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

XF 1.2 BBcode YouTube embeds

#1
Since importing from vB4, all of our YouTube embedded videos are appearing like this:

Code:
[YOUTUBE]8_ocrenOCPo[/YOUTUBE]
Any suggestions as to how to fix it?
 

Jeremy

Well-known member
#2
You'll need to either edit the post or use Kier's post replacement tool to replace all instances in the database.
 

Brogan

XenForo moderator
Staff member
#5
For simple content such as that, you can use an SQL query, which is what I did.

Code:
UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
Take a backup first though.
 
#6
No idea what I need to do to replace those BB codes. Can anybody help please?

I guess I need to search for the first and last parts of the code and replace these?

[YOUTUBE]

[/YOUTUBE]
 

Brogan

XenForo moderator
Staff member
#7
Code:
UPDATE xf_post SET message = REPLACE(message,'[YOUTUBE]','[media=youtube]');
Code:
UPDATE xf_post SET message = REPLACE(message,'[/YOUTUBE]','[/media]');
Rebuild the search index once done.
 

Brogan

XenForo moderator
Staff member
#9
As I mentioned in my earlier post, you can enter those as direct SQL queries in phpMyAdmin, rather than use the add-on.