"; if (!$online) return $img; return "$img"; } public static function role_badge( $role ) { // Dynamisch aus WBF_Roles — deckt alle Rollen inkl. superadmin ab return WBF_Roles::badge( $role ); } public static function render_prefix( $thread ) { if ( empty($thread->prefix_label) ) return ''; $label = esc_html($thread->prefix_label); $color = esc_attr($thread->prefix_color ?? '#fff'); $bg = esc_attr($thread->prefix_bg ?? '#475569'); return "{$label}"; } public static function render_tags( $tags, $small = false ) { if ( empty($tags) ) return ''; $cls = $small ? 'wbf-tag wbf-tag--sm' : 'wbf-tag'; $out = '
'; foreach ( $tags as $tag ) { $out .= '' . '' . esc_html($tag->name) . ''; } return $out . '
'; } private static function like_btn( $object_id, $type, $count, $liked = false ) { // Keep for thread likes (header area) $cls = $liked ? ' wbf-liked' : ''; return sprintf( '', $cls, $object_id, $type, $count ); } private static function reaction_bar( $object_id, $object_type, $current_user ) { $emojis = WBF_DB::get_allowed_reactions(); $user_id = $current_user ? (int)$current_user->id : 0; $data = WBF_DB::get_reactions($object_id, $object_type, $user_id); $counts = $data['counts']; $mine = $data['mine']; $total = array_sum($counts); $out = '
'; // Summary of existing reactions (clickable) if ($total > 0) { $out .= '
'; foreach ($emojis as $e) { if (!empty($counts[$e])) { $active = ($mine === $e) ? ' wbf-reaction-active' : ''; $out .= ''; } } $out .= '
'; } // Picker trigger (only for logged-in users with 'like' perm) if ($current_user && WBF_DB::can($current_user, 'like')) { $out .= '
' . '' . '
'; foreach ($emojis as $e) { $active = ($mine === $e) ? ' wbf-reaction-active' : ''; $out .= ''; } $out .= '
'; } $out .= '
'; return $out; } private static function mod_tools_thread( $thread, $current ) { if (!$current) return ''; // Only show mod bar to users who have at least one mod-level permission $can_pin = WBF_DB::can($current, 'pin_thread'); $can_close = WBF_DB::can($current, 'close_thread'); $can_delete = WBF_DB::can($current, 'delete_thread'); $can_move = WBF_DB::can($current, 'manage_cats'); if ( !$can_pin && !$can_close && !$can_delete && !$can_move ) return ''; $is_archived = $thread->status === 'archived'; $pin_label = $thread->pinned ? ' Entpinnen' : ' Pinnen'; $pin_action = $thread->pinned ? 'unpin_thread' : 'pin_thread'; $arch_action = $is_archived ? 'unarchive_thread' : 'archive_thread'; $arch_label = $is_archived ? ' Wiederherstellen' : ' Archivieren'; // Close/Open only makes sense on non-archived threads $cls_btn = ''; if ( !$is_archived && $can_close ) { $cls_action = $thread->status==='closed' ? 'open_thread' : 'close_thread'; $cls_label = $thread->status==='closed' ? ' Öffnen' : ' Schließen'; $cls_btn = ''; } $move_btn = $can_move ? '' : ''; $del_btn = $can_delete ? '' : ''; return '
Mod '.( $can_pin ? '' : '').' '.$cls_btn.' '.( $can_close ? '' : '').' '.$move_btn.' '.$del_btn.'
'; } private static function mod_tools_post( $post_id, $current ) { if (!$current || !WBF_DB::can($current,'delete_post')) return ''; return ''; } // ── Router ──────────────────────────────────────────────────────────────── public static function forum_main( $atts ) { // Server-seitiger Logout-Fallback if (isset($_GET['wbf_do_logout'])) { WBF_Auth::logout(); wp_redirect( wbf_get_forum_url() ); exit; } // ── Wartungsmodus — zentraler Check vor allem anderen ──────────────── $wbf_current_user = WBF_Auth::get_current_user(); $wbf_maint = wbf_get_settings()['maintenance_mode'] ?? '0'; if ( $wbf_maint === '1' ) { $is_staff = $wbf_current_user && WBF_Roles::level($wbf_current_user->role) >= 50; if ( ! $is_staff ) { return self::view_maintenance(); } } if (isset($_GET['forum_members'])) return self::view_members(); // Einladungscode aus URL vorausfüllen if (isset($_GET['wbf_invite'])) { $inv_code = strtoupper(sanitize_text_field($_GET['wbf_invite'])); if (!WBF_DB::verify_invite($inv_code)) { // Ungültiger Code — zeige Meldung ob_start(); ?>
Dieser Einladungslink ist ungültig oder bereits abgelaufen.
← Zurück zum Forum
guest_visible ?? 1) === 0 ) return false; // Min-Rolle: Nutzer muss mindestens diese Rolle haben um die Kategorie zu sehen if ( $cat->min_role && $cat->min_role !== 'member' ) { if ( ! $user ) return false; // nicht eingeloggt → versteckt wenn min_role > member if ( WBF_Roles::level($user->role) < WBF_Roles::level($cat->min_role) ) return false; } return true; } // ── HOME ────────────────────────────────────────────────────────────────── private static function view_home() { $current = WBF_Auth::get_current_user(); $tree = WBF_DB::get_categories_tree(); $stats = WBF_DB::get_stats(); $recent = WBF_DB::get_recent_threads(5); ob_start(); ?>

