CNStats 2.7 / User manual

© "CN-Software" Ltd. 2002-2005
support@cn-software.com
www.cnstats.com, www.cn-software.com

Settings stored in config.php:


$STATS_CONF["dbname"] (mandatory parameter)

Name of the database, where CNStats stores all data. Names of CNStats tables have "cns_" prefix, so it is possible to use CNStats even if your hosting-provider supplied you with access to only one database.

Example:

$STATS_CONF["db_name"]="mysite_cnstats";

$STATS_CONF["sqlhost"] (mandatory parameter)

Database server address. As a rule, it is supplied by the hosting-provider.

Example:

$STATS_CONF["sqlhost"]="localhost";

$STATS_CONF["sqluser"] (mandatory parameter)

Database server login. You must have rights for creation and deletion database tables for correct functioning of CNStats. These rights are usually supplied by the hosting-provider.

Example:

$STATS_CONF["sqluser"]="root";

$STATS_CONF["sqlpassword"] (mandatory parameter)

Database server password. It may be blank (often for "root" users). As a rule, it is supplied by the hosting-provider.

Example:

$STATS_CONF["sqlpassword"]="";

$STATS_CONF["adminpassword"] (mandatory parameter)

Password for statistics view. It is used with E-Mail set by the option $STATS_CONF["cnsoftwarelogin"])

The password is encrypted with MDS algorithm.

Example:

$STATS_CONF["adminpassword"]="ecb4cb24043cf723b4a5458da5f02";

Or, if you wish to change password used during installation:

$STATS_CONF["adminpassword"]=md5("mypassword");

$STATS_CONF["sqlserver"] (mandatory parameter)

SQL server software. So far only MySql is supported.

Example:

$STATS_CONF["sqlserver"]="MySql";

$STATS_CONF["cnsoftwarelogin"] (mandatory parameter)

E-Mail is used as login to view CNStats statistics. For the commercial versions this E-Mail should match the E-Mail the license is registered to. E-Mail and password ($STATS_CONF["cnsoftwarepassword"]) are transmitted to cnstats.com to get updated data files and extended reports.

Example:

$STATS_CONF["cnsoftwarelogin"]="admin@site.com";

If you decide to change E-Mail after purchase, you will have to change it for the current license in the license editing menu.


$STATS_CONF["cnsoftwarepassword"] (mandatory parameter for commercial version)

Password for the current license, which is used to get access to updates and extended reports. The password is not encrypted. After the purchase you will get an E-Mail with data to enter the Members Area. In your Member Area you will find the password for the current license. It should be inserted in this field.

Example:

$STATS_CONF["cnsoftwarepassword"]="mypassword";

The password may be changed in the license editing interface at www.cnstats.com. New password should be inserted into config.php afterwards.


$COUNTER["savelog"] (mandatory parameter)

It sets period of complete statistics storage per days. The longer the period, the more space is required for the database. The database size influences system performance, it slows down with larger database.

Database size may be monitored in the report "Database size".

Recommended value - 40.

Example:

$COUNTER["savelog"]=60;
You may increase database size any moment. Note: Do not set a too long period. 30-60 days is enough for most web-sites.
You may decrease database size any moment. Records are deleted at midnight. Note: Some of your database settings may not allow decreasing database size. To decrease database size run sql table optimization by command:
OPTIMIZE TABLE cns_log;

$COUNTER["domain"]

Address of the web-site main page where CNStats is installed. Ending slash ("/") is not used. The address is used to generate the counter code.

If the parameter is not set, it is built from the data generated in variable of the HTTP_HOST environment. If you use CNStats to count statistics for several domains and use combined counter, you should set this parameter, otherwise counter codes for secondary domains will be created incorrectly.

Example:

$COUNTER["domain"]="http://www.cnstats.com";

$COUNTER["type"] (mandatory parameter)

Counter type.

For more information, please, refer to "Counter types"


$COUNTER["inkR"], $COUNTER["inkG"], $COUNTER["inkB"]

Font color for symbols on the counter image. Each value may vary from 0 to 255.

