? flag_friend_handler_argument_numeric.patch
Index: includes/flag_friend_handler_argument_numeric.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag_friend/includes/Attic/flag_friend_handler_argument_numeric.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 flag_friend_handler_argument_numeric.inc
--- includes/flag_friend_handler_argument_numeric.inc	30 Apr 2009 23:25:56 -0000	1.1.2.3
+++ includes/flag_friend_handler_argument_numeric.inc	20 Oct 2010 03:39:21 -0000
@@ -7,9 +7,25 @@
  * Contains the custom argument handler for the flag_friend table.
  */
 class flag_friend_handler_argument_numeric extends views_handler_argument_numeric {
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['flag_friend_include_arg_user'] = array(
+      'default' => 0,
+      'translatable' => FALSE,
+    );
+    return $options;
+  }
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $options = $this->options;
+    $form['flag_friend_include_arg_user'] = array(
+      '#title' => t('Include argument user'),
+      '#description' => t('Include results from the user whose friends will be shown.'),
+      '#type' => 'checkbox',
+      '#default_value' => $options['flag_friend_include_arg_user'],
+    );
+  }
   function query() {
-    $this->ensure_my_table();
-
     if (!empty($this->options['break_phrase'])) {
       views_break_phrase($this->argument, $this);
     }
@@ -17,6 +33,9 @@ class flag_friend_handler_argument_numer
       $this->value = array($this->argument);
     }
     $group = $this->query->set_where_group('OR', 'friends');
+    if ($this->options['flag_friend_include_arg_user']) {
+      $this->query->add_where($group, "users.uid = %d", $this->argument);
+    }
     if (count($this->value) > 1) {
       $operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
       $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
