本文整理汇总了PHP中wpl_global::get_wp_qvar方法的典型用法代码示例。如果您正苦于以下问题:PHP wpl_global::get_wp_qvar方法的具体用法?PHP wpl_global::get_wp_qvar怎么用?PHP wpl_global::get_wp_qvar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wpl_global
的用法示例。
在下文中一共展示了wpl_global::get_wp_qvar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* This is a function for loading view
* @author Howard <howard@realtyna.com>
* @static
* @param string $view
* @param string $query_string
* @param array $instance
* @param string $function
* @return string
*/
public static function load($view = 'property_listing', $query_string = '', $instance = array(), $function = NULL)
{
/** first validations **/
if (trim($query_string) == '') {
$query_string = wpl_global::get_wp_qvar('wpl_qs');
}
/** generate pages object **/
$controller = new wpl_controller();
if (!$function) {
$function = 'f:' . $view . ':display';
}
/** call function **/
return call_user_func(array($controller, $function), $instance);
}
示例2: check_property_link
/**
* Checke proeprty alias and 301 redirect the page to the correct link
* @author Howard <howard@realtyna.com>
* @param int $proeprty_id
*/
public function check_property_link($proeprty_id)
{
$wpl_qs = urldecode(wpl_global::get_wp_qvar('wpl_qs'));
/** check property alias for avoiding duplicate content **/
$called_alias = $wpl_qs;
$column = 'alias';
$field_id = wpl_flex::get_dbst_id($column, wpl_property::get_property_kind($proeprty_id));
$field = wpl_flex::get_field($field_id);
if (isset($field->multilingual) and $field->multilingual and wpl_global::check_multilingual_status()) {
$column = wpl_addon_pro::get_column_lang_name($column, wpl_global::get_current_language(), false);
}
$property_alias = $proeprty_id . '-' . urldecode(wpl_db::get($column, 'wpl_properties', 'id', $proeprty_id));
if (trim($property_alias) != '' and $called_alias != $property_alias) {
$url = wpl_sef::get_wpl_permalink(true) . '/' . urlencode($property_alias);
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $url);
exit;
}
}
示例3: setVars
/**
* Sets parameters of a view
* @author Howard R <howard@realtyna.com>
* @static
* @param string $view
* @param string $query_string
*/
public static function setVars($view = 'property_listing', $query_string = '')
{
/** first validations **/
if (trim($query_string) == '') {
$query_string = wpl_global::get_wp_qvar('wpl_qs');
}
$separator = wpl_global::get_setting('sef_main_separator');
/** default value is "/" character **/
$ex = explode($separator, $query_string);
/** set view **/
wpl_request::setVar('wplview', $view, 'method', false);
if ($view == 'property_show') {
$exp = explode('-', $ex[0]);
wpl_request::setVar('pid', $exp[0], 'method', false);
} elseif ($view == 'profile_show') {
$query = "SELECT `ID` FROM `#__users` WHERE `user_login`='" . $ex[0] . "' ORDER BY ID ASC LIMIT 1";
$uid = wpl_db::select($query, 'loadResult');
wpl_request::setVar('uid', $uid, 'method', false);
wpl_request::setVar('sf_select_user_id', $uid, 'method', false);
} else {
/** specific fields like country, state, city and ... **/
$specific_fields = array();
/** set location vars **/
self::set_location_vars($ex);
foreach ($ex as $parameter) {
$types = array();
$detected = explode(':', $parameter);
if (count($detected) == 1) {
continue;
} elseif (count($detected) == 2) {
$types[0] = 'select';
$fields[0] = $detected[0];
$values[0] = $detected[1];
$parsed_value = explode('-', $detected[1]);
if (count($parsed_value) == 2) {
$types[0] = 'tmin';
$fields[0] = $detected[0];
$values[0] = $parsed_value[0];
$types[1] = 'tmax';
$fields[1] = $detected[0];
$values[1] = $parsed_value[1];
} elseif (count($parsed_value) == 3) {
$types[0] = 'min';
$fields[0] = $detected[0];
$values[0] = $parsed_value[0];
$types[1] = 'max';
$fields[1] = $detected[0];
$values[1] = $parsed_value[1];
$types[2] = 'unit';
$fields[2] = $detected[0];
$values[2] = $parsed_value[2];
}
} elseif (count($detected) == 3) {
$types[0] = strtolower($detected[0]);
$fields[0] = $detected[1];
$values[0] = $detected[2];
}
$i = 0;
foreach ($types as $type) {
$field = self::parse_field(urldecode($fields[$i]), $specific_fields);
$value = self::get_id_by_name($field, urldecode($values[$i]));
if (trim($value) != '') {
wpl_request::setVar('sf_' . $type . '_' . $field, $value, 'method', false);
}
$i++;
}
}
}
}