function logAccess() { global $c, $page; if ($c["pagetracking"]) { if ($c["usewebbug"]) { echo "<img src=\"" . $c["livedocroot"] . "sys/image.php?document=$page\" width=\"1\" height=\"1\">"; } else { include_once $c["path"].'modules/stats/phpOpenTracker.php'; phpOpenTracker::log(array('document' => $page)); } } }
header('Expires: Sat, 22 Apr 1978 02:19:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); require 'phpOpenTracker.php'; if (isset($_GET['document_url']) && !empty($_GET['document_url'])) { $parameters['document_url'] = base64_decode($_GET['document_url']); } else { if (isset($_SERVER['HTTP_REFERER'])) { $parameters['document_url'] = $_SERVER['HTTP_REFERER']; } } if (!isset($parameters['document_url'])) { exit; } if (isset($_GET['document']) && !empty($_GET['document'])) { $parameters['document'] = $_GET['document']; } else { $parameters['document'] = $parameters['document_url']; } $parameters['client_id'] = isset($_GET['client_id']) ? $_GET['client_id'] : 1; $parameters['referer'] = isset($_GET['referer']) ? base64_decode($_GET['referer']) : ''; if (isset($_GET['add_data']) && is_array($_GET['add_data'])) { foreach ($_GET['add_data'] as $data) { list($field, $value) = explode('::', $data); $parameters['add_data'][$field] = $value; } } phpOpenTracker::log($parameters); printf('%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%', 71, 73, 70, 56, 57, 97, 1, 0, 1, 0, 128, 255, 0, 192, 192, 192, 0, 0, 0, 33, 249, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59);
require_once $c["path"] . "config.inc.php"; } else { require_once "../cms/config.inc.php"; } include_once $c["path"] . "api/cds/track_exit_pages.php"; require_once $c["path"] . "api/cds/lib.inc.php"; // determine startpage and forward to startpage if no pageid isset. if (!isset($page)) { $page = value("page", "NUMERIC", -1); if ($page == -1 && !defined('ACCESS_CONTENT_ONLY')) { $forward = getStartPageURI(0, 10); if ($forward != "") { header("location: " . $forward); } } } if (!isset($article)) { $article = value("article", "NUMERIC"); } if (!isset($v)) { $v = value("variation", "NUMERIC", $c["stdvariation"]); } if ($c["pagetracking"] && !$c["usewebbug"]) { include_once $c["path"] . 'modules/stats/phpOpenTracker.php'; @phpOpenTracker::log(array('document' => $page)); } if (!(isset($disableCache) || isset($disableCaching))) { require_once $c["path"] . "ext/jpcache/jpcache.php"; } includePGNISources(); $cds = new CDSApi(false, $page, $v);
function opentrackerlog($logpath, $referer, $client_id) { // opentracker specific global $AR; // phpOpenTracker User Tracking require_once $AR->Stats->path; debug("mod_stats::opentrackerlog: logging {$logpath} to phpOpenTracker", "class"); // log the visitor if ($client_id != "") { debug("mod_stats::opentrackerlog: client_id = {$client_id}", "class"); @phpOpenTracker::log(array('document' => $logpath, 'referer' => $referer, 'client_id' => $client_id)); } else { debug("mod_stats::opentrackerlog: logging without client_id", "class"); @phpOpenTracker::log(array('document' => $logpath, 'referer' => $referer)); } // --- }
function event_hook($event, &$bag, &$eventData, $addData = null) { global $serendipity; $hooks =& $bag->get('event_hooks'); if (!isset($hooks[$event])) { return false; } $curr = $_SERVER['REQUEST_URI']; switch ($event) { case 'frontend_configure': // Quit if necessary if (preg_match(S9YPOT_EXCLPAT, $curr)) { return false; } // Now find out whether to use direct API call $path = $this->get_config('path'); if (!empty($path)) { ini_set("include_path", ini_get('include_path') . ":" . $path); if (@(include $this->get_config('fname'))) { phpOpenTracker::log(array('client_id' => $this->get_config('client_id'), 'document' => $curr)); #print("<!-- phpOpenTracker direct API call -->"); return true; } } // Use web bug $bugp = $this->get_config('bugpath'); if (!empty($bugp)) { print "<!-- Using phpOpenTracker web bug -->"; require_once S9Y_PEAR_PATH . 'Smarty/libs/' . 'Smarty.class.php'; $tpl = new Smarty(); $tpl->template_dir = dirname(__FILE__) . '/'; $tpl->compile_dir = PATH_SMARTY_COMPILE; $tpl->assign('client_id', $this->get_config('client_id')); $tpl->assign('webbugimageurl', $bugp); print $tpl->fetch('phpopentracker_webbug.js.tpl'); return true; } return false; break; default: return false; } }