Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Auto Youtube Link-Converter Details »»
Auto Youtube Link-Converter
Version: 1.4, by Disasterpiece Disasterpiece is offline
Developer Last Online: Oct 2019 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.1.2 Rating:
Released: 03-31-2011 Last Update: 05-22-2011 Installs: 795
Uses Plugins
Re-useable Code  
No support by the author.

So basically this is a total easy-to-implement plugin, which converts standard youtube links to video-embeds on the fly without urging users to use the video-button because I think it is unnecessary.


On post display, the plugin checks if the post contains at least 1 youtube link in the form of
Code:
<a href="http://www.youtube.com/watch?v=somecode&some=params">http://www.youtube.com/watch?v=somecode&some=params</a>
and converts them using the default vB video bbcode parser.

Code can be modified to fit your needs, altough there shouldn't be much to add.
If you're the special performance-freak, I'm curious if you can enhance data/query-performance. So let me know if you do.

INSTALL:

- Download attached XML File and import it as an addon.

Code:
Changes since 1.3:
- Now works properly on iPad

Changes since 1.2:
- Supports mobile devices with fallback-display if browser doesn't support flash/embed codes
- Allows the user to specify the above mentioned replacement code for mobile browsers
- Minor improvements & Fixes

Changes since 1.1:
- Moved regular expression and index position into admincp settings to allow easier changing in the future
- supports new youtube link format: "http://youtu.be/*somevideocode*"

Changes since 1.0: (or: why should I download that mod again?)
- Added Link parsing in post-preview mode and in post reviewbits (the latest posts you see under the new reply form)

Now every post containing youtube-links should display the embedded video instead.
Works with any number of youtube-links and any kind of text surrounding them.

Let me know if you have trouble/questions.

Download Now

File Type: xml product-autoytparser_1_1.xml (2.7 KB, 365 views)
File Type: xml product-autoytparser_1_2.xml (4.3 KB, 190 views)
File Type: xml product-autoytparser_1_3.xml (7.8 KB, 251 views)
File Type: xml product-autoytparser_1_4.xml (7.8 KB, 3453 views)

Show Your Support

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

Comments
  #62  
Old 05-05-2011, 11:35 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
Updated to 1.3

Supports mobile devices for flash/embed-less browsers


// P.S.

Vote for me @ MOTM !
Thank you for all your support!
Updated to 1.3 with thanks ..

Continues to work fine on my computer (MacBook Pro) running FireFox, as tested with post YouTube link shown below ... :up:

Tested accessing site from my two mobile devices using this YouTube link shown in a post.

http://www.youtube.com/watch?v=9E7GLdYhm3s

iPhone 4 ... :up: (video window appears and link marked YouTube Link shows above it.)

iPad .... :down: (post is blank .. no video or link shown ... when post is edited, link above shows fine)

Hope this helps track down any problems ...

Regards,
Doug

Edit: Follow up.. as a test, I DISABLED mod and checked post on iPad following that. Link to YouTube video then appears in post. I ENABLED mod again and post becomes blank again... no video, no pic.
Reply With Quote
  #63  
Old 05-06-2011, 05:43 PM
grc grc is offline
 
Join Date: Oct 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
Updated to 1.3

Supports mobile devices for flash/embed-less browsers


// P.S.

Vote for me @ MOTM !
Thank you for all your support!
One of my guys says he now has a link:
Quote:
Hey, I *do* see a difference on my iPhone! It looks the same on my Chrome browser with a Flash-blocking plugin installed, but on my iPhone I now see a thumbnail image of the video along with a clickable link!
Thanks for the update!
Reply With Quote
  #64  
Old 05-06-2011, 06:00 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, browsers that do not support the embed/flash-functionalities, have a fallback to the youtube preview image and a link to the youtube page attached. This is the (best) standard X3 conform method i could find
Reply With Quote
  #65  
Old 05-08-2011, 06:28 AM
Juggernaut Juggernaut is offline
 
Join Date: Dec 2009
Location: California
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Voted for MOTM
Reply With Quote
  #66  
Old 05-08-2011, 09:22 AM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone else tried this on the iPad?

See my post above where neither link or video appear with 1.3 ...

However, does appear fine on iPhone 4 with same Safari browser and same operating system.

Thanks ...

Regards,
Doug
Reply With Quote
  #67  
Old 05-08-2011, 12:12 PM
General Zod General Zod is offline
 
Join Date: Feb 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Greta mod working for me on 4.1.3
Reply With Quote
  #68  
Old 05-08-2011, 03:41 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BadgerDog View Post
Anyone else tried this on the iPad?

See my post above where neither link or video appear with 1.3 ...

However, does appear fine on iPhone 4 with same Safari browser and same operating system.

Thanks ...

Regards,
Doug
I'll test it soon on ipad, I have no access to it yet.

But as failsafe, you could change the fallback code to only image and link, so if a mobile browser is detected, don't use the default vB video embed at all.

You can accomplish this when you change the fallback embed code in the plugin's settings to this:
HTML Code:
<a href="http://www.youtube.com/watch?v=%1$s">
YouTube Video:<br /><img src="http://img.youtube.com/vi/%1$s/0.jpg" width="240" height="180" alt="Click here to view on youtube" /></a>
This ensures that the browser will display at least something instead of blank space in some cases.
Reply With Quote
  #69  
Old 05-08-2011, 05:58 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
I'll test it soon on ipad, I have no access to it yet.

But as failsafe, you could change the fallback code to only image and link, so if a mobile browser is detected, don't use the default vB video embed at all.

You can accomplish this when you change the fallback embed code in the plugin's settings to this:
HTML Code:
<a href="http://www.youtube.com/watch?v=%1$s">
YouTube Video:<br /><img src="http://img.youtube.com/vi/%1$s/0.jpg" width="240" height="180" alt="Click here to view on youtube" /></a>
This ensures that the browser will display at least something instead of blank space in some cases.
Thanks ...

What is the name of the plugin? I can't seem to find where to put that new code exactly, or what existing code to replace ...

I'm not the brightest light bulb programmer in the room ..

Regards,
Doug
Reply With Quote
  #70  
Old 05-08-2011, 06:11 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The Settings from Auto Youtube Viewer in your vB AdminCP > Settings > Auto Youtube Link Converter

I added an option in version 1.3 exactly for that purpose
Reply With Quote
  #71  
Old 05-08-2011, 06:34 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
The Settings from Auto Youtube Viewer in your vB AdminCP > Settings > Auto Youtube Link Converter

I added an option in version 1.3 exactly for that purpose
Ok...

That code is exactly what's in that box right now at the last line?

Code:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/%1$s" width="480" height="360">
<param name="movie" value="http://www.youtube.com/v/%1$s" />
<param name="quality" value="high" />
<param name="allowFullScreen" value="true" />
<!-- Fallback content -->
<a href="http://www.youtube.com/watch?v=%1$s">
YouTube Video:<br /><img src="http://img.youtube.com/vi/%1$s/0.jpg" width="240" height="180" alt="Click here to view on youtube" /></a>
</object>
Regards,
Doug
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 11:36 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.07653 seconds
  • Memory Usage 2,367KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (2)bbcode_html
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (13)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete