summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/rss.tpl.php12
-rw-r--r--www/rss.php31
2 files changed, 23 insertions, 20 deletions
diff --git a/data/templates/rss.tpl.php b/data/templates/rss.tpl.php
index 0f03c06..87c86e7 100644
--- a/data/templates/rss.tpl.php
+++ b/data/templates/rss.tpl.php
@@ -1,12 +1,13 @@
<?php
-echo '<?xml version="1.0" encoding="UTF-8" ?'.">\n";
+echo '<' . '?xml version="1.0" encoding="UTF-8" ?' . ">\n";
?>
-
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title><?php echo $feedtitle; ?></title>
<link><?php echo $feedlink; ?></link>
<description><?php echo $feeddescription; ?></description>
+ <pubDate><?php echo date('r'); ?></pubDate>
+ <lastBuildDate><?php echo $feedlastupdate ?></lastBuildDate>
<ttl>60</ttl>
<?php foreach($bookmarks as $bookmark): ?>
@@ -16,13 +17,10 @@ echo '<?xml version="1.0" encoding="UTF-8" ?'.">\n";
<description><?php echo $bookmark['description']; ?></description>
<dc:creator><?php echo $bookmark['creator']; ?></dc:creator>
<pubDate><?php echo $bookmark['pubdate']; ?></pubDate>
-
- <?php foreach($bookmark['tags'] as $tag): ?>
+<?php foreach($bookmark['tags'] as $tag): ?>
<category><?php echo $tag; ?></category>
- <?php endforeach; ?>
-
+<?php endforeach; ?>
</item>
<?php endforeach; ?>
-
</channel>
</rss> \ No newline at end of file
diff --git a/www/rss.php b/www/rss.php
index 945c8e2..82d9319 100644
--- a/www/rss.php
+++ b/www/rss.php
@@ -79,34 +79,39 @@ $tplVars['feedtitle'] = filter($GLOBALS['sitename'] . (isset($pagetitle) ? $page
$tplVars['feedlink'] = ROOT;
$tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOBALS['sitename']);
-$bookmarks =& $bookmarkservice->getBookmarks(0, 15, $userid, $cat, null, getSortOrder(), $watchlist);
+$bookmarks = $bookmarkservice->getBookmarks(
+ 0, 15, $userid, $cat,
+ null, getSortOrder(), $watchlist
+);
-$bookmarks_tmp =& filter($bookmarks['bookmarks']);
+$bookmarks_tmp = filter($bookmarks['bookmarks']);
$bookmarks_tpl = array();
-foreach (array_keys($bookmarks_tmp) as $key) {
- $row =& $bookmarks_tmp[$key];
-
+$latestdate = null;
+foreach ($bookmarks_tmp as $key => $row) {
$_link = $row['bAddress'];
// Redirection option
if ($GLOBALS['useredir']) {
$_link = $GLOBALS['url_redir'] . $_link;
}
- $_pubdate = gmdate("r", strtotime($row['bDatetime']));
- // array_walk($row['tags'], 'filter');
+ if ($row['bDatetime'] > $latestdate) {
+ $latestdate = $row['bDatetime'];
+ }
+ $_pubdate = gmdate('r', strtotime($row['bDatetime']));
$bookmarks_tpl[] = array(
- 'title' => $row['bTitle'],
- 'link' => $_link,
+ 'title' => $row['bTitle'],
+ 'link' => $_link,
'description' => $row['bDescription'],
- 'creator' => $row['username'],
- 'pubdate' => $_pubdate,
- 'tags' => $row['tags']
+ 'creator' => $row['username'],
+ 'pubdate' => $_pubdate,
+ 'tags' => $row['tags']
);
}
unset($bookmarks_tmp);
unset($bookmarks);
-$tplVars['bookmarks'] =& $bookmarks_tpl;
+$tplVars['bookmarks'] = $bookmarks_tpl;
+$tplVars['feedlastupdate'] = date('r', strtotime($latestdate));
$templateservice->loadTemplate('rss.tpl', $tplVars);