function google_cars() { echo '<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0"> <channel> <title>' . osc_page_title() . '</title> <description>' . osc_page_description() . '</description> <link>' . osc_base_url() . '</link>'; if (osc_count_items()) { while (osc_has_items()) { $item = feed_get_car_data(osc_item()); $date = date('d/m/Y'); $time = date('H:i'); if (preg_match('|([0-9]{4})-([0-9]{2})-([0-9]{2})|', osc_item_pub_date(), $tmp)) { $date = $tmp[3] . "/" . $tmp[2] . "/" . $tmp[1]; } echo '<item> <title>' . osc_item_title() . '</title> <description>' . osc_item_description() . '</description> <g:id>' . osc_item_id() . '</g:id> <link>' . osc_item_url() . '</link> <g:location>' . (osc_item_address() != '' ? osc_item_address() : '') . ', ' . (osc_item_city() != '' ? osc_item_city() : '') . ', ' . (osc_item_region() != '' ? osc_item_region() : '') . ', ' . (osc_item_zip() != '' ? osc_item_zip() : '') . ' ' . (osc_item_country() != '' ? osc_item_country() : '') . '</g:location> <g:publish_date>' . $date . '</g:publish_date> <g:color>' . (isset($item['s_color']) ? $item['s_color'] : '') . '</g:color> <g:condition>' . (isset($item['b_new']) && $item['b_new'] == 1 ? 'new' : 'used') . '</g:condition>'; if (osc_count_item_resources() > 0) { while (osc_has_item_resources()) { if (strpos(osc_resource_type(), 'image') !== FALSE) { echo '<g:image_link>' . osc_resource_path() . '</g:image_link>'; } } } echo '<g:make>' . (isset($item['s_make']) ? $item['s_make'] : '') . '</g:make> <g:mileage>' . (isset($item['i_mileage']) ? $item['i_mileage'] : '') . '</g:mileage> <g:model>' . (isset($item['s_model']) ? $item['s_model'] : '') . '</g:model> <g:price>' . (osc_item_price() != '' ? osc_item_price() : '') . '</g:price> <g:vehicle_type>' . (isset($item['s_name']) ? $item['s_name'] : '') . '</g:vehicle_type> <g:year>' . (isset($item['i_year']) ? $item['i_year'] : '') . '</g:year> </item>'; } } echo '</channel> </rss>'; }
<div class="form-label"><?php _e('Page title'); ?> </div> <div class="form-controls"><input type="text" class="xlarge" name="pageTitle" value="<?php echo osc_esc_html(osc_page_title()); ?> " /></div> </div> <div class="form-row"> <div class="form-label"><?php _e('Page description'); ?> </div> <div class="form-controls"><input type="text" class="xlarge" name="pageDesc" value="<?php echo osc_esc_html(osc_page_description()); ?> " /></div></div> <div class="form-row"> <div class="form-label"><?php _e('Admin e-mail'); ?> </div> <div class="form-controls"><input type="text" class="large" name="contactEmail" value="<?php echo osc_esc_html(osc_contact_email()); ?> " /></div></div> <div class="form-row"> <div class="form-label"><?php _e('Default language'); ?>
<?php } ?> <?php } ?> </ul> </div> </div> <div class="main_header" id="main_header"> <div class="container"> <div id="logo"> <?php echo logo_header(); ?> <span id="description"><?php echo osc_page_description(); ?> </span> </div> <h2 class="pull-right toggle"><i class="fa fa-align-justify"></i></h2> <ul class="links"> <?php osc_reset_static_pages(); while (osc_has_static_pages()) { ?> <li> <a href="<?php echo osc_static_page_url(); ?> "><?php echo osc_static_page_title(); ?> </a> </li>
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 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 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; }
<!-- settings form --> <div id="general-settings"> <h2 class="render-title"><?php _e('General Settings'); ?></h2> <ul id="error_list"></ul> <form name="settings_form" action="<?php echo osc_admin_base_url(true); ?>" method="post"> <input type="hidden" name="page" value="settings" /> <input type="hidden" name="action" value="update" /> <fieldset> <div class="form-horizontal"> <div class="form-row"> <div class="form-label"><?php _e('Page title'); ?></div> <div class="form-controls"><input type="text" class="xlarge" name="pageTitle" value="<?php echo osc_esc_html( osc_page_title() ); ?>" /></div> </div> <div class="form-row"> <div class="form-label"><?php _e('Page description'); ?></div> <div class="form-controls"><input type="text" class="xlarge" name="pageDesc" value="<?php echo osc_esc_html( osc_page_description() ); ?>" /></div></div> <div class="form-row"> <div class="form-label"><?php _e('Admin e-mail'); ?></div> <div class="form-controls"><input type="text" class="large" name="contactEmail" value="<?php echo osc_esc_html( osc_contact_email() ); ?>" /></div></div> <div class="form-row"> <div class="form-label"><?php _e('Default language'); ?></div> <div class="form-controls"> <select name="language"> <?php foreach( $aLanguages as $lang ) { ?> <option value="<?php echo $lang['pk_c_code']; ?>" <?php echo ((osc_language() == $lang['pk_c_code']) ? 'selected="selected"' : ''); ?>><?php echo $lang['s_name']; ?></option> <?php } ?> </select> </div> </div> <div class="form-row"> <div class="form-label"><?php _e('Default currency'); ?></div>
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; break; default: // home $text = osc_page_description(); break; } $text = str_replace("\n", '', $text); $text = trim($text); $text = osc_esc_html($text); return $text; }