So I hope he will not kill me because I added my nativeEx backcolor and lower right logo
Peter
I don't think we need to worry. I think he lost interest when I turned down his suggestion for 3-D animation.
In fact, I'm starting to wonder if we're all alone in here.
Anyhow, I'm in the process of implementing your .INI file title request and your idea for more user-specific subdir listing options. So far, I think I'll probably do the latter the same way I did the $allowBrowse option, replacing $update_list_all entirely. Something like this in the config file:
/////////////////////////////////////////////////////
// Subdirectories to include in WinBuilder updates listing file
// $subInclude = array("*") - all within base folder
/////////////////////////////////////////////////////
$subInclude = array($subdir[1],$subdir[2],$subdir[3],$subdir[4]);
That makes the handling very simple in both the directory_array() and items_list() functions:
function directory_array($startdir, $includefiles, $recursive, $level=1)
{
global $ignore_files, $subInclude;
$directory_array = array();
if($handle = opendir($startdir))
{
while (false !== ($file = readdir($handle)))
{
if(!in_array($file, $ignore_files))
{
if(is_dir($startdir. "/" . $file) && ($level > 1 || in_array("*", $subInclude) || in_array($file.'/', $subInclude)))
{
if($recursive)
{
$directory_array = array_merge($directory_array, directory_array($startdir. "/" . $file, $includefiles, $recursive, 2));
}
$file = $startdir . "/" . $file;
$directory_array[] = preg_replace("/\/\//si", "/", $file);
}
else
{
if($includefiles)
{
$file = $startdir . "/" . $file;
$directory_array[] = preg_replace("/\/\//si", "/", $file);
}
}
}
}
closedir($handle);
}
return $directory_array;
}
function items_list($startdir, $listtype = 'all')
{
global $ignore_files, $subInclude;
$itemslist = "";
$formpath01 = str_replace("./", ".",$startdir);
$formpath02 = str_replace(".", "",$formpath01);
$formpath03 = str_replace("/", "\\",$formpath02);
if($handle = opendir($startdir))
{
while (false !== ($file = readdir($handle)))
{
if(!in_array($file, $ignore_files))
{
$chkdir = realpath($startdir."/".$file);
if(is_dir($chkdir))
{
if(($listtype == 'folders' || $listtype == 'all') && ($startdir != '.' || in_array("*", $subInclude) || in_array($file.'/', $subInclude)))
{
if($formpath03 == '') $itemslist .= $file."=folder\n";
else $itemslist .= $formpath03."\\".$file."=folder\n";
}
}
else
{
if($listtype == 'files' || $listtype == 'all') $itemslist .= get_fileinfo($file, $startdir)."\n";
}
}
}
closedir($handle);
}
return $itemslist;
}
My divergence is
not a comment on the elegance of your own coding idea, BTW. I'm just very, very lazy.