Help with this PHP

ohaider

Senior Member
Joined
Jul 28, 2011
Messages
819
Reaction score
428
Within my footer I have several backlinks that are irrelevant and completely wasteful. However when they are removed my site goes into shutdown due to this I believe. How could I get around this so I can remove the links?

Code:
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>"); } }
 
it usually in function.php and some encrypted javascript...
post the wordpress theme, maybe i can help....
 
First you have to Check the footer.php and then function.php

When you check the footer.php you can see

PHP:
<div id="credits">Powered by <a href="http://wordpress.org/"><strong>WordPress</strong></a> | Designed by: <a href="http://backlinksvault.com">buy backlinks</a> | Thanks to <a href="http://www.ventzke-partner.de">Webdesign Berlin</a>, <a href="http://web-design-studios.net">Web Design</a> and <a href="http://seo-services.us/ppc.php">pay per click</a></div>
</div>

In Your function.php in these line.


PHP:
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://backlinksvault.com">buy backlinks</a> | Thanks to <a href="http://www.ventzke-partner.de">Webdesign Berlin</a>, <a href="http://web-design-studios.net">Web Design</a> and <a href="http://seo-services.us/ppc.php">pay per click</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();

Can you see this code is in both the above mentioned codes.

PHP:
Designed by: <a href="http://backlinksvault.com">buy backlinks</a> | Thanks to <a href="http://www.ventzke-partner.de">Webdesign Berlin</a>, <a href="http://web-design-studios.net">Web Design</a> and <a href="http://seo-services.us/ppc.php">pay per click</a>

I you want to change or delete anything in these area, you have to do it in both files.
 
Last edited:
to get the footer removed
just add comment after wp_initialize_the_theme_finish function / make the function blank
PHP:
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://backlinksvault.com">buy backlinks</a> | Thanks to <a href="http://www.ventzke-partner.de">Webdesign Berlin</a>, <a href="http://web-design-studios.net">Web Design</a> and <a href="http://seo-services.us/ppc.php">pay per click</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; } } } //comment here wp_initialize_the_theme_finish();
 
Back
Top