aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-03-02 00:15:49 +0100
committerThomas Citharel <tcit@tcit.fr>2015-03-02 00:15:49 +0100
commit059a3380341c439e1debb4921bbf023a3b424a4b (patch)
treefacfca653c08cca2cef72feb095b43b3cba80fcb /inc/poche/Database.class.php
parentb692691d7ddc1fa0e1ef1f7888dfd65f70677e27 (diff)
downloadwallabag-059a3380341c439e1debb4921bbf023a3b424a4b.tar.gz
wallabag-059a3380341c439e1debb4921bbf023a3b424a4b.tar.zst
wallabag-059a3380341c439e1debb4921bbf023a3b424a4b.zip
implement #1123
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-xinc/poche/Database.class.php20
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 {