implemented admin control panel with the ability to delete articles/users in bulk, and open user panels with the standard options to reset passwords, change email/usernames, or delete. additionally, updated SQL schema, created dummy data, and fixed some bugs.

This commit is contained in:
Joshua Ashton
2025-03-30 17:01:29 -06:00
parent 86823cbd3e
commit e6735a9a20
18 changed files with 414 additions and 61 deletions
-1
View File
@@ -17,7 +17,6 @@
if (isset($args['action'])) {
if ($args['action'] == 'signup') {
echo '
<script src="js/cropper.js"></script>
<script src="js/profile_picture_cropper_modal.js"></script>
<script src="js/upload.js"></script>
';
+12 -6
View File
@@ -9,14 +9,20 @@ $nav = '
<li><a href="/articles.php"' . ($current_page == '/articles.php' ? ' class="underline"' : '') . '>Articles</a></li>
';
if (isset($_COOKIE['role_id']) && $_COOKIE['role_id'] <= 2) {
$nav .= '
<li><a href="/admin.php"' . ($current_page == '/admin.php' ? ' class="underline"' : '') . '>Admin</a></li>
';
}
if (isset($_COOKIE['user_id'])) {
$nav .= '
$nav .= '
<li><a href="/user.php?action=view&user_id=' . $_COOKIE['user_id'] . '"' . ($current_page == '/user.php' ? ' class="underline"' : '') . '>Account</a></li>
';
}
if (isset($_COOKIE['role_id']) && $_COOKIE['role_id'] <= 3) {
$nav .= '
$nav .= '
<li><a href="/compose.php"' . ($current_page == '/compose.php' ? ' class="underline"' : '') . '>Compose</a></li>
';
}
@@ -30,9 +36,9 @@ $nav .= '
$theme_toggle = '';
if ($_SESSION['theme'] == 'dark')
$theme_toggle = 'light';
$theme_toggle = 'light';
else
$theme_toggle = 'dark';
$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>
@@ -40,11 +46,11 @@ $nav .= '
';
if (isset($_COOKIE['username'])) {
$nav .= '
$nav .= '
<a href="user.php?action=logout">Log Out</a>
';
} else {
$nav .= '
$nav .= '
<a href="user.php?action=login">Login</a>
<a href="user.php?action=signup">Sign Up</a>
';