SMF 2.0.14 to phpBB 3.2.1

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Post Reply
Blacktiger63
Registered User
Posts: 55
Joined: Thu Oct 17, 2013 7:43 pm

SMF 2.0.14 to phpBB 3.2.1

Post by Blacktiger63 »

It seems there still is no convertor to do this and the support for phpbb 3.0.x is closed.
At this moment the convertor works to convert SMF 2.0.14 to Phpbb 3.0.14 from which we can upgrade to 3.2.1.

However, some string things are happening, which I wonder if they can be fixed.

If double spaces are found, a strange  character is placed in the post, like this:
om er meerdere kleine winkels in te
This strange  character also applies on other occasions, for example when custom smilies are used after a question mark or special character like this:
Gadgets, die net niet mogen? :foei:
where the :foei: is a custom smilie.
And when a custom smilie code is put in wrong, by ending it with a ; instead of a : like this:
maar dit bedenkt ieder "Kaaskop" :stom;Â
Can this be fixed some how or is there a smf to phpbb 3.2.x convertor to be expected any time soon?
Blacktiger63
Registered User
Posts: 55
Joined: Thu Oct 17, 2013 7:43 pm

Re: SMF 2.0.14 to phpBB 3.2.1

Post by Blacktiger63 »

Fixed. For those interested, since the  is not a replacement for something but is just added during conversion, you can easily remove it via a database query.

However, a direct converter for SMF 2.0.x to SMF 3.2.x would be easier.
Blacktiger63
Registered User
Posts: 55
Joined: Thu Oct 17, 2013 7:43 pm

Re: SMF 2.0.14 to phpBB 3.2.1

Post by Blacktiger63 »

There is a more harsh problem which lies in the convertor and which prevens me from converting now.

Quotes are not converted correctly.

Original this quote:

Code: Select all

[quote author=Black Tiger link=topic=15766.msg91441#msg91441 date=1504617642]
Which is probably gotten from clicking the quote button, is converted to this:

Code: Select all

[quote="Black Tiger"]
which is displayed as text and should have been converted to:

Code: Select all

[quote="Black Tiger"]
for phpBB if I'm not mistaken.

I don't know how to change this by a database query and I'm no code so I don't know how to change it in the convertor.
The issue lies probably in functions_smf20.php:

Code: Select all

        // turn SMF's extended quotes into quotes that can be parsed by phpBB
        if (strpos($message, '[quote') !== false)
        {
                $message = preg_replace('/\[quote=(.*?)\]/s', '[quote="\1"]', $message);
                $message = preg_replace('/\[quote=""(.*?)""\]/s', '[quote="\1"]', $mes
sage); // Removes double quotes inserted by previous preg_replace
                $message = preg_replace("#\[quote author=(.+?) link=.+?\]#i", '[quote="\1"]', $message);
                $message = preg_replace("#\[quote author="(.+?)"\]#i", '[quote="\1"]', $message);
                $message = preg_replace("#\[quote author=(.+?)\]#i", '[quote="\1"]', $message);

                // let's hope that this solves more problems than it causes. Deal with escaped quotes.
                $message = str_replace('\"', '"', $message);
                $message = str_replace('\"', '"', $message);
        }

        $message_parser->message = $message;

        // Already the new user id ;)
        $user_id = $convert->row['id_member'];

        $message = str_replace('<br />', "\n", $message);

        // make the post UTF-8
        $message = smf_set_encoding($message);

        $message_parser->warn_msg = array(); // Reset the errors from the previous message
        $message_parser->message = $message;
        unset($message);
But I have no clue on what to change to fix this.

Another issue is that on a converted forum, this works:

Code: Select all

[img]https://www.imagehost.nl/broodjes.jpg[/img]
but this does not work, whilest this works on any other phpbb forum (at least 3.2.1 versons):

Code: Select all

[img]https://www.imagehost.nl/broodjes.jpg]Lekkere Broodjes[/img]
Or does this only work on 3.2.1. and not on 3.0.14?

Any help is greatly appreciated!
Blacktiger63
Registered User
Posts: 55
Joined: Thu Oct 17, 2013 7:43 pm

Re: SMF 2.0.14 to phpBB 3.2.1

Post by Blacktiger63 »

Fixed the quote stuff by replacing &amp;quot; by &quot; in all 4 or 5 lines, which seemed to fix the issue.

Now all is left is the thing with the images.

Next to that in the beginning of the conversion I've encountered this issue once:
functions_smf20.php [ 1456 ]:
Post ID: Message parser error:

Your message contains too few characters.
It seems I'm losing 18 posts due to this error, but I don't know what is causing it.

This is line 1456:

Code: Select all

$convert->p_master->error('<span style="color:red">' . $user->lang['POST_ID'] . ': ' . $msg_id . ' ' . $user->lang['
CONV_ERROR_MESSAGE_PARSER'] . ': <br /><br />' . implode('<br />', $message_parser->warn_msg), __LINE__, __FILE__, true);
If these 2 things (img code and this error) can be fixed this would be great.

Php 5.6.32
Mysql 5.5.58
Apache 2.4.29
16 GB memory
memory_limit in php.ini = 256

This is the complete part of the code which contains line 1456:

Code: Select all

        // parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote
_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
        $message_parser->parse($enable_bbcode, $enable_magic_url, $enable_smilies, true, true, true, true);

        if (sizeof($message_parser->warn_msg))
        {
                $msg_id = isset($convert->row['post_id']) ? $convert->row['post_id'] : $convert->row['privmsgs_id'];
                $convert->p_master->error('<span style="color:red">' . $user->lang['POST_ID'] . ': ' . $msg_id . ' ' . $user->lang['
CONV_ERROR_MESSAGE_PARSER'] . ': <br /><br />' . implode('<br />', $message_parser->warn_msg), __LINE__, __FILE__, true);
        }

        $convert->row['mp_bbcode_bitfield'] = $convert_row['mp_bbcode_bitfield'] = $message_parser->bbcode_bitfield;
        $convert->row['mp_bbcode_uid'] = $convert_row['mp_bbcode_uid'] = $message_parser->bbcode_uid;

        $message = $message_parser->message;
        unset($message_parser->message);

        return $message;
}
Post Reply

Return to “[3.2.x] Convertors”