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);
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;
$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%'");
@@ -6,6 +6,11 @@
define('WP_USE_THEMES', false);
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";
// 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
* 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
$wp_config_path = __DIR__ . '/../../../wp-config.php';
$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 ) ) {
// TEMPORÄR: Trage hier deinen API Key ein
$api_key = 'AIzaSyD-jSXZO-R4NJBySF0WL6SoFJmBDk2Gdbk'; // ← Dein API Key aus dem Customizer
$env_key = getenv( 'YOUTUBE_API_KEY' );
if ( $env_key !== false ) {
$api_key = $env_key;
}
}
if ( ! isset( $argv[1] ) ) {
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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(); ?>
</head>
<body <?php body_class(); ?>>
+161 -158
View File
@@ -1,158 +1,161 @@
(function($){
$(document).ready(function(){
const fonts = window.MM_Announcement_Fonts || {};
const current = window.MM_Announcement_Current || {};
const fontSelect = $('#mm-announcement-font');
const sizeInput = $('#mm-announcement-size');
const bgInput = $('#mm-announcement-bg');
const colorInput = $('#mm-announcement-color');
const previewText = $('#mm-announcement-preview-text');
const previewWrap = $('#mm-announcement-preview');
const positionSelect = $('#mm-announcement-position');
// Helper: lädt Google-Font-Link oder updatet existing
function ensureGoogleFont(googleName) {
if (!googleName) return;
const id = 'mm-admin-google-font';
const href = 'https://fonts.googleapis.com/css2?family=' + encodeURIComponent(googleName) + ':wght@400;700&display=swap';
let link = document.getElementById(id);
if (link) {
if (link.getAttribute('href') !== href) link.setAttribute('href', href);
} else {
link = document.createElement('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) {
previewText.css('font-family', '');
return;
}
previewText.css('font-family', meta.css);
if (meta.google && meta.google_name) {
ensureGoogleFont(meta.google_name);
}
}
// Update size/colors/position UI
function updateSizeAndColors() {
const size = parseInt(sizeInput.val(), 10) || 16;
previewText.css('font-size', size + 'px');
previewWrap.css('background', bgInput.val());
previewWrap.css('color', colorInput.val());
}
// Read content from wp_editor (TinyMCE) or textarea
function getEditorText() {
// Try TinyMCE first
if ( typeof tinymce !== 'undefined' ) {
try {
const ed = tinymce.get('mm_announcement_text');
if (ed && !ed.isHidden()) {
// getContent then strip tags
const html = ed.getContent({format: 'html'});
const tmp = document.createElement('div');
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || '';
}
} catch (e) {
// ignore
}
}
// Fallback to textarea
const ta = $('#mm_announcement_text');
if (ta.length) {
const tmp = document.createElement('div');
tmp.innerHTML = ta.val();
return tmp.textContent || tmp.innerText || '';
}
return '';
}
// Update preview text from editor content
function updatePreviewTextFromEditor() {
const text = getEditorText();
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);
} else {
updatePreviewForFontKey(fontSelect.val());
}
if (current.size) sizeInput.val(current.size);
if (current.bg) bgInput.val(current.bg);
if (current.color) colorInput.val(current.color);
updateSizeAndColors();
updatePreviewTextFromEditor();
// Attach events --------------------------------------------------
// font change
fontSelect.on('change', function(){
const key = $(this).val();
updatePreviewForFontKey(key);
});
// size/color/position change
sizeInput.on('input change', updateSizeAndColors );
bgInput.on('input change', updateSizeAndColors );
colorInput.on('input change', updateSizeAndColors );
// Editor changes:
// - TinyMCE: listen for keyup / change events when editor is ready
// - Textarea: listen for input
function attachEditorListeners() {
// TinyMCE
if ( typeof tinymce !== 'undefined' ) {
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();
});
}
// TinyMCE initialisation might be async — poll short time then attach
let tries = 0;
const waitForEditor = setInterval(function(){
tries++;
if ( (typeof tinymce !== 'undefined' && tinymce.get('mm_announcement_text')) || $('#mm_announcement_text').length ) {
clearInterval(waitForEditor);
attachEditorListeners();
} else if (tries > 30) { // about 3s
clearInterval(waitForEditor);
// still attach textarea event just in case
$('#mm_announcement_text').on('input change', updatePreviewTextFromEditor);
}
}, 100);
// 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(){
updateSizeAndColors();
updatePreviewForFontKey($('#mm-announcement-font').val());
updatePreviewTextFromEditor();
});
});
})(jQuery);
(function($){
$(document).ready(function(){
const fonts = window.MM_Announcement_Fonts || {};
const current = window.MM_Announcement_Current || {};
const fontSelect = $('#mm-announcement-font');
const sizeInput = $('#mm-announcement-size');
const bgInput = $('#mm-announcement-bg');
const colorInput = $('#mm-announcement-color');
const previewText = $('#mm-announcement-preview-text');
const previewWrap = $('#mm-announcement-preview');
const positionSelect = $('#mm-announcement-position');
// Helper: bindet die lokal gehostete Schrift für die Vorschau ein.
// Kein Aufruf von fonts.googleapis.com die Dateien liegen im Theme
// unter /fonts/<slug>/font.css (siehe mm_enqueue_local_font() in PHP).
function ensureLocalFont(fontKey) {
if (!fontKey || !current.fontsBase) return;
const slug = String(fontKey).toLowerCase().replace(/ /g, '-');
const id = 'mm-admin-local-font';
const href = current.fontsBase + slug + '/font.css';
let link = document.getElementById(id);
if (link) {
if (link.getAttribute('href') !== href) link.setAttribute('href', href);
} else {
link = document.createElement('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) {
previewText.css('font-family', '');
return;
}
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');
previewWrap.css('background', bgInput.val());
previewWrap.css('color', colorInput.val());
}
// Read content from wp_editor (TinyMCE) or textarea
function getEditorText() {
// Try TinyMCE first
if ( typeof tinymce !== 'undefined' ) {
try {
const ed = tinymce.get('mm_announcement_text');
if (ed && !ed.isHidden()) {
// getContent then strip tags
const html = ed.getContent({format: 'html'});
const tmp = document.createElement('div');
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || '';
}
} catch (e) {
// ignore
}
}
// Fallback to textarea
const ta = $('#mm_announcement_text');
if (ta.length) {
const tmp = document.createElement('div');
tmp.innerHTML = ta.val();
return tmp.textContent || tmp.innerText || '';
}
return '';
}
// Update preview text from editor content
function updatePreviewTextFromEditor() {
const text = getEditorText();
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);
} else {
updatePreviewForFontKey(fontSelect.val());
}
if (current.size) sizeInput.val(current.size);
if (current.bg) bgInput.val(current.bg);
if (current.color) colorInput.val(current.color);
updateSizeAndColors();
updatePreviewTextFromEditor();
// Attach events --------------------------------------------------
// font change
fontSelect.on('change', function(){
const key = $(this).val();
updatePreviewForFontKey(key);
});
// size/color/position change
sizeInput.on('input change', updateSizeAndColors );
bgInput.on('input change', updateSizeAndColors );
colorInput.on('input change', updateSizeAndColors );
// Editor changes:
// - TinyMCE: listen for keyup / change events when editor is ready
// - Textarea: listen for input
function attachEditorListeners() {
// TinyMCE
if ( typeof tinymce !== 'undefined' ) {
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();
});
}
// TinyMCE initialisation might be async — poll short time then attach
let tries = 0;
const waitForEditor = setInterval(function(){
tries++;
if ( (typeof tinymce !== 'undefined' && tinymce.get('mm_announcement_text')) || $('#mm_announcement_text').length ) {
clearInterval(waitForEditor);
attachEditorListeners();
} else if (tries > 30) { // about 3s
clearInterval(waitForEditor);
// still attach textarea event just in case
$('#mm_announcement_text').on('input change', updatePreviewTextFromEditor);
}
}, 100);
// 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(){
updateSizeAndColors();
updatePreviewForFontKey($('#mm-announcement-font').val());
updatePreviewTextFromEditor();
});
});
})(jQuery);
+49 -49
View File
@@ -1,50 +1,50 @@
document.addEventListener('DOMContentLoaded', function() {
const heroSlider = document.querySelector('.hero-slider');
if (!heroSlider) return;
// BUG-FIX: sliderSettings wird via wp_localize_script gesetzt. Fehlt es
// (z.B. wegen Caching oder falschem Enqueue), würde ein ReferenceError
// den gesamten Slider-Init abschießen.
if (typeof sliderSettings === 'undefined') {
console.warn('Minecraft Modern Theme: sliderSettings nicht gefunden. Slider wird nicht initialisiert.');
heroSlider.classList.add('swiper-initialized'); // Opacity-Fix trotzdem aufheben
return;
}
const swiperConfig = {
effect: 'fade',
fadeEffect: {
crossFade: true
},
loop: sliderSettings.loop === '1',
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
pauseOnMouseEnter: true,
navigation: sliderSettings.hideArrows !== '1' ? {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
} : false,
pagination: sliderSettings.hidePagination !== '1' ? {
el: '.swiper-pagination',
clickable: true,
} : false,
on: {
init: function () {
setTimeout(function() {
heroSlider.classList.add('swiper-initialized');
}, 50);
},
},
};
new Swiper('.hero-slider', swiperConfig);
document.addEventListener('DOMContentLoaded', function() {
const heroSlider = document.querySelector('.hero-slider');
if (!heroSlider) return;
// BUG-FIX: sliderSettings wird via wp_localize_script gesetzt. Fehlt es
// (z.B. wegen Caching oder falschem Enqueue), würde ein ReferenceError
// den gesamten Slider-Init abschießen.
if (typeof sliderSettings === 'undefined') {
console.warn('Minecraft Modern Theme: sliderSettings nicht gefunden. Slider wird nicht initialisiert.');
heroSlider.classList.add('swiper-initialized'); // Opacity-Fix trotzdem aufheben
return;
}
const swiperConfig = {
effect: 'fade',
fadeEffect: {
crossFade: true
},
loop: sliderSettings.loop === '1',
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
pauseOnMouseEnter: true,
navigation: sliderSettings.hideArrows !== '1' ? {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
} : false,
pagination: sliderSettings.hidePagination !== '1' ? {
el: '.swiper-pagination',
clickable: true,
} : false,
on: {
init: function () {
setTimeout(function() {
heroSlider.classList.add('swiper-initialized');
}, 50);
},
},
};
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);
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(
'post_type' => 'mm_livestream',
'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.