~cruzjbishop/anelectron/trunk

« back to all changes in this revision

Viewing changes to setup/mysql.php

  • Committer: Cruz Julian Bishop
  • Date: 2012-03-18 22:16:46 UTC
  • Revision ID: cruzjbishop@gmail.com-20120318221646-se8p54bd2g7i936n
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
//////////////////////////////////////////////////////////////
 
4
//===========================================================
 
5
// mysql.php(Setup)
 
6
//===========================================================
 
7
// AEF : Advanced Electron Forum 
 
8
// Version : 1.0.9
 
9
// Inspired by Pulkit and taken over by Electron
 
10
// ----------------------------------------------------------
 
11
// Started by: Electron, Ronak Gupta, Pulkit Gupta
 
12
// Date:       23rd Jan 2006
 
13
// Time:       15:00 hrs
 
14
// Site:       http://www.anelectron.com/ (Anelectron)
 
15
// ----------------------------------------------------------
 
16
// Please Read the Terms of use at http://www.anelectron.com
 
17
// ----------------------------------------------------------
 
18
//===========================================================
 
19
// (C)AEF Group All Rights Reserved.
 
20
//===========================================================
 
21
//////////////////////////////////////////////////////////////
 
22
 
 
23
 
 
24
$queries = array();
 
25
 
 
26
 
 
27
//$queries[] = "";
 
28
 
 
29
if (!empty($utf8)) {
 
30
 
 
31
    $queries[] = "ALTER DATABASE " . $database . "
 
32
                            CHARACTER SET utf8
 
33
                            DEFAULT CHARACTER SET utf8
 
34
                            COLLATE utf8_general_ci
 
35
                            DEFAULT COLLATE utf8_general_ci";
 
36
}
 
37
 
 
38
//Apps - Applications #1
 
39
$queries[] = "CREATE TABLE " . $dbprefix . "apps (
 
40
  `apid` mediumint(8) NOT NULL auto_increment,
 
41
  `ap_name` varchar(100) NOT NULL default '',
 
42
  `ap_version` varchar(15) NOT NULL default '',
 
43
  `installed_time` int(10) NOT NULL default '0',
 
44
  `ap_info` varchar(255) NOT NULL default '',
 
45
  PRIMARY KEY  (`apid`)
 
46
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
47
 
 
48
 
 
49
//Apps Registry - Applications Registry #2
 
50
$queries[] = "CREATE TABLE " . $dbprefix . "apps_registry (
 
51
  `apid` mediumint(8) NOT NULL default '0',
 
52
  `uid` mediumint(8) NOT NULL default '0',
 
53
  `apps_registry` text NOT NULL,
 
54
  UNIQUE KEY `apid` (`apid`,`uid`)
 
55
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
56
 
 
57
 
 
58
//Attachment Mimetypes #3
 
59
$queries[] = "CREATE TABLE " . $dbprefix . "attachment_mimetypes (
 
60
  atmtid smallint(5) NOT NULL auto_increment,
 
61
  atmt_ext varchar(20) NOT NULL default '',
 
62
  atmt_mimetype varchar(255) NOT NULL default '',
 
63
  atmt_icon tinytext NOT NULL,
 
64
  atmt_posts tinyint(2) NOT NULL default '0',
 
65
  atmt_avatar tinyint(2) NOT NULL default '0',
 
66
  atmt_isimage tinyint(2) NOT NULL default '0',
 
67
  PRIMARY KEY  (atmtid)
 
68
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
69
 
 
70
//Data for Attacment Mimetypes #4
 
71
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (1, 'png', 'image/png', 'png.png', 1, 1, 1)";
 
72
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (2, 'jpg', 'image/jpeg', 'jpg.png', 1, 1, 1)"; #5
 
73
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (3, 'gif', 'image/gif', 'gif.png', 1, 1, 1)"; #6
 
74
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (4, 'bmp', 'image/bitmap', 'bmp.png', 1, 1, 1)"; #7
 
75
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (5, 'tiff', 'image/tiff', 'tiff.png', 1, 1, 1)"; #8
 
76
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (6, 'txt', 'plain/text', 'txt.png', 1, 0, 0)"; #9
 
77
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (7, 'jpeg', 'image/jpeg', 'jpg.png', 1, 1, 1)"; #10
 
78
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (8, 'doc', 'application/msword', 'doc.png', 1, 0, 0)"; #11
 
79
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (9, 'mpg', 'video/mpeg', 'mpg.png', 1, 0, 0)"; #12
 
80
$queries[] = "INSERT INTO " . $dbprefix . "attachment_mimetypes VALUES (10, 'zip', 'application/zip', 'zip.png', 1, 0, 0)"; #13
 
81
//Attachments #14
 
82
$queries[] = "CREATE TABLE " . $dbprefix . "attachments (
 
83
  atid mediumint(8) NOT NULL auto_increment,
 
84
  at_original_file tinytext NOT NULL,
 
85
  at_file tinytext NOT NULL,
 
86
  at_mimetype_id smallint(5) NOT NULL default '0',
 
87
  at_size int(10) NOT NULL default '0',
 
88
  at_fid smallint(5) NOT NULL default '0',
 
89
  at_pid int(10) NOT NULL default '0',
 
90
  at_downloads int(10) NOT NULL default '0',
 
91
  at_time int(10) NOT NULL default '0',
 
92
  at_mid mediumint(8) NOT NULL default '0',
 
93
  at_width smallint(5) NOT NULL default '0',
 
94
  at_height smallint(5) NOT NULL default '0',
 
95
  PRIMARY KEY  (atid)
 
96
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
97
 
 
98
//Categories #15
 
99
$queries[] = "CREATE TABLE " . $dbprefix . "categories (
 
100
  cid smallint(5) NOT NULL auto_increment,
 
101
  name tinytext NOT NULL,
 
102
  `order` smallint(5) NOT NULL default '0',
 
103
  collapsable tinyint(2) NOT NULL default '1',
 
104
  PRIMARY KEY  (cid)
 
105
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
106
 
 
107
$queries[] = "INSERT INTO " . $dbprefix . "categories VALUES (1, 'General Stuff', 1, 1)";
 
108
 
 
109
//Errors #16
 
110
$queries[] = "CREATE TABLE " . $dbprefix . "errors (
 
111
  type tinyint(3) NOT NULL default '0',
 
112
  id mediumint(5) NOT NULL default '0'
 
113
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
114
 
 
115
//Forum Permissions #17
 
116
$queries[] = "CREATE TABLE " . $dbprefix . "forumpermissions (
 
117
  fpfid smallint(5) NOT NULL default '0',
 
118
  fpugid mediumint(5) NOT NULL default '0',
 
119
  can_post_topic tinyint(2) NOT NULL default '0',
 
120
  can_reply tinyint(2) NOT NULL default '0',
 
121
  can_vote_polls tinyint(2) NOT NULL default '0',
 
122
  can_post_polls tinyint(2) NOT NULL default '0',
 
123
  can_attach tinyint(2) NOT NULL default '0',
 
124
  can_view_attach tinyint(2) NOT NULL default '0',
 
125
  UNIQUE KEY fpfid (fpfid,fpugid)
 
126
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
127
 
 
128
//Forums #18
 
129
$queries[] = "CREATE TABLE " . $dbprefix . "forums (
 
130
  `fid` smallint(5) NOT NULL auto_increment,
 
131
  `cat_id` smallint(5) NOT NULL default '0',
 
132
  `par_board_id` smallint(5) NOT NULL default '0',
 
133
  `forum_order` smallint(5) NOT NULL default '0',
 
134
  `member_group` tinytext NOT NULL,
 
135
  `fname` tinytext NOT NULL,
 
136
  `description` tinytext NOT NULL,
 
137
  `fimage` tinytext NOT NULL,
 
138
  `fredirect` tinytext NOT NULL,
 
139
  `ntopic` mediumint(8) NOT NULL default '0',
 
140
  `nposts` mediumint(8) NOT NULL default '0',
 
141
  `status` tinyint(3) NOT NULL default '1',
 
142
  `prune` tinyint(3) NOT NULL default '0',
 
143
  `allow_poll` tinyint(2) NOT NULL default '0',
 
144
  `allow_html` tinyint(2) NOT NULL default '0',
 
145
  `id_skin` smallint(5) NOT NULL default '0',
 
146
  `override_skin` tinyint(2) NOT NULL default '0',
 
147
  `inc_mem_posts` tinyint(2) NOT NULL default '1',
 
148
  `quick_reply` tinyint(2) NOT NULL default '0',
 
149
  `quick_topic` tinyint(2) NOT NULL default '0',
 
150
  `f_last_pid` int(10) NOT NULL default '0',
 
151
  `frulestitle` tinytext NOT NULL,
 
152
  `frules` text NOT NULL,
 
153
  `mod_topics` tinyint(2) NOT NULL default '0',
 
154
  `mod_posts` tinyint(2) NOT NULL default '0',
 
155
  `rss` int(4) NOT NULL default '0',
 
156
  `rss_topic` int(4) NOT NULL default '0',
 
157
  PRIMARY KEY  (`fid`)
 
158
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
159
 
 
160
$queries[] = "INSERT INTO " . $dbprefix . "forums VALUES (1, 1, 0, 1, '-1,0,2,3', 'Generals', 'Talk about anything you like in general!', '', '', 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, '', '', 0, 0, 10, 10, '')"; #20
 
161
//Forgot Passwords #21
 
162
$queries[] = "CREATE TABLE " . $dbprefix . "fpass (
 
163
  fpuid mediumint(8) NOT NULL default '0',
 
164
  resetcode varchar(10) NOT NULL default '',
 
165
  fptime int(10) NOT NULL default '0',
 
166
  UNIQUE KEY fpuid (fpuid)
 
167
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
168
 
 
169
//Marked read topics and forums
 
170
$queries[] = "CREATE TABLE " . $dbprefix . "mark_read (
 
171
  mr_uid mediumint(8) NOT NULL default '0',
 
172
  mr_fid smallint(5) NOT NULL default '0',
 
173
  mr_time int(10) NOT NULL default '0',
 
174
  UNIQUE KEY mr_uid (mr_uid,mr_fid)
 
175
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
176
 
 
177
//Moderators
 
178
$queries[] = "CREATE TABLE " . $dbprefix . "moderators (
 
179
  mod_mem_id mediumint(8) NOT NULL default '0',
 
180
  mod_fid smallint(5) NOT NULL default '0',
 
181
  UNIQUE KEY mod_mem_id (mod_mem_id,mod_fid)
 
182
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
183
 
 
184
//News
 
185
$queries[] = "CREATE TABLE " . $dbprefix . "news (
 
186
  `nid` mediumint(8) NOT NULL auto_increment,
 
187
  `uid` mediumint(8) NOT NULL default '0',
 
188
  `title` tinytext NOT NULL,
 
189
  `news` text NOT NULL,
 
190
  `time` int(12) NOT NULL default '0',
 
191
  `image` tinytext NOT NULL,
 
192
  `fullstorylink` tinytext NOT NULL,
 
193
  `approved` tinyint(2) NOT NULL default '0',
 
194
  `showinticker` int(10) NOT NULL default '0',
 
195
  PRIMARY KEY  (`nid`)
 
196
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
197
 
 
198
//Forum Notifications
 
199
$queries[] = "CREATE TABLE " . $dbprefix . "notify_forum (
 
200
  notify_mid mediumint(8) NOT NULL default '0',
 
201
  notify_fid smallint(5) NOT NULL default '0',
 
202
  UNIQUE KEY notify_mid (notify_mid,notify_fid)
 
203
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
204
 
 
205
//Topic Notifications
 
206
$queries[] = "CREATE TABLE " . $dbprefix . "notify_topic (
 
207
  notify_mid mediumint(8) NOT NULL default '0',
 
208
  notify_tid mediumint(8) NOT NULL default '0',
 
209
  UNIQUE KEY notify_mid (notify_mid,notify_tid)
 
210
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
211
 
 
212
//Permissions
 
213
$queries[] = "CREATE TABLE " . $dbprefix . "permissions (
 
214
  `member_group_id` mediumint(8) NOT NULL default '0',
 
215
  `view_forum` tinyint(2) NOT NULL default '0',
 
216
  `can_post_topic` tinyint(2) NOT NULL default '0',
 
217
  `can_reply` tinyint(2) NOT NULL default '0',
 
218
  `can_edit_own_topic` tinyint(2) NOT NULL default '0',
 
219
  `can_edit_other_topic` tinyint(2) NOT NULL default '0',
 
220
  `can_edit_own` tinyint(2) NOT NULL default '0',
 
221
  `can_edit_other` tinyint(2) NOT NULL default '0',
 
222
  `approve_topics` tinyint(2) NOT NULL default '0',
 
223
  `approve_posts` tinyint(2) NOT NULL default '0',
 
224
  `can_del_own_post` tinyint(2) NOT NULL default '0',
 
225
  `can_del_other_post` tinyint(2) NOT NULL default '0',
 
226
  `can_search` tinyint(2) NOT NULL default '0',
 
227
  `can_email_mem` tinyint(2) NOT NULL default '0',
 
228
  `can_email_friend` tinyint(2) NOT NULL default '0',
 
229
  `can_edit_own_profile` tinyint(2) NOT NULL default '0',
 
230
  `can_edit_other_profile` tinyint(2) NOT NULL default '0',
 
231
  `can_del_own_account` tinyint(2) NOT NULL default '0',
 
232
  `can_del_other_account` tinyint(2) NOT NULL default '0',
 
233
  `can_ban_user` tinyint(2) NOT NULL default '0',
 
234
  `can_del_own_topic` tinyint(2) NOT NULL default '0',
 
235
  `can_del_other_topic` tinyint(2) NOT NULL default '0',
 
236
  `can_view_poll` tinyint(2) NOT NULL default '0',
 
237
  `can_vote_polls` tinyint(2) NOT NULL default '0',
 
238
  `can_post_polls` tinyint(2) NOT NULL default '0',
 
239
  `can_edit_other_poll` tinyint(2) NOT NULL default '0',
 
240
  `can_edit_own_poll` tinyint(2) NOT NULL default '0',
 
241
  `add_poll_topic_own` tinyint(2) NOT NULL default '0',
 
242
  `add_poll_topic_other` tinyint(2) NOT NULL default '0',
 
243
  `can_rem_own_poll` tinyint(2) NOT NULL default '0',
 
244
  `can_rem_other_poll` tinyint(2) NOT NULL default '0',
 
245
  `can_merge_topics` tinyint(2) NOT NULL default '0',
 
246
  `can_merge_posts` tinyint(2) NOT NULL default '0',
 
247
  `can_split_topics` tinyint(2) NOT NULL default '0',
 
248
  `can_email_topic` tinyint(2) NOT NULL default '0',
 
249
  `can_make_sticky` tinyint(2) NOT NULL default '0',
 
250
  `can_move_own_topic` tinyint(2) NOT NULL default '0',
 
251
  `can_move_other_topic` tinyint(2) NOT NULL default '0',
 
252
  `can_lock_own_topic` tinyint(2) NOT NULL default '0',
 
253
  `can_lock_other_topic` tinyint(2) NOT NULL default '0',
 
254
  `can_announce_topic` tinyint(2) NOT NULL default '0',
 
255
  `can_report_post` tinyint(2) NOT NULL default '0',
 
256
  `can_report_pm` tinyint(2) NOT NULL default '0',
 
257
  `prefix` varchar(80) NOT NULL default '',
 
258
  `suffix` varchar(80) NOT NULL default '',
 
259
  `can_attach` tinyint(2) NOT NULL default '0',
 
260
  `can_view_attach` tinyint(2) NOT NULL default '0',
 
261
  `can_remove_attach` tinyint(2) NOT NULL default '0',
 
262
  `max_attach` mediumint(8) NOT NULL default '0',
 
263
  `notify_new_posts` tinyint(2) NOT NULL default '0',
 
264
  `notify_new_topics` tinyint(2) NOT NULL default '0',
 
265
  `use_avatar` tinyint(2) NOT NULL default '0',
 
266
  `url_avatar` tinyint(2) NOT NULL default '0',
 
267
  `upload_avatar` tinyint(2) NOT NULL default '0',
 
268
  `hide_online` tinyint(2) NOT NULL default '0',
 
269
  `view_active` tinyint(2) NOT NULL default '0',
 
270
  `view_anonymous` tinyint(2) NOT NULL default '0',
 
271
  `allow_html` tinyint(2) NOT NULL default '0',
 
272
  `has_priviliges` tinyint(2) NOT NULL default '0',
 
273
  `view_ip` tinyint(2) NOT NULL default '0',
 
274
  `can_admin` tinyint(2) NOT NULL default '0',
 
275
  `can_use_pm` tinyint(2) NOT NULL default '0',
 
276
  `max_stored_pm` mediumint(8) NOT NULL default '0',
 
277
  `max_mass_pm` mediumint(8) NOT NULL default '0',
 
278
  `view_offline_board` tinyint(2) NOT NULL default '0',
 
279
  `can_view_profile` tinyint(2) NOT NULL default '0',
 
280
  `view_members` tinyint(2) NOT NULL default '0',
 
281
  `view_stats` tinyint(2) NOT NULL default '0',
 
282
  `can_submit_news` tinyint(2) NOT NULL default '0',
 
283
  `can_approve_news` tinyint(2) NOT NULL default '0',
 
284
  `can_edit_news` tinyint(2) NOT NULL default '0',
 
285
  `can_delete_news` tinyint(2) NOT NULL default '0',
 
286
  `group_message` text NOT NULL,
 
287
  `can_shout` tinyint(2) NOT NULL default '0',
 
288
  `can_del_shout` tinyint(2) NOT NULL default '0',  
 
289
  `view_calendar` tinyint(2) NOT NULL default '0',
 
290
  PRIMARY KEY  (`member_group_id`)
 
291
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
292
 
 
293
$queries[] = "INSERT INTO " . $dbprefix . "permissions VALUES (-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 1)";
 
294
$queries[] = "INSERT INTO " . $dbprefix . "permissions VALUES (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, '', '', 1, 1, 1, 50000, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, '', 1, 1, 1)";
 
295
$queries[] = "INSERT INTO " . $dbprefix . "permissions VALUES (3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, '', '', 1, 1, 1, 2048, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 150, 0, 0, 1, 1, 1, 1, 0, 0, 0, '', 1, 0, 1)";
 
296
$queries[] = "INSERT INTO " . $dbprefix . "permissions VALUES (2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, '', '', 1, 1, 1, 2048, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, '', 1, 1, 1)";
 
297
$queries[] = "INSERT INTO " . $dbprefix . "permissions VALUES (-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 1)";
 
298
$queries[] = "INSERT INTO " . $dbprefix . "permissions VALUES (0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, '', '', 1, 1, 0, 1024, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 200, 5, 0, 1, 1, 1, 1, 0, 0, 0, '', 1, 0, 1)";
 
299
 
 
300
//Plugins #
 
301
$queries[] = "CREATE TABLE " . $dbprefix . "plugins (
 
302
  `id` int(11) NOT NULL AUTO_INCREMENT,
 
303
  `plg_name` text COLLATE utf8_unicode_ci NOT NULL,
 
304
  `activated` int(11) NOT NULL,
 
305
  PRIMARY KEY (`id`)
 
306
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
307
 
 
308
//Personal Messages
 
309
$queries[] = "CREATE TABLE " . $dbprefix . "pm (
 
310
  pmid mediumint(8) NOT NULL auto_increment,
 
311
  pm_from mediumint(8) NOT NULL default '0',
 
312
  pm_to mediumint(8) NOT NULL default '0',
 
313
  pm_time int(10) NOT NULL default '0',
 
314
  pm_read_time int(10) NOT NULL default '0',
 
315
  pm_folder tinyint(2) NOT NULL default '0',
 
316
  pm_subject tinytext NOT NULL,
 
317
  pm_body text NOT NULL,
 
318
  pm_track tinyint(2) NOT NULL default '0',
 
319
  pm_to_text tinytext NOT NULL,
 
320
  PRIMARY KEY  (pmid)
 
321
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
322
 
 
323
//Poll Options
 
324
$queries[] = "CREATE TABLE " . $dbprefix . "poll_options (
 
325
  pooid mediumint(10) NOT NULL auto_increment,
 
326
  poo_poid mediumint(8) NOT NULL default '0',
 
327
  poo_option tinytext NOT NULL,
 
328
  poo_votes smallint(5) NOT NULL default '0',
 
329
  PRIMARY KEY  (pooid)
 
330
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
331
 
 
332
//Voters
 
333
$queries[] = "CREATE TABLE " . $dbprefix . "poll_voters (
 
334
  pv_mid mediumint(8) NOT NULL default '0',
 
335
  pv_pooid mediumint(10) NOT NULL default '0',
 
336
  pv_poid mediumint(8) NOT NULL default '0',
 
337
  UNIQUE KEY pv_mid (pv_mid,pv_pooid,pv_poid)
 
338
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
339
 
 
340
//Polls
 
341
$queries[] = "CREATE TABLE " . $dbprefix . "polls (
 
342
  poid mediumint(8) NOT NULL auto_increment,
 
343
  poll_qt tinytext NOT NULL,
 
344
  poll_mid mediumint(8) NOT NULL default '0',
 
345
  poll_locked tinyint(2) NOT NULL default '0',
 
346
  poll_tid mediumint(8) NOT NULL default '0',
 
347
  poll_expiry int(10) NOT NULL default '0',
 
348
  poll_change_vote tinyint(2) NOT NULL default '0',
 
349
  poll_started int(10) NOT NULL default '0',
 
350
  poll_show_when tinyint(2) NOT NULL default '0',
 
351
  PRIMARY KEY  (poid)
 
352
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
353
 
 
354
//Posts
 
355
$queries[] = "CREATE TABLE " . $dbprefix . "posts (
 
356
  `pid` int(10) NOT NULL auto_increment,
 
357
  `post_tid` mediumint(8) NOT NULL default '0',
 
358
  `p_top_sticky` tinyint(2) NOT NULL default '0',
 
359
  `post_fid` smallint(5) NOT NULL default '0',
 
360
  `ptime` int(10) NOT NULL default '0',
 
361
  `poster_id` mediumint(8) NOT NULL default '0',
 
362
  `poster_ip` varchar(20) NOT NULL default '',
 
363
  `modtime` int(10) NOT NULL default '0',
 
364
  `modifiers_id` mediumint(8) NOT NULL default '0',
 
365
  `post` text NOT NULL,
 
366
  `use_smileys` tinyint(2) NOT NULL default '1',
 
367
  `gposter_name` varchar(80) NOT NULL default '',
 
368
  `gposter_email` varchar(80) NOT NULL default '',
 
369
  `post_title` varchar(255) NOT NULL default '',
 
370
  `num_attachments` tinyint(4) NOT NULL default '0',
 
371
  `par_id` int(10) NOT NULL default '0',
 
372
  `p_approved` tinyint(2) NOT NULL default '0',
 
373
  PRIMARY KEY  (`pid`)
 
374
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
375
 
 
376
$queries[] = "INSERT INTO " . $dbprefix . "posts VALUES (1, 1, 0, 1, " . time() . ", -1, '', 0, 0, 'Hi,\r\n\r\n    We would like to thank you for using AEF.\r\nIf you need any assistance  :??:  , feel free to ask us for help at the [url=http://www.anelectron.com/board/]support board[/url].\r\n\r\nThanks and enjoy AEF!!!  ;-D \r\n\r\n', 1, 'AEF Team', 'aef@anelectron.com', '', 0, 0, 1)";
 
377
 
 
378
//Marked Board read
 
379
$queries[] = "CREATE TABLE " . $dbprefix . "read_board (
 
380
  rb_uid mediumint(8) NOT NULL default '0',
 
381
  rb_time int(12) NOT NULL default '0',
 
382
  UNIQUE KEY rb_uid (rb_uid)
 
383
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
384
 
 
385
//Read Forums
 
386
$queries[] = "CREATE TABLE " . $dbprefix . "read_forums (
 
387
  rf_uid mediumint(8) NOT NULL default '0',
 
388
  rf_fid smallint(5) NOT NULL default '0',
 
389
  rf_time int(10) NOT NULL default '0',
 
390
  UNIQUE KEY rf_uid (rf_uid,rf_fid)
 
