Jump to content


* * * * * 1 votes

[Unsupported] (B23) Video BBCode v1.0.1


  • Please log in to reply
140 replies to this topic

#41 eagle00789

eagle00789

    Novice

  • Members
  • PipPip
  • 11 posts
  • IPB Version:v2.3.x

Posted 11 September 2007 - 10:47 PM

I have another url for you: http://revision3.com/ Several videos

#42 GoppoBuro

GoppoBuro

    Advanced Member

  • Members
  • PipPipPipPip
  • 77 posts
  • IPB Version:v2.3.x

Posted 12 September 2007 - 06:15 PM

This is a so useful mod..but unfortunately i could not able to use that. am using IPB 2.3.1

after editing the sources\classes\bbcode\class_bbcode.php  file and uploading that i am getting these errors

Warning: preg_replace_callback() requires argument 2, 'class_bbcode::clean_video_tag', to be a valid callback in /home/my domain/public_html/sources/classes/bbcode/class_bbcode.php on line 537

Warning: preg_replace_callback() requires argument 2, 'class_bbcode::clean_video_tag', to be a valid callback in /home/my domain/public_html/sources/classes/bbcode/class_bbcode.php on line 537

Warning: preg_replace_callback() requires argument 2, 'class_bbcode::clean_video_tag', to be a valid callback in /home/my domain/public_html/sources/classes/bbcode/class_bbcode.php on line 537

and many more....

kindly help me to fix this problem

thanx

#43 Mexfrag

Mexfrag

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Mexico
  • IPB Version:v3.0.x

Posted 12 September 2007 - 06:26 PM

Check the edit on sources\classes\bbcode\class_bbcode_core.php, thats the edit causing your problem.

Is a huge chunk of code, so read carefully the instruction on that edit.

#44 GoppoBuro

GoppoBuro

    Advanced Member

  • Members
  • PipPipPipPip
  • 77 posts
  • IPB Version:v2.3.x

Posted 12 September 2007 - 08:44 PM

yah this mod is although quite lengthy, but very pretty...but i could not get your point.. what file I have to edit?

the instruction is saying

sources\classes\bbcode\class_bbcode.php

and you are telling sources\classes\bbcode\class_bbcode_core.php

got confused now..please clarify me.

why it is not working for me? sad.gif donno

#45 Mexfrag

Mexfrag

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Mexico
  • IPB Version:v3.0.x

Posted 12 September 2007 - 09:21 PM

Yes, you need to do edits also in class_bbcode.php but the error that are you getting is not because you do wrong the edits in that file, is because you did wrong in the huge edit on class_bbcode_core.php

Check that one again

#46 GoppoBuro

GoppoBuro

    Advanced Member

  • Members
  • PipPipPipPip
  • 77 posts
  • IPB Version:v2.3.x

Posted 13 September 2007 - 06:02 AM

Please let me to be clarified once again...

do i have to do the same edit on

sources\classes\bbcode\class_bbcode.php
sources\classes\bbcode\class_bbcode_core.php

both the files?

if i edit sources\classes\bbcode\class_bbcode.php this file then sources\classes\bbcode\class_bbcode_core.php  will this file  also be affected? please let me know. then i'll start the installation again..as i am new in this area and this mod is quite lengthy, without being sure, am fearing to edit tongue.gif

#47 Mexfrag

Mexfrag

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Mexico
  • IPB Version:v3.0.x

Posted 13 September 2007 - 06:30 AM

Just follow the instructions, do the proper edits first in sources\classes\bbcode\class_bbcode.php, after that do the proper edits on sources\classes\bbcode\class_bbcode_core.php.

Every file have his own set of edits and are different from each other.



#48 GoppoBuro

GoppoBuro

    Advanced Member

  • Members
  • PipPipPipPip
  • 77 posts
  • IPB Version:v2.3.x

Posted 13 September 2007 - 08:37 AM

thanks i got the point smile.gif now i'll start installing the mod freshly smile.gif

#49 eagle00789

eagle00789

    Novice

  • Members
  • PipPip
  • 11 posts
  • IPB Version:v2.3.x

Posted 13 September 2007 - 05:16 PM

I have installed this onto my board, but the View HTML Source in the RTE-Editor now doesn't show up anymore. Any idea how that can happen?? I have checked all my edits, or did i still made a very big mistake.

Also, i have a suggestion. Make this mod compatible with lightbox AND/OR greybox (Preffered is greybox). Then it would be awesome

