Esempio n. 1
0
function display_menu($with_ranking = false)
{
    if (session_is_registered('valid_user_id')) {
        switch (get_user_status($_SESSION['valid_user_id'])) {
            case 1:
                // normal users have $user_menu
                global $user_menu;
                $menu = $user_menu;
                break;
            case 2:
                // admins have $admin_menu
                global $admin_menu;
                $menu = $admin_menu;
                break;
                // $user_menu and $admin_menu are defined in cfg/config.php
        }
    } else {
        // user not logged in, menu consists only of login option
        $menu = array('' => 'Zaloguj siê');
    }
    ?>
<td width="170" valign="top">
<table bgcolor="#D9E1F0" border="1" width="100%" cellpadding="3" cellspacing="0">
<tr>
	<th class="naglowek_maly">M E N U</th>
</tr>
<?php 
    foreach ($menu as $link => $title) {
        echo '<tr><td><a href="' . get_www_root() . $link . '" class="menu">' . $title . '</a></td></tr>' . "\n";
    }
    ?>
</table>
<?php 
    if ($with_ranking && is_admin()) {
        // only admins can see the ranking.
        echo "<br>\n";
        echo '<table bgcolor="#d9e1f0" border="1" width="100%" cellpadding="3" cellspacing="0">' . "\n";
        echo '<tr><th class="naglowek_maly">';
        echo 'T O P 5';
        echo "</th></tr>\n";
        $what_top = array('user_id' => 'U¿ytkownicy', 'project_id' => 'Projekty');
        foreach ($what_top as $field => $label) {
            $top_5 = get_top_5($field, true);
            if ($top_5 !== false && !empty($top_5)) {
                echo '<tr><td align="center">';
                display_star();
                echo '&nbsp;<b>' . $label . '</b>&nbsp;';
                display_star();
                echo "</td></tr>\n";
                $cur = 1;
                foreach ($top_5 as $id => $count) {
                    echo '<tr><td>' . $cur . '.&nbsp;';
                    if ($field == 'user_id') {
                        display_link_to_user($id);
                    } elseif ($field == 'project_id') {
                        display_link_to_project($id);
                    }
                    echo '&nbsp;(' . $count . ")</td></tr>\n";
                    ++$cur;
                }
            }
        }
        echo "</table>\n";
    }
    ?>
</td><td align="left" valign="top">
<?php 
}
Esempio n. 2
0
</table>

<h1 style="margin-top:20px;margin-bottom:20px;text-align:center;"><?php 
echo $lang[$l][43];
?>
</h1>
<table cellspacing="0">
<tr><th style="width:20%;">IP</th><th>BID</th></th><th style="width:30%;"><?php 
echo $lang[$l][44];
?>
</th><th>Система</th></th><th><?php 
echo $lang[$l][45];
?>
</th></tr>
<?php 
echo get_top_5();
?>
</table>

<h1 style="margin-top:20px;margin-bottom:20px;text-align:center;"><?php 
echo $lang[$l][46];
?>
</h1>
<table cellspacing="0">
<tr><th style="width:30%;"><?php 
echo $lang[$l][47];
?>
</th><th><?php 
echo $lang[$l][48];
?>
</th></tr>