Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -1,25 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > RSS FUNCTIONS (Simple, light parser)
|
||||
@@ -131,6 +122,7 @@ class class_rss
|
||||
* @ var string
|
||||
*/
|
||||
var $doc_type = 'UTF-8';
|
||||
var $orig_doc_type = "";
|
||||
|
||||
/**
|
||||
* Error capture
|
||||
@@ -247,6 +239,8 @@ class class_rss
|
||||
*/
|
||||
var $convert_charset = 0;
|
||||
|
||||
var $collapse_newlines = 0;
|
||||
|
||||
/**
|
||||
* Destination charset
|
||||
*
|
||||
@@ -305,7 +299,7 @@ class class_rss
|
||||
{
|
||||
if ( ! count( $this->channels ) )
|
||||
{
|
||||
$this->errors[] = "Êàíàëû íå îïðåäåëåíû";
|
||||
$this->errors[] = "No channels defined";
|
||||
}
|
||||
|
||||
$this->rss_document = '<?xml version="1.0" encoding="'.$this->doc_type.'" ?'.'>'."\n";
|
||||
@@ -347,9 +341,9 @@ class class_rss
|
||||
// Got image?
|
||||
//-------------------------------
|
||||
|
||||
if ( is_array( $this->channel_images[ $idx ] ) and count( $this->channel_images[ $idx ] ) )
|
||||
if ( isset($this->channel_images[ $idx ]) AND is_array( $this->channel_images[ $idx ] ) AND count( $this->channel_images[ $idx ] ) )
|
||||
{
|
||||
foreach( $this->channel_images[ $idx ] as $i => $image )
|
||||
foreach( $this->channel_images[ $idx ] as $image )
|
||||
{
|
||||
$tmp_data .= "\t<image>\n";
|
||||
|
||||
@@ -368,7 +362,7 @@ class class_rss
|
||||
|
||||
if ( is_array( $this->items[ $idx ] ) and count( $this->items[ $idx ] ) )
|
||||
{
|
||||
foreach( $this->items[ $idx ] as $i => $item )
|
||||
foreach( $this->items[ $idx ] as $item )
|
||||
{
|
||||
$tmp_data .= "\t<item>\n";
|
||||
|
||||
@@ -601,32 +595,33 @@ class class_rss
|
||||
if ( count( $this->class_file_management->errors ) )
|
||||
{
|
||||
$this->errors = $this->class_file_management->errors;
|
||||
xml_parser_free($xml_parser); // Let's kill the parser before we return
|
||||
@xml_parser_free($xml_parser); // Let's kill the parser before we return
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( preg_match( "#encoding=[\"'](\S+?)[\"']#si", $data, $matches ) )
|
||||
{
|
||||
$this->orig_doc_type = $matches[1];
|
||||
}
|
||||
|
||||
if( preg_match( "#charset=(\S+?)#si", $data, $matches ) )
|
||||
{
|
||||
$this->orig_doc_type = $matches[1];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Charset conversion?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->convert_charset AND $data )
|
||||
{
|
||||
if ( $this->feed_charset != $this->destination_charset )
|
||||
if ( $this->feed_charset != $this->doc_type )
|
||||
{
|
||||
if ( ! is_object( $this->class_convert_charset ) )
|
||||
{
|
||||
require_once( IPS_CLASSES_PATH.'/class_convert_charset.php' );
|
||||
$this->class_convert_charset = new class_convert_charset();
|
||||
}
|
||||
|
||||
$data = $this->class_convert_charset->convert_charset( $data, $this->feed_charset, $this->destination_charset );
|
||||
$data = $this->ipsclass->txt_convert_charsets( $data, $this->feed_charset );
|
||||
|
||||
# Replace any char-set= data
|
||||
$data = preg_replace( "#encoding=[\"'](\S+?)[\"']#si", "encoding=\"".$this->destination_charset."\"", $data );
|
||||
$data = preg_replace( "#charset=(\S+?)#si" , "charset=".$this->destination_charset , $data );
|
||||
|
||||
# Reset doc type
|
||||
$this->doc_type = $this->destination_charset;
|
||||
$data = preg_replace( "#encoding=[\"'](\S+?)[\"']#si", "encoding=\"".$this->doc_type."\"", $data );
|
||||
$data = preg_replace( "#charset=(\S+?)#si" , "charset=".$this->doc_type , $data );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,6 +629,9 @@ class class_rss
|
||||
// Generate XML parser
|
||||
//-------------------------------
|
||||
|
||||
$supported_encodings = array( "utf-8", "iso-8859-1", "us-ascii" );
|
||||
$this->doc_type = in_array( strtolower($this->doc_type), $supported_encodings ) ? $this->doc_type : "utf-8";
|
||||
|
||||
$xml_parser = xml_parser_create( $this->doc_type );
|
||||
xml_set_element_handler( $xml_parser, array( &$this, "parse_startElement" ), array( &$this, "parse_endElement") );
|
||||
xml_set_character_data_handler($xml_parser, array( &$this, "parse_characterData" ) );
|
||||
@@ -644,14 +642,14 @@ class class_rss
|
||||
|
||||
if ( ! xml_parse( $xml_parser, $data ) )
|
||||
{
|
||||
$this->errors[] = sprintf("XML îøèáêà: %s â ñòðîêå %d", xml_error_string( xml_get_error_code($xml_parser) ), xml_get_current_line_number($xml_parser) );
|
||||
$this->errors[] = sprintf("XML error: %s at line %d", xml_error_string( xml_get_error_code($xml_parser) ), xml_get_current_line_number($xml_parser) );
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Free memory used by XML parser
|
||||
//-------------------------------
|
||||
|
||||
xml_parser_free($xml_parser);
|
||||
@xml_parser_free($xml_parser);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -706,7 +704,7 @@ class class_rss
|
||||
|
||||
if ( ! xml_parse( $xml_parser, $data, TRUE ) )
|
||||
{
|
||||
$this->errors[] = sprintf("XML îøèáêà: %s ñòðîêà %d", xml_error_string( xml_get_error_code($xml_parser) ), xml_get_current_line_number($xml_parser) );
|
||||
$this->errors[] = sprintf("XML error: %s at line %d", xml_error_string( xml_get_error_code($xml_parser) ), xml_get_current_line_number($xml_parser) );
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
@@ -752,18 +750,18 @@ class class_rss
|
||||
if ( $this->in_channel )
|
||||
{
|
||||
$this->in_channel++;
|
||||
$this->tag = $this->rss_tag_names[ $name ];
|
||||
$this->tag = isset($this->rss_tag_names[ $name ]) ? $this->rss_tag_names[ $name ] : '';
|
||||
}
|
||||
|
||||
if ( $this->rss_tag_names[ $name ] == "ITEM" )
|
||||
if ( isset($this->rss_tag_names[ $name ]) AND $this->rss_tag_names[ $name ] == "ITEM" )
|
||||
{
|
||||
$this->in_item = 1;
|
||||
}
|
||||
else if ( $this->rss_tag_names[ $name ] == "IMAGE")
|
||||
else if ( isset($this->rss_tag_names[ $name ]) AND $this->rss_tag_names[ $name ] == "IMAGE")
|
||||
{
|
||||
$this->in_image = 1;
|
||||
}
|
||||
else if ( $this->rss_tag_names[ $name ] == "CHANNEL")
|
||||
else if ( isset($this->rss_tag_names[ $name ]) AND $this->rss_tag_names[ $name ] == "CHANNEL")
|
||||
{
|
||||
$this->in_channel = 1;
|
||||
}
|
||||
@@ -789,7 +787,7 @@ class class_rss
|
||||
|
||||
$name = strtoupper($name);
|
||||
|
||||
if ( $this->rss_tag_names[ $name ] == "IMAGE" )
|
||||
if ( isset($this->rss_tag_names[ $name ]) AND $this->rss_tag_names[ $name ] == "IMAGE" )
|
||||
{
|
||||
$this->rss_images[ $this->cur_channel ]['url'] = $this->rss_img_image;
|
||||
$this->rss_images[ $this->cur_channel ]['title'] = $this->rss_img_title;
|
||||
@@ -801,7 +799,7 @@ class class_rss
|
||||
$this->_kill_image_elements();
|
||||
$this->in_image = 0;
|
||||
}
|
||||
else if ( $this->rss_tag_names[ $name ] == "CHANNEL" )
|
||||
else if ( isset($this->rss_tag_names[ $name ]) AND $this->rss_tag_names[ $name ] == "CHANNEL" )
|
||||
{
|
||||
//-------------------------------
|
||||
// Add data
|
||||
@@ -827,7 +825,7 @@ class class_rss
|
||||
$this->_kill_channel_elements();
|
||||
$this->in_channel = 0;
|
||||
}
|
||||
else if ( $this->rss_tag_names[ $name ] == "ITEM" )
|
||||
else if ( isset($this->rss_tag_names[ $name ]) AND $this->rss_tag_names[ $name ] == "ITEM" )
|
||||
{
|
||||
if ( $this->rss_count < $this->rss_max_show )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user