Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

+54 -57
View File
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* RSS Import
* Owner: Matt Mecham
* Last Updated: $Date: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
* Last Updated: $Date: 2011-09-29 11:46:02 -0400 (Thu, 29 Sep 2011) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 24th November 2009
* @version $Revision: 6925 $
* @version $Revision: 9568 $
*/
/**
@@ -80,110 +80,111 @@ class rss_import
/**
* Unique key
*
* @access private
* @access protected
* @var string
*/
private $_key = '';
protected $_key = '';
/**
* RSS Class handle
*
* @access private
* @access protected
* @var object
*/
private $_rssClass = null;
protected $_rssClass = null;
/**
* Feed URL
*
* @access private
* @access protected
* @var string
*/
private $_url = '';
protected $_url = '';
/**
* Items to import
*
* @access private
* @access protected
* @var int
*/
private $_limit = 10;
protected $_limit = 10;
/**
* Items already imported
*
* @access private
* @access protected
* @var int
*/
private $_importedCount = 0;
protected $_importedCount = 0;
/**
* String to match in title
*
* @access private
* @access protected
* @var int
*/
private $_titleMatch = '';
protected $_titleMatch = '';
/**
* String to match in title
*
* @access private
* @access protected
* @var int
*/
private $_contentMatch = '';
protected $_contentMatch = '';
/**
* Array of items
*
* @access private
* @access protected
* @var array
*/
private $_imported = array();
protected $_imported = array();
/**
* Maps count to date
*
* @access private
* @access protected
* @var array
*/
private $__map = array();
protected $__map = array();
/**
* GUIDS fetched
*
* @access private
* @access protected
* @var array
*/
private $__usedGuids = array();
protected $__usedGuids = array();
/**
* Internal array pointer
*
* @access private
* @access protected
* @var int
*/
private $__pointer = 0;
protected $__pointer = 0;
/**
* Last validated URL
*
* @access private
* @access protected
* @var string
*/
private $_validatedUrl = '';
protected $_validatedUrl = '';
/**
* Settings array
*
* @access private
* @access protected
* @var string
*/
private $_settings = array( 'AuthUser' => '',
'AuthPass' => '',
'ParseBbcode' => 1,
'ParseHtml' => 0,
'LinkBack' => "<a href=\"{url}\">Source</a>" );
protected $_settings = array( 'AuthUser' => '',
'AuthPass' => '',
'ParseBbcode' => 1,
'ParseHtml' => 0,
'LinkBack' => "<a href=\"{url}\">Source</a>"
);
/**
* Method constructor
@@ -192,7 +193,7 @@ class rss_import
* @access public
* @param string URL of feed
* @param string Unique key for the app/page importing (blog-{member_id} for example)
* @return void
* @return @e void
*
*/
public function __construct( $url, $key=false )
@@ -210,11 +211,10 @@ class rss_import
/* Load RSS Class */
if ( ! is_object( $this->_rssClass ) )
{
require_once( IPS_KERNEL_PATH . 'classRss.php' );
$this->_rssClass = new classRss();
$this->_rssClass->use_sockets = $this->use_sockets;
$this->_rssClass->rss_max_show = 100;
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' );
$this->_rssClass = new $classToLoad();
$this->_rssClass->rss_max_show = 100;
$this->_rssClass->orig_doc_type = IPS_DOC_CHAR_SET;
}
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
@@ -228,18 +228,16 @@ class rss_import
/**
* Magic Call method
*
* @access public
* @param string Method Name
* @param mixed Method arguments
* @return mixed
* Exception codes:
*/
public function __call( $method, $arguments )
{
$firstBit = substr( $method, 0, 3 );
$theRest = substr( $method, 3 );
if ( array_key_exists( $theRest, $this->_settings ) )
if ( isset( $this->_settings[ $theRest ] ) )
{
if ( $firstBit == 'set' )
{
@@ -255,8 +253,6 @@ class rss_import
/**
* Load
*
* @access public
*
* EXCEPTION CODES
* -- Any from validate()
*/
@@ -332,10 +328,10 @@ class rss_import
$item_data['unixdate'] = intval($item_data['unixdate']) ? intval($item_data['unixdate']) : time();
/* Convert char set? */
if ( $this->_classRss->orig_doc_type AND ( strtolower(IPS_DOC_CHAR_SET) != $this->_classRss->orig_doc_type) )
if ( $this->_rssClass->orig_doc_type != $this->_rssClass->doc_type )
{
$item_data['title'] = IPSText::convertCharsets( $item_data['title'] , $this->_classRss->orig_doc_type, IPS_DOC_CHAR_SET );
$item_data['content'] = IPSText::convertCharsets( $item_data['content'], $this->_classRss->orig_doc_type, IPS_DOC_CHAR_SET );
$item_data['title'] = IPSText::convertCharsets( $item_data['title'] , "UTF-8", IPS_DOC_CHAR_SET );
$item_data['content'] = IPSText::convertCharsets( $item_data['content'], "UTF-8", IPS_DOC_CHAR_SET );
}
/* Dates */
@@ -532,6 +528,10 @@ class rss_import
*/
public function parseContent( $content, $link="" )
{
/* Get editor */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
$editor = new $classToLoad();
/* Sort post content: Convert HTML to BBCode */
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = $this->_settings['ParseHtml'];
@@ -539,9 +539,7 @@ class rss_import
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
/* Force the RTE */
$this->registry->member()->setProperty('_canUseRTE', TRUE );
$_POST['ed-0_wysiwyg_used'] = 1;
IPSText::getTextClass( 'editor' )->method = 'rte';
$editor->setRteEnabled( true );
/* Clean up.. */
$content = preg_replace( "#<br />(\r)?\n#is", "<br />", $content );
@@ -550,7 +548,7 @@ class rss_import
{
$_raw = stripslashes($content);
$content = IPSText::getTextClass( 'bbcode' )->preDbParse( IPSText::getTextClass( 'editor' )->processRawPost( $_raw ) );
$content = IPSText::getTextClass( 'bbcode' )->preDbParse( $editor->process( $_raw ) );
}
else
{
@@ -566,7 +564,7 @@ class rss_import
{
$_raw = IPSText::getTextClass( 'bbcode' )->preEditParse( stripslashes($the_link) );
$the_link = "<br /><br />" . IPSText::getTextClass( 'bbcode' )->preDbParse( IPSText::getTextClass( 'editor' )->processRawPost( $_raw ) );
$the_link = "<br /><br />" . IPSText::getTextClass( 'bbcode' )->preDbParse( $editor->process( $_raw ) );
}
else
{
@@ -644,9 +642,9 @@ class rss_import
/**
* Reset RSS class
*
* @access private
* @access protected
*/
private function _reset()
protected function _reset()
{
/* Reset imported count */
$this->_importedCount = 0;
@@ -658,7 +656,6 @@ class rss_import
/* Set this imports doc type */
$this->_rssClass->doc_type = IPS_DOC_CHAR_SET;
$this->_rssClass->feed_charset = IPS_DOC_CHAR_SET;
/* Set this import's authentication */
$this->_rssClass->auth_req = ( $this->_settings['AuthUser'] AND $this->_settings['AuthPass'] ) ? 1 : 0;