[Phpfreechat-svn] SF.net SVN: phpfreechat: [1019] trunk/src/pfcglobalconfig.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-04-18 13:59:37
|
Revision: 1019 http://svn.sourceforge.net/phpfreechat/?rev=1019&view=rev Author: kerphi Date: 2007-04-18 06:59:38 -0700 (Wed, 18 Apr 2007) Log Message: ----------- [en] Bug fix: themes resources (images/sound) were hidden if pfc sources were located in a private (for the web browsers) path. [1h45] [fr] Bug fix : les ressources des th?\195?\168mes (images et son) ne s'affichaient pas lorsque le code source de pfc ?\195?\169tait plac?\195?\169 dans un chemin priv?\195?\169 (non accessible par les navigateurs web). [1h45] Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-04-18 12:17:25 UTC (rev 1018) +++ trunk/src/pfcglobalconfig.class.php 2007-04-18 13:59:38 UTC (rev 1019) @@ -405,18 +405,35 @@ $this->errors[] = _pfc("%s doesn't exist", $filetotest); $this->server_script_url = relativePath($this->client_script_path, $this->server_script_path).'/'.basename($filetotest).$this->_query_string; } - + + // If the user didn't give any theme_default_url value, + // copy the default theme resources in a public directory + if ($this->theme_default_url == '') + { + mkdir_r($this->data_public_path.'/themes/default'); + if (!is_dir($this->data_public_path.'/themes/default')) + $this->errors[] = _pfc("cannot create %s", $this->data_public_path.'/themes/default'); + else + { + $ret = copy_r( dirname(__FILE__).'/../themes/default', + $this->data_public_path.'/themes/default' ); + if (!$ret) + $this->errors[] = _pfc("cannot copy %s in %s", + dirname(__FILE__).'/../themes/default', + $this->data_public_path.'/themes/default'); + } + } + // check if the theme_path parameter are correctly setup - if ($this->theme_default_path == "" || !is_dir($this->theme_default_path)) - $this->theme_default_path = realpath(dirname(__FILE__)."/../themes"); - if ($this->theme_path == "" || !is_dir($this->theme_path)) + if ($this->theme_default_path == '' || !is_dir($this->theme_default_path)) + $this->theme_default_path = dirname(__FILE__).'/../themes'; + if ($this->theme_path == '' || !is_dir($this->theme_path)) $this->theme_path = $this->theme_default_path; // calculate theme url if ($this->theme_default_url == '') - $this->theme_default_url = relativePath($this->client_script_path, $this->theme_default_path); + $this->theme_default_url = $this->data_public_url.'/themes'; if ($this->theme_url == '') - $this->theme_url = relativePath($this->client_script_path, $this->theme_path); - + $this->theme_url = $this->theme_default_url; // --- // run specific container initialisation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |