From 83832a39c4651bd3e4bfa007f75c91d040db79d3 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 6 Sep 2014 11:32:52 -0400 Subject: Add a new configuration option Before, when you selected the option to display only unread articles, it shows read articles if no unread article were found. Now, this option is renamed to include information on fallback behavior and a new option is created to have the "only unread" behavior See #551 It is missing the german translation --- app/Models/Configuration.php | 13 ++++++++++++- app/Models/Entry.php | 2 ++ app/Models/EntryDAO.php | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'app/Models') diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 3a408faa5..92bab6ad9 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -141,7 +141,18 @@ class FreshRSS_Configuration { } } public function _default_view ($value) { - $this->data['default_view'] = $value === FreshRSS_Entry::STATE_ALL ? FreshRSS_Entry::STATE_ALL : FreshRSS_Entry::STATE_NOT_READ; + switch ($value): + case FreshRSS_Entry::STATE_ALL: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ_STRICT: + $this->data['default_view'] = $value; + break; + default: + $this->data['default_view'] = FreshRSS_Entry::STATE_ALL; + break; + endswitch; } public function _display_posts ($value) { $this->data['display_posts'] = ((bool)$value) && $value !== 'no'; diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 0bf1f2616..5f1c8abc4 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -6,6 +6,8 @@ class FreshRSS_Entry extends Minz_Model { const STATE_NOT_READ = 2; const STATE_FAVORITE = 4; const STATE_NOT_FAVORITE = 8; + const STATE_READ_STRICT = 16; + const STATE_NOT_READ_STRICT = 32; private $id = 0; private $guid; diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 75a8aeba4..dee49212d 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -338,6 +338,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { elseif ($state & FreshRSS_Entry::STATE_READ) { $where .= 'AND e1.is_read=1 '; } + elseif ($state & FreshRSS_Entry::STATE_NOT_READ_STRICT) { + $where .= 'AND e1.is_read=0 '; + } if ($state & FreshRSS_Entry::STATE_FAVORITE) { if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { $where .= 'AND e1.is_favorite=1 '; -- cgit v1.2.3 From 9fec7f328b077993499c282ccb59414fb50ca84f Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 17 Sep 2014 11:22:45 +0200 Subject: Coding style + i18n Change "Show only unread or read if no unread" into "Adjust showing". It is less explicit but shorter. --- app/Models/Configuration.php | 24 ++++++++++++------------ app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/views/configure/reading.phtml | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'app/Models') diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index e47b042c8..352e70f4f 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -141,18 +141,18 @@ class FreshRSS_Configuration { } } public function _default_view ($value) { - switch ($value): - case FreshRSS_Entry::STATE_ALL: - // left blank on purpose - case FreshRSS_Entry::STATE_NOT_READ: - // left blank on purpose - case FreshRSS_Entry::STATE_NOT_READ_STRICT: - $this->data['default_view'] = $value; - break; - default: - $this->data['default_view'] = FreshRSS_Entry::STATE_ALL; - break; - endswitch; + switch ($value) { + case FreshRSS_Entry::STATE_ALL: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ_STRICT: + $this->data['default_view'] = $value; + break; + default: + $this->data['default_view'] = FreshRSS_Entry::STATE_ALL; + break; + } } public function _display_posts ($value) { $this->data['display_posts'] = ((bool)$value) && $value !== 'no'; diff --git a/app/i18n/en.php b/app/i18n/en.php index 7c66864c1..562697585 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -92,7 +92,7 @@ return array ( 'rss_view' => 'RSS feed', 'show_all_articles' => 'Show all articles', 'show_not_reads' => 'Show only unread', - 'show_not_reads_with_fallback' => 'Show only unread or read if no unread', + 'show_adaptive' => 'Adjust showing', 'show_read' => 'Show only read', 'show_favorite' => 'Show only favorites', 'show_not_favorite' => 'Show all but favorites', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 327661035..9516f66cb 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -92,7 +92,7 @@ return array ( 'rss_view' => 'Flux RSS', 'show_all_articles' => 'Afficher tous les articles', 'show_not_reads' => 'Afficher les non lus', - 'show_not_reads_with_fallback' => 'Afficher les non lus ou les lus si aucun non lus', + 'show_adaptive' => 'Adapter l’affichage', 'show_read' => 'Afficher les lus', 'show_favorite' => 'Afficher les favoris', 'show_not_favorite' => 'Afficher tout sauf les favoris', diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 9bd145a3b..3dd457a2b 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -38,12 +38,12 @@
- +
-- cgit v1.2.3 From fc86d14ade745ca65f8ec8e6eaa0fb4c817961a2 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 17 Sep 2014 21:17:55 +0200 Subject: Bug purge https://github.com/marienfressinaud/FreshRSS/issues/493 --- app/Models/FeedDAO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Models') diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 756b1f008..b89ae2045 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -331,7 +331,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { $id_max = intval($date_min) . '000000'; $stm->bindParam(':id_feed', $id, PDO::PARAM_INT); - $stm->bindParam(':id_max', $id_max, PDO::PARAM_INT); + $stm->bindParam(':id_max', $id_max, PDO::PARAM_STR); $stm->bindParam(':keep', $keep, PDO::PARAM_INT); if ($stm && $stm->execute()) { -- cgit v1.2.3