threadr.lostcave.ddnss.de/navbar.template

82 lines
2.1 KiB
Plaintext
Raw Normal View History

<?php
if (isset($_SESSION['user_id'])){
$login = true;
} else {
$login = false;
}
?>
<ul class="topnav">
<li>
<?php
if ($login){
if ($navbar == "home"){
echo "<a class=\"active\" href=\"%CONTENT_DIR%/userhome/\"><img src=\"/common/threadr/img/ThreadR_Home.svg\" alt=\"My Feed\"/></a>";
} else {
echo "<a href=\"%CONTENT_DIR%/userhome/\"><img src=\"/common/threadr/img/ThreadR_Home.svg\" alt=\"My Feed\"/></a>";
}
} else {
if ($navbar == "home"){
echo "<a class=\"active\" href=\"%CONTENT_DIR%/\"><img src=\"/common/threadr/img/ThreadR_Home.svg\" alt=\"Home\"/></a>";
} else {
echo "<a href=\"%CONTENT_DIR%/\"><img src=\"/common/threadr/img/ThreadR_Home.svg\" alt=\"Home\"/></a>";
}
}
?>
</li>
<li>
<?php
if ($navbar == "news"){
echo "<a class=\"active\" href=\"%CONTENT_DIR%/news/\">News</a>";
} else {
echo "<a href=\"%CONTENT_DIR%/news/\">News</a>";
}
?>
</li>
<li>
<?php
if ($navbar == "boards"){
echo "<a class=\"active\" href=\"%CONTENT_DIR%/boards/\">Boards</a>";
} else {
echo "<a href=\"%CONTENT_DIR%/boards/\">Boards</a>";
}
?>
</li>
<li>
<?php
if ($navbar == "about"){
echo "<a class=\"active\" href=\"%CONTENT_DIR%/about/\">About</a>";
} else {
echo "<a href=\"%CONTENT_DIR%/about/\">About</a>";
}
?>
</li>
2020-03-04 10:48:41 +01:00
<li class="right">
<?php
if ($login) {
2020-03-04 10:48:41 +01:00
echo "<a href=\"%CONTENT_DIR%/logout/\">Log out</a>";
} else {
if ($navbar == "login") {
echo "<a class=\"active\" href=\"%CONTENT_DIR%/login/\">Log in</a>";
} else {
2020-03-04 10:48:41 +01:00
echo "<a href=\"%CONTENT_DIR%/login/\">Log in</a>";
}
}
?>
</li>
2020-03-04 10:48:41 +01:00
<li class="right">
<?php
if ($login) {
2020-03-04 10:48:41 +01:00
if ($navbar == "profile") {
echo "<a class=\"active\" href=\"%CONTENT_DIR%/profile/\">Profile</a>";
} else {
2020-03-04 10:48:41 +01:00
echo "<a href=\"%CONTENT_DIR%/profile/\">Profile</a>";
}
}
?>
</li>
</ul>
<br />