Indent your code. It's horrible to read and an error can easily be hidden somewhere due to an if being nested when it shouldn't or something similar.
It should indeed be
($file = readdir($od)) !== false
Readdir will return either a filename, or boolean false. If readdir returns filename '0' you'd otherwise have a problem, since 0 casts to boolean false, thus
# false
if (0)
# false
if (0 != false)
# true
if (0 !== false)
As for things being included or not, one thing that may cause issues is your use of global variables. Perhaps something inside an included file is not in global scope and that screws it up. Anyway, you could go through all your settings.php files and on line 1 insert
echo __file__ . ' included'; # or error_log()
That way you definitely get to see if a file is included or not.
You might also want to add output / error logging of the current directory being scanned and once you're certain that it goes through all directories you thought it would, output / error log the files it goes through in each directory.
And to get rid of the global mess start by adding $config as a third parameter to getSettings. If the only variables your included files define that need to be used after inclusion is the $SETTINGS array, you could simply return $SETTINGS in each of your settings files and
Also, since you never use $issubdir, you could simply drop this function parameter.