Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+8 votes
1.2k views
in Q2A Core by
How can add views for each topic?
by
Can you please clarify the question with more details?
by
I mean  like, 40 viewed on this question. like 10 answered.
by
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
by
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.
...