forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: avatarlab on July 18, 2004, 07:49:47 am

Title: favpics.php link for registered and logged in users only.
Post by: avatarlab 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~
Title: Re: favpics.php link for registered and logged in users only.
Post by: Casper 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.
Title: Re: favpics.php link for registered and logged in users only.
Post by: avatarlab 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?

 ???
Title: Re: favpics.php link for registered and logged in users only.
Post by: Joachim Müller 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
Title: Re: favpics.php link for registered and logged in users only.
Post by: bakr 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.
Title: Re: favpics.php link for registered and logged in users only.
Post by: Nibbler on November 09, 2004, 12:31:42 pm
Change
Code: [Select]
if (isset($USER)) {
to
Code: [Select]
if (USER_ID){
Title: Re: favpics.php link for registered and logged in users only.
Post by: bakr on November 18, 2004, 11:57:22 pm
Hi Nibbler,

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

Bakr