Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Plugins by
closed by

I have a question about Plugin
Is there a plugin that colors the nicknames ? For example, as the topic speaks admin , his nickname is underlined in red.
Sorry for my English
I look forward to your prompt reply

Q2A version: 1.7.3
closed with the note: .

1 Answer

+2 votes
selected by
Best answer

I don't know of any existing plugin, but this should be possible in a custom theme, or a layer plugin.

Override a function such as post_meta_who, then check the user type against the constants from qa-include/app/users.php, and change the colour accordingly.

See http://docs.question2answer.org for more details on writing plugins.

Here's an example overriding the post_meta_who function:

public function post_meta_who($post, $class)
    $class = '';

    switch ($post['raw']['level']) {
        case QA_USER_LEVEL_SUPER:
        case QA_USER_LEVEL_ADMIN:
            $class = 'usertype-admin';

    $post['who']['data'] = '<span class="' . $class . '">' . $post['who']['data'] . '</span>';
    parent::post_meta_who($post, $class);

You'll need to expand the different cases in the switch for each user type (see the constants defined at the top of qa-include/app/users.php).

It does not work :(
Where do I paste?
What exactly doesn't work?

The code needs to go either in a custom layer plugin, or a custom theme. For a theme it goes in the file qa-theme.php, inside the class.
Do not work for me coloring that is a class defined by me, but this class " message " A style tag