PDA

View Full Version : Reputation sorter broken (memberlist)?


fury
Fri 20th Jun '03, 3:49pm
When I sort the member list by reputation, it doesn't seem to go in the correct order. The two listed at the top have the lowest reputation, but then it's all out of order. I have the fourth highest but I am listed as the 3rd LOWEST in the member list.

http://www.otcentral.com/forum/memberlist.php?&sortorder=asc&sortfield=reputation&perpage=40&pagenumber=0

delaen
Sat 21st Jun '03, 12:30pm
I get the same thing.

Mike Sullivan
Sun 22nd Jun '03, 9:30pm
Did you change anything since you posted this? Because I'm seeing you as second on that list and in my tests, it appears to be working correctly.

fury
Mon 23rd Jun '03, 2:22pm
No, we've just been getting more reputation hits. I am currently the 5th highest but according to the member list, 2nd lowest.

mysql> select username,reputation from user order by user.reputation desc limit 5;

+------------+------------+
| username | reputation |
+------------+------------+
| greenfreak | 43 |
| PuterTutor | 39 |
| Luis G | 33 |
| Squiggy | 32 |
| fury | 31 |
+------------+------------+
5 rows in set (0.00 sec)


mysql> select username,reputation from user order by user.reputation asc limit 5;
+-----------------+------------+
| username | reputation |
+-----------------+------------+
| Buttcrackdivine | -12 |
| sbcanada | -10 |
| Q | -10 |
| BigDadday | 10 |
| darrensgurl86 | 10 |
+-----------------+------------+
5 rows in set (0.01 sec)

Also, when new users register, do they start out with 0 or 10 reputation? The reason I ask is that I saw a user with a reputation level of "is an unknown quantity at this point" who registered after the conversion, so I figured every member that was converted started out with a level of 10. But if new registrations start out at 0, then why am I not seeing any users with a reputation of 0 in this query?

Freddie Bingham
Mon 23rd Jun '03, 2:37pm
Do you allow users to hide their reputation? If so then their totals will be set to zero when calculating the list. Other than that, the query looks fine to me. Turn on debug and post the query that is being executed on that page to get the users.

fury
Mon 23rd Jun '03, 3:00pm
I do not allow users to hide their reputation.

SELECT user.*,usertextfield.*,userfield.*, user.userid, options,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
,IF((options & 1024), reputation, 0) AS reputationscore, level
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline

FROM user AS user
LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
LEFT JOIN userfield AS userfield ON(userfield.userid=user.userid)
LEFT JOIN reputationlevel AS reputationlevel ON(user.reputationlevelid=reputationlevel.reputati onlevelid)
LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)
WHERE 1=1
AND user.usergroupid IN (0,6,13,18,17,14,7,5,2,16,11)
ORDER BY reputationscore desc
LIMIT 0, 40

Mike Sullivan
Thu 26th Jun '03, 1:54am
Out of curiousity, what do the 2 following queries return:
SELECT user.username, IF((options & 1024), 1, 0) AS showrep, reputation
FROM user AS user
WHERE 1=1
AND user.usergroupid IN (0,6,13,18,17,14,7,5,2,16,11)
ORDER BY reputation desc
LIMIT 10 SELECT user.username, IF((options & 1024), 1, 0) AS showrep, reputation
FROM user AS user
WHERE 1=1
AND user.usergroupid IN (0,6,13,18,17,14,7,5,2,16,11)
ORDER BY reputation asc
LIMIT 10
BTW, I did find some other (unrelated) reputation bugs while I was looking at this one.