diff --git a/src/public/index.php b/src/public/index.php index 3482e65..ea5cca3 100644 --- a/src/public/index.php +++ b/src/public/index.php @@ -19,35 +19,48 @@ if (array_key_exists('refresh', $_GET)) { } } -$query = $db->prepare(<<<'SQL' +if (key_exists('bookmarked', $_GET)) { + $itemCriteria = 'item.is_bookmarked = 1'; + $returnURL = '&from=' . urlencode('/?bookmarked'); + $type = 'Bookmarked'; +} else { + $itemCriteria = 'item.is_read = 0'; + $returnURL = ''; + $type = 'Unread'; +} +$title = "Your $type Items"; + +$query = $db->prepare(<<bindValue(':userId', $_SESSION[Key::USER_ID]); $result = $query->execute(); $item = $result ? $result->fetchArray(SQLITE3_ASSOC) : false; -page_head('Your Unread Items'); ?> +page_head($title); ?>

- Your Unread Items   - (Refresh All Feeds) - Refreshing… +   + (Refresh All Feeds) + Refreshing…

-


+


fetchArray(SQLITE3_ASSOC); } } else { ?> -

There are no unread items

There are no items
FRC_VERSION }; ?>
-
v
+
Feed Reader Centralv
- | | - Log Off - | prepare(<<<'SQL' + SELECT EXISTS( + SELECT 1 + FROM item INNER JOIN feed ON item.feed_id = feed.id + WHERE feed.user_id = :id AND item.is_bookmarked = 1) + SQL); + $bookQuery->bindValue(':id', $_SESSION[Key::USER_ID]); + $bookResult = $bookQuery->execute(); + $hasBookmarks = $bookResult ? $bookResult->fetchArray(SQLITE3_NUM)[0] : false; ?> + | + + | + Log Off + | close(); } } else { ?> |