[svn r14862] Chat error message when 2 pages of Dokeos are open.

skala
Julio Montoya 17 years ago
parent e3d52400ae
commit 46c5153b11
  1. 216
      main/chat/chat_chat.php
  2. 208
      main/chat/chat_message.php
  3. 126
      main/chat/chat_whoisonline.php
  4. 15
      main/chat/header_frame.inc.php

@ -36,118 +36,124 @@ $language_file = array ('chat');
require('../inc/global.inc.php');
include(api_get_path(LIBRARY_PATH).'document.lib.php');
include (api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
$reset=$_GET['reset']?true:false;
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);
list($pseudoUser)=mysql_fetch_row($result);
$isAllowed=(empty($pseudoUser) || !$_cid)?false:true;
$isMaster=$is_courseAdmin?true:false;
$dateNow=date('Y-m-d');
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
$chatPath=$documentPath.'chat_files/';
$TABLEITEMPROPERTY= Database::get_course_table(TABLE_ITEM_PROPERTY);
if(!is_dir($chatPath))
{
if(is_file($chatPath))
$course=api_get_course_id();
// if we have the session set up
if (!empty($course))
{
$reset=$_GET['reset']?true:false;
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);
list($pseudoUser)=mysql_fetch_row($result);
$isAllowed=(empty($pseudoUser) || !$_cid)?false:true;
$isMaster=$is_courseAdmin?true:false;
$dateNow=date('Y-m-d');
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
$chatPath=$documentPath.'chat_files/';
$TABLEITEMPROPERTY= Database::get_course_table(TABLE_ITEM_PROPERTY);
if(!is_dir($chatPath))
{
@unlink($chatPath);
if(is_file($chatPath))
{
@unlink($chatPath);
}
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
@mkdir($chatPath,$perm);
@chmod($chatPath,$perm);
$doc_id=add_document($_course,'/chat_files','folder',0,'chat_files');
api_sql_query("INSERT INTO ".$TABLEITEMPROPERTY . " (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$doc_id,'DocumentAdded',1,0,NULL,0)");
}
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
@mkdir($chatPath,$perm);
@chmod($chatPath,$perm);
$doc_id=add_document($_course,'/chat_files','folder',0,'chat_files');
api_sql_query("INSERT INTO ".$TABLEITEMPROPERTY . " (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$doc_id,'DocumentAdded',1,0,NULL,0)");
if(!file_exists($chatPath.'messages-'.$dateNow.'.log.html'))
{
@fclose(fopen($chatPath.'messages-'.$dateNow.'.log.html','w'));
}
if(!file_exists($chatPath.'messages-'.$dateNow.'.log.html'))
{
fclose(fopen($chatPath.'messages-'.$dateNow.'.log.html','w'));
$doc_id=add_document($_course,'/chat_files/messages-'.$dateNow.'.log.html','file',0,'messages-'.$dateNow.'.log.html');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id']);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
}
if($reset && $isMaster)
{
$i=1;
while(file_exists($chatPath.'messages-'.$dateNow.'-'.$i.'.log.html'))
$doc_id=add_document($_course,'/chat_files/messages-'.$dateNow.'.log.html','file',0,'messages-'.$dateNow.'.log.html');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id']);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
}
if($reset && $isMaster)
{
$i++;
$i=1;
while(file_exists($chatPath.'messages-'.$dateNow.'-'.$i.'.log.html'))
{
$i++;
}
@rename($chatPath.'messages-'.$dateNow.'.log.html',$chatPath.'messages-'.$dateNow.'-'.$i.'.log.html');
@fclose(fopen($chatPath.'messages-'.$dateNow.'.log.html','w'));
$doc_id=add_document($_course,'/chat_files/messages-'.$dateNow.'-'.$i.'.log.html','file',filesize($chatPath.'messages-'.$dateNow.'-'.$i.'.log.html'),'messages-'.$dateNow.'-'.$i.'.log.html');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id']);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
$doc_id = DocumentManager::get_document_id($_course,'/chat_files/messages-'.$dateNow.'.log.html');
update_existing_document($_course, $doc_id,0);
}
$content=file($chatPath.'messages-'.$dateNow.'.log.html');
$nbr_lines=sizeof($content);
$remove=$nbr_lines-100;
if($remove < 0)
{
$remove=0;
}
array_splice($content,0,$remove);
include('header_frame.inc.php');
if ($_GET["origin"]=='whoisonline') { //the caller
$content[0]=get_lang('CallSent').'<br>'.$content[0];
}
if ($_GET["origin"]=='whoisonlinejoin') { //the joiner (we have to delete the chat request to him when he joins the chat)
$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql="update $track_user_table set chatcall_user_id = '', chatcall_date = '', chatcall_text='' where (user_id = ".$_user['user_id'].")";
$result=api_sql_query($sql,__FILE__,__LINE__);
}
rename($chatPath.'messages-'.$dateNow.'.log.html',$chatPath.'messages-'.$dateNow.'-'.$i.'.log.html');
fclose(fopen($chatPath.'messages-'.$dateNow.'.log.html','w'));
$doc_id=add_document($_course,'/chat_files/messages-'.$dateNow.'-'.$i.'.log.html','file',filesize($chatPath.'messages-'.$dateNow.'-'.$i.'.log.html'),'messages-'.$dateNow.'-'.$i.'.log.html');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id']);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
$doc_id = DocumentManager::get_document_id($_course,'/chat_files/messages-'.$dateNow.'.log.html');
update_existing_document($_course, $doc_id,0);
}
$content=file($chatPath.'messages-'.$dateNow.'.log.html');
$nbr_lines=sizeof($content);
$remove=$nbr_lines-100;
if($remove < 0)
{
$remove=0;
}
array_splice($content,0,$remove);
include('header_frame.inc.php');
if ($_GET["origin"]=='whoisonline') { //the caller
$content[0]=get_lang('CallSent').'<br>'.$content[0];
}
if ($_GET["origin"]=='whoisonlinejoin') { //the joiner (we have to delete the chat request to him when he joins the chat)
$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql="update $track_user_table set chatcall_user_id = '', chatcall_date = '', chatcall_text='' where (user_id = ".$_user['user_id'].")";
$result=api_sql_query($sql,__FILE__,__LINE__);
}
echo '<div style="margin-left: 5px;">';
foreach($content as $thisLine)
{
echo strip_tags(html_entity_decode($thisLine),'<br> <span> <b>');
}
echo '</div>';
?>
<a name="bottom" style="text-decoration:none;">&nbsp;</a>
<?php
if($isMaster || $is_courseCoach)
{
$rand=mt_rand(1,1000);
echo '<div style="margin-left: 5px;">';
echo '<a href="'.api_get_self().'?rand='.$rand.'&reset=1#bottom" onclick="javascript:if(!confirm(\''.addslashes(htmlentities(get_lang('ConfirmReset'),ENT_QUOTES,$charset)).'\')) return false;"><img src="../img/delete.gif" border="0" alt="" align="absbottom">'.get_lang('ClearList').'</a>';
echo '</div>';
foreach($content as $thisLine)
{
echo strip_tags(html_entity_decode($thisLine),'<br> <span> <b>');
}
echo '</div>';
?>
<a name="bottom" style="text-decoration:none;">&nbsp;</a>
<?php
if($isMaster || $is_courseCoach)
{
$rand=mt_rand(1,1000);
echo '<div style="margin-left: 5px;">';
echo '<a href="'.api_get_self().'?rand='.$rand.'&reset=1#bottom" onclick="javascript:if(!confirm(\''.addslashes(htmlentities(get_lang('ConfirmReset'),ENT_QUOTES,$charset)).'\')) return false;"><img src="../img/delete.gif" border="0" alt="" align="absbottom">'.get_lang('ClearList').'</a>';
echo '</div>';
}
}
else
{ include('header_frame.inc.php');
$message=get_lang('CloseOtherSession');
Display :: display_error_message($message);
}
include('footer_frame.inc.php');
?>
?>

