Including ZebraFeeds on your page is easy.
PHP script integration
This section describes the integration of ZebraFeeds script in another PHP script.
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.
Note: if you don't plan
to use a template with
a templateHeader section (that is, no style sheet),
the header script may not be necessary.
Here is an example of a minimal page (must be put
in the directory containing the 'newsfeeds' dir):
<html>
<head>
<?php include ('newsfeeds/zebraheader.php'); ?>
</head>
<body>
<?php include ('newsfeeds/zebrafeeds.php'); ?>
</body>
</html>
ZebraFeeds cookie support
If you want individual visitors to see new news items since they last visit,
you need to include
zebracookies.php.
It must be done before any other output, since cookies are sent in the headers.
<?php include ('newsfeeds/zebracookies.php'); ?>
<html>
<head>
<?php include ('newsfeeds/zebraheader.php'); ?>
</head>
<body>
<?php include ('newsfeeds/zebrafeeds.php'); ?>
</body>
</html>
See the below the section of the documentation pertaining to marking new items.
ZebraFeeds control bar
If you want to use the ZebraFeeds control bar, include
<?php include ('newsfeeds/zebrabar.php'); ?>
somewhere 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 personal
feed reader, not if you just publish feeds on your site.
The bar just makes easy the use of the
URL 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)
- zfviewmode - 'feed' or 'date'
- zftrim - composed value (ex '4days', '6hours' or '15news' ...)
examples:
http://example.com/newsfeeds/page_with_zebrafeeds.php?zftemplate=logos - will
show the feeds 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)
Of course, these parameters are meant to be used in URLs, not in PHP include statements.
(
Note: in this example, page_with_zebrafeeds.php
refers to the PHP script including zebrafeeds.php)
Manual configuration
The other way of including ZebraFeeds is to use the manual mode. Instead of
having ZebraFeeds automatically generate code in your page, you can call
specialised functions that will allow more control on
the way the aggregation HTML code is generated.
Manual mode is disabled by default and can be enabled by the appropriate option
of the configuration page.
See the relevant section for more information on the manual mode functions.
Note: if you choose not to use OPML lists, the manual mode is the only way to
display anything with ZebraFeeds.