View file install/index.php

File size: 8.88Kb
<?PHP
ini_set('display_errors', 'off');
header ("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
print '<?xml version="1.0" encoding="UTF-8"?>';
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
</title><link rel=\"StyleSheet\" type=\"text/css\" href=\"../style/0.css\">";
include "../ini.php";
mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die ('<title>error!</title>'.
        'Did not connect to database!'.
        '</body>'.
        '</html>');

mysql_select_db($DB_NAME);
$table="
DROP TABLE `adminka`,
`bannedib`,
`chat_ignor`,
`chat_intim`,
`chat_news`,
`chat_newserv`,
`chat_letters`,
`chat_meets`,
`chat_messages`,
`chat_ques` ,
`chat_settings`,
`chat_unlim`,
`chat_users`,
`chat_vict`,
`cusers`;
";
$result = @mysql_query($table);
echo "<b>Таблици удалены!<br/>  </b>";
$table="
CREATE TABLE `bannedib` (
  `mid` int(11) NOT NULL auto_increment,
  `ip` varchar(30) NOT NULL default '',
  `browser` varchar(255) NOT NULL default '',
  `login` text NOT NULL,
  `ci` int(255) NOT NULL default '0',
  PRIMARY KEY  (`mid`)
) TYPE=MyISAM AUTO_INCREMENT=25;
";
$result = @mysql_query($table);
echo "<b>1.Таблица bannedib успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_ignor` (
  `id` int(11) NOT NULL auto_increment,
  `loginid` int(11) NOT NULL default '0',
  `user` text NOT NULL,
  `ci` int(11) default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=8 ;
";
$result = @mysql_query($table);
echo "<b>2.Таблица chat_ignor успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_letters` (
  `id` int(11) NOT NULL auto_increment,
  `from_user` text NOT NULL,
  `to_user` text NOT NULL,
  `subject` text,
  `letter` text NOT NULL,
  `time` text NOT NULL,
  `new` int(11) default NULL,
  `ci` int(11) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=107 ;
";
$result = @mysql_query($table);
echo "<b>3.Таблица chat_letters успешно создана <br/>  </b>";
$table="
DROP TABLE IF EXISTS cusers;
";
$result = @mysql_query($table);
echo "<b>Таблица cusers очищена если она существует <br/>  </b>";
$table="
CREATE TABLE `cusers` (
  `ci` int(11) NOT NULL auto_increment,
  `admin` text NOT NULL,
  `pass` text NOT NULL,
  `topic` text NOT NULL,
  `link` text NOT NULL,
  `name` text NOT NULL,
  `bstatus` text,
  `bposts` int(11) NOT NULL default '0',
  `date` text NOT NULL,
  `ban` int(11) NOT NULL default 0,
  PRIMARY KEY  (`ci`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
";
$result = @mysql_query($table);
echo "<b>4.Таблица cusers успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_settings` (
  `id` int(11) NOT NULL auto_increment,
  `mod` text,
  `var` text,
  `val1` text,
  `val2` text,
  `val3` int(11) default '0',
  `ci` int(11) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1336 ;
";
$result = @mysql_query($table);
echo "<b>4.Таблица settings успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_users` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `pass` text NOT NULL,
  `name` text,
  `sex` text NOT NULL,
  `bday` int(11) default '0',
  `bmonth` int(11) default '0',
  `byear` int(11) default '0',
  `photo` text,
  `live` text,
  `mobile` text,
  `operator` text,
  `email` text,
  `wapsite` text,
  `website` text,
  `icq` int(11) default '0',
  `about` text,
  `status` text,
  `posts` int(11) NOT NULL default '0',
  `vposts` int(11) NOT NULL default '0',
  `nmsgs` int(11) default '0',
  `tupdate` int(11) default '0',
  `fsize` text,
  `ban` text,
  `breason` text,
  `btime` text,
  `room` text,
  `moder` int(11) default '0',
  `admin` int(11) default '0',
  `rtime` int(11) NOT NULL default '0',
  `ltime` int(11) NOT NULL default '0',
  `ip` text,
  `soft` text,
  `ci` int(255) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM ;
";
$result = @mysql_query($table);
echo "<b>5.Таблица chat_users успешно создана <br/>  </b>";

$table="
CREATE TABLE `chat_settings` (
`id` INT NOT NULL AUTO_INCREMENT ,
`mod` TEXT,
`var` TEXT,
`val1` TEXT,
`val2` TEXT,
`val3` INT(11) default '0',
`ci` int(255) NOT NULL default '0',
PRIMARY KEY ( `id` )
";
$result = @mysql_query($table);
echo "<b>6.Таблица chat_settings успешно создана <br/>  </b>";


$table="
CREATE TABLE `chat_messages` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `msg` text NOT NULL,
  `pr_from` text,
  `pr_to` text,
  `time` text NOT NULL,
  `room` text,
  `ci` int(255) NOT NULL default '0',
  PRIMARY KEY  (`id`)
);
";
$result = @mysql_query($table);
echo "<b>7.Таблица chat_messages успешно создана <br/>  </b>";

$table="
CREATE TABLE `chat_unlim` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `msg` text NOT NULL,
  `pr_from` text,
  `pr_to` text,
  `time` text NOT NULL,
  `ci` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
";
 $result = @mysql_query($table);
echo "<b>8.Таблица chat_unlim успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_intim` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `msg` text NOT NULL,
  `key` text,
  `time` text NOT NULL,
  `ci` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
";
$result = @mysql_query($table);
echo "<b>9.Таблица chat_intim успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_meets` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `title` text NOT NULL,
  `content` text NOT NULL,
  `organizatory` text NOT NULL,
  `ci` int(255) NOT NULL default '0',
  PRIMARY KEY  (`id`)
);
";
$result = @mysql_query($table);
echo "<b>10.Таблица chat_meets успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_news` (
  `id` int(11) NOT NULL auto_increment,
  `otkogo` text NOT NULL,
  `text` text NOT NULL,
  `title` text NOT NULL,
  `ci` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
";
$result = @mysql_query($table);
echo "<b>11.Таблица chat_meets успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_newserv` (
  `id` int(11) NOT NULL auto_increment,
  `otkogo` text NOT NULL,
  `text` text NOT NULL,
  `title` text NOT NULL,
  `ci` int(11) default NULL,
  `date` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
";
$result = @mysql_query($table);
echo "<b>12.Таблица chat_newserv успешно создана <br/>  </b>";
$table="
DROP TABLE IF EXISTS chat_vict;
";
$result = @mysql_query($table);
echo "<b>Таблица chat_vict очищена, если она существовала <br/>  </b>";
$table="
CREATE TABLE `chat_vict` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `msg` text NOT NULL,
  `pr_from` text,
  `pr_to` text,
  `vopros` text,
  `answered` text,
  `time` text NOT NULL,
  `ci` int(255) NOT NULL default '0',
  PRIMARY KEY  (`id`)
);
";
$result = @mysql_query($table);
echo "<b>13.Таблица chat_vict успешно создана <br/>  </b>";
$table="
CREATE TABLE `chat_ques` (
  `id` int(11) NOT NULL auto_increment,
  `vopros` text NOT NULL,
  `otvet` text NOT NULL,
  PRIMARY KEY  (`id`)
);
";
$result = @mysql_query($table);
echo "<b>14.Таблица chat_ques успешно создана <br/>  </b>";
$droop="
DROP TABLE IF EXISTS adminka;";
$result = @mysql_query($droop);
echo "<b>12.Таблица adminka успешно очищена <br/>  </b>";

$table="
CREATE TABLE `adminka` (
  `name` text NOT NULL,
  `passer` text NOT NULL,
  `rlink` varchar(200) NOT NULL default '1chats.ru',
  `rlinkn` varchar(200) NOT NULL default '1chats.ru',
  `limit` int(4) NOT NULL default '0',
   PRIMARY KEY  (`limit`)
);
";
$result = @mysql_query($table);
echo "<b>15.Таблица adminka успешно создана <br/>  </b>";

@mysql_query("insert into adminka values('1chats', '1chats', '1chats.ru','1chats.ru','100');");
echo "<b>14.Данные успешно занесены в таблицу adminka<br/></b>";
echo"Все таблицы созданы!</br></br>";
echo"ТЕПЕРЬ НУЖНО ЗАЛИТЬ ВОПРОСЫ К ВИКТОРИНЕ:</br>";
print" <a href=\"../install/ques.php\"><font color=#FF0000>Залить вопросы в викторину!!</font></a><br/>";
print '</body></html>';
?>