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
This commit is contained in:
parent
9bcab8c363
commit
d5bb000998
2 changed files with 31 additions and 1 deletions
|
@ -378,6 +378,22 @@ $defaultRecentDays = 14;
|
||||||
*/
|
*/
|
||||||
$defaultOrderBy = 'date_desc';
|
$defaultOrderBy = 'date_desc';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of entries that are shown in
|
||||||
|
* the RSS feed by default.
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
$defaultRssEntries = 15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of entries the RSS puts out
|
||||||
|
* at maximum.
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
$maxRssEntries = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect all bookmarks through $url_redir to improve privacy.
|
* Redirect all bookmarks through $url_redir to improve privacy.
|
||||||
*
|
*
|
||||||
|
|
16
www/rss.php
16
www/rss.php
|
@ -2,6 +2,10 @@
|
||||||
/**
|
/**
|
||||||
* RSS output of the latest posts.
|
* RSS output of the latest posts.
|
||||||
*
|
*
|
||||||
|
* Parameter:
|
||||||
|
* - count=15
|
||||||
|
* Sets the number of RSS entries to export
|
||||||
|
*
|
||||||
* SemanticScuttle - your social bookmark manager.
|
* SemanticScuttle - your social bookmark manager.
|
||||||
*
|
*
|
||||||
* PHP version 5.
|
* PHP version 5.
|
||||||
|
@ -46,6 +50,16 @@ if ($usecache) {
|
||||||
$cacheservice->Start($hash, 3600);
|
$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;
|
$watchlist = null;
|
||||||
$pagetitle = '';
|
$pagetitle = '';
|
||||||
if ($user && $user != 'all') {
|
if ($user && $user != 'all') {
|
||||||
|
@ -80,7 +94,7 @@ $tplVars['feedlink'] = ROOT;
|
||||||
$tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOBALS['sitename']);
|
$tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOBALS['sitename']);
|
||||||
|
|
||||||
$bookmarks = $bookmarkservice->getBookmarks(
|
$bookmarks = $bookmarkservice->getBookmarks(
|
||||||
0, 15, $userid, $cat,
|
0, $rssEntries, $userid, $cat,
|
||||||
null, getSortOrder(), $watchlist
|
null, getSortOrder(), $watchlist
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue