PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / trunk
Forumax – AI Powered Advanced Community Forum Plugin vtrunk
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 / form-topic.php

form-topic.php in Forumax – AI Powered Advanced Community Forum Plugin trunk, at templates/form-topic.php

289 lines 12.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * New/Edit Topic
4 *
5 * @package bbPress
6 * @subpackage Theme
7 */
8
9 // Exit if accessed directly
10 defined( 'ABSPATH' ) || exit;
11
12 if ( ! bbp_is_single_forum() ) : ?>
13
14 <div id="bbpress-forums" class="bbpress-wrapper">
15
16 <?php endif; ?>
17
18 <?php if ( bbp_is_topic_edit() ) : ?>
19
20 <?php bbp_get_template_part( 'alert', 'topic-lock' ); ?>
21
22 <?php endif; ?>
23
24 <?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
25
26 <div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form">
27
28 <form id="new-post" name="new-post" method="post">
29
30 <?php do_action( 'bbp_theme_before_topic_form' ); ?>
31
32 <fieldset class="bbp-form">
33 <legend>
34
35 <?php
36 if ( bbp_is_topic_edit() ) :
37 printf( esc_html__( 'Now Editing &ldquo;%s&rdquo;', 'forumax' ), bbp_get_topic_title() );
38 else :
39 ( bbp_is_single_forum() && bbp_get_forum_title() )
40 ? printf( esc_html__( 'Create New Topic in &ldquo;%s&rdquo;', 'forumax' ), bbp_get_forum_title() )
41 : esc_html_e( 'Create New Topic', 'forumax' );
42 endif;
43 ?>
44
45 </legend>
46
47 <?php do_action( 'bbp_theme_before_topic_form_notices' ); ?>
48
49 <?php if ( ! bbp_is_topic_edit() && bbp_is_forum_closed() ) : ?>
50
51 <div class="bbp-template-notice">
52 <ul>
53 <li><?php esc_html_e( 'This forum is marked as closed to new topics, however your posting capabilities still allow you to create a topic.',
54 'forumax' ); ?></li>
55 </ul>
56 </div>
57
58 <?php endif; ?>
59
60 <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
61
62 <div class="bbp-template-notice">
63 <ul>
64 <li><?php esc_html_e( 'Your account has the ability to post unrestricted HTML content.', 'forumax' ); ?></li>
65 </ul>
66 </div>
67
68 <?php endif; ?>
69
70 <?php if ( ! bbp_is_single_forum() ) : ?>
71 <?php do_action( 'bbp_template_notices' ); ?>
72 <?php endif; ?>
73
74 <div class="frmx-row aq-form-wrapper">
75
76 <?php bbp_get_template_part( 'form', 'anonymous' ); ?>
77
78 <?php do_action( 'bbp_theme_before_topic_form_title' ); ?>
79
80 <div class="form-item frmx-col-md-12">
81 <label for="bbp_topic_title"><?php printf( esc_html__( 'Topic Title (Maximum Length: %d):', 'forumax' ),
82 bbp_get_title_max_length() ); ?></label>
83 <input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" size="40" name="bbp_topic_title"
84 maxlength="<?php bbp_title_max_length(); ?>"/>
85 </div>
86
87 <?php do_action( 'bbp_theme_after_topic_form_title' ); ?>
88
89 <?php do_action( 'bbp_theme_before_topic_form_content' ); ?>
90
91 <div class="form-item frmx-col-md-12">
92 <?php bbp_the_content( array( 'context' => 'topic' ) ); ?>
93 </div>
94
95 <?php do_action( 'bbp_theme_after_topic_form_content' ); ?>
96
97 <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
98
99 <p class="form-allowed-tags">
100 <label><?php printf( esc_html__( 'You may use these %s tags and attributes:', 'forumax' ),
101 '<abbr title="HyperText Markup Language">HTML</abbr>' ); ?></label><br/>
102 <code><?php bbp_allowed_tags(); ?></code>
103 </p>
104
105 <?php endif; ?>
106
107 <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) ) : ?>
108
109 <?php do_action( 'bbp_theme_before_topic_form_tags' ); ?>
110
111 <div class="form-item frmx-col-md-12">
112 <label for="bbp_topic_tags"><?php esc_html_e( 'Topic Tags:', 'forumax' ); ?></label>
113 <input type="text" value="<?php bbp_form_topic_tags(); ?>" size="40" name="bbp_topic_tags"
114 id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> />
115 </div>
116
117 <?php do_action( 'bbp_theme_after_topic_form_tags' ); ?>
118
119 <?php endif; ?>
120
121 <?php if ( ! bbp_is_single_forum() ) : ?>
122
123 <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
124
125 <div class="form-item frmx-col-md-4">
126 <label for="bbp_forum_id"><?php esc_html_e( 'Forum:', 'forumax' ); ?></label>
127 <?php
128 bbp_dropdown( array(
129 'show_none' => esc_html__( '&mdash; No forum &mdash;', 'forumax' ),
130 'selected' => bbp_get_form_topic_forum()
131 ) );
132 ?>
133 </div>
134
135 <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
136
137 <?php endif; ?>
138
139 <?php if ( current_user_can( 'moderate', bbp_get_topic_id() ) ) : ?>
140
141 <?php do_action( 'bbp_theme_before_topic_form_type' ); ?>
142
143 <div class="form-item frmx-col-md-<?php echo bbp_is_single_forum() ? '6' : '4'; ?>">
144
145 <label for="bbp_stick_topic"><?php esc_html_e( 'Topic Type:', 'forumax' ); ?></label>
146
147 <?php bbp_form_topic_type_dropdown(); ?>
148
149 </div>
150
151 <?php do_action( 'bbp_theme_after_topic_form_type' ); ?>
152
153 <?php do_action( 'bbp_theme_before_topic_form_status' ); ?>
154
155 <div class="form-item frmx-col-md-<?php echo bbp_is_single_forum() ? '6' : '4'; ?>">
156
157 <label for="bbp_topic_status"><?php esc_html_e( 'Topic Status:', 'forumax' ); ?></label>
158
159 <?php bbp_form_topic_status_dropdown(); ?>
160
161 </div>
162
163 <?php do_action( 'bbp_theme_after_topic_form_status' ); ?>
164
165 <?php endif; ?>
166
167 <?php if ( bbp_allow_revisions() && bbp_is_topic_edit() ) : ?>
168
169 <?php do_action( 'bbp_theme_before_topic_form_revisions' ); ?>
170
171 <fieldset class="bbp-form">
172 <legend>
173 <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> />
174 <label for="bbp_log_topic_edit"><?php esc_html_e( 'Keep a log of this edit:', 'forumax' ); ?></label><br/>
175 </legend>
176
177 <div>
178 <label for="bbp_topic_edit_reason"><?php printf( esc_html__( 'Optional reason for editing:', 'forumax' ),
179 bbp_get_current_user_name() ); ?></label><br/>
180 <input type="text" value="<?php bbp_form_topic_edit_reason(); ?>" size="40" name="bbp_topic_edit_reason"
181 id="bbp_topic_edit_reason"/>
182 </div>
183 </fieldset>
184
185 <?php do_action( 'bbp_theme_after_topic_form_revisions' ); ?>
186
187 <?php endif; ?>
188
189 <?php do_action( 'bbp_theme_before_topic_form_submit_wrapper' ); ?>
190
191 <div class="form-item frmx-col-md-12 bbp-submit-wrapper">
192
193 <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous()
194 && ( ! bbp_is_topic_edit()
195 || ( bbp_is_topic_edit()
196 && ! bbp_is_topic_anonymous() ) )
197 ) : ?>
198
199 <div class="aq-notify-check">
200 <?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?>
201
202 <input class="checkbox-tik" name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"
203 value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
204
205 <?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
206
207 <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email',
208 'forumax' ); ?></label>
209
210 <?php else : ?>
211
212 <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'forumax' ); ?></label>
213
214 <?php endif; ?>
215
216 <?php do_action( 'bbp_theme_after_topic_form_subscriptions' ); ?>
217 </div>
218
219 <?php endif; ?>
220
221 <?php do_action( 'bbp_theme_before_topic_form_submit_button' ); ?>
222
223 <button type="submit" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit fill-brand">
224 <?php esc_html_e( 'Submit', 'forumax' ); ?>
225 </button>
226
227 <?php do_action( 'bbp_theme_after_topic_form_submit_button' ); ?>
228
229 </div>
230
231 <?php do_action( 'bbp_theme_after_topic_form_submit_wrapper' ); ?>
232
233 </div>
234
235 <?php bbp_topic_form_fields(); ?>
236
237 </fieldset>
238
239 <?php do_action( 'bbp_theme_after_topic_form' ); ?>
240
241 </form>
242 </div>
243
244 <?php elseif ( bbp_is_forum_closed() ) : ?>
245
246 <div id="forum-closed-<?php bbp_forum_id(); ?>" class="bbp-forum-closed">
247 <div class="bbp-template-notice">
248 <ul>
249 <li><?php printf( esc_html__( 'The forum &#8216;%s&#8217; is closed to new topics and replies.', 'forumax' ), bbp_get_forum_title() ); ?></li>
250 </ul>
251 </div>
252 </div>
253
254 <?php else : ?>
255
256 <div id="no-topic-<?php bbp_forum_id(); ?>" class="bbp-no-topic">
257 <?php if ( is_user_logged_in() ) : ?>
258 <div class="bbp-template-notice bbp-login-required-notice">
259 <span class="bbp-notice-icon" aria-hidden="true">
260 <svg viewBox="0 0 24 24" width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
261 <path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10Z" stroke="currentColor" stroke-width="1.8"/>
262 <path d="M12 10.5v6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
263 <path d="M12 7.75h.01" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/>
264 </svg>
265 </span>
266 <ul>
267 <li><?php esc_html_e( 'You cannot create new topics.', 'forumax' ); ?></li>
268 </ul>
269 </div>
270 <?php else : ?>
271 <div class="frmx-inline-login-prompt">
272 <h3 class="frmx-inline-login-title text-center"><?php echo esc_html__( 'Start a new topic', 'forumax' ); ?></h3>
273 <p class="frmx-inline-login-subtitle text-center"><?php echo esc_html__( 'You must be logged in to create new topics.', 'forumax' ); ?></p>
274 <div class="frmx-subscription-login-form">
275 <?php forumax_render_topic_login_form(); ?>
276 </div>
277 </div>
278 <?php endif; ?>
279
280 </div>
281
282 <?php endif; ?>
283
284 <?php if ( ! bbp_is_single_forum() ) : ?>
285
286 </div>
287
288 <?php endif;
289