<?php // ۞// text { encoding:utf-8 ; bom:no ; linebreaks:unix ; tabs:4sp ; }

// begin by sending the correct header..
header('content-type: application/rss+xml');

// for my site logger, and other stuff
@include $_SERVER['DOCUMENT_ROOT'].'/inc/init.php';
require(
'config.php');

echo 
'<?xml version="1.0" encoding="UTF-8"?>'."\n"// put this first, just in case

/*
    outputs an RSS (0.91 spec) feed for corzblog
    see rdf.php for details of what this file does

    (c) 2003->tomorrow! ~ cor + corz.org ;o)

    Please view the license for this free software, here:

        http://corz.org/free-scripts-licence.nfo
*/

if (!function_exists('str_split')) {
    function 
str_split($str$len=1$brk=':') {
    return 
explode($brkchunk_split($str$len$brk));
    }
}

echo 
'<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"';
echo 
' "http://my.netscape.com/publish/formats/rss-0.91.dtd">'."\n";
echo 
'<rss version="0.91">'."\n\n";
echo 
'<channel>'."\n";
echo 
'<title>',$corzblog['mysite'],'</title>'."\n";
echo 
'<link>',$corzblog['blog_url'],'</link>'."\n";
echo 
'<description>',htmlentities($corzblog['description']),'.. powered by corzblog</description>'."\n";
echo 
'<language>en-gb</language>'."\n";
echo 
'<copyright>content (c) ',date('Y'),' - ',$corzblog['host'],
', corzblog syndication (c) 2003 - ',date('Y'),' http://corz.org/ </copyright>'."\n";
echo 
'<managingEditor>',mail_mash($corzblog['mail_addy']),'</managingEditor>'."\n";
echo 
'<webMaster>',mail_mash($corzblog['mail_addy']),'</webMaster>'."\n\n";
echo 
'<image>'."\n";
echo 
'<title>',$corzblog['mysite'],'</title>'."\n";;
echo 
'<url>',$corzblog['blog_url'],'inc/img/corzblog.png</url>'."\n";
echo 
'<link>',$corzblog['blog_url'],'</link>'."\n";
echo 
'</image>'."\n\n";

// open and split the blog into an array of blog entries..
$fp fopen($corzblog['blog_file'], 'rb');
$file_contents = @fread($fpfilesize($corzblog['blog_file'])); // @ you may be updating
fclose($fp);
$whole_blog explode('<!--*end*-->'$file_contents);

// 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 trim(strip_tags($parts[1])); // the title
        // we need a valid "encoded" version of the link..
        
$enc_title do_valid_id($blog_title);
        
$the_blog strip_tags($parts[2]);
        
$snippet str_split($the_blog256); // the description

        // now create the <item> element..
        
echo '<item>'."\n";
        echo 
'<title>',$blog_title,'</title>'."\n";
        echo 
'<description>',$snippet[0],' ...</description>'."\n";
        echo 
'<link>',$corzblog['blog_url'],'index.php#',$enc_title,'</link>'."\n";
        echo 
'</item>'."\n\n";
    }
}

echo 
'</channel>'."\n";
echo 
'</rss>';


?>
back to the source menu
downloadtest

Welcome to corz.org!

I'm currently setting up a new web server, please bear with me.. See a bug? Mail me!