#50 eagle00789

eagle00789

    Novice

  • Members
  • PipPip
  • 11 posts
  • IPB Version:v2.3.x

Posted 13 September 2007 - 05:23 PM

I just went to check, and Bort Simpson (The creator of this fine mod) has the same problem on his forum.

#51 Mexfrag

Mexfrag

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Mexico
  • IPB Version:v3.0.x

Posted 13 September 2007 - 05:46 PM

You mean the Toggle HTML Source button?

If is that one is working fine with the mod (all the html source is showing up), you can check it over here

http://www.aztec-clan.com/test/index.php?showtopic=4

Do a full edit in the last post with the demo account and use the RTE

I will look around to see how it works with the greybox thing.


#52 Mexfrag

Mexfrag

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Mexico
  • IPB Version:v3.0.x

Posted 13 September 2007 - 07:40 PM

I fixed a problem when you try to uninstall the mod, just download the file again and reupload the mod_install/video_bbcode.xml

Sorry for the trouble

DONT REINSTALL THE MOD, THIS IS JUST IN CASE YOU WANT TO UNINSTALL IT

Edited by Bort Simpson, 13 September 2007 - 07:52 PM.


#53 eagle00789

eagle00789

    Novice

  • Members
  • PipPip
  • 11 posts
  • IPB Version:v2.3.x

Posted 13 September 2007 - 11:03 PM

QUOTE(eagle00789 @ Sep 13 2007, 07:16 PM) <{POST_SNAPBACK}>
I have installed this onto my board, but the View HTML Source in the RTE-Editor now doesn't show up anymore. Any idea how that can happen?? I have checked all my edits, or did i still made a very big mistake.
this fixed itself. sorry.........
QUOTE(eagle00789 @ Sep 13 2007, 07:16 PM) <{POST_SNAPBACK}>
Also, i have a suggestion. Make this mod compatible with lightbox AND/OR greybox (Preffered is greybox). Then it would be awesome

