Add date for RSS feeds (#4)

- First cut of user message add/display
This commit is contained in:
2024-04-11 19:07:39 -04:00
parent 8ca4bf2109
commit 7d294b9be8
4 changed files with 41 additions and 17 deletions

View File

@@ -12,7 +12,11 @@ Security::verifyUser();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// TODO: get feed, add if new, reject if existing but not owned by this user, update otherwise
$result = Feed::add($_POST['url']);
echo '<pre>'; var_dump($result); echo '</pre>';
if (array_key_exists('ok', $result)) {
add_message('INFO', 'Feed added successfully');
} else {
add_message('ERROR', $result['error']);
}
$feed = [ 'id' => $_POST['id'], 'url' => $_POST['url'] ];
$title = 'TODO';
} else {
@@ -20,9 +24,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$feed = [ 'id' => $_GET['id'], 'url' => '' ];
$title = 'Add RSS Feed';
}
page_head($title);
?>
page_head($title); ?>
<h1><?=$title?></h1>
<article>
<form method=POST action=/feed hx-post=/feed>
@@ -33,6 +36,5 @@ page_head($title);
</label><br>
<button type=submit>Save</button>
</form>
</article>
<?php
</article><?php
page_foot();