Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
457 views
in Q2A Core by
CAn someone advice me how to display the number of questions a user has right below his avatar image on Question page ???

Regards
Q2A version: 1.6.x

1 Answer

+2 votes
by

This data is stored in the meta-table qa_userpoints. The qposts columns has the number of questions they have asked. So a query like this would do it:

$result = qa_db_query_sub('SELECT qposts FROM ^userpoints WHERE userid=#', $userid);
$qposts = qa_db_read_one_value($result, true);

$userid there might be $post['raw']['userid'] instead, if the query was run in one of the theme functions.

...