Онлайн_Маньяк,
switch ($act) {
case 'install':
mysql_query("DROP TABLE IF EXISTS `down_bookmark`;");
mysql_query("
CREATE TABLE IF NOT EXISTS `down_bookmark` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`file_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `file_id` (`file_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
");
mysql_query("DROP TABLE IF EXISTS `down_comments`;");
mysql_query("
CREATE TABLE IF NOT EXISTS `down_comments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sub_id` int(10) unsigned NOT NULL,
`time` int(11) NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`text` text NOT NULL,
`reply` text NOT NULL,
`attributes` text NOT NULL,
PRIMARY KEY (`id`),
KEY `sub_id` (`sub_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
mysql_query("DROP TABLE IF EXISTS `down_files`;");
mysql_query("
CREATE TABLE IF NOT EXISTS `down_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`refid` int(11) NOT NULL,
`dir` text NOT NULL,
`time` int(11) NOT NULL,
`sort` int(11) NOT NULL,
`name` text NOT NULL,
`type` int(2) NOT NULL,
`user_id` int(11) NOT NULL,
`total` int(11) NOT NULL,
`rus_name` text NOT NULL,
`text` text NOT NULL,
`field` int(11) NOT NULL DEFAULT '0',
`rate` varchar(30) NOT NULL DEFAULT '0|0',
`about` text NOT NULL,
`desc` text NOT NULL,
PRIMARY KEY (`id`),
KEY `refid` (`refid`),
KEY `total` (`total`),
KEY `type` (`type`),
KEY `user_id` (`user_id`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
mysql_query("DROP TABLE IF EXISTS `down_more`;");
mysql_query("
CREATE TABLE IF NOT EXISTS `down_more` (
`id` int(11) NOT NULL auto_increment,
`refid` int(11) NOT NULL,
`time` int(11) NOT NULL,
`name` text NOT NULL,
`rus_name` text NOT NULL,
`size` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `refid` (`refid`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
echo '<div class="phdr"><b>Загруз центр</b></div>' .
'<div class="menu">Установка выполнена</div>' .
'<div class="rmenu">Не забудьте удалить файл install_down.php</div>' .
'<div class="phdr"><br /></div>';
break;
case 'update':
mysql_query("DROP TABLE IF EXISTS `down_comms`;");
mysql_query("DROP TABLE IF EXISTS `down_comments`;");
mysql_query("
CREATE TABLE IF NOT EXISTS `down_comments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sub_id` int(10) unsigned NOT NULL,
`time` int(11) NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`text` text NOT NULL,
`reply` text NOT NULL,
`attributes` text NOT NULL,
PRIMARY KEY (`id`),
KEY `sub_id` (`sub_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");