summaryrefslogtreecommitdiff
path: root/offline.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-06 20:20:18 +0300
committerAndrew Dolgov <[email protected]>2009-02-06 20:20:18 +0300
commit79645416fe227407e7e19f77382f77bec15ff78e (patch)
treefba6548ee8c9aad0b6b1dc4aa69f9c6b2626b5ea /offline.js
parent41cb233a11bfec3b20db18410384f5eb5629ed26 (diff)
viewfeed_offline: remove duplicate headlines
Diffstat (limited to 'offline.js')
-rw-r--r--offline.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/offline.js b/offline.js
index a02c978ba..c3fc1bb08 100644
--- a/offline.js
+++ b/offline.js
@@ -195,6 +195,8 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
mode_qpart = "1";
}
+ var ext_tables_qpart = "";
+
if (feed_id > 0) {
strategy_qpart = "feed_id = " + feed_id;
} else if (feed_id == -1) {
@@ -203,8 +205,8 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
strategy_qpart = "1";
} else if (feed_id < -10) {
var label_id = -11 - feed_id;
- strategy_qpart = "label_id = " + label_id;
-
+ strategy_qpart = "article_labels.id = articles.id AND label_id = " + label_id;
+ ext_tables_qpart = ",article_labels";
}
if (offset > 0) {
@@ -214,8 +216,8 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
}
var query = "SELECT *,feeds.title AS feed_title "+
- "FROM articles,feeds LEFT JOIN article_labels "+
- "ON (article_labels.id = articles.id) WHERE " +
+ "FROM articles,feeds"+ext_tables_qpart+" "+
+ "WHERE " +
"feed_id = feeds.id AND " +
strategy_qpart +
" AND " + mode_qpart +