1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Removing MyBB tags after importing database

Discussion in 'Troubleshooting and Problems' started by Moi EtOuir, Sep 8, 2011.

  1. Moi EtOuir

    Moi EtOuir New Member

    Hi,

    I got a problem after importing a MyBB database to Xenforo
    (I did Mybb -> Vbulletin -> Xenforo)

    All the tags like this :
    [align=center][/align]
    [size=x-small][/SIZE]

    Are not working, it's just showing the text
    I can't find a way to remove all the tags from the messages, or change them to blank :/

    I don't know regex/regular expressions, I didn't go that far in php :)

    ( http://xenforo.com/community/threads/post-content-find-replace.6548/ )
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can use Kier's addon to replace the old BB code with new BB code. For example, [align=center][/align] should be replaced with [center][/center].
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here are the values you can use in that addon.

    Updating the [align=center][/align] tags:

    Quick Find:
    [align​

    Regular Expression:
    #\[align=center\](.*)\[/align\]#siU​

    Replacement String:
    [center]\1[/center]​

    Screenshot:

    Screen shot 2011-09-07 at 8.45.45 PM.png

    Updating the [size=x-small][/size] tags:

    Quick Find:
    [size​

    Regular Expression:
    #\[size=x-small\](.*)\[/size\]#siU​

    Replacement String:
    [size=1]\1[/size]​

    Screenshot:

    Screen shot 2011-09-07 at 8.52.18 PM.png
     
    smimosmile, Lilybet and Moi EtOuir like this.
  4. Moi EtOuir

    Moi EtOuir New Member

    Thank you, you are awesome :p

    Too bad it doesn't clean the tags when there are multiple lines or images etc, we'll have to clean a lot of the messages and signatures (there are 20 000 members and 250k messages, good luck to us ^^)
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    You could also try a simple replace using SQL, which may capture some of the others.

    For example:
    Code:
    UPDATE xf_post SET message = REPLACE(message,'[size=x-small]','[SIZE=1]')
    You won't be able to do that with the closing align tag though as it will vary depending on whether it is center, right or left.
     

Share This Page