Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
928 views
in Q2A Core by
How do you hide certain users from the public users list? I'd like to hide admins & moderators whose sole purpose is to admin/moderate as opposed to participating for points, etc. Thought it might be a safeguard against unwanted messages/abuse to admins/moderators. Thanks!
Q2A version: 1.5
by
How about this in version 1.7?

3 Answers

+1 vote
by

You could do this via an advanced theme which overrides the ranking(...) function, if $this->template=='users' and removes those particular users from the list before calling through to the default ranking(...) function.

by
I dont get it....please explain a bit more....I want to hide the admin's username from the public user list....hows it possible....??? Which files needs to be changed?
+1 vote
by
Hi Experts

is there any update?
+1 vote
by

How mentioned by the author above, the users list is managed by the function ranking() that you can find in the file qa-theme-base.php inside the directory qa-include (on line 1310 in version 1.7.5). 

You can hide the admin simply jumping its item in the loop foreach ($ranking['items'] as $item) which is in the else clause on line 1324, by adding the following line:

if ($item['raw']['handle'] == 'admin-username') continue;

where "admin-username" is the username you assigned to the super-admin. Please note that:

  1. this will just exclude the nickname from the public list of users, but the admin dashboard (where it is written it is the super-admin) will still be visible, so other users and visitors should not know this username. This mean that you should use it only for admin purposes and not to answer to users' questions, which makes sense: better not to use the root account for normal usage of the system.
  2. Before to make any change directly on a source file, always make a backup copy (i.e adding BAK to the file name) so you can restore the original version in case of any mistake.

...