diff options
| author | wjames5 <will@tekimaki.com> | 2007-08-01 12:00:56 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2007-08-01 12:00:56 +0000 |
| commit | 85a02d9bb7c2e1cc5c5c88ab39eaa1e14534de1b (patch) | |
| tree | c4a58e93d83e5efae62f881c16130abb80a2f78a /modules | |
| parent | eb50f2632705b9048957f006a011aaf0c301260c (diff) | |
| download | rss-85a02d9bb7c2e1cc5c5c88ab39eaa1e14534de1b.tar.gz rss-85a02d9bb7c2e1cc5c5c88ab39eaa1e14534de1b.tar.bz2 rss-85a02d9bb7c2e1cc5c5c88ab39eaa1e14534de1b.zip | |
move common processes into class
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mod_rss_feed.php | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/modules/mod_rss_feed.php b/modules/mod_rss_feed.php index 66c6a82..879cd45 100644 --- a/modules/mod_rss_feed.php +++ b/modules/mod_rss_feed.php @@ -10,6 +10,38 @@ global $rsslib; require_once( RSS_PKG_PATH.'rss_lib.php' ); +extract( $moduleParams ); + +$listHash = Array(); +$listHash['id'] = $module_params['id']; +$listHash['cache_time'] = !empty($cache_time)?$cache_time:1; + +if ( $items = $rsslib->parse_feeds( $listHash ) ){ + $gBitSmarty->assign( 'modRSSItems', $items ); + + //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'] ); + } + + $gBitSmarty->assign( 'short_desc', $shortdescs ); + + //if desc is set and no desc_length is given then we present the full description/content of each item + $hideDesc = TRUE; + if (!empty($module_params['desc']) && $module_params['desc'] == 'y' && empty($module_params['desc_length']) ){ + $hideDesc = FALSE; + } + + $gBitSmarty->assign( 'hideDesc', $hideDesc ); + + $max = !empty( $module_params['max'] ) ? $module_params['max'] : 99; + $gBitSmarty->assign( 'max', $max ); +} + + + +/* //load up SimplePie require_once( UTIL_PKG_PATH.'simplepie/simplepie.inc' ); @@ -41,10 +73,9 @@ if( !is_dir( $cache_path ) && !mkdir_p( $cache_path ) ) { } } - //$feed = new SimplePie( $urls, $cache_path, 1 ); $feed = new SimplePie(); - //Instead of only passing in one feed url, we'll pass in an array of three + //Instead of only passing in one feed url, we'll pass in an array of multiple feeds $feed->set_feed_url( $urls ); $feed->set_cache_location( $cache_path ); @@ -97,4 +128,5 @@ if( !is_dir( $cache_path ) && !mkdir_p( $cache_path ) ) { $max = !empty( $module_params['max'] ) ? $module_params['max'] : 99; $gBitSmarty->assign( 'max', $max ); } +*/ ?> |
