Displaying videos from Youtube in Coppermine. - Page 2 Displaying videos from Youtube in Coppermine. - Page 2
 

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]

Main Menu

Displaying videos from Youtube in Coppermine.

Started by Nibbler, October 31, 2006, 03:42:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

h4nh4n

Quote from: Nibbler on November 06, 2006, 12:31:50 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 define('THEME_IS_XHTML10_TRANSITIONAL',1); and works fine now.

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

Quinttindew

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



h4nh4n

Quote from: Quinttindew 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



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

Quinttindew

Hi How you mean exactly , i dnt understand It

grteets

mywedding

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
Dreams are free, so free your dreams, "Astrid Alauda"

Nibbler


mywedding

Dreams are free, so free your dreams, "Astrid Alauda"

mywedding

#27
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...

Quote from: dugunum on November 10, 2006, 01:40:56 PM
i try again,
Dreams are free, so free your dreams, "Astrid Alauda"

Joachim Müller


phpbbguy

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?

Joachim Müller

If the function is not in your custom theme, this is what you need to paste in (into a new line before ?>):// 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);
}

compexsistemas

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!  ???


capecodgal

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?

Nibbler

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

capecodgal

Quote from: Nibbler on November 15, 2006, 09:47:11 PM
They remain at youtube. Only the thumbnail is copied to your gallery.


Sweet! Thanks Nibbler  ;D

bitcloud

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:
$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

donnoman

#37
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.

bitcloud

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...

KrustyTK