[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/sessions/views/ -> _stats_refsearches.view.php (source)

   1  <?php
   2  /**

   3   * This file implements the UI view for the referering searches stats.

   4   *

   5   * This file is part of the evoCore framework - {@link http://evocore.net/}

   6   * See also {@link http://sourceforge.net/projects/evocms/}.

   7   *

   8   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}

   9   *

  10   * {@internal License choice

  11   * - If you have received this file as part of a package, please find the license.txt file in

  12   *   the same folder or the closest folder above for complete license terms.

  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)

  14   *   then you must choose one of the following licenses before using the file:

  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php

  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php

  17   * }}

  18   *

  19   * {@internal Open Source relicensing agreement:

  20   * }}

  21   *

  22   * @package admin

  23   *

  24   * @version $Id: _stats_refsearches.view.php,v 1.1 2007/06/25 11:01:05 fplanque Exp $

  25   */
  26  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  27  
  28  /**

  29   * View funcs

  30   */
  31  require_once dirname(__FILE__).'/_stats_view.funcs.php';
  32  
  33  
  34  global $blog, $admin_url, $rsc_url;
  35  
  36  echo '<h2>'.T_('Search browser hits').':</h2>';
  37  
  38  echo '<p>'.T_('These are hits from people who came to this blog system through a search engine. (Search engines must be listed in /conf/_stats.php)').'</p>';
  39  
  40  // Create result set:

  41  $Results = & new Results( "
  42            SELECT hit_ID, hit_datetime, hit_referer, dom_name, hit_blog_ID, hit_uri, hit_remote_addr, blog_shortname
  43                FROM T_hitlog INNER JOIN T_basedomains ON dom_ID = hit_referer_dom_ID
  44                        INNER JOIN T_useragents ON hit_agnt_ID = agnt_ID
  45                        LEFT JOIN T_blogs ON hit_blog_ID = blog_ID
  46            WHERE hit_referer_type = 'search'
  47                           AND agnt_type = 'browser'"
  48          .( empty($blog) ? '' : "AND hit_blog_ID = $blog " ), 'lstsrch', 'D' );
  49  
  50  $Results->title = T_('Search browser hits');
  51  
  52  // datetime:

  53  $Results->cols[0] = array(
  54          'th' => T_('Date Time'),
  55          'order' => 'hit_datetime',
  56          'td_class' => 'timestamp',
  57          'td' => '%mysql2localedatetime_spans( \'$hit_datetime$\' )%',
  58      );
  59  
  60  // Referer:

  61  $Results->cols[1] = array(
  62          'th' => T_('Referer'),
  63          'order' => 'dom_name',
  64          'td_class' => 'nowrap',
  65      );
  66  if( $current_User->check_perm( 'stats', 'edit' ) )
  67  {
  68      $Results->cols[1]['td'] = '<a href="%regenerate_url( \'action\', \'action=delete&amp;hit_ID=$hit_ID$\')%" title="'
  69              .T_('Delete this hit!').'">'.get_icon('delete').'</a> '
  70              .'<a href="$hit_referer$">$dom_name$</a>';
  71  }
  72  else
  73  {
  74      $Results->cols[1]['td'] = '<a href="$hit_referer$">$dom_name$</a>';
  75  }
  76  
  77  // Keywords:

  78  $Results->cols[] = array(
  79          'th' => T_('Search keywords'),
  80          'td' => '%stats_search_keywords( #hit_referer# )%',
  81      );
  82  
  83  // Target Blog:

  84  if( empty($blog) )
  85  {
  86      $Results->cols[] = array(
  87              'th' => T_('Target Blog'),
  88              'order' => 'hit_blog_ID',
  89              'td' => '$blog_shortname$',
  90          );
  91  }
  92  
  93  // Requested URI (linked to blog's baseurlroot+URI):

  94  $Results->cols[] = array(
  95          'th' => T_('Requested URI'),
  96          'order' => 'hit_uri',
  97          'td' => '%stats_format_req_URI( #hit_blog_ID#, #hit_uri# )%',
  98      );
  99  
 100  // Remote address (IP):

 101  $Results->cols[] = array(
 102          'th' => '<span title="'.T_('Remote address').'">'.T_('IP').'</span>',
 103          'order' => 'hit_remote_addr',
 104          'td' => '% $GLOBALS[\'Plugins\']->get_trigger_event( \'FilterIpAddress\', $tmp_params = array(\'format\'=>\'htmlbody\', \'data\'=>\'$hit_remote_addr$\') ) %',
 105      );
 106  
 107  // Display results:

 108  $Results->display();
 109  
 110  
 111  
 112  // TOP REFERING SEARCH ENGINES

 113  ?>
 114  
 115  <h3><?php echo T_('Top refering search engines') ?>:</h3>
 116  
 117  <?php
 118  global $res_stats, $row_stats;
 119  refererList(20,'global',0,0,"'search'",'dom_name',$blog,true);
 120  if( count( $res_stats ) )
 121  {
 122      ?>
 123      <table class="grouped" cellspacing="0">
 124          <?php
 125          $count = 0;
 126          foreach( $res_stats as $row_stats )
 127          {
 128              ?>
 129              <tr <?php if( $count%2 == 1 ) echo 'class="odd"'; ?>>
 130                  <td class="firstcol"><a href="<?php stats_referer() ?>"><?php stats_basedomain() ?></a></td>
 131                  <td class="right"><?php stats_hit_count() ?></td>
 132                  <td class="right"><?php stats_hit_percent() ?></td>
 133              </tr>
 134          <?php
 135          $count++;
 136          }
 137          ?>
 138      </table>
 139  <?php
 140  }
 141  
 142  
 143  /*

 144   * $Log: _stats_refsearches.view.php,v $

 145   * Revision 1.1  2007/06/25 11:01:05  fplanque

 146   * MODULES (refactored MVC)

 147   *

 148   * Revision 1.7  2007/04/26 00:11:13  fplanque

 149   * (c) 2007

 150   *

 151   * Revision 1.6  2007/03/20 09:53:26  fplanque

 152   * Letting boggers view their own stats.

 153   * + Letthing admins view the aggregate by default.

 154   *

 155   * Revision 1.5  2006/11/26 01:42:10  fplanque

 156   * doc

 157   */
 158  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics