diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 0457af6..9f553fa 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -318,6 +318,12 @@ class Database { $query = $this->executeQuery($sql_action, $params_action); } + public function archiveAll($user_id) { + $sql_action = "UPDATE entries SET is_read=? WHERE user_id=? AND is_read=?"; + $params_action = array($user_id, 1, 0); + $query = $this->executeQuery($sql_action, $params_action); + } + public function getLastId($column = '') { return $this->getHandle()->lastInsertId($column); } diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 9345d1c..a786c8d 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -434,6 +434,13 @@ class Poche Tools::redirect(); } break; + case 'archive_all' : + $this->store->archiveAll($this->user->getId()); + Tools::logm('archive all links'); + if (!$import) { + Tools::redirect(); + } + break; case 'add_tag' : $tags = explode(',', $_POST['value']); $entry_id = $_POST['entry_id'];