Add feed refresh link (#5)
- Feed updates and refresh use the same logic - Fixed issue with logic around item add-or-update
This commit is contained in:
@@ -9,7 +9,17 @@ include '../start.php';
|
||||
|
||||
Security::verifyUser();
|
||||
|
||||
$db = Data::getConnection();
|
||||
$db = Data::getConnection();
|
||||
|
||||
if (array_key_exists('refresh', $_GET)) {
|
||||
$refreshResult = Feed::refreshAll($db);
|
||||
if (array_key_exists('ok', $refreshResult)) {
|
||||
add_info('All feeds refreshed successfully');
|
||||
} else {
|
||||
add_error(nl2br($refreshResult['error']));
|
||||
}
|
||||
}
|
||||
|
||||
$result = $db->query(<<<'SQL'
|
||||
SELECT item.id, item.title AS item_title, coalesce(item.updated_on, item.published_on) AS as_of,
|
||||
feed.title AS feed_title
|
||||
@@ -21,7 +31,7 @@ $result = $db->query(<<<'SQL'
|
||||
$item = $result ? $result->fetchArray(SQLITE3_ASSOC) : false;
|
||||
|
||||
page_head('Welcome'); ?>
|
||||
<h1>Your Unread Items</h1>
|
||||
<h1>Your Unread Items <a href=/?refresh><small><small><em>(Refresh All Feeds)</em></small></small></a></h1>
|
||||
<article><?php
|
||||
if ($item) {
|
||||
while ($item) { ?>
|
||||
|
||||
Reference in New Issue
Block a user