Configuration Files  

Configuration Files

ActiveStat has a number of *.cfg files in the stat/cfg directory. These files contain variables and constants you may set to configure your application as needed. Most of the settings enabled for user editing will be moved to the "settings" interface in the upcoming versions. Now you must at least configure the database.cfg.php and stat.cfg.php files prior to running the application.

database.cfg.php

This file contains the database settings. Here are the constants that must be specified:

define ("STAT_DB_USER", "root");//user name to connect to database
define ("STAT_DB_HOST", "localhost");//database host name
define ("STAT_DB_NAME", "stat");//database name
define ("STAT_DB_PASSWORD", "");//user password

stat.cfg.php

The most important constants you must set in this file are:

$stat_site_id - default SITE ID for statistic information collected. Mainly used by the "EMBEDDING STATISTICS AS PHP-CODE" method; or by the other method if for some reason SITE ID was not defined in the JS-code. Note: site IDs are defined in the Definitions/Sites menu of the administration interface.
$stat_visit_ttl - max delay between visitor's clicks to be assigned to the same visit
(you may choose to keep the default value of 10 minutes).

Other parameters may keep their default settings, but to adjust the behavior of ActiveStat so it better suits your needs, you'll have to change them. Here is how you can do it:

$stat_write_unk_site- if the parameter is set to 0, all visits from non-defined sites (see: Administration Interface/Definitions won't be recorded; if set to 1 - all visits will be recorded with unknown sites defined automatically.
$stat_redirect_url- represents the URL to which a visitor with 'access denied' will be redirected by default.
$stat_store_plugins- whether or not to store navigator plug-in information: 1- yes, 0 - no.
$statHttpVars- array containing definition of parameters to be stored without any transformation: array(PHP_variable_name => parameter_type_name)

ui.cfg.php

$stat_date_format- date format
$stat_date12- if true - 12-hour time format is used, if false - 24-hour time format is used
$stat_week_start- weekday numbers: 0 - Sunday, 1- Monday,… 6 - Saturday
$statParamTypes- this array contains parameter types (integer_type => " name "). Here you can add your custom parameter type.
$statUDReports- this array contains user defined reports (integer_type => array_of_parameters_of_the_type). A record from the array corresponds to a menu in the reporting interface named exactly as the parameter type and having submenus for each parameter from the "array_of_parameters_of_the_type" defined.

You may also add new param types to extend ActiveStat.

cron.cfg.php

This file is used to configure the jobs.php scheduled script, responsible for marking of visits and sending reports on marks, newly requested non-existent resources and referrers. It also performs delayed deletion of data if scheduled from the administration interface.

The following parameters determine who's to receive a task status report and in which form.
$stat_cron_admin_as- specify if the script will produce the admin's report. Available are the following constants: STAT_CR_NO - no report, STAT_CR_MAIL - send mail, STAT_CR_FILE - save report to file.
$stat_cron_admin_to- this variable contains either an email address the report will be sent to, if… $stat_cron_rpt_as = STAT_CR_MAIL; or the name of a file the report will be saved to, if … $stat_cron_rpt_as = STAT_CR_FILE
$stat_cron_admin_subj- subject of the report
 
The following parameters determine who’s to receive reports on a certain task and in which form.
 $stat_cron = array(
   JOB_MARKING => array (
       "as" => ... // like stat_cron_admin_as
       "to" => ... // like stat_cron_admin_to (comma separated list of emails)
       "subj" => ... // like stat_cron_admin_subj
   ),
   JOB_REQ_URL => array (
      ... // like for a previous task
   ),
   JOB_REFERRER => array (
      ...
   ),
   JOB_CLEANUP => array (
      ...
   )
 );

'Daily' parameters determine common settings for the JOB_MARKING, JOB_REQ_URL and JOB_REFERRER jobs, 'Cleanup' parameters are related to delayed deletion of information scheduled from the administration interface:

$stat_cron_params = array('daily' => ..., 'cleanup' => ...) contains additional job parameters related to schedule.
 
 'daily' => array(
   'starttime' => '06:00', // time for a 'daily' task to start (24 hour format)
   'timeout' => 2 * 60 * 60 // timeout in seconds for resetting task status
   ),
 'cleanup' => array(
   'timeout' => 30 * 60 // timeout in seconds for resetting task status
   )

reports.cfg.php

Contains constants that influence the reports interface. Here you can change the following parameters:

$statPreselectedSites- IDs of sites to be pre-selected in reports (see Reports/Options);
$stat_list_separator- to change a separator for CSV-export;
$statSBY array- to specify your own values for the "Show by" list box to be able to get reports by desired periods of days;
$statSBYN- to change it in accordance with the changes in $statSBY - allows you to set a count of periods to be displayed on a page for each period you have defined in the $statSBY array;
$statPltMnuFields, $statPltFields- to configure menu items in the "PLATFORM" menu and the Platform fields in the "visit details" popup window respectively.
$statBShowCount, $statWShowCount- default count of records in the "Visits list" and "Detailed visits list" respectively.

core_const.cfg.php, ui_const.cfg.php, reports_const.cfg.php, graph_const.cfg.php

You must not edit the above files.