
Benjamin
Staff

Jun 4, 2003, 3:55 PM
Post #1 of 17
(11723 views)
Shortcut
|
|
Hitcounter add-on?
|
Can't Post
|
|
Hey guys, I just read the hitcounter thread, and thought that might be a fun little project to work on. Here's how I'm thinking of putting it together - any and all feedback would be appreciated. What are the drawbacks to the following approach? Can you think of better ways to do it? hitcounter.cgi - this file would be pulled into your published article pages via an SSI, like so: <!--#include virtual='/path/to/exec/hitcounter.cgi?art_num=$art_num$'--> Then, the script examines the article number and outputs the hitcount for that article. Q: What's the best way to store the hitcounter info? Originally, I thought of just sticking it in a single file, but with thousands of articles, this would take increasingly longer times to parse through, grab the current hitcount for the article page, resave the page, then output the hitcount. I'm starting to think that having a single file per article might be the way to go, although a bit messy... we would have to have a separate /hitcount directory somewhere to store all the separate files... By having a single file per article, we would keep everything running quickly - plus (if we wished) we could even store additional information about the page for future information gathering. Also, to prevent people just clicking refresh again and again to up the stats, I'd include a IP buffer file, which stores (say) the last 5 people's IP addresses who've visited the page. If their IP is listed in that file, then the hitcounter wouldn't be incremented. We could do this with cookies, but I'd like to make it tougher to get around than that. Anyway. I've taken a look at look at some other page counters and haven't been too impressed - the best ones are database driven, but I don't want to write something that requires that. Comments? Having said all this, would this be a handy add-on?! Ben interactivetools.com
|