XF 1.2 YouTube Links

Wild Onion

Member
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="
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
"></param><embed src="
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
" 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?
 
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.
 
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.
 
Top Bottom