Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Change logic of red box when no answers

+3 votes
93 views
asked Feb 13 in Themes by Aymane
Hi,

I want to keep the red color even if there is an answer as long as there are no experts answers. Where should I look? Should I develop a plugin to change the logic?

Thanks

1 Answer

+1 vote
answered Feb 13 by pupi1985
selected Feb 17 by Aymane
 
Best answer

You will have to write a plugin. The logic should involve a layer to render the appropriate color as well as figuring out if the question has an answer that belongs to an expert user.

Regarding the rendering just overwrite the a_count() function to also include the qa-a-count-zero CSS class if the condition is met.

Regarding the condition I recommend to check the qa-include/pages/question.php file and see how the qa_db_full_child_posts_selectspec() function works. Then you'll have to call that function for every item in the question list and in the question itself to fetch all the answers of the question. Then it is just a matter of checking if the answer belongs to an expert user (QA_USER_LEVEL_EXPERT).

commented Feb 14 by Aymane
For some reason I don't see it.
Screenshot
https://ibb.co/nywHvn
commented Feb 14 by pupi1985
Interesting. Maybe there is a minimum amount of points you need to have before accepting an answer. Funny thing, I didn't remember that to happen when I joined here. Never mind!.
...