class Feeds extends Handler_Protected {
- function csrf_ignore($method) {
+ private $params;
+
+ function csrf_ignore($method) {
$csrf_ignored = array("index", "feedbrowser", "quickaddfeed", "search");
return array_search($method, $csrf_ignored) !== false;
private function format_headline_subtoolbar($feed_site_url, $feed_title,
$feed_id, $is_cat, $search,
- $search_mode, $view_mode, $error, $feed_last_updated) {
-
- $page_prev_link = "viewFeedGoPage(-1)";
- $page_next_link = "viewFeedGoPage(1)";
- $page_first_link = "viewFeedGoPage(0)";
+ $error, $feed_last_updated) {
- $catchup_page_link = "catchupPage()";
- $catchup_feed_link = "catchupCurrentFeed()";
$catchup_sel_link = "catchupSelection()";
$archive_sel_link = "archiveSelection()";
if ($is_cat) $cat_q = "&is_cat=$is_cat";
if ($search) {
- $search_q = "&q=$search&smode=$search_mode";
+ $search_q = "&q=$search";
} else {
$search_q = "";
}
+ $reply .= "<span class=\"holder\">";
+
$rss_link = htmlspecialchars(get_self_url_prefix() .
"/public.php?op=rss&id=$feed_id$cat_q$search_q");
$error_class = $error ? "error" : "";
- $reply .= "<span class='r'>";
- $reply .= "<span id='selected_prompt'></span>";
+ $reply .= "<span class='r'>
+ <a href=\"#\"
+ title=\"".__("View as RSS feed")."\"
+ onclick=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
+ <img class=\"noborder\" src=\"images/pub_set.png\"></a>";
+
+
+# $reply .= "<span>";
$reply .= "<span id='feed_title' class='$error_class'>";
if ($feed_site_url) {
$target = "target=\"_blank\"";
$reply .= "<a title=\"$last_updated\" $target href=\"$feed_site_url\">".
- truncate_string($feed_title,30)."</a>";
+ truncate_string($feed_title, 30)."</a>";
if ($error) {
$error = htmlspecialchars($error);
- $reply .= " <img title=\"$error\" src='images/error.png' alt='error' class=\"noborder\" style=\"vertical-align : middle\">";
+ $reply .= " <img title=\"$error\" src='images/error.png' alt='error' class=\"noborder\">";
}
} else {
$reply .= "</span>";
- $reply .= "
- <a href=\"#\"
- title=\"".__("View as RSS feed")."\"
- onclick=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
- <img class=\"noborder\" style=\"vertical-align : middle\" src=\"images/pub_set.png\"></a>";
-
$reply .= "</span>";
+# $reply .= "</span>";
+
// left part
- $reply .= __('Select:')."
+ $reply .= "<span class=\"main\">";
+ $reply .= "<span id='selected_prompt'></span>";
+
+ /*$reply .= "<span class=\"sel_links\">
<a href=\"#\" onclick=\"$sel_all_link\">".__('All')."</a>,
<a href=\"#\" onclick=\"$sel_unread_link\">".__('Unread')."</a>,
<a href=\"#\" onclick=\"$sel_inv_link\">".__('Invert')."</a>,
<a href=\"#\" onclick=\"$sel_none_link\">".__('None')."</a></li>";
- $reply .= " ";
+ $reply .= "</span> "; */
$reply .= "<select dojoType=\"dijit.form.Select\"
onchange=\"headlineActionsChange(this)\">";
- $reply .= "<option value=\"false\">".__('More...')."</option>";
+
+ $reply .= "<option value=\"0\" disabled='1'>".__('Select...')."</option>";
+
+ $reply .= "<option value=\"$sel_all_link\">".__('All')."</option>";
+ $reply .= "<option value=\"$sel_unread_link\">".__('Unread')."</option>";
+ $reply .= "<option value=\"$sel_inv_link\">".__('Invert')."</option>";
+ $reply .= "<option value=\"$sel_none_link\">".__('None')."</option>";
$reply .= "<option value=\"0\" disabled=\"1\">".__('Selection toggle:')."</option>";
$reply .= "</select>";
- //$reply .= "</div>";
-
//$reply .= "</h2";
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINE_TOOLBAR_BUTTON) as $p) {
- echo $p->hook_headline_toolbar_button($feed_id, $is_cat);
+ $reply .= $p->hook_headline_toolbar_button($feed_id, $is_cat);
}
+ $reply .= "</span></span>";
+
return $reply;
}
private function format_headlines_list($feed, $method, $view_mode, $limit, $cat_view,
- $next_unread_feed, $offset, $vgr_last_feed = false,
- $override_order = false, $include_children = false) {
-
- if (isset($_REQUEST["DevForceUpdate"]))
- header("Content-Type: text/plain");
+ $offset, $vgr_last_feed = false,
+ $override_order = false, $include_children = false, $check_first_id = false,
+ $skip_first_id_check = false) {
$disable_cache = false;
if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) {
// Update the feed if required with some basic flood control
- $result = $this->dbh->query(
- "SELECT cache_images,".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
- FROM ttrss_feeds WHERE id = '$feed'");
+ $any_needs_curl = false;
+
+ if (ini_get("open_basedir")) {
+ $pluginhost = PluginHost::getInstance();
+ foreach ($pluginhost->get_plugins() as $plugin) {
+ $flags = $plugin->flags();
+
+ if (isset($flags["needs_curl"]) && $flags["needs_curl"]) {
+ $any_needs_curl = true;
+ break;
+ }
+ }
+ }
+
+ //if ($_REQUEST["debug"]) print "<!-- any_needs_curl: $any_needs_curl -->";
+
+ if (!$any_needs_curl) {
+
+ $result = $this->dbh->query(
+ "SELECT cache_images," . SUBSTRING_FOR_DATE . "(last_updated,1,19) AS last_updated
+ FROM ttrss_feeds WHERE id = '$feed'");
if ($this->dbh->num_rows($result) != 0) {
$last_updated = strtotime($this->dbh->fetch_result($result, 0, "last_updated"));
$cache_images = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "cache_images"));
- if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) {
+ if (!$cache_images && time() - $last_updated > 120) {
include "rssfuncs.php";
- update_rss_feed($feed, true, true);
+ update_rss_feed($feed, true);
} else {
$this->dbh->query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01'
- WHERE id = '$feed'");
+ WHERE id = '$feed'");
}
}
+ } else {
+ $this->dbh->query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01'
+ WHERE id = '$feed'");
+ }
}
if ($method_split[0] == "MarkAllReadGR") {
}
@$search = $this->dbh->escape_string($_REQUEST["query"]);
+ @$search_language = $this->dbh->escape_string($_REQUEST["search_language"]); // PGSQL only
if ($search) {
$disable_cache = true;
}
- @$search_mode = $this->dbh->escape_string($_REQUEST["search_mode"]);
-
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
-// error_log("format_headlines_list: [" . $feed . "] method [" . $method . "]");
- if($search_mode == '' && $method != '' ){
- $search_mode = $method;
- }
-// error_log("search_mode: " . $search_mode);
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));
- // function queryFeedHeadlines($feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) {
-
if ($handler) {
$options = array(
"limit" => $limit,
"view_mode" => $view_mode,
"cat_view" => $cat_view,
"search" => $search,
- "search_mode" => $search_mode,
"override_order" => $override_order,
"offset" => $offset,
"owner_uid" => $_SESSION["uid"],
}
} else {
- $qfh_ret = queryFeedHeadlines($feed, $limit, $view_mode, $cat_view,
- $search, $search_mode, $override_order, $offset, 0,
- false, 0, $include_children);
+ /*$qfh_ret = queryFeedHeadlines($feed, $limit, $view_mode, $cat_view,
+ $search, false, $override_order, $offset, 0,
+ false, 0, $include_children, $topid);*/
+
+ //function queryFeedHeadlines($feed, $limit,
+ // $view_mode, $cat_view, $search, $search_mode,
+ // $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false,
+ // $ignore_vfeed_group = false, $override_strategy = false, $override_vfeed = false, $start_ts = false, $check_top_id = false) {
+
+ $params = array(
+ "feed" => $feed,
+ "limit" => $limit,
+ "view_mode" => $view_mode,
+ "cat_view" => $cat_view,
+ "search" => $search,
+ "search_language" => $search_language,
+ "override_order" => $override_order,
+ "offset" => $offset,
+ "include_children" => $include_children,
+ "check_first_id" => $check_first_id,
+ "skip_first_id_check" => $skip_first_id_check
+ );
+
+ $qfh_ret = queryFeedHeadlines($params);
}
+ $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];
$last_updated = strpos($qfh_ret[4], '1970-') === FALSE ?
make_local_datetime($qfh_ret[4], false) : __("Never");
$highlight_words = $qfh_ret[5];
+ $reply['first_id'] = $qfh_ret[6];
+ $reply['search_query'] = [$search, $search_language];
$vgroup_last_feed = $vgr_last_feed;
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
$feed_title,
- $feed, $cat_view, $search, $search_mode, $view_mode,
+ $feed, $cat_view, $search,
$last_error, $last_updated);
- $headlines_count = $this->dbh->num_rows($result);
-
- /* if (get_pref('COMBINED_DISPLAY_MODE')) {
- $button_plugins = array();
- foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
- $pclass = "button_" . trim($p);
+ $headlines_count = is_numeric($result) ? 0 : $this->dbh->num_rows($result);
- if (class_exists($pclass)) {
- $plugin = new $pclass();
- array_push($button_plugins, $plugin);
- }
+ if ($offset == 0) {
+ foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINES_BEFORE) as $p) {
+ $reply['content'] .= $p->hook_headlines_before($feed, $cat_view, $qfh_ret);
}
- } */
+ }
+
+ $reply['content'] = '';
- if ($this->dbh->num_rows($result) > 0) {
+ if ($headlines_count > 0) {
$lnum = $offset;
$num_unread = 0;
$cur_feed_title = '';
- $fresh_intl = get_pref("FRESH_ARTICLE_MAX_AGE") * 60 * 60;
-
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info);
$expand_cdm = get_pref('CDM_EXPANDED');
while ($line = $this->dbh->fetch_assoc($result)) {
- $line["content_preview"] = "— " . truncate_string(strip_tags($line["content_preview"]), 250);
+
+ $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 (!is_array($labels)) $labels = get_article_labels($id);
$labels_str = "<span class=\"HLLCTR-$id\">";
- $labels_str .= format_article_labels($labels, $id);
+ $labels_str .= format_article_labels($labels);
$labels_str .= "</span>";
if (count($topmost_article_ids) < 3) {
alt=\"Publish article\" onclick='togglePub($id)'>";
}
-# $content_link = "<a target=\"_blank\" href=\"".$line["link"]."\">" .
+# $content_link = "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"".$line["link"]."\">" .
# $line["title"] . "</a>";
# $content_link = "<a
# $content_link = "<a href=\"javascript:viewContentUrl('".$line["link"]."');\">" .
# $line["title"] . "</a>";
- $updated_fmt = make_local_datetime($line["updated"], false);
+ $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));
if (!get_pref('COMBINED_DISPLAY_MODE')) {
- if (get_pref('VFEED_GROUP_BY_FEED')) {
+ if ($vfeed_group_enabled) {
if ($feed_id != $vgroup_last_feed && $line["feed_title"]) {
$cur_feed_title = $line["feed_title"];
$cur_feed_title = htmlspecialchars($cur_feed_title);
- $vf_catchup_link = "(<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('Mark as read')."</a>)";
+ $vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
+
+ $reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
+ "<div style='float : right'>$feed_icon_img</div>".
+ "<a class='title' href=\"#\" onclick=\"viewfeed({feed:$feed_id})\">".
+ $line["feed_title"]."</a>
+ $vf_catchup_link</div>";
- $reply['content'] .= "<div class='cdmFeedTitle'>".
- "<div style=\"float : right\">$feed_icon_img</div>".
- "<a class='title' href=\"#\" onclick=\"viewfeed($feed_id)\">".
- $line["feed_title"]."</a> $vf_catchup_link</div>";
}
}
$mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
onmouseout='postMouseOut($id)'";
- $reply['content'] .= "<div class='hl $class' id='RROW-$id' $mouseover_attrs>";
+ $reply['content'] .= "<div class='hl hlMenuAttach $class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
$reply['content'] .= "<div class='hlLeft'>";
$reply['content'] .= "</div>";
- $reply['content'] .= "<span class=\"hlUpdated\">";
-
- if (!get_pref('VFEED_GROUP_BY_FEED')) {
+ if (!$vfeed_group_enabled) {
if (@$line["feed_title"]) {
$rgba = @$rgba_cache[$feed_id];
- $reply['content'] .= "<a class=\"hlFeed\" style=\"background : rgba($rgba, 0.3)\" href=\"#\" onclick=\"viewfeed($feed_id)\">".
- truncate_string($line["feed_title"],30)."</a>";
+ $reply['content'] .= "<span class=\"hlFeed\"><a style=\"background : rgba($rgba, 0.3)\" href=\"#\" onclick=\"viewfeed({feed:$feed_id})\">".
+ truncate_string($line["feed_title"],30)."</a></span>";
}
}
+
+ $reply['content'] .= "<span class=\"hlUpdated\">";
+
$reply['content'] .= "<div title='$date_entered_fmt'>$updated_fmt</div>
</span>";
$reply['content'] .= $score_pic;
- if ($line["feed_title"] && !get_pref('VFEED_GROUP_BY_FEED')) {
+ if ($line["feed_title"] && !$vfeed_group_enabled) {
- $reply['content'] .= "<span onclick=\"viewfeed($feed_id)\"
+ $reply['content'] .= "<span onclick=\"viewfeed({feed:$feed_id})\"
style=\"cursor : pointer\"
title=\"".htmlspecialchars($line['feed_title'])."\">
- $feed_icon_img<span>";
+ $feed_icon_img</span>";
}
$reply['content'] .= "</div>";
$line = $p->hook_render_article_cdm($line);
}
- if (get_pref('VFEED_GROUP_BY_FEED') && $line["feed_title"]) {
+ if ($vfeed_group_enabled && $line["feed_title"]) {
if ($feed_id != $vgroup_last_feed) {
$cur_feed_title = $line["feed_title"];
$cur_feed_title = htmlspecialchars($cur_feed_title);
- $vf_catchup_link = "(<a class='catchup' onclick='javascript:catchupFeedInGroup($feed_id);' href='#'>".__('mark as read')."</a>)";
+ $vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
$has_feed_icon = feed_has_icon($feed_id);
//$feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\" alt=\"\">";
}
- $reply['content'] .= "<div class='cdmFeedTitle'>".
+ $reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
"<div style=\"float : right\">$feed_icon_img</div>".
- "<a href=\"#\" class='title' onclick=\"viewfeed($feed_id)\">".
+ "<a href=\"#\" class='title' onclick=\"viewfeed({feed:$feed_id})\">".
$line["feed_title"]."</a> $vf_catchup_link</div>";
+
}
}
$expanded_class = $expand_cdm ? "expanded" : "expandable";
$reply['content'] .= "<div class=\"cdm $hlc_suffix $expanded_class $class\"
- id=\"RROW-$id\" $mouseover_attrs>";
+ id=\"RROW-$id\" data-article-id='$id' data-orig-feed-id='$feed_id' $mouseover_attrs>";
- $reply['content'] .= "<div class=\"cdmHeader\" style=\"$row_background\">";
+ $reply['content'] .= "<div class=\"cdmHeader\">";
$reply['content'] .= "<div style=\"vertical-align : middle\">";
$reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
}
}
+ // data-article-id included for context menu
$reply['content'] .= "<span id=\"RTITLE-$id\"
onclick=\"return cdmClicked(event, $id);\"
- class=\"titleWrap $hlc_suffix\">
+ data-article-id=\"$id\"
+ class=\"titleWrap hlMenuAttach $hlc_suffix\">
<a class=\"title $hlc_suffix\"
- target=\"_blank\" href=\"".
+ title=\"".htmlspecialchars($line["title"])."\"
+ target=\"_blank\" rel=\"noopener noreferrer\" href=\"".
htmlspecialchars($line["link"])."\">".
$line["title"] .
"</a> <span class=\"author\">$entry_author</span>";
$reply['content'] .= "</span>";
- if (!get_pref('VFEED_GROUP_BY_FEED')) {
+ if (!$vfeed_group_enabled) {
if (@$line["feed_title"]) {
$rgba = @$rgba_cache[$feed_id];
$reply['content'] .= "<div class=\"hlFeed\">
<a href=\"#\" style=\"background-color: rgba($rgba,0.3)\"
- onclick=\"viewfeed($feed_id)\">".
+ onclick=\"viewfeed({feed:$feed_id})\">".
truncate_string($line["feed_title"],30)."</a>
</div>";
}
if (!get_pref("VFEED_GROUP_BY_FEED") && $line["feed_title"]) {
$reply['content'] .= "<span style=\"cursor : pointer\"
title=\"".htmlspecialchars($line["feed_title"])."\"
- onclick=\"viewfeed($feed_id)\">$feed_icon_img</span>";
+ onclick=\"viewfeed({feed:$feed_id})\">$feed_icon_img</span>";
}
$reply['content'] .= "</div>";
$reply['content'] .= "</div>";
$reply['content'] .= "<div class=\"cdmContent\" $content_hidden
- onclick=\"return cdmClicked(event, $id);\"
+ onclick=\"return cdmClicked(event, $id, true);\"
id=\"CICD-$id\">";
$reply['content'] .= "<div id=\"POSTNOTE-$id\">";
if ($line["orig_feed_id"]) {
$tmp_result = $this->dbh->query("SELECT * FROM ttrss_archived_feeds
- WHERE id = ".$line["orig_feed_id"]);
+ WHERE id = ".$line["orig_feed_id"] . " AND owner_uid = " . $_SESSION["uid"]);
if ($this->dbh->num_rows($tmp_result) != 0) {
$tmp_line = $this->dbh->fetch_assoc($tmp_result);
- $reply['content'] .= "<a target='_blank'
+ $reply['content'] .= "<a target='_blank' rel='noopener noreferrer'
href=' " . htmlspecialchars($tmp_line['site_url']) . "'>" .
$tmp_line['title'] . "</a>";
$reply['content'] .= " ";
- $reply['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
+ $reply['content'] .= "<a target='_blank' rel='noopener noreferrer' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
$reply['content'] .= "<img title='".__('Feed URL')."'class='tinyFeedIcon' src='images/pub_unset.png'></a>";
$reply['content'] .= "</div>";
$reply['content'] .= "<span id=\"CWRAP-$id\">";
-// if (!$expand_cdm) {
- $reply['content'] .= "<span id=\"CENCW-$id\" style=\"display : none\">";
- $reply['content'] .= htmlspecialchars($line["content"]);
- $reply['content'] .= "</span.";
-
-// } else {
-// $reply['content'] .= $line["content"];
-// }
+ $reply['content'] .= "<span id=\"CENCW-$id\" class=\"cencw\" style=\"display : none\">";
+ $reply['content'] .= htmlspecialchars($line["content"]);
+ $reply['content'] .= "</span>";
$reply['content'] .= "</span>";
- $always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
+ $reply['content'] .= "</div>";
+
+ $reply['content'] .= "<div class=\"cdmIntermediate\">";
+ $always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
$reply['content'] .= format_article_enclosures($id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
$reply['content'] .= "</div>";
- $reply['content'] .= "<div class=\"cdmFooter\">";
+ $reply['content'] .= "<div class=\"cdmFooter\" onclick=\"cdmFooterClick(event)\">";
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
$reply['content'] .= $p->hook_article_left_button($line);
$tags_str = format_tags_string($tags, $id);
+ $reply['content'] .= "<span class='left'>";
+
$reply['content'] .= "<img src='images/tag.png' alt='Tags' title='Tags'>
<span id=\"ATSTR-$id\">$tags_str</span>
<a title=\"".__('Edit tags for this article')."\"
href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>";
- $num_comments = $line["num_comments"];
+ $num_comments = (int) $line["num_comments"];
$entry_comments = "";
if ($num_comments > 0) {
$comments_url = htmlspecialchars($line["link"]);
}
$entry_comments = "<a class=\"postComments\"
- target='_blank' href=\"$comments_url\">$num_comments ".
+ target='_blank' rel='noopener noreferrer' href=\"$comments_url\">$num_comments ".
_ngettext("comment", "comments", $num_comments)."</a>";
} else {
if ($line["comments"] && $line["link"] != $line["comments"]) {
- $entry_comments = "<a class=\"postComments\" target='_blank' href=\"".htmlspecialchars($line["comments"])."\">".__("comments")."</a>";
+ $entry_comments = "<a class=\"postComments\" target='_blank' rel='noopener noreferrer' href=\"".htmlspecialchars($line["comments"])."\">".__("comments")."</a>";
}
}
if ($entry_comments) $reply['content'] .= " ($entry_comments)";
- $reply['content'] .= "<div style=\"float : right\">";
+ $reply['content'] .= "</span>";
+ $reply['content'] .= "<div>";
// $reply['content'] .= "$marked_pic";
// $reply['content'] .= "$published_pic";
$reply['content'] .= "</div>";
$reply['content'] .= "</div>";
- $reply['content'] .= "</div><hr/>";
+ $reply['content'] .= "</div>";
$reply['content'] .= "</div>";
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PE", $timing_info);
- } else {
+ } else if (!is_numeric($result)) {
$message = "";
switch ($view_mode) {
}
if (!$offset && $message) {
- $reply['content'] .= "<div class='whiteBox'>$message";
+ $reply['content'] = "<div class='whiteBox'>$message";
$reply['content'] .= "<p><span class=\"insensitive\">";
__('Some feeds have update errors (click for details)')."</a>";
}
$reply['content'] .= "</span></p></div>";
+
}
+ } else if (is_numeric($result) && $result == -1) {
+ $reply['first_id_changed'] = true;
}
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H2", $timing_info);
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("0", $timing_info);
- $omode = $this->dbh->escape_string($_REQUEST["omode"]);
-
$feed = $this->dbh->escape_string($_REQUEST["feed"]);
$method = $this->dbh->escape_string($_REQUEST["m"]);
$view_mode = $this->dbh->escape_string($_REQUEST["view_mode"]);
@$offset = $this->dbh->escape_string($_REQUEST["skip"]);
@$vgroup_last_feed = $this->dbh->escape_string($_REQUEST["vgrlf"]);
$order_by = $this->dbh->escape_string($_REQUEST["order_by"]);
+ $check_first_id = $this->dbh->escape_string($_REQUEST["fid"]);
if (is_numeric($feed)) $feed = (int) $feed;
$reply['headlines'] = array();
- if (!$next_unread_feed)
- $reply['headlines']['id'] = $feed;
- else
- $reply['headlines']['id'] = $next_unread_feed;
-
- $reply['headlines']['is_cat'] = (bool) $cat_view;
-
$override_order = false;
+ $skip_first_id_check = false;
switch ($order_by) {
case "title":
break;
case "date_reverse":
$override_order = "score DESC, date_entered, updated";
+ $skip_first_id_check = true;
break;
case "feed_dates":
$override_order = "updated DESC";
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("04", $timing_info);
$ret = $this->format_headlines_list($feed, $method,
- $view_mode, $limit, $cat_view, $next_unread_feed, $offset,
- $vgroup_last_feed, $override_order, true);
+ $view_mode, $limit, $cat_view, $offset,
+ $vgroup_last_feed, $override_order, true, $check_first_id, $skip_first_id_check);
//$topmost_article_ids = $ret[0];
$headlines_count = $ret[1];
- $returned_feed = $ret[2];
+ /* $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']['content'] =& $ret[5]['content'];
+ //$reply['headlines']['toolbar'] =& $ret[5]['toolbar'];
+
+ $reply['headlines'] = $ret[5];
+
+ if (!$next_unread_feed)
+ $reply['headlines']['id'] = $feed;
+ else
+ $reply['headlines']['id'] = $next_unread_feed;
+
+ $reply['headlines']['is_cat'] = (bool) $cat_view;
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("05", $timing_info);
$reply['headlines']['is_cat'] = false;
$reply['headlines']['toolbar'] = '';
+
$reply['headlines']['content'] = "<div class='whiteBox'>".__('No feed selected.');
$reply['headlines']['content'] .= "<p><span class=\"insensitive\">";
private function generate_error_feed($error) {
$reply = array();
- $reply['headlines']['id'] = -6;
+ $reply['headlines']['id'] = -7;
$reply['headlines']['is_cat'] = false;
$reply['headlines']['toolbar'] = '';
}
function quickAddFeed() {
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"addfeed\">";
+ print_hidden("op", "rpc");
+ print_hidden("method", "addfeed");
+
+ print "<div id='fadd_error_message' style='display : none' class='alert alert-danger'></div>";
+
+ print "<div id='fadd_multiple_notify' style='display : none'>";
+ print_notice("Provided URL is a HTML page referencing multiple feeds, please select required feed from the dropdown menu below.");
+ print "<p></div>";
print "<div class=\"dlgSec\">".__("Feed or site URL")."</div>";
print "<div class=\"dlgSecCont\">";
" <input dojoType=\"dijit.form.TextBox\" name='login'\"
placeHolder=\"".__("Login")."\"
+ autocomplete=\"new-password\"
style=\"width : 10em;\"> ".
" <input
placeHolder=\"".__("Password")."\"
dojoType=\"dijit.form.TextBox\" type='password'
+ autocomplete=\"new-password\"
style=\"width : 10em;\" name='pass'\">
</div></div>";
$browser_search = $this->dbh->escape_string($_REQUEST["search"]);
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"updateFeedBrowser\">";
+ print_hidden("op", "rpc");
+ print_hidden("method", "updateFeedBrowser");
print "<div dojoType=\"dijit.Toolbar\">
<div style='float : right'>
print " <select dojoType=\"dijit.form.Select\" name=\"limit\" onchange=\"dijit.byId('feedBrowserDlg').update()\">";
foreach (array(25, 50, 100, 200) as $l) {
- $issel = ($l == $limit) ? "selected=\"1\"" : "";
- print "<option $issel value=\"$l\">$l</option>";
+ //$issel = ($l == $limit) ? "selected=\"1\"" : "";
+ print "<option value=\"$l\">$l</option>";
}
print "</select> ";
print "</div>";
- $owner_uid = $_SESSION["uid"];
-
require_once "feedbrowser.php";
print "<ul class='browseFeedList' id='browseFeedList'>";
- print make_feed_browser($search, 25);
+ print make_feed_browser("", 25);
print "</ul>";
print "<div align='center'>
style=\"font-size : 16px; width : 20em;\"
required=\"1\" name=\"query\" type=\"search\" value=''>";
- print "<hr/>".__('Limit search to:')." ";
-
- print "<select name=\"search_mode\" dojoType=\"dijit.form.Select\">
- <option value=\"all_feeds\">".__('All feeds')."</option>";
-
- $feed_title = getFeedTitle($active_feed_id);
-
- if (!$is_cat) {
- $feed_cat_title = getFeedCatTitle($active_feed_id);
- } else {
- $feed_cat_title = getCategoryTitle($active_feed_id);
- }
-
- if ($active_feed_id && !$is_cat) {
- print "<option selected=\"1\" value=\"this_feed\">$feed_title</option>";
- } else {
- print "<option disabled=\"1\" value=\"false\">".__('This feed')."</option>";
- }
-
- if ($is_cat) {
- $cat_preselected = "selected=\"1\"";
- }
+ print "<hr/><span style='float : right'>".T_sprintf('in %s', getFeedTitle($active_feed_id, $is_cat))."</span>";
- if (get_pref('ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
- print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>";
- } else {
- //print "<option disabled>".__('This category')."</option>";
+ if (DB_TYPE == "pgsql") {
+ print "<hr/>";
+ print_select("search_language", "", Pref_Feeds::$feed_languages,
+ "dojoType='dijit.form.Select' title=\"".__('Used for word stemming')."\"");
}
- print "</select>";
-
print "</div>";
print "<div class=\"dlgButtons\">";
- if (!SPHINX_ENABLED) {
+ if (count(PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH)) == 0) {
print "<div style=\"float : left\">
<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">".__("Search syntax")."</a>
</div>";
</div>";
}
+ function update_debugger() {
+ header("Content-type: text/html");
+
+ $feed_id = (int)$_REQUEST["feed_id"];
+ @$do_update = $_REQUEST["action"] == "do_update";
+ $csrf_token = $_REQUEST["csrf_token"];
+
+ $refetch_checked = isset($_REQUEST["force_refetch"]) ? "checked" : "";
+ $rehash_checked = isset($_REQUEST["force_rehash"]) ? "checked" : "";
+
+ ?>
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css" href="css/utility.css">
+ <title>Feed Debugger</title>
+ </head>
+ <body class="small_margins">
+ <h1>Feed Debugger: <?php echo "$feed_id: " . getFeedTitle($feed_id) ?></h1>
+ <form method="GET" action="">
+ <input type="hidden" name="op" value="feeds">
+ <input type="hidden" name="method" value="update_debugger">
+ <input type="hidden" name="xdebug" value="1">
+ <input type="hidden" name="csrf_token" value="<?php echo $csrf_token ?>">
+ <input type="hidden" name="action" value="do_update">
+ <input type="hidden" name="feed_id" value="<?php echo $feed_id ?>">
+ <input type="checkbox" name="force_refetch" value="1" <?php echo $refetch_checked ?>> Force refetch<br/>
+ <input type="checkbox" name="force_rehash" value="1" <?php echo $rehash_checked ?>> Force rehash<br/>
+
+ <p/><button type="submit">Continue</button>
+ </form>
+
+ <hr>
+
+ <pre><?php
+
+ if ($do_update) {
+ include "rssfuncs.php";
+ update_rss_feed($feed_id, true);
+ }
+
+ ?></pre>
+
+ </body>
+ </html>
+ <?php
+ }
}
?>