phpfreechat-svn Mailing List for phpFreeChat (Page 31)
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-05-28 11:54:05
|
Revision: 517 Author: kerphi Date: 2006-05-28 04:53:48 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=517&view=rev Log Message: ----------- New commands : /ban, /banlist, /unban (with a first basic implementation) Modified Paths: -------------- trunk/src/commands/join.class.php trunk/src/commands/kick.class.php trunk/src/proxys/auth.class.php trunk/themes/default/templates/pfcclient.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Added Paths: ----------- trunk/src/commands/ban.class.php trunk/src/commands/banlist.class.php trunk/src/commands/unban.class.php Added: trunk/src/commands/ban.class.php =================================================================== --- trunk/src/commands/ban.class.php (rev 0) +++ trunk/src/commands/ban.class.php 2006-05-28 11:53:48 UTC (rev 517) @@ -0,0 +1,36 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_ban extends pfcCommand +{ + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + + $container =& $c->getContainerInstance(); + $nickid = $container->getNickId($param); + if ($nickid != "undefined") + { + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $nickid); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + if (!isset($cmdtoplay["leave"])) $cmdtoplay["leave"] = array(); + $cmdtoplay["leave"][] = $recipientid; // ban the user from the current channel //_pfc("banished by %s", $sender); + $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $nickid); + } + + // update the recipient banlist + $banlist = $container->getMeta("banlist_nickid", "channel", $recipientid); + if ($banlist == NULL) + $banlist = array(); + else + $banlist = unserialize($banlist); + $banlist[] = $nickid; // append the nickid to the banlist + $container->setMeta(serialize($banlist), "banlist_nickid", "channel", $recipientid); + } +} + +?> \ No newline at end of file Added: trunk/src/commands/banlist.class.php =================================================================== --- trunk/src/commands/banlist.class.php (rev 0) +++ trunk/src/commands/banlist.class.php 2006-05-28 11:53:48 UTC (rev 517) @@ -0,0 +1,41 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +/** + * This command list the banished users on the given channel + * + * @author Stephane Gully <ste...@gm...> + */ +class pfcCommand_banlist extends pfcCommand +{ + var $desc = "This command list the banished users on the given channel"; + + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + $container =& $c->getContainerInstance(); + $banlist = $container->getMeta("banlist_nickid", "channel", $recipientid); + if ($banlist == NULL) $banlist = array(); else $banlist = unserialize($banlist); + $msg = ""; + $msg .= "<p>"._pfc("The banished user's id list is:")."</p>"; + if (count($banlist)>0) + { + $msg .= "<ul>"; + foreach($banlist as $b) $msg .= "<li style=\"margin-left:50px\">".$b."</li>"; + $msg .= "</ul>"; + } + else + { + $msg .= "<p>("._pfc("Empty").")</p>"; + } + $msg .= "<p>"._pfc("'/unban {id}' command will unban the user identified by {id}")."</p>"; + $msg .= "<p>"._pfc("'/unban all' command will unban all the users on this channel")."</p>"; + + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '".addslashes($msg)."');"); + } +} + +?> \ No newline at end of file Modified: trunk/src/commands/join.class.php =================================================================== --- trunk/src/commands/join.class.php 2006-05-28 11:52:22 UTC (rev 516) +++ trunk/src/commands/join.class.php 2006-05-28 11:53:48 UTC (rev 517) @@ -10,8 +10,8 @@ $u =& $this->u; $channame = $param; - $chanrecip = "ch_".$channame; - $chanid = md5($channame); + $chanrecip = pfcCommand_join::GetRecipient($channame); + $chanid = pfcCommand_join::GetRecipientId($channame); if(!isset($u->channels[$chanid])) { @@ -42,6 +42,16 @@ // then the client will create a new tab $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', Array('".$chanid."','".addslashes($channame)."'));"); } + + function GetRecipient($channame) + { + return "ch_".$channame; + } + + function GetRecipientId($channame) + { + return md5(pfcCommand_join::GetRecipient($channame)); + } } Modified: trunk/src/commands/kick.class.php =================================================================== --- trunk/src/commands/kick.class.php 2006-05-28 11:52:22 UTC (rev 516) +++ trunk/src/commands/kick.class.php 2006-05-28 11:53:48 UTC (rev 517) @@ -18,11 +18,10 @@ $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $nickid); if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); if (!is_array($cmdtoplay)) $cmdtoplay = array(); - if (!isset($cmdtoplay["quit"])) $cmdtoplay["quit"] = array(); - $cmdtoplay["quit"][] = _pfc("kicked by %s", $sender); + if (!isset($cmdtoplay["leave"])) $cmdtoplay["leave"] = array(); + $cmdtoplay["leave"][] = $recipientid; // kick the user from the current channel //_pfc("kicked by %s", $sender); $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $nickid); } - } } Added: trunk/src/commands/unban.class.php =================================================================== --- trunk/src/commands/unban.class.php (rev 0) +++ trunk/src/commands/unban.class.php 2006-05-28 11:53:48 UTC (rev 517) @@ -0,0 +1,48 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_unban extends pfcCommand +{ + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + $container =& $c->getContainerInstance(); + + + $updated = false; + $msg = "<p>"._pfc("Nobody has been unbanished")."</p>"; + + // update the recipient banlist + $banlist = $container->getMeta("banlist_nickid", "channel", $recipientid); + if ($banlist == NULL) + $banlist = array(); + else + $banlist = unserialize($banlist); + $nb = count($banlist); + + if (in_array($param, $banlist)) + { + $banlist = array_diff($banlist, array($param)); + $container->setMeta(serialize($banlist), "banlist_nickid", "channel", $recipientid); + $updated = true; + $msg = "<p>"._pfc("%s has been unbanished", $param)."</p>"; + } + else if ($param == "all") + { + $banlist = array(); + $container->setMeta(serialize($banlist), "banlist_nickid", "channel", $recipientid); + $updated = true; + $msg = "<p>"._pfc("%s users have been unbanished", $nb)."</p>"; + } + + if ($updated) + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '".$msg."');"); + else + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ko', '".$msg."');"); + } +} + +?> \ No newline at end of file Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-05-28 11:52:22 UTC (rev 516) +++ trunk/src/proxys/auth.class.php 2006-05-28 11:53:48 UTC (rev 517) @@ -47,7 +47,25 @@ $xml_reponse->addScript("alert('not allowed to do /op');"); } } + if ($this->name == "join") + { + // check the user is not listed in the banished channel list + $container =& $c->getContainerInstance(); + $channame = $param; + $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; + } + } // on passe la main a au prochain proxy (ou a la command finale) $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-05-28 11:52:22 UTC (rev 516) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-05-28 11:53:48 UTC (rev 517) @@ -336,6 +336,10 @@ this.sendRequest("/"+param[0],param[1]); } } + else if (param[0] == "leave") + { + this.sendRequest("/"+param[0],param[1]); + } else this.sendRequest("/"+param[0],param[1]); } @@ -346,13 +350,47 @@ { if (resp == "ok") { - this.displayMsg( 'rehash', this.i18n._('Configuration has been rehashed') ); + this.displayMsg( cmd, this.i18n._('Configuration has been rehashed') ); } else if (resp == "ko") { - this.displayMsg( 'rehash', this.i18n._('A problem occurs during rehash') ); + this.displayMsg( cmd, this.i18n._('A problem occurs during rehash') ); } } + else if (cmd == "banlist") + { + if (resp == "ok" || resp == "ko") + { + this.displayMsg( cmd, param ); + } + } + else if (cmd == "unban") + { + if (resp == "ok" || resp == "ko") + { + this.displayMsg( cmd, param ); + } + } + else if (cmd == "auth") + { + if (resp == "ban") + { + alert(param); + } + } + else if (cmd == "debug") + { + if (resp == "ok" || resp == "ko") + { + this.displayMsg( cmd, param ); + } + } + else if (cmd == "clear") + { + var tabid = this.gui.getTabId(); + var container = this.gui.getChatContentFromTabId(tabid); + container.innerHTML = ""; + } else alert(cmd + "-"+resp+"-"+param); }, @@ -546,12 +584,20 @@ var tabid = this.gui.getTabId(); var container = this.gui.getChatContentFromTabId(tabid); - // create a dummy div to avoid konqueror bug when setting nickmarkers - var m = document.createElement('div'); - m.innerHTML = '<pre class="<?php echo $prefix; ?>cmd_'+cmd+'">'+msg+'</pre>'; + div = document.createElement('div'); + div.style.padding = "2px 5px 2px 5px"; + + pre = document.createElement('pre'); + Element.addClassName(pre, '<?php echo $prefix; ?>info'); + Element.addClassName(pre, '<?php echo $prefix; ?>info_'+cmd); + pre.style.border = "1px solid #555"; + pre.style.padding = "5px"; + pre.innerHTML = msg; + div.appendChild(pre); + // finaly append this to the message list - container.appendChild(m); - this.gui.scrollDown(tabid, m); + container.appendChild(div); + this.gui.scrollDown(tabid, div); }, handleComingRequest: function( cmds ) Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-05-28 11:52:22 UTC (rev 516) +++ trunk/themes/default/templates/style.css.tpl.php 2006-05-28 11:53:48 UTC (rev 517) @@ -214,7 +214,7 @@ padding: 2px; height: 18px; - border: black solid 1px; + border: 1px solid #555; color: #FC4A1F; background-color: #FFBA76; text-align: center; @@ -234,11 +234,12 @@ font-style: italic; color: #888; } -pre.<?php echo $prefix; ?>cmd_rehash, -pre.<?php echo $prefix; ?>cmd_help -{ + +/* commands info */ +pre.<?php echo $prefix; ?>info { color: #888; font-style: italic; + background-color: #EEE; } div#<?php echo $prefix; ?>colorlist { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-28 11:52:28
|
Revision: 516 Author: kerphi Date: 2006-05-28 04:52:22 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=516&view=rev Log Message: ----------- typo 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-05-28 11:51:19 UTC (rev 515) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-05-28 11:52:22 UTC (rev 516) @@ -126,7 +126,7 @@ 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 seting it in the CSS is not taken in account + // 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"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-28 11:51:24
|
Revision: 515 Author: kerphi Date: 2006-05-28 04:51:19 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=515&view=rev Log Message: ----------- remove unused functions Modified Paths: -------------- trunk/src/pfcuserconfig.class.php Modified: trunk/src/pfcuserconfig.class.php =================================================================== --- trunk/src/pfcuserconfig.class.php 2006-05-28 11:50:35 UTC (rev 514) +++ trunk/src/pfcuserconfig.class.php 2006-05-28 11:51:19 UTC (rev 515) @@ -12,8 +12,8 @@ var $timeout; var $sessionid; - var $is_init = false; // used internaly to know if the chat config is initialized - var $errors = array(); + // var $is_init = false; // used internaly to know if the chat config is initialized + // var $errors = array(); function pfcUserConfig() { @@ -71,7 +71,7 @@ } return $i; } - + /* function init() { // echo "init()<br>"; @@ -101,7 +101,9 @@ { return $this->errors; } + */ + /* function getCacheFile() { $c =& pfcGlobalConfig::Instance(); @@ -111,10 +113,12 @@ // echo "getCacheFile() = '$cachefile'<br>"; return $cachefile; } + */ /** * save the pfcUserConfig object into cache if it doesn't exists yet * else restore the old pfcConfig object */ + /* function synchronizeWithCache() { // echo "synchronizeWithCache()<br>"; @@ -144,6 +148,8 @@ $this->saveInCache(); } } + */ + function saveInCache() { // echo "saveInCache()<br>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-28 11:50:45
|
Revision: 514 Author: kerphi Date: 2006-05-28 04:50:35 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=514&view=rev Log Message: ----------- add few comments Modified Paths: -------------- trunk/src/containers/file.class.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-05-27 19:11:04 UTC (rev 513) +++ trunk/src/containers/file.class.php 2006-05-28 11:50:35 UTC (rev 514) @@ -509,7 +509,7 @@ * @param $key is the index which identify a metadata * @param $type is used to "group" some metadata * @param $subtype is used to "group" precisely some metadata, use NULL to ignore it - * @return mixed the value assigned to the key + * @return mixed the value assigned to the key, NULL if not found */ function getMeta($key, $type, $subtype = NULL) { @@ -538,6 +538,7 @@ * @param $value is the value associated to the key * @param $type is used to "group" some metadata * @param $subtype is used to "group" precisely some metadata, use NULL to ignore it + * @return true on success, false on error */ function setMeta($value, $key, $type, $subtype = NULL) { @@ -568,6 +569,7 @@ * @param $key is the key to delete, use NULL to delete all the metadata * @param $type is used to "group" some metadata * @param $subtype is used to "group" precisely some metadata, use NULL to ignore it + * @return true on success, false on error */ function rmMeta($key, $type, $subtype = NULL) { @@ -612,6 +614,7 @@ /** * Return a unique id. Each time this function is called, the last id is incremented. * used internaly + * @private */ function _requestMsgId($chan) { @@ -647,12 +650,20 @@ return $msg_id; } - + + /** + * Used to encode UTF8 strings to ASCII filenames + * @private + */ function _encode($str) { return base64_encode(urlencode($str)); } + /** + * Used to decode ASCII filenames to UTF8 strings + * @private + */ function _decode($str) { return urldecode(base64_decode($str)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-27 19:11:13
|
Revision: 513 Author: kerphi Date: 2006-05-27 12:11:04 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=513&view=rev Log Message: ----------- Implement a basic 'kick' command Modified Paths: -------------- trunk/src/commands/kick.class.php trunk/src/commands/quit.class.php Modified: trunk/src/commands/kick.class.php =================================================================== --- trunk/src/commands/kick.class.php 2006-05-27 10:33:13 UTC (rev 512) +++ trunk/src/commands/kick.class.php 2006-05-27 19:11:04 UTC (rev 513) @@ -10,38 +10,19 @@ $u =& $this->u; - - + // kicking a user just add a command to play to the aimed user metadata. $container =& $c->getContainerInstance(); $nickid = $container->getNickId($param); - if ($nickid != "undefined") { $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $nickid); if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); if (!is_array($cmdtoplay)) $cmdtoplay = array(); if (!isset($cmdtoplay["quit"])) $cmdtoplay["quit"] = array(); - $cmdtoplay["quit"][] = "dummy param"; + $cmdtoplay["quit"][] = _pfc("kicked by %s", $sender); $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $nickid); } - $xml_reponse->addScript("alert('/kick $param command -> $nickid');"); - - /* - $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); - if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); - if (!is_array($cmdtoplay)) $cmdtoplay = array(); - if (!isset($cmdtoplay["privmsg2"])) $cmdtoplay["privmsg2"] = array(); - if (!in_array($u->nick, $cmdtoplay["privmsg2"])) - { - $cmdtoplay["privmsg2"][] = $u->nick; - $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); - // $xml_reponse->addScript("alert('cmdtoplay[]=".serialize($cmdtoplay)."');"); - } - */ - - - } } Modified: trunk/src/commands/quit.class.php =================================================================== --- trunk/src/commands/quit.class.php 2006-05-27 10:33:13 UTC (rev 512) +++ trunk/src/commands/quit.class.php 2006-05-27 19:11:04 UTC (rev 513) @@ -15,20 +15,21 @@ // then remove the nickname file $container =& $c->getContainerInstance(); + $quitmsg = $param == "" ? _pfc("%s quit", $u->nick) : _pfc("%s quit (%s)", $u->nick, $param); // from the channels foreach( $u->channels as $id => $chandetail ) if ($container->removeNick($chandetail["recipient"], $u->nick)) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $chandetail["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, $quitmsg, $sender, $chandetail["recipient"], $id, 2); } // from the private messages foreach( $u->privmsg as $id => $pvdetail ) if ($container->removeNick($pvdetail["recipient"], $u->nick)) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $pvdetail["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, $quitmsg, $sender, $pvdetail["recipient"], $id, 2); } // from the server $container->removeNick(NULL, $u->nick); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-27 10:33:23
|
Revision: 512 Author: kerphi Date: 2006-05-27 03:33:13 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=512&view=rev Log Message: ----------- Bug fix: the quit command didn't works Modified Paths: -------------- trunk/src/commands/kick.class.php trunk/src/commands/quit.class.php Modified: trunk/src/commands/kick.class.php =================================================================== --- trunk/src/commands/kick.class.php 2006-05-27 10:29:54 UTC (rev 511) +++ trunk/src/commands/kick.class.php 2006-05-27 10:33:13 UTC (rev 512) @@ -9,7 +9,39 @@ $c =& $this->c; $u =& $this->u; - $xml_reponse->addScript("alert('/kick $param command');"); + + + + $container =& $c->getContainerInstance(); + $nickid = $container->getNickId($param); + + if ($nickid != "undefined") + { + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $nickid); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + if (!isset($cmdtoplay["quit"])) $cmdtoplay["quit"] = array(); + $cmdtoplay["quit"][] = "dummy param"; + $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $nickid); + } + $xml_reponse->addScript("alert('/kick $param command -> $nickid');"); + + + /* + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + if (!isset($cmdtoplay["privmsg2"])) $cmdtoplay["privmsg2"] = array(); + if (!in_array($u->nick, $cmdtoplay["privmsg2"])) + { + $cmdtoplay["privmsg2"][] = $u->nick; + $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + // $xml_reponse->addScript("alert('cmdtoplay[]=".serialize($cmdtoplay)."');"); + } + */ + + + } } Modified: trunk/src/commands/quit.class.php =================================================================== --- trunk/src/commands/quit.class.php 2006-05-27 10:29:54 UTC (rev 511) +++ trunk/src/commands/quit.class.php 2006-05-27 10:33:13 UTC (rev 512) @@ -15,18 +15,23 @@ // then remove the nickname file $container =& $c->getContainerInstance(); - foreach( $u->channels as $id => $chan ) - if ($container->removeNick($chan, $u->nick)) + + // from the channels + foreach( $u->channels as $id => $chandetail ) + if ($container->removeNick($chandetail["recipient"], $u->nick)) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $chan["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $chandetail["recipient"], $id, 2); } - foreach( $u->privmsg as $id => $pv ) - if ($container->removeNick($pv, $u->nick)) + // from the private messages + foreach( $u->privmsg as $id => $pvdetail ) + if ($container->removeNick($pvdetail["recipient"], $u->nick)) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $pv["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $pvdetail["recipient"], $id, 2); } + // from the server + $container->removeNick(NULL, $u->nick); $xml_reponse->addScript("pfc.handleResponse('quit', 'ok', '');"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-27 10:30:04
|
Revision: 511 Author: kerphi Date: 2006-05-27 03:29:54 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=511&view=rev Log Message: ----------- fix a php warning Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-05-27 10:29:24 UTC (rev 510) +++ trunk/src/pfcglobalconfig.class.php 2006-05-27 10:29:54 UTC (rev 511) @@ -136,7 +136,7 @@ $this->synchronizeWithCache(); // the nickname is not global, it must not be cached - $this->nick = $params["nick"]; + if (isset($params["nick"])) $this->nick = $params["nick"]; } function &Instance( $params = array() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-27 10:29:34
|
Revision: 510 Author: kerphi Date: 2006-05-27 03:29:24 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=510&view=rev Log Message: ----------- fix some php warnings when directories doesn't exists Modified Paths: -------------- trunk/src/containers/file.class.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-05-26 20:56:29 UTC (rev 509) +++ trunk/src/containers/file.class.php 2006-05-27 10:29:24 UTC (rev 510) @@ -185,6 +185,7 @@ $nick_dir = ($chan != NULL) ? $c->container_cfg_channel_dir."/".$this->_encode($chan)."/nicknames" : $c->container_cfg_server_dir."/nicknames"; + if (!is_dir($nick_dir)) mkdir_r($nick_dir); // update my online status file $nick_filename = $nick_dir."/".$this->_encode($nick); @@ -338,7 +339,8 @@ $nick_dir = ($chan != NULL) ? $c->container_cfg_channel_dir."/".$this->_encode($chan)."/nicknames" : $c->container_cfg_server_dir."/nicknames"; - + if (!is_dir($nick_dir)) mkdir_r($nick_dir); + $users = array(); $dir_handle = opendir($nick_dir); while (false !== ($file = readdir($dir_handle))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-26 20:56:42
|
Revision: 509 Author: kerphi Date: 2006-05-26 13:56:29 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=509&view=rev Log Message: ----------- Code refactoring : change the specific "privmsg" metadata key to a more generic "cmdtoplay" Modified Paths: -------------- trunk/src/commands/nick.class.php trunk/src/commands/update.class.php trunk/src/phpfreechat.class.php trunk/src/proxys/auth.class.php trunk/themes/default/templates/pfcclient.js.tpl.php Added Paths: ----------- trunk/src/commands/kick.class.php trunk/src/commands/op.class.php Added: trunk/src/commands/kick.class.php =================================================================== --- trunk/src/commands/kick.class.php (rev 0) +++ trunk/src/commands/kick.class.php 2006-05-26 20:56:29 UTC (rev 509) @@ -0,0 +1,16 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_kick extends pfcCommand +{ + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + $xml_reponse->addScript("alert('/kick $param command');"); + } +} + +?> \ No newline at end of file Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-05-26 20:54:59 UTC (rev 508) +++ trunk/src/commands/nick.class.php 2006-05-26 20:56:29 UTC (rev 509) @@ -130,4 +130,4 @@ } } -?> +?> \ No newline at end of file Added: trunk/src/commands/op.class.php =================================================================== --- trunk/src/commands/op.class.php (rev 0) +++ trunk/src/commands/op.class.php 2006-05-26 20:56:29 UTC (rev 509) @@ -0,0 +1,16 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_op extends pfcCommand +{ + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + $c =& $this->c; + $u =& $this->u; + + $xml_reponse->addScript("alert('op command');"); + } +} + +?> \ No newline at end of file Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-05-26 20:54:59 UTC (rev 508) +++ trunk/src/commands/update.class.php 2006-05-26 20:56:29 UTC (rev 509) @@ -23,18 +23,21 @@ // $cmd =& pfcCommand::Factory("notice"); // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); // } - - // ----- - // check if other user talk to me or not + + + // --- + // play the other commands $nickid = $container->getNickId($u->nick); - $pvnicks = $container->getMeta("privmsg", "nickname", $nickid); - if (is_string($pvnicks)) $pvnicks = unserialize($pvnicks); - if (!is_array($pvnicks)) $pvnicks = array(); - for( $i=0; $i < count($pvnicks); $i++) - $xml_reponse->addScript("pfc.handleResponse('update', 'privmsg', '".addslashes($pvnicks[$i])."');"); - $container->rmMeta("privmsg", "nickname", $nickid); - // ----- + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $nickid); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + foreach($cmdtoplay as $cmdstr => $cmdparams) + foreach($cmdparams as $cmdparam) + $xml_reponse->addScript("pfc.handleResponse('update', 'cmdtoplay', Array('".$cmdstr."','".addslashes($cmdparam)."'));"); + $container->rmMeta("cmdtoplay", "nickname", $nickid); + // --- + // update the user nickname timestamp $cmd =& pfcCommand::Factory("updatemynick"); foreach( $u->channels as $id => $chan ) Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-05-26 20:54:59 UTC (rev 508) +++ trunk/src/phpfreechat.class.php 2006-05-26 20:56:29 UTC (rev 509) @@ -343,22 +343,27 @@ { $recipient = $u->privmsg[$recipientid]["recipient"]; + + // @todo: move this code in a proxy if ($rawcmd != "update" && - $rawcmd != "leave") // do not open the pv tab when other user close the tab + $rawcmd != "leave" && // do not open the pv tab when other user close the tab + $rawcmd != "privmsg2") { // alert the other from the new pv // (warn other user that someone talk to him) $container =& $c->getContainerInstance(); - $pvs = $container->getMeta("privmsg", "nickname", $u->privmsg[$recipientid]["pvnickid"]); - if (is_string($pvs)) $pvs = unserialize($pvs); - if (!is_array($pvs)) $pvs = array(); - if (!in_array($u->nick,$pvs)) + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + if (!isset($cmdtoplay["privmsg2"])) $cmdtoplay["privmsg2"] = array(); + if (!in_array($u->nick, $cmdtoplay["privmsg2"])) { - $pvs[] = $u->nick; - // $xml_reponse->addScript("alert('pvs[]=".serialize($pvs)."');"); - $container->setMeta(serialize($pvs), "privmsg", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + $cmdtoplay["privmsg2"][] = $u->nick; + $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + // $xml_reponse->addScript("alert('cmdtoplay[]=".serialize($cmdtoplay)."');"); } } + } $cmd =& pfcCommand::Factory($rawcmd); Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-05-26 20:54:59 UTC (rev 508) +++ trunk/src/proxys/auth.class.php 2006-05-26 20:56:29 UTC (rev 509) @@ -32,10 +32,22 @@ { function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { + $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") + { + if (!in_array($u->nick, $c->admins)) + { + $xml_reponse->addScript("alert('not allowed to do /op');"); + } + } + // on passe la main a au prochain proxy (ou a la command finale) $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-05-26 20:54:59 UTC (rev 508) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-05-26 20:56:29 UTC (rev 509) @@ -322,24 +322,22 @@ if (resp == "ok") { } - else if (resp == "privmsg") + else if (resp == "cmdtoplay") { - // check if the wanted privmsg exists or not - var index = this.privmsgs.indexOf(param); - if (index == -1) + if (param[0] == "privmsg2") { - // it doesn't exists, create it in the background - this.sendRequest('/privmsg2', param); - } - else - { - var tabid = this.privmsgids[index]; - if (this.gui.getTabId() != tabid) + // 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) { - // alert user something occurs in the pv tab - // alert("todo: highlight the '"+param+"' tab (tabid="+tabid+")"); + // it doesn't exists, create it in the background + this.sendRequest("/"+param[0],param[1]); } } + else + this.sendRequest("/"+param[0],param[1]); } // else // alert(cmd + "-"+resp+"-"+param); @@ -649,7 +647,7 @@ { var recipientid = this.gui.getTabId(); var req = cmd+" "+this.clientid+" "+(recipientid==''?'0':recipientid)+(param?" "+param : ""); - if (cmd != "/update") alert(req); + <?php if ($debug) { ?> if (cmd != "/update") alert(req);<?php } ?> return <?php echo $prefix; ?>handleRequest(req); }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-26 20:55:08
|
Revision: 508 Author: kerphi Date: 2006-05-26 13:54:59 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=508&view=rev Log Message: ----------- Adapte the code to the new container data model Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-05-26 14:32:01 UTC (rev 507) +++ trunk/src/commands/getonlinenick.class.php 2006-05-26 20:54:59 UTC (rev 508) @@ -27,7 +27,11 @@ // check if the nickname list must be updated if ($oldnicklist != $users) { - if ($c->debug) pxlog("/getonlinenick (nicklist updated - nicklist=".implode(",",$users).")", "chat", $c->getId()); + if ($c->debug) + { + $nicklist = array(); foreach($users as $u) $nicklist[] = $u["nick"]; $nicklist = implode(",",$nicklist); + pxlog("/getonlinenick (nicklist updated - nicklist=".$nicklist.")", "chat", $c->getId()); + } $_SESSION[$nicklist_sid] = $users; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-26 14:32:21
|
Revision: 507 Author: kerphi Date: 2006-05-26 07:32:01 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=507&view=rev Log Message: ----------- Change the directory and file creation rights to 0700 (thanks to Thomas Lu?\195?\159nig for the notice) Modified Paths: -------------- branches/0.x/src/pfctools.php branches/0.x/src/phpfreechatcontainerfile.class.php trunk/src/containers/file.class.php trunk/src/pfctools.php Modified: branches/0.x/src/pfctools.php =================================================================== --- branches/0.x/src/pfctools.php 2006-05-25 11:47:21 UTC (rev 506) +++ branches/0.x/src/pfctools.php 2006-05-26 14:32:01 UTC (rev 507) @@ -103,7 +103,7 @@ } -function mkdir_r($path, $mode = 0777) +function mkdir_r($path, $mode = 0700) { // This function creates the specified directory using mkdir(). Note // that the recursive feature on mkdir() is broken with PHP 5.0.4 for @@ -128,7 +128,7 @@ * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ -function copyr($source, $dest, $mode = 0777) +function copyr($source, $dest, $mode = 0700) { // Simple copy for a file if (is_file($source)) { Modified: branches/0.x/src/phpfreechatcontainerfile.class.php =================================================================== --- branches/0.x/src/phpfreechatcontainerfile.class.php 2006-05-25 11:47:21 UTC (rev 506) +++ branches/0.x/src/phpfreechatcontainerfile.class.php 2006-05-26 14:32:01 UTC (rev 507) @@ -78,7 +78,7 @@ if ($ok && !file_exists($c->container_cfg_data_file)) { @touch($c->container_cfg_data_file); - @chmod($c->container_cfg_data_file, 0777); + @chmod($c->container_cfg_data_file, 0700); } if ($ok && !file_exists($c->container_cfg_data_file)) { @@ -113,7 +113,7 @@ if ($ok && !file_exists($c->container_cfg_index_file)) { @touch($c->container_cfg_index_file); - @chmod($c->container_cfg_index_file, 0777); + @chmod($c->container_cfg_index_file, 0700); } if ($ok && !file_exists($c->container_cfg_index_file)) { @@ -168,7 +168,7 @@ $my_filename = $c->container_cfg_nickname_dir."/".$this->_encode($c->nick); if (file_exists($my_filename)) $there = true; touch($my_filename); - @chmod($my_filename, 0777); + @chmod($my_filename, 0700); return $there; } Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-05-25 11:47:21 UTC (rev 506) +++ trunk/src/containers/file.class.php 2006-05-26 14:32:01 UTC (rev 507) @@ -190,7 +190,7 @@ $nick_filename = $nick_dir."/".$this->_encode($nick); if (file_exists($nick_filename)) $there = true; @touch($nick_filename); - @chmod($nick_filename, 0777); + @chmod($nick_filename, 0700); // append the nickname to the cache list $_chan = ($chan == NULL) ? "SERVER" : $chan; Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-05-25 11:47:21 UTC (rev 506) +++ trunk/src/pfctools.php 2006-05-26 14:32:01 UTC (rev 507) @@ -103,7 +103,7 @@ } -function mkdir_r($path, $mode = 0777) +function mkdir_r($path, $mode = 0700) { // This function creates the specified directory using mkdir(). Note // that the recursive feature on mkdir() is broken with PHP 5.0.4 for @@ -138,7 +138,7 @@ * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ -function copyr($source, $dest, $mode = 0777) +function copyr($source, $dest, $mode = 0700) { // Simple copy for a file if (is_file($source)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-25 11:47:36
|
Revision: 506 Author: kerphi Date: 2006-05-25 04:47:21 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=506&view=rev Log Message: ----------- + Bug fix: when speaking to someone the new open tab is now open in the background (/privmsg2 command) + As for the /privmsg2 command, a new command /join2 has been created in order to supporte invitation to a channel in the future. Modified Paths: -------------- trunk/src/commands/join.class.php trunk/src/commands/privmsg.class.php trunk/src/phpfreechat.class.php trunk/themes/default/templates/pfcclient.js.tpl.php Added Paths: ----------- trunk/src/commands/join2.class.php trunk/src/commands/privmsg2.class.php Modified: trunk/src/commands/join.class.php =================================================================== --- trunk/src/commands/join.class.php 2006-05-25 11:45:57 UTC (rev 505) +++ trunk/src/commands/join.class.php 2006-05-25 11:47:21 UTC (rev 506) @@ -40,7 +40,7 @@ // return ok to the client // then the client will create a new tab - $xml_reponse->addScript("pfc.handleResponse('join', 'ok', Array('".$chanid."','".addslashes($channame)."'));"); + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', Array('".$chanid."','".addslashes($channame)."'));"); } } Added: trunk/src/commands/join2.class.php =================================================================== --- trunk/src/commands/join2.class.php (rev 0) +++ trunk/src/commands/join2.class.php 2006-05-25 11:47:21 UTC (rev 506) @@ -0,0 +1,34 @@ +<?php +/** + * join2.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__)."/join.class.php"); + +/** + * Same as join command but open the tab in the background + * + * @author Stephane Gully <ste...@gm...> + */ +class pfcCommand_join2 extends pfcCommand_join +{ +} + +?> \ No newline at end of file Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2006-05-25 11:45:57 UTC (rev 505) +++ trunk/src/commands/privmsg.class.php 2006-05-25 11:47:21 UTC (rev 506) @@ -8,7 +8,7 @@ { $c =& $this->c; $u =& $this->u; - + $pvname = $param; // check the pvname exists on the server @@ -19,7 +19,7 @@ // error: can't speak to myself if ($pvnickid == $nickid) { - $xml_reponse->addScript("pfc.handleResponse('privmsg', 'ko', Array('".addslashes($pvname)."','speak to myself'));"); + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ko', Array('".addslashes($pvname)."','speak to myself'));"); return; } @@ -39,7 +39,7 @@ $u->saveInCache(); } - $xml_reponse->addScript("pfc.handleResponse('privmsg', 'unknown', Array('".addslashes($pvname)."','speak to unknown'));"); + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'unknown', Array('".addslashes($pvname)."','speak to unknown'));"); return; } @@ -73,7 +73,7 @@ // return ok to the client // then the client will create a new tab - $xml_reponse->addScript("pfc.handleResponse('privmsg', 'ok', Array('".$pvrecipientid."','".addslashes($pvname)."'));"); + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', Array('".$pvrecipientid."','".addslashes($pvname)."'));"); } } Added: trunk/src/commands/privmsg2.class.php =================================================================== --- trunk/src/commands/privmsg2.class.php (rev 0) +++ trunk/src/commands/privmsg2.class.php 2006-05-25 11:47:21 UTC (rev 506) @@ -0,0 +1,34 @@ +<?php +/** + * privmsg2.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__)."/privmsg.class.php"); + +/** + * Same as privmsg command but open the tab in the background + * + * @author Stephane Gully <ste...@gm...> + */ +class pfcCommand_privmsg2 extends pfcCommand_privmsg +{ +} + +?> \ No newline at end of file Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-05-25 11:45:57 UTC (rev 505) +++ trunk/src/phpfreechat.class.php 2006-05-25 11:47:21 UTC (rev 506) @@ -315,7 +315,7 @@ $sender = ""; //if (preg_match("/^\/([a-z]*) ([0-9a-f]*) ([0-9a-f]*)( (.*)|)/", $request, $res)) //if (preg_match("/^\/([a-z]+) ([0-9a-f]+) ([0-9a-f]+) (.*)/", $request, $res)) - if (preg_match("/^\/([a-z]+) ([0-9a-f]+) ([0-9a-f]+)( (.*)|)/", $request, $res)) + if (preg_match("/^\/([a-z0-9]+) ([0-9a-f]+) ([0-9a-f]+)( (.*)|)/", $request, $res)) { $rawcmd = isset($res[1]) ? $res[1] : ""; Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-05-25 11:45:57 UTC (rev 505) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-05-25 11:47:21 UTC (rev 506) @@ -14,8 +14,10 @@ this.nickname = '<?php echo $u->nick; ?>'; + /* this.channels = Array(); this.channelids = Array(); + */ this.privmsgs = Array(); this.privmsgids = Array(); @@ -203,6 +205,22 @@ else alert(cmd + "-"+resp+"-"+param); } + else if (cmd == "join2") + { + if (resp =="ok") + { + // create the new channel + var tabid = param[0]; + var name = param[1]; + this.gui.createTab(name, tabid, "ch"); + // do not switch to the new created tab + // keep it in the background + // this.gui.setTabById(tabid); + alert("ccc"); + } + else + alert(cmd + "-"+resp+"-"+param); + } else if (cmd == "leave") { //alert(cmd + "-"+resp+"-"+param); @@ -213,11 +231,13 @@ this.gui.removeTabById(tabid); // synchronize the channel client arrays + /* var index = -1; index = this.channelids.indexOf(tabid); this.channelids = this.channelids.without(tabid); this.channels = this.channels.without(this.channels[index]); - + */ + // synchronize the privmsg client arrays index = -1; index = this.privmsgids.indexOf(tabid); @@ -247,6 +267,28 @@ else alert(cmd + "-"+resp+"-"+param); } + else if (cmd == "privmsg2") + { + if (resp == "ok") + { + // create the new channel + var tabid = param[0]; + var name = param[1]; + this.gui.createTab(name, tabid, "pv"); + // do not switch to the new created tab + // keep it in the background + // this.gui.setTabById(tabid); + + this.privmsgs.push(name); + this.privmsgids.push(tabid); + } + else if (resp == "unknown") + { + // speak to unknown user + } + else + alert(cmd + "-"+resp+"-"+param); + } else if (cmd == "nick") { if (resp == "connected") @@ -286,8 +328,8 @@ var index = this.privmsgs.indexOf(param); if (index == -1) { - // it doesn't exists, create it - this.sendRequest('/privmsg', param); + // it doesn't exists, create it in the background + this.sendRequest('/privmsg2', param); } else { @@ -355,7 +397,7 @@ { var w = this.el_words; var wval = w.value; - re = new RegExp("^(\/[a-z]+)( (.*)|)"); + re = new RegExp("^(\/[a-z0-9]+)( (.*)|)"); if (wval.match(re)) { /* a user command */ @@ -607,7 +649,7 @@ { var recipientid = this.gui.getTabId(); var req = cmd+" "+this.clientid+" "+(recipientid==''?'0':recipientid)+(param?" "+param : ""); - // if (cmd != "/update") alert(req); + if (cmd != "/update") alert(req); return <?php echo $prefix; ?>handleRequest(req); }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-25 11:46:19
|
Revision: 505 Author: kerphi Date: 2006-05-25 04:45:57 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=505&view=rev Log Message: ----------- correct the <input> tag which contains the nickname value 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-05-25 11:44:58 UTC (rev 504) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-05-25 11:45:57 UTC (rev 505) @@ -13,7 +13,7 @@ <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> - <input id="<?php echo $prefix; ?>handle" type="button" title="<?php echo _pfc("Enter your nickname here"); ?>" maxlength="<?php echo $max_nick_len; ?>" value="<?php echo $nick; ?>" onclick="pfc.askNick('');" /> + <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> <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/clock-on.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>clock" onclick="pfc.clock_swap()" /></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-25 11:45:15
|
Revision: 504 Author: kerphi Date: 2006-05-25 04:44:58 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=504&view=rev Log Message: ----------- add a grey shade background for the default theme Modified Paths: -------------- trunk/themes/default/templates/style.css.tpl.php Added Paths: ----------- trunk/themes/default/images/shade.gif Added: trunk/themes/default/images/shade.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/default/images/shade.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-05-25 11:44:26 UTC (rev 503) +++ trunk/themes/default/templates/style.css.tpl.php 2006-05-25 11:44:58 UTC (rev 504) @@ -8,9 +8,12 @@ <?php if ($width!="") { ?>width: <?php echo $width; ?>;<?php } ?> border: 1px solid #555; color: #000; - background-color: #FFF; padding: 10px; min-height: 20px; + background-color: #FFF; + background-image: url(<?php echo $c->getFileUrlFromTheme('images/shade.gif'); ?>); + background-position: right; + background-repeat: repeat-y; } #<?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-05-25 11:44:38
|
Revision: 503 Author: kerphi Date: 2006-05-25 04:44:26 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=503&view=rev Log Message: ----------- Hide the created content when a new tab is created in order to be hidden when a background tab is created 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-05-24 15:48:55 UTC (rev 502) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-05-25 11:44:26 UTC (rev 503) @@ -232,7 +232,7 @@ li_div.appendChild(a2); var div_content = document.createElement('div'); - //div_content.style.display = 'none'; + div_content.style.display = 'none'; div_content.setAttribute('id', '<?php echo $prefix; ?>channel_content'+tabid); Element.addClassName(div_content, '<?php echo $prefix; ?>content'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-24 15:49:18
|
Revision: 502 Author: kerphi Date: 2006-05-24 08:48:55 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=502&view=rev Log Message: ----------- Replace the green default theme by a simple black/grey/white theme. Modified Paths: -------------- trunk/demo/index.php trunk/misc/tabs.svg trunk/themes/default/images/ch-active.gif trunk/themes/default/images/ch.gif trunk/themes/default/images/pv-active.gif trunk/themes/default/images/pv.gif trunk/themes/default/templates/style.css.tpl.php Added Paths: ----------- trunk/themes/green/ trunk/themes/green/images/ trunk/themes/green/images/ch-active.gif trunk/themes/green/images/ch.gif trunk/themes/green/images/pv-active.gif trunk/themes/green/images/pv.gif trunk/themes/green/images/shade.gif trunk/themes/green/templates/ trunk/themes/green/templates/style.css.tpl.php Removed Paths: ------------- trunk/themes/default/images/shade.gif Modified: trunk/demo/index.php =================================================================== --- trunk/demo/index.php 2006-05-23 21:16:00 UTC (rev 501) +++ trunk/demo/index.php 2006-05-24 15:48:55 UTC (rev 502) @@ -82,6 +82,7 @@ <li><a href="demo18_phpbb2_smiley_theme.php">demo18 - A chat with a customized smiley theme (phpbb2 theme)</a></li> <li><a href="demo28_blune_theme.php">demo28 - use a customized theme (blune theme)</a></li> <li><a href="demo28_mini_blune_theme.php">demo28 - use a customized theme (blune theme) - mini</a></li> + <li><a href="demo44_green_theme.php">demo44 - use a customized theme (green)</a></li> </ul> <h2>Translations</h2> Modified: trunk/misc/tabs.svg =================================================================== --- trunk/misc/tabs.svg 2006-05-23 21:16:00 UTC (rev 501) +++ trunk/misc/tabs.svg 2006-05-24 15:48:55 UTC (rev 502) @@ -14,11 +14,22 @@ id="svg2" sodipodi:version="0.32" inkscape:version="0.43" - sodipodi:docbase="/home/kerphi/public_html/pfc-1.x/misc" + sodipodi:docbase="D:\www\pfc\trunk\misc" sodipodi:docname="tabs.svg"> <defs id="defs4"> <linearGradient + id="linearGradient2373"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop2375" /> + <stop + style="stop-color:#a3a3a3;stop-opacity:1;" + offset="1" + id="stop2377" /> + </linearGradient> + <linearGradient id="linearGradient4008"> <stop style="stop-color:#fdfdf2;stop-opacity:1;" @@ -161,6 +172,136 @@ y1="390.89087" x2="487.51208" y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2207" + id="linearGradient2359" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.433136,0.433136,-0.433136,0.433136,-280.3086,109.3019)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2207" + id="linearGradient2361" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-163.1934,-126.4271)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2207" + id="linearGradient2363" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-180.0754,165.0014)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2368" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-564.465,-124.8455)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2371" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.433136,0.433136,-0.433136,0.433136,-681.5802,110.8835)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2392" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-564.465,-124.8455)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2421" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.433136,0.433136,-0.433136,0.433136,-681.5802,110.8835)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2423" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-564.465,-124.8455)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2425" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-564.465,-124.8455)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2432" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.433136,0.433136,-0.433136,0.433136,-294.5944,117.2355)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2434" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-564.465,-124.8455)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2439" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-177.4792,-118.4935)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2373" + id="linearGradient2444" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,-218.8038,179.9249)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> </defs> <sodipodi:namedview id="base" @@ -311,5 +452,131 @@ inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv-active.png" inkscape:export-xdpi="5.3160944" inkscape:export-ydpi="5.3160944" /> + <g + id="g2394" + inkscape:export-filename="D:\www\pfc\trunk\themes\default\images\pv.png" + inkscape:export-xdpi="4.8899999" + inkscape:export-ydpi="4.8899999"> + <path + style="fill:url(#linearGradient2371);fill-opacity:1.0;fill-rule:nonzero;stroke:#666666;stroke-width:7.60999441;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M -706.64028,381.29665 C -755.79255,381.91999 -795.28735,402.07196 -795.28735,426.79743 C -795.28736,450.48607 -759.03162,469.94746 -712.76577,472.08764 C -711.5269,474.92662 -710.18901,477.86326 -708.74591,480.87385 C -694.35859,510.88894 -643.68509,515.46035 -667.91582,507.73022 C -678.58721,504.32582 -687.32044,488.57099 -693.73851,471.99192 C -648.46195,469.37723 -613.28426,450.13292 -613.28426,426.79743 C -613.28426,401.67949 -654.04994,381.29665 -704.28582,381.29665 C -705.07075,381.29665 -705.8601,381.28676 -706.64028,381.29665 z " + id="path2325" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/ch.png" + inkscape:export-xdpi="5.1439257" + inkscape:export-ydpi="5.1439257" /> + <g + id="g2379"> + <path + inkscape:export-ydpi="5.3160944" + inkscape:export-xdpi="5.3160944" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + id="path2327" + d="M -605.37629,316.61129 C -685.61869,317.62891 -750.09504,350.52754 -750.09504,390.89254 C -750.09505,429.5649 -690.90657,461.33615 -615.3763,464.83005 C -613.35382,469.46477 -611.16968,474.2589 -608.81379,479.17379 C -585.3261,528.17424 -502.60023,535.63717 -542.15755,523.01754 C -559.57889,517.45976 -573.83612,491.73956 -584.3138,464.67379 C -510.39858,460.40523 -452.97004,428.98837 -452.97005,390.89254 C -452.97005,349.88683 -519.52112,316.61128 -601.53255,316.61129 C -602.81398,316.61129 -604.10261,316.59514 -605.37629,316.61129 z " + style="fill:url(#linearGradient2368);fill-opacity:1.0;fill-rule:nonzero;stroke:#666666;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" /> + <path + inkscape:export-ydpi="5.3160944" + inkscape:export-xdpi="5.3160944" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + d="M -717.86897,356.76009 C -713.4386,344.93948 -705.0037,344.90385 -693.8444,345.49446 C -679.53732,352.32521 -666.69445,361.49313 -651.47797,365.69273 C -638.00266,345.13599 -643.57712,345.172 -611.61456,366.24731 C -597.29959,379.22393 -625.57195,376.10051 -610.56317,346.84142 C -598.77562,335.00599 -540.37155,382.45846 -586.64626,352.7192 C -562.81283,347.32201 -572.8903,341.64616 -540.11896,362.86664 C -567.36245,347.36263 -550.4428,359.66787 -525.86952,353.31012 C -522.4794,349.49979 -517.88461,349.19974 -513.47434,347.72106 L -492.11576,364.23736 C -496.01745,365.37998 -500.60435,364.4674 -503.60786,368.50038 C -528.0149,376.24503 -543.3093,369.20965 -564.91145,352.26777 C -559.6961,355.28903 -535.00935,364.87356 -566.18361,370.06021 C -620.02499,337.48996 -588.62005,350.69102 -587.96421,360.77361 C -601.70606,387.6147 -616.51574,375.68722 -636.24232,355.15129 C -620.74663,364.54262 -612.44107,363.99163 -630.20142,382.14908 C -646.03133,379.27055 -659.13446,370.53515 -673.22866,362.40885 C -682.83694,361.01185 -690.26831,359.59791 -693.5596,370.12428 L -717.86897,356.76009 z " + id="path2329" + style="fill:#6e6e6e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + inkscape:export-ydpi="5.3160944" + inkscape:export-xdpi="5.3160944" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + d="M -689.29754,405.33152 C -679.96339,381.632 -684.5537,380.75175 -654.20035,399.7503 C -622.63045,436.03316 -694.75714,381.99485 -636.26165,418.63665 C -630.16841,422.45347 -648.3879,410.90768 -654.45102,407.04319 C -642.98328,411.92392 -637.2031,406.4331 -629.03688,398.97433 C -609.07599,406.93419 -569.76221,442.48393 -604.89354,417.35983 C -590.8756,415.03512 -587.03064,399.74415 -581.45584,388.32499 C -569.63718,389.84924 -510.8015,435.43773 -557.53221,405.14176 C -544.3356,409.47532 -538.02309,403.15192 -530.26723,393.56146 C -475.67278,427.89325 -515.65161,400.8094 -515.93377,400.60321 L -495.0048,417.41385 C -509.5531,409.77026 -556.87031,382.21846 -507.91522,409.50041 C -515.93673,418.03048 -523.49947,425.53995 -536.89106,422.46821 C -557.33087,410.12971 -596.45972,380.76753 -558.79566,403.35213 C -565.3756,414.88215 -569.63351,430.097 -583.7568,434.10622 C -595.17942,427.94871 -657.49779,385.70885 -606.65298,414.473 C -615.13546,421.83989 -621.93485,428.23112 -633.99544,424.44525 C -661.8597,407.51316 -650.58345,425.54117 -679.29696,388.90227 C -650.90637,406.41296 -659.26861,395.57981 -664.98817,418.69571 L -689.29754,405.33152 z " + id="path2331" + style="fill:#6e6e6e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> + </g> + <g + id="g2384" + transform="translate(-41.3246,298.4184)" + inkscape:export-filename="D:\www\pfc\trunk\themes\default\images\ch.png" + inkscape:export-xdpi="5.0207553" + inkscape:export-ydpi="5.0207553"> + <path + style="fill:url(#linearGradient2392);fill-opacity:1;fill-rule:nonzero;stroke:#666666;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M -605.37629,316.61129 C -685.61869,317.62891 -750.09504,350.52754 -750.09504,390.89254 C -750.09505,429.5649 -690.90657,461.33615 -615.3763,464.83005 C -613.35382,469.46477 -611.16968,474.2589 -608.81379,479.17379 C -585.3261,528.17424 -502.60023,535.63717 -542.15755,523.01754 C -559.57889,517.45976 -573.83612,491.73956 -584.3138,464.67379 C -510.39858,460.40523 -452.97004,428.98837 -452.97005,390.89254 C -452.97005,349.88683 -519.52112,316.61128 -601.53255,316.61129 C -602.81398,316.61129 -604.10261,316.59514 -605.37629,316.61129 z " + id="path2386" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#6e6e6e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2388" + d="M -717.86897,356.76009 C -713.4386,344.93948 -705.0037,344.90385 -693.8444,345.49446 C -679.53732,352.32521 -666.69445,361.49313 -651.47797,365.69273 C -638.00266,345.13599 -643.57712,345.172 -611.61456,366.24731 C -597.29959,379.22393 -625.57195,376.10051 -610.56317,346.84142 C -598.77562,335.00599 -540.37155,382.45846 -586.64626,352.7192 C -562.81283,347.32201 -572.8903,341.64616 -540.11896,362.86664 C -567.36245,347.36263 -550.4428,359.66787 -525.86952,353.31012 C -522.4794,349.49979 -517.88461,349.19974 -513.47434,347.72106 L -492.11576,364.23736 C -496.01745,365.37998 -500.60435,364.4674 -503.60786,368.50038 C -528.0149,376.24503 -543.3093,369.20965 -564.91145,352.26777 C -559.6961,355.28903 -535.00935,364.87356 -566.18361,370.06021 C -620.02499,337.48996 -588.62005,350.69102 -587.96421,360.77361 C -601.70606,387.6147 -616.51574,375.68722 -636.24232,355.15129 C -620.74663,364.54262 -612.44107,363.99163 -630.20142,382.14908 C -646.03133,379.27055 -659.13446,370.53515 -673.22866,362.40885 C -682.83694,361.01185 -690.26831,359.59791 -693.5596,370.12428 L -717.86897,356.76009 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#6e6e6e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2390" + d="M -689.29754,405.33152 C -679.96339,381.632 -684.5537,380.75175 -654.20035,399.7503 C -622.63045,436.03316 -694.75714,381.99485 -636.26165,418.63665 C -630.16841,422.45347 -648.3879,410.90768 -654.45102,407.04319 C -642.98328,411.92392 -637.2031,406.4331 -629.03688,398.97433 C -609.07599,406.93419 -569.76221,442.48393 -604.89354,417.35983 C -590.8756,415.03512 -587.03064,399.74415 -581.45584,388.32499 C -569.63718,389.84924 -510.8015,435.43773 -557.53221,405.14176 C -544.3356,409.47532 -538.02309,403.15192 -530.26723,393.56146 C -475.67278,427.89325 -515.65161,400.8094 -515.93377,400.60321 L -495.0048,417.41385 C -509.5531,409.77026 -556.87031,382.21846 -507.91522,409.50041 C -515.93673,418.03048 -523.49947,425.53995 -536.89106,422.46821 C -557.33087,410.12971 -596.45972,380.76753 -558.79566,403.35213 C -565.3756,414.88215 -569.63351,430.097 -583.7568,434.10622 C -595.17942,427.94871 -657.49779,385.70885 -606.65298,414.473 C -615.13546,421.83989 -621.93485,428.23112 -633.99544,424.44525 C -661.8597,407.51316 -650.58345,425.54117 -679.29696,388.90227 C -650.90637,406.41296 -659.26861,395.57981 -664.98817,418.69571 L -689.29754,405.33152 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + </g> + <g + id="g2446" + inkscape:export-filename="D:\www\pfc\trunk\themes\default\images\pv-active.png" + inkscape:export-xdpi="4.8867297" + inkscape:export-ydpi="4.8867297"> + <path + style="fill:url(#linearGradient2432);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.60999441;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M -319.65448,387.64868 C -368.80675,388.27202 -408.30155,408.42399 -408.30155,433.14946 C -408.30156,456.8381 -372.04582,476.29949 -325.77997,478.43967 C -324.5411,481.27865 -323.20321,484.21529 -321.76011,487.22588 C -307.37279,517.24097 -256.69929,521.81238 -280.93002,514.08225 C -291.60141,510.67785 -300.33464,494.92302 -306.75271,478.34395 C -261.47615,475.72926 -226.29846,456.48495 -226.29846,433.14946 C -226.29846,408.03152 -267.06414,387.64868 -317.30002,387.64868 C -318.08495,387.64868 -318.8743,387.63879 -319.65448,387.64868 z " + id="path2403" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/ch.png" + inkscape:export-xdpi="5.1439257" + inkscape:export-ydpi="5.1439257" /> + <path + style="fill:url(#linearGradient2439);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M -218.39049,322.96332 C -298.63289,323.98094 -363.10924,356.87957 -363.10924,397.24457 C -363.10925,435.91693 -303.92077,467.68818 -228.3905,471.18208 C -226.36802,475.8168 -224.18388,480.61093 -221.82799,485.52582 C -198.3403,534.52627 -115.61443,541.9892 -155.17175,529.36957 C -172.59309,523.81179 -186.85032,498.09159 -197.328,471.02582 C -123.41278,466.75726 -65.98424,435.3404 -65.98425,397.24457 C -65.98425,356.23886 -132.53532,322.96331 -214.54675,322.96332 C -215.82818,322.96332 -217.11681,322.94717 -218.39049,322.96332 z " + id="path2407" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2409" + d="M -330.88317,363.11212 C -326.4528,351.29151 -318.0179,351.25588 -306.8586,351.84649 C -292.55152,358.67724 -279.70865,367.84516 -264.49217,372.04476 C -251.01686,351.48802 -256.59132,351.52403 -224.62876,372.59934 C -210.31379,385.57596 -238.58615,382.45254 -223.57737,353.19345 C -211.78982,341.35802 -153.38575,388.81049 -199.66046,359.07123 C -175.82703,353.67404 -185.9045,347.99819 -153.13316,369.21867 C -180.37665,353.71466 -163.457,366.0199 -138.88372,359.66215 C -135.4936,355.85182 -130.89881,355.55177 -126.48854,354.07309 L -105.12996,370.58939 C -109.03165,371.73201 -113.61855,370.81943 -116.62206,374.85241 C -141.0291,382.59706 -156.3235,375.56168 -177.92565,358.6198 C -172.7103,361.64106 -148.02355,371.22559 -179.19781,376.41224 C -233.03919,343.84199 -201.63425,357.04305 -200.97841,367.12564 C -214.72026,393.96673 -229.52994,382.03925 -249.25652,361.50332 C -233.76083,370.89465 -225.45527,370.34366 -243.21562,388.50111 C -259.04553,385.62258 -272.14866,376.88718 -286.24286,368.76088 C -295.85114,367.36388 -303.28251,365.94994 -306.5738,376.47631 L -330.88317,363.11212 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2411" + d="M -302.31174,411.68355 C -292.97759,387.98403 -297.5679,387.10378 -267.21455,406.10233 C -235.64465,442.38519 -307.77134,388.34688 -249.27585,424.98868 C -243.18261,428.8055 -261.4021,417.25971 -267.46522,413.39522 C -255.99748,418.27595 -250.2173,412.78513 -242.05108,405.32636 C -222.09019,413.28622 -182.77641,448.83596 -217.90774,423.71186 C -203.8898,421.38715 -200.04484,406.09618 -194.47004,394.67702 C -182.65138,396.20127 -123.8157,441.78976 -170.54641,411.49379 C -157.3498,415.82735 -151.03729,409.50395 -143.28143,399.91349 C -88.68698,434.24528 -128.66581,407.16143 -128.94797,406.95524 L -108.019,423.76588 C -122.5673,416.12229 -169.88451,388.57049 -120.92942,415.85244 C -128.95093,424.38251 -136.51367,431.89198 -149.90526,428.82024 C -170.34507,416.48174 -209.47392,387.11956 -171.80986,409.70416 C -178.3898,421.23418 -182.64771,436.44903 -196.771,440.45825 C -208.19362,434.30074 -270.51199,392.06088 -219.66718,420.82503 C -228.14966,428.19192 -234.94905,434.58315 -247.00964,430.79728 C -274.8739,413.86519 -263.59765,431.8932 -292.31116,395.2543 C -263.92057,412.76499 -272.28281,401.93184 -278.00237,425.04774 L -302.31174,411.68355 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + </g> + <g + id="g2452" + inkscape:export-filename="D:\www\pfc\trunk\themes\default\images\ch-active.png" + inkscape:export-xdpi="5.0207553" + inkscape:export-ydpi="5.0207553"> + <path + style="fill:url(#linearGradient2444);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M -259.71509,621.38169 C -339.95749,622.39931 -404.43384,655.29794 -404.43384,695.66294 C -404.43385,734.3353 -345.24537,766.10655 -269.7151,769.60045 C -267.69262,774.23517 -265.50848,779.0293 -263.15259,783.94419 C -239.6649,832.94464 -156.93903,840.40757 -196.49635,827.78794 C -213.91769,822.23016 -228.17492,796.50996 -238.6526,769.44419 C -164.73738,765.17563 -107.30884,733.75877 -107.30885,695.66294 C -107.30885,654.65723 -173.85992,621.38168 -255.87135,621.38169 C -257.15278,621.38169 -258.44141,621.36554 -259.71509,621.38169 z " + id="path2415" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2417" + d="M -372.20777,661.53049 C -367.7774,649.70988 -359.3425,649.67425 -348.1832,650.26486 C -333.87612,657.09561 -321.03325,666.26353 -305.81677,670.46313 C -292.34146,649.90639 -297.91592,649.9424 -265.95336,671.01771 C -251.63839,683.99433 -279.91075,680.87091 -264.90197,651.61182 C -253.11442,639.77639 -194.71035,687.22886 -240.98506,657.4896 C -217.15163,652.09241 -227.2291,646.41656 -194.45776,667.63704 C -221.70125,652.13303 -204.7816,664.43827 -180.20832,658.08052 C -176.8182,654.27019 -172.22341,653.97014 -167.81314,652.49146 L -146.45456,669.00776 C -150.35625,670.15038 -154.94315,669.2378 -157.94666,673.27078 C -182.3537,681.01543 -197.6481,673.98005 -219.25025,657.03817 C -214.0349,660.05943 -189.34815,669.64396 -220.52241,674.83061 C -274.36379,642.26036 -242.95885,655.46142 -242.30301,665.54401 C -256.04486,692.3851 -270.85454,680.45762 -290.58112,659.92169 C -275.08543,669.31302 -266.77987,668.76203 -284.54022,686.91948 C -300.37013,684.04095 -313.47326,675.30555 -327.56746,667.17925 C -337.17574,665.78225 -344.60711,664.36831 -347.8984,674.89468 L -372.20777,661.53049 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2419" + d="M -343.63634,710.10192 C -334.30219,686.4024 -338.8925,685.52215 -308.53915,704.5207 C -276.96925,740.80356 -349.09594,686.76525 -290.60045,723.40705 C -284.50721,727.22387 -302.7267,715.67808 -308.78982,711.81359 C -297.32208,716.69432 -291.5419,711.2035 -283.37568,703.74473 C -263.41479,711.70459 -224.10101,747.25433 -259.23234,722.13023 C -245.2144,719.80552 -241.36944,704.51455 -235.79464,693.09539 C -223.97598,694.61964 -165.1403,740.20813 -211.87101,709.91216 C -198.6744,714.24572 -192.36189,707.92232 -184.60603,698.33186 C -130.01158,732.66365 -169.99041,705.5798 -170.27257,705.37361 L -149.3436,722.18425 C -163.8919,714.54066 -211.20911,686.98886 -162.25402,714.27081 C -170.27553,722.80088 -177.83827,730.31035 -191.22986,727.23861 C -211.66967,714.90011 -250.79852,685.53793 -213.13446,708.12253 C -219.7144,719.65255 -223.97231,734.8674 -238.0956,738.87662 C -249.51822,732.71911 -311.83659,690.47925 -260.99178,719.2434 C -269.47426,726.61029 -276.27365,733.00152 -288.33424,729.21565 C -316.1985,712.28356 -304.92225,730.31157 -333.63576,693.67267 C -305.24517,711.18336 -313.60741,700.35021 -319.32697,723.46611 L -343.63634,710.10192 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + </g> </g> </svg> Modified: trunk/themes/default/images/ch-active.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/ch.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/pv-active.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/pv.gif =================================================================== (Binary files differ) Deleted: trunk/themes/default/images/shade.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-05-23 21:16:00 UTC (rev 501) +++ trunk/themes/default/templates/style.css.tpl.php 2006-05-24 15:48:55 UTC (rev 502) @@ -7,11 +7,8 @@ div#<?php echo $prefix; ?>container { <?php if ($width!="") { ?>width: <?php echo $width; ?>;<?php } ?> border: 1px solid #555; - color: #338822; - background-color: #d9edd8; - background-image: url(<?php echo $c->getFileUrlFromTheme('images/shade.gif'); ?>); - background-position: right; - background-repeat: repeat-y; + color: #000; + background-color: #FFF; padding: 10px; min-height: 20px; } @@ -31,7 +28,7 @@ border-right: 1px solid #555; border-left: 1px solid #555; border-bottom: 1px solid #555; - background-color: #e0edde; + background-color: #FAFAFA; margin-top: 5px; } div.<?php echo $prefix; ?>content { @@ -56,16 +53,16 @@ border-right: 1px solid #555; border-left: 1px solid #555; border-bottom: 1px solid #555; - background-color: #7dc073; + background-color: #DDD; } ul#<?php echo $prefix; ?>channels_list li.selected div { - background-color: #e0edde; - border-bottom: 1px solid #e0edde; + background-color: #FAFAFA; + border-bottom: 1px solid #FAFAFA; color: #000; font-weight: bold; } ul#<?php echo $prefix; ?>channels_list li > div:hover { - background-color: #e0edde; + background-color: #FAFAFA; } ul#<?php echo $prefix; ?>channels_list li a { color: #000; @@ -102,8 +99,8 @@ height: 60%; overflow: auto; text-align: center; - border: 1px solid #000; - background-color: #EEE; + background-color: #FFF; + /* borders are drawn by the javascript routines */ } div.<?php echo $prefix; ?>online { position: absolute; @@ -111,11 +108,11 @@ top: 0; padding: 0; overflow: auto; - border: black solid 1px; - color: #000; - background-color: #DDD; width: 20%; height: 40%; + color: #000; /* colors can be overriden by js nickname colorization */ + background-color: #FFF; + /* borders are drawn by the javascript routines */ } div.<?php echo $prefix; ?>online ul { list-style-type: none; @@ -125,9 +122,9 @@ margin-right: 8px; } div.<?php echo $prefix; ?>online li { - border-bottom: 1px solid #DDD; font-weight: bold; font-size: 90%; + /* bottom borders are drawn by the javascript routines */ } h2#<?php echo $prefix; ?>title { @@ -150,7 +147,7 @@ } div.<?php echo $prefix; ?>oldmsg { - background-color: #dde4dc; + background-color: #EEE; } span.<?php echo $prefix; ?>heure, span.<?php echo $prefix; ?>date { @@ -168,7 +165,8 @@ } input#<?php echo $prefix; ?>words { - border: black solid 1px; + border: #555 solid 1px; + background-color: #FAFAFA; width: 100%; height: 1.3em; } @@ -199,10 +197,12 @@ cursor: pointer; } div.<?php echo $prefix; ?>btn img { - border: 1px solid #393; /* same as container color */ + /* doesn't work */ + /* border: 1px solid #393;*/ /* same as container color */ } div.<?php echo $prefix; ?>btn img:hover { - border: 1px solid #000; + /* doesn't work */ + /* border: 1px solid #000;*/ } p#<?php echo $prefix; ?>errors { @@ -212,7 +212,7 @@ height: 18px; border: black solid 1px; - color: #EC4A1F; + color: #FC4A1F; background-color: #FFBA76; text-align: center; font-style: italic; Added: trunk/themes/green/images/ch-active.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/green/images/ch-active.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/themes/green/images/ch.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/green/images/ch.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/themes/green/images/pv-active.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/green/images/pv-active.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/themes/green/images/pv.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/green/images/pv.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/themes/green/images/shade.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/green/images/shade.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/themes/green/templates/style.css.tpl.php =================================================================== --- trunk/themes/green/templates/style.css.tpl.php (rev 0) +++ trunk/themes/green/templates/style.css.tpl.php 2006-05-24 15:48:55 UTC (rev 502) @@ -0,0 +1,109 @@ +div#<?php echo $prefix; ?>container { + border: 1px solid #555; + color: #338822; + background-color: #d9edd8; + background-image: url(<?php echo $c->getFileUrlFromTheme('images/shade.gif'); ?>); + background-position: right; + background-repeat: repeat-y; +} + +div#<?php echo $prefix; ?>channels_content { + border-right: 1px solid #555; + border-left: 1px solid #555; + border-bottom: 1px solid #555; + background-color: #e0edde; +} + +/* channels tabpanes */ +ul#<?php echo $prefix; ?>channels_list { + border-bottom: 1px solid #555; +} +ul#<?php echo $prefix; ?>channels_list li div { + border-top: 1px solid #555; + border-right: 1px solid #555; + border-left: 1px solid #555; + border-bottom: 1px solid #555; + background-color: #7dc073; +} +ul#<?php echo $prefix; ?>channels_list li.selected div { + background-color: #e0edde; + border-bottom: 1px solid #e0edde; + color: #000; +} +ul#<?php echo $prefix; ?>channels_list li > div:hover { + background-color: #e0edde; +} +ul#<?php echo $prefix; ?>channels_list li a { + color: #000; +} + +div.<?php echo $prefix; ?>smileys { + border: 1px solid #000; + background-color: #EEE; +} +div.<?php echo $prefix; ?>online { + border: black solid 1px; + color: #000; + background-color: #DDD; +} +div.<?php echo $prefix; ?>online li { + border-bottom: 1px solid #DDD; +} + +h2#<?php echo $prefix; ?>title { + font-size: 110%; +} + +div.<?php echo $prefix; ?>oldmsg { + background-color: #dde4dc; +} + +span.<?php echo $prefix; ?>heure, span.<?php echo $prefix; ?>date { + color: #bebebe; +} + +span.<?php echo $prefix; ?>nick { + color: #fbac17; +} + +input#<?php echo $prefix; ?>words { + border: black solid 1px; +} + +input#<?php echo $prefix; ?>handle { + border: black solid 1px; + color: black; + <?php if ($nick!="") { ?>background-color: #CCC;<?php } ?> +} + +div.<?php echo $prefix; ?>btn img { + border: 1px solid #393; /* same as container color */ +} +div.<?php echo $prefix; ?>btn img:hover { + border: 1px solid #000; +} + +p#<?php echo $prefix; ?>errors { + border: black solid 1px; + color: #EC4A1F; + background-color: #FFBA76; +} + +/* commands */ +.<?php echo $prefix; ?>cmd_msg { + color: black; +} +.<?php echo $prefix; ?>cmd_me { + font-style: italic; + color: black; +} +.<?php echo $prefix; ?>cmd_notice { + font-style: italic; + color: #888; +} +pre.<?php echo $prefix; ?>cmd_rehash, +pre.<?php echo $prefix; ?>cmd_help +{ + color: #888; + font-style: italic; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-23 21:16:09
|
Revision: 501 Author: kerphi Date: 2006-05-23 14:16:00 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=501&view=rev Log Message: ----------- firt proxy command implementation (will be used for moderation, logging, ...) Modified Paths: -------------- trunk/src/pfccommand.class.php trunk/src/pfcglobalconfig.class.php Added Paths: ----------- trunk/src/pfcproxycommand.class.php trunk/src/proxys/ trunk/src/proxys/auth.class.php Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-05-23 20:34:13 UTC (rev 500) +++ trunk/src/pfccommand.class.php 2006-05-23 21:16:00 UTC (rev 501) @@ -58,18 +58,36 @@ */ function &Factory($name) { - $cmd = NULL; - $name = strtolower($name); - $classname = "pfcCommand_".$name; - $filename = dirname(__FILE__)."/commands/".$name.".class.php"; - - if (file_exists($filename)) require_once($filename); - if(class_exists($classname)) + $c =& pfcGlobalConfig::Instance(); + + // instanciate the real command + $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 =& new $classname(); - $cmd->name = $name; + $cmd =& new $cmd_classname(); + $cmd->name = $cmd_name; } - return $cmd; + + // instanciate the proxy chains + $proxy = NULL; + $proxy_name = strtolower($c->proxy[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)) + { + $proxy =& new $proxy_classname(); + $proxy->name = $cmd_name; + $proxy->proxyname = $proxy_name; + $proxy->linkTo($cmd); + } + + // return the proxy, not the command (the proxy will forward the request to the real command) + return $proxy; } /** Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-05-23 20:34:13 UTC (rev 500) +++ trunk/src/pfcglobalconfig.class.php 2006-05-23 21:16:00 UTC (rev 501) @@ -32,12 +32,15 @@ { var $serverid = ""; // this is the chat server id (comparable to the server host in IRC) + var $admins = array(); + var $proxy = array("auth"); + // these parameters are dynamic (not cached) var $nick = ""; // the initial nickname ("" means the user will be queried) 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 $title = ""; // default is _pfc("My Chat") var $channel = ""; // default is _pfc("My room") Added: trunk/src/pfcproxycommand.class.php =================================================================== --- trunk/src/pfcproxycommand.class.php (rev 0) +++ trunk/src/pfcproxycommand.class.php 2006-05-23 21:16:00 UTC (rev 501) @@ -0,0 +1,64 @@ +<?php +/** + * pfcproxycommand.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__)."/pfccommand.class.php"; + +/** + * pfcProxyCommand is an abstract class (interface) which must be inherited by each concrete proxy commands + * + * @author Stephane Gully <ste...@gm...> + */ +class pfcProxyCommand extends pfcCommand +{ + /** + * Next proxy command + */ + var $next; + + /** + * The proxy name (similare to the command name) + */ + var $proxyname; + + /** + * Constructor + */ + function pfcProxyCommand() + { + pfcCommand::pfcCommand(); + } + + function linkTo(&$cmd) + { + $this->next = $cmd; + } + + /* + function run(&$xml_reponse, $clientid, &$param, &$sender, &$recipient, &$recipientid) + { + die(_pfc("%s must be implemented", get_class($this)."::".__FUNCTION__)); + } + */ +} + +?> \ No newline at end of file Added: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php (rev 0) +++ trunk/src/proxys/auth.class.php 2006-05-23 21:16:00 UTC (rev 501) @@ -0,0 +1,45 @@ +<?php +/** + * auth.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_auth + * + * @author Stephane Gully <ste...@gm...> + */ +class pfcProxyCommand_auth extends pfcProxyCommand +{ + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) + { + // $xml_reponse->addScript("alert('proxy auth');"); + + // if ($this->name == "send") + // $xml_reponse->addScript("alert('proxy auth');"); + + // on passe la main a au prochain proxy (ou a la command finale) + $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-05-23 20:34:28
|
Revision: 500 Author: kerphi Date: 2006-05-23 13:34:13 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=500&view=rev Log Message: ----------- Bug fix: the nick parameters passed in the parameter array was not take into account Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php trunk/src/pfcuserconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-05-23 20:33:23 UTC (rev 499) +++ trunk/src/pfcglobalconfig.class.php 2006-05-23 20:34:13 UTC (rev 500) @@ -31,7 +31,14 @@ class pfcGlobalConfig { var $serverid = ""; // this is the chat server id (comparable to the server host in IRC) + + // these parameters are dynamic (not cached) var $nick = ""; // the initial nickname ("" means the user will be queried) + 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 $title = ""; // default is _pfc("My Chat") var $channel = ""; // default is _pfc("My room") var $frozen_nick = false; @@ -124,6 +131,9 @@ if ($this->data_public_path == "") $this->data_public_path = dirname(__FILE__)."/../data/public"; $this->synchronizeWithCache(); + + // the nickname is not global, it must not be cached + $this->nick = $params["nick"]; } function &Instance( $params = array() ) @@ -428,52 +438,6 @@ else die(_pfc("Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct", $file, $this->themepath, $this->theme)); } - - - - - /* ---------------------------- */ - /* TO DELETE */ - - - /** - * save the pfcglobalconfig object into sessions if necessary - * else restore the old pfcglobalconfig object - */ - function synchronizeWithSession() - { - $session_id = $this->prefix."chatconfig_".$this->getId(); - if (isset($_SESSION[$session_id])) - { - $pfc_configvar = unserialize($_SESSION[$session_id]); - foreach($pfc_configvar as $key => $val) - $this->$key = $val; - if ($this->debug) pxlog("synchronizeWithSession[".$this->getId()."]: restore chatconfig from session nick=".$this->nick, "chatconfig", $this->getId()); - } - else - { - if (!$this->isInit()) - $this->init(); - $errors =& $this->getErrors(); - if (count($errors) > 0) - { - echo "<ul>"; foreach( $errors as $e ) echo "<li>".$e."</li>"; echo "</ul>"; - exit; - } - // save the validated config in session - $this->saveInSession(); - } - } - - function saveInSession() - { - $session_id = $this->prefix."chatconfig_".$this->getId(); - $_SESSION[$session_id] = serialize(get_object_vars($this)); - if ($this->debug) pxlog("saveInSession[".$this->getId()."]: nick=".$this->nick, "chatconfig", $this->getId()); - } - - - } ?> Modified: trunk/src/pfcuserconfig.class.php =================================================================== --- trunk/src/pfcuserconfig.class.php 2006-05-23 20:33:23 UTC (rev 499) +++ trunk/src/pfcuserconfig.class.php 2006-05-23 20:34:13 UTC (rev 500) @@ -10,7 +10,6 @@ var $active; var $timeout; - var $sessionid; var $is_init = false; // used internaly to know if the chat config is initialized @@ -27,6 +26,7 @@ $this->sessionid = session_id(); + // user parameters are cached in sessions $this->_getParam("nick"); if (!isset($this->nick)) $this->_setParam("nick",""); $this->_getParam("active"); @@ -35,9 +35,6 @@ if (!isset($this->channels)) $this->_setParam("channels",array()); $this->_getParam("privmsg"); if (!isset($this->privmsg)) $this->_setParam("privmsg",array()); - - //@ todo: save the nickname config into the cache - //$this->synchronizeWithCache(); } function &_getParam($p) @@ -49,6 +46,8 @@ $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; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-23 20:33:37
|
Revision: 499 Author: kerphi Date: 2006-05-23 13:33:23 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=499&view=rev Log Message: ----------- code cleaning Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/send.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-05-19 13:39:57 UTC (rev 498) +++ trunk/src/commands/connect.class.php 2006-05-23 20:33:23 UTC (rev 499) @@ -14,45 +14,6 @@ $container =& $c->getContainerInstance(); $disconnected_users = $container->removeObsoleteNick(NULL, $c->timeout); - /* - // reset the nickname cache - $_SESSION[$c->prefix."nicklist_".$c->getId()."_".$clientid] = NULL; - - // disable or not the nickname button if the frozen_nick is on/off - if ($c->frozen_nick) - $xml_reponse->addAssign($c->prefix."handle", "disabled", true); - else - $xml_reponse->addAssign($c->prefix."handle", "disabled", false); - - // disconnect last connected users if necessary - $cmd =& pfcCommand::Factory("getonlinenick"); - $cmd->run($xml_reponse, $clientid); - - // check if the wanted nickname was allready known - if ($c->debug) - { - $container =& $c->getContainerInstance(); - $nickid = $container->getNickId($u->nick); - pxlog("/connect (nick=".$u->nick." nickid=".$nickid.")", "chat", $c->getId()); - } - - if ($u->nick == "") - { - // ask user to choose a nickname - $cmd =& pfcCommand::Factory("asknick"); - $cmd->run($xml_reponse, $clientid, ""); - } - else - { - $cmd =& pfcCommand::Factory("nick"); - $cmd->run($xml_reponse, $clientid, $u->nick); - } - */ - - // start updates - // $xml_reponse->addScript("pfc.updateChat(true);"); - // $xml_reponse->addScript("pfc.isconnected = true; pfc.refresh_loginlogout();"); - // connect to the server $xml_reponse->addScript("pfc.handleResponse('connect', 'ok', '');"); Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2006-05-19 13:39:57 UTC (rev 498) +++ trunk/src/commands/send.class.php 2006-05-23 20:33:23 UTC (rev 499) @@ -11,6 +11,10 @@ $nick = phpFreeChat::FilterSpecialChar($sender); $text = phpFreeChat::PreFilterMsg($param); + + + // $offline = $container->getMeta("offline", "nickname", $u->privmsg[$recipientid]["name"]); + // if this channel is a pv (one to one channel), // first of all, check if the other user is connected This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-19 13:40:14
|
Revision: 498 Author: kerphi Date: 2006-05-19 06:39:57 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=498&view=rev Log Message: ----------- fix a XHTML error (thanks to anonymousZ for the report) Modified Paths: -------------- branches/0.x/themes/default/templates/chat.html.tpl.php trunk/themes/default/templates/chat.html.tpl.php Modified: branches/0.x/themes/default/templates/chat.html.tpl.php =================================================================== --- branches/0.x/themes/default/templates/chat.html.tpl.php 2006-05-18 08:15:57 UTC (rev 497) +++ branches/0.x/themes/default/templates/chat.html.tpl.php 2006-05-19 13:39:57 UTC (rev 498) @@ -80,7 +80,7 @@ <script type="text/javascript"> // <![CDATA[ <?php include($c->getFilePathFromTheme('templates/chat.js.tpl.php')); ?> - // ]] + // ]]> </script> </div> </div> Modified: trunk/themes/default/templates/chat.html.tpl.php =================================================================== --- trunk/themes/default/templates/chat.html.tpl.php 2006-05-18 08:15:57 UTC (rev 497) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-05-19 13:39:57 UTC (rev 498) @@ -72,7 +72,7 @@ <script type="text/javascript"> // <![CDATA[ <?php include($c->getFilePathFromTheme('templates/chat.js.tpl.php')); ?> - // ]] + // ]]> </script> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-18 08:16:16
|
Revision: 497 Author: kerphi Date: 2006-05-18 01:15:57 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=497&view=rev Log Message: ----------- Add a demo which shows how to customize the nicknames automatic colors. Modified Paths: -------------- branches/0.x/demo/index.php trunk/demo/index.php Added Paths: ----------- branches/0.x/demo/demo43_change_the_nicknames_colors/ branches/0.x/demo/demo43_change_the_nicknames_colors/mytheme/ branches/0.x/demo/demo43_change_the_nicknames_colors/mytheme/templates/ branches/0.x/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php branches/0.x/demo/demo43_change_the_nicknames_colors.php trunk/demo/demo43_change_the_nicknames_colors/ trunk/demo/demo43_change_the_nicknames_colors/mytheme/ trunk/demo/demo43_change_the_nicknames_colors/mytheme/templates/ trunk/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php trunk/demo/demo43_change_the_nicknames_colors.php Added: branches/0.x/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php =================================================================== --- branches/0.x/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php (rev 0) +++ branches/0.x/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php 2006-05-18 08:15:57 UTC (rev 497) @@ -0,0 +1,9 @@ +pfcClient.prototype.reloadColorList = function() +{ + this.colorlist = Array( 'green', + 'blue', + 'red', + '#567', + '#C33B3B' + ); +} \ No newline at end of file Added: branches/0.x/demo/demo43_change_the_nicknames_colors.php =================================================================== --- branches/0.x/demo/demo43_change_the_nicknames_colors.php (rev 0) +++ branches/0.x/demo/demo43_change_the_nicknames_colors.php 2006-05-18 08:15:57 UTC (rev 497) @@ -0,0 +1,46 @@ +<?php + +require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; + +$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat +$params["nick"] = "guest".rand(1,10); // setup the intitial nickname +$params["title"] = "A chat with a customized nickname color list"; +$params["themepath"] = dirname(__FILE__)."/demo43_change_the_nicknames_colors"; +$params["theme"] = "mytheme"; +$chat = new phpFreeChat( $params ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat demo</title> + + <?php $chat->printJavascript(); ?> + <?php $chat->printStyle(); ?> + </head> + + <body> + <?php $chat->printChat(); ?> +<?php + // print the current file + echo "<h2>The source code</h2>"; + $filename = __FILE__; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + +<?php + $filename = dirname(__FILE__)."/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php"; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + + </body> +</html> \ No newline at end of file Modified: branches/0.x/demo/index.php =================================================================== --- branches/0.x/demo/index.php 2006-05-18 08:11:11 UTC (rev 496) +++ branches/0.x/demo/index.php 2006-05-18 08:15:57 UTC (rev 497) @@ -28,7 +28,7 @@ <li><a href="demo32_show_last_messages-showlastmsg.php">demo32 - demo which show how to get the last posted messages (showlastmsg script)</a></li> --> <li><a href="demo35_shared_memory.php">demo35 - demo which show how to use the shared memory container</a></li> - + <li><a href="demo43_change_the_nicknames_colors.php">demo43 - demo which show how to change the nicknames automatic colors</a></li> </ul> Added: trunk/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php =================================================================== --- trunk/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php (rev 0) +++ trunk/demo/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php 2006-05-18 08:15:57 UTC (rev 497) @@ -0,0 +1,9 @@ +pfcClient.prototype.reloadColorList = function() +{ + this.colorlist = Array( 'green', + 'blue', + 'red', + '#567', + '#C33B3B' + ); +} \ No newline at end of file Added: trunk/demo/demo43_change_the_nicknames_colors.php =================================================================== --- trunk/demo/demo43_change_the_nicknames_colors.php (rev 0) +++ trunk/demo/demo43_change_the_nicknames_colors.php 2006-05-18 08:15:57 UTC (rev 497) @@ -0,0 +1,46 @@ +<?php + +require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; + +$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat +$params["nick"] = "guest".rand(1,10); // setup the intitial nickname +$params["title"] = "A chat with a customized nickname color list"; +$params["themepath"] = dirname(__FILE__)."/demo43_change_the_nicknames_colors"; +$params["theme"] = "mytheme"; +$chat = new phpFreeChat( $params ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat demo</title> + + <?php $chat->printJavascript(); ?> + <?php $chat->printStyle(); ?> + </head> + + <body> + <?php $chat->printChat(); ?> +<?php + // print the current file + echo "<h2>The source code</h2>"; + $filename = __FILE__; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + +<?php + $filename = dirname(__FILE__)."/demo43_change_the_nicknames_colors/mytheme/templates/pfcclient-custo.js.tpl.php"; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + + </body> +</html> \ No newline at end of file Modified: trunk/demo/index.php =================================================================== --- trunk/demo/index.php 2006-05-18 08:11:11 UTC (rev 496) +++ trunk/demo/index.php 2006-05-18 08:15:57 UTC (rev 497) @@ -1,51 +1,51 @@ <!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 Demos</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"> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>phpFreeChat Demos</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> - <body> - -<div class="header"> - <h1>phpFreeChat - Demos</h1> - <img alt="logo bulle" src="../style/bulle.png" class="logo2"> -</div> - -<div class="menu"> + <body> + +<div class="header"> + <h1>phpFreeChat - Demos</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="../index.php">PFC Index</a> - </li> - </ul> - </li> - <li class="sub title">Demos</li> - <li> - <ul class="sub"> - <li class="item"> - <a href="#Miscellaneous">Miscellaneous</a> - </li> - <li class="item"> - <a href="#Themes">Themes</a> - </li> - <li class="item"> - <a href="#Translations">Translations</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="sub title">General</li> + <li> + <ul class="sub"> + <li class="item"> + <a href="../index.php">PFC Index</a> + </li> + </ul> + </li> + <li class="sub title">Demos</li> + <li> + <ul class="sub"> + <li class="item"> + <a href="#Miscellaneous">Miscellaneous</a> + </li> + <li class="item"> + <a href="#Themes">Themes</a> + </li> + <li class="item"> + <a href="#Translations">Translations</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>Miscellaneous</h2> @@ -69,7 +69,7 @@ <li><a href="demo32_show_last_messages-showlastmsg.php">demo32 - demo which show how to get the last posted messages (showlastmsg script)</a></li> --> <li><a href="demo35_shared_memory.php">demo35 - demo which show how to use the shared memory container</a></li> - + <li><a href="demo43_change_the_nicknames_colors.php">demo43 - demo which show how to change the nicknames automatic colors</a></li> </ul> @@ -109,18 +109,18 @@ <li><a href="demo41_in_greek.php">demo41 - the greek translation of the chat</a></li> <li><a href="demo42_in_chinese_from_taiwan.php">demo42 - the Chinese from taiwan (traditional Chinese) translation of the chat</a></li> </ul> - -</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> + +</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-05-18 08:11:16
|
Revision: 496 Author: kerphi Date: 2006-05-18 01:11:11 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=496&view=rev Log Message: ----------- blind fix: should prevent some warnings. Modified Paths: -------------- branches/0.x/src/phpfreechatcontainermemory.class.php Modified: branches/0.x/src/phpfreechatcontainermemory.class.php =================================================================== --- branches/0.x/src/phpfreechatcontainermemory.class.php 2006-05-15 08:26:32 UTC (rev 495) +++ branches/0.x/src/phpfreechatcontainermemory.class.php 2006-05-18 08:11:11 UTC (rev 496) @@ -278,7 +278,7 @@ ($c->container_cfg_sm_messages); // remove old messages - $content = array_slice($content, -$c->max_msg); + $content = array_slice(is_array($content)?$content:array(), -$c->max_msg); $this->_memory->set ($c->container_cfg_sm_messages, $content); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2006-05-15 08:26:39
|
Revision: 495 Author: nemako Date: 2006-05-15 01:26:32 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=495&view=rev Log Message: ----------- add a display of the name of the connected user in the menu Modified Paths: -------------- trunk/admin/index_html_top.php Modified: trunk/admin/index_html_top.php =================================================================== --- trunk/admin/index_html_top.php 2006-05-13 21:10:35 UTC (rev 494) +++ trunk/admin/index_html_top.php 2006-05-15 08:26:32 UTC (rev 495) @@ -49,7 +49,16 @@ <a href="#">other</a> </li> </ul> - </li> + </li> + <li class="sub title">Connected User</li> + <li> + <ul> + <li class="item"> + <a href="#"><?php echo empty($_SERVER['REMOTE_USER']) ? "No user connected" : $_SERVER['REMOTE_USER']; ?></a> + </li> + </ul> + </li> + </ul> <p class="partner"> <a href="http://www.phpfreechat.net"><img alt="logo big" src="style/logo_88x31.gif"></a> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-13 21:10:46
|
Revision: 494 Author: kerphi Date: 2006-05-13 14:10:35 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=494&view=rev Log Message: ----------- small clarification Modified Paths: -------------- branches/0.x/src/pfctools.php Modified: branches/0.x/src/pfctools.php =================================================================== --- branches/0.x/src/pfctools.php 2006-05-12 14:06:35 UTC (rev 493) +++ branches/0.x/src/pfctools.php 2006-05-13 21:10:35 UTC (rev 494) @@ -46,7 +46,7 @@ !file_exists($sf)) { echo "<pre>"; - echo "<span style='color:red'>Error: GetScriptFilename function returns a wrong path. Please contact the pfc team (co...@ph...) and copy/paste this array to help debugging.</span>\n"; + echo "<span style='color:red'>Error: GetScriptFilename function returns a wrong path. Please contact the pfc team (co...@ph...) and copy/paste these lines to help debugging.</span>\n"; print_r($_SERVER); echo "</pre>"; exit; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-12 14:06:44
|
Revision: 493 Author: kerphi Date: 2006-05-12 07:06:35 -0700 (Fri, 12 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=493&view=rev Log Message: ----------- Container api modification: removeObsoleteNick now returns the disconnected users nicknames and their associated timestamp. Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php trunk/src/containers/file.class.php trunk/testcase/container_generic.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-05-12 13:55:14 UTC (rev 492) +++ trunk/src/commands/getonlinenick.class.php 2006-05-12 14:06:35 UTC (rev 493) @@ -14,7 +14,7 @@ foreach ($disconnected_users as $u) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u["nick"]), $sender, $recipient, $recipientid, 2); } // get the cached nickname list Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-05-12 13:55:14 UTC (rev 492) +++ trunk/src/containers/file.class.php 2006-05-12 14:06:35 UTC (rev 493) @@ -281,7 +281,7 @@ * Notice: this function must remove all nicknames which are not uptodate from the given channel or from the server * @param $chan if NULL then check obsolete nick on the server, otherwise just check obsolete nick on the given channel * @param $timeout - * @return array() contains all disconnected nicknames + * @return array("nick"=>???, "timestamp"=>???) contains all disconnected nicknames and there timestamp */ function removeObsoleteNick($chan, $timeout) { @@ -299,16 +299,18 @@ while (false !== ($file = readdir($dir_handle))) { if ($file == "." || $file == "..") continue; // skip . and .. generic files - if (time() > (filemtime($nick_dir."/".$file)+$timeout/1000) ) // user will be disconnected after 'timeout' secondes of inactivity + $f_time = filemtime($nick_dir."/".$file); + if (time() > ($f_time+$timeout/1000) ) // user will be disconnected after 'timeout' secondes of inactivity { - $deleted_user[] = $this->_decode($file); - unlink($nick_dir."/".$file); // disconnect expired user + $deleted_user[] = array("nick" => $this->_decode($file), + "timestamp" => $f_time); + @unlink($nick_dir."/".$file); // disconnect expired user } else { // optimisation: cache user list for next getOnlineNick call $users[] = array("nick" => $this->_decode($file), - "timestamp" => filemtime($nick_dir."/".$file)); + "timestamp" => $f_time); } } Modified: trunk/testcase/container_generic.php =================================================================== --- trunk/testcase/container_generic.php 2006-05-12 13:55:14 UTC (rev 492) +++ trunk/testcase/container_generic.php 2006-05-12 14:06:35 UTC (rev 493) @@ -113,18 +113,18 @@ $this->ct->createNick($chan, $nick, $nickid); sleep(2); $ret = $this->ct->removeObsoleteNick($chan, "1000"); - $this->assertTrue(in_array($nick, $ret), "nickname should be removed from the channel"); + $this->assertEquals(count($ret), 1, "1 nickname should be obsolete"); $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); - $this->assertFalse($isonline, "nickname shouldn't be online on the channel"); + $this->assertFalse($isonline, "nickname shouldn't be online anymore"); // on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); sleep(2); $ret = $this->ct->removeObsoleteNick($chan, "1000"); - $this->assertTrue(in_array($nick, $ret), "nickname should be removed from the server"); + $this->assertEquals(count($ret), 1, "1 nickname should be obsolete"); $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); - $this->assertFalse($isonline, "nickname shouldn't be online on the server"); + $this->assertFalse($isonline, "nickname shouldn't be online anymore"); } function testSetGetRmMeta_Generic() @@ -138,25 +138,25 @@ // set / get $this->ct->setMeta($nickid, "key1", "nickname", $nick); $metadata = $this->ct->getMeta("key1", "nickname", $nick); - $this->assertEquals($nickid, $metadata, "1-metadata value is not correct"); + $this->assertEquals($nickid, $metadata, "metadata value is not correct"); // set / rm / get $this->ct->setMeta($nickid, "key2", "nickname", $nick); $metadata = $this->ct->getMeta("key2", "nickname", $nick); - $this->assertEquals($nickid, $metadata, "2-metadata value is not correct"); + $this->assertEquals($nickid, $metadata, "metadata value is not correct"); $this->ct->rmMeta("key2", "nickname", $nick); $metadata = $this->ct->getMeta("key2", "nickname", $nick); - $this->assertNull($metadata, "3-metadata should not exists anymore"); + $this->assertNull($metadata, "metadata should not exists anymore"); // set / rm (all) / get $this->ct->setMeta($nickid, "key2", "nickname", $nick); $metadata = $this->ct->getMeta("key2", "nickname", $nick); - $this->assertEquals($nickid, $metadata, "4-metadata value is not correct"); + $this->assertEquals($nickid, $metadata, "metadata value is not correct"); $this->ct->rmMeta(NULL, "nickname", $nick); $metadata = $this->ct->getMeta("key2", "nickname", $nick); - $this->assertNull($metadata, "5-metadata should not exists anymore"); + $this->assertNull($metadata, "metadata should not exists anymore"); $metadata = $this->ct->getMeta("key1", "nickname", $nick); - $this->assertNull($metadata, "6-metadata should not exists anymore"); + $this->assertNull($metadata, "metadata should not exists anymore"); } function testupdateNick_Generic() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |