XF 1.4 Youtube BBcode not parsing

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.
 

Attachments

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');
 

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

Soyuz

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

Soyuz

Member
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
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
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).
 
Top