Upload via GUI (182 Dateien)

This commit is contained in:
2026-08-13 21:22:59 +00:00
parent 0fda461bec
commit 5e0c026da0
17 changed files with 278 additions and 4140 deletions
+5
View File
@@ -2,6 +2,11 @@
define('WP_USE_THEMES', false); define('WP_USE_THEMES', false);
require('../../../wp-load.php'); require('../../../wp-load.php');
if ( php_sapi_name() !== 'cli' && ! current_user_can( 'manage_options' ) ) {
http_response_code( 403 );
exit( 'Forbidden: Admin-Login erforderlich.' );
}
global $wpdb; global $wpdb;
$deleted1 = $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mm_yt_live%'"); $deleted1 = $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mm_yt_live%'");
$deleted2 = $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_timeout_mm_yt_live%'"); $deleted2 = $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_timeout_mm_yt_live%'");
@@ -6,6 +6,11 @@
define('WP_USE_THEMES', false); define('WP_USE_THEMES', false);
require('../../../wp-load.php'); require('../../../wp-load.php');
if ( php_sapi_name() !== 'cli' && ! current_user_can( 'manage_options' ) ) {
http_response_code( 403 );
exit( 'Forbidden: Admin-Login erforderlich.' );
}
echo "=== Cache löschen ===\n\n"; echo "=== Cache löschen ===\n\n";
// Zähler // Zähler
File diff suppressed because it is too large Load Diff
+14 -3
View File
@@ -2,8 +2,16 @@
/** /**
* Hilfsskript: Finde Channel-ID für einen @Handle * Hilfsskript: Finde Channel-ID für einen @Handle
* Verwendet direkt die YouTube API (ohne WordPress) * Verwendet direkt die YouTube API (ohne WordPress)
*
* SICHERHEIT: Nur per CLI ausführbar (php get-channel-id.php @handle).
* Über den Browser aufgerufen bricht das Skript sofort ab.
*/ */
if ( php_sapi_name() !== 'cli' ) {
http_response_code( 403 );
exit( 'Forbidden: Dieses Skript darf nur per CLI ausgeführt werden.' );
}
// API Key aus wp-config.php lesen // API Key aus wp-config.php lesen
$wp_config_path = __DIR__ . '/../../../wp-config.php'; $wp_config_path = __DIR__ . '/../../../wp-config.php';
$api_key = ''; $api_key = '';
@@ -16,10 +24,13 @@ if ( file_exists( $wp_config_path ) ) {
} }
} }
// Fallback: Direkte Eingabe hier (NUR FÜR TESTS!) // Fallback: API Key per Umgebungsvariable übergeben (NUR FÜR TESTS!)
// Beispiel: YOUTUBE_API_KEY=dein_key php get-channel-id.php @handle
if ( empty( $api_key ) ) { if ( empty( $api_key ) ) {
// TEMPORÄR: Trage hier deinen API Key ein $env_key = getenv( 'YOUTUBE_API_KEY' );
$api_key = 'AIzaSyD-jSXZO-R4NJBySF0WL6SoFJmBDk2Gdbk'; // ← Dein API Key aus dem Customizer if ( $env_key !== false ) {
$api_key = $env_key;
}
} }
if ( ! isset( $argv[1] ) ) { if ( ! isset( $argv[1] ) ) {
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="<?php bloginfo( 'charset' ); ?>"> <meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="strict-origin-when-cross-origin"> <meta name="referrer" content="strict-origin-when-cross-origin">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"> <?php // Font Awesome wird lokal über wp_enqueue_style() in functions.php geladen. ?>
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body <?php body_class(); ?>> <body <?php body_class(); ?>>
+161 -158
View File
@@ -1,158 +1,161 @@
(function($){ (function($){
$(document).ready(function(){ $(document).ready(function(){
const fonts = window.MM_Announcement_Fonts || {}; const fonts = window.MM_Announcement_Fonts || {};
const current = window.MM_Announcement_Current || {}; const current = window.MM_Announcement_Current || {};
const fontSelect = $('#mm-announcement-font'); const fontSelect = $('#mm-announcement-font');
const sizeInput = $('#mm-announcement-size'); const sizeInput = $('#mm-announcement-size');
const bgInput = $('#mm-announcement-bg'); const bgInput = $('#mm-announcement-bg');
const colorInput = $('#mm-announcement-color'); const colorInput = $('#mm-announcement-color');
const previewText = $('#mm-announcement-preview-text'); const previewText = $('#mm-announcement-preview-text');
const previewWrap = $('#mm-announcement-preview'); const previewWrap = $('#mm-announcement-preview');
const positionSelect = $('#mm-announcement-position'); const positionSelect = $('#mm-announcement-position');
// Helper: lädt Google-Font-Link oder updatet existing // Helper: bindet die lokal gehostete Schrift für die Vorschau ein.
function ensureGoogleFont(googleName) { // Kein Aufruf von fonts.googleapis.com die Dateien liegen im Theme
if (!googleName) return; // unter /fonts/<slug>/font.css (siehe mm_enqueue_local_font() in PHP).
const id = 'mm-admin-google-font'; function ensureLocalFont(fontKey) {
const href = 'https://fonts.googleapis.com/css2?family=' + encodeURIComponent(googleName) + ':wght@400;700&display=swap'; if (!fontKey || !current.fontsBase) return;
let link = document.getElementById(id); const slug = String(fontKey).toLowerCase().replace(/ /g, '-');
if (link) { const id = 'mm-admin-local-font';
if (link.getAttribute('href') !== href) link.setAttribute('href', href); const href = current.fontsBase + slug + '/font.css';
} else { let link = document.getElementById(id);
link = document.createElement('link'); if (link) {
link.id = id; if (link.getAttribute('href') !== href) link.setAttribute('href', href);
link.rel = 'stylesheet'; } else {
link.href = href; link = document.createElement('link');
document.head.appendChild(link); link.id = id;
} link.rel = 'stylesheet';
} link.href = href;
document.head.appendChild(link);
// Update preview appearance based on font key }
function updatePreviewForFontKey(key) { }
const meta = fonts[key];
if (!meta) { // Update preview appearance based on font key
previewText.css('font-family', ''); function updatePreviewForFontKey(key) {
return; const meta = fonts[key];
} if (!meta) {
previewText.css('font-family', meta.css); previewText.css('font-family', '');
if (meta.google && meta.google_name) { return;
ensureGoogleFont(meta.google_name); }
} previewText.css('font-family', meta.css);
} if (meta.google) {
ensureLocalFont(key);
// Update size/colors/position UI }
function updateSizeAndColors() { }
const size = parseInt(sizeInput.val(), 10) || 16;
previewText.css('font-size', size + 'px'); // Update size/colors/position UI
previewWrap.css('background', bgInput.val()); function updateSizeAndColors() {
previewWrap.css('color', colorInput.val()); const size = parseInt(sizeInput.val(), 10) || 16;
} previewText.css('font-size', size + 'px');
previewWrap.css('background', bgInput.val());
// Read content from wp_editor (TinyMCE) or textarea previewWrap.css('color', colorInput.val());
function getEditorText() { }
// Try TinyMCE first
if ( typeof tinymce !== 'undefined' ) { // Read content from wp_editor (TinyMCE) or textarea
try { function getEditorText() {
const ed = tinymce.get('mm_announcement_text'); // Try TinyMCE first
if (ed && !ed.isHidden()) { if ( typeof tinymce !== 'undefined' ) {
// getContent then strip tags try {
const html = ed.getContent({format: 'html'}); const ed = tinymce.get('mm_announcement_text');
const tmp = document.createElement('div'); if (ed && !ed.isHidden()) {
tmp.innerHTML = html; // getContent then strip tags
return tmp.textContent || tmp.innerText || ''; const html = ed.getContent({format: 'html'});
} const tmp = document.createElement('div');
} catch (e) { tmp.innerHTML = html;
// ignore return tmp.textContent || tmp.innerText || '';
} }
} } catch (e) {
// Fallback to textarea // ignore
const ta = $('#mm_announcement_text'); }
if (ta.length) { }
const tmp = document.createElement('div'); // Fallback to textarea
tmp.innerHTML = ta.val(); const ta = $('#mm_announcement_text');
return tmp.textContent || tmp.innerText || ''; if (ta.length) {
} const tmp = document.createElement('div');
return ''; tmp.innerHTML = ta.val();
} return tmp.textContent || tmp.innerText || '';
}
// Update preview text from editor content return '';
function updatePreviewTextFromEditor() { }
const text = getEditorText();
if (text && text.trim().length) { // Update preview text from editor content
previewText.text(text.trim()); function updatePreviewTextFromEditor() {
} else { const text = getEditorText();
previewText.text(current.text || 'Das ist eine Vorschau: Wie sieht die Schrift aus?'); if (text && text.trim().length) {
} previewText.text(text.trim());
} } else {
previewText.text(current.text || 'Das ist eine Vorschau: Wie sieht die Schrift aus?');
// Initialize controls with current settings }
if (current.font) { }
updatePreviewForFontKey(current.font);
fontSelect.val(current.font); // Initialize controls with current settings
} else { if (current.font) {
updatePreviewForFontKey(fontSelect.val()); updatePreviewForFontKey(current.font);
} fontSelect.val(current.font);
if (current.size) sizeInput.val(current.size); } else {
if (current.bg) bgInput.val(current.bg); updatePreviewForFontKey(fontSelect.val());
if (current.color) colorInput.val(current.color); }
if (current.size) sizeInput.val(current.size);
updateSizeAndColors(); if (current.bg) bgInput.val(current.bg);
updatePreviewTextFromEditor(); if (current.color) colorInput.val(current.color);
// Attach events -------------------------------------------------- updateSizeAndColors();
updatePreviewTextFromEditor();
// font change
fontSelect.on('change', function(){ // Attach events --------------------------------------------------
const key = $(this).val();
updatePreviewForFontKey(key); // font change
}); fontSelect.on('change', function(){
const key = $(this).val();
// size/color/position change updatePreviewForFontKey(key);
sizeInput.on('input change', updateSizeAndColors ); });
bgInput.on('input change', updateSizeAndColors );
colorInput.on('input change', updateSizeAndColors ); // size/color/position change
sizeInput.on('input change', updateSizeAndColors );
// Editor changes: bgInput.on('input change', updateSizeAndColors );
// - TinyMCE: listen for keyup / change events when editor is ready colorInput.on('input change', updateSizeAndColors );
// - Textarea: listen for input
function attachEditorListeners() { // Editor changes:
// TinyMCE // - TinyMCE: listen for keyup / change events when editor is ready
if ( typeof tinymce !== 'undefined' ) { // - Textarea: listen for input
const ed = tinymce.get('mm_announcement_text'); function attachEditorListeners() {
if (ed) { // TinyMCE
ed.on('keyup change NodeChange', function(){ if ( typeof tinymce !== 'undefined' ) {
updatePreviewTextFromEditor(); const ed = tinymce.get('mm_announcement_text');
}); if (ed) {
} ed.on('keyup change NodeChange', function(){
} updatePreviewTextFromEditor();
});
// Textarea fallback }
$('#mm_announcement_text').on('input change', function(){ }
updatePreviewTextFromEditor();
}); // Textarea fallback
} $('#mm_announcement_text').on('input change', function(){
updatePreviewTextFromEditor();
// TinyMCE initialisation might be async — poll short time then attach });
let tries = 0; }
const waitForEditor = setInterval(function(){
tries++; // TinyMCE initialisation might be async — poll short time then attach
if ( (typeof tinymce !== 'undefined' && tinymce.get('mm_announcement_text')) || $('#mm_announcement_text').length ) { let tries = 0;
clearInterval(waitForEditor); const waitForEditor = setInterval(function(){
attachEditorListeners(); tries++;
} else if (tries > 30) { // about 3s if ( (typeof tinymce !== 'undefined' && tinymce.get('mm_announcement_text')) || $('#mm_announcement_text').length ) {
clearInterval(waitForEditor); clearInterval(waitForEditor);
// still attach textarea event just in case attachEditorListeners();
$('#mm_announcement_text').on('input change', updatePreviewTextFromEditor); } else if (tries > 30) { // about 3s
} clearInterval(waitForEditor);
}, 100); // still attach textarea event just in case
$('#mm_announcement_text').on('input change', updatePreviewTextFromEditor);
// Also update preview when the form is programmatically changed (e.g., quicktags) }
$(document).on('change', '#mm-announcement-font, #mm-announcement-size, #mm-announcement-bg, #mm-announcement-color', function(){ }, 100);
updateSizeAndColors();
updatePreviewForFontKey($('#mm-announcement-font').val()); // Also update preview when the form is programmatically changed (e.g., quicktags)
updatePreviewTextFromEditor(); $(document).on('change', '#mm-announcement-font, #mm-announcement-size, #mm-announcement-bg, #mm-announcement-color', function(){
}); updateSizeAndColors();
updatePreviewForFontKey($('#mm-announcement-font').val());
}); updatePreviewTextFromEditor();
})(jQuery); });
});
})(jQuery);
+49 -49
View File
@@ -1,50 +1,50 @@
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const heroSlider = document.querySelector('.hero-slider'); const heroSlider = document.querySelector('.hero-slider');
if (!heroSlider) return; if (!heroSlider) return;
// BUG-FIX: sliderSettings wird via wp_localize_script gesetzt. Fehlt es // BUG-FIX: sliderSettings wird via wp_localize_script gesetzt. Fehlt es
// (z.B. wegen Caching oder falschem Enqueue), würde ein ReferenceError // (z.B. wegen Caching oder falschem Enqueue), würde ein ReferenceError
// den gesamten Slider-Init abschießen. // den gesamten Slider-Init abschießen.
if (typeof sliderSettings === 'undefined') { if (typeof sliderSettings === 'undefined') {
console.warn('Minecraft Modern Theme: sliderSettings nicht gefunden. Slider wird nicht initialisiert.'); console.warn('Minecraft Modern Theme: sliderSettings nicht gefunden. Slider wird nicht initialisiert.');
heroSlider.classList.add('swiper-initialized'); // Opacity-Fix trotzdem aufheben heroSlider.classList.add('swiper-initialized'); // Opacity-Fix trotzdem aufheben
return; return;
} }
const swiperConfig = { const swiperConfig = {
effect: 'fade', effect: 'fade',
fadeEffect: { fadeEffect: {
crossFade: true crossFade: true
}, },
loop: sliderSettings.loop === '1', loop: sliderSettings.loop === '1',
autoplay: { autoplay: {
delay: 5000, delay: 5000,
disableOnInteraction: false, disableOnInteraction: false,
}, },
pauseOnMouseEnter: true, pauseOnMouseEnter: true,
navigation: sliderSettings.hideArrows !== '1' ? { navigation: sliderSettings.hideArrows !== '1' ? {
nextEl: '.swiper-button-next', nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev', prevEl: '.swiper-button-prev',
} : false, } : false,
pagination: sliderSettings.hidePagination !== '1' ? { pagination: sliderSettings.hidePagination !== '1' ? {
el: '.swiper-pagination', el: '.swiper-pagination',
clickable: true, clickable: true,
} : false, } : false,
on: { on: {
init: function () { init: function () {
setTimeout(function() { setTimeout(function() {
heroSlider.classList.add('swiper-initialized'); heroSlider.classList.add('swiper-initialized');
}, 50); }, 50);
}, },
}, },
}; };
new Swiper('.hero-slider', swiperConfig); new Swiper('.hero-slider', swiperConfig);
}); });
File diff suppressed because one or more lines are too long
+5
View File
@@ -2,6 +2,11 @@
define('WP_USE_THEMES', false); define('WP_USE_THEMES', false);
require('../../../wp-load.php'); require('../../../wp-load.php');
if ( php_sapi_name() !== 'cli' && ! current_user_can( 'manage_options' ) ) {
http_response_code( 403 );
exit( 'Forbidden: Admin-Login erforderlich.' );
}
$posts = get_posts(array( $posts = get_posts(array(
'post_type' => 'mm_livestream', 'post_type' => 'mm_livestream',
'posts_per_page' => -1, 'posts_per_page' => -1,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.