coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: David9 on September 26, 2006, 02:24:20 PM

Title: Remove "My favorites" button when it's a visitor
Post by: David9 on September 26, 2006, 02:24:20 PM
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!  :'(
Title: Re: Remove "My favorites" button when it's a visitor
Post by: 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?

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


Title: Re: Remove "My favorites" button when it's a visitor
Post by: David9 on September 26, 2006, 04:58:54 PM
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.
Title: Re: Remove "My favorites" button when it's a visitor
Post by: François Keller on September 26, 2006, 05:18:36 PM
Hi,

You can use the final_extract plugin to do this.
http://forum.coppermine-gallery.net/index.php?topic=36605.0 (http://forum.coppermine-gallery.net/index.php?topic=36605.0)
Title: Re: Remove "My favorites" button when it's a visitor
Post by: David9 on September 26, 2006, 06:57:44 PM
Quote from: Frantz on September 26, 2006, 05:18:36 PM
Hi,

You can use the final_extract plugin to do this.
http://forum.coppermine-gallery.net/index.php?topic=36605.0 (http://forum.coppermine-gallery.net/index.php?topic=36605.0)
Sorry, it do not work... That's ok. Thanks both!
Title: Re: Remove "My favorites" button when it's a visitor
Post by: lamama on September 28, 2006, 12:01:09 AM
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.

Title: Re: Remove "My favorites" button when it's a visitor
Post by: François Keller on September 28, 2006, 07:43:56 AM
Quote from: David9 on September 26, 2006, 06:57:44 PM
Sorry, it do not work... That's ok. Thanks both!

What do not work ?