--- handlers/views_handler_argument_string.inc.OLD	2011-01-31 00:23:38.000000000 +0000
+++ handlers/views_handler_argument_string.inc	2011-01-31 00:34:21.000000000 +0000
@@ -83,6 +83,25 @@ class views_handler_argument_string exte
       '#default_value' => $this->options['path_case'],
     );
 
+    $form['operator'] = array(
+      '#type' => 'select',
+      '#title' => t('String Operator'),
+      '#description' => t('Choose how to handle the string'),
+      '#options' => array(
+        'op_equal' => t('Is equal to'),
+        'op_nequal' => t('Is not equal to'),
+        'op_contains' => t('Contains'),
+        //'op_contains_any_word' => t('Contains any word'),
+        //'op_contains_all_words' => t('Contains all words'),
+        'op_start_with' => t('Start with'),
+        'op_nstart_with' => t('Does not start with'),
+        'op_ends_with' => t('Ends with'),
+        'op_nends_with' => t('Does not end with'),
+        'op_ncontains' => t('Does not contain'),
+      ),
+      '#default_value' => $this->options['operator'],
+    );
+
     $form['transform_dash'] = array(
       '#type' => 'checkbox',
       '#title' => t('Transform spaces to dashes in URL'),
@@ -167,7 +186,74 @@ class views_handler_argument_string exte
       $field = $this->get_formula();
     }
 
-    $this->query->add_where(0, "$field = '%s'", $argument);
+    switch ($this->options['operator']) {
+    case 'op_equal':
+      $this->query->add_where(0, "$field = '%s'", $argument);
+    break;
+    case 'op_nequal':
+      $this->query->add_where(0, "$field != '%s'", $argument);
+    break;
+    case 'op_contains':
+      $this->query->add_where(0, "$field LIKE '%%%s%%'", $argument);
+    break;
+    case 'op_contains_any_word':
+      // TODO: Still work to do on that part
+      $where = array();
+      preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' '. $argument, $matches, PREG_SET_ORDER);
+      foreach ($matches as $match) {
+        $phrase = false;
+        // Strip off phrase quotes
+        if ($match[2]{0} == '"') {
+          $match[2] = substr($match[2], 1, -1);
+          $phrase = true;
+        }
+        $words = trim($match[2], ',?!();:-');
+        $words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
+        foreach ($words as $word) {
+          $where[] = "$upper($field) LIKE $upper('%%%s%%')";
+          $values[] = trim($word, " ,!?");
+        }
+      }
+      $where = '('. implode(' OR ', $where) .')';
+      $this->query->add_where(0, $where, $argument);
+    break;
+    case 'op_contains_all_words':
+      // TODO: Still work to do on that part
+      $where = array();
+      preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' '. $argument, $matches, PREG_SET_ORDER);
+      foreach ($matches as $match) {
+        $phrase = false;
+        // Strip off phrase quotes
+        if ($match[2]{0} == '"') {
+          $match[2] = substr($match[2], 1, -1);
+          $phrase = true;
+        }
+        $words = trim($match[2], ',?!();:-');
+        $words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
+        foreach ($words as $word) {
+          $where[] = "$upper($field) LIKE $upper('%%%s%%')";
+          $values[] = trim($word, " ,!?");
+        }
+      }
+      $where = implode(' AND ', $where);
+      $this->query->add_where(0, $where, $argument);
+    break;
+    case 'op_start_with':
+      $this->query->add_where(0, "$field LIKE '%s%%'", $argument);
+    break;
+    case 'op_nstart_with':
+      $this->query->add_where(0, "$field NOT LIKE '%s%%'", $argument);
+    break;
+    case 'op_ends_with':
+      $this->query->add_where(0, "$field LIKE '%%%s'", $argument);
+    break;
+    case 'op_nends_with':
+      $this->query->add_where(0, "$field NOT LIKE '%%%s'", $argument);
+    break;
+    case 'op_ncontains':
+      $this->query->add_where(0, "$field NOT LIKE '%%%s%%'", $argument);
+    break;
+    }
   }
 
   function summary_argument($data) {
