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
  #92  
Old 05-21-2011, 11:21 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The Mod is made vor vbulletin 4 as you can see in the details in the first post, so I give no guarantee that it runs on older versions, now you know why
Reply With Quote
  #93  
Old 05-22-2011, 12:02 AM
Angelyco Angelyco is offline
 
Join Date: Jun 2009
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, I did see that, and didn't see anyone else using anything much older to know if it worked or not, so it didn't hurt to ask! So assuming I had a newer version, I wouldn't need to add anything else to the code?
Reply With Quote
  #94  
Old 05-22-2011, 01:36 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in theory, you must check the script files where the according hooks are located and see how video tags are parsed there. Then you replace the function name with the current in the script, which doesn't seem to exist prior to vb4. The rest of the code should be generative enough that it works on vb3 too.
Reply With Quote
  #95  
Old 05-22-2011, 05:14 PM
inigo inigo is offline
 
Join Date: May 2010
Location: Spain
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod,

working without problems, v4.1.2

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

Updated with version 1.4:

iPad shows replacement properly
Reply With Quote
  #97  
Old 05-24-2011, 07:54 AM
Gamelobby's Avatar
Gamelobby Gamelobby is offline
 
Join Date: Jul 2007
Location: Long Beach, CA
Posts: 997
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Possible to do Game Trailers.?
http://www.gametrailers.com/video/de...-dirt-3/702436

Here is the embed code..
Code:
<div style="background-color:#000000;width:520px;"><div style="padding:4px;"><embed src="http://media.mtvnservices.com/mgid:moses:video:gametrailers.com:702436" width="512" height="288" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" base="." flashVars=""></embed><p style="text-align:left;background-color:#FFFFFF;padding:4px;margin-top:4px;margin-bottom:0px;font-family:Arial, Helvetica, sans-serif;font-size:12px;">Tags: <a href="http://www.gametrailers.com">GameTrailers.com</a>, <a href="http://www.gametrailers.com/video/debut-teaser-dirt-3/702436">Debut Teaser</a>, <a href="http://pc.gametrailers.com/">PC Games</a>, <a href="http://ps3.gametrailers.com/">PlayStation 3</a>, <a href="http://xbox360.gametrailers.com/">Xbox 360</a></p></div></div>

>> Or is it possible to even just add Game Trailers to work with the Video BBCode Button.?

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

Quote:
Originally Posted by Gamelobby View Post
Possible to do Game Trailers.?
http://www.gametrailers.com/video/de...-dirt-3/702436

Here is the embed code..
Code:
<div style="background-color:#000000;width:520px;"><div style="padding:4px;"><embed src="http://media.mtvnservices.com/mgid:moses:video:gametrailers.com:702436" width="512" height="288" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" base="." flashVars=""></embed><p style="text-align:left;background-color:#FFFFFF;padding:4px;margin-top:4px;margin-bottom:0px;font-family:Arial, Helvetica, sans-serif;font-size:12px;">Tags: <a href="http://www.gametrailers.com">GameTrailers.com</a>, <a href="http://www.gametrailers.com/video/debut-teaser-dirt-3/702436">Debut Teaser</a>, <a href="http://pc.gametrailers.com/">PC Games</a>, <a href="http://ps3.gametrailers.com/">PlayStation 3</a>, <a href="http://xbox360.gametrailers.com/">Xbox 360</a></p></div></div>

>> Or is it possible to even just add Game Trailers to work with the Video BBCode Button.?

Thanks
Hello,

Possible: yes.
But: This would go way beyond the scope of this mod.
If you'd like to have an individual solution, you can contact me via PM.
Reply With Quote
  #99  
Old 05-25-2011, 10:48 AM
rhorman rhorman is offline
 
Join Date: Oct 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is awesome! Could you make it so it will center the video? Or where do I change that in the XML?

Thanks!
Reply With Quote
  #100  
Old 05-25-2011, 01:14 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rhorman View Post
This is awesome! Could you make it so it will center the video? Or where do I change that in the XML?

Thanks!
Open the xml file, search for this code occurence:
PHP Code:
$repl[] = $vbulletin->options['pl_ismobile']
            ? 
sprintf($vbulletin->options['autoyt_membed'], $v)
            : 
$bbcode_parser->handle_bbcode_video("http://www.youtube.com/watch?v=".$v"youtube;".$v); 
Replace with:
PHP Code:
$repl[] = "<center>".($vbulletin->options['pl_ismobile']
            ? 
sprintf($vbulletin->options['autoyt_membed'], $v)
            : 
$bbcode_parser->handle_bbcode_video("http://www.youtube.com/watch?v=".$v"youtube;".$v))."</center>"
3 times.

Not tested but should work.
Reply With Quote
  #101  
Old 05-26-2011, 11:19 PM
porschegruven porschegruven is offline
 
Join Date: Jun 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by grc View Post
Cool - here's a link to a slide show:

PHP Code:
<embed type="application/x-shockwave-flash" src="https://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&hl=en_US&feat=flashalbum&RGB=0x000000&feed=https%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fnazarenealvin%2Falbumid%2F5440810094021987121%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed
username: nazarenealvin
albumname: 2010NewCross

Is it do-able?
Is there any chance you can get your plugin to work with Picasaweb slide show? Picasa is Google's photo depository.
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:29 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.08719 seconds
  • Memory Usage 2,372KB
  • 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
  • (4)bbcode_code
  • (3)bbcode_php
  • (3)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