1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Implementation of e107 v2.x Forum converter. |
---|
5 | * |
---|
6 | * @since bbPress (r5057) |
---|
7 | * @link Codex Docs http://codex.bbpress.org/import-forums/e107 |
---|
8 | */ |
---|
9 | class e107v2 extends BBP_Converter_Base { |
---|
10 | |
---|
11 | /** |
---|
12 | * Main Constructor |
---|
13 | * |
---|
14 | * @uses e107v2::setup_globals() |
---|
15 | */ |
---|
16 | function __construct() { |
---|
17 | parent::__construct(); |
---|
18 | $this->setup_globals(); |
---|
19 | } |
---|
20 | |
---|
21 | /** |
---|
22 | * Sets up the field mappings |
---|
23 | */ |
---|
24 | public function setup_globals() { |
---|
25 | |
---|
26 | /** Forum Section *****************************************************/ |
---|
27 | |
---|
28 | // Forum id (Stored in postmeta) |
---|
29 | $this->field_map[] = array( |
---|
30 | 'from_tablename' => 'forum', |
---|
31 | 'from_fieldname' => 'forum_id', |
---|
32 | 'to_type' => 'forum', |
---|
33 | 'to_fieldname' => '_bbp_forum_id' |
---|
34 | ); |
---|
35 | |
---|
36 | // Forum parent id (If no parent, then 0, Stored in postmeta) |
---|
37 | $this->field_map[] = array( |
---|
38 | 'from_tablename' => 'forum', |
---|
39 | 'from_fieldname' => 'forum_parent', |
---|
40 | 'to_type' => 'forum', |
---|
41 | 'to_fieldname' => '_bbp_forum_parent_id' |
---|
42 | ); |
---|
43 | |
---|
44 | // Forum topic count (Stored in postmeta) |
---|
45 | $this->field_map[] = array( |
---|
46 | 'from_tablename' => 'forum', |
---|
47 | 'from_fieldname' => 'forum_threads', |
---|
48 | 'to_type' => 'forum', |
---|
49 | 'to_fieldname' => '_bbp_topic_count' |
---|
50 | ); |
---|
51 | |
---|
52 | // Forum reply count (Stored in postmeta) |
---|
53 | $this->field_map[] = array( |
---|
54 | 'from_tablename' => 'forum', |
---|
55 | 'from_fieldname' => 'forum_replies', |
---|
56 | 'to_type' => 'forum', |
---|
57 | 'to_fieldname' => '_bbp_reply_count' |
---|
58 | ); |
---|
59 | |
---|
60 | // Forum total topic count (Includes unpublished topics, Stored in postmeta) |
---|
61 | $this->field_map[] = array( |
---|
62 | 'from_tablename' => 'forum', |
---|
63 | 'from_fieldname' => 'forum_threads', |
---|
64 | 'to_type' => 'forum', |
---|
65 | 'to_fieldname' => '_bbp_total_topic_count' |
---|
66 | ); |
---|
67 | |
---|
68 | // Forum total reply count (Includes unpublished replies, Stored in postmeta) |
---|
69 | $this->field_map[] = array( |
---|
70 | 'from_tablename' => 'forum', |
---|
71 | 'from_fieldname' => 'forum_replies', |
---|
72 | 'to_type' => 'forum', |
---|
73 | 'to_fieldname' => '_bbp_total_reply_count' |
---|
74 | ); |
---|
75 | |
---|
76 | // Forum title. |
---|
77 | $this->field_map[] = array( |
---|
78 | 'from_tablename' => 'forum', |
---|
79 | 'from_fieldname' => 'forum_name', |
---|
80 | 'to_type' => 'forum', |
---|
81 | 'to_fieldname' => 'post_title' |
---|
82 | ); |
---|
83 | |
---|
84 | // Forum slug (Clean name to avoid conflicts) |
---|
85 | $this->field_map[] = array( |
---|
86 | 'from_tablename' => 'forum', |
---|
87 | 'from_fieldname' => 'forum_name', |
---|
88 | 'to_type' => 'forum', |
---|
89 | 'to_fieldname' => 'post_name', |
---|
90 | 'callback_method' => 'callback_slug' |
---|
91 | ); |
---|
92 | |
---|
93 | // Forum description. |
---|
94 | $this->field_map[] = array( |
---|
95 | 'from_tablename' => 'forum', |
---|
96 | 'from_fieldname' => 'forum_description', |
---|
97 | 'to_type' => 'forum', |
---|
98 | 'to_fieldname' => 'post_content', |
---|
99 | 'callback_method' => 'callback_null' |
---|
100 | ); |
---|
101 | |
---|
102 | // Forum display order (Starts from 1) |
---|
103 | $this->field_map[] = array( |
---|
104 | 'from_tablename' => 'forum', |
---|
105 | 'from_fieldname' => 'forum_order', |
---|
106 | 'to_type' => 'forum', |
---|
107 | 'to_fieldname' => 'menu_order' |
---|
108 | ); |
---|
109 | |
---|
110 | // Forum type (Category = 0 or Forum > 0, Stored in postmeta) |
---|
111 | $this->field_map[] = array( |
---|
112 | 'from_tablename' => 'forum', |
---|
113 | 'from_fieldname' => 'forum_parent', |
---|
114 | 'to_type' => 'forum', |
---|
115 | 'to_fieldname' => '_bbp_forum_type', |
---|
116 | 'callback_method' => 'callback_forum_type' |
---|
117 | ); |
---|
118 | |
---|
119 | // Forum dates. |
---|
120 | $this->field_map[] = array( |
---|
121 | 'to_type' => 'forum', |
---|
122 | 'to_fieldname' => 'post_date', |
---|
123 | 'default' => date('Y-m-d H:i:s') |
---|
124 | ); |
---|
125 | $this->field_map[] = array( |
---|
126 | 'to_type' => 'forum', |
---|
127 | 'to_fieldname' => 'post_date_gmt', |
---|
128 | 'default' => date('Y-m-d H:i:s') |
---|
129 | ); |
---|
130 | $this->field_map[] = array( |
---|
131 | 'to_type' => 'forum', |
---|
132 | 'to_fieldname' => 'post_modified', |
---|
133 | 'default' => date('Y-m-d H:i:s') |
---|
134 | ); |
---|
135 | $this->field_map[] = array( |
---|
136 | 'to_type' => 'forum', |
---|
137 | 'to_fieldname' => 'post_modified_gmt', |
---|
138 | 'default' => date('Y-m-d H:i:s') |
---|
139 | ); |
---|
140 | |
---|
141 | /** Topic Section *****************************************************/ |
---|
142 | |
---|
143 | // Topic id (Stored in postmeta) |
---|
144 | $this->field_map[] = array( |
---|
145 | 'from_tablename' => 'forum_thread', |
---|
146 | 'from_fieldname' => 'thread_id', |
---|
147 | 'to_type' => 'topic', |
---|
148 | 'to_fieldname' => '_bbp_topic_id' |
---|
149 | ); |
---|
150 | |
---|
151 | // Topic reply count (Stored in postmeta) |
---|
152 | $this->field_map[] = array( |
---|
153 | 'from_tablename' => 'forum_thread', |
---|
154 | 'from_fieldname' => 'thread_total_replies', |
---|
155 | 'to_type' => 'topic', |
---|
156 | 'to_fieldname' => '_bbp_reply_count', |
---|
157 | 'callback_method' => 'callback_topic_reply_count' |
---|
158 | ); |
---|
159 | |
---|
160 | // Topic total reply count (Includes unpublished replies, Stored in postmeta) |
---|
161 | $this->field_map[] = array( |
---|
162 | 'from_tablename' => 'forum_thread', |
---|
163 | 'from_fieldname' => 'thread_total_replies', |
---|
164 | 'to_type' => 'topic', |
---|
165 | 'to_fieldname' => '_bbp_total_reply_count', |
---|
166 | 'callback_method' => 'callback_topic_reply_count' |
---|
167 | ); |
---|
168 | |
---|
169 | // Topic parent forum id (If no parent, then 0. Stored in postmeta) |
---|
170 | $this->field_map[] = array( |
---|
171 | 'from_tablename' => 'forum_thread', |
---|
172 | 'from_fieldname' => 'thread_forum_id', |
---|
173 | 'to_type' => 'topic', |
---|
174 | 'to_fieldname' => '_bbp_forum_id', |
---|
175 | 'callback_method' => 'callback_forumid' |
---|
176 | ); |
---|
177 | |
---|
178 | // Topic author. |
---|
179 | $this->field_map[] = array( |
---|
180 | 'from_tablename' => 'forum_thread', |
---|
181 | 'from_fieldname' => 'thread_user', |
---|
182 | 'to_type' => 'topic', |
---|
183 | 'to_fieldname' => 'post_author', |
---|
184 | 'callback_method' => 'callback_userid' |
---|
185 | ); |
---|
186 | |
---|
187 | // Topic content. |
---|
188 | // Note: We join the 'forum_post' table because 'forum_thread' table does not include topic content. |
---|
189 | $this->field_map[] = array( |
---|
190 | 'from_tablename' => 'forum_post', |
---|
191 | 'from_fieldname' => 'post_entry', |
---|
192 | 'join_tablename' => 'forum_thread', |
---|
193 | 'join_type' => 'INNER', |
---|
194 | 'join_expression' => 'ON forum_post.post_id = forum_thread.thread_id', |
---|
195 | 'to_type' => 'topic', |
---|
196 | 'to_fieldname' => 'post_content', |
---|
197 | 'callback_method' => 'callback_html' |
---|
198 | ); |
---|
199 | |
---|
200 | // Topic title. |
---|
201 | $this->field_map[] = array( |
---|
202 | 'from_tablename' => 'forum_thread', |
---|
203 | 'from_fieldname' => 'thread_name', |
---|
204 | 'to_type' => 'topic', |
---|
205 | 'to_fieldname' => 'post_title' |
---|
206 | ); |
---|
207 | |
---|
208 | // Topic slug (Clean name to avoid conflicts) |
---|
209 | $this->field_map[] = array( |
---|
210 | 'from_tablename' => 'forum_thread', |
---|
211 | 'from_fieldname' => 'thread_name', |
---|
212 | 'to_type' => 'topic', |
---|
213 | 'to_fieldname' => 'post_name', |
---|
214 | 'callback_method' => 'callback_slug' |
---|
215 | ); |
---|
216 | |
---|
217 | // Topic parent forum id (If no parent, then 0) |
---|
218 | $this->field_map[] = array( |
---|
219 | 'from_tablename' => 'forum_thread', |
---|
220 | 'from_fieldname' => 'thread_forum_id', |
---|
221 | 'to_type' => 'topic', |
---|
222 | 'to_fieldname' => 'post_parent', |
---|
223 | 'callback_method' => 'callback_forumid' |
---|
224 | ); |
---|
225 | |
---|
226 | // Topic dates. |
---|
227 | $this->field_map[] = array( |
---|
228 | 'from_tablename' => 'forum_thread', |
---|
229 | 'from_fieldname' => 'thread_datestamp', |
---|
230 | 'to_type' => 'topic', |
---|
231 | 'to_fieldname' => 'post_date', |
---|
232 | 'callback_method' => 'callback_datetime' |
---|
233 | ); |
---|
234 | $this->field_map[] = array( |
---|
235 | 'from_tablename' => 'forum_thread', |
---|
236 | 'from_fieldname' => 'thread_datestamp', |
---|
237 | 'to_type' => 'topic', |
---|
238 | 'to_fieldname' => 'post_date_gmt', |
---|
239 | 'callback_method' => 'callback_datetime' |
---|
240 | ); |
---|
241 | $this->field_map[] = array( |
---|
242 | 'from_tablename' => 'forum_thread', |
---|
243 | 'from_fieldname' => 'thread_datestamp', |
---|
244 | 'to_type' => 'topic', |
---|
245 | 'to_fieldname' => 'post_modified', |
---|
246 | 'callback_method' => 'callback_datetime' |
---|
247 | ); |
---|
248 | $this->field_map[] = array( |
---|
249 | 'from_tablename' => 'forum_thread', |
---|
250 | 'from_fieldname' => 'thread_datestamp', |
---|
251 | 'to_type' => 'topic', |
---|
252 | 'to_fieldname' => 'post_modified_gmt', |
---|
253 | 'callback_method' => 'callback_datetime' |
---|
254 | ); |
---|
255 | $this->field_map[] = array( |
---|
256 | 'from_tablename' => 'forum_thread', |
---|
257 | 'from_fieldname' => 'thread_lastpost', |
---|
258 | 'to_type' => 'topic', |
---|
259 | 'to_fieldname' => '_bbp_last_active_time', |
---|
260 | 'callback_method' => 'callback_datetime' |
---|
261 | ); |
---|
262 | /* |
---|
263 | /** Tags Section ******************************************************/ |
---|
264 | |
---|
265 | /** |
---|
266 | * e107 v2.x Forums do not support topic tags out of the box |
---|
267 | */ |
---|
268 | |
---|
269 | /** Reply Section *****************************************************/ |
---|
270 | |
---|
271 | // Reply id (Stored in postmeta) |
---|
272 | $this->field_map[] = array( |
---|
273 | 'from_tablename' => 'forum_post', |
---|
274 | 'from_fieldname' => 'post_id', |
---|
275 | 'to_type' => 'reply', |
---|
276 | 'to_fieldname' => '_bbp_post_id' |
---|
277 | ); |
---|
278 | |
---|
279 | // Reply parent forum id (If no parent, then 0. Stored in postmeta) |
---|
280 | $this->field_map[] = array( |
---|
281 | 'from_tablename' => 'forum_post', |
---|
282 | 'from_fieldname' => 'post_forum', |
---|
283 | 'to_type' => 'reply', |
---|
284 | 'to_fieldname' => '_bbp_forum_id', |
---|
285 | 'callback_method' => 'callback_topicid_to_forumid' |
---|
286 | ); |
---|
287 | |
---|
288 | // Reply parent topic id (If no parent, then 0. Stored in postmeta) |
---|
289 | $this->field_map[] = array( |
---|
290 | 'from_tablename' => 'forum_post', |
---|
291 | 'from_fieldname' => 'post_thread', |
---|
292 | 'to_type' => 'reply', |
---|
293 | 'to_fieldname' => '_bbp_topic_id', |
---|
294 | 'callback_method' => 'callback_topicid' |
---|
295 | ); |
---|
296 | |
---|
297 | // Reply author ip (Stored in postmeta) |
---|
298 | $this->field_map[] = array( |
---|
299 | 'from_tablename' => 'forum_post', |
---|
300 | 'from_fieldname' => 'post_ip', |
---|
301 | 'to_type' => 'reply', |
---|
302 | 'to_fieldname' => '_bbp_author_ip' |
---|
303 | ); |
---|
304 | |
---|
305 | // Reply author. |
---|
306 | $this->field_map[] = array( |
---|
307 | 'from_tablename' => 'forum_post', |
---|
308 | 'from_fieldname' => 'post_user', |
---|
309 | 'to_type' => 'reply', |
---|
310 | 'to_fieldname' => 'post_author', |
---|
311 | 'callback_method' => 'callback_userid' |
---|
312 | ); |
---|
313 | |
---|
314 | // Reply title. |
---|
315 | // Note: We join the 'forum_thread' table because 'forum_post' table does not include reply title. |
---|
316 | $this->field_map[] = array( |
---|
317 | 'from_tablename' => 'forum_thread', |
---|
318 | 'from_fieldname' => 'thread_name', |
---|
319 | 'join_tablename' => 'forum_post', |
---|
320 | 'join_type' => 'RIGHT', |
---|
321 | 'join_expression' => 'ON forum_post.post_thread = forum_thread.thread_id', |
---|
322 | 'to_type' => 'reply', |
---|
323 | 'to_fieldname' => 'post_title', |
---|
324 | 'callback_method' => 'callback_reply_title' |
---|
325 | ); |
---|
326 | |
---|
327 | // Reply slug (Clean name to avoid conflicts) |
---|
328 | // Note: We join the 'forum_thread' table because 'forum_post' table does not include reply slug. |
---|
329 | $this->field_map[] = array( |
---|
330 | 'from_tablename' => 'forum_thread', |
---|
331 | 'from_fieldname' => 'thread_name', |
---|
332 | 'join_tablename' => 'forum_post', |
---|
333 | 'join_type' => 'RIGHT', |
---|
334 | 'join_expression' => 'ON forum_post.post_thread = forum_thread.thread_id', |
---|
335 | 'to_type' => 'reply', |
---|
336 | 'to_fieldname' => 'post_name', |
---|
337 | 'callback_method' => 'callback_slug' |
---|
338 | ); |
---|
339 | |
---|
340 | // Reply content. |
---|
341 | // Note: We join the 'field_data_forum_post_body' table because 'forum_post' table does not have content. |
---|
342 | $this->field_map[] = array( |
---|
343 | 'from_tablename' => 'forum_post', |
---|
344 | 'from_fieldname' => 'post_entry', |
---|
345 | 'to_type' => 'reply', |
---|
346 | 'to_fieldname' => 'post_content', |
---|
347 | 'callback_method' => 'callback_html' |
---|
348 | ); |
---|
349 | |
---|
350 | // Reply parent topic id (If no parent, then 0) |
---|
351 | $this->field_map[] = array( |
---|
352 | 'from_tablename' => 'forum_post', |
---|
353 | 'from_fieldname' => 'post_thread', |
---|
354 | 'to_type' => 'reply', |
---|
355 | 'to_fieldname' => 'post_parent', |
---|
356 | 'callback_method' => 'callback_topicid' |
---|
357 | ); |
---|
358 | |
---|
359 | // Reply dates. |
---|
360 | $this->field_map[] = array( |
---|
361 | 'from_tablename' => 'forum_post', |
---|
362 | 'from_fieldname' => 'post_datestamp', |
---|
363 | 'to_type' => 'reply', |
---|
364 | 'to_fieldname' => 'post_date', |
---|
365 | 'callback_method' => 'callback_datetime' |
---|
366 | ); |
---|
367 | $this->field_map[] = array( |
---|
368 | 'from_tablename' => 'forum_post', |
---|
369 | 'from_fieldname' => 'post_datestamp', |
---|
370 | 'to_type' => 'reply', |
---|
371 | 'to_fieldname' => 'post_date_gmt', |
---|
372 | 'callback_method' => 'callback_datetime' |
---|
373 | ); |
---|
374 | $this->field_map[] = array( |
---|
375 | 'from_tablename' => 'forum_post', |
---|
376 | 'from_fieldname' => 'post_datestamp', |
---|
377 | 'to_type' => 'reply', |
---|
378 | 'to_fieldname' => 'post_modified', |
---|
379 | 'callback_method' => 'callback_datetime' |
---|
380 | ); |
---|
381 | $this->field_map[] = array( |
---|
382 | 'from_tablename' => 'forum_post', |
---|
383 | 'from_fieldname' => 'post_datestamp', |
---|
384 | 'to_type' => 'reply', |
---|
385 | 'to_fieldname' => 'post_modified_gmt', |
---|
386 | 'callback_method' => 'callback_datetime' |
---|
387 | ); |
---|
388 | |
---|
389 | /** User Section ******************************************************/ |
---|
390 | |
---|
391 | // Store old User id (Stored in usermeta) |
---|
392 | $this->field_map[] = array( |
---|
393 | 'from_tablename' => 'user', |
---|
394 | 'from_fieldname' => 'user_id', |
---|
395 | 'to_type' => 'user', |
---|
396 | 'to_fieldname' => '_bbp_user_id' |
---|
397 | ); |
---|
398 | |
---|
399 | // Store old User password (Stored in usermeta serialized with salt) |
---|
400 | $this->field_map[] = array( |
---|
401 | 'from_tablename' => 'user', |
---|
402 | 'from_fieldname' => 'user_password', |
---|
403 | 'to_type' => 'user', |
---|
404 | 'to_fieldname' => '_bbp_password' |
---|
405 | // 'callback_method' => 'callback_savepass' |
---|
406 | ); |
---|
407 | |
---|
408 | // Store old User Salt (This is only used for the SELECT row info for the above password save) |
---|
409 | // $this->field_map[] = array( |
---|
410 | // 'from_tablename' => 'user', |
---|
411 | // 'from_fieldname' => 'pass', |
---|
412 | // 'to_type' => 'user', |
---|
413 | // 'to_fieldname' => '' |
---|
414 | // ); |
---|
415 | |
---|
416 | // User password verify class (Stored in usermeta for verifying password) |
---|
417 | $this->field_map[] = array( |
---|
418 | 'to_type' => 'user', |
---|
419 | 'to_fieldname' => '_bbp_class', |
---|
420 | 'default' => 'e107v2' |
---|
421 | ); |
---|
422 | |
---|
423 | // User name. |
---|
424 | $this->field_map[] = array( |
---|
425 | 'from_tablename' => 'user', |
---|
426 | 'from_fieldname' => 'user_loginname', |
---|
427 | 'to_type' => 'user', |
---|
428 | 'to_fieldname' => 'user_login' |
---|
429 | ); |
---|
430 | |
---|
431 | // User nice name. |
---|
432 | $this->field_map[] = array( |
---|
433 | 'from_tablename' => 'user', |
---|
434 | 'from_fieldname' => 'user_loginname', |
---|
435 | 'to_type' => 'user', |
---|
436 | 'to_fieldname' => 'user_nicename' |
---|
437 | ); |
---|
438 | |
---|
439 | // User email. |
---|
440 | $this->field_map[] = array( |
---|
441 | 'from_tablename' => 'user', |
---|
442 | 'from_fieldname' => 'user_email', |
---|
443 | 'to_type' => 'user', |
---|
444 | 'to_fieldname' => 'user_email' |
---|
445 | ); |
---|
446 | |
---|
447 | // User registered. |
---|
448 | $this->field_map[] = array( |
---|
449 | 'from_tablename' => 'user', |
---|
450 | 'from_fieldname' => 'user_join', |
---|
451 | 'to_type' => 'user', |
---|
452 | 'to_fieldname' => 'user_registered', |
---|
453 | 'callback_method' => 'callback_datetime' |
---|
454 | ); |
---|
455 | |
---|
456 | // User display name. |
---|
457 | $this->field_map[] = array( |
---|
458 | 'from_tablename' => 'user', |
---|
459 | 'from_fieldname' => 'user_name', |
---|
460 | 'to_type' => 'user', |
---|
461 | 'to_fieldname' => 'display_name' |
---|
462 | ); |
---|
463 | |
---|
464 | // Store Signature (Stored in usermeta) |
---|
465 | $this->field_map[] = array( |
---|
466 | 'from_tablename' => 'user', |
---|
467 | 'from_fieldname' => 'user_signature', |
---|
468 | 'to_fieldname' => '_bbp_e107v2_user_sig', |
---|
469 | 'to_type' => 'user', |
---|
470 | 'callback_method' => 'callback_html' |
---|
471 | ); |
---|
472 | } |
---|
473 | |
---|
474 | /** |
---|
475 | * This method allows us to indicates what is or is not converted for each |
---|
476 | * converter. |
---|
477 | */ |
---|
478 | public function info() |
---|
479 | { |
---|
480 | return ''; |
---|
481 | } |
---|
482 | |
---|
483 | /** |
---|
484 | * This method is to save the salt and password together. That |
---|
485 | * way when we authenticate it we can get it out of the database |
---|
486 | * as one value. Array values are auto sanitized by WordPress. |
---|
487 | */ |
---|
488 | public function callback_savepass( $field, $row ) |
---|
489 | { |
---|
490 | $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] ); |
---|
491 | return $pass_array; |
---|
492 | } |
---|
493 | |
---|
494 | /** |
---|
495 | * This method is to take the pass out of the database and compare |
---|
496 | * to a pass the user has typed in. |
---|
497 | */ |
---|
498 | public function authenticate_pass( $password, $serialized_pass ) |
---|
499 | { |
---|
500 | $pass_array = unserialize( $serialized_pass ); |
---|
501 | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
---|
502 | } |
---|
503 | |
---|
504 | /** |
---|
505 | * Translate the forum type from e107 v2.x numeric's to WordPress's strings. |
---|
506 | * |
---|
507 | * @param int $status e107 v2.x numeric forum type |
---|
508 | * @return string WordPress safe |
---|
509 | */ |
---|
510 | public function callback_forum_type( $status = 0 ) { |
---|
511 | if ( $status == 0 ) { |
---|
512 | $status = 'category'; |
---|
513 | } else { |
---|
514 | $status = 'forum'; |
---|
515 | } |
---|
516 | return $status; |
---|
517 | } |
---|
518 | |
---|
519 | /** |
---|
520 | * Verify the topic/reply count. |
---|
521 | * |
---|
522 | * @param int $count e107 v2.x topic/reply counts |
---|
523 | * @return string WordPress safe |
---|
524 | */ |
---|
525 | public function callback_topic_reply_count( $count = 1 ) { |
---|
526 | $count = absint( (int) $count - 1 ); |
---|
527 | return $count; |
---|
528 | } |
---|
529 | |
---|
530 | /** |
---|
531 | * Set the reply title |
---|
532 | * |
---|
533 | * @param string $title e107 v2.x topic title of this reply |
---|
534 | * @return string Prefixed topic title, or empty string |
---|
535 | */ |
---|
536 | public function callback_reply_title( $title = '' ) { |
---|
537 | $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : ''; |
---|
538 | return $title; |
---|
539 | } |
---|
540 | } |
---|