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: favpics.php link for registered and logged in users only.  (Read 4644 times)

0 Members and 1 Guest are viewing this topic.

avatarlab

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 9
    • :: the avatar lab ::
favpics.php link for registered and logged in users only.
« on: July 18, 2004, 07:49:47 am »

I have searched, but couldn't find a solution.

I suspect it is a bit more complicated than just changing template.html links.
Is it possible to have only logged-in users able to 'add to favorites' and to download the ZIP files.
I know I can add the 'faves' link to the logged-in users administration menu, but I would prefer to make it only appear in the main menu (as does the *my gallery* link) when users are logged in.

Also, this would require disabling the 'add to favorites' link in the image info section below the images (or displaying an error-logged in users only page). It would seem pointless to leave it in there. Where do I start...or am I just being overly fussy?


Hoping for some help.
Fey~
« Last Edit: November 19, 2004, 09:28:31 am by GauGau »
Logged
visit :: the avatar lab :: for custom made avatars and icons

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: favpics.php link for registered and logged in users only.
« Reply #1 on: July 18, 2004, 01:18:14 pm »

Depending on which theme you use, you need to move;
Code: [Select]
<a href="{FAV_TGT}">{FAV_LNK}</a> ::
into the my gallery section, so it looks like this;
Code: [Select]
<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> ::
<a href="{FAV_TGT}">{FAV_LNK}</a> ::
<!-- END my_gallery -->

Default theme shown here.

There is no need to remove the 'add to favourites' link for unlogged users, as they cannot see or download them now anyway.
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

avatarlab

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 9
    • :: the avatar lab ::
Re: favpics.php link for registered and logged in users only.
« Reply #2 on: July 19, 2004, 03:17:26 am »

There is no need to remove the 'add to favourites' link for unlogged users, as they cannot see or download them now anyway.
Oh...yes they can.
Any gallery I have visited (that have faves option working) allows me, as a visitor to add pics to faves and download them, I haven't come across a site yet that didn't allow this to work.

I don't want visitors to be able to download .zip files.
Moving the 'faves' link from the main menu and putting it into my_gallery tags helped put an end to that.  :D

Thanks for helping me with the links...but is there any way to disable the 'add to faves' link in the 'image info' section so that only logged in users may see it?

 ???
Logged
visit :: the avatar lab :: for custom made avatars and icons

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: favpics.php link for registered and logged in users only.
« Reply #3 on: July 19, 2004, 07:47:40 am »

edit displayimage.php, find
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'] . " >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['remFav'] . '</a>';
    }
and replace it with
Code: [Select]
    // Create the add to fav link
    if (isset($USER)) {
    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>';
    }
    }
(not tested though).

GauGau
Logged

bakr

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: favpics.php link for registered and logged in users only.
« Reply #4 on: November 09, 2004, 06:56:32 am »

i tested your script above but the "add to favorite" disappeared not only for unregistered but also for registered users.
Logged

Nibbler

  • Guest
Re: favpics.php link for registered and logged in users only.
« Reply #5 on: November 09, 2004, 12:31:42 pm »

Change
Code: [Select]
if (isset($USER)) {
to
Code: [Select]
if (USER_ID){
Logged

bakr

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: favpics.php link for registered and logged in users only.
« Reply #6 on: November 18, 2004, 11:57:22 pm »

Hi Nibbler,

Your suggestion worked perfectly. Thanks for the ingeniuty. Much appreciated.

Bakr
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.