Update from Git Manager GUI
This commit is contained in:
@@ -707,7 +707,7 @@ class WBF_Shortcodes {
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!empty($thread->signature)): ?>
|
||||
<div class="wbf-signature"><div class="wbf-signature__divider"></div><?php echo nl2br(esc_html($thread->signature)); ?></div>
|
||||
<div class="wbf-signature"><div class="wbf-signature__divider"></div><?php echo WBF_BBCode::render($thread->signature); ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="wbf-post__footer">
|
||||
<span class="wbf-post__date"><?php echo self::time_ago($thread->created_at); ?></span>
|
||||
@@ -844,7 +844,7 @@ class WBF_Shortcodes {
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!empty($post->signature)): ?>
|
||||
<div class="wbf-signature"><div class="wbf-signature__divider"></div><?php echo nl2br(esc_html($post->signature)); ?></div>
|
||||
<div class="wbf-signature"><div class="wbf-signature__divider"></div><?php echo WBF_BBCode::render($post->signature); ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="wbf-post__footer">
|
||||
<span class="wbf-post__date"><?php echo self::time_ago($post->created_at); ?></span>
|
||||
@@ -994,13 +994,13 @@ class WBF_Shortcodes {
|
||||
<?php if (!empty($profile->bio)): ?>
|
||||
<div class="wbf-profile-sidebar__section">
|
||||
<span class="wbf-profile-sidebar__section-label"><i class="fas fa-align-left"></i> Bio</span>
|
||||
<p><?php echo nl2br(esc_html($profile->bio)); ?></p>
|
||||
<p><?php echo WBF_BBCode::render($profile->bio); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($profile->signature)): ?>
|
||||
<div class="wbf-profile-sidebar__section">
|
||||
<span class="wbf-profile-sidebar__section-label"><i class="fas fa-pen-nib"></i> Signatur</span>
|
||||
<p class="wbf-profile-sidebar__sig"><?php echo nl2br(esc_html($profile->signature)); ?></p>
|
||||
<p class="wbf-profile-sidebar__sig"><?php echo WBF_BBCode::render($profile->signature); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- Öffentliche Custom Fields — nach Kategorie gruppiert -->
|
||||
@@ -1113,10 +1113,13 @@ class WBF_Shortcodes {
|
||||
class="wbf-profile-tab<?php echo $active_tab===4?' active':''; ?>">
|
||||
<i class="fas fa-lock"></i> Sicherheit
|
||||
</a>
|
||||
<?php if ( class_exists('MC_Gallery_Forum_Bridge') ) : ?>
|
||||
<?php
|
||||
// „Verbindungen" Tab — immer sichtbar (Discord eingebaut, MC optional)
|
||||
$wbf_has_connections = true;
|
||||
if ( $wbf_has_connections ) : ?>
|
||||
<a href="?forum_profile=<?php echo (int)$profile->id; ?>&ptab=mc"
|
||||
class="wbf-profile-tab<?php echo $active_tab==='mc'?' active':''; ?>">
|
||||
<i class="fas fa-cubes"></i> Minecraft
|
||||
<i class="fas fa-plug"></i> Verbindungen
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1139,10 +1142,12 @@ class WBF_Shortcodes {
|
||||
</div>
|
||||
<div class="wbf-form-row">
|
||||
<label>Bio</label>
|
||||
<?php self::render_editor_toolbar('wbfEditBio'); ?>
|
||||
<textarea id="wbfEditBio" rows="2"><?php echo esc_textarea($profile->bio); ?></textarea>
|
||||
</div>
|
||||
<div class="wbf-form-row">
|
||||
<label>Signatur <small>(max. 300 Zeichen)</small></label>
|
||||
<?php self::render_editor_toolbar('wbfEditSignature'); ?>
|
||||
<textarea id="wbfEditSignature" rows="2" maxlength="300" placeholder="Deine Signatur…"><?php echo esc_textarea($profile->signature ?? ''); ?></textarea>
|
||||
<div class="wbf-sig-counter"><span id="wbfSigCount"><?php echo mb_strlen($profile->signature??''); ?></span>/300</div>
|
||||
</div>
|
||||
@@ -1535,12 +1540,118 @@ class WBF_Shortcodes {
|
||||
<?php endif; /* end Tab 4 */ ?>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════
|
||||
TAB MC — Minecraft-Konto verknüpfen (Bridge)
|
||||
Wird nur gerendert wenn MC Gallery Forum Bridge aktiv ist.
|
||||
TAB MC — Verbindungen (Externe Dienste verknüpfen)
|
||||
Wird nur gerendert wenn mind. eine Integration aktiv ist.
|
||||
Neue Integrationen: einfach weiteres .wbf-connection-card-Block
|
||||
via apply_filters('wbf_profile_connections', ...) hinzufügen.
|
||||
══════════════════════════════════════════════════ -->
|
||||
<?php if ( $is_own && $active_tab === 'mc' && class_exists('MC_Gallery_Forum_Bridge') ) :
|
||||
echo apply_filters('wbf_profile_tab_content', '', 'minecraft', $profile);
|
||||
endif; /* end Tab MC */ ?>
|
||||
<?php if ( $is_own && $active_tab === 'mc' ) : ?>
|
||||
|
||||
<div class="wbf-profile-card">
|
||||
<div class="wbf-profile-card__header">
|
||||
<i class="fas fa-plug"></i> Verbundene Dienste
|
||||
</div>
|
||||
<div class="wbf-profile-card__body" style="padding:0">
|
||||
|
||||
<?php if ( class_exists('MC_Gallery_Forum_Bridge') ) :
|
||||
$mc_content = apply_filters('wbf_profile_tab_content', '', 'minecraft', $profile);
|
||||
?>
|
||||
<div class="wbf-connection-card">
|
||||
<div class="wbf-connection-card__icon" style="background:rgba(101,163,13,.15);border-color:rgba(101,163,13,.3)">
|
||||
<i class="fas fa-cubes" style="color:#65a30d"></i>
|
||||
</div>
|
||||
<div class="wbf-connection-card__head">
|
||||
<span class="wbf-connection-card__title">Minecraft</span>
|
||||
</div>
|
||||
<div class="wbf-connection-card__content">
|
||||
<?php echo $mc_content; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// ── Discord-Card (eingebaut, kein extra Plugin nötig) ──────────────
|
||||
$discord_meta = WBF_DB::get_user_meta( $profile->id );
|
||||
$discord_current = trim( $discord_meta['discord_username'] ?? '' );
|
||||
$discord_connected = $discord_current !== '';
|
||||
?>
|
||||
<?php
|
||||
$s = wbf_get_settings();
|
||||
$discord_bot_configured = ! empty( trim( $s['discord_bot_token'] ?? '' ) );
|
||||
?>
|
||||
<div class="wbf-connection-card wbf-connection-card--discord">
|
||||
<div class="wbf-connection-card__icon">
|
||||
<i class="fab fa-discord"></i>
|
||||
</div>
|
||||
<div class="wbf-connection-card__head">
|
||||
<span class="wbf-connection-card__title">Discord</span>
|
||||
<?php if ( $discord_connected ) : ?>
|
||||
<span class="wbf-connection-badge wbf-connection-badge--connected">
|
||||
<i class="fas fa-check-circle"></i> Verbunden
|
||||
</span>
|
||||
<?php else : ?>
|
||||
<span class="wbf-connection-badge wbf-connection-badge--disconnected">
|
||||
<i class="fas fa-circle-xmark"></i> Nicht verbunden
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="wbf-connection-card__content">
|
||||
|
||||
<?php if ( $discord_connected ) : ?>
|
||||
<!-- ── Bereits verbunden ── -->
|
||||
<div class="wbf-discord-connected-info">
|
||||
<span class="wbf-discord-linked-name">
|
||||
<i class="fab fa-discord" style="color:#5865f2"></i>
|
||||
<?php echo esc_html( $discord_current ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="wbf-connect-row" style="margin-top:.75rem">
|
||||
<button type="button" class="wbf-btn wbf-btn--primary" id="wbf-discord-relink">
|
||||
<i class="fas fa-rotate"></i> Neu verknüpfen
|
||||
</button>
|
||||
<button type="button" class="wbf-btn wbf-btn--ghost" id="wbf-discord-disconnect">
|
||||
<i class="fas fa-unlink"></i> Trennen
|
||||
</button>
|
||||
</div>
|
||||
<div id="wbf-discord-msg" style="margin-top:.5rem;font-size:.82rem"></div>
|
||||
|
||||
<!-- Formular (standardmäßig ausgeblendet, bei "Neu verknüpfen" sichtbar) -->
|
||||
<div id="wbf-discord-form" style="display:none;margin-top:1rem">
|
||||
<?php self::render_discord_form( $discord_bot_configured ); ?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
<!-- ── Noch nicht verbunden ── -->
|
||||
<p class="wbf-connection-card__desc">
|
||||
Verknüpfe deinen Discord-Account mit deinem Profil.
|
||||
<?php if ( $discord_bot_configured ) : ?>
|
||||
Ein Bestätigungs-Code wird dir per Discord-DM zugeschickt.
|
||||
<?php else : ?>
|
||||
<em style="color:var(--c-muted)">(Bot noch nicht konfiguriert – wende dich an einen Admin.)</em>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<div id="wbf-discord-msg" style="margin-top:.3rem;font-size:.82rem"></div>
|
||||
<div id="wbf-discord-form">
|
||||
<?php self::render_discord_form( $discord_bot_configured ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Hook für weitere Verbindungen (z.B. Steam, Twitch, …)
|
||||
// Nutzung: add_filter('wbf_profile_connections', function($html, $profile) {
|
||||
// return $html . '<div class="wbf-connection-card">…</div>';
|
||||
// }, 10, 2);
|
||||
echo apply_filters('wbf_profile_connections', '', $profile);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; /* end Tab MC */ ?>
|
||||
|
||||
</div><!-- /.wbf-profile-main -->
|
||||
</div><!-- /.wbf-profile-layout -->
|
||||
@@ -1552,6 +1663,58 @@ class WBF_Shortcodes {
|
||||
|
||||
// ── TAG PAGE ─────────────────────────────────────────────────────────────
|
||||
|
||||
// ── Discord Verifikations-Formular (3-Schritt) ────────────────────────────
|
||||
|
||||
private static function render_discord_form( $bot_configured ) { ?>
|
||||
<?php if ( ! $bot_configured ) : ?>
|
||||
<p style="color:var(--c-muted);font-size:.83rem;margin:0">
|
||||
<i class="fas fa-triangle-exclamation"></i>
|
||||
Discord-Bot noch nicht eingerichtet. Bitte Admin kontaktieren.
|
||||
</p>
|
||||
<?php else : ?>
|
||||
<!-- Schritt 1: Benutzername eingeben -->
|
||||
<div id="wbf-dc-step1">
|
||||
<label>DISCORD-BENUTZERNAME</label>
|
||||
<div class="wbf-connect-row">
|
||||
<input type="text"
|
||||
id="wbf-discord-input"
|
||||
placeholder="z. B. MvViper"
|
||||
maxlength="40"
|
||||
autocomplete="off">
|
||||
<button type="button" class="wbf-btn wbf-btn--primary" id="wbf-discord-send-code">
|
||||
<i class="fab fa-discord"></i> Code senden
|
||||
</button>
|
||||
</div>
|
||||
<p style="font-size:.78rem;color:var(--c-muted);margin:.45rem 0 0">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
Du musst Mitglied unseres Discord-Servers sein und DMs erlauben.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Schritt 2: Code eingeben (zunächst ausgeblendet) -->
|
||||
<div id="wbf-dc-step2" style="display:none;margin-top:.9rem">
|
||||
<label>BESTÄTIGUNGS-CODE (aus Discord-DM)</label>
|
||||
<div class="wbf-connect-row">
|
||||
<input type="text"
|
||||
id="wbf-discord-code-input"
|
||||
placeholder="A1B2C3"
|
||||
maxlength="6"
|
||||
autocomplete="off"
|
||||
style="font-family:monospace;letter-spacing:.15em;text-transform:uppercase;max-width:140px">
|
||||
<button type="button" class="wbf-btn wbf-btn--primary" id="wbf-discord-verify">
|
||||
<i class="fas fa-check"></i> Bestätigen
|
||||
</button>
|
||||
<button type="button" class="wbf-btn wbf-btn--ghost" id="wbf-discord-code-back">
|
||||
<i class="fas fa-arrow-left"></i> Zurück
|
||||
</button>
|
||||
</div>
|
||||
<p style="font-size:.78rem;color:var(--c-muted);margin:.45rem 0 0">
|
||||
<i class="fas fa-clock"></i> Code ist 10 Minuten gültig.
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php }
|
||||
|
||||
private static function view_tag() {
|
||||
$slug = sanitize_title( $_GET['forum_tag'] ?? '' );
|
||||
$tag = WBF_DB::get_tag($slug);
|
||||
@@ -2416,7 +2579,16 @@ class WBF_Shortcodes {
|
||||
</div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php if (WBF_Roles::level($current->role) >= 80): // Nur Admins/Mods ?>
|
||||
<div style="margin-top:2.5rem;text-align:center">
|
||||
<button class="wbf-btn wbf-btn--primary" id="wbf-discord-sync-btn" type="button">
|
||||
<i class="fab fa-discord"></i> Discord-Rollen-Sync manuell anstoßen
|
||||
</button>
|
||||
<span id="wbf-discord-sync-msg" style="margin-left:1rem;font-size:.95em;display:none"></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (empty($members)): ?>
|
||||
<div class="wbf-empty" style="grid-column:1/-1">
|
||||
<i class="fas fa-users-slash"></i>
|
||||
|
||||
Reference in New Issue
Block a user