From: Lo?c C. <lo...@us...> - 2001-04-16 12:48:32
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv14894/chat Modified Files: users_low.php3 users.php3 Log Message: Fix some bugs that one can faced if a room's name like one of the keywords '%*%' Index: users_low.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users_low.php3,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** users_low.php3 2001/04/14 17:51:47 1.9 --- users_low.php3 2001/04/16 12:48:29 1.10 *************** *** 148,152 **** . '<span class="small">' . '<bdo dir="' . $textDirection . '"></bdo>' ! . ' (%NUMROWS%)' . '</span><br />'; --- 148,152 ---- . '<span class="small">' . '<bdo dir="' . $textDirection . '"></bdo>' ! . ' (%NUM ROWS%)' . '</span><br />'; *************** *** 201,205 **** $usersList[] = ''; $usersList[] = ''; ! $usersList[2] = str_replace('%NUMROWS%', $usersCnt, $usersList[2]); --- 201,205 ---- $usersList[] = ''; $usersList[] = ''; ! $usersList[2] = str_replace('%NUM ROWS%', $usersCnt, $usersList[2]); *************** *** 216,220 **** $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr LEFT JOIN ' . C_REG_TBL . ' reg ON usr.username = reg.username ' ! . 'WHERE usr.room = \'%OTHER%\' ' . 'ORDER BY usr.username'; } --- 216,220 ---- $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr LEFT JOIN ' . C_REG_TBL . ' reg ON usr.username = reg.username ' ! . 'WHERE usr.room = \'%OTHER ROOM%\' ' . 'ORDER BY usr.username'; } *************** *** 223,231 **** $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr, ' . C_REG_TBL . ' reg ' ! . 'WHERE usr.room = \'%OTHER%\' ' . 'UNION ' . 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.username NOT IN (SELECT reg.username FROM ' . C_REG_TBL . ' reg) AND usr.room = \'%OTHER%\' ' . 'ORDER BY usr.username'; } --- 223,231 ---- $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr, ' . C_REG_TBL . ' reg ' ! . 'WHERE usr.room = \'%OTHER ROOM%\' ' . 'UNION ' . 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.username NOT IN (SELECT reg.username FROM ' . C_REG_TBL . ' reg) AND usr.room = \'%OTHER ROOM%\' ' . 'ORDER BY usr.username'; } *************** *** 234,238 **** $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.room = \'%OTHER%\' ' . 'ORDER BY usr.username'; } --- 234,238 ---- $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.room = \'%OTHER ROOM%\' ' . 'ORDER BY usr.username'; } *************** *** 250,254 **** $usersDetails = array(); $slashedOther = pmcSlashSingleQuotes($roomName); ! $dbLink->query(str_replace('%OTHER%', $slashedOther, $otherRoomsQuery)); while (list($otherUser, $latin1, $status, $gender) = $dbLink->nextRecord()) { --- 250,254 ---- $usersDetails = array(); $slashedOther = pmcSlashSingleQuotes($roomName); ! $dbLink->query(str_replace('%OTHER ROOM%', $slashedOther, $otherRoomsQuery)); while (list($otherUser, $latin1, $status, $gender) = $dbLink->nextRecord()) { *************** *** 276,280 **** . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEWROOM%'; reset($othersRooms); --- 276,280 ---- . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEW ROOM%'; reset($othersRooms); *************** *** 288,292 **** $usersList[] = '<!-- The others rooms currently in use -->'; $usersList[] = '<p>'; ! $usersList[] = '<a href="' . str_replace('%NEWROOM%', urlencode($roomName), $joinUrl) . '" target="_parent">' . htmlspecialchars($roomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(' . $usersInCnt . ')</span><br />'; --- 288,292 ---- $usersList[] = '<!-- The others rooms currently in use -->'; $usersList[] = '<p>'; ! $usersList[] = '<a href="' . str_replace('%NEW ROOM%', urlencode($roomName), $joinUrl) . '" target="_parent">' . htmlspecialchars($roomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(' . $usersInCnt . ')</span><br />'; *************** *** 349,353 **** . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEWROOM%'; $usersList[] = '<!-- The others default and public rooms -->'; --- 349,353 ---- . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEW ROOM%'; $usersList[] = '<!-- The others default and public rooms -->'; *************** *** 365,369 **** $usersList[] = '<p>'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEWROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent">' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; --- 365,369 ---- $usersList[] = '<p>'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent">' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; Index: users.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users.php3,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** users.php3 2001/04/14 17:51:47 1.13 --- users.php3 2001/04/16 12:48:30 1.14 *************** *** 146,150 **** . '<span class="small">' . '<bdo dir="' . $textDirection . '"></bdo>' ! . ' (%NUMROWS%)' . '</span><br />'; $usersList[] = '<div style="margin-bottom: 10px">'; --- 146,150 ---- . '<span class="small">' . '<bdo dir="' . $textDirection . '"></bdo>' ! . ' (%NUM ROWS%)' . '</span><br />'; $usersList[] = '<div style="margin-bottom: 10px">'; *************** *** 200,204 **** $usersList[] = ''; $usersList[] = ''; ! $usersList[1] = str_replace('%NUMROWS%', $usersCnt, $usersList[1]); --- 200,204 ---- $usersList[] = ''; $usersList[] = ''; ! $usersList[1] = str_replace('%NUM ROWS%', $usersCnt, $usersList[1]); *************** *** 215,219 **** $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr LEFT JOIN ' . C_REG_TBL . ' reg ON usr.username = reg.username ' ! . 'WHERE usr.room = \'%OTHER%\' ' . 'ORDER BY usr.username'; } --- 215,219 ---- $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr LEFT JOIN ' . C_REG_TBL . ' reg ON usr.username = reg.username ' ! . 'WHERE usr.room = \'%OTHER ROOM%\' ' . 'ORDER BY usr.username'; } *************** *** 222,230 **** $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr, ' . C_REG_TBL . ' reg ' ! . 'WHERE usr.room = \'%OTHER%\' ' . 'UNION ' . 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.username NOT IN (SELECT reg.username FROM ' . C_REG_TBL . ' reg) AND usr.room = \'%OTHER%\' ' . 'ORDER BY usr.username'; } --- 222,230 ---- $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' . 'FROM ' . C_USR_TBL . ' usr, ' . C_REG_TBL . ' reg ' ! . 'WHERE usr.room = \'%OTHER ROOM%\' ' . 'UNION ' . 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.username NOT IN (SELECT reg.username FROM ' . C_REG_TBL . ' reg) AND usr.room = \'%OTHER ROOM%\' ' . 'ORDER BY usr.username'; } *************** *** 233,237 **** $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.room = \'%OTHER%\' ' . 'ORDER BY usr.username'; } --- 233,237 ---- $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, 0 ' . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.room = \'%OTHER ROOM%\' ' . 'ORDER BY usr.username'; } *************** *** 249,253 **** $usersDetails = array(); $slashedOther = pmcSlashSingleQuotes($roomName); ! $dbLink->query(str_replace('%OTHER%', $slashedOther, $otherRoomsQuery)); while (list($otherUser, $latin1, $status, $gender) = $dbLink->nextRecord()) { --- 249,253 ---- $usersDetails = array(); $slashedOther = pmcSlashSingleQuotes($roomName); ! $dbLink->query(str_replace('%OTHER ROOM%', $slashedOther, $otherRoomsQuery)); while (list($otherUser, $latin1, $status, $gender) = $dbLink->nextRecord()) { *************** *** 276,280 **** . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEWROOM%'; reset($othersRooms); --- 276,280 ---- . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEW ROOM%'; reset($othersRooms); *************** *** 294,298 **** . '<img name="imEx" src="images/closed.gif" width="9" height="9" border="0" alt="' . L_EXPCOL . '" /></a>' . ' ' ! . '<a href="' . str_replace('%NEWROOM%', urlencode($roomName), $joinUrl) . '" target="_parent">' . htmlspecialchars($roomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(' . $usersInCnt . ')</span>'; --- 294,298 ---- . '<img name="imEx" src="images/closed.gif" width="9" height="9" border="0" alt="' . L_EXPCOL . '" /></a>' . ' ' ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($roomName), $joinUrl) . '" target="_parent">' . htmlspecialchars($roomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(' . $usersInCnt . ')</span>'; *************** *** 357,361 **** . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEWROOM%'; $usersList[] = '<!-- The others default and public rooms -->'; --- 357,361 ---- . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'newTargetRoom=1%NEW ROOM%'; $usersList[] = '<!-- The others default and public rooms -->'; *************** *** 376,380 **** $usersList[] = '<div id="Parent' . $id . '" class="parent" style="margin-top: 5px; cursor: hand">'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEWROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent">' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; --- 376,380 ---- $usersList[] = '<div id="Parent' . $id . '" class="parent" style="margin-top: 5px; cursor: hand">'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent">' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; |