Exemple #1
0
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>';
                    }
                    if (!$b_pattern) {
                        $list[count($list) - 1] = preg_replace('|<a href.*?>(.*?)</a>|', '$01', $list[count($list) - 1]);
                    }
                    $result .= implode($separator, $list) . $separator;
                } else {
                    if ($b_region) {
                        $params['sRegion'] = $region;
                        $list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_region">' . $region . '</span></a>';
                        if (!$b_pattern) {
                            $list[count($list) - 1] = preg_replace('|<a href.*?>(.*?)</a>|', '$01', $list[count($list) - 1]);
                        }
                        $result .= implode($separator, $list) . $separator;
                    }
                }
            }
            if ($b_pattern) {
                $result .= '<span class="bc_last">' . __('Search Results', 'breadcrumbs') . ': ' . $pattern . '</span>' . $separator;
            }
            // remove last separator
            $result = preg_replace('|' . trim($separator) . '\\s*$|', '', $result);
            $text = $result;
            break;
        case 'login':
            switch ($section) {
                case 'recover':
                    $text = $page_title . $separator . '<span class="bc_last">' . __('Recover your password', 'breadcrumbs') . '</span>';
                default:
                    $text = $page_title . $separator . '<span class="bc_last">' . __('Login', 'breadcrumbs') . '</span>';
            }
            break;
        case 'register':
            $text = $page_title . $separator . '<span class="bc_last">' . __('Create a new account', 'breadcrumbs') . '</span>';
            break;
        case 'user':
            $user_dashboard = '<a href="' . osc_user_dashboard_url() . '"><span class="bc_user">' . __('My account', 'breadcrumbs') . '</span></a>';
            switch ($section) {
                case 'dashboard':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Dashboard', 'breadcrumbs') . '</span>';
                    break;
                case 'items':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Manage my items', 'breadcrumbs') . '</span>';
                    break;
                case 'alerts':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Manage my alerts', 'breadcrumbs') . '</span>';
                    break;
                case 'profile':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Update my profile', 'breadcrumbs') . '</span>';
                    break;
                case 'change_email':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Change my email', 'breadcrumbs') . '</span>';
                    break;
                case 'change_password':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Change my password', 'breadcrumbs') . '</span>';
                    break;
                case 'forgot':
                    $text = $page_title . $separator . $user_dashboard . $separator . '<span class="bc_last">' . __('Recover my password', 'breadcrumbs') . '</span>';
                    break;
            }
            break;
        case 'contact':
            $text = $page_title . $separator . '<span class="bc_last">' . __('Contact', 'breadcrumbs') . '</span>';
            break;
        default:
            break;
    }
    echo $text;
    return true;
}
                                    <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()) {
    ?>
                                    <div class="row checkboxes">
                                        <h6><?php 
    _e('Areas', 'masjob');
    ?>
</h6>
                                        <ul>
                                            <?php 
    // RESET CATEGORIES IF WE USED THEN IN THE HEADER
    ?>
function allSeo_description_filter($text)
{
    // CLEAN EXISTING DESCRIPTION
    $text = '';
    // HOME PAGE
    if (osc_is_home_page()) {
        $text = osc_page_description();
    }
    // STATIC PAGE
    if (osc_is_static_page()) {
        if (GetPageDesc() == '') {
            $text = osc_highlight(osc_static_page_text(), 140, '', '');
        } else {
            $text = GetPageDesc();
        }
    }
    // SEARCH & CATEGORY PAGE
    if (osc_is_search_page()) {
        $cat = osc_search_category_id();
        $cat_id = $cat[0];
        $cat_field = Category::newInstance()->findByPrimaryKey($cat_id);
        $country = GetCtrDesc(osc_search_country()) ? GetCtrDesc(osc_search_country()) : osc_search_country();
        $region = GetRegDesc(osc_search_region()) ? GetRegDesc(osc_search_region()) : osc_search_region();
        $city = osc_search_city();
        if (GetCatDesc($cat_id) != '') {
            $desc = GetCatDesc($cat_id);
        } else {
            $desc = $cat_field['s_name'];
        }
        $text = $desc;
        // ADD LOCATION DESCRIPTION
        if ($country != '') {
            $text .= ($text != '' ? ' - ' : '') . $country;
        }
        if ($region != '') {
            $text .= ($text != '' ? ' - ' : '') . $region;
        }
        if ($city != '') {
            $text .= ($text != '' ? ' - ' : '') . $city;
        }
        // Improve search/category title adding part of listings in this category/search
        if (osc_get_preference('allSeo_search_improve_desc', 'plugin-all_in_one') == 1) {
            osc_reset_custom_items();
            osc_query_item(array("category" => $cat_id, "country_name" => $country, "region_name" => $region, "city_name" => $city));
            while (osc_has_custom_items()) {
                $item = Item::newInstance()->findByPrimaryKey(osc_item_id());
                $con = strip_tags($item['s_description']);
                if (osc_item_city() != '') {
                    $text .= ' - ' . osc_item_city();
                }
                if ($con != '') {
                    $text .= ', ' . osc_highlight($con, 100);
                }
            }
        }
        $text = osc_highlight($text, 500);
        osc_reset_items();
    }
    // Listing page
    if (osc_is_ad_page()) {
        if (GetItemDesc() == '') {
            if (GetCatDesc(osc_item_category_id()) != '') {
                $desc = GetCatDesc(osc_item_category_id());
            } else {
                $desc = osc_item_category();
            }
            $item = Item::newInstance()->findByPrimaryKey(osc_item_id());
            $text = $desc . ' - ' . osc_highlight($item['s_description'], 120) . ', ' . SeoLocationShow();
        } else {
            $text = GetItemDesc();
        }
    }
    return $text;
}
                <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());
