diff options
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-x | inc/poche/Database.class.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 65675afe..4f55a7fe 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -421,6 +421,26 @@ class Database { | |||
421 | return $id; | 421 | return $id; |
422 | } | 422 | } |
423 | 423 | ||
424 | public function getPreviousArticle($id, $user_id) | ||
425 | { | ||
426 | $sql = "SELECT id FROM entries WHERE id = (SELECT max(id) FROM entries WHERE id < ?) AND user_id=? AND is_read=0"; | ||
427 | $params = array($id, $user_id); | ||
428 | $query = $this->executeQuery($sql, $params); | ||
429 | $id_entry = $query->fetchAll(); | ||
430 | $id = $id_entry[0][0]; | ||
431 | return $id; | ||
432 | } | ||
433 | |||
434 | public function getNextArticle($id, $user_id) | ||
435 | { | ||
436 | $sql = "SELECT id FROM entries WHERE id = (SELECT min(id) FROM entries WHERE id > ?) AND user_id=? AND is_read=0"; | ||
437 | $params = array($id, $user_id); | ||
438 | $query = $this->executeQuery($sql, $params); | ||
439 | $id_entry = $query->fetchAll(); | ||
440 | $id = $id_entry[0][0]; | ||
441 | return $id; | ||
442 | } | ||
443 | |||
424 | 444 | ||
425 | public function updateContent($id, $content, $user_id) | 445 | public function updateContent($id, $content, $user_id) |
426 | { | 446 | { |