PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.2.0
Forumax – AI Powered Advanced Community Forum Plugin v2.2.0
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 2.2.0, at templates/form-topic.php

286 lines 11.9 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 do_action( 'bbp_template_notices' ); ?>
71
72 <div class="frmx-row aq-form-wrapper">
73
74 <?php bbp_get_template_part( 'form', 'anonymous' ); ?>
75
76 <?php do_action( 'bbp_theme_before_topic_form_title' ); ?>
77
78 <div class="form-item frmx-col-md-12">
79 <label for="bbp_topic_title"><?php printf( esc_html__( 'Topic Title (Maximum Length: %d):', 'forumax' ),
80 bbp_get_title_max_length() ); ?></label><br/>
81 <input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" size="40" name="bbp_topic_title"
82 maxlength="<?php bbp_title_max_length(); ?>"/>
83 </div>
84
85 <?php do_action( 'bbp_theme_after_topic_form_title' ); ?>
86
87 <?php do_action( 'bbp_theme_before_topic_form_content' ); ?>
88
89 <?php bbp_the_content( array( 'context' => 'topic' ) ); ?>
90
91 <?php do_action( 'bbp_theme_after_topic_form_content' ); ?>
92
93 <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
94
95 <p class="form-allowed-tags">
96 <label><?php printf( esc_html__( 'You may use these %s tags and attributes:', 'forumax' ),
97 '<abbr title="HyperText Markup Language">HTML</abbr>' ); ?></label><br/>
98 <code><?php bbp_allowed_tags(); ?></code>
99 </p>
100
101 <?php endif; ?>
102
103 <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) ) : ?>
104
105 <?php do_action( 'bbp_theme_before_topic_form_tags' ); ?>
106
107 <div class="form-item frmx-col-md-12">
108 <label for="bbp_topic_tags"><?php esc_html_e( 'Topic Tags:', 'forumax' ); ?></label><br/>
109 <input type="text" value="<?php bbp_form_topic_tags(); ?>" size="40" name="bbp_topic_tags"
110 id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> />
111 </div>
112
113 <?php do_action( 'bbp_theme_after_topic_form_tags' ); ?>
114
115 <?php endif; ?>
116
117 <?php if ( ! bbp_is_single_forum() ) : ?>
118
119 <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
120
121 <div class="form-item frmx-col-md-4">
122 <label for="bbp_forum_id"><?php esc_html_e( 'Forum:', 'forumax' ); ?></label><br/>
123 <?php
124 bbp_dropdown( array(
125 'show_none' => esc_html__( '&mdash; No forum &mdash;', 'forumax' ),
126 'selected' => bbp_get_form_topic_forum()
127 ) );
128 ?>
129 </div>
130
131 <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
132
133 <?php endif; ?>
134
135 <?php if ( current_user_can( 'moderate', bbp_get_topic_id() ) ) : ?>
136
137 <?php do_action( 'bbp_theme_before_topic_form_type' ); ?>
138
139 <div class="form-item frmx-col-md-<?php echo bbp_is_single_forum() ? '6' : '4'; ?>">
140
141 <label for="bbp_stick_topic"><?php esc_html_e( 'Topic Type:', 'forumax' ); ?></label><br/>
142
143 <?php bbp_form_topic_type_dropdown(); ?>
144
145 </div>
146
147 <?php do_action( 'bbp_theme_after_topic_form_type' ); ?>
148
149 <?php do_action( 'bbp_theme_before_topic_form_status' ); ?>
150
151 <div class="form-item frmx-col-md-<?php echo bbp_is_single_forum() ? '6' : '4'; ?>">
152
153 <label for="bbp_topic_status"><?php esc_html_e( 'Topic Status:', 'forumax' ); ?></label><br/>
154
155 <?php bbp_form_topic_status_dropdown(); ?>
156
157 </div>
158
159 <?php do_action( 'bbp_theme_after_topic_form_status' ); ?>
160
161 <?php endif; ?>
162
163 <?php if ( bbp_allow_revisions() && bbp_is_topic_edit() ) : ?>
164
165 <?php do_action( 'bbp_theme_before_topic_form_revisions' ); ?>
166
167 <fieldset class="bbp-form">
168 <legend>
169 <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> />
170 <label for="bbp_log_topic_edit"><?php esc_html_e( 'Keep a log of this edit:', 'forumax' ); ?></label><br/>
171 </legend>
172
173 <div>
174 <label for="bbp_topic_edit_reason"><?php printf( esc_html__( 'Optional reason for editing:', 'forumax' ),
175 bbp_get_current_user_name() ); ?></label><br/>
176 <input type="text" value="<?php bbp_form_topic_edit_reason(); ?>" size="40" name="bbp_topic_edit_reason"
177 id="bbp_topic_edit_reason"/>
178 </div>
179 </fieldset>
180
181 <?php do_action( 'bbp_theme_after_topic_form_revisions' ); ?>
182
183 <?php endif; ?>
184
185 <?php do_action( 'bbp_theme_before_topic_form_submit_wrapper' ); ?>
186
187 <div class="form-item frmx-col-md-12 bbp-submit-wrapper">
188
189 <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous()
190 && ( ! bbp_is_topic_edit()
191 || ( bbp_is_topic_edit()
192 && ! bbp_is_topic_anonymous() ) )
193 ) : ?>
194
195 <div class="aq-notify-check">
196 <?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?>
197
198 <input class="checkbox-tik" name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"
199 value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
200
201 <?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
202
203 <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email',
204 'forumax' ); ?></label>
205
206 <?php else : ?>
207
208 <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'forumax' ); ?></label>
209
210 <?php endif; ?>
211
212 <?php do_action( 'bbp_theme_after_topic_form_subscriptions' ); ?>
213 </div>
214
215 <?php endif; ?>
216
217 <?php do_action( 'bbp_theme_before_topic_form_submit_button' ); ?>
218
219 <button type="submit" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit fill-brand">
220 <?php esc_html_e( 'Submit', 'forumax' ); ?>
221 </button>
222
223 <?php do_action( 'bbp_theme_after_topic_form_submit_button' ); ?>
224
225 </div>
226
227 <?php do_action( 'bbp_theme_after_topic_form_submit_wrapper' ); ?>
228
229 </div>
230
231 <?php bbp_topic_form_fields(); ?>
232
233 </fieldset>
234
235 <?php do_action( 'bbp_theme_after_topic_form' ); ?>
236
237 </form>
238 </div>
239
240 <?php elseif ( bbp_is_forum_closed() ) : ?>
241
242 <div id="forum-closed-<?php bbp_forum_id(); ?>" class="bbp-forum-closed">
243 <div class="bbp-template-notice">
244 <ul>
245 <li><?php printf( esc_html__( 'The forum &#8216;%s&#8217; is closed to new topics and replies.', 'forumax' ), bbp_get_forum_title() ); ?></li>
246 </ul>
247 </div>
248 </div>
249
250 <?php else : ?>
251
252 <div id="no-topic-<?php bbp_forum_id(); ?>" class="bbp-no-topic">
253 <div class="bbp-template-notice">
254 <ul>
255 <li>
256 <?php
257 is_user_logged_in()
258 ? esc_html_e( 'You cannot create new topics.', 'forumax' )
259 : esc_html_e( 'You must be logged in to create new topics.', 'forumax' );
260 ?>
261 </li>
262 </ul>
263 </div>
264
265 <?php if ( ! is_user_logged_in() ) : ?>
266
267 <?php
268 if ( forumax_get_opt('topic_login_shortcode') ) {
269 echo do_shortcode(forumax_get_opt('topic_login_shortcode'));
270 } else {
271 bbp_get_template_part('form', 'user-login');
272 }
273 ?>
274
275 <?php endif; ?>
276
277 </div>
278
279 <?php endif; ?>
280
281 <?php if ( ! bbp_is_single_forum() ) : ?>
282
283 </div>
284
285 <?php endif;
286