Print Topic - Archive

E-Blah Community  /  Forum Support  /  Problem Embedding Video
Posted by: impished, January 26, 2009, 10:39am
Hi,
I've allowed my users to embed video via sites (youtube, etc)  embed codes.  Unfortunately, one of the most popular sites among my users puts ' in their code instead of "
Is there a way I automatically change ' to a " ?

This is an example of the embed code from http://www.PinkBike.com with the offending '

<object width='500' height='440'><param name='allowFullScreen' value='true' /><param name='allowScriptAccess' value='always' /><param name='movie' value='http://www.pinkbike.com/v/49357/l/' /><embed src='http://www.pinkbike.com/v/49357/l/' type='application/x-shockwave-flash' width='500' height='440' allowFullScreen='true' allowScriptAccess='always'></embed></object>
Posted by: Nat, January 26, 2009, 10:49am; Reply: 1
Have you tried Martins YouTube mod? works a treat and can be found in the modification section
Posted by: impished, January 26, 2009, 12:52pm; Reply: 2
I have the media mod installed also.  The problem is that PinkBike have chosen to use apostrophes and not quotation marks.  I am sure it can be resolved in Perl, but I have yet to work out how to do it.
Posted by: Martin, January 26, 2009, 2:17pm; Reply: 3
Download the attached, unzip and upload in ASCII overwriting the current Media.pl
I have modified it to include pinkbike.com
Posted by: impished, January 26, 2009, 2:58pm; Reply: 4
Quoted from Martin
Download the attached, unzip and upload in ASCII overwriting the current Media.pl
I have modified it to include pinkbike.com

Thanks for your quick help Martin....  Alas, it didn't work :'(

The original url = http://www.pinkbike.com/video/49357/ needs to end-up as http://www.pinkbike.com/v/49357/

Sorry but I've tried to snoop at Perl, but can't quite work out the reg-ex for this one :-/
Posted by: Martin, January 26, 2009, 3:20pm; Reply: 5
Works on my test site: http://www.opportunitynowhere.co.uk/cgi-bin/forum/Blah.pl?m-1233000371/

Here's what I put between the media inserts:

[media]http://www.pinkbike.com/v/49357[/media]

even works with:

[media]http://www.pinkbike.com/v/49357/l/[/media]

I would like to point out that this is how you add the media, you don't insert the full embed code.
Posted by: impished, January 26, 2009, 4:51pm; Reply: 6
Quoted from Martin
Works on my test site: http://www.opportunitynowhere.co.uk/cgi-bin/forum/Blah.pl?m-1233000371/

Here's what I put between the media inserts:

[media]http://www.pinkbike.com/v/49357[/media]

even works with:

[media]http://www.pinkbike.com/v/49357/l/[/media]

I would like to point out that this is how you add the media, you don't insert the full embed code.

Thanks for helping Martin.... but....  your link above doesn't work.....  and the PinkBike original url is http://www.pinkbike.com/video/49357/

Posted by: Martin, January 27, 2009, 12:31am; Reply: 7
Sorry, still works for me and I just clicked my link to the test post and it's the same video that you say is the original.

And this is from your original post: http://www.pinkbike.com/v/49357/l/
This from mine: http://www.pinkbike.com/v/49357/l/

This won't work by pasting it directly in your browser as the v is transposed to video.

Maybe someone else can click the links and see if it works for them?
Posted by: impished, January 27, 2009, 4:49am; Reply: 8
I'm really sorry Martin.... I was being a plonker :-( and talking cross-purposes.

The original url = http://www.pinkbike.com/video/49357/
The media mod needs to change the url to http://www.pinkbike.com/v/49357/l/

Again, I'm really sorry for being a plonker and I appreciate your time and effort.
Posted by: impished, January 27, 2009, 7:20am; Reply: 9
OK, thanks for your help Martin, and again apologies for confusing the issue.  But I've worked it out myself.
Posted by: PunkMaister, April 25, 2009, 9:57pm; Reply: 10
I take it that I cannot use the adm. control pannel to use any of this can I? I would need to phisically access the server itself wouldn't I? If so then it befalls on the adm. of the website as a whole itself as I just administer the board itself.
Posted by: Martin, April 26, 2009, 1:11am; Reply: 11
You would need the webmaster to upload the mod via ftp so it can be installed via the Admin Center
Posted by: iCONICA, April 26, 2009, 9:28am; Reply: 12
You can copy and paste the code from the mod into E-Blah's modification Center if you don't have FTP access. But I'm not sure I understand your question?
Posted by: PunkMaister, April 26, 2009, 4:41pm; Reply: 13
Quoted from iCONICA
You can copy and paste the code from the mod into E-Blah's modification Center if you don't have FTP access. But I'm not sure I understand your question?


I've tried using the modification center using copy/paste for the code here:
Quoted Text
#############################################
# E-Blah Bulliten Board Systems        2007 #
#############################################
# Copyright (c) 2001 - 2007 E-Blah.         #
#############################################
sub embed {
     if (!$player_version){$player_version = 6;}

     my ($media_url,$play_pars) = @_;
     if ($media_url !~ m/^http:\/\//){ $media_url = "media://" + $media_url; } else { $media_url =~s~http:~media:~g; }
     ## file extensions that open windows media player for video
     if ($media_url =~ m/.wmv$/i || $media_url =~ m/.wpl$/i || $media_url =~ m/.asf$/i || $media_url =~ m/.avi$/i || $media_url =~ m/.mpg$/i || $media_url =~ m/.mpeg$/i){
          if ($player_version == 6){
               $video = $embed_wmv6;
          } elsif ($player_version == 10){
               $video = $embed_wmv10;
          } else {
               $video = $embed_wmv6;
          }
          $controlheight = 45;
     ## file extensions that open windows media player for audio
     } elsif ($media_url =~ m/.wma$/i || $media_url =~ m/.wax$/i || $media_url =~ m/.asx$/i || $media_url =~ m/.mp3$/i || $media_url =~ m/.mid$/i || $media_url =~ m/.wav$/i || $media_url =~ m/.kar$/i || $media_url =~ m/.rmi$/i){
          if ($player_version == 6){
               $video = $embed_wma6;
          } elsif ($player_version == 10){
               $video = $embed_wma10;
          } else {
               $video = $embed_wma6;
          }
     ## file extensions that open flash player
     } elsif ($media_url =~ m/.ra$/i || $media_url =~ m/.ram$/i || $media_url =~ m/.rm$/i){
          $video = $embed_ra;
     } elsif ($media_url =~ m/.swf$/i){
          $video = $embed_flash;
     } elsif ($media_url =~ m/youtube\.com/i){
          $media_url =~ s~watch\?v\=~v\/~g;
          $video = $embed_flash;
          $controlheight = 36;
     ## file extensions that open pinkbike player
     } elsif ($media_url =~ m/pinkbike\.com/i){
          $media_url =~ s~watch\?v\=~v\/~g;
          $video =$embed_flash2;
          $controlheight = 25;
     ## file extensions that open apple quicktime player player
     } elsif ($media_url =~ m/.qt$/ || $media_url =~ m/.qtm$/i || $media_url =~ m/.mov$/i){
          $video = $embed_qt;
          $controlheight = 15;
     }
     if ($play_pars =~ m/loop/){$pl_loop = "true"; } else {$pl_loop = "false"; }
     if ($play_pars =~ m/hide/ || $play_pars =~ m/hidden/){$pl_controls = "false"; $pl_controlheight = 0; $pl_controlwidth = 0;} else {$pl_controls = "true"; $pl_controlheight = 45; $pl_controlwidth = 320;}
     if ($play_pars =~ m/autostart/){$pl_start = "true"; } else {$pl_start = "false"; }
     if ($play_pars =~ m/width\=(\d{2,3})/i){
          $tempwidth= $1;
          if ($tempwidth >= 180 || $tempwidth <= 800){
               $pl_width = int($tempwidth);
               $pl_height = int(($pl_width*3)/4) + $controlheight;
          } else {
               $pl_width = 320;
               $pl_height = 240 + $controlheight;
          }
     } else {
          $pl_width = 320;
          $pl_height = 240 + $controlheight;
     }
     $video =~ s~[\t\r\n]~~g;
     $video =~ s~_width_~$pl_width~ig;
     $video =~ s~_controls_~$pl_controls~ig;
     $video =~ s~_height_~$pl_height~ig;
     $video =~ s~_controlheight_~$pl_controlheight~ig;
     $video =~ s~_controlwidth_~$pl_controlwidth~ig;
     $video =~ s~_media_~$media_url~ig;
     $video =~ s~_loop_~$pl_loop~ig;
     $video =~ s~_autostart_~$pl_start~ig;
     return $video;
}

sub flashconvert{
     my ($fl_url,$fl_size) = @_;
     $fl_size =~ s/ //g;
     my ($fl_width, undef) = split (/\,/ , $fl_size);
     return "\[media width\=$fl_width\]$fl_url\[/media\]";
}

## Windows Media Player 6.4 Video
$embed_wmv6 = qq~
      <object id='mediaPlayera' width="_width_" height="_height_"
      classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
      standby='Loading Microsoft Windows Media Player 6.4 components...' type='application/x-oleobject'>
      <param name='fileName' value="_media_"></param>
      <param name='autoStart' value="_autostart_"></param>
      <param name='showControls' value="_controls_"></param>
      <param name='loop' value="_loop_"></param>
      </object>
~;

## Windows Media Player 6.4 Audio
$embed_wma6 = qq~
      <object id='mediaPlayerb' width="_controlwidth_" height="_controlheight_"
      classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
      standby='Loading Microsoft Windows Media Player 6.4 components...' type='application/x-oleobject'>
      <param name='fileName' value="_media_"></param>
      <param name='autoStart' value="_autostart_"></param>
      <param name='showControls' value="_controls_"></param>
      <param name='loop' value="_loop_"></param>
      </object>
~;

## Windows Media Player 7,9 or 10 Video
$embed_wmv10 = qq~
      <object id='mediaPlayerc' width="_width_" height="_height_"
      classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'
      standby='Loading Microsoft Windows Media Player 7, 9 or 10 components...' type='application/x-oleobject'>
      <param name='fileName' value="_media_"></param>
      <param name='autoStart' value="_autostart_"></param>
      <param name='showControls' value="_controls_"></param>
      <param name='loop' value="_loop_"></param>
      </object>
~;

## Windows Media Player 7,9 or 10 Audio
$embed_wma10 = qq~
      <object id='mediaPlayerd' width="_controlwidth_" height="_controlheight_"
      classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'
      standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
      <param name='fileName' value="_media_"></param>
      <param name='autoStart' value="_autostart_"></param>
      <param name='showControls' value="_controls_"></param>
      <param name='loop' value="_loop_"></param>
      </object>
~;

$embed_ra = qq~
        <object id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
        width="320" height="_height_">
        <param name='src' value="_media_"></param>
        <param name='autostart' value="_autostart_"></param>
        <param name='controls' value='imagewindow'></param>
        <param name='console' value='video'></param>
        <param name='loop' value="_loop_"></param>
          </object>
~;

$embed_qt = qq~
        <object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="_width_"
        height="_height_" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="_media_"></param>
        <param name='autoplay' value="_autostart_"></param>
        <param name='controller' value="_controls_"></param>
        <param name='loop' value="_loop_"></param>
        </object>
~;

$embed_flash = qq~
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
     width="_width_" height="_height_" id="myMovieName">
     <param name='movie' value="_media_"></param>
     <param name='quality' value="high"></param>
     <param name='bgcolor' value="#fff"></param>
<embed src="_media_" quality="high" bgcolor="#fff"
width="_width_" height="_height_"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
     </object>
~;

$embed_flash2 = qq~
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
     width="_width_" height="_height_" id="myMovieName">
     <param name='movie' value="_media_"></param>
     <param name='quality' value="high"></param>
     <param name='bgcolor' value="#fff"></param>
     <param name='allowFullScreen' value="false">
     <param name='allowScriptAccess' value="never">

<embed src="_media_" quality="high" bgcolor="#fff"
width="_width_" height="_height_"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
     </object>
~;
1;


And I get in return this error message:

Quoted Text
The modification you entered is not valid. A valid modification must have a modname tag.



The version of E-Blah we got is E-Blah 10.3.6
Posted by: iCONICA, April 26, 2009, 6:56pm; Reply: 14
No, you can't simply paste a block of perl code into there.
If you have a valid modification, written by someone here, it'll have .v2m (I think) as the file extension. You can paste the contents of that into the modification Center. Saves having to use the FTP method.
Posted by: PunkMaister, April 26, 2009, 8:38pm; Reply: 15
Quoted from iCONICA
No, you can't simply paste a block of perl code into there.
If you have a valid modification, written by someone here, it'll have .v2m (I think) as the file extension. You can paste the contents of that into the modification Center. Saves having to use the FTP method.


Is there anyone that has such a thing or anywhere that you or anyone know that I might obtain it?


Posted by: iCONICA, April 26, 2009, 8:45pm; Reply: 16
I've lost you? Obtain what?

If you mean the embedding video mod, it's in the modifications board here.

I'm not sure I know what your after?
Posted by: PunkMaister, April 26, 2009, 8:52pm; Reply: 17
Quoted from iCONICA
I've lost you? Obtain what?

If you mean the embedding video mod, it's in the modifications board here.

I'm not sure I know what your after?

Well I cannot find that code you speak off anywhere around here.
Posted by: iCONICA, April 26, 2009, 9:14pm; Reply: 18
http://www.eblah.com/forum/m-1211527480/

I'm pretty sure it's the media mod from that list. :)
Posted by: PunkMaister, April 26, 2009, 10:14pm; Reply: 19
Quoted from iCONICA
http://www.eblah.com/forum/m-1211527480/

I'm pretty sure it's the media mod from that list. :)


Well I used the media c ode which is the closest thing on all that list to what I want with YouTube Videos and it has crashed the whole freaking website! Even backing down on the browser and attempting to remove the dang thing thing does nothing!


Posted by: iCONICA, April 27, 2009, 11:27am; Reply: 20
No idea what's caused that.

At what point did things go wrong? And did you test install before installing if you gotten that far?
Posted by: PunkMaister, April 27, 2009, 4:46pm; Reply: 21
Quoted from iCONICA
No idea what's caused that.

At what point did things go wrong? And did you test install before installing if you gotten that far?


My bad I did not test it, I assumed that it would work and never ever imagined that it would cause the whole thing to crash and to rebuilt everything from scratch which is what will have to happen now as probably not even the backup will work if restored! :(

Posted by: Martin, April 27, 2009, 11:52pm; Reply: 22
It probably won't need reinstalling but as I have said in another reply "you will need ftp access"
Posted by: PunkMaister, April 28, 2009, 1:33am; Reply: 23
Quoted from Martin
It probably won't need reinstalling but as I have said in another reply "you will need ftp access"

Well the website adm. has tried just about he can from his end and thus has decided to go thru the reinstalling rebuilding everything from scratch kind of route! :( Both him and I are not very experienced when it comes to using forum software of any kind. I have managed boards before but all from free domain servers that alreadty have all their software installed and ready to go etc. :o

Posted by: iCONICA, April 28, 2009, 10:52am; Reply: 24
If your going to start from scratch, did you have any threads or members? If so, make sure to save a copy of the old forum. You'll need to keep some of the files from the old installation. If not, then a fresh install is fine. :)
Print page generated: February 12, 2012, 2:50pm