[Phpfreechat-svn] SF.net SVN: phpfreechat: [852] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-29 15:37:49
|
Revision: 852 http://svn.sourceforge.net/phpfreechat/?rev=852&view=rev Author: kerphi Date: 2006-10-29 07:37:32 -0800 (Sun, 29 Oct 2006) Log Message: ----------- [en] Add 'cmd_path' parameter : this parameter is used to give an extra path where pfc will search to find the customized commands [20min] [fr] Ajout du param?\195?\168tre 'cmd_path' : ce parametre est utilis?\195?\169 pour donner un chemin ?\195?\160 pfc pour qu'il y recherche des commandes personnalis?\195?\169es [20min] Modified Paths: -------------- trunk/src/pfccommand.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-10-29 14:34:37 UTC (rev 851) +++ trunk/src/pfccommand.class.php 2006-10-29 15:37:32 UTC (rev 852) @@ -71,8 +71,12 @@ $cmd_classname = "pfcCommand_".$name; if (!class_exists($cmd_classname)) { - $cmd_filename = dirname(__FILE__)."/commands/".$cmd_name.".class.php"; - if (file_exists($cmd_filename)) require_once($cmd_filename); + $cmd_paths = array($c->cmd_path_default,$c->cmd_path); + foreach($cmd_paths as $cp) + { + $cmd_filename = $cp."/".$cmd_name.".class.php"; + if (file_exists($cmd_filename)) require_once($cmd_filename); + } } if (class_exists($cmd_classname)) { Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-10-29 14:34:37 UTC (rev 851) +++ trunk/src/pfcglobalconfig.class.php 2006-10-29 15:37:32 UTC (rev 852) @@ -54,6 +54,8 @@ "log" => array("path"=>"")); var $proxies_path = ""; // a custom proxies path var $proxies_path_default = ""; // dirname(__FILE__).'/proxies' + var $cmd_path = ""; // a custom commands path + var $cmd_path_default = ""; // dirname(__FILE__).'/commands' var $title = ""; // default is _pfc("My Chat") var $channels = array(); // the default joined channels when opening the chat var $frozen_channels = array(); // if empty, allows users to create there own channels @@ -64,7 +66,7 @@ var $max_nick_len = 15; var $max_text_len = 400; var $refresh_delay = 5000; // in mili-seconds (5 seconds) - var $max_refresh_delay = 60000; // in mili-seconds (60 seconds) + var $max_refresh_delay = 60000; // in mili-seconds (60 seconds) var $timeout = 20000; // in mili-seconds (20 seconds) var $max_msg = 20; var $quit_on_closedwindow = true; // could be annoying because the reload event is the same as a close event @@ -441,6 +443,9 @@ if ($this->proxies_path != '' && !is_dir($this->proxies_path)) $this->errors[] = _pfc("'%s' directory doesn't exist", $this->proxies_path); + // save the commands path + $this->cmd_path_default = dirname(__FILE__).'/commands'; + // load smileys from file $this->loadSmileyTheme(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |