You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(51) |
Apr
(688) |
May
(260) |
Jun
(108) |
Jul
(42) |
Aug
|
Sep
(2) |
Oct
|
Nov
(74) |
Dec
(217) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(3) |
Jun
(6) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(8) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/config In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/config Modified Files: config.lib.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: config.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/config/config.lib.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** config.lib.php3 2001/03/29 22:52:17 1.1 --- config.lib.php3 2001/04/03 20:10:15 1.2 *************** *** 43,48 **** define('C_MSG_DEL', 96); // Messages are deleted when there are 'xx' hours old define('C_USR_DEL', 4); // Usernames are deleted when its last use is 'xx' minutes old ! // the second setting must be greater than the maximum time // authorized between messages list refresh define('C_REG_DEL', 0); // Registered profiles are deleted when its last use is 'xx' days old // 'xx' should be 0 for never --- 43,50 ---- define('C_MSG_DEL', 96); // Messages are deleted when there are 'xx' hours old define('C_USR_DEL', 4); // Usernames are deleted when its last use is 'xx' minutes old ! // This setting must be greater than the maximum time // authorized between messages list refresh + define('C_SESS_DEL', 8); // Sessions are deleted when its last use is 'xx' minutes old + // This setting must be greater than the 'C_USR_DEL' one define('C_REG_DEL', 0); // Registered profiles are deleted when its last use is 'xx' days old // 'xx' should be 0 for never *************** *** 108,112 **** // Name and version of this application define('APP_NAME', 'phpMyChat'); // Application name ! define('APP_VERSION', '0.15.0 - dev'); // Application version number // Complete Url of the chat --- 110,114 ---- // Name and version of this application define('APP_NAME', 'phpMyChat'); // Application name ! define('APP_VERSION', '0.15.0 - dev1'); // Application version number // Complete Url of the chat |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/russian In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization/russian Modified Files: _localized.chat.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: _localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/russian/_localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** _localized.chat.php3 2001/03/28 22:28:57 1.1.1.1 --- _localized.chat.php3 2001/04/03 20:10:14 1.2 *************** *** 147,150 **** --- 147,151 ---- define('L_BEEP', 'ú×ÕË/ÎÅÔ Ú×ÕËÁ ÐÒÉ ×ÈÏÄÅ ÞÁÔÌÁÎÁ'); define('L_PROFILE', 'ðÏËÁÚÁÔØ ÐÒÏÆÁÉÌ'); + define('L_NO_PROFILE', 'No profile'); // input frame |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization Added Files: admin.lib.php3 languages.lib.php3 Log Message: The first dev. version that works! Still many things to do, of course... --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library defines the language that will be used for the | // | administration work. If there is no language already defined (neither in | // | a cookie, neither from a variable sent in the query part of the url) it | // | will try to get the most probable language the administrator would like | // | to use thanks to some environment variables. | // | | // | This file is called by the 'chat/admin.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: admin.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Defines the language to be used for the administration work of phpMyChat. // /** * Analyzes some PHP environment variables to find the most probable language * that should be used * * @param string string to analyze * @param integer type of the PHP environment variable which value is $str * * @global array the list of available translations * @global string the language to use * * @access private */ function pmcAdminDetect($str = '', $envType = '') { global $availableAdmins; global $lang; $notFound = true; reset($availableAdmins); while ($notFound && list($key, $name) = each($availableAdmins)) { // $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable, // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 1 && eregi('^' . $key . '$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])' . $key . '(;|\]|\))', $str))) { $lang = $availableAdmins[$key]; $notFound = false; } } } // end of the 'pmcAdminDetect()' function /** * Creates the array containing available languages */ // Defines available languages $availableAdmins = array(); $languageDirectories = dir('./localization/'); while ($name = $languageDirectories->read()) { if (is_dir('./localization/' . $name) && file_exists('./localization/' . $name . '/localized.admin.' . C_EXTENSION) { list($key) = file('./localization/' . $name . '/regex.txt'); $availableAdmins[$key] = $name; } } $languageDirectories->close(); // Sorts the $availableAdmins array in a convenient order if (!function_exists('krsort')) include('./localization/sort_languages.lib.' . C_EXTENSION); krsort($availableAdmins); /** * Get some predefined variables */ if (isset($HTTP_COOKIE_VARS['cookieLang'])) $cookieLang = $HTTP_COOKIE_VARS['cookieLang']; pmcGrabGlobals('HTTP_ACCEPT_LANGUAGE'); pmcGrabGlobals('HTTP_USER_AGENT'); /** * Finds the appropriate language file */ // If a language is defined in a cookie, ensures the translation exists if (isset($cookieLang) && file_exists('./localization/' . $cookieLang . '/localized.admin.' . C_EXTENSION)) { $lang = $cookieLang; } // Checks for an existing translation corresponding to the // 'HTTP_ACCEPT_LANGUAGE' variable sent by the browser else if ($HTTP_ACCEPT_LANGUAGE != '') { $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); pmcAdminDetect($accepted[0], 1); } // Checks for an existing translation corresponding to the // 'HTTP_USER_AGENT' variable sent by the browser else if ($HTTP_USER_AGENT != '') { pmcAdminDetect($HTTP_USER_AGENT, 2); } // If no translation has been retained, uses the default one if (!isset($lang)) $lang = (file_exists('./localization/' . C_LANGUAGE . '/localized.admin.' . C_EXTENSION)) ? C_LANGUAGE : 'english'; // Clears the table unset($availableAdmins); ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library defines the language that will be used during the chat | // | session. If there is no language already defined (neither in a cookie, | // | neither from a variable sent in the query part of the url) it will try | // | to get the most probable language the user would like to use thanks to | // | some environment variables. | // | | // | This file is called by most of the phpMyChat scripts. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: languages.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Defines the language to be used during the chat session. // /** * Analyzes some PHP environment variables to find the most probable language * that should be used * * @param string string to analyze * @param integer type of the PHP environment variable which value is $str * * @global array the list of available translations * @global string the session table * * @access private */ function pmcLangDetect($str = '', $envType = '') { global $availableLanguages; global $dbSessionVars; $notFound = true; reset($availableLanguages); while ($notFound && list($key, $name) = each($availableLanguages)) { // $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable, // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 1 && eregi('^' . $key . '$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])' . $key . '(;|\]|\))', $str))) { $dbSessionVars['lang'] = $availableLanguages[$key]; $notFound = false; } } } // end of the 'pmcLangDetect()' function /** * Creates the array containing available languages */ // Ensures the _CHAT_PATH constant is defined if (!defined('_CHAT_PATH')) define('_CHAT_PATH', ''); // Defines available languages $availableLanguages = array(); $languageDirectories = dir('./' . _CHAT_PATH . 'localization/'); while ($name = $languageDirectories->read()) { if (is_dir('./' . _CHAT_PATH . 'localization/' . $name) && file_exists('./' . _CHAT_PATH . 'localization/' . $name . '/regex.txt') && file_exists('./' . _CHAT_PATH . 'localization/' . $name . '/localized.chat.' . C_EXTENSION) && file_exists('./' . _CHAT_PATH . 'localization/' . $name . '/flag.gif')) { list($key) = file('./' . _CHAT_PATH . 'localization/' . $name . '/regex.txt'); $availableLanguages[$key] = $name; } } $languageDirectories->close(); // Sorts the $availableLanguages array in a convenient order if (!function_exists('krsort')) include('./' . _CHAT_PATH . 'localization/sort_languages.lib.' . C_EXTENSION); krsort($availableLanguages); /** * Get some predefined variables */ if (isset($HTTP_COOKIE_VARS['cookieLang'])) $cookieLang = $HTTP_COOKIE_VARS['cookieLang']; pmcGrabGlobals('HTTP_ACCEPT_LANGUAGE'); pmcGrabGlobals('HTTP_USER_AGENT'); /** * Finds the appropriate language file */ // The language is already defined if ((dbSessionIsRegistered('lang') && !empty($dbSessionVars['lang'])) || C_MULTI_LANG == 0) { // void } // If a language is defined in a cookie, ensures the translation exists else if (isset($cookieLang) && file_exists('./' . _CHAT_PATH . 'localization/' . $cookieLang . '/localized.chat.' . C_EXTENSION)) { $dbSessionVars['lang'] = $cookieLang; } // Checks for an existing translation corresponding to the // 'HTTP_ACCEPT_LANGUAGE' variable sent by the browser else if ($HTTP_ACCEPT_LANGUAGE != '') { $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); pmcLangDetect($accepted[0], 1); } // Checks for an existing translation corresponding to the // 'HTTP_USER_AGENT' variable sent by the browser else if ($HTTP_USER_AGENT != '') { pmcLangDetect($HTTP_USER_AGENT, 2); } // If no translation has been retained, uses the default one if (!dbSessionIsRegistered('lang')) $dbSessionVars['lang'] = C_LANGUAGE; // Puts the language retained in a cookie that will expire in one year setcookie('cookieLang', $dbSessionVars['lang'], time() + 60*60*24*365); ?> |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:09:40
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv3076/chat Modified Files: link.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: link.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/link.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:09:10
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv2906/chat Modified Files: index.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: index.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/index.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** index.php3 2001/03/29 22:52:17 1.1 --- index.php3 2001/04/03 20:09:06 1.2 *************** *** 69,77 **** // php code here. ! $username = (isset($cookieUsername)) ? $cookieUsername : ''; ! $roomName = (isset($cookieRoom)) ? $cookieRoom : ''; ! $roomType = (isset($cookieRoomType)) ? $cookieRoomType : ''; ! ! pmcStartpageLayout($username, $roomName, $roomType); // You can add php code here, or add html statements before the '</body>' tag. --- 69,73 ---- // php code here. ! pmcStartpageLayout(); // You can add php code here, or add html statements before the '</body>' tag. |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:08:25
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv2694/chat Modified Files: blank.htm Log Message: The first dev. version that works! Still many things to do, of course... Index: blank.htm =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/blank.htm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:00:54
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv32486/index_libs Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs added to the repository |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:00:27
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/images/tutorials_imgs In directory usw-pr-cvs1:/tmp/cvs-serv32358/tutorials_imgs Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/images/tutorials_imgs added to the repository |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:00:11
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/images/smilies In directory usw-pr-cvs1:/tmp/cvs-serv32247/smilies Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/images/smilies added to the repository |
From: Lo?c C. <lo...@us...> - 2001-04-03 19:59:55
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/images/admin_imgs In directory usw-pr-cvs1:/tmp/cvs-serv32105/admin_imgs Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/images/admin_imgs added to the repository |
From: Lo?c C. <lo...@us...> - 2001-04-03 19:59:32
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/images In directory usw-pr-cvs1:/tmp/cvs-serv31961/images Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/images added to the repository |
From: Lo?c C. <lo...@us...> - 2001-04-03 11:07:49
|
Update of /cvsroot/phpmychat/phpMyChat - 0.14/chat In directory usw-pr-cvs1:/tmp/cvs-serv16471 Modified Files: loader.php3 Log Message: Fix a bug if the username contains a single quote ***** Bogus filespec: - ***** Bogus filespec: 0.14/chat Index: loader.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/loader.php3,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** loader.php3 2001/04/02 17:57:44 1.4 --- loader.php3 2001/04/03 11:07:44 1.5 *************** *** 279,287 **** { // doubles backslashes except the ones for closing HTML tags ! $ToSend = ereg_replace("([^<]+)[\]","\\1\\\\",$Messages[$message_nb-1-$i]); // slashes the quotes that should be displayed ! $ToSend = str_replace("\"","\\\"",$ToSend); ?> ! window.parent.frames['messages'].window.document.write("<?php echo($ToSend); ?>\n"); <?php }; --- 279,288 ---- { // doubles backslashes except the ones for closing HTML tags ! $toPush = str_replace('\\', '\\\\', $Messages[$message_nb - 1 - $i]); ! $toPush = str_replace('<\\\\/', '<\\/', $toPush); // slashes the quotes that should be displayed ! $toPush = str_replace("\"","\\\"",$toPush); ?> ! window.parent.frames['messages'].window.document.write("<?php echo($toPush); ?>\n"); <?php }; |
From: Lo?c C. <lo...@us...> - 2001-04-02 17:57:49
|
Update of /cvsroot/phpmychat/phpMyChat - 0.14/chat In directory usw-pr-cvs1:/tmp/cvs-serv13536 Modified Files: loader.php3 Log Message: A little javascript improvement to avoid an annoying error message ***** Bogus filespec: - ***** Bogus filespec: 0.14/chat Index: loader.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/loader.php3,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** loader.php3 2001/03/23 18:44:46 1.3 --- loader.php3 2001/04/02 17:57:44 1.4 *************** *** 318,322 **** <SCRIPT TYPE="text/javascript" LANGUAGE="javascript1.1"> <!-- ! if (typeof(window.parent.frames['exit']) != 'undefined') window.parent.ConnectDone(); // --> </SCRIPT> --- 318,324 ---- <SCRIPT TYPE="text/javascript" LANGUAGE="javascript1.1"> <!-- ! if (typeof(window.parent.frames['exit']) != 'undefined' ! && typeof(window.parent.ConnectDone) != 'undefined') ! window.parent.ConnectDone(); // --> </SCRIPT> |
From: Lo?c C. <lo...@us...> - 2001-03-30 06:39:12
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv25349 Added Files: blank.htm link.php3 Log Message: First drafts for the 0.15 release --- NEW FILE --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <!-- // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | An empty page that will be dynamically filled. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: blank.htm,v 1.1 2001/03/30 06:39:08 loic1 Exp $ // // An empty page that will be dynamically filled. --> <head> <title>Blank title</title> </head> <body> <!-- Not a blank document ;) --> </body> </html> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | The bottom-right frame with the phpHeaven icon. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: link.php3,v 1.1 2001/03/30 06:39:08 loic1 Exp $ // // The bottom-right frame with the phpHeaven icon. /** * 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'); /** * Displays the frame */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <title>Blank title</title> <link rel="stylesheet" href="config/style.css.<?php echo(C_EXTENSION); ?>" type="text/css" /> </head> <body class="frame"> <center> <a href="http://www.phpheaven.net/" target="_blank"><img src="images/icon.gif" width="88" height="31" border="0" /></a> </center> </body> </html> |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:03:11
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv9147/lib Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/lib added to the repository |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:03:03
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/install In directory usw-pr-cvs1:/tmp/cvs-serv9193/install Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/install added to the repository |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:02:58
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/config In directory usw-pr-cvs1:/tmp/cvs-serv9221/config Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/config added to the repository |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:02:33
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/install/database In directory usw-pr-cvs1:/tmp/cvs-serv9281/database Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/install/database added to the repository |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:02:29
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/database In directory usw-pr-cvs1:/tmp/cvs-serv9316/database Log Message: Directory /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/database added to the repository |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:01:41
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/install/database In directory usw-pr-cvs1:/tmp/cvs-serv9865/chat/install/database Added Files: mysql.sql Log Message: First drafts for the 0.15 release --- NEW FILE --- # # Table structure for table 'pmc_ban_users' # CREATE TABLE /*!32312 IF NOT EXISTS*/ pmc_ban_users ( username varchar(30) NOT NULL DEFAULT '' , latin1 tinyint(1) unsigned NOT NULL DEFAULT '0' , ip varchar(16) NOT NULL DEFAULT '' , rooms varchar(100) NOT NULL DEFAULT '' , ban_until int(11) unsigned NOT NULL DEFAULT '0' , PRIMARY KEY (username), KEY ip (ip), KEY ban_until (ban_until) ); # # Table structure for table 'pmc_messages' # CREATE TABLE /*!32312 IF NOT EXISTS*/ pmc_messages ( type tinyint(1) unsigned NOT NULL DEFAULT '0' , room varchar(30) NOT NULL DEFAULT '' , username varchar(30) NOT NULL DEFAULT '' , latin1 tinyint(1) unsigned NOT NULL DEFAULT '0' , m_time int(11) unsigned NOT NULL DEFAULT '0' , address varchar(30) , message text NOT NULL DEFAULT '' , KEY type (type), KEY m_time (m_time) ); # # Table structure for table 'pmc_reg_users' # CREATE TABLE /*!32312 IF NOT EXISTS*/ pmc_reg_users ( username varchar(30) NOT NULL DEFAULT '' , latin1 tinyint(1) unsigned NOT NULL DEFAULT '0' , password varchar(32) NOT NULL DEFAULT '' , firstname varchar(64) NOT NULL DEFAULT '' , lastname varchar(64) NOT NULL DEFAULT '' , country varchar(64) , website varchar(64) , email varchar(64) NOT NULL DEFAULT '' , showemail tinyint(1) unsigned NOT NULL DEFAULT '0' , perms varchar(9) NOT NULL DEFAULT 'user' , rooms varchar(128) NOT NULL DEFAULT '' , reg_time int(11) unsigned NOT NULL DEFAULT '0' , ip varchar(16) NOT NULL DEFAULT '' , gender tinyint(1) unsigned NOT NULL DEFAULT '0' , PRIMARY KEY (username), KEY reg_time (reg_time), KEY perms (perms) ); # # Table structure for table 'pmc_sessions' # CREATE TABLE /*!32312 IF NOT EXISTS*/ pmc_sessions ( session_id varchar(32) NOT NULL DEFAULT '' , last int(11) unsigned NOT NULL DEFAULT '0' , data text , PRIMARY KEY (session_id), KEY last (last) ); # # Table structure for table 'pmc_users' # CREATE TABLE /*!32312 IF NOT EXISTS*/ pmc_users ( session_id varchar(32) NOT NULL DEFAULT '' , room varchar(30) NOT NULL DEFAULT '' , latin1 tinyint(1) unsigned NOT NULL DEFAULT '0' , username varchar(30) NOT NULL DEFAULT '' , status char(1) NOT NULL DEFAULT 'u' , ip varchar(16) NOT NULL DEFAULT '' , PRIMARY KEY (session_id), KEY room_id (room), KEY status (status) ); |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:01:38
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/database In directory usw-pr-cvs1:/tmp/cvs-serv9865/chat/lib/database Added Files: pgsql.lib.php3 odbc.lib.php3 oci8.lib.php3 mysql.lib.php3 Log Message: First drafts for the 0.15 release --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library sets an object to access a PostgreSQL database. It uses | // | default configuration if no parameters are given to the constructor. | // | | // | usage: - include this library to the top of your files | // | - create new database handlers like this: | // | $dbHandler = new DB; | // | or | // | $dbHandler = new DB($dbHost, $dbName, $dbUser, $dbPass); | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: pgsql.lib.php3,v 1.1 2001/03/29 22:52:17 loic1 Exp $ // // PostgreSQL database handler for PHP3 and PHP4. // if (!defined('_LIB_PMCDB_LOADED')) { define('_LIB_PMCDB_LOADED', true); /** * CONFIGURATION: Whether to display error messages or not * * @const _LIB_PGSQL_SHOW_ERROR_MESSAGES */ define('_LIB_PMCDB_PGSQL_SHOW_ERROR_MESSAGES', true); /** * This library sets an object to access a PostgeSQL database. It uses * default configuration if no parameters are given to the constructor. * * @access public * @version 0.3.0 * @package phpMyChat * @author the phpHeaven-team <php...@eg...> * @author Martin Dvorak <je...@pe...> * @copyright the phpHeaven-team */ class pmcDB { /** * Hostname of the PostgreSQL server * * @var string $dbHost */ var $dbHost = C_DB_HOST; /** * Logical database name on that server * * @var string $dbName */ var $dbName = C_DB_NAME; /** * Database authorized user * * @var string $dbUser */ var $dbUser = C_DB_USER; /** * User's password * * @var string $dbPass */ var $dbPass = C_DB_PASS; /** * Last result of pg_Connect() * * @var string $linkId */ var $linkId = 0; /** * Last result of pg_exec() * * @var string $queryId */ var $queryId = 0; /** * Last record fetched * * @var array $record */ var $record = array(); /** * Current row number * * @var integer $currentRow */ var $currentRow; /** * Last error number (not supported) * * @var integer $errorNumber */ var $errorNumber = 0; /** * Last error message * * @var string $errorMessage */ var $errorMessage = ''; /** * Last error location * * @var string $errorLocation */ var $errorLocation = ''; /** * pmcDB constructor * * @param string the hostname of the PostgreSQL server * @param string the logical database name on that server * @param string the database authorized user * @param string the user's password * * @access public */ function pmcDB($dbHost = '', $dbName = '', $dbUser = '', $dbPass = '') { if (!empty($dbHost)) $this->dbHost = $dbHost; if (!empty($dbName)) $this->dbName = $dbName; if (!empty($dbUser)) $this->dbUser = $dbUser; if (!empty($dbPass)) $this->dbPass = $dbPass; } // end of the 'pmcDB()' method /** * Handle and display error messages * * @param string the error localtion * * @access private */ function updateError($location) { // $this->errorNumber = pg_errno(); // not supported $this->errorMessage = pg_errormessage(); $this->errorLocation = $location; if ($this->errorMessage && _LIB_PMCDB_PGSQL_SHOW_ERROR_MESSAGES) { echo('<br /><b>PostgreSQL error:</b> ' . $this->errorMessage . "\n"); echo('<br /><b>With:</b> ' . $this->errorLocation . "\n"); echo('<br /><b>At:</b> ' . basename($GLOBALS['PHP_SELF']) . "\n"); die('<br /><br />Session halted.' . "\n"); die('<br />Session halted.' . "\n"); flush(); } } // end of the 'updateError()' method /** * Do connect to the database * * @return boolean whether connection succeed or not * * @access private */ function connect() { if ($this->linkId == 0) { $options = 'dbname=' . $this->dbName; if ($this->dbHost) { $tmp = split(':', $this->dbHost); if ($tmp[0]) { $options .= ' host=' . $tmp[0]; if ($tmp[1]) $options .= ' port=' . $tmp[1]; } } if ($this->dbUser) $options .= ' user=' . $this->dbUser; if ($this->dbPass) $options .= ' password=' . $this->dbPass; $this->linkId = @pg_Connect($options); if (!$this->linkId) { $this->updateError('pmcDB::connect() - pg_Connect'); return false; } } return true; } // end of the 'connect()' method /** * Do run a database query * * @param string the query to run * * @return integer the query ID (0 if the query failed) * * @access public */ function query($queryString) { $this->connect(); $this->queryId = @pg_exec($this->linkId, $queryString); $this->currentRow = 0; if (!$this->queryId) { $this->updateError('pmcDB::query(' . $queryString . ') - pg_exec'); return 0; } return $this->queryId; } // end of the 'query()' method /** * Get the next record * * @return mixed the next record in an array if it exists, 'false' * else * * @access public * * @see pmcDB::query() */ function nextRecord() { $this->record = @pg_fetch_array($this->queryId, $this->currentRow); if (!$this->record || !is_array($this->record)) { $this->updateError('pmcDB::nextRecord() - pg_fetch_array'); @pg_freeresult($this->queryId); $this->queryId = 0; return false; } $this->currentRow++; return $this->record; } // end of the 'nextRecord()' method /** * Get the number of rows returned by the last select query * * @return integer the number of matching records * * @access public */ function numRows() { return ($this->queryId) ? @pg_numrows($this->queryId) : 0; } // end of the 'numRows()' method /** * Get the number of affected rows returned by the last update or * delete query * * @return integer the number of affected records * * @access public */ function affectedRows() { return ($this->queryId) ? @pg_cmdtuples($this->queryId) : 0; } // end of the 'affectedRows()' method /** * Optimize a database table * * @return boolean whether something has been done or not * * @access public */ function optimize($tableName) { $this->connect(); if ($this->linkId) { $optimized = $this->query('VACUUM ' . $tableName); } else { $optimized = 0; } return ($optimized > 0); } // end of the 'optimize()' method /** * Clean the result of a query from the memory * * @return boolean whether something has been done or not * * @access public */ function cleanResults() { if ($this->queryId) { @pg_FreeResult($this->queryId); return true; } return false; } // end of the 'cleanResults()' method /** * Close the link to the database * * @return boolean whether something has been done or not * * @access public */ function close() { if ($this->linkId) { @pg_close($this->linkId); return true; } return false; } // end of the 'close()' method } // end of the 'pmcDB' class } ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library sets an object to access an ODBC database. It uses default | // | configuration if no parameters are given to the constructor. | // | | // | usage: - include this library to the top of your files | // | - create new database handlers like this: | // | $dbHandler = new pmcDB; | // | or | // | $dbHandler = new pmcDB($dbHost, $dbName, $dbUser, $dbPass); | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: J. "Guli" Mikulas <gu...@em...> | // | the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: odbc.lib.php3,v 1.1 2001/03/29 22:52:17 loic1 Exp $ // // ODBC database handler for PHP3 and PHP4. // if (!defined('_LIB_PMCDB_LOADED')) { define('_LIB_PMCDB_LOADED', true); /** * CONFIGURATION: Whether to display error messages or not * * @const _LIB_PMCDB_ODBC_SHOW_ERROR_MESSAGES */ define('_LIB_PMCDB_ODBC_SHOW_ERROR_MESSAGES', true); /** * This library sets an object to access an ODBC database. It uses default * configuration if no parameters are given to the constructor. * * @access public * @version 0.3.0 * @package phpMyChat * @author the phpHeaven-team <php...@eg...> * @author J. "Guli" Mikulas <gu...@em...> * @copyright the phpHeaven-team */ class pmcDB { /** * Hostname of the ODBC server * * @var string $dbHost */ var $dbHost = C_DB_HOST; /** * Logical database name on that server * * @var string $dbName */ var $dbName = C_DB_NAME; /** * Database authorized user * * @var string $dbUser */ var $dbUser = C_DB_USER; /** * User's password * * @var string $dbPass */ var $dbPass = C_DB_PASS; /** * Type of cursor to be used for this connection * * @var integer $useOdbcCursor */ var $useOdbcCursor = 0; /** * Whether to automatically free results or not (1/0) * * @var integer $autoFree */ var $autoFree = 1; /** * Last result of odbc_connect() * * @var string $linkId */ var $linkId = 0; /** * Last result of odbc_exec() * * @var string $queryId */ var $queryId = 0; /** * Last record fetched * * @var array $record */ var $record = array(); /** * Current row number * * @var integer $currentRow */ var $currentRow; /** * Last error number * * @var integer $errorNumber */ var $errorNumber = 0; /** * Last error message * * @var string $errorMessage */ var $errorMessage = ''; /** * Last error location * * @var string $errorLocation */ var $errorLocation = ''; /** * pmcDB constructor * * @param string the hostname of the ODBC server * @param string the logical database name on that server * @param string the database authorized user * @param string the user's password * * @access public */ function pmcDB($dbHost = '', $dbName = '', $dbUser = '', $dbPass = '') { if (!empty($dbHost)) $this->dbHost = $dbHost; if (!empty($dbName)) $this->dbName = $dbName; if (!empty($dbUser)) $this->dbUser = $dbUser; if (!empty($dbPass)) $this->dbPass = $dbPass; } // end of the 'pmcDB()' method /** * Handle and display error messages * * @param string the error localtion * * @access private */ function updateError($location) { // --- Removed by loic --- // $this->errorNumber = 1; // $this->errorMessage = 'General Error (The ODBC interface cannot return detailed error messages).'; // ----------------------- $this->errorNumber = odbc_error(); $this->errorMessage = odbc_errormsg(); $this->errorLocation = $location; if ($this->errorNumber && _LIB_PMCDB_ODBC_SHOW_ERROR_MESSAGES) { echo('<br /><b>ODBC error:</b> (' . $this->errorNumber . ') ' . $this->errorMessage . "\n"); echo('<br /><b>With:</b> ' . $this->errorLocation . "\n"); echo('<br /><b>At:</b> ' . basename($GLOBALS['PHP_SELF']) . "\n"); die('<br /><br />Session halted.' . "\n"); flush(); } } // end of the 'updateError()' method /** * Do connect to the database * * @return boolean whether connection succeed or not * * @access private */ function connect() { if (0 == $this->linkId) { $this->linkId = @odbc_connect($this->dbName, $this->dbUser, $this->dbPass, $this->useOdbcCursor); if (!$this->linkId) { $this->updateError('pmcDB::connect() - odbc_connect'); return false; } } return true; } // end of the 'connect()' method /** * Do run a database query * * @param string the query to run * * @return integer the query ID (0 if the query failed) * * @access public * * @todo find a workaround for the 'LIMIT' clause */ function query($queryString) { // remove the 'LIMIT' clause from the query $pos = strpos($queryString, ' LIMIT '); if ($pos) $queryString = substr($queryString, 0, $pos); unset($pos); $this->connect(); // echo('<br />Debug: query = ' . $queryString . '<br /> . "\n"); // re...@ne... suggested that we use this instead of the // odbc_exec(). // He is on NT, connecting to a Unix MySQL server with ODBC. // -- KK // $this->queryId = odbc_prepare($this->linkId, $queryString); // $this->queryOk = odbc_execute($this->queryId); $this->queryId = @odbc_exec($this->linkId, $queryString); $this->currentRow = 0; odbc_binmode($this->queryId, 1); odbc_longreadlen($this->queryId, 4096); if (!$this->queryId) { $this->updateError('pmcDB::query(' . $queryString . ') - odbc_exec'); return 0; } return $this->queryId; } // end of the 'query()' method /** * Get the next record * * @return mixed the next record in an array if it exists, 'false' * else * * @access public * * @see pmcDB::query() */ function nextRecord() { $this->$stat = @odbc_fetch_into($this->queryId, ++$this->row, &$this->record); if (!$this->$stat) { $this->updateError('pmcDB::nextRecord() - odbc_fetch_into'); if ($this->autoFree) @odbc_free_result($this->queryId); $this->queryId = 0; return false; } else { // add to record[<key>] $count = @odbc_num_fields($this->queryId); for ($i = 1; $i <= $count; $i++) $this->record[strtolower(odbc_field_name($this->queryId, $i))] = $this->record[$i - 1]; } $this->currentRow++; return $this->record; } // end of the 'nextRecord()' method /** * Set the current row number * * @param integer the current row number * * @access public */ function seek($pos) { $this->currentRow = $pos; } // end of the 'seek()' method /** * Get informations about a table * * @param string the table name * * @return mixed false if the command failed, an array containing * metadata informations else * * @access public */ function metadata($table) { $count = 0; $id = 0; $res = array(); $this->connect(); $id = @odbc_exec($this->linkId, 'SELECT * FROM ' . $table); if (!$id) { $this->updateError('pmcDB::metadata(' . $table . ') - odbc_exec'); return false; } $count = odbc_num_fields($id); for ($i = 1; $i <= $count; $i++) { $res[$i]['table'] = $table; $name = odbc_field_name($id, $i); $res[$i]['name'] = $name; $res[$i]['type'] = odbc_field_type($id, $name); $res[$i]['len'] = 0; // can we determine the width of // this column? $res[$i]['flags'] = ''; // any optional flags to report? } odbc_free_result($id); return $res; } // end of the 'metadata()' method /** * Get the number of rows returned by the last query * * Many ODBC drivers don't support 'odbc_num_rows()' on 'SELECT' * statements. The workaround below is intended to be ugly! * * @return integer the number of matching records * * @access public */ function numRows() { if (!$this->queryId) return 0; $numRows = @odbc_num_rows($this->queryId); // Workaround starts here. if ($numRows < 0) { $i = 10; while (odbc_fetch_row($this->queryId, $i)) $i *= 10; $j = 0; while ($i != $j) { $k = $j + intval(($i - $j) / 2); if (odbc_fetch_row($this->queryId, $k)) $j = $k; else $i = $k; if (($i - $j) == 1) { if (odbc_fetch_row($this->queryId, $i)) $j = $i; else $i = $j; } } $numRows = $i; } return $numRows; } // end of the 'numRows()' method /** * Get the number of fields returned by the last select query * * @return integer the number of fields * * @access public */ function numFields() { return count($this->record) / 2; } // end of the 'numFields()' method /** * Get the value of a field for a perticular record * * @return mixed the value of the field if it exists, false else * * @access public */ function fieldValue($fieldName) { return (isset($this->record[strtolower($fieldName)])) ? $this->record[strtolower($fieldName)] : false; } // end of the 'fieldValue()' method /** * Get the number of affected rows returned by the last update or * delete statement * * @return integer the number of affected records * * @access public * * @see pmcDB::numRows() */ function affectedRows() { return numRows(); } // end of the 'affectedRows()' method /** * Optimize a database table * * @return boolean whether something has been done or not * * @access public * * @todo the whole function! */ function optimize($tableName) { $this->connect(); if ($this->linkId) { // TODO // $optimized = $this->query('OPTIMIZE TABLE ' . $tableName); $optimized = 0; } else { $optimized = 0; } return ($optimized > 0); } // end of the 'optimize()' method /** * Clean the result of a query from the memory * * @return boolean whether something has been done or not * * @access public */ function cleanResults() { if ($this->queryId) { @odbc_freeresult($this->queryId); return true; } return false; } // end of the 'cleanResults()' method /** * Close the link to the database * * @return boolean whether something has been done or not * * @access public */ function close() { if ($this->linkId) { @odbc_close($this->linkId); return true; } return false; } // end of the 'close()' method } // end of the 'pmcDB' class } ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library sets an object to access an OCI8 database. It uses default | // | configuration if no parameters are given to the constructor. | // | | // | usage: - include this library to the top of your files | // | - create new database handlers like this: | // | $dbHandler = new pmcDB; | // | or | // | $dbHandler = new pmcDB($dbHost, $dbName, $dbUser, $dbPass); | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: Guillaume Boddaert <gbo...@e-...> | // | Catherine Lam <cl...@e-...> | // | the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: oci8.lib.php3,v 1.1 2001/03/29 22:52:17 loic1 Exp $ // // OCI8 database handler for PHP3 and PHP4. // if (!defined('_LIB_PMCDB_LOADED')) { define('_LIB_PMCDB_LOADED', true); /** * CONFIGURATION: Whether to display error messages or not * * @const _LIB_PMCDB_OCI8_SHOW_ERROR_MESSAGES */ define('_LIB_PMCDB_OCI8_SHOW_ERROR_MESSAGES', true); /** * This library sets an object to access a OCI8 database. It uses default * configuration if no parameters are given to the constructor. * * @access public * @version 0.1.0 * @package phpMyChat * @author the phpHeaven-team <php...@eg...> * @author Guillaume Boddaert <gbo...@e-...> * @author Catherine Lam <cl...@e-...> * @copyright the phpHeaven-team */ class pmcDB { /** * Hostname of the OCI8 server * * @var string $dbHost */ var $dbHost = C_DB_HOST; /** * Logical database name on that server * * @var string $dbName */ var $dbName = C_DB_NAME; /** * Database authorized user * * @var string $dbUser */ var $dbUser = C_DB_USER; /** * User's password * * @var string $dbPass */ var $dbPass = C_DB_PASS; /** * Last result of ocipLogon() * * @var string $linkId */ var $linkId = 0; /** * Result of the most recent OciExecute() * * @var string $queryId */ var $queryId = 0; /** * Last record fetched * * @var array $record */ var $record = array(); /** * Current row number * * @var integer $currentRow */ var $currentRow; /** * Last error number * * @var integer $errorNumber */ var $errorNumber = 0; /** * Last error message * * @var string $errorMessage */ var $errorMessage = ''; /** * Last error location * * @var string $errorLocation */ var $errorLocation = ''; /** * pmcDB constructor * * @param string the hostname of the OCI8 server * @param string the logical database name on that server * @param string the database authorized user * @param string the user's password * * @access public */ function pmcDB($dbHost = '', $dbName = '', $dbUser = '', $dbPass = '') { if (!empty($dbHost)) $this->dbHost = $dbHost; if (!empty($dbName)) $this->dbName = $dbName; if (!empty($dbUser)) $this->dbUser = $dbUser; if (!empty($dbPass)) $this->dbPass = $dbPass; } // end of the 'pmcDB()' method /** * Handle and display error messages * * @param string the error localtion * * @access private */ function updateError($location) { $currentError = OCIError(); $this->errorNumber = $currentError['code']; $this->errorMessage = $currentError['message']; $this->errorLocation = $location; if ($this->errorNumber && _LIB_PMCDB_OCI8_SHOW_ERROR_MESSAGES) { echo('<br /><b>ORACLE error:</b> (' . $this->errorNumber . ') ' . $this->errorMessage . "\n"); echo('<br /><b>With:</b> ' . $this->errorLocation . "\n"); echo('<br /><b>At:</b> ' . basename($GLOBALS['PHP_SELF']) . "\n"); die('<br /><br />Session halted.' . "\n"); flush(); } } // end of the 'updateError()' method /** * Do connect to the database * * @return boolean whether connection succeed or not * * @access private */ function connect() { if (0 == $this->linkId) { // --- Changed from persistent to non-persistent mode by loic --- // $this->linkId = @OCIPlogon($this->dbUser, $this->dbPass, $this->dbName); $this->linkId = @OCILogon($this->dbUser, $this->dbPass, $this->dbName); // -------------------------------------------------------------- if (!$this->linkId) { $this->updateError('pmcDB::connect() - OCILogon'); return false; } } return true; } // end of the 'connect()' method /** * Do run a database query * * @param string the query to run * * @return integer the query ID (0 if the query failed) * * @access public */ function query($queryString) { $this->connect(); $this->queryId = @OCIParse($this->linkId, $queryString); $this->currentRow = 0; if (!$this->queryId) { $this->updateError('pmcDB::query(' . $queryString . ') - OCIParse'); return 0; } $this->queryId = @OCIExecute($this->queryId); if (!$this->queryId) { $this->updateError('pmcDB::query(' . $queryString . ') - OCIExecute'); return 0; } return $this->queryId; } // end of the 'query()' method /** * Get the next record * * @return mixed the next record in an array if it exists, 'false' * else * * @access public * * @see pmcDB::query() */ function nextRecord() { $isResult = @OCIFetchInto($this->queryId, $this->Record, OCI_NUM+OCI_RETURN_NULLS); if (!$isResult) { $this->updateError('pmcDB::nextRecord() - OCIFetchInto'); @ocifreestatement($this->queryId); $this->queryId = 0; return false; } $this->currentRow++; return $this->record; } // end of the 'nextRecord()' method /** * Get the number of rows returned by the last select query * * @return integer the number of matching records * * @access public * * @todo the whole function! */ function numRows() { return ($this->queryId) ? @OCIrowcount($this->queryId) : 0; } // end of the 'numRows()' method /** * Get the number of affected rows returned by the last update or * delete query * * @return integer the number of affected records * * @access public */ function affectedRows() { return ($this->queryId) ? @OCIrowcount($this->queryId) : 0; } // end of the 'affectedRows()' method /** * Optimize a database table * * @return boolean whether something has been done or not * * @access public * * @todo the whole function! */ function optimize($tableName) { $this->connect(); if ($this->linkId) { // TODO // $optimized = $this->query('OPTIMIZE TABLE ' . $tableName); $optimized = 0; } else { $optimized = 0; } return ($optimized > 0); } // end of the 'optimize()' method /** * Clean the result of a query from the memory * * @return boolean whether something has been done or not * * @access public */ function cleanResults() { if ($this->queryId) { @ocifreestatement($this->queryId); return true; } return false; } // end of the 'cleanResults()' method /** * Close the link to the database * * @return boolean whether something has been done or not * * @access public */ function close() { if ($this->linkId) { @OCILogoff($this->linkId); return true; } return false; } // end of the 'close()' method } // end of the 'pmcDB' class } ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library sets an object to access a MySQL database. It uses default | // | configuration if no parameters are given to the constructor. | // | | // | usage: - include this library to the top of your files | // | - create new database handlers like this: | // | $dbHandler = new pmcDB; | // | or | // | $dbHandler = new pmcDB($dbHost, $dbName, $dbUser, $dbPass); | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: mysql.lib.php3,v 1.1 2001/03/29 22:52:17 loic1 Exp $ // // MySQL database handler for PHP3 and PHP4. // if (!defined('_LIB_PMCDB_LOADED')) { define('_LIB_PMCDB_LOADED', true); /** * CONFIGURATION: Whether to display error messages or not * * @const _LIB_PMCDB_MYSQL_SHOW_ERROR_MESSAGES */ define('_LIB_PMCDB_MYSQL_SHOW_ERROR_MESSAGES', true); /** * This library sets an object to access a MySQL database. It uses default * configuration if no parameters are given to the constructor. * * @access public * @version 0.3.0 * @package phpMyChat * @author the phpHeaven-team <php...@eg...> * @copyright the phpHeaven-team */ class pmcDB { /** * Hostname of the MySQL server * * @var string $dbHost */ var $dbHost = C_DB_HOST; /** * Logical database name on that server * * @var string $dbName */ var $dbName = C_DB_NAME; /** * Database authorized user * * @var string $dbUser */ var $dbUser = C_DB_USER; /** * User's password * * @var string $dbPass */ var $dbPass = C_DB_PASS; /** * Last result of mysql_connect() * * @var string $linkId */ var $linkId = 0; /** * Last result of mysql_query() * * @var string $queryId */ var $queryId = 0; /** * Last record fetched * * @var array $record */ var $record = array(); /** * Current row number * * @var integer $currentRow */ var $currentRow; /** * Last error number * * @var integer $errorNumber */ var $errorNumber = 0; /** * Last error message * * @var string $errorMessage */ var $errorMessage = ''; /** * Last error location * * @var string $errorLocation */ var $errorLocation = ''; /** * pmcDB constructor * * @param string the hostname of the MySQL server * @param string the logical database name on that server * @param string the database authorized user * @param string the user's password * * @access public */ function pmcDB($dbHost = '', $dbName = '', $dbUser = '', $dbPass = '') { if (!empty($dbHost)) $this->dbHost = $dbHost; if (!empty($dbName)) $this->dbName = $dbName; if (!empty($dbUser)) $this->dbUser = $dbUser; if (!empty($dbPass)) $this->dbPass = $dbPass; } // end of the 'pmcDB()' method /** * Handle and display error messages * * @param string the error localtion * * @access private */ function updateError($location) { $this->errorNumber = mysql_errno(); $this->errorMessage = mysql_error(); $this->errorLocation = $location; if ($this->errorNumber && _LIB_PMCDB_MYSQL_SHOW_ERROR_MESSAGES) { echo('<br /><b>MySQL error:</b> (' . $this->errorNumber . ') ' . $this->errorMessage . "\n"); echo('<br /><b>With:</b> ' . $this->errorLocation . "\n"); echo('<br /><b>At:</b> ' . basename($GLOBALS['PHP_SELF']) . "\n"); die('<br /><br />Session halted.' . "\n"); flush(); } } // end of the 'updateError()' method /** * Do connect to the database * * @return boolean whether connection succeed or not * * @access private */ function connect() { if ($this->linkId == 0) { $this->linkId = @mysql_connect($this->dbHost, $this->dbUser, $this->dbPass); if (!$this->linkId) { $this->updateError('pmcDB::connect() - mysql_connect'); return false; } $selectResult = @mysql_select_db($this->dbName, $this->linkId); if (!$selectResult) { $this->updateError('pmcDB::connect() - mysql_select_db'); return false; } } return true; } // end of the 'connect()' method /** * Do run a database query * * @param string the query to run * * @return integer the query ID (0 if the query failed) * * @access public */ function query($queryString) { $this->connect(); $this->queryId = @mysql_query($queryString, $this->linkId); $this->currentRow = 0; if (!$this->queryId) { $this->updateError('pmcDB::query(' . $queryString . ') - mysql_query'); return 0; } return $this->queryId; } // end of the 'query()' method /** * Get the next record * * @return mixed the next record in an array if it exists, 'false' * else * * @access public * * @see pmcDB::query() */ function nextRecord() { $this->record = @mysql_fetch_array($this->queryId); if (!$this->record || !is_array($this->record)) { $this->updateError('pmcDB::nextRecord() - mysql_fetch_array'); @mysql_free_result($this->queryId); $this->queryId = 0; return false; } $this->currentRow++; return $this->record; } // end of the 'nextRecord()' method /** * Get the number of rows returned by the last select query * * @return integer the number of matching records * * @access public */ function numRows() { return ($this->queryId) ? @mysql_num_rows($this->queryId) : 0; } // end of the 'numRows()' method /** * Get the number of affected rows returned by the last update or * delete query * * @return integer the number of affected records * * @access public */ function affectedRows() { return ($this->linkId) ? @mysql_affected_rows($this->linkId) : 0; } // end of the 'affectedRows()' method /** * Optimize a database table * * @return boolean whether something has been done or not * * @access public */ function optimize($tableName) { $this->connect(); if ($this->linkId) { $optimized = $this->query('OPTIMIZE TABLE ' . $tableName); } else { $optimized = 0; } return ($optimized > 0); } // end of the 'optimize()' method /** * Clean the result of a query from the memory * * @return boolean whether something has been done or not * * @access public */ function cleanResults() { if ($this->queryId) { @mysql_freeresult($this->queryId); return true; } return false; } // end of the 'cleanResults()' method /** * Close the link to the database * * @return boolean whether something has been done or not * * @access public */ function close() { if ($this->linkId) { @mysql_close($this->linkId); return true; } return false; } // end of the 'close()' method } // end of the 'pmcDB' class } ?> |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:01:36
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv9865/chat Added Files: index.php3 Log Message: First drafts for the 0.15 release --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This script is an example of what may be done to include phpMyChat into | // | an existing web page, regardless of its name (another example is the | // | the 'phpMyChat.php3' script at the root of the phpMyChat package). | // | You can also include such a file in a frameset. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: index.php3,v 1.1 2001/03/29 22:52:17 loic1 Exp $ // // Launches the phpMyChat script. // /** * Defines the relative path to the chat directory and gets the main library * * The lines below must be at the top of your file because * 'main_index.lib.php3' sets headers and cookies. */ // relative path from this file to the chat directory (empty if this file is in // the same directory than the chat) define('_CHAT_PATH', ''); // 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'); require('./' . _CHAT_PATH .'lib/index_libs/main_index.lib.' . C_EXTENSION); /** * Displays the starting form * * The 'pmcStartpageHeaders()' and 'pmcStartpageLayout()' functions are defined * inside the 'chat/lib/index_libs/main_index.lib.php3' library */ ?> <!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> <?php // You can put html head statements right after the '<head>' tag pmcStartpageHeaders(1, 1); ?> </head> <body class="chatBody"> <?php // If nothing other than phpMyChat is loaded in this page, or if you want // to have the same background color as phpMyChat for the whole page, // you have to modify the '<body>' tag to '<body class="chatBody">' // You can put html statements right after the '<body>' tag or add // php code here. $username = (isset($cookieUsername)) ? $cookieUsername : ''; $roomName = (isset($cookieRoom)) ? $cookieRoom : ''; $roomType = (isset($cookieRoomType)) ? $cookieRoomType : ''; pmcStartpageLayout($username, $roomName, $roomType); // You can add php code here, or add html statements before the '</body>' tag. ?> </body> </html> |
From: Lo?c C. <lo...@us...> - 2001-03-29 23:01:32
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/config In directory usw-pr-cvs1:/tmp/cvs-serv9865/chat/config Added Files: config.lib.php3 Log Message: First drafts for the 0.15 release --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This is the main configuration file for phpMyChat. You have to complete | // | it. | // | BEWARE: '," and \ characters must be slashed in the settings bellow. | // | | // | It is called by almost all of the phpMyChat scripts. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: config.lib.php3,v 1.1 2001/03/29 22:52:17 loic1 Exp $ // // Configuration file for phpMyChat. // /** * THESE SETTINGS MUST BE COMPLETED */ // Database settings define('C_DB_TYPE', 'mysql'); // SQL server type ('mysql' or 'postgresql') define('C_DB_HOST', 'localhost'); // Hostname of your MySQL server define('C_DB_NAME', 'db_name'); // Logical database name on that server define('C_DB_USER', 'username'); // Database user define('C_DB_PASS', 'password'); // Database user's password define('C_MSG_TBL', 'pmc_messages'); // Name of the table where messages are stored define('C_USR_TBL', 'pmc_users'); // Name of the table where user names are stored define('C_REG_TBL', 'pmc_reg_users'); // Name of the table where registered users are stored define('C_BAN_TBL', 'pmc_ban_users'); // Name of the table where banished users are stored define('C_SESS_TBL', 'pmc_sessions'); // Name of the table where banished users are stored // Cleaning settings for messages and usernames define('C_MSG_DEL', 96); // Messages are deleted when there are 'xx' hours old define('C_USR_DEL', 4); // Usernames are deleted when its last use is 'xx' minutes old // the second setting must be greater than the maximum time // authorized between messages list refresh define('C_REG_DEL', 0); // Registered profiles are deleted when its last use is 'xx' days old // 'xx' should be 0 for never /** * THESE SETTINGS ALLOW TO FINE TUNE phpMyChat */ // Proposed (default) rooms and reserved names for private rooms $defaultChatRooms = array('Default', 'MyRoom1', 'MyRoom2'); $defaultPrivateRooms = array('Priv1', 'Priv2'); // Language settings define('C_LANGUAGE', 'english'); // Default language define('C_MULTI_LANG', 1); // Allow multi-languages/charset ? : 0 = no, 1 = yes // Registration of users define('C_REQUIRE_REGISTER', 0); // Require registration ? : 0 = no, 1 = yes define('C_EMAIL_PASWD', 0); // Generate a password and send it to the user by e-mail ? 0 = no, 1 = yes // To enable this functionaly you also have to complete the settings in // the 'chat/lib/mail_validation.lib.php3' script // Security and restrictions define('C_SHOW_ADMIN', 0); // Show link for admin resources at startup screen ? 0 = no, 1 = yes define('C_SHOW_DEL_PROF', 1); // Show link that allows users to delete their own profile ? 0 = no, 1 = yes define('C_VERSION', 2); // Available rooms : users can access... // 0 : only the first room within the public default ones // 1 : all the public default rooms but not create a room // 2 : all the rooms and create new ones define('C_BANISH', 0); // Enable the banishment feature and define the delay for banishment // 0 = disabled, any positive number = number of banishment day(s) // if you want all moderators (and not only yourself) to banish users // forever, set C_BANISH to 2000000 (six zero) define('C_BAD_WORDS', 0); // Check for bad words defined in chat/lib/swearing.lib.php3 file ? // 0 = no, 1 = yes define('C_SAVE', '*'); // Max number of message that an user may export with the /save command // Special values: 0 = none (disable the command), * = no limit // Messages enhancements define('C_USE_SMILIES', 1); // Use graphical smilies ? : 0 = no, 1 = yes define('C_HTML_TAGS_KEEP', 'simple'); // Keep HTML tags in messages ? // 'simple' : keep bold, italic and underline tags // 'none' : keep none define('C_HTML_TAGS_SHOW', 1); // Show discarded HTML tags ? : 0 = no, 1 = yes // Default display settings define('C_TMZ_OFFSET', 0); // Timezone offset in hour between the server time and your country define('C_MSG_ORDER', 0); // Default order : 0 = last on top, 1 = last on bottom define('C_MSG_NB', 20); // Default number of messages to display define('C_MSG_REFRESH', 10); // Default timeout between each update define('C_SHOW_TIMESTAMP', 1); // Show Timsestamp before messages ? : 0 = no, 1 = yes define('C_NOTIFY', 1); // Show nofications of user entrance/exit as default. ? : 0 = no, 1 = yes define('C_WELCOME', 1); // Display a welcome message (defined inside 'chat/lib/welcome.lib.php3') // at user entrance // E-mail stuff define('C_MAIL_FUNCTION', 1); // Whether the mail function is enabled or not define('C_REG_SENDER', 'your name'); // Full sender name to be used in the registration form define('C_REG_EMAIL', 'your e-mail'); // Sender e-mail to be used in the registration form define('C_ADM_SENDER', 'your name'); // Full sender name to be used in the fourth administration sheet define('C_ADM_EMAIL', 'your e-mail'); // Sender e-mail to be used in the fourth administration sheet // Name and version of this application define('APP_NAME', 'phpMyChat'); // Application name define('APP_VERSION', '0.15.0 - dev'); // Application version number // Complete Url of the chat define('C_CHAT_URL', 'http://www.mysite.net/chat/'); ?> |
From: Lo?c C. <lo...@us...> - 2001-03-29 19:06:36
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/spanish In directory usw-pr-cvs1:/tmp/cvs-serv29024 Modified Files: localized.chat.php3 Log Message: Some uggly parse errors fixed... Sorry! Index: localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/spanish/localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** localized.chat.php3 2001/03/28 22:29:02 1.1.1.1 --- localized.chat.php3 2001/03/29 19:06:31 1.2 *************** *** 91,95 **** define('L_REG_35', 'Administracion'); define('L_REG_36', 'Idiomas Hablados'); ! define('L_REG_37', 'Por favor, los campos que contienen un <span class='error'>*</span> deben ser completados.'); define('L_REG_39', 'Este canal ha sido eliminado por el administrador.'); define('L_REG_45', 'Sexo'); --- 91,95 ---- define('L_REG_35', 'Administracion'); define('L_REG_36', 'Idiomas Hablados'); ! define('L_REG_37', 'Por favor, los campos que contienen un <span class="error">*</span> deben ser completados.'); define('L_REG_39', 'Este canal ha sido eliminado por el administrador.'); define('L_REG_45', 'Sexo'); *************** *** 100,104 **** define('L_EMAIL_VAL_1', 'Tu configuracion para entrar en el chat'); define('L_EMAIL_VAL_2', 'Bienvenido a tu servidor chat.'); ! define('L_EMAIL_VAL_Err', 'Error Interno, por favor contacta con el administrador: <a href='mailto:%s'>%s</a>.'); define('L_EMAIL_VAL_Done', 'La contraseña a sido enviada a tu direccion de correo electronico.'); --- 100,104 ---- define('L_EMAIL_VAL_1', 'Tu configuracion para entrar en el chat'); define('L_EMAIL_VAL_2', 'Bienvenido a tu servidor chat.'); ! define('L_EMAIL_VAL_Err', 'Error Interno, por favor contacta con el administrador: <a href="mailto:%s">%s</a>.'); define('L_EMAIL_VAL_Done', 'La contraseña a sido enviada a tu direccion de correo electronico.'); *************** *** 166,170 **** define('L_NO_ADMIN', 'Solo el administrador puede usar este comando.'); define('L_ANNOUNCE', 'Anunciar'); ! define('L_INVITE', '%s te invita a unirte en <a href='#' onclick='window.parent.runCmd(\'%s\', \'%s\')'>%s</a> room.'); define('L_INVITE_REG', ' Tienes que estar registrado para entrar en este canal.'); define('L_INVITE_DONE', 'Tu invitacion a sido enviada a %s.'); --- 166,170 ---- define('L_NO_ADMIN', 'Solo el administrador puede usar este comando.'); define('L_ANNOUNCE', 'Anunciar'); ! define('L_INVITE', '%s te invita a unirte en <a href="#" onclick="window.parent.runCmd(\'%s\', \'%s\')">%s</a> room.'); define('L_INVITE_REG', ' Tienes que estar registrado para entrar en este canal.'); define('L_INVITE_DONE', 'Tu invitacion a sido enviada a %s.'); *************** *** 201,205 **** define('L_HELP_CMD_17', 'Permitir al administrador mandar un anuncio a todos los usuarios, sin importar en el canal en el que esten chateando.'); define('L_HELP_CMD_18', 'Sugerir a usuarios que esten chateando en otros canales que se unan a tu canal.'); ! define('L_HELP_CMD_19', 'Permitir que el moderador de un canal o el administrador 'expluse' a un usuario del canal por un tiempo determinado por el administrador.<br />Si despues de haberlo baneado el usuario esta chateando en otros canales, puedes usar '<b> * </b>' un nuevo comando para expulsarlo de nuevo 'para siempre' del chat entero, no solo de los canales.'); define('L_HELP_CMD_20', 'Describe lo que estas haciendo.'); --- 201,205 ---- define('L_HELP_CMD_17', 'Permitir al administrador mandar un anuncio a todos los usuarios, sin importar en el canal en el que esten chateando.'); define('L_HELP_CMD_18', 'Sugerir a usuarios que esten chateando en otros canales que se unan a tu canal.'); ! define('L_HELP_CMD_19', 'Permitir que el moderador de un canal o el administrador "expluse" a un usuario del canal por un tiempo determinado por el administrador.<br />Si despues de haberlo baneado el usuario esta chateando en otros canales, puedes usar "<b> * </b>" un nuevo comando para expulsarlo de nuevo "para siempre" del chat entero, no solo de los canales.'); define('L_HELP_CMD_20', 'Describe lo que estas haciendo.'); |
From: Lo?c C. <lo...@us...> - 2001-03-29 19:05:33
|
Update of /cvsroot/phpmychat/phpMyChat - 0.14/chat In directory usw-pr-cvs1:/tmp/cvs-serv28757 Modified Files: usersH.php3 Log Message: Arg, another (and best I hope) fix for Netscape ***** Bogus filespec: - ***** Bogus filespec: 0.14/chat Index: usersH.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/usersH.php3,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** usersH.php3 2001/03/24 14:17:28 1.8 --- usersH.php3 2001/03/29 19:05:29 1.9 *************** *** 90,267 **** //** Build users list for the current room ** ! if(C_DB_TYPE == 'mysql') { ! $DbLink->query("SELECT ".C_USR_TBL.".username, ".C_USR_TBL.".latin1, status, gender FROM ".C_USR_TBL." LEFT JOIN ".C_REG_TBL." ON ".C_USR_TBL.".username = ".C_REG_TBL.".username WHERE room='$R' ORDER BY username"); ! echo("<B>".htmlspecialchars(stripslashes($R))."</B><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$DbLink->num_rows().")</SPAN><BR>\n"); ! echo("<DIV STYLE=\"margin-bottom: 10px\">\n"); ! while(list($User, $Latin1, $status, $gender) = $DbLink->next_record()) ! { ! // Put an icon when there is a profile for the user ! if($gender == 0) ! $gender = 'undefined'; ! elseif($gender == 1) ! $gender = 'boy'; ! elseif($gender == 2) ! $gender = 'girl'; ! else ! $gender = 'none'; ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! $Cmd2Send = ($User == stripslashes($U) ? "'PROFILE',''" : "'WHOIS','".special_char2($User,$Latin1)."'"); ! echo('<a href="#" onClick="window.parent.runCmd('.$Cmd2Send.'); return false;" class="user"><img name="whoisImg'.$ImgNum.'" src="images/gender_'.$gender.'.gif" width="14" height="14" border="0" alt="'.L_PROFILE.'"></a> '); ! //echo("<A HREF=\"#\" onClick=\"window.parent.runCmd($Cmd2Send); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); ! } ! else ! { ! echo('<img name="whoisImg'.$ImgNum.'" src="images/gender_none.gif" width="14" height="14" border="0" alt="Pas de profil"> '); ! //echo("- "); ! }; ! if($User != stripslashes($U)) ! { ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($User,$Latin1)."',false);\" CLASS=\"user\">".special_char($User,$Latin1,$status)."</A><BR>\n"); ! } ! else ! { ! echo(special_char($User,$Latin1,$status)."<BR>\n"); ! } ! } ! echo("</DIV>\n"); ! $DbLink->clean_results(); ! //** Build users list for other rooms ** ! $AddPwd2Link = (isset($PWD_Hash) && $PWD_Hash != "") ? "&PWD_Hash=$PWD_Hash" : ""; ! $DbLink->query("SELECT DISTINCT room FROM ".C_MSG_TBL." WHERE room != '$R' AND type = 1 ORDER BY room"); ! if($DbLink->num_rows() > 0) ! { ! $i = 0; ! $ChildNb = Array(); ! $OthersUsers = new DB; ! while(list($Other) = $DbLink->next_record()) ! { ! $OthersUsers->query("SELECT ".C_USR_TBL.".username, ".C_USR_TBL.".latin1, status, gender FROM ".C_USR_TBL." LEFT JOIN ".C_REG_TBL." ON ".C_USR_TBL.".username = ".C_REG_TBL.".username WHERE room = '".addslashes($Other)."' ORDER BY username"); ! if($OthersUsers->num_rows() > 0) ! { ! $i++; ! $id = md5($Other); ! if ($i == 1) $FirstOtherRoom = "Parent".$id; ! echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); ! echo("<A HREF=\"#\" onClick=\"window.parent.expandIt('${id}'); return false\">"); ! echo("<IMG NAME=\"imEx\" SRC=\"images/closed.gif\" WIDTH=9 HEIGHT=9 BORDER=0 ALT=\"".L_EXPCOL."\"></A>"); ! echo(" <A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R1=".urlencode($Other)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($Other)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$OthersUsers->num_rows().")</SPAN>"); ! echo("</DIV>\n"); ! echo("<DIV ID=\"Child${id}\" CLASS=\"child\" STYLE=\"margin-left: 12px\">\n"); ! $j = 0; ! while(list($OtherUser, $Latin1, $status, $gender) = $OthersUsers->next_record()) ! { ! $j++; ! // Put an icon when there is a profile for the user ! if($gender == 0) ! $gender = 'undefined'; ! elseif($gender == 1) ! $gender = 'boy'; ! elseif($gender == 2) ! $gender = 'girl'; ! else ! $gender = 'none'; ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! //echo("<A HREF=\"#\" onClick=\"window.parent.runCmd('WHOIS','".special_char2($OtherUser,$Latin1)."'); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); ! echo('<a href="#" onClick="window.parent.runCmd(\'WHOIS\',\''.special_char2($OtherUser,$Latin1).'\'); return false;" class="user"><img name="whoisImg'.$ImgNum.'" src="images/gender_'.$gender.'.gif" width="14" height="14" border="0" alt="'.L_PROFILE.'"></a> '); ! } ! else ! { ! //echo("- "); ! echo('<img name="whoisImg'.$ImgNum.'" src="images/gender_none.gif" width="14" height="14" border="0" alt="Pas de profil"> '); ! }; ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($OtherUser,$Latin1)."',false);\" CLASS=\"user\">".special_char($OtherUser,$Latin1,$status)."</A><BR>\n"); ! }; ! echo("</DIV>\n"); ! $ChildNb[$id] = $j; ! } ! $OthersUsers->clean_results(); ! } } - $DbLink->clean_results(); - $DbLink->close(); } ! else { ! $DbLink->query("SELECT username, latin1, status FROM ".C_USR_TBL." WHERE room='$R' ORDER BY username"); ! echo("<B>".htmlspecialchars(stripslashes($R))."</B><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$DbLink->num_rows().")</SPAN><BR>\n"); ! echo("<DIV STYLE=\"margin-bottom: 10px\">\n"); ! while(list($User, $Latin1, $status, $gender) = $DbLink->next_record()) { ! // Put an icon when there is a profile for the user ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") { ! $ImgNum++; ! $Cmd2Send = ($User == stripslashes($U) ? "'PROFILE',''" : "'WHOIS','".special_char2($User,$Latin1)."'"); ! echo("<A HREF=\"#\" onClick=\"window.parent.runCmd($Cmd2Send); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); } else - { - echo("- "); - }; - if($User != stripslashes($U)) { ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($User,$Latin1)."',false);\" CLASS=\"user\">".special_char($User,$Latin1,$status)."</A><BR>\n"); } - else - { - echo(special_char($User,$Latin1,$status)."<BR>\n"); - } - } - echo("</DIV>\n"); - $DbLink->clean_results(); ! //** Build users list for other rooms ** ! $AddPwd2Link = (isset($PWD_Hash) && $PWD_Hash != "") ? "&PWD_Hash=$PWD_Hash" : ""; ! $DbLink->query("SELECT DISTINCT room FROM ".C_MSG_TBL." WHERE room != '$R' AND type = 1 ORDER BY room"); ! if($DbLink->num_rows() > 0) ! { ! $i = 0; ! $ChildNb = Array(); ! $OthersUsers = new DB; ! while(list($Other) = $DbLink->next_record()) { ! $OthersUsers->query("SELECT username, latin1, status FROM ".C_USR_TBL." WHERE room = '".addslashes($Other)."' ORDER BY username"); ! if($OthersUsers->num_rows() > 0) { ! $i++; ! $id = md5($Other); ! if ($i == 1) $FirstOtherRoom = "Parent".$id; ! echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); ! echo("<A HREF=\"#\" onClick=\"window.parent.expandIt('${id}'); return false\">"); ! echo("<IMG NAME=\"imEx\" SRC=\"images/closed.gif\" WIDTH=9 HEIGHT=9 BORDER=0 ALT=\"".L_EXPCOL."\"></A>"); ! echo(" <A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R1=".urlencode($Other)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($Other)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$OthersUsers->num_rows().")</SPAN>"); ! echo("</DIV>\n"); ! echo("<DIV ID=\"Child${id}\" CLASS=\"child\" STYLE=\"margin-left: 12px\">\n"); ! $j = 0; ! while(list($OtherUser,$Latin1,$status) = $OthersUsers->next_record()) { ! $j++; ! // Put an icon when there is a profile for the user ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! echo("<A HREF=\"#\" onClick=\"window.parent.runCmd('WHOIS','".special_char2($OtherUser,$Latin1)."'); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); ! } ! else ! { ! echo("- "); ! }; ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($OtherUser,$Latin1)."',false);\" CLASS=\"user\">".special_char($OtherUser,$Latin1,$status)."</A><BR>\n"); ! }; ! echo("</DIV>\n"); ! $ChildNb[$id] = $j; } ! $OthersUsers->clean_results(); } } - $DbLink->clean_results(); - $DbLink->close(); } // Display all rest default rooms --- 90,235 ---- //** Build users list for the current room ** ! if (C_DB_TYPE == 'mysql') { ! $currentRoomQuery = '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 = \'' . $R . '\' ' ! . 'ORDER BY usr.username'; ! } ! else if (C_DB_TYPE == 'pgsql') ! { ! $currentRoomQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' ! . 'FROM ' . C_USR_TBL . ' usr, ' . C_REG_TBL . ' reg ' ! . 'WHERE usr.room = \'' . $R . '\' ' ! . 'UNION ' ! . 'SELECT usr.username, usr.latin1, usr.status, NULL ' ! . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.username NOT IN (SELECT reg.username FROM ' . C_REG_TBL . ' reg) AND usr.room = \'' . $R . '\' ' ! . 'ORDER BY usr.username'; ! } ! else ! { ! $currentRoomQuery = 'SELECT usr.username, usr.latin1, usr.status, NULL ' ! . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.room = \'' . $R . '\' ' ! . 'ORDER BY usr.username'; ! } ! $DbLink->query($currentRoomQuery); ! echo("<B>".htmlspecialchars(stripslashes($R))."</B><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$DbLink->num_rows().")</SPAN><BR>\n"); ! echo("<DIV STYLE=\"margin-bottom: 10px\">\n"); ! while(list($User, $Latin1, $status, $gender) = $DbLink->next_record()) ! { ! // Put an icon when there is a profile for the user ! if($gender == 0) ! $gender = 'undefined'; ! elseif($gender == 1) ! $gender = 'boy'; ! elseif($gender == 2) ! $gender = 'girl'; ! else ! $gender = 'none'; ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! $Cmd2Send = ($User == stripslashes($U) ? "'PROFILE',''" : "'WHOIS','".special_char2($User,$Latin1)."'"); ! echo('<a href="#" onClick="window.parent.runCmd('.$Cmd2Send.'); return false;" class="user"><img name="whoisImg'.$ImgNum.'" src="images/gender_'.$gender.'.gif" width="14" height="14" border="0" alt="'.L_PROFILE.'"></a> '); ! } ! else ! { ! echo('<img name="whoisImg'.$ImgNum.'" src="images/gender_none.gif" width="14" height="14" border="0" alt="Pas de profil"> '); ! } ! if($User != stripslashes($U)) ! { ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($User,$Latin1)."',false);\" CLASS=\"user\">".special_char($User,$Latin1,$status)."</A><BR>\n"); ! } ! else ! { ! echo(special_char($User,$Latin1,$status)."<BR>\n"); } } ! echo("</DIV>\n"); ! $DbLink->clean_results(); ! ! //** Build users list for other rooms ** ! $AddPwd2Link = (isset($PWD_Hash) && $PWD_Hash != "") ? "&PWD_Hash=$PWD_Hash" : ""; ! $DbLink->query("SELECT DISTINCT room FROM ".C_MSG_TBL." WHERE room != '$R' AND type = 1 ORDER BY room"); ! if($DbLink->num_rows() > 0) { ! $i = 0; ! $ChildNb = Array(); ! $OthersUsers = new DB; ! while(list($Other) = $DbLink->next_record()) { ! if (C_DB_TYPE == 'mysql') { ! $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 = \'' . addslashes($Other) . '\' ' ! . 'ORDER BY usr.username'; ! } ! else if (C_DB_TYPE == 'pgsql') ! { ! $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, reg.gender ' ! . 'FROM ' . C_USR_TBL . ' usr, ' . C_REG_TBL . ' reg ' ! . 'WHERE usr.room = \'' . addslashes($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 = \'' . addslashes($Other) . '\' ' ! . 'ORDER BY usr.username'; } else { ! $otherRoomsQuery = 'SELECT usr.username, usr.latin1, usr.status, 0 ' ! . 'FROM ' . C_USR_TBL . ' usr ' ! . 'WHERE usr.room = \'' . addslashes($Other) . '\' ' ! . 'ORDER BY usr.username'; } ! $OthersUsers->query($otherRoomsQuery); ! if($OthersUsers->num_rows() > 0) { ! $i++; ! $id = md5($Other); ! if ($i == 1) $FirstOtherRoom = "Parent".$id; ! echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); ! echo("<A HREF=\"#\" onClick=\"window.parent.expandIt('${id}'); return false\">"); ! echo("<IMG NAME=\"imEx\" SRC=\"images/closed.gif\" WIDTH=9 HEIGHT=9 BORDER=0 ALT=\"".L_EXPCOL."\"></A>"); ! echo(" <A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R1=".urlencode($Other)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($Other)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$OthersUsers->num_rows().")</SPAN>"); ! echo("</DIV>\n"); ! echo("<DIV ID=\"Child${id}\" CLASS=\"child\" STYLE=\"margin-left: 12px\">\n"); ! $j = 0; ! while(list($OtherUser, $Latin1, $status, $gender) = $OthersUsers->next_record()) { ! $j++; ! // Put an icon when there is a profile for the user ! if($gender == 0) ! $gender = 'undefined'; ! elseif($gender == 1) ! $gender = 'boy'; ! elseif($gender == 2) ! $gender = 'girl'; ! else ! $gender = 'none'; ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") { ! $ImgNum++; ! echo('<a href="#" onClick="window.parent.runCmd(\'WHOIS\',\''.special_char2($OtherUser,$Latin1).'\'); return false;" class="user"><img name="whoisImg'.$ImgNum.'" src="images/gender_'.$gender.'.gif" width="14" height="14" border="0" alt="'.L_PROFILE.'"></a> '); ! } ! else ! { ! echo('<img name="whoisImg'.$ImgNum.'" src="images/gender_none.gif" width="14" height="14" border="0" alt="Pas de profil"> '); ! } ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($OtherUser,$Latin1)."',false);\" CLASS=\"user\">".special_char($OtherUser,$Latin1,$status)."</A><BR>\n"); } ! echo("</DIV>\n"); ! $ChildNb[$id] = $j; } + $OthersUsers->clean_results(); } } + $DbLink->clean_results(); + $DbLink->close(); // Display all rest default rooms *************** *** 270,279 **** $tmpRoom = stripslashes($DefaultChatRooms[$k]); $id = md5($tmpRoom); - if (!isset($FirstOtherRoom) && $k == 0) - $FirstOtherRoom = "Parent".$id; // Display this room name when it hadn't been displayed yet if (strcasecmp($tmpRoom, stripslashes($R)) != 0 && (!isset($ChildNb) || !isset($ChildNb[$id]))) { echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); echo("<A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R0=".urlencode($tmpRoom)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($tmpRoom)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (0)</SPAN>"); --- 238,248 ---- $tmpRoom = stripslashes($DefaultChatRooms[$k]); $id = md5($tmpRoom); // Display this room name when it hadn't been displayed yet if (strcasecmp($tmpRoom, stripslashes($R)) != 0 && (!isset($ChildNb) || !isset($ChildNb[$id]))) { + if (!isset($FirstOtherRoom)) + $FirstOtherRoom = "Parent".$id; + echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); echo("<A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R0=".urlencode($tmpRoom)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($tmpRoom)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (0)</SPAN>"); |