ultimix
rss_2_0_0 Class Reference

Public Member Functions

 __construct ()
 get_feed_records ()
 compile_feed (&$Records)
 view ($Options)
 compile_rss_button (&$Settings)

Data Fields

 $AutoMarkup = false
 $CachedMultyFS = false
 $Database = false
 $PageComposer = false
 $Security = false
 $Settings = false
 $String = false

Detailed Description

Class creates RSS-feeds.

Author
Dodonov A.A.

Definition at line 26 of file rss.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 60 of file rss.php.

{
try
{
$this->AutoMarkup = get_package( 'page::page_parts' , 'last' , __FILE__ );
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->PageComposer = get_package( 'page::page_composer' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->Settings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_feed ( $Records)

Function compiles feed.

Parameters
$Records- Records.
Returns
Compiled feed.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 189 of file rss.php.

{
try
{
$FeedXml = $this->compile_records( $Records );
$FeedXml = str_replace( '{last_build_date}' , date( 'r' ) , $FeedXml );
$FeedXml = str_replace( '{package_path}' , _get_package_path( 'rss' , '2.0.0' ) , $FeedXml );
$this->Settings->load_file( dirname( __FILE__ ).'/conf/cf_default' );
$FeedXml = $this->String->print_record( $FeedXml , $this->Settings->get_raw_settings() );
$FeedXml = $this->AutoMarkup->compile_string( $FeedXml );
return( $FeedXml );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_rss_button ( $Settings)

Function processes macro 'rss_button'.

Parameters
$Str- String to process.
$Changed- true if any of the page's elements was compiled.
Returns
array( Processed string , Was the string changed ).
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 280 of file rss.php.

{
try
{
$Type = $Settings->get_setting( 'type' , 'small' );
$Code = $this->CachedMultyFS->get_template( __FILE__ , $Type.'_rss_button.tpl' );
$Code = $this->String->print_record( $Code , $Settings );
$Code = str_replace( '{package_path}' , _get_package_relative_path_ex( 'rss' , '2.0.0' ) , $Code );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_feed_records ( )

Function returns data for feed.

Returns
Data.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 96 of file rss.php.

{
try
{
if( $this->Security->get_gp( 'feed' , 'set' ) === false )
{
return( false );
}
$Feed = $this->Security->get_gp( 'feed' , 'command' );
$FeedScript = $this->CachedMultyFS->get_data( __FILE__ , "$Feed.sql" );
$FeedScript = $this->AutoMarkup->compile_string( $FeedScript );
$this->Database->query_as( DB_OBJECT );
$Result = $this->Database->query( $FeedScript );
return( $this->Database->fetch_results( $Result ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Function generates feed.

Parameters
$Options- Generatating options.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 229 of file rss.php.

{
try
{
$Records = $this->get_feed_records();
if( $Records === false )
{
return( false );
}
$Feed = $this->compile_feed( $Records );
$Feed = $this->Security->get( $Feed , 'unsafe_string' );
header( "Content-Type: application/rss+xml" );
return( $Feed );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$AutoMarkup = false

Cached objects.

Author
Dodonov A.A.

Definition at line 38 of file rss.php.

$CachedMultyFS = false

Definition at line 39 of file rss.php.

$Database = false

Definition at line 40 of file rss.php.

$PageComposer = false

Definition at line 41 of file rss.php.

$Security = false

Definition at line 42 of file rss.php.

$Settings = false

Definition at line 43 of file rss.php.

$String = false

Definition at line 44 of file rss.php.


The documentation for this class was generated from the following file: