This allows you to assign random RSS/Atom feeds to your site, allowing for a variety of content every time you refresh. For YACG. Qassia members: You must first sign up for forums.getyacg.com to get a copy of YACG (Yet Another Content Generator). Then search the forums for "RSS Aggregator 1.0".
///////////////////////////////////////////////////////////
| |
| RSS ATOM FEED AGGREGATOR 1.0 (FOR YACG 2.1) |
| By: bill@cube3design.com |
| www.cube3design.com |
| |
///////////////////////////////////////////////////////////
README***
This has only been tested on YACG 2.1 as of this writing.
*********************************************************
Description:
RSS ATOM FEED AGGREGATOR 1.0 allows you to add unlimited RSS blog posts to your YACG-generated pages.
The frontpage (index) will display only the first BLOG feed,
to keep your index page static (only updates frontpage content when the blog submits new content).
The rest of your dynamically-generated pages will randomly display one of your blogs when the page is accessed.
This will help with unique content on those pages that normally pull duplicate content / little information.
Enjoy!
Step 1:
Unzip RSS-YACG.ZIP to your yacg root folder.
Step 2:chmod 777 the following files:
rss_cache.inc
rss_fetch.inc
rss_parse.inc
rss_utils.inc
extlib/Snoopy.class.inc
Step 3:Open config.inc.php and add the following lines:
define('BLOG_1', 'xxxxxxxxxxxxxx.xml'); // BLOG 1 (Front Page) *atom feed
define('BLOG_2', 'xxxxxxxxxxxxxx.xml'); // BLOG 2 (Random Pages) *atom feed
define('BLOG_3', 'xxxxxxxxxxxxxx.xml'); // BLOG 3 (Random Pages) *atom feed
define('BLOG_4', 'xxxxxxxxxxxxxx.xml'); // BLOG 4 (Random Pages) *atom feed
note: you can add as many of these as you'd like, just continue the numbering i.e. BLOG_5, BLOG_6... etc.
note 2: YOU MUST NOT LEAVE ANY OF THESE AS XXXX.XML, or you will get errors. make sure you include atleast 4 blogs!
Step 4:Open template/index.php:
Add the following after "<? table('6') ?>" :
<?php
require_once('rss_fetch.inc');
$rss = fetch_rss( BLOG_1 );
//display latest blog content:
$item = $rss->items[0];
$content = $item['atom_content'];
echo "
Latest Blog Entry:
$content</p>\n";
?>
^^This part adds BLOG_1 to your index page.
Step 5:Open template/page.php:
Add the following after "<? flickr(THIS_PAGE_KEYWORD,"7") ?>":
<?php
require_once('rss_fetch.inc');
$blog = rand(1,4);
switch ($blog) {
case 1:
$blog = BLOG_1;
break;
case 2:
$blog = BLOG_2;
break;
case 3:
$blog = BLOG_3;
break;
case 4:
$blog = BLOG_4;
break;
}
$rss = fetch_rss( $blog );
//display latest blog content:
$item = $rss->items[0];
$content = $item['atom_content'];
echo "
Latest Blog Entry:
$content</p>\n";
?>
^^If you added more BLOG_XXX, add new cases for each of these blogs, *don't forget to set rand(1,XXX) where XXX = the maximum number of BLOG_XXX 's.
Step 6:
If you liked the aggregator, feel free to post a backlink to www.cube3design.com - it'll mean a lot!
Advanced:
To display older posts from a blog, change items[0] to items[1], items[2], etc. My next iteration will allow for multiple blog posts per page, with random alignments and css.
Any questions please post on forums.getyacg.com.
Thanks!