From 63202efc75a63ef30e58c12d602ea95a960a0976 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Wed, 21 Aug 2019 11:35:40 +0200 Subject: New feature : bookmarks - public bookmarks stored in config.json - personnal bookmarks stored in user data --- app/class/user.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'app/class/user.php') diff --git a/app/class/user.php b/app/class/user.php index ba3dfea..68eed91 100644 --- a/app/class/user.php +++ b/app/class/user.php @@ -11,6 +11,7 @@ class User protected $columns = ['title', 'datemodif', 'datecreation', 'secure', 'visitcount']; protected $connectcount = 0; protected $expiredate = false; + protected $bookmark = []; public function __construct($datas = []) { @@ -114,6 +115,11 @@ class User } } + public function bookmark() + { + return $this->bookmark; + } + // _______________________ S E T _______________________ @@ -185,6 +191,15 @@ class User } } + public function setbookmark($bookmark) + { + if(is_array($bookmark)) { + $this->bookmark = $bookmark; + } + } + + + @@ -246,6 +261,20 @@ class User $this->connectcount ++; } + public function addbookmark(string $id, string $query) + { + $id = idclean($id); + $this->bookmark[$id] = $query; + } + + public function deletebookmark(string $id) + { + if(key_exists($id, $this->bookmark)) { + unset($this->bookmark[$id]); + } + } + + } -- cgit v1.2.3