suggestion solved.
ONLY code for creator of the mod, because it is just for ONE videoplayer done.
open sources/classes/bbcode/class_bbcode_core.php
find:
CODE
    function regex_video_tag( $matches=array() )
    {

Add below:
CODE
        $startcode = "<!--id1--><div><script type='text/javascript'>var GB_ROOT_DIR = \"".$this->ipsclass->vars['board_url']."/greybox/\";</script><script type='text/javascript' src='greybox/AJS.js'></script><script type='text/javascript' src='greybox/AJS_fx.js'></script><script type='text/javascript' src='greybox/gb_scripts.js'></script><link href='greybox/gb_styles.css' rel='stylesheet' type='text/css' />";
        $endcode = "<img src='/style_images/video.png'/></a></div><!--id2-->";

find 2x:
CODE
                $code = '<!--id1--><div><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';

replace with 2x:
CODE
                $code = $startcode;
                $code .= "<a href='http://video.google.com/googleplayer.swf?docid=".substr($link, $startingpos, $lenght)."&' title='Youtube' rel='gb_page_center[400, 326]'>";
                $code .= $endcode;


#54 eagle00789

eagle00789

    Novice

  • Members
  • PipPip
  • 11 posts
  • IPB Version:v2.3.x

Posted 14 September 2007 - 11:22 AM

I now did find out that not every player is compatible with the greybox thing, but i am working on a fix for those that currently aren't compatible.
Compatible wit greybox:
  • Google
  • Youtube
  • LiveLeak
  • Veoh
  • Collegehumor
  • guba
  • glumbert
  • vsocial
  • FunnyOrDie
Currently NOT compatible with greybox:
  • ifilm
  • Revver
  • Brightcove
  • MySpace
  • GameTrailers

Edited by eagle00789, 14 September 2007 - 12:34 PM.


#55 eagle00789

eagle00789

    Novice

  • Members
  • PipPip
  • 11 posts
  • IPB Version:v2.3.x

Posted 14 September 2007 - 12:43 PM

To make the edit easy, just follow this guide (if you want to use greybox biggrin.gif)
Open sources/classes/bbcode/class_bbcode_core.php
Find
CODE
    function regex_video_tag( $matches=array() )
    {
        $link = $matches[1];
        if ( $link == "" )
        {
            return;
        }
                /**
                Google Video.
                **/
        if (strstr($link, 'google') != "")
        {
            $startingpos = strpos($link, 'docid=') + 6;
            $endpos = strpos($link,'&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link) - $startingpos;
                $code = '<!--id1--><div><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                YouTube Video.
                **/
        else if (strstr($link, 'youtube') != "")
        {
            $startingpos = strpos($link, 'v=') + 2;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.substr($link, $startingpos, $lenght).'&"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.substr($link, $startingpos, $lenght).'&" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" /></embed></object></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.substr($link, $startingpos, $lenght).'&"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.substr($link, $startingpos, $lenght).'&" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" /></embed></object></div><!--id2-->';
                return $code;
            }
        }
        /**
                LiveLeak Video.
                **/
        else if (strstr($link, 'liveleak') != "")
        {
            $startingpos = strpos($link, 'i=') + 2;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><object type="application/x-shockwave-flash" width="450" height="370" wmode="transparent" data="http://www.liveleak.com/player.swf?token='.substr($link, $startingpos, $lenght).'&"><param name="movie" value="http://www.liveleak.com/player.swf?token='.substr($link, $startingpos, $lenght).'&"><param name="wmode" value="transparent"><param name="quality" value="high" /></object></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><object type="application/x-shockwave-flash" width="450" height="370" wmode="transparent" data="http://www.liveleak.com/player.swf?token='.substr($link, $startingpos, $lenght).'&"><param name="movie" value="http://www.liveleak.com/player.swf?token='.substr($link, $startingpos, $lenght).'&"><param name="wmode" value="transparent"><param name="quality" value="high" /></object></div><!--id2-->';
                return $code;
            }
        }
        /**
                Veoh Video.
                **/
        else if (strstr($link, 'veoh') != "")
        {
            $startingpos = strpos($link, '/videos/') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.veoh.com/videodetails2.swf?permalinkId='.substr($link, $startingpos, $lenght).'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" width="540" height="438" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.veoh.com/videodetails2.swf?permalinkId='.substr($link, $startingpos, $lenght).'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" width="540" height="438" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                GameTrailers Video.
                **/
        else if (strstr($link, 'gametrailers') != "")
        {
            $startingpos = strpos($link, '/player/') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.gametrailers.com/remote_wrap.php?mid='.substr($link, $startingpos, $lenght).'&" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="409" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.gametrailers.com/remote_wrap.php?mid='.substr($link, $startingpos, $lenght).'&" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="409" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                iFilm Video.
                **/
        else if (strstr($link, 'ifilm') != "")
        {
            $startingpos = strpos($link, '/video/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed width="448" height="365" src="http://www.ifilm.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed width="448" height="365" src="http://www.ifilm.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                Revver Video.
                **/
        else if (strstr($link, 'revver') != "")
        {
            $startingpos = strpos($link, '/watch/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="noScale" salign="TL" bgcolor="#000000" flashvars="mediaId='.substr($link, $startingpos, $lenght).'&affiliateId=0&allowFullScreen=true" allowfullscreen="true" height="392" width="480" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="noScale" salign="TL" bgcolor="#000000" flashvars="mediaId='.substr($link, $startingpos, $lenght).'&affiliateId=0&allowFullScreen=true" allowfullscreen="true" height="392" width="480" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                BrightCove Video.
                **/
        else if (strstr($link, 'brightcove') != "")
        {
            $startingpos = strpos($link, 'title=') + 6;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.brightcove.com/playerswf" bgcolor="#FFFFFF" flashVars="initVideoId='.substr($link, $startingpos, $lenght).'&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&autoStart=false" base="http://admin.brightcove.com" name="bcPlayer" width="486" height="412" allowFullScreen="true" allowScriptAccess="always" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.brightcove.com/playerswf" bgcolor="#FFFFFF" flashVars="initVideoId='.substr($link, $startingpos, $lenght).'&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&autoStart=false" base="http://admin.brightcove.com" name="bcPlayer" width="486" height="412" allowFullScreen="true" allowScriptAccess="always" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" /></embed></div><!--id2-->';
                return $code;
            }
        }
                /**
                MySpace Video.
                **/
        else if (strstr($link, 'myspace') != "")
        {
            $startingpos = strpos($link, 'videoid=') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m='.substr($link, $startingpos, $lenght).'&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m='.substr($link, $startingpos, $lenght).'&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                CollegeHumor Video.
                **/
        else if (strstr($link, 'collegehumor') != "")
        {
            $startingpos = strpos($link, 'video:') + 6;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='.substr($link, $startingpos, $lenght).'&" quality="best" width="400" height="300" type="application/x-shockwave-flash" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='.substr($link, $startingpos, $lenght).'&" quality="best" width="400" height="300" type="application/x-shockwave-flash" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                vSocial Video.
                **/
        else if (strstr($link, 'vsocial') != "")
        {
            $startingpos = strpos($link, '?d=') + 3;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed allowScriptAccess="always" id="flash_player" name="flash_player" class="flash_player" height="400" width="410" src="http://static.vsocial.com/flash/ups.swf?d='.substr($link, $startingpos, $lenght).'&a=0&s=false" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed allowScriptAccess="always" id="flash_player" name="flash_player" class="flash_player" height="400" width="410" src="http://static.vsocial.com/flash/ups.swf?d='.substr($link, $startingpos, $lenght).'&a=0&s=false" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                Guba Video.
                **/
        else if (strstr($link, 'guba') != "")
        {
            $startingpos = strpos($link, '/watch/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/'.substr($link, $startingpos, $lenght).'/flash.flv&isEmbeddedPlayer=true" quality="high" bgcolor="#FFFFFF" menu="true" wmode="transparent" width="375px" height="360px" name="root" id="root" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/'.substr($link, $startingpos, $lenght).'/flash.flv&isEmbeddedPlayer=true" quality="high" bgcolor="#FFFFFF" menu="true" wmode="transparent" width="375px" height="360px" name="root" id="root" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                Glumbert Video.
                **/
        else if (strstr($link, 'glumbert') != "")
        {
            $startingpos = strpos($link, '/media/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><object width="448" height="336"><param name="movie" value="http://www.glumbert.com/embed/'.substr($link, $startingpos, $lenght).'&"></param><param name="wmode" value="transparent"></param><embed src="http://www.glumbert.com/embed/'.substr($link, $startingpos, $lenght).'&" type="application/x-shockwave-flash" wmode="transparent" width="448" height="336" /></embed></object></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><object width="448" height="336"><param name="movie" value="http://www.glumbert.com/embed/'.substr($link, $startingpos, $lenght).'&"></param><param name="wmode" value="transparent"></param><embed src="http://www.glumbert.com/embed/'.substr($link, $startingpos, $lenght).'&" type="application/x-shockwave-flash" wmode="transparent" width="448" height="336" /></embed></object></div><!--id2-->';
                return $code;
            }
        }
        else
        {
            return 'Invalid Video Link';
        }
    }

replace with
CODE
    function regex_video_tag( $matches=array() )
    {
        $startcode = "<!--id1--><div><script type='text/javascript'>var GB_ROOT_DIR = \"".$this->ipsclass->vars['board_url']."/greybox/\";</script><script type='text/javascript' src='greybox/AJS.js'></script><script type='text/javascript' src='greybox/AJS_fx.js'></script><script type='text/javascript' src='greybox/gb_scripts.js'></script><link href='greybox/gb_styles.css' rel='stylesheet' type='text/css' />";
        $endcode = "<img src='/style_images/video.png'/></a></div><!--id2-->";
        $link = $matches[1];
        if ( $link == "" )
        {
            return;
        }
                /**
                Google Video.
                **/
        if (strstr($link, 'google') != "")
        {
            $startingpos = strpos($link, 'docid=') + 6;
            $endpos = strpos($link,'&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://video.google.com/googleplayer.swf?docid=".substr($link, $startingpos, $lenght)."&' title='Google' rel='gb_page_center[400, 326]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link) - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://video.google.com/googleplayer.swf?docid=".substr($link, $startingpos, $lenght)."&' title='Google' rel='gb_page_center[400, 326]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
                YouTube Video.
                **/
        else if (strstr($link, 'youtube') != "")
        {
            $startingpos = strpos($link, 'v=') + 2;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www.youtube.com/v/".substr($link, $startingpos, $lenght)."&' title='youtube' rel='gb_page_center[425, 350]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www.youtube.com/v/".substr($link, $startingpos, $lenght)."&' title='youtube' rel='gb_page_center[425, 350]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
                LiveLeak Video.
                **/
        else if (strstr($link, 'liveleak') != "")
        {
            $startingpos = strpos($link, 'i=') + 2;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www.liveleak.com/player.swf?token=".substr($link, $startingpos, $lenght)."&' title='liveleak' rel='gb_page_center[450, 370]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www.liveleak.com/player.swf?token=".substr($link, $startingpos, $lenght)."&' title='liveleak' rel='gb_page_center[450, 370]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
             Veoh Video.
                **/
        else if (strstr($link, 'veoh') != "")
        {
            $startingpos = strpos($link, '/videos/') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www.veoh.com/videodetails2.swf?permalinkId=".substr($link, $startingpos, $lenght)."&id=anonymous&player=videodetailsembedded&videoAutoPlay=0' title='veoh' rel='gb_page_center[540, 438]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www.veoh.com/videodetails2.swf?permalinkId=".substr($link, $startingpos, $lenght)."&id=anonymous&player=videodetailsembedded&videoAutoPlay=0' veoh='veoh' rel='gb_page_center[540, 438]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
                GameTrailers Video.
                **/
        else if (strstr($link, 'gametrailers') != "")
        {
            $startingpos = strpos($link, '/player/') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.gametrailers.com/remote_wrap.php?mid='.substr($link, $startingpos, $lenght).'&" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="409" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.gametrailers.com/remote_wrap.php?mid='.substr($link, $startingpos, $lenght).'&" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="409" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                iFilm Video.
                **/
        else if (strstr($link, 'ifilm') != "")
        {
            $startingpos = strpos($link, '/video/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed width="448" height="365" src="http://www.ifilm.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed width="448" height="365" src="http://www.ifilm.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='.substr($link, $startingpos, $lenght).'&" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                Revver Video.
                **/
        else if (strstr($link, 'revver') != "")
        {
            $startingpos = strpos($link, '/watch/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="noScale" salign="TL" bgcolor="#000000" flashvars="mediaId='.substr($link, $startingpos, $lenght).'&affiliateId=0&allowFullScreen=true" allowfullscreen="true" height="392" width="480" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="noScale" salign="TL" bgcolor="#000000" flashvars="mediaId='.substr($link, $startingpos, $lenght).'&affiliateId=0&allowFullScreen=true" allowfullscreen="true" height="392" width="480" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                BrightCove Video.
                **/
        else if (strstr($link, 'brightcove') != "")
        {
            $startingpos = strpos($link, 'title=') + 6;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://www.brightcove.com/playerswf" bgcolor="#FFFFFF" flashVars="initVideoId='.substr($link, $startingpos, $lenght).'&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&autoStart=false" base="http://admin.brightcove.com" name="bcPlayer" width="486" height="412" allowFullScreen="true" allowScriptAccess="always" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://www.brightcove.com/playerswf" bgcolor="#FFFFFF" flashVars="initVideoId='.substr($link, $startingpos, $lenght).'&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&autoStart=false" base="http://admin.brightcove.com" name="bcPlayer" width="486" height="412" allowFullScreen="true" allowScriptAccess="always" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" /></embed></div><!--id2-->';
                return $code;
            }
        }
                /**
                MySpace Video.
                **/
        else if (strstr($link, 'myspace') != "")
        {
            $startingpos = strpos($link, 'videoid=') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = '<!--id1--><div><embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m='.substr($link, $startingpos, $lenght).'&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346" /></embed></div><!--id2-->';
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = '<!--id1--><div><embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m='.substr($link, $startingpos, $lenght).'&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346" /></embed></div><!--id2-->';
                return $code;
            }
        }
        /**
                CollegeHumor Video.
                **/
        else if (strstr($link, 'collegehumor') != "")
        {
            $startingpos = strpos($link, 'video:') + 6;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=".substr($link, $startingpos, $lenght)."&' title='collegehumor' rel='gb_page_center[400, 300]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=".substr($link, $startingpos, $lenght)."&' title='collegehumor' rel='gb_page_center[400, 300]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
                vSocial Video.
                **/
        else if (strstr($link, 'vsocial') != "")
        {
            $startingpos = strpos($link, '?d=') + 3;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://static.vsocial.com/flash/ups.swf?d=".substr($link, $startingpos, $lenght)."&a=0&s=false' title='vsocial' rel='gb_page_center[400, 410]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://static.vsocial.com/flash/ups.swf?d=".substr($link, $startingpos, $lenght)."&a=0&s=false' title='vsocial' rel='gb_page_center[400, 410]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
                Guba Video.
                **/
        else if (strstr($link, 'guba') != "")
        {
            $startingpos = strpos($link, '/watch/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/".substr($link, $startingpos, $lenght)."/flash.flv&isEmbeddedPlayer=true' title='guba' rel='gb_page_center[375, 360]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/".substr($link, $startingpos, $lenght)."/flash.flv&isEmbeddedPlayer=true' title='guba' rel='gb_page_center[375, 360]'>";
                $code .= $endcode;
                return $code;
            }
        }
        /**
                Glumbert Video.
                **/
        else if (strstr($link, 'glumbert') != "")
        {
            $startingpos = strpos($link, '/media/') + 7;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www.glumbert.com/embed/".substr($link, $startingpos, $lenght)."&' title='glumbert' rel='gb_page_center[450, 370]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www.glumbert.com/embed/".substr($link, $startingpos, $lenght)."&' title='glumbert' rel='gb_page_center[450, 370]'>";
                $code .= $endcode;
                return $code;
            }
        }
       /**
                Funny or Die Video.
                **/
        else if (strstr($link, 'funnyordie') != "")
        {
            $startingpos = strpos($link, '/videos/') + 8;
            $endpos = strpos($link, '&');
            if ($endpos > $startingpos)
            {
                $lenght = $endpos - $startingpos;
                $code = $startcode;
                $code .= "<a href='http://www2.funnyordie.com/public/flash/fodplayer.swf?1189050110&amp;ratename=WALKING+TALL&amp;canrate=no&amp;autostart=true&amp;key=".substr($link, $startingpos, $lenght)."' title='funnyordie' rel='gb_page_center[380, 350]'>";
                $code .= $endcode;
                return $code;
            }
            else if ($endpos < $startingpos)
            {
                $lenght = strlen($link);
                $code = $startcode;
                $code .= "<a href='http://www2.funnyordie.com/public/flash/fodplayer.swf?1189050110&amp;ratename=WALKING+TALL&amp;canrate=no&amp;autostart=true&amp;key=".substr($link, $startingpos, $lenght)."' title='funnyordie' rel='gb_page_center[380, 350]'>";
                $code .= $endcode;
                return $code;
            }
        }
        else
        {
            return 'Invalid Video Link';
        }
    }

Edited by eagle00789, 14 September 2007 - 12:47 PM.


#56 GoppoBuro

GoppoBuro

    Advanced Member

  • Members
  • PipPipPipPip
  • 77 posts
  • IPB Version:v2.3.x

Posted 16 September 2007 - 07:00 AM

glad to say that i have installed the code. working fine in my board. thanks a lot to bort for this fantastic mod smile.gif

#57 Leinad

Leinad

    Novice

  • Members
  • PipPip
  • 5 posts
  • IPB Version:N/A

Posted 20 September 2007 - 10:24 AM

Great mod! thumbsup.gif
Anyway, here is some bug reports:

  
QUOTE(Bort Simpson @ Sep 7 2007, 06:19 PM) <{POST_SNAPBACK}>
The button in the normal reply will add the [video] tags between any selected url (like the code/quote bbcode), the quick reply/edit window use a pop up (like the image bbcode) where you can input the url.

The popup window works using IExplorer but not Firefox.

In addition, about www.gametrailers.com, there are two types of links:
  1. http://www.gametrail...ayer/25171.html
The first one is working properly, but not the second.. would it be possible to add it to the supported list?

Tnx! flowers.gif

#58 Mexfrag

Mexfrag

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Mexico
  • IPB Version:v3.0.x

Posted 20 September 2007 - 04:38 PM

I tested the mod on Firefox,
Clean your cache to see if that fix the problem, the popup use almost the same code as the image button.

I will check the gametrailers problem.

#59 Leinad

Leinad

    Novice

  • Members
  • PipPip
  • 5 posts
  • IPB Version:N/A

Posted 21 September 2007 - 11:28 AM

QUOTE(Bort Simpson @ Sep 20 2007, 11:38 AM) <{POST_SNAPBACK}>
Clean your cache to see if that fix the problem, the popup use almost the same code as the image button.

I actually solved by cleaning browser's cache.
Tnx happy.gif

#60 puffer

puffer

    Novice

  • Banned
  • PipPip
  • 5 posts
  • Real Name:Ian
  • IPB Version:v3.0.x

Posted 24 September 2007 - 01:07 PM

SUPERB Mod!!!!
been looking for something like this for ages, installed perfectly (took a while though but worth it!)

any news on your next release so the "insert flash video" popup works on full edit/reply/post box, not just the quick reply box?
keep up the fantastic work!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users