[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_plugins/links_page/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/links_page/search/search_parser.php,v $
  14  |     $Revision: 1.2 $
  15  |     $Date: 2005/12/14 19:28:44 $
  16  |     $Author: sweetas $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  if (!defined('e107_INIT')) { exit; }
  21  
  22  // advanced 
  23  $advanced_where = "";
  24  if (isset($_GET['cat']) && is_numeric($_GET['cat'])) {
  25      $advanced_where .= " l.link_category='".$_GET['cat']."' AND";
  26  }
  27  
  28  if (isset($_GET['match']) && $_GET['match']) {
  29      $search_fields = array('l.link_name');
  30  } else {
  31      $search_fields = array('l.link_name', 'l.link_description');
  32  }
  33  
  34  // basic
  35  $return_fields = 'l.link_id, l.link_name, l.link_description, l.link_url, l.link_category, l.link_class, c.link_category_name';
  36  $weights = array('1.2', '0.6');
  37  $no_results = LAN_198;
  38  $where = "l.link_class IN (".USERCLASS_LIST.") AND".$advanced_where;
  39  $order = "";
  40  $table = "links_page AS l LEFT JOIN #links_page_cat AS c ON l.link_category = c.link_category_id";
  41  
  42  $ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_links', $no_results, $where, $order);
  43  $text .= $ps['text'];
  44  $results = $ps['results'];
  45  
  46  function search_links($row) {
  47      $res['link'] = e_PLUGIN."links_page/links.php?".$row['link_id'];
  48      $res['pre_title'] = $row['link_category_name']." | ";
  49      $res['title'] = $row['link_name'];
  50      $res['summary'] = $row['link_description'];
  51      $res['detail'] = "<a href='".e_PLUGIN."links_page/links.php?".$row['link_id']."'>".$row['link_url']."</a>";
  52      return $res;
  53  }
  54  
  55  ?>


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