• 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

DoctorWatsOn

Well-known member
#1
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?
 

Brogan

XenForo moderator
Staff member
#2
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.
 

bambua

Well-known member
#3

steven s

Well-known member
#5
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.)
 

DoctorWatsOn

Well-known member
#7
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.
Will that work, because the [youtube] tags only include the video ID, whereas xF's [ media=youtube] tags use the whole URL?
 

Brogan

XenForo moderator
Staff member
#8
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.)
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.
 

Brogan

XenForo moderator
Staff member
#11
Is this easier than running the SQL queries?

Not that I know how to do either. :oops:
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.
 

Ray

Active member
#13
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.
That works the best.
Make sure you run both for youtube and YOUTUBE
 

DoctorWatsOn

Well-known member
#14
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.
Oh right, I'll put that on the 'to do list' for my techie before we do the live site upgrade, thanks again.