SHARE
TWEET

adrotate_clean_trackerdata

a guest Apr 12th, 2012 212 Never
  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. }
RAW Paste Data
Top