Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Youtube display link parser without bbcode Details »»
Youtube display link parser without bbcode
Version: 1.00, by heavy1 heavy1 is offline
Developer Last Online: May 2009 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.6.5 Rating:
Released: 04-06-2007 Last Update: 04-07-2007 Installs: 19
Code Changes Is in Beta Stage  
No support by the author.

This is code that will parse all youtube video links and on the fly show embeded video to user.

Demo is here:

http://www.scepter.pl/showthread.php?t=582

Source of this post is:

Code:
Super komedia, film akcji, troche romansu.
Dwie pierwsze czesci byly tez fajne ale ta chyba najlepsza.

http://www.youtube.com/watch?v=QSTuPnNcI_I
As you see user don't have to use any bb tags for it to work - just paste link to post - that's it.

Thanks to TrekkerOfFiles for code deleting http://youtube.com url - I added deleting it with www. to this and it is perfect now.

It will not work very good if you have wysiwyg edit mode enabled (it breaks the link if you edit it) Using standard editor is recommended.

Mod instruction:
Updated installation info 07-04-2007:
Updated deleting http://*youtube.com 08-04-2007:

Atached zipped file cause this forum was messing up the code of modification.
It goes to /includes/ dir.

If you have other version of vb than 3.6.5 I recommend you to find jill edited code in my file and copy paste it to your file. It will work on 3.6.4 also.

If anyone can help with making it better please do

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-07-2007, 11:59 PM
Qwest Qwest is offline
 
Join Date: Jun 2004
Location: United States
Posts: 223
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have any mods installed on this forum that deal with BBcode.
Reply With Quote
  #13  
Old 04-08-2007, 12:03 AM
heavy1 heavy1 is offline
 
Join Date: Nov 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

are you sure you replaced your old file with mine?
try to delete it first then upload mine.
Reply With Quote
  #14  
Old 04-08-2007, 04:49 AM
menababu menababu is offline
 
Join Date: Mar 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks workig good on v3.6.5
Reply With Quote
  #15  
Old 04-08-2007, 10:22 AM
TrekkerOfFiles TrekkerOfFiles is offline
 
Join Date: Oct 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Instead of posting the entire php file like you have done which I would suggest is the cause of most people's problems you should have done instructions in the following vain;

Quote:
Open your /includes/class_bbcode.php

Find:
Code:
<the code to find>
Add below:
Code:
<your new code>
You're done!
If you did it this way then nobody would be overwriting this file which is bad practice to have people do IMO.
Reply With Quote
  #16  
Old 04-08-2007, 10:27 AM
heavy1 heavy1 is offline
 
Join Date: Nov 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TrekkerOfFiles View Post
Instead of posting the entire php file like you have done which I would suggest is the cause of most people's problems you should have done instructions in the following vain;



If you did it this way then nobody would be overwriting this file which is bad practice to have people do IMO.
it was like that in begining but this forum was breaking the code eaven inside code tags.
Reply With Quote
  #17  
Old 04-08-2007, 10:39 AM
TrekkerOfFiles TrekkerOfFiles is offline
 
Join Date: Oct 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did a few changes to your code that removes the http://www.youtube.com/ bit;
Here is an example of this working: http://www.y-helo-thar.com/showpost....98&postcount=7

Quote:
Originally Posted by my changes
Open /includes/class_bbcode.php

Find:
Code:
		// ********************* PARSE BBCODE TAGS ***************************
Add Above:

Code:
		//jill add youtube code remove full URL
				      if ( strpos($text, 'http://www.youtube.com/watch') !== false )
					{
				           //$data = preg_replace("http*youtube*com","", $data);
                                   $text = preg_replace("/http:\/\/www\.youtube\.com\/watch\\?v=([0-9a-zA-Z[:punct:]]{11}+)/","[/url]<object width=\"426\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/$1\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/$1\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object>[url]", $text);                           
					}
//jill code end
Reply With Quote
  #18  
Old 04-08-2007, 11:09 AM
heavy1 heavy1 is offline
 
Join Date: Nov 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice i will test it and update the code in file

thx

//edit
1 problem- www. link version is not included
I tried to replace www. with . but it doesnt work. why the dot is not working i have no idea

//edit2
resolved that problem - now working with www and without.
Reply With Quote
  #19  
Old 04-08-2007, 08:50 PM
DJ XtAzY DJ XtAzY is offline
 
Join Date: Feb 2005
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i thought u cant upload vb files here
Reply With Quote
  #20  
Old 04-11-2007, 04:23 AM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by XtAzY View Post
i thought u cant upload vb files here
He could of just made a plugin. under the bbcode_parse_start hook. *HINT*

remember the people that are at this site are mostly dense and do not know how to code... So just make it as easy as possible for them.
Reply With Quote
  #21  
Old 04-11-2007, 04:45 AM
DaReD3ViL DaReD3ViL is offline
 
Join Date: Mar 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be made for the following sites (many people use them):
Dailymotion.com
veoh.com
1dawg.com
stage6.divx.com (might be trickyer, but the extreamly high quality videos are definately worth it)

Thank you
Reply With Quote
Reply

Thread Tools

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 02:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05297 seconds
  • Memory Usage 2,303KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete