From d7f0f17fea42db10df2eea7d4edf636988bf06d5 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 21 Jun 2024 19:18:21 +0100 Subject: [PATCH] [image_view_counter] use a proper DB version counter --- ext/image_view_counter/config.php | 10 ++++++++++ ext/image_view_counter/main.php | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 ext/image_view_counter/config.php diff --git a/ext/image_view_counter/config.php b/ext/image_view_counter/config.php new file mode 100644 index 00000000..2103e6e9 --- /dev/null +++ b/ext/image_view_counter/config.php @@ -0,0 +1,10 @@ +get_bool("image_viewcounter_installed") == false) { //todo + if ($config->get_bool("image_viewcounter_installed")) { + $this->set_version(ImageViewCounterConfig::VERSION, 1); + $config->delete("image_viewcounter_installed"); + } + if ($this->get_version(ImageViewCounterConfig::VERSION) < 1) { $database->create_table("image_views", " id SCORE_AIPK, image_id INTEGER NOT NULL, user_id INTEGER NOT NULL, timestamp INTEGER NOT NULL, ipaddress SCORE_INET NOT NULL"); - $config->set_bool("image_viewcounter_installed", true); + $this->set_version(ImageViewCounterConfig::VERSION, 1); } }