[Convertor] vBulletin 3.x to phpBB3

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Scam Warning
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

Thanks Mario, tomorrow I will try it.

About color: do you mean that phpBB will interpretate "SandyBrown"?? :?: :!:
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs

Re: [Convertor] vBulletin 3.x to phpBB3

Post by canonknipser »

Tom1884 wrote:About color: do you mean that phpBB will interpretate "SandyBrown"?? :?: :!:
Test it: this should be SandyBrown
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
mario_7
Registered User
Posts: 14
Joined: Wed Mar 23, 2011 12:06 am

Re: [Convertor] vBulletin 3.x to phpBB3

Post by mario_7 »

As i wrote previously - phpBB accepts both names and hex values for colors. The important thing is valid syntax:

Code: Select all

[color="SandyBrown"]this will NOT work[/color]
this will NOT work

Code: Select all

[color=SandyBrown]this will work[/color]
this will work

Same thing is for hex values:

Code: Select all

[color="#0000FF"]this will NOT work[/color]
this will NOT work

Code: Select all

[color=#0000FF]this will work[/color]
this will work

My script strips quotes from color tags so phpBB will be able to parse them properly.
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

Thanks! ;)
I've run this script:

Code: Select all

function vb3_replace_size($matches) {
        $new_size = array(
            1 => "75",
            2 => "100",
            3 => "110",
            4 => "130",
            5 => "150",
            6 => "180",
            7 => "200"
        );
        return '[size=' . $new_size[$matches[1]] . ']';
}

while ($row = mysql_fetch_array($result)) {
        $oldid = $row['post_id'];
        $message = $row['post_text'];
        if (stripos($message, '[size=') !== false) {
            $message = preg_replace_callback('/\[size=\"(\d*)\"\]/i', 'vb3_replace_size', $message);
            $message = str_replace("[/SIZE]", "[/size]", $message);
        }
        if (stripos($message, '[color=') !== false) {
            $message = preg_replace('/\[color=\"(\w*)\"\]/i', '[color=$1]', $message);
            $message = str_replace("[/COLOR]", "[/color]", $message);
        }

    
// UPDATE
	$queryupdate = "UPDATE forumfanta_posts SET post_text = '$message' WHERE post_id = '$oldid'";
	mysql_query($queryupdate, $db);
	$i++;
}
After the php run correctly, we still have 3 problem:
1- some post aren't affected from any modification. Ex:
Image

2- where the code is correctly modified (post affected by php run), sometimes the post doesn't "interpretate". Image
I have to edit the post, without modifying anything, and save: then it looks ok!

3- the script doesn't modified some "caped" tags as, for ex.: [SIZE=""], it remains the same. Look:
Image
Last edited by Tom1884 on Mon Nov 14, 2011 9:40 am, edited 2 times in total.
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

Tom1884 wrote: After the php run correctly, we still have 3 problem:
the code is correctly modified, but the post doesn't "interpretate". Image
I have to edit the post, without modifying anything, and save: then it looks ok!

I can fix it reparsing BBcode with stk tool, but then all the posts on the forum result edited by me!
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

up

(sorry, but I have to go online in 24h)
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote

Re: [Convertor] vBulletin 3.x to phpBB3

Post by D¡cky »

Tom1884 wrote:I can fix it reparsing BBcode with stk tool, but then all the posts on the forum result edited by me!
This is the first time I have heard of this happening with the STK. Are you sure the edited marker was not there before running the STK?

To clear the "edited by" for ALL posts, run this query in phpMyAdmin

Code: Select all

UPDATE phpbb_posts SET post_edit_time='', post_edit_reason='', post_edit_user='', post_edit_count=''
Replace the table prefix phpbb_ with your table prefix if your table prefix is different.

To clear the "edited by" for posts edited by you, run this query in phpMyAdmin

Code: Select all

UPDATE phpbb_posts SET post_edit_time='', post_edit_reason='', post_edit_user='', post_edit_count= WHERE post_edit_user = xx
Replace xx with your user_id and replace the table prefix phpbb_ with your table prefix if your table prefix is different.
Have you hugged someone today?
mario_7
Registered User
Posts: 14
Joined: Wed Mar 23, 2011 12:06 am

