You are here

function og_views_handler_argument_uid in Organic groups 5.8

Same name and namespace in other branches
  1. 5 og_views.inc \og_views_handler_argument_uid()
  2. 5.3 og_views.inc \og_views_handler_argument_uid()

Custom argument for filtering by groups that a user is subscribed to

1 string reference to 'og_views_handler_argument_uid'
og_views_arguments in ./og_views.inc

File

./og_views.inc, line 367

Code

function og_views_handler_argument_uid($op, &$query, $a1, $a2 = null) {
  switch ($op) {
    case 'filter':
      $query
        ->ensure_table('og_uid');
      $query
        ->add_where("og_uid.uid = %d", $a2);
      break;
    case 'title':

      // This returns the title for this node in the title, breadcrumb, etc.
      return db_result(db_query('SELECT name FROM {users} WHERE uid = %d', $a2));
  }
}