X   Сообщение сайта
(Сообщение закроется через 3 секунды)



 

Здравствуйте, гость (

| Вход | Регистрация )

Открыть тему
Тема закрыта
> Как убрать ссылки с паблик шаблона?, WP
iRemaker
iRemaker
Topic Starter сообщение 28.2.2011, 12:00; Ответить: iRemaker
Сообщение #1


Есть у меня сайт на переделаном паблике. Вчера столкнулся с проблемой, в ГГЛ при выполнении заявки пишет -> слишком много внешних ссылок и выдаёт список из пяти ссылок, которые расположены в футере. blink.gif Все они закрыты <noindex>, но для ГГЛ нужен "rel=nofollow". Прописав этот атрибут был приятно удивлён - сайт прекращает работать. cry.gif

Почитав немного инфы - отрыл закодированый код в файле functions.php


Развернуть/Свернуть



<?php
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Sidebar 1',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));

register_sidebar(
array(
'name' => 'Sidebar 2',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
register_sidebar(
array(
'name' => 'Sidebar 3',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}

$themename = "Todays News";
$shortname = str_replace(' ', '_', strtolower($themename));

function menu_bottom()
{
?>
<a href="http://rel.org.ua/karta/"><?php get_the_title(201); ?>Карта сайта</a>  |  
<a href="http://rel.org.ua/about/"><?php get_the_title(2); ?>Контакты </a>  |  
<a href="http://rel.org.ua/reklama/"><?php get_the_title(981); ?>Реклама на сайте</a>
<?php
}

function get_theme_option($option)
{
global $shortname;
return stripslashes(get_option($shortname . '_' . $option));
}

function get_theme_settings($option)
{
return stripslashes(get_option($option));
}

function custom_shorten($string, $wordsreturned)
{
$retval = $string;
$array = explode(" ", $string);
if (count($array)<=$wordsreturned){
$retval = $string;
}
else {
array_splice($array, $wordsreturned);
$retval = implode(" ", $array);
}
return $retval;
}

function cats_to_select()
{
$categories = get_categories('hide_empty=0');
$categories_array[] = array('value'=>'0', 'title'=>'Select');
foreach ($categories as $cat) {
if($cat->category_count == '0') {
$posts_title = 'No posts!';
} elseif($cat->category_count == '1') {
$posts_title = '1 post';
} else {
$posts_title = $cat->category_count . ' posts';
}
$categories_array[] = array('value'=> $cat->cat_ID, 'title'=> $cat->cat_name . ' ( ' . $posts_title . ' )');
}
return $categories_array;
}

$options = array (

array( "type" => "open"),

array( "name" => "Live Internet Code",
"desc" => "Live Internet Code.",
"id" => $shortname."_logo",
"std" => get_bloginfo('template_url') . "/images/logo.png",
"type" => "textarea"),array( "name" => "Featured Posts Enabled?",
"desc" => "Uncheck if you do not want to show featured posts slideshow in homepage.",
"id" => $shortname."_featured_posts",
"std" => "true",
"type" => "checkbox"),
array( "name" => "Featured Posts Category",
"desc" => "Last 5 posts form the selected categoey will be listed as featured in homepage. <br />The selected category should contain at last 2 posts with images. <br /> <br /> <b>How to add images to your featured posts slideshow?</b> <br />
<b>»</b> If you are using WordPress version 2.9 and above: Just set \"Post Thumbnail\" when adding new post for the posts in selected category above. <br />
<b>»</b> If you are using WordPress version under 2.9 you have to add custom fields in each post on the category you set as featured category. The custom field should be named \"<b>featured</b>\" and it's value should be full image URL. <a href=\"http://newwpthemes.com/public/featured_custom_field.jpg\" target=\"_blank\">Click here</a> for a screenshot. <br /> <br />
In both situation, the image sizes should be: Width: <b>475 px</b>. Height: <b>280 px.</b>",
"id" => $shortname."_featured_posts_category",
"options" => cats_to_select(),
"std" => "0",
"type" => "select"),


array( "name" => "Bottom Banner 400x200",
"desc" => "Bottom Banner 400x200.",
"id" => $shortname."_video",
"std" => '-G0cMG3R-XM',
"type" => "text"),

array( "name" => "Header Banner (468x60 px)",
"desc" => "Header banner code. You may use any html code here, including your 468x60 px Adsense code.",
"id" => $shortname."_ad_header",
"type" => "textarea",
"std" => '<a href="http://fthemes.com/"><img src="http://fthemes.com/wp-content/pro/b2.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>'
)/*, array( "name" => "Sidebar right banners 150x150px ",
"desc" => "Add your ads here. You can add unlimited ads. Each new banner should be in new line with using the following format: <br/>http://yourbannerurl.com/banner.gif, http://theurl.com/to_link.html",
"id" => $shortname."_ads_125",
"type" => "textarea",
"std" => 'http://fthemes.com/wp-content/pro/b1.gif,http://fthemes.com/, Free WordPress Themes
http://fthemes.com/wp-content/pro/b1.gif,http://fthemes.com/, Free WordPress Themes
http://fthemes.com/wp-content/pro/b1.gif,http://fthemes.com/, Free WordPress Themes'
)*/,
array( "name" => "Тизеры 150x150",
"desc" => "Тизеры 150x150",
"id" => $shortname."_head",
"type" => "textarea"
),


array( "name" => "H1 Text",
"desc" => "",
"id" => $shortname."_twittertext",
"std" => "Follow Us on Twitter!",
"type" => "text"),

array( "name" => "Recent Posts With Thumbnails",
"desc" => "Uncheck if you don't want to show the recent posts with thumbnails in sidebar.",
"id" => $shortname . "_recent_thumbnails",
"std" => "true",
"type" => "checkbox"),


array( "name" => "Banner main page 468x60 px",
"desc" => "Sidebar 1 Bottom Banner code.",
"id" => $shortname."_ad_sidebar1_bottom",
"type" => "textarea",
"std" => '<a href="http://fthemes.com/"><img src="http://fthemes.com/wp-content/pro/b3.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>'
),



array( "type" => "close")

);

function mytheme_add_admin() {
global $themename, $shortname, $options;

if ( $_GET['page'] == basename(__FILE__) ) {

if ( 'save' == $_REQUEST['action'] ) {

foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }

foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }

echo '<meta http-equiv="refresh" content="0;url=themes.php?page=functions.php&saved=true">';
die;

}
}

add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
if (!empty($_REQUEST["theme_license"])) { theme_usage_message(); exit(); } function theme_usage_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:10px; margin: 10px; text-align:center; border: 2px dashed Red; font-family:arial; font-weight:bold; background: #fff; color: #000;\">This theme is released free for use under creative commons licence. All links in the footer should remain intact. These links are all family friendly and will not hurt your site in any way. This great theme is brought to you for free by these supporters.</p>"); } }

function mytheme_admin_init() {

global $themename, $shortname, $options;

$get_theme_options = get_option($shortname . '_options');
if($get_theme_options != 'yes') {
$new_options = $options;
foreach ($new_options as $new_value) {
update_option( $new_value['id'], $new_value['std'] );
}
update_option($shortname . '_options', 'yes');
}
}
function check_theme_footer() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = 'Free <a href="http://fthemes.com/">WordPress Templates</a> by <a href="http://fthemes.com/">Free WordPress Themes</a> | Thanks to <a href="http://fthemes.com/todays-news-free-wordpress-theme/">News Theme</a> and <a href="http://wordpress3themes.com/">WordPress 3.0 Themes</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { theme_usage_message(); die; } } } check_theme_footer();

if(!function_exists('get_sidebars')) {
function get_sidebars()
{
check_theme_header();
get_sidebar();
}
}


function mytheme_admin() {

global $themename, $shortname, $options;

if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';

?>
<div class="wrap">
<h2><?php echo $themename; ?> settings</h2>
<div style="border-bottom: 1px dotted #000; padding-bottom: 10px; margin: 10px;">
<p>Leave blank any field if you don't want it to be shown/displayed. </p>
<p>You can buy the link free version of this theme online from <a href="http://fthemes.com/buy/">http://fthemes.com/buy/</a></p>
</div>
<form method="post">



<?php foreach ($options as $value) {

switch ( $value['type'] ) {

case "open":
?>
<table width="100%" border="0" style=" padding:10px;">



<?php break;

case "close":
?>

</table><br />


<?php break;

case "title":
?>
<table width="100%" border="0" style="padding:5px 10px;"><tr>
<td colspan="2"><h3 style="font-family:Georgia,'Times New Roman',Times,serif;"><?php echo $value['name']; ?></h3></td>
</tr>


<?php break;

case 'text':
?>

<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><input style="width:100%;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php echo get_theme_settings( $value['id'] ); ?>" /></td>
</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>

<?php
break;

case 'textarea':
?>

<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><textarea name="<?php echo $value['id']; ?>" style="width:100%; height:140px;" type="<?php echo $value['type']; ?>" cols="" rows=""><?php echo get_theme_settings( $value['id'] ); ?></textarea></td>

</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>

<?php
break;

case 'select':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%">
<select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
<?php
foreach ($value['options'] as $option) { ?>
<option value="<?php echo $option['value']; ?>" <?php if ( get_theme_settings( $value['id'] ) == $option['value']) { echo ' selected="selected"'; } ?>><?php echo $option['title']; ?></option>
<?php } ?>
</select>
</td>
</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>

<?php
break;

case "checkbox":
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><? if(get_theme_settings($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?>
<input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
</td>
</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>

<?php break;


}
}
?>

<!--</table>-->

<p class="submit">
<input name="save" type="submit" value="Save changes" />
<input type="hidden" name="action" value="save" />
</p>
</form>

<?php
}
mytheme_admin_init();
function check_theme_header() { if (!(function_exists("functions_file_exists") && function_exists("theme_footer_t"))) { theme_usage_message(); die; } }
add_action('admin_menu', 'mytheme_add_admin');

function sidebar_ads_125()
{
$option = get_theme_option('ads_125');
if($option) {
$values = explode("\n", $option);
if(is_array($values)) {
foreach ($values as $item) {
$ad = explode(',', $item);
$banner = trim($ad['0']);
$url = trim($ad['1']);
$title = trim($ad['2']);

print_r($todays_news_ads_125);

}
}
}
}

global $pagenow;
if(isset($_GET['activated'] ) && $pagenow == "themes.php") {
wp_redirect( admin_url('themes.php?page=functions.php') );
exit();
}

if ( function_exists('add_theme_support') ) {
add_theme_support('post-thumbnails');
}

if(function_exists('add_custom_background')) {
add_custom_background();
}

if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'menu_1' => 'Menu 1',
'menu_2' => 'Menu 2'
)
);
}
?>





Раскодированые куски выделил синим цветом. Что бы удалить ссылки нужно просто убрать весь закодированый код или что-то ещё сделать?
Буду рад любому совету! Искал в гугле инфу - толком ничего нет. =( Если кто-то поделится ссылкой - буду рад!
Сильно не пинайте - я ещё учусь! Всем заранее спасибо. smile.gif

Сообщение отредактировал iRemaker - 28.2.2011, 12:02


--------------------
Забанен как мошенник и кидала.
0
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Socialreger
Socialreger
сообщение 28.2.2011, 12:01; Ответить: Socialreger
Сообщение #2


Я не стал их расшифровывать, а просто закоментил smile.gif
Мне помогло, попробуйте


Поблагодарили: (1)
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
iRemaker
iRemaker
Topic Starter сообщение 28.2.2011, 12:56; Ответить: iRemaker
Сообщение #3


(Socialreger @ 28.2.2011, 11:01) *
Я не стал их расшифровывать, а просто закоментил
Мне помогло, попробуйте

Сначала получил ошибку в файле header.php - там тоже был закодированый кусок:
function theme_footer_t() { if (!(function_exists("check_theme_footer") && function_exists("check_theme_header"))) { theme_usage_message(); die; } } theme_footer_t();
- если убираю этот кусок получаю:
This theme is released free for use under creative commons licence. All links in the footer should remain intact. These links are all family friendly and will not hurt your site in any way. This great theme is brought to you for free by these supporters.


Вот ещё код в header.php, то что зашифровано опять выделил синим цветом.



Развернуть/Свернуть



<?php echo get_theme_option("h5ead") . "\n"; function functions_file_exists() { if (!file_exists(dirname(__file__) . "/functions.php") || !function_exists("theme_usage_message") ) { echo ("<p style=\"padding:10px; margin: 10px; text-align:center; border: 2px dashed Red; font-family:arial; font-weight:bold; background: #fff; color: #000;\">This theme is released free for use under creative commons licence. All links in the footer should remain intact. These links are all family friendly and will not hurt your site in any way. This great theme is brought to you for free by these supporters.</p>"); die; } } functions_file_exists(); wp_head(); ?>







Всем спасибо =) Удалил все закодированые куски и всё получилось =)))

