coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1d PHPnuke Support (deprecated) => Topic started by: bartbh on November 10, 2003, 07:28:47 PM

Title: [FEATURE REQUEST] External pictures
Post by: bartbh on November 10, 2003, 07:28:47 PM
Is it possible to include external pictures in Coppermine 1.1D for PHPnuke?
The pictures have the right sizes and names (thumb_ & normal_ ).

example
* the site with phpnuke is on phpnuke.org
* the pictures are on pictures.org

Or is it possible to change something in one of the files of database?
Title: [FEATURE REQUEST] External pictures
Post by: DJMaze on November 10, 2003, 08:54:02 PM
Try this maybe it works:
if you edit the cpg_pictures table in the database yourself.

In the filepath place the URL
In the filename place the image

and insert the rest of the info
Title: [FEATURE REQUEST] External pictures
Post by: bartbh on November 10, 2003, 10:22:01 PM
I've tried, but I get a red cross instead of a picture.
Maybe it's an new feature for a new version? External pictures?
Title: [FEATURE REQUEST] External pictures
Post by: DJMaze on November 10, 2003, 11:05:58 PM
Ok we take this as feature request
Title: [FEATURE REQUEST] External pictures
Post by: gtroll on November 10, 2003, 11:18:27 PM
[edit I thought you were talking about vers. 1.2 (missed the topic name) so this code from functions.inc.php may or may not work for you]

This I think is a feature in the standalone that was not included in coppermine for nuke because of inconsistancies. If all your gallery images are hosted on the same other server you could try editing line 1106  
// Return the url for a picture, allows to have pictures spreaded over multiple servers
function get_pic_url(&$pic_row, $mode)
{
        global $CONFIG;
        static $pic_prefix = array();
        static $url_prefix = array();
        if (!count($pic_prefix)) {
                $pic_prefix = array(
                        'thumb' => $CONFIG['thumb_pfx'],
                        'normal' => $CONFIG['normal_pfx'],
                        'fullsize' => ''
                );
                $url_prefix = array(
                        0 => $CONFIG['fullpath'],
                );
        }
        return path2url('http://otherdomain.tld/'.$pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);//line 1106
}

This has not been tested but try it...
Title: [FEATURE REQUEST] External pictures
Post by: bartbh on November 14, 2003, 09:52:03 PM
I've made a change in functions.inc.php.
If you change the 'filepath' in cpg_pictures
and make a absolut filepath to pictures on an other site.
Example

filepath:
(1) modules/modules/coppermine/albums/userpics/
(2) file://c:/windows/desktop/fotos/

filename:
(1) test.jpg
(2) othersite.jpg

On this way you can also keep pictures on your 'own' site

Remark! The pictures on external host must have the right prefix
(thumb & normal)

if you have questions mail me

bartbh at hotmail dot com

functions.inc.php

function get_pic_url(&$pic_row, $mode)
{
        global $CONFIG;

        static $pic_prefix = array();
        static $url_prefix = array();

        if (!count($pic_prefix)) {
                $pic_prefix = array(
                        'thumb' => $CONFIG['thumb_pfx'],
                        'normal' => $CONFIG['normal_pfx'],
                        'fullsize' => ''
                );

                $url_prefix = array(
                        0 => $CONFIG['fullpath'],
                );
        }
//        return path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']); //orginal code
        return ($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);
}
?>