MyBB Community Forums

Full Version: Add a view count to a page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've added a page.  (using this tutorial: https://community.mybb.com/thread-116225.html )
Some Users might be jumping directly to the page (like making it a favorite bookmark) - resulting in no thread count on the forum.

If possible, can a view counter be added to the page?
Huh ? What type of page did you create? and why would you expect the thread view count to increment? I can understand if you want to create a counter to monitor page views of your page, but then you need some custom coding there.
(07-09-2017, 02:56 PM)Ashley1 Wrote: [ -> ]Huh ? What type of page did you create? and why would you expect the thread view count to increment? I can understand if you want to create a counter to monitor page views of your page, but then you need some custom coding there.

It's a human interest page (created using the code referenced in the original post).
Yes, thread view count increases when accessed via the forum topic.
But access to the page directly (once the url has been obtained) does not get counted - there is no view count anywhere.

"View count" draws more interest when the numbers are higher - it's helps increase readership.
And yes, it probably does require some custom coding to see how often the page is viewed.

I was hoping that this topic had been previously discussed. . .

(pm sent)
Thanks for the PM. I tested this, and your count does increment when i access the page directly via bookmark.
Thanks.  Based on your findings then I would assume it doesn't count me (or the same person) more than once.
I wonder if it counts if the same person visits the page everyday via a direct bookmark. . .?
(07-09-2017, 08:57 PM)CloudyBright Wrote: [ -> ]Thanks.  Based on your findings then I would assume it doesn't count me (or the same person) more than once.
I wonder if it counts if the same person visits the page everyday via a direct bookmark. . .?

Yes it will.

Looks like the count operates normally, counting just about anything that hits the page, and that includes guests, bots etc.
(07-09-2017, 08:57 PM)CloudyBright Wrote: [ -> ]Thanks.  Based on your findings then I would assume it doesn't count me (or the same person) more than once.
I wonder if it counts if the same person visits the page everyday via a direct bookmark. . .?

Note that your browser/server very well could be caching the page. This means that the number you see for your counter might not actually be up to date. Try deleting your browser cache/cookies and hard reload the page (Shift+F5) and then see if the number updates properly.
I think the custom page needs a view counter.
Ultimately, I want to use a custom menu (not a thread) to access view the custom page.
The page itself will need a view counter.

Any ideas?
I don't know how well this works:

https://mods.mybb.com/view/hit-counter
What ideas are you looking for here? I don't think there's very many ways to create a simple hit counter. It should basically just be one field in the database getting updated every time the page is loaded, right?

There's more efficient ways of doing this, of course, but the concept itself really is that simple.