"; 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_tags( $tags, $small = false ) { if ( empty($tags) ) return ''; $cls = $small ? 'wbf-tag wbf-tag--sm' : 'wbf-tag'; $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 = ['👍','❤️','😂','😮','😢','😡']; $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 = ''; 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 ''; } 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; } if (isset($_GET['forum_members'])) return self::view_members(); if (isset($_GET['wbf_reset_token'])) return self::view_reset_password(); if (isset($_GET['forum_thread'])) return self::view_thread(); if (isset($_GET['forum_cat'])) return self::view_category(); if (isset($_GET['forum_profile'])) return self::view_profile(); if (isset($_GET['forum_search'])) return self::view_search(); if (isset($_GET['forum_tag'])) return self::view_tag(); if (isset($_GET['forum_dm'])) return self::view_dm(); return self::view_home(); } // ── 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(); ?>description); ?>
Noch keine Threads. Starte die Diskussion!
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; ?>Keine Threads mit diesem Tag.
Wähle eine Konversation aus oder starte eine neue Nachricht.
Keine Ergebnisse.
Ergebnis(se) gefunden.
Keine Mitglieder gefunden.