View counts!

Blog post

Author
Message

Rocket Man
Posts: 383
Posted on: 2013-01-15 17:19:09.000
I've added a small feature that shows the number of views each forum thread or blog post has gained. Each time you view a thread in the forum view or view a complete blog post by clicking on the link, the number is bumped.

Because this is a new feature, all the old views aren't counted. :( So they are starting at zero.

This did require a change to the database, as I didn't already have the column "PostViews" in the Posts table. This can present a problem when people are upgrading from an earlier version of Rockets that doesn't have that column. I've updated setup-rockets.lisp to create this field when making a new database, but people's existing databases won't have it. I'll probably have to add a "update database to latest version" script that will just add the missing columns for people with older versions. One nice thing is that the database doesn't need any values in there. It just needs to be altered to add this missing field.

Rocket Man
Posts: 383
Posted on: 2013-01-15 17:20:11.000
Oh.. the views are shown on the item page and listed in the Forums page as well.

Rocket Man
Posts: 383
Posted on: 2013-01-15 17:34:16.000
And this post has a lot of views because I'm testing a bunch of formatting stuff. :)

Rocket Man
Posts: 383
Posted on: 2013-01-15 18:27:36.000
Okay I'm topping off the views at 20 so I can remember if they get bumped by other people or not. :) This is leading up to the next feature, which is keeping track of which threads have new messages in them and showing new activity to the user.

Rocketeer
Posts: 17
Posted on: 2013-01-18 20:19:30.000
Even better.


Views: 5384