1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8if (basename($_SERVER['SCRIPT_NAME']) === basename(__FILE__)) {
9	die('This script may only be included.');
10}
11
12if ($prefs['feature_referer_stats'] == 'y') {
13	if (isset($_SERVER['HTTP_REFERER'])) {
14		$pref = parse_url($_SERVER['HTTP_REFERER']);
15		if (isset($pref['host']) && ! strstr($_SERVER['SERVER_NAME'], $pref['host'])) {
16			$tikilib->register_referer($pref['host'], $_SERVER['HTTP_REFERER']);
17		}
18	}
19}
20
21if (StatsLib::is_stats_hit()) {
22	if (! isset($section) or ( $section != 'chat' and $section != 'livesupport' )) {
23		$statslib = TikiLib::lib('stats');
24		$statslib->add_pageview();
25	}
26}
27