<?
header ("Content-type: application/rss+xml");
 
include_once('../lib/config.php');
include_once(_SITEPATH.'lib/functions.php');
open_connection();

//. include RSS gen
require (_SITEPATH."lib/class.rss.genesis.php");

$rss = new rssGenesis();

$rss->setChannel (
				_SITE.' Editors Blog', // Title
				_SITEURL.'xml/blog.xml', // Link
				'Editor\'s Blog from '._SITE, // Description
				'EN', // Language
				_SITE, // Copyright
				'Wendy Fisk', // Managing Editor
				'Wendy Fisk', // WebMaster
				null, // Rating
				"auto", // PubDate
				"auto", // Last Build Date
				"Blogs", // Category
				' ', // Docs
				' ', // Time to Live
				' ', // Skip Days
				' ' // Skip Hours
				);

// IMAGE
/*$rss->setImage (
				null, // Title
				null, // Source
				null, // Link
				"auto", // Width
				"auto", // Height
				null // Description
				);
*/

$qSQL = 'SELECT id, title, body
		FROM sn_articles 
		WHERE articletype_id = 23 
		AND type_id = 1
		AND active = 1
		ORDER BY displaydate DESC';
	
$rss_rs = mysql_query($qSQL);

while ($row = mysql_fetch_array($rss_rs))
{
	$link = _SITEURL.'editors_blogs.php#article_'.$row["id"];
	if ($row["title"] != '' && $link != '')
	{
		$rss->addItem (
						$row["title"], // Title
						$link, // Link
						truncatetext(strip_tags($row["body"]),254), // Description
						$row["displaydate"], //.
						'Blogs' //. category
						);
	}
}

$rss->createFile('show');
?>