class RSS {
private $ctitle;
private $cdescription;
private $clink;
private $language;
private $copyright;
private $ititle;
private $dtposted;
private $idescription;
private $ilink;
public $items;
function RSS ( )
{
header("Content-type: application/xml");
}
function setChannelTitle ( $ctitle )
{
$this->ctitle = $ctitle;
}
function setChannelLink ( $clink )
{
$this->clink = $clink;
}
function setChannelDesc ( $cdescription )
{
$this->cdescription = $cdescription;
}
function setLanguage ( $language )
{
$this->language = $language;
}
function setCopyRight ( $copyright )
{
$this->copyright = $copyright;
}
function setItemTitle ( $ititle )
{
$this->ititle = $ititle;
}
function setItemDesc ( $idescription )
{
$this->idescription = $idescription;
}
function setItemLink ( $ilink )
{
$this->ilink = $ilink;
}
function setDtPosted ( $dtposted )
{
$this->dtposted = $dtposted;
}
function getChannelTitle ( )
{
return $this->ctitle;
}
function getChannelLink ( )
{
return $this->clink;
}
function getChannelDesc ( )
{
return $this->cdescription;
}
function getLanguage ( )
{
return $this->language;
}
function getCopyRight ( )
{
return $this->copyright;
}
function getItemTitle ( )
{
return $this->ititle;
}
function getItemDesc ( )
{
return $this->idescription;
}
function getItemLink ( )
{
return $this->ilink;
}
function getDtPosted ( )
{
return date("r",$this->dtposted);
}
function newRSS ( )
{
$rss = "\n";
$rss .= "\n";
$rss .="\n";
if(!$this->getChannelTitle()) {
echo "No channel title.
";
return false;
}
else {
$rss .= "".$this->getChannelTitle()."\n";
}
if(!$this->getChannelLink()) {
echo "No chanel link.
";
return false;
}
else {
$rss .= "".$this->getChannelLink()."\n";
}
if($this->getChannelDesc()) {
$rss .= "".$this->getChannelDesc()."\n";
}
if($this->getLanguage()) {
$rss .= "".$this->getLanguage()."\n";
}
if($this->getCopyRight()) {
$rss .= "".$this->getCopyRight()."\n";
}
$rss .= "".date("r")."\n";
// $this->setItems();
$rss .= $this->items;
$rss .= "\n";
$rss .= "";
return $rss;
}
function setItems() {
$itm = "- \n";
if(!$this->getItemTitle()) {
echo "No Item title.";
return false;
}
else {
$itm .= "".$this->getItemTitle()."\n";
}
if($this->getItemDesc()) {
$itm .= "".$this->getItemDesc()."\n";
}
if(!$this->getItemLink()) {
echo "No link item.
";
return false;
}
else {
$itm .= "".$this->getItemLink()."\n";
}
if($this->getDtPosted()) {
$itm .= "".$this->getDtPosted()."\n";
}
$itm .= " \n";
$this->items .= $itm;
}
}
?>