1
0
aclindsay.com/tabs.php
Aaron Lindsay b9d373a02f Stop using é in Resume
It seems like it might not be search friendly
2018-05-08 20:40:21 -04:00

26 lines
845 B
PHP

<?php include_once("common.php"); ?>
<div id="tabs">
<ul>
<?php
$tabs = array(
"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(/.*)?%")
);
$protocol = get_protocol();
$http_host = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
foreach ($tabs as $name => $tab_info) {
if ($tab_info[0] == $http_host && preg_match($tab_info[2], $request_uri))
$class="current";
else
$class="inactive";
echo "\t\t<li><a href=\"".$protocol.$tab_info[0].$tab_info[1]."\" class=\"".$class."\">".$name."</a></li>\n";
}
?>
</ul>
</div>