Upload via GUI (182 Dateien)
This commit is contained in:
@@ -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
@@ -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] ) ) {
|
||||||
|
|||||||
@@ -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(); ?>>
|
||||||
|
|||||||
@@ -11,11 +11,14 @@
|
|||||||
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;
|
||||||
|
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);
|
let link = document.getElementById(id);
|
||||||
if (link) {
|
if (link) {
|
||||||
if (link.getAttribute('href') !== href) link.setAttribute('href', href);
|
if (link.getAttribute('href') !== href) link.setAttribute('href', href);
|
||||||
@@ -36,8 +39,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
previewText.css('font-family', meta.css);
|
previewText.css('font-family', meta.css);
|
||||||
if (meta.google && meta.google_name) {
|
if (meta.google) {
|
||||||
ensureGoogleFont(meta.google_name);
|
ensureLocalFont(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
File diff suppressed because one or more lines are too long
@@ -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.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user