Skip to content

Commit

Permalink
! A couple of errors in the latest commit. Hopefully this should be e…
Browse files Browse the repository at this point in the history
…nough to let txcas import... ;) (smf2_to_wedge.xml)

* Applied the same fix to the SMF 2 RC import code, while I'm at it... (smf2RC_to_wedge.xml)

Signed-off-by: Nao <nao@wedge>
  • Loading branch information
Nao committed Feb 26, 2014
1 parent ed0e2b2 commit d65f1ff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
33 changes: 26 additions & 7 deletions smf2RC_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,
real_name, instant_messages, unread_messages, buddy_list, pm_ignore_list,
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,
'' 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,
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
4 changes: 2 additions & 2 deletions smf2_to_wedge.xml
Expand Up @@ -212,7 +212,7 @@
'modset' => $row['mod_prefs'],
);
if (!empty($row['secret_question']))
$data['secret'] => $row['secret_question'] . '|' . $row['secret_answer'];
$data['secret'] = $row['secret_question'] . '|' . $row['secret_answer'];

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

Expand All @@ -221,7 +221,7 @@
<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,
real_name, instant_messages, unread_messages, buddy_list, pm_ignore_list,
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,
Expand Down

0 comments on commit d65f1ff

Please sign in to comment.