Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
YouTube BB Code (W3C-compliant!) Details »»
YouTube BB Code (W3C-compliant!)
Version: 1.3.5, by Fangs404 Fangs404 is offline
Developer Last Online: Sep 2019 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 3.7.x Rating:
Released: 10-21-2008 Last Update: Never Installs: 80
Re-useable Code Translations  
No support by the author.

I searched for a decent YouTube BB code tag here, but every single one of them uses the embed tag, which is an illegal XHTML tag. I set out to find a way to create a W3C-compliant YouTube BB code tag, and this is what you see here.

Title: YouTube
BB Code Tag Name: youtube
Replacement:
HTML Code:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/{param}&fs=1&hd=1" width="644" height="390"><param name="movie" value="http://www.youtube.com/v/{param}&fs=1&hd=1" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><a href="http://www.youtube.com/watch?v={param}">http://www.youtube.com/watch?v={param}</a></object>
Example: [youtube]zlfKdbWwruY[/youtube]
Description: Embed a YouTube video. You <b>only</b> put the video ID in between the BB code tags (<b>NOT</b> the full URL!). Embedding <b>must</b> be enabled for the video!
Use Option: No
Image:

Important Note!
A link to the YouTube video is displayed if the YouTube video fails to load. There are a variety of reasons this might occur:

- You didn't properly enter the video ID between the BB code tags.
- You don't have the latest version of Flash.
- You are using Firefox and have a conflicting extension (AdBlock, NoScript, a Greasemonkey script, etc).
- The video doesn't allow embedding.
- You have some other problem on your end (corrupt browser install, spyware, virus, etc.).
- YouTube is currently having a problem.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-02-2009, 06:07 AM
Phaedrus Phaedrus is offline
 
Join Date: Jul 2006
Location: Colorado
Posts: 617
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this work with other video sites, just setting the {param} differently?
Reply With Quote
  #23  
Old 01-02-2009, 09:01 PM
Dingo14 Dingo14 is offline
 
Join Date: Dec 2007
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does anyone know if this draws on your server bandwidth to run the youtube videos like this just curious thanks
Reply With Quote
  #24  
Old 01-11-2009, 07:31 PM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Daryn View Post
Most of the HD videos I see on youtube are at 1280x720. The HD tag embeds at 630x380. Changing the size in the embed code seems to work, but is there anything else to change to get the full size in an embed?
I checked the size that YouTube actually uses (which isn't easily done since YouTube has a really complicated embedding scheme involving JavaScripts - I just took a screenshot and measured it), and it's actually not true 720p. YouTube displays at 858x508 for some odd reason, so that's what I'll alter the script to use.

Quote:
Originally Posted by Vaupell View Post
Installed and working, except when using the "botton" feature it adds spaces around
the video id, so you manually have to remove the extra spaces for it to work.

makes this

[youtubehd]
bIgslPPC1BA
[/youtubehd]

instead of [youtubehd]bIgslPPC1BA[/youtubehd]

Tx again.



But nice and installed. .
I don't see this problem. When I hit the button, it just displays , no spaces or new lines. Glad you like it, though.

Quote:
Originally Posted by Dingo14 View Post
does anyone know if this draws on your server bandwidth to run the youtube videos like this just curious thanks
No, it doesn't use any bandwidth from your server.

Quote:
Originally Posted by Phaedrus View Post
Would this work with other video sites, just setting the {param} differently?
It's not quite that straightforward, but most video sites have embedding code. Just alter the URL before/after the {param} and it should work. I've already modified the same code for Vimeo.
Reply With Quote
  #25  
Old 01-13-2009, 06:26 AM
dismas's Avatar
dismas dismas is offline
 
Join Date: Jun 2007
Location: Vermont
Posts: 720
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this, or any, embedded YouTube code make it so that "mature content" videos either can't be screened or have it so that the end user has to confirm that they are of age?
Reply With Quote
  #26  
Old 01-13-2009, 07:09 PM
Phaedrus Phaedrus is offline
 
Join Date: Jul 2006
Location: Colorado
Posts: 617
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fangs404 View Post
It's not quite that straightforward, but most video sites have embedding code. Just alter the URL before/after the {param} and it should work. I've already modified the same code for Vimeo.
Well, yeah, and you'd have to use different tags, but I can see what you mean.

Excellent. I think I'll do this rather than the passive hack.

See if I can get people used to it by disabling the other hack in other forums...
Reply With Quote
  #27  
Old 01-14-2009, 02:02 AM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just tested it, and it appears that this does get by the age filter. The video I tried played just fine and didn't ask for an birthday or anything.
Reply With Quote
  #28  
Old 01-14-2009, 01:52 PM
Chrakker Chrakker is offline
 
Join Date: Jan 2009
Location: Germany
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I always can NOT drop down the Thread Tools Menue ever when a post has been made with a Video in it ;S
IS that a bug?
had to uninstall it, because of that ;S
Reply With Quote
  #29  
Old 01-14-2009, 03:06 PM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's definitely not a bug with my BBCode. It's just a simple object HTML. It sounds like a browser bug on your end or maybe a bug with your template.
Reply With Quote
  #30  
Old 01-14-2009, 07:49 PM
M3xital's Avatar
M3xital M3xital is offline
 
Join Date: Jan 2009
Location: Italy
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,
Thanks a lot, it works great!
Reply With Quote
  #31  
Old 01-15-2009, 09:27 AM
Gweebs Gweebs is offline
 
Join Date: Jan 2009
Location: West Midlands, UK
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Having problems with the youtube button image in the post a reply box. It works if I use a url from another site, but can't get it to link from my site (probably doing something wrong).

Also in FireFox it just shows the text and not a button (wrap [youtube] tags around text).
Probably because there's a prob with the image button.

Anyway, help!!!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04993 seconds
  • Memory Usage 2,313KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete