[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_plugins/chatbox_menu/search/ -> search_parser.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/search/search_parser.php,v $
  14  |     $Revision: 1.3 $
  15  |     $Date: 2006/01/05 09:06:46 $
  16  |     $Author: sweetas $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  if (!defined('e107_INIT')) { exit; }
  21  
  22  $cb_count =  $sql -> db_Count('chatbox');
  23  
  24  // advanced 
  25  $advanced_where = "";
  26  if (isset($_GET['time']) && is_numeric($_GET['time'])) {
  27      $advanced_where .= " cb_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
  28  }
  29  
  30  if (isset($_GET['author']) && $_GET['author'] != '') {
  31      $advanced_where .= " cb_nick LIKE '%".$tp -> toDB($_GET['author'])."%' AND";
  32  }
  33  
  34  // basic
  35  $return_fields = 'cb_id, cb_nick, cb_message, cb_datestamp';
  36  $search_fields = array('cb_nick', 'cb_message');
  37  $weights = array('1', '1');
  38  $no_results = LAN_198;
  39  $where = $advanced_where;
  40  $order = array('cb_datestamp' => DESC);
  41  
  42  $ps = $sch -> parsesearch('chatbox', $return_fields, $search_fields, $weights, 'search_chatbox', $no_results, $where, $order);
  43  $text .= $ps['text'];
  44  $results = $ps['results'];
  45  
  46  function search_chatbox($row) {
  47      global $con, $cb_count;
  48      preg_match("/([0-9]+)\.(.*)/", $row['cb_nick'], $user);
  49      $res['link'] = e_PLUGIN."chatbox_menu/chat.php?".$row['cb_id'].".fs";
  50      $res['pre_title'] = LAN_SEARCH_7;
  51      $res['title'] = $user[2];
  52      $res['summary'] = $row['cb_message'];
  53      $res['detail'] = $con -> convert_date($row['cb_datestamp'], "long");
  54      return $res;
  55  }
  56  
  57  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7