1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-20 02:15:28 +00:00

force refetch feed when clicking update/clicking on same feed in the tree

This commit is contained in:
Andrew Dolgov
2012-10-25 13:15:14 +04:00
parent 56b2a4095b
commit c0c2abbaa7
6 changed files with 29 additions and 49 deletions

View File

@@ -134,9 +134,20 @@ class Feeds extends Handler_Protected {
$method_split = explode(":", $method);
if ($method == "ForceUpdate" && $feed && is_numeric($feed) > 0) {
include "rssfuncs.php";
update_rss_feed($this->link, $feed, true);
if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) {
// Update the feed if required with some basic flood control
$result = db_query($this->link,
"SELECT ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
FROM ttrss_feeds WHERE id = '$feed'");
if (db_num_rows($result) != 0) {
$last_updated = strtotime(db_fetch_result($result, 0, "last_updated"));
if (time() - $last_updated > 120) {
include "rssfuncs.php";
update_rss_feed($this->link, $feed, true, true);
}
}
}
if ($method_split[0] == "MarkAllReadGR") {