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

How to limit the max amount of views displayed in a question?

0 votes
44 views
asked Sep 6 in Q2A Core by Ronlaw
I want to display question views but only to a certain limit. For example:

Question A: 340 views

Question B: 1,000+ views

I think it's important to hide your most visited pages from competitors. Keyword competition in Google results can be brutal. But I still want users to know which questions are most visited.
Q2A version: Latest

1 Answer

+1 vote
answered 1 day ago by jatin.soni

If you have fixed maximum number than the easiest (may not be the perfect) way to do is just check conditionally with the max number and show unless it is lower than that else display your max number. 

Here is the simple logic. Of course, you will have to change variable and figure you want.

if ($viewCount < 1000) {
	//show view count as it is
} else {
	//show view count 1000+
}
commented 17 hours ago by Ronlaw
Thank you. That helps.
...