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

Yes, that is the code which gets displayed, if a mobile browser is detected. The reason is, that mobile browsers can't potentially display the default vbulletin code, therefore nothing gets displayed.

The above code you posted is a replacement-code, which works with most mobile browsers (iphone for example). However, the ipad seems still to have trouble displaying the fallback code. So if you put the code snipped I posted a few posts above into the option field, you can ensure, that every mobile browser only displays the link instead of an embed, which he potentially can't display.

This is just a temporary solution until I figured out why the ipad can't display the fallback code and I might find a better replacement
Reply With Quote
  #73  
Old 05-08-2011, 07:20 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
Yes, that is the code which gets displayed, if a mobile browser is detected. The reason is, that mobile browsers can't potentially display the default vbulletin code, therefore nothing gets displayed.

The above code you posted is a replacement-code, which works with most mobile browsers (iphone for example). However, the ipad seems still to have trouble displaying the fallback code. So if you put the code snipped I posted a few posts above into the option field, you can ensure, that every mobile browser only displays the link instead of an embed, which he potentially can't display.

This is just a temporary solution until I figured out why the ipad can't display the fallback code and I might find a better replacement
Ok, I did what you asked and snipped the line above and added it again under the same one that was already there, but I'm still confused as to why I need it twice. Anyway, it still doesn't appear on the iPad, but I've attached a pic of my AdminCP settings, just in case we're talking two different things here ..

Regards,
Doug
Attached Images
File Type: jpg Screen shot 2011-05-08 at 4.18.11 PM.jpg (87.0 KB, 0 views)
Reply With Quote
  #74  
Old 05-08-2011, 08:20 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not under, replace!

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

Understood ...

As you've noted, it still doesn't display on the iPad (just blank post). I also checked my wife's iPad-2 and it doesn't work. Finally, I went back and checked the iPhone4 with just that single line of "FallBack Content" and it works on the one video example I posted earlier, after having removed the old code ...

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>
I then went through the iPhone4 and checked a few other videos that I hadn't done before, particularly some with formats that were different.

ie:

Code:
[video=youtube;W7pl0-vaCAg]http://www.youtube.com/watch?v=W7pl0-vaCAg[/video]
They didn't show up on the iPhone4 or the iPads, I guess because the format is the video BBCode used by vBulletin in a native mode?

I thought we had gone through the routine of passing the database through your utility that removed all those? .. or, was that just the mod [youtube] type ones?

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

The script only removed those with the [youtube] tag.

The Issue I see at the moment is, that the standard vbulletin video code doesn't display on ipads, right?
> Just disable the mod, add a youtube video in a post via the vbulletin video-button, view the page and see if it appears. If not (as expected), the problem is with the embed code vbulletin uses and my mod also.
Right now I'm trying to fix that by looking for an embed code which modern browsers can display, and mobile browsers displaying some fallback thingy so they can at least see anything.

I own an iPhone 4, so I can check that, but I have to wait a few days until I get my hands on an iPad 2.

We'll see if there is something I can do, worst case will be disable the post replacement for mobile browsers completely, so they will only see a link to the youtube vid.
Reply With Quote
  #77  
Old 05-09-2011, 03:40 AM
bad2dbone bad2dbone is offline
 
Join Date: Apr 2011
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it worked for the first post now it doesn't work just tired isn't converting it any idea why my other file was converted?
Reply With Quote
  #78  
Old 05-09-2011, 11:16 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
The script only removed those with the [youtube] tag.

The Issue I see at the moment is, that the standard vbulletin video code doesn't display on ipads, right?
Right, but also using vBulletin's [video] function, it doesn't appear on iPhone4's.

Quote:
Originally Posted by Disasterpiece View Post
Just disable the mod, add a youtube video in a post via the vbulletin video-button, view the page and see if it appears. If not (as expected), the problem is with the embed code vbulletin uses and my mod also.
Tried that on iPhone4 with mod ON and OFF using standard iPhone Safari browser. vBulletin's [video] function doesn't appear on iPhone4's.

Quote:
Originally Posted by Disasterpiece View Post
We'll see if there is something I can do, worst case will be disable the post replacement for mobile browsers completely, so they will only see a link to the youtube vid.
That might be the best thing to do, but it still won't appear if people use the vBulletin [video] BBCode ...

Thanks for your efforts ... :up:

Regards,
Doug
Reply With Quote
  #79  
Old 05-09-2011, 12:04 PM
Robbie P Robbie P is offline
 
Join Date: Mar 2011
Location: England
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome release, thank you very much!
Reply With Quote
  #80  
Old 05-09-2011, 04:22 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bad2dbone View Post
it worked for the first post now it doesn't work just tired isn't converting it any idea why my other file was converted?
Do you use other modifications which edit the post-display behaviour in some way?

When you create a new post with just one or more vbulletin links (no tag, no video-embed) and view this post, do they get converted or does it stay as a link?
Reply With Quote
  #81  
Old 05-09-2011, 10:39 PM
bad2dbone bad2dbone is offline
 
Join Date: Apr 2011
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

stays as a link bro
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 09:17 AM.


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.06803 seconds
  • Memory Usage 2,369KB
  • 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
  • (5)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
  • (5)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