From d6e5706d7e127c747a9ff4dd092676fadf616af3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 1 Aug 2006 05:52:32 +0100 Subject: [PATCH] new option: REVERSE_HEADLINES (closes #97) --- functions.php | 8 ++++++-- schema/ttrss_schema_mysql.sql | 2 ++ schema/ttrss_schema_pgsql.sql | 2 ++ schema/upgrade-1.1.7-1.2.2-mysql.sql | 2 ++ schema/upgrade-1.1.7-1.2.2-pgsql.sql | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 65b374e1..e0f2cd5e 100644 --- a/functions.php +++ b/functions.php @@ -2105,8 +2105,12 @@ } else { $query_strategy_part = "id > 0"; // dumb } - - $order_by = "updated DESC"; + + if (get_pref($link, 'REVERSE_HEADLINES')) { + $order_by = "updated"; + } else { + $order_by = "updated DESC"; + } $feed_title = ""; diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 0b47461f..360d6257 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -253,6 +253,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); + create table ttrss_user_prefs ( owner_uid integer not null, pref_name varchar(250), diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 64e31447..150cef55 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -233,6 +233,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); + create table ttrss_user_prefs ( owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE, pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE, diff --git a/schema/upgrade-1.1.7-1.2.2-mysql.sql b/schema/upgrade-1.1.7-1.2.2-mysql.sql index 164b561c..5830742d 100644 --- a/schema/upgrade-1.1.7-1.2.2-mysql.sql +++ b/schema/upgrade-1.1.7-1.2.2-mysql.sql @@ -1,5 +1,7 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); + update ttrss_prefs SET section_id = 3 WHERE pref_name = 'ENABLE_SEARCH_TOOLBAR'; update ttrss_prefs SET section_id = 3 WHERE pref_name = 'ENABLE_FEED_ICONS'; update ttrss_prefs SET section_id = 3 WHERE pref_name = 'EXTENDED_FEEDLIST'; diff --git a/schema/upgrade-1.1.7-1.2.2-pgsql.sql b/schema/upgrade-1.1.7-1.2.2-pgsql.sql index a285a15a..6180026b 100644 --- a/schema/upgrade-1.1.7-1.2.2-pgsql.sql +++ b/schema/upgrade-1.1.7-1.2.2-pgsql.sql @@ -2,6 +2,8 @@ begin; insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); + update ttrss_prefs SET section_id = 3 WHERE pref_name = 'ENABLE_SEARCH_TOOLBAR'; update ttrss_prefs SET section_id = 3 WHERE pref_name = 'ENABLE_FEED_ICONS'; update ttrss_prefs SET section_id = 3 WHERE pref_name = 'EXTENDED_FEEDLIST'; -- 2.39.5