Documentation

Stats extends StatsLibrary

Stats

Class with different methodes to get statistical information about webaccess

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Christian Wehrli christian.wehrli@astalavista.ch

version
1.11
subpackage

coremodule_stats

Table of Contents

Properties

$_objTpl  : mixed
$arrBrowsers  : mixed
$arrClient  : mixed
$arrColourDefinitions  : mixed
$arrColourDepths  : mixed
$arrConfig  : mixed
$arrCountries  : mixed
$arrCountryNames  : mixed
$arrHostnames  : mixed
$arrIndexedPages  : mixed
$arrLastReferer  : mixed
$arrMostViewedPages  : mixed
$arrOperatingSystems  : mixed
$arrProxy  : mixed
$arrRequests  : mixed
$arrScreenResolutions  : mixed
$arrSearchTerms  : mixed
$arrSpiders  : mixed
$arrSupportJavaScript  : mixed
$arrTopReferer  : mixed
$arrVisitors  : mixed
$arrVisitorsDetails  : mixed
$browserSum  : mixed
$colourDepthSum  : mixed
$countriesSum  : mixed
$currentTime  : mixed
$hostnamesSum  : mixed
$md5Id  : mixed
$mostViewedPagesSum  : mixed
$operatingSystemsSum  : mixed
$pageTitle  : mixed
$pagingLimit  : mixed
$pagingLimitVisitorDetails  : mixed
$screenResolutionSum  : mixed
$spiderAgent  : mixed
$strErrMessage  : mixed
$strOkMessage  : mixed
$supportJavaScriptSum  : mixed
$totalRequests  : mixed
$totalVisitors  : mixed
$cx  : object
Instance of cloudrexx
$act  : mixed

Methods

__construct()  : mixed
constructor
_countSpider()  : bool
count every spider visit
_deleteStatistics()  : mixed
_getClientInfos()  : bool
Get client informations
_getProxyInformations()  : mixed
Get proxy informations
_getRequestedUrl()  : mixed
Get requested page
_initClientStatistics()  : mixed
_initConfiguration()  : mixed
Initialize the configuration for the counter and statistics
_initMostViewedPages()  : mixed
_initReferer()  : mixed
Init referer
_initSearchTerms()  : mixed
_initSpiders()  : mixed
_initStatisticsDays()  : mixed
_initStatisticsMonths()  : mixed
_initStatisticsToday()  : mixed
Initialize today statistics
_initStatisticsYears()  : mixed
_initVisitorDetails()  : mixed
_makePercentBar()  : string
return the image with the procentualy width or height
_removeOutdatedEntries()  : mixed
Remove outdated entries
_saveSettings()  : mixed
Save settings
_showClients()  : mixed
Show clients
_showMostViewedPages()  : mixed
Show most viewed pages
_showReferer()  : mixed
Show referer
_showRequests()  : mixed
Show requests
_showRequestsDays()  : mixed
Show requests days
_showRequestsMonths()  : mixed
Show requests months
_showRequestsToday()  : mixed
Show requests today
_showRequestsYears()  : mixed
Show requests years
_showSearchTerms()  : mixed
Show search terms
_showSettings()  : mixed
Show settings
_showSpiders()  : mixed
Show spiders
_showVisitorDetails()  : mixed
_xmlCountryEndTag()  : mixed
end element handler of the xml country parser
_xmlCountryStartTag()  : mixed
start element handler of the xml country parser
checkForSpider()  : mixed
Check if the user agent is a spider
getClientIp()  : string
Get the HTTP client's IP address
getContent()  : mixed
Get the content of the requested page
getCounterTag()  : string
Creates the tag to call the counter
getOnlineUsers()  : int
Get online users
getUniqueUserId()  : unique
Get unique user id
getVisitorNumber()  : mixed
Get visitor number
getChartJavascriptBy()  : string
Get javascript code for the jqplot chart.
getStatsDataBy()  : array<string|int, mixed>
Get hourly statistics data.
setNavigation()  : mixed
showVisitors()  : mixed

Properties

$arrColourDefinitions

public mixed $arrColourDefinitions = array('1' => 'TXT_MONOCHROME', '2' => 'TXT_CGA', '4' => 'TXT_VGA', '8' => 'TXT_SVGA', '15' => 'TXT_HIGH_COLOR', '16' => 'TXT_HIGH_COLOR', '24' => 'TXT_TRUE_COLOR', '32' => 'TXT_TRUE_COLOR_WITH_ALPHA_CHANNEL')

Methods

__construct()

constructor

public __construct() : mixed

global \Cx\Core\Html\Sigma global array

_countSpider()

count every spider visit

public _countSpider(mixed $useragent) : bool
Parameters
$useragent : mixed
Tags
global

ADONewConnection

integer

Return values
bool —

result

_getClientInfos()

Get client informations

public _getClientInfos() : bool

Get the clientinfos like useragent, langugage, ip, proxy, host and referer

Tags
see
_getProxyInformations()
_getReferer()
_checkForSpider()
Return values
bool —

result

_getProxyInformations()

Get proxy informations

public _getProxyInformations() : mixed

Collect proxy information, if available

_getRequestedUrl()

Get requested page

public _getRequestedUrl() : mixed

Get the requested page from the $_GET vars. If a session has started, this var will be blocked and not in the uri

_initConfiguration()

Initialize the configuration for the counter and statistics

public _initConfiguration() : mixed
Tags
global

ADONewConnection

_initReferer()

Init referer

public _initReferer() : mixed

Initialize the referer statistics

Tags
access

private

global

ADONewConnection

_initStatisticsToday()

