示例#1
0
/*
 *      Osclass – software for creating and publishing online classified
 *                           advertising platforms
 *
 *                        Copyright (C) 2014 OSCLASS
 *
 *       This program is free software: you can redistribute it and/or
 *     modify it under the terms of the GNU Affero General Public License
 *     as published by the Free Software Foundation, either version 3 of
 *            the License, or (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful, but
 *         WITHOUT ANY WARRANTY; without even the implied warranty of
 *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *             GNU Affero General Public License for more details.
 *
 *      You should have received a copy of the GNU Affero General Public
 * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
// meta tag robots
osc_add_hook('header', 'bender_nofollow_construct');
bender_add_body_class('page');
osc_current_web_theme_path('header.php');
?>
<h1><?php 
echo osc_static_page_title();
?>
</h1>
<?php 
echo osc_static_page_text();
osc_current_web_theme_path('footer.php');
示例#2
0
 function meta_description()
 {
     $location = Rewrite::newInstance()->get_location();
     $section = Rewrite::newInstance()->get_section();
     $text = '';
     switch ($location) {
         case 'item':
             switch ($section) {
                 case 'item_add':
                     $text = '';
                     break;
                 case 'item_edit':
                     $text = '';
                     break;
                 case 'send_friend':
                     $text = '';
                     break;
                 case 'contact':
                     $text = '';
                     break;
                 default:
                     $text = osc_item_category() . ', ' . osc_highlight(strip_tags(osc_item_description()), 140) . '..., ' . osc_item_category();
                     break;
             }
             break;
         case 'page':
             $text = osc_highlight(strip_tags(osc_static_page_text()), 140);
             break;
         case 'search':
             $result = '';
             if (osc_count_items() == 0) {
                 $text = '';
             }
             if (osc_has_items()) {
                 $result = osc_item_category() . ', ' . osc_highlight(strip_tags(osc_item_description()), 140) . '..., ' . osc_item_category();
             }
             osc_reset_items();
             $text = $result;
         case '':
             // home
             $result = '';
             if (osc_count_latest_items() == 0) {
                 $text = '';
             }
             if (osc_has_latest_items()) {
                 $result = osc_item_category() . ', ' . osc_highlight(strip_tags(osc_item_description()), 140) . '..., ' . osc_item_category();
             }
             osc_reset_items();
             $text = $result;
             break;
     }
     $text = str_replace('"', "'", $text);
     return $text;
 }
示例#3
0
function meta_description()
{
    $text = '';
    // home page
    if (osc_is_home_page()) {
        $text = osc_page_description();
    }
    // static page
    if (osc_is_static_page()) {
        $text = osc_highlight(osc_static_page_text(), 140, '', '');
    }
    // search
    if (osc_is_search_page()) {
        if (osc_has_items()) {
            $text = osc_item_category() . ' ' . osc_item_city() . ', ' . osc_highlight(osc_item_description(), 120);
        }
        osc_reset_items();
    }
    // listing
    if (osc_is_ad_page()) {
        $text = osc_item_category() . ' ' . osc_item_city() . ', ' . osc_highlight(osc_item_description(), 120);
    }
    return osc_apply_filter('meta_description_filter', $text);
}
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;
}
示例#5
0
function seo_meta_description_filter()
{
    $text = '';
    // home page
    if (osc_is_home_page()) {
        if (!osc_get_preference('seo_metadesc_home', 'seo_plugin')) {
            $text = osc_page_description();
        } else {
            $text = osc_get_preference('seo_metadesc_home', 'seo_plugin');
        }
    }
    // static page
    if (osc_is_static_page()) {
        if (!osc_get_preference('seo_metadesc_page_' . osc_static_page_id(), 'seo_plugin')) {
            $text = osc_highlight(osc_static_page_text(), 140, '', '');
        } else {
            $text = osc_get_preference('seo_metadesc_page_' . osc_static_page_id(), 'seo_plugin');
        }
    }
    //contact page
    if (osc_is_contact_page()) {
        if (osc_get_preference('seo_metadesc_page_contact', 'seo_plugin')) {
            $text = osc_get_preference('seo_metadesc_page_contact', 'seo_plugin');
        }
    }
    // search
    if (osc_is_search_page()) {
        if (osc_has_items()) {
            $text = osc_item_category() . ' ' . osc_item_city() . ', ' . osc_highlight(osc_item_description(), 120);
        }
        osc_reset_items();
    }
    // listing
    if (osc_is_ad_page()) {
        $detail = seo_get_row(osc_item_id());
        if (empty($detail['seo_item_meta_description'])) {
            $text = osc_item_category() . ' ' . osc_item_city() . ', ' . osc_highlight(osc_item_description(), 120);
        } else {
            $text = $detail['seo_item_meta_description'];
        }
    }
    return $text;
}