CPG & WordPress Bridging - displaying cpg images in WP CPG & WordPress Bridging - displaying cpg images in WP
 

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

CPG & WordPress Bridging - displaying cpg images in WP

Started by seanyore, February 13, 2007, 01:12:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

seanyore

Hi there -
The good news:
it works! you can display images from your cpg database for posts in your WP blogs, using the WP plugin, "coppermineSC". Check out

Sample site is "art.dontknowpub.com".
versions:
cpg: 1.4.10
wp: 2.1
CPGSC 0.4.5     url: http://www.rueplumet.com/plugins/copperminesc/

the plugin uses the CPG "displayimage.php" .
it works as specified.
OK, now for the "bad news":

When a user clicks on an image, the link for the image is something like:
www.foo.com/coppermine/displayimage.php?pos=-208
which refers to the image in the database (pos in this case is the permalink to the image in your cpg database).
for example, you could go to:
http://art.dontknowpub.com/blog/
and click on the post: cpg-test (post #15).
Here is the "problem" ( it could be a "feature" for others): if the user clicks on the image displayed, the browser launches coppermine and displays that image and its neighboring images from the album it belongs to (if your coppermine allows non-registered users to view the images - I have configured my cpg to be viewed only by registered users). I would prefer that displayimage simply supplies the image into the post and NO link.

I guess this might be a feature request to have displayimage either return a link with the image or not, if that is technically possible. I think the following code could be expanded:
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    $redirect = $redirect . "login.php";
    header("Location: $redirect");
    exit();
}

to:
define('NO_LOGIN', true);

if (!USER_ID &&!NO_LOGIN !&& $CONFIG['allow_unlogged_access'] == 0) {
    $redirect = $redirect . "login.php";
    header("Location: $redirect");}
} else {
     $redirect = $redirect . "???.php";
    header("Location: $redirect");}
   
    exit();
}

???.php would be some function that returns a 404 type error or a message.

BTW: here is how coppermineSC calls displayimage:

if (CPGSC_SINGLEIMAGE_LINK == 'normalimage') {
         $res .= '<a href="'.$config[0].$separatorslash.'displayimage.php?pos=-'.$image->pid.'" ......</a>';

$config[0].$separatorslash is made in to the url such as "www.foo.com/"  and $image->pid. is made into the cpg database name and the permalink in it.

Thanks for your time, try it you'll like it!

seanyore

Hi again -
After some thought, I suggest a variation. It would be to send displayimage a url to redirect to (such as an image link, another posting, a 404, etc.).  ???
anyway, I'll look into it.
I suppose that this is an extravagent request so I may as likely roll my own "myDisplayImage.php" to do the job. -s