summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-17 15:32:44 +0400
committerAndrew Dolgov <[email protected]>2013-03-17 15:38:21 +0400
commit7873d588227cba4c66e2535b1be631736415ef6f (patch)
tree362182a8794f2cd3b094a7d66c088150527ba58f /include
parentf01c8ec4f1324ed8b68e912220735af96c86883c (diff)
implement proper last_marked/last_published feeds for proper sorting of
published and marked virtual feeds, remove sorting by last_read workaround api: add pubsubhubbub ping when article is being set published bump schema
Diffstat (limited to 'include')
-rw-r--r--include/functions.php8
-rw-r--r--include/rssfuncs.php9
2 files changed, 13 insertions, 4 deletions
diff --git a/include/functions.php b/include/functions.php
index f17828d1d..bc8d48217 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1,6 +1,6 @@
<?php
define('EXPECTED_CONFIG_VERSION', 26);
- define('SCHEMA_VERSION', 104);
+ define('SCHEMA_VERSION', 105);
$fetch_last_error = false;
$pluginhost = false;
@@ -2310,6 +2310,8 @@
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
$allow_archived = true;
+ if (!$override_order) $override_order = "last_marked DESC, updated DESC";
+
} else if ($feed == -2) { // published virtual feed OR labels category
if (!$cat_view) {
@@ -2317,7 +2319,7 @@
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
$allow_archived = true;
- if (!$override_order) $override_order = "last_read DESC, updated DESC";
+ if (!$override_order) $override_order = "last_published DESC, updated DESC";
} else {
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
@@ -2450,6 +2452,7 @@
comments,
int_id,
unread,feed_id,marked,published,link,last_read,orig_feed_id,
+ last_marked, last_published,
".SUBSTRING_FOR_DATE."(last_read,1,19) as last_read_noms,
$vfeed_query_part
$content_query_part
@@ -2492,6 +2495,7 @@
"label_cache," .
"link," .
"last_read," .
+ "last_marked, last_published, " .
SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms," .
$since_id_part .
$vfeed_query_part .
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 5c49008c5..a95280a31 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -766,12 +766,17 @@
}
}
+ $last_marked = ($marked == 'true') ? 'NOW()' : 'NULL';
+ $last_published = ($published == 'true') ? 'NOW()' : 'NULL';
+
$result = db_query($link,
"INSERT INTO ttrss_user_entries
(ref_id, owner_uid, feed_id, unread, last_read, marked,
- published, score, tag_cache, label_cache, uuid)
+ published, score, tag_cache, label_cache, uuid,
+ last_marked, last_published)
VALUES ('$ref_id', '$owner_uid', '$feed', $unread,
- $last_read_qpart, $marked, $published, '$score', '', '', '')");
+ $last_read_qpart, $marked, $published, '$score', '', '',
+ '', $last_marked, $last_published)");
if (PUBSUBHUBBUB_HUB && $published == 'true') {
$rss_link = get_self_url_prefix() .