summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorwjames5 <will@tekimaki.com>2007-08-03 13:12:41 +0000
committerwjames5 <will@tekimaki.com>2007-08-03 13:12:41 +0000
commit24a354b72c1599542fae768e496dbaadd616642e (patch)
tree6bd34f278205d581f3838bfe2e08036baaf26b3f /modules
parentef39f3a1623a9833052be7a703e1d96a3f4177c7 (diff)
downloadrss-24a354b72c1599542fae768e496dbaadd616642e.tar.gz
rss-24a354b72c1599542fae768e496dbaadd616642e.tar.bz2
rss-24a354b72c1599542fae768e496dbaadd616642e.zip
ooops remove old code was working fromR202PRE_LIB_ATTACHMENT_REFACTOR
Diffstat (limited to 'modules')
-rw-r--r--modules/mod_rss_feed.php91
1 files changed, 0 insertions, 91 deletions
diff --git a/modules/mod_rss_feed.php b/modules/mod_rss_feed.php
index 879cd45..8ffb87a 100644
--- a/modules/mod_rss_feed.php
+++ b/modules/mod_rss_feed.php
@@ -38,95 +38,4 @@ if ( $items = $rsslib->parse_feeds( $listHash ) ){
$max = !empty( $module_params['max'] ) ? $module_params['max'] : 99;
$gBitSmarty->assign( 'max', $max );
}
-
-
-
-/*
-//load up SimplePie
-require_once( UTIL_PKG_PATH.'simplepie/simplepie.inc' );
-
-//set path to rss feed cache
-$cache_path = TEMP_PKG_PATH.'rss/simplepie';
-
-//we do this earlier instead of later because if we can't cache the source we shouldn't be pulling the rss feed.
-if( !is_dir( $cache_path ) && !mkdir_p( $cache_path ) ) {
- bit_log_error( 'Can not create the cache directory: '.$cache_path );
-}else{
- // moduleParams contains lots of goodies: extract for easier handling
- extract( $moduleParams );
-
- if (!is_array($module_params['id'])){
- $ids = explode( ",", $module_params['id'] );
- }else{
- $ids = $module_params['id'];
- }
-
- $urls = Array();
-
- foreach ($ids as $id){
- if( @BitBase::verifyId( $id ) ) {
- $feedHash = $rsslib->get_rss_module( $id );
- $urls[] = $feedHash['url'];
- }else{
- //todo assign this as an error
- //$repl = '<b>rss can not be found, id must be a number</b>';
- }
- }
-
- $feed = new SimplePie();
-
- //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 );
-
- //modules may not be cached so for now we relay the cache time to simplepie
- $cache_time = !empty($cache_time)?$cache_time:1;
- $feed->set_cache_duration( $cache_time );
-
- //not sure - we may want to eventually use this
- //$feed->set_stupidly_fast(TRUE);
-
- // Initialize the feed object
- $feed->init();
-
- // This will work if all of the feeds accept the same settings.
- $feed->handle_content_type();
-
- $items = $feed->get_items();
-
- $gBitSmarty->assign( 'modRSSItems', $items );
-
- $shortdescs = Array();
-
- if ( !empty($module_params['desc_length']) && is_numeric($module_params['desc_length']) && !empty($items)){
- foreach ($items as $item){
- //we try to trim each story to given number of sentences
- $sentences = $rsslib->get_short_desc( $item->get_description() );
-
- $shortdesc = NULL;
- for ($n = 0; $n < $module_params['desc_length']; $n++){
- $space = ($n > 0)?" ":NULL;
- $shortdesc .= $space;
- $shortdesc .= ( !empty( $sentences[$n] ) && $sentences[$n] != NULL ) ? $sentences[$n] : NULL;
- }
-
- $shortdescs[] = $shortdesc;
- }
- }
-
- $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 );
-}
-*/
?>