Version 2.0.0
This commit is contained in:
1 parent
5699abfc0e
commit
0eecc172d9
696 files changed
+120723
-77160
No files matched your search
+437
-145
@@ -2,17 +2,19 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.3.1 Final
|
||||
| Invision Power Board v2.0.0
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| (c) 2001 - 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Thu, 23 Sep 2004 23:05:01 GMT
|
||||
| Release: 3cb325c445e1909182084806ae7f8226
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Wrapper script
|
||||
@@ -28,31 +30,56 @@
|
||||
|
||||
// Root path
|
||||
|
||||
define( 'ROOT_PATH', "./" );
|
||||
define( 'ROOT_PATH' , "./" );
|
||||
define( 'KERNEL_PATH', ROOT_PATH.'ips_kernel/' );
|
||||
|
||||
// Enable module usage?
|
||||
// (Vital for some mods and IPB enhancements)
|
||||
|
||||
define ( 'USE_MODULES', 1 );
|
||||
|
||||
// Enable shut down features?
|
||||
// Uses PHPs register_shutdown_function to save
|
||||
// low priority tasks until end of exec
|
||||
|
||||
define ( 'USE_SHUTDOWN', 1 );
|
||||
|
||||
// Enable custom error handling?
|
||||
// Useful to trap skin errors, etc
|
||||
|
||||
define( 'CUSTOM_ERROR', 1 );
|
||||
|
||||
//-----------------------------------------------
|
||||
// NO USER EDITABLE SECTIONS BELOW
|
||||
//-----------------------------------------------
|
||||
|
||||
define ( 'IN_IPB', 1 );
|
||||
|
||||
define ( 'IN_DEV', 0 );
|
||||
|
||||
error_reporting (E_ERROR | E_WARNING | E_PARSE);
|
||||
set_magic_quotes_runtime(0);
|
||||
|
||||
class Debug {
|
||||
function startTimer() {
|
||||
if ( CUSTOM_ERROR )
|
||||
{
|
||||
set_error_handler("my_error_handler");
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// DEBUG CLASS
|
||||
//===========================================================================
|
||||
|
||||
class Debug
|
||||
{
|
||||
function startTimer()
|
||||
{
|
||||
global $starttime;
|
||||
$mtime = microtime ();
|
||||
$mtime = explode (' ', $mtime);
|
||||
$mtime = $mtime[1] + $mtime[0];
|
||||
$starttime = $mtime;
|
||||
}
|
||||
function endTimer() {
|
||||
function endTimer()
|
||||
{
|
||||
global $starttime;
|
||||
$mtime = microtime ();
|
||||
$mtime = explode (' ', $mtime);
|
||||
@@ -63,41 +90,45 @@ class Debug {
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// INFO CLASS
|
||||
//===========================================================================
|
||||
|
||||
class info {
|
||||
|
||||
var $member = array();
|
||||
var $input = array();
|
||||
var $session_id = "";
|
||||
var $base_url = "";
|
||||
var $vars = "";
|
||||
var $skin_id = "0"; // Skin Dir name
|
||||
var $skin_rid = ""; // Real skin id (numerical only)
|
||||
var $lang_id = "en";
|
||||
var $skin = "";
|
||||
var $lang = "";
|
||||
var $server_load = 0;
|
||||
var $version = "v1.3.1 Final";
|
||||
var $lastclick = "";
|
||||
var $location = "";
|
||||
var $debug_html = "";
|
||||
var $perm_id = "";
|
||||
var $forum_read = array();
|
||||
var $topic_cache = "";
|
||||
var $member = array();
|
||||
var $input = array();
|
||||
var $session_id = "";
|
||||
var $base_url = "";
|
||||
var $vars = "";
|
||||
var $lang_id = "en";
|
||||
var $skin = "";
|
||||
var $lang = "";
|
||||
var $server_load = 0;
|
||||
var $version = "v2.0.0 ";
|
||||
var $lastclick = "";
|
||||
var $location = "";
|
||||
var $debug_html = "";
|
||||
var $perm_id = "";
|
||||
var $forum_read = array();
|
||||
var $topic_cache = "";
|
||||
var $session_type = "";
|
||||
|
||||
function info() {
|
||||
var $skin_global = "";
|
||||
var $loaded_templates = array();
|
||||
var $converge = "";
|
||||
|
||||
function info()
|
||||
{
|
||||
global $sess, $std, $DB, $INFO;
|
||||
|
||||
$this->vars = &$INFO;
|
||||
|
||||
$this->vars['TEAM_ICON_URL'] = $INFO['html_url'] . '/team_icons';
|
||||
$this->vars['AVATARS_URL'] = $INFO['html_url'] . '/avatars';
|
||||
$this->vars['EMOTICONS_URL'] = $INFO['html_url'] . '/emoticons';
|
||||
$this->vars['mime_img'] = $INFO['html_url'] . '/mime_types';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// MAIN PROGRAM
|
||||
//===========================================================================
|
||||
|
||||
//--------------------------------
|
||||
// Import $INFO, now!
|
||||
//--------------------------------
|
||||
@@ -113,24 +144,13 @@ require ROOT_PATH."conf_global.php";
|
||||
$Debug = new Debug;
|
||||
$Debug->startTimer();
|
||||
|
||||
//--------------------------------
|
||||
// Require our global functions
|
||||
//--------------------------------
|
||||
|
||||
require ROOT_PATH."sources/functions.php";
|
||||
|
||||
$std = new FUNC;
|
||||
$print = new display();
|
||||
$sess = new session();
|
||||
|
||||
//--------------------------------
|
||||
// Load the DB driver and such
|
||||
//--------------------------------
|
||||
|
||||
$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver'];
|
||||
$INFO['sql_driver'] = ! $INFO['sql_driver'] ? 'mysql' : strtolower($INFO['sql_driver']);
|
||||
|
||||
$to_require = ROOT_PATH."sources/Drivers/".$INFO['sql_driver'].".php";
|
||||
require ($to_require);
|
||||
require ( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );
|
||||
|
||||
$DB = new db_driver;
|
||||
|
||||
@@ -139,81 +159,258 @@ $DB->obj['sql_user'] = $INFO['sql_user'];
|
||||
$DB->obj['sql_pass'] = $INFO['sql_pass'];
|
||||
$DB->obj['sql_host'] = $INFO['sql_host'];
|
||||
$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
|
||||
$DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_queries.php';
|
||||
$DB->obj['use_shutdown'] = USE_SHUTDOWN;
|
||||
|
||||
$DB->obj['debug'] = ($INFO['sql_debug'] == 1) ? $_GET['debug'] : 0;
|
||||
//-----------------------------------
|
||||
// Required vars?
|
||||
//-----------------------------------
|
||||
|
||||
if ( is_array( $DB->connect_vars ) and count( $DB->connect_vars ) )
|
||||
{
|
||||
foreach( $DB->connect_vars as $k => $v )
|
||||
{
|
||||
$DB->connect_vars[ $k ] = $INFO[ $k ];
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Get a DB connection
|
||||
//--------------------------------
|
||||
|
||||
$DB->connect();
|
||||
|
||||
//--------------------------------
|
||||
// Make CONSTANT
|
||||
//--------------------------------
|
||||
|
||||
define( 'SQL_PREFIX', $DB->obj['sql_tbl_prefix'] );
|
||||
define( 'SQL_DRIVER', $INFO['sql_driver'] );
|
||||
|
||||
//--------------------------------
|
||||
// Wrap it all up in a nice easy to
|
||||
// transport super class
|
||||
//--------------------------------
|
||||
|
||||
$ibforums = new info();
|
||||
$ibforums = new info();
|
||||
|
||||
//--------------------------------
|
||||
// Require our global functions
|
||||
//--------------------------------
|
||||
|
||||
require ROOT_PATH."sources/functions.php";
|
||||
require ROOT_PATH."sources/classes/class_display.php";
|
||||
require ROOT_PATH."sources/classes/class_session.php";
|
||||
require ROOT_PATH."sources/classes/class_forums.php";
|
||||
require KERNEL_PATH."class_converge.php";
|
||||
|
||||
$std = new FUNC;
|
||||
$print = new display();
|
||||
$sess = new session();
|
||||
$forums = new forum_functions();
|
||||
|
||||
//--------------------------------
|
||||
// Set up our vars
|
||||
//--------------------------------
|
||||
|
||||
$ibforums->input = $std->parse_incoming();
|
||||
$ibforums->input = $std->parse_incoming();
|
||||
|
||||
//--------------------------------
|
||||
// Short tags...
|
||||
// Set converge
|
||||
//--------------------------------
|
||||
|
||||
$ibforums->converge = new class_converge( $DB );
|
||||
|
||||
//===========================================================================
|
||||
// Generate choice array
|
||||
//===========================================================================
|
||||
|
||||
$choice = array(
|
||||
"idx" => array( "boards" , 'boards' ,"'birthdays', 'calendar'," ),
|
||||
"sf" => array( "forums" , 'forums' ,"'announcements', 'multimod'," ),
|
||||
"sr" => array( "forums" , 'forums' ),
|
||||
"st" => array( "topics" , 'topics' ,"'attachtypes','bbcode', 'multimod','ranks','profilefields'," ),
|
||||
"announce" => array( "announcements" , 'announcements',"'bbcode','badwords','emoticons','ranks','profilefields'," ),
|
||||
"login" => array( "login" , 'login' ),
|
||||
"post" => array( "post" , 'post' ,"'attachtypes','badwords','bbcode','emoticons'," ),
|
||||
"poll" => array( "lib/add_poll" , 'poll' ),
|
||||
"reg" => array( "register" , 'register' ),
|
||||
"online" => array( "online" , 'online' ),
|
||||
"members" => array( "memberlist" , 'memberlist' ,"'ranks','profilefields'," ),
|
||||
"help" => array( "help" , 'help' ),
|
||||
"search" => array( "search" , 'search' ,"'attachtypes','multimod','bbcode','ranks','profilefields'," ),
|
||||
"mod" => array( "moderate" , 'moderate' ,"'attachtypes','multimod','bbcode','emoticons'," ),
|
||||
"print" => array( "misc/print_page" , 'printpage' ,"'attachtypes','bbcode', 'multimod','ranks','profilefields'," ),
|
||||
"forward" => array( "misc/forward_page" , 'forwardpage' ),
|
||||
"mail" => array( "misc/contact_member", 'contactmember' ),
|
||||
"invite" => array( "misc/contact_member", 'contactmember' ),
|
||||
"icq" => array( "misc/contact_member", 'contactmember' ),
|
||||
"aol" => array( "misc/contact_member", 'contactmember' ),
|
||||
"yahoo" => array( "misc/contact_member", 'contactmember' ),
|
||||
"msn" => array( "misc/contact_member", 'contactmember' ),
|
||||
"report" => array( "misc/contact_member", 'contactmember' ),
|
||||
"chat" => array( "misc/contact_member", 'contactmember' ),
|
||||
"integ" => array( "misc/contact_member", 'contactmember' ),
|
||||
'boardrules' => array( "misc/contact_member", 'contactmember' ),
|
||||
"msg" => array( "messenger" , 'messenger' ,"'profilefields','attachtypes','badwords','bbcode','emoticons'," ),
|
||||
"usercp" => array( "usercp" , 'usercp' ,"'attachtypes','badwords','bbcode','emoticons'," ),
|
||||
"profile" => array( "profile" , 'profile' ,"'ranks','profilefields','badwords','bbcode','emoticons',"),
|
||||
"track" => array( "misc/tracker" , 'tracker' ),
|
||||
"stats" => array( "misc/stats" , 'stats' ),
|
||||
"attach" => array( "misc/attach" , 'attach' ,"'attachtypes'," ),
|
||||
'legends' => array( 'misc/legends' , 'legends' ,"'badwords','bbcode' ,'emoticons'," ),
|
||||
'calendar' => array( "calendar" , 'calendar' ),
|
||||
'buddy' => array( "browsebuddy" , 'assistant' ),
|
||||
'mmod' => array( "misc/multi_moderate", 'mmod' ,"'multimod',"),
|
||||
'warn' => array( "misc/warn" , 'warn' ,"'badwords','bbcode' ,'emoticons'," ),
|
||||
'home' => array( 'ipbportal' , 'ipdl' ,"'attachtypes','bbcode', 'multimod','ranks','profilefields'," ),
|
||||
'module' => array( 'modules' , 'modules' ),
|
||||
'toutline' => array( 'topics_outline' , 'toutline' ),
|
||||
'task' => array( 'taskloader' , 'taskloader' ),
|
||||
'findpost' => array( 'findpost' , 'findpost' ),
|
||||
);
|
||||
|
||||
//---------------------------------------------------
|
||||
// Check to make sure the array key exits..
|
||||
//---------------------------------------------------
|
||||
|
||||
$ibforums->input['_low_act'] = strtolower( $ibforums->input['act'] );
|
||||
|
||||
if (! isset($choice[ $ibforums->input['_low_act'] ][0]) )
|
||||
{
|
||||
$ibforums->input['act'] = 'idx';
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Short tags...
|
||||
//===========================================================================
|
||||
|
||||
if ( $ibforums->input['showforum'] != "" )
|
||||
{
|
||||
$ibforums->input['act'] = "SF";
|
||||
$ibforums->input['act'] = "sf";
|
||||
$ibforums->input['f'] = intval($ibforums->input['showforum']);
|
||||
}
|
||||
else if ( $ibforums->input['showtopic'] != "")
|
||||
{
|
||||
$ibforums->input['act'] = "ST";
|
||||
$ibforums->input['act'] = "st";
|
||||
$ibforums->input['t'] = intval($ibforums->input['showtopic']);
|
||||
|
||||
//---------------------------------------------------
|
||||
// Grab and cache the topic now as we need the 'f' attr for
|
||||
// the skins...
|
||||
//---------------------------------------------------
|
||||
|
||||
$DB->query("SELECT t.*, f.topic_mm_id, f.name as forum_name, f.quick_reply, f.id as forum_id, f.read_perms, f.reply_perms, f.parent_id, f.use_html,
|
||||
f.start_perms, f.allow_poll, f.password, f.posts as forum_posts, f.topics as forum_topics, f.upload_perms,
|
||||
f.show_rules, f.rules_text, f.rules_title,
|
||||
c.name as cat_name, c.id as cat_id
|
||||
FROM ibf_topics t, ibf_forums f , ibf_categories c
|
||||
WHERE t.tid=".$ibforums->input['t']." and f.id = t.forum_id and f.category=c.id");
|
||||
$DB->simple_construct( array( 'select' => '*',
|
||||
'from' => 'topics',
|
||||
'where' => "tid=".$ibforums->input['t'],
|
||||
) );
|
||||
|
||||
$DB->simple_exec();
|
||||
|
||||
$ibforums->topic_cache = $DB->fetch_row();
|
||||
$ibforums->input['f'] = $ibforums->topic_cache['forum_id'];
|
||||
}
|
||||
else if ( $ibforums->input['showuser'] != "")
|
||||
{
|
||||
$ibforums->input['act'] = "Profile";
|
||||
$ibforums->input['act'] = "profile";
|
||||
$ibforums->input['MID'] = intval($ibforums->input['showuser']);
|
||||
}
|
||||
else if ( $ibforums->input['automodule'] != "" )
|
||||
{
|
||||
$ibforums->input['act'] = 'module';
|
||||
$ibforums->input['module'] = $ibforums->input['automodule'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$ibforums->input['act'] = $ibforums->input['act'] == '' ? "idx" : $ibforums->input['act'];
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
// Get cache...
|
||||
//===========================================================================
|
||||
|
||||
$DB->simple_construct( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key IN ( ".$choice[ strtolower($ibforums->input['act']) ][2]."'banfilters', 'settings', 'group_cache', 'systemvars', 'skin_id_cache', 'forum_cache', 'moderators', 'stats', 'languages' )" ) );
|
||||
$DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
if ( $r['cs_key'] == 'settings' )
|
||||
{
|
||||
$tmp = unserialize(stripslashes($r['cs_value']));
|
||||
|
||||
if ( is_array( $tmp ) and count( $tmp ) )
|
||||
{
|
||||
foreach( $tmp as $k => $v )
|
||||
{
|
||||
$ibforums->vars[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
unset( $tmp );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $r['cs_array'] )
|
||||
{
|
||||
$ibforums->cache[ $r['cs_key'] ] = unserialize(stripslashes($r['cs_value']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$ibforums->cache[ $r['cs_key'] ] = $r['cs_value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $ibforums->cache['systemvars'] ) )
|
||||
{
|
||||
$DB->simple_exec_query( array( 'delete' => 'cache_store', 'where' => "cs_key='systemvars'" ) );
|
||||
$DB->do_insert( 'cache_store', array( 'cs_key' => 'systemvars', 'cs_value' => addslashes(serialize(array())), 'cs_array' => 1 ) );
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Set debug mode
|
||||
//--------------------------------
|
||||
|
||||
$DB->set_debug_mode( $ibforums->vars['sql_debug'] == 1 ? intval($_GET['debug']) : 0 );
|
||||
|
||||
//--------------------------------
|
||||
// Initialize the FUNC
|
||||
//--------------------------------
|
||||
|
||||
$std->FUNC_init();
|
||||
|
||||
//--------------------------------
|
||||
// The rest :D
|
||||
//--------------------------------
|
||||
|
||||
$ibforums->member = $sess->authorise();
|
||||
$ibforums->skin = $std->load_skin();
|
||||
$ibforums->lastclick = $sess->last_click;
|
||||
$ibforums->location = $sess->location;
|
||||
$ibforums->session_id = $sess->session_id;
|
||||
$ibforums->session_id = $sess->session_id; // Used in URLs
|
||||
$ibforums->my_session = $sess->session_id; // Used in code
|
||||
|
||||
//--------------------------------
|
||||
// Initialize the forums
|
||||
//--------------------------------
|
||||
|
||||
$forums->strip_invisible = 1;
|
||||
$forums->forums_init();
|
||||
|
||||
//--------------------------------
|
||||
// Load the skin
|
||||
//--------------------------------
|
||||
|
||||
$std->load_skin();
|
||||
|
||||
list($ppu,$tpu) = explode( "&", $ibforums->member['view_prefs'] );
|
||||
|
||||
$ibforums->vars['display_max_topics'] = ($tpu > 0) ? $tpu : $ibforums->vars['display_max_topics'];
|
||||
$ibforums->vars['display_max_posts'] = ($ppu > 0) ? $ppu : $ibforums->vars['display_max_posts'];
|
||||
|
||||
//--------------------------------
|
||||
//===========================================================================
|
||||
// Set up the session ID stuff
|
||||
//--------------------------------
|
||||
//===========================================================================
|
||||
|
||||
if ( $ibforums->session_type == 'cookie' )
|
||||
{
|
||||
@@ -233,14 +430,29 @@ $ibforums->js_base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars[
|
||||
|
||||
$std->hdl_forum_read_cookie();
|
||||
|
||||
//===========================================================================
|
||||
// Set up defaults
|
||||
//===========================================================================
|
||||
|
||||
$ibforums->skin_id = $ibforums->skin['_setid'];
|
||||
|
||||
$ibforums->vars['img_url'] = 'style_images/' . $ibforums->skin['_imagedir'];
|
||||
$ibforums->vars['AVATARS_URL'] = 'style_avatars';
|
||||
$ibforums->vars['EMOTICONS_URL'] = 'style_emoticons/<#EMO_DIR#>';
|
||||
$ibforums->vars['mime_img'] = 'style_images/<#IMG_DIR#>';
|
||||
|
||||
//--------------------------------
|
||||
// Set up the skin stuff
|
||||
// Set up cache path
|
||||
//--------------------------------
|
||||
|
||||
$ibforums->skin_rid = $ibforums->skin['set_id'];
|
||||
$ibforums->skin_id = 's'.$ibforums->skin['set_id'];
|
||||
|
||||
$ibforums->vars['img_url'] = 'style_images/' . $ibforums->skin['img_dir'];
|
||||
if ( $ibforums->vars['ipb_cache_path'] )
|
||||
{
|
||||
define( 'CACHE_PATH', $ibforums->vars['ipb_cache_path'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
define( 'CACHE_PATH', ROOT_PATH );
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Set up our language choice
|
||||
@@ -251,6 +463,26 @@ if ($ibforums->vars['default_language'] == "")
|
||||
$ibforums->vars['default_language'] = 'en';
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Did we choose a language?
|
||||
//--------------------------------
|
||||
|
||||
If ( $ibforums->input['setlanguage'] and $ibforums->input['langid'] and $ibforums->member['id'] )
|
||||
{
|
||||
if ( is_array( $ibforums->cache['languages'] ) and count( $ibforums->cache['languages'] ) )
|
||||
{
|
||||
foreach( $ibforums->cache['languages'] as $idx => $data )
|
||||
{
|
||||
if ( $data['ldir'] == $ibforums->input['langid'] )
|
||||
{
|
||||
$DB->do_update( 'members', array( 'language' => $data['ldir'] ), 'id='.$ibforums->member['id'] );
|
||||
$ibforums->member['language'] = $data['ldir'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$ibforums->lang_id = $ibforums->member['language'] ? $ibforums->member['language'] : $ibforums->vars['default_language'];
|
||||
|
||||
if ( ($ibforums->lang_id != $ibforums->vars['default_language']) and (! is_dir( ROOT_PATH."lang/".$ibforums->lang_id ) ) )
|
||||
@@ -260,10 +492,6 @@ if ( ($ibforums->lang_id != $ibforums->vars['default_language']) and (! is_dir(
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_global', $ibforums->lang_id);
|
||||
|
||||
//--------------------------------
|
||||
|
||||
$skin_universal = $std->load_template('skin_global');
|
||||
|
||||
//--------------------------------
|
||||
// Expire subscription?
|
||||
//--------------------------------
|
||||
@@ -273,9 +501,33 @@ if ( $ibforums->member['sub_end'] != 0 AND ( $ibforums->member['sub_end'] < time
|
||||
$std->expire_subscription();
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Upload dir?
|
||||
//--------------------------------
|
||||
|
||||
if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and $ibforums->input['act'] != 'Attach' and $ibforums->input['module'] != 'subscription')
|
||||
$ibforums->vars['upload_dir'] = $ibforums->vars['upload_dir'] ? $ibforums->vars['upload_dir'] : ROOT_PATH.'uploads';
|
||||
|
||||
//===========================================================================
|
||||
// DECONSTRUCTOR
|
||||
//===========================================================================
|
||||
|
||||
if ( USE_SHUTDOWN and $ibforums->input['act'] != 'task' )
|
||||
{
|
||||
chdir( ROOT_PATH );
|
||||
$ROOT_PATH = getcwd();
|
||||
|
||||
register_shutdown_function( array( &$std, 'my_deconstructor') );
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Force log in / board offline?
|
||||
//===========================================================================
|
||||
|
||||
if ($ibforums->input['_low_act'] != 'login' and
|
||||
$ibforums->input['_low_act'] != 'reg' and
|
||||
$ibforums->input['_low_act'] != 'attach' and
|
||||
$ibforums->input['_low_act'] != 'task' and
|
||||
( $ibforums->input['_low_act'] != 'module' && $ibforums->input['module'] != 'subscription' ) )
|
||||
{
|
||||
|
||||
//--------------------------------
|
||||
@@ -284,7 +536,7 @@ if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and
|
||||
//--------------------------------
|
||||
|
||||
if ($ibforums->member['g_view_board'] != 1)
|
||||
{
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_board') );
|
||||
}
|
||||
|
||||
@@ -296,6 +548,7 @@ if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and
|
||||
{
|
||||
if ($ibforums->member['g_access_offline'] != 1)
|
||||
{
|
||||
$ibforums->vars['no_reg'] == 1;
|
||||
$std->board_offline();
|
||||
}
|
||||
|
||||
@@ -307,80 +560,71 @@ if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and
|
||||
|
||||
if ( (! $ibforums->member['id']) and ($ibforums->vars['force_login'] == 1) )
|
||||
{
|
||||
require ROOT_PATH."sources/Login.php";
|
||||
require ROOT_PATH."sources/login.php";
|
||||
$runme = new login();
|
||||
$runme->auto_run();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------
|
||||
// Show PURCHASE screen?
|
||||
// Not enforced
|
||||
//--------------------------------
|
||||
|
||||
if ( ! $ibforums->member['sub_end'] )
|
||||
{
|
||||
//--------------------------------
|
||||
// 1: No enforce, chosen from reg
|
||||
//--------------------------------
|
||||
|
||||
if ( ! $ibforums->vars['subsm_enforce'] and $ibforums->member['subs_pkg_chosen'] )
|
||||
{
|
||||
$ibforums->input['act'] = 'module';
|
||||
$ibforums->input['module'] = 'subscription';
|
||||
$ibforums->input['CODE'] = 'paymentmethod';
|
||||
$ibforums->input['sub'] = $ibforums->member['subs_pkg_chosen'];
|
||||
$ibforums->input['nocp'] = 1;
|
||||
$ibforums->input['msgtype'] = 'fromreg';
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Show PURCHASE screen?
|
||||
// Enforced
|
||||
//--------------------------------
|
||||
|
||||
if ( $ibforums->vars['subsm_enforce'] and $ibforums->member['mgroup'] == $ibforums->vars['subsm_nopkg_group'] )
|
||||
{
|
||||
$ibforums->input['act'] = 'module';
|
||||
$ibforums->input['module'] = 'subscription';
|
||||
$ibforums->input['nocp'] = 1;
|
||||
$ibforums->input['msgtype'] = 'force';
|
||||
|
||||
if ( $ibforums->member['subs_pkg_chosen'] )
|
||||
{
|
||||
$ibforums->input['CODE'] = 'paymentmethod';
|
||||
$ibforums->input['sub'] = $ibforums->member['subs_pkg_chosen'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Decide what to do
|
||||
//--------------------------------
|
||||
|
||||
$choice = array(
|
||||
"idx" => "Boards",
|
||||
"SC" => "Boards",
|
||||
"SF" => "Forums",
|
||||
"SR" => "Forums",
|
||||
"ST" => "Topics",
|
||||
"Login" => "Login",
|
||||
"Post" => "Post",
|
||||
"Poll" => "lib/add_poll",
|
||||
"Reg" => "Register",
|
||||
"Online" => "Online",
|
||||
"Members" => "Memberlist",
|
||||
"Help" => "Help",
|
||||
"Search" => "Search",
|
||||
"Mod" => "Moderate",
|
||||
"Print" => "misc/print_page",
|
||||
"Forward" => "misc/forward_page",
|
||||
"Mail" => "misc/contact_member",
|
||||
"Invite" => "misc/contact_member",
|
||||
"ICQ" => "misc/contact_member",
|
||||
"AOL" => "misc/contact_member",
|
||||
"YAHOO" => "misc/contact_member",
|
||||
"MSN" => "misc/contact_member",
|
||||
"report" => "misc/contact_member",
|
||||
"chat" => "misc/contact_member",
|
||||
"integ" => "misc/contact_member",
|
||||
"Msg" => "Messenger",
|
||||
"UserCP" => "Usercp",
|
||||
"Profile" => "Profile",
|
||||
"Track" => "misc/tracker",
|
||||
"Stats" => "misc/stats",
|
||||
"Attach" => "misc/attach",
|
||||
'legends' => 'misc/legends',
|
||||
'modcp' => 'mod_cp',
|
||||
'calendar' => "calendar",
|
||||
'buddy' => "browsebuddy",
|
||||
'boardrules' => "misc/contact_member",
|
||||
'mmod' => "misc/multi_moderate",
|
||||
'warn' => "misc/warn",
|
||||
'home' => 'dynamiclite/csite',
|
||||
'module' => 'modules',
|
||||
);
|
||||
|
||||
|
||||
/***************************************************/
|
||||
//
|
||||
|
||||
// Check to make sure the array key exits..
|
||||
|
||||
if (! isset($choice[ $ibforums->input['act'] ]) )
|
||||
{
|
||||
$ibforums->input['act'] = 'idx';
|
||||
}
|
||||
//===========================================================================
|
||||
// REQUIRE AND RUN
|
||||
//===========================================================================
|
||||
|
||||
if ( $ibforums->input['act'] == 'home' )
|
||||
{
|
||||
if ( $ibforums->vars['csite_on'] )
|
||||
{
|
||||
require ROOT_PATH."sources/dynamiclite/csite.php";
|
||||
$csite = new click_site();
|
||||
require ROOT_PATH."sources/ipbportal.php";
|
||||
$csite = new ipdl();
|
||||
$csite->auto_run();
|
||||
}
|
||||
else
|
||||
{
|
||||
require ROOT_PATH."sources/Boards.php";
|
||||
require ROOT_PATH."sources/boards.php";
|
||||
$runme = new boards();
|
||||
$runme->auto_run();
|
||||
}
|
||||
}
|
||||
else if ( $ibforums->input['act'] == 'module' )
|
||||
@@ -392,21 +636,69 @@ else if ( $ibforums->input['act'] == 'module' )
|
||||
}
|
||||
else
|
||||
{
|
||||
require ROOT_PATH."sources/Boards.php";
|
||||
require ROOT_PATH."sources/boards.php";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Require and run
|
||||
require ROOT_PATH."sources/".$choice[ $ibforums->input['act'] ].".php";
|
||||
|
||||
require_once( ROOT_PATH."sources/".$choice[ strtolower($ibforums->input['act']) ][0].".php" );
|
||||
|
||||
$runme = new $choice[ strtolower($ibforums->input['act']) ][1];
|
||||
$runme->auto_run();
|
||||
}
|
||||
|
||||
//+-------------------------------------------------
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// GLOBAL ROUTINES
|
||||
//+-------------------------------------------------
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function fatal_error($message="", $help="") {
|
||||
function fatal_error($message="", $help="")
|
||||
{
|
||||
echo("$message<br><br>$help");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Custom error handler
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function my_error_handler( $errno, $errstr, $errfile, $errline )
|
||||
{
|
||||
// Did we turn off errors with @?
|
||||
|
||||
if ( ! error_reporting() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$errfile = str_replace( @getcwd(), "", $errfile );
|
||||
|
||||
switch ($errno)
|
||||
{
|
||||
case E_ERROR:
|
||||
echo "<b>IPB ERROR</b> [$errno] $errstr (Line: $errline of $errfile)<br />\n";
|
||||
exit(1);
|
||||
break;
|
||||
case E_WARNING:
|
||||
if ( strstr( $errstr, 'load_template(./skin_cache/cacheid_' ) )
|
||||
{
|
||||
echo "<div style='font-family:sans-serif'><b>IPB TEMPLATE ERROR:</b> Could not load the required template.
|
||||
<br /><br />First, try and remove any custom skin settings by clicking <a href='index.php?setskin&id=0'>here</a>
|
||||
<br /><br />Then, please visit your <a href='admin.php'>Admin Control Panel</a> to repair this template.
|
||||
<br /><br /><span style='font-size:90%;color:gray'>Error: $errstr</span></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<b>IPB WARNING</b> [$errno] $errstr (Line: $errline of $errfile)<br />\n";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//Do nothing
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user