<?php
/*
 BMForum Datium! Bulletin Board Systems
 Version : Datium!
 
 Function : Installing & Repair
 
 This is a freeware, but don't change the copyright information.
 A SourceForge Project - GNU Licence project.
 Web Site: http://www.bmforum.com
 Copyright (C) Bluview Technology
*/
@define("INSTALLER", 1);
@ini_set('display_error', 1);
@define("INBMFORUM", 1);
require_once("include/version.php");
include_once("install/func.inc.php");
if ($language) {
	include_once("install/languages/". $language .".php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $read_alignment;?>" lang="<?php echo $html_lang;?>">
<head>
<link rel="stylesheet" type="text/css" media="screen" href="images/bsd07/styles.css" />
<title>BMForum Setup - powered by BMForum.com</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="BMForum Installer" />
<meta name="keywords" content="php,bmb,bmf,蓝色,魔法,论坛,bbs,bmforum,text,蓝魔,免费" />
</head>

<body>
<div id="totallayer" style="position:relative; left:1.3%; top:0px; width:95%; height:auto; z-index:1; border: none; " class="bmforum_background">

<table class="tableborder" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td>		
	<table class="bmbnewstyle_withoutwidth" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
		<tr>
			<td>
			<table cellspacing="0" cellpadding="5" width="100%" border="0">
				<tr>
					<td class="bmforum_base_menu">
					<table cellspacing="0" cellpadding="0" width="100%">
						<tr>
							<td align="left">
							<span class="titlefontcolor">
							BMForum Setup - <?php echo $verandproname; ?></span></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
</td></tr></table>
    <style type="text/css">
    .t {font-family: Verdana, Arial, Sans-serif;font-size  : 12px;padding-left: 10px;font-weight: normal;line-height: 150%;color : #29338A;}
    .e {font-family: Arial, Sans-serif;font-size  : 12px;font-weight: normal;line-height: 200%;color : #0000EE;}
    .w {font-family: Arial, Sans-serif;font-size  : 12px;font-weight: normal;line-height: 200%;color : #EE0000;}
    .h {font-family: Arial, Sans-serif;padding-top: 5px;padding-left: 10px;font-size  : 16px;font-weight: bold;color : #29338A;}
    .i {font-family: Arial, Sans-serif;padding-top: 5px;padding-left: 10px;font-size  : 12px;font-weight: bold;color : #29338A;}
    </style>
<form action="install.php?tables=<?php echo $setdatabase[a8];?>" method="post" style="margin:0px;">
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
<span class="categoryfontcolor_font"><a name="top"></a>BMForum Forum System</span>
</td></tr>
<tr>
<td class="forumcoloronecolor" style="text-align:left;">

<?php
if (!$language) {
	$selectbox = refresh_language();
	echo $selectbox;
    $step = 999;
} else {
	// international version
	if ($international) writetofile("datafile/language.php", "<?php \$language='$forum_pack_name'; \$count_language=	'3';");
	
    if (!(copy("install/usertitle/usertitle.". $language .".php", "datafile/usertitle.php"))) {
    	echo "<font color='red' size='4'>$li[74] datafile/usertitle.php</font>";
    	exit;
    }
	
?>
			<?php echo $li[2]?>
			<br /><b><?php echo $li[3]?></b>
			<br />
			<span class='e'><?php echo $li[4]?></span>
			<br />
			<span class='w'><?php echo $li[5]?></span>
<?php
}
?>
		</td>
		</tr>
<?php
if (!$step) {
    $check = 1;
    $current_time = date("F j, Y, g:i:s a");
    $current_gmt_time = gmdate("F j, Y, g:i:s a");
    $phpver = PHP_VERSION;
    if ($phpver < "4.1.0") {
        $warningver = "<font class=w>$li[6]</font><br />";
    } 
    $phpos = PHP_OS;
    if (@isset($_COOKIE)) $testcookie = "<font color=#29338A>$li[7]</font>";
    else $testcookie = "<font class=w>$li[8]</font>";
    if (@isset($_GET)) $testget = "<font color=#29338A>$li[7]</font>";
    else $testget = "<font class=w>$li[8]</font>";
    if (@get_cfg_var("file_uploads")) $testupload = "<font color=#29338A>$li[7]</font> ($li[10] " . @get_cfg_var("upload_max_filesize") . ")";
    else $testupload = "<font color=990000>$li[9]</font>";
echo<<<EOT
</td></tr>
</table>
</td></tr></table>
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
<span class="categoryfontcolor_font">$li[11]<input type=hidden value=2 name=step><input type=hidden value='$language' name=language></span>
</td></tr>

  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>
$li[12] <font color=#29338A>$phpver</font>
<br />$li[13] <font color=#29338A>$phpos</font>
<br />$li[14] $testcookie
<br />$li[15] $testget
<br />$li[16] $testupload
<br />$li[67]&nbsp; &nbsp;<font color=#29338A>BMForum <span id='snews'></span></font>
<br />$li[66]&nbsp; &nbsp;<font color=#29338A>$verandproname</font>
<span id='vnews'><br/><strong style='color:red;'>$li[68]</strong></span>
<br />$li[17] <b><font face=verdana>$current_time ($li[18] $current_gmt_time)</font></b><br />$warningver
EOT;
echo<<<EOT
</td></tr>
EOT;

    include("datafile/config.php");

    if ($mysqlchar == 1) {
        $aschecked = "checked='checked'";
    } else {
        $bschecked = "checked='checked'";
    } 
echo<<<EOT
</td></tr>
</table>
</td></tr></table>
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
<span class="categoryfontcolor_font">$li[19]</span>
</td></tr>

  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>
   $li[20]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT size=35 value='$database_up' name=setdatabase[a1]></td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[21]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><select name=setdatabase[a2]><option checked value=mysql>MySQL</option></select></td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[22]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT size=35 value='$db_name' name=setdatabase[a3]></td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[23]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT size=35 value='$db_username' name=setdatabase[a4]></td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[24]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT size=35 value='$db_password' type="password" name=setdatabase[a5]></td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[25]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT size=35 value='$db_server' name=setdatabase[a6]></td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[69]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT type='radio' style="width:5%" value="1" name='setdatabase[a8]' />$li[70]<INPUT type='radio' checked='checked' style="width:5%" value="0" name='setdatabase[a8]' />$li[71]</td>
  </tr>
  <tr>
<td class='forumcoloronecolor' style='text-align:left;'>$li[26]</td>
   <td class='forumcoloronecolor' style='text-align:left;'><INPUT type=radio style="width:5%" value="0" $bschecked name=setdatabase[a7]>$li[27]<INPUT type=radio $aschecked style="width:5%" value="1" name=setdatabase[a7]>$li[28]</td>
  </tr>
    <tr><td class='forumcolortwo_noalign' style='text-align:center;' colspan="2"><INPUT style="WIDTH: 50%; FONT-FAMILY: Verdana" type=submit value="$li[29]"></form></TD></TR>
EOT;
} elseif ($step == 2) {
    $check = 1;

    include("datafile/config.php");

echo<<<EOT

</td></tr>
</table>
</td></tr></table>

EOT;

    $filecontent = "<?php
define(\"CONFIGLOADED\", 1);
error_reporting(0);
\$database_up=	'$setdatabase[a1]';
\$sqltype=	'$setdatabase[a2]';
\$db_name=	'$setdatabase[a3]';
\$db_username=	'$setdatabase[a4]';
\$db_password=	'$setdatabase[a5]';
\$db_server=	'$setdatabase[a6]';
\$mysqlchar=	'$setdatabase[a7]';
\$bbs_is_open	=	'$bbs_is_open';
\$bbs_close_msg	=	'$bbs_close_msg';
\$bbs_title	=	'$bbs_title';
\$script_pos	=	'$script_pos';
\$site_name	=	'$site_name';
\$site_url	=	'$site_url';
\$keyword_site	=	'$keyword_site';
\$admin_email	=	'$admin_email';
\$max_sign_length=	'$max_sign_length';
\$sign_use_wdbcode=	'$sign_use_wdbcode';
\$wdbcode_sign['pic']=	'{$wdbcode_sign[pic]}';
\$wdbcode_sign['flash']='{$wdbcode_sign[flash]}';
\$wdbcode_sign['fontsize']='{$wdbcode_sign[fontsize]}';
\$perpage	=	'$perpage';
\$read_perpage	=	'$read_perpage';
\$send_mail	=	'$send_mail';
\$max_post_length=	'$max_post_length';
\$wdbcode_post['pic']=	'{$wdbcode_post[pic]}';
\$wdbcode_post['reply']=	'{$wdbcode_post[reply]}';
\$wdbcode_post['jifen']=	'{$wdbcode_post[jifen]}';
\$wdbcode_post['sell']=	'{$wdbcode_post[sell]}';
\$wdbcode_post['flash']='{$wdbcode_post[flash]}';
\$wdbcode_post['fontsize']='{$wdbcode_post[fontsize]}';
\$echo_reply	=	'$echo_reply';
\$wdbcode_echo['pic']=	'{$wdbcode_echo[pic]}';
\$wdbcode_echo['flash']='{$wdbcode_echo[flash]}';
\$wdbcode_echo['fontsize']='{$wdbcode_echo[fontsize]}';
\$flood_control	=	'$flood_control';
\$short_msg_max	=	'$short_msg_max';
\$use_honor	=	'$use_honor';
\$refresh_allowed=	'$refresh_allowed';
\$userperpage	=	'$userperpage';
\$online_limit	=	'$online_limit';
\$showtime	=	'$showtime';
\$view_forum_online=	'$view_forum_online';
\$use_own_portait=	'$use_own_portait';
\$allow_upload	=	'$allow_upload';
\$max_upload_size=	'$max_upload_size';
\$upload_type_available='$upload_type_available';
\$wdbcode_post['mpeg']='{$wdbcode_post[mpeg]}';
\$wdbcode_post['iframe']='{$wdbcode_post[iframe]}';
\$bbs_money=	'$bbs_money';
\$reg_stop=	'$reg_stop';
\$reg_close_msg	=	'$reg_close_msg';
\$ads_select='$ads_select';
\$frep_select='$frep_select';
\$fnew_select='$fnew_select';
\$fnew_skin='$fnew_skin';
\$max_poll='$max_poll';
\$max_zzd='$max_zzd';
\$max_qzd='$max_qzd';
\$delrmb='$delrmb';
\$post_money='$post_money';
\$page_regtips='$page_regtips';
\$index_regtips='$index_regtips';
\$all_regtips='$all_regtips';
\$cancel_guest='$cancel_guest';
\$maxwidth='$maxwidth';
\$maxheight='$maxheight';
\$opencutusericon='$opencutusericon';
\$postbinfo='$postbinfo';
\$bbs_des='$bbs_des';
\$bbslogo83='$bbslogo83';
\$usemarquee='$usemarquee';
\$postjumpurl='$postjumpurl';
\$deljifen='$deljifen';
\$post_jifen='$post_jifen';
\$reg_money='$reg_money';
\$reg_allowed='$reg_allowed';
\$max_upload_post='$max_upload_post';
\$gvf='$gvf';
\$sea_allowed='$sea_allowed';
\$svf='$svf';
\$reg_r_money='$reg_r_money';
\$openupusericon='$openupusericon';
\$max_avatars_upload_size='$max_avatars_upload_size';
\$max_avatars_upload_post='$max_avatars_upload_post';
\$upload_avatars_type_available='$upload_avatars_type_available';
\$swf='$swf';
\$reauto='$reauto';
\$send_pass='$send_pass';
\$regduan='$regduan';
\$frdduan='$frdduan';
\$send_msg_max='$send_msg_max';
\$send_msg='$send_msg';
\$bbs_news='$bbs_news';
\$use_group='$use_group';
\$gzip_compress='$gzip_compress';
\$scclose='$scclose';
\$reg_va='$reg_va';
\$log_va='$log_va';
\$view_index_online='$view_index_online';
\$recclose='$recclose';
\$todayb_show='$todayb_show';
\$openbbimg='$openbbimg';
\$maxlogintry='$maxlogintry';
\$cookie_d='$cookie_d';
\$cookie_p='$cookie_p';
\$fdattach='$fdattach';
\$autolang='$autolang';
\$sess_cust='$sess_cust';
\$saveattbyym='$saveattbyym';
\$refreshpostrank='$refreshpostrank';
\$emotrand='$emotrand';
\$fastmanage='$fastmanage';
\$choose_reason='$choose_reason';
\$search_renums='$search_renums';
\$reg_posting='$reg_posting';
\$fastlogin='$fastlogin';
\$cachejs='$cachejs';
\$infopics='$infopics';
\$set_forinfo='$set_forinfo';
\$fjsjump='$fjsjump';
\$rcordosbr='$rcordosbr';
\$tfdattach='$tfdattach';
\$max_regname_length='$max_regname_length';
\$min_regname_length='$min_regname_length';
\$listmmlist='$listmmlist';
\$cacheclick='$cacheclick';
\$invit_del_point='$invit_del_point';
\$reg_invit='$reg_invit';
\$reg_oneemail='$reg_oneemail';
\$invit_send_point='$invit_send_point';
\$ugactive='$ugactive';
\$emot_every='$emot_every';
\$emot_lines='$emot_lines';
\$allow_ajax_reply='$allow_ajax_reply';
\$allow_ajax_browse='$allow_ajax_browse';
\$gd_auth='$gd_auth';
\$admin_idname='{replace_admin_id_name_here}';
\$bmfopt[showsubforum]='$bmfopt[showsubforum]';
\$bmfopt[invite_type]='$bmfopt[invite_type]';
\$bmfopt[ip_address]='$bmfopt[ip_address]';
\$bmfopt[hot_tags]='$bmfopt[hot_tags]';
\$bmfopt[tags_max_similar]='$bmfopt[tags_max_similar]';
\$footer_copyright='$footer_copyright';
\$bmfopt[display_ftag]=1;
\$bmfopt['noswitchuser']='$bmfopt[noswitchuser]';
\$bmfopt['newpms']='$bmfopt[newpms]';
";
    writetofile("datafile/config.php", $filecontent);

    include("datafile/config.php");

    if ($mysqlchar == 1) $sqlcharset=" CHARSET=utf8";

    require("include/db/db_{$sqltype}.php");
    bmbdb_connect($db_server, $db_username, $db_password, $db_name);
    
    bmbdb_select_db($db_name);
    if (bmbdb_error()) {
        bmbdb_query("CREATE DATABASE `$db_name`");
        if (bmbdb_error()) {
            $status.= "<li>$li[41] ($db_name)</li>";
            $check = 0;
        } else {
            bmbdb_select_db($db_name);
            $status.= "<li>$li[42] ($db_name)</li>";
        } 
    } 

   // Check charset
    $timestamp = time();
    bmbdb_query("CREATE TABLE `{$database_up}testtable{$timestamp}` ( `teststring` text NOT NULL) TYPE=MyISAM{$sqlcharset}");
    bmbdb_query("INSERT INTO `{$database_up}testtable{$timestamp}` ( `teststring` ) VALUES ('请选择合适的语言請選擇合適的語言测试中文乱码')");
    $test_result = bmbdb_query("SELECT * FROM `{$database_up}testtable{$timestamp}`");
    $the_string = bmbdb_fetch_array($test_result);

    if ($the_string['teststring'] != '请选择合适的语言請選擇合適的語言测试中文乱码') {
    	$status.= "<li>$li[73]</li>";
    }
    bmbdb_query("DROP TABLE `{$database_up}testtable{$timestamp}`");

// end

    if ($check) {
echo<<<EOT
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
	<INPUT type=hidden value=3 name=step><INPUT type=hidden value='$language' name=language><span class="categoryfontcolor_font">$li[32]</span>
</td></tr>

<tr>
<td class="forumcolortwo_noalign" style="text-align:left;" colspan="2"><br /><ul><li>$li[31]</li>$status</ul></td>
        </tr><tr>
	 <td class="forumcoloronecolor" style="text-align:left;">&nbsp;&nbsp;$li[33]</td>
	 <td class="forumcoloronecolor" style="text-align:left;"><input type='text' name='MEMBER_NAME'></td>
	</tr><tr>
	 <td class="forumcoloronecolor" style="text-align:left;">&nbsp;&nbsp;$li[34]</td>
	 <td class="forumcoloronecolor" style="text-align:left;"><input type='password' name='MEMBER_PASS'></td>
	</tr><tr>
	 <td class="forumcoloronecolor" style="text-align:left;">&nbsp;&nbsp;$li[35]</td>
	 <td class="forumcoloronecolor" style="text-align:left;"><input type='password' name='MEMBER_PASS_TWO'></td>
	</tr><tr>
	 <td class="forumcoloronecolor" style="text-align:left;">&nbsp;&nbsp;$li[36]</td>
	 <td class="forumcoloronecolor" style="text-align:left;"><input type='text' name='EMAIL'></td>
	</tr><tr>
	 <td class="forumcoloronecolor" style="text-align:left;">&nbsp;&nbsp;$li[37]</td>
	 <td class="forumcoloronecolor" style="text-align:left;"><input type='text' name='EMAIL_TWO'></td>
	</tr><tr>
	 <td class="forumcoloronecolor" style="text-align:center;" colspan="2"><input type='submit' value='$li[29]' style='font-family:Verdana;width:50%'></td>
	<tr>
EOT;
    } 
} elseif ($step == 3) {
    include("datafile/config.php");
    require("include/db/db_{$sqltype}.php");
    bmbdb_connect($db_server, $db_username, $db_password, $db_name, 0, $mysqlchar);

    $check = 1;
    
echo<<<EOT

</td></tr>
</table>
</td></tr></table>
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
<span class="categoryfontcolor_font">$li[38]</span></td></tr>
</td></tr>
<tr>
<td class="forumcoloronecolor" style="text-align:left;">
EOT;
    if ($MEMBER_PASS != $MEMBER_PASS_TWO) {
        echo "<span class='w'>$li[39]</span><br/>";
        $check = 0;
    } 

    if ($EMAIL != $EMAIL_TWO) {
        echo "<span class='w'>$li[40]</span><br/>";
        $check = 0;
    } 


    
    if ($mysqlchar == 1) $sqlcharset=" CHARSET=utf8";

    if ($check) {
    	if ($_GET['tables'] == 1) {
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}actlogs`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}apclog`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}beg`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}bmbcode`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}contacts`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}favorites`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}forumdata`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}gueststat`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}invite`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}lastest`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}levels`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}onlinestat`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}polls`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}posts`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}potlog`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}primsg`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}schedule`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}search`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}shareforum`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}tags`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}threads`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}usergroup`");
    	   bmbdb_query("DROP TABLE IF EXISTS `{$database_up}userlist`");
    	   echo "<span class='i'>$li[72]</span><br />";
    	}
    	
        $result = bmbdb_query("CREATE TABLE `{$database_up}actlogs` (
  `actdetail` text NOT NULL,
  `acter` text NOT NULL,
  `actreason` text NOT NULL,
  `acttime` int(11) NOT NULL default '0',
  `forumid` int(11) NOT NULL default '0',
  `actioncode` text NOT NULL,
  KEY `acttime` (`acttime`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}actlogs </span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}apclog` (
  `adminid` text NOT NULL,
  `adminpwd` text NOT NULL,
  `actionstatus` text NOT NULL,
  `adminip` text NOT NULL,
  `admintime` text NOT NULL,
  `addtime` int(11) NOT NULL default '0',
  KEY `addtime` (`addtime`)
) TYPE=MyISAM{$sqlcharset}
");
        echo "<span class='i'>$li[43] {$database_up}apclog</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}beg` (
  `id` int(11) NOT NULL default '0',
  `tid` int(11) NOT NULL default '0',
  `beglog` text NOT NULL,
  `giftid` text NOT NULL,
  `begers` mediumint(9) NOT NULL default '0',
  `begmoneys` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `tid` (`tid`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}beg</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}bmbcode` (
  `id` tinyint(4) NOT NULL auto_increment,
  `refrom` mediumtext NOT NULL,
  `reto` mediumtext NOT NULL,
  `enable` tinyint(1) NOT NULL default '0',
  `codetag` tinytext NOT NULL,
  `name` tinytext NOT NULL,
  `desc` tinytext NOT NULL,
  `example` tinytext NOT NULL,
  `nestings` tinyint(1) NOT NULL default '0',
  `displayorder` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM{$sqlcharset}
");
        echo "<span class='i'>$li[43] {$database_up}bmbcode</span><br />";
        
        $result = bmbdb_query("CREATE TABLE `{$database_up}contacts` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `type` tinyint(1) unsigned NOT NULL default '0',
  `adddate` int(11) NOT NULL default '0',
  `owner` mediumint(8) NOT NULL default '0',
  `contacts` mediumint(8) NOT NULL default '0',
  `conname` varchar(60) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `owner` (`owner`),
  KEY `type` (`type`,`owner`),
  KEY `contacts` (`type`,`owner`,`contacts`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}contacts</span><br />";
        
        $result = bmbdb_query("CREATE TABLE `{$database_up}favorites` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `tid` int(11) NOT NULL default '0',
  `owner` mediumint(8) NOT NULL default '0',
  `subscribe` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `owner` (`owner`),
  KEY `tid` (`tid`,`owner`),
  KEY `subscribe` (`tid`,`subscribe`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}favorites</span><br />";
        
        $result = bmbdb_query("CREATE TABLE `{$database_up}forumdata` (
  `type` text NOT NULL,
  `bbsname` text NOT NULL,
  `cdes` text NOT NULL,
  `id` int(11) unsigned NOT NULL default '0',
  `blad` text NOT NULL,
  `forum_icon` text NOT NULL,
  `filename` text NOT NULL,
  `forumpass` text NOT NULL,
  `forum_cid` text NOT NULL,
  `guestpost` text NOT NULL,
  `forum_ford` text NOT NULL,
  `postdontadd` text NOT NULL,
  `spusergroup` text NOT NULL,
  `naviewpost` text NOT NULL,
  `adminlist` text NOT NULL,
  `topicnum` int(11) unsigned NOT NULL default '0',
  `replysnum` int(11) unsigned NOT NULL default '0',
  `fltitle` text NOT NULL,
  `flposttime` text NOT NULL,
  `flposter` text NOT NULL,
  `flfname` text NOT NULL,
  `showorder` int(11) NOT NULL default '0',
  `usergroup` text NOT NULL,
  `caterows` tinyint(2) NOT NULL default '0',
  `todayp` int(7) unsigned NOT NULL default '0',
  `todaypt` int(11) unsigned NOT NULL default '0',
  `pincount` smallint(3) unsigned NOT NULL default '0',
  `trashcount` mediumint(8) unsigned NOT NULL default '0',
  `digestcount` mediumint(8) unsigned NOT NULL default '0',
  `jumpurl` tinytext NOT NULL,
  KEY `id` (`id`),
  KEY `showorder` (`showorder`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}forumdata</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}gueststat` (
  `username` text NOT NULL,
  `timestamp` text,
  `ips` text NOT NULL,
  `actionnum` text NOT NULL,
  `browser` text NOT NULL,
  `os` text NOT NULL,
  `filename` text NOT NULL
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}gueststat</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}invite` (
  `invitecode` varchar(9) NOT NULL default '',
  `inviter` int(11) NOT NULL default '0',
  `targetmail` text NOT NULL,
  `datetime` int(11) NOT NULL default '0',
  `accepted` tinyint(3) unsigned NOT NULL default '0',
  `newmember` varchar(60) NOT NULL default '',
  KEY `accepted` (`accepted`),
  KEY `datetime` (`datetime`),
  KEY `inviter` (`inviter`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}invite</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}lastest` (
  `pageid` text NOT NULL,
  `lastreged` text NOT NULL,
  `regednum` int(11) unsigned NOT NULL default '0',
  `threadnum` int(11) unsigned NOT NULL default '0',
  `postsnum` int(11) unsigned NOT NULL default '0',
  `todaynew` int(11) unsigned NOT NULL default '0',
  `lasttodaytime` int(11) NOT NULL default '0',
  `ydaynew` mediumint(9) unsigned NOT NULL default '0',
  `maxnews` mediumint(9) unsigned NOT NULL default '0',
  `lastposts` text NOT NULL,
  `lastposter` text NOT NULL,
  `lastpostid` int(11) NOT NULL default '0',
  `lastptime` int(11) NOT NULL default '0',
  `zytime` text NOT NULL,
  `zypeople` text NOT NULL
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}lastest</span><br />";
        
        $result = bmbdb_query("CREATE TABLE `{$database_up}levels` (
  `id` mediumint(9) NOT NULL default '0',
  `maccess` text NOT NULL,
  `fid` int(11) NOT NULL default '0'
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}levels</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}onlinestat` (
  `username` text NOT NULL,
  `onusrid` mediumint(8) NOT NULL default '0',
  `timestamp` text,
  `ips` text NOT NULL,
  `actionnum` text NOT NULL,
  `browser` text NOT NULL,
  `os` text NOT NULL,
  `filename` text NOT NULL,
  `ugnum` text NOT NULL,
  `prioption` text NOT NULL
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}onlinestat</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}polls` (
  `id` int(11) NOT NULL default '0',
  `options` text NOT NULL,
  `polluser` text NOT NULL,
  `setting` text NOT NULL,
  `forumid` int(11) NOT NULL default '0',
  KEY `id` (`id`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}polls</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}posts` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `tid` int(11) NOT NULL default '0',
  `articletitle` text NOT NULL,
  `username` text NOT NULL,
  `usrid` mediumint(8) NOT NULL default '0',
  `ip` varchar(20) NOT NULL default '',
  `usericon` text NOT NULL,
  `options` text NOT NULL,
  `other1` text NOT NULL,
  `other2` text NOT NULL,
  `other3` text NOT NULL,
  `other4` text NOT NULL,
  `other5` text NOT NULL,
  `addin` text NOT NULL,
  `articlecontent` text NOT NULL,
  `timestamp` int(11) NOT NULL default '0',
  `forumid` int(11) NOT NULL default '0',
  `changtime` int(11) NOT NULL default '0',
  `sellbuyer` text NOT NULL,
  `posttrash` enum('0','1') NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `changtime` (`changtime`),
  KEY `timestamp` (`timestamp`),
  KEY `globaltid` (`tid`,`id`),
  KEY `posttrash` (`posttrash`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}posts</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}potlog` (
  `pusername` text NOT NULL,
  `pauthor` text NOT NULL,
  `bymchange` text NOT NULL,
  `pforumid` text NOT NULL,
  `pfilename` text NOT NULL,
  `particle` text NOT NULL,
  `ptimestamp` int(14) default NULL,
  KEY `ptimestamp` (`ptimestamp`)
) TYPE=MyISAM{$sqlcharset}
");
        echo "<span class='i'>$li[43] {$database_up}potlog</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}primsg` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `belong` text NOT NULL,
  `sendto` text NOT NULL,
  `prtitle` text NOT NULL,
  `prtime` int(11) NOT NULL default '0',
  `prcontent` text NOT NULL,
  `prread` text NOT NULL,
  `prother` text NOT NULL,
  `prtype` text NOT NULL,
  `prkeepsnd` text NOT NULL,
  `stid` mediumint(9) NOT NULL default '0',
  `blid` mediumint(9) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `prtime` (`prtime`),
  KEY `stid` (`stid`,`blid`),
  FULLTEXT KEY `belong` (`belong`),
  FULLTEXT KEY `sendto` (`sendto`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}primsg</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}schedule` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `taskname` tinytext NOT NULL,
  `available` tinyint(4) NOT NULL default '0',
  `day` tinyint(4) NOT NULL default '0',
  `week` tinyint(4) NOT NULL default '0',
  `min` varchar(30) NOT NULL default '0',
  `hour` tinyint(4) NOT NULL default '0',
  `last` int(11) NOT NULL default '0',
  `next` int(11) NOT NULL default '0',
  `fname` tinytext NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `available` (`available`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}schedule</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}search` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `result` text NOT NULL,
  `bulitdate` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `bulitdate` (`bulitdate`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}search</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}shareforum` (
  `name` text NOT NULL,
  `url` text NOT NULL,
  `gif` text NOT NULL,
  `des` text NOT NULL,
  `type` text NOT NULL,
  `showorder` smallint(3) NOT NULL default '0',
  KEY `order` (`showorder`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}shareforum</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}tags` (
  `tagid` mediumint(9) unsigned NOT NULL auto_increment,
  `threads` mediumint(9) unsigned NOT NULL default '0',
  `tagname` varchar(100) NOT NULL default '',
  `filename` text NOT NULL,
  UNIQUE KEY `tagid` (`tagid`),
  KEY `threads` (`threads`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}tags</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}threads` (
  `id` int(11) NOT NULL default '0',
  `tid` int(11) NOT NULL default '0',
  `toptype` tinyint(1) unsigned NOT NULL default '0',
  `ttrash` tinyint(1) unsigned NOT NULL default '0',
  `lastreply` text NOT NULL,
  `topic` tinytext NOT NULL,
  `forumid` int(11) NOT NULL default '0',
  `hits` int(11) unsigned NOT NULL default '0',
  `replys` int(11) unsigned NOT NULL default '0',
  `changetime` int(11) NOT NULL default '0',
  `itsre` tinytext NOT NULL,
  `type` tinyint(1) unsigned NOT NULL default '0',
  `islock` tinyint(1) unsigned NOT NULL default '0',
  `title` text NOT NULL,
  `newdesc` text NOT NULL,
  `author` text NOT NULL,
  `authorid` int(11) NOT NULL default '0',
  `content` text NOT NULL,
  `time` int(11) NOT NULL default '0',
  `ip` varchar(20) NOT NULL default '',
  `face` tinytext NOT NULL,
  `options` text NOT NULL,
  `other1` text NOT NULL,
  `other2` text NOT NULL,
  `other3` text NOT NULL,
  `other4` text NOT NULL,
  `other5` text NOT NULL,
  `statdata` text NOT NULL,
  `addinfo` text NOT NULL,
  `alldata` int(11) NOT NULL default '0',
  `replyer` text NOT NULL,
  `ttagname` varchar(100) NOT NULL default '',
  `ttagid` varchar(20) NOT NULL default '',
  `ordertrash` tinyint(1) unsigned NOT NULL default '0',
  KEY `id` (`id`),
  KEY `tid` (`tid`),
  KEY `changetime` (`changetime`),
  KEY `time` (`time`),
  KEY `islock` (`islock`),
  KEY `ordertrash` (`ordertrash`),
  KEY `topindex` (`forumid`,`toptype`,`ttrash`,`changetime`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}threads</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}usergroup` (
  `id` int(11) NOT NULL default '0',
  `usersets` text NOT NULL,
  `adminsets` text NOT NULL,
  `unshowit` text NOT NULL,
  `showsort` int(11) NOT NULL default '0',
  `regwith` text NOT NULL,
  KEY `id` (`id`),
  KEY `showsort` (`showsort`)
) TYPE=MyISAM{$sqlcharset}