?>
" />
                </div>
              </fieldset>
              <fieldset>
                <h3>
                  <?php 
_e('Region', OSCLASSWIZARDS_THEME_FOLDER);
?>
                </h3>
                <div>
                  <input class="input-text" type="text" id="sRegion" name="sRegion" value="<?php 
echo osc_esc_html(osc_search_region());
?>
" />
Exemple #5
0
/**
 * 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;
}
Exemple #6
0
function osc_search_footer_links()
{
    if (!osc_rewrite_enabled()) {
        return array();
    }
    $categoryID = osc_search_category_id();
    if (!empty($categoryID)) {
        if (Category::newInstance()->isRoot(current($categoryID))) {
            $cat = Category::newInstance()->findSubcategories(current($categoryID));
            if (count($cat) > 0) {
                $categoryID = array();
                foreach ($cat as $c) {
                    $categoryID[] = $c['pk_i_id'];
                }
            }
        }
    }
    if (osc_search_city() != '') {
        return array();
    }
    $regionID = '';
    if (osc_search_region() != '') {
        $aRegion = Region::newInstance()->findByName(osc_search_region());
        if (isset($aRegion['pk_i_id'])) {
            $regionID = $aRegion['pk_i_id'];
        }
    }
    $conn = DBConnectionClass::newInstance();
    $data = $conn->getOsclassDb();
    $comm = new DBCommandClass($data);
    $comm->select('i.fk_i_category_id');
    $comm->select('l.*');
    $comm->select('COUNT(*) AS total');
    $comm->from(DB_TABLE_PREFIX . 't_item as i');
    $comm->from(DB_TABLE_PREFIX . 't_item_location as l');
    if (!empty($categoryID)) {
        $comm->whereIn('i.fk_i_category_id', $categoryID);
    }
    $comm->where('i.pk_i_id = l.fk_i_item_id');
    $comm->where('i.b_enabled = 1');
    $comm->where('i.b_active = 1');
    $comm->where(sprintf("dt_expiration >= '%s'", date('Y-m-d H:i:s')));
    $comm->where('l.fk_i_region_id IS NOT NULL');
    $comm->where('l.fk_i_city_id IS NOT NULL');
    if ($regionID != '') {
        $comm->where('l.fk_i_region_id', $regionID);
        $comm->groupBy('l.fk_i_city_id');
    } else {
        $comm->groupBy('l.fk_i_region_id');
    }
    $rs = $comm->get();
    if (!$rs) {
        return array();
    }
    return $rs->result();
}
Exemple #7
0
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;
}
Exemple #8
0
function seo_meta_title_filter()
{
    $location = Rewrite::newInstance()->get_location();
    $section = Rewrite::newInstance()->get_section();
    $text = '';
    switch ($location) {
        case 'item':
            switch ($section) {
                case 'item_add':
                    $text = __('Publish a listing') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'item_edit':
                    $text = __('Edit your listing') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'send_friend':
                    $text = __('Send to a friend') . seo_page_title_separator() . osc_item_title() . seo_page_title_separator() . seo_page_title();
                    break;
                case 'contact':
                    $text = __('Contact seller') . seo_page_title_separator() . osc_item_title();
                    break;
                default:
                    $detail = seo_get_row(osc_item_id());
                    if (empty($detail['seo_item_meta_title'])) {
                        $text = osc_item_title() . ' ' . osc_item_city() . seo_page_title_separator() . seo_page_title();
                    } else {
                        $text = $detail['seo_item_meta_title'];
                        $format = json_decode($detail['seo_item_meta_title_format']);
                        if (!empty($format)) {
                            foreach ($format as $value) {
                                if (!empty($value)) {
                                    if (seo_format_value($value) != '') {
                                        $text .= ' ' . seo_format_value($value);
                                    }
                                }
                            }
                        } else {
                            $text .= ' ';
                        }
                        $text .= seo_page_title_separator() . seo_page_title();
                    }
                    break;
            }
            break;
        case 'page':
            if (!osc_get_preference('seo_title_page_' . osc_static_page_id(), 'seo_plugin')) {
                $text = osc_static_page_title() . seo_page_title_separator() . seo_page_title();
            } else {
                $text = osc_get_preference('seo_title_page_' . osc_static_page_id(), 'seo_plugin') . seo_page_title_separator() . seo_page_title();
            }
            break;
        case 'error':
            $text = __('Error') . seo_page_title_separator() . seo_page_title();
            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 = seo_page_title_separator() . __('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') . seo_page_title_separator() . $s_page . seo_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') . ' ' . seo_page_title_separator() . seo_page_title();
            }
            $text .= $result . $s_page . seo_page_title_separator() . seo_page_title();
            break;
        case 'login':
            switch ($section) {
                case 'recover':
                    $text = __('Recover your password') . seo_page_title_separator() . seo_page_title();
                default:
                    $text = __('Login') . seo_page_title_separator() . seo_page_title();
            }
            break;
        case 'register':
            $text = __('Create a new account') . seo_page_title_separator() . seo_page_title();
            break;
        case 'user':
            switch ($section) {
                case 'dashboard':
                    $text = __('Dashboard') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'items':
                    $text = __('Manage my listings') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'alerts':
                    $text = __('Manage my alerts') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'profile':
                    $text = __('Update my profile') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'pub_profile':
                    $text = __('Public profile') . seo_page_title_separator() . osc_user_name() . seo_page_title_separator() . seo_page_title();
                    break;
                case 'change_email':
                    $text = __('Change my email') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'change_username':
                    $text = __('Change my username') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'change_password':
                    $text = __('Change my password') . seo_page_title_separator() . seo_page_title();
                    break;
                case 'forgot':
                    $text = __('Recover my password') . seo_page_title_separator() . seo_page_title();
                    break;
            }
            break;
        case 'contact':
            if (!osc_get_preference('seo_title_page_contact', 'seo_plugin')) {
                $text = __('Contact') . seo_page_title_separator() . seo_page_title();
            } else {
                $text = osc_get_preference('seo_title_page_contact', 'seo_plugin') . seo_page_title_separator() . seo_page_title();
            }
            break;
        default:
            $text = seo_page_title();
            break;
    }
    return $text;
}
Exemple #9
0
 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);
                         $this->addLevel($l);
                     }
                 }
             }
             // pattern
             if ($b_pattern) {
                 $l = array('title' => sprintf($this->title['search_pattern'], $pattern));
                 $this->addLevel($l);
             }
             // remove url from the last node
             $nodes = $this->getaLevel();
             if ($nodes > 0) {
                 if (array_key_exists('url', $nodes[count($nodes) - 1])) {
                     unset($nodes[count($nodes) - 1]['url']);
                 }
             }
             $this->setaLevel($nodes);
             break;
         case 'user':
             // use dashboard without url if you're in the dashboards
             if ($this->getSection() == 'dashboard') {
                 $l = array('title' => $this->title['user_dashboard']);
                 $this->addLevel($l);
                 break;
             }
             // use dashboard without url if you're in the dashboards
             if ($this->getSection() == 'pub_profile') {
                 $l = array('title' => sprintf($this->title['user_dashboard_profile'], osc_user_name()));
                 $this->addLevel($l);
                 break;
             }
             $l = array('url' => osc_user_dashboard_url(), 'title' => $this->title['user_account']);
             $this->addLevel($l);
             switch ($this->getSection()) {
                 case 'items':
                     $l = array('title' => $this->title['user_items']);
                     $this->addLevel($l);
                     break;
                 case 'alerts':
                     $l = array('title' => $this->title['user_alerts']);
                     $this->addLevel($l);
                     break;
                 case 'profile':
                     $l = array('title' => $this->title['user_profile']);
                     $this->addLevel($l);
                     break;
                 case 'change_email':
                     $l = array('title' => $this->title['user_change_email']);
                     $this->addLevel($l);
                     break;
                 case 'change_password':
                     $l = array('title' => $this->title['user_change_password']);
                     $this->addLevel($l);
                     break;
                 case 'change_username':
                     $l = array('title' => $this->title['user_change_username']);
                     $this->addLevel($l);
                     break;
             }
             break;
         case 'login':
             switch ($this->getSection()) {
                 case 'recover':
                     $l = array('title' => $this->title['login_recover']);
                     $this->addLevel($l);
                     break;
                 case 'forgot':
                     $l = array('title' => $this->title['login_forgot']);
                     $this->addLevel($l);
                     break;
                 case '':
                     $l = array('title' => $this->title['login']);
                     $this->addLevel($l);
                     break;
             }
             break;
         case 'register':
             $l = array('title' => $this->title['register']);
             $this->addLevel($l);
             break;
         case 'page':
             $l = array('title' => osc_static_page_title());
             $this->addLevel($l);
             break;
         case 'contact':
             $l = array('title' => $this->title['contact']);
             $this->addLevel($l);
             break;
     }
 }
Exemple #10
0
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()) {
        ?>
        <fieldset class="form-group">
            <div class="price-slice">
                <h6>
                    <?php 
        _e('Price', 'pop');
        ?>
                </h6>
                <ul class="row">
                    <li class="col-md-6"> <span>
                            <?php 
        _e('Min', 'pop');
        ?>
                   :</span>
                        <input class="input-text" type="text" id="priceMin" name="sPriceMin" value="<?php 
        echo osc_esc_html(osc_search_price_min());
        ?>
" size="6" maxlength="6" />
                    </li>
                    <li class="col-md-6"> <span>
                            <?php 
        _e('Max', 'pop');
        ?>
                   :</span>
                        <input class="input-text" type="text" id="priceMax" name="sPriceMax" value="<?php 
        echo osc_esc_html(osc_search_price_max());
        ?>
" size="6" maxlength="6" />
                    </li>
                </ul>
            </div>
        </fieldset>
        <?php 
    }
    ?>
          <div class="form-group plugin-hooks">
            <?php 
    if (osc_search_category_id()) {
        osc_run_hook('search_form', osc_search_category_id());
    } else {
        osc_run_hook('search_form');
    }
    ?>
        </div>
        <?php 
    $aCategories = osc_search_category();
    foreach ($aCategories as $cat_id) {
        ?>
        <input type="hidden" name="sCategory[]" value="<?php 
        echo osc_esc_html($cat_id);
        ?>
" />
        <?php 
    }
    ?>

        <div class="actions">
            <button type="submit" class="btn btn-primary">
                <?php 
    _e('Apply', 'pop');
    ?>
            </button>
            <a class="clear" onclick="formReset($('#filterForm'))">
            <i class="fa fa-times"></i><?php 
    echo _e('Clear filters', 'pop');
    ?>
</a>
        </div>
    </form>
<?php 
}
                </h3>
                <div>
					<?php 
osclasswizards_regions_select('sRegion', 'sRegion', __('Select a university', OSCLASSWIZARDS_THEME_FOLDER), osc_esc_html(osc_search_region()));
?>
                </div>
              </fieldset>
			  <fieldset>
                <h3>
                  <?php 
_e('College', OSCLASSWIZARDS_THEME_FOLDER);
?>
                </h3>
                <div>
                    <?php 
osclasswizards_cities_select('sCity', 'sCity', __('Select a college', OSCLASSWIZARDS_THEME_FOLDER), osc_esc_html(osc_search_city()));
?>
                </div>
              </fieldset>

              <?php 
if (osc_images_enabled_at_items()) {
    ?>
              <fieldset>
                <h3>
                  <?php 
    _e('Show only', OSCLASSWIZARDS_THEME_FOLDER);
    ?>
                </h3>
                <div class="checkbox">
                  <input type="checkbox" name="bPic" id="withPicture" value="1" <?php