= 4) { $IE4 = true; $VE4 = true; } } elseif (preg_match("#Mozilla/([0-9]+)#", $HTTP_USER_AGENT, $version)) { $NS = true; $ver = (int)$version[1]; if ($ver >= 4) { $NS4 = true; $VE4 = true; } } /////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // defsThisDir // Extracts the directory relative to the WEBROOT from the passed __FILE__ // // Parameters: // $filename The vaule of __FILE__ in the calling file // // Returns: // string the directory relative to the WEBROOT // function defsThisDir($filename) { global $lclFILEROOT; if(preg_match("#^/#", filename)) { preg_match("#$lclFILEROOT/(.*)/[^/]*$#", $filename, $matches); return "/" . $matches[1]; } else { preg_match("#(.*)/[^/]*$#", $filename, $matches); return $matches[1]; } } /////////////////////////////////////////////////////////////////////////////// // defsThisFile // Extracts the filename from the end of the passed __FILE__ // // Parameters: // $filename The vaule of __FILE__ in the calling file // // Returns: // string the filename of the calling file // function defsThisFile($filename) { preg_match("#([^/]*)$#", $filename, $matches); return $matches[1]; } /////////////////////////////////////////////////////////////////////////////// // LOCALS // /////////////////////////////////////////////////////////////////////////////// // Bring in the server specific constants $defsdir = defsThisDir(__FILE__); if($defsdir) { include("$defsdir/local.html"); } else { include("local.html"); } ?>