forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: tjreynolds on April 29, 2004, 07:32:30 pm

Title: Add to Favorites as a "button"
Post by: tjreynolds on April 29, 2004, 07:32:30 pm
First of all thanks for all of the hard work on this wonderful gallery. I love copermine!

http://www.whitneyinteriors.info/Gallery/displayimage.php?album=1&pos=21

How would I add a BUTTON next to an image for "add to favorites" . I do not want to show picture information, so I'd have to have a link near the displayed image.

I found the raw php in displayimage... but now what   ???

Quote
// Create the add to fav link
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['remFav'] . '</a>';
    }

    return theme_html_picinfo($info);
}

Rather have a button for asthetic purposes. Thanks
Title: Re: Add to Favorites as a "button"
Post by: Joachim Müller on April 30, 2004, 07:31:01 am
Then change the code you found to have an image instead of the text link, like this:
Code: [Select]
// Create the add to fav link
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $info[$lang_picinfo['addFavPhrase']] = '<a href=addfav.php?pid="' . $CURRENT_PIC_DATA['pid'] . '" ><img src="path_to_you_button/your_add_to_fav_button.gif" width="100" height="100" alt="" title="'. $lang_picinfo['addFav'] . '" /></a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = '<a href=addfav.php?pid="' . $CURRENT_PIC_DATA['pid'] . '" ><img src="path_to_you_button/your_remove_from_fav_button.gif" width="100" height="100" alt="" title="'. $lang_picinfo['remFav'] . '" /></a>';
    }

    return theme_html_picinfo($info);
}

GauGau
Title: Re: Add to Favorites as a "button"
Post by: tjreynolds on April 30, 2004, 05:36:05 pm
Hi GauGau,

Thanks for the response. I changed the code and that works great,

However, I'd like the link in a more prominent place without displaying the picture information such as just below the image on displayimage.php. Customer doesn't want any pic info on the page...    Does that make sense?

Thanks alot for the help on this.

If you ever need an eCommerce solution I use osCommerce which is built similar and know the in's and out's of that like the back of my hand.

TTYL
TJ.
Title: Re: Add to Favorites as a "button"
Post by: Casper on April 30, 2004, 05:42:39 pm
My suggestion would be to edit displayimage.php, so the only info shown is the button you have created.

See this thread how to do it;
http://forum.coppermine-gallery.net/index.php?topic=3411

Then set your config to show the info.