X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Ffeeds.php;h=0a7b7a241b94247632e16f93621bf5e3cf863b9b;hb=5aa9c604943cbb93f4d401914dafeedfddb0007e;hp=47a6b56b87973356161d5129ebeda4020efcbb41;hpb=5d95676ecc665395bad96b3a8b2930715e5b947b;p=tt-rss.git diff --git a/classes/feeds.php b/classes/feeds.php index 47a6b56b..0a7b7a24 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -173,7 +173,7 @@ class Feeds extends Handler_Protected { $method_split = explode(":", $method); if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) { - $sth = $this->pdo->prepare("UPDATE ttrss_feeds + $sth = $this->pdo->prepare("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01' WHERE id = ?"); $sth->execute([$feed]); @@ -277,7 +277,6 @@ class Feeds extends Handler_Protected { $lnum = $offset; $num_unread = 0; if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info); - $expand_cdm = get_pref('CDM_EXPANDED'); if (is_object($result)) { @@ -346,7 +345,7 @@ class Feeds extends Handler_Protected { $score_pic = "images/" . get_score_pic($score); - $score_pic = ""; if ($score > 500) { @@ -363,9 +362,7 @@ class Feeds extends Handler_Protected { $entry_author = " — $entry_author"; } - $has_feed_icon = feeds::feedHasIcon($feed_id); - - if ($has_feed_icon) { + if (feeds::feedHasIcon($feed_id)) { $feed_icon_img = "\"\""; } else { $feed_icon_img = "\"\""; @@ -393,7 +390,7 @@ class Feeds extends Handler_Protected { $vf_catchup_link = "".__('mark feed as read').""; - $reply['content'] .= "
". + $reply['content'] .= "
". "
$feed_icon_img
". "". $line["feed_title"]." @@ -405,7 +402,7 @@ class Feeds extends Handler_Protected { $reply['content'] .= "
"; - $reply['content'] .= "
"; + $reply['content'] .= "
"; $reply['content'] .= ""; - $reply['content'] .= ""; + $reply['content'] .= "" . truncate_string($line["title"], 200); if (get_pref('SHOW_CONTENT_PREVIEW')) { - $reply['content'] .= "" . $line["content_preview"] . ""; + $reply['content'] .= "" . $line["content_preview"] . ""; } $reply['content'] .= ""; @@ -437,18 +434,18 @@ class Feeds extends Handler_Protected { if (@$line["feed_title"]) { $rgba = @$rgba_cache[$feed_id]; - $reply['content'] .= "". + $reply['content'] .= "". truncate_string($line["feed_title"],30).""; } } - $reply['content'] .= ""; + $reply['content'] .= ""; $reply['content'] .= "
$updated_fmt
"; - $reply['content'] .= "
"; + $reply['content'] .= "
"; $reply['content'] .= $score_pic; @@ -477,6 +474,8 @@ class Feeds extends Handler_Protected { $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) { @@ -487,7 +486,7 @@ class Feeds extends Handler_Protected { $feed_icon_src = Feeds::getFeedIcon($feed_id); $feed_icon_img = ""; - $reply['content'] .= "
". + $reply['content'] .= "
". "
$feed_icon_img
". "". $line["feed_title"]." $vf_catchup_link
"; @@ -495,12 +494,13 @@ class Feeds extends Handler_Protected { } } - $expanded_class = $expand_cdm ? "expanded" : "expandable"; + $content_encoded = htmlspecialchars($line["content"]); - $tmp_content = "
"; + $expanded_class = get_pref("CDM_EXPANDED") ? "expanded" : "expandable"; + $tmp_content = "
"; - $tmp_content .= "
"; + $tmp_content .= "
"; $tmp_content .= "
"; $tmp_content .= " + class=\"titleWrap hlMenuAttach $hlc_suffix\"> "; - - if (!$expand_cdm) - $content_hidden = "style=\"display : none\""; - else - $excerpt_hidden = "style=\"display : none\""; - - $tmp_content .= "" . $content_preview . ""; + $tmp_content .= " + "; $tmp_content .= ""; @@ -552,7 +545,7 @@ class Feeds extends Handler_Protected { if (@$line["feed_title"]) { $rgba = @$rgba_cache[$feed_id]; - $tmp_content .= "
+ $tmp_content .= "
". truncate_string($line["feed_title"],30)." @@ -562,7 +555,7 @@ class Feeds extends Handler_Protected { $tmp_content .= "$updated_fmt"; - $tmp_content .= "
"; + $tmp_content .= "
"; $tmp_content .= "$score_pic"; if (!get_pref("VFEED_GROUP_BY_FEED") && $line["feed_title"]) { @@ -570,13 +563,11 @@ class Feeds extends Handler_Protected { title=\"".htmlspecialchars($line["feed_title"])."\" onclick=\"viewfeed({feed:$feed_id})\">$feed_icon_img"; } - $tmp_content .= "
"; //scoreWrap + $tmp_content .= "
"; //score wrapper2 - $tmp_content .= "
"; //cdmHeader + $tmp_content .= "
"; //header - $tmp_content .= "
"; + $tmp_content .= "
"; $tmp_content .= "
"; if ($line['note']) { @@ -586,7 +577,8 @@ class Feeds extends Handler_Protected { if (!$line['lang']) $line['lang'] = 'en'; - $tmp_content .= "
"; + // this is filled from RROW data-content + $tmp_content .= "
"; if ($line["orig_feed_id"]) { @@ -614,15 +606,8 @@ class Feeds extends Handler_Protected { } } - $tmp_content .= ""; - $tmp_content .= ""; - $tmp_content .= htmlspecialchars($line["content"]); - $tmp_content .= ""; - $tmp_content .= ""; - - $tmp_content .= "
"; //cdmContentInner - - $tmp_content .= "
"; + $tmp_content .= "
"; //content-inner + $tmp_content .= "
"; $always_display_enclosures = $line["always_display_enclosures"]; $tmp_content .= Article::format_article_enclosures($id, $always_display_enclosures, @@ -630,7 +615,7 @@ class Feeds extends Handler_Protected { $tmp_content .= "
"; // cdmIntermediate - $tmp_content .= "
"; + $tmp_content .= "
"; foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) { $tmp_content .= $p->hook_article_left_button($line); @@ -654,13 +639,13 @@ class Feeds extends Handler_Protected { } else { $comments_url = htmlspecialchars($line["link"]); } - $entry_comments = "$num_comments ". _ngettext("comment", "comments", $num_comments).""; } else { if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "".__("comments").""; + $entry_comments = "".__("comments").""; } } @@ -675,7 +660,7 @@ class Feeds extends Handler_Protected { $tmp_content .= "
"; // buttons - $tmp_content .= "
"; // cdmFooter + $tmp_content .= "
"; // cdm footer $tmp_content .= "
"; // cdmContent $tmp_content .= "
"; // RROW.cdm @@ -1132,6 +1117,9 @@ class Feeds extends Handler_Protected { function update_debugger() { header("Content-type: text/html"); + Debug::set_enabled(true); + Debug::set_loglevel($_REQUEST["xdebug"]); + $feed_id = (int)$_REQUEST["feed_id"]; @$do_update = $_REQUEST["action"] == "do_update"; $csrf_token = $_REQUEST["csrf_token"]; @@ -1469,7 +1457,7 @@ class Feeds extends Handler_Protected { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) { $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass); } - + if (!$contents) { if (preg_match("/cloudflare\.com/", $fetch_last_error_content)) { $fetch_last_error .= " (feed behind Cloudflare)";