From: Lo?c C. <lo...@us...> - 2001-05-26 11:54:29
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv24346/chat Modified Files: input.php3 handle_input.php3 Log Message: Commands success messages are no long stored in $error var but in $success one Index: input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** input.php3 2001/05/20 18:56:28 1.35 --- input.php3 2001/05/26 11:54:25 1.36 *************** *** 227,231 **** $msgValue = str_replace('"', '"', $prevMessage); } ! else if (isset($error) && !$isCommand) { $msgValue = str_replace('"', '"', $message); --- 227,231 ---- $msgValue = str_replace('"', '"', $prevMessage); } ! else if (isset($error)) { $msgValue = str_replace('"', '"', $message); *************** *** 235,238 **** --- 235,239 ---- $msgValue = ''; } + // Define the message box size // = (frame width - margins - send button size) / column width *************** *** 276,280 **** { // Error message defined by a command ! if (isset($error) && !$isCommand) { $lowMessage = '<span class="error">' --- 277,281 ---- { // Error message defined by a command ! if (isset($error)) { $lowMessage = '<span class="error">' *************** *** 283,290 **** } // Success message defined by a command ! else if (isset($error)) { $lowMessage = '<span class="success">' ! . str_replace('\\n', '<br />', str_replace('"', '"', $error)) . '</span>'; } --- 284,291 ---- } // Success message defined by a command ! else if (isset($success)) { $lowMessage = '<span class="success">' ! . str_replace('\\n', '<br />', str_replace('"', '"', $success)) . '</span>'; } *************** *** 475,485 **** /** ! * Display a JavaScript alert box with the error message if necessary * * Uses the the 'pmcSlashSingleQuotes()' function from the * 'chat/lib/common.lib.php3' library */ ! if (isset($error)) { ?> <script type="text/javascript" language="javascript"> --- 476,488 ---- /** ! * Display a JavaScript alert box with the error or success message if ! * necessary * * Uses the the 'pmcSlashSingleQuotes()' function from the * 'chat/lib/common.lib.php3' library */ ! if (isset($error) || isset($success)) { + $alertMsg = (isset($error)) ? $error : $success; ?> <script type="text/javascript" language="javascript"> *************** *** 487,491 **** // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($error)); ?>'); // --> </script> --- 490,494 ---- // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($alertMsg)); ?>'); // --> </script> Index: handle_input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** handle_input.php3 2001/05/23 21:40:30 1.27 --- handle_input.php3 2001/05/26 11:54:25 1.28 *************** *** 192,198 **** // - last submission if it was an erroneous command; // - else nothing. ! $msgValue = ($displayMessage) ? addslashes($prevMessage) : ''; ! if (isset($error) && !($isCommand)) ! $msgValue = addslashes($message); --- 192,207 ---- // - last submission if it was an erroneous command; // - else nothing. ! if ($displayMessage) ! { ! $msgValue = addslashes($prevMessage); ! } ! else if (isset($error)) ! { ! $msgValue = addslashes($message); ! } ! else ! { ! $msgValue = ''; ! } *************** *** 254,269 **** /** ! * Display a JavaScript alert box with the error message if necessary * * The 'pmcSlashSingleQuotes()' function is defined in the * 'chat/lib/common.lib.php3' script */ ! if (isset($error)) { echo("\n"); ?> // Display a JavaScript alert box with the error message if necessary pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($error)); ?>'); <?php } --- 263,280 ---- /** ! * Display a JavaScript alert box with the error message or success message if ! * necessary * * The 'pmcSlashSingleQuotes()' function is defined in the * 'chat/lib/common.lib.php3' script */ ! if (isset($error) || isset($success)) { + $alertMsg = (isset($error)) ? $error : $success; echo("\n"); ?> // Display a JavaScript alert box with the error message if necessary pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($alertMsg)); ?>'); <?php } |