summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-03-03 11:20:12 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-03-03 11:20:12 +0100
commitfa3fcd9ba1c888d61846546869043c0db8d92425 (patch)
tree787e5bf20f4be0f8d959eb78093d6f3d8f99c81e /feed.php
parent2825d176835aa8dd6a958651f9c503895381f7f0 (diff)
downloadrpg-fa3fcd9ba1c888d61846546869043c0db8d92425.tar.gz
rpg-fa3fcd9ba1c888d61846546869043c0db8d92425.tar.bz2
revised wiki:dokuwiki page
darcs-hash:20060303102012-7ad00-56d4ffdd28b89af5cc6bc7f16c32f78beee2d782.gz
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/feed.php b/feed.php
index 7cda26032..9636e6555 100644
--- a/feed.php
+++ b/feed.php
@@ -41,20 +41,20 @@
$type = 'RSS1.0';
}
- // the feed is dynamic - we need a cache for each combo
+ // the feed is dynamic - we need a cache for each combo
// (but most people just use the default feed so it's still effective)
- $cache = getCacheName($num.$type.$mode.$ns.$ltype.$_SERVER['REMOTE_USER'],'.feed');
+ $cache = getCacheName($num.$type.$mode.$ns.$ltype.$_SERVER['REMOTE_USER'],'.feed');
- // check cacheage and deliver if nothing has changed since last
+ // check cacheage and deliver if nothing has changed since last
// time (with 5 minutes settletime)
- $cmod = @filemtime($cache); // 0 if not exists
- if($cmod && ($cmod+(5*60) >= @filemtime($conf['changelog']))){
- header('Content-Type: application/xml; charset=utf-8');
- print io_readFile($cache);
- exit;
+ $cmod = @filemtime($cache); // 0 if not exists
+ if($cmod && ($cmod+(5*60) >= @filemtime($conf['changelog']))){
+ header('Content-Type: application/xml; charset=utf-8');
+ print io_readFile($cache);
+ exit;
}
- // create new feed
+ // create new feed
$rss = new DokuWikiFeedCreator();
$rss->title = $conf['title'].(($ns) ? ' '.$ns : '');
$rss->link = DOKU_URL;
@@ -74,11 +74,11 @@
}
$feed = $rss->createFeed($type,'utf-8');
-
+
// save cachefile
- io_saveFile($cache,$feed);
+ io_saveFile($cache,$feed);
- // finally deliver
+ // finally deliver
header('Content-Type: application/xml; charset=utf-8');
print $feed;
@@ -97,7 +97,7 @@ function rssRecentChanges(&$rss,$num,$ltype,$ns,$minor){
$guardmail = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');
- $flags = RECENTS_SKIP_DELETED;
+ $flags = RECENTS_SKIP_DELETED;
if(!$minor) $flags += RECENTS_SKIP_MINORS;
$recents = getRecents(0,$num,$ns,$flags);
@@ -105,12 +105,12 @@ function rssRecentChanges(&$rss,$num,$ltype,$ns,$minor){
//this can take some time if a lot of recaching has to be done
@set_time_limit(90); // set max execution time
- foreach($recents as $recent){
+ foreach($recents as $recent){
$item = new FeedItem();
$item->title = $recent['id'];
$xhtml = p_wiki_xhtml($recent['id'],'',false);
-
+
if($conf['useheading']) {
$matches = array();
if(preg_match('|<h([1-9])>(.*?)</h\1>|', $xhtml, $matches))
@@ -142,13 +142,13 @@ function rssRecentChanges(&$rss,$num,$ltype,$ns,$minor){
$item->description = $desc;
$item->date = date('r',$recent['date']);
- $cat = getNS($recent['id']);
- if($cat) $item->category = $cat;
-
+ $cat = getNS($recent['id']);
+ if($cat) $item->category = $cat;
+
$user = null;
$user = @$recent['user']; // the @ spares time repeating lookup
$item->author = '';
-
+
if($user){
$userInfo = $auth->getUserData($user);
$item->author = $userInfo['name'];
@@ -199,7 +199,7 @@ function rssListNamespace(&$rss,$ns){
$item->description = $desc;
$item->date = date('r',$date);
$rss->addItem($item);
- }
+ }
}
/**