<?PHP


    $adm_add_mass = NULL;
    $adm_add = NULL;

    if (!isset($user) || $user['level'] == 0) {
        $q222 = mysql_query("SELECT * FROM `forum_f` WHERE `adm` = '1'");

        if (mysql_num_rows($q222) != 0) {
            $adm_add = ' WHERE ';

            while ($adm_f = mysql_fetch_assoc($q222)) {
                $adm_add_mass[] = $adm_f['id'];
            }

            for ($zzz = 0; $zzz < count($adm_add_mass); $zzz++) {
                $adm_add .= "`id_forum` <> '$adm_add_mass[$zzz]'";
                if (count($adm_add_mass) != $zzz + 1) { 
                    $adm_add .= ' AND ';
                }
            }
        }
    }
    
    $k_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` $adm_add "),0);
    $k_t = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` $adm_add "),0);
    $k_n_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `time` > '" . $ftime . "'"),0);
    $k_n_t = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `time_create` > '" . $ftime . "'"),0);
    $qwe= mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '" . (time() - 600) . "' AND `url` like '/forum/%'"), 0).' чел';

    echo '(' . $qwe . '/' . $k_p . '/' . $k_t . ')';
    ?>
    <?= ($k_n_p > 0 ? '<span style="color: green;"><b>+' . $k_n_p . '</b></span>' : '')?>
    <?= ($k_n_t > 0 ? '<span style="color: red;"><b>+' . $k_n_t . '</b></span>' : '')?>
    <?

