本文整理汇总了PHP中osc_search_url函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_search_url函数的具体用法?PHP osc_search_url怎么用?PHP osc_search_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_search_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: osc_get_category
<?php
$category = osc_get_category('id', osc_item_category_id());
$category_url = osc_search_url(array('sCategory' => $category['s_slug']));
?>
<div class="item <?php
echo $class;
if (osc_item_is_premium()) {
echo ' premium';
}
?>
">
<?php
if (osc_images_enabled_at_items()) {
?>
<?php
if (osc_count_item_resources()) {
?>
<a class="" href="<?php
echo osc_item_url();
?>
" title="<?php
echo osc_esc_html(osc_item_title());
?>
"><img src="<?php
echo osc_resource_original_url();
?>
" title="" alt="<?php
echo osc_esc_html(osc_item_title());
?>
" width="220" ></a>
示例2: pop_ajax_load_more
function pop_ajax_load_more()
{
$array = Params::getParamsAsArray();
if ($array['_page'] == 'user') {
if ($array['_action'] == 'pub_profile') {
if ($array['username'] != '') {
$_user = User::newInstance()->findByUsername($array['username']);
$array['id'] = $_user['pk_i_id'];
}
$params['author'] = $array['id'];
$params['results_per_page'] = isset($array['_offset']) ? $array['_offset'] : osc_default_results_per_page_at_search();
$params['page'] = isset($array['iPage']) ? $array['iPage'] - 1 : 0;
}
if ($array['_action'] == 'items') {
$params['author'] = osc_logged_user_id();
$params['results_per_page'] = 10;
// core default
$params['page'] = isset($array['iPage']) ? $array['iPage'] - 1 : 0;
}
osc_query_item($params);
$result = View::newInstance()->_get('customItems');
echo _pop_print_listing_card($result);
exit;
}
if ($array['_page'] == 'search' || $array['_page'] == '') {
if (osc_rewrite_enabled()) {
if (REL_WEB_URL != '/') {
$base_url = str_replace(REL_WEB_URL, '', osc_base_url());
} else {
$base_url = osc_base_url();
}
$_SERVER['REQUEST_URI'] = preg_replace('|^' . $base_url . '|', '', osc_search_url(Params::getParamsAsArray()));
osc_add_hook('before_html', 'pop_ob_start_');
osc_add_hook('after_html', 'pop_ob_clean_');
osc_add_hook('after_search', 'pop_echo_pop_print_listing_card');
}
require_once osc_lib_path() . 'osclass/controller/search.php';
$do = new CWebSearch();
$do->doModel();
exit;
}
}
示例3: osc_list_city_url
/**
* Gets the url of current "list city""
*
* @return string
*/
function osc_list_city_url()
{
if (osc_rewrite_enabled()) {
$url = osc_base_url();
if (osc_get_preference('seo_url_search_prefix') != '') {
$url .= osc_get_preference('seo_url_search_prefix') . '/';
}
$url .= osc_sanitizeString(osc_list_city_name()) . '-c' . osc_list_city_id();
return $url;
} else {
return osc_search_url(array('sCity' => osc_list_city_id()));
}
}
示例4: doModel
function doModel()
{
osc_run_hook('before_search');
if (osc_rewrite_enabled()) {
// IF rewrite is not enabled, skip this part, preg_match is always time&resources consuming task
$p_sParams = "/" . Params::getParam('sParams', false, false);
if (preg_match_all('|\\/([^,]+),([^\\/]*)|', $p_sParams, $m)) {
$l = count($m[0]);
for ($k = 0; $k < $l; $k++) {
switch ($m[1][$k]) {
case osc_get_preference('rewrite_search_country'):
$m[1][$k] = 'sCountry';
break;
case osc_get_preference('rewrite_search_region'):
$m[1][$k] = 'sRegion';
break;
case osc_get_preference('rewrite_search_city'):
$m[1][$k] = 'sCity';
break;
case osc_get_preference('rewrite_search_city_area'):
$m[1][$k] = 'sCityArea';
break;
case osc_get_preference('rewrite_search_category'):
$m[1][$k] = 'sCategory';
break;
case osc_get_preference('rewrite_search_user'):
$m[1][$k] = 'sUser';
break;
case osc_get_preference('rewrite_search_pattern'):
$m[1][$k] = 'sPattern';
break;
default:
// custom fields
if (preg_match("/meta(\\d+)-?(.*)?/", $m[1][$k], $results)) {
$meta_key = $m[1][$k];
$meta_value = $m[2][$k];
$array_r = array();
if (Params::existParam('meta')) {
$array_r = Params::getParam('meta');
}
if ($results[2] == '') {
// meta[meta_id] = meta_value
$meta_key = $results[1];
$array_r[$meta_key] = $meta_value;
} else {
// meta[meta_id][meta_key] = meta_value
$meta_key = $results[1];
$meta_key2 = $results[2];
$array_r[$meta_key][$meta_key2] = $meta_value;
}
$m[1][$k] = 'meta';
$m[2][$k] = $array_r;
}
break;
}
Params::setParam($m[1][$k], $m[2][$k]);
}
Params::unsetParam('sParams');
}
}
$uriParams = Params::getParamsAsArray();
$searchUri = osc_search_url($uriParams);
if ($this->uri != 'feed') {
if (str_replace("%20", '+', $searchUri) != str_replace("%20", '+', WEB_PATH . $this->uri)) {
$this->redirectTo($searchUri, 301);
}
}
////////////////////////////////
//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);
//.........这里部分代码省略.........
示例5: osc_city_area_url
/**
* Gets city area's url
*
* @return string
*/
function osc_city_area_url()
{
return osc_search_url(array('sCityArea' => osc_city_area_name()));
}
示例6: osc_footer_link_url
function osc_footer_link_url($f = null)
{
if ($f == null) {
if (View::newInstance()->_exists('footer_link')) {
$f = View::newInstance()->_get('footer_link');
} else {
return '';
}
} else {
View::newInstance()->_exportVariableToView('footer_link', $f);
}
$params = array();
$tmp = osc_search_category_id();
if (!empty($tmp)) {
$params['sCategory'] = $f['fk_i_category_id'];
}
if (osc_search_region() == '') {
$params['sRegion'] = $f['fk_i_region_id'];
} else {
$params['sCity'] = $f['fk_i_city_id'];
}
return osc_search_url($params);
}
示例7: _e
<div id="sidebar">
<div class="navigation">
<?php
if (osc_count_list_regions() > 0) {
?>
<div class="box location">
<h3><strong><?php
_e("Location", 'modern');
?>
</strong></h3>
<ul>
<?php
while (osc_has_list_regions()) {
?>
<li><a href="<?php
echo osc_search_url(array('sRegion' => osc_list_region_name()));
?>
"><?php
echo osc_list_region_name();
?>
</a> <em>(<?php
echo osc_list_region_items();
?>
)</em></li>
<?php
}
?>
</ul>
</div>
<?php
}
示例8: breadcrumbs
function breadcrumbs($separator = '/')
{
$text = '';
$location = Rewrite::newInstance()->get_location();
$section = Rewrite::newInstance()->get_section();
$separator = ' ' . trim($separator) . ' ';
$page_title = '<a href="' . osc_base_url() . '"><span class="bc_root">' . osc_page_title() . '</span></a>';
switch ($location) {
case 'item':
switch ($section) {
case 'item_add':
break;
default:
$aCategories = Category::newInstance()->toRootTree((string) osc_item_category_id());
$category = '';
if (count($aCategories) == 0) {
break;
}
$deep = 1;
foreach ($aCategories as $aCategory) {
$list[] = '<a href="' . breadcrumbs_category_url($aCategory['pk_i_id']) . '"><span class="bc_level_' . $deep . '">' . $aCategory['s_name'] . '</span></a>';
$deep++;
}
$category = implode($separator, $list) . $separator;
$category = preg_replace('|' . trim($separator) . '\\s*$|', '', $category);
break;
}
switch ($section) {
case 'item_add':
$text = $page_title . $separator . '<span class="bc_last">' . __('Publish an item', 'breadcrumbs');
break;
case 'item_edit':
$text = $page_title . $separator . $category . $separator . '<a href="' . osc_item_url() . '"><span class="bc_item">' . osc_item_title() . '</span></a>' . $separator . '<span class="bc_last">' . __('Edit your item', 'breadcrumbs') . '</span>';
break;
case 'send_friend':
$text = $page_title . $separator . $category . $separator . '<a href="' . osc_item_url() . '"><span class="bc_item">' . osc_item_title() . '</span></a>' . $separator . '<span class="bc_last">' . __('Send to a friend', 'breadcrumbs') . '</span>';
break;
case 'contact':
$text = $page_title . $separator . $category . $separator . '<a href="' . osc_item_url() . '"><span class="bc_item">' . osc_item_title() . '</span></a>' . $separator . '<span class="bc_last">' . __('Contact seller', 'breadcrumbs') . '</span>';
break;
default:
$text = $page_title . $separator . $category . $separator . '<span class="bc_last">' . osc_item_title() . '</span>';
break;
}
break;
case 'page':
$text = $page_title . $separator . '<span class="bc_last">' . osc_static_page_title() . '</span>';
break;
case 'search':
$region = osc_search_region();
$city = osc_search_city();
$pattern = osc_search_pattern();
$category = osc_search_category_id();
$category = count($category) == 1 ? $category[0] : '';
$b_show_all = $pattern == '' && $category == '' && $region == '' && $city == '';
$b_category = $category != '';
$b_pattern = $pattern != '';
$b_region = $region != '';
$b_city = $city != '';
$b_location = $b_region || $b_city;
if ($b_show_all) {
$text = $page_title . $separator . '<span class="bc_last">' . __('Search', 'breadcrumbs') . '</span>';
break;
}
// init
$result = $page_title . $separator;
if ($b_category) {
$list = array();
$aCategories = Category::newInstance()->toRootTree($category);
if (count($aCategories) > 0) {
$deep = 1;
foreach ($aCategories as $single) {
$list[] = '<a href="' . breadcrumbs_category_url($single['pk_i_id']) . '"><span class="bc_level_' . $deep . '">' . $single['s_name'] . '</span></a>';
$deep++;
}
// remove last link
if (!$b_pattern && !$b_location) {
$list[count($list) - 1] = preg_replace('|<a href.*?>(.*?)</a>|', '$01', $list[count($list) - 1]);
}
$result .= implode($separator, $list) . $separator;
}
}
if ($b_location) {
$list = array();
$params = array();
if ($b_category) {
$params['sCategory'] = $category;
}
if ($b_city) {
$aCity = City::newInstance()->findByName($city);
if (count($aCity) == 0) {
$params['sCity'] = $city;
$list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_city">' . $city . '</span></a>';
} else {
$aRegion = Region::newInstance()->findByPrimaryKey($aCity['fk_i_region_id']);
$params['sRegion'] = $aRegion['s_name'];
$list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_region">' . $aRegion['s_name'] . '</span></a>';
$params['sCity'] = $aCity['s_name'];
$list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_city">' . $aCity['s_name'] . '</span></a>';
}
//.........这里部分代码省略.........
示例9: osc_search_category_url
/**
* Create automatically the url of a category
*
* @param string $pattern
* @return string the url
*/
function osc_search_category_url()
{
return osc_search_url(array('sCategory' => osc_category_id()));
}
示例10: osc_item_formated_price
echo '<div class="price">' . osc_item_formated_price() . '</div>';
}
if (osc_item_country() != "" || osc_item_region() != '') {
echo '<div class="has-icon"><div class="ico-location ico"></div>';
if (osc_item_region() != "") {
$tempData = osc_item_region();
if (osc_item_field("fk_i_region_id") != "") {
$tempData = '<a href="' . osc_search_url(array('sRegion' => osc_item_field("fk_i_region_id"))) . '">' . osc_item_region() . '</a>';
}
echo $tempData;
}
echo '<div class="mini">';
if (osc_item_city() != "") {
$tempData = osc_item_city();
if (osc_item_field("fk_i_city_id") != "") {
$tempData = '<a href="' . osc_search_url(array('sCity' => osc_item_field("fk_i_city_id"))) . '">' . osc_item_city() . '</a>';
}
echo $tempData;
}
echo '</div>';
echo '</div>';
}
//echo join(', ',$regionData);
?>
<div class="has-icon dates">
<div class="ico-dates ico"></div>
<div><?php
if (osc_item_pub_date() != '') {
echo __('Published', 'realestate') . ': ' . osc_format_date(osc_item_pub_date());
}
?>
示例11: nc_osc_get_public_picture_link
<img src="<?php
echo nc_osc_get_public_picture_link(osc_item_user_id());
?>
" class="img-responsive">
</div>
<div class="row">
<?php
if (osc_logged_user_id() != osc_item_user_id()) {
?>
<!--<a href="<?php
echo osc_route_url('seller-items', array('seller' => osc_item_user_id()));
?>
" >-->
<a href="<?php
echo osc_search_url(array('seller_post' => osc_item_user_id()));
?>
">See other items from seller</a>
<?php
}
?>
</div>
<div class="row">
<?php
if (osc_is_web_user_logged_in()) {
?>
<?php
if (osc_logged_user_id() != osc_item_user_id()) {
?>
<?php
osc_current_web_theme_path('seller-ratings.php');
示例12: _e
<div id="sidebar">
<div class="navigation">
<?php
if (osc_count_list_cities() > 0) {
?>
<div class="box location">
<h3><strong><?php
_e("Location", 'modern');
?>
</strong></h3>
<ul>
<?php
while (osc_has_list_cities()) {
?>
<li><a href="<?php
echo osc_search_url(array('sCity' => osc_list_city_name()));
?>
"><?php
echo osc_list_city_name();
?>
</a> <em>(<?php
echo osc_list_city_items();
?>
)</em></li>
<?php
}
?>
</ul>
</div>
<?php
}
示例13: init
public function init()
{
if (in_array($this->getLocation(), array('item', 'page', 'search', 'login', 'register', 'user', 'contact'))) {
$l = array('url' => osc_base_url(), 'title' => osc_page_title());
$this->addLevel($l);
}
switch ($this->getLocation()) {
case 'item':
if ($this->getSection() == 'item_add') {
$l = array('title' => $this->title['item_add']);
$this->addLevel($l);
break;
}
$aCategory = osc_get_category('id', osc_item_category_id());
// remove
View::newInstance()->_erase('categories');
View::newInstance()->_erase('subcategories');
View::newInstance()->_exportVariableToView('category', $aCategory);
$l = array('url' => osc_search_category_url(), 'title' => osc_category_name());
$this->addLevel($l);
switch ($this->getSection()) {
case 'item_edit':
$l = array('url' => osc_item_url(), 'title' => osc_item_title());
$this->addLevel($l);
$l = array('title' => $this->title['item_edit']);
$this->addLevel($l);
break;
case 'send_friend':
$l = array('url' => osc_item_url(), 'title' => osc_item_title());
$this->addLevel($l);
$l = array('title' => $this->title['item_send_friend']);
$this->addLevel($l);
break;
case 'contact':
$l = array('url' => osc_item_url(), 'title' => osc_item_title());
$this->addLevel($l);
$l = array('title' => $this->title['item_contact']);
$this->addLevel($l);
break;
case '':
$l = array('title' => osc_item_title());
$this->addLevel($l);
break;
}
break;
case 'search':
$region = osc_search_region();
$city = osc_search_city();
$pattern = osc_search_pattern();
$category = osc_search_category_id();
$category = count($category) == 1 ? $category[0] : '';
$b_show_all = $pattern == '' && $category == '' && $region == '' && $city == '';
$b_category = $category != '';
$b_pattern = $pattern != '';
$b_region = $region != '';
$b_city = $city != '';
$b_location = $b_region || $b_city;
// show all
if ($b_show_all) {
$l = array('title' => $this->title['search']);
$this->addLevel($l);
break;
}
// category
if ($b_category) {
$aCategories = Category::newInstance()->toRootTree($category);
foreach ($aCategories as $c) {
View::newInstance()->_erase('categories');
View::newInstance()->_erase('subcategories');
View::newInstance()->_exportVariableToView('category', $c);
$l = array('url' => osc_search_category_url(), 'title' => osc_category_name());
$this->addLevel($l);
}
}
// location
if ($b_location) {
$params = array();
if ($b_category) {
$params['sCategory'] = $category;
}
if ($b_city) {
//print_r("~~~~~~~~~~~~~~~~~~~".$city."~~~~~~~~~~~~~~~~~~~~");
$aCity = City::newInstance()->findByName($city);
if (count($aCity) == 0) {
$params['sCity'] = $city;
$l = array('url' => osc_search_url($params), 'title' => $city);
$this->addLevel($l);
} else {
$aRegion = Region::newInstance()->findByPrimaryKey($aCity['fk_i_region_id']);
$params['sRegion'] = $aRegion['s_name'];
$l = array('url' => osc_search_url($params), 'title' => $aRegion['s_name']);
$this->addLevel($l);
$params['sCity'] = $aCity['s_name'];
$l = array('url' => osc_search_url($params), 'title' => $aCity['s_name']);
$this->addLevel($l);
}
} else {
if ($b_region) {
$params['sRegion'] = $region;
$l = array('url' => osc_search_url($params), 'title' => $region);
//.........这里部分代码省略.........
示例14: twitter_breadcrumb
function twitter_breadcrumb($separator = '/')
{
$breadcrumb = array();
$text = '';
$location = Rewrite::newInstance()->get_location();
$section = Rewrite::newInstance()->get_section();
$separator = '<span class="divider">' . trim($separator) . '</span>';
$page_title = '<li><a href="' . osc_base_url() . '">' . osc_page_title() . '</a>' . $separator . '</li>';
switch ($location) {
case 'item':
switch ($section) {
case 'item_add':
break;
default:
$aCategories = Category::newInstance()->toRootTree((string) osc_item_category_id());
$category = '';
if (count($aCategories) == 0) {
break;
}
foreach ($aCategories as $aCategory) {
$list[] = '<li><a href="' . osc_item_category_url($aCategory['pk_i_id']) . '">' . $aCategory['s_name'] . '</a>' . $separator . '</li>';
}
$category = implode('', $list);
break;
}
switch ($section) {
case 'item_add':
$text = $page_title . '<li>' . __('Publish an item', 'twitter') . '</li>';
break;
case 'item_edit':
$text = $page_title . '<li><a href="' . osc_item_url() . '">' . osc_item_title() . '</a>' . $separator . '</li><li>' . __('Edit your item', 'twitter') . '</li>';
break;
case 'send_friend':
$text = $page_title . $category . '<li><a href="' . osc_item_url() . '">' . osc_item_title() . '</a>' . $separator . '</li><li>' . __('Send to a friend', 'twitter') . '</li>';
break;
case 'contact':
$text = $page_title . $category . '<li><a href="' . osc_item_url() . '">' . osc_item_title() . '</a>' . $separator . '<li><li>' . __('Contact seller', 'twitter') . '</li>';
break;
default:
$text = $page_title . $category . '<li>' . osc_item_title() . '</li>';
break;
}
break;
case 'page':
$text = $page_title . '<li>' . osc_static_page_title() . '</li>';
break;
case 'search':
$region = Params::getParam('sRegion');
$city = Params::getParam('sCity');
$pattern = Params::getParam('sPattern');
$category = osc_search_category_id();
$category = count($category) == 1 ? $category[0] : '';
$b_show_all = $pattern == '' && $category == '' && $region == '' && $city == '';
$b_category = $category != '';
$b_pattern = $pattern != '';
$b_region = $region != '';
$b_city = $city != '';
$b_location = $b_region || $b_city;
if ($b_show_all) {
$text = $page_title . '<li>' . __('Search', 'twitter') . '</li>';
break;
}
// init
$result = $page_title;
if ($b_category) {
$list = array();
$aCategories = Category::newInstance()->toRootTree($category);
if (count($aCategories) > 0) {
$deep = 1;
foreach ($aCategories as $single) {
$list[] = '<li><a href="' . osc_item_category_url($single['pk_i_id']) . '">' . $single['s_name'] . '</a>' . $separator . '</li>';
$deep++;
}
// remove last link
if (!$b_pattern && !$b_location) {
$list[count($list) - 1] = preg_replace('|<li><a href.*?>(.*?)</a>.*?</li>|', '$01', $list[count($list) - 1]);
}
$result .= implode('', $list);
}
}
if ($b_location) {
$list = array();
$params = array();
if ($b_category) {
$params['sCategory'] = $category;
}
if ($b_city) {
$aCity = City::newInstance()->findByName($city);
if (count($aCity) == 0) {
$params['sCity'] = $city;
$list[] = '<li><a href="' . osc_search_url($params) . '">' . $city . '</a>' . $separator . '</li>';
} else {
$aRegion = Region::newInstance()->findByPrimaryKey($aCity['fk_i_region_id']);
$params['sRegion'] = $aRegion['s_name'];
$list[] = '<li><a href="' . osc_search_url($params) . '">' . $aRegion['s_name'] . '</a>' . $separator . '</li>';
$params['sCity'] = $aCity['s_name'];
$list[] = '<li><a href="' . osc_search_url($params) . '">' . $aCity['s_name'] . '</a>' . $separator . '</li>';
}
if (!$b_pattern) {
$list[count($list) - 1] = preg_replace('|<li><a href.*?>(.*?)</a>.*?</li>|', '$01', $list[count($list) - 1]);
//.........这里部分代码省略.........
示例15: osclasswizards_popular_cities
}
?>
<?php
if (osclasswizards_show_popular_cities()) {
?>
<section id='Cities'>
<div class="popular_cities">
<?php
$cities = osclasswizards_popular_cities(osclasswizards_popular_cities_limit());
?>
<ul>
<?php
foreach ($cities as $city => $count) {
?>
<li><a href="<?php
echo osc_search_url(array('sCity' => $city));
?>
"><i class="fa fa-map-marker"></i><?php
echo $city;
?>
<em>(<?php
echo $count;
?>
)</em></a></li>
<?php
}
?>
</ul>
</div>
</section>
<?php