summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-05-25 11:47:07 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-05-25 11:47:07 +0200
commited74b60ead82d59fe4b53ec8ce6a8c0c830debc5 (patch)
treefaa7633ea0c64ae961974c97d3d8c81adf2dc366 /feed.php
parent6ebb44cb82f27dd826759fcb8e4a450452fd3635 (diff)
parent477e59988f5e90600b6fdcda7c055ab8ea001e03 (diff)
downloadrpg-ed74b60ead82d59fe4b53ec8ce6a8c0c830debc5.tar.gz
rpg-ed74b60ead82d59fe4b53ec8ce6a8c0c830debc5.tar.bz2
Merge pull request #626 from splitbrain/feedmodelistsort
Added sort by date option to feed in list mode
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/feed.php b/feed.php
index 996b1ba6b..a63e22164 100644
--- a/feed.php
+++ b/feed.php
@@ -127,6 +127,8 @@ function rss_parseOptions() {
'items' => array('int', 'num', $conf['recent']),
// Boolean, only used in rc mode
'show_minor' => array('bool', 'minor', false),
+ // String, only used in list mode
+ 'sort' => array('str', 'sort', 'natural'),
// String, only used in search mode
'search_query' => array('str', 'q', null),
// One of: pages, media, both
@@ -138,6 +140,7 @@ function rss_parseOptions() {
$opt['items'] = max(0, (int) $opt['items']);
$opt['show_minor'] = (bool) $opt['show_minor'];
+ $opt['sort'] = valid_input_set('sort', array('default' => 'natural', 'date'), $opt);
$opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');
@@ -480,7 +483,7 @@ function rssListNamespace($opt) {
global $conf;
$ns = ':'.cleanID($opt['namespace']);
- $ns = str_replace(':', '/', $ns);
+ $ns = utf8_encodeFN(str_replace(':', '/', $ns));
$data = array();
$search_opts = array(
@@ -488,7 +491,7 @@ function rssListNamespace($opt) {
'pagesonly' => true,
'listfiles' => true
);
- search($data, $conf['datadir'], 'search_universal', $search_opts, $ns);
+ search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $opt['sort']);
return $data;
}