diff --git a/ext/artists/main.php b/ext/artists/main.php index 9ea279ce..11fc59f4 100644 --- a/ext/artists/main.php +++ b/ext/artists/main.php @@ -32,7 +32,9 @@ class Artists extends Extension public function onInitExt(InitExtEvent $event): void { + global $config; Image::$prop_types["author"] = ImagePropType::STRING; + $config->set_default_int("artistsPerPage", 20); } public function onImageInfoSet(ImageInfoSetEvent $event): void @@ -120,7 +122,6 @@ class Artists extends Extension "); $database->execute("ALTER TABLE images ADD COLUMN author VARCHAR(255) NULL"); - $config->set_int("artistsPerPage", 20); $this->set_version("ext_artists_version", 1); } } diff --git a/ext/forum/main.php b/ext/forum/main.php index f2f4c31f..fb07560c 100644 --- a/ext/forum/main.php +++ b/ext/forum/main.php @@ -17,6 +17,15 @@ class Forum extends Extension /** @var ForumTheme */ protected Themelet $theme; + public function onInitExt(InitExtEvent $event): void + { + global $config; + $config->set_default_int("forumTitleSubString", 25); + $config->set_default_int("forumThreadsPerPage", 15); + $config->set_default_int("forumPostsPerPage", 15); + $config->set_default_int("forumMaxCharsPerPost", 512); + } + public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void { global $config, $database; @@ -46,12 +55,6 @@ class Forum extends Extension "); $database->execute("CREATE INDEX forum_posts_date_idx ON forum_posts(date)", []); - $config->set_int("forumTitleSubString", 25); - $config->set_int("forumThreadsPerPage", 15); - $config->set_int("forumPostsPerPage", 15); - - $config->set_int("forumMaxCharsPerPost", 512); - $this->set_version("forum_version", 3); } if ($this->get_version("forum_version") < 2) { diff --git a/ext/notes/main.php b/ext/notes/main.php index e19ce22c..fe3c81b7 100644 --- a/ext/notes/main.php +++ b/ext/notes/main.php @@ -11,7 +11,11 @@ class Notes extends Extension public function onInitExt(InitExtEvent $event): void { + global $config; Image::$prop_types["notes"] = ImagePropType::INT; + $config->set_default_int("notesNotesPerPage", 20); + $config->set_default_int("notesRequestsPerPage", 20); + $config->set_default_int("notesHistoriesPerPage", 20); } public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void @@ -67,10 +71,6 @@ class Notes extends Extension "); $database->execute("CREATE INDEX note_histories_image_id_idx ON note_histories(image_id)", []); - $config->set_int("notesNotesPerPage", 20); - $config->set_int("notesRequestsPerPage", 20); - $config->set_int("notesHistoriesPerPage", 20); - $this->set_version("ext_notes_version", 1); } }