~ Hello ~

Need some help hacking this abandoned og_forum.module file :) What I'm trying to do is probably common knowledge for most developers (unlike us hackers) so here goes:

All I want to do is change this URL so it uses my custom address, instead of the current one:

Default code:

>
/**
 * 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 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)

Any help would be greatly appreciated, thanks in advance...

Comments

jrstmartin’s picture

Be advised that I'm using clean URLs and the Pathauto module. Again what I'm after here is just how to "call-up" or "fetch" the current group name the user is in.

darren oh’s picture

Status: Active » Closed (works as designed)

Use $group->path.