diff options
| author | 2013-03-16 22:19:27 +0100 | |
|---|---|---|
| committer | 2013-03-16 22:19:27 +0100 | |
| commit | 8c2b3bfc30caa22258b9569b8a228db0adc90618 (patch) | |
| tree | 9d4ea433e309bf5bb7a2275f365dcc28bf14f8df /app/models/Entry.php | |
| parent | 9daa4c14636ca6b70031344f812ac99947b3a2b0 (diff) | |
Fix bug #27 : le marquer comme lu s'adapte si on ne regarde qu'une catégorie ou qu'un flux
Diffstat (limited to 'app/models/Entry.php')
| -rwxr-xr-x | app/models/Entry.php | 37 |
1 files changed, 37 insertions, 0 deletions
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']))); |
