If the GJ class file is included or is already loaded you can use the below get a list of groups the user owns or has joined.
Code:
$groups = cbgjData::getGroups( array( $array( 'grp_creator', 'grp_leave' ), $user ) );
Ensure $user provided is the user you're trying to the display the groups of.
The below is API to generate a link to those groups.
Code:
$url = cbgjClass::getPluginURL( array( 'groups', 'show', $group->category, $group->id ) );
So a final result would for example be the following.
Code:
$groups = cbgjData::getGroups( array( $array( 'grp_creator', 'grp_leave' ), $user ) );
$return = null;
if ( $groups ) foreach( $groups as $group ) {
$return .= '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'show', $group->category, $group->id ) ) . '">' . htmlspecialchars( $group->name ) . '</a></div>';
}
return $return;