1
0
aclindsay.com/tabs.php

27 lines
779 B
PHP
Raw Normal View History

2011-02-24 14:25:26 -05:00
<div id="tabs">
<ul>
2011-04-15 23:33:30 -04:00
<?php
$tabs = array(
"Home" => "/",
"Blog" => "/blog/",
"Contact" => "/contact/",
"Projects" => "/projects/",
"Resume" => "/resume/"
);
$base_domain = $_SERVER['HTTP_HOST'] == "aclindsay.com";
2011-04-15 23:33:30 -04:00
foreach ($tabs as $name => $url) {
if ($url == "/") {
if ($_SERVER['REQUEST_URI'] == "/")
echo "\t\t<li><a href=\"http://aclindsay.com/\" class=\"current\">Home</a></li>\n";
else
echo "\t\t<li><a href=\"http://aclindsay.com/\">Home</a></li>\n";
} else if ($base_domain && strncmp($url, $_SERVER['REQUEST_URI'], strlen($url)) == 0)
echo "\t\t<li><a href=\"http://aclindsay.com".$url."\" class=\"current\">".$name."</a></li>\n";
else
echo "\t\t<li><a href=\"http://aclindsay.com".$url."\">".$name."</a></li>\n";
}
?>
2011-02-24 14:25:26 -05:00
</ul>
</div>