We are using wiki in cases where there is lots of changes to the
existing pages, but new pages are coming much more rarely, so we
wanted to have option to make rss feed that only includes new pages,
not page modifications at all.
I made this change 2010 already, but didn't bother submitting it at
that time. Now when I updated our wikis to latest stable version I
decided to patch this change both to stable and latest snapshot, so I
can submit it as patch.
Included is the patch against the latest snapshot. It will allow
new option onlynewpages=1 in the feed.php link, and that will list
created pages in the feed.
--
kivinen@xxxxxx
diff -ur splitbrain-dokuwiki-aaf4f55/feed.php
splitbrain-dokuwiki-aaf4f55.patched/feed.php
--- splitbrain-dokuwiki-aaf4f55/feed.php 2016-12-01 12:45:32.000000000
+0200
+++ splitbrain-dokuwiki-aaf4f55.patched/feed.php 2016-12-03
18:34:05.000000000 +0200
@@ -127,6 +127,8 @@
'items' => array('int', 'num', $conf['recent']),
// Boolean, only used in rc mode
'show_minor' => array('bool', 'minor', false),
+ // Boolean, only used in rc mode
+ 'only_new' => array('bool', 'onlynewpages', false),
// String, only used in list mode
'sort' => array('str', 'sort', 'natural'),
// String, only used in search mode
@@ -140,6 +142,7 @@
$opt['items'] = max(0, (int) $opt['items']);
$opt['show_minor'] = (bool) $opt['show_minor'];
+ $opt['only_new'] = (bool) $opt['only_new'];
$opt['sort'] = valid_input_set('sort', array('default' => 'natural',
'date'), $opt);
$opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] !=
'none');
@@ -466,6 +469,7 @@
global $conf;
$flags = RECENTS_SKIP_DELETED;
if(!$opt['show_minor']) $flags += RECENTS_SKIP_MINORS;
+ if($opt['only_new']) $flags += RECENTS_ONLY_NEW_PAGES;
if($opt['content_type'] == 'media' && $conf['mediarevisions']) $flags +=
RECENTS_MEDIA_CHANGES;
if($opt['content_type'] == 'both' && $conf['mediarevisions']) $flags +=
RECENTS_MEDIA_PAGES_MIXED;
Only in splitbrain-dokuwiki-aaf4f55.patched: feed.php.orig
diff -ur splitbrain-dokuwiki-aaf4f55/inc/changelog.php
splitbrain-dokuwiki-aaf4f55.patched/inc/changelog.php
--- splitbrain-dokuwiki-aaf4f55/inc/changelog.php 2016-12-01
12:45:32.000000000 +0200
+++ splitbrain-dokuwiki-aaf4f55.patched/inc/changelog.php 2016-12-03
18:34:05.000000000 +0200
@@ -190,6 +190,7 @@
*
* RECENTS_SKIP_DELETED - don't include deleted pages
* RECENTS_SKIP_MINORS - don't include minor changes
+ * RECENTS_ONLY_NEW_PAGES - only include new created pages
* RECENTS_SKIP_SUBSPACES - don't include subspaces
* RECENTS_MEDIA_CHANGES - return media changes instead of page changes
* RECENTS_MEDIA_PAGES_MIXED - return both media changes and page changes
@@ -273,6 +274,7 @@
*
* RECENTS_SKIP_DELETED - don't include deleted pages
* RECENTS_SKIP_MINORS - don't include minor changes
+ * RECENTS_ONLY_NEW_PAGES - only include new created pages
* RECENTS_SKIP_SUBSPACES - don't include subspaces
* RECENTS_MEDIA_CHANGES - return media changes instead of page changes
*
@@ -347,6 +349,9 @@
// skip seen ones
if(isset($seen[$recent['id']])) return false;
+ // skip changes, of only new pages are requested
+ if($recent['type']!==DOKU_CHANGE_TYPE_CREATE && ($flags &
RECENTS_ONLY_NEW_PAGES)) return false;
+
// skip minors
if($recent['type']===DOKU_CHANGE_TYPE_MINOR_EDIT && ($flags &
RECENTS_SKIP_MINORS)) return false;
Only in splitbrain-dokuwiki-aaf4f55.patched/inc: changelog.php.orig
diff -ur splitbrain-dokuwiki-aaf4f55/inc/common.php
splitbrain-dokuwiki-aaf4f55.patched/inc/common.php
--- splitbrain-dokuwiki-aaf4f55/inc/common.php 2016-12-01 12:45:32.000000000
+0200
+++ splitbrain-dokuwiki-aaf4f55.patched/inc/common.php 2016-12-03
18:34:05.000000000 +0200
@@ -16,6 +16,7 @@
define('RECENTS_SKIP_SUBSPACES', 8);
define('RECENTS_MEDIA_CHANGES', 16);
define('RECENTS_MEDIA_PAGES_MIXED', 32);
+define('RECENTS_ONLY_NEW_PAGES', 64);
/**
* Wrapper around htmlspecialchars()
Only in splitbrain-dokuwiki-aaf4f55.patched/inc: common.php.orig