vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Mini Mods - MySpace/YouTube/Google Video Addon (best yet) (https://vborg.vbsupport.ru/showthread.php?t=133235)

Arjan 12-06-2006 02:37 PM

Quote:

Originally Posted by popmyzit (Post 1132803)
Googlevideo doesn't work on this for me. Youtube is fine...

Probably because you do not use video.google.com

Change
Code:

if (my_colors.match("video.google.com"))
to
Code:

if (my_colors.match("video.google"))
So that URL from other countries are also supported.

Arjan 12-06-2006 03:29 PM

Got it working

Fixes:
- Google aVideo from other domains then google.com (i.e. google.uk google.nl) are supported
- MetaCafe is working.

Here is the new Javascript code:
Code:

                * Insert Video Link
                */
                this.createvideolink = function(e, url)
                {
                        var my_colors=prompt("Please enter MySpace, Metacafe, YouTube or Google video URL","");
                        if ((my_colors=="") || (my_colors==null))
                        {
                                alert("Please Enter The Full URL!");
                        }
                        else
                        {
                                if (my_colors.match("www.youtube.com"))
                                {
                                        var col_array=my_colors.split("?v=");
                                        var part_num=1;
                                        return this.insert_text("[youtube]" + col_array[part_num] + "[/youtube]");
                                }
                                else
                                if (my_colors.match("myspace.com"))
                                {
                                        if (my_colors.match("videoID="))
                                        {
                                                var col_array=my_colors.split("videoID=");
                                        }
                                        else
                                        {
                                                var col_array=my_colors.split("videoid=");
                                        }
                                        var part_num=1;
                                        return this.insert_text("[myspace]" + col_array[part_num] + "[/myspace]");
                                }
                                else
                                if (my_colors.match("video.google"))
                                {
                                        var col_array=my_colors.split("docid=");
                                        var part_num=1;
                                        return this.insert_text("[googlevideo]" + col_array[part_num] + "[/googlevideo]");
                                }
                                else
                                if (my_colors.match("metacafe.com"))
                                {
                                        var col_array=my_colors.split("/watch/");
                                        var part_num=1;
                                        var cafeStr=col_array[part_num];
                                    if (cafeStr.lastIndexOf('/') == cafeStr.length-1)
                                        {
                                                return this.insert_text("[metacafe]" + cafeStr.substring(0,cafeStr.length-1) + "[/metacafe]");       
                                        }
                                        else
                                        {
                                                return this.insert_text("[metacafe]" + cafeStr + "[/metacafe]");       
                                        }
                                }
                                else
                                {
                                        alert("No valid Google, YouTube, MetaCafe or Myspace URL");
                                }
                        }
                };

Here is the changed BB code:

Title: metacafe
Tag: metacafe
Replacement:
Code:

<embed src="http://www.metacafe.com/fplayer/{param}.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>

Mr Chad 12-06-2006 09:00 PM

thanks, updated it.

rolandogomez 12-06-2006 10:10 PM

A few things, in your instructions, please add that there are about four or five places (lost count) to add the code after

/**
* Insert Link
*/

In addition, each time you add a BB code it asks you for an example, that would be beneficial for us noncoder types.

On the image that shows up in the reply boxes, it's this link: http://wwwstagemc.nhmccd.edu/resourc...video_icon.gif is that smart to do? I look at that as bandwith theft. You might tell people to download that image and where to change the code with your own server URL of the image.

Now, with that said, did everything, but it doesn't work for me, does nothing other than display the image. Something doesn't make the javascript work I'm guessing, perhaps VBSEO? Let me know, seems like a nice hack, thanks rg.

Mr Chad 12-06-2006 11:00 PM

hmm it seems it doesn't work when you change it into normal text edit from WYSIWYG. So it only works in WYSIWYG, i'm sure theres a second place to put the JS edit for it to work in both, i just don't know it yet.

TCattitude 12-07-2006 08:02 PM

Quote:

Originally Posted by Mr Chad (Post 1133536)
hmm it seems it doesn't work when you change it into normal text edit from WYSIWYG. So it only works in WYSIWYG, i'm sure theres a second place to put the JS edit for it to work in both, i just don't know it yet.

In the same javascript file, but before this (actually, works in many places around that part of the JS):

Quote:

/**
* Insert Image
*
* @param event Event object
* @param string (Optional) Image URL
*
* @return boolean
*/
That's all. In that way works in the normal editor.

Mr Chad 12-07-2006 09:20 PM

if i put it there will it work in both normal and WYSIWYG mode? or does it need to be in both places?

paypal 12-08-2006 03:17 AM

getting error on page display when i post new thread, non of the editing buttons work along with the media buttons?

did i miss something here.

AWJunkies 12-08-2006 04:37 AM

So if this mod good to go now? Works for normal edit mode not wys*. Quick edit and full etc and so on and quick post and full post?

BigJimTheLug 12-08-2006 06:29 AM

Hey, I tried it just like you said and it does not embed the videos.

the button doesn't work either.....lol..

something is wrong.......


All times are GMT. The time now is 11:12 AM.

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.01353 seconds
  • Memory Usage 1,758KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete