1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-07 07:47:59 +01:00
php-e107/e107_handlers/search/search_pages.php

52 lines
1.6 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <EFBFBD>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/search/search_pages.php,v $
| $Revision: 1.4 $
| $Date: 2008-02-16 21:24:49 $
2007-11-04 20:41:41 +00:00
| $Author: e107steved $
2006-12-02 04:36:16 +00:00
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// advanced
$advanced_where = "";
if (isset($_GET['time']) && is_numeric($_GET['time'])) {
$advanced_where .= " page_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
}
// basic
$return_fields = 'page_id, page_title, page_text, page_datestamp';
$search_fields = array('page_title', 'page_text');
$weights = array('1.2', '0.6');
$no_results = LAN_198;
$where = "page_class IN (".USERCLASS_LIST.") AND `page_theme` = '' AND".$advanced_where;
2006-12-02 04:36:16 +00:00
$order = array('page_datestamp' => DESC);
$table = "page";
$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_pages', $no_results, $where, $order);
$text .= $ps['text'];
$results = $ps['results'];
function search_pages($row) {
global $con;
$res['link'] = "page.php?".$row['page_id'];
$res['pre_title'] = "";
$res['title'] = $row['page_title'];
$res['summary'] = $row['page_text'];
$res['detail'] = LAN_SEARCH_3.$con -> convert_date($row['page_datestamp'], "long");
return $res;
}
?>