Файл: install/db_tables.php
Строк: 177
<?php
mysql_query("CREATE TABLE `cms_ads` (
`id` int(11) NOT NULL auto_increment,
`link_name` varchar(60) NOT NULL,
`link_link` varchar(60) NOT NULL,
`link_time` int(11) NOT NULL,
`time` int(11) NOT NULL,
`position` ENUM('up', 'down') NOT NULL,
`pages` ENUM('index', 'all', 'other') NOT NULL,
`color` varchar(20) NOT NULL,
`strong` ENUM('no', 'yes') DEFAULT 'no',
`underline` ENUM('no', 'yes') DEFAULT 'no',
`italic` ENUM('no', 'yes') DEFAULT 'no',
PRIMARY KEY (`id`),
KEY `link_time` (`link_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE IF NOT EXISTS `cms_settings` (
`id` int(1) NOT NULL AUTO_INCREMENT,
`language` varchar(15) NOT NULL,
`title` VARCHAR(60) NOT NULL,
`antiflood_time` int(10) NOT NULL,
`num_pages` int(2) NOT NULL,
`sex_view` ENUM('text', 'icons') NOT NULL,
`show_avatars` ENUM('no', 'yes') NOT NULL,
`theme` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2");
mysql_query("INSERT INTO `cms_settings` (`id`, `language`, `title`, `antiflood_time`, `num_pages`, `sex_view`, `show_avatars`, `theme`) VALUES
(1, 'ru', 'LiveCMS', 30, 10, 'icons', 'yes', 'default');");
mysql_query("CREATE TABLE `cms_forum_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`position` int(11) NOT NULL DEFAULT '0',
`name` varchar(100) NOT NULL,
`text` varchar(2000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_forum_sections` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`position` int(11) NOT NULL DEFAULT '0',
`name` varchar(100) NOT NULL,
`text` varchar(2000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_forum_topics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`section_id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`time_create` int(11) NOT NULL,
`time_update` int(11) NOT NULL,
`user_id` int(9) NOT NULL,
`close` ENUM('no', 'yes') DEFAULT 'no',
`up` ENUM('0', '1') DEFAULT '0',
PRIMARY KEY (`id`),
FULLTEXT KEY `name` (`name`),
KEY `category_id` (`category_id`,`section_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_forum_messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`section_id` int(11) NOT NULL,
`topic_id` int(11) NOT NULL,
`text` text NOT NULL,
`time` int(11) NOT NULL,
`user_id` int(9) NOT NULL,
`edit_count` int(10) NOT NULL DEFAULT '0',
`edit_by` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
KEY `category_id` (`category_id`),
KEY `section_id` (`section_id`),
KEY `topic_id` (`topic_id`),
KEY `time` (`time`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_banned_users` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`admin_id` int(11) NOT NULL,
`ban_time` int(11) NOT NULL,
`time` int(11) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `ban_time` (`ban_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_news` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(60) NOT NULL,
`text` text NOT NULL,
`time` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`days_homepage` int(11) NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_mail` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`to_id` int(11) NOT NULL default '0',
`time` int(11) NOT NULL,
`message` text NOT NULL,
`read` ENUM('no', 'yes') NOT NULL DEFAULT 'no',
`sys` ENUM('no', 'yes') NOT NULL DEFAULT 'no',
PRIMARY KEY (`id`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `cms_contacts` (
`user_id` int(11) NOT NULL default '0',
`cont_id` int(11) NOT NULL default '0',
`time` int(11) NOT NULL,
`type` ENUM('common', 'ignor') NOT NULL DEFAULT 'common',
UNIQUE KEY `user_id` (`user_id`, `cont_id`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `mini_chat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`time` int(11) NOT NULL,
`message` text NOT NULL,
PRIMARY KEY (`id`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `journal` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`time` int(11) NOT NULL,
`message` text NOT NULL,
`read` ENUM('no', 'yes') DEFAULT 'no',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `forum_files` (
`id` int(11) NOT NULL auto_increment,
`topic_id` int(11) NOT NULL,
`post_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`name` text NOT NULL,
`downloads` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `topic_id` (`topic_id`),
KEY `post_id` (`post_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `news_comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`news_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL DEFAULT '0',
`time` int(11) NOT NULL,
`message` text NOT NULL,
PRIMARY KEY (`id`),
KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL auto_increment,
`login` varchar(32) NOT NULL,
`password` varchar(64) NOT NULL,
`sex` varchar(3) NOT NULL DEFAULT '',
`date_reg` int(11) NOT NULL,
`date_last_entry` int(11) NOT NULL,
`rights` ENUM('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10') NOT NULL DEFAULT '0',
`status` varchar(50) NOT NULL DEFAULT '',
`name` varchar(50) NOT NULL DEFAULT '',
`lastname` varchar(50) NOT NULL DEFAULT '',
`dbirth` int(4) NOT NULL DEFAULT '0',
`mbirth` int(4) NOT NULL DEFAULT '0',
`ybirth` int(4) NOT NULL DEFAULT '0',
`live` varchar(50) NOT NULL DEFAULT '',
`about` varchar(600) NOT NULL DEFAULT '',
`email` varchar(45) NOT NULL DEFAULT '',
`icq` int(9) NOT NULL DEFAULT '0',
`skype` varchar(50) NOT NULL DEFAULT '',
`jabber` varchar(50) NOT NULL DEFAULT '',
`site` varchar(50) NOT NULL DEFAULT '',
`lastpost` int(11) NOT NULL,
`balls` int(11) NOT NULL DEFAULT '0',
`postsforum` int(10) UNSIGNED NOT NULL DEFAULT '0',
`postsmchat` int(10) UNSIGNED NOT NULL DEFAULT '0',
`postspg` int(10) UNSIGNED NOT NULL DEFAULT '0',
`ip` bigint(11) NOT NULL DEFAULT '0',
`rating` int(11) NOT NULL DEFAULT '0',
`read_news` ENUM('no', 'yes') DEFAULT 'no',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE IF NOT EXISTS `user_settings` (
`user_id` int(11) NOT NULL auto_increment,
`language` varchar(2) NOT NULL,
`num_pages` int(6) NOT NULL,
`sex_view` ENUM('icons', 'text') NOT NULL,
`show_avatars` ENUM('no', 'yes') NOT NULL,
`theme` varchar(30) DEFAULT 'default',
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
mysql_query("CREATE TABLE `users_guestbook` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`guest_id` int(11) NOT NULL DEFAULT '0',
`time` int(11) NOT NULL,
`message` text NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
?>