i hope somebody can help me here. i need a link to the groups forums just like the one given in the "group details" block of og module. i dont need the other links in that block and apparently there is no simple way to change that menu (at least not for a non-programmer like me). but i do need that link...

i managed a link like forum/$gid but then it turned out i needed subforums too and those are generated not with gid path but the group name. this might be hard to understand, dont know how to explain it easier. either way i need the exact link that the "group details" block uses... any ideas?

Comments

Anonymous’s picture

Assigned: Unassigned »

I would download and look at the code for the OG module . Using "Find" in a text editor should help.

aschiwi’s picture

good tip... i found something that might be helpful in og forum module. they seem to be using forum/$forum in this following function:

<?php
/**
 * 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_container($group->nid);
  if ($forum) {
    $links[] = l(t('Group forums'), "forum/$forum", array('title' => t('View group forum discussions.')));
  // Add forum creation link for the group managers
    if (og_forum_is_admin($group)) {
      $links[] = l(t('Manage group forums'), 'og_forum/manage/' . $group->nid, array('title' => t('Let you create, edit, delete group\'s forums.')));
    }
  }
  return $links;
} // function og_forum_og_create_links()
?>

i tried a few things but i am not very familiar with php. i want to implement the link in another block with the following code

<?php
if (module_exists('og')) {
  $group_node = og_get_group_context();
  $gid02 = $group_node->nid;
  $gid = (int)$gid02;
  if ($gid02 === null) $gid = 0;
  $output .= "<ul class=\"menu\">
<li class=\"leaf\"><a title=\"Startseite\" href=\"/portal/node/$gid\">Startseite $group_node->title </a></li>
<li class=\"leaf\"><a title=\"Dateiverzeichnis\" href=\"/portal/node/$gid/teilnehmerunterlagen\">Teilnehmerunterlagen</a></li>
<li class=\"leaf\"><a title=\"Teilnehmer\" href=\"/portal/node/$gid/teilnehmer\">Teilnehmer</a></li>
<!--<li class=\"leaf\"><a title=\"Forum\" href=\"/portal/forum/$forum">Forum</a></li>--> <-- THIS MAKES THE WHOLE BLOCK DISAPPEAR -->
</ul>
";
print $output;
}
?>

Using the forum/$forum makes the whole block disappear... does using that code in that way even make sense or am i missing something? i would also like to use the if ($forum) { because not all groups use a forum.

Anonymous’s picture

Assigned: » Unassigned
Anonymous’s picture

Apologies ,

I don't have the time to look into this at the moment as i am working on stabilizing OG Forum ready to begin the migration to D6.

Can anyone spare sometime to help out aschiwi ?

Thanks Paul

Anonymous’s picture

Status: Active » Closed (fixed)

I'm closing this support request as it has been inactive for a long time , please reopen if you still require support.

Thanks, Paul