Alpha 6: Feed-level Pages (#21)

Reviewed-on: #21
This commit was merged in pull request #21.
This commit is contained in:
2024-05-23 23:04:41 +00:00
parent 93377ffa0e
commit 4fa4dcb831
14 changed files with 256 additions and 85 deletions

View File

@@ -20,7 +20,7 @@ if (array_key_exists('refresh', $_GET)) {
}
$query = $db->prepare(<<<'SQL'
SELECT item.id, item.title AS item_title, coalesce(item.updated_on, item.published_on) AS as_of,
SELECT item.id, item.feed_id, item.title AS item_title, coalesce(item.updated_on, item.published_on) AS as_of,
feed.title AS feed_title
FROM item
INNER JOIN feed ON feed.id = item.feed_id
@@ -41,8 +41,9 @@ page_head('Your Unread Items'); ?>
<article><?php
if ($item) {
while ($item) { ?>
<p><a href=/item?id=<?=$item['id']?> hx-get=/item?id=<?=$item['id']?>><?=strip_tags($item['item_title'])?></a>
<br><?=htmlentities($item['feed_title'])?><br><small><em><?=date_time($item['as_of'])?></em></small><?php
<p><?=hx_get("/item?id={$item['id']}", strip_tags($item['item_title']))?><br>
<small><?=date_time($item['as_of'])?> &bull;
<?=hx_get("/feed/items?id={$item['feed_id']}&unread", htmlentities($item['feed_title']))?></small><?php
$item = $result->fetchArray(SQLITE3_ASSOC);
}
} else { ?>