I really need that feature, but it isn't there.
It takes only few minutes to add it. I even wrote all code so you could easily do it (code is based on 30 minutes old cvs).
in include/template.php find this (lines 84 and 85 in current cvs):
- Code: Select all
$this->static_lang = $static_lang;
$this->force_recompile = $force_recompile;
Then if you agree to add feature to execute cfg file you need to add this code:
- Code: Select all
if (file_exists($this->root . '/style.cfg'))
{
@include($this->root . '/style.cfg');
}
It will execute style.cfg if it exists.
If you think that allowing to run php file might be dangerous (though i think its not the issue because it was working fine in 2.0 and noone ever had any security issues with it) then that cfg file can contain only list of custom variables in format "variable_name=value" (one variable per line).
In that case you need to add this code (same place as previous code - after line 85):
- Code: Select all
if (file_exists($this->root . '/style.cfg'))
{
$file = @file($this->root . '/style.cfg');
$vars = array();
for($i=0; $i<count($file); $i++)
{
$item = explode('=', $file[$i], 2);
if(count($item) == 2)
{
$vars[$item[0]] = $item[1];
}
}
if(count($vars) > 0)
{
$this->assign_vars($vars);
}
}
Please add one of those codes or something similar.
Also there is a bug in template initialization. It was there long time ago, but it still isn't fixed: template variables {T_TEMPLATE_PATH} and {T_IMAGESET_PATH} are initialized incorrectly. With current variable {T_TEMPLATE_PATH} for subSilver is "styles/subSilvertemplate" and {T_IMAGESET_PATH} for subSilver is "styles/subSilverimageset".
Here is current code (in includes/functions.php):
- Code: Select all
'T_TEMPLATE_PATH' => 'styles/' . $user->theme['primary']['template_path'] . 'template',
'T_IMAGESET_PATH' => 'styles/' . $user->theme['primary']['imageset_path'] . 'imageset',
and here is fixed code:
- Code: Select all
'T_TEMPLATE_PATH' => 'styles/' . $user->theme['primary']['template_path'] . '/template',
'T_IMAGESET_PATH' => 'styles/' . $user->theme['primary']['imageset_path'] . '/imageset',
Formerly known as CyberAlien.