OSDN Git Service

Big update to iDB timezone system. (php5 datetime instance)
[idb/iDB.git.git] / setup / sql / pgsql.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2004-2014 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2014 Game Maker 2k - http://gamemaker2k.org/
13     iDB Installer made by Game Maker 2k - http://idb.berlios.net/
14
15     $FileInfo: pgsql.php - Last Update: 07/10/2014 SVN 788 - Author: cooldude2k $
16 */
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="pgsql.php"||$File3Name=="/pgsql.php") {
19         require('index.php');
20         exit(); }
21 if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
22 if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
23 /*
24 $query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$SQLCharset." COLLATE ".$SQLCollate.";", array(null));
25 sql_query($query,$SQLStat);
26 */
27 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
28 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
29 "  \"OrderID\" numeric(15) NOT NULL default '0',\n".
30 "  \"Name\" varchar(150) NOT NULL default '',\n".
31 "  \"ShowCategory\" varchar(5) NOT NULL default '',\n".
32 "  \"CategoryType\" varchar(15) NOT NULL default '',\n".
33 "  \"SubShowForums\" varchar(5) NOT NULL default '',\n".
34 "  \"InSubCategory\" numeric(15) NOT NULL default '0',\n".
35 "  \"PostCountView\" numeric(15) NOT NULL default '0',\n".
36 "  \"KarmaCountView\" numeric(15) NOT NULL default '0',\n".
37 "  \"Description\" text NOT NULL\n".
38 ");", array(null));
39 sql_query($query,$SQLStat);
40 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."categories\" (\"OrderID\", \"Name\", \"ShowCategory\", \"CategoryType\", \"SubShowForums\", \"InSubCategory\", \"PostCountView\", \"KarmaCountView\", \"Description\")\n". 
41 "VALUES (1, 'A Test Category', 'yes', 'category', 'yes', 0, 0, 0, 'A test category that may be removed at any time.');", array(null));
42 sql_query($query,$SQLStat);
43 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."catpermissions\" (\n".
44 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
45 "  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
46 "  \"Name\" varchar(150) NOT NULL default '',\n".
47 "  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
48 "  \"CanViewCategory\" varchar(5) NOT NULL default ''\n".
49 ");", array(null));
50 sql_query($query,$SQLStat);
51 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
52 "(1, 'Admin', 1, 'yes'),\n".
53 "(2, 'Moderator', 1, 'yes'),\n".
54 "(3, 'Member', 1, 'yes'),\n".
55 "(4, 'Guest', 1, 'yes'),\n".
56 "(5, 'Banned', 1, 'no'),\n".
57 "(6, 'Validate', 1, 'yes');", array(null)); 
58 sql_query($query,$SQLStat);
59 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."events\" (\n".
60 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
61 "  \"UserID\" numeric(15) NOT NULL default '0',\n".
62 "  \"GuestName\" varchar(150) NOT NULL default '',\n".
63 "  \"EventName\" varchar(150) NOT NULL default '',\n".
64 "  \"EventText\" text NOT NULL,\n".
65 "  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
66 "  \"TimeStampEnd\" numeric(15) NOT NULL default '0',\n".
67 "  \"EventMonth\" numeric(5) NOT NULL default '0',\n".
68 "  \"EventMonthEnd\" numeric(5) NOT NULL default '0',\n".
69 "  \"EventDay\" numeric(5) NOT NULL default '0',\n".
70 "  \"EventDayEnd\" numeric(5) NOT NULL default '0',\n".
71 "  \"EventYear\" numeric(5) NOT NULL default '0',\n".
72 "  \"EventYearEnd\" numeric(5) NOT NULL default '0',\n".
73 "  \"IP\" varchar(50) NOT NULL default ''\n".
74 ");", array(null));
75 sql_query($query,$SQLStat);
76 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."events\" (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
77 "(-1, '".$iDB_Author."', 'iDB Install', 'This is the start date of your board. ^_^', %i, %i, %i, %i, %i, %i, %i, %i, '127.0.0.1');", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd));
78 sql_query($query,$SQLStat);
79 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."forums\" (\n".
80 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
81 "  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
82 "  \"OrderID\" numeric(15) NOT NULL default '0',\n".
83 "  \"Name\" varchar(150) NOT NULL default '',\n".
84 "  \"ShowForum\" varchar(5) NOT NULL default '',\n".
85 "  \"ForumType\" varchar(15) NOT NULL default '',\n".
86 "  \"InSubForum\" numeric(15) NOT NULL default '0',\n".
87 "  \"RedirectURL\" text NOT NULL,\n".
88 "  \"Redirects\" numeric(15) NOT NULL default '0',\n".
89 "  \"NumViews\" numeric(15) NOT NULL default '0',\n".
90 "  \"Description\" text NOT NULL,\n".
91 "  \"PostCountAdd\" varchar(15) NOT NULL default '',\n".
92 "  \"PostCountView\" numeric(15) NOT NULL default '0',\n".
93 "  \"KarmaCountView\" numeric(15) NOT NULL default '0',\n".
94 "  \"CanHaveTopics\" varchar(5) NOT NULL default '',\n".
95 "  \"HotTopicPosts\" numeric(15) NOT NULL default '0',\n".
96 "  \"NumPosts\" numeric(15) NOT NULL default '0',\n".
97 "  \"NumTopics\" numeric(15) NOT NULL default '0'\n".
98 ");", array(null));
99 sql_query($query,$SQLStat);
100 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."forums\" (\"CategoryID\", \"OrderID\", \"Name\", \"ShowForum\", \"ForumType\", \"InSubForum\", \"RedirectURL\", \"Redirects\", \"NumViews\", \"Description\", \"PostCountAdd\", \"PostCountView\", \"KarmaCountView\", \"CanHaveTopics\", \"HotTopicPosts\", \"NumPosts\", \"NumTopics\") VALUES\n".
101 "(1, 1, 'A Test Forum', 'yes', 'forum', 0, 'http://', 0, 0, 'A test forum that may be removed at any time.', 'off', 0, 0, 'yes', 15, 1, 1);", array(null));
102 sql_query($query,$SQLStat);
103 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."groups\" (\n".
104 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
105 "  \"Name\" varchar(150) NOT NULL default '',\n".
106 "  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
107 "  \"NamePrefix\" varchar(150) NOT NULL default '',\n".
108 "  \"NameSuffix\" varchar(150) NOT NULL default '',\n".
109 "  \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
110 "  \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
111 "  \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
112 "  \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
113 "  \"CanPM\" varchar(5) NOT NULL default '',\n".
114 "  \"CanSearch\" varchar(5) NOT NULL default '',\n".
115 "  \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
116 "  \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
117 "  \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
118 "  \"CanModForum\" varchar(5) NOT NULL default '',\n".
119 "  \"CanViewIPAddress\" varchar(5) NOT NULL default '',\n".
120 "  \"CanViewUserAgent\" varchar(5) NOT NULL default '',\n".
121 "  \"FloodControl\" numeric(5) NOT NULL default '0',\n".
122 "  \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
123 "  \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
124 "  \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
125 "  \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
126 "  \"HasModCP\" varchar(5) NOT NULL default '',\n".
127 "  \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
128 "  \"ViewDBInfo\" varchar(5) NOT NULL default '',\n".
129 "  UNIQUE (\"Name\")\n".
130 ");", array(null));
131 sql_query($query,$SQLStat);
132 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
133 "('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes'),\n".
134 "('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no'),\n".
135 "('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
136 "('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
137 "('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
138 "('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null)); 
139 sql_query($query,$SQLStat);
140 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."levels\" (\n".
141 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
142 "  \"Name\" varchar(150) NOT NULL default '',\n".
143 "  \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
144 "  \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
145 "  \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
146 "  UNIQUE (\"Name\")\n".
147 ");", array(null));
148 sql_query($query,$SQLStat);
149 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."levels\" (\"id\", \"Name\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\") VALUES\n".
150 "(-1, 'Guest', 0, 0, 0),\n".
151 "(1, 'Member', 0, 0, 0);", array(null));
152 sql_query($query,$SQLStat);
153 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
154 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
155 "  \"Name\" varchar(150) NOT NULL default '',\n".
156 "  \"UserPassword\" varchar(256) NOT NULL default '',\n".
157 "  \"HashType\" varchar(50) NOT NULL default '',\n".
158 "  \"Email\" varchar(256) NOT NULL default '',\n".
159 "  \"GroupID\" numeric(15) NOT NULL default '0',\n".
160 "  \"LevelID\" numeric(15) NOT NULL default '0',\n".
161 "  \"Validated\" varchar(20) NOT NULL default '',\n".
162 "  \"HiddenMember\" varchar(20) NOT NULL default '',\n".
163 "  \"WarnLevel\" numeric(15) NOT NULL default '0',\n".
164 "  \"Interests\" text NOT NULL default '',\n".
165 "  \"Title\" varchar(150) NOT NULL default '',\n".
166 "  \"Joined\" numeric(15) NOT NULL default '0',\n".
167 "  \"LastActive\" numeric(15) NOT NULL default '0',\n".
168 "  \"LastPostTime\" numeric(15) NOT NULL default '0',\n".
169 "  \"BanTime\" numeric(15) NOT NULL default '0',\n".
170 "  \"BirthDay\" numeric(5) NOT NULL default '0',\n".
171 "  \"BirthMonth\" numeric(5) NOT NULL default '0',\n".
172 "  \"BirthYear\" numeric(5) NOT NULL default '0',\n".
173 "  \"Signature\" text NOT NULL,\n".
174 "  \"Notes\" text NOT NULL,\n".
175 "  \"Avatar\" varchar(150) NOT NULL default '',\n".
176 "  \"AvatarSize\" varchar(10) NOT NULL default '',\n".
177 "  \"Website\" varchar(150) NOT NULL default '',\n".
178 "  \"Gender\" varchar(15) NOT NULL default '',\n".
179 "  \"PostCount\" numeric(15) NOT NULL default '0',\n".
180 "  \"Karma\" numeric(15) NOT NULL default '0',\n".
181 "  \"KarmaUpdate\" numeric(15) NOT NULL default '0',\n".
182 "  \"RepliesPerPage\" numeric(5) NOT NULL default '0',\n".
183 "  \"TopicsPerPage\" numeric(5) NOT NULL default '0',\n".
184 "  \"MessagesPerPage\" numeric(5) NOT NULL default '0',\n".
185 "  \"TimeZone\" varchar(256) NOT NULL default '0',\n".
186 "  \"DateFormat\" VARCHAR(15) NOT NULL default '0',\n".
187 "  \"TimeFormat\" VARCHAR(15) NOT NULL default '0',\n".
188 "  \"UseTheme\" varchar(32) NOT NULL default '0',\n".
189 "  \"IP\" varchar(50) NOT NULL default '',\n".
190 "  \"Salt\" varchar(50) NOT NULL default '',\n".
191 "  UNIQUE (\"Name\"),\n".
192 "  UNIQUE (\"Email\")\n".
193 ");", array(null));
194 sql_query($query,$SQLStat);
195 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"LevelID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
196 "(-1, 'Guest', '%s', 'GuestPassword', '%s', 4, -1, 'no', 'yes', 0, 'Guest Account', 'Guest', %i, %i, '0', '0', '0', '0', '0', '', 'Your Notes', 'http://', '100x100', '%s', 'UnKnow', 1, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '127.0.0.1', '%s'),\n".
197 "(1, '%s', '%s', '".$iDBHashType."', '%s', 1, 1, 'yes', 'no', 0, '%s', 'Admin', %i, %i, '0', '0', '0', '0', '0', '%s', 'Your Notes', '%s', '100x100', '%s', 'UnKnow', 0, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '%s', '%s');", array($GuestPassword,$GEmail,$YourDate,$YourDate,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$GSalt,$_POST['AdminUser'],$NewPassword,$_POST['AdminEmail'],$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$UserIP,$YourSalt));
198 sql_query($query,$SQLStat);
199 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."mempermissions\" (\n".
200 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
201 "  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
202 "  \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
203 "  \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
204 "  \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
205 "  \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
206 "  \"CanPM\" varchar(5) NOT NULL default '',\n".
207 "  \"CanSearch\" varchar(5) NOT NULL default '',\n".
208 "  \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
209 "  \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
210 "  \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
211 "  \"CanModForum\" varchar(5) NOT NULL default '',\n".
212 "  \"CanViewIPAddress\" varchar(5) NOT NULL default '',\n".
213 "  \"CanViewUserAgent\" varchar(5) NOT NULL default '',\n".
214 "  \"FloodControl\" numeric(5) NOT NULL default '0',\n".
215 "  \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
216 "  \"HasModCP\" varchar(5) NOT NULL default '',\n".
217 "  \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
218 "  \"ViewDBInfo\" varchar(5) NOT NULL default ''\n".
219 ");", array(null));
220 sql_query($query,$SQLStat);
221 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
222 "(-1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group'),\n".
223 "(1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
224 //"(-1, 0, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 'no', 'no', 'no'),\n".
225 //"(1, 0, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 'yes', 'yes', 'yes');", array(null));
226 sql_query($query,$SQLStat);
227 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
228 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
229 "  \"DiscussionID\" numeric(15) NOT NULL default '0',\n".
230 "  \"SenderID\" numeric(15) NOT NULL default '0',\n".
231 "  \"ReciverID\" numeric(15) NOT NULL default '0',\n".
232 "  \"GuestName\" varchar(150) NOT NULL default '',\n".
233 "  \"MessageTitle\" varchar(150) NOT NULL default '',\n".
234 "  \"MessageText\" text NOT NULL,\n".
235 "  \"Description\" text NOT NULL,\n".
236 "  \"DateSend\" numeric(15) NOT NULL default '0',\n".
237 "  \"Read\" numeric(5) NOT NULL default '0',\n".
238 "  \"IP\" varchar(50) NOT NULL default ''\n".
239 ");", array(null));
240 sql_query($query,$SQLStat);
241 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"DiscussionID\", \"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
242 "(0, -1, 1, '".$iDB_Author."', 'Welcome', 'Welcome to your new Internet Discussion Board! :)', 'Welcome %s', %i, 0, '127.0.0.1');", array($_POST['AdminUser'],$YourDate));
243 sql_query($query,$SQLStat);
244 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
245 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
246 "  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
247 "  \"Name\" varchar(150) NOT NULL default '',\n".
248 "  \"ForumID\" numeric(15) NOT NULL default '0',\n".
249 "  \"CanViewForum\" varchar(5) NOT NULL default '',\n".
250 "  \"CanMakePolls\" varchar(5) NOT NULL default '',\n".
251 "  \"CanMakeTopics\" varchar(5) NOT NULL default '',\n".
252 "  \"CanMakeReplys\" varchar(5) NOT NULL default '',\n".
253 "  \"CanMakeReplysCT\" varchar(5) NOT NULL default '',\n".
254 "  \"CanEditTopics\" varchar(5) NOT NULL default '',\n".
255 "  \"CanEditTopicsCT\" varchar(5) NOT NULL default '',\n".
256 "  \"CanEditReplys\" varchar(5) NOT NULL default '',\n".
257 "  \"CanEditReplysCT\" varchar(5) NOT NULL default '',\n".
258 "  \"CanDeleteTopics\" varchar(5) NOT NULL default '',\n".
259 "  \"CanDeleteTopicsCT\" varchar(5) NOT NULL default '',\n".
260 "  \"CanDeleteReplys\" varchar(5) NOT NULL default '',\n".
261 "  \"CanDeleteReplysCT\" varchar(5) NOT NULL default '',\n".
262 "  \"CanCloseTopics\" varchar(5) NOT NULL default '',\n".
263 "  \"CanPinTopics\" varchar(5) NOT NULL default '',\n".
264 "  \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
265 "  \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
266 "  \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
267 "  \"CanModForum\" varchar(5) NOT NULL default ''\n".
268 ");", array(null));
269 sql_query($query,$SQLStat);
270 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBags\", \"CanModForum\") VALUES\n".
271 "(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
272 "(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes'),\n".
273 "(3, 'Member', 1, 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no'),\n".
274 "(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
275 "(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
276 "(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null)); 
277 sql_query($query,$SQLStat);
278 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."polls\" (\n".
279 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
280 "  \"UserID\" numeric(15) NOT NULL default '0',\n".
281 "  \"GuestName\" varchar(150) NOT NULL default '',\n".
282 "  \"PollValues\" text NOT NULL,\n".
283 "  \"Description\" text NOT NULL,\n".
284 "  \"UsersVoted\" text NOT NULL,\n".
285 "  \"IP\" varchar(50) NOT NULL default ''\n".
286 ");", array(null));
287 sql_query($query,$SQLStat);
288 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
289 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
290 "  \"TopicID\" numeric(15) NOT NULL default '0',\n".
291 "  \"ForumID\" numeric(15) NOT NULL default '0',\n".
292 "  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
293 "  \"UserID\" numeric(15) NOT NULL default '0',\n".
294 "  \"GuestName\" varchar(150) NOT NULL default '',\n".
295 "  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
296 "  \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
297 "  \"EditUser\" numeric(15) NOT NULL default '0',\n".
298 "  \"EditUserName\" varchar(150) NOT NULL default '',\n".
299 "  \"Post\" text NOT NULL,\n".
300 "  \"Description\" text NOT NULL,\n".
301 "  \"IP\" varchar(50) NOT NULL default '',\n".
302 "  \"EditIP\" varchar(50) NOT NULL default ''\n".
303 ");", array(null));
304 sql_query($query,$SQLStat);
305 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
306 "(1, 1, 1, -1, '".$iDB_Author."', %i, %i, 1, '".$_POST['AdminUser']."', 'Welcome to your new Internet Discussion Board! :) ', 'Welcome %s', '127.0.0.1', '127.0.0.1');", array($YourDate,$YourEditDate,$_POST['AdminUser'])); 
307 sql_query($query,$SQLStat);
308 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
309 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
310 "  \"Word\" text NOT NULL,\n".
311 "  \"RestrictedUserName\" varchar(5) NOT NULL default '',\n".
312 "  \"RestrictedTopicName\" varchar(5) NOT NULL default '',\n".
313 "  \"RestrictedEventName\" varchar(5) NOT NULL default '',\n".
314 "  \"RestrictedMessageName\" varchar(5) NOT NULL default '',\n".
315 "  \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
316 "  \"WholeWord\" varchar(5) NOT NULL default ''\n".
317 ");", array(null));
318 sql_query($query,$SQLStat);
319 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
320 "  \"session_id\" VARCHAR(250) PRIMARY KEY NOT NULL default '',\n".
321 "  \"session_data\" text NOT NULL,\n".
322 "  \"serialized_data\" text NOT NULL,\n".
323 "  \"user_agent\" text NOT NULL,\n".
324 "  \"ip_address\" varchar(20) NOT NULL default '',\n".
325 "  \"expires\" numeric(15) NOT NULL default '0'\n".
326 ");", array(null));
327 sql_query($query,$SQLStat);
328 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
329 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
330 "  \"FileName\" text NOT NULL,\n".
331 "  \"SmileName\" text NOT NULL,\n".
332 "  \"SmileText\" text NOT NULL,\n".
333 "  \"Directory\" text NOT NULL,\n".
334 "  \"Display\" varchar(5) NOT NULL default '',\n".
335 "  \"ReplaceCI\" varchar(5) NOT NULL default ''\n".
336 ");", array(null));
337 sql_query($query,$SQLStat);
338 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
339 "('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes'),\n".
340 "('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no'),\n".
341 "('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no'),\n".
342 "('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes'),\n".
343 "('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no'),\n".
344 "('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes'),\n".
345 "('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes'),\n".
346 "('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes'),\n".
347 "('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes'),\n".
348 "('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes'),\n".
349 "('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes'),\n".
350 "('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes'),\n".
351 "('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes'),\n".
352 "('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no'),\n".
353 "('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no'),\n".
354 "('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no'),\n".
355 "('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes'),\n".
356 "('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no'),\n".
357 "('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes'),\n".
358 "('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
359 sql_query($query,$SQLStat);
360 /*
361 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
362 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
363 "  \"UserID\" numeric(15) NOT NULL default '0',\n".
364 "  \"GuestName\" varchar(150) NOT NULL default '',\n".
365 "  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
366 "  \"Post\" text NOT NULL,\n".
367 "  \"IP\" varchar(50) NOT NULL default ''
368 ");", array(null));
369 sql_query($query,$SQLStat);
370 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."tagboard\" VALUES (1,-1,'".$iDB_Author."',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); 
371 sql_query($query,$SQLStat);
372 */
373 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
374 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
375 "  \"Name\" varchar(32) NOT NULL default '',\n".
376 "  \"ThemeName\" varchar(32) NOT NULL default '',\n".
377 "  \"ThemeMaker\" varchar(150) NOT NULL default '',\n".
378 "  \"ThemeVersion\" varchar(150) NOT NULL default '',\n".
379 "  \"ThemeVersionType\" varchar(150) NOT NULL default '',\n".
380 "  \"ThemeSubVersion\" varchar(150) NOT NULL default '',\n".
381 "  \"MakerURL\" varchar(150) NOT NULL default '',\n".
382 "  \"CopyRight\" varchar(150) NOT NULL default '',\n".
383 "  \"WrapperString\" text NOT NULL,\n".
384 "  \"CSS\" text NOT NULL,\n".
385 "  \"CSSType\" varchar(150) NOT NULL default '',\n".
386 "  \"FavIcon\" varchar(150) NOT NULL default '',\n".
387 "  \"TableStyle\" varchar(150) NOT NULL default '',\n".
388 "  \"MiniPageAltStyle\" varchar(150) NOT NULL default '',\n".
389 "  \"PreLogo\" varchar(150) NOT NULL default '',\n".
390 "  \"Logo\" varchar(150) NOT NULL default '',\n".
391 "  \"LogoStyle\" varchar(150) NOT NULL default '',\n".
392 "  \"SubLogo\" varchar(150) NOT NULL default '',\n".
393 "  \"TopicIcon\" varchar(150) NOT NULL default '',\n".
394 "  \"MovedTopicIcon\" varchar(150) NOT NULL default '',\n".
395 "  \"HotTopic\" varchar(150) NOT NULL default '',\n".
396 "  \"MovedHotTopic\" varchar(150) NOT NULL default '',\n".
397 "  \"PinTopic\" varchar(150) NOT NULL default '',\n".
398 "  \"AnnouncementTopic\" varchar(150) NOT NULL default '',\n".
399 "  \"MovedPinTopic\" varchar(150) NOT NULL default '',\n".
400 "  \"HotPinTopic\" varchar(150) NOT NULL default '',\n".
401 "  \"MovedHotPinTopic\" varchar(150) NOT NULL default '',\n".
402 "  \"ClosedTopic\" varchar(150) NOT NULL default '',\n".
403 "  \"MovedClosedTopic\" varchar(150) NOT NULL default '',\n".
404 "  \"HotClosedTopic\" varchar(150) NOT NULL default '',\n".
405 "  \"MovedHotClosedTopic\" varchar(150) NOT NULL default '',\n".
406 "  \"PinClosedTopic\" varchar(150) NOT NULL default '',\n".
407 "  \"MovedPinClosedTopic\" varchar(150) NOT NULL default '',\n".
408 "  \"HotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
409 "  \"MovedHotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
410 "  \"MessageRead\" varchar(150) NOT NULL default '',\n".
411 "  \"MessageUnread\" varchar(150) NOT NULL default '',\n".
412 "  \"Profile\" varchar(150) NOT NULL default '',\n".
413 "  \"WWW\" varchar(150) NOT NULL default '',\n".
414 "  \"PM\" varchar(150) NOT NULL default '',\n".
415 "  \"TopicLayout\" varchar(150) NOT NULL default '',\n".
416 "  \"AddReply\" varchar(150) NOT NULL default '',\n".
417 "  \"FastReply\" varchar(150) NOT NULL default '',\n".
418 "  \"NewTopic\" varchar(150) NOT NULL default '',\n".
419 "  \"QuoteReply\" varchar(150) NOT NULL default '',\n".
420 "  \"EditReply\" varchar(150) NOT NULL default '',\n".
421 "  \"DeleteReply\" varchar(150) NOT NULL default '',\n".
422 "  \"Report\" varchar(150) NOT NULL default '',\n".
423 "  \"LineDivider\" varchar(150) NOT NULL default '',\n".
424 "  \"ButtonDivider\" varchar(150) NOT NULL default '',\n".
425 "  \"LineDividerTopic\" varchar(150) NOT NULL default '',\n".
426 "  \"TitleDivider\" varchar(150) NOT NULL default '',\n".
427 "  \"ForumStyle\" varchar(150) NOT NULL default '',\n".
428 "  \"ForumIcon\" varchar(150) NOT NULL default '',\n".
429 "  \"SubForumIcon\" varchar(150) NOT NULL default '',\n".
430 "  \"RedirectIcon\" varchar(150) NOT NULL default '',\n".
431 "  \"TitleIcon\" varchar(150) NOT NULL default '',\n".
432 "  \"NavLinkIcon\" varchar(150) NOT NULL default '',\n".
433 "  \"NavLinkDivider\" varchar(150) NOT NULL default '',\n".
434 "  \"StatsIcon\" varchar(150) NOT NULL default '',\n".
435 "  \"NoAvatar\" varchar(150) NOT NULL default '',\n".
436 "  \"NoAvatarSize\" varchar(150) NOT NULL default '',\n".
437 "  UNIQUE (\"Name\")\n".
438 ");", array(null));
439 sql_query($query,$SQLStat);
440 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
441 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
442 "  \"PollID\" numeric(15) NOT NULL default '0',\n".
443 "  \"ForumID\" numeric(15) NOT NULL default '0',\n".
444 "  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
445 "  \"OldForumID\" numeric(15) NOT NULL default '0',\n".
446 "  \"OldCategoryID\" numeric(15) NOT NULL default '0',\n".
447 "  \"UserID\" numeric(15) NOT NULL default '0',\n".
448 "  \"GuestName\" varchar(150) NOT NULL default '',\n".
449 "  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
450 "  \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
451 "  \"TopicName\" varchar(150) NOT NULL default '',\n".
452 "  \"Description\" text NOT NULL,\n".
453 "  \"NumReply\" numeric(15) NOT NULL default '0',\n".
454 "  \"NumViews\" numeric(15) NOT NULL default '0',\n".
455 "  \"Pinned\" numeric(5) NOT NULL default '0',\n".
456 "  \"Closed\" numeric(5) NOT NULL default '0'\n".
457 ");", array(null));
458 sql_query($query,$SQLStat);
459 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."topics\" (\"PollID\", \"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
460 "(0, 1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
461 sql_query($query,$SQLStat);
462 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
463 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
464 "  \"FilterWord\" text NOT NULL,\n".
465 "  \"Replacement\" text NOT NULL,\n".
466 "  \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
467 "  \"WholeWord\" varchar(5) NOT NULL default ''\n".
468 ");", array(null));
469 sql_query($query,$SQLStat);
470 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
471 $TablePreFix = $_POST['tableprefix'];
472 function add_prefix($tarray) {
473 global $TablePreFix;
474 return $TablePreFix.$tarray; }
475 $TableChCk = array_map("add_prefix",$TableChCk);
476 $tcount = count($TableChCk); $ti = 0;
477 while ($ti < $tcount) {
478 $OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
479 ++$ti; }
480 ?>