see http://phpdocu.sourceforge.net/ // +----------------------------------------------------------------------+ // | Author (TikiWiki): Oliver Hertel // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider // +----------------------------------------------------------------------+ // $Id$ /** * definitions */ define( 'PLUGIN_GUID_DATARSS', 'datarss' ); global $gLibertySystem; $pluginParams = [ 'tag' => 'rss', 'auto_activate' => false, 'requires_pair' => false, 'load_function' => 'rss_parse_data', 'title' => 'RSS Feed', 'help_page' => 'DataPluginRSS', 'description' => KernelTools::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 = '' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'
' . KernelTools::tra( "Key" ) . '' . KernelTools::tra( "Type" ) . '' . KernelTools::tra( "Comments" ) . '
id' . KernelTools::tra( "string") . '
' . KernelTools::tra("(mandatory)") . '
' . KernelTools::tra( "IDs of the RSS-feeds to process. Separate multiple ids with \",\"") . '
max' . KernelTools::tra( "integer") . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::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; $max = !empty( $params['max'] ) ? $params['max'] : 99; if ( $items = $rsslib->parse_feeds( $params ) ){ //if we want short descriptions get them $shortdescs = []; if ( !empty($params['desc_length']) && is_numeric($params['desc_length']) && !empty($items)){ $shortdescs = $rsslib->get_short_descs( $items, $params['desc_length'] ); } } $repl = ''; } else { $repl = 'You have not provided an id or feed to process.'; } return $repl; }