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   Go Down

Author Topic: Open PDF from within CPG - work in progress - 1.4.10  (Read 17095 times)

0 Members and 1 Guest are viewing this topic.

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Open PDF from within CPG - work in progress - 1.4.10
« on: November 27, 2006, 07:08:58 pm »

Guys and Gals from CPG.

I searched but seem to be unable to come up with the right search keywords for finding the mod
once made to open and browse pdf files within CPG.

Can someone point me in the right direction ?

Thanks
Hein
« Last Edit: December 05, 2006, 10:14:42 am by Sami »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Open PDF from within CPG
« Reply #1 on: November 27, 2006, 07:22:03 pm »

Browse pdf files directly in your gallery. (Warning: mod has originally been created for cpg1.3.x!)
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG
« Reply #2 on: November 28, 2006, 12:48:46 pm »

Thanks for the link GauGau. Will try to get it going on 1.4.10 , i'll see how far i get  ;D

Hein
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Open PDF from within CPG
« Reply #3 on: November 28, 2006, 05:20:06 pm »

If you should manage to port it to cpg1.4.x, it would be great if you could post it for the benefit of others. If you decide to do so, please start a new thread (with reference to the old mod) and post your instructions on how to apply the mod in your new thread.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG
« Reply #4 on: November 30, 2006, 04:56:41 pm »

I tried and tried but got nowhere. The code differs to much from 1.3 , for which it was originally written, for me to make it work.

It is a very handy mod though. Maybe somebody else, Nibbler maybe, can look at getting this to work for 1.4.x ?

Thanks
Hein
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Open PDF from within CPG
« Reply #5 on: November 30, 2006, 10:55:26 pm »

Hein can you try this cause I don't have access to my test bed :

1) open up the scripts.js and add the following at the end of that:
Code: [Select]
pos = 1;

function next(top)
{
pos +=1;
if (pos > top) pos = 1
repoint();
}

function prev(top)
{
pos -=1;
if (pos < 1) pos = top
repoint();
}

function repoint()
{
var picurl = document.getElementById("pdfview").src;
picurl = picurl.replace(/(\d+)\.jpg$/, pos + '.jpg');
document.getElementById("pdfview").src = picurl;
}

2) Open up themes/yourtheme/theme.php and add this function before ?> (php end tag)
Code: [Select]
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";
        }
    // pdf additions begin
    } elseif ($mime_content['mime'] == 'application/pdf'){
        $pic_thumb_url = explode('.', $picture_url);
array_pop($pic_thumb_url);
$baseurl = implode('.', $pic_thumb_url);
$pic_thumb_url = $baseurl . '.1.jpg';

$i = 0;
while (file_exists($baseurl . '.' .++$i.".jpg"));
$i--;

$pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img id=\"pdfview\" src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
$pic_html .= '<a href="javascript:;" onclick="prev('.$i.')"><img src="images/prev.gif" width="16" height="16" border="0" /></a> Browse this document <a href="javascript:;" onclick="next('.$i.')"><img src="images/next.gif" width="16" height="16" border="0" /></a><br />';
// pdf additions end
} 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:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" ',
                                '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);
}

