diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-11-26 14:18:00 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-11-26 14:18:00 +0100 |
commit | 85cf819573ef2051171653402428ec33f0a9f4a6 (patch) | |
tree | f7c8dbdefe596c1e9e1da4a51f9c94921048b693 /feed.php | |
parent | cc2ae8020e0560794472a8f7e1526bab4c883dbd (diff) | |
download | rpg-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.php | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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); |