Index: cck_address_linuxbox.inc
===================================================================
--- cck_address_linuxbox.inc	(revision 0)
+++ cck_address_linuxbox.inc	(revision 0)
@@ -0,0 +1,74 @@
+<?php
+/** This file adds proper views search functionality to the cck_address
+    module.
+*/
+
+
+/**
+ * Returns and array of the fields that should be searched.
+ */
+function cck_address_components() {
+  return array('city', 'state', 'zip', 'country');
+} // function cck_address_components
+
+
+/**
+ * Return a list of operators we support to the views module
+ */
+function cck_address_handler_operator_like() {
+  $operators = array(
+    'word' => "Contains Any Word",
+    'starts' => "Begins with"
+  );
+  return $operators;
+}
+
+/**
+ * Implement the LIKE filter
+ */
+function cck_address_handler_filter_like($op, $filter, $filterinfo, &$query) {
+  if (! $filter['value']) { return; }
+
+  if ($filter['operator'] != 'word' && $filter['operator'] != 'starts') {
+    drupal_set_message(t("The filter operator '%s' is not yet implemented on name fields.", array("%s" => $filter['operator'])), 'error');
+    return;
+  } // if the operator is one that's not implemented
+
+  $smallquery = new _views_query('node', 'nid', '');
+  views_handler_filter_like($op, $filter, $filterinfo, $smallquery);
+
+  foreach ($smallquery->tables as $table => $ignore) {
+    $query->ensure_table($table);
+  } // foreach table that was added by the default handler
+
+  $thewhere = $smallquery->where[0];
+  $where_args = $smallquery->where_args;
+
+  drupal_set_message(print_r($thewhere, 1));
+  drupal_set_message(print_r($where_args, 1));
+
+  $mywheres = array();
+  $mywhereargs = array();
+
+  // Make all the components by twisting them out of the smallquery
+  $field = $filterinfo['content_field'];
+  $components = cck_address_components();
+
+  foreach ($components as $component) {
+    $full_component = "field_address_{$component}";
+    $new_where = $thewhere;
+    $field = preg_replace('/field_address_street1/', $full_component, $where_args[0]);
+    $new_where_args = array($field, $where_args[1]);
+
+    $mywheres[] = $new_where;
+    foreach ($new_where_args as $elt) { $mywhereargs[] = $elt; }
+  }
+
+
+  $mywhere = "(".implode(") OR (", $mywheres).")";
+  drupal_set_message($mywhere);
+  $query->where[] = $mywhere;
+  foreach ($mywhereargs as $mywherearg) { $query->where_args[] = $mywherearg; }
+}
+
+
Index: cck_address.module
===================================================================
--- cck_address.module	(revision 124)
+++ cck_address.module	(working copy)
@@ -1,4 +1,8 @@
 <?php
+/** ATTENTION: forked by Linuxbox
+ */
+ require_once('cck_address_linuxbox.inc');
+
 /**
  * This is the cck_address module for use with CCK.
  * 
@@ -657,8 +661,12 @@
     case 'filters':
        return array(
           'default' => array(
+	  /*
             'operator' => 'views_handler_operator_like',
             'handler' => 'views_handler_filter_like',
+	    */
+            'operator' => 'cck_address_handler_operator_like',
+            'handler' => 'cck_address_handler_filter_like',
           ),
         );
       
@@ -1808,4 +1816,4 @@
     }
   }
   return $result;
-}
\ No newline at end of file
+}
