[ Index ] |
|
Code source de e107 0.7.8 |
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_handlers/search/search_comment.php,v $ 14 | $Revision: 1.10 $ 15 | $Date: 2006/11/17 14:49:23 $ 16 | $Author: sweetas $ 17 +----------------------------------------------------------------------------+ 18 */ 19 20 if (!defined('e107_INIT')) { exit; } 21 22 // advanced 23 $advanced_where = ""; 24 if (isset($_GET['type']) && $_GET['type'] != 'all') { 25 $advanced_where .= " c.comment_type='".(str_replace('s_', '', $tp -> toDB($_GET['type'])))."' AND"; 26 } 27 28 if (isset($_GET['time']) && is_numeric($_GET['time'])) { 29 $advanced_where .= " c.comment_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND"; 30 } 31 32 if (isset($_GET['author']) && $_GET['author'] != '') { 33 $advanced_where .= " c.comment_author LIKE '%".$tp -> toDB($_GET['author'])."%' AND"; 34 } 35 36 //basic 37 $return_fields = 'c.comment_item_id, c.comment_author, c.comment_datestamp, c.comment_comment, c.comment_type'; 38 39 foreach ($search_prefs['comments_handlers'] as $h_key => $value) { 40 if (check_class($value['class'])) { 41 $path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$h_key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php'; 42 if (is_readable($path)) { 43 require_once($path); 44 $in[] = "'".$value['id']."'"; 45 $join[] = $comments_table[$h_key]; 46 $return_fields .= ', '.$comments_return[$h_key]; 47 } 48 49 } 50 } 51 52 $search_fields = array('c.comment_comment', 'c.comment_author'); 53 $weights = array('1.2', '0.6'); 54 $no_results = LAN_198; 55 $where = "comment_type IN (".implode(',', $in).") AND".$advanced_where; 56 $order = array('comment_datestamp' => DESC); 57 $table = "comments AS c ".implode(' ', $join); 58 59 $ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_comment', $no_results, $where, $order); 60 $text .= $ps['text']; 61 $results = $ps['results']; 62 63 function search_comment($row) { 64 if (is_callable('com_search_'.$row['comment_type'])) { 65 $res = call_user_func('com_search_'.$row['comment_type'], $row); 66 return $res; 67 } 68 } 69 70 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |