• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP osc_search_pattern函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中osc_search_pattern函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_search_pattern函数的具体用法?PHP osc_search_pattern怎么用?PHP osc_search_pattern使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osc_search_pattern函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _e

    ?>
</h1>
    </div>
    <div class="span11 columns">
        <?php 
    if (osc_search_pattern() == '') {
        ?>
            <h5><?php 
        _e('There are no results', 'twitter');
        ?>
</h5>
        <?php 
    } else {
        ?>
            <h5><?php 
        printf(__('There are no results matching "%s"', 'twitter'), osc_search_pattern());
        ?>
</h5>
        <?php 
    }
    ?>
    </div>
<?php 
} else {
    ?>
<div class="search-header span11 columns">
    <h1><?php 
    _e('Search results', 'twitter');
    ?>
</h1>
    <p class="filters">
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:31,代码来源:search_list.php


示例2: osc_highlight

/**
 * Gets prepared text, with:
 * - higlight search pattern and search city
 * - maxim length of text
 *
 * @param string $txt
 * @param int  $len
 * @param string $start_tag
 * @param string $end_tag
 * @return string
 */
function osc_highlight($txt, $len = 300, $start_tag = '<strong>', $end_tag = '</strong>')
{
    $txt = strip_tags($txt);
    $txt = str_replace(array("\n\r", "\r\n", "\n", "\r", "\t"), ' ', $txt);
    $txt = trim($txt);
    $txt = preg_replace('/\\s+/', ' ', $txt);
    if (mb_strlen($txt, 'UTF-8') > $len) {
        $txt = mb_substr($txt, 0, $len, 'UTF-8') . "...";
    }
    $query = osc_search_pattern();
    $query = str_replace(array('(', ')', '+', '-', '~', '>', '<'), array('', '', '', '', '', '', ''), $query);
    $query = str_replace(array('\\', '^', '$', '.', '[', '|', '?', '*', '{', '}', '/', ']'), array('\\\\', '\\^', '\\$', '\\.', '\\[', '\\|', '\\?', '\\*', '\\{', '\\}', '\\/', '\\]'), $query);
    $query = preg_replace('/\\s+/', ' ', $query);
    $words = array();
    if (preg_match_all('/"([^"]*)"/', $query, $matches)) {
        $l = count($matches[1]);
        for ($k = 0; $k < $l; $k++) {
            $words[] = $matches[1][$k];
        }
    }
    $query = trim(preg_replace('/\\s+/', ' ', preg_replace('/"([^"]*)"/', '', $query)));
    $words = array_merge($words, explode(" ", $query));
    foreach ($words as $word) {
        if ($word != '') {
            $txt = preg_replace("/(\\PL|\\s+|^)({$word})(\\PL|\\s+|\$)/i", "\$01" . $start_tag . "\$02" . $end_tag . "\$03", $txt);
        }
    }
    return $txt;
}
开发者ID:naneri,项目名称:Osclass,代码行数:40,代码来源:hUtils.php


示例3: meta_title

function meta_title()
{
    $location = Rewrite::newInstance()->get_location();
    $section = Rewrite::newInstance()->get_section();
    $text = '';
    switch ($location) {
        case 'item':
            switch ($section) {
                case 'item_add':
                    $text = __('Publish a listing');
                    break;
                case 'item_edit':
                    $text = __('Edit your listing');
                    break;
                case 'send_friend':
                    $text = __('Send to a friend') . ' - ' . osc_item_title();
                    break;
                case 'contact':
                    $text = __('Contact seller') . ' - ' . osc_item_title();
                    break;
                default:
                    $text = osc_item_title() . ' ' . osc_item_city();
                    break;
            }
            break;
        case 'page':
            $text = osc_static_page_title();
            break;
        case 'error':
            $text = __('Error');
            break;
        case 'search':
            $region = osc_search_region();
            $city = osc_search_city();
            $pattern = osc_search_pattern();
            $category = osc_search_category_id();
            $s_page = '';
            $i_page = Params::getParam('iPage');
            if ($i_page != '' && $i_page > 1) {
                $s_page = ' - ' . __('page') . ' ' . $i_page;
            }
            $b_show_all = $region == '' && $city == '' && $pattern == '' && empty($category);
            $b_category = !empty($category);
            $b_pattern = $pattern != '';
            $b_city = $city != '';
            $b_region = $region != '';
            if ($b_show_all) {
                $text = __('Show all listings') . ' - ' . $s_page . osc_page_title();
            }
            $result = '';
            if ($b_pattern) {
                $result .= $pattern . ' &raquo; ';
            }
            if ($b_category && is_array($category) && count($category) > 0) {
                $cat = Category::newInstance()->findByPrimaryKey($category[0]);
                if ($cat) {
                    $result .= $cat['s_name'] . ' ';
                }
            }
            if ($b_city) {
                $result .= $city . ' &raquo; ';
            } else {
                if ($b_region) {
                    $result .= $region . ' &raquo; ';
                }
            }
            $result = preg_replace('|\\s?&raquo;\\s$|', '', $result);
            if ($result == '') {
                $result = __('Search results');
            }
            $text = '';
            if (osc_get_preference('seo_title_keyword') != '') {
                $text .= osc_get_preference('seo_title_keyword') . ' ';
            }
            $text .= $result . $s_page;
            break;
        case 'login':
            switch ($section) {
                case 'recover':
                    $text = __('Recover your password');
                default:
                    $text = __('Login');
            }
            break;
        case 'register':
            $text = __('Create a new account');
            break;
        case 'user':
            switch ($section) {
                case 'dashboard':
                    $text = __('Dashboard');
                    break;
                case 'items':
                    $text = __('Manage my listings');
                    break;
                case 'alerts':
                    $text = __('Manage my alerts');
                    break;
                case 'profile':
                    $text = __('Update my profile');
//.........这里部分代码省略.........
开发者ID:oanav,项目名称:closetshare,代码行数:101,代码来源:functions.php


示例4: allSeo_title_filter

function allSeo_title_filter($text)
{
    $location = Rewrite::newInstance()->get_location();
    $section = Rewrite::newInstance()->get_section();
    switch ($location) {
        // Listing page and page related to listings
        case 'item':
            switch ($section) {
                case 'item_add':
                    $text = __('Publish a listing', 'all_in_one');
                    break;
                case 'item_edit':
                    $text = __('Edit your listing', 'all_in_one');
                    break;
                case 'send_friend':
                    $text = __('Send to a friend', 'all_in_one') . Delimiter() . osc_item_title();
                    break;
                case 'contact':
                    $text = __('Contact seller', 'all_in_one') . Delimiter() . osc_item_title();
                    break;
                default:
                    $text = SeoGenerateTitleListing();
                    break;
            }
            break;
            // Static page
        // Static page
        case 'page':
            if (GetPageTitle() == '') {
                $text = osc_static_page_title();
            } else {
                $text = GetPageTitle();
            }
            break;
            // Error page
        // Error page
        case 'error':
            $text = __('Page not found', 'all_in_one');
            break;
            // Search & Category page
        // Search & Category page
        case 'search':
            $region = osc_search_region();
            $city = osc_search_city();
            $pattern = osc_search_pattern();
            $category = osc_search_category_id();
            $s_page = '';
            $i_page = Params::getParam('iPage');
            if ($i_page != '' && $i_page > 1) {
                $s_page = Delimiter() . __('page', 'all_in_one') . ' ' . $i_page;
            }
            $result = SeoGenerateTitleCategory();
            if ($result == '') {
                $result = __('Search result', 'all_in_one');
            }
            $text = $result . $s_page;
            break;
            // Login page
        // Login page
        case 'login':
            switch ($section) {
                case 'recover':
                    $text = __('Recover your password', 'all_in_one');
                default:
                    $text = __('Login into your account', 'all_in_one');
            }
            break;
            // Registration page
        // Registration page
        case 'register':
            $text = __('Create a new account', 'all_in_one');
            break;
            // User page and pages related to user
        // User page and pages related to user
        case 'user':
            switch ($section) {
                case 'dashboard':
                    $text = __('Dashboard', 'all_in_one');
                    break;
                case 'items':
                    $text = __('Manage my listings', 'all_in_one');
                    break;
                case 'alerts':
                    $text = __('Manage my alerts', 'all_in_one');
                    break;
                case 'profile':
                    $text = __('Update my profile', 'all_in_one');
                    break;
                case 'pub_profile':
                    $text = __('Public profile of', 'all_in_one') . ' ' . ucfirst(osc_user_name());
                    break;
                case 'change_email':
                    $text = __('Change my email', 'all_in_one');
                    break;
                case 'change_password':
                    $text = __('Change my password', 'all_in_one');
                    break;
                case 'forgot':
                    $text = __('Recover my password', 'all_in_one');
                    break;
//.........这里部分代码省略.........
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:101,代码来源:index.php


示例5: osc_base_url

        }
        return true;
    }
</script>
<form action="<?php 
echo osc_base_url(true);
?>
" method="post" class="search" onsubmit="javascript:return doSearch();" >
    <input type="hidden" name="page" value="search" />
    <fieldset class="main">
        <label for="query"><?php 
_e('What job are you looking for?', 'masjob');
?>
</label>
        <input type="text" name="sPattern"  id="query" value="<?php 
echo osc_search_pattern() != '' ? osc_search_pattern() : $sExample;
?>
" />
        <?php 
if (osc_count_categories()) {
    ?>
            <?php 
    osc_goto_first_category();
    ?>
            <select name="sCategory" id="sCategory">
                <option value=""><?php 
    _e('All areas', 'masjob');
    ?>
</option>
                <?php 
    while (osc_has_categories()) {
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:31,代码来源:inc.search.php


示例6: osc_highlight

/**
 * Gets prepared text, with:
 * - higlight search pattern and search city
 * - maxim length of text
 *
 * @param string $txt
 * @param int  $len
 * @param string $start_tag
 * @param string $end_tag
 * @return string
 */
function osc_highlight($txt, $len = 300, $start_tag = '<strong>', $end_tag = '</strong>')
{
    if (strlen($txt) > $len) {
        $txt = mb_substr($txt, 0, $len, 'utf-8') . "...";
    }
    $query = osc_search_pattern() . " " . osc_search_city();
    $query = trim(preg_replace('/\\s+/', ' ', $query));
    $aQuery = explode(' ', $query);
    foreach ($aQuery as $word) {
        $word = trim($word);
        if ($word != '') {
            $txt = preg_replace("/({$word})/i", $start_tag . "\$01" . $end_tag, $txt);
        }
    }
    return $txt;
}
开发者ID:ricktaylord,项目名称:OSClass,代码行数:27,代码来源:hUtils.php


示例7: osc_esc_html

echo osc_esc_html(osc_update_search_url(array('sShowAs' => 'gallery')));
?>
" class="grid-button <?php 
if (osclasswizards_show_as() == 'gallery') {
    echo "active";
}
?>
" data-class-toggle="listing-grid" data-destination="#listing-card-list"><span> <i class="fa fa-th-large"></i> </span></a> </div>
      <?php 
osc_run_hook('search_ads_listing_top');
?>
      <?php 
if (osc_count_items() == 0) {
    ?>
      <p class="empty" ><?php 
    printf(__('There are no results matching "%s"', 'osclasswizards'), osc_search_pattern());
    ?>
</p>
      <?php 
} else {
    ?>
      <span class="counter-search">
      <?php 
    $search_number = osclasswizards_search_number();
    printf(__('%1$d - %2$d of %3$d listings', 'osclasswizards'), $search_number['from'], $search_number['to'], $search_number['of']);
    ?>
      </span>
      <div class="sort"> <span class="see_by">
        <?php 
    $orders = osc_list_orders();
    $current = '';
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:search.php


示例8: osc_base_url

            }
        });
        $('input[name=sPattern]').keypress(function(){
            $('input[name=sPattern]').css('background','');
        })
    });
</script>

<form action="<?php 
echo osc_base_url(true);
?>
" method="get" class="search" onsubmit="javascript:return doSearch();">
    <input type="hidden" name="page" value="search" />
    <fieldset class="main">
        <input type="text" name="sPattern"  id="query" value="<?php 
echo osc_esc_html(osc_search_pattern() != '' ? osc_search_pattern() : $sQuery);
?>
" />
        <?php 
if (osc_count_categories()) {
    ?>
            <?php 
    osc_categories_select('sCategory', null, __('Select a category', 'modern'));
    ?>
        <?php 
}
?>
    	<button type="submit"><?php 
_e('Search', 'modern');
?>
</button>
开发者ID:semul,项目名称:Osclass,代码行数:31,代码来源:inc.search.php


示例9: osc_base_url

        if($('input[name=sPattern]').val().length < 3) {
            $('input[name=sPattern]').css('background', '#FFC6C6');
            return false;
        }
        return true;
    }
</script>

<form action="<?php 
echo osc_base_url(true);
?>
" method="get" class="search" onsubmit="javascript:return doSearch();">
    <input type="hidden" name="page" value="search" />
    <fieldset class="main">
        <input type="text" name="sPattern"  id="query" value="<?php 
echo osc_search_pattern() != '' ? osc_search_pattern() : $sQuery;
?>
" />
        <?php 
if (osc_count_categories()) {
    ?>
            <?php 
    osc_categories_select('sCategory', null, __('Select a category', 'modern'));
    ?>
        <?php 
}
?>
        <button type="submit"><?php 
_e('Search', 'modern');
?>
</button>
开发者ID:acharei,项目名称:OSClass,代码行数:31,代码来源:inc.search.php


示例10: osc_base_url

        if($('input[name=sPattern]').val().length < 3) {
            $('input[name=sPattern]').css('background', '#FFC6C6');
            return false;
        }
        return true;
    }
</script>

<form action="<?php 
echo osc_base_url(true);
?>
" method="get" class="search" onsubmit="javascript:return doSearch();">
    <input type="hidden" name="page" value="search" />
    <fieldset class="main">
        <input type="text" name="sPattern"  id="query" value="<?php 
echo osc_search_pattern() != '' ? osc_search_pattern() : __("ie. PHP Programmer", 'modern');
?>
" />

        <?php 
if (osc_count_categories()) {
    ?>
            <?php 
    osc_goto_first_category();
    ?>
            <select name="sCategory" id="sCategory">
                    <option value=""><?php 
    _e("Select a category", 'modern');
    ?>
</option>
                    <?php 
开发者ID:hashemgamal,项目名称:OSClass,代码行数:31,代码来源:inc.search.php


示例11: 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);
//.........这里部分代码省略.........
开发者ID:jmcclenon,项目名称:Osclass,代码行数:101,代码来源:Breadcrumb.php


示例12: 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()) {
//.........这里部分代码省略.........
开发者ID:oanav,项目名称:closetshare,代码行数:101,代码来源:functions.php


示例13: osc_esc_html

echo osc_esc_html(osc_update_search_url(array('sShowAs' => 'gallery')));
?>
" class="grid-button <?php 
if (osclasswizards_show_as() == 'gallery') {
    echo "active";
}
?>
" data-class-toggle="listing-grid" data-destination="#listing-card-list"><span> <i class="fa fa-th-large"></i> </span></a> </div>
      <?php 
osc_run_hook('search_ads_listing_top');
?>
      <?php 
if (osc_count_items() == 0) {
    ?>
      <p class="empty" ><?php 
    printf(__('There are no results matching "%s"', OSCLASSWIZARDS_THEME_FOLDER), osc_search_pattern());
    ?>
</p>
      <?php 
} else {
    ?>
      <span class="counter-search">
      <?php 
    $search_number = osclasswizards_search_number();
    printf(__('%1$d - %2$d of %3$d listings', OSCLASSWIZARDS_THEME_FOLDER), $search_number['from'], $search_number['to'], $search_number['of']);
    ?>
      </span>
      <div class="sort"> <span class="see_by">
        <?php 
    $orders = osc_list_orders();
    $current = '';
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:search.php


示例14: _e

              <input type="hidden" name="sUser[]" value="<?php 
    echo $userId;
    ?>
"/>
              <?php 
}
?>
              <fieldset class="first">
                <h3>
                  <?php 
_e('Your search', OSCLASSWIZARDS_THEME_FOLDER);
?>
                </h3>
                <div class="row">
                  <input class="input-text" type="text" name="sPattern"  id="query" value="<?php 
echo osc_esc_html(osc_search_pattern());
?>
" />
                </div>
              </fieldset>
              <fieldset>
                <h3>
                  <?php 
_e('City', OSCLASSWIZARDS_THEME_FOLDER);
?>
                </h3>
                <div>
                  <input class="input-text" type="text" id="sCity" name="sCity" value="<?php 
echo osc_esc_html(osc_search_city());
?>
" />
开发者ID:bomvendador,项目名称:soroka_r,代码行数:31,代码来源:search-sidebar.php


示例15: osc_highlight

/**
 * Gets prepared text, with:
 * - higlight search pattern and search city
 * - maxim length of text
 *
 * @param string $txt
 * @param int  $len
 * @param string $start_tag
 * @param string $end_tag
 * @return string
 */
function osc_highlight($txt, $len = 300, $start_tag = '<strong>', $end_tag = '</strong>')
{
    $txt = strip_tags($txt);
    $txt = str_replace("\n", '', $txt);
    $txt = trim($txt);
    if (strlen($txt) > $len) {
        $txt = mb_substr($txt, 0, $len, 'utf-8') . "...";
    }
    $query = osc_search_pattern();
    $query = trim(preg_replace('/\\s+/', ' ', $query));
    // exact match
    if (preg_match('/^"(.*)"$/i', $query) > 0) {
        $query = preg_replace('/^"(.*)"$/i', '$01', $query);
        $txt = preg_replace("/({$query})/i", $start_tag . "\$01" . $end_tag, $txt);
    } else {
        $aQuery = explode(' ', $query);
        foreach ($aQuery as $word) {
            $word = trim($word);
            if ($word != '') {
                $txt = preg_replace("/(\\PL|\\s+|^)({$word})(\\PL|\\s+|\$)/i", "\$01" . $start_tag . "\$02" . $end_tag . "\$03", $txt);
            }
        }
    }
    return $txt;
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:36,代码来源:hUtils.php


示例16: 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>';
                    }
//.........这里部分代码省略.........
开发者ID:oanav,项目名称:closetshare,代码行数:101,代码来源:index.php


示例17: osc_highlight

function osc_highlight($txt, $len = 300, $start_tag = '<strong>', $end_tag = '</strong>')
{
    if (strlen($txt) > $len) {
        $txt = substr($txt, 0, $len) . "...";
    }
    $query = osc_search_pattern() . " " . osc_search_city();
    $query = trim(preg_replace('/\\s\\s+/', ' ', $query));
    $aQuery = explode(' ', $query);
    foreach ($aQuery as $word) {
        $txt = str_replace($word, $start_tag . $word . $end_tag, $txt);
    }
    return $txt;
}
开发者ID:hashemgamal,项目名称:OSClass,代码行数:13,代码来源:hUtils.php


示例18: osc_base_url

echo osc_base_url(true);
?>
" method="get" onSubmit="return checkEmptyCategories()">
                            <input type="hidden" name="page" value="search" />
                            <h3 class="your_search"><strong><?php 
_e('Your search', 'masjob');
?>
</strong></h3>
                            <fieldset class="box location">
                                <div class="row one_input">
                                    <h6><?php 
_e('Keyword', 'masjob');
?>
</h6>
                                    <input type="text" name="sPattern"  id="query" value="<?php 
echo osc_search_pattern();
?>
" />
                                </div>
                                <div class="row one_input">
                                    <h6><?php 
_e('City', 'masjob');
?>
</h6>
                                    <input type="text" id="sCity" name="sCity" value="<?php 
echo osc_search_city();
?>
" />
                                </div>
                                <?php 
if (osc_count_categories()) {
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:31,代码来源:search.php


示例19: search_ads_listing_top_fn

                                <?php 
    $i++;
    ?>
                            <?php 
}
?>
                        </div>
                    </div>
                    <?php 
search_ads_listing_top_fn();
?>
                    <?php 
if (osc_count_items() == 0) {
    ?>
                        <p class="empty" ><?php 
    printf(__('There are no results matching "%s"', 'realestate'), osc_search_pattern());
    ?>
</p>
                    <?php 
} else {
    ?>
                        <?php 
    require 'search_gallery.php';
    ?>
                    <?php 
}
?>
                            <?php 
osc_alert_form();
?>
                    <?php 
开发者ID:blairmain,项目名称:theme-realestate,代码行数:31,代码来源:search.php



注:本文中的osc_search_pattern函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP osc_search_url函数代码示例发布时间:2022-05-15
下一篇:
PHP osc_search_category_url函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap