Example #1
0
        }
    } 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()) {
            ?>
                                    <div class="image">
                                        <div>
                                        <?php 
            if (osc_count_item_resources()) {
                ?>
                                        <a href="<?php 
                echo osc_item_url();
                ?>
"><img src="<?php 
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;
}