Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: youtube  (Read 5199 times)

0 Members and 1 Guest are viewing this topic.

iain sherriff

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
youtube
« on: February 15, 2008, 01:13:39 pm »

I have a mod in my phpbb3 that uses BBcodes to embed youtube vids in posts.

eg     www.lowriderforums.com/forum/viewtopic.php?f=16&t=1409

the mod is
Code: [Select]
<copy>
<file from="root/video.php" to="video.php" />
</copy>

<diy-instructions lang="en"><![CDATA[Go to the Administration Control Panel and navigate to the "Posting" tab,
 then
to the "BBCodes" section. Click the "Add a new BBCode" button. The following
page is where you are to enter the information for the new BBCode.

    (1) In the "BBCode usage" area, enter the following:
    [video]{TEXT}[/video]

    (2) In the "HTML replacement" area, enter the following:
    <script type="text/javascript" src="video.php?link={TEXT}"></script>

    (3) In the "Help line" area, enter the following:
    Note: [video]link[/video]

    (4) In the "Settings" area, check the box for "Display on posting page" if
        you want a "video" button placed alongside the other BBCode buttons.

When that's all filled out, click "Submit".

and the php file is
Code: [Select]
<?php

Function get_video($link){
$values = array (
array (
'video.google''docid=:$:0' '<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={ID_VIDEO}&hl=it" flashvars=""> </embed>'),

array (
'youtube.com''v=:$:0' '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/{ID_VIDEO}&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{ID_VIDEO}&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>'),

array (
'metacafe.com''watch/:$:1' '<embed src="http://www.metacafe.com/fplayer/{ID_VIDEO}.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>'),

array (
'dailymotion''video/:$:0' '{DOWNLOAD}:<input id="video_player_embed_code_text" class="text" onclick="this.select()" type="text" value=":":<br />'),

array (
'starsclips.net''videos.aspx/:$:0','<object width="400" height="320"><param name="movie" value="http://www.starsclips.net/emb.aspx/{ID_VIDEO}"></param><param name="wmode" value="transparent"></param><embed src="http://www.starsclips.net/emb.aspx/{ID_VIDEO}" type="application/x-shockwave-flash" wmode="transparent" width="400" height="320"></embed></object>'),

array (
'vids.myspace.com''videoID=:$:0','<embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m=4674348&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346"></embed>')

);


if (
eregi('^(http|https)+(:\/\/)+[a-z0-9_-]+\.+[a-z0-9_-]'$link)){
for (
$x=0$x<count($values); $x++){
if(
stristr($link$values[$x][0])) {
$temp explode (':'$values[$x][1]);
$temp2 explode ($temp[0],$link);
If ($temp[1]=='$'){
$idvideo substr($temp2[1],0,strlen($temp2[1])-$temp[2]);
} else {
$temp3 explode ($temp2[1],$temp[1]);
$idvideo substr($temp3[0],0,strlen($temp3[0])-$temp[2]);
}
If (stristr($values[$x][2],'{DOWNLOAD}')){
$page file_get_contents ($link);
$temp4 explode (':'$values[$x][2]);
$temp5 explode ($temp4[1],$page );
$temp6 explode ($temp4[2],$temp5[1]);
$temp7 explode ('<br />'strip_tags(html_entity_decode($temp6[0]),'<object><param><embed><br>'));
Return $temp7[0];
} else {
Return str_replace ('{ID_VIDEO}',$idvideo,$values[$x][2]);
}

}
}
} else { Return 
'You\'ve inserted no links.'; }
}

If (
$_GET['link']){
echo 
"window.document.write('".addslashes(get_video($_GET['link']))."');";
}
?>

I have coppermine latest version bridged to my phpbb3. [www.lowriderforums.com/cpm]
I cant host vids on my server which is why the embeded youtube mod is great for my users.
I have seen Nibblers mod for youtube on here but , while I can [usually] install a mod by copy/paste and follow basic instructions I dont understand what the mod does behind the scenes  :-\.
The BBcode mod seems very simple to me and works flawlessly................ can a version if this be used to embed youtube in my coppermine galleries?

Thanks in advance

Iain
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.