From 49f25c00fed83be18faa87295fbc58d69cc2c5d8 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 8 Feb 2025 10:14:36 +0000 Subject: fix(views/archive): Only increment visited counter on opened archive --- views/archive/index.php | 2 -- views/archive/topbar.php | 10 ++++++++++ views/archive/visit.php | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 views/archive/visit.php (limited to 'views') diff --git a/views/archive/index.php b/views/archive/index.php index 36c438a..22b8a21 100644 --- a/views/archive/index.php +++ b/views/archive/index.php @@ -8,8 +8,6 @@ normalizeUrl($url); $page = Database\Webpage::fromDB($url); - $page->incrementVisits(); - $user = Database\Cookie::fromDB($TOKEN); } catch(Exception $e) { diff --git a/views/archive/topbar.php b/views/archive/topbar.php index b00a33d..9bf52f7 100644 --- a/views/archive/topbar.php +++ b/views/archive/topbar.php @@ -29,3 +29,13 @@ + + diff --git a/views/archive/visit.php b/views/archive/visit.php new file mode 100644 index 0000000..aa681e1 --- /dev/null +++ b/views/archive/visit.php @@ -0,0 +1,7 @@ +incrementVisits(); -- cgit v1.2.3