14

Using directly the Organic Groups API: og_get_group_members_properties($yourGroupNode, array(), 'members', 'node'); gives you an array of user ids. To obtain only active, pending or blocked users, you can put 'members__1', 'members__2' or 'members__3' in place of 'members', like in this example: og_get_group_members_properties($yourGroupNode, array(), '...


11

About The Group module allows for creating arbitrary collections of your content and users on your site, and grant access control permissions on those collections. It is available as of D7, and has a D8 version also. It is designed to be an alternative to Organic Groups. Organic Groups allows content itself to be groups, which isn't always what people want....


8

I managed to get this working. These very short instructions are indeed correct. But the first few times I tried to follow them I did not have any success. Therefore I thought it would be useful to explain the steps and potential pitfall in more detail. I have broken this answer up into two parts. You may have already done the work in Part A of these ...


7

I don't think that there is a page you can view the membership. I've just skimmed the code of OG module and didn't found any relating part which displays a membership in a separate page. However, since memberships are entities, it should be possible that you can setup a view which takes a membership id as contextual filter and display it in a selected view ...


6

For the 7.x-2.x branch of Organic Groups you need to use the following code. og_is_member('node', $gid, 'user', $user) 'node' is the entity type. The function og_is_member requires 4 parameters to return the correct value.


6

Under Relationships, I choose "OG membership: OG membership from Node". Then under Contextual Filters, I choose "OG membership: Group ID". The last step is to select the Provide default value and choose "Type: Current OG group from context" under the WHEN THE FILTER VALUE IS NOT IN THE URL heading. Attached is a picture of what I mean. Contextual Filter ...


5

Please allow me to offer helpful insights even 6 months after your posted question. Hopefully, this will help others who are struggling with the Drupal module OG as well. Note that in your content type, you should already have bundled Group content visibility as another field. Go to /admin/config/group/fields to accomplish this: In this picture as my ...


5

OG provides no access control on attached files. I ran into the same situation and came up with two options. The file depot module integrates nicely with OG and does prevent users who are not members of a group from accessing files that are attached to a group. The filedepot module is full featured Document Management module that has a google docs like ...


5

@potney i have updated your code.Please check drupal_add_http_header('Content-Type', 'text/csv; utf-8'); drupal_add_http_header('Content-Disposition', 'attachment;filename=csvfiles.csv'); $output = ''; $keys = array(t('User id'), t('Username'), t('Email')); if ($keys) { $output .= implode("\t", $keys) . "\n"; } $members = _get_users_in_group($gid); ...


5

There is an article that comes from being published named: GROUP FOR DRUPAL The author says about group: Simple Groups should be like content types. I want different kinds of groups with different fields, roles and permissions. That’s exactly how Group handles it. Group content Basically anything you attach to the group can be fieldable. Another ...


4

The problem is probably that the group doesn't have it's own role/permission settings. It's using the global og roles/permissions, and so the settings within the group are all read-only. One of the fields you can add to group entities via the OG Fields settings is a "Group Roles and Permissions" field. Once that field is added, you can edit the group entity ...


4

Part of me thinks that og_membership_delete would be a good option, you can pass the entity ID in as a parameter (and by "can", I really mean "need to"). Also, og_ungroup seems useful as well. You can find more functions that OG defines at: http://www.drupalcontrib.org/api/drupal/contributions!og!og.module/7 Here's an example of og_ungroup: og_ungroup('...


4

There is no view link because it does not exist. As you've already mentioned: a membership is an entity. Entities, by default, don't have display pages. You use a custom entity if the data does not necessary has to be publicly displayed on its own. Otherwise, you could use nodes (which are nothing more than extended entities). In this case, the entity ...


4

Add Action >> Get group members from group audience >> node Add Loop >> node:og-group-ref Add Loop inside loop >> group-members >> rename list_item to list_item2 Add Action >> Fetch entity by property >> User >> Mail >> list-item2:mail Add Action >> Fetch entity by property >> OG Memembership >> field_name >> list-item:title >> rename entity_fetched to ...


3

Have a look at this example implementation which creates a new OG Permission View unpublished content and uses Node Grants to decide who can view unpublished nodes. You now can configure which OG Role in your groups are allowed to view unpublished nodes. <?php define('MY_MODULE_REALM_VIEW_UNPUBLISHED', 'my_module_view_unpublished'); /** * Implements ...


3

I had a similar problem with OG Extras installed, the view and members tab would show even when a site visitor wasn't logged in, I wanted it hidden for non registered users or non-admin users. To stop it showing I edited the view 'OG Extras group members (User)' made sure I had the Page, not the block of the view selected and changed 'Access:' for the 'tab ...


3

Drupal caches the system table with all the module locations, so you'll need to run: drush registry-rebuild or use the Registry Rebuild module in order to flush that cache after manually updating the module paths in the system table. Alternatively, you could also just manually delete the system list from the cache bootstrap table: DELETE FROM ...


3

It's look the same, please follow instructions from image: Full image: http://i.stack.imgur.com/45olm.jpg


3

You can find all OG hooks here. You already mentioned two of them, but for the sake of a complete answer here are the hooks fired on membership add/edit/delete: hook_og_membership_insert hook_og_membership_presave hook_og_membership_delete Also, as memberships actually are entities you can also use all hooks used for saving and deleting entities, like ...


3

Editing my answer here as there seems to be a glitch in Views. Even with no contextual filters or relationships, just filtering by groups audience and exposed search doesn't work. The SQL query has both values but I don't know enough about sql to debug it. Contextual filters > (OG membership from node) OG membership: Group ID Relationships > OG ...


3

Group module as possible OG alternative As per your (3rd) comment like "I personally think OG is ..." below the previous answer: be aware that the Group module is a possible alternative for Organic groups for Drupal 7 these days (and soon Drupal 8 also ...). Refer to my answer to "How to create basic Organic Groups functionality with flags and references?" ...


3

This is how I solved a similar problem with the hook_menu() and the use of 'title callback' and 'page callback' function YOUR_MODULE_menu() { $items = array(); $items['link'] = array( 'title' => 'test', 'description' => t('Just a test'), 'title callback' => 'change_title_link', 'title arguments' => array(...


3

Organic Groups provises a default view for this called "OG User Groups". You can use that as a base and adapt it accordingly.


3

You don't need to use group_load anymore! Use node_load instead. You gid is equivalent to nid.


3

You should note that group role is not a field or property in the og_membership entity. The og_membership entity contains the properties etid, entity_type, group_type, and gid. There are other properties, but those are the ones you are interested in. When a user is added to a group, the entity_type is user and the etid is the user id. When node content is ...


2

smokris solution worked but I found another way with EntityFieldQuery: $query = new EntityFieldQuery(); $entities = $query->entityCondition('entity_type', 'node') ->fieldCondition('og_group_ref', 'target_id', $yourGroupID) ->execute(); Example of the returned value: {"node": {"22":{"nid":"22","vid":"22","type":"panoramique"}, "32":{"nid":...


2

I have discovered something that might help. In the header section of the view, click on "add" and choose "OG membership: Group membership overview". That single entry will add something that looks like the following: Group overview - Group manager: admin - Total members: 4 - Total content: 0 I desperately need those to be individually available in the ...


2

In OG 7.2 you need to enable Rules module then enable the two rules for "Pending" and "Active" memberships


2

At last I found how to do that. For displaying a group in the registration form, after enable "show on registration form" option in the admin/config/people/accounts/fields/og_user_node page, you should: Add the group register field to the group fields on the "groups field setting page" Then you should check the "Show on registration page" option on the ...


Only top voted, non community-wiki answers of a minimum length are eligible