PHP Classes
elePHPant
Icontem

File: RSS.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of James Logdson  >  Syndication Classes  >  RSS.php  >  Download  
File: RSS.php
Role: Example script
Content type: text/plain
Description: RSS Example
Class: Syndication Classes
Generate XML and RSS feeds
Author: By
Last change: Set $RSS->debug = true
Date: 9 years ago
Size: 2,219 bytes
 

Contents

Class file image Download
<?php

error_reporting
( E_ALL );

if ( isset (
$_GET['source'] ) AND $_GET['source'] == 1 )
{
    echo
'<a href=\'./RSS.php\'>Back</a><br />';
    echo
'<a href=\'./RSS.php?source=2\'>View SC_XML.class.php</a><br />';
    echo
'<a href=\'./RSS.php?source=3\'>View RSS.php</a><br />';
   
highlight_file ( './SC_RSS.class.php' );
    exit;
}
else if ( isset (
$_GET['source'] ) AND $_GET['source'] == 2 )
{
    echo
'<a href=\'./RSS.php\'>Back</a><br />';
    echo
'<a href=\'./RSS.php?source=1\'>View SC_RSS.class.php</a><br />';
    echo
'<a href=\'./RSS.php?source=3\'>View RSS.php</a><br />';
   
highlight_file ( './SC_XML.class.php' );
    exit;
}
else if ( isset (
$_GET['source'] ) AND $_GET['source'] == 3 )
{
    echo
'<a href=\'./RSS.php\'>Back</a><br />';
    echo
'<a href=\'./RSS.php?source=1\'>View SC_RSS.class.php</a><br />';
    echo
'<a href=\'./RSS.php?source=2\'>View SC_XML.class.php</a><br />';
   
highlight_file ( './RSS.php' );
    exit;
}

echo
'<a href=\'./RSS.php?source=1\'>View SC_RSS.class.php</a><br />';
echo
'<a href=\'./RSS.php?source=2\'>View SC_XML.class.php</a><br />';
echo
'<a href=\'./RSS.php?source=3\'>View RSS.php</a><br />';

require_once
"SC_RSS.class.php";

$info = Array (
   
'title' => 'Topic Title',
   
'link' => 'http://k4_bb_url.tld/viewtopic.php?id=234234',
   
'description' => 'Some information on the topic',
   
'pubDate' => date ( 'r' ),
   
'category' => 'Forum Cat/Forum Name'
);

$RSS = new SC_RSS ( $info );
$RSS->debug = true;

// Add posts
$post[1] = Array (
   
'title' => 'Topic Title',
   
'link' => 'http://k4_bb_url.tld/viewtopic.php?id=25#25',
   
'description' => 'The post goes here for real',
   
'author' => 'k4st',
   
'guid' => array('http://k4_bb_url.tld/viewtopic.php?id=25#25',true),
   
'pubDate' => date ( 'r' )
);
$post[2] = Array (
   
'title' => 'RE: Topic Title',
   
'link' => 'http://k4_bb_url.tld/viewtopic.php?id=25#26',
   
'description' => 'This is a reply',
   
'author' => 'necrotic',
   
'guid' => array('http://k4_bb_url.tld/viewtopic.php?id=25#26',true),
   
'pubDate' => date ( 'r' )
);

foreach (
$post as $info )
{
   
$RSS->addItem ( $info );
}

echo
$RSS->Go();

?>