1841 lines
59 KiB
PHP
1841 lines
59 KiB
PHP
<?php
|
|
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| Invision Power Board 2.1.7
|
|
| 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: Tuesday 18th of July 2006 05:56:00 PM
|
|
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
|
| Licence Info: http://www.invisionboard.com/?license
|
|
| http://www.ibresource.ru/license
|
|
+---------------------------------------------------------------------------
|
|
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
|
+---------------------------------------------------------------------------
|
|
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
|
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
|
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
|
+--------------------------------------------------------------------------
|
|
|
|
|
| > Script written by Matthew Mecham
|
|
| > Date started: 19th March 2004
|
|
| > Updated for 2.1: 23 June 2005
|
|
|
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
|
|
error_reporting (E_ERROR | E_WARNING | E_PARSE);
|
|
set_magic_quotes_runtime(0);
|
|
|
|
//+------------------------------------------------------------------------
|
|
// ENTER YOUR PATH TO THE DIRECTORY THIS SCRIPT IS IN.
|
|
//+------------------------------------------------------------------------
|
|
// Tips:
|
|
//
|
|
// If you are using Windows and Apache, do not
|
|
// use backslashes, use normal forward slashes.
|
|
// You may need to remove the drive letter also
|
|
// Example: C:\apache\htdocs\ibforums\ will need
|
|
// to be: /apache/htdocs/ibforums/
|
|
//
|
|
// If you are using Windows and IIS, then you will
|
|
// need to enter double backslashes.
|
|
//
|
|
// In all cases, please enter a trailing slash (or
|
|
// trailing backslashes...)
|
|
//+------------------------------------------------------------------------
|
|
|
|
define( 'THIS_ROOT_PATH', './' );
|
|
|
|
//+------------------------------------------------------------------------
|
|
// ROOT TO REST OF IPB (SHOULD BE ABLE TO LEAVE AS-IS
|
|
//+------------------------------------------------------------------------
|
|
|
|
define( 'ROOT_PATH', '../' );
|
|
|
|
//-----------------------------------------------
|
|
// NO USER EDITABLE SECTIONS BELOW
|
|
//-----------------------------------------------
|
|
|
|
define( 'KERNEL_PATH', ROOT_PATH.'ips_kernel/' );
|
|
define( 'CACHE_PATH' , ROOT_PATH );
|
|
|
|
define ( 'IN_ACP', 1 );
|
|
define ( 'IN_IPB', 1 );
|
|
define ( 'IN_DEV', 0 );
|
|
|
|
define ( 'IPBVERSION', '2.1.7' );
|
|
define ( 'IPB_LONG_VERSION', '21013.60712.u' );
|
|
|
|
define ( 'USE_SHUTDOWN', 0 );
|
|
define ( 'SAFE_MODE_ON', 0 );
|
|
|
|
$INFO = array();
|
|
|
|
//--------------------------------
|
|
// Load our classes
|
|
//--------------------------------
|
|
|
|
require ROOT_PATH . "sources/ipsclass.php";
|
|
require KERNEL_PATH . "class_converge.php";
|
|
|
|
# Initiate super-class
|
|
$ipsclass = new ipsclass();
|
|
$ipsclass->vars = $INFO;
|
|
$ipsclass->template = new template();
|
|
|
|
//--------------------------------
|
|
// Set up our vars
|
|
//--------------------------------
|
|
|
|
$ipsclass->parse_incoming();
|
|
|
|
$ipsclass->initiate_ipsclass();
|
|
|
|
//--------------------------------
|
|
// Set converge
|
|
//--------------------------------
|
|
|
|
$ipsclass->converge = new class_converge( $ipsclass->DB );
|
|
|
|
//---------------------------------------
|
|
// Installer locked?
|
|
//---------------------------------------
|
|
|
|
if ( file_exists( THIS_ROOT_PATH.'install.lock') )
|
|
{
|
|
install_error("Ñêðèïò óñòàíîâêè çàáëîêèðîâàí!<br>Ïîæàëóéñòà, (÷åðåç FTP) óäàëèòå ôàéë 'install/install.lock'");
|
|
exit();
|
|
}
|
|
|
|
//---------------------------------------
|
|
// Make sure we've renamed conf_global.php
|
|
//---------------------------------------
|
|
|
|
if ( file_exists( ROOT_PATH.'conf_global.php.dist') AND ! file_exists( ROOT_PATH.'conf_global.php') )
|
|
{
|
|
if ( ! @rename( ROOT_PATH.'conf_global.php.dist', ROOT_PATH.'conf_global.php' ) )
|
|
{
|
|
install_error("<h1 align='center'>Âû îáÿçàíû ïåðåèìåíîâàòü ôàéë 'conf_global.<b style='color:red'>php.dist</b>' â 'conf_global.<b style='color:red'>php</b>' ïåðåä óñòàíîâêîé ôîðóìà.</h1>
|
|
Ýòîò ôàéë ìîæíî íàéòè â êîðíåâîé ïàïêå ôîðóìà, òàì æå ãäå è 'admin.php' è 'index.php'.");
|
|
exit();
|
|
}
|
|
}
|
|
|
|
|
|
//-----------------------------------------------
|
|
// What to do?
|
|
//-----------------------------------------------
|
|
|
|
switch($ipsclass->input['a'])
|
|
{
|
|
case '1':
|
|
do_setup_form();
|
|
break;
|
|
|
|
case '2':
|
|
do_install();
|
|
break;
|
|
|
|
case 'templates':
|
|
do_templates();
|
|
break;
|
|
|
|
case 'acpperms':
|
|
do_acpperms();
|
|
break;
|
|
|
|
case '3':
|
|
do_finish();
|
|
break;
|
|
|
|
default:
|
|
do_intro();
|
|
break;
|
|
}
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// DO FINISH
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function do_finish()
|
|
{
|
|
global $ipsclass;
|
|
|
|
//-----------------------------------
|
|
// IMPORT $INFO!
|
|
//-----------------------------------
|
|
|
|
$require = ROOT_PATH."conf_global.php";
|
|
|
|
if ( ! file_exists($require) )
|
|
{
|
|
install_error("Íåâîçìîæíî íàéòè ôàéë '$require'. Âîçìîæíî, âàì íåîáõîäèìî ââåñòè ïîëíûé ïóòü ê ýòîìó ôàéëó ñêðèïòà óñòàíîâêè (index.php). Äëÿ ýòîãî ïðîñòî îòêðîéòå ýòîò ôàéë â ëþáîì òåêñòîâîì ðåäàêòîðå è ââåäèòå çíà÷åíèå ïåðåìåííîé \$root (íå çàáóäüòå äîáàâèòü êîíå÷íûé ñëýø '/'). Ïîëüçîâàòåëÿì NT ñèñòåì íåîáõîäèìî èñïîëüçîâàòü äâîéíîé ñëýø.");
|
|
}
|
|
|
|
require_once($require);
|
|
|
|
//-----------------------------------
|
|
// Attempt a DB connection..
|
|
//-----------------------------------
|
|
|
|
require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );
|
|
|
|
$ipsclass->DB = new db_driver();
|
|
|
|
$ipsclass->DB->obj['sql_database'] = $INFO['sql_database'];
|
|
$ipsclass->DB->obj['sql_user'] = $INFO['sql_user'];
|
|
$ipsclass->DB->obj['sql_pass'] = $INFO['sql_pass'];
|
|
$ipsclass->DB->obj['sql_host'] = $INFO['sql_host'];
|
|
$ipsclass->DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
|
|
$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
|
|
$ipsclass->DB->obj['use_shutdown'] = 0;
|
|
|
|
//-----------------------------------
|
|
// Required vars?
|
|
//-----------------------------------
|
|
|
|
if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
|
|
{
|
|
foreach( $ipsclass->DB->connect_vars as $k => $v )
|
|
{
|
|
$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Attempt a connect
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->connect() )
|
|
{
|
|
install_error( "Îøèáêà ñîåäèíåíèÿ:<br /><br />".$ipsclass->DB->error );
|
|
}
|
|
|
|
//--------------------------------
|
|
// Make CONSTANT
|
|
//--------------------------------
|
|
|
|
define( 'SQL_PREFIX', $ipsclass->DB->obj['sql_tbl_prefix'] );
|
|
define( 'SQL_DRIVER', strtolower($INFO['sql_driver']) );
|
|
|
|
//-----------------------------------
|
|
// Get ACP library
|
|
//-----------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/lib/admin_cache_functions.php' );
|
|
$acp = new admin_cache_functions();
|
|
$acp->ipsclass =& $ipsclass;
|
|
$acp->_rebuild_all_caches( array(2) );
|
|
unset( $acp );
|
|
|
|
//-------------------------------------------------------------
|
|
// Forum cache
|
|
//-------------------------------------------------------------
|
|
|
|
$ipsclass->update_forum_cache();
|
|
|
|
//-------------------------------------------------------------
|
|
// Group Cache
|
|
//-------------------------------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_admin/groups.php' );
|
|
$lib = new ad_groups();
|
|
$lib->ipsclass =& $ipsclass;
|
|
$lib->rebuild_group_cache();
|
|
unset( $lib );
|
|
|
|
//-------------------------------------------------------------
|
|
// Systemvars
|
|
//-------------------------------------------------------------
|
|
|
|
$ipsclass->cache['systemvars'] = array();
|
|
|
|
$result = $ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as cnt', 'from' => 'mail_queue' ) );
|
|
|
|
$ipsclass->cache['systemvars']['mail_queue'] = intval( $result['cnt'] );
|
|
$ipsclass->cache['systemvars']['task_next_run'] = time() + 3600;
|
|
|
|
$ipsclass->update_cache( array( 'name' => 'systemvars', 'array' => 1, 'deletefirst' => 1 ) );
|
|
|
|
//-------------------------------------------------------------
|
|
// Stats
|
|
//-------------------------------------------------------------
|
|
|
|
$ipsclass->cache['stats'] = array();
|
|
|
|
$ipsclass->cache['stats']['total_replies'] = 0;
|
|
$ipsclass->cache['stats']['total_topics'] = 1;
|
|
$ipsclass->cache['stats']['mem_count'] = 1;
|
|
|
|
$r = $ipsclass->DB->simple_exec_query( array( 'select' => 'id, name',
|
|
'from' => 'members',
|
|
'order' => 'id DESC',
|
|
'limit' => '0,1'
|
|
) );
|
|
|
|
$ipsclass->cache['stats']['last_mem_name'] = $r['name'];
|
|
$ipsclass->cache['stats']['last_mem_id'] = $r['id'];
|
|
|
|
$ipsclass->update_cache( array( 'name' => 'stats', 'array' => 1, 'deletefirst' => 1 ) );
|
|
|
|
//-------------------------------------------------------------
|
|
// Ranks
|
|
//-------------------------------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_admin/member.php' );
|
|
$lib = new ad_member();
|
|
$lib->ipsclass =& $ipsclass;
|
|
$lib->titles_recache();
|
|
unset( $lib );
|
|
|
|
//-------------------------------------------------------------
|
|
// SETTINGS
|
|
//-------------------------------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_admin/settings.php' );
|
|
$lib = new ad_settings();
|
|
$lib->ipsclass =& $ipsclass;
|
|
$lib->setting_rebuildcache();
|
|
unset( $lib );
|
|
|
|
//-------------------------------------------------------------
|
|
// EMOTICONS
|
|
//-------------------------------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_admin/emoticons.php' );
|
|
$lib = new ad_emoticons();
|
|
$lib->ipsclass =& $ipsclass;
|
|
$lib->emoticon_rebuildcache();
|
|
unset( $lib );
|
|
|
|
//-------------------------------------------------------------
|
|
// LANGUAGES
|
|
//-------------------------------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_admin/languages.php' );
|
|
$lib = new ad_languages();
|
|
$lib->ipsclass =& $ipsclass;
|
|
$lib->rebuild_cache();
|
|
unset( $lib );
|
|
|
|
//-------------------------------------------------------------
|
|
// ATTACHMENT TYPES
|
|
//-------------------------------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_admin/attachments.php' );
|
|
$lib = new ad_attachments();
|
|
$lib->ipsclass =& $ipsclass;
|
|
$lib->attach_type_rebuildcache();
|
|
unset( $lib );
|
|
|
|
|
|
//-----------------------------------
|
|
// Attempt to lock the install..
|
|
//-----------------------------------
|
|
|
|
if ($FH = @fopen( THIS_ROOT_PATH.'install.lock', 'w' ) )
|
|
{
|
|
@fwrite( $FH, 'bleh', 4 );
|
|
@fclose($FH);
|
|
|
|
@chmod( THIS_ROOT_PATH.'install.lock', 0666 );
|
|
|
|
$ipsclass->template->print_top('Óñïåøíî!');
|
|
|
|
$msg="Ñêðèïò óñòàíîâêè ñåé÷àñ çàáëîêèðîâàí (äëÿ ïåðåóñòàíîâêè óäàëèòå ôàéë 'install.lock'). Äëÿ áîëüøåé áåçîïàñíîñòè, ïîæàëóéñòà, óäàëèòå ôàéë install/index.php ïðåæäå, ÷åì ïðîäîëæèòü.
|
|
<br><br>
|
|
<center><b><a href='../index.php?act=Login&CODE=00'>ÍÀÆÌÈÒÅ ÑÞÄÀ, ×ÒÎÁÛ ÂÎÉÒÈ Â ÔÎÐÓÌ!</a></center>";
|
|
}
|
|
else
|
|
{
|
|
$ipsclass->template->print_top('Óñïåøíî!');
|
|
|
|
$msg = "ÏÎÆÀËÓÉÑÒÀ, ÓÄÀËÈÒÅ ÔÀÉË ÑÊÐÈÏÒÀ ÓÑÒÀÍÎÂÊÈ ('/install/index.php') ÏÐÅÆÄÅ, ×ÅÌ ÏÐÎÄÎËÆÈÒÜ!<br> Åñëè âû íå ñäåëàåòå ýòîãî, ëþáîé ïîëüçîâàòåëü èíòåðíåòà ñìîæåò óäàëèòü äàííûå âàøåãî ôîðóìà!
|
|
<br><br>
|
|
<center><b><a href='../index.php?act=Login&CODE=00'>ÍÀÆÌÈÒÅ ÑÞÄÀ, ×ÒÎÁÛ ÂÎÉÒÈ Â ÔÎÐÓÌ!</a></center>";
|
|
}
|
|
|
|
$ipsclass->template->contents .= "
|
|
<div class='centerbox'>
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Óñïåøíî</div>
|
|
<div class='tablepad'>
|
|
<b>Óñïåøíî</b>
|
|
<br><br>
|
|
$msg
|
|
</div>
|
|
</div>
|
|
</div>";
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
//*-------------------------------------------------------------------------*/
|
|
// Install the ACP perm keys
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function do_acpperms()
|
|
{
|
|
global $ipsclass;
|
|
|
|
//-----------------------------------
|
|
// INIT
|
|
//-----------------------------------
|
|
|
|
$inserted = 0;
|
|
|
|
//-----------------------------------
|
|
// IMPORT $INFO!
|
|
//-----------------------------------
|
|
|
|
$require = ROOT_PATH."conf_global.php";
|
|
|
|
if ( ! file_exists($require) )
|
|
{
|
|
install_error("Íåâîçìîæíî íàéòè '$require'. Âîçìîæíî, âàì íåîáõîäèìî ââåñòè ïîëíûé ïóòü ê ýòîìó ôàéëó ñêðèïòà óñòàíîâêè (index.php). Äëÿ ýòîãî ïðîñòî îòêðîéòå ýòîò ôàéë â ëþáîì òåêñòîâîì ðåäàêòîðå è ââåäèòå çíà÷åíèå ïåðåìåííîé \$root (íå çàáóäüòå äîáàâèòü êîíå÷íûé ñëýø '/'). Ïîëüçîâàòåëÿì NT ñèñòåì íåîáõîäèìî èñïîëüçîâàòü äâîéíîé ñëýø.");
|
|
}
|
|
|
|
require_once($require);
|
|
|
|
//-----------------------------------
|
|
// Attempt a DB connection..
|
|
//-----------------------------------
|
|
|
|
require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );
|
|
|
|
$ipsclass->DB = new db_driver();
|
|
|
|
$ipsclass->DB->obj['sql_database'] = $INFO['sql_database'];
|
|
$ipsclass->DB->obj['sql_user'] = $INFO['sql_user'];
|
|
$ipsclass->DB->obj['sql_pass'] = $INFO['sql_pass'];
|
|
$ipsclass->DB->obj['sql_host'] = $INFO['sql_host'];
|
|
$ipsclass->DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
|
|
$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
|
|
$ipsclass->DB->obj['use_shutdown'] = 0;
|
|
|
|
//-----------------------------------
|
|
// Required vars?
|
|
//-----------------------------------
|
|
|
|
if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
|
|
{
|
|
foreach( $ipsclass->DB->connect_vars as $k => $v )
|
|
{
|
|
$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Attempt a connect
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->connect() )
|
|
{
|
|
install_error( "Îøèáêà ñîåäèíåíèÿ:<br /><br />".$ipsclass->DB->error );
|
|
}
|
|
|
|
//--------------------------------
|
|
// Make CONSTANT
|
|
//--------------------------------
|
|
|
|
define( 'SQL_PREFIX', $ipsclass->DB->obj['sql_tbl_prefix'] );
|
|
define( 'SQL_DRIVER', strtolower($INFO['sql_driver']) );
|
|
|
|
//-----------------------------------
|
|
// Get XML
|
|
//-----------------------------------
|
|
|
|
require_once( KERNEL_PATH.'class_xml.php' );
|
|
|
|
$xml = new class_xml();
|
|
$xml->lite_parser = 1;
|
|
|
|
//-------------------------------
|
|
// GET MACROS
|
|
//-------------------------------
|
|
|
|
$xmlfile = THIS_ROOT_PATH.'installfiles/ipb_acpperms.xml';
|
|
|
|
$content = implode( "", file($xmlfile) );
|
|
|
|
//-------------------------------
|
|
// Unpack the datafile (MACRO)
|
|
//-------------------------------
|
|
|
|
$xml->xml_parse_document( $content );
|
|
|
|
//-----------------------------------------
|
|
// Fix up...
|
|
//-----------------------------------------
|
|
|
|
if ( ! is_array( $xml->xml_array['permsexport']['permsgroup']['perm'][0] ) )
|
|
{
|
|
//-----------------------------------------
|
|
// Ensure [0] is populated
|
|
//-----------------------------------------
|
|
|
|
$tmp = $xml->xml_array['permsexport']['permsgroup']['perm'];
|
|
|
|
unset($xml->xml_array['permsexport']['permsgroup']['perm']);
|
|
|
|
$xml->xml_array['permsexport']['permsgroup']['perm'][0] = $tmp;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Loop through and sort out settings...
|
|
//-----------------------------------------
|
|
|
|
foreach( $xml->xml_array['permsexport']['permsgroup']['perm'] as $id => $entry )
|
|
{
|
|
//-----------------------------------------
|
|
// Do we have a row matching this already?
|
|
//-----------------------------------------
|
|
|
|
$_perm_main = $entry['acpperm_main']['VALUE'];
|
|
$_perm_child = $entry['acpperm_child']['VALUE'];
|
|
$_perm_bit = $entry['acpperm_bit']['VALUE'];
|
|
|
|
$_perm_key = $_perm_main.':'.$_perm_child.':'.$_perm_bit;
|
|
|
|
if ( ! $cur_perms[ $_perm_key ] )
|
|
{
|
|
$ipsclass->DB->do_insert( 'admin_permission_keys', array( 'perm_key' => $_perm_key,
|
|
'perm_main' => $_perm_main,
|
|
'perm_child' => $_perm_child,
|
|
'perm_bit' => $_perm_bit ) );
|
|
|
|
$inserted++;
|
|
}
|
|
}
|
|
|
|
//-------------------------------
|
|
// ARE WE DONE? REALLY? COOL!!
|
|
//-------------------------------
|
|
|
|
$ipsclass->template->print_top('Óñïåøíî!');
|
|
|
|
$ipsclass->template->contents .= "
|
|
<meta http-equiv='refresh' content='2; url=index.php?a=3' />
|
|
<div class='centerbox'>
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Óñïåøíî</div>
|
|
<div class='tablepad'>
|
|
<b>Ôàéëû øàáëîíîâ óñòàíîâëåíû!</b>
|
|
<br><br>
|
|
$inserted íàñòðîåê îãðàíè÷åíèÿ äîñòóïà â àäìèíöåíòð âñòàâëåíî.
|
|
<br>
|
|
Íàæìèòå íà ññûëêó íèæå äëÿ ñîçäàíèÿ òðåáóåìûõ äàííûõ äëÿ êåøèðîâàíèÿ
|
|
<br><br>
|
|
<center><b><a href='index.php?a=3'>Íàæìèòå ñþäà äëÿ ïðîäîëæåíèÿ</a></center>
|
|
</div>
|
|
</div>
|
|
</div>";
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
//*-------------------------------------------------------------------------*/
|
|
// Install the template files, woohoo and stuff
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function do_templates()
|
|
{
|
|
global $ipsclass;
|
|
|
|
//-----------------------------------
|
|
// IMPORT $INFO!
|
|
//-----------------------------------
|
|
|
|
$require = ROOT_PATH."conf_global.php";
|
|
|
|
if ( ! file_exists($require) )
|
|
{
|
|
install_error("Íåâîçìîæíî íàéòè '$require'. Âîçìîæíî, âàì íåîáõîäèìî ââåñòè ïîëíûé ïóòü ê ýòîìó ôàéëó ñêðèïòà óñòàíîâêè (index.php). Äëÿ ýòîãî ïðîñòî îòêðîéòå ýòîò ôàéë â ëþáîì òåêñòîâîì ðåäàêòîðå è ââåäèòå çíà÷åíèå ïåðåìåííîé \$root (íå çàáóäüòå äîáàâèòü êîíå÷íûé ñëýø '/'). Ïîëüçîâàòåëÿì NT ñèñòåì íåîáõîäèìî èñïîëüçîâàòü äâîéíîé ñëýø.");
|
|
}
|
|
|
|
require_once($require);
|
|
|
|
//-----------------------------------
|
|
// Attempt a DB connection..
|
|
//-----------------------------------
|
|
|
|
require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );
|
|
|
|
$ipsclass->DB = new db_driver();
|
|
|
|
$ipsclass->DB->obj['sql_database'] = $INFO['sql_database'];
|
|
$ipsclass->DB->obj['sql_user'] = $INFO['sql_user'];
|
|
$ipsclass->DB->obj['sql_pass'] = $INFO['sql_pass'];
|
|
$ipsclass->DB->obj['sql_host'] = $INFO['sql_host'];
|
|
$ipsclass->DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
|
|
$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
|
|
$ipsclass->DB->obj['use_shutdown'] = 0;
|
|
|
|
//-----------------------------------
|
|
// Required vars?
|
|
//-----------------------------------
|
|
|
|
if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
|
|
{
|
|
foreach( $ipsclass->DB->connect_vars as $k => $v )
|
|
{
|
|
$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Attempt a connect
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->connect() )
|
|
{
|
|
install_error( "Îøèáêà ñîåäèíåíèÿ:<br /><br />".$ipsclass->DB->error );
|
|
}
|
|
|
|
//--------------------------------
|
|
// Make CONSTANT
|
|
//--------------------------------
|
|
|
|
define( 'SQL_PREFIX', $ipsclass->DB->obj['sql_tbl_prefix'] );
|
|
define( 'SQL_DRIVER', strtolower($INFO['sql_driver']) );
|
|
|
|
//-----------------------------------
|
|
// Get XML
|
|
//-----------------------------------
|
|
|
|
require_once( KERNEL_PATH.'class_xml.php' );
|
|
|
|
$xml = new class_xml();
|
|
$xml->lite_parser = 1;
|
|
|
|
//-----------------------------------
|
|
// Get XML file (TEMPLATES)
|
|
//-----------------------------------
|
|
|
|
$xmlfile = ROOT_PATH.'ipb_templates.xml';
|
|
|
|
$setting_content = implode( "", file($xmlfile) );
|
|
|
|
//-------------------------------
|
|
// Unpack the datafile (TEMPLATES)
|
|
//-------------------------------
|
|
|
|
$xml->xml_parse_document( $setting_content );
|
|
|
|
//-------------------------------
|
|
// (TEMPLATES)
|
|
//-------------------------------
|
|
|
|
if ( ! is_array( $xml->xml_array['templateexport']['templategroup']['template'] ) )
|
|
{
|
|
install_error("Îøèáêà ñ ipb_templates.xml - íåâîçìîæíî âûïîëíèòü XML");
|
|
}
|
|
|
|
foreach( $xml->xml_array['templateexport']['templategroup']['template'] as $id => $entry )
|
|
{
|
|
$newrow = array();
|
|
|
|
$newrow['group_name'] = $entry[ 'group_name' ]['VALUE'];
|
|
$newrow['section_content'] = $entry[ 'section_content' ]['VALUE'];
|
|
$newrow['func_name'] = $entry[ 'func_name' ]['VALUE'];
|
|
$newrow['func_data'] = $entry[ 'func_data' ]['VALUE'];
|
|
$newrow['set_id'] = 1;
|
|
$newrow['updated'] = time();
|
|
|
|
$ipsclass->DB->do_insert( 'skin_templates', $newrow );
|
|
}
|
|
|
|
//-------------------------------
|
|
// GET MACROS
|
|
//-------------------------------
|
|
|
|
$xmlfile = THIS_ROOT_PATH.'installfiles/ipb_macro.xml';
|
|
|
|
$setting_content = implode( "", file($xmlfile) );
|
|
|
|
//-------------------------------
|
|
// Unpack the datafile (MACRO)
|
|
//-------------------------------
|
|
|
|
$xml->xml_parse_document( $setting_content );
|
|
|
|
//-------------------------------
|
|
// (MACRO)
|
|
//-------------------------------
|
|
|
|
if ( ! is_array( $xml->xml_array['macroexport']['macrogroup']['macro'] ) )
|
|
{
|
|
install_error("Îøèáêà ñ ipb_macro.xml - íåâîçìîæíî âûïîëíèòü XML");
|
|
}
|
|
|
|
foreach( $xml->xml_array['macroexport']['macrogroup']['macro'] as $id => $entry )
|
|
{
|
|
$newrow = array();
|
|
|
|
$newrow['macro_value'] = $entry[ 'macro_value' ]['VALUE'];
|
|
$newrow['macro_replace'] = $entry[ 'macro_replace' ]['VALUE'];
|
|
$newrow['macro_set'] = 1;
|
|
|
|
$ipsclass->DB->do_insert( 'skin_macro', $newrow );
|
|
}
|
|
|
|
//-------------------------------
|
|
// WRAPPER / CSS
|
|
//-------------------------------
|
|
|
|
require_once( THIS_ROOT_PATH.'installfiles/components.php' );
|
|
|
|
$wrapper_record = array( 'set_wrapper' => $WRAPPER,
|
|
'set_css' => $CSS,
|
|
);
|
|
|
|
$ipsclass->DB->do_update( 'skin_sets', $wrapper_record, "set_skin_set_id=1" );
|
|
|
|
//-------------------------------
|
|
// ARE WE DONE? REALLY? COOL!!
|
|
//-------------------------------
|
|
|
|
$ipsclass->template->print_top('Óñïåøíî!');
|
|
|
|
$ipsclass->template->contents .= "
|
|
<meta http-equiv='refresh' content='2; url=index.php?a=acpperms' />
|
|
<div class='centerbox'>
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Óñïåøíî</div>
|
|
<div class='tablepad'>
|
|
<b>Øàáëîíû óñòàíîâëåíû!</b>
|
|
<br><br>
|
|
Ïðîöåññ óñòàíîâêè çàâåðøåí.
|
|
<br>
|
|
Íàæìèòå íà ññûëêó íèæå äëÿ óñòàíîâêè îãðàíè÷åíèé äîñòóïà â àäìèíöåíòð
|
|
<br><br>
|
|
<center><b><a href='index.php?a=acpperms'>Íàæìèòå ñþäà äëÿ ïðîäîëæåíèÿ</a></center>
|
|
</div>
|
|
</div>
|
|
</div>";
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// DO install
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function do_install()
|
|
{
|
|
global $ipsclass;
|
|
|
|
//-----------------------------------
|
|
// INIT
|
|
//-----------------------------------
|
|
|
|
$NEW_INFO = array();
|
|
$need = array('board_url','sql_host','sql_database','sql_user','adminname','adminpassword','adminpassword2','email');
|
|
$setting_groups_by_key = array();
|
|
$setting_groups = array();
|
|
$extra_install = "";
|
|
|
|
//-----------------------------------
|
|
// Check for blanks
|
|
//-----------------------------------
|
|
|
|
foreach($need as $greed)
|
|
{
|
|
if ( ! $ipsclass->input[ $greed ] )
|
|
{
|
|
install_error("Âû îáÿçàíû çàïîëíèòü âñå ïîëÿ ôîðìû, çà èñêëþ÷åíèåì ïðåôèêñà òàáëèö");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Get XML
|
|
//-----------------------------------
|
|
|
|
require_once( KERNEL_PATH.'class_xml.php' );
|
|
|
|
$xml = new class_xml();
|
|
|
|
//-----------------------------------
|
|
// Get XML file
|
|
//-----------------------------------
|
|
|
|
$xmlfile = THIS_ROOT_PATH.'installfiles/ipb_settings.xml';
|
|
|
|
$setting_content = implode( "", file($xmlfile) );
|
|
|
|
//-----------------------------------
|
|
// Fix up URL
|
|
//-----------------------------------
|
|
|
|
$ipsclass->input['board_url'] = preg_replace( "#/$#", "", $ipsclass->input['board_url'] );
|
|
|
|
//-----------------------------------
|
|
// TBL prefix
|
|
//-----------------------------------
|
|
|
|
if ($ipsclass->input['sql_tbl_prefix'] == "")
|
|
{
|
|
$ipsclass->input['sql_tbl_prefix'] = 'ibf_';
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Safe mode
|
|
//-----------------------------------
|
|
|
|
$safe_mode = intval( $ipsclass->input['safe_mode'] );
|
|
|
|
//-----------------------------------
|
|
// Did the admin passy and passy2 match?
|
|
//-----------------------------------
|
|
|
|
if ( $ipsclass->input['adminpassword2'] != $ipsclass->input['adminpassword'] )
|
|
{
|
|
install_error("Ââåäåííûå ïàðîëè íå ñîâïàäàþò");
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Get a correct path
|
|
//-----------------------------------
|
|
|
|
$root = THIS_ROOT_PATH;
|
|
|
|
if ( $root == './')
|
|
{
|
|
$root = str_replace( '\\', '/', getcwd() ) . '/';
|
|
$root = str_replace( 'install/', '', $root );
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Attempt to write the config file.
|
|
//-----------------------------------
|
|
|
|
$INFO = array(
|
|
'sql_driver' => $ipsclass->input['sql_driver'],
|
|
'sql_host' => $ipsclass->input['sql_host'],
|
|
'sql_database' => $ipsclass->input['sql_database'],
|
|
'sql_user' => $_POST['sql_user'],
|
|
'sql_pass' => $_POST['sql_pass'],
|
|
'sql_tbl_prefix' => $ipsclass->input['sql_tbl_prefix'],
|
|
'sql_debug' => 1,
|
|
|
|
'board_start' => time(),
|
|
'installed' => 1,
|
|
|
|
'php_ext' => 'php',
|
|
'safe_mode' => $safe_mode,
|
|
|
|
'board_url' => $ipsclass->input['board_url'],
|
|
|
|
'admin_group' => '4',
|
|
'guest_group' => '2',
|
|
'member_group' => '3',
|
|
'auth_group' => '1',
|
|
);
|
|
|
|
//--------------------------------------------------
|
|
// Update VARS settings
|
|
//--------------------------------------------------
|
|
|
|
$ipsclass->vars =& $INFO;
|
|
|
|
//--------------------------------------------------
|
|
// Any "extra" configs required for this driver?
|
|
//--------------------------------------------------
|
|
|
|
if ( file_exists( THIS_ROOT_PATH.'sql/'.$ipsclass->input['sql_driver'].'_install.php' ) )
|
|
{
|
|
require_once( THIS_ROOT_PATH.'sql/'.$ipsclass->input['sql_driver'].'_install.php' );
|
|
|
|
$extra_install = new install_extra();
|
|
$extra_install->ipsclass =& $ipsclass;
|
|
|
|
$extra_install->install_form_process();
|
|
|
|
if ( count( $extra_install->errors ) )
|
|
{
|
|
install_error( "Ïðè ïðîâåðêå SQL èíôîðìàöèè îáíàðóæåíû ñëåäóþùèå îøèáêè:<br /><br />".implode( "<br />", $extra_install->errors ) );
|
|
}
|
|
|
|
if ( is_array( $extra_install->info_extra ) and count( $extra_install->info_extra ) )
|
|
{
|
|
foreach( $extra_install->info_extra as $k => $v )
|
|
{
|
|
$INFO[ $k ] = $v;
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Attempt a DB connection..
|
|
//-----------------------------------
|
|
|
|
require ( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );
|
|
|
|
$ipsclass->DB = new db_driver();
|
|
|
|
$ipsclass->DB->obj['sql_database'] = $INFO['sql_database'];
|
|
$ipsclass->DB->obj['sql_user'] = $INFO['sql_user'];
|
|
$ipsclass->DB->obj['sql_pass'] = $INFO['sql_pass'];
|
|
$ipsclass->DB->obj['sql_host'] = $INFO['sql_host'];
|
|
$ipsclass->DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
|
|
$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
|
|
$ipsclass->DB->obj['use_shutdown'] = 0;
|
|
$ipsclass->DB->return_die = 1;
|
|
|
|
//-----------------------------------
|
|
// Required vars?
|
|
//-----------------------------------
|
|
|
|
if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
|
|
{
|
|
foreach( $ipsclass->DB->connect_vars as $k => $v )
|
|
{
|
|
$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Attempt a connect
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->connect() )
|
|
{
|
|
install_error( "Connection error:<br /><br />".$ipsclass->DB->error );
|
|
}
|
|
|
|
//--------------------------------
|
|
// Make CONSTANT
|
|
//--------------------------------
|
|
|
|
define( 'SQL_PREFIX', $ipsclass->DB->obj['sql_tbl_prefix'] );
|
|
define( 'SQL_DRIVER', strtolower($INFO['sql_driver']) );
|
|
|
|
$ipsclass->vars['sql_driver'] = SQL_DRIVER;
|
|
|
|
//-----------------------------------
|
|
// Write to disk
|
|
//-----------------------------------
|
|
|
|
$file_string = "<"."?php\n";
|
|
|
|
foreach( $INFO as $k => $v )
|
|
{
|
|
$file_string .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
|
|
}
|
|
|
|
$file_string .= "\n".'?'.'>';
|
|
|
|
if ( $fh = fopen( ROOT_PATH.'conf_global.php', 'w' ) )
|
|
{
|
|
fputs($fh, $file_string, strlen($file_string) );
|
|
fclose($fh);
|
|
}
|
|
else
|
|
{
|
|
install_error("Íåâîçìîæíà çàïèñü â 'conf_global.php'");
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Require insert files
|
|
//-----------------------------------
|
|
|
|
require_once( THIS_ROOT_PATH.'sql/'.$INFO['sql_driver'].'_tables.php' );
|
|
require_once( THIS_ROOT_PATH.'sql/'.$INFO['sql_driver'].'_inserts.php' );
|
|
require_once( THIS_ROOT_PATH.'sql/'.$INFO['sql_driver'].'_fulltext.php' );
|
|
|
|
//-----------------------------------
|
|
// Populate the database...
|
|
//-----------------------------------
|
|
|
|
foreach( $TABLE as $q )
|
|
{
|
|
preg_match("/CREATE TABLE (\S+) \(/", $q, $match);
|
|
|
|
if ($match[1])
|
|
{
|
|
$ipsclass->DB->sql_drop_table( str_replace( 'ibf_', '', $match[1] ) );
|
|
}
|
|
|
|
if ($ipsclass->input['sql_tbl_prefix'] != "ibf_")
|
|
{
|
|
$q = preg_replace("/ibf_(\S+?)([\s\.,]|$)/", $ipsclass->input['sql_tbl_prefix']."\\1\\2", $q);
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Pass to handler
|
|
//-----------------------------------
|
|
|
|
if ( $extra_install AND method_exists( $extra_install, 'process_query_create' ) )
|
|
{
|
|
$q = $extra_install->process_query_create( $q );
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Pass query
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->query($q) )
|
|
{
|
|
install_error($q."<br /><br />".$ipsclass->DB->error);
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Create the fulltext index...
|
|
//-----------------------------------
|
|
|
|
if ( $ipsclass->DB->sql_can_fulltext() )
|
|
{
|
|
foreach( $INDEX as $q )
|
|
{
|
|
if ($ipsclass->input['sql_tbl_prefix'] != "ibf_")
|
|
{
|
|
$q = preg_replace("/ibf_(\S+?)([\s\.,]|$)/", $ipsclass->input['sql_tbl_prefix']."\\1\\2", $q);
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Pass to handler
|
|
//-----------------------------------
|
|
|
|
if ( $extra_install AND method_exists( $extra_install, 'process_query_index' ) )
|
|
{
|
|
$q = $extra_install->process_query_index( $q );
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Pass query
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->query($q) )
|
|
{
|
|
install_error($q."<br /><br />".$ipsclass->DB->error);
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Populate tables...
|
|
//-----------------------------------
|
|
|
|
foreach( $INSERT as $q )
|
|
{
|
|
if ($ipsclass->input['sql_tbl_prefix'] != "ibf_")
|
|
{
|
|
$q = preg_replace("/ibf_(\S+?)([\s\.,]|$)/", $ipsclass->input['sql_tbl_prefix']."\\1\\2", $q);
|
|
}
|
|
|
|
$q = str_replace( "<%time%>", time(), $q );
|
|
|
|
//-----------------------------------
|
|
// Pass to handler
|
|
//-----------------------------------
|
|
|
|
if ( $extra_install AND method_exists( $extra_install, 'process_query_insert' ) )
|
|
{
|
|
$q = $extra_install->process_query_insert( $q );
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Pass query
|
|
//-----------------------------------
|
|
|
|
if ( ! $ipsclass->DB->query($q) )
|
|
{
|
|
install_error($q."<br /><br />".$ipsclass->DB->error);
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// Insert the admin...
|
|
//-----------------------------------
|
|
|
|
$md5_once = trim(md5($ipsclass->input['adminpassword']));
|
|
|
|
$salt = $ipsclass->converge->generate_password_salt(5);
|
|
$key = $ipsclass->converge->generate_auto_log_in_key();
|
|
$rpass = $ipsclass->converge->generate_compiled_passhash($salt, $md5_once);
|
|
$time = time();
|
|
|
|
//-----------------------------------
|
|
// Members...
|
|
//-----------------------------------
|
|
|
|
$member_record = array( 'id' => 1,
|
|
'name' => $ipsclass->input['adminname'],
|
|
'members_display_name' => $ipsclass->input['adminname'],
|
|
'mgroup' => 4,
|
|
'email' => $ipsclass->input['email'],
|
|
'joined' => $time,
|
|
'ip_address' => '127.0.0.1',
|
|
'posts' => 0,
|
|
'title' => 'Àäìèíèñòðàòîð',
|
|
'last_visit' => $time,
|
|
'last_activity' => $time,
|
|
'member_login_key' => $key,
|
|
);
|
|
|
|
$ipsclass->DB->do_insert( 'members', $member_record );
|
|
|
|
//-----------------------------------
|
|
// Converge...
|
|
//-----------------------------------
|
|
|
|
$converge_record = array( 'converge_email' => $ipsclass->input['email'],
|
|
'converge_joined' => $time,
|
|
'converge_pass_hash' => $rpass,
|
|
'converge_pass_salt' => $salt,
|
|
);
|
|
|
|
$ipsclass->DB->do_insert( 'members_converge', $converge_record );
|
|
|
|
//-----------------------------------
|
|
// Member Extra...
|
|
//-----------------------------------
|
|
|
|
$member_extra_record = array ( 'id' => 1,
|
|
'signature' => '',
|
|
'vdirs' => '',
|
|
);
|
|
|
|
$ipsclass->DB->do_insert( 'member_extra', $member_extra_record );
|
|
|
|
//-------------------------------
|
|
// Do we have a reg / copy key?
|
|
//-------------------------------
|
|
|
|
if ( file_exists( ROOT_PATH . '/retail/regkey.php' ) )
|
|
{
|
|
require_once( ROOT_PATH . '/retail/regkey.php' );
|
|
|
|
$customer_reg_key = '';
|
|
|
|
}
|
|
|
|
//-------------------------------
|
|
// Unpack the datafile
|
|
//-------------------------------
|
|
|
|
$xml->xml_parse_document( $setting_content );
|
|
|
|
//-------------------------------
|
|
// Known settings
|
|
//-------------------------------
|
|
|
|
if( substr( $ipsclass->input['board_url'], -1 ) == '/' )
|
|
{
|
|
$ipsclass->input['board_url'] = substr( $ipsclass->input['board_url'], 0, -1 );
|
|
}
|
|
|
|
$known = array( 'email_in' => $ipsclass->input['email'],
|
|
'email_out' => $ipsclass->input['email'],
|
|
'base_dir' => $root,
|
|
'upload_dir' => str_replace( "//", "/", $root."/uploads" ),
|
|
'upload_url' => $ipsclass->input['board_url']."/uploads",
|
|
'ipb_copy_number'=> $customer_copy_key,
|
|
'ipb_reg_number' => $customer_reg_key,
|
|
);
|
|
|
|
|
|
if ( ! is_array( $xml->xml_array['settingexport']['settinggroup']['setting'] ) )
|
|
{
|
|
install_error("Îøèáêà ñ ipb_settings.xml - íåâîçìîæíî âûïîëíèòü XML ôàéë");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// 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' , 'conf_title_keyword' );
|
|
|
|
$setting_fields = array( 'conf_title_keyword', 'conf_title_title', 'conf_title_desc', 'conf_title_noshow' );
|
|
|
|
//-----------------------------------------
|
|
// Fix up...
|
|
//-----------------------------------------
|
|
|
|
if ( ! is_array( $xml->xml_array['settingexport']['settinggroup']['setting'][0] ) )
|
|
{
|
|
//-----------------------------------------
|
|
// Ensure [0] is populated
|
|
//-----------------------------------------
|
|
|
|
$tmp = $xml->xml_array['settingexport']['settinggroup']['setting'];
|
|
|
|
unset($xml->xml_array['settingexport']['settinggroup']['setting']);
|
|
|
|
$xml->xml_array['settingexport']['settinggroup']['setting'][0] = $tmp;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Loop through and sort out settings...
|
|
//-----------------------------------------
|
|
|
|
foreach( $xml->xml_array['settingexport']['settinggroup']['setting'] as $id => $entry )
|
|
{
|
|
$newrow = array();
|
|
|
|
//-----------------------------------------
|
|
// Is setting?
|
|
//-----------------------------------------
|
|
|
|
if ( ! $entry['conf_is_title']['VALUE'] )
|
|
{
|
|
foreach( $fields as $f )
|
|
{
|
|
$newrow[$f] = $entry[ $f ]['VALUE'];
|
|
}
|
|
|
|
$new_settings[] = $newrow;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Is title?
|
|
//-----------------------------------------
|
|
|
|
else
|
|
{
|
|
foreach( $setting_fields as $f )
|
|
{
|
|
$newrow[$f] = $entry[ $f ]['VALUE'];
|
|
}
|
|
|
|
$new_titles[] = $newrow;
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Sort out titles...
|
|
//-----------------------------------------
|
|
|
|
if ( is_array( $new_titles ) and count( $new_titles ) )
|
|
{
|
|
foreach( $new_titles as $idx => $data )
|
|
{
|
|
if ( $data['conf_title_title'] AND $data['conf_title_keyword'] )
|
|
{
|
|
//-----------------------------------------
|
|
// Get ID based on key
|
|
//-----------------------------------------
|
|
|
|
$save = array( 'conf_title_title' => $data['conf_title_title'],
|
|
'conf_title_desc' => $data['conf_title_desc'],
|
|
'conf_title_keyword' => $data['conf_title_keyword'],
|
|
'conf_title_noshow' => $data['conf_title_noshow'] );
|
|
|
|
//-----------------------------------------
|
|
// Insert first
|
|
//-----------------------------------------
|
|
|
|
$ipsclass->DB->do_insert( 'conf_settings_titles', $save );
|
|
|
|
$conf_id = $ipsclass->DB->get_insert_id();
|
|
$save['conf_title_id'] = $conf_id;
|
|
|
|
//-----------------------------------------
|
|
// Update settings cache
|
|
//-----------------------------------------
|
|
|
|
$setting_groups_by_key[ $save['conf_title_keyword'] ] = $save;
|
|
$setting_groups[ $save['conf_title_id'] ] = $save;
|
|
|
|
$need_update[] = $conf_id;
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Sort out settings
|
|
//-----------------------------------------
|
|
|
|
if ( is_array( $new_settings ) and count( $new_settings ) )
|
|
{
|
|
foreach( $new_settings as $idx => $data )
|
|
{
|
|
//-----------------------------------------
|
|
// Make PHP slashes safe
|
|
//-----------------------------------------
|
|
|
|
//$data['conf_evalphp'] = str_replace( '\\', '\\\\', $data['conf_evalphp'] );
|
|
|
|
//-----------------------------------------
|
|
// Insert known
|
|
//-----------------------------------------
|
|
|
|
if ( in_array( $data['conf_key'], array_keys( $known ) ) )
|
|
{
|
|
$data['conf_value'] = $known[ $data['conf_key'] ];
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Now assign to the correct ID based on
|
|
// our title keyword...
|
|
//-----------------------------------------
|
|
|
|
$data['conf_group'] = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id'];
|
|
|
|
//-----------------------------------------
|
|
// Remove from array
|
|
//-----------------------------------------
|
|
|
|
unset( $data['conf_title_keyword'] );
|
|
|
|
$ipsclass->DB->do_insert( 'conf_settings', $data );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Update group counts...
|
|
//-----------------------------------------
|
|
|
|
if ( count( $need_update ) )
|
|
{
|
|
foreach( $need_update as $i => $idx )
|
|
{
|
|
$conf = $ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'conf_settings', 'where' => 'conf_group='.$idx ) );
|
|
|
|
$count = intval($conf['count']);
|
|
|
|
$ipsclass->DB->do_update( 'conf_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------
|
|
// ARE WE DONE? REALLY? COOL!!
|
|
//-----------------------------------
|
|
|
|
$ipsclass->template->print_top('Óñïåøíî!');
|
|
|
|
$ipsclass->template->contents .= "<meta http-equiv='refresh' content='2; url=index.php?a=templates' />
|
|
<div class='centerbox'>
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Óñïåøíî</div>
|
|
<div class='tablepad'>
|
|
<b>Âàø ôîðóì óñïåøíî óñòàíîâëåí!</b>
|
|
<br><br>
|
|
Ïðîöåññ óñòàíîâêè ïî÷òè çàâåðøåí.
|
|
<br>
|
|
Ñëåäóþùèé ýòàï çàïèøåò øàáëîíû â áàçó äàííûõ...
|
|
<br><br>
|
|
<center><b><a href='index.php?a=templates'>Íàæìèòå ñþäà, åñëè âàñ íå ïåðåìåñòèëî àâòîìàòè÷åñêè...</a></center>
|
|
</div>
|
|
</div>
|
|
</div>";
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// SET UP FORM
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function do_setup_form()
|
|
{
|
|
global $ipsclass;
|
|
|
|
//--------------------------------------------------
|
|
// INIT
|
|
//--------------------------------------------------
|
|
|
|
$drivers = array();
|
|
$ipsclass->template->print_top('Óñòàíîâêà');
|
|
|
|
//--------------------------------------------------
|
|
// Make sure kernel folder is present
|
|
//--------------------------------------------------
|
|
|
|
if ( ! is_dir(ROOT_PATH.'ips_kernel') )
|
|
{
|
|
install_error("Íåâîçìîæíî íàéòè ïàïêó 'ips_kernel'. Ïîæàëóéñòà, çàãðóçèòå âñå íåîáõîäèìûå ïàïêè è ôàéëû.");
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// DO WE HAVE A DB DRIVER SET?
|
|
//--------------------------------------------------
|
|
|
|
$ipsclass->input['sql_driver'] = ( $ipsclass->input['sql_driver'] == "" ) ? $_REQUEST['sql_driver'] : $ipsclass->input['sql_driver'];
|
|
|
|
if ( ! $ipsclass->input['sql_driver'] )
|
|
{
|
|
//----------------------------------------------
|
|
// Test to see how many DB driver's we've got..
|
|
//----------------------------------------------
|
|
|
|
$dh = opendir( ROOT_PATH.'ips_kernel' ) or install_error("Íåâîçìîæíî íàéòè ïàïêó 'ips_kernel' äëÿ ÷òåíèÿ, ïîæàëóéñòà, ïðîâåðüòå âñå ïóòè è ïðàâà");
|
|
|
|
while ( $file = @readdir( $dh ) )
|
|
{
|
|
if ( preg_match( "/^class_db_([a-zA-Z0-9]*)\.php/i", $file, $driver ) )
|
|
{
|
|
$drivers[] = $driver[1];
|
|
}
|
|
}
|
|
|
|
@closedir( $dh );
|
|
|
|
//----------------------------------------------
|
|
// Got more than one?
|
|
//----------------------------------------------
|
|
|
|
if ( count($drivers) > 1 )
|
|
{
|
|
//------------------------------------------
|
|
// Show choice screen first...
|
|
//------------------------------------------
|
|
|
|
$ipsclass->template->contents .= "<form action='index.php' method='POST'>
|
|
<input type='hidden' name='a' value='1'>
|
|
<div class='centerbox'>
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Îáíàðóæåíî íåñêîëüêî SQL äðàéâåðîâ</div>
|
|
<div class='pformstrip'>Ïîæàëóéñòà, âûáåðèòå æåëàåìûé SQL äðàéâåð äëÿ èñïîëüçîâàíèÿ â âàøåì Invision Power Board</div>
|
|
<table width='100%' cellspacing='1'>
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL Äðàéâåð</b><div class='description'>(Âûáåðèòå äðàéâåð)</div></td>
|
|
<td class='pformright'><select name='sql_driver' id='textinput'>\n";
|
|
|
|
foreach ($drivers as $k => $v)
|
|
{
|
|
$selected = ($v == "mysql") ? " selected='selected'" : "";
|
|
$ipsclass->template->contents .= "<option value='".$v."'".$selected.">".strtoupper($v)."</option>\n";
|
|
}
|
|
|
|
$ipsclass->template->contents .= "</select>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div align='center' class='pformstrip' style='text-align:center'><input type='image' src='img/install_proceed.gif'></div>
|
|
</div>
|
|
</div>
|
|
</form>";
|
|
|
|
$ipsclass->template->output();
|
|
|
|
exit();
|
|
|
|
}
|
|
else
|
|
{
|
|
//------------------------------------------
|
|
// Use only driver installed
|
|
//------------------------------------------
|
|
|
|
$ipsclass->input['sql_driver'] = $drivers[0];
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// If we're here, we have chosen a driver, so.......
|
|
//--------------------------------------------------
|
|
|
|
$this_url = str_replace( "/install/index.php", "", $_SERVER['HTTP_REFERER']);
|
|
$this_url = str_replace( "/install/" , "", $this_url);
|
|
$this_url = str_replace( "/install" , "", $this_url);
|
|
$this_url = str_replace( "index.php" , "", $this_url);
|
|
|
|
//--------------------------------------------------
|
|
// Test
|
|
//--------------------------------------------------
|
|
|
|
if ( ! $this_url )
|
|
{
|
|
$this_url = substr($_SERVER['SCRIPT_NAME'],0, -17);
|
|
|
|
if ($this_url == '')
|
|
{
|
|
$this_url == '/';
|
|
}
|
|
|
|
$this_url = 'http://'.$_SERVER['SERVER_NAME'].$this_url;
|
|
}
|
|
|
|
$this_url = preg_replace( "#/$#", "", str_replace( '?a=1', "", $this_url ) );
|
|
|
|
//--------------------------------------------------
|
|
// Safe mode?
|
|
//--------------------------------------------------
|
|
|
|
$safe_mode = 0;
|
|
|
|
if ( get_cfg_var('safe_mode') )
|
|
{
|
|
$safe_mode = get_cfg_var('safe_mode');
|
|
}
|
|
|
|
$ipsclass->template->contents .= "
|
|
<form action='index.php' method='POST'>
|
|
<input type='hidden' name='a' value='2'>
|
|
<input type='hidden' name='sql_driver' value='{$ipsclass->input['sql_driver']}'>
|
|
<div class='centerbox'>
|
|
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Äàííûå âàøåãî ñåðâåðà</div>
|
|
<div class='pformstrip'>Ýòà ñåêöèÿ òðåáóåò ââîäà âàìè âàøèõ ïóòåé è URL'îâ âàøåãî ôîðóìà.</div>
|
|
<table width='100%' cellspacing='1'>
|
|
<tr>
|
|
<td class='pformleftw'><b>IPB 'index.php' URL</b><div class='description'>Ýòî URL (îáÿçàí íà÷èíàòüñÿ ñ http://) âàøåé îñíîâíîé ïàïêè ôîðóìà<br />Ýòî ìîæåò áûòü, íàïðèìåð: <b>http://www.domain.ru/forums</b></div></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='board_url' value='$this_url'></td>
|
|
</tr>";
|
|
|
|
if ( $safe_mode )
|
|
{
|
|
$ipsclass->template->contents .= "
|
|
<tr>
|
|
<td class='pformleftw'><b>Îáíàðóæåí PHP Safe Mode/b><div class='description'>Ñèñòåìà óñòàíîâêà îáíàðóæèëà, ÷òî PHP íà âàøåì ñåðâåðå çàïóùåí â safe mode. Åñëè ýòî íåâåðíî, ïîïðàâüòå...</div></td>
|
|
<td class='pformright'><select id='textinput' name='safe_mode'><option value='1' selected='selected'>Safe Mode âêëþ÷åí</option><option value='0'>Safe Mode ÍÅ âêëþ÷åí</option></select></td>
|
|
</tr>";
|
|
}
|
|
|
|
$ipsclass->template->contents .= "
|
|
</table>
|
|
</div>
|
|
<div class='fade'> </div>
|
|
|
|
<br />
|
|
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Âàøè SQL äàííûå</div>
|
|
<div class='pformstrip'>Ýòîò áëîê òðåáóåò îò âàñ ââîäà SQL èíôîðìàöèè. Åñëè âû åå íå çíàåòå, îáðàòèòåñü ê ñâîåìó õîñòèíã-ïðîâàéäåðó. Ïîìíèòå, âû äîëæíû óêàçàòü â ôîðìå íèæå ñóùåñòâóþùóþ áàçó äàííûõ, åñëè íåò - âû äîëæíû ñîçäàòü íîâóþ áàçó äàííûõ íà ñåðâåðå ïðåæäå, ÷åì ïðîäîëæèòü óñòàíîâêó.</div>
|
|
<table width='100%' cellspacing='1'>
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL äðàéâåð</b></td>
|
|
<td class='pformright'>Âû âûáðàëè è áóäåòå èñïîëüçîâàòü <b>".strtoupper($ipsclass->input['sql_driver'])."</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL õîñò</b><div class='description'>(îáû÷íî ýòî localhost)</div></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='sql_host' value='localhost'></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL èìÿ áàçû äàííûõ</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='sql_database' value='{$ipsclass->vars['sql_database']}'></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL èìÿ ïîëüçîâàòåëÿ</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='sql_user' value='{$ipsclass->vars['sql_user']}'></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL ïàðîëü</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='sql_pass' value=''></td>
|
|
</tr>
|
|
<!--{EXTRA.SQL}-->
|
|
<tr>
|
|
<td class='pformleftw'><b>SQL ïðåôèêñ òàáëèö</b><div class='description'>(Âû ìîæåòå îñòàâèòü ïîëå ïóñòûì, òîãäà IPB áóäåò èñïîëüçîâàòü ïðåôèêñ ïî óìîë÷àíèþ - 'ibf_')</div></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='sql_tbl_prefix' value=''></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class='fade'> </div>
|
|
|
|
<br />
|
|
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Âàøà ó÷åòíàÿ çàïèñü àäìèíèñòðàòîðà</div>
|
|
<div class='pformstrip'>Ýòîò áëîê òðåáóåò èíôîðìàöèþ äëÿ ñîçäàíèÿ âàøåé ó÷åòíîé çàïèñè àäìèíèñòðàòîðà áóäóùåãî ôîðóìà! Ïîæàëóéñòà, ââåäèòå äîñòîâåðíóþ èíôîðìàöèþ è ïåðåïðîâåðüòå åå! Äëÿ áîëüøåé áåçîïàñíîñòè â êà÷åñòâå ïàðîëÿ àäìèíèñòðàòîðà èñïîëüçóéòå êîìáèíàöèþ ñëó÷àéíûõ ÷èñåë è áóêâ (ñòðî÷íûõ è ïðîïèñíûõ)!</div>
|
|
<table width='100%' cellspacing='1'>
|
|
<tr>
|
|
<td class='pformleftw'><b>Èìÿ ïîëüçîâàòåëÿ</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='adminname' value=''></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='pformleftw'><b>Ïàðîëü</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='adminpassword' value=''></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='pformleftw'><b>Ïîäòâåðäèòå ïàðîëü</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='adminpassword2' value=''></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='pformleftw'><b>E-mail</b></td>
|
|
<td class='pformright'><input type='text' id='textinput' name='email' value=''></td>
|
|
</tr>
|
|
</table>
|
|
<div align='center' class='pformstrip' style='text-align:center'><input type='image' src='img/install_proceed.gif'></div>
|
|
</div>
|
|
<div class='fade'> </div>
|
|
</div>
|
|
</form>";
|
|
|
|
//--------------------------------------------------
|
|
// Any "extra" configs required for this driver?
|
|
//--------------------------------------------------
|
|
|
|
if ( file_exists( THIS_ROOT_PATH.'sql/'.$ipsclass->input['sql_driver'].'_install.php' ) )
|
|
{
|
|
require_once( THIS_ROOT_PATH.'sql/'.$ipsclass->input['sql_driver'].'_install.php' );
|
|
$extra_install = new install_extra();
|
|
|
|
$ipsclass->template->contents = str_replace( '<!--{EXTRA.SQL}-->', $extra_install->install_form_extra(), $ipsclass->template->contents );
|
|
}
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// DO INTRO
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function do_intro()
|
|
{
|
|
global $ipsclass;
|
|
|
|
$ipsclass->template->print_top('E-mail');
|
|
|
|
$ipsclass->template->contents .= "<table width='80%' border='0' cellpadding='0' cellspacing='0' align='center'>
|
|
<tr>
|
|
<td valign='top'><img src='img/install_face.jpg' border='0' alt='Ëèöî :)'></td>
|
|
<td><img src='img/install_text.gif' border='0' alt='Äîáðî ïîæàëîâàòü â IPB'>
|
|
<br /><br />
|
|
Ïðåæäå ÷åì ìû íà÷íåì óñòàíîâêó ôîðóìà, ïîæàëóéñòà, ïðîâåðüòå, âñå ëè ôàéëû çàãðóæåíû íà ñåðâåð, âîçìîæíà
|
|
ëè çàïèñü â ôàéë 'conf_global.php' (ïðàâà CHMOD íà ôàéë äîëæíû áûòü 0666).
|
|
<br /><br />
|
|
<b>IPB ".IPBVERSION." òðåáóåò PHP 4.3.0 èëè âûøå è SQL áàçó äàííûõ.</b>
|
|
<br /><br />
|
|
Âû òàêæå íóæäàåòåñü â ñëåäóþùåé èíôîðìàöèè, êîòîðóþ âàì äîëæåí ïðîäîñòàâèòü âàø õîñòèíã-ïðîâàéäåð:
|
|
<ul>
|
|
<li>Èìÿ âàøåé SQL áàçû äàííûõ</li>
|
|
<li>Âàøå SQL èìÿ ïîëüçîâàòåëÿ</li>
|
|
<li>Âàø SQL ïàðîëü</li>
|
|
<li>Âàø SQL õîñò (îáû÷íî — localhost)</li>
|
|
</ul>
|
|
<br />
|
|
Êîãäà âû íàæìåòå íà êíîïêó «Äàëåå», âàì áóäåò äàíà ôîðìà äëÿ ââîäà âñåé íåîáõîäèìîé äëÿ óñòàíîâêè ôîðóìà èíôîðìàöèè.
|
|
<br><br>
|
|
<b>ÏÎÆÀËÓÉÑÒÀ, ÏÎÌÍÈÒÅ:</b> ÈÑÏÎËÜÇÓß ÝÒÎÒ ÑÊÐÈÏÒ ÓÑÒÀÍÎÂÊÈ, ÂÛ ÓÄÀËÈÒÅ ËÞÁÓÞ ÒÅÊÓÙÓÞ, ÈÌÅÞÙÓÞÑß ÁÀÇÓ ÄÀÍÍÛÕ ÔÎÐÓÌÀ INVISION POWER BOARD, ÅÑËÈ ÈÑÏÎËÜÇÓÅÒÅ ÒÀÊÎÉ ÆÅ ÏÐÅÔÈÊÑ ÒÀÁËÈÖ.
|
|
";
|
|
|
|
|
|
//---------------------------------------
|
|
// Check to make sure that the config file
|
|
// is there and it's got suitable permissions to write to:
|
|
//---------------------------------------
|
|
|
|
$file = ROOT_PATH."conf_global.php";
|
|
$templates = THIS_ROOT_PATH."installfiles/ipb_templates.xml";
|
|
$warnings = array();
|
|
$checkfiles = array( ROOT_PATH ."ipb_templates.xml",
|
|
THIS_ROOT_PATH."installfiles/components.php",
|
|
THIS_ROOT_PATH."installfiles/ipb_macro.xml",
|
|
THIS_ROOT_PATH."installfiles/ipb_settings.xml",
|
|
THIS_ROOT_PATH."sql",
|
|
KERNEL_PATH ."class_converge.php",
|
|
KERNEL_PATH ."class_xml.php",
|
|
ROOT_PATH ."conf_global.php" );
|
|
|
|
$writeable = array( ROOT_PATH."conf_global.php",
|
|
ROOT_PATH."cache",
|
|
ROOT_PATH."cache/lang_cache/",
|
|
ROOT_PATH."cache/skin_cache/" );
|
|
|
|
foreach ( $checkfiles as $cf )
|
|
{
|
|
if ( ! file_exists($cf) )
|
|
{
|
|
$warnings[] = "Íåâîçìîæíî íàéòè ôàéë '$cf'.";
|
|
}
|
|
}
|
|
|
|
foreach ( $writeable as $cf )
|
|
{
|
|
if ( ! is_writeable($cf) )
|
|
{
|
|
$warnings[] = "Íåâîçìîæíî ïðîèçâåñòè çàïèñü â ôàéë '$cf'. Ïîæàëóéñòà, óñòàíîâèòå ïðàâà äîñòóïà ê ôàéëó (CHMOD) - 0777.";
|
|
}
|
|
}
|
|
|
|
$phpversion = phpversion();
|
|
|
|
//----------------------------------
|
|
// CHECK BASICS
|
|
//----------------------------------
|
|
|
|
if ($phpversion < '4.1.0')
|
|
{
|
|
$warnings[] = "<b>Âû íå ñìîæåòå óñòàíîâèòü Invision Power Board. IPB òðåáóåò PHP âåðñèè 4.1.0 èëè âûøå.</b>";
|
|
}
|
|
|
|
if ( ! function_exists('get_cfg_var') )
|
|
{
|
|
$warnings[] = "<b>Âû íå ñìîæåòå óñòàíîâèòü Invision Power Board. Âàøà ïîñòàâêà PHP íå äîñòàòî÷íà, ÷òîáû çàïóñòèòü IPB.</b>";
|
|
}
|
|
|
|
if ( ! function_exists('xml_parse_into_struct') )
|
|
{
|
|
$warnings[] = "<b>Âû íå ñìîæåòå óñòàíîâèòü Invision Power Board. IPB òðåáóåò, ÷òîáû XML-ôóíêöèè â PHP áûëè âêëþ÷åíû. Ïîæàëóéñòà, ïîïðîñèòå âàøåãî õîñòèíã-ïðîâàéäåðà âêëþ÷èòü ïîääåðæêó XML.</b>";
|
|
}
|
|
//----------------------------------
|
|
// Got error?
|
|
//----------------------------------
|
|
|
|
if ( count($warnings) > 0 )
|
|
{
|
|
|
|
$err_string = '·'.implode( "<br /><br />·", $warnings );
|
|
|
|
$ipsclass->template->contents .= "<br /><br />
|
|
<div class='warnbox'>
|
|
<strong>Âíèìàíèå!</strong>
|
|
<b>Óêàçàííûå íèæå îøèáêè äîëæíû áûòü îáÿçàòåëüíî èñïðàâëåíû ïåðåä òåì, êàê ïðîäîëæèòü!</b>
|
|
<br><br>
|
|
$err_string
|
|
</div>";
|
|
}
|
|
else
|
|
{
|
|
$ipsclass->template->contents .= "<br /><br /><div align='center'><a href='index.php?a=1'><img src='img/install_proceed.gif' border='0' alt='Äàëåå'></a></div>";
|
|
}
|
|
|
|
$ipsclass->template->contents .= " </td>
|
|
</tr>
|
|
</table>";
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Install Error
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function install_error($msg="")
|
|
{
|
|
global $ipsclass;
|
|
|
|
$ipsclass->template->print_top('Âíèìàíèå!');
|
|
|
|
|
|
|
|
$ipsclass->template->contents .= "<div class='warnbox'>
|
|
<strong style='font-size:16px;color:#F00'>Âíèìàíèå!</strong>
|
|
<br /><br />
|
|
<b>Óêàçàííûå íèæå îøèáêè äîëæíû áûòü îáÿçàòåëüíî èñïðàâëåíû ïåðåä òåì, êàê ïðîäîëæèòü!</b><br>Ïîæàëóéñòà, âåðíèòåñü íàçàä è ïîïðîáóéòå ñíîâà!
|
|
<br><br>
|
|
$msg
|
|
</div>";
|
|
|
|
|
|
|
|
$ipsclass->template->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// CLASS TEMPLATE
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
class template
|
|
{
|
|
var $contents = "";
|
|
|
|
function output()
|
|
{
|
|
$year = date('Y');
|
|
|
|
echo $this->contents;
|
|
echo "
|
|
|
|
<br><br><br><br><center><span id='copy'><b><a href='http://www.bestwarez.ru' target='_blank'>Ðóññêàÿ âåðñèÿ</a> <a href='http://www.invisionboard.com' target='_blank'>Invision Power Board</a> © $year <a href='http://www.invisionpower.com' target='_blank'>Invision Power Services, Inc.</a></b></span></center><br>
|
|
|
|
</body>
|
|
</html>";
|
|
exit();
|
|
}
|
|
|
|
//--------------------------------------
|
|
|
|
function print_top($title="")
|
|
{
|
|
|
|
$this->contents = "<html>
|
|
<head>
|
|
<meta http-equiv=\"content-type\" content=\"text/html; charset=windows-1251\" >
|
|
<title>Óñòàíîâêà Invision Power Board :: $title </title>
|
|
<style type='text/css'>
|
|
|
|
BODY
|
|
{
|
|
font-size: 11px;
|
|
font-family: Verdana, Arial;
|
|
color: #000;
|
|
margin: 0px;
|
|
padding: 0px;
|
|
background-image: url(img/fadebg.jpg);
|
|
background-repeat: no-repeat;
|
|
background-position: right bottom;
|
|
}
|
|
|
|
TABLE, TR, TD { font-family:Verdana, Arial;font-size: 11px; color:#000 }
|
|
|
|
a:link, a:visited, a:active { color:#000055 }
|
|
a:hover { color:#333377;text-decoration:underline }
|
|
|
|
.centerbox { margin-right:10%;margin-left:10%;text-align:left }
|
|
|
|
.warnbox {
|
|
border:1px solid #F00;
|
|
background: #FFE0E0;
|
|
padding:6px;
|
|
margin-right:10%;margin-left:10%;text-align:left;
|
|
}
|
|
|
|
.tablepad { background-color:#F5F9FD;padding:6px }
|
|
.description { color:gray;font-size:10px }
|
|
.pformstrip { background-color: #D1DCEB; color:#3A4F6C;font-weight:bold;padding:7px;margin-top:1px;text-align:left }
|
|
.pformleftw { background-color: #F5F9FD; padding:6px; margin-top:1px;width:50%; border-top:1px solid #C2CFDF; border-right:1px solid #C2CFDF; }
|
|
.pformright { background-color: #F5F9FD; padding:6px; margin-top:1px;border-top:1px solid #C2CFDF; }
|
|
|
|
.tableborder { border:1px solid #345487;background-color:#FFF; padding:0px; margin:0px; width:100% }
|
|
|
|
.maintitle { text-align:left;vertical-align:middle;font-weight:bold; color:#FFF; letter-spacing:1px; padding:8px 0px 8px 5px; background-image: url(img/tile_back.gif) }
|
|
.maintitle a:link, .maintitle a:visited, .maintitle a:active { text-decoration: none; color: #FFF }
|
|
.maintitle a:hover { text-decoration: underline }
|
|
|
|
#copy { font-size:10px }
|
|
|
|
#button { background-color: #4C77B6; color: #FFFFFF; font-family:Verdana, Arial; font-size:11px }
|
|
|
|
#textinput { background-color: #EEEEEE; color:Ê#000000; font-family:Verdana, Arial; font-size:11px; width:100% }
|
|
|
|
#dropdown { background-color: #EEEEEE; color:Ê#000000; font-family:Verdana, Arial; font-size:10px }
|
|
|
|
#multitext { background-color: #EEEEEE; color:Ê#000000; font-family:Courier, Verdana, Arial; font-size:10px }
|
|
|
|
#logostrip {
|
|
padding: 0px;
|
|
margin: 0px;
|
|
background: #7AA3D0;
|
|
}
|
|
|
|
.fade
|
|
{
|
|
background-image: url(img/fade.jpg);
|
|
background-repeat: repeat-x;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body marginheight='0' marginwidth='0' leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>
|
|
|
|
<div id='logostrip'><img src='img/title.gif' border='0' alt='Èíñòàëëÿòîð Invision Power Board' /></div>
|
|
<div class='fade'> </div>
|
|
<br />
|
|
";
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
?>
|