2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
14 define('AT_INCLUDE_PATH', '../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16 session_write_close();
17 //authenticate(USER_CLIENT, USER_ADMIN);
18 require(AT_INCLUDE_PATH.'../mods/_standard/chat/lib/chat.inc.php');
20 $myPrefs = getPrefs($_SESSION['login']);
22 require('include/html/chat_header.inc.php');
24 <table width="100%" border="0" cellpadding="5" cellspacing="0">
26 <th align="left"><?php echo _AT('chat_options'); ?></th>
30 <table width="100%" border="0" cellpadding="5" cellspacing="0">
32 <td align="right"><a href="prefs.php" target="_top" onfocus="this.className='highlight'" onblur="this.className=''"><?php echo _AT('chat_edit_prefs'); ?></a> | <a href="logout.php" target="_top" accesskey="q" onfocus="this.className='highlight'" onblur="this.className=''"><?php echo _AT('chat_exit'); ?></a></td></tr></table>
34 <table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
36 align="left"><?php echo _AT('chat_list_and_history'); ?></th></tr></table><?php
38 if ($dir = opendir(AT_CONTENT_DIR . 'chat/'.$_SESSION['course_id'].'/users/')) {
39 while (($file = readdir($dir)) !== false) {
40 if (($file == '..') || ($file == '.')) {
44 $chatName = substr($file, 0, -strlen('.prefs'));
45 $la = getLastAccessed($chatName);
48 if (($la == 0) || (!$la)) {
50 } else if ($now - $la < $admin['chatSessionLifeSpan']) {
51 $colour = getChatIDColour($chatName, $myPrefs['colours']);
52 if ($chatName == $_SESSION['login']) {
53 echo '<li><a href="filterHistory.php?filterChatID='.$chatName.'" target="_top" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'"><span style="color:'.$colour.'">'.$chatName.'</span></a> ('._AT('chat_you').')</li>';
54 } else if($chatName != '') {
55 echo '<li><a href="filterHistory.php?filterChatID='.$chatName.'" target="_top" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'"><span style="color:'.$colour.'">'.$chatName.'</span></a></li>';
58 resetLastAccessed($chatName);
59 $topMsgNum = $bottomMsgNum = 0;
60 howManyMessages($topMsgNum, $bottomMsgNum);
61 postMessage(_AT('chat_system'),
62 require(AT_INCLUDE_PATH.'../mods/_standard/chat/lib/chat.inc.php'), _AT('chat_user_logged_out', $chatName),
71 echo '<table width="100%" border="0" cellpadding="5" cellspacing="0">
72 <tr><td align="right"><a href="history.php" target="_top" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AT('chat_full_history').'</a> | <a href="options.php" target="options" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AT('chat_refresh_user_list').'</a></td></tr></table>';
74 //if ($myPrefs['navigationAidFlag'] > 0) {
76 echo '<table width="100%" border="0" cellpadding="5" cellspacing="0">
77 <tr><td align="left"><h4>'._AT('chat_quick_keys').'</h4></td></tr></table>';
79 echo '<ul><li>'._AT('chat_altc').'</li>
80 <li>'._AT('chat_post').'</li>
81 <li>'._AT('chat_altr').'</li>
82 <li>'._AT('chat_altm').'</li>
83 <li>'._AT('chat_altq').'</li></ul>';
87 require('include/html/chat_footer.inc.php');