Location: PHPKode > projects > PhpMyForum > phpmyforum_4_1_1/team.php
<?php
define('PMF_INCLUDE', 1);
require('head.php');
access('team');

#
#
### Benutzergruppen
$result = $_db->query('SELECT id, name
                       FROM `'.$_cfg['DB_PREFIX'].'group`
                       WHERE in_team = 1
                       ORDER BY name');
while ($Daten = $_db->fetch_array($result)) {
    $access[$Daten['id']] = $Daten['name'];
}
$access_lines = '';
if (is_array($access)) {
    foreach ($access AS $id => $access_name) {
        $user_lines = '';
        $result = $_db->query('SELECT *
                               FROM `'.$_cfg['DB_PREFIX'].'user`
                               WHERE group_id = '.$id.'
                               ORDER BY name');
        while ($Daten = $_db->fetch_array($result)) {
            // Online ?
            $online = (isset($_online['member'][$Daten['id']])) ? 'online' : 'offline';
            $user_lines .= eval('return ("'.$_style->get('team_user_line').'");');
        }
        $access_lines .= ($_db->num_rows($result) > 0) ? eval('return ("'.$_style->get('team_access_line').'");') : '';
    }
}
unset($access);


#
#
### Moderatoren
$mods = array();
$result = $_db->query('SELECT b.id AS b_id, b.name AS b_name, u.*
                       FROM `'.$_cfg['DB_PREFIX'].'board_mod` AS m
                            LEFT JOIN `'.$_cfg['DB_PREFIX'].'board` AS b ON m.board_id = b.id
                            LEFT JOIN `'.$_cfg['DB_PREFIX'].'user` AS u ON m.user_id = u.id
                       WHERE b.id IN ('.get_aviable_boards('board').')');
while ($Daten = $_db->fetch_array($result)) {
    if (!$mods[$Daten['id']]) $mods[$Daten['id']] = $Daten;
    $mods[$Daten['id']]['boards'][$Daten['b_id']] = $Daten['b_name'];
}
$mod_lines = '';
if (is_array($mods)) {
    foreach ($mods AS $id => $mod) {
        $forum_lines = '';
        foreach ($mod['boards'] AS $board_id => $board_name) {
            $forum_lines .= eval('return ("'.$_style->get('team_forum_line').'");');
        }
        // Online ?
        $online = (isset($_online['member'][$mod['id']])) ? 'online' : 'offline';
        $mod_lines .= eval('return ("'.$_style->get('team_mod_line').'");');
    }
}

eval('echo "'.$_style->get('team').'";');

footer();
?>
Return current item: PhpMyForum