.:: Hello ::.
Need some help changing a small piece of code from (the abandoned) og_forum.module file.
All I want to do is change the way a URL is created:
>
/**
* Implementation of hook_og_create_links().
*/
function og_forum_og_create_links($group) {
global $user;
$links = array();
// Get group's forum
$forum = og_forum_get_forum($group->nid);
if ($forum) {
$links[] = l(t('Forums'), "og_forum/$forum/$group->nid", array('title' => t('View group forum discussions.')));
}
return $links;
}
I use groups heavily on my site. I want to change "og_forum/$forum/$group->nid" to "forums/GROUP-NAME-HERE". I've tried to fetch the group name using everything I know:
* $group->nid ~ that's not what I want, I want the actual group name in the URL not the number
* $group->name ~ this prints the current username for some reason
* $group->title ~ this prints the group name but not in URL format (no dashes in between words)
Be advised that I'm using clean URLs and the Pathauto module. That's not the issue. What I'm after here is just how to "fetch" the current group name the user is in, from within this .module file.
Any help would be greatly appreciated, thanks in advance...