aboutsummaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-16 22:19:27 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-16 22:19:27 +0100
commit8c2b3bfc30caa22258b9569b8a228db0adc90618 (patch)
tree9d4ea433e309bf5bb7a2275f365dcc28bf14f8df /app/models/Entry.php
parent9daa4c14636ca6b70031344f812ac99947b3a2b0 (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-xapp/models/Entry.php37
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'])));