Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
615 views
in Q2A Core by
I dont want the admin to be listed in the top usrs list. Is there anyway to hide him from the list?

For eg : in http://www.question2answer.org/qa/users Gidgreens is listed, how to remove his name?

1 Answer

+2 votes
by
selected by
 
Best answer

you could modify in qa-include/qa-db-selects.php file the line 1269

from :

'source' => '^users JOIN (SELECT userid FROM ^userpoints ORDER BY points DESC LIMIT #,#) y ON ^users.userid=y.userid JOIN ^userpoints ON ^users.userid=^userpoints.userid',

to :

'source' => '^users JOIN (SELECT userid FROM ^userpoints ORDER BY points DESC LIMIT #,#) y ON ^users.userid=y.userid JOIN ^userpoints ON ^users.userid=^userpoints.userid WHERE ^users.handle not in ("admin","admin2")',

where  admin, admin2, etc...  are the usernames you want to exclude.

Or, if you prefer to use id :

WHERE ^users.userid not in (1,2)

where 1,2 are the id of the users you want to exclude.

 

ps

consider that it would be a good practice to write a plugin instead of modifying the core, but I'm not able to do it yet smiley

...