phpfreechat-svn Mailing List for phpFreeChat (Page 29)
Status: Beta
Brought to you by:
kerphi
You can subscribe to this list here.
2006 |
Jan
|
Feb
(2) |
Mar
|
Apr
(61) |
May
(56) |
Jun
(96) |
Jul
(23) |
Aug
(62) |
Sep
(76) |
Oct
(48) |
Nov
(28) |
Dec
(28) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(31) |
Feb
(40) |
Mar
(29) |
Apr
(11) |
May
(6) |
Jun
(18) |
Jul
(18) |
Aug
(108) |
Sep
(24) |
Oct
(6) |
Nov
(21) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(16) |
Apr
|
May
(3) |
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(3) |
Dec
(2) |
2009 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ke...@us...> - 2006-06-13 20:15:40
|
Revision: 567 Author: kerphi Date: 2006-06-13 13:15:32 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=567&view=rev Log Message: ----------- the oldmsg css class was broken Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php trunk/themes/default/templates/pfcgui.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-13 09:34:05 UTC (rev 566) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-13 20:15:32 UTC (rev 567) @@ -657,7 +657,7 @@ { var msg_html = $H(); - // alert(cmds.inspect()); + //alert(cmds.inspect()); // var html = ''; for(var mid = 0; mid < cmds.length ; mid++) @@ -669,16 +669,16 @@ var recipientid = cmds[mid][4]; var cmd = cmds[mid][5]; var param = cmds[mid][6]; - //var fromtoday = cmds[mid][6]; - //var oldmsg = cmds[mid][7]; + var fromtoday = cmds[mid][7]; + var oldmsg = cmds[mid][8]; // format and post message var line = ''; line += '<div id="<?php echo $prefix; ?>msg'+ id +'" class="<?php echo $prefix; ?>'+ cmd +' <?php echo $prefix; ?>message'; - // if (oldmsg == 1) line += ' <?php echo $prefix; ?>oldmsg'; + if (oldmsg == 1) line += ' <?php echo $prefix; ?>oldmsg'; line += '">'; line += '<span class="<?php echo $prefix; ?>date'; - // if (fromtoday == 1) line += ' <?php echo $prefix; ?>invisible'; + if (fromtoday == 1) line += ' <?php echo $prefix; ?>invisible'; line += '">'+ date +'</span> '; line += '<span class="<?php echo $prefix; ?>heure">'+ time +'</span> '; if (cmd == 'send') Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-13 09:34:05 UTC (rev 566) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-13 20:15:32 UTC (rev 567) @@ -92,6 +92,7 @@ cc.setAttribute('id', '<?php echo $prefix; ?>chat_'+tabid); Element.addClassName(cc, '<?php echo $prefix; ?>chat'); cc.style.display = "block"; // needed by IE6 to show the online div at startup (first loaded page) + cc.style.marginLeft = "5px"; this.chatcontent[tabid] = cc; return cc; Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-06-13 09:34:05 UTC (rev 566) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-13 20:15:32 UTC (rev 567) @@ -87,10 +87,8 @@ div.<?php echo $prefix; ?>chat { z-index: 100; position: absolute; - top: 0px; - /* left and width are adjusted to leave a small margin on the left of the chat area - * padding css rule doesn't work because the chat zone is generated by JS function */ - left: 0.5%; + top: 0; + left: 0; width: 79.5%; height: 100%; overflow: auto; @@ -141,7 +139,7 @@ } div.<?php echo $prefix; ?>oldmsg { - background-color: #EEE; + color: #AAA; } span.<?php echo $prefix; ?>heure, span.<?php echo $prefix; ?>date { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-13 09:34:16
|
Revision: 566 Author: kerphi Date: 2006-06-13 02:34:05 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=566&view=rev Log Message: ----------- Bug fix: on Firefox 1.5, the tab display was wrong Modified Paths: -------------- trunk/themes/default/templates/style.css.tpl.php Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-06-12 15:48:04 UTC (rev 565) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-13 09:34:05 UTC (rev 566) @@ -14,6 +14,7 @@ background-image: url(<?php echo $c->getFileUrlFromTheme('images/shade.gif'); ?>); background-position: right; background-repeat: repeat-y; + font-family: Verdana, Sans-Serif; /* without this rule, the tabs are not correctly display on FF */ } #<?php echo $prefix; ?>minmax { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-12 15:48:10
|
Revision: 565 Author: kerphi Date: 2006-06-12 08:48:04 -0700 (Mon, 12 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=565&view=rev Log Message: ----------- typo Modified Paths: -------------- trunk/i18n/fr_FR/main.php Modified: trunk/i18n/fr_FR/main.php =================================================================== --- trunk/i18n/fr_FR/main.php 2006-06-12 15:38:25 UTC (rev 564) +++ trunk/i18n/fr_FR/main.php 2006-06-12 15:48:04 UTC (rev 565) @@ -205,7 +205,7 @@ $GLOBALS["i18n"]["'/unban all' will unban all the users on this channel"] = "'/unban all' va débannir tous les bannis de ce salon"; // line 24 in update.class.php -$GLOBALS["i18n"]["%s quit (timeout)"] = "%s à quitté (timeout)"; +$GLOBALS["i18n"]["%s quit (timeout)"] = "%s a quitté (timeout)"; // line 46 in join.class.php $GLOBALS["i18n"]["%s joins %s"] = "%s a rejoint %s"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-12 15:38:41
|
Revision: 564 Author: kerphi Date: 2006-06-12 08:38:25 -0700 (Mon, 12 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=564&view=rev Log Message: ----------- - remove useless ie7 script - fix problem with smiley box display - first step for IE6 display problems (chat area and nickname list are sometime hidden) Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php trunk/src/phpfreechat.class.php trunk/themes/default/templates/chat.js.tpl.php trunk/themes/default/templates/pfcgui.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Removed Paths: ------------- trunk/lib/IE7_0_9/ Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-11 21:23:50 UTC (rev 563) +++ trunk/src/pfcglobalconfig.class.php 2006-06-12 15:38:25 UTC (rev 564) @@ -79,8 +79,6 @@ var $client_script_url = ""; // default is calculated from 'client_script_path' var $server_script_path = ""; var $server_script_url = ""; // default is calculated from 'server_script_path' - var $useie7 = true; // use IE7 lib : fix crappy IE display bugs - var $ie7path = ""; // default is dirname(__FILE__)."/../lib/IE7_0_9"; var $xajaxpath = ""; // default is dirname(__FILE__)."/../lib/xajax_0.2.3"; var $jspath = ""; // default is dirname(__FILE__)."/../lib/javascript"; var $usecsstidy = false; @@ -182,7 +180,6 @@ if ($this->debug) pxlog("pfcGlobalConfig::init()", "chatconfig", $this->getId()); if ($this->title == "") $this->title = _pfc("My Chat"); - if ($this->ie7path == "") $this->ie7path = dirname(__FILE__)."/../lib/IE7_0_9"; if ($this->xajaxpath == "") $this->xajaxpath = dirname(__FILE__)."/../lib/xajax_0.2.3"; if ($this->jspath == "") $this->jspath = dirname(__FILE__)."/../lib/javascript"; if ($this->csstidypath == "") $this->csstidypath = dirname(__FILE__)."/../lib/csstidy-1.1"; @@ -224,15 +221,6 @@ $this->errors = array_merge($this->errors, @install_file($this->xajaxpath."/xajax_js/xajax_uncompressed.js", $this->data_public_path."/xajax_js/xajax_uncompressed.js" )); // --- - // test ie7 lib - $dir = $this->ie7path; - if (!is_dir($dir)) - $this->errors[] = _pfc("%s doesn't exist, %s library can't be found", $dir, "IE7"); - if (!file_exists($dir."/ie7-core.js")) - $this->errors[] = _pfc("%s not found, %s library can't be found", "ie7-core.js", "IE7"); - $this->errors = array_merge($this->errors, @install_dir($this->ie7path, $this->data_public_path."/ie7/")); - - // --- // test client script // try to find the path into server configuration if ($this->client_script_path == "") Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-06-11 21:23:50 UTC (rev 563) +++ trunk/src/phpfreechat.class.php 2006-06-12 15:38:25 UTC (rev 564) @@ -111,17 +111,6 @@ // print xajax javascript $output .= $this->xajax->getJavascript($c->data_public_url, NULL, $c->data_public_url."/xajax_js/xajax.js"); - // include microsoft IE6 patches - if ($c->useie7) - { - $ie7_path = $c->data_public_url."/ie7"; - $output .= "<!-- compliance patch for microsoft browsers -->\n"; - $output .= "<!--[if lt IE 7]>\n"; - $output .= " <script type=\"text/javascript\">IE7_PNG_SUFFIX = \".png\";</script>\n"; - $output .= " <script type=\"text/javascript\" src=\"".$ie7_path."/ie7-standard-p.js\"></script>\n"; - $output .= " <script type=\"text/javascript\" src=\"".$ie7_path."/ie7-recalc.js\"></script>\n"; - $output .= "<![endif]-->\n"; - } pfcI18N::SwitchOutputEncoding(); // display output Modified: trunk/themes/default/templates/chat.js.tpl.php =================================================================== --- trunk/themes/default/templates/chat.js.tpl.php 2006-06-11 21:23:50 UTC (rev 563) +++ trunk/themes/default/templates/chat.js.tpl.php 2006-06-12 15:38:25 UTC (rev 564) @@ -2,28 +2,12 @@ <?php include($c->getFilePathFromTheme('templates/chat-pre.js.tpl.php')); ?> -/* preload smileys */ -preloadImages( - <?php foreach ($smileys as $s_file => $s_str) { ?> - '<?php echo $s_file; ?>', - <?php } ?> - '' -); - /* create our client which will do all the work on the client side ! */ var pfc = new pfcClient(); <?php if ($connect_at_startup) { ?> pfc.connect_disconnect(); <?php } ?> -/* -pfc.refresh_loginlogout(); -pfc.refresh_nickmarker(); -pfc.refresh_clock(); -pfc.refresh_minimize_maximize(); -pfc.refresh_Smileys(); -pfc.refresh_WhosOnline(); -*/ <?php if ($debugxajax) { ?> xajax.DebugMessage = function(text) Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-11 21:23:50 UTC (rev 563) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-12 15:38:25 UTC (rev 564) @@ -66,7 +66,7 @@ tabcontent.style.display = 'none'; } } - + // show the new selected tab tab_to_show.style.display = 'block'; // restore the scroll pos @@ -91,8 +91,8 @@ cc = document.createElement('div'); cc.setAttribute('id', '<?php echo $prefix; ?>chat_'+tabid); Element.addClassName(cc, '<?php echo $prefix; ?>chat'); - // I set the border style here because seting it in the CSS is not taken in account - //cc.style.borderRight = "1px solid #555"; + cc.style.display = "block"; // needed by IE6 to show the online div at startup (first loaded page) + this.chatcontent[tabid] = cc; return cc; }, @@ -107,7 +107,8 @@ Element.addClassName(oc, '<?php echo $prefix; ?>online'); // I set the border style here because seting it in the CSS is not taken in account oc.style.borderLeft = "1px solid #555"; - + oc.style.display = "block"; // needed by IE6 to show the online div at startup (first loaded page) + // Create a dummy div to add padding var div = document.createElement('div'); div.style.padding = "5px"; @@ -206,9 +207,9 @@ li_div.appendChild(a2); var div_content = document.createElement('div'); - div_content.style.display = 'none'; div_content.setAttribute('id', '<?php echo $prefix; ?>channel_content'+tabid); Element.addClassName(div_content, '<?php echo $prefix; ?>content'); + div_content.style.display = 'none'; var div_chat = this.getChatContentFromTabId(tabid); var div_online = this.getOnlineContentFromTabId(tabid); Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-06-11 21:23:50 UTC (rev 563) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-12 15:38:25 UTC (rev 564) @@ -246,6 +246,7 @@ } div#<?php echo $prefix; ?>smileys { + display: none; /* will be shown by javascript routines */ background-color: #FFF; border: 1px solid #555; padding: 4px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-11 21:23:58
|
Revision: 563 Author: kerphi Date: 2006-06-11 14:23:50 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=563&view=rev Log Message: ----------- script used to generate a md5 checker in php Added Paths: ----------- trunk/misc/checkmd5 Added: trunk/misc/checkmd5 =================================================================== --- trunk/misc/checkmd5 (rev 0) +++ trunk/misc/checkmd5 2006-06-11 21:23:50 UTC (rev 563) @@ -0,0 +1,12 @@ +cd .. +echo "<?php" +for f in `find . -name "*.php"` +do + sum=`md5sum $f | sed "s/\s.*$//g"` + echo 'if (md5(file_get_contents("'$f'")) == "'$sum'")' + echo ' echo "ok - '$f'\n";' + echo 'else' + echo ' echo "corrupted - '$f' (please replace this file by a correct one)\n";' +done +echo "?>" +cd - Property changes on: trunk/misc/checkmd5 ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-11 21:22:29
|
Revision: 562 Author: kerphi Date: 2006-06-11 14:22:17 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=562&view=rev Log Message: ----------- - add the "noflood" proxy : don't allow flooders - fix the proxy chaine generation Modified Paths: -------------- trunk/src/pfccommand.class.php trunk/src/pfcglobalconfig.class.php Added Paths: ----------- trunk/src/proxys/noflood.class.php Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-06-09 11:21:03 UTC (rev 561) +++ trunk/src/pfccommand.class.php 2006-06-11 21:22:17 UTC (rev 562) @@ -69,30 +69,40 @@ $cmd = NULL; $cmd_name = strtolower($name); $cmd_classname = "pfcCommand_".$name; - $cmd_filename = dirname(__FILE__)."/commands/".$cmd_name.".class.php"; - if (file_exists($cmd_filename)) require_once($cmd_filename); + if (!class_exists($cmd_classname)) + { + $cmd_filename = dirname(__FILE__)."/commands/".$cmd_name.".class.php"; + if (file_exists($cmd_filename)) require_once($cmd_filename); + } if (class_exists($cmd_classname)) { $cmd =& new $cmd_classname(); $cmd->name = $cmd_name; - // instanciate the proxy chains - // @todo instanciate the whole chain (from the 'proxys' parameter array) - $proxy = NULL; - $proxy_name = strtolower($c->proxys[0]); - $proxy_classname = "pfcProxyCommand_" . $proxy_name; - $proxy_filename = dirname(__FILE__)."/proxys/".$proxy_name.".class.php"; - if (file_exists($proxy_filename)) require_once($proxy_filename); - if (class_exists($proxy_classname)) + // instanciate the proxys chaine + $firstproxy =& $cmd; + for($i = count($c->proxys)-1; $i >= 0; $i--) { - $proxy =& new $proxy_classname(); - $proxy->name = $cmd_name; - $proxy->proxyname = $proxy_name; - $proxy->linkTo($cmd); + $proxy_name = strtolower($c->proxys[$i]); + $proxy_classname = "pfcProxyCommand_" . $proxy_name; + if (!class_exists($proxy_classname)) + { + // try to include the proxy class file + $proxy_filename = dirname(__FILE__)."/proxys/".$proxy_name.".class.php"; + if (file_exists($proxy_filename)) require_once($proxy_filename); + } + if (class_exists($proxy_classname)) + { + // instanciate the proxy + $proxy =& new $proxy_classname(); + $proxy->name = $cmd_name; + $proxy->proxyname = $proxy_name; + $proxy->linkTo($firstproxy); + $firstproxy =& $proxy; + } } - // return the proxy, not the command (the proxy will forward the request to the real command) - return $proxy; + return $firstproxy; } return $cmd; } Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-09 11:21:03 UTC (rev 561) +++ trunk/src/pfcglobalconfig.class.php 2006-06-11 21:22:17 UTC (rev 562) @@ -37,7 +37,9 @@ var $isadmin = false; // these parameters are static (cached) - var $proxys = array("auth"); + var $proxys = array("auth", "noflood"); + var $proxys_cfg = array("auth" => array(), + "noflood" => array("limit"=>10,"delay"=>5)); var $title = ""; // default is _pfc("My Chat") var $channels = array(); // the default joined channels when opening the chat var $frozen_channels = array(); // by default allow users to create there own channels Added: trunk/src/proxys/noflood.class.php =================================================================== --- trunk/src/proxys/noflood.class.php (rev 0) +++ trunk/src/proxys/noflood.class.php 2006-06-11 21:22:17 UTC (rev 562) @@ -0,0 +1,71 @@ +<?php +/** + * noflood.class.php + * + * Copyright © 2006 Stephane Gully <ste...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ +require_once dirname(__FILE__)."/../pfci18n.class.php"; +require_once dirname(__FILE__)."/../pfcuserconfig.class.php"; +require_once dirname(__FILE__)."/../pfcproxycommand.class.php"; + +/** + * pfcProxyCommand_noflood + * this proxy will protect the chat from flooders + * @author Stephane Gully <ste...@gm...> + */ +class pfcProxyCommand_noflood extends pfcProxyCommand +{ + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + $cmdtocheck = array("send", "nick", "me", "notice"); + if ( in_array($this->name, $cmdtocheck) ) + { + $container =& $c->getContainerInstance(); + $nickid = $container->getNickId($sender); + $isadmin = $container->getMeta("isadmin", "nickname", $nickid); + $lastfloodtime = $container->getMeta("floodtime", "nickname", $nickid); + $nbflood = $container->getMeta("nbflood", "nickname", $nickid); + $floodtime = time(); + + if ($floodtime - $lastfloodtime <= $c->proxys_cfg[$this->proxyname]["delay"]) + $nbflood++; + else + $nbflood = 0; + + if ($nbflood>$c->proxys_cfg[$this->proxyname]["limit"]) + { + // kick the flooder + $msg = _pfc("you are a flooder"); + $xml_reponse->addScript("alert('".addslashes($msg)."');"); + return; + } + + if ($nbflood == 0) + $container->setMeta($floodtime, "floodtime", "nickname", $nickid); + $container->setMeta($nbflood, "nbflood", "nickname", $nickid); + } + + // forward the command to the next proxy or to the final command + $this->next->run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid); + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-09 11:21:11
|
Revision: 561 Author: kerphi Date: 2006-06-09 04:21:03 -0700 (Fri, 09 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=561&view=rev Log Message: ----------- disable the commands history because the key code are in conflict with other keys Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-09 09:16:36 UTC (rev 560) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-09 11:21:03 UTC (rev 561) @@ -486,7 +486,7 @@ w.value = ''; return false; } - else if (code == 33) /* page up key */ + else if (code == 33 && false) // page up key { // write the last command in the history if (this.cmdhistory.length>0) @@ -500,7 +500,7 @@ w.value = this.cmdhistory[this.cmdhistoryid]; } } - else if (code == 34) /* page down key */ + else if (code == 34 && false) // page down key { // write the next command in the history if (this.cmdhistory.length>0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-09 09:16:41
|
Revision: 560 Author: kerphi Date: 2006-06-09 02:16:36 -0700 (Fri, 09 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=560&view=rev Log Message: ----------- notify the unactive tab only on new received messages Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-09 08:43:34 UTC (rev 559) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-09 09:16:36 UTC (rev 560) @@ -699,6 +699,14 @@ line += '<span class="<?php echo $prefix; ?>words">'+ this.parseMessage(param) +'</span> '; line += '</div>'; + // notify the hidden tab a message has been received + if (cmd == 'send' || cmd == 'me') + { + var tabid = recipientid; + if (this.gui.getTabId() != tabid) + this.gui.notifyTab(tabid); + } + if (msg_html[recipientid] == null) msg_html[recipientid] = line; else @@ -711,9 +719,6 @@ { var recipientid = keys[i]; var tabid = recipientid; - - if (this.gui.getTabId() != tabid) - this.gui.notifyTab(tabid); // create the tab if it doesn't exists yet var recipientdiv = this.gui.getChatContentFromTabId(tabid); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-09 08:43:40
|
Revision: 559 Author: kerphi Date: 2006-06-09 01:43:34 -0700 (Fri, 09 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=559&view=rev Log Message: ----------- Bug fix: the special html characteres in smileys were broken Modified Paths: -------------- trunk/themes/default/templates/chat.html.tpl.php Modified: trunk/themes/default/templates/chat.html.tpl.php =================================================================== --- trunk/themes/default/templates/chat.html.tpl.php 2006-06-08 19:58:15 UTC (rev 558) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-06-09 08:43:34 UTC (rev 559) @@ -62,7 +62,7 @@ <div id="<?php echo $prefix; ?>smileys"> <?php foreach($smileys as $s_file => $s_str) { ?> - <img src="<?php echo $s_file; ?>" alt="<?php echo $s_str[0]; ?>" title="<?php echo $s_str[0]; ?>" onclick="pfc.insertSmiley(String('<?php echo $s_str[0]; ?>').unescapeHTML());" /> + <img src="<?php echo $s_file; ?>" alt="<?php echo $s_str[0]; ?>" title="<?php echo $s_str[0]; ?>" onclick="pfc.insertSmiley('<?php echo $s_str[0]; ?>');" /> <?php } ?> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-08 19:58:31
|
Revision: 558 Author: kerphi Date: 2006-06-08 12:58:15 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=558&view=rev Log Message: ----------- Bug fix: replace the UP/DOWN key by PAGEUP/PAGEDOWN for the commands history Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-08 19:45:18 UTC (rev 557) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-08 19:58:15 UTC (rev 558) @@ -439,7 +439,7 @@ */ callbackWords_OnKeypress: function(evt) { - var code = (evt.which) ? evt.which : evt.keyCode + var code = (evt.which) ? evt.which : evt.keyCode; if (code == Event.KEY_TAB) /* tab key */ { /* FF & Konqueror workaround : ignore TAB key here */ @@ -486,7 +486,7 @@ w.value = ''; return false; } - else if (code == Event.KEY_UP) /* up key */ + else if (code == 33) /* page up key */ { // write the last command in the history if (this.cmdhistory.length>0) @@ -500,7 +500,7 @@ w.value = this.cmdhistory[this.cmdhistoryid]; } } - else if (code == Event.KEY_DOWN) /* down key */ + else if (code == 34) /* page down key */ { // write the next command in the history if (this.cmdhistory.length>0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-08 19:45:25
|
Revision: 557 Author: kerphi Date: 2006-06-08 12:45:18 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=557&view=rev Log Message: ----------- Bug fix: the /rehash command was broken Bug fix: the themes were not installed in the public directory, now they are copied Modified Paths: -------------- trunk/src/commands/rehash.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/commands/rehash.class.php =================================================================== --- trunk/src/commands/rehash.class.php 2006-06-08 19:35:08 UTC (rev 556) +++ trunk/src/commands/rehash.class.php 2006-06-08 19:45:18 UTC (rev 557) @@ -14,10 +14,10 @@ function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { $c =& $this->c; - $c->destroy(); - $synchro = $c->synchronizeWithCache(); + $destroyed = $c->destroy(); + $synchro = $c->synchronizeWithCache(); - if ($synchro) + if ($destroyed && $synchro) $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ko', '');"); else $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '');"); Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-08 19:35:08 UTC (rev 556) +++ trunk/src/pfcglobalconfig.class.php 2006-06-08 19:45:18 UTC (rev 557) @@ -244,17 +244,6 @@ if ($this->client_script_url == "") $this->client_script_url = "./".basename($filetotest); - // set the default theme path - if ($this->themepath_default == "") - $this->themepath_default = dirname(__FILE__)."/../themes"; - if ($this->themepath == "") - $this->themepath = $this->themepath_default; - - // calculate the default theme url - if ($this->themeurl_default == "") - $this->themeurl_default = relativePath($this->client_script_path, $this->themepath_default); - if ($this->themeurl == "") - $this->themeurl = relativePath($this->client_script_path, $this->themepath); // calculate datapublic url if ($this->data_public_url == "") @@ -275,6 +264,24 @@ $this->errors[] = _pfc("%s doesn't exist", $filetotest); if ($this->server_script_url == "") $this->server_script_url = relativePath($this->client_script_path, $this->server_script_path)."/".basename($filetotest); + + // check if the themepath parameter are correctly setup + if ($this->themepath_default == "" || !is_dir($this->themepath_default)) + $this->themepath_default = dirname(__FILE__)."/../themes"; + if ($this->themepath == "" || !is_dir($this->themepath)) + $this->themepath = $this->themepath_default; + // copy the themes into the public directory + $this->errors = array_merge($this->errors, @install_dir($this->themepath_default, $this->data_public_path."/themes")); + $this->errors = array_merge($this->errors, @install_dir($this->themepath, $this->data_public_path."/themes")); + // now it's copied, so update the themepath parameters to the new location + $this->themepath_default = $this->data_public_path."/themes"; + $this->themepath = $this->data_public_path."/themes"; + // calculate the corresponding theme url + if ($this->themeurl_default == "") + $this->themeurl_default = relativePath($this->client_script_path, $this->data_public_path."/themes"); + if ($this->themeurl == "") + $this->themeurl = relativePath($this->client_script_path, $this->data_public_path."/themes"); + // --- // run specific container initialisation @@ -356,7 +363,7 @@ { if (preg_match("/^#.*/",$line)) continue; - else if (preg_match("/^([a-z_0-9]*(\.gif|\.png))(.*)$/i",$line,$res)) + else if (preg_match("/^([a-z_\-0-9]*(\.gif|\.png))(.*)$/i",$line,$res)) { $smiley_file = $this->getFileUrlFromTheme('smileys/'.$res[1]); $smiley_str = trim($res[3])."\n"; @@ -378,7 +385,10 @@ function destroy() { $cachefile = $this->data_private_path."/cache/pfcglobalconfig_".$this->getId(); - @unlink($cachefile); + if (!file_exists($cachefile)) + return false; + $this->is_init = false; + return @unlink($cachefile); } /** @@ -388,7 +398,7 @@ function synchronizeWithCache() { $cachefile = $this->data_private_path."/cache/pfcglobalconfig_".$this->getId(); - + if (file_exists($cachefile)) { $pfc_configvar = unserialize(file_get_contents($cachefile)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-08 19:35:16
|
Revision: 556 Author: kerphi Date: 2006-06-08 12:35:08 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=556&view=rev Log Message: ----------- Change the smileys box position : move it below the input area Modified Paths: -------------- trunk/themes/default/templates/chat.html.tpl.php trunk/themes/default/templates/pfcclient.js.tpl.php trunk/themes/default/templates/pfcgui.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Modified: trunk/themes/default/templates/chat.html.tpl.php =================================================================== --- trunk/themes/default/templates/chat.html.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -58,7 +58,13 @@ echo '<img src="'.$c->getFileUrlFromTheme('images/color_'.$bbc.'.gif').'" alt="color '.$bbc.'" onclick="pfc.switch_text_color(\''.$bbc.'\')" id="'.$prefix.'color_'.$bbc.'" class="'.$prefix.'color" /> '; } ?> - </div> + </div> + + <div id="<?php echo $prefix; ?>smileys"> + <?php foreach($smileys as $s_file => $s_str) { ?> + <img src="<?php echo $s_file; ?>" alt="<?php echo $s_str[0]; ?>" title="<?php echo $s_str[0]; ?>" onclick="pfc.insertSmiley(String('<?php echo $s_str[0]; ?>').unescapeHTML());" /> +<?php } ?> + </div> </div> </div> Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -225,7 +225,6 @@ // do not switch to the new created tab // keep it in the background // this.gui.setTabById(tabid); - this.refresh_Smileys(); this.refresh_WhosOnline(); } else @@ -1367,16 +1366,11 @@ refresh_Smileys: function() { // first of all : show/hide the smiley box - var root = $('<?php echo $prefix; ?>channels_content'); - var contentlist = this.getElementsByClassName(root, '<?php echo $prefix; ?>smileys', ''); - for(var i = 0; i < contentlist.length; i++) - { - var content = contentlist[i]; - if (this.showsmileys) - content.style.display = 'block'; - else - content.style.display = 'none'; - } + var content = $('<?php echo $prefix; ?>smileys'); + if (this.showsmileys) + content.style.display = 'block'; + else + content.style.display = 'none'; // then switch the button icon var btn = $('<?php echo $prefix; ?>showHideSmileysbtn'); @@ -1398,8 +1392,6 @@ btn.title = btn.alt; } } - this.refresh_Chat(); - this.refresh_OnlineAndSmileys(); }, @@ -1449,56 +1441,8 @@ btn.title = btn.alt; } this.refresh_Chat(); - this.refresh_OnlineAndSmileys(); }, - - /** - * Resize online and smileys - */ - refresh_OnlineAndSmileys: function() - { - var style = $H(); - var root = $('<?php echo $prefix; ?>channels_content'); - // resize the smiley area - var contentlist = this.getElementsByClassName(root, '<?php echo $prefix; ?>smileys', ''); - for(var i = 0; i < contentlist.length; i++) - { - var smileydiv = contentlist[i]; - if (this.showwhosonline) - { - style['height'] = ''; - Element.setStyle(smileydiv, style); - } - else - { - style['height'] = '100%'; - Element.setStyle(smileydiv, style); - } - } - - // resize the nickname list area - var contentlist = this.getElementsByClassName(root, '<?php echo $prefix; ?>online', ''); - for(var i = 0; i < contentlist.length; i++) - { - var onlinediv = contentlist[i]; - if (this.showsmileys) - { - style['height'] = ''; - Element.setStyle(onlinediv, style); - } - else - { - style['height'] = '100%'; - Element.setStyle(onlinediv, style); - } - } - - // for IE7 CSS refresh - // if fixes the smiley and online boxes resize problem on IE6 - if (document.recalc) setTimeout('document.recalc(true);', 0); - }, - /** * Resize chat */ @@ -1511,7 +1455,7 @@ { var chatdiv = contentlist[i]; var style = $H(); - if (!this.showwhosonline && !this.showsmileys) + if (!this.showwhosonline) { style['width'] = '100%'; Element.setStyle(chatdiv, style); Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -17,7 +17,6 @@ this.tabtypes = Array(); this.chatcontent = $H(); this.onlinecontent = $H(); - this.smileycontent = $H(); this.scrollpos = $H(); }, @@ -93,7 +92,7 @@ cc.setAttribute('id', '<?php echo $prefix; ?>chat_'+tabid); Element.addClassName(cc, '<?php echo $prefix; ?>chat'); // I set the border style here because seting it in the CSS is not taken in account - cc.style.borderRight = "1px solid #555"; + //cc.style.borderRight = "1px solid #555"; this.chatcontent[tabid] = cc; return cc; }, @@ -107,7 +106,7 @@ oc.setAttribute('id', '<?php echo $prefix; ?>online_'+tabid); Element.addClassName(oc, '<?php echo $prefix; ?>online'); // I set the border style here because seting it in the CSS is not taken in account - oc.style.borderBottom = "1px solid #555"; + oc.style.borderLeft = "1px solid #555"; // Create a dummy div to add padding var div = document.createElement('div'); @@ -117,33 +116,6 @@ this.onlinecontent[tabid] = oc; return oc; }, - getSmileysContentFromTabId: function(tabid) - { - // return the smileys content if it exists - var sc = this.smileycontent[tabid]; - if (sc) return sc; - - sc = document.createElement('div'); - sc.setAttribute('id', '<?php echo $prefix; ?>smileys_'+tabid); - Element.addClassName(sc, '<?php echo $prefix; ?>smileys'); - // I set the border style here because setting it in the CSS is not take into account - sc.style.borderTop = "1px solid #555"; - var div = document.createElement('div'); - div.style.padding = "5px"; - var s = null; - <?php foreach($smileys as $s_file => $s_str) { ?> - s = document.createElement('img'); - s.setAttribute('src','<?php echo $s_file; ?>'); - s.setAttribute('alt','<?php echo $s_str[0]; ?>'); - s.setAttribute('title','<?php echo $s_str[0]; ?>'); - s.setAttribute('onclick','pfc.insertSmiley(String(\'<?php echo $s_str[0]; ?>\').unescapeHTML());'); - div.appendChild(s); - <?php } ?> - sc.appendChild(div); - - this.smileycontent[tabid] = sc; - return sc; - }, removeTabById: function(tabid) { @@ -240,10 +212,8 @@ var div_chat = this.getChatContentFromTabId(tabid); var div_online = this.getOnlineContentFromTabId(tabid); - var div_smileys = this.getSmileysContentFromTabId(tabid); div_content.appendChild(div_chat); div_content.appendChild(div_online); - div_content.appendChild(div_smileys); $('<?php echo $prefix; ?>channels_list').appendChild(li_title); $('<?php echo $prefix; ?>channels_content').appendChild(div_content); Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -95,18 +95,6 @@ overflow: auto; } -div.<?php echo $prefix; ?>smileys { - position: absolute; - bottom: 0; - right: 0; - padding: 0; - width: 20%; - height: 60%; - overflow: auto; - text-align: center; - background-color: #FFF; - /* borders are drawn by the javascript routines */ -} div.<?php echo $prefix; ?>online { position: absolute; right: 0; @@ -114,7 +102,7 @@ padding: 0; overflow: auto; width: 20%; - height: 40%; + height: 100%; color: #000; /* colors can be overriden by js nickname colorization */ background-color: #FFF; /* borders are drawn by the javascript routines */ @@ -257,3 +245,13 @@ cursor: crosshair; } +div#<?php echo $prefix; ?>smileys { + background-color: #FFF; + border: 1px solid #555; + padding: 4px; + margin-top: 4px; +} + +div#<?php echo $prefix; ?>smileys img { + cursor: pointer; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-08 19:33:14
|
Revision: 555 Author: kerphi Date: 2006-06-08 12:33:09 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=555&view=rev Log Message: ----------- remove unused code Modified Paths: -------------- trunk/src/phpfreechat.class.php Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-06-08 19:32:39 UTC (rev 554) +++ trunk/src/phpfreechat.class.php 2006-06-08 19:33:09 UTC (rev 555) @@ -201,9 +201,6 @@ // output css pfcI18N::SwitchOutputEncoding(); $output = "<style type=\"text/css\">\n".$output."\n</style>\n"; - - // tabpane - $output .= '<link id="luna-tab-style-sheet" type="text/css" rel="stylesheet" href="'.$c->data_public_url.'/tabpane/css/luna/tab.css" />'; if($return) return $output; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-08 19:32:45
|
Revision: 554 Author: kerphi Date: 2006-06-08 12:32:39 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=554&view=rev Log Message: ----------- Do not show "xxx is connected" notice for 1.x branche Modified Paths: -------------- trunk/src/commands/nick.class.php Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-06-06 17:34:11 UTC (rev 553) +++ trunk/src/commands/nick.class.php 2006-06-08 19:32:39 UTC (rev 554) @@ -88,13 +88,15 @@ $u->saveInCache(); $xml_reponse->addScript("alert('join: u->nick=".$u->nick); - + + /* $cmd =& pfcCommand::Factory("notice"); foreach($u->channels as $id => $chan) $cmd->run($xml_reponse, $clientid, _pfc("%s is connected", $u->nick), $sender, $chan["recipient"], $id, 2); foreach($u->privmsg as $id => $pv) $cmd->run($xml_reponse, $clientid, _pfc("%s is connected", $u->nick), $sender, $pv["recipient"], $id, 2); - + */ + $xml_reponse->addScript("pfc.handleResponse('nick', 'connected', '".$newnick."');"); if ($c->debug) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:14:47
|
Revision: 550 Author: kerphi Date: 2006-06-06 09:17:15 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=550&view=rev Log Message: ----------- Bug fix: the cache directory path was hardcoded Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-05 14:33:24 UTC (rev 549) +++ trunk/src/pfcglobalconfig.class.php 2006-06-06 16:17:15 UTC (rev 550) @@ -209,7 +209,7 @@ $this->errors = array_merge($this->errors, @test_writable_dir($this->data_public_path, "data_public_path")); $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path, "data_private_path")); $this->errors = array_merge($this->errors, @install_dir($this->jspath, $this->data_public_path."/javascript")); - $this->errors = array_merge($this->errors, @test_writable_dir(dirname(__FILE__)."/../data/private/cache", "data_public_path/cache")); + $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path."/cache", "data_private_path/cache")); // --- // test xajax lib existance @@ -387,7 +387,7 @@ */ function synchronizeWithCache($destroy = false) { - $cachefile = dirname(__FILE__)."/../data/private/cache/pfcglobalconfig_".$this->getId(); + $cachefile = $this->data_private_path."/cache/pfcglobalconfig_".$this->getId(); // destroy the cache if init parameter is present into the url if (isset($_GET["init"]) || $destroy) @unlink($cachefile); @@ -416,7 +416,7 @@ } function saveInCache() { - $cachefile = dirname(__FILE__)."/../data/private/cache/pfcglobalconfig_".$this->getId(); + $cachefile = $this->data_private_path."/cache/pfcglobalconfig_".$this->getId(); file_put_contents($cachefile, serialize(get_object_vars($this))); if ($this->debug) pxlog("pfcGlobalConfig::saveInCache()", "chatconfig", $this->getId()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:35
|
Revision: 545 Author: kerphi Date: 2006-06-05 07:08:56 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=545&view=rev Log Message: ----------- Bug fix: add slashes to thetranslated strings in the javascript code Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-01 16:50:57 UTC (rev 544) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-05 14:08:56 UTC (rev 545) @@ -93,21 +93,21 @@ // the i18n translations this.i18n = new pfcI18N(); - this.i18n.setLabel('hide_nickname_color', '<?php echo _pfc("Hide nickname marker"); ?>'); - this.i18n.setLabel('show_nickname_color', '<?php echo _pfc("Show nickname marker"); ?>'); - this.i18n.setLabel('hide_clock', '<?php echo _pfc("Hide dates and hours"); ?>'); - this.i18n.setLabel('show_clock', '<?php echo _pfc("Show dates and hours"); ?>'); - this.i18n.setLabel('logout', '<?php echo _pfc("Disconnect"); ?>'); - this.i18n.setLabel('login', '<?php echo _pfc("Connect"); ?>'); - this.i18n.setLabel('maximize', '<?php echo _pfc("Magnify"); ?>'); - this.i18n.setLabel('minimize', '<?php echo _pfc("Cut down"); ?>'); - this.i18n.setLabel('hidesmiley', '<?php echo _pfc("Hide smiley box"); ?>'); - this.i18n.setLabel('showsmiley', '<?php echo _pfc("Show smiley box"); ?>'); - this.i18n.setLabel('hideonline', '<?php echo _pfc("Hide online users box"); ?>'); - this.i18n.setLabel('showonline', '<?php echo _pfc("Show online users box"); ?>'); - this.i18n.setLabel('enter_nickname', '<?php echo _pfc("Please enter your nickname"); ?>'); - this.i18n.setLabel('Private message', '<?php echo _pfc("Private message"); ?>'); - this.i18n.setLabel('Close this tab', '<?php echo _pfc("Close this tab"); ?>'); + this.i18n.setLabel('hide_nickname_color', '<?php echo addslashes(_pfc("Hide nickname marker")); ?>'); + this.i18n.setLabel('show_nickname_color', '<?php echo addslashes(_pfc("Show nickname marker")); ?>'); + this.i18n.setLabel('hide_clock', '<?php echo addslashes(_pfc("Hide dates and hours")); ?>'); + this.i18n.setLabel('show_clock', '<?php echo addslashes(_pfc("Show dates and hours")); ?>'); + this.i18n.setLabel('logout', '<?php echo addslashes(_pfc("Disconnect")); ?>'); + this.i18n.setLabel('login', '<?php echo addslashes(_pfc("Connect")); ?>'); + this.i18n.setLabel('maximize', '<?php echo addslashes(_pfc("Magnify")); ?>'); + this.i18n.setLabel('minimize', '<?php echo addslashes(_pfc("Cut down")); ?>'); + this.i18n.setLabel('hidesmiley', '<?php echo addslashes(_pfc("Hide smiley box")); ?>'); + this.i18n.setLabel('showsmiley', '<?php echo addslashes(_pfc("Show smiley box")); ?>'); + this.i18n.setLabel('hideonline', '<?php echo addslashes(_pfc("Hide online users box")); ?>'); + this.i18n.setLabel('showonline', '<?php echo addslashes(_pfc("Show online users box")); ?>'); + this.i18n.setLabel('enter_nickname', '<?php echo addslashes(_pfc("Please enter your nickname")); ?>'); + this.i18n.setLabel('Private message', '<?php echo addslashes(_pfc("Private message")); ?>'); + this.i18n.setLabel('Close this tab', '<?php echo addslashes(_pfc("Close this tab")); ?>'); // the graphical user interface this.gui = new pfcGui(this.i18n); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:34
|
Revision: 552 Author: kerphi Date: 2006-06-06 10:21:08 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=552&view=rev Log Message: ----------- Bug fix: the "channels" parameter didn't work as expected Modified Paths: -------------- trunk/src/commands/init.class.php trunk/src/commands/rehash.class.php trunk/src/pfcglobalconfig.class.php trunk/src/pfcuserconfig.class.php trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/src/commands/init.class.php =================================================================== --- trunk/src/commands/init.class.php 2006-06-06 17:19:21 UTC (rev 551) +++ trunk/src/commands/init.class.php 2006-06-06 17:21:08 UTC (rev 552) @@ -7,14 +7,12 @@ function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { $c =& $this->c; - + $u =& $this->u; + $cmd =& pfcCommand::Factory("quit"); $cmd->run($xml_reponse, $clientid, $param, $sender, $recipient, $recipientid); - if (isset($_COOKIE[session_name()])) - { - setcookie(session_name(), '', time()-42000, '/'); - } // clobber the cookie + $u->destroy(); } } Modified: trunk/src/commands/rehash.class.php =================================================================== --- trunk/src/commands/rehash.class.php 2006-06-06 17:19:21 UTC (rev 551) +++ trunk/src/commands/rehash.class.php 2006-06-06 17:21:08 UTC (rev 552) @@ -14,7 +14,8 @@ function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { $c =& $this->c; - $synchro = $c->synchronizeWithCache(true); // true => destroy the cache + $c->destroy(); + $synchro = $c->synchronizeWithCache(); if ($synchro) $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ko', '');"); Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-06 17:19:21 UTC (rev 551) +++ trunk/src/pfcglobalconfig.class.php 2006-06-06 17:21:08 UTC (rev 552) @@ -35,14 +35,12 @@ // these parameters are dynamic (not cached) var $nick = ""; // the initial nickname ("" means the user will be queried) var $isadmin = false; - var $channels = array(); // the default joined channels when opening the chat - var $privmsg = array(); // the default privmsg chat to lauch when opening the chat - var $active = false; // by default the user is not connected // these parameters are static (cached) var $proxys = array("auth"); var $title = ""; // default is _pfc("My Chat") - var $channel = ""; // default is _pfc("My room") + var $channels = array(); // the default joined channels when opening the chat + var $privmsg = array(); // the default privmsg chat to lauch when opening the chat var $frozen_nick = false; var $max_nick_len = 15; var $max_text_len = 400; @@ -182,12 +180,12 @@ if ($this->debug) pxlog("pfcGlobalConfig::init()", "chatconfig", $this->getId()); if ($this->title == "") $this->title = _pfc("My Chat"); - if ($this->channel == "") $this->channel = _pfc("My room"); if ($this->ie7path == "") $this->ie7path = dirname(__FILE__)."/../lib/IE7_0_9"; if ($this->xajaxpath == "") $this->xajaxpath = dirname(__FILE__)."/../lib/xajax_0.2.3"; if ($this->jspath == "") $this->jspath = dirname(__FILE__)."/../lib/javascript"; if ($this->csstidypath == "") $this->csstidypath = dirname(__FILE__)."/../lib/csstidy-1.1"; - + if (count($this->channels) == 0) $this->channels = array(_pfc("My room")); + // first of all, check the used functions $f_list["file_get_contents"] = _pfc("You need %s", "PHP 4 >= 4.3.0 or PHP 5"); $err_session_x = "You need PHP 4 or PHP 5"; @@ -374,23 +372,22 @@ function getId() { - /* channel is concatenated because it dynamic parameters - * further these parameter must be separated from global pfcconfig - * and can be changed dynamicaly in the user session */ return $this->serverid; } - + function destroy() + { + $cachefile = $this->data_private_path."/cache/pfcglobalconfig_".$this->getId(); + @unlink($cachefile); + } + /** * save the pfcConfig object into cache if it doesn't exists yet * else restore the old pfcConfig object */ - function synchronizeWithCache($destroy = false) + function synchronizeWithCache() { $cachefile = $this->data_private_path."/cache/pfcglobalconfig_".$this->getId(); - - // destroy the cache if init parameter is present into the url - if (isset($_GET["init"]) || $destroy) @unlink($cachefile); if (file_exists($cachefile)) { Modified: trunk/src/pfcuserconfig.class.php =================================================================== --- trunk/src/pfcuserconfig.class.php 2006-06-06 17:19:21 UTC (rev 551) +++ trunk/src/pfcuserconfig.class.php 2006-06-06 17:21:08 UTC (rev 552) @@ -17,9 +17,10 @@ function pfcUserConfig() { + $c =& pfcGlobalConfig::Instance(); + // start the session : session is used for locking purpose and cache purpose session_name( "phpfreechat" ); - if (isset($_GET["init"])) unset($_COOKIE[session_name()]); if(session_id() == "") session_start(); // echo "pfcUserConfig()<br>"; @@ -28,7 +29,7 @@ // user parameters are cached in sessions $this->_getParam("nick"); - if (!isset($this->nick)) $this->_setParam("nick",""); + if (!isset($this->nick)) $this->_setParam("nick",$c->nick); $this->_getParam("active"); if (!isset($this->active)) $this->_setParam("active",false); $this->_getParam("channels"); @@ -46,8 +47,6 @@ $sessionid_param = $sessionid."_".$p; if (isset($_SESSION[$sessionid_param])) $this->$p = $_SESSION[$sessionid_param]; - else - $this->$p = $c->$p; // take the default parameter from the global config } return $this->$p; } @@ -60,6 +59,15 @@ $_SESSION[$sessionid_param] = $v; $this->$p = $v; } + + function _rmParam($p) + { + $c =& pfcGlobalConfig::Instance(); + $sessionid = "pfcuserconfig_".$c->getId(); + $sessionid_param = $sessionid."_".$p; + unset($_SESSION[$sessionid_param]); + unset($this->$p); + } function &Instance() { @@ -149,6 +157,14 @@ } } */ + + function destroy() + { + $this->_rmParam("nick"); + $this->_rmParam("active"); + $this->_rmParam("channels"); + $this->_rmParam("privmsg"); + } function saveInCache() { Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-06 17:19:21 UTC (rev 551) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-06 17:21:08 UTC (rev 552) @@ -162,7 +162,8 @@ // or the default one <?php if (count($u->channels) == 0) - echo "this.sendRequest('/join', '".addslashes($c->channel)."');\n"; + foreach($c->channels as $ch) + echo "this.sendRequest('/join', '".addslashes($ch)."');\n"; foreach($u->channels as $ch) echo "this.sendRequest('/join', '".addslashes($ch["name"])."');\n"; foreach($u->privmsg as $pv) @@ -306,7 +307,8 @@ // or the default one <?php if (count($u->channels) == 0) - echo "this.sendRequest('/join', '".addslashes($c->channel)."');\n"; + foreach($c->channels as $ch) + echo "this.sendRequest('/join', '".addslashes($ch)."');\n"; foreach($u->channels as $ch) echo "this.sendRequest('/join', '".addslashes($ch["name"])."');\n"; foreach($u->privmsg as $pv) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:19
|
Revision: 546 Author: kerphi Date: 2006-06-05 07:10:14 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=546&view=rev Log Message: ----------- Bug fix: the files to translate list was incomplete for current 1.x branche Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-06-05 14:08:56 UTC (rev 545) +++ trunk/src/pfci18n.class.php 2006-06-05 14:10:14 UTC (rev 546) @@ -119,6 +119,9 @@ { $files = array(); $files = array_merge($files, glob(dirname(__FILE__)."/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/commands/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/containers/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/proxys/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/../themes/default/templates/*.php")); $res = array(); @@ -153,8 +156,9 @@ $new_content = ""; foreach($res as $str => $com) { - // echo "str=".$str."\n"; - if (preg_match("/".preg_quote($str)."/", $old_content) == 0) + //echo "com=".$com."\n"; + //echo "str=".$str."\n"; + if (preg_match("/".preg_quote($str,'/')."/", $old_content) == 0) $new_content .= $com."\n\$GLOBALS[\"i18n\"][\"".$str."\"] = \"\";\n\n"; } $content = "<?php" . $old_content . $new_content . "?>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:15
|
Revision: 547 Author: kerphi Date: 2006-06-05 07:10:42 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=547&view=rev Log Message: ----------- XHTML fixes Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2006-06-05 14:10:14 UTC (rev 546) +++ trunk/index.php 2006-06-05 14:10:42 UTC (rev 547) @@ -7,77 +7,76 @@ $chat = new phpFreeChat( $params ); ?> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8"> - <title>phpFreeChat Sources Index</title> - <link rel="stylesheet" title="classic" type="text/css" href="style/generic.css"> - <link rel="stylesheet" title="classic" type="text/css" href="style/header.css"> - <link rel="stylesheet" title="classic" type="text/css" href="style/footer.css"> - <link rel="stylesheet" title="classic" type="text/css" href="style/menu.css"> - <link rel="stylesheet" title="classic" type="text/css" href="style/content.css"> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat Sources Index</title> + <link rel="stylesheet" title="classic" type="text/css" href="style/generic.css" /> + <link rel="stylesheet" title="classic" type="text/css" href="style/header.css" /> + <link rel="stylesheet" title="classic" type="text/css" href="style/footer.css" /> + <link rel="stylesheet" title="classic" type="text/css" href="style/menu.css" /> + <link rel="stylesheet" title="classic" type="text/css" href="style/content.css" /> <?php $chat->printJavascript(); ?> <?php $chat->printStyle(); ?> </head> - <body> - -<div class="header"> - <h1>phpFreeChat - Sources Index</h1> - <img alt="logo bulle" src="style/bulle.png" class="logo2"> -</div> - -<div class="menu"> - <ul> - <li class="sub title">General</li> - <li> - <ul class="sub"> - <li class="item"> - <a href="demo/">Demos</a> - </li> - <li class="item"> - <a href="admin/">Administration</a> - </li> - </ul> - </li> - <li class="sub title">Documentation</li> - <li> - <ul> - <li class="item"> - <a href="README.en">readme [en]</a> - </li> - <li class="item"> - <a href="README.fr">readme [fr]</a> + <body> + +<div class="header"> + <h1>phpFreeChat - Sources Index</h1> + <img alt="logo bulle" src="style/bulle.png" class="logo2" /> +</div> + +<div class="menu"> + <ul> + <li class="sub title">General</li> + <li> + <ul class="sub"> + <li class="item"> + <a href="demo/">Demos</a> </li> - <li class="item"> - <a href="INSTALL.en">install [en]</a> - </li> - <li class="item"> - <a href="INSTALL.fr">install [fr]</a> - </li> - </ul> - </li> - </ul> - <p class="partner"> - <a href="http://www.phpfreechat.net"><img alt="logo big" src="style/logo_88x31.gif"></a> - </p> -</div> - + <li class="item"> + <a href="admin/">Administration</a> + </li> + </ul> + </li> + <li class="sub title">Documentation</li> + <li> + <ul> + <li class="item"> + <a href="README.en">readme [en]</a> + </li> + <li class="item"> + <a href="README.fr">readme [fr]</a> + </li> + <li class="item"> + <a href="INSTALL.en">install [en]</a> + </li> + <li class="item"> + <a href="INSTALL.fr">install [fr]</a> + </li> + </ul> + </li> + </ul> + <p class="partner"> + <a href="http://www.phpfreechat.net"><img alt="logo big" src="style/logo_88x31.gif" /></a> + </p> +</div> + <div class="content"> - <h2>See the quick demo</h2> - <?php $chat->printChat(); ?> -</div> - -<div class="footer"> - <div class="valid"> - <a href="http://validator.w3.org/check?uri=referer"> - <img alt="Valid XHTML 1.0!" src="style/valid-xhtml.png"> - </a> - <a href="http://jigsaw.w3.org/css-validator/check/referer"> - <img alt="Valid CSS!" src="style/valid-css.png"> - </a> - </div> - <p>\xA92006 phpFreeChat</p> - </div> + <h2>See the quick demo</h2> + <?php $chat->printChat(); ?> +</div> + +<div class="footer"> + <div class="valid"> + <a href="http://validator.w3.org/check?uri=referer"> + <img alt="Valid XHTML 1.0!" src="style/valid-xhtml.png" /> + </a> + <a href="http://jigsaw.w3.org/css-validator/check/referer"> + <img alt="Valid CSS!" src="style/valid-css.png" /> + </a> + </div> + <p>\xA92006 phpFreeChat</p> + </div> </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:14
|
Revision: 548 Author: kerphi Date: 2006-06-05 07:11:32 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=548&view=rev Log Message: ----------- translations of the new 1.x labels Modified Paths: -------------- trunk/i18n/en_US/main.php trunk/i18n/fr_FR/main.php Modified: trunk/i18n/en_US/main.php =================================================================== --- trunk/i18n/en_US/main.php 2006-06-05 14:10:42 UTC (rev 547) +++ trunk/i18n/en_US/main.php 2006-06-05 14:11:32 UTC (rev 548) @@ -174,4 +174,60 @@ // line 386 in phpfreechatconfig.class.php $GLOBALS["i18n"]["'%s' parameter is not valid. Available values are : '%s'"] = "'%s' parameter is not valid. Available values are: '%s'"; -?> +// line 185 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["My room"] = "My room"; + +// line 109 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Private message"] = "Private message"; + +// line 110 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Close this tab"] = "Close this tab"; + +// line 225 in pfcgui.js.tpl.php +$GLOBALS["i18n"]["Do you really want to leave this room ?"] = "Do you really want to leave this room ?"; + +// line 19 in unban.class.php +$GLOBALS["i18n"]["Missing parameter"] = "Missing parameter"; + +// line 38 in ban.class.php +$GLOBALS["i18n"]["banished from %s by %s"] = "banished from %s by %s"; + +// line 23 in banlist.class.php +$GLOBALS["i18n"]["The banished user's id list is:"] = "The banished user's id list is:"; + +// line 32 in banlist.class.php +$GLOBALS["i18n"]["Empty"] = "Empty"; + +// line 34 in banlist.class.php +$GLOBALS["i18n"]["'/unban {id}' will unban the user identified by {id}"] = "'/unban {id}' will unban the user identified by {id}"; + +// line 35 in banlist.class.php +$GLOBALS["i18n"]["'/unban all' will unban all the users on this channel"] = "'/unban all' will unban all the users on this channel"; + +// line 24 in update.class.php +$GLOBALS["i18n"]["%s quit (timeout)"] = "%s quit (timeout)"; + +// line 46 in join.class.php +$GLOBALS["i18n"]["%s joins %s"] = "%s joins %s"; + +// line 31 in kick.class.php +$GLOBALS["i18n"]["kicked from %s by %s"] = "kicked from %s by %s"; + +// line 38 in send.class.php +$GLOBALS["i18n"]["Can't send the message, %s is offline"] = "Can't send the message, %s is offline"; + +// line 27 in unban.class.php +$GLOBALS["i18n"]["Nobody has been unbanished"] = "Nobody has been unbanished"; + +// line 42 in unban.class.php +$GLOBALS["i18n"]["%s has been unbanished"] = "%s has been unbanished"; + +// line 49 in unban.class.php +$GLOBALS["i18n"]["%s users have been unbanished"] = "%s users have been unbanished"; + +// line 47 in auth.class.php +$GLOBALS["i18n"]["You are not allowed to run '%s' command"] = "You are not allowed to run '%s' command"; + +// line 67 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because you are banished"] = "Can't join %s because you are banished"; +?> \ No newline at end of file Modified: trunk/i18n/fr_FR/main.php =================================================================== --- trunk/i18n/fr_FR/main.php 2006-06-05 14:10:42 UTC (rev 547) +++ trunk/i18n/fr_FR/main.php 2006-06-05 14:11:32 UTC (rev 548) @@ -174,4 +174,60 @@ // line 386 in phpfreechatconfig.class.php $GLOBALS["i18n"]["'%s' parameter is not valid. Available values are : '%s'"] = "Le paramètre '%s' n'est pas valide. Les valeurs authorisées sont : '%s'"; +// line 185 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["My room"] = "Mon salon"; + +// line 109 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Private message"] = "Message privé"; + +// line 110 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Close this tab"] = "Fermer l'onglet"; + +// line 225 in pfcgui.js.tpl.php +$GLOBALS["i18n"]["Do you really want to leave this room ?"] = "Voulez vous vraiment quitter ce salon ?"; + +// line 19 in unban.class.php +$GLOBALS["i18n"]["Missing parameter"] = "Paramètre manquant"; + +// line 38 in ban.class.php +$GLOBALS["i18n"]["banished from %s by %s"] = "bannis du salon %s par %s"; + +// line 23 in banlist.class.php +$GLOBALS["i18n"]["The banished user's id list is:"] = "La liste des id bannis est :"; + +// line 32 in banlist.class.php +$GLOBALS["i18n"]["Empty"] = "Vide"; + +// line 34 in banlist.class.php +$GLOBALS["i18n"]["'/unban {id}' will unban the user identified by {id}"] = "'/unban {id}' va débannir l'utilisateur identifié par {id}"; + +// line 35 in banlist.class.php +$GLOBALS["i18n"]["'/unban all' will unban all the users on this channel"] = "'/unban all' va débannir tous les bannis de ce salon"; + +// line 24 in update.class.php +$GLOBALS["i18n"]["%s quit (timeout)"] = "%s à quitté (timeout)"; + +// line 46 in join.class.php +$GLOBALS["i18n"]["%s joins %s"] = "%s a rejoint %s"; + +// line 31 in kick.class.php +$GLOBALS["i18n"]["kicked from %s by %s"] = "kické de %s par %s"; + +// line 38 in send.class.php +$GLOBALS["i18n"]["Can't send the message, %s is offline"] = "Le message n'a pas été envoyé, %s n'est pas connecté"; + +// line 27 in unban.class.php +$GLOBALS["i18n"]["Nobody has been unbanished"] = "Personne n'a été débanni"; + +// line 42 in unban.class.php +$GLOBALS["i18n"]["%s has been unbanished"] = "%s a été débanni"; + +// line 49 in unban.class.php +$GLOBALS["i18n"]["%s users have been unbanished"] = "%s utilisateurs ont été débanni"; + +// line 47 in auth.class.php +$GLOBALS["i18n"]["You are not allowed to run '%s' command"] = "Vous n'êtes pas authorisé à lancer la commande '%s'"; + +// line 67 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because you are banished"] = "Vous ne pouvez pas rejoindre %s car vous êtes bannis"; ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:13
|
Revision: 549 Author: kerphi Date: 2006-06-05 07:33:24 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=549&view=rev Log Message: ----------- Bug fix: disallow to change nickname if frozen_nick is true Modified Paths: -------------- trunk/i18n/en_US/main.php trunk/i18n/fr_FR/main.php trunk/src/proxys/auth.class.php trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/i18n/en_US/main.php =================================================================== --- trunk/i18n/en_US/main.php 2006-06-05 14:11:32 UTC (rev 548) +++ trunk/i18n/en_US/main.php 2006-06-05 14:33:24 UTC (rev 549) @@ -230,4 +230,8 @@ // line 67 in auth.class.php $GLOBALS["i18n"]["Can't join %s because you are banished"] = "Can't join %s because you are banished"; + +// line 79 in auth.class.php +$GLOBALS["i18n"]["You are not allowed to change your nickname"] = "You are not allowed to change your nickname"; + ?> \ No newline at end of file Modified: trunk/i18n/fr_FR/main.php =================================================================== --- trunk/i18n/fr_FR/main.php 2006-06-05 14:11:32 UTC (rev 548) +++ trunk/i18n/fr_FR/main.php 2006-06-05 14:33:24 UTC (rev 549) @@ -230,4 +230,8 @@ // line 67 in auth.class.php $GLOBALS["i18n"]["Can't join %s because you are banished"] = "Vous ne pouvez pas rejoindre %s car vous êtes bannis"; + +// line 79 in auth.class.php +$GLOBALS["i18n"]["You are not allowed to change your nickname"] = "Vous n'êtes pas autorisé à changer votre pseudonyme"; + ?> \ No newline at end of file Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-06-05 14:11:32 UTC (rev 548) +++ trunk/src/proxys/auth.class.php 2006-06-05 14:33:24 UTC (rev 549) @@ -69,6 +69,18 @@ return; } } + + // disallow to change nickname if frozen_nick is true + if ($this->name == "nick") + { + if ($param != $c->nick && + $c->frozen_nick == true) + { + $msg = _pfc("You are not allowed to change your nickname", $param); + $xml_reponse->addScript("pfc.handleResponse('".$this->proxyname."', 'nick', '".addslashes($msg)."');"); + return; + } + } // forward the command to the next proxy or to the final command $this->next->run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid); Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-05 14:11:32 UTC (rev 548) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-05 14:33:24 UTC (rev 549) @@ -386,6 +386,10 @@ { alert(param); } + else if (resp == "nick") + { + this.displayMsg( cmd, param ); + } } else if (cmd == "debug") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:07:43
|
Revision: 551 Author: kerphi Date: 2006-06-06 10:19:21 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=551&view=rev Log Message: ----------- Allow to everyone to run /init command Modified Paths: -------------- trunk/src/proxys/auth.class.php Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-06-06 16:17:15 UTC (rev 550) +++ trunk/src/proxys/auth.class.php 2006-06-06 17:19:21 UTC (rev 551) @@ -36,7 +36,7 @@ $u =& $this->u; // protect admin commands - $admincmd = array("kick", "ban", "unban", "op", "deop", "debug", "rehash", "init"); + $admincmd = array("kick", "ban", "unban", "op", "deop", "debug", "rehash"); if ( in_array($this->name, $admincmd) ) { $container =& $c->getContainerInstance(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:07:33
|
Revision: 553 Author: kerphi Date: 2006-06-06 10:34:11 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=553&view=rev Log Message: ----------- New feature: add a new parameter "frozen_channels" which is a list of channels users are allowed to join. Modified Paths: -------------- trunk/i18n/en_US/main.php trunk/i18n/fr_FR/main.php trunk/src/pfcglobalconfig.class.php trunk/src/proxys/auth.class.php trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/i18n/en_US/main.php =================================================================== --- trunk/i18n/en_US/main.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/i18n/en_US/main.php 2006-06-06 17:34:11 UTC (rev 553) @@ -234,4 +234,7 @@ // line 79 in auth.class.php $GLOBALS["i18n"]["You are not allowed to change your nickname"] = "You are not allowed to change your nickname"; +// line 76 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Can't join %s because the channels list is restricted"; + ?> \ No newline at end of file Modified: trunk/i18n/fr_FR/main.php =================================================================== --- trunk/i18n/fr_FR/main.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/i18n/fr_FR/main.php 2006-06-06 17:34:11 UTC (rev 553) @@ -234,4 +234,7 @@ // line 79 in auth.class.php $GLOBALS["i18n"]["You are not allowed to change your nickname"] = "Vous n'êtes pas autorisé à changer votre pseudonyme"; +// line 76 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Vous ne pouvez pas rejoindre %s car il n'est pas dans la liste des salons autorisés"; + ?> \ No newline at end of file Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/src/pfcglobalconfig.class.php 2006-06-06 17:34:11 UTC (rev 553) @@ -40,7 +40,7 @@ var $proxys = array("auth"); var $title = ""; // default is _pfc("My Chat") var $channels = array(); // the default joined channels when opening the chat - var $privmsg = array(); // the default privmsg chat to lauch when opening the chat + var $frozen_channels = array(); // by default allow users to create there own channels var $frozen_nick = false; var $max_nick_len = 15; var $max_text_len = 400; Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/src/proxys/auth.class.php 2006-06-06 17:34:11 UTC (rev 553) @@ -49,25 +49,35 @@ } } - // protect channel from the banished users + // channels protection if ($this->name == "join") { - // check the user is not listed in the banished channel list $container =& $c->getContainerInstance(); $channame = $param; + + // check the user is not listed in the banished channel list $chanid = pfcCommand_join::GetRecipientId($channame); $banlist = $container->getMeta("banlist_nickid", "channel", $chanid); if ($banlist == NULL) $banlist = array(); else $banlist = unserialize($banlist); - $nickid = $container->getNickId($u->nick); if (in_array($nickid,$banlist)) { - // the user is banished, show a message and don't forward the /join command $msg = _pfc("Can't join %s because you are banished", $param); $xml_reponse->addScript("pfc.handleResponse('".$this->proxyname."', 'ban', '".addslashes($msg)."');"); return; } + + if (count($c->frozen_channels)>0) + { + if (!in_array($channame,$c->frozen_channels)) + { + // the user is banished, show a message and don't forward the /join command + $msg = _pfc("Can't join %s because the channels list is restricted", $param); + $xml_reponse->addScript("pfc.handleResponse('".$this->proxyname."', 'frozen', '".addslashes($msg)."');"); + return; + } + } } // disallow to change nickname if frozen_nick is true Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-06 17:34:11 UTC (rev 553) @@ -388,6 +388,10 @@ { alert(param); } + if (resp == "frozen") + { + alert(param); + } else if (resp == "nick") { this.displayMsg( cmd, param ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-01 17:58:51
|
Revision: 544 Author: kerphi Date: 2006-06-01 09:50:57 -0700 (Thu, 01 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=544&view=rev Log Message: ----------- Add a client side command history. As a classic terminal, use UP and DOWN key to navigate in the history. (doesn't works on IE6) Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-01 15:48:01 UTC (rev 543) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-01 16:50:57 UTC (rev 544) @@ -13,6 +13,12 @@ /* user description */ this.nickname = '<?php echo $u->nick; ?>'; + // this array contains all the sent command + // used the up and down key to navigate in the history + // (doesn't work on IE6) + this.cmdhistory = Array(); + this.cmdhistoryid = -1; + this.cmdhistoryissearching = false; /* this.channels = Array(); @@ -425,17 +431,24 @@ callbackWords_OnKeypress: function(evt) { var code = (evt.which) ? evt.which : evt.keyCode - if (code == 9) /* tab key */ + if (code == Event.KEY_TAB) /* tab key */ { /* FF & Konqueror workaround : ignore TAB key here */ /* do the nickname completion work like on IRC */ this.completeNick(); return false; /* do not leave the tab key default behavior */ } - else if (code == 13) /* enter key */ + else if (code == Event.KEY_RETURN) /* enter key */ { var w = this.el_words; var wval = w.value; + + // append the string to the history + this.cmdhistory.push(wval); + this.cmdhistoryid = this.cmdhistory.length; + this.cmdhistoryissearching = false; + + // send the string to the server re = new RegExp("^(\/[a-z0-9]+)( (.*)|)"); if (wval.match(re)) { @@ -464,6 +477,34 @@ w.value = ''; return false; } + else if (code == Event.KEY_UP) /* up key */ + { + // write the last command in the history + if (this.cmdhistory.length>0) + { + var w = this.el_words; + if (this.cmdhistoryissearching == false && w.value != "") + this.cmdhistory.push(w.value); + this.cmdhistoryissearching = true; + this.cmdhistoryid = this.cmdhistoryid-1; + if (this.cmdhistoryid<0) this.cmdhistoryid = this.cmdhistory.length-1; + w.value = this.cmdhistory[this.cmdhistoryid]; + } + } + else if (code == Event.KEY_DOWN) /* down key */ + { + // write the next command in the history + if (this.cmdhistory.length>0) + { + var w = this.el_words; + if (this.cmdhistoryissearching == false && w.value != "") + this.cmdhistory.push(w.value); + this.cmdhistoryissearching = true; + this.cmdhistoryid = this.cmdhistoryid+1; + if (this.cmdhistoryid>=this.cmdhistory.length) this.cmdhistoryid = 0; + w.value = this.cmdhistory[this.cmdhistoryid]; + } + } else { /* allow other keys */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-01 15:48:12
|
Revision: 543 Author: kerphi Date: 2006-06-01 08:48:01 -0700 (Thu, 01 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=543&view=rev Log Message: ----------- Now the admin command are protected and a /deop command is available. Modified Paths: -------------- trunk/src/proxys/auth.class.php Added Paths: ----------- trunk/src/commands/deop.class.php Added: trunk/src/commands/deop.class.php =================================================================== --- trunk/src/commands/deop.class.php (rev 0) +++ trunk/src/commands/deop.class.php 2006-06-01 15:48:01 UTC (rev 543) @@ -0,0 +1,32 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_deop extends pfcCommand +{ + var $usage = "/deop {nickname}"; + + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + if (trim($param) == "") + { + // error + $msg = _pfc("Missing parameter"); + $msg .= " (".$this->usage.")"; + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $clientid, $msg, $sender, $recipient, $recipientid); + return; + } + + // just change the "isadmin" meta flag + $nicktodeop = trim($param); + $container =& $c->getContainerInstance(); + $nicktodeopid = $container->getNickId($nicktodeop); + $container->setMeta(false, "isadmin", "nickname", $nicktodeopid); + } +} + +?> \ No newline at end of file Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-06-01 08:42:32 UTC (rev 542) +++ trunk/src/proxys/auth.class.php 2006-06-01 15:48:01 UTC (rev 543) @@ -35,27 +35,22 @@ $c =& $this->c; $u =& $this->u; - // $xml_reponse->addScript("alert('proxy auth');"); - - // if ($this->name == "send") - // $xml_reponse->addScript("alert('proxy auth');"); - - if ($this->name == "op") + // protect admin commands + $admincmd = array("kick", "ban", "unban", "op", "deop", "debug", "rehash", "init"); + if ( in_array($this->name, $admincmd) ) { $container =& $c->getContainerInstance(); $nickid = $container->getNickId($sender); $isadmin = $container->getMeta("isadmin", "nickname", $nickid); if (!$isadmin) { - $xml_reponse->addScript("alert('not allowed to do /op');"); + $xml_reponse->addScript("alert('".addslashes(_pfc("You are not allowed to run '%s' command", $this->name))."');"); return; } - else - { - // $xml_reponse->addScript("alert('allowed to do /op');"); - } } - else if ($this->name == "join") + + // protect channel from the banished users + if ($this->name == "join") { // check the user is not listed in the banished channel list $container =& $c->getContainerInstance(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |