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

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

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

+4 votes
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

-----

Thanks..
asked Jun 24, 2010 in Q2A Core by R

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
answered Jun 24, 2010 by gidgreen