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
  #62  
Old 03-30-2009, 08:49 AM
james-76's Avatar
james-76 james-76 is offline
 
Join Date: Feb 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is not working with firefox from today but works fine with IE.
http://www.birdiechance.co.uk/forums...read.php?t=601

Do you have any idea what the issue could be?
Reply With Quote
  #63  
Old 03-31-2009, 05:02 AM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's working just fine for me. It's an issue on your end. Check that you have the latest version of Flash and that you have no conflicting FF extensions (check AdBlock or NoScript).
Reply With Quote
  #64  
Old 03-31-2009, 05:27 AM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just modified both BB codes so that the full screen button is now available. I didn't realize it was missing until someone just told me yesterday.
Reply With Quote
  #65  
Old 03-31-2009, 07:48 PM
james-76's Avatar
james-76 james-76 is offline
 
Join Date: Feb 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have an idea that you might like to add

How you have "Borked"

I have changed it to "Video Error - Check here to make sure you have added it correctly."

This takes them to the FAQ so they can see the example etc.

Ok heres my idea I hope you are able to do it.

Instead of "Borked" could you make it so its an actual link to the correct video on youtube that opens in a new window? This way if the embedding fails on a site like it has mine a few times then it would show a link to video instead.

Thanks a lot
Reply With Quote
  #66  
Old 04-01-2009, 03:49 PM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by james-76 View Post
I have an idea that you might like to add

How you have "Borked"

I have changed it to "Video Error - Check here to make sure you have added it correctly."

This takes them to the FAQ so they can see the example etc.

Ok heres my idea I hope you are able to do it.

Instead of "Borked" could you make it so its an actual link to the correct video on youtube that opens in a new window? This way if the embedding fails on a site like it has mine a few times then it would show a link to video instead.

Thanks a lot
I like that idea a lot.
Reply With Quote
  #67  
Old 04-02-2009, 07:07 AM
james-76's Avatar
james-76 james-76 is offline
 
Join Date: Feb 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe you could have it as:

Quote:
"If no video is showing it could have been added incorrectly or there could be a technical issue.
Click here to view the video on youtube's site. (links to youtube and the correct video)

If you have added this video click here to make sure you have added it correctly. " (links to FAQ about youtube tag and example)
Of course the above would all be worded how you wish as I am just giving rough examples

It says a lot more than one word but it would stop us all coming back here asking whats the problem especially for human error.
I would think you could do this pretty easily but what do I know
Thanks for saying you liked the idea I hope at some point in the future you have some time to give it a try.

Regards,
James
Reply With Quote
  #68  
Old 04-02-2009, 07:40 PM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, here's what I changed it to.

HTML Code:
Something went wrong.  Please make sure you added the video correctly.  Click <a href="misc.php?do=bbcode">here</a> to see how YouTube videos should be embedded.  There could also be a technical issue that's not your fault.  Click <a href="http://www.youtube.com/watch?v={param}">here</a> to view the video on YouTube's site.  If this link doesn't work, you did something wrong.
Thanks for the recommendation. Hopefully this'll save some headaches.
Reply With Quote
  #69  
Old 04-02-2009, 08:22 PM
james-76's Avatar
james-76 james-76 is offline
 
Join Date: Feb 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thit is perfect Thanks very much for your time.

I altered it a little on my site so itgoes straight to the youtube bbcode instead of all bb codes.

<a href="misc.php?do=bbcode#youtube" target="_blank">

Also I made both links open in seperate windows as this suits me but may not suit others

Thanks once again.



Code:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/{param}&fs=1" width="644" height="390"><param name="movie" value="http://www.youtube.com/v/{param}&fs=1" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" />Something went wrong. Please make sure you added the video correctly. Click <a href="misc.php?do=bbcode#youtube" target="_blank">here</a> to see how YouTube videos should be embedded. There could also be a technical issue that's not your fault. Click <a href="http://www.youtube.com/watch?v={param}" target="_blank">here</a> to view the video on YouTube's site. If this link doesn't work, you did something wrong.</object>
Reply With Quote
  #70  
Old 08-12-2009, 03:56 AM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately, it appears that YouTube has removed the ability to embed HQ and HD videos using the &fmt=22 trick. As a result, I'm going to remove the youtubehd tag from my script.
Reply With Quote
  #71  
Old 08-17-2009, 08:06 PM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, HD videos will work again. I had to change &fmt=22 to &hd=1.
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 10:46 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04879 seconds
  • Memory Usage 2,317KB
  • 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_code
  • (2)bbcode_html
  • (2)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
  • (3)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