Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
MySpace/YouTube/Google Video Addon (best yet) Details »»
MySpace/YouTube/Google Video Addon (best yet)
Version: 1.00, by Mr Chad Mr Chad is offline
Developer Last Online: Apr 2009 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.4 Rating:
Released: 12-04-2006 Last Update: Never Installs: 239
 
No support by the author.

...

Show Your Support

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

Comments
  #212  
Old 02-03-2007, 04:34 PM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KipLarson View Post
Screen shots?
did you make all of the Javascript replacements?
Reply With Quote
  #213  
Old 02-03-2007, 06:10 PM
CrashfAB CrashfAB is offline
 
Join Date: Mar 2006
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr Chad View Post
glad to hear


The one thing I would add to the instructions chad and its one thing I had to figure out(now granted somebody more used to these things might have had an easier time) was the fact you had to add the code in 3 places above. But like I say I am totoaly new to anything with javascript


/**
* Insert Link
*/
Reply With Quote
  #214  
Old 02-04-2007, 05:13 AM
Kungfu Kungfu is offline
 
Join Date: Dec 2005
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i modified this to a better way of doing this. Adding this code 3 or 4 times is not efficient enough for me and can get complicated. For those of you who want an easy way to do this follow this step.

in clientscript/vbulletin_textedit.js find
Code:
			case 'PHP':
			{
				this.apply_format('removeformat');
			}
Add right below that
Code:
			case 'VIDEO':
			{
			var	video = this.get_selection();

			if((video=="") || (video==null)){
				var video=prompt("MySpace, YouTube, Google video, eBaum's World or Metacafe URL","");
      }
           if (video.match("youtube.com")) 
                {
                    var col_array=video.split("?v=");
                    var part_num=1;
                    if(col_array[part_num] == null || col_array[part_num] == ""){
                    	alert("Please Highlight the Full URL!");
                    	return false;
                    }
                    return this.insert_text("[youtube]" + col_array[part_num] + "[/youtube]");
                }
           else if (video.match("myspace.com"))
                {
                    if (video.match("videoID="))
                    {
                        var col_array=video.split("videoID=");
                    }
                    else
                    {
                        var col_array=video.split("videoid=");
                    }
                    var part_num=1;
                    if(col_array[part_num] == null || col_array[part_num] == ""){
                    	alert("Please Highlight the Full URL!");
                    	return false;
                    }
                    return this.insert_text("[myspace]" + col_array[part_num] + "[/myspace]");
                } 
           else if (video.match("video.google.")) 
                {
                    var col_array=video.split("docid=");
                    var part_num=1;
                    if(col_array[part_num] == null || col_array[part_num] == ""){
                    	alert("Please Highlight the Full URL!");
                    	return false;
                    }
                    return this.insert_text("[googlevideo]" + col_array[part_num] + "[/googlevideo]");
                }
					else if (video.match("ebaumsworld.com")) {
		    						var video = video.replace(".html","");
                    var col_array = video.split("ebaumsworld.com/");
                    if(col_array[part_num] == null || col_array[part_num] == ""){
                    	alert("Please Highlight the Full URL!");
                    	return false;
                    }
                    return this.insert_text("[ebaumsvideo]" + col_array[1] + "[/ebaumsvideo]");
                }
          else if (video.match("metacafe.com")) 
                {
		    						var video = video.replace(new RegExp(/\/$/),"");
                    var col_array = video.split(new RegExp(/\/watch\//g));
                    if(col_array[part_num] == null || col_array[part_num] == ""){
                    	alert("Please Highlight the Full URL!");
                    	return false;
                    }
                    return this.insert_text("[metacafe]" + col_array[1] + "[/metacafe]");
                }
           else{
           	alert("Please Enter The Full URL!");
            return false;
           }


			return false;
		}

now in the templates editor_toolbar_on and postbit_quickedit and showthread_quickreply
find:
Code:
            <if condition="$show['img_bbcode']">
                <td><div class="imagebutton" id="{$editorid}_cmd_insertimage"><img src="$stylevar[imgdir_editor]/insertimage.gif" width="21" height="20" alt="$vbphrase[insert_image]" /></div></td>
            </if>
and add below

Code:
<td><div class="imagebutton" id="{$editorid}_cmd_wrap0_VIDEO"><img src="http://wwwstagemc.nhmccd.edu/resources/images/live/locations/mc/general/MC_video_icon.gif" width="21" height="20" alt="$vbphrase[insert_link]" /></div></td>

Install the product file and thats it. Also if they highlight the URL it will add tags, if they highlight it but it doesnt have any type of video url it will tell them to select the entire url. if they dont highlight anything it will prompt them for something.
Reply With Quote
  #215  
Old 02-04-2007, 05:46 AM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does it work on all editors kungfu?
Reply With Quote
  #216  
Old 02-04-2007, 07:02 AM
Kungfu Kungfu is offline
 
Join Date: Dec 2005
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr Chad View Post
does it work on all editors kungfu?
Yea it should work on all editors. I had to make a custom function for a button like this. And this works.

I just updated the code too so it will detect if they highlighted the code right. Should be good to go now. So if they have google.com/blahblah it wont try to make a bbcode.

This is basically what you had in all 3-5 spots but its just one spot now. Should work on all browsers as well.

Just tested it again on different browsers and editors. Seems to work fine. I only tested a few video formats so if anyone tests it out and finds something wrong let me know or post im sure chad would be able to figure it out as well.
Reply With Quote
  #217  
Old 02-04-2007, 05:10 PM
taydu taydu is offline
 
Join Date: Oct 2006
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a little confuse with the instruction. I found four "insert link" and 1 "insert image." Do I insert the code above four "insert link" and the "insert image"
Reply With Quote
  #218  
Old 02-04-2007, 05:29 PM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just do all 4
Reply With Quote
  #219  
Old 02-04-2007, 05:47 PM
taydu taydu is offline
 
Join Date: Oct 2006
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks chad,

Now there is a "insert link button on the text editor but when I click on it it doesn't do anything.
Reply With Quote
  #220  
Old 02-05-2007, 08:26 PM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

your having a javascript error then.
Reply With Quote
  #221  
Old 02-06-2007, 02:11 AM
taydu taydu is offline
 
Join Date: Oct 2006
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i fix it? Doesn't "Inser Image" "Hyper Link" using the same java script? Those still working fine.
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:49 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.04916 seconds
  • Memory Usage 2,316KB
  • 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
  • (4)bbcode_code
  • (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
  • (2)pagenav_pagelinkrel
  • (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