Added support to embed videos from DailyMotion and Vimeo. ^_^
[iDB.git] / setup / sql / pgsql.php
blob00d150fa999dc8d2e3ba7f918790fa2146724bf7
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: 12/07/2010 SVN 600 - 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);
27 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
28 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
29 " \"OrderID\" int4 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\" int4 NOT NULL default '0',\n".
35 " \"PostCountView\" int4 NOT NULL default '0',\n".
36 " \"KarmaCountView\" int4 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\" int4 NOT NULL default '0',\n".
46 " \"Name\" varchar(150) NOT NULL default '',\n".
47 " \"CategoryID\" int4 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\" int4 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\" int4 NOT NULL default '0',\n".
66 " \"TimeStampEnd\" int4 NOT NULL default '0',\n".
67 " \"EventMonth\" int4 NOT NULL default '0',\n".
68 " \"EventMonthEnd\" int4 NOT NULL default '0',\n".
69 " \"EventDay\" int4 NOT NULL default '0',\n".
70 " \"EventDayEnd\" int4 NOT NULL default '0',\n".
71 " \"EventYear\" int4 NOT NULL default '0',\n".
72 " \"EventYearEnd\" int4 NOT NULL default '0',\n".
73 " \"IP\" varchar(20) 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\" int4 NOT NULL default '0',\n".
82 " \"OrderID\" int4 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\" int4 NOT NULL default '0',\n".
87 " \"RedirectURL\" text NOT NULL,\n".
88 " \"Redirects\" int4 NOT NULL default '0',\n".
89 " \"NumViews\" int4 NOT NULL default '0',\n".
90 " \"Description\" text NOT NULL,\n".
91 " \"PostCountAdd\" varchar(15) NOT NULL default '',\n".
92 " \"PostCountView\" int4 NOT NULL default '0',\n".
93 " \"KarmaCountView\" int4 NOT NULL default '0',\n".
94 " \"CanHaveTopics\" varchar(5) NOT NULL default '',\n".
95 " \"HotTopicPosts\" int4 NOT NULL default '0',\n".
96 " \"NumPosts\" int4 NOT NULL default '0',\n".
97 " \"NumTopics\" int4 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\" int4 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 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
116 " \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
117 " \"FloodControl\" int4 NOT NULL default '0',\n".
118 " \"SearchFlood\" int4 NOT NULL default '0',\n".
119 " \"PromoteTo\" int4 NOT NULL default '0',\n".
120 " \"PromotePosts\" int4 NOT NULL default '0',\n".
121 " \"PromoteKarma\" int4 NOT NULL default '0',\n".
122 " \"HasModCP\" varchar(5) NOT NULL default '',\n".
123 " \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
124 " \"ViewDBInfo\" varchar(5) NOT NULL default '',\n".
125 " UNIQUE (\"Name\")\n".
126 ");", array(null));
127 sql_query($query,$SQLStat);
128 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanDoHTML\", \"CanUseBBags\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
129 "('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes'),\n".
130 "('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no'),\n".
131 "('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
132 "('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
133 "('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
134 "('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'yes', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null));
135 sql_query($query,$SQLStat);
136 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
137 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
138 " \"Name\" varchar(150) NOT NULL default '',\n".
139 " \"UserPassword\" varchar(250) NOT NULL default '',\n".
140 " \"HashType\" varchar(50) NOT NULL default '',\n".
141 " \"Email\" varchar(150) NOT NULL default '',\n".
142 " \"GroupID\" int4 NOT NULL default '0',\n".
143 " \"Validated\" varchar(20) NOT NULL default '',\n".
144 " \"HiddenMember\" varchar(20) NOT NULL default '',\n".
145 " \"WarnLevel\" int4 NOT NULL default '0',\n".
146 " \"Interests\" varchar(150) NOT NULL default '',\n".
147 " \"Title\" varchar(150) NOT NULL default '',\n".
148 " \"Joined\" int4 NOT NULL default '0',\n".
149 " \"LastActive\" int4 NOT NULL default '0',\n".
150 " \"LastPostTime\" int4 NOT NULL default '0',\n".
151 " \"BanTime\" int4 NOT NULL default '0',\n".
152 " \"BirthDay\" int4 NOT NULL default '0',\n".
153 " \"BirthMonth\" int4 NOT NULL default '0',\n".
154 " \"BirthYear\" int4 NOT NULL default '0',\n".
155 " \"Signature\" text NOT NULL,\n".
156 " \"Notes\" text NOT NULL,\n".
157 " \"Avatar\" varchar(150) NOT NULL default '',\n".
158 " \"AvatarSize\" varchar(10) NOT NULL default '',\n".
159 " \"Website\" varchar(150) NOT NULL default '',\n".
160 " \"Gender\" varchar(15) NOT NULL default '',\n".
161 " \"PostCount\" int4 NOT NULL default '0',\n".
162 " \"Karma\" int4 NOT NULL default '0',\n".
163 " \"KarmaUpdate\" int4 NOT NULL default '0',\n".
164 " \"RepliesPerPage\" int4 NOT NULL default '0',\n".
165 " \"TopicsPerPage\" int4 NOT NULL default '0',\n".
166 " \"MessagesPerPage\" int4 NOT NULL default '0',\n".
167 " \"TimeZone\" varchar(5) NOT NULL default '0',\n".
168 " \"DST\" varchar(5) NOT NULL default '0',\n".
169 " \"UseTheme\" varchar(32) NOT NULL default '0',\n".
170 " \"IP\" varchar(20) NOT NULL default '',\n".
171 " \"Salt\" varchar(50) NOT NULL default '',\n".
172 " UNIQUE (\"Name\"),\n".
173 " UNIQUE (\"Email\")\n".
174 ");", array(null));
175 sql_query($query,$SQLStat);
176 $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".
177 "(-1, 'Guest', '%s', '".$iDBHashType."', '%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".
178 "(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));
179 sql_query($query,$SQLStat);
180 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
181 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
182 " \"SenderID\" int4 NOT NULL default '0',\n".
183 " \"ReciverID\" int4 NOT NULL default '0',\n".
184 " \"GuestName\" varchar(150) NOT NULL default '',\n".
185 " \"MessageTitle\" varchar(150) NOT NULL default '',\n".
186 " \"MessageText\" text NOT NULL,\n".
187 " \"Description\" text NOT NULL,\n".
188 " \"DateSend\" int4 NOT NULL default '0',\n".
189 " \"Read\" int4 NOT NULL default '0',\n".
190 " \"IP\" varchar(20) NOT NULL default ''\n".
191 ");", array(null));
192 sql_query($query,$SQLStat);
193 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
194 "(-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));
195 sql_query($query,$SQLStat);
196 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
197 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
198 " \"PermissionID\" int4 NOT NULL default '0',\n".
199 " \"Name\" varchar(150) NOT NULL default '',\n".
200 " \"ForumID\" int4 NOT NULL default '0',\n".
201 " \"CanViewForum\" varchar(5) NOT NULL default '',\n".
202 " \"CanMakeTopics\" varchar(5) NOT NULL default '',\n".
203 " \"CanMakeReplys\" varchar(5) NOT NULL default '',\n".
204 " \"CanMakeReplysCT\" varchar(5) NOT NULL default '',\n".
205 " \"CanEditTopics\" varchar(5) NOT NULL default '',\n".
206 " \"CanEditTopicsCT\" varchar(5) NOT NULL default '',\n".
207 " \"CanEditReplys\" varchar(5) NOT NULL default '',\n".
208 " \"CanEditReplysCT\" varchar(5) NOT NULL default '',\n".
209 " \"CanDeleteTopics\" varchar(5) NOT NULL default '',\n".
210 " \"CanDeleteTopicsCT\" varchar(5) NOT NULL default '',\n".
211 " \"CanDeleteReplys\" varchar(5) NOT NULL default '',\n".
212 " \"CanDeleteReplysCT\" varchar(5) NOT NULL default '',\n".
213 " \"CanCloseTopics\" varchar(5) NOT NULL default '',\n".
214 " \"CanPinTopics\" varchar(5) NOT NULL default '',\n".
215 " \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
216 " \"CanUseBBags\" varchar(5) NOT NULL default '',\n".
217 " \"CanModForum\" varchar(5) NOT NULL default ''\n".
218 ");", array(null));
219 sql_query($query,$SQLStat);
220 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanDoHTML\", \"CanUseBBags\", \"CanModForum\") VALUES\n".
221 "(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
222 "(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
223 "(3, 'Member', 1, 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'yes', 'no'),\n".
224 "(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
225 "(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
226 "(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null));
227 sql_query($query,$SQLStat);
228 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
229 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
230 " \"TopicID\" int4 NOT NULL default '0',\n".
231 " \"ForumID\" int4 NOT NULL default '0',\n".
232 " \"CategoryID\" int4 NOT NULL default '0',\n".
233 " \"UserID\" int4 NOT NULL default '0',\n".
234 " \"GuestName\" varchar(150) NOT NULL default '',\n".
235 " \"TimeStamp\" int4 NOT NULL default '0',\n".
236 " \"LastUpdate\" int4 NOT NULL default '0',\n".
237 " \"EditUser\" int4 NOT NULL default '0',\n".
238 " \"EditUserName\" varchar(150) NOT NULL default '',\n".
239 " \"Post\" text NOT NULL,\n".
240 " \"Description\" text NOT NULL,\n".
241 " \"IP\" varchar(20) NOT NULL default '',\n".
242 " \"EditIP\" varchar(20) NOT NULL default ''\n".
243 ");", array(null));
244 sql_query($query,$SQLStat);
245 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
246 "(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']));
247 sql_query($query,$SQLStat);
248 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
249 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
250 " \"Word\" text NOT NULL,\n".
251 " \"RestrictedUserName\" varchar(5) NOT NULL default '',\n".
252 " \"RestrictedTopicName\" varchar(5) NOT NULL default '',\n".
253 " \"RestrictedEventName\" varchar(5) NOT NULL default '',\n".
254 " \"RestrictedMessageName\" varchar(5) NOT NULL default '',\n".
255 " \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
256 " \"WholeWord\" varchar(5) NOT NULL default ''\n".
257 ");", array(null));
258 sql_query($query,$SQLStat);
259 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
260 " \"session_id\" VARCHAR(250) PRIMARY KEY NOT NULL default '',\n".
261 " \"session_data\" text NOT NULL,\n".
262 " \"user_agent\" text NOT NULL,\n".
263 " \"ip_address\" varchar(20) NOT NULL default '',\n".
264 " \"expires\" int4 NOT NULL default '0'\n".
265 ");", array(null));
266 sql_query($query,$SQLStat);
267 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
268 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
269 " \"FileName\" text NOT NULL,\n".
270 " \"SmileName\" text NOT NULL,\n".
271 " \"SmileText\" text NOT NULL,\n".
272 " \"Directory\" text NOT NULL,\n".
273 " \"Display\" varchar(5) NOT NULL default '',\n".
274 " \"ReplaceCI\" varchar(5) NOT NULL default ''\n".
275 ");", array(null));
276 sql_query($query,$SQLStat);
277 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
278 "('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes'),\n".
279 "('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no'),\n".
280 "('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no'),\n".
281 "('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes'),\n".
282 "('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no'),\n".
283 "('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes'),\n".
284 "('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes'),\n".
285 "('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes'),\n".
286 "('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes'),\n".
287 "('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes'),\n".
288 "('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes'),\n".
289 "('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes'),\n".
290 "('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes'),\n".
291 "('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no'),\n".
292 "('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no'),\n".
293 "('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no'),\n".
294 "('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes'),\n".
295 "('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no'),\n".
296 "('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes'),\n".
297 "('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
298 sql_query($query,$SQLStat);
300 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
301 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
302 " \"UserID\" int4 NOT NULL default '0',\n".
303 " \"GuestName\" varchar(150) NOT NULL default '',\n".
304 " \"TimeStamp\" int4 NOT NULL default '0',\n".
305 " \"Post\" text NOT NULL,\n".
306 " \"IP\" varchar(20) NOT NULL default ''
307 ");", array(null));
308 sql_query($query,$SQLStat);
309 $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));
310 sql_query($query,$SQLStat);
312 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
313 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
314 " \"Name\" varchar(32) NOT NULL default '',\n".
315 " \"ThemeName\" varchar(32) NOT NULL default '',\n".
316 " \"ThemeMaker\" varchar(150) NOT NULL default '',\n".
317 " \"ThemeVersion\" varchar(150) NOT NULL default '',\n".
318 " \"ThemeVersionType\" varchar(150) NOT NULL default '',\n".
319 " \"ThemeSubVersion\" varchar(150) NOT NULL default '',\n".
320 " \"MakerURL\" varchar(150) NOT NULL default '',\n".
321 " \"CopyRight\" varchar(150) NOT NULL default '',\n".
322 " \"CSS\" text NOT NULL,\n".
323 " \"CSSType\" varchar(150) NOT NULL default '',\n".
324 " \"FavIcon\" varchar(150) NOT NULL default '',\n".
325 " \"TableStyle\" varchar(150) NOT NULL default '',\n".
326 " \"MiniPageAltStyle\" varchar(150) NOT NULL default '',\n".
327 " \"PreLogo\" varchar(150) NOT NULL default '',\n".
328 " \"Logo\" varchar(150) NOT NULL default '',\n".
329 " \"LogoStyle\" varchar(150) NOT NULL default '',\n".
330 " \"SubLogo\" varchar(150) NOT NULL default '',\n".
331 " \"TopicIcon\" varchar(150) NOT NULL default '',\n".
332 " \"MovedTopicIcon\" varchar(150) NOT NULL default '',\n".
333 " \"HotTopic\" varchar(150) NOT NULL default '',\n".
334 " \"MovedHotTopic\" varchar(150) NOT NULL default '',\n".
335 " \"PinTopic\" varchar(150) NOT NULL default '',\n".
336 " \"AnnouncementTopic\" varchar(150) NOT NULL default '',\n".
337 " \"MovedPinTopic\" varchar(150) NOT NULL default '',\n".
338 " \"HotPinTopic\" varchar(150) NOT NULL default '',\n".
339 " \"MovedHotPinTopic\" varchar(150) NOT NULL default '',\n".
340 " \"ClosedTopic\" varchar(150) NOT NULL default '',\n".
341 " \"MovedClosedTopic\" varchar(150) NOT NULL default '',\n".
342 " \"HotClosedTopic\" varchar(150) NOT NULL default '',\n".
343 " \"MovedHotClosedTopic\" varchar(150) NOT NULL default '',\n".
344 " \"PinClosedTopic\" varchar(150) NOT NULL default '',\n".
345 " \"MovedPinClosedTopic\" varchar(150) NOT NULL default '',\n".
346 " \"HotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
347 " \"MovedHotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
348 " \"MessageRead\" varchar(150) NOT NULL default '',\n".
349 " \"MessageUnread\" varchar(150) NOT NULL default '',\n".
350 " \"Profile\" varchar(150) NOT NULL default '',\n".
351 " \"WWW\" varchar(150) NOT NULL default '',\n".
352 " \"PM\" varchar(150) NOT NULL default '',\n".
353 " \"TopicLayout\" varchar(150) NOT NULL default '',\n".
354 " \"AddReply\" varchar(150) NOT NULL default '',\n".
355 " \"FastReply\" varchar(150) NOT NULL default '',\n".
356 " \"NewTopic\" varchar(150) NOT NULL default '',\n".
357 " \"QuoteReply\" varchar(150) NOT NULL default '',\n".
358 " \"EditReply\" varchar(150) NOT NULL default '',\n".
359 " \"DeleteReply\" varchar(150) NOT NULL default '',\n".
360 " \"Report\" varchar(150) NOT NULL default '',\n".
361 " \"LineDivider\" varchar(150) NOT NULL default '',\n".
362 " \"ButtonDivider\" varchar(150) NOT NULL default '',\n".
363 " \"LineDividerTopic\" varchar(150) NOT NULL default '',\n".
364 " \"TitleDivider\" varchar(150) NOT NULL default '',\n".
365 " \"ForumStyle\" varchar(150) NOT NULL default '',\n".
366 " \"ForumIcon\" varchar(150) NOT NULL default '',\n".
367 " \"SubForumIcon\" varchar(150) NOT NULL default '',\n".
368 " \"RedirectIcon\" varchar(150) NOT NULL default '',\n".
369 " \"TitleIcon\" varchar(150) NOT NULL default '',\n".
370 " \"NavLinkIcon\" varchar(150) NOT NULL default '',\n".
371 " \"NavLinkDivider\" varchar(150) NOT NULL default '',\n".
372 " \"StatsIcon\" varchar(150) NOT NULL default '',\n".
373 " \"NoAvatar\" varchar(150) NOT NULL default '',\n".
374 " \"NoAvatarSize\" varchar(150) NOT NULL default '',\n".
375 " UNIQUE (\"Name\")\n".
376 ");", array(null));
377 sql_query($query,$SQLStat);
378 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
379 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
380 " \"ForumID\" int4 NOT NULL default '0',\n".
381 " \"CategoryID\" int4 NOT NULL default '0',\n".
382 " \"OldForumID\" int4 NOT NULL default '0',\n".
383 " \"OldCategoryID\" int4 NOT NULL default '0',\n".
384 " \"UserID\" int4 NOT NULL default '0',\n".
385 " \"GuestName\" varchar(150) NOT NULL default '',\n".
386 " \"TimeStamp\" int4 NOT NULL default '0',\n".
387 " \"LastUpdate\" int4 NOT NULL default '0',\n".
388 " \"TopicName\" varchar(150) NOT NULL default '',\n".
389 " \"Description\" text NOT NULL,\n".
390 " \"NumReply\" int4 NOT NULL default '0',\n".
391 " \"NumViews\" int4 NOT NULL default '0',\n".
392 " \"Pinned\" int4 NOT NULL default '0',\n".
393 " \"Closed\" int4 NOT NULL default '0'\n".
394 ");", array(null));
395 sql_query($query,$SQLStat);
396 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."topics\" (\"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
397 "(1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
398 sql_query($query,$SQLStat);
399 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
400 " \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
401 " \"FilterWord\" text NOT NULL,\n".
402 " \"Replacement\" text NOT NULL,\n".
403 " \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
404 " \"WholeWord\" varchar(5) NOT NULL default ''\n".
405 ");", array(null));
406 sql_query($query,$SQLStat);
407 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "messenger", "permissions", "posts", "restrictedwords", "sessions", "smileys", "topics", "wordfilter");
408 $TablePreFix = $_POST['tableprefix'];
409 function add_prefix($tarray) {
410 global $TablePreFix;
411 return $TablePreFix.$tarray; }
412 $TableChCk = array_map("add_prefix",$TableChCk);
413 $tcount = count($TableChCk); $ti = 0;
414 while ($ti < $tcount) {
415 $OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
416 ++$ti; }