diff --git a/includes/class-mc-gallery-core.php b/includes/class-mc-gallery-core.php index 6eb4760..90816de 100644 --- a/includes/class-mc-gallery-core.php +++ b/includes/class-mc-gallery-core.php @@ -1,8 +1,13 @@ 'integer', 'sanitize_callback' => 'absint', 'default' => 100]); register_setting('mc_gallery_pro_group', self::OPTION_SHOW_DATE, [ 'type' => 'boolean', - 'sanitize_callback' => function($input) { return $input === '1'; }, + 'sanitize_callback' => function($input) { return $input == '1' || $input === true || $input === 'on'; }, 'default' => true ]); register_setting('mc_gallery_pro_group', self::OPTION_MAX_UPLOADS, [ @@ -210,13 +220,39 @@ class MC_Gallery_Core { 'sanitize_callback' => 'absint', 'default' => 5 ]); + register_setting('mc_gallery_pro_group', self::OPTION_FORUM_LOGIN, [ + 'type' => 'boolean', + 'sanitize_callback' => function($input) { return !empty($input) && $input !== '0'; }, + 'default' => false + ]); + register_setting('mc_gallery_pro_group', self::OPTION_VOTING, [ + 'type' => 'boolean', + 'sanitize_callback' => function($input) { return !empty($input) && $input !== '0'; }, + 'default' => true + ]); } public static function settings_page() { - $thumb_h = get_option(self::OPTION_THUMB_H, 200); - $resize_pct = get_option(self::OPTION_RESIZE_PCT, 100); - $show_date = get_option(self::OPTION_SHOW_DATE, true); + $thumb_h = get_option(self::OPTION_THUMB_H, 200); + $resize_pct = get_option(self::OPTION_RESIZE_PCT, 100); + $show_date = get_option(self::OPTION_SHOW_DATE, true); $max_uploads = get_option(self::OPTION_MAX_UPLOADS, 5); + $forum_login = get_option(self::OPTION_FORUM_LOGIN, false); + $forum_plugin_active = class_exists('WBF_Auth'); + + // Prüfen ob das Forum-Plugin zwar existiert (Datei vorhanden) aber nicht aktiv ist + $forum_plugin_installed = false; + if ( ! $forum_plugin_active ) { + $all_plugins = get_plugins(); + foreach ( $all_plugins as $plugin_file => $plugin_data ) { + if ( stripos( $plugin_data['Name'], 'WP Business Forum' ) !== false + || stripos( $plugin_data['TextDomain'], 'wp-business-forum' ) !== false + || stripos( $plugin_file, 'wp-business-forum' ) !== false ) { + $forum_plugin_installed = true; + break; + } + } + } ?>
How many images can a user upload at once? (Default: 5)
+
+ Wenn aktiviert, können sich Nutzer die ihren Minecraft-Account im Forum-Profil verknüpft haben, direkt ohne Ingame-Token hochladen.
+ Der Shortcode: [mc_gallery_combined] ermöglicht eine kombinierte Verifizierung für Token und Forum.
+
+ Nach der Installation und Aktivierung von WP Business Forum wird diese Option freigeschaltet. +
+ + +
+ Besucher können Bilder mit 👍 oder 👎 bewerten. Jeder kann abstimmen (kein Login nötig).
+ Shortcode für die Bestenliste: [mc_gallery_vote]
+
+ Verknüpfe deinen Minecraft-Account mit deinem Forum-Profil. + Danach kannst du Bilder in der Galerie ohne Ingame-Token hochladen. +
+Kein Minecraft-Account verknüpft.
+ + +