Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
+270
-294
@@ -2,17 +2,23 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v2.0.0
|
||||
| ========================================
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2004 Invision Power Services
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| Email: matt@invisionpower.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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > IPB UPGRADE LOADER
|
||||
@@ -24,7 +30,7 @@
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -45,138 +51,17 @@ class core_functions
|
||||
|
||||
function upgrade_complete()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
$ibforums->template->content .= "
|
||||
$this->ipsclass->template->content .= "
|
||||
<div class='tableborder'>
|
||||
<div class='maintitle'>IPB Upgrade Complete!</div>
|
||||
<div class='tdrow1' style='padding:6px'>You have now been upgraded!
|
||||
<div class='maintitle'>Îáíîâëåíèå IPB çàâåðøåíî!</div>
|
||||
<div class='tdrow1' style='padding:6px'>Âàø ôîðóì óñïåøíî îáíîâëåí!
|
||||
<br /><br />
|
||||
You may want to disable permissions on the script 'upgrade/index.php' to increase security or rename the 'upgrade' directory.
|
||||
Âû äîëæíû îòêëþ÷èòü ïðàâà íà âûïîëíåíèå ñêðèïòà /upgrade/index.php èëè ïåðåèìåíîâàòü äèðåêòîðèþ /upgrade/. Èíà÷å ó âàñ ìîãóò áûòü ïðîáëåìû ñ áåçîïàñíîñòüþ.
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
$ibforums->template->output();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// REBUILD SETTINGS
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function rebuild_settings()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
$updated = 0;
|
||||
$inserted = 0;
|
||||
$need_update = array();
|
||||
|
||||
if ( ! @file_exists( THIS_PATH.'upg_'.$ibforums->current_version.'/ipb_settings_partial.xml' ) )
|
||||
{
|
||||
$ibforums->core->redirect( "index.php?act=recache&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "No settings to import or update, proceeding to rebuild caches..." );
|
||||
}
|
||||
|
||||
$content = implode( '', @file( THIS_PATH.'upg_'.$ibforums->current_version.'/ipb_settings_partial.xml' ) );
|
||||
|
||||
//-------------------------------
|
||||
// Get current settings.
|
||||
//-------------------------------
|
||||
|
||||
$cur_settings = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => 'conf_id, conf_key',
|
||||
'from' => 'conf_settings',
|
||||
'order' => 'conf_id' ) );
|
||||
|
||||
$DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
$cur_settings[ $r['conf_key'] ] = $r['conf_id'];
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Get xml mah-do-dah
|
||||
//-------------------------------
|
||||
|
||||
require( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
//-------------------------------
|
||||
// Unpack the datafile
|
||||
//-------------------------------
|
||||
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
//-------------------------------
|
||||
// pArse
|
||||
//-------------------------------
|
||||
|
||||
$fields = array( 'conf_title' , 'conf_description', 'conf_group' , 'conf_type' , 'conf_key' , 'conf_default',
|
||||
'conf_extra' , 'conf_evalphp' , 'conf_protected', 'conf_position', 'conf_start_group', 'conf_end_group',
|
||||
'conf_help_key', 'conf_add_cache' );
|
||||
|
||||
foreach( $xml->xml_array['settingexport']['settinggroup']['setting'] as $id => $entry )
|
||||
{
|
||||
$newrow = array();
|
||||
|
||||
//-----------------------------------
|
||||
// Make PHP slashes safe
|
||||
//-----------------------------------
|
||||
|
||||
$entry['conf_evalphp']['VALUE'] = str_replace( '\\', '\\\\', $entry['conf_evalphp']['VALUE'] );
|
||||
|
||||
foreach( $fields as $f )
|
||||
{
|
||||
$newrow[$f] = $entry[ $f ]['VALUE'];
|
||||
}
|
||||
|
||||
if ( $cur_settings[ $entry['conf_key']['VALUE'] ] )
|
||||
{
|
||||
//-----------------------------------
|
||||
// Update
|
||||
//-----------------------------------
|
||||
|
||||
$DB->do_update( 'conf_settings', $newrow, 'conf_id='.$cur_settings[ $entry['conf_key']['VALUE'] ] );
|
||||
$updated++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------
|
||||
// INSERT
|
||||
//-----------------------------------
|
||||
|
||||
$DB->do_insert( 'conf_settings', $newrow );
|
||||
$inserted++;
|
||||
}
|
||||
|
||||
$need_update[ $entry['conf_group']['VALUE'] ] = $entry['conf_group']['VALUE'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Update group counts...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count( $need_update ) )
|
||||
{
|
||||
foreach( $need_update as $id )
|
||||
{
|
||||
$conf = $DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'conf_settings', 'where' => 'conf_group='.$id ) );
|
||||
|
||||
$count = intval($conf['count']);
|
||||
|
||||
$DB->do_update( 'conf_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$id );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Boink..
|
||||
//-----------------------------------
|
||||
|
||||
$ibforums->core->redirect( "index.php?act=recache&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "$updated settings updated $inserted settings inserted, proceeding to rebuild caches..." );
|
||||
|
||||
$this->ipsclass->template->output();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -185,36 +70,35 @@ class core_functions
|
||||
|
||||
function rebuild_templates_cache()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
//-----------------------------------
|
||||
// Get ACP library
|
||||
//-----------------------------------
|
||||
|
||||
require_once( ROOT_PATH.'sources/admin/admin_cache_functions.php' );
|
||||
$acp = new admin_cache_functions();
|
||||
require_once( ROOT_PATH.'sources/lib/admin_cache_functions.php' );
|
||||
$acp = new admin_cache_functions();
|
||||
$acp->ipsclass =& $this->ipsclass;
|
||||
|
||||
$justdone = intval($ibforums->input['justdone']);
|
||||
$justdone = intval($this->ipsclass->input['justdone']);
|
||||
$justdone = $justdone ? $justdone : 1;
|
||||
|
||||
//-----------------------------------
|
||||
// Get skins
|
||||
//-----------------------------------
|
||||
|
||||
$DB->simple_construct( array( 'select' => '*',
|
||||
'from' => 'skin_sets',
|
||||
'where' => 'set_skin_set_id > '.$justdone,
|
||||
'order' => 'set_skin_set_id',
|
||||
'limit' => array( 0, 1 )
|
||||
) );
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
|
||||
'from' => 'skin_sets',
|
||||
'where' => 'set_skin_set_id > '.$justdone,
|
||||
'order' => 'set_skin_set_id',
|
||||
'limit' => array( 0, 1 )
|
||||
) );
|
||||
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
//-----------------------------------
|
||||
// Got a biggun?
|
||||
//-----------------------------------
|
||||
|
||||
$r = $DB->fetch_row();
|
||||
$r = $this->ipsclass->DB->fetch_row();
|
||||
|
||||
if ( $r['set_skin_set_id'] )
|
||||
{
|
||||
@@ -222,11 +106,11 @@ class core_functions
|
||||
|
||||
$extra = implode( "<br />", $acp->messages );
|
||||
|
||||
$ibforums->core->redirect( "index.php?act=templatescache&justdone={$r['set_skin_set_id']}&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "Rebuild cache for skin set {$r['set_name']}<br />{$extra}<br />Proceeding to the next skin..." );
|
||||
$this->ipsclass->core->redirect( "index.php?act=templatescache&justdone={$r['set_skin_set_id']}&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}", "Ïåðåñòðîéêà êåøà äëÿ ñòèëÿ «{$r['set_name']}»<br />{$extra}<br />Äàëåå ïåðåõîäèì ê ñëåäóþùåìó ñòèëþ..." );
|
||||
}
|
||||
else
|
||||
{
|
||||
$ibforums->core->redirect( "index.php?act=finish&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "No more skins to rebuild..." );
|
||||
$this->ipsclass->core->redirect( "index.php?act=finish&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}", "Íåò áîëüøå ñòèëåé äëÿ ïåðåñòðîéêè..." );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,8 +120,6 @@ class core_functions
|
||||
|
||||
function rebuild_templates()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
//-----------------------------------
|
||||
// Get XML
|
||||
//-----------------------------------
|
||||
@@ -245,6 +127,7 @@ class core_functions
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
$xml->lite_parser = 1;
|
||||
|
||||
//-----------------------------------
|
||||
// Get XML file (TEMPLATES)
|
||||
@@ -266,34 +149,34 @@ class core_functions
|
||||
|
||||
if ( ! is_array( $xml->xml_array['templateexport']['templategroup']['template'] ) )
|
||||
{
|
||||
install_error("Error with ipb_templates.xml - could not process XML properly");
|
||||
install_error("Îøèáêà â ôàéëå ipb_templates.xml — íåâîçìîæíî âûïîëíèòü ýòîò XML ôàéë");
|
||||
}
|
||||
|
||||
foreach( $xml->xml_array['templateexport']['templategroup']['template'] as $id => $entry )
|
||||
{
|
||||
|
||||
$row = $DB->simple_exec_query( array( 'select' => 'suid',
|
||||
'from' => 'skin_templates',
|
||||
'where' => "group_name='{$entry[ 'group_name' ]['VALUE']}' AND func_name='{$entry[ 'func_name' ]['VALUE']}' and set_id=1"
|
||||
) );
|
||||
$row = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'suid',
|
||||
'from' => 'skin_templates',
|
||||
'where' => "group_name='{$entry[ 'group_name' ]['VALUE']}' AND func_name='{$entry[ 'func_name' ]['VALUE']}' and set_id=1"
|
||||
) );
|
||||
|
||||
if ( $row['suid'] )
|
||||
{
|
||||
$DB->do_update( 'skin_templates', array( 'func_data' => $entry[ 'func_data' ]['VALUE'],
|
||||
'section_content' => $entry[ 'section_content' ]['VALUE'],
|
||||
'updated' => time()
|
||||
)
|
||||
, 'suid='.$row['suid'] );
|
||||
$this->ipsclass->DB->do_update( 'skin_templates', array( 'func_data' => $entry[ 'func_data' ]['VALUE'],
|
||||
'section_content' => $entry[ 'section_content' ]['VALUE'],
|
||||
'updated' => time()
|
||||
)
|
||||
, 'suid='.$row['suid'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$DB->do_insert( 'skin_templates', array( 'func_data' => $entry[ 'func_data' ]['VALUE'],
|
||||
'func_name' => $entry[ 'func_name' ]['VALUE'],
|
||||
'section_content' => $entry[ 'section_content' ]['VALUE'],
|
||||
'group_name' => $entry[ 'group_name' ]['VALUE'],
|
||||
'updated' => time(),
|
||||
'set_id' => 1
|
||||
) );
|
||||
$this->ipsclass->DB->do_insert( 'skin_templates', array( 'func_data' => $entry[ 'func_data' ]['VALUE'],
|
||||
'func_name' => $entry[ 'func_name' ]['VALUE'],
|
||||
'section_content' => $entry[ 'section_content' ]['VALUE'],
|
||||
'group_name' => $entry[ 'group_name' ]['VALUE'],
|
||||
'updated' => time(),
|
||||
'set_id' => 1
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +184,7 @@ class core_functions
|
||||
// Boink..
|
||||
//-----------------------------------
|
||||
|
||||
$ibforums->core->redirect( "index.php?act=templatescache&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "Master templates rebuilt, proceeding to recache templates..." );
|
||||
$this->ipsclass->core->redirect( "index.php?act=templatescache&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}", "Ïåðåñòðîéêà ìàñòåð øàáëîíîâ, äàëåå ïåðåñòðîéêà îáû÷íûõ øàáëîíîâ..." );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -310,152 +193,166 @@ class core_functions
|
||||
|
||||
function rebuild_caches()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// BBCODE
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['bbcode'] = array();
|
||||
$this->ipsclass->cache['bbcode'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
|
||||
$bbcode = $DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
|
||||
$bbcode = $this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row($bbcode) )
|
||||
while ( $r = $this->ipsclass->DB->fetch_row($bbcode) )
|
||||
{
|
||||
$ibforums->cache['bbcode'][] = $r;
|
||||
$this->ipsclass->cache['bbcode'][] = $r;
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'bbcode', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->ipsclass->update_cache( array( 'name' => 'bbcode', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Forum cache
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$std->update_forum_cache();
|
||||
$this->ipsclass->update_forum_cache();
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Group Cache
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['group_cache'] = array();
|
||||
$this->ipsclass->cache['group_cache'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => "*",
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => "*",
|
||||
'from' => 'groups'
|
||||
) );
|
||||
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $i = $DB->fetch_row() )
|
||||
while ( $i = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$ibforums->cache['group_cache'][ $i['g_id'] ] = $i;
|
||||
$this->ipsclass->cache['group_cache'][ $i['g_id'] ] = $i;
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'group_cache', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->ipsclass->update_cache( array( 'name' => 'group_cache', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Systemvars
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['systemvars'] = array();
|
||||
$this->ipsclass->cache['systemvars'] = array();
|
||||
|
||||
$result = $DB->simple_exec_query( array( 'select' => 'count(*) as cnt', 'from' => 'mail_queue' ) );
|
||||
$result = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as cnt', 'from' => 'mail_queue' ) );
|
||||
|
||||
$ibforums->cache['systemvars']['mail_queue'] = intval( $result['cnt'] );
|
||||
$ibforums->cache['systemvars']['task_next_run'] = time() + 3600;
|
||||
$this->ipsclass->cache['systemvars']['mail_queue'] = intval( $result['cnt'] );
|
||||
$this->ipsclass->cache['systemvars']['task_next_run'] = time() + 3600;
|
||||
|
||||
$std->update_cache( array( 'name' => 'systemvars', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
$this->ipsclass->update_cache( array( 'name' => 'systemvars', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->cache['moderators'] = array();
|
||||
|
||||
require_once( ROOT_PATH.'sources/action_admin/moderator.php' );
|
||||
$mod = new ad_moderator();
|
||||
$mod->ipsclass =& $this->ipsclass;
|
||||
|
||||
$mod->rebuild_moderator_cache();
|
||||
|
||||
//-----------------------------------------
|
||||
// Cal events / Birthdays
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( ROOT_PATH . 'sources/action_admin/calendars.php' );
|
||||
$calendars = new ad_calendars();
|
||||
$calendars->ipsclass =& $this->ipsclass;
|
||||
|
||||
$calendars->calendar_rebuildcache( 0 );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Ranks
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['ranks'] = array();
|
||||
$this->ipsclass->cache['ranks'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => 'id, title, pips, posts',
|
||||
'from' => 'titles',
|
||||
'order' => "posts DESC",
|
||||
) );
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, title, pips, posts',
|
||||
'from' => 'titles',
|
||||
'order' => "posts DESC",
|
||||
) );
|
||||
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ($i = $DB->fetch_row())
|
||||
while ($i = $this->ipsclass->DB->fetch_row())
|
||||
{
|
||||
$ibforums->cache['ranks'][ $i['id'] ] = array(
|
||||
'TITLE' => $i['title'],
|
||||
'PIPS' => $i['pips'],
|
||||
'POSTS' => $i['posts'],
|
||||
);
|
||||
$this->ipsclass->cache['ranks'][ $i['id'] ] = array(
|
||||
'TITLE' => $i['title'],
|
||||
'PIPS' => $i['pips'],
|
||||
'POSTS' => $i['posts'],
|
||||
);
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'ranks', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->ipsclass->update_cache( array( 'name' => 'ranks', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// SETTINGS
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['settings'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => '*', 'from' => 'conf_settings', 'where' => 'conf_add_cache=1' ) );
|
||||
$info = $DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row($info) )
|
||||
{
|
||||
$ibforums->cache['settings'][ $r['conf_key'] ] = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default'];
|
||||
}
|
||||
require_once( ROOT_PATH . 'sources/action_admin/settings.php' );
|
||||
$settings = new ad_settings();
|
||||
$settings->ipsclass =& $this->ipsclass;
|
||||
|
||||
$settings->setting_rebuildcache();
|
||||
|
||||
$std->update_cache( array( 'name' => 'settings', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// EMOTICONS
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['emoticons'] = array();
|
||||
$this->ipsclass->cache['emoticons'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons' ) );
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$ibforums->cache['emoticons'][] = $r;
|
||||
$this->ipsclass->cache['emoticons'][] = $r;
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'emoticons', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->ipsclass->update_cache( array( 'name' => 'emoticons', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// LANGUAGES
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['languages'] = array();
|
||||
$this->ipsclass->cache['languages'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => 'ldir,lname', 'from' => 'languages' ) );
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'ldir,lname', 'from' => 'languages' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$ibforums->cache['languages'][] = $r;
|
||||
$this->ipsclass->cache['languages'][] = $r;
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'languages', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->ipsclass->update_cache( array( 'name' => 'languages', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// ATTACHMENT TYPES
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$ibforums->cache['attachtypes'] = array();
|
||||
$this->ipsclass->cache['attachtypes'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$ibforums->cache['attachtypes'][ $r['atype_extension'] ] = $r;
|
||||
$this->ipsclass->cache['attachtypes'][ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'attachtypes', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->ipsclass->update_cache( array( 'name' => 'attachtypes', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
$ibforums->core->redirect( "index.php?act=templates&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "Caches rebuilt, proceeding to rebuild templates..." );
|
||||
$this->ipsclass->core->redirect( "index.php?act=templates&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}", "Êåøè ïåðåñòðîåíû, äàëåå ïåðåñòðîéêà øàáëîíîâ..." );
|
||||
|
||||
}
|
||||
|
||||
@@ -465,42 +362,118 @@ class core_functions
|
||||
|
||||
function module_complete()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
$message = array();
|
||||
|
||||
//--------------------------------
|
||||
// Upgrade templates
|
||||
//--------------------------------
|
||||
|
||||
if ( @file_exists( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/components.php' ) )
|
||||
{
|
||||
require_once( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/components.php' );
|
||||
|
||||
$this->ipsclass->DB->do_update( 'skin_sets', array( 'set_css' => $CSS,
|
||||
'set_cache_css' => $CSS,
|
||||
'set_wrapper' => $WRAPPER,
|
||||
'set_cache_wrapper' => $WRAPPER,
|
||||
), 'set_skin_set_id=1' );
|
||||
|
||||
$message[] = "Øàáëîíû êîìïîíåíòîâ îáíîâëåíû...";
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// ACP Perms
|
||||
//--------------------------------
|
||||
|
||||
if ( @file_exists( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/ipb_acpperms.xml' ) )
|
||||
{
|
||||
//-------------------------------
|
||||
// Load module...
|
||||
//-------------------------------
|
||||
|
||||
require_once( ROOT_PATH . 'sources/action_admin/acppermissions.php' );
|
||||
$settings = new ad_acppermissions();
|
||||
$settings->ipsclass =& $this->ipsclass;
|
||||
|
||||
//-------------------------------
|
||||
// Set location
|
||||
//-------------------------------
|
||||
|
||||
$this->ipsclass->input['file_location'] = UPGRADE_DIR.'/upg_'.$this->ipsclass->current_upgrade.'/ipb_acpperms.xml';
|
||||
|
||||
//-------------------------------
|
||||
// Run it
|
||||
//-------------------------------
|
||||
|
||||
$settings->acpperms_xml_import( 1 );
|
||||
|
||||
$message[] = $this->ipsclass->main_msg;
|
||||
}
|
||||
|
||||
//--------------------------------
|
||||
// Settings
|
||||
//--------------------------------
|
||||
|
||||
if ( @file_exists( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/ipb_settings_partial.xml' ) )
|
||||
{
|
||||
//-------------------------------
|
||||
// Load module...
|
||||
//-------------------------------
|
||||
|
||||
require_once( ROOT_PATH . 'sources/action_admin/settings.php' );
|
||||
$settings = new ad_settings();
|
||||
$settings->ipsclass =& $this->ipsclass;
|
||||
|
||||
//-------------------------------
|
||||
// Set location
|
||||
//-------------------------------
|
||||
|
||||
$this->ipsclass->input['file_location'] = UPGRADE_DIR.'/upg_'.$this->ipsclass->current_upgrade.'/ipb_settings_partial.xml';
|
||||
|
||||
//-------------------------------
|
||||
// Run it
|
||||
//-------------------------------
|
||||
|
||||
$settings->settings_do_import( 1 );
|
||||
|
||||
$message[] = $this->ipsclass->main_msg;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Update DB
|
||||
//------------------------------------------
|
||||
|
||||
$DB->do_insert( 'upgrade_history', array( 'upgrade_version_id' => $ibforums->current_upgrade,
|
||||
'upgrade_version_human' => $ibforums->versions[ $ibforums->current_upgrade ],
|
||||
'upgrade_date' => time(),
|
||||
'upgrade_mid' => $ibforums->input['mid']
|
||||
) );
|
||||
$this->ipsclass->DB->do_insert( 'upgrade_history', array( 'upgrade_version_id' => $this->ipsclass->current_upgrade,
|
||||
'upgrade_version_human' => $this->ipsclass->versions[ $this->ipsclass->current_upgrade ],
|
||||
'upgrade_date' => time(),
|
||||
'upgrade_mid' => $this->ipsclass->input['mid']
|
||||
) );
|
||||
|
||||
//------------------------------------------
|
||||
// Anymore to run?
|
||||
//------------------------------------------
|
||||
|
||||
if ( $ibforums->last_poss_id != $ibforums->current_upgrade )
|
||||
if ( $this->ipsclass->last_poss_id != $this->ipsclass->current_upgrade )
|
||||
{
|
||||
$ibforums->core->redirect( "index.php?act=work&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "Upgrade module complete, moving on to the next upgrade module...." );
|
||||
$this->ipsclass->core->redirect( "index.php?act=work&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}",
|
||||
implode( "<br />", $message ) . "<br />Îáíîâëåíèå ìîäóëÿ çàâåðøåíî, ïåðåìåùàåìñÿ ê îáíîâëåíèþ ñëåäóþùåãî ìîäóëÿ...." );
|
||||
}
|
||||
else
|
||||
{
|
||||
$ibforums->template->content .= "
|
||||
$this->ipsclass->template->content .= "
|
||||
<div class='tableborder'>
|
||||
<div class='maintitle'>IPB Upgrade Complete</div>
|
||||
<div class='tdrow1' style='padding:6px'>You have now been upgraded from {$ibforums->versions[$ibforums->current_version]} to {$ibforums->versions[$ibforums->current_upgrade]}
|
||||
<div class='maintitle'>Îáíîâëåíèå IPB çàâåðøåíî</div>
|
||||
<div class='tdrow1' style='padding:6px'>".implode( "<br />", $message ) . "<br />
|
||||
Âàø ôîðóì áûë óñïåøíî îáíîâëåí ñ {$this->ipsclass->versions[$this->ipsclass->current_version]} äî {$this->ipsclass->versions[$this->ipsclass->current_upgrade]}
|
||||
<br /><br />
|
||||
The next few final steps will check for updated settings and recache your cached data (forums, groups, moderators, etc) and rebuild your master templates to ensure
|
||||
that all the template additions and modifications are updated.
|
||||
Ñëåäóþùèå ôèíàëüíûå ýòàïû ïðîâåðÿò íà îáíîâëåíèÿ íàñòðîéêè è ïåðåñòðîÿò âàøè êåø äàííûå (ôîðóìû, ãðóïïû, ìîäåðàòîðû è ò.ä.), à òàêæå ïåðåñòðîÿò âàøè ìàñòåð øàáëîíû...
|
||||
<br /><br />
|
||||
<div align='center'><span style='font-weight:bold;font-size:14px'>» <a href='index.php?act=settings&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}'>Proceed...</a></span></div>
|
||||
<div align='center'><span style='font-weight:bold;font-size:14px'>» <a href='index.php?act=recache&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}'>Äàëåå...</a></span></div>
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
$ibforums->template->output();
|
||||
$this->ipsclass->template->output();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -511,22 +484,19 @@ class core_functions
|
||||
|
||||
function redirect($url, $text, $time=2)
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
|
||||
$ibforums->template->content .= "<meta http-equiv='refresh' content=\"{$time}; url={$url}\">
|
||||
$this->ipsclass->template->content .= "<meta http-equiv='refresh' content=\"{$time}; url={$url}\">
|
||||
<div class='tableborder'>
|
||||
<div class='maintitle'>Redirecting</div>
|
||||
<div class='maintitle'>Ïåðåàäðåñàöèÿ</div>
|
||||
<div class='tdrow1' style='padding:8px'>
|
||||
<div style='font-size:12px'>$text
|
||||
<br />
|
||||
<br />
|
||||
<center><a href='{$url}'>Click here if not redirected...</a></center>
|
||||
<center><a href='{$url}'>Íàæìèòå ñþäà, åñëè âû íå áûëè ïåðåìåùåíû...</a></center>
|
||||
</div>
|
||||
</div>
|
||||
</div>";
|
||||
|
||||
$ibforums->template->output("Redirecting...");
|
||||
$this->ipsclass->template->output("Ïåðåàäðåñàöèÿ...");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -535,12 +505,24 @@ class core_functions
|
||||
|
||||
function login_screen($msg='')
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
if ( ! file_exists( ROOT_PATH.'ipb_templates.xml' ) )
|
||||
{
|
||||
$msg .= "<div><b>Cannot locate XML templates</b><br />This should be located in 'ipb_templates.xml' please ensure this file is uploaded (recreating the file structure if needed) before continuing.
|
||||
<br /><strong>Failure to upload this file will mean that your templates will not be updated.</strong></div>";
|
||||
$alert .= "<div class='warnbox'><b>Íåâîçìîæíî íàéòè XML øàáëîíû</b><br />Îíè äîëæíû íàõîäèòüñÿ â «ipb_templates.xml» ïîæàëóéñòà ïðîâåðüòå, ÷òîáû ýòîò ôàéë áûë çàãðóæåí. Áåç íåãî ïðîäîëæåíèå íåâîçìîæíî.
|
||||
<br /><strong>Åñëè âû íå çàãðóçèòå ýòîò ôàéë, òî âàøè øàáëîíû íå áóäóò îáíîâëåíû!</strong></div>";
|
||||
}
|
||||
|
||||
if ( ! is_writeable( CACHE_PATH . 'cache/skin_cache' ) )
|
||||
{
|
||||
$alert .= "<div class='warnbox'><strong>ÂÍÈÌÀÍÈÅ: Ïàïêà cache/skin_cache íåäîñòóïíà äëÿ çàïèñè</strong><br />
|
||||
Ïîæàëóéñòà, ïðîâåðüòå CHMOD äëÿ ýòîé ïàïêè. Åñëè âû ïðîèãíîðèðóåòå ýòî ïðåäóïðåæäåíèå, òî ôàéëû ñòèëåé
|
||||
ìîãóò íåêîððåêòíî óñòàíîâèòüñÿ.</div>";
|
||||
}
|
||||
|
||||
if ( $alert )
|
||||
{
|
||||
$this->ipsclass->template->content .= "{$alert}";
|
||||
$this->ipsclass->template->output("ÂÍÈÌÀÍÈÅ");
|
||||
exit();
|
||||
}
|
||||
|
||||
if ( $msg != "" )
|
||||
@@ -548,33 +530,33 @@ class core_functions
|
||||
$msg = "<div class='warnbox'>$msg</div><br />";
|
||||
}
|
||||
|
||||
$ibforums->template->content .= "
|
||||
$this->ipsclass->template->content .= "
|
||||
<form action='index.php?act=login' method='post' name='theAdminForm'>
|
||||
{$msg}
|
||||
<div>
|
||||
<strong>You must log in with your forums administrative log in details to access the upgrade system.
|
||||
<br />Upgrading from {$ibforums->versions[$ibforums->current_version]} to {$ibforums->versions[$ibforums->current_upgrade]}</strong>
|
||||
<strong>Âû îáÿçàíû àâòîðèçîâàòüñÿ ñ âàøèìè äàííûìè äëÿ âõîäà â âàø ôîðóì ïîä ó÷åòíîé çàïèñüþ àäìèíèñòðàòîðà. Èíà÷å âû ïðîñòî íå ñìîæåòå âîñïîëüçîâàòüñÿ ñèñòåìîé îáíîâëåíèÿ.
|
||||
<br />Îáíîâëåíèå ñ âåðñèè {$this->ipsclass->versions[$this->ipsclass->current_version]} äî {$this->ipsclass->versions[$this->ipsclass->current_upgrade]}</strong>
|
||||
</div>
|
||||
<br />
|
||||
<div class='tableborder'>
|
||||
<div class='maintitle'>Verification Required - Please Log In</div>
|
||||
<div class='maintitle'>Òðåáóåòñÿ àâòîðèçàöèÿ</div>
|
||||
<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
|
||||
<tr>
|
||||
<td class='tdrow1' width='40%' valign='middle'>Your Forums Username:</td>
|
||||
<td class='tdrow1' width='40%' valign='middle'>Âàøå èìÿ ïîëüçîâàòåëÿ íà ôîðóìå:</td>
|
||||
<td class='tdrow2' width='60%' valign='middle'><input type='text' style='width:100%' name='username' value=''></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='tdrow1' width='40%' valign='middle'>Your Forums Password:</td>
|
||||
<td class='tdrow1' width='40%' valign='middle'>Âàø ïàðîëü íà ôîðóìå:</td>
|
||||
<td class='tdrow2' width='60%' valign='middle'><input type='password' style='width:100%' name='password' value=''></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='pformstrip' colspan='2'><div align='center'><input type='submit' value='Log in' id='button' accesskey='s'></div></td>
|
||||
<td class='pformstrip' colspan='2'><div align='center'><input type='submit' value='Âîéòè' id='button' accesskey='s'></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>";
|
||||
|
||||
$ibforums->template->output("Log In");
|
||||
$this->ipsclass->template->output("Âîéòè");
|
||||
|
||||
}
|
||||
|
||||
@@ -584,24 +566,22 @@ class core_functions
|
||||
|
||||
function get_member()
|
||||
{
|
||||
global $std, $DB, $ibforums;
|
||||
|
||||
$member = array( 'id' => 0 );
|
||||
|
||||
$ibforums->loginkey = $this->check_md5( $ibforums->input['loginkey'] );
|
||||
$ibforums->securekey = $this->check_md5( $ibforums->input['securekey'] );
|
||||
$ibforums->member_id = trim(intval($ibforums->input['mid'] ) );
|
||||
$this->ipsclass->loginkey = $this->check_md5( $this->ipsclass->input['loginkey'] );
|
||||
$this->ipsclass->securekey = $this->check_md5( $this->ipsclass->input['securekey'] );
|
||||
$this->ipsclass->member_id = trim(intval($this->ipsclass->input['mid'] ) );
|
||||
|
||||
if ( ! $ibforums->loginkey or ! $ibforums->securekey )
|
||||
if ( ! $this->ipsclass->loginkey or ! $this->ipsclass->securekey )
|
||||
{
|
||||
return $member;
|
||||
}
|
||||
|
||||
$DB->query( "SELECT m.*, g.* FROM ibf_members m
|
||||
LEFT JOIN ibf_groups g ON ( m.mgroup=g.g_id )
|
||||
WHERE member_login_key='{$ibforums->loginkey}' and id='{$ibforums->member_id}'" );
|
||||
$this->ipsclass->DB->query( "SELECT m.*, g.* FROM ibf_members m
|
||||
LEFT JOIN ibf_groups g ON ( m.mgroup=g.g_id )
|
||||
WHERE member_login_key='{$this->ipsclass->loginkey}' and id='{$this->ipsclass->member_id}'" );
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
$member = $this->ipsclass->DB->fetch_row();
|
||||
|
||||
return $member;
|
||||
}
|
||||
@@ -612,36 +592,34 @@ class core_functions
|
||||
|
||||
function get_version_latest()
|
||||
{
|
||||
global $ibforums;
|
||||
|
||||
$ibforums->current_version = '';
|
||||
$ibforums->current_upgrade = '';
|
||||
$this->ipsclass->current_version = '';
|
||||
$this->ipsclass->current_upgrade = '';
|
||||
|
||||
//------------------------------------------
|
||||
// Copy & pop DB array and get next
|
||||
// upgrade script
|
||||
//------------------------------------------
|
||||
|
||||
$tmp = $ibforums->db_contents;
|
||||
$tmp = $this->ipsclass->db_contents;
|
||||
|
||||
$ibforums->current_version = array_pop( $tmp );
|
||||
$this->ipsclass->current_version = array_pop( $tmp );
|
||||
|
||||
//------------------------------------------
|
||||
// Get the next upgrade script
|
||||
//------------------------------------------
|
||||
|
||||
ksort( $ibforums->dir_contents );
|
||||
ksort( $this->ipsclass->dir_contents );
|
||||
|
||||
foreach( $ibforums->dir_contents as $i => $a )
|
||||
foreach( $this->ipsclass->dir_contents as $i => $a )
|
||||
{
|
||||
if ( $a > $ibforums->current_version )
|
||||
if ( $a > $this->ipsclass->current_version )
|
||||
{
|
||||
if ( ! $ibforums->current_upgrade )
|
||||
if ( ! $this->ipsclass->current_upgrade )
|
||||
{
|
||||
$ibforums->current_upgrade = $a;
|
||||
$this->ipsclass->current_upgrade = $a;
|
||||
}
|
||||
|
||||
$ibforums->modules_to_run[] = $ibforums->versions[ $a ];
|
||||
$this->ipsclass->modules_to_run[] = $this->ipsclass->versions[ $a ];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -652,14 +630,12 @@ class core_functions
|
||||
|
||||
function get_db_structure()
|
||||
{
|
||||
global $std, $DB, $ibforums;
|
||||
|
||||
$vers = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id ASC' ) );
|
||||
$DB->simple_exec();
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id ASC' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while( $r = $DB->fetch_row() )
|
||||
while( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$vers[ $r['upgrade_version_id'] ] = $r['upgrade_version_id'];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user