Beispiel #1
0
			<a href="#" onClick="loadpage('./forums.php?forum=<?php 
echo $forum;
?>
&p=0',document.title,document.body.id);"><?php 
echo $forum;
?>
</a> </p>			<p class="datetime">All times are GMT</p>		</td>
	</tr>
	</table>		<br clear="all" />
 
		<?php 
$res = mysql_query("select count(username) from beta_users where forum_online='online'") or die(mysql_error());
$res2 = mysql_query("select username from beta_users where forum_online='online'") or die(mysql_error());
$row = mysql_fetch_assoc($res);
include 'visitors.php';
$guests = CountGuests() - $row['count(username)'];
$user = "******"tablebg\" width=\"100%\" cellspacing=\"0\">";
$user .= "<tr>";
$user .= "<td class=\"cat\"><h4>Who is online</h4></td></tr><tr>";
$user .= "<td class=\"row1\" width=\"100%\"><span class=\"genmed\">Users on this forum ";
$user .= ":: " . $row['count(username)'] . " registered and " . $guests . " guests ";
$user .= "<br />";
$i = 0;
if (mysql_num_rows($res2) > 0) {
    while ($row2 = mysql_fetch_assoc($res2)) {
        $res3 = mysql_query("select authlevel from beta_users where username = '******'username'] . "'") or die(mysql_error());
        $row3 = mysql_fetch_assoc($res3);
        if ($row3['authlevel'] != 0) {
            if ($row3['authlevel'] != 1) {
                if ($row3['authlevel'] != 2) {
                    $status = "Site Admin";
Beispiel #2
0
    if (is_array($dbarray)) {
        while (list($user_ip, $user_time) = each($dbarray)) {
            if ($user_ip != $currentIP && $user_time + $offline > $current_time) {
                $dbarray_new[$user_ip] = $user_time;
            }
        }
    }
    $dbarray_new[$currentIP] = $current_time;
    // add record for current user
    $fp = fopen($dbguests, "w");
    fputs($fp, serialize($dbarray_new));
    fclose($fp);
    $out = sprintf("%01d", count($dbarray_new));
    // format the result to display 3 digits with leading 0's
    return $out;
}
function guestIP()
{
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } elseif (isset($_SERVER['REMOTE_ADDR'])) {
        $ip = $_SERVER['REMOTE_ADDR'];
    } else {
        $ip = "0";
    }
    return $ip;
}
$visitors_online = CountGuests();
?>