]> git.mjollnir.org Git - moodle.git/commitdiff
Miscellaneous fixes from the PJ man
authormoodler <moodler>
Mon, 23 Aug 2004 14:40:53 +0000 (14:40 +0000)
committermoodler <moodler>
Mon, 23 Aug 2004 14:40:53 +0000 (14:40 +0000)
mod/chat/chatd.php
mod/chat/gui_sockets/index.php
mod/chat/lib.php

index 4b13452ab656b97072226d9a123f1ccfec4f0e0e..ebdeb9f5e6ad100cc7775371a0fd972fcad44a62 100755 (executable)
@@ -78,7 +78,7 @@ class ChatDaemon {
         // This will set it just fine for bookkeeping purposes.
         if($now - $this->sets_info[$sessionid]['lastinfocommit'] > $this->live_data_update_threshold) {
             // commit to permanent storage
-            trace('Committing volatile lastmessageping for session '.$sessionid);
+            // trace('Committing volatile lastmessageping for session '.$sessionid);
             $this->sets_info[$sessionid]['lastinfocommit'] = $now;
             update_record('chat_users', $this->sets_info[$sessionid]['chatuser']);
         }
@@ -151,6 +151,9 @@ class ChatDaemon {
         }
         echo '</tbody></table>';
 
+        // About 2K of HTML comments to force browsers to render the HTML
+        echo $GLOBALS['CHAT_DUMMY_DATA'];
+
         echo "</body>\n</html>\n";
 
         chat_language_restore($oldlang);
@@ -221,31 +224,7 @@ class ChatDaemon {
             break;
 
             case CHAT_SIDEKICK_USERS:
-            /*
-                //$x = pusers($this->sets_info[$sessionid]['chatid'], $this->sets_info[$sessionid]['groupid']);
-                //$x = "<html>Lalalala! ".time()."</html>";
-
-                $header  = "HTTP/1.1 200 OK\n";
-                $header .= "Connection: close\n";
-                $header .= "Date: ".date('r')."\n";
-                $header .= "Server: Moodle\n";
-                $header .= "Content-Type: text/html\n";
-                $header .= "Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT\n";
-                $header .= "Cache-Control: no-cache, must-revalidate\n";
-                $header .= "Expires: Wed, 4 Oct 1978 09:32:45 GMT\n";
-                //$header .= "Refresh: 3; url=http://$CFG->chat_serverhost:$CFG->chat_serverport?win=users&".
-                //           "chat_sid=".$sessionid."&groupid=".$this->sets_info[$sessionid]['groupid']."\n";
-                $header .= "\n";
-
-                $x = $header.$x;
-*/
-
-/*
-                trace('Outputting user list('.strlen($x).' chars)');
-                //trace($x);
-
-                chat_socket_write($handle, $x);
-*/
+                // A request to paint a user window
 
                 $content = $this->get_user_window($sessionid);
 
index 4d19d0a59aea1ecd91cea9ee76617e5c4a68d710..2b5783d506c6d01f2de3272d1048bca60ee53011 100644 (file)
@@ -1,26 +1,26 @@
 <?php
-require_once('../../../config.php');
+    require_once('../../../config.php');
     require_once('../lib.php');
 
     require_variable($id);
     optional_variable($groupid, -1);
 
-    if (!$chat = get_record("chat", "id", $id)) {
-        error("Could not find that chat room!");
+    if (!$chat = get_record('chat', 'id', $id)) {
+        error('Could not find that chat room!');
     }
 
-    if (!$course = get_record("course", "id", $chat->course)) {
-        error("Could not find the course this belongs to!");
+    if (!$course = get_record('course', 'id', $chat->course)) {
+        error('Could not find the course this belongs to!');
     }
 
-    if (!$cm = get_coursemodule_from_instance("chat", $chat->id, $course->id)) {
-        error("Course Module ID was incorrect");
+    if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) {
+        error('Course Module ID was incorrect');
     }
 
     require_login($course->id);
 
     if (isguest()) {
-        error("Guest does not have access to chat rooms");
+        error('Guest does not have access to chat rooms');
     }
 
 /// Check to see if groups are being used here
@@ -67,7 +67,7 @@ require_once('../../../config.php');
    <frame src="chatinput.php?<?php echo $params ?>" name="input" scrolling="no" marginwidth="2" marginheight="1">
   </frameset>
   <frame src="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport?win=users&amp;$params"; ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5"> 
-<!--  
+  <!--  
   <frame src="../users.php?<?php echo $params ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5">
   -->
  </frameset>
index c3d430ad524c73607796bc13219c558fe0fbd15b..2bba3c2d511db6a6a92137c5f5bbd8cfeadde02d 100644 (file)
@@ -46,6 +46,8 @@ $CHAT_HTMLHEAD_MSGINPUT = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transiti
 // The HTML code for the message input page, with JavaScript
 $CHAT_HTMLHEAD_MSGINPUT_JS = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\"><html><head><title>Message Input</title>\n<script language=\"Javascript\">\n<!--\nscroll_active = true;\nfunction empty_field_and_submit()\n{\ndocument.fdummy.arsc_message.value=document.f.arsc_message.value;\ndocument.fdummy.submit();\ndocument.f.arsc_message.focus();\ndocument.f.arsc_message.select();\nreturn false;\n}\n// -->\n</script>\n</head><body bgcolor=\"$THEME->body\" OnLoad=\"document.f.arsc_message.focus();document.f.arsc_message.select();\">";
 
+// Dummy data that gets output to the browser as needed, in order to make it show output
+$CHAT_DUMMY_DATA = "<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n<!-- nix -->\n";
 
 function chat_add_instance($chat) {
 /// Given an object containing all the necessary data,