From f17cac6b26c4df018e8fda97925411d8267c1310 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 2 Apr 2013 15:32:47 +0400 Subject: [PATCH] retire DEFAULT_ARTICLE_LIMIT, infinite scrolling is fast enough to make it superfluous --- classes/feeds.php | 2 +- classes/pref/prefs.php | 11 ++--------- include/db-prefs.php | 4 ---- include/functions.php | 2 +- js/viewfeed.js | 2 +- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index 713460e28..778850fc4 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -796,7 +796,7 @@ class Feeds extends Handler_Protected { $feed = db_escape_string($this->link, $_REQUEST["feed"]); $method = db_escape_string($this->link, $_REQUEST["m"]); $view_mode = db_escape_string($this->link, $_REQUEST["view_mode"]); - $limit = (int) get_pref($this->link, "DEFAULT_ARTICLE_LIMIT"); + $limit = 30; @$cat_view = $_REQUEST["cat"] == "true"; @$next_unread_feed = db_escape_string($this->link, $_REQUEST["nuf"]); @$offset = db_escape_string($this->link, $_REQUEST["skip"]); diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index cc523092f..fba9f70d8 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -120,7 +120,7 @@ class Pref_Prefs extends Handler_Protected { global $access_level_names; $prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES", - "SORT_HEADLINES_BY_FEED_DATE"); + "SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT"); /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */ @@ -498,13 +498,6 @@ class Pref_Prefs extends Handler_Protected { 'dojoType="dijit.form.Select"'); - } else if ($pref_name == "DEFAULT_ARTICLE_LIMIT") { - - $limits = array(15, 30, 45, 60); - - print_select($pref_name, $value, $limits, - 'dojoType="dijit.form.Select"'); - } else if ($pref_name == "DEFAULT_UPDATE_INTERVAL") { global $update_intervals_nodefault; @@ -528,7 +521,7 @@ class Pref_Prefs extends Handler_Protected { print ""; - } else if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', 'DEFAULT_ARTICLE_LIMIT', + } else if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT')) !== false) { $regexp = ($type_name == 'integer') ? 'regexp="^\d*$"' : ''; diff --git a/include/db-prefs.php b/include/db-prefs.php index f6a78939b..1ee3d609a 100644 --- a/include/db-prefs.php +++ b/include/db-prefs.php @@ -166,10 +166,6 @@ $value = sprintf("%d", $value); } - if ($pref_name == 'DEFAULT_ARTICLE_LIMIT' && $value == 0) { - $value = 30; - } - if ($pref_name == 'USER_TIMEZONE' && $value == '') { $value = 'UTC'; } diff --git a/include/functions.php b/include/functions.php index c04e6a81a..92690cfbb 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1840,7 +1840,7 @@ foreach (array("ON_CATCHUP_SHOW_NEXT_FEED", "HIDE_READ_FEEDS", "ENABLE_FEED_CATS", "FEEDS_SORT_BY_UNREAD", "CONFIRM_FEED_CATCHUP", - "CDM_AUTO_CATCHUP", "FRESH_ARTICLE_MAX_AGE", "DEFAULT_ARTICLE_LIMIT", + "CDM_AUTO_CATCHUP", "FRESH_ARTICLE_MAX_AGE", "HIDE_READ_SHOWS_SPECIAL", "COMBINED_DISPLAY_MODE") as $param) { $params[strtolower($param)] = (int) get_pref($link, $param); diff --git a/js/viewfeed.js b/js/viewfeed.js index 48137a136..c1163eab7 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -64,7 +64,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) { vgroup_last_feed = reply['headlines-info']['vgroup_last_feed']; - if (parseInt(headlines_count) < getInitParam("default_article_limit")) { + if (parseInt(headlines_count) < 30) { _infscroll_disable = 1; } else { _infscroll_disable = 0;