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!
Guest

adrotate_clean_trackerdata

By: a guest on Apr 12th, 2012  |  syntax: PHP  |  size: 0.72 KB  |  hits: 130  |  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. Add this line
  2.  
  3.         $wpdb->query("DELETE FROM `".$wpdb->prefix."adrotate_tracker` WHERE `ipaddress` ='unknown';");
  4.  
  5. Function now looks like:
  6.  
  7. /*-------------------------------------------------------------
  8.  Name:      adrotate_clean_trackerdata
  9.  
  10.  Purpose:   Removes old trackerdata
  11.  Receive:   -none-
  12.  Return:    -none-
  13.  Since:         2.0
  14. -------------------------------------------------------------*/
  15. function adrotate_clean_trackerdata() {
  16.         global $wpdb;
  17.  
  18.         $removeme = current_time('timestamp') - 86400;
  19.         $wpdb->query("DELETE FROM `".$wpdb->prefix."adrotate_tracker` WHERE `timer` < ".$removeme." AND `ipaddress` > 0;");
  20.         $wpdb->query("DELETE FROM `".$wpdb->prefix."adrotate_tracker` WHERE `ipaddress` ='unknown';");
  21.  
  22. }