Remove "My favorites" button when it's a visitor Remove "My favorites" button when it's a visitor
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Remove "My favorites" button when it's a visitor

Started by David9, September 26, 2006, 02:24:20 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

David9

Hi,

I have seen that if you are not logged you can pick your favorite photos. Then, someone else can pick others too and then when they click in the "My favorites" are there all the photos picked up.

It's not supposed that "My favorites" don't be available to not loggin users? How can i do that?

Sorry my english!  :'(

lamama

Usually I don't work with My Favourites at all, so I can't say what's normal behaviour or not.

Could you post a link to your gallery?

QuoteSorry my english!
No problem. You know there are support forums in other languages too?
Look here: http://forum.coppermine-gallery.net/index.php?board=37.0



David9

Quote from: lamama on September 26, 2006, 03:08:18 PM
Usually I don't work with My Favourites at all, so I can't say what's normal behaviour or not.

Could you post a link to your gallery?

I send you a PM with the link.

Thanks. but my language is not available.

François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

David9


lamama

Please note: "My Favourites" does AFAIK nothing on your server/webspace/database. The selected pics are stored in the a cookie inside the users browser, not inside the database. It's like a user (logged in or not) has 'bookmarked' some of your pics that are visible to him anyway. So this feature is mostly harmless, there is no risk when unlogged users can use it.

"ZIP-Download of favourites" is an optional function and can be switched off completly (Admin -> Settings).

If you want to disable "My Favourites" for all users, you maybe want remove the menu button:

If the final_extract plugin does not work: do it manually.

Your theme is 'Hardwired', right?
Open the template.php of that theme.

Search for:
<a href="{FAV_TGT}" title="{FAV_LNK}">{FAV_LNK}</a>

Remove the whole table element or comment it out like this::

<!-- <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
               <a href="{FAV_TGT}" title="{FAV_LNK}">{FAV_LNK}</a>
</td> -->



If you want to keep the "Favourites" function, but just for logged in users, I would suggest to keep the Menu Button as it is and just modify the "Add to favourites"-Link in the midsize-pic view:

Open displayimage.php
Search for (around line 174):


    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . $ref . "\" >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid']  . $ref . "\" >" . $lang_picinfo['remFav'] . '</a>';
    }


and wrap it inside another if-condition:

   if (USER_ID) {
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . $ref . "\" >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid']  . $ref . "\" >" . $lang_picinfo['remFav'] . '</a>';
    }
   }


This hides the "add to fav"-link for guests.


François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog