--- og_views.inc.ori 2007-10-12 16:55:42.000000000 -0300 +++ og_views.inc 2007-12-06 19:25:20.000000000 -0300 @@ -264,7 +264,15 @@ function og_views_tables() { 'list-type' => 'select', 'help' => t('Posts are filtered to groups that current user is a member of.'), ), - ), + 'mysiteuid' => array( + 'field' => 'uid', + 'name' => t('Og: Post in MySite User Subbed Groups'), + 'operator' => 'views_handler_operator_eqneq', + 'list' => 'og_handler_filter_mysiteuser', + 'list-type' => 'select', + 'help' => t('Posts are filtered to groups that current MySite user is a member of.'), + ), + ), ), // pseudotable for adding filter on node table and eventually more 'og_views' => array( @@ -1157,6 +1165,13 @@ function og_views_default_views() { } +/* + * Simple array for MySite user. + */ +function og_handler_filter_mysiteuser() { + return array('***MYSITE_USER***' => t('MySite User')); +} + /** * Views handler to display the number subscriptions */ @@ -1305,9 +1320,21 @@ function og_handler_filter_group_name_li * Allow replacement of current group so we can cache these queries. */ function og_views_query_substitutions($view) { + global $user; + $groupnode = og_get_group_context(); + $ret_array = array('***CURRENT_GID***' => $groupnode ? $groupnode->nid : -1); // return -1 instead of 0 to avoid matching all posts without a group - return array('***CURRENT_GID***' => $groupnode ? $groupnode->nid : -1); + + if (arg(0) == 'mysite' && is_numeric(arg(1))) { + $uid = arg(1); + } + else { + $uid = $user->uid; + } + $ret_array['***MYSITE_USER***'] = $uid; + + return $ret_array; } /**