PluginProbe
bbPress / 2.6.19
bbPress v2.6.19
2.6.19 2.6.18 2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 All 74 releases
bbpress / includes / admin / converters / XMB.php

XMB.php in bbPress 2.6.19, at includes/admin/converters/XMB.php

719 lines 20.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * bbPress XMB Converter
5 *
6 * @package bbPress
7 * @subpackage Converters
8 */
9
10 /**
11 * Implementation of XMB Forum converter.
12 *
13 * @since 2.5.0 bbPress (r5144)
14 *
15 * @link Codex Docs https://codex.bbpress.org/import-forums/xmb
16 */
17 class XMB extends BBP_Converter_Base {
18
19 /**
20 * Main Constructor
21 *
22 */
23 public function __construct() {
24 parent::__construct();
25 }
26
27 /**
28 * Sets up the field mappings
29 */
30 public function setup_globals() {
31
32 /** Forum Section *****************************************************/
33
34 // Old forum id (Stored in postmeta)
35 $this->field_map[] = array(
36 'from_tablename' => 'forums',
37 'from_fieldname' => 'fid',
38 'to_type' => 'forum',
39 'to_fieldname' => '_bbp_old_forum_id'
40 );
41
42 // Forum parent id (If no parent, then 0, Stored in postmeta)
43 $this->field_map[] = array(
44 'from_tablename' => 'forums',
45 'from_fieldname' => 'fup',
46 'to_type' => 'forum',
47 'to_fieldname' => '_bbp_old_forum_parent_id'
48 );
49
50 // Forum topic count (Stored in postmeta)
51 $this->field_map[] = array(
52 'from_tablename' => 'forums',
53 'from_fieldname' => 'threads',
54 'to_type' => 'forum',
55 'to_fieldname' => '_bbp_topic_count'
56 );
57
58 // Forum reply count (Stored in postmeta)
59 $this->field_map[] = array(
60 'from_tablename' => 'forums',
61 'from_fieldname' => 'posts',
62 'to_type' => 'forum',
63 'to_fieldname' => '_bbp_reply_count'
64 );
65
66 // Forum total topic count (Includes unpublished topics, Stored in postmeta)
67 $this->field_map[] = array(
68 'from_tablename' => 'forums',
69 'from_fieldname' => 'threads',
70 'to_type' => 'forum',
71 'to_fieldname' => '_bbp_total_topic_count'
72 );
73
74 // Forum total reply count (Includes unpublished replies, Stored in postmeta)
75 $this->field_map[] = array(
76 'from_tablename' => 'forums',
77 'from_fieldname' => 'posts',
78 'to_type' => 'forum',
79 'to_fieldname' => '_bbp_total_reply_count'
80 );
81
82 // Forum title.
83 $this->field_map[] = array(
84 'from_tablename' => 'forums',
85 'from_fieldname' => 'name',
86 'to_type' => 'forum',
87 'to_fieldname' => 'post_title'
88 );
89
90 // Forum slug (Clean name to avoid conflicts)
91 $this->field_map[] = array(
92 'from_tablename' => 'forums',
93 'from_fieldname' => 'name',
94 'to_type' => 'forum',
95 'to_fieldname' => 'post_name',
96 'callback_method' => 'callback_slug'
97 );
98
99 // Forum description.
100 $this->field_map[] = array(
101 'from_tablename' => 'forums',
102 'from_fieldname' => 'description',
103 'to_type' => 'forum',
104 'to_fieldname' => 'post_content',
105 'callback_method' => 'callback_null'
106 );
107
108 // Forum display order (Starts from 1)
109 $this->field_map[] = array(
110 'from_tablename' => 'forums',
111 'from_fieldname' => 'displayorder',
112 'to_type' => 'forum',
113 'to_fieldname' => 'menu_order'
114 );
115
116 // Forum type (Category = 'group', Forum = 'forum' or 'sub', Stored in postmeta)
117 $this->field_map[] = array(
118 'from_tablename' => 'forums',
119 'from_fieldname' => 'type',
120 'to_type' => 'forum',
121 'to_fieldname' => '_bbp_forum_type',
122 'callback_method' => 'callback_forum_type'
123 );
124
125 // Forum status (Set a default value 'open', Stored in postmeta)
126 $this->field_map[] = array(
127 'to_type' => 'forum',
128 'to_fieldname' => '_bbp_status',
129 'default' => 'open'
130 );
131
132 // Forum dates.
133 $this->field_map[] = array(
134 'to_type' => 'forum',
135 'to_fieldname' => 'post_date',
136 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
137 );
138 $this->field_map[] = array(
139 'to_type' => 'forum',
140 'to_fieldname' => 'post_date_gmt',
141 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
142 );
143 $this->field_map[] = array(
144 'to_type' => 'forum',
145 'to_fieldname' => 'post_modified',
146 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
147 );
148 $this->field_map[] = array(
149 'to_type' => 'forum',
150 'to_fieldname' => 'post_modified_gmt',
151 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
152 );
153
154 /** Topic Section *****************************************************/
155
156 // Old topic id (Stored in postmeta)
157 $this->field_map[] = array(
158 'from_tablename' => 'threads',
159 'from_fieldname' => 'tid',
160 'to_type' => 'topic',
161 'to_fieldname' => '_bbp_old_topic_id'
162 );
163
164 // Topic reply count (Stored in postmeta)
165 $this->field_map[] = array(
166 'from_tablename' => 'threads',
167 'from_fieldname' => 'replies',
168 'to_type' => 'topic',
169 'to_fieldname' => '_bbp_reply_count',
170 'callback_method' => 'callback_topic_reply_count'
171 );
172
173 // Topic total reply count (Includes unpublished replies, Stored in postmeta)
174 $this->field_map[] = array(
175 'from_tablename' => 'threads',
176 'from_fieldname' => 'replies',
177 'to_type' => 'topic',
178 'to_fieldname' => '_bbp_total_reply_count',
179 'callback_method' => 'callback_topic_reply_count'
180 );
181
182 // Topic parent forum id (If no parent, then 0. Stored in postmeta)
183 $this->field_map[] = array(
184 'from_tablename' => 'threads',
185 'from_fieldname' => 'fid',
186 'to_type' => 'topic',
187 'to_fieldname' => '_bbp_forum_id',
188 'callback_method' => 'callback_forumid'
189 );
190
191 // Topic author.
192 // Note: We join the 'members' table because 'threads' table does not have numerical author id.
193 $this->field_map[] = array(
194 'from_tablename' => 'members',
195 'from_fieldname' => 'uid',
196 'join_tablename' => 'threads',
197 'join_type' => 'LEFT',
198 'join_expression' => 'ON threads.author = members.username',
199 'to_type' => 'topic',
200 'to_fieldname' => 'post_author',
201 'callback_method' => 'callback_userid'
202 );
203
204 // Topic author name (Stored in postmeta as _bbp_anonymous_name)
205 $this->field_map[] = array(
206 'from_tablename' => 'threads',
207 'from_fieldname' => 'author',
208 'to_type' => 'topic',
209 'to_fieldname' => '_bbp_old_topic_author_name_id'
210 );
211
212 // Is the topic anonymous (Stored in postmeta)
213 $this->field_map[] = array(
214 'from_tablename' => 'members',
215 'from_fieldname' => 'uid',
216 'join_tablename' => 'threads',
217 'join_type' => 'LEFT',
218 'join_expression' => 'ON threads.author = members.username WHERE posts.subject = ""',
219 'to_type' => 'topic',
220 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
221 'callback_method' => 'callback_check_anonymous'
222 );
223
224 // Topic Author ip (Stored in postmeta)
225 // Note: We join the 'posts' table because 'threads' table does not have author ip.
226 $this->field_map[] = array(
227 'from_tablename' => 'posts',
228 'from_fieldname' => 'useip',
229 'join_tablename' => 'threads',
230 'join_type' => 'INNER',
231 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
232 'to_type' => 'topic',
233 'to_fieldname' => '_bbp_author_ip'
234 );
235
236 // Topic content.
237 // Note: We join the 'posts' table because 'threads' table does not have content.
238 $this->field_map[] = array(
239 'from_tablename' => 'posts',
240 'from_fieldname' => 'message',
241 'join_tablename' => 'threads',
242 'join_type' => 'INNER',
243 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
244 'to_type' => 'topic',
245 'to_fieldname' => 'post_content',
246 'callback_method' => 'callback_html'
247 );
248
249 // Topic title.
250 $this->field_map[] = array(
251 'from_tablename' => 'threads',
252 'from_fieldname' => 'subject',
253 'to_type' => 'topic',
254 'to_fieldname' => 'post_title'
255 );
256
257 // Topic slug (Clean name to avoid conflicts)
258 $this->field_map[] = array(
259 'from_tablename' => 'threads',
260 'from_fieldname' => 'subject',
261 'to_type' => 'topic',
262 'to_fieldname' => 'post_name',
263 'callback_method' => 'callback_slug'
264 );
265
266 // Topic parent forum id (If no parent, then 0)
267 $this->field_map[] = array(
268 'from_tablename' => 'threads',
269 'from_fieldname' => 'fid',
270 'to_type' => 'topic',
271 'to_fieldname' => 'post_parent',
272 'callback_method' => 'callback_forumid'
273 );
274
275 // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)
276 $this->field_map[] = array(
277 'from_tablename' => 'threads',
278 'from_fieldname' => 'closed',
279 'to_type' => 'topic',
280 'to_fieldname' => '_bbp_old_closed_status_id',
281 'callback_method' => 'callback_topic_status'
282 );
283
284 // Sticky status (Stored in postmeta)
285 $this->field_map[] = array(
286 'from_tablename' => 'threads',
287 'from_fieldname' => 'topped',
288 'to_type' => 'topic',
289 'to_fieldname' => '_bbp_old_sticky_status_id',
290 'callback_method' => 'callback_sticky_status'
291 );
292
293 // Topic dates.
294 // Note: We join the 'posts' table because 'threads' table does not include dates.
295 $this->field_map[] = array(
296 'from_tablename' => 'posts',
297 'from_fieldname' => 'dateline',
298 'join_tablename' => 'threads',
299 'join_type' => 'INNER',
300 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
301 'to_type' => 'topic',
302 'to_fieldname' => 'post_date',
303 'callback_method' => 'callback_datetime'
304 );
305 $this->field_map[] = array(
306 'from_tablename' => 'posts',
307 'from_fieldname' => 'dateline',
308 'join_tablename' => 'threads',
309 'join_type' => 'INNER',
310 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
311 'to_type' => 'topic',
312 'to_fieldname' => 'post_date_gmt',
313 'callback_method' => 'callback_datetime'
314 );
315 $this->field_map[] = array(
316 'from_tablename' => 'posts',
317 'from_fieldname' => 'dateline',
318 'join_tablename' => 'threads',
319 'join_type' => 'INNER',
320 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
321 'to_type' => 'topic',
322 'to_fieldname' => 'post_modified',
323 'callback_method' => 'callback_datetime'
324 );
325 $this->field_map[] = array(
326 'from_tablename' => 'posts',
327 'from_fieldname' => 'dateline',
328 'join_tablename' => 'threads',
329 'join_type' => 'INNER',
330 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
331 'to_type' => 'topic',
332 'to_fieldname' => 'post_modified_gmt',
333 'callback_method' => 'callback_datetime'
334 );
335 $this->field_map[] = array(
336 'from_tablename' => 'posts',
337 'from_fieldname' => 'dateline',
338 'join_tablename' => 'threads',
339 'join_type' => 'INNER',
340 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
341 'to_type' => 'topic',
342 'to_fieldname' => '_bbp_last_active_time',
343 'callback_method' => 'callback_datetime'
344 );
345
346 /** Tags Section ******************************************************/
347
348 /**
349 * XMB v1.9.11.13 Forums do not support topic tags out of the box
350 */
351
352 /** Reply Section *****************************************************/
353
354 // Old reply id (Stored in postmeta)
355 $this->field_map[] = array(
356 'from_tablename' => 'posts',
357 'from_fieldname' => 'pid',
358 'to_type' => 'reply',
359 'to_fieldname' => '_bbp_old_reply_id'
360 );
361
362 // Reply parent forum id (If no parent, then 0. Stored in postmeta)
363 $this->field_map[] = array(
364 'from_tablename' => 'posts',
365 'from_fieldname' => 'fid',
366 'to_type' => 'reply',
367 'to_fieldname' => '_bbp_forum_id',
368 'callback_method' => 'callback_topicid_to_forumid'
369 );
370
371 // Reply parent topic id (If no parent, then 0. Stored in postmeta)
372 $this->field_map[] = array(
373 'from_tablename' => 'posts',
374 'from_fieldname' => 'tid',
375 'to_type' => 'reply',
376 'to_fieldname' => '_bbp_topic_id',
377 'callback_method' => 'callback_topicid'
378 );
379
380 // Reply author ip (Stored in postmeta)
381 $this->field_map[] = array(
382 'from_tablename' => 'posts',
383 'from_fieldname' => 'useip',
384 'to_type' => 'reply',
385 'to_fieldname' => '_bbp_author_ip'
386 );
387
388 // Reply author.
389 // Note: We join the 'members' table because 'posts' table does not have numerical author id.
390 $this->field_map[] = array(
391 'from_tablename' => 'members',
392 'from_fieldname' => 'uid',
393 'join_tablename' => 'posts',
394 'join_type' => 'LEFT',
395 'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
396 'to_type' => 'reply',
397 'to_fieldname' => 'post_author',
398 'callback_method' => 'callback_userid'
399 );
400
401 // Reply author name (Stored in postmeta as _bbp_anonymous_name)
402 $this->field_map[] = array(
403 'from_tablename' => 'posts',
404 'from_fieldname' => 'author',
405 'to_type' => 'reply',
406 'to_fieldname' => '_bbp_old_reply_author_name_id'
407 );
408
409 // Is the reply anonymous (Stored in postmeta)
410 $this->field_map[] = array(
411 'from_tablename' => 'members',
412 'from_fieldname' => 'uid',
413 'join_tablename' => 'posts',
414 'join_type' => 'LEFT',
415 'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
416 'to_type' => 'reply',
417 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
418 'callback_method' => 'callback_check_anonymous'
419 );
420
421 // Reply content.
422 $this->field_map[] = array(
423 'from_tablename' => 'posts',
424 'from_fieldname' => 'message',
425 'to_type' => 'reply',
426 'to_fieldname' => 'post_content',
427 'callback_method' => 'callback_html'
428 );
429
430 // Reply parent topic id (If no parent, then 0)
431 $this->field_map[] = array(
432 'from_tablename' => 'posts',
433 'from_fieldname' => 'tid',
434 'to_type' => 'reply',
435 'to_fieldname' => 'post_parent',
436 'callback_method' => 'callback_topicid'
437 );
438
439 // Reply dates.
440 $this->field_map[] = array(
441 'from_tablename' => 'posts',
442 'from_fieldname' => 'dateline',
443 'to_type' => 'reply',
444 'to_fieldname' => 'post_date',
445 'callback_method' => 'callback_datetime'
446 );
447 $this->field_map[] = array(
448 'from_tablename' => 'posts',
449 'from_fieldname' => 'dateline',
450 'to_type' => 'reply',
451 'to_fieldname' => 'post_date_gmt',
452 'callback_method' => 'callback_datetime'
453 );
454 $this->field_map[] = array(
455 'from_tablename' => 'posts',
456 'from_fieldname' => 'dateline',
457 'to_type' => 'reply',
458 'to_fieldname' => 'post_modified',
459 'callback_method' => 'callback_datetime'
460 );
461 $this->field_map[] = array(
462 'from_tablename' => 'posts',
463 'from_fieldname' => 'dateline',
464 'to_type' => 'reply',
465 'to_fieldname' => 'post_modified_gmt',
466 'callback_method' => 'callback_datetime'
467 );
468
469 /** User Section ******************************************************/
470
471 // Store old user id (Stored in usermeta)
472 $this->field_map[] = array(
473 'from_tablename' => 'members',
474 'from_fieldname' => 'uid',
475 'to_type' => 'user',
476 'to_fieldname' => '_bbp_old_user_id'
477 );
478
479 // Store old User password (Stored in usermeta serialized with salt)
480 $this->field_map[] = array(
481 'from_tablename' => 'members',
482 'from_fieldname' => 'password',
483 'to_type' => 'user',
484 'to_fieldname' => '_bbp_password',
485 'callback_method' => 'callback_savepass'
486 );
487
488 // User password verify class (Stored in usermeta for verifying password)
489 $this->field_map[] = array(
490 'to_type' => 'user',
491 'to_fieldname' => '_bbp_class',
492 'default' => 'XMB'
493 );
494
495 // User name.
496 $this->field_map[] = array(
497 'from_tablename' => 'members',
498 'from_fieldname' => 'username',
499 'to_type' => 'user',
500 'to_fieldname' => 'user_login'
501 );
502
503 // User nice name.
504 $this->field_map[] = array(
505 'from_tablename' => 'members',
506 'from_fieldname' => 'username',
507 'to_type' => 'user',
508 'to_fieldname' => 'user_nicename'
509 );
510
511 // User email.
512 $this->field_map[] = array(
513 'from_tablename' => 'members',
514 'from_fieldname' => 'email',
515 'to_type' => 'user',
516 'to_fieldname' => 'user_email'
517 );
518
519 // User homepage.
520 $this->field_map[] = array(
521 'from_tablename' => 'members',
522 'from_fieldname' => 'site',
523 'to_type' => 'user',
524 'to_fieldname' => 'user_url'
525 );
526
527 // User registered.
528 $this->field_map[] = array(
529 'from_tablename' => 'members',
530 'from_fieldname' => 'regdate',
531 'to_type' => 'user',
532 'to_fieldname' => 'user_registered',
533 'callback_method' => 'callback_datetime'
534 );
535
536 // User AIM (Stored in usermeta)
537 $this->field_map[] = array(
538 'from_tablename' => 'members',
539 'from_fieldname' => 'aim',
540 'to_type' => 'user',
541 'to_fieldname' => '_bbp_xmb_user_aim'
542 );
543
544 // User Yahoo (Stored in usermeta)
545 $this->field_map[] = array(
546 'from_tablename' => 'members',
547 'from_fieldname' => 'yahoo',
548 'to_type' => 'user',
549 'to_fieldname' => '_bbp_xmb_user_yim'
550 );
551
552 // Store ICQ (Stored in usermeta)
553 $this->field_map[] = array(
554 'from_tablename' => 'members',
555 'from_fieldname' => 'icq',
556 'to_type' => 'user',
557 'to_fieldname' => '_bbp_xmb_user_icq'
558 );
559
560 // Store MSN (Stored in usermeta)
561 $this->field_map[] = array(
562 'from_tablename' => 'members',
563 'from_fieldname' => 'msn',
564 'to_type' => 'user',
565 'to_fieldname' => '_bbp_xmb_user_msn'
566 );
567
568 // Store Signature (Stored in usermeta)
569 $this->field_map[] = array(
570 'from_tablename' => 'members',
571 'from_fieldname' => 'sig',
572 'to_type' => 'user',
573 'to_fieldname' => '_bbp_xmb_user_sig',
574 'callback_method' => 'callback_html'
575 );
576
577 // Store Bio (Stored in usermeta)
578 $this->field_map[] = array(
579 'from_tablename' => 'members',
580 'from_fieldname' => 'bio',
581 'to_type' => 'user',
582 'to_fieldname' => '_bbp_xmb_user_bio',
583 'callback_method' => 'callback_html'
584 );
585
586 // Store Location (Stored in usermeta)
587 $this->field_map[] = array(
588 'from_tablename' => 'members',
589 'from_fieldname' => 'location',
590 'to_type' => 'user',
591 'to_fieldname' => '_bbp_xmb_user_location'
592 );
593
594 // Store Avatar (Stored in usermeta)
595 $this->field_map[] = array(
596 'from_tablename' => 'members',
597 'from_fieldname' => 'avatar',
598 'to_type' => 'user',
599 'to_fieldname' => '_bbp_xmb_user_avatar'
600 );
601
602 // Store Mood (Stored in usermeta)
603 $this->field_map[] = array(
604 'from_tablename' => 'members',
605 'from_fieldname' => 'mood',
606 'to_type' => 'user',
607 'to_fieldname' => '_bbp_xmb_user_mood'
608 );
609 }
610
611 /**
612 * This method allows us to indicates what is or is not converted for each
613 * converter.
614 */
615 public function info() {
616 return '';
617 }
618
619 /**
620 * Store the old password hash as an array. Array values are auto
621 * sanitized by WordPress.
622 */
623 public function callback_savepass( $field, $row ) {
624 return array( 'hash' => $field );
625 }
626
627 /**
628 * This method is to take the pass out of the database and compare
629 * to a pass the user has typed in.
630 */
631 public function authenticate_pass( $password, $serialized_pass ) {
632
633 // Unserialize the password, with safeguards
634 $pass_array = $this->unserialize_pass( $serialized_pass );
635
636 // Bail if missing or invalid values
637 if ( ! is_string( $password ) || ! is_array( $pass_array ) || ! isset( $pass_array['hash'] ) || ! is_string( $pass_array['hash'] ) ) {
638 return false;
639 }
640
641 return hash_equals( $pass_array['hash'], md5( $password ) );
642 }
643
644 /**
645 * Translate the forum type from XMB v1.9.11.13 Capitalised case to WordPress's non-capatilise case strings.
646 *
647 * @param int $status XMB v1.9.11.13 numeric forum type
648 * @return string WordPress safe
649 */
650 public function callback_forum_type( $status = 1 ) {
651 switch ( $status ) {
652 case 'group' :
653 $status = 'category';
654 break;
655
656 case 'sub' :
657 $status = 'forum';
658 break;
659
660 case 'forum' :
661 default :
662 $status = 'forum';
663 break;
664 }
665 return $status;
666 }
667
668 /**
669 * Translate the post status from XMB v1.9.11.13 numerics to WordPress's strings.
670 *
671 * @param int $status XMB v1.9.11.13 numeric topic status
672 * @return string WordPress safe
673 */
674 public function callback_topic_status( $status = '' ) {
675 switch ( $status ) {
676 case 'yes' :
677 $status = 'closed';
678 break;
679
680 case '' :
681 default :
682 $status = 'publish';
683 break;
684 }
685 return $status;
686 }
687
688 /**
689 * Translate the topic sticky status type from XMB v1.9.11.13 numerics to WordPress's strings.
690 *
691 * @param int $status XMB v1.9.11.13 numeric forum type
692 * @return string WordPress safe
693 */
694 public function callback_sticky_status( $status = 0 ) {
695 switch ( $status ) {
696 case 1 :
697 $status = 'sticky'; // XMB Sticky 'topped = 1'
698 break;
699
700 case 0 :
701 default :
702 $status = 'normal'; // XMB Normal Topic 'topped = 0'
703 break;
704 }
705 return $status;
706 }
707
708 /**
709 * Verify the topic/reply count.
710 *
711 * @param int $count XMB v1.9.11.13 topic/reply counts
712 * @return string WordPress safe
713 */
714 public function callback_topic_reply_count( $count = 1 ) {
715 $count = absint( (int) $count - 1 );
716 return $count;
717 }
718 }
719