When i go in 'options > theme options' i can see the 'theme colors' setting, but it appears empty when i select the arrow. BTW, it is a fresh install, and i have this issue for all themes which have a changeable color scheme. Does anyone have or had that problem? Thanks in advance for the help.
Another thing which is not related to the above problem: chililight2 theme (downloaded from theme section) has to be named Chili-Light2 in the ftp tree, otherwise, the images such as 'prev', 'next', 'loading', etc. cannot be displayed. If some admin passing by can take the point.
Comments
Here is a screenshot to show the issue :
http://img85.imageshack.us/img85/310/zp1nh1.gif
BTW, thanks for the note on chililight2 it is now fixed.
Is there an easy work around to solve that issue ? (except changing ISP :-p )
This is essentially the code we are using to get the file lists. `$root` is the full server path to the folder. `$suffix` is the filter (.css, .php, .png). $currentValue does not matter for testing.
`function generateListFromFiles($currentValue, $root, $suffix) {
chdir($root);
$filelist = glob('*'.$suffix);
sort($filelist);
$list = array();
foreach($filelist as $file) {
$list[] = str_replace($suffix, '', $file);
}
print_r($list);
}`
The `print_r` replaced the code for generating the drop-down. You might try it stand-a-lone and see what it does. It also may give you talking points with your ISP.
You could also add a `print_r($filelist);` to see what the glob call got returned.
You have two options as I see it. (Assuming that there is not a correctable error in safe_glob.)
1. Talk to your ISP and get them to enable the glob function for your installation.
2. Manally set the options you want directly to the options table in the database.
The rows you want are:
name=Theme_colors
value=css (without the .css suffix)
name=spam_filter
value=filter (without the .php suffix)
name=watermark_image
value=images/watermark.png
name=video_watermark_image
value=images/watermark-video.png
I have tried the safe_glob code from the PHP manual. I think it is not looking in the correct directory. I will see if I can fix it to work. Let you know.
`function safe_glob($pattern, $flags=0) {
$split=explode('/',$pattern);
$match=array_pop($split);
$path=implode('/',$split);
if (empty($path)) { $path = '.'; };
if (($dir=opendir($path))!==false) {
$glob=array();
while(($file=readdir($dir))!==false) {
if (fnmatch($match,$file)) {
if ((is_dir("$path/$file"))||(!($flags&GLOB_ONLYDIR))) {
if ($flags&GLOB_MARK) $file.='/';
$glob[]=$file;
}
}
}
closedir($dir);
if (!($flags&GLOB_NOSORT)) sort($glob);
return $glob;
} else {
return false;
}
}`
I've tested the updated safe_glob function you did, it is working well and it is much better than my workaround. Thanks a lot. It is saving me the trouble of editing a lot of files.
Thanks again for the help.
I have added the save_glob function to the hacks section in trak. You should know that the next revision of zenpoto will be using glob in the class-albums.php file in the deleteAlbum function.
I'm sure of what I have to do to "solve" the problem.
Should I have to add the given code in the admin-functions.php file ?
Thank you for helping me (and others for sure).
Damino:
I notice that there are several more calls on `glob()` than existed when the track article was written. You might want to do a search to find the places that need changing.
can you indicate what file i should modify ?
thanks