Small update to iPassword system. :P
[iDB.git] / setup / sql / pgsql.php
blob2c1571778ad61f2419d43af2bfc88b5c0fb25b99
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.
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.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
13 iDB Installer made by Game Maker 2k - http://idb.berlios.net/
15 $FileInfo: pgsql.php - Last Update: 07/13/2011 SVN 710 - Author: cooldude2k $
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/"; }
24 $query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$SQLCharset." COLLATE ".$SQLCollate.";", array(null));
25 sql_query($query,$SQLStat);
26 */numeric()
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 " \"FloodControl\" numeric(5) NOT NULL default '0',\n".
120 " \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
121 " \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
122 " \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
123 " \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
124 " \"HasModCP\" varchar(5) NOT NULL default '',\n".
125 " \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
126 " \"ViewDBInfo\" varchar(5) NOT NULL default '',\n".
127 " UNIQUE (\"Name\")\n".
128 ");", array(null));
129 sql_query($query,$SQLStat);
130 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBags\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
131 "('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes'),\n".
132 "('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no'),\n".
133 "('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
134 "('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
135 "('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
136 "('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'yes', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null));
137 sql_query($query,$SQLStat);
138 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
139 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
140 " \"Name\" varchar(150) NOT NULL default '',\n".
141 " \"UserPassword\" varchar(250) NOT NULL default '',\n".
142 " \"HashType\" varchar(50) NOT NULL default '',\n".
143 " \"Email\" varchar(256) NOT NULL default '',\n".
144 " \"GroupID\" numeric(15) NOT NULL default '0',\n".
145 " \"Validated\" varchar(20) NOT NULL default '',\n".
146 " \"HiddenMember\" varchar(20) NOT NULL default '',\n".
147 " \"WarnLevel\" numeric(15) NOT NULL default '0',\n".
148 " \"Interests\" varchar(150) NOT NULL default '',\n".
149 " \"Title\" varchar(150) NOT NULL default '',\n".
150 " \"Joined\" numeric(15) NOT NULL default '0',\n".
151 " \"LastActive\" numeric(15) NOT NULL default '0',\n".
152 " \"LastPostTime\" numeric(15) NOT NULL default '0',\n".
153 " \"BanTime\" numeric(15) NOT NULL default '0',\n".
154 " \"BirthDay\" numeric(5) NOT NULL default '0',\n".
155 " \"BirthMonth\" numeric(5) NOT NULL default '0',\n".
156 " \"BirthYear\" numeric(5) NOT NULL default '0',\n".
157 " \"Signature\" text NOT NULL,\n".
158 " \"Notes\" text NOT NULL,\n".
159 " \"Avatar\" varchar(150) NOT NULL default '',\n".
160 " \"AvatarSize\" varchar(10) NOT NULL default '',\n".
161 " \"Website\" varchar(150) NOT NULL default '',\n".
162 " \"Gender\" varchar(15) NOT NULL default '',\n".
163 " \"PostCount\" numeric(15) NOT NULL default '0',\n".
164 " \"Karma\" numeric(15) NOT NULL default '0',\n".
165 " \"KarmaUpdate\" numeric(15) NOT NULL default '0',\n".
166 " \"RepliesPerPage\" numeric(5) NOT NULL default '0',\n".
167 " \"TopicsPerPage\" numeric(5) NOT NULL default '0',\n".
168 " \"MessagesPerPage\" numeric(5) NOT NULL default '0',\n".
169 " \"TimeZone\" varchar(5) NOT NULL default '0',\n".
170 " \"DST\" varchar(5) NOT NULL default '0',\n".
171 " \"UseTheme\" varchar(32) NOT NULL default '0',\n".
172 " \"IP\" varchar(50) NOT NULL default '',\n".
173 " \"Salt\" varchar(50) NOT NULL default '',\n".
174 " UNIQUE (\"Name\"),\n".
175 " UNIQUE (\"Email\")\n".
176 ");", array(null));
177 sql_query($query,$SQLStat);
178 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"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\", \"DST\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
179 "(-1, 'Guest', '%s', 'GuestPassword', '%s', 4, 'no', 'yes', 0, 'Guest Account', 'Guest', %i, %i, '0', '0', '0', '0', '0', '[B]Test[/B] :)', 'Your Notes', 'http://', '100x100', '%s', 'UnKnow', 1, 0, 0, 10, 10, 10, '%s', '%s', '".$_POST['DefaultTheme']."', '127.0.0.1', '%s'),\n".
180 "(1, '%s', '%s', '".$iDBHashType."', '%s', 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', '".$_POST['DefaultTheme']."', '%s', '%s');", array($GuestPassword,$GEmail,$YourDate,$YourDate,$YourWebsite,$AdminTime,$AdminDST,$GSalt,$_POST['AdminUser'],$NewPassword,$_POST['AdminEmail'],$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$AdminTime,$AdminDST,$UserIP,$YourSalt));
181 sql_query($query,$SQLStat);
182 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."mempermissions\" (\n".
183 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
184 " \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
185 " \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
186 " \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
187 " \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
188 " \"CanPM\" varchar(5) NOT NULL default '',\n".
189 " \"CanSearch\" varchar(5) NOT NULL default '',\n".
190 " \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
191 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
192 " \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
193 " \"CanModForum\" varchar(5) NOT NULL default '',\n".
194 " \"FloodControl\" numeric(5) NOT NULL default '0',\n".
195 " \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
196 " \"HasModCP\" varchar(5) NOT NULL default '',\n".
197 " \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
198 " \"ViewDBInfo\" varchar(5) NOT NULL default ''\n".
199 ");", array(null));
200 sql_query($query,$SQLStat);
201 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBags\", \"CanModForum\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
202 "(-1, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group'),\n".
203 "(1, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
204 //"(-1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 'no', 'no', 'no'),\n".
205 //"(1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 'yes', 'yes', 'yes');", array(null));
206 sql_query($query,$SQLStat);
207 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
208 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
209 " \"SenderID\" numeric(15) NOT NULL default '0',\n".
210 " \"ReciverID\" numeric(15) NOT NULL default '0',\n".
211 " \"GuestName\" varchar(150) NOT NULL default '',\n".
212 " \"MessageTitle\" varchar(150) NOT NULL default '',\n".
213 " \"MessageText\" text NOT NULL,\n".
214 " \"Description\" text NOT NULL,\n".
215 " \"DateSend\" numeric(15) NOT NULL default '0',\n".
216 " \"Read\" numeric(5) NOT NULL default '0',\n".
217 " \"IP\" varchar(50) NOT NULL default ''\n".
218 ");", array(null));
219 sql_query($query,$SQLStat);
220 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
221 "(-1, 1, '".$iDB_Author."', 'Welcome', 'Welcome to your new Internet Discussion Board! :)\r\nThis is a Test PM. :P ', 'Welcome %s', %i, 0, '127.0.0.1');", array($_POST['AdminUser'],$YourDate));
222 sql_query($query,$SQLStat);
223 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
224 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
225 " \"PermissionID\" numeric(15) NOT NULL default '0',\n".
226 " \"Name\" varchar(150) NOT NULL default '',\n".
227 " \"ForumID\" numeric(15) NOT NULL default '0',\n".
228 " \"CanViewForum\" varchar(5) NOT NULL default '',\n".
229 " \"CanMakePolls\" varchar(5) NOT NULL default '',\n".
230 " \"CanMakeTopics\" varchar(5) NOT NULL default '',\n".
231 " \"CanMakeReplys\" varchar(5) NOT NULL default '',\n".
232 " \"CanMakeReplysCT\" varchar(5) NOT NULL default '',\n".
233 " \"CanEditTopics\" varchar(5) NOT NULL default '',\n".
234 " \"CanEditTopicsCT\" varchar(5) NOT NULL default '',\n".
235 " \"CanEditReplys\" varchar(5) NOT NULL default '',\n".
236 " \"CanEditReplysCT\" varchar(5) NOT NULL default '',\n".
237 " \"CanDeleteTopics\" varchar(5) NOT NULL default '',\n".
238 " \"CanDeleteTopicsCT\" varchar(5) NOT NULL default '',\n".
239 " \"CanDeleteReplys\" varchar(5) NOT NULL default '',\n".
240 " \"CanDeleteReplysCT\" varchar(5) NOT NULL default '',\n".
241 " \"CanCloseTopics\" varchar(5) NOT NULL default '',\n".
242 " \"CanPinTopics\" varchar(5) NOT NULL default '',\n".
243 " \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
244 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
245 " \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
246 " \"CanModForum\" varchar(5) NOT NULL default ''\n".
247 ");", array(null));
248 sql_query($query,$SQLStat);
249 $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\", \"CanModForum\") VALUES\n".
250 "(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
251 "(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes'),\n".
252 "(3, 'Member', 1, 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no'),\n".
253 "(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
254 "(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
255 "(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null));
256 sql_query($query,$SQLStat);
258 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."polls\" (\n".
259 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
260 " \"UserID\" numeric(15) NOT NULL default '0',\n".
261 " \"GuestName\" varchar(150) NOT NULL default '',\n".
262 " \"PollValues\" text NOT NULL,\n".
263 " \"Description\" text NOT NULL,\n".
264 " \"UsersVoted\" text NOT NULL,\n".
265 " \"IP\" varchar(50) NOT NULL default ''\n".
266 ");", array(null));
267 sql_query($query,$SQLStat);
269 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
270 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
271 " \"TopicID\" numeric(15) NOT NULL default '0',\n".
272 " \"ForumID\" numeric(15) NOT NULL default '0',\n".
273 " \"CategoryID\" numeric(15) NOT NULL default '0',\n".
274 " \"UserID\" numeric(15) NOT NULL default '0',\n".
275 " \"GuestName\" varchar(150) NOT NULL default '',\n".
276 " \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
277 " \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
278 " \"EditUser\" numeric(15) NOT NULL default '0',\n".
279 " \"EditUserName\" varchar(150) NOT NULL default '',\n".
280 " \"Post\" text NOT NULL,\n".
281 " \"Description\" text NOT NULL,\n".
282 " \"IP\" varchar(50) NOT NULL default '',\n".
283 " \"EditIP\" varchar(50) NOT NULL default ''\n".
284 ");", array(null));
285 sql_query($query,$SQLStat);
286 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
287 "(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']));
288 sql_query($query,$SQLStat);
289 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
290 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
291 " \"Word\" text NOT NULL,\n".
292 " \"RestrictedUserName\" varchar(5) NOT NULL default '',\n".
293 " \"RestrictedTopicName\" varchar(5) NOT NULL default '',\n".
294 " \"RestrictedEventName\" varchar(5) NOT NULL default '',\n".
295 " \"RestrictedMessageName\" varchar(5) NOT NULL default '',\n".
296 " \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
297 " \"WholeWord\" varchar(5) NOT NULL default ''\n".
298 ");", array(null));
299 sql_query($query,$SQLStat);
300 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
301 " \"session_id\" VARCHAR(250) PRIMARY KEY NOT NULL default '',\n".
302 " \"session_data\" text NOT NULL,\n".
303 " \"user_agent\" text NOT NULL,\n".
304 " \"ip_address\" varchar(20) NOT NULL default '',\n".
305 " \"expires\" numeric(15) NOT NULL default '0'\n".
306 ");", array(null));
307 sql_query($query,$SQLStat);
308 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
309 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
310 " \"FileName\" text NOT NULL,\n".
311 " \"SmileName\" text NOT NULL,\n".
312 " \"SmileText\" text NOT NULL,\n".
313 " \"Directory\" text NOT NULL,\n".
314 " \"Display\" varchar(5) NOT NULL default '',\n".
315 " \"ReplaceCI\" varchar(5) NOT NULL default ''\n".
316 ");", array(null));
317 sql_query($query,$SQLStat);
318 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
319 "('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes'),\n".
320 "('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no'),\n".
321 "('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no'),\n".
322 "('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes'),\n".
323 "('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no'),\n".
324 "('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes'),\n".
325 "('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes'),\n".
326 "('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes'),\n".
327 "('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes'),\n".
328 "('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes'),\n".
329 "('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes'),\n".
330 "('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes'),\n".
331 "('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes'),\n".
332 "('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no'),\n".
333 "('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no'),\n".
334 "('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no'),\n".
335 "('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes'),\n".
336 "('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no'),\n".
337 "('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes'),\n".
338 "('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
339 sql_query($query,$SQLStat);
341 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
342 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
343 " \"UserID\" numeric(15) NOT NULL default '0',\n".
344 " \"GuestName\" varchar(150) NOT NULL default '',\n".
345 " \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
346 " \"Post\" text NOT NULL,\n".
347 " \"IP\" varchar(50) NOT NULL default ''
348 ");", array(null));
349 sql_query($query,$SQLStat);
350 $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));
351 sql_query($query,$SQLStat);
353 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
354 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
355 " \"Name\" varchar(32) NOT NULL default '',\n".
356 " \"ThemeName\" varchar(32) NOT NULL default '',\n".
357 " \"ThemeMaker\" varchar(150) NOT NULL default '',\n".
358 " \"ThemeVersion\" varchar(150) NOT NULL default '',\n".
359 " \"ThemeVersionType\" varchar(150) NOT NULL default '',\n".
360 " \"ThemeSubVersion\" varchar(150) NOT NULL default '',\n".
361 " \"MakerURL\" varchar(150) NOT NULL default '',\n".
362 " \"CopyRight\" varchar(150) NOT NULL default '',\n".
363 " \"CSS\" text NOT NULL,\n".
364 " \"CSSType\" varchar(150) NOT NULL default '',\n".
365 " \"FavIcon\" varchar(150) NOT NULL default '',\n".
366 " \"TableStyle\" varchar(150) NOT NULL default '',\n".
367 " \"MiniPageAltStyle\" varchar(150) NOT NULL default '',\n".
368 " \"PreLogo\" varchar(150) NOT NULL default '',\n".
369 " \"Logo\" varchar(150) NOT NULL default '',\n".
370 " \"LogoStyle\" varchar(150) NOT NULL default '',\n".
371 " \"SubLogo\" varchar(150) NOT NULL default '',\n".
372 " \"TopicIcon\" varchar(150) NOT NULL default '',\n".
373 " \"MovedTopicIcon\" varchar(150) NOT NULL default '',\n".
374 " \"HotTopic\" varchar(150) NOT NULL default '',\n".
375 " \"MovedHotTopic\" varchar(150) NOT NULL default '',\n".
376 " \"PinTopic\" varchar(150) NOT NULL default '',\n".
377 " \"AnnouncementTopic\" varchar(150) NOT NULL default '',\n".
378 " \"MovedPinTopic\" varchar(150) NOT NULL default '',\n".
379 " \"HotPinTopic\" varchar(150) NOT NULL default '',\n".
380 " \"MovedHotPinTopic\" varchar(150) NOT NULL default '',\n".
381 " \"ClosedTopic\" varchar(150) NOT NULL default '',\n".
382 " \"MovedClosedTopic\" varchar(150) NOT NULL default '',\n".
383 " \"HotClosedTopic\" varchar(150) NOT NULL default '',\n".
384 " \"MovedHotClosedTopic\" varchar(150) NOT NULL default '',\n".
385 " \"PinClosedTopic\" varchar(150) NOT NULL default '',\n".
386 " \"MovedPinClosedTopic\" varchar(150) NOT NULL default '',\n".
387 " \"HotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
388 " \"MovedHotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
389 " \"MessageRead\" varchar(150) NOT NULL default '',\n".
390 " \"MessageUnread\" varchar(150) NOT NULL default '',\n".
391 " \"Profile\" varchar(150) NOT NULL default '',\n".
392 " \"WWW\" varchar(150) NOT NULL default '',\n".
393 " \"PM\" varchar(150) NOT NULL default '',\n".
394 " \"TopicLayout\" varchar(150) NOT NULL default '',\n".
395 " \"AddReply\" varchar(150) NOT NULL default '',\n".
396 " \"FastReply\" varchar(150) NOT NULL default '',\n".
397 " \"NewTopic\" varchar(150) NOT NULL default '',\n".
398 " \"QuoteReply\" varchar(150) NOT NULL default '',\n".
399 " \"EditReply\" varchar(150) NOT NULL default '',\n".
400 " \"DeleteReply\" varchar(150) NOT NULL default '',\n".
401 " \"Report\" varchar(150) NOT NULL default '',\n".
402 " \"LineDivider\" varchar(150) NOT NULL default '',\n".
403 " \"ButtonDivider\" varchar(150) NOT NULL default '',\n".
404 " \"LineDividerTopic\" varchar(150) NOT NULL default '',\n".
405 " \"TitleDivider\" varchar(150) NOT NULL default '',\n".
406 " \"ForumStyle\" varchar(150) NOT NULL default '',\n".
407 " \"ForumIcon\" varchar(150) NOT NULL default '',\n".
408 " \"SubForumIcon\" varchar(150) NOT NULL default '',\n".
409 " \"RedirectIcon\" varchar(150) NOT NULL default '',\n".
410 " \"TitleIcon\" varchar(150) NOT NULL default '',\n".
411 " \"NavLinkIcon\" varchar(150) NOT NULL default '',\n".
412 " \"NavLinkDivider\" varchar(150) NOT NULL default '',\n".
413 " \"StatsIcon\" varchar(150) NOT NULL default '',\n".
414 " \"NoAvatar\" varchar(150) NOT NULL default '',\n".
415 " \"NoAvatarSize\" varchar(150) NOT NULL default '',\n".
416 " UNIQUE (\"Name\")\n".
417 ");", array(null));
418 sql_query($query,$SQLStat);
419 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
420 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
421 " \"PollID\" numeric(15) NOT NULL default '0',\n".
422 " \"ForumID\" numeric(15) NOT NULL default '0',\n".
423 " \"CategoryID\" numeric(15) NOT NULL default '0',\n".
424 " \"OldForumID\" numeric(15) NOT NULL default '0',\n".
425 " \"OldCategoryID\" numeric(15) NOT NULL default '0',\n".
426 " \"UserID\" numeric(15) NOT NULL default '0',\n".
427 " \"GuestName\" varchar(150) NOT NULL default '',\n".
428 " \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
429 " \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
430 " \"TopicName\" varchar(150) NOT NULL default '',\n".
431 " \"Description\" text NOT NULL,\n".
432 " \"NumReply\" numeric(15) NOT NULL default '0',\n".
433 " \"NumViews\" numeric(15) NOT NULL default '0',\n".
434 " \"Pinned\" numeric(5) NOT NULL default '0',\n".
435 " \"Closed\" numeric(5) NOT NULL default '0'\n".
436 ");", array(null));
437 sql_query($query,$SQLStat);
438 $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".
439 "(0, 1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
440 sql_query($query,$SQLStat);
441 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
442 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
443 " \"FilterWord\" text NOT NULL,\n".
444 " \"Replacement\" text NOT NULL,\n".
445 " \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
446 " \"WholeWord\" varchar(5) NOT NULL default ''\n".
447 ");", array(null));
448 sql_query($query,$SQLStat);
449 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "topics", "wordfilter");
450 $TablePreFix = $_POST['tableprefix'];
451 function add_prefix($tarray) {
452 global $TablePreFix;
453 return $TablePreFix.$tarray; }
454 $TableChCk = array_map("add_prefix",$TableChCk);
455 $tcount = count($TableChCk); $ti = 0;
456 while ($ti < $tcount) {
457 $OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
458 ++$ti; }