NAME
Konstrukt::Plugin::browserstats - Browser statistics plugin
SYNOPSIS
Usage:
<!-- add browser request to the db -->
<& browserstats / &>
or
<!-- display the overall top browsers -->
<& browserstats show="all" / &>
or
<!-- display the top browsers grouped by year -->
<!-- month and day will also work, if the data is stored in such a fine granularity -->
<!-- the display aggregation should not be finer than the setting browserstats/aggregate -->
<& browserstats show="year" / &>
Result:
A table displaying the statistics, if the attribute show
is set. Nothing otherwise.
DESCRIPTION
Creates statistics about the browsers used to access your homepage.
You may simply integrate it by putting the tag into your page. See </SYNOPSIS> for details.
CONFIGURATION
You may do some configuration in your konstrukt.settings to let the plugin know where to get its data and which layout to use. Defaults:
#backend
browserstats/backend DBI
See the documentation of the backend modules (e.g. "CONFIGURATION" in Konstrukt::Plugin::browserstats::DBI) for their configuration.
#granularity
browserstats/aggregate all #specifies the granularity of the logs. may be all, year, month, day
#browser classes.
#syntax: classname1 => browsername1 browsername2, classname2 => ..., other => *
#see HTTP::BrowserDetect for a list of browsernames
browserstats/classes nsold => nav2 nav3 nav4 nav4up navgold, ns6 => nav6 nav6up, firefox => firefox, opera => opera, mozilla => mozilla, ie => ie, robot => robot, other => *
#layout
browserstats/template_path /templates/browserstats/
#only count unique visitors (determined by session)
browserstats/unique 1
#access control
browserstats/userlevel_view 2 #userlevel to view the stats
browserstats/userlevel_clear 3 #userlevel to clear the logs
METHODS
execute_again
Yes, this plugin may return dynamic nodes (i.e. template nodes).
init
Initializes this object. Sets $self->{backend} and $self->{template_path}layout/. init will be called by the constructor.
install
Installs the templates.
Parameters:
none
prepare
Prepare method
Parameters:
$tag - Reference to the tag (and its children) that shall be handled.
execute
All the work is done in the execute step.
Parameters:
$tag - Reference to the tag (and its children) that shall be handled.
hit
Logs a hit.
Parameters:
$title - The title of the page to log. (optional) If not defined, the filename of the current page will be used.
show_stats
Displays the results of the browser logging.
Parameters:
$aggregate - The range over which the hits should be aggregated. May be
all
,year
,month
andday
. Should not be finer than the settingbrowserstats/aggregate
AUTHOR
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
SEE ALSO
Konstrukt::Plugin::browserstats::DBI, Konstrukt::Plugin, Konstrukt, HTTP::BrowserDetect