Esempio n. 1
0
<?php

include_once "usersOnline.class.php";
$visitors_online = new usersOnline();
echo $visitors_online->usersOnline();
Esempio n. 2
0
<div class="nav_box"><div class="nav">Stats</div>
<div class="nav_box2"><div style="margin:5px;">
<?php 
$query = yasDB_select("SELECT * FROM stats where id=1");
$totalplays = $query->fetch_array(MYSQLI_ASSOC);
$query->close();
$query = yasDB_select("SELECT * FROM stats where id=2");
$dayplays = $query->fetch_array(MYSQLI_ASSOC);
$query->close();
$query = yasDB_select("SELECT count(id) as count FROM games");
$count = $query->fetch_array(MYSQLI_ASSOC);
$query->close();
$visitors_online = new usersOnline();
?>
<b>Game Plays Today:</b> <?php 
echo $dayplays['numbers'];
?>
<br/>
<b>Total Game Plays:</b> <?php 
echo $totalplays['numbers'];
?>
<br/>
<b>Total Games:</b> <?php 
echo $count['count'];
?>
<br/>
<b>visitors online:</b> <?php 
echo $visitors_online->count_users();
?>
<br/>
<b>Bots online:</b>
Esempio n. 3
0
<div class="main_header"><strong>Who's Online:</strong></div>
<div class="main_box"> 
<strong>Members:</strong>
<strong>Newest Members:</strong>
<strong>Visitors Online:</strong>
<?php 
$active_length = 600;
// How many seconds to count an user as active until they access another page... 600 = 10 minutes
$query = yasDB_select("SELECT count(user.id) as count FROM user ");
$row = $query->fetch_array(MYSQLI_ASSOC);
echo '' . $row['count'] . '';
$query = yasDB_select("SELECT * from user order by id desc limit 5");
while ($row = $query->fetch_array(MYSQLI_ASSOC)) {
    echo '<a  href="' . $setting['siteurl'] . 'showmember/ ' . $row['id'] . '.html" style="color:' . get_random_color() . '"> ' . $row['username'] . '&nbsp;&nbsp;</a>';
}
$visitors_online = new usersOnline();
echo $visitors_online->count_users();
?>

<strong>Members Online:</strong>
<?php 
$time = time() - $active_length;
$query = yasDB_select("SELECT count(memberid) as count from membersonline WHERE `timeactive`>= {$time}");
$query2 = yasDB_select("SELECT memberid FROM membersonline");
$row = $query->fetch_array(MYSQLI_ASSOC);
$row2 = $query2->fetch_array(MYSQLI_ASSOC);
if ($row['count'] > 0) {
    foreach ($row2 as $member) {
        $result = yasDB_select("SELECT username FROM user WHERE id = '{$member}'");
        $name = $result->fetch_array(MYSQLI_NUM);
        echo '<a  href="' . $setting['siteurl'] . 'showmember/ ' . $member . '.html" style="color:' . get_random_color() . '"> ' . $name[0] . '</a>';
Esempio n. 4
0
            } else {
                $ip = $_SERVER['REMOTE_ADDR'];
            }
            return $ip;
        }
    }
}
function doLog($text)
{
    global $setting;
    $filename = $setting['sitepath'] . "/jobs_log.txt";
    $fh = fopen($filename, "a");
    fwrite($fh, date("d-m-Y, H:i") . " - {$text}\n");
    fclose($fh);
}
$currentIp = new usersOnline();
$now = time();
$midnight_today = mktime(23, 59, 59);
$plus_week = strtotime('+7 days', $midnight_today);
$plus_month = strtotime('+30 days', $midnight_today);
$update = 0;
// empty daily game plays
if ($jobs['dayplays'][2] != 0 && $jobs['dayplays'][1] <= $now || $runjob == 'dayplays') {
    $update = 1;
    $displayIp = $runjob == 'dayplays' ? 'Admin' : $currentIp->ipCheck();
    yasDB_update("UPDATE `stats` SET numbers = 0 WHERE id = 2");
    yasDB_update("UPDATE `stats` SET numbers = 0 WHERE id = 3");
    $jobs['dayplays'][1] = $midnight_today;
    doLog("Daily game plays emptied triggered by visitor " . $displayIp);
}
// create game feeds
Esempio n. 5
0
<?php

include_once "../config/usersOnline.class.php";
$visitors_online = new usersOnline();
$OnlineUsers = $visitors_online->count_users();
echo $OnlineUsers;
if (count($visitors_online->error) == 0) {
    if ($visitors_online->count_users() == 1) {
        echo "There is " . $visitors_online->count_users() . " visitor online";
    } else {
        echo "There are " . $visitors_online->count_users() . " visitors online";
    }
} else {
    echo "<b>Users online class errors:</b><br /><ul>\r\n";
    for ($i = 0; $i < count($visitors_online->error); $i++) {
        echo "<li>" . $visitors_online->error[$i] . "</li>\r\n";
    }
    echo "</ul>\r\n";
}