Index: activity.module
===================================================================
--- activity.module	(revision 34)
+++ activity.module	(working copy)
@@ -411,7 +411,7 @@
  *   - an array of uids
  *   - can include the special uid ACTIVITY_ALL
  * @param $filters
- *   - an array where keys are one of module, type, operation, target_role
+ *   - an array where keys are one of module, type, operation, created, target_role
  *   - values are arrays of possible values for the keys.
  *     For example:
  *     array('target_role' => 'Author', 'operation' => 'delete')
@@ -444,6 +444,15 @@
 
   // Build sql limiting query to on filtered fields
   if (!empty($filters) && is_array($filters)) {
+    $ops = array(
+      'include' => " = '%s'",
+      'exclude' => " != '%s'",
+      'lt' => ' < %d',
+      'gt' => ' > %d',
+      'lte' => ' <= %d',
+      'gte' => ' >= %d'
+    );
+    
     foreach ($filters as $column => $filter) {
       // Of the possible columns, role is in the at table and all others in the
       // a table. Prefix the column name with the appropriate table.
@@ -455,7 +464,7 @@
       }
       
       // attempt to rewrite old filters to the new format
-      if (!is_array($filter) || (!array_key_exists('include', $filter) && !array_key_exists('exclude', $filter))) {
+      if (!is_array($filter) || count(array_intersect(array_keys($ops), array_keys($filter))) == 0)  {
         $filter = array('include' => $filter);
       }
 
@@ -468,7 +477,7 @@
           $wheres[] = $column . ($criteria == 'exclude' ? ' NOT IN ' : ' IN ') .'('. implode(',', $strings). ')';
         }
         else {
-          $wheres[] = $column . ($criteria == 'exclude' ? ' != ' : ' = ') ."'%s'";
+          $wheres[] = $column . $ops[$criteria];
           // $values is a string with the single value.
           $params[] = $values;
         }
