本文整理汇总了PHP中Search::getAllowedTypesForSorting方法的典型用法代码示例。如果您正苦于以下问题:PHP Search::getAllowedTypesForSorting方法的具体用法?PHP Search::getAllowedTypesForSorting怎么用?PHP Search::getAllowedTypesForSorting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search::getAllowedTypesForSorting方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doModel
//.........这里部分代码省略.........
if ($p_sCountry == '') {
$p_sCountry = array();
} else {
$p_sCountry = explode(",", $p_sCountry);
}
}
$p_sUser = Params::getParam('sUser');
if (!is_array($p_sUser)) {
if ($p_sUser == '') {
$p_sUser = '';
} else {
$p_sUser = explode(",", $p_sUser);
}
}
$p_sPattern = strip_tags(Params::getParam('sPattern'));
// ADD TO THE LIST OF LAST SEARCHES
if (osc_save_latest_searches()) {
if (trim($p_sPattern) != '') {
LatestSearches::newInstance()->insert(array('s_search' => trim($p_sPattern), 'd_date' => date('Y-m-d H:i:s')));
}
}
$p_bPic = Params::getParam('bPic');
$p_bPic == 1 ? $p_bPic = 1 : ($p_bPic = 0);
$p_sPriceMin = Params::getParam('sPriceMin');
$p_sPriceMax = Params::getParam('sPriceMax');
//WE CAN ONLY USE THE FIELDS RETURNED BY Search::getAllowedColumnsForSorting()
$p_sOrder = Params::getParam('sOrder');
if (!in_array($p_sOrder, Search::getAllowedColumnsForSorting())) {
$p_sOrder = osc_default_order_field_at_search();
}
$old_order = $p_sOrder;
//ONLY 0 ( => 'asc' ), 1 ( => 'desc' ) AS ALLOWED VALUES
$p_iOrderType = Params::getParam('iOrderType');
$allowedTypesForSorting = Search::getAllowedTypesForSorting();
$orderType = osc_default_order_type_at_search();
foreach ($allowedTypesForSorting as $k => $v) {
if ($p_iOrderType == $v) {
$orderType = $k;
break;
}
}
$p_iOrderType = $orderType;
$p_sFeed = Params::getParam('sFeed');
$p_iPage = 0;
if (is_numeric(Params::getParam('iPage')) && Params::getParam('iPage') > 0) {
$p_iPage = intval(Params::getParam('iPage')) - 1;
}
if ($p_sFeed != '') {
$p_sPageSize = 1000;
}
$p_sShowAs = Params::getParam('sShowAs');
$aValidShowAsValues = array('list', 'gallery');
if (!in_array($p_sShowAs, $aValidShowAsValues)) {
$p_sShowAs = osc_default_show_as_at_search();
}
// search results: it's blocked with the maxResultsPerPage@search defined in t_preferences
$p_iPageSize = intval(Params::getParam('iPagesize'));
if ($p_iPageSize > 0) {
if ($p_iPageSize > osc_max_results_per_page_at_search()) {
$p_iPageSize = osc_max_results_per_page_at_search();
}
} else {
$p_iPageSize = osc_default_results_per_page_at_search();
}
//FILTERING CATEGORY
$bAllCategoriesChecked = false;
示例2: _e
_e('Advanced Search', OSCLASSWIZARDS_THEME_FOLDER);
?>
</h2>
<section>
<div class="filters">
<form action="<?php
echo osc_base_url(true);
?>
" method="get" class="nocsrf">
<input type="hidden" name="page" value="search"/>
<input type="hidden" name="sOrder" value="<?php
echo osc_search_order();
?>
" />
<input type="hidden" name="iOrderType" value="<?php
$allowedTypesForSorting = Search::getAllowedTypesForSorting();
echo $allowedTypesForSorting[osc_search_order_type()];
?>
" />
<?php
foreach (osc_search_user() as $userId) {
?>
<input type="hidden" name="sUser[]" value="<?php
echo $userId;
?>
"/>
<?php
}
?>
<fieldset class="first">
<h3>
示例3: doModel
function doModel()
{
osc_run_hook('before_search');
$mCategories = new Category();
////////////////////////////////
//GETTING AND FIXING SENT DATA//
////////////////////////////////
$p_sCategory = Params::getParam('sCategory');
if (!is_array($p_sCategory)) {
if ($p_sCategory == '') {
$p_sCategory = array();
} else {
$p_sCategory = explode(",", $p_sCategory);
}
}
$p_sCityArea = Params::getParam('sCityArea');
if (!is_array($p_sCityArea)) {
if ($p_sCityArea == '') {
$p_sCityArea = array();
} else {
$p_sCityArea = explode(",", $p_sCityArea);
}
}
$p_sCity = Params::getParam('sCity');
if (!is_array($p_sCity)) {
if ($p_sCity == '') {
$p_sCity = array();
} else {
$p_sCity = explode(",", $p_sCity);
}
}
$p_sRegion = Params::getParam('sRegion');
if (!is_array($p_sRegion)) {
if ($p_sRegion == '') {
$p_sRegion = array();
} else {
$p_sRegion = explode(",", $p_sRegion);
}
}
$p_sCountry = Params::getParam('sCountry');
if (!is_array($p_sCountry)) {
if ($p_sCountry == '') {
$p_sCountry = array();
} else {
$p_sCountry = explode(",", $p_sCountry);
}
}
$p_sPattern = strip_tags(Params::getParam('sPattern'));
$p_sUser = strip_tags(Params::getParam('sUser'));
// ADD TO THE LIST OF LAST SEARCHES
if (osc_save_latest_searches()) {
if (trim($p_sPattern) != '') {
LatestSearches::newInstance()->insert(array('s_search' => trim($p_sPattern), 'd_date' => date('Y-m-d H:i:s')));
}
}
$p_bPic = Params::getParam('bPic');
$p_bPic == 1 ? $p_bPic = 1 : ($p_bPic = 0);
$p_sPriceMin = Params::getParam('sPriceMin');
$p_sPriceMax = Params::getParam('sPriceMax');
//WE CAN ONLY USE THE FIELDS RETURNED BY Search::getAllowedColumnsForSorting()
$p_sOrder = Params::getParam('sOrder');
if (!in_array($p_sOrder, Search::getAllowedColumnsForSorting())) {
$p_sOrder = osc_default_order_field_at_search();
}
//ONLY 0 ( => 'asc' ), 1 ( => 'desc' ) AS ALLOWED VALUES
$p_iOrderType = Params::getParam('iOrderType');
$allowedTypesForSorting = Search::getAllowedTypesForSorting();
$orderType = osc_default_order_type_at_search();
foreach ($allowedTypesForSorting as $k => $v) {
if ($p_iOrderType == $v) {
$orderType = $k;
break;
}
}
$p_iOrderType = $orderType;
$p_sFeed = Params::getParam('sFeed');
$p_iPage = intval(Params::getParam('iPage'));
if ($p_sFeed != '') {
$p_sPageSize = 1000;
}
$p_sShowAs = Params::getParam('sShowAs');
$aValidShowAsValues = array('list', 'gallery');
if (!in_array($p_sShowAs, $aValidShowAsValues)) {
$p_sShowAs = osc_default_show_as_at_search();
}
// search results: it's blocked with the maxResultsPerPage@search defined in t_preferences
$p_iPageSize = intval(Params::getParam('iPagesize'));
if ($p_iPageSize > 0) {
if ($p_iPageSize > osc_max_results_per_page_at_search()) {
$p_iPageSize = osc_max_results_per_page_at_search();
}
} else {
$p_iPageSize = osc_default_results_per_page_at_search();
}
//FILTERING CATEGORY
$bAllCategoriesChecked = false;
if (count($p_sCategory) > 0) {
foreach ($p_sCategory as $category) {
$this->mSearch->addCategory($category);
}
//.........这里部分代码省略.........
示例4: doModel
//.........这里部分代码省略.........
$p_sUser = explode(",", $p_sUser);
}
}
$p_sLocale = Params::getParam('sLocale');
if (!is_array($p_sLocale)) {
if ($p_sLocale == '') {
$p_sLocale = '';
} else {
$p_sLocale = explode(",", $p_sLocale);
}
}
$p_sPattern = trim(strip_tags(Params::getParam('sPattern')));
// ADD TO THE LIST OF LAST SEARCHES
if (osc_save_latest_searches() && (!Params::existParam('iPage') || Params::getParam('iPage') == 1)) {
$savePattern = osc_apply_filter('save_latest_searches_pattern', $p_sPattern);
if ($savePattern != '') {
LatestSearches::newInstance()->insert(array('s_search' => $savePattern, 'd_date' => date('Y-m-d H:i:s')));
}
}
$p_bPic = Params::getParam('bPic');
$p_bPic = $p_bPic == 1 ? 1 : 0;
$p_bPremium = Params::getParam('bPremium');
$p_bPremium = $p_bPremium == 1 ? 1 : 0;
$p_sPriceMin = Params::getParam('sPriceMin');
$p_sPriceMax = Params::getParam('sPriceMax');
//WE CAN ONLY USE THE FIELDS RETURNED BY Search::getAllowedColumnsForSorting()
$p_sOrder = Params::getParam('sOrder');
if (!in_array($p_sOrder, Search::getAllowedColumnsForSorting())) {
$p_sOrder = osc_default_order_field_at_search();
}
$old_order = $p_sOrder;
//ONLY 0 ( => 'asc' ), 1 ( => 'desc' ) AS ALLOWED VALUES
$p_iOrderType = Params::getParam('iOrderType');
$allowedTypesForSorting = Search::getAllowedTypesForSorting();
$orderType = osc_default_order_type_at_search();
foreach ($allowedTypesForSorting as $k => $v) {
if ($p_iOrderType == $v) {
$orderType = $k;
break;
}
}
$p_iOrderType = $orderType;
$p_sFeed = Params::getParam('sFeed');
$p_iPage = 0;
if (is_numeric(Params::getParam('iPage')) && Params::getParam('iPage') > 0) {
$p_iPage = intval(Params::getParam('iPage')) - 1;
}
if ($p_sFeed != '') {
$p_sPageSize = 1000;
}
$p_sShowAs = Params::getParam('sShowAs');
$aValidShowAsValues = array('list', 'gallery');
if (!in_array($p_sShowAs, $aValidShowAsValues)) {
$p_sShowAs = osc_default_show_as_at_search();
}
// search results: it's blocked with the maxResultsPerPage@search defined in t_preferences
$p_iPageSize = intval(Params::getParam('iPagesize'));
if ($p_iPageSize > 0) {
if ($p_iPageSize > osc_max_results_per_page_at_search()) {
$p_iPageSize = osc_max_results_per_page_at_search();
}
} else {
$p_iPageSize = osc_default_results_per_page_at_search();
}
//FILTERING CATEGORY
$bAllCategoriesChecked = false;
示例5: doModel
function doModel()
{
$mCategories = new Category();
$aCategories = $mCategories->findRootCategories();
$mCategoryStats = new CategoryStats();
////////////////////////////////
//GETTING AND FIXING SENT DATA//
////////////////////////////////
$p_sCategory = Params::getParam('sCategory');
if (!is_array($p_sCategory)) {
if ($p_sCategory == '') {
$p_sCategory = array();
} else {
$p_sCategory = explode(",", $p_sCategory);
}
}
$p_sCity = Params::getParam('sCity');
if (!is_array($p_sCity)) {
if ($p_sCity == '') {
$p_sCity = array();
} else {
$p_sCity = explode(",", $p_sCity);
}
}
$p_sRegion = Params::getParam('sRegion');
if (!is_array($p_sRegion)) {
if ($p_sRegion == '') {
$p_sRegion = array();
} else {
$p_sRegion = explode(",", $p_sRegion);
}
}
$p_sCountry = Params::getParam('sCountry');
if (!is_array($p_sCountry)) {
if ($p_sCountry == '') {
$p_sCountry = array();
} else {
$p_sCountry = explode(",", $p_sCountry);
}
}
$p_sPattern = strip_tags(Params::getParam('sPattern'));
$p_bPic = Params::getParam('bPic');
$p_bPic == 1 ? $p_bPic = 1 : ($p_bPic = 0);
$p_sPriceMin = Params::getParam('sPriceMin');
$p_sPriceMax = Params::getParam('sPriceMax');
//WE CAN ONLY USE THE FIELDS RETURNED BY Search::getAllowedColumnsForSorting()
$p_sOrder = Params::getParam('sOrder');
if (!in_array($p_sOrder, Search::getAllowedColumnsForSorting())) {
$p_sOrder = osc_default_order_field_at_search();
}
//ONLY 0 ( => 'asc' ), 1 ( => 'desc' ) AS ALLOWED VALUES
$p_iOrderType = Params::getParam('iOrderType');
$allowedTypesForSorting = Search::getAllowedTypesForSorting();
$orderType = osc_default_order_type_at_search();
foreach ($allowedTypesForSorting as $k => $v) {
if ($p_iOrderType == $v) {
$orderType = $k;
break;
}
}
$p_iOrderType = $orderType;
$p_sFeed = Params::getParam('sFeed');
$p_iPage = intval(Params::getParam('iPage'));
if ($p_sFeed != '') {
$p_sPageSize = 1000;
}
$p_sShowAs = Params::getParam('sShowAs');
$aValidShowAsValues = array('list', 'gallery');
if (!in_array($p_sShowAs, $aValidShowAsValues)) {
$p_sShowAs = osc_default_show_as_at_search();
}
// search results: it's blocked with the maxResultsPerPage@search defined in t_preferences
$p_iPageSize = intval(Params::getParam('iPagesize'));
if ($p_iPageSize > 0) {
if ($p_iPageSize > osc_max_results_per_page_at_search()) {
$p_iPageSize = osc_max_results_per_page_at_search();
}
} else {
$p_iPageSize = osc_default_results_per_page_at_search();
}
//FILTERING CATEGORY
$bAllCategoriesChecked = false;
if (count($p_sCategory) > 0) {
foreach ($p_sCategory as $category) {
$this->mSearch->addCategory($category);
}
} else {
$bAllCategoriesChecked = true;
}
//FILTERING CITY
foreach ($p_sCity as $city) {
$this->mSearch->addCity($city);
}
$p_sCity = implode(", ", $p_sCity);
//FILTERING REGION
foreach ($p_sRegion as $region) {
$this->mSearch->addRegion($region);
}
$p_sRegion = implode(", ", $p_sRegion);
//FILTERING COUNTRY
//.........这里部分代码省略.........
示例6: pop_search_filters
function pop_search_filters()
{
?>
<form id="filterForm" name="filterForm" action="<?php
echo osc_base_url(true);
?>
" method="get" class="nocsrf">
<input type="hidden" name="page" value="search" />
<input type="hidden" name="sOrder" value="<?php
echo osc_search_order();
?>
" />
<input type="hidden" name="iOrderType" value="<?php
$allowedTypesForSorting = Search::getAllowedTypesForSorting();
echo $allowedTypesForSorting[osc_search_order_type()];
?>
" />
<?php
foreach (osc_search_user() as $userId) {
?>
<input type="hidden" name="sUser[]" value="<?php
echo $userId;
?>
" />
<?php
}
?>
<fieldset class="form-group first">
<h6>
<?php
_e('Search text', 'pop');
?>
</h6>
<input class="input-text" type="text" name="sPattern" id="query" value="<?php
echo osc_esc_html(osc_search_pattern());
?>
" />
</fieldset>
<fieldset class="form-group">
<h6>
<?php
_e('Region', 'pop');
?>
</h6>
<div>
<?php
$sCountries = osc_get_countries();
$countryId = $sCountries[0]['pk_c_code'];
$sRegions = osc_get_regions($countryId);
?>
<?php
//pop_region_autocomplete($sRegions);
?>
<input type="hidden" id="countryId" name="countryId" value="<?php
echo $countryId;
?>
" />
<input class="input-text" type="text" id="region" name="sRegion" value="<?php
echo osc_esc_html(osc_search_region());
?>
" />
<input type="hidden" id="regionId" name="regionId" />
</div>
</fieldset>
<fieldset class="form-group">
<h6>
<?php
_e('City', 'pop');
?>
</h6>
<div>
<input class="input-text" type="text" id="city" name="sCity" value="<?php
echo osc_esc_html(osc_search_city());
?>
" />
<input type="hidden" id="cityId" name="cityId" />
</div>
</fieldset>
<?php
if (osc_images_enabled_at_items()) {
?>
<fieldset class="form-group">
<div class="checkbox">
<input type="checkbox" name="bPic" id="withPicture" value="1" <?php
echo osc_search_has_pic() ? 'checked' : '';
?>
/>
<label for="withPicture">
<?php
_e('Listings with pictures', 'pop');
?>
</label>
</div>
</fieldset>
<?php
}
?>
<?php
if (osc_price_enabled_at_items()) {
//.........这里部分代码省略.........