Version 2.1.7

This commit is contained in:
Neo committed 2025-12-19 00:21:15 -08:00
1 parent 0eecc172d9
commit f73f8bff6d
941 files changed
+215301 -103093

No files matched your search

+437
View File
@@ -0,0 +1,437 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| 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)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > API: Components
| > Module written by Matt Mecham
| > Date started: Wednesday 19th July 2005 (16:57)
|
+--------------------------------------------------------------------------
*/
/**
* API: Components
*
* EXAMPLE USAGE
* <code>
* //-- UPDATE EXISTING ROW --//
* $api = new api_components();
* # Optional - if $ipsclass is not passed, it'll init
* $api->ipsclass =& $this->ipsclass;
* $api->api_init();
* $update = array (
* 'com_version' => '1.3',
* 'com_menu_data' => array( 0 => array(
* 'menu_text' => 'Link text',
* 'menu_url' => 'code=showme',
* 'menu_redirect' => 0,
* 'menu_permbit' => 'keyhere',
* 'menu_permlang' => 'Allow CREATE Something' ),
* 1 => array(
* 'menu_text' => 'Link text 2',
* 'menu_url' => 'section=tools&act=op&code=showme2',
* 'menu_redirect' => 1,
* 'menu_permbit' => 'add',
* 'menu_permlang' => '' )
* ) );
*
* $api->acp_component_update( 'blog', $update );
* //-- ENABLE A COMPONENT --//
* $api->acp_component_enable( 'blog' );
* </code>
*
* COMPONENT FIELDS
* <code>
* 'com_title' = Component Title
* 'com_author' = Component Author
* 'com_version' = Component Version
* 'com_url' = Component Home URL
* 'com_menu_data' = Component Menu Data Array
* 'com_enabled' = Component Enabled
* 'com_safemode' = Component Safemode (admins cannot alter)
* 'com_section_key' = Component Section (Key, must match filename. eg: blog if using blog.php)
* 'com_description' = Component Description
* 'com_url_uri' = Component Board Header URL URI
* 'com_url_title' = Component Board Header URL Title
* </code>
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
if ( ! defined( 'IPS_API_PATH' ) )
{
/**
* Define classes path
*/
define( 'IPS_API_PATH', dirname(__FILE__) ? dirname(__FILE__) : '.' );
}
if ( ! defined('IPS_API_CORE_LOADED') )
{
require_once( IPS_API_PATH.'/api_core.php' );
/**
* CORE LOADED
*/
define( 'IPS_API_CORE_LOADED', TRUE );
}
/**
* API: Components
*
* This class deals with all available components functions.
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class api_components extends api_core
{
/**
* Loaded component
*
* @var array
*/
var $component;
/*-------------------------------------------------------------------------*/
// Get component by key
/*-------------------------------------------------------------------------*/
/**
* Updates a component
*
* @param string Component key (eg: blog)
* @return void Populates $this->component
*/
function get_component_by_key( $key )
{
$this->component = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'components',
'where' => 'com_section="'.$key.'"' ) );
}
/*-------------------------------------------------------------------------*/
// Create menu
/*-------------------------------------------------------------------------*/
/**
* Creates serialized string from a menu array
* <code>
* $menu_data [ $item_id ]['menu_text']
* $menu_data [ $item_id ]['menu_url']
* $menu_data [ $item_id ]['menu_redirect']
* $menu_data [ $item_id ]['menu_permbit']
* $menu_data [ $item_id ]['menu_permlang']
* </code>
*
* @param array multi-dimenisonal array
* @return void;
*/
function acp_component_create_menu_data( $menu_data )
{
if ( is_array( $menu_data ) )
{
return serialize( $menu_data );
}
}
/*-------------------------------------------------------------------------*/
// Update component
/*-------------------------------------------------------------------------*/
/**
* Updates a component
*
* @param string Component key (eg: blog)
* @param array Component fields ( must match class fields, see class docs )
* @return void;
*/
function acp_component_insert( $key, $fields )
{
//-------------------------------
// INIT
//-------------------------------
$key_saved = 0;
$com_title = trim( $fields['com_title'] );
$com_version = trim( $fields['com_version'] );
$com_description = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_UNhtmlspecialchars($fields['com_description'])) );
$com_author = trim( $fields['com_author'] );
$com_url = trim( $fields['com_url'] );
$com_menu_data = $fields['com_menu_data'];
$com_enabled = intval($fields['com_enabled']);
$com_section_key = trim( $fields['com_section_key'] );
$com_safemode = intval($fields['com_safemode']);
$com_url_title = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_windowstounix($fields['com_url_title']) ) );
$com_url_uri = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_windowstounix($fields['com_url_uri']) ) );
//-------------------------------
// Check?
//-------------------------------
if ( ! $com_title OR ! $com_menu_data OR ! $com_section_key )
{
$this->api_error[] = "input_missing_fields";
return;
}
//-------------------------------
// Already a key in use?
//-------------------------------
$this->get_component_by_key( $key );
if ( $this->component['com_id'] )
{
$this->api_error[] = "duplicate_component_key";
return;
}
//-------------------------------
// Menu not already serialized?
//-------------------------------
if ( is_array( $com_menu_data ) )
{
$com_menu_data = $this->acp_component_create_menu_data( $com_menu_data );
}
//-------------------------------
// Save it
//-------------------------------
$this->ipsclass->DB->force_data_type = array( 'com_version' => 'string' );
$array = array( 'com_title' => $com_title,
'com_author' => $com_author,
'com_version' => $com_version,
'com_url' => $com_url,
'com_menu_data' => $com_menu_data,
'com_enabled' => $com_enabled,
'com_safemode' => $com_safemode,
'com_section' => $com_section_key,
'com_filename' => $com_section_key,
'com_description' => $com_description,
'com_url_uri' => $com_url_uri,
'com_url_title' => $com_url_title,
'com_date_added' => time(),
);
//-------------------------------
// Got anything to save?
//-------------------------------
if ( count( $array ) )
{
$this->ipsclass->DB->do_insert( 'components', $array );
}
//-------------------------------
// Rebuild cache
//-------------------------------
$this->acp_component_rebuildcache();
}
/*-------------------------------------------------------------------------*/
// Update component
/*-------------------------------------------------------------------------*/
/**
* Updates a component
*
* @param string Component key (eg: blog)
* @param array Component fields ( must match class fields, see class docs )
* @return void;
*/
function acp_component_update( $key, $fields )
{
//-------------------------------
// INIT
//-------------------------------
$key_saved = 0;
$save = array();
//-------------------------------
// Check?
//-------------------------------
if ( ! $fields OR ! $key )
{
$this->api_error[] = "input_missing_fields";
return;
}
//-------------------------------
// Get stuff from DB
//-------------------------------
$this->get_component_by_key( $key );
if ( ! $this->component['com_id'] )
{
$this->api_error[] = "duplicate_component_key";
return;
}
$this->component['_com_section'] = $this->component['com_section'];
//-------------------------------
// Update...
//-------------------------------
foreach( $fields as $k => $v )
{
if ( ( $k == 'com_section_key' OR $k == 'com_section' OR $k == 'com_filename' ) AND $key_saved == 0 )
{
//-------------------------------
// Make sure we don't have another
// key the same
//-------------------------------
if ( $v != $this->component['_com_section'] )
{
$tmp = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'com_id',
'from' => 'components',
'where' => 'com_section="'.$v.'"' ) );
if ( $tmp['com_id'] AND $tmp['com_id'] != $this->component['com_id'] )
{
$this->api_error[] = "duplicate_component_key";
return;
}
}
$save['com_section'] = $v;
$save['com_filename'] = $v;
$key_saved = 1;
}
else if ( $k == 'com_menu_data' )
{
//-------------------------------
// Menu not already serialized?
//-------------------------------
if ( is_array( $v ) )
{
$v = $this->acp_component_create_menu_data( $v );
}
$save[ $k ] = $v;
}
else
{
$save[ $k ] = $v;
}
}
//-------------------------------
// Got anything to save?
//-------------------------------
if ( count( $save ) )
{
$this->ipsclass->DB->do_update( 'components', $save, 'com_id='.$this->component['com_id'] );
}
$this->acp_component_rebuildcache();
}
/*-------------------------------------------------------------------------*/
// Remove component
/*-------------------------------------------------------------------------*/
/**
* Remove a component [ no confirmation screens! ]
*
* @param string Component key (eg: blog)
* @return void
*/
function acp_component_remove( $key )
{
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'components', 'where' => 'com_section="'.$key.'"' ) );
$this->acp_component_rebuildcache();
}
/*-------------------------------------------------------------------------*/
// Enable component
/*-------------------------------------------------------------------------*/
/**
* Enable a component
*
* @param string Component key (eg: blog)
* @return void
*/
function acp_component_enable( $key )
{
$this->acp_component_update( $key, array( 'com_enabled' => 1 ) );
$this->acp_component_rebuildcache();
}
/*-------------------------------------------------------------------------*/
// Disable component
/*-------------------------------------------------------------------------*/
/**
* Enable a component
*
* @param string Component key (eg: blog)
* @return void
*/
function acp_component_disable( $key )
{
$this->acp_component_update( $key, array( 'com_enabled' => 0 ) );
$this->acp_component_rebuildcache();
}
/*-------------------------------------------------------------------------*/
// Components Rebuild Cache
/*-------------------------------------------------------------------------*/
/**
* Rebuild cache
*
* @return void
*/
function acp_component_rebuildcache()
{
require_once( ROOT_PATH. 'sources/action_admin/components.php' );
$components = new ad_components();
$components->ipsclass =& $this->ipsclass;
$components->components_rebuildcache();
}
}
?>
+266
View File
@@ -0,0 +1,266 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| 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)
+---------------------------------------------------------------------------
| > $Date: 2005-12-02 10:17:19 +0000 (Fri, 02 Dec 2005) $
| > $Revision: 89 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > API: Core functions
| > Module written by Matt Mecham
| > Date started: Wednesday 19th July 2005 (14:57)
|
+--------------------------------------------------------------------------
*/
/**
* API: CORE
*
* This class deals with all core functions.
* This class deals with all available language functions.
* If $ipsclass is passed to it, then it will skip the init
* However, if $ipsclass is not an object, it'll initialize
* the $ipsclass object, and by default load all the required
* IPB classes and init them (DB, converge, forums, display, session)
* and it'll also get a new DB connection and load settings and caches.
* You can alter which classes are loaded via the $this->load_classes[-class-] = 1;
* array
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
/**
* API: CORE
*
* This class deals with all core functions.
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class api_core
{
/**
* IPS Class Object
*
* @var object
*/
var $ipsclass;
/**
* API init run
*
* @var integer boolean
*/
var $init_run;
/**
* API Error string
*
* @var array Errors
*/
var $api_error = array();
/**
* API Load full?
*
* @var integer boolean
*/
var $full_load = 1;
/**
* API Path to IPB root (where init.php/index.php is)
*
* @var string Path to IPB root folder
*/
var $path_to_ipb = './';
/**
* API Load classes
*
* @var array Classes to load default: [display,forums,converge,session]
*/
var $load_classes = array( 'display' => 1,
'forums' => 1,
'converge' => 1,
'session' => 1 );
/*-------------------------------------------------------------------------*/
// API init
/*-------------------------------------------------------------------------*/
/**
* Determines if we have required ipsclass vars
* on hand
*
* @return void;
*/
function api_init()
{
//-------------------------------
// Already loaded?
//-------------------------------
if ( $this->init_run OR ! $this->full_load )
{
return;
}
//-------------------------------
// INIT run?
//-------------------------------
if ( ! defined( 'IPB_INIT_DONE' ) )
{
define( 'IPB_THIS_SCRIPT', 'api' );
require_once( $this->path_to_ipb.'init.php' );
}
//-------------------------------
// IPS Class an object?
//-------------------------------
if ( ! is_object( $this->ipsclass ) )
{
$INFO = array();
//--------------------------------
// Load our classes
//--------------------------------
require_once ROOT_PATH . "sources/ipsclass.php";
require_once ROOT_PATH . "conf_global.php";
# Initiate super-class
$ipsclass = new ipsclass();
$ipsclass->vars = $INFO;
$this->ipsclass =& $ipsclass;
$this->ipsclass->base_url = $this->ipsclass->vars['board_url'].'/index.'.$this->ipsclass->vars['php_ext'].'?';
}
//-------------------------------
// DB connected?
//-------------------------------
if ( ! defined( 'IPSCLASS_DB_LOADED' ) )
{
$this->ipsclass->vars['sql_force_new_connection'] = 1;
$this->ipsclass->init_db_connection();
}
//-------------------------------
// DISPLAY Object?
//-------------------------------
if ( ! is_object( $this->ipsclass->print ) AND $this->load_classes['print'] )
{
require_once ROOT_PATH . "sources/classes/class_display.php";
$this->ipsclass->print = new display();
$this->ipsclass->print->ipsclass =& $this->ipsclass;
}
//-------------------------------
// SESSION Object?
//-------------------------------
if ( ! is_object( $this->ipsclass->sess ) AND $this->load_classes['session'] )
{
require_once ROOT_PATH . "sources/classes/class_session.php";
$this->ipsclass->sess = new session();
$this->ipsclass->sess->ipsclass =& $this->ipsclass;
}
//-------------------------------
// FORUMS Object?
//-------------------------------
if ( ! is_object( $this->ipsclass->forums ) AND $this->load_classes['forums'] )
{
require_once ROOT_PATH . "sources/classes/class_forums.php";
$this->ipsclass->forums = new forum_functions();
$this->ipsclass->forums->ipsclass =& $this->ipsclass;
}
//-------------------------------
// Converge Object?
//-------------------------------
if ( ! is_object( $this->ipsclass->converge ) AND $this->load_classes['converge'] )
{
require_once KERNEL_PATH . "class_converge.php";
$this->ipsclass->converge = new class_converge( $this->ipsclass->DB );
}
//-------------------------------
// Caches init?
//-------------------------------
if ( ! defined('IPSCLASS_CACHE_LOADED') )
{
$this->ipsclass->init_load_cache( array('rss_export', 'bbcode', 'badwords', 'emoticons', 'settings', 'group_cache', 'systemvars', 'skin_id_cache', 'forum_cache', 'moderators', 'stats') );
}
if ( ! defined('IPSCLASS_INITIATED') )
{
$this->ipsclass->initiate_ipsclass();
$this->ipsclass->md5_check = $ipsclass->return_md5_check();
$this->ipsclass->parse_incoming();
if ( ! is_object( $this->ipsclass->forums ) )
{
$this->ipsclass->forums->ipsclass =& $this->ipsclass;
$this->ipsclass->forums->strip_invisible = 1;
$this->ipsclass->forums->forums_init();
}
$this->ipsclass->load_skin();
}
$this->init_run = 1;
}
}
?>
+137
View File
@@ -0,0 +1,137 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| 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)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > API: Languages
| > Module written by Matt Mecham
| > Date started: Wednesday 30th November 2005 (11:40)
|
+--------------------------------------------------------------------------
*/
/**
* API: Forums
*
* EXAMPLE USAGE
* <code>
* To follow
* </code>
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
if ( ! defined( 'IPS_API_PATH' ) )
{
/**
* Define classes path
*/
define( 'IPS_API_PATH', dirname(__FILE__) ? dirname(__FILE__) : '.' );
}
if ( ! class_exists( 'api_core' ) )
{
require_once( IPS_API_PATH.'/api_core.php' );
}
/**
* API: Languages
*
* This class deals with all available language functions.
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class api_forums extends api_core
{
/**
* IPS Class Object
*
* @var object
*/
//var $ipsclass;
/*-------------------------------------------------------------------------*/
// Returns a forum jump option list
/*-------------------------------------------------------------------------*/
/**
* Returns a forum jump list WITHOUT the SELECT tag
* NOTE: Returns ALL forums regardless of permission as
* if viewed from the ACP.
*
* @param array Array of selected IDs
* @return string HTML <option> list of forums;
*/
function return_forum_jump_option_list( $selected=array() )
{
//-----------------------------------------
// Get forums...
//-----------------------------------------
$this->ipsclass->forums->forums_init();
$content = $this->ipsclass->forums->forums_forum_jump( 0, 0, 1 );
//-----------------------------------------
// Splice in selected IDs
//-----------------------------------------
if ( is_array( $selected ) and count( $selected ) )
{
foreach( $selected as $id )
{
$content = preg_replace( "#value=([\"'])($id)[\"']#si", "value=\\1\\2\\1 selected='selected'", $content );
}
}
//-----------------------------------------
// Return...
//-----------------------------------------
return $content;
}
}
?>
+193
View File
@@ -0,0 +1,193 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| 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)
+---------------------------------------------------------------------------
| > $Date: 2005-11-30 12:25:19 +0000 (Wed, 30 Nov 2005) $
| > $Revision: 86 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > API: Languages
| > Module written by Matt Mecham
| > Date started: Wednesday 19th July 2005 (14:33)
|
+--------------------------------------------------------------------------
*/
/**
* API: Languages
*
* EXAMPLE USAGE
* <code>
* $api = new api_language();
* # Optional - if $ipsclass is not passed, it'll init
* $api->ipsclass =& $this->ipsclass;
* $api->api_init();
* $api->lang_add_strings( array('lang_key' => "Language value" ), 'lang_subscriptions' );
* </code>
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
if ( ! defined( 'IPS_API_PATH' ) )
{
/**
* Define classes path
*/
define( 'IPS_API_PATH', dirname(__FILE__) ? dirname(__FILE__) : '.' );
}
if ( ! class_exists( 'api_core' ) )
{
require_once( IPS_API_PATH.'/api_core.php' );
}
/**
* API: Languages
*
* This class deals with all available language functions.
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class api_language extends api_core
{
/**
* IPS Class Object
*
* @var object
*/
//var $ipsclass;
/*-------------------------------------------------------------------------*/
// Add language strings to IPB language system
/*-------------------------------------------------------------------------*/
/**
* Add language strings to the IPB language system
*
* @param array Language keys => values to add
* @param string Language file, eg: lang_global
* @param string Language pack to add to or 'all' to add to all
* @return void;
*/
function lang_add_strings( $to_add=array(), $add_lang_file='', $add_where='all')
{
//-------------------------------
// Check?
//-------------------------------
if ( ! count( $to_add ) )
{
$this->api_error[] = "input_missing_fields";
return;
}
if ( ! $add_lang_file )
{
$this->api_error[] = "input_missing_fields";
return;
}
//-------------------------------
// Trim off .php
//-------------------------------
$add_lang_file = str_replace( '.php', '', $add_lang_file );
//-------------------------------
// Get lang stuff from DB
//-------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages' ) );
$o = $this->ipsclass->DB->simple_exec();
//-------------------------------
// Go loopy
//-------------------------------
while( $row = $this->ipsclass->DB->fetch_row( $o ) )
{
$lang = array();
if ( $add_where == $row['ldir'] OR $add_where == 'all' )
{
$lang_file = CACHE_PATH."cache/lang_cache/".$row['ldir']."/".$add_lang_file.'.php';
if ( file_exists( $lang_file ) )
{
require ( $lang_file );
}
else
{
$this->errors[] = "file_not_found";
return;
}
foreach( $to_add as $k => $v )
{
$lang[ $k ] = $v;
}
//-------------------------------
// Write output
//-------------------------------
$start = "<?php\n\n";
foreach( $lang as $key => $text)
{
$text = preg_replace("/\n{1,}$/", "", $text);
$start .= "\n".'$lang['."'$key'".'] = "'.addslashes($text).'";';
}
$start .= "\n\n?".">";
if ( $fh = fopen( $lang_file, 'w') )
{
fwrite($fh, $start );
fclose($fh);
}
else
{
$this->api_error[] = "file_not_writeable";
continue;
}
}
}
}
}
?>
+204
View File
@@ -0,0 +1,204 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| 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)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > API: Languages
| > Module written by Matt Mecham
| > Date started: Wednesday 30th November 2005 (11:40)
|
+--------------------------------------------------------------------------
*/
/**
* API: Forums
*
* EXAMPLE USAGE
* <code>
* To follow
* </code>
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
if ( ! defined( 'IPS_API_PATH' ) )
{
/**
* Define classes path
*/
define( 'IPS_API_PATH', dirname(__FILE__) ? dirname(__FILE__) : '.' );
}
if ( ! class_exists( 'api_core' ) )
{
require_once( IPS_API_PATH.'/api_core.php' );
}
/**
* API: Languages
*
* This class deals with all available language functions.
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class api_topic_view extends api_core
{
/**
* 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' );
/*-------------------------------------------------------------------------*/
// 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 Array of topic data
*/
function return_topic_list_data()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topics = array();
//-----------------------------------------
// 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;
//-----------------------------------------
// Set up
//-----------------------------------------
$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'started' ) ? 'start_date' : $this->topic_list_config['order_field'];
$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'];
//-----------------------------------------
// Get from the DB
//-----------------------------------------
$this->ipsclass->DB->build_query( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.approved=1 AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',
'order' => $this->topic_list_config['order_field'].' '.$this->topic_list_config['order_by'],
'limit' => array( $this->topic_list_config['offset'], $this->topic_list_config['limit'] ),
'add_join' => array(
0 => array( 'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => 't.topic_firstpost=p.pid',
'type' => 'left' ),
1 => array( 'select' => 'm.id as member_id, m.members_display_name as member_name, m.mgroup, m.email',
'from' => array( 'members' => 'm' ),
'where' => "m.id=p.author_id",
'type' => 'left' ),
2 => array( 'select' => 'f.id as forum_id, f.name as forum_name, f.use_html',
'from' => array( 'forums' => 'f' ),
'where' => "t.forum_id=f.id",
'type' => 'left' ) )
) );
$this->ipsclass->DB->exec_query();
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'] );
//-----------------------------------------
// Guest name?
//-----------------------------------------
$row['member_name'] = $row['member_name'] ? $row['member_name'] : $row['author_name'];
//-----------------------------------------
// Topic link
//-----------------------------------------
$row['link-topic'] = $this->ipsclass->base_url.'showtopic='.$row['tid'];
$row['link-forum'] = $this->ipsclass->base_url.'showforum='.$row['forum_id'];
$topics[] = $row;
}
//-----------------------------------------
// Return...
//-----------------------------------------
return $topics;
}
}
?>
+818
View File
@@ -0,0 +1,818 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| 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)
+---------------------------------------------------------------------------
| > $Date: 2006-02-01 18:16:26 +0000 (Wed, 01 Feb 2006) $
| > $Revision: 132 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > API: Topics and Posts
| > Module written by Matt Mecham
| > Date started: Wednesday 20th July 2005 (14:48)
|
+--------------------------------------------------------------------------
*/
/**
* API: Topics & Posts
*
* IMPORTANT: This API DOESN'T check permissions, etc
* So, it's entirely possible to add replies to closed topics
* and to post new topics where the user doesn't normally have
* permission.
* EXAMPLE USAGE
* <code>
* $api = new api_topics_and_posts();
* $api->ipsclass =& $this->ipsclass;
* // ADD POST REPLY
* $api->set_author_by_name('matt');
* $api->set_post_content("<b>Hello World!</b> :D");
* $api->set_topic_id( 100 );
* # Default for show_signature is 1, added here for completeness
* $api->post_settings['show_signature'] = 1;
* # Optionally turn off rebuild to not rebuild topic, forum and stats
* # $api->delay_rebuild = 1;
* $api->create_new_reply();
* // ADD NEW TOPIC
* $api->set_author_by_name('matt');
* $api->set_post_content("<b>Hello World!</b> :D");
* $api->set_forum_id( 10 );
* $api->set_topic_title('Hello World');
* $api->set_topic_description('I am the description');
* $api->set_topic_state('open');
* $api->create_new_topic();
* </code>
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
if ( ! defined( 'IPS_API_PATH' ) )
{
/**
* Define classes path
*/
define( 'IPS_API_PATH', dirname(__FILE__) ? dirname(__FILE__) : '.' );
}
if ( ! class_exists( 'api_core' ) )
{
require_once( IPS_API_PATH.'/api_core.php' );
}
/**
* API: Topics & Posts
*
* This class deals with all showing, creating and editing topics and posts
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class api_topics_and_posts extends api_core
{
/**
* Author DB row
*
* @var array
*/
var $author = array();
/**
* Post content
*
* @var string
*/
var $post_content = "";
/**
* Topic ID
*
* @var integer
*/
var $topic_id = "";
/**
* Set forum ID
*
* @var integer
*/
var $forum_id = "";
/**
* Topic DB row
*
* @var array
*/
var $topic = array();
/**
* Forum DB row
*
* @var array
*/
var $forum = array();
/**
* Editor class
*
* @var object
*/
var $editor;
/**
* Post class
*
* @var object
*/
var $post;
/**
* Email class
*
* @var object
*/
var $email;
/**
* Parser class
*
* @var object
*/
var $parser;
/**
* Func Mod
*
* @var object
*/
var $func_mod;
/**
* Flag classes loaded?
*
* @var integer boolean
*/
var $classes_loaded = 0;
/**
* Delay rebuild flag
*
* If set to 1, you will need to manually
* rebuild topic info and forum info.
*
* @var integer boolean
*/
var $delay_rebuild = 0;
/**
* Post settings
*
* @var array show_signature, show_emoticons, post_icon_id, is_invisible, post_date, ip_address, parse_html
*/
var $post_settings = array( 'show_signature' => 1,
'show_emoticons' => 1,
'post_icon_id' => 0,
'is_invisible' => 0,
'post_date' => 0,
'ip_address' => 0,
'parse_html' => 0 );
/**
* Topic settings
*
* @var array topic_date, post_icon_id
*/
var $topic_settings = array( 'topic_date' => 0,
'post_icon_id' => 0 );
/**
* Topic title
*
* @var string
*/
var $topic_title;
/**
* Topic description
*
* @var string
*/
var $topic_desc;
/**
* Topic state
*
* @var string (open or closed)
*/
var $topic_state = 'open';
/**
* Topic pinned
*
* @var integer
*/
var $topic_pinned = 0;
/**
* Topic invisible
*
* @var integer
*/
var $topic_invisible = 0;
/*-------------------------------------------------------------------------*/
// Create new topic
/*-------------------------------------------------------------------------*/
/**
* Saves the post
*
* @return void
*/
function create_new_topic()
{
//-------------------------------
// Got anything?
//-------------------------------
if ( ! $this->author OR ! $this->post_content OR ! $this->forum_id OR ! $this->topic_title )
{
$this->api_error[] = 'not_all_data_ready';
$this->post_content = '';
return FALSE;
}
$this->api_tap_load_classes();
$this->topic_invisible = $this->topic_invisible ? $this->topic_invisible : $this->post_settings['is_invisible'];
//-------------------------------
// Attempt to format
//-------------------------------
$this->topic = array(
'title' => $this->ipsclass->parse_clean_value( $this->topic_title ),
'description' => $this->ipsclass->parse_clean_value( $this->topic_desc ),
'state' => $this->topic_state,
'posts' => 0,
'starter_id' => $this->author['id'],
'starter_name' => $this->author['members_display_name'],
'start_date' => $this->topic_settings['topic_date'] ? $this->topic_settings['topic_date'] : time(),
'last_poster_id' => $this->author['id'],
'last_poster_name' => $this->author['members_display_name'],
'last_post' => $this->topic_settings['topic_date'] ? $this->topic_settings['topic_date'] : time(),
'icon_id' => $this->topic_settings['post_icon_id'],
'author_mode' => 1,
'poll_state' => 0,
'last_vote' => 0,
'views' => 0,
'forum_id' => $this->forum_id,
'approved' => $this->topic_invisible ? 0 : 1,
'pinned' => $this->topic_pinned );
//-------------------------------
// Insert topic
//-------------------------------
$this->ipsclass->DB->do_insert( 'topics', $this->topic );
$this->topic_id = $this->ipsclass->DB->get_insert_id();
$this->topic['tid'] = $this->topic_id;
//-----------------------------------------
// Re-do member info
//-----------------------------------------
$temp_store = $this->ipsclass->member;
$this->ipsclass->member = $this->author;
//-----------------------------------------
// Tracker?
//-----------------------------------------
$this->post->forum_tracker( $this->topic['forum_id'], $this->topic_id, $this->topic['title'], $this->forum['name'], $this->post_content );
//-------------------------------
// Add post
//-------------------------------
$return_val = $this->create_new_reply();
$this->ipsclass->member = $temp_store;
return $return_val;
}
/*-------------------------------------------------------------------------*/
// Create new topic
/*-------------------------------------------------------------------------*/
/**
* Create new topic
*
* @return void
*/
function create_new_reply()
{
//-------------------------------
// Got anything?
//-------------------------------
if ( ! $this->author OR ! $this->post_content OR ! $this->topic_id )
{
$this->api_error[] = 'no_post_content';
$this->post_content = '';
return FALSE;
}
$this->api_tap_load_classes();
//-------------------------------
// Attempt to format
//-------------------------------
$post = array(
'author_id' => $this->author['id'],
'use_sig' => $this->post_settings['show_signature'],
'use_emo' => $this->post_settings['show_emoticons'],
'ip_address' => $this->post_settings['ip_address'] ? $this->post_settings['ip_address'] : $this->ipsclass->ip_address,
'post_date' => $this->post_settings['post_date'] ? $this->post_settings['post_date'] : time(),
'icon_id' => $this->post_settings['post_icon_id'],
'post' => $this->post_content,
'author_name' => $this->author['members_display_name'],
'topic_id' => $this->topic_id,
'queued' => $this->post_settings['is_invisible'],
'post_htmlstate' => 0,
'post_key' => md5( time() ),
);
//-----------------------------------------
// Add post to DB
//-----------------------------------------
$this->ipsclass->DB->do_insert( 'posts', $post );
//-----------------------------------------
// Rebuild topic
//-----------------------------------------
$this->func_mod->rebuild_topic( $this->topic_id, 0 );
//-----------------------------------------
// Increment member?
//-----------------------------------------
if ( $this->forum['inc_postcount'] )
{
$this->ipsclass->DB->simple_update( 'members', 'posts=posts+1', 'id='.intval( $this->author['id'] ) );
$this->ipsclass->DB->simple_exec();
}
//-----------------------------------------
// Re-do member info
//-----------------------------------------
$temp_store = $this->ipsclass->member;
$this->ipsclass->member = $this->author;
//-----------------------------------------
// Tracker? (Only run when not creating topic)
//-----------------------------------------
if ( ! $this->topic_title )
{
$this->post->topic_tracker( $this->topic_id, $this->post_content, $this->author['members_display_name'], time() );
}
//-----------------------------------------
// Rebuild
//-----------------------------------------
if ( ! $this->delay_rebuild )
{
$this->tap_rebuild_forum( $this->topic['forum_id'] );
$this->tap_rebuild_stats();
}
$this->ipsclass->member = $temp_store;
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Set topic: title
/*-------------------------------------------------------------------------*/
/**
* Set topic title
*
* @param string Incoming
* @return void
*/
function set_topic_title( $data )
{
$this->topic_title = $data;
}
/*-------------------------------------------------------------------------*/
// Set topic: desc
/*-------------------------------------------------------------------------*/
/**
* Set topic description
*
* @param string Incoming
* @return void
*/
function set_topic_description( $data )
{
$this->topic_desc = $data;
}
/*-------------------------------------------------------------------------*/
// Set topic: state
/*-------------------------------------------------------------------------*/
/**
* Set topic state
*
* @param string Incoming
* @return void
*/
function set_topic_state( $data )
{
$this->topic_state = $data;
}
/*-------------------------------------------------------------------------*/
// Set topic: pinned
/*-------------------------------------------------------------------------*/
/**
* Set topic pinned
*
* @param string Incoming
* @return void
*/
function set_topic_pinned( $data )
{
$this->topic_pinned = intval($data);
}
/*-------------------------------------------------------------------------*/
// Set topic: invisible
/*-------------------------------------------------------------------------*/
/**
* Set topic pinned
*
* @param string Incoming
* @return void
*/
function set_topic_invisible( $data )
{
$this->topic_invisible = intval($data);
}
/*-------------------------------------------------------------------------*/
// Set post content
/*-------------------------------------------------------------------------*/
/**
* Set the post content
*
* @param string post content
* @return boolean populates $this->post_content
*/
function set_post_content( $post )
{
//-------------------------------
// Got anything?
//-------------------------------
if ( ! $post )
{
$this->api_error[] = 'no_post_content';
$this->post_content = '';
return FALSE;
}
//-------------------------------
// Attempt to format
//-------------------------------
$this->api_tap_load_classes();
$this->parser->parse_smilies = $this->post_settings['show_emoticons'];
$this->parser->parse_html = $this->post_settings['parse_html'];
$this->parser->parse_bbcode = 1;
$this->post_content = $this->parser->pre_db_parse( $this->editor->_rte_html_to_bbcode( $post ) );
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Set author by user_name
/*-------------------------------------------------------------------------*/
/**
* Get a member from the DB by username
*
* @param string user name
* @return boolean populates $this->author
*/
function set_author_by_name( $user_name )
{
$this->author = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'members',
'where' => "LOWER(name) = '".$this->ipsclass->DB->add_slashes(strtolower($user_name))."'",
'limit' => array( 0, 1 ) ) );
if ( ! $this->author['id'] )
{
$this->api_error[] = 'no_user_found';
$this->author = array();
return FALSE;
}
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Set author by id
/*-------------------------------------------------------------------------*/
/**
* Get a member from the DB by ID
*
* @param integer User ID
* @return boolean populates $this->author
*/
function set_author_by_id( $id )
{
$this->author = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'members',
'where' => "id=".intval($id),
'limit' => array( 0, 1 ) ) );
if ( ! $this->author['id'] )
{
$this->api_error[] = 'no_user_found';
$this->author = array();
return FALSE;
}
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Set author by display_name
/*-------------------------------------------------------------------------*/
/**
* Get a member from the DB by display name
*
* @param string member display name
* @return boolean populates $this->author
*/
function set_author_by_display_name( $display_name )
{
$this->author = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'members',
'where' => "LOWER(members_display_name) = '".$this->ipsclass->DB->add_slashes(strtolower($display_name))."'",
'limit' => array( 0, 1 ) ) );
if ( ! $this->author['id'] )
{
$this->api_error[] = 'no_user_found';
$this->author = array();
}
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Set topic by id
/*-------------------------------------------------------------------------*/
/**
* Get a topic from the DB by ID and set the current topic id
*
* @param integer Topic
* @return boolean populates $this->author
*/
function set_topic_id( $id )
{
$this->topic_id = intval($id);
//-----------------------------------------
// Verify it exists
//-----------------------------------------
$this->topic = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'topics',
'where' => "tid=".intval( $this->topic_id ),
'limit' => array( 0, 1 ) ) );
if ( ! $this->topic['tid'] )
{
$this->api_error[] = 'no_topic_found';
$this->topic = array();
return FALSE;
}
//-----------------------------------------
// Set and get forum ID
//-----------------------------------------
$this->set_forum_id( $this->topic['forum_id'] );
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Set author by id
/*-------------------------------------------------------------------------*/
/**
* Get DB info and set forum ID
*
* @param integer Topic
* @return boolean populates $this->author
*/
function set_forum_id( $id )
{
$this->forum_id = intval($id);
//-----------------------------------------
// Verify it exists
//-----------------------------------------
$this->forum = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'forums',
'where' => "id=".intval( $this->forum_id ),
'limit' => array( 0, 1 ) ) );
if ( ! $this->forum['id'] )
{
$this->api_error[] = 'no_forum_found';
$this->forum = array();
return FALSE;
}
$perms = unserialize( $this->forum['permission_array'] );
$this->forum['read_perms'] = $perms['read_perms'];
$this->forum['reply_perms'] = $perms['reply_perms'];
$this->forum['start_perms'] = $perms['start_perms'];
$this->forum['upload_perms'] = $perms['upload_perms'];
$this->forum['show_perms'] = $perms['show_perms'];
return TRUE;
}
/*-------------------------------------------------------------------------*/
// Rebuild forum stats
/*-------------------------------------------------------------------------*/
/**
* Rebuilds the forum stats
*
* @return void
*/
function tap_rebuild_forum( $forum_id )
{
//-----------------------------------------
// Load classes...
//-----------------------------------------
$this->api_tap_load_classes();
//-----------------------------------------
// Send to rebuild
//-----------------------------------------
$this->func_mod->forum_recount( $forum_id );
}
/*-------------------------------------------------------------------------*/
// Rebuild stats
/*-------------------------------------------------------------------------*/
/**
* Rebuilds the global stats
*
* @return void
*/
function tap_rebuild_stats()
{
//-----------------------------------------
// Load classes...
//-----------------------------------------
$this->api_tap_load_classes();
//-----------------------------------------
// Send to rebuild
//-----------------------------------------
$this->func_mod->stats_recount();
}
/*-------------------------------------------------------------------------*/
// Add language strings to IPB language system
/*-------------------------------------------------------------------------*/
/**
* Loads required classes...
*
* @return void;
*/
function api_tap_load_classes()
{
if ( ! $this->classes_loaded )
{
//-----------------------------------------
// Force RTE editor
//-----------------------------------------
if ( ! is_object( $this->editor ) )
{
require_once( ROOT_PATH."sources/classes/editor/class_editor.php" );
require_once( ROOT_PATH."sources/classes/editor/class_editor_rte.php" );
$this->editor = new class_editor_module();
$this->editor->ipsclass =& $this->ipsclass;
}
//-----------------------------------------
// Load the email libby
//-----------------------------------------
if( ! is_object( $this->email ) )
{
require_once( ROOT_PATH."sources/classes/class_email.php" );
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
}
//-----------------------------------------
// Load and config POST class
//-----------------------------------------
if ( ! is_object( $this->post ) )
{
require_once( ROOT_PATH."sources/classes/post/class_post.php" );
$this->post = new class_post();
$this->post->ipsclass =& $this->ipsclass;
$this->post->email =& $this->email;
//^^ Required for forum tracker
}
//-----------------------------------------
// Load and config the post parser
//-----------------------------------------
if ( ! is_object( $this->parser ) )
{
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$this->parser = new parse_bbcode();
$this->parser->ipsclass =& $this->ipsclass;
$this->parser->allow_update_caches = 0;
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
}
//--------------------------------------------
// Not loaded the func?
//--------------------------------------------
if ( ! is_object( $this->func_mod ) )
{
require_once( ROOT_PATH.'sources/lib/func_mod.php' );
$this->func_mod = new func_mod();
$this->func_mod->ipsclass =& $this->ipsclass;
}
$this->classes_loaded = 1;
}
}
}
?>
+15
View File
@@ -0,0 +1,15 @@
<html>
<head><title>Ошибка &lt; Русская версия Invision Power Board</title></head>
<body>
<h1>Ошибка &lt; Русская версия Invision Power Board</h1>
<hr>
Вы попали на несуществующую страницу!<br>Пожалуйста нажмите на кнопочку &laquo;<b>Назад</b>&raquo;
в вашем браузере для возвращения на предыдущую страницу.
<hr>
<b>Invision Power Board:</b>
<ul>
<li><a href="http://www.bestwarez.ru" title="BestWarez.Ru - Только лучший Варез!">Русская версия</a></li>
<li><a href="http://www.invisionboard.com" title="Official Site">English version</a></li>
</ul>
</body>
</html>