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

I tried the steps shown at http://question2answer.org/qa/844/lock-question-accepting-answers-after-selection-best-answer

but nothing works execept a Notice: Undefined index: answerable in qa-page-question.php.

Please help

1 Answer

+1 vote
by

The code has changed slightly since that version. The solution is now to add the following line before the end of the branch:

if (isset($question)) { ... }

at the end of qa_page_q_load_q() in qa-page-question.php:

$question['answerbutton']=$question['answerbutton'] && !isset($question['selchildid']);

The && is a logical AND so we're just adding another condition here on whether a question can be answered - the condition is that it has no selected answer.
...