query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article` ( `id` int(11) NOT NULL auto_increment, `text` text NOT NULL, `date` int(11) NOT NULL default '0', `author` int(11) NOT NULL default '0', `eid` int(11) NULL default NULL, `edittime` int(11) NULL default NULL, `menue` int(11) NOT NULL default '0', `title` varchar(80) NOT NULL default '', `url` varchar(120) NOT NULL, `rightnavi` enum('false','true') NOT NULL, `active` enum('true','false') NOT NULL, PRIMARY KEY (`id`), KEY `author` (`author`), KEY `menue` (`menue`), KEY `eid` (`eid`) ) ENGINE=MyISAM"); $db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article_categories` ( `id` int(11) NOT NULL auto_increment, `categoryname` varchar(80) NOT NULL default '', `picture` varchar(80) NOT NULL default '', `active` enum('true','false') NOT NULL, PRIMARY KEY (`id`), KEY `active` (`active`) ) ENGINE=MyISAM"); $db->query("CREATE TABLE `" . $config["prefix"] . "article_category` ( `a_id` int(11) NOT NULL, `c_id` int(11) NOT NULL, KEY `a_id` (`a_id`), KEY `c_id` (`c_id`) ) ENGINE=MyISAM"); $db->query("CREATE TABLE `" . $config["prefix"] . "article_menue` ( `id` int(11) NOT NULL auto_increment, `sort` int(11) NOT NULL, `name` text NOT NULL, PRIMARY KEY (`id`), KEY `sort` (`sort`) ) ENGINE=MyISAM"); mkdir ($_SERVER["DOCUMENT_ROOT"]."/catimages", 0777); return TRUE; } function uninstall(){ global $config, $db; $db->query("DROP TABLE `" . $config["prefix"] . "article`"); $db->query("DROP TABLE `" . $config["prefix"] . "article_categories`"); $db->query("DROP TABLE `" . $config["prefix"] . "article_category`"); $db->query("DROP TABLE `" . $config["prefix"] . "article_menue`"); @$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages"); return TRUE; } function recursive($dest){ $list = array_diff(scandir($dest), array('.', '..')); foreach ($list as $value) { $file = $dest.'/'.$value; if (is_dir($file)) { recursive($file); }else{ unlink($file); } } return rmdir($dest); } } ?>