bbPress - Version 2.5

Version Description

  • Added forum subscriptions
  • Added importers for AEF, Drupal, FluxBB, Kunena Forums (Joomla), MyBB, Phorum, PHPFox, PHPWind, PunBB, SMF, Xenforo and XMB
  • Added BuddyPress Notifications integration
  • Added ability to enqueue scripts and styles in the template stack
  • Fix various existing importer scripts
  • Fix forum visibility meta saving
  • Fix Akismet anonymous user meta checking
  • Fix inconsistent bbp_dropdown() results
  • Fix topic and reply ping-status inconsistencies
Download this release

Release Info

Developer johnjamesjacoby
Plugin Icon 128x128 bbPress
Version 2.5
Comparing to
See all releases

Code changes from version 2.4.1 to 2.5

Files changed (75) hide show
  1. bbpress.php +21 -139
  2. humans.txt +6 -2
  3. includes/admin/admin.php +67 -48
  4. includes/admin/converter.php +106 -6
  5. includes/admin/converters/AEF.php +691 -0
  6. includes/admin/converters/Drupal7.php +587 -0
  7. includes/admin/converters/Example.php +29 -3
  8. includes/admin/converters/FluxBB.php +646 -0
  9. includes/admin/converters/Invision.php +58 -35
  10. includes/admin/converters/Kunena1.php +546 -0
  11. includes/admin/converters/Kunena2.php +588 -0
  12. includes/admin/converters/Kunena3.php +815 -0
  13. includes/admin/converters/Mingle.php +32 -3
  14. includes/admin/converters/MyBB.php +591 -0
  15. includes/admin/converters/PHPFox3.php +652 -0
  16. includes/admin/converters/PHPWind.php +585 -0
  17. includes/admin/converters/Phorum.php +545 -0
  18. includes/admin/converters/PunBB.php +680 -0
  19. includes/admin/converters/SMF.php +740 -0
  20. includes/admin/converters/SimplePress5.php +56 -11
  21. includes/admin/converters/Vanilla.php +22 -1
  22. includes/admin/converters/XMB.php +709 -0
  23. includes/admin/converters/XenForo.php +725 -0
  24. includes/admin/converters/bbPress1.php +101 -6
  25. includes/admin/converters/phpBB.php +108 -32
  26. includes/admin/converters/vBulletin.php +134 -18
  27. includes/admin/converters/vBulletin3.php +707 -0
  28. includes/admin/functions.php +9 -2
  29. includes/admin/metaboxes.php +6 -3
  30. includes/admin/settings.php +2 -2
  31. includes/admin/tools.php +130 -34
  32. includes/common/classes.php +5 -11
  33. includes/common/functions.php +135 -13
  34. includes/common/shortcodes.php +5 -1
  35. includes/common/template.php +93 -56
  36. includes/common/widgets.php +0 -1
  37. includes/core/actions.php +26 -22
  38. includes/core/filters.php +19 -10
  39. includes/core/template-functions.php +123 -4
  40. includes/core/theme-compat.php +3 -3
  41. includes/core/update.php +11 -4
  42. includes/extend/akismet.php +2 -2
  43. includes/extend/buddypress/functions.php +36 -0
  44. includes/extend/buddypress/loader.php +5 -0
  45. includes/extend/buddypress/notifications.php +155 -0
  46. includes/forums/functions.php +45 -0
  47. includes/forums/template.php +165 -0
  48. includes/replies/functions.php +0 -4
  49. includes/replies/template.php +94 -5
  50. includes/search/template.php +7 -13
  51. includes/topics/functions.php +4 -2
  52. includes/topics/template.php +192 -3
  53. includes/users/capabilities.php +4 -4
  54. includes/users/functions.php +570 -60
  55. includes/users/template.php +286 -36
  56. languages/bbpress.pot +835 -677
  57. readme.txt +13 -2
  58. templates/default/bbpress-functions.php +170 -148
  59. templates/default/bbpress/content-archive-forum.php +2 -0
  60. templates/default/bbpress/content-search.php +1 -1
  61. templates/default/bbpress/content-single-forum.php +2 -0
  62. templates/default/bbpress/content-single-topic-lead.php +2 -2
  63. templates/default/bbpress/content-single-view.php +1 -1
  64. templates/default/bbpress/form-anonymous.php +4 -4
  65. templates/default/bbpress/form-reply-move.php +1 -2
  66. templates/default/bbpress/form-topic-merge.php +1 -2
  67. templates/default/bbpress/form-topic-split.php +1 -2
  68. templates/default/bbpress/loop-replies.php +1 -1
  69. templates/default/bbpress/loop-single-forum.php +14 -0
  70. templates/default/bbpress/loop-single-topic.php +4 -4
  71. templates/default/bbpress/user-subscriptions.php +17 -2
  72. templates/default/css/bbpress-rtl.css +152 -1150
  73. templates/default/css/bbpress.css +9 -9
  74. templates/default/js/editor.js +50 -0
  75. templates/default/js/user.js +3 -0
bbpress.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * bbPress is forum software with a twist from the creators of WordPress.
7
  *
8
- * $Id: bbpress.php 5127 2013-10-10 23:11:01Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
@@ -17,7 +17,7 @@
17
  * Description: bbPress is forum software with a twist from the creators of WordPress.
18
  * Author: The bbPress Community
19
  * Author URI: http://bbpress.org
20
- * Version: 2.4.1
21
  * Text Domain: bbpress
22
  * Domain Path: /languages/
23
  */
@@ -190,8 +190,8 @@ final class bbPress {
190
 
191
  /** Versions **********************************************************/
192
 
193
- $this->version = '2.4.1';
194
- $this->db_version = '240';
195
 
196
  /** Paths *************************************************************/
197
 
@@ -243,6 +243,7 @@ final class bbPress {
243
 
244
  /** Queries ***********************************************************/
245
 
 
246
  $this->current_forum_id = 0; // Current forum id
247
  $this->current_topic_id = 0; // Current topic id
248
  $this->current_reply_id = 0; // Current reply id
@@ -456,6 +457,9 @@ final class bbPress {
456
 
457
  // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
458
  load_textdomain( $this->domain, $mofile_local );
 
 
 
459
  }
460
 
461
  /**
@@ -468,50 +472,15 @@ final class bbPress {
468
  */
469
  public static function register_post_types() {
470
 
471
- // Define local variable(s)
472
- $post_type = array();
473
-
474
  /** Forums ************************************************************/
475
 
476
- // Forum labels
477
- $post_type['labels'] = array(
478
- 'name' => __( 'Forums', 'bbpress' ),
479
- 'menu_name' => __( 'Forums', 'bbpress' ),
480
- 'singular_name' => __( 'Forum', 'bbpress' ),
481
- 'all_items' => __( 'All Forums', 'bbpress' ),
482
- 'add_new' => __( 'New Forum', 'bbpress' ),
483
- 'add_new_item' => __( 'Create New Forum', 'bbpress' ),
484
- 'edit' => __( 'Edit', 'bbpress' ),
485
- 'edit_item' => __( 'Edit Forum', 'bbpress' ),
486
- 'new_item' => __( 'New Forum', 'bbpress' ),
487
- 'view' => __( 'View Forum', 'bbpress' ),
488
- 'view_item' => __( 'View Forum', 'bbpress' ),
489
- 'search_items' => __( 'Search Forums', 'bbpress' ),
490
- 'not_found' => __( 'No forums found', 'bbpress' ),
491
- 'not_found_in_trash' => __( 'No forums found in Trash', 'bbpress' ),
492
- 'parent_item_colon' => __( 'Parent Forum:', 'bbpress' )
493
- );
494
-
495
- // Forum rewrite
496
- $post_type['rewrite'] = array(
497
- 'slug' => bbp_get_forum_slug(),
498
- 'with_front' => false
499
- );
500
-
501
- // Forum supports
502
- $post_type['supports'] = array(
503
- 'title',
504
- 'editor',
505
- 'revisions'
506
- );
507
-
508
  // Register Forum content type
509
  register_post_type(
510
  bbp_get_forum_post_type(),
511
  apply_filters( 'bbp_register_forum_post_type', array(
512
- 'labels' => $post_type['labels'],
513
- 'rewrite' => $post_type['rewrite'],
514
- 'supports' => $post_type['supports'],
515
  'description' => __( 'bbPress Forums', 'bbpress' ),
516
  'capabilities' => bbp_get_forum_caps(),
517
  'capability_type' => array( 'forum', 'forums' ),
@@ -530,45 +499,13 @@ final class bbPress {
530
 
531
  /** Topics ************************************************************/
532
 
533
- // Topic labels
534
- $post_type['labels'] = array(
535
- 'name' => __( 'Topics', 'bbpress' ),
536
- 'menu_name' => __( 'Topics', 'bbpress' ),
537
- 'singular_name' => __( 'Topic', 'bbpress' ),
538
- 'all_items' => __( 'All Topics', 'bbpress' ),
539
- 'add_new' => __( 'New Topic', 'bbpress' ),
540
- 'add_new_item' => __( 'Create New Topic', 'bbpress' ),
541
- 'edit' => __( 'Edit', 'bbpress' ),
542
- 'edit_item' => __( 'Edit Topic', 'bbpress' ),
543
- 'new_item' => __( 'New Topic', 'bbpress' ),
544
- 'view' => __( 'View Topic', 'bbpress' ),
545
- 'view_item' => __( 'View Topic', 'bbpress' ),
546
- 'search_items' => __( 'Search Topics', 'bbpress' ),
547
- 'not_found' => __( 'No topics found', 'bbpress' ),
548
- 'not_found_in_trash' => __( 'No topics found in Trash', 'bbpress' ),
549
- 'parent_item_colon' => __( 'Forum:', 'bbpress' )
550
- );
551
-
552
- // Topic rewrite
553
- $post_type['rewrite'] = array(
554
- 'slug' => bbp_get_topic_slug(),
555
- 'with_front' => false
556
- );
557
-
558
- // Topic supports
559
- $post_type['supports'] = array(
560
- 'title',
561
- 'editor',
562
- 'revisions'
563
- );
564
-
565
  // Register Topic content type
566
  register_post_type(
567
  bbp_get_topic_post_type(),
568
  apply_filters( 'bbp_register_topic_post_type', array(
569
- 'labels' => $post_type['labels'],
570
- 'rewrite' => $post_type['rewrite'],
571
- 'supports' => $post_type['supports'],
572
  'description' => __( 'bbPress Topics', 'bbpress' ),
573
  'capabilities' => bbp_get_topic_caps(),
574
  'capability_type' => array( 'topic', 'topics' ),
@@ -587,45 +524,13 @@ final class bbPress {
587
 
588
  /** Replies ***********************************************************/
589
 
590
- // Reply labels
591
- $post_type['labels'] = array(
592
- 'name' => __( 'Replies', 'bbpress' ),
593
- 'menu_name' => __( 'Replies', 'bbpress' ),
594
- 'singular_name' => __( 'Reply', 'bbpress' ),
595
- 'all_items' => __( 'All Replies', 'bbpress' ),
596
- 'add_new' => __( 'New Reply', 'bbpress' ),
597
- 'add_new_item' => __( 'Create New Reply', 'bbpress' ),
598
- 'edit' => __( 'Edit', 'bbpress' ),
599
- 'edit_item' => __( 'Edit Reply', 'bbpress' ),
600
- 'new_item' => __( 'New Reply', 'bbpress' ),
601
- 'view' => __( 'View Reply', 'bbpress' ),
602
- 'view_item' => __( 'View Reply', 'bbpress' ),
603
- 'search_items' => __( 'Search Replies', 'bbpress' ),
604
- 'not_found' => __( 'No replies found', 'bbpress' ),
605
- 'not_found_in_trash' => __( 'No replies found in Trash', 'bbpress' ),
606
- 'parent_item_colon' => __( 'Topic:', 'bbpress' )
607
- );
608
-
609
- // Reply rewrite
610
- $post_type['rewrite'] = array(
611
- 'slug' => bbp_get_reply_slug(),
612
- 'with_front' => false
613
- );
614
-
615
- // Reply supports
616
- $post_type['supports'] = array(
617
- 'title',
618
- 'editor',
619
- 'revisions'
620
- );
621
-
622
  // Register reply content type
623
  register_post_type(
624
  bbp_get_reply_post_type(),
625
  apply_filters( 'bbp_register_reply_post_type', array(
626
- 'labels' => $post_type['labels'],
627
- 'rewrite' => $post_type['rewrite'],
628
- 'supports' => $post_type['supports'],
629
  'description' => __( 'bbPress Replies', 'bbpress' ),
630
  'capabilities' => bbp_get_reply_caps(),
631
  'capability_type' => array( 'reply', 'replies' ),
@@ -739,36 +644,13 @@ final class bbPress {
739
  */
740
  public static function register_taxonomies() {
741
 
742
- // Define local variable(s)
743
- $topic_tag = array();
744
-
745
- // Topic tag labels
746
- $topic_tag['labels'] = array(
747
- 'name' => __( 'Topic Tags', 'bbpress' ),
748
- 'singular_name' => __( 'Topic Tag', 'bbpress' ),
749
- 'search_items' => __( 'Search Tags', 'bbpress' ),
750
- 'popular_items' => __( 'Popular Tags', 'bbpress' ),
751
- 'all_items' => __( 'All Tags', 'bbpress' ),
752
- 'edit_item' => __( 'Edit Tag', 'bbpress' ),
753
- 'update_item' => __( 'Update Tag', 'bbpress' ),
754
- 'add_new_item' => __( 'Add New Tag', 'bbpress' ),
755
- 'new_item_name' => __( 'New Tag Name', 'bbpress' ),
756
- 'view_item' => __( 'View Topic Tag', 'bbpress' )
757
- );
758
-
759
- // Topic tag rewrite
760
- $topic_tag['rewrite'] = array(
761
- 'slug' => bbp_get_topic_tag_tax_slug(),
762
- 'with_front' => false
763
- );
764
-
765
- // Register the topic tag taxonomy
766
  register_taxonomy(
767
  bbp_get_topic_tag_tax_id(),
768
  bbp_get_topic_post_type(),
769
  apply_filters( 'bbp_register_topic_taxonomy', array(
770
- 'labels' => $topic_tag['labels'],
771
- 'rewrite' => $topic_tag['rewrite'],
772
  'capabilities' => bbp_get_topic_tag_caps(),
773
  'update_count_callback' => '_update_post_term_count',
774
  'query_var' => true,
@@ -899,7 +781,7 @@ final class bbPress {
899
 
900
  // Unique rewrite ID's
901
  $feed_id = 'feed';
902
- $edit_id = 'edit';
903
  $view_id = bbp_get_view_rewrite_id();
904
  $paged_id = bbp_get_paged_rewrite_id();
905
  $search_id = bbp_get_search_rewrite_id();
5
  *
6
  * bbPress is forum software with a twist from the creators of WordPress.
7
  *
8
+ * $Id: bbpress.php 5199 2013-11-25 06:37:25Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
17
  * Description: bbPress is forum software with a twist from the creators of WordPress.
18
  * Author: The bbPress Community
19
  * Author URI: http://bbpress.org
20
+ * Version: 2.5
21
  * Text Domain: bbpress
22
  * Domain Path: /languages/
23
  */
190
 
191
  /** Versions **********************************************************/
192
 
193
+ $this->version = '2.5-5199';
194
+ $this->db_version = '250';
195
 
196
  /** Paths *************************************************************/
197
 
243
 
244
  /** Queries ***********************************************************/
245
 
246
+ $this->current_view_id = 0; // Current view id
247
  $this->current_forum_id = 0; // Current forum id
248
  $this->current_topic_id = 0; // Current topic id
249
  $this->current_reply_id = 0; // Current reply id
457
 
458
  // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
459
  load_textdomain( $this->domain, $mofile_local );
460
+
461
+ // Look in global /wp-content/languages/plugins/
462
+ load_plugin_textdomain( $this->domain );
463
  }
464
 
465
  /**
472
  */
473
  public static function register_post_types() {
474
 
 
 
 
475
  /** Forums ************************************************************/
476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  // Register Forum content type
478
  register_post_type(
479
  bbp_get_forum_post_type(),
480
  apply_filters( 'bbp_register_forum_post_type', array(
481
+ 'labels' => bbp_get_forum_post_type_labels(),
482
+ 'rewrite' => bbp_get_forum_post_type_rewrite(),
483
+ 'supports' => bbp_get_forum_post_type_supports(),
484
  'description' => __( 'bbPress Forums', 'bbpress' ),
485
  'capabilities' => bbp_get_forum_caps(),
486
  'capability_type' => array( 'forum', 'forums' ),
499
 
500
  /** Topics ************************************************************/
501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  // Register Topic content type
503
  register_post_type(
504
  bbp_get_topic_post_type(),
505
  apply_filters( 'bbp_register_topic_post_type', array(
506
+ 'labels' => bbp_get_topic_post_type_labels(),
507
+ 'rewrite' => bbp_get_topic_post_type_rewrite(),
508
+ 'supports' => bbp_get_topic_post_type_supports(),
509
  'description' => __( 'bbPress Topics', 'bbpress' ),
510
  'capabilities' => bbp_get_topic_caps(),
511
  'capability_type' => array( 'topic', 'topics' ),
524
 
525
  /** Replies ***********************************************************/
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  // Register reply content type
528
  register_post_type(
529
  bbp_get_reply_post_type(),
530
  apply_filters( 'bbp_register_reply_post_type', array(
531
+ 'labels' => bbp_get_reply_post_type_labels(),
532
+ 'rewrite' => bbp_get_reply_post_type_rewrite(),
533
+ 'supports' => bbp_get_reply_post_type_supports(),
534
  'description' => __( 'bbPress Replies', 'bbpress' ),
535
  'capabilities' => bbp_get_reply_caps(),
536
  'capability_type' => array( 'reply', 'replies' ),
644
  */
645
  public static function register_taxonomies() {
646
 
647
+ // Register the topic-tag taxonomy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
648
  register_taxonomy(
649
  bbp_get_topic_tag_tax_id(),
650
  bbp_get_topic_post_type(),
651
  apply_filters( 'bbp_register_topic_taxonomy', array(
652
+ 'labels' => bbp_get_topic_tag_tax_labels(),
653
+ 'rewrite' => bbp_get_topic_tag_tax_rewrite(),
654
  'capabilities' => bbp_get_topic_tag_caps(),
655
  'update_count_callback' => '_update_post_term_count',
656
  'query_var' => true,
781
 
782
  // Unique rewrite ID's
783
  $feed_id = 'feed';
784
+ $edit_id = bbp_get_edit_rewrite_id();
785
  $view_id = bbp_get_view_rewrite_id();
786
  $paged_id = bbp_get_paged_rewrite_id();
787
  $search_id = bbp_get_search_rewrite_id();
humans.txt CHANGED
@@ -42,9 +42,13 @@ Name: Jennifer M. Dodd
42
  Title: Core Contributor
43
  Twitter: jmdodd
44
 
 
 
 
 
45
  /* THANKS */
46
- Mike Adams, Gautam Gupta, Ben L, Justin Tadlock, cnorris23, anointed, andy, nacin, netweb
47
 
48
  /* META */
49
- Updated: 2012/12/22
50
  See: http://humanstxt.org/
42
  Title: Core Contributor
43
  Twitter: jmdodd
44
 
45
+ Name: Stephen Edgar
46
+ Title: Core Contributor
47
+ Twitter: netweb
48
+
49
  /* THANKS */
50
+ Mike Adams, Gautam Gupta, Ben L, Justin Tadlock, cnorris23, anointed, andy, nacin
51
 
52
  /* META */
53
+ Updated: 2013/11/25
54
  See: http://humanstxt.org/
includes/admin/admin.php CHANGED
@@ -124,14 +124,15 @@ class BBP_Admin {
124
 
125
  /** General Actions ***************************************************/
126
 
127
- add_action( 'bbp_admin_menu', array( $this, 'admin_menus' ) ); // Add menu item to settings menu
128
- add_action( 'bbp_admin_head', array( $this, 'admin_head' ) ); // Add some general styling to the admin area
129
- add_action( 'bbp_admin_notices', array( $this, 'activation_notice' ) ); // Add notice if not using a bbPress theme
130
- add_action( 'bbp_register_admin_style', array( $this, 'register_admin_style' ) ); // Add green admin style
131
- add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) ); // Add settings
132
- add_action( 'bbp_activation', array( $this, 'new_install' ) ); // Add menu item to settings menu
133
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Add enqueued JS and CSS
134
- add_action( 'wp_dashboard_setup', array( $this, 'dashboard_widget_right_now' ) ); // Forums 'Right now' Dashboard widget
 
135
 
136
  /** Ajax **************************************************************/
137
 
@@ -487,14 +488,25 @@ class BBP_Admin {
487
  public static function modify_plugin_action_links( $links, $file ) {
488
 
489
  // Return normal links if not bbPress
490
- if ( plugin_basename( bbpress()->file ) !== $file )
491
  return $links;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
 
493
  // Add a few links to the existing links array
494
- return array_merge( $links, array(
495
- 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>',
496
- 'about' => '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>'
497
- ) );
498
  }
499
 
500
  /**
@@ -508,9 +520,29 @@ class BBP_Admin {
508
  wp_add_dashboard_widget( 'bbp-dashboard-right-now', __( 'Right Now in Forums', 'bbpress' ), 'bbp_dashboard_widget_right_now' );
509
  }
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  /**
512
  * Enqueue any admin scripts we might need
513
- * @since bbPress (4260)
514
  */
515
  public function enqueue_scripts() {
516
  wp_enqueue_script( 'suggest' );
@@ -1330,7 +1362,7 @@ class BBP_Admin {
1330
  */
1331
  public function suggest_topic() {
1332
 
1333
- // TRy to get some topics
1334
  $topics = get_posts( array(
1335
  's' => like_escape( $_REQUEST['q'] ),
1336
  'post_type' => bbp_get_topic_post_type()
@@ -1382,7 +1414,7 @@ class BBP_Admin {
1382
 
1383
  <div class="wrap about-wrap">
1384
  <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
1385
- <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', 'bbpress' ), $display_version ); ?></div>
1386
  <div class="bbp-badge"><?php printf( esc_html__( 'Version %s', 'bbpress' ), $display_version ); ?></div>
1387
 
1388
  <h2 class="nav-tab-wrapper">
@@ -1394,55 +1426,44 @@ class BBP_Admin {
1394
  </h2>
1395
 
1396
  <div class="changelog">
1397
- <h3><?php esc_html_e( 'Hierarchical Replies', 'bbpress' ); ?></h3>
1398
 
1399
  <div class="feature-section col two-col">
1400
  <div class="last-feature">
1401
- <h4><?php esc_html_e( 'Reply to replies', 'bbpress' ); ?></h4>
1402
- <p><?php esc_html_e( 'Now your users can reply to specific replies, providing context to each inidividual post.', 'bbpress' ); ?></p>
1403
  </div>
1404
 
1405
  <div>
1406
- <h4><?php esc_html_e( 'Choose your own discussion style', 'bbpress' ); ?></h4>
1407
- <p><?php esc_html_e( 'Stay flat or go threaded, and seamlessly switch between the two.', 'bbpress' ); ?></p>
1408
  </div>
1409
  </div>
1410
  </div>
1411
 
1412
  <div class="changelog">
1413
- <h3><?php esc_html_e( 'Under the Hood', 'bbpress' ); ?></h3>
1414
-
1415
- <div class="feature-section col three-col">
1416
- <div>
1417
- <h4><?php esc_html_e( 'Preformatted text', 'bbpress' ); ?></h4>
1418
- <p><?php esc_html_e( 'Forum users can post code snippets with confidence.', 'bbpress' ); ?></p>
1419
- </div>
1420
-
1421
- <div>
1422
- <h4><?php esc_html_e( 'Polyglot support', 'bbpress' ); ?></h4>
1423
- <p><?php esc_html_e( 'bbPress is ready for future translation API improvements.', 'bbpress' ); ?></p>
1424
- </div>
1425
 
 
1426
  <div class="last-feature">
1427
- <h4><?php esc_html_e( 'User capabilities', 'bbpress' ); ?></h4>
1428
- <p><?php esc_html_e( 'Roles and capabilities have been swept through, cleaned up, and simplified.', 'bbpress' ); ?></p>
1429
  </div>
1430
  </div>
1431
 
1432
  <div class="feature-section col three-col">
1433
  <div>
1434
- <h4><?php esc_html_e( 'Search', 'bbpress' ); ?></h4>
1435
- <p><?php esc_html_e( 'Search results use pretty permalinks, and have a dedicated output page.', 'bbpress' ); ?></p>
1436
  </div>
1437
 
1438
  <div>
1439
- <h4><?php esc_html_e( 'Settings', 'bbpress' ); ?></h4>
1440
- <p><?php esc_html_e( 'Fields and sections have been reordered and reorganized.', 'bbpress' ); ?></p>
1441
  </div>
1442
 
1443
  <div class="last-feature">
1444
- <h4><?php esc_html_e( 'BuddyPress', 'bbpress' ); ?></h4>
1445
- <p><?php esc_html_e( 'Forums are now fully and seamlessly integrated into BuddyPress Groups.', 'bbpress' ); ?></p>
1446
  </div>
1447
  </div>
1448
  </div>
@@ -1500,15 +1521,15 @@ class BBP_Admin {
1500
  <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
1501
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
1502
  </li>
1503
- </ul>
1504
-
1505
- <h4 class="wp-people-group"><?php esc_html_e( 'Contributing Developers', 'bbpress' ); ?></h4>
1506
- <ul class="wp-people-group " id="wp-people-group-contributing-developers">
1507
  <li class="wp-person" id="wp-person-netweb">
1508
  <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
1509
  <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
1510
  <span class="title"><?php esc_html_e( 'Converter Specialist', 'bbpress' ); ?></span>
1511
  </li>
 
 
 
 
1512
  <li class="wp-person" id="wp-person-jaredatch">
1513
  <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
1514
  <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
@@ -1521,7 +1542,7 @@ class BBP_Admin {
1521
  </li>
1522
  </ul>
1523
 
1524
- <h4 class="wp-people-group"><?php esc_html_e( 'Core Contributors to bbPress 2.4', 'bbpress' ); ?></h4>
1525
  <p class="wp-credits-list">
1526
  <a href="http://profiles.wordpress.org/alex-ye">alex-ye</a>,
1527
  <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>,
@@ -1646,8 +1667,6 @@ class BBP_Admin {
1646
  <p><?php esc_html_e( 'All done!', 'bbpress' ); ?></p>
1647
  <a class="button" href="update-core.php?page=bbpress-update"><?php esc_html_e( 'Go Back', 'bbpress' ); ?></a>
1648
 
1649
- <?php break; ?>
1650
-
1651
  <?php
1652
 
1653
  // Still have sites to loop through
124
 
125
  /** General Actions ***************************************************/
126
 
127
+ add_action( 'bbp_admin_menu', array( $this, 'admin_menus' ) ); // Add menu item to settings menu
128
+ add_action( 'bbp_admin_head', array( $this, 'admin_head' ) ); // Add some general styling to the admin area
129
+ add_action( 'bbp_admin_notices', array( $this, 'activation_notice' ) ); // Add notice if not using a bbPress theme
130
+ add_action( 'bbp_register_admin_style', array( $this, 'register_admin_style' ) ); // Add green admin style
131
+ add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) ); // Add settings
132
+ add_action( 'bbp_activation', array( $this, 'new_install' ) ); // Add menu item to settings menu
133
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Add enqueued JS and CSS
134
+ add_action( 'wp_dashboard_setup', array( $this, 'dashboard_widget_right_now' ) ); // Forums 'Right now' Dashboard widget
135
+ add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 ); // Add a link to bbPress about page to the admin bar
136
 
137
  /** Ajax **************************************************************/
138
 
488
  public static function modify_plugin_action_links( $links, $file ) {
489
 
490
  // Return normal links if not bbPress
491
+ if ( plugin_basename( bbpress()->file ) !== $file ) {
492
  return $links;
493
+ }
494
+
495
+ // New links to merge into existing links
496
+ $new_links = array();
497
+
498
+ // Settings page link
499
+ if ( current_user_can( 'bbp_settings_page' ) ) {
500
+ $new_links['settings'] = '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>';
501
+ }
502
+
503
+ // About page link
504
+ if ( current_user_can( 'bbp_about_page' ) ) {
505
+ $new_links['about'] = '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>';
506
+ }
507
 
508
  // Add a few links to the existing links array
509
+ return array_merge( $links, $new_links );
 
 
 
510
  }
511
 
512
  /**
520
  wp_add_dashboard_widget( 'bbp-dashboard-right-now', __( 'Right Now in Forums', 'bbpress' ), 'bbp_dashboard_widget_right_now' );
521
  }
522
 
523
+ /**
524
+ * Add a link to bbPress about page to the admin bar
525
+ *
526
+ * @since bbPress (r5136)
527
+ *
528
+ * @param WP_Admin_Bar $wp_admin_bar
529
+ */
530
+ public function admin_bar_about_link( $wp_admin_bar ) {
531
+
532
+ if ( is_user_logged_in() ) {
533
+
534
+ $wp_admin_bar->add_menu( array(
535
+ 'parent' => 'wp-logo',
536
+ 'id' => 'bbp-about',
537
+ 'title' => esc_html__( 'About bbPress', 'bbpress' ),
538
+ 'href' => add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) )
539
+ ) );
540
+ }
541
+ }
542
+
543
  /**
544
  * Enqueue any admin scripts we might need
545
+ * @since bbPress (r4260)
546
  */
547
  public function enqueue_scripts() {
548
  wp_enqueue_script( 'suggest' );
1362
  */
1363
  public function suggest_topic() {
1364
 
1365
+ // Try to get some topics
1366
  $topics = get_posts( array(
1367
  's' => like_escape( $_REQUEST['q'] ),
1368
  'post_type' => bbp_get_topic_post_type()
1414
 
1415
  <div class="wrap about-wrap">
1416
  <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
1417
+ <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is bundled up and ready to weather the storm of users in your community!', 'bbpress' ), $display_version ); ?></div>
1418
  <div class="bbp-badge"><?php printf( esc_html__( 'Version %s', 'bbpress' ), $display_version ); ?></div>
1419
 
1420
  <h2 class="nav-tab-wrapper">
1426
  </h2>
1427
 
1428
  <div class="changelog">
1429
+ <h3><?php esc_html_e( 'Forum Subscriptions', 'bbpress' ); ?></h3>
1430
 
1431
  <div class="feature-section col two-col">
1432
  <div class="last-feature">
1433
+ <h4><?php esc_html_e( 'Subscribe to Forums', 'bbpress' ); ?></h4>
1434
+ <p><?php esc_html_e( 'Now your users can subscribe to new topics in specific forums.', 'bbpress' ); ?></p>
1435
  </div>
1436
 
1437
  <div>
1438
+ <h4><?php esc_html_e( 'Manage Subscriptions', 'bbpress' ); ?></h4>
1439
+ <p><?php esc_html_e( 'Your users can manage all of their subscriptions in one convenient location.', 'bbpress' ); ?></p>
1440
  </div>
1441
  </div>
1442
  </div>
1443
 
1444
  <div class="changelog">
1445
+ <h3><?php esc_html_e( 'Converters', 'bbpress' ); ?></h3>
 
 
 
 
 
 
 
 
 
 
 
1446
 
1447
+ <div class="feature-section col one-col">
1448
  <div class="last-feature">
1449
+ <p><?php esc_html_e( 'We&#8217;re all abuzz about the hive of new importers, AEF, Drupal, FluxBB, Kunena Forums for Joomla, MyBB, Phorum, PHPFox, PHPWind, PunBB, SMF, Xenforo and XMB. Existing importers are now sweeter than honey with improved importing stickies, topic tags, forum categories and the sting is now gone if you need to remove imported users.', 'bbpress' ); ?></p>
 
1450
  </div>
1451
  </div>
1452
 
1453
  <div class="feature-section col three-col">
1454
  <div>
1455
+ <h4><?php esc_html_e( 'Theme Compatibility', 'bbpress' ); ?></h4>
1456
+ <p><?php esc_html_e( 'Better handling of styles and scripts in the template stack.', 'bbpress' ); ?></p>
1457
  </div>
1458
 
1459
  <div>
1460
+ <h4><?php esc_html_e( 'Polyglot support', 'bbpress' ); ?></h4>
1461
+ <p><?php esc_html_e( 'bbPress fully supports automatic translation updates.', 'bbpress' ); ?></p>
1462
  </div>
1463
 
1464
  <div class="last-feature">
1465
+ <h4><?php esc_html_e( 'User capabilities', 'bbpress' ); ?></h4>
1466
+ <p><?php esc_html_e( 'Roles and capabilities have been swept through, cleaned up, and simplified.', 'bbpress' ); ?></p>
1467
  </div>
1468
  </div>
1469
  </div>
1521
  <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
1522
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
1523
  </li>
 
 
 
 
1524
  <li class="wp-person" id="wp-person-netweb">
1525
  <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
1526
  <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
1527
  <span class="title"><?php esc_html_e( 'Converter Specialist', 'bbpress' ); ?></span>
1528
  </li>
1529
+ </ul>
1530
+
1531
+ <h4 class="wp-people-group"><?php esc_html_e( 'Contributing Developers', 'bbpress' ); ?></h4>
1532
+ <ul class="wp-people-group " id="wp-people-group-contributing-developers">
1533
  <li class="wp-person" id="wp-person-jaredatch">
1534
  <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
1535
  <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
1542
  </li>
1543
  </ul>
1544
 
1545
+ <h4 class="wp-people-group"><?php esc_html_e( 'Core Contributors to bbPress 2.5', 'bbpress' ); ?></h4>
1546
  <p class="wp-credits-list">
1547
  <a href="http://profiles.wordpress.org/alex-ye">alex-ye</a>,
1548
  <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>,
1667
  <p><?php esc_html_e( 'All done!', 'bbpress' ); ?></p>
1668
  <a class="button" href="update-core.php?page=bbpress-update"><?php esc_html_e( 'Go Back', 'bbpress' ); ?></a>
1669
 
 
 
1670
  <?php
1671
 
1672
  // Still have sites to loop through
includes/admin/converter.php CHANGED
@@ -437,8 +437,38 @@ class BBP_Converter {
437
 
438
  break;
439
 
440
- // STEP 7. Convert tags.
441
  case 7 :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  if ( $converter->convert_tags( $start ) ) {
443
  update_option( '_bbp_converter_step', $step + 1 );
444
  update_option( '_bbp_converter_start', 0 );
@@ -452,8 +482,8 @@ class BBP_Converter {
452
 
453
  break;
454
 
455
- // STEP 8. Convert replies.
456
- case 8 :
457
  if ( $converter->convert_replies( $start ) ) {
458
  update_option( '_bbp_converter_step', $step + 1 );
459
  update_option( '_bbp_converter_start', 0 );
@@ -467,8 +497,8 @@ class BBP_Converter {
467
 
468
  break;
469
 
470
- // STEP 9. Convert reply_to parents.
471
- case 9 :
472
  if ( $converter->convert_reply_to_parents( $start ) ) {
473
  update_option( '_bbp_converter_step', $step + 1 );
474
  update_option( '_bbp_converter_start', 0 );
@@ -949,7 +979,14 @@ abstract class BBP_Converter_Base {
949
 
950
  case 'tags':
951
  $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
952
- break;
 
 
 
 
 
 
 
953
 
954
  /** Forum, Topic, Reply ***************************/
955
 
@@ -1027,6 +1064,69 @@ abstract class BBP_Converter_Base {
1027
  return ! $has_update;
1028
  }
1029
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1030
  /**
1031
  * This method converts old reply_to post id to new bbPress reply_to post id.
1032
  */
437
 
438
  break;
439
 
440
+ // STEP 7. Stick topics.
441
  case 7 :
442
+ if ( $converter->convert_topic_stickies( $start ) ) {
443
+ update_option( '_bbp_converter_step', $step + 1 );
444
+ update_option( '_bbp_converter_start', 0 );
445
+ if ( empty( $start ) ) {
446
+ $this->converter_output( __( 'No stickies to stick', 'bbpress' ) );
447
+ }
448
+ } else {
449
+ update_option( '_bbp_converter_start', $max + 1 );
450
+ $this->converter_output( sprintf( __( 'Calculating topic stickies (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
451
+ }
452
+
453
+ break;
454
+
455
+ // STEP 8. Stick to front topics (Super Sicky).
456
+ case 8 :
457
+ if ( $converter->convert_topic_super_stickies( $start ) ) {
458
+ update_option( '_bbp_converter_step', $step + 1 );
459
+ update_option( '_bbp_converter_start', 0 );
460
+ if ( empty( $start ) ) {
461
+ $this->converter_output( __( 'No super stickies to stick', 'bbpress' ) );
462
+ }
463
+ } else {
464
+ update_option( '_bbp_converter_start', $max + 1 );
465
+ $this->converter_output( sprintf( __( 'Calculating topic super stickies (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
466
+ }
467
+
468
+ break;
469
+
470
+ // STEP 9. Convert tags.
471
+ case 9 :
472
  if ( $converter->convert_tags( $start ) ) {
473
  update_option( '_bbp_converter_step', $step + 1 );
474
  update_option( '_bbp_converter_start', 0 );
482
 
483
  break;
484
 
485
+ // STEP 10. Convert replies.
486
+ case 10 :
487
  if ( $converter->convert_replies( $start ) ) {
488
  update_option( '_bbp_converter_step', $step + 1 );
489
  update_option( '_bbp_converter_start', 0 );
497
 
498
  break;
499
 
500
+ // STEP 11. Convert reply_to parents.
501
+ case 11 :
502
  if ( $converter->convert_reply_to_parents( $start ) ) {
503
  update_option( '_bbp_converter_step', $step + 1 );
504
  update_option( '_bbp_converter_start', 0 );
979
 
980
  case 'tags':
981
  $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
982
+ $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
983
+ if ( false !== $term ) {
984
+ wp_update_term( $term->term_id, 'topic-tag', array(
985
+ 'description' => $insert_postmeta['description'],
986
+ 'slug' => $insert_postmeta['slug']
987
+ ) );
988
+ }
989
+ break;
990
 
991
  /** Forum, Topic, Reply ***************************/
992
 
1064
  return ! $has_update;
1065
  }
1066
 
1067
+ /**
1068
+ * This method converts old topic stickies to new bbPress stickies.
1069
+ *
1070
+ * @since bbPress (r)
1071
+ *
1072
+ * @uses WPDB $wpdb
1073
+ * @uses bbp_stick_topic() to set the imported topic as sticky
1074
+ *
1075
+ */
1076
+ public function convert_topic_stickies( $start ) {
1077
+
1078
+ $has_update = false;
1079
+
1080
+ if ( !empty( $this->sync_table ) ) {
1081
+ $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows;
1082
+ } else {
1083
+ $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows;
1084
+ }
1085
+
1086
+ update_option( '_bbp_converter_query', $query );
1087
+
1088
+ $sticky_array = $this->wpdb->get_results( $query );
1089
+
1090
+ foreach ( (array) $sticky_array as $row ) {
1091
+ bbp_stick_topic( $row->value_id );
1092
+ $has_update = true;
1093
+ }
1094
+
1095
+ return ! $has_update;
1096
+ }
1097
+
1098
+ /**
1099
+ * This method converts old topic super stickies to new bbPress super stickies.
1100
+ *
1101
+ * @since bbPress (r)
1102
+ *
1103
+ * @uses WPDB $wpdb
1104
+ * @uses bbp_stick_topic() to set the imported topic as super sticky
1105
+ *
1106
+ */
1107
+ public function convert_topic_super_stickies( $start ) {
1108
+
1109
+ $has_update = false;
1110
+
1111
+ if ( !empty( $this->sync_table ) ) {
1112
+ $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "super-sticky" LIMIT ' . $start . ', ' . $this->max_rows;
1113
+ } else {
1114
+ $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "super-sticky" LIMIT ' . $start . ', ' . $this->max_rows;
1115
+ }
1116
+
1117
+ update_option( '_bbp_converter_query', $query );
1118
+
1119
+ $sticky_array = $this->wpdb->get_results( $query );
1120
+
1121
+ foreach ( (array) $sticky_array as $row ) {
1122
+ $super = true;
1123
+ bbp_stick_topic( $row->value_id, $super );
1124
+ $has_update = true;
1125
+ }
1126
+
1127
+ return ! $has_update;
1128
+ }
1129
+
1130
  /**
1131
  * This method converts old reply_to post id to new bbPress reply_to post id.
1132
  */
includes/admin/converters/AEF.php ADDED
@@ -0,0 +1,691 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of AEF Forum converter.
5
+ *
6
+ * @since bbPress (r5139)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/aef
8
+ */
9
+ class AEF extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses AEF::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' => 'forums',
31
+ 'from_fieldname' => 'fid',
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' => 'forums',
39
+ 'from_fieldname' => 'par_board_id',
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' => 'forums',
47
+ 'from_fieldname' => 'ntopic',
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' => 'forums',
55
+ 'from_fieldname' => 'nposts',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_reply_count'
58
+ );
59
+
60
+ // Forum total topic count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'ntopic',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_total_topic_count'
66
+ );
67
+
68
+ // Forum total reply count (Stored in postmeta)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'nposts',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_reply_count'
74
+ );
75
+
76
+ // Forum title.
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'forums',
79
+ 'from_fieldname' => 'fname',
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' => 'forums',
87
+ 'from_fieldname' => 'fname',
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' => 'forums',
96
+ 'from_fieldname' => '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' => 'forums',
105
+ 'from_fieldname' => 'forum_order',
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'menu_order'
108
+ );
109
+
110
+ // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forums',
113
+ 'from_fieldname' => 'status',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => '_bbp_status',
116
+ 'callback_method' => 'callback_forum_status'
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' => 'topics',
146
+ 'from_fieldname' => 'tid',
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' => 'topics',
154
+ 'from_fieldname' => 'n_posts',
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' => 'topics',
163
+ 'from_fieldname' => 'n_posts',
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' => 'topics',
172
+ 'from_fieldname' => 't_bid',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => '_bbp_forum_id',
175
+ 'callback_method' => 'callback_forumid'
176
+ );
177
+
178
+ // Topic author.
179
+ // Note: We join the 'posts' table because 'topics' table does not include author id.
180
+ $this->field_map[] = array(
181
+ 'from_tablename' => 'posts',
182
+ 'from_fieldname' => 'poster_id',
183
+ 'join_tablename' => 'topics',
184
+ 'join_type' => 'INNER',
185
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
186
+ 'to_type' => 'topic',
187
+ 'to_fieldname' => 'post_author',
188
+ 'callback_method' => 'callback_userid'
189
+ );
190
+
191
+ // Topic Author ip (Stored in postmeta)
192
+ // Note: We join the 'posts' table because 'topics' table does not include author ip.
193
+ $this->field_map[] = array(
194
+ 'from_tablename' => 'posts',
195
+ 'from_fieldname' => 'poster_ip',
196
+ 'join_tablename' => 'topics',
197
+ 'join_type' => 'INNER',
198
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
199
+ 'to_type' => 'topic',
200
+ 'to_fieldname' => '_bbp_author_ip'
201
+ );
202
+
203
+ // Topic content.
204
+ // Note: We join the 'posts' table because 'topics' table does not include topic content.
205
+ $this->field_map[] = array(
206
+ 'from_tablename' => 'posts',
207
+ 'from_fieldname' => 'post',
208
+ 'join_tablename' => 'topics',
209
+ 'join_type' => 'INNER',
210
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => 'post_content',
213
+ 'callback_method' => 'callback_html'
214
+ );
215
+
216
+ // Topic title.
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'topics',
219
+ 'from_fieldname' => 'topic',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_title'
222
+ );
223
+
224
+ // Topic slug (Clean name to avoid conflicts)
225
+ $this->field_map[] = array(
226
+ 'from_tablename' => 'topics',
227
+ 'from_fieldname' => 'topic',
228
+ 'to_type' => 'topic',
229
+ 'to_fieldname' => 'post_name',
230
+ 'callback_method' => 'callback_slug'
231
+ );
232
+
233
+ // Topic parent forum id (If no parent, then 0)
234
+ $this->field_map[] = array(
235
+ 'from_tablename' => 'topics',
236
+ 'from_fieldname' => 't_bid',
237
+ 'to_type' => 'topic',
238
+ 'to_fieldname' => 'post_parent',
239
+ 'callback_method' => 'callback_forumid'
240
+ );
241
+
242
+ // Sticky status (Stored in postmeta))
243
+ $this->field_map[] = array(
244
+ 'from_tablename' => 'topics',
245
+ 'from_fieldname' => 't_sticky',
246
+ 'to_type' => 'topic',
247
+ 'to_fieldname' => '_bbp_old_sticky_status',
248
+ 'callback_method' => 'callback_sticky_status'
249
+ );
250
+
251
+ // Topic dates.
252
+ // Note: We join the 'posts' table because 'topics' table does not include topic dates.
253
+ $this->field_map[] = array(
254
+ 'from_tablename' => 'posts',
255
+ 'from_fieldname' => 'ptime',
256
+ 'join_tablename' => 'topics',
257
+ 'join_type' => 'INNER',
258
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
259
+ 'to_type' => 'topic',
260
+ 'to_fieldname' => 'post_date',
261
+ 'callback_method' => 'callback_datetime'
262
+ );
263
+ $this->field_map[] = array(
264
+ 'from_tablename' => 'posts',
265
+ 'from_fieldname' => 'ptime',
266
+ 'join_tablename' => 'topics',
267
+ 'join_type' => 'INNER',
268
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
269
+ 'to_type' => 'topic',
270
+ 'to_fieldname' => 'post_date_gmt',
271
+ 'callback_method' => 'callback_datetime'
272
+ );
273
+ $this->field_map[] = array(
274
+ 'from_tablename' => 'posts',
275
+ 'from_fieldname' => 'ptime',
276
+ 'join_tablename' => 'topics',
277
+ 'join_type' => 'INNER',
278
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
279
+ 'to_type' => 'topic',
280
+ 'to_fieldname' => 'post_modified',
281
+ 'callback_method' => 'callback_datetime'
282
+ );
283
+ $this->field_map[] = array(
284
+ 'from_tablename' => 'posts',
285
+ 'from_fieldname' => 'ptime',
286
+ 'join_tablename' => 'topics',
287
+ 'join_type' => 'INNER',
288
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
289
+ 'to_type' => 'topic',
290
+ 'to_fieldname' => 'post_modified_gmt',
291
+ 'callback_method' => 'callback_datetime'
292
+ );
293
+ $this->field_map[] = array(
294
+ 'from_tablename' => 'posts',
295
+ 'from_fieldname' => 'ptime',
296
+ 'join_tablename' => 'topics',
297
+ 'join_type' => 'INNER',
298
+ 'join_expression' => 'ON topics.first_post_id = posts.pid',
299
+ 'to_type' => 'topic',
300
+ 'to_fieldname' => '_bbp_last_active_time',
301
+ 'callback_method' => 'callback_datetime'
302
+ );
303
+
304
+ // Topic status (Open = 1 or Closed = 0, AEF v1.0.9)
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'topics',
307
+ 'from_fieldname' => 't_status',
308
+ 'to_type' => 'topic',
309
+ 'to_fieldname' => 'post_status',
310
+ 'callback_method' => 'callback_topic_status'
311
+ );
312
+
313
+ /** Tags Section ******************************************************/
314
+
315
+ /**
316
+ * AEF v1.0.9 Forums do not support topic tags out of the box
317
+ */
318
+
319
+ /** Reply Section *****************************************************/
320
+
321
+ // Reply id (Stored in postmeta)
322
+ $this->field_map[] = array(
323
+ 'from_tablename' => 'posts',
324
+ 'from_fieldname' => 'pid',
325
+ 'to_type' => 'reply',
326
+ 'to_fieldname' => '_bbp_post_id'
327
+ );
328
+
329
+ // Reply parent forum id (If no parent, then 0, Stored in postmeta)
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'posts',
332
+ 'from_fieldname' => 'post_fid',
333
+ 'to_type' => 'reply',
334
+ 'to_fieldname' => '_bbp_forum_id',
335
+ 'callback_method' => 'callback_topicid_to_forumid'
336
+ );
337
+
338
+ // Reply parent topic id (If no parent, then 0, Stored in postmeta)
339
+ $this->field_map[] = array(
340
+ 'from_tablename' => 'posts',
341
+ 'from_fieldname' => 'post_tid',
342
+ 'to_type' => 'reply',
343
+ 'to_fieldname' => '_bbp_topic_id',
344
+ 'callback_method' => 'callback_topicid'
345
+ );
346
+
347
+ // Reply author ip (Stored in postmeta)
348
+ $this->field_map[] = array(
349
+ 'from_tablename' => 'posts',
350
+ 'from_fieldname' => 'poster_ip',
351
+ 'to_type' => 'reply',
352
+ 'to_fieldname' => '_bbp_author_ip'
353
+ );
354
+
355
+ // Reply author.
356
+ $this->field_map[] = array(
357
+ 'from_tablename' => 'posts',
358
+ 'from_fieldname' => 'poster_id',
359
+ 'to_type' => 'reply',
360
+ 'to_fieldname' => 'post_author',
361
+ 'callback_method' => 'callback_userid'
362
+ );
363
+
364
+ // Reply title.
365
+ // Note: We join the 'topics' table because 'posts' table does not include reply title.
366
+ $this->field_map[] = array(
367
+ 'from_tablename' => 'topics',
368
+ 'from_fieldname' => 'topic',
369
+ 'join_tablename' => 'posts',
370
+ 'join_type' => 'INNER',
371
+ 'join_expression' => 'ON topics.tid = posts.post_tid WHERE topics.first_post_id != posts.pid',
372
+ 'to_type' => 'reply',
373
+ 'to_fieldname' => 'post_title',
374
+ 'callback_method' => 'callback_reply_title'
375
+ );
376
+
377
+ // Reply slug (Clean name to avoid conflicts)
378
+ // Note: We join the 'topics' table because 'posts' table does not include reply slug.
379
+ $this->field_map[] = array(
380
+ 'from_tablename' => 'topics',
381
+ 'from_fieldname' => 'topic',
382
+ 'join_tablename' => 'posts',
383
+ 'join_type' => 'INNER',
384
+ 'join_expression' => 'ON topics.tid = posts.post_tid WHERE topics.first_post_id != posts.pid',
385
+ 'to_type' => 'reply',
386
+ 'to_fieldname' => 'post_name',
387
+ 'callback_method' => 'callback_slug'
388
+ );
389
+
390
+ // Reply content.
391
+ $this->field_map[] = array(
392
+ 'from_tablename' => 'posts',
393
+ 'from_fieldname' => 'post',
394
+ 'to_type' => 'reply',
395
+ 'to_fieldname' => 'post_content',
396
+ 'callback_method' => 'callback_html'
397
+ );
398
+
399
+ // Reply parent topic id (If no parent, then 0)
400
+ $this->field_map[] = array(
401
+ 'from_tablename' => 'posts',
402
+ 'from_fieldname' => 'post_tid',
403
+ 'to_type' => 'reply',
404
+ 'to_fieldname' => 'post_parent',
405
+ 'callback_method' => 'callback_topicid'
406
+ );
407
+
408
+ // Reply dates.
409
+ $this->field_map[] = array(
410
+ 'from_tablename' => 'posts',
411
+ 'from_fieldname' => 'ptime',
412
+ 'to_type' => 'reply',
413
+ 'to_fieldname' => 'post_date',
414
+ 'callback_method' => 'callback_datetime'
415
+ );
416
+ $this->field_map[] = array(
417
+ 'from_tablename' => 'posts',
418
+ 'from_fieldname' => 'ptime',
419
+ 'to_type' => 'reply',
420
+ 'to_fieldname' => 'post_date_gmt',
421
+ 'callback_method' => 'callback_datetime'
422
+ );
423
+ $this->field_map[] = array(
424
+ 'from_tablename' => 'posts',
425
+ 'from_fieldname' => 'ptime',
426
+ 'to_type' => 'reply',
427
+ 'to_fieldname' => 'post_modified',
428
+ 'callback_method' => 'callback_datetime'
429
+ );
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'posts',
432
+ 'from_fieldname' => 'ptime',
433
+ 'to_type' => 'reply',
434
+ 'to_fieldname' => 'post_modified_gmt',
435
+ 'callback_method' => 'callback_datetime'
436
+ );
437
+
438
+ /** User Section ******************************************************/
439
+
440
+ // Store old User id (Stored in usermeta)
441
+ $this->field_map[] = array(
442
+ 'from_tablename' => 'users',
443
+ 'from_fieldname' => 'id',
444
+ 'to_type' => 'user',
445
+ 'to_fieldname' => '_bbp_user_id'
446
+ );
447
+
448
+ // Store old User password (Stored in usermeta serialized with salt)
449
+ $this->field_map[] = array(
450
+ 'from_tablename' => 'users',
451
+ 'from_fieldname' => 'password',
452
+ 'to_type' => 'user',
453
+ 'to_fieldname' => '_bbp_password',
454
+ 'callback_method' => 'callback_savepass'
455
+ );
456
+
457
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
458
+ $this->field_map[] = array(
459
+ 'from_tablename' => 'users',
460
+ 'from_fieldname' => 'salt',
461
+ 'to_type' => 'user',
462
+ 'to_fieldname' => ''
463
+ );
464
+
465
+ // User password verify class (Stored in usermeta for verifying password)
466
+ $this->field_map[] = array(
467
+ 'to_type' => 'users',
468
+ 'to_fieldname' => '_bbp_class',
469
+ 'default' => 'AEF'
470
+ );
471
+
472
+ // User name.
473
+ $this->field_map[] = array(
474
+ 'from_tablename' => 'users',
475
+ 'from_fieldname' => 'username',
476
+ 'to_type' => 'user',
477
+ 'to_fieldname' => 'user_login'
478
+ );
479
+
480
+ // User nice name.
481
+ $this->field_map[] = array(
482
+ 'from_tablename' => 'users',
483
+ 'from_fieldname' => 'username',
484
+ 'to_type' => 'user',
485
+ 'to_fieldname' => 'user_nicename'
486
+ );
487
+
488
+ // User email.
489
+ $this->field_map[] = array(
490
+ 'from_tablename' => 'users',
491
+ 'from_fieldname' => 'email',
492
+ 'to_type' => 'user',
493
+ 'to_fieldname' => 'user_email'
494
+ );
495
+
496
+ // User homepage.
497
+ $this->field_map[] = array(
498
+ 'from_tablename' => 'users',
499
+ 'from_fieldname' => 'www',
500
+ 'to_type' => 'user',
501
+ 'to_fieldname' => 'user_url'
502
+ );
503
+
504
+ // User registered.
505
+ $this->field_map[] = array(
506
+ 'from_tablename' => 'users',
507
+ 'from_fieldname' => 'r_time',
508
+ 'to_type' => 'user',
509
+ 'to_fieldname' => 'user_registered',
510
+ 'callback_method' => 'callback_datetime'
511
+ );
512
+
513
+ // User AIM (Stored in usermeta)
514
+ $this->field_map[] = array(
515
+ 'from_tablename' => 'users',
516
+ 'from_fieldname' => 'aim',
517
+ 'to_type' => 'user',
518
+ 'to_fieldname' => 'aim'
519
+ );
520
+
521
+ // User Yahoo (Stored in usermeta)
522
+ $this->field_map[] = array(
523
+ 'from_tablename' => 'users',
524
+ 'from_fieldname' => 'yim',
525
+ 'to_type' => 'user',
526
+ 'to_fieldname' => 'yim'
527
+ );
528
+
529
+ // Store ICQ (Stored in usermeta)
530
+ $this->field_map[] = array(
531
+ 'from_tablename' => 'users',
532
+ 'from_fieldname' => 'icq',
533
+ 'to_type' => 'user',
534
+ 'to_fieldname' => '_bbp_aef_user_icq'
535
+ );
536
+
537
+ // Store MSN (Stored in usermeta)
538
+ $this->field_map[] = array(
539
+ 'from_tablename' => 'users',
540
+ 'from_fieldname' => 'msn',
541
+ 'to_type' => 'user',
542
+ 'to_fieldname' => '_bbp_aef_user_msn'
543
+ );
544
+
545
+ // Store Gmail (Stored in usermeta)
546
+ $this->field_map[] = array(
547
+ 'from_tablename' => 'users',
548
+ 'from_fieldname' => 'gmail',
549
+ 'to_type' => 'user',
550
+ 'to_fieldname' => '_bbp_aef_user_gmail'
551
+ );
552
+
553
+ // Store Signature (Stored in usermeta)
554
+ $this->field_map[] = array(
555
+ 'from_tablename' => 'users',
556
+ 'from_fieldname' => 'sig',
557
+ 'to_type' => 'user',
558
+ 'to_fieldname' => '_bbp_aef_user_sig',
559
+ 'callback_method' => 'callback_html'
560
+ );
561
+
562
+ // Store Location (Stored in usermeta)
563
+ $this->field_map[] = array(
564
+ 'from_tablename' => 'users',
565
+ 'from_fieldname' => 'location',
566
+ 'to_type' => 'user',
567
+ 'to_fieldname' => '_bbp_aef_user_location'
568
+ );
569
+
570
+ // Store PrivateText (Stored in usermeta)
571
+ $this->field_map[] = array(
572
+ 'from_tablename' => 'users',
573
+ 'from_fieldname' => 'users_text',
574
+ 'to_type' => 'user',
575
+ 'to_fieldname' => '_bbp_aef_user_private_text'
576
+ );
577
+
578
+ }
579
+
580
+ /**
581
+ * This method allows us to indicates what is or is not converted for each
582
+ * converter.
583
+ */
584
+ public function info()
585
+ {
586
+ return '';
587
+ }
588
+
589
+ /**
590
+ * This method is to save the salt and password together. That
591
+ * way when we authenticate it we can get it out of the database
592
+ * as one value. Array values are auto sanitized by WordPress.
593
+ */
594
+ public function callback_savepass( $field, $row )
595
+ {
596
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
597
+ return $pass_array;
598
+ }
599
+
600
+ /**
601
+ * This method is to take the pass out of the database and compare
602
+ * to a pass the user has typed in.
603
+ */
604
+ public function authenticate_pass( $password, $serialized_pass )
605
+ {
606
+ $pass_array = unserialize( $serialized_pass );
607
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
608
+ }
609
+
610
+ /**
611
+ * Translate the forum status from AEF v1.0.9 numeric's to WordPress's strings.
612
+ *
613
+ * @param int $status AEF v1.0.9 numeric forum status
614
+ * @return string WordPress safe
615
+ */
616
+ public function callback_forum_status( $status = 1 ) {
617
+ switch ( $status ) {
618
+ case 0 :
619
+ $status = 'closed';
620
+ break;
621
+
622
+ case 1 :
623
+ default :
624
+ $status = 'open';
625
+ break;
626
+ }
627
+ return $status;
628
+ }
629
+
630
+ /**
631
+ * Translate the post status from AEF v1.0.9 numeric's to WordPress's strings.
632
+ *
633
+ * @param int $status AEF v1.0.9 numeric topic status
634
+ * @return string WordPress safe
635
+ */
636
+ public function callback_topic_status( $status = 1 ) {
637
+ switch ( $status ) {
638
+ case 0 :
639
+ $status = 'closed';
640
+ break;
641
+
642
+ case 1 :
643
+ default :
644
+ $status = 'publish';
645
+ break;
646
+ }
647
+ return $status;
648
+ }
649
+
650
+ /**
651
+ * Translate the topic sticky status type from AEF 1.x numeric's to WordPress's strings.
652
+ *
653
+ * @param int $status AEF 1.x numeric forum type
654
+ * @return string WordPress safe
655
+ */
656
+ public function callback_sticky_status( $status = 0 ) {
657
+ switch ( $status ) {
658
+ case 1 :
659
+ $status = 'sticky'; // AEF Sticky 't_sticky = 1'
660
+ break;
661
+
662
+ case 0 :
663
+ default :
664
+ $status = 'normal'; // AEF normal topic 't_sticky = 0'
665
+ break;
666
+ }
667
+ return $status;
668
+ }
669
+
670
+ /**
671
+ * Verify the topic/reply count.
672
+ *
673
+ * @param int $count AEF v1.0.9 topic/reply counts
674
+ * @return string WordPress safe
675
+ */
676
+ public function callback_topic_reply_count( $count = 1 ) {
677
+ $count = absint( (int) $count - 1 );
678
+ return $count;
679
+ }
680
+
681
+ /**
682
+ * Set the reply title
683
+ *
684
+ * @param string $title AEF v1.0.9 topic title of this reply
685
+ * @return string Prefixed topic title, or empty string
686
+ */
687
+ public function callback_reply_title( $title = '' ) {
688
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
689
+ return $title;
690
+ }
691
+ }
includes/admin/converters/Drupal7.php ADDED
@@ -0,0 +1,587 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of Drupal v7.x Forum converter.
5
+ *
6
+ * @since bbPress (r5057)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/drupal
8
+ */
9
+ class Drupal7 extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses Drupal7::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' => 'taxonomy_term_data',
31
+ 'from_fieldname' => 'tid',
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' => 'taxonomy_term_hierarchy',
39
+ 'from_fieldname' => 'parent',
40
+ 'join_tablename' => 'taxonomy_term_data',
41
+ 'join_type' => 'INNER',
42
+ 'join_expression' => 'USING (tid)',
43
+ 'from_expression' => 'LEFT JOIN taxonomy_vocabulary AS taxonomy_vocabulary USING (vid) WHERE module = "forum"',
44
+ 'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_forum_parent_id'
46
+ );
47
+
48
+ // Forum title.
49
+ $this->field_map[] = array(
50
+ 'from_tablename' => 'taxonomy_term_data',
51
+ 'from_fieldname' => 'name',
52
+ 'to_type' => 'forum',
53
+ 'to_fieldname' => 'post_title'
54
+ );
55
+
56
+ // Forum slug (Clean name to avoid conflicts)
57
+ $this->field_map[] = array(
58
+ 'from_tablename' => 'taxonomy_term_data',
59
+ 'from_fieldname' => 'name',
60
+ 'to_type' => 'forum',
61
+ 'to_fieldname' => 'post_name',
62
+ 'callback_method' => 'callback_slug'
63
+ );
64
+
65
+ // Forum description.
66
+ $this->field_map[] = array(
67
+ 'from_tablename' => 'taxonomy_term_data',
68
+ 'from_fieldname' => 'description',
69
+ 'to_type' => 'forum',
70
+ 'to_fieldname' => 'post_content',
71
+ 'callback_method' => 'callback_null'
72
+ );
73
+
74
+ // Forum display order (Starts from 1)
75
+ $this->field_map[] = array(
76
+ 'from_tablename' => 'taxonomy_term_data',
77
+ 'from_fieldname' => 'weight',
78
+ 'to_type' => 'forum',
79
+ 'to_fieldname' => 'menu_order'
80
+ );
81
+
82
+ // Forum dates.
83
+ $this->field_map[] = array(
84
+ 'to_type' => 'forum',
85
+ 'to_fieldname' => 'post_date',
86
+ 'default' => date('Y-m-d H:i:s')
87
+ );
88
+ $this->field_map[] = array(
89
+ 'to_type' => 'forum',
90
+ 'to_fieldname' => 'post_date_gmt',
91
+ 'default' => date('Y-m-d H:i:s')
92
+ );
93
+ $this->field_map[] = array(
94
+ 'to_type' => 'forum',
95
+ 'to_fieldname' => 'post_modified',
96
+ 'default' => date('Y-m-d H:i:s')
97
+ );
98
+ $this->field_map[] = array(
99
+ 'to_type' => 'forum',
100
+ 'to_fieldname' => 'post_modified_gmt',
101
+ 'default' => date('Y-m-d H:i:s')
102
+ );
103
+
104
+ /** Topic Section *****************************************************/
105
+
106
+ // Topic id (Stored in postmeta)
107
+ $this->field_map[] = array(
108
+ 'from_tablename' => 'forum_index',
109
+ 'from_fieldname' => 'nid',
110
+ 'to_type' => 'topic',
111
+ 'to_fieldname' => '_bbp_topic_id'
112
+ );
113
+
114
+ // Topic reply count (Stored in postmeta)
115
+ $this->field_map[] = array(
116
+ 'from_tablename' => 'forum_index',
117
+ 'from_fieldname' => 'comment_count',
118
+ 'to_type' => 'topic',
119
+ 'to_fieldname' => '_bbp_reply_count',
120
+ 'callback_method' => 'callback_topic_reply_count'
121
+ );
122
+
123
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
124
+ $this->field_map[] = array(
125
+ 'from_tablename' => 'forum_index',
126
+ 'from_fieldname' => 'comment_count',
127
+ 'to_type' => 'topic',
128
+ 'to_fieldname' => '_bbp_total_reply_count',
129
+ 'callback_method' => 'callback_topic_reply_count'
130
+ );
131
+
132
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
133
+ $this->field_map[] = array(
134
+ 'from_tablename' => 'forum_index',
135
+ 'from_fieldname' => 'tid',
136
+ 'to_type' => 'topic',
137
+ 'to_fieldname' => '_bbp_forum_id',
138
+ 'callback_method' => 'callback_forumid'
139
+ );
140
+
141
+ // Topic author.
142
+ // Note: We join the 'node' table because 'forum_index' table does not include author id.
143
+ $this->field_map[] = array(
144
+ 'from_tablename' => 'node',
145
+ 'from_fieldname' => 'uid',
146
+ 'join_tablename' => 'forum_index',
147
+ 'join_type' => 'INNER',
148
+ 'join_expression' => 'ON node.nid = forum_index.nid',
149
+ 'to_type' => 'topic',
150
+ 'to_fieldname' => 'post_author',
151
+ 'callback_method' => 'callback_userid'
152
+ );
153
+
154
+ // Topic content.
155
+ // Note: We join the 'field_data_body' table because 'node' or 'forum_index' table does not include topic content.
156
+ $this->field_map[] = array(
157
+ 'from_tablename' => 'field_data_body',
158
+ 'from_fieldname' => 'body_value',
159
+ 'join_tablename' => 'node',
160
+ 'join_type' => 'INNER',
161
+ 'join_expression' => 'ON field_data_body.revision_id = node.vid',
162
+ 'to_type' => 'topic',
163
+ 'to_fieldname' => 'post_content',
164
+ 'callback_method' => 'callback_html'
165
+ );
166
+
167
+ // Topic title.
168
+ $this->field_map[] = array(
169
+ 'from_tablename' => 'forum_index',
170
+ 'from_fieldname' => 'title',
171
+ 'to_type' => 'topic',
172
+ 'to_fieldname' => 'post_title'
173
+ );
174
+
175
+ // Topic slug (Clean name to avoid conflicts)
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'forum_index',
178
+ 'from_fieldname' => 'title',
179
+ 'to_type' => 'topic',
180
+ 'to_fieldname' => 'post_name',
181
+ 'callback_method' => 'callback_slug'
182
+ );
183
+
184
+ // Topic parent forum id (If no parent, then 0)
185
+ $this->field_map[] = array(
186
+ 'from_tablename' => 'forum_index',
187
+ 'from_fieldname' => 'tid',
188
+ 'to_type' => 'topic',
189
+ 'to_fieldname' => 'post_parent',
190
+ 'callback_method' => 'callback_forumid'
191
+ );
192
+
193
+ // Sticky status (Stored in postmeta))
194
+ $this->field_map[] = array(
195
+ 'from_tablename' => 'forum_index',
196
+ 'from_fieldname' => 'sticky',
197
+ 'to_type' => 'topic',
198
+ 'to_fieldname' => '_bbp_old_sticky_status',
199
+ 'callback_method' => 'callback_sticky_status'
200
+ );
201
+
202
+ // Topic dates.
203
+ $this->field_map[] = array(
204
+ 'from_tablename' => 'forum_index',
205
+ 'from_fieldname' => 'created',
206
+ 'to_type' => 'topic',
207
+ 'to_fieldname' => 'post_date',
208
+ 'callback_method' => 'callback_datetime'
209
+ );
210
+ $this->field_map[] = array(
211
+ 'from_tablename' => 'forum_index',
212
+ 'from_fieldname' => 'created',
213
+ 'to_type' => 'topic',
214
+ 'to_fieldname' => 'post_date_gmt',
215
+ 'callback_method' => 'callback_datetime'
216
+ );
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'forum_index',
219
+ 'from_fieldname' => 'last_comment_timestamp',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_modified',
222
+ 'callback_method' => 'callback_datetime'
223
+ );
224
+ $this->field_map[] = array(
225
+ 'from_tablename' => 'forum_index',
226
+ 'from_fieldname' => 'last_comment_timestamp',
227
+ 'to_type' => 'topic',
228
+ 'to_fieldname' => 'post_modified_gmt',
229
+ 'callback_method' => 'callback_datetime'
230
+ );
231
+ $this->field_map[] = array(
232
+ 'from_tablename' => 'forum_index',
233
+ 'from_fieldname' => 'last_comment_timestamp',
234
+ 'to_type' => 'topic',
235
+ 'to_fieldname' => '_bbp_last_active_time',
236
+ 'callback_method' => 'callback_datetime'
237
+ );
238
+
239
+ // Topic status (Drupal v7.x Comments Enabled no = 0, closed = 1 & open = 2)
240
+ $this->field_map[] = array(
241
+ 'from_tablename' => 'node',
242
+ 'from_fieldname' => 'comment',
243
+ 'join_tablename' => 'forum_index',
244
+ 'join_type' => 'INNER',
245
+ 'join_expression' => 'ON node.nid = forum_index.nid',
246
+ 'to_type' => 'topic',
247
+ 'to_fieldname' => 'post_status',
248
+ 'callback_method' => 'callback_topic_status'
249
+ );
250
+
251
+ /** Tags Section ******************************************************/
252
+
253
+ // Topic id.
254
+ $this->field_map[] = array(
255
+ 'from_tablename' => 'field_data_field_tags',
256
+ 'from_fieldname' => 'entity_id',
257
+ 'to_type' => 'tags',
258
+ 'to_fieldname' => 'objectid',
259
+ 'callback_method' => 'callback_topicid'
260
+ );
261
+
262
+ // Taxonomy ID.
263
+ $this->field_map[] = array(
264
+ 'from_tablename' => 'field_data_field_tags',
265
+ 'from_fieldname' => 'field_tags_tid',
266
+ 'to_type' => 'tags',
267
+ 'to_fieldname' => 'taxonomy'
268
+ );
269
+
270
+ // Term name.
271
+ $this->field_map[] = array(
272
+ 'from_tablename' => 'taxonomy_term_data',
273
+ 'from_fieldname' => 'name',
274
+ 'join_tablename' => 'field_data_field_tags',
275
+ 'join_type' => 'INNER',
276
+ 'join_expression' => 'ON field_tags_tid = taxonomy_term_data.tid',
277
+ 'to_type' => 'tags',
278
+ 'to_fieldname' => 'name'
279
+ );
280
+
281
+ // Term slug.
282
+ $this->field_map[] = array(
283
+ 'from_tablename' => 'taxonomy_term_data',
284
+ 'from_fieldname' => 'name',
285
+ 'join_tablename' => 'field_data_field_tags',
286
+ 'join_type' => 'INNER',
287
+ 'join_expression' => 'ON field_tags_tid = taxonomy_term_data.tid',
288
+ 'to_type' => 'tags',
289
+ 'to_fieldname' => 'slug',
290
+ 'callback_method' => 'callback_slug'
291
+ );
292
+
293
+ // Term description.
294
+ $this->field_map[] = array(
295
+ 'from_tablename' => 'taxonomy_term_data',
296
+ 'from_fieldname' => 'description',
297
+ 'join_tablename' => 'field_data_field_tags',
298
+ 'join_type' => 'INNER',
299
+ 'join_expression' => 'ON field_tags_tid = taxonomy_term_data.tid',
300
+ 'to_type' => 'tags',
301
+ 'to_fieldname' => 'description'
302
+ );
303
+
304
+ /** Reply Section *****************************************************/
305
+
306
+ // Reply id (Stored in postmeta)
307
+ $this->field_map[] = array(
308
+ 'from_tablename' => 'comment',
309
+ 'from_fieldname' => 'cid',
310
+ 'to_type' => 'reply',
311
+ 'to_fieldname' => '_bbp_post_id'
312
+ );
313
+
314
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
315
+ // Note: We join the 'forum' table because 'comment' table does not include parent forum id.
316
+ $this->field_map[] = array(
317
+ 'from_tablename' => 'forum',
318
+ 'from_fieldname' => 'tid',
319
+ 'join_tablename' => 'comment',
320
+ 'join_type' => 'INNER',
321
+ 'join_expression' => 'ON forum.nid = comment.nid',
322
+ 'to_type' => 'reply',
323
+ 'to_fieldname' => '_bbp_forum_id',
324
+ 'callback_method' => 'callback_topicid_to_forumid'
325
+ );
326
+
327
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
328
+ $this->field_map[] = array(
329
+ 'from_tablename' => 'comment',
330
+ 'from_fieldname' => 'nid',
331
+ 'to_type' => 'reply',
332
+ 'to_fieldname' => '_bbp_topic_id',
333
+ 'callback_method' => 'callback_topicid'
334
+ );
335
+
336
+ // Reply parent reply id (If no parent, then 0. Stored in postmeta)
337
+ $this->field_map[] = array(
338
+ 'from_tablename' => 'comment',
339
+ 'from_fieldname' => 'pid',
340
+ 'to_type' => 'reply',
341
+ 'to_fieldname' => '_bbp_reply_to'
342
+ );
343
+
344
+ // Reply author ip (Stored in postmeta)
345
+ $this->field_map[] = array(
346
+ 'from_tablename' => 'comment',
347
+ 'from_fieldname' => 'hostname',
348
+ 'to_type' => 'reply',
349
+ 'to_fieldname' => '_bbp_author_ip'
350
+ );
351
+
352
+ // Reply author.
353
+ $this->field_map[] = array(
354
+ 'from_tablename' => 'comment',
355
+ 'from_fieldname' => 'uid',
356
+ 'to_type' => 'reply',
357
+ 'to_fieldname' => 'post_author',
358
+ 'callback_method' => 'callback_userid'
359
+ );
360
+
361
+ // Reply title.
362
+ $this->field_map[] = array(
363
+ 'from_tablename' => 'comment',
364
+ 'from_fieldname' => 'subject',
365
+ 'to_type' => 'reply',
366
+ 'to_fieldname' => 'post_title'
367
+ );
368
+
369
+ // Reply slug (Clean name to avoid conflicts)
370
+ $this->field_map[] = array(
371
+ 'from_tablename' => 'comment',
372
+ 'from_fieldname' => 'subject',
373
+ 'to_type' => 'reply',
374
+ 'to_fieldname' => 'post_name',
375
+ 'callback_method' => 'callback_slug'
376
+ );
377
+
378
+ // Reply content.
379
+ // Note: We join the 'field_data_comment_body' table because 'comment' table does not include reply content.
380
+ $this->field_map[] = array(
381
+ 'from_tablename' => 'field_data_comment_body',
382
+ 'from_fieldname' => 'comment_body_value',
383
+ 'join_tablename' => 'comment',
384
+ 'join_type' => 'INNER',
385
+ 'join_expression' => 'ON field_data_comment_body.entity_id = comment.cid',
386
+ 'to_type' => 'reply',
387
+ 'to_fieldname' => 'post_content',
388
+ 'callback_method' => 'callback_html'
389
+ );
390
+
391
+ // Reply parent topic id (If no parent, then 0)
392
+ $this->field_map[] = array(
393
+ 'from_tablename' => 'comment',
394
+ 'from_fieldname' => 'nid',
395
+ 'to_type' => 'reply',
396
+ 'to_fieldname' => 'post_parent',
397
+ 'callback_method' => 'callback_topicid'
398
+ );
399
+
400
+ // Reply dates.
401
+ $this->field_map[] = array(
402
+ 'from_tablename' => 'comment',
403
+ 'from_fieldname' => 'created',
404
+ 'to_type' => 'reply',
405
+ 'to_fieldname' => 'post_date',
406
+ 'callback_method' => 'callback_datetime'
407
+ );
408
+ $this->field_map[] = array(
409
+ 'from_tablename' => 'comment',
410
+ 'from_fieldname' => 'created',
411
+ 'to_type' => 'reply',
412
+ 'to_fieldname' => 'post_date_gmt',
413
+ 'callback_method' => 'callback_datetime'
414
+ );
415
+ $this->field_map[] = array(
416
+ 'from_tablename' => 'comment',
417
+ 'from_fieldname' => 'changed',
418
+ 'to_type' => 'reply',
419
+ 'to_fieldname' => 'post_modified',
420
+ 'callback_method' => 'callback_datetime'
421
+ );
422
+ $this->field_map[] = array(
423
+ 'from_tablename' => 'comment',
424
+ 'from_fieldname' => 'changed',
425
+ 'to_type' => 'reply',
426
+ 'to_fieldname' => 'post_modified_gmt',
427
+ 'callback_method' => 'callback_datetime'
428
+ );
429
+
430
+ /** User Section ******************************************************/
431
+
432
+ // Store old User id (Stored in usermeta)
433
+ $this->field_map[] = array(
434
+ 'from_tablename' => 'users',
435
+ 'from_fieldname' => 'uid',
436
+ 'to_type' => 'user',
437
+ 'to_fieldname' => '_bbp_user_id'
438
+ );
439
+
440
+ // Store old User password (Stored in usermeta serialized with salt)
441
+ $this->field_map[] = array(
442
+ 'from_tablename' => 'users',
443
+ 'from_fieldname' => 'pass',
444
+ 'to_type' => 'user',
445
+ 'to_fieldname' => '_bbp_password'
446
+ // 'callback_method' => 'callback_savepass'
447
+ );
448
+
449
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
450
+ $this->field_map[] = array(
451
+ 'from_tablename' => 'users',
452
+ 'from_fieldname' => 'pass',
453
+ 'to_type' => 'user',
454
+ 'to_fieldname' => ''
455
+ );
456
+
457
+ // User password verify class (Stored in usermeta for verifying password)
458
+ $this->field_map[] = array(
459
+ 'to_type' => 'users',
460
+ 'to_fieldname' => '_bbp_class',
461
+ 'default' => 'Drupal7'
462
+ );
463
+
464
+ // User name.
465
+ $this->field_map[] = array(
466
+ 'from_tablename' => 'users',
467
+ 'from_fieldname' => 'name',
468
+ 'to_type' => 'user',
469
+ 'to_fieldname' => 'user_login'
470
+ );
471
+
472
+ // User nice name.
473
+ $this->field_map[] = array(
474
+ 'from_tablename' => 'users',
475
+ 'from_fieldname' => 'name',
476
+ 'to_type' => 'user',
477
+ 'to_fieldname' => 'user_nicename'
478
+ );
479
+
480
+ // User email.
481
+ $this->field_map[] = array(
482
+ 'from_tablename' => 'users',
483
+ 'from_fieldname' => 'mail',
484
+ 'to_type' => 'user',
485
+ 'to_fieldname' => 'user_email'
486
+ );
487
+
488
+ // User registered.
489
+ $this->field_map[] = array(
490
+ 'from_tablename' => 'users',
491
+ 'from_fieldname' => 'created',
492
+ 'to_type' => 'user',
493
+ 'to_fieldname' => 'user_registered',
494
+ 'callback_method' => 'callback_datetime'
495
+ );
496
+
497
+ // Store Signature (Stored in usermeta)
498
+ $this->field_map[] = array(
499
+ 'from_tablename' => 'users',
500
+ 'from_fieldname' => 'signature',
501
+ 'to_fieldname' => '_bbp_drupal7_user_sig',
502
+ 'to_type' => 'user',
503
+ 'callback_method' => 'callback_html'
504
+ );
505
+ }
506
+
507
+ /**
508
+ * This method allows us to indicates what is or is not converted for each
509
+ * converter.
510
+ */
511
+ public function info()
512
+ {
513
+ return '';
514
+ }
515
+
516
+ /**
517
+ * This method is to save the salt and password together. That
518
+ * way when we authenticate it we can get it out of the database
519
+ * as one value. Array values are auto sanitized by WordPress.
520
+ */
521
+ public function callback_savepass( $field, $row )
522
+ {
523
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
524
+ return $pass_array;
525
+ }
526
+
527
+ /**
528
+ * This method is to take the pass out of the database and compare
529
+ * to a pass the user has typed in.
530
+ */
531
+ public function authenticate_pass( $password, $serialized_pass )
532
+ {
533
+ $pass_array = unserialize( $serialized_pass );
534
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
535
+ }
536
+
537
+ /**
538
+ * Translate the post status from Drupal v7.x numeric's to WordPress's strings.
539
+ *
540
+ * @param int $status Drupal v7.x numeric topic status
541
+ * @return string WordPress safe
542
+ */
543
+ public function callback_topic_status( $status = 2 ) {
544
+ switch ( $status ) {
545
+ case 1 :
546
+ $status = 'closed';
547
+ break;
548
+
549
+ case 2 :
550
+ default :
551
+ $status = 'publish';
552
+ break;
553
+ }
554
+ return $status;
555
+ }
556
+
557
+ /**
558
+ * Translate the topic sticky status type from Drupal v7.x numeric's to WordPress's strings.
559
+ *
560
+ * @param int $status Drupal v7.x numeric forum type
561
+ * @return string WordPress safe
562
+ */
563
+ public function callback_sticky_status( $status = 0 ) {
564
+ switch ( $status ) {
565
+ case 1 :
566
+ $status = 'sticky'; // Drupal Sticky 'topic_sticky = 1'
567
+ break;
568
+
569
+ case 0 :
570
+ default :
571
+ $status = 'normal'; // Drupal Normal Topic 'sticky = 0'
572
+ break;
573
+ }
574
+ return $status;
575
+ }
576
+
577
+ /**
578
+ * Verify the topic/reply count.
579
+ *
580
+ * @param int $count Drupal v7.x topic/reply counts
581
+ * @return string WordPress safe
582
+ */
583
+ public function callback_topic_reply_count( $count = 1 ) {
584
+ $count = absint( (int) $count - 1 );
585
+ return $count;
586
+ }
587
+ }
includes/admin/converters/Example.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * Example converter base impoprter template for bbPress
5
  *
6
  * @since bbPress (r4689)
7
  * @link Codex Docs http://codex.bbpress.org/import-forums/custom-import
@@ -233,6 +233,15 @@ class Example extends BBP_Converter_Base {
233
  'callback_method' => 'callback_forumid'
234
  );
235
 
 
 
 
 
 
 
 
 
 
236
  // Topic dates.
237
  $this->field_map[] = array(
238
  'from_tablename' => 'topics_table',
@@ -320,6 +329,23 @@ class Example extends BBP_Converter_Base {
320
  'to_fieldname' => 'name'
321
  );
322
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  /** Reply Section *****************************************************/
324
 
325
  // Setup table joins for the reply section at the base of this section
@@ -357,7 +383,7 @@ class Example extends BBP_Converter_Base {
357
  'to_type' => 'reply',
358
  'to_fieldname' => '_bbp_author_ip'
359
  );
360
-
361
  // Reply author.
362
  $this->field_map[] = array(
363
  'from_tablename' => 'replies_table',
@@ -454,7 +480,7 @@ class Example extends BBP_Converter_Base {
454
  /** User Section ******************************************************/
455
 
456
  // Setup table joins for the user section at the base of this section
457
-
458
  // Store old User id (Stored in usermeta)
459
  $this->field_map[] = array(
460
  'from_tablename' => 'users_table',
1
  <?php
2
 
3
  /**
4
+ * Example converter base impoprter template for bbPress
5
  *
6
  * @since bbPress (r4689)
7
  * @link Codex Docs http://codex.bbpress.org/import-forums/custom-import
233
  'callback_method' => 'callback_forumid'
234
  );
235
 
236
+ // Sticky status (Stored in postmeta))
237
+ $this->field_map[] = array(
238
+ 'from_tablename' => 'topics_table',
239
+ 'from_fieldname' => 'the_topic_sticky_status',
240
+ 'to_type' => 'topic',
241
+ 'to_fieldname' => '_bbp_old_sticky_status',
242
+ 'callback_method' => 'callback_sticky_status'
243
+ );
244
+
245
  // Topic dates.
246
  $this->field_map[] = array(
247
  'from_tablename' => 'topics_table',
329
  'to_fieldname' => 'name'
330
  );
331
 
332
+ // Term slug.
333
+ $this->field_map[] = array(
334
+ 'from_tablename' => 'tag_table',
335
+ 'from_fieldname' => 'tagslug',
336
+ 'to_type' => 'tags',
337
+ 'to_fieldname' => 'slug',
338
+ 'callback_method' => 'callback_slug'
339
+ );
340
+
341
+ // Term description.
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'tag_table',
344
+ 'from_fieldname' => 'tagdescription',
345
+ 'to_type' => 'tags',
346
+ 'to_fieldname' => 'description'
347
+ );
348
+
349
  /** Reply Section *****************************************************/
350
 
351
  // Setup table joins for the reply section at the base of this section
383
  'to_type' => 'reply',
384
  'to_fieldname' => '_bbp_author_ip'
385
  );
386
+
387
  // Reply author.
388
  $this->field_map[] = array(
389
  'from_tablename' => 'replies_table',
480
  /** User Section ******************************************************/
481
 
482
  // Setup table joins for the user section at the base of this section
483
+
484
  // Store old User id (Stored in usermeta)
485
  $this->field_map[] = array(
486
  'from_tablename' => 'users_table',
includes/admin/converters/FluxBB.php ADDED
@@ -0,0 +1,646 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of FluxBB Forum converter.
5
+ *
6
+ * @since bbPress (r5138)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/fluxbb
8
+ */
9
+ class FluxBB extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses FluxBB::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' => 'forums',
31
+ 'from_fieldname' => 'id',
32
+ 'to_type' => 'forum',
33
+ 'to_fieldname' => '_bbp_forum_id'
34
+ );
35
+
36
+ // Forum topic count (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'forums',
39
+ 'from_fieldname' => 'num_topics',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_topic_count'
42
+ );
43
+
44
+ // Forum reply count (Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'forums',
47
+ 'from_fieldname' => 'num_posts',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_reply_count'
50
+ );
51
+
52
+ // Forum total topic count (Stored in postmeta)
53
+ $this->field_map[] = array(
54
+ 'from_tablename' => 'forums',
55
+ 'from_fieldname' => 'num_topics',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_total_topic_count'
58
+ );
59
+
60
+ // Forum total reply count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'num_posts',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_total_reply_count'
66
+ );
67
+
68
+ // Forum title.
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'forum_name',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => 'post_title'
74
+ );
75
+
76
+ // Forum slug (Clean name to avoid conflicts)
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'forums',
79
+ 'from_fieldname' => 'forum_name',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => 'post_name',
82
+ 'callback_method' => 'callback_slug'
83
+ );
84
+
85
+ // Forum description.
86
+ $this->field_map[] = array(
87
+ 'from_tablename' => 'forums',
88
+ 'from_fieldname' => 'forum_desc',
89
+ 'to_type' => 'forum',
90
+ 'to_fieldname' => 'post_content',
91
+ 'callback_method' => 'callback_null'
92
+ );
93
+
94
+ // Forum display order (Starts from 1)
95
+ $this->field_map[] = array(
96
+ 'from_tablename' => 'forums',
97
+ 'from_fieldname' => 'disp_position',
98
+ 'to_type' => 'forum',
99
+ 'to_fieldname' => 'menu_order'
100
+ );
101
+
102
+ // Forum dates.
103
+ $this->field_map[] = array(
104
+ 'to_type' => 'forum',
105
+ 'to_fieldname' => 'post_date',
106
+ 'default' => date('Y-m-d H:i:s')
107
+ );
108
+ $this->field_map[] = array(
109
+ 'to_type' => 'forum',
110
+ 'to_fieldname' => 'post_date_gmt',
111
+ 'default' => date('Y-m-d H:i:s')
112
+ );
113
+ $this->field_map[] = array(
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'post_modified',
116
+ 'default' => date('Y-m-d H:i:s')
117
+ );
118
+ $this->field_map[] = array(
119
+ 'to_type' => 'forum',
120
+ 'to_fieldname' => 'post_modified_gmt',
121
+ 'default' => date('Y-m-d H:i:s')
122
+ );
123
+
124
+ /** Topic Section *****************************************************/
125
+
126
+ // Topic id (Stored in postmeta)
127
+ $this->field_map[] = array(
128
+ 'from_tablename' => 'topics',
129
+ 'from_fieldname' => 'id',
130
+ 'to_type' => 'topic',
131
+ 'to_fieldname' => '_bbp_topic_id'
132
+ );
133
+
134
+ // Topic reply count (Stored in postmeta)
135
+ $this->field_map[] = array(
136
+ 'from_tablename' => 'topics',
137
+ 'from_fieldname' => 'num_replies',
138
+ 'to_type' => 'topic',
139
+ 'to_fieldname' => '_bbp_reply_count',
140
+ 'callback_method' => 'callback_topic_reply_count'
141
+ );
142
+
143
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
144
+ $this->field_map[] = array(
145
+ 'from_tablename' => 'topics',
146
+ 'from_fieldname' => 'num_replies',
147
+ 'to_type' => 'topic',
148
+ 'to_fieldname' => '_bbp_total_reply_count',
149
+ 'callback_method' => 'callback_topic_reply_count'
150
+ );
151
+
152
+ // Topic parent forum id (If no parent, then 0, Stored in postmeta)
153
+ $this->field_map[] = array(
154
+ 'from_tablename' => 'topics',
155
+ 'from_fieldname' => 'forum_id',
156
+ 'to_type' => 'topic',
157
+ 'to_fieldname' => '_bbp_forum_id',
158
+ 'callback_method' => 'callback_forumid'
159
+ );
160
+
161
+ // Topic author.
162
+ // Note: We join the 'posts' table because 'topics' table does include numeric user id.
163
+ $this->field_map[] = array(
164
+ 'from_tablename' => 'posts',
165
+ 'from_fieldname' => 'poster_id',
166
+ 'join_tablename' => 'topics',
167
+ 'join_type' => 'INNER',
168
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
169
+ 'to_type' => 'topic',
170
+ 'to_fieldname' => 'post_author',
171
+ 'callback_method' => 'callback_userid'
172
+ );
173
+
174
+ // Topic Author ip (Stored in postmeta)
175
+ // Note: We join the 'posts' table because 'topics' table does not include author IP addresses.
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'posts',
178
+ 'from_fieldname' => 'poster_ip',
179
+ 'join_tablename' => 'topics',
180
+ 'join_type' => 'INNER',
181
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
182
+ 'to_type' => 'topic',
183
+ 'to_fieldname' => '_bbp_author_ip'
184
+ );
185
+
186
+ // Topic content.
187
+ // Note: We join the 'posts' table because 'topics' table does not include topic content.
188
+ $this->field_map[] = array(
189
+ 'from_tablename' => 'posts',
190
+ 'from_fieldname' => 'message',
191
+ 'join_tablename' => 'topics',
192
+ 'join_type' => 'INNER',
193
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
194
+ 'to_type' => 'topic',
195
+ 'to_fieldname' => 'post_content',
196
+ 'callback_method' => 'callback_html'
197
+ );
198
+
199
+ // Topic title.
200
+ $this->field_map[] = array(
201
+ 'from_tablename' => 'topics',
202
+ 'from_fieldname' => 'subject',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => 'post_title'
205
+ );
206
+
207
+ // Topic slug (Clean name to avoid conflicts)
208
+ $this->field_map[] = array(
209
+ 'from_tablename' => 'topics',
210
+ 'from_fieldname' => 'subject',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => 'post_name',
213
+ 'callback_method' => 'callback_slug'
214
+ );
215
+
216
+ // Topic parent forum id (If no parent, then 0)
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'topics',
219
+ 'from_fieldname' => 'forum_id',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_parent',
222
+ 'callback_method' => 'callback_forumid'
223
+ );
224
+
225
+ // Sticky status (Stored in postmeta))
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'topics',
228
+ 'from_fieldname' => 'sticky',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => '_bbp_old_sticky_status',
231
+ 'callback_method' => 'callback_sticky_status'
232
+ );
233
+
234
+ // Topic dates.
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'topics',
237
+ 'from_fieldname' => 'posted',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => 'post_date',
240
+ 'callback_method' => 'callback_datetime'
241
+ );
242
+ $this->field_map[] = array(
243
+ 'from_tablename' => 'topics',
244
+ 'from_fieldname' => 'posted',
245
+ 'to_type' => 'topic',
246
+ 'to_fieldname' => 'post_date_gmt',
247
+ 'callback_method' => 'callback_datetime'
248
+ );
249
+ $this->field_map[] = array(
250
+ 'from_tablename' => 'topics',
251
+ 'from_fieldname' => 'posted',
252
+ 'to_type' => 'topic',
253
+ 'to_fieldname' => 'post_modified',
254
+ 'callback_method' => 'callback_datetime'
255
+ );
256
+ $this->field_map[] = array(
257
+ 'from_tablename' => 'topics',
258
+ 'from_fieldname' => 'posted',
259
+ 'to_type' => 'topic',
260
+ 'to_fieldname' => 'post_modified_gmt',
261
+ 'callback_method' => 'callback_datetime'
262
+ );
263
+ $this->field_map[] = array(
264
+ 'from_tablename' => 'topics',
265
+ 'from_fieldname' => 'posted',
266
+ 'to_type' => 'topic',
267
+ 'to_fieldname' => '_bbp_last_active_time',
268
+ 'callback_method' => 'callback_datetime'
269
+ );
270
+
271
+ // Topic status (Open = 0 or Closed = 1, FluxBB v1.5.3)
272
+ $this->field_map[] = array(
273
+ 'from_tablename' => 'topics',
274
+ 'from_fieldname' => 'closed',
275
+ 'to_type' => 'topic',
276
+ 'to_fieldname' => 'post_status',
277
+ 'callback_method' => 'callback_topic_status'
278
+ );
279
+
280
+ /** Tags Section ******************************************************/
281
+
282
+ /**
283
+ * FluxBB v1.5.3 Forums do not support topic tags out of the box
284
+ */
285
+
286
+ /** Reply Section *****************************************************/
287
+
288
+ // Reply id (Stored in postmeta)
289
+ $this->field_map[] = array(
290
+ 'from_tablename' => 'posts',
291
+ 'from_fieldname' => 'id',
292
+ 'to_type' => 'reply',
293
+ 'to_fieldname' => '_bbp_post_id'
294
+ );
295
+
296
+ // Reply parent forum id (If no parent, then 0, Stored in postmeta)
297
+ $this->field_map[] = array(
298
+ 'from_tablename' => 'posts',
299
+ 'from_fieldname' => 'topic_id',
300
+ 'to_type' => 'reply',
301
+ 'to_fieldname' => '_bbp_forum_id',
302
+ 'callback_method' => 'callback_topicid_to_forumid'
303
+ );
304
+
305
+ // Reply parent topic id (If no parent, then 0, Stored in postmeta)
306
+ $this->field_map[] = array(
307
+ 'from_tablename' => 'posts',
308
+ 'from_fieldname' => 'topic_id',
309
+ 'to_type' => 'reply',
310
+ 'to_fieldname' => '_bbp_topic_id',
311
+ 'callback_method' => 'callback_topicid'
312
+ );
313
+
314
+ // Reply author ip (Stored in postmeta)
315
+ $this->field_map[] = array(
316
+ 'from_tablename' => 'posts',
317
+ 'from_fieldname' => 'poster_ip',
318
+ 'to_type' => 'reply',
319
+ 'to_fieldname' => '_bbp_author_ip'
320
+ );
321
+
322
+ // Reply author.
323
+ $this->field_map[] = array(
324
+ 'from_tablename' => 'posts',
325
+ 'from_fieldname' => 'poster_id',
326
+ 'to_type' => 'reply',
327
+ 'to_fieldname' => 'post_author',
328
+ 'callback_method' => 'callback_userid'
329
+ );
330
+
331
+ // Reply title.
332
+ // Note: We join the 'topics' table because 'posts' table does not include reply title.
333
+ $this->field_map[] = array(
334
+ 'from_tablename' => 'topics',
335
+ 'from_fieldname' => 'subject',
336
+ 'join_tablename' => 'posts',
337
+ 'join_type' => 'INNER',
338
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
339
+ 'to_type' => 'reply',
340
+ 'to_fieldname' => 'post_title',
341
+ 'callback_method' => 'callback_reply_title'
342
+ );
343
+
344
+ // Reply slug (Clean name to avoid conflicts)
345
+ // Note: We join the 'topics' table because 'posts' table does not include slug title.
346
+ $this->field_map[] = array(
347
+ 'from_tablename' => 'topics',
348
+ 'from_fieldname' => 'subject',
349
+ 'join_tablename' => 'posts',
350
+ 'join_type' => 'INNER',
351
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
352
+ 'to_type' => 'reply',
353
+ 'to_fieldname' => 'post_name',
354
+ 'callback_method' => 'callback_slug'
355
+ );
356
+
357
+ // Reply content.
358
+ $this->field_map[] = array(
359
+ 'from_tablename' => 'posts',
360
+ 'from_fieldname' => 'message',
361
+ 'to_type' => 'reply',
362
+ 'to_fieldname' => 'post_content',
363
+ 'callback_method' => 'callback_html'
364
+ );
365
+
366
+ // Reply parent topic id (If no parent, then 0)
367
+ $this->field_map[] = array(
368
+ 'from_tablename' => 'posts',
369
+ 'from_fieldname' => 'topic_id',
370
+ 'to_type' => 'reply',
371
+ 'to_fieldname' => 'post_parent',
372
+ 'callback_method' => 'callback_topicid'
373
+ );
374
+
375
+ // Reply dates.
376
+ $this->field_map[] = array(
377
+ 'from_tablename' => 'posts',
378
+ 'from_fieldname' => 'posted',
379
+ 'to_type' => 'reply',
380
+ 'to_fieldname' => 'post_date',
381
+ 'callback_method' => 'callback_datetime'
382
+ );
383
+ $this->field_map[] = array(
384
+ 'from_tablename' => 'posts',
385
+ 'from_fieldname' => 'posted',
386
+ 'to_type' => 'reply',
387
+ 'to_fieldname' => 'post_date_gmt',
388
+ 'callback_method' => 'callback_datetime'
389
+ );
390
+ $this->field_map[] = array(
391
+ 'from_tablename' => 'posts',
392
+ 'from_fieldname' => 'posted',
393
+ 'to_type' => 'reply',
394
+ 'to_fieldname' => 'post_modified',
395
+ 'callback_method' => 'callback_datetime'
396
+ );
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'posts',
399
+ 'from_fieldname' => 'posted',
400
+ 'to_type' => 'reply',
401
+ 'to_fieldname' => 'post_modified_gmt',
402
+ 'callback_method' => 'callback_datetime'
403
+ );
404
+
405
+ /** User Section ******************************************************/
406
+
407
+ // Store old User id (Stored in usermeta)
408
+ $this->field_map[] = array(
409
+ 'from_tablename' => 'users',
410
+ 'from_fieldname' => 'id',
411
+ 'to_type' => 'user',
412
+ 'to_fieldname' => '_bbp_user_id'
413
+ );
414
+
415
+ // Store old User password (Stored in usermeta serialized with salt)
416
+ $this->field_map[] = array(
417
+ 'from_tablename' => 'users',
418
+ 'from_fieldname' => 'password',
419
+ 'to_type' => 'user',
420
+ 'to_fieldname' => '_bbp_password',
421
+ 'callback_method' => 'callback_savepass'
422
+ );
423
+
424
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
425
+ // $this->field_map[] = array(
426
+ // 'from_tablename' => 'users',
427
+ // 'from_fieldname' => 'salt',
428
+ // 'to_type' => 'user',
429
+ // 'to_fieldname' => ''
430
+ // );
431
+
432
+ // User password verify class (Stored in usermeta for verifying password)
433
+ $this->field_map[] = array(
434
+ 'to_type' => 'users',
435
+ 'to_fieldname' => '_bbp_class',
436
+ 'default' => 'FluxBB'
437
+ );
438
+
439
+ // User name.
440
+ $this->field_map[] = array(
441
+ 'from_tablename' => 'users',
442
+ 'from_fieldname' => 'username',
443
+ 'to_type' => 'user',
444
+ 'to_fieldname' => 'user_login'
445
+ );
446
+
447
+ // User nice name.
448
+ $this->field_map[] = array(
449
+ 'from_tablename' => 'users',
450
+ 'from_fieldname' => 'username',
451
+ 'to_type' => 'user',
452
+ 'to_fieldname' => 'user_nicename'
453
+ );
454
+
455
+ // User email.
456
+ $this->field_map[] = array(
457
+ 'from_tablename' => 'users',
458
+ 'from_fieldname' => 'email',
459
+ 'to_type' => 'user',
460
+ 'to_fieldname' => 'user_email'
461
+ );
462
+
463
+ // User homepage.
464
+ $this->field_map[] = array(
465
+ 'from_tablename' => 'users',
466
+ 'from_fieldname' => 'url',
467
+ 'to_type' => 'user',
468
+ 'to_fieldname' => 'user_url'
469
+ );
470
+
471
+ // User registered.
472
+ $this->field_map[] = array(
473
+ 'from_tablename' => 'users',
474
+ 'from_fieldname' => 'registered',
475
+ 'to_type' => 'user',
476
+ 'to_fieldname' => 'user_registered',
477
+ 'callback_method' => 'callback_datetime'
478
+ );
479
+
480
+ // User display name.
481
+ $this->field_map[] = array(
482
+ 'from_tablename' => 'users',
483
+ 'from_fieldname' => 'realname',
484
+ 'to_type' => 'user',
485
+ 'to_fieldname' => 'display_name'
486
+ );
487
+
488
+ // User AIM (Stored in usermeta)
489
+ $this->field_map[] = array(
490
+ 'from_tablename' => 'users',
491
+ 'from_fieldname' => 'aim',
492
+ 'to_type' => 'user',
493
+ 'to_fieldname' => 'aim'
494
+ );
495
+
496
+ // User Yahoo (Stored in usermeta)
497
+ $this->field_map[] = array(
498
+ 'from_tablename' => 'users',
499
+ 'from_fieldname' => 'yahoo',
500
+ 'to_type' => 'user',
501
+ 'to_fieldname' => 'yim'
502
+ );
503
+
504
+ // Store Jabber
505
+ $this->field_map[] = array(
506
+ 'from_tablename' => 'users',
507
+ 'from_fieldname' => 'jabber',
508
+ 'to_type' => 'user',
509
+ 'to_fieldname' => 'jabber'
510
+ );
511
+
512
+ // Store ICQ (Stored in usermeta)
513
+ $this->field_map[] = array(
514
+ 'from_tablename' => 'users',
515
+ 'from_fieldname' => 'icq',
516
+ 'to_type' => 'user',
517
+ 'to_fieldname' => '_bbp_fluxbb_user_icq'
518
+ );
519
+
520
+ // Store MSN (Stored in usermeta)
521
+ $this->field_map[] = array(
522
+ 'from_tablename' => 'users',
523
+ 'from_fieldname' => 'msn',
524
+ 'to_type' => 'user',
525
+ 'to_fieldname' => '_bbp_fluxbb_user_msn'
526
+ );
527
+
528
+ // Store Location (Stored in usermeta)
529
+ $this->field_map[] = array(
530
+ 'from_tablename' => 'users',
531
+ 'from_fieldname' => 'location',
532
+ 'to_type' => 'user',
533
+ 'to_fieldname' => '_bbp_fluxbb_user_location'
534
+ );
535
+
536
+ // Store Signature (Stored in usermeta)
537
+ $this->field_map[] = array(
538
+ 'from_tablename' => 'users',
539
+ 'from_fieldname' => 'signature',
540
+ 'to_type' => 'user',
541
+ 'to_fieldname' => '_bbp_fluxbb_user_sig',
542
+ 'callback_method' => 'callback_html'
543
+ );
544
+
545
+ // Store Admin Note (Stored in usermeta)
546
+ $this->field_map[] = array(
547
+ 'from_tablename' => 'users',
548
+ 'from_fieldname' => 'admin_note',
549
+ 'to_type' => 'user',
550
+ 'to_fieldname' => '_bbp_fluxbb_user_admin_note'
551
+ );
552
+
553
+ }
554
+
555
+ /**
556
+ * This method allows us to indicates what is or is not converted for each
557
+ * converter.
558
+ */
559
+ public function info()
560
+ {
561
+ return '';
562
+ }
563
+
564
+ /**
565
+ * This method is to save the salt and password together. That
566
+ * way when we authenticate it we can get it out of the database
567
+ * as one value. Array values are auto sanitized by WordPress.
568
+ */
569
+ public function callback_savepass( $field, $row )
570
+ {
571
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
572
+ return $pass_array;
573
+ }
574
+
575
+ /**
576
+ * This method is to take the pass out of the database and compare
577
+ * to a pass the user has typed in.
578
+ */
579
+ public function authenticate_pass( $password, $serialized_pass )
580
+ {
581
+ $pass_array = unserialize( $serialized_pass );
582
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
583
+ }
584
+
585
+ /**
586
+ * Translate the post status from FluxBB v1.5.3 numeric's to WordPress's strings.
587
+ *
588
+ * @param int $status FluxBB v1.5.3 numeric topic status
589
+ * @return string WordPress safe
590
+ */
591
+ public function callback_topic_status( $status = 0 ) {
592
+ switch ( $status ) {
593
+ case 1 :
594
+ $status = 'closed';
595
+ break;
596
+
597
+ case 0 :
598
+ default :
599
+ $status = 'publish';
600
+ break;
601
+ }
602
+ return $status;
603
+ }
604
+
605
+ /**
606
+ * Translate the topic sticky status type from FluxBB v1.5.3 numeric's to WordPress's strings.
607
+ *
608
+ * @param int $status FluxBB v1.5.3 numeric forum type
609
+ * @return string WordPress safe
610
+ */
611
+ public function callback_sticky_status( $status = 0 ) {
612
+ switch ( $status ) {
613
+ case 1 :
614
+ $status = 'sticky'; // FluxBB Sticky 'sticky = 1'
615
+ break;
616
+
617
+ case 0 :
618
+ default :
619
+ $status = 'normal'; // FluxBB Normal Topic 'sticky = 0'
620
+ break;
621
+ }
622
+ return $status;
623
+ }
624
+
625
+ /**
626
+ * Verify the topic/reply count.
627
+ *
628
+ * @param int $count FluxBB v1.5.3 topic/reply counts
629
+ * @return string WordPress safe
630
+ */
631
+ public function callback_topic_reply_count( $count = 1 ) {
632
+ $count = absint( (int) $count - 1 );
633
+ return $count;
634
+ }
635
+
636
+ /**
637
+ * Set the reply title
638
+ *
639
+ * @param string $title FluxBB v1.5.3 topic title of this reply
640
+ * @return string Prefixed topic title, or empty string
641
+ */
642
+ public function callback_reply_title( $title = '' ) {
643
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
644
+ return $title;
645
+ }
646
+ }
includes/admin/converters/Invision.php CHANGED
@@ -21,10 +21,9 @@ class Invision extends BBP_Converter_Base {
21
  /**
22
  * Sets up the field mappings
23
  */
24
-
25
  public function setup_globals() {
26
 
27
- /** Forum Section ******************************************************/
28
 
29
  // Forum id (Stored in postmeta)
30
  $this->field_map[] = array(
@@ -34,7 +33,7 @@ class Invision extends BBP_Converter_Base {
34
  'to_fieldname' => '_bbp_forum_id'
35
  );
36
 
37
- // Forum parent id (If no parent, then 0. Stored in postmeta)
38
  $this->field_map[] = array(
39
  'from_tablename' => 'forums',
40
  'from_fieldname' => 'parent_id',
@@ -85,7 +84,7 @@ class Invision extends BBP_Converter_Base {
85
  // Forum slug (Clean name to avoid confilcts)
86
  $this->field_map[] = array(
87
  'from_tablename' => 'forums',
88
- 'from_fieldname' => 'name',
89
  'to_type' => 'forum',
90
  'to_fieldname' => 'post_name',
91
  'callback_method' => 'callback_slug'
@@ -108,6 +107,15 @@ class Invision extends BBP_Converter_Base {
108
  'to_fieldname' => 'menu_order'
109
  );
110
 
 
 
 
 
 
 
 
 
 
111
  // Forum dates.
112
  $this->field_map[] = array(
113
  'to_type' => 'forum',
@@ -130,7 +138,7 @@ class Invision extends BBP_Converter_Base {
130
  'default' => date('Y-m-d H:i:s')
131
  );
132
 
133
- /** Topic Section ******************************************************/
134
 
135
  // Topic id (Stored in postmeta)
136
  $this->field_map[] = array(
@@ -206,6 +214,15 @@ class Invision extends BBP_Converter_Base {
206
  'callback_method' => 'callback_forumid'
207
  );
208
 
 
 
 
 
 
 
 
 
 
209
  // Topic dates.
210
  $this->field_map[] = array(
211
  'from_tablename' => 'topics',
@@ -262,7 +279,7 @@ class Invision extends BBP_Converter_Base {
262
  'to_fieldname' => 'name'
263
  );
264
 
265
- /** Reply Section ******************************************************/
266
 
267
  // Reply id (Stored in postmeta)
268
  $this->field_map[] = array(
@@ -442,35 +459,6 @@ class Invision extends BBP_Converter_Base {
442
  'to_type' => 'user',
443
  'to_fieldname' => 'display_name'
444
  );
445
-
446
- /*
447
- * Table pfields_content AND pfields_data
448
- * These can be included once USER import JOIN bug is fixed
449
- // User homepage.
450
- $this->field_map[] = array(
451
- 'from_tablename' => 'members',
452
- 'from_fieldname' => 'homepage',
453
- 'to_type' => 'user',
454
- 'to_fieldname' => 'user_url'
455
- );
456
-
457
- // User AIM (Stored in usermeta)
458
- $this->field_map[] = array(
459
- 'from_tablename' => 'members',
460
- 'from_fieldname' => 'aim',
461
- 'to_type' => 'user',
462
- 'to_fieldname' => 'aim'
463
- );
464
-
465
- // User Yahoo (Stored in usermeta)
466
- $this->field_map[] = array(
467
- 'from_tablename' => 'members',
468
- 'from_fieldname' => 'yahoo',
469
- 'to_type' => 'user',
470
- 'to_fieldname' => 'yim'
471
- );
472
- */
473
-
474
  }
475
 
476
  /**
@@ -481,6 +469,41 @@ class Invision extends BBP_Converter_Base {
481
  return '';
482
  }
483
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  /**
485
  * Verify the topic reply count.
486
  *
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(
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' => 'forums',
39
  'from_fieldname' => 'parent_id',
84
  // Forum slug (Clean name to avoid confilcts)
85
  $this->field_map[] = array(
86
  'from_tablename' => 'forums',
87
+ 'from_fieldname' => 'name_seo',
88
  'to_type' => 'forum',
89
  'to_fieldname' => 'post_name',
90
  'callback_method' => 'callback_slug'
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
110
+ // Forum type (Forum = 0 or Category = -1, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forums',
113
+ 'from_fieldname' => 'parent_id',
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',
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(
214
  'callback_method' => 'callback_forumid'
215
  );
216
 
217
+ // Sticky status (Stored in postmeta))
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'topics',
220
+ 'from_fieldname' => 'pinned',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => '_bbp_old_sticky_status',
223
+ 'callback_method' => 'callback_sticky_status'
224
+ );
225
+
226
  // Topic dates.
227
  $this->field_map[] = array(
228
  'from_tablename' => 'topics',
279
  'to_fieldname' => 'name'
280
  );
281
 
282
+ /** Reply Section *****************************************************/
283
 
284
  // Reply id (Stored in postmeta)
285
  $this->field_map[] = array(
459
  'to_type' => 'user',
460
  'to_fieldname' => 'display_name'
461
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  }
463
 
464
  /**
469
  return '';
470
  }
471
 
472
+ /**
473
+ * Translate the forum type from Invision numeric's to WordPress's strings.
474
+ *
475
+ * @param int $status Invision numeric forum type
476
+ * @return string WordPress safe
477
+ */
478
+ public function callback_forum_type( $status = 0 ) {
479
+ if ( $status == -1 ) {
480
+ $status = 'category';
481
+ } else {
482
+ $status = 'forum';
483
+ }
484
+ return $status;
485
+ }
486
+
487
+ /**
488
+ * Translate the topic sticky status type from Invision numeric's to WordPress's strings.
489
+ *
490
+ * @param int $status Invision numeric forum type
491
+ * @return string WordPress safe
492
+ */
493
+ public function callback_sticky_status( $status = 0 ) {
494
+ switch ( $status ) {
495
+ case 1 :
496
+ $status = 'sticky'; // Invision Pinned Topic 'pinned = 1'
497
+ break;
498
+
499
+ case 0 :
500
+ default :
501
+ $status = 'normal'; // Invision Normal Topic 'pinned = 0'
502
+ break;
503
+ }
504
+ return $status;
505
+ }
506
+
507
  /**
508
  * Verify the topic reply count.
509
  *
includes/admin/converters/Kunena1.php ADDED
@@ -0,0 +1,546 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of Kunena v1.x Forums for Joomla Forum converter.
5
+ *
6
+ * @since bbPress (r5144)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/kunena/
8
+ */
9
+ class Kunena1 extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses Kunena1::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' => 'kunena_categories',
31
+ 'from_fieldname' => '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' => 'kunena_categories',
39
+ 'from_fieldname' => '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' => 'kunena_categories',
47
+ 'from_fieldname' => 'numTopics',
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' => 'kunena_categories',
55
+ 'from_fieldname' => 'numPosts',
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' => 'kunena_categories',
63
+ 'from_fieldname' => 'numTopics',
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' => 'kunena_categories',
71
+ 'from_fieldname' => 'numPosts',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_reply_count'
74
+ );
75
+
76
+ // Forum title.
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'kunena_categories',
79
+ 'from_fieldname' => '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' => 'kunena_categories',
87
+ 'from_fieldname' => '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' => 'kunena_categories',
96
+ 'from_fieldname' => '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' => 'kunena_categories',
105
+ 'from_fieldname' => 'ordering',
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' => 'kunena_categories',
113
+ 'from_fieldname' => 'parent',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => '_bbp_forum_type',
116
+ 'callback_method' => 'callback_forum_type'
117
+ );
118
+
119
+ // Forum status (Open = 0 or Closed = 1, Stored in postmeta)
120
+ $this->field_map[] = array(
121
+ 'from_tablename' => 'kunena_categories',
122
+ 'from_fieldname' => 'locked',
123
+ 'to_type' => 'forum',
124
+ 'to_fieldname' => '_bbp_status',
125
+ 'callback_method' => 'callback_forum_status'
126
+ );
127
+
128
+ // Forum dates.
129
+ $this->field_map[] = array(
130
+ 'to_type' => 'forum',
131
+ 'to_fieldname' => 'post_date',
132
+ 'default' => date('Y-m-d H:i:s')
133
+ );
134
+ $this->field_map[] = array(
135
+ 'to_type' => 'forum',
136
+ 'to_fieldname' => 'post_date_gmt',
137
+ 'default' => date('Y-m-d H:i:s')
138
+ );
139
+ $this->field_map[] = array(
140
+ 'to_type' => 'forum',
141
+ 'to_fieldname' => 'post_modified',
142
+ 'default' => date('Y-m-d H:i:s')
143
+ );
144
+ $this->field_map[] = array(
145
+ 'to_type' => 'forum',
146
+ 'to_fieldname' => 'post_modified_gmt',
147
+ 'default' => date('Y-m-d H:i:s')
148
+ );
149
+
150
+ /** Topic Section *****************************************************/
151
+
152
+ // Topic id (Stored in postmeta)
153
+ $this->field_map[] = array(
154
+ 'from_tablename' => 'kunena_messages',
155
+ 'from_fieldname' => 'thread',
156
+ 'to_type' => 'topic',
157
+ 'to_fieldname' => '_bbp_topic_id'
158
+ );
159
+
160
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'kunena_messages',
163
+ 'from_fieldname' => 'catid',
164
+ 'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_forum_id',
166
+ 'callback_method' => 'callback_forumid'
167
+ );
168
+
169
+ // Topic author.
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'kunena_messages',
172
+ 'from_fieldname' => 'userid',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => 'post_author',
175
+ 'callback_method' => 'callback_userid'
176
+ );
177
+
178
+ // Topic Author ip (Stored in postmeta)
179
+ $this->field_map[] = array(
180
+ 'from_tablename' => 'kunena_messages',
181
+ 'from_fieldname' => 'ip',
182
+ 'to_type' => 'topic',
183
+ 'to_fieldname' => '_bbp_author_ip'
184
+ );
185
+
186
+ // Topic content.
187
+ // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include topic content.
188
+ $this->field_map[] = array(
189
+ 'from_tablename' => 'kunena_messages_text',
190
+ 'from_fieldname' => 'message',
191
+ 'join_tablename' => 'kunena_messages',
192
+ 'join_type' => 'INNER',
193
+ 'join_expression' => 'ON kunena_messages_text.mesid = kunena_messages.id WHERE kunena_messages.parent = 0',
194
+ 'to_type' => 'topic',
195
+ 'to_fieldname' => 'post_content',
196
+ 'callback_method' => 'callback_html'
197
+ );
198
+
199
+ // Topic title.
200
+ $this->field_map[] = array(
201
+ 'from_tablename' => 'kunena_messages',
202
+ 'from_fieldname' => 'subject',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => 'post_title'
205
+ );
206
+
207
+ // Topic slug (Clean name to avoid conflicts)
208
+ $this->field_map[] = array(
209
+ 'from_tablename' => 'kunena_messages',
210
+ 'from_fieldname' => 'subject',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => 'post_name',
213
+ 'callback_method' => 'callback_slug'
214
+ );
215
+
216
+ // Topic parent forum id (If no parent, then 0)
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'kunena_messages',
219
+ 'from_fieldname' => 'catid',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_parent',
222
+ 'callback_method' => 'callback_forumid'
223
+ );
224
+
225
+ // Topic dates.
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'kunena_messages',
228
+ 'from_fieldname' => 'time',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_date',
231
+ 'callback_method' => 'callback_datetime'
232
+ );
233
+ $this->field_map[] = array(
234
+ 'from_tablename' => 'kunena_messages',
235
+ 'from_fieldname' => 'time',
236
+ 'to_type' => 'topic',
237
+ 'to_fieldname' => 'post_date_gmt',
238
+ 'callback_method' => 'callback_datetime'
239
+ );
240
+ $this->field_map[] = array(
241
+ 'from_tablename' => 'kunena_messages',
242
+ 'from_fieldname' => 'time',
243
+ 'to_type' => 'topic',
244
+ 'to_fieldname' => 'post_modified',
245
+ 'callback_method' => 'callback_datetime'
246
+ );
247
+ $this->field_map[] = array(
248
+ 'from_tablename' => 'kunena_messages',
249
+ 'from_fieldname' => 'time',
250
+ 'to_type' => 'topic',
251
+ 'to_fieldname' => 'post_modified_gmt',
252
+ 'callback_method' => 'callback_datetime'
253
+ );
254
+ $this->field_map[] = array(
255
+ 'from_tablename' => 'kunena_messages',
256
+ 'from_fieldname' => 'time',
257
+ 'to_type' => 'topic',
258
+ 'to_fieldname' => '_bbp_last_active_time',
259
+ 'callback_method' => 'callback_datetime'
260
+ );
261
+
262
+ // Topic status (Open or Closed, Kunena v3.x 0=open & 1=closed)
263
+ $this->field_map[] = array(
264
+ 'from_tablename' => 'kunena_messages',
265
+ 'from_fieldname' => 'locked',
266
+ 'to_type' => 'topic',
267
+ 'to_fieldname' => 'post_status',
268
+ 'callback_method' => 'callback_topic_status'
269
+ );
270
+
271
+ /** Tags Section ******************************************************/
272
+
273
+ /**
274
+ * Kunena v1.x Forums do not support topic tags out of the box
275
+ */
276
+
277
+ /** Reply Section *****************************************************/
278
+
279
+ // Reply id (Stored in postmeta)
280
+ $this->field_map[] = array(
281
+ 'from_tablename' => 'kunena_messages',
282
+ 'from_fieldname' => 'id',
283
+ 'to_type' => 'reply',
284
+ 'to_fieldname' => '_bbp_post_id'
285
+ );
286
+
287
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
288
+ $this->field_map[] = array(
289
+ 'from_tablename' => 'kunena_messages',
290
+ 'from_fieldname' => 'catid',
291
+ 'to_type' => 'reply',
292
+ 'to_fieldname' => '_bbp_forum_id',
293
+ 'callback_method' => 'callback_topicid_to_forumid'
294
+ );
295
+
296
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
297
+ $this->field_map[] = array(
298
+ 'from_tablename' => 'kunena_messages',
299
+ 'from_fieldname' => 'thread',
300
+ 'to_type' => 'reply',
301
+ 'to_fieldname' => '_bbp_topic_id',
302
+ 'callback_method' => 'callback_topicid'
303
+ );
304
+
305
+ // Reply author ip (Stored in postmeta)
306
+ $this->field_map[] = array(
307
+ 'from_tablename' => 'kunena_messages',
308
+ 'from_fieldname' => 'ip',
309
+ 'to_type' => 'reply',
310
+ 'to_fieldname' => '_bbp_author_ip'
311
+ );
312
+
313
+ // Reply author.
314
+ $this->field_map[] = array(
315
+ 'from_tablename' => 'kunena_messages',
316
+ 'from_fieldname' => 'userid',
317
+ 'to_type' => 'reply',
318
+ 'to_fieldname' => 'post_author',
319
+ 'callback_method' => 'callback_userid'
320
+ );
321
+
322
+ // Reply title.
323
+ $this->field_map[] = array(
324
+ 'from_tablename' => 'kunena_messages',
325
+ 'from_fieldname' => 'subject',
326
+ 'to_type' => 'reply',
327
+ 'to_fieldname' => 'post_title',
328
+ 'callback_method' => 'callback_reply_title'
329
+ );
330
+
331
+ // Reply slug (Clean name to avoid conflicts)
332
+ $this->field_map[] = array(
333
+ 'from_tablename' => 'kunena_messages',
334
+ 'from_fieldname' => 'subject',
335
+ 'to_type' => 'reply',
336
+ 'to_fieldname' => 'post_name',
337
+ 'callback_method' => 'callback_slug'
338
+ );
339
+
340
+ // Reply content.
341
+ // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'kunena_messages_text',
344
+ 'from_fieldname' => 'message',
345
+ 'join_tablename' => 'kunena_messages',
346
+ 'join_type' => 'INNER',
347
+ 'join_expression' => 'ON kunena_messages.id = kunena_messages_text.mesid WHERE kunena_messages.parent != 0',
348
+ 'to_type' => 'reply',
349
+ 'to_fieldname' => 'post_content',
350
+ 'callback_method' => 'callback_html'
351
+ );
352
+
353
+ // Reply parent topic id (If no parent, then 0)
354
+ $this->field_map[] = array(
355
+ 'from_tablename' => 'kunena_messages',
356
+ 'from_fieldname' => 'thread',
357
+ 'to_type' => 'reply',
358
+ 'to_fieldname' => 'post_parent',
359
+ 'callback_method' => 'callback_topicid'
360
+ );
361
+
362
+ // Reply dates.
363
+ $this->field_map[] = array(
364
+ 'from_tablename' => 'kunena_messages',
365
+ 'from_fieldname' => 'time',
366
+ 'to_type' => 'reply',
367
+ 'to_fieldname' => 'post_date',
368
+ 'callback_method' => 'callback_datetime'
369
+ );
370
+ $this->field_map[] = array(
371
+ 'from_tablename' => 'kunena_messages',
372
+ 'from_fieldname' => 'time',
373
+ 'to_type' => 'reply',
374
+ 'to_fieldname' => 'post_date_gmt',
375
+ 'callback_method' => 'callback_datetime'
376
+ );
377
+ $this->field_map[] = array(
378
+ 'from_tablename' => 'kunena_messages',
379
+ 'from_fieldname' => 'time',
380
+ 'to_type' => 'reply',
381
+ 'to_fieldname' => 'post_modified',
382
+ 'callback_method' => 'callback_datetime'
383
+ );
384
+ $this->field_map[] = array(
385
+ 'from_tablename' => 'kunena_messages',
386
+ 'from_fieldname' => 'time',
387
+ 'to_type' => 'reply',
388
+ 'to_fieldname' => 'post_modified_gmt',
389
+ 'callback_method' => 'callback_datetime'
390
+ );
391
+
392
+ /** User Section ******************************************************/
393
+
394
+ //Note: We are importing the Joomla User details and the Kunena v1.x user profile details.
395
+
396
+ // Store old User id (Stored in usermeta)
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'users',
399
+ 'from_fieldname' => 'id',
400
+ 'to_type' => 'user',
401
+ 'to_fieldname' => '_bbp_user_id'
402
+ );
403
+
404
+ // Store old User password (Stored in usermeta serialized with salt)
405
+ $this->field_map[] = array(
406
+ 'from_tablename' => 'users',
407
+ 'from_fieldname' => 'password',
408
+ 'to_type' => 'user',
409
+ 'to_fieldname' => '_bbp_password',
410
+ 'callback_method' => 'callback_savepass'
411
+ );
412
+
413
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
414
+ // $this->field_map[] = array(
415
+ // 'from_tablename' => 'user',
416
+ // 'from_fieldname' => 'salt',
417
+ // 'to_type' => 'user',
418
+ // 'to_fieldname' => ''
419
+ // );
420
+
421
+ // User password verify class (Stored in usermeta for verifying password)
422
+ // $this->field_map[] = array(
423
+ // 'to_type' => 'user',
424
+ // 'to_fieldname' => '_bbp_class',
425
+ // 'default' => 'Kunena1'
426
+ // );
427
+
428
+ // User name.
429
+ $this->field_map[] = array(
430
+ 'from_tablename' => 'users',
431
+ 'from_fieldname' => 'username',
432
+ 'to_type' => 'user',
433
+ 'to_fieldname' => 'user_login'
434
+ );
435
+
436
+ // User email.
437
+ $this->field_map[] = array(
438
+ 'from_tablename' => 'users',
439
+ 'from_fieldname' => 'email',
440
+ 'to_type' => 'user',
441
+ 'to_fieldname' => 'user_email'
442
+ );
443
+
444
+ // User registered.
445
+ $this->field_map[] = array(
446
+ 'from_tablename' => 'users',
447
+ 'from_fieldname' => 'registerDate',
448
+ 'to_type' => 'user',
449
+ 'to_fieldname' => 'user_registered',
450
+ 'callback_method' => 'callback_datetime'
451
+ );
452
+ }
453
+
454
+ /**
455
+ * This method allows us to indicates what is or is not converted for each
456
+ * converter.
457
+ */
458
+ public function info() {
459
+ return '';
460
+ }
461
+
462
+ /**
463
+ * This method is to save the salt and password together. That
464
+ * way when we authenticate it we can get it out of the database
465
+ * as one value. Array values are auto sanitized by WordPress.
466
+ */
467
+ public function callback_savepass($field, $row) {
468
+ $pass_array = array('hash' => $field, 'salt' => $row['salt']);
469
+ return $pass_array;
470
+ }
471
+
472
+ /**
473
+ * This method is to take the pass out of the database and compare
474
+ * to a pass the user has typed in.
475
+ */
476
+ public function authenticate_pass($password, $serialized_pass) {
477
+ $pass_array = unserialize($serialized_pass);
478
+ return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
479
+ }
480
+
481
+ /**
482
+ * Translate the forum type from Kunena v1.x numeric's to WordPress's strings.
483
+ *
484
+ * @param int $status Kunena v1.x numeric forum type
485
+ * @return string WordPress safe
486
+ */
487
+ public function callback_forum_type( $status = 0 ) {
488
+ if ( $status == 0 ) {
489
+ $status = 'category';
490
+ } else {
491
+ $status = 'forum';
492
+ }
493
+ return $status;
494
+ }
495
+
496
+ /**
497
+ * Translate the forum status from Kunena v1.x numeric's to WordPress's strings.
498
+ *
499
+ * @param int $status Kunena v1.x numeric forum status
500
+ * @return string WordPress safe
501
+ */
502
+ public function callback_forum_status( $status = 0 ) {
503
+ switch ( $status ) {
504
+ case 1 :
505
+ $status = 'closed';
506
+ break;
507
+
508
+ case 0 :
509
+ default :
510
+ $status = 'open';
511
+ break;
512
+ }
513
+ return $status;
514
+ }
515
+
516
+ /**
517
+ * Translate the post status from Kunena v1.x numeric's to WordPress's strings.
518
+ *
519
+ * @param int $status Kunena v1.x numeric topic status
520
+ * @return string WordPress safe
521
+ */
522
+ public function callback_topic_status( $status = 0 ) {
523
+ switch ( $status ) {
524
+ case 1 :
525
+ $status = 'closed';
526
+ break;
527
+
528
+ case 0 :
529
+ default :
530
+ $status = 'publish';
531
+ break;
532
+ }
533
+ return $status;
534
+ }
535
+
536
+ /**
537
+ * Set the reply title
538
+ *
539
+ * @param string $title Kunena v1.x topic title of this reply
540
+ * @return string Prefixed topic title, or empty string
541
+ */
542
+ public function callback_reply_title( $title = '' ) {
543
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
544
+ return $title;
545
+ }
546
+ }
includes/admin/converters/Kunena2.php ADDED
@@ -0,0 +1,588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of Kunena v2.x Forums for Joomla Forum converter.
5
+ *
6
+ * @since bbPress (r5144)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/kunena/
8
+ */
9
+ class Kunena2 extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses Kunena2::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
+
29
+ // Forum id (Stored in postmeta)
30
+ $this->field_map[] = array(
31
+ 'from_tablename' => 'kunena_categories',
32
+ 'from_fieldname' => 'id',
33
+ 'to_type' => 'forum',
34
+ 'to_fieldname' => '_bbp_forum_id'
35
+ );
36
+
37
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
38
+ $this->field_map[] = array(
39
+ 'from_tablename' => 'kunena_categories',
40
+ 'from_fieldname' => 'parent_id',
41
+ 'to_type' => 'forum',
42
+ 'to_fieldname' => '_bbp_forum_parent_id'
43
+ );
44
+
45
+ // Forum topic count (Stored in postmeta)
46
+ $this->field_map[] = array(
47
+ 'from_tablename' => 'kunena_categories',
48
+ 'from_fieldname' => 'numTopics',
49
+ 'to_type' => 'forum',
50
+ 'to_fieldname' => '_bbp_topic_count'
51
+ );
52
+
53
+ // Forum reply count (Stored in postmeta)
54
+ $this->field_map[] = array(
55
+ 'from_tablename' => 'kunena_categories',
56
+ 'from_fieldname' => 'numPosts',
57
+ 'to_type' => 'forum',
58
+ 'to_fieldname' => '_bbp_reply_count'
59
+ );
60
+
61
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
62
+ $this->field_map[] = array(
63
+ 'from_tablename' => 'kunena_categories',
64
+ 'from_fieldname' => 'numTopics',
65
+ 'to_type' => 'forum',
66
+ 'to_fieldname' => '_bbp_total_topic_count'
67
+ );
68
+
69
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
70
+ $this->field_map[] = array(
71
+ 'from_tablename' => 'kunena_categories',
72
+ 'from_fieldname' => 'numPosts',
73
+ 'to_type' => 'forum',
74
+ 'to_fieldname' => '_bbp_total_reply_count'
75
+ );
76
+
77
+ // Forum title.
78
+ $this->field_map[] = array(
79
+ 'from_tablename' => 'kunena_categories',
80
+ 'from_fieldname' => 'name',
81
+ 'to_type' => 'forum',
82
+ 'to_fieldname' => 'post_title'
83
+ );
84
+
85
+ // Forum slug (Clean name to avoid conflicts)
86
+ $this->field_map[] = array(
87
+ 'from_tablename' => 'kunena_categories',
88
+ 'from_fieldname' => 'alias',
89
+ 'to_type' => 'forum',
90
+ 'to_fieldname' => 'post_name',
91
+ 'callback_method' => 'callback_slug'
92
+ );
93
+
94
+ // Forum description.
95
+ $this->field_map[] = array(
96
+ 'from_tablename' => 'kunena_categories',
97
+ 'from_fieldname' => 'description',
98
+ 'to_type' => 'forum',
99
+ 'to_fieldname' => 'post_content',
100
+ 'callback_method' => 'callback_null'
101
+ );
102
+
103
+ // Forum display order (Starts from 1)
104
+ $this->field_map[] = array(
105
+ 'from_tablename' => 'kunena_categories',
106
+ 'from_fieldname' => 'ordering',
107
+ 'to_type' => 'forum',
108
+ 'to_fieldname' => 'menu_order'
109
+ );
110
+
111
+ // Forum type (Category = 0 or Forum = >0, Stored in postmeta)
112
+ $this->field_map[] = array(
113
+ 'from_tablename' => 'kunena_categories',
114
+ 'from_fieldname' => 'parent_id',
115
+ 'to_type' => 'forum',
116
+ 'to_fieldname' => '_bbp_forum_type',
117
+ 'callback_method' => 'callback_forum_type'
118
+ );
119
+
120
+ // Forum status (Open = 0 or Closed = 1, Stored in postmeta)
121
+ $this->field_map[] = array(
122
+ 'from_tablename' => 'kunena_categories',
123
+ 'from_fieldname' => 'locked',
124
+ 'to_type' => 'forum',
125
+ 'to_fieldname' => '_bbp_status',
126
+ 'callback_method' => 'callback_forum_status'
127
+ );
128
+
129
+ // Forum dates.
130
+ $this->field_map[] = array(
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => 'post_date',
133
+ 'default' => date('Y-m-d H:i:s')
134
+ );
135
+ $this->field_map[] = array(
136
+ 'to_type' => 'forum',
137
+ 'to_fieldname' => 'post_date_gmt',
138
+ 'default' => date('Y-m-d H:i:s')
139
+ );
140
+ $this->field_map[] = array(
141
+ 'to_type' => 'forum',
142
+ 'to_fieldname' => 'post_modified',
143
+ 'default' => date('Y-m-d H:i:s')
144
+ );
145
+ $this->field_map[] = array(
146
+ 'to_type' => 'forum',
147
+ 'to_fieldname' => 'post_modified_gmt',
148
+ 'default' => date('Y-m-d H:i:s')
149
+ );
150
+
151
+ /** Topic Section *****************************************************/
152
+
153
+ // Topic id (Stored in postmeta)
154
+ $this->field_map[] = array(
155
+ 'from_tablename' => 'kunena_topics',
156
+ 'from_fieldname' => 'id',
157
+ 'to_type' => 'topic',
158
+ 'to_fieldname' => '_bbp_topic_id'
159
+ );
160
+
161
+ // Topic reply count (Stored in postmeta)
162
+ $this->field_map[] = array(
163
+ 'from_tablename' => 'kunena_topics',
164
+ 'from_fieldname' => 'posts',
165
+ 'to_type' => 'topic',
166
+ 'to_fieldname' => '_bbp_reply_count',
167
+ 'callback_method' => 'callback_topic_reply_count'
168
+ );
169
+
170
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
171
+ $this->field_map[] = array(
172
+ 'from_tablename' => 'kunena_topics',
173
+ 'from_fieldname' => 'posts',
174
+ 'to_type' => 'topic',
175
+ 'to_fieldname' => '_bbp_total_reply_count',
176
+ 'callback_method' => 'callback_topic_reply_count'
177
+ );
178
+
179
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
180
+ $this->field_map[] = array(
181
+ 'from_tablename' => 'kunena_topics',
182
+ 'from_fieldname' => 'category_id',
183
+ 'to_type' => 'topic',
184
+ 'to_fieldname' => '_bbp_forum_id',
185
+ 'callback_method' => 'callback_forumid'
186
+ );
187
+
188
+ // Topic author.
189
+ $this->field_map[] = array(
190
+ 'from_tablename' => 'kunena_topics',
191
+ 'from_fieldname' => 'first_post_userid',
192
+ 'to_type' => 'topic',
193
+ 'to_fieldname' => 'post_author',
194
+ 'callback_method' => 'callback_userid'
195
+ );
196
+
197
+ // Topic Author ip (Stored in postmeta)
198
+ // Note: We join the 'kunena_messages' table because 'kunena_topics' table does not include author ip.
199
+ $this->field_map[] = array(
200
+ 'from_tablename' => 'kunena_messages',
201
+ 'from_fieldname' => 'ip',
202
+ 'join_tablename' => 'kunena_topics',
203
+ 'join_type' => 'LEFT',
204
+ 'join_expression' => 'USING (id)',
205
+ 'to_type' => 'topic',
206
+ 'to_fieldname' => '_bbp_author_ip'
207
+ );
208
+
209
+ // Topic content.
210
+ $this->field_map[] = array(
211
+ 'from_tablename' => 'kunena_topics',
212
+ 'from_fieldname' => 'first_post_message',
213
+ 'to_type' => 'topic',
214
+ 'to_fieldname' => 'post_content',
215
+ 'callback_method' => 'callback_html'
216
+ );
217
+
218
+ // Topic title.
219
+ $this->field_map[] = array(
220
+ 'from_tablename' => 'kunena_topics',
221
+ 'from_fieldname' => 'subject',
222
+ 'to_type' => 'topic',
223
+ 'to_fieldname' => 'post_title'
224
+ );
225
+
226
+ // Topic slug (Clean name to avoid conflicts)
227
+ $this->field_map[] = array(
228
+ 'from_tablename' => 'kunena_topics',
229
+ 'from_fieldname' => 'subject',
230
+ 'to_type' => 'topic',
231
+ 'to_fieldname' => 'post_name',
232
+ 'callback_method' => 'callback_slug'
233
+ );
234
+
235
+ // Topic parent forum id (If no parent, then 0)
236
+ $this->field_map[] = array(
237
+ 'from_tablename' => 'kunena_topics',
238
+ 'from_fieldname' => 'category_id',
239
+ 'to_type' => 'topic',
240
+ 'to_fieldname' => 'post_parent',
241
+ 'callback_method' => 'callback_forumid'
242
+ );
243
+
244
+ // Topic dates.
245
+ $this->field_map[] = array(
246
+ 'from_tablename' => 'kunena_topics',
247
+ 'from_fieldname' => 'first_post_time',
248
+ 'to_type' => 'topic',
249
+ 'to_fieldname' => 'post_date',
250
+ 'callback_method' => 'callback_datetime'
251
+ );
252
+ $this->field_map[] = array(
253
+ 'from_tablename' => 'kunena_topics',
254
+ 'from_fieldname' => 'first_post_time',
255
+ 'to_type' => 'topic',
256
+ 'to_fieldname' => 'post_date_gmt',
257
+ 'callback_method' => 'callback_datetime'
258
+ );
259
+ $this->field_map[] = array(
260
+ 'from_tablename' => 'kunena_topics',
261
+ 'from_fieldname' => 'last_post_time',
262
+ 'to_type' => 'topic',
263
+ 'to_fieldname' => 'post_modified',
264
+ 'callback_method' => 'callback_datetime'
265
+ );
266
+ $this->field_map[] = array(
267
+ 'from_tablename' => 'kunena_topics',
268
+ 'from_fieldname' => 'last_post_time',
269
+ 'to_type' => 'topic',
270
+ 'to_fieldname' => 'post_modified_gmt',
271
+ 'callback_method' => 'callback_datetime'
272
+ );
273
+ $this->field_map[] = array(
274
+ 'from_tablename' => 'kunena_topics',
275
+ 'from_fieldname' => 'last_post_time',
276
+ 'to_type' => 'topic',
277
+ 'to_fieldname' => '_bbp_last_active_time',
278
+ 'callback_method' => 'callback_datetime'
279
+ );
280
+
281
+ // Topic status (Open or Closed, Kunena v2.x 0=open & 1=closed)
282
+ $this->field_map[] = array(
283
+ 'from_tablename' => 'kunena_topics',
284
+ 'from_fieldname' => 'locked',
285
+ 'to_type' => 'topic',
286
+ 'to_fieldname' => 'post_status',
287
+ 'callback_method' => 'callback_topic_status'
288
+ );
289
+
290
+ /** Tags Section ******************************************************/
291
+
292
+ /**
293
+ * Kunena v2.x Forums do not support topic tags out of the box
294
+ */
295
+
296
+ /** Reply Section *****************************************************/
297
+
298
+ // Reply id (Stored in postmeta)
299
+ $this->field_map[] = array(
300
+ 'from_tablename' => 'kunena_messages',
301
+ 'from_fieldname' => 'id',
302
+ 'to_type' => 'reply',
303
+ 'to_fieldname' => '_bbp_post_id'
304
+ );
305
+
306
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
307
+ $this->field_map[] = array(
308
+ 'from_tablename' => 'kunena_messages',
309
+ 'from_fieldname' => 'catid',
310
+ 'to_type' => 'reply',
311
+ 'to_fieldname' => '_bbp_forum_id',
312
+ 'callback_method' => 'callback_topicid_to_forumid'
313
+ );
314
+
315
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
316
+ $this->field_map[] = array(
317
+ 'from_tablename' => 'kunena_messages',
318
+ 'from_fieldname' => 'thread',
319
+ 'to_type' => 'reply',
320
+ 'to_fieldname' => '_bbp_topic_id',
321
+ 'callback_method' => 'callback_topicid'
322
+ );
323
+
324
+ // Reply author ip (Stored in postmeta)
325
+ $this->field_map[] = array(
326
+ 'from_tablename' => 'kunena_messages',
327
+ 'from_fieldname' => 'ip',
328
+ 'to_type' => 'reply',
329
+ 'to_fieldname' => '_bbp_author_ip'
330
+ );
331
+
332
+ // Reply author.
333
+ $this->field_map[] = array(
334
+ 'from_tablename' => 'kunena_messages',
335
+ 'from_fieldname' => 'userid',
336
+ 'to_type' => 'reply',
337
+ 'to_fieldname' => 'post_author',
338
+ 'callback_method' => 'callback_userid'
339
+ );
340
+
341
+ // Reply title.
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'kunena_messages',
344
+ 'from_fieldname' => 'subject',
345
+ 'to_type' => 'reply',
346
+ 'to_fieldname' => 'post_title',
347
+ 'callback_method' => 'callback_reply_title'
348
+ );
349
+
350
+ // Reply slug (Clean name to avoid conflicts)
351
+ $this->field_map[] = array(
352
+ 'from_tablename' => 'kunena_messages',
353
+ 'from_fieldname' => 'subject',
354
+ 'to_type' => 'reply',
355
+ 'to_fieldname' => 'post_name',
356
+ 'callback_method' => 'callback_slug'
357
+ );
358
+
359
+ // Reply content.
360
+ // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
361
+ $this->field_map[] = array(
362
+ 'from_tablename' => 'kunena_messages_text',
363
+ 'from_fieldname' => 'message',
364
+ 'join_tablename' => 'kunena_messages',
365
+ 'join_type' => 'LEFT',
366
+ 'join_expression' => 'ON kunena_messages_text.mesid = kunena_messages.id LEFT JOIN jos_kunena_topics AS kunena_topics ON kunena_messages.thread = kunena_topics.id WHERE kunena_messages.parent != 0',
367
+ 'to_type' => 'reply',
368
+ 'to_fieldname' => 'post_content',
369
+ 'callback_method' => 'callback_html'
370
+ );
371
+
372
+ // Reply parent topic id (If no parent, then 0)
373
+ $this->field_map[] = array(
374
+ 'from_tablename' => 'kunena_messages',
375
+ 'from_fieldname' => 'thread',
376
+ 'to_type' => 'reply',
377
+ 'to_fieldname' => 'post_parent',
378
+ 'callback_method' => 'callback_topicid'
379
+ );
380
+
381
+ // Reply dates.
382
+ $this->field_map[] = array(
383
+ 'from_tablename' => 'kunena_messages',
384
+ 'from_fieldname' => 'time',
385
+ 'to_type' => 'reply',
386
+ 'to_fieldname' => 'post_date',
387
+ 'callback_method' => 'callback_datetime'
388
+ );
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'kunena_messages',
391
+ 'from_fieldname' => 'time',
392
+ 'to_type' => 'reply',
393
+ 'to_fieldname' => 'post_date_gmt',
394
+ 'callback_method' => 'callback_datetime'
395
+ );
396
+ $this->field_map[] = array(
397
+ 'from_tablename' => 'kunena_messages',
398
+ 'from_fieldname' => 'time',
399
+ 'to_type' => 'reply',
400
+ 'to_fieldname' => 'post_modified',
401
+ 'callback_method' => 'callback_datetime'
402
+ );
403
+ $this->field_map[] = array(
404
+ 'from_tablename' => 'kunena_messages',
405
+ 'from_fieldname' => 'time',
406
+ 'to_type' => 'reply',
407
+ 'to_fieldname' => 'post_modified_gmt',
408
+ 'callback_method' => 'callback_datetime'
409
+ );
410
+
411
+ /** User Section ******************************************************/
412
+
413
+ //Note: We are importing the Joomla User details and the Kunena v2.x user profile details.
414
+
415
+ // Store old User id (Stored in usermeta)
416
+ $this->field_map[] = array(
417
+ 'from_tablename' => 'users',
418
+ 'from_fieldname' => 'id',
419
+ 'to_type' => 'user',
420
+ 'to_fieldname' => '_bbp_user_id'
421
+ );
422
+
423
+ // Store old User password (Stored in usermeta serialized with salt)
424
+ $this->field_map[] = array(
425
+ 'from_tablename' => 'users',
426
+ 'from_fieldname' => 'password',
427
+ 'to_type' => 'user',
428
+ 'to_fieldname' => '_bbp_password',
429
+ 'callback_method' => 'callback_savepass'
430
+ );
431
+
432
+ // Store old User Salt. This is only used for the SELECT row info for the above password save
433
+ /*
434
+ $this->field_map[] = array(
435
+ 'from_tablename' => 'users',
436
+ 'from_fieldname' => 'salt',
437
+ 'to_type' => 'user',
438
+ 'to_fieldname' => ''
439
+ );
440
+ */
441
+
442
+ // User password verify class. Stores in usermeta for verifying password.
443
+ /*
444
+ $this->field_map[] = array(
445
+ 'to_type' => 'user',
446
+ 'to_fieldname' => '_bbp_class',
447
+ 'default' => 'Kunena2'
448
+ );
449
+ */
450
+
451
+ // User name.
452
+ $this->field_map[] = array(
453
+ 'from_tablename' => 'users',
454
+ 'from_fieldname' => 'username',
455
+ 'to_type' => 'user',
456
+ 'to_fieldname' => 'user_login'
457
+ );
458
+
459
+ // User email.
460
+ $this->field_map[] = array(
461
+ 'from_tablename' => 'users',
462
+ 'from_fieldname' => 'email',
463
+ 'to_type' => 'user',
464
+ 'to_fieldname' => 'user_email'
465
+ );
466
+
467
+ // User registered.
468
+ $this->field_map[] = array(
469
+ 'from_tablename' => 'users',
470
+ 'from_fieldname' => 'registerDate',
471
+ 'to_type' => 'user',
472
+ 'to_fieldname' => 'user_registered',
473
+ 'callback_method' => 'callback_datetime'
474
+ );
475
+
476
+ // User display name.
477
+ $this->field_map[] = array(
478
+ 'from_tablename' => 'users',
479
+ 'from_fieldname' => 'name',
480
+ 'to_type' => 'user',
481
+ 'to_fieldname' => 'display_name'
482
+ );
483
+
484
+ }
485
+
486
+ /**
487
+ * This method allows us to indicates what is or is not converted for each
488
+ * converter.
489
+ */
490
+ public function info() {
491
+ return '';
492
+ }
493
+
494
+ /**
495
+ * This method is to save the salt and password together. That
496
+ * way when we authenticate it we can get it out of the database
497
+ * as one value. Array values are auto sanitized by WordPress.
498
+ */
499
+ public function callback_savepass($field, $row) {
500
+ $pass_array = array('hash' => $field, 'salt' => $row['salt']);
501
+ return $pass_array;
502
+ }
503
+
504
+ /**
505
+ * This method is to take the pass out of the database and compare
506
+ * to a pass the user has typed in.
507
+ */
508
+ public function authenticate_pass($password, $serialized_pass) {
509
+ $pass_array = unserialize($serialized_pass);
510
+ return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
511
+ }
512
+ /**
513
+ * Translate the forum type from Kunena v2.x numeric's to WordPress's strings.
514
+ *
515
+ * @param int $status Kunena v2.x numeric forum type
516
+ * @return string WordPress safe
517
+ */
518
+ public function callback_forum_type( $status = 0 ) {
519
+ if ( $status == 0 ) {
520
+ $status = 'category';
521
+ } else {
522
+ $status = 'forum';
523
+ }
524
+ return $status;
525
+ }
526
+
527
+ /**
528
+ * Translate the forum status from Kunena v2.x numeric's to WordPress's strings.
529
+ *
530
+ * @param int $status Kunena v2.x numeric forum status
531
+ * @return string WordPress safe
532
+ */
533
+ public function callback_forum_status( $status = 0 ) {
534
+ switch ( $status ) {
535
+ case 1 :
536
+ $status = 'closed';
537
+ break;
538
+
539
+ case 0 :
540
+ default :
541
+ $status = 'open';
542
+ break;
543
+ }
544
+ return $status;
545
+ }
546
+
547
+ /**
548
+ * Translate the post status from Kunena v2.x numeric's to WordPress's strings.
549
+ *
550
+ * @param int $status Kunena v2.x numeric topic status
551
+ * @return string WordPress safe
552
+ */
553
+ public function callback_topic_status( $status = 0 ) {
554
+ switch ( $status ) {
555
+ case 1 :
556
+ $status = 'closed';
557
+ break;
558
+
559
+ case 0 :
560
+ default :
561
+ $status = 'publish';
562
+ break;
563
+ }
564
+ return $status;
565
+ }
566
+
567
+ /**
568
+ * Verify the topic/reply count.
569
+ *
570
+ * @param int $count Kunena v2.x topic/reply counts
571
+ * @return string WordPress safe
572
+ */
573
+ public function callback_topic_reply_count( $count = 1 ) {
574
+ $count = absint( (int) $count - 1 );
575
+ return $count;
576
+ }
577
+
578
+ /**
579
+ * Set the reply title
580
+ *
581
+ * @param string $title Kunena v2.x topic title of this reply
582
+ * @return string Prefixed topic title, or empty string
583
+ */
584
+ public function callback_reply_title( $title = '' ) {
585
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
586
+ return $title;
587
+ }
588
+ }
includes/admin/converters/Kunena3.php ADDED
@@ -0,0 +1,815 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of Kunena v3.x Forums for Joomla Forum converter.
5
+ *
6
+ * @since bbPress (r5144)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/kunena/
8
+ */
9
+ class Kunena3 extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses Kunena3::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' => 'kunena_categories',
31
+ 'from_fieldname' => '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' => 'kunena_categories',
39
+ 'from_fieldname' => 'parent_id',
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' => 'kunena_categories',
47
+ 'from_fieldname' => 'numTopics',
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' => 'kunena_categories',
55
+ 'from_fieldname' => 'numPosts',
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' => 'kunena_categories',
63
+ 'from_fieldname' => 'numTopics',
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' => 'kunena_categories',
71
+ 'from_fieldname' => 'numPosts',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_reply_count'
74
+ );
75
+
76
+ // Forum title.
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'kunena_categories',
79
+ 'from_fieldname' => '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' => 'kunena_categories',
87
+ 'from_fieldname' => 'alias',
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' => 'kunena_categories',
96
+ 'from_fieldname' => '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' => 'kunena_categories',
105
+ 'from_fieldname' => 'ordering',
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' => 'kunena_categories',
113
+ 'from_fieldname' => 'parent_id',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => '_bbp_forum_type',
116
+ 'callback_method' => 'callback_forum_type'
117
+ );
118
+
119
+ // Forum status (Open = 0 or Closed = 1, Stored in postmeta)
120
+ $this->field_map[] = array(
121
+ 'from_tablename' => 'kunena_categories',
122
+ 'from_fieldname' => 'locked',
123
+ 'to_type' => 'forum',
124
+ 'to_fieldname' => '_bbp_status',
125
+ 'callback_method' => 'callback_forum_status'
126
+ );
127
+
128
+ // Forum dates.
129
+ $this->field_map[] = array(
130
+ 'to_type' => 'forum',
131
+ 'to_fieldname' => 'post_date',
132
+ 'default' => date('Y-m-d H:i:s')
133
+ );
134
+ $this->field_map[] = array(
135
+ 'to_type' => 'forum',
136
+ 'to_fieldname' => 'post_date_gmt',
137
+ 'default' => date('Y-m-d H:i:s')
138
+ );
139
+ $this->field_map[] = array(
140
+ 'to_type' => 'forum',
141
+ 'to_fieldname' => 'post_modified',
142
+ 'default' => date('Y-m-d H:i:s')
143
+ );
144
+ $this->field_map[] = array(
145
+ 'to_type' => 'forum',
146
+ 'to_fieldname' => 'post_modified_gmt',
147
+ 'default' => date('Y-m-d H:i:s')
148
+ );
149
+
150
+ /** Topic Section *****************************************************/
151
+
152
+ // Topic id (Stored in postmeta)
153
+ $this->field_map[] = array(
154
+ 'from_tablename' => 'kunena_topics',
155
+ 'from_fieldname' => 'id',
156
+ 'to_type' => 'topic',
157
+ 'to_fieldname' => '_bbp_topic_id'
158
+ );
159
+
160
+ // Topic reply count (Stored in postmeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'kunena_topics',
163
+ 'from_fieldname' => 'posts',
164
+ 'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_reply_count',
166
+ 'callback_method' => 'callback_topic_reply_count'
167
+ );
168
+
169
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'kunena_topics',
172
+ 'from_fieldname' => 'posts',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => '_bbp_total_reply_count',
175
+ 'callback_method' => 'callback_topic_reply_count'
176
+ );
177
+
178
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
179
+ $this->field_map[] = array(
180
+ 'from_tablename' => 'kunena_topics',
181
+ 'from_fieldname' => 'category_id',
182
+ 'to_type' => 'topic',
183
+ 'to_fieldname' => '_bbp_forum_id',
184
+ 'callback_method' => 'callback_forumid'
185
+ );
186
+
187
+ // Topic author.
188
+ $this->field_map[] = array(
189
+ 'from_tablename' => 'kunena_topics',
190
+ 'from_fieldname' => 'first_post_userid',
191
+ 'to_type' => 'topic',
192
+ 'to_fieldname' => 'post_author',
193
+ 'callback_method' => 'callback_userid'
194
+ );
195
+
196
+ // Topic Author ip (Stored in postmeta)
197
+ // Note: We join the 'kunena_messages' table because 'kunena_topics' table does not include author ip.
198
+ $this->field_map[] = array(
199
+ 'from_tablename' => 'kunena_messages',
200
+ 'from_fieldname' => 'ip',
201
+ 'join_tablename' => 'kunena_topics',
202
+ 'join_type' => 'LEFT',
203
+ 'join_expression' => 'USING (id)',
204
+ 'to_type' => 'topic',
205
+ 'to_fieldname' => '_bbp_author_ip'
206
+ );
207
+
208
+ // Topic content.
209
+ $this->field_map[] = array(
210
+ 'from_tablename' => 'kunena_topics',
211
+ 'from_fieldname' => 'first_post_message',
212
+ 'to_type' => 'topic',
213
+ 'to_fieldname' => 'post_content',
214
+ 'callback_method' => 'callback_html'
215
+ );
216
+
217
+ // Topic title.
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'kunena_topics',
220
+ 'from_fieldname' => 'subject',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => 'post_title'
223
+ );
224
+
225
+ // Topic slug (Clean name to avoid conflicts)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'kunena_topics',
228
+ 'from_fieldname' => 'subject',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_name',
231
+ 'callback_method' => 'callback_slug'
232
+ );
233
+
234
+ // Topic parent forum id (If no parent, then 0)
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'kunena_topics',
237
+ 'from_fieldname' => 'category_id',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => 'post_parent',
240
+ 'callback_method' => 'callback_forumid'
241
+ );
242
+
243
+ // Topic dates.
244
+ $this->field_map[] = array(
245
+ 'from_tablename' => 'kunena_topics',
246
+ 'from_fieldname' => 'first_post_time',
247
+ 'to_type' => 'topic',
248
+ 'to_fieldname' => 'post_date',
249
+ 'callback_method' => 'callback_datetime'
250
+ );
251
+ $this->field_map[] = array(
252
+ 'from_tablename' => 'kunena_topics',
253
+ 'from_fieldname' => 'first_post_time',
254
+ 'to_type' => 'topic',
255
+ 'to_fieldname' => 'post_date_gmt',
256
+ 'callback_method' => 'callback_datetime'
257
+ );
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'kunena_topics',
260
+ 'from_fieldname' => 'last_post_time',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => 'post_modified',
263
+ 'callback_method' => 'callback_datetime'
264
+ );
265
+ $this->field_map[] = array(
266
+ 'from_tablename' => 'kunena_topics',
267
+ 'from_fieldname' => 'last_post_time',
268
+ 'to_type' => 'topic',
269
+ 'to_fieldname' => 'post_modified_gmt',
270
+ 'callback_method' => 'callback_datetime'
271
+ );
272
+ $this->field_map[] = array(
273
+ 'from_tablename' => 'kunena_topics',
274
+ 'from_fieldname' => 'last_post_time',
275
+ 'to_type' => 'topic',
276
+ 'to_fieldname' => '_bbp_last_active_time',
277
+ 'callback_method' => 'callback_datetime'
278
+ );
279
+
280
+ // Topic status (Open or Closed, Kunena v3.x 0=open & 1=closed)
281
+ $this->field_map[] = array(
282
+ 'from_tablename' => 'kunena_topics',
283
+ 'from_fieldname' => 'locked',
284
+ 'to_type' => 'topic',
285
+ 'to_fieldname' => 'post_status',
286
+ 'callback_method' => 'callback_topic_status'
287
+ );
288
+
289
+ /** Tags Section ******************************************************/
290
+
291
+ /**
292
+ * Kunena v3.x Forums do not support topic tags out of the box
293
+ */
294
+
295
+ /** Reply Section ******************************************************/
296
+
297
+ // Reply id (Stored in postmeta)
298
+ $this->field_map[] = array(
299
+ 'from_tablename' => 'kunena_messages',
300
+ 'from_fieldname' => 'id',
301
+ 'to_type' => 'reply',
302
+ 'to_fieldname' => '_bbp_post_id'
303
+ );
304
+
305
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
306
+ $this->field_map[] = array(
307
+ 'from_tablename' => 'kunena_messages',
308
+ 'from_fieldname' => 'catid',
309
+ 'to_type' => 'reply',
310
+ 'to_fieldname' => '_bbp_forum_id',
311
+ 'callback_method' => 'callback_topicid_to_forumid'
312
+ );
313
+
314
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
315
+ $this->field_map[] = array(
316
+ 'from_tablename' => 'kunena_messages',
317
+ 'from_fieldname' => 'thread',
318
+ 'to_type' => 'reply',
319
+ 'to_fieldname' => '_bbp_topic_id',
320
+ 'callback_method' => 'callback_topicid'
321
+ );
322
+
323
+ // Reply author ip (Stored in postmeta)
324
+ $this->field_map[] = array(
325
+ 'from_tablename' => 'kunena_messages',
326
+ 'from_fieldname' => 'ip',
327
+ 'to_type' => 'reply',
328
+ 'to_fieldname' => '_bbp_author_ip'
329
+ );
330
+
331
+ // Reply author.
332
+ $this->field_map[] = array(
333
+ 'from_tablename' => 'kunena_messages',
334
+ 'from_fieldname' => 'userid',
335
+ 'to_type' => 'reply',
336
+ 'to_fieldname' => 'post_author',
337
+ 'callback_method' => 'callback_userid'
338
+ );
339
+
340
+ // Reply title.
341
+ $this->field_map[] = array(
342
+ 'from_tablename' => 'kunena_messages',
343
+ 'from_fieldname' => 'subject',
344
+ 'to_type' => 'reply',
345
+ 'to_fieldname' => 'post_title',
346
+ 'callback_method' => 'callback_reply_title'
347
+ );
348
+
349
+ // Reply slug (Clean name to avoid conflicts)
350
+ $this->field_map[] = array(
351
+ 'from_tablename' => 'kunena_messages',
352
+ 'from_fieldname' => 'subject',
353
+ 'to_type' => 'reply',
354
+ 'to_fieldname' => 'post_name',
355
+ 'callback_method' => 'callback_slug'
356
+ );
357
+
358
+ // Reply content.
359
+ // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
360
+ $this->field_map[] = array(
361
+ 'from_tablename' => 'kunena_messages_text',
362
+ 'from_fieldname' => 'message',
363
+ 'join_tablename' => 'kunena_messages',
364
+ 'join_type' => 'LEFT',
365
+ 'join_expression' => 'ON kunena_messages_text.mesid = kunena_messages.id LEFT JOIN jos_kunena_topics AS kunena_topics ON kunena_messages.thread = kunena_topics.id WHERE kunena_messages.parent != 0',
366
+ 'to_type' => 'reply',
367
+ 'to_fieldname' => 'post_content',
368
+ 'callback_method' => 'callback_html'
369
+ );
370
+
371
+ // Reply parent topic id (If no parent, then 0)
372
+ $this->field_map[] = array(
373
+ 'from_tablename' => 'kunena_messages',
374
+ 'from_fieldname' => 'thread',
375
+ 'to_type' => 'reply',
376
+ 'to_fieldname' => 'post_parent',
377
+ 'callback_method' => 'callback_topicid'
378
+ );
379
+
380
+ // Reply dates.
381
+ $this->field_map[] = array(
382
+ 'from_tablename' => 'kunena_messages',
383
+ 'from_fieldname' => 'time',
384
+ 'to_type' => 'reply',
385
+ 'to_fieldname' => 'post_date',
386
+ 'callback_method' => 'callback_datetime'
387
+ );
388
+ $this->field_map[] = array(
389
+ 'from_tablename' => 'kunena_messages',
390
+ 'from_fieldname' => 'time',
391
+ 'to_type' => 'reply',
392
+ 'to_fieldname' => 'post_date_gmt',
393
+ 'callback_method' => 'callback_datetime'
394
+ );
395
+ $this->field_map[] = array(
396
+ 'from_tablename' => 'kunena_messages',
397
+ 'from_fieldname' => 'time',
398
+ 'to_type' => 'reply',
399
+ 'to_fieldname' => 'post_modified',
400
+ 'callback_method' => 'callback_datetime'
401
+ );
402
+ $this->field_map[] = array(
403
+ 'from_tablename' => 'kunena_messages',
404
+ 'from_fieldname' => 'time',
405
+ 'to_type' => 'reply',
406
+ 'to_fieldname' => 'post_modified_gmt',
407
+ 'callback_method' => 'callback_datetime'
408
+ );
409
+
410
+ /** User Section ******************************************************/
411
+
412
+ //Note: We are importing the Joomla User details and the Kunena v3.x user profile details.
413
+
414
+ // Store old User id (Stored in usermeta)
415
+ $this->field_map[] = array(
416
+ 'from_tablename' => 'users',
417
+ 'from_fieldname' => 'id',
418
+ 'to_type' => 'user',
419
+ 'to_fieldname' => '_bbp_user_id'
420
+ );
421
+
422
+ // Store old User password (Stored in usermeta serialized with salt)
423
+ $this->field_map[] = array(
424
+ 'from_tablename' => 'users',
425
+ 'from_fieldname' => 'password',
426
+ 'to_type' => 'user',
427
+ 'to_fieldname' => '_bbp_password',
428
+ 'callback_method' => 'callback_savepass'
429
+ );
430
+
431
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
432
+ // $this->field_map[] = array(
433
+ // 'from_tablename' => 'users',
434
+ // 'from_fieldname' => 'salt',
435
+ // 'to_type' => 'user',
436
+ // 'to_fieldname' => ''
437
+ // );
438
+
439
+ // User password verify class (Stored in usermeta for verifying password)
440
+ $this->field_map[] = array(
441
+ 'to_type' => 'users',
442
+ 'to_fieldname' => '_bbp_class',
443
+ 'default' => 'Kunena3'
444
+ );
445
+
446
+ // User name.
447
+ $this->field_map[] = array(
448
+ 'from_tablename' => 'users',
449
+ 'from_fieldname' => 'username',
450
+ 'to_type' => 'user',
451
+ 'to_fieldname' => 'user_login'
452
+ );
453
+
454
+ // User nice name.
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'users',
457
+ 'from_fieldname' => 'username',
458
+ 'to_type' => 'user',
459
+ 'to_fieldname' => 'user_nicename'
460
+ );
461
+
462
+ // User email.
463
+ $this->field_map[] = array(
464
+ 'from_tablename' => 'users',
465
+ 'from_fieldname' => 'email',
466
+ 'to_type' => 'user',
467
+ 'to_fieldname' => 'user_email'
468
+ );
469
+
470
+ // User homepage.
471
+ $this->field_map[] = array(
472
+ 'from_tablename' => 'kunena_users',
473
+ 'from_fieldname' => 'websiteurl',
474
+ 'join_tablename' => 'users',
475
+ 'join_type' => 'LEFT',
476
+ 'join_expression' => 'ON kunena_users.userid = users.id',
477
+ 'to_type' => 'user',
478
+ 'to_fieldname' => 'user_url'
479
+ );
480
+
481
+ // User registered.
482
+ $this->field_map[] = array(
483
+ 'from_tablename' => 'users',
484
+ 'from_fieldname' => 'registerDate',
485
+ 'to_type' => 'user',
486
+ 'to_fieldname' => 'user_registered',
487
+ 'callback_method' => 'callback_datetime'
488
+ );
489
+
490
+ // User display name.
491
+ $this->field_map[] = array(
492
+ 'from_tablename' => 'users',
493
+ 'from_fieldname' => 'name',
494
+ 'to_type' => 'user',
495
+ 'to_fieldname' => 'display_name'
496
+ );
497
+
498
+ // User AIM (Stored in usermeta)
499
+ $this->field_map[] = array(
500
+ 'from_tablename' => 'kunena_users',
501
+ 'from_fieldname' => 'aim',
502
+ 'join_tablename' => 'users',
503
+ 'join_type' => 'LEFT',
504
+ 'join_expression' => 'ON kunena_users.userid = users.id',
505
+ 'to_type' => 'user',
506
+ 'to_fieldname' => 'aim'
507
+ );
508
+
509
+ // User Yahoo (Stored in usermeta)
510
+ $this->field_map[] = array(
511
+ 'from_tablename' => 'kunena_users',
512
+ 'from_fieldname' => 'yim',
513
+ 'join_tablename' => 'users',
514
+ 'join_type' => 'LEFT',
515
+ 'join_expression' => 'ON kunena_users.userid = users.id',
516
+ 'to_type' => 'user',
517
+ 'to_fieldname' => 'yim'
518
+ );
519
+
520
+ // Store Google Tak (Stored in usermeta)
521
+ $this->field_map[] = array(
522
+ 'from_tablename' => 'kunena_users',
523
+ 'from_fieldname' => 'gtalk',
524
+ 'join_tablename' => 'users',
525
+ 'join_type' => 'LEFT',
526
+ 'join_expression' => 'ON kunena_users.userid = users.id',
527
+ 'to_type' => 'user',
528
+ 'to_fieldname' => 'jabber'
529
+ );
530
+
531
+ // Store ICQ (Stored in usermeta)
532
+ $this->field_map[] = array(
533
+ 'from_tablename' => 'kunena_users',
534
+ 'from_fieldname' => 'icq',
535
+ 'join_tablename' => 'users',
536
+ 'join_type' => 'LEFT',
537
+ 'join_expression' => 'ON kunena_users.userid = users.id',
538
+ 'to_type' => 'user',
539
+ 'to_fieldname' => '_bbp_kunena3_user_icq'
540
+ );
541
+
542
+ // Store MSN (Stored in usermeta)
543
+ $this->field_map[] = array(
544
+ 'from_tablename' => 'kunena_users',
545
+ 'from_fieldname' => 'msn',
546
+ 'join_tablename' => 'users',
547
+ 'join_type' => 'LEFT',
548
+ 'join_expression' => 'ON kunena_users.userid = users.id',
549
+ 'to_type' => 'user',
550
+ 'to_fieldname' => '_bbp_kunena3_user_msn'
551
+ );
552
+
553
+ // Store Skype (Stored in usermeta)
554
+ $this->field_map[] = array(
555
+ 'from_tablename' => 'kunena_users',
556
+ 'from_fieldname' => 'skype',
557
+ 'join_tablename' => 'users',
558
+ 'join_type' => 'LEFT',
559
+ 'join_expression' => 'ON kunena_users.userid = users.id',
560
+ 'to_type' => 'user',
561
+ 'to_fieldname' => '_bbp_kunena3_user_skype'
562
+ );
563
+
564
+ // Store Twitter (Stored in usermeta)
565
+ $this->field_map[] = array(
566
+ 'from_tablename' => 'kunena_users',
567
+ 'from_fieldname' => 'twitter',
568
+ 'join_tablename' => 'users',
569
+ 'join_type' => 'LEFT',
570
+ 'join_expression' => 'ON kunena_users.userid = users.id',
571
+ 'to_type' => 'user',
572
+ 'to_fieldname' => '_bbp_kunena3_user_twitter'
573
+ );
574
+
575
+ // Store Facebook (Stored in usermeta)
576
+ $this->field_map[] = array(
577
+ 'from_tablename' => 'kunena_users',
578
+ 'from_fieldname' => 'facebook',
579
+ 'join_tablename' => 'users',
580
+ 'join_type' => 'LEFT',
581
+ 'join_expression' => 'ON kunena_users.userid = users.id',
582
+ 'to_type' => 'user',
583
+ 'to_fieldname' => '_bbp_kunena3_user_facebook'
584
+ );
585
+
586
+ // Store myspace (Stored in usermeta)
587
+ $this->field_map[] = array(
588
+ 'from_tablename' => 'kunena_users',
589
+ 'from_fieldname' => 'myspace',
590
+ 'join_tablename' => 'users',
591
+ 'join_type' => 'LEFT',
592
+ 'join_expression' => 'ON kunena_users.userid = users.id',
593
+ 'to_type' => 'user',
594
+ 'to_fieldname' => '_bbp_kunena3_user_myspace'
595
+ );
596
+
597
+ // Store linkedin (Stored in usermeta)
598
+ $this->field_map[] = array(
599
+ 'from_tablename' => 'kunena_users',
600
+ 'from_fieldname' => 'linkedin',
601
+ 'join_tablename' => 'users',
602
+ 'join_type' => 'LEFT',
603
+ 'join_expression' => 'ON kunena_users.userid = users.id',
604
+ 'to_type' => 'user',
605
+ 'to_fieldname' => '_bbp_kunena3_user_linkedin'
606
+ );
607
+
608
+ // Store delicious (Stored in usermeta)
609
+ $this->field_map[] = array(
610
+ 'from_tablename' => 'kunena_users',
611
+ 'from_fieldname' => 'delicious',
612
+ 'join_tablename' => 'users',
613
+ 'join_type' => 'LEFT',
614
+ 'join_expression' => 'ON kunena_users.userid = users.id',
615
+ 'to_type' => 'user',
616
+ 'to_fieldname' => '_bbp_kunena3_user_delicious'
617
+ );
618
+
619
+ // Store friendfeed (Stored in usermeta)
620
+ $this->field_map[] = array(
621
+ 'from_tablename' => 'kunena_users',
622
+ 'from_fieldname' => 'friendfeed',
623
+ 'join_tablename' => 'users',
624
+ 'join_type' => 'LEFT',
625
+ 'join_expression' => 'ON kunena_users.userid = users.id',
626
+ 'to_type' => 'user',
627
+ 'to_fieldname' => '_bbp_kunena3_user_friendfeed'
628
+ );
629
+
630
+ // Store digg (Stored in usermeta)
631
+ $this->field_map[] = array(
632
+ 'from_tablename' => 'kunena_users',
633
+ 'from_fieldname' => 'digg',
634
+ 'join_tablename' => 'users',
635
+ 'join_type' => 'LEFT',
636
+ 'join_expression' => 'ON kunena_users.userid = users.id',
637
+ 'to_type' => 'user',
638
+ 'to_fieldname' => '_bbp_kunena3_user_digg'
639
+ );
640
+
641
+ // Store blogspot (Stored in usermeta)
642
+ $this->field_map[] = array(
643
+ 'from_tablename' => 'kunena_users',
644
+ 'from_fieldname' => 'blogspot',
645
+ 'join_tablename' => 'users',
646
+ 'join_type' => 'LEFT',
647
+ 'join_expression' => 'ON kunena_users.userid = users.id',
648
+ 'to_type' => 'user',
649
+ 'to_fieldname' => '_bbp_kunena3_user_blogspot'
650
+ );
651
+
652
+ // Store flickr (Stored in usermeta)
653
+ $this->field_map[] = array(
654
+ 'from_tablename' => 'kunena_users',
655
+ 'from_fieldname' => 'flickr',
656
+ 'join_tablename' => 'users',
657
+ 'join_type' => 'LEFT',
658
+ 'join_expression' => 'ON kunena_users.userid = users.id',
659
+ 'to_type' => 'user',
660
+ 'to_fieldname' => '_bbp_kunena3_user_flickr'
661
+ );
662
+
663
+ // Store bebo (Stored in usermeta)
664
+ $this->field_map[] = array(
665
+ 'from_tablename' => 'kunena_users',
666
+ 'from_fieldname' => 'bebo',
667
+ 'join_tablename' => 'users',
668
+ 'join_type' => 'LEFT',
669
+ 'join_expression' => 'ON kunena_users.userid = users.id',
670
+ 'to_type' => 'user',
671
+ 'to_fieldname' => '_bbp_kunena3_user_bebo'
672
+ );
673
+
674
+ // Store websitename (Stored in usermeta)
675
+ $this->field_map[] = array(
676
+ 'from_tablename' => 'kunena_users',
677
+ 'from_fieldname' => 'websitename',
678
+ 'join_tablename' => 'users',
679
+ 'join_type' => 'LEFT',
680
+ 'join_expression' => 'ON kunena_users.userid = users.id',
681
+ 'to_type' => 'user',
682
+ 'to_fieldname' => '_bbp_kunena3_user_websitename'
683
+ );
684
+
685
+ // Store location (Stored in usermeta)
686
+ $this->field_map[] = array(
687
+ 'from_tablename' => 'kunena_users',
688
+ 'from_fieldname' => 'location',
689
+ 'join_tablename' => 'users',
690
+ 'join_type' => 'LEFT',
691
+ 'join_expression' => 'ON kunena_users.userid = users.id',
692
+ 'to_type' => 'user',
693
+ 'to_fieldname' => '_bbp_kunena3_user_location'
694
+ );
695
+
696
+ // Store Signature (Stored in usermeta)
697
+ $this->field_map[] = array(
698
+ 'from_tablename' => 'kunena_users',
699
+ 'from_fieldname' => 'signature',
700
+ 'join_tablename' => 'users',
701
+ 'join_type' => 'LEFT',
702
+ 'join_expression' => 'ON kunena_users.userid = users.id',
703
+ 'to_type' => 'user',
704
+ 'to_fieldname' => '_bbp_kunena3_user_sig',
705
+ 'callback_method' => 'callback_html'
706
+ );
707
+ }
708
+
709
+ /**
710
+ * This method allows us to indicates what is or is not converted for each
711
+ * converter.
712
+ */
713
+ public function info()
714
+ {
715
+ return '';
716
+ }
717
+
718
+ /**
719
+ * This method is to save the salt and password together. That
720
+ * way when we authenticate it we can get it out of the database
721
+ * as one value. Array values are auto sanitized by WordPress.
722
+ */
723
+ public function callback_savepass( $field, $row )
724
+ {
725
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
726
+ return $pass_array;
727
+ }
728
+
729
+ /**
730
+ * This method is to take the pass out of the database and compare
731
+ * to a pass the user has typed in.
732
+ */
733
+ public function authenticate_pass( $password, $serialized_pass )
734
+ {
735
+ $pass_array = unserialize( $serialized_pass );
736
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
737
+ }
738
+
739
+ /**
740
+ * Translate the forum type from Kunena v3.x numeric's to WordPress's strings.
741
+ *
742
+ * @param int $status Kunena v3.x numeric forum type
743
+ * @return string WordPress safe
744
+ */
745
+ public function callback_forum_type( $status = 0 ) {
746
+ if ( $status == 0 ) {
747
+ $status = 'category';
748
+ } else {
749
+ $status = 'forum';
750
+ }
751
+ return $status;
752
+ }
753
+
754
+ /**
755
+ * Translate the forum status from Kunena v3.x numeric's to WordPress's strings.
756
+ *
757
+ * @param int $status Kunena v3.x numeric forum status
758
+ * @return string WordPress safe
759
+ */
760
+ public function callback_forum_status( $status = 0 ) {
761
+ switch ( $status ) {
762
+ case 1 :
763
+ $status = 'closed';
764
+ break;
765
+
766
+ case 0 :
767
+ default :
768
+ $status = 'open';
769
+ break;
770
+ }
771
+ return $status;
772
+ }
773
+
774
+ /**
775
+ * Translate the post status from Kunena v3.x numeric's to WordPress's strings.
776
+ *
777
+ * @param int $status Kunena v3.x numeric topic status
778
+ * @return string WordPress safe
779
+ */
780
+ public function callback_topic_status( $status = 0 ) {
781
+ switch ( $status ) {
782
+ case 1 :
783
+ $status = 'closed';
784
+ break;
785
+
786
+ case 0 :
787
+ default :
788
+ $status = 'publish';
789
+ break;
790
+ }
791
+ return $status;
792
+ }
793
+
794
+ /**
795
+ * Verify the topic/reply count.
796
+ *
797
+ * @param int $count Kunena v3.x topic/reply counts
798
+ * @return string WordPress safe
799
+ */
800
+ public function callback_topic_reply_count( $count = 1 ) {
801
+ $count = absint( (int) $count - 1 );
802
+ return $count;
803
+ }
804
+
805
+ /**
806
+ * Set the reply title
807
+ *
808
+ * @param string $title Kunena v3.x topic title of this reply
809
+ * @return string Prefixed topic title, or empty string
810
+ */
811
+ public function callback_reply_title( $title = '' ) {
812
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
813
+ return $title;
814
+ }
815
+ }
includes/admin/converters/Mingle.php CHANGED
@@ -131,7 +131,7 @@ class Mingle extends BBP_Converter_Base {
131
  'from_fieldname' => 'text',
132
  'join_tablename' => 'forum_threads',
133
  'join_type' => 'INNER',
134
- 'join_expression' => 'USING (subject)',
135
  'to_type' => 'topic',
136
  'to_fieldname' => 'post_content',
137
  'callback_method' => 'callback_html'
@@ -162,6 +162,15 @@ class Mingle extends BBP_Converter_Base {
162
  'callback_method' => 'callback_forumid'
163
  );
164
 
 
 
 
 
 
 
 
 
 
165
  // Topic dates.
166
  $this->field_map[] = array(
167
  'from_tablename' => 'forum_threads',
@@ -244,7 +253,7 @@ class Mingle extends BBP_Converter_Base {
244
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
245
  $this->field_map[] = array(
246
  'from_tablename' => 'forum_posts',
247
- 'from_fieldname' => 'id',
248
  'to_type' => 'reply',
249
  'to_fieldname' => '_bbp_topic_id',
250
  'callback_method' => 'callback_topicid'
@@ -421,7 +430,7 @@ class Mingle extends BBP_Converter_Base {
421
  }
422
 
423
  /**
424
- * Translate the post status from Mingle numeric's to WordPress's strings.
425
  *
426
  * @param int $status Mingle v1.x numeric topic status
427
  * @return string WordPress safe
@@ -440,6 +449,26 @@ class Mingle extends BBP_Converter_Base {
440
  return $status;
441
  }
442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  /**
444
  * This callback processes any custom BBCodes with parser.php
445
  */
131
  'from_fieldname' => 'text',
132
  'join_tablename' => 'forum_threads',
133
  'join_type' => 'INNER',
134
+ 'join_expression' => 'ON forum_posts.parent_id = forum_threads.id GROUP BY forum_threads.id',
135
  'to_type' => 'topic',
136
  'to_fieldname' => 'post_content',
137
  'callback_method' => 'callback_html'
162
  'callback_method' => 'callback_forumid'
163
  );
164
 
165
+ // Sticky status (Stored in postmeta))
166
+ $this->field_map[] = array(
167
+ 'from_tablename' => 'forum_threads',
168
+ 'from_fieldname' => 'status',
169
+ 'to_type' => 'topic',
170
+ 'to_fieldname' => '_bbp_old_sticky_status',
171
+ 'callback_method' => 'callback_sticky_status'
172
+ );
173
+
174
  // Topic dates.
175
  $this->field_map[] = array(
176
  'from_tablename' => 'forum_threads',
253
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
254
  $this->field_map[] = array(
255
  'from_tablename' => 'forum_posts',
256
+ 'from_fieldname' => 'parent_id',
257
  'to_type' => 'reply',
258
  'to_fieldname' => '_bbp_topic_id',
259
  'callback_method' => 'callback_topicid'
430
  }
431
 
432
  /**
433
+ * Translate the topic status from Mingle numeric's to WordPress's strings.
434
  *
435
  * @param int $status Mingle v1.x numeric topic status
436
  * @return string WordPress safe
449
  return $status;
450
  }
451
 
452
+ /**
453
+ * Translate the topic sticky status type from Mingle numeric's to WordPress's strings.
454
+ *
455
+ * @param int $status Mingle numeric forum type
456
+ * @return string WordPress safe
457
+ */
458
+ public function callback_sticky_status( $status = 0 ) {
459
+ switch ( $status ) {
460
+ case 'sticky' :
461
+ $status = 'sticky'; // Mingle Sticky 'status = sticky'
462
+ break;
463
+
464
+ case 'open' :
465
+ default :
466
+ $status = 'normal'; // Mingle Normal Topic 'status = open'
467
+ break;
468
+ }
469
+ return $status;
470
+ }
471
+
472
  /**
473
  * This callback processes any custom BBCodes with parser.php
474
  */
includes/admin/converters/MyBB.php ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of MyBB Forum converter.
5
+ *
6
+ * @since bbPress (r5140)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/mybb
8
+ */
9
+ class MyBB extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses MyBB::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' => 'forums',
31
+ 'from_fieldname' => 'fid',
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' => 'forums',
39
+ 'from_fieldname' => 'pid',
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' => 'forums',
47
+ 'from_fieldname' => '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' => 'forums',
55
+ 'from_fieldname' => 'posts',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_reply_count'
58
+ );
59
+
60
+ // Forum title.
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'name',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => 'post_title'
66
+ );
67
+
68
+ // Forum slug (Clean name to avoid conflicts)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'name',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => 'post_name',
74
+ 'callback_method' => 'callback_slug'
75
+ );
76
+
77
+ // Forum description.
78
+ $this->field_map[] = array(
79
+ 'from_tablename' => 'forums',
80
+ 'from_fieldname' => 'description',
81
+ 'to_type' => 'forum',
82
+ 'to_fieldname' => 'post_content',
83
+ 'callback_method' => 'callback_null'
84
+ );
85
+
86
+ // Forum display order (Starts from 1)
87
+ $this->field_map[] = array(
88
+ 'from_tablename' => 'forums',
89
+ 'from_fieldname' => 'disporder',
90
+ 'to_type' => 'forum',
91
+ 'to_fieldname' => 'menu_order'
92
+ );
93
+
94
+ // Forum dates.
95
+ $this->field_map[] = array(
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_date',
98
+ 'default' => date('Y-m-d H:i:s')
99
+ );
100
+ $this->field_map[] = array(
101
+ 'to_type' => 'forum',
102
+ 'to_fieldname' => 'post_date_gmt',
103
+ 'default' => date('Y-m-d H:i:s')
104
+ );
105
+ $this->field_map[] = array(
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'post_modified',
108
+ 'default' => date('Y-m-d H:i:s')
109
+ );
110
+ $this->field_map[] = array(
111
+ 'to_type' => 'forum',
112
+ 'to_fieldname' => 'post_modified_gmt',
113
+ 'default' => date('Y-m-d H:i:s')
114
+ );
115
+
116
+ /** Topic Section *****************************************************/
117
+
118
+ // Topic id (Stored in postmeta)
119
+ $this->field_map[] = array(
120
+ 'from_tablename' => 'threads',
121
+ 'from_fieldname' => 'tid',
122
+ 'to_type' => 'topic',
123
+ 'to_fieldname' => '_bbp_topic_id'
124
+ );
125
+
126
+ // Topic reply count (Stored in postmeta)
127
+ $this->field_map[] = array(
128
+ 'from_tablename' => 'threads',
129
+ 'from_fieldname' => 'replies',
130
+ 'to_type' => 'topic',
131
+ 'to_fieldname' => '_bbp_reply_count',
132
+ 'callback_method' => 'callback_topic_reply_count'
133
+ );
134
+
135
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
136
+ $this->field_map[] = array(
137
+ 'from_tablename' => 'threads',
138
+ 'from_fieldname' => 'replies',
139
+ 'to_type' => 'topic',
140
+ 'to_fieldname' => '_bbp_total_reply_count',
141
+ 'callback_method' => 'callback_topic_reply_count'
142
+ );
143
+
144
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
145
+ $this->field_map[] = array(
146
+ 'from_tablename' => 'threads',
147
+ 'from_fieldname' => 'fid',
148
+ 'to_type' => 'topic',
149
+ 'to_fieldname' => '_bbp_forum_id',
150
+ 'callback_method' => 'callback_forumid'
151
+ );
152
+
153
+ // Topic author.
154
+ $this->field_map[] = array(
155
+ 'from_tablename' => 'threads',
156
+ 'from_fieldname' => 'uid',
157
+ 'to_type' => 'topic',
158
+ 'to_fieldname' => 'post_author',
159
+ 'callback_method' => 'callback_userid'
160
+ );
161
+
162
+ // Topic Author ip (Stored in postmeta)
163
+ $this->field_map[] = array(
164
+ 'from_tablename' => 'posts',
165
+ 'from_fieldname' => 'ipaddress',
166
+ 'join_tablename' => 'threads',
167
+ 'join_type' => 'INNER',
168
+ 'join_expression' => 'USING (tid) WHERE replyto = 0',
169
+ 'to_type' => 'topic',
170
+ 'to_fieldname' => '_bbp_author_ip'
171
+ );
172
+
173
+ // Topic content.
174
+ // Note: We join the 'posts' table because 'threads' table does not have content.
175
+ $this->field_map[] = array(
176
+ 'from_tablename' => 'posts',
177
+ 'from_fieldname' => 'message',
178
+ 'join_tablename' => 'threads',
179
+ 'join_type' => 'INNER',
180
+ 'join_expression' => 'USING (tid) WHERE replyto = 0',
181
+ 'to_type' => 'topic',
182
+ 'to_fieldname' => 'post_content',
183
+ 'callback_method' => 'callback_html'
184
+ );
185
+
186
+ // Topic title.
187
+ $this->field_map[] = array(
188
+ 'from_tablename' => 'threads',
189
+ 'from_fieldname' => 'subject',
190
+ 'to_type' => 'topic',
191
+ 'to_fieldname' => 'post_title'
192
+ );
193
+
194
+ // Topic slug (Clean name to avoid conflicts)
195
+ $this->field_map[] = array(
196
+ 'from_tablename' => 'threads',
197
+ 'from_fieldname' => 'subject',
198
+ 'to_type' => 'topic',
199
+ 'to_fieldname' => 'post_name',
200
+ 'callback_method' => 'callback_slug'
201
+ );
202
+
203
+ // Topic parent forum id (If no parent, then 0)
204
+ $this->field_map[] = array(
205
+ 'from_tablename' => 'threads',
206
+ 'from_fieldname' => 'fid',
207
+ 'to_type' => 'topic',
208
+ 'to_fieldname' => 'post_parent',
209
+ 'callback_method' => 'callback_forumid'
210
+ );
211
+
212
+ // Sticky status (Stored in postmeta))
213
+ $this->field_map[] = array(
214
+ 'from_tablename' => 'threads',
215
+ 'from_fieldname' => 'sticky',
216
+ 'to_type' => 'topic',
217
+ 'to_fieldname' => '_bbp_old_sticky_status',
218
+ 'callback_method' => 'callback_sticky_status'
219
+ );
220
+
221
+ // Topic dates.
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'threads',
224
+ 'from_fieldname' => 'dateline',
225
+ 'to_type' => 'topic',
226
+ 'to_fieldname' => 'post_date',
227
+ 'callback_method' => 'callback_datetime'
228
+ );
229
+ $this->field_map[] = array(
230
+ 'from_tablename' => 'threads',
231
+ 'from_fieldname' => 'dateline',
232
+ 'to_type' => 'topic',
233
+ 'to_fieldname' => 'post_date_gmt',
234
+ 'callback_method' => 'callback_datetime'
235
+ );
236
+ $this->field_map[] = array(
237
+ 'from_tablename' => 'threads',
238
+ 'from_fieldname' => 'lastpost',
239
+ 'to_type' => 'topic',
240
+ 'to_fieldname' => 'post_modified',
241
+ 'callback_method' => 'callback_datetime'
242
+ );
243
+ $this->field_map[] = array(
244
+ 'from_tablename' => 'threads',
245
+ 'from_fieldname' => 'lastpost',
246
+ 'to_type' => 'topic',
247
+ 'to_fieldname' => 'post_modified_gmt',
248
+ 'callback_method' => 'callback_datetime'
249
+ );
250
+ $this->field_map[] = array(
251
+ 'from_tablename' => 'threads',
252
+ 'from_fieldname' => 'lastpost',
253
+ 'to_type' => 'topic',
254
+ 'to_fieldname' => '_bbp_last_active_time',
255
+ 'callback_method' => 'callback_datetime'
256
+ );
257
+
258
+ // Topic status (Open or Closed, MyBB v1.6.10 open = null & closed = 1)
259
+ $this->field_map[] = array(
260
+ 'from_tablename' => 'threads',
261
+ 'from_fieldname' => 'closed',
262
+ 'to_type' => 'topic',
263
+ 'to_fieldname' => 'post_status',
264
+ 'callback_method' => 'callback_topic_status'
265
+ );
266
+
267
+ /** Tags Section ******************************************************/
268
+
269
+ /**
270
+ * MyBB v1.6.10 Forums do not support topic tags out of the box
271
+ */
272
+
273
+ /** Reply Section *****************************************************/
274
+
275
+ // Reply id (Stored in postmeta)
276
+ $this->field_map[] = array(
277
+ 'from_tablename' => 'posts',
278
+ 'from_fieldname' => 'pid',
279
+ 'from_expression' => 'WHERE replyto != 0',
280
+ 'to_type' => 'reply',
281
+ 'to_fieldname' => '_bbp_post_id'
282
+ );
283
+
284
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
285
+ $this->field_map[] = array(
286
+ 'from_tablename' => 'posts',
287
+ 'from_fieldname' => 'fid',
288
+ 'to_type' => 'reply',
289
+ 'to_fieldname' => '_bbp_forum_id',
290
+ 'callback_method' => 'callback_topicid_to_forumid'
291
+ );
292
+
293
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
294
+ $this->field_map[] = array(
295
+ 'from_tablename' => 'posts',
296
+ 'from_fieldname' => 'tid',
297
+ 'to_type' => 'reply',
298
+ 'to_fieldname' => '_bbp_topic_id',
299
+ 'callback_method' => 'callback_topicid'
300
+ );
301
+
302
+ // Reply author ip (Stored in postmeta)
303
+ $this->field_map[] = array(
304
+ 'from_tablename' => 'posts',
305
+ 'from_fieldname' => 'ipaddress',
306
+ 'to_type' => 'reply',
307
+ 'to_fieldname' => '_bbp_author_ip'
308
+ );
309
+
310
+ // Reply author.
311
+ $this->field_map[] = array(
312
+ 'from_tablename' => 'posts',
313
+ 'from_fieldname' => 'uid',
314
+ 'to_type' => 'reply',
315
+ 'to_fieldname' => 'post_author',
316
+ 'callback_method' => 'callback_userid'
317
+ );
318
+
319
+ // Reply title.
320
+ $this->field_map[] = array(
321
+ 'from_tablename' => 'posts',
322
+ 'from_fieldname' => 'subject',
323
+ 'to_type' => 'reply',
324
+ 'to_fieldname' => 'post_title'
325
+ );
326
+
327
+ // Reply slug (Clean name to avoid conflicts)
328
+ $this->field_map[] = array(
329
+ 'from_tablename' => 'posts',
330
+ 'from_fieldname' => 'subject',
331
+ 'to_type' => 'reply',
332
+ 'to_fieldname' => 'post_name',
333
+ 'callback_method' => 'callback_slug'
334
+ );
335
+
336
+ // Reply content.
337
+ $this->field_map[] = array(
338
+ 'from_tablename' => 'posts',
339
+ 'from_fieldname' => 'message',
340
+ 'to_type' => 'reply',
341
+ 'to_fieldname' => 'post_content',
342
+ 'callback_method' => 'callback_html'
343
+ );
344
+
345
+ // Reply parent topic id (If no parent, then 0)
346
+ $this->field_map[] = array(
347
+ 'from_tablename' => 'posts',
348
+ 'from_fieldname' => 'tid',
349
+ 'to_type' => 'reply',
350
+ 'to_fieldname' => 'post_parent',
351
+ 'callback_method' => 'callback_topicid'
352
+ );
353
+
354
+ // Reply dates.
355
+ $this->field_map[] = array(
356
+ 'from_tablename' => 'posts',
357
+ 'from_fieldname' => 'dateline',
358
+ 'to_type' => 'reply',
359
+ 'to_fieldname' => 'post_date',
360
+ 'callback_method' => 'callback_datetime'
361
+ );
362
+ $this->field_map[] = array(
363
+ 'from_tablename' => 'posts',
364
+ 'from_fieldname' => 'dateline',
365
+ 'to_type' => 'reply',
366
+ 'to_fieldname' => 'post_date_gmt',
367
+ 'callback_method' => 'callback_datetime'
368
+ );
369
+ $this->field_map[] = array(
370
+ 'from_tablename' => 'posts',
371
+ 'from_fieldname' => 'edittime',
372
+ 'to_type' => 'reply',
373
+ 'to_fieldname' => 'post_modified',
374
+ 'callback_method' => 'callback_datetime'
375
+ );
376
+ $this->field_map[] = array(
377
+ 'from_tablename' => 'posts',
378
+ 'from_fieldname' => 'edittime',
379
+ 'to_type' => 'reply',
380
+ 'to_fieldname' => 'post_modified_gmt',
381
+ 'callback_method' => 'callback_datetime'
382
+ );
383
+
384
+ /** User Section ******************************************************/
385
+
386
+ // Store old User id (Stored in usermeta)
387
+ $this->field_map[] = array(
388
+ 'from_tablename' => 'users',
389
+ 'from_fieldname' => 'uid',
390
+ 'to_type' => 'user',
391
+ 'to_fieldname' => '_bbp_user_id'
392
+ );
393
+
394
+ // Store old User password (Stored in usermeta serialized with salt)
395
+ $this->field_map[] = array(
396
+ 'from_tablename' => 'users',
397
+ 'from_fieldname' => 'password',
398
+ 'to_type' => 'user',
399
+ 'to_fieldname' => '_bbp_password',
400
+ 'callback_method' => 'callback_savepass'
401
+ );
402
+
403
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
404
+ $this->field_map[] = array(
405
+ 'from_tablename' => 'users',
406
+ 'from_fieldname' => 'salt',
407
+ 'to_type' => 'user',
408
+ 'to_fieldname' => ''
409
+ );
410
+
411
+ // User password verify class (Stored in usermeta for verifying password)
412
+ $this->field_map[] = array(
413
+ 'to_type' => 'users',
414
+ 'to_fieldname' => '_bbp_class',
415
+ 'default' => 'MyBB'
416
+ );
417
+
418
+ // User name.
419
+ $this->field_map[] = array(
420
+ 'from_tablename' => 'users',
421
+ 'from_fieldname' => 'username',
422
+ 'to_type' => 'user',
423
+ 'to_fieldname' => 'user_login'
424
+ );
425
+
426
+ // User nice name.
427
+ $this->field_map[] = array(
428
+ 'from_tablename' => 'users',
429
+ 'from_fieldname' => 'username',
430
+ 'to_type' => 'user',
431
+ 'to_fieldname' => 'user_nicename'
432
+ );
433
+
434
+ // User email.
435
+ $this->field_map[] = array(
436
+ 'from_tablename' => 'users',
437
+ 'from_fieldname' => 'email',
438
+ 'to_type' => 'user',
439
+ 'to_fieldname' => 'user_email'
440
+ );
441
+
442
+ // User homepage.
443
+ $this->field_map[] = array(
444
+ 'from_tablename' => 'users',
445
+ 'from_fieldname' => 'website',
446
+ 'to_type' => 'user',
447
+ 'to_fieldname' => 'user_url'
448
+ );
449
+
450
+ // User registered.
451
+ $this->field_map[] = array(
452
+ 'from_tablename' => 'users',
453
+ 'from_fieldname' => 'regdate',
454
+ 'to_type' => 'user',
455
+ 'to_fieldname' => 'user_registered',
456
+ 'callback_method' => 'callback_datetime'
457
+ );
458
+
459
+ // User display name.
460
+ $this->field_map[] = array(
461
+ 'from_tablename' => 'users',
462
+ 'from_fieldname' => 'usertitle',
463
+ 'to_type' => 'user',
464
+ 'to_fieldname' => 'display_name'
465
+ );
466
+
467
+ // User AIM (Stored in usermeta)
468
+ $this->field_map[] = array(
469
+ 'from_tablename' => 'users',
470
+ 'from_fieldname' => 'aim',
471
+ 'to_type' => 'user',
472
+ 'to_fieldname' => 'aim'
473
+ );
474
+
475
+ // User Yahoo (Stored in usermeta)
476
+ $this->field_map[] = array(
477
+ 'from_tablename' => 'users',
478
+ 'from_fieldname' => 'yahoo',
479
+ 'to_type' => 'user',
480
+ 'to_fieldname' => 'yim'
481
+ );
482
+
483
+ // Store ICQ (Stored in usermeta)
484
+ $this->field_map[] = array(
485
+ 'from_tablename' => 'users',
486
+ 'from_fieldname' => 'icq',
487
+ 'to_type' => 'user',
488
+ 'to_fieldname' => '_bbp_mybb_user_icq'
489
+ );
490
+
491
+ // Store MSN (Stored in usermeta)
492
+ $this->field_map[] = array(
493
+ 'from_tablename' => 'users',
494
+ 'from_fieldname' => 'msn',
495
+ 'to_type' => 'user',
496
+ 'to_fieldname' => '_bbp_mybb_user_msn'
497
+ );
498
+
499
+ // Store Signature (Stored in usermeta)
500
+ $this->field_map[] = array(
501
+ 'from_tablename' => 'users',
502
+ 'from_fieldname' => 'signature',
503
+ 'to_type' => 'user',
504
+ 'to_fieldname' => '_bbp_mybb_user_sig',
505
+ 'callback_method' => 'callback_html'
506
+ );
507
+
508
+ }
509
+
510
+ /**
511
+ * This method allows us to indicates what is or is not converted for each
512
+ * converter.
513
+ */
514
+ public function info()
515
+ {
516
+ return '';
517
+ }
518
+
519
+ /**
520
+ * This method is to save the salt and password together. That
521
+ * way when we authenticate it we can get it out of the database
522
+ * as one value. Array values are auto sanitized by WordPress.
523
+ */
524
+ public function callback_savepass( $field, $row )
525
+ {
526
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
527
+ return $pass_array;
528
+ }
529
+
530
+ /**
531
+ * This method is to take the pass out of the database and compare
532
+ * to a pass the user has typed in.
533
+ */
534
+ public function authenticate_pass( $password, $serialized_pass )
535
+ {
536
+ $pass_array = unserialize( $serialized_pass );
537
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
538
+ }
539
+
540
+ /**
541
+ * Translate the post status from MyBB v1.6.10 numeric's to WordPress's strings.
542
+ *
543
+ * @param int $status MyBB v1.6.10 numeric topic status
544
+ * @return string WordPress safe
545
+ */
546
+ public function callback_topic_status( $status = 0 ) {
547
+ switch ( $status ) {
548
+ case 1 :
549
+ $status = 'closed';
550
+ break;
551
+
552
+ case 0 :
553
+ default :
554
+ $status = 'publish';
555
+ break;
556
+ }
557
+ return $status;
558
+ }
559
+
560
+ /**
561
+ * Translate the topic sticky status type from MyBB v1.6.10 numeric's to WordPress's strings.
562
+ *
563
+ * @param int $status MyBB v1.6.10 numeric forum type
564
+ * @return string WordPress safe
565
+ */
566
+ public function callback_sticky_status( $status = 0 ) {
567
+ switch ( $status ) {
568
+ case 1 :
569
+ $status = 'sticky'; // MyBB Sticky 'topic_sticky = 1'
570
+ break;
571
+
572
+ case 0 :
573
+ default :
574
+ $status = 'normal'; // MyBB Normal Topic 'topic_sticky = 0'
575
+ break;
576
+ }
577
+ return $status;
578
+ }
579
+
580
+ /**
581
+ * Verify the topic/reply count.
582
+ *
583
+ * @param int $count MyBB v1.6.10 topic/reply counts
584
+ * @return string WordPress safe
585
+ */
586
+ public function callback_topic_reply_count( $count = 1 ) {
587
+ $count = absint( (int) $count - 1 );
588
+ return $count;
589
+ }
590
+
591
+ }
includes/admin/converters/PHPFox3.php ADDED
@@ -0,0 +1,652 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of PHPFox v3.x Forum converter.
5
+ *
6
+ * @since bbPress (r5146)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/phpfox
8
+ */
9
+ class PHPFox3 extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses PHPFox3::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' => 'parent_id',
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' => 'total_thread',
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' => 'total_post',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_reply_count'
58
+ );
59
+
60
+ // Forum total topic count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forum',
63
+ 'from_fieldname' => 'total_thread',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_total_topic_count'
66
+ );
67
+
68
+ // Forum total reply count (Stored in postmeta)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forum',
71
+ 'from_fieldname' => 'total_post',
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' => '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' => 'name_url',
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' => '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' => 'ordering',
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'menu_order'
108
+ );
109
+
110
+ // Forum type (Forum = 0 or Category = 1, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forum',
113
+ 'from_fieldname' => 'is_category',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => '_bbp_forum_type',
116
+ 'callback_method' => 'callback_forum_type'
117
+ );
118
+
119
+ // Forum status (0=Open or 1=Closed, Stored in postmeta)
120
+ $this->field_map[] = array(
121
+ 'from_tablename' => 'forum',
122
+ 'from_fieldname' => 'is_closed',
123
+ 'to_type' => 'forum',
124
+ 'to_fieldname' => '_bbp_status',
125
+ 'callback_method' => 'callback_forum_status'
126
+ );
127
+
128
+ // Forum dates.
129
+ $this->field_map[] = array(
130
+ 'to_type' => 'forum',
131
+ 'to_fieldname' => 'post_date',
132
+ 'default' => date('Y-m-d H:i:s')
133
+ );
134
+ $this->field_map[] = array(
135
+ 'to_type' => 'forum',
136
+ 'to_fieldname' => 'post_date_gmt',
137
+ 'default' => date('Y-m-d H:i:s')
138
+ );
139
+ $this->field_map[] = array(
140
+ 'to_type' => 'forum',
141
+ 'to_fieldname' => 'post_modified',
142
+ 'default' => date('Y-m-d H:i:s')
143
+ );
144
+ $this->field_map[] = array(
145
+ 'to_type' => 'forum',
146
+ 'to_fieldname' => 'post_modified_gmt',
147
+ 'default' => date('Y-m-d H:i:s')
148
+ );
149
+
150
+ /** Topic Section *****************************************************/
151
+
152
+ // Topic id (Stored in postmeta)
153
+ $this->field_map[] = array(
154
+ 'from_tablename' => 'forum_thread',
155
+ 'from_fieldname' => 'thread_id',
156
+ 'to_type' => 'topic',
157
+ 'to_fieldname' => '_bbp_topic_id'
158
+ );
159
+
160
+ // Topic reply count (Stored in postmeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'forum_thread',
163
+ 'from_fieldname' => 'total_post',
164
+ 'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_reply_count',
166
+ 'callback_method' => 'callback_topic_reply_count'
167
+ );
168
+
169
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'forum_thread',
172
+ 'from_fieldname' => 'total_post',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => '_bbp_total_reply_count',
175
+ 'callback_method' => 'callback_topic_reply_count'
176
+ );
177
+
178
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
179
+ $this->field_map[] = array(
180
+ 'from_tablename' => 'forum_thread',
181
+ 'from_fieldname' => 'forum_id',
182
+ 'to_type' => 'topic',
183
+ 'to_fieldname' => '_bbp_forum_id',
184
+ 'callback_method' => 'callback_forumid'
185
+ );
186
+
187
+ // Topic author.
188
+ $this->field_map[] = array(
189
+ 'from_tablename' => 'forum_thread',
190
+ 'from_fieldname' => 'user_id',
191
+ 'to_type' => 'topic',
192
+ 'to_fieldname' => 'post_author',
193
+ 'callback_method' => 'callback_userid'
194
+ );
195
+
196
+ // Topic content.
197
+ // Note: We join the 'forum_post_text' table because 'forum_thread' table does not include content.
198
+ // Note: We can use 'text' for original text OR 'text_parsed' for pre-parsed text output
199
+ $this->field_map[] = array(
200
+ 'from_tablename' => 'forum_post_text',
201
+ 'from_fieldname' => 'text_parsed',
202
+ 'join_tablename' => 'forum_thread',
203
+ 'join_type' => 'LEFT',
204
+ 'join_expression' => 'ON forum_thread.start_id = forum_post_text.post_id',
205
+ 'to_type' => 'topic',
206
+ 'to_fieldname' => 'post_content',
207
+ 'callback_method' => 'callback_html'
208
+ );
209
+
210
+ // Topic title.
211
+ $this->field_map[] = array(
212
+ 'from_tablename' => 'forum_thread',
213
+ 'from_fieldname' => 'title',
214
+ 'to_type' => 'topic',
215
+ 'to_fieldname' => 'post_title'
216
+ );
217
+
218
+ // Topic slug (Clean name to avoid conflicts)
219
+ $this->field_map[] = array(
220
+ 'from_tablename' => 'forum_thread',
221
+ 'from_fieldname' => 'title_url',
222
+ 'to_type' => 'topic',
223
+ 'to_fieldname' => 'post_name',
224
+ 'callback_method' => 'callback_slug'
225
+ );
226
+
227
+ // Topic parent forum id (If no parent, then 0)
228
+ $this->field_map[] = array(
229
+ 'from_tablename' => 'forum_thread',
230
+ 'from_fieldname' => 'forum_id',
231
+ 'to_type' => 'topic',
232
+ 'to_fieldname' => 'post_parent',
233
+ 'callback_method' => 'callback_forumid'
234
+ );
235
+
236
+ // Topic status (Open or Closed, PHPFox v3.5.x 0=open & 1=closed)
237
+ $this->field_map[] = array(
238
+ 'from_tablename' => 'forum_thread',
239
+ 'from_fieldname' => 'is_closed',
240
+ 'to_type' => 'topic',
241
+ 'to_fieldname' => 'post_status',
242
+ 'callback_method' => 'callback_topic_status'
243
+ );
244
+
245
+ // Sticky status (Stored in postmeta))
246
+ $this->field_map[] = array(
247
+ 'from_tablename' => 'forum_thread',
248
+ 'from_fieldname' => 'order_id',
249
+ 'to_type' => 'topic',
250
+ 'to_fieldname' => '_bbp_old_sticky_status',
251
+ 'callback_method' => 'callback_sticky_status'
252
+ );
253
+
254
+ // Topic dates.
255
+ $this->field_map[] = array(
256
+ 'from_tablename' => 'forum_thread',
257
+ 'from_fieldname' => 'time_stamp',
258
+ 'to_type' => 'topic',
259
+ 'to_fieldname' => 'post_date',
260
+ 'callback_method' => 'callback_datetime'
261
+ );
262
+ $this->field_map[] = array(
263
+ 'from_tablename' => 'forum_thread',
264
+ 'from_fieldname' => 'time_stamp',
265
+ 'to_type' => 'topic',
266
+ 'to_fieldname' => 'post_date_gmt',
267
+ 'callback_method' => 'callback_datetime'
268
+ );
269
+ $this->field_map[] = array(
270
+ 'from_tablename' => 'forum_thread',
271
+ 'from_fieldname' => 'time_update',
272
+ 'to_type' => 'topic',
273
+ 'to_fieldname' => 'post_modified',
274
+ 'callback_method' => 'callback_datetime'
275
+ );
276
+ $this->field_map[] = array(
277
+ 'from_tablename' => 'forum_thread',
278
+ 'from_fieldname' => 'time_update',
279
+ 'to_type' => 'topic',
280
+ 'to_fieldname' => 'post_modified_gmt',
281
+ 'callback_method' => 'callback_datetime'
282
+ );
283
+ $this->field_map[] = array(
284
+ 'from_tablename' => 'forum_thread',
285
+ 'from_fieldname' => 'time_update',
286
+ 'to_type' => 'topic',
287
+ 'to_fieldname' => '_bbp_last_active_time',
288
+ 'callback_method' => 'callback_datetime'
289
+ );
290
+
291
+ /** Tags Section ******************************************************/
292
+
293
+ // Topic id.
294
+ $this->field_map[] = array(
295
+ 'from_tablename' => 'tag',
296
+ 'from_fieldname' => 'item_id',
297
+ 'to_type' => 'tags',
298
+ 'to_fieldname' => 'objectid',
299
+ 'callback_method' => 'callback_topicid'
300
+ );
301
+
302
+ // Taxonomy ID.
303
+ $this->field_map[] = array(
304
+ 'from_tablename' => 'tag',
305
+ 'from_fieldname' => 'tag_id',
306
+ 'to_type' => 'tags',
307
+ 'to_fieldname' => 'taxonomy'
308
+ );
309
+
310
+ // Term text.
311
+ $this->field_map[] = array(
312
+ 'from_tablename' => 'tag',
313
+ 'from_fieldname' => 'tag_text',
314
+ 'to_type' => 'tags',
315
+ 'to_fieldname' => 'name'
316
+ );
317
+
318
+ // Term slug.
319
+ $this->field_map[] = array(
320
+ 'from_tablename' => 'tag',
321
+ 'from_fieldname' => 'tag_url',
322
+ 'to_type' => 'tags',
323
+ 'to_fieldname' => 'slug',
324
+ 'callback_method' => 'callback_slug'
325
+ );
326
+
327
+ /** Reply Section *****************************************************/
328
+
329
+ // Reply id (Stored in postmeta)
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'forum_post',
332
+ 'from_fieldname' => 'post_id',
333
+ 'to_type' => 'reply',
334
+ 'to_fieldname' => '_bbp_post_id'
335
+ );
336
+
337
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
338
+ $this->field_map[] = array(
339
+ 'from_tablename' => 'forum_thread',
340
+ 'from_fieldname' => 'forum_id',
341
+ 'join_tablename' => 'forum_post',
342
+ 'join_type' => 'LEFT',
343
+ 'join_expression' => 'USING (thread_id)',
344
+ 'to_type' => 'reply',
345
+ 'to_fieldname' => '_bbp_forum_id',
346
+ 'callback_method' => 'callback_topicid_to_forumid'
347
+ );
348
+
349
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
350
+ $this->field_map[] = array(
351
+ 'from_tablename' => 'forum_post',
352
+ 'from_fieldname' => 'thread_id',
353
+ 'to_type' => 'reply',
354
+ 'to_fieldname' => '_bbp_topic_id',
355
+ 'callback_method' => 'callback_topicid'
356
+ );
357
+
358
+ // Reply author.
359
+ $this->field_map[] = array(
360
+ 'from_tablename' => 'forum_post',
361
+ 'from_fieldname' => 'user_id',
362
+ 'to_type' => 'reply',
363
+ 'to_fieldname' => 'post_author',
364
+ 'callback_method' => 'callback_userid'
365
+ );
366
+
367
+ // Reply title.
368
+ $this->field_map[] = array(
369
+ 'from_tablename' => 'forum_thread',
370
+ 'from_fieldname' => 'title',
371
+ 'join_tablename' => 'forum_post',
372
+ 'join_type' => 'LEFT',
373
+ 'join_expression' => 'USING (thread_id)',
374
+ 'to_type' => 'reply',
375
+ 'to_fieldname' => 'post_title',
376
+ 'callback_method' => 'callback_reply_title'
377
+ );
378
+
379
+ // Reply slug (Clean name to avoid conflicts)
380
+ $this->field_map[] = array(
381
+ 'from_tablename' => 'forum_thread',
382
+ 'from_fieldname' => 'title_url',
383
+ 'join_tablename' => 'forum_post',
384
+ 'join_type' => 'LEFT',
385
+ 'join_expression' => 'USING (thread_id)',
386
+ 'to_type' => 'reply',
387
+ 'to_fieldname' => 'post_name',
388
+ 'callback_method' => 'callback_slug'
389
+ );
390
+
391
+ // Reply content.
392
+ // Note: We join the 'forum_post_text' table because 'forum_post' table does not include content.
393
+ // Note: We can use 'text' for original text OR 'text_parsed' for pre-parsed text output
394
+ $this->field_map[] = array(
395
+ 'from_tablename' => 'forum_post_text',
396
+ 'from_fieldname' => 'text_parsed',
397
+ 'join_tablename' => 'forum_post',
398
+ 'join_type' => 'LEFT',
399
+ 'join_expression' => 'ON forum_post_text.post_id = forum_post.post_id WHERE forum_thread.start_id != forum_post.post_id',
400
+ 'to_type' => 'reply',
401
+ 'to_fieldname' => 'post_content',
402
+ 'callback_method' => 'callback_html'
403
+ );
404
+
405
+ // Reply parent topic id (If no parent, then 0)
406
+ $this->field_map[] = array(
407
+ 'from_tablename' => 'forum_post',
408
+ 'from_fieldname' => 'thread_id',
409
+ 'to_type' => 'reply',
410
+ 'to_fieldname' => 'post_parent',
411
+ 'callback_method' => 'callback_topicid'
412
+ );
413
+
414
+ // Reply dates.
415
+ $this->field_map[] = array(
416
+ 'from_tablename' => 'forum_post',
417
+ 'from_fieldname' => 'time_stamp',
418
+ 'to_type' => 'reply',
419
+ 'to_fieldname' => 'post_date',
420
+ 'callback_method' => 'callback_datetime'
421
+ );
422
+ $this->field_map[] = array(
423
+ 'from_tablename' => 'forum_post',
424
+ 'from_fieldname' => 'time_stamp',
425
+ 'to_type' => 'reply',
426
+ 'to_fieldname' => 'post_date_gmt',
427
+ 'callback_method' => 'callback_datetime'
428
+ );
429
+ $this->field_map[] = array(
430
+ 'from_tablename' => 'forum_post',
431
+ 'from_fieldname' => 'time_stamp',
432
+ 'to_type' => 'reply',
433
+ 'to_fieldname' => 'post_modified',
434
+ 'callback_method' => 'callback_datetime'
435
+ );
436
+ $this->field_map[] = array(
437
+ 'from_tablename' => 'forum_post',
438
+ 'from_fieldname' => 'time_stamp',
439
+ 'to_type' => 'reply',
440
+ 'to_fieldname' => 'post_modified_gmt',
441
+ 'callback_method' => 'callback_datetime'
442
+ );
443
+
444
+ /** User Section ******************************************************/
445
+
446
+ // Store old User id (Stored in usermeta)
447
+ $this->field_map[] = array(
448
+ 'from_tablename' => 'user',
449
+ 'from_fieldname' => 'user_id',
450
+ 'to_type' => 'user',
451
+ 'to_fieldname' => '_bbp_user_id'
452
+ );
453
+
454
+ // Store old User password (Stored in usermeta serialized with salt)
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'user',
457
+ 'from_fieldname' => 'password',
458
+ 'to_type' => 'user',
459
+ 'to_fieldname' => '_bbp_password',
460
+ 'callback_method' => 'callback_savepass'
461
+ );
462
+
463
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
464
+ $this->field_map[] = array(
465
+ 'from_tablename' => 'user',
466
+ 'from_fieldname' => 'password_salt',
467
+ 'to_type' => 'user',
468
+ 'to_fieldname' => ''
469
+ );
470
+
471
+ // User password verify class (Stored in usermeta for verifying password)
472
+ $this->field_map[] = array(
473
+ 'to_type' => 'user',
474
+ 'to_fieldname' => '_bbp_class',
475
+ 'default' => 'PHPFox3'
476
+ );
477
+
478
+ // User name.
479
+ $this->field_map[] = array(
480
+ 'from_tablename' => 'user',
481
+ 'from_fieldname' => 'user_name',
482
+ 'to_type' => 'user',
483
+ 'to_fieldname' => 'user_login'
484
+ );
485
+
486
+ // User nice name.
487
+ $this->field_map[] = array(
488
+ 'from_tablename' => 'user',
489
+ 'from_fieldname' => 'user_name',
490
+ 'to_type' => 'user',
491
+ 'to_fieldname' => 'user_nicename'
492
+ );
493
+
494
+ // User email.
495
+ $this->field_map[] = array(
496
+ 'from_tablename' => 'user',
497
+ 'from_fieldname' => 'email',
498
+ 'to_type' => 'user',
499
+ 'to_fieldname' => 'user_email'
500
+ );
501
+
502
+ // User registered.
503
+ $this->field_map[] = array(
504
+ 'from_tablename' => 'user',
505
+ 'from_fieldname' => 'joined',
506
+ 'to_type' => 'user',
507
+ 'to_fieldname' => 'user_registered',
508
+ 'callback_method' => 'callback_datetime'
509
+ );
510
+
511
+ // User display name.
512
+ $this->field_map[] = array(
513
+ 'from_tablename' => 'user',
514
+ 'from_fieldname' => 'full_name',
515
+ 'to_type' => 'user',
516
+ 'to_fieldname' => 'display_name'
517
+ );
518
+
519
+ }
520
+
521
+ /**
522
+ * This method allows us to indicates what is or is not converted for each
523
+ * converter.
524
+ */
525
+ public function info()
526
+ {
527
+ return '';
528
+ }
529
+
530
+ /**
531
+ * This method is to save the salt and password together. That
532
+ * way when we authenticate it we can get it out of the database
533
+ * as one value. Array values are auto sanitized by WordPress.
534
+ */
535
+ public function callback_savepass( $field, $row )
536
+ {
537
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
538
+ return $pass_array;
539
+ }
540
+
541
+ /**
542
+ * This method is to take the pass out of the database and compare
543
+ * to a pass the user has typed in.
544
+ */
545
+ public function authenticate_pass( $password, $serialized_pass )
546
+ {
547
+ $pass_array = unserialize( $serialized_pass );
548
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
549
+ }
550
+
551
+ /**
552
+ * Translate the forum type from PHPFox v3.5.x numeric's to WordPress's strings.
553
+ *
554
+ * @param int $status PHPFox v3.5.x numeric forum type
555
+ * @return string WordPress safe
556
+ */
557
+ public function callback_forum_type( $status = 0 ) {
558
+ switch ( $status ) {
559
+ case 1 :
560
+ $status = 'category';
561
+ break;
562
+
563
+ case 0 :
564
+ default :
565
+ $status = 'forum';
566
+ break;
567
+ }
568
+ return $status;
569
+ }
570
+
571
+ /**
572
+ * Translate the forum status from PHPFox v3.5.x numeric's to WordPress's strings.
573
+ *
574
+ * @param int $status PHPFox v3.5.x numeric forum status
575
+ * @return string WordPress safe
576
+ */
577
+ public function callback_forum_status( $status = 0 ) {
578
+ switch ( $status ) {
579
+ case 1 :
580
+ $status = 'closed';
581
+ break;
582
+
583
+ case 0 :
584
+ default :
585
+ $status = 'open';
586
+ break;
587
+ }
588
+ return $status;
589
+ }
590
+
591
+ /**
592
+ * Translate the post status from PHPFox v3.5.x numeric's to WordPress's strings.
593
+ *
594
+ * @param int $status PHPFox v3.5.x numeric topic status
595
+ * @return string WordPress safe
596
+ */
597
+ public function callback_topic_status( $status = 0 ) {
598
+ switch ( $status ) {
599
+ case 1 :
600
+ $status = 'closed';
601
+ break;
602
+
603
+ case 0 :
604
+ default :
605
+ $status = 'publish';
606
+ break;
607
+ }
608
+ return $status;
609
+ }
610
+
611
+ /**
612
+ * Translate the topic sticky status type from PHPFox v3.5.x numeric's to WordPress's strings.
613
+ *
614
+ * @param int $status PHPFox v3.5.x numeric forum type
615
+ * @return string WordPress safe
616
+ */
617
+ public function callback_sticky_status( $status = 0 ) {
618
+ switch ( $status ) {
619
+ case 1 :
620
+ $status = 'sticky'; // PHPFox Sticky 'topic_sticky = 1'
621
+ break;
622
+
623
+ case 0 :
624
+ default :
625
+ $status = 'normal'; // PHPFox Normal Topic 'topic_sticky = 0'
626
+ break;
627
+ }
628
+ return $status;
629
+ }
630
+
631
+ /**
632
+ * Verify the topic/reply count.
633
+ *
634
+ * @param int $count PHPFox v3.5.x topic/reply counts
635
+ * @return string WordPress safe
636
+ */
637
+ public function callback_topic_reply_count( $count = 1 ) {
638
+ $count = absint( (int) $count - 1 );
639
+ return $count;
640
+ }
641
+
642
+ /**
643
+ * Set the reply title
644
+ *
645
+ * @param string $title PHPFox v3.5.x topic title of this reply
646
+ * @return string Prefixed topic title, or empty string
647
+ */
648
+ public function callback_reply_title( $title = '' ) {
649
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
650
+ return $title;
651
+ }
652
+ }
includes/admin/converters/PHPWind.php ADDED
@@ -0,0 +1,585 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of PHPWind Forum converter.
5
+ *
6
+ * @since bbPress (r5142)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/phpwind
8
+ */
9
+ class PHPWind extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses PHPWind::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' => 'bbs_forum',
31
+ 'from_fieldname' => 'fid',
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' => 'bbs_forum',
39
+ 'from_fieldname' => 'parentid',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_forum_parent_id'
42
+ );
43
+
44
+ // Forum topic count (Stored in postmeta)
45
+ // Note: We join the 'bbs_forum_statistics' table because 'bbs_forum' table does not include topic and reply counts.
46
+ $this->field_map[] = array(
47
+ 'from_tablename' => 'bbs_forum_statistics',
48
+ 'from_fieldname' => 'threads',
49
+ 'join_tablename' => 'bbs_forum',
50
+ 'join_type' => 'LEFT',
51
+ 'join_expression' => 'USING (fid)',
52
+ 'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_topic_count'
54
+ );
55
+
56
+ // Forum reply count (Stored in postmeta)
57
+ // Note: We join the 'bbs_forum_statistics' table because 'bbs_forum' table does not include topic and reply counts.
58
+ $this->field_map[] = array(
59
+ 'from_tablename' => 'bbs_forum_statistics',
60
+ 'from_fieldname' => 'posts',
61
+ 'join_tablename' => 'bbs_forum',
62
+ 'join_type' => 'LEFT',
63
+ 'join_expression' => 'USING (fid)',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_reply_count'
66
+ );
67
+
68
+ // Forum total topic count (Stored in postmeta)
69
+ // Note: We join the 'bbs_forum_statistics' table because 'bbs_forum' table does not include topic and reply counts.
70
+ $this->field_map[] = array(
71
+ 'from_tablename' => 'bbs_forum_statistics',
72
+ 'from_fieldname' => 'threads',
73
+ 'join_tablename' => 'bbs_forum',
74
+ 'join_type' => 'LEFT',
75
+ 'join_expression' => 'USING (fid)',
76
+ 'to_type' => 'forum',
77
+ 'to_fieldname' => '_bbp_total_topic_count'
78
+ );
79
+
80
+ // Forum total reply count (Stored in postmeta)
81
+ // Note: We join the 'bbs_forum_statistics' table because 'bbs_forum' table does not include topic and reply counts.
82
+ $this->field_map[] = array(
83
+ 'from_tablename' => 'bbs_forum_statistics',
84
+ 'from_fieldname' => 'posts',
85
+ 'join_tablename' => 'bbs_forum',
86
+ 'join_type' => 'LEFT',
87
+ 'join_expression' => 'USING (fid)',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => '_bbp_total_reply_count'
90
+ );
91
+
92
+ // Forum title.
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'bbs_forum',
95
+ 'from_fieldname' => 'name',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_title'
98
+ );
99
+
100
+ // Forum slug (Clean name to avoid conflicts)
101
+ $this->field_map[] = array(
102
+ 'from_tablename' => 'bbs_forum',
103
+ 'from_fieldname' => 'name',
104
+ 'to_type' => 'forum',
105
+ 'to_fieldname' => 'post_name',
106
+ 'callback_method' => 'callback_slug'
107
+ );
108
+
109
+ // Forum description.
110
+ $this->field_map[] = array(
111
+ 'from_tablename' => 'bbs_forum',
112
+ 'from_fieldname' => 'descrip',
113
+ 'to_type' => 'forum',
114
+ 'to_fieldname' => 'post_content',
115
+ 'callback_method' => 'callback_null'
116
+ );
117
+
118
+ // Forum display order (Starts from 1)
119
+ $this->field_map[] = array(
120
+ 'from_tablename' => 'bbs_forum',
121
+ 'from_fieldname' => 'vieworder',
122
+ 'to_type' => 'forum',
123
+ 'to_fieldname' => 'menu_order'
124
+ );
125
+
126
+ // Forum type (Category = category or Forum = forum, sub or sub2, Stored in postmeta)
127
+ $this->field_map[] = array(
128
+ 'from_tablename' => 'bbs_forum',
129
+ 'from_fieldname' => 'type',
130
+ 'to_type' => 'forum',
131
+ 'to_fieldname' => '_bbp_forum_type',
132
+ 'callback_method' => 'callback_forum_type'
133
+ );
134
+
135
+ // Forum dates.
136
+ $this->field_map[] = array(
137
+ 'to_type' => 'bbs_forum',
138
+ 'to_fieldname' => 'post_date',
139
+ 'default' => date('Y-m-d H:i:s')
140
+ );
141
+ $this->field_map[] = array(
142
+ 'to_type' => 'bbs_forum',
143
+ 'to_fieldname' => 'post_date_gmt',
144
+ 'default' => date('Y-m-d H:i:s')
145
+ );
146
+ $this->field_map[] = array(
147
+ 'to_type' => 'bbs_forum',
148
+ 'to_fieldname' => 'post_modified',
149
+ 'default' => date('Y-m-d H:i:s')
150
+ );
151
+ $this->field_map[] = array(
152
+ 'to_type' => 'bbs_forum',
153
+ 'to_fieldname' => 'post_modified_gmt',
154
+ 'default' => date('Y-m-d H:i:s')
155
+ );
156
+
157
+ /** Topic Section *****************************************************/
158
+
159
+ // Topic id (Stored in postmeta)
160
+ $this->field_map[] = array(
161
+ 'from_tablename' => 'bbs_threads',
162
+ 'from_fieldname' => 'tid',
163
+ 'to_type' => 'topic',
164
+ 'to_fieldname' => '_bbp_topic_id'
165
+ );
166
+
167
+ // Topic reply count (Stored in postmeta)
168
+ $this->field_map[] = array(
169
+ 'from_tablename' => 'bbs_threads',
170
+ 'from_fieldname' => 'replies',
171
+ 'to_type' => 'topic',
172
+ 'to_fieldname' => '_bbp_reply_count',
173
+ 'callback_method' => 'callback_topic_reply_count'
174
+ );
175
+
176
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
177
+ $this->field_map[] = array(
178
+ 'from_tablename' => 'bbs_threads',
179
+ 'from_fieldname' => 'replies',
180
+ 'to_type' => 'topic',
181
+ 'to_fieldname' => '_bbp_total_reply_count',
182
+ 'callback_method' => 'callback_topic_reply_count'
183
+ );
184
+
185
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
186
+ $this->field_map[] = array(
187
+ 'from_tablename' => 'bbs_threads',
188
+ 'from_fieldname' => 'fid',
189
+ 'to_type' => 'topic',
190
+ 'to_fieldname' => '_bbp_forum_id',
191
+ 'callback_method' => 'callback_forumid'
192
+ );
193
+
194
+ // Topic author.
195
+ $this->field_map[] = array(
196
+ 'from_tablename' => 'bbs_threads',
197
+ 'from_fieldname' => 'created_userid',
198
+ 'to_type' => 'topic',
199
+ 'to_fieldname' => 'post_author',
200
+ 'callback_method' => 'callback_userid'
201
+ );
202
+
203
+ // Topic Author ip (Stored in postmeta)
204
+ $this->field_map[] = array(
205
+ 'from_tablename' => 'bbs_threads',
206
+ 'from_fieldname' => 'created_ip',
207
+ 'to_type' => 'topic',
208
+ 'to_fieldname' => '_bbp_author_ip'
209
+ );
210
+
211
+ // Topic content.
212
+ // Note: We join the 'bbs_threads_content' table because 'bbs_threads' table does not have content.
213
+ $this->field_map[] = array(
214
+ 'from_tablename' => 'bbs_threads_content',
215
+ 'from_fieldname' => 'content',
216
+ 'join_tablename' => 'bbs_threads',
217
+ 'join_type' => 'INNER',
218
+ 'join_expression' => 'USING (tid)',
219
+ 'to_type' => 'topic',
220
+ 'to_fieldname' => 'post_content',
221
+ 'callback_method' => 'callback_html'
222
+ );
223
+
224
+ // Topic title.
225
+ $this->field_map[] = array(
226
+ 'from_tablename' => 'bbs_threads',
227
+ 'from_fieldname' => 'subject',
228
+ 'to_type' => 'topic',
229
+ 'to_fieldname' => 'post_title'
230
+ );
231
+
232
+ // Topic slug (Clean name to avoid conflicts)
233
+ $this->field_map[] = array(
234
+ 'from_tablename' => 'bbs_threads',
235
+ 'from_fieldname' => 'subject',
236
+ 'to_type' => 'topic',
237
+ 'to_fieldname' => 'post_name',
238
+ 'callback_method' => 'callback_slug'
239
+ );
240
+
241
+ // Topic parent forum id (If no parent, then 0)
242
+ $this->field_map[] = array(
243
+ 'from_tablename' => 'bbs_threads',
244
+ 'from_fieldname' => 'fid',
245
+ 'to_type' => 'topic',
246
+ 'to_fieldname' => 'post_parent',
247
+ 'callback_method' => 'callback_forumid'
248
+ );
249
+
250
+ // Topic dates.
251
+ $this->field_map[] = array(
252
+ 'from_tablename' => 'bbs_threads',
253
+ 'from_fieldname' => 'created_time',
254
+ 'to_type' => 'topic',
255
+ 'to_fieldname' => 'post_date',
256
+ 'callback_method' => 'callback_datetime'
257
+ );
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'bbs_threads',
260
+ 'from_fieldname' => 'created_time',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => 'post_date_gmt',
263
+ 'callback_method' => 'callback_datetime'
264
+ );
265
+ $this->field_map[] = array(
266
+ 'from_tablename' => 'bbs_threads',
267
+ 'from_fieldname' => 'lastpost_time',
268
+ 'to_type' => 'topic',
269
+ 'to_fieldname' => 'post_modified',
270
+ 'callback_method' => 'callback_datetime'
271
+ );
272
+ $this->field_map[] = array(
273
+ 'from_tablename' => 'bbs_threads',
274
+ 'from_fieldname' => 'lastpost_time',
275
+ 'to_type' => 'topic',
276
+ 'to_fieldname' => 'post_modified_gmt',
277
+ 'callback_method' => 'callback_datetime'
278
+ );
279
+ $this->field_map[] = array(
280
+ 'from_tablename' => 'bbs_threads',
281
+ 'from_fieldname' => 'lastpost_time',
282
+ 'to_type' => 'topic',
283
+ 'to_fieldname' => '_bbp_last_active_time',
284
+ 'callback_method' => 'callback_datetime'
285
+ );
286
+
287
+ // Topic status (Open or Closed, PHPWind v9.x 0=no, 1=closed & 2=open)
288
+ $this->field_map[] = array(
289
+ 'from_tablename' => 'bbs_threads',
290
+ 'from_fieldname' => 'tpcstatus',
291
+ 'to_type' => 'topic',
292
+ 'to_fieldname' => 'post_status',
293
+ 'callback_method' => 'callback_topic_status'
294
+ );
295
+
296
+ /** Tags Section ******************************************************/
297
+
298
+ /**
299
+ * PHPWind v9.x Forums do not support topic tags out of the box
300
+ */
301
+
302
+ /** Reply Section *****************************************************/
303
+
304
+ // Reply id (Stored in postmeta)
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'bbs_posts',
307
+ 'from_fieldname' => 'pid',
308
+ 'to_type' => 'reply',
309
+ 'to_fieldname' => '_bbp_post_id'
310
+ );
311
+
312
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
313
+ $this->field_map[] = array(
314
+ 'from_tablename' => 'bbs_posts',
315
+ 'from_fieldname' => 'fid',
316
+ 'to_type' => 'reply',
317
+ 'to_fieldname' => '_bbp_forum_id',
318
+ 'callback_method' => 'callback_forumid'
319
+ );
320
+
321
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
322
+ $this->field_map[] = array(
323
+ 'from_tablename' => 'bbs_posts',
324
+ 'from_fieldname' => 'tid',
325
+ 'to_type' => 'reply',
326
+ 'to_fieldname' => '_bbp_topic_id',
327
+ 'callback_method' => 'callback_topicid'
328
+ );
329
+
330
+ // Reply author ip (Stored in postmeta)
331
+ $this->field_map[] = array(
332
+ 'from_tablename' => 'bbs_posts',
333
+ 'from_fieldname' => 'created_ip',
334
+ 'to_type' => 'reply',
335
+ 'to_fieldname' => '_bbp_author_ip'
336
+ );
337
+
338
+ // Reply author.
339
+ $this->field_map[] = array(
340
+ 'from_tablename' => 'bbs_posts',
341
+ 'from_fieldname' => 'created_userid',
342
+ 'to_type' => 'reply',
343
+ 'to_fieldname' => 'post_author',
344
+ 'callback_method' => 'callback_userid'
345
+ );
346
+
347
+ // Reply title.
348
+ // Note: We join the 'bbs_threads' table because 'bbs_posts' table does not include reply title.
349
+ $this->field_map[] = array(
350
+ 'from_tablename' => 'bbs_threads',
351
+ 'from_fieldname' => 'subject',
352
+ 'join_tablename' => 'bbs_posts',
353
+ 'join_type' => 'LEFT',
354
+ 'join_expression' => 'USING (tid)',
355
+ 'to_type' => 'reply',
356
+ 'to_fieldname' => 'post_title'
357
+ );
358
+
359
+ // Reply slug (Clean name to avoid conflicts)
360
+ // Note: We join the 'bbs_threads' table because 'bbs_posts' table does not include reply slug.
361
+ $this->field_map[] = array(
362
+ 'from_tablename' => 'bbs_threads',
363
+ 'from_fieldname' => 'subject',
364
+ 'join_tablename' => 'bbs_posts',
365
+ 'join_type' => 'LEFT',
366
+ 'join_expression' => 'USING (tid)',
367
+ 'to_type' => 'reply',
368
+ 'to_fieldname' => 'post_name',
369
+ 'callback_method' => 'callback_slug'
370
+ );
371
+
372
+ // Reply content.
373
+ $this->field_map[] = array(
374
+ 'from_tablename' => 'bbs_posts',
375
+ 'from_fieldname' => 'content',
376
+ 'to_type' => 'reply',
377
+ 'to_fieldname' => 'post_content',
378
+ 'callback_method' => 'callback_html'
379
+ );
380
+
381
+ // Reply parent topic id (If no parent, then 0)
382
+ $this->field_map[] = array(
383
+ 'from_tablename' => 'bbs_posts',
384
+ 'from_fieldname' => 'tid',
385
+ 'to_type' => 'reply',
386
+ 'to_fieldname' => 'post_parent',
387
+ 'callback_method' => 'callback_topicid'
388
+ );
389
+
390
+ // Reply dates.
391
+ $this->field_map[] = array(
392
+ 'from_tablename' => 'bbs_posts',
393
+ 'from_fieldname' => 'created_time',
394
+ 'to_type' => 'reply',
395
+ 'to_fieldname' => 'post_date',
396
+ 'callback_method' => 'callback_datetime'
397
+ );
398
+ $this->field_map[] = array(
399
+ 'from_tablename' => 'bbs_posts',
400
+ 'from_fieldname' => 'created_time',
401
+ 'to_type' => 'reply',
402
+ 'to_fieldname' => 'post_date_gmt',
403
+ 'callback_method' => 'callback_datetime'
404
+ );
405
+ $this->field_map[] = array(
406
+ 'from_tablename' => 'bbs_posts',
407
+ 'from_fieldname' => 'created_time',
408
+ 'to_type' => 'reply',
409
+ 'to_fieldname' => 'post_modified',
410
+ 'callback_method' => 'callback_datetime'
411
+ );
412
+ $this->field_map[] = array(
413
+ 'from_tablename' => 'bbs_posts',
414
+ 'from_fieldname' => 'created_time',
415
+ 'to_type' => 'reply',
416
+ 'to_fieldname' => 'post_modified_gmt',
417
+ 'callback_method' => 'callback_datetime'
418
+ );
419
+
420
+ /** User Section ******************************************************/
421
+
422
+ // Store old User id (Stored in usermeta)
423
+ $this->field_map[] = array(
424
+ 'from_tablename' => 'user',
425
+ 'from_fieldname' => 'uid',
426
+ 'to_type' => 'user',
427
+ 'to_fieldname' => '_bbp_user_id'
428
+ );
429
+
430
+ // Store old User password (Stored in usermeta serialized with salt)
431
+ $this->field_map[] = array(
432
+ 'from_tablename' => 'user',
433
+ 'from_fieldname' => 'password',
434
+ 'to_type' => 'user',
435
+ 'to_fieldname' => '_bbp_password'
436
+ // 'callback_method' => 'callback_savepass'
437
+ );
438
+
439
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
440
+ /* $this->field_map[] = array(
441
+ 'from_tablename' => 'user',
442
+ 'from_fieldname' => 'pass',
443
+ 'to_type' => 'user',
444
+ 'to_fieldname' => ''
445
+ );
446
+ */
447
+ // User password verify class (Stored in usermeta for verifying password)
448
+ $this->field_map[] = array(
449
+ 'to_type' => 'user',
450
+ 'to_fieldname' => '_bbp_class',
451
+ 'default' => 'PHPWind'
452
+ );
453
+
454
+ // User name.
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'user',
457
+ 'from_fieldname' => 'username',
458
+ 'to_type' => 'user',
459
+ 'to_fieldname' => 'user_login'
460
+ );
461
+
462
+ // User nice name.
463
+ $this->field_map[] = array(
464
+ 'from_tablename' => 'user',
465
+ 'from_fieldname' => 'username',
466
+ 'to_type' => 'user',
467
+ 'to_fieldname' => 'user_nicename'
468
+ );
469
+
470
+ // User email.
471
+ $this->field_map[] = array(
472
+ 'from_tablename' => 'user',
473
+ 'from_fieldname' => 'email',
474
+ 'to_type' => 'user',
475
+ 'to_fieldname' => 'user_email'
476
+ );
477
+
478
+ // User registered.
479
+ $this->field_map[] = array(
480
+ 'from_tablename' => 'user',
481
+ 'from_fieldname' => 'regdate',
482
+ 'to_type' => 'user',
483
+ 'to_fieldname' => 'user_registered',
484
+ 'callback_method' => 'callback_datetime'
485
+ );
486
+
487
+ // User display name.
488
+ $this->field_map[] = array(
489
+ 'from_tablename' => 'user',
490
+ 'from_fieldname' => 'realname',
491
+ 'to_type' => 'user',
492
+ 'to_fieldname' => 'display_name'
493
+ );
494
+ }
495
+
496
+ /**
497
+ * This method allows us to indicates what is or is not converted for each
498
+ * converter.
499
+ */
500
+ public function info()
501
+ {
502
+ return '';
503
+ }
504
+
505
+ /**
506
+ * This method is to save the salt and password together. That
507
+ * way when we authenticate it we can get it out of the database
508
+ * as one value. Array values are auto sanitized by WordPress.
509
+ */
510
+ public function callback_savepass( $field, $row )
511
+ {
512
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
513
+ return $pass_array;
514
+ }
515
+
516
+ /**
517
+ * This method is to take the pass out of the database and compare
518
+ * to a pass the user has typed in.
519
+ */
520
+ public function authenticate_pass( $password, $serialized_pass )
521
+ {
522
+ $pass_array = unserialize( $serialized_pass );
523
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
524
+ }
525
+
526
+ /**
527
+ * Translate the forum type from PHPWind v9.x Capitalised case to WordPress's non-capatilise case strings.
528
+ *
529
+ * @param int $status PHPWind v9.x numeric forum type
530
+ * @return string WordPress safe
531
+ */
532
+ public function callback_forum_type( $status = 1 ) {
533
+ switch ( $status ) {
534
+ case 'category' :
535
+ $status = 'category';
536
+ break;
537
+
538
+ case 'sub' :
539
+ $status = 'forum';
540
+ break;
541
+
542
+ case 'sub2' :
543
+ $status = 'forum';
544
+ break;
545
+
546
+ case 'forum' :
547
+ default :
548
+ $status = 'forum';
549
+ break;
550
+ }
551
+ return $status;
552
+ }
553
+
554
+ /**
555
+ * Translate the post status from PHPWind v9.x numeric's to WordPress's strings.
556
+ *
557
+ * @param int $status PHPWind v9.x numeric topic status
558
+ * @return string WordPress safe
559
+ */
560
+ public function callback_topic_status( $status = 2 ) {
561
+ switch ( $status ) {
562
+ case 1 :
563
+ $status = 'closed';
564
+ break;
565
+
566
+ case 2 :
567
+ default :
568
+ $status = 'publish';
569
+ break;
570
+ }
571
+ return $status;
572
+ }
573
+
574
+ /**
575
+ * Verify the topic/reply count.
576
+ *
577
+ * @param int $count PHPWind v9.x topic/reply counts
578
+ * @return string WordPress safe
579
+ */
580
+ public function callback_topic_reply_count( $count = 1 ) {
581
+ $count = absint( (int) $count - 1 );
582
+ return $count;
583
+ }
584
+
585
+ }
includes/admin/converters/Phorum.php ADDED
@@ -0,0 +1,545 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of Phorum Forum converter.
5
+ *
6
+ * @since bbPress (r5141)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/phorum
8
+ */
9
+ class Phorum extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses Phorum::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' => 'forums',
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' => 'forums',
39
+ 'from_fieldname' => 'parent_id',
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' => 'forums',
47
+ 'from_fieldname' => 'thread_count',
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' => 'forums',
55
+ 'from_fieldname' => 'message_count',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_reply_count'
58
+ );
59
+
60
+ // Forum title.
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'name',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => 'post_title'
66
+ );
67
+
68
+ // Forum slug (Clean name to avoid conflicts)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'name',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => 'post_name',
74
+ 'callback_method' => 'callback_slug'
75
+ );
76
+
77
+ // Forum description.
78
+ $this->field_map[] = array(
79
+ 'from_tablename' => 'forums',
80
+ 'from_fieldname' => 'description',
81
+ 'to_type' => 'forum',
82
+ 'to_fieldname' => 'post_content',
83
+ 'callback_method' => 'callback_null'
84
+ );
85
+
86
+ // Forum display order (Starts from 1)
87
+ $this->field_map[] = array(
88
+ 'from_tablename' => 'forums',
89
+ 'from_fieldname' => 'display_order',
90
+ 'to_type' => 'forum',
91
+ 'to_fieldname' => 'menu_order'
92
+ );
93
+
94
+ // Forum type (Category = 1 or Forum = 0, Stored in postmeta)
95
+ $this->field_map[] = array(
96
+ 'from_tablename' => 'forums',
97
+ 'from_fieldname' => 'folder_flag',
98
+ 'to_type' => 'forum',
99
+ 'to_fieldname' => '_bbp_forum_type',
100
+ 'callback_method' => 'callback_forum_type'
101
+ );
102
+
103
+ // Forum dates.
104
+ $this->field_map[] = array(
105
+ 'to_type' => 'forum',
106
+ 'to_fieldname' => 'post_date',
107
+ 'default' => date('Y-m-d H:i:s')
108
+ );
109
+ $this->field_map[] = array(
110
+ 'to_type' => 'forum',
111
+ 'to_fieldname' => 'post_date_gmt',
112
+ 'default' => date('Y-m-d H:i:s')
113
+ );
114
+ $this->field_map[] = array(
115
+ 'to_type' => 'forum',
116
+ 'to_fieldname' => 'post_modified',
117
+ 'default' => date('Y-m-d H:i:s')
118
+ );
119
+ $this->field_map[] = array(
120
+ 'to_type' => 'forum',
121
+ 'to_fieldname' => 'post_modified_gmt',
122
+ 'default' => date('Y-m-d H:i:s')
123
+ );
124
+
125
+ /** Topic Section *****************************************************/
126
+
127
+ // Topic id (Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'from_tablename' => 'messages',
130
+ 'from_fieldname' => 'thread',
131
+ 'from_expression' => 'WHERE parent_id = 0',
132
+ 'to_type' => 'topic',
133
+ 'to_fieldname' => '_bbp_topic_id'
134
+ );
135
+
136
+ // Topic reply count (Stored in postmeta)
137
+ $this->field_map[] = array(
138
+ 'from_tablename' => 'messages',
139
+ 'from_fieldname' => 'thread_count',
140
+ 'to_type' => 'topic',
141
+ 'to_fieldname' => '_bbp_reply_count',
142
+ 'callback_method' => 'callback_topic_reply_count'
143
+ );
144
+
145
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
146
+ $this->field_map[] = array(
147
+ 'from_tablename' => 'messages',
148
+ 'from_fieldname' => 'thread_count',
149
+ 'to_type' => 'topic',
150
+ 'to_fieldname' => '_bbp_total_reply_count',
151
+ 'callback_method' => 'callback_topic_reply_count'
152
+ );
153
+
154
+ // Topic parent forum id (If no parent, then 0, Stored in postmeta)
155
+ $this->field_map[] = array(
156
+ 'from_tablename' => 'messages',
157
+ 'from_fieldname' => 'forum_id',
158
+ 'to_type' => 'topic',
159
+ 'to_fieldname' => '_bbp_forum_id',
160
+ 'callback_method' => 'callback_forumid'
161
+ );
162
+
163
+ // Topic author.
164
+ $this->field_map[] = array(
165
+ 'from_tablename' => 'messages',
166
+ 'from_fieldname' => 'user_id',
167
+ 'to_type' => 'topic',
168
+ 'to_fieldname' => 'post_author',
169
+ 'callback_method' => 'callback_userid'
170
+ );
171
+
172
+ // Topic Author ip (Stored in postmeta)
173
+ $this->field_map[] = array(
174
+ 'from_tablename' => 'messages',
175
+ 'from_fieldname' => 'ip',
176
+ 'to_type' => 'topic',
177
+ 'to_fieldname' => '_bbp_author_ip'
178
+ );
179
+
180
+ // Topic content.
181
+ $this->field_map[] = array(
182
+ 'from_tablename' => 'messages',
183
+ 'from_fieldname' => 'body',
184
+ 'to_type' => 'topic',
185
+ 'to_fieldname' => 'post_content',
186
+ 'callback_method' => 'callback_html'
187
+ );
188
+
189
+ // Topic title.
190
+ $this->field_map[] = array(
191
+ 'from_tablename' => 'messages',
192
+ 'from_fieldname' => 'subject',
193
+ 'to_type' => 'topic',
194
+ 'to_fieldname' => 'post_title'
195
+ );
196
+
197
+ // Topic slug (Clean name to avoid conflicts)
198
+ $this->field_map[] = array(
199
+ 'from_tablename' => 'messages',
200
+ 'from_fieldname' => 'subject',
201
+ 'to_type' => 'topic',
202
+ 'to_fieldname' => 'post_name',
203
+ 'callback_method' => 'callback_slug'
204
+ );
205
+
206
+ // Topic parent forum id (If no parent, then 0)
207
+ $this->field_map[] = array(
208
+ 'from_tablename' => 'messages',
209
+ 'from_fieldname' => 'forum_id',
210
+ 'to_type' => 'topic',
211
+ 'to_fieldname' => 'post_parent',
212
+ 'callback_method' => 'callback_forumid'
213
+ );
214
+
215
+ // Topic dates.
216
+ $this->field_map[] = array(
217
+ 'from_tablename' => 'messages',
218
+ 'from_fieldname' => 'datestamp',
219
+ 'to_type' => 'topic',
220
+ 'to_fieldname' => 'post_date',
221
+ 'callback_method' => 'callback_datetime'
222
+ );
223
+ $this->field_map[] = array(
224
+ 'from_tablename' => 'messages',
225
+ 'from_fieldname' => 'datestamp',
226
+ 'to_type' => 'topic',
227
+ 'to_fieldname' => 'post_date_gmt',
228
+ 'callback_method' => 'callback_datetime'
229
+ );
230
+ $this->field_map[] = array(
231
+ 'from_tablename' => 'messages',
232
+ 'from_fieldname' => 'datestamp',
233
+ 'to_type' => 'topic',
234
+ 'to_fieldname' => 'post_modified',
235
+ 'callback_method' => 'callback_datetime'
236
+ );
237
+ $this->field_map[] = array(
238
+ 'from_tablename' => 'messages',
239
+ 'from_fieldname' => 'datestamp',
240
+ 'to_type' => 'topic',
241
+ 'to_fieldname' => 'post_modified_gmt',
242
+ 'callback_method' => 'callback_datetime'
243
+ );
244
+ $this->field_map[] = array(
245
+ 'from_tablename' => 'messages',
246
+ 'from_fieldname' => 'datestamp',
247
+ 'to_type' => 'topic',
248
+ 'to_fieldname' => '_bbp_last_active_time',
249
+ 'callback_method' => 'callback_datetime'
250
+ );
251
+
252
+ // Topic status (Open = 0 or Closed = 1)
253
+ $this->field_map[] = array(
254
+ 'from_tablename' => 'messages',
255
+ 'from_fieldname' => 'closed',
256
+ 'to_type' => 'topic',
257
+ 'to_fieldname' => 'post_status',
258
+ 'callback_method' => 'callback_topic_status'
259
+ );
260
+
261
+ /** Tags Section ******************************************************/
262
+
263
+ /**
264
+ * Phorum v5.2.19 Forums do not support topic tags out of the box
265
+ */
266
+
267
+ /** Reply Section *****************************************************/
268
+
269
+ // Reply id (Stored in postmeta)
270
+ $this->field_map[] = array(
271
+ 'from_tablename' => 'messages',
272
+ 'from_fieldname' => 'message_id',
273
+ 'from_expression' => 'WHERE parent_id != 0',
274
+ 'to_type' => 'reply',
275
+ 'to_fieldname' => '_bbp_post_id'
276
+ );
277
+
278
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
279
+ $this->field_map[] = array(
280
+ 'from_tablename' => 'messages',
281
+ 'from_fieldname' => 'forum_id',
282
+ 'to_type' => 'reply',
283
+ 'to_fieldname' => '_bbp_forum_id',
284
+ 'callback_method' => 'callback_topicid_to_forumid'
285
+ );
286
+
287
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
288
+ $this->field_map[] = array(
289
+ 'from_tablename' => 'messages',
290
+ 'from_fieldname' => 'thread',
291
+ 'to_type' => 'reply',
292
+ 'to_fieldname' => '_bbp_topic_id',
293
+ 'callback_method' => 'callback_topicid'
294
+ );
295
+
296
+ // Reply author ip (Stored in postmeta)
297
+ $this->field_map[] = array(
298
+ 'from_tablename' => 'messages',
299
+ 'from_fieldname' => 'ip',
300
+ 'to_type' => 'reply',
301
+ 'to_fieldname' => '_bbp_author_ip'
302
+ );
303
+
304
+ // Reply author.
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'messages',
307
+ 'from_fieldname' => 'user_id',
308
+ 'to_type' => 'reply',
309
+ 'to_fieldname' => 'post_author',
310
+ 'callback_method' => 'callback_userid'
311
+ );
312
+
313
+ // Reply title.
314
+ $this->field_map[] = array(
315
+ 'from_tablename' => 'messages',
316
+ 'from_fieldname' => 'subject',
317
+ 'to_type' => 'reply',
318
+ 'to_fieldname' => 'post_title'
319
+ );
320
+
321
+ // Reply slug (Clean name to avoid conflicts)
322
+ $this->field_map[] = array(
323
+ 'from_tablename' => 'messages',
324
+ 'from_fieldname' => 'subject',
325
+ 'to_type' => 'reply',
326
+ 'to_fieldname' => 'post_name',
327
+ 'callback_method' => 'callback_slug'
328
+ );
329
+
330
+ // Reply content.
331
+ $this->field_map[] = array(
332
+ 'from_tablename' => 'messages',
333
+ 'from_fieldname' => 'body',
334
+ 'to_type' => 'reply',
335
+ 'to_fieldname' => 'post_content',
336
+ 'callback_method' => 'callback_html'
337
+ );
338
+
339
+ // Reply parent topic id (If no parent, then 0)
340
+ $this->field_map[] = array(
341
+ 'from_tablename' => 'messages',
342
+ 'from_fieldname' => 'thread',
343
+ 'to_type' => 'reply',
344
+ 'to_fieldname' => 'post_parent',
345
+ 'callback_method' => 'callback_topicid'
346
+ );
347
+
348
+ // Reply dates.
349
+ $this->field_map[] = array(
350
+ 'from_tablename' => 'messages',
351
+ 'from_fieldname' => 'datestamp',
352
+ 'to_type' => 'reply',
353
+ 'to_fieldname' => 'post_date',
354
+ 'callback_method' => 'callback_datetime'
355
+ );
356
+ $this->field_map[] = array(
357
+ 'from_tablename' => 'messages',
358
+ 'from_fieldname' => 'datestamp',
359
+ 'to_type' => 'reply',
360
+ 'to_fieldname' => 'post_date_gmt',
361
+ 'callback_method' => 'callback_datetime'
362
+ );
363
+ $this->field_map[] = array(
364
+ 'from_tablename' => 'messages',
365
+ 'from_fieldname' => 'datestamp',
366
+ 'to_type' => 'reply',
367
+ 'to_fieldname' => 'post_modified',
368
+ 'callback_method' => 'callback_datetime'
369
+ );
370
+ $this->field_map[] = array(
371
+ 'from_tablename' => 'messages',
372
+ 'from_fieldname' => 'datestamp',
373
+ 'to_type' => 'reply',
374
+ 'to_fieldname' => 'post_modified_gmt',
375
+ 'callback_method' => 'callback_datetime'
376
+ );
377
+
378
+ /** User Section ******************************************************/
379
+
380
+ // Store old User id (Stored in usermeta)
381
+ $this->field_map[] = array(
382
+ 'from_tablename' => 'users',
383
+ 'from_fieldname' => 'user_id',
384
+ 'to_type' => 'user',
385
+ 'to_fieldname' => '_bbp_user_id'
386
+ );
387
+
388
+ // Store old User password (Stored in usermeta serialized with salt)
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'users',
391
+ 'from_fieldname' => 'password',
392
+ 'to_type' => 'user',
393
+ 'to_fieldname' => '_bbp_password',
394
+ 'callback_method' => 'callback_savepass'
395
+ );
396
+
397
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
398
+ // $this->field_map[] = array(
399
+ // 'from_tablename' => 'users',
400
+ // 'from_fieldname' => 'salt',
401
+ // 'to_type' => 'user',
402
+ // 'to_fieldname' => ''
403
+ // );
404
+
405
+ // User password verify class (Stored in usermeta for verifying password)
406
+ $this->field_map[] = array(
407
+ 'to_type' => 'users',
408
+ 'to_fieldname' => '_bbp_class',
409
+ 'default' => 'Phorum'
410
+ );
411
+
412
+ // User name.
413
+ $this->field_map[] = array(
414
+ 'from_tablename' => 'users',
415
+ 'from_fieldname' => 'username',
416
+ 'to_type' => 'user',
417
+ 'to_fieldname' => 'user_login'
418
+ );
419
+
420
+ // User nice name.
421
+ $this->field_map[] = array(
422
+ 'from_tablename' => 'users',
423
+ 'from_fieldname' => 'display_name',
424
+ 'to_type' => 'user',
425
+ 'to_fieldname' => 'user_nicename'
426
+ );
427
+
428
+ // User email.
429
+ $this->field_map[] = array(
430
+ 'from_tablename' => 'users',
431
+ 'from_fieldname' => 'email',
432
+ 'to_type' => 'user',
433
+ 'to_fieldname' => 'user_email'
434
+ );
435
+
436
+ // User registered.
437
+ $this->field_map[] = array(
438
+ 'from_tablename' => 'users',
439
+ 'from_fieldname' => 'date_added',
440
+ 'to_type' => 'user',
441
+ 'to_fieldname' => 'user_registered',
442
+ 'callback_method' => 'callback_datetime'
443
+ );
444
+
445
+ // User display name.
446
+ $this->field_map[] = array(
447
+ 'from_tablename' => 'users',
448
+ 'from_fieldname' => 'real_name',
449
+ 'to_type' => 'user',
450
+ 'to_fieldname' => 'display_name'
451
+ );
452
+
453
+ // Store Signature (Stored in usermeta)
454
+ $this->field_map[] = array(
455
+ 'from_tablename' => 'users',
456
+ 'from_fieldname' => 'signature',
457
+ 'to_type' => 'user',
458
+ 'to_fieldname' => '_bbp_phorum_user_sig',
459
+ 'callback_method' => 'callback_html'
460
+ );
461
+
462
+ }
463
+
464
+ /**
465
+ * This method allows us to indicates what is or is not converted for each
466
+ * converter.
467
+ */
468
+ public function info()
469
+ {
470
+ return '';
471
+ }
472
+
473
+ /**
474
+ * This method is to save the salt and password together. That
475
+ * way when we authenticate it we can get it out of the database
476
+ * as one value. Array values are auto sanitized by WordPress.
477
+ */
478
+ public function callback_savepass( $field, $row )
479
+ {
480
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
481
+ return $pass_array;
482
+ }
483
+
484
+ /**
485
+ * This method is to take the pass out of the database and compare
486
+ * to a pass the user has typed in.
487
+ */
488
+ public function authenticate_pass( $password, $serialized_pass )
489
+ {
490
+ $pass_array = unserialize( $serialized_pass );
491
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
492
+ }
493
+
494
+ /**
495
+ * Translate the forum type from Phorum v5.2.19 numeric's to WordPress's strings.
496
+ *
497
+ * @param int $status Phorum v5.2.19 numeric forum type
498
+ * @return string WordPress safe
499
+ */
500
+ public function callback_forum_type( $status = 0 ) {
501
+ switch ( $status ) {
502
+ case 1 :
503
+ $status = 'category';
504
+ break;
505
+
506
+ case 0 :
507
+ default :
508
+ $status = 'forum';
509
+ break;
510
+ }
511
+ return $status;
512
+ }
513
+
514
+ /**
515
+ * Translate the post status from Phorum v5.2.19 numeric's to WordPress's strings.
516
+ *
517
+ * @param int $status Phorum v5.2.19 numeric topic status
518
+ * @return string WordPress safe
519
+ */
520
+ public function callback_topic_status( $status = 0 ) {
521
+ switch ( $status ) {
522
+ case 1 :
523
+ $status = 'closed';
524
+ break;
525
+
526
+ case 0 :
527
+ default :
528
+ $status = 'publish';
529
+ break;
530
+ }
531
+ return $status;
532
+ }
533
+
534
+ /**
535
+ * Verify the topic/reply count.
536
+ *
537
+ * @param int $count Phorum v5.2.19 topic/reply counts
538
+ * @return string WordPress safe
539
+ */
540
+ public function callback_topic_reply_count( $count = 1 ) {
541
+ $count = absint( (int) $count - 1 );
542
+ return $count;
543
+ }
544
+
545
+ }
includes/admin/converters/PunBB.php ADDED
@@ -0,0 +1,680 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of PunBB v1.4.2 Forum converter.
5
+ *
6
+ * @since bbPress (r5153)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/punbb
8
+ */
9
+ class PunBB extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses PunBB::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' => 'forums',
31
+ 'from_fieldname' => 'id',
32
+ 'to_type' => 'forum',
33
+ 'to_fieldname' => '_bbp_forum_id'
34
+ );
35
+
36
+ // Forum topic count (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'forums',
39
+ 'from_fieldname' => 'num_topics',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_topic_count'
42
+ );
43
+
44
+ // Forum reply count (Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'forums',
47
+ 'from_fieldname' => 'num_posts',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_reply_count'
50
+ );
51
+
52
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
53
+ $this->field_map[] = array(
54
+ 'from_tablename' => 'forums',
55
+ 'from_fieldname' => 'num_topics',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_total_topic_count'
58
+ );
59
+
60
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'num_posts',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_total_reply_count'
66
+ );
67
+
68
+ // Forum title.
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'forum_name',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => 'post_title'
74
+ );
75
+
76
+ // Forum slug (Clean name to avoid conflicts)
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'forums',
79
+ 'from_fieldname' => 'forum_name',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => 'post_name',
82
+ 'callback_method' => 'callback_slug'
83
+ );
84
+
85
+ // Forum description.
86
+ $this->field_map[] = array(
87
+ 'from_tablename' => 'forums',
88
+ 'from_fieldname' => 'forum_desc',
89
+ 'to_type' => 'forum',
90
+ 'to_fieldname' => 'post_content',
91
+ 'callback_method' => 'callback_null'
92
+ );
93
+
94
+ // Forum display order (Starts from 1)
95
+ $this->field_map[] = array(
96
+ 'from_tablename' => 'forums',
97
+ 'from_fieldname' => 'disp_position',
98
+ 'to_type' => 'forum',
99
+ 'to_fieldname' => 'menu_order'
100
+ );
101
+
102
+ // Forum dates.
103
+ $this->field_map[] = array(
104
+ 'to_type' => 'forum',
105
+ 'to_fieldname' => 'post_date',
106
+ 'default' => date('Y-m-d H:i:s')
107
+ );
108
+ $this->field_map[] = array(
109
+ 'to_type' => 'forum',
110
+ 'to_fieldname' => 'post_date_gmt',
111
+ 'default' => date('Y-m-d H:i:s')
112
+ );
113
+ $this->field_map[] = array(
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'post_modified',
116
+ 'default' => date('Y-m-d H:i:s')
117
+ );
118
+ $this->field_map[] = array(
119
+ 'to_type' => 'forum',
120
+ 'to_fieldname' => 'post_modified_gmt',
121
+ 'default' => date('Y-m-d H:i:s')
122
+ );
123
+
124
+ /** Topic Section *****************************************************/
125
+
126
+ // Topic id (Stored in postmeta)
127
+ $this->field_map[] = array(
128
+ 'from_tablename' => 'topics',
129
+ 'from_fieldname' => 'id',
130
+ 'to_type' => 'topic',
131
+ 'to_fieldname' => '_bbp_topic_id'
132
+ );
133
+
134
+ // Topic reply count (Stored in postmeta)
135
+ $this->field_map[] = array(
136
+ 'from_tablename' => 'topics',
137
+ 'from_fieldname' => 'num_replies',
138
+ 'to_type' => 'topic',
139
+ 'to_fieldname' => '_bbp_reply_count',
140
+ 'callback_method' => 'callback_topic_reply_count'
141
+ );
142
+
143
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
144
+ $this->field_map[] = array(
145
+ 'from_tablename' => 'topics',
146
+ 'from_fieldname' => 'num_replies',
147
+ 'to_type' => 'topic',
148
+ 'to_fieldname' => '_bbp_total_reply_count',
149
+ 'callback_method' => 'callback_topic_reply_count'
150
+ );
151
+
152
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
153
+ $this->field_map[] = array(
154
+ 'from_tablename' => 'topics',
155
+ 'from_fieldname' => 'forum_id',
156
+ 'to_type' => 'topic',
157
+ 'to_fieldname' => '_bbp_forum_id',
158
+ 'callback_method' => 'callback_forumid'
159
+ );
160
+
161
+ // Topic author.
162
+ // Note: We join the 'posts' table because 'topics' table does not have user id's.
163
+ $this->field_map[] = array(
164
+ 'from_tablename' => 'posts',
165
+ 'from_fieldname' => 'poster_id',
166
+ 'join_tablename' => 'topics',
167
+ 'join_type' => 'LEFT',
168
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
169
+ 'to_type' => 'topic',
170
+ 'to_fieldname' => 'post_author',
171
+ 'callback_method' => 'callback_userid'
172
+ );
173
+
174
+ // Topic Author ip (Stored in postmeta)
175
+ // Note: We join the 'posts' table because 'topics' table does not have author ip.
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'posts',
178
+ 'from_fieldname' => 'poster_ip',
179
+ 'join_tablename' => 'topics',
180
+ 'join_type' => 'LEFT',
181
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
182
+ 'to_type' => 'topic',
183
+ 'to_fieldname' => '_bbp_author_ip'
184
+ );
185
+
186
+ // Topic content.
187
+ // Note: We join the 'posts' table because 'topics' table does not have content.
188
+ $this->field_map[] = array(
189
+ 'from_tablename' => 'posts',
190
+ 'from_fieldname' => 'message',
191
+ 'join_tablename' => 'topics',
192
+ 'join_type' => 'LEFT',
193
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
194
+ 'to_type' => 'topic',
195
+ 'to_fieldname' => 'post_content',
196
+ 'callback_method' => 'callback_html'
197
+ );
198
+
199
+ // Topic title.
200
+ $this->field_map[] = array(
201
+ 'from_tablename' => 'topics',
202
+ 'from_fieldname' => 'subject',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => 'post_title'
205
+ );
206
+
207
+ // Topic slug (Clean name to avoid conflicts)
208
+ $this->field_map[] = array(
209
+ 'from_tablename' => 'topics',
210
+ 'from_fieldname' => 'subject',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => 'post_name',
213
+ 'callback_method' => 'callback_slug'
214
+ );
215
+
216
+ // Topic parent forum id (If no parent, then 0)
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'topics',
219
+ 'from_fieldname' => 'forum_id',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_parent',
222
+ 'callback_method' => 'callback_forumid'
223
+ );
224
+
225
+ // Topic status (Open or Closed, PunBB v1.4.2 0=open & 1=closed)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'topics',
228
+ 'from_fieldname' => 'closed',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_status',
231
+ 'callback_method' => 'callback_topic_status'
232
+ );
233
+
234
+ // Sticky status (Stored in postmeta))
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'topics',
237
+ 'from_fieldname' => 'sticky',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => '_bbp_old_sticky_status',
240
+ 'callback_method' => 'callback_sticky_status'
241
+ );
242
+ // Topic dates.
243
+ $this->field_map[] = array(
244
+ 'from_tablename' => 'topics',
245
+ 'from_fieldname' => 'posted',
246
+ 'to_type' => 'topic',
247
+ 'to_fieldname' => 'post_date',
248
+ 'callback_method' => 'callback_datetime'
249
+ );
250
+ $this->field_map[] = array(
251
+ 'from_tablename' => 'topics',
252
+ 'from_fieldname' => 'posted',
253
+ 'to_type' => 'topic',
254
+ 'to_fieldname' => 'post_date_gmt',
255
+ 'callback_method' => 'callback_datetime'
256
+ );
257
+ $this->field_map[] = array(
258
+ 'from_tablename' => 'topics',
259
+ 'from_fieldname' => 'last_post',
260
+ 'to_type' => 'topic',
261
+ 'to_fieldname' => 'post_modified',
262
+ 'callback_method' => 'callback_datetime'
263
+ );
264
+ $this->field_map[] = array(
265
+ 'from_tablename' => 'topics',
266
+ 'from_fieldname' => 'last_post',
267
+ 'to_type' => 'topic',
268
+ 'to_fieldname' => 'post_modified_gmt',
269
+ 'callback_method' => 'callback_datetime'
270
+ );
271
+ $this->field_map[] = array(
272
+ 'from_tablename' => 'topics',
273
+ 'from_fieldname' => 'last_post',
274
+ 'to_type' => 'topic',
275
+ 'to_fieldname' => '_bbp_last_active_time',
276
+ 'callback_method' => 'callback_datetime'
277
+ );
278
+
279
+ /** Tags Section ******************************************************/
280
+
281
+ /**
282
+ * PunBB v1.4.2 Forums do not support topic tags out of the box
283
+ */
284
+
285
+ /** Reply Section *****************************************************/
286
+
287
+ // Reply id (Stored in postmeta)
288
+ $this->field_map[] = array(
289
+ 'from_tablename' => 'posts',
290
+ 'from_fieldname' => 'id',
291
+ 'to_type' => 'reply',
292
+ 'to_fieldname' => '_bbp_post_id'
293
+ );
294
+
295
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
296
+ // Note: We join the 'topics' table because 'posts' table does not have parent forum id's.
297
+ $this->field_map[] = array(
298
+ 'from_tablename' => 'topics',
299
+ 'from_fieldname' => 'forum_id',
300
+ 'join_tablename' => 'posts',
301
+ 'join_type' => 'LEFT',
302
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
303
+ 'to_type' => 'reply',
304
+ 'to_fieldname' => '_bbp_forum_id',
305
+ 'callback_method' => 'callback_topicid_to_forumid'
306
+ );
307
+
308
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
309
+ $this->field_map[] = array(
310
+ 'from_tablename' => 'posts',
311
+ 'from_fieldname' => 'topic_id',
312
+ 'to_type' => 'reply',
313
+ 'to_fieldname' => '_bbp_topic_id',
314
+ 'callback_method' => 'callback_topicid'
315
+ );
316
+
317
+ // Reply author ip (Stored in postmeta)
318
+ $this->field_map[] = array(
319
+ 'from_tablename' => 'posts',
320
+ 'from_fieldname' => 'poster_ip',
321
+ 'to_type' => 'reply',
322
+ 'to_fieldname' => '_bbp_author_ip'
323
+ );
324
+
325
+ // Reply author.
326
+ $this->field_map[] = array(
327
+ 'from_tablename' => 'posts',
328
+ 'from_fieldname' => 'poster_id',
329
+ 'to_type' => 'reply',
330
+ 'to_fieldname' => 'post_author',
331
+ 'callback_method' => 'callback_userid'
332
+ );
333
+
334
+ // Reply title.
335
+ // Note: We join the 'topics' table because 'posts' table does not have topic subject.
336
+ $this->field_map[] = array(
337
+ 'from_tablename' => 'topics',
338
+ 'from_fieldname' => 'subject',
339
+ 'join_tablename' => 'posts',
340
+ 'join_type' => 'LEFT',
341
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
342
+ 'to_type' => 'reply',
343
+ 'to_fieldname' => 'post_title',
344
+ 'callback_method' => 'callback_reply_title'
345
+ );
346
+
347
+ // Reply slug (Clean name to avoid conflicts)
348
+ // Note: We join the 'topics' table because 'posts' table does not have topic subject.
349
+ $this->field_map[] = array(
350
+ 'from_tablename' => 'topics',
351
+ 'from_fieldname' => 'subject',
352
+ 'join_tablename' => 'posts',
353
+ 'join_type' => 'LEFT',
354
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
355
+ 'to_type' => 'reply',
356
+ 'to_fieldname' => 'post_name',
357
+ 'callback_method' => 'callback_slug'
358
+ );
359
+
360
+ // Reply content.
361
+ $this->field_map[] = array(
362
+ 'from_tablename' => 'posts',
363
+ 'from_fieldname' => 'message',
364
+ 'to_type' => 'reply',
365
+ 'to_fieldname' => 'post_content',
366
+ 'callback_method' => 'callback_html'
367
+ );
368
+
369
+ // Reply parent topic id (If no parent, then 0)
370
+ $this->field_map[] = array(
371
+ 'from_tablename' => 'posts',
372
+ 'from_fieldname' => 'topic_id',
373
+ 'to_type' => 'reply',
374
+ 'to_fieldname' => 'post_parent',
375
+ 'callback_method' => 'callback_topicid'
376
+ );
377
+
378
+ // Reply dates.
379
+ $this->field_map[] = array(
380
+ 'from_tablename' => 'posts',
381
+ 'from_fieldname' => 'posted',
382
+ 'to_type' => 'reply',
383
+ 'to_fieldname' => 'post_date',
384
+ 'callback_method' => 'callback_datetime'
385
+ );
386
+ $this->field_map[] = array(
387
+ 'from_tablename' => 'posts',
388
+ 'from_fieldname' => 'posted',
389
+ 'to_type' => 'reply',
390
+ 'to_fieldname' => 'post_date_gmt',
391
+ 'callback_method' => 'callback_datetime'
392
+ );
393
+ $this->field_map[] = array(
394
+ 'from_tablename' => 'posts',
395
+ 'from_fieldname' => 'edited',
396
+ 'to_type' => 'reply',
397
+ 'to_fieldname' => 'post_modified',
398
+ 'callback_method' => 'callback_datetime'
399
+ );
400
+ $this->field_map[] = array(
401
+ 'from_tablename' => 'posts',
402
+ 'from_fieldname' => 'edited',
403
+ 'to_type' => 'reply',
404
+ 'to_fieldname' => 'post_modified_gmt',
405
+ 'callback_method' => 'callback_datetime'
406
+ );
407
+
408
+ /** User Section ******************************************************/
409
+
410
+ // Store old User id (Stored in usermeta)
411
+ $this->field_map[] = array(
412
+ 'from_tablename' => 'users',
413
+ 'from_fieldname' => 'id',
414
+ 'to_type' => 'user',
415
+ 'to_fieldname' => '_bbp_user_id'
416
+ );
417
+
418
+ // Store old User password (Stored in usermeta serialized with salt)
419
+ $this->field_map[] = array(
420
+ 'from_tablename' => 'users',
421
+ 'from_fieldname' => 'password',
422
+ 'to_type' => 'user',
423
+ 'to_fieldname' => '_bbp_password',
424
+ 'callback_method' => 'callback_savepass'
425
+ );
426
+
427
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
428
+ $this->field_map[] = array(
429
+ 'from_tablename' => 'users',
430
+ 'from_fieldname' => 'salt',
431
+ 'to_type' => 'user',
432
+ 'to_fieldname' => ''
433
+ );
434
+
435
+ // User password verify class (Stored in usermeta for verifying password)
436
+ $this->field_map[] = array(
437
+ 'to_type' => 'users',
438
+ 'to_fieldname' => '_bbp_class',
439
+ 'default' => 'PunBB'
440
+ );
441
+
442
+ // User name.
443
+ $this->field_map[] = array(
444
+ 'from_tablename' => 'users',
445
+ 'from_fieldname' => 'username',
446
+ 'to_type' => 'user',
447
+ 'to_fieldname' => 'user_login'
448
+ );
449
+
450
+ // User nice name.
451
+ $this->field_map[] = array(
452
+ 'from_tablename' => 'users',
453
+ 'from_fieldname' => 'username',
454
+ 'to_type' => 'user',
455
+ 'to_fieldname' => 'user_nicename'
456
+ );
457
+
458
+ // User email.
459
+ $this->field_map[] = array(
460
+ 'from_tablename' => 'users',
461
+ 'from_fieldname' => 'email',
462
+ 'to_type' => 'user',
463
+ 'to_fieldname' => 'user_email'
464
+ );
465
+
466
+ // User homepage.
467
+ $this->field_map[] = array(
468
+ 'from_tablename' => 'users',
469
+ 'from_fieldname' => 'url',
470
+ 'to_type' => 'user',
471
+ 'to_fieldname' => 'user_url'
472
+ );
473
+
474
+ // User registered.
475
+ $this->field_map[] = array(
476
+ 'from_tablename' => 'users',
477
+ 'from_fieldname' => 'registered',
478
+ 'to_type' => 'user',
479
+ 'to_fieldname' => 'user_registered',
480
+ 'callback_method' => 'callback_datetime'
481
+ );
482
+
483
+ // User display name.
484
+ $this->field_map[] = array(
485
+ 'from_tablename' => 'users',
486
+ 'from_fieldname' => 'realname',
487
+ 'to_type' => 'user',
488
+ 'to_fieldname' => 'display_name'
489
+ );
490
+
491
+ // User AIM (Stored in usermeta)
492
+ $this->field_map[] = array(
493
+ 'from_tablename' => 'users',
494
+ 'from_fieldname' => 'aim',
495
+ 'to_type' => 'user',
496
+ 'to_fieldname' => 'aim'
497
+ );
498
+
499
+ // User Yahoo (Stored in usermeta)
500
+ $this->field_map[] = array(
501
+ 'from_tablename' => 'users',
502
+ 'from_fieldname' => 'yahoo',
503
+ 'to_type' => 'user',
504
+ 'to_fieldname' => 'yim'
505
+ );
506
+
507
+ // Store Jabber
508
+ $this->field_map[] = array(
509
+ 'from_tablename' => 'users',
510
+ 'from_fieldname' => 'jabber',
511
+ 'to_type' => 'user',
512
+ 'to_fieldname' => 'jabber'
513
+ );
514
+
515
+ // Store ICQ (Stored in usermeta)
516
+ $this->field_map[] = array(
517
+ 'from_tablename' => 'users',
518
+ 'from_fieldname' => 'icq',
519
+ 'to_type' => 'user',
520
+ 'to_fieldname' => '_bbp_punbb_user_icq'
521
+ );
522
+
523
+ // Store MSN (Stored in usermeta)
524
+ $this->field_map[] = array(
525
+ 'from_tablename' => 'users',
526
+ 'from_fieldname' => 'msn',
527
+ 'to_type' => 'user',
528
+ 'to_fieldname' => '_bbp_punbb_user_msn'
529
+ );
530
+
531
+ // Store Facebook (Stored in usermeta)
532
+ $this->field_map[] = array(
533
+ 'from_tablename' => 'users',
534
+ 'from_fieldname' => 'facebook',
535
+ 'to_type' => 'user',
536
+ 'to_fieldname' => '_bbp_punbb_user_facebook'
537
+ );
538
+
539
+ // Store Twitter (Stored in usermeta)
540
+ $this->field_map[] = array(
541
+ 'from_tablename' => 'users',
542
+ 'from_fieldname' => 'twitter',
543
+ 'to_type' => 'user',
544
+ 'to_fieldname' => '_bbp_punbb_user_twitter'
545
+ );
546
+
547
+ // Store LinkedIn (Stored in usermeta)
548
+ $this->field_map[] = array(
549
+ 'from_tablename' => 'users',
550
+ 'from_fieldname' => 'linkedin',
551
+ 'to_type' => 'user',
552
+ 'to_fieldname' => '_bbp_punbb_user_linkedin'
553
+ );
554
+
555
+ // Store Skype (Stored in usermeta)
556
+ $this->field_map[] = array(
557
+ 'from_tablename' => 'users',
558
+ 'from_fieldname' => 'skype',
559
+ 'to_type' => 'user',
560
+ 'to_fieldname' => '_bbp_punbb_user_skype'
561
+ );
562
+
563
+ // Store Signature (Stored in usermeta)
564
+ $this->field_map[] = array(
565
+ 'from_tablename' => 'users',
566
+ 'from_fieldname' => 'signature',
567
+ 'to_type' => 'user',
568
+ 'to_fieldname' => '_bbp_punbb_user_sig',
569
+ 'callback_method' => 'callback_html'
570
+ );
571
+
572
+ // Store Location (Stored in usermeta)
573
+ $this->field_map[] = array(
574
+ 'from_tablename' => 'users',
575
+ 'from_fieldname' => 'location',
576
+ 'to_type' => 'user',
577
+ 'to_fieldname' => '_bbp_punbb_user_from'
578
+ );
579
+
580
+ // Store Admin Note (Stored in usermeta)
581
+ $this->field_map[] = array(
582
+ 'from_tablename' => 'users',
583
+ 'from_fieldname' => 'admin_note',
584
+ 'to_type' => 'user',
585
+ 'to_fieldname' => '_bbp_punbb_user_admin_note'
586
+ );
587
+ }
588
+
589
+ /**
590
+ * This method allows us to indicates what is or is not converted for each
591
+ * converter.
592
+ */
593
+ public function info()
594
+ {
595
+ return '';
596
+ }
597
+
598
+ /**
599
+ * This method is to save the salt and password together. That
600
+ * way when we authenticate it we can get it out of the database
601
+ * as one value. Array values are auto sanitized by WordPress.
602
+ */
603
+ public function callback_savepass( $field, $row )
604
+ {
605
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
606
+ return $pass_array;
607
+ }
608
+
609
+ /**
610
+ * This method is to take the pass out of the database and compare
611
+ * to a pass the user has typed in.
612
+ */
613
+ public function authenticate_pass( $password, $serialized_pass )
614
+ {
615
+ $pass_array = unserialize( $serialized_pass );
616
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
617
+ }
618
+
619
+ /**
620
+ * Translate the post status from PunBB v1.4.2 numeric's to WordPress's strings.
621
+ *
622
+ * @param int $status PunBB v1.4.2 numeric topic status
623
+ * @return string WordPress safe
624
+ */
625
+ public function callback_topic_status( $status = 0 ) {
626
+ switch ( $status ) {
627
+ case 1 :
628
+ $status = 'closed';
629
+ break;
630
+
631
+ case 0 :
632
+ default :
633
+ $status = 'publish';
634
+ break;
635
+ }
636
+ return $status;
637
+ }
638
+
639
+ /**
640
+ * Translate the topic sticky status type from PunBB v1.4.2 numeric's to WordPress's strings.
641
+ *
642
+ * @param int $status PunBB v1.4.2 numeric forum type
643
+ * @return string WordPress safe
644
+ */
645
+ public function callback_sticky_status( $status = 0 ) {
646
+ switch ( $status ) {
647
+ case 1 :
648
+ $status = 'sticky'; // PunBB Sticky 'topic_sticky = 1'
649
+ break;
650
+
651
+ case 0 :
652
+ default :
653
+ $status = 'normal'; // PunBB Normal Topic 'topic_sticky = 0'
654
+ break;
655
+ }
656
+ return $status;
657
+ }
658
+
659
+ /**
660
+ * Verify the topic/reply count.
661
+ *
662
+ * @param int $count PunBB v1.4.2 topic/reply counts
663
+ * @return string WordPress safe
664
+ */
665
+ public function callback_topic_reply_count( $count = 1 ) {
666
+ $count = absint( (int) $count - 1 );
667
+ return $count;
668
+ }
669
+
670
+ /**
671
+ * Set the reply title
672
+ *
673
+ * @param string $title PunBB v1.4.2 topic title of this reply
674
+ * @return string Prefixed topic title, or empty string
675
+ */
676
+ public function callback_reply_title( $title = '' ) {
677
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
678
+ return $title;
679
+ }
680
+ }
includes/admin/converters/SMF.php ADDED
@@ -0,0 +1,740 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of SMF Forum converter.
5
+ *
6
+ * @since bbPress (r5189)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/smf
8
+ */
9
+ class SMF extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses SMF::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' => 'boards',
31
+ 'from_fieldname' => 'id_board',
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' => 'boards',
39
+ 'from_fieldname' => 'id_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' => 'boards',
47
+ 'from_fieldname' => 'num_topics',
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' => 'boards',
55
+ 'from_fieldname' => 'num_posts',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_reply_count'
58
+ );
59
+
60
+ // Forum total topic count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'boards',
63
+ 'from_fieldname' => 'num_topics',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_total_topic_count'
66
+ );
67
+
68
+ // Forum total reply count (Stored in postmeta)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'boards',
71
+ 'from_fieldname' => 'num_posts',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_reply_count'
74
+ );
75
+
76
+ // Forum title.
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'boards',
79
+ 'from_fieldname' => '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' => 'boards',
87
+ 'from_fieldname' => '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' => 'boards',
96
+ 'from_fieldname' => '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' => 'boards',
105
+ 'from_fieldname' => 'board_order',
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'menu_order'
108
+ );
109
+
110
+ // Forum dates.
111
+ $this->field_map[] = array(
112
+ 'to_type' => 'forum',
113
+ 'to_fieldname' => 'post_date',
114
+ 'default' => date('Y-m-d H:i:s')
115
+ );
116
+ $this->field_map[] = array(
117
+ 'to_type' => 'forum',
118
+ 'to_fieldname' => 'post_date_gmt',
119
+ 'default' => date('Y-m-d H:i:s')
120
+ );
121
+ $this->field_map[] = array(
122
+ 'to_type' => 'forum',
123
+ 'to_fieldname' => 'post_modified',
124
+ 'default' => date('Y-m-d H:i:s')
125
+ );
126
+ $this->field_map[] = array(
127
+ 'to_type' => 'forum',
128
+ 'to_fieldname' => 'post_modified_gmt',
129
+ 'default' => date('Y-m-d H:i:s')
130
+ );
131
+
132
+ /** Topic Section ******************************************************/
133
+
134
+ // Topic id (Stored in postmeta)
135
+ $this->field_map[] = array(
136
+ 'from_tablename' => 'topics',
137
+ 'from_fieldname' => 'id_topic',
138
+ 'to_type' => 'topic',
139
+ 'to_fieldname' => '_bbp_topic_id'
140
+ );
141
+
142
+ // Topic reply count (Stored in postmeta)
143
+ $this->field_map[] = array(
144
+ 'from_tablename' => 'topics',
145
+ 'from_fieldname' => 'num_replies',
146
+ 'to_type' => 'topic',
147
+ 'to_fieldname' => '_bbp_reply_count',
148
+ 'callback_method' => 'callback_topic_reply_count'
149
+ );
150
+
151
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
152
+ $this->field_map[] = array(
153
+ 'from_tablename' => 'topics',
154
+ 'from_fieldname' => 'num_replies',
155
+ 'to_type' => 'topic',
156
+ 'to_fieldname' => '_bbp_total_reply_count',
157
+ 'callback_method' => 'callback_topic_reply_count'
158
+ );
159
+
160
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'topics',
163
+ 'from_fieldname' => 'id_board',
164
+ 'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_forum_id',
166
+ 'callback_method' => 'callback_forumid'
167
+ );
168
+
169
+ // Topic author.
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'topics',
172
+ 'from_fieldname' => 'id_member_started',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => 'post_author',
175
+ 'callback_method' => 'callback_userid'
176
+ );
177
+
178
+ // Topic Author ip (Stored in postmeta)
179
+ $this->field_map[] = array(
180
+ 'from_tablename' => 'messages',
181
+ 'from_fieldname' => 'poster_ip',
182
+ 'join_tablename' => 'topics',
183
+ 'join_type' => 'LEFT',
184
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
185
+ 'to_type' => 'topic',
186
+ 'to_fieldname' => '_bbp_author_ip'
187
+ );
188
+
189
+ // Topic content.
190
+ // Note: We join the 'messages' table because 'topics' table does not have content.
191
+ $this->field_map[] = array(
192
+ 'from_tablename' => 'messages',
193
+ 'from_fieldname' => 'body',
194
+ 'join_tablename' => 'topics',
195
+ 'join_type' => 'LEFT',
196
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
197
+ 'to_type' => 'topic',
198
+ 'to_fieldname' => 'post_content',
199
+ 'callback_method' => 'callback_html'
200
+ );
201
+
202
+ // Topic title.
203
+ $this->field_map[] = array(
204
+ 'from_tablename' => 'messages',
205
+ 'from_fieldname' => 'subject',
206
+ 'join_tablename' => 'topics',
207
+ 'join_type' => 'LEFT',
208
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
209
+ 'to_type' => 'topic',
210
+ 'to_fieldname' => 'post_title'
211
+ );
212
+
213
+ // Topic slug (Clean name to avoid conflicts)
214
+ $this->field_map[] = array(
215
+ 'from_tablename' => 'messages',
216
+ 'from_fieldname' => 'subject',
217
+ 'join_tablename' => 'topics',
218
+ 'join_type' => 'LEFT',
219
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_name',
222
+ 'callback_method' => 'callback_slug'
223
+ );
224
+
225
+ // Topic parent forum id (If no parent, then 0)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'topics',
228
+ 'from_fieldname' => 'id_board',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_parent',
231
+ 'callback_method' => 'callback_forumid'
232
+ );
233
+
234
+ // Topic status (Open or Closed, SMF v2.0.4 0=open & 1=closed)
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'topics',
237
+ 'from_fieldname' => 'locked',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => 'post_status',
240
+ 'callback_method' => 'callback_topic_status'
241
+ );
242
+
243
+ // Sticky status (Stored in postmeta))
244
+ $this->field_map[] = array(
245
+ 'from_tablename' => 'topics',
246
+ 'from_fieldname' => 'is_sticky',
247
+ 'to_type' => 'topic',
248
+ 'to_fieldname' => '_bbp_old_sticky_status',
249
+ 'callback_method' => 'callback_sticky_status'
250
+ );
251
+
252
+ // Topic dates.
253
+ $this->field_map[] = array(
254
+ 'from_tablename' => 'messages',
255
+ 'from_fieldname' => 'poster_time',
256
+ 'join_tablename' => 'topics',
257
+ 'join_type' => 'LEFT',
258
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
259
+ 'to_type' => 'topic',
260
+ 'to_fieldname' => 'post_date',
261
+ 'callback_method' => 'callback_datetime'
262
+ );
263
+ $this->field_map[] = array(
264
+ 'from_tablename' => 'messages',
265
+ 'from_fieldname' => 'poster_time',
266
+ 'join_tablename' => 'topics',
267
+ 'join_type' => 'LEFT',
268
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
269
+ 'to_type' => 'topic',
270
+ 'to_fieldname' => 'post_date_gmt',
271
+ 'callback_method' => 'callback_datetime'
272
+ );
273
+ $this->field_map[] = array(
274
+ 'from_tablename' => 'messages',
275
+ 'from_fieldname' => 'poster_time',
276
+ 'join_tablename' => 'topics',
277
+ 'join_type' => 'LEFT',
278
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
279
+ 'to_type' => 'topic',
280
+ 'to_fieldname' => 'post_modified',
281
+ 'callback_method' => 'callback_datetime'
282
+ );
283
+ $this->field_map[] = array(
284
+ 'from_tablename' => 'messages',
285
+ 'from_fieldname' => 'poster_time',
286
+ 'join_tablename' => 'topics',
287
+ 'join_type' => 'LEFT',
288
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
289
+ 'to_type' => 'topic',
290
+ 'to_fieldname' => 'post_modified_gmt',
291
+ 'callback_method' => 'callback_datetime'
292
+ );
293
+ $this->field_map[] = array(
294
+ 'from_tablename' => 'messages',
295
+ 'from_fieldname' => 'poster_time',
296
+ 'join_tablename' => 'topics',
297
+ 'join_type' => 'LEFT',
298
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
299
+ 'to_type' => 'topic',
300
+ 'to_fieldname' => '_bbp_last_active_time',
301
+ 'callback_method' => 'callback_datetime'
302
+ );
303
+
304
+ /** Tags Section ******************************************************/
305
+
306
+ /**
307
+ * SMF v2.0.4 Forums do not support topic tags out of the box
308
+ */
309
+
310
+ /** Reply Section ******************************************************/
311
+
312
+ // Reply id (Stored in postmeta)
313
+ $this->field_map[] = array(
314
+ 'from_tablename' => 'messages',
315
+ 'from_fieldname' => 'id_msg',
316
+ 'to_type' => 'reply',
317
+ 'to_fieldname' => '_bbp_post_id'
318
+ );
319
+
320
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
321
+ $this->field_map[] = array(
322
+ 'from_tablename' => 'topics',
323
+ 'from_fieldname' => 'id_board',
324
+ 'join_tablename' => 'messages',
325
+ 'join_type' => 'LEFT',
326
+ 'join_expression' => 'USING (id_topic) WHERE topics.id_first_msg != messages.id_msg',
327
+ 'to_type' => 'reply',
328
+ 'to_fieldname' => '_bbp_forum_id',
329
+ 'callback_method' => 'callback_topicid_to_forumid'
330
+ );
331
+
332
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
333
+ $this->field_map[] = array(
334
+ 'from_tablename' => 'messages',
335
+ 'from_fieldname' => 'id_topic',
336
+ 'to_type' => 'reply',
337
+ 'to_fieldname' => '_bbp_topic_id',
338
+ 'callback_method' => 'callback_topicid'
339
+ );
340
+
341
+ // Reply author ip (Stored in postmeta)
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'messages',
344
+ 'from_fieldname' => 'poster_ip',
345
+ 'to_type' => 'reply',
346
+ 'to_fieldname' => '_bbp_author_ip'
347
+ );
348
+
349
+ // Reply author.
350
+ $this->field_map[] = array(
351
+ 'from_tablename' => 'messages',
352
+ 'from_fieldname' => 'id_member',
353
+ 'to_type' => 'reply',
354
+ 'to_fieldname' => 'post_author',
355
+ 'callback_method' => 'callback_userid'
356
+ );
357
+
358
+ // Reply title.
359
+ $this->field_map[] = array(
360
+ 'from_tablename' => 'messages',
361
+ 'from_fieldname' => 'subject',
362
+ 'to_type' => 'reply',
363
+ 'to_fieldname' => 'post_title',
364
+ 'callback_method' => 'callback_reply_title'
365
+ );
366
+
367
+ // Reply slug (Clean name to avoid conflicts)
368
+ $this->field_map[] = array(
369
+ 'from_tablename' => 'messages',
370
+ 'from_fieldname' => 'subject',
371
+ 'to_type' => 'reply',
372
+ 'to_fieldname' => 'post_name',
373
+ 'callback_method' => 'callback_slug'
374
+ );
375
+
376
+ // Reply content.
377
+ $this->field_map[] = array(
378
+ 'from_tablename' => 'messages',
379
+ 'from_fieldname' => 'body',
380
+ 'to_type' => 'reply',
381
+ 'to_fieldname' => 'post_content',
382
+ 'callback_method' => 'callback_html'
383
+ );
384
+
385
+ // Reply parent topic id (If no parent, then 0)
386
+ $this->field_map[] = array(
387
+ 'from_tablename' => 'messages',
388
+ 'from_fieldname' => 'id_topic',
389
+ 'to_type' => 'reply',
390
+ 'to_fieldname' => 'post_parent',
391
+ 'callback_method' => 'callback_topicid'
392
+ );
393
+
394
+ // Reply dates.
395
+ $this->field_map[] = array(
396
+ 'from_tablename' => 'messages',
397
+ 'from_fieldname' => 'poster_time',
398
+ 'to_type' => 'reply',
399
+ 'to_fieldname' => 'post_date',
400
+ 'callback_method' => 'callback_datetime'
401
+ );
402
+ $this->field_map[] = array(
403
+ 'from_tablename' => 'messages',
404
+ 'from_fieldname' => 'poster_time',
405
+ 'to_type' => 'reply',
406
+ 'to_fieldname' => 'post_date_gmt',
407
+ 'callback_method' => 'callback_datetime'
408
+ );
409
+ $this->field_map[] = array(
410
+ 'from_tablename' => 'messages',
411
+ 'from_fieldname' => 'poster_time',
412
+ 'to_type' => 'reply',
413
+ 'to_fieldname' => 'post_modified',
414
+ 'callback_method' => 'callback_datetime'
415
+ );
416
+ $this->field_map[] = array(
417
+ 'from_tablename' => 'messages',
418
+ 'from_fieldname' => 'poster_time',
419
+ 'to_type' => 'reply',
420
+ 'to_fieldname' => 'post_modified_gmt',
421
+ 'callback_method' => 'callback_datetime'
422
+ );
423
+
424
+ /** User Section ******************************************************/
425
+
426
+ // Store old User id (Stored in usermeta)
427
+ $this->field_map[] = array(
428
+ 'from_tablename' => 'members',
429
+ 'from_fieldname' => 'id_member',
430
+ 'to_type' => 'user',
431
+ 'to_fieldname' => '_bbp_user_id'
432
+ );
433
+
434
+ // Store old User password (Stored in usermeta serialized with salt)
435
+ $this->field_map[] = array(
436
+ 'from_tablename' => 'members',
437
+ 'from_fieldname' => 'passwd',
438
+ 'to_type' => 'user',
439
+ 'to_fieldname' => '_bbp_password',
440
+ 'callback_method' => 'callback_savepass'
441
+ );
442
+
443
+ // User password verify class (Stored in usermeta for verifying password)
444
+ $this->field_map[] = array(
445
+ 'to_type' => 'user',
446
+ 'to_fieldname' => '_bbp_class',
447
+ 'default' => 'SMF'
448
+ );
449
+
450
+ // User name.
451
+ $this->field_map[] = array(
452
+ 'from_tablename' => 'members',
453
+ 'from_fieldname' => 'member_name',
454
+ 'to_type' => 'user',
455
+ 'to_fieldname' => 'user_login'
456
+ );
457
+
458
+ // User nice name.
459
+ $this->field_map[] = array(
460
+ 'from_tablename' => 'members',
461
+ 'from_fieldname' => 'member_name',
462
+ 'to_type' => 'user',
463
+ 'to_fieldname' => 'user_nicename'
464
+ );
465
+
466
+ // User email.
467
+ $this->field_map[] = array(
468
+ 'from_tablename' => 'members',
469
+ 'from_fieldname' => 'email_address',
470
+ 'to_type' => 'user',
471
+ 'to_fieldname' => 'user_email'
472
+ );
473
+
474
+ // User homepage.
475
+ $this->field_map[] = array(
476
+ 'from_tablename' => 'members',
477
+ 'from_fieldname' => 'website_url',
478
+ 'to_type' => 'user',
479
+ 'to_fieldname' => 'user_url'
480
+ );
481
+
482
+ // User registered.
483
+ $this->field_map[] = array(
484
+ 'from_tablename' => 'members',
485
+ 'from_fieldname' => 'date_registered',
486
+ 'to_type' => 'user',
487
+ 'to_fieldname' => 'user_registered',
488
+ 'callback_method' => 'callback_datetime'
489
+ );
490
+
491
+ // User display name.
492
+ $this->field_map[] = array(
493
+ 'from_tablename' => 'members',
494
+ 'from_fieldname' => 'real_name',
495
+ 'to_type' => 'user',
496
+ 'to_fieldname' => 'display_name'
497
+ );
498
+
499
+ // User AIM (Stored in usermeta)
500
+ $this->field_map[] = array(
501
+ 'from_tablename' => 'members',
502
+ 'from_fieldname' => 'aim',
503
+ 'to_type' => 'user',
504
+ 'to_fieldname' => 'aim'
505
+ );
506
+
507
+ // User Yahoo (Stored in usermeta)
508
+ $this->field_map[] = array(
509
+ 'from_tablename' => 'members',
510
+ 'from_fieldname' => 'yim',
511
+ 'to_type' => 'user',
512
+ 'to_fieldname' => 'yim'
513
+ );
514
+
515
+ // Store ICQ (Stored in usermeta)
516
+ $this->field_map[] = array(
517
+ 'from_tablename' => 'members',
518
+ 'from_fieldname' => 'icq',
519
+ 'to_type' => 'user',
520
+ 'to_fieldname' => '_bbp_smf_user_icq'
521
+ );
522
+
523
+ // Store MSN (Stored in usermeta)
524
+ $this->field_map[] = array(
525
+ 'from_tablename' => 'members',
526
+ 'from_fieldname' => 'msn',
527
+ 'to_type' => 'user',
528
+ 'to_fieldname' => '_bbp_smf_user_msn'
529
+ );
530
+
531
+ // Store Signature (Stored in usermeta)
532
+ $this->field_map[] = array(
533
+ 'from_tablename' => 'members',
534
+ 'from_fieldname' => 'signature',
535
+ 'to_type' => 'user',
536
+ 'to_fieldname' => '_bbp_smf_user_sig',
537
+ 'callback_method' => 'callback_html'
538
+ );
539
+
540
+ // Store Avatar (Stored in usermeta)
541
+ $this->field_map[] = array(
542
+ 'from_tablename' => 'members',
543
+ 'from_fieldname' => 'avatar',
544
+ 'to_type' => 'user',
545
+ 'to_fieldname' => '_bbp_smf_user_avatar',
546
+ 'callback_method' => 'callback_html'
547
+ );
548
+
549
+ // Store Location (Stored in usermeta)
550
+ $this->field_map[] = array(
551
+ 'from_tablename' => 'members',
552
+ 'from_fieldname' => 'location',
553
+ 'to_type' => 'user',
554
+ 'to_fieldname' => '_bbp_smf_user_location',
555
+ 'callback_method' => 'callback_html'
556
+ );
557
+
558
+ // Store Personal Text (Stored in usermeta)
559
+ $this->field_map[] = array(
560
+ 'from_tablename' => 'members',
561
+ 'from_fieldname' => 'personal_text',
562
+ 'to_type' => 'user',
563
+ 'to_fieldname' => '_bbp_smf_user_personal_text',
564
+ 'callback_method' => 'callback_html'
565
+ );
566
+ }
567
+
568
+ /**
569
+ * This method allows us to indicates what is or is not converted for each
570
+ * converter.
571
+ */
572
+ public function info()
573
+ {
574
+ return '';
575
+ }
576
+
577
+ /**
578
+ * This method is to save the salt and password together. That
579
+ * way when we authenticate it we can get it out of the database
580
+ * as one value. Array values are auto sanitized by WordPress.
581
+ */
582
+ public function callback_savepass( $field, $row )
583
+ {
584
+ $pass_array = array( 'hash' => $field, 'username' => $row['member_name'] );
585
+ return $pass_array;
586
+ }
587
+
588
+ /**
589
+ * This method is to take the pass out of the database and compare
590
+ * to a pass the user has typed in.
591
+ */
592
+ public function authenticate_pass( $password, $serialized_pass )
593
+ {
594
+ $pass_array = unserialize( $serialized_pass );
595
+ return ( $pass_array['hash'] === sha1( strtolower( $pass_array['username'] ) . $password ) ? true : false );
596
+ }
597
+
598
+ /**
599
+ * Translate the post status from SMF v2.0.4 numeric's to WordPress's strings.
600
+ *
601
+ * @param int $status SMF v2.0.4 numeric topic status
602
+ * @return string WordPress safe
603
+ */
604
+ public function callback_topic_status( $status = 0 ) {
605
+ switch ( $status ) {
606
+ case 1 :
607
+ $status = 'closed';
608
+ break;
609
+
610
+ case 0 :
611
+ default :
612
+ $status = 'publish';
613
+ break;
614
+ }
615
+ return $status;
616
+ }
617
+
618
+ /**
619
+ * Translate the topic sticky status type from SMF v2.0.4 numeric's to WordPress's strings.
620
+ *
621
+ * @param int $status SMF v2.0.4 numeric forum type
622
+ * @return string WordPress safe
623
+ */
624
+ public function callback_sticky_status( $status = 0 ) {
625
+ switch ( $status ) {
626
+ case 1 :
627
+ $status = 'sticky'; // SMF Sticky 'is_sticky = 1'
628
+ break;
629
+
630
+ case 0 :
631
+ default :
632
+ $status = 'normal'; // SMF normal topic 'is_sticky = 0'
633
+ break;
634
+ }
635
+ return $status;
636
+ }
637
+
638
+ /**
639
+ * Verify the topic/reply count.
640
+ *
641
+ * @param int $count SMF v2.0.4 topic/reply counts
642
+ * @return string WordPress safe
643
+ */
644
+ public function callback_topic_reply_count( $count = 1 ) {
645
+ $count = absint( (int) $count - 1 );
646
+ return $count;
647
+ }
648
+
649
+ /**
650
+ * Set the reply title
651
+ *
652
+ * @param string $title SMF v2.0.4 topic title of this reply
653
+ * @return string Prefixed topic title, or empty string
654
+ */
655
+ public function callback_reply_title( $title = '' ) {
656
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
657
+ return $title;
658
+ }
659
+
660
+ /**
661
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
662
+ */
663
+ protected function callback_html( $field ) {
664
+
665
+ // Strips SMF custom HTML first from $field before parsing $field to parser.php
666
+ $SMF_markup = $field;
667
+ $SMF_markup = html_entity_decode( $SMF_markup );
668
+
669
+ // Replace '[quote]' with '<blockquote>'
670
+ $SMF_markup = preg_replace( '/\[quote\]/', '<blockquote>', $SMF_markup );
671
+ // Replace '[quote ($1)]' with '<blockquote>"
672
+ $SMF_markup = preg_replace( '/\[quote (.*?)\]/' , '<blockquote>', $SMF_markup );
673
+ // Replace '[/quote]' with '</blockquote>'
674
+ $SMF_markup = preg_replace( '/\[\/quote\]/', '</blockquote>', $SMF_markup );
675
+
676
+ // Replace '[glow]' with ''
677
+ $SMF_markup = preg_replace( '/\[glow\]/', '', $SMF_markup );
678
+ // Replace '[glow]' with ''
679
+ $SMF_markup = preg_replace( '/\[glow=(.*?)\]/', '', $SMF_markup );
680
+ // Replace '[/glow]' with ''
681
+ $SMF_markup = preg_replace( '/\[\/glow\]/', '', $SMF_markup );
682
+
683
+ // Replace '[shadow]' with ''
684
+ $SMF_markup = preg_replace( '/\[shadow\]/', '', $SMF_markup );
685
+ // Replace '[shadow]' with ''
686
+ $SMF_markup = preg_replace( '/\[shadow=(.*?)\]/', '', $SMF_markup );
687
+ // Replace '[/shadow]' with ''
688
+ $SMF_markup = preg_replace( '/\[\/shadow\]/', '', $SMF_markup );
689
+
690
+ // Replace '[move]' with ''
691
+ $SMF_markup = preg_replace( '/\[move\]/', '', $SMF_markup );
692
+ // Replace '[/move]' with ''
693
+ $SMF_markup = preg_replace( '/\[\/move\]/', '', $SMF_markup );
694
+
695
+ // Replace '[table]' with '<table>'
696
+ $SMF_markup = preg_replace( '/\[table\]/', '<table>', $SMF_markup );
697
+ // Replace '[/table]' with '</table>'
698
+ $SMF_markup = preg_replace( '/\[\/table\]/', '</table>', $SMF_markup );
699
+ // Replace '[tr]' with '<tr>'
700
+ $SMF_markup = preg_replace( '/\[tr\]/', '<tr>', $SMF_markup );
701
+ // Replace '[/tr]' with '</tr>'
702
+ $SMF_markup = preg_replace( '/\[\/tr\]/', '</tr>', $SMF_markup );
703
+ // Replace '[td]' with '<td>'
704
+ $SMF_markup = preg_replace( '/\[td\]/', '<td>', $SMF_markup );
705
+ // Replace '[/td]' with '</td>'
706
+ $SMF_markup = preg_replace( '/\[\/td\]/', '</td>', $SMF_markup );
707
+
708
+ // Replace '[list]' with '<ul>'
709
+ $phpbb_uid = preg_replace( '/\[list\]/', '<ul>', $phpbb_uid );
710
+ // Replace '[liist type=decimal]' with '<ol type="a">'
711
+ $phpbb_uid = preg_replace( '/\[list\ type=decimal\]/', '<ol type="a">', $phpbb_uid );
712
+ // Replace '[li]' with '<li>'
713
+ $SMF_markup = preg_replace( '/\[li\]/', '<li>', $SMF_markup );
714
+ // Replace '[/li]' with '</li>'
715
+ $SMF_markup = preg_replace( '/\[\/li\]/', '</li>', $SMF_markup );
716
+
717
+ // Replace '[tt]' with '<tt>'
718
+ $SMF_markup = preg_replace( '/\[tt\]/', '<tt>', $SMF_markup );
719
+ // Replace '[/tt]' with '</tt>'
720
+ $SMF_markup = preg_replace( '/\[\/tt\]/', '</tt>', $SMF_markup );
721
+
722
+ // Replace '<br />' with ''
723
+ $SMF_markup = preg_replace( '/\<br \/\>/', '<tt>', $SMF_markup );
724
+
725
+ // Replace '[size=$1]' with '<span style="font-size:$1%;">$3</span>'
726
+ $SMF_markup = preg_replace( '/\[size=(.*?)\]/', '<span style="font-size:$1">', $SMF_markup );
727
+ // Replace '[/size]' with '</span>'
728
+ $SMF_markup = preg_replace( '/\[\/size\]/', '</span>', $SMF_markup );
729
+
730
+ // Now that SMF custom HTML has been stripped put the cleaned HTML back in $field
731
+ $field = $SMF_markup;
732
+
733
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
734
+ require_once( bbpress()->admin->admin_dir . 'parser.php' );
735
+ $bbcode = BBCode::getInstance();
736
+ $bbcode->enable_smileys = false;
737
+ $bbcode->smiley_regex = false;
738
+ return html_entity_decode( $bbcode->Parse( $field ) );
739
+ }
740
+ }
includes/admin/converters/SimplePress5.php CHANGED
@@ -23,7 +23,7 @@ class SimplePress5 extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
26
- /** Forum Section ******************************************************/
27
 
28
  // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
@@ -129,7 +129,7 @@ class SimplePress5 extends BBP_Converter_Base {
129
  'default' => date('Y-m-d H:i:s')
130
  );
131
 
132
- /** Topic Section ******************************************************/
133
 
134
  // Topic id (Stored in postmeta)
135
  $this->field_map[] = array(
@@ -205,6 +205,24 @@ class SimplePress5 extends BBP_Converter_Base {
205
  'callback_method' => 'callback_forumid'
206
  );
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  // Topic dates.
209
  $this->field_map[] = array(
210
  'from_tablename' => 'sftopics',
@@ -237,15 +255,6 @@ class SimplePress5 extends BBP_Converter_Base {
237
  'to_fieldname' => '_bbp_last_active_time'
238
  );
239
 
240
- // Topic status (Open or Closed)
241
- $this->field_map[] = array(
242
- 'from_tablename' => 'sftopics',
243
- 'from_fieldname' => 'topic_status',
244
- 'to_type' => 'topic',
245
- 'to_fieldname' => 'post_status',
246
- 'callback_method' => 'callback_status'
247
- );
248
-
249
  /** Tags Section ******************************************************/
250
 
251
  /**
@@ -310,6 +319,19 @@ class SimplePress5 extends BBP_Converter_Base {
310
  'callback_method' => 'callback_reply_title'
311
  );
312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  // Reply content.
314
  $this->field_map[] = array(
315
  'from_tablename' => 'sfposts',
@@ -474,6 +496,26 @@ class SimplePress5 extends BBP_Converter_Base {
474
  return $status;
475
  }
476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  /**
478
  * Verify the topic reply count.
479
  *
@@ -524,6 +566,9 @@ class SimplePress5 extends BBP_Converter_Base {
524
  // Replace '<strong>username said </strong>' with '@username said:'
525
  $simplepress_markup = preg_replace ( '/\<strong\>(.*?)\ said\ \<\/strong\>/', '@$1 said:', $simplepress_markup );
526
 
 
 
 
527
  // Now that SimplePress' custom HTML codes have been stripped put the cleaned HTML back in $field
528
  $field = $simplepress_markup;
529
 
23
  */
24
  public function setup_globals() {
25
 
26
+ /** Forum Section *****************************************************/
27
 
28
  // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
129
  'default' => date('Y-m-d H:i:s')
130
  );
131
 
132
+ /** Topic Section *****************************************************/
133
 
134
  // Topic id (Stored in postmeta)
135
  $this->field_map[] = array(
205
  'callback_method' => 'callback_forumid'
206
  );
207
 
208
+ // Topic status (Open or Closed)
209
+ $this->field_map[] = array(
210
+ 'from_tablename' => 'sftopics',
211
+ 'from_fieldname' => 'topic_status',
212
+ 'to_type' => 'topic',
213
+ 'to_fieldname' => 'post_status',
214
+ 'callback_method' => 'callback_status'
215
+ );
216
+
217
+ // Sticky status (Stored in postmeta))
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'sftopics',
220
+ 'from_fieldname' => 'topic_pinned',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => '_bbp_old_sticky_status',
223
+ 'callback_method' => 'callback_sticky_status'
224
+ );
225
+
226
  // Topic dates.
227
  $this->field_map[] = array(
228
  'from_tablename' => 'sftopics',
255
  'to_fieldname' => '_bbp_last_active_time'
256
  );
257
 
 
 
 
 
 
 
 
 
 
258
  /** Tags Section ******************************************************/
259
 
260
  /**
319
  'callback_method' => 'callback_reply_title'
320
  );
321
 
322
+ // Reply slug (Clean name to avoid conflicts)
323
+ // Note: We join the sftopics table because sfposts table does not include topic title.
324
+ $this->field_map[] = array(
325
+ 'from_tablename' => 'sftopics',
326
+ 'from_fieldname' => 'topic_name',
327
+ 'join_tablename' => 'sfposts',
328
+ 'join_type' => 'LEFT',
329
+ 'join_expression' => 'USING (topic_id) WHERE sfposts.post_index != 1',
330
+ 'to_type' => 'reply',
331
+ 'to_fieldname' => 'post_name',
332
+ 'callback_method' => 'callback_slug'
333
+ );
334
+
335
  // Reply content.
336
  $this->field_map[] = array(
337
  'from_tablename' => 'sfposts',
496
  return $status;
497
  }
498
 
499
+ /**
500
+ * Translate the topic sticky status type from Simple:Press v5.x numeric's to WordPress's strings.
501
+ *
502
+ * @param int $status Simple:Press v5.x numeric forum type
503
+ * @return string WordPress safe
504
+ */
505
+ public function callback_sticky_status( $status = 0 ) {
506
+ switch ( $status ) {
507
+ case 1 :
508
+ $status = 'sticky'; // Simple:Press Sticky 'topic_sticky = 1'
509
+ break;
510
+
511
+ case 0 :
512
+ default :
513
+ $status = 'normal'; // Simple:Press Normal Topic 'topic_sticky = 0'
514
+ break;
515
+ }
516
+ return $status;
517
+ }
518
+
519
  /**
520
  * Verify the topic reply count.
521
  *
566
  // Replace '<strong>username said </strong>' with '@username said:'
567
  $simplepress_markup = preg_replace ( '/\<strong\>(.*?)\ said\ \<\/strong\>/', '@$1 said:', $simplepress_markup );
568
 
569
+ // Replace '<p>&nbsp;</p>' with '<p>&nbsp;</p>'
570
+ $simplepress_markup = preg_replace ( '/\n(&nbsp;|[\s\p{Z}\xA0\x{00A0}]+)\r/', '<br>', $simplepress_markup );
571
+
572
  // Now that SimplePress' custom HTML codes have been stripped put the cleaned HTML back in $field
573
  $field = $simplepress_markup;
574
 
includes/admin/converters/Vanilla.php CHANGED
@@ -21,7 +21,6 @@ class Vanilla extends BBP_Converter_Base {
21
  /**
22
  * Sets up the field mappings
23
  */
24
-
25
  public function setup_globals() {
26
 
27
  /** Forum Section *****************************************************/
@@ -155,6 +154,15 @@ class Vanilla extends BBP_Converter_Base {
155
  'callback_method' => 'callback_topic_reply_count'
156
  );
157
 
 
 
 
 
 
 
 
 
 
158
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
159
  $this->field_map[] = array(
160
  'from_tablename' => 'Discussion',
@@ -331,6 +339,19 @@ class Vanilla extends BBP_Converter_Base {
331
  'callback_method' => 'callback_reply_title'
332
  );
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  // Reply author ip (Stored in postmeta)
335
  $this->field_map[] = array(
336
  'from_tablename' => 'Comment',
21
  /**
22
  * Sets up the field mappings
23
  */
 
24
  public function setup_globals() {
25
 
26
  /** Forum Section *****************************************************/
154
  'callback_method' => 'callback_topic_reply_count'
155
  );
156
 
157
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
158
+ $this->field_map[] = array(
159
+ 'from_tablename' => 'Discussion',
160
+ 'from_fieldname' => 'CountComments',
161
+ 'to_type' => 'topic',
162
+ 'to_fieldname' => '_bbp_total_reply_count',
163
+ 'callback_method' => 'callback_topic_reply_count'
164
+ );
165
+
166
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
167
  $this->field_map[] = array(
168
  'from_tablename' => 'Discussion',
339
  'callback_method' => 'callback_reply_title'
340
  );
341
 
342
+ // Reply slug (Clean name to avoid conflicts)
343
+ // Note: We join the Discussion table because Comment table does not include topic title.
344
+ $this->field_map[] = array(
345
+ 'from_tablename' => 'Discussion',
346
+ 'from_fieldname' => 'Name',
347
+ 'join_tablename' => 'Comment',
348
+ 'join_type' => 'INNER',
349
+ 'join_expression' => 'USING (DiscussionID)',
350
+ 'to_type' => 'reply',
351
+ 'to_fieldname' => 'post_name',
352
+ 'callback_method' => 'callback_slug'
353
+ );
354
+
355
  // Reply author ip (Stored in postmeta)
356
  $this->field_map[] = array(
357
  'from_tablename' => 'Comment',
includes/admin/converters/XMB.php ADDED
@@ -0,0 +1,709 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of XMB Forum converter.
5
+ *
6
+ * @since bbPress (r5143)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/xmb
8
+ */
9
+ class XMB extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main Constructor
13
+ *
14
+ * @uses XMB::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' => 'forums',
31
+ 'from_fieldname' => 'fid',
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' => 'forums',
39
+ 'from_fieldname' => 'fup',
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' => 'forums',
47
+ 'from_fieldname' => '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' => 'forums',
55
+ 'from_fieldname' => 'posts',
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' => 'forums',
63
+ 'from_fieldname' => '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' => 'forums',
71
+ 'from_fieldname' => 'posts',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_reply_count'
74
+ );
75
+
76
+ // Forum title.
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'forums',
79
+ 'from_fieldname' => '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' => 'forums',
87
+ 'from_fieldname' => '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' => 'forums',
96
+ 'from_fieldname' => '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' => 'forums',
105
+ 'from_fieldname' => 'displayorder',
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'menu_order'
108
+ );
109
+
110
+ // Forum type (Category = 'group', Forum = 'forum' or 'sub', Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forums',
113
+ 'from_fieldname' => 'type',
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' => 'threads',
146
+ 'from_fieldname' => 'tid',
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' => 'threads',
154
+ 'from_fieldname' => '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' => 'threads',
163
+ 'from_fieldname' => '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' => 'threads',
172
+ 'from_fieldname' => 'fid',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => '_bbp_forum_id',
175
+ 'callback_method' => 'callback_forumid'
176
+ );
177
+
178
+ // Topic author.
179
+ // Note: We join the 'members' table because 'threads' table does not have numerical author id.
180
+ $this->field_map[] = array(
181
+ 'from_tablename' => 'members',
182
+ 'from_fieldname' => 'uid',
183
+ 'join_tablename' => 'threads',
184
+ 'join_type' => 'LEFT',
185
+ 'join_expression' => 'ON threads.author = members.username',
186
+ 'to_type' => 'topic',
187
+ 'to_fieldname' => 'post_author',
188
+ 'callback_method' => 'callback_userid'
189
+ );
190
+
191
+ // Topic Author ip (Stored in postmeta)
192
+ // Note: We join the 'posts' table because 'threads' table does not have author ip.
193
+ $this->field_map[] = array(
194
+ 'from_tablename' => 'posts',
195
+ 'from_fieldname' => 'useip',
196
+ 'join_tablename' => 'threads',
197
+ 'join_type' => 'INNER',
198
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
199
+ 'to_type' => 'topic',
200
+ 'to_fieldname' => '_bbp_author_ip'
201
+ );
202
+
203
+ // Topic content.
204
+ // Note: We join the 'posts' table because 'threads' table does not have content.
205
+ $this->field_map[] = array(
206
+ 'from_tablename' => 'posts',
207
+ 'from_fieldname' => 'message',
208
+ 'join_tablename' => 'threads',
209
+ 'join_type' => 'INNER',
210
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => 'post_content',
213
+ 'callback_method' => 'callback_html'
214
+ );
215
+
216
+ // Topic title.
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'threads',
219
+ 'from_fieldname' => 'subject',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_title'
222
+ );
223
+
224
+ // Topic slug (Clean name to avoid conflicts)
225
+ $this->field_map[] = array(
226
+ 'from_tablename' => 'threads',
227
+ 'from_fieldname' => 'subject',
228
+ 'to_type' => 'topic',
229
+ 'to_fieldname' => 'post_name',
230
+ 'callback_method' => 'callback_slug'
231
+ );
232
+
233
+ // Topic parent forum id (If no parent, then 0)
234
+ $this->field_map[] = array(
235
+ 'from_tablename' => 'threads',
236
+ 'from_fieldname' => 'fid',
237
+ 'to_type' => 'topic',
238
+ 'to_fieldname' => 'post_parent',
239
+ 'callback_method' => 'callback_forumid'
240
+ );
241
+
242
+ // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)
243
+ $this->field_map[] = array(
244
+ 'from_tablename' => 'threads',
245
+ 'from_fieldname' => 'closed',
246
+ 'to_type' => 'topic',
247
+ 'to_fieldname' => 'post_status',
248
+ 'callback_method' => 'callback_topic_status'
249
+ );
250
+
251
+ // Sticky status (Stored in postmeta))
252
+ $this->field_map[] = array(
253
+ 'from_tablename' => 'threads',
254
+ 'from_fieldname' => 'topped',
255
+ 'to_type' => 'topic',
256
+ 'to_fieldname' => '_bbp_old_sticky_status',
257
+ 'callback_method' => 'callback_sticky_status'
258
+ );
259
+
260
+ // Topic dates.
261
+ // Note: We join the 'posts' table because 'threads' table does not include dates.
262
+ $this->field_map[] = array(
263
+ 'from_tablename' => 'posts',
264
+ 'from_fieldname' => 'dateline',
265
+ 'join_tablename' => 'threads',
266
+ 'join_type' => 'INNER',
267
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
268
+ 'to_type' => 'topic',
269
+ 'to_fieldname' => 'post_date',
270
+ 'callback_method' => 'callback_datetime'
271
+ );
272
+ $this->field_map[] = array(
273
+ 'from_tablename' => 'posts',
274
+ 'from_fieldname' => 'dateline',
275
+ 'join_tablename' => 'threads',
276
+ 'join_type' => 'INNER',
277
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
278
+ 'to_type' => 'topic',
279
+ 'to_fieldname' => 'post_date_gmt',
280
+ 'callback_method' => 'callback_datetime'
281
+ );
282
+ $this->field_map[] = array(
283
+ 'from_tablename' => 'posts',
284
+ 'from_fieldname' => 'dateline',
285
+ 'join_tablename' => 'threads',
286
+ 'join_type' => 'INNER',
287
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
288
+ 'to_type' => 'topic',
289
+ 'to_fieldname' => 'post_modified',
290
+ 'callback_method' => 'callback_datetime'
291
+ );
292
+ $this->field_map[] = array(
293
+ 'from_tablename' => 'posts',
294
+ 'from_fieldname' => 'dateline',
295
+ 'join_tablename' => 'threads',
296
+ 'join_type' => 'INNER',
297
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
298
+ 'to_type' => 'topic',
299
+ 'to_fieldname' => 'post_modified_gmt',
300
+ 'callback_method' => 'callback_datetime'
301
+ );
302
+ $this->field_map[] = array(
303
+ 'from_tablename' => 'posts',
304
+ 'from_fieldname' => 'dateline',
305
+ 'join_tablename' => 'threads',
306
+ 'join_type' => 'INNER',
307
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
308
+ 'to_type' => 'topic',
309
+ 'to_fieldname' => '_bbp_last_active_time',
310
+ 'callback_method' => 'callback_datetime'
311
+ );
312
+
313
+ /** Tags Section ******************************************************/
314
+
315
+ /**
316
+ * XMB v1.9.11.13 Forums do not support topic tags out of the box
317
+ */
318
+
319
+ /** Reply Section *****************************************************/
320
+
321
+ // Reply id (Stored in postmeta)
322
+ $this->field_map[] = array(
323
+ 'from_tablename' => 'posts',
324
+ 'from_fieldname' => 'pid',
325
+ 'to_type' => 'reply',
326
+ 'to_fieldname' => '_bbp_post_id'
327
+ );
328
+
329
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'posts',
332
+ 'from_fieldname' => 'fid',
333
+ 'to_type' => 'reply',
334
+ 'to_fieldname' => '_bbp_forum_id',
335
+ 'callback_method' => 'callback_topicid_to_forumid'
336
+ );
337
+
338
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
339
+ $this->field_map[] = array(
340
+ 'from_tablename' => 'posts',
341
+ 'from_fieldname' => 'tid',
342
+ 'to_type' => 'reply',
343
+ 'to_fieldname' => '_bbp_topic_id',
344
+ 'callback_method' => 'callback_topicid'
345
+ );
346
+
347
+ // Reply author ip (Stored in postmeta)
348
+ $this->field_map[] = array(
349
+ 'from_tablename' => 'posts',
350
+ 'from_fieldname' => 'useip',
351
+ 'to_type' => 'reply',
352
+ 'to_fieldname' => '_bbp_author_ip'
353
+ );
354
+
355
+ // Reply author.
356
+ // Note: We join the 'members' table because 'posts' table does not have numerical author id.
357
+ $this->field_map[] = array(
358
+ 'from_tablename' => 'members',
359
+ 'from_fieldname' => 'uid',
360
+ 'join_tablename' => 'posts',
361
+ 'join_type' => 'LEFT',
362
+ 'join_expression' => 'ON posts.author = members.username',
363
+ 'to_type' => 'reply',
364
+ 'to_fieldname' => 'post_author',
365
+ 'callback_method' => 'callback_userid'
366
+ );
367
+
368
+ // Reply title.
369
+ // Note: We join the 'threads' table because 'posts' table does not have topic title.
370
+ $this->field_map[] = array(
371
+ 'from_tablename' => 'threads',
372
+ 'from_fieldname' => 'subject',
373
+ 'join_tablename' => 'posts',
374
+ 'join_type' => 'INNER',
375
+ 'join_expression' => 'USING (tid) WHERE posts.subject = ""',
376
+ 'to_type' => 'reply',
377
+ 'to_fieldname' => 'post_title',
378
+ 'callback_method' => 'callback_reply_title'
379
+ );
380
+
381
+ // Reply slug (Clean name to avoid conflicts)
382
+ // Note: We join the 'threads' table because 'posts' table does not have topic title.
383
+ $this->field_map[] = array(
384
+ 'from_tablename' => 'threads',
385
+ 'from_fieldname' => 'subject',
386
+ 'join_tablename' => 'posts',
387
+ 'join_type' => 'INNER',
388
+ 'join_expression' => 'USING (tid) WHERE posts.subject = ""',
389
+ 'to_type' => 'reply',
390
+ 'to_fieldname' => 'post_name',
391
+ 'callback_method' => 'callback_slug'
392
+ );
393
+
394
+ // Reply content.
395
+ $this->field_map[] = array(
396
+ 'from_tablename' => 'posts',
397
+ 'from_fieldname' => 'message',
398
+ 'to_type' => 'reply',
399
+ 'to_fieldname' => 'post_content',
400
+ 'callback_method' => 'callback_html'
401
+ );
402
+
403
+ // Reply parent topic id (If no parent, then 0)
404
+ $this->field_map[] = array(
405
+ 'from_tablename' => 'posts',
406
+ 'from_fieldname' => 'tid',
407
+ 'to_type' => 'reply',
408
+ 'to_fieldname' => 'post_parent',
409
+ 'callback_method' => 'callback_topicid'
410
+ );
411
+
412
+ // Reply dates.
413
+ $this->field_map[] = array(
414
+ 'from_tablename' => 'posts',
415
+ 'from_fieldname' => 'dateline',
416
+ 'to_type' => 'reply',
417
+ 'to_fieldname' => 'post_date',
418
+ 'callback_method' => 'callback_datetime'
419
+ );
420
+ $this->field_map[] = array(
421
+ 'from_tablename' => 'posts',
422
+ 'from_fieldname' => 'dateline',
423
+ 'to_type' => 'reply',
424
+ 'to_fieldname' => 'post_date_gmt',
425
+ 'callback_method' => 'callback_datetime'
426
+ );
427
+ $this->field_map[] = array(
428
+ 'from_tablename' => 'posts',
429
+ 'from_fieldname' => 'dateline',
430
+ 'to_type' => 'reply',
431
+ 'to_fieldname' => 'post_modified',
432
+ 'callback_method' => 'callback_datetime'
433
+ );
434
+ $this->field_map[] = array(
435
+ 'from_tablename' => 'posts',
436
+ 'from_fieldname' => 'dateline',
437
+ 'to_type' => 'reply',
438
+ 'to_fieldname' => 'post_modified_gmt',
439
+ 'callback_method' => 'callback_datetime'
440
+ );
441
+
442
+ /** User Section ******************************************************/
443
+
444
+ // Store old User id (Stored in usermeta)
445
+ $this->field_map[] = array(
446
+ 'from_tablename' => 'members',
447
+ 'from_fieldname' => 'uid',
448
+ 'to_type' => 'user',
449
+ 'to_fieldname' => '_bbp_user_id'
450
+ );
451
+
452
+ // Store old User password (Stored in usermeta serialized with salt)
453
+ $this->field_map[] = array(
454
+ 'from_tablename' => 'members',
455
+ 'from_fieldname' => 'password',
456
+ 'to_type' => 'user',
457
+ 'to_fieldname' => '_bbp_password',
458
+ 'callback_method' => 'callback_savepass'
459
+ );
460
+
461
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
462
+ // $this->field_map[] = array(
463
+ // 'from_tablename' => 'members',
464
+ // 'from_fieldname' => 'salt',
465
+ // 'to_type' => 'user',
466
+ // 'to_fieldname' => ''
467
+ // );
468
+
469
+ // User password verify class (Stored in usermeta for verifying password)
470
+ $this->field_map[] = array(
471
+ 'to_type' => 'members',
472
+ 'to_fieldname' => '_bbp_class',
473
+ 'default' => 'XMB'
474
+ );
475
+
476
+ // User name.
477
+ $this->field_map[] = array(
478
+ 'from_tablename' => 'members',
479
+ 'from_fieldname' => 'username',
480
+ 'to_type' => 'user',
481
+ 'to_fieldname' => 'user_login'
482
+ );
483
+
484
+ // User nice name.
485
+ $this->field_map[] = array(
486
+ 'from_tablename' => 'members',
487
+ 'from_fieldname' => 'username',
488
+ 'to_type' => 'user',
489
+ 'to_fieldname' => 'user_nicename'
490
+ );
491
+
492
+ // User email.
493
+ $this->field_map[] = array(
494
+ 'from_tablename' => 'members',
495
+ 'from_fieldname' => 'email',
496
+ 'to_type' => 'user',
497
+ 'to_fieldname' => 'user_email'
498
+ );
499
+
500
+ // User homepage.
501
+ $this->field_map[] = array(
502
+ 'from_tablename' => 'members',
503
+ 'from_fieldname' => 'site',
504
+ 'to_type' => 'user',
505
+ 'to_fieldname' => 'user_url'
506
+ );
507
+
508
+ // User registered.
509
+ $this->field_map[] = array(
510
+ 'from_tablename' => 'members',
511
+ 'from_fieldname' => 'regdate',
512
+ 'to_type' => 'user',
513
+ 'to_fieldname' => 'user_registered',
514
+ 'callback_method' => 'callback_datetime'
515
+ );
516
+
517
+ // User AIM (Stored in usermeta)
518
+ $this->field_map[] = array(
519
+ 'from_tablename' => 'members',
520
+ 'from_fieldname' => 'aim',
521
+ 'to_type' => 'user',
522
+ 'to_fieldname' => 'aim'
523
+ );
524
+
525
+ // User Yahoo (Stored in usermeta)
526
+ $this->field_map[] = array(
527
+ 'from_tablename' => 'members',
528
+ 'from_fieldname' => 'yahoo',
529
+ 'to_type' => 'user',
530
+ 'to_fieldname' => 'yim'
531
+ );
532
+
533
+ // Store ICQ (Stored in usermeta)
534
+ $this->field_map[] = array(
535
+ 'from_tablename' => 'members',
536
+ 'from_fieldname' => 'icq',
537
+ 'to_type' => 'user',
538
+ 'to_fieldname' => '_bbp_xmb_user_icq'
539
+ );
540
+
541
+ // Store MSN (Stored in usermeta)
542
+ $this->field_map[] = array(
543
+ 'from_tablename' => 'members',
544
+ 'from_fieldname' => 'msn',
545
+ 'to_type' => 'user',
546
+ 'to_fieldname' => '_bbp_xmb_user_msn'
547
+ );
548
+
549
+ // Store Signature (Stored in usermeta)
550
+ $this->field_map[] = array(
551
+ 'from_tablename' => 'members',
552
+ 'from_fieldname' => 'sig',
553
+ 'to_type' => 'user',
554
+ 'to_fieldname' => '_bbp_xmb_user_sig',
555
+ 'callback_method' => 'callback_html'
556
+ );
557
+
558
+ // Store Bio (Stored in usermeta)
559
+ $this->field_map[] = array(
560
+ 'from_tablename' => 'members',
561
+ 'from_fieldname' => 'bio',
562
+ 'to_type' => 'user',
563
+ 'to_fieldname' => '_bbp_xmb_user_bio',
564
+ 'callback_method' => 'callback_html'
565
+ );
566
+
567
+ // Store Location (Stored in usermeta)
568
+ $this->field_map[] = array(
569
+ 'from_tablename' => 'members',
570
+ 'from_fieldname' => 'location',
571
+ 'to_type' => 'user',
572
+ 'to_fieldname' => '_bbp_xmb_user_location'
573
+ );
574
+
575
+ // Store Avatar (Stored in usermeta)
576
+ $this->field_map[] = array(
577
+ 'from_tablename' => 'members',
578
+ 'from_fieldname' => 'avatar',
579
+ 'to_type' => 'user',
580
+ 'to_fieldname' => '_bbp_xmb_user_avatar'
581
+ );
582
+
583
+ // Store Mood (Stored in usermeta)
584
+ $this->field_map[] = array(
585
+ 'from_tablename' => 'members',
586
+ 'from_fieldname' => 'mood',
587
+ 'to_type' => 'user',
588
+ 'to_fieldname' => '_bbp_xmb_user_mood'
589
+ );
590
+
591
+ }
592
+
593
+ /**
594
+ * This method allows us to indicates what is or is not converted for each
595
+ * converter.
596
+ */
597
+ public function info()
598
+ {
599
+ return '';
600
+ }
601
+
602
+ /**
603
+ * This method is to save the salt and password together. That
604
+ * way when we authenticate it we can get it out of the database
605
+ * as one value. Array values are auto sanitized by WordPress.
606
+ */
607
+ public function callback_savepass( $field, $row )
608
+ {
609
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
610
+ return $pass_array;
611
+ }
612
+
613
+ /**
614
+ * This method is to take the pass out of the database and compare
615
+ * to a pass the user has typed in.
616
+ */
617
+ public function authenticate_pass( $password, $serialized_pass )
618
+ {
619
+ $pass_array = unserialize( $serialized_pass );
620
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
621
+ }
622
+
623
+ /**
624
+ * Translate the forum type from XMB v1.9.11.13 Capitalised case to WordPress's non-capatilise case strings.
625
+ *
626
+ * @param int $status XMB v1.9.11.13 numeric forum type
627
+ * @return string WordPress safe
628
+ */
629
+ public function callback_forum_type( $status = 1 ) {
630
+ switch ( $status ) {
631
+ case 'group' :
632
+ $status = 'category';
633
+ break;
634
+
635
+ case 'sub' :
636
+ $status = 'forum';
637
+ break;
638
+
639
+ case 'forum' :
640
+ default :
641
+ $status = 'forum';
642
+ break;
643
+ }
644
+ return $status;
645
+ }
646
+
647
+ /**
648
+ * Translate the post status from XMB v1.9.11.13 numeric's to WordPress's strings.
649
+ *
650
+ * @param int $status XMB v1.9.11.13 numeric topic status
651
+ * @return string WordPress safe
652
+ */
653
+ public function callback_topic_status( $status = '' ) {
654
+ switch ( $status ) {
655
+ case 'yes' :
656
+ $status = 'closed';
657
+ break;
658
+
659
+ case '' :
660
+ default :
661
+ $status = 'publish';
662
+ break;
663
+ }
664
+ return $status;
665
+ }
666
+
667
+ /**
668
+ * Translate the topic sticky status type from XMB v1.9.11.13 numeric's to WordPress's strings.
669
+ *
670
+ * @param int $status XMB v1.9.11.13 numeric forum type
671
+ * @return string WordPress safe
672
+ */
673
+ public function callback_sticky_status( $status = 0 ) {
674
+ switch ( $status ) {
675
+ case 1 :
676
+ $status = 'sticky'; // XMB Sticky 'topped = 1'
677
+ break;
678
+
679
+ case 0 :
680
+ default :
681
+ $status = 'normal'; // XMB Normal Topic 'topped = 0'
682
+ break;
683
+ }
684
+ return $status;
685
+ }
686
+
687
+ /**
688
+ * Verify the topic/reply count.
689
+ *
690
+ * @param int $count XMB v1.9.11.13 topic/reply counts
691
+ * @return string WordPress safe
692
+ */
693
+ public function callback_topic_reply_count( $count = 1 ) {
694
+ $count = absint( (int) $count - 1 );
695
+ return $count;
696
+ }
697
+
698
+ /**
699
+ * Set the reply title
700
+ *
701
+ * @param string $title XMB v1.9.11.13 topic title of this reply
702
+ * @return string Prefixed topic title, or empty string
703
+ */
704
+ public function callback_reply_title( $title = '' ) {
705
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
706
+ return $title;
707
+ }
708
+
709
+ }
includes/admin/converters/XenForo.php ADDED
@@ -0,0 +1,725 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of XenForo converter.
5
+ *
6
+ * @since bbPress (r5145)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/xenforo
8
+ */
9
+ class XenForo extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main constructor
13
+ *
14
+ * @uses XenForo::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' => 'node',
31
+ 'from_fieldname' => 'node_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' => 'node',
39
+ 'from_fieldname' => 'parent_node_id',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_forum_parent_id'
42
+ );
43
+
44
+ // Forum topic count (Stored in postmeta)
45
+ // Note: We join the 'forum' table because 'node' does not include topic counts.
46
+ $this->field_map[] = array(
47
+ 'from_tablename' => 'forum',
48
+ 'from_fieldname' => 'discussion_count',
49
+ 'join_tablename' => 'node',
50
+ 'join_type' => 'LEFT',
51
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
52
+ 'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_topic_count'
54
+ );
55
+
56
+ // Forum reply count (Stored in postmeta)
57
+ // Note: We join the 'forum' table because 'node' does not include reply counts.
58
+ $this->field_map[] = array(
59
+ 'from_tablename' => 'forum',
60
+ 'from_fieldname' => 'message_count',
61
+ 'join_tablename' => 'node',
62
+ 'join_type' => 'LEFT',
63
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_reply_count'
66
+ );
67
+
68
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
69
+ // Note: We join the 'forum' table because 'node' does not include topic counts.
70
+ $this->field_map[] = array(
71
+ 'from_tablename' => 'forum',
72
+ 'from_fieldname' => 'discussion_count',
73
+ 'join_tablename' => 'node',
74
+ 'join_type' => 'LEFT',
75
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
76
+ 'to_type' => 'forum',
77
+ 'to_fieldname' => '_bbp_total_topic_count'
78
+ );
79
+
80
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
81
+ // Note: We join the 'forum' table because 'node' does not include reply counts.
82
+ $this->field_map[] = array(
83
+ 'from_tablename' => 'forum',
84
+ 'from_fieldname' => 'message_count',
85
+ 'join_tablename' => 'node',
86
+ 'join_type' => 'LEFT',
87
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => '_bbp_total_reply_count'
90
+ );
91
+
92
+ // Forum title.
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'node',
95
+ 'from_fieldname' => 'title',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_title'
98
+ );
99
+
100
+ // Forum slug (Clean name to avoid confilcts)
101
+ // 'node_name' only has slug for explictly named forums
102
+ $this->field_map[] = array(
103
+ 'from_tablename' => 'node',
104
+ 'from_fieldname' => 'node_name',
105
+ 'to_type' => 'forum',
106
+ 'to_fieldname' => 'post_name',
107
+ 'callback_method' => 'callback_slug'
108
+ );
109
+
110
+ // Forum description.
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'node',
113
+ 'from_fieldname' => 'description',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'post_content',
116
+ 'callback_method' => 'callback_null'
117
+ );
118
+
119
+ // Forum display order (Starts from 1)
120
+ $this->field_map[] = array(
121
+ 'from_tablename' => 'node',
122
+ 'from_fieldname' => 'display_order',
123
+ 'to_type' => 'forum',
124
+ 'to_fieldname' => 'menu_order'
125
+ );
126
+
127
+ // Forum type (Category = Category or Forum = Forum, Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'from_tablename' => 'node',
130
+ 'from_fieldname' => 'node_type_id',
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => '_bbp_forum_type',
133
+ 'callback_method' => 'callback_forum_type'
134
+ );
135
+
136
+ // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta)
137
+ // Note: We join the 'forum' table because 'node' does not include forum status.
138
+ $this->field_map[] = array(
139
+ 'from_tablename' => 'forum',
140
+ 'from_fieldname' => 'allow_posting',
141
+ 'join_tablename' => 'node',
142
+ 'join_type' => 'LEFT',
143
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
144
+ 'to_type' => 'forum',
145
+ 'to_fieldname' => '_bbp_status',
146
+ 'callback_method' => 'callback_forum_status'
147
+ );
148
+
149
+ // Forum dates.
150
+ $this->field_map[] = array(
151
+ 'to_type' => 'forum',
152
+ 'to_fieldname' => 'post_date',
153
+ 'default' => date('Y-m-d H:i:s')
154
+ );
155
+ $this->field_map[] = array(
156
+ 'to_type' => 'forum',
157
+ 'to_fieldname' => 'post_date_gmt',
158
+ 'default' => date('Y-m-d H:i:s')
159
+ );
160
+ $this->field_map[] = array(
161
+ 'to_type' => 'forum',
162
+ 'to_fieldname' => 'post_modified',
163
+ 'default' => date('Y-m-d H:i:s')
164
+ );
165
+ $this->field_map[] = array(
166
+ 'to_type' => 'forum',
167
+ 'to_fieldname' => 'post_modified_gmt',
168
+ 'default' => date('Y-m-d H:i:s')
169
+ );
170
+
171
+ /** Topic Section *****************************************************/
172
+
173
+ // Topic id (Stored in postmeta)
174
+ $this->field_map[] = array(
175
+ 'from_tablename' => 'thread',
176
+ 'from_fieldname' => 'thread_id',
177
+ 'to_type' => 'topic',
178
+ 'to_fieldname' => '_bbp_topic_id'
179
+ );
180
+
181
+ // Topic reply count (Stored in postmeta)
182
+ $this->field_map[] = array(
183
+ 'from_tablename' => 'thread',
184
+ 'from_fieldname' => 'reply_count',
185
+ 'to_type' => 'topic',
186
+ 'to_fieldname' => '_bbp_reply_count',
187
+ 'callback_method' => 'callback_topic_reply_count'
188
+ );
189
+
190
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
191
+ $this->field_map[] = array(
192
+ 'from_tablename' => 'thread',
193
+ 'from_fieldname' => 'reply_count',
194
+ 'to_type' => 'topic',
195
+ 'to_fieldname' => '_bbp_total_reply_count',
196
+ 'callback_method' => 'callback_topic_reply_count'
197
+ );
198
+
199
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
200
+ $this->field_map[] = array(
201
+ 'from_tablename' => 'thread',
202
+ 'from_fieldname' => 'node_id',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => '_bbp_forum_id',
205
+ 'callback_method' => 'callback_forumid'
206
+ );
207
+
208
+ // Topic author.
209
+ $this->field_map[] = array(
210
+ 'from_tablename' => 'thread',
211
+ 'from_fieldname' => 'user_id',
212
+ 'to_type' => 'topic',
213
+ 'to_fieldname' => 'post_author',
214
+ 'callback_method' => 'callback_userid'
215
+ );
216
+
217
+ // Topic title.
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'thread',
220
+ 'from_fieldname' => 'title',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => 'post_title'
223
+ );
224
+
225
+ // Topic slug (Clean name to avoid conflicts)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'thread',
228
+ 'from_fieldname' => 'title',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_name',
231
+ 'callback_method' => 'callback_slug'
232
+ );
233
+
234
+ // Topic content.
235
+ // Note: We join the 'post' table because 'thread' table does not include content.
236
+ $this->field_map[] = array(
237
+ 'from_tablename' => 'post',
238
+ 'from_fieldname' => 'message',
239
+ 'join_tablename' => 'thread',
240
+ 'join_type' => 'INNER',
241
+ 'join_expression' => 'ON thread.first_post_id = post.post_id',
242
+ 'to_type' => 'topic',
243
+ 'to_fieldname' => 'post_content',
244
+ 'callback_method' => 'callback_html'
245
+ );
246
+
247
+ // Topic status (Open = 1 or Closed = 0)
248
+ $this->field_map[] = array(
249
+ 'from_tablename' => 'thread',
250
+ 'from_fieldname' => 'discussion_open',
251
+ 'to_type' => 'topic',
252
+ 'to_fieldname' => 'post_status',
253
+ 'callback_method' => 'callback_topic_status'
254
+ );
255
+
256
+ // Topic parent forum id (If no parent, then 0)
257
+ $this->field_map[] = array(
258
+ 'from_tablename' => 'thread',
259
+ 'from_fieldname' => 'node_id',
260
+ 'to_type' => 'topic',
261
+ 'to_fieldname' => 'post_parent',
262
+ 'callback_method' => 'callback_forumid'
263
+ );
264
+
265
+ // Sticky status (Stored in postmeta))
266
+ $this->field_map[] = array(
267
+ 'from_tablename' => 'thread',
268
+ 'from_fieldname' => 'sticky',
269
+ 'to_type' => 'topic',
270
+ 'to_fieldname' => '_bbp_old_sticky_status',
271
+ 'callback_method' => 'callback_sticky_status'
272
+ );
273
+
274
+ // Topic dates.
275
+ $this->field_map[] = array(
276
+ 'from_tablename' => 'thread',
277
+ 'from_fieldname' => 'post_date',
278
+ 'to_type' => 'topic',
279
+ 'to_fieldname' => 'post_date',
280
+ 'callback_method' => 'callback_datetime'
281
+ );
282
+ $this->field_map[] = array(
283
+ 'from_tablename' => 'thread',
284
+ 'from_fieldname' => 'post_date',
285
+ 'to_type' => 'topic',
286
+ 'to_fieldname' => 'post_date_gmt',
287
+ 'callback_method' => 'callback_datetime'
288
+ );
289
+ $this->field_map[] = array(
290
+ 'from_tablename' => 'thread',
291
+ 'from_fieldname' => 'last_post_date',
292
+ 'to_type' => 'topic',
293
+ 'to_fieldname' => 'post_modified',
294
+ 'callback_method' => 'callback_datetime'
295
+ );
296
+ $this->field_map[] = array(
297
+ 'from_tablename' => 'thread',
298
+ 'from_fieldname' => 'last_post_date',
299
+ 'to_type' => 'topic',
300
+ 'to_fieldname' => 'post_modified_gmt',
301
+ 'callback_method' => 'callback_datetime'
302
+ );
303
+ $this->field_map[] = array(
304
+ 'from_tablename' => 'thread',
305
+ 'from_fieldname' => 'last_post_date',
306
+ 'to_type' => 'topic',
307
+ 'to_fieldname' => '_bbp_last_active_time',
308
+ 'callback_method' => 'callback_datetime'
309
+ );
310
+
311
+ /** Tags Section ******************************************************/
312
+
313
+ /**
314
+ * XenForo Forums do not support topic tags out of the box
315
+ */
316
+
317
+ /** Reply Section *****************************************************/
318
+
319
+ // Reply id (Stored in postmeta)
320
+ $this->field_map[] = array(
321
+ 'from_tablename' => 'post',
322
+ 'from_fieldname' => 'post_id',
323
+ 'to_type' => 'reply',
324
+ 'to_fieldname' => '_bbp_post_id'
325
+ );
326
+
327
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
328
+ $this->field_map[] = array(
329
+ 'from_tablename' => 'post',
330
+ 'from_fieldname' => 'thread_id',
331
+ 'to_type' => 'reply',
332
+ 'to_fieldname' => '_bbp_forum_id',
333
+ 'callback_method' => 'callback_topicid_to_forumid'
334
+ );
335
+
336
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
337
+ $this->field_map[] = array(
338
+ 'from_tablename' => 'post',
339
+ 'from_fieldname' => 'thread_id',
340
+ 'to_type' => 'reply',
341
+ 'to_fieldname' => '_bbp_topic_id',
342
+ 'callback_method' => 'callback_topicid'
343
+ );
344
+
345
+ // Reply author.
346
+ $this->field_map[] = array(
347
+ 'from_tablename' => 'post',
348
+ 'from_fieldname' => 'user_id',
349
+ 'to_type' => 'reply',
350
+ 'to_fieldname' => 'post_author',
351
+ 'callback_method' => 'callback_userid'
352
+ );
353
+
354
+ // Reply title.
355
+ // Note: We join the 'thread' table because 'post' do not have titles.
356
+ $this->field_map[] = array(
357
+ 'from_tablename' => 'thread',
358
+ 'from_fieldname' => 'title',
359
+ 'join_tablename' => 'post',
360
+ 'join_type' => 'LEFT',
361
+ 'join_expression' => 'USING (thread_id) WHERE thread.first_post_id != post.post_id',
362
+ 'to_type' => 'reply',
363
+ 'to_fieldname' => 'post_title',
364
+ 'callback_method' => 'callback_reply_title'
365
+ );
366
+
367
+ // Reply slug (Clean name to avoid conflicts)
368
+ // Note: We join the 'thread' table because 'post' do not have titles.
369
+ $this->field_map[] = array(
370
+ 'from_tablename' => 'thread',
371
+ 'from_fieldname' => 'title',
372
+ 'join_tablename' => 'post',
373
+ 'join_type' => 'LEFT',
374
+ 'join_expression' => 'USING (thread_id) WHERE thread.first_post_id != post.post_id',
375
+ 'to_fieldname' => 'post_name',
376
+ 'callback_method' => 'callback_slug'
377
+ );
378
+
379
+ // Reply content.
380
+ $this->field_map[] = array(
381
+ 'from_tablename' => 'post',
382
+ 'from_fieldname' => 'message',
383
+ 'to_type' => 'reply',
384
+ 'to_fieldname' => 'post_content',
385
+ 'callback_method' => 'callback_html'
386
+ );
387
+
388
+ // Reply parent topic id (If no parent, then 0)
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'post',
391
+ 'from_fieldname' => 'thread_id',
392
+ 'to_type' => 'reply',
393
+ 'to_fieldname' => 'post_parent',
394
+ 'callback_method' => 'callback_topicid'
395
+ );
396
+
397
+ // Reply dates.
398
+ $this->field_map[] = array(
399
+ 'from_tablename' => 'post',
400
+ 'from_fieldname' => 'post_date',
401
+ 'to_type' => 'reply',
402
+ 'to_fieldname' => 'post_date',
403
+ 'callback_method' => 'callback_datetime'
404
+ );
405
+ $this->field_map[] = array(
406
+ 'from_tablename' => 'post',
407
+ 'from_fieldname' => 'post_date',
408
+ 'to_type' => 'reply',
409
+ 'to_fieldname' => 'post_date_gmt',
410
+ 'callback_method' => 'callback_datetime'
411
+ );
412
+ $this->field_map[] = array(
413
+ 'from_tablename' => 'post',
414
+ 'from_fieldname' => 'post_date',
415
+ 'to_type' => 'reply',
416
+ 'to_fieldname' => 'post_modified',
417
+ 'callback_method' => 'callback_datetime'
418
+ );
419
+ $this->field_map[] = array(
420
+ 'from_tablename' => 'post',
421
+ 'from_fieldname' => 'post_date',
422
+ 'to_type' => 'reply',
423
+ 'to_fieldname' => 'post_modified_gmt',
424
+ 'callback_method' => 'callback_datetime'
425
+ );
426
+
427
+ /** User Section ******************************************************/
428
+
429
+ // Store old User id (Stored in usermeta)
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'user',
432
+ 'from_fieldname' => 'user_id',
433
+ 'to_type' => 'user',
434
+ 'to_fieldname' => '_bbp_user_id'
435
+ );
436
+
437
+ /* // User password.
438
+ // Note: We join the 'user_authenticate' table because 'user' does not include password.
439
+ $this->field_map[] = array(
440
+ 'from_tablename' => 'user_authenticate',
441
+ 'from_fieldname' => 'data',
442
+ 'join_tablename' => 'user',
443
+ 'join_type' => 'LEFT',
444
+ 'join_expression' => 'USING (user_id)',
445
+ 'to_type' => 'user',
446
+ 'to_fieldname' => '_bbp_converter_password'
447
+ );
448
+
449
+ // Store old User password (Stored in usermeta serialized with salt)
450
+ $this->field_map[] = array(
451
+ 'from_tablename' => 'user',
452
+ 'from_fieldname' => 'password',
453
+ 'to_type' => 'user',
454
+ 'to_fieldname' => '_bbp_password',
455
+ 'callback_method' => 'callback_savepass'
456
+ );
457
+
458
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
459
+ $this->field_map[] = array(
460
+ 'from_tablename' => 'user',
461
+ 'from_fieldname' => 'salt',
462
+ 'to_type' => 'user',
463
+ 'to_fieldname' => ''
464
+ );
465
+ */
466
+ // User password verify class (Stored in usermeta for verifying password)
467
+ $this->field_map[] = array(
468
+ 'to_type' => 'user',
469
+ 'to_fieldname' => '_bbp_class',
470
+ 'default' => 'XenForo'
471
+ );
472
+
473
+ // User name.
474
+ $this->field_map[] = array(
475
+ 'from_tablename' => 'user',
476
+ 'from_fieldname' => 'username',
477
+ 'to_type' => 'user',
478
+ 'to_fieldname' => 'user_login'
479
+ );
480
+
481
+ // User email.
482
+ $this->field_map[] = array(
483
+ 'from_tablename' => 'user',
484
+ 'from_fieldname' => 'email',
485
+ 'to_type' => 'user',
486
+ 'to_fieldname' => 'user_email'
487
+ );
488
+
489
+ // User homepage.
490
+ // Note: We join the 'user_profile' table because 'user' does not include user homepage.
491
+ $this->field_map[] = array(
492
+ 'from_tablename' => 'user_profile',
493
+ 'from_fieldname' => 'homepage',
494
+ 'join_tablename' => 'user',
495
+ 'join_type' => 'LEFT',
496
+ 'join_expression' => 'USING (user_id)',
497
+ 'to_type' => 'user',
498
+ 'to_fieldname' => 'user_url'
499
+ );
500
+
501
+ // User registered.
502
+ $this->field_map[] = array(
503
+ 'from_tablename' => 'user',
504
+ 'from_fieldname' => 'register_date',
505
+ 'to_type' => 'user',
506
+ 'to_fieldname' => 'user_registered',
507
+ 'callback_method' => 'callback_datetime'
508
+ );
509
+
510
+ // User display name.
511
+ $this->field_map[] = array(
512
+ 'from_tablename' => 'user',
513
+ 'from_fieldname' => 'username',
514
+ 'to_type' => 'user',
515
+ 'to_fieldname' => 'display_name'
516
+ );
517
+
518
+ // Store Custom Title (Stored in usermeta)
519
+ $this->field_map[] = array(
520
+ 'from_tablename' => 'user',
521
+ 'from_fieldname' => 'custom_title',
522
+ 'to_type' => 'user',
523
+ 'to_fieldname' => '_bbp_xenforo_user_custom_title'
524
+ );
525
+
526
+ // Store Status (Stored in usermeta)
527
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user status.
528
+ $this->field_map[] = array(
529
+ 'from_tablename' => 'user_profile',
530
+ 'from_fieldname' => 'status',
531
+ 'join_tablename' => 'user',
532
+ 'join_type' => 'LEFT',
533
+ 'join_expression' => 'USING (user_id)',
534
+ 'to_type' => 'user',
535
+ 'to_fieldname' => '_bbp_xenforo_user_status'
536
+ );
537
+
538
+ // Store Signature (Stored in usermeta)
539
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user signature.
540
+ $this->field_map[] = array(
541
+ 'from_tablename' => 'user_profile',
542
+ 'from_fieldname' => 'signature',
543
+ 'join_tablename' => 'user',
544
+ 'join_type' => 'LEFT',
545
+ 'join_expression' => 'USING (user_id)',
546
+ 'to_fieldname' => '_bbp_xenforo_user_sig',
547
+ 'to_type' => 'user',
548
+ 'callback_method' => 'callback_html'
549
+ );
550
+
551
+ // Store Location (Stored in usermeta)
552
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user location.
553
+ $this->field_map[] = array(
554
+ 'from_tablename' => 'user_profile',
555
+ 'from_fieldname' => 'location',
556
+ 'join_tablename' => 'user',
557
+ 'join_type' => 'LEFT',
558
+ 'join_expression' => 'USING (user_id)',
559
+ 'to_type' => 'user',
560
+ 'to_fieldname' => '_bbp_xenforo_user_location'
561
+ );
562
+
563
+ // Store Occupation (Stored in usermeta)
564
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user occupation.
565
+ $this->field_map[] = array(
566
+ 'from_tablename' => 'user_profile',
567
+ 'from_fieldname' => 'occupation',
568
+ 'join_tablename' => 'user',
569
+ 'join_type' => 'LEFT',
570
+ 'join_expression' => 'USING (user_id)',
571
+ 'to_type' => 'user',
572
+ 'to_fieldname' => '_bbp_xenforo_user_occupation'
573
+ );
574
+
575
+ // Store About (Stored in usermeta)
576
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user about.
577
+ $this->field_map[] = array(
578
+ 'from_tablename' => 'user_profile',
579
+ 'from_fieldname' => 'about',
580
+ 'join_tablename' => 'user',
581
+ 'join_type' => 'LEFT',
582
+ 'join_expression' => 'USING (user_id)',
583
+ 'to_type' => 'user',
584
+ 'to_fieldname' => '_bbp_xenforo_user_about',
585
+ 'callback_method' => 'callback_html'
586
+ );
587
+ }
588
+
589
+ /**
590
+ * This method allows us to indicates what is or is not converted for each
591
+ * converter.
592
+ */
593
+ public function info() {
594
+ return '';
595
+ }
596
+
597
+ /**
598
+ * This method is to save the salt and password together. That
599
+ * way when we authenticate it we can get it out of the database
600
+ * as one value. Array values are auto sanitized by wordpress.
601
+ */
602
+ public function translate_savepass( $field, $row )
603
+ {
604
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
605
+ return $pass_array;
606
+ }
607
+
608
+ /**
609
+ * This method is to take the pass out of the database and compare
610
+ * to a pass the user has typed in.
611
+ */
612
+ public function authenticate_pass( $password, $serialized_pass )
613
+ {
614
+ $pass_array = unserialize( $serialized_pass );
615
+ switch( $pass_array['hashFunc'] )
616
+ {
617
+ case 'sha256':
618
+ return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) );
619
+ case 'sha1':
620
+ return ( $pass_array['hash'] == sha1( sha1( $password ) . $pass_array['salt'] ) );
621
+ }
622
+ }
623
+
624
+ /**
625
+ * Translate the forum type from XenForo Capitalised case to WordPress's non-capatilise case strings.
626
+ *
627
+ * @param int $status XenForo numeric forum type
628
+ * @return string WordPress safe
629
+ */
630
+ public function callback_forum_type( $status = 1 ) {
631
+ switch ( $status ) {
632
+ case 'Category' :
633
+ $status = 'category';
634
+ break;
635
+
636
+ case 'Forum' :
637
+ default :
638
+ $status = 'forum';
639
+ break;
640
+ }
641
+ return $status;
642
+ }
643
+
644
+ /**
645
+ * Translate the forum status from XenForo numeric's to WordPress's strings.
646
+ *
647
+ * @param int $status XenForo numeric forum status
648
+ * @return string WordPress safe
649
+ */
650
+ public function callback_forum_status( $status = 1 ) {
651
+ switch ( $status ) {
652
+ case 0 :
653
+ $status = 'closed';
654
+ break;
655
+
656
+ case 1 :
657
+ default :
658
+ $status = 'open';
659
+ break;
660
+ }
661
+ return $status;
662
+ }
663
+
664
+ /**
665
+ * Translate the topic status from XenForo numeric's to WordPress's strings.
666
+ *
667
+ * @param int $status XenForo numeric topic status
668
+ * @return string WordPress safe
669
+ */
670
+ public function callback_topic_status( $status = 1 ) {
671
+ switch ( $status ) {
672
+ case 0 :
673
+ $status = 'closed';
674
+ break;
675
+
676
+ case 1 :
677
+ default :
678
+ $status = 'publish';
679
+ break;
680
+ }
681
+ return $status;
682
+ }
683
+
684
+ /**
685
+ * Translate the topic sticky status type from XenForo numeric's to WordPress's strings.
686
+ *
687
+ * @param int $status XenForo numeric forum type
688
+ * @return string WordPress safe
689
+ */
690
+ public function callback_sticky_status( $status = 0 ) {
691
+ switch ( $status ) {
692
+ case 1 :
693
+ $status = 'sticky'; // XenForo Sticky 'sticky = 1'
694
+ break;
695
+
696
+ case 0 :
697
+ default :
698
+ $status = 'normal'; // XenForo Normal Topic 'sticky = 0'
699
+ break;
700
+ }
701
+ return $status;
702
+ }
703
+
704
+ /**
705
+ * Verify the topic reply count.
706
+ *
707
+ * @param int $count XenForo reply count
708
+ * @return string WordPress safe
709
+ */
710
+ public function callback_topic_reply_count( $count = 1 ) {
711
+ $count = absint( (int) $count - 1 );
712
+ return $count;
713
+ }
714
+
715
+ /**
716
+ * Set the reply title
717
+ *
718
+ * @param string $title XenForo topic title of this reply
719
+ * @return string Prefixed topic title, or empty string
720
+ */
721
+ public function callback_reply_title( $title = '' ) {
722
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
723
+ return $title;
724
+ }
725
+ }
includes/admin/converters/bbPress1.php CHANGED
@@ -107,6 +107,18 @@ class bbPress1 extends BBP_Converter_Base {
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  // Forum dates.
111
  $this->field_map[] = array(
112
  'to_type' => 'forum',
@@ -148,6 +160,15 @@ class bbPress1 extends BBP_Converter_Base {
148
  'callback_method' => 'callback_topic_reply_count'
149
  );
150
 
 
 
 
 
 
 
 
 
 
151
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
152
  $this->field_map[] = array(
153
  'from_tablename' => 'topics',
@@ -177,14 +198,14 @@ class bbPress1 extends BBP_Converter_Base {
177
  // Topic slug (Clean name to avoid conflicts)
178
  $this->field_map[] = array(
179
  'from_tablename' => 'topics',
180
- 'from_fieldname' => 'topic_title',
181
  'to_type' => 'topic',
182
  'to_fieldname' => 'post_name',
183
  'callback_method' => 'callback_slug'
184
  );
185
 
186
  // Topic content.
187
- // Note: We join the posts table because topics do not have content.
188
  $this->field_map[] = array(
189
  'from_tablename' => 'posts',
190
  'from_fieldname' => 'post_text',
@@ -196,7 +217,7 @@ class bbPress1 extends BBP_Converter_Base {
196
  'callback_method' => 'callback_html'
197
  );
198
 
199
- // Topic status (Spam, Trash or Publish)
200
  $this->field_map[] = array(
201
  'from_tablename' => 'posts',
202
  'from_fieldname' => 'post_status',
@@ -209,6 +230,7 @@ class bbPress1 extends BBP_Converter_Base {
209
  );
210
 
211
  // Topic author ip (Stored in postmeta)
 
212
  $this->field_map[] = array(
213
  'from_tablename' => 'posts',
214
  'from_fieldname' => 'poster_ip',
@@ -228,6 +250,15 @@ class bbPress1 extends BBP_Converter_Base {
228
  'callback_method' => 'callback_forumid'
229
  );
230
 
 
 
 
 
 
 
 
 
 
231
  // Topic dates.
232
  $this->field_map[] = array(
233
  'from_tablename' => 'topics',
@@ -293,6 +324,18 @@ class bbPress1 extends BBP_Converter_Base {
293
  'to_fieldname' => 'name'
294
  );
295
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  /** Reply Section *****************************************************/
297
 
298
  // Reply id (Stored in postmeta)
@@ -322,7 +365,7 @@ class bbPress1 extends BBP_Converter_Base {
322
  );
323
 
324
  // Reply title.
325
- // Note: We join the topics table because post table does not include topic title.
326
  $this->field_map[] = array(
327
  'from_tablename' => 'topics',
328
  'from_fieldname' => 'topic_title',
@@ -334,6 +377,19 @@ class bbPress1 extends BBP_Converter_Base {
334
  'callback_method' => 'callback_reply_title'
335
  );
336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  // Reply author ip (Stored in postmeta)
338
  $this->field_map[] = array(
339
  'from_tablename' => 'posts',
@@ -351,7 +407,7 @@ class bbPress1 extends BBP_Converter_Base {
351
  'callback_method' => 'callback_userid'
352
  );
353
 
354
- // Reply status (Spam, Trash or Publish)
355
  $this->field_map[] = array(
356
  'from_tablename' => 'posts',
357
  'from_fieldname' => 'post_status',
@@ -499,7 +555,7 @@ class bbPress1 extends BBP_Converter_Base {
499
  * Translate the post status from bbPress 1's numeric's to WordPress's
500
  * strings.
501
  *
502
- * @param int $status bbPress 1.x numeric status
503
  * @return string WordPress safe
504
  */
505
  public function callback_status( $status = 0 ) {
@@ -520,6 +576,45 @@ class bbPress1 extends BBP_Converter_Base {
520
  return $status;
521
  }
522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  /**
524
  * Verify the topic reply count.
525
  *
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
110
+ // Forum type (bbPress v1.x Forum > 0 or Category = 0, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'meta',
113
+ 'from_fieldname' => 'meta_value',
114
+ 'join_tablename' => 'forums',
115
+ 'join_type' => 'LEFT',
116
+ 'join_expression' => 'ON meta.object_id = forums.forum_id AND meta.meta_key = "forum_is_category"',
117
+ 'to_type' => 'forum',
118
+ 'to_fieldname' => '_bbp_forum_type',
119
+ 'callback_method' => 'callback_forum_type'
120
+ );
121
+
122
  // Forum dates.
123
  $this->field_map[] = array(
124
  'to_type' => 'forum',
160
  'callback_method' => 'callback_topic_reply_count'
161
  );
162
 
163
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
164
+ $this->field_map[] = array(
165
+ 'from_tablename' => 'topics',
166
+ 'from_fieldname' => 'topic_posts',
167
+ 'to_type' => 'topic',
168
+ 'to_fieldname' => '_bbp_total_reply_count',
169
+ 'callback_method' => 'callback_topic_reply_count'
170
+ );
171
+
172
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
173
  $this->field_map[] = array(
174
  'from_tablename' => 'topics',
198
  // Topic slug (Clean name to avoid conflicts)
199
  $this->field_map[] = array(
200
  'from_tablename' => 'topics',
201
+ 'from_fieldname' => 'topic_slug',
202
  'to_type' => 'topic',
203
  'to_fieldname' => 'post_name',
204
  'callback_method' => 'callback_slug'
205
  );
206
 
207
  // Topic content.
208
+ // Note: We join the 'posts' table because 'topics' table does not include content.
209
  $this->field_map[] = array(
210
  'from_tablename' => 'posts',
211
  'from_fieldname' => 'post_text',
217
  'callback_method' => 'callback_html'
218
  );
219
 
220
+ // Topic status (Spam, Trash or Publish, bbPress v1.x publish = 0, trash = 1 & spam = 2)
221
  $this->field_map[] = array(
222
  'from_tablename' => 'posts',
223
  'from_fieldname' => 'post_status',
230
  );
231
 
232
  // Topic author ip (Stored in postmeta)
233
+ // Note: We join the 'posts' table because 'topics' table does not include author ip.
234
  $this->field_map[] = array(
235
  'from_tablename' => 'posts',
236
  'from_fieldname' => 'poster_ip',
250
  'callback_method' => 'callback_forumid'
251
  );
252
 
253
+ // Sticky status (Stored in postmeta))
254
+ $this->field_map[] = array(
255
+ 'from_tablename' => 'topics',
256
+ 'from_fieldname' => 'topic_sticky',
257
+ 'to_type' => 'topic',
258
+ 'to_fieldname' => '_bbp_old_sticky_status',
259
+ 'callback_method' => 'callback_sticky_status'
260
+ );
261
+
262
  // Topic dates.
263
  $this->field_map[] = array(
264
  'from_tablename' => 'topics',
324
  'to_fieldname' => 'name'
325
  );
326
 
327
+ // Term slug.
328
+ $this->field_map[] = array(
329
+ 'from_tablename' => 'terms',
330
+ 'from_fieldname' => 'slug',
331
+ 'join_tablename' => 'term_taxonomy',
332
+ 'join_type' => 'INNER',
333
+ 'join_expression' => 'USING (term_id)',
334
+ 'to_type' => 'tags',
335
+ 'to_fieldname' => 'slug',
336
+ 'callback_method' => 'callback_slug'
337
+ );
338
+
339
  /** Reply Section *****************************************************/
340
 
341
  // Reply id (Stored in postmeta)
365
  );
366
 
367
  // Reply title.
368
+ // Note: We join the 'topics' table because 'posts' table does not include topic title.
369
  $this->field_map[] = array(
370
  'from_tablename' => 'topics',
371
  'from_fieldname' => 'topic_title',
377
  'callback_method' => 'callback_reply_title'
378
  );
379
 
380
+ // Reply slug (Clean name to avoid conflicts)
381
+ // Note: We join the 'topics' table because 'posts' table does not include topic slug.
382
+ $this->field_map[] = array(
383
+ 'from_tablename' => 'topics',
384
+ 'from_fieldname' => 'topic_slug',
385
+ 'join_tablename' => 'posts',
386
+ 'join_type' => 'INNER',
387
+ 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0,1)',
388
+ 'to_type' => 'reply',
389
+ 'to_fieldname' => 'post_name',
390
+ 'callback_method' => 'callback_slug'
391
+ );
392
+
393
  // Reply author ip (Stored in postmeta)
394
  $this->field_map[] = array(
395
  'from_tablename' => 'posts',
407
  'callback_method' => 'callback_userid'
408
  );
409
 
410
+ // Reply status (Spam, Trash or Publish, bbPress v1.x publish = 0, trash = 1 & spam = 2)
411
  $this->field_map[] = array(
412
  'from_tablename' => 'posts',
413
  'from_fieldname' => 'post_status',
555
  * Translate the post status from bbPress 1's numeric's to WordPress's
556
  * strings.
557
  *
558
+ * @param int $status bbPress 1.x numeric post status
559
  * @return string WordPress safe
560
  */
561
  public function callback_status( $status = 0 ) {
576
  return $status;
577
  }
578
 
579
+ /**
580
+ * Translate the forum type from bbPress 1.x numeric's to WordPress's strings.
581
+ *
582
+ * @param int $status bbPress 1.x numeric forum type
583
+ * @return string WordPress safe
584
+ */
585
+ public function callback_forum_type( $status = 0 ) {
586
+ if ( $status == 1 ) {
587
+ $status = 'category';
588
+ } else {
589
+ $status = 'forum';
590
+ }
591
+ return $status;
592
+ }
593
+
594
+ /**
595
+ * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings.
596
+ *
597
+ * @param int $status bbPress 1.x numeric forum type
598
+ * @return string WordPress safe
599
+ */
600
+ public function callback_sticky_status( $status = 0 ) {
601
+ switch ( $status ) {
602
+ case 2 :
603
+ $status = 'super-sticky'; // bbPress Super Sticky 'topic_sticky = 2'
604
+ break;
605
+
606
+ case 1 :
607
+ $status = 'sticky'; // bbPress Sticky 'topic_sticky = 1'
608
+ break;
609
+
610
+ case 0 :
611
+ default :
612
+ $status = 'normal'; // bbPress Normal Topic 'topic_sticky = 0'
613
+ break;
614
+ }
615
+ return $status;
616
+ }
617
+
618
  /**
619
  * Verify the topic reply count.
620
  *
includes/admin/converters/phpBB.php CHANGED
@@ -23,7 +23,7 @@ class phpBB extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
26
- /** Forum Section ******************************************************/
27
 
28
  // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
@@ -65,7 +65,7 @@ class phpBB extends BBP_Converter_Base {
65
  'to_fieldname' => '_bbp_total_topic_count'
66
  );
67
 
68
- // Forum total reply count (Stored in postmeta)
69
  $this->field_map[] = array(
70
  'from_tablename' => 'forums',
71
  'from_fieldname' => 'forum_posts',
@@ -107,7 +107,16 @@ class phpBB extends BBP_Converter_Base {
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
110
- // Forum status (Locked =1 Unlocked =0, Stored in postmeta)
 
 
 
 
 
 
 
 
 
111
  $this->field_map[] = array(
112
  'from_tablename' => 'forums',
113
  'from_fieldname' => 'forum_status',
@@ -138,7 +147,7 @@ class phpBB extends BBP_Converter_Base {
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(
@@ -184,8 +193,19 @@ class phpBB extends BBP_Converter_Base {
184
  'callback_method' => 'callback_userid'
185
  );
186
 
 
 
 
 
 
 
 
 
 
 
 
187
  // Topic content.
188
- // Note: We join the posts table because topics do not have content.
189
  $this->field_map[] = array(
190
  'from_tablename' => 'posts',
191
  'from_fieldname' => 'post_text',
@@ -214,6 +234,15 @@ class phpBB extends BBP_Converter_Base {
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' => 'topics',
@@ -223,6 +252,15 @@ class phpBB extends BBP_Converter_Base {
223
  'callback_method' => 'callback_forumid'
224
  );
225
 
 
 
 
 
 
 
 
 
 
226
  // Topic dates.
227
  $this->field_map[] = array(
228
  'from_tablename' => 'topics',
@@ -260,28 +298,6 @@ class phpBB extends BBP_Converter_Base {
260
  'callback_method' => 'callback_datetime'
261
  );
262
 
263
- // Topic status (Open or Closed)
264
- $this->field_map[] = array(
265
- 'from_tablename' => 'topics',
266
- 'from_fieldname' => 'topic_status',
267
- 'to_type' => 'topic',
268
- 'to_fieldname' => 'post_status',
269
- 'callback_method' => 'callback_topic_status'
270
- );
271
-
272
- // Topic Author ip (Stored in postmeta)
273
- $this->field_map[] = array(
274
- 'from_tablename' => 'posts',
275
- 'from_fieldname' => 'poster_ip',
276
- 'join_tablename' => 'topics',
277
- 'join_type' => 'INNER',
278
- 'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id',
279
- 'to_type' => 'topic',
280
- 'to_fieldname' => '_bbp_author_ip'
281
- );
282
-
283
- // Sticky Status
284
-
285
  /** Tags Section ******************************************************/
286
 
287
  /**
@@ -345,10 +361,11 @@ class phpBB extends BBP_Converter_Base {
345
 
346
  // Reply title.
347
  $this->field_map[] = array(
348
- 'from_tablename' => 'posts',
349
- 'from_fieldname' => 'post_subject',
350
- 'to_type' => 'reply',
351
- 'to_fieldname' => 'post_title'
 
352
  );
353
 
354
  // Reply slug (Clean name to avoid conflicts)
@@ -690,6 +707,26 @@ class phpBB extends BBP_Converter_Base {
690
  return $output;
691
  }
692
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
  /**
694
  * Translate the forum status from phpBB v3.x numeric's to WordPress's strings.
695
  *
@@ -722,7 +759,7 @@ class phpBB extends BBP_Converter_Base {
722
  $status = 'closed';
723
  break;
724
 
725
- case 0 :
726
  default :
727
  $status = 'publish';
728
  break;
@@ -730,6 +767,34 @@ class phpBB extends BBP_Converter_Base {
730
  return $status;
731
  }
732
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  /**
734
  * Verify the topic reply count.
735
  *
@@ -741,6 +806,17 @@ class phpBB extends BBP_Converter_Base {
741
  return $count;
742
  }
743
 
 
 
 
 
 
 
 
 
 
 
 
744
  /**
745
  * This callback processes any custom parser.php attributes and custom code with preg_replace
746
  */
23
  */
24
  public function setup_globals() {
25
 
26
+ /** Forum Section *****************************************************/
27
 
28
  // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
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' => 'forums',
71
  'from_fieldname' => 'forum_posts',
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
110
+ // Forum type (Category = 0 or Forum = 1, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forums',
113
+ 'from_fieldname' => 'forum_type',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => '_bbp_forum_type',
116
+ 'callback_method' => 'callback_forum_type'
117
+ );
118
+
119
+ // Forum status (Unlocked = 0 or Locked = 1, Stored in postmeta)
120
  $this->field_map[] = array(
121
  'from_tablename' => 'forums',
122
  'from_fieldname' => 'forum_status',
147
  'default' => date('Y-m-d H:i:s')
148
  );
149
 
150
+ /** Topic Section *****************************************************/
151
 
152
  // Topic id (Stored in postmeta)
153
  $this->field_map[] = array(
193
  'callback_method' => 'callback_userid'
194
  );
195
 
196
+ // Topic Author ip (Stored in postmeta)
197
+ $this->field_map[] = array(
198
+ 'from_tablename' => 'posts',
199
+ 'from_fieldname' => 'poster_ip',
200
+ 'join_tablename' => 'topics',
201
+ 'join_type' => 'INNER',
202
+ 'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => '_bbp_author_ip'
205
+ );
206
+
207
  // Topic content.
208
+ // Note: We join the 'posts' table because 'topics' does not include topic content.
209
  $this->field_map[] = array(
210
  'from_tablename' => 'posts',
211
  'from_fieldname' => 'post_text',
234
  'callback_method' => 'callback_slug'
235
  );
236
 
237
+ // Topic status (Open or Closed)
238
+ $this->field_map[] = array(
239
+ 'from_tablename' => 'topics',
240
+ 'from_fieldname' => 'topic_status',
241
+ 'to_type' => 'topic',
242
+ 'to_fieldname' => 'post_status',
243
+ 'callback_method' => 'callback_topic_status'
244
+ );
245
+
246
  // Topic parent forum id (If no parent, then 0)
247
  $this->field_map[] = array(
248
  'from_tablename' => 'topics',
252
  'callback_method' => 'callback_forumid'
253
  );
254
 
255
+ // Sticky status (Stored in postmeta))
256
+ $this->field_map[] = array(
257
+ 'from_tablename' => 'topics',
258
+ 'from_fieldname' => 'topic_type',
259
+ 'to_type' => 'topic',
260
+ 'to_fieldname' => '_bbp_old_sticky_status',
261
+ 'callback_method' => 'callback_sticky_status'
262
+ );
263
+
264
  // Topic dates.
265
  $this->field_map[] = array(
266
  'from_tablename' => 'topics',
298
  'callback_method' => 'callback_datetime'
299
  );
300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  /** Tags Section ******************************************************/
302
 
303
  /**
361
 
362
  // Reply title.
363
  $this->field_map[] = array(
364
+ 'from_tablename' => 'posts',
365
+ 'from_fieldname' => 'post_subject',
366
+ 'to_type' => 'reply',
367
+ 'to_fieldname' => 'post_title',
368
+ 'callback_method' => 'callback_reply_title'
369
  );
370
 
371
  // Reply slug (Clean name to avoid conflicts)
707
  return $output;
708
  }
709
 
710
+ /**
711
+ * Translate the forum type from phpBB v3.x numeric's to WordPress's strings.
712
+ *
713
+ * @param int $status phpBB v3.x numeric forum type
714
+ * @return string WordPress safe
715
+ */
716
+ public function callback_forum_type( $status = 1 ) {
717
+ switch ( $status ) {
718
+ case 0 :
719
+ $status = 'category';
720
+ break;
721
+
722
+ case 1 :
723
+ default :
724
+ $status = 'forum';
725
+ break;
726
+ }
727
+ return $status;
728
+ }
729
+
730
  /**
731
  * Translate the forum status from phpBB v3.x numeric's to WordPress's strings.
732
  *
759
  $status = 'closed';
760
  break;
761
 
762
+ case 0 :
763
  default :
764
  $status = 'publish';
765
  break;
767
  return $status;
768
  }
769
 
770
+ /**
771
+ * Translate the topic sticky status type from phpBB 3.x numeric's to WordPress's strings.
772
+ *
773
+ * @param int $status phpBB 3.x numeric forum type
774
+ * @return string WordPress safe
775
+ */
776
+ public function callback_sticky_status( $status = 0 ) {
777
+ switch ( $status ) {
778
+ case 3 :
779
+ $status = 'super-sticky'; // phpBB Global Sticky 'topic_type = 3'
780
+ break;
781
+
782
+ case 2 :
783
+ $status = 'super-sticky'; // phpBB Announcement Sticky 'topic_type = 2'
784
+ break;
785
+
786
+ case 1 :
787
+ $status = 'sticky'; // phpBB Sticky 'topic_type = 1'
788
+ break;
789
+
790
+ case 0 :
791
+ default :
792
+ $status = 'normal'; // phpBB normal topic 'topic_type = 0'
793
+ break;
794
+ }
795
+ return $status;
796
+ }
797
+
798
  /**
799
  * Verify the topic reply count.
800
  *
806
  return $count;
807
  }
808
 
809
+ /**
810
+ * Set the reply title
811
+ *
812
+ * @param string $title phpBB v3.x topic title of this reply
813
+ * @return string Prefixed topic title, or empty string
814
+ */
815
+ public function callback_reply_title( $title = '' ) {
816
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
817
+ return $title;
818
+ }
819
+
820
  /**
821
  * This callback processes any custom parser.php attributes and custom code with preg_replace
822
  */
includes/admin/converters/vBulletin.php CHANGED
@@ -57,6 +57,22 @@ class vBulletin extends BBP_Converter_Base {
57
  'to_fieldname' => '_bbp_reply_count'
58
  );
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  // Forum title.
61
  $this->field_map[] = array(
62
  'from_tablename' => 'forum',
@@ -91,6 +107,15 @@ class vBulletin extends BBP_Converter_Base {
91
  'to_fieldname' => 'menu_order'
92
  );
93
 
 
 
 
 
 
 
 
 
 
94
  // Forum dates.
95
  $this->field_map[] = array(
96
  'to_type' => 'forum',
@@ -141,6 +166,15 @@ class vBulletin extends BBP_Converter_Base {
141
  'callback_method' => 'callback_topic_reply_count'
142
  );
143
 
 
 
 
 
 
 
 
 
 
144
  // Topic author.
145
  $this->field_map[] = array(
146
  'from_tablename' => 'thread',
@@ -150,6 +184,18 @@ class vBulletin extends BBP_Converter_Base {
150
  'callback_method' => 'callback_userid'
151
  );
152
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  // Topic title.
154
  $this->field_map[] = array(
155
  'from_tablename' => 'thread',
@@ -177,7 +223,7 @@ class vBulletin extends BBP_Converter_Base {
177
  );
178
 
179
  // Topic content.
180
- // Note: We join the posts table because topics do not have content.
181
  $this->field_map[] = array(
182
  'from_tablename' => 'post',
183
  'from_fieldname' => 'pagetext',
@@ -189,6 +235,24 @@ class vBulletin extends BBP_Converter_Base {
189
  'callback_method' => 'callback_html'
190
  );
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  // Topic dates.
193
  $this->field_map[] = array(
194
  'from_tablename' => 'thread',
@@ -226,15 +290,6 @@ class vBulletin extends BBP_Converter_Base {
226
  'callback_method' => 'callback_datetime'
227
  );
228
 
229
- // Topic status (Open or Closed)
230
- $this->field_map[] = array(
231
- 'from_tablename' => 'thread',
232
- 'from_fieldname' => 'open',
233
- 'to_type' => 'topic',
234
- 'to_fieldname' => 'post_status',
235
- 'callback_method' => 'callback_topic_status'
236
- );
237
-
238
  /** Tags Section ******************************************************/
239
 
240
  // Topic id.
@@ -265,6 +320,18 @@ class vBulletin extends BBP_Converter_Base {
265
  'to_fieldname' => 'name'
266
  );
267
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  /** Reply Section *****************************************************/
269
 
270
  // Reply id (Stored in postmeta)
@@ -276,6 +343,7 @@ class vBulletin extends BBP_Converter_Base {
276
  );
277
 
278
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
 
279
  $this->field_map[] = array(
280
  'from_tablename' => 'thread',
281
  'from_fieldname' => 'forumid',
@@ -287,7 +355,7 @@ class vBulletin extends BBP_Converter_Base {
287
  'callback_method' => 'callback_topicid_to_forumid'
288
  );
289
 
290
- // Reply parent topic id (If no parent, then 0. Stored in postmeta)
291
  $this->field_map[] = array(
292
  'from_tablename' => 'post',
293
  'from_fieldname' => 'threadid',
@@ -314,7 +382,7 @@ class vBulletin extends BBP_Converter_Base {
314
  );
315
 
316
  // Reply title.
317
- // Note: We join the thread table because post table does not include topic title.
318
  $this->field_map[] = array(
319
  'from_tablename' => 'thread',
320
  'from_fieldname' => 'title',
@@ -326,6 +394,19 @@ class vBulletin extends BBP_Converter_Base {
326
  'callback_method' => 'callback_reply_title'
327
  );
328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  // Reply content.
330
  $this->field_map[] = array(
331
  'from_tablename' => 'post',
@@ -398,7 +479,7 @@ class vBulletin extends BBP_Converter_Base {
398
  'from_tablename' => 'user',
399
  'from_fieldname' => 'salt',
400
  'to_type' => 'user',
401
- 'to_fieldname' => ''
402
  );
403
 
404
  // User password verify class (Stored in usermeta for verifying password)
@@ -497,7 +578,7 @@ class vBulletin extends BBP_Converter_Base {
497
  * as one value. Array values are auto sanitized by WordPress.
498
  */
499
  public function callback_savepass( $field, $row ) {
500
- $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
501
  return $pass_array;
502
  }
503
 
@@ -505,16 +586,51 @@ class vBulletin extends BBP_Converter_Base {
505
  * This method is to take the pass out of the database and compare
506
  * to a pass the user has typed in.
507
  *
508
- * vBulletin passwords do not work. Maybe use the below plugin's approach?
509
- *
510
- * @link http://wordpress.org/extend/plugins/vb-user-copy/
511
- * @link http://plugins.trac.wordpress.org/browser/vb-user-copy/trunk/vb_user_copy.php
512
  */
513
  public function authenticate_pass( $password, $serialized_pass ) {
514
  $pass_array = unserialize( $serialized_pass );
515
  return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
516
  }
517
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  /**
519
  * Verify the topic reply count.
520
  *
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' => 'threadcount',
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' => 'replycount',
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',
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
110
+ // Forum type (Category = -1 or Forum > 0, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forum',
113
+ 'from_fieldname' => 'parentid',
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',
166
  'callback_method' => 'callback_topic_reply_count'
167
  );
168
 
169
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'thread',
172
+ 'from_fieldname' => 'replycount',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => '_bbp_total_reply_count',
175
+ 'callback_method' => 'callback_topic_reply_count'
176
+ );
177
+
178
  // Topic author.
179
  $this->field_map[] = array(
180
  'from_tablename' => 'thread',
184
  'callback_method' => 'callback_userid'
185
  );
186
 
187
+ // Topic Author ip (Stored in postmeta)
188
+ // Note: We join the 'post' table because 'thread' table does not include topic content.
189
+ $this->field_map[] = array(
190
+ 'from_tablename' => 'post',
191
+ 'from_fieldname' => 'ipaddress',
192
+ 'join_tablename' => 'thread',
193
+ 'join_type' => 'INNER',
194
+ 'join_expression' => 'USING (threadid) WHERE post.parentid = 0',
195
+ 'to_type' => 'topic',
196
+ 'to_fieldname' => '_bbp_author_ip'
197
+ );
198
+
199
  // Topic title.
200
  $this->field_map[] = array(
201
  'from_tablename' => 'thread',
223
  );
224
 
225
  // Topic content.
226
+ // Note: We join the 'post' table because 'thread' table does not include topic content.
227
  $this->field_map[] = array(
228
  'from_tablename' => 'post',
229
  'from_fieldname' => 'pagetext',
235
  'callback_method' => 'callback_html'
236
  );
237
 
238
+ // Topic status (Open or Closed)
239
+ $this->field_map[] = array(
240
+ 'from_tablename' => 'thread',
241
+ 'from_fieldname' => 'open',
242
+ 'to_type' => 'topic',
243
+ 'to_fieldname' => 'post_status',
244
+ 'callback_method' => 'callback_topic_status'
245
+ );
246
+
247
+ // Sticky status (Stored in postmeta))
248
+ $this->field_map[] = array(
249
+ 'from_tablename' => 'thread',
250
+ 'from_fieldname' => 'sticky',
251
+ 'to_type' => 'topic',
252
+ 'to_fieldname' => '_bbp_old_sticky_status',
253
+ 'callback_method' => 'callback_sticky_status'
254
+ );
255
+
256
  // Topic dates.
257
  $this->field_map[] = array(
258
  'from_tablename' => 'thread',
290
  'callback_method' => 'callback_datetime'
291
  );
292
 
 
 
 
 
 
 
 
 
 
293
  /** Tags Section ******************************************************/
294
 
295
  // Topic id.
320
  'to_fieldname' => 'name'
321
  );
322
 
323
+ // Term slug.
324
+ $this->field_map[] = array(
325
+ 'from_tablename' => 'tag',
326
+ 'from_fieldname' => 'tagtext',
327
+ 'join_tablename' => 'tagcontent',
328
+ 'join_type' => 'INNER',
329
+ 'join_expression' => 'USING (tagid)',
330
+ 'to_type' => 'tags',
331
+ 'to_fieldname' => 'slug',
332
+ 'callback_method' => 'callback_slug'
333
+ );
334
+
335
  /** Reply Section *****************************************************/
336
 
337
  // Reply id (Stored in postmeta)
343
  );
344
 
345
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
346
+ // Note: We join the 'thread' table because 'post' table does not include forum id.
347
  $this->field_map[] = array(
348
  'from_tablename' => 'thread',
349
  'from_fieldname' => 'forumid',
355
  'callback_method' => 'callback_topicid_to_forumid'
356
  );
357
 
358
+ // Reply parent topic id (If no parent, then 0, Stored in postmeta)
359
  $this->field_map[] = array(
360
  'from_tablename' => 'post',
361
  'from_fieldname' => 'threadid',
382
  );
383
 
384
  // Reply title.
385
+ // Note: We join the 'thread' table because 'post' table does not include reply title.
386
  $this->field_map[] = array(
387
  'from_tablename' => 'thread',
388
  'from_fieldname' => 'title',
394
  'callback_method' => 'callback_reply_title'
395
  );
396
 
397
+ // Reply slug (Clean name to avoid conflicts)
398
+ // Note: We join the 'thread' table because 'post' table does not include reply slug.
399
+ $this->field_map[] = array(
400
+ 'from_tablename' => 'thread',
401
+ 'from_fieldname' => 'title',
402
+ 'join_tablename' => 'post',
403
+ 'join_type' => 'INNER',
404
+ 'join_expression' => 'USING (threadid) WHERE post.parentid != 0',
405
+ 'to_type' => 'reply',
406
+ 'to_fieldname' => 'post_name',
407
+ 'callback_method' => 'callback_slug'
408
+ );
409
+
410
  // Reply content.
411
  $this->field_map[] = array(
412
  'from_tablename' => 'post',
479
  'from_tablename' => 'user',
480
  'from_fieldname' => 'salt',
481
  'to_type' => 'user',
482
+ 'to_fieldname' => '_bbp_salt'
483
  );
484
 
485
  // User password verify class (Stored in usermeta for verifying password)
578
  * as one value. Array values are auto sanitized by WordPress.
579
  */
580
  public function callback_savepass( $field, $row ) {
581
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
582
  return $pass_array;
583
  }
584
 
586
  * This method is to take the pass out of the database and compare
587
  * to a pass the user has typed in.
588
  *
 
 
 
 
589
  */
590
  public function authenticate_pass( $password, $serialized_pass ) {
591
  $pass_array = unserialize( $serialized_pass );
592
  return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
593
  }
594
 
595
+ /**
596
+ * Translate the forum type from vBulletin v4.x numeric's to WordPress's strings.
597
+ *
598
+ * @param int $status vBulletin v4.x numeric forum type
599
+ * @return string WordPress safe
600
+ */
601
+ public function callback_forum_type( $status = 0 ) {
602
+ if ( $status == -1 ) {
603
+ $status = 'category';
604
+ } else {
605
+ $status = 'forum';
606
+ }
607
+ return $status;
608
+ }
609
+
610
+ /**
611
+ * Translate the topic sticky status type from vBulletin v4.x numeric's to WordPress's strings.
612
+ *
613
+ * @param int $status vBulletin v4.x numeric forum type
614
+ * @return string WordPress safe
615
+ */
616
+ public function callback_sticky_status( $status = 0 ) {
617
+ switch ( $status ) {
618
+ case 2 :
619
+ $status = 'super-sticky'; // vBulletin Super Sticky 'sticky = 2'
620
+ break;
621
+
622
+ case 1 :
623
+ $status = 'sticky'; // vBulletin Sticky 'sticky = 1'
624
+ break;
625
+
626
+ case 0 :
627
+ default :
628
+ $status = 'normal'; // vBulletin Normal Topic 'sticky = 0'
629
+ break;
630
+ }
631
+ return $status;
632
+ }
633
+
634
  /**
635
  * Verify the topic reply count.
636
  *
includes/admin/converters/vBulletin3.php ADDED
@@ -0,0 +1,707 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implementation of vBulletin v3.x Converter.
5
+ *
6
+ * @since bbPress (r5151)
7
+ * @link Codex Docs http://codex.bbpress.org/import-forums/vbulletin
8
+ */
9
+ class vBulletin3 extends BBP_Converter_Base {
10
+
11
+ /**
12
+ * Main constructor
13
+ *
14
+ * @uses vBulletin::setup_globals()
15
+ */
16
+ function __construct() {
17
+ parent::__construct();
18
+ $this->setup_globals();
19
+ }
20
+
21
+ /**
22
+ * Sets up the field mappings
23
+ */
24
+ private 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' => 'forumid',
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' => 'parentid',
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' => 'threadcount',
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' => 'replycount',
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' => 'threadcount',
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' => 'replycount',
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' => 'title',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => 'post_title'
82
+ );
83
+
84
+ // Forum slug (Clean name to avoid confilcts)
85
+ $this->field_map[] = array(
86
+ 'from_tablename' => 'forum',
87
+ 'from_fieldname' => 'title_clean',
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' => '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' => 'displayorder',
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'menu_order'
108
+ );
109
+
110
+ // Forum type (Category = -1 or Forum > 0, Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forum',
113
+ 'from_fieldname' => 'parentid',
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' => 'thread',
146
+ 'from_fieldname' => 'threadid',
147
+ 'to_type' => 'topic',
148
+ 'to_fieldname' => '_bbp_topic_id'
149
+ );
150
+
151
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
152
+ $this->field_map[] = array(
153
+ 'from_tablename' => 'thread',
154
+ 'from_fieldname' => 'forumid',
155
+ 'to_type' => 'topic',
156
+ 'to_fieldname' => '_bbp_forum_id',
157
+ 'callback_method' => 'callback_forumid'
158
+ );
159
+
160
+ // Topic reply count (Stored in postmeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'thread',
163
+ 'from_fieldname' => 'replycount',
164
+ 'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_reply_count',
166
+ 'callback_method' => 'callback_topic_reply_count'
167
+ );
168
+
169
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'thread',
172
+ 'from_fieldname' => 'replycount',
173
+ 'to_type' => 'topic',
174
+ 'to_fieldname' => '_bbp_total_reply_count',
175
+ 'callback_method' => 'callback_topic_reply_count'
176
+ );
177
+
178
+ // Topic author.
179
+ $this->field_map[] = array(
180
+ 'from_tablename' => 'thread',
181
+ 'from_fieldname' => 'postuserid',
182
+ 'to_type' => 'topic',
183
+ 'to_fieldname' => 'post_author',
184
+ 'callback_method' => 'callback_userid'
185
+ );
186
+
187
+ // Topic Author ip (Stored in postmeta)
188
+ // Note: We join the 'post' table because 'thread' table does not include topic content.
189
+ $this->field_map[] = array(
190
+ 'from_tablename' => 'post',
191
+ 'from_fieldname' => 'ipaddress',
192
+ 'join_tablename' => 'thread',
193
+ 'join_type' => 'INNER',
194
+ 'join_expression' => 'USING (threadid) WHERE post.parentid = 0',
195
+ 'to_type' => 'topic',
196
+ 'to_fieldname' => '_bbp_author_ip'
197
+ );
198
+
199
+ // Topic title.
200
+ $this->field_map[] = array(
201
+ 'from_tablename' => 'thread',
202
+ 'from_fieldname' => 'title',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => 'post_title'
205
+ );
206
+
207
+ // Topic slug (Clean name to avoid conflicts)
208
+ $this->field_map[] = array(
209
+ 'from_tablename' => 'thread',
210
+ 'from_fieldname' => 'title',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => 'post_name',
213
+ 'callback_method' => 'callback_slug'
214
+ );
215
+
216
+ // Topic parent forum id (If no parent, then 0)
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'thread',
219
+ 'from_fieldname' => 'forumid',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_parent',
222
+ 'callback_method' => 'callback_forumid'
223
+ );
224
+
225
+ // Topic content.
226
+ // Note: We join the 'post' table because 'thread' table does not include topic content.
227
+ $this->field_map[] = array(
228
+ 'from_tablename' => 'post',
229
+ 'from_fieldname' => 'pagetext',
230
+ 'join_tablename' => 'thread',
231
+ 'join_type' => 'INNER',
232
+ 'join_expression' => 'USING (threadid) WHERE post.parentid = 0',
233
+ 'to_type' => 'topic',
234
+ 'to_fieldname' => 'post_content',
235
+ 'callback_method' => 'callback_html'
236
+ );
237
+
238
+ // Topic status (Open or Closed)
239
+ $this->field_map[] = array(
240
+ 'from_tablename' => 'thread',
241
+ 'from_fieldname' => 'open',
242
+ 'to_type' => 'topic',
243
+ 'to_fieldname' => 'post_status',
244
+ 'callback_method' => 'callback_topic_status'
245
+ );
246
+
247
+ // Sticky status (Stored in postmeta))
248
+ $this->field_map[] = array(
249
+ 'from_tablename' => 'thread',
250
+ 'from_fieldname' => 'sticky',
251
+ 'to_type' => 'topic',
252
+ 'to_fieldname' => '_bbp_old_sticky_status',
253
+ 'callback_method' => 'callback_sticky_status'
254
+ );
255
+
256
+ // Topic dates.
257
+ $this->field_map[] = array(
258
+ 'from_tablename' => 'thread',
259
+ 'from_fieldname' => 'dateline',
260
+ 'to_type' => 'topic',
261
+ 'to_fieldname' => 'post_date',
262
+ 'callback_method' => 'callback_datetime'
263
+ );
264
+ $this->field_map[] = array(
265
+ 'from_tablename' => 'thread',
266
+ 'from_fieldname' => 'dateline',
267
+ 'to_type' => 'topic',
268
+ 'to_fieldname' => 'post_date_gmt',
269
+ 'callback_method' => 'callback_datetime'
270
+ );
271
+ $this->field_map[] = array(
272
+ 'from_tablename' => 'thread',
273
+ 'from_fieldname' => 'dateline',
274
+ 'to_type' => 'topic',
275
+ 'to_fieldname' => 'post_modified',
276
+ 'callback_method' => 'callback_datetime'
277
+ );
278
+ $this->field_map[] = array(
279
+ 'from_tablename' => 'thread',
280
+ 'from_fieldname' => 'dateline',
281
+ 'to_type' => 'topic',
282
+ 'to_fieldname' => 'post_modified_gmt',
283
+ 'callback_method' => 'callback_datetime'
284
+ );
285
+ $this->field_map[] = array(
286
+ 'from_tablename' => 'thread',
287
+ 'from_fieldname' => 'lastpost',
288
+ 'to_type' => 'topic',
289
+ 'to_fieldname' => '_bbp_last_active_time',
290
+ 'callback_method' => 'callback_datetime'
291
+ );
292
+
293
+ /** Tags Section ******************************************************/
294
+
295
+ // Topic id.
296
+ $this->field_map[] = array(
297
+ 'from_tablename' => 'tagthread',
298
+ 'from_fieldname' => 'threadid',
299
+ 'to_type' => 'tags',
300
+ 'to_fieldname' => 'objectid',
301
+ 'callback_method' => 'callback_topicid'
302
+ );
303
+
304
+ // Taxonomy ID.
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'tagthread',
307
+ 'from_fieldname' => 'tagid',
308
+ 'to_type' => 'tags',
309
+ 'to_fieldname' => 'taxonomy'
310
+ );
311
+
312
+ // Term text.
313
+ $this->field_map[] = array(
314
+ 'from_tablename' => 'tag',
315
+ 'from_fieldname' => 'tagtext',
316
+ 'join_tablename' => 'tagthread',
317
+ 'join_type' => 'INNER',
318
+ 'join_expression' => 'USING (tagid)',
319
+ 'to_type' => 'tags',
320
+ 'to_fieldname' => 'name'
321
+ );
322
+
323
+ // Term slug.
324
+ $this->field_map[] = array(
325
+ 'from_tablename' => 'tag',
326
+ 'from_fieldname' => 'tagtext',
327
+ 'join_tablename' => 'tagthread',
328
+ 'join_type' => 'INNER',
329
+ 'join_expression' => 'USING (tagid)',
330
+ 'to_type' => 'tags',
331
+ 'to_fieldname' => 'slug',
332
+ 'callback_method' => 'callback_slug'
333
+ );
334
+
335
+ /** Reply Section *****************************************************/
336
+
337
+ // Reply id (Stored in postmeta)
338
+ $this->field_map[] = array(
339
+ 'from_tablename' => 'post',
340
+ 'from_fieldname' => 'postid',
341
+ 'to_type' => 'reply',
342
+ 'to_fieldname' => '_bbp_post_id'
343
+ );
344
+
345
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
346
+ // Note: We join the 'thread' table because 'post' table does not include forum id.
347
+ $this->field_map[] = array(
348
+ 'from_tablename' => 'thread',
349
+ 'from_fieldname' => 'forumid',
350
+ 'join_tablename' => 'post',
351
+ 'join_type' => 'INNER',
352
+ 'join_expression' => 'USING (threadid) WHERE post.parentid != 0',
353
+ 'to_type' => 'reply',
354
+ 'to_fieldname' => '_bbp_forum_id',
355
+ 'callback_method' => 'callback_topicid_to_forumid'
356
+ );
357
+
358
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
359
+ $this->field_map[] = array(
360
+ 'from_tablename' => 'post',
361
+ 'from_fieldname' => 'threadid',
362
+ 'to_type' => 'reply',
363
+ 'to_fieldname' => '_bbp_topic_id',
364
+ 'callback_method' => 'callback_topicid'
365
+ );
366
+
367
+ // Reply author ip (Stored in postmeta)
368
+ $this->field_map[] = array(
369
+ 'from_tablename' => 'post',
370
+ 'from_fieldname' => 'ipaddress',
371
+ 'to_type' => 'reply',
372
+ 'to_fieldname' => '_bbp_author_ip'
373
+ );
374
+
375
+ // Reply author.
376
+ $this->field_map[] = array(
377
+ 'from_tablename' => 'post',
378
+ 'from_fieldname' => 'userid',
379
+ 'to_type' => 'reply',
380
+ 'to_fieldname' => 'post_author',
381
+ 'callback_method' => 'callback_userid'
382
+ );
383
+
384
+ // Reply title.
385
+ // Note: We join the 'thread' table because 'post' table does not include reply title.
386
+ $this->field_map[] = array(
387
+ 'from_tablename' => 'thread',
388
+ 'from_fieldname' => 'title',
389
+ 'join_tablename' => 'post',
390
+ 'join_type' => 'INNER',
391
+ 'join_expression' => 'USING (threadid) WHERE post.parentid != 0',
392
+ 'to_type' => 'reply',
393
+ 'to_fieldname' => 'post_title',
394
+ 'callback_method' => 'callback_reply_title'
395
+ );
396
+
397
+ // Reply slug (Clean name to avoid conflicts)
398
+ // Note: We join the 'thread' table because 'post' table does not include reply slug.
399
+ $this->field_map[] = array(
400
+ 'from_tablename' => 'thread',
401
+ 'from_fieldname' => 'title',
402
+ 'join_tablename' => 'post',
403
+ 'join_type' => 'INNER',
404
+ 'join_expression' => 'USING (threadid) WHERE post.parentid != 0',
405
+ 'to_type' => 'reply',
406
+ 'to_fieldname' => 'post_name',
407
+ 'callback_method' => 'callback_slug'
408
+ );
409
+
410
+ // Reply content.
411
+ $this->field_map[] = array(
412
+ 'from_tablename' => 'post',
413
+ 'from_fieldname' => 'pagetext',
414
+ 'to_type' => 'reply',
415
+ 'to_fieldname' => 'post_content',
416
+ 'callback_method' => 'callback_html'
417
+ );
418
+
419
+ // Reply parent topic id (If no parent, then 0)
420
+ $this->field_map[] = array(
421
+ 'from_tablename' => 'post',
422
+ 'from_fieldname' => 'threadid',
423
+ 'to_type' => 'reply',
424
+ 'to_fieldname' => 'post_parent',
425
+ 'callback_method' => 'callback_topicid'
426
+ );
427
+
428
+ // Reply dates.
429
+ $this->field_map[] = array(
430
+ 'from_tablename' => 'post',
431
+ 'from_fieldname' => 'dateline',
432
+ 'to_type' => 'reply',
433
+ 'to_fieldname' => 'post_date',
434
+ 'callback_method' => 'callback_datetime'
435
+ );
436
+ $this->field_map[] = array(
437
+ 'from_tablename' => 'post',
438
+ 'from_fieldname' => 'dateline',
439
+ 'to_type' => 'reply',
440
+ 'to_fieldname' => 'post_date_gmt',
441
+ 'callback_method' => 'callback_datetime'
442
+ );
443
+ $this->field_map[] = array(
444
+ 'from_tablename' => 'post',
445
+ 'from_fieldname' => 'dateline',
446
+ 'to_type' => 'reply',
447
+ 'to_fieldname' => 'post_modified',
448
+ 'callback_method' => 'callback_datetime'
449
+ );
450
+ $this->field_map[] = array(
451
+ 'from_tablename' => 'post',
452
+ 'from_fieldname' => 'dateline',
453
+ 'to_type' => 'reply',
454
+ 'to_fieldname' => 'post_modified_gmt',
455
+ 'callback_method' => 'callback_datetime'
456
+ );
457
+
458
+ /** User Section ******************************************************/
459
+
460
+ // Store old User id (Stored in usermeta)
461
+ $this->field_map[] = array(
462
+ 'from_tablename' => 'user',
463
+ 'from_fieldname' => 'userid',
464
+ 'to_type' => 'user',
465
+ 'to_fieldname' => '_bbp_user_id'
466
+ );
467
+
468
+ // Store old User password (Stored in usermeta serialized with salt)
469
+ $this->field_map[] = array(
470
+ 'from_tablename' => 'user',
471
+ 'from_fieldname' => 'password',
472
+ 'to_type' => 'user',
473
+ 'to_fieldname' => '_bbp_password',
474
+ 'callback_method' => 'callback_savepass'
475
+ );
476
+
477
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
478
+ $this->field_map[] = array(
479
+ 'from_tablename' => 'user',
480
+ 'from_fieldname' => 'salt',
481
+ 'to_type' => 'user',
482
+ 'to_fieldname' => ''
483
+ );
484
+
485
+ // User password verify class (Stored in usermeta for verifying password)
486
+ $this->field_map[] = array(
487
+ 'to_type' => 'user',
488
+ 'to_fieldname' => '_bbp_class',
489
+ 'default' => 'vBulletin3'
490
+ );
491
+
492
+ // User name.
493
+ $this->field_map[] = array(
494
+ 'from_tablename' => 'user',
495
+ 'from_fieldname' => 'username',
496
+ 'to_type' => 'user',
497
+ 'to_fieldname' => 'user_login'
498
+ );
499
+
500
+ // User email.
501
+ $this->field_map[] = array(
502
+ 'from_tablename' => 'user',
503
+ 'from_fieldname' => 'email',
504
+ 'to_type' => 'user',
505
+ 'to_fieldname' => 'user_email'
506
+ );
507
+
508
+ // User homepage.
509
+ $this->field_map[] = array(
510
+ 'from_tablename' => 'user',
511
+ 'from_fieldname' => 'homepage',
512
+ 'to_type' => 'user',
513
+ 'to_fieldname' => 'user_url'
514
+ );
515
+
516
+ // User registered.
517
+ $this->field_map[] = array(
518
+ 'from_tablename' => 'user',
519
+ 'from_fieldname' => 'joindate',
520
+ 'to_type' => 'user',
521
+ 'to_fieldname' => 'user_registered',
522
+ 'callback_method' => 'callback_datetime'
523
+ );
524
+
525
+ // User AIM (Stored in usermeta)
526
+ $this->field_map[] = array(
527
+ 'from_tablename' => 'user',
528
+ 'from_fieldname' => 'aim',
529
+ 'to_type' => 'user',
530
+ 'to_fieldname' => 'aim'
531
+ );
532
+
533
+ // User Yahoo (Stored in usermeta)
534
+ $this->field_map[] = array(
535
+ 'from_tablename' => 'user',
536
+ 'from_fieldname' => 'yahoo',
537
+ 'to_type' => 'user',
538
+ 'to_fieldname' => 'yim'
539
+ );
540
+
541
+ // User ICQ (Stored in usermeta)
542
+ $this->field_map[] = array(
543
+ 'from_tablename' => 'user',
544
+ 'from_fieldname' => 'icq',
545
+ 'to_type' => 'user',
546
+ 'to_fieldname' => '_bbp_vbulletin3_user_icq'
547
+ );
548
+
549
+ // User MSN (Stored in usermeta)
550
+ $this->field_map[] = array(
551
+ 'from_tablename' => 'user',
552
+ 'from_fieldname' => 'msn',
553
+ 'to_type' => 'user',
554
+ 'to_fieldname' => '_bbp_vbulletin3_user_msn'
555
+ );
556
+
557
+ // User Skype (Stored in usermeta)
558
+ $this->field_map[] = array(
559
+ 'from_tablename' => 'user',
560
+ 'from_fieldname' => 'skype',
561
+ 'to_type' => 'user',
562
+ 'to_fieldname' => '_bbp_vbulletin3_user_skype'
563
+ );
564
+ }
565
+
566
+ /**
567
+ * This method allows us to indicates what is or is not converted for each
568
+ * converter.
569
+ */
570
+ public function info() {
571
+ return '';
572
+ }
573
+
574
+
575
+ /**
576
+ * This method is to save the salt and password together. That
577
+ * way when we authenticate it we can get it out of the database
578
+ * as one value. Array values are auto sanitized by WordPress.
579
+ */
580
+ public function callback_savepass( $field, $row ) {
581
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
582
+ return $pass_array;
583
+ }
584
+
585
+ /**
586
+ * This method is to take the pass out of the database and compare
587
+ * to a pass the user has typed in.
588
+ *
589
+ * vBulletin passwords do not work. Maybe use the below plugin's approach?
590
+ *
591
+ * @link http://wordpress.org/extend/plugins/vb-user-copy/
592
+ * @link http://plugins.trac.wordpress.org/browser/vb-user-copy/trunk/vb_user_copy.php
593
+ */
594
+ public function authenticate_pass( $password, $serialized_pass ) {
595
+ $pass_array = unserialize( $serialized_pass );
596
+ return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
597
+ }
598
+
599
+ /**
600
+ * Translate the forum type from vBulletin v3.x numeric's to WordPress's strings.
601
+ *
602
+ * @param int $status vBulletin v3.x numeric forum type
603
+ * @return string WordPress safe
604
+ */
605
+ public function callback_forum_type( $status = 0 ) {
606
+ if ( $status == -1 ) {
607
+ $status = 'category';
608
+ } else {
609
+ $status = 'forum';
610
+ }
611
+ return $status;
612
+ }
613
+
614
+ /**
615
+ * Translate the topic sticky status type from vBulletin v3.x numeric's to WordPress's strings.
616
+ *
617
+ * @param int $status vBulletin v3.x numeric forum type
618
+ * @return string WordPress safe
619
+ */
620
+ public function callback_sticky_status( $status = 0 ) {
621
+ switch ( $status ) {
622
+ case 1 :
623
+ $status = 'sticky'; // vBulletin Sticky 'topic_sticky = 1'
624
+ break;
625
+
626
+ case 0 :
627
+ default :
628
+ $status = 'normal'; // vBulletin Normal Topic 'topic_sticky = 0'
629
+ break;
630
+ }
631
+ return $status;
632
+ }
633
+
634
+ /**
635
+ * Verify the topic reply count.
636
+ *
637
+ * @param int $count vBulletin v3.x reply count
638
+ * @return string WordPress safe
639
+ */
640
+ public function callback_topic_reply_count( $count = 1 ) {
641
+ $count = absint( (int) $count - 1 );
642
+ return $count;
643
+ }
644
+
645
+ /**
646
+ * Set the reply title
647
+ *
648
+ * @param string $title vBulletin v3.x topic title of this reply
649
+ * @return string Prefixed topic title, or empty string
650
+ */
651
+ public function callback_reply_title( $title = '' ) {
652
+ $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
653
+ return $title;
654
+ }
655
+
656
+ /**
657
+ * Translate the post status from vBulletin v3.x numeric's to WordPress's strings.
658
+ *
659
+ * @param int $status vBulletin v3.x numeric topic status
660
+ * @return string WordPress safe
661
+ */
662
+ public function callback_topic_status( $status = 1 ) {
663
+ switch ( $status ) {
664
+ case 0 :
665
+ $status = 'closed';
666
+ break;
667
+
668
+ case 1 :
669
+ default :
670
+ $status = 'publish';
671
+ break;
672
+ }
673
+ return $status;
674
+ }
675
+
676
+ /**
677
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
678
+ */
679
+ protected function callback_html( $field ) {
680
+
681
+ // Strips vBulletin custom HTML first from $field before parsing $field to parser.php
682
+ $vbulletin_markup = $field;
683
+ $vbulletin_markup = html_entity_decode( $vbulletin_markup );
684
+
685
+ // Replace '[QUOTE]' with '<blockquote>'
686
+ $vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup );
687
+ // Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>"
688
+ $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/' , '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
689
+ // Replace '[/QUOTE]' with '</blockquote>'
690
+ $vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup );
691
+ // Replace '[MENTION=###($1)]User Name($2)[/MENTION]' with '@$2"
692
+ $vbulletin_markup = preg_replace( '/\[MENTION=(.*?)\](.*?)\[\/MENTION\]/', '@$2', $vbulletin_markup );
693
+
694
+ // Replace '[video=youtube;$1]$2[/video]' with '$2"
695
+ $vbulletin_markup = preg_replace( '/\[video\=youtube;(.*?)\](.*?)\[\/video\]/', '$2', $vbulletin_markup );
696
+
697
+ // Now that vBulletin custom HTML has been stripped put the cleaned HTML back in $field
698
+ $field = $vbulletin_markup;
699
+
700
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
701
+ require_once( bbpress()->admin->admin_dir . 'parser.php' );
702
+ $bbcode = BBCode::getInstance();
703
+ $bbcode->enable_smileys = false;
704
+ $bbcode->smiley_regex = false;
705
+ return html_entity_decode( $bbcode->Parse( $field ) );
706
+ }
707
+ }
includes/admin/functions.php CHANGED
@@ -173,15 +173,22 @@ function bbp_do_uninstall( $site_id = 0 ) {
173
  function bbp_do_activation_redirect() {
174
 
175
  // Bail if no activation redirect
176
- if ( ! get_transient( '_bbp_activation_redirect' ) )
177
  return;
 
178
 
179
  // Delete the redirect transient
180
  delete_transient( '_bbp_activation_redirect' );
181
 
182
  // Bail if activating from network, or bulk
183
- if ( is_network_admin() || isset( $_GET['activate-multi'] ) )
184
  return;
 
 
 
 
 
 
185
 
186
  // Redirect to bbPress about page
187
  wp_safe_redirect( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) );
173
  function bbp_do_activation_redirect() {
174
 
175
  // Bail if no activation redirect
176
+ if ( ! get_transient( '_bbp_activation_redirect' ) ) {
177
  return;
178
+ }
179
 
180
  // Delete the redirect transient
181
  delete_transient( '_bbp_activation_redirect' );
182
 
183
  // Bail if activating from network, or bulk
184
+ if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
185
  return;
186
+ }
187
+
188
+ // Bail if the current user cannot see the about page
189
+ if ( ! current_user_can( 'bbp_about_page' ) ) {
190
+ return;
191
+ }
192
 
193
  // Redirect to bbPress about page
194
  wp_safe_redirect( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) );
includes/admin/metaboxes.php CHANGED
@@ -312,7 +312,6 @@ function bbp_forum_metabox() {
312
  'tab' => bbp_get_tab_index(),
313
  'options_only' => false,
314
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
315
- 'none_found' => false,
316
  'disable_categories' => false,
317
  'disabled' => ''
318
  ) ); ?>
@@ -324,6 +323,8 @@ function bbp_forum_metabox() {
324
  <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" />
325
  </p>
326
 
 
 
327
  <?php
328
  wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' );
329
  do_action( 'bbp_forum_metabox', $post_id );
@@ -391,12 +392,13 @@ function bbp_topic_metabox() {
391
  'tab' => bbp_get_tab_index(),
392
  'options_only' => false,
393
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
394
- 'none_found' => false,
395
  'disable_categories' => current_user_can( 'edit_forums' ),
396
  'disabled' => ''
397
  ) ); ?>
398
  </p>
399
 
 
 
400
  <?php
401
  wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' );
402
  do_action( 'bbp_topic_metabox', $post_id );
@@ -444,7 +446,6 @@ function bbp_reply_metabox() {
444
  'tab' => bbp_get_tab_index(),
445
  'options_only' => false,
446
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
447
- 'none_found' => false,
448
  'disable_categories' => current_user_can( 'edit_forums' ),
449
  'disabled' => ''
450
  ) ); ?>
@@ -464,6 +465,8 @@ function bbp_reply_metabox() {
464
  <input name="bbp_reply_to" id="bbp_reply_to" type="text" value="<?php echo esc_attr( $reply_to ); ?>" />
465
  </p>
466
 
 
 
467
  <?php
468
  wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
469
  do_action( 'bbp_reply_metabox', $post_id );
312
  'tab' => bbp_get_tab_index(),
313
  'options_only' => false,
314
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
 
315
  'disable_categories' => false,
316
  'disabled' => ''
317
  ) ); ?>
323
  <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" />
324
  </p>
325
 
326
+ <input name="ping_status" type="hidden" id="ping_status" value="open" />
327
+
328
  <?php
329
  wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' );
330
  do_action( 'bbp_forum_metabox', $post_id );
392
  'tab' => bbp_get_tab_index(),
393
  'options_only' => false,
394
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
 
395
  'disable_categories' => current_user_can( 'edit_forums' ),
396
  'disabled' => ''
397
  ) ); ?>
398
  </p>
399
 
400
+ <input name="ping_status" type="hidden" id="ping_status" value="open" />
401
+
402
  <?php
403
  wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' );
404
  do_action( 'bbp_topic_metabox', $post_id );
446
  'tab' => bbp_get_tab_index(),
447
  'options_only' => false,
448
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
 
449
  'disable_categories' => current_user_can( 'edit_forums' ),
450
  'disabled' => ''
451
  ) ); ?>
465
  <input name="bbp_reply_to" id="bbp_reply_to" type="text" value="<?php echo esc_attr( $reply_to ); ?>" />
466
  </p>
467
 
468
+ <input name="ping_status" type="hidden" id="ping_status" value="open" />
469
+
470
  <?php
471
  wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
472
  do_action( 'bbp_reply_metabox', $post_id );
includes/admin/settings.php CHANGED
@@ -193,7 +193,7 @@ function bbp_admin_get_settings_fields() {
193
  'args' => array()
194
  ),
195
 
196
- // Allow threadde replies
197
  '_bbp_allow_threaded_replies' => array(
198
  'sanitize_callback' => 'intval',
199
  'args' => array()
@@ -1281,7 +1281,7 @@ function bbp_admin_settings() {
1281
  function bbp_converter_setting_callback_main_section() {
1282
  ?>
1283
 
1284
- <p><?php esc_html_e( 'Information about your previous forums database so that they can be converted. <strong>Backup your database before proceeding.</strong>', 'bbpress' ); ?></p>
1285
 
1286
  <?php
1287
  }
193
  'args' => array()
194
  ),
195
 
196
+ // Allow threaded replies
197
  '_bbp_allow_threaded_replies' => array(
198
  'sanitize_callback' => 'intval',
199
  'args' => array()
1281
  function bbp_converter_setting_callback_main_section() {
1282
  ?>
1283
 
1284
+ <p><?php _e( 'Information about your previous forums database so that they can be converted. <strong>Backup your database before proceeding.</strong>', 'bbpress' ); ?></p>
1285
 
1286
  <?php
1287
  }
includes/admin/tools.php CHANGED
@@ -158,22 +158,23 @@ function bbp_admin_tools_feedback( $message, $class = false ) {
158
  */
159
  function bbp_admin_repair_list() {
160
  $repair_list = array(
161
- 0 => array( 'bbp-sync-topic-meta', __( 'Recalculate the parent topic for each post', 'bbpress' ), 'bbp_admin_repair_topic_meta' ),
162
- 5 => array( 'bbp-sync-forum-meta', __( 'Recalculate the parent forum for each post', 'bbpress' ), 'bbp_admin_repair_forum_meta' ),
163
- 10 => array( 'bbp-sync-forum-visibility', __( 'Recalculate private and hidden forums', 'bbpress' ), 'bbp_admin_repair_forum_visibility' ),
164
- 15 => array( 'bbp-sync-all-topics-forums', __( 'Recalculate last activity in each topic and forum', 'bbpress' ), 'bbp_admin_repair_freshness' ),
165
- 20 => array( 'bbp-sync-all-topics-sticky', __( 'Recalculate the sticky relationship of each topic', 'bbpress' ), 'bbp_admin_repair_sticky' ),
166
- 25 => array( 'bbp-group-forums', __( 'Repair BuddyPress Group Forum relationships', 'bbpress' ), 'bbp_admin_repair_group_forum_relationship' ),
167
- 30 => array( 'bbp-forum-topics', __( 'Count topics in each forum', 'bbpress' ), 'bbp_admin_repair_forum_topic_count' ),
168
- 35 => array( 'bbp-forum-replies', __( 'Count replies in each forum', 'bbpress' ), 'bbp_admin_repair_forum_reply_count' ),
169
- 40 => array( 'bbp-topic-replies', __( 'Count replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_reply_count' ),
170
- 45 => array( 'bbp-topic-voices', __( 'Count voices in each topic', 'bbpress' ), 'bbp_admin_repair_topic_voice_count' ),
171
- 50 => array( 'bbp-topic-hidden-replies', __( 'Count spammed & trashed replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_hidden_reply_count' ),
172
- 55 => array( 'bbp-user-topics', __( 'Count topics for each user', 'bbpress' ), 'bbp_admin_repair_user_topic_count' ),
173
- 60 => array( 'bbp-user-replies', __( 'Count replies for each user', 'bbpress' ), 'bbp_admin_repair_user_reply_count' ),
174
- 65 => array( 'bbp-user-favorites', __( 'Remove trashed topics from user favorites', 'bbpress' ), 'bbp_admin_repair_user_favorites' ),
175
- 70 => array( 'bbp-user-subscriptions', __( 'Remove trashed topics from user subscriptions', 'bbpress' ), 'bbp_admin_repair_user_subscriptions' ),
176
- 75 => array( 'bbp-user-role-map', __( 'Remap existing users to default forum roles', 'bbpress' ), 'bbp_admin_repair_user_roles' )
 
177
  );
178
  ksort( $repair_list );
179
 
@@ -646,7 +647,7 @@ function bbp_admin_repair_user_favorites() {
646
  }
647
 
648
  /**
649
- * Clean the users' subscriptions
650
  *
651
  * @since bbPress (r2668)
652
  *
@@ -655,7 +656,7 @@ function bbp_admin_repair_user_favorites() {
655
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
656
  * @return array An array of the status code and the message
657
  */
658
- function bbp_admin_repair_user_subscriptions() {
659
  global $wpdb;
660
 
661
  $statement = __( 'Removing trashed topics from user subscriptions&hellip; %s', 'bbpress' );
@@ -706,6 +707,67 @@ function bbp_admin_repair_user_subscriptions() {
706
  return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
707
  }
708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  /**
710
  * This repair tool will map each user of the current site to their respective
711
  * forums role. By default, Admins will be Key Masters, and every other role
@@ -1068,7 +1130,8 @@ function bbp_admin_reset() {
1068
  <?php screen_icon( 'tools' ); ?>
1069
 
1070
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Reset Forums', 'bbpress' ) ); ?></h2>
1071
- <p><?php esc_html_e( 'This will revert your forums back to a brand new installation. This process cannot be undone. <strong>Backup your database before proceeding</strong>.', 'bbpress' ); ?></p>
 
1072
 
1073
  <form class="settings" method="post" action="">
1074
  <table class="form-table">
@@ -1088,11 +1151,22 @@ function bbp_admin_reset() {
1088
  </td>
1089
  </tr>
1090
  <tr valign="top">
1091
- <th scope="row"><?php esc_html_e( 'Are you sure you want to do this?', 'bbpress' ) ?></th>
1092
  <td>
1093
  <fieldset>
1094
- <legend class="screen-reader-text"><span><?php esc_html_e( "Say it ain't so!", 'bbpress' ) ?></span></legend>
 
 
 
 
 
 
 
 
 
 
1095
  <label><input type="checkbox" class="checkbox" name="bbpress-are-you-sure" id="bbpress-are-you-sure" value="1" /> <?php esc_html_e( 'This process cannot be undone.', 'bbpress' ); ?></label>
 
1096
  </fieldset>
1097
  </td>
1098
  </tr>
@@ -1139,7 +1213,7 @@ function bbp_admin_reset_handler() {
1139
  // Flush the cache; things are about to get ugly.
1140
  wp_cache_flush();
1141
 
1142
- /** Posts *************************************************************/
1143
 
1144
  $statement = __( 'Deleting Posts&hellip; %s', 'bbpress' );
1145
  $sql_posts = $wpdb->get_results( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN ('forum', 'topic', 'reply')", OBJECT_K );
@@ -1147,10 +1221,10 @@ function bbp_admin_reset_handler() {
1147
  $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1148
  $messages[] = sprintf( $statement, $result );
1149
 
1150
-
1151
- /** Post Meta *********************************************************/
1152
 
1153
  if ( !empty( $sql_posts ) ) {
 
1154
  foreach ( $sql_posts as $key => $value ) {
1155
  $sql_meta[] = $key;
1156
  }
@@ -1161,21 +1235,43 @@ function bbp_admin_reset_handler() {
1161
  $messages[] = sprintf( $statement, $result );
1162
  }
1163
 
1164
- /** Topic Tags ********************************************************/
1165
 
1166
  $statement = __( 'Deleting Topic Tags&hellip; %s', 'bbpress' );
1167
  $sql_delete = "DELETE a,b,c FROM `{$wpdb->terms}` AS a LEFT JOIN `{$wpdb->term_taxonomy}` AS c ON a.term_id = c.term_id LEFT JOIN `{$wpdb->term_relationships}` AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'topic-tag';";
1168
  $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1169
  $messages[] = sprintf( $statement, $result );
1170
 
1171
- /** User Meta *********************************************************/
1172
 
1173
- $statement = __( 'Deleting User Meta&hellip; %s', 'bbpress' );
1174
- $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` LIKE '%%_bbp_%%';";
1175
- $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1176
- $messages[] = sprintf( $statement, $result );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1177
 
1178
- /** Converter *********************************************************/
1179
 
1180
  $statement = __( 'Deleting Conversion Table&hellip; %s', 'bbpress' );
1181
  $table_name = $wpdb->prefix . 'bbp_converter_translator';
@@ -1187,13 +1283,13 @@ function bbp_admin_reset_handler() {
1187
  }
1188
  $messages[] = sprintf( $statement, $result );
1189
 
1190
- /** Options ***********************************************************/
1191
 
1192
  $statement = __( 'Deleting Settings&hellip; %s', 'bbpress' );
1193
  bbp_delete_options();
1194
  $messages[] = sprintf( $statement, $success );
1195
 
1196
- /** Roles *************************************************************/
1197
 
1198
  $statement = __( 'Deleting Roles and Capabilities&hellip; %s', 'bbpress' );
1199
  remove_role( bbp_get_moderator_role() );
@@ -1201,7 +1297,7 @@ function bbp_admin_reset_handler() {
1201
  bbp_remove_caps();
1202
  $messages[] = sprintf( $statement, $success );
1203
 
1204
- /** Output ************************************************************/
1205
 
1206
  if ( count( $messages ) ) {
1207
  foreach ( $messages as $message ) {
158
  */
159
  function bbp_admin_repair_list() {
160
  $repair_list = array(
161
+ 0 => array( 'bbp-sync-topic-meta', __( 'Recalculate the parent topic for each post', 'bbpress' ), 'bbp_admin_repair_topic_meta' ),
162
+ 5 => array( 'bbp-sync-forum-meta', __( 'Recalculate the parent forum for each post', 'bbpress' ), 'bbp_admin_repair_forum_meta' ),
163
+ 10 => array( 'bbp-sync-forum-visibility', __( 'Recalculate private and hidden forums', 'bbpress' ), 'bbp_admin_repair_forum_visibility' ),
164
+ 15 => array( 'bbp-sync-all-topics-forums', __( 'Recalculate last activity in each topic and forum', 'bbpress' ), 'bbp_admin_repair_freshness' ),
165
+ 20 => array( 'bbp-sync-all-topics-sticky', __( 'Recalculate the sticky relationship of each topic', 'bbpress' ), 'bbp_admin_repair_sticky' ),
166
+ 25 => array( 'bbp-group-forums', __( 'Repair BuddyPress Group Forum relationships', 'bbpress' ), 'bbp_admin_repair_group_forum_relationship' ),
167
+ 30 => array( 'bbp-forum-topics', __( 'Count topics in each forum', 'bbpress' ), 'bbp_admin_repair_forum_topic_count' ),
168
+ 35 => array( 'bbp-forum-replies', __( 'Count replies in each forum', 'bbpress' ), 'bbp_admin_repair_forum_reply_count' ),
169
+ 40 => array( 'bbp-topic-replies', __( 'Count replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_reply_count' ),
170
+ 45 => array( 'bbp-topic-voices', __( 'Count voices in each topic', 'bbpress' ), 'bbp_admin_repair_topic_voice_count' ),
171
+ 50 => array( 'bbp-topic-hidden-replies', __( 'Count spammed & trashed replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_hidden_reply_count' ),
172
+ 55 => array( 'bbp-user-topics', __( 'Count topics for each user', 'bbpress' ), 'bbp_admin_repair_user_topic_count' ),
173
+ 60 => array( 'bbp-user-replies', __( 'Count replies for each user', 'bbpress' ), 'bbp_admin_repair_user_reply_count' ),
174
+ 65 => array( 'bbp-user-favorites', __( 'Remove trashed topics from user favorites', 'bbpress' ), 'bbp_admin_repair_user_favorites' ),
175
+ 70 => array( 'bbp-user-topic-subscriptions', __( 'Remove trashed topics from user subscriptions', 'bbpress' ), 'bbp_admin_repair_user_topic_subscriptions' ),
176
+ 75 => array( 'bbp-user-forum-subscriptions', __( 'Remove trashed forums from user subscriptions', 'bbpress' ), 'bbp_admin_repair_user_forum_subscriptions' ),
177
+ 80 => array( 'bbp-user-role-map', __( 'Remap existing users to default forum roles', 'bbpress' ), 'bbp_admin_repair_user_roles' )
178
  );
179
  ksort( $repair_list );
180
 
647
  }
648
 
649
  /**
650
+ * Clean the users' topic subscriptions
651
  *
652
  * @since bbPress (r2668)
653
  *
656
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
657
  * @return array An array of the status code and the message
658
  */
659
+ function bbp_admin_repair_user_topic_subscriptions() {
660
  global $wpdb;
661
 
662
  $statement = __( 'Removing trashed topics from user subscriptions&hellip; %s', 'bbpress' );
707
  return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
708
  }
709
 
710
+ /**
711
+ * Clean the users' forum subscriptions
712
+ *
713
+ * @since bbPress (r5155)
714
+ *
715
+ * @uses bbp_get_forum_post_type() To get the topic post type
716
+ * @uses wpdb::query() To run our recount sql queries
717
+ * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
718
+ * @return array An array of the status code and the message
719
+ */
720
+ function bbp_admin_repair_user_forum_subscriptions() {
721
+ global $wpdb;
722
+
723
+ $statement = __( 'Removing trashed forums from user subscriptions&hellip; %s', 'bbpress' );
724
+ $result = __( 'Failed!', 'bbpress' );
725
+ $key = $wpdb->prefix . '_bbp_forum_subscriptions';
726
+ $users = $wpdb->get_results( "SELECT `user_id`, `meta_value` AS `subscriptions` FROM `{$wpdb->usermeta}` WHERE `meta_key` = '{$key}';" );
727
+
728
+ if ( is_wp_error( $users ) )
729
+ return array( 1, sprintf( $statement, $result ) );
730
+
731
+ $forums = $wpdb->get_col( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_forum_post_type() . "' AND `post_status` = '" . bbp_get_public_status_id() . "';" );
732
+ if ( is_wp_error( $forums ) )
733
+ return array( 2, sprintf( $statement, $result ) );
734
+
735
+ $values = array();
736
+ foreach ( $users as $user ) {
737
+ if ( empty( $user->subscriptions ) || !is_string( $user->subscriptions ) )
738
+ continue;
739
+
740
+ $subscriptions = array_intersect( $forums, explode( ',', $user->subscriptions ) );
741
+ if ( empty( $subscriptions ) || !is_array( $subscriptions ) )
742
+ continue;
743
+
744
+ $subscriptions_joined = implode( ',', $subscriptions );
745
+ $values[] = "('{$user->user_id}', '{$key}', '{$subscriptions_joined}')";
746
+
747
+ // Cleanup
748
+ unset( $subscriptions, $subscriptions_joined );
749
+ }
750
+
751
+ if ( !count( $values ) ) {
752
+ $result = __( 'Nothing to remove!', 'bbpress' );
753
+ return array( 0, sprintf( $statement, $result ) );
754
+ }
755
+
756
+ $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` = '{$key}';";
757
+ if ( is_wp_error( $wpdb->query( $sql_delete ) ) )
758
+ return array( 4, sprintf( $statement, $result ) );
759
+
760
+ foreach ( array_chunk( $values, 10000 ) as $chunk ) {
761
+ $chunk = "\n" . implode( ",\n", $chunk );
762
+ $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
763
+ if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
764
+ return array( 5, sprintf( $statement, $result ) );
765
+ }
766
+ }
767
+
768
+ return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
769
+ }
770
+
771
  /**
772
  * This repair tool will map each user of the current site to their respective
773
  * forums role. By default, Admins will be Key Masters, and every other role
1130
  <?php screen_icon( 'tools' ); ?>
1131
 
1132
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Reset Forums', 'bbpress' ) ); ?></h2>
1133
+ <p><?php esc_html_e( 'Revert your forums back to a brand new installation. This process cannot be undone.', 'bbpress' ); ?></p>
1134
+ <p><strong><?php esc_html_e( 'Backup your database before proceeding.', 'bbpress' ); ?></strong></p>
1135
 
1136
  <form class="settings" method="post" action="">
1137
  <table class="form-table">
1151
  </td>
1152
  </tr>
1153
  <tr valign="top">
1154
+ <th scope="row"><?php esc_html_e( 'Delete imported users?', 'bbpress' ); ?></th>
1155
  <td>
1156
  <fieldset>
1157
+ <legend class="screen-reader-text"><span><?php esc_html_e( "Say it ain't so!", 'bbpress' ); ?></span></legend>
1158
+ <label><input type="checkbox" class="checkbox" name="bbpress-delete-imported-users" id="bbpress-delete-imported-users" value="1" /> <?php esc_html_e( 'This option will delete all previously imported users, and cannot be undone.', 'bbpress' ); ?></label>
1159
+ <p class="description"><?php esc_html_e( 'Note: Resetting without this checked will delete the meta-data necessary to delete these users.', 'bbpress' ); ?></p>
1160
+ </fieldset>
1161
+ </td>
1162
+ </tr>
1163
+ <tr valign="top">
1164
+ <th scope="row"><?php esc_html_e( 'Are you sure you want to do this?', 'bbpress' ); ?></th>
1165
+ <td>
1166
+ <fieldset>
1167
+ <legend class="screen-reader-text"><span><?php esc_html_e( "Say it ain't so!", 'bbpress' ); ?></span></legend>
1168
  <label><input type="checkbox" class="checkbox" name="bbpress-are-you-sure" id="bbpress-are-you-sure" value="1" /> <?php esc_html_e( 'This process cannot be undone.', 'bbpress' ); ?></label>
1169
+ <p class="description"><?php esc_html_e( 'Human sacrifice, dogs and cats living together... mass hysteria!', 'bbpress' ); ?></p>
1170
  </fieldset>
1171
  </td>
1172
  </tr>
1213
  // Flush the cache; things are about to get ugly.
1214
  wp_cache_flush();
1215
 
1216
+ /** Posts *****************************************************************/
1217
 
1218
  $statement = __( 'Deleting Posts&hellip; %s', 'bbpress' );
1219
  $sql_posts = $wpdb->get_results( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN ('forum', 'topic', 'reply')", OBJECT_K );
1221
  $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1222
  $messages[] = sprintf( $statement, $result );
1223
 
1224
+ /** Post Meta *************************************************************/
 
1225
 
1226
  if ( !empty( $sql_posts ) ) {
1227
+ $sql_meta = array();
1228
  foreach ( $sql_posts as $key => $value ) {
1229
  $sql_meta[] = $key;
1230
  }
1235
  $messages[] = sprintf( $statement, $result );
1236
  }
1237
 
1238
+ /** Topic Tags ************************************************************/
1239
 
1240
  $statement = __( 'Deleting Topic Tags&hellip; %s', 'bbpress' );
1241
  $sql_delete = "DELETE a,b,c FROM `{$wpdb->terms}` AS a LEFT JOIN `{$wpdb->term_taxonomy}` AS c ON a.term_id = c.term_id LEFT JOIN `{$wpdb->term_relationships}` AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'topic-tag';";
1242
  $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1243
  $messages[] = sprintf( $statement, $result );
1244
 
1245
+ /** User ******************************************************************/
1246
 
1247
+ // Delete users
1248
+ if ( !empty( $_POST['bbpress-delete-imported-users'] ) ) {
1249
+ $sql_users = $wpdb->get_results( "SELECT `user_id` FROM `{$wpdb->usermeta}` WHERE `meta_key` = '_bbp_user_id'", OBJECT_K );
1250
+ if ( !empty( $sql_users ) ) {
1251
+ $sql_meta = array();
1252
+ foreach ( $sql_users as $key => $value ) {
1253
+ $sql_meta[] = $key;
1254
+ }
1255
+ $statement = __( 'Deleting User&hellip; %s', 'bbpress' );
1256
+ $sql_meta = implode( "', '", $sql_meta );
1257
+ $sql_delete = "DELETE FROM `{$wpdb->users}` WHERE `ID` IN ('{$sql_meta}');";
1258
+ $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1259
+ $messages[] = sprintf( $statement, $result );
1260
+ $statement = __( 'Deleting User Meta&hellip; %s', 'bbpress' );
1261
+ $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `user_id` IN ('{$sql_meta}');";
1262
+ $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1263
+ $messages[] = sprintf( $statement, $result );
1264
+ }
1265
+
1266
+ // Delete imported user metadata
1267
+ } else {
1268
+ $statement = __( 'Deleting User Meta&hellip; %s', 'bbpress' );
1269
+ $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` LIKE '%%_bbp_%%';";
1270
+ $result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
1271
+ $messages[] = sprintf( $statement, $result );
1272
+ }
1273
 
1274
+ /** Converter *************************************************************/
1275
 
1276
  $statement = __( 'Deleting Conversion Table&hellip; %s', 'bbpress' );
1277
  $table_name = $wpdb->prefix . 'bbp_converter_translator';
1283
  }
1284
  $messages[] = sprintf( $statement, $result );
1285
 
1286
+ /** Options ***************************************************************/
1287
 
1288
  $statement = __( 'Deleting Settings&hellip; %s', 'bbpress' );
1289
  bbp_delete_options();
1290
  $messages[] = sprintf( $statement, $success );
1291
 
1292
+ /** Roles *****************************************************************/
1293
 
1294
  $statement = __( 'Deleting Roles and Capabilities&hellip; %s', 'bbpress' );
1295
  remove_role( bbp_get_moderator_role() );
1297
  bbp_remove_caps();
1298
  $messages[] = sprintf( $statement, $success );
1299
 
1300
+ /** Output ****************************************************************/
1301
 
1302
  if ( count( $messages ) ) {
1303
  foreach ( $messages as $message ) {
includes/common/classes.php CHANGED
@@ -386,19 +386,13 @@ class BBP_Walker_Reply extends Walker {
386
  }
387
 
388
  // Style for div or list element
389
- if ( 'div' === $args['style'] ) {
390
- $tag = 'div';
391
  } else {
392
- $tag = 'li';
393
- } ?>
394
-
395
- <<?php echo $tag ?>>
396
-
397
- <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
398
-
399
- </<?php echo $tag ?>>
400
 
401
- <?php
402
  }
403
 
404
  /**
386
  }
387
 
388
  // Style for div or list element
389
+ if ( !empty( $args['style'] ) && ( 'div' === $args['style'] ) ) {
390
+ echo "<div>\n";
391
  } else {
392
+ echo "<li>\n";
393
+ }
 
 
 
 
 
 
394
 
395
+ bbp_get_template_part( 'loop', 'single-reply' );
396
  }
397
 
398
  /**
includes/common/functions.php CHANGED
@@ -780,7 +780,7 @@ function bbp_check_for_moderation( $anonymous_data = false, $author_id = 0, $tit
780
  return true;
781
 
782
  // Bail if keymaster is author
783
- if ( bbp_is_user_keymaster( $author_id ) )
784
  return true;
785
 
786
  // Define local variable(s)
@@ -899,7 +899,7 @@ function bbp_check_for_blacklist( $anonymous_data = false, $author_id = 0, $titl
899
  return true;
900
 
901
  // Bail if keymaster is author
902
- if ( bbp_is_user_keymaster( $author_id ) )
903
  return true;
904
 
905
  // Define local variable
@@ -982,7 +982,7 @@ function bbp_check_for_blacklist( $anonymous_data = false, $author_id = 0, $titl
982
  /** Subscriptions *************************************************************/
983
 
984
  /**
985
- * Sends notification emails for new posts
986
  *
987
  * Gets new post's ID and check if there are subscribed users to that topic, and
988
  * if there are, send notifications
@@ -992,22 +992,26 @@ function bbp_check_for_blacklist( $anonymous_data = false, $author_id = 0, $titl
992
  * @param int $reply_id ID of the newly made reply
993
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
994
  * @uses bbp_get_reply_id() To validate the reply ID
 
 
995
  * @uses bbp_get_reply() To get the reply
996
- * @uses bbp_get_reply_topic_id() To get the topic ID of the reply
997
  * @uses bbp_is_reply_published() To make sure the reply is published
998
  * @uses bbp_get_topic_id() To validate the topic ID
999
  * @uses bbp_get_topic() To get the reply's topic
1000
  * @uses bbp_is_topic_published() To make sure the topic is published
1001
- * @uses get_the_author_meta() To get the author's display name
1002
- * @uses do_action() Calls 'bbp_pre_notify_subscribers' with the reply id and
1003
- * topic id
1004
  * @uses bbp_get_topic_subscribers() To get the topic subscribers
1005
  * @uses apply_filters() Calls 'bbp_subscription_mail_message' with the
1006
- * message, reply id, topic id and user id
 
 
 
1007
  * @uses get_userdata() To get the user data
1008
  * @uses wp_mail() To send the mail
1009
- * @uses do_action() Calls 'bbp_post_notify_subscribers' with the reply id
1010
- * and topic id
1011
  * @return bool True on success, false on failure
1012
  */
1013
  function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $reply_author = 0 ) {
@@ -1036,7 +1040,7 @@ function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $a
1036
 
1037
  /** User ******************************************************************/
1038
 
1039
- // Get subscribers and bail if empty
1040
  $user_ids = bbp_get_topic_subscribers( $topic_id, true );
1041
  if ( empty( $user_ids ) )
1042
  return false;
@@ -1108,6 +1112,124 @@ Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
1108
  return true;
1109
  }
1110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  /** Login *********************************************************************/
1112
 
1113
  /**
@@ -1713,10 +1835,10 @@ function bbp_request_feed_trap( $query_vars = array() ) {
1713
  }
1714
 
1715
  // Single Topic Vview
1716
- } elseif ( isset( $query_vars['bbp_view'] ) ) {
1717
 
1718
  // Get the view
1719
- $view = $query_vars['bbp_view'];
1720
 
1721
  // We have a view to display a feed
1722
  if ( !empty( $view ) ) {
780
  return true;
781
 
782
  // Bail if keymaster is author
783
+ if ( !empty( $author_id ) && bbp_is_user_keymaster( $author_id ) )
784
  return true;
785
 
786
  // Define local variable(s)
899
  return true;
900
 
901
  // Bail if keymaster is author
902
+ if ( !empty( $author_id ) && bbp_is_user_keymaster( $author_id ) )
903
  return true;
904
 
905
  // Define local variable
982
  /** Subscriptions *************************************************************/
983
 
984
  /**
985
+ * Sends notification emails for new replies to subscribed topics
986
  *
987
  * Gets new post's ID and check if there are subscribed users to that topic, and
988
  * if there are, send notifications
992
  * @param int $reply_id ID of the newly made reply
993
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
994
  * @uses bbp_get_reply_id() To validate the reply ID
995
+ * @uses bbp_get_topic_id() To validate the topic ID
996
+ * @uses bbp_get_forum_id() To validate the forum ID
997
  * @uses bbp_get_reply() To get the reply
 
998
  * @uses bbp_is_reply_published() To make sure the reply is published
999
  * @uses bbp_get_topic_id() To validate the topic ID
1000
  * @uses bbp_get_topic() To get the reply's topic
1001
  * @uses bbp_is_topic_published() To make sure the topic is published
1002
+ * @uses bbp_get_reply_author_display_name() To get the reply author's display name
1003
+ * @uses do_action() Calls 'bbp_pre_notify_subscribers' with the reply id,
1004
+ * topic id and user id
1005
  * @uses bbp_get_topic_subscribers() To get the topic subscribers
1006
  * @uses apply_filters() Calls 'bbp_subscription_mail_message' with the
1007
+ * message, reply id, topic id and user id
1008
+ * @uses apply_filters() Calls 'bbp_subscription_mail_title' with the
1009
+ * topic title, reply id, topic id and user id
1010
+ * @uses apply_filters() Calls 'bbp_subscription_mail_headers'
1011
  * @uses get_userdata() To get the user data
1012
  * @uses wp_mail() To send the mail
1013
+ * @uses do_action() Calls 'bbp_post_notify_subscribers' with the reply id,
1014
+ * topic id and user id
1015
  * @return bool True on success, false on failure
1016
  */
1017
  function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $reply_author = 0 ) {
1040
 
1041
  /** User ******************************************************************/
1042
 
1043
+ // Get topic subscribers and bail if empty
1044
  $user_ids = bbp_get_topic_subscribers( $topic_id, true );
1045
  if ( empty( $user_ids ) )
1046
  return false;
1112
  return true;
1113
  }
1114
 
1115
+ /**
1116
+ * Sends notification emails for new topics to subscribed forums
1117
+ *
1118
+ * Gets new post's ID and check if there are subscribed users to that topic, and
1119
+ * if there are, send notifications
1120
+ *
1121
+ * @since bbPress (r5156)
1122
+ *
1123
+ * @param int $topic_id ID of the newly made reply
1124
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
1125
+ * @uses bbp_get_topic_id() To validate the topic ID
1126
+ * @uses bbp_get_forum_id() To validate the forum ID
1127
+ * @uses bbp_is_topic_published() To make sure the topic is published
1128
+ * @uses bbp_get_forum_subscribers() To get the forum subscribers
1129
+ * @uses bbp_get_topic_author_display_name() To get the topic author's display name
1130
+ * @uses do_action() Calls 'bbp_pre_notify_forum_subscribers' with the topic id,
1131
+ * forum id and user id
1132
+ * @uses apply_filters() Calls 'bbp_forum_subscription_mail_message' with the
1133
+ * message, topic id, forum id and user id
1134
+ * @uses apply_filters() Calls 'bbp_forum_subscription_mail_title' with the
1135
+ * topic title, topic id, forum id and user id
1136
+ * @uses apply_filters() Calls 'bbp_forum_subscription_mail_headers'
1137
+ * @uses get_userdata() To get the user data
1138
+ * @uses wp_mail() To send the mail
1139
+ * @uses do_action() Calls 'bbp_post_notify_forum_subscribers' with the topic,
1140
+ * id, forum id and user id
1141
+ * @return bool True on success, false on failure
1142
+ */
1143
+ function bbp_notify_forum_subscribers( $topic_id = 0, $forum_id = 0, $anonymous_data = false, $topic_author = 0 ) {
1144
+
1145
+ // Bail if subscriptions are turned off
1146
+ if ( !bbp_is_subscriptions_active() )
1147
+ return false;
1148
+
1149
+ /** Validation ************************************************************/
1150
+
1151
+ $topic_id = bbp_get_topic_id( $topic_id );
1152
+ $forum_id = bbp_get_forum_id( $forum_id );
1153
+
1154
+ /** Topic *****************************************************************/
1155
+
1156
+ // Bail if topic is not published
1157
+ if ( ! bbp_is_topic_published( $topic_id ) )
1158
+ return false;
1159
+
1160
+ /** User ******************************************************************/
1161
+
1162
+ // Get forum subscribers and bail if empty
1163
+ $user_ids = bbp_get_forum_subscribers( $forum_id, true );
1164
+ if ( empty( $user_ids ) )
1165
+ return false;
1166
+
1167
+ // Poster name
1168
+ $topic_author_name = bbp_get_topic_author_display_name( $topic_id );
1169
+
1170
+ /** Mail ******************************************************************/
1171
+
1172
+ do_action( 'bbp_pre_notify_forum_subscribers', $topic_id, $forum_id, $user_ids );
1173
+
1174
+ // Remove filters from reply content and topic title to prevent content
1175
+ // from being encoded with HTML entities, wrapped in paragraph tags, etc...
1176
+ remove_all_filters( 'bbp_get_topic_content' );
1177
+ remove_all_filters( 'bbp_get_topic_title' );
1178
+
1179
+ // Strip tags from text
1180
+ $topic_title = strip_tags( bbp_get_topic_title( $topic_id ) );
1181
+ $topic_content = strip_tags( bbp_get_topic_content( $topic_id ) );
1182
+ $topic_url = get_permalink( $topic_id );
1183
+ $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
1184
+
1185
+ // Loop through users
1186
+ foreach ( (array) $user_ids as $user_id ) {
1187
+
1188
+ // Don't send notifications to the person who made the post
1189
+ if ( !empty( $topic_author ) && (int) $user_id === (int) $topic_author )
1190
+ continue;
1191
+
1192
+ // For plugins to filter messages per reply/topic/user
1193
+ $message = sprintf( __( '%1$s wrote:
1194
+
1195
+ %2$s
1196
+
1197
+ Topic Link: %3$s
1198
+
1199
+ -----------
1200
+
1201
+ You are receiving this email because you subscribed to a forum.
1202
+
1203
+ Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
1204
+
1205
+ $topic_author_name,
1206
+ $topic_content,
1207
+ $topic_url
1208
+ );
1209
+ $message = apply_filters( 'bbp_forum_subscription_mail_message', $message, $topic_id, $forum_id, $user_id );
1210
+ if ( empty( $message ) )
1211
+ continue;
1212
+
1213
+ // For plugins to filter titles per reply/topic/user
1214
+ $subject = apply_filters( 'bbp_forum_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $topic_id, $forum_id, $user_id );
1215
+ if ( empty( $subject ) )
1216
+ continue;
1217
+
1218
+ // Custom headers
1219
+ $headers = apply_filters( 'bbp_forum_subscription_mail_headers', array() );
1220
+
1221
+ // Get user data of this user
1222
+ $user = get_userdata( $user_id );
1223
+
1224
+ // Send notification email
1225
+ wp_mail( $user->user_email, $subject, $message, $headers );
1226
+ }
1227
+
1228
+ do_action( 'bbp_post_notify_forum_subscribers', $topic_id, $forum_id, $user_ids );
1229
+
1230
+ return true;
1231
+ }
1232
+
1233
  /** Login *********************************************************************/
1234
 
1235
  /**
1835
  }
1836
 
1837
  // Single Topic Vview
1838
+ } elseif ( isset( $query_vars[ bbp_get_view_rewrite_id() ] ) ) {
1839
 
1840
  // Get the view
1841
+ $view = $query_vars[ bbp_get_view_rewrite_id() ];
1842
 
1843
  // We have a view to display a feed
1844
  if ( !empty( $view ) ) {
includes/common/shortcodes.php CHANGED
@@ -125,6 +125,7 @@ class BBP_Shortcodes {
125
  $bbp->search_query = new WP_Query();
126
 
127
  // Unset global ID's
 
128
  $bbp->current_forum_id = 0;
129
  $bbp->current_topic_id = 0;
130
  $bbp->current_reply_id = 0;
@@ -623,6 +624,9 @@ class BBP_Shortcodes {
623
  // Unset globals
624
  $this->unset_globals();
625
 
 
 
 
626
  // Load the view
627
  bbp_view_query( $view_id );
628
 
@@ -698,7 +702,7 @@ class BBP_Shortcodes {
698
  set_query_var( bbp_get_search_rewrite_id(), $search_terms );
699
 
700
  // Start output buffer
701
- $this->start( 'bbp_search' );
702
 
703
  // Output template
704
  bbp_get_template_part( 'content', 'search' );
125
  $bbp->search_query = new WP_Query();
126
 
127
  // Unset global ID's
128
+ $bbp->current_view_id = 0;
129
  $bbp->current_forum_id = 0;
130
  $bbp->current_topic_id = 0;
131
  $bbp->current_reply_id = 0;
624
  // Unset globals
625
  $this->unset_globals();
626
 
627
+ // Set the current view ID
628
+ bbpress()->current_view_id = $view_id;
629
+
630
  // Load the view
631
  bbp_view_query( $view_id );
632
 
702
  set_query_var( bbp_get_search_rewrite_id(), $search_terms );
703
 
704
  // Start output buffer
705
+ $this->start( bbp_get_search_rewrite_id() );
706
 
707
  // Output template
708
  bbp_get_template_part( 'content', 'search' );
includes/common/template.php CHANGED
@@ -806,7 +806,7 @@ function bbp_is_search() {
806
  $retval = true;
807
 
808
  // Check query name
809
- if ( empty( $retval ) && bbp_is_query_name( 'bbp_search' ) )
810
  $retval = true;
811
 
812
  // Check $_GET
@@ -844,7 +844,7 @@ function bbp_is_search_results() {
844
  $retval = true;
845
 
846
  // Check $_REQUEST
847
- if ( empty( $retval ) && !empty( $_REQUEST[bbp_get_search_rewrite_id()] ) )
848
  $retval = true;
849
 
850
  return (bool) apply_filters( 'bbp_is_search_results', $retval );
@@ -1330,10 +1330,7 @@ function bbp_dropdown( $args = '' ) {
1330
  * - select_id: ID of the select box. Defaults to 'bbp_forum_id'
1331
  * - tab: Tabindex value. False or integer
1332
  * - options_only: Show only <options>? No <select>?
1333
- * - show_none: False or something like __( '(No Forum)', 'bbpress' ),
1334
- * will have value=""
1335
- * - none_found: False or something like
1336
- * __( 'No forums to post to!', 'bbpress' )
1337
  * - disable_categories: Disable forum categories and closed forums?
1338
  * Defaults to true. Only for forums and when
1339
  * the category option is displayed.
@@ -1370,7 +1367,6 @@ function bbp_dropdown( $args = '' ) {
1370
  'tab' => bbp_get_tab_index(),
1371
  'options_only' => false,
1372
  'show_none' => false,
1373
- 'none_found' => false,
1374
  'disable_categories' => true,
1375
  'disabled' => ''
1376
  ), 'get_dropdown' );
@@ -1407,52 +1403,68 @@ function bbp_dropdown( $args = '' ) {
1407
 
1408
  /** Drop Down *********************************************************/
1409
 
1410
- // Items found
1411
- if ( !empty( $posts ) ) {
1412
 
1413
- // Build the opening tag for the select element
1414
- if ( empty( $r['options_only'] ) ) {
1415
 
1416
- // Should this select appear disabled?
1417
- $disabled = disabled( isset( bbpress()->options[ $r['disabled'] ] ), true, false );
1418
 
1419
- // Setup the tab index attribute
1420
- $tab = !empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : '';
 
1421
 
1422
- // Build the opening tag
1423
- $retval .= '<select name="' . esc_attr( $r['select_id'] ) . '" id="' . esc_attr( $r['select_id'] ) . '"' . $disabled . $tab . '>' . "\n";
1424
- }
1425
 
1426
- // Get the options
1427
- $retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . esc_html( $r['show_none'] ) . '</option>' : '';
1428
- $retval .= walk_page_dropdown_tree( $posts, 0, $r );
1429
 
1430
- // Build the closing tag for the select element
1431
- if ( empty( $r['options_only'] ) ) {
1432
- $retval .= '</select>';
1433
- }
1434
 
1435
- // No items found - Display feedback if no custom message was passed
1436
- } elseif ( empty( $r['none_found'] ) ) {
 
1437
 
1438
- // Switch the response based on post type
1439
- switch ( $r['post_type'] ) {
1440
 
1441
- // Topics
1442
- case bbp_get_topic_post_type() :
1443
- $retval = __( 'No topics available', 'bbpress' );
1444
- break;
1445
 
1446
- // Forums
1447
- case bbp_get_forum_post_type() :
1448
- $retval = __( 'No forums available', 'bbpress' );
1449
- break;
1450
 
1451
- // Any other
1452
- default :
1453
- $retval = __( 'None available', 'bbpress' );
1454
- break;
 
 
 
 
 
 
1455
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1456
  }
1457
 
1458
  return apply_filters( 'bbp_get_dropdown', $retval, $r );
@@ -1567,7 +1579,6 @@ function bbp_reply_form_fields() {
1567
 
1568
  if ( bbp_is_reply_edit() ) : ?>
1569
 
1570
- <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php bbp_reply_title(); ?>" />
1571
  <input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php bbp_reply_id(); ?>" />
1572
  <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" />
1573
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-reply" />
@@ -1579,7 +1590,6 @@ function bbp_reply_form_fields() {
1579
 
1580
  else : ?>
1581
 
1582
- <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" />
1583
  <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" />
1584
  <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" />
1585
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-reply" />
@@ -1876,23 +1886,30 @@ function bbp_view_id( $view = '' ) {
1876
  /**
1877
  * Get the view id
1878
  *
1879
- * If a view id is supplied, that is used. Otherwise the 'bbp_view'
1880
- * query var is checked for.
1881
  *
1882
  * @since bbPress (r2789)
1883
  *
1884
  * @param string $view Optional. View id.
1885
  * @uses sanitize_title() To sanitize the view id
1886
- * @uses get_query_var() To get the view id from query var 'bbp_view'
 
1887
  * @return bool|string ID on success, false on failure
1888
  */
1889
  function bbp_get_view_id( $view = '' ) {
1890
  $bbp = bbpress();
1891
 
1892
- $view = !empty( $view ) ? sanitize_title( $view ) : get_query_var( 'bbp_view' );
 
 
 
 
 
 
1893
 
1894
- if ( array_key_exists( $view, $bbp->views ) )
1895
  return $view;
 
1896
 
1897
  return false;
1898
  }
@@ -1969,7 +1986,7 @@ function bbp_view_url( $view = false ) {
1969
 
1970
  // Unpretty permalinks
1971
  } else {
1972
- $url = add_query_arg( array( 'bbp_view' => $view ), home_url( '/' ) );
1973
  }
1974
 
1975
  return apply_filters( 'bbp_get_view_link', $url, $view );
@@ -2562,24 +2579,44 @@ function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
2562
  // Profile page
2563
  } elseif ( bbp_is_single_user() ) {
2564
 
2565
- // Current users profile
2566
  if ( bbp_is_user_home() ) {
2567
- $new_title['text'] = esc_attr__( 'Your Profile', 'bbpress' );
2568
 
2569
- // Other users profile
2570
  } else {
2571
- $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
2572
- $new_title['format'] = esc_attr__( "%s's Profile", 'bbpress' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2573
  }
2574
 
2575
  // Profile edit page
2576
  } elseif ( bbp_is_single_user_edit() ) {
2577
 
2578
- // Current users profile
2579
  if ( bbp_is_user_home_edit() ) {
2580
  $new_title['text'] = esc_attr__( 'Edit Your Profile', 'bbpress' );
2581
 
2582
- // Other users profile
2583
  } else {
2584
  $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
2585
  $new_title['format'] = esc_attr__( "Edit %s's Profile", 'bbpress' );
806
  $retval = true;
807
 
808
  // Check query name
809
+ if ( empty( $retval ) && bbp_is_query_name( bbp_get_search_rewrite_id() ) )
810
  $retval = true;
811
 
812
  // Check $_GET
844
  $retval = true;
845
 
846
  // Check $_REQUEST
847
+ if ( empty( $retval ) && !empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) )
848
  $retval = true;
849
 
850
  return (bool) apply_filters( 'bbp_is_search_results', $retval );
1330
  * - select_id: ID of the select box. Defaults to 'bbp_forum_id'
1331
  * - tab: Tabindex value. False or integer
1332
  * - options_only: Show only <options>? No <select>?
1333
+ * - show_none: Boolean or String __( '(No Forum)', 'bbpress' )
 
 
 
1334
  * - disable_categories: Disable forum categories and closed forums?
1335
  * Defaults to true. Only for forums and when
1336
  * the category option is displayed.
1367
  'tab' => bbp_get_tab_index(),
1368
  'options_only' => false,
1369
  'show_none' => false,
 
1370
  'disable_categories' => true,
1371
  'disabled' => ''
1372
  ), 'get_dropdown' );
1403
 
1404
  /** Drop Down *********************************************************/
1405
 
1406
+ // Build the opening tag for the select element
1407
+ if ( empty( $r['options_only'] ) ) {
1408
 
1409
+ // Should this select appear disabled?
1410
+ $disabled = disabled( isset( bbpress()->options[ $r['disabled'] ] ), true, false );
1411
 
1412
+ // Setup the tab index attribute
1413
+ $tab = !empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : '';
1414
 
1415
+ // Open the select tag
1416
+ $retval .= '<select name="' . esc_attr( $r['select_id'] ) . '" id="' . esc_attr( $r['select_id'] ) . '"' . $disabled . $tab . '>' . "\n";
1417
+ }
1418
 
1419
+ // Display a leading 'no-value' option, with or without custom text
1420
+ if ( !empty( $r['show_none'] ) || !empty( $r['none_found'] ) ) {
 
1421
 
1422
+ // Open the 'no-value' option tag
1423
+ $retval .= "\t<option value=\"\" class=\"level-0\">";
 
1424
 
1425
+ // Use deprecated 'none_found' first for backpat
1426
+ if ( ! empty( $r['none_found'] ) && is_string( $r['none_found'] ) ) {
1427
+ $retval .= esc_html( $r['none_found'] );
 
1428
 
1429
+ // Use 'show_none' second
1430
+ } elseif ( ! empty( $r['show_none'] ) && is_string( $r['show_none'] ) ) {
1431
+ $retval .= esc_html( $r['show_none'] );
1432
 
1433
+ // Otherwise, make some educated guesses
1434
+ } else {
1435
 
1436
+ // Switch the response based on post type
1437
+ switch ( $r['post_type'] ) {
 
 
1438
 
1439
+ // Topics
1440
+ case bbp_get_topic_post_type() :
1441
+ $retval .= esc_html__( 'No topics available', 'bbpress' );
1442
+ break;
1443
 
1444
+ // Forums
1445
+ case bbp_get_forum_post_type() :
1446
+ $retval .= esc_html__( 'No forums available', 'bbpress' );
1447
+ break;
1448
+
1449
+ // Any other
1450
+ default :
1451
+ $retval .= esc_html__( 'None available', 'bbpress' );
1452
+ break;
1453
+ }
1454
  }
1455
+
1456
+ // Close the 'no-value' option tag
1457
+ $retval .= '</option>';
1458
+ }
1459
+
1460
+ // Items found so walk the tree
1461
+ if ( !empty( $posts ) ) {
1462
+ $retval .= walk_page_dropdown_tree( $posts, 0, $r );
1463
+ }
1464
+
1465
+ // Close the selecet tag
1466
+ if ( empty( $r['options_only'] ) ) {
1467
+ $retval .= '</select>';
1468
  }
1469
 
1470
  return apply_filters( 'bbp_get_dropdown', $retval, $r );
1579
 
1580
  if ( bbp_is_reply_edit() ) : ?>
1581
 
 
1582
  <input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php bbp_reply_id(); ?>" />
1583
  <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" />
1584
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-reply" />
1590
 
1591
  else : ?>
1592
 
 
1593
  <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" />
1594
  <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" />
1595
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-reply" />
1886
  /**
1887
  * Get the view id
1888
  *
1889
+ * Use view id if supplied, otherwise bbp_get_view_rewrite_id() query var.
 
1890
  *
1891
  * @since bbPress (r2789)
1892
  *
1893
  * @param string $view Optional. View id.
1894
  * @uses sanitize_title() To sanitize the view id
1895
+ * @uses get_query_var() To get the view id query variable
1896
+ * @uses bbp_get_view_rewrite_id() To get the view rewrite ID
1897
  * @return bool|string ID on success, false on failure
1898
  */
1899
  function bbp_get_view_id( $view = '' ) {
1900
  $bbp = bbpress();
1901
 
1902
+ if ( !empty( $view ) ) {
1903
+ $view = sanitize_title( $view );
1904
+ } elseif ( ! empty( $bbp->current_view_id ) ) {
1905
+ $view = $bbp->current_view_id;
1906
+ } else {
1907
+ $view = get_query_var( bbp_get_view_rewrite_id() );
1908
+ }
1909
 
1910
+ if ( array_key_exists( $view, $bbp->views ) ) {
1911
  return $view;
1912
+ }
1913
 
1914
  return false;
1915
  }
1986
 
1987
  // Unpretty permalinks
1988
  } else {
1989
+ $url = add_query_arg( array( bbp_get_view_rewrite_id() => $view ), home_url( '/' ) );
1990
  }
1991
 
1992
  return apply_filters( 'bbp_get_view_link', $url, $view );
2579
  // Profile page
2580
  } elseif ( bbp_is_single_user() ) {
2581
 
2582
+ // User is viewing their own profile
2583
  if ( bbp_is_user_home() ) {
2584
+ $new_title['text'] = esc_attr_x( 'Your', 'User viewing his/her own profile', 'bbpress' );
2585
 
2586
+ // User is viewing someone else's profile (so use their display name)
2587
  } else {
2588
+ $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
2589
+ }
2590
+
2591
+ // User topics created
2592
+ if ( bbp_is_single_user_topics() ) {
2593
+ $new_title['format'] = esc_attr__( "%s's Topics", 'bbpress' );
2594
+
2595
+ // User rueplies created
2596
+ } elseif ( bbp_is_single_user_replies() ) {
2597
+ $new_title['format'] = esc_attr__( "%s's Replies", 'bbpress' );
2598
+
2599
+ // User favorites
2600
+ } elseif ( bbp_is_favorites() ) {
2601
+ $new_title['format'] = esc_attr__( "%s's Favorites", 'bbpress' );
2602
+
2603
+ // User subscriptions
2604
+ } elseif ( bbp_is_subscriptions() ) {
2605
+ $new_title['format'] = esc_attr__( "%s's Subscriptions", 'bbpress' );
2606
+
2607
+ // User "home"
2608
+ } else {
2609
+ $new_title['format'] = esc_attr__( "%s's Profile", 'bbpress' );
2610
  }
2611
 
2612
  // Profile edit page
2613
  } elseif ( bbp_is_single_user_edit() ) {
2614
 
2615
+ // Current user
2616
  if ( bbp_is_user_home_edit() ) {
2617
  $new_title['text'] = esc_attr__( 'Edit Your Profile', 'bbpress' );
2618
 
2619
+ // Other user
2620
  } else {
2621
  $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
2622
  $new_title['format'] = esc_attr__( "Edit %s's Profile", 'bbpress' );
includes/common/widgets.php CHANGED
@@ -1101,7 +1101,6 @@ class BBP_Replies_Widget extends WP_Widget {
1101
  * @param array $instance
1102
  * @uses apply_filters() Calls 'bbp_reply_widget_title' with the title
1103
  * @uses bbp_get_reply_author_link() To get the reply author link
1104
- * @uses bbp_get_reply_author() To get the reply author name
1105
  * @uses bbp_get_reply_id() To get the reply id
1106
  * @uses bbp_get_reply_url() To get the reply url
1107
  * @uses bbp_get_reply_excerpt() To get the reply excerpt
1101
  * @param array $instance
1102
  * @uses apply_filters() Calls 'bbp_reply_widget_title' with the title
1103
  * @uses bbp_get_reply_author_link() To get the reply author link
 
1104
  * @uses bbp_get_reply_id() To get the reply id
1105
  * @uses bbp_get_reply_url() To get the reply url
1106
  * @uses bbp_get_reply_excerpt() To get the reply excerpt
includes/core/actions.php CHANGED
@@ -37,21 +37,21 @@ if ( !defined( 'ABSPATH' ) ) exit;
37
  *
38
  * v--WordPress Actions v--bbPress Sub-actions
39
  */
40
- add_action( 'plugins_loaded', 'bbp_loaded', 10 );
41
- add_action( 'init', 'bbp_init', 0 ); // Early for bbp_register
42
- add_action( 'parse_query', 'bbp_parse_query', 2 ); // Early for overrides
43
- add_action( 'widgets_init', 'bbp_widgets_init', 10 );
44
- add_action( 'generate_rewrite_rules', 'bbp_generate_rewrite_rules', 10 );
45
- add_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts', 10 );
46
- add_action( 'wp_head', 'bbp_head', 10 );
47
- add_action( 'wp_footer', 'bbp_footer', 10 );
48
- add_action( 'set_current_user', 'bbp_setup_current_user', 10 );
49
- add_action( 'setup_theme', 'bbp_setup_theme', 10 );
50
- add_action( 'after_setup_theme', 'bbp_after_setup_theme', 10 );
51
- add_action( 'template_redirect', 'bbp_template_redirect', 8 ); // Before BuddyPress's 10 [BB2225]
52
- add_action( 'login_form_login', 'bbp_login_form_login', 10 );
53
- add_action( 'profile_update', 'bbp_profile_update', 10, 2 ); // user_id and old_user_data
54
- add_action( 'user_register', 'bbp_user_register', 10 );
55
 
56
  /**
57
  * bbp_loaded - Attached to 'plugins_loaded' above
@@ -118,8 +118,8 @@ add_action( 'bbp_register', 'bbp_register_views', 8 );
118
  add_action( 'bbp_register', 'bbp_register_shortcodes', 10 );
119
 
120
  // Autoembeds
121
- add_action( 'bbp_init', 'bbp_reply_content_autoembed', 8 );
122
- add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 );
123
 
124
  /**
125
  * bbp_ready - attached to end 'bbp_init' above
@@ -224,7 +224,10 @@ add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_favorites' );
224
  // Subscriptions
225
  add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_subscriptions' );
226
  add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_subscriptions' );
 
 
227
  add_action( 'bbp_new_reply', 'bbp_notify_subscribers', 11, 5 );
 
228
 
229
  // Sticky
230
  add_action( 'bbp_trash_topic', 'bbp_unstick_topic' );
@@ -297,11 +300,12 @@ add_action( 'bbp_post_request', 'bbp_new_reply_handler', 10 );
297
  add_action( 'bbp_post_request', 'bbp_new_topic_handler', 10 );
298
 
299
  // Theme-side GET requests
300
- add_action( 'bbp_get_request', 'bbp_toggle_topic_handler', 1 );
301
- add_action( 'bbp_get_request', 'bbp_toggle_reply_handler', 1 );
302
- add_action( 'bbp_get_request', 'bbp_favorites_handler', 1 );
303
- add_action( 'bbp_get_request', 'bbp_subscriptions_handler', 1 );
304
- add_action( 'bbp_get_request', 'bbp_search_results_redirect', 10 );
 
305
 
306
  // Maybe convert the users password
307
  add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
37
  *
38
  * v--WordPress Actions v--bbPress Sub-actions
39
  */
40
+ add_action( 'plugins_loaded', 'bbp_loaded', 10 );
41
+ add_action( 'init', 'bbp_init', 0 ); // Early for bbp_register
42
+ add_action( 'parse_query', 'bbp_parse_query', 2 ); // Early for overrides
43
+ add_action( 'widgets_init', 'bbp_widgets_init', 10 );
44
+ add_action( 'generate_rewrite_rules', 'bbp_generate_rewrite_rules', 10 );
45
+ add_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts', 10 );
46
+ add_action( 'wp_head', 'bbp_head', 10 );
47
+ add_action( 'wp_footer', 'bbp_footer', 10 );
48
+ add_action( 'set_current_user', 'bbp_setup_current_user', 10 );
49
+ add_action( 'setup_theme', 'bbp_setup_theme', 10 );
50
+ add_action( 'after_setup_theme', 'bbp_after_setup_theme', 10 );
51
+ add_action( 'template_redirect', 'bbp_template_redirect', 8 ); // Before BuddyPress's 10 [BB2225]
52
+ add_action( 'login_form_login', 'bbp_login_form_login', 10 );
53
+ add_action( 'profile_update', 'bbp_profile_update', 10, 2 ); // user_id and old_user_data
54
+ add_action( 'user_register', 'bbp_user_register', 10 );
55
 
56
  /**
57
  * bbp_loaded - Attached to 'plugins_loaded' above
118
  add_action( 'bbp_register', 'bbp_register_shortcodes', 10 );
119
 
120
  // Autoembeds
121
+ add_action( 'bbp_init', 'bbp_reply_content_autoembed', 8 );
122
+ add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 );
123
 
124
  /**
125
  * bbp_ready - attached to end 'bbp_init' above
224
  // Subscriptions
225
  add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_subscriptions' );
226
  add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_subscriptions' );
227
+ add_action( 'bbp_trash_forum', 'bbp_remove_forum_from_all_subscriptions' );
228
+ add_action( 'bbp_delete_forum', 'bbp_remove_forum_from_all_subscriptions' );
229
  add_action( 'bbp_new_reply', 'bbp_notify_subscribers', 11, 5 );
230
+ add_action( 'bbp_new_topic', 'bbp_notify_forum_subscribers', 11, 4 );
231
 
232
  // Sticky
233
  add_action( 'bbp_trash_topic', 'bbp_unstick_topic' );
300
  add_action( 'bbp_post_request', 'bbp_new_topic_handler', 10 );
301
 
302
  // Theme-side GET requests
303
+ add_action( 'bbp_get_request', 'bbp_toggle_topic_handler', 1 );
304
+ add_action( 'bbp_get_request', 'bbp_toggle_reply_handler', 1 );
305
+ add_action( 'bbp_get_request', 'bbp_favorites_handler', 1 );
306
+ add_action( 'bbp_get_request', 'bbp_subscriptions_handler', 1 );
307
+ add_action( 'bbp_get_request', 'bbp_forum_subscriptions_handler', 1 );
308
+ add_action( 'bbp_get_request', 'bbp_search_results_redirect', 10 );
309
 
310
  // Maybe convert the users password
311
  add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
includes/core/filters.php CHANGED
@@ -60,6 +60,9 @@ add_filter( 'posts_where', 'bbp_query_post_parent__in', 10, 2 );
60
  // Remove forums roles from list of all roles
61
  add_filter( 'editable_roles', 'bbp_filter_blog_editable_roles' );
62
 
 
 
 
63
  /**
64
  * Feeds
65
  *
@@ -253,11 +256,17 @@ add_filter( 'bbp_map_meta_caps', 'bbp_map_topic_tag_meta_caps', 10, 4 ); // Topi
253
  *
254
  * @since bbPress (r4213)
255
  *
256
- * @param type $locale
257
- * @return type
258
  */
259
- function _bbp_filter_locale( $locale = '' ) {
260
- return apply_filters( 'bbpress_locale', $locale );
 
 
 
 
 
 
261
  }
262
  add_filter( 'bbp_plugin_locale', '_bbp_filter_locale', 10, 1 );
263
 
@@ -265,8 +274,8 @@ add_filter( 'bbp_plugin_locale', '_bbp_filter_locale', 10, 1 );
265
  * Deprecated forums query filter
266
  *
267
  * @since bbPress (r3961)
268
- * @param type $args
269
- * @return type
270
  */
271
  function _bbp_has_forums_query( $args = array() ) {
272
  return apply_filters( 'bbp_has_forums_query', $args );
@@ -277,8 +286,8 @@ add_filter( 'bbp_after_has_forums_parse_args', '_bbp_has_forums_query' );
277
  * Deprecated topics query filter
278
  *
279
  * @since bbPress (r3961)
280
- * @param type $args
281
- * @return type
282
  */
283
  function _bbp_has_topics_query( $args = array() ) {
284
  return apply_filters( 'bbp_has_topics_query', $args );
@@ -289,8 +298,8 @@ add_filter( 'bbp_after_has_topics_parse_args', '_bbp_has_topics_query' );
289
  * Deprecated replies query filter
290
  *
291
  * @since bbPress (r3961)
292
- * @param type $args
293
- * @return type
294
  */
295
  function _bbp_has_replies_query( $args = array() ) {
296
  return apply_filters( 'bbp_has_replies_query', $args );
60
  // Remove forums roles from list of all roles
61
  add_filter( 'editable_roles', 'bbp_filter_blog_editable_roles' );
62
 
63
+ // Reply title fallback
64
+ add_filter( 'the_title', 'bbp_get_reply_title_fallback', 2, 2 );
65
+
66
  /**
67
  * Feeds
68
  *
256
  *
257
  * @since bbPress (r4213)
258
  *
259
+ * @param string $locale
260
+ * @return string $domain
261
  */
262
+ function _bbp_filter_locale( $locale = '', $domain = '' ) {
263
+
264
+ // Only apply to the bbPress text-domain
265
+ if ( bbpress()->domain !== $domain ) {
266
+ return $locale;
267
+ }
268
+
269
+ return apply_filters( 'bbpress_locale', $locale, $domain );
270
  }
271
  add_filter( 'bbp_plugin_locale', '_bbp_filter_locale', 10, 1 );
272
 
274
  * Deprecated forums query filter
275
  *
276
  * @since bbPress (r3961)
277
+ * @param array $args
278
+ * @return array
279
  */
280
  function _bbp_has_forums_query( $args = array() ) {
281
  return apply_filters( 'bbp_has_forums_query', $args );
286
  * Deprecated topics query filter
287
  *
288
  * @since bbPress (r3961)
289
+ * @param array $args
290
+ * @return array
291
  */
292
  function _bbp_has_topics_query( $args = array() ) {
293
  return apply_filters( 'bbp_has_topics_query', $args );
298
  * Deprecated replies query filter
299
  *
300
  * @since bbPress (r3961)
301
+ * @param array $args
302
+ * @return array
303
  */
304
  function _bbp_has_replies_query( $args = array() ) {
305
  return apply_filters( 'bbp_has_replies_query', $args );
includes/core/template-functions.php CHANGED
@@ -50,7 +50,7 @@ function bbp_get_template_part( $slug, $name = null ) {
50
  * inherit from a parent theme can just overload one file. If the template is
51
  * not found in either of those, it looks in the theme-compat folder last.
52
  *
53
- * @since bbPres (r3618)
54
  *
55
  * @param string|array $template_names Template file(s) to search for, in order.
56
  * @param bool $load If true the template file will be loaded if it is found.
@@ -108,6 +108,125 @@ function bbp_locate_template( $template_names, $load = false, $require_once = tr
108
  return $located;
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * This is really cool. This function registers a new template stack location,
113
  * using WordPress's built in filters API.
@@ -118,7 +237,7 @@ function bbp_locate_template( $template_names, $load = false, $require_once = tr
118
  *
119
  * @since bbPress (r4323)
120
  *
121
- * @param string $location Callback function that returns the
122
  * @param int $priority
123
  */
124
  function bbp_register_template_stack( $location_callback = '', $priority = 10 ) {
@@ -282,7 +401,7 @@ function bbp_get_template_locations( $templates = array() ) {
282
  * @since bbPress (r3738)
283
  *
284
  * @param array $templates
285
- * @return array()
286
  */
287
  function bbp_add_template_stack_locations( $stacks = array() ) {
288
  $retval = array();
@@ -496,7 +615,7 @@ function bbp_parse_query( $posts_query ) {
496
 
497
  // Get the post type from the main query loop
498
  $post_type = $posts_query->get( 'post_type' );
499
-
500
  // Check which post_type we are editing, if any
501
  if ( !empty( $post_type ) ) {
502
  switch( $post_type ) {
50
  * inherit from a parent theme can just overload one file. If the template is
51
  * not found in either of those, it looks in the theme-compat folder last.
52
  *
53
+ * @since bbPress (r3618)
54
  *
55
  * @param string|array $template_names Template file(s) to search for, in order.
56
  * @param bool $load If true the template file will be loaded if it is found.
108
  return $located;
109
  }
110
 
111
+ /**
112
+ * Enqueue a script from the highest priority location in the template stack.
113
+ *
114
+ * Registers the style if file provided (does NOT overwrite) and enqueues.
115
+ *
116
+ * @since bbPress (r5180)
117
+ *
118
+ * @param string $handle Name of the stylesheet.
119
+ * @param string|bool $file Relative path to stylesheet. Example: '/css/mystyle.css'.
120
+ * @param array $deps An array of registered style handles this stylesheet depends on. Default empty array.
121
+ * @param string|bool $ver String specifying the stylesheet version number, if it has one. This parameter is used
122
+ * to ensure that the correct version is sent to the client regardless of caching, and so
123
+ * should be included if a version number is available and makes sense for the stylesheet.
124
+ * @param string $media Optional. The media for which this stylesheet has been defined.
125
+ * Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',
126
+ * 'screen', 'tty', or 'tv'.
127
+ *
128
+ * @return string The style filename if one is located.
129
+ */
130
+ function bbp_enqueue_style( $handle = '', $file = '', $dependencies = array(), $version = false, $media = 'all' ) {
131
+
132
+ // No file found yet
133
+ $located = false;
134
+
135
+ // Trim off any slashes from the template name
136
+ $file = ltrim( $file, '/' );
137
+
138
+ // Make sure there is always a version
139
+ if ( empty( $version ) ) {
140
+ $version = bbp_get_version();
141
+ }
142
+
143
+ // Loop through template stack
144
+ foreach ( (array) bbp_get_template_stack() as $template_location ) {
145
+
146
+ // Continue if $template_location is empty
147
+ if ( empty( $template_location ) ) {
148
+ continue;
149
+ }
150
+
151
+ // Check child theme first
152
+ if ( file_exists( trailingslashit( $template_location ) . $file ) ) {
153
+ $located = trailingslashit( $template_location ) . $file;
154
+ break;
155
+ }
156
+ }
157
+
158
+ // Enqueue if located
159
+ if ( !empty( $located ) ) {
160
+
161
+ // Make path to file relative to site URL
162
+ $located = trailingslashit( WP_CONTENT_URL ) . ltrim( str_replace( WP_CONTENT_DIR, '', $located ), '/' );
163
+
164
+ // Enqueue the style
165
+ wp_enqueue_style( $handle, $located, $dependencies, $version, $media );
166
+ }
167
+
168
+ return $located;
169
+ }
170
+
171
+ /**
172
+ * Enqueue a script from the highest priority location in the template stack.
173
+ *
174
+ * Registers the style if file provided (does NOT overwrite) and enqueues.
175
+ *
176
+ * @since bbPress (r5180)
177
+ *
178
+ * @param string $handle Name of the script.
179
+ * @param string|bool $file Relative path to the script. Example: '/js/myscript.js'.
180
+ * @param array $deps An array of registered handles this script depends on. Default empty array.
181
+ * @param string|bool $ver Optional. String specifying the script version number, if it has one. This parameter
182
+ * is used to ensure that the correct version is sent to the client regardless of caching,
183
+ * and so should be included if a version number is available and makes sense for the script.
184
+ * @param bool $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
185
+ * Default 'false'. Accepts 'false' or 'true'.
186
+ *
187
+ * @return string The script filename if one is located.
188
+ */
189
+ function bbp_enqueue_script( $handle = '', $file = '', $dependencies = array(), $version = false, $in_footer = 'all' ) {
190
+
191
+ // No file found yet
192
+ $located = false;
193
+
194
+ // Trim off any slashes from the template name
195
+ $file = ltrim( $file, '/' );
196
+
197
+ // Make sure there is always a version
198
+ if ( empty( $version ) ) {
199
+ $version = bbp_get_version();
200
+ }
201
+
202
+ // Loop through template stack
203
+ foreach ( (array) bbp_get_template_stack() as $template_location ) {
204
+
205
+ // Continue if $template_location is empty
206
+ if ( empty( $template_location ) ) {
207
+ continue;
208
+ }
209
+
210
+ // Check child theme first
211
+ if ( file_exists( trailingslashit( $template_location ) . $file ) ) {
212
+ $located = trailingslashit( $template_location ) . $file;
213
+ break;
214
+ }
215
+ }
216
+
217
+ // Enqueue if located
218
+ if ( !empty( $located ) ) {
219
+
220
+ // Make path to file relative to site URL
221
+ $located = trailingslashit( WP_CONTENT_URL ) . ltrim( str_replace( WP_CONTENT_DIR, '', $located ), '/' );
222
+
223
+ // Enqueue the style
224
+ wp_enqueue_script( $handle, $located, $dependencies, $version, $in_footer );
225
+ }
226
+
227
+ return $located;
228
+ }
229
+
230
  /**
231
  * This is really cool. This function registers a new template stack location,
232
  * using WordPress's built in filters API.
237
  *
238
  * @since bbPress (r4323)
239
  *
240
+ * @param string $location Callback function that returns the
241
  * @param int $priority
242
  */
243
  function bbp_register_template_stack( $location_callback = '', $priority = 10 ) {
401
  * @since bbPress (r3738)
402
  *
403
  * @param array $templates
404
+ * @return array()
405
  */
406
  function bbp_add_template_stack_locations( $stacks = array() ) {
407
  $retval = array();
615
 
616
  // Get the post type from the main query loop
617
  $post_type = $posts_query->get( 'post_type' );
618
+
619
  // Check which post_type we are editing, if any
620
  if ( !empty( $post_type ) ) {
621
  switch( $post_type ) {
includes/core/theme-compat.php CHANGED
@@ -431,7 +431,7 @@ function bbp_theme_compat_reset_post( $args = array() ) {
431
  * @uses bbp_set_theme_compat_template() To set the global theme compat template
432
  */
433
  function bbp_template_include_theme_compat( $template = '' ) {
434
-
435
  /**
436
  * Bail if a root template was already found. This prevents unintended
437
  * recursive filtering of 'the_content'.
@@ -690,7 +690,7 @@ function bbp_template_include_theme_compat( $template = '' ) {
690
  'post_title' => bbp_get_view_title(),
691
  'post_author' => 0,
692
  'post_date' => 0,
693
- 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( 'bbp_view' ) ) ),
694
  'post_type' => '',
695
  'post_status' => bbp_get_public_status_id(),
696
  'comment_status' => 'closed'
@@ -706,7 +706,7 @@ function bbp_template_include_theme_compat( $template = '' ) {
706
  'post_title' => bbp_get_search_title(),
707
  'post_author' => 0,
708
  'post_date' => 0,
709
- 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( 'bbp_search' ) ) ),
710
  'post_type' => '',
711
  'post_status' => bbp_get_public_status_id(),
712
  'comment_status' => 'closed'
431
  * @uses bbp_set_theme_compat_template() To set the global theme compat template
432
  */
433
  function bbp_template_include_theme_compat( $template = '' ) {
434
+
435
  /**
436
  * Bail if a root template was already found. This prevents unintended
437
  * recursive filtering of 'the_content'.
690
  'post_title' => bbp_get_view_title(),
691
  'post_author' => 0,
692
  'post_date' => 0,
693
+ 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( bbp_get_view_rewrite_id() ) ) ),
694
  'post_type' => '',
695
  'post_status' => bbp_get_public_status_id(),
696
  'comment_status' => 'closed'
706
  'post_title' => bbp_get_search_title(),
707
  'post_author' => 0,
708
  'post_date' => 0,
709
+ 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( bbp_get_search_rewrite_id() ) ) ),
710
  'post_type' => '',
711
  'post_status' => bbp_get_public_status_id(),
712
  'comment_status' => 'closed'
includes/core/update.php CHANGED
@@ -337,21 +337,28 @@ function bbp_add_activation_redirect() {
337
  function bbp_make_current_user_keymaster() {
338
 
339
  // Bail if the current user can't activate plugins since previous pageload
340
- if ( ! current_user_can( 'activate_plugins' ) )
341
  return;
 
342
 
343
  // Get the current user ID
344
  $user_id = get_current_user_id();
345
  $blog_id = get_current_blog_id();
346
 
347
  // Bail if user is not actually a member of this site
348
- if ( ! is_user_member_of_blog( $user_id, $blog_id ) )
349
  return;
 
350
 
351
- // Bail if the current user is already a keymaster
352
- if ( bbp_is_user_keymaster( $user_id ) )
 
353
  return;
 
354
 
355
  // Make the current user a keymaster
356
  bbp_set_user_role( $user_id, bbp_get_keymaster_role() );
 
 
 
357
  }
337
  function bbp_make_current_user_keymaster() {
338
 
339
  // Bail if the current user can't activate plugins since previous pageload
340
+ if ( ! current_user_can( 'activate_plugins' ) ) {
341
  return;
342
+ }
343
 
344
  // Get the current user ID
345
  $user_id = get_current_user_id();
346
  $blog_id = get_current_blog_id();
347
 
348
  // Bail if user is not actually a member of this site
349
+ if ( ! is_user_member_of_blog( $user_id, $blog_id ) ) {
350
  return;
351
+ }
352
 
353
+ // Bail if the current user already has a forum role to prevent
354
+ // unexpected role and capability escalation.
355
+ if ( bbp_get_user_role( $user_id ) ) {
356
  return;
357
+ }
358
 
359
  // Make the current user a keymaster
360
  bbp_set_user_role( $user_id, bbp_get_keymaster_role() );
361
+
362
+ // Reload the current user so caps apply immediately
363
+ wp_get_current_user();
364
  }
includes/extend/akismet.php CHANGED
@@ -118,8 +118,8 @@ class BBP_Akismet {
118
  // Author is anonymous
119
  if ( !empty( $anonymous_data ) ) {
120
  $user_data['name'] = $anonymous_data['bbp_anonymous_name'];
121
- $user_data['email'] = $anonymous_data['bbp_anonymous_name'];
122
- $user_data['website'] = $anonymous_data['bbp_anonymous_name'];
123
 
124
  // Author is logged in
125
  } elseif ( !empty( $userdata ) ) {
118
  // Author is anonymous
119
  if ( !empty( $anonymous_data ) ) {
120
  $user_data['name'] = $anonymous_data['bbp_anonymous_name'];
121
+ $user_data['email'] = $anonymous_data['bbp_anonymous_email'];
122
+ $user_data['website'] = $anonymous_data['bbp_anonymous_website'];
123
 
124
  // Author is logged in
125
  } elseif ( !empty( $userdata ) ) {
includes/extend/buddypress/functions.php CHANGED
@@ -81,6 +81,42 @@ function bbp_filter_is_user_home( $is = false ) {
81
  }
82
  add_filter( 'bbp_is_user_home', 'bbp_filter_is_user_home', 10, 1 );
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  /** BuddyPress Screens ********************************************************/
85
 
86
  /**
81
  }
82
  add_filter( 'bbp_is_user_home', 'bbp_filter_is_user_home', 10, 1 );
83
 
84
+ /**
85
+ * Add the topic title to the <title> if viewing a single group forum topic
86
+ *
87
+ * @since bbPress (r5161)
88
+ *
89
+ * @param string $new_title The title to filter
90
+ * @param string $old_title (Not used)
91
+ * @param string $sep The separator to use
92
+ * @return string The possibly modified title
93
+ */
94
+ function bbp_filter_modify_page_title( $new_title = '', $old_title = '', $sep = '' ) {
95
+
96
+ // Only filter if group forums are active
97
+ if ( bbp_is_group_forums_active() ) {
98
+
99
+ // Only filter for single group forum topics
100
+ if ( bp_is_group_forum_topic() || bp_is_group_forum_topic_edit() ) {
101
+
102
+ // Get the topic
103
+ $topic = get_posts( array(
104
+ 'name' => bp_action_variable( 1 ),
105
+ 'post_status' => 'publish',
106
+ 'post_type' => bbp_get_topic_post_type(),
107
+ 'numberposts' => 1
108
+ ) );
109
+
110
+ // Add the topic title to the <title>
111
+ $new_title .= bbp_get_topic_title( $topic[0]->ID ) . ' ' . $sep . ' ';
112
+ }
113
+ }
114
+
115
+ // Return the title
116
+ return $new_title;
117
+ }
118
+ add_action( 'bp_modify_page_title', 'bbp_filter_modify_page_title', 10, 3 );
119
+
120
  /** BuddyPress Screens ********************************************************/
121
 
122
  /**
includes/extend/buddypress/loader.php CHANGED
@@ -59,6 +59,11 @@ class BBP_Forums_Component extends BP_Component {
59
  // Members modifications
60
  $includes[] = 'members.php';
61
 
 
 
 
 
 
62
  // BuddyPress Activity Extension class
63
  if ( bp_is_active( 'activity' ) ) {
64
  $includes[] = 'activity.php';
59
  // Members modifications
60
  $includes[] = 'members.php';
61
 
62
+ // BuddyPress Notfications Extension functions
63
+ if ( bp_is_active( 'notifications' ) ) {
64
+ $includes[] = 'notifications.php';
65
+ }
66
+
67
  // BuddyPress Activity Extension class
68
  if ( bp_is_active( 'activity' ) ) {
69
  $includes[] = 'activity.php';
includes/extend/buddypress/notifications.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Format the BuddyBar/Toolbar notifications
5
+ *
6
+ * @since bbPress (r5155)
7
+ *
8
+ * @package bbPress
9
+ *
10
+ * @param string $action The kind of notification being rendered
11
+ * @param int $item_id The primary item id
12
+ * @param int $secondary_item_id The secondary item id
13
+ * @param int $total_items The total number of messaging-related notifications waiting for the user
14
+ * @param string $format 'string' for BuddyBar-compatible notifications; 'array' for WP Toolbar
15
+ */
16
+ function bbp_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
17
+
18
+ // New reply notifications
19
+ if ( 'bbp_new_reply' === $action ) {
20
+ $topic_id = bbp_get_reply_topic_id( $item_id );
21
+ $topic_title = bbp_get_topic_title( $topic_id );
22
+ $topic_link = wp_nonce_url( add_query_arg( array( 'action' => 'bbp_mark_read', 'topic_id' => $topic_id ), bbp_get_reply_url( $item_id ) ), 'bbp_mark_topic_' . $topic_id );
23
+ $title_attr = __( 'Topic Replies', 'bbpress' );
24
+
25
+ if ( (int) $total_items > 1 ) {
26
+ $text = sprintf( __( 'You have %d new replies', 'bbpress' ), (int) $total_items );
27
+ $filter = 'bbp_multiple_new_subscription_notification';
28
+ } else {
29
+ if ( !empty( $secondary_item_id ) ) {
30
+ $text = sprintf( __( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), (int) $total_items, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) );
31
+ } else {
32
+ $text = sprintf( __( 'You have %d new reply to %s', 'bbpress' ), (int) $total_items, $topic_title );
33
+ }
34
+ $filter = 'bbp_single_new_subscription_notification';
35
+ }
36
+
37
+ // WordPress Toolbar
38
+ if ( 'string' === $format ) {
39
+ $return = apply_filters( $filter, '<a href="' . esc_url( $topic_link ) . '" title="' . esc_attr( $title_attr ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $topic_link );
40
+
41
+ // Deprecated BuddyBar
42
+ } else {
43
+ $return = apply_filters( $filter, array(
44
+ 'text' => $text,
45
+ 'link' => $topic_link
46
+ ), $topic_link, (int) $total_items, $text, $topic_title );
47
+ }
48
+
49
+ do_action( 'bbp_format_buddypress_notifications', $action, $item_id, $secondary_item_id, $total_items );
50
+
51
+ return $return;
52
+ }
53
+ }
54
+ add_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications', 10, 5 );
55
+
56
+ /**
57
+ * Hooked into the new reply function, this notification action is responsible
58
+ * for notifying topic and hierarchical reply authors of topic replies.
59
+ *
60
+ * @since bbPress (r5156)
61
+ *
62
+ * @param int $reply_id
63
+ * @param int $topic_id
64
+ * @param int $forum_id (not used)
65
+ * @param array $anonymous_data (not used)
66
+ * @param int $author_id
67
+ * @param bool $is_edit Used to bail if this gets hooked to an edit action
68
+ * @param int $reply_to
69
+ */
70
+ function bbp_buddypress_add_notification( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false, $reply_to = 0 ) {
71
+
72
+ // Bail if somehow this is hooked to an edit action
73
+ if ( !empty( $is_edit ) ) {
74
+ return;
75
+ }
76
+
77
+ // Get autohr information
78
+ $topic_author_id = bbp_get_topic_author_id( $topic_id );
79
+ $secondary_item_id = $author_id;
80
+
81
+ // Hierarchical replies
82
+ if ( !empty( $reply_to ) ) {
83
+ $reply_to_item_id = bbp_get_topic_author_id( $reply_to );
84
+ }
85
+
86
+ // Get some reply information
87
+ $date_notified = get_post( $reply_id )->post_date;
88
+ $item_id = $topic_id;
89
+ $component_name = 'forums';
90
+ $component_action = 'bbp_new_reply';
91
+
92
+ // Notify the topic author if not the current reply author
93
+ if ( $author_id !== $topic_author_id ) {
94
+ bp_core_add_notification( $item_id, $topic_author_id, $component_name, $component_action, $secondary_item_id, $date_notified );
95
+ }
96
+
97
+ // Notify the immediate reply author if not the current reply author
98
+ if ( !empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) {
99
+ bp_core_add_notification( $item_id, $topic_author_id, $component_name, $component_action, $reply_to_item_id, $date_notified );
100
+ }
101
+ }
102
+ add_action( 'bbp_new_reply', 'bbp_buddypress_add_notification', 10, 7 );
103
+
104
+ /**
105
+ * Mark notifications as read when reading a topic
106
+ *
107
+ * @since bbPress (r5155)
108
+ *
109
+ * @return If not trying to mark a notification as read
110
+ */
111
+ function bbp_buddypress_mark_notifications( $action = '' ) {
112
+
113
+ // Bail if no topic ID is passed
114
+ if ( empty( $_GET['topic_id'] ) ) {
115
+ return;
116
+ }
117
+
118
+ // Bail if action is not for this function
119
+ if ( 'bbp_mark_read' !== $action ) {
120
+ return;
121
+ }
122
+
123
+ // Get required data
124
+ $user_id = bp_loggedin_user_id();
125
+ $topic_id = intval( $_GET['topic_id'] );
126
+
127
+ // Check nonce
128
+ if ( ! bbp_verify_nonce_request( 'bbp_mark_topic_' . $topic_id ) ) {
129
+ bbp_add_error( 'bbp_notification_topic_id', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
130
+
131
+ // Check current user's ability to edit the user
132
+ } elseif ( !current_user_can( 'edit_user', $user_id ) ) {
133
+ bbp_add_error( 'bbp_notification_permissions', __( '<strong>ERROR</strong>: You do not have permission to mark notifications for that user.', 'bbpress' ) );
134
+ }
135
+
136
+ // Bail if we have errors
137
+ if ( ! bbp_has_errors() ) {
138
+
139
+ // Attempt to clear notifications for the current user from this topic
140
+ $success = bp_core_mark_notifications_by_item_id( $user_id, $topic_id, 'forums', 'bbp_new_reply' );
141
+
142
+ // Do additional subscriptions actions
143
+ do_action( 'bbp_notifications_handler', $success, $user_id, $topic_id, $action );
144
+ }
145
+
146
+ // Redirect to the topic
147
+ $redirect = bbp_get_reply_url( $topic_id );
148
+
149
+ // Redirect
150
+ wp_safe_redirect( $redirect );
151
+
152
+ // For good measure
153
+ exit();
154
+ }
155
+ add_action( 'bbp_get_request', 'bbp_buddypress_mark_notifications', 1 );
includes/forums/functions.php CHANGED
@@ -805,6 +805,7 @@ function bbp_publicize_forum( $forum_id = 0, $current_visibility = '' ) {
805
  global $wpdb;
806
  $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_public_status_id() ), array( 'ID' => $forum_id ) );
807
  wp_transition_post_status( bbp_get_public_status_id(), $current_visibility, get_post( $forum_id ) );
 
808
  }
809
 
810
  do_action( 'bbp_publicized_forum', $forum_id );
@@ -854,6 +855,7 @@ function bbp_privatize_forum( $forum_id = 0, $current_visibility = '' ) {
854
  global $wpdb;
855
  $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_private_status_id() ), array( 'ID' => $forum_id ) );
856
  wp_transition_post_status( bbp_get_private_status_id(), $current_visibility, get_post( $forum_id ) );
 
857
  }
858
 
859
  do_action( 'bbp_privatized_forum', $forum_id );
@@ -903,6 +905,7 @@ function bbp_hide_forum( $forum_id = 0, $current_visibility = '' ) {
903
  global $wpdb;
904
  $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_hidden_status_id() ), array( 'ID' => $forum_id ) );
905
  wp_transition_post_status( bbp_get_hidden_status_id(), $current_visibility, get_post( $forum_id ) );
 
906
  }
907
 
908
  do_action( 'bbp_hid_forum', $forum_id );
@@ -958,6 +961,48 @@ function bbp_repair_forum_visibility() {
958
  return true;
959
  }
960
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
961
  /** Count Bumpers *************************************************************/
962
 
963
  /**
805
  global $wpdb;
806
  $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_public_status_id() ), array( 'ID' => $forum_id ) );
807
  wp_transition_post_status( bbp_get_public_status_id(), $current_visibility, get_post( $forum_id ) );
808
+ bbp_clean_post_cache( $forum_id );
809
  }
810
 
811
  do_action( 'bbp_publicized_forum', $forum_id );
855
  global $wpdb;
856
  $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_private_status_id() ), array( 'ID' => $forum_id ) );
857
  wp_transition_post_status( bbp_get_private_status_id(), $current_visibility, get_post( $forum_id ) );
858
+ bbp_clean_post_cache( $forum_id );
859
  }
860
 
861
  do_action( 'bbp_privatized_forum', $forum_id );
905
  global $wpdb;
906
  $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_hidden_status_id() ), array( 'ID' => $forum_id ) );
907
  wp_transition_post_status( bbp_get_hidden_status_id(), $current_visibility, get_post( $forum_id ) );
908
+ bbp_clean_post_cache( $forum_id );
909
  }
910
 
911
  do_action( 'bbp_hid_forum', $forum_id );
961
  return true;
962
  }
963
 
964
+ /** Subscriptions *************************************************************/
965
+
966
+ /**
967
+ * Remove a deleted forum from all users' subscriptions
968
+ *
969
+ * @since bbPress (r5156)
970
+ *
971
+ * @param int $forum_id Get the forum ID to remove
972
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
973
+ * @uses bbp_get_forum_id To get the forum id
974
+ * @uses bbp_get_forum_subscribers() To get the forum subscribers
975
+ * @uses bbp_remove_user_subscription() To remove the user subscription
976
+ */
977
+ function bbp_remove_forum_from_all_subscriptions( $forum_id = 0 ) {
978
+
979
+ // Subscriptions are not active
980
+ if ( ! bbp_is_subscriptions_active() ) {
981
+ return;
982
+ }
983
+
984
+ $forum_id = bbp_get_forum_id( $forum_id );
985
+
986
+ // Bail if no forum
987
+ if ( empty( $forum_id ) ) {
988
+ return;
989
+ }
990
+
991
+ // Get users
992
+ $users = (array) bbp_get_forum_subscribers( $forum_id );
993
+
994
+ // Users exist
995
+ if ( !empty( $users ) ) {
996
+
997
+ // Loop through users
998
+ foreach ( $users as $user ) {
999
+
1000
+ // Remove each user
1001
+ bbp_remove_user_subscription( $user, $forum_id );
1002
+ }
1003
+ }
1004
+ }
1005
+
1006
  /** Count Bumpers *************************************************************/
1007
 
1008
  /**
includes/forums/template.php CHANGED
@@ -34,6 +34,63 @@ function bbp_forum_post_type() {
34
  return apply_filters( 'bbp_get_forum_post_type', bbpress()->forum_post_type );
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  /** Forum Loop ****************************************************************/
38
 
39
  /**
@@ -732,6 +789,54 @@ function bbp_list_forums( $args = '' ) {
732
  }
733
  }
734
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
735
  /** Forum Last Topic **********************************************************/
736
 
737
  /**
@@ -2108,6 +2213,66 @@ function bbp_form_forum_visibility() {
2108
 
2109
  return apply_filters( 'bbp_get_form_forum_visibility', esc_attr( $forum_visibility ) );
2110
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2111
 
2112
  /** Form Dropdowns ************************************************************/
2113
 
34
  return apply_filters( 'bbp_get_forum_post_type', bbpress()->forum_post_type );
35
  }
36
 
37
+
38
+ /**
39
+ * Return array of labels used by the forum post type
40
+ *
41
+ * @since bbPress (r5129)
42
+ *
43
+ * @return array
44
+ */
45
+ function bbp_get_forum_post_type_labels() {
46
+ return apply_filters( 'bbp_get_forum_post_type_labels', array(
47
+ 'name' => __( 'Forums', 'bbpress' ),
48
+ 'menu_name' => __( 'Forums', 'bbpress' ),
49
+ 'singular_name' => __( 'Forum', 'bbpress' ),
50
+ 'all_items' => __( 'All Forums', 'bbpress' ),
51
+ 'add_new' => __( 'New Forum', 'bbpress' ),
52
+ 'add_new_item' => __( 'Create New Forum', 'bbpress' ),
53
+ 'edit' => __( 'Edit', 'bbpress' ),
54
+ 'edit_item' => __( 'Edit Forum', 'bbpress' ),
55
+ 'new_item' => __( 'New Forum', 'bbpress' ),
56
+ 'view' => __( 'View Forum', 'bbpress' ),
57
+ 'view_item' => __( 'View Forum', 'bbpress' ),
58
+ 'search_items' => __( 'Search Forums', 'bbpress' ),
59
+ 'not_found' => __( 'No forums found', 'bbpress' ),
60
+ 'not_found_in_trash' => __( 'No forums found in Trash', 'bbpress' ),
61
+ 'parent_item_colon' => __( 'Parent Forum:', 'bbpress' )
62
+ ) );
63
+ }
64
+
65
+ /**
66
+ * Return array of forum post type rewrite settings
67
+ *
68
+ * @since bbPress (r5129)
69
+ *
70
+ * @return array
71
+ */
72
+ function bbp_get_forum_post_type_rewrite() {
73
+ return apply_filters( 'bbp_get_forum_post_type_rewrite', array(
74
+ 'slug' => bbp_get_forum_slug(),
75
+ 'with_front' => false
76
+ ) );
77
+ }
78
+
79
+ /**
80
+ * Return array of features the forum post type supports
81
+ *
82
+ * @since bbPress (r5129)
83
+ *
84
+ * @return array
85
+ */
86
+ function bbp_get_forum_post_type_supports() {
87
+ return apply_filters( 'bbp_get_forum_post_type_supports', array(
88
+ 'title',
89
+ 'editor',
90
+ 'revisions'
91
+ ) );
92
+ }
93
+
94
  /** Forum Loop ****************************************************************/
95
 
96
  /**
789
  }
790
  }
791
 
792
+ /** Forum Subscriptions *******************************************************/
793
+
794
+ /**
795
+ * Output the forum subscription link
796
+ *
797
+ * @since bbPress (r5156)
798
+ *
799
+ * @uses bbp_get_forum_subscription_link()
800
+ */
801
+ function bbp_forum_subscription_link( $args = array() ) {
802
+ echo bbp_get_forum_subscription_link( $args );
803
+ }
804
+
805
+ /**
806
+ * Get the forum subscription link
807
+ *
808
+ * A custom wrapper for bbp_get_user_subscribe_link()
809
+ *
810
+ * @since bbPress (r5156)
811
+ *
812
+ * @uses bbp_parse_args()
813
+ * @uses bbp_get_user_subscribe_link()
814
+ * @uses apply_filters() Calls 'bbp_get_forum_subscribe_link'
815
+ */
816
+ function bbp_get_forum_subscription_link( $args = array() ) {
817
+
818
+ // No link
819
+ $retval = false;
820
+
821
+ // Parse the arguments
822
+ $r = bbp_parse_args( $args, array(
823
+ 'forum_id' => 0,
824
+ 'user_id' => 0,
825
+ 'before' => '',
826
+ 'after' => '',
827
+ 'subscribe' => __( 'Subscribe', 'bbpress' ),
828
+ 'unsubscribe' => __( 'Unsubscribe', 'bbpress' )
829
+ ), 'get_forum_subscribe_link' );
830
+
831
+ // No link for categories until we support subscription hierarchy
832
+ // @see http://bbpress.trac.wordpress.org/ticket/2475
833
+ if ( ! bbp_is_forum_category() ) {
834
+ $retval = bbp_get_user_subscribe_link( $r );
835
+ }
836
+
837
+ return apply_filters( 'bbp_get_forum_subscribe_link', $retval, $r );
838
+ }
839
+
840
  /** Forum Last Topic **********************************************************/
841
 
842
  /**
2213
 
2214
  return apply_filters( 'bbp_get_form_forum_visibility', esc_attr( $forum_visibility ) );
2215
  }
2216
+
2217
+ /**
2218
+ * Output checked value of forum subscription
2219
+ *
2220
+ * @since bbPress (r5156)
2221
+ *
2222
+ * @uses bbp_get_form_forum_subscribed() To get the subscribed checkbox value
2223
+ */
2224
+ function bbp_form_forum_subscribed() {
2225
+ echo bbp_get_form_forum_subscribed();
2226
+ }
2227
+ /**
2228
+ * Return checked value of forum subscription
2229
+ *
2230
+ * @since bbPress (r5156)
2231
+ *
2232
+ * @uses bbp_is_forum_edit() To check if it's the forum edit page
2233
+ * @uses bbp_get_global_post_field() To get current post author
2234
+ * @uses bbp_get_current_user_id() To get the current user id
2235
+ * @uses bbp_is_user_subscribed() To check if the user is subscribed to
2236
+ * the forum
2237
+ * @uses apply_filters() Calls 'bbp_get_form_forum_subscribed' with the
2238
+ * option
2239
+ * @return string Checked value of forum subscription
2240
+ */
2241
+ function bbp_get_form_forum_subscribed() {
2242
+
2243
+ // Get _POST data
2244
+ if ( bbp_is_post_request() && isset( $_POST['bbp_forum_subscription'] ) ) {
2245
+ $forum_subscribed = (bool) $_POST['bbp_forum_subscription'];
2246
+
2247
+ // Get edit data
2248
+ } elseif ( bbp_is_forum_edit() || bbp_is_reply_edit() ) {
2249
+
2250
+ // Get current posts author
2251
+ $post_author = bbp_get_global_post_field( 'post_author', 'raw' );
2252
+
2253
+ // Post author is not the current user
2254
+ if ( bbp_get_current_user_id() !== $post_author ) {
2255
+ $forum_subscribed = bbp_is_user_subscribed( $post_author );
2256
+
2257
+ // Post author is the current user
2258
+ } else {
2259
+ $forum_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id() );
2260
+ }
2261
+
2262
+ // Get current status
2263
+ } elseif ( bbp_is_single_forum() ) {
2264
+ $forum_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id() );
2265
+
2266
+ // No data
2267
+ } else {
2268
+ $forum_subscribed = false;
2269
+ }
2270
+
2271
+ // Get checked output
2272
+ $checked = checked( $forum_subscribed, true, false );
2273
+
2274
+ return apply_filters( 'bbp_get_form_forum_subscribed', $checked, $forum_subscribed );
2275
+ }
2276
 
2277
  /** Form Dropdowns ************************************************************/
2278
 
includes/replies/functions.php CHANGED
@@ -275,10 +275,6 @@ function bbp_new_reply_handler( $action = '' ) {
275
  // Filter and sanitize
276
  $reply_title = apply_filters( 'bbp_new_reply_pre_title', $reply_title );
277
 
278
- // No reply title
279
- if ( empty( $reply_title ) )
280
- bbp_add_error( 'bbp_reply_title', __( '<strong>ERROR</strong>: Your reply needs a title.', 'bbpress' ) );
281
-
282
  /** Reply Content *********************************************************/
283
 
284
  if ( !empty( $_POST['bbp_reply_content'] ) )
275
  // Filter and sanitize
276
  $reply_title = apply_filters( 'bbp_new_reply_pre_title', $reply_title );
277
 
 
 
 
 
278
  /** Reply Content *********************************************************/
279
 
280
  if ( !empty( $_POST['bbp_reply_content'] ) )
includes/replies/template.php CHANGED
@@ -35,6 +35,62 @@ function bbp_reply_post_type() {
35
  return apply_filters( 'bbp_get_reply_post_type', bbpress()->reply_post_type );
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /** Reply Loop Functions ******************************************************/
39
 
40
  /**
@@ -490,6 +546,33 @@ function bbp_reply_title( $reply_id = 0 ) {
490
  return apply_filters( 'bbp_get_reply_title', get_the_title( $reply_id ), $reply_id );
491
  }
492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  /**
494
  * Output the content of the reply
495
  *
@@ -888,9 +971,12 @@ function bbp_is_reply_anonymous( $reply_id = 0 ) {
888
  }
889
 
890
  /**
 
 
891
  * Output the author of the reply
892
  *
893
  * @since bbPress (r2667)
 
894
  *
895
  * @param int $reply_id Optional. Reply id
896
  * @uses bbp_get_reply_author() To get the reply author
@@ -899,9 +985,12 @@ function bbp_reply_author( $reply_id = 0 ) {
899
  echo bbp_get_reply_author( $reply_id );
900
  }
901
  /**
 
 
902
  * Return the author of the reply
903
  *
904
  * @since bbPress (r2667)
 
905
  *
906
  * @param int $reply_id Optional. Reply id
907
  * @uses bbp_get_reply_id() To get the reply id
@@ -1080,7 +1169,6 @@ function bbp_reply_author_link( $args = '' ) {
1080
  * @uses bbp_get_reply_id() To get the reply id
1081
  * @uses bbp_is_reply_anonymous() To check if the reply is by an
1082
  * anonymous user
1083
- * @uses bbp_get_reply_author() To get the reply author name
1084
  * @uses bbp_get_reply_author_url() To get the reply author url
1085
  * @uses bbp_get_reply_author_avatar() To get the reply author avatar
1086
  * @uses bbp_get_reply_author_display_name() To get the reply author display
@@ -1143,7 +1231,7 @@ function bbp_reply_author_link( $args = '' ) {
1143
  // Link class
1144
  $link_class = ' class="bbp-author-' . esc_attr( $r['type'] ) . '"';
1145
 
1146
- // Add links if not anonymous
1147
  if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
1148
 
1149
  // Assemble the links
@@ -1191,6 +1279,7 @@ function bbp_reply_author_url( $reply_id = 0 ) {
1191
  * @uses bbp_get_reply_id() To get the reply id
1192
  * @uses bbp_is_reply_anonymous() To check if the reply is by an anonymous
1193
  * user
 
1194
  * @uses bbp_get_reply_author_id() To get the reply author id
1195
  * @uses bbp_get_user_profile_url() To get the user profile url
1196
  * @uses get_post_meta() To get the anonymous poster's website url
@@ -1201,8 +1290,8 @@ function bbp_reply_author_url( $reply_id = 0 ) {
1201
  function bbp_get_reply_author_url( $reply_id = 0 ) {
1202
  $reply_id = bbp_get_reply_id( $reply_id );
1203
 
1204
- // Check for anonymous user
1205
- if ( !bbp_is_reply_anonymous( $reply_id ) ) {
1206
  $author_url = bbp_get_user_profile_url( bbp_get_reply_author_id( $reply_id ) );
1207
  } else {
1208
  $author_url = get_post_meta( $reply_id, '_bbp_anonymous_website', true );
@@ -1518,7 +1607,7 @@ function bbp_reply_to_link( $args = array() ) {
1518
  * @uses bbp_get_reply() To get the reply
1519
  * @uses apply_filters() Calls 'bbp_get_reply_to_link' with the formatted link,
1520
  * the arguments array, and the reply
1521
- * @return string Link for a reply to a reply
1522
  */
1523
  function bbp_get_reply_to_link( $args = array() ) {
1524
 
35
  return apply_filters( 'bbp_get_reply_post_type', bbpress()->reply_post_type );
36
  }
37
 
38
+ /**
39
+ * Return array of labels used by the reply post type
40
+ *
41
+ * @since bbPress (r5129)
42
+ *
43
+ * @return array
44
+ */
45
+ function bbp_get_reply_post_type_labels() {
46
+ return apply_filters( 'bbp_get_reply_post_type_labels', array(
47
+ 'name' => __( 'Replies', 'bbpress' ),
48
+ 'menu_name' => __( 'Replies', 'bbpress' ),
49
+ 'singular_name' => __( 'Reply', 'bbpress' ),
50
+ 'all_items' => __( 'All Replies', 'bbpress' ),
51
+ 'add_new' => __( 'New Reply', 'bbpress' ),
52
+ 'add_new_item' => __( 'Create New Reply', 'bbpress' ),
53
+ 'edit' => __( 'Edit', 'bbpress' ),
54
+ 'edit_item' => __( 'Edit Reply', 'bbpress' ),
55
+ 'new_item' => __( 'New Reply', 'bbpress' ),
56
+ 'view' => __( 'View Reply', 'bbpress' ),
57
+ 'view_item' => __( 'View Reply', 'bbpress' ),
58
+ 'search_items' => __( 'Search Replies', 'bbpress' ),
59
+ 'not_found' => __( 'No replies found', 'bbpress' ),
60
+ 'not_found_in_trash' => __( 'No replies found in Trash', 'bbpress' ),
61
+ 'parent_item_colon' => __( 'Topic:', 'bbpress' )
62
+ ) );
63
+ }
64
+
65
+ /**
66
+ * Return array of reply post type rewrite settings
67
+ *
68
+ * @since bbPress (r5129)
69
+ *
70
+ * @return array
71
+ */
72
+ function bbp_get_reply_post_type_rewrite() {
73
+ return apply_filters( 'bbp_get_reply_post_type_rewrite', array(
74
+ 'slug' => bbp_get_reply_slug(),
75
+ 'with_front' => false
76
+ ) );
77
+ }
78
+
79
+ /**
80
+ * Return array of features the reply post type supports
81
+ *
82
+ * @since bbPress (rx5129)
83
+ *
84
+ * @return array
85
+ */
86
+ function bbp_get_reply_post_type_supports() {
87
+ return apply_filters( 'bbp_get_reply_post_type_supports', array(
88
+ 'title',
89
+ 'editor',
90
+ 'revisions'
91
+ ) );
92
+ }
93
+
94
  /** Reply Loop Functions ******************************************************/
95
 
96
  /**
546
  return apply_filters( 'bbp_get_reply_title', get_the_title( $reply_id ), $reply_id );
547
  }
548
 
549
+ /**
550
+ * Get empty reply title fallback.
551
+ *
552
+ * @since bbPress (r5177)
553
+ *
554
+ * @param string $reply_title Required. Reply Title
555
+ * @param int $reply_id Required. Reply ID
556
+ * @uses bbp_get_reply_topic_title() To get the reply topic title
557
+ * @uses apply_filters() Calls 'bbp_get_reply_title_fallback' with the title and reply ID
558
+ * @return string Title of reply
559
+ */
560
+ function bbp_get_reply_title_fallback( $post_title = '', $post_id = 0 ) {
561
+
562
+ // Bail if title not empty, or post is not a reply
563
+ if ( ! empty( $post_title ) || ! bbp_is_reply( $post_id ) ) {
564
+ return $post_title;
565
+ }
566
+
567
+ // Get reply topic title.
568
+ $topic_title = bbp_get_reply_topic_title( $post_id );
569
+
570
+ // Get empty reply title fallback.
571
+ $reply_title = sprintf( __( 'Reply To: %s', 'bbpress' ), $topic_title );
572
+
573
+ return apply_filters( 'bbp_get_reply_title_fallback', $reply_title, $post_id, $topic_title );
574
+ }
575
+
576
  /**
577
  * Output the content of the reply
578
  *
971
  }
972
 
973
  /**
974
+ * Deprecated. Use bbp_reply_author_display_name() instead.
975
+ *
976
  * Output the author of the reply
977
  *
978
  * @since bbPress (r2667)
979
+ * @deprecated bbPress (r5119)
980
  *
981
  * @param int $reply_id Optional. Reply id
982
  * @uses bbp_get_reply_author() To get the reply author
985
  echo bbp_get_reply_author( $reply_id );
986
  }
987
  /**
988
+ * Deprecated. Use bbp_get_reply_author_display_name() instead.
989
+ *
990
  * Return the author of the reply
991
  *
992
  * @since bbPress (r2667)
993
+ * @deprecated bbPress (r5119)
994
  *
995
  * @param int $reply_id Optional. Reply id
996
  * @uses bbp_get_reply_id() To get the reply id
1169
  * @uses bbp_get_reply_id() To get the reply id
1170
  * @uses bbp_is_reply_anonymous() To check if the reply is by an
1171
  * anonymous user
 
1172
  * @uses bbp_get_reply_author_url() To get the reply author url
1173
  * @uses bbp_get_reply_author_avatar() To get the reply author avatar
1174
  * @uses bbp_get_reply_author_display_name() To get the reply author display
1231
  // Link class
1232
  $link_class = ' class="bbp-author-' . esc_attr( $r['type'] ) . '"';
1233
 
1234
+ // Add links if not anonymous and existing user
1235
  if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
1236
 
1237
  // Assemble the links
1279
  * @uses bbp_get_reply_id() To get the reply id
1280
  * @uses bbp_is_reply_anonymous() To check if the reply is by an anonymous
1281
  * user
1282
+ * @uses bbp_user_has_profile() To check if the user has a profile
1283
  * @uses bbp_get_reply_author_id() To get the reply author id
1284
  * @uses bbp_get_user_profile_url() To get the user profile url
1285
  * @uses get_post_meta() To get the anonymous poster's website url
1290
  function bbp_get_reply_author_url( $reply_id = 0 ) {
1291
  $reply_id = bbp_get_reply_id( $reply_id );
1292
 
1293
+ // Check for anonymous user or non-existant user
1294
+ if ( !bbp_is_reply_anonymous( $reply_id ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
1295
  $author_url = bbp_get_user_profile_url( bbp_get_reply_author_id( $reply_id ) );
1296
  } else {
1297
  $author_url = get_post_meta( $reply_id, '_bbp_anonymous_website', true );
1607
  * @uses bbp_get_reply() To get the reply
1608
  * @uses apply_filters() Calls 'bbp_get_reply_to_link' with the formatted link,
1609
  * the arguments array, and the reply
1610
+ * @return string Link for a reply to a reply
1611
  */
1612
  function bbp_get_reply_to_link( $args = array() ) {
1613
 
includes/search/template.php CHANGED
@@ -85,15 +85,13 @@ function bbp_has_search_results( $args = '' ) {
85
  // Parse arguments against default values
86
  $r = bbp_parse_args( $args, $default, 'has_search_results' );
87
 
88
- // Don't bother if we don't have search terms
89
- if ( empty( $r['s'] ) )
90
- return false;
91
-
92
  // Get bbPress
93
  $bbp = bbpress();
94
 
95
  // Call the query
96
- $bbp->search_query = new WP_Query( $r );
 
 
97
 
98
  // Add pagination values to query object
99
  $bbp->search_query->posts_per_page = $r['posts_per_page'];
@@ -102,12 +100,8 @@ function bbp_has_search_results( $args = '' ) {
102
  // Never home, regardless of what parse_query says
103
  $bbp->search_query->is_home = false;
104
 
105
- // Found posts
106
- if ( !$bbp->search_query->found_posts )
107
- return false;
108
-
109
  // Only add pagination is query returned results
110
- if ( (int) $bbp->search_query->found_posts && (int) $bbp->search_query->posts_per_page ) {
111
 
112
  // Array of arguments to add after pagination links
113
  $add_args = array();
@@ -270,7 +264,7 @@ function bbp_search_url() {
270
 
271
  // Unpretty permalinks
272
  } else {
273
- $url = add_query_arg( array( 'bbp_search' => '' ), home_url( '/' ) );
274
  }
275
 
276
  return apply_filters( 'bbp_get_search_url', $url );
@@ -320,7 +314,7 @@ function bbp_search_results_url() {
320
 
321
  // Unpretty permalinks
322
  } else {
323
- $url = add_query_arg( array( 'bbp_search' => urlencode( $search_terms ) ), home_url( '/' ) );
324
  }
325
 
326
  return apply_filters( 'bbp_get_search_results_url', $url );
@@ -348,7 +342,7 @@ function bbp_search_terms( $search_terms = '' ) {
348
  *
349
  * @param string $passed_terms Optional. Search terms
350
  * @uses sanitize_title() To sanitize the search terms
351
- * @uses get_query_var*( To get the search terms from query var 'bbp_search'
352
  * @return bool|string Search terms on success, false on failure
353
  */
354
  function bbp_get_search_terms( $passed_terms = '' ) {
85
  // Parse arguments against default values
86
  $r = bbp_parse_args( $args, $default, 'has_search_results' );
87
 
 
 
 
 
88
  // Get bbPress
89
  $bbp = bbpress();
90
 
91
  // Call the query
92
+ if ( ! empty( $r['s'] ) ) {
93
+ $bbp->search_query = new WP_Query( $r );
94
+ }
95
 
96
  // Add pagination values to query object
97
  $bbp->search_query->posts_per_page = $r['posts_per_page'];
100
  // Never home, regardless of what parse_query says
101
  $bbp->search_query->is_home = false;
102
 
 
 
 
 
103
  // Only add pagination is query returned results
104
+ if ( ! empty( $bbp->search_query->found_posts ) && ! empty( $bbp->search_query->posts_per_page ) ) {
105
 
106
  // Array of arguments to add after pagination links
107
  $add_args = array();
264
 
265
  // Unpretty permalinks
266
  } else {
267
+ $url = add_query_arg( array( bbp_get_search_rewrite_id() => '' ), home_url( '/' ) );
268
  }
269
 
270
  return apply_filters( 'bbp_get_search_url', $url );
314
 
315
  // Unpretty permalinks
316
  } else {
317
+ $url = add_query_arg( array( bbp_get_search_rewrite_id() => urlencode( $search_terms ) ), home_url( '/' ) );
318
  }
319
 
320
  return apply_filters( 'bbp_get_search_results_url', $url );
342
  *
343
  * @param string $passed_terms Optional. Search terms
344
  * @uses sanitize_title() To sanitize the search terms
345
+ * @uses get_query_var() To get the search terms from query variable
346
  * @return bool|string Search terms on success, false on failure
347
  */
348
  function bbp_get_search_terms( $passed_terms = '' ) {
includes/topics/functions.php CHANGED
@@ -2200,7 +2200,8 @@ function bbp_toggle_topic_handler( $action = '' ) {
2200
  *
2201
  * @since bbPress (r2652)
2202
  *
2203
- * @param int $topic_id Topic ID to remove
 
2204
  * @uses bbp_get_topic_favoriters() To get the topic's favoriters
2205
  * @uses bbp_remove_user_favorite() To remove the topic from user's favorites
2206
  */
@@ -2231,8 +2232,9 @@ function bbp_remove_topic_from_all_favorites( $topic_id = 0 ) {
2231
  *
2232
  * @since bbPress (r2652)
2233
  *
2234
- * @param int $topic_id Topic ID to remove
2235
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
 
2236
  * @uses bbp_get_topic_subscribers() To get the topic subscribers
2237
  * @uses bbp_remove_user_subscription() To remove the user subscription
2238
  */
2200
  *
2201
  * @since bbPress (r2652)
2202
  *
2203
+ * @param int $topic_id Get the topic id to remove
2204
+ * @uses bbp_get_topic_id To get the topic id
2205
  * @uses bbp_get_topic_favoriters() To get the topic's favoriters
2206
  * @uses bbp_remove_user_favorite() To remove the topic from user's favorites
2207
  */
2232
  *
2233
  * @since bbPress (r2652)
2234
  *
2235
+ * @param int $topic_id Get the topic id to remove
2236
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
2237
+ * @uses bbp_get_topic_id To get the topic id
2238
  * @uses bbp_get_topic_subscribers() To get the topic subscribers
2239
  * @uses bbp_remove_user_subscription() To remove the user subscription
2240
  */
includes/topics/template.php CHANGED
@@ -35,6 +35,62 @@ function bbp_topic_post_type() {
35
  return apply_filters( 'bbp_get_topic_post_type', bbpress()->topic_post_type );
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * The plugin version of bbPress comes with two topic display options:
40
  * - Traditional: Topics are included in the reply loop (default)
@@ -1183,9 +1239,12 @@ function bbp_is_topic_anonymous( $topic_id = 0 ) {
1183
  }
1184
 
1185
  /**
1186
- * Output the author of the topic
 
 
1187
  *
1188
  * @since bbPress (r2590)
 
1189
  *
1190
  * @param int $topic_id Optional. Topic id
1191
  * @uses bbp_get_topic_author() To get the topic author
@@ -1194,9 +1253,12 @@ function bbp_topic_author( $topic_id = 0 ) {
1194
  echo bbp_get_topic_author( $topic_id );
1195
  }
1196
  /**
 
 
1197
  * Return the author of the topic
1198
  *
1199
  * @since bbPress (r2590)
 
1200
  *
1201
  * @param int $topic_id Optional. Topic id
1202
  * @uses bbp_get_topic_id() To get the topic id
@@ -1488,6 +1550,7 @@ function bbp_topic_author_url( $topic_id = 0 ) {
1488
  * @uses bbp_get_topic_id() To get the topic id
1489
  * @uses bbp_is_topic_anonymous() To check if the topic is by an anonymous
1490
  * user or not
 
1491
  * @uses bbp_get_topic_author_id() To get topic author id
1492
  * @uses bbp_get_user_profile_url() To get profile url
1493
  * @uses get_post_meta() To get anonmous user's website
@@ -1498,8 +1561,8 @@ function bbp_topic_author_url( $topic_id = 0 ) {
1498
  function bbp_get_topic_author_url( $topic_id = 0 ) {
1499
  $topic_id = bbp_get_topic_id( $topic_id );
1500
 
1501
- // Check for anonymous user
1502
- if ( !bbp_is_topic_anonymous( $topic_id ) ) {
1503
  $author_url = bbp_get_user_profile_url( bbp_get_topic_author_id( $topic_id ) );
1504
  } else {
1505
  $author_url = get_post_meta( $topic_id, '_bbp_anonymous_website', true );
@@ -1745,6 +1808,96 @@ function bbp_topic_last_active_time( $topic_id = 0 ) {
1745
  return apply_filters( 'bbp_get_topic_last_active', $last_active, $topic_id );
1746
  }
1747
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1748
  /** Topic Last Reply **********************************************************/
1749
 
1750
  /**
@@ -3203,6 +3356,42 @@ function bbp_topic_tag_tax_id() {
3203
  return apply_filters( 'bbp_get_topic_tag_tax_id', bbpress()->topic_tag_tax_id );
3204
  }
3205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3206
  /**
3207
  * Output the id of the current tag
3208
  *
35
  return apply_filters( 'bbp_get_topic_post_type', bbpress()->topic_post_type );
36
  }
37
 
38
+ /**
39
+ * Return array of labels used by the topic post type
40
+ *
41
+ * @since bbPress (r5129)
42
+ *
43
+ * @return array
44
+ */
45
+ function bbp_get_topic_post_type_labels() {
46
+ return apply_filters( 'bbp_get_topic_post_type_labels', array(
47
+ 'name' => __( 'Topics', 'bbpress' ),
48
+ 'menu_name' => __( 'Topics', 'bbpress' ),
49
+ 'singular_name' => __( 'Topic', 'bbpress' ),
50
+ 'all_items' => __( 'All Topics', 'bbpress' ),
51
+ 'add_new' => __( 'New Topic', 'bbpress' ),
52
+ 'add_new_item' => __( 'Create New Topic', 'bbpress' ),
53
+ 'edit' => __( 'Edit', 'bbpress' ),
54
+ 'edit_item' => __( 'Edit Topic', 'bbpress' ),
55
+ 'new_item' => __( 'New Topic', 'bbpress' ),
56
+ 'view' => __( 'View Topic', 'bbpress' ),
57
+ 'view_item' => __( 'View Topic', 'bbpress' ),
58
+ 'search_items' => __( 'Search Topics', 'bbpress' ),
59
+ 'not_found' => __( 'No topics found', 'bbpress' ),
60
+ 'not_found_in_trash' => __( 'No topics found in Trash', 'bbpress' ),
61
+ 'parent_item_colon' => __( 'Forum:', 'bbpress' )
62
+ ) );
63
+ }
64
+
65
+ /**
66
+ * Return array of topic post type rewrite settings
67
+ *
68
+ * @since bbPress (r5129)
69
+ *
70
+ * @return array
71
+ */
72
+ function bbp_get_topic_post_type_rewrite() {
73
+ return apply_filters( 'bbp_get_topic_post_type_rewrite', array(
74
+ 'slug' => bbp_get_topic_slug(),
75
+ 'with_front' => false
76
+ ) );
77
+ }
78
+
79
+ /**
80
+ * Return array of features the topic post type supports
81
+ *
82
+ * @since bbPress (r5129)
83
+ *
84
+ * @return array
85
+ */
86
+ function bbp_get_topic_post_type_supports() {
87
+ return apply_filters( 'bbp_get_topic_post_type_supports', array(
88
+ 'title',
89
+ 'editor',
90
+ 'revisions'
91
+ ) );
92
+ }
93
+
94
  /**
95
  * The plugin version of bbPress comes with two topic display options:
96
  * - Traditional: Topics are included in the reply loop (default)
1239
  }
1240
 
1241
  /**
1242
+ * Deprecated. Use bbp_topic_author_display_name() instead.
1243
+ *
1244
+ * Output the author of the topic.
1245
  *
1246
  * @since bbPress (r2590)
1247
+ * @deprecated bbPress (r5119)
1248
  *
1249
  * @param int $topic_id Optional. Topic id
1250
  * @uses bbp_get_topic_author() To get the topic author
1253
  echo bbp_get_topic_author( $topic_id );
1254
  }
1255
  /**
1256
+ * Deprecated. Use bbp_get_topic_author_display_name() instead.
1257
+ *
1258
  * Return the author of the topic
1259
  *
1260
  * @since bbPress (r2590)
1261
+ * @deprecated bbPress (r5119)
1262
  *
1263
  * @param int $topic_id Optional. Topic id
1264
  * @uses bbp_get_topic_id() To get the topic id
1550
  * @uses bbp_get_topic_id() To get the topic id
1551
  * @uses bbp_is_topic_anonymous() To check if the topic is by an anonymous
1552
  * user or not
1553
+ * @uses bbp_user_has_profile() To check if the user has a profile
1554
  * @uses bbp_get_topic_author_id() To get topic author id
1555
  * @uses bbp_get_user_profile_url() To get profile url
1556
  * @uses get_post_meta() To get anonmous user's website
1561
  function bbp_get_topic_author_url( $topic_id = 0 ) {
1562
  $topic_id = bbp_get_topic_id( $topic_id );
1563
 
1564
+ // Check for anonymous user or non-existant user
1565
+ if ( !bbp_is_topic_anonymous( $topic_id ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
1566
  $author_url = bbp_get_user_profile_url( bbp_get_topic_author_id( $topic_id ) );
1567
  } else {
1568
  $author_url = get_post_meta( $topic_id, '_bbp_anonymous_website', true );
1808
  return apply_filters( 'bbp_get_topic_last_active', $last_active, $topic_id );
1809
  }
1810
 
1811
+ /** Topic Subscriptions *******************************************************/
1812
+
1813
+ /**
1814
+ * Output the topic subscription link
1815
+ *
1816
+ * @since bbPress (r5156)
1817
+ *
1818
+ * @uses bbp_get_topic_subscription_link()
1819
+ */
1820
+ function bbp_topic_subscription_link( $args = array() ) {
1821
+ echo bbp_get_topic_subscription_link( $args );
1822
+ }
1823
+
1824
+ /**
1825
+ * Get the forum subscription link
1826
+ *
1827
+ * A custom wrapper for bbp_get_user_subscribe_link()
1828
+ *
1829
+ * @since bbPress (r5156)
1830
+ *
1831
+ * @uses bbp_parse_args()
1832
+ * @uses bbp_get_user_subscribe_link()
1833
+ * @uses apply_filters() Calls 'bbp_get_topic_subscribe_link'
1834
+ */
1835
+ function bbp_get_topic_subscription_link( $args = array() ) {
1836
+
1837
+ // No link
1838
+ $retval = false;
1839
+
1840
+ // Parse the arguments
1841
+ $r = bbp_parse_args( $args, array(
1842
+ 'user_id' => 0,
1843
+ 'topic_id' => 0,
1844
+ 'before' => '&nbsp;|&nbsp;',
1845
+ 'after' => '',
1846
+ 'subscribe' => __( 'Subscribe', 'bbpress' ),
1847
+ 'unsubscribe' => __( 'Unsubscribe', 'bbpress' )
1848
+ ), 'get_forum_subscribe_link' );
1849
+
1850
+ // Get the link
1851
+ $retval = bbp_get_user_subscribe_link( $r );
1852
+
1853
+ return apply_filters( 'bbp_get_topic_subscribe_link', $retval, $r );
1854
+ }
1855
+
1856
+ /** Topic Favorites ***********************************************************/
1857
+
1858
+ /**
1859
+ * Output the topic favorite link
1860
+ *
1861
+ * @since bbPress (r5156)
1862
+ *
1863
+ * @uses bbp_get_topic_favorite_link()
1864
+ */
1865
+ function bbp_topic_favorite_link( $args = array() ) {
1866
+ echo bbp_get_topic_favorite_link( $args );
1867
+ }
1868
+
1869
+ /**
1870
+ * Get the forum favorite link
1871
+ *
1872
+ * A custom wrapper for bbp_get_user_favorite_link()
1873
+ *
1874
+ * @since bbPress (r5156)
1875
+ *
1876
+ * @uses bbp_parse_args()
1877
+ * @uses bbp_get_user_favorites_link()
1878
+ * @uses apply_filters() Calls 'bbp_get_topic_favorite_link'
1879
+ */
1880
+ function bbp_get_topic_favorite_link( $args = array() ) {
1881
+
1882
+ // No link
1883
+ $retval = false;
1884
+
1885
+ // Parse the arguments
1886
+ $r = bbp_parse_args( $args, array(
1887
+ 'user_id' => 0,
1888
+ 'topic_id' => 0,
1889
+ 'before' => '',
1890
+ 'after' => '',
1891
+ 'favorite' => __( 'Favorite', 'bbpress' ),
1892
+ 'favorited' => __( 'Unfavorite', 'bbpress' )
1893
+ ), 'get_forum_favorite_link' );
1894
+
1895
+ // Get the link
1896
+ $retval = bbp_get_user_favorites_link( $r );
1897
+
1898
+ return apply_filters( 'bbp_get_topic_favorite_link', $retval, $r );
1899
+ }
1900
+
1901
  /** Topic Last Reply **********************************************************/
1902
 
1903
  /**
3356
  return apply_filters( 'bbp_get_topic_tag_tax_id', bbpress()->topic_tag_tax_id );
3357
  }
3358
 
3359
+ /**
3360
+ * Return array of labels used by the topic-tag taxonomy
3361
+ *
3362
+ * @since bbPress (r5129)
3363
+ *
3364
+ * @return array
3365
+ */
3366
+ function bbp_get_topic_tag_tax_labels() {
3367
+ return apply_filters( 'bbp_get_topic_tag_tax_labels', array(
3368
+ 'name' => __( 'Topic Tags', 'bbpress' ),
3369
+ 'singular_name' => __( 'Topic Tag', 'bbpress' ),
3370
+ 'search_items' => __( 'Search Tags', 'bbpress' ),
3371
+ 'popular_items' => __( 'Popular Tags', 'bbpress' ),
3372
+ 'all_items' => __( 'All Tags', 'bbpress' ),
3373
+ 'edit_item' => __( 'Edit Tag', 'bbpress' ),
3374
+ 'update_item' => __( 'Update Tag', 'bbpress' ),
3375
+ 'add_new_item' => __( 'Add New Tag', 'bbpress' ),
3376
+ 'new_item_name' => __( 'New Tag Name', 'bbpress' ),
3377
+ 'view_item' => __( 'View Topic Tag', 'bbpress' )
3378
+ ) );
3379
+ }
3380
+
3381
+ /**
3382
+ * Return an array of topic-tag taxonomy rewrite settings
3383
+ *
3384
+ * @since bbPress (r5129)
3385
+ *
3386
+ * @return array
3387
+ */
3388
+ function bbp_get_topic_tag_tax_rewrite() {
3389
+ return apply_filters( 'bbp_get_topic_tag_tax_rewrite', array(
3390
+ 'slug' => bbp_get_topic_tag_tax_slug(),
3391
+ 'with_front' => false
3392
+ ) );
3393
+ }
3394
+
3395
  /**
3396
  * Output the id of the current tag
3397
  *
includes/users/capabilities.php CHANGED
@@ -149,12 +149,12 @@ function bbp_get_user_role( $user_id = 0 ) {
149
  function bbp_get_user_blog_role( $user_id = 0 ) {
150
 
151
  // Add bbPress roles (returns $wp_roles global)
152
- $wp_roles = bbp_add_forums_roles();
153
 
154
  // Validate user id
155
- $user_id = bbp_get_user_id( $user_id );
156
- $user = get_userdata( $user_id );
157
- $role = false;
158
 
159
  // User has roles so lets
160
  if ( ! empty( $user->roles ) ) {
149
  function bbp_get_user_blog_role( $user_id = 0 ) {
150
 
151
  // Add bbPress roles (returns $wp_roles global)
152
+ bbp_add_forums_roles();
153
 
154
  // Validate user id
155
+ $user_id = bbp_get_user_id( $user_id );
156
+ $user = get_userdata( $user_id );
157
+ $role = false;
158
 
159
  // User has roles so lets
160
  if ( ! empty( $user->roles ) ) {
includes/users/functions.php CHANGED
@@ -44,7 +44,7 @@ function bbp_redirect_login( $url = '', $raw_url = '', $user = '' ) {
44
  /**
45
  * Is an anonymous topic/reply being made?
46
  *
47
- * @since bbPres (r2688)
48
  *
49
  * @uses is_user_logged_in() Is the user logged in?
50
  * @uses bbp_allow_anonymous() Is anonymous posting allowed?
@@ -87,9 +87,9 @@ function bbp_current_anonymous_user_data( $key = '' ) {
87
  */
88
  function bbp_get_current_anonymous_user_data( $key = '' ) {
89
  $cookie_names = array(
90
- 'name' => 'comment_author',
91
- 'email' => 'comment_author_email',
92
- 'website' => 'comment_author_url',
93
 
94
  // Here just for the sake of them, use the above ones
95
  'comment_author' => 'comment_author',
@@ -313,7 +313,7 @@ function bbp_is_user_favorite( $user_id = 0, $topic_id = 0 ) {
313
  $favorites = bbp_get_user_favorites_topic_ids( $user_id );
314
 
315
  if ( !empty( $favorites ) ) {
316
-
317
  // Checking a specific topic id
318
  if ( !empty( $topic_id ) ) {
319
  $topic = bbp_get_topic( $topic_id );
@@ -511,6 +511,33 @@ function bbp_favorites_handler( $action = '' ) {
511
 
512
  /** Subscriptions *************************************************************/
513
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  /**
515
  * Get the users who have subscribed to the topic
516
  *
@@ -538,6 +565,23 @@ function bbp_get_topic_subscribers( $topic_id = 0 ) {
538
  return apply_filters( 'bbp_get_topic_subscribers', $users );
539
  }
540
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  /**
542
  * Get a user's subscribed topics
543
  *
@@ -550,12 +594,13 @@ function bbp_get_topic_subscribers( $topic_id = 0 ) {
550
  * and user id
551
  * @return array|bool Results if user has subscriptions, otherwise false
552
  */
553
- function bbp_get_user_subscriptions( $user_id = 0 ) {
554
 
555
  // Default to the displayed user
556
  $user_id = bbp_get_user_id( $user_id );
557
- if ( empty( $user_id ) )
558
  return false;
 
559
 
560
  // If user has subscriptions, load them
561
  $subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
@@ -565,7 +610,61 @@ function bbp_get_user_subscriptions( $user_id = 0 ) {
565
  $query = false;
566
  }
567
 
568
- return apply_filters( 'bbp_get_user_subscriptions', $query, $user_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  }
570
 
571
  /**
@@ -591,13 +690,125 @@ function bbp_get_user_subscribed_topic_ids( $user_id = 0 ) {
591
  return (array) apply_filters( 'bbp_get_user_subscribed_topic_ids', $subscriptions, $user_id );
592
  }
593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  /**
595
  * Check if a topic is in user's subscription list or not
596
  *
597
- * @since bbPress (r2668)
598
  *
599
  * @param int $user_id Optional. User id
600
  * @param int $topic_id Optional. Topic id
 
601
  * @uses bbp_get_user_id() To get the user id
602
  * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
603
  * @uses bbp_get_topic() To get the topic
@@ -606,39 +817,128 @@ function bbp_get_user_subscribed_topic_ids( $user_id = 0 ) {
606
  * topic id and subsriptions
607
  * @return bool True if the topic is in user's subscriptions, otherwise false
608
  */
609
- function bbp_is_user_subscribed( $user_id = 0, $topic_id = 0 ) {
 
 
 
610
 
611
  // Validate user
612
  $user_id = bbp_get_user_id( $user_id, true, true );
613
- if ( empty( $user_id ) )
614
- return false;
615
 
616
- $retval = false;
617
- $subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
 
 
618
 
619
- if ( !empty( $subscriptions ) ) {
 
620
 
621
- // Checking a specific topic id
622
- if ( !empty( $topic_id ) ) {
623
- $topic = bbp_get_topic( $topic_id );
624
- $topic_id = !empty( $topic ) ? $topic->ID : 0;
625
 
626
- // Using the global topic id
627
- } elseif ( bbp_get_topic_id() ) {
628
- $topic_id = bbp_get_topic_id();
629
 
630
- // Use the current post id
631
- } elseif ( !bbp_get_topic_id() ) {
632
- $topic_id = get_the_ID();
633
- }
634
 
635
- // Is topic_id in the user's favorites
636
- if ( !empty( $topic_id ) ) {
637
- $retval = in_array( $topic_id, $subscriptions );
 
638
  }
639
  }
640
 
641
- return (bool) apply_filters( 'bbp_is_user_subscribed', (bool) $retval, $user_id, $topic_id, $subscriptions );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
642
  }
643
 
644
  /**
@@ -654,13 +954,15 @@ function bbp_is_user_subscribed( $user_id = 0, $topic_id = 0 ) {
654
  * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id
655
  * @return bool Always true
656
  */
657
- function bbp_add_user_subscription( $user_id = 0, $topic_id = 0 ) {
658
- if ( empty( $user_id ) || empty( $topic_id ) )
659
  return false;
 
660
 
661
  $topic = bbp_get_topic( $topic_id );
662
- if ( empty( $topic ) )
663
  return false;
 
664
 
665
  $subscriptions = (array) bbp_get_user_subscribed_topic_ids( $user_id );
666
  if ( !in_array( $topic_id, $subscriptions ) ) {
@@ -671,7 +973,7 @@ function bbp_add_user_subscription( $user_id = 0, $topic_id = 0 ) {
671
  wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
672
  }
673
 
674
- do_action( 'bbp_add_user_subscription', $user_id, $topic_id );
675
 
676
  return true;
677
  }
@@ -683,43 +985,247 @@ function bbp_add_user_subscription( $user_id = 0, $topic_id = 0 ) {
683
  *
684
  * @param int $user_id Optional. User id
685
  * @param int $topic_id Optional. Topic id
686
- * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  * @uses update_user_option() To update the user's subscriptions
688
  * @uses delete_user_option() To delete the user's subscriptions meta
689
  * @uses do_action() Calls 'bbp_remove_user_subscription' with the user id and
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  * topic id
691
  * @return bool True if the topic was removed from user's subscriptions,
692
  * otherwise false
693
  */
694
- function bbp_remove_user_subscription( $user_id, $topic_id ) {
695
- if ( empty( $user_id ) || empty( $topic_id ) )
696
  return false;
 
697
 
698
  $subscriptions = (array) bbp_get_user_subscribed_topic_ids( $user_id );
699
-
700
- if ( empty( $subscriptions ) )
701
  return false;
 
702
 
703
  $pos = array_search( $topic_id, $subscriptions );
704
- if ( is_numeric( $pos ) ) {
705
- array_splice( $subscriptions, $pos, 1 );
706
- $subscriptions = array_filter( $subscriptions );
707
 
708
- if ( !empty( $subscriptions ) ) {
709
- $subscriptions = implode( ',', wp_parse_id_list( $subscriptions ) );
710
- update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
711
- } else {
712
- delete_user_option( $user_id, '_bbp_subscriptions' );
713
- }
714
 
715
- wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
 
 
 
 
716
  }
717
 
718
- do_action( 'bbp_remove_user_subscription', $user_id, $topic_id );
 
 
719
 
720
  return true;
721
  }
722
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
  /**
724
  * Handles the front end subscribing and unsubscribing topics
725
  *
@@ -736,18 +1242,19 @@ function bbp_remove_user_subscription( $user_id, $topic_id ) {
736
  * @uses do_action() Calls 'bbp_subscriptions_handler' with success, user id,
737
  * topic id and action
738
  * @uses bbp_is_subscription() To check if it's the subscription page
739
- * @uses bbp_get_subscription_link() To get the subscription page link
740
  * @uses bbp_get_topic_permalink() To get the topic permalink
741
  * @uses wp_safe_redirect() To redirect to the url
742
  */
743
  function bbp_subscriptions_handler( $action = '' ) {
744
 
745
- if ( !bbp_is_subscriptions_active() )
746
  return false;
 
747
 
748
  // Bail if no topic ID is passed
749
- if ( empty( $_GET['topic_id'] ) )
750
  return;
 
751
 
752
  // Setup possible get actions
753
  $possible_actions = array(
@@ -756,8 +1263,9 @@ function bbp_subscriptions_handler( $action = '' ) {
756
  );
757
 
758
  // Bail if actions aren't meant for this function
759
- if ( !in_array( $action, $possible_actions ) )
760
  return;
 
761
 
762
  // Get required data
763
  $user_id = bbp_get_user_id( 0, true, true );
@@ -777,18 +1285,20 @@ function bbp_subscriptions_handler( $action = '' ) {
777
  }
778
 
779
  // Bail if we have errors
780
- if ( bbp_has_errors() )
781
  return;
 
782
 
783
  /** No errors *************************************************************/
784
 
785
  $is_subscription = bbp_is_user_subscribed( $user_id, $topic_id );
786
  $success = false;
787
 
788
- if ( true === $is_subscription && 'bbp_unsubscribe' === $action )
789
  $success = bbp_remove_user_subscription( $user_id, $topic_id );
790
- elseif ( false === $is_subscription && 'bbp_subscribe' === $action )
791
  $success = bbp_add_user_subscription( $user_id, $topic_id );
 
792
 
793
  // Do additional subscriptions actions
794
  do_action( 'bbp_subscriptions_handler', $success, $user_id, $topic_id, $action );
@@ -968,7 +1478,7 @@ function bbp_user_edit_after() {
968
  * @return array|bool Results if the user has created topics, otherwise false
969
  */
970
  function bbp_get_user_topics_started( $user_id = 0 ) {
971
-
972
  // Validate user
973
  $user_id = bbp_get_user_id( $user_id );
974
  if ( empty( $user_id ) )
@@ -993,7 +1503,7 @@ function bbp_get_user_topics_started( $user_id = 0 ) {
993
  * @return array|bool Results if the user has created topics, otherwise false
994
  */
995
  function bbp_get_user_replies_created( $user_id = 0 ) {
996
-
997
  // Validate user
998
  $user_id = bbp_get_user_id( $user_id );
999
  if ( empty( $user_id ) )
@@ -1031,7 +1541,7 @@ function bbp_get_total_users() {
1031
  * which a user can edit another user (or themselves.) If these conditions are
1032
  * met. We assume a user cannot perform this task, and look for ways they can
1033
  * earn the ability to access this template.
1034
- *
1035
  * @since bbPress (r3605)
1036
  *
1037
  * @uses bbp_is_topic_edit()
44
  /**
45
  * Is an anonymous topic/reply being made?
46
  *
47
+ * @since bbPress (r2688)
48
  *
49
  * @uses is_user_logged_in() Is the user logged in?
50
  * @uses bbp_allow_anonymous() Is anonymous posting allowed?
87
  */
88
  function bbp_get_current_anonymous_user_data( $key = '' ) {
89
  $cookie_names = array(
90
+ 'name' => 'comment_author',
91
+ 'email' => 'comment_author_email',
92
+ 'url' => 'comment_author_url',
93
 
94
  // Here just for the sake of them, use the above ones
95
  'comment_author' => 'comment_author',
313
  $favorites = bbp_get_user_favorites_topic_ids( $user_id );
314
 
315
  if ( !empty( $favorites ) ) {
316
+
317
  // Checking a specific topic id
318
  if ( !empty( $topic_id ) ) {
319
  $topic = bbp_get_topic( $topic_id );
511
 
512
  /** Subscriptions *************************************************************/
513
 
514
+ /**
515
+ * Get the users who have subscribed to the forum
516
+ *
517
+ * @since bbPress (r5156)
518
+ *
519
+ * @param int $forum_id Optional. forum id
520
+ * @uses wpdb::get_col() To execute our query and get the column back
521
+ * @uses apply_filters() Calls 'bbp_get_forum_subscribers' with the subscribers
522
+ * @return array|bool Results if the forum has any subscribers, otherwise false
523
+ */
524
+ function bbp_get_forum_subscribers( $forum_id = 0 ) {
525
+ $forum_id = bbp_get_forum_id( $forum_id );
526
+ if ( empty( $forum_id ) )
527
+ return;
528
+
529
+ global $wpdb;
530
+
531
+ $key = $wpdb->prefix . '_bbp_forum_subscriptions';
532
+ $users = wp_cache_get( 'bbp_get_forum_subscribers_' . $forum_id, 'bbpress_users' );
533
+ if ( false === $users ) {
534
+ $users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$forum_id}', meta_value) > 0" );
535
+ wp_cache_set( 'bbp_get_forum_subscribers_' . $forum_id, $users, 'bbpress_users' );
536
+ }
537
+
538
+ return apply_filters( 'bbp_get_forum_subscribers', $users );
539
+ }
540
+
541
  /**
542
  * Get the users who have subscribed to the topic
543
  *
565
  return apply_filters( 'bbp_get_topic_subscribers', $users );
566
  }
567
 
568
+ /**
569
+ * Get a user's subscribed topics
570
+ *
571
+ * @since bbPress (r2668)
572
+ *
573
+ * @deprecated since bbPress (r5156)
574
+ *
575
+ * @param int $user_id Optional. User id
576
+ * @uses bbp_get_user_topic_subscriptions() To get the user's subscriptions
577
+ * @return array|bool Results if user has subscriptions, otherwise false
578
+ */
579
+ function bbp_get_user_subscriptions( $user_id = 0 ) {
580
+ _deprecated_function( __FUNCTION__, 2.5, 'bbp_get_user_topic_subscriptions()' );
581
+ $query = bbp_get_user_topic_subscriptions( $user_id );
582
+ return apply_filters( 'bbp_get_user_subscriptions', $query, $user_id );
583
+ }
584
+
585
  /**
586
  * Get a user's subscribed topics
587
  *
594
  * and user id
595
  * @return array|bool Results if user has subscriptions, otherwise false
596
  */
597
+ function bbp_get_user_topic_subscriptions( $user_id = 0 ) {
598
 
599
  // Default to the displayed user
600
  $user_id = bbp_get_user_id( $user_id );
601
+ if ( empty( $user_id ) ) {
602
  return false;
603
+ }
604
 
605
  // If user has subscriptions, load them
606
  $subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
610
  $query = false;
611
  }
612
 
613
+ return apply_filters( 'bbp_get_user_topic_subscriptions', $query, $user_id );
614
+ }
615
+
616
+ /**
617
+ * Get a user's subscribed forums
618
+ *
619
+ * @since bbPress (r5156)
620
+ *
621
+ * @param int $user_id Optional. User id
622
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
623
+ * @uses bbp_has_forums() To get the forums
624
+ * @uses apply_filters() Calls 'bbp_get_user_forum_subscriptions' with the forum
625
+ * query and user id
626
+ * @return array|bool Results if user has subscriptions, otherwise false
627
+ */
628
+ function bbp_get_user_forum_subscriptions( $user_id = 0 ) {
629
+
630
+ // Default to the displayed user
631
+ $user_id = bbp_get_user_id( $user_id );
632
+ if ( empty( $user_id ) ) {
633
+ return false;
634
+ }
635
+
636
+ // If user has subscriptions, load them
637
+ $subscriptions = bbp_get_user_subscribed_forum_ids( $user_id );
638
+ if ( !empty( $subscriptions ) ) {
639
+ $query = bbp_has_forums( array( 'post__in' => $subscriptions ) );
640
+ } else {
641
+ $query = false;
642
+ }
643
+
644
+ return apply_filters( 'bbp_get_user_forum_subscriptions', $query, $user_id );
645
+ }
646
+
647
+ /**
648
+ * Get a user's subscribed forum ids
649
+ *
650
+ * @since bbPress (r5156)
651
+ *
652
+ * @param int $user_id Optional. User id
653
+ * @uses bbp_get_user_id() To get the user id
654
+ * @uses get_user_option() To get the user's subscriptions
655
+ * @uses apply_filters() Calls 'bbp_get_user_subscribed_forum_ids' with
656
+ * the subscriptions and user id
657
+ * @return array|bool Results if user has subscriptions, otherwise false
658
+ */
659
+ function bbp_get_user_subscribed_forum_ids( $user_id = 0 ) {
660
+ $user_id = bbp_get_user_id( $user_id );
661
+ if ( empty( $user_id ) )
662
+ return false;
663
+
664
+ $subscriptions = get_user_option( '_bbp_forum_subscriptions', $user_id );
665
+ $subscriptions = array_filter( wp_parse_id_list( $subscriptions ) );
666
+
667
+ return (array) apply_filters( 'bbp_get_user_subscribed_forum_ids', $subscriptions, $user_id );
668
  }
669
 
670
  /**
690
  return (array) apply_filters( 'bbp_get_user_subscribed_topic_ids', $subscriptions, $user_id );
691
  }
692
 
693
+ /**
694
+ * Check if a topic or forum is in user's subscription list or not
695
+ *
696
+ * @since bbPress (r5156)
697
+ *
698
+ * @param int $user_id Optional. User id
699
+ * @param int $forum_id Optional. Topic id
700
+ * @uses get_post() To get the post object
701
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's forum subscriptions
702
+ * @uses bbp_get_user_subscribed_topic_ids() To get the user's topic subscriptions
703
+ * @uses bbp_get_forum_post_type() To get the forum post type
704
+ * @uses bbp_get_topic_post_type() To get the topic post type
705
+ * @uses apply_filters() Calls 'bbp_is_user_subscribed' with the bool, user id,
706
+ * forum/topic id and subsriptions
707
+ * @return bool True if the forum or topic is in user's subscriptions, otherwise false
708
+ */
709
+ function bbp_is_user_subscribed( $user_id = 0, $object_id = 0 ) {
710
+
711
+ // Assume user is not subscribed
712
+ $retval = false;
713
+
714
+ // Setup ID's array
715
+ $subscribed_ids = array();
716
+
717
+ // User and object ID's are passed
718
+ if ( ! empty( $user_id ) && ! empty( $object_id ) ) {
719
+
720
+ // Get the post type
721
+ $post_type = get_post_type( $object_id );
722
+
723
+ // Post exists, so check the types
724
+ if ( ! empty( $post_type ) ) {
725
+
726
+ switch( $post_type ) {
727
+
728
+ // Forum
729
+ case bbp_get_forum_post_type() :
730
+ $subscribed_ids = bbp_get_user_subscribed_forum_ids( $user_id );
731
+ $retval = bbp_is_user_subscribed_to_forum( $user_id, $object_id, $subscribed_ids );
732
+ break;
733
+
734
+ // Topic (default)
735
+ case bbp_get_topic_post_type() :
736
+ default :
737
+ $subscribed_ids = bbp_get_user_subscribed_topic_ids( $user_id );
738
+ $retval = bbp_is_user_subscribed_to_topic( $user_id, $object_id, $subscribed_ids );
739
+ break;
740
+ }
741
+ }
742
+ }
743
+
744
+ return (bool) apply_filters( 'bbp_is_user_subscribed', $retval, $user_id, $object_id, $subscribed_ids );
745
+ }
746
+
747
+ /**
748
+ * Check if a forum is in user's subscription list or not
749
+ *
750
+ * @since bbPress (r5156)
751
+ *
752
+ * @param int $user_id Optional. User id
753
+ * @param int $forum_id Optional. Topic id
754
+ * @param array $subscribed_ids Optional. Array of forum ID's to check
755
+ * @uses bbp_get_user_id() To get the user id
756
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
757
+ * @uses bbp_get_forum() To get the forum
758
+ * @uses bbp_get_forum_id() To get the forum id
759
+ * @uses apply_filters() Calls 'bbp_is_user_subscribed' with the bool, user id,
760
+ * forum id and subsriptions
761
+ * @return bool True if the forum is in user's subscriptions, otherwise false
762
+ */
763
+ function bbp_is_user_subscribed_to_forum( $user_id = 0, $forum_id = 0, $subscribed_ids = array() ) {
764
+
765
+ // Assume user is not subscribed
766
+ $retval = false;
767
+
768
+ // Validate user
769
+ $user_id = bbp_get_user_id( $user_id, true, true );
770
+ if ( ! empty( $user_id ) ) {
771
+
772
+ // Get subscription ID's if none passed
773
+ if ( empty( $subscribed_ids ) ) {
774
+ $subscribed_ids = bbp_get_user_subscribed_forum_ids( $user_id );
775
+ }
776
+
777
+ // User has forum subscriptions
778
+ if ( ! empty( $subscribed_ids ) ) {
779
+
780
+ // Checking a specific forum id
781
+ if ( ! empty( $forum_id ) ) {
782
+ $forum = bbp_get_forum( $forum_id );
783
+ $forum_id = ! empty( $forum ) ? $forum->ID : 0;
784
+
785
+ // Using the global forum id
786
+ } elseif ( bbp_get_forum_id() ) {
787
+ $forum_id = bbp_get_forum_id();
788
+
789
+ // Use the current post id
790
+ } elseif ( ! bbp_get_forum_id() ) {
791
+ $forum_id = get_the_ID();
792
+ }
793
+
794
+ // Is forum_id in the user's favorites
795
+ if ( ! empty( $forum_id ) ) {
796
+ $retval = in_array( $forum_id, $subscribed_ids );
797
+ }
798
+ }
799
+ }
800
+
801
+ return (bool) apply_filters( 'bbp_is_user_subscribed_to_forum', (bool) $retval, $user_id, $forum_id, $subscribed_ids );
802
+ }
803
+
804
  /**
805
  * Check if a topic is in user's subscription list or not
806
  *
807
+ * @since bbPress (r5156)
808
  *
809
  * @param int $user_id Optional. User id
810
  * @param int $topic_id Optional. Topic id
811
+ * @param array $subscribed_ids Optional. Array of topic ID's to check
812
  * @uses bbp_get_user_id() To get the user id
813
  * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
814
  * @uses bbp_get_topic() To get the topic
817
  * topic id and subsriptions
818
  * @return bool True if the topic is in user's subscriptions, otherwise false
819
  */
820
+ function bbp_is_user_subscribed_to_topic( $user_id = 0, $topic_id = 0, $subscribed_ids = array() ) {
821
+
822
+ // Assume user is not subscribed
823
+ $retval = false;
824
 
825
  // Validate user
826
  $user_id = bbp_get_user_id( $user_id, true, true );
827
+ if ( !empty( $user_id ) ) {
 
828
 
829
+ // Get subscription ID's if none passed
830
+ if ( empty( $subscribed_ids ) ) {
831
+ $subscribed_ids = bbp_get_user_subscribed_topic_ids( $user_id );
832
+ }
833
 
834
+ // User has topic subscriptions
835
+ if ( ! empty( $subscribed_ids ) ) {
836
 
837
+ // Checking a specific topic id
838
+ if ( ! empty( $topic_id ) ) {
839
+ $topic = bbp_get_topic( $topic_id );
840
+ $topic_id = ! empty( $topic ) ? $topic->ID : 0;
841
 
842
+ // Using the global topic id
843
+ } elseif ( bbp_get_topic_id() ) {
844
+ $topic_id = bbp_get_topic_id();
845
 
846
+ // Use the current post id
847
+ } elseif ( !bbp_get_topic_id() ) {
848
+ $topic_id = get_the_ID();
849
+ }
850
 
851
+ // Is topic_id in the user's favorites
852
+ if ( ! empty( $topic_id ) ) {
853
+ $retval = in_array( $topic_id, $subscribed_ids );
854
+ }
855
  }
856
  }
857
 
858
+ return (bool) apply_filters( 'bbp_is_user_subscribed_to_topic', (bool) $retval, $user_id, $topic_id, $subscribed_ids );
859
+ }
860
+
861
+ /**
862
+ * Add a topic to user's subscriptions
863
+ *
864
+ * @since bbPress (r5156)
865
+ *
866
+ * @param int $user_id Optional. User id
867
+ * @param int $topic_id Optional. Topic id
868
+ * @uses get_post() To get the post object
869
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's forum subscriptions
870
+ * @uses bbp_get_user_subscribed_topic_ids() To get the user's topic subscriptions
871
+ * @uses bbp_get_forum_post_type() To get the forum post type
872
+ * @uses bbp_get_topic_post_type() To get the topic post type
873
+ * @uses update_user_option() To update the user's subscriptions
874
+ * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id
875
+ * @return bool Always true
876
+ */
877
+ function bbp_add_user_subscription( $user_id = 0, $object_id = 0 ) {
878
+ if ( empty( $user_id ) || empty( $object_id ) ) {
879
+ return false;
880
+ }
881
+
882
+ // Get the post type
883
+ $post_type = get_post_type( $object_id );
884
+ if ( empty( $post_type ) ) {
885
+ return false;
886
+ }
887
+
888
+ switch( $post_type ) {
889
+
890
+ // Forum
891
+ case bbp_get_forum_post_type() :
892
+ bbp_add_user_forum_subscription( $user_id, $object_id );
893
+ break;
894
+
895
+ // Topic
896
+ case bbp_get_topic_post_type() :
897
+ default :
898
+ bbp_add_user_topic_subscription( $user_id, $object_id );
899
+ break;
900
+ }
901
+
902
+ do_action( 'bbp_add_user_subscription', $user_id, $object_id, $post_type );
903
+
904
+ return true;
905
+ }
906
+
907
+ /**
908
+ * Add a forum to user's subscriptions
909
+ *
910
+ * @since bbPress (r5156)
911
+ *
912
+ * @param int $user_id Optional. User id
913
+ * @param int $forum_id Optional. forum id
914
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
915
+ * @uses bbp_get_forum() To get the forum
916
+ * @uses update_user_option() To update the user's subscriptions
917
+ * @uses do_action() Calls 'bbp_add_user_subscription' with the user & forum id
918
+ * @return bool Always true
919
+ */
920
+ function bbp_add_user_forum_subscription( $user_id = 0, $forum_id = 0 ) {
921
+ if ( empty( $user_id ) || empty( $forum_id ) ) {
922
+ return false;
923
+ }
924
+
925
+ $forum = bbp_get_forum( $forum_id );
926
+ if ( empty( $forum ) ) {
927
+ return false;
928
+ }
929
+
930
+ $subscriptions = (array) bbp_get_user_subscribed_forum_ids( $user_id );
931
+ if ( !in_array( $forum_id, $subscriptions ) ) {
932
+ $subscriptions[] = $forum_id;
933
+ $subscriptions = implode( ',', wp_parse_id_list( array_filter( $subscriptions ) ) );
934
+ update_user_option( $user_id, '_bbp_forum_subscriptions', $subscriptions );
935
+
936
+ wp_cache_delete( 'bbp_get_forum_subscribers_' . $forum_id, 'bbpress_users' );
937
+ }
938
+
939
+ do_action( 'bbp_add_user_forum_subscription', $user_id, $forum_id );
940
+
941
+ return true;
942
  }
943
 
944
  /**
954
  * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id
955
  * @return bool Always true
956
  */
957
+ function bbp_add_user_topic_subscription( $user_id = 0, $topic_id = 0 ) {
958
+ if ( empty( $user_id ) || empty( $topic_id ) ) {
959
  return false;
960
+ }
961
 
962
  $topic = bbp_get_topic( $topic_id );
963
+ if ( empty( $topic ) ) {
964
  return false;
965
+ }
966
 
967
  $subscriptions = (array) bbp_get_user_subscribed_topic_ids( $user_id );
968
  if ( !in_array( $topic_id, $subscriptions ) ) {
973
  wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
974
  }
975
 
976
+ do_action( 'bbp_add_user_topic_subscription', $user_id, $topic_id );
977
 
978
  return true;
979
  }
985
  *
986
  * @param int $user_id Optional. User id
987
  * @param int $topic_id Optional. Topic id
988
+ * @uses get_post() To get the post object
989
+ * @uses bbp_get_forum_post_type() To get the forum post type
990
+ * @uses bbp_get_topic_post_type() To get the topic post type
991
+ * @uses bbp_remove_user_forum_subscription() To remove the user's subscription
992
+ * @uses bbp_remove_user_topic_subscription() To remove the user's subscription
993
+ * @uses do_action() Calls 'bbp_remove_user_subscription' with the user id and
994
+ * topic id
995
+ * @return bool True if the topic was removed from user's subscriptions,
996
+ * otherwise false
997
+ */
998
+ function bbp_remove_user_subscription( $user_id = 0, $object_id = 0 ) {
999
+ if ( empty( $user_id ) || empty( $object_id ) ) {
1000
+ return false;
1001
+ }
1002
+
1003
+ $post_type = get_post_type( $object_id );
1004
+ if ( empty( $post_type ) ) {
1005
+ return false;
1006
+ }
1007
+
1008
+ switch( $post_type ) {
1009
+
1010
+ // Forum
1011
+ case bbp_get_forum_post_type() :
1012
+ bbp_remove_user_forum_subscription( $user_id, $object_id );
1013
+ break;
1014
+
1015
+ // Topic
1016
+ case bbp_get_topic_post_type() :
1017
+ default :
1018
+ bbp_remove_user_topic_subscription( $user_id, $object_id );
1019
+ break;
1020
+ }
1021
+
1022
+ do_action( 'bbp_remove_user_subscription', $user_id, $object_id, $post_type );
1023
+
1024
+ return true;
1025
+ }
1026
+
1027
+ /**
1028
+ * Remove a forum from user's subscriptions
1029
+ *
1030
+ * @since bbPress (r5156)
1031
+ *
1032
+ * @param int $user_id Optional. User id
1033
+ * @param int $forum_id Optional. forum id
1034
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
1035
  * @uses update_user_option() To update the user's subscriptions
1036
  * @uses delete_user_option() To delete the user's subscriptions meta
1037
  * @uses do_action() Calls 'bbp_remove_user_subscription' with the user id and
1038
+ * forum id
1039
+ * @return bool True if the forum was removed from user's subscriptions,
1040
+ * otherwise false
1041
+ */
1042
+ function bbp_remove_user_forum_subscription( $user_id, $forum_id ) {
1043
+ if ( empty( $user_id ) || empty( $forum_id ) ) {
1044
+ return false;
1045
+ }
1046
+
1047
+ $subscriptions = (array) bbp_get_user_subscribed_forum_ids( $user_id );
1048
+ if ( empty( $subscriptions ) ) {
1049
+ return false;
1050
+ }
1051
+
1052
+ $pos = array_search( $forum_id, $subscriptions );
1053
+ if ( false === $pos ) {
1054
+ return false;
1055
+ }
1056
+
1057
+ array_splice( $subscriptions, $pos, 1 );
1058
+ $subscriptions = array_filter( $subscriptions );
1059
+
1060
+ if ( !empty( $subscriptions ) ) {
1061
+ $subscriptions = implode( ',', wp_parse_id_list( $subscriptions ) );
1062
+ update_user_option( $user_id, '_bbp_forum_subscriptions', $subscriptions );
1063
+ } else {
1064
+ delete_user_option( $user_id, '_bbp_forum_subscriptions' );
1065
+ }
1066
+
1067
+ wp_cache_delete( 'bbp_get_forum_subscribers_' . $forum_id, 'bbpress_users' );
1068
+
1069
+ do_action( 'bbp_remove_user_forum_subscription', $user_id, $forum_id );
1070
+
1071
+ return true;
1072
+ }
1073
+
1074
+ /**
1075
+ * Remove a topic from user's subscriptions
1076
+ *
1077
+ * @since bbPress (r5156)
1078
+ *
1079
+ * @param int $user_id Optional. User id
1080
+ * @param int $topic_id Optional. Topic id
1081
+ * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
1082
+ * @uses update_user_option() To update the user's subscriptions
1083
+ * @uses delete_user_option() To delete the user's subscriptions meta
1084
+ * @uses do_action() Calls 'bbp_remove_user_topic_subscription' with the user id and
1085
  * topic id
1086
  * @return bool True if the topic was removed from user's subscriptions,
1087
  * otherwise false
1088
  */
1089
+ function bbp_remove_user_topic_subscription( $user_id, $topic_id ) {
1090
+ if ( empty( $user_id ) || empty( $topic_id ) ) {
1091
  return false;
1092
+ }
1093
 
1094
  $subscriptions = (array) bbp_get_user_subscribed_topic_ids( $user_id );
1095
+ if ( empty( $subscriptions ) ) {
 
1096
  return false;
1097
+ }
1098
 
1099
  $pos = array_search( $topic_id, $subscriptions );
1100
+ if ( false === $pos ) {
1101
+ return false;
1102
+ }
1103
 
1104
+ array_splice( $subscriptions, $pos, 1 );
1105
+ $subscriptions = array_filter( $subscriptions );
 
 
 
 
1106
 
1107
+ if ( !empty( $subscriptions ) ) {
1108
+ $subscriptions = implode( ',', wp_parse_id_list( $subscriptions ) );
1109
+ update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
1110
+ } else {
1111
+ delete_user_option( $user_id, '_bbp_subscriptions' );
1112
  }
1113
 
1114
+ wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
1115
+
1116
+ do_action( 'bbp_remove_user_topic_subscription', $user_id, $topic_id );
1117
 
1118
  return true;
1119
  }
1120
 
1121
+ /**
1122
+ * Handles the front end subscribing and unsubscribing forums
1123
+ *
1124
+ * @since bbPress (r5156)
1125
+ *
1126
+ * @param string $action The requested action to compare this function to
1127
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
1128
+ * @uses bbp_get_user_id() To get the user id
1129
+ * @uses bbp_verify_nonce_request() To verify the nonce and check the request
1130
+ * @uses current_user_can() To check if the current user can edit the user
1131
+ * @uses bbPress:errors:add() To log the error messages
1132
+ * @uses bbp_is_user_subscribed() To check if the forum is in user's
1133
+ * subscriptions
1134
+ * @uses bbp_remove_user_subscription() To remove the user subscription
1135
+ * @uses bbp_add_user_subscription() To add the user subscription
1136
+ * @uses do_action() Calls 'bbp_subscriptions_handler' with success, user id,
1137
+ * forum id and action
1138
+ * @uses bbp_is_subscription() To check if it's the subscription page
1139
+ * @uses bbp_get_forum_permalink() To get the forum permalink
1140
+ * @uses wp_safe_redirect() To redirect to the url
1141
+ */
1142
+ function bbp_forum_subscriptions_handler( $action = '' ) {
1143
+
1144
+ if ( ! bbp_is_subscriptions_active() ) {
1145
+ return false;
1146
+ }
1147
+
1148
+ // Bail if no forum ID is passed
1149
+ if ( empty( $_GET['forum_id'] ) ) {
1150
+ return;
1151
+ }
1152
+
1153
+ // Setup possible get actions
1154
+ $possible_actions = array(
1155
+ 'bbp_subscribe',
1156
+ 'bbp_unsubscribe',
1157
+ );
1158
+
1159
+ // Bail if actions aren't meant for this function
1160
+ if ( ! in_array( $action, $possible_actions ) ) {
1161
+ return;
1162
+ }
1163
+
1164
+ // Get required data
1165
+ $user_id = bbp_get_user_id( 0, true, true );
1166
+ $forum_id = intval( $_GET['forum_id'] );
1167
+
1168
+ // Check for empty forum
1169
+ if ( empty( $forum_id ) ) {
1170
+ bbp_add_error( 'bbp_subscription_forum_id', __( '<strong>ERROR</strong>: No forum was found! Which forum are you subscribing/unsubscribing to?', 'bbpress' ) );
1171
+
1172
+ // Check nonce
1173
+ } elseif ( ! bbp_verify_nonce_request( 'toggle-subscription_' . $forum_id ) ) {
1174
+ bbp_add_error( 'bbp_subscription_forum_id', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
1175
+
1176
+ // Check current user's ability to edit the user
1177
+ } elseif ( !current_user_can( 'edit_user', $user_id ) ) {
1178
+ bbp_add_error( 'bbp_subscription_permissions', __( '<strong>ERROR</strong>: You don\'t have the permission to edit favorites of that user!', 'bbpress' ) );
1179
+ }
1180
+
1181
+ // Bail if we have errors
1182
+ if ( bbp_has_errors() ) {
1183
+ return;
1184
+ }
1185
+
1186
+ /** No errors *************************************************************/
1187
+
1188
+ $is_subscription = bbp_is_user_subscribed( $user_id, $forum_id );
1189
+ $success = false;
1190
+
1191
+ if ( true === $is_subscription && 'bbp_unsubscribe' === $action ) {
1192
+ $success = bbp_remove_user_subscription( $user_id, $forum_id );
1193
+ } elseif ( false === $is_subscription && 'bbp_subscribe' === $action ) {
1194
+ $success = bbp_add_user_subscription( $user_id, $forum_id );
1195
+ }
1196
+
1197
+ // Do additional subscriptions actions
1198
+ do_action( 'bbp_subscriptions_handler', $success, $user_id, $forum_id, $action );
1199
+
1200
+ // Success!
1201
+ if ( true === $success ) {
1202
+
1203
+ // Redirect back from whence we came
1204
+ if ( bbp_is_subscriptions() ) {
1205
+ $redirect = bbp_get_subscriptions_permalink( $user_id );
1206
+ } elseif ( bbp_is_single_user() ) {
1207
+ $redirect = bbp_get_user_profile_url();
1208
+ } elseif ( is_singular( bbp_get_forum_post_type() ) ) {
1209
+ $redirect = bbp_get_forum_permalink( $forum_id );
1210
+ } elseif ( is_single() || is_page() ) {
1211
+ $redirect = get_permalink();
1212
+ } else {
1213
+ $redirect = get_permalink( $forum_id );
1214
+ }
1215
+
1216
+ wp_safe_redirect( $redirect );
1217
+
1218
+ // For good measure
1219
+ exit();
1220
+
1221
+ // Fail! Handle errors
1222
+ } elseif ( true === $is_subscription && 'bbp_unsubscribe' === $action ) {
1223
+ bbp_add_error( 'bbp_unsubscribe', __( '<strong>ERROR</strong>: There was a problem unsubscribing from that forum!', 'bbpress' ) );
1224
+ } elseif ( false === $is_subscription && 'bbp_subscribe' === $action ) {
1225
+ bbp_add_error( 'bbp_subscribe', __( '<strong>ERROR</strong>: There was a problem subscribing to that forum!', 'bbpress' ) );
1226
+ }
1227
+ }
1228
+
1229
  /**
1230
  * Handles the front end subscribing and unsubscribing topics
1231
  *
1242
  * @uses do_action() Calls 'bbp_subscriptions_handler' with success, user id,
1243
  * topic id and action
1244
  * @uses bbp_is_subscription() To check if it's the subscription page
 
1245
  * @uses bbp_get_topic_permalink() To get the topic permalink
1246
  * @uses wp_safe_redirect() To redirect to the url
1247
  */
1248
  function bbp_subscriptions_handler( $action = '' ) {
1249
 
1250
+ if ( !bbp_is_subscriptions_active() ) {
1251
  return false;
1252
+ }
1253
 
1254
  // Bail if no topic ID is passed
1255
+ if ( empty( $_GET['topic_id'] ) ) {
1256
  return;
1257
+ }
1258
 
1259
  // Setup possible get actions
1260
  $possible_actions = array(
1263
  );
1264
 
1265
  // Bail if actions aren't meant for this function
1266
+ if ( !in_array( $action, $possible_actions ) ) {
1267
  return;
1268
+ }
1269
 
1270
  // Get required data
1271
  $user_id = bbp_get_user_id( 0, true, true );
1285
  }
1286
 
1287
  // Bail if we have errors
1288
+ if ( bbp_has_errors() ) {
1289
  return;
1290
+ }
1291
 
1292
  /** No errors *************************************************************/
1293
 
1294
  $is_subscription = bbp_is_user_subscribed( $user_id, $topic_id );
1295
  $success = false;
1296
 
1297
+ if ( true === $is_subscription && 'bbp_unsubscribe' === $action ) {
1298
  $success = bbp_remove_user_subscription( $user_id, $topic_id );
1299
+ } elseif ( false === $is_subscription && 'bbp_subscribe' === $action ) {
1300
  $success = bbp_add_user_subscription( $user_id, $topic_id );
1301
+ }
1302
 
1303
  // Do additional subscriptions actions
1304
  do_action( 'bbp_subscriptions_handler', $success, $user_id, $topic_id, $action );
1478
  * @return array|bool Results if the user has created topics, otherwise false
1479
  */
1480
  function bbp_get_user_topics_started( $user_id = 0 ) {
1481
+
1482
  // Validate user
1483
  $user_id = bbp_get_user_id( $user_id );
1484
  if ( empty( $user_id ) )
1503
  * @return array|bool Results if the user has created topics, otherwise false
1504
  */
1505
  function bbp_get_user_replies_created( $user_id = 0 ) {
1506
+
1507
  // Validate user
1508
  $user_id = bbp_get_user_id( $user_id );
1509
  if ( empty( $user_id ) )
1541
  * which a user can edit another user (or themselves.) If these conditions are
1542
  * met. We assume a user cannot perform this task, and look for ways they can
1543
  * earn the ability to access this template.
1544
+ *
1545
  * @since bbPress (r3605)
1546
  *
1547
  * @uses bbp_is_topic_edit()
includes/users/template.php CHANGED
@@ -611,6 +611,176 @@ function bbp_author_ip( $args = '' ) {
611
  return apply_filters( 'bbp_get_author_ip', $author_ip, $r );
612
  }
613
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
  /** Favorites *****************************************************************/
615
 
616
  /**
@@ -715,8 +885,9 @@ function bbp_user_favorites_link( $args = array(), $user_id = 0, $wrap = true )
715
  * @return string User favorites link
716
  */
717
  function bbp_get_user_favorites_link( $args = '', $user_id = 0, $wrap = true ) {
718
- if ( !bbp_is_favorites_active() )
719
  return false;
 
720
 
721
  // Parse arguments against default values
722
  $r = bbp_parse_args( $args, array(
@@ -736,13 +907,13 @@ function bbp_user_favorites_link( $args = array(), $user_id = 0, $wrap = true )
736
  }
737
 
738
  // No link if you can't edit yourself
739
- if ( !current_user_can( 'edit_user', (int) $user_id ) ) {
740
  return false;
741
  }
742
 
743
  // Decide which link to show
744
  $is_fav = bbp_is_user_favorite( $user_id, $topic_id );
745
- if ( !empty( $is_fav ) ) {
746
  $text = $r['favorited'];
747
  $query_args = array( 'action' => 'bbp_favorite_remove', 'topic_id' => $topic_id );
748
  } else {
@@ -765,7 +936,7 @@ function bbp_user_favorites_link( $args = array(), $user_id = 0, $wrap = true )
765
  $html = sprintf( '%s<span id="favorite-%d" %s><a href="%s" class="favorite-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
766
 
767
  // Initial output is wrapped in a span, ajax output is hooked to this
768
- if ( !empty( $wrap ) ) {
769
  $html = '<span id="favorite-toggle">' . $html . '</span>';
770
  }
771
 
@@ -848,7 +1019,7 @@ function bbp_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
848
  echo bbp_get_user_subscribe_link( $args, $user_id, $wrap );
849
  }
850
  /**
851
- * Return the link to subscribe/unsubscribe from a topic
852
  *
853
  * @since bbPress (r2668)
854
  *
@@ -857,14 +1028,19 @@ function bbp_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
857
  * - unsubscribe: Unsubscribe text
858
  * - user_id: User id
859
  * - topic_id: Topic id
 
860
  * - before: Before the link
861
  * - after: After the link
862
  * @param int $user_id Optional. User id
863
  * @param bool $wrap Optional. If you want to wrap the link in <span id="subscription-toggle">.
 
 
864
  * @uses bbp_get_user_id() To get the user id
865
- * @uses current_user_can() To check if the current user can edit user
866
  * @uses bbp_get_topic_id() To get the topic id
867
- * @uses bbp_is_user_subscribed() To check if the user is subscribed
 
 
 
868
  * @uses bbp_is_subscriptions() To check if it's the subscriptions page
869
  * @uses bbp_get_subscriptions_permalink() To get subscriptions link
870
  * @uses bbp_get_topic_permalink() To get topic link
@@ -873,8 +1049,9 @@ function bbp_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
873
  * @return string Permanent link to topic
874
  */
875
  function bbp_get_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
876
- if ( !bbp_is_subscriptions_active() )
877
  return;
 
878
 
879
  // Parse arguments against default values
880
  $r = bbp_parse_args( $args, array(
@@ -882,49 +1059,86 @@ function bbp_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
882
  'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
883
  'user_id' => 0,
884
  'topic_id' => 0,
 
885
  'before' => '&nbsp;|&nbsp;',
886
  'after' => ''
887
  ), 'get_user_subscribe_link' );
888
 
889
- // Validate user and topic ID's
890
  $user_id = bbp_get_user_id( $r['user_id'], true, true );
891
  $topic_id = bbp_get_topic_id( $r['topic_id'] );
892
- if ( empty( $user_id ) || empty( $topic_id ) ) {
 
893
  return false;
894
  }
895
 
896
  // No link if you can't edit yourself
897
- if ( !current_user_can( 'edit_user', (int) $user_id ) ) {
898
  return false;
899
  }
900
 
901
- // Decide which link to show
902
- $is_subscribed = bbp_is_user_subscribed( $user_id, $topic_id );
903
- if ( !empty( $is_subscribed ) ) {
904
- $text = $r['unsubscribe'];
905
- $query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
906
- } else {
907
- $text = $r['subscribe'];
908
- $query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
909
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
910
 
911
- // Create the link based where the user is and if the user is
912
- // subscribed already
913
- if ( bbp_is_subscriptions() ) {
914
- $permalink = bbp_get_subscriptions_permalink( $user_id );
915
- } elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
916
- $permalink = bbp_get_topic_permalink( $topic_id );
917
  } else {
918
- $permalink = get_permalink();
919
- }
920
 
921
- $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) );
922
- $sub = $is_subscribed ? ' class="is-subscribed"' : '';
923
- $html = sprintf( '%s<span id="subscribe-%d" %s><a href="%s" class="subscription-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
 
 
 
 
 
 
924
 
925
- // Initial output is wrapped in a span, ajax output is hooked to this
926
- if ( !empty( $wrap ) ) {
927
- $html = '<span id="subscription-toggle">' . $html . '</span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
928
  }
929
 
930
  // Return the link
@@ -1439,7 +1653,6 @@ function bbp_author_link( $args = '' ) {
1439
 
1440
  // Assemble some link bits
1441
  $link_title = !empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : '';
1442
- $author_url = bbp_get_user_profile_url( $user_id );
1443
  $anonymous = bbp_is_reply_anonymous( $r['post_id'] );
1444
 
1445
  // Get avatar
@@ -1454,6 +1667,7 @@ function bbp_author_link( $args = '' ) {
1454
 
1455
  // Add links if not anonymous
1456
  if ( empty( $anonymous ) && bbp_user_has_profile( $user_id ) ) {
 
1457
  foreach ( $author_links as $link_text ) {
1458
  $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', $author_url, $link_title, $link_text );
1459
  }
@@ -1509,7 +1723,7 @@ function bbp_user_can_view_forum( $args = '' ) {
1509
  $retval = false;
1510
 
1511
  // User is a keymaster
1512
- if ( bbp_is_user_keymaster( $user_id ) ) {
1513
  $retval = true;
1514
 
1515
  // Forum is public, and user can read forums or is not logged in
@@ -1792,3 +2006,39 @@ function bbp_current_user_can_access_create_reply_form() {
1792
  // Allow access to be filtered
1793
  return (bool) apply_filters( 'bbp_current_user_can_access_create_reply_form', (bool) $retval );
1794
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
611
  return apply_filters( 'bbp_get_author_ip', $author_ip, $r );
612
  }
613
 
614
+ /** Anonymous Fields **********************************************************/
615
+
616
+ /**
617
+ * Output the author disylay-name of a topic or reply.
618
+ *
619
+ * Convenience function to ensure proper template functions are called
620
+ * and correct filters are executed. Used primarily to display topic
621
+ * and reply author information in the anonymous form template-part.
622
+ *
623
+ * @since bbPress (r5119)
624
+ *
625
+ * @param int $post_id
626
+ * @uses bbp_get_author_display_name() to get the author name
627
+ */
628
+ function bbp_author_display_name( $post_id = 0 ) {
629
+ echo bbp_get_author_display_name( $post_id );
630
+ }
631
+
632
+ /**
633
+ * Return the author name of a topic or reply.
634
+ *
635
+ * Convenience function to ensure proper template functions are called
636
+ * and correct filters are executed. Used primarily to display topic
637
+ * and reply author information in the anonymous form template-part.
638
+ *
639
+ * @since bbPress (r5119)
640
+ *
641
+ * @param int $post_id
642
+ *
643
+ * @uses bbp_is_topic_edit()
644
+ * @uses bbp_get_topic_author_display_name()
645
+ * @uses bbp_is_reply_edit()
646
+ * @uses bbp_get_reply_author_display_name()
647
+ * @uses bbp_current_anonymous_user_data()
648
+ *
649
+ * @return string The name of the author
650
+ */
651
+ function bbp_get_author_display_name( $post_id = 0 ) {
652
+
653
+ // Define local variable(s)
654
+ $retval = '';
655
+
656
+ // Topic edit
657
+ if ( bbp_is_topic_edit() ) {
658
+ $retval = bbp_get_topic_author_display_name( $post_id );
659
+
660
+ // Reply edit
661
+ } elseif ( bbp_is_reply_edit() ) {
662
+ $retval = bbp_get_reply_author_display_name( $post_id );
663
+
664
+ // Not an edit, so rely on current user cookie data
665
+ } else {
666
+ $retval = bbp_current_anonymous_user_data( 'name' );
667
+ }
668
+
669
+ return apply_filters( 'bbp_get_author_display_name', $retval, $post_id );
670
+ }
671
+
672
+ /**
673
+ * Output the author email of a topic or reply.
674
+ *
675
+ * Convenience function to ensure proper template functions are called
676
+ * and correct filters are executed. Used primarily to display topic
677
+ * and reply author information in the anonymous user form template-part.
678
+ *
679
+ * @since bbPress (r5119)
680
+ *
681
+ * @param int $post_id
682
+ * @uses bbp_get_author_email() to get the author email
683
+ */
684
+ function bbp_author_email( $post_id = 0 ) {
685
+ echo bbp_get_author_email( $post_id );
686
+ }
687
+
688
+ /**
689
+ * Return the author email of a topic or reply.
690
+ *
691
+ * Convenience function to ensure proper template functions are called
692
+ * and correct filters are executed. Used primarily to display topic
693
+ * and reply author information in the anonymous user form template-part.
694
+ *
695
+ * @since bbPress (r5119)
696
+ *
697
+ * @param int $post_id
698
+ *
699
+ * @uses bbp_is_topic_edit()
700
+ * @uses bbp_get_topic_author_email()
701
+ * @uses bbp_is_reply_edit()
702
+ * @uses bbp_get_reply_author_email()
703
+ * @uses bbp_current_anonymous_user_data()
704
+ *
705
+ * @return string The email of the author
706
+ */
707
+ function bbp_get_author_email( $post_id = 0 ) {
708
+
709
+ // Define local variable(s)
710
+ $retval = '';
711
+
712
+ // Topic edit
713
+ if ( bbp_is_topic_edit() ) {
714
+ $retval = bbp_get_topic_author_email( $post_id );
715
+
716
+ // Reply edit
717
+ } elseif ( bbp_is_reply_edit() ) {
718
+ $retval = bbp_get_reply_author_email( $post_id );
719
+
720
+ // Not an edit, so rely on current user cookie data
721
+ } else {
722
+ $retval = bbp_current_anonymous_user_data( 'email' );
723
+ }
724
+
725
+ return apply_filters( 'bbp_get_author_email', $retval, $post_id );
726
+ }
727
+
728
+ /**
729
+ * Output the author url of a topic or reply.
730
+ *
731
+ * Convenience function to ensure proper template functions are called
732
+ * and correct filters are executed. Used primarily to display topic
733
+ * and reply author information in the anonymous user form template-part.
734
+ *
735
+ * @since bbPress (r5119)
736
+ *
737
+ * @param int $post_id
738
+ * @uses bbp_get_author_url() to get the author url
739
+ */
740
+ function bbp_author_url( $post_id = 0 ) {
741
+ echo bbp_get_author_url( $post_id );
742
+ }
743
+
744
+ /**
745
+ * Return the author url of a topic or reply.
746
+ *
747
+ * Convenience function to ensure proper template functions are called
748
+ * and correct filters are executed. Used primarily to display topic
749
+ * and reply author information in the anonymous user form template-part.
750
+ *
751
+ * @since bbPress (r5119)
752
+ *
753
+ * @param int $post_id
754
+ *
755
+ * @uses bbp_is_topic_edit()
756
+ * @uses bbp_get_topic_author_url()
757
+ * @uses bbp_is_reply_edit()
758
+ * @uses bbp_get_reply_author_url()
759
+ * @uses bbp_current_anonymous_user_data()
760
+ *
761
+ * @return string The url of the author
762
+ */
763
+ function bbp_get_author_url( $post_id = 0 ) {
764
+
765
+ // Define local variable(s)
766
+ $retval = '';
767
+
768
+ // Topic edit
769
+ if ( bbp_is_topic_edit() ) {
770
+ $retval = bbp_get_topic_author_url( $post_id );
771
+
772
+ // Reply edit
773
+ } elseif ( bbp_is_reply_edit() ) {
774
+ $retval = bbp_get_reply_author_url( $post_id );
775
+
776
+ // Not an edit, so rely on current user cookie data
777
+ } else {
778
+ $retval = bbp_current_anonymous_user_data( 'url' );
779
+ }
780
+
781
+ return apply_filters( 'bbp_get_author_url', $retval, $post_id );
782
+ }
783
+
784
  /** Favorites *****************************************************************/
785
 
786
  /**
885
  * @return string User favorites link
886
  */
887
  function bbp_get_user_favorites_link( $args = '', $user_id = 0, $wrap = true ) {
888
+ if ( ! bbp_is_favorites_active() ) {
889
  return false;
890
+ }
891
 
892
  // Parse arguments against default values
893
  $r = bbp_parse_args( $args, array(
907
  }
908
 
909
  // No link if you can't edit yourself
910
+ if ( ! current_user_can( 'edit_user', (int) $user_id ) ) {
911
  return false;
912
  }
913
 
914
  // Decide which link to show
915
  $is_fav = bbp_is_user_favorite( $user_id, $topic_id );
916
+ if ( ! empty( $is_fav ) ) {
917
  $text = $r['favorited'];
918
  $query_args = array( 'action' => 'bbp_favorite_remove', 'topic_id' => $topic_id );
919
  } else {
936
  $html = sprintf( '%s<span id="favorite-%d" %s><a href="%s" class="favorite-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
937
 
938
  // Initial output is wrapped in a span, ajax output is hooked to this
939
+ if ( ! empty( $wrap ) ) {
940
  $html = '<span id="favorite-toggle">' . $html . '</span>';
941
  }
942
 
1019
  echo bbp_get_user_subscribe_link( $args, $user_id, $wrap );
1020
  }
1021
  /**
1022
+ * Return the link to subscribe/unsubscribe from a forum or topic
1023
  *
1024
  * @since bbPress (r2668)
1025
  *
1028
  * - unsubscribe: Unsubscribe text
1029
  * - user_id: User id
1030
  * - topic_id: Topic id
1031
+ * - forum_id: Forum id
1032
  * - before: Before the link
1033
  * - after: After the link
1034
  * @param int $user_id Optional. User id
1035
  * @param bool $wrap Optional. If you want to wrap the link in <span id="subscription-toggle">.
1036
+ * @uses bbp_is_subscriptions_active() to check if subscriptions are active
1037
+ * @uses bbp_get_user_id() To get the user id
1038
  * @uses bbp_get_user_id() To get the user id
 
1039
  * @uses bbp_get_topic_id() To get the topic id
1040
+ * @uses bbp_get_forum_id() To get the forum id
1041
+ * @uses current_user_can() To check if the current user can edit user
1042
+ * @uses bbp_is_user_subscribed_to_forum() To check if the user is subscribed to the forum
1043
+ * @uses bbp_is_user_subscribed_to_topic() To check if the user is subscribed to the topic
1044
  * @uses bbp_is_subscriptions() To check if it's the subscriptions page
1045
  * @uses bbp_get_subscriptions_permalink() To get subscriptions link
1046
  * @uses bbp_get_topic_permalink() To get topic link
1049
  * @return string Permanent link to topic
1050
  */
1051
  function bbp_get_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
1052
+ if ( ! bbp_is_subscriptions_active() ) {
1053
  return;
1054
+ }
1055
 
1056
  // Parse arguments against default values
1057
  $r = bbp_parse_args( $args, array(
1059
  'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
1060
  'user_id' => 0,
1061
  'topic_id' => 0,
1062
+ 'forum_id' => 0,
1063
  'before' => '&nbsp;|&nbsp;',
1064
  'after' => ''
1065
  ), 'get_user_subscribe_link' );
1066
 
1067
+ // Validate user and object ID's
1068
  $user_id = bbp_get_user_id( $r['user_id'], true, true );
1069
  $topic_id = bbp_get_topic_id( $r['topic_id'] );
1070
+ $forum_id = bbp_get_forum_id( $r['forum_id'] );
1071
+ if ( empty( $user_id ) || ( empty( $topic_id ) && empty( $forum_id ) ) ) {
1072
  return false;
1073
  }
1074
 
1075
  // No link if you can't edit yourself
1076
+ if ( ! current_user_can( 'edit_user', (int) $user_id ) ) {
1077
  return false;
1078
  }
1079
 
1080
+ // Check if viewing a single forum
1081
+ if ( empty( $topic_id ) && ! empty( $forum_id ) ) {
1082
+
1083
+ // Decide which link to show
1084
+ $is_subscribed = bbp_is_user_subscribed_to_forum( $user_id, $forum_id );
1085
+ if ( ! empty( $is_subscribed ) ) {
1086
+ $text = $r['unsubscribe'];
1087
+ $query_args = array( 'action' => 'bbp_unsubscribe', 'forum_id' => $forum_id );
1088
+ } else {
1089
+ $text = $r['subscribe'];
1090
+ $query_args = array( 'action' => 'bbp_subscribe', 'forum_id' => $forum_id );
1091
+ }
1092
+
1093
+ // Create the link based where the user is and if the user is
1094
+ // subscribed already
1095
+ if ( bbp_is_subscriptions() ) {
1096
+ $permalink = bbp_get_subscriptions_permalink( $user_id );
1097
+ } elseif ( bbp_is_single_forum() || bbp_is_single_reply() ) {
1098
+ $permalink = bbp_get_forum_permalink( $forum_id );
1099
+ } else {
1100
+ $permalink = get_permalink();
1101
+ }
1102
+
1103
+ $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $forum_id ) );
1104
+ $sub = $is_subscribed ? ' class="is-subscribed"' : '';
1105
+ $html = sprintf( '%s<span id="subscribe-%d" %s><a href="%s" class="subscription-toggle" data-forum="%d">%s</a></span>%s', $r['before'], $forum_id, $sub, $url, $forum_id, $text, $r['after'] );
1106
+
1107
+ // Initial output is wrapped in a span, ajax output is hooked to this
1108
+ if ( !empty( $wrap ) ) {
1109
+ $html = '<span id="subscription-toggle">' . $html . '</span>';
1110
+ }
1111
 
 
 
 
 
 
 
1112
  } else {
 
 
1113
 
1114
+ // Decide which link to show
1115
+ $is_subscribed = bbp_is_user_subscribed_to_topic( $user_id, $topic_id );
1116
+ if ( ! empty( $is_subscribed ) ) {
1117
+ $text = $r['unsubscribe'];
1118
+ $query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
1119
+ } else {
1120
+ $text = $r['subscribe'];
1121
+ $query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
1122
+ }
1123
 
1124
+ // Create the link based where the user is and if the user is
1125
+ // subscribed already
1126
+ if ( bbp_is_subscriptions() ) {
1127
+ $permalink = bbp_get_subscriptions_permalink( $user_id );
1128
+ } elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
1129
+ $permalink = bbp_get_topic_permalink( $topic_id );
1130
+ } else {
1131
+ $permalink = get_permalink();
1132
+ }
1133
+
1134
+ $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) );
1135
+ $sub = $is_subscribed ? ' class="is-subscribed"' : '';
1136
+ $html = sprintf( '%s<span id="subscribe-%d" %s><a href="%s" class="subscription-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
1137
+
1138
+ // Initial output is wrapped in a span, ajax output is hooked to this
1139
+ if ( !empty( $wrap ) ) {
1140
+ $html = '<span id="subscription-toggle">' . $html . '</span>';
1141
+ }
1142
  }
1143
 
1144
  // Return the link
1653
 
1654
  // Assemble some link bits
1655
  $link_title = !empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : '';
 
1656
  $anonymous = bbp_is_reply_anonymous( $r['post_id'] );
1657
 
1658
  // Get avatar
1667
 
1668
  // Add links if not anonymous
1669
  if ( empty( $anonymous ) && bbp_user_has_profile( $user_id ) ) {
1670
+ $author_url = bbp_get_user_profile_url( $user_id );
1671
  foreach ( $author_links as $link_text ) {
1672
  $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', $author_url, $link_title, $link_text );
1673
  }
1723
  $retval = false;
1724
 
1725
  // User is a keymaster
1726
+ if ( !empty( $user_id ) && bbp_is_user_keymaster( $user_id ) ) {
1727
  $retval = true;
1728
 
1729
  // Forum is public, and user can read forums or is not logged in
2006
  // Allow access to be filtered
2007
  return (bool) apply_filters( 'bbp_current_user_can_access_create_reply_form', (bool) $retval );
2008
  }
2009
+
2010
+ /**
2011
+ * Performs a series of checks to ensure the current user should see the
2012
+ * anonymous user form fields.
2013
+ *
2014
+ * @since bbPress (r5119)
2015
+ *
2016
+ * @uses bbp_is_anonymous()
2017
+ * @uses bbp_is_topic_edit()
2018
+ * @uses bbp_is_topic_anonymous()
2019
+ * @uses bbp_is_reply_edit()
2020
+ * @uses bbp_is_reply_anonymous()
2021
+ *
2022
+ * @return bool
2023
+ */
2024
+ function bbp_current_user_can_access_anonymous_user_form() {
2025
+
2026
+ // Users need to earn access
2027
+ $retval = false;
2028
+
2029
+ // User is not logged in, and anonymous posting is allowed
2030
+ if ( bbp_is_anonymous() ) {
2031
+ $retval = true;
2032
+
2033
+ // User is editing a topic, and topic is authored by anonymous user
2034
+ } elseif ( bbp_is_topic_edit() && bbp_is_topic_anonymous() ) {
2035
+ $retval = true;
2036
+
2037
+ // User is editing a reply, and reply is authored by anonymous user
2038
+ } elseif ( bbp_is_reply_edit() && bbp_is_reply_anonymous() ) {
2039
+ $retval = true;
2040
+ }
2041
+
2042
+ // Allow access to be filtered
2043
+ return (bool) apply_filters( 'bbp_current_user_can_access_anonymous_user_form', (bool) $retval );
2044
+ }
languages/bbpress.pot CHANGED
@@ -2,539 +2,328 @@
2
  # This file is distributed under the same license as the bbPress package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: bbPress 2.4\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/bbpress\n"
7
- "POT-Creation-Date: 2013-09-02 17:40:01+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: JOHN JAMES JACOBY <jjj@bbpress.org>\n"
13
- "Language-Team: ENGLISH <jjj@bbpress.org>\n"
14
 
15
  #: bbpress.php:133 bbpress.php:140
16
  msgid "Cheatin&#8217; huh?"
17
  msgstr ""
18
 
19
- #: bbpress.php:403 templates/default/bbpress-functions.php:68
20
  msgid "bbPress Default"
21
  msgstr ""
22
 
23
- #: bbpress.php:478 bbpress.php:479 includes/admin/admin.php:221
24
- #: includes/admin/admin.php:222 includes/admin/admin.php:232
25
- #: includes/admin/admin.php:233 includes/admin/users.php:82
26
- #: includes/common/widgets.php:662 includes/extend/buddypress/loader.php:42
27
- #: includes/extend/buddypress/loader.php:170
28
- #: includes/extend/buddypress/loader.php:256
29
- #: includes/extend/buddypress/loader.php:307
30
- #: templates/default/bbpress/content-statistics.php:22
31
- msgid "Forums"
32
- msgstr ""
33
-
34
- #: bbpress.php:480 includes/admin/forums.php:409
35
- #: includes/admin/metaboxes.php:50 includes/admin/metaboxes.php:379
36
- #: includes/admin/metaboxes.php:432 includes/admin/replies.php:570
37
- #: includes/admin/settings.php:293 includes/admin/topics.php:633
38
- #: includes/extend/buddypress/groups.php:52
39
- #: includes/extend/buddypress/groups.php:53
40
- #: templates/default/bbpress/loop-forums.php:19
41
- msgid "Forum"
42
- msgstr ""
43
-
44
- #: bbpress.php:481 includes/admin/tools.php:1079
45
- msgid "All Forums"
46
- msgstr ""
47
-
48
- #: bbpress.php:482 bbpress.php:486
49
- msgid "New Forum"
50
- msgstr ""
51
-
52
- #: bbpress.php:483 templates/default/bbpress/form-forum.php:37
53
- msgid "Create New Forum"
54
- msgstr ""
55
-
56
- #: bbpress.php:484 bbpress.php:541 bbpress.php:598
57
- #: includes/common/template.php:2183 includes/replies/template.php:1819
58
- #: includes/topics/template.php:2340
59
- #: templates/default/bbpress/user-details.php:65
60
- msgid "Edit"
61
- msgstr ""
62
-
63
- #: bbpress.php:485
64
- msgid "Edit Forum"
65
- msgstr ""
66
-
67
- #: bbpress.php:487 bbpress.php:488
68
- msgid "View Forum"
69
- msgstr ""
70
-
71
- #: bbpress.php:489 includes/common/widgets.php:483
72
- msgid "Search Forums"
73
- msgstr ""
74
-
75
- #: bbpress.php:490
76
- msgid "No forums found"
77
- msgstr ""
78
-
79
- #: bbpress.php:491
80
- msgid "No forums found in Trash"
81
- msgstr ""
82
-
83
- #: bbpress.php:492 templates/default/bbpress/form-forum.php:118
84
- msgid "Parent Forum:"
85
- msgstr ""
86
-
87
- #: bbpress.php:515
88
  msgid "bbPress Forums"
89
  msgstr ""
90
 
91
- #: bbpress.php:535 bbpress.php:536 includes/admin/forums.php:410
92
- #: includes/admin/settings.php:222 includes/admin/settings.php:243
93
- #: includes/admin/topics.php:632 includes/extend/buddypress/activity.php:354
94
- #: includes/forums/template.php:2424
95
- #: templates/default/bbpress/content-statistics.php:27
96
- #: templates/default/bbpress/loop-forums.php:20
97
- msgid "Topics"
98
- msgstr ""
99
-
100
- #: bbpress.php:537 includes/admin/metaboxes.php:67
101
- #: includes/admin/metaboxes.php:457 includes/admin/replies.php:571
102
- #: includes/admin/settings.php:301
103
- #: templates/default/bbpress/content-single-topic-lead.php:22
104
- #: templates/default/bbpress/content-single-topic-lead.php:94
105
- #: templates/default/bbpress/loop-topics.php:19
106
- msgid "Topic"
107
- msgstr ""
108
-
109
- #: bbpress.php:538 includes/admin/tools.php:1080
110
- #: includes/topics/functions.php:3438
111
- msgid "All Topics"
112
- msgstr ""
113
-
114
- #: bbpress.php:539 bbpress.php:543
115
- msgid "New Topic"
116
- msgstr ""
117
-
118
- #: bbpress.php:540 templates/default/bbpress/form-topic.php:43
119
- msgid "Create New Topic"
120
- msgstr ""
121
-
122
- #: bbpress.php:542
123
- msgid "Edit Topic"
124
- msgstr ""
125
-
126
- #: bbpress.php:544 bbpress.php:545
127
- msgid "View Topic"
128
- msgstr ""
129
-
130
- #: bbpress.php:546
131
- msgid "Search Topics"
132
- msgstr ""
133
-
134
- #: bbpress.php:547
135
- msgid "No topics found"
136
- msgstr ""
137
-
138
- #: bbpress.php:548
139
- msgid "No topics found in Trash"
140
- msgstr ""
141
-
142
- #: bbpress.php:549 includes/admin/metaboxes.php:378
143
- #: includes/admin/metaboxes.php:431 includes/extend/buddypress/groups.php:1038
144
- #: templates/default/bbpress/form-topic.php:114
145
- msgid "Forum:"
146
- msgstr ""
147
-
148
- #: bbpress.php:572
149
  msgid "bbPress Topics"
150
  msgstr ""
151
 
152
- #: bbpress.php:592 bbpress.php:593 includes/admin/forums.php:411
153
- #: includes/admin/settings.php:230 includes/admin/settings.php:251
154
- #: includes/admin/topics.php:634 includes/core/theme-compat.php:636
155
- #: includes/extend/buddypress/activity.php:355
156
- #: includes/forums/template.php:2488
157
- #: templates/default/bbpress/content-statistics.php:32
158
- #: templates/default/bbpress/loop-forums.php:21
159
- #: templates/default/bbpress/loop-replies.php:32
160
- #: templates/default/bbpress/loop-replies.php:70
161
- #: templates/default/bbpress/loop-topics.php:21
162
- msgid "Replies"
163
- msgstr ""
164
-
165
- #: bbpress.php:594 includes/admin/metaboxes.php:84
166
- #: includes/admin/settings.php:325 includes/replies/template.php:1530
167
- #: includes/topics/template.php:2770
168
- msgid "Reply"
169
- msgstr ""
170
-
171
- #: bbpress.php:595 includes/admin/tools.php:1081
172
- #: includes/replies/functions.php:1998
173
- msgid "All Replies"
174
- msgstr ""
175
-
176
- #: bbpress.php:596 bbpress.php:600
177
- msgid "New Reply"
178
- msgstr ""
179
-
180
- #: bbpress.php:597
181
- msgid "Create New Reply"
182
- msgstr ""
183
-
184
- #: bbpress.php:599
185
- msgid "Edit Reply"
186
- msgstr ""
187
-
188
- #: bbpress.php:601 bbpress.php:602
189
- msgid "View Reply"
190
- msgstr ""
191
-
192
- #: bbpress.php:603
193
- msgid "Search Replies"
194
- msgstr ""
195
-
196
- #: bbpress.php:604
197
- msgid "No replies found"
198
- msgstr ""
199
-
200
- #: bbpress.php:605
201
- msgid "No replies found in Trash"
202
- msgstr ""
203
-
204
- #: bbpress.php:606 includes/admin/metaboxes.php:456
205
- msgid "Topic:"
206
- msgstr ""
207
-
208
- #: bbpress.php:629
209
  msgid "bbPress Replies"
210
  msgstr ""
211
 
212
- #: bbpress.php:664
213
  msgctxt "post"
214
  msgid "Closed"
215
  msgstr ""
216
 
217
- #: bbpress.php:665
218
  msgctxt "post"
219
  msgid "Closed <span class=\"count\">(%s)</span>"
220
  msgid_plural "Closed <span class=\"count\">(%s)</span>"
221
  msgstr[0] ""
222
  msgstr[1] ""
223
 
224
- #: bbpress.php:675
225
  msgctxt "post"
226
  msgid "Spam"
227
  msgstr ""
228
 
229
- #: bbpress.php:676
230
  msgctxt "post"
231
  msgid "Spam <span class=\"count\">(%s)</span>"
232
  msgid_plural "Spam <span class=\"count\">(%s)</span>"
233
  msgstr[0] ""
234
  msgstr[1] ""
235
 
236
- #: bbpress.php:688
237
  msgctxt "post"
238
  msgid "Orphan"
239
  msgstr ""
240
 
241
- #: bbpress.php:689
242
  msgctxt "post"
243
  msgid "Orphan <span class=\"count\">(%s)</span>"
244
  msgid_plural "Orphans <span class=\"count\">(%s)</span>"
245
  msgstr[0] ""
246
  msgstr[1] ""
247
 
248
- #: bbpress.php:701
249
  msgctxt "post"
250
  msgid "Hidden"
251
  msgstr ""
252
 
253
- #: bbpress.php:702
254
  msgctxt "post"
255
  msgid "Hidden <span class=\"count\">(%s)</span>"
256
  msgid_plural "Hidden <span class=\"count\">(%s)</span>"
257
  msgstr[0] ""
258
  msgstr[1] ""
259
 
260
- #: bbpress.php:747 templates/default/bbpress/content-statistics.php:37
261
- msgid "Topic Tags"
262
- msgstr ""
263
-
264
- #: bbpress.php:748 includes/admin/metaboxes.php:103
265
- #: includes/admin/settings.php:309
266
- msgid "Topic Tag"
267
- msgstr ""
268
-
269
- #: bbpress.php:749
270
- msgid "Search Tags"
271
- msgstr ""
272
-
273
- #: bbpress.php:750
274
- msgid "Popular Tags"
275
- msgstr ""
276
-
277
- #: bbpress.php:751
278
- msgid "All Tags"
279
- msgstr ""
280
-
281
- #: bbpress.php:752
282
- msgid "Edit Tag"
283
- msgstr ""
284
-
285
- #: bbpress.php:753
286
- msgid "Update Tag"
287
- msgstr ""
288
-
289
- #: bbpress.php:754
290
- msgid "Add New Tag"
291
- msgstr ""
292
-
293
- #: bbpress.php:755
294
- msgid "New Tag Name"
295
- msgstr ""
296
-
297
- #: bbpress.php:756
298
- msgid "View Topic Tag"
299
- msgstr ""
300
-
301
- #: bbpress.php:795
302
  msgid "Most popular topics"
303
  msgstr ""
304
 
305
- #: bbpress.php:807
306
  msgid "Topics with no replies"
307
  msgstr ""
308
 
309
- #: includes/admin/admin.php:186 includes/admin/functions.php:236
310
  #: includes/admin/tools.php:34
311
  msgid "Repair Forums"
312
  msgstr ""
313
 
314
- #: includes/admin/admin.php:187
315
  msgid "Forum Repair"
316
  msgstr ""
317
 
318
- #: includes/admin/admin.php:196 includes/admin/functions.php:240
319
  #: includes/admin/settings.php:1507
320
  msgid "Import Forums"
321
  msgstr ""
322
 
323
- #: includes/admin/admin.php:197
324
  msgid "Forum Import"
325
  msgstr ""
326
 
327
- #: includes/admin/admin.php:206 includes/admin/functions.php:244
328
- #: includes/admin/tools.php:1070
329
  msgid "Reset Forums"
330
  msgstr ""
331
 
332
- #: includes/admin/admin.php:207
333
  msgid "Forum Reset"
334
  msgstr ""
335
 
336
- #: includes/admin/admin.php:245 includes/admin/admin.php:246
337
- #: includes/admin/admin.php:254 includes/admin/admin.php:255
 
 
 
 
 
 
 
 
 
 
 
 
338
  msgid "Welcome to bbPress"
339
  msgstr ""
340
 
341
- #: includes/admin/admin.php:268 includes/admin/admin.php:269
342
- #: includes/admin/admin.php:290 includes/admin/admin.php:291
343
- #: includes/admin/admin.php:1629 includes/admin/admin.php:1718
344
  msgid "Update Forums"
345
  msgstr ""
346
 
347
- #: includes/admin/admin.php:495 includes/admin/admin.php:1439
348
  msgid "Settings"
349
  msgstr ""
350
 
351
- #: includes/admin/admin.php:496
352
  msgid "About"
353
  msgstr ""
354
 
355
- #: includes/admin/admin.php:508
356
  msgid "Right Now in Forums"
357
  msgstr ""
358
 
359
- #: includes/admin/admin.php:1288
 
 
 
 
360
  msgctxt "admin color scheme"
361
  msgid "Green"
362
  msgstr ""
363
 
364
- #: includes/admin/admin.php:1342 includes/admin/admin.php:1366
365
  msgid "%s - %s"
366
  msgstr ""
367
 
368
- #: includes/admin/admin.php:1384 includes/admin/admin.php:1472
369
  msgid "Welcome to bbPress %s"
370
  msgstr ""
371
 
372
- #: includes/admin/admin.php:1385 includes/admin/admin.php:1473
373
  msgid ""
374
- "Thank you for updating! bbPress %s is waxed, polished, and ready for you to "
375
- "take it for a lap or two around the block!"
376
  msgstr ""
377
 
378
- #: includes/admin/admin.php:1386 includes/admin/admin.php:1474
379
  msgid "Version %s"
380
  msgstr ""
381
 
382
- #: includes/admin/admin.php:1390 includes/admin/admin.php:1478
383
  msgid "What&#8217;s New"
384
  msgstr ""
385
 
386
- #: includes/admin/admin.php:1392 includes/admin/admin.php:1480
387
  msgid "Credits"
388
  msgstr ""
389
 
390
- #: includes/admin/admin.php:1397
391
- msgid "Hierarchical Replies"
392
  msgstr ""
393
 
394
- #: includes/admin/admin.php:1401
395
- msgid "Reply to replies"
396
  msgstr ""
397
 
398
- #: includes/admin/admin.php:1402
399
- msgid ""
400
- "Now your users can reply to specific replies, providing context to each "
401
- "inidividual post."
402
  msgstr ""
403
 
404
- #: includes/admin/admin.php:1406
405
- msgid "Choose your own discussion style"
406
  msgstr ""
407
 
408
- #: includes/admin/admin.php:1407
409
- msgid "Stay flat or go threaded, and seamlessly switch between the two."
 
410
  msgstr ""
411
 
412
- #: includes/admin/admin.php:1413
413
- msgid "Under the Hood"
414
  msgstr ""
415
 
416
- #: includes/admin/admin.php:1417
417
- msgid "Preformatted text"
 
 
 
 
 
 
 
 
 
418
  msgstr ""
419
 
420
- #: includes/admin/admin.php:1418
421
- msgid "Forum users can post code snippets with confidence."
422
  msgstr ""
423
 
424
- #: includes/admin/admin.php:1422
425
  msgid "Polyglot support"
426
  msgstr ""
427
 
428
- #: includes/admin/admin.php:1423
429
- msgid "bbPress is ready for future translation API improvements."
430
  msgstr ""
431
 
432
- #: includes/admin/admin.php:1427
433
  msgid "User capabilities"
434
  msgstr ""
435
 
436
- #: includes/admin/admin.php:1428
437
  msgid ""
438
  "Roles and capabilities have been swept through, cleaned up, and simplified."
439
  msgstr ""
440
 
441
- #: includes/admin/admin.php:1434 includes/admin/settings.php:166
442
- #: includes/admin/settings.php:333 includes/common/template.php:2297
443
- #: includes/search/template.php:231
444
- #: templates/default/bbpress/form-search.php:17
445
- msgid "Search"
446
- msgstr ""
447
-
448
- #: includes/admin/admin.php:1435
449
- msgid "Search results use pretty permalinks, and have a dedicated output page."
450
- msgstr ""
451
-
452
- #: includes/admin/admin.php:1440
453
- msgid "Fields and sections have been reordered and reorganized."
454
- msgstr ""
455
-
456
- #: includes/admin/admin.php:1444
457
- msgid "BuddyPress"
458
- msgstr ""
459
-
460
- #: includes/admin/admin.php:1445
461
- msgid "Forums are now fully and seamlessly integrated into BuddyPress Groups."
462
  msgstr ""
463
 
464
- #: includes/admin/admin.php:1451 includes/admin/admin.php:1555
465
- msgid "Go to Forum Settings"
 
 
466
  msgstr ""
467
 
468
- #: includes/admin/admin.php:1484
469
  msgid "bbPress is created by a worldwide swarm of busy, busy bees."
470
  msgstr ""
471
 
472
- #: includes/admin/admin.php:1486
473
  msgid "Project Leaders"
474
  msgstr ""
475
 
476
- #: includes/admin/admin.php:1491
477
  msgid "Founding Developer"
478
  msgstr ""
479
 
480
- #: includes/admin/admin.php:1496
481
  msgid "Lead Developer"
482
  msgstr ""
483
 
484
- #: includes/admin/admin.php:1501 includes/admin/admin.php:1520
485
  msgid "Feature Developer"
486
  msgstr ""
487
 
488
- #: includes/admin/admin.php:1505
489
- msgid "Contributing Developers"
490
  msgstr ""
491
 
492
- #: includes/admin/admin.php:1510
493
- msgid "Converter Specialist"
494
  msgstr ""
495
 
496
- #: includes/admin/admin.php:1515
497
  msgid "Bug Testing"
498
  msgstr ""
499
 
500
- #: includes/admin/admin.php:1524
501
- msgid "Core Contributors to bbPress 2.4"
502
  msgstr ""
503
 
504
- #: includes/admin/admin.php:1581 includes/admin/admin.php:1603
505
  msgid "Update Forum"
506
  msgstr ""
507
 
508
- #: includes/admin/admin.php:1592 includes/admin/admin.php:1646
509
  msgid "All done!"
510
  msgstr ""
511
 
512
- #: includes/admin/admin.php:1593 includes/admin/admin.php:1647
513
  msgid "Go Back"
514
  msgstr ""
515
 
516
- #: includes/admin/admin.php:1602
517
  msgid ""
518
  "You can update your forum through this page. Hit the link below to update."
519
  msgstr ""
520
 
521
- #: includes/admin/admin.php:1674
522
  msgid ""
523
  "Warning! Problem updating %1$s. Your server may not be able to connect to "
524
  "sites running on it. Error message: <em>%2$s</em>"
525
  msgstr ""
526
 
527
- #: includes/admin/admin.php:1698
528
  msgid ""
529
  "If your browser doesn&#8217;t start loading the next page automatically, "
530
  "click this link:"
531
  msgstr ""
532
 
533
- #: includes/admin/admin.php:1699
534
  msgid "Next Forums"
535
  msgstr ""
536
 
537
- #: includes/admin/admin.php:1717
538
  msgid ""
539
  "You can update all the forums on your network through this page. It works by "
540
  "calling the update script of each site automatically. Hit the link below to "
@@ -601,7 +390,7 @@ msgstr ""
601
  msgid "Starting Conversion"
602
  msgstr ""
603
 
604
- #: includes/admin/converter.php:248 includes/admin/converter.php:490
605
  msgid "Conversion Complete"
606
  msgstr ""
607
 
@@ -654,34 +443,62 @@ msgid "Converting topics (%1$s - %2$s)"
654
  msgstr ""
655
 
656
  #: includes/admin/converter.php:446
657
- msgid "No tags to convert"
658
  msgstr ""
659
 
660
  #: includes/admin/converter.php:450
661
- msgid "Converting topic tags (%1$s - %2$s)"
662
  msgstr ""
663
 
664
  #: includes/admin/converter.php:461
665
- msgid "No replies to convert"
666
  msgstr ""
667
 
668
  #: includes/admin/converter.php:465
669
- msgid "Converting replies (%1$s - %2$s)"
670
  msgstr ""
671
 
672
  #: includes/admin/converter.php:476
673
- msgid "No reply_to parents to convert"
674
  msgstr ""
675
 
676
  #: includes/admin/converter.php:480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  msgid "Calculating reply_to parents (%1$s - %2$s)"
678
  msgstr ""
679
 
680
- #: includes/admin/converters/Invision.php:502
681
- #: includes/admin/converters/SimplePress5.php:495
682
- #: includes/admin/converters/Vanilla.php:514
683
- #: includes/admin/converters/bbPress1.php:541
684
- #: includes/admin/converters/vBulletin.php:536
 
 
 
 
 
 
 
 
 
 
 
 
685
  msgid "Re: "
686
  msgstr ""
687
 
@@ -902,6 +719,39 @@ msgstr ""
902
  msgid "Publish Box"
903
  msgstr ""
904
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
905
  #: includes/admin/forums.php:412
906
  #: templates/default/bbpress/content-single-topic-lead.php:18
907
  #: templates/default/bbpress/content-single-topic-lead.php:90
@@ -919,7 +769,7 @@ msgstr ""
919
  msgid "Freshness"
920
  msgstr ""
921
 
922
- #: includes/admin/forums.php:463 includes/forums/template.php:531
923
  msgid "No Topics"
924
  msgstr ""
925
 
@@ -978,6 +828,32 @@ msgstr ""
978
  msgid "Discussion"
979
  msgstr ""
980
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
981
  #: includes/admin/metaboxes.php:127
982
  msgid "Users &amp; Moderation"
983
  msgstr ""
@@ -1011,12 +887,12 @@ msgid "You are using <span class=\"b\">bbPress %s</span>."
1011
  msgstr ""
1012
 
1013
  #: includes/admin/metaboxes.php:261 includes/admin/metaboxes.php:262
1014
- #: includes/admin/metaboxes.php:354
1015
  msgid "Type:"
1016
  msgstr ""
1017
 
1018
  #: includes/admin/metaboxes.php:273 includes/admin/metaboxes.php:274
1019
- #: includes/admin/metaboxes.php:366
1020
  #: templates/default/bbpress/form-forum.php:100
1021
  msgid "Status:"
1022
  msgstr ""
@@ -1034,79 +910,89 @@ msgstr ""
1034
  msgid "Forum Parent"
1035
  msgstr ""
1036
 
1037
- #: includes/admin/metaboxes.php:314 includes/admin/metaboxes.php:393
1038
- #: includes/admin/metaboxes.php:446
1039
  msgid "&mdash; No parent &mdash;"
1040
  msgstr ""
1041
 
1042
- #: includes/admin/metaboxes.php:322
1043
  msgid "Order:"
1044
  msgstr ""
1045
 
1046
- #: includes/admin/metaboxes.php:323
1047
  msgid "Forum Order"
1048
  msgstr ""
1049
 
1050
- #: includes/admin/metaboxes.php:355
1051
  msgid "Topic Type"
1052
  msgstr ""
1053
 
1054
- #: includes/admin/metaboxes.php:367
1055
  msgid "Select whether to open or close the topic."
1056
  msgstr ""
1057
 
1058
- #: includes/admin/metaboxes.php:462
1059
- msgid "Reply To:"
 
 
 
 
 
 
1060
  msgstr ""
1061
 
1062
  #: includes/admin/metaboxes.php:463
 
 
 
 
1063
  msgid "Reply To"
1064
  msgstr ""
1065
 
1066
- #: includes/admin/metaboxes.php:493
1067
  #: templates/default/bbpress/form-topic-tag.php:35
1068
  msgid "Name:"
1069
  msgstr ""
1070
 
1071
- #: includes/admin/metaboxes.php:494
1072
  #: templates/default/bbpress/form-user-edit.php:14
1073
  #: templates/default/bbpress/form-user-edit.php:19
1074
  msgid "Name"
1075
  msgstr ""
1076
 
1077
- #: includes/admin/metaboxes.php:499
1078
  msgid "Email:"
1079
  msgstr ""
1080
 
1081
- #: includes/admin/metaboxes.php:500
1082
  #: templates/default/bbpress/form-user-edit.php:103
1083
  #: templates/default/bbpress/form-user-register.php:28
1084
  msgid "Email"
1085
  msgstr ""
1086
 
1087
- #: includes/admin/metaboxes.php:505
1088
  #: templates/default/bbpress/form-anonymous.php:32
1089
  msgid "Website:"
1090
  msgstr ""
1091
 
1092
- #: includes/admin/metaboxes.php:506
1093
  #: templates/default/bbpress/form-user-edit.php:57
1094
  msgid "Website"
1095
  msgstr ""
1096
 
1097
- #: includes/admin/metaboxes.php:513
1098
  msgid "ID:"
1099
  msgstr ""
1100
 
1101
- #: includes/admin/metaboxes.php:514
1102
  msgid "ID"
1103
  msgstr ""
1104
 
1105
- #: includes/admin/metaboxes.php:521
1106
  msgid "IP:"
1107
  msgstr ""
1108
 
1109
- #: includes/admin/metaboxes.php:522
1110
  msgid "IP Address"
1111
  msgstr ""
1112
 
@@ -1340,32 +1226,32 @@ msgid "Mark this reply as spam"
1340
  msgstr ""
1341
 
1342
  #: includes/admin/replies.php:739 includes/admin/topics.php:810
1343
- #: includes/replies/template.php:2014 includes/topics/template.php:2721
1344
  msgid "Spam"
1345
  msgstr ""
1346
 
1347
  #: includes/admin/replies.php:748 includes/admin/topics.php:818
1348
- #: includes/replies/template.php:1956 includes/topics/template.php:2477
1349
  msgid "Restore this item from the Trash"
1350
  msgstr ""
1351
 
1352
  #: includes/admin/replies.php:748 includes/admin/topics.php:818
1353
- #: includes/replies/template.php:1944 includes/topics/template.php:2465
1354
  msgid "Restore"
1355
  msgstr ""
1356
 
1357
  #: includes/admin/replies.php:750 includes/admin/topics.php:820
1358
- #: includes/replies/template.php:1958 includes/topics/template.php:2479
1359
  msgid "Move this item to the Trash"
1360
  msgstr ""
1361
 
1362
  #: includes/admin/replies.php:750 includes/admin/topics.php:820
1363
- #: includes/replies/template.php:1943 includes/topics/template.php:2464
1364
  msgid "Trash"
1365
  msgstr ""
1366
 
1367
  #: includes/admin/replies.php:754 includes/admin/topics.php:824
1368
- #: includes/replies/template.php:1962 includes/topics/template.php:2483
1369
  msgid "Delete this item permanently"
1370
  msgstr ""
1371
 
@@ -1476,12 +1362,12 @@ msgstr ""
1476
  msgid "Revisions"
1477
  msgstr ""
1478
 
1479
- #: includes/admin/settings.php:142 includes/extend/buddypress/loader.php:213
1480
  #: templates/default/bbpress/user-details.php:48
1481
  msgid "Favorites"
1482
  msgstr ""
1483
 
1484
- #: includes/admin/settings.php:150 includes/extend/buddypress/loader.php:225
1485
  #: templates/default/bbpress/user-details.php:58
1486
  msgid "Subscriptions"
1487
  msgstr ""
@@ -1490,6 +1376,12 @@ msgstr ""
1490
  msgid "Topic tags"
1491
  msgstr ""
1492
 
 
 
 
 
 
 
1493
  #: includes/admin/settings.php:174
1494
  msgid "Post Formatting"
1495
  msgstr ""
@@ -1526,19 +1418,19 @@ msgstr ""
1526
  msgid "User Base"
1527
  msgstr ""
1528
 
1529
- #: includes/admin/settings.php:354 includes/extend/buddypress/loader.php:191
1530
- #: includes/extend/buddypress/loader.php:264
1531
  #: templates/default/bbpress/user-details.php:35
1532
  msgid "Topics Started"
1533
  msgstr ""
1534
 
1535
- #: includes/admin/settings.php:362 includes/extend/buddypress/loader.php:202
1536
- #: includes/extend/buddypress/loader.php:272
1537
  #: templates/default/bbpress/user-details.php:41
1538
  msgid "Replies Created"
1539
  msgstr ""
1540
 
1541
- #: includes/admin/settings.php:370 includes/extend/buddypress/loader.php:280
1542
  msgid "Favorite Topics"
1543
  msgstr ""
1544
 
@@ -2081,199 +1973,251 @@ msgid "Remove trashed topics from user subscriptions"
2081
  msgstr ""
2082
 
2083
  #: includes/admin/tools.php:176
 
 
 
 
2084
  msgid "Remap existing users to default forum roles"
2085
  msgstr ""
2086
 
2087
- #: includes/admin/tools.php:196
2088
  msgid "Counting the number of replies in each topic&hellip; %s"
2089
  msgstr ""
2090
 
2091
- #: includes/admin/tools.php:197 includes/admin/tools.php:240
2092
- #: includes/admin/tools.php:282 includes/admin/tools.php:327
2093
- #: includes/admin/tools.php:444 includes/admin/tools.php:478
2094
- #: includes/admin/tools.php:510 includes/admin/tools.php:555
2095
- #: includes/admin/tools.php:600 includes/admin/tools.php:662
2096
- #: includes/admin/tools.php:730 includes/admin/tools.php:778
2097
- #: includes/admin/tools.php:884 includes/admin/tools.php:944
2098
- #: includes/admin/tools.php:965 includes/admin/tools.php:1019
 
2099
  msgid "Failed!"
2100
  msgstr ""
2101
 
2102
- #: includes/admin/tools.php:223 includes/admin/tools.php:266
2103
- #: includes/admin/tools.php:292 includes/admin/tools.php:459
2104
- #: includes/admin/tools.php:493 includes/admin/tools.php:538
2105
- #: includes/admin/tools.php:583 includes/admin/tools.php:645
2106
- #: includes/admin/tools.php:706 includes/admin/tools.php:868
2107
- #: includes/admin/tools.php:925 includes/admin/tools.php:948
2108
- #: includes/admin/tools.php:1003 includes/admin/tools.php:1048
 
2109
  msgid "Complete!"
2110
  msgstr ""
2111
 
2112
- #: includes/admin/tools.php:239
2113
  msgid "Counting the number of voices in each topic&hellip; %s"
2114
  msgstr ""
2115
 
2116
- #: includes/admin/tools.php:281
2117
  msgid ""
2118
  "Counting the number of spammed and trashed replies in each topic&hellip; %s"
2119
  msgstr ""
2120
 
2121
- #: includes/admin/tools.php:306
2122
  msgid "Repairing BuddyPress group-forum relationships&hellip; %s"
2123
  msgstr ""
2124
 
2125
- #: includes/admin/tools.php:407
2126
  msgid "Group Forums"
2127
  msgstr ""
2128
 
2129
- #: includes/admin/tools.php:408
2130
  msgid "group-forums"
2131
  msgstr ""
2132
 
2133
- #: includes/admin/tools.php:424
2134
  msgid ""
2135
  "Complete! %s groups updated; %s forums updated; %s forum statuses synced."
2136
  msgstr ""
2137
 
2138
- #: includes/admin/tools.php:443
2139
  msgid "Counting the number of topics in each forum&hellip; %s"
2140
  msgstr ""
2141
 
2142
- #: includes/admin/tools.php:477
2143
  msgid "Counting the number of replies in each forum&hellip; %s"
2144
  msgstr ""
2145
 
2146
- #: includes/admin/tools.php:509
2147
  msgid "Counting the number of topics each user has created&hellip; %s"
2148
  msgstr ""
2149
 
2150
- #: includes/admin/tools.php:554
2151
  msgid "Counting the number of topics to which each user has replied&hellip; %s"
2152
  msgstr ""
2153
 
2154
- #: includes/admin/tools.php:599
2155
  msgid "Removing trashed topics from user favorites&hellip; %s"
2156
  msgstr ""
2157
 
2158
- #: includes/admin/tools.php:629 includes/admin/tools.php:690
 
2159
  msgid "Nothing to remove!"
2160
  msgstr ""
2161
 
2162
- #: includes/admin/tools.php:661
2163
  msgid "Removing trashed topics from user subscriptions&hellip; %s"
2164
  msgstr ""
2165
 
2166
  #: includes/admin/tools.php:723
 
 
 
 
2167
  msgid "Remapping forum role for each user on this site&hellip; %s"
2168
  msgstr ""
2169
 
2170
- #: includes/admin/tools.php:761
2171
  msgid "Complete! %s users updated."
2172
  msgstr ""
2173
 
2174
- #: includes/admin/tools.php:777
2175
  msgid "Recomputing latest post in every topic and forum&hellip; %s"
2176
  msgstr ""
2177
 
2178
- #: includes/admin/tools.php:883
2179
  msgid "Repairing the sticky topic to the parent forum relationships&hellip; %s"
2180
  msgstr ""
2181
 
2182
- #: includes/admin/tools.php:940
2183
  msgid "Recalculating forum visibility &hellip; %s"
2184
  msgstr ""
2185
 
2186
- #: includes/admin/tools.php:964
2187
  msgid "Recalculating the forum for each post &hellip; %s"
2188
  msgstr ""
2189
 
2190
- #: includes/admin/tools.php:1018
2191
  msgid "Recalculating the topic for each post &hellip; %s"
2192
  msgstr ""
2193
 
2194
- #: includes/admin/tools.php:1071
2195
  msgid ""
2196
- "This will revert your forums back to a brand new installation. This process "
2197
- "cannot be undone. <strong>Backup your database before proceeding</strong>."
 
 
 
 
2198
  msgstr ""
2199
 
2200
- #: includes/admin/tools.php:1077
2201
  msgid "The following data will be removed:"
2202
  msgstr ""
2203
 
2204
- #: includes/admin/tools.php:1082
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2205
  msgid "All Topic Tags"
2206
  msgstr ""
2207
 
2208
- #: includes/admin/tools.php:1083
2209
  msgid "Related Meta Data"
2210
  msgstr ""
2211
 
2212
- #: includes/admin/tools.php:1084
2213
  msgid "Forum Settings"
2214
  msgstr ""
2215
 
2216
- #: includes/admin/tools.php:1085
2217
  msgid "Forum Activity"
2218
  msgstr ""
2219
 
2220
- #: includes/admin/tools.php:1086
2221
  msgid "Forum User Roles"
2222
  msgstr ""
2223
 
2224
- #: includes/admin/tools.php:1087
2225
  msgid "Importer Helper Data"
2226
  msgstr ""
2227
 
2228
- #: includes/admin/tools.php:1091
2229
- msgid "Are you sure you want to do this?"
2230
  msgstr ""
2231
 
2232
- #: includes/admin/tools.php:1094
2233
  msgid "Say it ain't so!"
2234
  msgstr ""
2235
 
2236
- #: includes/admin/tools.php:1095
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2237
  msgid "This process cannot be undone."
2238
  msgstr ""
2239
 
2240
- #: includes/admin/tools.php:1103
 
 
 
 
2241
  msgid "Reset bbPress"
2242
  msgstr ""
2243
 
2244
- #: includes/admin/tools.php:1136
2245
  msgid "Failed"
2246
  msgstr ""
2247
 
2248
- #: includes/admin/tools.php:1137
2249
  msgid "Success!"
2250
  msgstr ""
2251
 
2252
- #: includes/admin/tools.php:1144
2253
  msgid "Deleting Posts&hellip; %s"
2254
  msgstr ""
2255
 
2256
- #: includes/admin/tools.php:1157
2257
  msgid "Deleting Post Meta&hellip; %s"
2258
  msgstr ""
2259
 
2260
- #: includes/admin/tools.php:1166
2261
  msgid "Deleting Topic Tags&hellip; %s"
2262
  msgstr ""
2263
 
2264
- #: includes/admin/tools.php:1173
 
 
 
 
2265
  msgid "Deleting User Meta&hellip; %s"
2266
  msgstr ""
2267
 
2268
- #: includes/admin/tools.php:1180
2269
  msgid "Deleting Conversion Table&hellip; %s"
2270
  msgstr ""
2271
 
2272
- #: includes/admin/tools.php:1192
2273
  msgid "Deleting Settings&hellip; %s"
2274
  msgstr ""
2275
 
2276
- #: includes/admin/tools.php:1198
2277
  msgid "Deleting Roles and Capabilities&hellip; %s"
2278
  msgstr ""
2279
 
@@ -2513,7 +2457,7 @@ msgstr ""
2513
  msgid "(No Forum)"
2514
  msgstr ""
2515
 
2516
- #: includes/admin/topics.php:730 includes/topics/template.php:1911
2517
  msgid "No Replies"
2518
  msgstr ""
2519
 
@@ -2539,7 +2483,7 @@ msgstr ""
2539
  msgid "Unstick this topic"
2540
  msgstr ""
2541
 
2542
- #: includes/admin/topics.php:798 includes/topics/template.php:2595
2543
  msgid "Unstick"
2544
  msgstr ""
2545
 
@@ -2547,7 +2491,7 @@ msgstr ""
2547
  msgid "Stick this topic to its forum"
2548
  msgstr ""
2549
 
2550
- #: includes/admin/topics.php:801 includes/topics/template.php:2594
2551
  msgid "Stick"
2552
  msgstr ""
2553
 
@@ -2555,7 +2499,7 @@ msgstr ""
2555
  msgid "Stick this topic to front"
2556
  msgstr ""
2557
 
2558
- #: includes/admin/topics.php:801 includes/topics/template.php:2596
2559
  msgid "(to front)"
2560
  msgstr ""
2561
 
@@ -2608,7 +2552,7 @@ msgid "Forum Role"
2608
  msgstr ""
2609
 
2610
  #: includes/admin/users.php:96 includes/admin/users.php:100
2611
- #: includes/users/template.php:1076
2612
  msgid "&mdash; No role for these forums &mdash;"
2613
  msgstr ""
2614
 
@@ -2709,7 +2653,7 @@ msgstr ""
2709
  msgid "<strong>ERROR</strong>: Invalid email address submitted!"
2710
  msgstr ""
2711
 
2712
- #: includes/common/functions.php:1070
2713
  msgid ""
2714
  "%1$s wrote:\n"
2715
  "\n"
@@ -2724,100 +2668,135 @@ msgid ""
2724
  "Login and visit the topic to unsubscribe from these emails."
2725
  msgstr ""
2726
 
2727
- #: includes/common/functions.php:1758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2728
  msgid ""
2729
  "Conditional query tags do not work before the query is run. Before then, "
2730
  "they always return false."
2731
  msgstr ""
2732
 
2733
- #: includes/common/template.php:1443
2734
  msgid "No topics available"
2735
  msgstr ""
2736
 
2737
- #: includes/common/template.php:1448
2738
  msgid "No forums available"
2739
  msgstr ""
2740
 
2741
- #: includes/common/template.php:1453
2742
  msgid "None available"
2743
  msgstr ""
2744
 
2745
- #: includes/common/template.php:1582 includes/replies/functions.php:1302
2746
- #: includes/topics/functions.php:1294 includes/topics/functions.php:1652
2747
- #: templates/default/bbpress/form-reply.php:29
2748
- msgid "Reply To: %s"
2749
- msgstr ""
2750
-
2751
- #: includes/common/template.php:2105
2752
  msgid "Home"
2753
  msgstr ""
2754
 
2755
- #: includes/common/template.php:2175
2756
  msgid "(Edit)"
2757
  msgstr ""
2758
 
2759
- #: includes/common/template.php:2179 includes/common/template.php:2293
2760
- #: includes/common/template.php:2561 includes/core/theme-compat.php:729
2761
  #: templates/default/extras/taxonomy-topic-tag-edit.php:17
2762
  #: templates/default/extras/taxonomy-topic-tag.php:17
2763
  msgid "Topic Tag: %s"
2764
  msgstr ""
2765
 
2766
- #: includes/common/template.php:2200
 
 
 
 
 
 
 
2767
  msgid "&lsaquo;"
2768
  msgstr ""
2769
 
2770
- #: includes/common/template.php:2200
2771
  msgid "&rsaquo;"
2772
  msgstr ""
2773
 
2774
- #: includes/common/template.php:2468
2775
  msgid "Log Out"
2776
  msgstr ""
2777
 
2778
- #: includes/common/template.php:2525
2779
  msgid "Forum Edit: %s"
2780
  msgstr ""
2781
 
2782
- #: includes/common/template.php:2530
2783
  msgid "Topic Edit: %s"
2784
  msgstr ""
2785
 
2786
- #: includes/common/template.php:2535
2787
  msgid "Reply Edit: %s"
2788
  msgstr ""
2789
 
2790
- #: includes/common/template.php:2540
2791
  msgid "Topic Tag Edit: %s"
2792
  msgstr ""
2793
 
2794
- #: includes/common/template.php:2547
2795
  msgid "Forum: %s"
2796
  msgstr ""
2797
 
2798
- #: includes/common/template.php:2552
2799
  msgid "Topic: %s"
2800
  msgstr ""
2801
 
2802
- #: includes/common/template.php:2570
2803
- msgid "Your Profile"
 
2804
  msgstr ""
2805
 
2806
- #: includes/common/template.php:2575
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2807
  #: templates/default/bbpress/user-details.php:29
2808
  msgid "%s's Profile"
2809
  msgstr ""
2810
 
2811
- #: includes/common/template.php:2583
2812
  msgid "Edit Your Profile"
2813
  msgstr ""
2814
 
2815
- #: includes/common/template.php:2588
2816
  #: templates/default/bbpress/user-details.php:65
2817
  msgid "Edit %s's Profile"
2818
  msgstr ""
2819
 
2820
- #: includes/common/template.php:2596
2821
  msgid "View: %s"
2822
  msgstr ""
2823
 
@@ -2865,7 +2844,7 @@ msgstr ""
2865
  #: includes/common/widgets.php:185 includes/common/widgets.php:337
2866
  #: includes/common/widgets.php:465 includes/common/widgets.php:634
2867
  #: includes/common/widgets.php:876 includes/common/widgets.php:1030
2868
- #: includes/common/widgets.php:1235
2869
  msgid "Title:"
2870
  msgstr ""
2871
 
@@ -2893,6 +2872,10 @@ msgstr ""
2893
  msgid "(bbPress) Forum Search Form"
2894
  msgstr ""
2895
 
 
 
 
 
2896
  #: includes/common/widgets.php:512
2897
  msgid "A list of forums with an option to set the parent."
2898
  msgstr ""
@@ -2926,7 +2909,7 @@ msgstr ""
2926
  msgid "Maximum topics to show:"
2927
  msgstr ""
2928
 
2929
- #: includes/common/widgets.php:889 includes/common/widgets.php:1237
2930
  msgid "Show post date:"
2931
  msgstr ""
2932
 
@@ -2976,38 +2959,38 @@ msgid "(bbPress) Recent Replies"
2976
  msgstr ""
2977
 
2978
  #. translators: 1: reply author, 2: reply link, 3: reply timestamp
2979
- #: includes/common/widgets.php:1167
2980
  msgctxt "widgets"
2981
  msgid "%1$s on %2$s %3$s"
2982
  msgstr ""
2983
 
2984
  #. translators: 1: reply link, 2: reply timestamp
2985
- #: includes/common/widgets.php:1173
2986
  msgctxt "widgets"
2987
  msgid "%1$s %2$s"
2988
  msgstr ""
2989
 
2990
  #. translators: 1: reply author, 2: reply link
2991
- #: includes/common/widgets.php:1179
2992
  msgctxt "widgets"
2993
  msgid "%1$s on %2$s"
2994
  msgstr ""
2995
 
2996
  #. translators: 1: reply link
2997
- #: includes/common/widgets.php:1185
2998
  msgctxt "widgets"
2999
  msgid "%1$s"
3000
  msgstr ""
3001
 
3002
- #: includes/common/widgets.php:1236
3003
  msgid "Maximum replies to show:"
3004
  msgstr ""
3005
 
3006
- #: includes/common/widgets.php:1238
3007
  msgid "Show reply author:"
3008
  msgstr ""
3009
 
3010
- #: includes/common/widgets.php:1253
3011
  msgid "Recent Replies"
3012
  msgstr ""
3013
 
@@ -3152,15 +3135,17 @@ msgid "Save Settings"
3152
  msgstr ""
3153
 
3154
  #: includes/extend/buddypress/groups.php:335
3155
- #: includes/extend/buddypress/groups.php:494 includes/forums/functions.php:118
3156
- #: includes/forums/functions.php:394 includes/replies/functions.php:116
3157
- #: includes/replies/functions.php:522 includes/replies/functions.php:1249
3158
- #: includes/topics/functions.php:122 includes/topics/functions.php:520
3159
- #: includes/topics/functions.php:1153 includes/topics/functions.php:1456
3160
- #: includes/topics/functions.php:1820 includes/topics/functions.php:1859
3161
- #: includes/topics/functions.php:1916 includes/users/functions.php:459
3162
- #: includes/users/functions.php:772 includes/users/functions.php:897
3163
- #: includes/users/functions.php:903
 
 
3164
  msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
3165
  msgstr ""
3166
 
@@ -3177,167 +3162,229 @@ msgstr ""
3177
  msgid "This group does not currently have a forum."
3178
  msgstr ""
3179
 
3180
- #: includes/extend/buddypress/loader.php:100
3181
  msgid "Search Forums..."
3182
  msgstr ""
3183
 
3184
- #: includes/extend/buddypress/loader.php:288
 
3185
  msgid "Subscribed Topics"
3186
  msgstr ""
3187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3188
  #: includes/forums/functions.php:131
3189
  msgid ""
3190
  "<strong>ERROR</strong>: You do not have permission to create new forums."
3191
  msgstr ""
3192
 
3193
- #: includes/forums/functions.php:155 includes/forums/functions.php:454
3194
  msgid "<strong>ERROR</strong>: Your forum needs a title."
3195
  msgstr ""
3196
 
3197
- #: includes/forums/functions.php:167 includes/forums/functions.php:466
3198
  msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
3199
  msgstr ""
3200
 
3201
- #: includes/forums/functions.php:180
3202
  msgid "<strong>ERROR</strong>: Your forum must have a parent."
3203
  msgstr ""
3204
 
3205
- #: includes/forums/functions.php:187
3206
  msgid ""
3207
  "<strong>ERROR</strong>: This forum is a category. No forums can be created "
3208
  "in this forum."
3209
  msgstr ""
3210
 
3211
- #: includes/forums/functions.php:192 includes/forums/functions.php:430
3212
  msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
3213
  msgstr ""
3214
 
3215
- #: includes/forums/functions.php:197 includes/forums/functions.php:435
3216
  msgid ""
3217
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3218
  "capability to read or create new forums in it."
3219
  msgstr ""
3220
 
3221
- #: includes/forums/functions.php:202 includes/forums/functions.php:440
3222
  msgid ""
3223
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3224
  "capability to read or create new forums in it."
3225
  msgstr ""
3226
 
3227
- #: includes/forums/functions.php:209 includes/replies/functions.php:297
3228
  #: includes/topics/functions.php:260
3229
  msgid "<strong>ERROR</strong>: Slow down; you move too fast."
3230
  msgstr ""
3231
 
3232
- #: includes/forums/functions.php:214
3233
  msgid "<strong>ERROR</strong>: This forum already exists."
3234
  msgstr ""
3235
 
3236
- #: includes/forums/functions.php:219
3237
  msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
3238
  msgstr ""
3239
 
3240
- #: includes/forums/functions.php:383
3241
  msgid "<strong>ERROR</strong>: Forum ID not found."
3242
  msgstr ""
3243
 
3244
- #: includes/forums/functions.php:399
3245
  msgid "<strong>ERROR</strong>: The forum you want to edit was not found."
3246
  msgstr ""
3247
 
3248
- #: includes/forums/functions.php:404
3249
  msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
3250
  msgstr ""
3251
 
3252
- #: includes/forums/functions.php:471
3253
  msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
3254
  msgstr ""
3255
 
3256
- #: includes/forums/functions.php:1559
3257
  msgctxt "Open the forum"
3258
  msgid "Open"
3259
  msgstr ""
3260
 
3261
- #: includes/forums/functions.php:1560
3262
  msgctxt "Close the forum"
3263
  msgid "Closed"
3264
  msgstr ""
3265
 
3266
- #: includes/forums/functions.php:1573
3267
  msgctxt "Forum accepts new topics"
3268
  msgid "Forum"
3269
  msgstr ""
3270
 
3271
- #: includes/forums/functions.php:1574
3272
  msgctxt "Forum is a category"
3273
  msgid "Category"
3274
  msgstr ""
3275
 
3276
- #: includes/forums/functions.php:1587
3277
  msgctxt "Make forum public"
3278
  msgid "Public"
3279
  msgstr ""
3280
 
3281
- #: includes/forums/functions.php:1588
3282
  msgctxt "Make forum private"
3283
  msgid "Private"
3284
  msgstr ""
3285
 
3286
- #: includes/forums/functions.php:1589
3287
  msgctxt "Make forum hidden"
3288
  msgid "Hidden"
3289
  msgstr ""
3290
 
3291
- #: includes/forums/template.php:1121 includes/forums/template.php:1859
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3292
  msgid "%s topic"
3293
  msgid_plural "%s topics"
3294
  msgstr[0] ""
3295
  msgstr[1] ""
3296
 
3297
- #: includes/forums/template.php:1137 includes/topics/template.php:1967
3298
  msgid " (+ %d hidden)"
3299
  msgstr ""
3300
 
3301
- #: includes/forums/template.php:1848 includes/topics/template.php:1951
3302
  msgid "%s reply"
3303
  msgid_plural "%s replies"
3304
  msgstr[0] ""
3305
  msgstr[1] ""
3306
 
3307
- #: includes/forums/template.php:1868
3308
  msgid ""
3309
  "This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
3310
  msgstr ""
3311
 
3312
- #: includes/forums/template.php:1870
3313
  msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
3314
  msgstr ""
3315
 
3316
- #: includes/forums/template.php:1876
3317
  msgid "This category contains %1$s, and was last updated by %2$s %3$s."
3318
  msgstr ""
3319
 
3320
- #: includes/forums/template.php:1878
3321
  msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
3322
  msgstr ""
3323
 
3324
- #: includes/forums/template.php:1888
3325
  msgid "This category contains %1$s and %2$s."
3326
  msgstr ""
3327
 
3328
- #: includes/forums/template.php:1890
3329
  msgid "This forum contains %1$s and %2$s."
3330
  msgstr ""
3331
 
3332
- #: includes/forums/template.php:1898
3333
  msgid "This category contains %1$s."
3334
  msgstr ""
3335
 
3336
- #: includes/forums/template.php:1900
3337
  msgid "This forum contains %1$s."
3338
  msgstr ""
3339
 
3340
- #: includes/forums/template.php:1904
3341
  msgid "This forum is empty."
3342
  msgstr ""
3343
 
@@ -3379,256 +3426,286 @@ msgstr ""
3379
  msgid "<strong>ERROR</strong>: Forum does not exist."
3380
  msgstr ""
3381
 
3382
- #: includes/replies/functions.php:227 includes/replies/functions.php:578
3383
  msgid ""
3384
  "<strong>ERROR</strong>: This forum is a category. No replies can be created "
3385
  "in this forum."
3386
  msgstr ""
3387
 
3388
- #: includes/replies/functions.php:234 includes/replies/functions.php:585
3389
  msgid "<strong>ERROR</strong>: This forum has been closed to new replies."
3390
  msgstr ""
3391
 
3392
- #: includes/replies/functions.php:240 includes/replies/functions.php:591
3393
  msgid ""
3394
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3395
  "capability to read or create new replies in it."
3396
  msgstr ""
3397
 
3398
- #: includes/replies/functions.php:246 includes/replies/functions.php:597
3399
  msgid ""
3400
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3401
  "capability to read or create new replies in it."
3402
  msgstr ""
3403
 
3404
- #: includes/replies/functions.php:280
3405
- msgid "<strong>ERROR</strong>: Your reply needs a title."
3406
- msgstr ""
3407
-
3408
- #: includes/replies/functions.php:292 includes/replies/functions.php:621
3409
  msgid "<strong>ERROR</strong>: Your reply cannot be empty."
3410
  msgstr ""
3411
 
3412
- #: includes/replies/functions.php:302
3413
  msgid ""
3414
  "<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
3415
  "you&#8217;ve already said that!"
3416
  msgstr ""
3417
 
3418
- #: includes/replies/functions.php:307
3419
  msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
3420
  msgstr ""
3421
 
3422
- #: includes/replies/functions.php:324
3423
  msgid "<strong>ERROR</strong>: Topic is closed."
3424
  msgstr ""
3425
 
3426
- #: includes/replies/functions.php:383 includes/replies/functions.php:705
3427
  msgid ""
3428
  "<strong>ERROR</strong>: There was a problem adding the tags to the topic."
3429
  msgstr ""
3430
 
3431
- #: includes/replies/functions.php:511
3432
  msgid "<strong>ERROR</strong>: Reply ID not found."
3433
  msgstr ""
3434
 
3435
- #: includes/replies/functions.php:528
3436
  msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
3437
  msgstr ""
3438
 
3439
- #: includes/replies/functions.php:539
3440
  msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
3441
  msgstr ""
3442
 
3443
- #: includes/replies/functions.php:626
3444
  msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
3445
  msgstr ""
3446
 
3447
- #: includes/replies/functions.php:1226
3448
  msgid "<strong>ERROR</strong>: Reply ID to move not found!"
3449
  msgstr ""
3450
 
3451
- #: includes/replies/functions.php:1235
3452
  msgid "<strong>ERROR</strong>: The reply you want to move was not found."
3453
  msgstr ""
3454
 
3455
- #: includes/replies/functions.php:1244
3456
  msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
3457
  msgstr ""
3458
 
3459
- #: includes/replies/functions.php:1255 includes/topics/functions.php:1164
3460
  #: includes/topics/functions.php:1462
3461
  msgid ""
3462
  "<strong>ERROR</strong>: You do not have the permissions to edit the source "
3463
  "topic."
3464
  msgstr ""
3465
 
3466
- #: includes/replies/functions.php:1265
3467
  msgid "<strong>ERROR</strong>: You need to choose a valid move option."
3468
  msgstr ""
3469
 
3470
- #: includes/replies/functions.php:1278 includes/topics/functions.php:1483
3471
  msgid "<strong>ERROR</strong>: Destination topic ID not found!"
3472
  msgstr ""
3473
 
3474
- #: includes/replies/functions.php:1288
3475
  msgid "<strong>ERROR</strong>: The topic you want to move to was not found!"
3476
  msgstr ""
3477
 
3478
- #: includes/replies/functions.php:1293 includes/topics/functions.php:1496
3479
  msgid ""
3480
  "<strong>ERROR</strong>: You do not have the permissions to edit the "
3481
  "destination topic!"
3482
  msgstr ""
3483
 
3484
- #: includes/replies/functions.php:1347 includes/topics/functions.php:1533
 
 
 
 
 
 
3485
  msgid ""
3486
  "<strong>ERROR</strong>: There was a problem converting the reply into the "
3487
  "topic. Please try again."
3488
  msgstr ""
3489
 
3490
- #: includes/replies/functions.php:1352 includes/topics/functions.php:1538
3491
  msgid ""
3492
  "<strong>ERROR</strong>: You do not have the permissions to create new "
3493
  "topics. The reply could not be converted into a topic."
3494
  msgstr ""
3495
 
3496
- #: includes/replies/functions.php:1534
3497
  msgid "<strong>ERROR:</strong> You do not have the permission to do that!"
3498
  msgstr ""
3499
 
3500
- #: includes/replies/functions.php:1547
3501
  msgid ""
3502
  "<strong>ERROR</strong>: There was a problem unmarking the reply as spam!"
3503
  msgstr ""
3504
 
3505
- #: includes/replies/functions.php:1547
3506
  msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam!"
3507
  msgstr ""
3508
 
3509
- #: includes/replies/functions.php:1566
3510
  msgid "<strong>ERROR</strong>: There was a problem trashing the reply!"
3511
  msgstr ""
3512
 
3513
- #: includes/replies/functions.php:1574
3514
  msgid "<strong>ERROR</strong>: There was a problem untrashing the reply!"
3515
  msgstr ""
3516
 
3517
- #: includes/replies/functions.php:1582
3518
  msgid "<strong>ERROR</strong>: There was a problem deleting the reply!"
3519
  msgstr ""
3520
 
3521
- #: includes/replies/functions.php:1996
3522
  msgid "All Posts"
3523
  msgstr ""
3524
 
3525
- #: includes/replies/functions.php:2038 includes/topics/functions.php:3463
3526
  msgid "Replies: %s"
3527
  msgstr ""
3528
 
3529
- #: includes/replies/template.php:623 includes/topics/template.php:753
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3530
  msgctxt "date at time"
3531
  msgid "%1$s at %2$s"
3532
  msgstr ""
3533
 
3534
- #: includes/replies/template.php:721
3535
  msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
3536
  msgstr ""
3537
 
3538
- #: includes/replies/template.php:723
3539
  msgid "This reply was modified %1$s by %2$s."
3540
  msgstr ""
3541
 
3542
- #: includes/replies/template.php:1009 includes/topics/template.php:1306
3543
  #: includes/users/template.php:184
3544
  msgid "Anonymous"
3545
  msgstr ""
3546
 
3547
- #: includes/replies/template.php:1122 includes/topics/template.php:1419
3548
- #: includes/users/template.php:1437
3549
  msgid "View %s's profile"
3550
  msgstr ""
3551
 
3552
- #: includes/replies/template.php:1122 includes/topics/template.php:1419
3553
- #: includes/users/template.php:1437
3554
  msgid "Visit %s's website"
3555
  msgstr ""
3556
 
3557
- #: includes/replies/template.php:1604
3558
  msgid "Cancel"
3559
  msgstr ""
3560
 
3561
- #: includes/replies/template.php:1945 includes/topics/template.php:2466
3562
  #: templates/default/bbpress/form-topic-tag.php:88
3563
  #: templates/default/bbpress/form-topic-tag.php:101
3564
  msgid "Delete"
3565
  msgstr ""
3566
 
3567
- #: includes/replies/template.php:1962 includes/topics/template.php:2483
3568
  msgid "Are you sure you want to delete that permanently?"
3569
  msgstr ""
3570
 
3571
- #: includes/replies/template.php:2015 includes/topics/template.php:2722
3572
  msgid "Unspam"
3573
  msgstr ""
3574
 
3575
- #: includes/replies/template.php:2078
3576
  msgid "Move"
3577
  msgstr ""
3578
 
3579
- #: includes/replies/template.php:2079
3580
  msgid "Move this reply"
3581
  msgstr ""
3582
 
3583
- #: includes/replies/template.php:2145
3584
  msgid "Split"
3585
  msgstr ""
3586
 
3587
- #: includes/replies/template.php:2146
3588
  msgid "Split the topic from this reply"
3589
  msgstr ""
3590
 
3591
- #: includes/replies/template.php:2252
3592
  msgid "Viewing %1$s reply thread"
3593
  msgid_plural "Viewing %1$s reply threads"
3594
  msgstr[0] ""
3595
  msgstr[1] ""
3596
 
3597
- #: includes/replies/template.php:2259
3598
  msgid "Viewing %1$s reply"
3599
  msgid_plural "Viewing %1$s replies"
3600
  msgstr[0] ""
3601
  msgstr[1] ""
3602
 
3603
- #: includes/replies/template.php:2263
3604
  msgid "Viewing %2$s replies (of %4$s total)"
3605
  msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
3606
  msgstr[0] ""
3607
  msgstr[1] ""
3608
 
3609
- #: includes/replies/template.php:2271
3610
  msgid "Viewing %1$s post"
3611
  msgid_plural "Viewing %1$s posts"
3612
  msgstr[0] ""
3613
  msgstr[1] ""
3614
 
3615
- #: includes/replies/template.php:2275
3616
  msgid "Viewing %2$s post (of %4$s total)"
3617
  msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
3618
  msgstr[0] ""
3619
  msgstr[1] ""
3620
 
3621
- #: includes/search/template.php:235
3622
  msgid "Search Results for '%s'"
3623
  msgstr ""
3624
 
3625
- #: includes/search/template.php:407
3626
  msgid "Viewing %1$s result"
3627
  msgid_plural "Viewing %1$s results"
3628
  msgstr[0] ""
3629
  msgstr[1] ""
3630
 
3631
- #: includes/search/template.php:411
3632
  msgid "Viewing %2$s results (of %4$s total)"
3633
  msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
3634
  msgstr[0] ""
@@ -3865,79 +3942,153 @@ msgstr ""
3865
  msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
3866
  msgstr ""
3867
 
3868
- #: includes/topics/template.php:935
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3869
  msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
3870
  msgstr ""
3871
 
3872
- #: includes/topics/template.php:937
3873
  msgid "This topic was modified %1$s by %2$s."
3874
  msgstr ""
3875
 
3876
- #: includes/topics/template.php:2144
 
 
 
 
 
 
 
 
3877
  msgid "Tagged:"
3878
  msgstr ""
3879
 
3880
- #: includes/topics/template.php:2534
3881
  msgctxt "Topic Status"
3882
  msgid "Close"
3883
  msgstr ""
3884
 
3885
- #: includes/topics/template.php:2535
3886
  msgctxt "Topic Status"
3887
  msgid "Open"
3888
  msgstr ""
3889
 
3890
- #: includes/topics/template.php:2665
3891
  #: templates/default/bbpress/form-topic-tag.php:59
3892
  #: templates/default/bbpress/form-topic-tag.php:73
3893
  msgid "Merge"
3894
  msgstr ""
3895
 
3896
- #: includes/topics/template.php:2826
3897
  msgid "Viewing %1$s topic"
3898
  msgid_plural "Viewing %1$s topics"
3899
  msgstr[0] ""
3900
  msgstr[1] ""
3901
 
3902
- #: includes/topics/template.php:2830
3903
  msgid "Viewing topic %2$s (of %4$s total)"
3904
  msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
3905
  msgstr[0] ""
3906
  msgstr[1] ""
3907
 
3908
- #: includes/topics/template.php:2890
3909
  msgid "This topic is marked as spam."
3910
  msgstr ""
3911
 
3912
- #: includes/topics/template.php:2895
3913
  msgid "This topic is in the trash."
3914
  msgstr ""
3915
 
3916
- #: includes/topics/template.php:3155
3917
  msgid "%s voice"
3918
  msgid_plural "%s voices"
3919
  msgstr[0] ""
3920
  msgstr[1] ""
3921
 
3922
- #: includes/topics/template.php:3161
3923
  msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
3924
  msgstr ""
3925
 
3926
- #: includes/topics/template.php:3165
3927
  msgid "This topic contains %1$s and has %2$s."
3928
  msgstr ""
3929
 
3930
- #: includes/topics/template.php:3169
3931
  msgid "This topic has no replies."
3932
  msgstr ""
3933
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3934
  #: includes/users/functions.php:455
3935
  msgid ""
3936
  "<strong>ERROR</strong>: No topic was found! Which topic are you marking/"
3937
  "unmarking as favorite?"
3938
  msgstr ""
3939
 
3940
- #: includes/users/functions.php:463 includes/users/functions.php:776
 
3941
  msgid ""
3942
  "<strong>ERROR</strong>: You don't have the permission to edit favorites of "
3943
  "that user!"
@@ -3953,18 +4104,33 @@ msgstr ""
3953
  msgid "<strong>ERROR</strong>: There was a problem favoriting that topic!"
3954
  msgstr ""
3955
 
3956
- #: includes/users/functions.php:768
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3957
  msgid ""
3958
  "<strong>ERROR</strong>: No topic was found! Which topic are you subscribing/"
3959
  "unsubscribing to?"
3960
  msgstr ""
3961
 
3962
- #: includes/users/functions.php:819
3963
  msgid ""
3964
  "<strong>ERROR</strong>: There was a problem unsubscribing from that topic!"
3965
  msgstr ""
3966
 
3967
- #: includes/users/functions.php:821
3968
  msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic!"
3969
  msgstr ""
3970
 
@@ -3984,55 +4150,43 @@ msgstr ""
3984
  msgid "Admin"
3985
  msgstr ""
3986
 
3987
- #: includes/users/template.php:723
3988
- msgid "Favorite"
3989
- msgstr ""
3990
-
3991
- #: includes/users/template.php:724
3992
  msgid "Favorited"
3993
  msgstr ""
3994
 
3995
- #: includes/users/template.php:881
3996
- msgid "Subscribe"
3997
- msgstr ""
3998
-
3999
- #: includes/users/template.php:882
4000
- msgid "Unsubscribe"
4001
- msgstr ""
4002
-
4003
- #: includes/users/template.php:949
4004
  msgid "User updated."
4005
  msgstr ""
4006
 
4007
- #: includes/users/template.php:974
4008
  msgid "You have super admin privileges."
4009
  msgstr ""
4010
 
4011
- #: includes/users/template.php:974
4012
  msgid "This user has super admin privileges."
4013
  msgstr ""
4014
 
4015
- #: includes/users/template.php:1041
4016
  msgid "&mdash; No role for this site &mdash;"
4017
  msgstr ""
4018
 
4019
- #: includes/users/template.php:1239
4020
  msgid "You are now logged out."
4021
  msgstr ""
4022
 
4023
- #: includes/users/template.php:1243
4024
  msgid "New user registration is currently not allowed."
4025
  msgstr ""
4026
 
4027
- #: includes/users/template.php:1252
4028
  msgid "Check your e-mail for the confirmation link."
4029
  msgstr ""
4030
 
4031
- #: includes/users/template.php:1257
4032
  msgid "Check your e-mail for your new password."
4033
  msgstr ""
4034
 
4035
- #: includes/users/template.php:1262
4036
  msgid "Registration complete. Please check your e-mail."
4037
  msgstr ""
4038
 
@@ -4134,10 +4288,10 @@ msgid "(No Parent)"
4134
  msgstr ""
4135
 
4136
  #: templates/default/bbpress/form-forum.php:138
4137
- #: templates/default/bbpress/form-reply-move.php:73
4138
  #: templates/default/bbpress/form-reply.php:135
4139
- #: templates/default/bbpress/form-topic-merge.php:94
4140
- #: templates/default/bbpress/form-topic-split.php:98
4141
  #: templates/default/bbpress/form-topic.php:203
4142
  msgid "Submit"
4143
  msgstr ""
@@ -4192,22 +4346,17 @@ msgstr ""
4192
  msgid "Use an existing topic in this forum:"
4193
  msgstr ""
4194
 
4195
- #: templates/default/bbpress/form-reply-move.php:58
4196
- #: templates/default/bbpress/form-topic-split.php:58
4197
- msgid "No other topics found!"
4198
- msgstr ""
4199
-
4200
- #: templates/default/bbpress/form-reply-move.php:69
4201
- #: templates/default/bbpress/form-topic-merge.php:90
4202
- #: templates/default/bbpress/form-topic-split.php:94
4203
  msgid "<strong>WARNING:</strong> This process cannot be undone."
4204
  msgstr ""
4205
 
4206
- #: templates/default/bbpress/form-reply-move.php:86
4207
  msgid "You do not have the permissions to edit this reply!"
4208
  msgstr ""
4209
 
4210
- #: templates/default/bbpress/form-reply-move.php:86
4211
  msgid "You cannot edit this reply."
4212
  msgstr ""
4213
 
@@ -4294,38 +4443,34 @@ msgstr ""
4294
  msgid "Merge with this topic:"
4295
  msgstr ""
4296
 
4297
- #: templates/default/bbpress/form-topic-merge.php:51
4298
- msgid "No topics were found to which the topic could be merged to!"
4299
- msgstr ""
4300
-
4301
- #: templates/default/bbpress/form-topic-merge.php:57
4302
  msgid "There are no other topics in this forum to merge with."
4303
  msgstr ""
4304
 
4305
- #: templates/default/bbpress/form-topic-merge.php:65
4306
- #: templates/default/bbpress/form-topic-split.php:69
4307
  msgid "Topic Extras"
4308
  msgstr ""
4309
 
4310
- #: templates/default/bbpress/form-topic-merge.php:72
4311
  msgid "Merge topic subscribers"
4312
  msgstr ""
4313
 
4314
- #: templates/default/bbpress/form-topic-merge.php:77
4315
  msgid "Merge topic favoriters"
4316
  msgstr ""
4317
 
4318
- #: templates/default/bbpress/form-topic-merge.php:82
4319
  msgid "Merge topic tags"
4320
  msgstr ""
4321
 
4322
- #: templates/default/bbpress/form-topic-merge.php:107
4323
- #: templates/default/bbpress/form-topic-split.php:111
4324
  msgid "You do not have the permissions to edit this topic!"
4325
  msgstr ""
4326
 
4327
- #: templates/default/bbpress/form-topic-merge.php:107
4328
- #: templates/default/bbpress/form-topic-split.php:111
4329
  msgid "You cannot edit this topic."
4330
  msgstr ""
4331
 
@@ -4355,15 +4500,15 @@ msgstr ""
4355
  msgid "Split: %s"
4356
  msgstr ""
4357
 
4358
- #: templates/default/bbpress/form-topic-split.php:76
4359
  msgid "Copy subscribers to the new topic"
4360
  msgstr ""
4361
 
4362
- #: templates/default/bbpress/form-topic-split.php:81
4363
  msgid "Copy favoriters to the new topic"
4364
  msgstr ""
4365
 
4366
- #: templates/default/bbpress/form-topic-split.php:86
4367
  msgid "Copy topic tags to the new topic"
4368
  msgstr ""
4369
 
@@ -4629,14 +4774,6 @@ msgstr ""
4629
  msgid "%s's Replies Created"
4630
  msgstr ""
4631
 
4632
- #: templates/default/bbpress/user-details.php:48
4633
- msgid "%s's Favorites"
4634
- msgstr ""
4635
-
4636
- #: templates/default/bbpress/user-details.php:58
4637
- msgid "%s's Subscriptions"
4638
- msgstr ""
4639
-
4640
  #: templates/default/bbpress/user-favorites.php:15
4641
  msgid "Favorite Forum Topics"
4642
  msgstr ""
@@ -4674,14 +4811,22 @@ msgid "This user has not replied to any topics."
4674
  msgstr ""
4675
 
4676
  #: templates/default/bbpress/user-subscriptions.php:19
4677
- msgid "Subscribed Forum Topics"
 
 
 
 
 
 
 
 
4678
  msgstr ""
4679
 
4680
- #: templates/default/bbpress/user-subscriptions.php:32
4681
  msgid "You are not currently subscribed to any topics."
4682
  msgstr ""
4683
 
4684
- #: templates/default/bbpress/user-subscriptions.php:32
4685
  msgid "This user is not currently subscribed to any topics."
4686
  msgstr ""
4687
 
@@ -4697,43 +4842,56 @@ msgstr ""
4697
  msgid "This user has not created any topics."
4698
  msgstr ""
4699
 
4700
- #: templates/default/bbpress-functions.php:307
 
4701
  msgid "Something went wrong. Refresh your browser and try again."
4702
  msgstr ""
4703
 
4704
- #: templates/default/bbpress-functions.php:332
4705
- msgid "Favorites are no longer active."
 
4706
  msgstr ""
4707
 
4708
- #: templates/default/bbpress-functions.php:337
4709
- msgid "Please login to make this topic a favorite."
4710
  msgstr ""
4711
 
4712
- #: templates/default/bbpress-functions.php:346
4713
- #: templates/default/bbpress-functions.php:413
 
4714
  msgid "You do not have permission to do this."
4715
  msgstr ""
4716
 
4717
- #: templates/default/bbpress-functions.php:354
4718
- #: templates/default/bbpress-functions.php:421
4719
- msgid "The topic could not be found."
4720
  msgstr ""
4721
 
4722
- #: templates/default/bbpress-functions.php:359
4723
- #: templates/default/bbpress-functions.php:426
 
4724
  msgid "Are you sure you meant to do that?"
4725
  msgstr ""
4726
 
4727
- #: templates/default/bbpress-functions.php:367
4728
- #: templates/default/bbpress-functions.php:434
 
4729
  msgid "The request was unsuccessful. Please try again."
4730
  msgstr ""
4731
 
4732
- #: templates/default/bbpress-functions.php:399
4733
- msgid "Subscriptions are no longer active."
4734
  msgstr ""
4735
 
4736
- #: templates/default/bbpress-functions.php:404
 
 
 
 
 
 
 
 
 
4737
  msgid "Please login to subscribe to this topic."
4738
  msgstr ""
4739
 
@@ -4750,9 +4908,9 @@ msgstr ""
4750
  msgid "bbPress"
4751
  msgstr ""
4752
 
4753
- #. #-#-#-#-# plugin.pot (bbPress 2.4-rc1) #-#-#-#-#
4754
  #. Plugin URI of the plugin/theme
4755
- #. #-#-#-#-# plugin.pot (bbPress 2.4-rc1) #-#-#-#-#
4756
  #. Author URI of the plugin/theme
4757
  msgid "http://bbpress.org"
4758
  msgstr ""
2
  # This file is distributed under the same license as the bbPress package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: bbPress 2.5\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/bbpress\n"
7
+ "POT-Creation-Date: 2013-11-25 06:51:36+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
  #: bbpress.php:133 bbpress.php:140
16
  msgid "Cheatin&#8217; huh?"
17
  msgstr ""
18
 
19
+ #: bbpress.php:404 templates/default/bbpress-functions.php:51
20
  msgid "bbPress Default"
21
  msgstr ""
22
 
23
+ #: bbpress.php:484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  msgid "bbPress Forums"
25
  msgstr ""
26
 
27
+ #: bbpress.php:509
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  msgid "bbPress Topics"
29
  msgstr ""
30
 
31
+ #: bbpress.php:534
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  msgid "bbPress Replies"
33
  msgstr ""
34
 
35
+ #: bbpress.php:569
36
  msgctxt "post"
37
  msgid "Closed"
38
  msgstr ""
39
 
40
+ #: bbpress.php:570
41
  msgctxt "post"
42
  msgid "Closed <span class=\"count\">(%s)</span>"
43
  msgid_plural "Closed <span class=\"count\">(%s)</span>"
44
  msgstr[0] ""
45
  msgstr[1] ""
46
 
47
+ #: bbpress.php:580
48
  msgctxt "post"
49
  msgid "Spam"
50
  msgstr ""
51
 
52
+ #: bbpress.php:581
53
  msgctxt "post"
54
  msgid "Spam <span class=\"count\">(%s)</span>"
55
  msgid_plural "Spam <span class=\"count\">(%s)</span>"
56
  msgstr[0] ""
57
  msgstr[1] ""
58
 
59
+ #: bbpress.php:593
60
  msgctxt "post"
61
  msgid "Orphan"
62
  msgstr ""
63
 
64
+ #: bbpress.php:594
65
  msgctxt "post"
66
  msgid "Orphan <span class=\"count\">(%s)</span>"
67
  msgid_plural "Orphans <span class=\"count\">(%s)</span>"
68
  msgstr[0] ""
69
  msgstr[1] ""
70
 
71
+ #: bbpress.php:606
72
  msgctxt "post"
73
  msgid "Hidden"
74
  msgstr ""
75
 
76
+ #: bbpress.php:607
77
  msgctxt "post"
78
  msgid "Hidden <span class=\"count\">(%s)</span>"
79
  msgid_plural "Hidden <span class=\"count\">(%s)</span>"
80
  msgstr[0] ""
81
  msgstr[1] ""
82
 
83
+ #: bbpress.php:677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  msgid "Most popular topics"
85
  msgstr ""
86
 
87
+ #: bbpress.php:689
88
  msgid "Topics with no replies"
89
  msgstr ""
90
 
91
+ #: includes/admin/admin.php:187 includes/admin/functions.php:243
92
  #: includes/admin/tools.php:34
93
  msgid "Repair Forums"
94
  msgstr ""
95
 
96
+ #: includes/admin/admin.php:188
97
  msgid "Forum Repair"
98
  msgstr ""
99
 
100
+ #: includes/admin/admin.php:197 includes/admin/functions.php:247
101
  #: includes/admin/settings.php:1507
102
  msgid "Import Forums"
103
  msgstr ""
104
 
105
+ #: includes/admin/admin.php:198
106
  msgid "Forum Import"
107
  msgstr ""
108
 
109
+ #: includes/admin/admin.php:207 includes/admin/functions.php:251
110
+ #: includes/admin/tools.php:1132
111
  msgid "Reset Forums"
112
  msgstr ""
113
 
114
+ #: includes/admin/admin.php:208
115
  msgid "Forum Reset"
116
  msgstr ""
117
 
118
+ #: includes/admin/admin.php:222 includes/admin/admin.php:223
119
+ #: includes/admin/admin.php:233 includes/admin/admin.php:234
120
+ #: includes/admin/users.php:82 includes/common/widgets.php:662
121
+ #: includes/extend/buddypress/loader.php:42
122
+ #: includes/extend/buddypress/loader.php:175
123
+ #: includes/extend/buddypress/loader.php:261
124
+ #: includes/extend/buddypress/loader.php:312 includes/forums/template.php:47
125
+ #: includes/forums/template.php:48
126
+ #: templates/default/bbpress/content-statistics.php:22
127
+ msgid "Forums"
128
+ msgstr ""
129
+
130
+ #: includes/admin/admin.php:246 includes/admin/admin.php:247
131
+ #: includes/admin/admin.php:255 includes/admin/admin.php:256
132
  msgid "Welcome to bbPress"
133
  msgstr ""
134
 
135
+ #: includes/admin/admin.php:269 includes/admin/admin.php:270
136
+ #: includes/admin/admin.php:291 includes/admin/admin.php:292
137
+ #: includes/admin/admin.php:1650 includes/admin/admin.php:1737
138
  msgid "Update Forums"
139
  msgstr ""
140
 
141
+ #: includes/admin/admin.php:500
142
  msgid "Settings"
143
  msgstr ""
144
 
145
+ #: includes/admin/admin.php:505
146
  msgid "About"
147
  msgstr ""
148
 
149
+ #: includes/admin/admin.php:520
150
  msgid "Right Now in Forums"
151
  msgstr ""
152
 
153
+ #: includes/admin/admin.php:537
154
+ msgid "About bbPress"
155
+ msgstr ""
156
+
157
+ #: includes/admin/admin.php:1320
158
  msgctxt "admin color scheme"
159
  msgid "Green"
160
  msgstr ""
161
 
162
+ #: includes/admin/admin.php:1374 includes/admin/admin.php:1398
163
  msgid "%s - %s"
164
  msgstr ""
165
 
166
+ #: includes/admin/admin.php:1416 includes/admin/admin.php:1493
167
  msgid "Welcome to bbPress %s"
168
  msgstr ""
169
 
170
+ #: includes/admin/admin.php:1417
171
  msgid ""
172
+ "Thank you for updating! bbPress %s is bundled up and ready to weather the "
173
+ "storm of users in your community!"
174
  msgstr ""
175
 
176
+ #: includes/admin/admin.php:1418 includes/admin/admin.php:1495
177
  msgid "Version %s"
178
  msgstr ""
179
 
180
+ #: includes/admin/admin.php:1422 includes/admin/admin.php:1499
181
  msgid "What&#8217;s New"
182
  msgstr ""
183
 
184
+ #: includes/admin/admin.php:1424 includes/admin/admin.php:1501
185
  msgid "Credits"
186
  msgstr ""
187
 
188
+ #: includes/admin/admin.php:1429
189
+ msgid "Forum Subscriptions"
190
  msgstr ""
191
 
192
+ #: includes/admin/admin.php:1433
193
+ msgid "Subscribe to Forums"
194
  msgstr ""
195
 
196
+ #: includes/admin/admin.php:1434
197
+ msgid "Now your users can subscribe to new topics in specific forums."
 
 
198
  msgstr ""
199
 
200
+ #: includes/admin/admin.php:1438
201
+ msgid "Manage Subscriptions"
202
  msgstr ""
203
 
204
+ #: includes/admin/admin.php:1439
205
+ msgid ""
206
+ "Your users can manage all of their subscriptions in one convenient location."
207
  msgstr ""
208
 
209
+ #: includes/admin/admin.php:1445
210
+ msgid "Converters"
211
  msgstr ""
212
 
213
+ #: includes/admin/admin.php:1449
214
+ msgid ""
215
+ "We&#8217;re all abuzz about the hive of new importers, AEF, Drupal, FluxBB, "
216
+ "Kunena Forums for Joomla, MyBB, Phorum, PHPFox, PHPWind, PunBB, SMF, Xenforo "
217
+ "and XMB. Existing importers are now sweeter than honey with improved "
218
+ "importing stickies, topic tags, forum categories and the sting is now gone "
219
+ "if you need to remove imported users."
220
+ msgstr ""
221
+
222
+ #: includes/admin/admin.php:1455
223
+ msgid "Theme Compatibility"
224
  msgstr ""
225
 
226
+ #: includes/admin/admin.php:1456
227
+ msgid "Better handling of styles and scripts in the template stack."
228
  msgstr ""
229
 
230
+ #: includes/admin/admin.php:1460
231
  msgid "Polyglot support"
232
  msgstr ""
233
 
234
+ #: includes/admin/admin.php:1461
235
+ msgid "bbPress fully supports automatic translation updates."
236
  msgstr ""
237
 
238
+ #: includes/admin/admin.php:1465
239
  msgid "User capabilities"
240
  msgstr ""
241
 
242
+ #: includes/admin/admin.php:1466
243
  msgid ""
244
  "Roles and capabilities have been swept through, cleaned up, and simplified."
245
  msgstr ""
246
 
247
+ #: includes/admin/admin.php:1472 includes/admin/admin.php:1576
248
+ msgid "Go to Forum Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  msgstr ""
250
 
251
+ #: includes/admin/admin.php:1494
252
+ msgid ""
253
+ "Thank you for updating! bbPress %s is waxed, polished, and ready for you to "
254
+ "take it for a lap or two around the block!"
255
  msgstr ""
256
 
257
+ #: includes/admin/admin.php:1505
258
  msgid "bbPress is created by a worldwide swarm of busy, busy bees."
259
  msgstr ""
260
 
261
+ #: includes/admin/admin.php:1507
262
  msgid "Project Leaders"
263
  msgstr ""
264
 
265
+ #: includes/admin/admin.php:1512
266
  msgid "Founding Developer"
267
  msgstr ""
268
 
269
+ #: includes/admin/admin.php:1517
270
  msgid "Lead Developer"
271
  msgstr ""
272
 
273
+ #: includes/admin/admin.php:1522 includes/admin/admin.php:1541
274
  msgid "Feature Developer"
275
  msgstr ""
276
 
277
+ #: includes/admin/admin.php:1527
278
+ msgid "Converter Specialist"
279
  msgstr ""
280
 
281
+ #: includes/admin/admin.php:1531
282
+ msgid "Contributing Developers"
283
  msgstr ""
284
 
285
+ #: includes/admin/admin.php:1536
286
  msgid "Bug Testing"
287
  msgstr ""
288
 
289
+ #: includes/admin/admin.php:1545
290
+ msgid "Core Contributors to bbPress 2.5"
291
  msgstr ""
292
 
293
+ #: includes/admin/admin.php:1602 includes/admin/admin.php:1624
294
  msgid "Update Forum"
295
  msgstr ""
296
 
297
+ #: includes/admin/admin.php:1613 includes/admin/admin.php:1667
298
  msgid "All done!"
299
  msgstr ""
300
 
301
+ #: includes/admin/admin.php:1614 includes/admin/admin.php:1668
302
  msgid "Go Back"
303
  msgstr ""
304
 
305
+ #: includes/admin/admin.php:1623
306
  msgid ""
307
  "You can update your forum through this page. Hit the link below to update."
308
  msgstr ""
309
 
310
+ #: includes/admin/admin.php:1693
311
  msgid ""
312
  "Warning! Problem updating %1$s. Your server may not be able to connect to "
313
  "sites running on it. Error message: <em>%2$s</em>"
314
  msgstr ""
315
 
316
+ #: includes/admin/admin.php:1717
317
  msgid ""
318
  "If your browser doesn&#8217;t start loading the next page automatically, "
319
  "click this link:"
320
  msgstr ""
321
 
322
+ #: includes/admin/admin.php:1718
323
  msgid "Next Forums"
324
  msgstr ""
325
 
326
+ #: includes/admin/admin.php:1736
327
  msgid ""
328
  "You can update all the forums on your network through this page. It works by "
329
  "calling the update script of each site automatically. Hit the link below to "
390
  msgid "Starting Conversion"
391
  msgstr ""
392
 
393
+ #: includes/admin/converter.php:248 includes/admin/converter.php:520
394
  msgid "Conversion Complete"
395
  msgstr ""
396
 
443
  msgstr ""
444
 
445
  #: includes/admin/converter.php:446
446
+ msgid "No stickies to stick"
447
  msgstr ""
448
 
449
  #: includes/admin/converter.php:450
450
+ msgid "Calculating topic stickies (%1$s - %2$s)"
451
  msgstr ""
452
 
453
  #: includes/admin/converter.php:461
454
+ msgid "No super stickies to stick"
455
  msgstr ""
456
 
457
  #: includes/admin/converter.php:465
458
+ msgid "Calculating topic super stickies (%1$s - %2$s)"
459
  msgstr ""
460
 
461
  #: includes/admin/converter.php:476
462
+ msgid "No tags to convert"
463
  msgstr ""
464
 
465
  #: includes/admin/converter.php:480
466
+ msgid "Converting topic tags (%1$s - %2$s)"
467
+ msgstr ""
468
+
469
+ #: includes/admin/converter.php:491
470
+ msgid "No replies to convert"
471
+ msgstr ""
472
+
473
+ #: includes/admin/converter.php:495
474
+ msgid "Converting replies (%1$s - %2$s)"
475
+ msgstr ""
476
+
477
+ #: includes/admin/converter.php:506
478
+ msgid "No reply_to parents to convert"
479
+ msgstr ""
480
+
481
+ #: includes/admin/converter.php:510
482
  msgid "Calculating reply_to parents (%1$s - %2$s)"
483
  msgstr ""
484
 
485
+ #: includes/admin/converters/AEF.php:688
486
+ #: includes/admin/converters/FluxBB.php:643
487
+ #: includes/admin/converters/Invision.php:525
488
+ #: includes/admin/converters/Kunena1.php:543
489
+ #: includes/admin/converters/Kunena2.php:585
490
+ #: includes/admin/converters/Kunena3.php:812
491
+ #: includes/admin/converters/PHPFox3.php:649
492
+ #: includes/admin/converters/PunBB.php:677
493
+ #: includes/admin/converters/SMF.php:656
494
+ #: includes/admin/converters/SimplePress5.php:537
495
+ #: includes/admin/converters/Vanilla.php:535
496
+ #: includes/admin/converters/XMB.php:705
497
+ #: includes/admin/converters/XenForo.php:722
498
+ #: includes/admin/converters/bbPress1.php:636
499
+ #: includes/admin/converters/phpBB.php:816
500
+ #: includes/admin/converters/vBulletin.php:652
501
+ #: includes/admin/converters/vBulletin3.php:652
502
  msgid "Re: "
503
  msgstr ""
504
 
719
  msgid "Publish Box"
720
  msgstr ""
721
 
722
+ #: includes/admin/forums.php:409 includes/admin/metaboxes.php:50
723
+ #: includes/admin/metaboxes.php:380 includes/admin/metaboxes.php:434
724
+ #: includes/admin/replies.php:570 includes/admin/settings.php:293
725
+ #: includes/admin/topics.php:633 includes/extend/buddypress/groups.php:52
726
+ #: includes/extend/buddypress/groups.php:53 includes/forums/template.php:49
727
+ #: templates/default/bbpress/loop-forums.php:19
728
+ msgid "Forum"
729
+ msgstr ""
730
+
731
+ #: includes/admin/forums.php:410 includes/admin/settings.php:222
732
+ #: includes/admin/settings.php:243 includes/admin/topics.php:632
733
+ #: includes/extend/buddypress/activity.php:354
734
+ #: includes/forums/template.php:2589 includes/topics/template.php:47
735
+ #: includes/topics/template.php:48
736
+ #: templates/default/bbpress/content-statistics.php:27
737
+ #: templates/default/bbpress/loop-forums.php:20
738
+ msgid "Topics"
739
+ msgstr ""
740
+
741
+ #: includes/admin/forums.php:411 includes/admin/settings.php:230
742
+ #: includes/admin/settings.php:251 includes/admin/topics.php:634
743
+ #: includes/core/theme-compat.php:646
744
+ #: includes/extend/buddypress/activity.php:355
745
+ #: includes/forums/template.php:2653 includes/replies/template.php:47
746
+ #: includes/replies/template.php:48
747
+ #: templates/default/bbpress/content-statistics.php:32
748
+ #: templates/default/bbpress/loop-forums.php:21
749
+ #: templates/default/bbpress/loop-replies.php:32
750
+ #: templates/default/bbpress/loop-replies.php:70
751
+ #: templates/default/bbpress/loop-topics.php:21
752
+ msgid "Replies"
753
+ msgstr ""
754
+
755
  #: includes/admin/forums.php:412
756
  #: templates/default/bbpress/content-single-topic-lead.php:18
757
  #: templates/default/bbpress/content-single-topic-lead.php:90
769
  msgid "Freshness"
770
  msgstr ""
771
 
772
+ #: includes/admin/forums.php:463 includes/forums/template.php:588
773
  msgid "No Topics"
774
  msgstr ""
775
 
828
  msgid "Discussion"
829
  msgstr ""
830
 
831
+ #: includes/admin/metaboxes.php:67 includes/admin/metaboxes.php:458
832
+ #: includes/admin/replies.php:571 includes/admin/settings.php:301
833
+ #: includes/topics/template.php:49
834
+ #: templates/default/bbpress/content-single-topic-lead.php:22
835
+ #: templates/default/bbpress/content-single-topic-lead.php:94
836
+ #: templates/default/bbpress/loop-topics.php:19
837
+ msgid "Topic"
838
+ msgid_plural "Topics"
839
+ msgstr[0] ""
840
+ msgstr[1] ""
841
+
842
+ #: includes/admin/metaboxes.php:84 includes/admin/settings.php:325
843
+ #: includes/replies/template.php:49 includes/replies/template.php:1619
844
+ #: includes/topics/template.php:2923
845
+ msgid "Reply"
846
+ msgid_plural "Replies"
847
+ msgstr[0] ""
848
+ msgstr[1] ""
849
+
850
+ #: includes/admin/metaboxes.php:103 includes/admin/settings.php:309
851
+ #: includes/topics/template.php:3369
852
+ msgid "Topic Tag"
853
+ msgid_plural "Topic Tags"
854
+ msgstr[0] ""
855
+ msgstr[1] ""
856
+
857
  #: includes/admin/metaboxes.php:127
858
  msgid "Users &amp; Moderation"
859
  msgstr ""
887
  msgstr ""
888
 
889
  #: includes/admin/metaboxes.php:261 includes/admin/metaboxes.php:262
890
+ #: includes/admin/metaboxes.php:355
891
  msgid "Type:"
892
  msgstr ""
893
 
894
  #: includes/admin/metaboxes.php:273 includes/admin/metaboxes.php:274
895
+ #: includes/admin/metaboxes.php:367
896
  #: templates/default/bbpress/form-forum.php:100
897
  msgid "Status:"
898
  msgstr ""
910
  msgid "Forum Parent"
911
  msgstr ""
912
 
913
+ #: includes/admin/metaboxes.php:314 includes/admin/metaboxes.php:394
914
+ #: includes/admin/metaboxes.php:448
915
  msgid "&mdash; No parent &mdash;"
916
  msgstr ""
917
 
918
+ #: includes/admin/metaboxes.php:321
919
  msgid "Order:"
920
  msgstr ""
921
 
922
+ #: includes/admin/metaboxes.php:322
923
  msgid "Forum Order"
924
  msgstr ""
925
 
926
+ #: includes/admin/metaboxes.php:356
927
  msgid "Topic Type"
928
  msgstr ""
929
 
930
+ #: includes/admin/metaboxes.php:368
931
  msgid "Select whether to open or close the topic."
932
  msgstr ""
933
 
934
+ #: includes/admin/metaboxes.php:379 includes/admin/metaboxes.php:433
935
+ #: includes/extend/buddypress/groups.php:1038 includes/topics/template.php:61
936
+ #: templates/default/bbpress/form-topic.php:114
937
+ msgid "Forum:"
938
+ msgstr ""
939
+
940
+ #: includes/admin/metaboxes.php:457 includes/replies/template.php:61
941
+ msgid "Topic:"
942
  msgstr ""
943
 
944
  #: includes/admin/metaboxes.php:463
945
+ msgid "Reply To:"
946
+ msgstr ""
947
+
948
+ #: includes/admin/metaboxes.php:464
949
  msgid "Reply To"
950
  msgstr ""
951
 
952
+ #: includes/admin/metaboxes.php:496
953
  #: templates/default/bbpress/form-topic-tag.php:35
954
  msgid "Name:"
955
  msgstr ""
956
 
957
+ #: includes/admin/metaboxes.php:497
958
  #: templates/default/bbpress/form-user-edit.php:14
959
  #: templates/default/bbpress/form-user-edit.php:19
960
  msgid "Name"
961
  msgstr ""
962
 
963
+ #: includes/admin/metaboxes.php:502
964
  msgid "Email:"
965
  msgstr ""
966
 
967
+ #: includes/admin/metaboxes.php:503
968
  #: templates/default/bbpress/form-user-edit.php:103
969
  #: templates/default/bbpress/form-user-register.php:28
970
  msgid "Email"
971
  msgstr ""
972
 
973
+ #: includes/admin/metaboxes.php:508
974
  #: templates/default/bbpress/form-anonymous.php:32
975
  msgid "Website:"
976
  msgstr ""
977
 
978
+ #: includes/admin/metaboxes.php:509
979
  #: templates/default/bbpress/form-user-edit.php:57
980
  msgid "Website"
981
  msgstr ""
982
 
983
+ #: includes/admin/metaboxes.php:516
984
  msgid "ID:"
985
  msgstr ""
986
 
987
+ #: includes/admin/metaboxes.php:517
988
  msgid "ID"
989
  msgstr ""
990
 
991
+ #: includes/admin/metaboxes.php:524
992
  msgid "IP:"
993
  msgstr ""
994
 
995
+ #: includes/admin/metaboxes.php:525
996
  msgid "IP Address"
997
  msgstr ""
998
 
1226
  msgstr ""
1227
 
1228
  #: includes/admin/replies.php:739 includes/admin/topics.php:810
1229
+ #: includes/replies/template.php:2103 includes/topics/template.php:2874
1230
  msgid "Spam"
1231
  msgstr ""
1232
 
1233
  #: includes/admin/replies.php:748 includes/admin/topics.php:818
1234
+ #: includes/replies/template.php:2045 includes/topics/template.php:2630
1235
  msgid "Restore this item from the Trash"
1236
  msgstr ""
1237
 
1238
  #: includes/admin/replies.php:748 includes/admin/topics.php:818
1239
+ #: includes/replies/template.php:2033 includes/topics/template.php:2618
1240
  msgid "Restore"
1241
  msgstr ""
1242
 
1243
  #: includes/admin/replies.php:750 includes/admin/topics.php:820
1244
+ #: includes/replies/template.php:2047 includes/topics/template.php:2632
1245
  msgid "Move this item to the Trash"
1246
  msgstr ""
1247
 
1248
  #: includes/admin/replies.php:750 includes/admin/topics.php:820
1249
+ #: includes/replies/template.php:2032 includes/topics/template.php:2617
1250
  msgid "Trash"
1251
  msgstr ""
1252
 
1253
  #: includes/admin/replies.php:754 includes/admin/topics.php:824
1254
+ #: includes/replies/template.php:2051 includes/topics/template.php:2636
1255
  msgid "Delete this item permanently"
1256
  msgstr ""
1257
 
1362
  msgid "Revisions"
1363
  msgstr ""
1364
 
1365
+ #: includes/admin/settings.php:142 includes/extend/buddypress/loader.php:218
1366
  #: templates/default/bbpress/user-details.php:48
1367
  msgid "Favorites"
1368
  msgstr ""
1369
 
1370
+ #: includes/admin/settings.php:150 includes/extend/buddypress/loader.php:230
1371
  #: templates/default/bbpress/user-details.php:58
1372
  msgid "Subscriptions"
1373
  msgstr ""
1376
  msgid "Topic tags"
1377
  msgstr ""
1378
 
1379
+ #: includes/admin/settings.php:166 includes/admin/settings.php:333
1380
+ #: includes/common/template.php:2314 includes/search/template.php:225
1381
+ #: templates/default/bbpress/form-search.php:17
1382
+ msgid "Search"
1383
+ msgstr ""
1384
+
1385
  #: includes/admin/settings.php:174
1386
  msgid "Post Formatting"
1387
  msgstr ""
1418
  msgid "User Base"
1419
  msgstr ""
1420
 
1421
+ #: includes/admin/settings.php:354 includes/extend/buddypress/loader.php:196
1422
+ #: includes/extend/buddypress/loader.php:269
1423
  #: templates/default/bbpress/user-details.php:35
1424
  msgid "Topics Started"
1425
  msgstr ""
1426
 
1427
+ #: includes/admin/settings.php:362 includes/extend/buddypress/loader.php:207
1428
+ #: includes/extend/buddypress/loader.php:277
1429
  #: templates/default/bbpress/user-details.php:41
1430
  msgid "Replies Created"
1431
  msgstr ""
1432
 
1433
+ #: includes/admin/settings.php:370 includes/extend/buddypress/loader.php:285
1434
  msgid "Favorite Topics"
1435
  msgstr ""
1436
 
1973
  msgstr ""
1974
 
1975
  #: includes/admin/tools.php:176
1976
+ msgid "Remove trashed forums from user subscriptions"
1977
+ msgstr ""
1978
+
1979
+ #: includes/admin/tools.php:177
1980
  msgid "Remap existing users to default forum roles"
1981
  msgstr ""
1982
 
1983
+ #: includes/admin/tools.php:197
1984
  msgid "Counting the number of replies in each topic&hellip; %s"
1985
  msgstr ""
1986
 
1987
+ #: includes/admin/tools.php:198 includes/admin/tools.php:241
1988
+ #: includes/admin/tools.php:283 includes/admin/tools.php:328
1989
+ #: includes/admin/tools.php:445 includes/admin/tools.php:479
1990
+ #: includes/admin/tools.php:511 includes/admin/tools.php:556
1991
+ #: includes/admin/tools.php:601 includes/admin/tools.php:663
1992
+ #: includes/admin/tools.php:724 includes/admin/tools.php:792
1993
+ #: includes/admin/tools.php:840 includes/admin/tools.php:946
1994
+ #: includes/admin/tools.php:1006 includes/admin/tools.php:1027
1995
+ #: includes/admin/tools.php:1081
1996
  msgid "Failed!"
1997
  msgstr ""
1998
 
1999
+ #: includes/admin/tools.php:224 includes/admin/tools.php:267
2000
+ #: includes/admin/tools.php:293 includes/admin/tools.php:460
2001
+ #: includes/admin/tools.php:494 includes/admin/tools.php:539
2002
+ #: includes/admin/tools.php:584 includes/admin/tools.php:646
2003
+ #: includes/admin/tools.php:707 includes/admin/tools.php:768
2004
+ #: includes/admin/tools.php:930 includes/admin/tools.php:987
2005
+ #: includes/admin/tools.php:1010 includes/admin/tools.php:1065
2006
+ #: includes/admin/tools.php:1110
2007
  msgid "Complete!"
2008
  msgstr ""
2009
 
2010
+ #: includes/admin/tools.php:240
2011
  msgid "Counting the number of voices in each topic&hellip; %s"
2012
  msgstr ""
2013
 
2014
+ #: includes/admin/tools.php:282
2015
  msgid ""
2016
  "Counting the number of spammed and trashed replies in each topic&hellip; %s"
2017
  msgstr ""
2018
 
2019
+ #: includes/admin/tools.php:307
2020
  msgid "Repairing BuddyPress group-forum relationships&hellip; %s"
2021
  msgstr ""
2022
 
2023
+ #: includes/admin/tools.php:408
2024
  msgid "Group Forums"
2025
  msgstr ""
2026
 
2027
+ #: includes/admin/tools.php:409
2028
  msgid "group-forums"
2029
  msgstr ""
2030
 
2031
+ #: includes/admin/tools.php:425
2032
  msgid ""
2033
  "Complete! %s groups updated; %s forums updated; %s forum statuses synced."
2034
  msgstr ""
2035
 
2036
+ #: includes/admin/tools.php:444
2037
  msgid "Counting the number of topics in each forum&hellip; %s"
2038
  msgstr ""
2039
 
2040
+ #: includes/admin/tools.php:478
2041
  msgid "Counting the number of replies in each forum&hellip; %s"
2042
  msgstr ""
2043
 
2044
+ #: includes/admin/tools.php:510
2045
  msgid "Counting the number of topics each user has created&hellip; %s"
2046
  msgstr ""
2047
 
2048
+ #: includes/admin/tools.php:555
2049
  msgid "Counting the number of topics to which each user has replied&hellip; %s"
2050
  msgstr ""
2051
 
2052
+ #: includes/admin/tools.php:600
2053
  msgid "Removing trashed topics from user favorites&hellip; %s"
2054
  msgstr ""
2055
 
2056
+ #: includes/admin/tools.php:630 includes/admin/tools.php:691
2057
+ #: includes/admin/tools.php:752
2058
  msgid "Nothing to remove!"
2059
  msgstr ""
2060
 
2061
+ #: includes/admin/tools.php:662
2062
  msgid "Removing trashed topics from user subscriptions&hellip; %s"
2063
  msgstr ""
2064
 
2065
  #: includes/admin/tools.php:723
2066
+ msgid "Removing trashed forums from user subscriptions&hellip; %s"
2067
+ msgstr ""
2068
+
2069
+ #: includes/admin/tools.php:785
2070
  msgid "Remapping forum role for each user on this site&hellip; %s"
2071
  msgstr ""
2072
 
2073
+ #: includes/admin/tools.php:823
2074
  msgid "Complete! %s users updated."
2075
  msgstr ""
2076
 
2077
+ #: includes/admin/tools.php:839
2078
  msgid "Recomputing latest post in every topic and forum&hellip; %s"
2079
  msgstr ""
2080
 
2081
+ #: includes/admin/tools.php:945
2082
  msgid "Repairing the sticky topic to the parent forum relationships&hellip; %s"
2083
  msgstr ""
2084
 
2085
+ #: includes/admin/tools.php:1002
2086
  msgid "Recalculating forum visibility &hellip; %s"
2087
  msgstr ""
2088
 
2089
+ #: includes/admin/tools.php:1026
2090
  msgid "Recalculating the forum for each post &hellip; %s"
2091
  msgstr ""
2092
 
2093
+ #: includes/admin/tools.php:1080
2094
  msgid "Recalculating the topic for each post &hellip; %s"
2095
  msgstr ""
2096
 
2097
+ #: includes/admin/tools.php:1133
2098
  msgid ""
2099
+ "Revert your forums back to a brand new installation. This process cannot be "
2100
+ "undone."
2101
+ msgstr ""
2102
+
2103
+ #: includes/admin/tools.php:1134
2104
+ msgid "Backup your database before proceeding."
2105
  msgstr ""
2106
 
2107
+ #: includes/admin/tools.php:1140
2108
  msgid "The following data will be removed:"
2109
  msgstr ""
2110
 
2111
+ #: includes/admin/tools.php:1142 includes/forums/template.php:50
2112
+ msgid "All Forums"
2113
+ msgstr ""
2114
+
2115
+ #: includes/admin/tools.php:1143 includes/topics/functions.php:3440
2116
+ #: includes/topics/template.php:50
2117
+ msgid "All Topics"
2118
+ msgstr ""
2119
+
2120
+ #: includes/admin/tools.php:1144 includes/replies/functions.php:1994
2121
+ #: includes/replies/template.php:50
2122
+ msgid "All Replies"
2123
+ msgstr ""
2124
+
2125
+ #: includes/admin/tools.php:1145
2126
  msgid "All Topic Tags"
2127
  msgstr ""
2128
 
2129
+ #: includes/admin/tools.php:1146
2130
  msgid "Related Meta Data"
2131
  msgstr ""
2132
 
2133
+ #: includes/admin/tools.php:1147
2134
  msgid "Forum Settings"
2135
  msgstr ""
2136
 
2137
+ #: includes/admin/tools.php:1148
2138
  msgid "Forum Activity"
2139
  msgstr ""
2140
 
2141
+ #: includes/admin/tools.php:1149
2142
  msgid "Forum User Roles"
2143
  msgstr ""
2144
 
2145
+ #: includes/admin/tools.php:1150
2146
  msgid "Importer Helper Data"
2147
  msgstr ""
2148
 
2149
+ #: includes/admin/tools.php:1154
2150
+ msgid "Delete imported users?"
2151
  msgstr ""
2152
 
2153
+ #: includes/admin/tools.php:1157 includes/admin/tools.php:1167
2154
  msgid "Say it ain't so!"
2155
  msgstr ""
2156
 
2157
+ #: includes/admin/tools.php:1158
2158
+ msgid ""
2159
+ "This option will delete all previously imported users, and cannot be undone."
2160
+ msgstr ""
2161
+
2162
+ #: includes/admin/tools.php:1159
2163
+ msgid ""
2164
+ "Note: Resetting without this checked will delete the meta-data necessary to "
2165
+ "delete these users."
2166
+ msgstr ""
2167
+
2168
+ #: includes/admin/tools.php:1164
2169
+ msgid "Are you sure you want to do this?"
2170
+ msgstr ""
2171
+
2172
+ #: includes/admin/tools.php:1168
2173
  msgid "This process cannot be undone."
2174
  msgstr ""
2175
 
2176
+ #: includes/admin/tools.php:1169
2177
+ msgid "Human sacrifice, dogs and cats living together... mass hysteria!"
2178
+ msgstr ""
2179
+
2180
+ #: includes/admin/tools.php:1177
2181
  msgid "Reset bbPress"
2182
  msgstr ""
2183
 
2184
+ #: includes/admin/tools.php:1210
2185
  msgid "Failed"
2186
  msgstr ""
2187
 
2188
+ #: includes/admin/tools.php:1211
2189
  msgid "Success!"
2190
  msgstr ""
2191
 
2192
+ #: includes/admin/tools.php:1218
2193
  msgid "Deleting Posts&hellip; %s"
2194
  msgstr ""
2195
 
2196
+ #: includes/admin/tools.php:1231
2197
  msgid "Deleting Post Meta&hellip; %s"
2198
  msgstr ""
2199
 
2200
+ #: includes/admin/tools.php:1240
2201
  msgid "Deleting Topic Tags&hellip; %s"
2202
  msgstr ""
2203
 
2204
+ #: includes/admin/tools.php:1255
2205
+ msgid "Deleting User&hellip; %s"
2206
+ msgstr ""
2207
+
2208
+ #: includes/admin/tools.php:1260 includes/admin/tools.php:1268
2209
  msgid "Deleting User Meta&hellip; %s"
2210
  msgstr ""
2211
 
2212
+ #: includes/admin/tools.php:1276
2213
  msgid "Deleting Conversion Table&hellip; %s"
2214
  msgstr ""
2215
 
2216
+ #: includes/admin/tools.php:1288
2217
  msgid "Deleting Settings&hellip; %s"
2218
  msgstr ""
2219
 
2220
+ #: includes/admin/tools.php:1294
2221
  msgid "Deleting Roles and Capabilities&hellip; %s"
2222
  msgstr ""
2223
 
2457
  msgid "(No Forum)"
2458
  msgstr ""
2459
 
2460
+ #: includes/admin/topics.php:730 includes/topics/template.php:2064
2461
  msgid "No Replies"
2462
  msgstr ""
2463
 
2483
  msgid "Unstick this topic"
2484
  msgstr ""
2485
 
2486
+ #: includes/admin/topics.php:798 includes/topics/template.php:2748
2487
  msgid "Unstick"
2488
  msgstr ""
2489
 
2491
  msgid "Stick this topic to its forum"
2492
  msgstr ""
2493
 
2494
+ #: includes/admin/topics.php:801 includes/topics/template.php:2747
2495
  msgid "Stick"
2496
  msgstr ""
2497
 
2499
  msgid "Stick this topic to front"
2500
  msgstr ""
2501
 
2502
+ #: includes/admin/topics.php:801 includes/topics/template.php:2749
2503
  msgid "(to front)"
2504
  msgstr ""
2505
 
2552
  msgstr ""
2553
 
2554
  #: includes/admin/users.php:96 includes/admin/users.php:100
2555
+ #: includes/users/template.php:1290
2556
  msgid "&mdash; No role for these forums &mdash;"
2557
  msgstr ""
2558
 
2653
  msgid "<strong>ERROR</strong>: Invalid email address submitted!"
2654
  msgstr ""
2655
 
2656
+ #: includes/common/functions.php:1074
2657
  msgid ""
2658
  "%1$s wrote:\n"
2659
  "\n"
2668
  "Login and visit the topic to unsubscribe from these emails."
2669
  msgstr ""
2670
 
2671
+ #: includes/common/functions.php:1193
2672
+ msgid ""
2673
+ "%1$s wrote:\n"
2674
+ "\n"
2675
+ "%2$s\n"
2676
+ "\n"
2677
+ "Topic Link: %3$s\n"
2678
+ "\n"
2679
+ "-----------\n"
2680
+ "\n"
2681
+ "You are receiving this email because you subscribed to a forum.\n"
2682
+ "\n"
2683
+ "Login and visit the topic to unsubscribe from these emails."
2684
+ msgstr ""
2685
+
2686
+ #: includes/common/functions.php:1905
2687
  msgid ""
2688
  "Conditional query tags do not work before the query is run. Before then, "
2689
  "they always return false."
2690
  msgstr ""
2691
 
2692
+ #: includes/common/template.php:1441
2693
  msgid "No topics available"
2694
  msgstr ""
2695
 
2696
+ #: includes/common/template.php:1446
2697
  msgid "No forums available"
2698
  msgstr ""
2699
 
2700
+ #: includes/common/template.php:1451
2701
  msgid "None available"
2702
  msgstr ""
2703
 
2704
+ #: includes/common/template.php:2122
 
 
 
 
 
 
2705
  msgid "Home"
2706
  msgstr ""
2707
 
2708
+ #: includes/common/template.php:2192
2709
  msgid "(Edit)"
2710
  msgstr ""
2711
 
2712
+ #: includes/common/template.php:2196 includes/common/template.php:2310
2713
+ #: includes/common/template.php:2575 includes/core/theme-compat.php:739
2714
  #: templates/default/extras/taxonomy-topic-tag-edit.php:17
2715
  #: templates/default/extras/taxonomy-topic-tag.php:17
2716
  msgid "Topic Tag: %s"
2717
  msgstr ""
2718
 
2719
+ #: includes/common/template.php:2200 includes/forums/template.php:53
2720
+ #: includes/replies/template.php:53 includes/replies/template.php:1908
2721
+ #: includes/topics/template.php:53 includes/topics/template.php:2493
2722
+ #: templates/default/bbpress/user-details.php:65
2723
+ msgid "Edit"
2724
+ msgstr ""
2725
+
2726
+ #: includes/common/template.php:2217
2727
  msgid "&lsaquo;"
2728
  msgstr ""
2729
 
2730
+ #: includes/common/template.php:2217
2731
  msgid "&rsaquo;"
2732
  msgstr ""
2733
 
2734
+ #: includes/common/template.php:2485
2735
  msgid "Log Out"
2736
  msgstr ""
2737
 
2738
+ #: includes/common/template.php:2539
2739
  msgid "Forum Edit: %s"
2740
  msgstr ""
2741
 
2742
+ #: includes/common/template.php:2544
2743
  msgid "Topic Edit: %s"
2744
  msgstr ""
2745
 
2746
+ #: includes/common/template.php:2549
2747
  msgid "Reply Edit: %s"
2748
  msgstr ""
2749
 
2750
+ #: includes/common/template.php:2554
2751
  msgid "Topic Tag Edit: %s"
2752
  msgstr ""
2753
 
2754
+ #: includes/common/template.php:2561
2755
  msgid "Forum: %s"
2756
  msgstr ""
2757
 
2758
+ #: includes/common/template.php:2566
2759
  msgid "Topic: %s"
2760
  msgstr ""
2761
 
2762
+ #: includes/common/template.php:2584
2763
+ msgctxt "User viewing his/her own profile"
2764
+ msgid "Your"
2765
  msgstr ""
2766
 
2767
+ #: includes/common/template.php:2593
2768
+ msgid "%s's Topics"
2769
+ msgstr ""
2770
+
2771
+ #: includes/common/template.php:2597
2772
+ msgid "%s's Replies"
2773
+ msgstr ""
2774
+
2775
+ #: includes/common/template.php:2601
2776
+ #: templates/default/bbpress/user-details.php:48
2777
+ msgid "%s's Favorites"
2778
+ msgstr ""
2779
+
2780
+ #: includes/common/template.php:2605
2781
+ #: templates/default/bbpress/user-details.php:58
2782
+ msgid "%s's Subscriptions"
2783
+ msgstr ""
2784
+
2785
+ #: includes/common/template.php:2609
2786
  #: templates/default/bbpress/user-details.php:29
2787
  msgid "%s's Profile"
2788
  msgstr ""
2789
 
2790
+ #: includes/common/template.php:2617
2791
  msgid "Edit Your Profile"
2792
  msgstr ""
2793
 
2794
+ #: includes/common/template.php:2622
2795
  #: templates/default/bbpress/user-details.php:65
2796
  msgid "Edit %s's Profile"
2797
  msgstr ""
2798
 
2799
+ #: includes/common/template.php:2630
2800
  msgid "View: %s"
2801
  msgstr ""
2802
 
2844
  #: includes/common/widgets.php:185 includes/common/widgets.php:337
2845
  #: includes/common/widgets.php:465 includes/common/widgets.php:634
2846
  #: includes/common/widgets.php:876 includes/common/widgets.php:1030
2847
+ #: includes/common/widgets.php:1234
2848
  msgid "Title:"
2849
  msgstr ""
2850
 
2872
  msgid "(bbPress) Forum Search Form"
2873
  msgstr ""
2874
 
2875
+ #: includes/common/widgets.php:483 includes/forums/template.php:58
2876
+ msgid "Search Forums"
2877
+ msgstr ""
2878
+
2879
  #: includes/common/widgets.php:512
2880
  msgid "A list of forums with an option to set the parent."
2881
  msgstr ""
2909
  msgid "Maximum topics to show:"
2910
  msgstr ""
2911
 
2912
+ #: includes/common/widgets.php:889 includes/common/widgets.php:1236
2913
  msgid "Show post date:"
2914
  msgstr ""
2915
 
2959
  msgstr ""
2960
 
2961
  #. translators: 1: reply author, 2: reply link, 3: reply timestamp
2962
+ #: includes/common/widgets.php:1166
2963
  msgctxt "widgets"
2964
  msgid "%1$s on %2$s %3$s"
2965
  msgstr ""
2966
 
2967
  #. translators: 1: reply link, 2: reply timestamp
2968
+ #: includes/common/widgets.php:1172
2969
  msgctxt "widgets"
2970
  msgid "%1$s %2$s"
2971
  msgstr ""
2972
 
2973
  #. translators: 1: reply author, 2: reply link
2974
+ #: includes/common/widgets.php:1178
2975
  msgctxt "widgets"
2976
  msgid "%1$s on %2$s"
2977
  msgstr ""
2978
 
2979
  #. translators: 1: reply link
2980
+ #: includes/common/widgets.php:1184
2981
  msgctxt "widgets"
2982
  msgid "%1$s"
2983
  msgstr ""
2984
 
2985
+ #: includes/common/widgets.php:1235
2986
  msgid "Maximum replies to show:"
2987
  msgstr ""
2988
 
2989
+ #: includes/common/widgets.php:1237
2990
  msgid "Show reply author:"
2991
  msgstr ""
2992
 
2993
+ #: includes/common/widgets.php:1252
2994
  msgid "Recent Replies"
2995
  msgstr ""
2996
 
3135
  msgstr ""
3136
 
3137
  #: includes/extend/buddypress/groups.php:335
3138
+ #: includes/extend/buddypress/groups.php:494
3139
+ #: includes/extend/buddypress/notifications.php:129
3140
+ #: includes/forums/functions.php:118 includes/forums/functions.php:395
3141
+ #: includes/replies/functions.php:116 includes/replies/functions.php:518
3142
+ #: includes/replies/functions.php:1245 includes/topics/functions.php:122
3143
+ #: includes/topics/functions.php:520 includes/topics/functions.php:1153
3144
+ #: includes/topics/functions.php:1456 includes/topics/functions.php:1820
3145
+ #: includes/topics/functions.php:1859 includes/topics/functions.php:1916
3146
+ #: includes/users/functions.php:459 includes/users/functions.php:1174
3147
+ #: includes/users/functions.php:1280 includes/users/functions.php:1407
3148
+ #: includes/users/functions.php:1413
3149
  msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
3150
  msgstr ""
3151
 
3162
  msgid "This group does not currently have a forum."
3163
  msgstr ""
3164
 
3165
+ #: includes/extend/buddypress/loader.php:105
3166
  msgid "Search Forums..."
3167
  msgstr ""
3168
 
3169
+ #: includes/extend/buddypress/loader.php:293
3170
+ #: templates/default/bbpress/user-subscriptions.php:34
3171
  msgid "Subscribed Topics"
3172
  msgstr ""
3173
 
3174
+ #: includes/extend/buddypress/notifications.php:23
3175
+ msgid "Topic Replies"
3176
+ msgstr ""
3177
+
3178
+ #: includes/extend/buddypress/notifications.php:26
3179
+ msgid "You have %d new replies"
3180
+ msgstr ""
3181
+
3182
+ #: includes/extend/buddypress/notifications.php:30
3183
+ msgid "You have %d new reply to %2$s from %3$s"
3184
+ msgstr ""
3185
+
3186
+ #: includes/extend/buddypress/notifications.php:32
3187
+ msgid "You have %d new reply to %s"
3188
+ msgstr ""
3189
+
3190
+ #: includes/extend/buddypress/notifications.php:133
3191
+ msgid ""
3192
+ "<strong>ERROR</strong>: You do not have permission to mark notifications for "
3193
+ "that user."
3194
+ msgstr ""
3195
+
3196
  #: includes/forums/functions.php:131
3197
  msgid ""
3198
  "<strong>ERROR</strong>: You do not have permission to create new forums."
3199
  msgstr ""
3200
 
3201
+ #: includes/forums/functions.php:155 includes/forums/functions.php:455
3202
  msgid "<strong>ERROR</strong>: Your forum needs a title."
3203
  msgstr ""
3204
 
3205
+ #: includes/forums/functions.php:167 includes/forums/functions.php:467
3206
  msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
3207
  msgstr ""
3208
 
3209
+ #: includes/forums/functions.php:181
3210
  msgid "<strong>ERROR</strong>: Your forum must have a parent."
3211
  msgstr ""
3212
 
3213
+ #: includes/forums/functions.php:188
3214
  msgid ""
3215
  "<strong>ERROR</strong>: This forum is a category. No forums can be created "
3216
  "in this forum."
3217
  msgstr ""
3218
 
3219
+ #: includes/forums/functions.php:193 includes/forums/functions.php:431
3220
  msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
3221
  msgstr ""
3222
 
3223
+ #: includes/forums/functions.php:198 includes/forums/functions.php:436
3224
  msgid ""
3225
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3226
  "capability to read or create new forums in it."
3227
  msgstr ""
3228
 
3229
+ #: includes/forums/functions.php:203 includes/forums/functions.php:441
3230
  msgid ""
3231
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3232
  "capability to read or create new forums in it."
3233
  msgstr ""
3234
 
3235
+ #: includes/forums/functions.php:210 includes/replies/functions.php:293
3236
  #: includes/topics/functions.php:260
3237
  msgid "<strong>ERROR</strong>: Slow down; you move too fast."
3238
  msgstr ""
3239
 
3240
+ #: includes/forums/functions.php:215
3241
  msgid "<strong>ERROR</strong>: This forum already exists."
3242
  msgstr ""
3243
 
3244
+ #: includes/forums/functions.php:220
3245
  msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
3246
  msgstr ""
3247
 
3248
+ #: includes/forums/functions.php:384
3249
  msgid "<strong>ERROR</strong>: Forum ID not found."
3250
  msgstr ""
3251
 
3252
+ #: includes/forums/functions.php:400
3253
  msgid "<strong>ERROR</strong>: The forum you want to edit was not found."
3254
  msgstr ""
3255
 
3256
+ #: includes/forums/functions.php:405
3257
  msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
3258
  msgstr ""
3259
 
3260
+ #: includes/forums/functions.php:472
3261
  msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
3262
  msgstr ""
3263
 
3264
+ #: includes/forums/functions.php:1602
3265
  msgctxt "Open the forum"
3266
  msgid "Open"
3267
  msgstr ""
3268
 
3269
+ #: includes/forums/functions.php:1603
3270
  msgctxt "Close the forum"
3271
  msgid "Closed"
3272
  msgstr ""
3273
 
3274
+ #: includes/forums/functions.php:1616
3275
  msgctxt "Forum accepts new topics"
3276
  msgid "Forum"
3277
  msgstr ""
3278
 
3279
+ #: includes/forums/functions.php:1617
3280
  msgctxt "Forum is a category"
3281
  msgid "Category"
3282
  msgstr ""
3283
 
3284
+ #: includes/forums/functions.php:1630
3285
  msgctxt "Make forum public"
3286
  msgid "Public"
3287
  msgstr ""
3288
 
3289
+ #: includes/forums/functions.php:1631
3290
  msgctxt "Make forum private"
3291
  msgid "Private"
3292
  msgstr ""
3293
 
3294
+ #: includes/forums/functions.php:1632
3295
  msgctxt "Make forum hidden"
3296
  msgid "Hidden"
3297
  msgstr ""
3298
 
3299
+ #: includes/forums/template.php:51 includes/forums/template.php:55
3300
+ msgid "New Forum"
3301
+ msgstr ""
3302
+
3303
+ #: includes/forums/template.php:52 templates/default/bbpress/form-forum.php:37
3304
+ msgid "Create New Forum"
3305
+ msgstr ""
3306
+
3307
+ #: includes/forums/template.php:54
3308
+ msgid "Edit Forum"
3309
+ msgstr ""
3310
+
3311
+ #: includes/forums/template.php:56 includes/forums/template.php:57
3312
+ msgid "View Forum"
3313
+ msgstr ""
3314
+
3315
+ #: includes/forums/template.php:59
3316
+ msgid "No forums found"
3317
+ msgstr ""
3318
+
3319
+ #: includes/forums/template.php:60
3320
+ msgid "No forums found in Trash"
3321
+ msgstr ""
3322
+
3323
+ #: includes/forums/template.php:61
3324
+ #: templates/default/bbpress/form-forum.php:118
3325
+ msgid "Parent Forum:"
3326
+ msgstr ""
3327
+
3328
+ #: includes/forums/template.php:827 includes/topics/template.php:1846
3329
+ #: includes/users/template.php:1058
3330
+ msgid "Subscribe"
3331
+ msgstr ""
3332
+
3333
+ #: includes/forums/template.php:828 includes/topics/template.php:1847
3334
+ #: includes/users/template.php:1059
3335
+ msgid "Unsubscribe"
3336
+ msgstr ""
3337
+
3338
+ #: includes/forums/template.php:1226 includes/forums/template.php:1964
3339
  msgid "%s topic"
3340
  msgid_plural "%s topics"
3341
  msgstr[0] ""
3342
  msgstr[1] ""
3343
 
3344
+ #: includes/forums/template.php:1242 includes/topics/template.php:2120
3345
  msgid " (+ %d hidden)"
3346
  msgstr ""
3347
 
3348
+ #: includes/forums/template.php:1953 includes/topics/template.php:2104
3349
  msgid "%s reply"
3350
  msgid_plural "%s replies"
3351
  msgstr[0] ""
3352
  msgstr[1] ""
3353
 
3354
+ #: includes/forums/template.php:1973
3355
  msgid ""
3356
  "This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
3357
  msgstr ""
3358
 
3359
+ #: includes/forums/template.php:1975
3360
  msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
3361
  msgstr ""
3362
 
3363
+ #: includes/forums/template.php:1981
3364
  msgid "This category contains %1$s, and was last updated by %2$s %3$s."
3365
  msgstr ""
3366
 
3367
+ #: includes/forums/template.php:1983
3368
  msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
3369
  msgstr ""
3370
 
3371
+ #: includes/forums/template.php:1993
3372
  msgid "This category contains %1$s and %2$s."
3373
  msgstr ""
3374
 
3375
+ #: includes/forums/template.php:1995
3376
  msgid "This forum contains %1$s and %2$s."
3377
  msgstr ""
3378
 
3379
+ #: includes/forums/template.php:2003
3380
  msgid "This category contains %1$s."
3381
  msgstr ""
3382
 
3383
+ #: includes/forums/template.php:2005
3384
  msgid "This forum contains %1$s."
3385
  msgstr ""
3386
 
3387
+ #: includes/forums/template.php:2009
3388
  msgid "This forum is empty."
3389
  msgstr ""
3390
 
3426
  msgid "<strong>ERROR</strong>: Forum does not exist."
3427
  msgstr ""
3428
 
3429
+ #: includes/replies/functions.php:227 includes/replies/functions.php:574
3430
  msgid ""
3431
  "<strong>ERROR</strong>: This forum is a category. No replies can be created "
3432
  "in this forum."
3433
  msgstr ""
3434
 
3435
+ #: includes/replies/functions.php:234 includes/replies/functions.php:581
3436
  msgid "<strong>ERROR</strong>: This forum has been closed to new replies."
3437
  msgstr ""
3438
 
3439
+ #: includes/replies/functions.php:240 includes/replies/functions.php:587
3440
  msgid ""
3441
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3442
  "capability to read or create new replies in it."
3443
  msgstr ""
3444
 
3445
+ #: includes/replies/functions.php:246 includes/replies/functions.php:593
3446
  msgid ""
3447
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3448
  "capability to read or create new replies in it."
3449
  msgstr ""
3450
 
3451
+ #: includes/replies/functions.php:288 includes/replies/functions.php:617
 
 
 
 
3452
  msgid "<strong>ERROR</strong>: Your reply cannot be empty."
3453
  msgstr ""
3454
 
3455
+ #: includes/replies/functions.php:298
3456
  msgid ""
3457
  "<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
3458
  "you&#8217;ve already said that!"
3459
  msgstr ""
3460
 
3461
+ #: includes/replies/functions.php:303
3462
  msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
3463
  msgstr ""
3464
 
3465
+ #: includes/replies/functions.php:320
3466
  msgid "<strong>ERROR</strong>: Topic is closed."
3467
  msgstr ""
3468
 
3469
+ #: includes/replies/functions.php:379 includes/replies/functions.php:701
3470
  msgid ""
3471
  "<strong>ERROR</strong>: There was a problem adding the tags to the topic."
3472
  msgstr ""
3473
 
3474
+ #: includes/replies/functions.php:507
3475
  msgid "<strong>ERROR</strong>: Reply ID not found."
3476
  msgstr ""
3477
 
3478
+ #: includes/replies/functions.php:524
3479
  msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
3480
  msgstr ""
3481
 
3482
+ #: includes/replies/functions.php:535
3483
  msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
3484
  msgstr ""
3485
 
3486
+ #: includes/replies/functions.php:622
3487
  msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
3488
  msgstr ""
3489
 
3490
+ #: includes/replies/functions.php:1222
3491
  msgid "<strong>ERROR</strong>: Reply ID to move not found!"
3492
  msgstr ""
3493
 
3494
+ #: includes/replies/functions.php:1231
3495
  msgid "<strong>ERROR</strong>: The reply you want to move was not found."
3496
  msgstr ""
3497
 
3498
+ #: includes/replies/functions.php:1240
3499
  msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
3500
  msgstr ""
3501
 
3502
+ #: includes/replies/functions.php:1251 includes/topics/functions.php:1164
3503
  #: includes/topics/functions.php:1462
3504
  msgid ""
3505
  "<strong>ERROR</strong>: You do not have the permissions to edit the source "
3506
  "topic."
3507
  msgstr ""
3508
 
3509
+ #: includes/replies/functions.php:1261
3510
  msgid "<strong>ERROR</strong>: You need to choose a valid move option."
3511
  msgstr ""
3512
 
3513
+ #: includes/replies/functions.php:1274 includes/topics/functions.php:1483
3514
  msgid "<strong>ERROR</strong>: Destination topic ID not found!"
3515
  msgstr ""
3516
 
3517
+ #: includes/replies/functions.php:1284
3518
  msgid "<strong>ERROR</strong>: The topic you want to move to was not found!"
3519
  msgstr ""
3520
 
3521
+ #: includes/replies/functions.php:1289 includes/topics/functions.php:1496
3522
  msgid ""
3523
  "<strong>ERROR</strong>: You do not have the permissions to edit the "
3524
  "destination topic!"
3525
  msgstr ""
3526
 
3527
+ #: includes/replies/functions.php:1298 includes/replies/template.php:571
3528
+ #: includes/topics/functions.php:1294 includes/topics/functions.php:1652
3529
+ #: templates/default/bbpress/form-reply.php:29
3530
+ msgid "Reply To: %s"
3531
+ msgstr ""
3532
+
3533
+ #: includes/replies/functions.php:1343 includes/topics/functions.php:1533
3534
  msgid ""
3535
  "<strong>ERROR</strong>: There was a problem converting the reply into the "
3536
  "topic. Please try again."
3537
  msgstr ""
3538
 
3539
+ #: includes/replies/functions.php:1348 includes/topics/functions.php:1538
3540
  msgid ""
3541
  "<strong>ERROR</strong>: You do not have the permissions to create new "
3542
  "topics. The reply could not be converted into a topic."
3543
  msgstr ""
3544
 
3545
+ #: includes/replies/functions.php:1530
3546
  msgid "<strong>ERROR:</strong> You do not have the permission to do that!"
3547
  msgstr ""
3548
 
3549
+ #: includes/replies/functions.php:1543
3550
  msgid ""
3551
  "<strong>ERROR</strong>: There was a problem unmarking the reply as spam!"
3552
  msgstr ""
3553
 
3554
+ #: includes/replies/functions.php:1543
3555
  msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam!"
3556
  msgstr ""
3557
 
3558
+ #: includes/replies/functions.php:1562
3559
  msgid "<strong>ERROR</strong>: There was a problem trashing the reply!"
3560
  msgstr ""
3561
 
3562
+ #: includes/replies/functions.php:1570
3563
  msgid "<strong>ERROR</strong>: There was a problem untrashing the reply!"
3564
  msgstr ""
3565
 
3566
+ #: includes/replies/functions.php:1578
3567
  msgid "<strong>ERROR</strong>: There was a problem deleting the reply!"
3568
  msgstr ""
3569
 
3570
+ #: includes/replies/functions.php:1992
3571
  msgid "All Posts"
3572
  msgstr ""
3573
 
3574
+ #: includes/replies/functions.php:2034 includes/topics/functions.php:3465
3575
  msgid "Replies: %s"
3576
  msgstr ""
3577
 
3578
+ #: includes/replies/template.php:51 includes/replies/template.php:55
3579
+ msgid "New Reply"
3580
+ msgstr ""
3581
+
3582
+ #: includes/replies/template.php:52
3583
+ msgid "Create New Reply"
3584
+ msgstr ""
3585
+
3586
+ #: includes/replies/template.php:54
3587
+ msgid "Edit Reply"
3588
+ msgstr ""
3589
+
3590
+ #: includes/replies/template.php:56 includes/replies/template.php:57
3591
+ msgid "View Reply"
3592
+ msgstr ""
3593
+
3594
+ #: includes/replies/template.php:58
3595
+ msgid "Search Replies"
3596
+ msgstr ""
3597
+
3598
+ #: includes/replies/template.php:59
3599
+ msgid "No replies found"
3600
+ msgstr ""
3601
+
3602
+ #: includes/replies/template.php:60
3603
+ msgid "No replies found in Trash"
3604
+ msgstr ""
3605
+
3606
+ #: includes/replies/template.php:706 includes/topics/template.php:809
3607
  msgctxt "date at time"
3608
  msgid "%1$s at %2$s"
3609
  msgstr ""
3610
 
3611
+ #: includes/replies/template.php:804
3612
  msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
3613
  msgstr ""
3614
 
3615
+ #: includes/replies/template.php:806
3616
  msgid "This reply was modified %1$s by %2$s."
3617
  msgstr ""
3618
 
3619
+ #: includes/replies/template.php:1098 includes/topics/template.php:1368
3620
  #: includes/users/template.php:184
3621
  msgid "Anonymous"
3622
  msgstr ""
3623
 
3624
+ #: includes/replies/template.php:1210 includes/topics/template.php:1481
3625
+ #: includes/users/template.php:1651
3626
  msgid "View %s's profile"
3627
  msgstr ""
3628
 
3629
+ #: includes/replies/template.php:1210 includes/topics/template.php:1481
3630
+ #: includes/users/template.php:1651
3631
  msgid "Visit %s's website"
3632
  msgstr ""
3633
 
3634
+ #: includes/replies/template.php:1693
3635
  msgid "Cancel"
3636
  msgstr ""
3637
 
3638
+ #: includes/replies/template.php:2034 includes/topics/template.php:2619
3639
  #: templates/default/bbpress/form-topic-tag.php:88
3640
  #: templates/default/bbpress/form-topic-tag.php:101
3641
  msgid "Delete"
3642
  msgstr ""
3643
 
3644
+ #: includes/replies/template.php:2051 includes/topics/template.php:2636
3645
  msgid "Are you sure you want to delete that permanently?"
3646
  msgstr ""
3647
 
3648
+ #: includes/replies/template.php:2104 includes/topics/template.php:2875
3649
  msgid "Unspam"
3650
  msgstr ""
3651
 
3652
+ #: includes/replies/template.php:2167
3653
  msgid "Move"
3654
  msgstr ""
3655
 
3656
+ #: includes/replies/template.php:2168
3657
  msgid "Move this reply"
3658
  msgstr ""
3659
 
3660
+ #: includes/replies/template.php:2234
3661
  msgid "Split"
3662
  msgstr ""
3663
 
3664
+ #: includes/replies/template.php:2235
3665
  msgid "Split the topic from this reply"
3666
  msgstr ""
3667
 
3668
+ #: includes/replies/template.php:2341
3669
  msgid "Viewing %1$s reply thread"
3670
  msgid_plural "Viewing %1$s reply threads"
3671
  msgstr[0] ""
3672
  msgstr[1] ""
3673
 
3674
+ #: includes/replies/template.php:2348
3675
  msgid "Viewing %1$s reply"
3676
  msgid_plural "Viewing %1$s replies"
3677
  msgstr[0] ""
3678
  msgstr[1] ""
3679
 
3680
+ #: includes/replies/template.php:2352
3681
  msgid "Viewing %2$s replies (of %4$s total)"
3682
  msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
3683
  msgstr[0] ""
3684
  msgstr[1] ""
3685
 
3686
+ #: includes/replies/template.php:2360
3687
  msgid "Viewing %1$s post"
3688
  msgid_plural "Viewing %1$s posts"
3689
  msgstr[0] ""
3690
  msgstr[1] ""
3691
 
3692
+ #: includes/replies/template.php:2364
3693
  msgid "Viewing %2$s post (of %4$s total)"
3694
  msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
3695
  msgstr[0] ""
3696
  msgstr[1] ""
3697
 
3698
+ #: includes/search/template.php:229
3699
  msgid "Search Results for '%s'"
3700
  msgstr ""
3701
 
3702
+ #: includes/search/template.php:401
3703
  msgid "Viewing %1$s result"
3704
  msgid_plural "Viewing %1$s results"
3705
  msgstr[0] ""
3706
  msgstr[1] ""
3707
 
3708
+ #: includes/search/template.php:405
3709
  msgid "Viewing %2$s results (of %4$s total)"
3710
  msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
3711
  msgstr[0] ""
3942
  msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
3943
  msgstr ""
3944
 
3945
+ #: includes/topics/template.php:51 includes/topics/template.php:55
3946
+ msgid "New Topic"
3947
+ msgstr ""
3948
+
3949
+ #: includes/topics/template.php:52 templates/default/bbpress/form-topic.php:43
3950
+ msgid "Create New Topic"
3951
+ msgstr ""
3952
+
3953
+ #: includes/topics/template.php:54
3954
+ msgid "Edit Topic"
3955
+ msgstr ""
3956
+
3957
+ #: includes/topics/template.php:56 includes/topics/template.php:57
3958
+ msgid "View Topic"
3959
+ msgstr ""
3960
+
3961
+ #: includes/topics/template.php:58
3962
+ msgid "Search Topics"
3963
+ msgstr ""
3964
+
3965
+ #: includes/topics/template.php:59
3966
+ msgid "No topics found"
3967
+ msgstr ""
3968
+
3969
+ #: includes/topics/template.php:60
3970
+ msgid "No topics found in Trash"
3971
+ msgstr ""
3972
+
3973
+ #: includes/topics/template.php:991
3974
  msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
3975
  msgstr ""
3976
 
3977
+ #: includes/topics/template.php:993
3978
  msgid "This topic was modified %1$s by %2$s."
3979
  msgstr ""
3980
 
3981
+ #: includes/topics/template.php:1891 includes/users/template.php:894
3982
+ msgid "Favorite"
3983
+ msgstr ""
3984
+
3985
+ #: includes/topics/template.php:1892
3986
+ msgid "Unfavorite"
3987
+ msgstr ""
3988
+
3989
+ #: includes/topics/template.php:2297
3990
  msgid "Tagged:"
3991
  msgstr ""
3992
 
3993
+ #: includes/topics/template.php:2687
3994
  msgctxt "Topic Status"
3995
  msgid "Close"
3996
  msgstr ""
3997
 
3998
+ #: includes/topics/template.php:2688
3999
  msgctxt "Topic Status"
4000
  msgid "Open"
4001
  msgstr ""
4002
 
4003
+ #: includes/topics/template.php:2818
4004
  #: templates/default/bbpress/form-topic-tag.php:59
4005
  #: templates/default/bbpress/form-topic-tag.php:73
4006
  msgid "Merge"
4007
  msgstr ""
4008
 
4009
+ #: includes/topics/template.php:2979
4010
  msgid "Viewing %1$s topic"
4011
  msgid_plural "Viewing %1$s topics"
4012
  msgstr[0] ""
4013
  msgstr[1] ""
4014
 
4015
+ #: includes/topics/template.php:2983
4016
  msgid "Viewing topic %2$s (of %4$s total)"
4017
  msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
4018
  msgstr[0] ""
4019
  msgstr[1] ""
4020
 
4021
+ #: includes/topics/template.php:3043
4022
  msgid "This topic is marked as spam."
4023
  msgstr ""
4024
 
4025
+ #: includes/topics/template.php:3048
4026
  msgid "This topic is in the trash."
4027
  msgstr ""
4028
 
4029
+ #: includes/topics/template.php:3308
4030
  msgid "%s voice"
4031
  msgid_plural "%s voices"
4032
  msgstr[0] ""
4033
  msgstr[1] ""
4034
 
4035
+ #: includes/topics/template.php:3314
4036
  msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
4037
  msgstr ""
4038
 
4039
+ #: includes/topics/template.php:3318
4040
  msgid "This topic contains %1$s and has %2$s."
4041
  msgstr ""
4042
 
4043
+ #: includes/topics/template.php:3322
4044
  msgid "This topic has no replies."
4045
  msgstr ""
4046
 
4047
+ #: includes/topics/template.php:3368
4048
+ #: templates/default/bbpress/content-statistics.php:37
4049
+ msgid "Topic Tags"
4050
+ msgstr ""
4051
+
4052
+ #: includes/topics/template.php:3370
4053
+ msgid "Search Tags"
4054
+ msgstr ""
4055
+
4056
+ #: includes/topics/template.php:3371
4057
+ msgid "Popular Tags"
4058
+ msgstr ""
4059
+
4060
+ #: includes/topics/template.php:3372
4061
+ msgid "All Tags"
4062
+ msgstr ""
4063
+
4064
+ #: includes/topics/template.php:3373
4065
+ msgid "Edit Tag"
4066
+ msgstr ""
4067
+
4068
+ #: includes/topics/template.php:3374
4069
+ msgid "Update Tag"
4070
+ msgstr ""
4071
+
4072
+ #: includes/topics/template.php:3375
4073
+ msgid "Add New Tag"
4074
+ msgstr ""
4075
+
4076
+ #: includes/topics/template.php:3376
4077
+ msgid "New Tag Name"
4078
+ msgstr ""
4079
+
4080
+ #: includes/topics/template.php:3377
4081
+ msgid "View Topic Tag"
4082
+ msgstr ""
4083
+
4084
  #: includes/users/functions.php:455
4085
  msgid ""
4086
  "<strong>ERROR</strong>: No topic was found! Which topic are you marking/"
4087
  "unmarking as favorite?"
4088
  msgstr ""
4089
 
4090
+ #: includes/users/functions.php:463 includes/users/functions.php:1178
4091
+ #: includes/users/functions.php:1284
4092
  msgid ""
4093
  "<strong>ERROR</strong>: You don't have the permission to edit favorites of "
4094
  "that user!"
4104
  msgid "<strong>ERROR</strong>: There was a problem favoriting that topic!"
4105
  msgstr ""
4106
 
4107
+ #: includes/users/functions.php:1170
4108
+ msgid ""
4109
+ "<strong>ERROR</strong>: No forum was found! Which forum are you subscribing/"
4110
+ "unsubscribing to?"
4111
+ msgstr ""
4112
+
4113
+ #: includes/users/functions.php:1223
4114
+ msgid ""
4115
+ "<strong>ERROR</strong>: There was a problem unsubscribing from that forum!"
4116
+ msgstr ""
4117
+
4118
+ #: includes/users/functions.php:1225
4119
+ msgid "<strong>ERROR</strong>: There was a problem subscribing to that forum!"
4120
+ msgstr ""
4121
+
4122
+ #: includes/users/functions.php:1276
4123
  msgid ""
4124
  "<strong>ERROR</strong>: No topic was found! Which topic are you subscribing/"
4125
  "unsubscribing to?"
4126
  msgstr ""
4127
 
4128
+ #: includes/users/functions.php:1329
4129
  msgid ""
4130
  "<strong>ERROR</strong>: There was a problem unsubscribing from that topic!"
4131
  msgstr ""
4132
 
4133
+ #: includes/users/functions.php:1331
4134
  msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic!"
4135
  msgstr ""
4136
 
4150
  msgid "Admin"
4151
  msgstr ""
4152
 
4153
+ #: includes/users/template.php:895
 
 
 
 
4154
  msgid "Favorited"
4155
  msgstr ""
4156
 
4157
+ #: includes/users/template.php:1163
 
 
 
 
 
 
 
 
4158
  msgid "User updated."
4159
  msgstr ""
4160
 
4161
+ #: includes/users/template.php:1188
4162
  msgid "You have super admin privileges."
4163
  msgstr ""
4164
 
4165
+ #: includes/users/template.php:1188
4166
  msgid "This user has super admin privileges."
4167
  msgstr ""
4168
 
4169
+ #: includes/users/template.php:1255
4170
  msgid "&mdash; No role for this site &mdash;"
4171
  msgstr ""
4172
 
4173
+ #: includes/users/template.php:1453
4174
  msgid "You are now logged out."
4175
  msgstr ""
4176
 
4177
+ #: includes/users/template.php:1457
4178
  msgid "New user registration is currently not allowed."
4179
  msgstr ""
4180
 
4181
+ #: includes/users/template.php:1466
4182
  msgid "Check your e-mail for the confirmation link."
4183
  msgstr ""
4184
 
4185
+ #: includes/users/template.php:1471
4186
  msgid "Check your e-mail for your new password."
4187
  msgstr ""
4188
 
4189
+ #: includes/users/template.php:1476
4190
  msgid "Registration complete. Please check your e-mail."
4191
  msgstr ""
4192
 
4288
  msgstr ""
4289
 
4290
  #: templates/default/bbpress/form-forum.php:138
4291
+ #: templates/default/bbpress/form-reply-move.php:72
4292
  #: templates/default/bbpress/form-reply.php:135
4293
+ #: templates/default/bbpress/form-topic-merge.php:93
4294
+ #: templates/default/bbpress/form-topic-split.php:97
4295
  #: templates/default/bbpress/form-topic.php:203
4296
  msgid "Submit"
4297
  msgstr ""
4346
  msgid "Use an existing topic in this forum:"
4347
  msgstr ""
4348
 
4349
+ #: templates/default/bbpress/form-reply-move.php:68
4350
+ #: templates/default/bbpress/form-topic-merge.php:89
4351
+ #: templates/default/bbpress/form-topic-split.php:93
 
 
 
 
 
4352
  msgid "<strong>WARNING:</strong> This process cannot be undone."
4353
  msgstr ""
4354
 
4355
+ #: templates/default/bbpress/form-reply-move.php:85
4356
  msgid "You do not have the permissions to edit this reply!"
4357
  msgstr ""
4358
 
4359
+ #: templates/default/bbpress/form-reply-move.php:85
4360
  msgid "You cannot edit this reply."
4361
  msgstr ""
4362
 
4443
  msgid "Merge with this topic:"
4444
  msgstr ""
4445
 
4446
+ #: templates/default/bbpress/form-topic-merge.php:56
 
 
 
 
4447
  msgid "There are no other topics in this forum to merge with."
4448
  msgstr ""
4449
 
4450
+ #: templates/default/bbpress/form-topic-merge.php:64
4451
+ #: templates/default/bbpress/form-topic-split.php:68
4452
  msgid "Topic Extras"
4453
  msgstr ""
4454
 
4455
+ #: templates/default/bbpress/form-topic-merge.php:71
4456
  msgid "Merge topic subscribers"
4457
  msgstr ""
4458
 
4459
+ #: templates/default/bbpress/form-topic-merge.php:76
4460
  msgid "Merge topic favoriters"
4461
  msgstr ""
4462
 
4463
+ #: templates/default/bbpress/form-topic-merge.php:81
4464
  msgid "Merge topic tags"
4465
  msgstr ""
4466
 
4467
+ #: templates/default/bbpress/form-topic-merge.php:106
4468
+ #: templates/default/bbpress/form-topic-split.php:110
4469
  msgid "You do not have the permissions to edit this topic!"
4470
  msgstr ""
4471
 
4472
+ #: templates/default/bbpress/form-topic-merge.php:106
4473
+ #: templates/default/bbpress/form-topic-split.php:110
4474
  msgid "You cannot edit this topic."
4475
  msgstr ""
4476
 
4500
  msgid "Split: %s"
4501
  msgstr ""
4502
 
4503
+ #: templates/default/bbpress/form-topic-split.php:75
4504
  msgid "Copy subscribers to the new topic"
4505
  msgstr ""
4506
 
4507
+ #: templates/default/bbpress/form-topic-split.php:80
4508
  msgid "Copy favoriters to the new topic"
4509
  msgstr ""
4510
 
4511
+ #: templates/default/bbpress/form-topic-split.php:85
4512
  msgid "Copy topic tags to the new topic"
4513
  msgstr ""
4514
 
4774
  msgid "%s's Replies Created"
4775
  msgstr ""
4776
 
 
 
 
 
 
 
 
 
4777
  #: templates/default/bbpress/user-favorites.php:15
4778
  msgid "Favorite Forum Topics"
4779
  msgstr ""
4811
  msgstr ""
4812
 
4813
  #: templates/default/bbpress/user-subscriptions.php:19
4814
+ msgid "Subscribed Forums"
4815
+ msgstr ""
4816
+
4817
+ #: templates/default/bbpress/user-subscriptions.php:28
4818
+ msgid "You are not currently subscribed to any forums."
4819
+ msgstr ""
4820
+
4821
+ #: templates/default/bbpress/user-subscriptions.php:28
4822
+ msgid "This user is not currently subscribed to any forums."
4823
  msgstr ""
4824
 
4825
+ #: templates/default/bbpress/user-subscriptions.php:47
4826
  msgid "You are not currently subscribed to any topics."
4827
  msgstr ""
4828
 
4829
+ #: templates/default/bbpress/user-subscriptions.php:47
4830
  msgid "This user is not currently subscribed to any topics."
4831
  msgstr ""
4832
 
4842
  msgid "This user has not created any topics."
4843
  msgstr ""
4844
 
4845
+ #: templates/default/bbpress-functions.php:248
4846
+ #: templates/default/bbpress-functions.php:257
4847
  msgid "Something went wrong. Refresh your browser and try again."
4848
  msgstr ""
4849
 
4850
+ #: templates/default/bbpress-functions.php:285
4851
+ #: templates/default/bbpress-functions.php:421
4852
+ msgid "Subscriptions are no longer active."
4853
  msgstr ""
4854
 
4855
+ #: templates/default/bbpress-functions.php:290
4856
+ msgid "Please login to subscribe to this forum."
4857
  msgstr ""
4858
 
4859
+ #: templates/default/bbpress-functions.php:299
4860
+ #: templates/default/bbpress-functions.php:367
4861
+ #: templates/default/bbpress-functions.php:435
4862
  msgid "You do not have permission to do this."
4863
  msgstr ""
4864
 
4865
+ #: templates/default/bbpress-functions.php:307
4866
+ msgid "The forum could not be found."
 
4867
  msgstr ""
4868
 
4869
+ #: templates/default/bbpress-functions.php:312
4870
+ #: templates/default/bbpress-functions.php:380
4871
+ #: templates/default/bbpress-functions.php:448
4872
  msgid "Are you sure you meant to do that?"
4873
  msgstr ""
4874
 
4875
+ #: templates/default/bbpress-functions.php:320
4876
+ #: templates/default/bbpress-functions.php:388
4877
+ #: templates/default/bbpress-functions.php:456
4878
  msgid "The request was unsuccessful. Please try again."
4879
  msgstr ""
4880
 
4881
+ #: templates/default/bbpress-functions.php:353
4882
+ msgid "Favorites are no longer active."
4883
  msgstr ""
4884
 
4885
+ #: templates/default/bbpress-functions.php:358
4886
+ msgid "Please login to make this topic a favorite."
4887
+ msgstr ""
4888
+
4889
+ #: templates/default/bbpress-functions.php:375
4890
+ #: templates/default/bbpress-functions.php:443
4891
+ msgid "The topic could not be found."
4892
+ msgstr ""
4893
+
4894
+ #: templates/default/bbpress-functions.php:426
4895
  msgid "Please login to subscribe to this topic."
4896
  msgstr ""
4897
 
4908
  msgid "bbPress"
4909
  msgstr ""
4910
 
4911
+ #. #-#-#-#-# plugin.pot (bbPress 2.5) #-#-#-#-#
4912
  #. Plugin URI of the plugin/theme
4913
+ #. #-#-#-#-# plugin.pot (bbPress 2.5) #-#-#-#-#
4914
  #. Author URI of the plugin/theme
4915
  msgid "http://bbpress.org"
4916
  msgstr ""
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === bbPress ===
2
- Contributors: matt, johnjamesjacoby, jmdodd
3
  Tags: forums, discussion, support, theme, akismet, multisite
4
  Requires at least: 3.6
5
  Tested up to: 3.6
6
- Stable tag: 2.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -42,6 +42,17 @@ We're keeping things as small and light as possible while still allowing for gre
42
 
43
  == Changelog ==
44
 
 
 
 
 
 
 
 
 
 
 
 
45
  = 2.4.1 =
46
  * Fix forum status saving
47
  * Fix widget settings saving
1
  === bbPress ===
2
+ Contributors: matt, johnjamesjacoby, jmdodd, netweb
3
  Tags: forums, discussion, support, theme, akismet, multisite
4
  Requires at least: 3.6
5
  Tested up to: 3.6
6
+ Stable tag: 2.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
42
 
43
  == Changelog ==
44
 
45
+ = 2.5 =
46
+ * Added forum subscriptions
47
+ * Added importers for AEF, Drupal, FluxBB, Kunena Forums (Joomla), MyBB, Phorum, PHPFox, PHPWind, PunBB, SMF, Xenforo and XMB
48
+ * Added BuddyPress Notifications integration
49
+ * Added ability to enqueue scripts and styles in the template stack
50
+ * Fix various existing importer scripts
51
+ * Fix forum visibility meta saving
52
+ * Fix Akismet anonymous user meta checking
53
+ * Fix inconsistent bbp_dropdown() results
54
+ * Fix topic and reply ping-status inconsistencies
55
+
56
  = 2.4.1 =
57
  * Fix forum status saving
58
  * Fix widget settings saving
templates/default/bbpress-functions.php CHANGED
@@ -44,31 +44,17 @@ class BBP_Default extends BBP_Theme_Compat {
44
  * @uses BBP_Default::setup_globals()
45
  * @uses BBP_Default::setup_actions()
46
  */
47
- public function __construct() {
48
- $this->setup_globals();
49
- $this->setup_actions();
50
- }
51
 
52
- /**
53
- * Component global variables
54
- *
55
- * Note that this function is currently commented out in the constructor.
56
- * It will only be used if you copy this file into your current theme and
57
- * uncomment the line above.
58
- *
59
- * You'll want to customize the values in here, so they match whatever your
60
- * needs are.
61
- *
62
- * @since bbPress (r3732)
63
- * @access private
64
- */
65
- private function setup_globals() {
66
- $bbp = bbpress();
67
- $this->id = 'default';
68
- $this->name = __( 'bbPress Default', 'bbpress' );
69
- $this->version = bbp_get_version();
70
- $this->dir = trailingslashit( $bbp->themes_dir . 'default' );
71
- $this->url = trailingslashit( $bbp->themes_url . 'default' );
72
  }
73
 
74
  /**
@@ -84,12 +70,12 @@ class BBP_Default extends BBP_Theme_Compat {
84
 
85
  /** Scripts ***********************************************************/
86
 
87
- add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS
88
- add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS
89
- add_filter( 'bbp_enqueue_scripts', array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization
90
- add_action( 'bbp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head>
91
- add_action( 'bbp_ajax_favorite', array( $this, 'ajax_favorite' ) ); // Handles the ajax favorite/unfavorite
92
- add_action( 'bbp_ajax_subscription', array( $this, 'ajax_subscription' ) ); // Handles the ajax subscribe/unsubscribe
93
 
94
  /** Template Wrappers *************************************************/
95
 
@@ -140,27 +126,30 @@ class BBP_Default extends BBP_Theme_Compat {
140
  */
141
  public function enqueue_styles() {
142
 
143
- // LTR or RTL
144
- $file = is_rtl() ? 'css/bbpress-rtl.css' : 'css/bbpress.css';
145
-
146
- // Check child theme
147
- if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) {
148
- $location = trailingslashit( get_stylesheet_directory_uri() );
149
- $handle = 'bbp-child-bbpress';
150
 
151
- // Check parent theme
152
- } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) {
153
- $location = trailingslashit( get_template_directory_uri() );
154
- $handle = 'bbp-parent-bbpress';
 
155
 
156
- // bbPress Theme Compatibility
157
- } else {
158
- $location = trailingslashit( $this->url );
159
- $handle = 'bbp-default-bbpress';
 
 
160
  }
161
 
162
- // Enqueue the bbPress styling
163
- wp_enqueue_style( $handle, $location . $file, array(), $this->version, 'screen' );
 
 
 
 
 
164
  }
165
 
166
  /**
@@ -168,114 +157,66 @@ class BBP_Default extends BBP_Theme_Compat {
168
  *
169
  * @since bbPress (r3732)
170
  *
 
171
  * @uses bbp_is_single_topic() To check if it's the topic page
 
172
  * @uses bbp_is_single_user_edit() To check if it's the profile edit page
173
  * @uses wp_enqueue_script() To enqueue the scripts
174
  */
175
  public function enqueue_scripts() {
176
 
 
 
 
177
  // Always pull in jQuery for TinyMCE shortcode usage
178
  if ( bbp_use_wp_editor() ) {
179
- wp_enqueue_script( 'jquery' );
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  // Topic-specific scripts
183
  if ( bbp_is_single_topic() ) {
184
 
185
  // Topic favorite/unsubscribe
186
- wp_enqueue_script( 'bbpress-topic', $this->url . 'js/topic.js', array( 'jquery' ), $this->version );
 
 
 
187
 
188
  // Hierarchical replies
189
  if ( bbp_thread_replies() ) {
190
- wp_enqueue_script( 'bbpress-reply', $this->url . 'js/reply.js', array(), $this->version );
 
 
 
191
  }
192
  }
193
 
194
  // User Profile edit
195
  if ( bbp_is_single_user_edit() ) {
196
- wp_enqueue_script( 'user-profile' );
 
 
 
197
  }
198
- }
199
 
200
- /**
201
- * Put some scripts in the header, like AJAX url for wp-lists
202
- *
203
- * @since bbPress (r3732)
204
- *
205
- * @uses bbp_is_single_topic() To check if it's the topic page
206
- * @uses admin_url() To get the admin url
207
- * @uses bbp_is_single_user_edit() To check if it's the profile edit page
208
- */
209
- public function head_scripts() {
210
-
211
- // Bail if no extra JS is needed
212
- if ( ! bbp_is_single_user_edit() && ! bbp_use_wp_editor() )
213
- return; ?>
214
 
215
- <script type="text/javascript">
216
- /* <![CDATA[ */
217
- <?php if ( bbp_is_single_user_edit() ) : ?>
218
- if ( window.location.hash === '#password' ) {
219
- document.getElementById('pass1').focus();
220
- }
221
- <?php endif; ?>
222
-
223
- <?php if ( bbp_use_wp_editor() ) : ?>
224
- jQuery(document).ready( function() {
225
-
226
- /* Use backticks instead of <code> for the Code button in the editor */
227
- if ( typeof( edButtons ) !== 'undefined' ) {
228
- edButtons[110] = new QTags.TagButton( 'code', 'code', '`', '`', 'c' );
229
- QTags._buttonsInit();
230
- }
231
-
232
- /* Tab from topic title */
233
- jQuery( '#bbp_topic_title' ).bind( 'keydown.editor-focus', function(e) {
234
- if ( e.which !== 9 )
235
- return;
236
-
237
- if ( !e.ctrlKey && !e.altKey && !e.shiftKey ) {
238
- if ( typeof( tinymce ) !== 'undefined' ) {
239
- if ( ! tinymce.activeEditor.isHidden() ) {
240
- var editor = tinymce.activeEditor.editorContainer;
241
- jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
242
- } else {
243
- jQuery( 'textarea.bbp-the-content' ).focus();
244
- }
245
- } else {
246
- jQuery( 'textarea.bbp-the-content' ).focus();
247
- }
248
-
249
- e.preventDefault();
250
- }
251
- });
252
-
253
- /* Shift + tab from topic tags */
254
- jQuery( '#bbp_topic_tags' ).bind( 'keydown.editor-focus', function(e) {
255
- if ( e.which !== 9 )
256
- return;
257
-
258
- if ( e.shiftKey && !e.ctrlKey && !e.altKey ) {
259
- if ( typeof( tinymce ) !== 'undefined' ) {
260
- if ( ! tinymce.activeEditor.isHidden() ) {
261
- var editor = tinymce.activeEditor.editorContainer;
262
- jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
263
- } else {
264
- jQuery( 'textarea.bbp-the-content' ).focus();
265
- }
266
- } else {
267
- jQuery( 'textarea.bbp-the-content' ).focus();
268
- }
269
-
270
- e.preventDefault();
271
- }
272
- });
273
- });
274
- <?php endif; ?>
275
- /* ]]> */
276
- </script>
277
-
278
- <?php
279
  }
280
 
281
  /**
@@ -285,9 +226,11 @@ class BBP_Default extends BBP_Theme_Compat {
285
  *
286
  * @since bbPress (r3732)
287
  *
 
288
  * @uses bbp_is_single_topic() To check if it's the topic page
289
  * @uses is_user_logged_in() To check if user is logged in
290
  * @uses bbp_get_current_user_id() To get the current user id
 
291
  * @uses bbp_get_topic_id() To get the topic id
292
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
293
  * @uses bbp_is_user_favorite() To check if the topic is in user's favorites
@@ -298,17 +241,93 @@ class BBP_Default extends BBP_Theme_Compat {
298
  */
299
  public function localize_topic_script() {
300
 
301
- // Bail if not viewing a single topic
302
- if ( !bbp_is_single_topic() )
303
- return;
304
-
305
- wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array(
306
- 'bbp_ajaxurl' => bbp_get_ajax_url(),
307
- 'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
308
- 'is_user_logged_in' => is_user_logged_in(),
309
- 'fav_nonce' => wp_create_nonce( 'toggle-favorite_' . get_the_ID() ),
310
- 'subs_nonce' => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
311
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  }
313
 
314
  /**
@@ -316,6 +335,8 @@ class BBP_Default extends BBP_Theme_Compat {
316
  *
317
  * @since bbPress (r3732)
318
  *
 
 
319
  * @uses bbp_get_current_user_id() To get the current user id
320
  * @uses current_user_can() To check if the current user can edit the user
321
  * @uses bbp_get_topic() To get the topic
@@ -333,7 +354,7 @@ class BBP_Default extends BBP_Theme_Compat {
333
  }
334
 
335
  // Bail if user is not logged in
336
- if ( !is_user_logged_in() ) {
337
  bbp_ajax_response( false, __( 'Please login to make this topic a favorite.', 'bbpress' ), 301 );
338
  }
339
 
@@ -342,7 +363,7 @@ class BBP_Default extends BBP_Theme_Compat {
342
  $id = !empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;
343
 
344
  // Bail if user cannot add favorites for this user
345
- if ( !current_user_can( 'edit_user', $user_id ) ) {
346
  bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
347
  }
348
 
@@ -355,7 +376,7 @@ class BBP_Default extends BBP_Theme_Compat {
355
  }
356
 
357
  // Bail if user did not take this action
358
- if ( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'toggle-favorite_' . $topic->ID ) ) {
359
  bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
360
  }
361
 
@@ -383,6 +404,7 @@ class BBP_Default extends BBP_Theme_Compat {
383
  * @since bbPress (r3732)
384
  *
385
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
 
386
  * @uses bbp_get_current_user_id() To get the current user id
387
  * @uses current_user_can() To check if the current user can edit the user
388
  * @uses bbp_get_topic() To get the topic
@@ -395,12 +417,12 @@ class BBP_Default extends BBP_Theme_Compat {
395
  public function ajax_subscription() {
396
 
397
  // Bail if subscriptions are not active
398
- if ( !bbp_is_subscriptions_active() ) {
399
  bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
400
  }
401
 
402
  // Bail if user is not logged in
403
- if ( !is_user_logged_in() ) {
404
  bbp_ajax_response( false, __( 'Please login to subscribe to this topic.', 'bbpress' ), 301 );
405
  }
406
 
@@ -409,7 +431,7 @@ class BBP_Default extends BBP_Theme_Compat {
409
  $id = intval( $_POST['id'] );
410
 
411
  // Bail if user cannot add favorites for this user
412
- if ( !current_user_can( 'edit_user', $user_id ) ) {
413
  bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
414
  }
415
 
@@ -422,7 +444,7 @@ class BBP_Default extends BBP_Theme_Compat {
422
  }
423
 
424
  // Bail if user did not take this action
425
- if ( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $topic->ID ) ) {
426
  bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
427
  }
428
 
44
  * @uses BBP_Default::setup_globals()
45
  * @uses BBP_Default::setup_actions()
46
  */
47
+ public function __construct( $properties = array() ) {
 
 
 
48
 
49
+ parent::__construct( bbp_parse_args( $properties, array(
50
+ 'id' => 'default',
51
+ 'name' => __( 'bbPress Default', 'bbpress' ),
52
+ 'version' => bbp_get_version(),
53
+ 'dir' => trailingslashit( bbpress()->themes_dir . 'default' ),
54
+ 'url' => trailingslashit( bbpress()->themes_url . 'default' ),
55
+ ), 'default_theme' ) );
56
+
57
+ $this->setup_actions();
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
  /**
70
 
71
  /** Scripts ***********************************************************/
72
 
73
+ add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS
74
+ add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS
75
+ add_filter( 'bbp_enqueue_scripts', array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization
76
+ add_action( 'bbp_ajax_favorite', array( $this, 'ajax_favorite' ) ); // Handles the topic ajax favorite/unfavorite
77
+ add_action( 'bbp_ajax_subscription', array( $this, 'ajax_subscription' ) ); // Handles the topic ajax subscribe/unsubscribe
78
+ add_action( 'bbp_ajax_forum_subscription', array( $this, 'ajax_forum_subscription' ) ); // Handles the forum ajax subscribe/unsubscribe
79
 
80
  /** Template Wrappers *************************************************/
81
 
126
  */
127
  public function enqueue_styles() {
128
 
129
+ // Setup styles array
130
+ $styles = array();
 
 
 
 
 
131
 
132
+ // LTR
133
+ $styles['bbp-default'] = array(
134
+ 'file' => 'css/bbpress.css',
135
+ 'dependencies' => array()
136
+ );
137
 
138
+ // RTL helpers
139
+ if ( is_rtl() ) {
140
+ $styles['bbp-default-rtl'] = array(
141
+ 'file' => 'css/bbpress-rtl.css',
142
+ 'dependencies' => array( 'bbp-default' )
143
+ );
144
  }
145
 
146
+ // Filter the scripts
147
+ $styles = apply_filters( 'bbp_default_styles', $styles );
148
+
149
+ // Enqueue the styles
150
+ foreach ( $styles as $handle => $attributes ) {
151
+ bbp_enqueue_style( $handle, $attributes['file'], $attributes['dependencies'], $this->version, 'screen' );
152
+ }
153
  }
154
 
155
  /**
157
  *
158
  * @since bbPress (r3732)
159
  *
160
+ * @uses bbp_is_single_forum() To check if it's the forum page
161
  * @uses bbp_is_single_topic() To check if it's the topic page
162
+ * @uses bbp_thread_replies() To check if threaded replies are enabled
163
  * @uses bbp_is_single_user_edit() To check if it's the profile edit page
164
  * @uses wp_enqueue_script() To enqueue the scripts
165
  */
166
  public function enqueue_scripts() {
167
 
168
+ // Setup scripts array
169
+ $scripts = array();
170
+
171
  // Always pull in jQuery for TinyMCE shortcode usage
172
  if ( bbp_use_wp_editor() ) {
173
+ $scripts['bbpress-editor'] = array(
174
+ 'file' => 'js/editor.js',
175
+ 'dependencies' => array( 'jquery' )
176
+ );
177
+ }
178
+
179
+ // Forum-specific scripts
180
+ if ( bbp_is_single_forum() ) {
181
+ $scripts['bbpress-forum'] = array(
182
+ 'file' => 'js/forum.js',
183
+ 'dependencies' => array( 'jquery' )
184
+ );
185
  }
186
 
187
  // Topic-specific scripts
188
  if ( bbp_is_single_topic() ) {
189
 
190
  // Topic favorite/unsubscribe
191
+ $scripts['bbpress-topic'] = array(
192
+ 'file' => 'js/topic.js',
193
+ 'dependencies' => array( 'jquery' )
194
+ );
195
 
196
  // Hierarchical replies
197
  if ( bbp_thread_replies() ) {
198
+ $scripts['bbpress-reply'] = array(
199
+ 'file' => 'js/reply.js',
200
+ 'dependencies' => array( 'jquery' )
201
+ );
202
  }
203
  }
204
 
205
  // User Profile edit
206
  if ( bbp_is_single_user_edit() ) {
207
+ $scripts['bbpress-user'] = array(
208
+ 'file' => 'js/user.js',
209
+ 'dependencies' => array( 'user-query' )
210
+ );
211
  }
 
212
 
213
+ // Filter the scripts
214
+ $scripts = apply_filters( 'bbp_default_scripts', $scripts );
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
+ // Enqueue the scripts
217
+ foreach ( $scripts as $handle => $attributes ) {
218
+ bbp_enqueue_script( $handle, $attributes['file'], $attributes['dependencies'], $this->version, 'screen' );
219
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
221
 
222
  /**
226
  *
227
  * @since bbPress (r3732)
228
  *
229
+ * @uses bbp_is_single_forum() To check if it's the forum page
230
  * @uses bbp_is_single_topic() To check if it's the topic page
231
  * @uses is_user_logged_in() To check if user is logged in
232
  * @uses bbp_get_current_user_id() To get the current user id
233
+ * @uses bbp_get_forum_id() To get the forum id
234
  * @uses bbp_get_topic_id() To get the topic id
235
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
236
  * @uses bbp_is_user_favorite() To check if the topic is in user's favorites
241
  */
242
  public function localize_topic_script() {
243
 
244
+ // Single forum
245
+ if ( bbp_is_single_forum() ) {
246
+ wp_localize_script( 'bbpress-forum', 'bbpForumJS', array(
247
+ 'bbp_ajaxurl' => bbp_get_ajax_url(),
248
+ 'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
249
+ 'is_user_logged_in' => is_user_logged_in(),
250
+ 'subs_nonce' => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
251
+ ) );
252
+
253
+ // Single topic
254
+ } elseif ( bbp_is_single_topic() ) {
255
+ wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array(
256
+ 'bbp_ajaxurl' => bbp_get_ajax_url(),
257
+ 'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
258
+ 'is_user_logged_in' => is_user_logged_in(),
259
+ 'fav_nonce' => wp_create_nonce( 'toggle-favorite_' . get_the_ID() ),
260
+ 'subs_nonce' => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
261
+ ) );
262
+ }
263
+ }
264
+
265
+ /**
266
+ * AJAX handler to Subscribe/Unsubscribe a user from a forum
267
+ *
268
+ * @since bbPress (r5155)
269
+ *
270
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
271
+ * @uses bbp_is_user_logged_in() To check if user is logged in
272
+ * @uses bbp_get_current_user_id() To get the current user id
273
+ * @uses current_user_can() To check if the current user can edit the user
274
+ * @uses bbp_get_forum() To get the forum
275
+ * @uses wp_verify_nonce() To verify the nonce
276
+ * @uses bbp_is_user_subscribed() To check if the forum is in user's subscriptions
277
+ * @uses bbp_remove_user_subscriptions() To remove the forum from user's subscriptions
278
+ * @uses bbp_add_user_subscriptions() To add the forum from user's subscriptions
279
+ * @uses bbp_ajax_response() To return JSON
280
+ */
281
+ public function ajax_forum_subscription() {
282
+
283
+ // Bail if subscriptions are not active
284
+ if ( ! bbp_is_subscriptions_active() ) {
285
+ bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
286
+ }
287
+
288
+ // Bail if user is not logged in
289
+ if ( ! is_user_logged_in() ) {
290
+ bbp_ajax_response( false, __( 'Please login to subscribe to this forum.', 'bbpress' ), 301 );
291
+ }
292
+
293
+ // Get user and forum data
294
+ $user_id = bbp_get_current_user_id();
295
+ $id = intval( $_POST['id'] );
296
+
297
+ // Bail if user cannot add favorites for this user
298
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
299
+ bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
300
+ }
301
+
302
+ // Get the forum
303
+ $forum = bbp_get_forum( $id );
304
+
305
+ // Bail if forum cannot be found
306
+ if ( empty( $forum ) ) {
307
+ bbp_ajax_response( false, __( 'The forum could not be found.', 'bbpress' ), 303 );
308
+ }
309
+
310
+ // Bail if user did not take this action
311
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $forum->ID ) ) {
312
+ bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
313
+ }
314
+
315
+ // Take action
316
+ $status = bbp_is_user_subscribed( $user_id, $forum->ID ) ? bbp_remove_user_subscription( $user_id, $forum->ID ) : bbp_add_user_subscription( $user_id, $forum->ID );
317
+
318
+ // Bail if action failed
319
+ if ( empty( $status ) ) {
320
+ bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );
321
+ }
322
+
323
+ // Put subscription attributes in convenient array
324
+ $attrs = array(
325
+ 'forum_id' => $forum->ID,
326
+ 'user_id' => $user_id
327
+ );
328
+
329
+ // Action succeeded
330
+ bbp_ajax_response( true, bbp_get_forum_subscription_link( $attrs, $user_id, false ), 200 );
331
  }
332
 
333
  /**
335
  *
336
  * @since bbPress (r3732)
337
  *
338
+ * @uses bbp_is_favorites_active() To check if favorites are active
339
+ * @uses bbp_is_user_logged_in() To check if user is logged in
340
  * @uses bbp_get_current_user_id() To get the current user id
341
  * @uses current_user_can() To check if the current user can edit the user
342
  * @uses bbp_get_topic() To get the topic
354
  }
355
 
356
  // Bail if user is not logged in
357
+ if ( ! is_user_logged_in() ) {
358
  bbp_ajax_response( false, __( 'Please login to make this topic a favorite.', 'bbpress' ), 301 );
359
  }
360
 
363
  $id = !empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;
364
 
365
  // Bail if user cannot add favorites for this user
366
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
367
  bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
368
  }
369
 
376
  }
377
 
378
  // Bail if user did not take this action
379
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-favorite_' . $topic->ID ) ) {
380
  bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
381
  }
382
 
404
  * @since bbPress (r3732)
405
  *
406
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
407
+ * @uses bbp_is_user_logged_in() To check if user is logged in
408
  * @uses bbp_get_current_user_id() To get the current user id
409
  * @uses current_user_can() To check if the current user can edit the user
410
  * @uses bbp_get_topic() To get the topic
417
  public function ajax_subscription() {
418
 
419
  // Bail if subscriptions are not active
420
+ if ( ! bbp_is_subscriptions_active() ) {
421
  bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
422
  }
423
 
424
  // Bail if user is not logged in
425
+ if ( ! is_user_logged_in() ) {
426
  bbp_ajax_response( false, __( 'Please login to subscribe to this topic.', 'bbpress' ), 301 );
427
  }
428
 
431
  $id = intval( $_POST['id'] );
432
 
433
  // Bail if user cannot add favorites for this user
434
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
435
  bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
436
  }
437
 
444
  }
445
 
446
  // Bail if user did not take this action
447
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $topic->ID ) ) {
448
  bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
449
  }
450
 
templates/default/bbpress/content-archive-forum.php CHANGED
@@ -23,6 +23,8 @@
23
 
24
  <?php bbp_breadcrumb(); ?>
25
 
 
 
26
  <?php do_action( 'bbp_template_before_forums_index' ); ?>
27
 
28
  <?php if ( bbp_has_forums() ) : ?>
23
 
24
  <?php bbp_breadcrumb(); ?>
25
 
26
+ <?php bbp_forum_subscription_link(); ?>
27
+
28
  <?php do_action( 'bbp_template_before_forums_index' ); ?>
29
 
30
  <?php if ( bbp_has_forums() ) : ?>
templates/default/bbpress/content-search.php CHANGED
@@ -13,7 +13,7 @@
13
 
14
  <?php bbp_breadcrumb(); ?>
15
 
16
- <?php bbp_set_query_name( 'bbp_search' ); ?>
17
 
18
  <?php do_action( 'bbp_template_before_search' ); ?>
19
 
13
 
14
  <?php bbp_breadcrumb(); ?>
15
 
16
+ <?php bbp_set_query_name( bbp_get_search_rewrite_id() ); ?>
17
 
18
  <?php do_action( 'bbp_template_before_search' ); ?>
19
 
templates/default/bbpress/content-single-forum.php CHANGED
@@ -13,6 +13,8 @@
13
 
14
  <?php bbp_breadcrumb(); ?>
15
 
 
 
16
  <?php do_action( 'bbp_template_before_single_forum' ); ?>
17
 
18
  <?php if ( post_password_required() ) : ?>
13
 
14
  <?php bbp_breadcrumb(); ?>
15
 
16
+ <?php bbp_forum_subscription_link(); ?>
17
+
18
  <?php do_action( 'bbp_template_before_single_forum' ); ?>
19
 
20
  <?php if ( post_password_required() ) : ?>
templates/default/bbpress/content-single-topic-lead.php CHANGED
@@ -21,9 +21,9 @@
21
 
22
  <?php _e( 'Topic', 'bbpress' ); ?>
23
 
24
- <?php bbp_user_subscribe_link(); ?>
25
 
26
- <?php bbp_user_favorites_link(); ?>
27
 
28
  </div><!-- .bbp-topic-content -->
29
 
21
 
22
  <?php _e( 'Topic', 'bbpress' ); ?>
23
 
24
+ <?php bbp_topic_subscription_link(); ?>
25
 
26
+ <?php bbp_topic_favorite_link(); ?>
27
 
28
  </div><!-- .bbp-topic-content -->
29
 
templates/default/bbpress/content-single-view.php CHANGED
@@ -13,7 +13,7 @@
13
 
14
  <?php bbp_breadcrumb(); ?>
15
 
16
- <?php bbp_set_query_name( 'bbp_view' ); ?>
17
 
18
  <?php if ( bbp_view_query() ) : ?>
19
 
13
 
14
  <?php bbp_breadcrumb(); ?>
15
 
16
+ <?php bbp_set_query_name( bbp_get_view_rewrite_id() ); ?>
17
 
18
  <?php if ( bbp_view_query() ) : ?>
19
 
templates/default/bbpress/form-anonymous.php CHANGED
@@ -9,7 +9,7 @@
9
 
10
  ?>
11
 
12
- <?php if ( bbp_is_anonymous() || ( bbp_is_topic_edit() && bbp_is_topic_anonymous() ) || ( bbp_is_reply_edit() && bbp_is_reply_anonymous() ) ) : ?>
13
 
14
  <?php do_action( 'bbp_theme_before_anonymous_form' ); ?>
15
 
@@ -20,17 +20,17 @@
20
 
21
  <p>
22
  <label for="bbp_anonymous_author"><?php _e( 'Name (required):', 'bbpress' ); ?></label><br />
23
- <input type="text" id="bbp_anonymous_author" value="<?php bbp_is_topic_edit() ? bbp_topic_author() : bbp_is_reply_edit() ? bbp_reply_author() : bbp_current_anonymous_user_data( 'name' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_name" />
24
  </p>
25
 
26
  <p>
27
  <label for="bbp_anonymous_email"><?php _e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br />
28
- <input type="text" id="bbp_anonymous_email" value="<?php bbp_is_topic_edit() ? bbp_topic_author_email() : bbp_is_reply_edit() ? bbp_reply_author_email() : bbp_current_anonymous_user_data( 'email' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_email" />
29
  </p>
30
 
31
  <p>
32
  <label for="bbp_anonymous_website"><?php _e( 'Website:', 'bbpress' ); ?></label><br />
33
- <input type="text" id="bbp_anonymous_website" value="<?php bbp_is_topic_edit() ? bbp_topic_author_url() : bbp_is_reply_edit() ? bbp_reply_author_url() : bbp_current_anonymous_user_data( 'website' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_website" />
34
  </p>
35
 
36
  <?php do_action( 'bbp_theme_anonymous_form_extras_bottom' ); ?>
9
 
10
  ?>
11
 
12
+ <?php if ( bbp_current_user_can_access_anonymous_user_form() ) : ?>
13
 
14
  <?php do_action( 'bbp_theme_before_anonymous_form' ); ?>
15
 
20
 
21
  <p>
22
  <label for="bbp_anonymous_author"><?php _e( 'Name (required):', 'bbpress' ); ?></label><br />
23
+ <input type="text" id="bbp_anonymous_author" value="<?php bbp_author_display_name(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_name" />
24
  </p>
25
 
26
  <p>
27
  <label for="bbp_anonymous_email"><?php _e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br />
28
+ <input type="text" id="bbp_anonymous_email" value="<?php bbp_author_email(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_email" />
29
  </p>
30
 
31
  <p>
32
  <label for="bbp_anonymous_website"><?php _e( 'Website:', 'bbpress' ); ?></label><br />
33
+ <input type="text" id="bbp_anonymous_website" value="<?php bbp_author_url(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_website" />
34
  </p>
35
 
36
  <?php do_action( 'bbp_theme_anonymous_form_extras_bottom' ); ?>
templates/default/bbpress/form-reply-move.php CHANGED
@@ -54,8 +54,7 @@
54
  'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ),
55
  'selected' => -1,
56
  'exclude' => bbp_get_reply_topic_id( bbp_get_reply_id() ),
57
- 'select_id' => 'bbp_destination_topic',
58
- 'none_found' => __( 'No other topics found!', 'bbpress' )
59
  ) );
60
  ?>
61
 
54
  'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ),
55
  'selected' => -1,
56
  'exclude' => bbp_get_reply_topic_id( bbp_get_reply_id() ),
57
+ 'select_id' => 'bbp_destination_topic'
 
58
  ) );
59
  ?>
60
 
templates/default/bbpress/form-topic-merge.php CHANGED
@@ -47,8 +47,7 @@
47
  'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
48
  'selected' => -1,
49
  'exclude' => bbp_get_topic_id(),
50
- 'select_id' => 'bbp_destination_topic',
51
- 'none_found' => __( 'No topics were found to which the topic could be merged to!', 'bbpress' )
52
  ) );
53
  ?>
54
 
47
  'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
48
  'selected' => -1,
49
  'exclude' => bbp_get_topic_id(),
50
+ 'select_id' => 'bbp_destination_topic'
 
51
  ) );
52
  ?>
53
 
templates/default/bbpress/form-topic-split.php CHANGED
@@ -54,8 +54,7 @@
54
  'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
55
  'selected' => -1,
56
  'exclude' => bbp_get_topic_id(),
57
- 'select_id' => 'bbp_destination_topic',
58
- 'none_found' => __( 'No other topics found!', 'bbpress' )
59
  ) );
60
  ?>
61
 
54
  'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
55
  'selected' => -1,
56
  'exclude' => bbp_get_topic_id(),
57
+ 'select_id' => 'bbp_destination_topic'
 
58
  ) );
59
  ?>
60
 
templates/default/bbpress/loop-replies.php CHANGED
@@ -23,7 +23,7 @@
23
 
24
  <?php _e( 'Posts', 'bbpress' ); ?>
25
 
26
- <?php bbp_user_subscribe_link(); ?>
27
 
28
  <?php bbp_user_favorites_link(); ?>
29
 
23
 
24
  <?php _e( 'Posts', 'bbpress' ); ?>
25
 
26
+ <?php bbp_topic_subscription_link(); ?>
27
 
28
  <?php bbp_user_favorites_link(); ?>
29
 
templates/default/bbpress/loop-single-forum.php CHANGED
@@ -13,6 +13,20 @@
13
 
14
  <li class="bbp-forum-info">
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <?php do_action( 'bbp_theme_before_forum_title' ); ?>
17
 
18
  <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>
13
 
14
  <li class="bbp-forum-info">
15
 
16
+ <?php if ( bbp_is_user_home() && bbp_is_subscriptions() ) : ?>
17
+
18
+ <span class="bbp-row-actions">
19
+
20
+ <?php do_action( 'bbp_theme_before_forum_subscription_action' ); ?>
21
+
22
+ <?php bbp_forum_subscription_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '&times;' ) ); ?>
23
+
24
+ <?php do_action( 'bbp_theme_after_forum_subscription_action' ); ?>
25
+
26
+ </span>
27
+
28
+ <?php endif; ?>
29
+
30
  <?php do_action( 'bbp_theme_before_forum_title' ); ?>
31
 
32
  <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>
templates/default/bbpress/loop-single-topic.php CHANGED
@@ -17,11 +17,11 @@
17
 
18
  <?php if ( bbp_is_favorites() ) : ?>
19
 
20
- <span class="bbp-topic-action">
21
 
22
  <?php do_action( 'bbp_theme_before_topic_favorites_action' ); ?>
23
 
24
- <?php bbp_user_favorites_link( array( 'before' => '', 'favorite' => '+', 'favorited' => '&times;' ) ); ?>
25
 
26
  <?php do_action( 'bbp_theme_after_topic_favorites_action' ); ?>
27
 
@@ -29,11 +29,11 @@
29
 
30
  <?php elseif ( bbp_is_subscriptions() ) : ?>
31
 
32
- <span class="bbp-topic-action">
33
 
34
  <?php do_action( 'bbp_theme_before_topic_subscription_action' ); ?>
35
 
36
- <?php bbp_user_subscribe_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '&times;' ) ); ?>
37
 
38
  <?php do_action( 'bbp_theme_after_topic_subscription_action' ); ?>
39
 
17
 
18
  <?php if ( bbp_is_favorites() ) : ?>
19
 
20
+ <span class="bbp-row-actions">
21
 
22
  <?php do_action( 'bbp_theme_before_topic_favorites_action' ); ?>
23
 
24
+ <?php bbp_topic_favorite_link( array( 'before' => '', 'favorite' => '+', 'favorited' => '&times;' ) ); ?>
25
 
26
  <?php do_action( 'bbp_theme_after_topic_favorites_action' ); ?>
27
 
29
 
30
  <?php elseif ( bbp_is_subscriptions() ) : ?>
31
 
32
+ <span class="bbp-row-actions">
33
 
34
  <?php do_action( 'bbp_theme_before_topic_subscription_action' ); ?>
35
 
36
+ <?php bbp_topic_subscription_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '&times;' ) ); ?>
37
 
38
  <?php do_action( 'bbp_theme_after_topic_subscription_action' ); ?>
39
 
templates/default/bbpress/user-subscriptions.php CHANGED
@@ -16,10 +16,25 @@
16
  <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
17
 
18
  <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">
19
- <h2 class="entry-title"><?php _e( 'Subscribed Forum Topics', 'bbpress' ); ?></h2>
20
  <div class="bbp-user-section">
21
 
22
- <?php if ( bbp_get_user_subscriptions() ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
25
 
16
  <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
17
 
18
  <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">
19
+ <h2 class="entry-title"><?php _e( 'Subscribed Forums', 'bbpress' ); ?></h2>
20
  <div class="bbp-user-section">
21
 
22
+ <?php if ( bbp_get_user_forum_subscriptions() ) : ?>
23
+
24
+ <?php bbp_get_template_part( 'loop', 'forums' ); ?>
25
+
26
+ <?php else : ?>
27
+
28
+ <p><?php bbp_is_user_home() ? _e( 'You are not currently subscribed to any forums.', 'bbpress' ) : _e( 'This user is not currently subscribed to any forums.', 'bbpress' ); ?></p>
29
+
30
+ <?php endif; ?>
31
+
32
+ </div>
33
+
34
+ <h2 class="entry-title"><?php _e( 'Subscribed Topics', 'bbpress' ); ?></h2>
35
+ <div class="bbp-user-section">
36
+
37
+ <?php if ( bbp_get_user_topic_subscriptions() ) : ?>
38
 
39
  <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
40
 
templates/default/css/bbpress-rtl.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * bbPress specific CSS
3
  *
4
  * @package bbPress
5
  * @subpackage Theme
@@ -8,212 +8,47 @@
8
  /* =bbPress Style
9
  -------------------------------------------------------------- */
10
 
11
- #bbpress-forums hr {
12
- margin: 0 0 24px 0;
13
- }
14
-
15
- #bbpress-forums {
16
- background: transparent;
17
- clear: both;
18
- margin-bottom: 20px;
19
- overflow: hidden;
20
- font-size: 12px;
21
- }
22
-
23
- #bbpress-forums div.even,
24
- #bbpress-forums ul.even {
25
- background-color: #fff;
26
- }
27
-
28
- #bbpress-forums div.odd,
29
- #bbpress-forums ul.odd {
30
- background-color: #fbfbfb;
31
- }
32
-
33
- body.reply-edit .reply {
34
- float: none;
35
- }
36
-
37
- #bbpress-forums .type-reply {
38
- height: auto;
39
- width: 100%;
40
- }
41
-
42
- #bbpress-forums div.bbp-forum-header,
43
- #bbpress-forums div.bbp-topic-header,
44
- #bbpress-forums div.bbp-reply-header {
45
- background-color: #f4f4f4;
46
- }
47
-
48
- #bbpress-forums .status-trash.even,
49
- #bbpress-forums .status-spam.even {
50
- background-color: #fee;
51
- }
52
- #bbpress-forums .status-trash.odd,
53
- #bbpress-forums .status-spam.odd {
54
- background-color: #fdd;
55
- }
56
-
57
- #bbpress-forums .status-closed,
58
- #bbpress-forums .status-closed a {
59
- color: #ccc;
60
- }
61
-
62
- #bbpress-forums ul {
63
- background: none;
64
- list-style: none;
65
- margin: 0;
66
- padding: 0;
67
- }
68
-
69
- #bbpress-forums ul.bbp-threaded-replies {
70
- margin-right: 50px;
71
- }
72
-
73
- #bbpress-forums li {
74
- background: none;
75
- margin: 0;
76
- list-style: none;
77
- }
78
-
79
- #bbpress-forums ul.bbp-lead-topic,
80
- #bbpress-forums ul.bbp-topics,
81
- #bbpress-forums ul.bbp-forums,
82
- #bbpress-forums ul.bbp-replies,
83
- #bbpress-forums ul.bbp-search-results {
84
- font-size: 12px;
85
- overflow: hidden;
86
- border: 1px solid #eee;
87
- margin-bottom: 20px;
88
- clear: both;
89
- }
90
-
91
- #bbpress-forums li.bbp-header,
92
- #bbpress-forums li.bbp-body,
93
- #bbpress-forums li.bbp-footer {
94
- clear: both;
95
- }
96
-
97
- #bbpress-forums li.bbp-header,
98
- #bbpress-forums li.bbp-footer {
99
- background: #f3f3f3;
100
- border-top: 1px solid #eee;
101
- font-weight: bold;
102
- padding: 8px;
103
- text-align: center;
104
- }
105
-
106
- #bbpress-forums li.bbp-header {
107
- background: #eaeaea;
108
- }
109
-
110
- #bbpress-forums li.bbp-header ul {
111
- overflow: hidden;
112
- }
113
-
114
  #bbpress-forums .bbp-forums-list {
115
- margin: 0 5px 0 0;
116
- padding-right: 15px;
117
- border-right: 1px solid #ddd;
118
- }
119
-
120
- #bbpress-forums .bbp-forums-list li {
121
- display: inline;
122
- font-size: 11px;
123
  }
124
-
125
- #bbpress-forums li.bbp-footer p {
126
- margin: 0;
127
- line-height: 1em;
128
  }
129
-
130
  li.bbp-forum-info,
131
  li.bbp-topic-title {
132
- float: right;
133
- text-align: right;
134
- width: 55%;
135
  }
136
  li.bbp-forum-topic-count,
137
  li.bbp-topic-voice-count,
138
  li.bbp-forum-reply-count,
139
  li.bbp-topic-reply-count {
140
- float: right;
141
- text-align: center;
142
- width: 10%;
143
  }
144
-
145
  li.bbp-forum-freshness,
146
  li.bbp-topic-freshness {
147
- text-align: center;
148
- float: right;
149
- width: 22%;
150
  }
151
-
152
- #bbpress-forums li.bbp-body ul.forum,
153
- #bbpress-forums li.bbp-body ul.topic {
154
- border-top: 1px solid #eee;
155
- overflow: hidden;
156
- padding: 8px;
157
  }
158
-
159
  li.bbp-header div.bbp-topic-content span#subscription-toggle,
160
  li.bbp-header div.bbp-topic-content span#favorite-toggle,
161
  li.bbp-header div.bbp-reply-content span#subscription-toggle,
162
  li.bbp-header div.bbp-reply-content span#favorite-toggle {
163
- float: left;
164
  }
165
-
166
- #bbpress-forums div.bbp-forum-title h3,
167
- #bbpress-forums div.bbp-topic-title h3,
168
- #bbpress-forums div.bbp-reply-title h3 {
169
- background: none;
170
- border: none;
171
- font-size: 16px;
172
- line-height: 1em;
173
- margin: 8px 0;
174
- padding: 0;
175
- text-transform: none;
176
- }
177
-
178
- #bbpress-forums div.bbp-forum-author,
179
  #bbpress-forums div.bbp-topic-author,
180
  #bbpress-forums div.bbp-reply-author {
181
- float: right;
182
- text-align: center;
183
- width: 115px;
184
- }
185
-
186
- #bbpress-forums div.bbp-forum-author img.avatar,
187
- #bbpress-forums div.bbp-topic-author img.avatar,
188
- #bbpress-forums div.bbp-reply-author img.avatar {
189
- border: none;
190
- max-width: 80px;
191
- padding: 0;
192
- margin: 12px auto 0 auto;
193
- float: none;
194
- }
195
-
196
- #bbpress-forums div.bbp-forum-author a.bbp-author-name,
197
- #bbpress-forums div.bbp-topic-author a.bbp-author-name,
198
- #bbpress-forums div.bbp-reply-author a.bbp-author-name {
199
- margin: 0 12px;
200
- word-break: break-word;
201
- display: inline-block;
202
- }
203
-
204
- #bbpress-forums div.bbp-topic-author a.bbp-author-name,
205
- #bbpress-forums div.bbp-reply-author a.bbp-author-name {
206
- clear: right;
207
- display: block;
208
- }
209
-
210
- #bbpress-forums div.bbp-forum-author .bbp-author-role,
211
- #bbpress-forums div.bbp-topic-author .bbp-author-role,
212
- #bbpress-forums div.bbp-reply-author .bbp-author-role {
213
- font-size: 11px;
214
- font-style: italic;
215
  }
216
-
217
  #bbpress-forums li.bbp-header .bbp-search-author,
218
  #bbpress-forums li.bbp-footer .bbp-search-author,
219
  #bbpress-forums li.bbp-header .bbp-forum-author,
@@ -222,12 +57,8 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
222
  #bbpress-forums li.bbp-footer .bbp-topic-author,
223
  #bbpress-forums li.bbp-header .bbp-reply-author,
224
  #bbpress-forums li.bbp-footer .bbp-reply-author {
225
- float: right;
226
- margin: 0;
227
- padding: 0;
228
- width: 120px;
229
  }
230
-
231
  #bbpress-forums li.bbp-header .bbp-search-content,
232
  #bbpress-forums li.bbp-footer .bbp-search-content,
233
  #bbpress-forums li.bbp-header .bbp-forum-content,
@@ -236,32 +67,9 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
236
  #bbpress-forums li.bbp-footer .bbp-topic-content,
237
  #bbpress-forums li.bbp-header .bbp-reply-content,
238
  #bbpress-forums li.bbp-footer .bbp-reply-content {
239
- margin-right: 140px;
240
- padding: 0;
241
- text-align: right;
242
- }
243
-
244
- div.bbp-forum-header,
245
- div.bbp-topic-header,
246
- div.bbp-reply-header,
247
- li.bbp-body div.hentry {
248
- margin-bottom: 0;
249
- overflow: hidden;
250
- padding: 8px;
251
- }
252
-
253
- div.bbp-forum-header,
254
- div.bbp-topic-header,
255
- div.bbp-reply-header {
256
- border-top: 1px solid #ddd;
257
- clear: both;
258
- }
259
-
260
- span.bbp-author-ip {
261
- font-family: 'Helvetica Neue', Arial, Helvetica, 'Nimbus Sans L', sans-serif;
262
- font-size: 11px;
263
- font-weight: bold;
264
- color: #aaa;
265
  }
266
 
267
  /* =Topic and reply content
@@ -270,731 +78,170 @@ span.bbp-author-ip {
270
  #bbpress-forums div.bbp-forum-content,
271
  #bbpress-forums div.bbp-topic-content,
272
  #bbpress-forums div.bbp-reply-content {
273
- margin-right: 130px;
274
- padding: 12px 0 12px 12px;
275
- text-align: right;
276
- }
277
-
278
- /* Clearing hack */
279
- #bbpress-forums div.bbp-forum-content:after,
280
- #bbpress-forums div.bbp-topic-content:after,
281
- #bbpress-forums div.bbp-reply-content:after {
282
- clear: both;
283
- content: ".";
284
- display: block;
285
- float: none;
286
- height: 0;
287
- font-size: 0;
288
- visibility: hidden;
289
- }
290
-
291
- #bbpress-forums div.bbp-topic-content a,
292
- #bbpress-forums div.bbp-reply-content a {
293
- background: none;
294
- border: none;
295
- display: inline;
296
- font-weight: normal;
297
- margin: 0;
298
- padding: 0;
299
- }
300
-
301
- #bbpress-forums div.bbp-topic-content h1,
302
- #bbpress-forums div.bbp-reply-content h1,
303
- #bbpress-forums div.bbp-topic-content h2,
304
- #bbpress-forums div.bbp-reply-content h2,
305
- #bbpress-forums div.bbp-topic-content h3,
306
- #bbpress-forums div.bbp-reply-content h3,
307
- #bbpress-forums div.bbp-topic-content h4,
308
- #bbpress-forums div.bbp-reply-content h4,
309
- #bbpress-forums div.bbp-topic-content h5,
310
- #bbpress-forums div.bbp-reply-content h5,
311
- #bbpress-forums div.bbp-topic-content h6,
312
- #bbpress-forums div.bbp-reply-content h6 {
313
- clear: none;
314
- line-height: 1em;
315
- margin: 24px 0;
316
- padding: 0;
317
- }
318
-
319
- #bbpress-forums div.bbp-topic-content img,
320
- #bbpress-forums div.bbp-reply-content img {
321
- max-width: 100%;
322
- }
323
-
324
- #bbpress-forums div.bbp-topic-content ul,
325
- #bbpress-forums div.bbp-reply-content ul,
326
- #bbpress-forums div.bbp-topic-content ol,
327
- #bbpress-forums div.bbp-reply-content ol {
328
- margin: 0 15px 15px;
329
- padding: 0;
330
- }
331
-
332
- #bbpress-forums div.bbp-topic-content ul li,
333
- #bbpress-forums div.bbp-reply-content ul li {
334
- list-style-type: disc;
335
- }
336
-
337
- #bbpress-forums div.bbp-topic-content ol li,
338
- #bbpress-forums div.bbp-reply-content ol li {
339
- list-style-type: decimal;
340
- }
341
-
342
- #bbpress-forums div.bbp-topic-content ol li li,
343
- #bbpress-forums div.bbp-reply-content ol li li {
344
- list-style-type: lower-alpha;
345
- }
346
-
347
- #bbpress-forums div.bbp-topic-content ol li li li,
348
- #bbpress-forums div.bbp-reply-content ol li li li {
349
- list-style-type: upper-roman;
350
- }
351
-
352
- #bbpress-forums div.bbp-topic-content code,
353
- #bbpress-forums div.bbp-reply-content code,
354
- #bbpress-forums div.bbp-topic-content pre,
355
- #bbpress-forums div.bbp-reply-content pre {
356
- font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
357
- display: inline-block;
358
- background-color: #f9f9f9;
359
- border: 1px solid #ddd;
360
- padding: 0 5px;
361
- max-width: 95%;
362
- vertical-align: middle;
363
- margin-top: -3px;
364
- }
365
-
366
- #bbpress-forums div.bbp-topic-content pre,
367
- #bbpress-forums div.bbp-reply-content pre {
368
- display: block;
369
- line-height: 18px;
370
- margin: 0 0 24px;
371
- padding: 5px 10px;
372
- white-space: pre;
373
- overflow: auto;
374
- }
375
-
376
- #bbpress-forums div.bbp-topic-content pre code,
377
- #bbpress-forums div.bbp-reply-content pre code {
378
- display: block;
379
- border: none;
380
- padding: 0;
381
- margin: 0;
382
- background-color: transparent;
383
- overflow-wrap: normal;
384
- overflow: scroll;
385
- max-width: 100%;
386
  }
387
 
388
  /* =Reply to
389
  -------------------------------------------------------------- */
390
 
391
  #bbpress-forums div.bbp-reply-to {
392
- margin-right: 130px;
393
- padding: 12px 0px 12px 12px;
394
- text-align: left;
 
395
  }
396
-
397
  #bbpress-forums div#bbp-cancel-reply-to {
398
- text-align: left;
399
  }
400
 
401
  /* =Breadcrumb and Tags
402
  -------------------------------------------------------------- */
403
 
404
  div.bbp-breadcrumb {
405
- float: right;
406
- }
407
-
408
- div.bbp-breadcrumb,
409
- div.bbp-topic-tags {
410
- font-size: 12px;
411
- }
412
-
413
- #bbpress-forums div.bbp-breadcrumb p,
414
- #bbpress-forums div.bbp-topic-tags p {
415
- margin-bottom: 10px
416
- }
417
-
418
- #bbpress-forums div.bbp-topic-tags {
419
- float: left;
420
- }
421
-
422
- #bbp-topic-hot-tags {
423
- clear: both;
424
  }
425
 
426
  /* =Search
427
  -------------------------------------------------------------- */
428
 
429
  #bbpress-forums #bbp-search-form {
430
- clear: right;
431
  }
432
-
433
- #bbpress-forums #bbp-search-form .hidden {
434
- height: 0;
435
- width: 0;
436
- overflow: hidden;
437
- position: absolute;
438
- background: none;
439
- left: -999em;
440
- }
441
-
442
- #bbpress-forums #bbp-search-form #bbp_search {
443
- display: inline-block;
444
- width: auto;
445
- }
446
-
447
  #bbpress-forums div.bbp-search-form {
448
- float: left;
449
  }
450
 
451
  /* =Admin Links
452
  -------------------------------------------------------------- */
453
 
454
  span.bbp-admin-links {
455
- float: left;
456
- color: #ddd;
457
- }
458
- span.bbp-admin-links a {
459
- color: #bbb;
460
- font-weight: normal;
461
- font-size: 10px;
462
- text-transform: uppercase;
463
- text-decoration: none;
464
  }
465
  fieldset span.bbp-admin-links {
466
- float: right;
467
- }
468
- tr td span.bbp-admin-links a:hover {
469
- color: #ff4b33;
470
  }
471
- td.bbp-topic-admin-links,
472
- td.bbp-topic-counts {
473
- width: 50%;
474
- }
475
-
476
- .bbp-forum-header a.bbp-forum-permalink,
477
  .bbp-topic-header a.bbp-topic-permalink,
478
  .bbp-reply-header a.bbp-reply-permalink {
479
- float: left;
480
- margin-right: 10px;
481
- color: #ccc;
482
- }
483
-
484
- /* =Toggles
485
- -------------------------------------------------------------- */
486
-
487
- .bbp-topic-action #favorite-toggle a {
488
- text-decoration: none;
489
- padding: 0 3px 1px;
490
- color: #7c7;
491
- border: 1px solid #aca;
492
- background-color: #dfd;
493
- font-weight: bold;
494
- font-size: 13px;
495
- }
496
- .bbp-topic-action #favorite-toggle a:hover {
497
- color: #5a5;
498
- border-color: #7c7;
499
- background-color: #beb;
500
- }
501
- .bbp-topic-action #favorite-toggle span.is-favorite a {
502
- color: #faa;
503
- border: 1px solid #faa;
504
- background-color: #fee;
505
- }
506
- .bbp-topic-action #favorite-toggle span.is-favorite a:hover {
507
- color: #c88;
508
- border-color: #c88;
509
- background-color: #fdd;
510
- }
511
-
512
- .bbp-topic-action #subscription-toggle a {
513
- text-decoration: none;
514
- padding: 0 3px 1px;
515
- color: #7c7;
516
- border: 1px solid #aca;
517
- background-color: #dfd;
518
- font-weight: bold;
519
- font-size: 13px;
520
- }
521
- .bbp-topic-action #subscription-toggle a:hover {
522
- color: #5a5;
523
- border-color: #7c7;
524
- background-color: #beb;
525
- }
526
- .bbp-topic-action #subscription-toggle span.is-subscribed a {
527
- color: #faa;
528
- border: 1px solid #faa;
529
- background-color: #fee;
530
- }
531
- .bbp-topic-action #subscription-toggle span.is-subscribed a:hover {
532
- color: #c88;
533
- border-color: #c88;
534
- background-color: #fdd;
535
- }
536
-
537
- #bbpress-forums .bbp-forum-info .bbp-forum-content,
538
- #bbpress-forums p.bbp-topic-meta {
539
- font-size: 11px;
540
- margin: 5px 0 5px;
541
- padding: 0;
542
- word-wrap: break-word;
543
- }
544
-
545
- #bbpress-forums p.bbp-topic-meta span {
546
- white-space: nowrap;
547
  }
548
 
549
  /* =Pagination
550
  -------------------------------------------------------------- */
551
 
552
  .bbp-pagination-count {
553
- float: right;
554
- border: 1px solid transparent;
555
  }
556
-
557
  .bbp-pagination-links {
558
- float: left;
559
- list-style: none;
560
- display: inline;
561
- }
562
- .bbp-pagination-links a,
563
- .bbp-pagination-links span.current {
564
- display: block;
565
- float: right;
566
- padding: 0px 5px;
567
- margin-right: 5px;
568
- border: 1px solid #efefef;
569
- text-decoration: none;
570
- }
571
- .bbp-pagination-links a:hover,
572
- .bbp-pagination-links span.current {
573
- background: #eee;
574
- opacity: 0.8;
575
- border: 1px solid #ddd;
576
- }
577
-
578
- .bbp-pagination-links span.dots {
579
- display: block;
580
- float: right;
581
- padding: 1px 4px;
582
- margin-right: 5px;
583
- }
584
-
585
  .bbp-pagination {
586
- float: right;
587
- width: 100%;
588
- margin-bottom: 15px;
589
  }
590
-
591
  .bbp-topic-pagination {
592
- display: inline-block;
593
- margin-right: 5px;
594
- margin-bottom: 2px;
595
- }
596
- .bbp-topic-pagination a {
597
- font-size: 10px;
598
- line-height: 10px;
599
- padding: 1px 3px;
600
- border: 1px solid #ddd;
601
- text-decoration: none;
602
- }
603
-
604
 
605
  /* =Forms
606
  -------------------------------------------------------------- */
607
 
608
  #bbpress-forums fieldset.bbp-form {
609
- clear: right;
610
- }
611
-
612
- #bbpress-forums fieldset.bbp-form {
613
- border: 1px solid #eee;
614
- padding: 10px 20px;
615
- margin-bottom: 10px;
616
- }
617
-
618
- #bbpress-forums fieldset.bbp-form legend {
619
- padding: 5px;
620
- }
621
-
622
- #bbpress-forums fieldset.bbp-form label {
623
- margin: 0;
624
- display: inline-block;
625
- }
626
-
627
- #bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,
628
- #bbp-login fieldset label,
629
- #bbp-register fieldset label,
630
- #bbp-lost-pass fieldset label {
631
- width: 100px;
632
  }
633
-
634
- #bbpress-forums fieldset.bbp-form p,
635
- #bbpress-forums fieldset.bbp-form textarea,
636
- #bbpress-forums fieldset.bbp-form select,
637
- #bbpress-forums fieldset.bbp-form input {
638
- margin: 0 0 8px;
639
- }
640
-
641
- textarea#bbp_reply_content,
642
- textarea#bbp_topic_content,
643
- textarea#bbp_forum_content {
644
- width: 97%;
645
- box-sizing: border-box;
646
- }
647
-
648
- textarea#bbp_forum_content {
649
- height: 210px;
650
- }
651
-
652
  #bbpress-forums fieldset.bbp-forum-form-attributes {
653
- width: 200px;
654
- float: left;
655
- clear: none;
656
- margin-right: 25px;
657
  }
658
-
659
- /**
660
- * Fix for too-long forum names, usually from conversion
661
- */
662
- #bbpress-forums fieldset select#bbp_forum_id {
663
- max-width: 200px;
664
- }
665
-
666
  .bbp-topic-form,
667
  .bbp-reply-form,
668
  .bbp-topic-tag-form {
669
- clear: right;
670
  }
671
  body.topic-edit .bbp-topic-form div.avatar img,
672
  body.reply-edit .bbp-reply-form div.avatar img,
673
  body.single-forum .bbp-topic-form div.avatar img,
674
  body.single-reply .bbp-reply-form div.avatar img {
675
- margin-left: 0;
676
- padding: 10px;
677
- border: 1px solid #ddd;
678
- line-height: 0;
679
- background-color: #efefef;
680
  }
681
-
682
- body.page .bbp-reply-form code,
683
- body.page .bbp-topic-form code,
684
- body.single-topic .bbp-reply-form code,
685
- body.single-forum .bbp-topic-form code,
686
- body.topic-edit .bbp-topic-form code,
687
- body.reply-edit .bbp-reply-form code {
688
- font-size: 10px;
689
- background-color: #f0fff8;
690
- border: 1px solid #CEEFE1;
691
- display: block;
692
- padding: 8px;
693
- margin-top: 5px;
694
- width: 369px;
695
- }
696
-
697
- #merge_tag,
698
- #delete_tag {
699
- display: inline;
700
  }
701
-
702
  div.bbp-submit-wrapper {
703
- margin-top: 15px;
704
- float: left;
705
- clear: both;
706
  }
707
 
708
- p.form-allowed-tags {
709
- max-width: 100%;
710
- }
711
 
712
  /* =TinyMCE in themes
713
  -------------------------------------------------------------- */
714
- #bbpress-forums div.bbp-the-content-wrapper {
715
- margin-bottom: 10px;
716
- }
717
-
718
- #bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content {
719
- width: 100%;
720
- margin: 0;
721
- font-size: 12px;
722
- }
723
-
724
- #bbpress-forums div.bbp-the-content-wrapper table,
725
- #bbpress-forums div.bbp-the-content-wrapper tbody,
726
- #bbpress-forums div.bbp-the-content-wrapper tr,
727
- #bbpress-forums div.bbp-the-content-wrapper td {
728
- border: none;
729
- padding: 0;
730
- margin: 0;
731
- width: auto;
732
- line-height: 1em;
733
- }
734
 
735
  #bbpress-forums div.bbp-the-content-wrapper input {
736
- font-size: 12px;
737
- padding: 5px;
738
- margin: 0 0 0 2px;
739
- line-height: 1em;
740
- }
741
-
742
- #bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar {
743
- padding: 5px;
744
- min-height: 26px;
745
- }
746
- #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar {
747
- padding: 4px 4px 8px;
748
- }
749
-
750
- #bbpress-forums div.wp-editor-container {
751
- margin: 0;
752
- padding: 0;
753
- line-height: 0;
754
- }
755
-
756
- #bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar {
757
- line-height: 16px;
758
  }
759
 
760
  /* =Edit User
761
  -------------------------------------------------------------- */
762
 
763
- #bbpress-forums #bbp-your-profile fieldset {
764
- padding: 20px 20px 0 20px;
 
765
  }
766
- #bbpress-forums #bbp-your-profile fieldset div {
767
- margin-bottom: 20px;
768
- float: right;
769
- width: 100%;
770
- clear: right;
771
- }
772
- #bbpress-forums #bbp-your-profile fieldset select {
773
- margin-bottom: 0;
774
- }
775
- #bbpress-forums #bbp-your-profile fieldset input,
776
- #bbpress-forums #bbp-your-profile fieldset textarea {
777
- margin-bottom: 0;
778
- width: 60%;
779
- background: #f9f9f9;
780
- border: 1px solid #ddd;
781
- box-shadow: none;
782
- padding: 5px 8px;
783
- border-radius: 0;
784
- }
785
- #bbpress-forums #bbp-your-profile fieldset input:focus,
786
- #bbpress-forums #bbp-your-profile fieldset textarea:focus {
787
- border: 1px solid #ccc;
788
- box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
789
- outline-color: rgba(240,255,240,0.1);
790
- }
791
- #bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox {
792
- width: auto;
793
- }
794
- #bbpress-forums #bbp-your-profile fieldset legend {
795
- display: none;
796
- }
797
- #bbpress-forums #bbp-your-profile fieldset label[for] {
798
- float: right;
799
- width: 20%;
800
- padding: 5px 5px 5px 20px;
801
- text-align: left;
802
- cursor: pointer;
803
- }
804
- #bbpress-forums #bbp-your-profile fieldset dl label[for] {
805
- text-align: right;
806
- width: 60%;
807
- }
808
- #bbpress-forums #bbp-your-profile fieldset span.description {
809
- margin: 5px 0 0 20%;
810
- font-size: 12px;
811
- font-style: italic;
812
- float: right;
813
- clear: right;
814
- width: 60%;
815
- padding: 5px 8px;
816
- border: #cee1ef 1px solid;
817
- background-color: #f0f8ff;
818
- }
819
-
820
- #bbpress-forums #bbp-your-profile fieldset fieldset {
821
- margin: 0;
822
- border: none;
823
- padding: 0;
824
- clear: none;
825
- float: none;
826
- }
827
- #bbpress-forums #bbp-your-profile fieldset fieldset.password {
828
- width: 60%;
829
- display: inline;
830
- }
831
- #bbpress-forums #bbp-your-profile fieldset fieldset.password input,
832
- #bbpress-forums #bbp-your-profile fieldset fieldset.password span {
833
- width: 100%;
834
- }
835
- #bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl {
836
- margin: 0;
837
- }
838
- #bbpress-forums #bbp-your-profile fieldset fieldset.password span.description {
839
- margin-right: 0;
840
- margin-bottom: 20px;
841
- }
842
-
843
- #bbpress-forums #bbp-your-profile fieldset.submit button {
844
- float: left;
845
- }
846
-
847
- /* =Notices
848
- -------------------------------------------------------------- */
849
-
850
- div.bbp-template-notice,
851
- div.indicator-hint {
852
- border-width: 1px;
853
- border-style: solid;
854
- padding: 0 0.6em;
855
- margin: 5px 0 15px;
856
- border-radius: 3px;
857
- background-color: #ffffe0;
858
- border-color: #e6db55;
859
- color: #000;
860
- clear: both;
861
  }
862
- div.bbp-template-notice a {
863
- color: #555;
864
- text-decoration: none;
865
  }
866
- div.bbp-template-notice a:hover {
867
- color: #000;
868
- }
869
- div.bbp-template-notice.info {
870
- border: #cee1ef 1px solid;
871
- background-color: #f0f8ff;
872
- }
873
- div.bbp-template-notice.important {
874
- border: #e6db55 1px solid;
875
- background-color: #fffbcc;
876
- }
877
- div.bbp-template-notice.error,
878
- div.bbp-template-notice.warning {
879
- background-color: #ffebe8;
880
- border-color: #c00;
881
- }
882
- div.bbp-template-notice.error a,
883
- div.bbp-template-notice.warning a {
884
- color: #c00;
885
- }
886
- div.bbp-template-notice p {
887
- margin: 0.5em 0 6px 0 !important;
888
- padding: 2px;
889
- font-size: 12px;
890
- line-height: 140%;
891
- }
892
-
893
- /* =Stickies
894
- -------------------------------------------------------------- */
895
-
896
- .bbp-topics-front ul.super-sticky,
897
- .bbp-topics ul.super-sticky,
898
- .bbp-topics ul.sticky,
899
- .bbp-forum-content ul.sticky {
900
- background-color: #ffffe0 !important;
901
- font-size: 1.1em;
902
  }
903
-
904
- /* =Revisions
905
- -------------------------------------------------------------- */
906
-
907
- #bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,
908
- #bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,
909
- #bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log {
910
- border-top: 1px dotted #ddd;
911
- width: 100%;
912
- margin: 0;
913
- padding: 8px 0 0 0;
914
- font-size: 11px;
915
- color: #aaa;
916
  }
917
-
918
- #bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,
919
- #bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,
920
- #bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li {
921
- list-style-type: none;
922
  }
923
 
924
  /* =Widgets
925
  -------------------------------------------------------------- */
926
 
927
- .bbp-login-form fieldset legend {
928
- display: none;
929
- }
930
-
931
- .bbp-login-form .bbp-username input,
932
- .bbp-login-form .bbp-email input,
933
- .bbp-login-form .bbp-password input {
934
- padding: 5px;
935
- }
936
-
937
- .bbp-login-form label {
938
- width: 140px;
939
- display: inline-block;
940
- }
941
-
942
- #sidebar .bbp-login-form label {
943
- width: 70px;
944
- }
945
-
946
- .bbp-login-form .bbp-username,
947
- .bbp-login-form .bbp-email,
948
- .bbp-login-form .bbp-password,
949
- .bbp-login-form .bbp-remember-me,
950
  .bbp-login-form .bbp-submit-wrapper {
951
- margin-top: 10px;
952
- }
953
-
954
- .bbp-login-form .bbp-remember-me {
955
-
956
  }
957
-
958
- .bbp-login-form .bbp-submit-wrapper {
959
- text-align: left;
960
- }
961
-
962
- .bbp-login-form .bbp-login-links {
963
- }
964
-
965
  .bbp-login-form .bbp-login-links a {
966
- float: right;
967
- clear: right;
968
  }
969
-
970
  .bbp-logged-in img.avatar {
971
- float: right;
972
- margin: 0 0 0 15px;
973
- }
974
-
975
- .bbp-logged-in h4 {
976
- font-weight: bold;
977
- font-size: 1.3em;
978
- clear: none;
979
- margin-bottom: 10px;
980
  }
981
 
982
  /* =Avatars
983
  -------------------------------------------------------------- */
984
 
985
- #bbpress-forums p.bbp-topic-meta img.avatar,
986
- #bbpress-forums ul.bbp-reply-revision-log img.avatar,
987
- #bbpress-forums ul.bbp-topic-revision-log img.avatar,
988
- #bbpress-forums div.bbp-template-notice img.avatar,
989
- #bbpress-forums .widget_display_topics img.avatar,
990
- #bbpress-forums .widget_display_replies img.avatar {
991
- float: none;
992
- margin-bottom: -7px;
993
- border: 3px double #ddd;
994
- }
995
-
996
  fieldset div.avatar {
997
- float: left;
998
  }
999
 
1000
  /* =BuddyPress Activity Streams
@@ -1002,130 +249,31 @@ fieldset div.avatar {
1002
 
1003
  .activity-list li.bbp_topic_create .activity-content .activity-inner,
1004
  .activity-list li.bbp_reply_create .activity-content .activity-inner {
1005
- border-right: 2px solid #eaeaea;
1006
- margin-right: 5px;
1007
- padding-right: 10px;
 
 
 
1008
  }
1009
 
 
1010
  /* =User Pages
1011
  -------------------------------------------------------------- */
1012
 
1013
- #bbpress-forums h1 {
1014
- clear: none;
1015
- font-size: 1.8em;
1016
- line-height: 1em;
1017
- padding-bottom: 10px;
1018
- }
1019
-
1020
  #bbpress-forums #bbp-user-wrapper {
1021
- float: right;
1022
- width: 100%;
1023
  }
1024
-
1025
- #bbpress-forums .bbp-user-section {
1026
- overflow: auto;
1027
- }
1028
-
1029
- #bbpress-forums #bbp-user-wrapper h2.entry-title {
1030
- font-size: 1.4em;
1031
- margin: 0;
1032
- padding-bottom: 10px;
1033
- padding-top: 0;
1034
- clear: none;
1035
- }
1036
-
1037
- #bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,
1038
- #bbpress-forums #bbp-user-wrapper ul.bbp-topics,
1039
- #bbpress-forums #bbp-user-wrapper ul.bbp-forums,
1040
- #bbpress-forums #bbp-user-wrapper ul.bbp-replies,
1041
- #bbpress-forums #bbp-user-wrapper fieldset.bbp-form {
1042
- clear: none;
1043
- }
1044
-
1045
  #bbpress-forums #bbp-single-user-details {
1046
- margin: 0;
1047
- width: 150px;
1048
- float: right;
1049
- overflow: hidden;
1050
- }
1051
-
1052
- #bbpress-forums #bbp-single-user-details #bbp-user-avatar {
1053
- margin: 0;
1054
- width: 150px;
1055
- }
1056
-
1057
- #bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar {
1058
- border: none;
1059
- height: 150px;
1060
- padding: 0;
1061
- margin: 0 0 20px 0;
1062
- width: 150px;
1063
  }
1064
-
1065
  #bbpress-forums #bbp-single-user-details #bbp-user-description {
1066
- float: none;
1067
- margin-right: 180px;
1068
- }
1069
-
1070
- #bbpress-forums #bbp-single-user-details #bbp-user-navigation {
1071
- float: none;
1072
- margin: 0;
1073
- }
1074
-
1075
- #bbpress-forums #bbp-single-user-details #bbp-user-navigation li {
1076
- margin: 0;
1077
  }
1078
-
1079
- #bbpress-forums #bbp-single-user-details #bbp-user-navigation a {
1080
- padding: 5px 8px;
1081
- display: block;
1082
- border: 1px solid transparent;
1083
- text-decoration: none;
1084
- }
1085
-
1086
- #bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a {
1087
- background: #eee;
1088
- opacity: 0.8;
1089
- }
1090
-
1091
  #bbpress-forums #bbp-user-body {
1092
- margin-right: 180px;
1093
- }
1094
-
1095
- body.my-account #bbpress-forums {
1096
- border-top: none;
1097
- padding-top: 0;
1098
- margin-bottom: 0;
1099
- }
1100
-
1101
- /* =User Capabilities
1102
- -------------------------------------------------------------- */
1103
-
1104
- #bbpress-forums dl.bbp-user-capabilities {
1105
- display: inline-block;
1106
- vertical-align: top;
1107
- }
1108
-
1109
- #bbpress-forums dl.bbp-user-capabilities dt {
1110
- margin: 0 0 10px;
1111
- text-transform: capitalize;
1112
- }
1113
-
1114
- #bbpress-forums dl.bbp-user-capabilities dd {
1115
- margin: 0;
1116
- padding: 0;
1117
- }
1118
-
1119
- /* =BuddyPress Group Forums
1120
- -------------------------------------------------------------- */
1121
-
1122
- #bbpress-forums div.row-actions {
1123
- font-size: 11px;
1124
- visibility: hidden;
1125
- }
1126
-
1127
- #bbpress-forums li:hover > div.row-actions {
1128
- visibility: visible;
1129
  }
1130
 
1131
  /*--------------------------------------------------------------
@@ -1134,209 +282,63 @@ body.my-account #bbpress-forums {
1134
 
1135
  /* =Standard Mobile Landscape
1136
  -------------------------------------------------------------- */
1137
- @media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
1138
- -webkit-text-size-adjust: none;
1139
- }
1140
  @media only screen and (max-width: 480px) {
1141
- #bbpress-forums div.bbp-topic-tags {
1142
- clear: right;
1143
- float: right;
1144
- }
1145
- div.bbp-search-form input,
1146
- div.bbp-search-form button {
1147
- font-size: 11px;
1148
- padding: 2px;
1149
- }
1150
- li.bbp-forum-info,
1151
- li.bbp-topic-title {
1152
- width: 45%;
1153
- }
1154
- li.bbp-forum-topic-count,
1155
- li.bbp-forum-reply-count,
1156
- li.bbp-topic-voice-count,
1157
- li.bbp-topic-reply-count {
1158
- width: 15%;
1159
- }
1160
- span.bbp-reply-post-date {
1161
- float: right;
1162
- }
1163
- span.bbp-admin-links {
1164
- clear: right;
1165
- float: right;
1166
- }
1167
- #bbpress-forums .bbp-forums-list li {
1168
- display: block;
1169
- font-size: 11px;
1170
- }
1171
- #bbpress-forums div.bbp-reply-author {
1172
- margin: -15px 10px 10px;
1173
- min-height: 100px;
1174
- padding-right: 80px;
1175
- position: relative;
1176
- text-align: right;
1177
- width: 100%;
1178
- }
1179
- #bbpress-forums div.bbp-reply-author a.bbp-author-name {
1180
- clear: none;
1181
- display: inline-block;
1182
- margin-right: 0;
1183
- word-wrap: break-word;
1184
- }
1185
- #bbpress-forums div.bbp-reply-author img.avatar {
1186
- position: absolute;
1187
- top: 15px;
1188
- right: 0;
1189
- width: 60px;
1190
- height: auto;
1191
- }
1192
- #bbpress-forums div.bbp-reply-author .bbp-author-role {
1193
- font-size: 12px;
1194
- font-style: normal;
1195
- }
1196
- #bbpress-forums .bbp-body div.bbp-reply-content {
1197
- clear: both;
1198
- margin: 10px;
1199
- padding: 0;
1200
- }
1201
- #bbpress-forums div.bbp-reply-content p {
1202
- margin-bottom: 1em;
1203
- }
1204
- div.bbp-submit-wrapper {
1205
- float: right;
1206
- }
1207
- #bbpress-forums fieldset.bbp-form {
1208
- padding: 0 10px 10px;
1209
- }
1210
- #bbpress-forums #bbp-user-body {
1211
- clear: both;
1212
- margin-right: 0;
1213
- word-wrap: break-word;
1214
- }
1215
  }
1216
 
1217
  /* =Standard Mobile Portrait
1218
  -------------------------------------------------------------- */
1219
  @media only screen and (max-width: 320px) {
1220
- #bbpress-forums div.bbp-search-form {
1221
- margin-bottom: 10px;
1222
- }
1223
- #bbpress-forums li.bbp-header li.bbp-forum-info,
1224
- #bbpress-forums li.bbp-body li.bbp-forum-info,
1225
- #bbpress-forums li.bbp-header li.bbp-topic-title,
1226
- #bbpress-forums li.bbp-body li.bbp-topic-title {
1227
- width: 100%;
1228
- }
1229
- #bbpress-forums li.bbp-header li.bbp-forum-info,
1230
- #bbpress-forums li.bbp-header li.bbp-topic-title {
1231
- text-align: center;
1232
- text-transform: uppercase;
1233
- }
1234
- #bbpress-forums li.bbp-header li.bbp-forum-topic-count,
1235
- #bbpress-forums li.bbp-header li.bbp-forum-reply-count,
1236
- #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1237
- #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1238
- #bbpress-forums li.bbp-header li.bbp-topic-voice-count,
1239
- #bbpress-forums li.bbp-header li.bbp-topic-reply-count,
1240
- #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1241
- #bbpress-forums li.bbp-body li.bbp-topic-reply-count {
1242
- width: 20%;
1243
- }
1244
- #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1245
- #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1246
- #bbpress-forums li.bbp-header li.bbp-topic-freshness,
1247
- #bbpress-forums li.bbp-body li.bbp-topic-freshness {
1248
- width: 58%;
1249
- }
1250
- #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1251
- #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1252
- #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1253
- #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1254
- #bbpress-forums li.bbp-body li.bbp-topic-reply-count,
1255
- #bbpress-forums li.bbp-body li.bbp-topic-freshness {
1256
- margin-top: 7px;
1257
- }
1258
- #bbpress-forums li.bbp-header,
1259
- #bbpress-forums li.bbp-footer {
1260
- font-size: 10px;
1261
- }
1262
- #bbpress-forums li.bbp-header div.bbp-reply-author {
1263
- text-align: right;
1264
- width: 25%;
1265
- }
1266
- #bbpress-forums li.bbp-header div.bbp-reply-content{
1267
- margin-right: 25%;
1268
- }
1269
- #bbpress-forums div.bbp-template-notice img.avatar,
1270
- #bbpress-forums p.bbp-topic-meta img.avatar {
1271
- width: 14px;
1272
- height: auto;
1273
- }
1274
- #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar {
1275
- padding: 1px;
1276
- }
1277
- #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar td {
1278
- width: 20px;
1279
- height: 20px;
1280
- }
1281
- #bbpress-forums div.wp-editor-container {
1282
- width: 100%;
1283
- overflow: auto;
1284
- }
1285
- #bbpress-forums input#bbp_topic_title,
1286
- #bbpress-forums input#bbp_topic_tags {
1287
- width: 95%;
1288
- }
1289
  }
1290
 
1291
  /* =Extra Small Mobile
1292
  -------------------------------------------------------------- */
1293
  @media only screen and (max-width: 240px) {
1294
- #bbpress-forums li.bbp-header li.bbp-forum-topic-count,
1295
- #bbpress-forums li.bbp-header li.bbp-forum-reply-count,
1296
- #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1297
- #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1298
- #bbpress-forums li.bbp-header li.bbp-topic-voice-count,
1299
- #bbpress-forums li.bbp-header li.bbp-topic-reply-count,
1300
- #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1301
- #bbpress-forums li.bbp-body li.bbp-topic-reply-count,
1302
- #bbpress-forums li.bbp-footer div.bbp-reply-author,
1303
- #bbpress-forums li.bbp-footer div.bbp-reply-content {
1304
- width: 45%;
1305
- }
1306
- #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1307
- #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1308
- #bbpress-forums li.bbp-header li.bbp-topic-freshness,
1309
- #bbpress-forums li.bbp-body li.bbp-topic-freshness,
1310
- #bbpress-forums li.bbp-header div.bbp-reply-author,
1311
- #bbpress-forums li.bbp-header div.bbp-reply-content {
1312
- clear: both;
1313
- width: 100%;
1314
- }
1315
- #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1316
- #bbpress-forums li.bbp-header li.bbp-topic-freshness {
1317
- text-align: center;
1318
- }
1319
- #bbpress-forums li.bbp-body li.bbp-topic-freshness,
1320
- #bbpress-forums li.bbp-header div.bbp-reply-content {
1321
- margin-right: 0;
1322
- text-align: right;
1323
- }
1324
- #bbpress-forums li.bbp-body li.bbp-topic-freshness p.bbp-topic-meta {
1325
- display: inline-block;
1326
- }
1327
- #bbpress-forums li.bbp-header {
1328
- overflow: hidden;
1329
- }
1330
- #bbpress-forums li.bbp-footer div.bbp-reply-content {
1331
- display: inline-block;
1332
- margin-right: 0;
1333
- }
1334
- #bbpress-forums li.bbp-body div.bbp-reply-author {
1335
- min-height: 60px;
1336
- padding-right: 60px;
1337
- }
1338
- #bbpress-forums div.bbp-reply-author img.avatar {
1339
- width: 40px;
1340
- height: auto;
1341
- }
1342
  }
1
  /**
2
+ * bbPress RTL (Right-To-Left) CSS
3
  *
4
  * @package bbPress
5
  * @subpackage Theme
8
  /* =bbPress Style
9
  -------------------------------------------------------------- */
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  #bbpress-forums .bbp-forums-list {
12
+ border-right: 1px solid #ddd;
13
+ padding-right: 15px;
14
+ margin: 0 5px 0 0;
15
+ padding-left: 0;
16
+ border-left: 0;
 
 
 
17
  }
18
+ #bbpress-forums ul.bbp-threaded-replies {
19
+ margin-right: 50px;
20
+ margin-left: 0;
 
21
  }
 
22
  li.bbp-forum-info,
23
  li.bbp-topic-title {
24
+ float: right;
25
+ text-align: right;
 
26
  }
27
  li.bbp-forum-topic-count,
28
  li.bbp-topic-voice-count,
29
  li.bbp-forum-reply-count,
30
  li.bbp-topic-reply-count {
31
+ float: right;
 
 
32
  }
 
33
  li.bbp-forum-freshness,
34
  li.bbp-topic-freshness {
35
+ float: right;
 
 
36
  }
37
+ #bbpress-forums div.bbp-topic-author a.bbp-author-name,
38
+ #bbpress-forums div.bbp-reply-author a.bbp-author-name {
39
+ clear: right;
 
 
 
40
  }
 
41
  li.bbp-header div.bbp-topic-content span#subscription-toggle,
42
  li.bbp-header div.bbp-topic-content span#favorite-toggle,
43
  li.bbp-header div.bbp-reply-content span#subscription-toggle,
44
  li.bbp-header div.bbp-reply-content span#favorite-toggle {
45
+ float: left;
46
  }
47
+ #bbpress-forums div.bbp-forum-author,
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  #bbpress-forums div.bbp-topic-author,
49
  #bbpress-forums div.bbp-reply-author {
50
+ float: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
 
52
  #bbpress-forums li.bbp-header .bbp-search-author,
53
  #bbpress-forums li.bbp-footer .bbp-search-author,
54
  #bbpress-forums li.bbp-header .bbp-forum-author,
57
  #bbpress-forums li.bbp-footer .bbp-topic-author,
58
  #bbpress-forums li.bbp-header .bbp-reply-author,
59
  #bbpress-forums li.bbp-footer .bbp-reply-author {
60
+ float: right;
 
 
 
61
  }
 
62
  #bbpress-forums li.bbp-header .bbp-search-content,
63
  #bbpress-forums li.bbp-footer .bbp-search-content,
64
  #bbpress-forums li.bbp-header .bbp-forum-content,
67
  #bbpress-forums li.bbp-footer .bbp-topic-content,
68
  #bbpress-forums li.bbp-header .bbp-reply-content,
69
  #bbpress-forums li.bbp-footer .bbp-reply-content {
70
+ margin-right: 140px;
71
+ text-align: right;
72
+ margin-left: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
 
75
  /* =Topic and reply content
78
  #bbpress-forums div.bbp-forum-content,
79
  #bbpress-forums div.bbp-topic-content,
80
  #bbpress-forums div.bbp-reply-content {
81
+ padding: 12px 0 12px 12px;
82
+ margin-right: 130px;
83
+ text-align: right;
84
+ margin-left: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  /* =Reply to
88
  -------------------------------------------------------------- */
89
 
90
  #bbpress-forums div.bbp-reply-to {
91
+ padding: 12px 0px 12px 12px;
92
+ margin-right: 130px;
93
+ text-align: left;
94
+ margin-left: 0;
95
  }
 
96
  #bbpress-forums div#bbp-cancel-reply-to {
97
+ text-align: left;
98
  }
99
 
100
  /* =Breadcrumb and Tags
101
  -------------------------------------------------------------- */
102
 
103
  div.bbp-breadcrumb {
104
+ float: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  }
106
 
107
  /* =Search
108
  -------------------------------------------------------------- */
109
 
110
  #bbpress-forums #bbp-search-form {
111
+ clear: right;
112
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  #bbpress-forums div.bbp-search-form {
114
+ float: left;
115
  }
116
 
117
  /* =Admin Links
118
  -------------------------------------------------------------- */
119
 
120
  span.bbp-admin-links {
121
+ float: left;
 
 
 
 
 
 
 
 
122
  }
123
  fieldset span.bbp-admin-links {
124
+ float: right;
 
 
 
125
  }
126
+ .bbp-forum-header a.bbp-forum-permalink,
 
 
 
 
 
127
  .bbp-topic-header a.bbp-topic-permalink,
128
  .bbp-reply-header a.bbp-reply-permalink {
129
+ margin-right: 10px;
130
+ margin-left: 0;
131
+ float: left;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  }
133
 
134
  /* =Pagination
135
  -------------------------------------------------------------- */
136
 
137
  .bbp-pagination-count {
138
+ float: right;
 
139
  }
 
140
  .bbp-pagination-links {
141
+ float: left;
142
+ }
143
+ .bbp-pagination-links a,
144
+ .bbp-pagination-links span.current {
145
+ margin-right: 5px;
146
+ margin-left: 0;
147
+ float: right;
148
+ }
149
+ .bbp-pagination-links span.dots {
150
+ margin-right: 5px;
151
+ margin-left: 0;
152
+ float: right;
153
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  .bbp-pagination {
155
+ float: right;
 
 
156
  }
 
157
  .bbp-topic-pagination {
158
+ margin-right: 5px;
159
+ margin-left: 0;
160
+ }
 
 
 
 
 
 
 
 
 
161
 
162
  /* =Forms
163
  -------------------------------------------------------------- */
164
 
165
  #bbpress-forums fieldset.bbp-form {
166
+ clear: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  #bbpress-forums fieldset.bbp-forum-form-attributes {
169
+ margin-right: 25px;
170
+ margin-left: 25px;
171
+ float: left;
 
172
  }
 
 
 
 
 
 
 
 
173
  .bbp-topic-form,
174
  .bbp-reply-form,
175
  .bbp-topic-tag-form {
176
+ clear: right;
177
  }
178
  body.topic-edit .bbp-topic-form div.avatar img,
179
  body.reply-edit .bbp-reply-form div.avatar img,
180
  body.single-forum .bbp-topic-form div.avatar img,
181
  body.single-reply .bbp-reply-form div.avatar img {
182
+ margin-left: 0;
 
 
 
 
183
  }
184
+ #bbpress-forums div.bbp-topic-tags {
185
+ float: left;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
 
187
  div.bbp-submit-wrapper {
188
+ float: left;
 
 
189
  }
190
 
 
 
 
191
 
192
  /* =TinyMCE in themes
193
  -------------------------------------------------------------- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
  #bbpress-forums div.bbp-the-content-wrapper input {
196
+ margin: 0 0 0 2px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  }
198
 
199
  /* =Edit User
200
  -------------------------------------------------------------- */
201
 
202
+ #bbpress-forums #bbp-your-profile fieldset div {
203
+ float: right;
204
+ clear: right;
205
  }
206
+ #bbpress-forums #bbp-your-profile fieldset label[for] {
207
+ padding: 5px 5px 5px 20px;
208
+ text-align: left;
209
+ float: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
211
+ #bbpress-forums #bbp-your-profile fieldset dl label[for] {
212
+ text-align: right;
 
213
  }
214
+ #bbpress-forums #bbp-your-profile fieldset span.description {
215
+ float: right;
216
+ clear: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  }
218
+ #bbpress-forums #bbp-your-profile fieldset fieldset.password span.description {
219
+ margin-right: 0;
 
 
 
 
 
 
 
 
 
 
 
220
  }
221
+ #bbpress-forums #bbp-your-profile fieldset.submit button {
222
+ float: left;
 
 
 
223
  }
224
 
225
  /* =Widgets
226
  -------------------------------------------------------------- */
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  .bbp-login-form .bbp-submit-wrapper {
229
+ text-align: left;
 
 
 
 
230
  }
 
 
 
 
 
 
 
 
231
  .bbp-login-form .bbp-login-links a {
232
+ float: right;
233
+ clear: right;
234
  }
 
235
  .bbp-logged-in img.avatar {
236
+ margin: 0 0 0 15px;
237
+ float: right;
 
 
 
 
 
 
 
238
  }
239
 
240
  /* =Avatars
241
  -------------------------------------------------------------- */
242
 
 
 
 
 
 
 
 
 
 
 
 
243
  fieldset div.avatar {
244
+ float: left;
245
  }
246
 
247
  /* =BuddyPress Activity Streams
249
 
250
  .activity-list li.bbp_topic_create .activity-content .activity-inner,
251
  .activity-list li.bbp_reply_create .activity-content .activity-inner {
252
+ border-right: 2px solid #eaeaea;
253
+ padding-right: 10px;
254
+ margin-right: 5px;
255
+ padding-right:0;
256
+ border-right:0;
257
+ margin-right:0;
258
  }
259
 
260
+
261
  /* =User Pages
262
  -------------------------------------------------------------- */
263
 
 
 
 
 
 
 
 
264
  #bbpress-forums #bbp-user-wrapper {
265
+ float: right;
 
266
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  #bbpress-forums #bbp-single-user-details {
268
+ float: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  }
 
270
  #bbpress-forums #bbp-single-user-details #bbp-user-description {
271
+ margin-right: 180px;
272
+ margin-left: 0;
 
 
 
 
 
 
 
 
 
273
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  #bbpress-forums #bbp-user-body {
275
+ margin-right: 180px;
276
+ margin-left: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  }
278
 
279
  /*--------------------------------------------------------------
282
 
283
  /* =Standard Mobile Landscape
284
  -------------------------------------------------------------- */
 
 
 
285
  @media only screen and (max-width: 480px) {
286
+ #bbpress-forums div.bbp-topic-tags {
287
+ clear: left;
288
+ float: left;
289
+ }
290
+ span.bbp-reply-post-date {
291
+ float: left;
292
+ }
293
+ span.bbp-admin-links {
294
+ clear: left;
295
+ float: left;
296
+ }
297
+ #bbpress-forums .bbp-body div.bbp-reply-author {
298
+ padding-left: 80px;
299
+ padding-right: 0;
300
+ text-align: left;
301
+ }
302
+ #bbpress-forums div.bbp-reply-author a.bbp-author-name {
303
+ margin-left: 0;
304
+ }
305
+ #bbpress-forums div.bbp-reply-author img.avatar {
306
+ left: auto;
307
+ left: 0;
308
+ }
309
+ div.bbp-submit-wrapper {
310
+ float: left;
311
+ }
312
+ #bbpress-forums #bbp-user-body {
313
+ margin-left: 0;
314
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
316
 
317
  /* =Standard Mobile Portrait
318
  -------------------------------------------------------------- */
319
  @media only screen and (max-width: 320px) {
320
+ #bbpress-forums li.bbp-header div.bbp-reply-author {
321
+ text-align: left;
322
+ }
323
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
324
+ margin-left: 25%;
325
+ margin-right: 0;
326
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  }
328
 
329
  /* =Extra Small Mobile
330
  -------------------------------------------------------------- */
331
  @media only screen and (max-width: 240px) {
332
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness,
333
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
334
+ margin-left: 0;
335
+ text-align: left;
336
+ }
337
+ #bbpress-forums li.bbp-footer div.bbp-reply-content {
338
+ margin-left: 0;
339
+ }
340
+ #bbpress-forums li.bbp-body div.bbp-reply-author {
341
+ padding-left: 60px;
342
+ padding-right: 0;
343
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  }
templates/default/css/bbpress.css CHANGED
@@ -484,7 +484,7 @@ td.bbp-topic-counts {
484
  /* =Toggles
485
  -------------------------------------------------------------- */
486
 
487
- .bbp-topic-action #favorite-toggle a {
488
  text-decoration: none;
489
  padding: 0 3px 1px;
490
  color: #7c7;
@@ -493,23 +493,23 @@ td.bbp-topic-counts {
493
  font-weight: bold;
494
  font-size: 13px;
495
  }
496
- .bbp-topic-action #favorite-toggle a:hover {
497
  color: #5a5;
498
  border-color: #7c7;
499
  background-color: #beb;
500
  }
501
- .bbp-topic-action #favorite-toggle span.is-favorite a {
502
  color: #faa;
503
  border: 1px solid #faa;
504
  background-color: #fee;
505
  }
506
- .bbp-topic-action #favorite-toggle span.is-favorite a:hover {
507
  color: #c88;
508
  border-color: #c88;
509
  background-color: #fdd;
510
  }
511
 
512
- .bbp-topic-action #subscription-toggle a {
513
  text-decoration: none;
514
  padding: 0 3px 1px;
515
  color: #7c7;
@@ -518,17 +518,17 @@ td.bbp-topic-counts {
518
  font-weight: bold;
519
  font-size: 13px;
520
  }
521
- .bbp-topic-action #subscription-toggle a:hover {
522
  color: #5a5;
523
  border-color: #7c7;
524
  background-color: #beb;
525
  }
526
- .bbp-topic-action #subscription-toggle span.is-subscribed a {
527
  color: #faa;
528
  border: 1px solid #faa;
529
  background-color: #fee;
530
  }
531
- .bbp-topic-action #subscription-toggle span.is-subscribed a:hover {
532
  color: #c88;
533
  border-color: #c88;
534
  background-color: #fdd;
@@ -1339,4 +1339,4 @@ body.my-account #bbpress-forums {
1339
  width: 40px;
1340
  height: auto;
1341
  }
1342
- }
484
  /* =Toggles
485
  -------------------------------------------------------------- */
486
 
487
+ .bbp-row-actions #favorite-toggle a {
488
  text-decoration: none;
489
  padding: 0 3px 1px;
490
  color: #7c7;
493
  font-weight: bold;
494
  font-size: 13px;
495
  }
496
+ .bbp-row-actions #favorite-toggle a:hover {
497
  color: #5a5;
498
  border-color: #7c7;
499
  background-color: #beb;
500
  }
501
+ .bbp-row-actions #favorite-toggle span.is-favorite a {
502
  color: #faa;
503
  border: 1px solid #faa;
504
  background-color: #fee;
505
  }
506
+ .bbp-row-actions #favorite-toggle span.is-favorite a:hover {
507
  color: #c88;
508
  border-color: #c88;
509
  background-color: #fdd;
510
  }
511
 
512
+ .bbp-row-actions #subscription-toggle a {
513
  text-decoration: none;
514
  padding: 0 3px 1px;
515
  color: #7c7;
518
  font-weight: bold;
519
  font-size: 13px;
520
  }
521
+ .bbp-row-actions #subscription-toggle a:hover {
522
  color: #5a5;
523
  border-color: #7c7;
524
  background-color: #beb;
525
  }
526
+ .bbp-row-actions #subscription-toggle span.is-subscribed a {
527
  color: #faa;
528
  border: 1px solid #faa;
529
  background-color: #fee;
530
  }
531
+ .bbp-row-actions #subscription-toggle span.is-subscribed a:hover {
532
  color: #c88;
533
  border-color: #c88;
534
  background-color: #fdd;
1339
  width: 40px;
1340
  height: auto;
1341
  }
1342
+ }
templates/default/js/editor.js ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready( function() {
2
+
3
+ /* Use backticks instead of <code> for the Code button in the editor */
4
+ if ( typeof( edButtons ) !== 'undefined' ) {
5
+ edButtons[110] = new QTags.TagButton( 'code', 'code', '`', '`', 'c' );
6
+ QTags._buttonsInit();
7
+ }
8
+
9
+ /* Tab from topic title */
10
+ jQuery( '#bbp_topic_title' ).bind( 'keydown.editor-focus', function(e) {
11
+ if ( e.which !== 9 )
12
+ return;
13
+
14
+ if ( !e.ctrlKey && !e.altKey && !e.shiftKey ) {
15
+ if ( typeof( tinymce ) !== 'undefined' ) {
16
+ if ( ! tinymce.activeEditor.isHidden() ) {
17
+ var editor = tinymce.activeEditor.editorContainer;
18
+ jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
19
+ } else {
20
+ jQuery( 'textarea.bbp-the-content' ).focus();
21
+ }
22
+ } else {
23
+ jQuery( 'textarea.bbp-the-content' ).focus();
24
+ }
25
+
26
+ e.preventDefault();
27
+ }
28
+ });
29
+
30
+ /* Shift + tab from topic tags */
31
+ jQuery( '#bbp_topic_tags' ).bind( 'keydown.editor-focus', function(e) {
32
+ if ( e.which !== 9 )
33
+ return;
34
+
35
+ if ( e.shiftKey && !e.ctrlKey && !e.altKey ) {
36
+ if ( typeof( tinymce ) !== 'undefined' ) {
37
+ if ( ! tinymce.activeEditor.isHidden() ) {
38
+ var editor = tinymce.activeEditor.editorContainer;
39
+ jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
40
+ } else {
41
+ jQuery( 'textarea.bbp-the-content' ).focus();
42
+ }
43
+ } else {
44
+ jQuery( 'textarea.bbp-the-content' ).focus();
45
+ }
46
+
47
+ e.preventDefault();
48
+ }
49
+ });
50
+ });
templates/default/js/user.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ if ( window.location.hash === '#password' ) {
2
+ document.getElementById('pass1').focus();
3
+ }