tiki-search_stats.php 1.6 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
// 
4 5
// 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.
changi67's avatar
changi67 committed
6
// $Id: /cvsroot/tikiwiki/tiki/tiki-search_stats.php,v 1.14 2007-10-12 07:55:32 nyloth Exp $
7 8
require_once ('tiki-setup.php');
include_once ('lib/search/searchstatslib.php');
9
if ($prefs['feature_search_stats'] != 'y') {
changi67's avatar
changi67 committed
10
	$smarty->assign('msg', tra("This feature is disabled") . ": feature_search_stats");
11
	$smarty->display("error.tpl");
12
	die;
13
}
14
if ($tiki_p_admin != 'y') {
15
	$smarty->assign('errortype', 401);
16
	$smarty->assign('msg', tra("You do not have permission to use this feature"));
17
	$smarty->display("error.tpl");
18 19 20
	die;
}
if (isset($_REQUEST["clear"])) {
21
	check_ticket('search-stats');
22 23 24 25
	$searchstatslib->clear_search_stats();
}
if (!isset($_REQUEST["sort_mode"])) {
	$sort_mode = 'hits_desc';
26
} else {
27
	$sort_mode = $_REQUEST["sort_mode"];
28
}
29 30
if (!isset($_REQUEST["offset"])) {
	$offset = 0;
31
} else {
32
	$offset = $_REQUEST["offset"];
33
}
34 35 36 37 38 39 40 41 42
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
	$find = $_REQUEST["find"];
} else {
	$find = '';
}
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $searchstatslib->list_search_stats($offset, $maxRecords, $sort_mode, $find);
43
$smarty->assign_by_ref('cant_pages', $channels["cant"]);
44
$smarty->assign_by_ref('channels', $channels["data"]);
45
ask_ticket('search-stats');
46
// Display the template
47
$smarty->assign('mid', 'tiki-search_stats.tpl');
48
$smarty->display("tiki.tpl");