[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/search/ -> stats.php (source)

   1  <?php
   2  //
   3  // Created on: <08-Aug-2002 14:04:07 bf>
   4  //
   5  // SOFTWARE NAME: eZ publish
   6  // SOFTWARE RELEASE: 3.9.0
   7  // BUILD VERSION: 17785
   8  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
   9  // SOFTWARE LICENSE: GNU General Public License v2.0
  10  // NOTICE: >
  11  //   This program is free software; you can redistribute it and/or
  12  //   modify it under the terms of version 2.0  of the GNU General
  13  //   Public License as published by the Free Software Foundation.
  14  //
  15  //   This program is distributed in the hope that it will be useful,
  16  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  //   GNU General Public License for more details.
  19  //
  20  //   You should have received a copy of version 2.0 of the GNU General
  21  //   Public License along with this program; if not, write to the Free
  22  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23  //   MA 02110-1301, USA.
  24  //
  25  //
  26  
  27  include_once ( "lib/ezutils/classes/ezhttptool.php" );
  28  include_once ( "kernel/common/template.php" );
  29  include_once ( "kernel/classes/ezsearchlog.php" );
  30  include_once ( "kernel/classes/ezpreferences.php" );
  31  
  32  if ( eZPreferences::value( 'admin_search_stats_limit' ) )
  33  {
  34      switch ( eZPreferences::value( 'admin_search_stats_limit' ) )
  35      {
  36          case '2': { $limit = 25; } break;
  37          case '3': { $limit = 50; } break;
  38          default:  { $limit = 10; } break;
  39      }
  40  }
  41  else
  42  {
  43      $limit = 10;
  44  }
  45  
  46  $offset = $Params['Offset'];
  47  if ( !is_numeric( $offset ) )
  48  {
  49      $offset = 0;
  50  }
  51  
  52  $http =& eZHTTPTool::instance();
  53  $module =& $Params["Module"];
  54  
  55  if ( $module->isCurrentAction( 'ResetSearchStats' ) )
  56  {
  57      eZSearchLog::removeStatistics();
  58  }
  59  
  60  $viewParameters = array( 'offset' => $offset, 'limit'  => $limit );
  61  $tpl =& templateInit();
  62  
  63  $db =& eZDB::instance();
  64  $query = "SELECT count(*) as count FROM ezsearch_search_phrase";
  65  $searchListCount = $db->arrayQuery( $query );
  66  
  67  $mostFrequentPhraseArray =& eZSearchLog::mostFrequentPhraseArray( $viewParameters );
  68  
  69  $tpl->setVariable( "view_parameters", $viewParameters );
  70  $tpl->setVariable( "most_frequent_phrase_array", $mostFrequentPhraseArray );
  71  $tpl->setVariable( "search_list_count", $searchListCount[0]['count'] );
  72  
  73  $Result = array();
  74  $Result['content'] =& $tpl->fetch( "design:search/stats.tpl" );
  75  $Result['path'] = array( array( 'text' => ezi18n( 'kernel/search', 'Search stats' ),
  76                                  'url' => false ) );
  77  
  78  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7