[Openupload-svn-update] SF.net SVN: openupload:[262] trunk/lib/general.inc.php
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2009-02-21 13:40:58
|
Revision: 262
http://openupload.svn.sourceforge.net/openupload/?rev=262&view=rev
Author: tsdogs
Date: 2009-02-21 13:40:52 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
Remove not necessary WEB_ROOT setting for templates
Modified Paths:
--------------
trunk/lib/general.inc.php
Modified: trunk/lib/general.inc.php
===================================================================
--- trunk/lib/general.inc.php 2009-02-21 12:35:30 UTC (rev 261)
+++ trunk/lib/general.inc.php 2009-02-21 13:40:52 UTC (rev 262)
@@ -115,12 +115,16 @@
function template_file($file) {
global $CONFIG;
-
if ($file == '') return '';
if (strpos($file,'/')===0) { /* remove leading slash */
$file = substr($file,1,strlen($file)-1);
}
- if (file_exists($CONFIG['WEB_ROOT'].'/templates/'.$CONFIG['site']['template'].'/'.$file))
+ /* guess where "public" template files are placed */
+ $base = '.';
+ if (defined('__NOT_MAIN_SCRIPT')) {
+ $base = './www';
+ }
+ if (file_exists($base.'/templates/'.$CONFIG['site']['template'].'/'.$file))
return $CONFIG['WWW_ROOT'].'/templates/'.$CONFIG['site']['template'].'/'.$file;
else
return $CONFIG['WWW_ROOT'].'/templates/default/'.$file;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|