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:
+55
-1
@@ -1,7 +1,61 @@
|
||||
<?php
|
||||
require_once 'functions/init.php';
|
||||
require_once 'functions/functions.php';
|
||||
include_once 'components/head.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);
|
||||
}
|
||||
|
||||
include_once 'components/head.php';
|
||||
|
||||
echo form();
|
||||
include_once 'components/foot.php';
|
||||
|
||||
function form()
|
||||
{
|
||||
$raw_tags = article_tags();
|
||||
$tags = '
|
||||
<div class="form_tags">
|
||||
<label>Tags</label>
|
||||
';
|
||||
|
||||
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 .= '
|
||||
</div>
|
||||
';
|
||||
|
||||
$form = '
|
||||
<div class="form_card">
|
||||
<form method="post">
|
||||
<label for="title">Title</label>
|
||||
<input id="title" name="title" placeholder="Article Title" required>
|
||||
|
||||
<label for="markdown">Markdown</label>
|
||||
<textarea id="markdown" name="markdown" required>
|
||||
## Heading
|
||||
vintagecoding.net uses markdown for articles. This means:
|
||||
- Simple syntax for formatting
|
||||
- Pre-built styling
|
||||
- Markdown can be parsed into HTML.
|
||||
</textarea>
|
||||
|
||||
<label for="excerpt">Excerpt</label>
|
||||
<input id="excerpt" name="excerpt" placeholder="Article Excerpt">
|
||||
' . $tags . '
|
||||
<input class="button" type="submit" value="Create Article">
|
||||
</form>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user