The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Embed XHTML valid YouTube and Google Video into your posts Details »» | |||||||||||||||||||||||||||
Embed XHTML valid YouTube and Google Video into your posts
Developer Last Online: Dec 2017
Just thought I'd share what I did to allow my users to embed YouTube and Google Video videos into posts on my forum. This is my very first mod I've made since switching to vB, so forgive me if I screwed something up. Demo: http://forums.finalgear.com/test-for...-thread-14892/ The black bar will be different for you as it'll match your theme (it uses the same style as the whole quick reply box). Upgrading from v1.x: Just remove the plugin you added before (manage plugins -> delete) and then continue on to the installation instructions. If you already have v2.x installed, you do NOT need to do this. Installation: Download and install the attached product. It will automatically create the new custom BBCode and add in some filtering plugins. Save the two attached images and upload them to /images/editor/. Usage: Here's some examples: Code:
[youtube]http://www.youtube.com/watch?v=hl2UUunlI2Q[/youtube] [youtube]hl2UUunlI2Q[/youtube] [youtube="http://www.youtube.com/watch?v=hl2UUunlI2Q"]Aston Martin Crash[/youtube] [youtube="hl2UUunlI2Q"]Aston Martin Crash[/youtube] Code:
[gvideo]http://video.google.com/videoplay?docid=3688185030664621355[/gvideo] [gvideo]3688185030664621355[/gvideo] [gvideo="http://video.google.com/videoplay?docid=3688185030664621355"]1980's Izuzu Gemini Advertisement[/gvideo] [gvideo="3688185030664621355"]1980's Izuzu Gemini Advertisement[/gvideo] How do I customize the look of the new box thingies? Just edit the new custom BBCode items. It's in the admin area, near the bottom. Show Your Support
|
Comments |
#112
|
||||
|
||||
Quote:
First, it finds all validly formatted calls to the BBCode and replaces them with [VALIDYOUTUBE12345]gakjh43hj34f[/VALIDYOUTUBE12345]. Anything left over is then bad calls to the BBCode (ex: [YOUTUBE]http://www.yahoo.com/[/YOUTUBE]). These get replaced with [INVALIDYOUTUBE] so that the BBCode parser doesn't replace them and make a broken embed box. Then once the BBCode parser is done, it replaces all of the [INVALIDYOUTUBE]'s with [YOUTUBE]. This results in them displaying as the user typed in (in plain text) with no HTML. However, it seems that second plugin (which puts the tags back) doesn't always work and I'm not quite sure why (since I'm new to vB). That's why you may see [INVALIDYOUTUBE]'s sometimes in your posts rather than [YOUTUBE]http://www.yahoo.com/[/YOUTUBE]. Valid calls to the BBCode though should always work and show up correctly. |
#113
|
||||
|
||||
Quote:
|
#114
|
||||
|
||||
Quote:
|
#115
|
|||
|
|||
A CMPS module would be a great addition for this mod.
Also, if you could have your own player instead of using Google's and YouTube's, it would be a real nice option. |
#116
|
|||
|
|||
Viper, great mod. I also run a SMF forum, version 1.1 RC3,
any chance you can port this over for 1.1RC3? They only have a similar mod for 1.1RC2 and all the suggested hacks to get it to work on RC3 fails. Plus you need to install 2 mods to get what your VB mod does! I know your mod would be greatly appreciated for SMF Any chance it happening? |
#117
|
||||
|
||||
Sounds good....thanks again for taking time out in putting this hack together.
|
#118
|
|||
|
|||
When you click the YouTube icon for example, it brings up a window where you enter in the URL of the video.
Now if I submit my reply without entering in a title within the tags, it does not display the video. I would recommend another pop-up window asking the user to enter in a description or title. |
#119
|
||||
|
||||
Attention :
If you have used something like [gv] before this Update and want to change now all old Codes to [gvideo] operate this SQL Querie. Code:
UPDATE vb3_post SET pagetext = REPLACE(pagetext, '[gv]', '[gvideo]'); UPDATE vb3_post SET pagetext = REPLACE(pagetext, '[/gv]', '[/gvideo]'); UPDATE vb3_post SET pagetext = REPLACE(pagetext, '[GV]', '[gvideo]'); UPDATE vb3_post SET pagetext = REPLACE(pagetext, '[/GV]', '[/gvideo]'); UPDATE vb3_post SET pagetext = REPLACE(pagetext, '[Gv]', '[gvideo]'); UPDATE vb3_post SET pagetext = REPLACE(pagetext, '[/Gv]', '[/gvideo]'); Attention - maybe you have to change Tableprefix. @Viper007Bond - include this to Installinstructions please or use it for coding a AdminCP Option. |
#120
|
|||
|
|||
|
#121
|
|||
|
|||
I am a little confused, you have the example usage thing but how do i make it so when they click to insert the video url it shows more than the [google][ /google] thing but instead the full Usage code you have posted above.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|