|
@@ -14,10 +14,6 @@ if(!defined('entry')) define('entry',true);
|
14
|
14
|
<?php
|
15
|
15
|
header("Content-type: text/xml; charset=utf-8");
|
16
|
16
|
|
17
|
|
- require(dirname(__FILE__)."/config.php");
|
18
|
|
- include("classes/configuration.class.php");
|
19
|
|
- include("classes/gelato.class.php");
|
20
|
|
- include("classes/textile.class.php");
|
21
|
17
|
$isFeed = true;
|
22
|
18
|
$tumble = new gelato();
|
23
|
19
|
$conf = new configuration();
|
|
@@ -29,14 +25,14 @@ if(!defined('entry')) define('entry',true);
|
29
|
25
|
|
30
|
26
|
if (isset($_GET["action"]) && $_GET["action"] == "read") {
|
31
|
27
|
if (isset($_GET["start"])) { $start = $_GET["start"]; } else { $start = 0; }
|
32
|
|
- if (isset($_GET["num"])) { $num = $_GET["num"]; } else { $num = 20; }
|
33
|
|
- if (isset($_GET["type"])) { $type = $_GET["type"]; } else { $type = null; }
|
34
|
|
- if ($num > 50) { $num = 50; }
|
|
28
|
+ if (isset($_GET["total"])) { $total = $_GET["total"]; } else { $total = 20; }
|
|
29
|
+ if (isset($_GET["type"])) { $hasType = true; } else { $hasType = false; }
|
|
30
|
+ if ($total > 50) { $total = 50; }
|
35
|
31
|
?>
|
36
|
32
|
<tumblelog name="<?php echo $_SESSION["user_login"];?>" timezone="<?php echo $conf->offsetCity;?>" title="<?php echo $conf->title;?>"><?php echo $conf->description;?></tumblelog>
|
37
|
33
|
|
38
|
34
|
<?php
|
39
|
|
- switch ($type) {
|
|
35
|
+ switch ($hasType) {
|
40
|
36
|
case "post":
|
41
|
37
|
$_GET["type"] = "1";
|
42
|
38
|
break;
|
|
@@ -59,65 +55,86 @@ if(!defined('entry')) define('entry',true);
|
59
|
55
|
$_GET["type"] = "7";
|
60
|
56
|
break;
|
61
|
57
|
}
|
62
|
|
- $rs = $tumble->getPosts($num, $start);
|
|
58
|
+ $rs = $tumble->getPosts($total, $start);
|
63
|
59
|
if ($tumble->contarRegistros()>0) {
|
64
|
60
|
?>
|
65
|
|
- <posts start="<?php echo $start; ?>" total="<?php echo $num; ?>">
|
66
|
|
-<?php/*
|
|
61
|
+ <posts start="<?php echo $start; ?>" total="<?php echo $total; ?>">
|
|
62
|
+<?php
|
67
|
63
|
while($register = mysql_fetch_array($rs)) {
|
68
|
|
-
|
69
|
|
- $textile = new Textile();
|
70
|
|
- $register["description"] = $textile->TextileThis($register["description"]);
|
|
64
|
+ $desc = $register["description"];
|
|
65
|
+ $url = $conf->urlGelato."/index.php?post=".$register["id_post"];
|
|
66
|
+ $formatedDate = gmdate("D, d M Y H:i:s", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
71
|
67
|
|
72
|
68
|
switch ($register["type"]) {
|
73
|
69
|
case "1":
|
74
|
|
- $tit = ($register["title"]=="") ? strip_tags($register["description"]) : $register["title"];
|
75
|
|
- $desc = $register["description"];
|
|
70
|
+
|
|
71
|
+ $tit = ($register["title"]=="") ? $register["description"] : $register["title"];
|
|
72
|
+?>
|
|
73
|
+
|
|
74
|
+ <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="regular" date="<?php echo $formatedDate;?>">
|
|
75
|
+ <regular-title><?php echo $tit;?></regular-title>
|
|
76
|
+ <regular-body><?php echo $desc;?></regular-body>
|
|
77
|
+ </post>
|
|
78
|
+<?php
|
76
|
79
|
break;
|
77
|
80
|
case "2":
|
78
|
|
- $tit = ($register["description"]=="") ? "Photo" : strip_tags($register["description"]);
|
79
|
|
- $desc = "<img src=\"".$register["url"]."\"/>";
|
|
81
|
+ $tit = ($register["description"]=="") ? "Photo" : $register["description"];
|
|
82
|
+?>
|
|
83
|
+ <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="photo" date="<?php echo $formatedDate;?>">
|
|
84
|
+<?php
|
|
85
|
+ $photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
|
86
|
+?>
|
|
87
|
+ <photo-caption><?php echo $tit;?></photo-caption>
|
|
88
|
+ <photo-url><?php echo $photoPath;?></photo-url>
|
|
89
|
+ </post>
|
|
90
|
+<?php
|
80
|
91
|
break;
|
81
|
|
- case "3":
|
82
|
|
- $tit = "\"".strip_tags($register["description"])."\"";
|
83
|
|
- $tmpStr = ($register["title"]!="") ? "<br /><br /> - <em>".$register["title"]."</em>" : "";
|
84
|
|
- $desc = "\"".$register["description"]."\"".$tmpStr;
|
|
92
|
+ case "3":
|
|
93
|
+?>
|
|
94
|
+ <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="quote" date="<?php echo $formatedDate;?>">
|
|
95
|
+ <quote-text><?php echo $desc; ?></quote-text>
|
|
96
|
+ <quote-source><?php echo $register["title"]; ?></quote-source>
|
|
97
|
+ </post>
|
|
98
|
+<?php
|
85
|
99
|
break;
|
86
|
100
|
case "4":
|
87
|
101
|
$tit = ($register["title"]=="") ? $register["url"] : $register["title"];
|
88
|
|
- $tmpStr = ($register["description"]!="") ? "<br /><br /> - <em>".$register["description"]."</em>" : "";
|
89
|
|
- $desc = "<a href=\"".$register["url"]."\">".$tit."</a>".$tmpStr;
|
|
102
|
+?>
|
|
103
|
+ <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="link" date="<?php echo $formatedDate;?>">
|
|
104
|
+ <link-text><?php echo $tit; ?></link-text>
|
|
105
|
+ <link-url><?php echo $register["url"]; ?></link-url>
|
|
106
|
+ </post>
|
|
107
|
+<?php
|
90
|
108
|
break;
|
91
|
109
|
case "5":
|
92
|
110
|
$lines = explode("\n", $register["description"]);
|
93
|
111
|
$line = $lines[0];
|
94
|
112
|
$tit = ($register["title"]=="") ? $line : $register["title"];
|
95
|
113
|
$desc = $tumble->formatConversation($register["description"]);
|
|
114
|
+?>
|
|
115
|
+ <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="conversation" date="<?php echo $formatedDate;?>">
|
|
116
|
+ <conversation-title><?php echo $tit; ?></conversation-title>
|
|
117
|
+ <conversation-text><?php echo $register["description"]; ?></conversation-text>
|
|
118
|
+ <?php echo $tumble->formatApiConversation($register["description"]); ?>
|
|
119
|
+ </post>
|
|
120
|
+<?php
|
96
|
121
|
break;
|
|
122
|
+/*
|
97
|
123
|
case "6":
|
98
|
|
- $tit = ($register["description"]=="") ? "Video" : strip_tags($register["description"]);
|
|
124
|
+ $tit = ($register["description"]=="") ? "Video" : $register["description"];
|
99
|
125
|
$desc = $tumble->getVideoPlayer($register["url"]);
|
100
|
126
|
break;
|
101
|
127
|
case "7":
|
102
|
|
- $tit = ($register["description"]=="") ? "MP3" : strip_tags($register["description"]);
|
|
128
|
+ $tit = ($register["description"]=="") ? "MP3" : $register["description"];
|
103
|
129
|
$desc = $tumble->getMp3Player($register["url"]);
|
104
|
130
|
break;
|
|
131
|
+*/
|
105
|
132
|
}
|
106
|
133
|
$url = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
|
107
|
|
- $formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
108
|
|
-?>
|
109
|
|
-
|
110
|
|
- <item>
|
111
|
|
- <title><?php echo $tit;?></title>
|
112
|
|
- <description><![CDATA[<?php echo $desc;?>]]></description>
|
113
|
|
- <link><?php echo $url;?></link>
|
114
|
|
- <guid isPermaLink="true"><?php echo $conf->urlGelato."/index.php/post/".$register["id_post"]."/";?></guid>
|
115
|
|
- <pubDate><?php echo $formatedDate;?></pubDate>
|
116
|
|
- </item>
|
117
|
|
-
|
118
|
|
-<?php
|
|
134
|
+ $formatedDate = gmdate("D, d M Y H:i:s", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
119
|
135
|
}
|
120
|
|
-*/?>
|
|
136
|
+
|
|
137
|
+?>
|
121
|
138
|
</posts>
|
122
|
139
|
<?php
|
123
|
140
|
}
|