Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands
In directory usw-pr-cvs1:/tmp/cvs-serv32717/chat/lib/commands
Modified Files:
quit.cmd.php3 promote.cmd.php3 priv_msg.cmd.php3 me.cmd.php3
invite.cmd.php3 announce.cmd.php3
Log Message:
Some SQL queries has been rewriten in order to avois errors with customized tables
Index: quit.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/quit.cmd.php3,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** quit.cmd.php3 2001/04/19 21:05:04 1.4
--- quit.cmd.php3 2001/04/21 19:37:39 1.5
***************
*** 45,48 ****
--- 45,49 ----
$msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
+ . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) '
. 'VALUES ('
. $currentRoomType . ', '
Index: promote.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/promote.cmd.php3,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** promote.cmd.php3 2001/04/19 21:05:04 1.4
--- promote.cmd.php3 2001/04/21 19:37:39 1.5
***************
*** 77,81 ****
$dbLink->query("UPDATE " . C_REG_TBL . " SET perms = 'moderator', rooms = '$slashedModeratedRooms' WHERE username = '$slashedTarget'");
$dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'm' WHERE username = '$slashedTarget'");
! $dbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($currentRoomType, '$slashedCurrentRoomName', 'SYS promote', $latin1, " . time() . ", NULL, '#666699', 'sprintf(L_MODERATOR, \'$targetForNotifications\')', 'sprintf(L_MODERATOR, \'$targetForNotifications\')')");
}
else
--- 77,86 ----
$dbLink->query("UPDATE " . C_REG_TBL . " SET perms = 'moderator', rooms = '$slashedModeratedRooms' WHERE username = '$slashedTarget'");
$dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'm' WHERE username = '$slashedTarget'");
! $msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
! . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) '
! . 'VALUES ('
! . "$currentRoomType, '$slashedCurrentRoomName', 'SYS promote', $latin1, " . time() . ", NULL, '#666699', 'sprintf(L_MODERATOR, \'$targetForNotifications\')', 'sprintf(L_MODERATOR, \'$targetForNotifications\')'"
! . ')';
! $dbLink->query($msgQuery);
}
else
Index: priv_msg.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/priv_msg.cmd.php3,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** priv_msg.cmd.php3 2001/04/19 21:05:04 1.3
--- priv_msg.cmd.php3 2001/04/21 19:37:39 1.4
***************
*** 57,60 ****
--- 57,61 ----
// Put the message in the 'messages' table
$msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
+ . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) '
. 'VALUES ('
. $currentRoomType . ', '
Index: me.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/me.cmd.php3,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** me.cmd.php3 2001/04/19 21:05:04 1.5
--- me.cmd.php3 2001/04/21 19:37:39 1.6
***************
*** 43,46 ****
--- 43,47 ----
// Put the message in the 'messages' table
$msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
+ . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) '
. 'VALUES ('
. $currentRoomType . ', '
Index: invite.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/invite.cmd.php3,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** invite.cmd.php3 2001/04/19 20:23:36 1.6
--- invite.cmd.php3 2001/04/21 19:37:39 1.7
***************
*** 56,59 ****
--- 56,60 ----
$invitedQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
+ . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) '
. 'VALUES ('
. $currentRoomType . ', '
Index: announce.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/announce.cmd.php3,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** announce.cmd.php3 2001/04/19 21:05:04 1.6
--- announce.cmd.php3 2001/04/21 19:37:39 1.7
***************
*** 26,30 ****
/**
! * The current user is adminsitrator -> insert the message in the 'messages'
* table
*/
--- 26,30 ----
/**
! * The current user is administrator -> insert the message in the 'messages'
* table
*/
***************
*** 43,46 ****
--- 43,47 ----
// Put the message in the 'messages' table
$msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
+ . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) '
. 'VALUES ('
. $currentRoomType . ', '
|