sp_ColumnEnd();
            sp_InsertBreak();
            sp_SectionEnd('', 'topic');
        }
    } else {
        sp_NoTopicsInForumMessage('tagClass=spMessage', __sp('There are no topics in this forum'));
    }
    sp_SectionEnd('', 'topiclist');
    sp_SectionEnd('', 'forum');
    # Start the 'pagelinks' section
    # ----------------------------------------------------------------------
    sp_SectionStart('tagClass=spPlainSection', 'pageLinks');
    sp_TopicNewButton('tagId=spTopicNewButtonBottom&tagClass=spButton spRight', __sp('Add Topic'), __sp('Start a new topic'), __sp('This forum is locked'), __sp('No permission to start topics'));
    sp_TopicIndexPageLinks('', __sp('Page: '), __sp('Jump to page %PAGE% of topics'), __sp('Jump to page'));
    sp_InsertBreak();
    sp_SectionEnd('', 'pageLinks');
    # Start the 'editor' section
    # ----------------------------------------------------------------------
    sp_SectionStart('tagClass=spHiddenSection', 'editor');
    sp_TopicEditorWindow($addTopicForm);
    sp_SectionEnd('', 'editor');
} else {
    sp_NoForumMessage('tagClass=spMessage', __sp('Access denied - you do not have permission to view this page'), __sp('The requested forum does not exist'));
}
sp_SectionEnd('', 'forumView');
sp_SectionEnd('', 'body');
# Load the forum footer template - normally last thing
# ----------------------------------------------------------------------
sp_SectionStart('tagClass=spFootContainer', 'foot');
sp_load_template('spFoot.php');
sp_SectionEnd('', 'foot');
        global $thisAlt;
        $thisAlt = 'spOdd';
        global $spThisForum;
        if (sp_has_forums()) {
            while (sp_loop_forums()) {
                sp_the_forum();
                $out .= sp_ProfilePermissionsForum($spThisForum, $userid);
                # do subforums
                if (!empty($spThisForumSubs)) {
                    foreach ($spThisForumSubs as $sub) {
                        $out .= sp_ProfilePermissionsForum($sub, $userid);
                    }
                }
            }
        } else {
            sp_NoForumMessage('tagClass=spMessage', sp_text('No Forums Found in this Group'));
        }
        $out .= '</div>';
    }
} else {
    sp_NoGroupMessage('tagClass=spMessage', sp_text('Access denied'), sp_text('No Groups Defined'));
}
$out = apply_filters('sph_ProfileUserPermissionsFormBottom', $out, $userid);
$out = apply_filters('sph_ProfileFormBottom', $out, $userid, $thisSlug);
$out .= '</div>';
$out = apply_filters('sph_ProfilePermissionsForm', $out);
echo $out;
# routine for outputting forum or subforum row
function sp_ProfilePermissionsForum($thisForum, $userid)
{
    global $thisAlt;