Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 01:09 pm EST

Geeklog Forums

Help troubleshooting Userlist hack by Dirk


Status: offline

jordydme

Forum User
Full Member
Registered: 11/03/05
Posts: 135
Hi,

I would like to troubleshoot a problem I ahve been having for some time and I am not sure how to go about it.

I am using Dirk's Userlist hack. Every so often a member who registers does not show up on the userlist but they do show up on the ACP user list. I was inspecting the database and this is what I found. There are currently two users whose id numbers appear to be out of sequence.


INSERT INTO `gl_users` VALUES (1,'ralphy'
INSERT INTO `gl_users` VALUES (2,'ricky'
INSERT INTO `gl_users` VALUES (151,'Corey'



INSERT INTO `gl_users` VALUES (173,'sasny',
INSERT INTO `gl_users` VALUES (174,'Alisaha2',
INSERT INTO `gl_users` VALUES (175,'evansuz2'
INSERT INTO `gl_users` VALUES (176,'Dingleberies','
INSERT INTO `gl_users` VALUES (192,'sylvia','Sylvia



If you notice the one marked "INSERT INTO `gl_users` VALUES (151,'Corey'" and the one below marked, "INSERT INTO `gl_users` VALUES (192,'sylvia','Sylvia" are both out of sequence. I was wondering why this happens occasionally and how or just how I can repair it if I cna't figure out the cause. Do i just cut and paste the lines in the order they should logically appear and then restore the editied database.

Any help woudl be appreciated,
Jordy
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
(I had to dig this code out from somewhere - I'm not using it myself anymore)

The problem is simply that the userlist isn't sorted at all. MySQL will fill in empty slots in a table that occur when you delete entries. In other words: When you delete user #42, then that slot will be re-used for the next user that's created and you may end up with an order like #41, #321, #43, etc.

You can either sort the gl_users table in phpMyAdmin (won't affect Geeklog, as it's addressing everything via the uid) or you can add an ORDER clause in the userlist script.

There are two SELECT statements in that script that both end with "LIMIT $offset,$limit". Before that LIMIT, add "ORDER BY uid" or "ORDER BY usernam" or whatever you prefer.

HTH

bye, Dirk
 Quote

Status: offline

jordydme

Forum User
Full Member
Registered: 11/03/05
Posts: 135
Dirk,

Thanks, that did the trick.

Question:
If I wanted to sort the users by by graduating year, how would I do start this process.

Right now I am using a custom registration that asks for the graduation date upon registering. I usually manually add that to the full name so my userlist currently looks like this:

User name Full Name
Joeyeezzz Joe Shmo 90 SendMail
figsttr John Smith 87 SendMail
googey Rachel Bent 91


What if I wanted to order these full names so that they were ordered by class year. All of the 90's would be in -line and all of the 87's would be together, etc. Is this too involved for a novice?

Thanks,
Jordy
 Quote

All times are EST. The time is now 01:09 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content