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-2024 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2024 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13 iDB Installer made by Game Maker 2k - http://idb.berlios.net/
15 $FileInfo: pgsql.php - Last Update: 8/30/2024 SVN 1064 - Author: cooldude2k $
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name == "pgsql.php" ||
$File3Name == "/pgsql.php") {
22 if (!isset($SetupDir['setup'])) {
23 $SetupDir['setup'] = "setup/";
25 if (!isset($SetupDir['convert'])) {
26 $SetupDir['convert'] = "setup/convert/";
29 $query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$SQLCharset." COLLATE ".$SQLCollate.";", null);
30 sql_query($query,$SQLStat);
32 $parsestr = parse_url($YourWebsite);
33 if (!filter_var($parsestr['host'], FILTER_VALIDATE_IP
, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6
) ||
$parsestr['host'] == "localhost") {
34 $GuestLocalIP = gethostbyname($parsestr['host']);
36 $GuestLocalIP = $parsestr['host'];
38 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
39 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
40 " \"OrderID\" numeric(15) NOT NULL default '0',\n".
41 " \"Name\" varchar(150) NOT NULL default '',\n".
42 " \"ShowCategory\" varchar(5) NOT NULL default '',\n".
43 " \"CategoryType\" varchar(15) NOT NULL default '',\n".
44 " \"SubShowForums\" varchar(5) NOT NULL default '',\n".
45 " \"InSubCategory\" numeric(15) NOT NULL default '0',\n".
46 " \"PostCountView\" numeric(15) NOT NULL default '0',\n".
47 " \"KarmaCountView\" numeric(15) NOT NULL default '0',\n".
48 " \"Description\" text NOT NULL\n".
50 sql_query($query, $SQLStat);
51 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."catpermissions\" (\n".
52 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
53 " \"PermissionID\" numeric(15) NOT NULL default '0',\n".
54 " \"Name\" varchar(150) NOT NULL default '',\n".
55 " \"CategoryID\" numeric(15) NOT NULL default '0',\n".
56 " \"CanViewCategory\" varchar(5) NOT NULL default ''\n".
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(64) NOT NULL default ''\n".
75 sql_query($query, $SQLStat);
76 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."forums\" (\n".
77 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
78 " \"CategoryID\" numeric(15) NOT NULL default '0',\n".
79 " \"OrderID\" numeric(15) NOT NULL default '0',\n".
80 " \"Name\" varchar(150) NOT NULL default '',\n".
81 " \"ShowForum\" varchar(5) NOT NULL default '',\n".
82 " \"ForumType\" varchar(15) NOT NULL default '',\n".
83 " \"InSubForum\" numeric(15) NOT NULL default '0',\n".
84 " \"RedirectURL\" text NOT NULL,\n".
85 " \"Redirects\" numeric(15) NOT NULL default '0',\n".
86 " \"NumViews\" numeric(15) NOT NULL default '0',\n".
87 " \"Description\" text NOT NULL,\n".
88 " \"PostCountAdd\" varchar(15) NOT NULL default '',\n".
89 " \"PostCountView\" numeric(15) NOT NULL default '0',\n".
90 " \"KarmaCountView\" numeric(15) NOT NULL default '0',\n".
91 " \"CanHaveTopics\" varchar(5) NOT NULL default '',\n".
92 " \"HotTopicPosts\" numeric(15) NOT NULL default '0',\n".
93 " \"NumPosts\" numeric(15) NOT NULL default '0',\n".
94 " \"NumTopics\" numeric(15) NOT NULL default '0'\n".
96 sql_query($query, $SQLStat);
97 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."groups\" (\n".
98 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
99 " \"Name\" varchar(150) NOT NULL default '',\n".
100 " \"PermissionID\" numeric(15) NOT NULL default '0',\n".
101 " \"NamePrefix\" varchar(150) NOT NULL default '',\n".
102 " \"NameSuffix\" varchar(150) NOT NULL default '',\n".
103 " \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
104 " \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
105 " \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
106 " \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
107 " \"CanPM\" varchar(5) NOT NULL default '',\n".
108 " \"CanSearch\" varchar(5) NOT NULL default '',\n".
109 " \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
110 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
111 " \"CanUseBBTags\" varchar(5) NOT NULL default '',\n".
112 " \"CanModForum\" varchar(5) NOT NULL default '',\n".
113 " \"CanViewIPAddress\" varchar(5) NOT NULL default '',\n".
114 " \"CanViewUserAgent\" varchar(5) NOT NULL default '',\n".
115 " \"CanViewAnonymous\" varchar(5) NOT NULL default '',\n".
116 " \"FloodControl\" numeric(5) NOT NULL default '0',\n".
117 " \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
118 " \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
119 " \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
120 " \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
121 " \"DemoteTo\" numeric(15) NOT NULL default '0',\n".
122 " \"DemotePosts\" numeric(15) NOT NULL default '0',\n".
123 " \"DemoteKarma\" 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".
129 sql_query($query, $SQLStat);
130 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."ranks\" (\n".
131 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
132 " \"Name\" varchar(150) NOT NULL default '',\n".
133 " \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
134 " \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
135 " \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
136 " \"DemoteTo\" numeric(15) NOT NULL default '0',\n".
137 " \"DemotePosts\" numeric(15) NOT NULL default '0',\n".
138 " \"DemoteKarma\" numeric(15) NOT NULL default '0',\n".
139 " UNIQUE (\"Name\")\n".
141 sql_query($query, $SQLStat);
142 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."levels\" (\n".
143 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
144 " \"Name\" varchar(150) NOT NULL default '',\n".
145 " \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
146 " \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
147 " \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
148 " \"DemoteTo\" numeric(15) NOT NULL default '0',\n".
149 " \"DemotePosts\" numeric(15) NOT NULL default '0',\n".
150 " \"DemoteKarma\" numeric(15) NOT NULL default '0',\n".
151 " UNIQUE (\"Name\")\n".
153 sql_query($query, $SQLStat);
154 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
155 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
156 " \"Name\" varchar(150) NOT NULL default '',\n".
157 " \"Handle\" varchar(150) NOT NULL default '',\n".
158 " \"UserPassword\" varchar(256) NOT NULL default '',\n".
159 " \"HashType\" varchar(50) NOT NULL default '',\n".
160 " \"Email\" varchar(256) NOT NULL default '',\n".
161 " \"GroupID\" numeric(15) NOT NULL default '0',\n".
162 " \"LevelID\" numeric(15) NOT NULL default '0',\n".
163 " \"RankID\" numeric(15) NOT NULL default '0',\n".
164 " \"Validated\" varchar(20) NOT NULL default '',\n".
165 " \"HiddenMember\" varchar(20) NOT NULL default '',\n".
166 " \"WarnLevel\" numeric(15) NOT NULL default '0',\n".
167 " \"Interests\" text NOT NULL default '',\n".
168 " \"Title\" varchar(150) NOT NULL default '',\n".
169 " \"Joined\" numeric(15) NOT NULL default '0',\n".
170 " \"LastActive\" numeric(15) NOT NULL default '0',\n".
171 " \"LastLogin\" numeric(15) NOT NULL default '0',\n".
172 " \"LastPostTime\" numeric(15) NOT NULL default '0',\n".
173 " \"BanTime\" numeric(15) NOT NULL default '0',\n".
174 " \"BirthDay\" numeric(5) NOT NULL default '0',\n".
175 " \"BirthMonth\" numeric(5) NOT NULL default '0',\n".
176 " \"BirthYear\" numeric(5) NOT NULL default '0',\n".
177 " \"Signature\" text NOT NULL,\n".
178 " \"Notes\" text NOT NULL,\n".
179 " \"Bio\" text NOT NULL,\n".
180 " \"Avatar\" varchar(150) NOT NULL default '',\n".
181 " \"AvatarSize\" varchar(10) NOT NULL default '',\n".
182 " \"Website\" varchar(150) NOT NULL default '',\n".
183 " \"Location\" varchar(150) NOT NULL default '',\n".
184 " \"Gender\" varchar(15) NOT NULL default '',\n".
185 " \"PostCount\" numeric(15) NOT NULL default '0',\n".
186 " \"Karma\" numeric(15) NOT NULL default '0',\n".
187 " \"KarmaUpdate\" numeric(15) NOT NULL default '0',\n".
188 " \"RepliesPerPage\" numeric(5) NOT NULL default '0',\n".
189 " \"TopicsPerPage\" numeric(5) NOT NULL default '0',\n".
190 " \"MessagesPerPage\" numeric(5) NOT NULL default '0',\n".
191 " \"TimeZone\" varchar(256) NOT NULL default '',\n".
192 " \"DateFormat\" VARCHAR(15) NOT NULL default '',\n".
193 " \"TimeFormat\" VARCHAR(15) NOT NULL default '',\n".
194 " \"UseTheme\" varchar(32) NOT NULL default '',\n".
195 " \"IgnoreSignitures\" varchar(32) NOT NULL default '',\n".
196 " \"IgnoreAdvatars\" varchar(32) NOT NULL default '',\n".
197 " \"IgnoreUsers\" varchar(32) NOT NULL default '',\n".
198 " \"IP\" varchar(64) NOT NULL default '',\n".
199 " \"Salt\" varchar(50) NOT NULL default '',\n".
200 " UNIQUE (\"Name\"),\n".
201 " UNIQUE (\"Handle\"),\n".
202 " UNIQUE (\"Email\")\n".
204 sql_query($query, $SQLStat);
205 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."mempermissions\" (\n".
206 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
207 " \"PermissionID\" numeric(15) NOT NULL default '0',\n".
208 " \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
209 " \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
210 " \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
211 " \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
212 " \"CanPM\" varchar(5) NOT NULL default '',\n".
213 " \"CanSearch\" varchar(5) NOT NULL default '',\n".
214 " \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
215 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
216 " \"CanUseBBTags\" varchar(5) NOT NULL default '',\n".
217 " \"CanModForum\" varchar(5) NOT NULL default '',\n".
218 " \"CanViewIPAddress\" varchar(5) NOT NULL default '',\n".
219 " \"CanViewUserAgent\" varchar(5) NOT NULL default '',\n".
220 " \"CanViewAnonymous\" varchar(5) NOT NULL default '',\n".
221 " \"FloodControl\" numeric(5) NOT NULL default '0',\n".
222 " \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
223 " \"HasModCP\" varchar(5) NOT NULL default '',\n".
224 " \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
225 " \"ViewDBInfo\" varchar(5) NOT NULL default ''\n".
227 sql_query($query, $SQLStat);
228 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
229 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
230 " \"DiscussionID\" numeric(15) NOT NULL default '0',\n".
231 " \"SenderID\" numeric(15) NOT NULL default '0',\n".
232 " \"ReciverID\" numeric(15) NOT NULL default '0',\n".
233 " \"GuestName\" varchar(150) NOT NULL default '',\n".
234 " \"MessageTitle\" varchar(150) NOT NULL default '',\n".
235 " \"MessageText\" text NOT NULL,\n".
236 " \"Description\" text NOT NULL,\n".
237 " \"DateSend\" numeric(15) NOT NULL default '0',\n".
238 " \"Read\" numeric(5) NOT NULL default '0',\n".
239 " \"IP\" varchar(64) NOT NULL default ''\n".
241 sql_query($query, $SQLStat);
242 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
243 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
244 " \"PermissionID\" numeric(15) NOT NULL default '0',\n".
245 " \"Name\" varchar(150) NOT NULL default '',\n".
246 " \"ForumID\" numeric(15) NOT NULL default '0',\n".
247 " \"CanViewForum\" varchar(5) NOT NULL default '',\n".
248 " \"CanMakePolls\" varchar(5) NOT NULL default '',\n".
249 " \"CanMakeTopics\" varchar(5) NOT NULL default '',\n".
250 " \"CanMakeReplys\" varchar(5) NOT NULL default '',\n".
251 " \"CanMakeReplysCT\" varchar(5) NOT NULL default '',\n".
252 " \"HideEditPostInfo\" varchar(5) NOT NULL default '',\n".
253 " \"CanEditTopics\" varchar(5) NOT NULL default '',\n".
254 " \"CanEditTopicsCT\" varchar(5) NOT NULL default '',\n".
255 " \"CanEditReplys\" varchar(5) NOT NULL default '',\n".
256 " \"CanEditReplysCT\" varchar(5) NOT NULL default '',\n".
257 " \"CanDeleteTopics\" varchar(5) NOT NULL default '',\n".
258 " \"CanDeleteTopicsCT\" varchar(5) NOT NULL default '',\n".
259 " \"CanDeleteReplys\" varchar(5) NOT NULL default '',\n".
260 " \"CanDeleteReplysCT\" varchar(5) NOT NULL default '',\n".
261 " \"CanDoublePost\" varchar(5) NOT NULL default '',\n".
262 " \"CanDoublePostCT\" varchar(5) NOT NULL default '',\n".
263 " \"GotoEditPost\" varchar(5) NOT NULL default '',\n".
264 " \"CanCloseTopics\" varchar(5) NOT NULL default '',\n".
265 " \"CanCloseTopicsCT\" varchar(5) NOT NULL default '',\n".
266 " \"CanPinTopics\" varchar(5) NOT NULL default '',\n".
267 " \"CanPinTopicsCT\" varchar(5) NOT NULL default '',\n".
268 " \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
269 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
270 " \"CanUseBBTags\" varchar(5) NOT NULL default '',\n".
271 " \"CanModForum\" varchar(5) NOT NULL default '',\n".
272 " \"CanReportPost\" varchar(5) NOT NULL default ''\n".
274 sql_query($query, $SQLStat);
275 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."polls\" (\n".
276 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
277 " \"UserID\" numeric(15) NOT NULL default '0',\n".
278 " \"GuestName\" varchar(150) NOT NULL default '',\n".
279 " \"PollValues\" text NOT NULL,\n".
280 " \"Description\" text NOT NULL,\n".
281 " \"UsersVoted\" text NOT NULL,\n".
282 " \"IP\" varchar(64) NOT NULL default ''\n".
284 sql_query($query, $SQLStat);
285 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
286 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
287 " \"TopicID\" numeric(15) NOT NULL default '0',\n".
288 " \"ForumID\" numeric(15) NOT NULL default '0',\n".
289 " \"CategoryID\" numeric(15) NOT NULL default '0',\n".
290 " \"ReplyID\" numeric(15) NOT NULL default '0',\n".
291 " \"UserID\" numeric(15) NOT NULL default '0',\n".
292 " \"GuestName\" varchar(150) NOT NULL default '',\n".
293 " \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
294 " \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
295 " \"EditUser\" numeric(15) NOT NULL default '0',\n".
296 " \"EditUserName\" varchar(150) NOT NULL default '',\n".
297 " \"Post\" text NOT NULL,\n".
298 " \"Description\" text NOT NULL,\n".
299 " \"IP\" varchar(64) NOT NULL default '',\n".
300 " \"EditIP\" varchar(64) NOT NULL default ''\n".
302 sql_query($query, $SQLStat);
303 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
304 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
305 " \"Word\" text NOT NULL,\n".
306 " \"RestrictedUserName\" varchar(5) NOT NULL default '',\n".
307 " \"RestrictedTopicName\" varchar(5) NOT NULL default '',\n".
308 " \"RestrictedEventName\" varchar(5) NOT NULL default '',\n".
309 " \"RestrictedMessageName\" varchar(5) NOT NULL default '',\n".
310 " \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
311 " \"WholeWord\" varchar(5) NOT NULL default ''\n".
313 sql_query($query, $SQLStat);
314 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
315 " \"session_id\" varchar(250) PRIMARY KEY NOT NULL default '',\n".
316 " \"session_data\" text NOT NULL,\n".
317 " \"serialized_data\" text NOT NULL,\n".
318 " \"user_agent\" text NOT NULL,\n".
319 " \"client_hints\" text NOT NULL,\n".
320 " \"ip_address\" varchar(64) NOT NULL default '',\n".
321 " \"expires\" numeric(15) NOT NULL default '0'\n".
323 sql_query($query, $SQLStat);
324 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
325 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
326 " \"FileName\" text NOT NULL,\n".
327 " \"SmileName\" text NOT NULL,\n".
328 " \"SmileText\" text NOT NULL,\n".
329 " \"EmojiText\" text NOT NULL,\n".
330 " \"Directory\" text NOT NULL,\n".
331 " \"Display\" varchar(5) NOT NULL default '',\n".
332 " \"ReplaceCI\" varchar(5) NOT NULL default ''\n".
334 sql_query($query, $SQLStat);
336 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
337 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
338 " \"UserID\" numeric(15) NOT NULL default '0',\n".
339 " \"GuestName\" varchar(150) NOT NULL default '',\n".
340 " \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
341 " \"Post\" text NOT NULL,\n".
342 " \"IP\" varchar(64) NOT NULL default ''
344 sql_query($query,$SQLStat);
346 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
347 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
348 " \"Name\" varchar(32) NOT NULL default '',\n".
349 " \"ThemeName\" varchar(32) NOT NULL default '',\n".
350 " \"ThemeMaker\" varchar(150) NOT NULL default '',\n".
351 " \"ThemeVersion\" varchar(150) NOT NULL default '',\n".
352 " \"ThemeVersionType\" varchar(150) NOT NULL default '',\n".
353 " \"ThemeSubVersion\" varchar(150) NOT NULL default '',\n".
354 " \"MakerURL\" varchar(150) NOT NULL default '',\n".
355 " \"CopyRight\" varchar(150) NOT NULL default '',\n".
356 " \"WrapperString\" text NOT NULL,\n".
357 " \"CSS\" text NOT NULL,\n".
358 " \"CSSType\" varchar(150) NOT NULL default '',\n".
359 " \"FavIcon\" varchar(150) NOT NULL default '',\n".
360 " \"OpenGraph\" varchar(150) NOT NULL default '',\n".
361 " \"TableStyle\" varchar(150) NOT NULL default '',\n".
362 " \"MiniPageAltStyle\" varchar(150) NOT NULL default '',\n".
363 " \"PreLogo\" varchar(150) NOT NULL default '',\n".
364 " \"Logo\" varchar(150) NOT NULL default '',\n".
365 " \"LogoStyle\" varchar(150) NOT NULL default '',\n".
366 " \"SubLogo\" varchar(150) NOT NULL default '',\n".
367 " \"TopicIcon\" varchar(150) NOT NULL default '',\n".
368 " \"MovedTopicIcon\" varchar(150) NOT NULL default '',\n".
369 " \"HotTopic\" varchar(150) NOT NULL default '',\n".
370 " \"MovedHotTopic\" varchar(150) NOT NULL default '',\n".
371 " \"PinTopic\" varchar(150) NOT NULL default '',\n".
372 " \"AnnouncementTopic\" varchar(150) NOT NULL default '',\n".
373 " \"MovedPinTopic\" varchar(150) NOT NULL default '',\n".
374 " \"HotPinTopic\" varchar(150) NOT NULL default '',\n".
375 " \"MovedHotPinTopic\" varchar(150) NOT NULL default '',\n".
376 " \"ClosedTopic\" varchar(150) NOT NULL default '',\n".
377 " \"MovedClosedTopic\" varchar(150) NOT NULL default '',\n".
378 " \"HotClosedTopic\" varchar(150) NOT NULL default '',\n".
379 " \"MovedHotClosedTopic\" varchar(150) NOT NULL default '',\n".
380 " \"PinClosedTopic\" varchar(150) NOT NULL default '',\n".
381 " \"MovedPinClosedTopic\" varchar(150) NOT NULL default '',\n".
382 " \"HotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
383 " \"MovedHotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
384 " \"MessageRead\" varchar(150) NOT NULL default '',\n".
385 " \"MessageUnread\" varchar(150) NOT NULL default '',\n".
386 " \"Profile\" varchar(150) NOT NULL default '',\n".
387 " \"WWW\" varchar(150) NOT NULL default '',\n".
388 " \"PM\" varchar(150) NOT NULL default '',\n".
389 " \"TopicLayout\" varchar(150) NOT NULL default '',\n".
390 " \"AddReply\" varchar(150) NOT NULL default '',\n".
391 " \"FastReply\" varchar(150) NOT NULL default '',\n".
392 " \"NewTopic\" varchar(150) NOT NULL default '',\n".
393 " \"QuoteReply\" varchar(150) NOT NULL default '',\n".
394 " \"EditReply\" varchar(150) NOT NULL default '',\n".
395 " \"DeleteReply\" varchar(150) NOT NULL default '',\n".
396 " \"Report\" varchar(150) NOT NULL default '',\n".
397 " \"LineDivider\" varchar(150) NOT NULL default '',\n".
398 " \"ButtonDivider\" varchar(150) NOT NULL default '',\n".
399 " \"LineDividerTopic\" varchar(150) NOT NULL default '',\n".
400 " \"TitleDivider\" varchar(150) NOT NULL default '',\n".
401 " \"ForumStyle\" varchar(150) NOT NULL default '',\n".
402 " \"ForumIcon\" varchar(150) NOT NULL default '',\n".
403 " \"SubForumIcon\" varchar(150) NOT NULL default '',\n".
404 " \"RedirectIcon\" varchar(150) NOT NULL default '',\n".
405 " \"TitleIcon\" varchar(150) NOT NULL default '',\n".
406 " \"NavLinkIcon\" varchar(150) NOT NULL default '',\n".
407 " \"NavLinkDivider\" varchar(150) NOT NULL default '',\n".
408 " \"BoardStatsIcon\" varchar(150) NOT NULL default '',\n".
409 " \"MemberStatsIcon\" varchar(150) NOT NULL default '',\n".
410 " \"BirthdayStatsIcon\" varchar(150) NOT NULL default '',\n".
411 " \"EventStatsIcon\" varchar(150) NOT NULL default '',\n".
412 " \"OnlineStatsIcon\" varchar(150) NOT NULL default '',\n".
413 " \"NoAvatar\" varchar(150) NOT NULL default '',\n".
414 " \"NoAvatarSize\" varchar(150) NOT NULL default '',\n".
415 " UNIQUE (\"Name\")\n".
417 sql_query($query, $SQLStat);
418 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
419 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
420 " \"PollID\" numeric(15) NOT NULL default '0',\n".
421 " \"ForumID\" numeric(15) NOT NULL default '0',\n".
422 " \"CategoryID\" numeric(15) NOT NULL default '0',\n".
423 " \"OldForumID\" numeric(15) NOT NULL default '0',\n".
424 " \"OldCategoryID\" numeric(15) NOT NULL default '0',\n".
425 " \"UserID\" numeric(15) NOT NULL default '0',\n".
426 " \"GuestName\" varchar(150) NOT NULL default '',\n".
427 " \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
428 " \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
429 " \"TopicName\" varchar(150) NOT NULL default '',\n".
430 " \"Description\" text NOT NULL,\n".
431 " \"NumReply\" numeric(15) NOT NULL default '0',\n".
432 " \"NumViews\" numeric(15) NOT NULL default '0',\n".
433 " \"Pinned\" numeric(5) NOT NULL default '0',\n".
434 " \"Closed\" numeric(5) NOT NULL default '0'\n".
436 sql_query($query, $SQLStat);
437 $query = sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
438 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
439 " \"FilterWord\" text NOT NULL,\n".
440 " \"Replacement\" text NOT NULL,\n".
441 " \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
442 " \"WholeWord\" varchar(5) NOT NULL default ''\n".
444 sql_query($query, $SQLStat);
445 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "ranks", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
446 $TablePreFix = $_POST['tableprefix'];
447 function add_prefix($tarray)
450 return $TablePreFix.$tarray;
452 $TableChCk = array_map("add_prefix", $TableChCk);
453 $tcount = count($TableChCk);
455 while ($ti < $tcount) {
456 $OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", null), $SQLStat);