<?php
include "header/config.inc.php";
include "header/connect.inc.php";
mysql_query("DROP TABLE IF EXISTS `wpcc_captcha`");
mysql_query("CREATE TABLE `wpcc_captcha` (
`code` text,
`ua` text,
`ip` text,
`ts` bigint(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("DROP TABLE IF EXISTS `wpcc_clicks`");
mysql_query("CREATE TABLE `wpcc_clicks` (
`who` text,
`to` text,
`ts` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("DROP TABLE IF EXISTS `wpcc_guest`");
mysql_query("CREATE TABLE `wpcc_guest` (
`id` int(11) NOT NULL auto_increment,
`who` text,
`text` text,
`answer` text,
`ts` bigint(20) default NULL,
`ua` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("DROP TABLE IF EXISTS `wpcc_news`");
mysql_query("CREATE TABLE `wpcc_news` (
`id` int(11) NOT NULL auto_increment,
`text` text,
`ts` bigint(20) default NULL,
`cat` tinyint(2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("DROP TABLE IF EXISTS `wpcc_stats`");
mysql_query("CREATE TABLE `wpcc_stats` (
`who` varchar(60) NOT NULL,
`cn` smallint(6) unsigned NOT NULL,
`ts` date NOT NULL,
UNIQUE KEY `who` (`who`,`cn`,`ts`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("DROP TABLE IF EXISTS `wpcc_transfers`");
mysql_query("CREATE TABLE `wpcc_transfers` (
`from` varchar(20) collate utf8_unicode_ci NOT NULL,
`to` varchar(20) collate utf8_unicode_ci NOT NULL,
`time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`sum` mediumint(9) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
mysql_query("DROP TABLE IF EXISTS `wpcc_users`");
mysql_query("CREATE TABLE `wpcc_users` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`login` text character set utf8,
`password` text,
`credits` mediumint(9) NOT NULL,
`url` varchar(100) default NULL,
`mail` text,
`ts` bigint(20) default NULL,
`cto` bigint(20) default NULL,
`cfrom` bigint(20) default NULL,
`ip` text,
`ua` text,
`ets` bigint(20) default '0',
`admin` tinyint(4) default '0',
`ctime` int(10) unsigned NOT NULL,
`gotime` int(10) unsigned NOT NULL,
`referer` int(11) NOT NULL,
`refcount` tinyint(4) NOT NULL,
`fromref` int(11) NOT NULL,
`shcomp` tinyint(1) NOT NULL default '1',
`shopera` tinyint(1) NOT NULL default '1',
`kostiprize` mediumint(8) NOT NULL default '0',
`kostiprizetoday` mediumint(9) NOT NULL,
`fromforum` mediumint(9) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `url` (`url`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("DROP TABLE IF EXISTS `wpcc_preferences`");
mysql_query("CREATE TABLE `wpcc_preferences` (
`key` varchar(255) collate utf8_unicode_ci NOT NULL,
`val` varchar(255) collate utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
mysql_query("INSERT INTO `wpcc_preferences` VALUES('targetting', 'on');");
echo "Taблицы ycпeшнo импopтиpoвaны!";
?>