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

XF 1.2 display media after vbulletin import

Discussion in 'Installation, Upgrade, and Import Support' started by Mr Lucky, Nov 14, 2013.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    Is there a way that e.g. youtube videos will display after an import from vbulletin without having to edit each post individually?

    Thanks
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Are they attempting to be displayed with BB Code with add-ons such as ame for vBulletin?
     
  3. Mr Lucky

    Mr Lucky Well-Known Member


    Sorry, I'm not sure what that is. The vbulletin forum i am importing from is v4.2 and has no media addons

    In the imported forum, the post just shows the code like this:

    Code:
    [video=youtube_share;gQV8yReZQY8]http://youtu.be/gQV8yReZQY8[/video]
    If I edit it to:

    Code:
    [media=youtube]gQV8yReZQY8[/media]
    Then it displays as embedded video rather than just code:

     
  4. Adam Howard

    Adam Howard Well-Known Member

    Back up your database first, but the quick and easy way to do this would be to run this command in MySQL (or phpMyAdmin)

    PHP:
    UPDATE xf_post SET message REPLACE(message'[youtube]''[media=youtube]');
    UPDATE xf_post SET message REPLACE(message'[/youtube]''[/media]');
     
  5. Adam Howard

    Adam Howard Well-Known Member

  6. Brogan

    Brogan XenForo Moderator Staff Member

    That won't work for the opening tag as it is formatted like this:
    [video=youtube_share;gQV8yReZQY8]

    Not to mention you are trying to replace 'youtube' and the string is 'video'.

    That will require regex due to it containing the video ID.
    Use this tool: http://xenforo.com/community/resources/post-content-find-replace.1549/
     
  7. Mr Lucky

    Mr Lucky Well-Known Member

    That doesn't seem right. The current imported code=

    Code:
    [video=youtube_share;gQV8yReZQY8]http://youtu.be/gQV8yReZQY8[/video]
    And has no [youtube] or [/youtube]
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

  9. Mr Lucky

    Mr Lucky Well-Known Member


    Yes, I have installed that but am a bit confused as there are (at least) two different formats of the embed:

    Code:
    [video=youtube;g0uAlX9RSEI]http://www.youtube.com/watch?v=g0uAlX9RSEI[/video]
    or

    Code:
    [video=youtube_share;gQV8yReZQY8]http://youtu.be/gQV8yReZQY8[/video]
    Will that RegEx work for both?

    NB: this question is now at two threads as I asked over on the Post Replacement Tool Thread so my apologies for sort of cross posting. I am concerned to get this right as I get the feeling if it's wrong it gets really complicated, though of course the database is backed up.
     

Share This Page