diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-01-14 19:54:56 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-01-14 19:54:56 +0000 |
| commit | 2e9ce0b1345eb7b48532d9800674679d8e8279ff (patch) | |
| tree | 48f0e3e4fbdf94e916c2d4552a3bdeba44eb4281 /plugins/data.rss.php | |
| parent | c7f3bf675b6ae9469d1e5b56e119b6704a4ecdaa (diff) | |
| download | liberty-2e9ce0b1345eb7b48532d9800674679d8e8279ff.tar.gz liberty-2e9ce0b1345eb7b48532d9800674679d8e8279ff.tar.bz2 liberty-2e9ce0b1345eb7b48532d9800674679d8e8279ff.zip | |
merge recent changes into HEAD
Diffstat (limited to 'plugins/data.rss.php')
| -rw-r--r-- | plugins/data.rss.php | 150 |
1 files changed, 76 insertions, 74 deletions
diff --git a/plugins/data.rss.php b/plugins/data.rss.php index 58d191b..91ab555 100644 --- a/plugins/data.rss.php +++ b/plugins/data.rss.php @@ -1,74 +1,76 @@ -<?php -/** - * @version $Revision: 1.3 $ - * @package liberty - * @subpackage plugins_data - */ -// +----------------------------------------------------------------------+ -// | Copyright (c) 2004, bitweaver.org -// +----------------------------------------------------------------------+ -// | All Rights Reserved. See copyright.txt for details and a complete list of authors. -// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details -// | -// | For comments, please use phpdocu.sourceforge.net documentation standards!!! -// | -> see http://phpdocu.sourceforge.net/ -// +----------------------------------------------------------------------+ -// | Author (TikiWiki): Oliver Hertel <ohertel@users.sourceforge.net> -// | Reworked for Bitweaver (& Undoubtedly Screwed-Up) -// | by: StarRider <starrrider@users.sourceforge.net> -// +----------------------------------------------------------------------+ -// $Id: data.rss.php,v 1.3 2005/08/07 17:40:31 squareing Exp $ - -/** - * definitions - */ -global $gLibertySystem; - -define( 'PLUGIN_GUID_RSS', 'datarss' ); - -global $gLibertySystem; -$pluginParams = array ( 'tag' => 'RSS', - 'auto_activate' => TRUE, - '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 - ); -$gLibertySystem->registerPlugin( PLUGIN_GUID_RSS, $pluginParams ); -$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_RSS ); - -function rss_extended_help() { - return 'NO HELP WRITTEN FOR {RSS}'; -} - -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; - - $rssdata = $rsslib->get_rss_module_content( $params['id'] ); - $items = $rsslib->parse_rss_data( $rssdata, $params['id'] ); - - $repl = '<ul class="rsslist">'; - - for ($j = 1; $j < count($items) && $j < $max; $j++) { - $repl .= '<li><a href="' . $items[$j]["link"] . '">' . $items[$j]["title"] . '</a>'; - if ($items[$j]["pubdate"] <> '') { - $repl .= ' <small>('.$items[$j]["pubdate"].')</small>'; - } - $repl .= '</li>'; - } - - $repl .= '</ul>'; - } - return $repl; -} - -?> +<?php
+/**
+ * @version $Revision: 1.4 $
+ * @package liberty
+ * @subpackage plugins_data
+ */
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2004, bitweaver.org
+// +----------------------------------------------------------------------+
+// | All Rights Reserved. See copyright.txt for details and a complete list of authors.
+// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
+// |
+// | For comments, please use phpdocu.sourceforge.net documentation standards!!!
+// | -> see http://phpdocu.sourceforge.net/
+// +----------------------------------------------------------------------+
+// | Author (TikiWiki): Oliver Hertel <ohertel@users.sourceforge.net>
+// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
+// | by: StarRider <starrrider@users.sourceforge.net>
+// +----------------------------------------------------------------------+
+// $Id: data.rss.php,v 1.4 2006/01/14 19:54:56 squareing Exp $
+
+/**
+ * definitions
+ */
+global $gLibertySystem;
+
+define( 'PLUGIN_GUID_RSS', 'datarss' );
+
+global $gLibertySystem;
+$pluginParams = array ( 'tag' => 'RSS',
+ 'auto_activate' => TRUE,
+ '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
+ );
+$gLibertySystem->registerPlugin( PLUGIN_GUID_RSS, $pluginParams );
+$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_RSS );
+
+function rss_extended_help() {
+ return 'NO HELP WRITTEN FOR {RSS}';
+}
+
+function rss_parse_data( $data, $params ) {
+ $repl = '';
+ if( @BitBase::verifyId( $params['id'] ) ) {
+ global $rsslib;
+ require_once( RSS_PKG_PATH.'rss_lib.php' );
+
+ $max = !empty( $params['max'] ) ? $params['max'] : 99;
+
+ $rssdata = $rsslib->get_rss_module_content( $params['id'] );
+ $items = $rsslib->parse_rss_data( $rssdata, $params['id'] );
+
+ $repl = '<ul class="rsslist">';
+
+ for ($j = 1; $j < count($items) && $j < $max; $j++) {
+ $repl .= '<li><a href="' . $items[$j]["link"] . '">' . $items[$j]["title"] . '</a>';
+ if ($items[$j]["pubdate"] <> '') {
+ $repl .= ' <small>('.$items[$j]["pubdate"].')</small>';
+ }
+ $repl .= '</li>';
+ }
+
+ $repl .= '</ul>';
+ }else{
+ $repl = '<b>rss can not be found, id must be a number</b>';
+ }
+ return $repl;
+}
+
+?>
|