3) Open up include/picmgmt.inc.php and change add_picture function with this one
Code: [Select]
function add_picture($aid, $filepath, $filename, $position = 0, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '', $iwidth = 0, $iheight = 0)
{
    global $CONFIG, $ERROR, $USER_DATA, $PIC_NEED_APPROVAL;
    global $lang_errors;

    $image = $CONFIG['fullpath'] . $filepath . $filename;
    $normal = $CONFIG['fullpath'] . $filepath . $CONFIG['normal_pfx'] . $filename;
    $thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $filename;



    if (!is_known_filetype($image)) {
        return false;
    } elseif (is_image($filename)) {
        $imagesize = getimagesize($image);

        if ($CONFIG['read_iptc_data']) {
           $iptc = get_IPTC($image);
           if (is_array($iptc) && !$title && !$caption && !$keywords) {  //if any of those 3 are filled out we don't want to override them, they may be blank on purpose.
               $title = (isset($iptc['Title'])) ? $iptc['Title'] : $title;
               $caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
               $keywords = (isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']) : $keywords;
           }
        }

        if (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']) //$CONFIG['auto_resize']==1
        {
          //resize_image($image, $image, $CONFIG['max_upl_width_height'], $CONFIG['thumb_method'], $imagesize[0] > $CONFIG['max_upl_width_height'] ? 'wd' : 'ht');
          resize_image($image, $image, $CONFIG['max_upl_width_height'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
          $imagesize = getimagesize($image);
        }
        if (!file_exists($thumb)) {
            if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))
                return false;
        }
        if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'] && !file_exists($normal)) {
            if (!resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))
                return false;
        }
    // pdf additions begin
    } elseif (strtolower(array_pop(explode('.', $filename))) == 'pdf'){
$cmd = "/usr/bin/ghostscript -sDEVICE=jpeg -dNOPAUSE  -dBATCH -sOutputFile='{$CONFIG['fullpath']}edit/pdftmp.$filename.%d.jpg' '$image'";
exec ($cmd, $output, $retval);
if ($retval) die("Error $retval on command '$cmd'");

if ($dh = opendir("{$CONFIG['fullpath']}edit")) {
while (($file = readdir($dh)) !== false) {
if (strpos($file, 'pdftmp') === 0){
$parts = explode('.', $file);
$jpeg = array_pop($parts);
$i = array_pop($parts);
$pdf = array_pop($parts);
array_shift($parts);
$rawname = implode('.', $parts);
$dest = "{$CONFIG['fullpath']}$filepath$rawname.$i.jpg";
$src = "{$CONFIG['fullpath']}edit/$file";
resize_image($src, $dest, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
unlink($src);
}
}
$thumbname = "{$CONFIG['fullpath']}$filepath/{$CONFIG['thumb_pfx']}$rawname.jpg";
resize_image("{$CONFIG['fullpath']}$filepath$rawname.1.jpg", $thumbname, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
        closedir($dh);
}
   // pdf additions end
    } else {
        $imagesize[0] = $iwidth;
        $imagesize[1] = $iheight;
    }

    $image_filesize = filesize($image);
    $total_filesize = is_image($filename) ? ($image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb)) : ($image_filesize);


    // Test if disk quota exceeded
    if (!GALLERY_ADMIN_MODE && $USER_DATA['group_quota']) {
        $result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");
        $record = mysql_fetch_array($result);
        $total_space_used = $record[0];
        mysql_free_result($result);

        if ((($total_space_used + $total_filesize)>>10) > $USER_DATA['group_quota'] ) {
            @unlink($image);
            if (is_image($image)) {
                @unlink($normal);
                @unlink($thumb);
            }
            $msg = strtr($lang_errors['quota_exceeded'], array('[quota]' => ($USER_DATA['group_quota']),
                '[space]' => ($total_space_used >> 10)));
            cpg_die(ERROR, $msg, __FILE__, __LINE__);
        }
    }
    // Test if picture requires approval
    if (GALLERY_ADMIN_MODE) {
        $approved = 'YES';
    } elseif (!$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT + USER_ID) {
        $approved = 'YES';
    } elseif (!$USER_DATA['pub_upl_need_approval'] && $category < FIRST_USER_CAT) {
        $approved = 'YES';
    } else {
        $approved = 'NO';
    }
    $PIC_NEED_APPROVAL = ($approved == 'NO');
    // User ID is now recorded when in admin mode (casper)
    $user_id = USER_ID;
    $username= USER_NAME;
    // Populate Array to pass to plugins, then to SQL.
    $CURRENT_PIC_DATA['aid'] = $aid;
    $CURRENT_PIC_DATA['filepath'] = $filepath;
    $CURRENT_PIC_DATA['filename'] = $filename;
    $CURRENT_PIC_DATA['filesize'] = $image_filesize;
    $CURRENT_PIC_DATA['total_filesize'] = $total_filesize;
    $CURRENT_PIC_DATA['pwidth'] = $imagesize[0];
    $CURRENT_PIC_DATA['pheight'] = $imagesize[1];
    $CURRENT_PIC_DATA['owner_id'] = $user_id;
    $CURRENT_PIC_DATA['owner_name'] = $username;
    $CURRENT_PIC_DATA['title'] = $title;
    $CURRENT_PIC_DATA['caption'] = $caption;
    $CURRENT_PIC_DATA['keywords'] = $keywords;
    $CURRENT_PIC_DATA['approved'] = $approved;
    $CURRENT_PIC_DATA['user1'] = $user1;
    $CURRENT_PIC_DATA['user2'] = $user2;
    $CURRENT_PIC_DATA['user3'] = $user3;
    $CURRENT_PIC_DATA['user4'] = $user4;
    $CURRENT_PIC_DATA['pic_raw_ip'] = $raw_ip;
    $CURRENT_PIC_DATA['pic_hdr_ip'] = $hdr_ip;
    $CURRENT_PIC_DATA['position'] = $position;
    $CURRENT_PIC_DATA = CPGPluginAPI::filter('add_file_data',$CURRENT_PIC_DATA);

    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
    $result = cpg_db_query($query);

    return $result;
}

Please test it and let me know , I'll Split this post to new thread if it's working ;)
« Last Edit: December 05, 2006, 06:25:29 pm by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG
« Reply #6 on: November 30, 2006, 11:14:58 pm »

Thanks Sami but unfortunately  :'(..it did not work.

Thanks for looking at the puzzle though. If you are willing to tackle this puzzle then i am willing to test it.

Hein
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Open PDF from within CPG
« Reply #7 on: November 30, 2006, 11:36:33 pm »

Would you try it again ;)
just apply section 2 again (theme.php) I've change it a bit
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG
« Reply #8 on: November 30, 2006, 11:48:37 pm »

Getting there Sami.

It does not actually browse yet but it does display this

Code: [Select]
            |
Browse this document (with a arrow on the left and right)

See here: http://fototest.scouting.nl/displayimage.php?album=14&pos=0

This is looking promising  :)

Hein

p.s. not quite yet ;).
Code: [Select]
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in /home/fototest/WWW/plugins/CPGOcat/codebase.php on line 61This came up after editing the files as you suggested.
I rolled back the files so the site works again.
Let me know when you want to try again  ;)
And thanks!
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Open PDF from within CPG
« Reply #9 on: December 01, 2006, 12:00:12 am »

check the path to ghostscript under include/picmgmt.inc.php
Code: [Select]
$cmd = "/usr/bin/ghostscript -sDEVICE=jpeg -dNOPAUSE  -dBATCH -sOutputFile='{$CONFIG['fullpath']}edit/pdftmp.$filename.%d.jpg' '$image'";
also remove var_dump from themes/yourtheme/theme.php
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #10 on: December 01, 2006, 03:07:19 pm »

 :-[ Little woops on my side. The server i wanted to implement this mod on does not (yet) have ghostscript installed. Sysadmins are having a pow-wow now to determine if they want to install it.

When they do i will install this again to see if it works or not. Have not yet gotten time to install it on my test site.

Hein

- Ghost script installed now. But my dear Sysadmin forgot to pass me the path ;)
« Last Edit: December 01, 2006, 04:49:39 pm by Hein »
Logged

Bruce

  • Guest
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #11 on: December 02, 2006, 04:32:59 am »

I tried this on your gallery and had no problem having my default PDF reader opening your documents.

This was using Firefox 1.5.x and Foxit PDF Reader as default.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #12 on: December 04, 2006, 09:55:34 am »

I tried this on your gallery and had no problem having my default PDF reader opening your documents.

This was using Firefox 1.5.x and Foxit PDF Reader as default.

Bruce, read the thread more carefully. This deals with browsing a pdf file from within CPG without the use of pdf readers such as FoxIt PDF Reader.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #13 on: December 05, 2006, 08:16:34 am »

Sami,

got some testing done on my test bed. When i edit the files according to your post it looks good.. until i want to batch add some pdf files.
I then get nothing at first, it does not add the file to a album. When i then click reload it gives a message that it is has a unexpected $ at line 319.
Code: [Select]
Parse error: parse error, unexpected $ in /home/fototest/WWW/include/picmgmt.inc.php on line 319
Done the editing of the files three times now. Same result. Can you see what is going wrong ?

Hein
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #14 on: December 05, 2006, 08:52:34 am »

Sure I'll
Can you attache your picmgmt.inc.php to this thread , please
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #15 on: December 05, 2006, 09:20:03 am »

This mod appears to be a work in progress (as suggested in the subject) and far from being production-ready. It shouldn't have been moved to the mods section, as only actual working mods are suppossed to reside within this sub-board. Mod-discussion is not suppossed to reside in the mods board. I suggest moving this thread back to the support board where it was started initially and start a new thread with the mod instructions once you have fully figured out how the mod works and when it's ready-for-use. The new thread should then be moved to the mods board and contain a link to the previous discussion (this thread) that lead to the creation of the new mod.

Thanks

Joachim
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #16 on: December 05, 2006, 09:56:37 am »

My mistake. Please move as i can't.

Hein
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #17 on: December 05, 2006, 10:16:28 am »

Moved as suggested
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #18 on: December 05, 2006, 01:03:39 pm »

Sure I'll
Can you attache your picmgmt.inc.php to this thread , please


Thanks Sami. File attached.
And sorry for the mixup folks. I had a cold diesel like start that day.

Hein
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Open PDF from within CPG - work in progress - 1.4.10
« Reply #19 on: December 05, 2006, 06:29:15 pm »

Hein Would you check the new add_picture function (section 3)
I should be more careful with } ;D
« Last Edit: December 06, 2006, 06:53:08 am by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board
Pages: [1] 2   Go Up
 

Page created in 0.026 seconds with 20 queries.