@ -42,121 +42,123 @@ $language_file = array ('chat');
require('../inc/global.inc.php');
api_protect_course_script();
$course=api_get_course_id();
include_once(api_get_path(LIBRARY_PATH).'document.lib.php');
include_once(api_get_path(LIBRARY_PATH).'text.lib.php');
include_once (api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
/*
-----------------------------------------------------------
Constants and variables
-----------------------------------------------------------
*/
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$sent = $_REQUEST['sent'];
/*
==============================================================================
MAIN CODE
==============================================================================
*/
$query="SELECT lastname, firstname, username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);
list($pseudoUser)=mysql_fetch_row($result);
$isAllowed=(empty($pseudoUser) || !$_cid)?false:true;
$isMaster=$is_courseAdmin?true:false;
$firstname=mysql_result($result,0,'firstname');
$lastname=mysql_result($result,0,'lastname');
$dateNow=date('Y-m-d');
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
$chatPath=$documentPath.'chat_files/';
$TABLEITEMPROPERTY= Database::get_course_table(TABLE_ITEM_PROPERTY);
if(!is_dir($chatPath))
// if we have the session set up
if (!empty($course))
{
if(is_file($chatPath))
include_once(api_get_path(LIBRARY_PATH).'document.lib.php');
include_once(api_get_path(LIBRARY_PATH).'text.lib.php');
include_once (api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
/*
-----------------------------------------------------------
Constants and variables
-----------------------------------------------------------
*/
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$sent = $_REQUEST['sent'];
/*
==============================================================================
MAIN CODE
==============================================================================
*/
$query="SELECT lastname, firstname, username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);
list($pseudoUser)=mysql_fetch_row($result);
$isAllowed=(empty($pseudoUser) || !$_cid)?false:true;
$isMaster=$is_courseAdmin?true:false;
$firstname=mysql_result($result,0,'firstname');
$lastname=mysql_result($result,0,'lastname');
$dateNow=date('Y-m-d');
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
$chatPath=$documentPath.'chat_files/';
$TABLEITEMPROPERTY= Database::get_course_table(TABLE_ITEM_PROPERTY);
if(!is_dir($chatPath))
{
@unlink($chatPath);
if(is_file($chatPath))
{
@unlink($chatPath);
}
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
@mkdir($chatPath,$perm);
@chmod($chatPath,$perm);
$doc_id=add_document($_course,'/chat_files','folder',0,'chat_files');
api_sql_query("INSERT INTO ".$TABLEITEMPROPERTY . " (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$doc_id,'DocumentAdded',1,0,NULL,0)");
}
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
@mkdir($chatPath,$perm);
@chmod($chatPath,$perm);
$doc_id=add_document($_course,'/chat_files','folder',0,'chat_files');
api_sql_query("INSERT INTO ".$TABLEITEMPROPERTY . " (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$doc_id,'DocumentAdded',1,0,NULL,0)");
}
include('header_frame.inc.php');
$chat_size=0;
if($sent)
{
$message=trim(htmlspecialchars(stripslashes($_POST['message']),ENT_QUOTES,$charset));
include('header_frame.inc.php');
if(!empty($message))
$chat_size=0;
if($sent)
{
$message=make_clickable($message);
if(!file_exists($chatPath.'messages-'.$dateNow.'.log.html'))
$message=trim(htmlspecialchars(stripslashes($_POST['message']),ENT_QUOTES,$charset));
if(!empty($message))
{
$doc_id=add_document($_course,'/chat_files/messages-'.$dateNow.'.log.html','file',0,'messages-'.$dateNow.'.log.html');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id']);
$message=make_clickable($message);
if(!file_exists($chatPath.'messages-'.$dateNow.'.log.html'))
{
$doc_id=add_document($_course,'/chat_files/messages-'.$dateNow.'.log.html','file',0,'messages-'.$dateNow.'.log.html');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id']);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
}
else
{
$doc_id = DocumentManager::get_document_id($_course,'/chat_files/messages-'.$dateNow.'.log.html');
}
$fp=fopen($chatPath.'messages-'.$dateNow.'.log.html','a');
if($isMaster)
{
fputs($fp,'<span id="chat_login_name"><b>'.$firstname.' '.$lastname.'</b></span> : '.$message.'<br>'."\n");
}
else
{
fputs($fp,"<b>$firstname $lastname</b> : $message<br>\n");
}
fclose($fp);
$chat_size=filesize($chatPath.'messages-'.$dateNow.'.log.html');
update_existing_document($_course, $doc_id,$chat_size);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
}
else
{
$doc_id = DocumentManager::get_document_id($_course,'/chat_files/messages-'.$dateNow.'.log.html');
}
$fp=fopen($chatPath.'messages-'.$dateNow.'.log.html','a');
if($isMaster)
{
fputs($fp,'<span id="chat_login_name"><b>'.$firstname.' '.$lastname.'</b></span> : '.$message.'<br>'."\n");
}
else
{
fputs($fp,"<b>$firstname $lastname</b> : $message<br>\n");
}
fclose($fp);
$chat_size=filesize($chatPath.'messages-'.$dateNow.'.log.html');
update_existing_document($_course, $doc_id,$chat_size);
item_property_update_on_folder($_course,'/chat_files', $_user['user_id']);
}
?>
<form name="formMessage" method="post" action="<?php echo api_get_self(); ?>" onsubmit="javascript:if(document.formMessage.message.value == '') { alert('<?php echo addslashes(htmlentities(get_lang('TypeMessage'),ENT_QUOTES,$charset)); ?>'); document.formMessage.message.focus(); return false; }" autocomplete="off">
<input type="hidden" name="sent" value="1">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="520" valign="middle">
<textarea name="message" style="width: 520px; height: 35px" onkeydown="send_message(event);"></textarea>
</td>
<td>
<input type="submit" value="<?php echo get_lang("Send"); ?>" class="background_submit">
</td>
</tr>
</table>
</form>
<?php
}
?>
<form name="formMessage" method="post" action="<?php echo api_get_self(); ?>" onsubmit="javascript:if(document.formMessage.message.value == '') { alert('<?php echo addslashes(htmlentities(get_lang('TypeMessage'),ENT_QUOTES,$charset)); ?>'); document.formMessage.message.focus(); return false; }" autocomplete="off">
<input type="hidden" name="sent" value="1">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="520" valign="middle">
<textarea name="message" style="width: 520px; height: 35px" onkeydown="send_message(event);"></textarea>
</td>
<td>
<input type="submit" value="<?php echo get_lang("Send"); ?>" class="background_submit">
</td>
</tr>
</table>
</form>
<?php
include('footer_frame.inc.php');
?>

@ -3,14 +3,13 @@
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt".
The full license can be read in "license.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
@ -31,75 +30,80 @@
*/
define('FRAME','online');
$language_file = array ('chat');
include('../inc/global.inc.php');
include('../inc/lib/course.lib.php');
include('../inc/lib/usermanager.lib.php');
$showPic=intval($_GET['showPic']);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_chat_connected = Database::get_course_chat_connected_table();
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);
$course=api_get_course_id();
list($pseudoUser)=mysql_fetch_row($result);
$isAllowed=(empty($pseudoUser) || !$_cid)?false:true;
$isMaster=$is_courseAdmin?true:false;
if(!isset($_SESSION['id_session']))
{
$query="SELECT t1.user_id,username,firstname,lastname,picture_uri,t3.status FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_course_user t3 WHERE t1.user_id=t2.user_id AND t3.user_id=t2.user_id AND t3.course_code = '".$_course['sysCode']."' AND t2.last_connection>'".date('Y-m-d H:i:s',time()-60*5)."' ORDER BY username";
}
else
if (!empty($course))
{
$query="SELECT t1.user_id,username,firstname,lastname,picture_uri FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session_course_user t3 WHERE t1.user_id=t2.user_id AND t3.id_user=t2.user_id AND t3.course_code = '".$_course['sysCode']."' AND t2.last_connection>'".date('Y-m-d H:i:s',time()-60*5)."' ORDER BY username";
}
$result=api_sql_query($query,__FILE__,__LINE__);
$Users=api_store_result($result);
include('header_frame.inc.php');
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="data_table">
<tr><th colspan="2"><?php echo get_lang("Connected"); ?></th></tr>
<?php
foreach($Users as $enreg)
{
$showPic=intval($_GET['showPic']);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_chat_connected = Database::get_course_chat_connected_table();
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);
list($pseudoUser)=mysql_fetch_row($result);
$isAllowed=(empty($pseudoUser) || !$_cid)?false:true;
$isMaster=$is_courseAdmin?true:false;
$date_inter=date('Y-m-d H:i:s',time()-60);
if(!isset($_SESSION['id_session']))
{
$status=$enreg['status'];
$query="SELECT t1.user_id,username,firstname,lastname,picture_uri,t3.status FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_course_user t3 WHERE t1.user_id=t2.user_id AND t3.user_id=t2.user_id AND t3.course_code = '".$_course['sysCode']."' AND t2.last_connection>'".$date_inter."' ORDER BY username";
}
else
{
if(CourseManager::is_course_teacher($enreg['user_id'],$_SESSION['_course']['id'])) $status=1; else $status=5;
$query="SELECT t1.user_id,username,firstname,lastname,picture_uri FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session_course_user t3 WHERE t1.user_id=t2.user_id AND t3.id_user=t2.user_id AND t3.course_code = '".$_course['sysCode']."' AND t2.last_connection>'".$date_inter."' ORDER BY username";
}
?>
<tr>
<td width="1%" valign="top"><?php if($status == 1) echo '<img src="../img/teachers.gif" align="absbottom" border="0" alt="" style="margin: 1px;">'; else echo '<img src="../img/students.gif" align="absbottom" border="0" alt="" style="margin: 1px;">';?></td>
<td width="99%"><a <?php if($status == 1) echo 'class="master"'; ?> name="user_<?php echo $enreg['user_id']; ?>" href="<?php echo api_get_self(); ?>?showPic=<?php if($showPic == $enreg['user_id']) echo '0'; else echo $enreg['user_id']; ?>#user_<?php echo $enreg['user_id']; ?>"><?php echo ucfirst($enreg['firstname']).' '.ucfirst($enreg['lastname']); ?></a></td>
</tr>
<?php
$user_image=UserManager::get_user_picture_path_by_id($enreg['user_id'],'web',false,true);
$file_url=$user_image['dir'].$user_image['file'];
if($showPic == $enreg['user_id']): ?>
<tr>
<td colspan="2" align="center"><img src="<?php echo $file_url;?>" border="0" width="100" alt="" style="margin-top: 5px;"></td>
</tr>
<?php endif; ?>
<?php
}
unset($Users);
?>
</table>
<?php
include('footer_frame.inc.php');
?>
$result=api_sql_query($query,__FILE__,__LINE__);
$Users=api_store_result($result);
$user_id=$enreg['user_id'];
include('header_frame.inc.php');
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="data_table">
<tr><th colspan="2"><?php echo get_lang("Connected"); ?></th></tr>
<?php
foreach($Users as $enreg)
{
if(!isset($_SESSION['id_session']))
{
$status=$enreg['status'];
}
else
{
if(CourseManager::is_course_teacher($enreg['user_id'],$_SESSION['_course']['id'])) $status=1; else $status=5;
}
?>
<tr>
<td width="1%" valign="top"><?php if($status == 1) echo '<img src="../img/teachers.gif" align="absbottom" border="0" alt="" style="margin: 1px;">'; else echo '<img src="../img/students.gif" align="absbottom" border="0" alt="" style="margin: 1px;">';?></td>
<td width="99%"><a <?php if($status == 1) echo 'class="master"'; ?> name="user_<?php echo $enreg['user_id']; ?>" href="<?php echo api_get_self(); ?>?showPic=<?php if($showPic == $enreg['user_id']) echo '0'; else echo $enreg['user_id']; ?>#user_<?php echo $enreg['user_id']; ?>"><?php echo ucfirst($enreg['firstname']).' '.ucfirst($enreg['lastname']); ?></a></td>
</tr>
<?php
$user_image=UserManager::get_user_picture_path_by_id($enreg['user_id'],'web',false,true);
$file_url=$user_image['dir'].$user_image['file'];
if($showPic == $enreg['user_id']): ?>
<tr>
<td colspan="2" align="center"><img src="<?php echo $file_url;?>" border="0" width="100" alt="" style="margin-top: 5px;"></td>
</tr>
<?php endif; ?>
<?php
}
unset($Users);
?>
</table>
<?php
}
include('footer_frame.inc.php');
?>

