Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
945 views
in Q2A Core by
Is there any way to show in the home page how many times each question favorited ??

Just the number of favorited times next to each question. Is there a plugin to do this? If not i think that this is a good idea.
Q2A version: 1.6.x

1 Answer

+2 votes
by
selected by
 
Best answer

Use the below SQL to get the count of the questions favorited by all the users . 

Where entityid the question_id (post_id) from the database . 

After grabing the value use it anyway you want . 

SELECT COUNT(*) as count 
FROM `qa_userfavorites` 
WHERE `entitytype` = 'Q'
AND `entityid` =10
LIMIT 0 , 300

 
Hope this helps . Thanks 
...