]> git.mjollnir.org Git - moodle.git/commitdiff
mod/chat: Normal method -- faster, lighter DB updates
authormartinlanghoff <martinlanghoff>
Mon, 17 Apr 2006 21:05:51 +0000 (21:05 +0000)
committermartinlanghoff <martinlanghoff>
Mon, 17 Apr 2006 21:05:51 +0000 (21:05 +0000)
Use set_field() keyed on PK instead of update_record() or set_field()
keyed on non-PKs.

mod/chat/gui_header_js/jsupdate.php
mod/chat/gui_header_js/users.php

index 9085349ae55e660537371d79e45840e4d5b61bc4..918492018030b5c3439ddaa442c89f5531dfcdf8 100644 (file)
         }
 
         $chatuser->lastping = time();
-        set_field('chat_users', 'lastping', $chatuser->lastping, 'sid', $chatuser->sid );
+        set_field('chat_users', 'lastping', $chatuser->lastping, 'id', $chatuser->id  );
 
         if ($refreshusers) {
             echo "if (parent.users.document.anchors[0] != null) {" .
index 73807129244af4f50baefb773a75cabaa9d0b0ae..ff0929616deb8e5e99423d0d672651076729209c 100644 (file)
@@ -46,7 +46,7 @@
     }
 
     $chatuser->lastping = time();
-    update_record('chat_users', $chatuser);
+    set_field('chat_users', 'lastping', $chatuser->lastping, 'id', $chatuser->id  );
 
     $refreshurl = "users.php?chat_sid=$chat_sid";