@ -65,6 +65,7 @@ if(api_get_setting('user_selected_theme') == 'true')
}
$mycourseid = api_get_course_id();
if (!empty($mycourseid) && $mycourseid != -1)
{
if (api_get_setting('allow_course_theme') == 'true')
@ -81,15 +82,20 @@ if (!empty($mycourseid) && $mycourseid != -1)
}
}
if (empty($mycourseid))
{
// if it is not set $mycourse id we reload the chat_message window in order to hide the
// textarea to submit a message
echo '<script type="text/javascript" language="javascript">';
echo "parent.chat_message.location.href='chat_whoisonline.php';";
echo '</script>';
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset;?>">
<title>Chat</title>
<link rel="stylesheet" type="text/css" href="../css/<?php echo $my_style; ?>/default.css">
<style>
a{
font-size: 12px;
@ -110,7 +116,7 @@ function updateChat()
{
if('<?php echo $chat_size_old; ?>' != '<?php echo $chat_size_new; ?>')
{
parent.chat_chat.location.href='chat_chat.php?size=<?php echo $chat_size_new; ?>#bottom';
parent.chat_chat.location.href='chat_chat.php?size=<?php echo $chat_size_new; ?>#bottom';
}
}
@ -148,7 +154,6 @@ function send_message(evenement){
{
document.formMessage.submit();
}
}
//-->

Loading…
Cancel
Save