<?php
if (!defined('R_P')) die("access die");
$sql['add'][] = "
	CREATE TABLE IF NOT EXISTS `".TABLEPRE."download__channelid__` (
		  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
		  `cid` int(10) unsigned NOT NULL DEFAULT '0',
		  `channelid` int(10) NOT NULL DEFAULT '0',
		  `subject_pre` varchar(6) NOT NULL,
		  `subject_color` varchar(7) NOT NULL,
		  `subject` varchar(100) NOT NULL DEFAULT '0',
		  `size` int(10) NOT NULL DEFAULT '0',
		  `stars` tinyint(1) unsigned NOT NULL DEFAULT '0',
		  `systems` varchar(200) NOT NULL,
		  `language` varchar(20) NOT NULL DEFAULT '',
		  `use_type` varchar(20) NOT NULL DEFAULT '',
		  `plugin` varchar(20) NOT NULL DEFAULT '',
		  `thumb` varchar(255) NOT NULL,
		  `author` varchar(30) NOT NULL DEFAULT '',
		  `source` varchar(120) NOT NULL,
		  `softtype` varchar(30) DEFAULT NULL,
		  `editor` varchar(30) NOT NULL DEFAULT '',
		  `edit_time` int(10) unsigned NOT NULL DEFAULT '0',
		  `uid` int(10) unsigned NOT NULL DEFAULT '0',
		  `username` varchar(20) NOT NULL,
		  `description` mediumtext NOT NULL,
		  `is_comend` tinyint(1) NOT NULL DEFAULT '0',
		  `nocoment` tinyint(1) NOT NULL DEFAULT '0',
		  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
		  `dview` mediumint(6) unsigned NOT NULL DEFAULT '0',
		  `wview` mediumint(6) unsigned NOT NULL DEFAULT '0',
		  `mview` mediumint(6) unsigned NOT NULL DEFAULT '0',
		  `views` mediumint(6) unsigned NOT NULL DEFAULT '0',
		  `viewtime` int(10) unsigned NOT NULL DEFAULT '0',
		  `filter` set('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32') NOT NULL DEFAULT '0',
		  `a-z` char(3) NOT NULL DEFAULT '',
		  `keyword` varchar(64) NOT NULL,
		  `postip` int(11) NOT NULL,
		  `filename` varchar(64) NOT NULL,
		  `showphp` varchar(30) NOT NULL DEFAULT '',
		  `ver` mediumint(8) unsigned NOT NULL,
		  `ordering` int(10) unsigned NOT NULL,
		  `pay` tinyint(1) unsigned NOT NULL DEFAULT '0',
		  `error` tinyint(1) NOT NULL DEFAULT '0',
		  `type` enum('0','1') DEFAULT '0',
		  `tag_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
		  `extdata` text NOT NULL,
		  PRIMARY KEY (`id`),
		  KEY `views` (`views`),
		  KEY `cid` (`cid`)
	) ENGINE=MyISAM;
";

$sql['add'][] = "
	CREATE TABLE IF NOT EXISTS `".TABLEPRE."downloads__channelid__` (
		`pid` int(10) NOT NULL AUTO_INCREMENT,
		`id` int(10) NOT NULL DEFAULT '0',
		`serverid` text NOT NULL,
		`url_name` varchar(50) DEFAULT NULL,
		`urls` varchar(255) NOT NULL DEFAULT '',
		`ordering` int(10) unsigned NOT NULL DEFAULT '0',
		PRIMARY KEY (`pid`),
		KEY `id` (`id`)
	) ENGINE=MyISAM
";

$sql['drop'][] = " DROP TABLE `".TABLEPRE."download__channelid__` ";
$sql['drop'][] = " DROP TABLE `".TABLEPRE."downloads__channelid__` ";
?>