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
+13 -10
View File
@@ -4,10 +4,13 @@ require_once 'functions/functions.php';
include_once 'functions/article_functions.php';
if (!empty($_POST)) {
$id = create_article(2025, $_POST['title'], $_POST['excerpt'], $_POST['tags'], $_POST['markdown']);
header('Location: articles.php?article_id=' . $id);
$id = create_article($_COOKIE['user_id'], $_POST['title'], $_POST['excerpt'], $_POST['tags'], $_POST['markdown']);
header('Location: articles.php?article_id=' . $id);
}
if (!isset($_COOKIE['role_id']) || $_COOKIE['role_id'] == 4)
header('Location: articles.php');
include_once 'components/head.php';
echo form();
@@ -15,26 +18,26 @@ include_once 'components/foot.php';
function form()
{
$raw_tags = article_tags();
$tags = '
$raw_tags = article_tags();
$tags = '
<div class="checkboxes">
<label>Tags</label>
';
foreach ($raw_tags as $row) {
$tags .= '
foreach ($raw_tags as $row) {
$tags .= '
<label class="form_checkbox_container">' . $row['tag'] . '
<input name="tags[]" value="' . $row['tag_id'] . '" type="checkbox">
<span class="checkmark"></span>
</label>
';
}
}
$tags .= '
$tags .= '
</div>
';
$form = '
$form = '
<div class="form_card">
<form method="post">
<label for="title">Title</label>
@@ -57,5 +60,5 @@ vintagecoding.net uses markdown for articles. This means:
</div>
';
return $form;
return $form;
}