Default color is black.

Example:

Black:

$COUNTER["inkR"]=0;
$COUNTER["inkG"]=0;
$COUNTER["inkB"]=0;

Red:

$COUNTER["inkR"]=255;
$COUNTER["inkG"]=0;
$COUNTER["inkB"]=0;

White:

$COUNTER["inkR"]=255;
$COUNTER["inkG"]=255;
$COUNTER["inkB"]=255;

$COUNTER["excludeip"], $COUNTER["excludemask"]

List of excluded IP addresses and networks. It is possible to set one or several ranges. It should be set in couples: IP-address first, than network mask.

Example:

For a single address:

$COUNTER["excludeip"]="127.0.0.1";
$COUNTER["excludemask"]="255.255.255.255";

For a single address and a single network:

$COUNTER["excludeip"][]="127.0.0.1";
$COUNTER["excludemask"][]="255.255.255.255";
$COUNTER["excludeip"][]="192.168.0.1";
$COUNTER["excludemask"][]="255.255.255.0";

$COUNTER["disablepassword"]

CNStats authorization disabling. "Yes" - authorization is disabled, "no" - authorization is enabled.

Sometimes it is more convenient to use "in-house" authorization when you install CNStats into existent software engine. In such cases you may switch off CNStats authorization to avoid double authorization.

Default value: "no"

Example:

$COUNTER["disablepassword"]="yes"

$COUNTER["senderrorsbymail"]

If it is set to "yes", then CNStats errors will be reported to the E-Mail set in $STATS_CONF["cnsoftwarelogin"] parameter.

If "no", no errors reports will be E-Mailed.

Example:

$COUNTER["senderrorsbymail"]="yes";

$COUNTER["resolution"]

The parameter sets resolution of the statistics interface. It can be 800 or 1024 for 800x600 and 1024x768 correspondingly. Resolution affects size of tables as well as of charts.

Default value: 800

Example:

$COUNTER["resolution"]=800;

$COUNTER["sqlwritelog"]

Addition to the SQL request to write in the log-table. It is inserted in the SQL instruction in plain format between "INSERT" and the table name.

Note: Incorrect parameter can damage the database

Example:

$COUNTER["sqlwritelog"]="DELAYED";

$STATS_CONF["sqlinstructions"]

Array of SQL-instructions, performed upon connection to the database server. As a rule this option is used to configure localization, if the database server has incorrect settings.

Example:

$STATS_CONF["sqlinstructions"][]="SET NAMES cp1251";
$STATS_CONF["sqlinstructions"][]="SET CHARACTER SET cp1251";

$STATS_CONF["slow_reports_memory_limit"]

Memory volume limit for slow reports. There are two of them - "Entry pages" and "Trace browsing".

If integer is used, the value is measured in bytes. It is possible to use abbreviations - K (for kilobytes) and M (for megabytes).

Example:

$STATS_CONF["slow_reports_memory_limit"]="32M";

$STATS_CONF["slow_reports_time_limit"]

Time limit for slow reports (seconds). There are two of them - "Entry pages" and "Trace browsing".

Example:

$STATS_CONF["slow_reports_time_limit"]=1800;

$STATS_CONF["color"]

Sets color template for the statistics interface. Nine colors which are used to display statistics are stored in array elements from 0 to 8 (from dark to light). 0 is for the darkest hue, 8 is for the lightest hue.

Default values:

$STATS_CONF["color"][0]="#489153";
$STATS_CONF["color"][1]="#88C591";
$STATS_CONF["color"][2]="#B8E1BD";
$STATS_CONF["color"][3]="#D4F3D7";
$STATS_CONF["color"][4]="#DAF5DE";
$STATS_CONF["color"][5]="#CFEDD3";
$STATS_CONF["color"][6]="#E7F9EA";
$STATS_CONF["color"][7]="#F2FCF4";
$STATS_CONF["color"][8]="#FEFEFE";

Example for the grey color:

