Exemple #1
0
/*$ct= $details->city;
  $rg= $details->region;
  $cy= $details->country; */
$ct = $geoplugin->city;
$rg = $geoplugin->region;
$cy = $geoplugin->countryName;
if ($cy == null) {
    if ($rg == null) {
        if ($ct != null) {
            osc_query_item('city_name=' . $ct);
        }
    } else {
        osc_query_item('region_name=' . $rg);
    }
} else {
    osc_query_item('country_name=' . $cy);
}
if (osc_count_custom_items() == 0) {
    ?>
        
                            <?php 
} else {
    ?>
                            
                            <?php 
    while (osc_has_custom_items()) {
        ?>
                            <div class="item wow fadeInUp animated">
                                <div class="list">
                                    <?php 
        if (osc_images_enabled_at_items()) {
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;
}
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;
    }
}
Exemple #4
0
<?php

$dlocation = array();
if (osc_item_city() !== '') {
    $dlocation[] = osc_item_city();
}
if (osc_item_region() !== '') {
    $dlocation[] = osc_item_region();
}
$ltd = osc_item_id($locale = "");
osc_query_item(array("author" => osc_item_user_id(), "results_per_page" => 6));
if (osc_count_custom_items() >= 2) {
    ?>
<div class="widget">
<h3><?php 
    echo osc_item_contact_name();
    ?>
 <?php 
    _e('Listings', 'flatter');
    ?>
</h3>
<div class="wblock sellerlisting">
	<?php 
    while (osc_has_custom_items()) {
        ?>
		<div class="item <?php 
        if ($ltd == osc_item_id()) {
            echo "current";
        }
        ?>
 clearfix">