summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-01-16 10:12:25 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-01-16 10:12:25 +0000
commit7d3de4e01ec11a553f46fea48c5733e6ab25e91d (patch)
treeb0b7c1887ca426fc9056803f74983f04640513cc /www
parentbacc8ecb70663a0b3a4a06f884eb45db0ece989e (diff)
downloadsemanticscuttle-7d3de4e01ec11a553f46fea48c5733e6ab25e91d.tar.gz
semanticscuttle-7d3de4e01ec11a553f46fea48c5733e6ab25e91d.tar.bz2
add pubdate and latest change date to rss feed
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@589 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'www')
-rw-r--r--www/rss.php31
1 files changed, 18 insertions, 13 deletions
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);