Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Auto Youtube Link-Converter Details »
Auto Youtube Link-Converter
Mod Version: 1.4, by Disasterpiece (Coder) Disasterpiece is offline
Developer Last Online: Sep 2018 I like it Show Printable Version Email this Page

vB Version: 4.1.2 Rating: (82 votes - 4.88 average) Installs: 787
Released: 01 Apr 2011 Last Update: 23 May 2011 Downloads: 3710
Not Supported Uses Plugins Re-usable Code  

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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 03 Apr 2011, 19:30
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Originally Posted by grc View Post
Cool - here's a link to a slide show:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

username: nazarenealvin
albumname: 2010NewCross

Is it do-able?
I don't see any kind of embed-code. How does it work?
Reply With Quote
  #17  
Old 03 Apr 2011, 19:54
grc grc is offline
 
Join Date: Oct 2005
Originally Posted by Disasterpiece View Post
I don't see any kind of embed-code. How does it work?
Sorry, grabbed the wrong code - I just edited the post to include the embed code. If it's too much, no worries - thanks for thinking about it.
Reply With Quote
  #18  
Old 03 Apr 2011, 21:21
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Thumbs up

Great idea ....

Just installed and for testing on 4.04pl1 ....

Seems to be working just fine ....

Really valuable addition to our site and saves me a lot of time checking posts and converting the manual links to BBCode [video] links ....

Slick the way it does the conversion during the "submit" part of the post creation or editing ...

Thanks for this ...

Regards,
Doug
Reply With Quote
  #19  
Old 03 Apr 2011, 21:33
ProFifaLeagues's Avatar
ProFifaLeagues ProFifaLeagues is offline
 
Join Date: Aug 2009
Real name: Rob
Thumbs up

Originally Posted by Disasterpiece View Post
It should work, yes. Only one way to find out :P
I started and developed the plugin on vB 4.1.2 so I can't guarantee it works with older versions.

Installed and working fine on 4.0.6
Thanks mate saves a lot of work for us
Reply With Quote
  #20  
Old 05 Apr 2011, 02:16
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Just updated with newer version.

I missed the conversion in post preview and the reviewbits, so here they are.

Same procedure, now there are 3 plugins. You can enable/disable the plugins by itself if you want to disable a specific feature.

Last edited by Disasterpiece; 05 Apr 2011 at 11:58.
Reply With Quote
  #21  
Old 05 Apr 2011, 02:40
Juggernaut's Avatar
Juggernaut Juggernaut is offline
 
Join Date: Dec 2009
Really useful mod
Reply With Quote
  #22  
Old 05 Apr 2011, 10:46
Goodfather's Avatar
Goodfather Goodfather is offline
 
Join Date: Jan 2010
Installed and working fine on 4.1.2
thanks

Nominated!
Reply With Quote
  #23  
Old 05 Apr 2011, 13:11
YkudzA YkudzA is offline
 
Join Date: Feb 2011
Real name: Sergey
installed and nominated !
Reply With Quote
  #24  
Old 05 Apr 2011, 17:05
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Real name: Brandon
works as it should on 4.1.2

thanks

/me clicks install
__________________

Email me for website help: brandon[at]sheley[dot]org
Reply With Quote
  #25  
Old 05 Apr 2011, 18:55
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Just installed 1.1 update and testing on 4.04pl1 ....

Appears to be operating just fine ...

I like smart and intuitive add-ons that substitute for unnecessary steps for the end user and this is one of those ...

Regards,
Doug

Edit: oooppps.... found a problem. Have started to get emails from members saying that they're seeing YouTube videos being duplicated in just some posts, primarily older ones. Traced cause to a conflict with a mod we've been using for 5 years which is a BBCode [youtube]xxx[/youtube] add-on to handle YouTube videos even before vb4 did with their [video]xxx[/video] button.

Any way to have this mod ignore that old mod (too many posts for us to change) and not translate, adding a second duplicate video? .. or, can we make an SQL pass on the database and change all posts to something else to be compatible with his mod?

Last edited by BadgerDog; 05 Apr 2011 at 19:05.
Reply With Quote
  #26  
Old 06 Apr 2011, 01:34
Rofo Rofo is offline
 
Join Date: Feb 2011
Works fairly well. I've noticed some YouTube links won't auto embedd. Example,

http://www.youtube.com/user/tdwpplaya - Will no embed automatically

http://www.youtube.com/watch?v=0ABGIJwiGBc - Will embed automatically.

Is it because the first link is "user"/ and not watch?v= ?

Either way, very nice Mod. This is the kinda stuff I don't understand why is not built in to the vB software. Clicking the [video] button is completely (or should be) unnecessary!
Reply With Quote
  #27  
Old 06 Apr 2011, 02:11
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Originally Posted by BadgerDog View Post
Edit: oooppps.... found a problem. Have started to get emails from members saying that they're seeing YouTube videos being duplicated in just some posts, primarily older ones. Traced cause to a conflict with a mod we've been using for 5 years which is a BBCode [youtube]xxx[/youtube] add-on to handle YouTube videos even before vb4 did with their [video]xxx[/video] button.

