|
@@ -12,17 +12,14 @@ if(!defined('entry')) define('entry',true);
|
12
|
12
|
=========================== */
|
13
|
13
|
?>
|
14
|
14
|
<?php
|
15
|
|
- header("Content-type: text/xml; charset=utf-8");
|
16
|
15
|
$isFeed = true;
|
17
|
16
|
|
18
|
17
|
require('entry.php');
|
19
|
18
|
global $user, $conf, $tumble;
|
20
|
19
|
$f = new feeds();
|
21
|
|
-
|
22
|
|
- echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
23
|
|
-?>
|
24
|
|
- <gelato version="1.0">
|
25
|
|
-<?php
|
|
20
|
+
|
|
21
|
+ $theme = new themes;
|
|
22
|
+
|
26
|
23
|
if (isset($_GET["action"]) && $_GET["action"] == "read") {
|
27
|
24
|
if (isset($_GET["start"])) { $start = $_GET["start"]; } else { $start = 0; }
|
28
|
25
|
if (isset($_GET["total"])) { $total = $_GET["total"]; } else { $total = 20; }
|
|
@@ -30,122 +27,79 @@ if(!defined('entry')) define('entry',true);
|
30
|
27
|
if ($total > 50) { $total = 50; }
|
31
|
28
|
$user = new user();
|
32
|
29
|
$userData = $user->getUserByID(1);
|
33
|
|
- $username = ($userData["name"] == "") ? "gelato" : $userData["name"];
|
34
|
|
-?>
|
35
|
|
- <tumblelog name="<?php echo $username;?>" timezone="<?php echo $conf->offsetCity;?>" title="<?php echo $conf->title;?>">
|
36
|
|
-<?php
|
37
|
|
- echo "\n\t".$conf->description."\n";
|
38
|
|
-?>
|
39
|
|
- <feeds>
|
40
|
|
-<?php
|
41
|
|
- $actual_feeds = $f->getFeedList();
|
42
|
|
- foreach($actual_feeds as $feed){
|
43
|
|
- $error_text = ($feed["error"]>0) ? "false" : "true";
|
44
|
|
-?>
|
45
|
|
- <feed id="<?php echo $feed["id_feed"];?>" url="<?php echo htmlspecialchars($feed["url"]);?>" import-type="<?php echo util::type2Text($feed["type"]);?>" next-update-in-seconds="<? echo $f->getNextUpdate($feed["id_feed"]);?>" title="<?php echo htmlspecialchars($feed["title"]);?>" error-text="<? echo $error_text;?>"/>
|
46
|
|
-<?php
|
47
|
|
- }
|
48
|
|
-?>
|
49
|
|
- </feeds>
|
50
|
|
- </tumblelog>
|
|
30
|
+ $username = ($userData["name"] == "") ? "gelato" : $userData["name"];
|
|
31
|
+
|
|
32
|
+ $theme->set("username",$username);
|
|
33
|
+ $theme->set("conf",array(
|
|
34
|
+ "offsetCity"=>$conf->offsetCity,
|
|
35
|
+ "title"=>$conf->title,
|
|
36
|
+ "description"=>$conf->description
|
|
37
|
+ ));
|
|
38
|
+
|
|
39
|
+ $feeds = array();
$actual_feeds = $f->getFeedList();
|
|
40
|
+ foreach($actual_feeds as $feed){
|
|
41
|
+ $error_text = ($feed["error"]>0) ? "false" : "true";
|
|
42
|
+ $feed['url'] = htmlspecialchars($feed['url']);
|
|
43
|
+ $feed['type'] = util::type2Text($feed['type']);
|
|
44
|
+ $feed['getNextUpdate'] = $f->getNextUpdate($feed['id_feed']);
|
|
45
|
+ $feed['title'] = htmlspecialchars($feed['title']);
|
|
46
|
+ $feed['error_text'] = $error_text;
|
|
47
|
+ $feeds[] = $feed;
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
+ $theme->set("feeds",$feeds);
|
51
|
51
|
|
52
|
|
-<?php
|
53
|
52
|
if ($hasType) {
|
54
|
53
|
$postType = type2Number($_GET["type"]);
|
55
|
54
|
}
|
56
|
55
|
$rs = $tumble->getPosts($total, $start);
|
57
|
|
- if ($db->contarRegistros()>0) {
|
58
|
|
-?>
|
59
|
|
- <posts start="<?php echo $start; ?>" total="<?php echo $total; ?>">
|
60
|
|
-<?php
|
61
|
|
- while($register = mysql_fetch_array($rs)) {
|
62
|
|
- $desc = util::trimString($register["description"]);
|
|
56
|
+ if ($db->contarRegistros()>0) {
|
|
57
|
+ $theme->set("start",$start);
|
|
58
|
+ $theme->set("total",$total);
|
|
59
|
+
|
|
60
|
+ while($post = mysql_fetch_assoc($rs)){
|
|
61
|
+ $post['desc'] = util::trimString($post["description"]);
|
63
|
62
|
$strEnd = ($conf->urlFriendly) ? "/" : "";
|
64
|
|
- $url = $conf->urlGelato.($conf->urlFriendly ? "/post/" : "/index.php?post=").$register["id_post"].$strEnd;
|
65
|
|
- $formatedDate = gmdate("D, d M Y H:i:s", strtotime($register["date"]) + util::transform_offset($conf->offsetTime));
|
66
|
|
-
|
67
|
|
- switch ($register["type"]) {
|
68
|
|
- case "1":
|
|
63
|
+ $post['url'] = $conf->urlGelato.($conf->urlFriendly ? "/post/" : "/index.php?post=").$post["id_post"].$strEnd;
|
|
64
|
+ $post['formatedDate'] = gmdate("D, d M Y H:i:s", strtotime($post["date"]) + util::transform_offset($conf->offsetTime));
|
|
65
|
+
|
|
66
|
+ $post['type'] = util::type2Text($post["type"]);
|
69
|
67
|
|
70
|
|
- $tit = (empty($register["title"])) ? $desc : strip_tags($register["title"]);
|
71
|
|
-?>
|
72
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="regular" date="<?php echo $formatedDate;?>">
|
73
|
|
- <regular-title><?php echo $tit;?></regular-title>
|
74
|
|
- <regular-body><?php echo $desc;?></regular-body>
|
75
|
|
- </post>
|
76
|
|
-<?php
|
|
68
|
+ switch ($post["type"]) {
|
|
69
|
+ case "post":
|
|
70
|
+ $post['tit'] = (empty($post["title"])) ? $desc : strip_tags($post["title"]);
|
77
|
71
|
break;
|
78
|
|
- case "2":
|
79
|
|
- $tit = (empty($register["description"])) ? "Photo" : $desc;
|
80
|
|
-?>
|
81
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="photo" date="<?php echo $formatedDate;?>">
|
82
|
|
-<?php
|
83
|
|
- $photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
84
|
|
-?>
|
85
|
|
- <photo-caption><?php echo stripslashes($tit);?></photo-caption>
|
86
|
|
- <photo-url><?php echo $photoPath;?></photo-url>
|
87
|
|
- </post>
|
88
|
|
-<?php
|
|
72
|
+ case "photo":
|
|
73
|
+ $post['photoPath'] = str_replace("../", $conf->urlGelato."/", $post["url"]);
|
|
74
|
+ $post['tit'] = stripslashes(((empty($post["description"])) ? "Photo" : $post['desc']));
|
89
|
75
|
break;
|
90
|
|
- case "3":
|
91
|
|
-?>
|
92
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="quote" date="<?php echo $formatedDate;?>">
|
93
|
|
- <quote-text><?php echo $desc; ?></quote-text>
|
94
|
|
- <quote-source><?php echo strip_tags($register["title"]); ?></quote-source>
|
95
|
|
- </post>
|
96
|
|
-<?php
|
|
76
|
+ case "quote":
|
|
77
|
+ $post['title'] = strip_tags($post["title"]);
|
97
|
78
|
break;
|
98
|
|
- case "4":
|
99
|
|
- $tit = (empty($register["title"])) ? $register["url"] : strip_tags($register["title"]);
|
100
|
|
-?>
|
101
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="link" date="<?php echo $formatedDate;?>">
|
102
|
|
- <link-text><?php echo $tit; ?></link-text>
|
103
|
|
- <link-url><?php echo $register["url"]; ?></link-url>
|
104
|
|
- </post>
|
105
|
|
-<?php
|
|
79
|
+ case "url":
|
|
80
|
+ $post['tit'] = (empty($post["title"])) ? $post["url"] : strip_tags($post["title"]);
|
106
|
81
|
break;
|
107
|
|
- case "5":
|
|
82
|
+ case "conversation":
|
108
|
83
|
$lines = explode("\n", $desc);
|
109
|
84
|
$line = $lines[0];
|
110
|
|
- $tit = (empty($register["title"])) ? trimString($line) : $register["title"];
|
111
|
|
- $desc = $tumble->formatConversation($desc);
|
112
|
|
-?>
|
113
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="conversation" date="<?php echo $formatedDate;?>">
|
114
|
|
- <conversation-title><?php echo $tit; ?></conversation-title>
|
115
|
|
- <conversation-text><?php echo $desc; ?></conversation-text>
|
116
|
|
- <?php echo $tumble->formatApiConversation($desc); ?>
|
117
|
|
- </post>
|
118
|
|
-<?php
|
|
85
|
+ $post['tit'] = (empty($post["title"])) ? trimString($line) : $post["title"];
|
|
86
|
+ $post['desc'] = $tumble->formatConversation($desc);
|
|
87
|
+ $post['descAPIFormat'] = $tumble->formatConversation($desc);
|
119
|
88
|
break;
|
120
|
|
- case "6":
|
121
|
|
- $tit = (empty($register["description"])) ? "Video" : $desc;
|
122
|
|
- $desc = $tumble->getVideoPlayer($register["url"]);
|
123
|
|
-?>
|
124
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="video" date="<?php echo $formatedDate;?>">
|
125
|
|
- <video-caption><?php echo $tit; ?></video-caption>
|
126
|
|
- <video-source><?php echo $register["url"]; ?></video-source>
|
127
|
|
- <video-player><?php echo htmlspecialchars($desc); ?></video-player>
|
128
|
|
- </post>
|
129
|
|
-<?php
|
|
89
|
+ case "video":
|
|
90
|
+ $post['tit'] = (empty($post["description"])) ? "Video" : $desc;
|
|
91
|
+ $post['desc'] = htmlspecialchars($tumble->getVideoPlayer($post["url"]));
|
130
|
92
|
break;
|
131
|
|
-
|
132
|
|
- case "7":
|
133
|
|
- $tit = (empty($register["description"])) ? "Audio" : $desc;
|
134
|
|
- $desc = $tumble->getMp3Player($register["url"]);
|
135
|
|
-?>
|
136
|
|
- <post id="<?php echo $register["id_post"]; ?>" url="<?php echo $url;?>" type="audio" date="<?php echo $formatedDate;?>">
|
137
|
|
- <audio-caption><?php echo $tit; ?></audio-caption>
|
138
|
|
- <audio-player><?php echo htmlspecialchars($desc); ?></audio-player>
|
139
|
|
- </post>
|
140
|
|
-<?php
|
|
93
|
+ case "mp3":
|
|
94
|
+ $post['tit'] = (empty($post["description"])) ? "Audio" : $desc;
|
|
95
|
+ $desc = htmlspecialchars($tumble->getMp3Player($post["url"]));
|
141
|
96
|
break;
|
142
|
|
-
|
143
|
|
- }
|
144
|
|
- }
|
145
|
|
-?>
|
146
|
|
- </posts>
|
147
|
|
-<?php
|
|
97
|
+ }
|
|
98
|
+ $posts[] = $post;
|
|
99
|
+ }
|
|
100
|
+ $theme->set("posts",$posts);
|
148
|
101
|
}
|
149
|
|
- }
|
150
|
|
-?>
|
151
|
|
- </gelato>
|
|
102
|
+ }
|
|
103
|
+
|
|
104
|
+$theme->display(Absolute_Path.'admin/themes/admin/api.xml');
|
|
105
|
+?>
|