From 8c2b3bfc30caa22258b9569b8a228db0adc90618 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 16 Mar 2013 22:19:27 +0100 Subject: Fix bug #27 : le marquer comme lu s'adapte si on ne regarde qu'une catégorie ou qu'un flux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Entry.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'app/models/Entry.php') diff --git a/app/models/Entry.php b/app/models/Entry.php index b1d7b8880..001f76b5a 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -171,6 +171,43 @@ class EntryDAO extends Model_pdo { } } + public function markReadEntries ($read) { + $sql = 'UPDATE entry SET is_read = ?'; + $stm = $this->bd->prepare ($sql); + + $values = array ($read); + + if ($stm && $stm->execute ($values)) { + return true; + } else { + 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 = ?'; + $stm = $this->bd->prepare ($sql); + + $values = array ($read, $id); + + if ($stm && $stm->execute ($values)) { + return true; + } else { + return false; + } + } + public function markReadFeed ($id, $read) { + $sql = 'UPDATE entry SET is_read = ? WHERE id_feed = ?'; + $stm = $this->bd->prepare ($sql); + + $values = array ($read, $id); + + if ($stm && $stm->execute ($values)) { + return true; + } else { + return false; + } + } + public function updateEntries ($valuesTmp) { if (isset ($valuesTmp['content'])) { $valuesTmp['content'] = base64_encode (gzdeflate (serialize ($valuesTmp['content']))); -- cgit v1.2.3