diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 65675afe1..4f55a7fe2 100755
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -421,6 +421,26 @@ class Database {
return $id;
}
+ public function getPreviousArticle($id, $user_id)
+ {
+ $sql = "SELECT id FROM entries WHERE id = (SELECT max(id) FROM entries WHERE id < ?) AND user_id=? AND is_read=0";
+ $params = array($id, $user_id);
+ $query = $this->executeQuery($sql, $params);
+ $id_entry = $query->fetchAll();
+ $id = $id_entry[0][0];
+ return $id;
+ }
+
+ public function getNextArticle($id, $user_id)
+ {
+ $sql = "SELECT id FROM entries WHERE id = (SELECT min(id) FROM entries WHERE id > ?) AND user_id=? AND is_read=0";
+ $params = array($id, $user_id);
+ $query = $this->executeQuery($sql, $params);
+ $id_entry = $query->fetchAll();
+ $id = $id_entry[0][0];
+ return $id;
+ }
+
public function updateContent($id, $content, $user_id)
{
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 30d42c61b..18e1d0511 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -310,11 +310,16 @@ class Poche
if ( Tools::isAjaxRequest() ) {
echo 1;
exit;
- }
- else {
+ } else {
Tools::redirect();
}
break;
+ case 'archive_and_next' :
+ $nextid = $this->store->getNextArticle($id, $this->user->getId());
+ $this->store->archiveById($id, $this->user->getId());
+ Tools::logm('archive link #' . $id);
+ Tools::redirect('?view=view&id=' . $nextid);
+ break;
case 'archive_all' :
$this->store->archiveAll($this->user->getId());
Tools::logm('archive all links');
@@ -516,6 +521,20 @@ class Poche
$flattr->checkItem($entry['url'], $entry['id']);
}
+ # previous and next
+ $previous = FALSE;
+ $previous_id = $this->store->getPreviousArticle($id, $this->user->getId());
+ $next = FALSE;
+ $next_id = $this->store->getNextArticle($id, $this->user->getId());
+
+ if ($this->store->retrieveOneById($previous_id, $this->user->getId())) {
+ $previous = TRUE;
+ }
+ if ($this->store->retrieveOneById($next_id, $this->user->getId())) {
+ $next = TRUE;
+ }
+ $navigate = $arrayName = array('previous' => $previous, 'previousid' => $previous_id, 'next' => $next, 'nextid' => $next_id);
+
# tags
$tags = $this->store->retrieveTagsByEntry($entry['id']);
@@ -523,7 +542,8 @@ class Poche
'entry' => $entry,
'content' => $content,
'flattr' => $flattr,
- 'tags' => $tags
+ 'tags' => $tags,
+ 'navigate' => $navigate
);
}
else {
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css
index b93a78b82..1b221021b 100755
--- a/themes/baggy/css/main.css
+++ b/themes/baggy/css/main.css
@@ -748,6 +748,15 @@ a.add-to-wallabag-link-after:after {
.icon-tags:before {
content: "\e936";
}
+.icon-previous:before {
+ content: "\e606";
+}
+.icon-next:before {
+ content: "\e605";
+}
+.icon-archiveandnext:before {
+ content: "\e607";
+}
/* .icon-image class, for image-based icons
diff --git a/themes/baggy/fonts/icomoon.eot b/themes/baggy/fonts/icomoon.eot
index 3d4d14ae8..057c7bc4e 100644
Binary files a/themes/baggy/fonts/icomoon.eot and b/themes/baggy/fonts/icomoon.eot differ
diff --git a/themes/baggy/fonts/icomoon.svg b/themes/baggy/fonts/icomoon.svg
index 19fcfa1f3..f4086b53a 100644
--- a/themes/baggy/fonts/icomoon.svg
+++ b/themes/baggy/fonts/icomoon.svg
@@ -11,6 +11,10 @@
+
+
+
+
diff --git a/themes/baggy/fonts/icomoon.ttf b/themes/baggy/fonts/icomoon.ttf
index 923f56d81..f53c9590d 100644
Binary files a/themes/baggy/fonts/icomoon.ttf and b/themes/baggy/fonts/icomoon.ttf differ
diff --git a/themes/baggy/fonts/icomoon.woff b/themes/baggy/fonts/icomoon.woff
index a2e86d361..2a12440c6 100644
Binary files a/themes/baggy/fonts/icomoon.woff and b/themes/baggy/fonts/icomoon.woff differ
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig
index 7320057f8..ae02ce484 100755
--- a/themes/baggy/view.twig
+++ b/themes/baggy/view.twig
@@ -8,8 +8,10 @@
diff --git a/themes/default/css/style-default.css b/themes/default/css/style-default.css
index da8703f2b..8b18320d9 100755
--- a/themes/default/css/style-default.css
+++ b/themes/default/css/style-default.css
@@ -1,7 +1,19 @@
a.back span {
+ background-image: url('../img/default/home.png');
+}
+
+a.previous span {
background-image: url('../img/default/left.png');
}
+a.next span {
+ background-image: url('../img/default/right.png');
+}
+
+a.archiveandnext span {
+ background-image: url('../img/default/forward.png');
+}
+
a.top span {
background-image: url('../img/default/top.png');
}
diff --git a/themes/default/view.twig b/themes/default/view.twig
index 44cbf41b8..0d4ec1744 100755
--- a/themes/default/view.twig
+++ b/themes/default/view.twig
@@ -5,10 +5,12 @@
{% include '_pocheit-form.twig' %}