Где здесь что поменять?
Код: Выделить всё
case "search":
$term = utf8_normalize_nfc(request_var('stext', '', true));
$prefix_id = request_var('sprefix', 0);
$category_id = request_var('scategory', 0);
$location_id = request_var('slocation', 0);
$only_active = request_var('sactive', 0);
$order = request_var('sorder', '');
$order_type = request_var('sordertype', '');
$searchterm = '*' . strtolower($term) . '*';
if ($searchterm != '**')
{
$searchterm = str_replace('*', $db->any_char , $searchterm);
$searchterm = str_replace('?', $db->one_char , $searchterm);
}
$sql_where = 'a.ad_expire > ' . $now . '';
$sql_where .= ($term != '') ? ' AND ( LOWER(a.ad_description) ' . $db->sql_like_expression($searchterm) . ' OR LOWER(a.ad_title) ' . $db->sql_like_expression($searchterm) . ' OR LOWER(a.short_desc) ' . $db->sql_like_expression($searchterm) . ')' : '';
$sql_where .= ($prefix_id != 0) ? ' AND a.ad_prefix_id = ' . $prefix_id . '' : '';
$sql_where .= ($location_id != 0) ? ' AND a.ad_location_id = ' . $location_id . '' : '';
$sql_where .= ($category_id != 0) ? ' AND a.cat_id = ' . $category_id . '' : '';
$sql_where .= ($only_active != 0) ? ' AND a.ad_status = ' . ACTIVE . '' : '';
if ($order == 'time' && $order_type != '')
{
$sql_order = ($order_type == 'desc') ? 'a.ad_date DESC' : 'a.ad_date ASC';
}
elseif ($order == 'views' && $order_type != '')
{
$sql_order = ($order_type == 'desc') ? 'a.ad_views DESC' : 'a.ad_views ASC';
}
elseif ($order == 'price' && $order_type != '')
{
$sql_order = ($order_type == 'desc') ? 'a.ad_price DESC' : 'a.ad_price ASC';
}
elseif ($order == '' || $order_type == '')
{
$sql_order = 'a.ad_date DESC';
}
$sql_ary['WHERE'] = $sql_where;
$sql_ary['ORDER_BY'] = $sql_order;
$template->assign_vars(array(
'STEXT' => $term,
'SPREFIX' => $prefix_id,
'SCATEGORY' => $category_id,
'SLOCATION' => $location_id,
'SACTIVE' => $only_active,
'SORDER' => $order,
'SORDERTYPE' => $order_type,
));
$pagination_url = append_sid("{$phpbb_root_path}".CL_DIRECTORY."/index.{$phpEx}", 'mode=search&stext='.$term.'&sprefix='.$prefix_id.'&slocation='.$location_id.'&sactive='.$only_active.'&scategory='.$category_id.'&sorder='.$order.'&sordertype='.$order_type);
$classifieds_title = ($term != '') ? $user->lang['CL_SEARCH_RESULTS'].' '.$user->lang['CL_FOR'].' "'.$term.'"' : $user->lang['CL_SEARCH_RESULTS'];
break;