391
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
392
 
 
393
//Read Topics
 
394
$queries[] = "CREATE TABLE " . $dbprefix . "read_topics (
 
395
  rt_uid mediumint(8) NOT NULL default '0',
 
396
  rt_tid smallint(5) NOT NULL default '0',
 
397
  rt_time int(10) NOT NULL default '0',
 
398
  UNIQUE KEY rt_uid (rt_uid,rt_tid)
 
399
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
400
 
 
401
//AEF Registry
 
402
$queries[] = "CREATE TABLE " . $dbprefix . "registry (
 
403
  name varchar(255) NOT NULL default '',
 
404
  regval text NOT NULL,
 
405
  UNIQUE KEY name (name)
 
406
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
407
 
 
408
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('reserved_names', 'admin\r\nwebmaster\r\nmaster\r\nuser\r\nlocalhost\r\nlord')";
 
409
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('latest_mem', '" . $ad_username . "|1')";
 
410
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('num_mem', '1')";
 
411
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('recyclebin', '0')";
 
412
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mostactive', '1|" . time() . "')";
 
413
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxtopics', '30')";
 
414
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxpostsintopics', '15')";
 
415
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxreplyhot', '15')";
 
416
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxreplyveryhot', '25')";
 
417
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('disableshoutingtopics', '0')";
 
418
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('disableshoutingdesc', '0')";
 
419
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('prenextopic', '1')";
 
420
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('warnoldtopic', '120')";
 
421
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('prefixsticky', 'Sticky:')";
 
422
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('prefixmoved', 'Moved:')";
 
423
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('prefixpolls', 'Poll:')";
 
424
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxtitlechars', '0')";
 
425
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mintitlechars', '0')";
 
426
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxdescchars', '0')";
 
427
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mindescchars', '0')";
 
428
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('allow_taf', '1')";
 
429
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxcharposts', '20000')";
 
430
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mincharposts', '0')";
 
431
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('timepostfromuser', '10')";
 
432
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxemotpost', '15')";
 
433
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maximgspost', '15')";
 
434
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('allowdynimg', '0')";
 
435
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maximgwidthpost', '300')";
 
436
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maximgheightpost', '300')";
 
437
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('removenestedquotes', '0')";
 
438
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachsigtopost', '1')";
 
439
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('embedflashinpost', '0')";
 
440
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxflashpost', '5')";
 
441
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxflashwidthinpost', '300')";
 
442
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxflashheightinpost', '300')";
 
443
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('enablepolls', '1')";
 
444
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxpollsintopic', '3')";
 
445
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxoptionspoll', '10')";
 
446
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxpollqtlen', '100')";
 
447
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('censor_words_from', '')";
 
448
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('censor_words_to', '')";
 
449
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maintenance', '0')";
 
450
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('censor_words_case', '0')";
 
451
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('parsebbc', '1')";
 
452
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('autolink', '1')";
 
453
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_hr', '1')";
 
454
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_b', '1')";
 
455
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_i', '1')";
 
456
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_u', '1')";
 
457
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_s', '1')";
 
458
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_left', '1')";
 
459
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_right', '1')";
 
460
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_center', '1')";
 
461
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_size', '1')";
 
462
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_font', '1')";
 
463
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_sup', '1')";
 
464
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_sub', '1')";
 
465
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_color', '1')";
 
466
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_url', '1')";
 
467
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_ftp', '1')";
 
468
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_email', '1')";
 
469
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_img', '1')";
 
470
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_flash', '1')";
 
471
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_code', '1')";
 
472
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_quote', '1')";
 
473
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_php', '1')";
 
474
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_ul', '1')";
 
475
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_ol', '1')";
 
476
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bbc_parseHTML', '1')";
 
477
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('reg_method', '1')";
 
478
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('allow_reg', '1')";
 
479
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('wel_email', '1')";
 
480
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('reg_notify', '0')";
 
481
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('max_pass', '20')";
 
482
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('max_uname', '20')";
 
483
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('min_pass', '4')";
 
484
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('min_uname', '4')";
 
485
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('sec_conf', '1')";
 
486
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('samepc_reg', '0')";
 
487
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('age_limit', '0')";
 
488
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('age_rest_act', '1')";
 
489
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('age_rest_act_address', '')";
 
490
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('age_rest_act_fax', '')";
 
491
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('age_rest_act_tele', '')";
 
492
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('reserved_match_whole', '0')";
 
493
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('reserved_match_insensitive', '1')";
 
494
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('login_failed', '5')";
 
495
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('anon_login', '1')";
 
496
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('fpass_sec_conf', '1')";
 
497
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('userstextlen', '100')";
 
498
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('wwwlen', '150')";
 
499
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('customtitlelen', '30')";
 
500
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('locationlen', '100')";
 
501
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('realnamelen', '100')";
 
502
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('secretqtlen', '200')";
 
503
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('secretansmaxlen', '20')";
 
504
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('secretansminlen', '4')";
 
505
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('usersiglen', '200')";
 
506
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('showavatars', '1')";
 
507
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('avatardir', '" . $server_url . "/avatars')";
 
508
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('avatarurl', '" . $url . "/avatars')";
 
509
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('uploadavatardir', '" . $server_url . "/uploads/avatars')";
 
510
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('uploadavatarurl', '" . $url . "/uploads/avatars')";
 
511
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('uploadavatarmaxsize', '5000')";
 
512
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('avatartypes', 'gif,jpg,png')";
 
513
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('uploadppicdir', '" . $server_url . "/uploads/personalpic')";
 
514
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('uploadppicurl', '" . $url . "/uploads/personalpic')";
 
515
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('uploadppicmaxsize', '5000')";
 
516
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('ppictypes', 'gif,jpg,png,tiff')";
 
517
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('pmon', '1')";
 
518
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('notifynewpm', '1')";
 
519
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('pmusesmileys', '1')";
 
520
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('pmnumshowinfolders', '50')";
 
521
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('pmsaveinsentitems', '1')";
 
522
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachmentmode', '1')";
 
523
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('allownewattachment', '1')";
 
524
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachmentdir', '" . $server_url . "/uploads/attachments')";
 
525
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxattachmentpost', '3')";
 
526
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxattachsize', '150')";
 
527
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxattachsizepost', '250')";
 
