Version 2.3.6

This commit is contained in:
Neo committed 2025-12-19 00:26:08 -08:00
1 parent a3bb603c96
commit 19b38c7c74
764 files changed
+143731 -118164

No files matched your search

+82 -62
View File
@@ -2,24 +2,14 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.2.2
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:54 PM
| Release: e3790216629e5a2aaf37070b32237f06
| 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)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
@@ -34,22 +24,24 @@
*/
/**
* API: Ôîðóìîâ
* API: Forums
*
* ÏÐÈÌÅÐ ÈÑÏÎËÜÇÎÂÀÍÈß
* EXAMPLE USAGE
* <code>
$api = new api_topic_view();
$api->ipsclass =& $this->ipsclass;
$api->topic_list_config['forums'] = array( 1,2,3,4 );
$api->topic_list_config['limit'] = 10;
$topics = $api->return_topic_list_data();
// Ïðîéòè ìàññèâ $topics è âûâåñòè äàííûå
// Loop on $topics and output the data
* </code>
*
* API âîçâðàùàåò èíôîðìàöèþ î ïðèêðåïëåííûõ ôàéëàõ â ìàññèâå
* attachment_data
* API will return attachment data in an array
* attachment_data - you are responsible for any
* processing or displaying if you wish to do so
*
* Ñòðóêòóðà ìàññèâà ïðèêðåïëåííûõ ôàéëîâ:
* Attachment data returned will be in an array with the
* topic/post data like so:
[attachment_data] => Array
(
@@ -68,14 +60,12 @@
)
)
* Ïåðåáèðàÿ êëþ÷è ìàññèâà attachment_data (åñëè îíè
* ñóùåñòâóþò - åñëè íåò, òî íåò è ïðèêðåïëåííûõ ôàéëîâ)
* ìîæíî îáðàáîòàòü êàæäûé ïðèêðåïëåííûé ôàéë.
* You can then loop on the attachment_data key (if
* it exists - it won't exist if there are no attachments)
* and process each attachment in the record.
*
* Òèïû ïðèêðåïëåííûõ ôàéëîâ ( çíà÷åíèÿ types):
* thumb = ýñêèç,
* image = èçîáðàæåíèå,
* reg = ôàéë
* Attachment types - thumb = thumbnail, image = regular image
* reg = regular attachment
*
* @package InvisionPowerBoard
* @subpackage APIs
@@ -98,9 +88,9 @@ if ( ! class_exists( 'api_core' ) )
}
/**
* API: Ôîðóìîâ
* API: Languages
*
* Êëàññ ïðåäîñòàâëÿåò âñå ìåòîäû API äëÿ ðàáîòû ñ âûâîäîì òåì.
* This class deals with all available language functions.
*
* @package InvisionPowerBoard
* @subpackage APIs
@@ -111,37 +101,36 @@ if ( ! class_exists( 'api_core' ) )
class api_topic_view extends api_core
{
/**
* Îáúåêò ñóïåð-êëàññà IPS
* IPS Class Object
*
* @var object
*/
//var $ipsclass;
/**
* Êîíôèãóðàöèÿ âûâîäà ñïèñêà òåì
* Topic list config
*
* @var array
*/
var $topic_list_config = array( 'offset' => 0, // ñ êàêîé òåìû íà÷èíàòü âûâîä
'limit' => 5, // êîëè÷åñòâî âûâîäèìûõ òåì
'forums' => 1, // èç êàêèõ ôîðóìîâ áðàòü òåìû (ìîæåò áûòü ìàññèâîì)
'order_field' => 'last_post', // ïîëå ïî êîòîðîìó ñîðòèðîâàòü òåìû
'order_by' => 'DESC' ); // ïîðÿäîê ñîðòèðîâêè
var $topic_list_config = array( 'offset' => 0,
'limit' => 5,
'forums' => '*',
'order_field' => 'last_post',
'order_by' => 'DESC' );
var $attach_pids = array();
/*-------------------------------------------------------------------------*/
// Ïîëó÷åíèå ìàññèâà äàííûõ òåì
// Returns an array of topic data
/*-------------------------------------------------------------------------*/
/**
* Âîçâðàùàåò ìàññèâ ñ äàííûìè âñåõ òåì
*
* ÂÍÈÌÀÍÈÅ: ìåòîä âîçâðàùàåò ÂÑÅ òåìû, ïðàâà ïîëüçîâàòåëÿ íå ó÷èòûâàþòñÿ, ò.å.
* äîñòóïíû âñå ôîðóìû!
* Returns an array of topic data
* NOTE: Returns ALL topics regardless of permission as
* if viewed from the ACP.
*
* @return array Ìàññèâ ñ äàííûìè òåì
* @return array Array of topic data
*/
function return_topic_list_data()
function return_topic_list_data( $view_as_guest=0 )
{
//-----------------------------------------
// INIT
@@ -149,17 +138,7 @@ class api_topic_view extends api_core
$topics = array();
$this->ipsclass->init_load_cache( array( 'bbcode','emoticons','attachtypes' ) );
//-----------------------------------------
// Load parser
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$parser = new parse_bbcode();
$parser->ipsclass =& $this->ipsclass;
$parser->allow_update_caches = 0;
$parser->bypass_badwords = 0;
$this->ipsclass->init_load_cache( array( 'attachtypes' ) );
//-----------------------------------------
// Set up
@@ -169,6 +148,57 @@ class api_topic_view extends api_core
$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'lastpost' ) ? 'last_post' : $this->topic_list_config['order_field'];
$this->topic_list_config['forums'] = ( is_array( $this->topic_list_config['forums'] ) ) ? implode( ",", $this->topic_list_config['forums'] ) : $this->topic_list_config['forums'];
//-----------------------------------------
// Fix up allowed forums
//-----------------------------------------
if ( $this->topic_list_config['forums'] )
{
# Init forums...
if ( $view_as_guest )
{
$this->ipsclass->perm_id_array = explode( ',', $this->ipsclass->create_perms_from_group( $this->ipsclass->vars['guest_group'] ) );
$this->ipsclass->forums->strip_invisible = 1;
}
$this->ipsclass->forums->forums_init();
# Reset topics...
if ( $this->topic_list_config['forums'] == '*' )
{
$_tmp_array = array();
$this->topic_list_config['forums'] = '';
foreach( $this->ipsclass->forums->forum_by_id as $id => $data )
{
$_tmp_forums[] = $id;
}
}
else
{
$_tmp_forums = explode( ',', $this->topic_list_config['forums'] );
$_tmp_array = array();
$this->topic_list_config['forums'] = '';
}
foreach( $_tmp_forums as $_id )
{
if ( $view_as_guest )
{
if ( ! $this->ipsclass->forums->forums_quick_check_access( $_id ) )
{
$_tmp_array[] = $_id;
}
}
else
{
$_tmp_array[] = $_id;
}
}
$this->topic_list_config['forums'] = implode( ',', $_tmp_array );
}
//-----------------------------------------
// Get from the DB
//-----------------------------------------
@@ -197,16 +227,6 @@ class api_topic_view extends api_core
while( $row = $this->ipsclass->DB->fetch_row() )
{
//-----------------------------------------
// Format posts
//-----------------------------------------
$parser->parse_html = ( $row['use_html'] AND $row['post_htmlstate'] ) ? 1 : 0;
$parser->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
$parser->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
$row['post'] = $parser->pre_display_parse( $row['post'] );
if( $row['topic_hasattach'] )
{
$this->attach_pids[] = $row['pid'];
@@ -234,7 +254,7 @@ class api_topic_view extends api_core
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'attachments',
'where' => "attach_pid IN (".implode(",", $this->attach_pids).")"
'where' => "attach_rel_module='post' AND attach_rel_id IN (".implode(",", $this->attach_pids).")"
) );
$this->ipsclass->DB->simple_exec();