• 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

#1
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.
 

Attachments

Brogan

XenForo moderator
Staff member
#2
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');
 
#3
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...
 
#7
Mmm but there is already a Youtube Media BBCode. I can't create a new one for parsing the existing [ youtube ] BBcodes.
 

Brogan

XenForo moderator
Staff member
#8
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');
Code:
UPDATE xf_post SET message = REPLACE(message, '[youtube]', '[media=youtube]');
UPDATE xf_post SET message = REPLACE(message, '[/youtube]', '[/media]');
 

Mike

XenForo developer
Staff member
#9
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).