528
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachmentshowimage', '1')";
 
529
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachmentshowimagemaxwidth', '200')";
 
530
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachmentshowimagemaxheight', '200')";
 
531
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('attachmenturl', '" . $url . "/uploads/attachments')";
 
532
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('usesmileys', '1')";
 
533
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maintenance_subject', '')";
 
534
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maintenance_message', '')";
 
535
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mail', '1')";
 
536
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mail_user', '')";
 
537
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mail_pass', '')";
 
538
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mail_server', '')";
 
539
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('mail_port', '')";
 
540
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('notifications', '1')";
 
541
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('numsubinpage', '30')";
 
542
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('session_timeout', '3600')";
 
543
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('last_active_span', '15')";
 
544
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('only_users', '0')";
 
545
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('stats', '1')";
 
546
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('memhideemail', '1')";
 
547
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('showmemdetails', '0')";
 
548
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxactivelist', '50')";
 
549
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('maxmemberlist', '50')";
 
550
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('theme', 'default')";
 
551
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('theme_id', '1')";
 
552
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('choose_theme', '1')";
 
553
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('version', '1.1.0 preview')";
 
554
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('enablenews', '1')";
 
555
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('enableshoutbox', '0')";
 
556
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('shouts', '10')";
 
557
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('shoutboxtime', '1440')";
 
558
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('countinboardposts', '0')";
 
559
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('subscribeauto', '0')";
 
560
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('enablesig', '1')";
 
561
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('showimgs', '1')";
 
562
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('shoutbox_emot', '1')";
 
563
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('shoutbox_nbbc', '1')";
 
564
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('shoutbox_sbbc', '0')";
 
565
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('language', 'english')";
 
566
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('choose_language', '1')";
 
567
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('smiley_space_boundary', '1')";
 
568
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('users_visited_today', '0')";
 
569
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('av_width', '90')";
 
570
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('av_height', '90')";
 
571
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('ppic_width', '90')";
 
572
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('ppic_height', '90')";
 
573
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('last_posts_reply', '10')";
 
574
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('recent_posts', '8')";
 
575
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('who_read_topic', '0')";
 
576
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('show_groups', '0')";
 
577
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('change_username', '1')";
 
578
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('rss_recent', '10')";
 
579
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('smart_redirect', '1')";
 
580
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('report_posts', '1')";
 
581
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('charset', '" . (empty($utf8) ? 'ISO-8859-1' : 'UTF-8') . "')";
 
582
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('title_in_link', '0')";
 
583
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('seo', '0')";
 
584
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('timezone', '0')";
 
585
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('tickednews', '1')";
 
586
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('todaysnews', '1')";
 
587
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('newsperpage', '12')";
 
588
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('bannedip', '')";
 
589
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('keywords', '')";
 
590
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('akismet_key', '')";
 
591
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('enable_akismet', '0')";
 
592
$queries[] = "INSERT INTO " . $dbprefix . "registry VALUES ('share_limit', '20')";
 
593
 
 
594
//Sessions
 
595
$queries[] = "CREATE TABLE " . $dbprefix . "sessions (
 
596
  sid varchar(32) NOT NULL default '',
 
597
  uid mediumint(8) NOT NULL default '0',
 
598
  time int(12) NOT NULL default '0',
 
599
  data text NOT NULL,
 
600
  ip varchar(20) NOT NULL default '',
 
601
  last_activity tinytext NOT NULL,
 
602
  activity text NOT NULL,
 
603
  viewing_board smallint(5) NOT NULL default '0',
 
604
  viewing_topic mediumint(8) NOT NULL default '0',
 
605
  anonymous tinyint(2) NOT NULL default '0',
 
606
  UNIQUE KEY sid (sid)
 
607
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
608
 
 
609
//Shouts
 
610
$queries[] = "CREATE TABLE " . $dbprefix . "shouts (
 
611
  shid int(10) NOT NULL auto_increment,
 
612
  shtime int(10) NOT NULL default '0',
 
613
  shuid mediumint(8) NOT NULL default '0',
 
614
  shtext text NOT NULL,
 
615
  shucolor text NOT NULL,
 
616
  PRIMARY KEY  (shid)
 
617
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
618
 
 
619
//Smileys
 
620
$queries[] = "CREATE TABLE " . $dbprefix . "smileys (
 
621
  smid smallint(5) NOT NULL auto_increment,
 
622
  smcode varchar(40) NOT NULL default '',
 
623
  smfile varchar(40) NOT NULL default '',
 
624
  smtitle varchar(40) NOT NULL default '',
 
625
  smorder smallint(5) NOT NULL default '0',
 
626
  smstatus tinyint(2) NOT NULL default '0',
 
627
  smfolder varchar(70) NOT NULL default '',
 
628
  PRIMARY KEY  (smid),
 
629
  UNIQUE KEY smcode (smcode),
 
630
  UNIQUE KEY smcode_2 (smcode)
 
631
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
632
 
 
633
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':)', 'smile.png', 'Smile', 1, 0, 'cutemoticons')";
 
634
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':D', 'bigsmile.png', 'Big Smile', 2, 0, 'cutemoticons')";
 
635
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':angel:', 'angel.png', 'Angel', 3, 0, 'cutemoticons')";
 
636
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':-x', 'crossedlips.png', 'Crossed Lips', 0, 0, 'cutemoticons')";
 
637
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':cry:', 'cry.png', 'Cry', 0, 0, 'cutemoticons')";
 
638
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':kiss:', 'kiss.png', 'Kiss', 0, 0, 'cutemoticons')";
 
639
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':nerd:', 'nerd.png', 'Nerd', 0, 0, 'cutemoticons')";
 
640
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':neu:', 'neutral.png', 'Neutral', 0, 0, 'cutemoticons')";
 
641
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':??:', 'ooh.png', 'Question ??', 0, 0, 'cutemoticons')";
 
642
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':-(', 'sad.png', 'Sad', 0, 0, 'cutemoticons')";
 
643
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':squi:', 'squigglemouth.png', 'Squiggle mouth', 0, 0, 'cutemoticons')";
 
644
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':P', 'tongue.png', 'Sticking tongue out', 0, 0, 'cutemoticons')";
 
