[Solved]: Changing the ecard link [Solved]: Changing the ecard link
 

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

[Solved]: Changing the ecard link

Started by psundstrom, June 11, 2004, 12:13:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

psundstrom

I want to change the link to ecard.php to call my own ecard script.

I've edited displayimage.php and changed:

$ecard_tgt = "ecard.php?album=$album$cat_link&pid=$pid&pos=$pos";

to

$ecard_tgt = "/cgi-bin/postcard.cgi?image=$picname";

I've tried all sorts of other variables apart from $picname, but the value is always blank.  I just need to have a variable that has the image URL.

Joachim Müller

do not mess around in displayimage.php - instead, edit themes/yourtheme/theme.php and change the ecard link there.

GauGau

psundstrom

Thanks for the info GauGau.

However, I can't get it to recognise the image URL.

I edited theme.php and changed the email link to be:

<a href="/cgi-bin/postcard.cgi?image={PIC_URL}" title="{ECARD_TITLE}"><img src="themes/hardwired/images/ecard.gif" width="21" height="15" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>

But the {PIC_URL} doesn't get expanded and the postcard.cgi script sees the parameter as a literal {PIC_URL}.  Seeing as {PIC_URL} is used to display the image, I don't understand why the above doesn't work.



psundstrom

Unfortunately my PHP knowledge is very limited, so if I can just find out how to define a variable that holds the image URL, then I'll be set.   :D

Joachim Müller

using {PIC_URL} in this context is just whishfull thinking, won't work this way. Go back to the original link (<a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>). In fact I was wrong in my first post, you should edit displayimage.php. Change$ecard_tgt = "ecard.php?album=$album$cat_link&amp;pid=$pid&amp;pos=$pos";to$picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
$ecard_tgt = "/cgi-bin/postcard.cgi?image=$picture_url";
instead (not tested though).

Please report back

GauGau

psundstrom

That did the trick.

Thank you very much GauGau.   :D