Any way to have this mod ignore that old mod (too many posts for us to change) and not translate, adding a second duplicate video? .. or, can we make an SQL pass on the database and change all posts to something else to be compatible with his mod?
Funny that you mention that, I had exactly the same problem. We didn't use video tags, just the [youtube=title]videoid[/youtube] thingy which caused above mentioned problem.
I made a script for myself which changed all [youtube]...[/youtube] tags to full urls like
http://www.youtube.com/watch?v=*videoid*
to solve this problem. I attached it below.

USE AT YOUR OWN RISK!
Backup your database before running the query, disabling your forum might be a good idea, place it anywhere and delete it afterwards.
Edit the file before you run it with your database credentials and modify the table-prefix/name accordingly. Hit the "continue" link until the script doesn't make any more queries.
Oh and I had troubles with singlequotes in postings which messed up my query, so I simply escaped it. I didn't discover any problems with that, keep in mind that if your language makes excessive use of the ' character, you might want to find a way around that, I did not.

Will only work with old youtube tags in the form of:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you used a different tag, send me a PM and I try to help you out with the correct replacement.


Originally Posted by Rofo View Post
Works fairly well. I've noticed some YouTube links won't auto embedd. Example,

http://www.youtube.com/user/tdwpplaya - Will no embed automatically

http://www.youtube.com/watch?v=0ABGIJwiGBc - Will embed automatically.

Is it because the first link is "user"/ and not watch?v= ?

Either way, very nice Mod. This is the kinda stuff I don't understand why is not built in to the vB software. Clicking the [video] button is completely (or should be) unnecessary!
Thanks for your feedback

The user-link will only display the profile page of the user, not a specific video. Which means, if that particlular user uploads a new video, the new video will be shown on this site. I'm not aware if the vB video tag translates this kind of url too, I find it rather unintuitive and uncommon and due to the lack of a video-ID in the url, it's not really supposed to be embedded
Attached Files
File Type: php convyt.php (1.6 KB, 10 views)

Last edited by Disasterpiece; 15 Apr 2011 at 13:32.
Reply With Quote
  #28  
Old 06 Apr 2011, 02:48
Rofo Rofo is offline
 
Join Date: Feb 2011
Originally Posted by Disasterpiece View Post
Funny that you mention that, I had exactly the same problem. We didn't use video tags, just the [youtube=title]videoid[/youtube] thingy which caused above mentioned problem.
I made a script for myself which changed all [youtube]...[/youtube] tags to full urls like
http://www.youtube.com/watch?v=*videoid*
to solve this problem. I attached it below.

USE AT YOUR OWN RISK!
Backup your database before running the query, disabling your forum might be a good idea, place it anywhere and delete it afterwards.
Edit the file before you run it with your database credentials and modify the table-prefix/name accordingly. Hit the "continue" link until the script doesn't make any more queries.
Oh and I had troubles with singlequotes in postings which messed up my query, so I simply escaped it. I didn't discover any problems with that, keep in mind that if your language makes excessive use of the ' character, you might want to find a way around that, I did not.

Will only work with old youtube tags in the form of:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you used a different tag, send me a PM and I try to help you out with the correct replacement.



Thanks for your feedback

The user-link will only display the profile page of the user, not a specific video. Which means, if that particlular user uploads a new video, the new video will be shown on this site. I'm not aware if the vB video tag translates this kind of url too, I find it rather unintuitive and uncommon and due to the lack of a video-ID in the url, it's not really supposed to be embedded
Gotcha. Not really that big of a deal, as most YouTube links don't have that User/. Thank you for the Mod, this was a much needed one. Now if some of the other videos would auto embed!

Installed/Rated/Voted
Reply With Quote
  #29  
Old 06 Apr 2011, 03:38
GeorgeEcuador's Avatar
GeorgeEcuador GeorgeEcuador is offline
 
Join Date: Sep 2009
Functional v4.03.. Fine... Installed..
Reply With Quote
  #30  
Old 06 Apr 2011, 14:10
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
Funny that you mention that, I had exactly the same problem. We didn't use video tags, just the [youtube=title]videoid[/youtube] thingy which caused above mentioned problem.
I made a script for myself which changed all [youtube]...[/youtube] tags to full urls like
http://www.youtube.com/watch?v=*videoid*
to solve this problem. I attached it below.

USE AT YOUR OWN RISK!
Backup your database before running the query, disabling your forum might be a good idea, place it anywhere and delete it afterwards.
Edit the file before you run it with your database credentials and modify the table-prefix/name accordingly. Hit the "continue" link until the script doesn't make any more queries.
Oh and I had troubles with singlequotes in postings which messed up my query, so I simply escaped it. I didn't discover any problems with that, keep in mind that if your language makes excessive use of the ' character, you might want to find a way around that, I did not.

Will only work with old youtube tags in the form of:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you used a different tag, send me a PM and I try to help you out with the correct replacement.
Thanks partner ... appreciate that ...

Those two BBCodes are EXACTLY the ones that we used for years, so there's a LOT of old YouTube links with them.

So, I simply execute that PHP file you attached and it will go through our entire database, altering them to something else?

I have no database prefix .... it just shows in the config file for vBulletin as ' ' with no prefix in between the single quotes. Just leave it as two single quotes in your PHP file?

BTW, my language is English ..

Regards,
Doug

Last edited by BadgerDog; 06 Apr 2011 at 14:18.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 01:01.

Layout Options | Width: Wide Color: