View file update_v4_to_v6.php

File size: 15.74Kb
<?php

/***************************************************************************
 *
 *   Эта версия phpBB-WAP является бесплатным
 *   программным обеспечением и распространяется
 *   в рамках лицензии GNU General Public License.
 *   Автор модификации настоятельно не
 *   рекомендует распрострянять её так, как
 *   распространялась 5 версия мода.
 *
 ***************************************************************************/

include("config.php");
$connect = mysql_connect($dbhost,$dbuser,$dbpasswd);
mysql_select_db($dbname,$connect);

echo '<a href="index.php">Форумы</a>|Обновление<br/>';

$sql = array();
$sql[] = "CREATE TABLE " . $table_prefix . "styles_css (style_id mediumint(8) auto_increment, style_name varchar(50) default NULL, style_text text, PRIMARY KEY (style_id))";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('1', 'Синий', 'body { background-color : #e2f0f8;}
font,th,td,p  {
color: #494949;
font-family: sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited  {
color: #40A7FC;
text-decoration: none;
}
a:hover { text-decoration: none; color: black; position: relative; top: 1px; }
td.catSides  { background-color: #228FEA; border-bottom: 3px solid #1581DA; border-top: 3px solid #40A7FC; border-left: 3px solid #40A7FC; border-right: 3px solid #1581DA; height: 23px; }
td.row1  { background-color: #D3E5F0; border-bottom: 3px solid #C1DCED; border-top: 3px solid #E9F2F8; border-left: 3px solid #E9F2F8; border-right: 3px solid #C1DCED;}
td.row_easy  { background-color: #E9F2F8; border-bottom: 3px solid #C1DCED; border-top: 3px solid #FFFFFF; border-left: 3px solid #FFFFFF; border-right: 3px solid #C1DCED; padding: 1px;}
td.row_hard  { background-color: #D3E5F0; border-bottom: 3px solid #C1DCED; border-top: 3px solid #E9F2F8; border-left: 3px solid #E9F2F8; border-right: 3px solid #C1DCED; padding: 1px;}
.subbutton { color: #FFF; background-color: #228FEA; border-top: 2px solid #40A7FC; border-left: 2px solid #40A7FC; border-right: 2px solid #1581DA; border-bottom: 2px solid #1581DA; }
.forumline  { font-size: none; background-color: #999999;}
.genmed { font-size : 11px; }
.cattitle  {
color: #FFFFFF;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: #FFFFFF; text-decoration: none; }
a.mainmenu  { color: #333333; text-decoration: none; font-weight: bold;}
a.buttom  { color: #40A7FC; border: 1px solid #C1DCED; background: #D3E5F0; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('2', 'Жёлтый', 'body { background-color : #FFFFB9;}
font,th,td,p  {
color: #494949;
font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited  {
color: green;
text-decoration: none;
}
a:hover { text-decoration: none; color: black; position: relative; top: 1px; }
td.catSides  { background-color: #FFBF40; border-bottom: 1px solid #FFAA00; border-left: 1px solid #FFAA00; border-right: 1px solid #FFAA00; height: 23px; }
td.row1  { background-color: #FFFF90; border-bottom: 1px solid #FFBF40; border-left: 1px solid #FFBF40; border-right: 1px solid #FFBF40;}
td.row_easy  { background-color: #FFFF90; border-bottom: 1px solid #FFBF40; border-left: 1px solid #FFBF40; border-right: 1px solid #FFBF40; padding: 1px;}
td.row_hard  { background-color: #FFFF70; border-bottom: 1px solid #FFBF40; border-left: 1px solid #FFBF40; border-right: 1px solid #FFBF40; padding: 1px;}
.forumline  { font-size: none; background-color: #999999;}
.genmed { font-size : 11px; }
.cattitle  {
color: #494949;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: green; text-decoration: none; }
a.mainmenu  { color: #333333; text-decoration: none; font-weight: bold;}
a.buttom  { color: green; border: 1px solid #FFBF40; background: #FFBF40; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('3', 'Серый', 'body { background-color : #FFFFFF;}
font,th,td,p  {
color: #494949;
font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited   {
color: #3B678D;
text-decoration: none;
}
td.catSides  { background: url(images/cellpic1.gif); background-color: #D4D6D4; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; height: 23px; }
td.row1  { background-color: #EBEBEB; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999;}
td.row_easy  { background-color: #EBEBEB; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; padding: 1px;}
td.row_hard  { background-color: #D4D6D4; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; padding: 1px;}
.forumline  { font-size: none; background-color: #999999;}
.genmed { font-size : 11px; }
.cattitle  {
color: #333333;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: #3B678D; text-decoration: none; }
a.mainmenu  { color: #333333; text-decoration: none; font-weight: bold;}
a.buttom  { color: #333333; border: 1px solid #999999; background: #D4D6D4; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('4', 'Чёрно-зелёный', 'body { background-color : #000000;}
font,th,td,p  {
color: #FFD700;
font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited   {
color: #00FF00;
text-decoration: none;
}
td.catSides  { background-color: #222222; border-bottom: 3px solid #131313; border-left: 3px solid #3b3b3b; border-top: 3px solid #3b3b3b; border-right: 3px solid #131313; height: 23px; }
td.row1  { background-color: #222222; border-bottom: 1px solid #444444; border-left: 1px solid #444444; border-right: 1px solid #444444;}
td.row_easy  { background-color: #525252; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; padding: 1px;}
td.row_hard  { background-color: #727272; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; padding: 1px;}
.forumline  { font-size: none; background-color: #999999;}
.genmed { font-size : 11px; }
.cattitle  {
color: #ffffff;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: #3B678D; text-decoration: none; }
a.mainmenu  { color: #333333; text-decoration: none; font-weight: bold;}
a.buttom  { color: #000000; border: 1px solid #999999; background: #727272; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('5', 'Чёрно-синий', 'body { background-color : #000000;}
font,th,td,p  {
color: #FFFFFF;
font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited   {
color: #0099FF;
text-decoration: none;
}
td.catSides  { background-color: #003366; border-bottom: 3px solid #002b55; border-left: 3px solid #004284; border-top: 3px solid #004284; border-right: 3px solid #002b55; height: 23px; }
td.row1  { background-color: #000000; border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898;}
td.row_easy  { background-color: #002255; border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898; padding: 1px;}
td.row_hard  { background-color: #000000; border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898; padding: 1px;}
.forumline  { font-size: none; background-color: #557898;}
.genmed { font-size : 11px; }
.off { font-size: 10px; color: #999999 }
.cattitle  {
color: #00FF00;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: #008000; text-decoration: none; }
a.mainmenu  { color: #008000; text-decoration: none; font-weight: bold;}
a.buttom  { color: #008000; border: 1px solid #557898; background: #ADD2F5; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('6', 'Зелёный', 'body { background-color : #294000;}
font,th,td,p  {
color: #FFFFFF;
font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited   {
color: #34EB5E;
text-decoration: none;
}
td.catSides  { background-color: #3B7D32; border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898; height: 23px; }
td.row1  { background-color: #295723 ;border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898;}
td.row_easy  { background-color: #1f6516; border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898; padding: 1px;}
td.row_hard  { background-color: #295723; border-bottom: 1px solid #557898; border-left: 1px solid #557898; border-right: 1px solid #557898; padding: 1px;}
.forumline  { font-size: none; background-color: #557898;}
.genmed { font-size : 11px; }
.off { font-size: 10px; color: #999999 }
.cattitle  {
color: #00FF00;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: #000000; text-decoration: none; }
a.mainmenu  { color: 000000; text-decoration: none; font-weight: bold;}
a.buttom  { color: #000000; border: 1px solid #557898; background: #ADD2F5; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('7', 'Розовый', 'body { background-color : #ffdbf6;}
font,th,td,p  {
color: #494949;
font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link,a:active,a:visited  {
color: #fb1ac3;
text-decoration: none;
}
a:hover { text-decoration: none; color: black; position: relative; top: 1px; }
td.catSides  { background-color: #ed01b3; border-bottom: 3px solid #d802a3; border-top: 3px solid #fb01bd; border-left: 3px solid #fb01bd; border-right: 3px solid #d802a3; height: 23px; }
td.row1  { background-color: #fed0f3; border-bottom: 3px solid #fec4f0; border-top: 3px solid #fee7f8; border-left: 3px solid #fee7f8; border-right: 3px solid #fec4f0;}
td.row_easy  { background-color: #fee7f8; border-bottom: 3px solid #ffdcf6; border-top: 3px solid #ffffff; border-left: 3px solid #ffffff; border-right: 3px solid #ffdcf6; padding: 1px;}
td.row_hard  { background-color: #fed0f3; border-bottom: 3px solid #fec4f0; border-top: 3px solid #fee7f8; border-left: 3px solid #fee7f8; border-right: 3px solid #fec4f0; padding: 1px;}
.subbutton { color: #FFF; background-color: #ed01b3; border-top: 2px solid #fb01bd; border-left: 2px solid #fb01bd; border-right: 2px solid #d802a3; border-bottom: 2px solid #d802a3; }
.forumline  { font-size: none; background-color: #999999;}
.genmed { font-size : 11px; }
.cattitle  {
color: #FFFFFF;
font-weight: bold;
font-size: 11px;}
a.cattitle  { color: #FFFFFF; text-decoration: none; }
a.mainmenu  { color: #333333; text-decoration: none; font-weight: bold;}
a.buttom  { color: #fb1ac3; border: 1px solid #fec4f0; background: #fed0f3; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('8', 'Чёрно-красный', 'body { background-color : #000000; }
font,th,td,p  { color: #FFFFFF; font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
a:link,a:active,a:visited
{ color: #FF9900;text-decoration: none; }
a:hover { text-decoration: none; color: #FFFF00; position: relative; top: 1px; }
td.catSides  { background-color: #990000; border-bottom: 3px solid #660000; border-left: 3px solid #CC0000; border-top: 3px solid #CC0000; border-right: 3px solid #660000; height: 23px; }
td.row1  { background-color: #000000; border-bottom: 1px solid #CC3300; border-left: 1px solid #CC3300; border-right: 1px solid #CC3300;}
td.row_easy  { background-color: #660000; border-bottom: 1px solid #CC3300; border-left: 1px solid #CC3300; border-right: 1px solid #CC3300; padding: 1px;}
td.row_hard  { background-color: #000000; border-bottom: 1px solid #CC3300; border-left: 1px solid #CC3300; border-right: 1px solid #CC3300; padding: 1px;}
.forumline  { font-size: none; background-color: #CC3300;}
.genmed { font-size : 11px; }
.off { font-size: 10px; color: #999999 }
.cattitle  { color: #00FF00; font-weight: bold; font-size: 11px; }
a.cattitle  { color: #008000; text-decoration: none; }
a.mainmenu  { color: #008000; text-decoration: none; font-weight: bold;}
a.buttom  { color: #990033; border: 1px solid #990033; background: #FFCC66; padding: 0px 2px 0px; line-height: 1.5;}')";
$sql[] = "INSERT INTO " . $table_prefix . "styles_css VALUES ('9', 'phpBB-WAP', 'body { background-color : #DCDCDC; color: #494949; font-family: sans-serif; font-size: 12px; }
td { font-size: 12px; }
a:link,a:active,a:visited { color: #0000FF; text-decoration: none; }
a:hover { text-decoration: none; color: black; position: relative; top: 1px; }
div.cat { color: #DDDDDD; background: url(images/fon_grey.gif); background-color: #696969; padding: 0px 2px 0px; }
td.catSides { background: url(images/vista.gif); background-color: #696969; border-bottom: 1px solid #DCDCDC; height: 28px; }
td.row1 { background-color: #EBEBEB; border-bottom: 1px solid #DCDCDC; }
td.row_easy { background-color: #EBEBEB; }
td.row_hard { background-color: #D4D6D4; }
.forumline { font-size: none; background-color: #999999;}
.genmed { font-size : 11px; }
.cattitle {
color: #FFFFFF;
font-weight: bold;
font-size: 12px; }
a.cattitle { color: #FFFFFF; text-decoration: none; }
a.mainmenu { color: #333333; text-decoration: none; font-weight: bold; }
a.buttom { color: #494949; border: 1px solid #C4C6C4; background: #D4D6D4; padding: 0px 2px 0px; line-height: 1.5; }')";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD style_text text";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD user_on_off TINYINT not null DEFAULT '1'";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD user_attach_mod TINYINT not null DEFAULT '1'";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD user_nic_color varchar(100) NOT NULL default '#3B678D'";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD user_quick_answer TINYINT not null DEFAULT '0'";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD user_icq_send TINYINT not null DEFAULT '1'";
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD user_index_spisok TINYINT not null DEFAULT '0'";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('index_announcement', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('index_spisok', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('send_user_icq', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('default_icq', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('default_icq_pass', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('flood_icq_interval', '60')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('last_check_icq_time', '0')";

$errormsg = '';

for( $i = 0; $i < count($sql); $i++ )
{
	if( !$result = mysql_query($sql[$i]) )
	{
		$error = mysql_error();
		$errorsql = true;
		$errormsg .= $error['message'].'<br/>';
	}
	else
	{
		$errorsql = false;
	}
}

if($errorsql)
{
	echo '<span style="color:#FF1493">Обновление произошло с ошибками:</span><br/>';
	echo $errormsg;
} else {
	echo '<p>Обновление выполнено</p>';
}
echo '<p><span class="genmed">(c) чел, 2008</span></p>';
mysql_close($connect);

?>