diff options
| author | 2013-03-17 00:01:40 +0100 | |
|---|---|---|
| committer | 2013-03-17 00:01:40 +0100 | |
| commit | d63eddf0c5a563d11c880bb700dafc889ee87a3d (patch) | |
| tree | 17a2d4f788850684e73b8229e57efefeda9a121a /app/models/Entry.php | |
| parent | 81eab003ef3ff845da46f85c56850a76f2d16bb8 (diff) | |
Ajout d'options : possibilité de changer l'ordre des articles + possibilité de marquer comme lu au choix : tous, antérieurs à 1 jour, antérieurs à 1 semaine
Diffstat (limited to 'app/models/Entry.php')
| -rwxr-xr-x | app/models/Entry.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index 001f76b5a..245fea2f6 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -171,11 +171,11 @@ class EntryDAO extends Model_pdo { } } - public function markReadEntries ($read) { - $sql = 'UPDATE entry SET is_read = ?'; + public function markReadEntries ($read, $dateMax) { + $sql = 'UPDATE entry SET is_read = ? WHERE date < ?'; $stm = $this->bd->prepare ($sql); - $values = array ($read); + $values = array ($read, $dateMax); if ($stm && $stm->execute ($values)) { return true; @@ -183,11 +183,11 @@ class EntryDAO extends Model_pdo { return false; } } - public function markReadCat ($id, $read) { - $sql = 'UPDATE entry e INNER JOIN feed f ON e.id_feed = f.id SET is_read = ? WHERE category = ?'; + public function markReadCat ($id, $read, $dateMax) { + $sql = 'UPDATE entry e INNER JOIN feed f ON e.id_feed = f.id SET is_read = ? WHERE category = ? AND date < ?'; $stm = $this->bd->prepare ($sql); - $values = array ($read, $id); + $values = array ($read, $id, $dateMax); if ($stm && $stm->execute ($values)) { return true; @@ -195,11 +195,11 @@ class EntryDAO extends Model_pdo { return false; } } - public function markReadFeed ($id, $read) { - $sql = 'UPDATE entry SET is_read = ? WHERE id_feed = ?'; + public function markReadFeed ($id, $read, $dateMax) { + $sql = 'UPDATE entry SET is_read = ? WHERE id_feed = ? AND date < ?'; $stm = $this->bd->prepare ($sql); - $values = array ($read, $id); + $values = array ($read, $id, $dateMax); if ($stm && $stm->execute ($values)) { return true; |
