Project: Webinterface II - Fidonet Messagebase Structure: MELTDOWN@SQL

AMBROSIA60-Portal  Webinterface II Project
SQL Installation Script:


	$database = array(
		"CREATE TABLE users (
			userid mediumint(8) unsigned NOT NULL auto_increment,
			level smallint(2) UNSIGNED DEFAULT '1',
			firstname varchar(25) NOT NULL,
			lastname varchar(25) NOT NULL,
			password varchar(32) NOT NULL,
			email varchar(255),
			uploads smallint(2) UNSIGNED DEFAULT '0',
			downloads smallint(2) UNSIGNED DEFAULT '0',
			regdate int(11) DEFAULT '0' NOT NULL,
			lastvisit int(11) DEFAULT '0' NOT NULL,
			language varchar(2) DEFAULT 'en',
			template varchar(32) DEFAULT 'panorama',
			PRIMARY KEY (userid)
		);",

		"CREATE TABLE areas (
			areaid int(11) unsigned NOT NULL auto_increment,
			level_list smallint(2) UNSIGNED DEFAULT '1',
			level_download smallint(2) UNSIGNED DEFAULT '1',
			level_upload smallint(2) UNSIGNED DEFAULT '1',
			level_admin smallint(2) UNSIGNED DEFAULT '100',
			name varchar(150),
			description varchar(255),
			path varchar(150),
			order_num int(11) unsigned DEFAULT '1',
			PRIMARY KEY (areaid)
		);",

		"CREATE TABLE files (
			fileid int(11) unsigned NOT NULL auto_increment,
			areaid smallint(5) UNSIGNED NOT NULL,
			uploader_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
			filename varchar(150),
			mime_type varchar(150),
			description varchar(255),
			upload_time int(11) DEFAULT '0' NOT NULL,
			downloads smallint(2) UNSIGNED DEFAULT '0',
			FULLTEXT (description),
			PRIMARY KEY (fileid),
			KEY areaid (areaid)
		);",

		"CREATE TABLE echos (
			echoid smallint(5) UNSIGNED NOT NULL auto_increment,
			name varchar(150),
			level_read smallint(2) UNSIGNED DEFAULT '1',
			level_post smallint(2) UNSIGNED DEFAULT '1',
			level_admin smallint(2) UNSIGNED DEFAULT '100',
			fidotag varchar(150),
			description varchar(150),
			aka varchar(150),
			order_num int(11) unsigned DEFAULT '1',
			PRIMARY KEY (echoid)
		);",

		"CREATE TABLE msgs (
			msgid smallint(5) UNSIGNED NOT NULL auto_increment,
			echoid smallint(5) UNSIGNED NOT NULL,
			sender varchar(36),
			recipient varchar(36),
			subject varchar(72),
			replyto smallint(5) UNSIGNED,
			datetime int(11) DEFAULT '0' NOT NULL,
			body text,
			sent tinyint(1) DEFAULT '0',
			orig_msgid varchar(80),
			orig_reply varchar(80),
			FULLTEXT (subject,body),
			PRIMARY KEY (msgid),
			KEY echoid (echoid)
		);",

		"CREATE TABLE netmail (
			msgid smallint(5) UNSIGNED NOT NULL auto_increment,
			sender varchar(36),
			recipient varchar(36),
			subject varchar(72),
			datetime int(11) DEFAULT '0' NOT NULL,
			body text,
			sent tinyint(1) DEFAULT '0',
			sourcenode varchar(50) DEFAULT '' NOT NULL,
			destnode varchar(50) DEFAULT '' NOT NULL,
			PRIMARY KEY (msgid)
		);",

		"CREATE TABLE config (
			config_name varchar(255) NOT NULL,
			config_value varchar(255) NOT NULL,
			PRIMARY KEY (config_name)
		);",
		"INSERT INTO users (level, firstname, lastname, password,
                        email, regdate, language) VALUES (100, 
                        '$admin_firstname', '$admin_lastname', '"
                        . md5($admin_password) . "',
                        '$admin_email', " . time() . ",'$language');",
		"INSERT INTO config VALUES ('bbs_name','$bbs_name')",
		"INSERT INTO config VALUES ('language','$language')",
		"INSERT INTO config VALUES ('template','$template')",
		"INSERT INTO config VALUES ('newuser_level','1')",
		"INSERT INTO config VALUES ('newuser_uploads','1')",
		"INSERT INTO config VALUES ('file_ratio','0')",
		"INSERT INTO config VALUES ('nodenumber','')",
		"INSERT INTO config VALUES ('ban_file_extensions','htm html cgi
                        php php3 phtml shtml pl sh')",
		"INSERT INTO config VALUES ('timeout','300')",
		"INSERT INTO config VALUES ('page', '50')",
		"INSERT INTO config VALUES ('version', '1021')",
		"INSERT INTO echos (echoid, name, description)
                        VALUES ('1', 'Test Forum', 'This is a test forum -
                        you can delete it after your BBS is properly
                        installed')",
		"INSERT INTO msgs (echoid, sender, recipient, subject, datetime,
                        body) VALUES ('1', 'System', '$admin_firstname
                        $admin_lastname', 'Test message', " . time() . ",
                        'This is a test message.\r\n\r\nYou can delete it
                        after your BBS is properly installed.')"

© 2003-2024 by Ulrich Schroeter   01002