Location: PHPKode > projects > Zort > zort-1.1.0/examples/config-complex.php
<?
/*
 * This is a complex example which shows everything
 * that can be done with Zort
 */

// We only want to see the five most recent items for each
// feed. 
$zort->max_items(5);

// Override the default HTML Title (default "Zort")
$zort->title("Foo's RSS Feeds");

// We don't like seeing the "Loading" screen while feeds are
// fetched.
$zort->no_loading_screen();

// Also we don't want Zort to attempt to sanitize HTML from
// the feeds we get.  It's highly recommended to let Zort
// try and fix HTML, otherwise bad HTML in a feed could break
// Zort's display.  Only use this config option if you suspect
// that the HTML fixing is adversely affecting your feeds.
// If your PHP installation doesn't support HTML Tidy (which
// is available as a PECL extension in PHP4, and via the
// configure option "--with-tidy" in PHP5), Zort won't do any
// HTML fixing anyway.
$zort->no_fix_html();

//
// NOTE:
//
// The syntax for configuring colors was changed after Zort
// 1.0.2.  The old syntax will still work, but you're
// encouraged to move to the new syntax anyway, as it's
// cleaner and less prone to typos and the like.  Also,
// you're no longer required to have the color configuration
// in your config.php at all.  If you're happy with the
// default colors used by Zort, there's no need to mention
// colors in config.php at all.
//

// We don't like Zort's default colors, so we're going
// to define our own here.  First we clear out the defaults:
$zort->color_reset();

// Now we just want to cycle between two colors of our own.
// The header background is specified first, then the body
// background.
$zort->color_add('#111', '#ccc');
$zort->color_add('#11f', '#ccf');

// If we wanted to merely add more colors into the default
// pool, we'd just call color_add() without the initial
// color_reset.  To insert your own colors *before* the
// defaults, use color_insert() instead of color_add().

// Here's a page for geek feeds, we'll just add a few
// the "usual" way and then specify some with special
// options.
$zort->page('Geek Feeds');
$zort->cat('Geek');
$zort->feed(
	'http://www.theregister.co.uk/excerpts.rss',
	'http://www.osnews.com/files/recent.rdf',
	'http://linuxtoday.com/biglt.rss'
);

// Now we want to add another feed, but we want to see 10 items from
// this feed, instead of the 5 we limited it to earlier.  Note that
// we can only specify one feed at a time with feed_full(), unlike feed()
$zort->feed_full('http://www.linuxjournal.com/node/feed', 10);

// Likewise, we want to limit *this* feed to the top 3, instead of
// the top 5.
$zort->feed_full('http://slashdot.org/index.rss', 3);

// Now we want to add yet another feed.  We're okay with keeping it at
// five displayed items, but we want to override the title of this feed.
$zort->feed_full('http://www.eff.org/news/index.xml', -1, 'Electronic Frontier Foundation');

// One more, we only want the most recent item, and we're also going
// to override the title
$zort->feed_full('http://blogs.adobe.com/penguin.swf/atom.xml', 1, 'Linux Flash Player 9 Development Blog');

// And now for the rest of the file it's just business as usual.
$zort->cat('Other');
$zort->feed(
	'http://slumbering.lungfish.com/index.php?p=rss',
	'http://www.livejournal.com/users/scottbateman/data/rss'
);

$zort->page('News Feeds');

$zort->feed(
	'http://news.bbc.co.uk/rss/newsonline_world_edition/front_page/rss091.xml',
    'http://rss.cnn.com/rss/cnn_topstories.rss',
	'http://www.nasa.gov/rss/breaking_news.rss'
);

?>
Return current item: Zort