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

XF 1.2 YouTube Links

#1
I'm wrapping up my transition from vBulletin 3.7 to XF 1.2. On my vBulletin board, I had a BB Code for embedding YouTube Links, using VB's BB Code Manager.

The user's BB Code would be [YT]youtubevideocode[/YT]

The replacement:

<object width="425" height="350"><param name="movie" value="
"></param><embed src="
" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
After the import, these links no longer work, but my users still visit these threads. Any idea how to update these links?
 

Brogan

XenForo moderator
Staff member
#2
How does the code appear in the posts?

If it is simply the YT tags with the video ID then you can do a simple replacement by running a query:
Code:
UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
So for simple YT tags the queries would be:
Code:
UPDATE xf_post SET message = REPLACE(message,'[YT]','[media=youtube]');
UPDATE xf_post SET message = REPLACE(message,'[/YT]','[/media]');
Take a backup of the database first.
 
#3
How does the code appear in the posts?

If it is simply the YT tags with the video ID then you can do a simple replacement by running a query:
Code:
UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
So for simple YT tags the queries would be:
Code:
UPDATE xf_post SET message = REPLACE(message,'[YT]','[media=youtube]');
UPDATE xf_post SET message = REPLACE(message,'[/YT]','[/media]');
Take a backup of the database first.
Looks like that will work. I'll run the replacement query after the backup.

Thanks for all the help.