Source for file online.inc.php
Documentation is available at online.inc.php
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2005 Dokeos S.A.
Copyright (c) Istvan Mandak
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
==============================================================================
==============================================================================
* Code library for showing Who is online
* @author Istvan Mandak, principal author
* @author Denes Nagy, principal author
* @author Roan Embrechts, cleaning and bugfixing
* @package dokeos.whoisonline
==============================================================================
* Enter description here...
* @param unknown_type $uid
* @param unknown_type $statistics_database
* @todo the second parameter is of no use.
$login_ip = $_SERVER['REMOTE_ADDR'];
$login_date = date("Y-m-d H:i:s",$reallyNow);
// if the $_course array exists this means we are in a course and we have to store this in the who's online table also
// to have the x users in this course feature working
$query = "INSERT INTO ". $online_table . " (login_id,login_user_id,login_date,login_ip, course) VALUES ($uid,$uid,'$login_date','$login_ip', '". $_course['id']. "')";
$query = "INSERT INTO ". $online_table . " (login_id,login_user_id,login_date,login_ip) VALUES ($uid,$uid,'$login_date','$login_ip')";
* Enter description here...
* @param unknown_type $uid
* @todo the name is not very clear. I would expect that it deletes a login from the tracking info or even it deletes a user.
* @todo remove parameter $statistics_database which is no longer necessary
$query = "SELECT login_user_id,login_date FROM ". $track_online_table . " WHERE DATE_ADD(login_date,INTERVAL $valid MINUTE) >= NOW() ";
$rdate = date("Y-m-d H:i:s",$rtime);
// YYYY-MM-DD HH:MM:SS, db date format
$hour = substr($login_date,11,2);
$minute = substr($login_date,14,2);
$secund = substr($login_date,17,2);
$month = substr($login_date,5,2);
$day = substr($login_date,8,2);
$year = substr($login_date,0,4);
$dbtime = mktime($hour,$minute,$secund,$month,$day,$year);
//echo $dbtime.":".$rtime.">".$validtime."<BR>";
//echo "$login_user_id.":".$login_date.";";
$query = "SELECT firstname,lastname FROM ". $user_table. " WHERE user_id='$safe_uid'";
$str = $lastname. " ". $firstname;
for($i= 0;$i < sizeof($url)- 2; $i++ )
$str = $str. $url[$i]. "/";
$query = "SELECT `picture_uri` FROM ". $user_table. " WHERE `user_id`='$uid'";
if (count($picture_uri)> 0)
$sql= "select chatcall_user_id, chatcall_date from $track_user_table where ( user_id = '". $_user['user_id']. "' )";
$login_date= $row['chatcall_date'];
$hour = substr($login_date,11,2);
$minute = substr($login_date,14,2);
$secund = substr($login_date,17,2);
$month = substr($login_date,5,2);
$day = substr($login_date,8,2);
$year = substr($login_date,0,4);
$calltime = mktime($hour,$minute,$secund,$month,$day,$year);
$time = date("Y-m-d H:i:s", $time);
$minute_passed= 5; //within this limit, the chat call request is valid
if (($row['chatcall_user_id']) and ($calltime> $limittime)) {
. "<a href=\"". $webpath. "chat/chat.php?cidReq=". $_cid. "&origin=whoisonlinejoin\">"
. " | "
* Returns a list (array) of users who are online and in this course.
$query = "SELECT login_user_id,login_date FROM ". $track_online_table . " WHERE course='". $coursecode. "' AND DATE_ADD(login_date,INTERVAL $valid MINUTE) >= NOW() ";
$rdate = date("Y-m-d H:i:s",$rtime);
// YYYY-MM-DD HH:MM:SS, db date format
$hour = substr($login_date,11,2);
$minute = substr($login_date,14,2);
$secund = substr($login_date,17,2);
$month = substr($login_date,5,2);
$day = substr($login_date,8,2);
$year = substr($login_date,0,4);
$dbtime = mktime($hour,$minute,$secund,$month,$day,$year);
if ($dbtime >= $validtime)
//echo $dbtime.":".$rtime.">".$validtime."<BR>";
//echo "$login_user_id.":".$login_date.";";
|