Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
in Q2A Core by
Hi All,

How to show total number of questions, answers and users in side bar?
Any idea?

Want to show like this..

200 Questions
250 Answers
50 Users



1 Answer

+2 votes
Best answer
I'm afraid there's not currently an easy way to do this.

But if you're comfortable with PHP programming, you can modify the HTML output using an advanced theme. The information itself can be retrieved using the following snippets of PHP code:

require_once QA_INCLUDE_DIR.'qa-db-admin.php';

global $qa_db; // required to get database resource handle

qa_get_option($qa_db, 'cache_qcount'); // returns number of questions
qa_get_option($qa_db, 'cache_acount'); // returns number of answers
qa_db_count_users($qa_db); // returns number of users
Hi Gidgreen, I tried your suggestion, but i could not able to make it. No problem..
If any one give somewhat full code or coding in template, it will be better.
I somewhat managed to get this.. :)
I added above codes in in 'sidebar' => ' place of qa-index.php.. concatenated with custom sidebar section.. works fine for Question & Answer counts but not for users..
Thank you!
I added in custom theme, it works fine..
Thank you Gidgreen! :)
asked Jan 19, 2011 in Q2A Core by anonymous source code please anybody!