Author |
Topic |
pitstraight
New Member
Australia
82 Posts |
Posted - 31 January 2008 : 15:29:45
|
At the moment the 'read' counter on any thread just starts from 1 and continually rises. I would like to see a MOD that allows you to find how many reads in the last X days (like the active topics dropdown).
I see something like the Active Topics page, but the dropdown has 1, 7, 14, 30 , 60, 90 days etc ..... and lists the topics sorted by reads (in that timeframe) in desc order.
So, a thread with a HUGE number of reads, but no one has read it today will NOT be shown in the 1-day list, but the thread that was posted and read 3 times WILL appear in the 1-day list. It's kinda hard to desctibe, but I hope you get the idea< |
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 31 January 2008 : 16:16:56
|
Hate to sound like a broken record, but I've got the same answer here as for your other question:
To the best of my knowledge, there is no existing MOD to do this. While it is technically possible, and I agree that it would be a good thing from a conceptual standpoint, I'm not sure I would actually implement something like this unless I've got a lot of data storage to burn.
WROX had a statistics package up that I played with for a while, but its in need of some updating and for the short time I needed/used it it generated a sizable chunk of data.
You could look at it for some ideas on how to go about programming what you want. It is worth mentioning that it also got slower and slower as time went on, so you might not want to follow too closely.
http://www.2enetworx.com/dev/projects/statcountex.asp< |
|
|
pitstraight
New Member
Australia
82 Posts |
Posted - 31 January 2008 : 20:44:18
|
Hmmm ok, I don't know enough about the coding and data storage side or I would do it myself, but could you just store the topic number and date and then add the hits when you want to ?
Possibly you could remove the data more than 12 months old if the storage is getting too big.< |
|
|
phy1729
Average Member
USA
589 Posts |
Posted - 31 January 2008 : 22:47:04
|
I think the way to approach it would be to add 8 columns to the topics table say Day0 through Day6 or 1-7 depending on how the day is returned by ASP and Last_Day and each day store the day view count in that column each time the day changes which you could tell if Last_Day <> today then clear the column and to get the read count of the prev 7 days just sum the values. Thoughts? I can't code this now but I may later when I have time if you choose to use this method.< |
|
|
pitstraight
New Member
Australia
82 Posts |
Posted - 31 January 2008 : 23:41:57
|
But I don't want just 8 days, I need a good list going back maybe 2-3 months.
< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 01 February 2008 : 07:03:04
|
Then your original thought would be a better way to go - have a table that records the topic number and date/time.< |
|
|
phy1729
Average Member
USA
589 Posts |
Posted - 01 February 2008 : 07:12:39
|
well then you could expand it to be say Day0_0 ..0_1 ... and do a modulo date or probably better go with something else.< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 01 February 2008 : 08:34:15
|
Just out of curiosity, does your hosting package have any kind of statistical analysis you could use?< |
|
|
pitstraight
New Member
Australia
82 Posts |
Posted - 01 February 2008 : 14:54:35
|
Yes, I have a stats package I can use but I think it just records topic.asp and not all the stuff on the end like topic id
I'm scratching my head wondering why this is so hard, I guess there's something I'm missing. At the moment there is a counter to record the total number of reads on a specific topic. I just want that added in different ways, not a straight total.
The thing is I don't know enough about the coding to actually make it work, which is why I posted here.< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 01 February 2008 : 15:07:53
|
Most stat packages I've seen do keep the query string variables when they record the hits, which would allow you to extract that information.
As far as building it into Snitz, its not so much that its hard, its just inefficient. Why do you need this information? (I saw about the drop-down, be more specific and include the rational as to why - it helps when building a program. ) There may be a better way to get what you want...< |
|
|
pitstraight
New Member
Australia
82 Posts |
Posted - 01 February 2008 : 15:23:33
|
It's for a project that I have to do to measure how popular topics are over a certain timeframe. The dropdown is the key, it limits the days that the read counter is totalled over. So the dropdown basically says "please rank the topics in descending order based on their read count in the last X days" where X can be 1,2,7,14,30, whatever but probably like the ActiveTopics page there is a sensible list of values to choose from.< |
|
|
phy1729
Average Member
USA
589 Posts |
Posted - 01 February 2008 : 17:28:38
|
Is this for normal users or just for you?< |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 01 February 2008 : 17:32:52
|
If you want to go that route, here's how I would do it: create a new table, TOPIC_VIEWS, and store all of the information there. For fields, I'd have something like VIEW_ID (just so there is a unique key), TOPIC_ID, and VIEW_TIME.
Then you could query the table as you wanted to get results for different time frames. It adds some overhead to the forum, but I suppose the tradeoff depends on how busy your forum is or how beefy your server. As AnonJr mentioned, this table will bloat your DB in a hurry, since every time someone reads a topic (thousands of times a day on forums like this one), there's an associated DB entry.< |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
Edited by - muzishun on 01 February 2008 17:35:42 |
|
|
pitstraight
New Member
Australia
82 Posts |
Posted - 01 February 2008 : 21:08:22
|
I'm thinking just for me at the moment, does that affect the space it will use ?
< |
|
|
phy1729
Average Member
USA
589 Posts |
Posted - 01 February 2008 : 21:37:31
|
Well if it's just for you you may want to consider adding Google analytics to your forum to do the job for you.< |
|
|
pitstraight
New Member
Australia
82 Posts |
Posted - 01 February 2008 : 22:16:02
|
My site is behind a firewall, so I can't use it
I have Google Analytics on another site, but that tracks the hits on each page separately ... I've just looked :(
< |
|
|
Topic |
|