name); ?>

description); ?>

thread_count; ?> post_count; ?> min_role??'member') !== 'member'): ?> min_role)); ?>+
children)): ?>
children as $child): if (!self::can_see_category($current, $child)) continue; ?>
name); ?> description); ?>
thread_count; ?> post_count; ?> last_thread_title): ?> last_thread_title,0,30)); ?>…
Kategorie nicht gefunden.

'; $current = WBF_Auth::get_current_user(); // Zugang prüfen — Gäste + Min-Rolle if (!self::can_see_category($current, $cat)) { ob_start(); ?>
Diese Kategorie ist nur für eingeloggte Mitglieder sichtbar. Du hast keine Berechtigung um diese Kategorie zu sehen.
id, $page); $total = WBF_DB::count_threads($cat->id); $pages = ceil($total / 20) ?: 1; $children = WBF_DB::get_child_categories($cat->id); $crumbs = WBF_DB::get_category_breadcrumb($cat); ob_start(); ?>

name); ?>

description); ?>

Noch keine Threads. Starte die Diskussion!

id,$t->id,'thread') : false; ?>
avatar_url,$t->display_name); ?>
pinned): ?> status==='closed'): ?> Geschlossen title); ?>
von display_name); ?> author_role); ?> created_at); ?>
id); echo self::render_tags($row_tags, true); ?>
reply_count; ?> views; ?> id,'thread',$t->like_count,$liked); ?>
1): ?>
id, 1, 50); $arch_count = WBF_DB::count_archived_threads($cat->id); if ($arch_count > 0): ?>
Archivierte Threads
avatar_url,$at->display_name); ?>
Archiviert title); ?>
von display_name); ?> author_role); ?> created_at); ?>
reply_count; ?>
id); ?>
role) < 50 ) ) { return self::view_maintenance(); } $id = (int)($_GET['forum_thread'] ?? 0); $thread = WBF_DB::get_thread($id); if (!$thread) return '

Thread nicht gefunden.

'; // Kategorie-Zugang prüfen (Gäste + Min-Rolle) $cat6 = WBF_DB::get_category($thread->category_id); if ($cat6 && !self::can_see_category($cur6, $cat6)) { ob_start(); ?>
Dieser Thread ist nur für eingeloggte Mitglieder sichtbar. Du hast keine Berechtigung um diesen Thread zu sehen.
query($wpdb->prepare("UPDATE {$wpdb->prefix}forum_threads SET views=views+1 WHERE id=%d",$id)); $page = max(1,(int)($_GET['tp']??1)); $posts = WBF_DB::get_posts($id,$page,15); $total = WBF_DB::count_posts($id); $pages = ceil($total/15) ?: 1; $current = WBF_Auth::get_current_user(); $cat = WBF_DB::get_category($thread->category_id); $crumbs = $cat ? WBF_DB::get_category_breadcrumb($cat) : []; $t_liked = $current ? WBF_DB::has_liked($current->id,$id,'thread') : false; ob_start(); ?>

pinned): ?> status==='closed'): ?> status==='archived'): ?> Archiviert title); ?>

like_count,$t_liked); ?> id,$id); ?> reply_count; ?> Antworten views; ?> Views
id === (int)$thread->user_id && !$poll && $thread->status === 'open'; if ($can_add_poll): ?>
id); $my_votes = $current ? WBF_DB::get_user_votes($poll->id, $current->id) : []; $total = array_sum($results); $voted = !empty($my_votes); $expired = $poll->ends_at && strtotime($poll->ends_at) < time(); $show_results = $voted || $expired || !$current; ?>
question); ?> multi): ?>Mehrfachauswahl Beendet
options as $i => $opt): $votes = $results[$i] ?? 0; $pct = $total > 0 ? round($votes / $total * 100) : 0; $mine = in_array($i, $my_votes); ?>
% ()
options as $i => $opt): ?>
ends_at): ?>
id, $id, 'thread') : false; $op_can_edit = $current && ((int)$current->id === (int)$thread->user_id || WBF_DB::can($current,'delete_post')); ?>
content); ?>
signature)): ?>
signature)); ?>
id,$post->id,'post') : false; self::render_single_post($post,$current,$p_liked); endforeach; ?>
1): ?>
status==='open'): ?>

Antworten

avatar_url,$current->display_name,44); ?>
0 Zeichen
oder Registrieren um zu antworten.
Dieser Thread ist geschlossen.
id, $post->id, 'post') : false; ?>
user_id); echo self::avatar($post->avatar_url,$post->display_name,52,$p_online); ?> display_name); ?> author_role); ?> author_posts); ?>
Neu
content); ?>
signature)): ?>
signature)); ?>
Profil nicht gefunden.

'; $is_own = $current && $current->id == $profile->id; $is_staff = $current && WBF_Roles::level($current->role) >= 50; // Profil-Sichtbarkeit prüfen if (!$is_own && !$is_staff && (int)($profile->profile_public ?? 1) === 0) { ob_start(); ?>
Dieses Profil ist nicht öffentlich.
id, 50 ); $bookmarks = $is_own ? WBF_DB::get_user_bookmarks($current->id, 50) : []; $ignore_list = $is_own ? WBF_DB::get_ignore_list($current->id) : []; $cf_defs = WBF_DB::get_profile_field_defs(); $cf_vals = WBF_DB::get_user_meta( $profile->id ); // Aktiven Tab aus URL lesen (tab=1|2|3), Standard: 1 für eigenes, 2 für fremdes $active_tab = (int)($_GET['ptab'] ?? ($is_own ? 1 : 2)); $active_tab = in_array($active_tab, [1,2,3]) ? $active_tab : ($is_own ? 1 : 2); // Tab 1 + 3 nur für eigenes Profil if (!$is_own && $active_tab !== 2) $active_tab = 2; ob_start(); ?>
role) >= 0): ?>
Nachricht senden id, $profile->id); ?>
Profil bearbeiten
signature??''); ?>/300
profile_public ?? 1); ?>
E-Mail-Adresse

Aktuelle Adresse: email); ?>

Weitere Profilangaben
>
Lesezeichen

Noch keine Lesezeichen.

title,0,60)); ?> cat_name); ?> bookmarked_at); ?>
Beiträge

Noch keine Beiträge.

content), 0, 130)); $more = mb_strlen(strip_tags($up->content)) > 130 ? '…' : ''; $is_thread = isset($up->entry_type) && $up->entry_type === 'thread'; $anchor = $is_thread ? '?forum_thread=' . (int)$up->thread_id : '?forum_thread=' . (int)$up->thread_id . '#post-' . (int)$up->id; ?>
Thread Antwort thread_title, 0, 60)); ?> cat_name); ?> created_at); ?>

E-Mail-Benachrichtigungen
id); $n_reply = ($notif_meta['notify_reply'] ?? '1') !== '0'; $n_mention = ($notif_meta['notify_mention'] ?? '1') !== '0'; $n_message = ($notif_meta['notify_message'] ?? '1') !== '0'; ?>

Lege fest bei welchen Ereignissen du eine E-Mail erhältst.

Ignorierte Nutzer

Du ignorierst niemanden.

avatar_url, $ign->display_name, 36); ?>
display_name); ?> Ignoriert seit ignored_since); ?>
Datenschutz & Konto löschen

Gemäß DSGVO Art. 17 (Recht auf Vergessenwerden) kannst du die vollständige Löschung deines Kontos und aller personenbezogenen Daten beantragen.
Deine Beiträge bleiben anonymisiert sichtbar. Direktnachrichten, Likes, Profilinformationen und alle persönlichen Daten werden dauerhaft gelöscht.

Tag nicht gefunden.

'; $current = WBF_Auth::get_current_user(); $page = max(1,(int)($_GET['fp']??1)); $threads = WBF_DB::get_threads_by_tag($slug, $page, 20); $total = WBF_DB::count_threads_by_tag($slug); $pages = ceil($total/20) ?: 1; ob_start(); ?>

name); ?> Thread

Keine Threads mit diesem Tag.

