From: Lo?c C. <lo...@us...> - 2001-04-30 22:45:02
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv3139/chat Modified Files: input.php3 help_popup.php3 Added Files: smilies_popup.php3 Log Message: Updated to the new 'input' frame --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html | // +--------------------------------------------------------------------------+ // | This script defines the 'smilies' popup. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: smilies_popup.php3,v 1.1 2001/04/30 22:44:58 loic1 Exp $ // // The 'smilies' popup. // /** * Gets the extension for the php scripts */ if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; define('C_EXTENSION', (substr($PHP_SELF, -1) == 3) ? 'php3' : 'php'); /** * Gets some core libraries */ require('./config/config.lib.' . C_EXTENSION); require('./lib/common.lib.' . C_EXTENSION); /** * Gets the variables sent to this script * * Uses the 'pmcGrabGlobals()' function defined in the * 'chat/lib/common.lib.php3' library. */ pmcGrabGlobals('%GET'); /** * Defines the language to be used */ if (!file_exists('./localization/' . $lang . '/chat.loc')) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head><title>Error</title></head> <body> <b>No translation for this language!</b> </body> </html> <?php exit(); } require('./localization/' . $lang . '/chat.loc'); /** * Sends HTTP headers * * The 'pmcHttpHeaders()' function is defined in the 'chat/lib/common.lib.php3' * library */ pmcHttpHeaders(L_CHARSET, false); /** * Displays the popup * * Uses the 'pmcUrlForStyleSheet()' function from the * 'chat/lib/common.lib.php3' library */ // The url for the style sheet $cssUrl = pmcUrlForStyleSheet('style', L_CHARSET, (defined('L_FONT_NAME')) ? L_FONT_NAME : '', L_FONT_SIZE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo((L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'); ?>"> <head> <title><?php echo(L_SMIL_TIT); ?></title> <link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" /> <script type="text/javascript" language="javascript1.1"> <!-- /** * Put the 'input' frame in an object variable * * @return object the 'input' frame object * * @access private */ function pmcTargetWin() { if (typeof(window.opener) == 'undefined') return null; else if (window.opener.window.document.title == '<?php echo(APP_NAME); ?>') return window.opener.frames['input'].window; else if (window.opener.window.document.title == 'Handle input hidden frame') return window.opener.window.parent.frames['input'].window; else return window.opener.window; } // end of the 'pmcTargetWin()' function /** * Add a smiley to the message box at the 'input' frame * * @param string the smiley text code * * @access private */ function pmcSmiley2Input(code) { window.focus(); if (typeof(window.opener) != 'undefined' && window.opener && !window.opener.closed) { addTo = pmcTargetWin(); if (addTo && !addTo.closed) { oldStr = addTo.document.forms['inputForm'].elements['message'].value; oldStrLength = oldStr.length; if (oldStr != '' && oldStr.substring(oldStrLength - 1, oldStrLength) != ' ') code = ' ' + code; addTo.document.forms['inputForm'].elements['message'].value += code + ' '; } } } // end of the 'pmcSmiley2Input()' function /** * Kill the pointer to this window */ function pmcKillPointer() { if (typeof(window.opener) != 'undefined') window.opener.window.parent.jsSmiliesPopupWin = null; } // end of the 'pmcKillPointer()' function //--> </script> </head> <body class="mainFrame" onload="if (window.focus) window.focus()" onunload="pmcKillPointer()"> <?php if ($jsVersion != 'noJs') { echo('<p>' . "\n"); echo("\t" . L_SMIL_CLICK . "\n"); echo('</p>' . "\n"); } ?> <!-- Smilies codes --> <center> <table cellpadding="3" width="574" class="table"> <?php // Display smilies require('./lib/smilies.lib.' . C_EXTENSION); $smiliesCodes = pmcDisplaySmilies('help'); $smiliesCnt = count($smilies); unset($smilies); $i = 0; $smiliesCnt = count($smiliesCodes); while ($i < $smiliesCnt) { if ($i > 0) echo("\t"); echo('<tr valign="bottom">' . "\n"); echo($smiliesCodes[$i]); echo("\t" . '</tr>' . "\n"); echo("\t" . '<tr>' . "\n"); $i++; echo($smiliesCodes[$i]); echo("\t" . '</tr>' . "\n"); $i++; } unset($smiliesCodes); ?> </table> </center> <p> <?php echo(L_SMIL_MINE . "\n"); ?> </p> </body> </html> Index: input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** input.php3 2001/04/30 19:41:19 1.29 --- input.php3 2001/04/30 22:44:58 1.30 *************** *** 231,235 **** } // Define the message box size ! $msgBoxSize = 70 - ((L_FONT_SIZE - 10) * 3.5); // The urls for the help and the smilies popups --- 231,235 ---- } // Define the message box size ! $msgBoxSize = 68 - ((L_FONT_SIZE - 10) * 3.5); // The urls for the help and the smilies popups Index: help_popup.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/help_popup.php3,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** help_popup.php3 2001/04/28 20:31:18 1.13 --- help_popup.php3 2001/04/30 22:44:58 1.14 *************** *** 111,138 **** /** - * Add a smiley to the message box at the 'input' frame - * - * @param string the smiley text code - * - * @access private - */ - function pmcSmiley2Input(code) - { - window.focus(); - if (typeof(window.opener) != 'undefined' && window.opener && !window.opener.closed) - { - addTo = pmcTargetWin(); - if (addTo && !addTo.closed) - { - oldStr = addTo.document.forms['inputForm'].elements['message'].value; - oldStrLength = oldStr.length; - if (oldStr != '' && oldStr.substring(oldStrLength - 1, oldStrLength) != ' ') - code = ' ' + code; - addTo.document.forms['inputForm'].elements['message'].value += code + ' '; - } - } - } // end of the 'pmcSmiley2Input()' function - - /** * Add a command to the message box at the 'input' frame * --- 111,114 ---- *************** *** 176,215 **** <?php - // Display smilies - if (C_USE_SMILIES == 1) - { - include('./lib/smilies.lib.' . C_EXTENSION); - $smiliesCodes = pmcDisplaySmilies('help'); - $smiliesCnt = count($smilies); - unset($smilies); - ?> - <!-- Smilies codes --> - <table border="0" cellpadding="3" width="574" class="table"> - <tr> - <th class="tabTitle" colspan="<?php echo($smiliesCnt); ?>"><?php echo(L_HELP_TIT_1); ?></th> - </tr> - <?php - $i = 0; - $smiliesCnt = count($smiliesCodes); - while ($i < $smiliesCnt) - { - if ($i > 0) - echo("\t"); - echo('<tr valign="bottom">' . "\n"); - echo($smiliesCodes[$i]); - echo("\t" . '</tr>' . "\n"); - echo("\t" . '<tr>' . "\n"); - $i++; - echo($smiliesCodes[$i]); - echo("\t" . '</tr>' . "\n"); - $i++; - } - unset($smiliesCodes); - ?> - </table> - <br /> - <?php - } // end of display smilies - if (C_HTML_TAGS_KEEP != 'none') { --- 152,155 ---- *************** *** 218,222 **** <!-- Text formatting help --> <table border="0" cellpadding="3" width="574" class="table"> ! <tr><td align="center" class="tabTitle"><?php echo(L_HELP_TIT_2); ?></td></tr> <tr><td align="<?php echo($cellAlign); ?>"><?php echo(L_HELP_FMT_1); ?></td></tr> <tr><td align="<?php echo($cellAlign); ?>"><?php echo(L_HELP_FMT_2); ?></td></tr> --- 158,162 ---- <!-- Text formatting help --> <table border="0" cellpadding="3" width="574" class="table"> ! <tr><td align="center" class="tabTitle"><?php echo(L_HELP_TIT_1); ?></td></tr> <tr><td align="<?php echo($cellAlign); ?>"><?php echo(L_HELP_FMT_1); ?></td></tr> <tr><td align="<?php echo($cellAlign); ?>"><?php echo(L_HELP_FMT_2); ?></td></tr> *************** *** 230,234 **** <!-- Commands help --> <table border="0" cellpadding="3" width="574" class="table"> ! <tr><th align="center" class="tabTitle" colspan="2"><?php echo(L_HELP_TIT_3); ?></th></tr> <tr><th align="center" colspan="2"><?php echo(L_HELP_CMD_0); ?></th></tr> <tr><th align="<?php echo($cellAlign); ?>" colspan="2"><a href="#" onclick="pmcCmd2Input('/!', false); return false" class="sender">/!</a></th></tr> --- 170,174 ---- <!-- Commands help --> <table border="0" cellpadding="3" width="574" class="table"> ! <tr><th align="center" class="tabTitle" colspan="2"><?php echo(L_HELP_TIT_2); ?></th></tr> <tr><th align="center" colspan="2"><?php echo(L_HELP_CMD_0); ?></th></tr> <tr><th align="<?php echo($cellAlign); ?>" colspan="2"><a href="#" onclick="pmcCmd2Input('/!', false); return false" class="sender">/!</a></th></tr> |