Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
632 views
in Q2A Core by

How would I display user type next to username if it is anything other than 'Registered User' ie Expert, Admin, etc.?

For example:

answered 5 hours ago by gidgreen 10K! (76,400 points)

would read (with display points disabled):

answered 5 hours ago by gidgreen Super Administrator

1 Answer

+3 votes
by
 
Best answer

You can do this via an advanced theme, but it needs a little change to the core code first, in order to retrieve the user's type (or 'level') from the database.

In qa_db_posts_basic_selectspec(...) in qa-db-selects.php, add:

$selectspec['columns'][]='^users.level';

... after ...

$selectspec['columns']['flags']='^users.flags';

Then you want to override function post_meta_who(...) in your advanced theme. You can access the user's level from $post['raw']['level'] within that function, and compare that value against the QA_USER_LEVEL_* constants defined at the top of qa-app-users.php.

...