You can try out the page stats box i just made, at a demo site (log in as guest/guest, who is an editor -- i've designated in a Var that editors can see the box). I haven't done much testing, so let me know what you find, as well as any opinions about usability, more features, etc.
A cron function parses the httpd access log, which should have a modified combined log format that includes the cookie string. Currently the location of the log (CustomLog directive) and it's exact format (LogFormat directive) are specified in Vars, since i don't know any way to access those values thru mod_perl.
The added field to the log is the only addition to scoop's logging.
The box currently makes a total of two selects, on one table each.
Here relevant Vars, as well as the new table structures, are indicated by the statements below.
The stats box code can currently be accessed here, and the cron function is in this version of Cron.pm. But like i said, it needs testing.
INSERT INTO vars (name,value,description,type,category) VALUES ('stats_skip_groups', '', 'List of groups to ignore when calculating page statistics. E.g. Superuser, Admins, Anonymous', 'text', 'Stats');
INSERT INTO vars (name,value,description,type,category) VALUES ('stats_pageview_timeout', '30', 'Number of minutes a page viewing can take before being ignored by page statistics calculator', 'num', 'Stats');
INSERT INTO vars (name,value,description,type,category) VALUES ('stats_logformat', '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" "%{Cookie}i"', 'Format of log, as specified by the Apache directive', 'text', 'Stats');
INSERT INTO vars (name,value,description,type,category) VALUES ('stats_logfile', '', 'full path of log file (should be access log)', 'text', 'Stats');
INSERT INTO vars (name,value,description,type,category) VALUES ('stats_displayto_groups', 'Superuser, Admins', 'List of groups that can see the stats box', 'text', 'Stats');
INSERT INTO vars (name,value,description,type,category) VALUES ('stats_links_number', 6, 'How many of the most popular links should be shown in the list', 'num', 'Stats');
CREATE TABLE page_route (loc1 TEXT, loc2 TEXT, label TEXT, period CHAR(1), count MEDIUMINT UNSIGNED, percent TINYINT);
CREATE INDEX per_loc ON page_route (period,loc1(20));
CREATE TABLE page_views (loc TEXT, period CHAR(1), count MEDIUMINT UNSIGNED, elapsed MEDIUMINT UNSIGNED, avg TINYINT UNSIGNED);
CREATE INDEX per_loc ON page_views (period,loc(20));
INSERT INTO cron (name,func,run_every,enabled) VALUES ('stats', 'cron_stats', 86400, 1);
--
babelguides.com <<world literature in translation>>