phpfreechat-svn Mailing List for phpFreeChat (Page 27)
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-17 18:20:30
|
Revision: 617 Author: kerphi Date: 2006-06-17 11:20:22 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=617&view=rev Log Message: ----------- fix warnings Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getonlinenick.class.php trunk/src/commands/nick.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/commands/connect.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -40,7 +40,8 @@ if (!$isadmin) { $users = $container->getOnlineNick(NULL); - if (count($users["nickid"]) == 0) $isadmin = true; + if (isset($users["nickid"]) && + count($users["nickid"]) == 0) $isadmin = true; } // setup some user meta Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/commands/getonlinenick.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -11,11 +11,12 @@ // take care to disconnect timeouted users on this channel $disconnected_users = $container->removeObsoleteNick($recipient,$c->timeout); - foreach ($disconnected_users["nick"] as $n) - { - $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)", $n), $sender, $recipient, $recipientid, 2); - } + if (isset($disconnected_users["nick"])) + foreach ($disconnected_users["nick"] as $n) + { + $cmd =& pfcCommand::Factory("notice"); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)", $n), $sender, $recipient, $recipientid, 2); + } // get the cached nickname list $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$recipientid; @@ -35,8 +36,8 @@ if ($c->debug) { - $nicklist = implode(",",$nicklist); - pxlog("/getonlinenick (nicklist updated - nicklist=".$nicklist.")", "chat", $c->getId()); + $nicklist2 = implode(",",$nicklist); + pxlog("/getonlinenick (nicklist updated - nicklist=".$nicklist2.")", "chat", $c->getId()); } // build and send the nickname list Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/commands/nick.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -34,16 +34,17 @@ // 'BoB' and 'bob' must be considered same nicknames $nick_in_use = false; $online_users = $container->getOnlineNick(NULL); - foreach($online_users["nickid"] as $nid) - { - if (preg_match("/^".preg_quote($container->getNickname($nid))."$/i",$newnick)) + if (isset($online_users["nickid"])) + foreach($online_users["nickid"] as $nid) { - // the nick match - // just allow the owner to change his capitalised letters - if ($nid != $oldnickid) - $nick_in_use = true; + if (preg_match("/^".preg_quote($container->getNickname($nid))."$/i",$newnick)) + { + // the nick match + // just allow the owner to change his capitalised letters + if ($nid != $oldnickid) + $nick_in_use = true; + } } - } if ( $newnickid == "undefined" && !$nick_in_use ) { Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/containers/file.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -112,7 +112,7 @@ // check the if the file exists only in debug mode! if ($c->debug) { - if (file_exists($nick_filename)) + if (file_exists($nickid_filename)) pxlog("createNick(".$nick.", ".$nickid.") - Error: another nickname data file exists, we are overwriting it (nickname takeover)!", "chat", $c->getId()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 12:33:56
|
Revision: 616 Author: kerphi Date: 2006-06-17 05:33:51 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=616&view=rev Log Message: ----------- Warning fix: iconv(): Wrong charset, conversion from `UTF-8' to `UTF-8' is not allowed Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-06-17 12:33:27 UTC (rev 615) +++ trunk/src/pfci18n.class.php 2006-06-17 12:33:51 UTC (rev 616) @@ -26,7 +26,9 @@ { $args = func_get_args(); $args[0] = isset($GLOBALS["i18n"][$args[0]]) && $GLOBALS["i18n"][$args[0]] != "" ? - iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]]) : + ($GLOBALS["output_encoding"] == "UTF-8" ? + $GLOBALS["i18n"][$args[0]] : + iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]])) : "_".$args[0]."_"; return call_user_func_array('sprintf', $args); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 12:33:32
|
Revision: 615 Author: kerphi Date: 2006-06-17 05:33:27 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=615&view=rev Log Message: ----------- Fix warning: Missing argument 4 for pfcProxyCommand_auth::run() Modified Paths: -------------- trunk/src/commands/send.class.php Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2006-06-17 10:58:45 UTC (rev 614) +++ trunk/src/commands/send.class.php 2006-06-17 12:33:27 UTC (rev 615) @@ -32,7 +32,7 @@ { // send an error because the user is not online $cmd =& pfcCommand::Factory("error"); - $cmd->run($xml_reponse, $clientid, _pfc("Can't send the message, %s is offline", $pvnick)); + $cmd->run($xml_reponse, $clientid, _pfc("Can't send the message, %s is offline", $pvnick), $sender, $recipient, $recipientid); $can_send = false; } } @@ -48,7 +48,7 @@ foreach($errors as $e) if ($c->debug) pxlog("error /send, user can't send a message -> nick=".$u->nick." err=".$e, "chat", $c->getId()); $cmd =& pfcCommand::Factory("error"); - $cmd->run($xml_reponse, $clientid, $errors); + $cmd->run($xml_reponse, $clientid, $errors, $sender, $recipient, $recipientid); if (isset($errors[$c->prefix."handle"])) // the nick is empty so give it focus $xml_reponse->addScript("$('".$c->prefix."handle').focus();"); $can_send = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 10:58:51
|
Revision: 614 Author: kerphi Date: 2006-06-17 03:58:45 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=614&view=rev Log Message: ----------- Refactoring: rename copyr to copy_r Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php trunk/src/pfctools.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-17 10:54:12 UTC (rev 613) +++ trunk/src/pfcglobalconfig.class.php 2006-06-17 10:58:45 UTC (rev 614) @@ -199,29 +199,29 @@ $this->errors = array_merge($this->errors, @install_dir($this->jspath, $this->data_public_path."/javascript")); $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path."/cache", "data_private_path/cache")); - // check the copyr and rm_r function works + // check the copy_r and rm_r function works if (count($this->errors) == 0) { - $copyr_ok = true; - $dir1 = $this->data_private_path."/copyr1"; + $copy_r_ok = true; + $dir1 = $this->data_private_path."/copy_r1"; $file1 = $dir1."/dummy"; - $dir2 = $this->data_private_path."/copyr2"; + $dir2 = $this->data_private_path."/copy_r2"; $file2 = $dir2."/dummy"; // create a dummy directory mkdir($dir1); // check the directory exists - if (!file_exists($dir1) || !is_dir($dir1)) $copyr_ok = false; + if (!file_exists($dir1) || !is_dir($dir1)) $copy_r_ok = false; // create a dummy file touch($file1); // check the file exists - if (!file_exists($file1)) $copyr_ok = false; - // copyr the dummy dir - copyr($dir1,$dir2); + if (!file_exists($file1)) $copy_r_ok = false; + // copy_r the dummy dir + copy_r($dir1,$dir2); // check the directory exists - if (!file_exists($dir2) || !is_dir($dir2)) $copyr_ok = false; + if (!file_exists($dir2) || !is_dir($dir2)) $copy_r_ok = false; // check the file exists - if (!file_exists($file2)) $copyr_ok = false; - if (!$copyr_ok) + if (!file_exists($file2)) $copy_r_ok = false; + if (!$copy_r_ok) $this->errors[] = _pfc("Recursive copy doesn't works"); // try to remove recursively the directory @@ -232,7 +232,7 @@ if (file_exists($dir1) || file_exists($dir2)) $rm_r_ok = false; // check the file doesn't exists if (file_exists($file1) || file_exists($file2)) $rm_r_ok = false; - if (!$copyr_ok) + if (!$copy_r_ok) $this->errors[] = _pfc("Recursive remove doesn't works"); } Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-06-17 10:54:12 UTC (rev 613) +++ trunk/src/pfctools.php 2006-06-17 10:58:45 UTC (rev 614) @@ -137,7 +137,7 @@ * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ -function copyr($source, $dest, $mode = 0700) +function copy_r($source, $dest, $mode = 0700) { // Simple copy for a file if (is_file($source)) { @@ -166,7 +166,7 @@ if ($e == '.' || $e == '..' || $e == '.svn') continue; // Deep copy directories if ($dest !== $source . DIRECTORY_SEPARATOR . $e) - copyr($source . DIRECTORY_SEPARATOR . $e, $dest . DIRECTORY_SEPARATOR . $e, $mode); + copy_r($source . DIRECTORY_SEPARATOR . $e, $dest . DIRECTORY_SEPARATOR . $e, $mode); } // Clean up @@ -239,7 +239,7 @@ if (!is_readable($src_dir)) $errors[] = _pfc("%s is not readable", $src_dir); - copyr( $src_dir, $dst_dir ); + copy_r( $src_dir, $dst_dir ); return $errors; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 10:54:21
|
Revision: 613 Author: kerphi Date: 2006-06-17 03:54:12 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=613&view=rev Log Message: ----------- Be sure the copy_r and rm_r function works Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-17 10:19:50 UTC (rev 612) +++ trunk/src/pfcglobalconfig.class.php 2006-06-17 10:54:12 UTC (rev 613) @@ -198,6 +198,43 @@ $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($this->data_private_path."/cache", "data_private_path/cache")); + + // check the copyr and rm_r function works + if (count($this->errors) == 0) + { + $copyr_ok = true; + $dir1 = $this->data_private_path."/copyr1"; + $file1 = $dir1."/dummy"; + $dir2 = $this->data_private_path."/copyr2"; + $file2 = $dir2."/dummy"; + // create a dummy directory + mkdir($dir1); + // check the directory exists + if (!file_exists($dir1) || !is_dir($dir1)) $copyr_ok = false; + // create a dummy file + touch($file1); + // check the file exists + if (!file_exists($file1)) $copyr_ok = false; + // copyr the dummy dir + copyr($dir1,$dir2); + // check the directory exists + if (!file_exists($dir2) || !is_dir($dir2)) $copyr_ok = false; + // check the file exists + if (!file_exists($file2)) $copyr_ok = false; + if (!$copyr_ok) + $this->errors[] = _pfc("Recursive copy doesn't works"); + + // try to remove recursively the directory + $rm_r_ok = true; + rm_r($dir2); + rm_r($dir1); + // check the directory doesn't exists + if (file_exists($dir1) || file_exists($dir2)) $rm_r_ok = false; + // check the file doesn't exists + if (file_exists($file1) || file_exists($file2)) $rm_r_ok = false; + if (!$copyr_ok) + $this->errors[] = _pfc("Recursive remove doesn't works"); + } // --- // test xajax lib existance This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 10:19:56
|
Revision: 612 Author: kerphi Date: 2006-06-17 03:19:50 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=612&view=rev Log Message: ----------- Bug fix: the global config was not correctly checked since the cache lock file addition. Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-17 09:54:09 UTC (rev 611) +++ trunk/src/pfcglobalconfig.class.php 2006-06-17 10:19:50 UTC (rev 612) @@ -386,7 +386,7 @@ { $cachefile = $this->_getCacheFile(); $cachefile_lock = $cachefile."_lock"; - + if (file_exists($cachefile)) { // if a cache file exists, remove the lock file because config has been succesfully stored @@ -406,7 +406,14 @@ else { if (file_exists($cachefile_lock)) - return false; // do nothing if the lock file exists + { + // delete too old lockfiles (more than 15 seconds) + $locktime = filemtime($cachefile_lock); + if ($locktime+15 < time()) + unlink($cachefile_lock); + else + return false; // do nothing if the lock file exists + } else @touch($cachefile_lock); // create the lockfile @@ -415,6 +422,7 @@ $errors =& $this->getErrors(); if (count($errors) > 0) { + @unlink($cachefile_lock); // destroy the lock file for the next attempt echo "<ul>"; foreach( $errors as $e ) echo "<li>".$e."</li>"; echo "</ul>"; exit; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 09:54:13
|
Revision: 611 Author: kerphi Date: 2006-06-17 02:54:09 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=611&view=rev Log Message: ----------- 'nick' and 'isadmin' parameter are dynamic, don't reassign it in the synchronizeWithCache function Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-17 08:01:09 UTC (rev 610) +++ trunk/src/pfcglobalconfig.class.php 2006-06-17 09:54:09 UTC (rev 611) @@ -38,7 +38,7 @@ // these parameters are static (cached) var $proxys = array("auth", "noflood"); - var $proxys_cfg = array("auth" => array(), + 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 @@ -127,11 +127,6 @@ if ($this->data_public_path == "") $this->data_public_path = dirname(__FILE__)."/../data/public"; $this->synchronizeWithCache(); - - // the 'nick' is dynamic, it must not be cached - if (isset($params["nick"])) $this->nick = $params["nick"]; - // the 'isadmin' flag is dynamic, it must not be cached - if (isset($params["isadmin"])) $this->isadmin = $params["isadmin"]; } function &Instance( $params = array() ) @@ -399,7 +394,13 @@ $pfc_configvar = unserialize(file_get_contents($cachefile)); foreach($pfc_configvar as $key => $val) - $this->$key = $val; + { + // the 'nick' and 'isadmin' are dynamic parameters, it must not be cached + if ($key != "nick" && + $key != "isadmin") + $this->$key = $val; + } + return true; // synchronized } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 08:01:16
|
Revision: 610 Author: kerphi Date: 2006-06-17 01:01:09 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=610&view=rev Log Message: ----------- Bug fix: when this is the first connection, the u->channels is empty, to setup the oldmsg flag, c->channels must be used Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-16 21:18:38 UTC (rev 609) +++ trunk/src/commands/connect.class.php 2006-06-17 08:01:09 UTC (rev 610) @@ -16,9 +16,14 @@ // reset the message id indicator (see getnewmsg.class.php) // i.e. be ready to re-get all last posted messages require_once(dirname(__FILE__)."/join.class.php"); - foreach($u->channels as $chan) + $channels = array(); + if (count($u->channels) == 0) + $channels = $c->channels; + else + foreach($u->channels as $chan) + $channels[] = $chan["name"]; + foreach($channels as $channame) { - $channame = $chan["name"]; $chanrecip = pfcCommand_join::GetRecipient($channame); $chanid = pfcCommand_join::GetRecipientId($channame); // reset the fromid flag This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 21:18:48
|
Revision: 609 Author: kerphi Date: 2006-06-16 14:18:38 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=609&view=rev Log Message: ----------- improve the design on the border between chat and nickname list area Modified Paths: -------------- trunk/themes/default/templates/pfcgui.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Added Paths: ----------- trunk/themes/default/images/online-separator.gif Added: trunk/themes/default/images/online-separator.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/default/images/online-separator.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 21:02:15 UTC (rev 608) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 21:18:38 UTC (rev 609) @@ -123,7 +123,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.borderLeft = "1px solid #555"; + // 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 Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-06-16 21:02:15 UTC (rev 608) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-16 21:18:38 UTC (rev 609) @@ -11,7 +11,7 @@ padding: 10px; min-height: 20px; background-color: #FFF; - background-image: url(<?php echo $c->getFileUrlFromTheme('images/shade.gif'); ?>); + 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 */ @@ -89,7 +89,7 @@ position: absolute; top: 0; left: 0; - width: 79.9%; + width: 80%; height: 100%; overflow: auto; } @@ -104,6 +104,9 @@ height: 100%; color: #000; /* colors can be overriden by js nickname colorization */ background-color: #FFF; + background-image: url("<?php echo $c->getFileUrlFromTheme('images/online-separator.gif'); ?>"); + background-position: left; + background-repeat: repeat-y; /* borders are drawn by the javascript routines */ } div.<?php echo $prefix; ?>online ul { @@ -140,8 +143,7 @@ div.<?php echo $prefix; ?>oldmsg { background-image: url("<?php echo $c->getFileUrlFromTheme('images/oldmsg.gif'); ?>"); background-position: right; - background-repeat: repeat-y; - + background-repeat: repeat-y; } 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-16 21:02:24
|
Revision: 608 Author: kerphi Date: 2006-06-16 14:02:15 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=608&view=rev Log Message: ----------- change the default style for the oldmsg Modified Paths: -------------- trunk/themes/default/templates/pfcgui.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Added Paths: ----------- trunk/themes/default/images/oldmsg.gif Added: trunk/themes/default/images/oldmsg.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/default/images/oldmsg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 20:40:30 UTC (rev 607) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 21:02:15 UTC (rev 608) @@ -108,7 +108,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"; + // 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-16 20:40:30 UTC (rev 607) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-16 21:02:15 UTC (rev 608) @@ -32,7 +32,7 @@ border-right: 1px solid #555; border-left: 1px solid #555; border-bottom: 1px solid #555; - background-color: #FAFAFA; + background-color: #FFF; margin-top: 5px; } div.<?php echo $prefix; ?>content { @@ -60,13 +60,13 @@ background-color: #DDD; } ul#<?php echo $prefix; ?>channels_list li.selected div { - background-color: #FAFAFA; - border-bottom: 1px solid #FAFAFA; + background-color: #FFF; + border-bottom: 1px solid #FFF; color: #000; font-weight: bold; } ul#<?php echo $prefix; ?>channels_list li > div:hover { - background-color: #FAFAFA; + background-color: #FFF; } ul#<?php echo $prefix; ?>channels_list li a { color: #000; @@ -89,7 +89,7 @@ position: absolute; top: 0; left: 0; - width: 79.5%; + width: 79.9%; height: 100%; overflow: auto; } @@ -132,14 +132,16 @@ } div.<?php echo $prefix; ?>message { - margin: 0; } .<?php echo $prefix; ?>words { font-size: 90%; } div.<?php echo $prefix; ?>oldmsg { - color: #AAA; + background-image: url("<?php echo $c->getFileUrlFromTheme('images/oldmsg.gif'); ?>"); + background-position: right; + background-repeat: repeat-y; + } 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-16 20:40:38
|
Revision: 607 Author: kerphi Date: 2006-06-16 13:40:30 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=607&view=rev Log Message: ----------- Bug fix: the oldmsg flag was broken Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getnewmsg.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-16 20:30:27 UTC (rev 606) +++ trunk/src/commands/connect.class.php 2006-06-16 20:40:30 UTC (rev 607) @@ -21,11 +21,14 @@ $channame = $chan["name"]; $chanrecip = pfcCommand_join::GetRecipient($channame); $chanid = pfcCommand_join::GetRecipientId($channame); + // reset the fromid flag $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$chanid; $from_id = $container->getLastId($chanrecip)-$c->max_msg; $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + // reset the oldmsg flag + $oldmsg_sid = $c->prefix."oldmsg_".$c->getId()."_".$clientid."_".$chanid; + $_SESSION[$oldmsg_sid] = true; } - // check if the user is alone on the server, and give it the admin status if yes $isadmin = $c->isadmin; Modified: trunk/src/commands/getnewmsg.class.php =================================================================== --- trunk/src/commands/getnewmsg.class.php 2006-06-16 20:30:27 UTC (rev 606) +++ trunk/src/commands/getnewmsg.class.php 2006-06-16 20:40:30 UTC (rev 607) @@ -37,6 +37,13 @@ $from_id = $container->getLastId($recipient)-$c->max_msg; if ($from_id < 0) $from_id = 0; } + // check if this is the first time you get messages + $oldmsg_sid = $c->prefix."oldmsg_".$c->getId()."_".$clientid."_".$recipientid; + if (isset($_SESSION[$oldmsg_sid])) + { + unset($_SESSION[$oldmsg_sid]); + $oldmsg = true; + } //$xml_reponse->addScript("alert('getnewmsg: fromidsid=".$from_id_sid."');"); //$xml_reponse->addScript("alert('getnewmsg: recipient=".$recipient." fromid=".$from_id."');"); @@ -61,7 +68,7 @@ $m_recipientid = $recipientid; $m_cmd = $d["cmd"]; $m_param = phpFreeChat::PostFilterMsg($d["param"]); - $js .= "Array(".$m_id.",'".addslashes($m_date)."','".addslashes($m_time)."','".addslashes($m_sender)."','".addslashes($m_recipientid)."','".addslashes($m_cmd)."','".addslashes($m_param)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($from_id == 0? 1 : 0)."),"; + $js .= "Array(".$m_id.",'".addslashes($m_date)."','".addslashes($m_time)."','".addslashes($m_sender)."','".addslashes($m_recipientid)."','".addslashes($m_cmd)."','".addslashes($m_param)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($oldmsg ? 1 : 0)."),"; $data_sent = true; } if ($js != "") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 20:30:32
|
Revision: 606 Author: kerphi Date: 2006-06-16 13:30:27 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=606&view=rev Log Message: ----------- Bug fix: the focus on click feature was broken for konqueror 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-16 20:26:28 UTC (rev 605) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-16 20:30:27 UTC (rev 606) @@ -549,12 +549,12 @@ }, callbackContainer_OnMousedown: function(evt) { - if ( (is_ie && evt.button == 1) || (is_ff && evt.button == 0) ) + if ( ((is_ie || is_khtml) && evt.button == 1) || (is_ff && evt.button == 0) ) this.isdraging = false; }, callbackContainer_OnMouseup: function(evt) { - if ( (is_ie && evt.button == 1) || (is_ff && evt.button == 0) ) + if ( ((is_ie || is_khtml) && evt.button == 1) || (is_ff && evt.button == 0) ) if (!this.isdraging) if (this.el_words && !this.minmax_status) this.el_words.focus(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 20:26:34
|
Revision: 605 Author: kerphi Date: 2006-06-16 13:26:28 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=605&view=rev Log Message: ----------- Bug fix: the scrollbar was not correctly updated Modified Paths: -------------- trunk/themes/default/templates/pfcgui.js.tpl.php Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 18:47:36 UTC (rev 604) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 20:26:28 UTC (rev 605) @@ -75,9 +75,13 @@ // show the new selected tab tab_to_show.style.display = 'block'; + + // restore the scroll pos + var content = this.getChatContentFromTabId(tabid); + content.scrollTop = this.scrollpos[tabid]; // scroll the new posted message - if (this.elttoscroll[tabid]) + if (this.elttoscroll[tabid].length > 0) { // on by one for (var i=0; i<this.elttoscroll[tabid].length; i++) @@ -85,10 +89,6 @@ this.elttoscroll[tabid] = Array(); } - // restore the scroll pos - var content = this.getChatContentFromTabId(tabid); - content.scrollTop = this.scrollpos[tabid]; - this.unnotifyTab(tabid); }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 18:47:49
|
Revision: 604 Author: kerphi Date: 2006-06-16 11:47:36 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=604&view=rev Log Message: ----------- Bug fix: the "max_msg" parameter was broken, setting this parameter to zero displayed blank screen on next reload Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getnewmsg.class.php trunk/src/commands/join.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-16 16:12:08 UTC (rev 603) +++ trunk/src/commands/connect.class.php 2006-06-16 18:47:36 UTC (rev 604) @@ -9,15 +9,28 @@ $c =& $this->c; $u =& $this->u; - // disconnect last connected users from the server if necessary $container =& $c->getContainerInstance(); $disconnected_users = $container->removeObsoleteNick(NULL, $c->timeout); + // reset the message id indicator (see getnewmsg.class.php) + // i.e. be ready to re-get all last posted messages + require_once(dirname(__FILE__)."/join.class.php"); + foreach($u->channels as $chan) + { + $channame = $chan["name"]; + $chanrecip = pfcCommand_join::GetRecipient($channame); + $chanid = pfcCommand_join::GetRecipientId($channame); + $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$chanid; + $from_id = $container->getLastId($chanrecip)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + } + + + // check if the user is alone on the server, and give it the admin status if yes $isadmin = $c->isadmin; if (!$isadmin) { - // check if the user is alone on the server, and give it the admin status if yes $users = $container->getOnlineNick(NULL); if (count($users["nickid"]) == 0) $isadmin = true; } Modified: trunk/src/commands/getnewmsg.class.php =================================================================== --- trunk/src/commands/getnewmsg.class.php 2006-06-16 16:12:08 UTC (rev 603) +++ trunk/src/commands/getnewmsg.class.php 2006-06-16 18:47:36 UTC (rev 604) @@ -11,7 +11,7 @@ // do nothing if the recipient is not defined if ($recipient == "") return; - // $xml_reponse->addScript("alert('getnewmsg: sender=".addslashes($sender)." param=".addslashes($param)." recipient=".addslashes($recipient)." recipientid=".addslashes($recipientid)."');"); + //$xml_reponse->addScript("alert('getnewmsg: sender=".addslashes($sender)." param=".addslashes($param)." recipient=".addslashes($recipient)." recipientid=".addslashes($recipientid)."');"); // check this methode is not being called if( isset($_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid]) ) Modified: trunk/src/commands/join.class.php =================================================================== --- trunk/src/commands/join.class.php 2006-06-16 16:12:08 UTC (rev 603) +++ trunk/src/commands/join.class.php 2006-06-16 18:47:36 UTC (rev 604) @@ -34,18 +34,13 @@ $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$chanid; $_SESSION[$nicklist_sid] = NULL; - // reset the message id indicator - // i.e. be ready to re-get all last posted messages - $container =& $c->getContainerInstance(); - $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$chanid; - $from_id = $container->getLastId($chanrecip)-$c->max_msg; - $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; - // show a join message $cmd =& pfcCommand::Factory("notice"); $cmd->run($xml_reponse, $clientid, _pfc("%s joins %s",$u->nick, $channame), $sender, $chanrecip, $chanid, 1); } - //$xml_reponse->addScript("alert('join: chan=".$channame."');"); + + + //$xml_reponse->addScript("alert('join: chan=".$channame.", from_id=".$from_id."');"); // $xml_reponse->addScript("alert('join: u->nick=".$u->nick." chanid=".$chanid." channame=".addslashes($channame)."');"); // $xml_reponse->addScript("alert('join: fromidsid=".$from_id_sid."');"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 16:54:45
|
Revision: 603 Author: kerphi Date: 2006-06-16 09:12:08 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=603&view=rev Log Message: ----------- Bug fix: the button position index was wrong on IE, so the autofocus feature was broken 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-16 15:12:59 UTC (rev 602) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-16 16:12:08 UTC (rev 603) @@ -1,3 +1,7 @@ +var is_ie = navigator.appName.match("Explorer"); +var is_khtml = navigator.appName.match("Konqueror") || navigator.appVersion.match("KHTML"); +var is_ff = navigator.appName.match("Netscape"); + /** * This class is the client part of phpFreeChat * (depends on prototype library) @@ -545,12 +549,12 @@ }, callbackContainer_OnMousedown: function(evt) { - if (evt.button == 0) + if ( (is_ie && evt.button == 1) || (is_ff && evt.button == 0) ) this.isdraging = false; }, callbackContainer_OnMouseup: function(evt) { - if (evt.button == 0) + if ( (is_ie && evt.button == 1) || (is_ff && evt.button == 0) ) if (!this.isdraging) if (this.el_words && !this.minmax_status) this.el_words.focus(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 15:13:10
|
Revision: 602 Author: kerphi Date: 2006-06-16 08:12:59 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=602&view=rev Log Message: ----------- prepare the 1.0-beta2 release Modified Paths: -------------- trunk/version Modified: trunk/version =================================================================== --- trunk/version 2006-06-16 15:12:20 UTC (rev 601) +++ trunk/version 2006-06-16 15:12:59 UTC (rev 602) @@ -1 +1 @@ -1.0-beta \ No newline at end of file +1.0-beta2 \ 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-16 15:12:26
|
Revision: 601 Author: kerphi Date: 2006-06-16 08:12:20 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=601&view=rev Log Message: ----------- Bandwidth optimization : do not send any responses when nothing have to be updated (this code is under commentary because it doesn't work with the current xajax version) Modified Paths: -------------- trunk/src/phpfreechat.class.php Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-06-16 15:09:56 UTC (rev 600) +++ trunk/src/phpfreechat.class.php 2006-06-16 15:12:20 UTC (rev 601) @@ -443,6 +443,9 @@ pxlog("HandleRequest: content=".$data, "chat", $c->getId()); ob_end_clean(); } + + // do nothing else if the xml response is empty + //if ($xml_reponse->xml == "") die(); return $xml_reponse->getXML(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 15:10:01
|
Revision: 600 Author: kerphi Date: 2006-06-16 08:09:56 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=600&view=rev Log Message: ----------- code cleaning 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-16 14:45:47 UTC (rev 599) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-16 15:09:56 UTC (rev 600) @@ -332,29 +332,6 @@ if (resp == "ok") { } - else if (resp == "cmdtoplay") - { - if (param[0] == "privmsg2") - { - // do not open the same tab twice - // (it's not necessary to speak to the server if the tab is allready open) - // so we check if the wanted privmsg tab exists or not - var index = this.privmsgs.indexOf(param[1]); - if (index == -1) - { - // it doesn't exists, create it in the background - this.sendRequest("/"+param[0],param[1]); - } - } - else if (param[0] == "leave") - { - this.sendRequest("/"+param[0],param[1]); - } - else - this.sendRequest("/"+param[0],param[1]); - } - // else - // alert(cmd + "-"+resp+"-"+param); } else if (cmd == "rehash") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 14:45:53
|
Revision: 599 Author: kerphi Date: 2006-06-16 07:45:47 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=599&view=rev Log Message: ----------- Bandwidth optimization: do not send the "ok" ack when the update command is run Modified Paths: -------------- trunk/src/commands/update.class.php Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-06-16 14:20:29 UTC (rev 598) +++ trunk/src/commands/update.class.php 2006-06-16 14:45:47 UTC (rev 599) @@ -44,8 +44,9 @@ // $cmd =& pfcCommand::Factory("notice"); // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); // } - - $xml_reponse->addScript("pfc.handleResponse('update', 'ok', '');"); + + // do not send a response in order to save some bandwidth + // $xml_reponse->addScript("pfc.handleResponse('update', 'ok', '');"); } else $xml_reponse->addScript("pfc.handleResponse('update', 'ko', '');"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 14:20:46
|
Revision: 598 Author: kerphi Date: 2006-06-16 07:20:29 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=598&view=rev Log Message: ----------- Bug fix: when clicking on the chat window to give focus to the input zone, ignore other button than left button. 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-16 14:11:49 UTC (rev 597) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-16 14:20:29 UTC (rev 598) @@ -568,13 +568,15 @@ }, callbackContainer_OnMousedown: function(evt) { - this.isdraging = false; + if (evt.button == 0) + this.isdraging = false; }, callbackContainer_OnMouseup: function(evt) { - if (!this.isdraging) - if (this.el_words && !this.minmax_status) - this.el_words.focus(); + if (evt.button == 0) + if (!this.isdraging) + if (this.el_words && !this.minmax_status) + this.el_words.focus(); }, /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 14:11:56
|
Revision: 597 Author: kerphi Date: 2006-06-16 07:11:49 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=597&view=rev Log Message: ----------- XHTML fix: the target="_blank" attribute should not be used Modified Paths: -------------- trunk/themes/default/templates/chat.html.tpl.php trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/chat.html.tpl.php =================================================================== --- trunk/themes/default/templates/chat.html.tpl.php 2006-06-16 13:59:34 UTC (rev 596) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-06-16 14:11:49 UTC (rev 597) @@ -12,7 +12,7 @@ <div id="<?php echo $prefix; ?>input_container"> <input id="<?php echo $prefix; ?>words" type="text" title="<?php echo _pfc("Enter your message here"); ?>" maxlength="<?php echo $max_text_len-25; ?>" /> <div id="<?php echo $prefix; ?>cmd_container"> - <a href="http://www.phpfreechat.net" id="<?php echo $prefix; ?>logo"<?php if($openlinknewwindow) echo ' target="_blank"'; ?>><img src="http://www.phpfreechat.net/pub/logo_80x15.gif" alt="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" title="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" /></a> + <a href="http://www.phpfreechat.net" id="<?php echo $prefix; ?>logo"<?php if($openlinknewwindow) echo ' onclick="window.open(this.href,\'_blank\');return false;"'; ?>><img src="http://www.phpfreechat.net/pub/logo_80x15.gif" alt="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" title="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" /></a> <input id="<?php echo $prefix; ?>handle" type="button" title="<?php echo _pfc("Enter your nickname here"); ?>" value="<?php echo $u->nick; ?>" onclick="pfc.askNick('');" /> <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/logout.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>loginlogout" onclick="pfc.connect_disconnect()" /></div> <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/color-on.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>nickmarker" onclick="pfc.nickmarker_swap()" /></div> Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-16 13:59:34 UTC (rev 596) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-16 14:11:49 UTC (rev 597) @@ -880,7 +880,7 @@ var range1 = 7+offset-delta; var range2 = 7+offset+delta; if (ttt[i].match(rx_url)) - msg = msg + '<a href="' + ttt[i] + '"<?php if($openlinknewwindow) echo ' target="_blank"'; ?>>' + (delta>0 ? ttt[i].substring(7,range1)+ ' ... '+ ttt[i].substring(range2,ttt[i].length) : ttt[i]) + '</a>'; + msg = msg + '<a href="' + ttt[i] + '"<?php if($openlinknewwindow) echo ' onclick="window.open(this.href,\\\'_blank\\\');return false;"'; ?>>' + (delta>0 ? ttt[i].substring(7,range1)+ ' ... '+ ttt[i].substring(range2,ttt[i].length) : ttt[i]) + '</a>'; else { msg = msg + ttt[i]; @@ -889,7 +889,7 @@ } else // fallback for IE6/Konqueror which do not support split with regexp - msg = msg.replace(rx_url, '$1<a href="$2"<?php if($openlinknewwindow) echo ' target="_blank"'; ?>>$2</a>$3'); + msg = msg.replace(rx_url, '$1<a href="$2"<?php if($openlinknewwindow) echo ' onclick="window.open(this.href,\\\'_blank\\\');return false;"'; ?>>$2</a>$3'); // replace double spaces by entity rx = new RegExp(' ','g'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 13:59:42
|
Revision: 596 Author: kerphi Date: 2006-06-16 06:59:34 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=596&view=rev Log Message: ----------- Bug fix: when new messages were received in a background tab, the corresponding scrollbar was not scrolled as expected. Modified Paths: -------------- trunk/themes/default/templates/pfcgui.js.tpl.php Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 12:13:17 UTC (rev 595) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-16 13:59:34 UTC (rev 596) @@ -18,6 +18,7 @@ this.chatcontent = $H(); this.onlinecontent = $H(); this.scrollpos = $H(); + this.elttoscroll = $H(); }, /** @@ -25,7 +26,12 @@ */ scrollDown: function(tabid, elttoscroll) { - if (this.getTabId() != tabid) return; /* do nothing if this is not the current tab or it will reset the scrollbar position to 0 */ + if (this.getTabId() != tabid) + { + if (!this.elttoscroll[tabid]) this.elttoscroll[tabid] = Array(); + this.elttoscroll[tabid].push(elttoscroll); + return; + } var content = this.getChatContentFromTabId(tabid); content.scrollTop += elttoscroll.offsetHeight+2; this.scrollpos[tabid] = content.scrollTop; @@ -38,7 +44,7 @@ setTabById: function(tabid) { - // first of all save the scroll post of the visible tab + // first of all save the scroll pos of the visible tab var content = this.getChatContentFromTabId(this.current_tab_id); this.scrollpos[this.current_tab_id] = content.scrollTop; @@ -46,7 +52,7 @@ this.current_tab = ''; this.current_tab_id = ''; var tab_to_show = null; - // try to fine the tab to select and select it! + // try to fine the tab to select and select it! for (var i=0; i<this.tabids.length; i++) { var tabtitle = $('<?php echo $prefix; ?>channel_title'+this.tabids[i]); @@ -69,6 +75,16 @@ // show the new selected tab tab_to_show.style.display = 'block'; + + // scroll the new posted message + if (this.elttoscroll[tabid]) + { + // on by one + for (var i=0; i<this.elttoscroll[tabid].length; i++) + this.scrollDown(tabid,this.elttoscroll[tabid][i]); + this.elttoscroll[tabid] = Array(); + } + // restore the scroll pos var content = this.getChatContentFromTabId(tabid); content.scrollTop = this.scrollpos[tabid]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-16 12:13:22
|
Revision: 595 Author: kerphi Date: 2006-06-16 05:13:17 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=595&view=rev Log Message: ----------- Warning fix: "Call-time pass-by-reference has been deprecated" Modified Paths: -------------- trunk/src/containers/file.class.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-06-15 20:51:12 UTC (rev 594) +++ trunk/src/containers/file.class.php 2006-06-16 12:13:17 UTC (rev 595) @@ -35,7 +35,7 @@ function pfcContainer_File(&$config) { - pfcContainer::pfcContainer(&$config); + pfcContainer::pfcContainer($config); // $this->loadPaths(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-15 20:55:27
|
Revision: 594 Author: kerphi Date: 2006-06-15 13:51:12 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=594&view=rev Log Message: ----------- Optimize the default file container metadata access: add a cache Modified Paths: -------------- trunk/src/containers/file.class.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-06-15 20:31:43 UTC (rev 593) +++ trunk/src/containers/file.class.php 2006-06-15 20:51:12 UTC (rev 594) @@ -31,7 +31,8 @@ { var $_users = array("nickid" => array(), "timestamp" => array()); - + var $_meta = array(); + function pfcContainer_File(&$config) { pfcContainer::pfcContainer(&$config); @@ -571,22 +572,25 @@ */ function getMeta($key, $type, $subtype = NULL) { - $c =& $this->c; - // encode parameters $enc_key = $this->_encode($key); $enc_type = $this->_encode($type); - $enc_subtype = ($subtype == NULL) ? "" : $this->_encode($subtype); - + $enc_subtype = ($subtype == NULL) ? "NULL" : $this->_encode($subtype); + if (isset($this->_meta[$enc_type][$enc_subtype][$enc_key])) + return $this->_meta[$enc_type][$enc_subtype][$enc_key]; + // read data from metadata file + $c =& $this->c; $dir_base = $c->container_cfg_meta_dir; - $dir = $dir_base."/".$enc_type.($enc_subtype == "" ? "" : "/".$enc_subtype); + $dir = $dir_base."/".$enc_type.($enc_subtype == "NULL" ? "" : "/".$enc_subtype); $filename = $dir."/".$enc_key; $ret = @file_get_contents($filename); - if ($ret == false) - return NULL; - else - return $ret; + if ($ret == false) $ret = NULL; + + // store the result in the cache + $this->_meta[$enc_type][$enc_subtype][$enc_key] = $ret; + + return $ret; } /** @@ -600,21 +604,24 @@ */ function setMeta($value, $key, $type, $subtype = NULL) { - $c =& $this->c; - // encode parameters $enc_key = $this->_encode($key); $enc_type = $this->_encode($type); - $enc_subtype = ($subtype == NULL) ? "" : $this->_encode($subtype); - + $enc_subtype = ($subtype == NULL) ? "NULL" : $this->_encode($subtype); + // create directories + $c =& $this->c; $dir_base = $c->container_cfg_meta_dir; - $dir = $dir_base."/".$enc_type.($enc_subtype == "" ? "" : "/".$enc_subtype); + $dir = $dir_base."/".$enc_type.($enc_subtype == "NULL" ? "" : "/".$enc_subtype); if (!is_dir($dir)) mkdir_r($dir); // create or replace metadata file $filename = $dir."/".$enc_key; $ret = @file_put_contents($filename, $value); + + // store the value in the cache + if ($ret) $this->_meta[$enc_type][$enc_subtype][$enc_key] = $value; + if ($ret == false) return false; else @@ -634,24 +641,30 @@ $c =& $this->c; // encode parameters - $enc_key = ($key == NULL) ? "" : $this->_encode($key); + $enc_key = ($key == NULL) ? "NULL" : $this->_encode($key); $enc_type = $this->_encode($type); - $enc_subtype = ($subtype == NULL) ? "" : $this->_encode($subtype); + $enc_subtype = ($subtype == NULL) ? "NULL" : $this->_encode($subtype); // rm data from metadata file $dir_base = $c->container_cfg_meta_dir; - $dir = $dir_base."/".$enc_type.($enc_subtype == "" ? "" : "/".$enc_subtype); + $dir = $dir_base."/".$enc_type.($enc_subtype == "NULL" ? "" : "/".$enc_subtype); $ret = true; - if ($enc_key == "") + if ($enc_key == "NULL") { // remove all keys (the complete directory) @rm_r($dir); + + // remove the cached data + unset($this->_meta[$enc_type][$enc_subtype]); } else { // just remove one key $filename = $dir."/".$enc_key; $ret = @unlink($filename); + + // remove the cached data + unset($this->_meta[$enc_type][$enc_subtype][$enc_key]); } return $ret; @@ -666,7 +679,11 @@ $c =& $this->c; // remove the created files and directories $dir = $c->container_cfg_server_dir; - rm_r($dir); + @rm_r($dir); + // empty the cache + $this->_meta = array(); + $this->_users = array("nickid" => array(), + "timestamp" => array()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-15 20:31:51
|
Revision: 593 Author: kerphi Date: 2006-06-15 13:31:43 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=593&view=rev Log Message: ----------- The "xxxx quit (timeout)" notification was broken Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php trunk/src/commands/update.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-06-15 20:21:26 UTC (rev 592) +++ trunk/src/commands/getonlinenick.class.php 2006-06-15 20:31:43 UTC (rev 593) @@ -11,10 +11,10 @@ // take care to disconnect timeouted users on this channel $disconnected_users = $container->removeObsoleteNick($recipient,$c->timeout); - foreach ($disconnected_users["nickid"] as $nid) + foreach ($disconnected_users["nick"] as $n) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$container->getNickname($nid)), $sender, $recipient, $recipientid, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)", $n), $sender, $recipient, $recipientid, 2); } // get the cached nickname list Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-06-15 20:21:26 UTC (rev 592) +++ trunk/src/commands/update.class.php 2006-06-15 20:31:43 UTC (rev 593) @@ -11,19 +11,7 @@ // do not update if user isn't active (didn't connect) if ($u->active) - { - $container =& $c->getContainerInstance(); - - // take care to disconnect timeouted users on the server - $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); - // if whould be possible to echo these disconnected users on a server tab - // server tab is not yet available so I just commente the code - // foreach ($disconnected_users as $u) - // { - // $cmd =& pfcCommand::Factory("notice"); - // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); - // } - + { // update the user nickname timestamp $cmd =& pfcCommand::Factory("updatemynick"); foreach( $u->channels as $id => $chan ) @@ -46,6 +34,17 @@ foreach( $u->privmsg as $id => $pv ) $cmd->run($xml_reponse, $clientid, $param, $sender, $pv["recipient"], $id); + // take care to disconnect timeouted users on the server + $container =& $c->getContainerInstance(); + $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); + // if whould be possible to echo these disconnected users on a server tab + // server tab is not yet available so I just commente the code + // foreach ($disconnected_users as $u) + // { + // $cmd =& pfcCommand::Factory("notice"); + // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); + // } + $xml_reponse->addScript("pfc.handleResponse('update', 'ok', '');"); } else Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-06-15 20:21:26 UTC (rev 592) +++ trunk/src/containers/file.class.php 2006-06-15 20:31:43 UTC (rev 593) @@ -334,6 +334,7 @@ $f_time = filemtime($nick_dir."/".$file); if (time() > ($f_time+$timeout/1000) ) // user will be disconnected after 'timeout' secondes of inactivity { + $deleted_user["nick"][] = $this->getNickname($file); $deleted_user["nickid"][] = $file; $deleted_user["timestamp"][] = $f_time; @unlink($nick_dir."/".$file); // disconnect expired user This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |