aboutsummaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-03 22:53:51 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-03 22:53:51 +0100
commit018273e2720c481c699ecc5cca1cdc90599921f7 (patch)
treee3112653abfb687dd65763839a3fc4fefff14030 /app/models/Entry.php
parent0425432271fb709d94194cfd5ca922038c175573 (diff)
Corrige bug marquer tous les favoris comme lus
Corrige https://github.com/marienfressinaud/FreshRSS/issues/270
Diffstat (limited to 'app/models/Entry.php')
-rwxr-xr-xapp/models/Entry.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php
index 899e98b00..6c37c3d6e 100755
--- a/app/models/Entry.php
+++ b/app/models/Entry.php
@@ -257,11 +257,14 @@ class EntryDAO extends Model_pdo {
return false;
}
}
- public function markReadEntries ($idMax = 0) {
+ public function markReadEntries ($idMax = 0, $onlyFavorites = false) {
if ($idMax === 0) {
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
. 'SET e.is_read = 1, f.cache_nbUnreads=0 '
. 'WHERE e.is_read = 0 AND f.priority > 0';
+ if ($onlyFavorites) {
+ $sql .= ' AND e.is_favorite = 1';
+ }
$stm = $this->bd->prepare ($sql);
if ($stm && $stm->execute ()) {
return $stm->rowCount();
@@ -276,6 +279,9 @@ class EntryDAO extends Model_pdo {
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
. 'SET e.is_read = 1 '
. 'WHERE e.is_read = 0 AND e.id <= ? AND f.priority > 0';
+ if ($onlyFavorites) {
+ $sql .= ' AND e.is_favorite = 1';
+ }
$values = array ($idMax);
$stm = $this->bd->prepare ($sql);
if (!($stm && $stm->execute ($values))) {