Camen Design Forum

Feature Request:Forum Topic Views Counter!

append delete SteTaylor

Not sure what you guys think of this. But i think it would be really cool to have a view counter on forum topics. So you can see how many views each topic has got. What you think? :)

Reply RSS


append delete #1. Martijn

I thought about this and if NNF was database powered I would have thrown it in instantly, but the way NNF saves its data – straight to RSS – I wonder if this would have any noticeable performance impacts?

Implementing a view counter would add an expansive file lock, read, and write chain every time a thread is viewed. All of these have to be done in order. So if a 100 people visit a popular thread the server will be locking, reading, and writing, the view counter a hundred times in a row. As a popular thread will probably have many replies we can assume the RSS file to be big, which slows downs this process even more.

So now the server has 100 view count updates queued, then what? Then any new replies will be added to the end of the queue. You will hit reply and then your browser will just sit there, waiting, you might even think the website has gone unresponsive or is broken overall.

On a good hosting platform and with forums the side of this one here these problems will probably be inexistent. But they are something to think about.

append delete #2. Kroc

What is a view? Search bots will access pages every few minutes and without a database the one IP could view a page hundreds of times. View tracking is not practical or useful to do in NNF by design, it's not a meaningful metric. What matters is content and the most recently updated threads order shows that. For anything important but not updated often there's stickies.

append delete #3. SteTaylor

Your right. There is just no point for it. As bots will just destroy the real views. I did not think of it like that. And stickies are there to cover important threads like Kroc said. Just a stupid idea from the top of my head lol.

append delete #4. Kroc

An idea is only stupid if it is not heard and discussed. I don't mind hearing any ideas you have. Any user's opinion of NNF is valuable to me.

append delete #5. Martijn

Bots could be countered for the most part by looking at past projects though. phpBB is a popular forum system that counts views and they are getting pretty accurate results after filtering out 45 different bots [1]. NNF could easily take over this list.

The StackExchange question on this subject [2] is interesting to look a too. The advice their boils down to:

1. Create a user-agent blocklist, like phpBB has, but possibly use a bigger dataset such as the database by [3] or [4].
2. Ignore all user-agents sporting the words `bot`, `slurp`, `spider`, `crawl`, `archiver`, and `facebook`.
3. Use JavaScript to instantly exclude most of the bots going around.
4. Create a honeypot to collect more bot user-agents.

Most of this feels like it would make for an extreme bloat in the NNF source-code though.

Another problem (that I just thought of) is that NNF would need to introduce some sort of sessions system otherwise many valid users will inflate the counter as well: I will be counted when I read page 1 of a thread, again on page 2, again on page 3, then I might write a reply and after hitting the reply button I would be counted again. So even excluding bots this will be a problem.


[1]: (Latest master commit, as of today)

:: @Martijn added on 08 Jun ’14 · 09:38


append delete #6. jham



(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn