Version 2.3.6
This commit is contained in:
1 parent
a3bb603c96
commit
19b38c7c74
764 files changed
+143731
-118164
No files matched your search
@@ -1,30 +1,4 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board INSTALLER
|
||||
| ========================================
|
||||
| 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: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+----------------------------------------------------------------------------
|
||||
| Action controller for install page
|
||||
+----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invision Power Board
|
||||
* Action controller for install page
|
||||
@@ -33,7 +7,6 @@
|
||||
class action_install
|
||||
{
|
||||
var $install;
|
||||
var $extra_install;
|
||||
|
||||
var $helpfiles = 0;
|
||||
|
||||
@@ -52,10 +25,6 @@ class action_install
|
||||
$this->install->saved_data['helpfile'] = intval($this->install->ipsclass->input['helpfile']) ? intval($this->install->ipsclass->input['helpfile']) : $this->install->saved_data['helpfile'];
|
||||
$this->install->saved_data['man'] = intval($this->install->ipsclass->input['man']) ? intval($this->install->ipsclass->input['man']) : $this->install->saved_data['man'];
|
||||
|
||||
if ( isset($this->install->saved_data['mysql_codepage']) AND !isset($this->install->ipsclass->vars['mysql_codepage']) ) {
|
||||
$this->install->ipsclass->DB->obj['mysql_codepage'] = $this->install->saved_data['mysql_codepage'];
|
||||
}
|
||||
|
||||
/* Switch */
|
||||
switch( $this->install->ipsclass->input['sub'] )
|
||||
{
|
||||
@@ -144,11 +113,6 @@ class action_install
|
||||
*/
|
||||
function install_sql()
|
||||
{
|
||||
if ( $this->install->saved_data['mysql_codepage'] AND !isset($this->install->ipsclass->vars['mysql_codepage']) )
|
||||
{
|
||||
$output = $this->install->write_codepage_configuration();
|
||||
}
|
||||
|
||||
if ( $this->install->current_upgrade AND $this->install->current_upgrade < 20000 )
|
||||
{
|
||||
// Jump right to the finish routine for 1.x
|
||||
@@ -169,14 +133,6 @@ class action_install
|
||||
require_once ( INS_ROOT_PATH.'installfiles/upg_'.$this->install->current_upgrade.'/'.strtolower($this->install->ipsclass->vars['sql_driver']).'_updates.php' );
|
||||
}
|
||||
|
||||
if ( file_exists( INS_ROOT_PATH.'sql/'.$this->install->ipsclass->vars['sql_driver'].'_install.php' ) )
|
||||
{
|
||||
require_once( INS_ROOT_PATH.'sql/'.$this->install->ipsclass->vars['sql_driver'].'_install.php' );
|
||||
|
||||
$extra_install = new install_extra();
|
||||
$extra_install->ipsclass =& $this->install->ipsclass;
|
||||
}
|
||||
|
||||
// Create/Alter tables
|
||||
if ( count( $SQL ) > 0 )
|
||||
{
|
||||
@@ -191,15 +147,11 @@ class action_install
|
||||
|
||||
$q = str_replace( "<%time%>", time(), $q );
|
||||
|
||||
if ( preg_match("/CREATE TABLE (\S+) \(/", $q) )
|
||||
if( $this->install->ipsclass->vars['mysql_tbl_type'] )
|
||||
{
|
||||
//-----------------------------------
|
||||
// Pass to handler
|
||||
//-----------------------------------
|
||||
|
||||
if ( $extra_install AND method_exists( $extra_install, 'process_query_create' ) )
|
||||
if( preg_match( "/^create table(.+?)/i", $q ) )
|
||||
{
|
||||
$q = $extra_install->process_query_create( $q );
|
||||
$q = preg_replace( "/^(.+?)\);$/is", "\\1) TYPE={$this->install->ipsclass->vars['mysql_tbl_type']};", $q );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +174,7 @@ class action_install
|
||||
}
|
||||
}
|
||||
|
||||
$message[] = "Âûïîëíåíî $this->sqlcount çàïðîñîâ...";
|
||||
$message[] = $this->sqlcount." queries run...";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -235,11 +187,11 @@ class action_install
|
||||
|
||||
if ( count( $this->install->error ) > 0 )
|
||||
{
|
||||
$this->install->message = count($message) ? implode( "<br />", $message ) : "Ïðîäîëæàåì îáíîâëåíèå";
|
||||
$this->install->message = count($message) ? implode( "<br />", $message ) : "Proceeding with update";
|
||||
|
||||
$this->install->template->warning( array_merge( array( $this->install->message ),
|
||||
array( 'Ïðîáëåìû ïðè îáíîâëåíèè äî '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>Îøèáîê: ".count($this->install->error).'</span>' ),
|
||||
array( 'Error in upgrade '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>".count($this->install->error).' errors found</span>' ),
|
||||
$this->install->error ) );
|
||||
$this->install->template->in_error = 1;
|
||||
|
||||
@@ -250,14 +202,14 @@ class action_install
|
||||
|
||||
if( $this->install->saved_data['man'] AND $output )
|
||||
{
|
||||
$output = "<h3><b>Äëÿ ïðîäîëæåíèÿ îáíîâëåíèÿ íåîáõîäèìî âûïîëíèòü ñëåäóþùèå MySQL çàïðîñû:</b></h3><br /><div class='eula'>".nl2br(htmlspecialchars($output)).'</div>';
|
||||
$output = "<h3><b>Please run these queries in your MySQL database before continuing..</b></h3><br />".nl2br(htmlspecialchars($output));
|
||||
|
||||
$this->install->template->next_action = '?p=install&sub=finish';
|
||||
$this->install->template->append( $output );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output[] = count($message) ? implode( "<br />", $message ) : "Íåò çàïðîñîâ, íàñòðîåê äëÿ èìïîðòèðîâàíèÿ...<br /><br />Ïðîäîëæàåì îáíîâëåíèå";
|
||||
$output[] = count($message) ? implode( "<br />", $message ) : "No queries, settings, or permissions to import...<br /><br />Proceeding with update";
|
||||
$this->install->template->next_action = '?p=install&sub=finish';
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( $output ) );
|
||||
$this->install->template->hide_next = 1;
|
||||
@@ -304,7 +256,7 @@ class action_install
|
||||
// Run it
|
||||
//-------------------------------
|
||||
|
||||
$settings->settings_do_import( 1, 1 );
|
||||
$settings->settings_do_import( 1 );
|
||||
|
||||
$message[] = $this->install->ipsclass->main_msg;
|
||||
|
||||
@@ -320,11 +272,11 @@ class action_install
|
||||
|
||||
if ( count( $this->install->error ) > 0 )
|
||||
{
|
||||
$this->install->message = count($message) ? implode( "<br />", $message ) : "Ïðîäîëæàåì îáíîâëåíèå";
|
||||
$this->install->message = count($message) ? implode( "<br />", $message ) : "Proceeding with update";
|
||||
|
||||
$this->install->template->warning( array_merge( array( $this->install->message ),
|
||||
array( 'Ïðîáëåìû ïðè îáíîâëåíèè äî '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>Îøèáîê: ".count($this->install->error).'</span>' ),
|
||||
array( 'Error in upgrade '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>".count($this->install->error).' errors found</span>' ),
|
||||
$this->install->error ) );
|
||||
$this->install->template->in_error = 1;
|
||||
|
||||
@@ -333,7 +285,7 @@ class action_install
|
||||
return;
|
||||
}
|
||||
|
||||
$output[] = count($message) ? implode( "<br />", $message ) : "Íåò íàñòðîåê äëÿ èìïîðòèðîâàíèÿ...<br /><br />Ïðîäîëæàåì îáíîâëåíèå";
|
||||
$output[] = count($message) ? implode( "<br />", $message ) : "No settings to import...<br /><br />Proceeding with update";
|
||||
$this->install->template->next_action = '?p=install&sub=acpperms';
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( $output ) );
|
||||
$this->install->template->hide_next = 1;
|
||||
@@ -372,7 +324,7 @@ class action_install
|
||||
|
||||
$api->add_task();
|
||||
|
||||
$message[] = $api->error ? "<span style='color:red;'>Íå óäàëîñü îáíîâèòü ñïèñîê çàäà÷ ïëàíèðîâùèêà. Âîñïîëüçóéòåñü èíòñðóìåíòîì îáíîâëåíèÿ çàäà÷ â ÀÖ.</span>" : "Îáíîâëåíèå ñïèñêà çàäà÷ ïëàíèðîâùèêà...";
|
||||
$message[] = $api->error ? "<span style='color:red;'>Could not rebuild tasks. Please rebuild tasks in the ACP from the Task Manager page</span>" : "Rebuilt Tasks from XML...";
|
||||
|
||||
//-------------------------------
|
||||
// Load module...
|
||||
@@ -399,7 +351,7 @@ class action_install
|
||||
//-----------------------------------------
|
||||
// Install FAQ
|
||||
//-----------------------------------------
|
||||
$message[] = "Îáíîâëåíèå ðàçäåëîâ ïîìîùè...";
|
||||
$message[] = "Updating FAQ information...";
|
||||
$xml = new class_xml();
|
||||
$xml->lite_parser = 1;
|
||||
|
||||
@@ -443,13 +395,81 @@ class action_install
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// XML: Help Information
|
||||
//-----------------------------------------
|
||||
|
||||
$message[] = "Inserting ACP help files...";
|
||||
|
||||
$keys = array();
|
||||
|
||||
$this->install->ipsclass->DB->build_query( array( 'select' => 'page_key', 'from' => 'acp_help' ) );
|
||||
$this->install->ipsclass->DB->exec_query();
|
||||
|
||||
while( $r = $this->install->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$keys[] = $r['page_key'];
|
||||
}
|
||||
|
||||
$xml = new class_xml();
|
||||
$xml->lite_parser = 1;
|
||||
|
||||
$content = implode( "", file( ROOT_PATH . 'resources/help_sections.xml' ) );
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
foreach( $xml->xml_array['helpsectionsexport']['helpsectionsgroup']['helpsections'] as $id => $entry )
|
||||
{
|
||||
$newrow = array(
|
||||
'is_setting' => 0,
|
||||
'page_key' => $entry['key']['VALUE'],
|
||||
'help_title' => $entry['title']['VALUE'],
|
||||
'help_body' => $entry['helptext']['VALUE'],
|
||||
);
|
||||
|
||||
if( in_array( $newrow['page_key'], $keys ) )
|
||||
{
|
||||
$this->install->ipsclass->DB->do_update( 'acp_help', $newrow, "page_key='{$newrow['page_key']}'" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->ipsclass->DB->do_insert( 'acp_help', $newrow );
|
||||
}
|
||||
}
|
||||
|
||||
$xml = new class_xml();
|
||||
$xml->lite_parser = 1;
|
||||
|
||||
$content = implode( "", file( ROOT_PATH . 'resources/help_settings.xml' ) );
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
foreach( $xml->xml_array['helpsettingsexport']['helpsettingsgroup']['helpsettings'] as $id => $entry )
|
||||
{
|
||||
$newrow = array(
|
||||
'is_setting' => 1,
|
||||
'page_key' => $entry['key']['VALUE'],
|
||||
'help_title' => $entry['title']['VALUE'],
|
||||
'help_body' => $entry['helptext']['VALUE'],
|
||||
'help_mouseover'=> $entry['mouseover']['VALUE'],
|
||||
);
|
||||
|
||||
if( in_array( $newrow['page_key'], $keys ) )
|
||||
{
|
||||
$this->install->ipsclass->DB->do_update( 'acp_help', $newrow, "page_key='{$newrow['page_key']}'" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->ipsclass->DB->do_insert( 'acp_help', $newrow );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( count( $this->install->error ) > 0 )
|
||||
{
|
||||
$this->install->message = count($message) ? implode( "<br />", $message ) : "Ïðîäîëæàåì îáíîâëåíèå";
|
||||
$this->install->message = count($message) ? implode( "<br />", $message ) : "Proceeding with update";
|
||||
|
||||
$this->install->template->warning( array_merge( array( $this->install->message ),
|
||||
array( 'Ïðîáëåìû ïðè îáíîâëåíèè äî '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>Îøèáîê: ".count($this->install->error).'</span>' ),
|
||||
array( 'Error in upgrade '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>".count($this->install->error).' errors found</span>' ),
|
||||
$this->install->error ) );
|
||||
$this->install->template->in_error = 1;
|
||||
|
||||
@@ -475,28 +495,28 @@ class action_install
|
||||
{
|
||||
$continue = 0;
|
||||
|
||||
$upg_file = INS_ROOT_PATH.'installfiles/upg_'.$this->install->current_upgrade.'/version_upgrade.php';
|
||||
if ( $this->install->current_upgrade < 20000 )
|
||||
{
|
||||
$driver = $this->install->ipsclass->vars['sql_driver'] ? trim(strtolower($this->install->ipsclass->vars['sql_driver'])) : 'mysql';
|
||||
|
||||
$upg_file = INS_ROOT_PATH.'installfiles/upg_'.$this->install->current_upgrade.'/version_upgrade_' . $driver . '.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
$upg_file = INS_ROOT_PATH.'installfiles/upg_'.$this->install->current_upgrade.'/version_upgrade.php';
|
||||
}
|
||||
|
||||
if ( file_exists( $upg_file ) )
|
||||
{
|
||||
require_once( $upg_file );
|
||||
|
||||
if ( file_exists( INS_ROOT_PATH.'sql/'.$this->install->ipsclass->vars['sql_driver'].'_install.php' ) )
|
||||
{
|
||||
require_once( INS_ROOT_PATH.'sql/'.$this->install->ipsclass->vars['sql_driver'].'_install.php' );
|
||||
|
||||
$this->install->extra_install = new install_extra();
|
||||
$this->install->extra_install->ipsclass =& $this->install->ipsclass;
|
||||
}
|
||||
|
||||
$upgrade = new version_upgrade( $this->install );
|
||||
$result = $upgrade->auto_run();
|
||||
|
||||
if ( count( $this->install->error ) > 0 )
|
||||
{
|
||||
$this->install->template->warning( array_merge( array( $this->install->message ),
|
||||
array( 'Ïðîáëåìû ïðè îáíîâëåíèè äî '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>Îøèáîê: ".count($this->install->error).'</span>' ),
|
||||
array( 'Error in upgrade '.$this->install->versions[ $this->install->current_upgrade ]. ' (' . $this->install->current_upgrade . ')' ),
|
||||
array( "<span style='color:red'>".count($this->install->error).' errors found</span>' ),
|
||||
$this->install->error ) );
|
||||
$this->install->template->in_error = 1;
|
||||
|
||||
@@ -550,7 +570,7 @@ class action_install
|
||||
$output[] = $this->install->message;
|
||||
}
|
||||
|
||||
$output[] = "Óñïåøíî çàâåðøåíî îáíîâëåíèå äî âåðñèè <nobr>{$this->install->versions[ $this->install->current_upgrade ]}</nobr>";
|
||||
$output[] = "Succesfully upgraded to version {$this->install->versions[ $this->install->current_upgrade ]}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -565,7 +585,7 @@ class action_install
|
||||
}
|
||||
else
|
||||
{
|
||||
$output[] = "Ïðîäîëæàåì îáíîâëåíèå...";
|
||||
$output[] = "Proceeding with update...";
|
||||
}
|
||||
|
||||
$continue = 1;
|
||||
@@ -585,7 +605,7 @@ class action_install
|
||||
'upgrade_mid' => $this->install->saved_data['mid'],
|
||||
) );
|
||||
|
||||
$output[] = "Óñïåøíî çàâåðøåíî îáíîâëåíèå äî âåðñèè <nobr>{$this->install->versions[ $this->install->current_upgrade ]}</nobr>";
|
||||
$output[] = "Succesfully upgraded to version {$this->install->versions[ $this->install->current_upgrade ]}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,25 +670,83 @@ class action_install
|
||||
//-------------------------------
|
||||
|
||||
require_once( ROOT_PATH . "sources/lib/admin_skin.php" );
|
||||
$this->install->ipsclass->skin_acp = 'IPB2_Standard';
|
||||
$this->install->ipsclass->skin_acp_url = $this->install->ipsclass->vars['board_url']."/skin_acp/".$this->install->ipsclass->skin_acp;
|
||||
$this->install->ipsclass->skin_acp = 'IPB2_Standard';
|
||||
$this->install->ipsclass->skin_acp_url = $this->install->ipsclass->vars['board_url'] . "/skin_acp/" . $this->install->ipsclass->skin_acp;
|
||||
|
||||
$this->install->ipsclass->adskin = new admin_skin();
|
||||
$this->install->ipsclass->adskin->ipsclass =& $this->install->ipsclass;
|
||||
$this->install->ipsclass->adskin->init_admin_skin();
|
||||
|
||||
//-----------------------------------------
|
||||
// Fixing something?
|
||||
//-----------------------------------------
|
||||
|
||||
$queries_to_run = array();
|
||||
|
||||
foreach( $this->install->ipsclass->input as $k => $v )
|
||||
{
|
||||
if( preg_match( "/^query(\d+)$/", $k, $matches ) )
|
||||
{
|
||||
$queries_to_run[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if( isset($this->install->ipsclass->input['query']) AND $this->install->ipsclass->input['query'] )
|
||||
{
|
||||
$queries_to_run[] = $this->install->ipsclass->input['query'];
|
||||
}
|
||||
|
||||
if( count($queries_to_run) > 0 )
|
||||
{
|
||||
foreach( $queries_to_run as $the_query )
|
||||
{
|
||||
$sql = trim( urldecode( base64_decode($the_query) ) );
|
||||
|
||||
if ( preg_match( "/^(DROP|FLUSH)/i", trim($sql) ) )
|
||||
{
|
||||
$this->install->ipsclass->main_msg = "Sorry, those queries are not allowed for your safety";
|
||||
|
||||
continue;
|
||||
}
|
||||
else if ( preg_match( "/^(DELETE|UPDATE|TRUNCATE)/i", preg_replace( "#\s{1,}#s", "", $sql ) ) and preg_match( "/admin_login_logs/i", preg_replace( "#\s{1,}#s", "", $sql ) ) )
|
||||
{
|
||||
$this->install->ipsclass->main_msg = "Sorry, those queries are not allowed for your safety";
|
||||
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->ipsclass->DB->return_die = 1;
|
||||
|
||||
$this->install->ipsclass->DB->query($sql,1);
|
||||
|
||||
if( $this->install->ipsclass->DB->error != "" )
|
||||
{
|
||||
$this->install->ipsclass->main_msg .= "<span style='color:red;'>SQL Error</span><br />{$this->install->ipsclass->DB->error}<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->ipsclass->main_msg .= "Query: ".htmlspecialchars($sql)."<br />Executed Successfully<br />";
|
||||
}
|
||||
|
||||
$this->install->ipsclass->DB->error = "";
|
||||
$this->install->ipsclass->DB->failed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Load module...
|
||||
//-------------------------------
|
||||
|
||||
require_once( KERNEL_PATH . 'db_lib/' . strtolower($this->install->ipsclass->vars['sql_driver']) . '_tools.php' );
|
||||
require_once( ROOT_PATH . 'install/sql/' . strtolower($this->install->ipsclass->vars['sql_driver']) . '_tables.php' );
|
||||
|
||||
require_once( ROOT_PATH."sources/action_admin/sql_{$this->install->ipsclass->vars['sql_driver']}.php" );
|
||||
|
||||
$this->sql_driver = new ad_sql_module();
|
||||
$this->sql_driver->ipsclass =& $this->install->ipsclass;
|
||||
$db_tools = new db_tools( $this->install->ipsclass );
|
||||
|
||||
$output = array();
|
||||
$output = $this->sql_driver->db_table_diag( 0 );
|
||||
|
||||
$output = $db_tools->db_table_diag( $TABLE );
|
||||
#print_r($output);
|
||||
$our_output = " <style type='text/css' media='all'>
|
||||
.tableheader,
|
||||
.tableheaderalt
|
||||
@@ -687,14 +765,16 @@ class action_install
|
||||
<script type='text/javascript' src='dbchecker.js'></script>
|
||||
";
|
||||
|
||||
if( $this->sql_driver->db_has_issues )
|
||||
if( $output['error_count'] > 0 )
|
||||
{
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "{none}" , "50%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "{none}" , "50%" );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->start_table( "ÂÍÈÌÀÍÈÅ: Îáíàðóæåíû îøèáêè" );
|
||||
$our_output .= "<script type='text/javascript' src='dbchecker.js'></script><script type='text/javascript'>var save_data = '".urlencode(serialize($this->install->saved_data))."';</script>";
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->add_td_row( array( array( "<script type='text/javascript'>var save_data = '".serialize($this->install->saved_data)."';</script><span class='rss-feed-invalid'>Íàéäåíû îøèáêè â òàáëèöàõ áàçû äàííûõ ôîðóìà. Âû ìîæåòå îçíàêîìèòüñÿ ñî ñïèñêîì íàéäåííûõ îøèáîê íèæå, ëèáî <a href='#' onclick='fix_all_dberrors();'>èñïðàâèòü</a> ñðàçó âñå îøèáêè.", 2 ) ) );
|
||||
$our_output .= $this->install->ipsclass->adskin->start_table( "WARNING: ERRORS FOUND" );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->add_td_row( array( array( "<span class='rss-feed-invalid'>There were errors found with your database. Please review them below, or click <a href='#' onclick='fix_all_dberrors();'>here</a> to correct these errors.", 2 ) ) );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->end_table();
|
||||
}
|
||||
@@ -703,24 +783,43 @@ class action_install
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "{none}" , "50%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "{none}" , "50%" );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->start_table( "Íåò îøèáîê" );
|
||||
$our_output .= $this->install->ipsclass->adskin->start_table( "No Errors Found" );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->add_td_row( array( array( "<span class='rss-feed-valid'>Îøèáîê â âàøå áàçå äàííûõ íå íàéäåíî.", 2 ) ) );
|
||||
$our_output .= $this->install->ipsclass->adskin->add_td_row( array( array( "<span class='rss-feed-valid'>There were no errors found with your database.", 2 ) ) );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->end_table();
|
||||
}
|
||||
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "Òàáëèöà" , "30%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "Ñîñòîÿíèå" , "20%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "Èñïðàâèòü" , "50%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "Table" , "30%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "Status" , "20%" );
|
||||
$this->install->ipsclass->adskin->td_header[] = array( "Fix" , "50%" );
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->start_table( "Ðåçóëüòàòû ïðîâåðêè òàáëèö áàçû äàííûõ" );
|
||||
$our_output .= $this->install->ipsclass->adskin->start_table( "Database Table Results" );
|
||||
|
||||
foreach( $output as $html_row )
|
||||
$good_img = "<img src='{$this->install->ipsclass->skin_acp_url}/images/aff_tick.png' border='0' alt='YN' class='ipd' />";
|
||||
$bad_img = "<img src='{$this->install->ipsclass->skin_acp_url}/images/aff_cross.png' border='0' alt='YN' class='ipd' />";
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach( $output['results'] as $data )
|
||||
{
|
||||
$html_row = preg_replace( "#'&section=help&act=diag&code=dbchecker&query=(.*?)'#i", "'index.php?p=install&sub=checkdb&saved_data=".serialize($this->install->saved_data)."&query=$1'", $html_row );
|
||||
if( $data['status'] == 'error' )
|
||||
{
|
||||
$popup_div = "<div style='border: 2px outset rgb(85, 85, 85); padding: 4px; background: rgb(238, 238, 238) none repeat scroll 0%; position: absolute; width: auto; display: none; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;' id='{$i}' align='center'>{$data['fixsql']}</div>";
|
||||
|
||||
$our_output .= $html_row;
|
||||
$our_output .= $this->install->ipsclass->adskin->add_td_row( array( "<span style='color:red'>{$data['table']}</span>",
|
||||
"<span style='color:red'>{$good_img}</span>",
|
||||
"<center><script type='text/javascript'>all_queries[{$i}] = '".base64_encode($data['fixsql'])."';</script><a href='index.php?p=install&sub=checkdb&saved_data=".urlencode(serialize($this->install->saved_data))."&query=".urlencode(base64_encode($data['fixsql']))."'><b>Fix Automatically</b></a> | <a href'#' onclick=\"toggleview('{$i}');return false;\" style='cursor: pointer;'><b>Fix Manually</b></a><br />{$popup_div}</center>"
|
||||
) );
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$our_output .= $this->install->ipsclass->adskin->add_td_row( array( "<span style='color:green'>{$data['table']}</span>",
|
||||
"<span style='color:green'>{$good_img}</span>",
|
||||
" "
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
$our_output .= $this->install->ipsclass->adskin->end_table();
|
||||
@@ -728,11 +827,13 @@ class action_install
|
||||
else
|
||||
{
|
||||
// Can't run db checker as table def isn't there
|
||||
$this->install_skinrevert();
|
||||
//$this->install_skinrevert();
|
||||
$this->install_templates();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->install->template->next_action = '?p=install&sub=skinrevert';
|
||||
//$this->install->template->next_action = '?p=install&sub=skinrevert';
|
||||
$this->install->template->next_action = '?p=install&sub=templates';
|
||||
$this->install->template->append( $our_output );
|
||||
}
|
||||
|
||||
@@ -763,27 +864,17 @@ class action_install
|
||||
if ( ! $this->install->saved_data['do'] )
|
||||
{
|
||||
$id = intval($this->install->saved_data['skinid']) ? intval($this->install->saved_data['skinid']) : 1;
|
||||
$this->install->saved_data['new_skin'] = intval($this->install->saved_data['new_skin']);
|
||||
|
||||
$default = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => '*',
|
||||
'from' => 'skin_sets',
|
||||
'where' => "set_skin_set_id > {$id}",
|
||||
'where' => "set_skin_set_id > {$id} AND set_key != 'ip.board_pro'",
|
||||
'order' => 'set_skin_set_id ASC',
|
||||
'limit' => array(0,1) ) );
|
||||
|
||||
if ( $default['set_skin_set_id'] AND ( $default['set_skin_set_id'] == $this->install->saved_data['new_skin'] ) )
|
||||
{
|
||||
$default = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => '*',
|
||||
'from' => 'skin_sets',
|
||||
'where' => "set_skin_set_id > {$this->install->saved_data['new_skin']}",
|
||||
'order' => 'set_skin_set_id ASC',
|
||||
'limit' => array(0,1) ) );
|
||||
}
|
||||
|
||||
if ( ! $default['set_skin_set_id'] )
|
||||
{
|
||||
$this->install->template->next_action = '?p=install&sub=templates';
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( 'Îáðàáîòàíû âñå ñòèëè' ) ) );
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( 'No further skins to revert' ) ) );
|
||||
$this->install->template->hide_next = 1;
|
||||
return;
|
||||
}
|
||||
@@ -801,32 +892,35 @@ class action_install
|
||||
$man = intval( $this->install->saved_data['skinid'] );
|
||||
$cnt = 0;
|
||||
|
||||
$default = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_skin_set_id=".$man ) );
|
||||
$default = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_skin_set_id=".$man." AND set_key != 'ip.board_pro'" ) );
|
||||
|
||||
$this->install->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "set_id=".$man ) );
|
||||
$outer = $this->install->ipsclass->DB->simple_exec();
|
||||
|
||||
if( $this->install->ipsclass->DB->get_num_rows($outer) )
|
||||
if( $default['set_skin_set_id'] )
|
||||
{
|
||||
while( $r = $this->install->ipsclass->DB->fetch_row($outer) )
|
||||
$this->install->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "set_id=".$man ) );
|
||||
$outer = $this->install->ipsclass->DB->simple_exec();
|
||||
|
||||
if( $this->install->ipsclass->DB->get_num_rows($outer) )
|
||||
{
|
||||
if( $r['set_id'] == 1 )
|
||||
while( $r = $this->install->ipsclass->DB->fetch_row($outer) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->ipsclass->DB->simple_exec_query( array( 'delete' => 'skin_templates', 'where' => 'suid='.$r['suid'] ) );
|
||||
$cnt++;
|
||||
if( $r['set_id'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->ipsclass->DB->simple_exec_query( array( 'delete' => 'skin_templates', 'where' => 'suid='.$r['suid'] ) );
|
||||
$cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->install->ipsclass->DB->do_update( 'skin_sets', array( 'set_css' => '', 'set_wrapper' => '' ), "set_skin_set_id=".$man );
|
||||
}
|
||||
|
||||
$this->install->ipsclass->DB->do_update( 'skin_sets', array( 'set_css' => '', 'set_wrapper' => '' ), "set_skin_set_id=".$man );
|
||||
|
||||
$next = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => '*',
|
||||
'from' => 'skin_sets',
|
||||
'where' => "set_skin_set_id > ".$man,
|
||||
'where' => "set_skin_set_id > ".$man." AND set_key != 'ip.board_pro'",
|
||||
'order' => 'set_skin_set_id ASC',
|
||||
'limit' => array(0,1) ) );
|
||||
|
||||
@@ -837,16 +931,16 @@ class action_install
|
||||
$this->install->saved_data['skinid'] = $next['set_skin_set_id'];
|
||||
$this->install->saved_data['do'] = 'all';
|
||||
$this->install->template->next_action = '?p=install&sub=skinrevert';
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( "Èçìåíåíèÿ â $cnt øàáëîíàõ èç ñòèëÿ '{$default['set_name']}' îòìåíåíû, ïåðåõîäèì ê ñëåäóþùåìó ñòèëþ..." ) ) );
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( "$cnt skin template bits from skin set '{$default['set_name']}' reverted, proceeding to next skin set...." ) ) );
|
||||
$this->install->template->hide_next = 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->saved_data['skinid'] = $next['set_skin_set_id'];
|
||||
$this->install->saved_data['skinid'] = $default['set_skin_set_id'];
|
||||
$this->install->template->next_action = '?p=install&sub=skinrevert';
|
||||
unset($this->install->saved_data['do']);
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( "Èçìåíåíèÿ â $cnt øàáëîíàõ èç ñòèëÿ '{$default['set_name']}' îòìåíåíû, ïåðåõîäèì ê ñëåäóþùåìó ñòèëþ..." ) ) );
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( "$cnt skin template bits from skin set '{$default['set_name']}' reverted, proceeding to next skin set...." ) ) );
|
||||
$this->install->template->hide_next = 1;
|
||||
return;
|
||||
}
|
||||
@@ -854,7 +948,7 @@ class action_install
|
||||
else
|
||||
{
|
||||
$this->install->template->next_action = '?p=install&sub=templates';
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( "Èçìåíåíèÿ â $cnt øàáëîíàõ èç ñòèëÿ '{$default['set_name']}' îòìåíåíû, ïåðåõîäèì ê ñëåäóþùåìó øàáëîíó..." ) ) );
|
||||
$this->install->template->append( $this->install->template->install_page_refresh( array( "$cnt skin template bits from skin set '{$default['set_name']}' reverted, proceeding to rebuild templates...." ) ) );
|
||||
$this->install->template->hide_next = 1;
|
||||
return;
|
||||
}
|
||||
@@ -900,7 +994,7 @@ class action_install
|
||||
if ( ! is_array( $xml->xml_array['templateexport']['templategroup']['template'] ) )
|
||||
{
|
||||
$this->install->template->in_error = 1;
|
||||
$this->install->error[] = "Ïðîáëåìû ñ ðåñóðîì resources/ipb_templates.xml - ðåñóðñ ñîäåðæèò íå ïðàâèëüíûé XML êîä";
|
||||
$this->install->error[] = "Error with resources/ipb_templates.xml - could not process XML properly";
|
||||
|
||||
$this->install->template->warning( $this->install->error );
|
||||
|
||||
@@ -909,7 +1003,7 @@ class action_install
|
||||
}
|
||||
else
|
||||
{
|
||||
$output[] = "Ãëàâíûé øàáëîí îáíîâëåí, ïåðåõîäèì ê ñîçäàíèþ êåøåé øàáëîíîâ...";
|
||||
$output[] = "Master templates rebuilt, proceeding to recache templates...";
|
||||
|
||||
foreach( $xml->xml_array['templateexport']['templategroup']['template'] as $id => $entry )
|
||||
{
|
||||
@@ -924,21 +1018,23 @@ class action_install
|
||||
|
||||
if ( $row['suid'] )
|
||||
{
|
||||
$this->install->ipsclass->DB->do_update( 'skin_templates', array( 'func_data' => $entry[ 'func_data' ]['VALUE'],
|
||||
'section_content' => $entry[ 'section_content' ]['VALUE'],
|
||||
'updated' => time()
|
||||
)
|
||||
, 'suid='.$row['suid'] );
|
||||
$this->install->ipsclass->DB->do_update( 'skin_templates', array( 'func_data' => $entry[ 'func_data' ]['VALUE'],
|
||||
'section_content' => $entry[ 'section_content' ]['VALUE'],
|
||||
'group_names_secondary' => $entry[ 'group_names_secondary' ]['VALUE'],
|
||||
'updated' => time()
|
||||
)
|
||||
, 'suid='.$row['suid'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->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
|
||||
) );
|
||||
$this->install->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_names_secondary' => $entry[ 'group_names_secondary' ]['VALUE'],
|
||||
'group_name' => $entry[ 'group_name' ]['VALUE'],
|
||||
'updated' => time(),
|
||||
'set_id' => 1
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user