645
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ';-D', 'wink.png', 'Wink', 0, 0, 'cutemoticons')";
 
646
$queries[] = "INSERT INTO " . $dbprefix . "smileys VALUES (0, ':xd:', 'xd.png', 'XD', 0, 0, 'cutemoticons')";
 
647
 
 
648
//Stats
 
649
$queries[] = "CREATE TABLE " . $dbprefix . "stats (
 
650
  timestamp int(12) NOT NULL default '0',
 
651
  users mediumint(8) NOT NULL default '0',
 
652
  topics mediumint(8) NOT NULL default '0',
 
653
  posts mediumint(8) NOT NULL default '0',
 
654
  active mediumint(8) NOT NULL default '0',
 
655
  pageviews int(10) NOT NULL default '0',
 
656
  UNIQUE KEY timestamp (timestamp)
 
657
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
658
 
 
659
//Theme registry
 
660
$queries[] = "CREATE TABLE " . $dbprefix . "theme_registry (
 
661
  `thid` mediumint(8) NOT NULL default '0',
 
662
  `uid` mediumint(8) NOT NULL default '0',
 
663
  `theme_registry` text NOT NULL,
 
664
  UNIQUE KEY `thid` (`thid`,`uid`)
 
665
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
666
 
 
667
$queries[] = "INSERT INTO " . $dbprefix . "theme_registry VALUES (1, 0, 'a:15:{s:4:\"name\";s:8:\"Electron\";s:4:\"path\";s:54:\"" . $server_url . "/themes/default\";s:3:\"url\";s:35:\"" . $url . "/themes/default\";s:6:\"images\";s:43:\"" . $url . "/themes/default/images/\";s:7:\"wysiwyg\";i:1;s:11:\"fixshoutbox\";i:0;s:8:\"showdock\";i:1;s:9:\"headerimg\";s:0:\"\";s:9:\"headerads\";s:0:\"\";s:13:\"headernavtree\";i:1;s:14:\"shownumqueries\";i:1;s:14:\"showntimetaken\";i:1;s:9:\"copyright\";s:0:\"\";s:9:\"footerads\";s:0:\"\";s:13:\"footernavtree\";i:0;}')";
 
668
 
 
669
//Themes
 
670
$queries[] = "CREATE TABLE " . $dbprefix . "themes (
 
671
  `thid` mediumint(5) NOT NULL auto_increment,
 
672
  `th_name` varchar(100) NOT NULL default '',
 
673
  `th_folder` varchar(100) NOT NULL default '',
 
674
  PRIMARY KEY  (`thid`)
 
675
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
676
 
 
677
$queries[] = "INSERT INTO " . $dbprefix . "themes VALUES (1, 'Electron', 'default')";
 
678
 
 
679
//Topics
 
680
$queries[] = "CREATE TABLE " . $dbprefix . "topics (
 
681
  tid mediumint(8) NOT NULL auto_increment,
 
682
  topic mediumtext NOT NULL,
 
683
  t_description mediumtext NOT NULL,
 
684
  t_bid smallint(5) NOT NULL default '0',
 
685
  t_status tinyint(2) NOT NULL default '1',
 
686
  n_posts int(11) NOT NULL default '0',
 
687
  n_views int(11) NOT NULL default '0',
 
688
  type_image mediumint(3) NOT NULL default '0',
 
689
  t_mem_id mediumint(8) NOT NULL default '0',
 
690
  poll_id mediumint(8) NOT NULL default '0',
 
691
  t_sticky tinyint(2) NOT NULL default '0',
 
692
  first_post_id int(10) NOT NULL default '0',
 
693
  last_post_id int(10) NOT NULL default '0',
 
694
  mem_id_last_post mediumint(8) NOT NULL default '0',
 
695
  has_attach smallint(5) NOT NULL default '0',
 
696
  t_approved tinyint(2) NOT NULL default '0',
 
697
  PRIMARY KEY  (tid)
 
698
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
699
 
 
700
$queries[] = "INSERT INTO " . $dbprefix . "topics VALUES (1, 'Welcome to AEF', '', 1, 1, 0, 0, 6, -1, 0, 0, 1, 0, 0, 0, 1)";
 
701
 
 
702
//User Groups
 
703
$queries[] = "CREATE TABLE " . $dbprefix . "user_groups (
 
704
  member_group mediumint(5) NOT NULL auto_increment,
 
705
  mem_gr_name varchar(80) NOT NULL default '',
 
706
  mem_gr_colour varchar(20) NOT NULL default '',
 
707
  post_count mediumint(8) NOT NULL default '0',
 
708
  image_name varchar(30) NOT NULL default '',
 
709
  image_count mediumint(5) NOT NULL default '0',
 
710
  max_pm mediumint(5) NOT NULL default '0',
 
711
  PRIMARY KEY  (member_group)
 
712
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
713
 
 
714
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (-3, 'Banned', '#000000', -1, 'banned.gif', 1, 0)";
 
715
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (-1, 'Guest', '#000000', -1, 'guests.png', 1, 0)";
 
716
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (1, 'Administrator', '#FF0000', -1, 'admin.gif', 7, 0)";
 
717
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (2, 'Universal Moderator', '#0000FF', -1, 'unimod.gif', 6, 0)";
 
718
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (3, 'Moderator', '#339933', -1, 'mod.gif', 5, 0)";
 
719
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (4, 'Newbie', '#000000', 0, 'member.gif', 1, 0)";
 
720
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (5, 'Working Newbie', '#000000', 50, 'member.gif', 2, 0)";
 
721
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (6, 'Working Member', '#000000', 100, 'member.gif', 3, 0)";
 
722
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (7, 'Elite Member', '#000000', 250, 'member.gif', 4, 0)";
 
723
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (8, 'Super Member', '#000000', 500, 'member.gif', 5, 0)";
 
724
$queries[] = "INSERT INTO " . $dbprefix . "user_groups VALUES (0, 'Member', '#000000', -1, 'member.gif', 2, 0)";
 
725
//A small bug catch for the Member Group
 
726
$queries[] = "UPDATE " . $dbprefix . "user_groups SET member_group = '0' WHERE mem_gr_name = 'Member'";
 
727
 
 
728
 
 
729
//Users
 
