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: display favorites on profile  (Read 5394 times)

0 Members and 1 Guest are viewing this topic.

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
display favorites on profile
« on: January 26, 2007, 02:50:02 pm »

Is it possible to display the user' s favorites on his profile?

I want other users to be able to browse the favorite photos of a user. Maybe it should be displayed the same way like last updated and last commented pictures are displayed, meaning show only the last picture and a link which points to the rest.

It looks like favorite pictures are stored in the database but also in the cookie on the users computer. I think you need to disable storing favorites in the cookie first to accomplish this. I wanted to add some code to the last comments and last uploads code in profile.php, but I noticed that the favpics table does not have a pid column. So, it won' t work.

Can anyone please help me on this?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: display favorites on profile
« Reply #1 on: January 26, 2007, 03:31:42 pm »

in include/init.inc.php you'll see how to get an array with a users favpics out of the db after
Code: [Select]
// If the person is logged in get favs from DB those in the DB have precedence
(the pid is in the array)
however in my opinion displaying a users favs is a no go. I wouldn't love being outed as a pervert (without knowing it).

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: display favorites on profile
« Reply #2 on: January 26, 2007, 05:55:14 pm »

in include/init.inc.php you'll see how to get an array with a users favpics out of the db after
Code: [Select]
// If the person is logged in get favs from DB those in the DB have precedence(the pid is in the array)
Thank you. I found the code. It is as follows:
Code: [Select]
if (USER_ID > 0){
        $sql = "SELECT user_favpics FROM {$CONFIG['TABLE_FAVPICS']} WHERE user_id = ".USER_ID;
        $results = cpg_db_query($sql);
        $row = mysql_fetch_array($results);
        if (!empty($row['user_favpics'])){
                $FAVPICS = @unserialize(@base64_decode($row['user_favpics']));
        }else{
                $FAVPICS = array();
        }
}
But I don' t know how to retrieve the favorite pictures. I only know that includes/init.inc.php is already called in profile.php, so I do not need to put the code into the profile.php file again, right? Still I am totally lost. The latest comments/uploads code is much easier to understand for me. Can you please provide some more assistence?

Quote
however in my opinion displaying a users favs is a no go. I wouldn't love being outed as a pervert (without knowing it).

We do not allow users to have a personal gallery in coppermine and they are also not allowed to upload pictures into the public albums. We only have pictures of our users or of interesting objects, which we have take ourself or have checked, no xxx content. The favorite picture album will be a sort of personal gallery of the user.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: display favorites on profile
« Reply #3 on: January 26, 2007, 06:36:03 pm »

Quote
We only have pictures of our users or of interesting objects, which we have take ourself or have checked, no xxx content. The favorite picture album will be a sort of personal gallery of the user.

sorry, but in my opinion that's an utterly bollux argumentation. If you publish what someone likes (favs) and he's not aware of that, then you're volating his privacy rights. Has nothing to do with xxx or user galleries. With seeing ones favs I can tell you a lot about this person.

Quote
I only know that includes/init.inc.php is already called in profile.php, so I do not need to put the code into the profile.php file again, right?

wrong, this only calls the favs of the actual person viewing the gallery, not the favs of the person's profile you're watching. This code can't be used 1:1 in profile.php. It just shows the way how to get the favs. I won't give you a copy/ paste solution cause I do not like what you're up tp. But you're able to do it on your own with this hint.

Again, your surfers may not like what you're doing and probably won't visit your gallery again after seeing what you do. At least I would ;)

 

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: display favorites on profile
« Reply #4 on: January 26, 2007, 09:12:23 pm »

I am very sorry, you see my intention so negatively. But I think you misunderstood my request. I am not trying to put this up secretely. The user will be aware that the favorite pictures can be seen by anyone. We also have a personal profile gallery (a phpbb mod). It is displayed right on the person' s profile and our users know it. They like to look into each other' s galleries to check for updates.

Your arguments made me wonder about this feature and revealed a problem, I have not taken care of. It is the fact, that some users already have favorite pics in their gallery. Putting up this feature would reveal those. Therefore we need to contact them and telling them to save those pictures, because they will be deleted before adding this feature.

I was always thinking that it should be obvious to our members, that their profile gallery can be viewed by every registered member. And because most of our members like to present themself in their gallery, I believe I am right on this one. This made me think the same of the favorite pictures gallery. I was wrong about that one, but I think by telling our members that this feature will be introduced and by adding explainatory text to this feature, everything should be clear again.

I came across this feature, because another community in my town has this feature, too. The community has been around much longer than our homepage. They only allow adding public gallery pictures to the users' public personal galleries. Their users are not able to upload pictures. On our community it is the opposite around. Users are able to upload pictures, but not able to present their favorite pictures of the public gallery to other users. Therefore they often save public photos to their computer and uploaded them to their profile gallery. The new feature should make things easier for them.

I hope that you can understand me a little bit better now. I do not intend to violate our user' s privacy. Thanks for giving me some hints although you do not like what I am trying to do.
Logged

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Re: display favorites on profile
« Reply #5 on: September 20, 2007, 05:10:00 pm »

Did you ever get this up and running? I need a similar feature and wondered if you could help  ???

As the idea of our site is that of a community the voting and more so the favorites form a part of that.

I must say I was surprised at all the negativity to this edit. I've seen similar things on countless other sites, it being viewed as showing your appreciation of someones work rather than anything sinister?
Logged

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Re: display favorites on profile
« Reply #6 on: October 22, 2007, 12:21:15 pm »

I guess not?  ???

Shame as it would be a usefull feature.
Logged

Brane29

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: display favorites on profile
« Reply #7 on: October 22, 2007, 12:57:14 pm »

Yes, fav pics are needed in my site to. Reason is that i have Photo club site and fav pics are users selection of pictures that they like and no reason not showin' pictures in users profile.
I'm traying to code a mod that will display pictures by number of favs descending so that guests can see most favorite pictures. But, my php and mysql is not so good.
I would be greatfull if someone can help solving fav pics on profile at least...tried that but no succsses. Thank you!

If i come up with something, i will share it.
Logged

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Re: display favorites on profile
« Reply #8 on: October 23, 2007, 05:33:12 pm »

Thanks for the reply Brane. Glad to know its not just me stuck.  :)
Logged

dke

  • Guest
Re: display favorites on profile
« Reply #9 on: February 05, 2008, 10:20:40 pm »

I would also like to know how to do this. I don't think its invading anyones privacy if you mention this in your FAQ and in the registration message.

Could someone please hook us up?
Logged

ravendark

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: display favorites on profile
« Reply #10 on: May 06, 2008, 12:26:51 pm »

Hello,
Please help , I need to show every user's Favorite Images on Profile page for our digital art community.
I really don't know how to output data stored in a cookie.
Thank you for your support,
Ravendark
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: display favorites on profile
« Reply #11 on: May 06, 2008, 06:38:22 pm »

You can't: the cookies are stored on the user's PC. Coppermine simply doesn't have that feature. End of story. You need that feature -> you code it.
Logged

Nibbler

  • Guest
Re: display favorites on profile
« Reply #12 on: May 06, 2008, 06:48:05 pm »

That used to be the case in 1.3, but favourites are in the db for registered users since 1.4.
Logged

ravendark

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: display favorites on profile
« Reply #13 on: May 06, 2008, 11:11:57 pm »

i see ...it's a dead end.
thank you anyway
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.