News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

[FEATURE REQUEST] External pictures

Started by bartbh, November 10, 2003, 07:28:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bartbh

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?

DJMaze

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
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

bartbh

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?

DJMaze

There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

gtroll

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

bartbh

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']);
}
?>