Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (30 sloc) 1.08 KB
<?php
/**
* Plures Multi Website Analytics (Main file)
*
* @version 1.3
* @author João Ferreira <jflei@sapo.pt>
* @copyright (c) 2017, João Ferreira
*/
error_reporting(E_ALL);
# Include database connection details / Advanced Settings
include_once rtrim(__DIR__, '/') . '/includes/plures.settings.php';
# Include functions file
include_once rtrim(__DIR__, '/') . '/includes/plures.functions.php';
# Autoload classes
function my_autoloader($class_name) {
$target_file = strtolower(str_replace('Plures', '', $class_name));
include_once rtrim(__DIR__, '/') . '/includes/plures.' . $target_file . '.class.php';
}
spl_autoload_register('my_autoloader');
# Initiate session to store unique visits and form messages
session_start();
# Initiate database class
$pl_mysqli = new PluresMysqlDb();
# Initiate Analytics class
$pl_analytics = new PluresAnalytics($pl_mysqli);
# Check if site_code GET parameter exists (remote javascript call), if yes, count analytics, if not, skip (php tracking codes already call the counter directly)
if(pl_my_get('site_code')) {
$pl_analytics->count();
}
?>