favpics.php link for registered and logged in users only. favpics.php link for registered and logged in users only.
 

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

favpics.php link for registered and logged in users only.

Started by avatarlab, July 18, 2004, 07:49:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

avatarlab

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~
visit :: the avatar lab :: for custom made avatars and icons

Casper

Depending on which theme you use, you need to move;
<a href="{FAV_TGT}">{FAV_LNK}</a> ::

into the my gallery section, so it looks like this;
<!-- 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.
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

Quote from: Casper on July 18, 2004, 01:18:14 PMThere 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?

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

Joachim Müller

edit displayimage.php, find    // 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    // 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

bakr

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

Nibbler


bakr

Hi Nibbler,

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

Bakr