id,$t->id,'thread') : false; $t_tags = WBF_DB::get_thread_tags($t->id); ?>
avatar_url,$t->display_name); ?>
von display_name); ?> author_role); ?> created_at); ?>
reply_count; ?> views; ?> id,'thread',$t->like_count,$liked); ?>
1): ?>

Alle Tags

🔒

Bitte einloggen

Um Nachrichten lesen zu können, musst du eingeloggt sein.

Wähle eine Konversation aus oder starte eine neue Nachricht.

Neue Nachricht

role) < 50)) return self::view_maintenance(); $query = sanitize_text_field($_GET['q'] ?? ''); $current = WBF_Auth::get_current_user(); $results = mb_strlen($query) >= 2 ? WBF_DB::search($query, 40) : []; ob_start(); ?>

Suchergebnisse für „

Keine Ergebnisse.

result_type === 'thread'; $url = $is_thread ? '?forum_thread='.(int)$r->id : '?forum_thread='.(int)$r->id; $preview = esc_html(mb_substr(strip_tags($r->content), 0, 200)); $more = mb_strlen(strip_tags($r->content)) > 200 ? '…' : ''; ?>
Thread Antwort cat_name); ?> avatar_url, $r->display_name, 18); ?> display_name); ?> created_at); ?>
title, 0, 80)); ?>

Ergebnis(se) gefunden.

id) : 0; ?>
Passwort vergessen?
Registrierung ist deaktiviert.

Gib deine E-Mail ein — wir schicken dir einen Reset-Link.

Forum Zugang

(int)$c->parent_id === 0); $children_map = []; foreach ($categories as $c) { if ((int)$c->parent_id > 0) $children_map[$c->parent_id][] = $c; } ?>

Thread verschieben

Beitrag melden

Umfrage erstellen

(int)$c->parent_id === 0); $children_map = []; foreach ($categories as $c) { if ((int)$c->parent_id > 0) $children_map[$c->parent_id][] = $c; } ?>

Neuen Thread erstellen

Passwort zurücksetzen

Dieser Link ist ungültig oder abgelaufen. Bitte fordere einen neuen an.
Zurück zum Forum
role) < 50)) return self::view_maintenance(); if ( ! $current ) { ob_start(); ?>
Bitte um die Mitgliederliste zu sehen.
prepare("WHERE (display_name LIKE %s OR username LIKE %s)", '%'.$search.'%', '%'.$search.'%') : ''; $order = $sort === 'display_name' ? 'ASC' : 'DESC'; $total = (int)$wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}forum_users $where"); $members = $wpdb->get_results($wpdb->prepare( "SELECT id, username, display_name, avatar_url, role, post_count, registered, last_active FROM {$wpdb->prefix}forum_users $where ORDER BY $sort $order LIMIT %d OFFSET %d", $per_page, $offset )); $pages = ceil($total / $per_page) ?: 1; ob_start(); ?>

Mitglieder ()

Zurücksetzen
role); $is_online = WBF_DB::is_online($m->id); ?>
avatar_url, $m->display_name, 64); ?>
display_name); ?>
@username); ?>
role); ?>
post_count); ?> registered)); ?>

Keine Mitglieder gefunden.

1): ?>
🔧

Durch die Nutzung des Forums stimmst du unseren Regeln zu. Forum-Regeln lesen
Diese Seite ist nicht verfügbar.

'; } $title = esc_html( $s['rules_title'] ?? 'Forum-Regeln & Nutzungsbedingungen' ); $raw = $s['rules_content'] ?? ''; ob_start(); ?>
📜

Zuletzt aktualisiert:  ·  Bitte sorgfältig lesen

Mit der Nutzung des Forums stimmst du diesen Regeln zu. Zurück zum Forum
Noch keine Regeln hinterlegt.

'; } $paragraphs = preg_split( '/\n{2,}/', trim( $raw ) ); $out = ''; foreach ( $paragraphs as $para ) { $para = trim( $para ); if ( $para === '' ) continue; if ( preg_match( '/^\*\*(\d+\.\s*.+?)\*\*$/', $para, $m ) ) { preg_match('/^(\d+)\.\s*(.+)$/', $m[1], $parts); $num = esc_html($parts[1] ?? ''); $text = esc_html($parts[2] ?? $m[1]); $out .= '
' . '' . $num . '' . '

' . $text . '

' . '
'; } else { $para = htmlspecialchars( $para, ENT_QUOTES, 'UTF-8' ); $para = preg_replace( '/\*\*(.+?)\*\*/s', '$1', $para ); $para = nl2br( $para ); $out .= '

' . $para . '

'; } } return $out; } } WBF_Shortcodes::init();