hi guys,

anyone know a way to create a group members view?

if there is no way a

"user subbed in groupNID"
or
"usernode subbed in groupNID"

views argument will be nice to create member list views.

greets

Lausch

Comments

moshe weitzman’s picture

Title: what about a new views argument "user subbed in groupNID" or "usernode subbed in groupNID" » list usernodes in Views
Priority: Critical » Normal

in current Views, you have to list usernodes and not users. i am not familiar enough with usernode and views to know how to do this. if the usernodes were affiliated with the group, this would work out of the box.

alex_b’s picture

I just ran into a similar request, too.

A views selector "OG: node author member of given group" would help a lot.

I am not familar with the views API - is such a selector feasible at all?

jasonxxx’s picture

$tables=array( 'zite_og_users' => array(
'name' => 'users',
'provider' => 'internal', // won't show up in external list.
'join' => array(
'type' => 'left',
'left' => array(
'table' => 'og_uid',
'field' => 'uid'
),
'right' => array(
'field' => 'uid'
),
),
'filters' => array(
'name' => array(
'name' => t('OG: Consumers'),
'operator' => 'views_handler_operator_like',
'handler' => 'views_handler_filter_like',
'help' => t('jason32.'),
),
)
)); // hook_views_tables()

Lausch’s picture

thanks for your help,

but where to include this code?

greets

Lausch

Christefano-oldaccount’s picture

Status: Active » Needs work

This looks like it would go into og_views.inc. jason32, can you provide a proper patch?

dkruglyak’s picture

Version: 5.x-4.0 » 5.x-4.3

+1, this patch is needed. Could we get it finalized and commited ?

socialnicheguru’s picture

subscribing

jasonxxx’s picture

It is translated from Russian by the autotranslator
It is necessary to create the office module. I named it "zite". There to create function zite_views_tables ()
I have resulted a code, I will repeat -

function zite_views_tables() {
$tables=array( 'zite_og_users' => array(
'name' => 'users',
'provider' => 'internal', // won't show up in external list.
'join' => array(
'type' => 'left',
'left' => array(
'table' => 'og_uid',
'field' => 'uid'
),
'right' => array(
'field' => 'uid'
),
),
'filters' => array(
'name' => array(
'name' => t('OG: Consumers'),
'operator' => 'views_handler_operator_like',
'handler' => 'views_handler_filter_like',
'help' => t('jason32.'),
),
)
));  return $tables;

After that there should be a corresponding filter. I if fairly have already forgotten, about what in general has safely handed over for a long time already the speech, that project.

claudiu.cristea’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

This version of Drupal is not supported anymore. If this is still an issue in the 8.x-1.x branch, please open a new up-to-date ticket. Closing.