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
  #52  
Old 04-22-2011, 02:11 PM
zelnik zelnik is offline
 
Join Date: Aug 2008
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant thanks!
Reply With Quote
  #53  
Old 04-22-2011, 03:54 PM
theoutlawed's Avatar
theoutlawed theoutlawed is offline
 
Join Date: Sep 2010
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good stuff, thanks for the update!
Reply With Quote
  #54  
Old 04-22-2011, 11:07 PM
blue-c blue-c is offline
 
Join Date: Jan 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent - works perfectly, thanks
Reply With Quote
  #55  
Old 04-24-2011, 08:08 PM
ttran ttran is offline
 
Join Date: Aug 2010
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HI Disasterpiece
This 1.2 works well on 4.0.8 Thank You!
I wonder if you can do this kinda code for Flickr and Photobucket Video as well? I think this would be great.
Thanks
Reply With Quote
  #56  
Old 04-24-2011, 09:07 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ttran View Post
HI Disasterpiece
This 1.2 works well on 4.0.8 Thank You!
I wonder if you can do this kinda code for Flickr and Photobucket Video as well? I think this would be great.
Thanks
That's a really interesting idea..... :up:

Perhaps convert the Photobucket [URL] link to an [IMG] link ...

Drives me crazy when folks are too lazy (or don't know how) to do anything but post an HTTP:// link to their pic which takes them off our site.

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

hmm, well you could. But every check costs render time the way it is now. I think this is not the appropriate way to auto-replace more than 1 particular link structure.

I coded and released this mod, because in my case, youtube links are 99% of all links which makes sense to convert them and actually improves usability. For everything else, I suggest to keep an eye out for other similar mods which cover this case.

Flickr can't be easily translated from url to embed, because it's an additional query necessary to check if the author allowed embedding, etc. So that's a bit more difficult to handle than youtube.
Reply With Quote
  #58  
Old 04-24-2011, 11:50 PM
yin9 yin9 is offline
 
Join Date: Dec 2010
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this mod, it work with almost all videos in my forum, but I can't do that with this URL format:

http://www.youtube.com/v/2jql3tUuiFU


My forum have many videos with that format. Can you help me?

Too have many videos with spanish subdomain in URL and Without "www", but i solved this changing in RegEx "www\.youtube\.com" by ".*\youtube\.com":

Code:
/<a href=\"https?:\/\/((.*\youtube\.com\/watch\?v=)|(youtu\.be\/))([a-zA-Z0-9-_]+)(.*)?\"( target=\"_blank\")?>.*<\/a>/

Thanks in advance, greetings.
Reply With Quote
  #59  
Old 05-04-2011, 04:16 PM
grc grc is offline
 
Join Date: Oct 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry if this has already been asked, but I don't see it....

A few users are complaining that their browser/device doesn't see the videos when they are embedded in a post. If they have the link to youtube, they can view in youtube (why is beyond me).

Anyway, is there a way that, say, beneath the video, the link to it on youtube can be shown?

Thanks for the nifty mod.
Reply With Quote
  #60  
Old 05-04-2011, 07:10 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by grc View Post
Sorry if this has already been asked, but I don't see it....

A few users are complaining that their browser/device doesn't see the videos when they are embedded in a post. If they have the link to youtube, they can view in youtube (why is beyond me).

Anyway, is there a way that, say, beneath the video, the link to it on youtube can be shown?

Thanks for the nifty mod.
I noticed this as well, but I can't explain it yet. Fact is: The mod only replaces the link code to embed code. Maybe for special devices (iphone, smartphones in general) there is a special code necessary.
I'll check this out and keep you posted.
Reply With Quote
  #61  
Old 05-05-2011, 05:57 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated to 1.3

Supports mobile devices for flash/embed-less browsers
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:18 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.05330 seconds
  • Memory Usage 2,354KB
  • 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_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