= 5.0) { $BROWSER = "newmozilla"; # Mozilla or Netscape 6+ if (eregi("(Netscape|Navigator|Communicator)", $HTTP_USER_AGENT, $throwaway)) { $BROWSERVARIANT = "netscape"; } else { $BROWSERVARIANT = "notnetscape"; } } else { $BROWSER = "oldmozilla"; # Netscape 4.xx or earlier } } else { $BROWSER = "oldmozilla"; # Netscape, old-school-style. if ($matches[2] > 0) { # It gives a compatibility version... $BROWSERVERSION = $matches[2]; } else { $BROWSERVERSION = "3.0"; # We'll assume they can handle # what NS 3 can. } } } else { if (ereg("(Opera)[\ \/]([0-9\.]+)[^0-9]", " $HTTP_USER_AGENT ", $matches)) { # Opera $BROWSER = "opera"; $BROWSERVERSION = $matches[2]; } else { if (eregi("(Lynx|Links|w3m|charlotte|mailbrowse|nettame|wanna|bobcat)[\ \/][\(]?([0-9\.]+)[^0-9]", " $HTTP_USER_AGENT ", $matches)) { # Lynx, links or w3m-- popular text-based browsers. $BROWSER = "textbased"; $BROWSERVARIANT = strtolower($matches[1]); $BROWSERVERSION = $matches[2]; } else { if (ereg("(iCab)[\ \/]([0-9\.]+)[^0-9]", " $HTTP_USER_AGENT ", $matches)) { $BROWSER = "icab"; # iCab, the most anal-retentive browser ever! $BROWSERVERSION = $matches[2]; } else { $BROWSER = "unknown"; # We have no clue what this is. $BROWSERVERSION = "0.0"; } } } } } } # Now we have the browser type... okay, so now we need to discover # the OS type: 'win', 'mac' or 'other' (e.g. Unix). if (eregi("(Windows|Win16|Win32|Win64|WinXP|Win2K|Win95|Win98|Win9x|WinNT|Windows NT|Windows 2000)", $HTTP_USER_AGENT, $matches)) { $BROWSEROS = 'win'; # Windows browser. } else { if (eregi("(Macintosh|MacOS|Mac OS|OS X|Mac_PowerPC|Mac_[m]?68k)", $HTTP_USER_AGENT, $matches)) { $BROWSEROS = 'mac'; # Mac OS browser. } else { $BROWSEROS = 'other'; # Other OS browser (e.g. Linux) } } } # End of DiscoverBrowser() function DirBrowser() { $linkcount = 0; if ($dir = @opendir(".")) { while (($file = readdir($dir)) !== false) { if (eregi("\.php$", $file, $throwaway)) { if ($file != 'index.php') { ereg("^(.*)\.php$", $file, $tmpresults); $thispage = ereg_replace('_', ' ', $tmpresults[1]); # echo "$thispage
\n"; $allpages[$thispage] = $file; $linkcount++; } } } closedir($dir); if ($linkcount > 0) { ksort($allpages); $linkcount = count($allpages); global $CURRPAGECOLOR; ereg("(.*)/(.*)$", strtoupper(getcwd()), $tmpresults); $secname = $tmpresults[2]; if (strtolower($secname) != 'www') { if ($currpage == 'index.php') { print "[$secname]"; } else { print "[$secname]"; } print " >> "; while (list($lvar, $lvalue) = each($allpages)) { print "  ["; if ($currpage == $lvalue) { print ""; } else { print ""; } print $lvar; if ($currpage != $lvalue) { print ""; } print "]"; $linkcount--; if ($linkcount > 0) { print " "; } } print "
"; } } } } # End of DirBrowser(); function IncludeBody() { $REQUEST_URI = getenv('REQUEST_URI'); $snarray = split("/", $REQUEST_URI); $snhighestindex = count($snarray) - 1; $snbase = $snarray[$snhighestindex]; if ($snbase == '') { $snbase = 'index.php'; } $myhtml = eregi_replace(".php$", ".html", $snbase); $myhtmlbase = eregi_replace(".php$", '', $snbase); global $BROWSER; global $BROWSEROS; if (file_exists("${myhtmlbase}_${BROWSEROS}_${BROWSER}.html")) { require("${myhtmlbase}_${BROWSEROS}_${BROWSER}.html"); } if (file_exists($myhtml)) { require($myhtml); } else { print "


(Sorry, the file '$myhtml' was not found)
\n"; } } # End of IncludeBody(); # Main code DiscoverBrowser(); global $BROWSER; global $BASEDIR; print ' '; require("${BASEDIR}/twutop-alkire.html"); print '
'; print "\n"; DirBrowser(); print '
'; print "\n"; print '
'; print "\n"; $tmperrors = trim($GLOBALS['HTTP_POST_VARS']['errors']); if ($tmperrors == '') { $tmperrors = trim($GLOBALS['HTTP_GET_VARS']['errors']); } if ($tmperrors != '') { print ""; print ""; $snarray = split("/", $REQUEST_URI); $snhighestindex = count($snarray) - 1; $snbase = $snarray[$snhighestindex]; $myerrordb = eregi_replace(".php$", ".err", $snbase); if (file_exists($myerrordb)) { $errordb = file($myerrordb); $origerrors = $tmperrors; $outerrors = ''; for ($e = 0; $e < count($errordb); $e++) { $currline = trim($errordb[$e]); eregi("^([^:]):[\s]*(.*)$", $currline, $tmpres); $errcode = $tmpres[1]; $errdesc = $tmpres[2]; $allerrors[$errcode] = $errdesc; if (ereg($errcode, $origerrors)) { if ($outerrors != '') { $outerrors .= '
'; } $outerrors .= $errdesc; } } } if ($outerrors == '') { $outerrors = 'Unknown error.'; } print "
Oops!  ${outerrors}


"; } print '
'; IncludeBody(); print '
'; require("${BASEDIR}/twubottom-alkire.html"); ?>