Thanks for all of your help.... here's the final file version that works:
<?php
/**
* jobber job board platform
*
* @author Filip C.T.E. <http://www.filipcte.ro> <me@filipcte.ro>
* @license You are free to edit and use this work, but it would be nice if you always referenced the original author 
* (see license.txt).
*
* Feed class displays RSS feeds
*/
require_once 'class.XmlWriter.php';
require_once 'class.RssWriter.php';
class Feed
{
var $mCategoryId = false;
var $mCategoryVarName = false;
function __construct($category = false)
{
global $db;
if ($category != 'all')
{
$sql = 'SELECT id
FROM categories
WHERE var_name = "' . $category . '"';
$result = $db->query($sql);
$row = $result->fetch_assoc();
$this->mCategoryId = $row['id'];
$this->mCategoryVarName = $category;
return 1;
}
else if ($category == 'all')
{
$this->mCategoryId = 'all';
}
else
{
return 0;
}
}
// Display a feed
public function Display()
{
global $db;
$rss_writer_object = new rss_writer_class;
$rss_writer_object->specification = '1.0';
$rss_writer_object->about = BASE_URL . 'rss.xml';
$rss_writer_object->rssnamespaces['dc']='http://purl.org/dc/elements/1.1/';
$properties = array();
if ($this->mCategoryId == 'all')
{
$properties['description'] = 'Latest jobs';
}
else
{
$properties['description'] = 'Latest jobs for ' . ucwords($this->mCategoryVarName);
}
$properties['link'] = BASE_URL;
$properties['title'] = SITE_NAME;
$properties['dc:date'] = date('c');
$rss_writer_object->addchannel($properties);
$count = 0;
$jobb = new Job();
if ($this->mCategoryId == 'all')
{
$jobs = $jobb->GetJobs(0, 0, 0, 0, 0, true);
}
else
{
$jobs = $jobb->GetJobs(0, $this->mCategoryId, 0, 0, 0, true);
}
foreach ($jobs as $job)
{
$count++;
if ($count > 10)
{
break;
}
$properties=array();
$properties['description'] = '<strong>Location:</strong> ' . $job['location'] . '<br />';
if ($job['url'] != '' && $job['url'] != 'http://')
{
$properties['description'] .= '<strong>URL:</strong> <a href="' . $job['url'] . '">' . $job['url'] . '</a><br /><br />';
}
$textile = new Textile();
$job['description'] = $textile->TextileThis($job['description']);
$properties['description'] .= '<strong>Description:</strong><br />' . $job['description'] . '<br /><br />';
$properties['description'] .= '<a href="' . BASE_URL . 'job/' . $job['id'] . '/' . $job['url_title'] . '/' . '">Apply to this job</a><br />';
$properties['link'] = BASE_URL . 'job/' . $job['id'] . '/' . $job['url_title'] . '/';
if ($job['type_id'] == JOBTYPE_FULLTIME)
{
$type = '[full-time]';
}
else if ($job['type_id'] == JOBTYPE_PARTTIME)
{
$type = '[part-time]';
}
else if ($job['type_id'] == JOBTYPE_FREELANCE)
{
$type = '[freelance]';
}
$properties['title'] = $type . ' ' . $job['title'] . ' at ' . $job['company'];
$properties['dc:date'] = str_replace(" ","T",$job['mysql_date'])
.substr_replace(date("O"),":",3,0);
$rss_writer_object->additem($properties);
}
if (empty($jobs))
{
$properties=array();
$properties['description'] = ' ';
$properties['description'] .= ' ';
$properties['link'] = ' ';
$properties['title'] = ' ';
$properties['dc:date'] = str_replace(" ","T",$job['mysql_date'])
.substr_replace(date("O"),":",3,0);
$rss_writer_object->additem($properties);
}
if($rss_writer_object->writerss($output))
{
header('Content-Type: text/xml; charset="utf-8"');
header('Content-Length: '.strval(strlen($output)));
echo $output;
}
else
{
//header('Content-Type: text/plain');
//echo ('Error: '.$rss_writer_object->error);
}
}
}
?>