");
        echo "<span class='i'>$li[43] {$database_up}usergroup</span><br />";

        $result = bmbdb_query("CREATE TABLE `{$database_up}userlist` (
  `userid` mediumint(8) unsigned NOT NULL auto_increment,
  `username` varchar(60) NOT NULL default '',
  `pwd` varchar(32) NOT NULL default '',
  `avarts` text NOT NULL,
  `mailadd` text NOT NULL,
  `qqmsnicq` tinytext NOT NULL,
  `regdate` tinytext NOT NULL,
  `signtext` text NOT NULL,
  `homepage` tinytext NOT NULL,
  `fromwhere` tinytext NOT NULL,
  `desper` text NOT NULL,
  `headtitle` tinytext NOT NULL,
  `lastpost` int(11) NOT NULL default '0',
  `postamount` int(11) NOT NULL default '0',
  `publicmail` tinyint(1) unsigned NOT NULL default '0',
  `mailtype` varchar(4) NOT NULL default '',
  `point` int(11) NOT NULL default '0',
  `pwdask` tinytext NOT NULL,
  `pwdanswer` varchar(32) NOT NULL default '',
  `ugnum` int(11) NOT NULL default '0',
  `money` int(11) NOT NULL default '0',
  `birthday` tinytext NOT NULL,
  `team` tinytext NOT NULL,
  `sex` tinytext NOT NULL,
  `national` tinytext NOT NULL,
  `lastlogin` int(11) NOT NULL default '0',
  `tlastvisit` int(11) NOT NULL default '0',
  `deltopic` mediumint(8) unsigned NOT NULL default '0',
  `delreply` mediumint(8) unsigned NOT NULL default '0',
  `uploadfiletoday` mediumint(8) unsigned NOT NULL default '0',
  `lastupload` int(11) NOT NULL default '0',
  `foreuser` tinytext NOT NULL,
  `hisipa` varchar(20) NOT NULL default '',
  `hisipb` varchar(20) NOT NULL default '',
  `hisipc` varchar(20) NOT NULL default '',
  `newmess` smallint(3) unsigned NOT NULL default '0',
  `baoliu1` text NOT NULL,
  `baoliu2` text NOT NULL,
  `personug` text NOT NULL,
  `digestmount` mediumint(9) unsigned NOT NULL default '0',
  `activestatus` tinytext NOT NULL,
  `parusrid` mediumint(8) unsigned NOT NULL default '0',
  PRIMARY KEY  (`userid`),
  KEY `postamount` (`postamount`),
  KEY `point` (`point`),
  KEY `ugnum` (`ugnum`),
  KEY `money` (`money`),
  KEY `username` (`username`),
  KEY `parusrid` (`parusrid`)
) TYPE=MyISAM{$sqlcharset}");
        echo "<span class='i'>$li[43] {$database_up}userlist</span><br />";

        $MEMBER_PASS_W = md5($MEMBER_PASS);

        $result = bmbdb_query("INSERT INTO `{$database_up}userlist` (`username`, `pwd`, `avarts`, `mailadd`, `qqmsnicq`, `regdate`, `signtext`, `homepage`, `fromwhere`, `desper`, `headtitle`, `lastpost`, `postamount`, `publicmail`, `mailtype`, `point`, `pwdask`, `pwdanswer`, `ugnum`, `money`, `birthday`, `team`, `sex`, `national`, `lastlogin`, `tlastvisit`, `deltopic`, `delreply`, `uploadfiletoday`, `foreuser`, `hisipa`, `hisipb`, `hisipc`, `newmess`, `baoliu1`, `baoliu2`, `personug`, `activestatus`) VALUES ('$MEMBER_NAME', '$MEMBER_PASS_W', '', '$EMAIL', '※※', '" . time() . "', '', '', '', '', '', 0, 0, '0', 'text', '0', '', '', '0', '0', '', '', '', '', 0, 0, '0', '0', '0', '', '', '', '', 0, '', '', '', '')");
        $result = bmbdb_query("INSERT INTO `{$database_up}lastest` (`pageid`, `lastreged`, `regednum`, `threadnum`, `postsnum`, `todaynew`, `lasttodaytime`, `ydaynew`, `maxnews`, `lastposts`, `lastposter`, `lastpostid`, `lastptime`, `zytime`, `zypeople`) VALUES ('index', '$MEMBER_NAME', 1, 0, 0, 0, 0,0,0,'', '', 0, 0, '', '')");
        $result = bmbdb_query("insert into {$database_up}shareforum (name,url,gif,des,type,showorder) values ('BMForum','http://www.bmforum.com/bmb/','http://www.bmforum.com/bmb/logo8.gif','BMForum 官方讨论区,最好的 PHP 论坛','pic',0)");
        $result = bmbdb_query("insert into {$database_up}shareforum (name,url,gif,des,type,showorder) values ('BMForum Official Site','http://www.bmforum.com/bmb/','','BMForum 官方讨论区,最好的 PHP 论坛','',1)");

        $filecontent = str_replace("{replace_admin_id_name_here}", "$MEMBER_NAME", readfromfile("datafile/config.php"));
        writetofile("datafile/config.php", $filecontent);
    
        echo "<span class='i'>$li[44]</span><br />";
echo<<<EOT
</td></tr>
</table>
</td></tr></table>
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
<span class="categoryfontcolor_font">$li[45]</span>
</td></tr>
<tr>
<td class="forumcoloronecolor" style="text-align:left;">
<b>Name</b>: $MEMBER_NAME <br /><b>Password: $MEMBER_PASS </b>
<br /><br />
	<span style='color:#206FCA;'><a style='color:#206FCA;font-size:12pt;' href='install.php?step=4&language=$language'>$li[29]</a></span>

EOT;
    } else {
echo<<<EOT
</td></tr>
</table>
</td></tr></table>
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr>
<td class="forumcoloronecolor" style="text-align:center;">
<input onclick='history.go(-1)' type='button' value='$li[61]' style='font-family:Verdana;width:50%'>

EOT;

	}
} elseif ($step == 4) {
    include("datafile/config.php");
    require("include/db/db_{$sqltype}.php");
    bmbdb_connect($db_server, $db_username, $db_password, $db_name, 0, $mysqlchar);

    $check = 1;
echo<<<EOT
</td></tr>
</table>
</td></tr></table>
<br/><table cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr><td>
<table cellspacing="1" cellpadding="5" class="faq_table" style='width:100%'>
<tr><td colspan="100" class="faq_table_tr"> 
<span class="categoryfontcolor_font">$li[46]</span>
</td></tr>
<tr>
<td class="forumcoloronecolor" style="text-align:left;">


EOT;
	$result = bmbdb_fetch_array(bmbdb_query("SELECT COUNT(`id`) FROM `{$database_up}forumdata`"));
	if ($result['COUNT(`id`)'] == 0) {
    	$result = bmbdb_query("INSERT INTO `{$database_up}forumdata` (`type`, `bbsname`, `cdes`, `id`, `blad`, `forum_icon`, `filename`, `forumpass`, `forum_cid`, `guestpost`, `forum_ford`, `postdontadd`, `spusergroup`, `naviewpost`, `adminlist`, `topicnum`, `replysnum`, `fltitle`, `flposttime`, `flposter`, `flfname`, `showorder`, `usergroup`, `caterows`, `todayp`, `todaypt`, `jumpurl`) VALUES  ('category', '$li[47]', '', '1', '', '', '', '', '', '', '___', '', '', '', '', 0, 0, '', '', '', '', 1, '',0,0,0,'')");
    	$result = bmbdb_query("INSERT INTO `{$database_up}forumdata` (`type`, `bbsname`, `cdes`, `id`, `blad`, `forum_icon`, `filename`, `forumpass`, `forum_cid`, `guestpost`, `forum_ford`, `postdontadd`, `spusergroup`, `naviewpost`, `adminlist`, `topicnum`, `replysnum`, `fltitle`, `flposttime`, `flposter`, `flfname`, `showorder`, `usergroup`, `caterows`, `todayp`, `todaypt`, `jumpurl`) VALUES ('forum', '$li[48]', '$li[49]', '2', '', '', '', '', '1', '', '___', '', '', '', '', 0, 0, '', '', '', '', 2, '',0,0,0,'')");
	    echo "<span class=\"i\">$li[50]</span><br />";
	}
    // {$database_up}
	$result = bmbdb_fetch_array(bmbdb_query("SELECT COUNT(`id`) FROM `{$database_up}usergroup`"));
    if ($result['COUNT(`id`)'] == 0) {
    
    $query = "INSERT INTO `{$database_up}usergroup` VALUES (0, '$li[51]|messages0.gif|1|1|1|1|1|999999|1|1|1|1|1|1|9999999|999|999|1|1|2048000|jpg gif zip rar png ace iso txt bmp xls|1|1|teamad.gif|1|10|yes|999|0|1000|1|1|1|10|5|2|2|1|0|1|1|500000|0|jpg gif png|180|180|1|1|1|1|1|1||1|1|1|1|1|1|1|1|1|1|1|1|2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|1|0|1|1|5|0|50|50|0|1||0|0|0|1|1|1|0|3|0|0|0|0|1|-10|10|-100|100|1|0|0|1|1|1', '1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1||1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|', '0', 1, '')
INSERT INTO `{$database_up}usergroup` VALUES (1, '$li[52]|messages7.gif|1|1|1|1|1|300|1|1|1|1|1|1|30000|300|200|1|0|512000|jpg gif zip rar png ace iso txt|1|1|teamsmo.gif|1|8|no|10|0|500|1|0|1|10|5|2|2|1|0|1|1|300000|0|jpg gif png|150|150|1|1|1|1|1|1||1|1|1|1|1|1|1|1|1|1|0|1|2|1|1|1|1|1|1|1|1|1|0|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|1||0|0|0|1|1|1|0|3|0|0|0|0|1|-10|10|-100|100|1|0|0|1|1|1', '0|0|0|0|1|0|1|0|1|0|0|0|0|0|1|0|0|0|0|0|0|0|0|1|1||0|0|0|0|1|1|1|0|0|0|0|0|0|0|', '0', 2, '')
INSERT INTO `{$database_up}usergroup` VALUES (2, '$li[53]|messages4.gif|1|1|1|1|1|250|1|1|1|1|1|1|20000|250|100|1|0|512000|jpg gif zip rar png ace iso|0|0|teammo.gif|1|7|no|6|0|300|0|0|1|10|5|2|2|1|0|1|1|250000|0|jpg gif png|140|140|1|1|1|1|1|1||0|0|1|1|1|0|1|0|1|1|0|1|2|1|1|1|1|1|1|1|1|1|0|1|1|1|1|1|1|1|1|1|1|0|1|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|0||0|0|0|1|1|1|0|3|0|0|0|0|0|-10|10|-100|100|1|0|0|1|1|1', '0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0||', '0', 4, '')
INSERT INTO `{$database_up}usergroup` VALUES (3, '$li[54]|messages6.gif|1|1|1|1|1|200|1|1|1|1|1|1|20000|200|50|1|0|512000|jpg gif zip rar png ace txt|0|0|teamrz.gif|0|5|no|5|0|200|0|0|0|10|5|2|2|1|0|1|1|200000|0|jpg gif png|130|130|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|1|2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|3|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|10|0|100|1|0|0|0|0|', '0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0||', '0', 5, '')
INSERT INTO `{$database_up}usergroup` VALUES (4, '$li[55]|messages1.gif|1|1|1|1|1|200|1|1|0|1|0|1|20000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|2|no|3|0|100|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|1|2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|3|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|1|0|50|1|0|0|0|0|', '0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0|', '0', 6, '1')
INSERT INTO `{$database_up}usergroup` VALUES (5, '$li[56]|messages1.gif|1|0|0|0|0|10|0|0|0|0|0|1|0|2|1|0|0|0||0|0||0|0|no|0|99999999999999|0|0|0|0|999|0|999|0|0||0|0||||||0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|1|1|0|0|', '0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0||', '1', 7, '')
INSERT INTO `{$database_up}usergroup` VALUES (6, '$li[57]|messages1.gif|1||||||0|0|0|0|0||20000|||||0|||||0|0|no|0|||0|0|0|0|0|0|0|0|9999||||||||1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|||||||0|0|0|0|0|0|1|0|2|50|50|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|', '0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0||', '1', 8, '')
INSERT INTO `{$database_up}usergroup` VALUES (7, '$li[58]|messages8.gif|1|1|1|1|1|300|1|1|1|1|1|1|30000|300|150|1|0|819200|jpg gif zip rar png ace iso|0|0|teammo.gif|1|8|no|7|0|400|0|0|1|10|5|2|2|1|0|1|1|280000|0|jpg gif png|140|140|1|1|1|1|1|1||0|1|1|1|1|0|1|0|1|1|0|1|2|1|1|1|1|1|1|1|1|1|0|1|1|1|1|1|1|1|1|1|1|0|1||||||||||1|0|1|1|5|2|50|50|0|0||0|0|0|1|1|1|0|3|0|0|0|0|0|-10|10|-100|100|1|0|0|1|1|1', '0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0||', '0', 3, '')
INSERT INTO `{$database_up}levels` VALUES (0, '1|messages1.gif|1|1|1|1|1|150|1|1|0|1|0|1|20000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|2|no|3|0|100|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|3|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|0|0|0|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (1, '2|messages1.gif|1|1|1|1|1|150|1|1|0|1|0|1|20000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|2|no|3|0|100|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|3|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|1|0|10|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (2, '3|messages1.gif|1|1|1|1|1|150|1|1|0|1|0|1|20000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|2|no|3|0|100|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|3|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|1|0|10|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (3, '4|messages1.gif|1|1|1|1|1|200|1|1|0|1|0|1|30000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|3|no|4|0|100|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|4|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|2|0|20|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (4, '5|messages1.gif|1|1|1|1|1|200|1|1|0|1|0|1|30000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|3|no|4|0|200|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|3|0|30|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (5, '5|messages1.gif|1|1|1|1|1|200|1|1|0|1|0|1|40000|200|5|1|0|512000|jpg gif zip rar png txt swf|0|0||0|4|no|5|0|300|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|3|0|30|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (6, '6|messages1.gif|1|1|1|1|1|300|1|1|0|1|0|1|40000|200|5|1|0|1024000|jpg gif zip rar png txt swf|0|0||0|6|no|6|0|500|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|120|120|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|0||0|0|0|0|0|0|0|4|0|0|0|0|0|0|4|0|40|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (7, '7|messages1.gif|1|1|1|1|1|500|1|1|0|1|0|1|40000|500|10|1|0|1024000|jpg gif zip rar png txt swf|0|0||0|6|no|6|0|500|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|180|180|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|4|0|40|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (8, '8|messages1.gif|1|1|1|1|1|500|1|1|0|1|0|1|40000|500|10|1|0|1024000|jpg gif zip rar png txt swf|0|0||0|6|no|6|0|500|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|180|180|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|5|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|5|0|50|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (9, '9|messages1.gif|1|1|1|1|1|500|1|1|0|1|0|1|40000|500|10|1|0|1024000|jpg gif zip rar png txt swf|0|0||0|6|no|6|0|500|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|180|180|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|6|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|5|0|50|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (10, '10|messages1.gif|1|1|1|1|1|500|1|1|0|1|0|1|40000|500|15|1|0|1024000|jpg gif zip rar png txt swf|0|0||0|6|no|6|0|1000|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|180|180|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|6|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|6|0|60|0|0|0|0|0|', 0)
INSERT INTO `{$database_up}levels` VALUES (11, '11|messages1.gif|1|1|1|1|1|500|1|1|0|1|0|1|40000|500|20|1|0|2048000|jpg gif zip rar png txt swf|0|0||0|6|no|6|0|1000|0|0|0|10|5|2|2|1|0|1|1|100000|10|jpg gif|180|180|1|1|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0||2|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|1|1|6|2|50|50|0|0||0|0|0|0|0|0|0|3|0|0|0|0|0|0|7|0|70|0|0|0|0|0|', 0)";
    $arrayquery = explode("\n", $query);
    for($i = 0;$i < count($arrayquery);$i++) {
        $result = bmbdb_query($arrayquery[$i]);
    } 
    echo "<span class=\"i\">$li[59]</span><br />";
    }

    refresh_forumcach();
    refresh_ugcache();

echo<<<EOT

	<span style='color:#206FCA;'><a style='font-size:12pt;color:#206FCA;' href='admin.php'>$li[60]</a></span>


EOT;

    @rename("install.php", "install.lock");
} 

?>
    </td>
</td></tr>
</table>
</td></tr></table>
</form>
<?php
if (!$step) {
echo<<<EOT
<script src="http://www.bmforum.com/down/vercheck.php?check_version_lang=$check_version_lang"></script>
<script>
document.getElementById("snews").innerHTML  = newver;
if($kernel_build>=kernel_build){ 
document.getElementById("vnews").innerHTML  = "<br/>$li[65]";
}else{ 
document.getElementById("vnews").innerHTML  = "<br/><a href='http://www.bmforum.com'>$li[64]</a><br/>"+notice;
if(enablealert!="") {
	alert(enablealert);
}
}
</script>
EOT;

}
?>
<br />
    </body></html>
