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

XF 1.4 Youtube BBcode not parsing

Discussion in 'Troubleshooting and Problems' started by Soyuz, May 8, 2015.

  1. Soyuz

    Soyuz Member

    Does anyone know why the [ youtube ] [ /youtube] BBcode is not parsing in my forum? (screenshot attached). It's a migrated forum (from phpBB). Curious thing: if I edit the post and put a carriage return behind the youtube bbcode, it parses to...

    Code:
    [youtube][MEDIA=youtube]6dTUFVvqla4[/MEDIA]
    ...and the video appears, but with that [ youtube ] left behind.
     

    Attached Files:

  2. Brogan

    Brogan XenForo Moderator Staff Member

    The XF bb code tag is media=youtube, not youtube.

    You will either need to create a new youtube bb code tag, or replace all instances with media=youtube.
    Code:
    UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
     
    ideenwerk likes this.
  3. Soyuz

    Soyuz Member

    Ok thank you :) Anyway I'm not sure how to proceed, because there are several valid URLs for inserting youtube videos, i.e.:

    Code:
    youtube.com/watch?v=XXXX
    youtu.be/XXXX
    ...and the Custom BBcode editor does not work in this way. It does not accept strings like that (you just create the BBcode and it assumes that the whole string between BBcodes is the {text}). Or maybe I'm not used to it yet...
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You can add as many different URL types as you like.

    upload_2015-5-8_23-32-14.png
     
  5. Soyuz

    Soyuz Member

    Excuse me, I don't find that "Match URLs" form in my Home > Custom BBCodes screen... ¿?
     
  6. Soyuz

    Soyuz Member

    Ok! Now I see. It's Media BBcodes, not Custom BBcodes. Thank you ;)
     
  7. Soyuz

    Soyuz Member

    Mmm but there is already a Youtube Media BBCode. I can't create a new one for parsing the existing [ youtube ] BBcodes.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Code:
    UPDATE xf_post SET message = REPLACE(message, '[youtube]', '[media=youtube]');
    UPDATE xf_post SET message = REPLACE(message, '[/youtube]', '[/media]');
     
  9. Mike

    Mike XenForo Developer Staff Member

    It sounds like your YouTube BB code took the entire URL as the argument, which isn't how the media tag works. That's not something that would be easy to convert unless you are comfortable writing various regular expressions (and using a tool to do the replacement). You may need to create a custom BB code (though without PHP, it's unlikely to be able to embed the video).
     

Share This Page