Re: [Convertor] vBulletin 3.x to phpBB3

Post by mario_7 »

Tom1884 wrote:1- some post aren't affected from any modification. Ex:
(...)
3- the script doesn't modified some "caped" tags as, for ex.: [SIZE=""], it remains the same. Look:
Does this affect whole posts or only parts of them?
Are you sure that your while loop covers all posts?
Does the script finish it's work without errors (like timeout or out of memory or anything else)?
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

mario_7 wrote:
Tom1884 wrote:1- some post aren't affected from any modification. Ex:
(...)
3- the script doesn't modified some "caped" tags as, for ex.: [SIZE=""], it remains the same. Look:
Does this affect whole posts or only parts of them?
Are you sure that your while loop covers all posts?
Does the script finish it's work without errors (like timeout or out of memory or anything else)?
I've solved this part of the problem. MySql had problem with ' when updating, so it died.
I solved updating this way, with addslashes php function:

Code: Select all

query="UPDATE forum_posts SET post_text = '".addslashes($message)."' WHERE post_id = $id_post";
Anyway, ok, I've modified all the posts correctly but I still have the "parsing problem": new (and correct) code isn't interpretate and it's visualizated as it is in every edited post.
mario_7
Registered User
Posts: 14
Joined: Wed Mar 23, 2011 12:06 am

Re: [Convertor] vBulletin 3.x to phpBB3

Post by mario_7 »

addslashes is not solution. You should use mysql_real_escape_string() function for escaping post's text before placing it in SQL query.
Tom1884 wrote:Anyway, ok, I've modified all the posts correctly but I still have the "parsing problem": new (and correct) code isn't interpretate and it's visualizated as it is in every edited post.
Do you mean that the option in STK to reparse BBCodes does not work at all?
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

mario_7 wrote:Do you mean that the option in STK to reparse BBCodes does not work at all?
No no, STK works perfectly, it solves the problem! But it makes appear in every post the line "Edited by ... on ...", like it was the author of the post to edit the post (probably editing only post_edit_* column...?].
Before STK
Immagine 2.png
After STK
Immagine 4.png
You do not have the required permissions to view the files attached to this post.
mario_7
Registered User
Posts: 14
Joined: Wed Mar 23, 2011 12:06 am

Re: [Convertor] vBulletin 3.x to phpBB3

Post by mario_7 »

Does it make any problems? As far as I remember those informations are not visible for users without privileges to modify posts.

After all you could make use of D¡cky's advice to get rid of them. You could clear all "edited by" informations because after using convertor all posts are "unmodified" (history of edits is not converted from vBulletin).
Tom1884
Registered User
Posts: 39
Joined: Mon Apr 19, 2010 5:24 pm

Re: [Convertor] vBulletin 3.x to phpBB3

Post by Tom1884 »

mario_7 wrote:Does it make any problems? As far as I remember those informations are not visible for users without privileges to modify posts.
Yes, it makes problems for me because in my forum we manage a game in which post time is part of the rules... ;) so, right, I modded forum to show that edit line every time...

Anyway, I run Dicky's script and solved ALL the problem ;)
But have to modify it this way, 'cause of the integer db field (or script died).

Code: Select all

UPDATE phpbb_posts SET post_edit_time='0', post_edit_reason='', post_edit_user='0', post_edit_count='0'
I've finished migration from vB to phpBB. It wasn't so immediate as convertor made think.
Convertor is bad in BBcode parsing.
Anyway, I went out of it. Thanks all for support, mario_7 first! ;)
mario_7
Registered User
Posts: 14
Joined: Wed Mar 23, 2011 12:06 am

Re: [Convertor] vBulletin 3.x to phpBB3

Post by mario_7 »

I told you to use my version of convertor - I have fixed few things there, including BBCodes.

At least now people will know what to do with broken BBCodes. ;)
prevzemaj
Registered User
Posts: 23
Joined: Mon Dec 19, 2011 11:04 pm
Location: Macedonia
Name: J Trajkovski

Re: [Convertor] vBulletin 3.x to phpBB3

Post by prevzemaj »

Help PLS

Image

Return to “[3.0.x] Convertors”