diff --git a/tabs.php b/tabs.php
index c7c608c..6f76ef9 100644
--- a/tabs.php
+++ b/tabs.php
@@ -3,24 +3,21 @@
"/",
- "Blog" => "/blog/",
- "Contact" => "/contact/",
- "Projects" => "/projects/",
- "Resume" => "/resume/"
+ "Home" => array("aclindsay.com", "", "%^/?$%"),
+ "Blog" => array("blog.aclindsay.com", "", "%.*%"),
+ "Contact" => array("aclindsay.com", "/contact", "%^/contact(/.*)?%"),
+ "Projects" => array("aclindsay.com", "/projects", "%^/projects(/.*)?%"),
+ "Resume" => array("aclindsay.com", "/resume", "%^/resume(/.*)?%")
);
-$base_domain = $_SERVER['HTTP_HOST'] == "aclindsay.com";
+$http_host = $_SERVER['HTTP_HOST'];
+$request_uri = $_SERVER['REQUEST_URI'];
-foreach ($tabs as $name => $url) {
- if ($url == "/") {
- if ($base_domain && $_SERVER['REQUEST_URI'] == "/")
- echo "\t\t- Home
\n";
- else
- echo "\t\t- Home
\n";
- } else if (strncmp($url, $_SERVER['REQUEST_URI'], strlen($url)) == 0)
- echo "\t\t- ".$name."
\n";
+foreach ($tabs as $name => $tab_info) {
+ if ($tab_info[0] == $http_host && preg_match($tab_info[2], $request_uri))
+ $class="current";
else
- echo "\t\t- ".$name."
\n";
+ $class="inactive";
+ echo "\t\t- ".$name."
\n";
}
?>