Гуру | Ситуация следующая. Установил на WP шаблон Clipso, у которого в футере имеется целых 5 ссылок. Необходимо их удалить. При удалении ссылок из файла footer.php, шаблон перестает работать. Прикладываю кусок кода footer.php , где есть предупреждение об этом и сами ссылки:
Развернуть текст PHP код: <?php /*
All links in the footer should remain intact.
These links are all family friendly and will not hurt your site in any way.
Warning! Your site may stop working if these links are edited or deleted
You can buy this theme without footer links online at http://newwpthemes.com/buy/?theme=clipso
*/ ?>
<div id="credits"><a href="http://templatelab.ru/">templatelab.ru</a> | Designed by: <a href="http://virtualdesktoponline.com/">Online Desktop</a> | Thanks to <a href="http://mssharepointhosting.com/what-is-sharepoint/">What is SharePoint</a>, <a href="http://projectserverhosting.com/project-management-software/">Microsoft Project Management Software</a> and <a href="http://businessemailhosting.com/hosted-exchange/">hosted exchange</a></div><!-- #credits -->
</div><!-- #footer -->
[свернуть] Далее в файле functions.php присутствует следующий кусок кода:
Развернуть текст PHP код: function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = 'Designed by: <a href="http://virtualdesktoponline.com/">Online Desktop</a> | Thanks to <a href="http://mssharepointhosting.com/what-is-sharepoint/">What is SharePoint</a>, <a href="http://projectserverhosting.com/project-management-software/">Microsoft Project Management Software</a> and <a href="http://businessemailhosting.com/hosted-exchange/">hosted exchange</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) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();
[свернуть] , при удалении которого, тема все также отказывается работать и пишет, что я удалил ссылки. И третий файл Themater.php содержит следующий кусок кода:
Развернуть текст PHP код: if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_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:20px; margin: 20px; text-align:center; border: 2px dotted #0000ff; font-family:arial; font-weight:bold; background: #fff; color: #0000ff;\">All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.</p>"); } }
if(!function_exists('get_sidebars')) { function get_sidebars($the_sidebar = '') { wp_initialize_the_theme_load(); get_sidebar($the_sidebar); } }
[свернуть] , при удалении которого, тема перестает работать и выдает ошибку. Прошу помощи в этой проблеме, так как я еще совсем нуб в PHP. ---------- Сообщение добавлено 13:29 ---------- Предыдущее 13:10 ---------- Извиняюсь за то, что поднял панику раньше времени. На меня тут снизошло озарение и я смог справиться с этой проблемой. Если кому-нибудь понадобится способ: В моем шаблоне в файле functions.php стояла функция проверки наличия ссылок. Вот она PHP код: fclose($fd); if ( strpos($c, $l) == 0
, достаточно изменить ее значение на 1 и проверка отключилась. После чего можно смело удалять лишние ссылки в файле footer.php. |