implemented article composer functionality + interface, login & signup functionality + interface, auth permission functionality reflected in the nav, and determined a unified accent color accessible in dark and light mode
This commit is contained in:
+28
-3
@@ -7,9 +7,19 @@ $nav = '
|
||||
<ul>
|
||||
<li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li>
|
||||
<li><a href="/articles.php"' . ($current_page == '/articles.php' ? ' class="underline"' : '') . '>Articles</a></li>
|
||||
';
|
||||
|
||||
if (isset($_COOKIE['role_id']) && $_COOKIE['role_id'] <= 3) {
|
||||
$nav .= '
|
||||
<li><a href="/compose.php"' . ($current_page == '/compose.php' ? ' class="underline"' : '') . '>Compose</a></li>
|
||||
';
|
||||
}
|
||||
|
||||
$nav .= '
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="nav_right_hand">
|
||||
<form method="post">
|
||||
';
|
||||
|
||||
$theme_toggle = '';
|
||||
@@ -19,8 +29,23 @@ else
|
||||
$theme_toggle = 'dark';
|
||||
|
||||
$nav .= '
|
||||
<button id="theme-toggle" value="' . $theme_toggle . '" name="theme" onchange="this.form.submit()"><i class="nf ' . ($theme_toggle == 'dark' ? 'nf-oct-moon' : 'nf-oct-sun') . '"></i></button>
|
||||
</form>
|
||||
<button id="theme-toggle" value="' . $theme_toggle . '" name="theme" onchange="this.form.submit()"><i class="nf ' . ($theme_toggle == 'dark' ? 'nf-oct-moon' : 'nf-oct-sun') . '"></i></button>
|
||||
</form>
|
||||
';
|
||||
|
||||
if (isset($_COOKIE['username'])) {
|
||||
$nav .= '
|
||||
<a href="user.php?action=logout">Log Out</a>
|
||||
';
|
||||
} else {
|
||||
$nav .= '
|
||||
<a href="user.php?action=login">Login</a>
|
||||
<a href="user.php?action=signup">Sign Up</a>
|
||||
';
|
||||
}
|
||||
|
||||
$nav .= '
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
';
|
||||
|
||||
Reference in New Issue
Block a user