$_SESSION['hasSandbox'] = $has_sandbox;
+ $skip_first_id_check = false;
+
$override_order = false;
switch ($_REQUEST["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";
list($headlines, $headlines_header) = $this->api_get_headlines($feed_id, $limit, $offset,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $override_order,
$include_attachments, $since_id, $search,
- $include_nested, $sanitize_content, $force_update, $excerpt_length, $check_first_id);
+ $include_nested, $sanitize_content, $force_update, $excerpt_length, $check_first_id, $skip_first_id_check);
if ($include_header) {
$this->wrap(self::STATUS_OK, array($headlines_header, $headlines));
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order,
$include_attachments, $since_id,
$search = "", $include_nested = false, $sanitize_content = true,
- $force_update = false, $excerpt_length = 100, $check_first_id = false) {
+ $force_update = false, $excerpt_length = 100, $check_first_id = false, $skip_first_id_check = false) {
if ($force_update && $feed_id > 0 && is_numeric($feed_id)) {
// Update the feed if required with some basic flood control
"offset" => $offset,
"since_id" => $since_id,
"include_children" => $include_nested,
- "check_first_id" => $check_first_id
+ "check_first_id" => $check_first_id,
+ "skip_first_id_check" => $skip_first_id_check
);
$qfh_ret = queryFeedHeadlines($params);
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, $check_first_id = false) {
+ $override_order = false, $include_children = false, $check_first_id = false,
+ $skip_first_id_check = false) {
$disable_cache = false;
"override_order" => $override_order,
"offset" => $offset,
"include_children" => $include_children,
- "check_first_id" => $check_first_id
+ "check_first_id" => $check_first_id,
+ "skip_first_id_check" => $skip_first_id_check
);
$qfh_ret = queryFeedHeadlines($params);
$reply['headlines'] = array();
$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";
$ret = $this->format_headlines_list($feed, $method,
$view_mode, $limit, $cat_view, $next_unread_feed, $offset,
- $vgroup_last_feed, $override_order, true, $check_first_id);
+ $vgroup_last_feed, $override_order, true, $check_first_id, $skip_first_id_check);
//$topmost_article_ids = $ret[0];
$headlines_count = $ret[1];
$override_vfeed = isset($params["override_vfeed"]) ? $params["override_vfeed"] : false;
$start_ts = isset($params["start_ts"]) ? $params["start_ts"] : false;
$check_first_id = isset($params["check_first_id"]) ? $params["check_first_id"] : false;
+ $skip_first_id_check = isset($params["skip_first_id_check"]) ? $params["skip_first_id_check"] : false;
$ext_tables_part = "";
$query_strategy_part = "";
$sanity_interval_qpart = "date_entered >= DATE_SUB(NOW(), INTERVAL 1 hour) AND";
}
- if (!$search) {
+ if (!$search && !$skip_first_id_check) {
// if previous topmost article id changed that means our current pagination is no longer valid
$query = "SELECT DISTINCT
ttrss_feeds.title,