Skip to content

Commit

Permalink
* Updated SMF2 importer to the latest Wedge version. Warning: unteste…
Browse files Browse the repository at this point in the history
…d! Written following Thorsten's guidelines. (smf2_to_wedge.xml)

Signed-off-by: Nao <nao@wedge>
  • Loading branch information
Nao committed Feb 20, 2014
1 parent b3807d4 commit ed0e2b2
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions smf2_to_wedge.xml
Expand Up @@ -205,18 +205,32 @@
<detect>{$from_prefix}members</detect>
<destination>{$to_prefix}members</destination>
<presql>TRUNCATE {$to_prefix}members;</presql>
<preparsecode>
// We're going to import some of SMF's member settings into the serialized data array.
$data = array(
'pmlabs' => $row['message_labels'],
'modset' => $row['mod_prefs'],
);
if (!empty($row['secret_question']))
$data['secret'] => $row['secret_question'] . '|' . $row['secret_answer'];

$row['data'] = serialize($data);

unset($data, $row['message_labels'], $row['mod_prefs'], $row['secret_question'], $row['secret_answer']);
</preparsecode>
<query>
SELECT
id_member, member_name, date_registered, posts, id_group, lngfile, last_login,
real_name, instant_messages, unread_messages, new_pm, buddy_list, pm_ignore_list,
pm_prefs, mod_prefs, message_labels, passwd, email_address, personal_text,
gender, birthdate, website_url, website_title, location, hide_email, show_online,
pm_prefs, passwd, email_address, personal_text, gender, birthdate,
website_url, website_title, location, hide_email, show_online,
time_format, signature, time_offset, avatar, pm_email_notify,
usertitle, notify_announcements, notify_regularity, notify_send_body,
notify_types, member_ip, member_ip2, secret_question, secret_answer, is_activated,
validation_code, id_msg_last_visit, additional_groups, smiley_set, id_post_group,
total_time_logged_in, password_salt, ignore_boards, IFNULL(warning, 0) AS warning, passwd_flood,
pm_receive_from, '' AS data
notify_types, member_ip, member_ip2, is_activated, validation_code,
id_msg_last_visit, additional_groups, smiley_set, id_post_group,
total_time_logged_in, password_salt, ignore_boards,
IFNULL(warning, 0) AS warning, passwd_flood, pm_receive_from,
message_labels, secret_question, secret_answer, mod_prefs, '' AS data
FROM {$from_prefix}members;
</query>
</step>
Expand All @@ -231,6 +245,7 @@
FROM {$from_prefix}settings
WHERE variable='attachmentUploadDir';");
list ($smf_attachments_dir) = $db->fetch_row($request);
$db->free_result($request);

$smf_attachments_dir = rtrim($smf_attachments_dir, '/');

Expand Down Expand Up @@ -261,6 +276,7 @@
FROM {$from_prefix}settings
WHERE variable = 'custom_avatar_dir';");
list ($smf_attachments_dir) = $db->fetch_row($request);
$db->free_result($request);

if (empty($smf_attachments_dir))
{
Expand All @@ -270,6 +286,7 @@
WHERE variable='attachmentUploadDir';");
list ($smf_attachments_dir) = $db->fetch_row($request);
}
$db->free_result($request);

if ($avatarUploadDir == $attachmentUploadDir)
$row['attachment_type'] = 0;
Expand Down Expand Up @@ -590,12 +607,14 @@
FROM {$to_prefix}settings
WHERE variable='smileys_dir';");
list ($we_smileys_dir) = $db->fetch_row($request);
$db->free_result($request);

$request = $db->query("
SELECT value
FROM {$from_prefix}settings
WHERE variable='smileys_dir';");
list ($smf_smileys_dir) = $db->fetch_row($request);
$db->free_result($request);

helper::copy_smileys($smf_smileys_dir, $we_smileys_dir);
</code>
Expand Down

0 comments on commit ed0e2b2

Please sign in to comment.