summaryrefslogtreecommitdiff
path: root/www/rss.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-01-16 10:15:19 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-01-16 10:15:19 +0000
commitd5bb0009986f868d719a29cd87c0e9520bd94df7 (patch)
tree97f973219b96bafcd40e3a25b498d968a46dd1f7 /www/rss.php
parent9bcab8c363da59f61086ec6ac9b7d77a75c5c8a4 (diff)
downloadsemanticscuttle-d5bb0009986f868d719a29cd87c0e9520bd94df7.tar.gz
semanticscuttle-d5bb0009986f868d719a29cd87c0e9520bd94df7.tar.bz2
Part of bug #2928950: add support for "count" parameter in rss feed and add config options for default and maximum rss feed entries
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@591 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'www/rss.php')
-rw-r--r--www/rss.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/www/rss.php b/www/rss.php
index 82d9319..6b0625e 100644
--- a/www/rss.php
+++ b/www/rss.php
@@ -2,6 +2,10 @@
/**
* RSS output of the latest posts.
*
+ * Parameter:
+ * - count=15
+ * Sets the number of RSS entries to export
+ *
* SemanticScuttle - your social bookmark manager.
*
* PHP version 5.
@@ -46,6 +50,16 @@ if ($usecache) {
$cacheservice->Start($hash, 3600);
}
+if (isset($_GET['count'])) {
+ $rssEntries = (int)$_GET['count'];
+}
+if ($rssEntries <= 0) {
+ $rssEntries = $defaultRssEntries;
+} else if ($rssEntries > $maxRssEntries) {
+ $rssEntries = $maxRssEntries;
+}
+
+
$watchlist = null;
$pagetitle = '';
if ($user && $user != 'all') {
@@ -80,7 +94,7 @@ $tplVars['feedlink'] = ROOT;
$tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOBALS['sitename']);
$bookmarks = $bookmarkservice->getBookmarks(
- 0, 15, $userid, $cat,
+ 0, $rssEntries, $userid, $cat,
null, getSortOrder(), $watchlist
);