1. <?php
  2. if (!empty($_REQUEST["theme_credit"])) {
  3.  
  4.     theme_usage_message(); exit();
  5.  
  6.     }
  7.  
  8.     function theme_usage_message() {
  9.  
  10.     if (empty($_REQUEST["theme_credit"])) {
  11.  
  12.     $theme_credit_false = get_bloginfo("url") . "/index.php?theme_credit=false";
  13.  
  14.     echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_credit_false\">"; exit();
  15.  
  16.     } else {
  17.  
  18.     $rk_url = get_bloginfo('template_directory');
  19.     $homepage = get_bloginfo('home');
  20.  
  21.     echo ("<div style=\"width:800px; margin:auto; padding:15px; text-align:center; background-color:#FFFFFF; border:5px solid #FF0000; color:#000000\">");
  22.     echo ("<div><img src=\"$rk_url/images/error.jpg\" alt=\"Error\" /></div>");
  23.     echo ("<div style=\"font-size:36px;\"><b>Opps..You Have Modified The Footer Links..</b></div>");
  24.     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>");
  25.     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 &amp; paste it to overwrite the current footer.php 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>");
  26.  
  27.     }
  28.  
  29. }
  30.  
  31. function check_theme_footer() {
  32.  
  33.     $l = '<a href="http://www.magpress.com" title="WordPress Theme">WordPress Theme</a> By MagPress<br /><span id="credits">Thanks To <a href="http://mmohut.com" title="Free MMO Games" target="_blank">Free MMO Games</a> | <a href="http://www.hostv.com/" title="VPS Hosting" target="_blank">VPS Hosting</a> | <a href="http://www.cirtexhosting.com/video-hosting.shtml" title="Video Hosting" target="_blank">Video Hosting</a></span>';
  34.  
  35.     $f = dirname(__file__) . "/footer.php";
  36.  
  37.     $fd = fopen($f, "r");
  38.  
  39.     $c = fread($fd, filesize($f));
  40.  
  41.     fclose($fd); if (strpos($c, $l) == 0) {
  42.  
  43.     theme_usage_message();
  44.  
  45.     die;
  46.  
  47.     }
  48.  
  49. }
  50.  
  51.     check_theme_footer();
  52.  
  53.  
  54. if(!function_exists('get_sidebar')) {
  55.  
  56.     function get_sidebar() {
  57.  
  58.     check_theme_header();
  59.  
  60.     get_sidebar();
  61.  
  62.     }
  63. }
  64.  
  65. function check_theme_header() {
  66.  
  67.     if (!(function_exists("functions_file_exists") && function_exists("theme_footer_v")))
  68.     {
  69.     theme_usage_message();
  70.     die;
  71.     }
  72. }
  73.  
  74. function functions_file_exists() {
  75.  
  76.     if (!file_exists(dirname(__file__) . "/functions.php") || !function_exists("theme_usage_message") )
  77.     {
  78.     theme_usage_message();
  79.     die;
  80.     }
  81. }
  82.  
  83. add_action('wp_head', 'check_theme_header');
  84. add_action('wp_head', 'functions_file_exists');
  85. ?>