UBB.Dev
Posted By: willing Allowing members to turn off their ratings - 05/06/2007 4:34 AM
I really need some help.
We have recently moved from classic to threads and generally really like it.

1 thing is causing a bit of a problem though..... a small number of our long-time members really really do not like other members being able to rate them, and for those ratings to be public. I am not questioning whether I agree with their dislike, but I do know that we really do want to be able to allow our members to turn their ratings off (ie. for them not to be displayed in public).

Whether other members can rate them is not the big issue here, and while it would be good to turn that off as well, the main thing is for any individual member to be able to set it so that their rating is now shown in public.

Even a simple modification that lets us (admin) specify a user member in the code so that it does not appear for that member would be fine.

Can anyone help?

Thank you
Posted By: Rick Re: Allowing members to turn off their ratings - 05/08/2007 5:06 AM
To turn off the ability to rate a member you can edit the showprofile.inc.php script. Line 174 you'll see this:

if ($config['USER_RATINGS'] == "1") {

Just change that to:

if (($config['USER_RATINGS'] == "1") && ($UNumber != '###')) {

Change, ### to the actual userid of the user in question.

To disable the display on the posts, it would probably be easiest to just clear out their current rating in the database.

UPDATE ubbt_USER_PROFILE set USER_RATING='0' where USER_ID='###'

Again, just change ### to the userid in question.
Rick, thank you so much I really appreciate it.

Thank you.
smile
Sorry just another question on this. If I wanted to do this for more than 1 member, how would the code be modified to? Appreciate the help.
i'd use one of the custom fields, which then allows the user to turn that on/off by him/herself. then turn on this field in user settings via your admin cpanel and name it 'AllowRated' (or like that).

then just change the if to NOT be by user number, but by the custom field value. ie: 0,1 or null/whatever (prolly)

this would then allow any number of users to essentially allow the in place ratings to be applied as they permit.

the test would be then if (($config['USER_RATINGS'] == "1") && (!$user['custom_fieldx'])) { no rates } else { do rate }; <-- totally pseudo code there, so don't kill me laugh

ps: i'm doing this at WORK (shhhh don't tell anyone), so it's from memory, but if i get home and you don't have a solution, i will at least copy/paste the exact code and/or steps (that i might use) here to accomplish this .

pps: you could even go further as to allow a tri-state condition where users are of 3 minds:

0 - No rates never! (head in the sand)
1 - No one else sees my rating, but me (curious)
2 - Rate me hard baby (let 'er rip)

then to make it idiot proof in the profiles, replace the text field with a 3 state radio button (defaulted to most common) where users choose 0, 1 or 2 (with languages descriptors, of course)

wink

[humor mode on]

ppps: hehe, i just had a thought. the options could be expanded to:

0 - Nobody can see my rating and I don't wanna look (scared)
1 - Peeps can see my rating! But i wanna put a fake 5 in there (vain)
2 - Peeps can see my rating! But i wanna put a fake 0 in there (anti establishment)
3 - Peeps can see my rating! But i wanna put a fake 3 in there (lurker)
4 - Peeps can rate me, but not see! But i wanna peek (curious)
5 - Rate me hard baby! (muhaha)

[/humor] laugh
Posted By: Gizmo Re: Allowing members to turn off their ratings - 05/09/2007 1:00 AM
Since I can't test it right now, it should be one of these (I'm kind of out of it, not feeling well again)

Code
if (($config['USER_RATINGS'] == "1") && (($UNumber != '###') || ($UNumber != '###'))) {

or

Code
if (($config['USER_RATINGS'] == "1") && ($UNumber != '###' || $UNumber != '###')) {
© UBB.Developers