730
$queries[] = "CREATE TABLE " . $dbprefix . "users (
 
731
  `id` mediumint(8) NOT NULL auto_increment,
 
732
  `username` varchar(80) NOT NULL default '',
 
733
  `password` varchar(32) NOT NULL default '',
 
734
  `salt` varchar(5) NOT NULL default '',
 
735
  `email` varchar(100) NOT NULL default '',
 
736
  `r_time` int(12) NOT NULL default '0',
 
737
  `r_ip` varchar(20) NOT NULL default '',
 
738
  `cookpass` varchar(32) NOT NULL default '',
 
739
  `lastlogin` int(12) NOT NULL default '0',
 
740
  `lastlogin_1` int(12) NOT NULL default '0',
 
741
  `posts` mediumint(8) NOT NULL default '0',
 
742
  `u_member_group` mediumint(5) NOT NULL default '0',
 
743
  `realname` tinytext NOT NULL,
 
744
  `pm` smallint(5) NOT NULL default '0',
 
745
  `unread_pm` smallint(5) NOT NULL default '0',
 
746
  `users_text` tinytext NOT NULL,
 
747
  `gender` tinyint(2) NOT NULL default '0',
 
748
  `birth_date` date NOT NULL default '0000-00-00',
 
749
  `customtitle` varchar(100) NOT NULL default '',
 
750
  `location` varchar(255) NOT NULL default '',
 
751
  `www` tinytext NOT NULL,
 
752
  `timezone` varchar(6) NOT NULL default '0',
 
753
  `gmail` varchar(255) NOT NULL default '',
 
754
  `icq` varchar(255) NOT NULL default '',
 
755
  `aim` varchar(255) NOT NULL default '',
 
756
  `yim` varchar(255) NOT NULL default '',
 
757
  `msn` varchar(255) NOT NULL default '',
 
758
  `sig` text NOT NULL,
 
759
  `avatar` tinytext NOT NULL,
 
760
  `avatar_type` tinyint(2) NOT NULL default '0',
 
761
  `avatar_width` tinyint(4) NOT NULL default '0',
 
762
  `avatar_height` tinyint(4) NOT NULL default '0',
 
763
  `ppic` tinytext NOT NULL,
 
764
  `ppic_type` tinyint(2) NOT NULL default '0',
 
765
  `ppic_width` tinyint(4) NOT NULL default '0',
 
766
  `ppic_height` tinyint(4) NOT NULL default '0',
 
767
  `timeformat` varchar(80) NOT NULL default '',
 
768
  `secret_question` tinytext NOT NULL,
 
769
  `secret_answer` tinytext NOT NULL,
 
770
  `user_theme` mediumint(5) NOT NULL default '1',
 
771
  `act_status` tinyint(2) NOT NULL default '0',
 
772
  `activation_code` varchar(10) NOT NULL default '',
 
773
  `validation_code` varchar(32) NOT NULL default '',
 
774
  `total_time_loggedin` int(12) NOT NULL default '0',
 
775
  `warns` tinyint(2) NOT NULL default '0',
 
776
  `last_warned` int(10) NOT NULL default '0',
 
777
  `language` varchar(50) NOT NULL default '0',
 
778
  `temp_ban` int(10) NOT NULL default '0',
 
779
  `temp_ban_time` int(10) NOT NULL default '0',
 
780
  `temp_ban_ug` mediumint(5) NOT NULL default '0',
 
781
  `adminemail` tinyint(2) NOT NULL default '0',
 
782
  `hideemail` tinyint(2) NOT NULL default '0',
 
783
  `subscribeauto` tinyint(2) NOT NULL default '0',
 
784
  `sendnewreply` tinyint(2) NOT NULL default '0',
 
785
  `pm_email_notify` tinyint(2) NOT NULL default '0',
 
786
  `pm_notify` tinyint(2) NOT NULL default '0',
 
787
  `saveoutgoingpm` tinyint(2) NOT NULL default '0',
 
788
  `showsigs` tinyint(2) NOT NULL default '0',
 
789
  `showavatars` tinyint(2) NOT NULL default '0',
 
790
  `showsmileys` tinyint(2) NOT NULL default '0',
 
791
  `autofastreply` tinyint(2) NOT NULL default '0',
 
792
  `showimgs` tinyint(2) NOT NULL default '0',
 
793
  `i_am_anon` tinyint(2) NOT NULL default '0',
 
794
  `user_settings` text NOT NULL,
 
795
  PRIMARY KEY  (`id`),
 
796
  UNIQUE KEY `username` (`username`)
 
797
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
 
798
 
 
799
//Admin Account
 
800
$queries[] = "INSERT INTO " . $dbprefix . "users
 
801
                SET username = '$ad_username',
 
802
                password = '$ad_pass',
 
803
                salt = '$salt',
 
804
                email = '$ad_email',
 
805
                r_time = '" . time() . "',
 
806
                r_ip = '" . $_SERVER['REMOTE_ADDR'] . "',
 
807
                u_member_group = '1',
 
808
                act_status = '1'";
 
809
 
 
810
$queries[] = "CREATE TABLE " . $dbprefix . "tellafriend (
 
811
  `id` int(11) NOT NULL AUTO_INCREMENT,
 
812
  `userid` int(11) NOT NULL,
 
813
  `time` varchar(256) NOT NULL,
 
814
  PRIMARY KEY (`id`)
 
815
) ENGINE=MyISAM" . (empty($utf8) ? '' : " DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci" ;
 
816
 
 
817
 
 
818
 
 
819
function make_mysql($queries_r) {
 
820
 
 
821
    global $conn, $error;
 
822
 
 
823
    foreach ($queries_r as $k => $q) {
 
824
 
 
825
        $result = mysql_query($q, $conn);
 
826
 
 
827
        if (!$result) {
 
828
 
 
829
            //Didnt get anyresult - DIE
 
830
            $error[] = 'Could not make the query numbered : ' . $k . '<br />MySQL Error No : ' . mysql_errno($conn) . '<br />MySQL Error : ' . mysql_error($conn) . ' </br >query : </br >' . $q;
 
831
 
 
832
            return false;
 
833
        }
 
834
    }
 
835
 
 
836
    return true;
 
837
}
 
838
 
 
839
?>