Pastebin launched a little side project called HostCabi.net, check it out ;-)Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!

Untitled

By: johnburn on Nov 27th, 2011  |  syntax: PHP  |  size: 2.71 KB  |  hits: 98  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if (!empty($_REQUEST["theme_credit"])) {
  2.  
  3.         theme_usage_message(); exit();
  4.  
  5.         }
  6.  
  7.         function theme_usage_message() {
  8.  
  9.         if (empty($_REQUEST["theme_credit"])) {
  10.  
  11.         $theme_credit_false = get_bloginfo("url") . "/index.php?theme_credit=false";
  12.  
  13.         echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_credit_false\">"; exit();
  14.  
  15.         } else {
  16.  
  17.     $rk_url = get_bloginfo('template_directory');
  18.         $homepage = get_bloginfo('home');
  19.  
  20.         echo ("<div style=\"width:800px; margin:auto; padding:15px; text-align:center; background-color:#FFFFFF; border:5px solid #FF0000; color:#000000\">");
  21.     echo ("<div><img src=\"$rk_url/images/error.jpg\" alt=\"Error\" /></div>");
  22.     echo ("<div style=\"font-size:36px;\"><b>Opps..You Have Modified The Footer Links..</b></div>");
  23.     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>");
  24.     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>");
  25.  
  26.         }
  27.  
  28. }
  29.  
  30. function check_theme_footer() {
  31.  
  32.         $l = '<a href="http://www.magpress.com" title="WordPress Theme" target="_blank">WordPress Theme</a> By MagPress<br />Thanks To <a href="http://rpgmusic.org" title="Game Soundtracks" target="_blank">Game Soundtracks</a> | <a href="http://www.hostv.com" title="VPS Hosting" target="_blank">VPS Hosting</a> | <a href="http://www.cirtexhosting.com" title="Website Hosting" target="_blank">Website Hosting</a>';
  33.  
  34.         $f = dirname(__file__) . "/footer.php";
  35.  
  36.         $fd = fopen($f, "r");
  37.  
  38.         $c = fread($fd, filesize($f));
  39.  
  40.         fclose($fd); if (strpos($c, $l) == 0) {
  41.  
  42.         theme_usage_message();
  43.  
  44.     die;
  45.  
  46.         }
  47.  
  48. }
  49.  
  50.         check_theme_footer();
  51.  
  52.  
  53. if(!function_exists('get_sidebar')) {
  54.  
  55.         function get_sidebar() {
  56.  
  57.         check_theme_header();
  58.  
  59.         get_sidebar();
  60.  
  61.         }
  62. }
  63.  
  64. function check_theme_header() {
  65.  
  66.     if (!(function_exists("functions_file_exists") && function_exists("theme_footer_v")))
  67.     {
  68.     theme_usage_message();
  69.     die;
  70.     }
  71. }
  72.  
  73. function functions_file_exists() {
  74.  
  75.         if (!file_exists(dirname(__file__) . "/functions.php") || !function_exists("theme_usage_message") )
  76.         {
  77.     theme_usage_message();
  78.         die;
  79.     }
  80. }
  81.  
  82. add_action('wp_head', 'check_theme_header');
  83. add_action('wp_head', 'functions_file_exists');
  84.