<?php
/**************************************
 Shortstat De-Spammer
 v0.2
 
 Created: 21st January 2005
 Updated: 4th February 2005
 
 By:      Mark McLaughlin 
          http://undercrank.com
***************************************
 Place this file in your Shortstat 
 installation directory (I recommend 
 naming it "_despam.php") and run it to 
 remove recently added spam domains 
 from Jay Allen's MT-Blacklist.
***************************************/

  
header("Content-Type: text/plain");
  include_once(
"configuration.php");
  include_once(
"functions.php");
  if (
$shortstat) {
    
SI_pconnect();
    
$hours 72;  // Change this to whatever number of hours you see fit.
    
$date date("Y-m-d H:i:s", (time() - ($hours 3600)));
    
$urlpatterns mysql_query("SELECT ext_bl_item_text, ext_bl_item_created_on 
                                  FROM mt_ext_bl_item 
                                  WHERE ext_bl_item_created_on > \"$date\""
);
    while (
$row mysql_fetch_array($urlpatternsMYSQL_NUM)) {
      print 
"Removing references to " $row[0] . " (added " $row[1]  . ")...\n";
      
$query "DELETE FROM $SI_tables[stats] WHERE domain LIKE \"%$row[0]\"";
      @
mysql_query($query);
    }
  }
?>