From 66ca7919a188e59c77567865610159b6efd0ec40 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Thu, 8 Jan 2026 15:09:55 +0000 Subject: [PATCH] Dateien nach "/" hochladen --- mc-multiserver-gallery-pro.php | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 mc-multiserver-gallery-pro.php diff --git a/mc-multiserver-gallery-pro.php b/mc-multiserver-gallery-pro.php new file mode 100644 index 0000000..a0d5338 --- /dev/null +++ b/mc-multiserver-gallery-pro.php @@ -0,0 +1,91 @@ +

MC Gallery PRO: Dieses Plugin benötigt PHP 7.0 oder höher.

'; + }); + } + return; +} + +if (defined('MCGALLERY_PRO_VERSION')) { return; } + +define('MCGALLERY_PRO_VERSION', '2.5.2'); +define('MCGALLERY_PRO_DIR', plugin_dir_path(__FILE__)); +define('MCGALLERY_PRO_URL', plugin_dir_url(__FILE__)); +define('MCGALLERY_TOKEN_TTL', 300); +define('MCGALLERY_OPTION_KEY', 'mc_gallery_tokens_store'); + +function mc_gallery_pro_safe_require($path) { + if (!file_exists($path)) { + if (is_admin()) { + add_action('admin_notices', function() use ($path) { + echo '

MC Gallery PRO Fehler: Datei nicht gefunden: ' . esc_html($path) . '.

'; + }); + } + return false; + } + require_once $path; + return true; +} + +function mc_gallery_pro_load_textdomain() { + load_plugin_textdomain('mc-multiserver-gallery-pro', false, basename(dirname(__FILE__)) . '/languages'); +} +add_action('plugins_loaded', 'mc_gallery_pro_load_textdomain'); + + $core_files = [ + 'class-mc-gallery-helpers.php', + 'class-mc-gallery-core.php', + 'class-mc-gallery-shortcodes.php' +]; + +if (!is_dir(MCGALLERY_PRO_DIR . 'includes')) { + add_action('admin_notices', function() { + echo '

MC Gallery PRO Fehler: Der Ordner includes/ fehlt.

'; + }); +} else { + foreach ($core_files as $file) { + if (!mc_gallery_pro_safe_require(MCGALLERY_PRO_DIR . 'includes/' . $file)) { + return; + } + } +} + +function mc_gallery_pro_activate_callback() { + if (class_exists('MC_Gallery_Core')) { + if (!get_option(MC_Gallery_Core::OPTION_THUMB_H)) { + update_option(MC_Gallery_Core::OPTION_THUMB_H, 200); + } + } + if (get_option(MCGALLERY_OPTION_KEY) === false) { + update_option(MCGALLERY_OPTION_KEY, []); + } +} +register_activation_hook(__FILE__, 'mc_gallery_pro_activate_callback'); + +function mc_gallery_pro_uninstall_callback() { + delete_option(MCGALLERY_OPTION_KEY); + if (class_exists('MC_Gallery_Core')) { + delete_option(MC_Gallery_Core::OPTION_THUMB_H); + } +} +register_uninstall_hook(__FILE__, 'mc_gallery_pro_uninstall_callback'); + +if (class_exists('MC_Gallery_Core')) { + add_action('plugins_loaded', ['MC_Gallery_Core', 'init']); +} +if (class_exists('MC_Gallery_Shortcodes')) { + add_action('plugins_loaded', ['MC_Gallery_Shortcodes', 'init']); +} \ No newline at end of file