Support for organic group
pivica - June 30, 2008 - 13:45
| Project: | Advanced User |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
Hi,
It would be nice to add support for organic groups - for example to allow adding/removing multiple users to groups.
Now I am not sure should that feature need to be added to advuser or maybe to og module through user_operations callback.
Anyway for now I have patched advuser to allow adding multiple users to some organic group. If anybody is interested I can also add removing from organic groups and then upload patch here so others can test it.

#1
Yes, this would be a nice feature. I've been developing a site using OG. I'd be interested if you uploaded your patches.
#2
OK here is first version of patch (note that i have created this patch against 5.x-2.0 version). I have also added support for removing users from organic group.
The next thing that would maybe be nice is adding filters for groups - so you can use advuser to filter users from only chosen group. What do you think?
#3
I prefer the patches to be cvs based differences. See the http://drupal.org/handbook/cvs guide if you need help with that. Or just ask me.
Yes adding OG filtering logic would be good.
#4
try this version is it ok now?
#5
Please add some docbook/doxygen comments to the new functions. One of the near future goals is to be standard with coding and to be able to look at http://drupal.kollm.org/doxygen/_contrib/drupal-contrib-phpdoc/dirs.html, find advuser and see http://drupal.kollm.org/doxygen/_contrib/drupal-contrib-phpdoc/advuser_2... to get the documented version of the module.
Your JOIN
<?php+ $result = db_query('SELECT node.nid as nid, title FROM {node} JOIN {og} WHERE node.nid = og.nid');
?>
<?php+ $result = db_query('SELECT node.nid as nid, title FROM {node} JOIN {og} ON og.nid = node.nid');
?>
<?php+ $result = db_query('SELECT n.nid, n.title FROM {node} n JOIN {og} og ON og.nid = n.nid');
?>
When you upload your new patch please change the status to "patch (code needs review)".
#6
Hi earnie,
Thanks for the useful hints and here is new version of patch.
#7
Your new functions still need some phpdoc documentation.
<?php/**
* Example phpdoc documentation
*
* @param int $someint
* Provide an param sample
* @return bool
* Operation status
*/
function somefunction ($someint) {
if ($someint) {
return TRUE
}
return FALSE
}
?>
You might want to check http://manual.phpdoc.org/HTMLframesConverter/DOM/default/ or http://www.stack.nl/~dimitri/doxygen/docblocks.html. I plan to test your patch further beginning Monday.
#8
Hey there - this OG stuff seems to work just fine for me. Any plans on making the user search filterable by group membership too?
#9
Thanks for testing and the report. Ivica had mentioned that he was working on a patch for filtering by OG as well. I'm looking forward to it. I've been currently too busy with other things in life and haven't had a chance to give this more attention. We still need the phpdoc documentation comments.
#10
Hi,
Yes I will implement OG filtering but can't tell exactly when - i am also very busy at this moment. But will try to do some work on this and phpdoc next weekend.
#11
Here is new version of patch, this time i also added og filter support. Tested a little bit and Its seems it works fine for 'EQ' operation.
#12
Thanks for the patches. I'm out of cycles for August though I'm afraid. I'll have to review them later.