$STATS_CONF["color"][0]="#606060";
$STATS_CONF["color"][1]="#808080";
$STATS_CONF["color"][2]="#C0C0C0";
$STATS_CONF["color"][3]="#D0D0D0";
$STATS_CONF["color"][4]="#E0E0E0";
$STATS_CONF["color"][5]="#F0F0F0";
$STATS_CONF["color"][6]="#E0E0E0";
$STATS_CONF["color"][7]="#F0F0F0";
$STATS_CONF["color"][8]="#FFFFFF";

$STATS_CONF["hello string"]

The parameter sets text string which is displayed in the login dialogue. HTML code may be used. The string is blank by default.

Example:

$STATS_CONF["hello string"]="To see the statistics
you should use login <B>guest</B> and
password <B>guest</B>.";

$STATS_CONF["guestlogin"]

The parameter sets guest login, which allows viewing statistics and using filters (creating, deleting). Other settings are not available for a guest.

For instance:

$STATS_CONF["guestlogin"]="guest";

$STATS_CONF["guestpassword"]

The parameter sets guest password. It is used together with $STATS_CONF["guestlogin"].

Guest logon allows viewing statistics and using filters (creating, deleting). Other settings are not available for a guest.

For instance:

$STATS_CONF["guestpassword"]="guest";

$COUNTER["timeoffset"] (this function is working in test mode)

Server time shift in seconds. It is set if the server, where your web-site is running, is located in the different time zone.

Example:

$COUNTER["timeoffset"]=-1800;

Example of config.php

<?
// Data for the database server connection
$STATS_CONF["dbname"]="cnstats";
$STATS_CONF["sqlhost"]="localhost";
$STATS_CONF["sqluser"]="root";
$STATS_CONF["sqlpassword"]="";

$STATS_CONF["sqlserver"]="MySql";

// Password for administrative interface
$STATS_CONF["adminpassword"]="1cb4cb24043c45f74b8da5a523f02";

// E-Mail, to which the product is licensed to
// (it is also used to login to CNStats)
$STATS_CONF["cnsoftwarelogin"]="admin@site.com";

// Password, which is set in the license settings
$STATS_CONF["cnsoftwarepassword"]="mypassword";

// It saves full statistics for 30 days
$COUNTER["savelog"]=30;

// Web-site root directory without closing slash (/)
$COUNTER["domain"]="http://www.cnstats.com";

// Counter type - PHP-include
$COUNTER["type"]=1;

// PNG image font color
$COUNTER["inkR"]=0;
$COUNTER["inkG"]=255;
$COUNTER["inkB"]=0;

// Do not count my own visits 
$COUNTER["excludeip"][]="127.0.0.1";
$COUNTER["excludemask"][]="255.255.255.255";

// Do not disable CNStats authorization
$COUNTER["disablepassword"]="no";

// Report errors via E-Mail
$COUNTER["senderrorsbymail"]="yes";

// Adjust tables and diagrams for screen resolution 800x600
$COUNTER["resolution"]=800;

// Use grey colour spectrum
$STATS_CONF["color"][0]="#606060";
$STATS_CONF["color"][1]="#808080";
$STATS_CONF["color"][2]="#C0C0C0";
$STATS_CONF["color"][3]="#D0D0D0";
$STATS_CONF["color"][4]="#E0E0E0";
$STATS_CONF["color"][5]="#F0F0F0";
$STATS_CONF["color"][6]="#E0E0E0";
$STATS_CONF["color"][7]="#F0F0F0";
$STATS_CONF["color"][8]="#FFFFFF";

// Hello string 
$STATS_CONF["hello string"]="To see a demonstration, enter
<B>guest</B> for both the Login and Password fields.";

// Guest login
$STATS_CONF["guestlogin"]="guest"; 

// Guest passowrd
$STATS_CONF["guestpassword"]="guest"; 


// Use DELAYED INSERT when adding log to the table
$CONFIG["sqlwritelog"]="DELAYED";

// Resources limits
$STATS_CONF["slow_reports_memory_limit"]="32M";
$STATS_CONF["slow_reports_time_limit"]=1800;
?>

Back | Manual index | Next