-
Notifications
You must be signed in to change notification settings - Fork 2
/
smf11_to_wedge.xml
481 lines (478 loc) · 14.5 KB
/
smf11_to_wedge.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
<?xml version="1.0"?>
<importer xmlns="http://wedge.org/xml/importer" xmlns:smf="http://wedge.org/">
<general>
<name>SMF 1.1</name>
<version>Wedge 0.1</version>
<settings>/Settings.php</settings>
<from_prefix>`$db_name`.$db_prefix</from_prefix>
<table_test>{$from_prefix}members;</table_test>
<defines>SMF=1</defines>
<ip_to_ipv6>member_ip, member_ip2, ip</ip_to_ipv6>
<ip_to_pointer>poster_ip</ip_to_pointer>
</general>
<step>
<title>Importing settings</title>
<detect>{$from_prefix}settings</detect>
<destination>{$to_prefix}settings</destination>
<options>
<replace>true</replace>
</options>
<code>
$do_import = array(
'news',
'compactTopicPagesContiguous',
'compactTopicPagesEnable',
'enablePinnedTopics',
'todayMod',
'enablePreviousNext',
'pollMode',
'enableVBStyleLogin',
'enableCompressedOutput',
'attachmentSizeLimit',
'attachmentPostLimit',
'attachmentNumPerPostLimit',
'attachmentDirSizeLimit',
'attachmentExtensions',
'attachmentCheckExtensions',
'attachmentShowImages',
'attachmentEnable',
'attachmentEncryptFilenames',
'attachmentThumbnails',
'attachmentThumbWidth',
'attachmentThumbHeight',
'censorIgnoreCase',
'mostOnline',
'mostOnlineToday',
'mostDate',
'allow_disableAnnounce',
'trackStats',
'userLanguage',
'titlesEnable',
'topicSummaryPosts',
'enableErrorLogging',
'max_image_width',
'max_image_height',
'onlineEnable',
'smtp_host',
'smtp_port',
'smtp_username',
'smtp_password',
'mail_type',
'timeLoadPageEnable',
'totalMembers',
'totalTopics',
'totalMessages',
'simpleSearch',
'censor_vulgar',
'censor_proper',
'enablePostHTML',
'enableEmbeddedFlash',
'xmlnews_enable',
'xmlnews_maxlen',
'hotTopicPosts',
'hotTopicVeryPosts',
'registration_method',
'send_validation_onChange',
'send_welcomeEmail',
'allow_editDisplayName',
'allow_hideOnline',
'guest_hideContacts',
'spamWaitTime',
'pm_spam_settings',
'reserveWord',
'reserveCase',
'reserveUser',
'reserveName',
'reserveNames',
'autoLinkUrls',
'banLastUpdated',
'avatar_max_height_external',
'avatar_max_width_external',
'avatar_action_too_large',
'avatar_max_height_upload',
'avatar_max_width_upload',
'avatar_resize_upload',
'avatar_download_png',
'failed_login_threshold',
'oldTopicDays',
'edit_wait_time',
'edit_disable_time',
'autoFixDatabase',
'allow_guestAccess',
'time_format',
'number_format',
'enableBBC',
'max_messageLength',
'signature_settings',
'autoOptMaxOnline',
'defaultMaxMessages',
'defaultMaxTopics',
'defaultMaxMembers',
'enableParticipation',
'recycle_enable',
'recycle_board',
'maxMsgID',
'enableAllMessages',
'fixLongWords',
'who_enabled',
'time_offset',
'cookieTime',
'lastActive',
'requireAgreement',
'unapprovedMembers',
'package_make_backups',
'databaseSession_enable',
'databaseSession_loose',
'databaseSession_lifetime',
'search_cache_size',
'search_results_per_page',
'search_weight_frequency',
'search_weight_age',
'search_weight_length',
'search_weight_subject',
'search_weight_first_message',
'search_max_results',
'search_floodcontrol_time',
'permission_enable_deny',
'permission_enable_postgroups',
'mail_next_send',
'mail_recent',
'settings_updated',
'next_task_time',
'warning_settings',
'admin_features',
'last_mod_report_action',
'pruningOptions',
'cache_enable',
'reg_verification',
'enable_buddylist',
'birthday_email',
'globalCookies',
'default_timezone',
'memberlist_updated',
'latestMember',
'latestRealName',
'db_mysql_group_by_fix',
'rand_seed',
'mostOnlineUpdated',
'search_pointer',
'spider_name_cache',
'modlog_enabled',
'disabledBBC',
'latest_member',
'latest_real_name',
'total_members',
'total_messages',
'max_msg_id',
'total_topics',
'disable_hash_time',
'latestreal_name',
'disableHashTime',
);
$request = $db->query("
SELECT variable, value
FROM {$from_prefix}settings;");
while ($row = $db->fetch_assoc($request))
{
if (in_array($row['variable'], $do_import))
$db->query("
REPLACE INTO {$to_prefix}settings
(variable, value)
VALUES('$row[variable]', '$row[value]')");
}
</code>
</step>
<step type="mandatory">
<title>Importing members</title>
<detect>{$from_prefix}members</detect>
<destination>{$to_prefix}members</destination>
<presql>TRUNCATE {$to_prefix}members;</presql>
<query>
SELECT
ID_MEMBER as id_member, memberName AS member_name, dateRegistered AS date_registered,
posts, ID_GROUP as id_group, lngfile, lastLogin AS last_login,
realName AS real_name, instantMessages AS instant_messages,
unreadMessages AS unread_messages, buddy_list, pm_ignore_list,
messageLabels AS message_labels, passwd, emailAddress AS email_address,
personalText AS personal_text, gender, birthdate, websiteUrl AS website_url,
websiteTitle AS website_title, location, hideEmail AS hide_email,
showOnline AS show_online, timeFormat AS time_format, signature,
timeOffset AS time_offset, avatar, pm_email_notify, usertitle, '' AS ignore_boards,
notifyAnnouncements AS notify_announcements, notifyOnce AS notify_regularity,
notifySendBody AS notify_send_body, notifyTypes AS notify_types,
memberIP AS member_ip, memberIP2 AS member_ip2, secretQuestion AS secret_question,
secretAnswer AS secret_answer, is_activated,
validation_code, ID_MSG_LAST_VISIT AS id_msg_last_visit, additionalGroups AS additional_groups,
smileySet AS smiley_set, ID_POST_GROUP AS id_post_group,
totalTimeLoggedIn AS total_time_logged_in, passwordSalt AS password_salt
FROM {$from_prefix}members;
</query>
</step>
<step>
<title>Importing categories</title>
<detect>{$from_prefix}categories</detect>
<destination>{$to_prefix}categories</destination>
<presql>TRUNCATE {$to_prefix}categories;</presql>
<query>
SELECT
ID_CAT AS id_cat, name, catOrder AS cat_order, canCollapse AS can_collapse
FROM {$from_prefix}categories;
</query>
</step>
<step>
<title>Importing collapsed categories</title>
<detect>{$from_prefix}collapsed_categories</detect>
<destination>{$to_prefix}collapsed_categories</destination>
<presql>TRUNCATE {$to_prefix}collapsed_categories;</presql>
<query>
SELECT
ID_CAT AS id_cat, ID_MEMBER AS id_member
FROM {$from_prefix}collapsed_categories;
</query>
</step>
<step>
<title>Importing boards</title>
<detect>{$from_prefix}boards</detect>
<destination>{$to_prefix}boards</destination>
<presql>TRUNCATE {$to_prefix}boards;</presql>
<preparsecode>
$row['url'] = substr($this->boardurl, strpos($this->boardurl, '://') + 3) . '/board' . $row['url'];
$row['urllen'] = strlen($row['url']);
if (!empty($row['member_groups']))
{
$permissions = explode(',', $row['member_groups']);
foreach ($permissions as $allowed)
$db->query("
REPLACE INTO {$to_prefix}board_groups
(id_group, id_board, view_perm, enter_perm)
VALUES ('$allowed', $row[id_board], 'allow', 'allow')
");
}
</preparsecode>
<query>
SELECT
ID_BOARD AS id_board, ID_CAT AS id_cat, childLevel AS child_level,
ID_PARENT AS id_parent, boardOrder AS board_order, ID_LAST_MSG AS id_last_msg,
ID_MSG_UPDATED AS id_msg_updated, memberGroups AS member_groups,
name, description, numTopics AS num_topics, numPosts AS num_posts,
countPosts AS count_posts, override_theme AS override_skin, ID_BOARD AS url
FROM {$from_prefix}boards;
</query>
</step>
<step>
<title>Importing topics</title>
<detect>{$from_prefix}topics</detect>
<destination>{$to_prefix}topics</destination>
<presql>TRUNCATE {$to_prefix}topics;</presql>
<query>
SELECT
ID_TOPIC AS id_topic, isSticky AS is_pinned, ID_BOARD AS id_board,
ID_FIRST_MSG AS id_first_msg,ID_LAST_MSG AS id_last_msg,
ID_MEMBER_STARTED AS id_member_started, ID_MEMBER_UPDATED AS id_member_updated,
ID_POLL AS id_poll, numReplies AS num_replies, numViews AS num_views,locked
FROM {$from_prefix}topics;
</query>
</step>
<step>
<title>Importing messages</title>
<detect>{$from_prefix}messages</detect>
<destination>{$to_prefix}messages</destination>
<presql>TRUNCATE {$to_prefix}messages;</presql>
<options>
<limit>100</limit>
</options>
<query>
SELECT
ID_MSG AS id_msg, ID_TOPIC AS id_topic, ID_BOARD AS id_board,
posterTime AS poster_time, ID_MEMBER AS id_member,
ID_MSG_MODIFIED AS id_msg_modified, subject, posterName AS poster_name,
posterEmail AS poster_email, posterIP AS poster_ip,
smileysEnabled AS smileys_enabled, modifiedTime AS modified_time,
modifiedName AS modified_name, body, icon
FROM {$from_prefix}messages;
</query>
</step>
<step>
<title>Importing polls</title>
<detect>{$from_prefix}polls</detect>
<destination>{$to_prefix}polls</destination>
<presql>TRUNCATE {$to_prefix}polls;</presql>
<query>
SELECT
ID_POLL AS id_poll, question, votingLocked AS voting_locked,
maxVotes AS max_votes, expireTime AS expire_time,
hideResults AS hide_results, changeVote AS change_vote,
ID_MEMBER AS id_member, posterName AS poster_name
FROM {$from_prefix}polls;
</query>
</step>
<step>
<title>Importing poll choices</title>
<detect>{$from_prefix}poll_choices</detect>
<destination>{$to_prefix}poll_choices</destination>
<presql>TRUNCATE {$to_prefix}poll_choices;</presql>
<query>
SELECT
ID_POLL AS id_poll, ID_CHOICE AS id_choice, label, votes
FROM {$from_prefix}poll_choices;
</query>
</step>
<step>
<title>Importing poll votes</title>
<detect>{$from_prefix}log_polls</detect>
<destination>{$to_prefix}log_polls</destination>
<presql>TRUNCATE {$to_prefix}log_polls;</presql>
<query>
SELECT
ID_POLL AS id_poll, ID_MEMBER AS id_member, ID_CHOICE AS id_choice
FROM {$from_prefix}log_polls;
</query>
</step>
<step>
<title>Importing personal messages</title>
<detect>{$from_prefix}personal_messages</detect>
<destination>{$to_prefix}personal_messages</destination>
<presql>TRUNCATE {$to_prefix}personal_messages;</presql>
<options>
<limit>200</limit>
</options>
<query>
SELECT
ID_PM AS id_pm, ID_MEMBER_FROM AS id_member_from,
deletedBySender AS deleted_by_sender, fromName AS from_name,
msgtime, subject, body
FROM {$from_prefix}personal_messages;
</query>
</step>
<step>
<title>Importing pm recipients</title>
<detect>{$from_prefix}pm_recipients</detect>
<destination>{$to_prefix}pm_recipients</destination>
<presql>TRUNCATE {$to_prefix}pm_recipients;</presql>
<query>
SELECT
ID_PM AS id_pm, ID_MEMBER AS id_member, labels, bcc, is_read, deleted
FROM {$from_prefix}pm_recipients;
</query>
</step>
<step>
<title>Importing board moderators</title>
<detect>{$from_prefix}moderators</detect>
<destination>{$to_prefix}moderators</destination>
<presql>TRUNCATE {$to_prefix}moderators;</presql>
<query>
SELECT
ID_BOARD AS id_board, ID_MEMBER AS id_member
FROM {$from_prefix}moderators;
</query>
</step>
<step>
<title>Importing mark read data (topics)</title>
<detect>{$from_prefix}log_topics</detect>
<destination>{$to_prefix}log_topics</destination>
<presql>TRUNCATE {$to_prefix}log_topics;</presql>
<query>
SELECT
ID_MEMBER AS id_member, ID_TOPIC AS id_topic, ID_MSG AS id_msg
FROM {$from_prefix}log_topics;
</query>
</step>
<step>
<title>Importing mark read data</title>
<detect>{$from_prefix}log_mark_read</detect>
<destination>{$to_prefix}log_mark_read</destination>
<presql>TRUNCATE {$to_prefix}log_mark_read;</presql>
<query>
SELECT
ID_MEMBER AS id_member, ID_BOARD AS id_board, ID_MSG AS id_msg
FROM {$from_prefix}log_mark_read;
</query>
</step>
<step>
<title>Importing notifications</title>
<detect>{$from_prefix}log_notify</detect>
<destination>{$to_prefix}log_notify</destination>
<presql>TRUNCATE {$to_prefix}log_notify;</presql>
<query>
SELECT
ID_MEMBER AS id_member, ID_TOPIC AS id_topic, ID_BOARD AS id_board, sent
FROM {$from_prefix}log_notify;
</query>
</step>
<step>
<title>Importing membergroups</title>
<detect>{$from_prefix}membergroups</detect>
<destination>{$to_prefix}membergroups</destination>
<options>
<replace>true</replace>
</options>
<preparsecode>
if (!empty($row['online_color']))
{
if ($row['online_color'] == '#FF0000') // admin's shiny red?
$row['online_color'] = '#d2653a'; // subdued red is better.
if ($row['online_color'] == '#0000FF') // global mod's bright blue?
$row['online_color'] = '#c18933'; // light brown is better.
}
if (!empty($row['stars']))
$row['stars'] = str_replace('#star', '#rank', $row['stars']);
</preparsecode>
<query>
SELECT
ID_GROUP AS id_group, groupName AS group_name, '' AS description,
onlineColor AS online_color, minPosts AS min_posts,
maxMessages AS max_messages, stars
FROM {$from_prefix}membergroups;
</query>
</step>
<step>
<title>Importing permissions</title>
<detect>{$from_prefix}permissions</detect>
<destination>{$to_prefix}permissions</destination>
<options>
<replace>true</replace>
</options>
<query>
SELECT
ID_GROUP AS id_group, permission, addDeny AS add_deny
FROM {$from_prefix}permissions;
</query>
</step>
<step>
<title>Importing smileys</title>
<detect>{$from_prefix}smileys</detect>
<destination>{$to_prefix}smileys</destination>
<options>
<replace>true</replace>
</options>
<query>
SELECT
ID_SMILEY AS id_smiley, code, filename, description,
smileyRow AS smiley_row, smileyOrder AS smiley_order, hidden
FROM {$from_prefix}smileys;
</query>
</step>
<step>
<title>Importing statistics (activity log)</title>
<detect>{$from_prefix}log_activity</detect>
<destination>{$to_prefix}log_activity</destination>
<presql>TRUNCATE {$to_prefix}log_activity;</presql>
<query>
SELECT
date, hits, topics, posts, registers, mostOn AS most_on
FROM {$from_prefix}log_activity;
</query>
</step>
<step>
<title>Importing logged actions</title>
<detect>{$from_prefix}log_actions</detect>
<destination>{$to_prefix}log_actions</destination>
<presql>TRUNCATE {$to_prefix}log_actions;</presql>
<query>
SELECT
ID_ACTION AS id_action, logTime AS log_time,
ID_MEMBER AS id_member, ip, action, extra
FROM {$from_prefix}log_actions;
</query>
</step>
</importer>