2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
18 global $system_courses;
20 // global $_course_id is set when a guest accessing a public course.
21 // This is to solve the issue that the google indexing fails as the session vars are lost.
23 if (isset($_SESSION['course_id'])) $_course_id = $_SESSION['course_id'];
27 $sql = "SELECT * FROM ".TABLE_PREFIX."users_online WHERE course_id=$_course_id AND expiry>".time()." ORDER BY login";
28 $result = mysql_query($sql, $db);
29 if ($row = mysql_fetch_assoc($result)) {
30 echo '<ul style="padding: 0px; list-style: none;">';
32 $type = 'class="user"';
33 if ($system_courses[$_course_id]['member_id'] == $row['member_id']) {
34 $type = 'class="user instructor" title="'._AT('instructor').'"';
36 echo '<li style="padding: 3px 0px;"><a href="'.$_base_path.'profile.php?id='.$row['member_id'].'" '.$type.'>'.AT_print($row['login'], 'members.login').'</a></li>';
37 } while ($row = mysql_fetch_assoc($result));
40 echo '<strong>'._AT('none_found').'</strong><br />';
43 echo '<strong>'._AT('guests_not_listed').'</strong>';
45 $savant->assign('dropdown_contents', ob_get_contents());
47 $savant->assign('title', _AT('users_online'));
48 $savant->display('include/box.tmpl.php');