forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: psundstrom on June 11, 2004, 12:13:37 pm

Title: [Solved]: Changing the ecard link
Post by: psundstrom on June 11, 2004, 12:13:37 pm
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.
Title: Re: Changing the ecard link
Post by: Joachim Müller on June 14, 2004, 12:06:50 am
do not mess around in displayimage.php - instead, edit themes/yourtheme/theme.php and change the ecard link there.

GauGau
Title: Re: Changing the ecard link
Post by: psundstrom on June 14, 2004, 09:40:44 am
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.


Title: Re: Changing the ecard link
Post by: psundstrom on June 18, 2004, 11:30:03 pm
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
Title: Re: Changing the ecard link
Post by: Joachim Müller on June 20, 2004, 03:48:04 pm
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
Code: [Select]
$ecard_tgt = "ecard.php?album=$album$cat_link&amp;pid=$pid&amp;pos=$pos";to
Code: [Select]
$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
Title: Re: Changing the ecard link
Post by: psundstrom on June 26, 2004, 10:26:56 pm
That did the trick.

Thank you very much GauGau.   :D