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

hm, try this one, altough it doesn't make any sense:

PHP Code:
$ytpreg "/\[youtube\]([a-zA-Z0-9_\-]+)\[\/youtube\]/i"
Quote:
Would be great if this also worked in blogs and not just forums
I'd love to, but sadly I don't know which hooks to use. I have no vbcms

If anyone offers me admin access to a test installation, I'm able to create a plugin for vbcms too.
Reply With Quote
  #43  
Old 04-08-2011, 08:30 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
hm, try this one, altough it doesn't make any sense:

PHP Code:
$ytpreg "/\[youtube\]([a-zA-Z0-9_\-]+)\[\/youtube\]/i"
Nope?. thanks for trying ....

Not sure why it doesn't work, as it's opening the database now and processing it ...

Just seems to process 150,000+ posts and skips every one of them ?

Quote:
150588: Skipping...
150589: Skipping...
150590: Skipping...
150591: Skipping...
150592: Skipping...
150593: Skipping...
150594: Skipping...
150595: Skipping...
150596: Skipping...
150597: Skipping...
150598: Skipping...
150599: Skipping...
150600: Skipping...
150601: Skipping...
150602: Skipping...


FINISHED 588 runs with 0 queries

Click Here to continue?.
Imbedded BBCodes look like this ..

[youtube]FM6wHknkAPk[/youtube]
[youtube]XTGuRgcGujs[/youtube]
[youtube]Ie88A51IxY4[/youtube]

Regards,
Doug
Reply With Quote
  #44  
Old 04-08-2011, 11:25 PM
Randomm Randomm is offline
 
Join Date: Jul 2010
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tagged
BTW can you make one with images?
Reply With Quote
  #45  
Old 04-09-2011, 11:06 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
Nope…. thanks for trying ....

Not sure why it doesn't work, as it's opening the database now and processing it ...

Just seems to process 150,000+ posts and skips every one of them …



Imbedded BBCodes look like this ..

[youtube]FM6wHknkAPk[/youtube]
[youtube]XTGuRgcGujs[/youtube]
[youtube]Ie88A51IxY4[/youtube]

Regards,
Doug
And you clicked the link everytime until it has no queries left to run? The link is at the bottom of each page.

Otherwise I'm out of ideas.
What could help immensly is: Export only your vb posts table, put it into an archive and send it to me via PM so I can run the script myself and test out why it doesn't replace the tags.

Quote:
Originally Posted by Randomm View Post
tagged
BTW can you make one with images?
Sure
Reply With Quote
  #46  
Old 04-10-2011, 09:36 AM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
And you clicked the link everytime until it has no queries left to run? The link is at the bottom of each page.

Otherwise I'm out of ideas.
What could help immensly is: Export only your vb posts table, put it into an archive and send it to me via PM so I can run the script myself and test out why it doesn't replace the tags.
Yes Sir ... clicked it each time at every 10,000 posts and ran all the way through to the end ...

I'll try to figure out how to export the post table and send it to you. Never done anything like that before.

Appreciate your help .. very gracious of you ... :up:

Regards,
Doug
Reply With Quote
  #47  
Old 04-14-2011, 05:35 PM
dealzoid dealzoid is offline
 
Join Date: Dec 2010
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting 3 copies of the same video, it's a youtube rss link, before this mod I would just get a clickable image that would redirect to youtube, undesired, so any fix? or can I disable this mod just for 1 forum

the rss link is http://gdata.youtube.com/feeds/base/...rss&time=today

thanks
Reply With Quote
  #48  
Old 04-16-2011, 12:49 PM
zelnik zelnik is offline
 
Join Date: Aug 2008
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, any chance of getting this to work with the new youtu.be url structure?

Here's further info:

http://tracker.vbulletin.com/browse/VBIV-11734
Reply With Quote
  #49  
Old 04-16-2011, 07:43 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zelnik View Post
Hey, any chance of getting this to work with the new youtu.be url structure?

Here's further info:

http://tracker.vbulletin.com/browse/VBIV-11734
Yes, that would be excellent if this mod could support this new YouTube standard ... :up:

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

Supports new youtube links
Reply With Quote
  #51  
Old 04-22-2011, 01:55 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
Supports new youtube links
Updated to 1.2 with thanks ..

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 06:24 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.08494 seconds
  • Memory Usage 2,362KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_php
  • (8)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