CREATE TABLE `%prefix%_config` ( `id` varchar(20) NOT NULL default '', `config` longtext NOT NULL, PRIMARY KEY  (`id`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_online` ( `id` varchar(40) NOT NULL default '', `time` bigint(20) default NULL, `uid` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`id`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_users` ( `uid` int(10) unsigned NOT NULL auto_increment, `name` varchar(20) NOT NULL default '', `password` varchar(32) NOT NULL default '', `class` enum('normal','admin') NOT NULL default 'normal', `realname` varchar(40) default NULL, `email` varchar(50) NOT NULL default '', `question1` varchar(20) NOT NULL default '', `question2` varchar(20) NOT NULL default '', `url` varchar(127) default NULL, `receivenews` enum('Y','N') NOT NULL default 'N', `receiverel` enum('Y','N') NOT NULL default 'N', `country` varchar(30) NOT NULL default '', `city` varchar(30) default NULL, `state` varchar(4) default NULL, `icq` varchar(12) default NULL, `aim` varchar(12) default NULL, `sex` enum('Male','Female') default NULL, `session` varchar(32) NOT NULL default '', `active` enum('Y','N') NOT NULL default 'N', `comments` mediumtext, `newsposted` int(10) unsigned NOT NULL default '0', `commentsposted` int(10) unsigned NOT NULL default '0', `faqposted` int(10) unsigned NOT NULL default '0', `topicsposted` int(10) unsigned NOT NULL default '0', `dateregistered` datetime NOT NULL default '0000-00-00 00:00:00', `dateactivated` datetime NOT NULL default '0000-00-00 00:00:00', `lastvisit` datetime NOT NULL default '0000-00-00 00:00:00', `logins` int(10) unsigned NOT NULL default '0', `newemail` varchar(50) default NULL, `newemailsess` varchar(32) default NULL, `avatar` varchar(20) default NULL, PRIMARY KEY  (`uid`), UNIQUE KEY `email` (`email`), UNIQUE KEY `name` (`name`), KEY `listInd` (`country`,`name`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_user_access` ( `userid` int(10) unsigned NOT NULL default '0', `module` char(20) NOT NULL default '', PRIMARY KEY  (`userid`,`module`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_user_book` ( `userid` int(10) unsigned NOT NULL default '0', `cod_user` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`userid`,`cod_user`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_menu` ( `pos` smallint(5) unsigned NOT NULL default '0', `title` varchar(30) NOT NULL default '', `url` varchar(127) NOT NULL default '', `type` enum('A','L','N') NOT NULL default 'A', `newwindow` ENUM('Y','N') NOT NULL DEFAULT 'N', PRIMARY KEY (`pos`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_comments` ( `cod` int(10) unsigned NOT NULL auto_increment, `type` tinyint(3) unsigned NOT NULL default '0', `link` int(10) unsigned NOT NULL default '0', `date` datetime NOT NULL default '0000-00-00 00:00:00', `userid` int(10) unsigned NOT NULL default '0', `comment` text NOT NULL, PRIMARY KEY  (`cod`), KEY `MainInd` (`type`,`link`,`date`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_downloadscat` ( `cod` int(10) unsigned NOT NULL auto_increment, `name` varchar(80) NOT NULL default '', `descr` text NOT NULL, PRIMARY KEY  (`cod`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_downloads` ( `id` int(10) unsigned NOT NULL auto_increment, `category` int(10) unsigned NOT NULL default '0', `name` varchar(30) NOT NULL default '', `active` ENUM('Y','N')  DEFAULT "N" NOT NULL, `url` varchar(255) NOT NULL default '', `date` datetime NOT NULL default '0000-00-00 00:00:00', `size` int(10) unsigned NOT NULL default '0', `count` int(10) unsigned NOT NULL default '0', `rate_sum` int(10) unsigned NOT NULL default '0', `rate_count` int(10) unsigned NOT NULL default '0', `short_description` tinytext NOT NULL, `description` text NOT NULL, `small_picture` varchar(40) NOT NULL default 'none', `big_picture` varchar(40) NOT NULL default 'none', `author_name` VARCHAR(30), `author_email` VARCHAR(50), `comments` TEXT, `url_screenshot` VARCHAR(127), PRIMARY KEY  (`id`), KEY `category` (`category`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_faq_topics` ( `cod` int(10) unsigned NOT NULL auto_increment, `name` varchar(80) NOT NULL default '', PRIMARY KEY  (`cod`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_faq` ( `cod` int(10) unsigned NOT NULL auto_increment, `topic` int(10) unsigned NOT NULL default '0', `uid` int(10) unsigned NOT NULL default '0', `active` char(1) NOT NULL default 'N', `question_ori` text NOT NULL, `question` text NOT NULL, `answer_ori` text NOT NULL, `answer` text NOT NULL, PRIMARY KEY  (`cod`), KEY `topic` (`topic`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_linkscat` (  cod int(10) unsigned NOT NULL auto_increment,  name varchar(80) NOT NULL,  descr text NOT NULL,  `parent_id` INT UNSIGNED DEFAULT "0" NOT NULL,  PRIMARY KEY (cod),  INDEX parentInd (parent_id) ) TYPE=MyISAM
CREATE TABLE `%prefix%_links` ( id int(10) unsigned NOT NULL auto_increment,  category int(10) unsigned DEFAULT '0' NOT NULL, `active` ENUM('Y','N')  DEFAULT 'N' NOT NULL,  name varchar(40) NOT NULL,  url varchar(127) NOT NULL,  count int(10) unsigned DEFAULT '0' NOT NULL,  descr text NULL, `obs` TEXT, PRIMARY KEY (id),  KEY category (category) ) TYPE=MyISAM
CREATE TABLE `%prefix%_user_msgs` ( `cod` int(10) unsigned NOT NULL auto_increment, `userid` int(10) unsigned NOT NULL default '0', `folder` enum('inbox','sent') NOT NULL default 'inbox', `date` datetime NOT NULL default '0000-00-00 00:00:00', `user_from` int(10) unsigned NOT NULL default '0', `title` varchar(80) NOT NULL default '', `msg_read` tinyint(3) unsigned NOT NULL default '0', `text` text NOT NULL, PRIMARY KEY  (`cod`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_newscat` ( `cod` int(10) unsigned NOT NULL auto_increment, `name` varchar(30) NOT NULL default '', `image` varchar(40) NOT NULL default '', PRIMARY KEY  (`cod`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_news` ( `cod` int(10) unsigned NOT NULL auto_increment, `category` int(10) unsigned NOT NULL default '0', `date` datetime NOT NULL default '0000-00-00 00:00:00', `title` varchar(80) NOT NULL default '', `userid` int(10) unsigned NOT NULL default '0', `image` varchar(40) NOT NULL default 'none', `align` varchar(20)  DEFAULT 'left' NOT NULL, `active` char(1) NOT NULL default 'N', `counter` int(10) unsigned NOT NULL default '0', `text` text, `text_ori` text, `full_text` text, `full_text_ori` text, `archived` enum('Y','N') NOT NULL default 'N', PRIMARY KEY  (`cod`), KEY `date` (`date`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_picofdaycat` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(30) NOT NULL default '', `description` mediumtext, PRIMARY KEY  (`id`), KEY `name` (`name`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_picofday` ( `id` int(10) unsigned NOT NULL auto_increment, `category` int(10) unsigned NOT NULL default '0', `userid` int(10) unsigned NOT NULL default '0', `small_picture` varchar(40) NOT NULL default 'none', `big_picture` varchar(40) NOT NULL default 'none', `description` varchar(40) default NULL, `full_description` text, `views` int(10) unsigned NOT NULL default '0', `clicks` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`id`), KEY `ClickInd` (`clicks`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_picofdaysel` ( `date` date NOT NULL default '0000-00-00', `picture_id` int(10) unsigned NOT NULL default '0', `views` int(10) unsigned NOT NULL default '0', `clicks` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`date`), KEY `picture_id` (`picture_id`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_polls` ( `cod` int(10) unsigned NOT NULL auto_increment, `dtstart` date NOT NULL default '0000-00-00', `dtend` date NOT NULL default '0000-00-00', `question` text NOT NULL, `item01` varchar(40) NOT NULL default '', `item02` varchar(40) NOT NULL default '', `item03` varchar(40) default NULL, `item04` varchar(40) default NULL, `item05` varchar(40) default NULL, `item06` varchar(40) default NULL, `item07` varchar(40) default NULL, `item08` varchar(40) default NULL, `item09` varchar(40) default NULL, `item10` varchar(40) default NULL, `count01` int(10) unsigned NOT NULL default '0', `count02` int(10) unsigned NOT NULL default '0', `count03` int(10) unsigned default '0', `count04` int(10) unsigned default '0', `count05` int(10) unsigned default '0', `count06` int(10) unsigned default '0', `count07` int(10) unsigned default NULL, `count08` int(10) unsigned default NULL, `count09` int(10) unsigned default NULL, `count10` int(10) unsigned default NULL, PRIMARY KEY  (`cod`), UNIQUE KEY `dtstInd` (`dtstart`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_banners` ( `cod` tinyint(3) unsigned NOT NULL auto_increment, `name` varchar(20) NOT NULL default '', `active` enum('Y','N') NOT NULL default 'N', `image` varchar(40) NOT NULL default '', `url_image` varchar(127) NOT NULL default '', `url` varchar(127) NOT NULL default '', `code` text, `views` int(10) unsigned NOT NULL default '0', `clicks` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`cod`), KEY `activeInd` (`active`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_banners_rawlog` ( `banner` tinyint(3) unsigned NOT NULL default '0', `type` enum('view','click') NOT NULL default 'view', `date` datetime NOT NULL default '0000-00-00 00:00:00', `session` varchar(32) NOT NULL default '', KEY `bannerInd` (`banner`,`type`,`date`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_banners_log` ( `banner` tinyint(3) unsigned NOT NULL default '0', `date` date NOT NULL default '0000-00-00', `views` int(10) unsigned NOT NULL default '0', `clicks` int(10) unsigned NOT NULL default '0', `sessions` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`banner`,`date`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_articlescat` ( `cod` int(10) unsigned NOT NULL default '0', `category` varchar(80) NOT NULL default '', PRIMARY KEY  (`cod`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_articles_title` ( `article_id` int(10) unsigned NOT NULL auto_increment, `category` int(10) unsigned NOT NULL default '0', `title` varchar(80) NOT NULL default '', `date` date NOT NULL default '0000-00-00', `userid` int(10) unsigned NOT NULL default '0', `views` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`article_id`), KEY `CatInd` (`category`,`date`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_articles` ( `cod` int(10) unsigned NOT NULL auto_increment, `article_id` int(10) unsigned NOT NULL default '0', `subtitle` varchar(127) default NULL, `page` tinyint(3) unsigned default '0', `text` longtext NOT NULL, `text_ori` longtext NOT NULL, `htmlarticle` TINYINT( 3 ) UNSIGNED DEFAULT '0', `views` int(10) unsigned NOT NULL default '0', PRIMARY KEY  (`cod`), UNIQUE KEY `ArticleInd` (`article_id`,`page`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_forums` ( `cod` int(10) unsigned NOT NULL auto_increment, `title` varchar(80) NOT NULL default '', `descr` text, `locked` enum('Y','N') default 'N', PRIMARY KEY (`cod`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_forums_mod` ( `forum` int(10) unsigned NOT NULL default '0', `userid` int(10) unsigned NOT NULL default '0', `type` enum('allowed','moderator') NOT NULL default 'allowed', PRIMARY KEY (`forum`,`userid`,`type`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_forum_msgs` ( `cod` int(10) unsigned NOT NULL auto_increment, `forum` int(10) unsigned NOT NULL default '0', `msg_ref` int(10) unsigned NOT NULL default '0', `date` datetime default NULL, `date_der` datetime default NULL, `userid` int(10) unsigned NOT NULL default '0', `views` int(10) unsigned NOT NULL default '0', `title` varchar(80) NOT NULL default '', `text` text NOT NULL, `text_ori` text NOT NULL, `closed` enum('Y','N') default 'N', PRIMARY KEY (`cod`), KEY `msg_ref`(`msg_ref`), KEY `categorie`(`forum`) ) TYPE=MyISAM
CREATE TABLE `%prefix%_sideboxes` ( `cod` int(10) unsigned NOT NULL auto_increment, `pos` int(10) unsigned NOT NULL default '0', `side` varchar(5) NOT NULL default '', `onlyindex` tinyint(3) unsigned NOT NULL default '0', `title` varchar(80) NOT NULL default '', `content` text, `file` varchar(40) NOT NULL default 'none', `type` enum('A','L','N') NOT NULL default 'A', `function` varchar(50) NULL, PRIMARY KEY  (`cod`) ) TYPE=MyISAM

INSERT INTO %prefix%_sideboxes VALUES(0,"1","left","0","Menu",NULL,"none","A","draw_menu")
INSERT INTO %prefix%_sideboxes VALUES(0,"2","left","0","Login box",NULL,"none","A","draw_login_box")
INSERT INTO %prefix%_sideboxes VALUES(0,"3","left","0","Users Online",NULL,"none","A","draw_users_online")
INSERT INTO %prefix%_sideboxes VALUES(0,"4","left","0","Admin Box",NULL,"none","L","draw_admin_box")
INSERT INTO %prefix%_sideboxes VALUES(0,"5","left","0","Pending Actions",NULL,"none","A","draw_pending_actions")
INSERT INTO %prefix%_config VALUES("core", "a:22:{s:5:\"title\";s:12:\"phpWebThings\";s:3:\"url\";s:17:\"http://localhost/\";s:8:\"keywords\";s:22:\"php,mysql,phpwebthings\";s:11:\"description\";s:56:\"phpWebThings is an application to create a cool web site\";s:10:\"name_admin\";s:9:\"Webmaster\";s:10:\"mail_admin\";s:16:\"nobody@localhost\";s:4:\"lang\";s:4:\"enus\";s:5:\"theme\";s:2:\"bg\";s:8:\"show_map\";b:0;s:11:\"date_format\";s:6:\"fmtSQL\";s:16:\"email_activation\";b:1;s:13:\"mail_new_user\";b:1;s:14:\"page_processed\";b:1;s:7:\"avatars\";b:1;s:14:\"avatars_folder\";s:12:\"var/avatars/\";s:15:\"question1_small\";s:10:\"Desktop 0S\";s:13:\"question1_big\";s:31:\"OS used to <i>develop</i> sites\";s:16:\"question1_values\";s:41:\"Linux,Windows,MAC/OS,OS/2,BeOS,Unix,Other\";s:15:\"question2_small\";s:9:\"Server OS\";s:13:\"question2_big\";s:28:\"OS used as <i>web server</i>\";s:16:\"question2_values\";s:41:\"Linux,Windows,MAC/OS,OS/2,BeOS,Unix,Other\";s:13:\"sendmail_qtde\";s:3:\"300\";}")
INSERT INTO %prefix%_config VALUES("modules", "a:13:{s:8:\"articles\";b:0;s:7:\"banners\";b:0;s:8:\"comments\";b:0;s:7:\"contact\";b:0;s:9:\"downloads\";b:0;s:4:\"faqs\";b:0;s:7:\"fileman\";b:0;s:5:\"forum\";b:0;s:5:\"links\";b:0;s:8:\"messages\";b:0;s:4:\"news\";b:0;s:8:\"picofday\";b:0;s:5:\"polls\";b:0;}")
