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 [2] 3 4 5 6 ... 22   Go Down

Author Topic: Displaying videos from Youtube in Coppermine.  (Read 431863 times)

0 Members and 1 Guest are viewing this topic.

h4nh4n

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 38
  • God loves you!
    • Indonesian Actress
Re: Displaying videos from Youtube in Coppermine.
« Reply #20 on: November 06, 2006, 01:18:41 pm »

You probably added some whitespace at the end of your theme.php by accident.
Yup, I have fixed the sitemap.. You were right, I had put the code at the end of my theme.php then I move copy theme_html_picture() to the top after
Code: [Select]
define('THEME_IS_XHTML10_TRANSITIONAL',1); and works fine now.

Thanks :)
Logged
Artis Indonesia - Albums of Indonesian Actresses
Johan Ng - Personal Website

Quinttindew

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Displaying videos from Youtube in Coppermine.
« Reply #21 on: November 08, 2006, 05:15:35 pm »

 I have install the mod , but , I upload an video , But I get only the jpg and not the video


Logged

h4nh4n

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 38
  • God loves you!
    • Indonesian Actress
Re: Displaying videos from Youtube in Coppermine.
« Reply #22 on: November 08, 2006, 06:24:03 pm »

I have install the mod , but , I upload an video , But I get only the jpg and not the video



I have the same problem before, I just re-do editing for theme.php and now its works perfect.
Logged
Artis Indonesia - Albums of Indonesian Actresses
Johan Ng - Personal Website

Quinttindew

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Displaying videos from Youtube in Coppermine.
« Reply #23 on: November 08, 2006, 07:14:42 pm »

Hi How you mean exactly , i dnt understand It

grteets
Logged

mywedding

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 42
  • MyWedding
    • Wedding
Re: Displaying videos from Youtube in Coppermine.
« Reply #24 on: November 10, 2006, 09:42:26 am »

i took youtube code and then i put the codes ....

and i changed all of you wrote of codes for  coper.. 1.4.5 ,
 but , it seems upload an video with no error ,  But I get only the jpg and not the video

could you help me pls....i did read all your advice , bu ti can't...

its my copermine pages address http://www.dugunum.com/Gelin-Fotograflari/

best regards
dugunum
Logged
Dreams are free, so free your dreams, "Astrid Alauda"

Nibbler

  • Guest
Re: Displaying videos from Youtube in Coppermine.
« Reply #25 on: November 10, 2006, 12:08:23 pm »

You probably missed the edit to theme.php
Logged

mywedding

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 42
  • MyWedding
    • Wedding
Re: Displaying videos from Youtube in Coppermine.
« Reply #26 on: November 10, 2006, 01:40:56 pm »

i try again,
Logged
Dreams are free, so free your dreams, "Astrid Alauda"

mywedding

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 42
  • MyWedding
    • Wedding
Re: Displaying videos from Youtube in Coppermine.
« Reply #27 on: November 10, 2006, 02:01:48 pm »

its ok...

but i changed different "theme.php" ....its was in the "include" , what i change..
http://www.dugunum.com/Gelin-Fotograflari/displayimage.php?&pos=-3103

well , many thanks for your greet copprmine script to all of your team , who worked for that...

i love coppermine..

bye from istanbul ,which is magnificent city...

i try again,
« Last Edit: November 10, 2006, 07:14:11 pm by GauGau »
Logged
Dreams are free, so free your dreams, "Astrid Alauda"

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Displaying videos from Youtube in Coppermine.
« Reply #28 on: November 10, 2006, 07:14:50 pm »

You mustn't edit include/themes.inc.php!
Logged

phpbbguy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Displaying videos from Youtube in Coppermine.
« Reply #29 on: November 11, 2006, 05:26:24 pm »

when you say
theme.php (if you can't find this code, copy theme_html_picture() over from sample theme and then apply the change)

do you mean everything after that bit of code? am using eyeball and am missing that bit of code, so should i copy the whole code from sample theme into the eyeball theme?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Displaying videos from Youtube in Coppermine.
« Reply #30 on: November 12, 2006, 10:40:18 am »

If the function is not in your custom theme, this is what you need to paste in (into a new line before ?>):
Code: [Select]
// Displays a picture
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo;

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}
Logged

compexsistemas

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Displaying videos from Youtube in Coppermine.
« Reply #31 on: November 15, 2006, 05:56:54 pm »

Hello, I use Dreamhost… and fopen cannot be qualified (off)… is no form to make work this mod? for example using cURL? Thanks and greetings from Argentina!  ???
Logged

Nibbler

  • Guest
Re: Displaying videos from Youtube in Coppermine.
« Reply #32 on: November 15, 2006, 07:19:16 pm »

Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Displaying videos from Youtube in Coppermine.
« Reply #33 on: November 15, 2006, 09:41:08 pm »

really dumb question- but I have to ask.... I am not at home now so I can't test.......

when doing this will your server be hosting the videos or will you tube still be hosting them? In other words are you uploading the videos to your own server or are you streaming them off their servers?
Logged

Nibbler

  • Guest
Re: Displaying videos from Youtube in Coppermine.
« Reply #34 on: November 15, 2006, 09:47:11 pm »

They remain at youtube. Only the thumbnail is copied to your gallery.
Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Displaying videos from Youtube in Coppermine.
« Reply #35 on: November 16, 2006, 05:13:44 pm »

They remain at youtube. Only the thumbnail is copied to your gallery.


Sweet! Thanks Nibbler  ;D
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Displaying videos from Youtube in Coppermine.
« Reply #36 on: November 29, 2006, 04:03:02 am »

Hey guys,

This mod is working beautifully, but I'm finding users are getting images and youtube videos confused.
I wanted to add a watermark to youtube vids on this mod to quell this confusion...

So far I've got:
Code: [Select]
$cmdline = 'composite -compose over -gravity southeast "youtubewatermark.png" "tmp.jpg" '.'"tmp.jpg" 2>&1';
exec($cmdline);

I've pulled this from an old bit of code, and honestly can't remember the details of it (whether you need to declare anything to get the imagemagick commands working etc? I don't think so)
Anyway, I don't really know where to integrate this into this mod, and if/how I need to adjust it to get it working correctly.

Does anyone have any clues on this? It would be greatly appreciated! cheers
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Displaying videos from Youtube in Coppermine.
« Reply #37 on: November 29, 2006, 04:17:48 am »

Your probably going to run into problems, if your host is running any kind of safe mode you won't be allowed to shell out, and many hosts don't have imagemagik installed.

Are you sure you have access to imagemagik?

You might look for some gd2 examples. 

also you might consider downloading the cpgmark plugin from cpg-contrib.org, it uses gd2 to do watermarking that you could use as an example.
« Last Edit: November 29, 2006, 06:02:09 am by donnoman »
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Displaying videos from Youtube in Coppermine.
« Reply #38 on: November 29, 2006, 04:52:00 am »

yeah I've got imagemagick working - that "composite" line of code is working in another upload php file...

I'm not really sure where in this mod to try and execute it tho...
Logged

KrustyTK

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Displaying videos from Youtube in Coppermine.
« Reply #39 on: November 29, 2006, 11:38:44 pm »

BRILLIANT!!!

Thank you verry much for this.
Logged
Pages: 1 [2] 3 4 5 6 ... 22   Go Up
 

Page created in 0.025 seconds with 20 queries.