Using it where? If in CB Auto Actions you'd need to provide what trigger you're using as the group object may already be available. Worst case you just get the value from GET as group id will be in the URL.
We use it in our own created PHP code, some in modules on the GJ Group page. These modules resist in a sidebar of the Joomla template, outside the GJ and CB templates. In the past, we indeed used:
Code:
if(isset($_GET['gid'])){
$GROUP_ID = $_GET['gid'];
} else {
$GROUP_ID = $_GET['id'];
}
But this doesn't work anymore, since you learned to us (last week) to create nice GroupJive SEF URL's like
Code:
/menu_alias/cateogry_id-category_name/group_id-group_name
We were even busy to create menu items for every group (with CB Auto Action - PHP) but given this we maybe have to keep the default GroupJive SEF URL's and use the code below?
Code:
$GROUP_ID = strtok(basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)), '-');
Or do you know a better way to get GROUP_ID from the current displayed group? You have really spoiled us on CB Profile pages with things like
Code:
[cb:userdata field="user_id" user="#displayedOrMe" /]
and we now miss that kind of power on GJ Group pages
You'll need to use SQL to query for that as there's no utility function for that.
Okay, thanks!
P.s.: @Kyle/Krileon: Thank you so much for helping me to figure out the most efficient way to get this kind of things done in GroupJive! As I will use these kinds of things a lot.