Exemplo n.º 1
0
function return_last_time($room)
{
    global $db, $prefix, $x7s, $x7c;
    $query = $db->DoQuery("SELECT * FROM {$prefix}online WHERE name='{$x7s->username}' AND room='{$room}'");
    $row = $db->Do_Fetch_Row($query);
    $time = time();
    $user_online = get_online($room);
    $return[0] = array();
    $total_us = count($user_online);
    $row[4] = explode(",", $row[4]);
    $back_2_db = implode(",", $user_online);
    $return[2] = array_diff($user_online, $row[4]);
    $return[3] = array_diff($row[4], $user_online);
    $compared = $return[2] + $return[3];
    if (count($compared) > 0) {
        // Update the online list
        $return[0] = $user_online;
    }
    if (@$row[0] == "") {
        // See if the room is full
        if ($total_us >= $x7c->room_data['maxusers']) {
            return 2;
        }
        $ip = $_SERVER['REMOTE_ADDR'];
        //User can stay one chat per time
        $db->DoQuery("DELETE FROM {$prefix}online WHERE name='{$x7s->username}'");
        $db->DoQuery("INSERT INTO {$prefix}online VALUES('0','{$x7s->username}','{$ip}','{$room}','','{$time}','{$x7c->settings['auto_inv']}')");
        return 1;
    }
    $db->DoQuery("UPDATE {$prefix}online SET time='{$time}',usersonline='{$back_2_db}' WHERE name='{$x7s->username}' AND room='{$room}'");
    // This gets set to the timestamp when the user last got messages
    $return[1] = $row[5];
    // Add the
    return $return;
}
Exemplo n.º 2
0
function print_header($title = ' ', $script = '', $subdir = false, $ismobile = false)
{
    $user = unserialize($_SESSION['user_class']);
    get_online($user->id);
    header("Cache-Control: no-store, no-cache, must-revalidate");
    ?>
<!doctype html>
<html lang="ru" dir="ltl">
<head>
<title><?php 
    echo $title;
    ?>
</title>
<meta charset="utf-8">
<?php 
    /*if($subdir)
        {
          print '<link rel="stylesheet" type="text/css" href="../style.php?c='.$user->colors.'"/>';
        }
        else
        {
          print '<link rel="stylesheet" type="text/css" href="style.php?c='.$user->colors.'"/>';
    
        }*/
    print '<link rel="stylesheet" type="text/css" href="' . LPU_HOST . 'style.php?c=' . $user->colors . '"/>';
    switch (get_browser_info()) {
        case 'Chrome':
        case 'Opera':
            break;
        default:
            echo '<link rel="stylesheet" type="text/css" href="' . LPU_HOST . 'calendar/calendar.css"><script src="' . LPU_HOST . 'calendar/calendar.js" type="text/javascript"></script>';
    }
    ?>
<script type="text/javascript">
<?php 
    print $script;
    ?>
</script>    

<?php 
    if ($ismobile) {
        print '<link rel="stylesheet" href="css/jquery.sidr.dark.css">';
        print '</head><body>
    <!-- Include jQuery -->
    <!--<script src="js/jquery.js"></script>-->
    <script src="js/jquery-2.1.1.js"></script>
    <!-- Include the Sidr JS -->
    <script src="js/jquery.sidr.min.js"></script>
    ';
    } else {
        print '</head><body>';
    }
    $start_time = microtime();
    $start_array = explode(" ", $start_time);
    $GLOBALS['start_time'] = $start_array[1] + $start_array[0];
}
Exemplo n.º 3
0
function get_offline()
{
    return get_total() - get_online();
}
Exemplo n.º 4
0
</th><th><?php 
echo $lang[$l][38];
?>
</th></tr>
            	<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/infected.png"><?php 
echo $lang[$l][39];
?>
:</td><td><?php 
echo get_total();
?>
</td></tr>
            	<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/online.png"><?php 
echo $lang[$l][61];
?>
:</td><td><?php 
echo get_online();
?>
</td></tr>
            	<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/offline.png"><?php 
echo $lang[$l][62];
?>
:</td><td><?php 
echo get_offline();
?>
</td></tr>
			<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/tasks.png"><?php 
echo $lang[$l][40];
?>
:</td><td><?php 
echo get_tasks();
?>