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 add views for each topic?

+6 votes
How can add views for each topic?
asked Apr 7, 2010 in Q2A Core by minnkyaw
Can you please clarify the question with more details?
I mean  like, 40 viewed on this question. like 10 answered.
I too would also like to have a views counter as well as badges. Can you code something that stackoverflow doesn't even have yet that people want! I love this Q2A software.

1 Answer

0 votes
This would require quite a lot of changes to the QA engine, which has not been designed (for now) to keep track of views. One reason is that every page view requires only a single database query, and keeping track of views would use a second.

Still, you could do it yourself by creating a new database column that counts views, then incrementing that count whenever the page is viewed. Then make sure that column is retrieved in qa_db_posts_basic_selectspec(), add the appropriate logic to qa_post_html_fields() to pass the information to the theme layer, and then make an advanced PHP theme which outputs this information in the web pages in the appropriate location.
answered Apr 7, 2010 by gidgreen