Location: PHPKode > projects > WB News > install/install.mysql.php
<?php

/* $Id: install.mysql.php,v 1.1.2.1 2008/05/09 23:53:18 pmcilwaine Exp $ */

$sql[] = "CREATE TABLE " . TBL_ADMINSECTIONS . " (
	\"sectionid\" int(10) unsigned auto_increment,
	\"section\" varchar(250) default NULL,
	\"displayorder\" int(11) default 0,
	PRIMARY KEY (\"sectionid\"),
	UNIQUE KEY \"section\" (\"section\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_CATEGORY ." (
	\"id\" int(11) auto_increment,
	\"name\" varchar(150) default NULL,
	\"avatar_name\" varchar(150) default NULL,
	\"avatar_url\" varchar(250) default NULL,
	PRIMARY KEY (\"id\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_CATPERMS ." (
	\"id\" int(10) unsigned auto_increment,
	\"catid\" int(10) unsigned default NULL,
	\"groupid\" int(10) unsigned default NULL,
	PRIMARY KEY (\"id\"),
	KEY \"catid\" (\"catid\", \"groupid\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_COMMENTS . " (
	\"id\" int(11) auto_increment,
	\"newsid\" int(11) default 0,
	\"message\" text,
	\"name\" varchar(150) default NULL,
	\"userid\" int(11) default 0,
	\"email\" varchar(200) default NULL,
	\"ipaddress\" varchar(15) default NULL,
	\"timeposted\" int(11) default 0,
	\"is_spam\" tinyint(4) default -1,
	PRIMARY KEY (\"id\"),
	KEY \"newsid\" (\"newsid\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_EMOTICON . " (
	\"id\" int(11) auto_increment,
	\"name\" varchar(150) default NULL,
	\"code\" varchar(20) default NULL,
	\"image\" varchar(255) default NULL,
	PRIMARY KEY (\"id\"),
	UNIQUE KEY \"code\" (\"code\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_MENU ." (
	\"id\" int(11) auto_increment,
	\"created_ts\" timestamp default '0000-00-00 00:00:00',
	\"modified\" timestamp default CURRENT_TIMESTAMP,
	\"owner\" text,
	\"label\" text,
	\"url\" text,
	\"attrs\" text,
	\"desc\" text,
	\"auth\" text,
	\"parent\" int(11) default NULL,
	\"icon\" text,
	PRIMARY KEY (\"id\"),
	KEY \"parent\" (\"parent\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_NEWS ." (
	\"id\" int(11) auto_increment,
	\"catid\" int(11) NOT NULL default '0',
	\"userid\" int(11) NOT NULL default '0',
	\"title\" varchar(150) NOT NULL default '',
	\"summary\" text NOT NULL,
	\"news\" text NOT NULL,
	\"timeposted\" int(11) NOT NULL default '0',
	\"allowcomments\" smallint(6) NOT NULL default '0',
	\"release_date\" date default NULL,
	\"archive_date\" date default NULL,
	\"publish\" int(11) default NULL,
	\"ts\" timestamp NOT NULL default CURRENT_TIMESTAMP,
	\"comments_logged_user\" smallint(6) NOT NULL,
	PRIMARY KEY  (\"id\"),
	KEY \"userid\" (\"userid\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_NEWSCONFIG . " (
	\"id\" int(11) auto_increment,
	\"sectionid\" int(11) default 0,
	\"title\" varchar(150) default NULL,
	\"description\" varchar(200) default NULL,
	\"value\" text,
	\"var\" varchar(100) default NULL,
	\"optionlist\" text,
	\"displayorder\" int(11) default 0,
	\"fieldtype\" varchar(12) default NULL,
	\"validate\" text,
	\"show\" int(11) default NULL,
	PRIMARY KEY (\"id\"),
	UNIQUE KEY \"var\" (\"var\"),
	KEY \"title\" (\"title\", \"description\", \"var\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_SEND . " (
	\"id\" int(11) auto_increment,
	\"newsid\" int(11) default 0,
	\"time\" int(11) default 0,
	\"email_to\" varchar(255) default NULL,
	\"email_from\" varchar(255) default NULL,
	\"message\" text,
	\"ipaddress\" varchar(15) default NULL,
	PRIMARY KEY (\"id\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_THEMES . " (
	\"themeid\" int(11) auto_increment,
	\"title\" varchar(100) default NULL,
	\"themepath\" varchar(200) default NULL,
	PRIMARY KEY (\"themeid\"),
	UNIQUE KEY \"title\" (\"title\", \"themepath\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE "  . TBL_UGROUPS . " (
	\"usergroupid\" int(11) auto_increment,
	\"title\" varchar(100) default NULL,
	\"group_bit\" int(11) default NULL,
	PRIMARY KEY (\"usergroupid\"),
	UNIQUE KEY \"title\" (\"title\")
	) ENGINE=InnoDB";

$sql[] = "CREATE TABLE " . TBL_USERS . " (
	\"userid\" int(11) auto_increment,
	\"usergroupid\" int(11) default 0,
	\"username\" varchar(100) default NULL,
	\"password\" varchar(100) default NULL,
	\"postname\" varchar(100) default NULL,
	\"email\" varchar(150) default NULL,
	PRIMARY KEY (\"userid\"),
	KEY \"usergroupid\" (\"usergroupid\")
	) ENGINE=InnoDB";

?>
Return current item: WB News