yana

phpDocumentor v 1.4.0

Class RSS

Description

«entity» RSS feed
This class represents a RSS feed. It offers functionality to publish new feeds.
Examples of usage:
  1. Creating and printing a RSS feed inside a plugin:
    1.   function rss_foobar($args)
    2.   {
    3.        // create rss feed
    4.        $rss new RSS();
    5.        // provide some description for it
    6.        $rss->title 'foo';
    7.        $rss->description 'this is my RSS feed';
    8.        // create 1st item
    9.        $item new RSSitem();
    10.        $item->title '1st entry';
    11.        $item->link 'http://some.url';
    12.        $item->description 'some text';
    13.        $rss->addItem($item);
    14.        // create 2nd item
    15.        $item new RSSitem();
    16.        $item->title '2nd entry';
    17.        $item->link 'http://some.other.url';
    18.        $item->description 'some text';
    19.        $rss->addItem($item);
    20.        // print rss feed
    21.        print utf8_encode($rss->toString());
    22.        // when you're done, terminate the program
    23.        exit(0);
    24.   }
  2. Showing the RSS logo + link from inside a plugin:
    1. $YANA->setVar('RSS_ACTION''rss_foobar')
    Where 'rss_foobar' is the value for the "action" parameter of the URL. You don't need to call it 'rss_foobar' - just call it whatever you like. You are to implement the code for action 'rss_foobar' yourself. To find out how to do that, see the example above.
  • access: public
Object
   |
   --RSS
Variable Summary
array $category
string $copyright
string $css
string $description
string $image
array $item
string $language
string $link
string $title
int $ttl
string $webMaster
string $xslt
Method Summary

Variables

array $category = array()
one or more categories that the channel belongs to
this field is optional
  • access: public
string $copyright = ""
copyright notice of your choice
this field is optional
  • access: public
string $css = ""
a CSS stylesheet that formats the channel
this field is optional
  • access: public
string $description = ""
a text to describe context and purpose of this channel
this field is mandatory
  • access: public
string $image = ""
*.jpg, *.gif, or *.png image to display with the feed
this field is optional
  • access: public
array $item = array()
list of one or more items of the channel
this field is optional
  • access: public
string $language = ""
language the channel is written in
this field is optional
  • access: public
string $link = ""
a link that points to the originating website of the feed
this field is mandatory
  • access: public
string $managingEditor = ""
mail of person responsible for editorial content
this field is optional
  • access: public
string $title = ""
name of the channel, e.g. title of the website the channel refers to
this field is mandatory
  • access: public
int $ttl = 0
"time to live" - a number of minutes that indicates how long a channel can be cached before refreshing from the source
this field is optional
  • access: public
string $webMaster = ""
mail of person responsible for technical issues
this field is optional
  • access: public
string $xslt = ""
a XSL transformation that formats the channel
this field is optional
  • access: public

Methods

constructor
RSS RSS ()
Description:
creates and initializes a new instance of this class
add RSS feed item to this channel
bool addItem (
RSSitem $item
)
List of parameters:
Name Type Description
$item RSSitem
Description:
The $item has to be a valid RSSitem object.
Returns bool(true) on success and bool(false) on error.
Note: this function does not check for duplicate guid's
  • access: public
  • name: RSS::toString()
publish a rss feed
bool publish (
string $action, [string $name = null]
)
List of parameters:
Name Type Description
$action string
$name string
Description:
Adds the action identified by $action to the list of rss-feeds to be offered to the user.
The argument $name is optional and allows you to define a custom name for your feed. If none is provided, the
Example of usage:
Add this to your plugin code
  1. Microsummary::publish('create_rss');
Where 'create_rss' is the name of the plugin function that displays the rss feed.
Returns bool(false) on error.
  • access: public
get string value
bool(false)|string toString ()
Description:
This returns this object as a string in RSS 2.0 syntax.
Returns bool(false) and issues an E_USER_NOTICE on error.
  • access: public
  • name: RSS::toString()

Redefinition of: Object::toString()

inherited from base classes

Inherited From Object

Documentation generated on Sat, 03 Jan 2009 22:22:33 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net