Esempio n. 1
0
 $numForums = DB_numRows($forumQuery);
 $numForumsDisplayed = 0;
 $forumlisting->set_block('forumlisting', 'forumrows', 'frow');
 while ($B = DB_FetchArray($forumQuery)) {
     if (_ff_canUserViewRating($B['forum_id'])) {
         $lastforum_noaccess = false;
         $topicCount = $B['topic_count'];
         $postCount = $B['post_count'];
         if ($_FF_CONF['show_moderators']) {
             $modsql = DB_query("SELECT * FROM {$_TABLES['ff_moderators']} WHERE mod_forum=" . (int) $B['forum_id']);
             $moderatorcnt = 1;
             if (DB_numRows($modsql) > 0) {
                 while ($showmods = DB_fetchArray($modsql, false)) {
                     if ($showmods['mod_uid'] == '0') {
                         if ($showmods['mod_groupid'] > 0) {
                             $showmods['mod_username'] = _ff_getGroup($showmods['mod_groupid']);
                         }
                         if ($moderatorcnt == 1 or $moderators == '') {
                             $moderators = $showmods['mod_username'];
                         } else {
                             $moderators .= ', ' . $showmods['mod_username'];
                         }
                     } else {
                         if ($moderatorcnt == 1 or $moderators == '') {
                             $moderators = COM_getDisplayName($showmods['mod_uid']);
                         } else {
                             $moderators .= ', ' . COM_getDisplayName($showmods['mod_uid']);
                         }
                     }
                     $moderatorcnt++;
                 }
Esempio n. 2
0
function FF_ForumHeader($forum, $showtopic)
{
    global $_TABLES, $_USER, $_CONF, $_FF_CONF, $LANG_GF01, $LANG_GF02;
    $retval = '';
    $navbar = new Template($_CONF['path'] . 'plugins/forum/templates/');
    $navbar->set_file(array('topicheader' => 'navbar.thtml'));
    $navbar->set_var('search_forum', f_forumsearch());
    $navbar->set_var('select_forum', f_forumjump());
    if ($_FF_CONF['usermenu'] == 'navbar') {
        if ($forum == 0) {
            $navbar->set_var('navmenu', FF_NavbarMenu($LANG_GF01['INDEXPAGE']));
        } else {
            $navbar->set_var('navmenu', FF_NavbarMenu());
        }
    } else {
        $navbar->set_var('navmenu', '');
    }
    $navbar->parse('output', 'topicheader');
    $retval .= $navbar->finish($navbar->get_var('output'));
    if ($forum != '' || $showtopic != '') {
        if ($showtopic != '') {
            $forum_id = DB_getItem($_TABLES['ff_topic'], 'forum', "id=" . (int) $showtopic);
            $grp_id = DB_getItem($_TABLES['ff_forums'], 'grp_id', "forum_id=" . (int) $forum_id);
        } elseif ($forum != "") {
            $grp_id = DB_getItem($_TABLES['ff_forums'], 'grp_id', "forum_id=" . (int) $forum);
        }
        $groupname = _ff_getGroup($grp_id);
        if (!SEC_inGroup($groupname)) {
            $retval .= FF_BlockMessage($LANG_GF01['ACCESSERROR'], $LANG_GF02['msg77'], false);
            $retval .= FF_siteFooter();
            echo $retval;
            exit;
        }
    }
    return $retval;
}