PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.4.3
Forumax – AI Powered Advanced Community Forum Plugin v2.4.3
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
bbp-core / templates / content-single-topic-lead.php

content-single-topic-lead.php in Forumax – AI Powered Advanced Community Forum Plugin 2.4.3, at templates/content-single-topic-lead.php

219 lines 6.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Single Topic Lead Content Part
5 *
6 * @package bbPress
7 * @subpackage Theme
8 */
9
10 // Exit if accessed directly.
11 defined( 'ABSPATH' ) || exit;
12
13 do_action( 'bbp_template_before_lead_topic' );
14
15 $topic_tag_list = bbp_get_topic_tag_list(
16 get_the_ID(),
17 array(
18 'before' => '',
19 'after' => '',
20 'sep' => ', ',
21 'none' => '',
22 )
23 );
24 $has_topic_tags = ! empty( $topic_tag_list );
25 $action_btns_class = $has_topic_tags ? 'has-topic-tags' : 'no-topic-tags';
26 ?>
27 <div class="main-post">
28 <div class="topic-content-wrapper">
29
30 <div class="forum-post-top">
31 <div class="bbp-author-wrap">
32 <div class="author-avatar bbp-author-link">
33 <?php
34 echo bbp_get_topic_author_link(
35 array(
36 'post_id' => get_the_ID(),
37 'size' => 40,
38 'type' => 'avatar',
39 )
40 );
41 ?>
42 </div>
43
44 <div class="forum-post-author">
45 <div class="topic-author author-flex author-gap">
46 <?php
47 echo bbp_get_topic_author_link(
48 array(
49 'post_id' => get_the_ID(),
50 'type' => 'name',
51 )
52 );
53 ?>
54 <div class="author-badge badge <?php echo esc_attr( sanitize_title( forumax_get_bbp_user_role() ) ); ?>">
55 <?php forumax_bbp_user_role_icon(); ?>
56 <span><?php echo esc_html( forumax_get_bbp_user_role() ); ?></span>
57 </div>
58 </div>
59
60 <div class="forum-author-meta meta">
61 <span title="<?php bbp_topic_post_date( get_the_ID() ); ?>">
62 <?php bbp_topic_post_date( get_the_ID(), true ); ?>
63 </span>
64 <span class="dot"></span>
65 <?php $lead_reply_count = bbp_get_topic_reply_count( bbp_get_topic_id() ); ?>
66 <a href="#topic-<?php bbp_topic_id(); ?>-replies" class="replies-count">
67 <?php
68 printf(
69 /* translators: %s: number of replies */
70 esc_html( _n( '%s Reply', '%s Replies', $lead_reply_count, 'forumax' ) ),
71 esc_html( number_format_i18n( $lead_reply_count ) )
72 );
73 ?>
74 </a>
75 </div>
76 </div>
77 </div>
78
79 <div class="action-button-container">
80 <?php
81 if ( is_user_logged_in() ) :
82 bbp_topic_subscription_link(
83 array(
84 'before' => '',
85 'after' => '',
86 'unsubscribe' => esc_html__( 'Subscribed', 'forumax' ),
87 )
88 );
89 else :
90 if ( get_option( '_bbp_enable_subscriptions' ) == 1 && forumax_get_opt( 'is_topic_subscription' ) == 1 ) :
91 ?>
92 <button class="button subscription-login-btn frmx-subscribe-trigger-btn">
93 <?php esc_html_e( 'Log in to subscribe', 'forumax' ); ?>
94 </button>
95 <div class="subscription-login-modal frmx-topic-sub-modal">
96 <div class="subscription-login-modal-inner">
97 <button class="subscription-login-modal-close" aria-label="<?php esc_attr_e( 'Close', 'forumax' ); ?>">&times;</button>
98 <h3 class="frmx-inline-login-title"><?php echo esc_html( forumax_get_opt( 'subscription_modal_title', __( 'Login to the community', 'forumax' ) ) ); ?></h3>
99 <p class="frmx-inline-login-subtitle"><?php echo esc_html( forumax_get_opt( 'subscription_modal_subtitle', __( 'You must be logged in to subscribe to this topic.', 'forumax' ) ) ); ?></p>
100 <div class="frmx-subscription-login-form">
101 <?php
102 if ( function_exists( 'forumax_get_opt' ) && forumax_get_opt( 'topic_login_shortcode' ) ) {
103 echo do_shortcode( forumax_get_opt( 'topic_login_shortcode' ) );
104 } else {
105 bbp_get_template_part( 'form', 'user-login' );
106 }
107 ?>
108 </div>
109 </div>
110 </div>
111 <?php
112 endif;
113 endif;
114 ?>
115
116 <?php
117 /**
118 * Topic admin links dropdown (⋯ three-dot menu).
119 * Placed next to Subscribe for quick access.
120 */
121 if ( is_user_logged_in() && function_exists( 'forumax_get_topic_admin_links' ) ) {
122 echo forumax_get_topic_admin_links(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
123 }
124 ?>
125 </div>
126 </div>
127
128 <div class="q-title">
129 <?php
130 $topic_prefix = forumax_get_opt( 'topic_title_prefix', 'Q:' );
131 if ( ! empty( $topic_prefix ) ) :
132 ?>
133 <span class="question-icon" title="Question">
134 <?php echo esc_html( $topic_prefix ); ?>
135 </span>
136 <?php endif; ?>
137 <h1>
138 <?php do_action( 'bbp_theme_before_topic_title' ); ?>
139 <?php
140 the_title();
141 do_action( 'bbpc-resolved-topics' );
142 ?>
143 </h1>
144 </div>
145
146 <div class="forum-post-content">
147 <?php do_action('bbp_theme_after_topic_author_details'); ?>
148 <div class="topic-content-layout">
149 <?php
150 $topic_post = get_post();
151 $forum_id = $topic_post ? bbp_get_topic_forum_id( $topic_post->ID ) : 0;
152 $forum_vote = $forum_id ? get_post_meta( $forum_id, 'bbp_voting_forum_enable_topics', true ) : '';
153
154 // Note: despite the option id name, this switcher is used as an enable flag in the voting frontend.
155 $topic_voting_enabled = ! empty( forumax_get_opt( 'is_voting_disabled_topics', 0 ) );
156 $voting_feature_on = (bool) forumax_get_opt( 'is_votes', true );
157
158 $show_vote_column = $voting_feature_on
159 && (bool) has_action( 'bbp_voting_cpt' )
160 && ( ( ! empty( $forum_vote ) && $forum_vote !== 'false' ) || ( empty( $forum_vote ) && $topic_voting_enabled ) );
161 ?>
162 <?php if ( $show_vote_column ) : ?>
163 <div class="topic-vote-column">
164 <?php
165 /**
166 * Render only the voting UI in the left column.
167 */
168 do_action( 'bbp_voting_cpt', $topic_post );
169 ?>
170 </div>
171 <?php endif; ?>
172
173 <div class="topic-content-body">
174 <div class="content editor-content">
175 <?php do_action('bbp_theme_before_topic_content'); ?>
176 <?php bbp_topic_content(); ?>
177 </div>
178
179 <div class="action-button-container action-btns <?php echo esc_attr( $action_btns_class ); ?>">
180 <?php
181 if ( has_action( 'bbp_theme_after_topic_content', 'bbp_voting_buttons' ) ) {
182 remove_action( 'bbp_theme_after_topic_content', 'bbp_voting_buttons' );
183 }
184 ?>
185 <?php do_action('bbp_theme_after_topic_content'); ?>
186 <?php if ( $has_topic_tags ) : ?>
187 <div class="taxonomy forum-post-tags">
188 <?php
189 echo wp_kses_post(
190 '<span class="tags-label">' . esc_html__( 'Tags:', 'forumax' ) . '</span> <span class="tags">' . $topic_tag_list . '</span>'
191 );
192 ?>
193 </div>
194 <?php endif; ?>
195
196 <div class="frmx-action-btns-right">
197 <?php
198 bbp_topic_favorite_link(
199 array(
200 'before' => '',
201 )
202 );
203 ?>
204 <?php
205 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
206 echo forumax_topic_social_share();
207 ?>
208 </div>
209 </div>
210 </div>
211 </div>
212 </div>
213
214 </div>
215 </div>
216
217 <?php
218 do_action( 'bbp_template_after_lead_topic' );
219