سلام خدمت شما
کد PHP:
if (!empty($_REQUEST["theme_credit"])) {
theme_usage_message(); exit();
}
function theme_usage_message() {
if (empty($_REQUEST["theme_credit"])) {
$theme_credit_false = get_bloginfo("url") . "/index.php?theme_credit=false";
echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_credit_false\">"; exit();
} else {
$rk_url = get_bloginfo('template_directory');
$homepage = get_bloginfo('home');
echo ("<div style=\"width:800px; margin:auto; padding:15px; text-align:center; background-color:#FFFFFF; border:5px solid #FF0000; color:#000000\">");
echo ("<div><img src=\"$rk_url/images/error.jpg\" alt=\"Error\" /></div>");
echo ("<div style=\"font-size:36px;\"><b>Opps..You Have Modified The Footer Links..</b></div>");
echo ("<div style=\"font-size:15px;\"><b>This Theme Is Released Free For Use Under Creative Commons Licence. All Links In The Footer Must Remain Intact AS IS. These Links Are All Family Friendly And Will Not Hurt Your Site In Any Way. Please Appreciate These Supporters Effort In Providing You This Great Theme For Free.</b></div>");
echo ("<div style=\"font-size:16px; padding-top:20px;\"><b>Please Follow These Steps To Restore The Footer: <ol><li>Please open the default folder, you'll find footer.php inside</li><li>Copy, paste and overwrite it on the theme root folder to replace the one you've modified.</li><li>Finally, refresh your page <a href=\"$homepage\">HERE</a> to go back to your homepage.</li></ol></b></div></div>");
}
}
function check_theme_footer() {
$l = '<a href="http://www.magpress.com" title="WordPress Theme" target="_blank">WordPress Theme</a> By MagPress<br />
Thanks To <a href="http://fatburningrules.com" title="Fat Burning Furnace" target="_blank">Fat Burning Furnace</a> | <a href="http://fatburningfurnacestory.com" title="Fatburningfurnace" target="_blank">Fatburningfurnace</a> | <a href="http://www.simplysixpacks.com" title="Get A Six Pack" target="_blank">Get A Six Pack</a>';
$f = dirname(__file__) . "/footer.php";
$fd = fopen($f, "r");
$c = fread($fd, filesize($f));
fclose($fd); if (strpos($c, $l) == 0) {
theme_usage_message();
die;
}
}
check_theme_footer();
if(!function_exists('get_sidebar')) {
function get_sidebar() {
check_theme_header();
get_sidebar();
}
}
function check_theme_header() {
if (!(function_exists("functions_file_exists") && function_exists("theme_footer_v")))
{
theme_usage_message();
die;
}
}
function functions_file_exists() {
if (!file_exists(dirname(__file__) . "/functions.php") || !function_exists("theme_usage_message") )
{
theme_usage_message();
die;
}
}
add_action('wp_head', 'check_theme_header');
add_action('wp_head', 'functions_file_exists');