View Full Version : Issues with youtube bbcode
Vcize
07-06-2011, 02:07 PM
I have the following bbcode replacement for users to use when inserting a youtube video into a post:
<iframe width="560" height="349" src="http://www.youtube.com/embed/{param}" frameborder="0" allowfullscreen></iframe>
This works great when the user uses the tag correctly and inserts only the video ID. However, if the user pastes in the entire URL, which they often do by mistake, it causes the entire thread to be redirected to youtube any time someone opens it.
Is there a way to handle the user putting in a full URL rather than just the video ID and fail gracefully?
You could use this mod: https://vborg.vbsupport.ru/showthread.php?t=261296
Vcize
07-06-2011, 02:27 PM
You could use this mod: https://vborg.vbsupport.ru/showthread.php?t=261296
Thanks, I'd still prefer that users be able to post them as links when they want to though, and not auto-embed them all.
Also, I'm not sure this would actually solve the problem of when a user puts a link inside a BBcode tag.
There's got to be a solution for this out there, tons of people use custom bbcode's for youtube embeds and they can't all just be letting their forum redirect whenever anyone puts a full URL in there...
--------------- Added 1310015826 at 1310015826 ---------------
Anyone? This just started happening recently too. Did youtube change their embed code or something?
GavoTrav
07-08-2011, 09:13 PM
Thanks, I'd still prefer that users be able to post them as links when they want to though, and not auto-embed them all.
Also, I'm not sure this would actually solve the problem of when a user puts a link inside a BBcode tag.
There's got to be a solution for this out there, tons of people use custom bbcode's for youtube embeds and they can't all just be letting their forum redirect whenever anyone puts a full URL in there...
--------------- Added 1310015826 at 1310015826 ---------------
Anyone? This just started happening recently too. Did youtube change their embed code or something?
If you want auto embed and tell users if they want to just use links they can use [noparse]
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.