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

How can I remove the ability of regular users to pick/choose a Best Answer, and make this feature available for site manager only?

Q2A version: 1.8.1
by
+1
What if the asker doesn't feel the manager's choice correct?
by
im just going to ouse it to carry the important answers i threw myself to the top.

3 Answers

+3 votes
by
selected by
 
Best answer

I haven't tested this, but it should work.
If you're using SnowFlat theme, open the file  qa-theme.php  . On line 532 , swap the code from this:

$this->a_selection($a_item);

To this

if (qa_get_logged_in_level() > QA_USER_LEVEL_MODERATOR) {
    $this->a_selection($a_item);
}

Save it and re-upload it to the server.
This will hide the selection button for users whose level is inferior than Moderators.

by
I am not using the snowflat theme, but I found the line. What condition should I add here?
bkz: http://prnt.sc/resrdc
by
if (all conditions) { outputs}
by
You should look for where this function is being called. Not the function itself.
It's easier and cleaner if you wrap the hook, instead of wrapping all that code.

If you're using Notepad++ to edit your code, Press Ctrl+F to open Text Finder
Paste the following code:

    $this->a_selection($a_item);

Hit find this parameter button and make the changes
by
Sorry, there is no such code block in theme files.
by
There is such a code related to the selected answer, but I do not know if it is relevant.

http://prnt.sc/rew8wr
by
+1
wrap the code from the first screenshot then

function a_selection($post)
{
    if (qa_get_logged_in_level() > QA_USER_LEVEL_MODERATOR) {
        // THE REST OF YOUR CODE HERE ....
    }
}
by
+1
Thank you so much!
by
Yes it works fine on https://wepals.net
0 votes
by
Modify in the administrator permission menu

Answer selection for any question:

At a user level that you decide
by
Unfortunately, this is not the answer i want. i want users to be unable to choose answers in their own questions
0 votes
by
This may not be a perfect solution but how about hiding the "Tick" in CSS?

The user cannot see the tick, they cannot click!
by
moved by
If i cancel that one, also i can not see it
...