[Evocms-plugins-commits] SF.net SVN: evocms-plugins:[1096] feed_importer_plugin/trunk/_feed_importe
Brought to you by:
blueyed
From: <sa...@us...> - 2009-04-06 09:44:58
|
Revision: 1096 http://evocms-plugins.svn.sourceforge.net/evocms-plugins/?rev=1096&view=rev Author: sam2kb Date: 2009-04-06 09:44:48 +0000 (Mon, 06 Apr 2009) Log Message: ----------- now uses $evo_charset instead of $current_charset see http://forums.b2evolution.net/viewtopic.php?p=90052#90052 Modified Paths: -------------- feed_importer_plugin/trunk/_feed_importer.plugin.php Modified: feed_importer_plugin/trunk/_feed_importer.plugin.php =================================================================== --- feed_importer_plugin/trunk/_feed_importer.plugin.php 2009-04-05 06:28:15 UTC (rev 1095) +++ feed_importer_plugin/trunk/_feed_importer.plugin.php 2009-04-06 09:44:48 UTC (rev 1096) @@ -28,8 +28,8 @@ var $apply_rendering = 'never'; var $number_of_installs = 1; - // String separator for imported text files - var $parts_separator = '@+@'; + var $parts_separator = '@+@'; // String separator for imported text files + var $simplepie = 'simplepie-1.1.3.inc'; // SimplePie filename var $dir; /** @@ -397,6 +397,8 @@ foreach( $options['items'] as $item ) { + //var_export($item); + // Check if post already exists in our DB if( $check_existance && ($skip_ID = $this->post_exists($item)) ) { @@ -420,7 +422,7 @@ 'tags' => array(), 'locale' => '', ), $item ); - + if( empty($params['date']) ) { // If date not set, use current time $params['date'] = date('Y-m-d H:i:s',time()); @@ -465,10 +467,10 @@ */ function parse_feed( $feed_url ) { - global $DB, $current_charset, $use_strict; - + global $DB, $evo_charset, $current_charset, $use_strict; + // Make sure the simple pie class is loaded - require_once dirname(__FILE__).'/simplepie.inc'; + require_once dirname(__FILE__).'/'.$this->simplepie; if( ! $content = $this->get_data($feed_url) ) return false; @@ -478,12 +480,14 @@ $SimplePie->enable_cache( false ); $SimplePie->remove_div( true ); $SimplePie->strip_comments( true ); - $SimplePie->set_output_encoding( $current_charset ); + $SimplePie->set_output_encoding( $evo_charset ); $SimplePie->init(); $SimplePie->handle_content_type(); if( $feed_items = $SimplePie->get_items() ) { // We have feed items + + //var_export($feed_items); $items = array(); foreach( $feed_items as $feed_item ) { @@ -545,11 +549,16 @@ 'image' => $link, ); + //var_export($items); return array( 'feed' => $feed, 'items' => $items ); } else { // Display an error - $this->msg( $SimplePie->error() , 'error' ); + if( !$error = $SimplePie->error() ) + { + $error = 'Unknown SimplePie error'; + } + $this->msg( $error, 'error' ); } return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |