Akis tried php

This commit is contained in:
Richard Mikloš 2024-01-23 13:11:30 +01:00
parent 073a56a628
commit da07b43ac4
4 changed files with 42 additions and 3 deletions

@ -18,7 +18,16 @@ $paths_to_check = array();
$page = basename($_SERVER['QUERY_STRING']);
$nav = include_ob("$template_dir/navigation.html");
if (isset($_SESSION['user_id'])) {
if(isset($_SESSION['user_isAdmin'])) {
$nav = include_ob("$template_dir/admin_nav.html");
}
else {
$nav = include_ob("$template_dir/user_nav.html");
}
} esle {
$nav = include_ob("$template_dir/navigation.html");
}
if($page_dir == "global") {

15
templates/admin_nav.html Normal file

@ -0,0 +1,15 @@
<nav>
<ul>
<li><a href=""><i class="ri-settings-4-fill"></i></a></li>
<div class="links">
<li><a href="">Home</a></li>
<li><a href=""></a></li>
<li><a href="" class="pfp"><template name="gravatar image"></template></a></li>
You are the coolest person ever (you are admin)
ako urobím aby admin nav bol iný ako non-admin nav, a ešte aby global bol iný (login, register, atď)?
</div>
</ul>
</nav>

@ -6,8 +6,8 @@
<li><a href=""></a></li>
<li><a href="" class="pfp"><template name="gravatar image"></template></a></li>
ako urobím aby admin nav bol iný ako non-admin nav, a ešte aby global bol iný (login, register, atď)
ako urobím aby admin nav bol iný ako non-admin nav, a ešte aby global bol iný (login, register, atď)?
</div>
</ul>
</nav>

15
templates/user_nav.html Normal file

@ -0,0 +1,15 @@
<nav>
<ul>
<li><a href=""><i class="ri-settings-4-fill"></i></a></li>
<div class="links">
<li><a href="">Home</a></li>
<li><a href=""></a></li>
<li><a href="" class="pfp"><template name="gravatar image"></template></a></li>
Just USER nav
ako urobím aby admin nav bol iný ako non-admin nav, a ešte aby global bol iný (login, register, atď)?
</div>
</ul>
</nav>