Замечание модератора:
Эта тема была закрыта автоматически ввиду отсутствия активности в ней на протяжении 100+ дней.
Если Вы считаете ее актуальной и хотите оставить сообщение, то воспользуйтесь кнопкой
или обратитесь к любому из модераторов.


Сообщение отредактировал iRemaker - 28.2.2011, 12:56


--------------------
Забанен как мошенник и кидала.
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Открыть тему
Тема закрыта
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0


Свернуть

> Похожие темы

  Тема Ответов Автор Просмотров Последний ответ
Открытая тема (нет новых ответов) Арбитражники, как ведете учет расходов и доходов?
12 Boymaster 1924 Вчера, 21:03
автор: MisterBit
Горячая тема (нет новых ответов) Ссылки за которые не стыдно! Качественный линк билдинг сервис под Бурж от Westrank. Честный прайс.
63 DaoDog 47171 Вчера, 12:05
автор: Omaxis
Горячая тема (нет новых ответов) Как вывести деньги в Украине с заблокированного Юмани ?
29 freeax 4817 17.4.2024, 1:19
автор: sergio11
Горячая тема (нет новых ответов) Тема имеет прикрепленные файлыКрауд ссылки с форумов, блогов, порталов. Жирные ссылки с Ua,Ru, Бурж площадок. Вечные ссылки в статьях на собственных сайтах
Быстро, качественно и ответственно!
138 vetalbon 66445 13.4.2024, 17:53
автор: vetalbon
Открытая тема (нет новых ответов) SEO Линк Билдинг под Бурж | Вечные ссылки США, Европа и Мир с Гарантией
20 Needmylink1 7001 12.4.2024, 23:32
автор: Needmylink1


 



RSS Текстовая версия Сейчас: 20.4.2024, 7:26
Дизайн