corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
<?php
// start the loop..
$total_articles = count ($whole_blog);
for ($i=0;$i < $total_articles;$i++) {
$z = $i + 1;
if ($z == $total_articles) {
break; // we reached the end of the articles
} else {
// okay, we have an article
$blog = $whole_blog[$i];
// split the article into its parts..
$parts = explode('<!--*g*-->', $blog);
$blog_title = strip_tags($parts[1]); // the title
// we need a valid "encoded" version of the link..
$enc_title = rawurlencode(strip_tags($parts[1]));
// grab the first two paragraphs for the news preview.
// it may go over 500 chrs, och well, we could check for that.
$the_blog = explode("<br />", $parts[2]);
$snippet = htmlspecialchars(strip_tags($the_blog[0]))
.htmlspecialchars(strip_tags($the_blog[1]))
.htmlspecialchars(strip_tags($the_blog[2])); // what a pain!
// now create the <item> element..
echo '<item>',"\n";
echo '<title>',$blog_title,'</title>',"\n";
echo '<description>',$snippet,' ...</description>',"\n";
echo '<link>',$blogurl,'index.php#',$enc_title,'</link>',"\n";
echo '</item>',"\n\n";
}
} // and loop until we reach the end of the blog
echo '</channel>',"\n";
echo '</rss>';
?>