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

Converting youtube clips embedded with BB-code to xF

Discussion in 'XenForo Questions and Support' started by DoctorWatsOn, Nov 14, 2010.

  1. DoctorWatsOn

    DoctorWatsOn Well-Known Member

    Before vB introduced youtube embedding, I was using BB-code and when I imported my vb4 data into xF it didn’t convert these, so posts just show:

    [youtube]xp9Gm-aRe5A&hl[/youtube]
    OR
    [YOUTUBE]it-gPAhFq1c[/YOUTUBE]

    Is there anyway these can be converted to make them display?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can run some SQL queries to update the post table.

    Code:
    UPDATE xf_post SET message = REPLACE(message, '[youtube]', '[media=youtube]');
    UPDATE xf_post SET message = REPLACE(message, '[/youtube]', '[/media]');
    Make sure you take a backup first....just in case.
     
    DoctorWatsOn likes this.
  3. bambua

    bambua Well-Known Member

    You've got to use regular expressions to do it, but Kier released an addon to do this: http://xenforo.com/community/threads/post-content-find-replace.6548/#post-96086
     
    DoctorWatsOn likes this.
  4. DoctorWatsOn

    DoctorWatsOn Well-Known Member

    WOW that was quick. :cool:

    Thanks guys, I'll go take a look. :)
     
  5. steven s

    steven s Well-Known Member

    I'm going to need this too.
    If only there was a way to bookmark these posts for future use. (Other than saving bookmarks with your browser.)
     
  6. Elizabeth

    Elizabeth Well-Known Member

    Just click "Watch Thread" without email notification.
     
  7. DoctorWatsOn

    DoctorWatsOn Well-Known Member

    Will that work, because the [youtube] tags only include the video ID, whereas xF's [ media=youtube] tags use the whole URL?
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Why not update the BB Code and the post table on your forum now?

    That's what I've done so when it comes to switching I won't need to update anything.
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Once you add the URL, the software strips out everything except the video ID.

    For example, I just added this using the media button on the editor and this is the result:
    [media=youtube]8gFgs_To9GY[/media]
     
    Jake Bunce likes this.
  10. DoctorWatsOn

    DoctorWatsOn Well-Known Member

    Is this easier than running the SQL queries?

    Not that I know how to do either. :oops:
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    Well you will have to run the queries whether you do it on your current database or after you convert as all of the historic post content will have to be updated.

    I just prefer to get as much done beforehand so there is less to do after I switch.
     
  12. steven s

    steven s Well-Known Member

    I guess by default, every thread I posted in is watched.
     
  13. Ray

    Ray Active Member

    That works the best.
    Make sure you run both for youtube and YOUTUBE
     
  14. DoctorWatsOn

    DoctorWatsOn Well-Known Member

    Oh right, I'll put that on the 'to do list' for my techie before we do the live site upgrade, thanks again.
     

Share This Page