summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-11-26 14:18:00 +0100
committerAndreas Gohr <andi@splitbrain.org>2005-11-26 14:18:00 +0100
commit85cf819573ef2051171653402428ec33f0a9f4a6 (patch)
treef7c8dbdefe596c1e9e1da4a51f9c94921048b693 /feed.php
parentcc2ae8020e0560794472a8f7e1526bab4c883dbd (diff)
downloadrpg-85cf819573ef2051171653402428ec33f0a9f4a6.tar.gz
rpg-85cf819573ef2051171653402428ec33f0a9f4a6.tar.bz2
honor useheading in list feed mode #625
darcs-hash:20051126131800-7ad00-f8d8dd84e4aec36bc6a5abffee835dbc774c870c.gz
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/feed.php b/feed.php
index 7d4b2fa07..27cd04581 100644
--- a/feed.php
+++ b/feed.php
@@ -179,11 +179,20 @@ function rssListNamespace(&$rss,$ns){
sort($data);
search($data,$conf['datadir'],'search_list','',$ns);
foreach($data as $row){
- $id = $row['id'];
- $date = filemtime(wikiFN($id));
- $desc = cleanDesc(p_wiki_xhtml($id,'',false));
$item = new FeedItem();
+
+ $id = $row['id'];
+ $date = filemtime(wikiFN($id));
+ $xhtml = p_wiki_xhtml($id,'',false);
+ $desc = cleanDesc($xhtml);
$item->title = $id;
+
+ if($conf['useheading']) {
+ $matches = array();
+ if(preg_match('|<h([1-9])>(.*?)</h\1>|', $xhtml, $matches))
+ $item->title = trim($matches[2]);
+ }
+
$item->link = wl($id,'rev='.$date,true);
$item->description = $desc;
$item->date = date('r',$date);