Initialize today statistics

public _initStatisticsToday() : mixed

Initialize the visitor and request statistics from today

Tags
access

private

global

ADONewConnection

see
_removeOutdatedEntries()

_makePercentBar()

return the image with the procentualy width or height

public _makePercentBar(float $maxWidth, float $maxHeight, float $percWidth, float $percHeight, mixed $gif[, string $title = '' ]) : string
Parameters
$maxWidth : float

width if the image is 100% in widht

$maxHeight : float

height if the image is 100% in height

$percWidth : float

procentualy width

$percHeight : float

procentualy height

$gif : mixed
$title : string = ''

title and alternative text

Return values
string —

the path to the image with procentualy width and height

_removeOutdatedEntries()

Remove outdated entries

public _removeOutdatedEntries() : mixed

Remove outdated entries of the database

Tags
global

ADONewConnection

_saveSettings()

Save settings

public _saveSettings() : mixed

Save the statistic settings

Tags
access

private

global

ADONewConnection

see
_initConfiguration()

_showClients()

Show clients

public _showClients() : mixed

Show the statistics of the clients browser, operating system, javascript support, screen resolution and the colour depth

Tags
access

private

global

array

see
_initClientStatistics

_showMostViewedPages()

Show most viewed pages

public _showMostViewedPages() : mixed

Show a list of the most viewed pages

Tags
access

private

global

array

see
_initMostViewedPagesStatistics()

_showReferer()

Show referer

public _showReferer() : mixed

Show the last referers and the most referers

Tags
access

private

global

array

see
_initReferer()

_showRequests()

Show requests

public _showRequests() : mixed

Show the request statistics

Tags
access

private

global

array

see
_showRequestsToday()
_showRequestsDays()
_showRequestsMonths()
_showRequestsYears()
_showRequestsToday()

_showRequestsDays()

Show requests days

public _showRequestsDays() : mixed

Show the page requests and visitors of the days

Tags
access

private

see
_initStatisticsDays()
global

array

integer

_showRequestsMonths()

Show requests months

public _showRequestsMonths() : mixed

Show the page requests and visitors of the months

Tags
access

private

see
_initStatisticsMonths()
global

array

integer

_showRequestsToday()

Show requests today

public _showRequestsToday() : mixed

Show the page requests and visitors of today

Tags
access

private

see
_initStatisticsToday()
global

array

integer

_showRequestsYears()

Show requests years

public _showRequestsYears() : mixed

Show the page requests and visitors of the years

Tags
access

private

see
_initStatisticsYears()
global

array

integer

_showSearchTerms()

Show search terms

public _showSearchTerms() : mixed

Show the statistic of the search queries

Tags
access

private

global

array

see
_initSearchTerms()

_showSettings()

Show settings

public _showSettings() : mixed

Show the settings page

Tags
access

private

global

array

see
_saveSettings()

_showSpiders()

Show spiders

public _showSpiders() : mixed

Show a top list of the spiders that have indexed this webpage and a list of all websites that have been indexed by a spider

Tags
access

private

global

array

see
_initSpiders()

_showVisitorDetails()

public _showVisitorDetails() : mixed

_xmlCountryEndTag()

end element handler of the xml country parser

public _xmlCountryEndTag(mixed $parser, mixed $name) : mixed
Parameters
$parser : mixed
$name : mixed
Tags
access

private

todo

Remove unused argument $parser

_xmlCountryStartTag()

start element handler of the xml country parser

public _xmlCountryStartTag(mixed $parser, mixed $name, mixed $attrs) : mixed
Parameters
$parser : mixed
$name : mixed
$attrs : mixed
Tags
access

private

todo

Remove unused argument $parser

checkForSpider()

Check if the user agent is a spider

public checkForSpider() : mixed

getClientIp()

Get the HTTP client's IP address

public getClientIp() : string

IMPORTANT: Do not store the return value of this method in order to comply with the data privacy act GDPR! In case the client is connecting through a proxy, this method will try the fetch the client's original IP address and will return that one instead of the proxy's IP address.

Return values
string —

IP address of client

getContent()

Get the content of the requested page

public getContent() : mixed
Tags
access

public

global

\Cx\Core\Html\Sigma

see
showVisitors()
_showRequests()
_showReferer()
_showSpiders()
_showSearchTerms()
_showSettings()
Return values
mixed —

Template content

getCounterTag()

Creates the tag to call the counter

public getCounterTag() : string
Tags
access

public

global

integer $pageId

Return values
string —

$counterTag The counter tag

getOnlineUsers()

Get online users

public getOnlineUsers() : int

Get the number of the online users

Tags
access

public

global

ADONewConnection

Return values
int —

$onlineUsers

getUniqueUserId()

Get unique user id

public getUniqueUserId() : unique
Return values
unique —

user id as md5-string

getVisitorNumber()

Get visitor number

public getVisitorNumber() : mixed

Get the number of the current visitor

Tags
access

public

global

ADONewConnection

Return values
mixed —

visitor number on success, false on failure

getChartJavascriptBy()

Get javascript code for the jqplot chart.

protected getChartJavascriptBy(string $id, array<string|int, mixed> $data[, mixed $renderer = '' ]) : string
Parameters
$id : string
$data : array<string|int, mixed>
$renderer : mixed = ''
Return values
string —

$code

getStatsDataBy()

Get hourly statistics data.

protected getStatsDataBy(string $param) : array<string|int, mixed>
Parameters
$param : string

(hour, day, month or year)

Return values
array<string|int, mixed> —

array(ticks, dates, visitors, requests)

On this page

Search results