From 7f5f75a9f6f0e78f3b2f789b82b2feca62fc88c4 Mon Sep 17 00:00:00 2001 From: aragonc Date: Thu, 8 May 2014 19:14:57 -0500 Subject: [PATCH] new chat css iframe --- main/chat/chat.php | 7 ++--- main/chat/chat_chat.php | 7 +++-- main/chat/chat_message.php | 20 +++++++++---- main/chat/chat_whoisonline.php | 55 ++++++++++++++++------------------ main/chat/header_frame.inc.php | 2 +- 5 files changed, 50 insertions(+), 41 deletions(-) diff --git a/main/chat/chat.php b/main/chat/chat.php index e0a92b9b03..c32937d0fb 100755 --- a/main/chat/chat.php +++ b/main/chat/chat.php @@ -74,10 +74,9 @@ if (!empty($groupId)) { if (empty($open_chat_window)) { Display::display_header($tool_name, 'Chat'); } - -echo ''; -echo ''; -echo ''; +echo ''; +echo ''; +echo ''; echo ''; if (empty($open_chat_window)) { diff --git a/main/chat/chat_chat.php b/main/chat/chat_chat.php index afae2d7e55..59407ac0ff 100755 --- a/main/chat/chat_chat.php +++ b/main/chat/chat_chat.php @@ -141,19 +141,22 @@ if (!empty($course)) { $result = Database::query($sql); } - echo '
'; + echo '
'; foreach ($content as & $this_line) { - echo strip_tags(api_html_entity_decode($this_line), '
'); + echo strip_tags(api_html_entity_decode($this_line), '

'); } echo '
'; + echo '
'; echo ' '; if ($isMaster || $is_courseCoach) { $rand = mt_rand(1, 1000); echo ''; + echo '
'; } } else { + echo '
'; require 'header_frame.inc.php'; $message = get_lang('CloseOtherSession'); Display :: display_error_message($message); diff --git a/main/chat/chat_message.php b/main/chat/chat_message.php index 5ae67e6889..8b20a6e6b7 100755 --- a/main/chat/chat_message.php +++ b/main/chat/chat_message.php @@ -5,6 +5,7 @@ * Allows to type the messages that will be displayed on chat_chat.php * * @author Olivier Brouckaert + * Modified by Alex Aragón (BeezNest) * @package chamilo.chat */ /** @@ -71,7 +72,7 @@ if (!empty($course) && !empty($_user['user_id'])) { /* MAIN CODE */ - $query = "SELECT lastname, firstname, username FROM $tbl_user WHERE user_id='".intval($_user['user_id'])."'"; + $query = "SELECT user_id, lastname, firstname, username, picture_uri FROM $tbl_user WHERE user_id='".intval($_user['user_id'])."'"; $result = Database::query($query); list($pseudo_user) = Database::fetch_row($result); @@ -79,8 +80,10 @@ if (!empty($course) && !empty($_user['user_id'])) { $isAllowed = !(empty($pseudo_user) || !$_cid); $isMaster = (bool)$is_courseAdmin; + $user_id = Database::result($result, 0, 'user_id'); $firstname = Database::result($result, 0, 'firstname'); $lastname = Database::result($result, 0, 'lastname'); + $picture = Database::result($result, 0, 'picture_uri'); $date_now = date('Y-m-d'); @@ -207,13 +210,20 @@ if (!empty($course) && !empty($_user['user_id'])) { } $fp = fopen($chat_path.$basename_chat.'.log.html', 'a'); + // view user picture + $user_image = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true); + $user_photo = $user_image['dir'].$user_image['file']; + $file_photo = ''; if ($isMaster) { - $photo = ''.get_lang('Teacher').''; - fputs($fp, '['.$timeNow.']'.$photo.' '.api_get_person_name($firstname, $lastname).' : '.$message.'
'."\n"); + + // $photo = ''.get_lang('Teacher').''; + fputs($fp, '
'.$message.'
'.$timeNow.'
'.$file_photo.'
'."\n"); + //fputs($fp, '['.$timeNow.']'.$file_photo.' '.api_get_person_name($firstname, $lastname).' : '.$message.'
'."\n"); } else { - $photo = ''.get_lang('Student').''; - fputs($fp, '['.$timeNow.']'.$photo.' '.api_get_person_name($firstname, $lastname).' : '.$message.'
'."\n"); + // $photo = ''.get_lang('Student').''; + //fputs($fp, '['.$timeNow.']'.$file_photo.' '.api_get_person_name($firstname, $lastname).' : '.$message.'
'."\n"); + fputs($fp, '
'.$file_photo.'
'.$message.'
'.$timeNow.'
'."\n"); } fclose($fp); diff --git a/main/chat/chat_whoisonline.php b/main/chat/chat_whoisonline.php index c4a9d4d171..ccdc3d7c64 100755 --- a/main/chat/chat_whoisonline.php +++ b/main/chat/chat_whoisonline.php @@ -107,34 +107,31 @@ if (!empty($course)) { require 'header_frame.inc.php'; ?> - - - - - - - - - - - - -
'11')).' '; else echo Display::return_icon('students.gif', get_lang('Student'), array('height' => '11')); ?> name="user_" href="?&showPic=#user_">
+
+
+ +
Chat - +