query("CREATE TABLE `" . $config['prefix'] . "news` ( `id` int(11) NOT NULL auto_increment, `title` varchar(60) NOT NULL default '', `text` text NOT NULL, `author` int(11) NOT NULL default '0', `date` int(11) NOT NULL default '0', `category` mediumint(9) NOT NULL default '0', `active` enum('false','true') NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM"); $db->query("CREATE TABLE `" . $config['prefix'] . "news_category` ( `id` int(11) NOT NULL auto_increment, `name` varchar(60) NOT NULL default '', `picture` varchar(60) NOT NULL, `active` enum('false','true') NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM"); mkdir ($_SERVER["DOCUMENT_ROOT"] . $config['path']."/newsimages", 0777); return TRUE; } function uninstall(){ global $config, $db; $db->query("DELETE FROM `" . $config["prefix"] . "navigation` WHERE file='frontpage_news'"); $db->query("DROP TABLE `" . $config["prefix"] . "news`"); $db->query("DROP TABLE `" . $config["prefix"] . "news_category`"); @$this->recursive($_SERVER["DOCUMENT_ROOT"]. $config['path']."/newsimages"); 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); } } ?>