Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
25.7k views
in Q2A Core by
As I could not find a cached value, I am using:

                // get number of answered questions total
                $quAnswered = qa_opt('cache_qcount')-qa_opt('cache_unaqcount');
 

Is there another way?
Q2A version: 1.6.2

2 Answers

+1 vote
by
edited by

Okay, just needed to modify the cache_unaqcount query with acount>0

SELECT COUNT(*) FROM qa_posts WHERE type="Q" AND acount>0 AND closedbyid IS NULL

That solution does not rely on cached values ;-)

 

PS: AND closedbyid IS NULL is optional, as I never count closed questions.

by
Is your problem solved ?
by
I just thought there is something like qa_opt('cache_qanswcount'). But does not seem so ;)
0 votes
by

I am not sure, but are you looking for:

qa_opt('cache_qcount')

qa_opt('cache_acount')

qa_opt('cache_ccount')

qa_opt('cache_userpointscount')

 

by
It is fine, I am using my first idea now to see how many questions have been answered already:
$quAnswered = qa_opt('cache_qcount')-qa_opt('cache_unaqcount');
 
answered questions = all questions - unanswered questions
...