once the installation is succesfull you
can include the feedsreader on
your php page. You must include the main script in the
<body> section and the header script in the <head> section.
The header script handles thre template's CSS and javascript, while the
main script renders the aggregated feeds.
Example of a minimal page:
<html>
<head>
<?php include ('newsfeeds/zebraheader.php'); ?>
</head>
<body>
<?php include ('newsfeeds/zebrafeeds.php'); ?>
</body>
</html>
If you want to use the ZebraFeeds control bar, include
<?php include ('newsfeeds/zebrabar.php'); ?>
in the BODY section.
The ZebraFeeds control bar features useful controls to display/manage
your feeds:
- Displays all subscription lists configured in the admin
panel
- Sort new by date or by channel
- Access to the admin panel
It should ideally be used if you plan to use ZebraFeeds as a personel
feed reader, not if you just publish feeds on your site.
The bar just makes easy the use of the three
parameters available when calling ZebraFeeds:
- zftemplate - a template name (filename in templates
directory, without the extension)
- zflist - subscription list name (filename in categories
subdirectory, without the extension)
- zfgroupby - 'feed' or 'date'
examples:
http://example.com/newsfeeds/zebrafeeds.php?zftemplate=logos - will
show with
the logos template
http://example.com/page_with_zebrafeeds.php?zftemplate=some&zflist=linux
will show only the feeds from the linux subscription list (that you
defined in ZebraFeeds subscription lists admin panel)
in a 'some' template.
Manual configuration
If you do not wish to use the OPML subscription lists, you have to manually
configure the feeds that ZebraFeeds aggregates.
A couple of functions are available to do so.
- zf_addFeed: add a newsfeed to the aggregator
- zf_renderPage: render the aggregated newsfeeds
By default, ZebraFeeds renders the news sorted by channel using the template defined in the admin panel.
Additionally, these functions help to manipulate the way ZebraFeeds renders the aggregated feeds:
- zf_groupByDate: display news sorted by date
- zf_trim: show only the last news/days/hours (will force group by date)
- zf_match: show only news containing a keyword
- zf_reset: reset to restart a display loop with different parameters/feeds
- zf_useTemplate: under certain conditions changes the rendering template
See the
demo_manual.php script for more details and examples.