diff options
Diffstat (limited to 'classes')
| -rwxr-xr-x | classes/article.php | 9 | ||||
| -rwxr-xr-x | classes/feeds.php | 479 | ||||
| -rwxr-xr-x | classes/pluginhost.php | 2 |
3 files changed, 107 insertions, 383 deletions
diff --git a/classes/article.php b/classes/article.php index 6553bc67d..3ddf66d5c 100755 --- a/classes/article.php +++ b/classes/article.php @@ -27,6 +27,7 @@ class Article extends Handler_Protected { } } + /* function view() { $id = clean($_REQUEST["id"]); $cids = explode(",", clean($_REQUEST["cids"])); @@ -63,8 +64,9 @@ class Article extends Handler_Protected { } print json_encode($articles); - } + } */ + /* private function catchupArticleById($id, $cmode) { if ($cmode == 0) { @@ -86,6 +88,7 @@ class Article extends Handler_Protected { $feed_id = $this->getArticleFeed($id); CCache::update($feed_id, $_SESSION["uid"]); } + */ static function create_published_article($title, $url, $content, $labels_str, $owner_uid) { @@ -516,9 +519,9 @@ class Article extends Handler_Protected { } if (count($entries_inline) > 0) { - $rv .= "<hr clear='both'/>"; + //$rv .= "<hr clear='both'/>"; foreach ($entries_inline as $entry) { $rv .= $entry; }; - $rv .= "<hr clear='both'/>"; + $rv .= "<br clear='both'/>"; } $rv .= "<div class=\"attachments\" dojoType=\"dijit.form.DropDownButton\">". diff --git a/classes/feeds.php b/classes/feeds.php index 080d9e80c..6b499e65c 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -113,8 +113,7 @@ class Feeds extends Handler_Protected { } private function format_headlines_list($feed, $method, $view_mode, $limit, $cat_view, - $offset, $vgr_last_feed = false, - $override_order = false, $include_children = false, $check_first_id = false, + $offset, $override_order = false, $include_children = false, $check_first_id = false, $skip_first_id_check = false) { $disable_cache = false; @@ -122,9 +121,6 @@ class Feeds extends Handler_Protected { $reply = array(); $rgba_cache = array(); - - $timing_info = microtime(true); - $topmost_article_ids = array(); if (!$offset) $offset = 0; @@ -161,8 +157,6 @@ class Feeds extends Handler_Protected { $disable_cache = true; } - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info); - if (!$cat_view && is_numeric($feed) && $feed < PLUGIN_FEED_BASE_INDEX && $feed > LABEL_BASE_INDEX) { $handler = PluginHost::getInstance()->get_feed_handler( PluginHost::feed_to_pfeed_id($feed)); @@ -205,8 +199,6 @@ class Feeds extends Handler_Protected { $vfeed_group_enabled = get_pref("VFEED_GROUP_BY_FEED") && $feed != -6; - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info); - $result = $qfh_ret[0]; // this could be either a PDO query result or a -1 if first id changed $feed_title = $qfh_ret[1]; $feed_site_url = $qfh_ret[2]; @@ -216,8 +208,7 @@ class Feeds extends Handler_Protected { $highlight_words = $qfh_ret[5]; $reply['first_id'] = $qfh_ret[6]; $reply['search_query'] = [$search, $search_language]; - - $vgroup_last_feed = $vgr_last_feed; + $reply['vfeed_group_enabled'] = $vfeed_group_enabled; $reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url, $feed_title, @@ -230,42 +221,44 @@ class Feeds extends Handler_Protected { } } - $reply['content'] = ''; + $reply['content'] = []; $headlines_count = 0; - $lnum = $offset; - $num_unread = 0; - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info); - if (is_object($result)) { - - while ($line = $result->fetch()) { + while ($line = $result->fetch(PDO::FETCH_ASSOC)) { ++$headlines_count; - $line["content_preview"] = "— " . truncate_string(strip_tags($line["content"]), 250); - - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { - $line = $p->hook_query_headlines($line, 250, false); - } + if (!get_pref('SHOW_CONTENT_PREVIEW')) { + $line["content_preview"] = null; + } else { + $line["content_preview"] = "— " . truncate_string(strip_tags($line["content"]), 250); - if (get_pref('SHOW_CONTENT_PREVIEW')) { - $content_preview = $line["content_preview"]; - } + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line, 250, false); + } + } $id = $line["id"]; - $feed_id = $line["feed_id"]; - $label_cache = $line["label_cache"]; - $labels = false; + + // frontend doesn't expect pdo returning booleans as strings on mysql + if (DB_TYPE == "mysql") { + foreach (["unread", "marked", "published"] as $k) { + $line[$k] = $line[$k] === "1"; + } + } // normalize archived feed - if ($feed_id === null) { - $feed_id = 0; + if ($line['feed_id'] === null) { + $line['feed_id'] = 0; $line["feed_title"] = __("Archived articles"); } - $mouseover_attrs = "onmouseover='Article.mouseIn($id)' onmouseout='Article.mouseOut($id)'"; + $feed_id = $line["feed_id"]; + + $label_cache = $line["label_cache"]; + $labels = false; if ($label_cache) { $label_cache = json_decode($label_cache, true); @@ -284,361 +277,112 @@ class Feeds extends Handler_Protected { $labels_str .= Article::format_article_labels($labels); $labels_str .= "</span>"; + $line["labels"] = $labels_str; + if (count($topmost_article_ids) < 3) { array_push($topmost_article_ids, $id); } - $class = ""; - - if ($line["unread"]) { - $class .= " Unread"; - ++$num_unread; - } - - $class .= $line["marked"] ? " marked" : ""; - $marked_pic = "<i class=\"marked-pic marked-$id material-icons\" onclick='Headlines.toggleMark($id)'>star</i>"; - - $class .= $line["published"] ? " published" : ""; - $published_pic = "<i class=\"pub-pic pub-$id material-icons\" onclick='Headlines.togglePub($id)'>rss_feed</i>"; + if (!$line["feed_title"]) $line["feed_title"] = ""; - $updated_fmt = make_local_datetime($line["updated"], false, false, false, true); - $date_entered_fmt = T_sprintf("Imported at %s", - make_local_datetime($line["date_entered"], false)); - - $score = $line["score"]; + $line["buttons_left"] = ""; + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) { + $line["buttons_left"] .= $p->hook_article_left_button($line); + } - $score_pic = "<i class='material-icons icon-score' title='$score' - data-score='$score' onclick='Article.setScore($id, this)'>" . - get_score_pic($score) . "</i>"; - $score_class = get_score_class($score); + $line["buttons"] = ""; + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) { + $line["buttons"] .= $p->hook_article_button($line); + } - $entry_author = $line["author"]; - - if ($entry_author) { - $entry_author = " — $entry_author"; - } - - if (feeds::feedHasIcon($feed_id)) { - $feed_icon_img = "<img class=\"icon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">"; - } else { - $feed_icon_img = "<i class='icon-no-feed material-icons'>rss_feed</i>"; - } - - $entry_site_url = $line["site_url"]; - - //setting feed headline background color, needs to change text color based on dark/light - $fav_color = $line['favicon_avg_color']; + $line["content"] = sanitize($line["content"], + $line['hide_images'], false, $line["site_url"], $highlight_words, $line["id"]); - require_once "colors.php"; - - if ($fav_color && $fav_color != 'fail') { - if (!isset($rgba_cache[$feed_id])) { - $rgba_cache[$feed_id] = join(",", _color_unpack($fav_color)); - } - } - - if (!get_pref('COMBINED_DISPLAY_MODE')) { - - if ($vfeed_group_enabled) { - if ($feed_id != $vgroup_last_feed) { - - $vgroup_last_feed = $feed_id; - - $vf_catchup_link = "<a class='catchup' onclick='Feeds.catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>"; - - $reply['content'] .= "<div data-feed-id='$feed_id' class='feed-title'>". - "<div style='float : right'>$feed_icon_img</div>". - "<a class='title' href=\"#\" onclick=\"Feeds.open({feed:$feed_id})\">". - $line["feed_title"]."</a> - $vf_catchup_link</div>"; - } - } - - $reply['content'] .= "<div class='hl $class $score_class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>"; - - $reply['content'] .= "<div class='left'>"; - - $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\" - type=\"checkbox\" onclick=\"Headlines.onRowChecked(this)\" - class='rchk'>"; - - $reply['content'] .= "$marked_pic"; - $reply['content'] .= "$published_pic"; - - $reply['content'] .= "</div>"; - - $reply['content'] .= "<div onclick='return Headlines.click(event, $id)' - class=\"title\"><span data-article-id=\"$id\" class='hl-content hlMenuAttach'>"; - $reply['content'] .= "<a class=\"title\" - href=\"" . htmlspecialchars($line["link"]) . "\" - onclick=\"\">" . - truncate_string($line["title"], 200); - - if (get_pref('SHOW_CONTENT_PREVIEW')) { - $reply['content'] .= "<span class=\"preview\">" . $line["content_preview"] . "</span>"; - } - - $reply['content'] .= "</a></span>"; - - $reply['content'] .= $labels_str; - - $reply['content'] .= "</div>"; - - if (!$vfeed_group_enabled) { - if (@$line["feed_title"]) { - $rgba = @$rgba_cache[$feed_id]; - - $reply['content'] .= "<span class=\"feed\"><a style=\"background : rgba($rgba, 0.3)\" href=\"#\" onclick=\"Feeds.open({feed:$feed_id})\">". - truncate_string($line["feed_title"],30)."</a></span>"; - } - } - - - $reply['content'] .= "<span class=\"updated\">"; - - $reply['content'] .= "<div title='$date_entered_fmt'>$updated_fmt</div> - </span>"; - - $reply['content'] .= "<div class=\"right\">"; - - $reply['content'] .= $score_pic; - - if (!$vfeed_group_enabled) { - $reply['content'] .= "<span onclick=\"Feeds.open({feed:$feed_id})\" - style=\"cursor : pointer\" - title=\"".htmlspecialchars($line['feed_title'])."\"> - $feed_icon_img</span>"; - } - - $reply['content'] .= "</div>"; - $reply['content'] .= "</div>"; - - } else { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) { + $line = $p->hook_render_article_cdm($line); + } - if ($line["tag_cache"]) - $tags = explode(",", $line["tag_cache"]); - else - $tags = false; + $line['content'] = rewrite_cached_urls($line['content']); - $line["content"] = sanitize($line["content"], - $line['hide_images'], false, $entry_site_url, $highlight_words, $line["id"]); + if ($line['note']) + $line['note'] = Article::format_article_note($id, $line['note']); + else + $line['note'] = ""; - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) { - $line = $p->hook_render_article_cdm($line); - } - - $line['content'] = rewrite_cached_urls($line['content']); - - if ($vfeed_group_enabled && $line["feed_title"]) { - if ($feed_id != $vgroup_last_feed) { - - $vgroup_last_feed = $feed_id; - - $vf_catchup_link = "<a class='catchup' onclick='Feeds.catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>"; - - $feed_icon_src = Feeds::getFeedIcon($feed_id); - $feed_icon_img = "<img class=\"icon\" src=\"$feed_icon_src\">"; - - $reply['content'] .= "<div data-feed-id='$feed_id' class='feed-title'>". - "<div style=\"float : right\">$feed_icon_img</div>". - "<a href=\"#\" class='title' onclick=\"Feeds.open({feed:$feed_id})\">". - $line["feed_title"]."</a> $vf_catchup_link</div>"; - - } - } - - $content_encoded = htmlspecialchars($line["content"]); - - $expanded_class = get_pref("CDM_EXPANDED") ? "expanded" : "expandable"; - $tmp_content = "<div class=\"cdm $expanded_class $score_class $class\" - id=\"RROW-$id\" data-content=\"$content_encoded\" data-article-id='$id' data-orig-feed-id='$feed_id' $mouseover_attrs>"; - - $tmp_content .= "<div class=\"header\">"; - $tmp_content .= "<div class=\"left\">"; - - $tmp_content .= "<input dojoType=\"dijit.form.CheckBox\" - type=\"checkbox\" onclick=\"Headlines.onRowChecked(this)\" - class='rchk'>"; - - $tmp_content .= "$marked_pic"; - $tmp_content .= "$published_pic"; - - $tmp_content .= "</div>"; - - if ($highlight_words && count($highlight_words) > 0) { - foreach ($highlight_words as $word) { - $word = preg_quote($word, "/"); - - $line["title"] = preg_replace("/($word)/i", - "<span class=\"highlight\">$1</span>", $line["title"]); - } - } - - // data-article-id included for context menu - $tmp_content .= "<span - onclick=\"return Headlines.click(event, $id);\" - data-article-id=\"$id\" - class=\"titleWrap hlMenuAttach\"> - <a class=\"title\" - title=\"".htmlspecialchars($line["title"])."\" - target=\"_blank\" rel=\"noopener noreferrer\" href=\"". - htmlspecialchars($line["link"])."\">". - $line["title"] . - "</a> <span class=\"author\">$entry_author</span>"; - - $tmp_content .= $labels_str; - - if (!get_pref("CDM_EXPANDED")) { - $tmp_content .= "<span class='collapse'> - <i class=\"material-icons\" onclick=\"return Article.cdmUnsetActive(event)\" + if (!get_pref("CDM_EXPANDED")) { + $line["cdm_excerpt"] = "<span class='collapse'> + <i class='material-icons' onclick='return Article.cdmUnsetActive(event)' title=\"" . __("Collapse article") . "\">remove_circle</i></span>"; - if (get_pref('SHOW_CONTENT_PREVIEW')) { - $tmp_content .= "<span class='excerpt'>" . $line["content_preview"] . "</span>"; - } - } - - $tmp_content .= "</span>"; - - if (!$vfeed_group_enabled) { - if (@$line["feed_title"]) { - $rgba = @$rgba_cache[$feed_id]; - - $tmp_content .= "<div class=\"feed\"> - <a href=\"#\" style=\"background-color: rgba($rgba,0.3)\" - onclick=\"Feeds.open({feed:$feed_id})\">". - truncate_string($line["feed_title"],30)."</a> - </div>"; - } - } - - $tmp_content .= "<span class='updated' title='$date_entered_fmt'>$updated_fmt</span>"; - - $tmp_content .= "<div class='right'>"; - $tmp_content .= "$score_pic"; - - if (!get_pref("VFEED_GROUP_BY_FEED")) { - $tmp_content .= "<span style=\"cursor : pointer\" - title=\"".htmlspecialchars($line["feed_title"])."\" - onclick=\"Feeds.open({feed:$feed_id})\">$feed_icon_img</span>"; - } - $tmp_content .= "</div>"; //score wrapper2 - - $tmp_content .= "</div>"; //header - - $tmp_content .= "<div class=\"content\" onclick=\"return Headlines.click(event, $id, true);\">"; - - $tmp_content .= "<div id=\"POSTNOTE-$id\">"; - if ($line['note']) { - $tmp_content .= Article::format_article_note($id, $line['note']); - } - $tmp_content .= "</div>"; //POSTNOTE - - if (!$line['lang']) $line['lang'] = 'en'; - - // this is filled from RROW data-content - $tmp_content .= "<div class=\"content-inner\" lang=\"".$line['lang']."\"> - <img src='images/indicator_white.gif'> - </div>"; - $tmp_content .= "<div class=\"intermediate\">"; + if (get_pref('SHOW_CONTENT_PREVIEW')) { + $line["cdm_excerpt"] .= "<span class='excerpt'>" . $line["content_preview"] . "</span>"; + } + } - if ($line["orig_feed_id"]) { + $line["enclosures"] = Article::format_article_enclosures($id, $line["always_display_enclosures"], + $line["content"], $line["hide_images"]); - $ofgh = $this->pdo->prepare("SELECT * FROM ttrss_archived_feeds - WHERE id = ? AND owner_uid = ?"); - $ofgh->execute([$line["orig_feed_id"], $_SESSION['uid']]); + if ($line["orig_feed_id"]) { - if ($tmp_line = $ofgh->fetch()) { + $ofgh = $this->pdo->prepare("SELECT * FROM ttrss_archived_feeds + WHERE id = ? AND owner_uid = ?"); + $ofgh->execute([$line["orig_feed_id"], $_SESSION['uid']]); - $tmp_content .= "<div clear='both'>"; - $tmp_content .= __("Originally from:"); + if ($tmp_line = $ofgh->fetch()) { + $line["orig_feed"] = [ $tmp_line["title"], $tmp_line["site_url"], $tmp_line["feed_url"] ]; + } + } - $tmp_content .= " "; + $line["updated_long"] = make_local_datetime($line["updated"],true); + $line["updated"] = make_local_datetime($line["updated"], false, false, false, true); - $tmp_content .= "<a target='_blank' rel='noopener noreferrer' - href=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . - $tmp_line['title'] . "</a>"; - $tmp_content .= " "; - - $tmp_content .= "<a target='_blank' rel='noopener noreferrer' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>"; - - $tmp_content .= "</div>"; - } - } - - - $always_display_enclosures = $line["always_display_enclosures"]; - $tmp_content .= Article::format_article_enclosures($id, $always_display_enclosures, - $line["content"], $line["hide_images"]); - - $tmp_content .= "</div>"; // cdmIntermediate - - $tmp_content .= "<div class=\"footer\" onclick=\"event.stopPropagation()\">"; - - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) { - $tmp_content .= $p->hook_article_left_button($line); - } - - $tags_str = Article::format_tags_string($tags, $id); + $line['imported'] = T_sprintf("Imported at %s", + make_local_datetime($line["date_entered"], false)); - $tmp_content .= "<div class='left'>"; + $score = $line["score"]; - $tmp_content .= "<i class='material-icons'>label_outline</i> - <span id=\"ATSTR-$id\">$tags_str</span> - <a title=\"".__('Edit tags for this article')."\" - href=\"#\" onclick=\"Article.editTags($id)\">(+)</a>"; + $line["score_pic"] = get_score_pic($score); + $line["score_class"] = get_score_class($score); - $num_comments = (int) $line["num_comments"]; - $entry_comments = ""; + if ($line["tag_cache"]) + $tags = explode(",", $line["tag_cache"]); + else + $tags = false; - if ($num_comments > 0) { - if ($line["comments"]) { - $comments_url = htmlspecialchars($line["comments"]); - } else { - $comments_url = htmlspecialchars($line["link"]); - } - $entry_comments = "<a class=\"comments\" - target='_blank' rel='noopener noreferrer' href=\"$comments_url\">$num_comments ". - _ngettext("comment", "comments", $num_comments)."</a>"; + $line["tags_str"] = Article::format_tags_string($tags, $id); - } else { - if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "<a class=\"comments\" target='_blank' rel='noopener noreferrer' href=\"".htmlspecialchars($line["comments"])."\">".__("comments")."</a>"; - } - } + if (feeds::feedHasIcon($feed_id)) { + $line['feed_icon'] = "<img class=\"icon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">"; + } else { + $line['feed_icon'] = "<i class='icon-no-feed material-icons'>rss_feed</i>"; + } - if ($entry_comments) $tmp_content .= " ($entry_comments)"; + //setting feed headline background color, needs to change text color based on dark/light + $fav_color = $line['favicon_avg_color']; - $tmp_content .= "</div>"; - $tmp_content .= "<div class='right'>"; + require_once "colors.php"; - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) { - $tmp_content .= $p->hook_article_button($line); + if ($fav_color && $fav_color != 'fail') { + if (!isset($rgba_cache[$feed_id])) { + $rgba_cache[$feed_id] = join(",", _color_unpack($fav_color)) . ",0.3"; } - $tmp_content .= "</div>"; // buttons + $line['favicon_avg_color_rgba'] = $rgba_cache[$feed_id]; + } - $tmp_content .= "</div>"; // cdm footer - $tmp_content .= "</div>"; // cdmContent - $tmp_content .= "</div>"; // RROW.cdm + /* we don't need those */ - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FORMAT_ARTICLE_CDM) as $p) { - $tmp_content = $p->hook_format_article_cdm($tmp_content, $line); - } - - $reply['content'] .= $tmp_content; - } + foreach (["date_entered", "guid", "last_published", "last_marked", "tag_cache", "favicon_avg_color", "uuid", "label_cache"] as $k) + unset($line[$k]); - ++$lnum; + array_push($reply['content'], $line); } } - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PE", $timing_info); - if (!$headlines_count) { - if (!is_numeric($result)) { + if (is_object($result)) { switch ($view_mode) { case "unread": @@ -692,10 +436,7 @@ class Feeds extends Handler_Protected { } } - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H2", $timing_info); - - return array($topmost_article_ids, $headlines_count, $feed, $disable_cache, - $vgroup_last_feed, $reply); + return array($topmost_article_ids, $headlines_count, $feed, $disable_cache, $reply); } function catchupAll() { @@ -707,12 +448,8 @@ class Feeds extends Handler_Protected { } function view() { - $timing_info = microtime(true); - $reply = array(); - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("0", $timing_info); - $feed = $_REQUEST["feed"]; $method = $_REQUEST["m"]; $view_mode = $_REQUEST["view_mode"]; @@ -720,7 +457,6 @@ class Feeds extends Handler_Protected { @$cat_view = $_REQUEST["cat"] == "true"; @$next_unread_feed = $_REQUEST["nuf"]; @$offset = $_REQUEST["skip"]; - @$vgroup_last_feed = $_REQUEST["vgrlf"]; $order_by = $_REQUEST["order_by"]; $check_first_id = $_REQUEST["fid"]; @@ -786,7 +522,7 @@ class Feeds extends Handler_Protected { $sth->execute([$feed, $_SESSION['uid']]); } - $reply['headlines'] = array(); + $reply['headlines'] = []; $override_order = false; $skip_first_id_check = false; @@ -804,22 +540,13 @@ class Feeds extends Handler_Protected { break; } - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("04", $timing_info); - $ret = $this->format_headlines_list($feed, $method, $view_mode, $limit, $cat_view, $offset, - $vgroup_last_feed, $override_order, true, $check_first_id, $skip_first_id_check); + $override_order, true, $check_first_id, $skip_first_id_check); - //$topmost_article_ids = $ret[0]; $headlines_count = $ret[1]; - /* $returned_feed = $ret[2]; */ $disable_cache = $ret[3]; - $vgroup_last_feed = $ret[4]; - - //$reply['headlines']['content'] =& $ret[5]['content']; - //$reply['headlines']['toolbar'] =& $ret[5]['toolbar']; - - $reply['headlines'] = $ret[5]; + $reply['headlines'] = $ret[4]; if (!$next_unread_feed) $reply['headlines']['id'] = $feed; @@ -828,14 +555,10 @@ class Feeds extends Handler_Protected { $reply['headlines']['is_cat'] = (bool) $cat_view; - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("05", $timing_info); - - $reply['headlines-info'] = array("count" => (int) $headlines_count, - "vgroup_last_feed" => $vgroup_last_feed, - "disable_cache" => (bool) $disable_cache); - - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("30", $timing_info); + $reply['headlines-info'] = ["count" => (int) $headlines_count, + "disable_cache" => (bool) $disable_cache]; + // this is parsed by handleRpcJson() on first viewfeed() to set cdm expanded, etc $reply['runtime-info'] = make_runtime_info(); print json_encode($reply); @@ -878,7 +601,6 @@ class Feeds extends Handler_Protected { $reply['headlines']['content'] .= "</span></p>"; $reply['headlines-info'] = array("count" => 0, - "vgroup_last_feed" => '', "unread" => 0, "disable_cache" => true); @@ -895,7 +617,6 @@ class Feeds extends Handler_Protected { $reply['headlines']['content'] = "<div class='whiteBox'>". $error . "</div>"; $reply['headlines-info'] = array("count" => 0, - "vgroup_last_feed" => '', "unread" => 0, "disable_cache" => true); diff --git a/classes/pluginhost.php b/classes/pluginhost.php index 1ea6d8a5b..96b1ce499 100755 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -52,7 +52,7 @@ class PluginHost { const HOOK_MAIN_TOOLBAR_BUTTON = 32; const HOOK_ENCLOSURE_ENTRY = 33; const HOOK_FORMAT_ARTICLE = 34; - const HOOK_FORMAT_ARTICLE_CDM = 35; + const HOOK_FORMAT_ARTICLE_CDM = 35; /* RIP */ const HOOK_FEED_BASIC_INFO = 36; const HOOK_SEND_LOCAL_FILE = 37; const HOOK_UNSUBSCRIBE_FEED = 38; |