本文整理汇总了PHP中search::searchQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP search::searchQuery方法的具体用法?PHP search::searchQuery怎么用?PHP search::searchQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::searchQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
!isset($_GET[$key]) ? $errToken = true : null;
}
if ($errToken) {
$arrErrors[] = ERROR_SEARCH_NONE_REQUIRED_FIELDS;
} elseif ('vacancy' !== $_GET['base'] && 'resume' !== $_GET['base'] || 'exact' !== $_GET['type'] && 'any' !== $_GET['type']) {
$arrErrors[] = ERROR_SEARCH_INCORRECT_DATA;
}
if (!$arrErrors) {
// создаем объект
$search = new search(strtolower($_GET['base']));
$arrFields = array('q' => $search->decodeSearchString($_GET['q']), 'base' => strtolower($_GET['base']), 'type' => strtolower($_GET['type']), 'id_section' => validate::checkNaturalNumber($_GET['id_section']), 'id_profession' => validate::checkNaturalNumber($_GET['id_profession']), 'id_region' => validate::checkNaturalNumber($_GET['id_region']), 'id_city' => validate::checkNaturalNumber($_GET['id_city']), 'pay_from' => validate::checkNaturalNumber($_GET['pay_from']), 'currency' => in_array($_GET['currency'], $arrSysDict['Currency']['values']) ? $_GET['currency'] : false, 'period' => array_key_exists($_GET['period'], $arrSysDict['SearchPeriod']['values']) ? $_GET['period'] : 0, 'records' => in_array($_GET['records'], $arrSysDict['AnnounceRecords']['values']) ? $_GET['records'] : 5);
// смещение, всегда 0 (затем берется из $_GET)
$offset = !empty($_GET['offset']) && validate::checkNaturalNumber($_GET['offset']) ? validate::checkNaturalNumber($_GET['offset']) : 0;
//смещение, всегда
// производим поиск
$arrData = $search->searchQuery($arrFields + array('offset' => $offset));
// формируем ссылку
$path = 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=search&q=' . $arrFields['q'] . '&base=' . $arrFields['base'] . '&type=' . $arrFields['type'] . '&id_section=' . $arrFields['id_section'] . '&id_profession=' . $arrFields['id_profession'] . '&id_region=' . $arrFields['id_region'] . '&id_city=' . $arrFields['id_city'] . '&pay_from=' . $arrFields['pay_from'] . '&currency=' . $arrFields['currency'] . '&period=' . $arrFields['period'] . '&records=' . $arrFields['records'] . '&';
// формируем странциы
$strPages = strings::generatePage($arrData['records'], $offset, $arrFields['records'], $path, true);
// передаем в шаблон необходимые данные
$smarty->assign('link', CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=' . $arrFields['base'] . '&action=view&id=');
$smarty->assignByRef('return_data', $arrData['result']);
$smarty->assignByRef('find', $arrData['records']);
$smarty->assignByRef('time', $arrData['time']);
$smarty->assign('template', $arrFields['base'] . '.view.short.tpl');
$smarty->assignByRef('string_page', $strPages);
}
}
// передаем массив селекта "Валюты"
//$smarty->assignByRef('currency', $arrSysDict['Currency']['values']);
示例2: trim
if (($row['tmp_time'] > $time) && ($row['tmp_info'] != 'type_search '.$query_check)) {
$perform_search = false;
$SEARCH_VARS->SEARCH_MESSAGE = LAN_SEARCH_17.$search_prefs['time_secs'].LAN_SEARCH_18;
} else {
$sql -> db_Update("tmp", "tmp_time='".time()."', tmp_info='type_search ".$query_check."' WHERE tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'");
}
} else {
$sql -> db_Insert("tmp", "'".$ip."', '".time()."', 'type_search ".$query_check."'");
}
}
if ($perform_search) {
$result_flag = $_GET['r'];
}
$query = trim($full_query);
}*/
$query = $srchObj->searchQuery();
// forward user if searching in google
$search_count = count($search_info);
$google_id = $search_count + 1;
if ($perform_search) {
if ($search_prefs['selector'] == 1) {
// Care needed - with alpha strings on search of single area $_GET['t'][$google_id] returns a character on page > 1
if (isset($_GET['t'][$google_id]) && $_GET['t'] == $google_id && $_GET['t'][$google_id]) {
// echo "We think google should be used using checkboxes<br />";
header("location:http://www.google.com/search?q=" . stripslashes(str_replace(" ", "+", $query)));
exit;
}
} else {
if (isset($_GET['t']) && $_GET['t'] == $google_id) {
header("location:http://www.google.com/search?q=" . stripslashes(str_replace(" ", "+", $query)));
exit;