summaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-25 17:37:52 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-25 17:37:52 +0100
commit06d4b8d10247146d9c6f7c78ff9fc584438dd8fe (patch)
treec85a0f839df94ef77a168ce0865586e9f03372af /app/Models/EntryDAO.php
parenta4b890b67fb4d97c97a2b1b455c327ce4b905194 (diff)
Option globale pour la taille minimale de l'historique par défaut
Plus une réorganisation des options
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index f0207e96d..14d3ddcff 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -260,7 +260,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return isset ($entries[0]) ? $entries[0] : false;
}
- public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) {
+ public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $keepHistoryDefault = 0) {
$where = '';
$joinFeed = false;
$values = array();
@@ -307,7 +307,11 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$where .= 'AND e1.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' ';
}
if (($date_min > 0) && ($type !== 's')) {
- $where .= 'AND (e1.id >= ' . $date_min . '000000 OR e1.is_favorite = 1 OR f.keep_history <> 0) ';
+ $where .= 'AND (e1.id >= ' . $date_min . '000000 OR e1.is_favorite = 1 OR (f.keep_history <> 0';
+ if (intval($keepHistoryDefault) === 0) {
+ $where .= ' AND f.keep_history <> -2'; //default
+ }
+ $where .= ')) ';
$joinFeed = true;
}
$search = '';