Index: og_forum.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/og_forum/Attic/og_forum.module,v retrieving revision 1.11.2.11.2.20 diff -u -p -r1.11.2.11.2.20 og_forum.module --- og_forum.module 14 Oct 2008 10:20:13 -0000 1.11.2.11.2.20 +++ og_forum.module 2 Dec 2008 20:32:17 -0000 @@ -733,8 +733,9 @@ function og_forum_settings_submit($form_ function og_forum_set_og_group_context_from_tid($tid=0) { $sql = "SELECT nid FROM {og_term} WHERE tid = %d"; if ($gid = db_result(db_query($sql, $tid))) { - $group_node = node_load($gid); - og_set_group_context($group_node); + $group_node = node_load($gid); + og_set_group_context($group_node); + og_set_theme($gid); } } // function og_forum_set_og_group_context_from_tid() @@ -859,6 +860,10 @@ function og_forum_nodeapi($node, $op, $t case 'load': if ($node->type == 'forum' && $og_forum_nid = db_result(db_query('SELECT nid FROM {og_term} WHERE tid = %d', $node->tid))) { $node->og_forum_nid = $og_forum_nid; + // Set group theme + global $theme, $custom_theme; + if (!isset($theme)) + og_set_theme($og_forum_nid); } break; case 'prepare': @@ -1118,7 +1123,18 @@ function og_forum_nodeapi($node, $op, $t } // If we're viewing a forum post in a group forum, set that // group as the context. - if ($page && $node->og_groups && $node->type == 'forum') { + if ($page && !og_is_omitted_type($node->type) && $node->type == 'forum') { + // If not og_groups set, look for group (when og_type = 'omitted_mail') + if (!isset($node->og_groups)) { + foreach($node->taxonomy as $term) { + $rs = db_query('SELECT * FROM {og_term} WHERE tid = %d', $term->tid); + if (db_num_rows($rs)) { + $term = db_fetch_object($rs); + $node->og_groups[0] = $term->nid; + break; + } + } + } og_set_group_context(node_load($node->og_groups[0])); if (is_numeric($node->tid)) { @@ -1753,4 +1769,4 @@ function og_forum_is_public($tid) { else { return 0; } -} // function og_forum_is_public() \ No newline at end of file +} // function og_forum_is_public()