Class TM::RSS by Thiemo Mättig
Version 2004-01-11

RSS creation class.

A single interface to create news feeds in RSS 2.0 (default), 0.91, 0.92 and 0.93 (versions 0.9x and 2.0 are nearly the same), Atom (according to the pre-draft version 0.3), RSS 3.0 (a human readable plain text format according to RFC 822) and ESF (a tabulator separated plain text format).

Most constructor and method calls are similar to the RSSBuilder class by Michael Wimmer (http://www.flaimo.com/).

Don't hesitate to report bugs or feature requests.

Variable Summary
maxItemAge -- Maximum item age in days. Defaults to 30.
maxItemCount -- Maximum number of items. Defaults to 15.

Constructor Summary
RSS -- Creates a new RSS object.

Method Summary
addDCData -- Adds some meta data (author, language etc.) to the feed.
addItem -- Adds a new item to the feed.
getRSSOutput -- Returns the final feed as a string.
outputRSS -- Prints the final feed to the browser.

Variable Detail

maxItemAge

Maximum item age in days. Defaults to 30.

int $maxItemAge

maxItemCount

Maximum number of items. Defaults to 15.

int $maxItemCount

Constructor Detail

RSS

Creates a new RSS object.

RSS RSS ( [ string encoding [, string link [, string title [, string description [, string imageUrl [, string category [, int cache]]]]]]])

Parameters:
encoding - Defaults to "ISO-8859-1".
link - Leave empty to generate a default value.
category - Unused.
cache - Unused.

Method Detail

addDCData

Adds some meta data (author, language etc.) to the feed.

void addDCData ( [ string publisher [, string creator [, int date [, string language [, string rights [, string coverage [, string contributor]]]]]]])

Parameters:
publisher - Unused.
creator - Name of the author of the feed (no email).
date - Unix timestamp the feed changed last, defaults to the last item date.
language - Defaults to "de-DE".
rights - Unused.
coverage - Unused.
contributor - Unused.

addItem

Adds a new item to the feed.

bool addItem ( [ mixed id [, string title [, string link [, string description [, string subject [, int date [, string author [, mixed commentLink [, int commentCount [, string commentRss]]]]]]]]]])

Parameters:
id - Set to true to use the link's value as id.
title - Leave empty to generate a title out of the description.
link - Permanent absolute or relative link to the item.
description - Full content or abstract of the item.
subject - Unused.
date - Unix timestamp the item was published.
author - Unused.
commentLink - Set to true to use the link as comment link too.
commentCount - Number of comments already posted.
commentRss - Link to this items comments feed.

getRSSOutput

Returns the final feed as a string.

string getRSSOutput ( [ mixed version])

Parameters:
version - 2.0 (default), 0.91, 0.92, 0.93, 1.0, "Atom", 3.0, "ESF".

outputRSS

Prints the final feed to the browser.

void outputRSS ( [ mixed version])

Parameters:
version - 2.0 (default), 0.91, 0.92, 0.93, 1.0, "Atom", 3.0, "ESF".

Documentation generated by TM::PHPDoc