On Tue, 2003-07-15 at 00:33, Pascal Van Hecke (Yahoo) wrote:
> Hi,
Greetings!
> I want to turn the articles in a topic into an rss feed.
> Anybody has code to share?
> Difficulty: I 'm unable to use both MidCom and repligard.
Here is what we do in the Aegir Sample Site template:
<?php
echo "<?xml version=\"1.0\"?>\n";
?>
<rss version="2.0">
<channel>
<title>&(site[title]);</title>
<link>&(site[url]);</link>
<language>en-us</language>
<generator>Midgard <?php echo mgd_version(); ?></generator>
<?php
if ($news_topic) {
$newstopicname = rawurlencode($news_topic->name);
$news = mgd_list_topic_articles($news_topic->id);
if ($news) {
while ($news->fetch()) {
$newsname = rawurlencode($news->name);
$description = substr(strip_tags($news->content),0,500);
$guid = $news->guid();
$pubDate = date('r',$news->created);
?>
<item>
<title>&(news.title);</title>
<description>&(description);</description>
<link>&(site[url]);&(newstopicname);/&(newsname);.html</link>
<guid isPermaLink="false">&(guid);@Midgard</guid>
<pubDate>&(pubDate);</pubDate>
</item>
<?php
}
}
} ?>
</channel>
</rss>
> Pascal Van Hecke
/Bergie
--
Henri Bergius [EMAIL PROTECTED]
Consultant Partner Tel: +358-20-198 6032
Nemein Oy http://www.nemein.com/
Nemein.Net -- Project tracking solution for consulting companies
http://www.nemein.com/Nemein.Net/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]