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: Add to Favorites as a "button"  (Read 4216 times)

0 Members and 1 Guest are viewing this topic.

tjreynolds

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Add to Favorites as a "button"
« 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
« Last Edit: April 29, 2004, 08:07:00 pm by tjreynolds »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add to Favorites as a "button"
« Reply #1 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
Logged

tjreynolds

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Add to Favorites as a "button"
« Reply #2 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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Add to Favorites as a "button"
« Reply #3 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.