tiki-referer_stats.php 1.3 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
6
// 
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9
// $Id$
changi67's avatar
changi67 committed
10

11 12
require_once ('tiki-setup.php');
include_once ('lib/refererstats/refererlib.php');
13 14 15
$access->check_feature('feature_referer_stats');
$access->check_permission('tiki_p_view_referer_stats');

16
if (isset($_REQUEST["clear"])) {
17 18
	$access->check_authenticity();
	$refererlib->clear_referer_stats();
19
}
20 21
if (!isset($_REQUEST["sort_mode"])) {
	$sort_mode = 'hits_desc';
22
} else {
23 24 25 26
	$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
	$offset = 0;
27
} else {
28
	$offset = $_REQUEST["offset"];
29
}
30 31 32
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
	$find = $_REQUEST["find"];
33
} else {
34
	$find = '';
35
}
36 37 38
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $refererlib->list_referer_stats($offset, $maxRecords, $sort_mode, $find);
39
$smarty->assign_by_ref('cant_pages', $channels["cant"]);
40
$smarty->assign_by_ref('channels', $channels["data"]);
41
ask_ticket('referer-stats');
42
// Display the template
43
$smarty->assign('mid', 'tiki-referer_stats.tpl');
44
$smarty->display("tiki.tpl");