see http://phpdocu.sourceforge.net/ // +----------------------------------------------------------------------+ // | Author (TikiWiki): Oliver Hertel // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider // +----------------------------------------------------------------------+ // $Id: data.rss.php,v 1.3 2009/10/01 13:45:47 wjames5 Exp $ /** * definitions */ global $gLibertySystem; define( 'PLUGIN_GUID_DATARSS', 'datarss' ); global $gLibertySystem; $pluginParams = array ( 'tag' => 'rss', 'auto_activate' => FALSE, 'requires_pair' => FALSE, 'load_function' => 'rss_parse_data', 'title' => 'RSS Feed', 'help_page' => 'DataPluginRSS', 'description' => tra("Display RSS Feeds"), 'help_function' => 'rss_extended_help', 'syntax' => "{RSS id= max= }", 'plugin_type' => DATA_PLUGIN, 'biticon' => '{biticon ilocation=quicktag ipackage=rss iname=rss-16x16 iexplain="RSS Feed"}', 'taginsert' => '{rss}' ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATARSS, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATARSS ); function rss_extended_help() { $help = '' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'
' . tra( "Key" ) . '' . tra( "Type" ) . '' . tra( "Comments" ) . '
id' . tra( "string") . '
' . tra("(mandatory)") . '
' . tra( "IDs of the RSS-feeds to process. Separate multiple ids with \",\"") . '
max' . tra( "integer") . '
' . tra("(optional)") . '
' . tra( "Number of entries to be displayed from given RSS Feed, prefixed with publication date.") . '
' ; return $help; } function rss_parse_data( $data, $params ) { $repl = ''; if( !empty( $params['id'] ) ) { global $rsslib; require_once( RSS_PKG_PATH.'rss_lib.php' ); $max = !empty( $params['max'] ) ? $params['max'] : 99; if ( $items = $rsslib->parse_feeds( $params ) ){ //if we want short descriptions get them $shortdescs = Array(); if ( !empty($module_params['desc_length']) && is_numeric($module_params['desc_length']) && !empty($items)){ $shortdescs = $rsslib->get_short_descs( $items, $module_params['desc_length'] ); } } $repl = ''; } else { $repl = 'You have not provided an id or feed to process.'; } return $repl; } ?>