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

Author Topic: [FEATURE REQUEST] External pictures  (Read 6214 times)

0 Members and 1 Guest are viewing this topic.

bartbh

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
[FEATURE REQUEST] External pictures
« 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?
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
[FEATURE REQUEST] External pictures
« Reply #1 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
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
[FEATURE REQUEST] External pictures
« Reply #2 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?
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
[FEATURE REQUEST] External pictures
« Reply #3 on: November 10, 2003, 11:05:58 pm »

Ok we take this as feature request
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
[FEATURE REQUEST] External pictures
« Reply #4 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  
Code: [Select]

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
[FEATURE REQUEST] External pictures
« Reply #5 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
Code: [Select]

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']);
}
?>
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 14 queries.