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

How to change a setting for the question view's counter for Q2A Blog tool?

+2 votes
224 views
asked Feb 7, 2016 in Plugins by Ankhamax

I would like to know how to change a setting for the question view's counter for Q2A Blog Tool Plugin.

Actually, it is counting users from their ip. So if they come twice, it only shows 1 view.

How to change it, when a user views the blog, it counts as a view, and if the same ip user comes back, it counts for another view?

Q2A version: 1.7.2

Q2A version: 1.7.2
commented Feb 7, 2016 by Gurjyot Singh
Actually counting view based on IP is in core of Q2A. So Blog plugin is also following the same thing. Although, if there is a way to count every visit a view then I would also like to know that but I won't actually like to implement that.

1 Answer

+1 vote
answered Feb 7, 2016 by Ami
selected Feb 7, 2016 by Ankhamax
 
Best answer
In blog-tool/pages/blog-post.php ,

you can comment this line to record every page load .

Find -

( ( $post[ 'lastviewip' ] != qa_remote_ip_address() ) || ( !isset( $post[ 'lastviewip' ] ) ) ) && // then it must be different IP from last view

Comment this , like

//( ( $post[ 'lastviewip' ] != qa_remote_ip_address() ) || ( !isset( $post[ 'lastviewip' ] ) ) ) && // then it must be different IP from last view

PS: This is not good for performance point of view.
commented Feb 7, 2016 by Ankhamax
Hi Amy,

Thank you for the heads up. It helped me to figure it out. On my version, it is located under post-single.php file. I took a little bit different approach to make it work. I didn't comment it out, hopefully it won't affect the performance.
commented Feb 7, 2016 by Ami
Thats great . I think I gave you a renamed file name as I am on the way to 2.0 and changed few file names .
...