* - $forum->link: The URL to link to this forum.
 * - $forum->description: The description of this forum.
 * - $forum->new_topics: True if the forum contains unread posts.
 * - $forum->new_url: A URL to the forum's unread posts.
 * - $forum->new_text: Text for the above URL which tells how many new posts.
 * - $forum->old_topics: A count of posts that have already been read.
 * - $forum->num_posts: The total number of posts in the forum.
 * - $forum->last_reply: Text representing the last time a forum was posted or
 *   commented in.
 *
 * @see template_preprocess_forum_list()
 * @see theme_forum_list()
 */
$main_forum = forum_term_load($forum_id);
$forum_description = $main_forum['description'];
if (!og_is_group_member(arg(1))) {
    ?>
<div class="link-wrapper"><a class="join-link" href="/communities/og/subscribe/<?php 
    print arg(1);
    ?>
?destination=node/<?php 
    print arg(1);
    ?>
/forums">Join This Community</a></div>
<?php 
}
?>
<table id="forum-<?php 
print $forum_id;
?>
" class="forum-table">
/**
 * Test if user is member of Group, via safe call to OG function.
 */
function _groupadmin_is_group_member($gid, $uid)
{
    return _groupadmin_checkfunc('og_is_group_member') ? og_is_group_member($gid, FALSE, $uid) : FALSE;
}
if ($links) {
    ?>
    <div class="links">
      <?php 
    print $links;
    ?>
    </div>
    <?php 
}
?>
    </div>
    
    <!-- JOIN GROUP OR LEAVE GROUP BUTTON -->
    <?php 
if ($page && !$is_edit) {
    if (og_is_group_member($node, FALSE)) {
        ?>
                <div class="og-buttons">
                <?php 
        global $user;
        if (og_menu_access_unsubscribe($node)) {
            print l('<span>' . t('Leave') . '</span>', 'og/unsubscribe/' . $node->nid . '/' . $user->uid, array('attributes' => array('title' => t('Leave this group'), 'class' => 'og-unsubscribe-button', 'rel' => 'nofollow'), 'html' => TRUE, 'query' => drupal_get_destination()));
        }
        ?>
                </div>    
    <?php 
    } else {
        ?>
    
            <div class="og-buttons"> 
            <?php 
 * - $topic->num_comments: The number of replies on this topic.
 * - $topic->new_replies: A flag to indicate whether there are unread comments.
 * - $topic->new_url: If there are unread replies, this is a link to them.
 * - $topic->new_text: Text containing the translated, properly pluralized count.
 * - $topic->created: An outputtable string represented when the topic was posted.
 * - $topic->last_reply: An outputtable string representing when the topic was
 *   last replied to.
 * - $topic->timestamp: The raw timestamp this topic was posted.
 * - $topic->new: 1 if this is a new/updated topic for the current user.
 *
 * @see template_preprocess_forum_topic_list()
 * @see advanced_forum_preprocess_forum_topic_list()
 */
print $pager;
global $user;
if ($user->uid && !og_is_group_member(arg(1))) {
    ?>
	<em><?php 
    print "You must join this community to post forum topics.";
    ?>
</em>
 	<div class="link-wrapper"><a class="join-link" href="/communities/og/subscribe/<?php 
    print arg(1);
    ?>
?destination=node/<?php 
    print arg(1);
    ?>
">Join This Community</a></div>
<?php 
}
?>
            <?php 
print $pre_sidebar_first;
?>

            <!-- main group: width = grid_width - sidebar_first_width -->
            <div id="main-group" class="main-group row nested <?php 
print $main_group_width;
?>
">
              <div id="main-group-inner" class="main-group-inner inner">
			  <?php 
global $user;
$id = $user->uid;
$node = node_load(arg(1));
// Find out if the current user is a member of this group or not
$ismember = og_is_group_member($node);
// For some reason, if anonymous user then the list of taxonomy
// terms for this current page is empty. So I have to query the
// database directly. Get the title of the node, add " Private"
// to it to get the private taxonomy term for this group. Go get
// the taxonomy terms for this node (all of them by tid) and go
// through the list to see if the private term is in there.
$title = $node->title;
$tname = $title;
$tpname = $title . " Private";
$rname = "Restricted";
$isrestricted = false;
$isprivate = false;
$result = db_query("SELECT term_data.tid,term_data.name FROM term_node,term_data WHERE term_node.nid = {$node->nid} AND term_node.tid = term_data.tid");
if ($result) {
    while ($term = db_fetch_object($result)) {
    ?>
    <div class="links">
      <?php 
    print $links;
    ?>
    </div>
    <?php 
}
?>
  </div><!-- /inner -->

  <?php 
$cnid = !empty($node->field_contest[0]['nid']) ? $node->field_contest[0]['nid'] : -1;
$cnode = node_load($cnid);
$cstate = !empty($cnode->field_contest_state[0]['value']) ? $cnode->field_contest_state[0]['value'] : NULL;
if (!empty($cnode) && $cstate == ContestState::OPEN && !og_is_group_member($node)) {
    ?>
  <div class="subscribe-og">
      <?php 
    print og_subscribe_link($node);
    ?>
  </div>
  <?php 
}
?>

  <?php 
if ($node_bottom && !$teaser) {
    ?>
  <div id="node-bottom" class="node-bottom row nested">
    <div id="node-bottom-inner" class="node-bottom-inner inner">