phpfreechat-svn Mailing List for phpFreeChat (Page 32)
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-12 13:55:25
|
Revision: 492 Author: kerphi Date: 2006-05-12 06:55:14 -0700 (Fri, 12 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=492&view=rev Log Message: ----------- - Bug fix: the cached nickname list was not correctly updated - add a new function in the container API : isNickOnline Modified Paths: -------------- trunk/src/containers/file.class.php trunk/src/pfctools.php trunk/testcase/container_file.php trunk/testcase/container_generic.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-05-11 16:56:06 UTC (rev 491) +++ trunk/src/containers/file.class.php 2006-05-12 13:55:14 UTC (rev 492) @@ -118,6 +118,15 @@ flock ($fp, LOCK_UN); // unlock fclose($fp); + // append the nickname to the cached nickname list + $id = $this->isNickOnline($chan, $nick); + $_chan = ($chan == NULL) ? "SERVER" : $chan; + if ($id<0) + { + $this->_users[$_chan][] = array("nick" => $nick, + "timestamp" => filemtime($nick_filename)); + } + return true; } @@ -126,6 +135,7 @@ * Notice: The caller must take care to update all joined channels. * @param $chan if NULL then remove the user on the server (disconnect), otherwise just remove the user from the given channel (quit) * @param $nick the nickname to remove + * @return true if the nickname was correctly removed */ function removeNick($chan, $nick) { @@ -144,27 +154,21 @@ pxlog("removeNick(".$nick.") - Error: the nickname data file to remove doesn't exists", "chat", $c->getId()); } - @unlink($nick_filename); + $ok = @unlink($nick_filename); - // remove the nickname from the cache list - if (isset($this->_users[$chan])) + if ($c->debug) { - $uid = 0; $isonline = false; - while($uid < count($this->_users[$chan]) && !$isonline) - { - if ($this->_users[$chan][$uid]["nick"] == $nick) - $isonline = true; - else - $uid++; - } - if ($isonline) - { - $key = $uid; - unset($this->_users[$chan][$key]); - } + // check the nickname file is correctly deleted + if (file_exists($nick_filename)) + pxlog("removeNick(".$nick.") - Error: the nickname data file yet exists", "chat", $c->getId()); } + + // remove the nickname from the cache list + $id = $this->isNickOnline($chan, $nick); + $_chan = ($chan == NULL) ? "SERVER" : $chan; + if ($id >= 0) unset($this->_users[$_chan][$id]); - return true; + return $ok; } /** @@ -189,22 +193,18 @@ @chmod($nick_filename, 0777); // append the nickname to the cache list - if (isset($this->_users[$chan])) + $_chan = ($chan == NULL) ? "SERVER" : $chan; + $id = $this->isNickOnline($chan, $nick); + if ($id < 0) { - $uid = 0; $isonline = false; - while($uid < count($this->_users[$chan]) && !$isonline) - { - if ($this->_users[$chan][$uid]["nick"] == $nick) - $isonline = true; - else - $uid++; - } - if (!$isonline) - { - $this->_users[$chan][] = array("nick" => $nick, - "timestamp" => filemtime($nick_filename)); - } + $this->_users[$_chan][] = array("nick" => $nick, + "timestamp" => filemtime($nick_filename)); } + else + { + // just update the timestamp if the nickname is allready present in the cached list + $this->_users[$_chan][$id]["timestamp"] = filemtime($nick_filename); + } return $there; } @@ -231,22 +231,12 @@ // update the nick cache list if($ok) { - if (isset($this->_users[$chan])) + $_chan = ($chan == NULL) ? "SERVER" : $chan; + $id = $this->isNickOnline($chan, $oldnick); + if ($id >= 0) { - $uid = 0; $isonline = false; - while($uid < count($this->_users[$chan]) && !$isonline) - { - if ($this->_users[$chan][$uid]["nick"] == $oldnick) - $isonline = true; - else - $uid++; - } - if ($isonline) - { - $key = $uid; - $this->_users[$chan][$key]["nick"] = $newnick; - $this->_users[$chan][$key]["timestamp"] = filemtime($newnick_filename); - } + $this->_users[$_chan][$id]["nick"] = $newnick; + $this->_users[$_chan][$id]["timestamp"] = filemtime($newnick_filename); } } @@ -323,7 +313,8 @@ } // cache the updated user list - $this->_users[$chan] =& $users; + $_chan = ($chan == NULL) ? "SERVER" : $chan; + $this->_users[$_chan] =& $users; return $deleted_user; } @@ -331,14 +322,14 @@ /** * Returns the nickname list on the given channel or on the whole server * @param $chan if NULL then returns all connected user, otherwise just returns the channel nicknames - * @return array() contains a nickname list + * @return array(array("nick"=>???,"timestamp"=>???) contains the nickname list with the associated timestamp (laste update time) */ function getOnlineNick($chan) { // return the cached user list if it exists - if (isset($this->_users[$chan]) && - is_array($this->_users[$chan])) - return $this->_users[$chan]; + $_chan = ($chan == NULL) ? "SERVER" : $chan; + if (isset($this->_users[$_chan]) && is_array($this->_users[$_chan])) + return $this->_users[$_chan]; $c =& $this->c; @@ -356,11 +347,37 @@ } // cache the user list - $this->_users[$chan] =& $users; + $this->_users[$_chan] =& $users; - return $users; + return $this->_users[$_chan]; } + + /** + * Returns returns a positive number if the nick is online + * @param $chan if NULL then check if the user is online on the server, otherwise check if the user has joined the channel + * @return -1 if the user is off line, a positive (>=0) if the user is online + */ + function isNickOnline($chan, $nick) + { + // get the nickname list + $_chan = ($chan == NULL) ? "SERVER" : $chan; + $online_users = isset($this->_users[$_chan]) ? $this->_users[$_chan] : $this->getOnlineNick($chan); + $uid = 0; + $isonline = false; + while($uid < count($online_users) && !$isonline) + { + if ($online_users[$uid]["nick"] == $nick) + $isonline = true; + else + $uid++; + } + if ($isonline) + return $uid; + else + return -1; + } + /** * Write a command to the given channel or to the server * Notice: a message is very generic, it can be a misc command (notice, me, ...) @@ -401,10 +418,10 @@ /** * Read the last posted commands from a channel or from the server + * Notice: the returned array must be ordered by id * @param $chan if NULL then read from the server, otherwise read from the given channel * @param $from_id read all message with a greater id * @return array() contains the command list - * @todo use one file (filename = msgid) for one message */ function read($chan, $from_id) { @@ -428,7 +445,8 @@ if ($file == "." || $file == "..") continue; // skip . and .. generic files if ($file>$from_id) { - $new_from_id = $file; + if ($file > $new_from_id) + $new_from_id = $file; $newmsg[] = $file; } } @@ -448,10 +466,11 @@ $data["sender"]= $formated_line[3]; $data["cmd"] = $formated_line[4]; $data["param"] = $formated_line[5]; - $datalist[] = $data; + $datalist[$data["id"]] = $data; } } - + ksort($datalist); + return array("data" => $datalist, "new_from_id" => $new_from_id ); } Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-05-11 16:56:06 UTC (rev 491) +++ trunk/src/pfctools.php 2006-05-12 13:55:14 UTC (rev 492) @@ -125,7 +125,7 @@ if($obj=='.' || $obj=='..') continue; if (!@unlink($dir.'/'.$obj)) rm_r($dir.'/'.$obj); } - rmdir($dir); + @rmdir($dir); } /** Modified: trunk/testcase/container_file.php =================================================================== --- trunk/testcase/container_file.php 2006-05-11 16:56:06 UTC (rev 491) +++ trunk/testcase/container_file.php 2006-05-12 13:55:14 UTC (rev 492) @@ -26,7 +26,7 @@ { pfcContainerTestcase::tearDown(); } - + // this is a specific test for the File container function testCreateNick_File() { @@ -47,7 +47,7 @@ } // on desactive le timeout car se script peut mettre bcp de temps a s'executer -ini_set('max_execution_time', -1); +ini_set('max_execution_time', 0); $suite = new PHPUnit_TestSuite(); $suite->addTestSuite("pfcContainerTestcase_File"); Modified: trunk/testcase/container_generic.php =================================================================== --- trunk/testcase/container_generic.php 2006-05-11 16:56:06 UTC (rev 491) +++ trunk/testcase/container_generic.php 2006-05-12 13:55:14 UTC (rev 492) @@ -45,7 +45,7 @@ // remove the created files and directories $this->ct->clear(); } - + function testCreateNick_Generic() { $c =& $this->c; @@ -56,14 +56,14 @@ // create on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the channel"); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertTrue($isonline, "nickname should be online on the channel"); // create on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the server"); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertTrue($isonline, "nickname should be online on the server"); } function testRemoveNick_Generic() @@ -76,22 +76,18 @@ // on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the channel"); - $this->ct->removeNick($chan,$nick); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertFalse(in_array($nick, $online_nick), "nickname should not be online on the channel"); + $this->ct->removeNick($chan, $nick); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertFalse($isonline, "nickname shouldn't be online on the channel"); // on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the server"); - $this->ct->removeNick($chan,$nick); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertFalse(in_array($nick, $online_nick), "nickname should not be online on the server"); + $this->ct->removeNick($chan, $nick); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertFalse($isonline, "nickname shouldn't be online on the server"); } - + function testGetNickId_Generic() { $c =& $this->c; @@ -104,7 +100,7 @@ $ret = $this->ct->getNickId($nick); $this->assertEquals($nickid, $ret, "created nickname doesn't have a correct nickid"); } - + function testRemoveObsoleteNick_Generic() { $c =& $this->c; @@ -115,24 +111,20 @@ // on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the channel"); sleep(2); $ret = $this->ct->removeObsoleteNick($chan, "1000"); $this->assertTrue(in_array($nick, $ret), "nickname should be removed from the channel"); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertFalse(in_array($nick, $online_nick), "nickname should not be online on the channel"); - + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertFalse($isonline, "nickname shouldn't be online on the channel"); + // on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the server"); sleep(2); $ret = $this->ct->removeObsoleteNick($chan, "1000"); $this->assertTrue(in_array($nick, $ret), "nickname should be removed from the server"); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertFalse(in_array($nick, $online_nick), "nickname should not be online on the server"); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertFalse($isonline, "nickname shouldn't be online on the server"); } function testSetGetRmMeta_Generic() @@ -177,61 +169,55 @@ // on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "1-nickname should be online on the channel"); sleep(2); $ret = $this->ct->updateNick($chan, $nick); - $this->assertTrue($ret, "2-nickname should be correctly updated on the channel"); + $this->assertTrue($ret, "nickname should be correctly updated"); $ret = $this->ct->removeObsoleteNick($chan, "1000"); - $this->assertFalse(in_array($nick, $ret), "3-nickname should not be removed from the channel because it has been updated"); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "4-nickname should be online on the channel"); - + $this->assertFalse(in_array($nick, $ret), "nickname shouldn't be removed because it has been updated"); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertTrue($isonline, "nickname should be online"); + // on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "5-nickname should be online on the server"); sleep(2); $ret = $this->ct->updateNick($chan, $nick); - $this->assertTrue($ret, "6-nickname should be correctly updated on the server"); + $this->assertTrue($ret, "nickname should be correctly updated"); $ret = $this->ct->removeObsoleteNick($chan, "1000"); - $this->assertFalse(in_array($nick, $ret), "7-nickname should not be removed from the server because it has been updated"); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "8-nickname should be online on the server"); + $this->assertFalse(in_array($nick, $ret), "nickname shouldn't be removed because it has been updated"); + $isonline = ($this->ct->isNickOnline($chan, $nick) >= 0); + $this->assertTrue($isonline, "nickname should be online"); } function testchangeNick_Generic() { $c =& $this->c; $ct =& $this->ct; - $nick = $this->nick; + $nick1 = $this->nick; $nick2 = $this->nick."2"; $nickid = $this->nickid; $chan = $this->chan; // create on the channel - $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "1-nickname should be online on the channel"); - $ret = $this->ct->changeNick($chan, $nick2, $nick); - $this->assertTrue($ret, "2-nickname change function should returns true (succes)"); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertFalse(in_array($nick, $online_nick), "3-nickname should not be online on the channel"); - $this->assertTrue(in_array($nick2, $online_nick), "4-nickname should be online on the channel"); - + $this->ct->createNick($chan, $nick1, $nickid); + $ret = $this->ct->changeNick($chan, $nick2, $nick1); + $this->assertTrue($ret, "nickname change function should returns true (success)"); + $isonline1 = ($this->ct->isNickOnline($chan, $nick1) >= 0); + $isonline2 = ($this->ct->isNickOnline($chan, $nick2) >= 0); + $this->assertFalse($isonline1, "nickname shouldn't be online"); + $this->assertTrue($isonline2, "nickname shouldn't be online"); + // create on the server $chan = NULL; - $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "5-nickname should be online"); - $ret = $this->ct->changeNick($chan, $nick2, $nick); - $this->assertTrue($ret, "6-nickname change function should returns true (succes)"); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertFalse(in_array($nick, $online_nick), "7-nickname should not be online"); - $this->assertTrue(in_array($nick2, $online_nick), "8-nickname should be online on the channel"); + $this->ct->createNick($chan, $nick1, $nickid); + $ret = $this->ct->changeNick($chan, $nick2, $nick1); + $this->assertTrue($ret, "nickname change function should returns true (success)"); + $isonline1 = ($this->ct->isNickOnline($chan, $nick1) >= 0); + $isonline2 = ($this->ct->isNickOnline($chan, $nick2) >= 0); + $this->assertFalse($isonline1, "nickname shouldn't be online"); + $this->assertTrue($isonline2, "nickname shouldn't be online"); } - + function testwrite_Generic() { $c =& $this->c; @@ -244,28 +230,24 @@ // create message on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "1-nickname should be online on the channel"); $msgid = $this->ct->write($chan, $nick, $cmd, $msg); - $this->assertEquals($msgid, 1,"2- generated msg_id is not correct"); + $this->assertEquals($msgid, 1,"generated msg_id is not correct"); $res = $this->ct->read($chan, 0); - $this->assertEquals(1, count($res["data"]), "3- 1 messages should be read"); - $this->assertEquals($msg, $res["data"][0]["param"] ,"4- messages data is not the same as the sent one"); - $this->assertEquals($res["new_from_id"], 1 ,"6- new_from_id is not correct"); + $this->assertEquals(1, count($res["data"]), "1 messages should be read"); + $this->assertEquals($msg, $res["data"][1]["param"] ,"messages data is not the same as the sent one"); + $this->assertEquals($res["new_from_id"], 1 ,"new_from_id is not correct"); // create message on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "7-nickname should be online on the channel"); $msgid = $this->ct->write($chan, $nick, $cmd, $msg); - $this->assertEquals($msgid, 1,"8- generated msg_id is not correct"); + $this->assertEquals($msgid, 1,"generated msg_id is not correct"); $res = $this->ct->read($chan, 0); - $this->assertEquals(1, count($res["data"]), "9- 1 messages should be read"); - $this->assertEquals($msg, $res["data"][0]["param"] ,"10- messages data is not the same as the sent one"); - $this->assertEquals($res["new_from_id"], 1 ,"11- new_from_id is not correct"); + $this->assertEquals(1, count($res["data"]), "1 messages should be read"); + $this->assertEquals($msg, $res["data"][1]["param"] ,"messages data is not the same as the sent one"); + $this->assertEquals($res["new_from_id"], 1 ,"new_from_id is not correct"); } - + function testread_Generic() { $c =& $this->c; @@ -278,28 +260,25 @@ // create on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "1-nickname should be online on the channel"); for($i = 0; $i < 10; $i++) { $msgid = $this->ct->write($chan, $nick, $cmd ,$msg . $i); - $this->assertEquals($msgid, $i+1,"2- generated msg_id is not correct"); + $this->assertEquals($msgid, $i+1, "generated msg_id is not correct"); } $res = $this->ct->read($chan, 0); - $this->assertEquals(10, count($res["data"]), "3- 10 messages should be read"); - $this->assertEquals($msg."0", $res["data"][0]["param"] ,"4- messages data is not the same as the sent one"); - $this->assertEquals($msg."9", $res["data"][9]["param"] ,"5- messages data is not the same as the sent one"); - $this->assertEquals($res["new_from_id"], 10 ,"6- new_from_id is not correct"); - + $this->assertEquals(10, count($res["data"]), "10 messages should be read"); + $this->assertEquals($msg."0", $res["data"][1]["param"] ,"messages data is not the same as the sent one"); + $this->assertEquals($msg."8", $res["data"][9]["param"] ,"messages data is not the same as the sent one"); + $this->assertEquals($res["new_from_id"], 10 ,"new_from_id is not correct"); + $res = $this->ct->read($chan, 5); - $this->assertEquals(5, count($res["data"]), "7- 5 messages should be read"); - $this->assertEquals($msg."5", $res["data"][0]["param"] ,"8- messages data is not the same as the sent one"); - $this->assertEquals($msg."9", $res["data"][4]["param"] ,"9- messages data is not the same as the sent one"); - $this->assertEquals($res["new_from_id"], 10 ,"10- new_from_id is not correct"); + $this->assertEquals(5, count($res["data"]), "5 messages should be read"); + $this->assertEquals($msg."5", $res["data"][6]["param"] ,"messages data is not the same as the sent one"); + $this->assertEquals($msg."9", $res["data"][10]["param"] ,"messages data is not the same as the sent one"); + $this->assertEquals($res["new_from_id"], 10 ,"new_from_id is not correct"); } - function testgetLastId_Generic() { $c =& $this->c; @@ -312,28 +291,24 @@ // on the channel $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "1-nickname should be online on the channel"); for($i = 0; $i < 10; $i++) { $msgid = $this->ct->write($chan, $nick, $cmd ,$msg . $i); - $this->assertEquals($msgid, $i+1,"2- generated msg_id is not correct"); + $this->assertEquals($msgid, $i+1,"generated msg_id is not correct"); } $msgid = $this->ct->getLastId($chan); - $this->assertEquals(10, $msgid, "3- last msgid is not correct"); + $this->assertEquals(10, $msgid, "last msgid is not correct"); // on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); - $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "4-nickname should be online on the channel"); for($i = 0; $i < 10; $i++) { $msgid = $this->ct->write($chan, $nick, $cmd ,$msg . $i); - $this->assertEquals($msgid, $i+1,"5- generated msg_id is not correct"); + $this->assertEquals($msgid, $i+1,"generated msg_id is not correct"); } $msgid = $this->ct->getLastId($chan); - $this->assertEquals(10, $msgid, "6- last msgid is not correct"); + $this->assertEquals(10, $msgid, "last msgid is not correct"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-11 16:56:13
|
Revision: 491 Author: kerphi Date: 2006-05-11 09:56:06 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=491&view=rev Log Message: ----------- add OS detection for the delimiter value (';' on windows, ':' on unix) Modified Paths: -------------- trunk/testcase/container_generic.php Modified: trunk/testcase/container_generic.php =================================================================== --- trunk/testcase/container_generic.php 2006-05-11 16:47:54 UTC (rev 490) +++ trunk/testcase/container_generic.php 2006-05-11 16:56:06 UTC (rev 491) @@ -1,6 +1,7 @@ <?php -$classpath = ".:".dirname(__FILE__).'/../lib/pear/'; +$delim = DIRECTORY_SEPARATOR == "\\" ? ";" : ":"; +$classpath = "." . $delim . dirname(__FILE__).'/../lib/pear/'; ini_set('include_path', $classpath); require_once "PHPUnit.php"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-11 16:48:03
|
Revision: 490 Author: kerphi Date: 2006-05-11 09:47:54 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=490&view=rev Log Message: ----------- improve the getOnlineNick function: now it returns the nicknames timestamps Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php trunk/src/commands/nick.class.php trunk/src/commands/send.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-05-11 16:11:14 UTC (rev 489) +++ trunk/src/commands/getonlinenick.class.php 2006-05-11 16:47:54 UTC (rev 490) @@ -34,7 +34,7 @@ $js = ""; foreach ($users as $u) { - $nickname = addslashes($u); // must escape ' charactere for javascript string + $nickname = addslashes($u["nick"]); // must escape ' charactere for javascript string $js .= "'".$nickname."',"; } $js = substr($js, 0, strlen($js)-1); // remove last ',' Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-05-11 16:11:14 UTC (rev 489) +++ trunk/src/commands/nick.class.php 2006-05-11 16:47:54 UTC (rev 490) @@ -34,11 +34,11 @@ $online_users = $container->getOnlineNick(NULL); foreach($online_users as $ou) { - if (preg_match("/^".preg_quote($ou)."$/i",$newnick)) + if (preg_match("/^".preg_quote($ou["nick"])."$/i",$newnick)) { // the nick match // just allow the owner to change his capitalised letters - if ($container->getNickId($ou) != $oldnickid) + if ($container->getNickId($ou["nick"]) != $oldnickid) $nick_in_use = true; } } Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2006-05-11 16:11:14 UTC (rev 489) +++ trunk/src/commands/send.class.php 2006-05-11 16:47:54 UTC (rev 490) @@ -22,8 +22,14 @@ // now check if this user is currently online $container =& $c->getContainerInstance(); $onlineusers = $container->getOnlineNick(NULL); - if (!in_array($pvnick,$onlineusers)) + $uid = 0; $isonline = false; + while($uid < count($onlineusers) && !$isonline) { + if ($onlineusers[$uid]["nick"] == $pvnick) $isonline = true; + $uid++; + } + if (!$isonline) + { $cmd =& pfcCommand::Factory("error"); $cmd->run($xml_reponse, $clientid, _pfc("Can't send the message, %s is offline", $pvnick)); $can_send = false; Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-05-11 16:11:14 UTC (rev 489) +++ trunk/src/containers/file.class.php 2006-05-11 16:47:54 UTC (rev 490) @@ -147,11 +147,21 @@ @unlink($nick_filename); // remove the nickname from the cache list - if (isset($this->_users[$chan]) && - in_array($nick, $this->_users[$chan])) + if (isset($this->_users[$chan])) { - $key = array_search($nick, $this->_users[$chan]); - unset($this->_users[$chan][$key]); + $uid = 0; $isonline = false; + while($uid < count($this->_users[$chan]) && !$isonline) + { + if ($this->_users[$chan][$uid]["nick"] == $nick) + $isonline = true; + else + $uid++; + } + if ($isonline) + { + $key = $uid; + unset($this->_users[$chan][$key]); + } } return true; @@ -179,10 +189,21 @@ @chmod($nick_filename, 0777); // append the nickname to the cache list - if (isset($this->_users[$chan]) && - !in_array($nick, $this->_users[$chan])) + if (isset($this->_users[$chan])) { - $this->_users[$chan][] = $nick; + $uid = 0; $isonline = false; + while($uid < count($this->_users[$chan]) && !$isonline) + { + if ($this->_users[$chan][$uid]["nick"] == $nick) + $isonline = true; + else + $uid++; + } + if (!$isonline) + { + $this->_users[$chan][] = array("nick" => $nick, + "timestamp" => filemtime($nick_filename)); + } } return $there; @@ -210,14 +231,22 @@ // update the nick cache list if($ok) { - if (isset($this->_users[$chan]) && - in_array($oldnick, $this->_users[$chan])) + if (isset($this->_users[$chan])) { - // remove the oldnick from the cache - $key = array_search($oldnick, $this->_users[$chan]); - unset($this->_users[$chan][$key]); - // append the new nick to the cache - $this->_users[$chan][] = $newnick; + $uid = 0; $isonline = false; + while($uid < count($this->_users[$chan]) && !$isonline) + { + if ($this->_users[$chan][$uid]["nick"] == $oldnick) + $isonline = true; + else + $uid++; + } + if ($isonline) + { + $key = $uid; + $this->_users[$chan][$key]["nick"] = $newnick; + $this->_users[$chan][$key]["timestamp"] = filemtime($newnick_filename); + } } } @@ -287,8 +316,9 @@ } else { - // optimisation: cache user list for next getOnlineUserList call - $users[] = $this->_decode($file); + // optimisation: cache user list for next getOnlineNick call + $users[] = array("nick" => $this->_decode($file), + "timestamp" => filemtime($nick_dir."/".$file)); } } @@ -321,7 +351,8 @@ while (false !== ($file = readdir($dir_handle))) { if ($file == "." || $file == "..") continue; // skip . and .. generic files - $users[] = $this->_decode($file); + $users[] = array("nick" => $this->_decode($file), + "timestamp" => filemtime($nick_dir."/".$file)); } // cache the user list This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-11 16:30:40
|
Revision: 489 Author: kerphi Date: 2006-05-11 09:11:14 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=489&view=rev Log Message: ----------- Code cleaning: when a user close his window, take care to disconnect users from the server and from the joined channels. Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php trunk/src/commands/update.class.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-05-11 15:51:03 UTC (rev 488) +++ trunk/src/commands/getonlinenick.class.php 2006-05-11 16:11:14 UTC (rev 489) @@ -7,19 +7,21 @@ function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { $c =& $this->c; + $container =& $c->getContainerInstance(); - // get the actual nicklist - $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$recipientid; - $oldnicklist = isset($_SESSION[$nicklist_sid]) ? $_SESSION[$nicklist_sid] : array(); - - $container =& $c->getContainerInstance(); - $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); + // take care to disconnect timeouted users on this channel $disconnected_users = $container->removeObsoleteNick($recipient,$c->timeout); foreach ($disconnected_users as $u) { $cmd =& pfcCommand::Factory("notice"); $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); } + + // get the cached nickname list + $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$recipientid; + $oldnicklist = isset($_SESSION[$nicklist_sid]) ? $_SESSION[$nicklist_sid] : array(); + + // get the real nickname list $users = $container->getOnlineNick($recipient); sort($users); // check if the nickname list must be updated Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-05-11 15:51:03 UTC (rev 488) +++ trunk/src/commands/update.class.php 2006-05-11 16:11:14 UTC (rev 489) @@ -12,9 +12,20 @@ // do not update if user isn't active (didn't connect) if ($u->active) { + $container =& $c->getContainerInstance(); + + // take care to disconnect timeouted users on the server + $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); + // if whould be possible to echo these disconnected users on a server tab + // server tab is not yet available so I just commente the code + // foreach ($disconnected_users as $u) + // { + // $cmd =& pfcCommand::Factory("notice"); + // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); + // } + // ----- // check if other user talk to me or not - $container =& $c->getContainerInstance(); $nickid = $container->getNickId($u->nick); $pvnicks = $container->getMeta("privmsg", "nickname", $nickid); if (is_string($pvnicks)) $pvnicks = unserialize($pvnicks); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-11 15:51:11
|
Revision: 488 Author: kerphi Date: 2006-05-11 08:51:03 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=488&view=rev Log Message: ----------- Bug fix: When I chat in 1:1. If one of the two members quit the discussion, closing this tab, if I speak again it will open a new tab for him, ok !! But if my correspondent quit the chat because he close his browser, it must appear off line, for the moment we could continue to chat with nobody... It could be fine to detect the off line status of the correspondent and display a "your correspondent is off line" message... Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php trunk/src/commands/send.class.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-05-11 15:11:34 UTC (rev 487) +++ trunk/src/commands/getonlinenick.class.php 2006-05-11 15:51:03 UTC (rev 488) @@ -13,6 +13,7 @@ $oldnicklist = isset($_SESSION[$nicklist_sid]) ? $_SESSION[$nicklist_sid] : array(); $container =& $c->getContainerInstance(); + $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); $disconnected_users = $container->removeObsoleteNick($recipient,$c->timeout); foreach ($disconnected_users as $u) { Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2006-05-11 15:11:34 UTC (rev 487) +++ trunk/src/commands/send.class.php 2006-05-11 15:51:03 UTC (rev 488) @@ -6,25 +6,54 @@ { function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { - $c =& $this->c; - $u =& $this->u; + $c =& $this->c; + $u =& $this->u; + $nick = phpFreeChat::FilterSpecialChar($sender); + $text = phpFreeChat::PreFilterMsg($param); - //$xml_reponse->addScript("alert('send: sender=".addslashes($sender)." param=".addslashes($param)." recipient=".addslashes($recipient)." recipientid=".addslashes($recipientid)."');"); - // check the nick is not allready known - $nick = phpFreeChat::FilterSpecialChar($sender); - $text = phpFreeChat::PreFilterMsg($param); - + // if this channel is a pv (one to one channel), + // first of all, check if the other user is connected + // if he is not connected anymore, display an error + $can_send = true; + if (isset($u->privmsg[$recipientid])) + { + $pvnick = $u->privmsg[$recipientid]["name"]; + // now check if this user is currently online + $container =& $c->getContainerInstance(); + $onlineusers = $container->getOnlineNick(NULL); + if (!in_array($pvnick,$onlineusers)) + { + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $clientid, _pfc("Can't send the message, %s is offline", $pvnick)); + $can_send = false; + } + } + + + // check the sent text is not empty and the user has a none empty nickname $errors = array(); if ($text == "") $errors[$c->prefix."words"] = _pfc("Text cannot be empty"); if ($nick == "") $errors[$c->prefix."handle"] = _pfc("Please enter your nickname"); - if (count($errors) == 0) + if (count($errors) > 0) { + // an error occured, just ignore the message and display errors + foreach($errors as $e) + if ($c->debug) pxlog("error /send, user can't send a message -> nick=".$u->nick." err=".$e, "chat", $c->getId()); + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $clientid, $errors); + if (isset($errors[$c->prefix."handle"])) // the nick is empty so give it focus + $xml_reponse->addScript("$('".$c->prefix."handle').focus();"); + $can_send = false; + } + + + // Now send the message if there is no errors + if ($can_send) + { $container =& $c->getContainerInstance(); $msgid = $container->write($recipient, $nick, "send", $text); if ($c->debug) pxlog("/send ".$text." (a user just sent a message -> nick=".$u->nick.")", "chat", $c->getId()); - - //$xml_reponse->addScript("alert('send: msgid=".$msgid."');"); // a message has been posted so : // - clear errors @@ -32,16 +61,6 @@ $xml_reponse->addScript("pfc.clearError(Array('".$c->prefix."words"."','".$c->prefix."handle"."'));"); $xml_reponse->addScript("$('".$c->prefix."words').focus();"); } - else - { - // an error occured, just ignore the message and display errors - foreach($errors as $e) - if ($c->debug) pxlog("error /send, user can't send a message -> nick=".$u->nick." err=".$e, "chat", $c->getId()); - $cmd =& pfcCommand::Factory("error"); - $cmd->run($xml_reponse, $clientid, $errors); - if (isset($errors[$c->prefix."handle"])) // the nick is empty so give it focus - $xml_reponse->addScript("$('".$c->prefix."handle').focus();"); - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-11 15:11:42
|
Revision: 487 Author: kerphi Date: 2006-05-11 08:11:34 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=487&view=rev Log Message: ----------- bug fix: do not open the pv tab when other user close the tab Modified Paths: -------------- trunk/src/phpfreechat.class.php Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-05-05 15:46:21 UTC (rev 486) +++ trunk/src/phpfreechat.class.php 2006-05-11 15:11:34 UTC (rev 487) @@ -343,7 +343,8 @@ { $recipient = $u->privmsg[$recipientid]["recipient"]; - if ($rawcmd != "update") + if ($rawcmd != "update" && + $rawcmd != "leave") // do not open the pv tab when other user close the tab { // alert the other from the new pv // (warn other user that someone talk to him) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-05-05 15:46:31
|
Revision: 486 Author: kerphi Date: 2006-05-05 08:46:21 -0700 (Fri, 05 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=486&view=rev Log Message: ----------- work on absolute urls Modified Paths: -------------- branches/0.x/contrib/dcChat/config.php Modified: branches/0.x/contrib/dcChat/config.php =================================================================== --- branches/0.x/contrib/dcChat/config.php 2006-04-29 17:59:27 UTC (rev 485) +++ branches/0.x/contrib/dcChat/config.php 2006-05-05 15:46:21 UTC (rev 486) @@ -1,6 +1,6 @@ <?php -require_once dirname(__FILE__)."/phpfreechat/src/phpfreechattools.class.php"; +require_once dirname(__FILE__)."/phpfreechat/src/pfctools.php"; require_once dirname(__FILE__)."/phpfreechat/src/phpfreechat.class.php"; function &getChat($room) @@ -9,12 +9,23 @@ if (!isset($chat)) { $params = array(); + $params["serverid"] = md5(__FILE__); $params["title"] = ""; $params["channel"] = $room; - $params["connect_at_startup"] = false; - $params["start_minimized"] = true; - $params["server_script_url"] = "ecrire/tools/dcchat/server_script.php?room=".$room; - $params["smileyurl"] = "ecrire/tools/dcchat/phpfreechat/smileys"; + // $params["connect_at_startup"] = false; + // $params["start_minimized"] = true; + + //echo "<pre>"; print_r($GLOBALS['news']); echo "</pre>"; + $url = $GLOBALS['theme_uri']."ecrire/tools/dcchat"; + echo $url; + $params["server_script_url"] = $url."/server_script.php?room=".$room; + // setup urls + $params["data_public_url"] = $url."/phpfreechat/data/public"; + //$params["client_script_url"] = "./demo21_with_hardcoded_urls.php"; + $params["themeurl"] = $url."/phpfreechat/themes"; + $params["themeurl_default"] = $url."/phpfreechat/themes"; + +// $params["smileyurl"] = "ecrire/tools/dcchat/phpfreechat/smileys"; // $params["debug"] = true; $chat = new phpFreeChat($params); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Paul S. <pso...@so...> - 2006-05-03 16:28:35
|
Dear project developers, This is test post to investigate issues with your mailing list. Please ignore this and any future test messages. Thank you, -- Paul Sokolovsky, http://sourceforge.net/users/pfalcon SourceForge developer http://sourceforge.net |
From: <ke...@us...> - 2006-04-29 17:59:35
|
Revision: 485 Author: kerphi Date: 2006-04-29 10:59:27 -0700 (Sat, 29 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=485&view=rev Log Message: ----------- Now a private chat is identified by the both nicknames ids. (it fixes a security hole : private chat takeover) Modified Paths: -------------- trunk/src/commands/privmsg.class.php trunk/src/commands/update.class.php trunk/src/phpfreechat.class.php Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2006-04-29 17:57:20 UTC (rev 484) +++ trunk/src/commands/privmsg.class.php 2006-04-29 17:59:27 UTC (rev 485) @@ -57,6 +57,7 @@ { $u->privmsg[$pvrecipientid]["recipient"] = $pvrecipient; $u->privmsg[$pvrecipientid]["name"] = $pvname; + $u->privmsg[$pvrecipientid]["pvnickid"] = $pvnickid; $u->saveInCache(); // clear the cached nicknames list for the given channel Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-04-29 17:57:20 UTC (rev 484) +++ trunk/src/commands/update.class.php 2006-04-29 17:59:27 UTC (rev 485) @@ -15,12 +15,13 @@ // ----- // check if other user talk to me or not $container =& $c->getContainerInstance(); - $pvnicks = $container->getMeta("privmsg", "nickname", $u->nick); + $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", $u->nick); + $container->rmMeta("privmsg", "nickname", $nickid); // ----- // update the user nickname timestamp Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-04-29 17:57:20 UTC (rev 484) +++ trunk/src/phpfreechat.class.php 2006-04-29 17:59:27 UTC (rev 485) @@ -348,14 +348,14 @@ // 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]["name"]); + $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)) { $pvs[] = $u->nick; // $xml_reponse->addScript("alert('pvs[]=".serialize($pvs)."');"); - $container->setMeta(serialize($pvs), "privmsg", "nickname", $u->privmsg[$recipientid]["name"]); + $container->setMeta(serialize($pvs), "privmsg", "nickname", $u->privmsg[$recipientid]["pvnickid"]); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-29 17:57:29
|
Revision: 484 Author: kerphi Date: 2006-04-29 10:57:20 -0700 (Sat, 29 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=484&view=rev Log Message: ----------- optimization: add a cache for the nickname list Modified Paths: -------------- trunk/src/containers/file.class.php trunk/testcase/container_generic.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-04-28 22:34:41 UTC (rev 483) +++ trunk/src/containers/file.class.php 2006-04-29 17:57:20 UTC (rev 484) @@ -29,8 +29,8 @@ */ class pfcContainer_File extends pfcContainer { - // var $_users = array(); - //var $_cache_nickid = array(); + var $_users = array(); + var $_cache_nickid = array(); function pfcContainer_File(&$config) { @@ -118,10 +118,6 @@ flock ($fp, LOCK_UN); // unlock fclose($fp); - - // if (!in_array($nickname, $this->_users)) - // $this->_users[] = $nickname; // _users will be used by getOnlineUserList - return true; } @@ -150,14 +146,13 @@ @unlink($nick_filename); - /* // remove the nickname from the cache list - if (in_array($nick, $this->_users)) + if (isset($this->_users[$chan]) && + in_array($nick, $this->_users[$chan])) { - $key = array_search($nick, $this->_users); - unset($this->_users[$key]); + $key = array_search($nick, $this->_users[$chan]); + unset($this->_users[$chan][$key]); } - */ return true; } @@ -182,6 +177,13 @@ if (file_exists($nick_filename)) $there = true; @touch($nick_filename); @chmod($nick_filename, 0777); + + // append the nickname to the cache list + if (isset($this->_users[$chan]) && + !in_array($nick, $this->_users[$chan])) + { + $this->_users[$chan][] = $nick; + } return $there; } @@ -204,6 +206,20 @@ $oldnick_filename = $nick_dir."/".$this->_encode($oldnick); $ok = @rename($oldnick_filename, $newnick_filename); + + // update the nick cache list + if($ok) + { + if (isset($this->_users[$chan]) && + in_array($oldnick, $this->_users[$chan])) + { + // remove the oldnick from the cache + $key = array_search($oldnick, $this->_users[$chan]); + unset($this->_users[$chan][$key]); + // append the new nick to the cache + $this->_users[$chan][] = $newnick; + } + } return $ok; } @@ -216,33 +232,31 @@ */ function getNickId($nickname) { - //if (!isset($this->_cache_nickid[$nickname])) - //{ - $c =& $this->c; - $nickid = "undefined"; - - $nick_dir = $c->container_cfg_server_dir."/nicknames"; - $nick_filename = $nick_dir."/".$this->_encode($nickname); - - if (file_exists($nick_filename)) + if (!isset($this->_cache_nickid[$nickname])) { - $fsize = filesize($nick_filename); - if ($fsize>0) + $c =& $this->c; + $nickid = "undefined"; + + $nick_dir = $c->container_cfg_server_dir."/nicknames"; + $nick_filename = $nick_dir."/".$this->_encode($nickname); + + if (file_exists($nick_filename)) { - // write the nickid into the new nickname file - $fp = fopen($nick_filename, "r"); - $nickid = fread($fp, $fsize); - if ($nickid == "") $nickid = "undefined"; - fclose($fp); + $fsize = filesize($nick_filename); + if ($fsize>0) + { + // write the nickid into the new nickname file + $fp = fopen($nick_filename, "r"); + $nickid = fread($fp, $fsize); + if ($nickid == "") $nickid = "undefined"; + fclose($fp); + } } + $this->_cache_nickid[$nickname] = $nickid; } - //$this->_cache_nickid[$nickname] = $nickid; - //if ($c->debug) pxlog("getNickId[".$c->sessionid."]: nickname=".$nickname." nickid=".$nickid, "chat", $c->getId()); - //} - return $nickid; //$this->_cache_nickid[$nickname]; + return $this->_cache_nickid[$nickname]; } - /** * Remove (disconnect/quit) the timeouted nickname from the server or from a channel * Notice: this function must remove all nicknames which are not uptodate from the given channel or from the server @@ -278,7 +292,8 @@ } } - // $this->_users =& $users; // _users will be used by getOnlineUserList + // cache the updated user list + $this->_users[$chan] =& $users; return $deleted_user; } @@ -290,8 +305,10 @@ */ function getOnlineNick($chan) { - // if (is_array($this->_users)) - // return $this->_users; + // return the cached user list if it exists + if (isset($this->_users[$chan]) && + is_array($this->_users[$chan])) + return $this->_users[$chan]; $c =& $this->c; @@ -306,6 +323,10 @@ if ($file == "." || $file == "..") continue; // skip . and .. generic files $users[] = $this->_decode($file); } + + // cache the user list + $this->_users[$chan] =& $users; + return $users; } Modified: trunk/testcase/container_generic.php =================================================================== --- trunk/testcase/container_generic.php 2006-04-28 22:34:41 UTC (rev 483) +++ trunk/testcase/container_generic.php 2006-04-29 17:57:20 UTC (rev 484) @@ -177,27 +177,27 @@ // on the channel $this->ct->createNick($chan, $nick, $nickid); $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the channel"); + $this->assertTrue(in_array($nick, $online_nick), "1-nickname should be online on the channel"); sleep(2); $ret = $this->ct->updateNick($chan, $nick); - $this->assertTrue($ret, "nickname should be correctly updated on the channel"); + $this->assertTrue($ret, "2-nickname should be correctly updated on the channel"); $ret = $this->ct->removeObsoleteNick($chan, "1000"); - $this->assertFalse(in_array($nick, $ret), "nickname should not be removed from the channel because it has been updated"); + $this->assertFalse(in_array($nick, $ret), "3-nickname should not be removed from the channel because it has been updated"); $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the channel"); + $this->assertTrue(in_array($nick, $online_nick), "4-nickname should be online on the channel"); // on the server $chan = NULL; $this->ct->createNick($chan, $nick, $nickid); $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the server"); + $this->assertTrue(in_array($nick, $online_nick), "5-nickname should be online on the server"); sleep(2); $ret = $this->ct->updateNick($chan, $nick); - $this->assertTrue($ret, "nickname should be correctly updated on the server"); + $this->assertTrue($ret, "6-nickname should be correctly updated on the server"); $ret = $this->ct->removeObsoleteNick($chan, "1000"); - $this->assertFalse(in_array($nick, $ret), "nickname should not be removed from the server because it has been updated"); + $this->assertFalse(in_array($nick, $ret), "7-nickname should not be removed from the server because it has been updated"); $online_nick = $this->ct->getOnlineNick($chan); - $this->assertTrue(in_array($nick, $online_nick), "nickname should be online on the server"); + $this->assertTrue(in_array($nick, $online_nick), "8-nickname should be online on the server"); } function testchangeNick_Generic() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-28 22:34:48
|
Revision: 483 Author: kerphi Date: 2006-04-28 15:34:41 -0700 (Fri, 28 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=483&view=rev Log Message: ----------- 0.9.3 release Added Paths: ----------- tags/0.9.3/ Copied: tags/0.9.3 (from rev 482, branches/0.x) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-28 22:27:56
|
Revision: 481 Author: kerphi Date: 2006-04-28 13:12:59 -0700 (Fri, 28 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=481&view=rev Log Message: ----------- documentation update Modified Paths: -------------- branches/0.x/INSTALL.en branches/0.x/INSTALL.fr branches/0.x/README.en branches/0.x/README.fr Added Paths: ----------- branches/0.x/CUSTOMIZE.en branches/0.x/README.ar Added: branches/0.x/CUSTOMIZE.en =================================================================== --- branches/0.x/CUSTOMIZE.en (rev 0) +++ branches/0.x/CUSTOMIZE.en 2006-04-28 20:12:59 UTC (rev 481) @@ -0,0 +1,79 @@ + + phpFreeChat was developped with an aim of simplicity and flexibilty. + + Setting it up is relatively simple. All parameters are centralized in an + array and passed as parameters on the instantiation of the phpFreeChat + object. + + We can thus : + + * Customization of the overall appearance (colors, sizes ...) + * Customization of the smileys list + * Write a new command + * Write your own container + + Customization of the overall appearance (colors, sizes ...) + + You need to create a new theme (for example mytheme) : + + 1. Create a directory: phpfreechat/themes/mytheme/ + 2. Create a new CSS stylesheet: + phpfreechat/themes/mytheme/templates/style.css.tpl.php + 3. Now insert CSS rules into this file, for example, to change the + date/hours color to red: + span.<?php echo $prefix; ?>heure, span.<?php echo $prefix; ?>date { + color: red; + } + + Notice: use the <?php echo $prefix; ?> to prefix the CSS classes + selectors in order to keep compatibility if the prefix is changed + later. + 4. Setup the theme parameter in your chat script: + $params["theme"] = "mytheme"; + + + As an examples, see these demos: 1[23], 2[24] + + Customization of the smileys list + + Follow the above instructions for the theme creation. Then I suppose you + have a directory phpfreechat/themes/mytheme/. + + 1. Create a new smileys directory: phpfreechat/themes/mytheme/smileys/ + 2. Insert ping, jpeg or gif smileys images in the folder for example : + smiley1.png, smiley2.gif, and smiley3.jpg + 3. Create a file phpfreechat/themes/mytheme/smileys/theme and enter + the keyboard to image mapping smileys' description, for example : + smiley1.png :) :-) + smiley2.gif :( :-( + smiley3.jpg :D :-D :o) + + Each line begins with the image filename followed by the list of + the string characters to replace by that image. Only use spaces to + separate the smileys string matches. + 4. Setup the theme parameter in your chat script: + $params["theme"] = "mytheme"; + + + + Write a new command + + @todo : to write + + + Write your own container + + @todo : to write + + + + + ©2006 phpFreeChat + + + +-------------------------------------------------------------- +List of References + +Document's URL: http://www.phpfreechat.net/customize.en.html + Modified: branches/0.x/INSTALL.en =================================================================== --- branches/0.x/INSTALL.en 2006-04-28 20:12:16 UTC (rev 480) +++ branches/0.x/INSTALL.en 2006-04-28 20:12:59 UTC (rev 481) @@ -1,3 +1,45 @@ +Document's Title: PHP FREE CHAT - Free PHP + AJAX chat + +php Free Chat + + logo bulle + + This page in english[1] Cette page en français[2] [3] + + phpMyVisites + + * General + * o News[4] + o Overview[5] + o Demo[6] + o Screenshots[7] + o Downloads[8] + o Who uses it ?[9] + o FAQ[10] + o Contact us[11] + o Partners[12] + o Forum[13] + * Documentation + * o Install[14] + o Customize[15] + o Required configuration[16] + * Developers + * o Roadmap[17] + o Bugs list[18] + o ChangeLog[19] + o Contributions[20] + + logo big[21] + + HotScripts.com[22] + + + + If you like our script, please rate it! + + Excellent! <<Rate>> + + Install To install phpFreeChat you need: @@ -15,7 +57,7 @@ Using the setup (the easy way): - 1. Download phpfreechat-x.x-setup.php[21] (lastest version) + 1. Download phpfreechat-x.x-setup.php[23] (lastest version) 2. Upload the setup script on your server into a browsable directory (public directory) 3. Browse the script with your personnal browser, it should launch a @@ -25,7 +67,7 @@ Using the ziped archives (for those who havn't gzip module in their php): - 1. Download phpfreechat-x.x.zip (or .tar.gz for linux users)[22] + 1. Download phpfreechat-x.x.zip (or .tar.gz for linux users)[24] (lastest version) 2. Unzip the archive localy then upload the phpfreechat-x.x directory on your server into a browsable directory (public directory). @@ -59,6 +101,7 @@ "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(); ?> @@ -123,10 +166,10 @@ channel Used to create a room. Technicaly this parameter is used to choose the data (messages + nicknames) storage destination. For a better - explaination, see this FAQ entry[23]. + explaination, see this FAQ entry[25]. (auto-generated string based on the title parameter by default) frozen_nick - Setting this to true will forbid the user to change his nickname + Setting this to true will forbid the user to change his/her nickname later. (false value by default) max_nick_len @@ -148,6 +191,18 @@ This is the message history length. When a user connects, he can see the history. The number of messages s/he can see is defined by this (20 lines by default) + quit_on_closedwindow + Setting this to true will send a /quit command when the user close + his window (doesn't work on Firefox). It's not set to true by + default because on IE and Konqueror/Safari, when the user reload his + page this event occurs. + (false value by default) + focus_on_connect + Setting this to true will give the focus to the input text box when + connecting to the chat. It can be usefull not touch the focus when + integrating the chat into an existing website because when the focus + is changed, the viewport follows the focus location. + (true value by default) connect_at_startup Setting this to false will oblige user to click on the connect button if s/he wants to chat. @@ -163,11 +218,11 @@ Width of the chat area. ("" by default, means it's given by the CSS) shownotice - Setting this to 0 will disable nickname change notices and - connect/disconnect notices. Setting it to 1 will only disable - connect/disconnect notices. Setting it to 2 will show all notice - types. - (2 by default) + Setting this to 0 will show nothing. Setting it to 1 will show + nicknames changes. Setting it to 2 will show connect/disconnect + notifications. Setting it to 3 (1+2) will show nicknames and + connect/disconnect notifications. + (3 by default) nickmarker Setting it to false will disable nickname colorization. (true value by default) @@ -228,7 +283,7 @@ client script browable url (useful when using url rewriting). (by default these parameters are auto-detected) useie7 - Setting this to false will disable IE7[24] scripts used to improve + Setting this to false will disable IE7[26] scripts used to improve display for the crappy Internet Explorer. (true value by default) ie7path @@ -239,7 +294,7 @@ Specify the javascript libraries path (md5, cookie ...). (dirname(__FILE__)."/../lib/javascript" by default) smartypath - Specify the Smarty[25] path. It's useful if you allready have a + Specify the Smarty[27] path. It's useful if you allready have a Smarty library installed and you want to save bytes on your server. (dirname(__FILE__)."/../lib/Smarty-2.6.7" by default) usecsstidy @@ -248,18 +303,18 @@ (false value by default because it make problems on strange server configurations) csstidypath - Specify the CSS Tidy[26] library path. It's useful if you allready + Specify the CSS Tidy[28] library path. It's useful if you allready have a Smarty library installed and you want to save bytes on your server. (dirname(__FILE__)."/../lib/csstidy-1.1" by default) xajaxpath - Specify the xajax[27] path. It's useful if you allready have a xajax + Specify the xajax[29] path. It's useful if you allready have a xajax library installed and you want to save bytes on your server. (dirname(__FILE__)."/../lib/xajax_0.2_stable" by default); data_private_path Used by the filesystem container to store chat data. Used by smarty to store compiled templates. Tip: you can optimize your chat - performances, see this FAQ entry[28]. + performances, see this FAQ entry[30]. (dirname(__FILE__)."/../data/private" by default) data_public_path and data_public_url This path must be reachable by your web server. IE7 scripts and @@ -281,18 +336,51 @@ order to avoid variables overlaps. ("phpfreechat_" by default) - \xA92006 phpFreeChat + RSS[31] + Valid XHTML 1.0![32] Valid CSS![33] Created with Amaya[34] + ©2006 phpFreeChat + + -------------------------------------------------------------- List of References Document's URL: http://www.phpfreechat.net/install.en.html -[23] faq.en.html#multiple-channels -[24] http://dean.edwards.name/IE7/ -[25] http://smarty.php.net/ -[26] http://csstidy.sourceforge.net/index.php -[27] http://www.xajaxproject.org/ -[28] faq.en.html#tmpfs +style/generic.cssstyle/header.cssstyle/footer.cssstyle/menu.cssstyle/content.cssstyle/install.css +[1] install.en.html +[2] install.fr.html +[3] install.ar.html +[4] news.en.html +[5] overview.en.html +[6] demo.en.php +[7] screenshot.en.html +[8] download.en.html +[9] whouses.en.html +[10] faq.en.html +[11] contact.en.html +[12] partners.en.html +[13] forum/ +[14] install.en.html +[15] customize.en.html +[16] requiredconfig.en.html +[17] roadmap.en.html +[18] buglist.en.html +[19] changelog.en.html +[20] contributions.en.html +[21] http://www.phpfreechat.net +[22] http://www.hotscripts.com/?RID=N452772 +[23] download.en.html +[24] download.en.html +[25] faq.en.html#multiple-channels +[26] http://dean.edwards.name/IE7/ +[27] http://smarty.php.net/ +[28] http://csstidy.sourceforge.net/index.php +[29] http://www.xajaxproject.org/ +[30] faq.en.html#tmpfs +[31] forum/extern.php?action=active&type=RSS&fid=7 +[32] http://validator.w3.org/check?uri=referer +[33] http://jigsaw.w3.org/css-validator/check/referer +[34] http://www.w3.org/Amaya Modified: branches/0.x/INSTALL.fr =================================================================== --- branches/0.x/INSTALL.fr 2006-04-28 20:12:16 UTC (rev 480) +++ branches/0.x/INSTALL.fr 2006-04-28 20:12:59 UTC (rev 481) @@ -1,3 +1,47 @@ +Document's Title: PHP FREE CHAT - Chat gratuit en PHP + AJAX + +php Free Chat + + logo bulle + + This page in english[1] Cette page en français[2] [3] + + phpMyVisites + + * Général + * o Nouvelles[4] + o Présentation[5] + o Démonstration[6] + o Captures d'écrans[7] + o Télécharger[8] + o Qui l'utilise ?[9] + o FAQ[10] + o Contactez nous[11] + o Partenaires[12] + o Forum [en][13] + * Documentation + * o Installation[14] + o Paramétrage[15] + o Configuration recommandée[16] + * Développeurs + * o Feuille de route[17] + o Liste de bug[18] + o Historique[19] + o Contributions[20] + + logo big[21] + + HotScripts.com[22] + + + + Si vous aimez ce script, votez! + + Excellent! <<Voter>> + + + + Installation Vous avez besoin de : @@ -3,37 +47,37 @@ * Un serveur Web (apache, IIS ...) avec le module php (4 ou 5) - * Un acces en \xE9criture sur ce serveur Web (ssh, FTP ou autre) + * Un acces en écriture sur ce serveur Web (ssh, FTP ou autre) - Par d\xE9faut, vous n'avez pas besoin d'une base de donn\xE9e Mysql car des - simples fichiers sont utilis\xE9s pour stoquer les informations. + Par défaut, vous n'avez pas besoin d'une base de donnée Mysql car des + simples fichiers sont utilisés pour stoquer les informations. * En avant! - * Configuration avanc\xE9e + * Configuration avancée En avant! Pour les feignants: - 1. T\xE9l\xE9chargez le script d'installation auto-extractible : - phpfreechat-x.x-setup.php[21] (la derni\xE8re version de pr\xE9f\xE9rence) - 2. Uploadez le script dans un r\xE9pertoire accessible par votre - navigateur (r\xE9pertoire publique) - 3. Lancez votre navigateur et ex\xE9cutez le script d'installation que + 1. Téléchargez le script d'installation auto-extractible : + phpfreechat-x.x-setup.php[23] (la dernière version de préférence) + 2. Uploadez le script dans un répertoire accessible par votre + navigateur (répertoire publique) + 3. Lancez votre navigateur et exécutez le script d'installation que vous venez d'uploader, ceci devrait lancer une interface - d'installation, suivez alors les \xE9tapes ! - Astuce : supprimez le scripte d'installation une fois termin\xE9 pour - des raisons de s\xE9curit\xE9. + d'installation, suivez alors les étapes ! + Astuce : supprimez le scripte d'installation une fois terminé pour + des raisons de sécurité. - Pour les utilisateurs avanc\xE9s ou pour ceux qui n'ont pas gzip install\xE9 + Pour les utilisateurs avancés ou pour ceux qui n'ont pas gzip installé sur leur serveur: - 1. T\xE9l\xE9chargez l'archive zip (ou tag.gz pour les utilisateurs linux) : - phpfreechat-x.x.zip[22] (la derni\xE8re version de pr\xE9f\xE9rence) - 2. D\xE9compressez l'archive localement et uploadez le r\xE9sultat sur votre - serveur dans un r\xE9pertoire accessible par votre navigateur. - Astuce: si vous avez un acc\xE8s SSH, je vous conseil d'uploader - l'archive tar.gz puis de la d\xE9compresser directement sur le serveur - avec la commande tar xzf phpfreechat-x.x.tar.gz - 3. Donnez les droits en \xE9criture aux r\xE9pertoires + 1. Téléchargez l'archive zip (ou tag.gz pour les utilisateurs linux) + : phpfreechat-x.x.zip[24] (la dernière version de préférence) + 2. Décompressez l'archive localement et uploadez le résultat sur + votre serveur dans un répertoire accessible par votre navigateur. + Astuce: si vous avez un accès SSH, je vous conseil d'uploader + l'archive tar.gz puis de la décompresser directement sur le + serveur avec la commande tar xzf phpfreechat-x.x.tar.gz + 3. Donnez les droits en écriture aux répertoires phpfreechat-x.x/data/public et phpfreechat-x.x/data/private Si vous utilisez FTP, voici les commandes: @@ -44,17 +88,17 @@ Si vous utilisez SSH, voici les commandes: chmod a+w phpfreechat-x.x/data/* - 4. Pour terminer : lancez votre navigateur et ouvrez le r\xE9pertoire + 4. Pour terminer : lancez votre navigateur et ouvrez le répertoire phpfreechat-x.x sur votre serveur ! - Vous d\xE9sirez certainement param\xE9trer votre propre chat, pour cela prenez - exemple sur les scriptes du r\xE9pertoire phpfreechat-x.x/demo. + Vous désirez certainement paramétrer votre propre chat, pour cela + prenez exemple sur les scriptes du répertoire phpfreechat-x.x/demo. - Voila le script minimum pour que le chat fonctionne (inspir\xE9 de demo1) : + Voila le script minimum pour que le chat fonctionne (inspiré de demo1) : <?php - require_once "src/phpfreechat.class.php"; // pensez \xE0 ajuster le chemin + require_once "src/phpfreechat.class.php"; // pensez à ajuster le chemin $params["serverid"] = md5(__FILE__); // permet d'identifier ce chat $chat = new phpFreeChat($params); @@ -63,6 +107,7 @@ "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(); ?> @@ -72,12 +117,12 @@ </body> </html> - Configuration avanc\xE9e + Configuration avancée - Le chat fonctionne tr\xE8s bien en laissant les param\xE8tres par d\xE9faut mais - de nombreuses options peuvent \xEAtre r\xE9gl\xE9es. Par exemple, pour changer le - temps de rafraichissement \xE0 2 secondes (par d\xE9faut c'est 5 secondes), - voila ce qu'il faut faire : + Le chat fonctionne très bien en laissant les paramètres par défaut + mais de nombreuses options peuvent être réglées. Par exemple, pour + changer le temps de rafraichissement à 2 secondes (par défaut c'est 5 + secondes), voila ce qu'il faut faire : <?php @@ -90,256 +135,307 @@ [... copiez/coller le code HTML vu plus haut ...] Un autre exemple: vous souhaitez que vos utilisateur n'entrent pas de - pseudonymes \xE0 leur arriv\xE9 sur le chat et qu'un pseudo "invit\xE9" leur oit - assign\xE9 automatiquement (ceci est tr\xE8s utile pour integrer le chat dans - un forum, un portail ou tout autre syst\xE8me o\xF9 l'utilisateur est d\xE9ja - authentifi\xE9), voila ce qu'il faut faire : + pseudonymes à leur arrivé sur le chat et qu'un pseudo "invité" leur + oit assigné automatiquement (ceci est très utile pour integrer le chat + dans un forum, un portail ou tout autre système où l'utilisateur est + déja authentifié), voila ce qu'il faut faire : <?php require_once "src/phpfreechat.class.php"; // ajustez le chemin $params["serverid"] = md5(__FILE__); - $params["nick"] = "guest"; // ce pseudo peut-\xEAtre r\xE9cup\xE9r\xE9 depuis une base de donn\xE9es + $params["nick"] = "guest"; // ce pseudo peut-être récupéré depuis une base de données $chat = new phpFreeChat($params); ?> [... copiez/coller le code HTML vu plus haut ...] - Maintenant voyons la liste exaustive des param\xE8tres : + Maintenant voyons la liste exaustive des paramètres : serverid - C'est leur seule param\xE8tre obligatoire. C'est l'identifiant du chat, - "son IP" (comparable \xE0 l'adresse (host) d'un serveur IRC) utilis\xE9 - pour diff\xE9rencer ce chat d'un autre. Deux chats doivent avoir des - serverid diff\xE9rents. Si vous ne savez pas quoi mettre, ceci - fonctionnera dans la majorit\xE9 des cas : $params["serverid"] = + C'est leur seule paramètre obligatoire. C'est l'identifiant du + chat, "son IP" (comparable à l'adresse (host) d'un serveur IRC) + utilisé pour différencer ce chat d'un autre. Deux chats doivent + avoir des serverid différents. Si vous ne savez pas quoi mettre, + ceci fonctionnera dans la majorité des cas : $params["serverid"] = md5(__FILE__); nick - Ce param\xE8tre est tr\xE8s utile si vous connaissez \xE0 l'avance les - pseudonymes des utilisateurs, par exemple si vous souhaitez int\xE9grer - le chat \xE0 un forum ou a un portail qui poss\xE8de d\xE9j\xE0 un syst\xE8me - d'authentification. Il suffit de renseigner le pseudonyme de - l'utilisateur concern\xE9 dans cette option et l'utilisateur sera alors - automatiquement connect\xE9 avec son pseudonyme, il n'aura pas \xE0 - choisir son pseudo lors de la premi\xE8re connexion. - Attention : Les pseudonymes doivent \xEAtre encod\xE9s en UTF-8. Si par - exemple vos pseudo viennent d'une base de donn\xE9e o\xF9 ils sont encod\xE9s - en ISO-8859-1, vous devez les convertir : $params["nick"] = + Ce paramètre est très utile si vous connaissez à l'avance les + pseudonymes des utilisateurs, par exemple si vous souhaitez + intégrer le chat à un forum ou a un portail qui possède déjà un + système d'authentification. Il suffit de renseigner le pseudonyme + de l'utilisateur concerné dans cette option et l'utilisateur sera + alors automatiquement connecté avec son pseudonyme, il n'aura pas + à choisir son pseudo lors de la première connexion. + Attention : Les pseudonymes doivent être encodés en UTF-8. Si par + exemple vos pseudo viennent d'une base de donnée où ils sont + encodés en ISO-8859-1, vous devez les convertir : $params["nick"] = iconv("ISO-8859-1", "UTF-8", $bdd_nickname); (bien sur changez la - variable $bdd_nickname \xE0 votre convenance) - Remarque : Cette option peut-\xEAtre utilis\xE9e conjointement \xE0 l'option - frozen_nick pour emp\xEAcher l'utilisateur de changer de nom. - ("" par d\xE9faut, signifie que les utilisateurs doivent choisir leur + variable $bdd_nickname à votre convenance) + Remarque : Cette option peut-être utilisée conjointement à + l'option frozen_nick pour empêcher l'utilisateur de changer de nom. + ("" par défaut, signifie que les utilisateurs doivent choisir leur pseudonymes quand ils se connectent) title - Permet de changer le titre du chat, c'est \xE0 dire le texte qui + Permet de changer le titre du chat, c'est à dire le texte qui s'affiche en haut. - ("My phpFreeChat" est la valeur par d\xE9faut) + ("My phpFreeChat" est la valeur par défaut) channel - Permet de cr\xE9er un salon. Techniquement, ce param\xE8tre permet de - choisir o\xF9 vont \xEAtre stock\xE9s les messages et les pseudonymes du - chat. Pour une explication plus d\xE9taill\xE9es voyez le paragraphe - suivant[23] dans la FAQ. - (par d\xE9faut, il est calcul\xE9 automatiquement \xE0 partir du title) + Permet de créer un salon. Techniquement, ce paramètre permet de + choisir où vont être stockés les messages et les pseudonymes du + chat. Pour une explication plus détaillées voyez le paragraphe + suivant[25] dans la FAQ. + (par défaut, il est calculé automatiquement à partir du title) frozen_nick - Mettre cette option \xE0 true va tout simplement emp\xEAcher les + Mettre cette option à true va tout simplement empêcher les utilisateurs de changer leur pseudonymes. Cela sous entends que le - pseudonyme \xE0 \xE9t\xE9 automatiquement assign\xE9 (voir l'option nick) - (false par d\xE9faut) + pseudonyme à été automatiquement assigné (voir l'option nick) + (false par défaut) max_nick_len C'est la longeur maximale que peut avoir un pseudonyme - (15de caract\xE8res par d\xE9faut) + (15de caractères par défaut) max_text_len C'est la longeur maximale que peut avoir un message. - ( 250 caract\xE8res par d\xE9faut) + ( 250 caractères par défaut) refresh_delay - Ceci est le temps \xE0 attendre entre chaque rafrechissements. Un - rafrechissement correspond \xE0 une requete HTTP demandant au serveur - si il y a quelque chose de nouveau \xE0 afficher ou pas. S'il n'y a - rien de nouveau alors la r\xE9ponse HTTP est vide. - ( 5000ms = 5s par d\xE9faut) + Ceci est le temps à attendre entre chaque rafrechissements. Un + rafrechissement correspond à une requete HTTP demandant au serveur + si il y a quelque chose de nouveau à afficher ou pas. S'il n'y a + rien de nouveau alors la réponse HTTP est vide. + ( 5000ms = 5s par défaut) timeout - Ceci est le temps d'inactivit\xE9 \xE0 attendre avant de d\xE9connecter un + Ceci est le temps d'inactivité à attendre avant de déconnecter un utilisateur (en millisecondes). - ( 20000ms = 20s par d\xE9faut) + ( 20000ms = 20s par défaut) max_msg - Ceci est la taille de l'historique, c'est \xE0 dire le nombre de - messages gard\xE9s en m\xE9moire. Quand un utilisateur se connect, il voit - automatiquement les messages de l'historique. Le nombre de messages - qu'il voit est d\xE9finit par ce param\xE8tre - (20 lignes par d\xE9faut) + Ceci est la taille de l'historique, c'est à dire le nombre de + messages gardés en mémoire. Quand un utilisateur se connect, il + voit automatiquement les messages de l'historique. Le nombre de + messages qu'il voit est définit par ce paramètre + (20 lignes par défaut) + quit_on_closedwindow + Mettre ce paramètre à true permet d'envoyer une commande /quit + lorsque l'utilisateur ferme sa fenêtre (ne fonctionne pas sour + Firefox). Ce paramètre n'est pas a true par défaut car sous IE, + Safari et Konqueror : lorsque l'utilisateur recharge sa fenêtre le + même évenement est envoyé ce qui surcharge de messages le chat. + (false par défaut) + focus_on_connect + Mettre ce parametre à true permet de placer le curseur directement + dans la zone de saisie du chat après la connexion. Il peut être + intéressant de passer ce paramètre à false lorsque l'on intégre + le chat dans un site Web car lorsque le focus change, la vue de + l'utilisateur dans la fenêtre change aussi, elle suit le focus. + Lorsque la page est grande la bar de scroll peut alors se déplacer + de façon involontaire. + (true par défaut) connect_at_startup - Mettre cette option \xE0 false obligera les utilisateurs \xE0 cliquer sur - l'icone de connexion pour tchater. - (true par d\xE9faut, signifie que les utilisateurs sont automatiquement - connect\xE9s lorsque la page du chat est ouverte) + Mettre cette option à false obligera les utilisateurs à cliquer + sur l'icone de connexion pour tchater. + (true par défaut, signifie que les utilisateurs sont + automatiquement connectés lorsque la page du chat est ouverte) start_minimized - Mettre cette option \xE0 true minimizera le chat au premier chargement + Mettre cette option à true minimizera le chat au premier chargement de la page. - (false par d\xE9faut) + (false par défaut) height Hauteur de la zone de chat - (440px par d\xE9faut) + (440px par défaut) width Largeur de la zone de chat - ("" par d\xE9faut, signifie que la valeur est assign\xE9es dans les CSS) + ("" par défaut, signifie que la valeur est assignées dans les CSS) shownotice Trois valeurs sont possibles : 0 pour ne rien afficher (ni les notices de connexion/deconnexion, ni les changements de pseudo), 1 - pour afficher seulement les changements de pseudo, 2 pour afficher - les changements de pseudo et les connexions/deconnexions. - (2 par d\xE9faut) + pour afficher les changements de pseudo, 2 pour afficher les + connexions/deconnexions, 3 (1+2) pour afficher les changements de + pseudo et les connexions/deconnexions. + (3 par défaut) nickmarker - Mettre cette option \xE0 false d\xE9sactivera la colorisation des + Mettre cette option à false désactivera la colorisation des pseudonymes. - (true par d\xE9faut) + (true par défaut) clock - Mettre cette option \xE0 false d\xE9sactivera l'affichage de la date et de - l'heure. - (true par d\xE9faut) + Mettre cette option à false désactivera l'affichage de la date et + de l'heure. + (true par défaut) openlinknewwindow - Mettre cette option \xE0 true permettra d'ouvrire les liens des - convertations dans une nouvelle fen\xEAtre. Techniquement cela rajoute + Mettre cette option à true permettra d'ouvrire les liens des + convertations dans une nouvelle fenêtre. Techniquement cela rajoute l'attribut target="_blank" dans la balise du lien. - (true par d\xE9faut) + (true par défaut) showwhosonline - Permet de cacher/montrer la liste des utilisateurs connect\xE9s lors du - premier affichage du chat. - Utilisez btn_sh_whosonline pour d\xE9sactiver compl\xE8tement la - possibilit\xE9 de voir la liste des pseudonymes. - (true par d\xE9faut) + Permet de cacher/montrer la liste des utilisateurs connectés lors + du premier affichage du chat. + Utilisez btn_sh_whosonline pour désactiver complètement la + possibilité de voir la liste des pseudonymes. + (true par défaut) showsmileys Permet de cacher/montrer la liste des smileys lors du premier affichage du chat. - Utilisez btn_sh_smileys pour d\xE9sactiver compl\xE8tement la possibilit\xE9 - de voir la liste des smileys. - (true par d\xE9faut) + Utilisez btn_sh_smileys pour désactiver complètement la + possibilité de voir la liste des smileys. + (true par défaut) btn_sh_whosonline Permet de cacher ou montrer le bouton showwhosonline (celui qui permet de cacher/montrer la liste des pseudonymes) - (true par d\xE9faut) + (true par défaut) btn_sh_smileys Permet de cacher ou montrer le bouton showsmileys (celui qui permet de cacher/montrer la liste des smileys) - (true par d\xE9faut) + (true par défaut) themeurl - Permet de sp\xE9cifier l'url \xE0 utiliser pour acceder aux themes (tr\xE8s - utile pour la r\xE9\xE9criture d'url) - (ce param\xE8tre est automatiquement calcul\xE9 en fonction de themepath + Permet de spécifier l'url à utiliser pour acceder aux themes + (très utile pour la réécriture d'url) + (ce paramètre est automatiquement calculé en fonction de themepath themepath - Le chemin vers les themes. Les sous r\xE9pertoires sont les diff\xE9rents - thems disponibles. - (dirname(__FILE__)."/../themes" par d\xE9faut) + Le chemin vers les themes. Les sous répertoires sont les + différents thems disponibles. + (dirname(__FILE__)."/../themes" par défaut) theme - Ce peram\xE8tre permet de sp\xE9cifier quelle theme utiliser. La liste des - themes possible sont les nom des sous r\xE9pertoires de themepath. - ("default" par d\xE9faut) + Ce peramètre permet de spécifier quelle theme utiliser. La liste + des themes possible sont les nom des sous répertoires de themepath. + ("default" par défaut) language - Permet d'afficher le chat dans une langue donn\xE9e. Les valeurs - possibles sont les nom des sous r\xE9pertoires de i18n. - (par d\xE9faut la langue est celle du serveur qui h\xE9berge le chat) + Permet d'afficher le chat dans une langue donnée. Les valeurs + possibles sont les nom des sous répertoires de i18n. + (par défaut la langue est celle du serveur qui héberge le chat) output_encoding - Permet de sp\xE9cifier l'encodage \xE0 utiliser pour afficher les labels. - Concretement ce param\xE8tre doit correspondre \xE0 l'encodage de la page - Web contenant le chat. - (par d\xE9faut UTF-8, c'est \xE0 dire aucun transcodage car les messages - sont stoqu\xE9s en UTF-8 par d\xE9faut) + Permet de spécifier l'encodage à utiliser pour afficher les + labels. Concretement ce paramètre doit correspondre à l'encodage + de la page Web contenant le chat. + (par défaut UTF-8, c'est à dire aucun transcodage car les messages + sont stoqués en UTF-8 par défaut) container_type - Permet de sp\xE9ficier le conteneur \xE0 utiliser. Pour le moment, seul le - conteneur File (syst\xE8me de fichier) est disponible mais dans le + Permet de spéficier le conteneur à utiliser. Pour le moment, seul + le conteneur File (système de fichier) est disponible mais dans le future de nombreux conteneurs existerons surrement (mysql, irc, msn, jabber...). - ("File" par d\xE9faut) + ("File" par défaut) server_script_path et server_script_url - Ces param\xE8tres permettent de sp\xE9cifier un script externe qui sera - charg\xE9 des communication client/serveur du chat. Ce param\xE8tre est - tr\xE8s utile lorsque le script du chat (client) consomme beaucoup de + Ces paramètres permettent de spécifier un script externe qui sera + chargé des communication client/serveur du chat. Ce paramètre est + très utile lorsque le script du chat (client) consomme beaucoup de ressources (voyez la demo3 pour un exemple concret). Le premier - param\xE8tre sp\xE9cifie l'endroit du fichier lui m\xEAme, le second - param\xE8tre indique l'url o\xF9 est situ\xE9 le fichier (utile pour la - r\xE9\xE9criture d'url) - (par d\xE9faut on utilise le m\xEAme scripte que le script client pour les - communications) + paramètre spécifie l'endroit du fichier lui même, le second + paramètre indique l'url où est situé le fichier (utile pour la + réécriture d'url) + (par défaut on utilise le même scripte que le script client pour + les communications) client_script_path et client_script_url - Ces param\xE8tres sont utilis\xE9s pour sp\xE9cifier le chemin du script qui - va afficher le chat (script client). Ces options peuvent \xEAtre utile - lorsque la configuration du serveur est peu commune. Le premier - param\xE8tre sp\xE9cifie l'endroit du fichier lui m\xEAme, le second - param\xE8tre indique l'url o\xF9 est situ\xE9 le fichier (utile pour la - r\xE9\xE9criture d'url) - (par d\xE9faut pfc va essayer d'auto-detecter le script client en + Ces paramètres sont utilisés pour spécifier le chemin du script + qui va afficher le chat (script client). Ces options peuvent être + utile lorsque la configuration du serveur est peu commune. Le + premier paramètre spécifie l'endroit du fichier lui même, le + second paramètre indique l'url où est situé le fichier (utile + pour la réécriture d'url) + (par défaut pfc va essayer d'auto-detecter le script client en fonction des variables globales du serveur) useie7 - Mettre ce param\xE8tre \xE0 false d\xE9sactivera l'ajout des scripts IE7[24] - permettant un meilleur affichage dans Internet Explorer. - (true par d\xE9faut) + Mettre ce paramètre à false désactivera l'ajout des scripts + IE7[26] permettant un meilleur affichage dans Internet Explorer. + (true par défaut) ie7path - Sp\xE9cifie le r\xE9pertoire vers la librairie IE7. Ce param\xE8tre est utile - si vous avez d\xE9j\xE0 install\xE9 une librairie smarty et que vous voulez - \xE9conomiser des octets sur votre serveur. - (dirname(__FILE__)."/../lib/IE7_0_9" par d\xE9faut) + Spécifie le répertoire vers la librairie IE7. Ce paramètre est + utile si vous avez déjà installé une librairie smarty et que vous + voulez économiser des octets sur votre serveur. + (dirname(__FILE__)."/../lib/IE7_0_9" par défaut) jspath - Sp\xE9cifie le r\xE9pertoire vers les librairies javascript (md5, cookie + Spécifie le répertoire vers les librairies javascript (md5, cookie ...). - (dirname(__FILE__)."/../lib/javascript" par d\xE9faut) + (dirname(__FILE__)."/../lib/javascript" par défaut) usecsstidy - Mettre ce param\xE8tre \xE0 false d\xE9sactivera l'utilisation de la - librairie CSSTidy utilis\xE9e pour optimiser (en taille) la g\xE9n\xE9ration - des CSS. - (false par d\xE9faut car sur certains serveur la librarie CSSTidy pose - des probl\xE8mes) + Mettre ce paramètre à false désactivera l'utilisation de la + librairie CSSTidy utilisée pour optimiser (en taille) la + génération des CSS. + (false par défaut car sur certains serveur la librarie CSSTidy pose + des problèmes) csstidypath - Sp\xE9cifie le r\xE9pertoire vers la librairie CSS Tidy[25]. Ce param\xE8tre - est utile si vous avez d\xE9j\xE0 install\xE9 une librairie csstidy et que - vous voulez \xE9conomiser des octets sur votre serveur. - (dirname(__FILE__)."/../lib/csstidy-1.1" par d\xE9faut) + Spécifie le répertoire vers la librairie CSS Tidy[27]. Ce + paramètre est utile si vous avez déjà installé une librairie + csstidy et que vous voulez économiser des octets sur votre serveur. + (dirname(__FILE__)."/../lib/csstidy-1.1" par défaut) xajaxpath - Sp\xE9cifie le r\xE9pertoire vers la librairie xajax[26]. Ce param\xE8tre est - utile si vous avez d\xE9j\xE0 install\xE9 une librairie xajax et que vous - voulez \xE9conomiser des octets sur votre serveur. - (dirname(__FILE__)."/../lib/xajax_0.2_stable" par d\xE9faut) + Spécifie le répertoire vers la librairie xajax[28]. Ce paramètre + est utile si vous avez déjà installé une librairie xajax et que + vous voulez économiser des octets sur votre serveur. + (dirname(__FILE__)."/../lib/xajax_0.2_stable" par défaut) data_private_path - Ce r\xE9pertoire est utilis\xE9 pour stoqu\xE9 les donn\xE9es du chat ainsi que - les templates compil\xE9s de smarty. Astuce: vous pouvez optimisez les - performances cot\xE9 serveur en sp\xE9cifiant un r\xE9pertoire en m\xE9moire - vive (RAM disk, tmpfs), voyez cette section dans la FAQ[27]. - (dirname(__FILE__)."/../data/private" par d\xE9faut) + Ce répertoire est utilisé pour stoqué les données du chat ainsi + que les templates compilés de smarty. Astuce: vous pouvez optimisez + les performances coté serveur en spécifiant un répertoire en + mémoire vive (RAM disk, tmpfs), voyez cette section dans la FAQ[29]. + (dirname(__FILE__)."/../data/private" par défaut) data_public_path et data_public_url - Ce r\xE9pertoire doit \xEAtre imp\xE9rativement accessible par votre serveur - Web. Les scripts IE7 et xajax necessaires au chat y seront stock\xE9s. - Le premier param\xE8tre indique le r\xE9pertoire absolue au niveau syst\xE8me - de fichier, et le second indique l'url pour y acceder depuis le - navigateur (utile pour la r\xE9\xE9critude d'url) - (dirname(__FILE__)."/../data/public" par d\xE9faut, data_public_url lui - est calcul\xE9 automatiquement) + Ce répertoire doit être impérativement accessible par votre + serveur Web. Les scripts IE7 et xajax necessaires au chat y seront + stockés. Le premier paramètre indique le répertoire absolue au + niveau système de fichier, et le second indique l'url pour y + acceder depuis le navigateur (utile pour la réécritude d'url) + (dirname(__FILE__)."/../data/public" par défaut, data_public_url + lui est calculé automatiquement) debug - Cette option est tr\xE8s utile pour les d\xE9veloppeurs. La mettre \xE0 true - va activer les messages de log et la console de debug. - (false par d\xE9faut) + Cette option est très utile pour les développeurs. La mettre à + true va activer les messages de log et la console de debug. + (false par défaut) debugxajax - Cette option est tr\xE8s utile pour d\xE9couvrire les bug cach\xE9s (warning - php lors d'une requete xajax par exemple) . Mettre cette option \xE0 - true va activer les popup javascript de xajax pour tracer la - communication client/serveur. - (false par d\xE9faut) + Cette option est très utile pour découvrire les bug cachés + (warning php lors d'une requete xajax par exemple) . Mettre cette + option à true va activer les popup javascript de xajax pour tracer + la communication client/serveur. + (false par défaut) prefix - Ce prefix est utilis\xE9 pour chaques fonctions javascript, chaque id - CSS et chaques classes CSS de fa\xE7on \xE0 \xE9viter les recouvrements de + Ce prefix est utilisé pour chaques fonctions javascript, chaque id + CSS et chaques classes CSS de façon à éviter les recouvrements de variables entre phpfreechat et votre site web. - ("phpfreechat_" par d\xE9faut) + ("phpfreechat_" par défaut) - \xA92006 phpFreeChat + RSS[30] + Valid XHTML 1.0![31] Valid CSS![32] Created with Amaya[33] + ©2006 phpFreeChat + + -------------------------------------------------------------- List of References Document's URL: http://www.phpfreechat.net/install.fr.html -[23] faq.fr.html#multiple-channels -[24] http://dean.edwards.name/IE7/ -[25] http://csstidy.sourceforge.net/index.php -[26] http://www.xajaxproject.org/ -[27] faq.fr.html#tmpfs +style/generic.cssstyle/header.cssstyle/footer.cssstyle/menu.cssstyle/content.cssstyle/install.css +[1] install.en.html +[2] install.fr.html +[3] install.ar.html +[4] news.fr.html +[5] overview.fr.html +[6] demo.fr.php +[7] screenshot.fr.html +[8] download.fr.html +[9] whouses.en.html +[10] faq.fr.html +[11] contact.fr.html +[12] partners.fr.html +[13] forum/ +[14] install.fr.html +[15] customize.fr.html +[16] requiredconfig.fr.html +[17] roadmap.fr.html +[18] buglist.fr.html +[19] changelog.fr.html +[20] contributions.fr.html +[21] http://www.phpfreechat.net +[22] http://www.hotscripts.com/?RID=N452772 +[23] download.en.html +[24] download.en.html +[25] faq.fr.html#multiple-channels +[26] http://dean.edwards.name/IE7/ +[27] http://csstidy.sourceforge.net/index.php +[28] http://www.xajaxproject.org/ +[29] faq.fr.html#tmpfs +[30] forum/extern.php?action=active&type=RSS&fid=7 +[31] http://validator.w3.org/check?uri=referer +[32] http://jigsaw.w3.org/css-validator/check/referer +[33] http://www.w3.org/Amaya + Added: branches/0.x/README.ar =================================================================== --- branches/0.x/README.ar (rev 0) +++ branches/0.x/README.ar 2006-04-28 20:12:59 UTC (rev 481) @@ -0,0 +1,77 @@ + + ب أش ب فري تشات هو خادم دردشة مجاني، سهل، + سريع، وقابل للتخصيص، يستعمل نظام ملفات + سهل لتخزين الالقاب والمحادثات. يستخدم + التكنولوجيا أجكس لانعاش وعرض منطقتا + الدردشة واللقب. يسمح إستعمال أوراق + أسلوب CSS ونظام البرنامج المساعد + فبإمكانك كتابة كيفية تخزين المعلومات (... + Mysql, IRC backends ). + + + خادم دردشة سهل، سريع، وقابل للتخصيص + + سهل + عليك نسخ/لصق ثلاثة أسطر فقط في + الصفحة التي تريد، للحصول على برنامج + دردشة شغال. + لا داعي لتخصيص قاعدة بيانات (مي س ك ل)، + المحادثات تُخزَّن في ملفات. + لا نزاع مع برنامج الحماية لأن phpFreeChat + يستخدم بروتوكول انتقال النص + المتشعب(http). متصفح انترنت يكفي + للدردشة. + سريع + التكنولوجيا أجكس استُعملت لانعاش + وعرض منطقتا الدردشة واللقب بشكل ناعم + وغير متقطع. + المحادثات تُخزَّن في ملفات مما يسمح + بتوفير للحد الأعلى مصادر الخادم. + الخادم لا ينقل أبدا مرتين نفس + المعلومات : الرسائل الجديدة وحدها + تُنقل. هذا يسمح بتخفيف استهلاك العصبة + العريضة (bandwidth). + قابل للتخصيص + بإمكانك كتابة ورقة أسلوب لتغيير + مظهر[24] برنامجك. + كل وظائف phpFreeChat قابلة للتخصيص. مثلاً + بإمكانك تغيير وقت إنعاش الرسائل أو + منع مستخدمي البرنامج من تغيير + ألقابهم. + بفضل طريقة البرنامج المساعد[25] + بإمكانك كتابة كيفية تخزين المعلومات. + على سبيل المثال يمكنك كتابة برنامج + مساعد يعمل على تخزين المحادثات في + قاعدة بيانات. + حر ومجاني + phpFreeChat هو برنامج مفتوح المصدر، + بإمكانك إستعماله وتعديله كما تريد. + أطلب منك فقط إبقاء التوقيع logo على + صفحات البرنامج. + + كل أوامر phpFreeChat مستوحات من بروتوكول ي ر س + irc[26] والتوصيل مستوحى من mIRC[27] و XChat[28] + لذالك مستخدمي البرنامج يبقون على + عاداتهم. + + التكنولوجيا التي يستعملها phpFreeChat هي : + + * php[29]: على صعيد الخادم : المحادثات + تُخزَّن في ملفات. + * xajax[30]: على صعيد الزبون : للاتصالات + الغير تزامنية بين الخادم و الزبون. + + phpFreeChat لا يستعمل مي س ك ل (MySQL) + + ©2006 phpFreeChat + + +-------------------------------------------------------------- +List of References + +Document's URL: http://www.phpfreechat.net/overview.ar.html +[26] http://www.irc.org +[27] http://www.mirc.com/ +[28] http://www.xchat.org/ +[29] http://www.php.net/ +[30] http://www.xajaxproject.org/ Modified: branches/0.x/README.en =================================================================== --- branches/0.x/README.en 2006-04-28 20:12:16 UTC (rev 480) +++ branches/0.x/README.en 2006-04-28 20:12:59 UTC (rev 481) @@ -1,7 +1,12 @@ -phpFreeChat, a free, simple, fast and customizable chat server + php Free Chat is a free, simple to install, fast, customizable and multi + languages chat that uses a simple filesystem for message and nickname + storage. It uses AJAX to smoothly refresh (no flicker) and display the + chat zone and the nickname zone. It supports customized themes based on + CSS and a plugin system that allows you to write your own storage + routines (ex: Mysql, IRC backends ...), and you own chat commands ! Simple - You only have to copy/paste 3 lines of code[21] to have a nice + You only have to copy/paste 3 lines of code to have a nice working chat. No need to configure a database (Mysql), messages and nicknames are stored in files. @@ -21,11 +26,11 @@ data twice, only new messages are transmitted. Customizable You can write your own customized CSS stylesheets, to completely - change the appearance[22] of your chat. + change the appearance[24] of your chat. All chat functionalities are customizable. For example, you can change the messages refresh time, you can ban users for changing their usernames, etc. - The plugin system[23] allows you to write your own storage routines. + The plugin system[25] allows you to write your own storage routines. For example, you can write a plugin to store the conversations into your database. Opensource @@ -34,31 +39,30 @@ I just ask, by gratitude, to keep the linkback logo on the pages of your chat. - All phpFreeChat commands are inspired by the irc[24] protocol, and its - interface is inspired by mIRC[25] and XChat[26], so that users won't be + All phpFreeChat commands are inspired by the irc[26] protocol, and its + interface is inspired by mIRC[27] and XChat[28], so that users won't be disoriented. Techonologies used by phpFreeChat are: - * PHP[27] : on the server side : conversations are simply stored in + * PHP[29] : on the server side : conversations are simply stored in filesystems. - * XAJAX[28] : for the asynchronous communication between the client + * XAJAX[30] : for the asynchronous communication between the client and the server (phpFreeChat does NOT require MySQL, or any SQL database) - \xA92006 phpFreeChat + ©2006 phpFreeChat + -------------------------------------------------------------- List of References Document's URL: http://www.phpfreechat.net/overview.en.html -[22] customize.en.html#cust-css -[23] customize.en.html#container-plug -[24] http://www.irc.org -[25] http://www.mirc.com/ -[26] http://www.xchat.org/ -[27] http://www.php.net/ -[28] http://www.xajaxproject.org/ +[26] http://www.irc.org +[27] http://www.mirc.com/ +[28] http://www.xchat.org/ +[29] http://www.php.net/ +[30] http://www.xajaxproject.org/ Modified: branches/0.x/README.fr =================================================================== --- branches/0.x/README.fr 2006-04-28 20:12:16 UTC (rev 480) +++ branches/0.x/README.fr 2006-04-28 20:12:59 UTC (rev 481) @@ -1,67 +1,72 @@ + php Free Chat est un chat simple à installer, gratuit, rapide, + paramétrable et multi langues. Par soucis de simplicité, des + répertoires et fichiers sont utilisés pour stocker les pseudonymes et + les messages. AJAX est utilisé pour mettre à jour sans clignotement la + liste des messages et des pseudonymes. Le système de thèmes basé sur + les feuilles de styles CSS permet de changer complètement l'apparence et + le système de plugin permet d'écrire ses propres routines de stockage + (ex: Mysql, IRC backends ...) et vos propres commandes de chat ! -phpFreeChat un serveur de chat libre, simple, rapide et param\xE9trable Simple - Vous avez seulement 3 lignes de php \xE0 copier/coller[21] dans la page - de votre choix pour obtenir un chat fonctionnel. - En effet, pas besoin de param\xE9trer une base de donn\xE9e Mysql, les - conversations sont stock\xE9es simplement dans des fichiers. - Le chat fontionnera chez tout le monde car il est bas\xE9 sur HTTP, il - vous suffit donc d'avoir un navigateur Web connect\xE9 \xE0 internet pour - pouvoir chatter. - Tous les jeux de caract\xE8res sont support\xE9s ! Que vous soyez Russe, - Japonais, Turque, Chinois, ou Arabe, tous les caract\xE8res - s'afficheront car phpfreechat utilise XML coupl\xE9 \xE0 UTF8 pour encoder - les caract\xE8res. + Vous avez seulement 3 lignes de php à copier/coller dans la + page de votre choix pour obtenir un chat fonctionnel. + En effet, pas besoin de paramétrer une base de donnée Mysql, les + conversations sont stockées simplement dans des fichiers. + Le chat fontionnera chez tout le monde car il est basé sur HTTP, il + vous suffit donc d'avoir un navigateur Web connecté à internet + pour pouvoir chatter. + Tous les jeux de caractères sont supportés ! Que vous soyez Russe, + Japonais, Turque, Chinois, ou Arabe, tous les caractères + s'afficheront car phpfreechat utilise XML couplé à UTF8 pour + encoder les caractères. Rapide - La technologie AJAX est utilis\xE9e pour afficher p\xE9riodiquement et + La technologie AJAX est utilisée pour afficher périodiquement et sans effets de clignotement les nouveaux messages et les nouvelles - personnes connect\xE9es. - Les conversations sont stock\xE9es dans des fichiers, les ressources du - serveur sont donc \xE9conomis\xE9es au maximum. - La bande passante est \xE9conomis\xE9e car le serveur ne transmettra - jamais deux fois les m\xEAmes informations : seulement les nouveaux + personnes connectées. + Les conversations sont stockées dans des fichiers, les ressources + du serveur sont donc économisées au maximum. + La bande passante est économisée car le serveur ne transmettra + jamais deux fois les mêmes informations : seulement les nouveaux messages sont transmis. - Param\xE9trable - Vous pouvez \xE9crire vos feuilles de style (CSS) personnalis\xE9es pour - changer compl\xE8tement l'apparence[22] de votre chat. - Toutes les fonctionnalit\xE9s du chat ont \xE9t\xE9 rendues param\xE9trables. - Par exemple, vous pouvez changer le temps de mise \xE0 jour des - messages, vous pouvez interdire aux utilisateurs de changer leur - pseudo... - Vous pouvez \xE9galement, gr\xE2ce au syst\xE8me de plugin[23], \xE9crire vos - propres routines de stockage si vous pr\xE9f\xE9rez stocker les - conversations dans votre base de donn\xE9es. + Paramétrable + Vous pouvez écrire vos feuilles de style (CSS) personnalisées pour + changer complètement l'apparence[24] de votre chat. + Toutes les fonctionnalités du chat ont été rendues + paramétrables. Par exemple, vous pouvez changer le temps de mise à + jour des messages, vous pouvez interdire aux utilisateurs de changer + leur pseudo... + Vous pouvez également, grâce au système de plugin[25], écrire + vos propres routines de stockage si vous préférez stocker les + conversations dans votre base de données. Libre - phpFreeChat est d\xE9velopp\xE9 en opensource (LGPL), vous pouvez donc + phpFreeChat est développé en opensource (LGPL), vous pouvez donc librement utiliser le programme et le modifier. Je demande juste, par gratitude, de ne pas enlever la signature logo sur les pages de votre chat. - Toutes les commandes de phpFreeChat sont inspir\xE9es du protocole irc[24], - et son interface est inspir\xE9e de mIRC[25] et XChat[26], vos utilisateurs - ne seront donc pas d\xE9pays\xE9s. + Toutes les commandes de phpFreeChat sont inspirées du protocole irc[26], + et son interface est inspirée de mIRC[27] et XChat[28], vos utilisateurs + ne seront donc pas dépaysés. - Les technologies utilis\xE9es par phpFreeChat sont : + Les technologies utilisées par phpFreeChat sont : - * php[27] : pour le cot\xE9 serveur, les conversations sont simplement - enregistr\xE9es dans des fichiers - * xajax[28] : pour la communication asynchrone entre le client et le + * php[29] : pour le coté serveur, les conversations sont simplement + enregistrées dans des fichiers + * xajax[30] : pour la communication asynchrone entre le client et le serveur (phpFreeChat n'utilise PAS mysql) - \xA92006 phpFreeChat + ©2006 phpFreeChat -------------------------------------------------------------- List of References Document's URL: http://www.phpfreechat.net/overview.fr.html -[22] customize.fr.html#custo-css -[23] customize.fr.html#container-plug -[24] http://www.irc.org -[25] http://www.mirc.com/ -[26] http://www.xchat.org/ -[27] http://www.php.net/ -[28] http://www.xajaxproject.org/ +[26] http://www.irc.org +[27] http://www.mirc.com/ +[28] http://www.xchat.org/ +[29] http://www.php.net/ +[30] http://www.xajaxproject.org/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-28 22:26:33
|
Revision: 480 Author: kerphi Date: 2006-04-28 13:12:16 -0700 (Fri, 28 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=480&view=rev Log Message: ----------- add license header Modified Paths: -------------- branches/0.x/src/pfccommand_asknick.class.php branches/0.x/src/pfccommand_connect.class.php branches/0.x/src/pfccommand_error.class.php branches/0.x/src/pfccommand_getnewmsg.class.php branches/0.x/src/pfccommand_getonlinenick.class.php branches/0.x/src/pfccommand_init.class.php branches/0.x/src/pfccommand_me.class.php branches/0.x/src/pfccommand_nick.class.php branches/0.x/src/pfccommand_notice.class.php branches/0.x/src/pfccommand_quit.class.php branches/0.x/src/pfccommand_send.class.php branches/0.x/src/pfccommand_update.class.php branches/0.x/src/pfccommand_updatemynick.class.php Modified: branches/0.x/src/pfccommand_asknick.class.php =================================================================== --- branches/0.x/src/pfccommand_asknick.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_asknick.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_connect.class.php =================================================================== --- branches/0.x/src/pfccommand_connect.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_connect.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_error.class.php =================================================================== --- branches/0.x/src/pfccommand_error.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_error.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_getnewmsg.class.php =================================================================== --- branches/0.x/src/pfccommand_getnewmsg.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_getnewmsg.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_getonlinenick.class.php =================================================================== --- branches/0.x/src/pfccommand_getonlinenick.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_getonlinenick.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_init.class.php =================================================================== --- branches/0.x/src/pfccommand_init.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_init.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_me.class.php =================================================================== --- branches/0.x/src/pfccommand_me.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_me.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_nick.class.php =================================================================== --- branches/0.x/src/pfccommand_nick.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_nick.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_notice.class.php =================================================================== --- branches/0.x/src/pfccommand_notice.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_notice.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_quit.class.php =================================================================== --- branches/0.x/src/pfccommand_quit.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_quit.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_send.class.php =================================================================== --- branches/0.x/src/pfccommand_send.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_send.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_update.class.php =================================================================== --- branches/0.x/src/pfccommand_update.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_update.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); Modified: branches/0.x/src/pfccommand_updatemynick.class.php =================================================================== --- branches/0.x/src/pfccommand_updatemynick.class.php 2006-04-27 11:49:10 UTC (rev 479) +++ branches/0.x/src/pfccommand_updatemynick.class.php 2006-04-28 20:12:16 UTC (rev 480) @@ -1,4 +1,24 @@ <?php +/** + * phpfreechat.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__)."/pfccommand.class.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-28 22:26:28
|
Revision: 482 Author: kerphi Date: 2006-04-28 13:34:30 -0700 (Fri, 28 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=482&view=rev Log Message: ----------- 0.9.3 release Modified Paths: -------------- branches/0.x/version Modified: branches/0.x/version =================================================================== --- branches/0.x/version 2006-04-28 20:12:59 UTC (rev 481) +++ branches/0.x/version 2006-04-28 20:34:30 UTC (rev 482) @@ -1 +1 @@ -0.9.2 \ No newline at end of file +0.9.3 \ 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: <ne...@us...> - 2006-04-27 11:49:21
|
Revision: 479 Author: nemako Date: 2006-04-27 04:49:10 -0700 (Thu, 27 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=479&view=rev Log Message: ----------- + use file_get_contents instead of fileopen to read pfc version Modified Paths: -------------- trunk/admin/version.class.php Modified: trunk/admin/version.class.php =================================================================== --- trunk/admin/version.class.php 2006-04-27 10:09:45 UTC (rev 478) +++ trunk/admin/version.class.php 2006-04-27 11:49:10 UTC (rev 479) @@ -20,10 +20,7 @@ * @return integer version */ function getLocalVersion(){ - $fp = fopen($this->local_version,"r"); - $version = trim(fgets($fp)); - fclose($fp); - return $version; + return file_get_contents($this->local_version); } /** @@ -34,14 +31,11 @@ $parse = parse_url($this->pfc_official_current_version); $host = $parse['host']; error_reporting(0); // It's maybe not the best thing to do... - if (!fsockopen ($host, 80, $errno, $errstr, 1)) { + if (!fsockopen ($host, 80, $errno, $errstr, 2)) { return 0; } else{ - $fp = fopen($this->pfc_official_current_version,"r"); - $version = trim(fgets($fp)); - fclose($fp); - return $version; + return file_get_contents($this->pfc_official_current_version); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-27 10:09:56
|
Revision: 478 Author: kerphi Date: 2006-04-27 03:09:45 -0700 (Thu, 27 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=478&view=rev Log Message: ----------- code cleaning : remove unused code Modified Paths: -------------- trunk/src/containers/file.class.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-04-26 17:49:18 UTC (rev 477) +++ trunk/src/containers/file.class.php 2006-04-27 10:09:45 UTC (rev 478) @@ -118,23 +118,7 @@ flock ($fp, LOCK_UN); // unlock fclose($fp); - - /** - * @todo: this is not the container' job to keep synchronized the user' metadatas ! - */ - - // update the user's metadata (channels) - if ($chan != NULL) - { - $userchan = $this->getMeta("channels", "nickname", $nick); - $userchan = $userchan != NULL ? unserialize($userchan) : array(); - if (!in_array($chan, $userchan)) - { - $userchan[] = $chan; - $this->setMeta(serialize($userchan), "channels", "nickname", $nick); - } - } - + // if (!in_array($nickname, $this->_users)) // $this->_users[] = $nickname; // _users will be used by getOnlineUserList @@ -166,31 +150,6 @@ @unlink($nick_filename); - - - /** - * @todo: this is not the container' job to keep synchronized the user' metadatas ! - */ - - // update the user's metadata (channels) - if ($chan != NULL) - { - // the user just disconnect from a channel - $userchan = $this->getMeta("channels", "nickname", $nick); - $userchan = $userchan != NULL ? unserialize($userchan) : array(); - if (in_array($chan, $userchan)) - { - $key = array_search($chan, $userchan); - unset($userchan[$key]); - $this->setMeta(serialize($userchan), "channels", "nickname", $nick); - } - } - else - { - // the user disconnect from the whole server - $this->rmMeta("channels", "nickname", $nick); - } - /* // remove the nickname from the cache list if (in_array($nick, $this->_users)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-26 17:49:25
|
Revision: 477 Author: kerphi Date: 2006-04-26 10:49:18 -0700 (Wed, 26 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=477&view=rev Log Message: ----------- Typo Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-04-26 17:48:32 UTC (rev 476) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-04-26 17:49:18 UTC (rev 477) @@ -663,7 +663,7 @@ img.title = img.alt; img.style.marginRight = '5px'; var a = document.createElement('a'); - a.setAttribute('href', 'opo'); + a.setAttribute('href', ''); a.pfc_nick = nicks[i]; a.onclick = function(){pfc.sendRequest('/privmsg', this.pfc_nick); return false;} a.appendChild(img); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-26 17:48:37
|
Revision: 476 Author: kerphi Date: 2006-04-26 10:48:32 -0700 (Wed, 26 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=476&view=rev Log Message: ----------- Bug fix: It seems there is a little bug with the icon before my name in the user box (user.gif instead of user-me.gif). When I enter the channel the first time, I have a user.gif icon before my name, if I refresh the windows I have the normal user-me.gif icon.... It seems that the test does not work the first time. (thx to nemako for the bug report) Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-04-26 17:32:59 UTC (rev 475) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-04-26 17:48:32 UTC (rev 476) @@ -262,9 +262,11 @@ echo "this.sendRequest('/privmsg', '".addslashes($pv["name"])."');\n"; ?> } + if (resp == "ok" || resp == "notchanged" || resp == "changed" || resp == "connected") { this.el_handle.value = param; + this.nickname = param; } else if (resp == "isused") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-04-26 17:33:10
|
Revision: 475 Author: kerphi Date: 2006-04-26 10:32:59 -0700 (Wed, 26 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=475&view=rev Log Message: ----------- Bug fix: Clicking the nickname box to change its name, under the textarea, we always have a predifined box with undefined instead of our current nickname. (thx to Nemako for the bug report) 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-04-26 08:43:35 UTC (rev 474) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-04-26 17:32:59 UTC (rev 475) @@ -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"); ?>" maxlength="<?php echo $max_nick_len; ?>" value="<?php echo $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-04-26 08:43:41
|
Revision: 474 Author: kerphi Date: 2006-04-26 01:43:35 -0700 (Wed, 26 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=474&view=rev Log Message: ----------- Bug fix: leaving a channel didn't clear the chat area correctly so when coming back, double messages appears (thanks to nemako for the bug report http://www.phpfreechat.net/forum/viewtopic.php?id=265). 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-04-25 13:00:45 UTC (rev 473) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-04-26 08:43:35 UTC (rev 474) @@ -155,6 +155,10 @@ tabparent_t.removeChild(tab_t); tabparent_c.removeChild(tab_c); + // empty the chat div content + var div_chat = this.getChatContentFromTabId(tabid); + div_chat.innerHTML = ''; + // remove the tab from the list var tabpos = this.tabids.indexOf(tabid); var name = this.tabs[tabpos]; @@ -241,7 +245,7 @@ $('<?php echo $prefix; ?>channels_list').appendChild(li_title); $('<?php echo $prefix; ?>channels_content').appendChild(div_content); - + return tabid; }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2006-04-25 13:01:00
|
Revision: 473 Author: nemako Date: 2006-04-25 06:00:45 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=473&view=rev Log Message: ----------- Replace preg_match("/^\..*/", $file) by strpos($file,".")===0. It is faster. Modified Paths: -------------- trunk/admin/index.php trunk/admin/themes.class.php trunk/src/pfci18n.class.php Modified: trunk/admin/index.php =================================================================== --- trunk/admin/index.php 2006-04-25 12:16:50 UTC (rev 472) +++ trunk/admin/index.php 2006-04-25 13:00:45 UTC (rev 473) @@ -22,7 +22,7 @@ <li><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <select name="lang"> <?php - $available_admin_lang = pfcI18N::GetAcceptedAdminLanguage(); + $available_admin_lang = pfcI18N::GetAcceptedLanguage("admin"); for($i=0;$i<count($available_admin_lang);$i++) { if ($lang==$available_admin_lang[$i]) $selected ="selected=\"selected\""; Modified: trunk/admin/themes.class.php =================================================================== --- trunk/admin/themes.class.php 2006-04-25 12:16:50 UTC (rev 472) +++ trunk/admin/themes.class.php 2006-04-25 13:00:45 UTC (rev 473) @@ -22,7 +22,7 @@ $i=0; $dir = opendir($this->dir_themes); while ($f = readdir($dir)) { - if(is_dir($this->dir_themes.$f) && $f!="." && $f!=".." && strpos($f,".")===false) { + if(is_dir($this->dir_themes.$f) && $f!="." && $f!=".." && strpos($f,".")!==0) { $themes_list[$i] = $f; $i++; } Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-04-25 12:16:50 UTC (rev 472) +++ trunk/src/pfci18n.class.php 2006-04-25 13:00:45 UTC (rev 473) @@ -33,10 +33,10 @@ class pfcI18N { - function Init($language,$type='main') + function Init($language,$type="main") { if ($type=="admin") - if (!in_array($language, pfcI18N::GetAcceptedAdminLanguage())) + if (!in_array($language, pfcI18N::GetAcceptedLanguage("admin"))) $language = pfcI18N::GetDefaultLanguage(); if (!in_array($language, pfcI18N::GetAcceptedLanguage())) $language = pfcI18N::GetDefaultLanguage(); @@ -79,41 +79,37 @@ * Return the language list supported bye i18n system * (content of the i18n directory) */ - function GetAcceptedLanguage() + function GetAcceptedLanguage($type="main") { - if (isset($GLOBALS["accepted_languages"])) - return $GLOBALS["accepted_languages"]; // restore the cached languages list - $GLOBALS["accepted_languages"] = array(); - $dir_handle = opendir(dirname(__FILE__)."/../i18n"); - while (false !== ($file = readdir($dir_handle))) - { - // skip . and .. generic files - // skip also .svn directory - if ($file == "." || $file == ".." || preg_match("/^\..*/", $file)) continue; - $GLOBALS["accepted_languages"][] = $file; + if ($type=="admin"){ + if (isset($GLOBALS["accepted_admin_languages"])) + return $GLOBALS["accepted_admin_languages"]; // restore the cached languages list + $GLOBALS["accepted_admin_languages"] = array(); + $dir_handle = opendir(dirname(__FILE__)."/../i18n"); + while (false !== ($file = readdir($dir_handle))) + { + // skip . and .. generic files + // skip also .svn directory + if ($file == "." || $file == ".." || strpos($file,".")===0) continue; + if (file_exists(dirname(__FILE__)."/../i18n/".$file."/admin.php")) + $GLOBALS["accepted_admin_languages"][] = $file; + } + return $GLOBALS["accepted_admin_languages"]; } - return $GLOBALS["accepted_languages"]; - } - - /** - * Return the language list supported bye i18n system - * (content of the i18n directory) - */ - function GetAcceptedAdminLanguage() - { - if (isset($GLOBALS["accepted_admin_languages"])) - return $GLOBALS["accepted_admin_languages"]; // restore the cached languages list - $GLOBALS["accepted_admin_languages"] = array(); - $dir_handle = opendir(dirname(__FILE__)."/../i18n"); - while (false !== ($file = readdir($dir_handle))) - { - // skip . and .. generic files - // skip also .svn directory - if ($file == "." || $file == ".." || preg_match("/^\..*/", $file)) continue; - if (file_exists(dirname(__FILE__)."/../i18n/".$file."/admin.php")) - $GLOBALS["accepted_admin_languages"][] = $file; + else{ + if (isset($GLOBALS["accepted_languages"])) + return $GLOBALS["accepted_languages"]; // restore the cached languages list + $GLOBALS["accepted_languages"] = array(); + $dir_handle = opendir(dirname(__FILE__)."/../i18n"); + while (false !== ($file = readdir($dir_handle))) + { + // skip . and .. generic files + // skip also .svn directory + if ($file == "." || $file == ".." || strpos($file,".")===0) continue; + $GLOBALS["accepted_languages"][] = $file; + } + return $GLOBALS["accepted_languages"]; } - return $GLOBALS["accepted_admin_languages"]; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2006-04-25 12:17:07
|
Revision: 472 Author: nemako Date: 2006-04-25 05:16:50 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=472&view=rev Log Message: ----------- Add a test for themes directory listing Modified Paths: -------------- trunk/admin/themes.class.php Modified: trunk/admin/themes.class.php =================================================================== --- trunk/admin/themes.class.php 2006-04-25 10:15:32 UTC (rev 471) +++ trunk/admin/themes.class.php 2006-04-25 12:16:50 UTC (rev 472) @@ -22,7 +22,7 @@ $i=0; $dir = opendir($this->dir_themes); while ($f = readdir($dir)) { - if(is_dir($this->dir_themes.$f) && $f!="." && $f!="..") { + if(is_dir($this->dir_themes.$f) && $f!="." && $f!=".." && strpos($f,".")===false) { $themes_list[$i] = $f; $i++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2006-04-25 10:15:48
|
Revision: 471 Author: nemako Date: 2006-04-25 03:15:32 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=471&view=rev Log Message: ----------- Change in the admin interface. Add language choose. Modified Paths: -------------- trunk/admin/inc.conf.php trunk/admin/index.php trunk/i18n/en_US/admin.php trunk/i18n/fr_FR/admin.php trunk/src/pfci18n.class.php Modified: trunk/admin/inc.conf.php =================================================================== --- trunk/admin/inc.conf.php 2006-04-25 07:51:34 UTC (rev 470) +++ trunk/admin/inc.conf.php 2006-04-25 10:15:32 UTC (rev 471) @@ -1,4 +1,4 @@ <?php session_start(); -$lang = isset($_GET["lang"]) ? $_GET["lang"] : (isset($_SESSION["lang"]) ? $_SESSION["lang"] : "en_US" ); $_SESSION["lang"] = $lang; +$lang = isset($_POST["lang"]) ? $_POST["lang"] : (isset($_SESSION["lang"]) ? $_SESSION["lang"] : "en_US" ); $_SESSION["lang"] = $lang; ?> \ No newline at end of file Modified: trunk/admin/index.php =================================================================== --- trunk/admin/index.php 2006-04-25 07:51:34 UTC (rev 470) +++ trunk/admin/index.php 2006-04-25 10:15:32 UTC (rev 471) @@ -4,7 +4,6 @@ require_once("inc.conf.php"); pfcI18N::Init($lang,"admin"); - # version class require_once("version.class.php"); $version = new version(); @@ -18,41 +17,63 @@ <div class="content"> <h2><?php echo _pfc("Administration"); ?></h2> -<?php -if ($version->getPFCOfficialCurrentVersion()==0){ -?> - <div><h3><?php echo _pfc("Internet connection is not possible"); ?></h3> + <div><h3><?php echo _pfc("Available Languages"); ?></h3> <ul> - <li><?php echo _pfc("PFC version"); ?> : <?php echo $version->getLocalVersion(); ?></li> + <li><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> + <select name="lang"> + <?php + $available_admin_lang = pfcI18N::GetAcceptedAdminLanguage(); + for($i=0;$i<count($available_admin_lang);$i++) { + if ($lang==$available_admin_lang[$i]) + $selected ="selected=\"selected\""; + else + $selected =""; + echo "<option value=\"$available_admin_lang[$i]\" $selected>$available_admin_lang[$i]</option>"; + } + ?> + </select> + <input type="submit" name="submit" value="Ok"/> + </form> + </li> </ul> </div> -<?php -} -elseif (($version->getLocalVersion())==($version->getPFCOfficialCurrentVersion())){ -?> - <div class="ok"><h3><img src="style/check_on.png" alt="<?php echo _pfc("PFC is update"); ?>"> <?php echo _pfc("PFC is update"); ?></h3> + <div><h3><?php echo _pfc("PFC version verification"); ?></h3> + <?php + if ($version->getPFCOfficialCurrentVersion()==0){ + ?> <ul> + <li><?php echo _pfc("Internet connection is not possible"); ?></li> <li><?php echo _pfc("PFC version"); ?> : <?php echo $version->getLocalVersion(); ?></li> </ul> </div> -<?php -} -else{ -?> - <div class="ko"><h3><img src="style/check_off.png" alt="<?php echo _pfc("PFC is not update"); ?>"> <?php echo _pfc("PFC is not update"); ?></h3> + <?php + } + elseif (($version->getLocalVersion())==($version->getPFCOfficialCurrentVersion())){ + ?> <ul> + <li><span style="color:#339933;"><img src="style/check_on.png" alt="<?php echo _pfc("PFC is update"); ?>"> <?php echo _pfc("PFC is update"); ?></span></li> + <li><?php echo _pfc("PFC version"); ?> : <?php echo $version->getLocalVersion(); ?></li> + </ul> + + <?php + } + else{ + ?> + <ul> + <li><span style="color:#FF0000;"><img src="style/check_off.png" alt="<?php echo _pfc("PFC is not update"); ?>"> <?php echo _pfc("PFC is not update"); ?></span></li> <li><?php echo _pfc("Your version"); ?> : <?php echo $version->getLocalVersion(); ?></li> <li><?php echo _pfc("The last official version"); ?> : <?php echo $version->getPFCOfficialCurrentVersion(); ?></li> <li><?php echo _pfc("Download the last version %s here %s.","<a href=\"http://sourceforge.net/project/showfiles.php?group_id=158880\">","</a>"); ?></li> </ul> - </div> <?php } -?> +?> + </div> + </div> <?php Modified: trunk/i18n/en_US/admin.php =================================================================== --- trunk/i18n/en_US/admin.php 2006-04-25 07:51:34 UTC (rev 470) +++ trunk/i18n/en_US/admin.php 2006-04-25 10:15:32 UTC (rev 471) @@ -26,15 +26,19 @@ * @author Nemako <fr...@ne...> */ +$GLOBALS["i18n"]["lang"] = "English"; + // admin/index.php $GLOBALS["i18n"]["Administration"] = "Administration"; +$GLOBALS["i18n"]["Available Languages"] = "Available Languages"; +$GLOBALS["i18n"]["PFC version verification"] = "PFC version verification"; $GLOBALS["i18n"]["Internet connection is not possible"] = "Internet connection is not possible"; $GLOBALS["i18n"]["PFC is update"] = "PFC is update"; $GLOBALS["i18n"]["PFC version"] = "PFC version"; $GLOBALS["i18n"]["The last official version"] = "The last official version"; $GLOBALS["i18n"]["PFC is not update"] = "PFC is not update"; $GLOBALS["i18n"]["Your version"] = "Your version"; -$GLOBALS["i18n"]["Download the last version %s here %s."] = "Télécharger la dernière version %s ici %s."; +$GLOBALS["i18n"]["Download the last version %s here %s."] = "Download the last version %s here %s."; // admin/user.php Modified: trunk/i18n/fr_FR/admin.php =================================================================== --- trunk/i18n/fr_FR/admin.php 2006-04-25 07:51:34 UTC (rev 470) +++ trunk/i18n/fr_FR/admin.php 2006-04-25 10:15:32 UTC (rev 471) @@ -26,10 +26,14 @@ * @author Stephane Gully <ste...@gm...> */ +$GLOBALS["i18n"]["lang"] = "Français"; + // admin/index.php $GLOBALS["i18n"]["Administration"] = "Administration"; +$GLOBALS["i18n"]["Available Languages"] = "Langues disponibles"; +$GLOBALS["i18n"]["PFC version verification"] = "Verification de la version de PFC"; $GLOBALS["i18n"]["Internet connection is not possible"] = "La connexion à Internet n'est pas possible"; -$GLOBALS["i18n"]["PFC is update"] = "PFC est pas à jour"; +$GLOBALS["i18n"]["PFC is update"] = "PFC est à jour"; $GLOBALS["i18n"]["PFC version"] = "version de PFC"; $GLOBALS["i18n"]["The last official version"] = "La dernière version officielle"; $GLOBALS["i18n"]["PFC is not update"] = "PFC n'est pas à jour"; Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-04-25 07:51:34 UTC (rev 470) +++ trunk/src/pfci18n.class.php 2006-04-25 10:15:32 UTC (rev 471) @@ -35,8 +35,12 @@ { function Init($language,$type='main') { + if ($type=="admin") + if (!in_array($language, pfcI18N::GetAcceptedAdminLanguage())) + $language = pfcI18N::GetDefaultLanguage(); if (!in_array($language, pfcI18N::GetAcceptedLanguage())) $language = pfcI18N::GetDefaultLanguage(); + if ($type=="admin") require_once(dirname(__FILE__)."/../i18n/".$language."/admin.php"); else @@ -90,6 +94,27 @@ } return $GLOBALS["accepted_languages"]; } + + /** + * Return the language list supported bye i18n system + * (content of the i18n directory) + */ + function GetAcceptedAdminLanguage() + { + if (isset($GLOBALS["accepted_admin_languages"])) + return $GLOBALS["accepted_admin_languages"]; // restore the cached languages list + $GLOBALS["accepted_admin_languages"] = array(); + $dir_handle = opendir(dirname(__FILE__)."/../i18n"); + while (false !== ($file = readdir($dir_handle))) + { + // skip . and .. generic files + // skip also .svn directory + if ($file == "." || $file == ".." || preg_match("/^\..*/", $file)) continue; + if (file_exists(dirname(__FILE__)."/../i18n/".$file."/admin.php")) + $GLOBALS["accepted_admin_languages"][] = $file; + } + return $GLOBALS["accepted_admin_languages"]; + } /** * Parse the source-code and update the i18n ressources files This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2006-04-25 07:51:38
|
Revision: 470 Author: nemako Date: 2006-04-25 00:51:34 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=470&view=rev Log Message: ----------- + delete themes_avant.php Removed Paths: ------------- trunk/admin/themes_avant.php Deleted: trunk/admin/themes_avant.php =================================================================== --- trunk/admin/themes_avant.php 2006-04-25 07:30:18 UTC (rev 469) +++ trunk/admin/themes_avant.php 2006-04-25 07:51:34 UTC (rev 470) @@ -1,61 +0,0 @@ -<?php -require_once("themes.class.php"); -$themes = new themes(); - - -?> - -<?php -// TOP // -include("index_html_top.php"); -?> - -<div class="content"> - <h2>Liste des themes disponibles</h2> -<?php - echo "<ul>"; - $themes_list = $themes->getThemesList(); - for($i=0;$i<count($themes_list);$i++) { - $author = $themes->getThemeAuthor($themes_list[$i]); - $website = $themes->getThemeWebsite($themes_list[$i]); - - echo "<li><strong>$themes_list[$i]</strong>"; - if ($author!='0' || $website!='0') echo " ( $author - <a href=\"$website\">$website</a> )"; - echo "</li>"; - echo "<ul>"; - - - - - if($themes->isThemeImages($themes_list[$i])) - echo "<li>Images <img src=\"style/check_on.png\" alt=\"On\" /></li>"; - else - echo "<li>Images <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; - - if($themes->isThemeSmiley($themes_list[$i])) - echo "<li>Smiley <img src=\"style/check_on.png\" alt=\"On\" /></li>"; - else - echo "<li>Smiley <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; - - if($themes->isThemeTemplates($themes_list[$i])){ - echo "<li>Templates <img src=\"style/check_on.png\" alt=\"On\" /></li>"; - $templates_files_list = $themes->getThemesTemplatesFilesList($themes_list[$i]); - echo "<ul>"; - for($j=0;$j<count($templates_files_list);$j++) { - echo "<li>$templates_files_list[$j]</li>"; - } - echo "</ul>"; - } - else - echo "<li>Templates <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; - - echo "</ul>"; - } - echo "</ul>"; -?> -</div> - -<?php -// BOTTOM -include("index_html_bottom.php"); -?> \ 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: <ne...@us...> - 2006-04-25 07:30:24
|
Revision: 469 Author: nemako Date: 2006-04-25 00:30:18 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=469&view=rev Log Message: ----------- + Change the test in the version.class.php file to detect if the www.pfc.net/version file is reachable Modified Paths: -------------- trunk/admin/version.class.php Modified: trunk/admin/version.class.php =================================================================== --- trunk/admin/version.class.php 2006-04-24 15:33:52 UTC (rev 468) +++ trunk/admin/version.class.php 2006-04-25 07:30:18 UTC (rev 469) @@ -31,14 +31,18 @@ * @return integer version */ function getPFCOfficialCurrentVersion(){ - if (file_exists($this->pfc_official_current_version)) { + $parse = parse_url($this->pfc_official_current_version); + $host = $parse['host']; + error_reporting(0); // It's maybe not the best thing to do... + if (!fsockopen ($host, 80, $errno, $errstr, 1)) { + return 0; + } + else{ $fp = fopen($this->pfc_official_current_version,"r"); $version = trim(fgets($fp)); fclose($fp); return $version; } - else - return 0; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |