phpDocumentor Rss
[ class tree: Rss ] [ index: Rss ] [ all elements ]

Class: Rss

Source Location: /rss.class.php

Class Rss

Class Overview

Class Rss

If making derivative works, you MUST attribute the author in one or more of following ways:
Leave rss generator tags and comments in the output
Place the link http://weblog.finwe.info/item/php-trida-generujici-rss to your product documentation
Place the link http://weblog.finwe.info/item/php-trida-generujici-rss to your product website

Located in /rss.class.php [line 31]



		
				Author(s):
		
		
		API Tags:
Example:  Basic example

Information Tags:
Link:  Tutorial Article at finwe.info (cs_CZ)
License:  Creative Commons Attribution-ShareAlike 2.5
Version:  Rss.class.php, v 1.3 2007/02/17 14:48:00

Properties

Methods

[ Top ]
Property Summary
array   $channelSubelements   Custom channel subelements (pubDate, ttl, skipHours etc.)
string   $commentsLink   String of item-comment-link.
mixed   $dbCallback   Data retrieval handler setting.
array   $dbFields   Array of database fields to use.
string   $dbHost   DB host. defaults localhost
string   $dbName   Name of the database to use.
string   $dbPass   DB password.
string   $dbPort   Database Port.
string   $dbSql   SQL query to run on given database.
string   $dbUser   DB user.
string   $descripton   Feed description.
string   $encoding   Feed encoding.
string   $image   URL of feed image.
string   $language   Language of the feed.
string   $link   Base url of the page.
array   $namespaces   Oprional feed namespaces.
string   $postLink   String of item-link.
string   $title   Title of the feed. Should be the same as the page title.

[ Top ]
Method Summary
void   addChannelSubelement()   Adds user-defined channel subelement
void   addNamespace()   Adds user-defined namespace
void   display()   Complete method for final usage.
array   getMysqlData()   Database data withdrawal, mysql driver
array   getMysqliData()   Database data withdrawal, mysqli driver
array   prepareData()   Prepares array of data for further usage
void   rssBody()   Writes ITEM tags of RSS from values prepared by prepareData()
void   rssFoot()   Writes RSS epilogue
void   rssHead()   Writes RSS prologue with Channel obligatory tags
void   setHeader()   Sets page header
string   splitLongText()   By RSS Spec, description text should be 450 chars max. Lets ensure it is.
string   writeChannelSubelements()   writes Channel Subelements XML
string   writeNamespaces()   Writes namespaces
void   __call()   Method overloading - allows user to set Rss variables.

[ Top ]
Properties
array   $channelSubelements = array() [line 125]

Custom channel subelements (pubDate, ttl, skipHours etc.)

API Tags:
Usedby:  Rss::writeChannelSubelements()
Usedby:  Rss::addChannelSubelement()
Access:  private


[ Top ]
string   $commentsLink = '' [line 184]

String of item-comment-link.

Is prepared for sprintf or vsprintf. Instead of %s variables, data from database will be used. If multiple variables used, $dbFields must be set accordingly (array in array value)

'/item/%s' string with one variable '/item/%s-%s' string with multiple variables

API Tags:
Access:  private
See:  Rss::$dbFields
Example:  Basic example


[ Top ]
mixed   $dbCallback = array('Rss', 'getMysqlData') [line 48]

Data retrieval handler setting.

Allows user to define his own data-retrieval function, even outside of the class.

string 'getData' will call function gatData array('pgSql','getData') will staticaly call method getData of pgSql object (pgSql::getData()).

there are two pre-prepared methods - getMysqlData() and getMysqliData(). They both use db parameters specific for Rss class

API Tags:
Access:  private


[ Top ]
array   $dbFields = array() [line 145]

Array of database fields to use.

Key is a name of RSS tag, value is name of database field, from which the data are to be taken. Value can be an array of db field names for usage with link, comments and guid tags. @see $postLink

API Tags:
Access:  private
See:  Rss::prepareData()


[ Top ]
string   $dbHost = 'localhost' [line 55]

DB host. defaults localhost

API Tags:
Access:  private


[ Top ]
string   $dbName = '' [line 76]

Name of the database to use.

API Tags:
Access:  private


[ Top ]
string   $dbPass = '' [line 69]

DB password.

API Tags:
Access:  private


[ Top ]
string   $dbPort = '' [line 83]

Database Port.

API Tags:
Access:  private


[ Top ]
string   $dbSql = '' [line 152]

SQL query to run on given database.

API Tags:
Access:  private


[ Top ]
string   $dbUser = '' [line 62]

DB user.

API Tags:
Access:  private


[ Top ]
string   $descripton = '' [line 104]

Feed description.

API Tags:
Access:  private


[ Top ]
string   $encoding = 'utf-8' [line 192]

Feed encoding.

API Tags:
Access:  private


[ Top ]
string   $image = '' [line 133]

URL of feed image.

API Tags:
Access:  private


[ Top ]
string   $language = '' [line 111]

Language of the feed.

API Tags:
Access:  private


[ Top ]
string   $link = '' [line 97]

Base url of the page.

API Tags:
Access:  private


[ Top ]
array   $namespaces = array() [line 118]

Oprional feed namespaces.

API Tags:
Usedby:  Rss::writeNamespaces()
Usedby:  Rss::addNamespace()
Access:  private


[ Top ]
string   $postLink = '' [line 168]

String of item-link.

Is prepared for sprintf or vsprintf. Instead of %s variables, data from database will be used. If multiple variables used, $dbFields must be set accordingly (array in array value)

'/item/%s' string with one variable '/item/%s-%s' string with multiple variables

API Tags:
Access:  private
See:  Rss::$dbFields
Example:  Basic example


[ Top ]
string   $title = '' [line 90]

Title of the feed. Should be the same as the page title.

API Tags:
Access:  private


[ Top ]
Methods
addChannelSubelement  [line 260]

  void addChannelSubelement( string $element, mixed $data  )

Adds user-defined channel subelement

Parameters:
string   $element:  name of the tag
mixed   $data:  tag data

API Tags:
Access:  public
Uses:  Rss::$channelSubelements
See:  Rss::writeChannelSubelements()


[ Top ]
addNamespace  [line 233]

  void addNamespace( string $namespace, string $link  )

Adds user-defined namespace

Parameters:
string   $namespace:  Namespace itself
string   $link:  link to namespace definition

API Tags:
Access:  public
Uses:  Rss::$namespaces


[ Top ]
display  [line 527]

  void display( )

Complete method for final usage.


API Tags:
Access:  public


[ Top ]
getMysqlData  [line 369]

  array getMysqlData( )

Database data withdrawal, mysql driver


API Tags:
Return:  Data fetched from MySQL < 4.1 database
Access:  protected


[ Top ]
getMysqliData  [line 392]

  array getMysqliData( )

Database data withdrawal, mysqli driver


API Tags:
Return:  fetched from MySQL >= 4.1 database
Access:  protected


[ Top ]
prepareData  [line 415]

  array prepareData( )

Prepares array of data for further usage


API Tags:
Return:  Data prepared for insertion to XML
Access:  protected


[ Top ]
rssBody  [line 491]

  void rssBody( array $data  )

Writes ITEM tags of RSS from values prepared by prepareData()

Parameters:
array   $data:  Data prepared from prepareData()

API Tags:
Access:  protected


[ Top ]
rssFoot  [line 514]

  void rssFoot( )

Writes RSS epilogue


API Tags:
Access:  protected


[ Top ]
rssHead  [line 316]

  void rssHead( )

Writes RSS prologue with Channel obligatory tags


API Tags:
Access:  protected


[ Top ]
setHeader  [line 219]

  void setHeader( [string $context = 'text/plain']  )

Sets page header

Parameters:
string   $context:  Page context-type.

API Tags:
Access:  protected


[ Top ]
splitLongText  [line 343]

  string splitLongText( $string, [ $length = 450], [ $etc = '...'], [ $break_words = false], [ $middle = false]  )

By RSS Spec, description text should be 450 chars max. Lets ensure it is.

Parameters:
   $string: 
   $length: 
   $etc: 
   $break_words: 
   $middle: 

API Tags:
Return:  Truncated string
Access:  protected

Information Tags:
Author:  Monte Ohrt <at ohrt dot com monte at ohrt dot com>

[ Top ]
writeChannelSubelements  [line 272]

  string writeChannelSubelements( )

writes Channel Subelements XML


API Tags:
Return:  XML of channel subelements
Access:  private
Uses:  Rss::$channelSubelements


[ Top ]
writeNamespaces  [line 245]

  string writeNamespaces( )

Writes namespaces


API Tags:
Return:  Namespaces
Access:  protected
Uses:  Rss::$namespaces


[ Top ]
__call  [line 198]

  void __call( $name, $args  )

Method overloading - allows user to set Rss variables.

Parameters:
   $name: 
   $args: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Sat, 17 Feb 2007 14:51:24 +0100 by phpDocumentor 1.3.1