From: Andrew Dolgov Date: Mon, 13 Jul 2015 10:29:13 +0000 (+0300) Subject: headlines: fix whitebox reply not returned in an updated format X-Git-Tag: 16.3~228 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9f5eca992b116e7c5944d41826d2c25e742b185c;p=tt-rss.git headlines: fix whitebox reply not returned in an updated format --- diff --git a/classes/feeds.php b/classes/feeds.php index 089c3e71..fb9413ff 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -296,6 +296,8 @@ class Feeds extends Handler_Protected { } } + $reply['content'] = array(); + if (!is_numeric($result) && $this->dbh->num_rows($result) > 0) { $lnum = $offset; @@ -307,8 +309,6 @@ class Feeds extends Handler_Protected { $expand_cdm = get_pref('CDM_EXPANDED'); - $reply['content'] = array(); - while ($line = $this->dbh->fetch_assoc($result)) { $headline_row = ''; @@ -787,9 +787,9 @@ class Feeds extends Handler_Protected { } if (!$offset && $message) { - $reply['content'] .= "
$message"; + $headline_row = "
$message"; - $reply['content'] .= "

"; + $headline_row .= "

"; $result = $this->dbh->query("SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds WHERE owner_uid = " . $_SESSION['uid']); @@ -797,7 +797,7 @@ class Feeds extends Handler_Protected { $last_updated = $this->dbh->fetch_result($result, 0, "last_updated"); $last_updated = make_local_datetime($last_updated, false); - $reply['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated); + $headline_row .= sprintf(__("Feeds last updated at %s"), $last_updated); $result = $this->dbh->query("SELECT COUNT(id) AS num_errors FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); @@ -805,14 +805,16 @@ class Feeds extends Handler_Protected { $num_errors = $this->dbh->fetch_result($result, 0, "num_errors"); if ($num_errors > 0) { - $reply['content'] .= "
"; - $reply['content'] .= "". + $headline_row .= "
"; + $headline_row .= "
". __('Some feeds have update errors (click for details)').""; } - $reply['content'] .= "

"; + $headline_row .= "

"; + + //array_push($reply['content'], array("id" => 0, "kind" => "status_message", "html" => $headline_row)); + array_push($reply['content'], array("id" => 0, 'kind' => 'status_message', 'html' => $headline_row)); } } else if (is_numeric($result) && $result == -1) { - $reply['content'] = ''; $reply['first_id_changed'] = true; }