search
[ class tree: search ] [ index: search ] [ all elements ]

Source for file stats.php

Documentation is available at stats.php

  1. <?php
  2. /**
  3.  * $Header$
  4.  *
  5.  * @copyright (c) 2004 bitweaver.org
  6.  *  Copyright (c) 2003 tikwiki.org
  7.  *  Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  *  All Rights Reserved. See below for details and a complete list of authors.
  9.  *  Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  10.  *
  11.  *  $Id$
  12.  * @author  Luis Argerich (lrargerich@yahoo.com)
  13.  * @package search
  14.  * @subpackage functions
  15.  */
  16.  
  17. /**
  18.  * requires setup
  19.  */
  20. require_once'../kernel/setup_inc.php' );
  21.  
  22. include_onceSEARCH_PKG_PATH.'searchstats_lib.php');
  23.  
  24. $gBitSystem->verifyFeature'search_stats' );
  25. $gBitSystem->verifyPermission'p_admin' );
  26.  
  27. if (isset($_REQUEST["clear"])) {
  28.     $searchstatslib->clear_search_stats();
  29. }
  30.  
  31. if empty$_REQUEST["sort_mode") ) {
  32.     $sort_mode 'hits_desc';
  33. else {
  34.     $sort_mode $_REQUEST["sort_mode"];
  35. }
  36.  
  37. if (!isset($_REQUEST["offset"])) {
  38.     $offset 0;
  39. else {
  40.     $offset $_REQUEST["offset"];
  41. }
  42. if (isset($_REQUEST['page'])) {
  43.     $page &$_REQUEST['page'];
  44.     $offset ($page 1$max_records;
  45. }
  46. $gBitSmarty->assign_by_ref('offset'$offset);
  47.  
  48. if (isset($_REQUEST["find"])) {
  49.     $find $_REQUEST["find"];
  50. else {
  51.     $find '';
  52. }
  53.  
  54. $gBitSmarty->assign('find'$find);
  55.  
  56. $gBitSmarty->assign_by_ref('sort_mode'$sort_mode);
  57. $channels $searchstatslib->list_search_stats($offset$max_records$sort_mode$find);
  58.  
  59. $cant_pages ceil($channels["cant"$max_records);
  60. $gBitSmarty->assign_by_ref('cant_pages'$cant_pages);
  61. $gBitSmarty->assign('actual_page'($offset $max_records));
  62.  
  63. if ($channels["cant"($offset $max_records)) {
  64.     $gBitSmarty->assign('next_offset'$offset $max_records);
  65. else {
  66.     $gBitSmarty->assign('next_offset'-1);
  67. }
  68.  
  69. // If offset is > 0 then prev_offset
  70. if ($offset 0{
  71.     $gBitSmarty->assign('prev_offset'$offset $max_records);
  72. else {
  73.     $gBitSmarty->assign('prev_offset'-1);
  74. }
  75.  
  76. $gBitSmarty->assign_by_ref('channels'$channels["data"]);
  77.  
  78.  
  79.  
  80. // Display the template
  81. $gBitSystem->display'bitpackage:stats/search_stats.tpl'NULLarray'display_mode' => 'display' ));
  82.  
  83. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:28 +0000 by phpDocumentor 1.5.0-lsces