diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-01-12 14:53:41 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-01-12 14:53:41 +0100 |
commit | 393709dcf84776c760146722560816172167fe98 (patch) | |
tree | 4b5c1f24beae72a0ed9e6535f725031b46be165d /app/class/art2.php | |
parent | 19458f7fc46c5a275f9a04b9e80fdf8175c85c6e (diff) | |
download | wcms-393709dcf84776c760146722560816172167fe98.tar.gz wcms-393709dcf84776c760146722560816172167fe98.zip |
visit counter
Diffstat (limited to 'app/class/art2.php')
-rw-r--r-- | app/class/art2.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/class/art2.php b/app/class/art2.php index a378bd4..2341ff9 100644 --- a/app/class/art2.php +++ b/app/class/art2.php @@ -37,6 +37,7 @@ class Art2 protected $invites; protected $readers; protected $affcount; + protected $visitcount; protected $editcount; @@ -110,6 +111,7 @@ class Art2 $this->setinvites([]); $this->setreaders([]); $this->setaffcount(0); + $this->setvisitcount(0); $this->seteditcount(0); } @@ -432,6 +434,11 @@ class Art2 return $this->affcount; } + public function visitcount($type = 'int') + { + return $this->visitcount; + } + public function editcount($type = 'int') { return $this->editcount; @@ -739,6 +746,15 @@ class Art2 } } + public function setvisitcount($visitcount) + { + if (is_int($visitcount)) { + $this->visitcount = $visitcount; + } elseif (is_numeric($visitcount)) { + $this->visitcount = intval($visitcount); + } + } + public function seteditcount($editcount) { if (is_int($editcount)) { @@ -762,6 +778,11 @@ class Art2 $this->affcount++; } + public function addvisitcount() + { + $this->visitcount++; + } + public function updateedited() { $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); |