bbPress - Version 2.6-beta-1

Version Description

Download this release

Release Info

Developer johnjamesjacoby
Plugin Icon 128x128 bbPress
Version 2.6-beta-1
Comparing to
See all releases

Code changes from version 2.5.12 to 2.6-beta-1

Files changed (66) hide show
  1. bbpress.php +158 -99
  2. bbpress.pot +5640 -0
  3. composer.json +29 -0
  4. includes/admin/actions.php +110 -18
  5. includes/admin/admin.php +150 -139
  6. includes/admin/converter.php +521 -176
  7. includes/admin/converters/AEF.php +34 -56
  8. includes/admin/converters/Drupal7.php +115 -34
  9. includes/admin/converters/Example.php +120 -41
  10. includes/admin/converters/FluxBB.php +79 -56
  11. includes/admin/converters/Invision.php +30 -39
  12. includes/admin/converters/Kunena1.php +254 -275
  13. includes/admin/converters/Kunena2.php +114 -135
  14. includes/admin/converters/Kunena3.php +26 -47
  15. includes/admin/converters/Mingle.php +40 -36
  16. includes/admin/converters/MyBB.php +595 -591
  17. includes/admin/converters/PHPFox3.php +25 -52
  18. includes/admin/converters/PHPWind.php +29 -40
  19. includes/admin/converters/Phorum.php +76 -26
  20. includes/admin/converters/PunBB.php +742 -680
  21. includes/admin/converters/SMF.php +815 -740
  22. includes/admin/converters/SimplePress5.php +79 -45
  23. includes/admin/converters/Vanilla.php +109 -60
  24. includes/admin/converters/XMB.php +726 -709
  25. includes/admin/converters/XenForo.php +853 -725
  26. includes/admin/converters/bbPress1.php +153 -54
  27. includes/admin/converters/e107v1.php +640 -0
  28. includes/admin/converters/phpBB.php +191 -77
  29. includes/admin/converters/vBulletin.php +108 -59
  30. includes/admin/converters/vBulletin3.php +103 -56
  31. includes/admin/css/admin-rtl.css +212 -0
  32. includes/admin/css/admin-rtl.min.css +1 -0
  33. includes/admin/css/admin.css +93 -58
  34. includes/admin/css/admin.min.css +1 -0
  35. includes/admin/forums.php +352 -91
  36. includes/admin/functions.php +29 -19
  37. includes/admin/images/badge-2x.png +0 -0
  38. includes/admin/images/badge.png +0 -0
  39. includes/admin/images/button-grad.png +0 -0
  40. includes/admin/images/icons32-2x.png +0 -0
  41. includes/admin/images/icons32.png +0 -0
  42. includes/admin/images/index.php +0 -5
  43. includes/admin/images/menu-2x.png +0 -0
  44. includes/admin/images/menu.png +0 -0
  45. includes/admin/js/common.min.js +2 -0
  46. includes/admin/js/replies.js +3 -0
  47. includes/admin/js/replies.min.js +2 -0
  48. includes/admin/js/topics.min.js +2 -0
  49. includes/admin/list-tables/topic-replies.php +303 -0
  50. includes/admin/metaboxes.php +293 -66
  51. includes/admin/parser.php +21 -4
  52. includes/admin/replies.php +328 -168
  53. includes/admin/settings.php +158 -125
  54. includes/admin/styles/evergreen-rtl.css +0 -168
  55. includes/admin/styles/evergreen.css +0 -168
  56. includes/admin/styles/evergreen/colors-rtl.css +510 -0
  57. includes/admin/styles/evergreen/colors-rtl.min.css +1 -0
  58. includes/admin/styles/evergreen/colors.css +510 -0
  59. includes/admin/styles/evergreen/colors.min.css +1 -0
  60. includes/admin/styles/mint-rtl.css +0 -168
  61. includes/admin/styles/mint.css +0 -168
  62. includes/admin/styles/mint/colors-rtl.css +510 -0
  63. includes/admin/styles/mint/colors-rtl.min.css +1 -0
  64. includes/admin/styles/mint/colors.css +510 -0
  65. includes/admin/styles/mint/colors.min.css +1 -0
  66. includes/admin/tools.php +1024 -123
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 6148 2016-12-09 07:37:52Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
@@ -15,15 +15,16 @@
15
  * Plugin Name: bbPress
16
  * Plugin URI: https://bbpress.org
17
  * Description: bbPress is forum software with a twist from the creators of WordPress.
18
- * Author: The bbPress Community
19
  * Author URI: https://bbpress.org
20
- * Version: 2.5.12
21
  * Text Domain: bbpress
22
  * Domain Path: /languages/
 
23
  */
24
 
25
  // Exit if accessed directly
26
- if ( !defined( 'ABSPATH' ) ) exit;
27
 
28
  if ( !class_exists( 'bbPress' ) ) :
29
  /**
@@ -31,7 +32,7 @@ if ( !class_exists( 'bbPress' ) ) :
31
  *
32
  * "How doth the little busy bee, improve each shining hour..."
33
  *
34
- * @since bbPress (r2464)
35
  */
36
  final class bbPress {
37
 
@@ -58,25 +59,30 @@ final class bbPress {
58
  public $current_user = false;
59
 
60
  /**
61
- * @var obj Add-ons append to this (Akismet, BuddyPress, etc...)
62
  */
63
  public $extend;
64
 
65
  /**
66
  * @var array Topic views
67
  */
68
- public $views = array();
69
 
70
  /**
71
  * @var array Overloads get_option()
72
  */
73
- public $options = array();
74
 
75
  /**
76
  * @var array Overloads get_user_meta()
77
  */
78
  public $user_options = array();
79
 
 
 
 
 
 
80
  /** Singleton *************************************************************/
81
 
82
  /**
@@ -89,13 +95,14 @@ final class bbPress {
89
  * Insures that only one instance of bbPress exists in memory at any one
90
  * time. Also prevents needing to define globals all over the place.
91
  *
92
- * @since bbPress (r3757)
 
93
  * @staticvar object $instance
94
  * @uses bbPress::setup_globals() Setup the globals needed
95
  * @uses bbPress::includes() Include the required files
96
  * @uses bbPress::setup_actions() Setup the hooks and actions
97
  * @see bbpress()
98
- * @return The one true bbPress
99
  */
100
  public static function instance() {
101
 
@@ -119,7 +126,8 @@ final class bbPress {
119
  /**
120
  * A dummy constructor to prevent bbPress from being loaded more than once.
121
  *
122
- * @since bbPress (r2464)
 
123
  * @see bbPress::instance()
124
  * @see bbpress();
125
  */
@@ -128,49 +136,53 @@ final class bbPress {
128
  /**
129
  * A dummy magic method to prevent bbPress from being cloned
130
  *
131
- * @since bbPress (r2464)
132
  */
133
  public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'bbpress' ), '2.1' ); }
134
 
135
  /**
136
  * A dummy magic method to prevent bbPress from being unserialized
137
  *
138
- * @since bbPress (r2464)
139
  */
140
  public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'bbpress' ), '2.1' ); }
141
 
142
  /**
143
  * Magic method for checking the existence of a certain custom field
144
  *
145
- * @since bbPress (r3951)
146
  */
147
- public function __isset( $key ) { return isset( $this->data[$key] ); }
148
 
149
  /**
150
  * Magic method for getting bbPress variables
151
  *
152
- * @since bbPress (r3951)
153
  */
154
- public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
155
 
156
  /**
157
  * Magic method for setting bbPress variables
158
  *
159
- * @since bbPress (r3951)
160
  */
161
- public function __set( $key, $value ) { $this->data[$key] = $value; }
162
 
163
  /**
164
  * Magic method for unsetting bbPress variables
165
  *
166
- * @since bbPress (r4628)
167
  */
168
- public function __unset( $key ) { if ( isset( $this->data[$key] ) ) unset( $this->data[$key] ); }
 
 
 
 
169
 
170
  /**
171
  * Magic method to prevent notices and errors from invalid method calls
172
  *
173
- * @since bbPress (r4252)
174
  */
175
  public function __call( $name = '', $args = array() ) { unset( $name, $args ); return null; }
176
 
@@ -180,7 +192,8 @@ final class bbPress {
180
  * Set some smart defaults to class variables. Allow some of them to be
181
  * filtered to allow for early overriding.
182
  *
183
- * @since bbPress (r2626)
 
184
  * @access private
185
  * @uses plugin_dir_path() To generate bbPress plugin path
186
  * @uses plugin_dir_url() To generate bbPress plugin url
@@ -190,16 +203,18 @@ final class bbPress {
190
 
191
  /** Versions **********************************************************/
192
 
193
- $this->version = '2.5.12-6148';
194
- $this->db_version = '250';
195
 
196
  /** Paths *************************************************************/
197
 
198
- // Setup some base path and URL information
199
  $this->file = __FILE__;
200
- $this->basename = apply_filters( 'bbp_plugin_basenname', plugin_basename( $this->file ) );
201
- $this->plugin_dir = apply_filters( 'bbp_plugin_dir_path', plugin_dir_path( $this->file ) );
202
- $this->plugin_url = apply_filters( 'bbp_plugin_dir_url', plugin_dir_url ( $this->file ) );
 
 
203
 
204
  // Includes
205
  $this->includes_dir = apply_filters( 'bbp_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );
@@ -217,8 +232,8 @@ final class bbPress {
217
  // Post type identifiers
218
  $this->forum_post_type = apply_filters( 'bbp_forum_post_type', 'forum' );
219
  $this->topic_post_type = apply_filters( 'bbp_topic_post_type', 'topic' );
220
- $this->reply_post_type = apply_filters( 'bbp_reply_post_type', 'reply' );
221
  $this->topic_tag_tax_id = apply_filters( 'bbp_topic_tag_tax_id', 'topic-tag' );
 
222
 
223
  // Status identifiers
224
  $this->spam_status_id = apply_filters( 'bbp_spam_post_status', 'spam' );
@@ -269,13 +284,17 @@ final class bbPress {
269
  $this->domain = 'bbpress'; // Unique identifier for retrieving translated strings
270
  $this->extend = new stdClass(); // Plugins add data here
271
  $this->errors = new WP_Error(); // Feedback
 
 
 
272
  $this->tab_index = apply_filters( 'bbp_default_tab_index', 100 );
273
  }
274
 
275
  /**
276
  * Include required files
277
  *
278
- * @since bbPress (r2626)
 
279
  * @access private
280
  * @uses is_admin() If in WordPress admin, load additional file
281
  */
@@ -283,72 +302,74 @@ final class bbPress {
283
 
284
  /** Core **************************************************************/
285
 
286
- require( $this->includes_dir . 'core/sub-actions.php' );
287
- require( $this->includes_dir . 'core/functions.php' );
288
- require( $this->includes_dir . 'core/cache.php' );
289
- require( $this->includes_dir . 'core/options.php' );
290
- require( $this->includes_dir . 'core/capabilities.php' );
291
- require( $this->includes_dir . 'core/update.php' );
292
- require( $this->includes_dir . 'core/template-functions.php' );
293
- require( $this->includes_dir . 'core/template-loader.php' );
294
- require( $this->includes_dir . 'core/theme-compat.php' );
 
295
 
296
  /** Components ********************************************************/
297
 
298
  // Common
299
- require( $this->includes_dir . 'common/ajax.php' );
300
- require( $this->includes_dir . 'common/classes.php' );
301
- require( $this->includes_dir . 'common/functions.php' );
302
- require( $this->includes_dir . 'common/formatting.php' );
303
- require( $this->includes_dir . 'common/locale.php' );
304
- require( $this->includes_dir . 'common/template.php' );
305
- require( $this->includes_dir . 'common/widgets.php' );
306
- require( $this->includes_dir . 'common/shortcodes.php' );
307
 
308
  // Forums
309
- require( $this->includes_dir . 'forums/capabilities.php' );
310
- require( $this->includes_dir . 'forums/functions.php' );
311
- require( $this->includes_dir . 'forums/template.php' );
312
 
313
  // Topics
314
- require( $this->includes_dir . 'topics/capabilities.php' );
315
- require( $this->includes_dir . 'topics/functions.php' );
316
- require( $this->includes_dir . 'topics/template.php' );
317
 
318
  // Replies
319
- require( $this->includes_dir . 'replies/capabilities.php' );
320
- require( $this->includes_dir . 'replies/functions.php' );
321
- require( $this->includes_dir . 'replies/template.php' );
322
 
323
  // Search
324
- require( $this->includes_dir . 'search/functions.php' );
325
- require( $this->includes_dir . 'search/template.php' );
326
 
327
  // Users
328
- require( $this->includes_dir . 'users/capabilities.php' );
329
- require( $this->includes_dir . 'users/functions.php' );
330
- require( $this->includes_dir . 'users/template.php' );
331
- require( $this->includes_dir . 'users/options.php' );
332
 
333
  /** Hooks *************************************************************/
334
 
335
- require( $this->includes_dir . 'core/extend.php' );
336
- require( $this->includes_dir . 'core/actions.php' );
337
- require( $this->includes_dir . 'core/filters.php' );
338
 
339
  /** Admin *************************************************************/
340
 
341
  // Quick admin check and load if needed
342
  if ( is_admin() ) {
343
- require( $this->includes_dir . 'admin/admin.php' );
344
- require( $this->includes_dir . 'admin/actions.php' );
345
  }
346
  }
347
 
348
  /**
349
  * Setup the default hooks and actions
350
  *
351
- * @since bbPress (r2644)
 
352
  * @access private
353
  * @uses add_action() To add various actions
354
  */
@@ -359,13 +380,15 @@ final class bbPress {
359
  add_action( 'deactivate_' . $this->basename, 'bbp_deactivation' );
360
 
361
  // If bbPress is being deactivated, do not add any actions
362
- if ( bbp_is_deactivation( $this->basename ) )
363
  return;
 
364
 
365
  // Array of bbPress core actions
366
  $actions = array(
367
  'setup_theme', // Setup the default theme compat
368
  'setup_current_user', // Setup currently logged in user
 
369
  'register_post_types', // Register post types (forum|topic|reply)
370
  'register_post_statuses', // Register post statuses (closed|spam|orphan|hidden)
371
  'register_taxonomies', // Register taxonomies (topic-tag)
@@ -379,8 +402,9 @@ final class bbPress {
379
  );
380
 
381
  // Add the actions
382
- foreach ( $actions as $class_action )
383
  add_action( 'bbp_' . $class_action, array( $this, $class_action ), 5 );
 
384
 
385
  // All bbPress actions are setup (includes bbp-core-hooks.php)
386
  do_action_ref_array( 'bbp_after_setup_actions', array( &$this ) );
@@ -395,7 +419,7 @@ final class bbPress {
395
  * the bbp-theme-compat folders, it's fine to hardcode these here. If at a
396
  * later date we need to automate this, and API will need to be built.
397
  *
398
- * @since bbPress (r3829)
399
  */
400
  public function register_theme_packages() {
401
 
@@ -417,28 +441,29 @@ final class bbPress {
417
  /**
418
  * Setup the default bbPress theme compatibility location.
419
  *
420
- * @since bbPress (r3778)
421
  */
422
  public function setup_theme() {
423
 
424
  // Bail if something already has this under control
425
- if ( ! empty( $this->theme_compat->theme ) )
426
  return;
 
427
 
428
  // Setup the theme package to use for compatibility
429
  bbp_setup_theme_compat( bbp_get_theme_package_id() );
430
  }
431
 
432
  /**
433
- * Load the translation file for current language. Checks the languages
434
- * folder inside the bbPress plugin first, and then the default WordPress
435
- * languages folder.
436
  *
437
  * Note that custom translation files inside the bbPress plugin folder
438
  * will be removed on bbPress updates. If you're creating custom
439
  * translation files, please use the global language folder.
440
  *
441
- * @since bbPress (r2596)
442
  *
443
  * @uses apply_filters() Calls 'plugin_locale' with {@link get_locale()} value
444
  * @uses load_textdomain() To load the textdomain
@@ -456,7 +481,7 @@ final class bbPress {
456
  // Look in global /wp-content/languages/bbpress folder
457
  load_textdomain( $this->domain, $mofile_global );
458
 
459
- // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
460
  load_textdomain( $this->domain, $mofile_local );
461
 
462
  // Look in global /wp-content/languages/plugins/
@@ -466,7 +491,8 @@ final class bbPress {
466
  /**
467
  * Setup the post types for forums, topics and replies
468
  *
469
- * @since bbPress (r2597)
 
470
  * @uses register_post_type() To register the post types
471
  * @uses apply_filters() Calls various filters to modify the arguments
472
  * sent to register_post_type()
@@ -555,7 +581,8 @@ final class bbPress {
555
  * We do some manipulation of the 'trash' status so trashed topics and
556
  * replies can be viewed from within the theme.
557
  *
558
- * @since bbPress (r2727)
 
559
  * @uses register_post_status() To register post statuses
560
  * @uses $wp_post_statuses To modify trash and private statuses
561
  * @uses current_user_can() To check if the current user is capable &
@@ -623,7 +650,7 @@ final class bbPress {
623
  */
624
  global $wp_post_statuses;
625
 
626
- if ( !empty( $wp_post_statuses['trash'] ) ) {
627
 
628
  // User can view trash so set internal to false
629
  if ( current_user_can( 'view_trash' ) ) {
@@ -638,14 +665,23 @@ final class bbPress {
638
  }
639
 
640
  /**
641
- * Register the topic tag taxonomy
 
 
642
  *
643
- * @since bbPress (r2464)
644
  * @uses register_taxonomy() To register the taxonomy
 
 
 
 
 
 
 
 
645
  */
646
  public static function register_taxonomies() {
647
 
648
- // Register the topic-tag taxonomy
649
  register_taxonomy(
650
  bbp_get_topic_tag_tax_id(),
651
  bbp_get_topic_post_type(),
@@ -659,7 +695,7 @@ final class bbPress {
659
  'hierarchical' => false,
660
  'show_in_nav_menus' => false,
661
  'public' => true,
662
- 'show_ui' => bbp_allow_topic_tags() && current_user_can( 'bbp_topic_tags_admin' )
663
  )
664
  ) );
665
  }
@@ -667,7 +703,8 @@ final class bbPress {
667
  /**
668
  * Register the bbPress views
669
  *
670
- * @since bbPress (r2789)
 
671
  * @uses bbp_register_view() To register the views
672
  */
673
  public static function register_views() {
@@ -678,6 +715,7 @@ final class bbPress {
678
  __( 'Most popular topics', 'bbpress' ),
679
  apply_filters( 'bbp_register_view_popular', array(
680
  'meta_key' => '_bbp_reply_count',
 
681
  'max_num_pages' => 1,
682
  'orderby' => 'meta_value_num',
683
  'show_stickies' => false
@@ -690,6 +728,7 @@ final class bbPress {
690
  __( 'Topics with no replies', 'bbpress' ),
691
  apply_filters( 'bbp_register_view_no_replies', array(
692
  'meta_key' => '_bbp_reply_count',
 
693
  'meta_value' => 1,
694
  'meta_compare' => '<',
695
  'orderby' => '',
@@ -701,7 +740,7 @@ final class bbPress {
701
  /**
702
  * Register the bbPress shortcodes
703
  *
704
- * @since bbPress (r3031)
705
  *
706
  * @uses BBP_Shortcodes
707
  */
@@ -712,24 +751,43 @@ final class bbPress {
712
  /**
713
  * Setup the currently logged-in user
714
  *
715
- * Do not to call this prematurely, I.E. before the 'init' action has
716
- * started. This function is naturally hooked into 'init' to ensure proper
717
- * execution. get_currentuserinfo() is used to check for XMLRPC_REQUEST to
718
- * avoid xmlrpc errors.
719
  *
720
- * @since bbPress (r2697)
721
  * @uses wp_get_current_user()
722
  */
723
  public function setup_current_user() {
724
  $this->current_user = wp_get_current_user();
725
  }
726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727
  /** Custom Rewrite Rules **************************************************/
728
 
729
  /**
730
  * Add the bbPress-specific rewrite tags
731
  *
732
- * @since bbPress (r2753)
 
733
  * @uses add_rewrite_tag() To add the rewrite tags
734
  */
735
  public static function add_rewrite_tags() {
@@ -750,7 +808,8 @@ final class bbPress {
750
  * - Topic views
751
  * - User profiles
752
  *
753
- * @since bbPress (r2688)
 
754
  * @todo Extract into an API
755
  */
756
  public static function add_rewrite_rules() {
@@ -849,7 +908,7 @@ final class bbPress {
849
  * - Topic Views
850
  * - Search
851
  *
852
- * @since bbPress (r4930)
853
  */
854
  public static function add_permastructs() {
855
 
@@ -886,7 +945,7 @@ final class bbPress {
886
  ) );
887
 
888
  // Search Permastruct
889
- add_permastruct( $user_id, $search_slug . '/%' . $search_id . '%', array(
890
  'with_front' => false,
891
  'ep_mask' => EP_NONE,
892
  'paged' => true,
@@ -907,10 +966,10 @@ final class bbPress {
907
  *
908
  * Example: <?php $bbp = bbpress(); ?>
909
  *
910
- * @return The one true bbPress Instance
911
  */
912
  function bbpress() {
913
- return bbpress::instance();
914
  }
915
 
916
  /**
5
  *
6
  * bbPress is forum software with a twist from the creators of WordPress.
7
  *
8
+ * $Id: bbpress.php 6213 2017-01-11 20:42:25Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
15
  * Plugin Name: bbPress
16
  * Plugin URI: https://bbpress.org
17
  * Description: bbPress is forum software with a twist from the creators of WordPress.
18
+ * Author: The bbPress Contributors
19
  * Author URI: https://bbpress.org
20
+ * Version: 2.6-beta-1
21
  * Text Domain: bbpress
22
  * Domain Path: /languages/
23
+ * License: GPLv2 or later (license.txt)
24
  */
25
 
26
  // Exit if accessed directly
27
+ defined( 'ABSPATH' ) || exit;
28
 
29
  if ( !class_exists( 'bbPress' ) ) :
30
  /**
32
  *
33
  * "How doth the little busy bee, improve each shining hour..."
34
  *
35
+ * @since 2.0.0 bbPress (r2464)
36
  */
37
  final class bbPress {
38
 
59
  public $current_user = false;
60
 
61
  /**
62
+ * @var stdClass Add-ons append to this (Akismet, BuddyPress, etc...)
63
  */
64
  public $extend;
65
 
66
  /**
67
  * @var array Topic views
68
  */
69
+ public $views = array();
70
 
71
  /**
72
  * @var array Overloads get_option()
73
  */
74
+ public $options = array();
75
 
76
  /**
77
  * @var array Overloads get_user_meta()
78
  */
79
  public $user_options = array();
80
 
81
+ /**
82
+ * @var array Dynamically initialized user roles
83
+ */
84
+ public $roles = array();
85
+
86
  /** Singleton *************************************************************/
87
 
88
  /**
95
  * Insures that only one instance of bbPress exists in memory at any one
96
  * time. Also prevents needing to define globals all over the place.
97
  *
98
+ * @since 2.1.0 bbPress (r3757)
99
+ *
100
  * @staticvar object $instance
101
  * @uses bbPress::setup_globals() Setup the globals needed
102
  * @uses bbPress::includes() Include the required files
103
  * @uses bbPress::setup_actions() Setup the hooks and actions
104
  * @see bbpress()
105
+ * @return bbPress The one true bbPress
106
  */
107
  public static function instance() {
108
 
126
  /**
127
  * A dummy constructor to prevent bbPress from being loaded more than once.
128
  *
129
+ * @since 2.0.0 bbPress (r2464)
130
+ *
131
  * @see bbPress::instance()
132
  * @see bbpress();
133
  */
136
  /**
137
  * A dummy magic method to prevent bbPress from being cloned
138
  *
139
+ * @since 2.0.0 bbPress (r2464)
140
  */
141
  public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'bbpress' ), '2.1' ); }
142
 
143
  /**
144
  * A dummy magic method to prevent bbPress from being unserialized
145
  *
146
+ * @since 2.0.0 bbPress (r2464)
147
  */
148
  public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'bbpress' ), '2.1' ); }
149
 
150
  /**
151
  * Magic method for checking the existence of a certain custom field
152
  *
153
+ * @since 2.1.0 bbPress (r3951)
154
  */
155
+ public function __isset( $key ) { return isset( $this->data[ $key ] ); }
156
 
157
  /**
158
  * Magic method for getting bbPress variables
159
  *
160
+ * @since 2.1.0 bbPress (r3951)
161
  */
162
+ public function __get( $key ) { return isset( $this->data[ $key ] ) ? $this->data[ $key ] : null; }
163
 
164
  /**
165
  * Magic method for setting bbPress variables
166
  *
167
+ * @since 2.1.0 bbPress (r3951)
168
  */
169
+ public function __set( $key , $value ) { $this->data[ $key ] = $value; }
170
 
171
  /**
172
  * Magic method for unsetting bbPress variables
173
  *
174
+ * @since 2.3.0 bbPress (r4628)
175
  */
176
+ public function __unset( $key ) {
177
+ if ( isset( $this->data[ $key ] ) ) {
178
+ unset( $this->data[ $key ] );
179
+ }
180
+ }
181
 
182
  /**
183
  * Magic method to prevent notices and errors from invalid method calls
184
  *
185
+ * @since 2.2.0 bbPress (r4252)
186
  */
187
  public function __call( $name = '', $args = array() ) { unset( $name, $args ); return null; }
188
 
192
  * Set some smart defaults to class variables. Allow some of them to be
193
  * filtered to allow for early overriding.
194
  *
195
+ * @since 2.0.0 bbPress (r2626)
196
+ *
197
  * @access private
198
  * @uses plugin_dir_path() To generate bbPress plugin path
199
  * @uses plugin_dir_url() To generate bbPress plugin url
203
 
204
  /** Versions **********************************************************/
205
 
206
+ $this->version = '2.6-beta-6213';
207
+ $this->db_version = '260';
208
 
209
  /** Paths *************************************************************/
210
 
211
+ // Base name
212
  $this->file = __FILE__;
213
+ $this->basename = apply_filters( 'bbp_plugin_basename', str_replace( array( 'build/', 'src/' ), '', plugin_basename( $this->file ) ) );
214
+
215
+ // Path and URL
216
+ $this->plugin_dir = apply_filters( 'bbp_plugin_dir_path', plugin_dir_path( $this->file ) );
217
+ $this->plugin_url = apply_filters( 'bbp_plugin_dir_url', plugin_dir_url ( $this->file ) );
218
 
219
  // Includes
220
  $this->includes_dir = apply_filters( 'bbp_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );
232
  // Post type identifiers
233
  $this->forum_post_type = apply_filters( 'bbp_forum_post_type', 'forum' );
234
  $this->topic_post_type = apply_filters( 'bbp_topic_post_type', 'topic' );
 
235
  $this->topic_tag_tax_id = apply_filters( 'bbp_topic_tag_tax_id', 'topic-tag' );
236
+ $this->reply_post_type = apply_filters( 'bbp_reply_post_type', 'reply' );
237
 
238
  // Status identifiers
239
  $this->spam_status_id = apply_filters( 'bbp_spam_post_status', 'spam' );
284
  $this->domain = 'bbpress'; // Unique identifier for retrieving translated strings
285
  $this->extend = new stdClass(); // Plugins add data here
286
  $this->errors = new WP_Error(); // Feedback
287
+
288
+ /** Deprecated ********************************************************/
289
+
290
  $this->tab_index = apply_filters( 'bbp_default_tab_index', 100 );
291
  }
292
 
293
  /**
294
  * Include required files
295
  *
296
+ * @since 2.0.0 bbPress (r2626)
297
+ *
298
  * @access private
299
  * @uses is_admin() If in WordPress admin, load additional file
300
  */
302
 
303
  /** Core **************************************************************/
304
 
305
+ require $this->includes_dir . 'core/abstraction.php';
306
+ require $this->includes_dir . 'core/sub-actions.php';
307
+ require $this->includes_dir . 'core/functions.php';
308
+ require $this->includes_dir . 'core/cache.php';
309
+ require $this->includes_dir . 'core/options.php';
310
+ require $this->includes_dir . 'core/capabilities.php';
311
+ require $this->includes_dir . 'core/update.php';
312
+ require $this->includes_dir . 'core/template-functions.php';
313
+ require $this->includes_dir . 'core/template-loader.php';
314
+ require $this->includes_dir . 'core/theme-compat.php';
315
 
316
  /** Components ********************************************************/
317
 
318
  // Common
319
+ require $this->includes_dir . 'common/ajax.php';
320
+ require $this->includes_dir . 'common/classes.php';
321
+ require $this->includes_dir . 'common/functions.php';
322
+ require $this->includes_dir . 'common/formatting.php';
323
+ require $this->includes_dir . 'common/locale.php';
324
+ require $this->includes_dir . 'common/template.php';
325
+ require $this->includes_dir . 'common/widgets.php';
326
+ require $this->includes_dir . 'common/shortcodes.php';
327
 
328
  // Forums
329
+ require $this->includes_dir . 'forums/capabilities.php';
330
+ require $this->includes_dir . 'forums/functions.php';
331
+ require $this->includes_dir . 'forums/template.php';
332
 
333
  // Topics
334
+ require $this->includes_dir . 'topics/capabilities.php';
335
+ require $this->includes_dir . 'topics/functions.php';
336
+ require $this->includes_dir . 'topics/template.php';
337
 
338
  // Replies
339
+ require $this->includes_dir . 'replies/capabilities.php';
340
+ require $this->includes_dir . 'replies/functions.php';
341
+ require $this->includes_dir . 'replies/template.php';
342
 
343
  // Search
344
+ require $this->includes_dir . 'search/functions.php';
345
+ require $this->includes_dir . 'search/template.php';
346
 
347
  // Users
348
+ require $this->includes_dir . 'users/capabilities.php';
349
+ require $this->includes_dir . 'users/functions.php';
350
+ require $this->includes_dir . 'users/template.php';
351
+ require $this->includes_dir . 'users/options.php';
352
 
353
  /** Hooks *************************************************************/
354
 
355
+ require $this->includes_dir . 'core/extend.php';
356
+ require $this->includes_dir . 'core/actions.php';
357
+ require $this->includes_dir . 'core/filters.php';
358
 
359
  /** Admin *************************************************************/
360
 
361
  // Quick admin check and load if needed
362
  if ( is_admin() ) {
363
+ require $this->includes_dir . 'admin/admin.php';
364
+ require $this->includes_dir . 'admin/actions.php';
365
  }
366
  }
367
 
368
  /**
369
  * Setup the default hooks and actions
370
  *
371
+ * @since 2.0.0 bbPress (r2644)
372
+ *
373
  * @access private
374
  * @uses add_action() To add various actions
375
  */
380
  add_action( 'deactivate_' . $this->basename, 'bbp_deactivation' );
381
 
382
  // If bbPress is being deactivated, do not add any actions
383
+ if ( bbp_is_deactivation( $this->basename ) ) {
384
  return;
385
+ }
386
 
387
  // Array of bbPress core actions
388
  $actions = array(
389
  'setup_theme', // Setup the default theme compat
390
  'setup_current_user', // Setup currently logged in user
391
+ 'roles_init', // User roles init
392
  'register_post_types', // Register post types (forum|topic|reply)
393
  'register_post_statuses', // Register post statuses (closed|spam|orphan|hidden)
394
  'register_taxonomies', // Register taxonomies (topic-tag)
402
  );
403
 
404
  // Add the actions
405
+ foreach ( $actions as $class_action ) {
406
  add_action( 'bbp_' . $class_action, array( $this, $class_action ), 5 );
407
+ }
408
 
409
  // All bbPress actions are setup (includes bbp-core-hooks.php)
410
  do_action_ref_array( 'bbp_after_setup_actions', array( &$this ) );
419
  * the bbp-theme-compat folders, it's fine to hardcode these here. If at a
420
  * later date we need to automate this, and API will need to be built.
421
  *
422
+ * @since 2.1.0 bbPress (r3829)
423
  */
424
  public function register_theme_packages() {
425
 
441
  /**
442
  * Setup the default bbPress theme compatibility location.
443
  *
444
+ * @since 2.1.0 bbPress (r3778)
445
  */
446
  public function setup_theme() {
447
 
448
  // Bail if something already has this under control
449
+ if ( ! empty( $this->theme_compat->theme ) ) {
450
  return;
451
+ }
452
 
453
  // Setup the theme package to use for compatibility
454
  bbp_setup_theme_compat( bbp_get_theme_package_id() );
455
  }
456
 
457
  /**
458
+ * Load the translation file for current language. Checks the deprecated
459
+ * languages folder inside the bbPress plugin first, and then the default
460
+ * WordPress languages folder.
461
  *
462
  * Note that custom translation files inside the bbPress plugin folder
463
  * will be removed on bbPress updates. If you're creating custom
464
  * translation files, please use the global language folder.
465
  *
466
+ * @since 2.0.0 bbPress (r2596)
467
  *
468
  * @uses apply_filters() Calls 'plugin_locale' with {@link get_locale()} value
469
  * @uses load_textdomain() To load the textdomain
481
  // Look in global /wp-content/languages/bbpress folder
482
  load_textdomain( $this->domain, $mofile_global );
483
 
484
+ // Look in local /wp-content/plugins/bbpress/languages/ folder
485
  load_textdomain( $this->domain, $mofile_local );
486
 
487
  // Look in global /wp-content/languages/plugins/
491
  /**
492
  * Setup the post types for forums, topics and replies
493
  *
494
+ * @since 2.0.0 bbPress (r2597)
495
+ *
496
  * @uses register_post_type() To register the post types
497
  * @uses apply_filters() Calls various filters to modify the arguments
498
  * sent to register_post_type()
581
  * We do some manipulation of the 'trash' status so trashed topics and
582
  * replies can be viewed from within the theme.
583
  *
584
+ * @since 2.0.0 bbPress (r2727)
585
+ *
586
  * @uses register_post_status() To register post statuses
587
  * @uses $wp_post_statuses To modify trash and private statuses
588
  * @uses current_user_can() To check if the current user is capable &
650
  */
651
  global $wp_post_statuses;
652
 
653
+ if ( ! empty( $wp_post_statuses['trash'] ) ) {
654
 
655
  // User can view trash so set internal to false
656
  if ( current_user_can( 'view_trash' ) ) {
665
  }
666
 
667
  /**
668
+ * Register the topic tag and forum moderator taxonomies
669
+ *
670
+ * @since 2.0.0 bbPress (r2464) Added bbp_get_topic_tag_tax_id() taxonomy
671
  *
 
672
  * @uses register_taxonomy() To register the taxonomy
673
+ * @uses bbp_get_topic_post_type() To get the topic post type
674
+ * @uses bbp_get_topic_tag_tax_labels() To get the topic tag taxonomy labels
675
+ * @uses bbp_get_topic_tag_tax_rewrite() To get the topic tag taxonomy slug
676
+ * @uses bbp_get_topic_tag_caps() To get topic tag capabilities
677
+ * @uses bbp_allow_topic_tags() To check if topic tags are allowed
678
+ * @uses current_user_can() To check if the current user can edit/delete tags
679
+ * @uses bbp_get_forum_post_type() To get the forum post type
680
+ * @uses current_user_can() To check if the current user can edit/delete forums
681
  */
682
  public static function register_taxonomies() {
683
 
684
+ // Register the topic-tag taxonomy.
685
  register_taxonomy(
686
  bbp_get_topic_tag_tax_id(),
687
  bbp_get_topic_post_type(),
695
  'hierarchical' => false,
696
  'show_in_nav_menus' => false,
697
  'public' => true,
698
+ 'show_ui' => bbp_allow_topic_tags() && current_user_can( 'bbp_topic_tags_admin' ),
699
  )
700
  ) );
701
  }
703
  /**
704
  * Register the bbPress views
705
  *
706
+ * @since 2.0.0 bbPress (r2789)
707
+ *
708
  * @uses bbp_register_view() To register the views
709
  */
710
  public static function register_views() {
715
  __( 'Most popular topics', 'bbpress' ),
716
  apply_filters( 'bbp_register_view_popular', array(
717
  'meta_key' => '_bbp_reply_count',
718
+ 'meta_type' => 'NUMERIC',
719
  'max_num_pages' => 1,
720
  'orderby' => 'meta_value_num',
721
  'show_stickies' => false
728
  __( 'Topics with no replies', 'bbpress' ),
729
  apply_filters( 'bbp_register_view_no_replies', array(
730
  'meta_key' => '_bbp_reply_count',
731
+ 'meta_type' => 'NUMERIC',
732
  'meta_value' => 1,
733
  'meta_compare' => '<',
734
  'orderby' => '',
740
  /**
741
  * Register the bbPress shortcodes
742
  *
743
+ * @since 2.0.0 bbPress (r3031)
744
  *
745
  * @uses BBP_Shortcodes
746
  */
751
  /**
752
  * Setup the currently logged-in user
753
  *
754
+ * @since 2.0.0 bbPress (r2697)
 
 
 
755
  *
 
756
  * @uses wp_get_current_user()
757
  */
758
  public function setup_current_user() {
759
  $this->current_user = wp_get_current_user();
760
  }
761
 
762
+ /**
763
+ * Initialize forum-specific roles
764
+ *
765
+ * @since 2.6.0
766
+ */
767
+ public function roles_init() {
768
+
769
+ // Get role IDs
770
+ $keymaster = bbp_get_keymaster_role();
771
+ $moderator = bbp_get_moderator_role();
772
+ $participant = bbp_get_participant_role();
773
+ $spectator = bbp_get_spectator_role();
774
+ $blocked = bbp_get_blocked_role();
775
+
776
+ // Build the roles into one useful array
777
+ $this->roles[ $keymaster ] = new WP_Role( 'Keymaster', bbp_get_caps_for_role( $keymaster ) );
778
+ $this->roles[ $moderator ] = new WP_Role( 'Moderator', bbp_get_caps_for_role( $moderator ) );
779
+ $this->roles[ $participant ] = new WP_Role( 'Participant', bbp_get_caps_for_role( $participant ) );
780
+ $this->roles[ $spectator ] = new WP_Role( 'Spectator', bbp_get_caps_for_role( $spectator ) );
781
+ $this->roles[ $blocked ] = new WP_Role( 'Blocked', bbp_get_caps_for_role( $blocked ) );
782
+ }
783
+
784
  /** Custom Rewrite Rules **************************************************/
785
 
786
  /**
787
  * Add the bbPress-specific rewrite tags
788
  *
789
+ * @since 2.0.0 bbPress (r2753)
790
+ *
791
  * @uses add_rewrite_tag() To add the rewrite tags
792
  */
793
  public static function add_rewrite_tags() {
808
  * - Topic views
809
  * - User profiles
810
  *
811
+ * @since 2.0.0 bbPress (r2688)
812
+ *
813
  * @todo Extract into an API
814
  */
815
  public static function add_rewrite_rules() {
908
  * - Topic Views
909
  * - Search
910
  *
911
+ * @since 2.4.0 bbPress (r4930)
912
  */
913
  public static function add_permastructs() {
914
 
945
  ) );
946
 
947
  // Search Permastruct
948
+ add_permastruct( $search_id, $search_slug . '/%' . $search_id . '%', array(
949
  'with_front' => false,
950
  'ep_mask' => EP_NONE,
951
  'paged' => true,
966
  *
967
  * Example: <?php $bbp = bbpress(); ?>
968
  *
969
+ * @return bbPress The one true bbPress Instance
970
  */
971
  function bbpress() {
972
+ return bbPress::instance();
973
  }
974
 
975
  /**
bbpress.pot ADDED
@@ -0,0 +1,5640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2017 The bbPress Contributors
2
+ # This file is distributed under the GPLv2 or later (license.txt).
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: bbPress 2.6-beta-1\n"
6
+ "Report-Msgid-Bugs-To: https://bbpress.trac.wordpress.org\n"
7
+ "POT-Creation-Date: 2017-01-12 11:42:56+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: 2017-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
+ "X-Generator: grunt-wp-i18n 0.5.4\n"
15
+
16
+ #: bbpress.php:141 bbpress.php:148
17
+ msgid "Cheatin&#8217; huh?"
18
+ msgstr ""
19
+
20
+ #: bbpress.php:429
21
+ msgid "bbPress Default"
22
+ msgstr ""
23
+
24
+ #: bbpress.php:511
25
+ msgid "bbPress Forums"
26
+ msgstr ""
27
+
28
+ #: bbpress.php:536
29
+ msgid "bbPress Topics"
30
+ msgstr ""
31
+
32
+ #: bbpress.php:561
33
+ msgid "bbPress Replies"
34
+ msgstr ""
35
+
36
+ #: bbpress.php:715
37
+ msgid "Most popular topics"
38
+ msgstr ""
39
+
40
+ #: bbpress.php:728
41
+ msgid "Topics with no replies"
42
+ msgstr ""
43
+
44
+ #: includes/admin/actions.php:153 includes/admin/forums.php:609
45
+ #: includes/admin/settings.php:232 includes/admin/settings.php:253
46
+ #: includes/admin/tools.php:835 includes/admin/topics.php:866
47
+ #: includes/extend/buddypress/activity.php:365
48
+ #: includes/forums/template.php:2858 includes/topics/template.php:47
49
+ #: includes/topics/template.php:48
50
+ #: templates/default/bbpress/content-statistics.php:27
51
+ #: templates/default/bbpress/loop-forums.php:18
52
+ msgid "Topics"
53
+ msgstr ""
54
+
55
+ #: includes/admin/actions.php:158 includes/admin/actions.php:170
56
+ #: includes/admin/forums.php:610
57
+ #: includes/admin/list-tables/topic-replies.php:38
58
+ #: includes/admin/settings.php:240 includes/admin/settings.php:261
59
+ #: includes/admin/tools.php:838 includes/admin/topics.php:408
60
+ #: includes/admin/topics.php:868 includes/core/theme-compat.php:676
61
+ #: includes/extend/buddypress/activity.php:366
62
+ #: includes/forums/template.php:2922 includes/replies/template.php:47
63
+ #: includes/replies/template.php:48
64
+ #: templates/default/bbpress/content-statistics.php:32
65
+ #: templates/default/bbpress/loop-forums.php:20
66
+ #: templates/default/bbpress/loop-replies.php:17
67
+ #: templates/default/bbpress/loop-replies.php:43
68
+ #: templates/default/bbpress/loop-topics.php:18
69
+ msgid "Replies"
70
+ msgstr ""
71
+
72
+ #: includes/admin/actions.php:165 includes/admin/actions.php:177
73
+ #: includes/admin/forums.php:608 includes/admin/metaboxes.php:97
74
+ #: includes/admin/metaboxes.php:425 includes/admin/metaboxes.php:492
75
+ #: includes/admin/replies.php:689 includes/admin/settings.php:303
76
+ #: includes/admin/topics.php:867 includes/extend/buddypress/groups.php:50
77
+ #: includes/extend/buddypress/groups.php:51 includes/forums/template.php:50
78
+ #: templates/default/bbpress/loop-forums.php:17
79
+ msgid "Forum"
80
+ msgstr ""
81
+
82
+ #: includes/admin/actions.php:182 includes/admin/metaboxes.php:114
83
+ #: includes/admin/metaboxes.php:519 includes/admin/replies.php:690
84
+ #: includes/admin/settings.php:311 includes/topics/template.php:49
85
+ #: templates/default/bbpress/content-single-topic-lead.php:20
86
+ #: templates/default/bbpress/content-single-topic-lead.php:88
87
+ #: templates/default/bbpress/loop-topics.php:15
88
+ msgid "Topic"
89
+ msgstr ""
90
+
91
+ #: includes/admin/admin.php:208 includes/admin/functions.php:283
92
+ #: includes/admin/tools.php:36 includes/admin/tools.php:269
93
+ msgid "Repair Forums"
94
+ msgstr ""
95
+
96
+ #: includes/admin/admin.php:209
97
+ msgid "Forum Repair"
98
+ msgstr ""
99
+
100
+ #: includes/admin/admin.php:218 includes/admin/functions.php:287
101
+ #: includes/admin/settings.php:1535
102
+ msgid "Import Forums"
103
+ msgstr ""
104
+
105
+ #: includes/admin/admin.php:219
106
+ msgid "Forum Import"
107
+ msgstr ""
108
+
109
+ #: includes/admin/admin.php:228 includes/admin/functions.php:291
110
+ #: includes/admin/tools.php:308 includes/admin/tools.php:2431
111
+ msgid "Reset Forums"
112
+ msgstr ""
113
+
114
+ #: includes/admin/admin.php:229
115
+ msgid "Forum Reset"
116
+ msgstr ""
117
+
118
+ #: includes/admin/admin.php:243 includes/admin/admin.php:244
119
+ #: includes/admin/admin.php:254 includes/admin/admin.php:255
120
+ #: includes/admin/tools.php:832 includes/admin/users.php:97
121
+ #: includes/common/widgets.php:667 includes/extend/buddypress/loader.php:42
122
+ #: includes/extend/buddypress/loader.php:179
123
+ #: includes/extend/buddypress/loader.php:286
124
+ #: includes/extend/buddypress/loader.php:337 includes/forums/template.php:48
125
+ #: includes/forums/template.php:49
126
+ #: templates/default/bbpress/content-statistics.php:22
127
+ msgid "Forums"
128
+ msgstr ""
129
+
130
+ #: includes/admin/admin.php:267 includes/admin/admin.php:268
131
+ #: includes/admin/admin.php:276 includes/admin/admin.php:277
132
+ msgid "Welcome to bbPress"
133
+ msgstr ""
134
+
135
+ #: includes/admin/admin.php:291 includes/admin/admin.php:292
136
+ #: includes/admin/admin.php:315 includes/admin/admin.php:316
137
+ #: includes/admin/admin.php:1020 includes/admin/admin.php:1108
138
+ msgid "Update Forums"
139
+ msgstr ""
140
+
141
+ #: includes/admin/admin.php:529
142
+ msgid "Settings"
143
+ msgstr ""
144
+
145
+ #: includes/admin/admin.php:534
146
+ msgid "About"
147
+ msgstr ""
148
+
149
+ #: includes/admin/admin.php:553
150
+ msgid "About bbPress"
151
+ msgstr ""
152
+
153
+ #: includes/admin/admin.php:735 includes/admin/admin.php:772
154
+ msgid "%s - %s"
155
+ msgstr ""
156
+
157
+ #: includes/admin/admin.php:790 includes/admin/admin.php:867
158
+ msgid "Welcome to bbPress %s"
159
+ msgstr ""
160
+
161
+ #: includes/admin/admin.php:791
162
+ msgid ""
163
+ "Thank you for updating! bbPress %s is bundled up and ready to weather the "
164
+ "storm of users in your community!"
165
+ msgstr ""
166
+
167
+ #: includes/admin/admin.php:796 includes/admin/admin.php:873
168
+ msgid "What&#8217;s New"
169
+ msgstr ""
170
+
171
+ #: includes/admin/admin.php:798 includes/admin/admin.php:875
172
+ msgid "Credits"
173
+ msgstr ""
174
+
175
+ #: includes/admin/admin.php:803
176
+ msgid "Forum Subscriptions"
177
+ msgstr ""
178
+
179
+ #: includes/admin/admin.php:807
180
+ msgid "Subscribe to Forums"
181
+ msgstr ""
182
+
183
+ #: includes/admin/admin.php:808
184
+ msgid "Now your users can subscribe to new topics in specific forums."
185
+ msgstr ""
186
+
187
+ #: includes/admin/admin.php:812
188
+ msgid "Manage Subscriptions"
189
+ msgstr ""
190
+
191
+ #: includes/admin/admin.php:813
192
+ msgid "Your users can manage all of their subscriptions in one convenient location."
193
+ msgstr ""
194
+
195
+ #: includes/admin/admin.php:819
196
+ msgid "Converters"
197
+ msgstr ""
198
+
199
+ #: includes/admin/admin.php:823
200
+ msgid ""
201
+ "We&#8217;re all abuzz about the hive of new importers, AEF, Drupal, FluxBB, "
202
+ "Kunena Forums for Joomla, MyBB, Phorum, PHPFox, PHPWind, PunBB, SMF, "
203
+ "Xenforo and XMB. Existing importers are now sweeter than honey with "
204
+ "improved importing stickies, topic tags, forum categories and the sting is "
205
+ "now gone if you need to remove imported users."
206
+ msgstr ""
207
+
208
+ #: includes/admin/admin.php:829
209
+ msgid "Theme Compatibility"
210
+ msgstr ""
211
+
212
+ #: includes/admin/admin.php:830
213
+ msgid "Better handling of styles and scripts in the template stack."
214
+ msgstr ""
215
+
216
+ #: includes/admin/admin.php:834
217
+ msgid "Polyglot support"
218
+ msgstr ""
219
+
220
+ #: includes/admin/admin.php:835
221
+ msgid "bbPress fully supports automatic translation updates."
222
+ msgstr ""
223
+
224
+ #: includes/admin/admin.php:839
225
+ msgid "User capabilities"
226
+ msgstr ""
227
+
228
+ #: includes/admin/admin.php:840
229
+ msgid "Roles and capabilities have been swept through, cleaned up, and simplified."
230
+ msgstr ""
231
+
232
+ #: includes/admin/admin.php:846 includes/admin/admin.php:950
233
+ msgid "Go to Forum Settings"
234
+ msgstr ""
235
+
236
+ #: includes/admin/admin.php:868
237
+ msgid ""
238
+ "Thank you for updating! bbPress %s is waxed, polished, and ready for you to "
239
+ "take it for a lap or two around the block!"
240
+ msgstr ""
241
+
242
+ #: includes/admin/admin.php:879
243
+ msgid "bbPress is created by a worldwide swarm of busy, busy bees."
244
+ msgstr ""
245
+
246
+ #: includes/admin/admin.php:881
247
+ msgid "Project Leaders"
248
+ msgstr ""
249
+
250
+ #: includes/admin/admin.php:886
251
+ msgid "Founding Developer"
252
+ msgstr ""
253
+
254
+ #: includes/admin/admin.php:891
255
+ msgid "Lead Developer"
256
+ msgstr ""
257
+
258
+ #: includes/admin/admin.php:896 includes/admin/admin.php:915
259
+ msgid "Feature Developer"
260
+ msgstr ""
261
+
262
+ #: includes/admin/admin.php:901
263
+ msgid "Converter Specialist"
264
+ msgstr ""
265
+
266
+ #: includes/admin/admin.php:905
267
+ msgid "Contributing Developers"
268
+ msgstr ""
269
+
270
+ #: includes/admin/admin.php:910
271
+ msgid "Bug Testing"
272
+ msgstr ""
273
+
274
+ #: includes/admin/admin.php:919
275
+ msgid "Core Contributors to bbPress 2.5"
276
+ msgstr ""
277
+
278
+ #: includes/admin/admin.php:974 includes/admin/admin.php:996
279
+ msgid "Update Forum"
280
+ msgstr ""
281
+
282
+ #: includes/admin/admin.php:985 includes/admin/admin.php:1037
283
+ msgid "All done!"
284
+ msgstr ""
285
+
286
+ #: includes/admin/admin.php:986 includes/admin/admin.php:1038
287
+ msgid "Go Back"
288
+ msgstr ""
289
+
290
+ #: includes/admin/admin.php:995
291
+ msgid "You can update your forum through this page. Hit the link below to update."
292
+ msgstr ""
293
+
294
+ #: includes/admin/admin.php:1063
295
+ msgid ""
296
+ "Warning! Problem updating %1$s. Your server may not be able to connect to "
297
+ "sites running on it. Error message: %2$s"
298
+ msgstr ""
299
+
300
+ #: includes/admin/admin.php:1088
301
+ msgid ""
302
+ "If your browser doesn&#8217;t start loading the next page automatically, "
303
+ "click this link:"
304
+ msgstr ""
305
+
306
+ #: includes/admin/admin.php:1089
307
+ msgid "Next Forums"
308
+ msgstr ""
309
+
310
+ #: includes/admin/admin.php:1107
311
+ msgid ""
312
+ "You can update all the forums on your network through this page. It works "
313
+ "by calling the update script of each site automatically. Hit the link below "
314
+ "to update."
315
+ msgstr ""
316
+
317
+ #: includes/admin/converter.php:90 includes/admin/tools.php:349
318
+ msgid "Database Settings"
319
+ msgstr ""
320
+
321
+ #: includes/admin/converter.php:93
322
+ msgid "Select Platform"
323
+ msgstr ""
324
+
325
+ #: includes/admin/converter.php:97
326
+ msgid "Database Server"
327
+ msgstr ""
328
+
329
+ #: includes/admin/converter.php:101
330
+ msgid "Database Port"
331
+ msgstr ""
332
+
333
+ #: includes/admin/converter.php:105
334
+ msgid "Database Name"
335
+ msgstr ""
336
+
337
+ #: includes/admin/converter.php:109
338
+ msgid "Database User"
339
+ msgstr ""
340
+
341
+ #: includes/admin/converter.php:113
342
+ msgid "Database Password"
343
+ msgstr ""
344
+
345
+ #: includes/admin/converter.php:117
346
+ msgid "Table Prefix"
347
+ msgstr ""
348
+
349
+ #: includes/admin/converter.php:121
350
+ msgid "Options"
351
+ msgstr ""
352
+
353
+ #: includes/admin/converter.php:124
354
+ msgid "Rows Limit"
355
+ msgstr ""
356
+
357
+ #: includes/admin/converter.php:128
358
+ msgid "Delay Time"
359
+ msgstr ""
360
+
361
+ #: includes/admin/converter.php:132
362
+ msgid "Convert Users"
363
+ msgstr ""
364
+
365
+ #: includes/admin/converter.php:136
366
+ msgid "Start Over"
367
+ msgstr ""
368
+
369
+ #: includes/admin/converter.php:140
370
+ msgid "Purge Previous Import"
371
+ msgstr ""
372
+
373
+ #: includes/admin/converter.php:229
374
+ msgid "Starting Conversion"
375
+ msgstr ""
376
+
377
+ #: includes/admin/converter.php:254 includes/admin/converter.php:623
378
+ msgid "Conversion Complete"
379
+ msgstr ""
380
+
381
+ #: includes/admin/converter.php:355
382
+ msgid "No data to clean"
383
+ msgstr ""
384
+
385
+ #: includes/admin/converter.php:359
386
+ msgid "Deleting previously converted data (%1$s - %2$s)"
387
+ msgstr ""
388
+
389
+ #: includes/admin/converter.php:375
390
+ msgid "No users to convert"
391
+ msgstr ""
392
+
393
+ #: includes/admin/converter.php:379
394
+ msgid "Converting users (%1$s - %2$s)"
395
+ msgstr ""
396
+
397
+ #: includes/admin/converter.php:395
398
+ msgid "No passwords to clear"
399
+ msgstr ""
400
+
401
+ #: includes/admin/converter.php:399
402
+ msgid "Delete users WordPress default passwords (%1$s - %2$s)"
403
+ msgstr ""
404
+
405
+ #: includes/admin/converter.php:414
406
+ msgid "No forums to convert"
407
+ msgstr ""
408
+
409
+ #: includes/admin/converter.php:418
410
+ msgid "Converting forums (%1$s - %2$s)"
411
+ msgstr ""
412
+
413
+ #: includes/admin/converter.php:429
414
+ msgid "No forum parents to convert"
415
+ msgstr ""
416
+
417
+ #: includes/admin/converter.php:433
418
+ msgid "Calculating forum hierarchy (%1$s - %2$s)"
419
+ msgstr ""
420
+
421
+ #: includes/admin/converter.php:444
422
+ msgid "No forum subscriptions to convert"
423
+ msgstr ""
424
+
425
+ #: includes/admin/converter.php:448
426
+ msgid "Converting forum subscriptions (%1$s - %2$s)"
427
+ msgstr ""
428
+
429
+ #: includes/admin/converter.php:459
430
+ msgid "No topics to convert"
431
+ msgstr ""
432
+
433
+ #: includes/admin/converter.php:463
434
+ msgid "Converting topics (%1$s - %2$s)"
435
+ msgstr ""
436
+
437
+ #: includes/admin/converter.php:474
438
+ msgid "No anonymous topic authors to convert"
439
+ msgstr ""
440
+
441
+ #: includes/admin/converter.php:478
442
+ msgid "Converting anonymous topic authors (%1$s - %2$s)"
443
+ msgstr ""
444
+
445
+ #: includes/admin/converter.php:489
446
+ msgid "No stickies to stick"
447
+ msgstr ""
448
+
449
+ #: includes/admin/converter.php:493
450
+ msgid "Calculating topic stickies (%1$s - %2$s)"
451
+ msgstr ""
452
+
453
+ #: includes/admin/converter.php:504
454
+ msgid "No super stickies to stick"
455
+ msgstr ""
456
+
457
+ #: includes/admin/converter.php:508
458
+ msgid "Calculating topic super stickies (%1$s - %2$s)"
459
+ msgstr ""
460
+
461
+ #: includes/admin/converter.php:519
462
+ msgid "No closed topics to close"
463
+ msgstr ""
464
+
465
+ #: includes/admin/converter.php:523
466
+ msgid "Calculating closed topics (%1$s - %2$s)"
467
+ msgstr ""
468
+
469
+ #: includes/admin/converter.php:534
470
+ msgid "No topic tags to convert"
471
+ msgstr ""
472
+
473
+ #: includes/admin/converter.php:538
474
+ msgid "Converting topic tags (%1$s - %2$s)"
475
+ msgstr ""
476
+
477
+ #: includes/admin/converter.php:549
478
+ msgid "No topic subscriptions to convert"
479
+ msgstr ""
480
+
481
+ #: includes/admin/converter.php:553
482
+ msgid "Converting topic subscriptions (%1$s - %2$s)"
483
+ msgstr ""
484
+
485
+ #: includes/admin/converter.php:564
486
+ msgid "No favorites to convert"
487
+ msgstr ""
488
+
489
+ #: includes/admin/converter.php:568
490
+ msgid "Converting favorites (%1$s - %2$s)"
491
+ msgstr ""
492
+
493
+ #: includes/admin/converter.php:579
494
+ msgid "No replies to convert"
495
+ msgstr ""
496
+
497
+ #: includes/admin/converter.php:583
498
+ msgid "Converting replies (%1$s - %2$s)"
499
+ msgstr ""
500
+
501
+ #: includes/admin/converter.php:594
502
+ msgid "No anonymous reply authors to convert"
503
+ msgstr ""
504
+
505
+ #: includes/admin/converter.php:598
506
+ msgid "Converting anonymous reply authors (%1$s - %2$s)"
507
+ msgstr ""
508
+
509
+ #: includes/admin/converter.php:609
510
+ msgid "No threaded replies to convert"
511
+ msgstr ""
512
+
513
+ #: includes/admin/converter.php:613
514
+ msgid "Calculating threaded replies parents (%1$s - %2$s)"
515
+ msgstr ""
516
+
517
+ #: includes/admin/forums.php:116 includes/admin/replies.php:127
518
+ #: includes/admin/settings.php:1577 includes/admin/tools.php:340
519
+ #: includes/admin/topics.php:130
520
+ msgid "Overview"
521
+ msgstr ""
522
+
523
+ #: includes/admin/forums.php:118
524
+ msgid ""
525
+ "This screen displays the individual forums on your site. You can customize "
526
+ "the display of this screen to suit your workflow."
527
+ msgstr ""
528
+
529
+ #: includes/admin/forums.php:124 includes/admin/replies.php:135
530
+ #: includes/admin/topics.php:138
531
+ msgid "Screen Content"
532
+ msgstr ""
533
+
534
+ #: includes/admin/forums.php:126 includes/admin/replies.php:137
535
+ #: includes/admin/topics.php:140
536
+ msgid ""
537
+ "You can customize the display of this screen&#8217;s contents in a number "
538
+ "of ways:"
539
+ msgstr ""
540
+
541
+ #: includes/admin/forums.php:128
542
+ msgid ""
543
+ "You can hide/display columns based on your needs and decide how many forums "
544
+ "to list per screen using the Screen Options tab."
545
+ msgstr ""
546
+
547
+ #: includes/admin/forums.php:129
548
+ msgid ""
549
+ "You can filter the list of forums by forum status using the text links in "
550
+ "the upper left to show All, Published, or Trashed forums. The default view "
551
+ "is to show all forums."
552
+ msgstr ""
553
+
554
+ #: includes/admin/forums.php:130
555
+ msgid ""
556
+ "You can refine the list to show only forums from a specific month by using "
557
+ "the dropdown menus above the forums list. Click the Filter button after "
558
+ "making your selection. You also can refine the list by clicking on the "
559
+ "forum creator in the forums list."
560
+ msgstr ""
561
+
562
+ #: includes/admin/forums.php:137 includes/admin/replies.php:149
563
+ #: includes/admin/topics.php:152
564
+ msgid "Available Actions"
565
+ msgstr ""
566
+
567
+ #: includes/admin/forums.php:139
568
+ msgid ""
569
+ "Hovering over a row in the forums list will display action links that allow "
570
+ "you to manage your forum. You can perform the following actions:"
571
+ msgstr ""
572
+
573
+ #: includes/admin/forums.php:141
574
+ msgid ""
575
+ "<strong>Edit</strong> takes you to the editing screen for that forum. You "
576
+ "can also reach that screen by clicking on the forum title."
577
+ msgstr ""
578
+
579
+ #: includes/admin/forums.php:142
580
+ msgid ""
581
+ "<strong>Trash</strong> removes your forum from this list and places it in "
582
+ "the trash, from which you can permanently delete it."
583
+ msgstr ""
584
+
585
+ #: includes/admin/forums.php:143
586
+ msgid ""
587
+ "<strong>View</strong> will show you what your draft forum will look like if "
588
+ "you publish it. View will take you to your live site to view the forum. "
589
+ "Which link is available depends on your forum&#8217;s status."
590
+ msgstr ""
591
+
592
+ #: includes/admin/forums.php:150 includes/admin/replies.php:165
593
+ #: includes/admin/tools.php:54 includes/admin/tools.php:150
594
+ #: includes/admin/topics.php:170
595
+ msgid "Bulk Actions"
596
+ msgstr ""
597
+
598
+ #: includes/admin/forums.php:152
599
+ msgid ""
600
+ "You can also edit or move multiple forums to the trash at once. Select the "
601
+ "forums you want to act on using the checkboxes, then select the action you "
602
+ "want to take from the Bulk Actions menu and click Apply."
603
+ msgstr ""
604
+
605
+ #: includes/admin/forums.php:153
606
+ msgid ""
607
+ "When using Bulk Edit, you can change the metadata (categories, author, "
608
+ "etc.) for all selected forums at once. To remove a forum from the grouping, "
609
+ "just click the x next to its name in the Bulk Edit area that appears."
610
+ msgstr ""
611
+
612
+ #: includes/admin/forums.php:158 includes/admin/forums.php:216
613
+ #: includes/admin/replies.php:173 includes/admin/replies.php:229
614
+ #: includes/admin/settings.php:1623 includes/admin/tools.php:282
615
+ #: includes/admin/tools.php:314 includes/admin/tools.php:374
616
+ #: includes/admin/topics.php:178 includes/admin/topics.php:233
617
+ msgid "For more information:"
618
+ msgstr ""
619
+
620
+ #: includes/admin/forums.php:159 includes/admin/forums.php:217
621
+ #: includes/admin/replies.php:174 includes/admin/replies.php:230
622
+ #: includes/admin/settings.php:1624 includes/admin/tools.php:283
623
+ #: includes/admin/tools.php:315 includes/admin/tools.php:375
624
+ #: includes/admin/topics.php:179 includes/admin/topics.php:234
625
+ msgid ""
626
+ "<a href=\"https://codex.bbpress.org\" target=\"_blank\">bbPress "
627
+ "Documentation</a>"
628
+ msgstr ""
629
+
630
+ #: includes/admin/forums.php:160 includes/admin/forums.php:218
631
+ #: includes/admin/replies.php:175 includes/admin/replies.php:231
632
+ #: includes/admin/settings.php:1625 includes/admin/tools.php:284
633
+ #: includes/admin/tools.php:316 includes/admin/tools.php:376
634
+ #: includes/admin/topics.php:180 includes/admin/topics.php:235
635
+ msgid ""
636
+ "<a href=\"https://bbpress.org/forums/\" target=\"_blank\">bbPress Support "
637
+ "Forums</a>"
638
+ msgstr ""
639
+
640
+ #: includes/admin/forums.php:173
641
+ msgid ""
642
+ "The title field and the big forum editing Area are fixed in place, but you "
643
+ "can reposition all the other boxes using drag and drop, and can minimize or "
644
+ "expand them by clicking the title bar of each box. Use the Screen Options "
645
+ "tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, "
646
+ "Discussion, Slug, Author) or to choose a 1- or 2-column layout for this "
647
+ "screen."
648
+ msgstr ""
649
+
650
+ #: includes/admin/forums.php:177 includes/admin/replies.php:192
651
+ #: includes/admin/topics.php:197
652
+ msgid "Customizing This Display"
653
+ msgstr ""
654
+
655
+ #: includes/admin/forums.php:183
656
+ msgid "Title and Forum Editor"
657
+ msgstr ""
658
+
659
+ #: includes/admin/forums.php:185
660
+ msgid ""
661
+ "<strong>Title</strong> - Enter a title for your forum. After you enter a "
662
+ "title, you&#8217;ll see the permalink below, which you can edit."
663
+ msgstr ""
664
+
665
+ #: includes/admin/forums.php:186
666
+ msgid ""
667
+ "<strong>Forum Editor</strong> - Enter the text for your forum. There are "
668
+ "two modes of editing: Visual and HTML. Choose the mode by clicking on the "
669
+ "appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last "
670
+ "icon in the row to get a second row of controls. The HTML mode allows you "
671
+ "to enter raw HTML along with your forum text. You can insert media files by "
672
+ "clicking the icons above the forum editor and following the directions. You "
673
+ "can go to the distraction-free writing screen via the Fullscreen icon in "
674
+ "Visual mode (second to last in the top row) or the Fullscreen button in "
675
+ "HTML mode (last in the row). Once there, you can make buttons visible by "
676
+ "hovering over the top area. Exit Fullscreen back to the regular forum "
677
+ "editor."
678
+ msgstr ""
679
+
680
+ #: includes/admin/forums.php:189
681
+ msgid ""
682
+ "<strong>Publish</strong> - You can set the terms of publishing your forum "
683
+ "in the Publish box. For Status, Visibility, and Publish (immediately), "
684
+ "click on the Edit link to reveal more options. Visibility includes options "
685
+ "for password-protecting a forum or making it stay at the top of your blog "
686
+ "indefinitely (sticky). Publish (immediately) allows you to set a future or "
687
+ "past date and time, so you can schedule a forum to be published in the "
688
+ "future or backdate a forum."
689
+ msgstr ""
690
+
691
+ #: includes/admin/forums.php:192
692
+ msgid ""
693
+ "<strong>Featured Image</strong> - This allows you to associate an image "
694
+ "with your forum without inserting it. This is usually useful only if your "
695
+ "theme makes use of the featured image as a forum thumbnail on the home "
696
+ "page, a custom header, etc."
697
+ msgstr ""
698
+
699
+ #: includes/admin/forums.php:197 includes/admin/forums.php:234
700
+ msgid "Forum Attributes"
701
+ msgstr ""
702
+
703
+ #: includes/admin/forums.php:199
704
+ msgid "Select the attributes that your forum should have:"
705
+ msgstr ""
706
+
707
+ #: includes/admin/forums.php:201
708
+ msgid ""
709
+ "<strong>Type</strong> indicates if the forum is a category or forum. "
710
+ "Categories generally contain other forums."
711
+ msgstr ""
712
+
713
+ #: includes/admin/forums.php:202
714
+ msgid ""
715
+ "<strong>Status</strong> allows you to close a forum to new topics and "
716
+ "forums."
717
+ msgstr ""
718
+
719
+ #: includes/admin/forums.php:203
720
+ msgid ""
721
+ "<strong>Visibility</strong> lets you pick the scope of each forum and what "
722
+ "users are allowed to access it."
723
+ msgstr ""
724
+
725
+ #: includes/admin/forums.php:204
726
+ msgid ""
727
+ "<strong>Parent</strong> dropdown determines the parent forum. Select the "
728
+ "forum or category from the dropdown, or leave the default \"No parent\" to "
729
+ "create the forum at the root of your forums."
730
+ msgstr ""
731
+
732
+ #: includes/admin/forums.php:205
733
+ msgid "<strong>Order</strong> allows you to order your forums numerically."
734
+ msgstr ""
735
+
736
+ #: includes/admin/forums.php:211 includes/admin/replies.php:224
737
+ #: includes/admin/topics.php:228
738
+ msgid "Publish Box"
739
+ msgstr ""
740
+
741
+ #: includes/admin/forums.php:261 includes/admin/settings.php:168
742
+ #: includes/admin/tools.php:2449
743
+ msgid "Forum Moderators"
744
+ msgstr ""
745
+
746
+ #: includes/admin/forums.php:293 includes/admin/settings.php:152
747
+ #: includes/admin/settings.php:388 includes/admin/topics.php:472
748
+ #: includes/extend/buddypress/loader.php:237
749
+ #: templates/default/bbpress/user-details.php:56
750
+ msgid "Subscriptions"
751
+ msgstr ""
752
+
753
+ #: includes/admin/forums.php:493
754
+ msgid "The forum was not found."
755
+ msgstr ""
756
+
757
+ #: includes/admin/forums.php:498 includes/admin/replies.php:563
758
+ #: includes/admin/topics.php:671
759
+ msgid "You do not have permission to do that."
760
+ msgstr ""
761
+
762
+ #: includes/admin/forums.php:569
763
+ msgid "There was a problem opening the forum \"%1$s\"."
764
+ msgstr ""
765
+
766
+ #: includes/admin/forums.php:570
767
+ msgid "Forum \"%1$s\" successfully opened."
768
+ msgstr ""
769
+
770
+ #: includes/admin/forums.php:575
771
+ msgid "There was a problem closing the forum \"%1$s\"."
772
+ msgstr ""
773
+
774
+ #: includes/admin/forums.php:576
775
+ msgid "Forum \"%1$s\" successfully closed."
776
+ msgstr ""
777
+
778
+ #: includes/admin/forums.php:611 includes/admin/metaboxes.php:662
779
+ msgid "Moderators"
780
+ msgstr ""
781
+
782
+ #: includes/admin/forums.php:612
783
+ #: templates/default/bbpress/content-single-topic-lead.php:16
784
+ #: templates/default/bbpress/content-single-topic-lead.php:84
785
+ msgid "Creator"
786
+ msgstr ""
787
+
788
+ #: includes/admin/forums.php:613 includes/admin/replies.php:692
789
+ #: includes/admin/topics.php:871
790
+ msgid "Created"
791
+ msgstr ""
792
+
793
+ #: includes/admin/forums.php:614 includes/admin/topics.php:872
794
+ #: templates/default/bbpress/loop-forums.php:23
795
+ #: templates/default/bbpress/loop-topics.php:21
796
+ msgid "Last Post"
797
+ msgstr ""
798
+
799
+ #: includes/admin/forums.php:657
800
+ msgid "&mdash;"
801
+ msgstr ""
802
+
803
+ #: includes/admin/forums.php:674 includes/forums/template.php:613
804
+ msgid "No Topics"
805
+ msgstr ""
806
+
807
+ #: includes/admin/forums.php:715
808
+ msgid "Close this forum"
809
+ msgstr ""
810
+
811
+ #: includes/admin/forums.php:717
812
+ msgid "Open this forum"
813
+ msgstr ""
814
+
815
+ #: includes/admin/forums.php:759 includes/admin/forums.php:771
816
+ msgid "Forum updated."
817
+ msgstr ""
818
+
819
+ #: includes/admin/forums.php:761 includes/admin/forums.php:784
820
+ msgid "View forum"
821
+ msgstr ""
822
+
823
+ #: includes/admin/forums.php:765 includes/admin/replies.php:984
824
+ #: includes/admin/topics.php:1169
825
+ msgid "Custom field updated."
826
+ msgstr ""
827
+
828
+ #: includes/admin/forums.php:768 includes/admin/replies.php:987
829
+ #: includes/admin/topics.php:1172
830
+ msgid "Custom field deleted."
831
+ msgstr ""
832
+
833
+ #: includes/admin/forums.php:776
834
+ #. translators: %s: date and time of the revision
835
+ msgid "Forum restored to revision from %s"
836
+ msgstr ""
837
+
838
+ #: includes/admin/forums.php:782
839
+ msgid "Forum created."
840
+ msgstr ""
841
+
842
+ #: includes/admin/forums.php:788
843
+ msgid "Forum saved."
844
+ msgstr ""
845
+
846
+ #: includes/admin/forums.php:793
847
+ msgid "Forum submitted."
848
+ msgstr ""
849
+
850
+ #: includes/admin/forums.php:795 includes/admin/forums.php:807
851
+ #: includes/admin/forums.php:815
852
+ msgid "Preview forum"
853
+ msgstr ""
854
+
855
+ #: includes/admin/forums.php:802
856
+ msgid "Forum scheduled for: %s."
857
+ msgstr ""
858
+
859
+ #: includes/admin/forums.php:804 includes/admin/replies.php:1023
860
+ #: includes/admin/topics.php:1208
861
+ #. translators: Publish box date format, see http:php.net/date
862
+ msgid "M j, Y @ G:i"
863
+ msgstr ""
864
+
865
+ #: includes/admin/forums.php:813
866
+ msgid "Forum draft updated."
867
+ msgstr ""
868
+
869
+ #: includes/admin/list-tables/topic-replies.php:56
870
+ #: includes/admin/replies.php:691 includes/admin/topics.php:870
871
+ #: templates/default/bbpress/loop-replies.php:15
872
+ #: templates/default/bbpress/loop-replies.php:41
873
+ #: templates/default/bbpress/loop-search.php:16
874
+ #: templates/default/bbpress/loop-search.php:38
875
+ msgid "Author"
876
+ msgstr ""
877
+
878
+ #: includes/admin/list-tables/topic-replies.php:57
879
+ msgid "Content"
880
+ msgstr ""
881
+
882
+ #: includes/admin/list-tables/topic-replies.php:58
883
+ msgid "Replied"
884
+ msgstr ""
885
+
886
+ #: includes/admin/list-tables/topic-replies.php:87
887
+ msgid "Unapprove"
888
+ msgstr ""
889
+
890
+ #: includes/admin/list-tables/topic-replies.php:88
891
+ #: includes/admin/replies.php:249 includes/admin/replies.php:864
892
+ #: includes/admin/topics.php:253 includes/admin/topics.php:1050
893
+ #: includes/replies/template.php:2171 includes/topics/template.php:3041
894
+ msgid "Spam"
895
+ msgstr ""
896
+
897
+ #: includes/admin/list-tables/topic-replies.php:89
898
+ #: includes/admin/replies.php:875 includes/admin/topics.php:1060
899
+ #: includes/replies/template.php:2099 includes/topics/template.php:2719
900
+ msgid "Trash"
901
+ msgstr ""
902
+
903
+ #: includes/admin/list-tables/topic-replies.php:141
904
+ #: includes/admin/replies.php:840 includes/admin/topics.php:1006
905
+ #: includes/admin/topics.php:1019
906
+ msgid "View"
907
+ msgstr ""
908
+
909
+ #: includes/admin/list-tables/topic-replies.php:146
910
+ #: includes/common/template.php:2294 includes/forums/template.php:54
911
+ #: includes/replies/template.php:53 includes/replies/template.php:1972
912
+ #: includes/topics/template.php:53 includes/topics/template.php:2592
913
+ #: templates/default/bbpress/user-details.php:63
914
+ msgid "Edit"
915
+ msgstr ""
916
+
917
+ #: includes/admin/list-tables/topic-replies.php:239
918
+ msgid "No replies to this topic."
919
+ msgstr ""
920
+
921
+ #: includes/admin/metaboxes.php:28
922
+ msgid "%s Forum"
923
+ msgid_plural "%s Forums"
924
+ msgstr[0] ""
925
+ msgstr[1] ""
926
+
927
+ #: includes/admin/metaboxes.php:35
928
+ msgid "%s Topic"
929
+ msgid_plural "%s Topics"
930
+ msgstr[0] ""
931
+ msgstr[1] ""
932
+
933
+ #: includes/admin/metaboxes.php:42
934
+ msgid "%s Reply"
935
+ msgid_plural "%s Replies"
936
+ msgstr[0] ""
937
+ msgstr[1] ""
938
+
939
+ #: includes/admin/metaboxes.php:49
940
+ msgid "%s Topic Tag"
941
+ msgid_plural "%s Topic Tags"
942
+ msgstr[0] ""
943
+ msgstr[1] ""
944
+
945
+ #: includes/admin/metaboxes.php:89
946
+ msgid "Discussion"
947
+ msgstr ""
948
+
949
+ #: includes/admin/metaboxes.php:131
950
+ msgid "Reply"
951
+ msgid_plural "Replies"
952
+ msgstr[0] ""
953
+ msgstr[1] ""
954
+
955
+ #: includes/admin/metaboxes.php:150 includes/admin/settings.php:319
956
+ #: includes/topics/template.php:3551
957
+ msgid "Topic Tag"
958
+ msgid_plural "Topic Tags"
959
+ msgstr[0] ""
960
+ msgstr[1] ""
961
+
962
+ #: includes/admin/metaboxes.php:174
963
+ msgid "Users &amp; Moderation"
964
+ msgstr ""
965
+
966
+ #: includes/admin/metaboxes.php:182
967
+ msgid "User"
968
+ msgid_plural "Users"
969
+ msgstr[0] ""
970
+ msgstr[1] ""
971
+
972
+ #: includes/admin/metaboxes.php:201
973
+ msgid "Hidden Topic"
974
+ msgid_plural "Hidden Topics"
975
+ msgstr[0] ""
976
+ msgstr[1] ""
977
+
978
+ #: includes/admin/metaboxes.php:223
979
+ msgid "Hidden Reply"
980
+ msgid_plural "Hidden Replies"
981
+ msgstr[0] ""
982
+ msgstr[1] ""
983
+
984
+ #: includes/admin/metaboxes.php:245
985
+ msgid "Empty Topic Tag"
986
+ msgid_plural "Empty Topic Tags"
987
+ msgstr[0] ""
988
+ msgstr[1] ""
989
+
990
+ #: includes/admin/metaboxes.php:269
991
+ msgid "You are using <span class=\"b\">bbPress %s</span>."
992
+ msgstr ""
993
+
994
+ #: includes/admin/metaboxes.php:307 includes/admin/metaboxes.php:308
995
+ #: includes/admin/metaboxes.php:397
996
+ msgid "Type:"
997
+ msgstr ""
998
+
999
+ #: includes/admin/metaboxes.php:319 includes/admin/metaboxes.php:320
1000
+ #: includes/admin/metaboxes.php:409 includes/admin/metaboxes.php:475
1001
+ #: templates/default/bbpress/form-forum.php:118
1002
+ msgid "Status:"
1003
+ msgstr ""
1004
+
1005
+ #: includes/admin/metaboxes.php:331 includes/admin/metaboxes.php:332
1006
+ #: templates/default/bbpress/form-forum.php:127
1007
+ msgid "Visibility:"
1008
+ msgstr ""
1009
+
1010
+ #: includes/admin/metaboxes.php:345
1011
+ msgid "Parent:"
1012
+ msgstr ""
1013
+
1014
+ #: includes/admin/metaboxes.php:346
1015
+ msgid "Forum Parent"
1016
+ msgstr ""
1017
+
1018
+ #: includes/admin/metaboxes.php:359 includes/admin/topics.php:926
1019
+ #: includes/extend/buddypress/groups.php:326
1020
+ #: templates/default/bbpress/form-topic.php:122
1021
+ msgid "&mdash; No forum &mdash;"
1022
+ msgstr ""
1023
+
1024
+ #: includes/admin/metaboxes.php:366
1025
+ msgid "Order:"
1026
+ msgstr ""
1027
+
1028
+ #: includes/admin/metaboxes.php:367
1029
+ msgid "Forum Order"
1030
+ msgstr ""
1031
+
1032
+ #: includes/admin/metaboxes.php:398
1033
+ msgid "Topic Type"
1034
+ msgstr ""
1035
+
1036
+ #: includes/admin/metaboxes.php:411
1037
+ msgid "Select whether to open or close the topic."
1038
+ msgstr ""
1039
+
1040
+ #: includes/admin/metaboxes.php:424 includes/admin/metaboxes.php:491
1041
+ #: includes/extend/buddypress/groups.php:1160 includes/topics/template.php:62
1042
+ #: templates/default/bbpress/form-topic.php:119
1043
+ #: templates/default/bbpress/loop-search-forum.php:22
1044
+ msgid "Forum:"
1045
+ msgstr ""
1046
+
1047
+ #: includes/admin/metaboxes.php:438
1048
+ #: templates/default/bbpress/form-forum.php:141
1049
+ msgid "&mdash; No parent &mdash;"
1050
+ msgstr ""
1051
+
1052
+ #: includes/admin/metaboxes.php:477
1053
+ msgid "Select what status to give the reply."
1054
+ msgstr ""
1055
+
1056
+ #: includes/admin/metaboxes.php:505
1057
+ msgid "&mdash; No reply &mdash;"
1058
+ msgstr ""
1059
+
1060
+ #: includes/admin/metaboxes.php:518 includes/replies/template.php:62
1061
+ #: templates/default/bbpress/loop-search-topic.php:22
1062
+ msgid "Topic:"
1063
+ msgstr ""
1064
+
1065
+ #: includes/admin/metaboxes.php:531
1066
+ #: templates/default/bbpress/form-reply.php:116
1067
+ msgid "Reply To:"
1068
+ msgstr ""
1069
+
1070
+ #: includes/admin/metaboxes.php:532
1071
+ msgid "Reply To"
1072
+ msgstr ""
1073
+
1074
+ #: includes/admin/metaboxes.php:606
1075
+ #: templates/default/bbpress/form-topic-tag.php:37
1076
+ msgid "Name:"
1077
+ msgstr ""
1078
+
1079
+ #: includes/admin/metaboxes.php:607
1080
+ #: templates/default/bbpress/form-user-edit.php:14
1081
+ #: templates/default/bbpress/form-user-edit.php:19
1082
+ msgid "Name"
1083
+ msgstr ""
1084
+
1085
+ #: includes/admin/metaboxes.php:612
1086
+ msgid "Email:"
1087
+ msgstr ""
1088
+
1089
+ #: includes/admin/metaboxes.php:613
1090
+ #: templates/default/bbpress/form-user-edit.php:109
1091
+ #: templates/default/bbpress/form-user-register.php:31
1092
+ msgid "Email"
1093
+ msgstr ""
1094
+
1095
+ #: includes/admin/metaboxes.php:618
1096
+ #: templates/default/bbpress/form-anonymous.php:30
1097
+ msgid "Website:"
1098
+ msgstr ""
1099
+
1100
+ #: includes/admin/metaboxes.php:619
1101
+ #: templates/default/bbpress/form-user-edit.php:57
1102
+ msgid "Website"
1103
+ msgstr ""
1104
+
1105
+ #: includes/admin/metaboxes.php:626
1106
+ msgid "ID:"
1107
+ msgstr ""
1108
+
1109
+ #: includes/admin/metaboxes.php:627
1110
+ msgid "ID"
1111
+ msgstr ""
1112
+
1113
+ #: includes/admin/metaboxes.php:634
1114
+ msgid "IP:"
1115
+ msgstr ""
1116
+
1117
+ #: includes/admin/metaboxes.php:635
1118
+ msgid "IP Address"
1119
+ msgstr ""
1120
+
1121
+ #: includes/admin/metaboxes.php:693
1122
+ msgid "No users have favorited this topic."
1123
+ msgstr ""
1124
+
1125
+ #: includes/admin/metaboxes.php:723
1126
+ msgid "No users have subscribed to this topic."
1127
+ msgstr ""
1128
+
1129
+ #: includes/admin/metaboxes.php:753
1130
+ msgid "No users have subscribed to this forum."
1131
+ msgstr ""
1132
+
1133
+ #: includes/admin/replies.php:129
1134
+ msgid ""
1135
+ "This screen provides access to all of your replies. You can customize the "
1136
+ "display of this screen to suit your workflow."
1137
+ msgstr ""
1138
+
1139
+ #: includes/admin/replies.php:139
1140
+ msgid ""
1141
+ "You can hide/display columns based on your needs and decide how many "
1142
+ "replies to list per screen using the Screen Options tab."
1143
+ msgstr ""
1144
+
1145
+ #: includes/admin/replies.php:140
1146
+ msgid ""
1147
+ "You can filter the list of replies by reply status using the text links in "
1148
+ "the upper left to show All, Published, Draft, Pending, Trashed, or Spam "
1149
+ "replies. The default view is to show all replies."
1150
+ msgstr ""
1151
+
1152
+ #: includes/admin/replies.php:141
1153
+ msgid ""
1154
+ "You can view replies in a simple title list or with an excerpt. Choose the "
1155
+ "view you prefer by clicking on the icons at the top of the list on the "
1156
+ "right."
1157
+ msgstr ""
1158
+
1159
+ #: includes/admin/replies.php:142
1160
+ msgid ""
1161
+ "You can refine the list to show only replies in a specific forum or from a "
1162
+ "specific month by using the dropdown menus above the replies list. Click "
1163
+ "the Filter button after making your selection."
1164
+ msgstr ""
1165
+
1166
+ #: includes/admin/replies.php:151
1167
+ msgid ""
1168
+ "Hovering over a row in the replies list will display action links that "
1169
+ "allow you to manage your reply. You can perform the following actions:"
1170
+ msgstr ""
1171
+
1172
+ #: includes/admin/replies.php:153
1173
+ msgid ""
1174
+ "<strong>Edit</strong> takes you to the editing screen for that reply. You "
1175
+ "can also reach that screen by clicking on the reply title."
1176
+ msgstr ""
1177
+
1178
+ #: includes/admin/replies.php:155
1179
+ msgid ""
1180
+ "<strong>Trash</strong> removes your reply from this list and places it in "
1181
+ "the trash, from which you can permanently delete it."
1182
+ msgstr ""
1183
+
1184
+ #: includes/admin/replies.php:156
1185
+ msgid ""
1186
+ "<strong>Spam</strong> removes your reply from this list and places it in "
1187
+ "the spam queue, from which you can permanently delete it."
1188
+ msgstr ""
1189
+
1190
+ #: includes/admin/replies.php:157
1191
+ msgid "<strong>View</strong> will take you to your live site to view the reply."
1192
+ msgstr ""
1193
+
1194
+ #: includes/admin/replies.php:158 includes/admin/topics.php:160
1195
+ msgid "<strong>Approve</strong> will change the status from pending to publish."
1196
+ msgstr ""
1197
+
1198
+ #: includes/admin/replies.php:167
1199
+ msgid ""
1200
+ "You can also edit, spam, or move multiple replies to the trash at once. "
1201
+ "Select the replies you want to act on using the checkboxes, then select the "
1202
+ "action you want to take from the Bulk Actions menu and click Apply."
1203
+ msgstr ""
1204
+
1205
+ #: includes/admin/replies.php:168
1206
+ msgid ""
1207
+ "When using Bulk Edit, you can change the metadata (categories, author, "
1208
+ "etc.) for all selected replies at once. To remove a reply from the "
1209
+ "grouping, just click the x next to its name in the Bulk Edit area that "
1210
+ "appears."
1211
+ msgstr ""
1212
+
1213
+ #: includes/admin/replies.php:188
1214
+ msgid ""
1215
+ "The title field and the big reply editing Area are fixed in place, but you "
1216
+ "can reposition all the other boxes using drag and drop, and can minimize or "
1217
+ "expand them by clicking the title bar of each box. Use the Screen Options "
1218
+ "tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, "
1219
+ "Discussion, Slug, Author) or to choose a 1- or 2-column layout for this "
1220
+ "screen."
1221
+ msgstr ""
1222
+
1223
+ #: includes/admin/replies.php:198
1224
+ msgid "Title and Reply Editor"
1225
+ msgstr ""
1226
+
1227
+ #: includes/admin/replies.php:200
1228
+ msgid ""
1229
+ "<strong>Title</strong> - Enter a title for your reply. After you enter a "
1230
+ "title, you&#8217;ll see the permalink below, which you can edit."
1231
+ msgstr ""
1232
+
1233
+ #: includes/admin/replies.php:201
1234
+ msgid ""
1235
+ "<strong>Reply Editor</strong> - Enter the text for your reply. There are "
1236
+ "two modes of editing: Visual and HTML. Choose the mode by clicking on the "
1237
+ "appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last "
1238
+ "icon in the row to get a second row of controls. The HTML mode allows you "
1239
+ "to enter raw HTML along with your reply text. You can insert media files by "
1240
+ "clicking the icons above the reply editor and following the directions. You "
1241
+ "can go to the distraction-free writing screen via the Fullscreen icon in "
1242
+ "Visual mode (second to last in the top row) or the Fullscreen button in "
1243
+ "HTML mode (last in the row). Once there, you can make buttons visible by "
1244
+ "hovering over the top area. Exit Fullscreen back to the regular reply "
1245
+ "editor."
1246
+ msgstr ""
1247
+
1248
+ #: includes/admin/replies.php:204
1249
+ msgid ""
1250
+ "<strong>Publish</strong> - You can set the terms of publishing your reply "
1251
+ "in the Publish box. For Status, Visibility, and Publish (immediately), "
1252
+ "click on the Edit link to reveal more options. Visibility includes options "
1253
+ "for password-protecting a reply or making it stay at the top of your blog "
1254
+ "indefinitely (sticky). Publish (immediately) allows you to set a future or "
1255
+ "past date and time, so you can schedule a reply to be published in the "
1256
+ "future or backdate a reply."
1257
+ msgstr ""
1258
+
1259
+ #: includes/admin/replies.php:207
1260
+ msgid ""
1261
+ "<strong>Featured Image</strong> - This allows you to associate an image "
1262
+ "with your reply without inserting it. This is usually useful only if your "
1263
+ "theme makes use of the featured image as a reply thumbnail on the home "
1264
+ "page, a custom header, etc."
1265
+ msgstr ""
1266
+
1267
+ #: includes/admin/replies.php:212 includes/admin/replies.php:345
1268
+ msgid "Reply Attributes"
1269
+ msgstr ""
1270
+
1271
+ #: includes/admin/replies.php:214
1272
+ msgid "Select the attributes that your reply should have:"
1273
+ msgstr ""
1274
+
1275
+ #: includes/admin/replies.php:216
1276
+ msgid ""
1277
+ "<strong>Forum</strong> dropdown determines the parent forum that the reply "
1278
+ "belongs to. Select the forum, or leave the default (Use Forum of Topic) to "
1279
+ "post the reply in forum of the topic."
1280
+ msgstr ""
1281
+
1282
+ #: includes/admin/replies.php:217
1283
+ msgid ""
1284
+ "<strong>Topic</strong> determines the parent topic that the reply belongs "
1285
+ "to."
1286
+ msgstr ""
1287
+
1288
+ #: includes/admin/replies.php:218
1289
+ msgid "<strong>Reply To</strong> determines the threading of the reply."
1290
+ msgstr ""
1291
+
1292
+ #: includes/admin/replies.php:247 includes/admin/topics.php:251
1293
+ #: includes/replies/template.php:2172 includes/topics/template.php:3042
1294
+ msgid "Unspam"
1295
+ msgstr ""
1296
+
1297
+ #: includes/admin/replies.php:266
1298
+ msgid "%s reply updated."
1299
+ msgid_plural "%s replies updated."
1300
+ msgstr[0] ""
1301
+ msgstr[1] ""
1302
+
1303
+ #: includes/admin/replies.php:267
1304
+ msgid "1 reply not updated, somebody is editing it."
1305
+ msgstr ""
1306
+
1307
+ #: includes/admin/replies.php:268
1308
+ msgid "%s reply not updated, somebody is editing it."
1309
+ msgid_plural "%s replies not updated, somebody is editing them."
1310
+ msgstr[0] ""
1311
+ msgstr[1] ""
1312
+
1313
+ #: includes/admin/replies.php:291 includes/admin/topics.php:295
1314
+ msgid "Sorry, you are not allowed to spam this item."
1315
+ msgstr ""
1316
+
1317
+ #: includes/admin/replies.php:300
1318
+ msgid "Error in spamming reply."
1319
+ msgstr ""
1320
+
1321
+ #: includes/admin/replies.php:312
1322
+ msgid "Sorry, you are not allowed to unspam this reply."
1323
+ msgstr ""
1324
+
1325
+ #: includes/admin/replies.php:321
1326
+ msgid "Error in unspamming reply."
1327
+ msgstr ""
1328
+
1329
+ #: includes/admin/replies.php:376 includes/admin/topics.php:374
1330
+ #: templates/default/bbpress/form-anonymous.php:15
1331
+ msgid "Author Information"
1332
+ msgstr ""
1333
+
1334
+ #: includes/admin/replies.php:558
1335
+ msgid "The reply was not found."
1336
+ msgstr ""
1337
+
1338
+ #: includes/admin/replies.php:639
1339
+ msgid "There was a problem marking the reply \"%1$s\" as spam."
1340
+ msgstr ""
1341
+
1342
+ #: includes/admin/replies.php:640
1343
+ msgid "Reply \"%1$s\" successfully marked as spam."
1344
+ msgstr ""
1345
+
1346
+ #: includes/admin/replies.php:645
1347
+ msgid "There was a problem unmarking the reply \"%1$s\" as spam."
1348
+ msgstr ""
1349
+
1350
+ #: includes/admin/replies.php:646
1351
+ msgid "Reply \"%1$s\" successfully unmarked as spam."
1352
+ msgstr ""
1353
+
1354
+ #: includes/admin/replies.php:651
1355
+ msgid "There was a problem approving the reply \"%1$s\"."
1356
+ msgstr ""
1357
+
1358
+ #: includes/admin/replies.php:652
1359
+ msgid "Reply \"%1$s\" successfully approved."
1360
+ msgstr ""
1361
+
1362
+ #: includes/admin/replies.php:657
1363
+ msgid "There was a problem unapproving the reply \"%1$s\"."
1364
+ msgstr ""
1365
+
1366
+ #: includes/admin/replies.php:658
1367
+ msgid "Reply \"%1$s\" successfully unapproved."
1368
+ msgstr ""
1369
+
1370
+ #: includes/admin/replies.php:688
1371
+ msgid "Title"
1372
+ msgstr ""
1373
+
1374
+ #: includes/admin/replies.php:742 includes/admin/replies.php:750
1375
+ msgid "No Topic"
1376
+ msgstr ""
1377
+
1378
+ #: includes/admin/replies.php:768 includes/admin/replies.php:783
1379
+ #: includes/admin/topics.php:919
1380
+ msgid "No Forum"
1381
+ msgstr ""
1382
+
1383
+ #: includes/admin/replies.php:774
1384
+ msgid "(Mismatch)"
1385
+ msgstr ""
1386
+
1387
+ #: includes/admin/replies.php:840 includes/admin/topics.php:1006
1388
+ #: includes/admin/topics.php:1019
1389
+ msgid "View &#8220;%s&#8221;"
1390
+ msgstr ""
1391
+
1392
+ #: includes/admin/replies.php:853
1393
+ msgid "Unapprove this reply"
1394
+ msgstr ""
1395
+
1396
+ #: includes/admin/replies.php:855
1397
+ msgid "Approve this reply"
1398
+ msgstr ""
1399
+
1400
+ #: includes/admin/replies.php:862
1401
+ msgid "Mark the reply as not spam"
1402
+ msgstr ""
1403
+
1404
+ #: includes/admin/replies.php:862 includes/admin/topics.php:1048
1405
+ msgid "Not spam"
1406
+ msgstr ""
1407
+
1408
+ #: includes/admin/replies.php:864
1409
+ msgid "Mark this reply as spam"
1410
+ msgstr ""
1411
+
1412
+ #: includes/admin/replies.php:873 includes/admin/topics.php:1058
1413
+ #: includes/replies/template.php:2113 includes/topics/template.php:2733
1414
+ msgid "Restore this item from the Trash"
1415
+ msgstr ""
1416
+
1417
+ #: includes/admin/replies.php:873 includes/admin/topics.php:1058
1418
+ #: includes/replies/template.php:2100 includes/topics/template.php:2720
1419
+ msgid "Restore"
1420
+ msgstr ""
1421
+
1422
+ #: includes/admin/replies.php:875 includes/admin/topics.php:1060
1423
+ #: includes/replies/template.php:2115 includes/topics/template.php:2735
1424
+ msgid "Move this item to the Trash"
1425
+ msgstr ""
1426
+
1427
+ #: includes/admin/replies.php:879 includes/admin/topics.php:1064
1428
+ #: includes/replies/template.php:2119 includes/topics/template.php:2739
1429
+ msgid "Delete this item permanently"
1430
+ msgstr ""
1431
+
1432
+ #: includes/admin/replies.php:879 includes/admin/topics.php:1064
1433
+ msgid "Delete Permanently"
1434
+ msgstr ""
1435
+
1436
+ #: includes/admin/replies.php:904 includes/admin/topics.php:1089
1437
+ msgid "Empty Spam"
1438
+ msgstr ""
1439
+
1440
+ #: includes/admin/replies.php:919 includes/admin/topics.php:1104
1441
+ msgid "In all forums"
1442
+ msgstr ""
1443
+
1444
+ #: includes/admin/replies.php:978 includes/admin/replies.php:990
1445
+ msgid "Reply updated."
1446
+ msgstr ""
1447
+
1448
+ #: includes/admin/replies.php:980 includes/admin/replies.php:1003
1449
+ #: includes/admin/topics.php:1165 includes/admin/topics.php:1188
1450
+ msgid "View topic"
1451
+ msgstr ""
1452
+
1453
+ #: includes/admin/replies.php:995
1454
+ #. translators: %s: date and time of the revision
1455
+ msgid "Reply restored to revision from %s"
1456
+ msgstr ""
1457
+
1458
+ #: includes/admin/replies.php:1001
1459
+ msgid "Reply created."
1460
+ msgstr ""
1461
+
1462
+ #: includes/admin/replies.php:1007
1463
+ msgid "Reply saved."
1464
+ msgstr ""
1465
+
1466
+ #: includes/admin/replies.php:1012
1467
+ msgid "Reply submitted."
1468
+ msgstr ""
1469
+
1470
+ #: includes/admin/replies.php:1014 includes/admin/replies.php:1026
1471
+ #: includes/admin/replies.php:1034 includes/admin/topics.php:1199
1472
+ #: includes/admin/topics.php:1211 includes/admin/topics.php:1219
1473
+ msgid "Preview topic"
1474
+ msgstr ""
1475
+
1476
+ #: includes/admin/replies.php:1021
1477
+ msgid "Reply scheduled for: %s."
1478
+ msgstr ""
1479
+
1480
+ #: includes/admin/replies.php:1032
1481
+ msgid "Reply draft updated."
1482
+ msgstr ""
1483
+
1484
+ #: includes/admin/settings.php:25
1485
+ msgid "Forum User Settings"
1486
+ msgstr ""
1487
+
1488
+ #: includes/admin/settings.php:30
1489
+ msgid "Forum Features"
1490
+ msgstr ""
1491
+
1492
+ #: includes/admin/settings.php:35
1493
+ msgid "Forum Theme Packages"
1494
+ msgstr ""
1495
+
1496
+ #: includes/admin/settings.php:40
1497
+ msgid "Topics and Replies Per Page"
1498
+ msgstr ""
1499
+
1500
+ #: includes/admin/settings.php:45
1501
+ msgid "Topics and Replies Per RSS Page"
1502
+ msgstr ""
1503
+
1504
+ #: includes/admin/settings.php:50
1505
+ msgid "Forum Root Slug"
1506
+ msgstr ""
1507
+
1508
+ #: includes/admin/settings.php:55
1509
+ msgid "Single Forum Slugs"
1510
+ msgstr ""
1511
+
1512
+ #: includes/admin/settings.php:60
1513
+ msgid "Forum User Slugs"
1514
+ msgstr ""
1515
+
1516
+ #: includes/admin/settings.php:65
1517
+ msgid "BuddyPress Integration"
1518
+ msgstr ""
1519
+
1520
+ #: includes/admin/settings.php:70
1521
+ msgid "Akismet Integration"
1522
+ msgstr ""
1523
+
1524
+ #: includes/admin/settings.php:93
1525
+ msgid "Disallow editing after"
1526
+ msgstr ""
1527
+
1528
+ #: includes/admin/settings.php:101
1529
+ msgid "Throttle posting every"
1530
+ msgstr ""
1531
+
1532
+ #: includes/admin/settings.php:109
1533
+ msgid "Anonymous posting"
1534
+ msgstr ""
1535
+
1536
+ #: includes/admin/settings.php:117
1537
+ msgid "Auto role"
1538
+ msgstr ""
1539
+
1540
+ #: includes/admin/settings.php:136 includes/admin/settings.php:1719
1541
+ msgid "Revisions"
1542
+ msgstr ""
1543
+
1544
+ #: includes/admin/settings.php:144 includes/admin/topics.php:440
1545
+ #: includes/extend/buddypress/loader.php:224
1546
+ #: templates/default/bbpress/user-details.php:46
1547
+ msgid "Favorites"
1548
+ msgstr ""
1549
+
1550
+ #: includes/admin/settings.php:160
1551
+ msgid "Topic tags"
1552
+ msgstr ""
1553
+
1554
+ #: includes/admin/settings.php:176 includes/admin/settings.php:343
1555
+ #: includes/common/template.php:2409 includes/search/template.php:232
1556
+ #: templates/default/bbpress/form-search.php:17
1557
+ msgid "Search"
1558
+ msgstr ""
1559
+
1560
+ #: includes/admin/settings.php:184
1561
+ msgid "Post Formatting"
1562
+ msgstr ""
1563
+
1564
+ #: includes/admin/settings.php:192
1565
+ msgid "Auto-embed links"
1566
+ msgstr ""
1567
+
1568
+ #: includes/admin/settings.php:200
1569
+ msgid "Reply Threading"
1570
+ msgstr ""
1571
+
1572
+ #: includes/admin/settings.php:219
1573
+ msgid "Current Package"
1574
+ msgstr ""
1575
+
1576
+ #: includes/admin/settings.php:274
1577
+ msgid "Forum Root"
1578
+ msgstr ""
1579
+
1580
+ #: includes/admin/settings.php:282
1581
+ msgid "Forum Prefix"
1582
+ msgstr ""
1583
+
1584
+ #: includes/admin/settings.php:290
1585
+ msgid "Forum root should show"
1586
+ msgstr ""
1587
+
1588
+ #: includes/admin/settings.php:327
1589
+ msgid "Topic View"
1590
+ msgstr ""
1591
+
1592
+ #: includes/admin/settings.php:356
1593
+ msgid "User Base"
1594
+ msgstr ""
1595
+
1596
+ #: includes/admin/settings.php:364 includes/extend/buddypress/loader.php:201
1597
+ #: includes/extend/buddypress/loader.php:294
1598
+ #: templates/default/bbpress/user-details.php:33
1599
+ msgid "Topics Started"
1600
+ msgstr ""
1601
+
1602
+ #: includes/admin/settings.php:372 includes/extend/buddypress/loader.php:212
1603
+ #: includes/extend/buddypress/loader.php:302
1604
+ #: templates/default/bbpress/user-details.php:39
1605
+ msgid "Replies Created"
1606
+ msgstr ""
1607
+
1608
+ #: includes/admin/settings.php:380 includes/extend/buddypress/loader.php:310
1609
+ msgid "Favorite Topics"
1610
+ msgstr ""
1611
+
1612
+ #: includes/admin/settings.php:401
1613
+ msgid "Enable Group Forums"
1614
+ msgstr ""
1615
+
1616
+ #: includes/admin/settings.php:409
1617
+ msgid "Group Forums Parent"
1618
+ msgstr ""
1619
+
1620
+ #: includes/admin/settings.php:422
1621
+ msgid "Use Akismet"
1622
+ msgstr ""
1623
+
1624
+ #: includes/admin/settings.php:464
1625
+ msgid "Setting time limits and other user posting capabilities"
1626
+ msgstr ""
1627
+
1628
+ #: includes/admin/settings.php:481 includes/common/functions.php:124
1629
+ msgid "minutes"
1630
+ msgstr ""
1631
+
1632
+ #: includes/admin/settings.php:497 includes/common/functions.php:125
1633
+ msgid "seconds"
1634
+ msgstr ""
1635
+
1636
+ #: includes/admin/settings.php:513
1637
+ msgid "Allow guest users without accounts to create topics and replies"
1638
+ msgstr ""
1639
+
1640
+ #: includes/admin/settings.php:547
1641
+ msgid "Automatically give registered visitors the %s forum role"
1642
+ msgstr ""
1643
+
1644
+ #: includes/admin/settings.php:563
1645
+ msgid "Forum features that can be toggled on and off"
1646
+ msgstr ""
1647
+
1648
+ #: includes/admin/settings.php:579
1649
+ msgid "Allow users to mark topics as favorites"
1650
+ msgstr ""
1651
+
1652
+ #: includes/admin/settings.php:595
1653
+ msgid "Allow users to subscribe to forums and topics"
1654
+ msgstr ""
1655
+
1656
+ #: includes/admin/settings.php:611
1657
+ msgid "Allow topics to have tags"
1658
+ msgstr ""
1659
+
1660
+ #: includes/admin/settings.php:627
1661
+ msgid "Allow forums to have dedicated moderators"
1662
+ msgstr ""
1663
+
1664
+ #: includes/admin/settings.php:643
1665
+ msgid "Allow forum wide search"
1666
+ msgstr ""
1667
+
1668
+ #: includes/admin/settings.php:682
1669
+ msgid "Enable threaded (nested) replies %s levels deep"
1670
+ msgstr ""
1671
+
1672
+ #: includes/admin/settings.php:699
1673
+ msgid "Allow topic and reply revision logging"
1674
+ msgstr ""
1675
+
1676
+ #: includes/admin/settings.php:715
1677
+ msgid "Add toolbar & buttons to textareas to help with HTML formatting"
1678
+ msgstr ""
1679
+
1680
+ #: includes/admin/settings.php:728
1681
+ msgid "How your forum content is displayed within your existing theme."
1682
+ msgstr ""
1683
+
1684
+ #: includes/admin/settings.php:752 includes/common/classes.php:527
1685
+ #: includes/replies/template.php:2677
1686
+ msgid "%1$s - %2$s"
1687
+ msgstr ""
1688
+
1689
+ #: includes/admin/settings.php:758
1690
+ msgid "will serve all bbPress templates"
1691
+ msgstr ""
1692
+
1693
+ #: includes/admin/settings.php:762
1694
+ msgid "No template packages available."
1695
+ msgstr ""
1696
+
1697
+ #: includes/admin/settings.php:778
1698
+ msgid ""
1699
+ "Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and "
1700
+ "replies"
1701
+ msgstr ""
1702
+
1703
+ #: includes/admin/settings.php:793
1704
+ msgid "How many topics and replies to show per page"
1705
+ msgstr ""
1706
+
1707
+ #: includes/admin/settings.php:809 includes/admin/settings.php:825
1708
+ #: includes/admin/settings.php:856 includes/admin/settings.php:872
1709
+ msgid "per page"
1710
+ msgstr ""
1711
+
1712
+ #: includes/admin/settings.php:840
1713
+ msgid "How many topics and replies to show per RSS page"
1714
+ msgstr ""
1715
+
1716
+ #: includes/admin/settings.php:891
1717
+ msgid ""
1718
+ "Customize your Forums root. Partner with a WordPress Page and use "
1719
+ "Shortcodes for more flexibility."
1720
+ msgstr ""
1721
+
1722
+ #: includes/admin/settings.php:924
1723
+ msgid "Prefix all forum content with the Forum Root slug (Recommended)"
1724
+ msgstr ""
1725
+
1726
+ #: includes/admin/settings.php:944
1727
+ msgid "Forum Index"
1728
+ msgstr ""
1729
+
1730
+ #: includes/admin/settings.php:947
1731
+ msgid "Topics by Last Post"
1732
+ msgstr ""
1733
+
1734
+ #: includes/admin/settings.php:974
1735
+ msgid "Customize your user profile slugs."
1736
+ msgstr ""
1737
+
1738
+ #: includes/admin/settings.php:1074
1739
+ msgid "Custom slugs for single forums, topics, replies, tags, views, and search."
1740
+ msgstr ""
1741
+
1742
+ #: includes/admin/settings.php:1192
1743
+ msgid "Forum settings for BuddyPress"
1744
+ msgstr ""
1745
+
1746
+ #: includes/admin/settings.php:1208
1747
+ msgid "Allow BuddyPress Groups to have their own forums"
1748
+ msgstr ""
1749
+
1750
+ #: includes/admin/settings.php:1225
1751
+ msgid "&mdash; Forum root &mdash;"
1752
+ msgstr ""
1753
+
1754
+ #: includes/admin/settings.php:1233
1755
+ msgid "is the parent for all group forums"
1756
+ msgstr ""
1757
+
1758
+ #: includes/admin/settings.php:1234
1759
+ msgid ""
1760
+ "Using the Forum Root is not recommended. Changing this does not move "
1761
+ "existing forums."
1762
+ msgstr ""
1763
+
1764
+ #: includes/admin/settings.php:1249
1765
+ msgid "Forum settings for Akismet"
1766
+ msgstr ""
1767
+
1768
+ #: includes/admin/settings.php:1266
1769
+ msgid "Allow Akismet to actively prevent forum spam."
1770
+ msgstr ""
1771
+
1772
+ #: includes/admin/settings.php:1286
1773
+ msgid "Forums Settings"
1774
+ msgstr ""
1775
+
1776
+ #: includes/admin/settings.php:1295
1777
+ #: templates/default/bbpress/form-user-edit.php:163
1778
+ msgid "Save Changes"
1779
+ msgstr ""
1780
+
1781
+ #: includes/admin/settings.php:1314
1782
+ msgid ""
1783
+ "Information about your previous forums database so that they can be "
1784
+ "converted. <strong>Backup your database before proceeding.</strong>"
1785
+ msgstr ""
1786
+
1787
+ #: includes/admin/settings.php:1345
1788
+ msgid "is the previous forum software"
1789
+ msgstr ""
1790
+
1791
+ #: includes/admin/settings.php:1359
1792
+ msgid "IP or hostname"
1793
+ msgstr ""
1794
+
1795
+ #: includes/admin/settings.php:1373
1796
+ msgid "Use default 3306 if unsure"
1797
+ msgstr ""
1798
+
1799
+ #: includes/admin/settings.php:1387
1800
+ msgid "User for your database connection"
1801
+ msgstr ""
1802
+
1803
+ #: includes/admin/settings.php:1401
1804
+ msgid "Password to access the database"
1805
+ msgstr ""
1806
+
1807
+ #: includes/admin/settings.php:1415
1808
+ msgid "Name of the database with your old forum data"
1809
+ msgstr ""
1810
+
1811
+ #: includes/admin/settings.php:1428
1812
+ msgid "Some optional parameters to help tune the conversion process."
1813
+ msgstr ""
1814
+
1815
+ #: includes/admin/settings.php:1442
1816
+ msgid "(If converting from BuddyPress Forums, use \"wp_bb_\" or your custom prefix)"
1817
+ msgstr ""
1818
+
1819
+ #: includes/admin/settings.php:1456
1820
+ msgid "rows to process at a time"
1821
+ msgstr ""
1822
+
1823
+ #: includes/admin/settings.php:1457
1824
+ msgid "Keep this low if you experience out-of-memory issues."
1825
+ msgstr ""
1826
+
1827
+ #: includes/admin/settings.php:1471
1828
+ msgid "second(s) delay between each group of rows"
1829
+ msgstr ""
1830
+
1831
+ #: includes/admin/settings.php:1472
1832
+ msgid "Keep this high to prevent too-many-connection issues."
1833
+ msgstr ""
1834
+
1835
+ #: includes/admin/settings.php:1486
1836
+ msgid "Start a fresh conversion from the beginning"
1837
+ msgstr ""
1838
+
1839
+ #: includes/admin/settings.php:1487
1840
+ msgid "You should clean old conversion information before starting over."
1841
+ msgstr ""
1842
+
1843
+ #: includes/admin/settings.php:1501
1844
+ msgid "Purge all information from a previously attempted import"
1845
+ msgstr ""
1846
+
1847
+ #: includes/admin/settings.php:1502
1848
+ msgid "Use this if an import failed and you want to remove that incomplete data."
1849
+ msgstr ""
1850
+
1851
+ #: includes/admin/settings.php:1516
1852
+ msgid "Attempt to import user accounts from previous forums"
1853
+ msgstr ""
1854
+
1855
+ #: includes/admin/settings.php:1517
1856
+ msgid ""
1857
+ "Non-bbPress passwords cannot be automatically converted. They will be "
1858
+ "converted as each user logs in."
1859
+ msgstr ""
1860
+
1861
+ #: includes/admin/settings.php:1534 includes/admin/tools.php:35
1862
+ #: includes/admin/tools.php:2430
1863
+ msgid "Forum Tools"
1864
+ msgstr ""
1865
+
1866
+ #: includes/admin/settings.php:1544
1867
+ msgid "Start"
1868
+ msgstr ""
1869
+
1870
+ #: includes/admin/settings.php:1545
1871
+ msgid "Stop"
1872
+ msgstr ""
1873
+
1874
+ #: includes/admin/settings.php:1578
1875
+ msgid "This screen provides access to all of the Forums settings."
1876
+ msgstr ""
1877
+
1878
+ #: includes/admin/settings.php:1579 includes/admin/tools.php:342
1879
+ msgid ""
1880
+ "Please see the additional help tabs for more information on each individual "
1881
+ "section."
1882
+ msgstr ""
1883
+
1884
+ #: includes/admin/settings.php:1585
1885
+ msgid "Main Settings"
1886
+ msgstr ""
1887
+
1888
+ #: includes/admin/settings.php:1586
1889
+ msgid "In the Main Settings you have a number of options:"
1890
+ msgstr ""
1891
+
1892
+ #: includes/admin/settings.php:1589
1893
+ msgid ""
1894
+ "You can choose to lock a post after a certain number of minutes. \"Locking "
1895
+ "post editing\" will prevent the author from editing some amount of time "
1896
+ "after saving a post."
1897
+ msgstr ""
1898
+
1899
+ #: includes/admin/settings.php:1590
1900
+ msgid ""
1901
+ "\"Throttle time\" is the amount of time required between posts from a "
1902
+ "single author. The higher the throttle time, the longer a user will need to "
1903
+ "wait between posting to the forum."
1904
+ msgstr ""
1905
+
1906
+ #: includes/admin/settings.php:1591
1907
+ msgid ""
1908
+ "Favorites are a way for users to save and later return to topics they "
1909
+ "favor. This is enabled by default."
1910
+ msgstr ""
1911
+
1912
+ #: includes/admin/settings.php:1592
1913
+ msgid ""
1914
+ "Subscriptions allow users to subscribe for notifications to topics that "
1915
+ "interest them. This is enabled by default."
1916
+ msgstr ""
1917
+
1918
+ #: includes/admin/settings.php:1593
1919
+ msgid ""
1920
+ "Topic-Tags allow users to filter topics between forums. This is enabled by "
1921
+ "default."
1922
+ msgstr ""
1923
+
1924
+ #: includes/admin/settings.php:1594
1925
+ msgid ""
1926
+ "\"Anonymous Posting\" allows guest users who do not have accounts on your "
1927
+ "site to both create topics as well as replies."
1928
+ msgstr ""
1929
+
1930
+ #: includes/admin/settings.php:1595
1931
+ msgid ""
1932
+ "The Fancy Editor brings the luxury of the Visual editor and HTML editor "
1933
+ "from the traditional WordPress dashboard into your theme."
1934
+ msgstr ""
1935
+
1936
+ #: includes/admin/settings.php:1596
1937
+ msgid ""
1938
+ "Auto-embed will embed the media content from a URL directly into the "
1939
+ "replies. For example: links to Flickr and YouTube."
1940
+ msgstr ""
1941
+
1942
+ #: includes/admin/settings.php:1599
1943
+ msgid ""
1944
+ "You must click the Save Changes button at the bottom of the screen for new "
1945
+ "settings to take effect."
1946
+ msgstr ""
1947
+
1948
+ #: includes/admin/settings.php:1605
1949
+ msgid "Per Page"
1950
+ msgstr ""
1951
+
1952
+ #: includes/admin/settings.php:1606
1953
+ msgid ""
1954
+ "Per Page settings allow you to control the number of topics and replies "
1955
+ "appear on each page."
1956
+ msgstr ""
1957
+
1958
+ #: includes/admin/settings.php:1607
1959
+ msgid ""
1960
+ "This is comparable to the WordPress \"Reading Settings\" page, where you "
1961
+ "can set the number of posts that should show on blog pages and in feeds."
1962
+ msgstr ""
1963
+
1964
+ #: includes/admin/settings.php:1608
1965
+ msgid ""
1966
+ "These are broken up into two separate groups: one for what appears in your "
1967
+ "theme, another for RSS feeds."
1968
+ msgstr ""
1969
+
1970
+ #: includes/admin/settings.php:1614
1971
+ msgid "Slugs"
1972
+ msgstr ""
1973
+
1974
+ #: includes/admin/settings.php:1615
1975
+ msgid ""
1976
+ "The Slugs section allows you to control the permalink structure for your "
1977
+ "forums."
1978
+ msgstr ""
1979
+
1980
+ #: includes/admin/settings.php:1616
1981
+ msgid ""
1982
+ "\"Archive Slugs\" are used as the \"root\" for your forums and topics. If "
1983
+ "you combine these values with existing page slugs, bbPress will attempt to "
1984
+ "output the most correct title and content."
1985
+ msgstr ""
1986
+
1987
+ #: includes/admin/settings.php:1617
1988
+ msgid ""
1989
+ "\"Single Slugs\" are used as a prefix when viewing an individual forum, "
1990
+ "topic, reply, user, or view."
1991
+ msgstr ""
1992
+
1993
+ #: includes/admin/settings.php:1618
1994
+ msgid ""
1995
+ "In the event of a slug collision with WordPress or BuddyPress, a warning "
1996
+ "will appear next to the problem slug(s)."
1997
+ msgstr ""
1998
+
1999
+ #: includes/admin/settings.php:1717
2000
+ #: templates/default/bbpress/loop-forums.php:21
2001
+ #: templates/default/bbpress/loop-replies.php:18
2002
+ #: templates/default/bbpress/loop-replies.php:44
2003
+ #: templates/default/bbpress/loop-topics.php:19
2004
+ msgid "Posts"
2005
+ msgstr ""
2006
+
2007
+ #: includes/admin/settings.php:1718
2008
+ msgid "Pages"
2009
+ msgstr ""
2010
+
2011
+ #: includes/admin/settings.php:1720
2012
+ msgid "Attachments"
2013
+ msgstr ""
2014
+
2015
+ #: includes/admin/settings.php:1721
2016
+ msgid "Menus"
2017
+ msgstr ""
2018
+
2019
+ #: includes/admin/settings.php:1724
2020
+ msgid "Tag base"
2021
+ msgstr ""
2022
+
2023
+ #: includes/admin/settings.php:1727
2024
+ msgid "Category base"
2025
+ msgstr ""
2026
+
2027
+ #: includes/admin/settings.php:1732
2028
+ msgid "Forums base"
2029
+ msgstr ""
2030
+
2031
+ #: includes/admin/settings.php:1735
2032
+ msgid "Topics base"
2033
+ msgstr ""
2034
+
2035
+ #: includes/admin/settings.php:1738
2036
+ msgid "Forum slug"
2037
+ msgstr ""
2038
+
2039
+ #: includes/admin/settings.php:1741
2040
+ msgid "Topic slug"
2041
+ msgstr ""
2042
+
2043
+ #: includes/admin/settings.php:1744
2044
+ msgid "Reply slug"
2045
+ msgstr ""
2046
+
2047
+ #: includes/admin/settings.php:1747
2048
+ msgid "User base"
2049
+ msgstr ""
2050
+
2051
+ #: includes/admin/settings.php:1750
2052
+ msgid "View base"
2053
+ msgstr ""
2054
+
2055
+ #: includes/admin/settings.php:1753
2056
+ msgid "Topic tag slug"
2057
+ msgstr ""
2058
+
2059
+ #: includes/admin/settings.php:1765
2060
+ msgid "%s page"
2061
+ msgstr ""
2062
+
2063
+ #: includes/admin/settings.php:1788
2064
+ msgid "Possible %1$s conflict: %2$s"
2065
+ msgstr ""
2066
+
2067
+ #: includes/admin/tools.php:38
2068
+ msgid ""
2069
+ "bbPress keeps track of relationships between forums, topics, replies, "
2070
+ "topic-tags, favorites, subscriptions, and users. Occasionally these "
2071
+ "relationships become out of sync, most often after an import or migration. "
2072
+ "Use the tools below to manually recalculate these relationships."
2073
+ msgstr ""
2074
+
2075
+ #: includes/admin/tools.php:39
2076
+ msgid ""
2077
+ "Some of these tools create substantial database overhead. Use caution when "
2078
+ "running more than 1 repair at a time."
2079
+ msgstr ""
2080
+
2081
+ #: includes/admin/tools.php:52 includes/admin/tools.php:148
2082
+ msgid "Select bulk action"
2083
+ msgstr ""
2084
+
2085
+ #: includes/admin/tools.php:55 includes/admin/tools.php:96
2086
+ #: includes/admin/tools.php:151
2087
+ msgid "Run"
2088
+ msgstr ""
2089
+
2090
+ #: includes/admin/tools.php:57 includes/admin/tools.php:153
2091
+ msgid "Apply"
2092
+ msgstr ""
2093
+
2094
+ #: includes/admin/tools.php:71 includes/admin/tools.php:136
2095
+ msgid "Select All"
2096
+ msgstr ""
2097
+
2098
+ #: includes/admin/tools.php:75 includes/admin/tools.php:92
2099
+ #: includes/admin/tools.php:140
2100
+ msgid "Description"
2101
+ msgstr ""
2102
+
2103
+ #: includes/admin/tools.php:76 includes/admin/tools.php:103
2104
+ #: includes/admin/tools.php:141
2105
+ msgid "Components"
2106
+ msgstr ""
2107
+
2108
+ #: includes/admin/tools.php:77 includes/admin/tools.php:110
2109
+ #: includes/admin/tools.php:142
2110
+ msgid "Overhead"
2111
+ msgstr ""
2112
+
2113
+ #: includes/admin/tools.php:96
2114
+ msgid "Run %s"
2115
+ msgstr ""
2116
+
2117
+ #: includes/admin/tools.php:100
2118
+ msgid "Show more details"
2119
+ msgstr ""
2120
+
2121
+ #: includes/admin/tools.php:125
2122
+ msgid "No repair tools match this criteria."
2123
+ msgstr ""
2124
+
2125
+ #: includes/admin/tools.php:270
2126
+ msgid ""
2127
+ "There is more detailed information available on the bbPress and BuddyPress "
2128
+ "codex for the following:"
2129
+ msgstr ""
2130
+
2131
+ #: includes/admin/tools.php:273
2132
+ msgid ""
2133
+ "BuddyPress Group Forums: <a "
2134
+ "href=\"https://codex.buddypress.org/getting-started/installing-group-and-"
2135
+ "sitewide-forums/\">Installing Group and Sitewide Forums</a> and <a "
2136
+ "href=\"https://codex.buddypress.org/getting-started/guides/migrating-from-"
2137
+ "old-forums-to-bbpress-2/\">Migrating from old forums to bbPress 2.2+</a>."
2138
+ msgstr ""
2139
+
2140
+ #: includes/admin/tools.php:274
2141
+ msgid ""
2142
+ "bbPress roles: <a "
2143
+ "href=\"https://codex.bbpress.org/bbpress-user-roles-and-capabilities/\" "
2144
+ "target=\"_blank\">bbPress User Roles and Capabilities</a>"
2145
+ msgstr ""
2146
+
2147
+ #: includes/admin/tools.php:277
2148
+ msgid ""
2149
+ "Also see <a href=\"https://codex.bbpress.org/repair-forums/\">bbPress: "
2150
+ "Repair Forums</a>."
2151
+ msgstr ""
2152
+
2153
+ #: includes/admin/tools.php:309
2154
+ msgid ""
2155
+ "Also see <a href=\"https://codex.bbpress.org/reset-forums/\">bbPress: Reset "
2156
+ "Forums</a>."
2157
+ msgstr ""
2158
+
2159
+ #: includes/admin/tools.php:341
2160
+ msgid ""
2161
+ "This screen provides access to all of the bbPress Import Forums settings "
2162
+ "and resources."
2163
+ msgstr ""
2164
+
2165
+ #: includes/admin/tools.php:343
2166
+ msgid ""
2167
+ "Also see the main article on the bbPress codex <a "
2168
+ "href=\"https://codex.bbpress.org/import-forums/\">bbPress: Import "
2169
+ "Forums</a>."
2170
+ msgstr ""
2171
+
2172
+ #: includes/admin/tools.php:350
2173
+ msgid "In the Database Settings you have a number of options:"
2174
+ msgstr ""
2175
+
2176
+ #: includes/admin/tools.php:353
2177
+ msgid ""
2178
+ "The settings in this section refer to the database connection strings used "
2179
+ "by your old forum software. The best way to determine the exact settings "
2180
+ "you need is to copy them from your legacy forums configuration file or "
2181
+ "contact your web hosting provider."
2182
+ msgstr ""
2183
+
2184
+ #: includes/admin/tools.php:361
2185
+ msgid "Importer Options"
2186
+ msgstr ""
2187
+
2188
+ #: includes/admin/tools.php:362
2189
+ msgid "In the Options you have a number of options:"
2190
+ msgstr ""
2191
+
2192
+ #: includes/admin/tools.php:365
2193
+ msgid ""
2194
+ "Depending on your MySQL configuration you can tweak the \"Rows Limit\" and "
2195
+ "\"Delay Time\" that may help to improve the overall time it takes to "
2196
+ "perform a complete forum import."
2197
+ msgstr ""
2198
+
2199
+ #: includes/admin/tools.php:366
2200
+ msgid "\"Convert Users\" will import your legacy forum members as WordPress Users."
2201
+ msgstr ""
2202
+
2203
+ #: includes/admin/tools.php:367
2204
+ msgid ""
2205
+ "\"Start Over\" will start the importer fresh, if your import failed for any "
2206
+ "reason leaving this setting unchecked the importer will begin from where it "
2207
+ "left off."
2208
+ msgstr ""
2209
+
2210
+ #: includes/admin/tools.php:368
2211
+ msgid ""
2212
+ "\"Purge Previous Import\" will remove data imported from a failed import "
2213
+ "without removing your existing forum data."
2214
+ msgstr ""
2215
+
2216
+ #: includes/admin/tools.php:394
2217
+ msgid "Dismiss this notice."
2218
+ msgstr ""
2219
+
2220
+ #: includes/admin/tools.php:454
2221
+ msgid "The repair was completed successfully"
2222
+ msgstr ""
2223
+
2224
+ #: includes/admin/tools.php:455
2225
+ msgid "The repair was not successful"
2226
+ msgstr ""
2227
+
2228
+ #: includes/admin/tools.php:487
2229
+ msgid "Recalculate parent topic for each reply"
2230
+ msgstr ""
2231
+
2232
+ #: includes/admin/tools.php:497
2233
+ msgid "Recalculate parent forum for each topic and reply"
2234
+ msgstr ""
2235
+
2236
+ #: includes/admin/tools.php:507
2237
+ msgid "Recalculate private and hidden forums"
2238
+ msgstr ""
2239
+
2240
+ #: includes/admin/tools.php:517
2241
+ msgid "Recalculate last activity in each topic and forum"
2242
+ msgstr ""
2243
+
2244
+ #: includes/admin/tools.php:527
2245
+ msgid "Recalculate sticky relationship of each topic"
2246
+ msgstr ""
2247
+
2248
+ #: includes/admin/tools.php:537
2249
+ msgid "Recalculate the position of each reply"
2250
+ msgstr ""
2251
+
2252
+ #: includes/admin/tools.php:547
2253
+ msgid "Repair BuddyPress Group Forum relationships"
2254
+ msgstr ""
2255
+
2256
+ #: includes/admin/tools.php:557
2257
+ msgid "Repair closed topics"
2258
+ msgstr ""
2259
+
2260
+ #: includes/admin/tools.php:567
2261
+ msgid "Count topics in each forum"
2262
+ msgstr ""
2263
+
2264
+ #: includes/admin/tools.php:577
2265
+ msgid "Count replies in each forum"
2266
+ msgstr ""
2267
+
2268
+ #: includes/admin/tools.php:587
2269
+ msgid "Count replies in each topic"
2270
+ msgstr ""
2271
+
2272
+ #: includes/admin/tools.php:597
2273
+ msgid "Count voices in each topic"
2274
+ msgstr ""
2275
+
2276
+ #: includes/admin/tools.php:607
2277
+ msgid "Count pending, spammed, & trashed replies in each topic"
2278
+ msgstr ""
2279
+
2280
+ #: includes/admin/tools.php:617
2281
+ msgid "Recount topics for each user"
2282
+ msgstr ""
2283
+
2284
+ #: includes/admin/tools.php:627
2285
+ msgid "Recount replies for each user"
2286
+ msgstr ""
2287
+
2288
+ #: includes/admin/tools.php:637
2289
+ msgid "Remove unpublished topics from user favorites"
2290
+ msgstr ""
2291
+
2292
+ #: includes/admin/tools.php:647
2293
+ msgid "Remove unpublished topics from user subscriptions"
2294
+ msgstr ""
2295
+
2296
+ #: includes/admin/tools.php:657
2297
+ msgid "Remove unpublished forums from user subscriptions"
2298
+ msgstr ""
2299
+
2300
+ #: includes/admin/tools.php:667
2301
+ msgid "Remap existing users to default forum roles"
2302
+ msgstr ""
2303
+
2304
+ #: includes/admin/tools.php:677
2305
+ msgid "Upgrade user favorites"
2306
+ msgstr ""
2307
+
2308
+ #: includes/admin/tools.php:687
2309
+ msgid "Upgrade user topic subscriptions"
2310
+ msgstr ""
2311
+
2312
+ #: includes/admin/tools.php:697
2313
+ msgid "Upgrade user forum subscriptions"
2314
+ msgstr ""
2315
+
2316
+ #: includes/admin/tools.php:748
2317
+ msgid "Search Tools:"
2318
+ msgstr ""
2319
+
2320
+ #: includes/admin/tools.php:750
2321
+ msgid "Search Tools"
2322
+ msgstr ""
2323
+
2324
+ #: includes/admin/tools.php:771
2325
+ msgid "Filter by Component"
2326
+ msgstr ""
2327
+
2328
+ #: includes/admin/tools.php:773
2329
+ msgid "All Components"
2330
+ msgstr ""
2331
+
2332
+ #: includes/admin/tools.php:782
2333
+ msgid "Filter"
2334
+ msgstr ""
2335
+
2336
+ #: includes/admin/tools.php:800
2337
+ msgid "Low"
2338
+ msgstr ""
2339
+
2340
+ #: includes/admin/tools.php:803
2341
+ msgid "Medium"
2342
+ msgstr ""
2343
+
2344
+ #: includes/admin/tools.php:806
2345
+ msgid "High"
2346
+ msgstr ""
2347
+
2348
+ #: includes/admin/tools.php:829
2349
+ msgid "Users"
2350
+ msgstr ""
2351
+
2352
+ #: includes/admin/tools.php:1020
2353
+ msgid "All %s"
2354
+ msgstr ""
2355
+
2356
+ #: includes/admin/tools.php:1073
2357
+ msgid "Counting the number of replies in each topic&hellip; %s"
2358
+ msgstr ""
2359
+
2360
+ #: includes/admin/tools.php:1074 includes/admin/tools.php:1129
2361
+ #: includes/admin/tools.php:1178 includes/admin/tools.php:1232
2362
+ #: includes/admin/tools.php:1353 includes/admin/tools.php:1390
2363
+ #: includes/admin/tools.php:1435 includes/admin/tools.php:1487
2364
+ #: includes/admin/tools.php:1539 includes/admin/tools.php:1609
2365
+ #: includes/admin/tools.php:1678 includes/admin/tools.php:1753
2366
+ #: includes/admin/tools.php:1810 includes/admin/tools.php:1938
2367
+ #: includes/admin/tools.php:2051 includes/admin/tools.php:2075
2368
+ #: includes/admin/tools.php:2130 includes/admin/tools.php:2512
2369
+ msgid "Failed!"
2370
+ msgstr ""
2371
+
2372
+ #: includes/admin/tools.php:1108 includes/admin/tools.php:1157
2373
+ #: includes/admin/tools.php:1196 includes/admin/tools.php:1370
2374
+ #: includes/admin/tools.php:1416 includes/admin/tools.php:1468
2375
+ #: includes/admin/tools.php:1520 includes/admin/tools.php:1590
2376
+ #: includes/admin/tools.php:1659 includes/admin/tools.php:1728
2377
+ #: includes/admin/tools.php:1916 includes/admin/tools.php:1981
2378
+ #: includes/admin/tools.php:2055 includes/admin/tools.php:2111
2379
+ #: includes/admin/tools.php:2166 includes/admin/tools.php:2223
2380
+ msgid "Complete!"
2381
+ msgstr ""
2382
+
2383
+ #: includes/admin/tools.php:1128
2384
+ msgid "Counting the number of voices in each topic&hellip; %s"
2385
+ msgstr ""
2386
+
2387
+ #: includes/admin/tools.php:1177
2388
+ msgid ""
2389
+ "Counting the number of pending, spammed, and trashed replies in each "
2390
+ "topic&hellip; %s"
2391
+ msgstr ""
2392
+
2393
+ #: includes/admin/tools.php:1211
2394
+ msgid "Repairing BuddyPress group-forum relationships&hellip; %s"
2395
+ msgstr ""
2396
+
2397
+ #: includes/admin/tools.php:1315
2398
+ msgid "Group Forums"
2399
+ msgstr ""
2400
+
2401
+ #: includes/admin/tools.php:1316
2402
+ msgid "group-forums"
2403
+ msgstr ""
2404
+
2405
+ #: includes/admin/tools.php:1332
2406
+ msgid "Complete! %s groups updated; %s forums updated; %s forum statuses synced."
2407
+ msgstr ""
2408
+
2409
+ #: includes/admin/tools.php:1352
2410
+ msgid "Counting the number of topics in each forum&hellip; %s"
2411
+ msgstr ""
2412
+
2413
+ #: includes/admin/tools.php:1389
2414
+ msgid "Counting the number of replies in each forum&hellip; %s"
2415
+ msgstr ""
2416
+
2417
+ #: includes/admin/tools.php:1434
2418
+ msgid "Counting the number of topics each user has created&hellip; %s"
2419
+ msgstr ""
2420
+
2421
+ #: includes/admin/tools.php:1486
2422
+ msgid "Counting the number of topics to which each user has replied&hellip; %s"
2423
+ msgstr ""
2424
+
2425
+ #: includes/admin/tools.php:1538
2426
+ msgid "Removing trashed topics from user favorites&hellip; %s"
2427
+ msgstr ""
2428
+
2429
+ #: includes/admin/tools.php:1573 includes/admin/tools.php:1642
2430
+ #: includes/admin/tools.php:1711
2431
+ msgid "Nothing to remove!"
2432
+ msgstr ""
2433
+
2434
+ #: includes/admin/tools.php:1608
2435
+ msgid "Removing trashed topics from user subscriptions&hellip; %s"
2436
+ msgstr ""
2437
+
2438
+ #: includes/admin/tools.php:1677
2439
+ msgid "Removing trashed forums from user subscriptions&hellip; %s"
2440
+ msgstr ""
2441
+
2442
+ #: includes/admin/tools.php:1746
2443
+ msgid "Remapping forum role for each user on this site&hellip; %s"
2444
+ msgstr ""
2445
+
2446
+ #: includes/admin/tools.php:1785
2447
+ msgid "Complete! %s users updated."
2448
+ msgstr ""
2449
+
2450
+ #: includes/admin/tools.php:1809
2451
+ msgid "Recomputing latest post in every topic and forum&hellip; %s"
2452
+ msgstr ""
2453
+
2454
+ #: includes/admin/tools.php:1937
2455
+ msgid "Repairing the sticky topic to the parent forum relationships&hellip; %s"
2456
+ msgstr ""
2457
+
2458
+ #: includes/admin/tools.php:2005
2459
+ msgid "Repairing closed topics&hellip; %s"
2460
+ msgstr ""
2461
+
2462
+ #: includes/admin/tools.php:2006
2463
+ msgid "No closed topics to repair."
2464
+ msgstr ""
2465
+
2466
+ #: includes/admin/tools.php:2033
2467
+ msgid "Complete! %d closed topic repaired."
2468
+ msgid_plural "Complete! %d closed topics repaired."
2469
+ msgstr[0] ""
2470
+ msgstr[1] ""
2471
+
2472
+ #: includes/admin/tools.php:2047
2473
+ msgid "Recalculating forum visibility &hellip; %s"
2474
+ msgstr ""
2475
+
2476
+ #: includes/admin/tools.php:2074
2477
+ msgid "Recalculating the forum for each post &hellip; %s"
2478
+ msgstr ""
2479
+
2480
+ #: includes/admin/tools.php:2129
2481
+ msgid "Recalculating the topic for each post &hellip; %s"
2482
+ msgstr ""
2483
+
2484
+ #: includes/admin/tools.php:2184
2485
+ msgid "Recalculating reply menu order &hellip; %s"
2486
+ msgstr ""
2487
+
2488
+ #: includes/admin/tools.php:2185
2489
+ msgid "No reply positions to recalculate."
2490
+ msgstr ""
2491
+
2492
+ #: includes/admin/tools.php:2237
2493
+ msgid "Upgrading user favorites &hellip; %s"
2494
+ msgstr ""
2495
+
2496
+ #: includes/admin/tools.php:2238
2497
+ msgid "No favorites to upgrade."
2498
+ msgstr ""
2499
+
2500
+ #: includes/admin/tools.php:2284
2501
+ msgid "Complete! %d favorite upgraded."
2502
+ msgid_plural "Complete! %d favorites upgraded."
2503
+ msgstr[0] ""
2504
+ msgstr[1] ""
2505
+
2506
+ #: includes/admin/tools.php:2300
2507
+ msgid "Upgrading user topic subscriptions &hellip; %s"
2508
+ msgstr ""
2509
+
2510
+ #: includes/admin/tools.php:2301
2511
+ msgid "No topic subscriptions to upgrade."
2512
+ msgstr ""
2513
+
2514
+ #: includes/admin/tools.php:2347
2515
+ msgid "Complete! %d topic subscription upgraded."
2516
+ msgid_plural "Complete! %d topic subscriptions upgraded."
2517
+ msgstr[0] ""
2518
+ msgstr[1] ""
2519
+
2520
+ #: includes/admin/tools.php:2363
2521
+ msgid "Upgrading user forum subscriptions &hellip; %s"
2522
+ msgstr ""
2523
+
2524
+ #: includes/admin/tools.php:2364
2525
+ msgid "No forum subscriptions to upgrade."
2526
+ msgstr ""
2527
+
2528
+ #: includes/admin/tools.php:2410
2529
+ msgid "Complete! %d forum subscription upgraded."
2530
+ msgid_plural "Complete! %d forum subscriptions upgraded."
2531
+ msgstr[0] ""
2532
+ msgstr[1] ""
2533
+
2534
+ #: includes/admin/tools.php:2432
2535
+ msgid ""
2536
+ "Revert your forums back to a brand new installation. This process cannot be "
2537
+ "undone."
2538
+ msgstr ""
2539
+
2540
+ #: includes/admin/tools.php:2433
2541
+ msgid "Backup your database before proceeding."
2542
+ msgstr ""
2543
+
2544
+ #: includes/admin/tools.php:2439
2545
+ msgid "The following data will be removed:"
2546
+ msgstr ""
2547
+
2548
+ #: includes/admin/tools.php:2441 includes/forums/template.php:51
2549
+ msgid "All Forums"
2550
+ msgstr ""
2551
+
2552
+ #: includes/admin/tools.php:2442 includes/topics/functions.php:4066
2553
+ #: includes/topics/template.php:50
2554
+ msgid "All Topics"
2555
+ msgstr ""
2556
+
2557
+ #: includes/admin/tools.php:2443 includes/replies/functions.php:2295
2558
+ #: includes/replies/template.php:50
2559
+ msgid "All Replies"
2560
+ msgstr ""
2561
+
2562
+ #: includes/admin/tools.php:2444
2563
+ msgid "All Topic Tags"
2564
+ msgstr ""
2565
+
2566
+ #: includes/admin/tools.php:2445
2567
+ msgid "Related Meta Data"
2568
+ msgstr ""
2569
+
2570
+ #: includes/admin/tools.php:2446
2571
+ msgid "Forum Settings"
2572
+ msgstr ""
2573
+
2574
+ #: includes/admin/tools.php:2447
2575
+ msgid "Forum Activity"
2576
+ msgstr ""
2577
+
2578
+ #: includes/admin/tools.php:2448
2579
+ msgid "Forum User Roles"
2580
+ msgstr ""
2581
+
2582
+ #: includes/admin/tools.php:2450
2583
+ msgid "Importer Helper Data"
2584
+ msgstr ""
2585
+
2586
+ #: includes/admin/tools.php:2454
2587
+ msgid "Delete imported users?"
2588
+ msgstr ""
2589
+
2590
+ #: includes/admin/tools.php:2457 includes/admin/tools.php:2467
2591
+ msgid "Say it ain't so!"
2592
+ msgstr ""
2593
+
2594
+ #: includes/admin/tools.php:2458
2595
+ msgid "This option will delete all previously imported users, and cannot be undone."
2596
+ msgstr ""
2597
+
2598
+ #: includes/admin/tools.php:2459
2599
+ msgid ""
2600
+ "Note: Resetting without this checked will delete the meta-data necessary to "
2601
+ "delete these users."
2602
+ msgstr ""
2603
+
2604
+ #: includes/admin/tools.php:2464
2605
+ msgid "Do you really want to do this?"
2606
+ msgstr ""
2607
+
2608
+ #: includes/admin/tools.php:2468
2609
+ #: templates/default/bbpress/form-reply-move.php:73
2610
+ #: templates/default/bbpress/form-topic-merge.php:95
2611
+ #: templates/default/bbpress/form-topic-split.php:99
2612
+ msgid "This process cannot be undone."
2613
+ msgstr ""
2614
+
2615
+ #: includes/admin/tools.php:2476
2616
+ msgid "Reset bbPress"
2617
+ msgstr ""
2618
+
2619
+ #: includes/admin/tools.php:2513
2620
+ msgid "Success!"
2621
+ msgstr ""
2622
+
2623
+ #: includes/admin/tools.php:2527
2624
+ msgid "Deleting Posts&hellip; %s"
2625
+ msgstr ""
2626
+
2627
+ #: includes/admin/tools.php:2541
2628
+ msgid "Deleting Post Meta&hellip; %s"
2629
+ msgstr ""
2630
+
2631
+ #: includes/admin/tools.php:2555
2632
+ msgid "Deleting Post Revisions&hellip; %s"
2633
+ msgstr ""
2634
+
2635
+ #: includes/admin/tools.php:2564
2636
+ msgid "Deleting Forum Moderators&hellip; %s"
2637
+ msgstr ""
2638
+
2639
+ #: includes/admin/tools.php:2571
2640
+ msgid "Deleting Topic Tags&hellip; %s"
2641
+ msgstr ""
2642
+
2643
+ #: includes/admin/tools.php:2586
2644
+ msgid "Deleting Imported Users&hellip; %s"
2645
+ msgstr ""
2646
+
2647
+ #: includes/admin/tools.php:2591
2648
+ msgid "Deleting Imported User Meta&hellip; %s"
2649
+ msgstr ""
2650
+
2651
+ #: includes/admin/tools.php:2599
2652
+ msgid "Deleting User Meta&hellip; %s"
2653
+ msgstr ""
2654
+
2655
+ #: includes/admin/tools.php:2606
2656
+ msgid "Deleting Conversion Table&hellip; %s"
2657
+ msgstr ""
2658
+
2659
+ #: includes/admin/tools.php:2618
2660
+ msgid "Deleting Settings&hellip; %s"
2661
+ msgstr ""
2662
+
2663
+ #: includes/admin/tools.php:2624
2664
+ msgid "Deleting Roles and Capabilities&hellip; %s"
2665
+ msgstr ""
2666
+
2667
+ #: includes/admin/topics.php:132
2668
+ msgid ""
2669
+ "This screen displays the individual topics on your site. You can customize "
2670
+ "the display of this screen to suit your workflow."
2671
+ msgstr ""
2672
+
2673
+ #: includes/admin/topics.php:142
2674
+ msgid ""
2675
+ "You can hide/display columns based on your needs and decide how many topics "
2676
+ "to list per screen using the Screen Options tab."
2677
+ msgstr ""
2678
+
2679
+ #: includes/admin/topics.php:143
2680
+ msgid ""
2681
+ "You can filter the list of topics by topic status using the text links in "
2682
+ "the upper left to show All, Published, Draft, Pending, Trashed, Closed, or "
2683
+ "Spam topics. The default view is to show all topics."
2684
+ msgstr ""
2685
+
2686
+ #: includes/admin/topics.php:144
2687
+ msgid ""
2688
+ "You can view topics in a simple title list or with an excerpt. Choose the "
2689
+ "view you prefer by clicking on the icons at the top of the list on the "
2690
+ "right."
2691
+ msgstr ""
2692
+
2693
+ #: includes/admin/topics.php:145
2694
+ msgid ""
2695
+ "You can refine the list to show only topics in a specific forum or from a "
2696
+ "specific month by using the dropdown menus above the topics list. Click the "
2697
+ "Filter button after making your selection."
2698
+ msgstr ""
2699
+
2700
+ #: includes/admin/topics.php:154
2701
+ msgid ""
2702
+ "Hovering over a row in the topics list will display action links that allow "
2703
+ "you to manage your topic. You can perform the following actions:"
2704
+ msgstr ""
2705
+
2706
+ #: includes/admin/topics.php:156
2707
+ msgid ""
2708
+ "<strong>Edit</strong> takes you to the editing screen for that topic. You "
2709
+ "can also reach that screen by clicking on the topic title."
2710
+ msgstr ""
2711
+
2712
+ #: includes/admin/topics.php:157
2713
+ msgid ""
2714
+ "<strong>Trash</strong> removes your topic from this list and places it in "
2715
+ "the trash, from which you can permanently delete it."
2716
+ msgstr ""
2717
+
2718
+ #: includes/admin/topics.php:158
2719
+ msgid ""
2720
+ "<strong>Spam</strong> removes your topic from this list and places it in "
2721
+ "the spam queue, from which you can permanently delete it."
2722
+ msgstr ""
2723
+
2724
+ #: includes/admin/topics.php:159
2725
+ msgid "<strong>View</strong> will take you to your live site to view the topic."
2726
+ msgstr ""
2727
+
2728
+ #: includes/admin/topics.php:161
2729
+ msgid ""
2730
+ "<strong>Close</strong> will mark the selected topic as &#8217;closed&#8217; "
2731
+ "and disable the option to post new replies to the topic."
2732
+ msgstr ""
2733
+
2734
+ #: includes/admin/topics.php:162
2735
+ msgid ""
2736
+ "<strong>Stick</strong> will keep the selected topic &#8217;pinned&#8217; to "
2737
+ "the top the parent forum topic list."
2738
+ msgstr ""
2739
+
2740
+ #: includes/admin/topics.php:163
2741
+ msgid ""
2742
+ "<strong>Stick <em>(to front)</em></strong> will keep the selected topic "
2743
+ "&#8217;pinned&#8217; to the top of ALL forums and be visable in any forums "
2744
+ "topics list."
2745
+ msgstr ""
2746
+
2747
+ #: includes/admin/topics.php:172
2748
+ msgid ""
2749
+ "You can also edit, spam, or move multiple topics to the trash at once. "
2750
+ "Select the topics you want to act on using the checkboxes, then select the "
2751
+ "action you want to take from the Bulk Actions menu and click Apply."
2752
+ msgstr ""
2753
+
2754
+ #: includes/admin/topics.php:173
2755
+ msgid ""
2756
+ "When using Bulk Edit, you can change the metadata (categories, author, "
2757
+ "etc.) for all selected topics at once. To remove a topic from the grouping, "
2758
+ "just click the x next to its name in the Bulk Edit area that appears."
2759
+ msgstr ""
2760
+
2761
+ #: includes/admin/topics.php:193
2762
+ msgid ""
2763
+ "The title field and the big topic editing Area are fixed in place, but you "
2764
+ "can reposition all the other boxes using drag and drop, and can minimize or "
2765
+ "expand them by clicking the title bar of each box. Use the Screen Options "
2766
+ "tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, "
2767
+ "Discussion, Slug, Author) or to choose a 1- or 2-column layout for this "
2768
+ "screen."
2769
+ msgstr ""
2770
+
2771
+ #: includes/admin/topics.php:203
2772
+ msgid "Title and Topic Editor"
2773
+ msgstr ""
2774
+
2775
+ #: includes/admin/topics.php:205
2776
+ msgid ""
2777
+ "<strong>Title</strong> - Enter a title for your topic. After you enter a "
2778
+ "title, you&#8217;ll see the permalink below, which you can edit."
2779
+ msgstr ""
2780
+
2781
+ #: includes/admin/topics.php:206
2782
+ msgid ""
2783
+ "<strong>Topic Editor</strong> - Enter the text for your topic. There are "
2784
+ "two modes of editing: Visual and HTML. Choose the mode by clicking on the "
2785
+ "appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last "
2786
+ "icon in the row to get a second row of controls. The HTML mode allows you "
2787
+ "to enter raw HTML along with your topic text. You can insert media files by "
2788
+ "clicking the icons above the topic editor and following the directions. You "
2789
+ "can go to the distraction-free writing screen via the Fullscreen icon in "
2790
+ "Visual mode (second to last in the top row) or the Fullscreen button in "
2791
+ "HTML mode (last in the row). Once there, you can make buttons visible by "
2792
+ "hovering over the top area. Exit Fullscreen back to the regular topic "
2793
+ "editor."
2794
+ msgstr ""
2795
+
2796
+ #: includes/admin/topics.php:209
2797
+ msgid ""
2798
+ "<strong>Publish</strong> - You can set the terms of publishing your topic "
2799
+ "in the Publish box. For Status, Visibility, and Publish (immediately), "
2800
+ "click on the Edit link to reveal more options. Visibility includes options "
2801
+ "for password-protecting a topic or making it stay at the top of your blog "
2802
+ "indefinitely (sticky). Publish (immediately) allows you to set a future or "
2803
+ "past date and time, so you can schedule a topic to be published in the "
2804
+ "future or backdate a topic."
2805
+ msgstr ""
2806
+
2807
+ #: includes/admin/topics.php:212
2808
+ msgid ""
2809
+ "<strong>Featured Image</strong> - This allows you to associate an image "
2810
+ "with your topic without inserting it. This is usually useful only if your "
2811
+ "theme makes use of the featured image as a topic thumbnail on the home "
2812
+ "page, a custom header, etc."
2813
+ msgstr ""
2814
+
2815
+ #: includes/admin/topics.php:217 includes/admin/topics.php:349
2816
+ msgid "Topic Attributes"
2817
+ msgstr ""
2818
+
2819
+ #: includes/admin/topics.php:219
2820
+ msgid "Select the attributes that your topic should have:"
2821
+ msgstr ""
2822
+
2823
+ #: includes/admin/topics.php:221
2824
+ msgid ""
2825
+ "<strong>Forum</strong> dropdown determines the parent forum that the topic "
2826
+ "belongs to. Select the forum or category from the dropdown, or leave the "
2827
+ "default \"No forum\" to post the topic without an assigned forum."
2828
+ msgstr ""
2829
+
2830
+ #: includes/admin/topics.php:222
2831
+ msgid ""
2832
+ "<strong>Topic Type</strong> dropdown indicates the sticky status of the "
2833
+ "topic. Selecting the super sticky option would stick the topic to the front "
2834
+ "of your forums, i.e. the topic index, sticky option would stick the topic "
2835
+ "to its respective forum. Selecting normal would not stick the topic "
2836
+ "anywhere."
2837
+ msgstr ""
2838
+
2839
+ #: includes/admin/topics.php:270
2840
+ msgid "%s topic updated."
2841
+ msgid_plural "%s topics updated."
2842
+ msgstr[0] ""
2843
+ msgstr[1] ""
2844
+
2845
+ #: includes/admin/topics.php:271
2846
+ msgid "1 topic not updated, somebody is editing it."
2847
+ msgstr ""
2848
+
2849
+ #: includes/admin/topics.php:272
2850
+ msgid "%s topic not updated, somebody is editing it."
2851
+ msgid_plural "%s topics not updated, somebody is editing them."
2852
+ msgstr[0] ""
2853
+ msgstr[1] ""
2854
+
2855
+ #: includes/admin/topics.php:304
2856
+ msgid "Error in spamming topic."
2857
+ msgstr ""
2858
+
2859
+ #: includes/admin/topics.php:316
2860
+ msgid "Sorry, you are not allowed to unspam this topic."
2861
+ msgstr ""
2862
+
2863
+ #: includes/admin/topics.php:325
2864
+ msgid "Error in unspamming topic."
2865
+ msgstr ""
2866
+
2867
+ #: includes/admin/topics.php:666
2868
+ msgid "The topic was not found."
2869
+ msgstr ""
2870
+
2871
+ #: includes/admin/topics.php:787
2872
+ msgid "There was a problem opening the topic \"%1$s\"."
2873
+ msgstr ""
2874
+
2875
+ #: includes/admin/topics.php:788
2876
+ msgid "Topic \"%1$s\" successfully opened."
2877
+ msgstr ""
2878
+
2879
+ #: includes/admin/topics.php:793
2880
+ msgid "There was a problem closing the topic \"%1$s\"."
2881
+ msgstr ""
2882
+
2883
+ #: includes/admin/topics.php:794
2884
+ msgid "Topic \"%1$s\" successfully closed."
2885
+ msgstr ""
2886
+
2887
+ #: includes/admin/topics.php:799
2888
+ msgid "There was a problem sticking the topic \"%1$s\" to front."
2889
+ msgstr ""
2890
+
2891
+ #: includes/admin/topics.php:800
2892
+ msgid "Topic \"%1$s\" successfully stuck to front."
2893
+ msgstr ""
2894
+
2895
+ #: includes/admin/topics.php:805
2896
+ msgid "There was a problem sticking the topic \"%1$s\"."
2897
+ msgstr ""
2898
+
2899
+ #: includes/admin/topics.php:806
2900
+ msgid "Topic \"%1$s\" successfully stuck."
2901
+ msgstr ""
2902
+
2903
+ #: includes/admin/topics.php:811
2904
+ msgid "There was a problem unsticking the topic \"%1$s\"."
2905
+ msgstr ""
2906
+
2907
+ #: includes/admin/topics.php:812
2908
+ msgid "Topic \"%1$s\" successfully unstuck."
2909
+ msgstr ""
2910
+
2911
+ #: includes/admin/topics.php:817
2912
+ msgid "There was a problem marking the topic \"%1$s\" as spam."
2913
+ msgstr ""
2914
+
2915
+ #: includes/admin/topics.php:818
2916
+ msgid "Topic \"%1$s\" successfully marked as spam."
2917
+ msgstr ""
2918
+
2919
+ #: includes/admin/topics.php:823
2920
+ msgid "There was a problem unmarking the topic \"%1$s\" as spam."
2921
+ msgstr ""
2922
+
2923
+ #: includes/admin/topics.php:824
2924
+ msgid "Topic \"%1$s\" successfully unmarked as spam."
2925
+ msgstr ""
2926
+
2927
+ #: includes/admin/topics.php:829
2928
+ msgid "There was a problem approving the topic \"%1$s\"."
2929
+ msgstr ""
2930
+
2931
+ #: includes/admin/topics.php:830
2932
+ msgid "Topic \"%1$s\" successfully approved."
2933
+ msgstr ""
2934
+
2935
+ #: includes/admin/topics.php:835
2936
+ msgid "There was a problem unapproving the topic \"%1$s\"."
2937
+ msgstr ""
2938
+
2939
+ #: includes/admin/topics.php:836
2940
+ msgid "Topic \"%1$s\" successfully unapproved."
2941
+ msgstr ""
2942
+
2943
+ #: includes/admin/topics.php:869 templates/default/bbpress/loop-topics.php:16
2944
+ msgid "Voices"
2945
+ msgstr ""
2946
+
2947
+ #: includes/admin/topics.php:961 includes/topics/template.php:2154
2948
+ msgid "No Replies"
2949
+ msgstr ""
2950
+
2951
+ #: includes/admin/topics.php:1016
2952
+ msgid "Unapprove this topic"
2953
+ msgstr ""
2954
+
2955
+ #: includes/admin/topics.php:1018
2956
+ msgid "Approve this topic"
2957
+ msgstr ""
2958
+
2959
+ #: includes/admin/topics.php:1027
2960
+ msgid "Close this topic"
2961
+ msgstr ""
2962
+
2963
+ #: includes/admin/topics.php:1029
2964
+ msgid "Open this topic"
2965
+ msgstr ""
2966
+
2967
+ #: includes/admin/topics.php:1038
2968
+ msgid "Unstick this topic"
2969
+ msgstr ""
2970
+
2971
+ #: includes/admin/topics.php:1038 includes/topics/template.php:2913
2972
+ msgid "Unstick"
2973
+ msgstr ""
2974
+
2975
+ #: includes/admin/topics.php:1041
2976
+ msgid "Stick this topic to its forum"
2977
+ msgstr ""
2978
+
2979
+ #: includes/admin/topics.php:1041 includes/topics/template.php:2912
2980
+ msgid "Stick"
2981
+ msgstr ""
2982
+
2983
+ #: includes/admin/topics.php:1041
2984
+ msgid "Stick this topic to front"
2985
+ msgstr ""
2986
+
2987
+ #: includes/admin/topics.php:1041 includes/topics/template.php:2914
2988
+ msgid "(to front)"
2989
+ msgstr ""
2990
+
2991
+ #: includes/admin/topics.php:1048
2992
+ msgid "Mark the topic as not spam"
2993
+ msgstr ""
2994
+
2995
+ #: includes/admin/topics.php:1050
2996
+ msgid "Mark this topic as spam"
2997
+ msgstr ""
2998
+
2999
+ #: includes/admin/topics.php:1163 includes/admin/topics.php:1175
3000
+ msgid "Topic updated."
3001
+ msgstr ""
3002
+
3003
+ #: includes/admin/topics.php:1180
3004
+ #. translators: %s: date and time of the revision
3005
+ msgid "Topic restored to revision from %s"
3006
+ msgstr ""
3007
+
3008
+ #: includes/admin/topics.php:1186
3009
+ msgid "Topic created."
3010
+ msgstr ""
3011
+
3012
+ #: includes/admin/topics.php:1192
3013
+ msgid "Topic saved."
3014
+ msgstr ""
3015
+
3016
+ #: includes/admin/topics.php:1197
3017
+ msgid "Topic submitted."
3018
+ msgstr ""
3019
+
3020
+ #: includes/admin/topics.php:1206
3021
+ msgid "Topic scheduled for: %s."
3022
+ msgstr ""
3023
+
3024
+ #: includes/admin/topics.php:1217
3025
+ msgid "Topic draft updated."
3026
+ msgstr ""
3027
+
3028
+ #: includes/admin/users.php:102 includes/admin/users.php:263
3029
+ #: templates/default/bbpress/form-user-roles.php:20
3030
+ msgid "Forum Role"
3031
+ msgstr ""
3032
+
3033
+ #: includes/admin/users.php:111 includes/admin/users.php:115
3034
+ #: includes/users/template.php:1361
3035
+ msgid "&mdash; No role for these forums &mdash;"
3036
+ msgstr ""
3037
+
3038
+ #: includes/admin/users.php:168 includes/admin/users.php:170
3039
+ msgid "Change forum role to&hellip;"
3040
+ msgstr ""
3041
+
3042
+ #: includes/admin/users.php:174
3043
+ msgid "Change"
3044
+ msgstr ""
3045
+
3046
+ #: includes/admin/users.php:262
3047
+ msgid "Site Role"
3048
+ msgstr ""
3049
+
3050
+ #: includes/common/functions.php:113
3051
+ msgid "sometime"
3052
+ msgstr ""
3053
+
3054
+ #: includes/common/functions.php:114
3055
+ msgid "right now"
3056
+ msgstr ""
3057
+
3058
+ #: includes/common/functions.php:115
3059
+ msgid "%s ago"
3060
+ msgstr ""
3061
+
3062
+ #: includes/common/functions.php:119
3063
+ msgid "year"
3064
+ msgstr ""
3065
+
3066
+ #: includes/common/functions.php:119
3067
+ msgid "years"
3068
+ msgstr ""
3069
+
3070
+ #: includes/common/functions.php:120
3071
+ msgid "month"
3072
+ msgstr ""
3073
+
3074
+ #: includes/common/functions.php:120
3075
+ msgid "months"
3076
+ msgstr ""
3077
+
3078
+ #: includes/common/functions.php:121
3079
+ msgid "week"
3080
+ msgstr ""
3081
+
3082
+ #: includes/common/functions.php:121
3083
+ msgid "weeks"
3084
+ msgstr ""
3085
+
3086
+ #: includes/common/functions.php:122
3087
+ msgid "day"
3088
+ msgstr ""
3089
+
3090
+ #: includes/common/functions.php:122
3091
+ msgid "days"
3092
+ msgstr ""
3093
+
3094
+ #: includes/common/functions.php:123
3095
+ msgid "hour"
3096
+ msgstr ""
3097
+
3098
+ #: includes/common/functions.php:123
3099
+ msgid "hours"
3100
+ msgstr ""
3101
+
3102
+ #: includes/common/functions.php:124
3103
+ msgid "minute"
3104
+ msgstr ""
3105
+
3106
+ #: includes/common/functions.php:125
3107
+ msgid "second"
3108
+ msgstr ""
3109
+
3110
+ #: includes/common/functions.php:534 includes/common/functions.php:573
3111
+ msgid "Pending: %s"
3112
+ msgstr ""
3113
+
3114
+ #: includes/common/functions.php:535 includes/common/functions.php:574
3115
+ msgid "Private: %s"
3116
+ msgstr ""
3117
+
3118
+ #: includes/common/functions.php:536 includes/common/functions.php:575
3119
+ msgid "Spammed: %s"
3120
+ msgstr ""
3121
+
3122
+ #: includes/common/functions.php:537 includes/common/functions.php:576
3123
+ msgid "Trashed: %s"
3124
+ msgstr ""
3125
+
3126
+ #: includes/common/functions.php:659
3127
+ msgid "<strong>ERROR</strong>: Invalid author name."
3128
+ msgstr ""
3129
+
3130
+ #: includes/common/functions.php:664
3131
+ msgid "<strong>ERROR</strong>: Invalid email address."
3132
+ msgstr ""
3133
+
3134
+ #: includes/common/functions.php:1167
3135
+ msgid ""
3136
+ "%1$s wrote:\n"
3137
+ "\n"
3138
+ "%2$s\n"
3139
+ "\n"
3140
+ "Post Link: %3$s\n"
3141
+ "\n"
3142
+ "-----------\n"
3143
+ "\n"
3144
+ "You are receiving this email because you subscribed to a forum topic.\n"
3145
+ "\n"
3146
+ "Login and visit the topic to unsubscribe from these emails."
3147
+ msgstr ""
3148
+
3149
+ #: includes/common/functions.php:1324
3150
+ msgid ""
3151
+ "%1$s wrote:\n"
3152
+ "\n"
3153
+ "%2$s\n"
3154
+ "\n"
3155
+ "Topic Link: %3$s\n"
3156
+ "\n"
3157
+ "-----------\n"
3158
+ "\n"
3159
+ "You are receiving this email because you subscribed to a forum.\n"
3160
+ "\n"
3161
+ "Login and visit the topic to unsubscribe from these emails."
3162
+ msgstr ""
3163
+
3164
+ #: includes/common/functions.php:2151
3165
+ msgid ""
3166
+ "Conditional query tags do not work before the query is run. Before then, "
3167
+ "they always return false."
3168
+ msgstr ""
3169
+
3170
+ #: includes/common/template.php:1535
3171
+ msgid "No topics available"
3172
+ msgstr ""
3173
+
3174
+ #: includes/common/template.php:1540
3175
+ msgid "No forums available"
3176
+ msgstr ""
3177
+
3178
+ #: includes/common/template.php:1545
3179
+ msgid "None available"
3180
+ msgstr ""
3181
+
3182
+ #: includes/common/template.php:2216
3183
+ msgid "Home"
3184
+ msgstr ""
3185
+
3186
+ #: includes/common/template.php:2286
3187
+ msgid "(Edit)"
3188
+ msgstr ""
3189
+
3190
+ #: includes/common/template.php:2290 includes/common/template.php:2405
3191
+ #: includes/common/template.php:2673 includes/core/theme-compat.php:769
3192
+ #: templates/default/extras/taxonomy-topic-tag-edit.php:17
3193
+ #: templates/default/extras/taxonomy-topic-tag.php:17
3194
+ msgid "Topic Tag: %s"
3195
+ msgstr ""
3196
+
3197
+ #: includes/common/template.php:2311
3198
+ msgid "&lsaquo;"
3199
+ msgstr ""
3200
+
3201
+ #: includes/common/template.php:2311
3202
+ msgid "&rsaquo;"
3203
+ msgstr ""
3204
+
3205
+ #: includes/common/template.php:2583
3206
+ msgid "Log Out"
3207
+ msgstr ""
3208
+
3209
+ #: includes/common/template.php:2637
3210
+ msgid "Forum Edit: %s"
3211
+ msgstr ""
3212
+
3213
+ #: includes/common/template.php:2642
3214
+ msgid "Topic Edit: %s"
3215
+ msgstr ""
3216
+
3217
+ #: includes/common/template.php:2647
3218
+ msgid "Reply Edit: %s"
3219
+ msgstr ""
3220
+
3221
+ #: includes/common/template.php:2652
3222
+ msgid "Topic Tag Edit: %s"
3223
+ msgstr ""
3224
+
3225
+ #: includes/common/template.php:2659
3226
+ msgid "Forum: %s"
3227
+ msgstr ""
3228
+
3229
+ #: includes/common/template.php:2664
3230
+ msgid "Topic: %s"
3231
+ msgstr ""
3232
+
3233
+ #: includes/common/template.php:2686
3234
+ msgid "Your Topics"
3235
+ msgstr ""
3236
+
3237
+ #: includes/common/template.php:2690
3238
+ #. translators: user's display name
3239
+ msgid "%s's Topics"
3240
+ msgstr ""
3241
+
3242
+ #: includes/common/template.php:2696
3243
+ msgid "Your Replies"
3244
+ msgstr ""
3245
+
3246
+ #: includes/common/template.php:2700
3247
+ #. translators: user's display name
3248
+ msgid "%s's Replies"
3249
+ msgstr ""
3250
+
3251
+ #: includes/common/template.php:2706
3252
+ msgid "Your Favorites"
3253
+ msgstr ""
3254
+
3255
+ #: includes/common/template.php:2710
3256
+ #: templates/default/bbpress/user-details.php:46
3257
+ #. translators: user's display name
3258
+ msgid "%s's Favorites"
3259
+ msgstr ""
3260
+
3261
+ #: includes/common/template.php:2716
3262
+ msgid "Your Subscriptions"
3263
+ msgstr ""
3264
+
3265
+ #: includes/common/template.php:2720
3266
+ #: templates/default/bbpress/user-details.php:56
3267
+ #. translators: user's display name
3268
+ msgid "%s's Subscriptions"
3269
+ msgstr ""
3270
+
3271
+ #: includes/common/template.php:2726
3272
+ msgid "Your Profile"
3273
+ msgstr ""
3274
+
3275
+ #: includes/common/template.php:2730
3276
+ #: templates/default/bbpress/user-details.php:27
3277
+ #. translators: user's display name
3278
+ msgid "%s's Profile"
3279
+ msgstr ""
3280
+
3281
+ #: includes/common/template.php:2739
3282
+ msgid "Edit Your Profile"
3283
+ msgstr ""
3284
+
3285
+ #: includes/common/template.php:2744
3286
+ #: templates/default/bbpress/user-details.php:63
3287
+ msgid "Edit %s's Profile"
3288
+ msgstr ""
3289
+
3290
+ #: includes/common/template.php:2752
3291
+ msgid "View: %s"
3292
+ msgstr ""
3293
+
3294
+ #: includes/common/widgets.php:39
3295
+ msgid "A simple login form with optional links to sign-up and lost password pages."
3296
+ msgstr ""
3297
+
3298
+ #: includes/common/widgets.php:42
3299
+ msgid "(bbPress) Login Widget"
3300
+ msgstr ""
3301
+
3302
+ #: includes/common/widgets.php:89 includes/common/widgets.php:110
3303
+ #: templates/default/bbpress/form-user-login.php:14
3304
+ #: templates/default/bbpress/form-user-login.php:35
3305
+ msgid "Log In"
3306
+ msgstr ""
3307
+
3308
+ #: includes/common/widgets.php:92
3309
+ #: templates/default/bbpress/form-user-edit.php:104
3310
+ #: templates/default/bbpress/form-user-login.php:17
3311
+ #: templates/default/bbpress/form-user-register.php:26
3312
+ msgid "Username"
3313
+ msgstr ""
3314
+
3315
+ #: includes/common/widgets.php:97
3316
+ #: templates/default/bbpress/form-user-login.php:22
3317
+ msgid "Password"
3318
+ msgstr ""
3319
+
3320
+ #: includes/common/widgets.php:103
3321
+ msgid "Remember Me"
3322
+ msgstr ""
3323
+
3324
+ #: includes/common/widgets.php:122
3325
+ #: templates/default/bbpress/form-user-register.php:39
3326
+ msgid "Register"
3327
+ msgstr ""
3328
+
3329
+ #: includes/common/widgets.php:128
3330
+ #: templates/default/bbpress/form-user-lost-pass.php:14
3331
+ msgid "Lost Password"
3332
+ msgstr ""
3333
+
3334
+ #: includes/common/widgets.php:185 includes/common/widgets.php:337
3335
+ #: includes/common/widgets.php:466 includes/common/widgets.php:639
3336
+ #: includes/common/widgets.php:883 includes/common/widgets.php:1037
3337
+ #: includes/common/widgets.php:1241
3338
+ msgid "Title:"
3339
+ msgstr ""
3340
+
3341
+ #: includes/common/widgets.php:190
3342
+ msgid "Register URI:"
3343
+ msgstr ""
3344
+
3345
+ #: includes/common/widgets.php:195
3346
+ msgid "Lost Password URI:"
3347
+ msgstr ""
3348
+
3349
+ #: includes/common/widgets.php:243
3350
+ msgid "A list of registered optional topic views."
3351
+ msgstr ""
3352
+
3353
+ #: includes/common/widgets.php:246
3354
+ msgid "(bbPress) Topic Views List"
3355
+ msgstr ""
3356
+
3357
+ #: includes/common/widgets.php:384
3358
+ msgid "The bbPress forum search form."
3359
+ msgstr ""
3360
+
3361
+ #: includes/common/widgets.php:387
3362
+ msgid "(bbPress) Forum Search Form"
3363
+ msgstr ""
3364
+
3365
+ #: includes/common/widgets.php:484 includes/forums/template.php:60
3366
+ msgid "Search Forums"
3367
+ msgstr ""
3368
+
3369
+ #: includes/common/widgets.php:513
3370
+ msgid "A list of forums with an option to set the parent."
3371
+ msgstr ""
3372
+
3373
+ #: includes/common/widgets.php:516
3374
+ msgid "(bbPress) Forums List"
3375
+ msgstr ""
3376
+
3377
+ #: includes/common/widgets.php:645 includes/common/widgets.php:887
3378
+ msgid "Parent Forum ID:"
3379
+ msgstr ""
3380
+
3381
+ #: includes/common/widgets.php:651 includes/common/widgets.php:893
3382
+ msgid "\"0\" to show only root - \"any\" to show all"
3383
+ msgstr ""
3384
+
3385
+ #: includes/common/widgets.php:697
3386
+ msgid "A list of recent topics, sorted by: newness, popularity, or recent replies."
3387
+ msgstr ""
3388
+
3389
+ #: includes/common/widgets.php:700
3390
+ msgid "(bbPress) Recent Topics"
3391
+ msgstr ""
3392
+
3393
+ #: includes/common/widgets.php:884
3394
+ msgid "Maximum topics to show:"
3395
+ msgstr ""
3396
+
3397
+ #: includes/common/widgets.php:896 includes/common/widgets.php:1243
3398
+ msgid "Show post date:"
3399
+ msgstr ""
3400
+
3401
+ #: includes/common/widgets.php:897
3402
+ msgid "Show topic author:"
3403
+ msgstr ""
3404
+
3405
+ #: includes/common/widgets.php:900
3406
+ msgid "Order By:"
3407
+ msgstr ""
3408
+
3409
+ #: includes/common/widgets.php:902
3410
+ msgid "Newest Topics"
3411
+ msgstr ""
3412
+
3413
+ #: includes/common/widgets.php:903
3414
+ #: templates/default/extras/page-forum-statistics.php:34
3415
+ msgid "Popular Topics"
3416
+ msgstr ""
3417
+
3418
+ #: includes/common/widgets.php:904
3419
+ msgid "Topics With Recent Replies"
3420
+ msgstr ""
3421
+
3422
+ #: includes/common/widgets.php:921
3423
+ msgid "Recent Topics"
3424
+ msgstr ""
3425
+
3426
+ #: includes/common/widgets.php:955
3427
+ msgid "Some statistics from your forum."
3428
+ msgstr ""
3429
+
3430
+ #: includes/common/widgets.php:958
3431
+ msgid "(bbPress) Statistics"
3432
+ msgstr ""
3433
+
3434
+ #: includes/common/widgets.php:1055
3435
+ msgid "Forum Statistics"
3436
+ msgstr ""
3437
+
3438
+ #: includes/common/widgets.php:1085
3439
+ msgid "A list of the most recent replies."
3440
+ msgstr ""
3441
+
3442
+ #: includes/common/widgets.php:1088
3443
+ msgid "(bbPress) Recent Replies"
3444
+ msgstr ""
3445
+
3446
+ #: includes/common/widgets.php:1242
3447
+ msgid "Maximum replies to show:"
3448
+ msgstr ""
3449
+
3450
+ #: includes/common/widgets.php:1244
3451
+ msgid "Show reply author:"
3452
+ msgstr ""
3453
+
3454
+ #: includes/common/widgets.php:1259
3455
+ msgid "Recent Replies"
3456
+ msgstr ""
3457
+
3458
+ #: includes/core/capabilities.php:497
3459
+ msgid "Editable forum roles no longer exist."
3460
+ msgstr ""
3461
+
3462
+ #: includes/core/update.php:190
3463
+ msgid "General"
3464
+ msgstr ""
3465
+
3466
+ #: includes/core/update.php:191
3467
+ msgid "General chit-chat"
3468
+ msgstr ""
3469
+
3470
+ #: includes/core/update.php:192
3471
+ msgid "Hello World!"
3472
+ msgstr ""
3473
+
3474
+ #: includes/core/update.php:193
3475
+ msgid "I am the first topic in your new forums."
3476
+ msgstr ""
3477
+
3478
+ #: includes/core/update.php:194
3479
+ msgid "Oh, and this is what a reply looks like."
3480
+ msgstr ""
3481
+
3482
+ #: includes/extend/akismet.php:342
3483
+ #. translators: %s: reporter name
3484
+ msgid "%s reported this topic as spam"
3485
+ msgstr ""
3486
+
3487
+ #: includes/extend/akismet.php:347
3488
+ #. translators: %s: reporter name
3489
+ msgid "%s reported this reply as spam"
3490
+ msgstr ""
3491
+
3492
+ #: includes/extend/akismet.php:352
3493
+ #. translators: 1: reporter name, 2: comment type
3494
+ msgid "%1$s reported this %2$s as spam"
3495
+ msgstr ""
3496
+
3497
+ #: includes/extend/akismet.php:367
3498
+ #. translators: %s: reporter name
3499
+ msgid "%s reported this topic as not spam"
3500
+ msgstr ""
3501
+
3502
+ #: includes/extend/akismet.php:372
3503
+ #. translators: %s: reporter name
3504
+ msgid "%s reported this reply as not spam"
3505
+ msgstr ""
3506
+
3507
+ #: includes/extend/akismet.php:377
3508
+ #. translators: 1: reporter name, 2: comment type
3509
+ msgid "%1$s reported this %2$s as not spam"
3510
+ msgstr ""
3511
+
3512
+ #: includes/extend/akismet.php:471
3513
+ msgid "No response"
3514
+ msgstr ""
3515
+
3516
+ #: includes/extend/akismet.php:531
3517
+ msgid "Akismet caught this post as spam"
3518
+ msgstr ""
3519
+
3520
+ #: includes/extend/akismet.php:535 includes/extend/akismet.php:550
3521
+ msgid "Post status was changed to %s"
3522
+ msgstr ""
3523
+
3524
+ #: includes/extend/akismet.php:543
3525
+ msgid "Akismet cleared this post as not spam"
3526
+ msgstr ""
3527
+
3528
+ #: includes/extend/akismet.php:557
3529
+ msgid ""
3530
+ "Akismet was unable to check this post (response: %s), will automatically "
3531
+ "retry again later."
3532
+ msgstr ""
3533
+
3534
+ #: includes/extend/akismet.php:770 includes/extend/akismet.php:780
3535
+ msgid "Akismet History"
3536
+ msgstr ""
3537
+
3538
+ #: includes/extend/akismet.php:828
3539
+ msgid "No recorded history. Akismet has not checked this post."
3540
+ msgstr ""
3541
+
3542
+ #: includes/extend/buddypress/activity.php:199
3543
+ msgid "New forum topic"
3544
+ msgstr ""
3545
+
3546
+ #: includes/extend/buddypress/activity.php:200
3547
+ msgid "New forum reply"
3548
+ msgstr ""
3549
+
3550
+ #: includes/extend/buddypress/activity.php:435
3551
+ msgid "%1$s started the topic %2$s in the forum %3$s"
3552
+ msgstr ""
3553
+
3554
+ #: includes/extend/buddypress/activity.php:588
3555
+ msgid "%1$s replied to the topic %2$s in the forum %3$s"
3556
+ msgstr ""
3557
+
3558
+ #: includes/extend/buddypress/groups.php:306
3559
+ #: includes/extend/buddypress/groups.php:309
3560
+ msgid "Group Forum Settings"
3561
+ msgstr ""
3562
+
3563
+ #: includes/extend/buddypress/groups.php:310
3564
+ #: includes/extend/buddypress/groups.php:516
3565
+ msgid ""
3566
+ "Create a discussion forum to allow members of this group to communicate in "
3567
+ "a structured, bulletin-board style fashion."
3568
+ msgstr ""
3569
+
3570
+ #: includes/extend/buddypress/groups.php:314
3571
+ #: includes/extend/buddypress/groups.php:519
3572
+ msgid "Yes. I want this group to have a forum."
3573
+ msgstr ""
3574
+
3575
+ #: includes/extend/buddypress/groups.php:317
3576
+ msgid "Saying no will not delete existing forum content."
3577
+ msgstr ""
3578
+
3579
+ #: includes/extend/buddypress/groups.php:322
3580
+ msgid "Group Forum:"
3581
+ msgstr ""
3582
+
3583
+ #: includes/extend/buddypress/groups.php:330
3584
+ msgid "Network administrators can reconfigure which forum belongs to this group."
3585
+ msgstr ""
3586
+
3587
+ #: includes/extend/buddypress/groups.php:335
3588
+ msgid "Save Settings"
3589
+ msgstr ""
3590
+
3591
+ #: includes/extend/buddypress/groups.php:372
3592
+ #: includes/extend/buddypress/groups.php:534
3593
+ #: includes/extend/buddypress/notifications.php:179
3594
+ #: includes/forums/functions.php:132 includes/forums/functions.php:415
3595
+ #: includes/replies/functions.php:156 includes/replies/functions.php:558
3596
+ #: includes/replies/functions.php:1357 includes/topics/functions.php:137
3597
+ #: includes/topics/functions.php:523 includes/topics/functions.php:1224
3598
+ #: includes/topics/functions.php:1538 includes/topics/functions.php:1894
3599
+ #: includes/topics/functions.php:1934 includes/topics/functions.php:1992
3600
+ #: includes/users/functions.php:508 includes/users/functions.php:1165
3601
+ #: includes/users/functions.php:1270 includes/users/functions.php:1363
3602
+ #: includes/users/functions.php:1369 includes/users/functions.php:1559
3603
+ msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
3604
+ msgstr ""
3605
+
3606
+ #: includes/extend/buddypress/groups.php:514
3607
+ msgid "Group Forum"
3608
+ msgstr ""
3609
+
3610
+ #: includes/extend/buddypress/groups.php:873
3611
+ msgid "This group does not currently have a forum."
3612
+ msgstr ""
3613
+
3614
+ #: includes/extend/buddypress/loader.php:107
3615
+ msgid "Search Forums..."
3616
+ msgstr ""
3617
+
3618
+ #: includes/extend/buddypress/loader.php:318
3619
+ #: templates/default/bbpress/user-subscriptions.php:35
3620
+ msgid "Subscribed Topics"
3621
+ msgstr ""
3622
+
3623
+ #: includes/extend/buddypress/notifications.php:69
3624
+ msgid "Topic Replies"
3625
+ msgstr ""
3626
+
3627
+ #: includes/extend/buddypress/notifications.php:72
3628
+ msgid "You have %d new replies"
3629
+ msgstr ""
3630
+
3631
+ #: includes/extend/buddypress/notifications.php:76
3632
+ msgid "You have %d new reply to %2$s from %3$s"
3633
+ msgstr ""
3634
+
3635
+ #: includes/extend/buddypress/notifications.php:78
3636
+ msgid "You have %d new reply to %s"
3637
+ msgstr ""
3638
+
3639
+ #: includes/extend/buddypress/notifications.php:183
3640
+ msgid ""
3641
+ "<strong>ERROR</strong>: You do not have permission to mark notifications "
3642
+ "for that user."
3643
+ msgstr ""
3644
+
3645
+ #: includes/forums/functions.php:145
3646
+ msgid "<strong>ERROR</strong>: You do not have permission to create new forums."
3647
+ msgstr ""
3648
+
3649
+ #: includes/forums/functions.php:170 includes/forums/functions.php:476
3650
+ msgid "<strong>ERROR</strong>: Your forum needs a title."
3651
+ msgstr ""
3652
+
3653
+ #: includes/forums/functions.php:184 includes/forums/functions.php:490
3654
+ msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
3655
+ msgstr ""
3656
+
3657
+ #: includes/forums/functions.php:199
3658
+ msgid "<strong>ERROR</strong>: Your forum must have a parent."
3659
+ msgstr ""
3660
+
3661
+ #: includes/forums/functions.php:206
3662
+ msgid ""
3663
+ "<strong>ERROR</strong>: This forum is a category. No forums can be created "
3664
+ "in this forum."
3665
+ msgstr ""
3666
+
3667
+ #: includes/forums/functions.php:211 includes/forums/functions.php:451
3668
+ msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
3669
+ msgstr ""
3670
+
3671
+ #: includes/forums/functions.php:216 includes/forums/functions.php:456
3672
+ msgid ""
3673
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
3674
+ "capability to read or create new forums in it."
3675
+ msgstr ""
3676
+
3677
+ #: includes/forums/functions.php:221 includes/forums/functions.php:461
3678
+ msgid ""
3679
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3680
+ "capability to read or create new forums in it."
3681
+ msgstr ""
3682
+
3683
+ #: includes/forums/functions.php:228 includes/replies/functions.php:327
3684
+ #: includes/topics/functions.php:279
3685
+ msgid "<strong>ERROR</strong>: Slow down; you move too fast."
3686
+ msgstr ""
3687
+
3688
+ #: includes/forums/functions.php:234
3689
+ msgid "<strong>ERROR</strong>: This forum already exists."
3690
+ msgstr ""
3691
+
3692
+ #: includes/forums/functions.php:240
3693
+ msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
3694
+ msgstr ""
3695
+
3696
+ #: includes/forums/functions.php:404
3697
+ msgid "<strong>ERROR</strong>: Forum ID not found."
3698
+ msgstr ""
3699
+
3700
+ #: includes/forums/functions.php:420
3701
+ msgid "<strong>ERROR</strong>: The forum you want to edit was not found."
3702
+ msgstr ""
3703
+
3704
+ #: includes/forums/functions.php:425
3705
+ msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
3706
+ msgstr ""
3707
+
3708
+ #: includes/forums/functions.php:496
3709
+ msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
3710
+ msgstr ""
3711
+
3712
+ #: includes/forums/template.php:52 includes/replies/template.php:51
3713
+ #: includes/topics/template.php:51
3714
+ msgid "Add New"
3715
+ msgstr ""
3716
+
3717
+ #: includes/forums/template.php:53 templates/default/bbpress/form-forum.php:37
3718
+ msgid "Create New Forum"
3719
+ msgstr ""
3720
+
3721
+ #: includes/forums/template.php:55
3722
+ msgid "Edit Forum"
3723
+ msgstr ""
3724
+
3725
+ #: includes/forums/template.php:56
3726
+ msgid "New Forum"
3727
+ msgstr ""
3728
+
3729
+ #: includes/forums/template.php:57 includes/forums/template.php:58
3730
+ msgid "View Forum"
3731
+ msgstr ""
3732
+
3733
+ #: includes/forums/template.php:59
3734
+ msgid "View Forums"
3735
+ msgstr ""
3736
+
3737
+ #: includes/forums/template.php:61
3738
+ msgid "No forums found"
3739
+ msgstr ""
3740
+
3741
+ #: includes/forums/template.php:62
3742
+ msgid "No forums found in Trash"
3743
+ msgstr ""
3744
+
3745
+ #: includes/forums/template.php:63 templates/default/bbpress/form-forum.php:136
3746
+ msgid "Parent Forum:"
3747
+ msgstr ""
3748
+
3749
+ #: includes/forums/template.php:860 includes/topics/template.php:1933
3750
+ #: includes/users/template.php:1058
3751
+ msgid "Subscribe"
3752
+ msgstr ""
3753
+
3754
+ #: includes/forums/template.php:861 includes/topics/template.php:1934
3755
+ #: includes/users/template.php:1059
3756
+ msgid "Unsubscribe"
3757
+ msgstr ""
3758
+
3759
+ #: includes/forums/template.php:1269 includes/forums/template.php:2120
3760
+ msgid "%s topic"
3761
+ msgid_plural "%s topics"
3762
+ msgstr[0] ""
3763
+ msgstr[1] ""
3764
+
3765
+ #: includes/forums/template.php:1286 includes/topics/template.php:2210
3766
+ msgid "(+ %d hidden)"
3767
+ msgid_plural "(+ %d hidden)"
3768
+ msgstr[0] ""
3769
+ msgstr[1] ""
3770
+
3771
+ #: includes/forums/template.php:2109 includes/topics/template.php:2193
3772
+ msgid "%s reply"
3773
+ msgid_plural "%s replies"
3774
+ msgstr[0] ""
3775
+ msgstr[1] ""
3776
+
3777
+ #: includes/forums/template.php:2129
3778
+ msgid "This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
3779
+ msgstr ""
3780
+
3781
+ #: includes/forums/template.php:2131
3782
+ msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
3783
+ msgstr ""
3784
+
3785
+ #: includes/forums/template.php:2137
3786
+ msgid "This category contains %1$s, and was last updated by %2$s %3$s."
3787
+ msgstr ""
3788
+
3789
+ #: includes/forums/template.php:2139
3790
+ msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
3791
+ msgstr ""
3792
+
3793
+ #: includes/forums/template.php:2149
3794
+ msgid "This category contains %1$s and %2$s."
3795
+ msgstr ""
3796
+
3797
+ #: includes/forums/template.php:2151
3798
+ msgid "This forum contains %1$s and %2$s."
3799
+ msgstr ""
3800
+
3801
+ #: includes/forums/template.php:2159
3802
+ msgid "This category contains %1$s."
3803
+ msgstr ""
3804
+
3805
+ #: includes/forums/template.php:2161
3806
+ msgid "This forum contains %1$s."
3807
+ msgstr ""
3808
+
3809
+ #: includes/forums/template.php:2165
3810
+ msgid "This forum is empty."
3811
+ msgstr ""
3812
+
3813
+ #: includes/replies/functions.php:182
3814
+ msgid "<strong>ERROR</strong>: You do not have permission to reply."
3815
+ msgstr ""
3816
+
3817
+ #: includes/replies/functions.php:194
3818
+ msgid "<strong>ERROR</strong>: Topic ID is missing."
3819
+ msgstr ""
3820
+
3821
+ #: includes/replies/functions.php:198
3822
+ msgid "<strong>ERROR</strong>: Topic ID must be a number."
3823
+ msgstr ""
3824
+
3825
+ #: includes/replies/functions.php:208
3826
+ msgid "<strong>ERROR</strong>: Topic ID cannot be a negative number."
3827
+ msgstr ""
3828
+
3829
+ #: includes/replies/functions.php:212
3830
+ msgid "<strong>ERROR</strong>: Topic does not exist."
3831
+ msgstr ""
3832
+
3833
+ #: includes/replies/functions.php:231 includes/replies/functions.php:245
3834
+ #: includes/topics/functions.php:215 includes/topics/functions.php:229
3835
+ #: includes/topics/functions.php:538
3836
+ msgid "<strong>ERROR</strong>: Forum ID is missing."
3837
+ msgstr ""
3838
+
3839
+ #: includes/replies/functions.php:235 includes/topics/functions.php:219
3840
+ msgid "<strong>ERROR</strong>: Forum ID must be a number."
3841
+ msgstr ""
3842
+
3843
+ #: includes/replies/functions.php:249 includes/topics/functions.php:233
3844
+ msgid "<strong>ERROR</strong>: Forum ID cannot be a negative number."
3845
+ msgstr ""
3846
+
3847
+ #: includes/replies/functions.php:253 includes/topics/functions.php:237
3848
+ msgid "<strong>ERROR</strong>: Forum does not exist."
3849
+ msgstr ""
3850
+
3851
+ #: includes/replies/functions.php:267 includes/replies/functions.php:610
3852
+ msgid ""
3853
+ "<strong>ERROR</strong>: This forum is a category. No replies can be created "
3854
+ "in this forum."
3855
+ msgstr ""
3856
+
3857
+ #: includes/replies/functions.php:274 includes/replies/functions.php:617
3858
+ msgid "<strong>ERROR</strong>: This forum has been closed to new replies."
3859
+ msgstr ""
3860
+
3861
+ #: includes/replies/functions.php:280 includes/replies/functions.php:623
3862
+ msgid ""
3863
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
3864
+ "capability to read or create new replies in it."
3865
+ msgstr ""
3866
+
3867
+ #: includes/replies/functions.php:286 includes/replies/functions.php:629
3868
+ msgid ""
3869
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3870
+ "capability to read or create new replies in it."
3871
+ msgstr ""
3872
+
3873
+ #: includes/replies/functions.php:321 includes/replies/functions.php:655
3874
+ msgid "<strong>ERROR</strong>: Your reply cannot be empty."
3875
+ msgstr ""
3876
+
3877
+ #: includes/replies/functions.php:333
3878
+ msgid ""
3879
+ "<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
3880
+ "you&#8217;ve already said that."
3881
+ msgstr ""
3882
+
3883
+ #: includes/replies/functions.php:339
3884
+ msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
3885
+ msgstr ""
3886
+
3887
+ #: includes/replies/functions.php:364
3888
+ msgid "<strong>ERROR</strong>: Topic is closed."
3889
+ msgstr ""
3890
+
3891
+ #: includes/replies/functions.php:424 includes/replies/functions.php:749
3892
+ msgid "<strong>ERROR</strong>: There was a problem adding the tags to the topic."
3893
+ msgstr ""
3894
+
3895
+ #: includes/replies/functions.php:547
3896
+ msgid "<strong>ERROR</strong>: Reply ID not found."
3897
+ msgstr ""
3898
+
3899
+ #: includes/replies/functions.php:564
3900
+ msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
3901
+ msgstr ""
3902
+
3903
+ #: includes/replies/functions.php:575
3904
+ msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
3905
+ msgstr ""
3906
+
3907
+ #: includes/replies/functions.php:661
3908
+ msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
3909
+ msgstr ""
3910
+
3911
+ #: includes/replies/functions.php:1333
3912
+ msgid "<strong>ERROR</strong>: A reply ID is required"
3913
+ msgstr ""
3914
+
3915
+ #: includes/replies/functions.php:1342
3916
+ msgid "<strong>ERROR</strong>: The reply you want to move was not found."
3917
+ msgstr ""
3918
+
3919
+ #: includes/replies/functions.php:1352
3920
+ msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
3921
+ msgstr ""
3922
+
3923
+ #: includes/replies/functions.php:1363 includes/topics/functions.php:1235
3924
+ #: includes/topics/functions.php:1544
3925
+ msgid "<strong>ERROR</strong>: You do not have permission to edit the source topic."
3926
+ msgstr ""
3927
+
3928
+ #: includes/replies/functions.php:1373
3929
+ msgid "<strong>ERROR</strong>: You need to choose a valid move option."
3930
+ msgstr ""
3931
+
3932
+ #: includes/replies/functions.php:1386 includes/topics/functions.php:1567
3933
+ msgid "<strong>ERROR</strong>: A topic ID is required."
3934
+ msgstr ""
3935
+
3936
+ #: includes/replies/functions.php:1396
3937
+ msgid "<strong>ERROR</strong>: The topic you want to move to was not found."
3938
+ msgstr ""
3939
+
3940
+ #: includes/replies/functions.php:1401 includes/topics/functions.php:1255
3941
+ #: includes/topics/functions.php:1582
3942
+ msgid ""
3943
+ "<strong>ERROR</strong>: You do not have permission to edit the destination "
3944
+ "topic."
3945
+ msgstr ""
3946
+
3947
+ #: includes/replies/functions.php:1455 includes/topics/functions.php:1620
3948
+ msgid ""
3949
+ "<strong>ERROR</strong>: There was a problem converting the reply into the "
3950
+ "topic. Please try again."
3951
+ msgstr ""
3952
+
3953
+ #: includes/replies/functions.php:1460 includes/topics/functions.php:1625
3954
+ msgid ""
3955
+ "<strong>ERROR</strong>: You do not have permission to create new topics. "
3956
+ "The reply could not be converted into a topic."
3957
+ msgstr ""
3958
+
3959
+ #: includes/replies/functions.php:1632
3960
+ msgid "<strong>ERROR:</strong> This reply could not be found or no longer exists."
3961
+ msgstr ""
3962
+
3963
+ #: includes/replies/functions.php:1638 includes/topics/functions.php:2180
3964
+ msgid "<strong>ERROR:</strong> You do not have permission to do that."
3965
+ msgstr ""
3966
+
3967
+ #: includes/replies/functions.php:1714
3968
+ msgid "<strong>ERROR</strong>: There was a problem approving the reply."
3969
+ msgstr ""
3970
+
3971
+ #: includes/replies/functions.php:1714
3972
+ msgid "<strong>ERROR</strong>: There was a problem unapproving the reply."
3973
+ msgstr ""
3974
+
3975
+ #: includes/replies/functions.php:1725
3976
+ msgid "<strong>ERROR</strong>: There was a problem unmarking the reply as spam."
3977
+ msgstr ""
3978
+
3979
+ #: includes/replies/functions.php:1725
3980
+ msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam."
3981
+ msgstr ""
3982
+
3983
+ #: includes/replies/functions.php:1740
3984
+ msgid "<strong>ERROR</strong>: There was a problem trashing the reply."
3985
+ msgstr ""
3986
+
3987
+ #: includes/replies/functions.php:1748
3988
+ msgid "<strong>ERROR</strong>: There was a problem untrashing the reply."
3989
+ msgstr ""
3990
+
3991
+ #: includes/replies/functions.php:1756
3992
+ msgid "<strong>ERROR</strong>: There was a problem deleting the reply."
3993
+ msgstr ""
3994
+
3995
+ #: includes/replies/functions.php:2293
3996
+ msgid "All Posts"
3997
+ msgstr ""
3998
+
3999
+ #: includes/replies/functions.php:2336 includes/topics/functions.php:4091
4000
+ msgid "Replies: %s"
4001
+ msgstr ""
4002
+
4003
+ #: includes/replies/template.php:52
4004
+ msgid "Create New Reply"
4005
+ msgstr ""
4006
+
4007
+ #: includes/replies/template.php:54
4008
+ msgid "Edit Reply"
4009
+ msgstr ""
4010
+
4011
+ #: includes/replies/template.php:55
4012
+ msgid "New Reply"
4013
+ msgstr ""
4014
+
4015
+ #: includes/replies/template.php:56 includes/replies/template.php:57
4016
+ msgid "View Reply"
4017
+ msgstr ""
4018
+
4019
+ #: includes/replies/template.php:58
4020
+ msgid "View Replies"
4021
+ msgstr ""
4022
+
4023
+ #: includes/replies/template.php:59
4024
+ msgid "Search Replies"
4025
+ msgstr ""
4026
+
4027
+ #: includes/replies/template.php:60
4028
+ msgid "No replies found"
4029
+ msgstr ""
4030
+
4031
+ #: includes/replies/template.php:61
4032
+ msgid "No replies found in Trash"
4033
+ msgstr ""
4034
+
4035
+ #: includes/replies/template.php:579
4036
+ #: templates/default/bbpress/form-reply.php:27
4037
+ msgid "Reply To: %s"
4038
+ msgstr ""
4039
+
4040
+ #: includes/replies/template.php:816
4041
+ msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
4042
+ msgstr ""
4043
+
4044
+ #: includes/replies/template.php:818
4045
+ msgid "This reply was modified %1$s by %2$s."
4046
+ msgstr ""
4047
+
4048
+ #: includes/replies/template.php:1145 includes/topics/template.php:1442
4049
+ #: includes/users/template.php:184
4050
+ msgid "Anonymous"
4051
+ msgstr ""
4052
+
4053
+ #: includes/replies/template.php:1259 includes/topics/template.php:1557
4054
+ #: includes/users/template.php:1714
4055
+ msgid "View %s's profile"
4056
+ msgstr ""
4057
+
4058
+ #: includes/replies/template.php:1259 includes/topics/template.php:1557
4059
+ #: includes/users/template.php:1714
4060
+ msgid "Visit %s's website"
4061
+ msgstr ""
4062
+
4063
+ #: includes/replies/template.php:1755
4064
+ msgid "Cancel"
4065
+ msgstr ""
4066
+
4067
+ #: includes/replies/template.php:2101 includes/topics/template.php:2721
4068
+ #: templates/default/bbpress/form-topic-tag.php:97
4069
+ #: templates/default/bbpress/form-topic-tag.php:114
4070
+ msgid "Delete"
4071
+ msgstr ""
4072
+
4073
+ #: includes/replies/template.php:2119 includes/topics/template.php:2739
4074
+ msgid "Are you sure you want to delete that permanently?"
4075
+ msgstr ""
4076
+
4077
+ #: includes/replies/template.php:2236
4078
+ msgid "Move"
4079
+ msgstr ""
4080
+
4081
+ #: includes/replies/template.php:2237
4082
+ msgid "Move this reply"
4083
+ msgstr ""
4084
+
4085
+ #: includes/replies/template.php:2304
4086
+ msgid "Split"
4087
+ msgstr ""
4088
+
4089
+ #: includes/replies/template.php:2305
4090
+ msgid "Split the topic from this reply"
4091
+ msgstr ""
4092
+
4093
+ #: includes/replies/template.php:2473
4094
+ msgid "Viewing %1$s reply thread"
4095
+ msgid_plural "Viewing %1$s reply threads"
4096
+ msgstr[0] ""
4097
+ msgstr[1] ""
4098
+
4099
+ #: includes/replies/template.php:2480
4100
+ msgid "Viewing %1$s reply"
4101
+ msgid_plural "Viewing %1$s replies"
4102
+ msgstr[0] ""
4103
+ msgstr[1] ""
4104
+
4105
+ #: includes/replies/template.php:2484
4106
+ msgid "Viewing %2$s replies (of %4$s total)"
4107
+ msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
4108
+ msgstr[0] ""
4109
+ msgstr[1] ""
4110
+
4111
+ #: includes/replies/template.php:2492
4112
+ msgid "Viewing %1$s post"
4113
+ msgid_plural "Viewing %1$s posts"
4114
+ msgstr[0] ""
4115
+ msgstr[1] ""
4116
+
4117
+ #: includes/replies/template.php:2496
4118
+ msgid "Viewing %2$s post (of %4$s total)"
4119
+ msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
4120
+ msgstr[0] ""
4121
+ msgstr[1] ""
4122
+
4123
+ #: includes/search/template.php:236
4124
+ msgid "Search Results for '%s'"
4125
+ msgstr ""
4126
+
4127
+ #: includes/search/template.php:412
4128
+ msgid "Viewing %1$s result"
4129
+ msgid_plural "Viewing %1$s results"
4130
+ msgstr[0] ""
4131
+ msgstr[1] ""
4132
+
4133
+ #: includes/search/template.php:416
4134
+ msgid "Viewing %2$s results (of %4$s total)"
4135
+ msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
4136
+ msgstr[0] ""
4137
+ msgstr[1] ""
4138
+
4139
+ #: includes/topics/functions.php:165
4140
+ msgid "<strong>ERROR</strong>: You do not have permission to create new topics."
4141
+ msgstr ""
4142
+
4143
+ #: includes/topics/functions.php:191 includes/topics/functions.php:589
4144
+ msgid "<strong>ERROR</strong>: Your topic needs a title."
4145
+ msgstr ""
4146
+
4147
+ #: includes/topics/functions.php:205 includes/topics/functions.php:603
4148
+ msgid "<strong>ERROR</strong>: Your topic cannot be empty."
4149
+ msgstr ""
4150
+
4151
+ #: includes/topics/functions.php:251
4152
+ msgid ""
4153
+ "<strong>ERROR</strong>: This forum is a category. No topics can be created "
4154
+ "in this forum."
4155
+ msgstr ""
4156
+
4157
+ #: includes/topics/functions.php:258 includes/topics/functions.php:560
4158
+ msgid "<strong>ERROR</strong>: This forum has been closed to new topics."
4159
+ msgstr ""
4160
+
4161
+ #: includes/topics/functions.php:264 includes/topics/functions.php:566
4162
+ msgid ""
4163
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
4164
+ "capability to read or create new topics in it."
4165
+ msgstr ""
4166
+
4167
+ #: includes/topics/functions.php:270 includes/topics/functions.php:572
4168
+ msgid ""
4169
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
4170
+ "capability to read or create new topics in it."
4171
+ msgstr ""
4172
+
4173
+ #: includes/topics/functions.php:285
4174
+ msgid ""
4175
+ "<strong>ERROR</strong>: Duplicate topic detected; it looks as though "
4176
+ "you&#8217;ve already said that."
4177
+ msgstr ""
4178
+
4179
+ #: includes/topics/functions.php:291
4180
+ msgid "<strong>ERROR</strong>: Your topic cannot be created at this time."
4181
+ msgstr ""
4182
+
4183
+ #: includes/topics/functions.php:485 includes/topics/functions.php:1217
4184
+ msgid "<strong>ERROR</strong>: Topic ID not found."
4185
+ msgstr ""
4186
+
4187
+ #: includes/topics/functions.php:496
4188
+ msgid "<strong>ERROR</strong>: The topic you want to edit was not found."
4189
+ msgstr ""
4190
+
4191
+ #: includes/topics/functions.php:507
4192
+ msgid "<strong>ERROR</strong>: You do not have permission to edit that topic."
4193
+ msgstr ""
4194
+
4195
+ #: includes/topics/functions.php:553
4196
+ msgid ""
4197
+ "<strong>ERROR</strong>: This forum is a category. No topics can be created "
4198
+ "in it."
4199
+ msgstr ""
4200
+
4201
+ #: includes/topics/functions.php:609
4202
+ msgid "<strong>ERROR</strong>: Your topic cannot be edited at this time."
4203
+ msgstr ""
4204
+
4205
+ #: includes/topics/functions.php:1229
4206
+ msgid "<strong>ERROR</strong>: The topic you want to merge was not found."
4207
+ msgstr ""
4208
+
4209
+ #: includes/topics/functions.php:1243
4210
+ msgid "<strong>ERROR</strong>: Destination topic ID not found."
4211
+ msgstr ""
4212
+
4213
+ #: includes/topics/functions.php:1250
4214
+ msgid "<strong>ERROR</strong>: The topic you want to merge to was not found."
4215
+ msgstr ""
4216
+
4217
+ #: includes/topics/functions.php:1514
4218
+ msgid "<strong>ERROR</strong>: A reply ID is required."
4219
+ msgstr ""
4220
+
4221
+ #: includes/topics/functions.php:1523
4222
+ msgid "<strong>ERROR</strong>: The reply you want to split from was not found."
4223
+ msgstr ""
4224
+
4225
+ #: includes/topics/functions.php:1533
4226
+ msgid "<strong>ERROR</strong>: The topic you want to split was not found."
4227
+ msgstr ""
4228
+
4229
+ #: includes/topics/functions.php:1554
4230
+ msgid "<strong>ERROR</strong>: You need to choose a valid split option."
4231
+ msgstr ""
4232
+
4233
+ #: includes/topics/functions.php:1577
4234
+ msgid "<strong>ERROR</strong>: The topic you want to split to was not found."
4235
+ msgstr ""
4236
+
4237
+ #: includes/topics/functions.php:1882
4238
+ msgid ""
4239
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4240
+ "getting the tag: %s"
4241
+ msgstr ""
4242
+
4243
+ #: includes/topics/functions.php:1900 includes/topics/functions.php:1940
4244
+ msgid "<strong>ERROR</strong>: You do not have permission to edit the topic tags."
4245
+ msgstr ""
4246
+
4247
+ #: includes/topics/functions.php:1906 includes/topics/functions.php:1946
4248
+ msgid "<strong>ERROR</strong>: You need to enter a tag name."
4249
+ msgstr ""
4250
+
4251
+ #: includes/topics/functions.php:1917
4252
+ msgid ""
4253
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4254
+ "updating the tag: %s"
4255
+ msgstr ""
4256
+
4257
+ #: includes/topics/functions.php:1957 includes/topics/functions.php:1975
4258
+ msgid ""
4259
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4260
+ "merging the tags: %s"
4261
+ msgstr ""
4262
+
4263
+ #: includes/topics/functions.php:1966
4264
+ msgid "<strong>ERROR</strong>: The tags which are being merged can not be the same."
4265
+ msgstr ""
4266
+
4267
+ #: includes/topics/functions.php:1998
4268
+ msgid "<strong>ERROR</strong>: You do not have permission to delete the topic tags."
4269
+ msgstr ""
4270
+
4271
+ #: includes/topics/functions.php:2007
4272
+ msgid ""
4273
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4274
+ "deleting the tag: %s"
4275
+ msgstr ""
4276
+
4277
+ #: includes/topics/functions.php:2174
4278
+ msgid "<strong>ERROR:</strong> This topic could not be found or no longer exists."
4279
+ msgstr ""
4280
+
4281
+ #: includes/topics/functions.php:2264
4282
+ msgid "<strong>ERROR</strong>: There was a problem approving the topic."
4283
+ msgstr ""
4284
+
4285
+ #: includes/topics/functions.php:2265
4286
+ msgid "<strong>ERROR</strong>: There was a problem unapproving the topic."
4287
+ msgstr ""
4288
+
4289
+ #: includes/topics/functions.php:2282
4290
+ msgid "<strong>ERROR</strong>: There was a problem closing the topic."
4291
+ msgstr ""
4292
+
4293
+ #: includes/topics/functions.php:2283
4294
+ msgid "<strong>ERROR</strong>: There was a problem opening the topic."
4295
+ msgstr ""
4296
+
4297
+ #: includes/topics/functions.php:2301
4298
+ msgid "<strong>ERROR</strong>: There was a problem unsticking the topic."
4299
+ msgstr ""
4300
+
4301
+ #: includes/topics/functions.php:2302
4302
+ msgid "<strong>ERROR</strong>: There was a problem sticking the topic."
4303
+ msgstr ""
4304
+
4305
+ #: includes/topics/functions.php:2320
4306
+ msgid "<strong>ERROR</strong>: There was a problem unmarking the topic as spam."
4307
+ msgstr ""
4308
+
4309
+ #: includes/topics/functions.php:2321
4310
+ msgid "<strong>ERROR</strong>: There was a problem marking the topic as spam."
4311
+ msgstr ""
4312
+
4313
+ #: includes/topics/functions.php:2334
4314
+ msgid "<strong>ERROR</strong>: There was a problem trashing the topic."
4315
+ msgstr ""
4316
+
4317
+ #: includes/topics/functions.php:2342
4318
+ msgid "<strong>ERROR</strong>: There was a problem untrashing the topic."
4319
+ msgstr ""
4320
+
4321
+ #: includes/topics/functions.php:2350
4322
+ msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
4323
+ msgstr ""
4324
+
4325
+ #: includes/topics/template.php:52 templates/default/bbpress/form-topic.php:43
4326
+ msgid "Create New Topic"
4327
+ msgstr ""
4328
+
4329
+ #: includes/topics/template.php:54
4330
+ msgid "Edit Topic"
4331
+ msgstr ""
4332
+
4333
+ #: includes/topics/template.php:55
4334
+ msgid "New Topic"
4335
+ msgstr ""
4336
+
4337
+ #: includes/topics/template.php:56 includes/topics/template.php:57
4338
+ msgid "View Topic"
4339
+ msgstr ""
4340
+
4341
+ #: includes/topics/template.php:58
4342
+ msgid "View Topics"
4343
+ msgstr ""
4344
+
4345
+ #: includes/topics/template.php:59
4346
+ msgid "Search Topics"
4347
+ msgstr ""
4348
+
4349
+ #: includes/topics/template.php:60
4350
+ msgid "No topics found"
4351
+ msgstr ""
4352
+
4353
+ #: includes/topics/template.php:61
4354
+ msgid "No topics found in Trash"
4355
+ msgstr ""
4356
+
4357
+ #: includes/topics/template.php:1009
4358
+ msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
4359
+ msgstr ""
4360
+
4361
+ #: includes/topics/template.php:1011
4362
+ msgid "This topic was modified %1$s by %2$s."
4363
+ msgstr ""
4364
+
4365
+ #: includes/topics/template.php:1978 includes/users/template.php:899
4366
+ msgid "Favorite"
4367
+ msgstr ""
4368
+
4369
+ #: includes/topics/template.php:1979 includes/users/template.php:900
4370
+ msgid "Unfavorite"
4371
+ msgstr ""
4372
+
4373
+ #: includes/topics/template.php:2392
4374
+ msgid "Tagged:"
4375
+ msgstr ""
4376
+
4377
+ #: includes/topics/template.php:2984
4378
+ #: templates/default/bbpress/form-topic-tag.php:66
4379
+ #: templates/default/bbpress/form-topic-tag.php:82
4380
+ msgid "Merge"
4381
+ msgstr ""
4382
+
4383
+ #: includes/topics/template.php:3149
4384
+ msgid "Viewing %1$s topic"
4385
+ msgid_plural "Viewing %1$s topics"
4386
+ msgstr[0] ""
4387
+ msgstr[1] ""
4388
+
4389
+ #: includes/topics/template.php:3153
4390
+ msgid "Viewing topic %2$s (of %4$s total)"
4391
+ msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
4392
+ msgstr[0] ""
4393
+ msgstr[1] ""
4394
+
4395
+ #: includes/topics/template.php:3215
4396
+ msgid "This topic is marked as spam."
4397
+ msgstr ""
4398
+
4399
+ #: includes/topics/template.php:3220
4400
+ msgid "This topic is in the trash."
4401
+ msgstr ""
4402
+
4403
+ #: includes/topics/template.php:3490
4404
+ msgid "%s voice"
4405
+ msgid_plural "%s voices"
4406
+ msgstr[0] ""
4407
+ msgstr[1] ""
4408
+
4409
+ #: includes/topics/template.php:3496
4410
+ msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
4411
+ msgstr ""
4412
+
4413
+ #: includes/topics/template.php:3500
4414
+ msgid "This topic contains %1$s and has %2$s."
4415
+ msgstr ""
4416
+
4417
+ #: includes/topics/template.php:3504
4418
+ msgid "This topic has no replies."
4419
+ msgstr ""
4420
+
4421
+ #: includes/topics/template.php:3550
4422
+ #: templates/default/bbpress/content-statistics.php:37
4423
+ msgid "Topic Tags"
4424
+ msgstr ""
4425
+
4426
+ #: includes/topics/template.php:3552
4427
+ msgid "Search Tags"
4428
+ msgstr ""
4429
+
4430
+ #: includes/topics/template.php:3553
4431
+ msgid "Popular Tags"
4432
+ msgstr ""
4433
+
4434
+ #: includes/topics/template.php:3554
4435
+ msgid "All Tags"
4436
+ msgstr ""
4437
+
4438
+ #: includes/topics/template.php:3555
4439
+ msgid "Edit Tag"
4440
+ msgstr ""
4441
+
4442
+ #: includes/topics/template.php:3556
4443
+ msgid "Update Tag"
4444
+ msgstr ""
4445
+
4446
+ #: includes/topics/template.php:3557
4447
+ msgid "Add New Tag"
4448
+ msgstr ""
4449
+
4450
+ #: includes/topics/template.php:3558
4451
+ msgid "New Tag Name"
4452
+ msgstr ""
4453
+
4454
+ #: includes/topics/template.php:3559
4455
+ msgid "View Topic Tag"
4456
+ msgstr ""
4457
+
4458
+ #: includes/topics/template.php:3560
4459
+ msgid "View Topic Tags"
4460
+ msgstr ""
4461
+
4462
+ #: includes/topics/template.php:3561
4463
+ msgid "Separate topic tags with commas"
4464
+ msgstr ""
4465
+
4466
+ #: includes/users/functions.php:504
4467
+ msgid ""
4468
+ "<strong>ERROR</strong>: No topic was found. Which topic are you "
4469
+ "marking/unmarking as favorite?"
4470
+ msgstr ""
4471
+
4472
+ #: includes/users/functions.php:512
4473
+ msgid ""
4474
+ "<strong>ERROR</strong>: You do not have permission to edit favorites for "
4475
+ "that user!."
4476
+ msgstr ""
4477
+
4478
+ #: includes/users/functions.php:554
4479
+ msgid ""
4480
+ "<strong>ERROR</strong>: There was a problem removing that topic from "
4481
+ "favorites."
4482
+ msgstr ""
4483
+
4484
+ #: includes/users/functions.php:556
4485
+ msgid "<strong>ERROR</strong>: There was a problem favoriting that topic."
4486
+ msgstr ""
4487
+
4488
+ #: includes/users/functions.php:1161
4489
+ msgid ""
4490
+ "<strong>ERROR</strong>: No forum was found. Which forum are you "
4491
+ "subscribing/unsubscribing to?"
4492
+ msgstr ""
4493
+
4494
+ #: includes/users/functions.php:1169 includes/users/functions.php:1274
4495
+ msgid ""
4496
+ "<strong>ERROR</strong>: You do not have permission to edit favorites of "
4497
+ "that user."
4498
+ msgstr ""
4499
+
4500
+ #: includes/users/functions.php:1211
4501
+ msgid "<strong>ERROR</strong>: There was a problem unsubscribing from that forum."
4502
+ msgstr ""
4503
+
4504
+ #: includes/users/functions.php:1213
4505
+ msgid "<strong>ERROR</strong>: There was a problem subscribing to that forum."
4506
+ msgstr ""
4507
+
4508
+ #: includes/users/functions.php:1266
4509
+ msgid ""
4510
+ "<strong>ERROR</strong>: No topic was found. Which topic are you "
4511
+ "subscribing/unsubscribing to?"
4512
+ msgstr ""
4513
+
4514
+ #: includes/users/functions.php:1316
4515
+ msgid "<strong>ERROR</strong>: There was a problem unsubscribing from that topic."
4516
+ msgstr ""
4517
+
4518
+ #: includes/users/functions.php:1318
4519
+ msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic."
4520
+ msgstr ""
4521
+
4522
+ #: includes/users/functions.php:1375 includes/users/functions.php:1387
4523
+ msgid "<strong>ERROR</strong>: That is not a valid email address."
4524
+ msgstr ""
4525
+
4526
+ #: includes/users/functions.php:1393 includes/users/functions.php:1522
4527
+ msgid "<strong>ERROR</strong>: That email address is already in use."
4528
+ msgstr ""
4529
+
4530
+ #: includes/users/functions.php:1592
4531
+ msgid "<strong>ERROR</strong>: An error occurred while updating your email address."
4532
+ msgstr ""
4533
+
4534
+ #: includes/users/functions.php:1604
4535
+ msgid ""
4536
+ "%1$s\n"
4537
+ "\n"
4538
+ "Someone requested a change to the email address on your account.\n"
4539
+ "\n"
4540
+ "Please click the following link to confirm this change:\n"
4541
+ "%2$s\n"
4542
+ "\n"
4543
+ "If you did not request this, you can safely ignore and delete this "
4544
+ "notification.\n"
4545
+ "\n"
4546
+ "This email was sent to: %3$s\n"
4547
+ "\n"
4548
+ "Regards,\n"
4549
+ "The %4$s Team\n"
4550
+ "%5$s"
4551
+ msgstr ""
4552
+
4553
+ #: includes/users/functions.php:1639
4554
+ msgid "[%s] New Email Address"
4555
+ msgstr ""
4556
+
4557
+ #: includes/users/template.php:509
4558
+ msgid "Guest"
4559
+ msgstr ""
4560
+
4561
+ #: includes/users/template.php:513
4562
+ msgid "Inactive"
4563
+ msgstr ""
4564
+
4565
+ #: includes/users/template.php:523
4566
+ msgid "Member"
4567
+ msgstr ""
4568
+
4569
+ #: includes/users/template.php:567
4570
+ msgid "Admin"
4571
+ msgstr ""
4572
+
4573
+ #: includes/users/template.php:1173
4574
+ msgid "User updated."
4575
+ msgstr ""
4576
+
4577
+ #: includes/users/template.php:1223
4578
+ msgid "There is a pending email address change to %1$s. %2$s"
4579
+ msgstr ""
4580
+
4581
+ #: includes/users/template.php:1250
4582
+ msgid "You have super admin privileges."
4583
+ msgstr ""
4584
+
4585
+ #: includes/users/template.php:1250
4586
+ msgid "This user has super admin privileges."
4587
+ msgstr ""
4588
+
4589
+ #: includes/users/template.php:1324
4590
+ msgid "&mdash; No role for this site &mdash;"
4591
+ msgstr ""
4592
+
4593
+ #: includes/users/template.php:1516
4594
+ msgid "You are now logged out."
4595
+ msgstr ""
4596
+
4597
+ #: includes/users/template.php:1520
4598
+ msgid "New user registration is currently not allowed."
4599
+ msgstr ""
4600
+
4601
+ #: includes/users/template.php:1529
4602
+ msgid "Check your e-mail for the confirmation link."
4603
+ msgstr ""
4604
+
4605
+ #: includes/users/template.php:1534
4606
+ msgid "Check your e-mail for your new password."
4607
+ msgstr ""
4608
+
4609
+ #: includes/users/template.php:1539
4610
+ msgid "Registration complete. Please check your e-mail."
4611
+ msgstr ""
4612
+
4613
+ #: includes/users/template.php:2151
4614
+ msgid "Moderators:"
4615
+ msgstr ""
4616
+
4617
+ #: templates/default/bbpress/content-statistics.php:17
4618
+ msgid "Registered Users"
4619
+ msgstr ""
4620
+
4621
+ #: templates/default/bbpress/content-statistics.php:44
4622
+ msgid "Empty Topic Tags"
4623
+ msgstr ""
4624
+
4625
+ #: templates/default/bbpress/content-statistics.php:53
4626
+ msgid "Hidden Topics"
4627
+ msgstr ""
4628
+
4629
+ #: templates/default/bbpress/content-statistics.php:64
4630
+ msgid "Hidden Replies"
4631
+ msgstr ""
4632
+
4633
+ #: templates/default/bbpress/feedback-logged-in.php:14
4634
+ msgid "You are already logged in."
4635
+ msgstr ""
4636
+
4637
+ #: templates/default/bbpress/feedback-no-access.php:13
4638
+ msgid "Private"
4639
+ msgstr ""
4640
+
4641
+ #: templates/default/bbpress/feedback-no-access.php:17
4642
+ msgid "You do not have permission to view this forum."
4643
+ msgstr ""
4644
+
4645
+ #: templates/default/bbpress/feedback-no-forums.php:14
4646
+ msgid "Oh, bother! No forums were found here."
4647
+ msgstr ""
4648
+
4649
+ #: templates/default/bbpress/feedback-no-replies.php:14
4650
+ msgid "Oh, bother! No replies were found here."
4651
+ msgstr ""
4652
+
4653
+ #: templates/default/bbpress/feedback-no-search.php:14
4654
+ msgid "Oh, bother! No search results were found here."
4655
+ msgstr ""
4656
+
4657
+ #: templates/default/bbpress/feedback-no-topics.php:14
4658
+ msgid "Oh, bother! No topics were found here."
4659
+ msgstr ""
4660
+
4661
+ #: templates/default/bbpress/form-anonymous.php:15
4662
+ msgid "Your information:"
4663
+ msgstr ""
4664
+
4665
+ #: templates/default/bbpress/form-anonymous.php:20
4666
+ msgid "Name (required):"
4667
+ msgstr ""
4668
+
4669
+ #: templates/default/bbpress/form-anonymous.php:25
4670
+ msgid "Mail (will not be published) (required):"
4671
+ msgstr ""
4672
+
4673
+ #: templates/default/bbpress/form-forum.php:33
4674
+ #: templates/default/bbpress/form-topic.php:39
4675
+ msgid "Now Editing &ldquo;%s&rdquo;"
4676
+ msgstr ""
4677
+
4678
+ #: templates/default/bbpress/form-forum.php:36
4679
+ msgid "Create New Forum in &ldquo;%s&rdquo;"
4680
+ msgstr ""
4681
+
4682
+ #: templates/default/bbpress/form-forum.php:49
4683
+ msgid ""
4684
+ "This forum is closed to new content, however your account still allows you "
4685
+ "to do so."
4686
+ msgstr ""
4687
+
4688
+ #: templates/default/bbpress/form-forum.php:59
4689
+ #: templates/default/bbpress/form-reply.php:45
4690
+ #: templates/default/bbpress/form-topic.php:65
4691
+ msgid "Your account has the ability to post unrestricted HTML content."
4692
+ msgstr ""
4693
+
4694
+ #: templates/default/bbpress/form-forum.php:72
4695
+ msgid "Forum Name (Maximum Length: %d):"
4696
+ msgstr ""
4697
+
4698
+ #: templates/default/bbpress/form-forum.php:87
4699
+ #: templates/default/bbpress/form-reply.php:66
4700
+ msgid ""
4701
+ "You may use these <abbr title=\"HyperText Markup Language\">HTML</abbr> "
4702
+ "tags and attributes:"
4703
+ msgstr ""
4704
+
4705
+ #: templates/default/bbpress/form-forum.php:98
4706
+ msgid "Forum Moderators:"
4707
+ msgstr ""
4708
+
4709
+ #: templates/default/bbpress/form-forum.php:109
4710
+ msgid "Forum Type:"
4711
+ msgstr ""
4712
+
4713
+ #: templates/default/bbpress/form-forum.php:156
4714
+ #: templates/default/bbpress/form-reply-move.php:78
4715
+ #: templates/default/bbpress/form-reply.php:163
4716
+ #: templates/default/bbpress/form-topic-merge.php:100
4717
+ #: templates/default/bbpress/form-topic-split.php:104
4718
+ #: templates/default/bbpress/form-topic.php:208
4719
+ msgid "Submit"
4720
+ msgstr ""
4721
+
4722
+ #: templates/default/bbpress/form-forum.php:180
4723
+ msgid "The forum &#8216;%s&#8217; is closed to new content."
4724
+ msgstr ""
4725
+
4726
+ #: templates/default/bbpress/form-forum.php:191
4727
+ msgid "You cannot create new forums."
4728
+ msgstr ""
4729
+
4730
+ #: templates/default/bbpress/form-forum.php:192
4731
+ msgid "You must be logged in to create new forums."
4732
+ msgstr ""
4733
+
4734
+ #: templates/default/bbpress/form-protected.php:14
4735
+ msgid "Protected"
4736
+ msgstr ""
4737
+
4738
+ #: templates/default/bbpress/form-reply-move.php:24
4739
+ msgid "Move reply \"%s\""
4740
+ msgstr ""
4741
+
4742
+ #: templates/default/bbpress/form-reply-move.php:30
4743
+ msgid ""
4744
+ "You can either make this reply a new topic with a new title, or merge it "
4745
+ "into an existing topic."
4746
+ msgstr ""
4747
+
4748
+ #: templates/default/bbpress/form-reply-move.php:36
4749
+ msgid ""
4750
+ "If you choose an existing topic, replies will be ordered by the time and "
4751
+ "date they were created."
4752
+ msgstr ""
4753
+
4754
+ #: templates/default/bbpress/form-reply-move.php:41
4755
+ msgid "Move Method"
4756
+ msgstr ""
4757
+
4758
+ #: templates/default/bbpress/form-reply-move.php:45
4759
+ #: templates/default/bbpress/form-topic-split.php:45
4760
+ msgid "New topic in %s titled:"
4761
+ msgstr ""
4762
+
4763
+ #: templates/default/bbpress/form-reply-move.php:46
4764
+ msgid "Moved: %s"
4765
+ msgstr ""
4766
+
4767
+ #: templates/default/bbpress/form-reply-move.php:53
4768
+ #: templates/default/bbpress/form-topic-split.php:53
4769
+ msgid "Use an existing topic in this forum:"
4770
+ msgstr ""
4771
+
4772
+ #: templates/default/bbpress/form-reply-move.php:92
4773
+ msgid "You do not have permission to edit this reply."
4774
+ msgstr ""
4775
+
4776
+ #: templates/default/bbpress/form-reply-move.php:93
4777
+ msgid "You cannot edit this reply."
4778
+ msgstr ""
4779
+
4780
+ #: templates/default/bbpress/form-reply.php:27
4781
+ msgid "Reply #%1$s in %2$s"
4782
+ msgstr ""
4783
+
4784
+ #: templates/default/bbpress/form-reply.php:35
4785
+ msgid ""
4786
+ "This topic is marked as closed to new replies, however your posting "
4787
+ "capabilities still allow you to do so."
4788
+ msgstr ""
4789
+
4790
+ #: templates/default/bbpress/form-reply.php:77
4791
+ msgid "Tags:"
4792
+ msgstr ""
4793
+
4794
+ #: templates/default/bbpress/form-reply.php:95
4795
+ #: templates/default/bbpress/form-topic.php:169
4796
+ msgid "Notify the author of follow-up replies via email"
4797
+ msgstr ""
4798
+
4799
+ #: templates/default/bbpress/form-reply.php:99
4800
+ #: templates/default/bbpress/form-topic.php:173
4801
+ msgid "Notify me of follow-up replies via email"
4802
+ msgstr ""
4803
+
4804
+ #: templates/default/bbpress/form-reply.php:125
4805
+ msgid "Reply Status:"
4806
+ msgstr ""
4807
+
4808
+ #: templates/default/bbpress/form-reply.php:140
4809
+ #: templates/default/bbpress/form-topic.php:189
4810
+ msgid "Keep a log of this edit:"
4811
+ msgstr ""
4812
+
4813
+ #: templates/default/bbpress/form-reply.php:144
4814
+ #: templates/default/bbpress/form-topic.php:193
4815
+ msgid "Optional reason for editing:"
4816
+ msgstr ""
4817
+
4818
+ #: templates/default/bbpress/form-reply.php:187
4819
+ msgid "The topic &#8216;%s&#8217; is closed to new replies."
4820
+ msgstr ""
4821
+
4822
+ #: templates/default/bbpress/form-reply.php:197
4823
+ #: templates/default/bbpress/form-topic.php:232
4824
+ msgid "The forum &#8216;%s&#8217; is closed to new topics and replies."
4825
+ msgstr ""
4826
+
4827
+ #: templates/default/bbpress/form-reply.php:208
4828
+ msgid "You cannot reply to this topic."
4829
+ msgstr ""
4830
+
4831
+ #: templates/default/bbpress/form-reply.php:209
4832
+ msgid "You must be logged in to reply to this topic."
4833
+ msgstr ""
4834
+
4835
+ #: templates/default/bbpress/form-search.php:14
4836
+ msgid "Search for:"
4837
+ msgstr ""
4838
+
4839
+ #: templates/default/bbpress/form-topic-merge.php:24
4840
+ msgid "Merge topic \"%s\""
4841
+ msgstr ""
4842
+
4843
+ #: templates/default/bbpress/form-topic-merge.php:30
4844
+ msgid ""
4845
+ "Select the topic to merge this one into. The destination topic will remain "
4846
+ "the lead topic, and this one will change into a reply."
4847
+ msgstr ""
4848
+
4849
+ #: templates/default/bbpress/form-topic-merge.php:31
4850
+ msgid ""
4851
+ "To keep this topic as the lead, go to the other topic and use the merge "
4852
+ "tool from there instead."
4853
+ msgstr ""
4854
+
4855
+ #: templates/default/bbpress/form-topic-merge.php:37
4856
+ msgid ""
4857
+ "Replies to both topics are merged chronologically, ordered by the time and "
4858
+ "date they were published. Topics may be updated to a 1 second difference to "
4859
+ "maintain chronological order based on the merge direction."
4860
+ msgstr ""
4861
+
4862
+ #: templates/default/bbpress/form-topic-merge.php:42
4863
+ msgid "Destination"
4864
+ msgstr ""
4865
+
4866
+ #: templates/default/bbpress/form-topic-merge.php:46
4867
+ msgid "Merge with this topic:"
4868
+ msgstr ""
4869
+
4870
+ #: templates/default/bbpress/form-topic-merge.php:61
4871
+ msgid "There are no other topics in this forum to merge with."
4872
+ msgstr ""
4873
+
4874
+ #: templates/default/bbpress/form-topic-merge.php:69
4875
+ #: templates/default/bbpress/form-topic-split.php:73
4876
+ msgid "Topic Extras"
4877
+ msgstr ""
4878
+
4879
+ #: templates/default/bbpress/form-topic-merge.php:76
4880
+ msgid "Merge topic subscribers"
4881
+ msgstr ""
4882
+
4883
+ #: templates/default/bbpress/form-topic-merge.php:81
4884
+ msgid "Merge topic favoriters"
4885
+ msgstr ""
4886
+
4887
+ #: templates/default/bbpress/form-topic-merge.php:86
4888
+ msgid "Merge topic tags"
4889
+ msgstr ""
4890
+
4891
+ #: templates/default/bbpress/form-topic-merge.php:114
4892
+ #: templates/default/bbpress/form-topic-split.php:118
4893
+ msgid "You do not have permission to edit this topic."
4894
+ msgstr ""
4895
+
4896
+ #: templates/default/bbpress/form-topic-merge.php:115
4897
+ #: templates/default/bbpress/form-topic-split.php:119
4898
+ msgid "You cannot edit this topic."
4899
+ msgstr ""
4900
+
4901
+ #: templates/default/bbpress/form-topic-split.php:24
4902
+ msgid "Split topic \"%s\""
4903
+ msgstr ""
4904
+
4905
+ #: templates/default/bbpress/form-topic-split.php:30
4906
+ msgid ""
4907
+ "When you split a topic, you are slicing it in half starting with the reply "
4908
+ "you just selected. Choose to use that reply as a new topic with a new "
4909
+ "title, or merge those replies into an existing topic."
4910
+ msgstr ""
4911
+
4912
+ #: templates/default/bbpress/form-topic-split.php:36
4913
+ msgid ""
4914
+ "If you use the existing topic option, replies within both topics will be "
4915
+ "merged chronologically. The order of the merged replies is based on the "
4916
+ "time and date they were posted."
4917
+ msgstr ""
4918
+
4919
+ #: templates/default/bbpress/form-topic-split.php:41
4920
+ msgid "Split Method"
4921
+ msgstr ""
4922
+
4923
+ #: templates/default/bbpress/form-topic-split.php:46
4924
+ msgid "Split: %s"
4925
+ msgstr ""
4926
+
4927
+ #: templates/default/bbpress/form-topic-split.php:80
4928
+ msgid "Copy subscribers to the new topic"
4929
+ msgstr ""
4930
+
4931
+ #: templates/default/bbpress/form-topic-split.php:85
4932
+ msgid "Copy favoriters to the new topic"
4933
+ msgstr ""
4934
+
4935
+ #: templates/default/bbpress/form-topic-split.php:90
4936
+ msgid "Copy topic tags to the new topic"
4937
+ msgstr ""
4938
+
4939
+ #: templates/default/bbpress/form-topic-tag.php:16
4940
+ msgid "Manage Tag: \"%s\""
4941
+ msgstr ""
4942
+
4943
+ #: templates/default/bbpress/form-topic-tag.php:20
4944
+ msgid "Rename"
4945
+ msgstr ""
4946
+
4947
+ #: templates/default/bbpress/form-topic-tag.php:24
4948
+ msgid "Leave the slug empty to have one automatically generated."
4949
+ msgstr ""
4950
+
4951
+ #: templates/default/bbpress/form-topic-tag.php:30
4952
+ msgid ""
4953
+ "Changing the slug affects its permalink. Any links to the old slug will "
4954
+ "stop working."
4955
+ msgstr ""
4956
+
4957
+ #: templates/default/bbpress/form-topic-tag.php:42
4958
+ msgid "Slug:"
4959
+ msgstr ""
4960
+
4961
+ #: templates/default/bbpress/form-topic-tag.php:47
4962
+ msgid "Description:"
4963
+ msgstr ""
4964
+
4965
+ #: templates/default/bbpress/form-topic-tag.php:52
4966
+ msgid "Update"
4967
+ msgstr ""
4968
+
4969
+ #: templates/default/bbpress/form-topic-tag.php:70
4970
+ msgid "Merging tags together cannot be undone."
4971
+ msgstr ""
4972
+
4973
+ #: templates/default/bbpress/form-topic-tag.php:77
4974
+ msgid "Existing tag:"
4975
+ msgstr ""
4976
+
4977
+ #: templates/default/bbpress/form-topic-tag.php:82
4978
+ msgid "Are you sure you want to merge the \"%s\" tag into the tag you specified?"
4979
+ msgstr ""
4980
+
4981
+ #: templates/default/bbpress/form-topic-tag.php:101
4982
+ msgid "This does not delete your topics. Only the tag itself is deleted."
4983
+ msgstr ""
4984
+
4985
+ #: templates/default/bbpress/form-topic-tag.php:106
4986
+ msgid "Deleting a tag cannot be undone."
4987
+ msgstr ""
4988
+
4989
+ #: templates/default/bbpress/form-topic-tag.php:107
4990
+ msgid "Any links to this tag will no longer function."
4991
+ msgstr ""
4992
+
4993
+ #: templates/default/bbpress/form-topic-tag.php:114
4994
+ msgid ""
4995
+ "Are you sure you want to delete the \"%s\" tag? This is permanent and "
4996
+ "cannot be undone."
4997
+ msgstr ""
4998
+
4999
+ #: templates/default/bbpress/form-topic.php:42
5000
+ msgid "Create New Topic in &ldquo;%s&rdquo;"
5001
+ msgstr ""
5002
+
5003
+ #: templates/default/bbpress/form-topic.php:55
5004
+ msgid ""
5005
+ "This forum is marked as closed to new topics, however your posting "
5006
+ "capabilities still allow you to do so."
5007
+ msgstr ""
5008
+
5009
+ #: templates/default/bbpress/form-topic.php:80
5010
+ msgid "Topic Title (Maximum Length: %d):"
5011
+ msgstr ""
5012
+
5013
+ #: templates/default/bbpress/form-topic.php:95
5014
+ msgid "You may use these %s tags and attributes:"
5015
+ msgstr ""
5016
+
5017
+ #: templates/default/bbpress/form-topic.php:106
5018
+ msgid "Topic Tags:"
5019
+ msgstr ""
5020
+
5021
+ #: templates/default/bbpress/form-topic.php:138
5022
+ msgid "Topic Type:"
5023
+ msgstr ""
5024
+
5025
+ #: templates/default/bbpress/form-topic.php:150
5026
+ msgid "Topic Status:"
5027
+ msgstr ""
5028
+
5029
+ #: templates/default/bbpress/form-topic.php:243
5030
+ msgid "You cannot create new topics."
5031
+ msgstr ""
5032
+
5033
+ #: templates/default/bbpress/form-topic.php:244
5034
+ msgid "You must be logged in to create new topics."
5035
+ msgstr ""
5036
+
5037
+ #: templates/default/bbpress/form-user-edit.php:24
5038
+ msgid "First Name"
5039
+ msgstr ""
5040
+
5041
+ #: templates/default/bbpress/form-user-edit.php:29
5042
+ msgid "Last Name"
5043
+ msgstr ""
5044
+
5045
+ #: templates/default/bbpress/form-user-edit.php:34
5046
+ msgid "Nickname"
5047
+ msgstr ""
5048
+
5049
+ #: templates/default/bbpress/form-user-edit.php:39
5050
+ msgid "Display Name"
5051
+ msgstr ""
5052
+
5053
+ #: templates/default/bbpress/form-user-edit.php:49
5054
+ #: templates/default/bbpress/form-user-edit.php:52
5055
+ msgid "Contact Info"
5056
+ msgstr ""
5057
+
5058
+ #: templates/default/bbpress/form-user-edit.php:75
5059
+ #: templates/default/bbpress/form-user-edit.php:81
5060
+ msgid "About Yourself"
5061
+ msgstr ""
5062
+
5063
+ #: templates/default/bbpress/form-user-edit.php:76
5064
+ #: templates/default/bbpress/form-user-edit.php:82
5065
+ msgid "About the user"
5066
+ msgstr ""
5067
+
5068
+ #: templates/default/bbpress/form-user-edit.php:88
5069
+ msgid "Biographical Info"
5070
+ msgstr ""
5071
+
5072
+ #: templates/default/bbpress/form-user-edit.php:96
5073
+ #: templates/default/bbpress/form-user-edit.php:99
5074
+ msgid "Account"
5075
+ msgstr ""
5076
+
5077
+ #: templates/default/bbpress/form-user-edit.php:114
5078
+ msgid "New Password"
5079
+ msgstr ""
5080
+
5081
+ #: templates/default/bbpress/form-user-edit.php:117
5082
+ msgid ""
5083
+ "If you would like to change the password type a new one. Otherwise leave "
5084
+ "this blank."
5085
+ msgstr ""
5086
+
5087
+ #: templates/default/bbpress/form-user-edit.php:120
5088
+ msgid "Type your new password again."
5089
+ msgstr ""
5090
+
5091
+ #: templates/default/bbpress/form-user-edit.php:123
5092
+ msgid ""
5093
+ "Your password should be at least ten characters long. Use upper and lower "
5094
+ "case letters, numbers, and symbols to make it even stronger."
5095
+ msgstr ""
5096
+
5097
+ #: templates/default/bbpress/form-user-edit.php:133
5098
+ #: templates/default/bbpress/form-user-edit.php:136
5099
+ msgid "User Role"
5100
+ msgstr ""
5101
+
5102
+ #: templates/default/bbpress/form-user-edit.php:143
5103
+ msgid "Network Role"
5104
+ msgstr ""
5105
+
5106
+ #: templates/default/bbpress/form-user-edit.php:146
5107
+ msgid "Grant this user super admin privileges for the Network."
5108
+ msgstr ""
5109
+
5110
+ #: templates/default/bbpress/form-user-edit.php:169
5111
+ msgid "Update Profile"
5112
+ msgstr ""
5113
+
5114
+ #: templates/default/bbpress/form-user-edit.php:170
5115
+ msgid "Update User"
5116
+ msgstr ""
5117
+
5118
+ #: templates/default/bbpress/form-user-login.php:28
5119
+ msgid "Keep me signed in"
5120
+ msgstr ""
5121
+
5122
+ #: templates/default/bbpress/form-user-lost-pass.php:18
5123
+ msgid "Username or Email"
5124
+ msgstr ""
5125
+
5126
+ #: templates/default/bbpress/form-user-lost-pass.php:27
5127
+ msgid "Reset My Password"
5128
+ msgstr ""
5129
+
5130
+ #: templates/default/bbpress/form-user-register.php:14
5131
+ msgid "Create an Account"
5132
+ msgstr ""
5133
+
5134
+ #: templates/default/bbpress/form-user-register.php:20
5135
+ msgid "Your username must be unique, and cannot be changed later."
5136
+ msgstr ""
5137
+
5138
+ #: templates/default/bbpress/form-user-register.php:21
5139
+ msgid ""
5140
+ "We use your email address to email you a secure password and verify your "
5141
+ "account."
5142
+ msgstr ""
5143
+
5144
+ #: templates/default/bbpress/form-user-roles.php:13
5145
+ msgid "Blog Role"
5146
+ msgstr ""
5147
+
5148
+ #: templates/default/bbpress/loop-search-forum.php:14
5149
+ msgid "Last updated %s"
5150
+ msgstr ""
5151
+
5152
+ #: templates/default/bbpress/loop-search-reply.php:19
5153
+ msgid "In reply to: "
5154
+ msgstr ""
5155
+
5156
+ #: templates/default/bbpress/loop-search-topic.php:29
5157
+ msgid "in group forum "
5158
+ msgstr ""
5159
+
5160
+ #: templates/default/bbpress/loop-search-topic.php:33
5161
+ msgid "in forum "
5162
+ msgstr ""
5163
+
5164
+ #: templates/default/bbpress/loop-search.php:20
5165
+ #: templates/default/bbpress/loop-search.php:42
5166
+ msgid "Search Results"
5167
+ msgstr ""
5168
+
5169
+ #: templates/default/bbpress/loop-single-reply.php:19
5170
+ msgid "in reply to: "
5171
+ msgstr ""
5172
+
5173
+ #: templates/default/bbpress/loop-single-topic.php:59
5174
+ msgid "Started by: %1$s"
5175
+ msgstr ""
5176
+
5177
+ #: templates/default/bbpress/loop-single-topic.php:67
5178
+ msgid "in: %1$s"
5179
+ msgstr ""
5180
+
5181
+ #: templates/default/bbpress/user-details.php:27
5182
+ #: templates/default/bbpress/user-profile.php:13
5183
+ msgid "Profile"
5184
+ msgstr ""
5185
+
5186
+ #: templates/default/bbpress/user-details.php:33
5187
+ msgid "%s's Topics Started"
5188
+ msgstr ""
5189
+
5190
+ #: templates/default/bbpress/user-details.php:39
5191
+ msgid "%s's Replies Created"
5192
+ msgstr ""
5193
+
5194
+ #: templates/default/bbpress/user-favorites.php:13
5195
+ msgid "Favorite Forum Topics"
5196
+ msgstr ""
5197
+
5198
+ #: templates/default/bbpress/user-favorites.php:27
5199
+ msgid "You currently have no favorite topics."
5200
+ msgstr ""
5201
+
5202
+ #: templates/default/bbpress/user-favorites.php:28
5203
+ msgid "This user has no favorite topics."
5204
+ msgstr ""
5205
+
5206
+ #: templates/default/bbpress/user-profile.php:22
5207
+ msgid "Forum Role: %s"
5208
+ msgstr ""
5209
+
5210
+ #: templates/default/bbpress/user-profile.php:23
5211
+ msgid "Topics Started: %s"
5212
+ msgstr ""
5213
+
5214
+ #: templates/default/bbpress/user-profile.php:24
5215
+ msgid "Replies Created: %s"
5216
+ msgstr ""
5217
+
5218
+ #: templates/default/bbpress/user-replies-created.php:13
5219
+ msgid "Forum Replies Created"
5220
+ msgstr ""
5221
+
5222
+ #: templates/default/bbpress/user-replies-created.php:27
5223
+ msgid "You have not replied to any topics."
5224
+ msgstr ""
5225
+
5226
+ #: templates/default/bbpress/user-replies-created.php:28
5227
+ msgid "This user has not replied to any topics."
5228
+ msgstr ""
5229
+
5230
+ #: templates/default/bbpress/user-subscriptions.php:17
5231
+ msgid "Subscribed Forums"
5232
+ msgstr ""
5233
+
5234
+ #: templates/default/bbpress/user-subscriptions.php:27
5235
+ msgid "You are not currently subscribed to any forums."
5236
+ msgstr ""
5237
+
5238
+ #: templates/default/bbpress/user-subscriptions.php:28
5239
+ msgid "This user is not currently subscribed to any forums."
5240
+ msgstr ""
5241
+
5242
+ #: templates/default/bbpress/user-subscriptions.php:49
5243
+ msgid "You are not currently subscribed to any topics."
5244
+ msgstr ""
5245
+
5246
+ #: templates/default/bbpress/user-subscriptions.php:50
5247
+ msgid "This user is not currently subscribed to any topics."
5248
+ msgstr ""
5249
+
5250
+ #: templates/default/bbpress/user-topics-created.php:13
5251
+ msgid "Forum Topics Started"
5252
+ msgstr ""
5253
+
5254
+ #: templates/default/bbpress/user-topics-created.php:27
5255
+ msgid "You have not created any topics."
5256
+ msgstr ""
5257
+
5258
+ #: templates/default/bbpress/user-topics-created.php:28
5259
+ msgid "This user has not created any topics."
5260
+ msgstr ""
5261
+
5262
+ #: templates/default/bbpress-functions.php:244
5263
+ #: templates/default/bbpress-functions.php:253
5264
+ msgid "Something went wrong. Refresh your browser and try again."
5265
+ msgstr ""
5266
+
5267
+ #: templates/default/bbpress-functions.php:281
5268
+ #: templates/default/bbpress-functions.php:417
5269
+ msgid "Subscriptions are no longer active."
5270
+ msgstr ""
5271
+
5272
+ #: templates/default/bbpress-functions.php:286
5273
+ msgid "Please login to subscribe to this forum."
5274
+ msgstr ""
5275
+
5276
+ #: templates/default/bbpress-functions.php:295
5277
+ #: templates/default/bbpress-functions.php:363
5278
+ #: templates/default/bbpress-functions.php:431
5279
+ msgid "You do not have permission to do this."
5280
+ msgstr ""
5281
+
5282
+ #: templates/default/bbpress-functions.php:303
5283
+ msgid "The forum could not be found."
5284
+ msgstr ""
5285
+
5286
+ #: templates/default/bbpress-functions.php:308
5287
+ #: templates/default/bbpress-functions.php:376
5288
+ #: templates/default/bbpress-functions.php:444
5289
+ msgid "Are you sure you meant to do that?"
5290
+ msgstr ""
5291
+
5292
+ #: templates/default/bbpress-functions.php:316
5293
+ #: templates/default/bbpress-functions.php:384
5294
+ #: templates/default/bbpress-functions.php:452
5295
+ msgid "The request was unsuccessful. Please try again."
5296
+ msgstr ""
5297
+
5298
+ #: templates/default/bbpress-functions.php:349
5299
+ msgid "Favorites are no longer active."
5300
+ msgstr ""
5301
+
5302
+ #: templates/default/bbpress-functions.php:354
5303
+ msgid "Please login to make this topic a favorite."
5304
+ msgstr ""
5305
+
5306
+ #: templates/default/bbpress-functions.php:371
5307
+ #: templates/default/bbpress-functions.php:439
5308
+ msgid "The topic could not be found."
5309
+ msgstr ""
5310
+
5311
+ #: templates/default/bbpress-functions.php:422
5312
+ msgid "Please login to subscribe to this topic."
5313
+ msgstr ""
5314
+
5315
+ #: templates/default/extras/page-forum-statistics.php:22
5316
+ msgid "Here are the statistics and popular topics of our forums."
5317
+ msgstr ""
5318
+
5319
+ #: templates/default/extras/page-topic-tags.php:22
5320
+ msgid "This is a collection of tags that are currently popular on our forums."
5321
+ msgstr ""
5322
+
5323
+ #. Plugin Name of the plugin/theme
5324
+ msgid "bbPress"
5325
+ msgstr ""
5326
+
5327
+ #. Author URI of the plugin/theme
5328
+ msgid "https://bbpress.org"
5329
+ msgstr ""
5330
+
5331
+ #. Description of the plugin/theme
5332
+ msgid "bbPress is forum software with a twist from the creators of WordPress."
5333
+ msgstr ""
5334
+
5335
+ #. Author of the plugin/theme
5336
+ msgid "The bbPress Contributors"
5337
+ msgstr ""
5338
+
5339
+ #: bbpress.php:597
5340
+ msgctxt "post"
5341
+ msgid "Closed"
5342
+ msgstr ""
5343
+
5344
+ #: bbpress.php:598
5345
+ msgctxt "post"
5346
+ msgid "Closed <span class=\"count\">(%s)</span>"
5347
+ msgid_plural "Closed <span class=\"count\">(%s)</span>"
5348
+ msgstr[0] ""
5349
+ msgstr[1] ""
5350
+
5351
+ #: bbpress.php:608
5352
+ msgctxt "post"
5353
+ msgid "Spam"
5354
+ msgstr ""
5355
+
5356
+ #: bbpress.php:609
5357
+ msgctxt "post"
5358
+ msgid "Spam <span class=\"count\">(%s)</span>"
5359
+ msgid_plural "Spam <span class=\"count\">(%s)</span>"
5360
+ msgstr[0] ""
5361
+ msgstr[1] ""
5362
+
5363
+ #: bbpress.php:621
5364
+ msgctxt "post"
5365
+ msgid "Orphan"
5366
+ msgstr ""
5367
+
5368
+ #: bbpress.php:622
5369
+ msgctxt "post"
5370
+ msgid "Orphan <span class=\"count\">(%s)</span>"
5371
+ msgid_plural "Orphans <span class=\"count\">(%s)</span>"
5372
+ msgstr[0] ""
5373
+ msgstr[1] ""
5374
+
5375
+ #: bbpress.php:634
5376
+ msgctxt "post"
5377
+ msgid "Hidden"
5378
+ msgstr ""
5379
+
5380
+ #: bbpress.php:635
5381
+ msgctxt "post"
5382
+ msgid "Hidden <span class=\"count\">(%s)</span>"
5383
+ msgid_plural "Hidden <span class=\"count\">(%s)</span>"
5384
+ msgstr[0] ""
5385
+ msgstr[1] ""
5386
+
5387
+ #: includes/admin/admin.php:654
5388
+ msgctxt "admin color scheme"
5389
+ msgid "Mint"
5390
+ msgstr ""
5391
+
5392
+ #: includes/admin/admin.php:663
5393
+ msgctxt "admin color scheme"
5394
+ msgid "Evergreen"
5395
+ msgstr ""
5396
+
5397
+ #: includes/admin/forums.php:715
5398
+ msgctxt "Close a Forum"
5399
+ msgid "Close"
5400
+ msgstr ""
5401
+
5402
+ #: includes/admin/forums.php:717
5403
+ msgctxt "Open a Forum"
5404
+ msgid "Open"
5405
+ msgstr ""
5406
+
5407
+ #: includes/admin/list-tables/topic-replies.php:37
5408
+ #: includes/admin/settings.php:335 includes/replies/template.php:49
5409
+ msgctxt "noun"
5410
+ msgid "Reply"
5411
+ msgstr ""
5412
+
5413
+ #: includes/admin/replies.php:853
5414
+ msgctxt "Unapprove reply"
5415
+ msgid "Unapprove"
5416
+ msgstr ""
5417
+
5418
+ #: includes/admin/replies.php:855
5419
+ msgctxt "Approve reply"
5420
+ msgid "Approve"
5421
+ msgstr ""
5422
+
5423
+ #: includes/admin/topics.php:1016
5424
+ msgctxt "Unapprove Topic"
5425
+ msgid "Unapprove"
5426
+ msgstr ""
5427
+
5428
+ #: includes/admin/topics.php:1018
5429
+ msgctxt "Approve Topic"
5430
+ msgid "Approve"
5431
+ msgstr ""
5432
+
5433
+ #: includes/admin/topics.php:1027
5434
+ msgctxt "Close a Topic"
5435
+ msgid "Close"
5436
+ msgstr ""
5437
+
5438
+ #: includes/admin/topics.php:1029
5439
+ msgctxt "Open a Topic"
5440
+ msgid "Open"
5441
+ msgstr ""
5442
+
5443
+ #: includes/common/functions.php:180
5444
+ msgctxt "Separator in time since"
5445
+ msgid ","
5446
+ msgstr ""
5447
+
5448
+ #: includes/common/locale.php:44
5449
+ #. translators: user role
5450
+ msgctxt "User role"
5451
+ msgid "Keymaster"
5452
+ msgstr ""
5453
+
5454
+ #: includes/common/locale.php:47
5455
+ #. translators: user role
5456
+ msgctxt "User role"
5457
+ msgid "Moderator"
5458
+ msgstr ""
5459
+
5460
+ #: includes/common/locale.php:50
5461
+ #. translators: user role
5462
+ msgctxt "User role"
5463
+ msgid "Participant"
5464
+ msgstr ""
5465
+
5466
+ #: includes/common/locale.php:53
5467
+ #. translators: user role
5468
+ msgctxt "User role"
5469
+ msgid "Spectator"
5470
+ msgstr ""
5471
+
5472
+ #: includes/common/locale.php:56
5473
+ #. translators: user role
5474
+ msgctxt "User role"
5475
+ msgid "Blocked"
5476
+ msgstr ""
5477
+
5478
+ #: includes/common/widgets.php:822
5479
+ msgctxt "widgets"
5480
+ msgid "by %1$s"
5481
+ msgstr ""
5482
+
5483
+ #: includes/common/widgets.php:1173
5484
+ #. translators: 1: reply author, 2: reply link, 3: reply timestamp
5485
+ msgctxt "widgets"
5486
+ msgid "%1$s on %2$s %3$s"
5487
+ msgstr ""
5488
+
5489
+ #: includes/common/widgets.php:1179
5490
+ #. translators: 1: reply link, 2: reply timestamp
5491
+ msgctxt "widgets"
5492
+ msgid "%1$s %2$s"
5493
+ msgstr ""
5494
+
5495
+ #: includes/common/widgets.php:1185
5496
+ #. translators: 1: reply author, 2: reply link
5497
+ msgctxt "widgets"
5498
+ msgid "%1$s on %2$s"
5499
+ msgstr ""
5500
+
5501
+ #: includes/common/widgets.php:1191
5502
+ #. translators: 1: reply link
5503
+ msgctxt "widgets"
5504
+ msgid "%1$s"
5505
+ msgstr ""
5506
+
5507
+ #: includes/extend/buddypress/groups.php:472
5508
+ msgctxt "group admin edit screen"
5509
+ msgid "Discussion Forum"
5510
+ msgstr ""
5511
+
5512
+ #: includes/forums/functions.php:1997
5513
+ msgctxt "Open the forum"
5514
+ msgid "Open"
5515
+ msgstr ""
5516
+
5517
+ #: includes/forums/functions.php:1998
5518
+ msgctxt "Close the forum"
5519
+ msgid "Closed"
5520
+ msgstr ""
5521
+
5522
+ #: includes/forums/functions.php:2013
5523
+ msgctxt "Forum accepts new topics"
5524
+ msgid "Forum"
5525
+ msgstr ""
5526
+
5527
+ #: includes/forums/functions.php:2014
5528
+ msgctxt "Forum is a category"
5529
+ msgid "Category"
5530
+ msgstr ""
5531
+
5532
+ #: includes/forums/functions.php:2029
5533
+ msgctxt "Make forum public"
5534
+ msgid "Public"
5535
+ msgstr ""
5536
+
5537
+ #: includes/forums/functions.php:2030
5538
+ msgctxt "Make forum private"
5539
+ msgid "Private"
5540
+ msgstr ""
5541
+
5542
+ #: includes/forums/functions.php:2031
5543
+ msgctxt "Make forum hidden"
5544
+ msgid "Hidden"
5545
+ msgstr ""
5546
+
5547
+ #: includes/replies/functions.php:1786
5548
+ msgctxt "Publish the reply"
5549
+ msgid "Publish"
5550
+ msgstr ""
5551
+
5552
+ #: includes/replies/functions.php:1787
5553
+ msgctxt "Spam the reply"
5554
+ msgid "Spam"
5555
+ msgstr ""
5556
+
5557
+ #: includes/replies/functions.php:1788
5558
+ msgctxt "Trash the reply"
5559
+ msgid "Trash"
5560
+ msgstr ""
5561
+
5562
+ #: includes/replies/functions.php:1789
5563
+ msgctxt "Mark reply as pending"
5564
+ msgid "Pending"
5565
+ msgstr ""
5566
+
5567
+ #: includes/replies/template.php:715 includes/topics/template.php:826
5568
+ msgctxt "date at time"
5569
+ msgid "%1$s at %2$s"
5570
+ msgstr ""
5571
+
5572
+ #: includes/replies/template.php:1680 includes/topics/template.php:3091
5573
+ msgctxt "verb"
5574
+ msgid "Reply"
5575
+ msgstr ""
5576
+
5577
+ #: includes/replies/template.php:2368 includes/topics/template.php:2851
5578
+ msgctxt "Pending Status"
5579
+ msgid "Approve"
5580
+ msgstr ""
5581
+
5582
+ #: includes/replies/template.php:2369 includes/topics/template.php:2852
5583
+ msgctxt "Pending Status"
5584
+ msgid "Unapprove"
5585
+ msgstr ""
5586
+
5587
+ #: includes/topics/functions.php:2040
5588
+ msgctxt "Open the topic"
5589
+ msgid "Open"
5590
+ msgstr ""
5591
+
5592
+ #: includes/topics/functions.php:2041
5593
+ msgctxt "Close the topic"
5594
+ msgid "Closed"
5595
+ msgstr ""
5596
+
5597
+ #: includes/topics/functions.php:2042
5598
+ msgctxt "Spam the topic"
5599
+ msgid "Spam"
5600
+ msgstr ""
5601
+
5602
+ #: includes/topics/functions.php:2043
5603
+ msgctxt "Trash the topic"
5604
+ msgid "Trash"
5605
+ msgstr ""
5606
+
5607
+ #: includes/topics/functions.php:2044
5608
+ msgctxt "Mark topic as pending"
5609
+ msgid "Pending"
5610
+ msgstr ""
5611
+
5612
+ #: includes/topics/functions.php:2059
5613
+ msgctxt "Unstick a topic"
5614
+ msgid "Normal"
5615
+ msgstr ""
5616
+
5617
+ #: includes/topics/functions.php:2060
5618
+ msgctxt "Make topic sticky"
5619
+ msgid "Sticky"
5620
+ msgstr ""
5621
+
5622
+ #: includes/topics/functions.php:2061
5623
+ msgctxt "Make topic super sticky"
5624
+ msgid "Super Sticky"
5625
+ msgstr ""
5626
+
5627
+ #: includes/topics/template.php:2790
5628
+ msgctxt "Topic Status"
5629
+ msgid "Close"
5630
+ msgstr ""
5631
+
5632
+ #: includes/topics/template.php:2791
5633
+ msgctxt "Topic Status"
5634
+ msgid "Open"
5635
+ msgstr ""
5636
+
5637
+ #: includes/users/template.php:1218
5638
+ msgctxt "Dismiss pending user email address change"
5639
+ msgid "Cancel"
5640
+ msgstr ""
composer.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "bbpress/bbpress",
3
+ "description": "bbPress is forum software with a twist from the creators of WordPress.",
4
+ "type": "wordpress-plugin",
5
+ "keywords": [
6
+ "bulletin board",
7
+ "community",
8
+ "forum",
9
+ "support",
10
+ "wordpress"
11
+ ],
12
+ "homepage": "https://bbpress.org",
13
+ "license": "GPL-2.0+",
14
+ "authors": [ {
15
+ "name": "bbPress Contributors",
16
+ "homepage": "https://bbpress.org/about/"
17
+ } ],
18
+ "support": {
19
+ "forum": "https://bbpress.org/support/",
20
+ "irc": "irc://irc.freenode.net/bbpress-dev",
21
+ "issues": "https://bbpress.trac.wordpress.org/",
22
+ "wiki": "https://codex.bbpress.org/",
23
+ "source": "https://bbpress.trac.wordpress.org/browser"
24
+ },
25
+ "require": {
26
+ "composer/installers": "~1.0",
27
+ "php": ">=5.2.4"
28
+ }
29
+ }
includes/admin/actions.php CHANGED
@@ -3,9 +3,6 @@
3
  /**
4
  * bbPress Admin Actions
5
  *
6
- * @package bbPress
7
- * @subpackage Admin
8
- *
9
  * This file contains the actions that are used through-out bbPress Admin. They
10
  * are consolidated here to make searching for them easier, and to help developers
11
  * understand at a glance the order in which things occur.
@@ -15,12 +12,15 @@
15
  * - bbPress: In {@link bbPress::setup_actions()} in bbpress.php
16
  * - Admin: More in {@link BBP_Admin::setup_actions()} in admin.php
17
  *
 
 
 
18
  * @see bbp-core-actions.php
19
  * @see bbp-core-filters.php
20
  */
21
 
22
  // Exit if accessed directly
23
- if ( !defined( 'ABSPATH' ) ) exit;
24
 
25
  /**
26
  * Attach bbPress to WordPress
@@ -42,20 +42,23 @@ add_action( 'admin_menu', 'bbp_admin_menu' );
42
  add_action( 'admin_init', 'bbp_admin_init' );
43
  add_action( 'admin_head', 'bbp_admin_head' );
44
  add_action( 'admin_notices', 'bbp_admin_notices' );
45
- add_action( 'custom_menu_order', 'bbp_admin_custom_menu_order' );
46
  add_action( 'menu_order', 'bbp_admin_menu_order' );
 
 
47
  add_action( 'wpmu_new_blog', 'bbp_new_site', 10, 6 );
48
 
49
  // Hook on to admin_init
50
- add_action( 'bbp_admin_init', 'bbp_admin_forums' );
51
- add_action( 'bbp_admin_init', 'bbp_admin_topics' );
52
- add_action( 'bbp_admin_init', 'bbp_admin_replies' );
53
  add_action( 'bbp_admin_init', 'bbp_setup_updater', 999 );
54
  add_action( 'bbp_admin_init', 'bbp_register_importers' );
55
  add_action( 'bbp_admin_init', 'bbp_register_admin_style' );
56
  add_action( 'bbp_admin_init', 'bbp_register_admin_settings' );
57
  add_action( 'bbp_admin_init', 'bbp_do_activation_redirect', 1 );
58
 
 
 
 
 
 
59
  // Initialize the admin area
60
  add_action( 'bbp_init', 'bbp_admin' );
61
 
@@ -73,8 +76,14 @@ add_action( 'bbp_deactivation', 'bbp_delete_rewrite_rules' );
73
  // New Site
74
  add_action( 'bbp_new_site', 'bbp_create_initial_content', 8 );
75
 
 
 
 
76
  // Contextual Helpers
77
- add_action( 'load-settings_page_bbpress', 'bbp_admin_settings_help' );
 
 
 
78
 
79
  // Handle submission of Tools pages
80
  add_action( 'load-tools_page_bbp-repair', 'bbp_admin_repair_handler' );
@@ -83,11 +92,19 @@ add_action( 'load-tools_page_bbp-reset', 'bbp_admin_reset_handler' );
83
  // Add sample permalink filter
84
  add_filter( 'post_type_link', 'bbp_filter_sample_permalink', 10, 4 );
85
 
 
 
 
 
 
 
 
 
86
  /**
87
  * When a new site is created in a multisite installation, run the activation
88
  * routine on that site
89
  *
90
- * @since bbPress (r3283)
91
  *
92
  * @param int $blog_id
93
  * @param int $user_id
@@ -99,8 +116,9 @@ add_filter( 'post_type_link', 'bbp_filter_sample_permalink', 10, 4 );
99
  function bbp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
100
 
101
  // Bail if plugin is not network activated
102
- if ( ! is_plugin_active_for_network( bbpress()->basename ) )
103
  return;
 
104
 
105
  // Switch to the new blog
106
  switch_to_blog( $blog_id );
@@ -112,12 +130,68 @@ function bbp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
112
  restore_current_blog();
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  /** Sub-Actions ***************************************************************/
116
 
117
  /**
118
  * Piggy back admin_init action
119
  *
120
- * @since bbPress (r3766)
 
121
  * @uses do_action() Calls 'bbp_admin_init'
122
  */
123
  function bbp_admin_init() {
@@ -127,7 +201,8 @@ function bbp_admin_init() {
127
  /**
128
  * Piggy back admin_menu action
129
  *
130
- * @since bbPress (r3766)
 
131
  * @uses do_action() Calls 'bbp_admin_menu'
132
  */
133
  function bbp_admin_menu() {
@@ -137,7 +212,8 @@ function bbp_admin_menu() {
137
  /**
138
  * Piggy back admin_head action
139
  *
140
- * @since bbPress (r3766)
 
141
  * @uses do_action() Calls 'bbp_admin_head'
142
  */
143
  function bbp_admin_head() {
@@ -147,7 +223,8 @@ function bbp_admin_head() {
147
  /**
148
  * Piggy back admin_notices action
149
  *
150
- * @since bbPress (r3766)
 
151
  * @uses do_action() Calls 'bbp_admin_notices'
152
  */
153
  function bbp_admin_notices() {
@@ -157,7 +234,8 @@ function bbp_admin_notices() {
157
  /**
158
  * Dedicated action to register bbPress importers
159
  *
160
- * @since bbPress (r3766)
 
161
  * @uses do_action() Calls 'bbp_admin_notices'
162
  */
163
  function bbp_register_importers() {
@@ -167,7 +245,8 @@ function bbp_register_importers() {
167
  /**
168
  * Dedicated action to register admin styles
169
  *
170
- * @since bbPress (r3766)
 
171
  * @uses do_action() Calls 'bbp_admin_notices'
172
  */
173
  function bbp_register_admin_style() {
@@ -177,9 +256,22 @@ function bbp_register_admin_style() {
177
  /**
178
  * Dedicated action to register admin settings
179
  *
180
- * @since bbPress (r3766)
 
181
  * @uses do_action() Calls 'bbp_register_admin_settings'
182
  */
183
  function bbp_register_admin_settings() {
184
  do_action( 'bbp_register_admin_settings' );
185
  }
 
 
 
 
 
 
 
 
 
 
 
 
3
  /**
4
  * bbPress Admin Actions
5
  *
 
 
 
6
  * This file contains the actions that are used through-out bbPress Admin. They
7
  * are consolidated here to make searching for them easier, and to help developers
8
  * understand at a glance the order in which things occur.
12
  * - bbPress: In {@link bbPress::setup_actions()} in bbpress.php
13
  * - Admin: More in {@link BBP_Admin::setup_actions()} in admin.php
14
  *
15
+ * @package bbPress
16
+ * @subpackage Administration
17
+ *
18
  * @see bbp-core-actions.php
19
  * @see bbp-core-filters.php
20
  */
21
 
22
  // Exit if accessed directly
23
+ defined( 'ABSPATH' ) || exit;
24
 
25
  /**
26
  * Attach bbPress to WordPress
42
  add_action( 'admin_init', 'bbp_admin_init' );
43
  add_action( 'admin_head', 'bbp_admin_head' );
44
  add_action( 'admin_notices', 'bbp_admin_notices' );
 
45
  add_action( 'menu_order', 'bbp_admin_menu_order' );
46
+ add_action( 'custom_menu_order', 'bbp_admin_custom_menu_order' );
47
+ add_action( 'current_screen', 'bbp_current_screen' );
48
  add_action( 'wpmu_new_blog', 'bbp_new_site', 10, 6 );
49
 
50
  // Hook on to admin_init
 
 
 
51
  add_action( 'bbp_admin_init', 'bbp_setup_updater', 999 );
52
  add_action( 'bbp_admin_init', 'bbp_register_importers' );
53
  add_action( 'bbp_admin_init', 'bbp_register_admin_style' );
54
  add_action( 'bbp_admin_init', 'bbp_register_admin_settings' );
55
  add_action( 'bbp_admin_init', 'bbp_do_activation_redirect', 1 );
56
 
57
+ // Hook on to current_screen
58
+ add_action( 'bbp_current_screen', 'bbp_admin_forums' );
59
+ add_action( 'bbp_current_screen', 'bbp_admin_topics' );
60
+ add_action( 'bbp_current_screen', 'bbp_admin_replies' );
61
+
62
  // Initialize the admin area
63
  add_action( 'bbp_init', 'bbp_admin' );
64
 
76
  // New Site
77
  add_action( 'bbp_new_site', 'bbp_create_initial_content', 8 );
78
 
79
+ // Load the default repair tools
80
+ add_action( 'load-tools_page_bbp-repair', 'bbp_register_default_repair_tools' );
81
+
82
  // Contextual Helpers
83
+ add_action( 'load-settings_page_bbpress', 'bbp_admin_settings_help' );
84
+ add_action( 'load-tools_page_bbp-repair', 'bbp_admin_tools_repair_help' );
85
+ add_action( 'load-tools_page_bbp-converter', 'bbp_admin_tools_converter_help' );
86
+ add_action( 'load-tools_page_bbp-reset', 'bbp_admin_tools_reset_help' );
87
 
88
  // Handle submission of Tools pages
89
  add_action( 'load-tools_page_bbp-repair', 'bbp_admin_repair_handler' );
92
  // Add sample permalink filter
93
  add_filter( 'post_type_link', 'bbp_filter_sample_permalink', 10, 4 );
94
 
95
+ // Add quick stats to dashboard glance elements
96
+ add_filter( 'dashboard_glance_items', 'bbp_filter_dashboard_glance_items', -99 );
97
+
98
+ // Maybe use icons for column headers
99
+ add_filter( 'bbp_admin_forums_column_headers', 'bbp_filter_column_headers' );
100
+ add_filter( 'bbp_admin_topics_column_headers', 'bbp_filter_column_headers' );
101
+ add_filter( 'bbp_admin_replies_column_headers', 'bbp_filter_column_headers' );
102
+
103
  /**
104
  * When a new site is created in a multisite installation, run the activation
105
  * routine on that site
106
  *
107
+ * @since 2.0.0 bbPress (r3283)
108
  *
109
  * @param int $blog_id
110
  * @param int $user_id
116
  function bbp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
117
 
118
  // Bail if plugin is not network activated
119
+ if ( ! is_plugin_active_for_network( bbpress()->basename ) ) {
120
  return;
121
+ }
122
 
123
  // Switch to the new blog
124
  switch_to_blog( $blog_id );
130
  restore_current_blog();
131
  }
132
 
133
+ /**
134
+ * Show icons in list-table column headers instead of strings
135
+ *
136
+ * @since 2.6.0 bbPress (r5833)
137
+ *
138
+ * @param array $columns Column headers fed into list-table objects
139
+ *
140
+ * @return array Possibly altered column headers
141
+ */
142
+ function bbp_filter_column_headers( $columns = array() ) {
143
+
144
+ // Do not filter column headers by default - maybe we'll turn it on later
145
+ if ( ! apply_filters( 'bbp_filter_column_headers', false ) ) {
146
+ return $columns;
147
+ }
148
+
149
+ /** Forums ****************************************************************/
150
+
151
+ // Forum topic count
152
+ if ( isset( $columns[ 'bbp_forum_topic_count' ] ) ) {
153
+ $columns[ 'bbp_forum_topic_count' ] = '<span class="vers bbp_topics_column" title="' . esc_attr__( 'Topics', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topics', 'bbpress' ) . '</span></span>';
154
+ }
155
+
156
+ // Forum reply count
157
+ if ( isset( $columns[ 'bbp_forum_reply_count' ] ) ) {
158
+ $columns[ 'bbp_forum_reply_count' ] = '<span class="vers bbp_replies_column" title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
159
+ }
160
+
161
+ /** Topics ****************************************************************/
162
+
163
+ // Topic forum
164
+ if ( isset( $columns[ 'bbp_topic_forum' ] ) ) {
165
+ $columns[ 'bbp_topic_forum' ] = '<span class="vers bbp_forums_column" title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
166
+ }
167
+
168
+ // Topic reply count
169
+ if ( isset( $columns[ 'bbp_topic_reply_count' ] ) ) {
170
+ $columns[ 'bbp_topic_reply_count' ] = '<span class="vers bbp_replies_column" title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
171
+ }
172
+
173
+ /** Replies ***************************************************************/
174
+
175
+ // Reply forum
176
+ if ( isset( $columns[ 'bbp_reply_forum' ] ) ) {
177
+ $columns[ 'bbp_reply_forum' ] = '<span class="vers bbp_forums_column" title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
178
+ }
179
+
180
+ // Reply topic
181
+ if ( isset( $columns[ 'bbp_reply_topic' ] ) ) {
182
+ $columns[ 'bbp_reply_topic' ] = '<span class="vers bbp_topics_column" title="' . esc_attr__( 'Topic', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topic', 'bbpress' ) . '</span></span>';
183
+ }
184
+
185
+ return $columns;
186
+ }
187
+
188
  /** Sub-Actions ***************************************************************/
189
 
190
  /**
191
  * Piggy back admin_init action
192
  *
193
+ * @since 2.1.0 bbPress (r3766)
194
+ *
195
  * @uses do_action() Calls 'bbp_admin_init'
196
  */
197
  function bbp_admin_init() {
201
  /**
202
  * Piggy back admin_menu action
203
  *
204
+ * @since 2.1.0 bbPress (r3766)
205
+ *
206
  * @uses do_action() Calls 'bbp_admin_menu'
207
  */
208
  function bbp_admin_menu() {
212
  /**
213
  * Piggy back admin_head action
214
  *
215
+ * @since 2.1.0 bbPress (r3766)
216
+ *
217
  * @uses do_action() Calls 'bbp_admin_head'
218
  */
219
  function bbp_admin_head() {
223
  /**
224
  * Piggy back admin_notices action
225
  *
226
+ * @since 2.1.0 bbPress (r3766)
227
+ *
228
  * @uses do_action() Calls 'bbp_admin_notices'
229
  */
230
  function bbp_admin_notices() {
234
  /**
235
  * Dedicated action to register bbPress importers
236
  *
237
+ * @since 2.1.0 bbPress (r3766)
238
+ *
239
  * @uses do_action() Calls 'bbp_admin_notices'
240
  */
241
  function bbp_register_importers() {
245
  /**
246
  * Dedicated action to register admin styles
247
  *
248
+ * @since 2.1.0 bbPress (r3766)
249
+ *
250
  * @uses do_action() Calls 'bbp_admin_notices'
251
  */
252
  function bbp_register_admin_style() {
256
  /**
257
  * Dedicated action to register admin settings
258
  *
259
+ * @since 2.1.0 bbPress (r3766)
260
+ *
261
  * @uses do_action() Calls 'bbp_register_admin_settings'
262
  */
263
  function bbp_register_admin_settings() {
264
  do_action( 'bbp_register_admin_settings' );
265
  }
266
+
267
+ /**
268
+ * Dedicated action to hook into the current screen
269
+ *
270
+ * @since 2.6.0 bbPress (r6185)
271
+ *
272
+ * @param WP_Screen $current_screen
273
+ * @uses do_action() Calls 'bbp_current_screen'
274
+ */
275
+ function bbp_current_screen( $current_screen = '' ) {
276
+ do_action( 'bbp_current_screen', $current_screen );
277
+ }
includes/admin/admin.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Admin' ) ) :
14
  /**
@@ -16,7 +16,7 @@ if ( !class_exists( 'BBP_Admin' ) ) :
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
- * @since bbPress (r2464)
20
  */
21
  class BBP_Admin {
22
 
@@ -68,12 +68,19 @@ class BBP_Admin {
68
  */
69
  public $show_separator = false;
70
 
 
 
 
 
 
 
 
71
  /** Functions *************************************************************/
72
 
73
  /**
74
  * The main bbPress admin loader
75
  *
76
- * @since bbPress (r2515)
77
  *
78
  * @uses BBP_Admin::setup_globals() Setup the globals needed
79
  * @uses BBP_Admin::includes() Include the required files
@@ -88,7 +95,8 @@ class BBP_Admin {
88
  /**
89
  * Admin globals
90
  *
91
- * @since bbPress (r2646)
 
92
  * @access private
93
  */
94
  private function setup_globals() {
@@ -104,7 +112,8 @@ class BBP_Admin {
104
  /**
105
  * Include required files
106
  *
107
- * @since bbPress (r2646)
 
108
  * @access private
109
  */
110
  private function includes() {
@@ -122,7 +131,8 @@ class BBP_Admin {
122
  /**
123
  * Setup the admin hooks, actions and filters
124
  *
125
- * @since bbPress (r2646)
 
126
  * @access private
127
  *
128
  * @uses add_action() To add various actions
@@ -131,21 +141,21 @@ class BBP_Admin {
131
  private function setup_actions() {
132
 
133
  // Bail to prevent interfering with the deactivation process
134
- if ( bbp_is_deactivation() )
135
  return;
 
136
 
137
  /** General Actions ***************************************************/
138
 
139
- add_action( 'bbp_admin_menu', array( $this, 'admin_menus' ) ); // Add menu item to settings menu
140
- add_action( 'bbp_admin_head', array( $this, 'admin_head' ) ); // Add some general styling to the admin area
141
- add_action( 'bbp_admin_notices', array( $this, 'activation_notice' ) ); // Add notice if not using a bbPress theme
142
- add_action( 'bbp_register_admin_style', array( $this, 'register_admin_style' ) ); // Add green admin style
143
- add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) ); // Add settings
144
- add_action( 'bbp_activation', array( $this, 'new_install' ) ); // Add menu item to settings menu
145
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Add enqueued CSS
146
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Add enqueued JS
147
- add_action( 'wp_dashboard_setup', array( $this, 'dashboard_widget_right_now' ) ); // Forums 'Right now' Dashboard widget
148
- add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 ); // Add a link to bbPress about page to the admin bar
149
 
150
  /** Ajax **************************************************************/
151
 
@@ -181,7 +191,7 @@ class BBP_Admin {
181
  /**
182
  * Add the admin menus
183
  *
184
- * @since bbPress (r2646)
185
  *
186
  * @uses add_management_page() To add the Recount page in Tools section
187
  * @uses add_options_page() To add the Forums settings page in Settings
@@ -272,8 +282,9 @@ class BBP_Admin {
272
  }
273
 
274
  // Bail if plugin is not network activated
275
- if ( ! is_plugin_active_for_network( bbpress()->basename ) )
276
  return;
 
277
 
278
  add_submenu_page(
279
  'index.php',
@@ -288,14 +299,16 @@ class BBP_Admin {
288
  /**
289
  * Add the network admin menus
290
  *
291
- * @since bbPress (r3689)
 
292
  * @uses add_submenu_page() To add the Update Forums page in Updates
293
  */
294
  public function network_admin_menus() {
295
 
296
  // Bail if plugin is not network activated
297
- if ( ! is_plugin_active_for_network( bbpress()->basename ) )
298
  return;
 
299
 
300
  add_submenu_page(
301
  'upgrade.php',
@@ -310,12 +323,14 @@ class BBP_Admin {
310
  /**
311
  * If this is a new installation, create some initial forum content.
312
  *
313
- * @since bbPress (r3767)
 
314
  * @return type
315
  */
316
  public static function new_install() {
317
- if ( !bbp_is_install() )
318
  return;
 
319
 
320
  bbp_create_initial_content();
321
  }
@@ -323,7 +338,7 @@ class BBP_Admin {
323
  /**
324
  * Register the settings
325
  *
326
- * @since bbPress (r2737)
327
  *
328
  * @uses add_settings_section() To add our own settings section
329
  * @uses add_settings_field() To add various settings fields
@@ -334,8 +349,9 @@ class BBP_Admin {
334
 
335
  // Bail if no sections available
336
  $sections = bbp_admin_get_settings_sections();
337
- if ( empty( $sections ) )
338
  return false;
 
339
 
340
  // Are we using settings integration?
341
  $settings_integration = bbp_settings_integration();
@@ -344,16 +360,18 @@ class BBP_Admin {
344
  foreach ( (array) $sections as $section_id => $section ) {
345
 
346
  // Only proceed if current user can see this section
347
- if ( ! current_user_can( $section_id ) )
348
  continue;
 
349
 
350
  // Only add section and fields if section has fields
351
  $fields = bbp_admin_get_settings_fields_for_section( $section_id );
352
- if ( empty( $fields ) )
353
  continue;
 
354
 
355
  // Toggle the section if core integration is on
356
- if ( ( true === $settings_integration ) && !empty( $section['page'] ) ) {
357
  $page = $section['page'];
358
  } else {
359
  $page = 'bbpress';
@@ -366,7 +384,7 @@ class BBP_Admin {
366
  foreach ( (array) $fields as $field_id => $field ) {
367
 
368
  // Add the field
369
- if ( ! empty( $field['callback'] ) && !empty( $field['title'] ) ) {
370
  add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] );
371
  }
372
 
@@ -379,12 +397,12 @@ class BBP_Admin {
379
  /**
380
  * Maps settings capabilities
381
  *
382
- * @since bbPress (r4242)
383
  *
384
  * @param array $caps Capabilities for meta capability
385
  * @param string $cap Capability name
386
  * @param int $user_id User id
387
- * @param mixed $args Arguments
388
  * @uses get_post() To get the post
389
  * @uses apply_filters() Calls 'bbp_map_meta_caps' with caps, cap, user id and
390
  * args
@@ -440,7 +458,7 @@ class BBP_Admin {
440
  /**
441
  * Register the importers
442
  *
443
- * @since bbPress (r2737)
444
  *
445
  * @uses apply_filters() Calls 'bbp_importer_path' filter to allow plugins
446
  * to customize the importer script locations.
@@ -448,8 +466,9 @@ class BBP_Admin {
448
  public function register_importers() {
449
 
450
  // Leave if we're not in the import section
451
- if ( !defined( 'WP_LOAD_IMPORTERS' ) )
452
  return;
 
453
 
454
  // Load Importer API
455
  require_once( ABSPATH . 'wp-admin/includes/import.php' );
@@ -478,7 +497,7 @@ class BBP_Admin {
478
  *
479
  * Shows a nag message in admin area about the theme not supporting bbPress
480
  *
481
- * @since bbPress (r2743)
482
  *
483
  * @uses current_user_can() To check notice should be displayed.
484
  */
@@ -489,7 +508,7 @@ class BBP_Admin {
489
  /**
490
  * Add Settings link to plugins area
491
  *
492
- * @since bbPress (r2737)
493
  *
494
  * @param array $links Links array in which we would prepend our link
495
  * @param string $file Current plugin basename
@@ -498,7 +517,7 @@ class BBP_Admin {
498
  public static function modify_plugin_action_links( $links, $file ) {
499
 
500
  // Return normal links if not bbPress
501
- if ( plugin_basename( bbpress()->file ) !== $file ) {
502
  return $links;
503
  }
504
 
@@ -519,26 +538,15 @@ class BBP_Admin {
519
  return array_merge( $links, $new_links );
520
  }
521
 
522
- /**
523
- * Add the 'Right now in Forums' dashboard widget
524
- *
525
- * @since bbPress (r2770)
526
- *
527
- * @uses wp_add_dashboard_widget() To add the dashboard widget
528
- */
529
- public static function dashboard_widget_right_now() {
530
- wp_add_dashboard_widget( 'bbp-dashboard-right-now', __( 'Right Now in Forums', 'bbpress' ), 'bbp_dashboard_widget_right_now' );
531
- }
532
-
533
  /**
534
  * Add a link to bbPress about page to the admin bar
535
  *
536
- * @since bbPress (r5136)
537
  *
538
  * @param WP_Admin_Bar $wp_admin_bar
539
  */
540
  public function admin_bar_about_link( $wp_admin_bar ) {
541
- if ( is_user_logged_in() ) {
542
  $wp_admin_bar->add_menu( array(
543
  'parent' => 'wp-logo',
544
  'id' => 'bbp-about',
@@ -551,11 +559,16 @@ class BBP_Admin {
551
  /**
552
  * Enqueue any admin scripts we might need
553
  *
554
- * @since bbPress (r4260)
555
  */
556
  public function enqueue_scripts() {
 
 
557
  wp_enqueue_script( 'suggest' );
558
 
 
 
 
559
  // Get the version to use for JS
560
  $version = bbp_get_version();
561
 
@@ -566,15 +579,15 @@ class BBP_Admin {
566
  case bbp_get_topic_post_type() :
567
 
568
  // Enqueue the common JS
569
- wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'common.js', array( 'jquery' ), $version );
570
 
571
  // Topics admin
572
  if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) {
573
- wp_enqueue_script( 'bbp-admin-topics-js', $this->js_url . 'topics.js', array( 'jquery' ), $version );
574
 
575
  // Replies admin
576
  } elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) {
577
- wp_enqueue_script( 'bbp-admin-replies-js', $this->js_url . 'replies.js', array( 'jquery' ), $version );
578
  }
579
 
580
  break;
@@ -585,17 +598,23 @@ class BBP_Admin {
585
  /**
586
  * Enqueue any admin scripts we might need
587
  *
588
- * @since bbPress (r5224)
589
  */
590
  public function enqueue_styles() {
591
- wp_enqueue_style( 'bbp-admin-css', $this->css_url . 'admin.css', array( 'dashicons' ), bbp_get_version() );
 
 
 
 
 
 
592
  }
593
 
594
  /**
595
  * Remove the individual recount and converter menus.
596
  * They are grouped together by h2 tabs
597
  *
598
- * @since bbPress (r2464)
599
  *
600
  * @uses remove_submenu_page() To remove menu items with alternat navigation
601
  */
@@ -614,21 +633,26 @@ class BBP_Admin {
614
  * way to be certain what the relative path of the admin images is.
615
  * We are including the two most common configurations here, just in case.
616
  *
617
- * @since bbPress (r2521)
618
  *
619
  * @uses wp_admin_css_color() To register the color scheme
620
  */
621
- public function register_admin_style () {
 
 
 
 
 
622
 
623
  // RTL and/or minified
624
- $suffix = is_rtl() ? '-rtl' : '';
625
- //$suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
626
 
627
  // Mint
628
  wp_admin_css_color(
629
  'bbp-mint',
630
- esc_html_x( 'Mint', 'admin color scheme', 'bbpress' ),
631
- $this->styles_url . 'mint' . $suffix . '.css',
632
  array( '#4f6d59', '#33834e', '#5FB37C', '#81c498' ),
633
  array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
634
  );
@@ -637,32 +661,24 @@ class BBP_Admin {
637
  wp_admin_css_color(
638
  'bbp-evergreen',
639
  esc_html_x( 'Evergreen', 'admin color scheme', 'bbpress' ),
640
- $this->styles_url . 'evergreen' . $suffix . '.css',
641
  array( '#324d3a', '#446950', '#56b274', '#324d3a' ),
642
  array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
643
  );
644
-
645
- // Bail if already using the fresh color scheme
646
- if ( 'fresh' === get_user_option( 'admin_color' ) ) {
647
- return;
648
- }
649
-
650
- // Force 'colors-fresh' dependency
651
- global $wp_styles;
652
- $wp_styles->registered[ 'colors' ]->deps[] = 'colors-fresh';
653
  }
654
 
655
  /**
656
  * Hide theme compat package selection if only 1 package is registered
657
  *
658
- * @since bbPress (r4315)
659
  *
660
  * @param array $sections Forums settings sections
661
  * @return array
662
  */
663
  public function hide_theme_compat_packages( $sections = array() ) {
664
- if ( count( bbpress()->theme_compat->packages ) <= 1 )
665
  unset( $sections['bbp_settings_theme_compat'] );
 
666
 
667
  return $sections;
668
  }
@@ -670,7 +686,7 @@ class BBP_Admin {
670
  /**
671
  * Allow keymaster role to save Forums settings
672
  *
673
- * @since bbPress (r4678)
674
  *
675
  * @param string $capability
676
  * @return string Return 'keep_gate' capability
@@ -685,7 +701,7 @@ class BBP_Admin {
685
  /**
686
  * Ajax action for facilitating the forum auto-suggest
687
  *
688
- * @since bbPress (r4261)
689
  *
690
  * @uses get_posts()
691
  * @uses bbp_get_topic_post_type()
@@ -693,7 +709,6 @@ class BBP_Admin {
693
  * @uses bbp_get_topic_title()
694
  */
695
  public function suggest_topic() {
696
- global $wpdb;
697
 
698
  // Bail early if no request
699
  if ( empty( $_REQUEST['q'] ) ) {
@@ -710,7 +725,7 @@ class BBP_Admin {
710
 
711
  // Try to get some topics
712
  $topics = get_posts( array(
713
- 's' => $wpdb->esc_like( $_REQUEST['q'] ),
714
  'post_type' => bbp_get_topic_post_type()
715
  ) );
716
 
@@ -726,10 +741,9 @@ class BBP_Admin {
726
  /**
727
  * Ajax action for facilitating the topic and reply author auto-suggest
728
  *
729
- * @since bbPress (r5014)
730
  */
731
  public function suggest_user() {
732
- global $wpdb;
733
 
734
  // Bail early if no request
735
  if ( empty( $_REQUEST['q'] ) ) {
@@ -746,7 +760,7 @@ class BBP_Admin {
746
 
747
  // Try to get some users
748
  $users_query = new WP_User_Query( array(
749
- 'search' => '*' . $wpdb->esc_like( $_REQUEST['q'] ) . '*',
750
  'fields' => array( 'ID', 'user_nicename' ),
751
  'search_columns' => array( 'ID', 'user_nicename', 'user_email' ),
752
  'orderby' => 'ID'
@@ -766,7 +780,7 @@ class BBP_Admin {
766
  /**
767
  * Output the about screen
768
  *
769
- * @since bbPress (r4159)
770
  */
771
  public function about_screen() {
772
 
@@ -775,7 +789,7 @@ class BBP_Admin {
775
  <div class="wrap about-wrap">
776
  <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
777
  <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>
778
- <div class="bbp-badge"><?php printf( esc_html__( 'Version %s', 'bbpress' ), $display_version ); ?></div>
779
 
780
  <h2 class="nav-tab-wrapper">
781
  <a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>">
@@ -843,7 +857,7 @@ class BBP_Admin {
843
  * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll
844
  * want to leverage api.wordpress.org eventually.
845
  *
846
- * @since bbPress (r4159)
847
  */
848
  public function credits_screen() {
849
 
@@ -852,7 +866,7 @@ class BBP_Admin {
852
  <div class="wrap about-wrap">
853
  <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
854
  <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>
855
- <div class="bbp-badge"><?php printf( esc_html__( 'Version %s', 'bbpress' ), $display_version ); ?></div>
856
 
857
  <h2 class="nav-tab-wrapper">
858
  <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
@@ -864,72 +878,72 @@ class BBP_Admin {
864
 
865
  <p class="about-description"><?php esc_html_e( 'bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress' ); ?></p>
866
 
867
- <h4 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'bbpress' ); ?></h4>
868
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
869
  <li class="wp-person" id="wp-person-matt">
870
- <a href="http://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a>
871
- <a class="web" href="http://profiles.wordpress.org/matt">Matt Mullenweg</a>
872
  <span class="title"><?php esc_html_e( 'Founding Developer', 'bbpress' ); ?></span>
873
  </li>
874
  <li class="wp-person" id="wp-person-johnjamesjacoby">
875
- <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
876
- <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
877
  <span class="title"><?php esc_html_e( 'Lead Developer', 'bbpress' ); ?></span>
878
  </li>
879
  <li class="wp-person" id="wp-person-jmdodd">
880
- <a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>
881
- <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
882
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
883
  </li>
884
  <li class="wp-person" id="wp-person-netweb">
885
- <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
886
- <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
887
  <span class="title"><?php esc_html_e( 'Converter Specialist', 'bbpress' ); ?></span>
888
  </li>
889
  </ul>
890
 
891
- <h4 class="wp-people-group"><?php esc_html_e( 'Contributing Developers', 'bbpress' ); ?></h4>
892
  <ul class="wp-people-group " id="wp-people-group-contributing-developers">
893
  <li class="wp-person" id="wp-person-jaredatch">
894
- <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
895
- <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
896
  <span class="title"><?php esc_html_e( 'Bug Testing', 'bbpress' ); ?></span>
897
  </li>
898
  <li class="wp-person" id="wp-person-gautamgupta">
899
- <a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>
900
- <a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a>
901
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
902
  </li>
903
  </ul>
904
 
905
- <h4 class="wp-people-group"><?php esc_html_e( 'Core Contributors to bbPress 2.5', 'bbpress' ); ?></h4>
906
  <p class="wp-credits-list">
907
- <a href="http://profiles.wordpress.org/alex-ye">alex-ye</a>,
908
- <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>,
909
- <a href="http://profiles.wordpress.org/aliso">aliso</a>,
910
- <a href="http://profiles.wordpress.org/boonebgorges">boonebgorges</a>,
911
- <a href="http://profiles.wordpress.org/daveshine">daveshine</a>,
912
- <a href="http://profiles.wordpress.org/DJPaul">DJPaul</a>,
913
- <a href="http://profiles.wordpress.org/ethitter">ethitter</a>,
914
- <a href="http://profiles.wordpress.org/fanquake">fanquake</a>,
915
- <a href="http://profiles.wordpress.org/GargajCNS">GargajCNS</a>,
916
- <a href="http://profiles.wordpress.org/GautamGupta">GautamGupta</a>,
917
- <a href="http://profiles.wordpress.org/imath">imath</a>,
918
- <a href="http://profiles.wordpress.org/jkudish">jkudish</a>,
919
- <a href="http://profiles.wordpress.org/kobenland">kobenland</a>,
920
- <a href="http://profiles.wordpress.org/lakrisgubben">lakrisgubben</a>,
921
- <a href="http://profiles.wordpress.org/loki_racer">loki_racer</a>,
922
- <a href="http://profiles.wordpress.org/mamaduka">mamaduka</a>,
923
- <a href="http://profiles.wordpress.org/Maty">Maty</a>,
924
- <a href="http://profiles.wordpress.org/mercime">mercime</a>,
925
- <a href="http://profiles.wordpress.org/mordauk">mordauk</a>,
926
- <a href="http://profiles.wordpress.org/mrcl">mrcl</a>,
927
- <a href="http://profiles.wordpress.org/MZAWeb">MZAWeb</a>,
928
- <a href="http://profiles.wordpress.org/r-a-y">r-a-y</a>,
929
- <a href="http://profiles.wordpress.org/strangerstudios">strangerstudios</a>,
930
- <a href="http://profiles.wordpress.org/thebrandonallen">thebrandonallen</a>,
931
- <a href="http://profiles.wordpress.org/tlovett1">tlovett1</a>,
932
- <a href="http://profiles.wordpress.org/wpdennis">wpdennis</a>,
933
  </p>
934
 
935
  <div class="return-to-dashboard">
@@ -946,9 +960,8 @@ class BBP_Admin {
946
  /**
947
  * Update all bbPress forums across all sites
948
  *
949
- * @since bbPress (r3689)
950
  *
951
- * @global WPDB $wpdb
952
  * @uses get_blog_option()
953
  * @uses wp_remote_get()
954
  */
@@ -958,8 +971,7 @@ class BBP_Admin {
958
  $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; ?>
959
 
960
  <div class="wrap">
961
- <div id="icon-edit" class="icon32 icon32-posts-topic"><br /></div>
962
- <h2><?php esc_html_e( 'Update Forum', 'bbpress' ); ?></h2>
963
 
964
  <?php
965
 
@@ -993,21 +1005,19 @@ class BBP_Admin {
993
  /**
994
  * Update all bbPress forums across all sites
995
  *
996
- * @since bbPress (r3689)
997
  *
998
- * @global WPDB $wpdb
999
  * @uses get_blog_option()
1000
  * @uses wp_remote_get()
1001
  */
1002
  public static function network_update_screen() {
1003
- global $wpdb;
1004
 
1005
  // Get action
1006
  $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; ?>
1007
 
1008
  <div class="wrap">
1009
- <div id="icon-edit" class="icon32 icon32-posts-topic"><br /></div>
1010
- <h2><?php esc_html_e( 'Update Forums', 'bbpress' ); ?></h2>
1011
 
1012
  <?php
1013
 
@@ -1019,7 +1029,7 @@ class BBP_Admin {
1019
  $n = isset( $_GET['n'] ) ? intval( $_GET['n'] ) : 0;
1020
 
1021
  // Get blogs 5 at a time
1022
- $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
1023
 
1024
  // No blogs so all done!
1025
  if ( empty( $blogs ) ) : ?>
@@ -1049,8 +1059,9 @@ class BBP_Admin {
1049
  );
1050
 
1051
  // Site errored out, no response?
1052
- if ( is_wp_error( $response ) )
1053
- wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: <em>%2$s</em>', 'bbpress' ), $siteurl, $response->get_error_message() ) );
 
1054
 
1055
  // Switch to the new blog
1056
  switch_to_blog( $details[ 'blog_id' ] );
@@ -1108,7 +1119,7 @@ endif; // class_exists check
1108
  /**
1109
  * Setup bbPress Admin
1110
  *
1111
- * @since bbPress (r2596)
1112
  *
1113
  * @uses BBP_Admin
1114
  */
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
  if ( !class_exists( 'BBP_Admin' ) ) :
14
  /**
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
+ * @since 2.0.0 bbPress (r2464)
20
  */
21
  class BBP_Admin {
22
 
68
  */
69
  public $show_separator = false;
70
 
71
+ /** Tools *****************************************************************/
72
+
73
+ /**
74
+ * @var array Array of available repair tools
75
+ */
76
+ public $tools = array();
77
+
78
  /** Functions *************************************************************/
79
 
80
  /**
81
  * The main bbPress admin loader
82
  *
83
+ * @since 2.0.0 bbPress (r2515)
84
  *
85
  * @uses BBP_Admin::setup_globals() Setup the globals needed
86
  * @uses BBP_Admin::includes() Include the required files
95
  /**
96
  * Admin globals
97
  *
98
+ * @since 2.0.0 bbPress (r2646)
99
+ *
100
  * @access private
101
  */
102
  private function setup_globals() {
112
  /**
113
  * Include required files
114
  *
115
+ * @since 2.0.0 bbPress (r2646)
116
+ *
117
  * @access private
118
  */
119
  private function includes() {
131
  /**
132
  * Setup the admin hooks, actions and filters
133
  *
134
+ * @since 2.0.0 bbPress (r2646)
135
+ *
136
  * @access private
137
  *
138
  * @uses add_action() To add various actions
141
  private function setup_actions() {
142
 
143
  // Bail to prevent interfering with the deactivation process
144
+ if ( bbp_is_deactivation() ) {
145
  return;
146
+ }
147
 
148
  /** General Actions ***************************************************/
149
 
150
+ add_action( 'bbp_admin_menu', array( $this, 'admin_menus' ) ); // Add menu item to settings menu
151
+ add_action( 'bbp_admin_head', array( $this, 'admin_head' ) ); // Add some general styling to the admin area
152
+ add_action( 'bbp_admin_notices', array( $this, 'activation_notice' ) ); // Add notice if not using a bbPress theme
153
+ add_action( 'bbp_register_admin_style', array( $this, 'register_admin_style' ) ); // Add green admin style
154
+ add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) ); // Add settings
155
+ add_action( 'bbp_activation', array( $this, 'new_install' ) ); // Add menu item to settings menu
156
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Add enqueued CSS
157
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Add enqueued JS
158
+ add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 ); // Add a link to bbPress about page to the admin bar
 
159
 
160
  /** Ajax **************************************************************/
161
 
191
  /**
192
  * Add the admin menus
193
  *
194
+ * @since 2.0.0 bbPress (r2646)
195
  *
196
  * @uses add_management_page() To add the Recount page in Tools section
197
  * @uses add_options_page() To add the Forums settings page in Settings
282
  }
283
 
284
  // Bail if plugin is not network activated
285
+ if ( ! is_plugin_active_for_network( bbpress()->basename ) ) {
286
  return;
287
+ }
288
 
289
  add_submenu_page(
290
  'index.php',
299
  /**
300
  * Add the network admin menus
301
  *
302
+ * @since 2.1.0 bbPress (r3689)
303
+ *
304
  * @uses add_submenu_page() To add the Update Forums page in Updates
305
  */
306
  public function network_admin_menus() {
307
 
308
  // Bail if plugin is not network activated
309
+ if ( ! is_plugin_active_for_network( bbpress()->basename ) ) {
310
  return;
311
+ }
312
 
313
  add_submenu_page(
314
  'upgrade.php',
323
  /**
324
  * If this is a new installation, create some initial forum content.
325
  *
326
+ * @since 2.1.0 bbPress (r3767)
327
+ *
328
  * @return type
329
  */
330
  public static function new_install() {
331
+ if ( ! bbp_is_install() ) {
332
  return;
333
+ }
334
 
335
  bbp_create_initial_content();
336
  }
338
  /**
339
  * Register the settings
340
  *
341
+ * @since 2.0.0 bbPress (r2737)
342
  *
343
  * @uses add_settings_section() To add our own settings section
344
  * @uses add_settings_field() To add various settings fields
349
 
350
  // Bail if no sections available
351
  $sections = bbp_admin_get_settings_sections();
352
+ if ( empty( $sections ) ) {
353
  return false;
354
+ }
355
 
356
  // Are we using settings integration?
357
  $settings_integration = bbp_settings_integration();
360
  foreach ( (array) $sections as $section_id => $section ) {
361
 
362
  // Only proceed if current user can see this section
363
+ if ( ! current_user_can( $section_id ) ) {
364
  continue;
365
+ }
366
 
367
  // Only add section and fields if section has fields
368
  $fields = bbp_admin_get_settings_fields_for_section( $section_id );
369
+ if ( empty( $fields ) ) {
370
  continue;
371
+ }
372
 
373
  // Toggle the section if core integration is on
374
+ if ( ( true === $settings_integration ) && ! empty( $section['page'] ) ) {
375
  $page = $section['page'];
376
  } else {
377
  $page = 'bbpress';
384
  foreach ( (array) $fields as $field_id => $field ) {
385
 
386
  // Add the field
387
+ if ( ! empty( $field['callback'] ) && ! empty( $field['title'] ) ) {
388
  add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] );
389
  }
390
 
397
  /**
398
  * Maps settings capabilities
399
  *
400
+ * @since 2.2.0 bbPress (r4242)
401
  *
402
  * @param array $caps Capabilities for meta capability
403
  * @param string $cap Capability name
404
  * @param int $user_id User id
405
+ * @param array $args Arguments
406
  * @uses get_post() To get the post
407
  * @uses apply_filters() Calls 'bbp_map_meta_caps' with caps, cap, user id and
408
  * args
458
  /**
459
  * Register the importers
460
  *
461
+ * @since 2.0.0 bbPress (r2737)
462
  *
463
  * @uses apply_filters() Calls 'bbp_importer_path' filter to allow plugins
464
  * to customize the importer script locations.
466
  public function register_importers() {
467
 
468
  // Leave if we're not in the import section
469
+ if ( !defined( 'WP_LOAD_IMPORTERS' ) ) {
470
  return;
471
+ }
472
 
473
  // Load Importer API
474
  require_once( ABSPATH . 'wp-admin/includes/import.php' );
497
  *
498
  * Shows a nag message in admin area about the theme not supporting bbPress
499
  *
500
+ * @since 2.0.0 bbPress (r2743)
501
  *
502
  * @uses current_user_can() To check notice should be displayed.
503
  */
508
  /**
509
  * Add Settings link to plugins area
510
  *
511
+ * @since 2.0.0 bbPress (r2737)
512
  *
513
  * @param array $links Links array in which we would prepend our link
514
  * @param string $file Current plugin basename
517
  public static function modify_plugin_action_links( $links, $file ) {
518
 
519
  // Return normal links if not bbPress
520
+ if ( plugin_basename( bbpress()->basename ) !== $file ) {
521
  return $links;
522
  }
523
 
538
  return array_merge( $links, $new_links );
539
  }
540
 
 
 
 
 
 
 
 
 
 
 
 
541
  /**
542
  * Add a link to bbPress about page to the admin bar
543
  *
544
+ * @since 2.5.0 bbPress (r5136)
545
  *
546
  * @param WP_Admin_Bar $wp_admin_bar
547
  */
548
  public function admin_bar_about_link( $wp_admin_bar ) {
549
+ if ( is_user_logged_in() && current_user_can( 'bbp_about_page' ) ) {
550
  $wp_admin_bar->add_menu( array(
551
  'parent' => 'wp-logo',
552
  'id' => 'bbp-about',
559
  /**
560
  * Enqueue any admin scripts we might need
561
  *
562
+ * @since 2.2.0 bbPress (r4260)
563
  */
564
  public function enqueue_scripts() {
565
+
566
+ // Enqueue suggest for forum/topic/reply autocmopletes
567
  wp_enqueue_script( 'suggest' );
568
 
569
+ // Minified
570
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
571
+
572
  // Get the version to use for JS
573
  $version = bbp_get_version();
574
 
579
  case bbp_get_topic_post_type() :
580
 
581
  // Enqueue the common JS
582
+ wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'common' . $suffix . '.js', array( 'jquery', 'suggest' ), $version );
583
 
584
  // Topics admin
585
  if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) {
586
+ wp_enqueue_script( 'bbp-admin-topics-js', $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version );
587
 
588
  // Replies admin
589
  } elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) {
590
+ wp_enqueue_script( 'bbp-admin-replies-js', $this->js_url . 'replies' . $suffix . '.js', array( 'jquery', 'suggest' ), $version );
591
  }
592
 
593
  break;
598
  /**
599
  * Enqueue any admin scripts we might need
600
  *
601
+ * @since 2.6.0 bbPress (r5224)
602
  */
603
  public function enqueue_styles() {
604
+
605
+ // RTL and/or minified
606
+ $suffix = is_rtl() ? '-rtl' : '';
607
+ $suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
608
+
609
+ // Enqueue admin CSS with dashicons dependency
610
+ wp_enqueue_style( 'bbp-admin-css', $this->css_url . 'admin' . $suffix . '.css', array( 'dashicons' ), bbp_get_version() );
611
  }
612
 
613
  /**
614
  * Remove the individual recount and converter menus.
615
  * They are grouped together by h2 tabs
616
  *
617
+ * @since 2.0.0 bbPress (r2464)
618
  *
619
  * @uses remove_submenu_page() To remove menu items with alternat navigation
620
  */
633
  * way to be certain what the relative path of the admin images is.
634
  * We are including the two most common configurations here, just in case.
635
  *
636
+ * @since 2.0.0 bbPress (r2521)
637
  *
638
  * @uses wp_admin_css_color() To register the color scheme
639
  */
640
+ public function register_admin_style() {
641
+
642
+ // Color schemes are not available when running out of src
643
+ if ( false !== strpos( plugin_basename( bbpress()->file ), 'src' ) ) {
644
+ return;
645
+ }
646
 
647
  // RTL and/or minified
648
+ $suffix = is_rtl() ? '-rtl' : '';
649
+ $suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
650
 
651
  // Mint
652
  wp_admin_css_color(
653
  'bbp-mint',
654
+ esc_html_x( 'Mint', 'admin color scheme', 'bbpress' ),
655
+ $this->styles_url . 'mint/colors' . $suffix . '.css',
656
  array( '#4f6d59', '#33834e', '#5FB37C', '#81c498' ),
657
  array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
658
  );
661
  wp_admin_css_color(
662
  'bbp-evergreen',
663
  esc_html_x( 'Evergreen', 'admin color scheme', 'bbpress' ),
664
+ $this->styles_url . 'evergreen/colors' . $suffix . '.css',
665
  array( '#324d3a', '#446950', '#56b274', '#324d3a' ),
666
  array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
667
  );
 
 
 
 
 
 
 
 
 
668
  }
669
 
670
  /**
671
  * Hide theme compat package selection if only 1 package is registered
672
  *
673
+ * @since 2.2.0 bbPress (r4315)
674
  *
675
  * @param array $sections Forums settings sections
676
  * @return array
677
  */
678
  public function hide_theme_compat_packages( $sections = array() ) {
679
+ if ( count( bbpress()->theme_compat->packages ) <= 1 ) {
680
  unset( $sections['bbp_settings_theme_compat'] );
681
+ }
682
 
683
  return $sections;
684
  }
686
  /**
687
  * Allow keymaster role to save Forums settings
688
  *
689
+ * @since 2.3.0 bbPress (r4678)
690
  *
691
  * @param string $capability
692
  * @return string Return 'keep_gate' capability
701
  /**
702
  * Ajax action for facilitating the forum auto-suggest
703
  *
704
+ * @since 2.2.0 bbPress (r4261)
705
  *
706
  * @uses get_posts()
707
  * @uses bbp_get_topic_post_type()
709
  * @uses bbp_get_topic_title()
710
  */
711
  public function suggest_topic() {
 
712
 
713
  // Bail early if no request
714
  if ( empty( $_REQUEST['q'] ) ) {
725
 
726
  // Try to get some topics
727
  $topics = get_posts( array(
728
+ 's' => bbp_db()->esc_like( $_REQUEST['q'] ),
729
  'post_type' => bbp_get_topic_post_type()
730
  ) );
731
 
741
  /**
742
  * Ajax action for facilitating the topic and reply author auto-suggest
743
  *
744
+ * @since 2.4.0 bbPress (r5014)
745
  */
746
  public function suggest_user() {
 
747
 
748
  // Bail early if no request
749
  if ( empty( $_REQUEST['q'] ) ) {
760
 
761
  // Try to get some users
762
  $users_query = new WP_User_Query( array(
763
+ 'search' => '*' . bbp_db()->esc_like( $_REQUEST['q'] ) . '*',
764
  'fields' => array( 'ID', 'user_nicename' ),
765
  'search_columns' => array( 'ID', 'user_nicename', 'user_email' ),
766
  'orderby' => 'ID'
780
  /**
781
  * Output the about screen
782
  *
783
+ * @since 2.2.0 bbPress (r4159)
784
  */
785
  public function about_screen() {
786
 
789
  <div class="wrap about-wrap">
790
  <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
791
  <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>
792
+ <div class="bbp-badge"></div>
793
 
794
  <h2 class="nav-tab-wrapper">
795
  <a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>">
857
  * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll
858
  * want to leverage api.wordpress.org eventually.
859
  *
860
+ * @since 2.2.0 bbPress (r4159)
861
  */
862
  public function credits_screen() {
863
 
866
  <div class="wrap about-wrap">
867
  <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
868
  <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>
869
+ <div class="bbp-badge"></div>
870
 
871
  <h2 class="nav-tab-wrapper">
872
  <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
878
 
879
  <p class="about-description"><?php esc_html_e( 'bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress' ); ?></p>
880
 
881
+ <h3 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'bbpress' ); ?></h3>
882
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
883
  <li class="wp-person" id="wp-person-matt">
884
+ <a href="https://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a>
885
+ <a class="web" href="https://profiles.wordpress.org/matt">Matt Mullenweg</a>
886
  <span class="title"><?php esc_html_e( 'Founding Developer', 'bbpress' ); ?></span>
887
  </li>
888
  <li class="wp-person" id="wp-person-johnjamesjacoby">
889
+ <a href="https://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
890
+ <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
891
  <span class="title"><?php esc_html_e( 'Lead Developer', 'bbpress' ); ?></span>
892
  </li>
893
  <li class="wp-person" id="wp-person-jmdodd">
894
+ <a href="https://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>
895
+ <a class="web" href="https://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
896
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
897
  </li>
898
  <li class="wp-person" id="wp-person-netweb">
899
+ <a href="https://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
900
+ <a class="web" href="https://profiles.wordpress.org/netweb">Stephen Edgar</a>
901
  <span class="title"><?php esc_html_e( 'Converter Specialist', 'bbpress' ); ?></span>
902
  </li>
903
  </ul>
904
 
905
+ <h3 class="wp-people-group"><?php esc_html_e( 'Contributing Developers', 'bbpress' ); ?></h3>
906
  <ul class="wp-people-group " id="wp-people-group-contributing-developers">
907
  <li class="wp-person" id="wp-person-jaredatch">
908
+ <a href="https://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
909
+ <a class="web" href="https://profiles.wordpress.org/jaredatch">Jared Atchison</a>
910
  <span class="title"><?php esc_html_e( 'Bug Testing', 'bbpress' ); ?></span>
911
  </li>
912
  <li class="wp-person" id="wp-person-gautamgupta">
913
+ <a href="https://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>
914
+ <a class="web" href="https://profiles.wordpress.org/gautamgupta">Gautam Gupta</a>
915
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
916
  </li>
917
  </ul>
918
 
919
+ <h3 class="wp-people-group"><?php esc_html_e( 'Core Contributors to bbPress 2.5', 'bbpress' ); ?></h3>
920
  <p class="wp-credits-list">
921
+ <a href="https://profiles.wordpress.org/alex-ye">alex-ye</a>,
922
+ <a href="https://profiles.wordpress.org/alexvorn2">alexvorn2</a>,
923
+ <a href="https://profiles.wordpress.org/aliso">aliso</a>,
924
+ <a href="https://profiles.wordpress.org/boonebgorges">boonebgorges</a>,
925
+ <a href="https://profiles.wordpress.org/daveshine">daveshine</a>,
926
+ <a href="https://profiles.wordpress.org/DJPaul">DJPaul</a>,
927
+ <a href="https://profiles.wordpress.org/ethitter">ethitter</a>,
928
+ <a href="https://profiles.wordpress.org/fanquake">fanquake</a>,
929
+ <a href="https://profiles.wordpress.org/GargajCNS">GargajCNS</a>,
930
+ <a href="https://profiles.wordpress.org/GautamGupta">GautamGupta</a>,
931
+ <a href="https://profiles.wordpress.org/imath">imath</a>,
932
+ <a href="https://profiles.wordpress.org/jkudish">jkudish</a>,
933
+ <a href="https://profiles.wordpress.org/kobenland">kobenland</a>,
934
+ <a href="https://profiles.wordpress.org/lakrisgubben">lakrisgubben</a>,
935
+ <a href="https://profiles.wordpress.org/loki_racer">loki_racer</a>,
936
+ <a href="https://profiles.wordpress.org/mamaduka">mamaduka</a>,
937
+ <a href="https://profiles.wordpress.org/Maty">Maty</a>,
938
+ <a href="https://profiles.wordpress.org/mercime">mercime</a>,
939
+ <a href="https://profiles.wordpress.org/mordauk">mordauk</a>,
940
+ <a href="https://profiles.wordpress.org/mrcl">mrcl</a>,
941
+ <a href="https://profiles.wordpress.org/MZAWeb">MZAWeb</a>,
942
+ <a href="https://profiles.wordpress.org/r-a-y">r-a-y</a>,
943
+ <a href="https://profiles.wordpress.org/strangerstudios">strangerstudios</a>,
944
+ <a href="https://profiles.wordpress.org/thebrandonallen">thebrandonallen</a>,
945
+ <a href="https://profiles.wordpress.org/tlovett1">tlovett1</a>,
946
+ <a href="https://profiles.wordpress.org/wpdennis">wpdennis</a>,
947
  </p>
948
 
949
  <div class="return-to-dashboard">
960
  /**
961
  * Update all bbPress forums across all sites
962
  *
963
+ * @since 2.1.0 bbPress (r3689)
964
  *
 
965
  * @uses get_blog_option()
966
  * @uses wp_remote_get()
967
  */
971
  $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; ?>
972
 
973
  <div class="wrap">
974
+ <h1><?php esc_html_e( 'Update Forum', 'bbpress' ); ?></h1>
 
975
 
976
  <?php
977
 
1005
  /**
1006
  * Update all bbPress forums across all sites
1007
  *
1008
+ * @since 2.1.0 bbPress (r3689)
1009
  *
 
1010
  * @uses get_blog_option()
1011
  * @uses wp_remote_get()
1012
  */
1013
  public static function network_update_screen() {
1014
+ $bbp_db = bbp_db();
1015
 
1016
  // Get action
1017
  $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; ?>
1018
 
1019
  <div class="wrap">
1020
+ <h1><?php esc_html_e( 'Update Forums', 'bbpress' ); ?></h1>
 
1021
 
1022
  <?php
1023
 
1029
  $n = isset( $_GET['n'] ) ? intval( $_GET['n'] ) : 0;
1030
 
1031
  // Get blogs 5 at a time
1032
+ $blogs = $bbp_db->get_results( "SELECT * FROM {$bbp_db->blogs} WHERE site_id = '{$bbp_db->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
1033
 
1034
  // No blogs so all done!
1035
  if ( empty( $blogs ) ) : ?>
1059
  );
1060
 
1061
  // Site errored out, no response?
1062
+ if ( is_wp_error( $response ) ) {
1063
+ wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s', 'bbpress' ), $siteurl, '<em>' . $response->get_error_message() . '</em>' ) );
1064
+ }
1065
 
1066
  // Switch to the new blog
1067
  switch_to_blog( $details[ 'blog_id' ] );
1119
  /**
1120
  * Setup bbPress Admin
1121
  *
1122
+ * @since 2.0.0 bbPress (r2596)
1123
  *
1124
  * @uses BBP_Admin
1125
  */
includes/admin/converter.php CHANGED
@@ -3,14 +3,14 @@
3
  /**
4
  * bbPress Converter
5
  *
6
- * Based on the hard work of Adam Ellis at http://bbconverter.com
7
  *
8
  * @package bbPress
9
  * @subpackage Administration
10
  */
11
 
12
  // Exit if accessed directly
13
- if ( !defined( 'ABSPATH' ) ) exit;
14
 
15
  /**
16
  * Main BBP_Converter Class
@@ -20,30 +20,34 @@ class BBP_Converter {
20
  /**
21
  * The main bbPress Converter loader
22
  *
23
- * @since bbPress (r3813)
 
24
  * @uses BBP_Converter::includes() Include the required files
25
  * @uses BBP_Converter::setup_actions() Setup the actions
26
  */
27
  public function __construct() {
28
 
29
  // "I wonder where I'll float next."
30
- if ( empty( $_SERVER['REQUEST_METHOD'] ) )
31
  return;
 
32
 
33
  // Bail if request is not correct
34
  switch ( strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
35
 
36
  // Converter is converting
37
  case 'POST' :
38
- if ( ( empty( $_POST['action'] ) || ( 'bbconverter_process' != $_POST['action'] ) ) )
39
  return;
 
40
 
41
  break;
42
 
43
  // Some other admin page
44
  case 'GET' :
45
- if ( ( empty( $_GET['page'] ) || ( 'bbp-converter' != $_GET['page'] ) ) )
46
  return;
 
47
 
48
  break;
49
  }
@@ -55,7 +59,8 @@ class BBP_Converter {
55
  /**
56
  * Setup the default actions
57
  *
58
- * @since bbPress (r3813)
 
59
  * @uses add_action() To add various actions
60
  */
61
  private function setup_actions() {
@@ -73,7 +78,8 @@ class BBP_Converter {
73
  /**
74
  * Register the settings
75
  *
76
- * @since bbPress (r3813)
 
77
  * @uses add_settings_section() To add our own settings section
78
  * @uses add_settings_field() To add various settings fields
79
  * @uses register_setting() To register various settings
@@ -138,7 +144,7 @@ class BBP_Converter {
138
  /**
139
  * Admin scripts
140
  *
141
- * @since bbPress (r3813)
142
  */
143
  public function admin_head() { ?>
144
 
@@ -215,7 +221,7 @@ class BBP_Converter {
215
  }
216
 
217
  function bbconverter_start() {
218
- if( false == bbconverter_is_running ) {
219
  bbconverter_is_running = true;
220
  jQuery('#bbp-converter-start').hide();
221
  jQuery('#bbp-converter-stop').show();
@@ -245,7 +251,7 @@ class BBP_Converter {
245
  function bbconverter_success(response) {
246
  bbconverter_log(response);
247
 
248
- if ( response == '<p class="loading"><?php esc_html_e( 'Conversion Complete', 'bbpress' ); ?></p>' || response.indexOf('error') > -1 ) {
249
  bbconverter_log('<p>Repair any missing information: <a href="<?php echo admin_url(); ?>tools.php?page=bbp-repair">Continue</a></p>');
250
  bbconverter_stop();
251
  } else if( bbconverter_is_running ) { // keep going
@@ -258,7 +264,7 @@ class BBP_Converter {
258
  }
259
 
260
  function bbconverter_log(text) {
261
- if ( jQuery('#bbp-converter-message').css('display') == 'none' ) {
262
  jQuery('#bbp-converter-message').show();
263
  }
264
  if ( text ) {
@@ -275,7 +281,7 @@ class BBP_Converter {
275
  /**
276
  * Wrap the converter output in paragraph tags, so styling can be applied
277
  *
278
- * @since bbPress (r4052)
279
  *
280
  * @param string $output
281
  */
@@ -286,8 +292,9 @@ class BBP_Converter {
286
  $after = '</p>';
287
  $query = get_option( '_bbp_converter_query' );
288
 
289
- if ( ! empty( $query ) )
290
  $before = '<p class="loading" title="' . esc_attr( $query ) . '">';
 
291
 
292
  echo $before . $output . $after;
293
  }
@@ -295,18 +302,18 @@ class BBP_Converter {
295
  /**
296
  * Callback processor
297
  *
298
- * @since bbPress (r3813)
299
  */
300
  public function process_callback() {
301
 
302
- // Verify intent
303
- check_ajax_referer( 'bbp_converter_process' );
304
-
305
  // Bail if user cannot view import page
306
  if ( ! current_user_can( 'bbp_tools_import_page' ) ) {
307
  wp_die( '0' );
308
  }
309
 
 
 
 
310
  if ( ! ini_get( 'safe_mode' ) ) {
311
  set_time_limit( 0 );
312
  ini_set( 'memory_limit', '256M' );
@@ -315,7 +322,7 @@ class BBP_Converter {
315
  }
316
 
317
  // Save step and count so that it can be restarted.
318
- if ( ! get_option( '_bbp_converter_step' ) || ( !empty( $_POST['_bbp_converter_restart'] ) ) ) {
319
  update_option( '_bbp_converter_step', 1 );
320
  update_option( '_bbp_converter_start', 0 );
321
  }
@@ -327,9 +334,10 @@ class BBP_Converter {
327
  $start = $min;
328
 
329
  // Bail if platform did not get saved
330
- $platform = !empty( $_POST['_bbp_converter_platform' ] ) ? $_POST['_bbp_converter_platform' ] : get_option( '_bbp_converter_platform' );
331
- if ( empty( $platform ) )
332
  return;
 
333
 
334
  // Include the appropriate converter.
335
  $converter = bbp_new_converter( $platform );
@@ -338,7 +346,7 @@ class BBP_Converter {
338
 
339
  // STEP 1. Clean all tables.
340
  case 1 :
341
- if ( !empty( $_POST['_bbp_converter_clean'] ) ) {
342
  if ( $converter->clean( $start ) ) {
343
  update_option( '_bbp_converter_step', $step + 1 );
344
  update_option( '_bbp_converter_start', 0 );
@@ -359,7 +367,7 @@ class BBP_Converter {
359
 
360
  // STEP 2. Convert users.
361
  case 2 :
362
- if ( !empty( $_POST['_bbp_converter_convert_users'] ) ) {
363
  if ( $converter->convert_users( $start ) ) {
364
  update_option( '_bbp_converter_step', $step + 1 );
365
  update_option( '_bbp_converter_start', 0 );
@@ -379,7 +387,7 @@ class BBP_Converter {
379
 
380
  // STEP 3. Clean passwords.
381
  case 3 :
382
- if ( !empty( $_POST['_bbp_converter_convert_users'] ) ) {
383
  if ( $converter->clean_passwords( $start ) ) {
384
  update_option( '_bbp_converter_step', $step + 1 );
385
  update_option( '_bbp_converter_start', 0 );
@@ -427,8 +435,23 @@ class BBP_Converter {
427
 
428
  break;
429
 
430
- // STEP 6. Convert topics.
431
  case 6 :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  if ( $converter->convert_topics( $start ) ) {
433
  update_option( '_bbp_converter_step', $step + 1 );
434
  update_option( '_bbp_converter_start', 0 );
@@ -442,8 +465,23 @@ class BBP_Converter {
442
 
443
  break;
444
 
445
- // STEP 7. Stick topics.
446
- case 7 :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  if ( $converter->convert_topic_stickies( $start ) ) {
448
  update_option( '_bbp_converter_step', $step + 1 );
449
  update_option( '_bbp_converter_start', 0 );
@@ -457,8 +495,8 @@ class BBP_Converter {
457
 
458
  break;
459
 
460
- // STEP 8. Stick to front topics (Super Sicky).
461
- case 8 :
462
  if ( $converter->convert_topic_super_stickies( $start ) ) {
463
  update_option( '_bbp_converter_step', $step + 1 );
464
  update_option( '_bbp_converter_start', 0 );
@@ -472,13 +510,28 @@ class BBP_Converter {
472
 
473
  break;
474
 
475
- // STEP 9. Convert tags.
476
- case 9 :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  if ( $converter->convert_tags( $start ) ) {
478
  update_option( '_bbp_converter_step', $step + 1 );
479
  update_option( '_bbp_converter_start', 0 );
480
  if ( empty( $start ) ) {
481
- $this->converter_output( __( 'No tags to convert', 'bbpress' ) );
482
  }
483
  } else {
484
  update_option( '_bbp_converter_start', $max + 1 );
@@ -487,8 +540,38 @@ class BBP_Converter {
487
 
488
  break;
489
 
490
- // STEP 10. Convert replies.
491
- case 10 :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  if ( $converter->convert_replies( $start ) ) {
493
  update_option( '_bbp_converter_step', $step + 1 );
494
  update_option( '_bbp_converter_start', 0 );
@@ -502,17 +585,32 @@ class BBP_Converter {
502
 
503
  break;
504
 
505
- // STEP 11. Convert reply_to parents.
506
- case 11 :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  if ( $converter->convert_reply_to_parents( $start ) ) {
508
  update_option( '_bbp_converter_step', $step + 1 );
509
  update_option( '_bbp_converter_start', 0 );
510
  if ( empty( $start ) ) {
511
- $this->converter_output( __( 'No reply_to parents to convert', 'bbpress' ) );
512
  }
513
  } else {
514
  update_option( '_bbp_converter_start', $max + 1 );
515
- $this->converter_output( sprintf( __( 'Calculating reply_to parents (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
516
  }
517
 
518
  break;
@@ -531,30 +629,31 @@ class BBP_Converter {
531
  /**
532
  * Create Tables for fast syncing
533
  *
534
- * @since bbPress (r3813)
535
  */
536
  public function sync_table( $drop = false ) {
537
- global $wpdb;
538
 
539
- $table_name = $wpdb->prefix . 'bbp_converter_translator';
540
- if ( ! empty( $drop ) && $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name )
541
- $wpdb->query( "DROP TABLE {$table_name}" );
 
 
542
 
543
  require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
544
 
545
- if ( !empty( $wpdb->charset ) ) {
546
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
547
  }
548
 
549
- if ( !empty( $wpdb->collate ) ) {
550
- $charset_collate .= " COLLATE $wpdb->collate";
551
  }
552
 
553
- /** Translator ****************************************************/
554
-
555
  $sql = array();
556
  $max_index_length = 191;
557
 
 
 
558
  $sql[] = "CREATE TABLE {$table_name} (
559
  meta_id mediumint(8) unsigned not null auto_increment,
560
  value_type varchar(25) null,
@@ -564,7 +663,7 @@ class BBP_Converter {
564
  PRIMARY KEY (meta_id),
565
  KEY value_id (value_id),
566
  KEY meta_join (meta_key({$max_index_length}), meta_value({$max_index_length}))
567
- ) {$charset_collate};";
568
 
569
  dbDelta( $sql );
570
  }
@@ -573,7 +672,7 @@ class BBP_Converter {
573
  /**
574
  * Base class to be extended by specific individual importers
575
  *
576
- * @since bbPress (r3813)
577
  */
578
  abstract class BBP_Converter_Base {
579
 
@@ -583,7 +682,7 @@ abstract class BBP_Converter_Base {
583
  protected $field_map = array();
584
 
585
  /**
586
- * @var object This is the connection to the WordPress datbase.
587
  */
588
  protected $wpdb;
589
 
@@ -647,11 +746,10 @@ abstract class BBP_Converter_Base {
647
  }
648
 
649
  private function setup_globals() {
650
- global $wpdb;
651
 
652
  /** Get database connections ******************************************/
653
 
654
- $this->wpdb = $wpdb;
655
  $this->max_rows = (int) $_POST['_bbp_converter_rows'];
656
  $this->opdb = new wpdb( $_POST['_bbp_converter_db_user'], $_POST['_bbp_converter_db_pass'], $_POST['_bbp_converter_db_name'], $_POST['_bbp_converter_db_server'] );
657
  $this->opdb->prefix = $_POST['_bbp_converter_db_prefix'];
@@ -666,14 +764,14 @@ abstract class BBP_Converter_Base {
666
  * Syncing
667
  */
668
  $this->sync_table_name = $this->wpdb->prefix . 'bbp_converter_translator';
669
- if ( $this->wpdb->get_var( "SHOW TABLES LIKE '" . $this->sync_table_name . "'" ) == $this->sync_table_name ) {
670
  $this->sync_table = true;
671
  } else {
672
  $this->sync_table = false;
673
  }
674
 
675
  /**
676
- * Charset
677
  */
678
  if ( empty( $this->wpdb->charset ) ) {
679
  $this->charset = 'UTF8';
@@ -792,12 +890,33 @@ abstract class BBP_Converter_Base {
792
  }
793
 
794
  /**
795
- * Convert Tags
796
  */
797
  public function convert_tags( $start = 1 ) {
798
  return $this->convert_table( 'tags', $start );
799
  }
800
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
801
  /**
802
  * Convert Table
803
  *
@@ -807,7 +926,7 @@ abstract class BBP_Converter_Base {
807
  public function convert_table( $to_type, $start ) {
808
 
809
  // Are we usig a sync table, or postmeta?
810
- if ( $this->wpdb->get_var( "SHOW TABLES LIKE '" . $this->sync_table_name . "'" ) == $this->sync_table_name ) {
811
  $this->sync_table = true;
812
  } else {
813
  $this->sync_table = false;
@@ -828,12 +947,24 @@ abstract class BBP_Converter_Base {
828
  $tablename = '';
829
  break;
830
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  default :
832
  $tablename = $this->wpdb->posts;
833
  }
834
 
835
  // Get the fields from the destination table
836
- if ( !empty( $tablename ) ) {
837
  $tablefield_array = $this->get_fields( $tablename );
838
  }
839
 
@@ -843,13 +974,13 @@ abstract class BBP_Converter_Base {
843
  foreach ( $this->field_map as $item ) {
844
 
845
  // Yay a match, and we have a from table, too
846
- if ( ( $item['to_type'] == $to_type ) && !empty( $item['from_tablename'] ) ) {
847
 
848
  // $from_tablename was set from a previous loop iteration
849
  if ( ! empty( $from_tablename ) ) {
850
 
851
  // Doing some joining
852
- if ( !in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) {
853
  $from_tablename .= ' ' . $item['join_type'] . ' JOIN ' . $this->opdb->prefix . $item['from_tablename'] . ' AS ' . $item['from_tablename'] . ' ' . $item['join_expression'];
854
  }
855
 
@@ -859,7 +990,7 @@ abstract class BBP_Converter_Base {
859
  }
860
 
861
  // Specific FROM expression data used
862
- if ( !empty( $item['from_expression'] ) ) {
863
 
864
  // No 'WHERE' in expression
865
  if ( stripos( $from_tablename, "WHERE" ) === false ) {
@@ -880,18 +1011,19 @@ abstract class BBP_Converter_Base {
880
  /** Step 2 ************************************************************/
881
 
882
  // We have a $from_tablename, so we want to get some data to convert
883
- if ( !empty( $from_tablename ) ) {
884
 
885
  // Get some data from the old forums
886
  $field_list = array_unique( $field_list );
887
- $forum_query = 'SELECT ' . implode( ',', $field_list ) . ' FROM ' . $this->opdb->prefix . $from_tablename . ' LIMIT ' . $start . ', ' . $this->max_rows;
 
888
  $forum_array = $this->opdb->get_results( $forum_query, ARRAY_A );
889
 
890
  // Set this query as the last one ran
891
  update_option( '_bbp_converter_query', $forum_query );
892
 
893
  // Query returned some results
894
- if ( !empty( $forum_array ) ) {
895
 
896
  // Loop through results
897
  foreach ( (array) $forum_array as $forum ) {
@@ -902,9 +1034,9 @@ abstract class BBP_Converter_Base {
902
  // Loop through field map, again...
903
  foreach ( $this->field_map as $row ) {
904
 
905
- // Types matchand to_fieldname is present. This means
906
  // we have some work to do here.
907
- if ( ( $row['to_type'] == $to_type ) && ! is_null( $row['to_fieldname'] ) ) {
908
 
909
  // This row has a destination that matches one of the
910
  // columns in this table.
@@ -912,40 +1044,40 @@ abstract class BBP_Converter_Base {
912
 
913
  // Allows us to set default fields.
914
  if ( isset( $row['default'] ) ) {
915
- $insert_post[$row['to_fieldname']] = $row['default'];
916
 
917
  // Translates a field from the old forum.
918
  } elseif ( isset( $row['callback_method'] ) ) {
919
- if ( ( 'callback_userid' == $row['callback_method'] ) && empty( $_POST['_bbp_converter_convert_users'] ) ) {
920
- $insert_post[$row['to_fieldname']] = $forum[$row['from_fieldname']];
921
  } else {
922
- $insert_post[$row['to_fieldname']] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[$row['from_fieldname']], $forum ) );
923
  }
924
 
925
  // Maps the field from the old forum.
926
  } else {
927
- $insert_post[$row['to_fieldname']] = $forum[$row['from_fieldname']];
928
  }
929
 
930
  // Destination field is not empty, so we might need
931
  // to do some extra work or set a default.
932
- } elseif ( !empty( $row['to_fieldname'] ) ) {
933
 
934
  // Allows us to set default fields.
935
  if ( isset( $row['default'] ) ) {
936
- $insert_postmeta[$row['to_fieldname']] = $row['default'];
937
 
938
  // Translates a field from the old forum.
939
  } elseif ( isset( $row['callback_method'] ) ) {
940
- if ( ( $row['callback_method'] == 'callback_userid' ) && ( 0 == $_POST['_bbp_converter_convert_users'] ) ) {
941
- $insert_postmeta[$row['to_fieldname']] = $forum[$row['from_fieldname']];
942
  } else {
943
- $insert_postmeta[$row['to_fieldname']] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[$row['from_fieldname']], $forum ) );
944
  }
945
 
946
  // Maps the field from the old forum.
947
  } else {
948
- $insert_postmeta[$row['to_fieldname']] = $forum[$row['from_fieldname']];
949
  }
950
  }
951
  }
@@ -995,7 +1127,70 @@ abstract class BBP_Converter_Base {
995
  'slug' => $insert_postmeta['slug']
996
  ) );
997
  }
998
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
999
 
1000
  /** Forum, Topic, Reply ***************************/
1001
 
@@ -1008,31 +1203,35 @@ abstract class BBP_Converter_Base {
1008
 
1009
  add_post_meta( $post_id, $key, $value, true );
1010
 
1011
- // Forums need to save their old ID for group forum association
1012
- if ( ( 'forum' == $to_type ) && ( '_bbp_forum_id' == $key ) )
1013
- add_post_meta( $post_id, '_bbp_old_forum_id', $value );
1014
-
1015
- // Topics need an extra bit of metadata
1016
- // to be keyed to the new post_id
1017
- if ( ( 'topic' == $to_type ) && ( '_bbp_topic_id' == $key ) ) {
1018
-
1019
- // Update the live topic ID
1020
- update_post_meta( $post_id, $key, $post_id );
1021
-
1022
- // Save the old topic ID
1023
- add_post_meta( $post_id, '_bbp_old_topic_id', $value );
1024
- if ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
1025
- $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => '_bbp_topic_id', 'meta_value' => $post_id ) );
1026
- $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => '_bbp_old_topic_id', 'meta_value' => $value ) );
1027
- }
1028
-
1029
- } elseif ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
1030
  $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
1031
  }
1032
 
1033
- // Replies need to save their old reply_to ID for hierarchical replies association
1034
- if ( ( 'reply' == $to_type ) && ( '_bbp_reply_to' == $key ) ) {
1035
- add_post_meta( $post_id, '_bbp_old_reply_to', $value );
 
 
 
 
 
1036
  }
1037
  }
1038
  }
@@ -1054,10 +1253,10 @@ abstract class BBP_Converter_Base {
1054
 
1055
  $has_update = false;
1056
 
1057
- if ( !empty( $this->sync_table ) ) {
1058
- $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
1059
  } else {
1060
- $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
1061
  }
1062
 
1063
  update_option( '_bbp_converter_query', $query );
@@ -1066,7 +1265,7 @@ abstract class BBP_Converter_Base {
1066
 
1067
  foreach ( (array) $forum_array as $row ) {
1068
  $parent_id = $this->callback_forumid( $row->meta_value );
1069
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->posts . ' SET post_parent = "' . $parent_id . '" WHERE ID = "' . $row->value_id . '" LIMIT 1' );
1070
  $has_update = true;
1071
  }
1072
 
@@ -1076,7 +1275,7 @@ abstract class BBP_Converter_Base {
1076
  /**
1077
  * This method converts old topic stickies to new bbPress stickies.
1078
  *
1079
- * @since bbPress (r)
1080
  *
1081
  * @uses WPDB $wpdb
1082
  * @uses bbp_stick_topic() to set the imported topic as sticky
@@ -1086,10 +1285,10 @@ abstract class BBP_Converter_Base {
1086
 
1087
  $has_update = false;
1088
 
1089
- if ( !empty( $this->sync_table ) ) {
1090
- $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;
1091
  } else {
1092
- $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;
1093
  }
1094
 
1095
  update_option( '_bbp_converter_query', $query );
@@ -1107,7 +1306,7 @@ abstract class BBP_Converter_Base {
1107
  /**
1108
  * This method converts old topic super stickies to new bbPress super stickies.
1109
  *
1110
- * @since bbPress (r)
1111
  *
1112
  * @uses WPDB $wpdb
1113
  * @uses bbp_stick_topic() to set the imported topic as super sticky
@@ -1117,10 +1316,10 @@ abstract class BBP_Converter_Base {
1117
 
1118
  $has_update = false;
1119
 
1120
- if ( !empty( $this->sync_table ) ) {
1121
- $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;
1122
  } else {
1123
- $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;
1124
  }
1125
 
1126
  update_option( '_bbp_converter_query', $query );
@@ -1136,17 +1335,49 @@ abstract class BBP_Converter_Base {
1136
  return ! $has_update;
1137
  }
1138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1139
  /**
1140
  * This method converts old reply_to post id to new bbPress reply_to post id.
 
 
1141
  */
1142
  public function convert_reply_to_parents( $start ) {
1143
 
1144
  $has_update = false;
1145
 
1146
- if ( !empty( $this->sync_table ) ) {
1147
- $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_to" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
1148
  } else {
1149
- $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_reply_to" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
1150
  }
1151
 
1152
  update_option( '_bbp_converter_query', $query );
@@ -1155,7 +1386,99 @@ abstract class BBP_Converter_Base {
1155
 
1156
  foreach ( (array) $reply_to_array as $row ) {
1157
  $reply_to = $this->callback_reply_to( $row->meta_value );
1158
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->postmeta . ' SET meta_value = "' . $reply_to . '" WHERE meta_key = "_bbp_reply_to" AND post_id = "' . $row->value_id . '" LIMIT 1' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1159
  $has_update = true;
1160
  }
1161
 
@@ -1173,9 +1496,9 @@ abstract class BBP_Converter_Base {
1173
  /** Delete bbconverter topics/forums/posts ****************************/
1174
 
1175
  if ( true === $this->sync_table ) {
1176
- $query = 'SELECT value_id FROM ' . $this->sync_table_name . ' INNER JOIN ' . $this->wpdb->posts . ' ON(value_id = ID) WHERE meta_key LIKE "_bbp_%" AND value_type = "post" GROUP BY value_id ORDER BY value_id DESC LIMIT ' . $this->max_rows;
1177
  } else {
1178
- $query = 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key LIKE "_bbp_%" GROUP BY post_id ORDER BY post_id DESC LIMIT ' . $this->max_rows;
1179
  }
1180
 
1181
  update_option( '_bbp_converter_query', $query );
@@ -1192,16 +1515,16 @@ abstract class BBP_Converter_Base {
1192
  /** Delete bbconverter users ******************************************/
1193
 
1194
  if ( true === $this->sync_table ) {
1195
- $query = 'SELECT value_id FROM ' . $this->sync_table_name . ' INNER JOIN ' . $this->wpdb->users . ' ON(value_id = ID) WHERE meta_key = "_bbp_user_id" AND value_type = "user" LIMIT ' . $this->max_rows;
1196
  } else {
1197
- $query = 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_user_id" LIMIT ' . $this->max_rows;
1198
  }
1199
 
1200
  update_option( '_bbp_converter_query', $query );
1201
 
1202
  $users = $this->wpdb->get_results( $query, ARRAY_A );
1203
 
1204
- if ( !empty( $users ) ) {
1205
  foreach ( $users as $value ) {
1206
  wp_delete_user( $value['value_id'] );
1207
  }
@@ -1225,19 +1548,19 @@ abstract class BBP_Converter_Base {
1225
 
1226
  /** Delete bbconverter passwords **************************************/
1227
 
1228
- $query = 'SELECT user_id, meta_value FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" LIMIT ' . $start . ', ' . $this->max_rows;
1229
  update_option( '_bbp_converter_query', $query );
1230
 
1231
  $bbconverter = $this->wpdb->get_results( $query, ARRAY_A );
1232
 
1233
- if ( !empty( $bbconverter ) ) {
1234
 
1235
  foreach ( $bbconverter as $value ) {
1236
  if ( is_serialized( $value['meta_value'] ) ) {
1237
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "" ' . 'WHERE ID = "' . $value['user_id'] . '"' );
1238
  } else {
1239
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . $value['meta_value'] . '" ' . 'WHERE ID = "' . $value['user_id'] . '"' );
1240
- $this->wpdb->query( 'DELETE FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $value['user_id'] . '"' );
1241
  }
1242
  }
1243
  $has_delete = true;
@@ -1271,12 +1594,13 @@ abstract class BBP_Converter_Base {
1271
  $rval[] = $field['Field'];
1272
  }
1273
 
1274
- if ( $tablename == $this->wpdb->users ) {
1275
  $rval[] = 'role';
1276
  $rval[] = 'yim';
1277
  $rval[] = 'aim';
1278
  $rval[] = 'jabber';
1279
  }
 
1280
  return $rval;
1281
  }
1282
 
@@ -1289,14 +1613,14 @@ abstract class BBP_Converter_Base {
1289
  * @param string $password
1290
  */
1291
  public function callback_pass( $username, $password ) {
1292
- $user = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT * FROM ' . $this->wpdb->users . ' WHERE user_login = "%s" AND user_pass = "" LIMIT 1', $username ) );
1293
- if ( !empty( $user ) ) {
1294
- $usermeta = $this->wpdb->get_row( 'SELECT * FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '" LIMIT 1' );
1295
 
1296
- if ( !empty( $usermeta ) ) {
1297
  if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
1298
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . wp_hash_password( $password ) . '" ' . 'WHERE ID = "' . $user->ID . '"' );
1299
- $this->wpdb->query( 'DELETE FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '"' );
1300
  }
1301
  }
1302
  }
@@ -1309,20 +1633,20 @@ abstract class BBP_Converter_Base {
1309
  * @return string
1310
  */
1311
  private function callback_forumid( $field ) {
1312
- if ( !isset( $this->map_forumid[$field] ) ) {
1313
- if ( !empty( $this->sync_table ) ) {
1314
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_forum_id" AND meta_value = "%s" LIMIT 1', $field ) );
1315
  } else {
1316
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_forum_id" AND meta_value = "%s" LIMIT 1', $field ) );
1317
  }
1318
 
1319
- if ( !is_null( $row ) ) {
1320
- $this->map_forumid[$field] = $row->value_id;
1321
  } else {
1322
- $this->map_forumid[$field] = 0;
1323
  }
1324
  }
1325
- return $this->map_forumid[$field];
1326
  }
1327
 
1328
  /**
@@ -1332,43 +1656,45 @@ abstract class BBP_Converter_Base {
1332
  * @return string
1333
  */
1334
  private function callback_topicid( $field ) {
1335
- if ( !isset( $this->map_topicid[$field] ) ) {
1336
- if ( !empty( $this->sync_table ) ) {
1337
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_topic_id" AND meta_value = "%s" LIMIT 1', $field ) );
1338
  } else {
1339
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_topic_id" AND meta_value = "%s" LIMIT 1', $field ) );
1340
  }
1341
 
1342
- if ( !is_null( $row ) ) {
1343
- $this->map_topicid[$field] = $row->value_id;
1344
  } else {
1345
- $this->map_topicid[$field] = 0;
1346
  }
1347
  }
1348
- return $this->map_topicid[$field];
1349
  }
1350
 
1351
  /**
1352
  * A mini cache system to reduce database calls to reply_to post id.
1353
  *
 
 
1354
  * @param string $field
1355
  * @return string
1356
  */
1357
  private function callback_reply_to( $field ) {
1358
- if ( !isset( $this->map_reply_to[$field] ) ) {
1359
- if ( !empty( $this->sync_table ) ) {
1360
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_post_id" AND meta_value = "%s" LIMIT 1', $field ) );
1361
  } else {
1362
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_post_id" AND meta_value = "%s" LIMIT 1', $field ) );
1363
  }
1364
 
1365
- if ( !is_null( $row ) ) {
1366
- $this->map_reply_to[$field] = $row->value_id;
1367
  } else {
1368
- $this->map_reply_to[$field] = 0;
1369
  }
1370
  }
1371
- return $this->map_reply_to[$field];
1372
  }
1373
 
1374
  /**
@@ -1378,24 +1704,43 @@ abstract class BBP_Converter_Base {
1378
  * @return string
1379
  */
1380
  private function callback_userid( $field ) {
1381
- if ( !isset( $this->map_userid[$field] ) ) {
1382
- if ( !empty( $this->sync_table ) ) {
1383
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
1384
  } else {
1385
- $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
1386
  }
1387
 
1388
- if ( !is_null( $row ) ) {
1389
- $this->map_userid[$field] = $row->value_id;
1390
  } else {
1391
- if ( !empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {
1392
- $this->map_userid[$field] = 0;
1393
  } else {
1394
- $this->map_userid[$field] = $field;
1395
  }
1396
  }
1397
  }
1398
- return $this->map_userid[$field];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1399
  }
1400
 
1401
  /**
@@ -1407,18 +1752,18 @@ abstract class BBP_Converter_Base {
1407
  private function callback_topicid_to_forumid( $field ) {
1408
  $topicid = $this->callback_topicid( $field );
1409
  if ( empty( $topicid ) ) {
1410
- $this->map_topicid_to_forumid[$topicid] = 0;
1411
- } elseif ( ! isset( $this->map_topicid_to_forumid[$topicid] ) ) {
1412
- $row = $this->wpdb->get_row( 'SELECT post_parent FROM ' . $this->wpdb->posts . ' WHERE ID = "' . $topicid . '" LIMIT 1' );
1413
 
1414
- if ( !is_null( $row ) ) {
1415
- $this->map_topicid_to_forumid[$topicid] = $row->post_parent;
1416
  } else {
1417
- $this->map_topicid_to_forumid[$topicid] = 0;
1418
  }
1419
  }
1420
 
1421
- return $this->map_topicid_to_forumid[$topicid];
1422
  }
1423
 
1424
  protected function callback_slug( $field ) {
@@ -1470,7 +1815,7 @@ function bbp_new_converter( $platform ) {
1470
  while ( $file = readdir( $curdir ) ) {
1471
  if ( stristr( $file, '.php' ) && stristr( $file, 'index' ) === FALSE ) {
1472
  $file = preg_replace( '/.php/', '', $file );
1473
- if ( $platform == $file ) {
1474
  $found = true;
1475
  continue;
1476
  }
3
  /**
4
  * bbPress Converter
5
  *
6
+ * Based on the hard work of Adam Ellis
7
  *
8
  * @package bbPress
9
  * @subpackage Administration
10
  */
11
 
12
  // Exit if accessed directly
13
+ defined( 'ABSPATH' ) || exit;
14
 
15
  /**
16
  * Main BBP_Converter Class
20
  /**
21
  * The main bbPress Converter loader
22
  *
23
+ * @since 2.1.0 bbPress (r3813)
24
+ *
25
  * @uses BBP_Converter::includes() Include the required files
26
  * @uses BBP_Converter::setup_actions() Setup the actions
27
  */
28
  public function __construct() {
29
 
30
  // "I wonder where I'll float next."
31
+ if ( empty( $_SERVER['REQUEST_METHOD'] ) ) {
32
  return;
33
+ }
34
 
35
  // Bail if request is not correct
36
  switch ( strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
37
 
38
  // Converter is converting
39
  case 'POST' :
40
+ if ( ( empty( $_POST['action'] ) || ( 'bbconverter_process' != $_POST['action'] ) ) ) {
41
  return;
42
+ }
43
 
44
  break;
45
 
46
  // Some other admin page
47
  case 'GET' :
48
+ if ( ( empty( $_GET['page'] ) || ( 'bbp-converter' != $_GET['page'] ) ) ) {
49
  return;
50
+ }
51
 
52
  break;
53
  }
59
  /**
60
  * Setup the default actions
61
  *
62
+ * @since 2.1.0 bbPress (r3813)
63
+ *
64
  * @uses add_action() To add various actions
65
  */
66
  private function setup_actions() {
78
  /**
79
  * Register the settings
80
  *
81
+ * @since 2.1.0 bbPress (r3813)
82
+ *
83
  * @uses add_settings_section() To add our own settings section
84
  * @uses add_settings_field() To add various settings fields
85
  * @uses register_setting() To register various settings
144
  /**
145
  * Admin scripts
146
  *
147
+ * @since 2.1.0 bbPress (r3813)
148
  */
149
  public function admin_head() { ?>
150
 
221
  }
222
 
223
  function bbconverter_start() {
224
+ if( false === bbconverter_is_running ) {
225
  bbconverter_is_running = true;
226
  jQuery('#bbp-converter-start').hide();
227
  jQuery('#bbp-converter-stop').show();
251
  function bbconverter_success(response) {
252
  bbconverter_log(response);
253
 
254
+ if ( response === '<p class="loading"><?php esc_html_e( 'Conversion Complete', 'bbpress' ); ?></p>' || response.indexOf('error') > -1 ) {
255
  bbconverter_log('<p>Repair any missing information: <a href="<?php echo admin_url(); ?>tools.php?page=bbp-repair">Continue</a></p>');
256
  bbconverter_stop();
257
  } else if( bbconverter_is_running ) { // keep going
264
  }
265
 
266
  function bbconverter_log(text) {
267
+ if ( jQuery('#bbp-converter-message').css('display') === 'none' ) {
268
  jQuery('#bbp-converter-message').show();
269
  }
270
  if ( text ) {
281
  /**
282
  * Wrap the converter output in paragraph tags, so styling can be applied
283
  *
284
+ * @since 2.1.0 bbPress (r4052)
285
  *
286
  * @param string $output
287
  */
292
  $after = '</p>';
293
  $query = get_option( '_bbp_converter_query' );
294
 
295
+ if ( ! empty( $query ) ) {
296
  $before = '<p class="loading" title="' . esc_attr( $query ) . '">';
297
+ }
298
 
299
  echo $before . $output . $after;
300
  }
302
  /**
303
  * Callback processor
304
  *
305
+ * @since 2.1.0 bbPress (r3813)
306
  */
307
  public function process_callback() {
308
 
 
 
 
309
  // Bail if user cannot view import page
310
  if ( ! current_user_can( 'bbp_tools_import_page' ) ) {
311
  wp_die( '0' );
312
  }
313
 
314
+ // Verify intent
315
+ check_ajax_referer( 'bbp_converter_process' );
316
+
317
  if ( ! ini_get( 'safe_mode' ) ) {
318
  set_time_limit( 0 );
319
  ini_set( 'memory_limit', '256M' );
322
  }
323
 
324
  // Save step and count so that it can be restarted.
325
+ if ( ! get_option( '_bbp_converter_step' ) || ( ! empty( $_POST['_bbp_converter_restart'] ) ) ) {
326
  update_option( '_bbp_converter_step', 1 );
327
  update_option( '_bbp_converter_start', 0 );
328
  }
334
  $start = $min;
335
 
336
  // Bail if platform did not get saved
337
+ $platform = ! empty( $_POST['_bbp_converter_platform' ] ) ? $_POST['_bbp_converter_platform' ] : get_option( '_bbp_converter_platform' );
338
+ if ( empty( $platform ) ) {
339
  return;
340
+ }
341
 
342
  // Include the appropriate converter.
343
  $converter = bbp_new_converter( $platform );
346
 
347
  // STEP 1. Clean all tables.
348
  case 1 :
349
+ if ( ! empty( $_POST['_bbp_converter_clean'] ) ) {
350
  if ( $converter->clean( $start ) ) {
351
  update_option( '_bbp_converter_step', $step + 1 );
352
  update_option( '_bbp_converter_start', 0 );
367
 
368
  // STEP 2. Convert users.
369
  case 2 :
370
+ if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) {
371
  if ( $converter->convert_users( $start ) ) {
372
  update_option( '_bbp_converter_step', $step + 1 );
373
  update_option( '_bbp_converter_start', 0 );
387
 
388
  // STEP 3. Clean passwords.
389
  case 3 :
390
+ if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) {
391
  if ( $converter->clean_passwords( $start ) ) {
392
  update_option( '_bbp_converter_step', $step + 1 );
393
  update_option( '_bbp_converter_start', 0 );
435
 
436
  break;
437
 
438
+ // STEP 6. Convert forum subscriptions.
439
  case 6 :
440
+ if ( $converter->convert_forum_subscriptions( $start ) ) {
441
+ update_option( '_bbp_converter_step', $step + 1 );
442
+ update_option( '_bbp_converter_start', 0 );
443
+ if ( empty( $start ) ) {
444
+ $this->converter_output( __( 'No forum subscriptions to convert', 'bbpress' ) );
445
+ }
446
+ } else {
447
+ update_option( '_bbp_converter_start', $max + 1 );
448
+ $this->converter_output( sprintf( __( 'Converting forum subscriptions (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
449
+ }
450
+
451
+ break;
452
+
453
+ // STEP 7. Convert topics.
454
+ case 7 :
455
  if ( $converter->convert_topics( $start ) ) {
456
  update_option( '_bbp_converter_step', $step + 1 );
457
  update_option( '_bbp_converter_start', 0 );
465
 
466
  break;
467
 
468
+ // STEP 8. Convert anonymous topic authors.
469
+ case 8 :
470
+ if ( $converter->convert_anonymous_topic_authors( $start ) ) {
471
+ update_option( '_bbp_converter_step', $step + 1 );
472
+ update_option( '_bbp_converter_start', 0 );
473
+ if ( empty( $start ) ) {
474
+ $this->converter_output( __( 'No anonymous topic authors to convert', 'bbpress' ) );
475
+ }
476
+ } else {
477
+ update_option( '_bbp_converter_start', $max + 1 );
478
+ $this->converter_output( sprintf( __( 'Converting anonymous topic authors (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
479
+ }
480
+
481
+ break;
482
+
483
+ // STEP 9. Stick topics.
484
+ case 9 :
485
  if ( $converter->convert_topic_stickies( $start ) ) {
486
  update_option( '_bbp_converter_step', $step + 1 );
487
  update_option( '_bbp_converter_start', 0 );
495
 
496
  break;
497
 
498
+ // STEP 10. Stick to front topics (Super Sicky).
499
+ case 10 :
500
  if ( $converter->convert_topic_super_stickies( $start ) ) {
501
  update_option( '_bbp_converter_step', $step + 1 );
502
  update_option( '_bbp_converter_start', 0 );
510
 
511
  break;
512
 
513
+ // STEP 11. Closed topics.
514
+ case 11 :
515
+ if ( $converter->convert_topic_closed_topics( $start ) ) {
516
+ update_option( '_bbp_converter_step', $step + 1 );
517
+ update_option( '_bbp_converter_start', 0 );
518
+ if ( empty( $start ) ) {
519
+ $this->converter_output( __( 'No closed topics to close', 'bbpress' ) );
520
+ }
521
+ } else {
522
+ update_option( '_bbp_converter_start', $max + 1 );
523
+ $this->converter_output( sprintf( __( 'Calculating closed topics (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
524
+ }
525
+
526
+ break;
527
+
528
+ // STEP 12. Convert topic tags.
529
+ case 12 :
530
  if ( $converter->convert_tags( $start ) ) {
531
  update_option( '_bbp_converter_step', $step + 1 );
532
  update_option( '_bbp_converter_start', 0 );
533
  if ( empty( $start ) ) {
534
+ $this->converter_output( __( 'No topic tags to convert', 'bbpress' ) );
535
  }
536
  } else {
537
  update_option( '_bbp_converter_start', $max + 1 );
540
 
541
  break;
542
 
543
+ // STEP 13. Convert topic subscriptions.
544
+ case 13 :
545
+ if ( $converter->convert_topic_subscriptions( $start ) ) {
546
+ update_option( '_bbp_converter_step', $step + 1 );
547
+ update_option( '_bbp_converter_start', 0 );
548
+ if ( empty( $start ) ) {
549
+ $this->converter_output( __( 'No topic subscriptions to convert', 'bbpress' ) );
550
+ }
551
+ } else {
552
+ update_option( '_bbp_converter_start', $max + 1 );
553
+ $this->converter_output( sprintf( __( 'Converting topic subscriptions (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
554
+ }
555
+
556
+ break;
557
+
558
+ // STEP 14. Convert topic favorites.
559
+ case 14 :
560
+ if ( $converter->convert_favorites( $start ) ) {
561
+ update_option( '_bbp_converter_step', $step + 1 );
562
+ update_option( '_bbp_converter_start', 0 );
563
+ if ( empty( $start ) ) {
564
+ $this->converter_output( __( 'No favorites to convert', 'bbpress' ) );
565
+ }
566
+ } else {
567
+ update_option( '_bbp_converter_start', $max + 1 );
568
+ $this->converter_output( sprintf( __( 'Converting favorites (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
569
+ }
570
+
571
+ break;
572
+
573
+ // STEP 15. Convert replies.
574
+ case 15 :
575
  if ( $converter->convert_replies( $start ) ) {
576
  update_option( '_bbp_converter_step', $step + 1 );
577
  update_option( '_bbp_converter_start', 0 );
585
 
586
  break;
587
 
588
+ // STEP 16. Convert anonymous reply authors.
589
+ case 16 :
590
+ if ( $converter->convert_anonymous_reply_authors( $start ) ) {
591
+ update_option( '_bbp_converter_step', $step + 1 );
592
+ update_option( '_bbp_converter_start', 0 );
593
+ if ( empty( $start ) ) {
594
+ $this->converter_output( __( 'No anonymous reply authors to convert', 'bbpress' ) );
595
+ }
596
+ } else {
597
+ update_option( '_bbp_converter_start', $max + 1 );
598
+ $this->converter_output( sprintf( __( 'Converting anonymous reply authors (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
599
+ }
600
+
601
+ break;
602
+
603
+ // STEP 17. Convert threaded replies parents.
604
+ case 17 :
605
  if ( $converter->convert_reply_to_parents( $start ) ) {
606
  update_option( '_bbp_converter_step', $step + 1 );
607
  update_option( '_bbp_converter_start', 0 );
608
  if ( empty( $start ) ) {
609
+ $this->converter_output( __( 'No threaded replies to convert', 'bbpress' ) );
610
  }
611
  } else {
612
  update_option( '_bbp_converter_start', $max + 1 );
613
+ $this->converter_output( sprintf( __( 'Calculating threaded replies parents (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
614
  }
615
 
616
  break;
629
  /**
630
  * Create Tables for fast syncing
631
  *
632
+ * @since 2.1.0 bbPress (r3813)
633
  */
634
  public function sync_table( $drop = false ) {
 
635
 
636
+ $bbp_db = bbp_db();
637
+ $table_name = $bbp_db->prefix . 'bbp_converter_translator';
638
+ if ( ! empty( $drop ) && $bbp_db->get_var( "SHOW TABLES LIKE '{$table_name}'" ) === $table_name ) {
639
+ $bbp_db->query( "DROP TABLE {$table_name}" );
640
+ }
641
 
642
  require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
643
 
644
+ if ( ! empty( $bbp_db->charset ) ) {
645
+ $charset_collate = "DEFAULT CHARACTER SET $bbp_db->charset";
646
  }
647
 
648
+ if ( ! empty( $bbp_db->collate ) ) {
649
+ $charset_collate .= " COLLATE $bbp_db->collate";
650
  }
651
 
 
 
652
  $sql = array();
653
  $max_index_length = 191;
654
 
655
+ /** Translator ********************************************************/
656
+
657
  $sql[] = "CREATE TABLE {$table_name} (
658
  meta_id mediumint(8) unsigned not null auto_increment,
659
  value_type varchar(25) null,
663
  PRIMARY KEY (meta_id),
664
  KEY value_id (value_id),
665
  KEY meta_join (meta_key({$max_index_length}), meta_value({$max_index_length}))
666
+ ) {$charset_collate}";
667
 
668
  dbDelta( $sql );
669
  }
672
  /**
673
  * Base class to be extended by specific individual importers
674
  *
675
+ * @since 2.1.0 bbPress (r3813)
676
  */
677
  abstract class BBP_Converter_Base {
678
 
682
  protected $field_map = array();
683
 
684
  /**
685
+ * @var object This is the connection to the WordPress database.
686
  */
687
  protected $wpdb;
688
 
746
  }
747
 
748
  private function setup_globals() {
 
749
 
750
  /** Get database connections ******************************************/
751
 
752
+ $this->wpdb = bbp_db();
753
  $this->max_rows = (int) $_POST['_bbp_converter_rows'];
754
  $this->opdb = new wpdb( $_POST['_bbp_converter_db_user'], $_POST['_bbp_converter_db_pass'], $_POST['_bbp_converter_db_name'], $_POST['_bbp_converter_db_server'] );
755
  $this->opdb->prefix = $_POST['_bbp_converter_db_prefix'];
764
  * Syncing
765
  */
766
  $this->sync_table_name = $this->wpdb->prefix . 'bbp_converter_translator';
767
+ if ( $this->wpdb->get_var( "SHOW TABLES LIKE '" . $this->sync_table_name . "'" ) === $this->sync_table_name ) {
768
  $this->sync_table = true;
769
  } else {
770
  $this->sync_table = false;
771
  }
772
 
773
  /**
774
+ * Character set
775
  */
776
  if ( empty( $this->wpdb->charset ) ) {
777
  $this->charset = 'UTF8';
890
  }
891
 
892
  /**
893
+ * Convert Topic Tags
894
  */
895
  public function convert_tags( $start = 1 ) {
896
  return $this->convert_table( 'tags', $start );
897
  }
898
 
899
+ /**
900
+ * Convert Forum Subscriptions
901
+ */
902
+ public function convert_forum_subscriptions( $start = 1 ) {
903
+ return $this->convert_table( 'forum_subscriptions', $start );
904
+ }
905
+
906
+ /**
907
+ * Convert Topic Subscriptions
908
+ */
909
+ public function convert_topic_subscriptions( $start = 1 ) {
910
+ return $this->convert_table( 'topic_subscriptions', $start );
911
+ }
912
+
913
+ /**
914
+ * Convert Favorites
915
+ */
916
+ public function convert_favorites( $start = 1 ) {
917
+ return $this->convert_table( 'favorites', $start );
918
+ }
919
+
920
  /**
921
  * Convert Table
922
  *
926
  public function convert_table( $to_type, $start ) {
927
 
928
  // Are we usig a sync table, or postmeta?
929
+ if ( $this->wpdb->get_var( "SHOW TABLES LIKE '" . $this->sync_table_name . "'" ) === $this->sync_table_name ) {
930
  $this->sync_table = true;
931
  } else {
932
  $this->sync_table = false;
947
  $tablename = '';
948
  break;
949
 
950
+ case 'forum_subscriptions' :
951
+ $tablename = $this->wpdb->postmeta;
952
+ break;
953
+
954
+ case 'topic_subscriptions' :
955
+ $tablename = $this->wpdb->postmeta;
956
+ break;
957
+
958
+ case 'favorites' :
959
+ $tablename = $this->wpdb->postmeta;
960
+ break;
961
+
962
  default :
963
  $tablename = $this->wpdb->posts;
964
  }
965
 
966
  // Get the fields from the destination table
967
+ if ( ! empty( $tablename ) ) {
968
  $tablefield_array = $this->get_fields( $tablename );
969
  }
970
 
974
  foreach ( $this->field_map as $item ) {
975
 
976
  // Yay a match, and we have a from table, too
977
+ if ( ( $item['to_type'] === $to_type ) && ! empty( $item['from_tablename'] ) ) {
978
 
979
  // $from_tablename was set from a previous loop iteration
980
  if ( ! empty( $from_tablename ) ) {
981
 
982
  // Doing some joining
983
+ if ( ! in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) {
984
  $from_tablename .= ' ' . $item['join_type'] . ' JOIN ' . $this->opdb->prefix . $item['from_tablename'] . ' AS ' . $item['from_tablename'] . ' ' . $item['join_expression'];
985
  }
986
 
990
  }
991
 
992
  // Specific FROM expression data used
993
+ if ( ! empty( $item['from_expression'] ) ) {
994
 
995
  // No 'WHERE' in expression
996
  if ( stripos( $from_tablename, "WHERE" ) === false ) {
1011
  /** Step 2 ************************************************************/
1012
 
1013
  // We have a $from_tablename, so we want to get some data to convert
1014
+ if ( ! empty( $from_tablename ) ) {
1015
 
1016
  // Get some data from the old forums
1017
  $field_list = array_unique( $field_list );
1018
+ $fields = implode( ',', $field_list );
1019
+ $forum_query = "SELECT {$fields} FROM {$this->opdb->prefix}{$from_tablename} LIMIT {$start}, {$this->max_rows}";
1020
  $forum_array = $this->opdb->get_results( $forum_query, ARRAY_A );
1021
 
1022
  // Set this query as the last one ran
1023
  update_option( '_bbp_converter_query', $forum_query );
1024
 
1025
  // Query returned some results
1026
+ if ( ! empty( $forum_array ) ) {
1027
 
1028
  // Loop through results
1029
  foreach ( (array) $forum_array as $forum ) {
1034
  // Loop through field map, again...
1035
  foreach ( $this->field_map as $row ) {
1036
 
1037
+ // Types match and to_fieldname is present. This means
1038
  // we have some work to do here.
1039
+ if ( ( $row['to_type'] === $to_type ) && isset( $row['to_fieldname'] ) ) {
1040
 
1041
  // This row has a destination that matches one of the
1042
  // columns in this table.
1044
 
1045
  // Allows us to set default fields.
1046
  if ( isset( $row['default'] ) ) {
1047
+ $insert_post[ $row['to_fieldname'] ] = $row['default'];
1048
 
1049
  // Translates a field from the old forum.
1050
  } elseif ( isset( $row['callback_method'] ) ) {
1051
+ if ( ( 'callback_userid' === $row['callback_method'] ) && empty( $_POST['_bbp_converter_convert_users'] ) ) {
1052
+ $insert_post[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
1053
  } else {
1054
+ $insert_post[ $row['to_fieldname'] ] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[ $row['from_fieldname'] ], $forum ) );
1055
  }
1056
 
1057
  // Maps the field from the old forum.
1058
  } else {
1059
+ $insert_post[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
1060
  }
1061
 
1062
  // Destination field is not empty, so we might need
1063
  // to do some extra work or set a default.
1064
+ } elseif ( ! empty( $row['to_fieldname'] ) ) {
1065
 
1066
  // Allows us to set default fields.
1067
  if ( isset( $row['default'] ) ) {
1068
+ $insert_postmeta[ $row['to_fieldname'] ] = $row['default'];
1069
 
1070
  // Translates a field from the old forum.
1071
  } elseif ( isset( $row['callback_method'] ) ) {
1072
+ if ( ( $row['callback_method'] === 'callback_userid' ) && ( 0 == $_POST['_bbp_converter_convert_users'] ) ) {
1073
+ $insert_postmeta[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
1074
  } else {
1075
+ $insert_postmeta[ $row['to_fieldname'] ] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[ $row['from_fieldname'] ], $forum ) );
1076
  }
1077
 
1078
  // Maps the field from the old forum.
1079
  } else {
1080
+ $insert_postmeta[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
1081
  }
1082
  }
1083
  }
1127
  'slug' => $insert_postmeta['slug']
1128
  ) );
1129
  }
1130
+ break;
1131
+
1132
+ /** Forum Subscriptions ***************************/
1133
+
1134
+ case 'forum_subscriptions':
1135
+ $user_id = $insert_post['user_id'];
1136
+ $items = wp_list_pluck( $insert_postmeta, '_bbp_forum_subscriptions' );
1137
+ if ( is_numeric( $user_id ) && ! empty( $items ) ) {
1138
+ foreach ( $items as $value ) {
1139
+
1140
+ // Maybe string with commas
1141
+ $value = is_string( $value )
1142
+ ? explode( ',', $value )
1143
+ : (array) $value;
1144
+
1145
+ // Add user ID to forums subscribed users
1146
+ foreach ( $value as $fav ) {
1147
+ bbp_add_user_forum_subscription( $user_id, $this->callback_forumid( $fav ) );
1148
+ }
1149
+ }
1150
+ }
1151
+ break;
1152
+
1153
+ /** Subscriptions *********************************/
1154
+
1155
+ case 'topic_subscriptions':
1156
+ $user_id = $insert_post['user_id'];
1157
+ $items = wp_list_pluck( $insert_postmeta, '_bbp_subscriptions' );
1158
+ if ( is_numeric( $user_id ) && ! empty( $items ) ) {
1159
+ foreach ( $items as $value ) {
1160
+
1161
+ // Maybe string with commas
1162
+ $value = is_string( $value )
1163
+ ? explode( ',', $value )
1164
+ : (array) $value;
1165
+
1166
+ // Add user ID to topics subscribed users
1167
+ foreach ( $value as $fav ) {
1168
+ bbp_add_user_topic_subscription( $user_id, $this->callback_topicid( $fav ) );
1169
+ }
1170
+ }
1171
+ }
1172
+ break;
1173
+
1174
+ /** Favorites *************************************/
1175
+
1176
+ case 'favorites':
1177
+ $user_id = $insert_post['user_id'];
1178
+ $items = wp_list_pluck( $insert_postmeta, '_bbp_favorites' );
1179
+ if ( is_numeric( $user_id ) && ! empty( $items ) ) {
1180
+ foreach ( $items as $value ) {
1181
+
1182
+ // Maybe string with commas
1183
+ $value = is_string( $value )
1184
+ ? explode( ',', $value )
1185
+ : (array) $value;
1186
+
1187
+ // Add user ID to topics favorited users
1188
+ foreach ( $value as $fav ) {
1189
+ bbp_add_user_favorite( $user_id, $this->callback_topicid( $fav ) );
1190
+ }
1191
+ }
1192
+ }
1193
+ break;
1194
 
1195
  /** Forum, Topic, Reply ***************************/
1196
 
1203
 
1204
  add_post_meta( $post_id, $key, $value, true );
1205
 
1206
+ /**
1207
+ * If we are using the sync_table add
1208
+ * the meta '_id' keys to the table
1209
+ *
1210
+ * Forums: _bbp_old_forum_id // The old forum ID
1211
+ * _bbp_old_forum_parent_id // The old forum parent ID
1212
+ *
1213
+ * Topics: _bbp_forum_id // The new forum ID
1214
+ * _bbp_old_topic_id // The old topic ID
1215
+ * _bbp_old_closed_status_id // The old topic open/closed status
1216
+ * _bbp_old_sticky_status_id // The old topic sticky status
1217
+ *
1218
+ * Replies: _bbp_forum_id // The new forum ID
1219
+ * _bbp_topic_id // The new topic ID
1220
+ * _bbp_old_reply_id // The old reply ID
1221
+ * _bbp_old_reply_to_id // The old reply to ID
1222
+ */
1223
+ if ( '_id' === substr( $key, -3 ) && ( true === $this->sync_table ) ) {
 
1224
  $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
1225
  }
1226
 
1227
+ /**
1228
+ * Replies need to save their old reply_to ID for
1229
+ * hierarchical replies association. Later we update
1230
+ * the _bbp_reply_to value with the new bbPress
1231
+ * value using convert_reply_to_parents()
1232
+ */
1233
+ if ( ( 'reply' === $to_type ) && ( '_bbp_old_reply_to_id' === $key ) ) {
1234
+ add_post_meta( $post_id, '_bbp_reply_to', $value );
1235
  }
1236
  }
1237
  }
1253
 
1254
  $has_update = false;
1255
 
1256
+ if ( ! empty( $this->sync_table ) ) {
1257
+ $query = $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value > 0 LIMIT {$start}, {$this->max_rows}", '_bbp_old_forum_parent_id' );
1258
  } else {
1259
+ $query = $this->wpdb->prepare( "SELECT post_id AS value_id, meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value > 0 LIMIT {$start}, {$this->max_rows}", '_bbp_old_forum_parent_id' );
1260
  }
1261
 
1262
  update_option( '_bbp_converter_query', $query );
1265
 
1266
  foreach ( (array) $forum_array as $row ) {
1267
  $parent_id = $this->callback_forumid( $row->meta_value );
1268
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->posts} SET post_parent = %d WHERE ID = %d LIMIT 1", $parent_id, $row->value_id ) );
1269
  $has_update = true;
1270
  }
1271
 
1275
  /**
1276
  * This method converts old topic stickies to new bbPress stickies.
1277
  *
1278
+ * @since 2.5.0 bbPress (r5170)
1279
  *
1280
  * @uses WPDB $wpdb
1281
  * @uses bbp_stick_topic() to set the imported topic as sticky
1285
 
1286
  $has_update = false;
1287
 
1288
+ if ( ! empty( $this->sync_table ) ) {
1289
+ $query = $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT {$start}, {$this->max_rows}", '_bbp_old_sticky_status_id', 'sticky' );
1290
  } else {
1291
+ $query = $this->wpdb->prepare( "SELECT post_id AS value_id, meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s LIMIT {$start}, {$this->max_rows}", '_bbp_old_sticky_status_id', 'sticky' );
1292
  }
1293
 
1294
  update_option( '_bbp_converter_query', $query );
1306
  /**
1307
  * This method converts old topic super stickies to new bbPress super stickies.
1308
  *
1309
+ * @since 2.5.0 bbPress (r5170)
1310
  *
1311
  * @uses WPDB $wpdb
1312
  * @uses bbp_stick_topic() to set the imported topic as super sticky
1316
 
1317
  $has_update = false;
1318
 
1319
+ if ( ! empty( $this->sync_table ) ) {
1320
+ $query = $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT {$start}, {$this->max_rows}", '_bbp_old_sticky_status_id', 'super-sticky' );
1321
  } else {
1322
+ $query = $this->wpdb->prepare( "SELECT post_id AS value_id, meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s LIMIT {$start}, {$this->max_rows}", '_bbp_old_sticky_status_id', 'super-sticky' );
1323
  }
1324
 
1325
  update_option( '_bbp_converter_query', $query );
1335
  return ! $has_update;
1336
  }
1337
 
1338
+ /**
1339
+ * This method converts old closed topics to bbPress closed topics.
1340
+ *
1341
+ * @since 2.6.0 bbPress (r5425)
1342
+ *
1343
+ * @uses bbp_close_topic() to close topics properly
1344
+ *
1345
+ */
1346
+ public function convert_topic_closed_topics( $start ) {
1347
+
1348
+ $has_update = false;
1349
+
1350
+ if ( ! empty( $this->sync_table ) ) {
1351
+ $query = $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT {$start}, {$this->max_rows}", '_bbp_old_closed_status_id', 'closed' );
1352
+ } else {
1353
+ $query = $this->wpdb->prepare( "SELECT post_id AS value_id, meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s LIMIT {$start}, {$this->max_rows}", '_bbp_old_closed_status_id', 'closed' );
1354
+ }
1355
+
1356
+ update_option( '_bbp_converter_query', $query );
1357
+
1358
+ $closed_topic = $this->wpdb->get_results( $query );
1359
+
1360
+ foreach ( (array) $closed_topic as $row ) {
1361
+ bbp_close_topic( $row->value_id );
1362
+ $has_update = true;
1363
+ }
1364
+
1365
+ return ! $has_update;
1366
+ }
1367
+
1368
  /**
1369
  * This method converts old reply_to post id to new bbPress reply_to post id.
1370
+ *
1371
+ * @since 2.4.0 bbPress (r5093)
1372
  */
1373
  public function convert_reply_to_parents( $start ) {
1374
 
1375
  $has_update = false;
1376
 
1377
+ if ( ! empty( $this->sync_table ) ) {
1378
+ $query = $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value > 0 LIMIT {$start}, {$this->max_rows}", '_bbp_old_reply_to_id' );
1379
  } else {
1380
+ $query = $this->wpdb->prepare( "SELECT post_id AS value_id, meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value > 0 LIMIT {$start}, {$this->max_rows}", '_bbp_old_reply_to_id' );
1381
  }
1382
 
1383
  update_option( '_bbp_converter_query', $query );
1386
 
1387
  foreach ( (array) $reply_to_array as $row ) {
1388
  $reply_to = $this->callback_reply_to( $row->meta_value );
1389
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->postmeta} SET meta_value = %s WHERE meta_key = %s AND post_id = %d LIMIT 1", $reply_to, '_bbp_reply_to', $row->value_id ) );
1390
+ $has_update = true;
1391
+ }
1392
+
1393
+ return ! $has_update;
1394
+ }
1395
+
1396
+ /**
1397
+ * This method converts anonymous topics.
1398
+ *
1399
+ * @since 2.6.0 bbPress (r5538)
1400
+ *
1401
+ * @uses add_post_meta() To add _bbp_anonymous_name topic meta key
1402
+ */
1403
+ public function convert_anonymous_topic_authors( $start ) {
1404
+
1405
+ $has_update = false;
1406
+
1407
+ if ( ! empty( $this->sync_table ) ) {
1408
+ $query = $this->wpdb->prepare( "SELECT sync_table1.value_id AS topic_id, sync_table1.meta_value AS topic_is_anonymous, sync_table2.meta_value AS topic_author
1409
+ FROM {$this->sync_table_name} AS sync_table1
1410
+ INNER JOIN {$this->sync_table_name} AS sync_table2
1411
+ ON ( sync_table1.value_id = sync_table2.value_id )
1412
+ WHERE sync_table1.meta_value = %s
1413
+ AND sync_table2.meta_key = %s
1414
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_topic_author_name_id' );
1415
+ } else {
1416
+ $query = $this->wpdb->prepare( "SELECT wp_postmeta1.post_id AS topic_id, wp_postmeta1.meta_value AS topic_is_anonymous, wp_postmeta2.meta_value AS topic_author
1417
+ FROM {$this->wpdb->postmeta} AS wp_postmeta1
1418
+ INNER JOIN {$this->wpdb->postmeta} AS wp_postmeta2
1419
+ ON ( wp_postmeta1.post_id = wp_postmeta2.post_id )
1420
+ WHERE wp_postmeta1.meta_value = %s
1421
+ AND wp_postmeta2.meta_key = %s
1422
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_topic_author_name_id' );
1423
+
1424
+ }
1425
+
1426
+ update_option( '_bbp_converter_query', $query );
1427
+
1428
+ $anonymous_topics = $this->wpdb->get_results( $query );
1429
+
1430
+ foreach ( (array) $anonymous_topics as $row ) {
1431
+ $anonymous_topic_author_id = 0;
1432
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->posts} SET post_author = %d WHERE ID = %d LIMIT 1", $anonymous_topic_author_id, $row->topic_id ) );
1433
+
1434
+ add_post_meta( $row->topic_id, '_bbp_anonymous_name', $row->topic_author );
1435
+
1436
+ $has_update = true;
1437
+ }
1438
+
1439
+ return ! $has_update;
1440
+ }
1441
+
1442
+ /**
1443
+ * This method converts anonymous replies.
1444
+ *
1445
+ * @since 2.6.0 bbPress (r5538)
1446
+ *
1447
+ * @uses add_post_meta() To add _bbp_anonymous_name reply meta key
1448
+ */
1449
+ public function convert_anonymous_reply_authors( $start ) {
1450
+
1451
+ $has_update = false;
1452
+
1453
+ if ( ! empty( $this->sync_table ) ) {
1454
+ $query = $this->wpdb->prepare( "SELECT sync_table1.value_id AS reply_id, sync_table1.meta_value AS reply_is_anonymous, sync_table2.meta_value AS reply_author
1455
+ FROM {$this->sync_table_name} AS sync_table1
1456
+ INNER JOIN {$this->sync_table_name} AS sync_table2
1457
+ ON ( sync_table1.value_id = sync_table2.value_id )
1458
+ WHERE sync_table1.meta_value = %s
1459
+ AND sync_table2.meta_key = %s
1460
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_reply_author_name_id' );
1461
+ } else {
1462
+ $query = $this->wpdb->prepare( "SELECT wp_postmeta1.post_id AS reply_id, wp_postmeta1.meta_value AS reply_is_anonymous, wp_postmeta2.meta_value AS reply_author
1463
+ FROM {$this->wpdb->postmeta} AS wp_postmeta1
1464
+ INNER JOIN {$this->wpdb->postmeta} AS wp_postmeta2
1465
+ ON ( wp_postmeta1.post_id = wp_postmeta2.post_id )
1466
+ WHERE wp_postmeta1.meta_value = %s
1467
+ AND wp_postmeta2.meta_key = %s
1468
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_reply_author_name_id' );
1469
+
1470
+ }
1471
+
1472
+ update_option( '_bbp_converter_query', $query );
1473
+
1474
+ $anonymous_replies = $this->wpdb->get_results( $query );
1475
+
1476
+ foreach ( (array) $anonymous_replies as $row ) {
1477
+ $anonymous_reply_author_id = 0;
1478
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->posts} SET post_author = %d WHERE ID = %d LIMIT 1", $anonymous_reply_author_id, $row->reply_id ) );
1479
+
1480
+ add_post_meta( $row->reply_id, '_bbp_anonymous_name', $row->reply_author );
1481
+
1482
  $has_update = true;
1483
  }
1484
 
1496
  /** Delete bbconverter topics/forums/posts ****************************/
1497
 
1498
  if ( true === $this->sync_table ) {
1499
+ $query = $this->wpdb->prepare( "SELECT value_id FROM {$this->sync_table_name} INNER JOIN {$this->wpdb->posts} ON(value_id = ID) WHERE meta_key LIKE '_bbp_%' AND value_type = %s GROUP BY value_id ORDER BY value_id DESC LIMIT {$this->max_rows}", 'post' );
1500
  } else {
1501
+ $query = $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key LIKE '_bbp_%' GROUP BY post_id ORDER BY post_id DESC LIMIT {$this->max_rows}" );
1502
  }
1503
 
1504
  update_option( '_bbp_converter_query', $query );
1515
  /** Delete bbconverter users ******************************************/
1516
 
1517
  if ( true === $this->sync_table ) {
1518
+ $query = $this->wpdb->prepare( "SELECT value_id FROM {$this->sync_table_name} INNER JOIN {$this->wpdb->users} ON(value_id = ID) WHERE meta_key = %s AND value_type = %s LIMIT {$this->max_rows}", '_bbp_old_user_id', 'user' );
1519
  } else {
1520
+ $query = $this->wpdb->prepare( "SELECT user_id AS value_id FROM {$this->wpdb->usermeta} WHERE meta_key = %s LIMIT {$this->max_rows}", '_bbp_old_user_id' );
1521
  }
1522
 
1523
  update_option( '_bbp_converter_query', $query );
1524
 
1525
  $users = $this->wpdb->get_results( $query, ARRAY_A );
1526
 
1527
+ if ( ! empty( $users ) ) {
1528
  foreach ( $users as $value ) {
1529
  wp_delete_user( $value['value_id'] );
1530
  }
1548
 
1549
  /** Delete bbconverter passwords **************************************/
1550
 
1551
+ $query = $this->wpdb->prepare( "SELECT user_id, meta_value FROM {$this->wpdb->usermeta} WHERE meta_key = %s LIMIT {$start}, {$this->max_rows}", '_bbp_password' );
1552
  update_option( '_bbp_converter_query', $query );
1553
 
1554
  $bbconverter = $this->wpdb->get_results( $query, ARRAY_A );
1555
 
1556
+ if ( ! empty( $bbconverter ) ) {
1557
 
1558
  foreach ( $bbconverter as $value ) {
1559
  if ( is_serialized( $value['meta_value'] ) ) {
1560
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->users} SET user_pass = '' WHERE ID = %d", $value['user_id'] ) );
1561
  } else {
1562
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->users} SET user_pass = %s WHERE ID = %d", $value['meta_value'], $value['user_id'] ) );
1563
+ $this->wpdb->query( $this->wpdb->prepare( "DELETE FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND user_id = %d", '_bbp_password', $value['user_id'] ) );
1564
  }
1565
  }
1566
  $has_delete = true;
1594
  $rval[] = $field['Field'];
1595
  }
1596
 
1597
+ if ( $tablename === $this->wpdb->users ) {
1598
  $rval[] = 'role';
1599
  $rval[] = 'yim';
1600
  $rval[] = 'aim';
1601
  $rval[] = 'jabber';
1602
  }
1603
+
1604
  return $rval;
1605
  }
1606
 
1613
  * @param string $password
1614
  */
1615
  public function callback_pass( $username, $password ) {
1616
+ $user = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT * FROM {$this->wpdb->users} WHERE user_login = %s AND user_pass = '' LIMIT 1", $username ) );
1617
+ if ( ! empty( $user ) ) {
1618
+ $usermeta = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT * FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND user_id = %d LIMIT 1", '_bbp_password', $user->ID ) );
1619
 
1620
+ if ( ! empty( $usermeta ) ) {
1621
  if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
1622
+ $this->wpdb->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->users} SET user_pass = %s WHERE ID = %d", wp_hash_password( $password ), $user->ID ) );
1623
+ $this->wpdb->query( $this->wpdb->prepare( "DELETE FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND user_id = %d", '_bbp_password', $user->ID ) );
1624
  }
1625
  }
1626
  }
1633
  * @return string
1634
  */
1635
  private function callback_forumid( $field ) {
1636
+ if ( ! isset( $this->map_forumid[ $field ] ) ) {
1637
+ if ( ! empty( $this->sync_table ) ) {
1638
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_forum_id', $field ) );
1639
  } else {
1640
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_forum_id', $field ) );
1641
  }
1642
 
1643
+ if ( ! is_null( $row ) ) {
1644
+ $this->map_forumid[ $field ] = $row->value_id;
1645
  } else {
1646
+ $this->map_forumid[ $field ] = 0;
1647
  }
1648
  }
1649
+ return $this->map_forumid[ $field ];
1650
  }
1651
 
1652
  /**
1656
  * @return string
1657
  */
1658
  private function callback_topicid( $field ) {
1659
+ if ( ! isset( $this->map_topicid[ $field ] ) ) {
1660
+ if ( ! empty( $this->sync_table ) ) {
1661
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_topic_id', $field ) );
1662
  } else {
1663
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_topic_id', $field ) );
1664
  }
1665
 
1666
+ if ( ! is_null( $row ) ) {
1667
+ $this->map_topicid[ $field ] = $row->value_id;
1668
  } else {
1669
+ $this->map_topicid[ $field ] = 0;
1670
  }
1671
  }
1672
+ return $this->map_topicid[ $field ];
1673
  }
1674
 
1675
  /**
1676
  * A mini cache system to reduce database calls to reply_to post id.
1677
  *
1678
+ * @since 2.4.0 bbPress (r5093)
1679
+ *
1680
  * @param string $field
1681
  * @return string
1682
  */
1683
  private function callback_reply_to( $field ) {
1684
+ if ( ! isset( $this->map_reply_to[ $field ] ) ) {
1685
+ if ( ! empty( $this->sync_table ) ) {
1686
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_reply_id', $field ) );
1687
  } else {
1688
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_reply_id', $field ) );
1689
  }
1690
 
1691
+ if ( ! is_null( $row ) ) {
1692
+ $this->map_reply_to[ $field ] = $row->value_id;
1693
  } else {
1694
+ $this->map_reply_to[ $field ] = 0;
1695
  }
1696
  }
1697
+ return $this->map_reply_to[ $field ];
1698
  }
1699
 
1700
  /**
1704
  * @return string
1705
  */
1706
  private function callback_userid( $field ) {
1707
+ if ( ! isset( $this->map_userid[ $field ] ) ) {
1708
+ if ( ! empty( $this->sync_table ) ) {
1709
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_user_id', $field ) );
1710
  } else {
1711
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT user_id AS value_id FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_user_id', $field ) );
1712
  }
1713
 
1714
+ if ( ! is_null( $row ) ) {
1715
+ $this->map_userid[ $field ] = $row->value_id;
1716
  } else {
1717
+ if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( (int) $_POST['_bbp_converter_convert_users'] === 1 ) ) {
1718
+ $this->map_userid[ $field ] = 0;
1719
  } else {
1720
+ $this->map_userid[ $field ] = $field;
1721
  }
1722
  }
1723
  }
1724
+ return $this->map_userid[ $field ];
1725
+ }
1726
+
1727
+ /**
1728
+ * Check if the topic or reply author is anonymous
1729
+ *
1730
+ * @since 2.6.0 bbPress (r5544)
1731
+ *
1732
+ * @param string $field
1733
+ * @return string
1734
+ */
1735
+ private function callback_check_anonymous( $field ) {
1736
+
1737
+ if ( $this->callback_userid( $field ) == 0 ) {
1738
+ $field = 'true';
1739
+ } else {
1740
+ $field = 'false';
1741
+ }
1742
+
1743
+ return $field;
1744
  }
1745
 
1746
  /**
1752
  private function callback_topicid_to_forumid( $field ) {
1753
  $topicid = $this->callback_topicid( $field );
1754
  if ( empty( $topicid ) ) {
1755
+ $this->map_topicid_to_forumid[ $topicid ] = 0;
1756
+ } elseif ( ! isset( $this->map_topicid_to_forumid[ $topicid ] ) ) {
1757
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT post_parent FROM {$this->wpdb->posts} WHERE ID = %d LIMIT 1", $topicid ) );
1758
 
1759
+ if ( ! is_null( $row ) ) {
1760
+ $this->map_topicid_to_forumid[ $topicid ] = $row->post_parent;
1761
  } else {
1762
+ $this->map_topicid_to_forumid[ $topicid ] = 0;
1763
  }
1764
  }
1765
 
1766
+ return $this->map_topicid_to_forumid[ $topicid ];
1767
  }
1768
 
1769
  protected function callback_slug( $field ) {
1815
  while ( $file = readdir( $curdir ) ) {
1816
  if ( stristr( $file, '.php' ) && stristr( $file, 'index' ) === FALSE ) {
1817
  $file = preg_replace( '/.php/', '', $file );
1818
+ if ( $platform === $file ) {
1819
  $found = true;
1820
  continue;
1821
  }
includes/admin/converters/AEF.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class AEF extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class AEF extends BBP_Converter_Base {
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)
@@ -107,6 +115,13 @@ class AEF extends BBP_Converter_Base {
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',
@@ -140,12 +155,12 @@ class AEF extends BBP_Converter_Base {
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)
@@ -239,12 +254,12 @@ class AEF extends BBP_Converter_Base {
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
 
@@ -306,7 +321,7 @@ class AEF extends BBP_Converter_Base {
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
 
@@ -318,12 +333,12 @@ class AEF extends BBP_Converter_Base {
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)
@@ -361,32 +376,6 @@ class AEF extends BBP_Converter_Base {
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',
@@ -437,15 +426,15 @@ class AEF extends BBP_Converter_Base {
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',
@@ -454,7 +443,7 @@ class AEF extends BBP_Converter_Base {
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',
@@ -515,7 +504,7 @@ class AEF extends BBP_Converter_Base {
515
  'from_tablename' => 'users',
516
  'from_fieldname' => 'aim',
517
  'to_type' => 'user',
518
- 'to_fieldname' => 'aim'
519
  );
520
 
521
  // User Yahoo (Stored in usermeta)
@@ -523,7 +512,7 @@ class AEF extends BBP_Converter_Base {
523
  'from_tablename' => 'users',
524
  'from_fieldname' => 'yim',
525
  'to_type' => 'user',
526
- 'to_fieldname' => 'yim'
527
  );
528
 
529
  // Store ICQ (Stored in usermeta)
@@ -677,15 +666,4 @@ class AEF extends BBP_Converter_Base {
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
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress AEF Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of AEF Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5139)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/aef
16
  */
17
  class AEF extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'fid',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'forums',
47
  'from_fieldname' => 'par_board_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
115
  'to_fieldname' => 'menu_order'
116
  );
117
 
118
+ // Forum type (Set a default value 'forum', Stored in postmeta)
119
+ $this->field_map[] = array(
120
+ 'to_type' => 'forum',
121
+ 'to_fieldname' => '_bbp_forum_type',
122
+ 'default' => 'forum'
123
+ );
124
+
125
  // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta)
126
  $this->field_map[] = array(
127
  'from_tablename' => 'forums',
155
 
156
  /** Topic Section *****************************************************/
157
 
158
+ // Old topic id (Stored in postmeta)
159
  $this->field_map[] = array(
160
  'from_tablename' => 'topics',
161
  'from_fieldname' => 'tid',
162
  'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
  );
165
 
166
  // Topic reply count (Stored in postmeta)
254
  'callback_method' => 'callback_forumid'
255
  );
256
 
257
+ // Sticky status (Stored in postmeta)
258
  $this->field_map[] = array(
259
  'from_tablename' => 'topics',
260
  'from_fieldname' => 't_sticky',
261
  'to_type' => 'topic',
262
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
263
  'callback_method' => 'callback_sticky_status'
264
  );
265
 
321
  'from_tablename' => 'topics',
322
  'from_fieldname' => 't_status',
323
  'to_type' => 'topic',
324
+ 'to_fieldname' => '_bbp_old_closed_status_id',
325
  'callback_method' => 'callback_topic_status'
326
  );
327
 
333
 
334
  /** Reply Section *****************************************************/
335
 
336
+ // Old reply id (Stored in postmeta)
337
  $this->field_map[] = array(
338
  'from_tablename' => 'posts',
339
  'from_fieldname' => 'pid',
340
  'to_type' => 'reply',
341
+ 'to_fieldname' => '_bbp_old_reply_id'
342
  );
343
 
344
  // Reply parent forum id (If no parent, then 0, Stored in postmeta)
376
  'callback_method' => 'callback_userid'
377
  );
378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  // Reply content.
380
  $this->field_map[] = array(
381
  'from_tablename' => 'posts',
426
 
427
  /** User Section ******************************************************/
428
 
429
+ // Store old user id (Stored in usermeta)
430
  $this->field_map[] = array(
431
  'from_tablename' => 'users',
432
  'from_fieldname' => 'id',
433
  'to_type' => 'user',
434
+ 'to_fieldname' => '_bbp_old_user_id'
435
  );
436
 
437
+ // Store old user password (Stored in usermeta serialized with salt)
438
  $this->field_map[] = array(
439
  'from_tablename' => 'users',
440
  'from_fieldname' => 'password',
443
  'callback_method' => 'callback_savepass'
444
  );
445
 
446
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
447
  $this->field_map[] = array(
448
  'from_tablename' => 'users',
449
  'from_fieldname' => 'salt',
504
  'from_tablename' => 'users',
505
  'from_fieldname' => 'aim',
506
  'to_type' => 'user',
507
+ 'to_fieldname' => '_bbp_aef_user_aim'
508
  );
509
 
510
  // User Yahoo (Stored in usermeta)
512
  'from_tablename' => 'users',
513
  'from_fieldname' => 'yim',
514
  'to_type' => 'user',
515
+ 'to_fieldname' => '_bbp_aef_user_yim'
516
  );
517
 
518
  // Store ICQ (Stored in usermeta)
666
  $count = absint( (int) $count - 1 );
667
  return $count;
668
  }
669
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Drupal7.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Drupal v7.x Forum converter.
5
  *
6
- * @since bbPress (r5138)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/drupal
 
8
  */
9
  class Drupal7 extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class Drupal7 extends BBP_Converter_Base {
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)
@@ -42,7 +50,7 @@ class Drupal7 extends BBP_Converter_Base {
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.
@@ -79,6 +87,20 @@ class Drupal7 extends BBP_Converter_Base {
79
  'to_fieldname' => 'menu_order'
80
  );
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  // Forum dates.
83
  $this->field_map[] = array(
84
  'to_type' => 'forum',
@@ -103,12 +125,12 @@ class Drupal7 extends BBP_Converter_Base {
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)
@@ -151,6 +173,25 @@ class Drupal7 extends BBP_Converter_Base {
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(
@@ -190,12 +231,24 @@ class Drupal7 extends BBP_Converter_Base {
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
 
@@ -244,7 +297,7 @@ class Drupal7 extends BBP_Converter_Base {
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
 
@@ -303,22 +356,18 @@ class Drupal7 extends BBP_Converter_Base {
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'
@@ -338,7 +387,7 @@ class Drupal7 extends BBP_Converter_Base {
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)
@@ -358,21 +407,30 @@ class Drupal7 extends BBP_Converter_Base {
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.
@@ -429,15 +487,17 @@ class Drupal7 extends BBP_Converter_Base {
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',
@@ -446,7 +506,7 @@ class Drupal7 extends BBP_Converter_Base {
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',
@@ -534,6 +594,27 @@ class Drupal7 extends BBP_Converter_Base {
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
  *
@@ -584,4 +665,4 @@ class Drupal7 extends BBP_Converter_Base {
584
  $count = absint( (int) $count - 1 );
585
  return $count;
586
  }
587
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress Drupal7 Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Drupal v7.x Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5138)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/drupal
16
  */
17
  class Drupal7 extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'taxonomy_term_data',
39
  'from_fieldname' => 'tid',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
50
  'join_expression' => 'USING (tid)',
51
  'from_expression' => 'LEFT JOIN taxonomy_vocabulary AS taxonomy_vocabulary USING (vid) WHERE module = "forum"',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum title.
87
  'to_fieldname' => 'menu_order'
88
  );
89
 
90
+ // Forum type (Set a default value 'forum', Stored in postmeta)
91
+ $this->field_map[] = array(
92
+ 'to_type' => 'forum',
93
+ 'to_fieldname' => '_bbp_forum_type',
94
+ 'default' => 'forum'
95
+ );
96
+
97
+ // Forum status (Set a default value 'open', Stored in postmeta)
98
+ $this->field_map[] = array(
99
+ 'to_type' => 'forum',
100
+ 'to_fieldname' => '_bbp_status',
101
+ 'default' => 'open'
102
+ );
103
+
104
  // Forum dates.
105
  $this->field_map[] = array(
106
  'to_type' => 'forum',
125
 
126
  /** Topic Section *****************************************************/
127
 
128
+ // Old topic id (Stored in postmeta)
129
  $this->field_map[] = array(
130
  'from_tablename' => 'forum_index',
131
  'from_fieldname' => 'nid',
132
  'to_type' => 'topic',
133
+ 'to_fieldname' => '_bbp_old_topic_id'
134
  );
135
 
136
  // Topic reply count (Stored in postmeta)
173
  'callback_method' => 'callback_userid'
174
  );
175
 
176
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
177
+ $this->field_map[] = array(
178
+ 'to_type' => 'topic',
179
+ 'to_fieldname' => '_bbp_old_topic_author_name_id',
180
+ 'default' => 'Anonymous'
181
+ );
182
+
183
+ // Is the topic anonymous (Stored in postmeta)
184
+ $this->field_map[] = array(
185
+ 'from_tablename' => 'node',
186
+ 'from_fieldname' => 'uid',
187
+ 'join_tablename' => 'forum_index',
188
+ 'join_type' => 'INNER',
189
+ 'join_expression' => 'ON node.nid = forum_index.nid',
190
+ 'to_type' => 'topic',
191
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
192
+ 'callback_method' => 'callback_check_anonymous'
193
+ );
194
+
195
  // Topic content.
196
  // Note: We join the 'field_data_body' table because 'node' or 'forum_index' table does not include topic content.
197
  $this->field_map[] = array(
231
  'callback_method' => 'callback_forumid'
232
  );
233
 
234
+ // Topic status (Publish or Unpublished, Drupal v7.x publish = 1, pending = 0)
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'node',
237
+ 'from_fieldname' => 'status',
238
+ 'join_tablename' => 'forum_index',
239
+ 'join_type' => 'INNER',
240
+ 'join_expression' => 'ON node.nid = forum_index.nid',
241
+ 'to_type' => 'topic',
242
+ 'to_fieldname' => 'post_status',
243
+ 'callback_method' => 'callback_status'
244
+ );
245
+
246
+ // Sticky status (Stored in postmeta)
247
  $this->field_map[] = array(
248
  'from_tablename' => 'forum_index',
249
  'from_fieldname' => 'sticky',
250
  'to_type' => 'topic',
251
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
252
  'callback_method' => 'callback_sticky_status'
253
  );
254
 
297
  'join_type' => 'INNER',
298
  'join_expression' => 'ON node.nid = forum_index.nid',
299
  'to_type' => 'topic',
300
+ 'to_fieldname' => '_bbp_old_closed_status_id',
301
  'callback_method' => 'callback_topic_status'
302
  );
303
 
356
 
357
  /** Reply Section *****************************************************/
358
 
359
+ // Old reply id (Stored in postmeta)
360
  $this->field_map[] = array(
361
  'from_tablename' => 'comment',
362
  'from_fieldname' => 'cid',
363
  'to_type' => 'reply',
364
+ 'to_fieldname' => '_bbp_old_reply_id'
365
  );
366
 
367
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
 
368
  $this->field_map[] = array(
369
+ 'from_tablename' => 'comment',
370
+ 'from_fieldname' => 'nid',
 
 
 
371
  'to_type' => 'reply',
372
  'to_fieldname' => '_bbp_forum_id',
373
  'callback_method' => 'callback_topicid_to_forumid'
387
  'from_tablename' => 'comment',
388
  'from_fieldname' => 'pid',
389
  'to_type' => 'reply',
390
+ 'to_fieldname' => '_bbp_old_reply_to_id'
391
  );
392
 
393
  // Reply author ip (Stored in postmeta)
407
  'callback_method' => 'callback_userid'
408
  );
409
 
410
+ // Reply status (Publish or Unpublished, Drupal v7.x publish = 1, pending = 0)
411
+ $this->field_map[] = array(
412
+ 'from_tablename' => 'comment',
413
+ 'from_fieldname' => 'status',
414
+ 'to_type' => 'reply',
415
+ 'to_fieldname' => 'post_status',
416
+ 'callback_method' => 'callback_status'
417
+ );
418
+
419
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
420
  $this->field_map[] = array(
421
  'from_tablename' => 'comment',
422
+ 'from_fieldname' => 'name',
423
  'to_type' => 'reply',
424
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
425
  );
426
 
427
+ // Is the reply anonymous (Stored in postmeta)
428
  $this->field_map[] = array(
429
  'from_tablename' => 'comment',
430
+ 'from_fieldname' => 'uid',
431
  'to_type' => 'reply',
432
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
433
+ 'callback_method' => 'callback_check_anonymous'
434
  );
435
 
436
  // Reply content.
487
 
488
  /** User Section ******************************************************/
489
 
490
+ // Store old user id (Stored in usermeta)
491
+ // Don't import user uid = 0, this is Drupal 7's guest user
492
  $this->field_map[] = array(
493
+ 'from_tablename' => 'users',
494
+ 'from_fieldname' => 'uid',
495
+ 'from_expression' => 'WHERE uid != 0',
496
+ 'to_type' => 'user',
497
+ 'to_fieldname' => '_bbp_old_user_id'
498
  );
499
 
500
+ // Store old user password (Stored in usermeta serialized with salt)
501
  $this->field_map[] = array(
502
  'from_tablename' => 'users',
503
  'from_fieldname' => 'pass',
506
  // 'callback_method' => 'callback_savepass'
507
  );
508
 
509
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
510
  $this->field_map[] = array(
511
  'from_tablename' => 'users',
512
  'from_fieldname' => 'pass',
594
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
595
  }
596
 
597
+ /**
598
+ * Translate the post status from Drupal v7.x numeric's to WordPress's
599
+ * strings.
600
+ *
601
+ * @param int $status Drupal v7.x numeric post status
602
+ * @return string WordPress safe
603
+ */
604
+ public function callback_status( $status = 1 ) {
605
+ switch ( $status ) {
606
+ case 0 :
607
+ $status = 'pending'; // bbp_get_pending_status_id()
608
+ break;
609
+
610
+ case 1 :
611
+ default :
612
+ $status = 'publish'; // bbp_get_public_status_id()
613
+ break;
614
+ }
615
+ return $status;
616
+ }
617
+
618
  /**
619
  * Translate the post status from Drupal v7.x numeric's to WordPress's strings.
620
  *
665
  $count = absint( (int) $count - 1 );
666
  return $count;
667
  }
668
+ }
includes/admin/converters/Example.php CHANGED
@@ -1,10 +1,18 @@
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
 
8
  */
9
  class Example extends BBP_Converter_Base {
10
 
@@ -27,12 +35,12 @@ class Example extends BBP_Converter_Base {
27
 
28
  // Setup table joins for the forum section at the base of this section
29
 
30
- // Forum id (Stored in postmeta)
31
  $this->field_map[] = array(
32
  'from_tablename' => 'forums_table',
33
  'from_fieldname' => 'the_forum_id',
34
  'to_type' => 'forum',
35
- 'to_fieldname' => '_bbp_forum_id'
36
  );
37
 
38
  // Forum parent id (If no parent, then 0. Stored in postmeta)
@@ -40,7 +48,7 @@ class Example extends BBP_Converter_Base {
40
  'from_tablename' => 'forums_table',
41
  'from_fieldname' => 'the_parent_id',
42
  'to_type' => 'forum',
43
- 'to_fieldname' => '_bbp_forum_parent_id'
44
  );
45
 
46
  // Forum topic count (Stored in postmeta)
@@ -109,6 +117,24 @@ class Example extends BBP_Converter_Base {
109
  'to_fieldname' => 'menu_order'
110
  );
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  // Forum dates.
113
  $this->field_map[] = array(
114
  'to_type' => 'forum',
@@ -142,16 +168,35 @@ class Example extends BBP_Converter_Base {
142
  'to_type' => 'forum'
143
  );
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  /** Topic Section *****************************************************/
146
 
147
  // Setup table joins for the topic section at the base of this section
148
 
149
- // Topic id (Stored in postmeta)
150
  $this->field_map[] = array(
151
  'from_tablename' => 'topics_table',
152
  'from_fieldname' => 'the_topic_id',
153
  'to_type' => 'topic',
154
- 'to_fieldname' => '_bbp_topic_id'
155
  );
156
 
157
  // Topic reply count (Stored in postmeta)
@@ -224,6 +269,15 @@ class Example extends BBP_Converter_Base {
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' => 'topics_table',
@@ -233,12 +287,12 @@ class Example extends BBP_Converter_Base {
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
 
@@ -346,16 +400,54 @@ class Example extends BBP_Converter_Base {
346
  'to_fieldname' => 'description'
347
  );
348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  /** Reply Section *****************************************************/
350
 
351
  // Setup table joins for the reply section at the base of this section
352
 
353
- // Reply id (Stored in postmeta)
354
  $this->field_map[] = array(
355
  'from_tablename' => 'replies_table',
356
  'from_fieldname' => 'the_reply_id',
357
  'to_type' => 'reply',
358
- 'to_fieldname' => '_bbp_post_id'
359
  );
360
 
361
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
@@ -364,7 +456,7 @@ class Example extends BBP_Converter_Base {
364
  'from_fieldname' => 'the_reply_parent_forum_id',
365
  'to_type' => 'reply',
366
  'to_fieldname' => '_bbp_forum_id',
367
- 'callback_method' => 'callback_topicid_to_forumid'
368
  );
369
 
370
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
@@ -393,22 +485,9 @@ class Example extends BBP_Converter_Base {
393
  'callback_method' => 'callback_userid'
394
  );
395
 
396
- // Reply title.
397
- $this->field_map[] = array(
398
- 'from_tablename' => 'replies_table',
399
- 'from_fieldname' => 'the_reply_title',
400
- 'to_type' => 'reply',
401
- 'to_fieldname' => 'post_title'
402
- );
403
-
404
- // Reply slug (Clean name to avoid conflicts)
405
- $this->field_map[] = array(
406
- 'from_tablename' => 'replies_table',
407
- 'from_fieldname' => 'the_reply_slug',
408
- 'to_type' => 'reply',
409
- 'to_fieldname' => 'post_name',
410
- 'callback_method' => 'callback_slug'
411
- );
412
 
413
  // Reply content.
414
  $this->field_map[] = array(
@@ -481,15 +560,15 @@ class Example extends BBP_Converter_Base {
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',
487
  'from_fieldname' => 'the_users_id',
488
  'to_type' => 'user',
489
- 'to_fieldname' => '_bbp_user_id'
490
  );
491
 
492
- // Store old User password (Stored in usermeta serialized with salt)
493
  $this->field_map[] = array(
494
  'from_tablename' => 'users_table',
495
  'from_fieldname' => 'the_users_password',
@@ -498,7 +577,7 @@ class Example extends BBP_Converter_Base {
498
  'callback_method' => 'callback_savepass'
499
  );
500
 
501
- // Store old User Salt (This is only used for the SELECT row info for the above password save)
502
  $this->field_map[] = array(
503
  'from_tablename' => 'users_table',
504
  'from_fieldname' => 'the_users_password_salt',
@@ -570,28 +649,28 @@ class Example extends BBP_Converter_Base {
570
  'to_fieldname' => 'display_name'
571
  );
572
 
573
- // User AIM (Stored in usermeta)
574
  $this->field_map[] = array(
575
  'from_tablename' => 'users_table',
576
- 'from_fieldname' => 'the_users_aim',
577
  'to_type' => 'user',
578
- 'to_fieldname' => 'aim'
579
  );
580
 
581
- // User Yahoo (Stored in usermeta)
582
  $this->field_map[] = array(
583
  'from_tablename' => 'users_table',
584
- 'from_fieldname' => 'the_users_yahoo',
585
  'to_type' => 'user',
586
- 'to_fieldname' => 'yim'
587
  );
588
 
589
- // User Jabber (Stored in usermeta)
590
  $this->field_map[] = array(
591
  'from_tablename' => 'users_table',
592
- 'from_fieldname' => 'the_users_jabber',
593
  'to_type' => 'user',
594
- 'to_fieldname' => 'jabber'
595
  );
596
 
597
  // Setup any table joins needed for the user section
1
  <?php
2
 
3
+ /**
4
+ * bbPress Example Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Example converter base impoprter template for bbPress
12
  *
13
+ * @since 2.3.0 bbPress (r4689)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/custom-import
16
  */
17
  class Example extends BBP_Converter_Base {
18
 
35
 
36
  // Setup table joins for the forum section at the base of this section
37
 
38
+ // Old forum id (Stored in postmeta)
39
  $this->field_map[] = array(
40
  'from_tablename' => 'forums_table',
41
  'from_fieldname' => 'the_forum_id',
42
  'to_type' => 'forum',
43
+ 'to_fieldname' => '_bbp_old_forum_id'
44
  );
45
 
46
  // Forum parent id (If no parent, then 0. Stored in postmeta)
48
  'from_tablename' => 'forums_table',
49
  'from_fieldname' => 'the_parent_id',
50
  'to_type' => 'forum',
51
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
52
  );
53
 
54
  // Forum topic count (Stored in postmeta)
117
  'to_fieldname' => 'menu_order'
118
  );
119
 
120
+ // Forum type (Category = 0 or Forum = 1, Stored in postmeta)
121
+ $this->field_map[] = array(
122
+ 'from_tablename' => 'forums_table',
123
+ 'from_fieldname' => 'the_forum_type',
124
+ 'to_type' => 'forum',
125
+ 'to_fieldname' => '_bbp_forum_type',
126
+ 'callback_method' => 'callback_forum_type'
127
+ );
128
+
129
+ // Forum status (Unlocked = 0 or Locked = 1, Stored in postmeta)
130
+ $this->field_map[] = array(
131
+ 'from_tablename' => 'forums_table',
132
+ 'from_fieldname' => 'the_forum_status',
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => '_bbp_status',
135
+ 'callback_method' => 'callback_forum_status'
136
+ );
137
+
138
  // Forum dates.
139
  $this->field_map[] = array(
140
  'to_type' => 'forum',
168
  'to_type' => 'forum'
169
  );
170
 
171
+ /** Forum Subscriptions Section ***************************************/
172
+
173
+ // Subscribed forum ID (Stored in usermeta)
174
+ $this->field_map[] = array(
175
+ 'from_tablename' => 'forum_subscriptions_table',
176
+ 'from_fieldname' => 'the_forum_id',
177
+ 'to_type' => 'forum_subscriptions',
178
+ 'to_fieldname' => '_bbp_forum_subscriptions'
179
+ );
180
+
181
+ // Subscribed user ID (Stored in usermeta)
182
+ $this->field_map[] = array(
183
+ 'from_tablename' => 'forum_subscriptions_table',
184
+ 'from_fieldname' => 'the_user_id',
185
+ 'to_type' => 'forum_subscriptions',
186
+ 'to_fieldname' => 'user_id',
187
+ 'callback_method' => 'callback_userid'
188
+ );
189
+
190
  /** Topic Section *****************************************************/
191
 
192
  // Setup table joins for the topic section at the base of this section
193
 
194
+ // Old topic id (Stored in postmeta)
195
  $this->field_map[] = array(
196
  'from_tablename' => 'topics_table',
197
  'from_fieldname' => 'the_topic_id',
198
  'to_type' => 'topic',
199
+ 'to_fieldname' => '_bbp_old_topic_id'
200
  );
201
 
202
  // Topic reply count (Stored in postmeta)
269
  'callback_method' => 'callback_slug'
270
  );
271
 
272
+ // Topic status (Open or Closed)
273
+ $this->field_map[] = array(
274
+ 'from_tablename' => 'topics_table',
275
+ 'from_fieldname' => 'the_topic_status',
276
+ 'to_type' => 'topic',
277
+ 'to_fieldname' => '_bbp_old_closed_status_id',
278
+ 'callback_method' => 'callback_topic_status'
279
+ );
280
+
281
  // Topic parent forum id (If no parent, then 0)
282
  $this->field_map[] = array(
283
  'from_tablename' => 'topics_table',
287
  'callback_method' => 'callback_forumid'
288
  );
289
 
290
+ // Sticky status (Stored in postmeta)
291
  $this->field_map[] = array(
292
  'from_tablename' => 'topics_table',
293
  'from_fieldname' => 'the_topic_sticky_status',
294
  'to_type' => 'topic',
295
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
296
  'callback_method' => 'callback_sticky_status'
297
  );
298
 
400
  'to_fieldname' => 'description'
401
  );
402
 
403
+ /** Topic Subscriptions Section ***************************************/
404
+
405
+ // Subscribed topic ID (Stored in usermeta)
406
+ $this->field_map[] = array(
407
+ 'from_tablename' => 'topic_subscriptions_table',
408
+ 'from_fieldname' => 'the_topic_id',
409
+ 'to_type' => 'topic_subscriptions',
410
+ 'to_fieldname' => '_bbp_subscriptions'
411
+ );
412
+
413
+ // Subscribed user ID (Stored in usermeta)
414
+ $this->field_map[] = array(
415
+ 'from_tablename' => 'topic_subscriptions_table',
416
+ 'from_fieldname' => 'the_user_id',
417
+ 'to_type' => 'topic_subscriptions',
418
+ 'to_fieldname' => 'user_id',
419
+ 'callback_method' => 'callback_userid'
420
+ );
421
+
422
+ /** Favorites Section *************************************************/
423
+
424
+ // Favorited topic ID (Stored in usermeta)
425
+ $this->field_map[] = array(
426
+ 'from_tablename' => 'favorites_table',
427
+ 'from_fieldname' => 'the_favorite_topic_id',
428
+ 'to_type' => 'favorites',
429
+ 'to_fieldname' => '_bbp_favorites'
430
+ );
431
+
432
+ // Favorited user ID (Stored in usermeta)
433
+ $this->field_map[] = array(
434
+ 'from_tablename' => 'favorites_table',
435
+ 'from_fieldname' => 'the_user_id',
436
+ 'to_type' => 'favorites',
437
+ 'to_fieldname' => 'user_id',
438
+ 'callback_method' => 'callback_userid'
439
+ );
440
+
441
  /** Reply Section *****************************************************/
442
 
443
  // Setup table joins for the reply section at the base of this section
444
 
445
+ // Old reply id (Stored in postmeta)
446
  $this->field_map[] = array(
447
  'from_tablename' => 'replies_table',
448
  'from_fieldname' => 'the_reply_id',
449
  'to_type' => 'reply',
450
+ 'to_fieldname' => '_bbp_old_reply_id'
451
  );
452
 
453
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
456
  'from_fieldname' => 'the_reply_parent_forum_id',
457
  'to_type' => 'reply',
458
  'to_fieldname' => '_bbp_forum_id',
459
+ 'callback_method' => 'callback_forumid'
460
  );
461
 
462
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
485
  'callback_method' => 'callback_userid'
486
  );
487
 
488
+ // Reply title and reply slugs
489
+ // Note: We don't actually want either a reply title or a reply slug as
490
+ // we want single replies to use their ID as the permalink.
 
 
 
 
 
 
 
 
 
 
 
 
 
491
 
492
  // Reply content.
493
  $this->field_map[] = array(
560
 
561
  // Setup table joins for the user section at the base of this section
562
 
563
+ // Store old user id (Stored in usermeta)
564
  $this->field_map[] = array(
565
  'from_tablename' => 'users_table',
566
  'from_fieldname' => 'the_users_id',
567
  'to_type' => 'user',
568
+ 'to_fieldname' => '_bbp_old_user_id'
569
  );
570
 
571
+ // Store old user password (Stored in usermeta serialized with salt)
572
  $this->field_map[] = array(
573
  'from_tablename' => 'users_table',
574
  'from_fieldname' => 'the_users_password',
577
  'callback_method' => 'callback_savepass'
578
  );
579
 
580
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
581
  $this->field_map[] = array(
582
  'from_tablename' => 'users_table',
583
  'from_fieldname' => 'the_users_password_salt',
649
  'to_fieldname' => 'display_name'
650
  );
651
 
652
+ // User Profile Field 1 (Stored in usermeta)
653
  $this->field_map[] = array(
654
  'from_tablename' => 'users_table',
655
+ 'from_fieldname' => 'the_users_custom_profile_field_1',
656
  'to_type' => 'user',
657
+ 'to_fieldname' => '_bbp_example_profile_field_1'
658
  );
659
 
660
+ // User Profile Field 2 (Stored in usermeta)
661
  $this->field_map[] = array(
662
  'from_tablename' => 'users_table',
663
+ 'from_fieldname' => 'the_users_custom_profile_field_2',
664
  'to_type' => 'user',
665
+ 'to_fieldname' => '_bbp_example_profile_field_2'
666
  );
667
 
668
+ // User Profile Field 3 (Stored in usermeta)
669
  $this->field_map[] = array(
670
  'from_tablename' => 'users_table',
671
+ 'from_fieldname' => 'the_users_custom_profile_field_3',
672
  'to_type' => 'user',
673
+ 'to_fieldname' => '_bbp_example_profile_field_3'
674
  );
675
 
676
  // Setup any table joins needed for the user section
includes/admin/converters/FluxBB.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class FluxBB extends BBP_Converter_Base {
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)
@@ -99,6 +107,20 @@ class FluxBB extends BBP_Converter_Base {
99
  'to_fieldname' => 'menu_order'
100
  );
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  // Forum dates.
103
  $this->field_map[] = array(
104
  'to_type' => 'forum',
@@ -121,14 +143,33 @@ class FluxBB extends BBP_Converter_Base {
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)
@@ -222,12 +263,12 @@ class FluxBB extends BBP_Converter_Base {
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
 
@@ -273,7 +314,7 @@ class FluxBB extends BBP_Converter_Base {
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
 
@@ -283,14 +324,33 @@ class FluxBB extends BBP_Converter_Base {
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)
@@ -328,32 +388,6 @@ class FluxBB extends BBP_Converter_Base {
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',
@@ -404,15 +438,15 @@ class FluxBB extends BBP_Converter_Base {
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',
@@ -421,7 +455,7 @@ class FluxBB extends BBP_Converter_Base {
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',
@@ -490,7 +524,7 @@ class FluxBB extends BBP_Converter_Base {
490
  'from_tablename' => 'users',
491
  'from_fieldname' => 'aim',
492
  'to_type' => 'user',
493
- 'to_fieldname' => 'aim'
494
  );
495
 
496
  // User Yahoo (Stored in usermeta)
@@ -498,7 +532,7 @@ class FluxBB extends BBP_Converter_Base {
498
  'from_tablename' => 'users',
499
  'from_fieldname' => 'yahoo',
500
  'to_type' => 'user',
501
- 'to_fieldname' => 'yim'
502
  );
503
 
504
  // Store Jabber
@@ -506,7 +540,7 @@ class FluxBB extends BBP_Converter_Base {
506
  'from_tablename' => 'users',
507
  'from_fieldname' => 'jabber',
508
  'to_type' => 'user',
509
- 'to_fieldname' => 'jabber'
510
  );
511
 
512
  // Store ICQ (Stored in usermeta)
@@ -632,15 +666,4 @@ class FluxBB extends BBP_Converter_Base {
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
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress FluxBB Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of FluxBB Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5138)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/fluxbb
16
  */
17
  class FluxBB extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum topic count (Stored in postmeta)
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
110
+ // Forum type (Set a default value 'forum', Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'to_type' => 'forum',
113
+ 'to_fieldname' => '_bbp_forum_type',
114
+ 'default' => 'forum'
115
+ );
116
+
117
+ // Forum status (Set a default value 'open', Stored in postmeta)
118
+ $this->field_map[] = array(
119
+ 'to_type' => 'forum',
120
+ 'to_fieldname' => '_bbp_status',
121
+ 'default' => 'open'
122
+ );
123
+
124
  // Forum dates.
125
  $this->field_map[] = array(
126
  'to_type' => 'forum',
143
  'default' => date('Y-m-d H:i:s')
144
  );
145
 
146
+ /** Forum Subscriptions Section ***************************************/
147
+
148
+ // Subscribed forum ID (Stored in usermeta)
149
+ $this->field_map[] = array(
150
+ 'from_tablename' => 'forum_subscriptions',
151
+ 'from_fieldname' => 'forum_id',
152
+ 'to_type' => 'forum_subscriptions',
153
+ 'to_fieldname' => '_bbp_forum_subscriptions'
154
+ );
155
+
156
+ // Subscribed user ID (Stored in usermeta)
157
+ $this->field_map[] = array(
158
+ 'from_tablename' => 'forum_subscriptions',
159
+ 'from_fieldname' => 'user_id',
160
+ 'to_type' => 'forum_subscriptions',
161
+ 'to_fieldname' => 'user_id',
162
+ 'callback_method' => 'callback_userid'
163
+ );
164
+
165
  /** Topic Section *****************************************************/
166
 
167
+ // Old topic id (Stored in postmeta)
168
  $this->field_map[] = array(
169
  'from_tablename' => 'topics',
170
  'from_fieldname' => 'id',
171
  'to_type' => 'topic',
172
+ 'to_fieldname' => '_bbp_old_topic_id'
173
  );
174
 
175
  // Topic reply count (Stored in postmeta)
263
  'callback_method' => 'callback_forumid'
264
  );
265
 
266
+ // Sticky status (Stored in postmeta)
267
  $this->field_map[] = array(
268
  'from_tablename' => 'topics',
269
  'from_fieldname' => 'sticky',
270
  'to_type' => 'topic',
271
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
272
  'callback_method' => 'callback_sticky_status'
273
  );
274
 
314
  'from_tablename' => 'topics',
315
  'from_fieldname' => 'closed',
316
  'to_type' => 'topic',
317
+ 'to_fieldname' => '_bbp_old_closed_status_id',
318
  'callback_method' => 'callback_topic_status'
319
  );
320
 
324
  * FluxBB v1.5.3 Forums do not support topic tags out of the box
325
  */
326
 
327
+ /** Topic Subscriptions Section ***************************************/
328
+
329
+ // Subscribed topic ID (Stored in usermeta)
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'topic_subscriptions',
332
+ 'from_fieldname' => 'topic_id',
333
+ 'to_type' => 'topic_subscriptions',
334
+ 'to_fieldname' => '_bbp_subscriptions'
335
+ );
336
+
337
+ // Subscribed user ID (Stored in usermeta)
338
+ $this->field_map[] = array(
339
+ 'from_tablename' => 'topic_subscriptions',
340
+ 'from_fieldname' => 'user_id',
341
+ 'to_type' => 'topic_subscriptions',
342
+ 'to_fieldname' => 'user_id',
343
+ 'callback_method' => 'callback_userid'
344
+ );
345
+
346
  /** Reply Section *****************************************************/
347
 
348
+ // Old reply id (Stored in postmeta)
349
  $this->field_map[] = array(
350
  'from_tablename' => 'posts',
351
  'from_fieldname' => 'id',
352
  'to_type' => 'reply',
353
+ 'to_fieldname' => '_bbp_old_reply_id'
354
  );
355
 
356
  // Reply parent forum id (If no parent, then 0, Stored in postmeta)
388
  'callback_method' => 'callback_userid'
389
  );
390
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  // Reply content.
392
  $this->field_map[] = array(
393
  'from_tablename' => 'posts',
438
 
439
  /** User Section ******************************************************/
440
 
441
+ // Store old user id (Stored in usermeta)
442
  $this->field_map[] = array(
443
  'from_tablename' => 'users',
444
  'from_fieldname' => 'id',
445
  'to_type' => 'user',
446
+ 'to_fieldname' => '_bbp_old_user_id'
447
  );
448
 
449
+ // Store old user password (Stored in usermeta serialized with salt)
450
  $this->field_map[] = array(
451
  'from_tablename' => 'users',
452
  'from_fieldname' => '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' => 'users',
461
  // 'from_fieldname' => 'salt',
524
  'from_tablename' => 'users',
525
  'from_fieldname' => 'aim',
526
  'to_type' => 'user',
527
+ 'to_fieldname' => '_bbp_fluxbb_user_aim'
528
  );
529
 
530
  // User Yahoo (Stored in usermeta)
532
  'from_tablename' => 'users',
533
  'from_fieldname' => 'yahoo',
534
  'to_type' => 'user',
535
+ 'to_fieldname' => '_bbp_fluxbb_user_yim'
536
  );
537
 
538
  // Store Jabber
540
  'from_tablename' => 'users',
541
  'from_fieldname' => 'jabber',
542
  'to_type' => 'user',
543
+ 'to_fieldname' => '_bbp_fluxbb_user_jabber'
544
  );
545
 
546
  // Store ICQ (Stored in usermeta)
666
  $count = absint( (int) $count - 1 );
667
  return $count;
668
  }
669
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Invision.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Invision Power Board v3.x converter.
5
  *
6
- * @since bbPress (r4713)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/invision
 
8
  */
9
  class Invision extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class Invision extends BBP_Converter_Base {
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 parent id (If no parent, then 0, Stored in postmeta)
@@ -38,7 +46,7 @@ class Invision extends BBP_Converter_Base {
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)
@@ -116,6 +124,13 @@ class Invision extends BBP_Converter_Base {
116
  'callback_method' => 'callback_forum_type'
117
  );
118
 
 
 
 
 
 
 
 
119
  // Forum dates.
120
  $this->field_map[] = array(
121
  'to_type' => 'forum',
@@ -140,12 +155,12 @@ class Invision extends BBP_Converter_Base {
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)
@@ -214,12 +229,12 @@ class Invision extends BBP_Converter_Base {
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
 
@@ -281,12 +296,12 @@ class Invision extends BBP_Converter_Base {
281
 
282
  /** Reply Section *****************************************************/
283
 
284
- // Reply id (Stored in postmeta)
285
  $this->field_map[] = array(
286
  'from_tablename' => 'posts',
287
  'from_fieldname' => 'pid',
288
  'to_type' => 'reply',
289
- 'to_fieldname' => '_bbp_post_id'
290
  );
291
 
292
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
@@ -324,19 +339,6 @@ class Invision extends BBP_Converter_Base {
324
  'callback_method' => 'callback_userid'
325
  );
326
 
327
- // Reply title.
328
- // Note: We join the topics table because post table does not include topic title.
329
- $this->field_map[] = array(
330
- 'from_tablename' => 'topics',
331
- 'from_fieldname' => 'title',
332
- 'join_tablename' => 'posts',
333
- 'join_type' => 'INNER',
334
- 'join_expression' => 'ON (topics.tid = posts.topic_id) WHERE posts.new_topic = 0',
335
- 'to_type' => 'reply',
336
- 'to_fieldname' => 'post_title',
337
- 'callback_method' => 'callback_reply_title'
338
- );
339
-
340
  // Reply content.
341
  $this->field_map[] = array(
342
  'from_tablename' => 'posts',
@@ -387,15 +389,15 @@ class Invision extends BBP_Converter_Base {
387
 
388
  /** User Section ******************************************************/
389
 
390
- // Store old User id (Stored in usermeta)
391
  $this->field_map[] = array(
392
  'from_tablename' => 'members',
393
  'from_fieldname' => 'member_id',
394
  'to_type' => 'user',
395
- 'to_fieldname' => '_bbp_user_id'
396
  );
397
 
398
- // Store old User password (Stored in usermeta serialized with salt)
399
  $this->field_map[] = array(
400
  'from_tablename' => 'members',
401
  'from_fieldname' => 'members_pass_hash',
@@ -404,7 +406,7 @@ class Invision extends BBP_Converter_Base {
404
  'callback_method' => 'callback_savepass'
405
  );
406
 
407
- // Store old User Salt (This is only used for the SELECT row info for the above password save)
408
  $this->field_map[] = array(
409
  'from_tablename' => 'members',
410
  'from_fieldname' => 'members_pass_salt',
@@ -515,17 +517,6 @@ class Invision extends BBP_Converter_Base {
515
  return $count;
516
  }
517
 
518
- /**
519
- * Set the reply title
520
- *
521
- * @param string $title Invision topic title of this reply
522
- * @return string Prefixed topic title, or empty string
523
- */
524
- public function callback_reply_title( $title = '' ) {
525
- $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
526
- return $title;
527
- }
528
-
529
  /**
530
  * This method is to save the salt and password together. That
531
  * way when we authenticate it we can get it out of the database
1
  <?php
2
 
3
+ /**
4
+ * bbPress Invision Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Invision Power Board v3.x converter.
12
  *
13
+ * @since 2.3.0 bbPress (r4713)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/invision
16
  */
17
  class Invision extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'forums',
47
  'from_fieldname' => 'parent_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
124
  'callback_method' => 'callback_forum_type'
125
  );
126
 
127
+ // Forum status (Set a default value 'open', Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => '_bbp_status',
131
+ 'default' => 'open'
132
+ );
133
+
134
  // Forum dates.
135
  $this->field_map[] = array(
136
  'to_type' => 'forum',
155
 
156
  /** Topic Section *****************************************************/
157
 
158
+ // Old topic id (Stored in postmeta)
159
  $this->field_map[] = array(
160
  'from_tablename' => 'topics',
161
  'from_fieldname' => 'tid',
162
  'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
  );
165
 
166
  // Topic reply count (Stored in postmeta)
229
  'callback_method' => 'callback_forumid'
230
  );
231
 
232
+ // Sticky status (Stored in postmeta)
233
  $this->field_map[] = array(
234
  'from_tablename' => 'topics',
235
  'from_fieldname' => 'pinned',
236
  'to_type' => 'topic',
237
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
238
  'callback_method' => 'callback_sticky_status'
239
  );
240
 
296
 
297
  /** Reply Section *****************************************************/
298
 
299
+ // Old reply id (Stored in postmeta)
300
  $this->field_map[] = array(
301
  'from_tablename' => 'posts',
302
  'from_fieldname' => 'pid',
303
  'to_type' => 'reply',
304
+ 'to_fieldname' => '_bbp_old_reply_id'
305
  );
306
 
307
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
339
  'callback_method' => 'callback_userid'
340
  );
341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  // Reply content.
343
  $this->field_map[] = array(
344
  'from_tablename' => 'posts',
389
 
390
  /** User Section ******************************************************/
391
 
392
+ // Store old user id (Stored in usermeta)
393
  $this->field_map[] = array(
394
  'from_tablename' => 'members',
395
  'from_fieldname' => 'member_id',
396
  'to_type' => 'user',
397
+ 'to_fieldname' => '_bbp_old_user_id'
398
  );
399
 
400
+ // Store old user password (Stored in usermeta serialized with salt)
401
  $this->field_map[] = array(
402
  'from_tablename' => 'members',
403
  'from_fieldname' => 'members_pass_hash',
406
  'callback_method' => 'callback_savepass'
407
  );
408
 
409
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
410
  $this->field_map[] = array(
411
  'from_tablename' => 'members',
412
  'from_fieldname' => 'members_pass_salt',
517
  return $count;
518
  }
519
 
 
 
 
 
 
 
 
 
 
 
 
520
  /**
521
  * This method is to save the salt and password together. That
522
  * way when we authenticate it we can get it out of the database
includes/admin/converters/Kunena1.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -21,24 +29,24 @@ class Kunena1 extends BBP_Converter_Base {
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)
@@ -73,38 +81,38 @@ class Kunena1 extends BBP_Converter_Base {
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)
@@ -125,36 +133,36 @@ class Kunena1 extends BBP_Converter_Base {
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)
@@ -264,219 +272,201 @@ class Kunena1 extends BBP_Converter_Base {
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.
@@ -532,15 +522,4 @@ class Kunena1 extends BBP_Converter_Base {
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
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress Kunena 1.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Kunena v1.x Forums for Joomla Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5144)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/kunena/
16
  */
17
  class Kunena1 extends BBP_Converter_Base {
18
 
29
  /**
30
  * Sets up the field mappings
31
  */
32
+ public function setup_globals() {
33
 
34
+ /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'kunena_categories',
39
+ 'from_fieldname' => 'id',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'kunena_categories',
47
+ 'from_fieldname' => 'parent',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
81
  'to_fieldname' => '_bbp_total_reply_count'
82
  );
83
 
84
+ // Forum title.
85
+ $this->field_map[] = array(
86
+ 'from_tablename' => 'kunena_categories',
87
+ 'from_fieldname' => 'name',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => 'post_title'
90
  );
91
 
92
+ // Forum slug (Clean name to avoid conflicts)
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'kunena_categories',
95
+ 'from_fieldname' => 'name',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_name',
98
+ 'callback_method' => 'callback_slug'
99
  );
100
 
101
+ // Forum description.
102
+ $this->field_map[] = array(
103
+ 'from_tablename' => 'kunena_categories',
104
+ 'from_fieldname' => 'description',
105
+ 'to_type' => 'forum',
106
+ 'to_fieldname' => 'post_content',
107
+ 'callback_method' => 'callback_null'
108
  );
109
 
110
+ // Forum display order (Starts from 1)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'kunena_categories',
113
+ 'from_fieldname' => 'ordering',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'menu_order'
116
  );
117
 
118
  // Forum type (Category = 0 or Forum > 0, Stored in postmeta)
133
  'callback_method' => 'callback_forum_status'
134
  );
135
 
136
+ // Forum dates.
137
+ $this->field_map[] = array(
138
+ 'to_type' => 'forum',
139
+ 'to_fieldname' => 'post_date',
140
+ 'default' => date('Y-m-d H:i:s')
141
  );
142
+ $this->field_map[] = array(
143
+ 'to_type' => 'forum',
144
+ 'to_fieldname' => 'post_date_gmt',
145
+ 'default' => date('Y-m-d H:i:s')
146
  );
147
+ $this->field_map[] = array(
148
+ 'to_type' => 'forum',
149
+ 'to_fieldname' => 'post_modified',
150
+ 'default' => date('Y-m-d H:i:s')
151
  );
152
+ $this->field_map[] = array(
153
+ 'to_type' => 'forum',
154
+ 'to_fieldname' => 'post_modified_gmt',
155
+ 'default' => date('Y-m-d H:i:s')
156
  );
157
 
158
+ /** Topic Section *****************************************************/
159
 
160
+ // Old topic id (Stored in postmeta)
161
  $this->field_map[] = array(
162
  'from_tablename' => 'kunena_messages',
163
  'from_fieldname' => 'thread',
164
  'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_old_topic_id'
166
  );
167
 
168
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
272
  'from_tablename' => 'kunena_messages',
273
  'from_fieldname' => 'locked',
274
  'to_type' => 'topic',
275
+ 'to_fieldname' => '_bbp_old_closed_status_id',
276
  'callback_method' => 'callback_topic_status'
277
  );
278
 
279
+ /** Tags Section ******************************************************/
280
 
281
  /**
282
  * Kunena v1.x Forums do not support topic tags out of the box
283
  */
284
 
285
+ /** Reply Section *****************************************************/
286
+
287
+ // Old reply id (Stored in postmeta)
288
+ $this->field_map[] = array(
289
+ 'from_tablename' => 'kunena_messages',
290
+ 'from_fieldname' => 'id',
291
+ 'to_type' => 'reply',
292
+ 'to_fieldname' => '_bbp_old_reply_id'
293
+ );
294
+
295
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
296
+ $this->field_map[] = array(
297
+ 'from_tablename' => 'kunena_messages',
298
+ 'from_fieldname' => 'catid',
299
+ 'to_type' => 'reply',
300
+ 'to_fieldname' => '_bbp_forum_id',
301
+ 'callback_method' => 'callback_topicid_to_forumid'
302
+ );
303
+
304
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'kunena_messages',
307
+ 'from_fieldname' => 'thread',
308
+ 'to_type' => 'reply',
309
+ 'to_fieldname' => '_bbp_topic_id',
310
+ 'callback_method' => 'callback_topicid'
311
+ );
312
+
313
+ // Reply author ip (Stored in postmeta)
314
+ $this->field_map[] = array(
315
+ 'from_tablename' => 'kunena_messages',
316
+ 'from_fieldname' => 'ip',
317
+ 'to_type' => 'reply',
318
+ 'to_fieldname' => '_bbp_author_ip'
319
+ );
320
+
321
+ // Reply author.
322
+ $this->field_map[] = array(
323
+ 'from_tablename' => 'kunena_messages',
324
+ 'from_fieldname' => 'userid',
325
+ 'to_type' => 'reply',
326
+ 'to_fieldname' => 'post_author',
327
+ 'callback_method' => 'callback_userid'
328
+ );
329
+
330
+ // Reply content.
331
+ // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
332
+ $this->field_map[] = array(
333
+ 'from_tablename' => 'kunena_messages_text',
334
+ 'from_fieldname' => 'message',
335
+ 'join_tablename' => 'kunena_messages',
336
+ 'join_type' => 'INNER',
337
+ 'join_expression' => 'ON kunena_messages.id = kunena_messages_text.mesid WHERE kunena_messages.parent != 0',
338
+ 'to_type' => 'reply',
339
+ 'to_fieldname' => 'post_content',
340
+ 'callback_method' => 'callback_html'
341
+ );
342
+
343
+ // Reply parent topic id (If no parent, then 0)
344
+ $this->field_map[] = array(
345
+ 'from_tablename' => 'kunena_messages',
346
+ 'from_fieldname' => 'thread',
347
+ 'to_type' => 'reply',
348
+ 'to_fieldname' => 'post_parent',
349
+ 'callback_method' => 'callback_topicid'
350
+ );
351
+
352
+ // Reply dates.
353
+ $this->field_map[] = array(
354
+ 'from_tablename' => 'kunena_messages',
355
+ 'from_fieldname' => 'time',
356
+ 'to_type' => 'reply',
357
+ 'to_fieldname' => 'post_date',
358
+ 'callback_method' => 'callback_datetime'
359
+ );
360
+ $this->field_map[] = array(
361
+ 'from_tablename' => 'kunena_messages',
362
+ 'from_fieldname' => 'time',
363
+ 'to_type' => 'reply',
364
+ 'to_fieldname' => 'post_date_gmt',
365
+ 'callback_method' => 'callback_datetime'
366
+ );
367
+ $this->field_map[] = array(
368
+ 'from_tablename' => 'kunena_messages',
369
+ 'from_fieldname' => 'time',
370
+ 'to_type' => 'reply',
371
+ 'to_fieldname' => 'post_modified',
372
+ 'callback_method' => 'callback_datetime'
373
+ );
374
+ $this->field_map[] = array(
375
+ 'from_tablename' => 'kunena_messages',
376
+ 'from_fieldname' => 'time',
377
+ 'to_type' => 'reply',
378
+ 'to_fieldname' => 'post_modified_gmt',
379
+ 'callback_method' => 'callback_datetime'
380
+ );
381
+
382
+ /** User Section ******************************************************/
383
+
384
+ //Note: We are importing the Joomla User details and the Kunena v1.x user profile details.
385
+
386
+ // Store old user id (Stored in usermeta)
387
+ $this->field_map[] = array(
388
+ 'from_tablename' => 'users',
389
+ 'from_fieldname' => 'id',
390
+ 'to_type' => 'user',
391
+ 'to_fieldname' => '_bbp_old_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' => 'user',
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' => 'user',
414
+ // 'to_fieldname' => '_bbp_class',
415
+ // 'default' => 'Kunena1'
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 email.
427
+ $this->field_map[] = array(
428
+ 'from_tablename' => 'users',
429
+ 'from_fieldname' => 'email',
430
+ 'to_type' => 'user',
431
+ 'to_fieldname' => 'user_email'
432
+ );
433
+
434
+ // User registered.
435
+ $this->field_map[] = array(
436
+ 'from_tablename' => 'users',
437
+ 'from_fieldname' => 'registerDate',
438
+ 'to_type' => 'user',
439
+ 'to_fieldname' => 'user_registered',
440
+ 'callback_method' => 'callback_datetime'
441
+ );
442
+ }
443
+
444
+ /**
445
+ * This method allows us to indicates what is or is not converted for each
446
+ * converter.
447
+ */
448
+ public function info() {
449
+ return '';
450
+ }
451
+
452
+ /**
453
+ * This method is to save the salt and password together. That
454
+ * way when we authenticate it we can get it out of the database
455
+ * as one value. Array values are auto sanitized by WordPress.
456
+ */
457
+ public function callback_savepass($field, $row) {
458
+ $pass_array = array('hash' => $field, 'salt' => $row['salt']);
459
+ return $pass_array;
460
+ }
461
+
462
+ /**
463
+ * This method is to take the pass out of the database and compare
464
+ * to a pass the user has typed in.
465
+ */
466
+ public function authenticate_pass($password, $serialized_pass) {
467
+ $pass_array = unserialize($serialized_pass);
468
+ return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
469
+ }
470
 
471
  /**
472
  * Translate the forum type from Kunena v1.x numeric's to WordPress's strings.
522
  }
523
  return $status;
524
  }
525
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Kunena2.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -21,17 +29,17 @@ class Kunena2 extends BBP_Converter_Base {
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)
@@ -39,7 +47,7 @@ class Kunena2 extends BBP_Converter_Base {
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)
@@ -150,12 +158,12 @@ class Kunena2 extends BBP_Converter_Base {
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)
@@ -283,11 +291,11 @@ class Kunena2 extends BBP_Converter_Base {
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
@@ -295,12 +303,12 @@ class Kunena2 extends BBP_Converter_Base {
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)
@@ -338,24 +346,6 @@ class Kunena2 extends BBP_Converter_Base {
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(
@@ -408,70 +398,70 @@ class Kunena2 extends BBP_Converter_Base {
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(
@@ -481,34 +471,34 @@ class Kunena2 extends BBP_Converter_Base {
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
  *
@@ -574,15 +564,4 @@ class Kunena2 extends BBP_Converter_Base {
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
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress Kunena 2.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Kunena v2.x Forums for Joomla Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5144)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/kunena/
16
  */
17
  class Kunena2 extends BBP_Converter_Base {
18
 
29
  /**
30
  * Sets up the field mappings
31
  */
32
+ public function setup_globals() {
33
 
34
+ /** Forum Section *****************************************************/
35
 
36
 
37
+ // Old forum id (Stored in postmeta)
38
  $this->field_map[] = array(
39
  'from_tablename' => 'kunena_categories',
40
  'from_fieldname' => 'id',
41
  'to_type' => 'forum',
42
+ 'to_fieldname' => '_bbp_old_forum_id'
43
  );
44
 
45
  // Forum parent id (If no parent, then 0, Stored in postmeta)
47
  'from_tablename' => 'kunena_categories',
48
  'from_fieldname' => 'parent_id',
49
  'to_type' => 'forum',
50
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
51
  );
52
 
53
  // Forum topic count (Stored in postmeta)
158
 
159
  /** Topic Section *****************************************************/
160
 
161
+ // Old topic id (Stored in postmeta)
162
  $this->field_map[] = array(
163
  'from_tablename' => 'kunena_topics',
164
  'from_fieldname' => 'id',
165
  'to_type' => 'topic',
166
+ 'to_fieldname' => '_bbp_old_topic_id'
167
  );
168
 
169
  // Topic reply count (Stored in postmeta)
291
  'from_tablename' => 'kunena_topics',
292
  'from_fieldname' => 'locked',
293
  'to_type' => 'topic',
294
+ 'to_fieldname' => '_bbp_old_closed_status_id',
295
  'callback_method' => 'callback_topic_status'
296
  );
297
 
298
+ /** Tags Section ******************************************************/
299
 
300
  /**
301
  * Kunena v2.x Forums do not support topic tags out of the box
303
 
304
  /** Reply Section *****************************************************/
305
 
306
+ // Old reply id (Stored in postmeta)
307
  $this->field_map[] = array(
308
  'from_tablename' => 'kunena_messages',
309
  'from_fieldname' => 'id',
310
  'to_type' => 'reply',
311
+ 'to_fieldname' => '_bbp_old_reply_id'
312
  );
313
 
314
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
346
  'callback_method' => 'callback_userid'
347
  );
348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  // Reply content.
350
  // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
351
  $this->field_map[] = array(
398
  'callback_method' => 'callback_datetime'
399
  );
400
 
401
+ /** User Section ******************************************************/
402
+
403
+ //Note: We are importing the Joomla User details and the Kunena v2.x user profile details.
404
+
405
+ // Store old user id (Stored in usermeta)
406
+ $this->field_map[] = array(
407
+ 'from_tablename' => 'users',
408
+ 'from_fieldname' => 'id',
409
+ 'to_type' => 'user',
410
+ 'to_fieldname' => '_bbp_old_user_id'
411
+ );
412
+
413
+ // Store old user password (Stored in usermeta serialized with salt)
414
+ $this->field_map[] = array(
415
+ 'from_tablename' => 'users',
416
+ 'from_fieldname' => 'password',
417
+ 'to_type' => 'user',
418
+ 'to_fieldname' => '_bbp_password',
419
+ 'callback_method' => 'callback_savepass'
420
+ );
421
+
422
+ // Store old user salt. This is only used for the SELECT row info for the above password save
423
+ /*
424
+ $this->field_map[] = array(
425
+ 'from_tablename' => 'users',
426
+ 'from_fieldname' => 'salt',
427
+ 'to_type' => 'user',
428
+ 'to_fieldname' => ''
429
+ );
430
+ */
431
+
432
+ // User password verify class. Stores in usermeta for verifying password.
433
+ /*
434
+ $this->field_map[] = array(
435
+ 'to_type' => 'user',
436
+ 'to_fieldname' => '_bbp_class',
437
+ 'default' => 'Kunena2'
438
+ );
439
+ */
440
+
441
+ // User name.
442
+ $this->field_map[] = array(
443
+ 'from_tablename' => 'users',
444
+ 'from_fieldname' => 'username',
445
+ 'to_type' => 'user',
446
+ 'to_fieldname' => 'user_login'
447
+ );
448
+
449
+ // User email.
450
+ $this->field_map[] = array(
451
+ 'from_tablename' => 'users',
452
+ 'from_fieldname' => 'email',
453
+ 'to_type' => 'user',
454
+ 'to_fieldname' => 'user_email'
455
+ );
456
+
457
+ // User registered.
458
+ $this->field_map[] = array(
459
+ 'from_tablename' => 'users',
460
+ 'from_fieldname' => 'registerDate',
461
+ 'to_type' => 'user',
462
+ 'to_fieldname' => 'user_registered',
463
+ 'callback_method' => 'callback_datetime'
464
+ );
465
 
466
  // User display name.
467
  $this->field_map[] = array(
471
  'to_fieldname' => 'display_name'
472
  );
473
 
474
+ }
475
+
476
+ /**
477
+ * This method allows us to indicates what is or is not converted for each
478
+ * converter.
479
+ */
480
+ public function info() {
481
+ return '';
482
+ }
483
+
484
+ /**
485
+ * This method is to save the salt and password together. That
486
+ * way when we authenticate it we can get it out of the database
487
+ * as one value. Array values are auto sanitized by WordPress.
488
+ */
489
+ public function callback_savepass($field, $row) {
490
+ $pass_array = array('hash' => $field, 'salt' => $row['salt']);
491
+ return $pass_array;
492
+ }
493
+
494
+ /**
495
+ * This method is to take the pass out of the database and compare
496
+ * to a pass the user has typed in.
497
+ */
498
+ public function authenticate_pass($password, $serialized_pass) {
499
+ $pass_array = unserialize($serialized_pass);
500
+ return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
501
+ }
502
  /**
503
  * Translate the forum type from Kunena v2.x numeric's to WordPress's strings.
504
  *
564
  $count = absint( (int) $count - 1 );
565
  return $count;
566
  }
567
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Kunena3.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -149,12 +157,12 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -282,7 +290,7 @@ class Kunena3 extends BBP_Converter_Base {
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
 
@@ -294,12 +302,12 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -337,24 +345,6 @@ class Kunena3 extends BBP_Converter_Base {
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(
@@ -411,15 +401,15 @@ class Kunena3 extends BBP_Converter_Base {
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',
@@ -428,7 +418,7 @@ class Kunena3 extends BBP_Converter_Base {
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',
@@ -503,7 +493,7 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -514,7 +504,7 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -525,7 +515,7 @@ class Kunena3 extends BBP_Converter_Base {
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)
@@ -801,15 +791,4 @@ class Kunena3 extends BBP_Converter_Base {
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
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress Kunena 3.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Kunena v3.x Forums for Joomla Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5144)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/kunena/
16
  */
17
  class Kunena3 extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'kunena_categories',
39
  'from_fieldname' => 'id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'kunena_categories',
47
  'from_fieldname' => 'parent_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
157
 
158
  /** Topic Section *****************************************************/
159
 
160
+ // Old topic id (Stored in postmeta)
161
  $this->field_map[] = array(
162
  'from_tablename' => 'kunena_topics',
163
  'from_fieldname' => 'id',
164
  'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_old_topic_id'
166
  );
167
 
168
  // Topic reply count (Stored in postmeta)
290
  'from_tablename' => 'kunena_topics',
291
  'from_fieldname' => 'locked',
292
  'to_type' => 'topic',
293
+ 'to_fieldname' => '_bbp_old_closed_status_id',
294
  'callback_method' => 'callback_topic_status'
295
  );
296
 
302
 
303
  /** Reply Section ******************************************************/
304
 
305
+ // Old reply id (Stored in postmeta)
306
  $this->field_map[] = array(
307
  'from_tablename' => 'kunena_messages',
308
  'from_fieldname' => 'id',
309
  'to_type' => 'reply',
310
+ 'to_fieldname' => '_bbp_old_reply_id'
311
  );
312
 
313
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
345
  'callback_method' => 'callback_userid'
346
  );
347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  // Reply content.
349
  // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
350
  $this->field_map[] = array(
401
 
402
  //Note: We are importing the Joomla User details and the Kunena v3.x user profile details.
403
 
404
+ // Store old user id (Stored in usermeta)
405
  $this->field_map[] = array(
406
  'from_tablename' => 'users',
407
  'from_fieldname' => 'id',
408
  'to_type' => 'user',
409
+ 'to_fieldname' => '_bbp_old_user_id'
410
  );
411
 
412
+ // Store old user password (Stored in usermeta serialized with salt)
413
  $this->field_map[] = array(
414
  'from_tablename' => 'users',
415
  'from_fieldname' => 'password',
418
  'callback_method' => 'callback_savepass'
419
  );
420
 
421
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
422
  // $this->field_map[] = array(
423
  // 'from_tablename' => 'users',
424
  // 'from_fieldname' => 'salt',
493
  'join_type' => 'LEFT',
494
  'join_expression' => 'ON kunena_users.userid = users.id',
495
  'to_type' => 'user',
496
+ 'to_fieldname' => '_bbp_kunena3_user_aim'
497
  );
498
 
499
  // User Yahoo (Stored in usermeta)
504
  'join_type' => 'LEFT',
505
  'join_expression' => 'ON kunena_users.userid = users.id',
506
  'to_type' => 'user',
507
+ 'to_fieldname' => '_bbp_kunena3_user_yim'
508
  );
509
 
510
  // Store Google Tak (Stored in usermeta)
515
  'join_type' => 'LEFT',
516
  'join_expression' => 'ON kunena_users.userid = users.id',
517
  'to_type' => 'user',
518
+ 'to_fieldname' => '_bbp_kunena3_user_jabber'
519
  );
520
 
521
  // Store ICQ (Stored in usermeta)
791
  $count = absint( (int) $count - 1 );
792
  return $count;
793
  }
794
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Mingle.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Mingle Forums converter.
5
  *
6
- * @since bbPress (r4691)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/mingle
 
8
  */
9
  class Mingle extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class Mingle extends BBP_Converter_Base {
25
 
26
  /** Forum Section ******************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
30
  'from_tablename' => 'forum_forums',
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)
@@ -38,7 +46,7 @@ class Mingle extends BBP_Converter_Base {
38
  'from_tablename' => 'forum_forums',
39
  'from_fieldname' => 'parent_id',
40
  'to_type' => 'forum',
41
- 'to_fieldname' => '_bbp_forum_parent_id'
42
  );
43
 
44
  // Forum title.
@@ -74,6 +82,20 @@ class Mingle extends BBP_Converter_Base {
74
  'to_fieldname' => 'menu_order'
75
  );
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  // Forum dates.
78
  $this->field_map[] = array(
79
  'to_type' => 'forum',
@@ -98,12 +120,12 @@ class Mingle extends BBP_Converter_Base {
98
 
99
  /** Topic Section ******************************************************/
100
 
101
- // Topic id (Stored in postmeta)
102
  $this->field_map[] = array(
103
  'from_tablename' => 'forum_threads',
104
  'from_fieldname' => 'id',
105
  'to_type' => 'topic',
106
- 'to_fieldname' => '_bbp_topic_id'
107
  );
108
 
109
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
@@ -162,12 +184,12 @@ class Mingle extends BBP_Converter_Base {
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
 
@@ -208,7 +230,7 @@ class Mingle extends BBP_Converter_Base {
208
  'from_tablename' => 'forum_threads',
209
  'from_fieldname' => 'closed',
210
  'to_type' => 'topic',
211
- 'to_fieldname' => 'post_status',
212
  'callback_method' => 'callback_topic_status'
213
  );
214
 
@@ -216,16 +238,16 @@ class Mingle extends BBP_Converter_Base {
216
 
217
  /**
218
  * Mingle Forums do not support topic tags
219
- */
220
 
221
  /** Reply Section ******************************************************/
222
 
223
- // Reply id (Stored in postmeta)
224
  $this->field_map[] = array(
225
  'from_tablename' => 'forum_posts',
226
  'from_fieldname' => 'id',
227
  'to_type' => 'reply',
228
- 'to_fieldname' => '_bbp_post_id'
229
  );
230
 
231
  // Setup reply section table joins
@@ -268,23 +290,6 @@ class Mingle extends BBP_Converter_Base {
268
  'callback_method' => 'callback_userid'
269
  );
270
 
271
- // Reply title.
272
- $this->field_map[] = array(
273
- 'from_tablename' => 'forum_posts',
274
- 'from_fieldname' => 'subject',
275
- 'to_type' => 'reply',
276
- 'to_fieldname' => 'post_title'
277
- );
278
-
279
- // Reply slug (Clean name to avoid conflicts)
280
- $this->field_map[] = array(
281
- 'from_tablename' => 'forum_posts',
282
- 'from_fieldname' => 'subject',
283
- 'to_type' => 'reply',
284
- 'to_fieldname' => 'post_name',
285
- 'callback_method' => 'callback_slug'
286
- );
287
-
288
  // Reply content.
289
  $this->field_map[] = array(
290
  'from_tablename' => 'forum_posts',
@@ -331,15 +336,15 @@ class Mingle extends BBP_Converter_Base {
331
 
332
  /** User Section ******************************************************/
333
 
334
- // Store old User id (Stored in usermeta)
335
  $this->field_map[] = array(
336
  'from_tablename' => 'users',
337
  'from_fieldname' => 'ID',
338
  'to_type' => 'user',
339
- 'to_fieldname' => '_bbp_user_id'
340
  );
341
 
342
- // Store old User password (Stored in usermeta)
343
  $this->field_map[] = array(
344
  'from_tablename' => 'users',
345
  'from_fieldname' => 'user_pass',
@@ -470,8 +475,8 @@ class Mingle extends BBP_Converter_Base {
470
  }
471
 
472
  /**
473
- * This callback processes any custom BBCodes with parser.php
474
- */
475
  protected function callback_html( $field ) {
476
  require_once( bbpress()->admin->admin_dir . 'parser.php' );
477
  $bbcode = BBCode::getInstance();
@@ -479,5 +484,4 @@ class Mingle extends BBP_Converter_Base {
479
  $bbcode->smiley_regex = false;
480
  return html_entity_decode( $bbcode->Parse( $field ) );
481
  }
482
-
483
  }
1
  <?php
2
 
3
+ /**
4
+ * bbPress Mingle Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Mingle Forums converter.
12
  *
13
+ * @since 2.3.0 bbPress (r4691)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/mingle
16
  */
17
  class Mingle extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section ******************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forum_forums',
39
  'from_fieldname' => 'id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0. Stored in postmeta)
46
  'from_tablename' => 'forum_forums',
47
  'from_fieldname' => 'parent_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum title.
82
  'to_fieldname' => 'menu_order'
83
  );
84
 
85
+ // Forum type (Set a default value 'forum', Stored in postmeta)
86
+ $this->field_map[] = array(
87
+ 'to_type' => 'forum',
88
+ 'to_fieldname' => '_bbp_forum_type',
89
+ 'default' => 'forum'
90
+ );
91
+
92
+ // Forum status (Set a default value 'open', Stored in postmeta)
93
+ $this->field_map[] = array(
94
+ 'to_type' => 'forum',
95
+ 'to_fieldname' => '_bbp_status',
96
+ 'default' => 'open'
97
+ );
98
+
99
  // Forum dates.
100
  $this->field_map[] = array(
101
  'to_type' => 'forum',
120
 
121
  /** Topic Section ******************************************************/
122
 
123
+ // Old topic id (Stored in postmeta)
124
  $this->field_map[] = array(
125
  'from_tablename' => 'forum_threads',
126
  'from_fieldname' => 'id',
127
  'to_type' => 'topic',
128
+ 'to_fieldname' => '_bbp_old_topic_id'
129
  );
130
 
131
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
184
  'callback_method' => 'callback_forumid'
185
  );
186
 
187
+ // Sticky status (Stored in postmeta)
188
  $this->field_map[] = array(
189
  'from_tablename' => 'forum_threads',
190
  'from_fieldname' => 'status',
191
  'to_type' => 'topic',
192
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
193
  'callback_method' => 'callback_sticky_status'
194
  );
195
 
230
  'from_tablename' => 'forum_threads',
231
  'from_fieldname' => 'closed',
232
  'to_type' => 'topic',
233
+ 'to_fieldname' => '_bbp_old_closed_status_id',
234
  'callback_method' => 'callback_topic_status'
235
  );
236
 
238
 
239
  /**
240
  * Mingle Forums do not support topic tags
241
+ */
242
 
243
  /** Reply Section ******************************************************/
244
 
245
+ // Old reply id (Stored in postmeta)
246
  $this->field_map[] = array(
247
  'from_tablename' => 'forum_posts',
248
  'from_fieldname' => 'id',
249
  'to_type' => 'reply',
250
+ 'to_fieldname' => '_bbp_old_reply_id'
251
  );
252
 
253
  // Setup reply section table joins
290
  'callback_method' => 'callback_userid'
291
  );
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  // Reply content.
294
  $this->field_map[] = array(
295
  'from_tablename' => 'forum_posts',
336
 
337
  /** User Section ******************************************************/
338
 
339
+ // Store old user id (Stored in usermeta)
340
  $this->field_map[] = array(
341
  'from_tablename' => 'users',
342
  'from_fieldname' => 'ID',
343
  'to_type' => 'user',
344
+ 'to_fieldname' => '_bbp_old_user_id'
345
  );
346
 
347
+ // Store old user password (Stored in usermeta)
348
  $this->field_map[] = array(
349
  'from_tablename' => 'users',
350
  'from_fieldname' => 'user_pass',
475
  }
476
 
477
  /**
478
+ * This callback processes any custom BBCodes with parser.php
479
+ */
480
  protected function callback_html( $field ) {
481
  require_once( bbpress()->admin->admin_dir . 'parser.php' );
482
  $bbcode = BBCode::getInstance();
484
  $bbcode->smiley_regex = false;
485
  return html_entity_decode( $bbcode->Parse( $field ) );
486
  }
 
487
  }
includes/admin/converters/MyBB.php CHANGED
@@ -1,591 +1,595 @@
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
- }
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress MyBB Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
+ /**
11
+ * Implementation of MyBB Forum converter.
12
+ *
13
+ * @since 2.5.0 bbPress (r5140)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/mybb
16
+ */
17
+ class MyBB extends BBP_Converter_Base {
18
+
19
+ /**
20
+ * Main Constructor
21
+ *
22
+ * @uses MyBB::setup_globals()
23
+ */
24
+ function __construct() {
25
+ parent::__construct();
26
+ $this->setup_globals();
27
+ }
28
+
29
+ /**
30
+ * Sets up the field mappings
31
+ */
32
+ public function setup_globals() {
33
+
34
+ /** Forum Section *****************************************************/
35
+
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'forums',
39
+ 'from_fieldname' => 'fid',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
+ );
43
+
44
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'forums',
47
+ 'from_fieldname' => 'pid',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
+ );
51
+
52
+ // Forum topic count (Stored in postmeta)
53
+ $this->field_map[] = array(
54
+ 'from_tablename' => 'forums',
55
+ 'from_fieldname' => 'threads',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_topic_count'
58
+ );
59
+
60
+ // Forum reply count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'posts',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_reply_count'
66
+ );
67
+
68
+ // Forum title.
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => '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' => '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' => 'description',
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' => 'disporder',
98
+ 'to_type' => 'forum',
99
+ 'to_fieldname' => 'menu_order'
100
+ );
101
+
102
+ // Forum type (Set a default value 'forum', Stored in postmeta)
103
+ $this->field_map[] = array(
104
+ 'to_type' => 'forum',
105
+ 'to_fieldname' => '_bbp_forum_type',
106
+ 'default' => 'forum'
107
+ );
108
+
109
+ // Forum status (Set a default value 'open', Stored in postmeta)
110
+ $this->field_map[] = array(
111
+ 'to_type' => 'forum',
112
+ 'to_fieldname' => '_bbp_status',
113
+ 'default' => 'open'
114
+ );
115
+
116
+ // Forum dates.
117
+ $this->field_map[] = array(
118
+ 'to_type' => 'forum',
119
+ 'to_fieldname' => 'post_date',
120
+ 'default' => date('Y-m-d H:i:s')
121
+ );
122
+ $this->field_map[] = array(
123
+ 'to_type' => 'forum',
124
+ 'to_fieldname' => 'post_date_gmt',
125
+ 'default' => date('Y-m-d H:i:s')
126
+ );
127
+ $this->field_map[] = array(
128
+ 'to_type' => 'forum',
129
+ 'to_fieldname' => 'post_modified',
130
+ 'default' => date('Y-m-d H:i:s')
131
+ );
132
+ $this->field_map[] = array(
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => 'post_modified_gmt',
135
+ 'default' => date('Y-m-d H:i:s')
136
+ );
137
+
138
+ /** Topic Section *****************************************************/
139
+
140
+ // Old topic id (Stored in postmeta)
141
+ $this->field_map[] = array(
142
+ 'from_tablename' => 'threads',
143
+ 'from_fieldname' => 'tid',
144
+ 'to_type' => 'topic',
145
+ 'to_fieldname' => '_bbp_old_topic_id'
146
+ );
147
+
148
+ // Topic reply count (Stored in postmeta)
149
+ $this->field_map[] = array(
150
+ 'from_tablename' => 'threads',
151
+ 'from_fieldname' => 'replies',
152
+ 'to_type' => 'topic',
153
+ 'to_fieldname' => '_bbp_reply_count',
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' => 'threads',
160
+ 'from_fieldname' => 'replies',
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' => 'threads',
169
+ 'from_fieldname' => 'fid',
170
+ 'to_type' => 'topic',
171
+ 'to_fieldname' => '_bbp_forum_id',
172
+ 'callback_method' => 'callback_forumid'
173
+ );
174
+
175
+ // Topic author.
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'threads',
178
+ 'from_fieldname' => 'uid',
179
+ 'to_type' => 'topic',
180
+ 'to_fieldname' => 'post_author',
181
+ 'callback_method' => 'callback_userid'
182
+ );
183
+
184
+ // Topic Author ip (Stored in postmeta)
185
+ $this->field_map[] = array(
186
+ 'from_tablename' => 'posts',
187
+ 'from_fieldname' => 'ipaddress',
188
+ 'join_tablename' => 'threads',
189
+ 'join_type' => 'INNER',
190
+ 'join_expression' => 'USING (tid) WHERE replyto = 0',
191
+ 'to_type' => 'topic',
192
+ 'to_fieldname' => '_bbp_author_ip'
193
+ );
194
+
195
+ // Topic content.
196
+ // Note: We join the 'posts' table because 'threads' table does not have content.
197
+ $this->field_map[] = array(
198
+ 'from_tablename' => 'posts',
199
+ 'from_fieldname' => 'message',
200
+ 'join_tablename' => 'threads',
201
+ 'join_type' => 'INNER',
202
+ 'join_expression' => 'USING (tid) WHERE replyto = 0',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => 'post_content',
205
+ 'callback_method' => 'callback_html'
206
+ );
207
+
208
+ // Topic title.
209
+ $this->field_map[] = array(
210
+ 'from_tablename' => 'threads',
211
+ 'from_fieldname' => 'subject',
212
+ 'to_type' => 'topic',
213
+ 'to_fieldname' => 'post_title'
214
+ );
215
+
216
+ // Topic slug (Clean name to avoid conflicts)
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'threads',
219
+ 'from_fieldname' => 'subject',
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' => 'threads',
228
+ 'from_fieldname' => 'fid',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_parent',
231
+ 'callback_method' => 'callback_forumid'
232
+ );
233
+
234
+ // Sticky status (Stored in postmeta)
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'threads',
237
+ 'from_fieldname' => 'sticky',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
240
+ 'callback_method' => 'callback_sticky_status'
241
+ );
242
+
243
+ // Topic dates.
244
+ $this->field_map[] = array(
245
+ 'from_tablename' => 'threads',
246
+ 'from_fieldname' => 'dateline',
247
+ 'to_type' => 'topic',
248
+ 'to_fieldname' => 'post_date',
249
+ 'callback_method' => 'callback_datetime'
250
+ );
251
+ $this->field_map[] = array(
252
+ 'from_tablename' => 'threads',
253
+ 'from_fieldname' => 'dateline',
254
+ 'to_type' => 'topic',
255
+ 'to_fieldname' => 'post_date_gmt',
256
+ 'callback_method' => 'callback_datetime'
257
+ );
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'threads',
260
+ 'from_fieldname' => 'lastpost',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => 'post_modified',
263
+ 'callback_method' => 'callback_datetime'
264
+ );
265
+ $this->field_map[] = array(
266
+ 'from_tablename' => 'threads',
267
+ 'from_fieldname' => 'lastpost',
268
+ 'to_type' => 'topic',
269
+ 'to_fieldname' => 'post_modified_gmt',
270
+ 'callback_method' => 'callback_datetime'
271
+ );
272
+ $this->field_map[] = array(
273
+ 'from_tablename' => 'threads',
274
+ 'from_fieldname' => 'lastpost',
275
+ 'to_type' => 'topic',
276
+ 'to_fieldname' => '_bbp_last_active_time',
277
+ 'callback_method' => 'callback_datetime'
278
+ );
279
+
280
+ // Topic status (Open or Closed, MyBB v1.6.10 open = null & closed = 1)
281
+ $this->field_map[] = array(
282
+ 'from_tablename' => 'threads',
283
+ 'from_fieldname' => 'closed',
284
+ 'to_type' => 'topic',
285
+ 'to_fieldname' => '_bbp_old_closed_status_id',
286
+ 'callback_method' => 'callback_topic_status'
287
+ );
288
+
289
+ /** Tags Section ******************************************************/
290
+
291
+ /**
292
+ * MyBB v1.6.10 Forums do not support topic tags out of the box
293
+ */
294
+
295
+ /** Reply Section *****************************************************/
296
+
297
+ // Old reply id (Stored in postmeta)
298
+ $this->field_map[] = array(
299
+ 'from_tablename' => 'posts',
300
+ 'from_fieldname' => 'pid',
301
+ 'from_expression' => 'WHERE replyto != 0',
302
+ 'to_type' => 'reply',
303
+ 'to_fieldname' => '_bbp_old_reply_id'
304
+ );
305
+
306
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
307
+ $this->field_map[] = array(
308
+ 'from_tablename' => 'posts',
309
+ 'from_fieldname' => 'fid',
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' => 'posts',
318
+ 'from_fieldname' => 'tid',
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' => 'posts',
327
+ 'from_fieldname' => 'ipaddress',
328
+ 'to_type' => 'reply',
329
+ 'to_fieldname' => '_bbp_author_ip'
330
+ );
331
+
332
+ // Reply author.
333
+ $this->field_map[] = array(
334
+ 'from_tablename' => 'posts',
335
+ 'from_fieldname' => 'uid',
336
+ 'to_type' => 'reply',
337
+ 'to_fieldname' => 'post_author',
338
+ 'callback_method' => 'callback_userid'
339
+ );
340
+
341
+ // Reply content.
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'posts',
344
+ 'from_fieldname' => 'message',
345
+ 'to_type' => 'reply',
346
+ 'to_fieldname' => 'post_content',
347
+ 'callback_method' => 'callback_html'
348
+ );
349
+
350
+ // Reply parent topic id (If no parent, then 0)
351
+ $this->field_map[] = array(
352
+ 'from_tablename' => 'posts',
353
+ 'from_fieldname' => 'tid',
354
+ 'to_type' => 'reply',
355
+ 'to_fieldname' => 'post_parent',
356
+ 'callback_method' => 'callback_topicid'
357
+ );
358
+
359
+ // Reply dates.
360
+ $this->field_map[] = array(
361
+ 'from_tablename' => 'posts',
362
+ 'from_fieldname' => 'dateline',
363
+ 'to_type' => 'reply',
364
+ 'to_fieldname' => 'post_date',
365
+ 'callback_method' => 'callback_datetime'
366
+ );
367
+ $this->field_map[] = array(
368
+ 'from_tablename' => 'posts',
369
+ 'from_fieldname' => 'dateline',
370
+ 'to_type' => 'reply',
371
+ 'to_fieldname' => 'post_date_gmt',
372
+ 'callback_method' => 'callback_datetime'
373
+ );
374
+ $this->field_map[] = array(
375
+ 'from_tablename' => 'posts',
376
+ 'from_fieldname' => 'edittime',
377
+ 'to_type' => 'reply',
378
+ 'to_fieldname' => 'post_modified',
379
+ 'callback_method' => 'callback_datetime'
380
+ );
381
+ $this->field_map[] = array(
382
+ 'from_tablename' => 'posts',
383
+ 'from_fieldname' => 'edittime',
384
+ 'to_type' => 'reply',
385
+ 'to_fieldname' => 'post_modified_gmt',
386
+ 'callback_method' => 'callback_datetime'
387
+ );
388
+
389
+ /** User Section ******************************************************/
390
+
391
+ // Store old user id (Stored in usermeta)
392
+ $this->field_map[] = array(
393
+ 'from_tablename' => 'users',
394
+ 'from_fieldname' => 'uid',
395
+ 'to_type' => 'user',
396
+ 'to_fieldname' => '_bbp_old_user_id'
397
+ );
398
+
399
+ // Store old user password (Stored in usermeta serialized with salt)
400
+ $this->field_map[] = array(
401
+ 'from_tablename' => 'users',
402
+ 'from_fieldname' => 'password',
403
+ 'to_type' => 'user',
404
+ 'to_fieldname' => '_bbp_password',
405
+ 'callback_method' => 'callback_savepass'
406
+ );
407
+
408
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
409
+ $this->field_map[] = array(
410
+ 'from_tablename' => 'users',
411
+ 'from_fieldname' => 'salt',
412
+ 'to_type' => 'user',
413
+ 'to_fieldname' => ''
414
+ );
415
+
416
+ // User password verify class (Stored in usermeta for verifying password)
417
+ $this->field_map[] = array(
418
+ 'to_type' => 'users',
419
+ 'to_fieldname' => '_bbp_class',
420
+ 'default' => 'MyBB'
421
+ );
422
+
423
+ // User name.
424
+ $this->field_map[] = array(
425
+ 'from_tablename' => 'users',
426
+ 'from_fieldname' => 'username',
427
+ 'to_type' => 'user',
428
+ 'to_fieldname' => 'user_login'
429
+ );
430
+
431
+ // User nice name.
432
+ $this->field_map[] = array(
433
+ 'from_tablename' => 'users',
434
+ 'from_fieldname' => 'username',
435
+ 'to_type' => 'user',
436
+ 'to_fieldname' => 'user_nicename'
437
+ );
438
+
439
+ // User email.
440
+ $this->field_map[] = array(
441
+ 'from_tablename' => 'users',
442
+ 'from_fieldname' => 'email',
443
+ 'to_type' => 'user',
444
+ 'to_fieldname' => 'user_email'
445
+ );
446
+
447
+ // User homepage.
448
+ $this->field_map[] = array(
449
+ 'from_tablename' => 'users',
450
+ 'from_fieldname' => 'website',
451
+ 'to_type' => 'user',
452
+ 'to_fieldname' => 'user_url'
453
+ );
454
+
455
+ // User registered.
456
+ $this->field_map[] = array(
457
+ 'from_tablename' => 'users',
458
+ 'from_fieldname' => 'regdate',
459
+ 'to_type' => 'user',
460
+ 'to_fieldname' => 'user_registered',
461
+ 'callback_method' => 'callback_datetime'
462
+ );
463
+
464
+ // User display name.
465
+ $this->field_map[] = array(
466
+ 'from_tablename' => 'users',
467
+ 'from_fieldname' => 'usertitle',
468
+ 'to_type' => 'user',
469
+ 'to_fieldname' => 'display_name'
470
+ );
471
+
472
+ // User AIM (Stored in usermeta)
473
+ $this->field_map[] = array(
474
+ 'from_tablename' => 'users',
475
+ 'from_fieldname' => 'aim',
476
+ 'to_type' => 'user',
477
+ 'to_fieldname' => '_bbp_mybb_user_aim'
478
+ );
479
+
480
+ // User Yahoo (Stored in usermeta)
481
+ $this->field_map[] = array(
482
+ 'from_tablename' => 'users',
483
+ 'from_fieldname' => 'yahoo',
484
+ 'to_type' => 'user',
485
+ 'to_fieldname' => '_bbp_mybb_user_yim'
486
+ );
487
+
488
+ // Store ICQ (Stored in usermeta)
489
+ $this->field_map[] = array(
490
+ 'from_tablename' => 'users',
491
+ 'from_fieldname' => 'icq',
492
+ 'to_type' => 'user',
493
+ 'to_fieldname' => '_bbp_mybb_user_icq'
494
+ );
495
+
496
+ // Store MSN (Stored in usermeta)
497
+ $this->field_map[] = array(
498
+ 'from_tablename' => 'users',
499
+ 'from_fieldname' => 'msn',
500
+ 'to_type' => 'user',
501
+ 'to_fieldname' => '_bbp_mybb_user_msn'
502
+ );
503
+
504
+ // Store Signature (Stored in usermeta)
505
+ $this->field_map[] = array(
506
+ 'from_tablename' => 'users',
507
+ 'from_fieldname' => 'signature',
508
+ 'to_type' => 'user',
509
+ 'to_fieldname' => '_bbp_mybb_user_sig',
510
+ 'callback_method' => 'callback_html'
511
+ );
512
+
513
+ }
514
+
515
+ /**
516
+ * This method allows us to indicates what is or is not converted for each
517
+ * converter.
518
+ */
519
+ public function info()
520
+ {
521
+ return '';
522
+ }
523
+
524
+ /**
525
+ * This method is to save the salt and password together. That
526
+ * way when we authenticate it we can get it out of the database
527
+ * as one value. Array values are auto sanitized by WordPress.
528
+ */
529
+ public function callback_savepass( $field, $row )
530
+ {
531
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
532
+ return $pass_array;
533
+ }
534
+
535
+ /**
536
+ * This method is to take the pass out of the database and compare
537
+ * to a pass the user has typed in.
538
+ */
539
+ public function authenticate_pass( $password, $serialized_pass )
540
+ {
541
+ $pass_array = unserialize( $serialized_pass );
542
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
543
+ }
544
+
545
+ /**
546
+ * Translate the post status from MyBB v1.6.10 numeric's to WordPress's strings.
547
+ *
548
+ * @param int $status MyBB v1.6.10 numeric topic status
549
+ * @return string WordPress safe
550
+ */
551
+ public function callback_topic_status( $status = 0 ) {
552
+ switch ( $status ) {
553
+ case 1 :
554
+ $status = 'closed';
555
+ break;
556
+
557
+ case 0 :
558
+ default :
559
+ $status = 'publish';
560
+ break;
561
+ }
562
+ return $status;
563
+ }
564
+
565
+ /**
566
+ * Translate the topic sticky status type from MyBB v1.6.10 numeric's to WordPress's strings.
567
+ *
568
+ * @param int $status MyBB v1.6.10 numeric forum type
569
+ * @return string WordPress safe
570
+ */
571
+ public function callback_sticky_status( $status = 0 ) {
572
+ switch ( $status ) {
573
+ case 1 :
574
+ $status = 'sticky'; // MyBB Sticky 'topic_sticky = 1'
575
+ break;
576
+
577
+ case 0 :
578
+ default :
579
+ $status = 'normal'; // MyBB Normal Topic 'topic_sticky = 0'
580
+ break;
581
+ }
582
+ return $status;
583
+ }
584
+
585
+ /**
586
+ * Verify the topic/reply count.
587
+ *
588
+ * @param int $count MyBB v1.6.10 topic/reply counts
589
+ * @return string WordPress safe
590
+ */
591
+ public function callback_topic_reply_count( $count = 1 ) {
592
+ $count = absint( (int) $count - 1 );
593
+ return $count;
594
+ }
595
+ }
includes/admin/converters/PHPFox3.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class PHPFox3 extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class PHPFox3 extends BBP_Converter_Base {
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)
@@ -149,12 +157,12 @@ class PHPFox3 extends BBP_Converter_Base {
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)
@@ -238,16 +246,16 @@ class PHPFox3 extends BBP_Converter_Base {
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
 
@@ -326,12 +334,12 @@ class PHPFox3 extends BBP_Converter_Base {
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)
@@ -364,30 +372,6 @@ class PHPFox3 extends BBP_Converter_Base {
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
@@ -443,15 +427,15 @@ class PHPFox3 extends BBP_Converter_Base {
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',
@@ -460,7 +444,7 @@ class PHPFox3 extends BBP_Converter_Base {
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',
@@ -638,15 +622,4 @@ class PHPFox3 extends BBP_Converter_Base {
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
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress PHPFox3 Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of PHPFox v3.x Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5146)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/phpfox
16
  */
17
  class PHPFox3 extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forum',
39
  'from_fieldname' => 'forum_id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'forum',
47
  'from_fieldname' => 'parent_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
157
 
158
  /** Topic Section *****************************************************/
159
 
160
+ // Old topic id (Stored in postmeta)
161
  $this->field_map[] = array(
162
  'from_tablename' => 'forum_thread',
163
  'from_fieldname' => 'thread_id',
164
  'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_old_topic_id'
166
  );
167
 
168
  // Topic reply count (Stored in postmeta)
246
  'from_tablename' => 'forum_thread',
247
  'from_fieldname' => 'is_closed',
248
  'to_type' => 'topic',
249
+ 'to_fieldname' => '_bbp_old_closed_status_id',
250
  'callback_method' => 'callback_topic_status'
251
  );
252
 
253
+ // Sticky status (Stored in postmeta)
254
  $this->field_map[] = array(
255
  'from_tablename' => 'forum_thread',
256
  'from_fieldname' => 'order_id',
257
  'to_type' => 'topic',
258
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
259
  'callback_method' => 'callback_sticky_status'
260
  );
261
 
334
 
335
  /** Reply Section *****************************************************/
336
 
337
+ // Old reply id (Stored in postmeta)
338
  $this->field_map[] = array(
339
  'from_tablename' => 'forum_post',
340
  'from_fieldname' => 'post_id',
341
  'to_type' => 'reply',
342
+ 'to_fieldname' => '_bbp_old_reply_id'
343
  );
344
 
345
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
372
  'callback_method' => 'callback_userid'
373
  );
374
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  // Reply content.
376
  // Note: We join the 'forum_post_text' table because 'forum_post' table does not include content.
377
  // Note: We can use 'text' for original text OR 'text_parsed' for pre-parsed text output
427
 
428
  /** User Section ******************************************************/
429
 
430
+ // Store old user id (Stored in usermeta)
431
  $this->field_map[] = array(
432
  'from_tablename' => 'user',
433
  'from_fieldname' => 'user_id',
434
  'to_type' => 'user',
435
+ 'to_fieldname' => '_bbp_old_user_id'
436
  );
437
 
438
+ // Store old user password (Stored in usermeta serialized with salt)
439
  $this->field_map[] = array(
440
  'from_tablename' => 'user',
441
  'from_fieldname' => 'password',
444
  'callback_method' => 'callback_savepass'
445
  );
446
 
447
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
448
  $this->field_map[] = array(
449
  'from_tablename' => 'user',
450
  'from_fieldname' => 'password_salt',
622
  $count = absint( (int) $count - 1 );
623
  return $count;
624
  }
625
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/PHPWind.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class PHPWind extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class PHPWind extends BBP_Converter_Base {
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)
@@ -132,6 +140,12 @@ class PHPWind extends BBP_Converter_Base {
132
  'callback_method' => 'callback_forum_type'
133
  );
134
 
 
 
 
 
 
 
135
  // Forum dates.
136
  $this->field_map[] = array(
137
  'to_type' => 'bbs_forum',
@@ -156,12 +170,12 @@ class PHPWind extends BBP_Converter_Base {
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)
@@ -289,7 +303,7 @@ class PHPWind extends BBP_Converter_Base {
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
 
@@ -301,12 +315,12 @@ class PHPWind extends BBP_Converter_Base {
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)
@@ -344,31 +358,6 @@ class PHPWind extends BBP_Converter_Base {
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',
@@ -419,15 +408,15 @@ class PHPWind extends BBP_Converter_Base {
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',
@@ -436,7 +425,7 @@ class PHPWind extends BBP_Converter_Base {
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',
@@ -582,4 +571,4 @@ class PHPWind extends BBP_Converter_Base {
582
  return $count;
583
  }
584
 
585
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress PHPWind Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of PHPWind Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5142)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/phpwind
16
  */
17
  class PHPWind extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'bbs_forum',
39
  'from_fieldname' => 'fid',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'bbs_forum',
47
  'from_fieldname' => 'parentid',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
140
  'callback_method' => 'callback_forum_type'
141
  );
142
 
143
+ // Forum status (Set a default value 'open', Stored in postmeta)
144
+ $this->field_map[] = array(
145
+ 'to_type' => 'forum',
146
+ 'to_fieldname' => '_bbp_status',
147
+ 'default' => 'open'
148
+ );
149
  // Forum dates.
150
  $this->field_map[] = array(
151
  'to_type' => 'bbs_forum',
170
 
171
  /** Topic Section *****************************************************/
172
 
173
+ // Old topic id (Stored in postmeta)
174
  $this->field_map[] = array(
175
  'from_tablename' => 'bbs_threads',
176
  'from_fieldname' => 'tid',
177
  'to_type' => 'topic',
178
+ 'to_fieldname' => '_bbp_old_topic_id'
179
  );
180
 
181
  // Topic reply count (Stored in postmeta)
303
  'from_tablename' => 'bbs_threads',
304
  'from_fieldname' => 'tpcstatus',
305
  'to_type' => 'topic',
306
+ 'to_fieldname' => '_bbp_old_closed_status_id',
307
  'callback_method' => 'callback_topic_status'
308
  );
309
 
315
 
316
  /** Reply Section *****************************************************/
317
 
318
+ // Old reply id (Stored in postmeta)
319
  $this->field_map[] = array(
320
  'from_tablename' => 'bbs_posts',
321
  'from_fieldname' => 'pid',
322
  'to_type' => 'reply',
323
+ 'to_fieldname' => '_bbp_old_reply_id'
324
  );
325
 
326
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
358
  'callback_method' => 'callback_userid'
359
  );
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  // Reply content.
362
  $this->field_map[] = array(
363
  'from_tablename' => 'bbs_posts',
408
 
409
  /** User Section ******************************************************/
410
 
411
+ // Store old user id (Stored in usermeta)
412
  $this->field_map[] = array(
413
  'from_tablename' => 'user',
414
  'from_fieldname' => 'uid',
415
  'to_type' => 'user',
416
+ 'to_fieldname' => '_bbp_old_user_id'
417
  );
418
 
419
+ // Store old user password (Stored in usermeta serialized with salt)
420
  $this->field_map[] = array(
421
  'from_tablename' => 'user',
422
  'from_fieldname' => 'password',
425
  // 'callback_method' => 'callback_savepass'
426
  );
427
 
428
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
429
  /* $this->field_map[] = array(
430
  'from_tablename' => 'user',
431
  'from_fieldname' => 'pass',
571
  return $count;
572
  }
573
 
574
+ }
includes/admin/converters/Phorum.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class Phorum extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class Phorum extends BBP_Converter_Base {
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)
@@ -100,6 +108,13 @@ class Phorum extends BBP_Converter_Base {
100
  'callback_method' => 'callback_forum_type'
101
  );
102
 
 
 
 
 
 
 
 
103
  // Forum dates.
104
  $this->field_map[] = array(
105
  'to_type' => 'forum',
@@ -124,13 +139,13 @@ class Phorum extends BBP_Converter_Base {
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)
@@ -169,6 +184,23 @@ class Phorum extends BBP_Converter_Base {
169
  'callback_method' => 'callback_userid'
170
  );
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  // Topic Author ip (Stored in postmeta)
173
  $this->field_map[] = array(
174
  'from_tablename' => 'messages',
@@ -254,7 +286,7 @@ class Phorum extends BBP_Converter_Base {
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
 
@@ -264,15 +296,34 @@ class Phorum extends BBP_Converter_Base {
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)
@@ -281,7 +332,7 @@ class Phorum extends BBP_Converter_Base {
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)
@@ -310,21 +361,21 @@ class Phorum extends BBP_Converter_Base {
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.
@@ -377,15 +428,15 @@ class Phorum extends BBP_Converter_Base {
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',
@@ -394,7 +445,7 @@ class Phorum extends BBP_Converter_Base {
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',
@@ -541,5 +592,4 @@ class Phorum extends BBP_Converter_Base {
541
  $count = absint( (int) $count - 1 );
542
  return $count;
543
  }
544
-
545
- }
1
  <?php
2
 
3
+ /**
4
+ * bbPress Phorum Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Phorum Forum converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5141)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/phorum
16
  */
17
  class Phorum extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'forum_id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'forums',
47
  'from_fieldname' => 'parent_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
108
  'callback_method' => 'callback_forum_type'
109
  );
110
 
111
+ // Forum status (Set a default value 'open', Stored in postmeta)
112
+ $this->field_map[] = array(
113
+ 'to_type' => 'forum',
114
+ 'to_fieldname' => '_bbp_status',
115
+ 'default' => 'open'
116
+ );
117
+
118
  // Forum dates.
119
  $this->field_map[] = array(
120
  'to_type' => 'forum',
139
 
140
  /** Topic Section *****************************************************/
141
 
142
+ // Old topic id (Stored in postmeta)
143
  $this->field_map[] = array(
144
  'from_tablename' => 'messages',
145
  'from_fieldname' => 'thread',
146
  'from_expression' => 'WHERE parent_id = 0',
147
  'to_type' => 'topic',
148
+ 'to_fieldname' => '_bbp_old_topic_id'
149
  );
150
 
151
  // Topic reply count (Stored in postmeta)
184
  'callback_method' => 'callback_userid'
185
  );
186
 
187
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
188
+ $this->field_map[] = array(
189
+ 'from_tablename' => 'messages',
190
+ 'from_fieldname' => 'author',
191
+ 'to_type' => 'topic',
192
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
193
+ );
194
+
195
+ // Is the topic anonymous (Stored in postmeta)
196
+ $this->field_map[] = array(
197
+ 'from_tablename' => 'messages',
198
+ 'from_fieldname' => 'user_id',
199
+ 'to_type' => 'topic',
200
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
201
+ 'callback_method' => 'callback_check_anonymous'
202
+ );
203
+
204
  // Topic Author ip (Stored in postmeta)
205
  $this->field_map[] = array(
206
  'from_tablename' => 'messages',
286
  'from_tablename' => 'messages',
287
  'from_fieldname' => 'closed',
288
  'to_type' => 'topic',
289
+ 'to_fieldname' => '_bbp_old_closed_status_id',
290
  'callback_method' => 'callback_topic_status'
291
  );
292
 
296
  * Phorum v5.2.19 Forums do not support topic tags out of the box
297
  */
298
 
299
+ /** Topic Subscriptions Section ***************************************/
300
+
301
+ // Subscribed topic ID (Stored in usermeta)
302
+ $this->field_map[] = array(
303
+ 'from_tablename' => 'subscribers',
304
+ 'from_fieldname' => 'thread',
305
+ 'to_type' => 'topic_subscriptions',
306
+ 'to_fieldname' => '_bbp_subscriptions'
307
+ );
308
+
309
+ // Subscribed user ID (Stored in usermeta)
310
+ $this->field_map[] = array(
311
+ 'from_tablename' => 'subscribers',
312
+ 'from_fieldname' => 'user_id',
313
+ 'to_type' => 'topic_subscriptions',
314
+ 'to_fieldname' => 'user_id',
315
+ 'callback_method' => 'callback_userid'
316
+ );
317
+
318
  /** Reply Section *****************************************************/
319
 
320
+ // Old reply id (Stored in postmeta)
321
  $this->field_map[] = array(
322
  'from_tablename' => 'messages',
323
  'from_fieldname' => 'message_id',
324
  'from_expression' => 'WHERE parent_id != 0',
325
  'to_type' => 'reply',
326
+ 'to_fieldname' => '_bbp_old_reply_id'
327
  );
328
 
329
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
332
  'from_fieldname' => 'forum_id',
333
  'to_type' => 'reply',
334
  'to_fieldname' => '_bbp_forum_id',
335
+ 'callback_method' => 'callback_forumid'
336
  );
337
 
338
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
361
  'callback_method' => 'callback_userid'
362
  );
363
 
364
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
365
  $this->field_map[] = array(
366
+ 'from_tablename' => 'messages',
367
+ 'from_fieldname' => 'author',
368
+ 'to_type' => 'reply',
369
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
370
  );
371
 
372
+ // Is the reply anonymous (Stored in postmeta)
373
  $this->field_map[] = array(
374
  'from_tablename' => 'messages',
375
+ 'from_fieldname' => 'user_id',
376
  'to_type' => 'reply',
377
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
378
+ 'callback_method' => 'callback_check_anonymous'
379
  );
380
 
381
  // Reply content.
428
 
429
  /** User Section ******************************************************/
430
 
431
+ // Store old user id (Stored in usermeta)
432
  $this->field_map[] = array(
433
  'from_tablename' => 'users',
434
  'from_fieldname' => 'user_id',
435
  'to_type' => 'user',
436
+ 'to_fieldname' => '_bbp_old_user_id'
437
  );
438
 
439
+ // Store old user password (Stored in usermeta serialized with salt)
440
  $this->field_map[] = array(
441
  'from_tablename' => 'users',
442
  'from_fieldname' => 'password',
445
  'callback_method' => 'callback_savepass'
446
  );
447
 
448
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
449
  // $this->field_map[] = array(
450
  // 'from_tablename' => 'users',
451
  // 'from_fieldname' => 'salt',
592
  $count = absint( (int) $count - 1 );
593
  return $count;
594
  }
595
+ }
 
includes/admin/converters/PunBB.php CHANGED
@@ -1,680 +1,742 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress PunBB Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
+ /**
11
+ * Implementation of PunBB v1.4.2 Forum converter.
12
+ *
13
+ * @since 2.5.0 bbPress (r5153)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/punbb
16
+ */
17
+ class PunBB extends BBP_Converter_Base {
18
+
19
+ /**
20
+ * Main Constructor
21
+ *
22
+ * @uses PunBB::setup_globals()
23
+ */
24
+ function __construct() {
25
+ parent::__construct();
26
+ $this->setup_globals();
27
+ }
28
+
29
+ /**
30
+ * Sets up the field mappings
31
+ */
32
+ public function setup_globals() {
33
+
34
+ /** Forum Section *****************************************************/
35
+
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'forums',
39
+ 'from_fieldname' => 'id',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
+ );
43
+
44
+ // Forum topic count (Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'forums',
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' => 'forums',
55
+ 'from_fieldname' => 'num_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' => 'num_topics',
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' => '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' => 'forums',
79
+ 'from_fieldname' => 'forum_name',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => 'post_title'
82
+ );
83
+
84
+ // Forum slug (Clean name to avoid conflicts)
85
+ $this->field_map[] = array(
86
+ 'from_tablename' => 'forums',
87
+ 'from_fieldname' => 'forum_name',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => 'post_name',
90
+ 'callback_method' => 'callback_slug'
91
+ );
92
+
93
+ // Forum description.
94
+ $this->field_map[] = array(
95
+ 'from_tablename' => 'forums',
96
+ 'from_fieldname' => 'forum_desc',
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' => 'disp_position',
106
+ 'to_type' => 'forum',
107
+ 'to_fieldname' => 'menu_order'
108
+ );
109
+
110
+ // Forum type (Set a default value 'forum', Stored in postmeta)
111
+ $this->field_map[] = array(
112
+ 'to_type' => 'forum',
113
+ 'to_fieldname' => '_bbp_forum_type',
114
+ 'default' => 'forum'
115
+ );
116
+
117
+ // Forum status (Set a default value 'open', Stored in postmeta)
118
+ $this->field_map[] = array(
119
+ 'to_type' => 'forum',
120
+ 'to_fieldname' => '_bbp_status',
121
+ 'default' => 'open'
122
+ );
123
+
124
+ // Forum dates.
125
+ $this->field_map[] = array(
126
+ 'to_type' => 'forum',
127
+ 'to_fieldname' => 'post_date',
128
+ 'default' => date('Y-m-d H:i:s')
129
+ );
130
+ $this->field_map[] = array(
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => 'post_date_gmt',
133
+ 'default' => date('Y-m-d H:i:s')
134
+ );
135
+ $this->field_map[] = array(
136
+ 'to_type' => 'forum',
137
+ 'to_fieldname' => 'post_modified',
138
+ 'default' => date('Y-m-d H:i:s')
139
+ );
140
+ $this->field_map[] = array(
141
+ 'to_type' => 'forum',
142
+ 'to_fieldname' => 'post_modified_gmt',
143
+ 'default' => date('Y-m-d H:i:s')
144
+ );
145
+
146
+ /** Forum Subscriptions Section ***************************************/
147
+
148
+ // Subscribed forum ID (Stored in usermeta)
149
+ $this->field_map[] = array(
150
+ 'from_tablename' => 'forum_subscriptions',
151
+ 'from_fieldname' => 'forum_id',
152
+ 'to_type' => 'forum_subscriptions',
153
+ 'to_fieldname' => '_bbp_forum_subscriptions'
154
+ );
155
+
156
+ // Subscribed user ID (Stored in usermeta)
157
+ $this->field_map[] = array(
158
+ 'from_tablename' => 'forum_subscriptions',
159
+ 'from_fieldname' => 'user_id',
160
+ 'to_type' => 'forum_subscriptions',
161
+ 'to_fieldname' => 'user_id',
162
+ 'callback_method' => 'callback_userid'
163
+ );
164
+
165
+ /** Topic Section *****************************************************/
166
+
167
+ // Old topic id (Stored in postmeta)
168
+ $this->field_map[] = array(
169
+ 'from_tablename' => 'topics',
170
+ 'from_fieldname' => 'id',
171
+ 'to_type' => 'topic',
172
+ 'to_fieldname' => '_bbp_old_topic_id'
173
+ );
174
+
175
+ // Topic reply count (Stored in postmeta)
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'topics',
178
+ 'from_fieldname' => 'num_replies',
179
+ 'to_type' => 'topic',
180
+ 'to_fieldname' => '_bbp_reply_count',
181
+ 'callback_method' => 'callback_topic_reply_count'
182
+ );
183
+
184
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
185
+ $this->field_map[] = array(
186
+ 'from_tablename' => 'topics',
187
+ 'from_fieldname' => 'num_replies',
188
+ 'to_type' => 'topic',
189
+ 'to_fieldname' => '_bbp_total_reply_count',
190
+ 'callback_method' => 'callback_topic_reply_count'
191
+ );
192
+
193
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
194
+ $this->field_map[] = array(
195
+ 'from_tablename' => 'topics',
196
+ 'from_fieldname' => 'forum_id',
197
+ 'to_type' => 'topic',
198
+ 'to_fieldname' => '_bbp_forum_id',
199
+ 'callback_method' => 'callback_forumid'
200
+ );
201
+
202
+ // Topic author.
203
+ // Note: We join the 'posts' table because 'topics' table does not have user id's.
204
+ $this->field_map[] = array(
205
+ 'from_tablename' => 'posts',
206
+ 'from_fieldname' => 'poster_id',
207
+ 'join_tablename' => 'topics',
208
+ 'join_type' => 'LEFT',
209
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
210
+ 'to_type' => 'topic',
211
+ 'to_fieldname' => 'post_author',
212
+ 'callback_method' => 'callback_userid'
213
+ );
214
+
215
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
216
+ $this->field_map[] = array(
217
+ 'from_tablename' => 'topics',
218
+ 'from_fieldname' => 'poster',
219
+ 'to_type' => 'topic',
220
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
221
+ );
222
+
223
+ // Is the topic anonymous (Stored in postmeta)
224
+ $this->field_map[] = array(
225
+ 'from_tablename' => 'posts',
226
+ 'from_fieldname' => 'poster_id',
227
+ 'join_tablename' => 'topics',
228
+ 'join_type' => 'LEFT',
229
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
230
+ 'to_type' => 'topic',
231
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
232
+ 'callback_method' => 'callback_check_anonymous'
233
+ );
234
+
235
+ // Topic Author ip (Stored in postmeta)
236
+ // Note: We join the 'posts' table because 'topics' table does not have author ip.
237
+ $this->field_map[] = array(
238
+ 'from_tablename' => 'posts',
239
+ 'from_fieldname' => 'poster_ip',
240
+ 'join_tablename' => 'topics',
241
+ 'join_type' => 'LEFT',
242
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
243
+ 'to_type' => 'topic',
244
+ 'to_fieldname' => '_bbp_author_ip'
245
+ );
246
+
247
+ // Topic content.
248
+ // Note: We join the 'posts' table because 'topics' table does not have content.
249
+ $this->field_map[] = array(
250
+ 'from_tablename' => 'posts',
251
+ 'from_fieldname' => 'message',
252
+ 'join_tablename' => 'topics',
253
+ 'join_type' => 'LEFT',
254
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
255
+ 'to_type' => 'topic',
256
+ 'to_fieldname' => 'post_content',
257
+ 'callback_method' => 'callback_html'
258
+ );
259
+
260
+ // Topic title.
261
+ $this->field_map[] = array(
262
+ 'from_tablename' => 'topics',
263
+ 'from_fieldname' => 'subject',
264
+ 'to_type' => 'topic',
265
+ 'to_fieldname' => 'post_title'
266
+ );
267
+
268
+ // Topic slug (Clean name to avoid conflicts)
269
+ $this->field_map[] = array(
270
+ 'from_tablename' => 'topics',
271
+ 'from_fieldname' => 'subject',
272
+ 'to_type' => 'topic',
273
+ 'to_fieldname' => 'post_name',
274
+ 'callback_method' => 'callback_slug'
275
+ );
276
+
277
+ // Topic parent forum id (If no parent, then 0)
278
+ $this->field_map[] = array(
279
+ 'from_tablename' => 'topics',
280
+ 'from_fieldname' => 'forum_id',
281
+ 'to_type' => 'topic',
282
+ 'to_fieldname' => 'post_parent',
283
+ 'callback_method' => 'callback_forumid'
284
+ );
285
+
286
+ // Topic status (Open or Closed, PunBB v1.4.2 0=open & 1=closed)
287
+ $this->field_map[] = array(
288
+ 'from_tablename' => 'topics',
289
+ 'from_fieldname' => 'closed',
290
+ 'to_type' => 'topic',
291
+ 'to_fieldname' => '_bbp_old_closed_status_id',
292
+ 'callback_method' => 'callback_topic_status'
293
+ );
294
+
295
+ // Sticky status (Stored in postmeta)
296
+ $this->field_map[] = array(
297
+ 'from_tablename' => 'topics',
298
+ 'from_fieldname' => 'sticky',
299
+ 'to_type' => 'topic',
300
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
301
+ 'callback_method' => 'callback_sticky_status'
302
+ );
303
+ // Topic dates.
304
+ $this->field_map[] = array(
305
+ 'from_tablename' => 'topics',
306
+ 'from_fieldname' => 'posted',
307
+ 'to_type' => 'topic',
308
+ 'to_fieldname' => 'post_date',
309
+ 'callback_method' => 'callback_datetime'
310
+ );
311
+ $this->field_map[] = array(
312
+ 'from_tablename' => 'topics',
313
+ 'from_fieldname' => 'posted',
314
+ 'to_type' => 'topic',
315
+ 'to_fieldname' => 'post_date_gmt',
316
+ 'callback_method' => 'callback_datetime'
317
+ );
318
+ $this->field_map[] = array(
319
+ 'from_tablename' => 'topics',
320
+ 'from_fieldname' => 'last_post',
321
+ 'to_type' => 'topic',
322
+ 'to_fieldname' => 'post_modified',
323
+ 'callback_method' => 'callback_datetime'
324
+ );
325
+ $this->field_map[] = array(
326
+ 'from_tablename' => 'topics',
327
+ 'from_fieldname' => 'last_post',
328
+ 'to_type' => 'topic',
329
+ 'to_fieldname' => 'post_modified_gmt',
330
+ 'callback_method' => 'callback_datetime'
331
+ );
332
+ $this->field_map[] = array(
333
+ 'from_tablename' => 'topics',
334
+ 'from_fieldname' => 'last_post',
335
+ 'to_type' => 'topic',
336
+ 'to_fieldname' => '_bbp_last_active_time',
337
+ 'callback_method' => 'callback_datetime'
338
+ );
339
+
340
+ /** Tags Section ******************************************************/
341
+
342
+ /**
343
+ * PunBB v1.4.2 Forums do not support topic tags out of the box
344
+ */
345
+
346
+ /** Topic Subscriptions Section ***************************************/
347
+
348
+ // Subscribed topic ID (Stored in usermeta)
349
+ $this->field_map[] = array(
350
+ 'from_tablename' => 'subscriptions',
351
+ 'from_fieldname' => 'topic_id',
352
+ 'to_type' => 'topic_subscriptions',
353
+ 'to_fieldname' => '_bbp_subscriptions'
354
+ );
355
+
356
+ // Subscribed user ID (Stored in usermeta)
357
+ $this->field_map[] = array(
358
+ 'from_tablename' => 'subscriptions',
359
+ 'from_fieldname' => 'user_id',
360
+ 'to_type' => 'topic_subscriptions',
361
+ 'to_fieldname' => 'user_id',
362
+ 'callback_method' => 'callback_userid'
363
+ );
364
+
365
+ /** Reply Section *****************************************************/
366
+
367
+ // Old reply id (Stored in postmeta)
368
+ $this->field_map[] = array(
369
+ 'from_tablename' => 'posts',
370
+ 'from_fieldname' => 'id',
371
+ 'to_type' => 'reply',
372
+ 'to_fieldname' => '_bbp_old_reply_id'
373
+ );
374
+
375
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
376
+ // Note: We join the 'topics' table because 'posts' table does not have parent forum id's.
377
+ $this->field_map[] = array(
378
+ 'from_tablename' => 'topics',
379
+ 'from_fieldname' => 'forum_id',
380
+ 'join_tablename' => 'posts',
381
+ 'join_type' => 'LEFT',
382
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
383
+ 'to_type' => 'reply',
384
+ 'to_fieldname' => '_bbp_forum_id',
385
+ 'callback_method' => 'callback_topicid_to_forumid'
386
+ );
387
+
388
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'posts',
391
+ 'from_fieldname' => 'topic_id',
392
+ 'to_type' => 'reply',
393
+ 'to_fieldname' => '_bbp_topic_id',
394
+ 'callback_method' => 'callback_topicid'
395
+ );
396
+
397
+ // Reply author ip (Stored in postmeta)
398
+ $this->field_map[] = array(
399
+ 'from_tablename' => 'posts',
400
+ 'from_fieldname' => 'poster_ip',
401
+ 'to_type' => 'reply',
402
+ 'to_fieldname' => '_bbp_author_ip'
403
+ );
404
+
405
+ // Reply author.
406
+ $this->field_map[] = array(
407
+ 'from_tablename' => 'posts',
408
+ 'from_fieldname' => 'poster_id',
409
+ 'to_type' => 'reply',
410
+ 'to_fieldname' => 'post_author',
411
+ 'callback_method' => 'callback_userid'
412
+ );
413
+
414
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
415
+ $this->field_map[] = array(
416
+ 'from_tablename' => 'posts',
417
+ 'from_fieldname' => 'poster',
418
+ 'to_type' => 'reply',
419
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
420
+ );
421
+
422
+ // Is the reply anonymous (Stored in postmeta)
423
+ $this->field_map[] = array(
424
+ 'from_tablename' => 'posts',
425
+ 'from_fieldname' => 'poster_id',
426
+ 'to_type' => 'reply',
427
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
428
+ 'callback_method' => 'callback_check_anonymous'
429
+ );
430
+
431
+ // Reply content.
432
+ $this->field_map[] = array(
433
+ 'from_tablename' => 'posts',
434
+ 'from_fieldname' => 'message',
435
+ 'to_type' => 'reply',
436
+ 'to_fieldname' => 'post_content',
437
+ 'callback_method' => 'callback_html'
438
+ );
439
+
440
+ // Reply parent topic id (If no parent, then 0)
441
+ $this->field_map[] = array(
442
+ 'from_tablename' => 'posts',
443
+ 'from_fieldname' => 'topic_id',
444
+ 'to_type' => 'reply',
445
+ 'to_fieldname' => 'post_parent',
446
+ 'callback_method' => 'callback_topicid'
447
+ );
448
+
449
+ // Reply dates.
450
+ $this->field_map[] = array(
451
+ 'from_tablename' => 'posts',
452
+ 'from_fieldname' => 'posted',
453
+ 'to_type' => 'reply',
454
+ 'to_fieldname' => 'post_date',
455
+ 'callback_method' => 'callback_datetime'
456
+ );
457
+ $this->field_map[] = array(
458
+ 'from_tablename' => 'posts',
459
+ 'from_fieldname' => 'posted',
460
+ 'to_type' => 'reply',
461
+ 'to_fieldname' => 'post_date_gmt',
462
+ 'callback_method' => 'callback_datetime'
463
+ );
464
+ $this->field_map[] = array(
465
+ 'from_tablename' => 'posts',
466
+ 'from_fieldname' => 'edited',
467
+ 'to_type' => 'reply',
468
+ 'to_fieldname' => 'post_modified',
469
+ 'callback_method' => 'callback_datetime'
470
+ );
471
+ $this->field_map[] = array(
472
+ 'from_tablename' => 'posts',
473
+ 'from_fieldname' => 'edited',
474
+ 'to_type' => 'reply',
475
+ 'to_fieldname' => 'post_modified_gmt',
476
+ 'callback_method' => 'callback_datetime'
477
+ );
478
+
479
+ /** User Section ******************************************************/
480
+
481
+ // Store old user id (Stored in usermeta)
482
+ // Don't import user id 1, this is PunBB's guest user
483
+ $this->field_map[] = array(
484
+ 'from_tablename' => 'users',
485
+ 'from_fieldname' => 'id',
486
+ 'from_expression' => 'WHERE id != 1',
487
+ 'to_type' => 'user',
488
+ 'to_fieldname' => '_bbp_old_user_id'
489
+ );
490
+
491
+ // Store old user password (Stored in usermeta serialized with salt)
492
+ $this->field_map[] = array(
493
+ 'from_tablename' => 'users',
494
+ 'from_fieldname' => 'password',
495
+ 'to_type' => 'user',
496
+ 'to_fieldname' => '_bbp_password',
497
+ 'callback_method' => 'callback_savepass'
498
+ );
499
+
500
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
501
+ $this->field_map[] = array(
502
+ 'from_tablename' => 'users',
503
+ 'from_fieldname' => 'salt',
504
+ 'to_type' => 'user',
505
+ 'to_fieldname' => ''
506
+ );
507
+
508
+ // User password verify class (Stored in usermeta for verifying password)
509
+ $this->field_map[] = array(
510
+ 'to_type' => 'users',
511
+ 'to_fieldname' => '_bbp_class',
512
+ 'default' => 'PunBB'
513
+ );
514
+
515
+ // User name.
516
+ $this->field_map[] = array(
517
+ 'from_tablename' => 'users',
518
+ 'from_fieldname' => 'username',
519
+ 'to_type' => 'user',
520
+ 'to_fieldname' => 'user_login'
521
+ );
522
+
523
+ // User nice name.
524
+ $this->field_map[] = array(
525
+ 'from_tablename' => 'users',
526
+ 'from_fieldname' => 'username',
527
+ 'to_type' => 'user',
528
+ 'to_fieldname' => 'user_nicename'
529
+ );
530
+
531
+ // User email.
532
+ $this->field_map[] = array(
533
+ 'from_tablename' => 'users',
534
+ 'from_fieldname' => 'email',
535
+ 'to_type' => 'user',
536
+ 'to_fieldname' => 'user_email'
537
+ );
538
+
539
+ // User homepage.
540
+ $this->field_map[] = array(
541
+ 'from_tablename' => 'users',
542
+ 'from_fieldname' => 'url',
543
+ 'to_type' => 'user',
544
+ 'to_fieldname' => 'user_url'
545
+ );
546
+
547
+ // User registered.
548
+ $this->field_map[] = array(
549
+ 'from_tablename' => 'users',
550
+ 'from_fieldname' => 'registered',
551
+ 'to_type' => 'user',
552
+ 'to_fieldname' => 'user_registered',
553
+ 'callback_method' => 'callback_datetime'
554
+ );
555
+
556
+ // User display name.
557
+ $this->field_map[] = array(
558
+ 'from_tablename' => 'users',
559
+ 'from_fieldname' => 'realname',
560
+ 'to_type' => 'user',
561
+ 'to_fieldname' => 'display_name'
562
+ );
563
+
564
+ // User AIM (Stored in usermeta)
565
+ $this->field_map[] = array(
566
+ 'from_tablename' => 'users',
567
+ 'from_fieldname' => 'aim',
568
+ 'to_type' => 'user',
569
+ 'to_fieldname' => '_bbp_punbb_user_aim'
570
+ );
571
+
572
+ // User Yahoo (Stored in usermeta)
573
+ $this->field_map[] = array(
574
+ 'from_tablename' => 'users',
575
+ 'from_fieldname' => 'yahoo',
576
+ 'to_type' => 'user',
577
+ 'to_fieldname' => '_bbp_punbb_user_yim'
578
+ );
579
+
580
+ // Store Jabber
581
+ $this->field_map[] = array(
582
+ 'from_tablename' => 'users',
583
+ 'from_fieldname' => 'jabber',
584
+ 'to_type' => 'user',
585
+ 'to_fieldname' => '_bbp_punbb_user_jabber'
586
+ );
587
+
588
+ // Store ICQ (Stored in usermeta)
589
+ $this->field_map[] = array(
590
+ 'from_tablename' => 'users',
591
+ 'from_fieldname' => 'icq',
592
+ 'to_type' => 'user',
593
+ 'to_fieldname' => '_bbp_punbb_user_icq'
594
+ );
595
+
596
+ // Store MSN (Stored in usermeta)
597
+ $this->field_map[] = array(
598
+ 'from_tablename' => 'users',
599
+ 'from_fieldname' => 'msn',
600
+ 'to_type' => 'user',
601
+ 'to_fieldname' => '_bbp_punbb_user_msn'
602
+ );
603
+
604
+ // Store Facebook (Stored in usermeta)
605
+ $this->field_map[] = array(
606
+ 'from_tablename' => 'users',
607
+ 'from_fieldname' => 'facebook',
608
+ 'to_type' => 'user',
609
+ 'to_fieldname' => '_bbp_punbb_user_facebook'
610
+ );
611
+
612
+ // Store Twitter (Stored in usermeta)
613
+ $this->field_map[] = array(
614
+ 'from_tablename' => 'users',
615
+ 'from_fieldname' => 'twitter',
616
+ 'to_type' => 'user',
617
+ 'to_fieldname' => '_bbp_punbb_user_twitter'
618
+ );
619
+
620
+ // Store LinkedIn (Stored in usermeta)
621
+ $this->field_map[] = array(
622
+ 'from_tablename' => 'users',
623
+ 'from_fieldname' => 'linkedin',
624
+ 'to_type' => 'user',
625
+ 'to_fieldname' => '_bbp_punbb_user_linkedin'
626
+ );
627
+
628
+ // Store Skype (Stored in usermeta)
629
+ $this->field_map[] = array(
630
+ 'from_tablename' => 'users',
631
+ 'from_fieldname' => 'skype',
632
+ 'to_type' => 'user',
633
+ 'to_fieldname' => '_bbp_punbb_user_skype'
634
+ );
635
+
636
+ // Store Signature (Stored in usermeta)
637
+ $this->field_map[] = array(
638
+ 'from_tablename' => 'users',
639
+ 'from_fieldname' => 'signature',
640
+ 'to_type' => 'user',
641
+ 'to_fieldname' => '_bbp_punbb_user_sig',
642
+ 'callback_method' => 'callback_html'
643
+ );
644
+
645
+ // Store Location (Stored in usermeta)
646
+ $this->field_map[] = array(
647
+ 'from_tablename' => 'users',
648
+ 'from_fieldname' => 'location',
649
+ 'to_type' => 'user',
650
+ 'to_fieldname' => '_bbp_punbb_user_from'
651
+ );
652
+
653
+ // Store Admin Note (Stored in usermeta)
654
+ $this->field_map[] = array(
655
+ 'from_tablename' => 'users',
656
+ 'from_fieldname' => 'admin_note',
657
+ 'to_type' => 'user',
658
+ 'to_fieldname' => '_bbp_punbb_user_admin_note'
659
+ );
660
+ }
661
+
662
+ /**
663
+ * This method allows us to indicates what is or is not converted for each
664
+ * converter.
665
+ */
666
+ public function info()
667
+ {
668
+ return '';
669
+ }
670
+
671
+ /**
672
+ * This method is to save the salt and password together. That
673
+ * way when we authenticate it we can get it out of the database
674
+ * as one value. Array values are auto sanitized by WordPress.
675
+ */
676
+ public function callback_savepass( $field, $row )
677
+ {
678
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
679
+ return $pass_array;
680
+ }
681
+
682
+ /**
683
+ * This method is to take the pass out of the database and compare
684
+ * to a pass the user has typed in.
685
+ */
686
+ public function authenticate_pass( $password, $serialized_pass )
687
+ {
688
+ $pass_array = unserialize( $serialized_pass );
689
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
690
+ }
691
+
692
+ /**
693
+ * Translate the post status from PunBB v1.4.2 numeric's to WordPress's strings.
694
+ *
695
+ * @param int $status PunBB v1.4.2 numeric topic status
696
+ * @return string WordPress safe
697
+ */
698
+ public function callback_topic_status( $status = 0 ) {
699
+ switch ( $status ) {
700
+ case 1 :
701
+ $status = 'closed';
702
+ break;
703
+
704
+ case 0 :
705
+ default :
706
+ $status = 'publish';
707
+ break;
708
+ }
709
+ return $status;
710
+ }
711
+
712
+ /**
713
+ * Translate the topic sticky status type from PunBB v1.4.2 numeric's to WordPress's strings.
714
+ *
715
+ * @param int $status PunBB v1.4.2 numeric forum type
716
+ * @return string WordPress safe
717
+ */
718
+ public function callback_sticky_status( $status = 0 ) {
719
+ switch ( $status ) {
720
+ case 1 :
721
+ $status = 'sticky'; // PunBB Sticky 'topic_sticky = 1'
722
+ break;
723
+
724
+ case 0 :
725
+ default :
726
+ $status = 'normal'; // PunBB Normal Topic 'topic_sticky = 0'
727
+ break;
728
+ }
729
+ return $status;
730
+ }
731
+
732
+ /**
733
+ * Verify the topic/reply count.
734
+ *
735
+ * @param int $count PunBB v1.4.2 topic/reply counts
736
+ * @return string WordPress safe
737
+ */
738
+ public function callback_topic_reply_count( $count = 1 ) {
739
+ $count = absint( (int) $count - 1 );
740
+ return $count;
741
+ }
742
+ }
includes/admin/converters/SMF.php CHANGED
@@ -1,740 +1,815 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress SMF Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
+ /**
11
+ * Implementation of SMF Forum converter.
12
+ *
13
+ * @since 2.5.0 bbPress (r5189)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/smf
16
+ */
17
+ class SMF extends BBP_Converter_Base {
18
+
19
+ /**
20
+ * Main Constructor
21
+ *
22
+ * @uses SMF::setup_globals()
23
+ */
24
+ function __construct() {
25
+ parent::__construct();
26
+ $this->setup_globals();
27
+ }
28
+
29
+ /**
30
+ * Sets up the field mappings
31
+ */
32
+ public function setup_globals() {
33
+
34
+ /** Forum Section ******************************************************/
35
+
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'boards',
39
+ 'from_fieldname' => 'id_board',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
+ );
43
+
44
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'boards',
47
+ 'from_fieldname' => 'id_parent',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
+ );
51
+
52
+ // Forum topic count (Stored in postmeta)
53
+ $this->field_map[] = array(
54
+ 'from_tablename' => 'boards',
55
+ 'from_fieldname' => 'num_topics',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_topic_count'
58
+ );
59
+
60
+ // Forum reply count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'boards',
63
+ 'from_fieldname' => 'num_posts',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_reply_count'
66
+ );
67
+
68
+ // Forum total topic count (Stored in postmeta)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'boards',
71
+ 'from_fieldname' => 'num_topics',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_topic_count'
74
+ );
75
+
76
+ // Forum total reply count (Stored in postmeta)
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'boards',
79
+ 'from_fieldname' => 'num_posts',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => '_bbp_total_reply_count'
82
+ );
83
+
84
+ // Forum title.
85
+ $this->field_map[] = array(
86
+ 'from_tablename' => 'boards',
87
+ 'from_fieldname' => 'name',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => 'post_title'
90
+ );
91
+
92
+ // Forum slug (Clean name to avoid conflicts)
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'boards',
95
+ 'from_fieldname' => 'name',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_name',
98
+ 'callback_method' => 'callback_slug'
99
+ );
100
+
101
+ // Forum description.
102
+ $this->field_map[] = array(
103
+ 'from_tablename' => 'boards',
104
+ 'from_fieldname' => 'description',
105
+ 'to_type' => 'forum',
106
+ 'to_fieldname' => 'post_content',
107
+ 'callback_method' => 'callback_null'
108
+ );
109
+
110
+ // Forum display order (Starts from 1)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'boards',
113
+ 'from_fieldname' => 'board_order',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'menu_order'
116
+ );
117
+
118
+ // Forum type (Set a default value 'forum', Stored in postmeta)
119
+ $this->field_map[] = array(
120
+ 'to_type' => 'forum',
121
+ 'to_fieldname' => '_bbp_forum_type',
122
+ 'default' => 'forum'
123
+ );
124
+
125
+ // Forum status (Set a default value 'open', Stored in postmeta)
126
+ $this->field_map[] = array(
127
+ 'to_type' => 'forum',
128
+ 'to_fieldname' => '_bbp_status',
129
+ 'default' => 'open'
130
+ );
131
+
132
+ // Forum dates.
133
+ $this->field_map[] = array(
134
+ 'to_type' => 'forum',
135
+ 'to_fieldname' => 'post_date',
136
+ 'default' => date('Y-m-d H:i:s')
137
+ );
138
+ $this->field_map[] = array(
139
+ 'to_type' => 'forum',
140
+ 'to_fieldname' => 'post_date_gmt',
141
+ 'default' => date('Y-m-d H:i:s')
142
+ );
143
+ $this->field_map[] = array(
144
+ 'to_type' => 'forum',
145
+ 'to_fieldname' => 'post_modified',
146
+ 'default' => date('Y-m-d H:i:s')
147
+ );
148
+ $this->field_map[] = array(
149
+ 'to_type' => 'forum',
150
+ 'to_fieldname' => 'post_modified_gmt',
151
+ 'default' => date('Y-m-d H:i:s')
152
+ );
153
+
154
+ /** Forum Subscriptions Section ***************************************/
155
+
156
+ // Subscribed forum ID (Stored in usermeta)
157
+ $this->field_map[] = array(
158
+ 'from_tablename' => 'log_notify',
159
+ 'from_fieldname' => 'id_board',
160
+ 'from_expression' => 'WHERE log_notify.id_board != 0',
161
+ 'to_type' => 'forum_subscriptions',
162
+ 'to_fieldname' => '_bbp_forum_subscriptions'
163
+ );
164
+
165
+ // Subscribed user ID (Stored in usermeta)
166
+ $this->field_map[] = array(
167
+ 'from_tablename' => 'log_notify',
168
+ 'from_fieldname' => 'id_member',
169
+ 'from_expression' => 'WHERE log_notify.id_board != 0',
170
+ 'to_type' => 'forum_subscriptions',
171
+ 'to_fieldname' => 'user_id',
172
+ 'callback_method' => 'callback_userid'
173
+ );
174
+
175
+ /** Topic Section ******************************************************/
176
+
177
+ // Old topic id (Stored in postmeta)
178
+ $this->field_map[] = array(
179
+ 'from_tablename' => 'topics',
180
+ 'from_fieldname' => 'id_topic',
181
+ 'to_type' => 'topic',
182
+ 'to_fieldname' => '_bbp_old_topic_id'
183
+ );
184
+
185
+ // Topic reply count (Stored in postmeta)
186
+ $this->field_map[] = array(
187
+ 'from_tablename' => 'topics',
188
+ 'from_fieldname' => 'num_replies',
189
+ 'to_type' => 'topic',
190
+ 'to_fieldname' => '_bbp_reply_count',
191
+ 'callback_method' => 'callback_topic_reply_count'
192
+ );
193
+
194
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
195
+ $this->field_map[] = array(
196
+ 'from_tablename' => 'topics',
197
+ 'from_fieldname' => 'num_replies',
198
+ 'to_type' => 'topic',
199
+ 'to_fieldname' => '_bbp_total_reply_count',
200
+ 'callback_method' => 'callback_topic_reply_count'
201
+ );
202
+
203
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
204
+ $this->field_map[] = array(
205
+ 'from_tablename' => 'topics',
206
+ 'from_fieldname' => 'id_board',
207
+ 'to_type' => 'topic',
208
+ 'to_fieldname' => '_bbp_forum_id',
209
+ 'callback_method' => 'callback_forumid'
210
+ );
211
+
212
+ // Topic author.
213
+ $this->field_map[] = array(
214
+ 'from_tablename' => 'topics',
215
+ 'from_fieldname' => 'id_member_started',
216
+ 'to_type' => 'topic',
217
+ 'to_fieldname' => 'post_author',
218
+ 'callback_method' => 'callback_userid'
219
+ );
220
+
221
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'messages',
224
+ 'from_fieldname' => 'poster_name',
225
+ 'join_tablename' => 'topics',
226
+ 'join_type' => 'LEFT',
227
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
228
+ 'to_type' => 'topic',
229
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
230
+ );
231
+
232
+ // Is the topic anonymous (Stored in postmeta)
233
+ $this->field_map[] = array(
234
+ 'from_tablename' => 'topics',
235
+ 'from_fieldname' => 'id_member_started',
236
+ 'to_type' => 'topic',
237
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
238
+ 'callback_method' => 'callback_check_anonymous'
239
+ );
240
+
241
+ // Topic Author ip (Stored in postmeta)
242
+ $this->field_map[] = array(
243
+ 'from_tablename' => 'messages',
244
+ 'from_fieldname' => 'poster_ip',
245
+ 'join_tablename' => 'topics',
246
+ 'join_type' => 'LEFT',
247
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
248
+ 'to_type' => 'topic',
249
+ 'to_fieldname' => '_bbp_author_ip'
250
+ );
251
+
252
+ // Topic content.
253
+ // Note: We join the 'messages' table because 'topics' table does not have content.
254
+ $this->field_map[] = array(
255
+ 'from_tablename' => 'messages',
256
+ 'from_fieldname' => 'body',
257
+ 'join_tablename' => 'topics',
258
+ 'join_type' => 'LEFT',
259
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
260
+ 'to_type' => 'topic',
261
+ 'to_fieldname' => 'post_content',
262
+ 'callback_method' => 'callback_html'
263
+ );
264
+
265
+ // Topic title.
266
+ $this->field_map[] = array(
267
+ 'from_tablename' => 'messages',
268
+ 'from_fieldname' => 'subject',
269
+ 'join_tablename' => 'topics',
270
+ 'join_type' => 'LEFT',
271
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
272
+ 'to_type' => 'topic',
273
+ 'to_fieldname' => 'post_title'
274
+ );
275
+
276
+ // Topic slug (Clean name to avoid conflicts)
277
+ $this->field_map[] = array(
278
+ 'from_tablename' => 'messages',
279
+ 'from_fieldname' => 'subject',
280
+ 'join_tablename' => 'topics',
281
+ 'join_type' => 'LEFT',
282
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
283
+ 'to_type' => 'topic',
284
+ 'to_fieldname' => 'post_name',
285
+ 'callback_method' => 'callback_slug'
286
+ );
287
+
288
+ // Topic parent forum id (If no parent, then 0)
289
+ $this->field_map[] = array(
290
+ 'from_tablename' => 'topics',
291
+ 'from_fieldname' => 'id_board',
292
+ 'to_type' => 'topic',
293
+ 'to_fieldname' => 'post_parent',
294
+ 'callback_method' => 'callback_forumid'
295
+ );
296
+
297
+ // Topic status (Open or Closed, SMF v2.0.4 0=open & 1=closed)
298
+ $this->field_map[] = array(
299
+ 'from_tablename' => 'topics',
300
+ 'from_fieldname' => 'locked',
301
+ 'to_type' => 'topic',
302
+ 'to_fieldname' => '_bbp_old_closed_status_id',
303
+ 'callback_method' => 'callback_topic_status'
304
+ );
305
+
306
+ // Sticky status (Stored in postmeta)
307
+ $this->field_map[] = array(
308
+ 'from_tablename' => 'topics',
309
+ 'from_fieldname' => 'is_sticky',
310
+ 'to_type' => 'topic',
311
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
312
+ 'callback_method' => 'callback_sticky_status'
313
+ );
314
+
315
+ // Topic dates.
316
+ $this->field_map[] = array(
317
+ 'from_tablename' => 'messages',
318
+ 'from_fieldname' => 'poster_time',
319
+ 'join_tablename' => 'topics',
320
+ 'join_type' => 'LEFT',
321
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
322
+ 'to_type' => 'topic',
323
+ 'to_fieldname' => 'post_date',
324
+ 'callback_method' => 'callback_datetime'
325
+ );
326
+ $this->field_map[] = array(
327
+ 'from_tablename' => 'messages',
328
+ 'from_fieldname' => 'poster_time',
329
+ 'join_tablename' => 'topics',
330
+ 'join_type' => 'LEFT',
331
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
332
+ 'to_type' => 'topic',
333
+ 'to_fieldname' => 'post_date_gmt',
334
+ 'callback_method' => 'callback_datetime'
335
+ );
336
+ $this->field_map[] = array(
337
+ 'from_tablename' => 'messages',
338
+ 'from_fieldname' => 'poster_time',
339
+ 'join_tablename' => 'topics',
340
+ 'join_type' => 'LEFT',
341
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
342
+ 'to_type' => 'topic',
343
+ 'to_fieldname' => 'post_modified',
344
+ 'callback_method' => 'callback_datetime'
345
+ );
346
+ $this->field_map[] = array(
347
+ 'from_tablename' => 'messages',
348
+ 'from_fieldname' => 'poster_time',
349
+ 'join_tablename' => 'topics',
350
+ 'join_type' => 'LEFT',
351
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
352
+ 'to_type' => 'topic',
353
+ 'to_fieldname' => 'post_modified_gmt',
354
+ 'callback_method' => 'callback_datetime'
355
+ );
356
+ $this->field_map[] = array(
357
+ 'from_tablename' => 'messages',
358
+ 'from_fieldname' => 'poster_time',
359
+ 'join_tablename' => 'topics',
360
+ 'join_type' => 'LEFT',
361
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
362
+ 'to_type' => 'topic',
363
+ 'to_fieldname' => '_bbp_last_active_time',
364
+ 'callback_method' => 'callback_datetime'
365
+ );
366
+
367
+ /** Tags Section ******************************************************/
368
+
369
+ /**
370
+ * SMF v2.0.4 Forums do not support topic tags out of the box
371
+ */
372
+
373
+ /** Topic Subscriptions Section ***************************************/
374
+
375
+ // Subscribed topic ID (Stored in usermeta)
376
+ $this->field_map[] = array(
377
+ 'from_tablename' => 'log_notify',
378
+ 'from_fieldname' => 'id_topic',
379
+ 'from_expression' => 'WHERE log_notify.id_topic != 0',
380
+ 'to_type' => 'topic_subscriptions',
381
+ 'to_fieldname' => '_bbp_subscriptions'
382
+ );
383
+
384
+ // Subscribed user ID (Stored in usermeta)
385
+ $this->field_map[] = array(
386
+ 'from_tablename' => 'log_notify',
387
+ 'from_fieldname' => 'id_member',
388
+ 'from_expression' => 'WHERE log_notify.id_topic != 0',
389
+ 'to_type' => 'topic_subscriptions',
390
+ 'to_fieldname' => 'user_id',
391
+ 'callback_method' => 'callback_userid'
392
+ );
393
+
394
+ /** Reply Section *****************************************************/
395
+
396
+ // Old reply id (Stored in postmeta)
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'messages',
399
+ 'from_fieldname' => 'id_msg',
400
+ 'to_type' => 'reply',
401
+ 'to_fieldname' => '_bbp_old_reply_id'
402
+ );
403
+
404
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
405
+ $this->field_map[] = array(
406
+ 'from_tablename' => 'topics',
407
+ 'from_fieldname' => 'id_board',
408
+ 'join_tablename' => 'messages',
409
+ 'join_type' => 'LEFT',
410
+ 'join_expression' => 'USING (id_topic) WHERE topics.id_first_msg != messages.id_msg',
411
+ 'to_type' => 'reply',
412
+ 'to_fieldname' => '_bbp_forum_id',
413
+ 'callback_method' => 'callback_topicid_to_forumid'
414
+ );
415
+
416
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
417
+ $this->field_map[] = array(
418
+ 'from_tablename' => 'messages',
419
+ 'from_fieldname' => 'id_topic',
420
+ 'to_type' => 'reply',
421
+ 'to_fieldname' => '_bbp_topic_id',
422
+ 'callback_method' => 'callback_topicid'
423
+ );
424
+
425
+ // Reply author ip (Stored in postmeta)
426
+ $this->field_map[] = array(
427
+ 'from_tablename' => 'messages',
428
+ 'from_fieldname' => 'poster_ip',
429
+ 'to_type' => 'reply',
430
+ 'to_fieldname' => '_bbp_author_ip'
431
+ );
432
+
433
+ // Reply author.
434
+ $this->field_map[] = array(
435
+ 'from_tablename' => 'messages',
436
+ 'from_fieldname' => 'id_member',
437
+ 'to_type' => 'reply',
438
+ 'to_fieldname' => 'post_author',
439
+ 'callback_method' => 'callback_userid'
440
+ );
441
+
442
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
443
+ $this->field_map[] = array(
444
+ 'from_tablename' => 'messages',
445
+ 'from_fieldname' => 'poster_name',
446
+ 'to_type' => 'reply',
447
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
448
+ );
449
+
450
+ // Is the reply anonymous (Stored in postmeta)
451
+ $this->field_map[] = array(
452
+ 'from_tablename' => 'messages',
453
+ 'from_fieldname' => 'id_member',
454
+ 'to_type' => 'reply',
455
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
456
+ 'callback_method' => 'callback_check_anonymous'
457
+ );
458
+
459
+ // Reply content.
460
+ $this->field_map[] = array(
461
+ 'from_tablename' => 'messages',
462
+ 'from_fieldname' => 'body',
463
+ 'to_type' => 'reply',
464
+ 'to_fieldname' => 'post_content',
465
+ 'callback_method' => 'callback_html'
466
+ );
467
+
468
+ // Reply parent topic id (If no parent, then 0)
469
+ $this->field_map[] = array(
470
+ 'from_tablename' => 'messages',
471
+ 'from_fieldname' => 'id_topic',
472
+ 'to_type' => 'reply',
473
+ 'to_fieldname' => 'post_parent',
474
+ 'callback_method' => 'callback_topicid'
475
+ );
476
+
477
+ // Reply dates.
478
+ $this->field_map[] = array(
479
+ 'from_tablename' => 'messages',
480
+ 'from_fieldname' => 'poster_time',
481
+ 'to_type' => 'reply',
482
+ 'to_fieldname' => 'post_date',
483
+ 'callback_method' => 'callback_datetime'
484
+ );
485
+ $this->field_map[] = array(
486
+ 'from_tablename' => 'messages',
487
+ 'from_fieldname' => 'poster_time',
488
+ 'to_type' => 'reply',
489
+ 'to_fieldname' => 'post_date_gmt',
490
+ 'callback_method' => 'callback_datetime'
491
+ );
492
+ $this->field_map[] = array(
493
+ 'from_tablename' => 'messages',
494
+ 'from_fieldname' => 'poster_time',
495
+ 'to_type' => 'reply',
496
+ 'to_fieldname' => 'post_modified',
497
+ 'callback_method' => 'callback_datetime'
498
+ );
499
+ $this->field_map[] = array(
500
+ 'from_tablename' => 'messages',
501
+ 'from_fieldname' => 'poster_time',
502
+ 'to_type' => 'reply',
503
+ 'to_fieldname' => 'post_modified_gmt',
504
+ 'callback_method' => 'callback_datetime'
505
+ );
506
+
507
+ /** User Section ******************************************************/
508
+
509
+ // Store old user id (Stored in usermeta)
510
+ $this->field_map[] = array(
511
+ 'from_tablename' => 'members',
512
+ 'from_fieldname' => 'id_member',
513
+ 'to_type' => 'user',
514
+ 'to_fieldname' => '_bbp_old_user_id'
515
+ );
516
+
517
+ // Store old user password (Stored in usermeta serialized with salt)
518
+ $this->field_map[] = array(
519
+ 'from_tablename' => 'members',
520
+ 'from_fieldname' => 'passwd',
521
+ 'to_type' => 'user',
522
+ 'to_fieldname' => '_bbp_password',
523
+ 'callback_method' => 'callback_savepass'
524
+ );
525
+
526
+ // User password verify class (Stored in usermeta for verifying password)
527
+ $this->field_map[] = array(
528
+ 'to_type' => 'user',
529
+ 'to_fieldname' => '_bbp_class',
530
+ 'default' => 'SMF'
531
+ );
532
+
533
+ // User name.
534
+ $this->field_map[] = array(
535
+ 'from_tablename' => 'members',
536
+ 'from_fieldname' => 'member_name',
537
+ 'to_type' => 'user',
538
+ 'to_fieldname' => 'user_login'
539
+ );
540
+
541
+ // User nice name.
542
+ $this->field_map[] = array(
543
+ 'from_tablename' => 'members',
544
+ 'from_fieldname' => 'member_name',
545
+ 'to_type' => 'user',
546
+ 'to_fieldname' => 'user_nicename'
547
+ );
548
+
549
+ // User email.
550
+ $this->field_map[] = array(
551
+ 'from_tablename' => 'members',
552
+ 'from_fieldname' => 'email_address',
553
+ 'to_type' => 'user',
554
+ 'to_fieldname' => 'user_email'
555
+ );
556
+
557
+ // User homepage.
558
+ $this->field_map[] = array(
559
+ 'from_tablename' => 'members',
560
+ 'from_fieldname' => 'website_url',
561
+ 'to_type' => 'user',
562
+ 'to_fieldname' => 'user_url'
563
+ );
564
+
565
+ // User registered.
566
+ $this->field_map[] = array(
567
+ 'from_tablename' => 'members',
568
+ 'from_fieldname' => 'date_registered',
569
+ 'to_type' => 'user',
570
+ 'to_fieldname' => 'user_registered',
571
+ 'callback_method' => 'callback_datetime'
572
+ );
573
+
574
+ // User display name.
575
+ $this->field_map[] = array(
576
+ 'from_tablename' => 'members',
577
+ 'from_fieldname' => 'real_name',
578
+ 'to_type' => 'user',
579
+ 'to_fieldname' => 'display_name'
580
+ );
581
+
582
+ // User AIM (Stored in usermeta)
583
+ $this->field_map[] = array(
584
+ 'from_tablename' => 'members',
585
+ 'from_fieldname' => 'aim',
586
+ 'to_type' => 'user',
587
+ 'to_fieldname' => '_bbp_smf_user_aim'
588
+ );
589
+
590
+ // User Yahoo (Stored in usermeta)
591
+ $this->field_map[] = array(
592
+ 'from_tablename' => 'members',
593
+ 'from_fieldname' => 'yim',
594
+ 'to_type' => 'user',
595
+ 'to_fieldname' => '_bbp_smf_user_yim'
596
+ );
597
+
598
+ // Store ICQ (Stored in usermeta)
599
+ $this->field_map[] = array(
600
+ 'from_tablename' => 'members',
601
+ 'from_fieldname' => 'icq',
602
+ 'to_type' => 'user',
603
+ 'to_fieldname' => '_bbp_smf_user_icq'
604
+ );
605
+
606
+ // Store MSN (Stored in usermeta)
607
+ $this->field_map[] = array(
608
+ 'from_tablename' => 'members',
609
+ 'from_fieldname' => 'msn',
610
+ 'to_type' => 'user',
611
+ 'to_fieldname' => '_bbp_smf_user_msn'
612
+ );
613
+
614
+ // Store Signature (Stored in usermeta)
615
+ $this->field_map[] = array(
616
+ 'from_tablename' => 'members',
617
+ 'from_fieldname' => 'signature',
618
+ 'to_type' => 'user',
619
+ 'to_fieldname' => '_bbp_smf_user_sig',
620
+ 'callback_method' => 'callback_html'
621
+ );
622
+
623
+ // Store Avatar (Stored in usermeta)
624
+ $this->field_map[] = array(
625
+ 'from_tablename' => 'members',
626
+ 'from_fieldname' => 'avatar',
627
+ 'to_type' => 'user',
628
+ 'to_fieldname' => '_bbp_smf_user_avatar',
629
+ 'callback_method' => 'callback_html'
630
+ );
631
+
632
+ // Store Location (Stored in usermeta)
633
+ $this->field_map[] = array(
634
+ 'from_tablename' => 'members',
635
+ 'from_fieldname' => 'location',
636
+ 'to_type' => 'user',
637
+ 'to_fieldname' => '_bbp_smf_user_location',
638
+ 'callback_method' => 'callback_html'
639
+ );
640
+
641
+ // Store Personal Text (Stored in usermeta)
642
+ $this->field_map[] = array(
643
+ 'from_tablename' => 'members',
644
+ 'from_fieldname' => 'personal_text',
645
+ 'to_type' => 'user',
646
+ 'to_fieldname' => '_bbp_smf_user_personal_text',
647
+ 'callback_method' => 'callback_html'
648
+ );
649
+ }
650
+
651
+ /**
652
+ * This method allows us to indicates what is or is not converted for each
653
+ * converter.
654
+ */
655
+ public function info()
656
+ {
657
+ return '';
658
+ }
659
+
660
+ /**
661
+ * This method is to save the salt and password together. That
662
+ * way when we authenticate it we can get it out of the database
663
+ * as one value. Array values are auto sanitized by WordPress.
664
+ */
665
+ public function callback_savepass( $field, $row )
666
+ {
667
+ $pass_array = array( 'hash' => $field, 'username' => $row['member_name'] );
668
+ return $pass_array;
669
+ }
670
+
671
+ /**
672
+ * This method is to take the pass out of the database and compare
673
+ * to a pass the user has typed in.
674
+ */
675
+ public function authenticate_pass( $password, $serialized_pass )
676
+ {
677
+ $pass_array = unserialize( $serialized_pass );
678
+ return ( $pass_array['hash'] === sha1( strtolower( $pass_array['username'] ) . $password ) ? true : false );
679
+ }
680
+
681
+ /**
682
+ * Translate the post status from SMF v2.0.4 numeric's to WordPress's strings.
683
+ *
684
+ * @param int $status SMF v2.0.4 numeric topic status
685
+ * @return string WordPress safe
686
+ */
687
+ public function callback_topic_status( $status = 0 ) {
688
+ switch ( $status ) {
689
+ case 1 :
690
+ $status = 'closed';
691
+ break;
692
+
693
+ case 0 :
694
+ default :
695
+ $status = 'publish';
696
+ break;
697
+ }
698
+ return $status;
699
+ }
700
+
701
+ /**
702
+ * Translate the topic sticky status type from SMF v2.0.4 numeric's to WordPress's strings.
703
+ *
704
+ * @param int $status SMF v2.0.4 numeric forum type
705
+ * @return string WordPress safe
706
+ */
707
+ public function callback_sticky_status( $status = 0 ) {
708
+ switch ( $status ) {
709
+ case 1 :
710
+ $status = 'sticky'; // SMF Sticky 'is_sticky = 1'
711
+ break;
712
+
713
+ case 0 :
714
+ default :
715
+ $status = 'normal'; // SMF normal topic 'is_sticky = 0'
716
+ break;
717
+ }
718
+ return $status;
719
+ }
720
+
721
+ /**
722
+ * Verify the topic/reply count.
723
+ *
724
+ * @param int $count SMF v2.0.4 topic/reply counts
725
+ * @return string WordPress safe
726
+ */
727
+ public function callback_topic_reply_count( $count = 1 ) {
728
+ $count = absint( (int) $count - 1 );
729
+ return $count;
730
+ }
731
+
732
+ /**
733
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
734
+ */
735
+ protected function callback_html( $field ) {
736
+
737
+ // Strips SMF custom HTML first from $field before parsing $field to parser.php
738
+ $SMF_markup = $field;
739
+ $SMF_markup = html_entity_decode( $SMF_markup );
740
+
741
+ // Replace '[quote]' with '<blockquote>'
742
+ $SMF_markup = preg_replace( '/\[quote\]/', '<blockquote>', $SMF_markup );
743
+ // Replace '[quote ($1)]' with '<blockquote>"
744
+ $SMF_markup = preg_replace( '/\[quote (.*?)\]/' , '<blockquote>', $SMF_markup );
745
+ // Replace '[/quote]' with '</blockquote>'
746
+ $SMF_markup = preg_replace( '/\[\/quote\]/', '</blockquote>', $SMF_markup );
747
+
748
+ // Replace '[glow]' with ''
749
+ $SMF_markup = preg_replace( '/\[glow\]/', '', $SMF_markup );
750
+ // Replace '[glow]' with ''
751
+ $SMF_markup = preg_replace( '/\[glow=(.*?)\]/', '', $SMF_markup );
752
+ // Replace '[/glow]' with ''
753
+ $SMF_markup = preg_replace( '/\[\/glow\]/', '', $SMF_markup );
754
+
755
+ // Replace '[shadow]' with ''
756
+ $SMF_markup = preg_replace( '/\[shadow\]/', '', $SMF_markup );
757
+ // Replace '[shadow]' with ''
758
+ $SMF_markup = preg_replace( '/\[shadow=(.*?)\]/', '', $SMF_markup );
759
+ // Replace '[/shadow]' with ''
760
+ $SMF_markup = preg_replace( '/\[\/shadow\]/', '', $SMF_markup );
761
+
762
+ // Replace '[move]' with ''
763
+ $SMF_markup = preg_replace( '/\[move\]/', '', $SMF_markup );
764
+ // Replace '[/move]' with ''
765
+ $SMF_markup = preg_replace( '/\[\/move\]/', '', $SMF_markup );
766
+
767
+ // Replace '[table]' with '<table>'
768
+ $SMF_markup = preg_replace( '/\[table\]/', '<table>', $SMF_markup );
769
+ // Replace '[/table]' with '</table>'
770
+ $SMF_markup = preg_replace( '/\[\/table\]/', '</table>', $SMF_markup );
771
+ // Replace '[tr]' with '<tr>'
772
+ $SMF_markup = preg_replace( '/\[tr\]/', '<tr>', $SMF_markup );
773
+ // Replace '[/tr]' with '</tr>'
774
+ $SMF_markup = preg_replace( '/\[\/tr\]/', '</tr>', $SMF_markup );
775
+ // Replace '[td]' with '<td>'
776
+ $SMF_markup = preg_replace( '/\[td\]/', '<td>', $SMF_markup );
777
+ // Replace '[/td]' with '</td>'
778
+ $SMF_markup = preg_replace( '/\[\/td\]/', '</td>', $SMF_markup );
779
+
780
+ // Replace '[list]' with '<ul>'
781
+ $SMF_markup = preg_replace( '/\[list\]/', '<ul>', $SMF_markup );
782
+ // Replace '[liist type=decimal]' with '<ol type="a">'
783
+ $SMF_markup = preg_replace( '/\[list\ type=decimal\]/', '<ol type="a">', $SMF_markup );
784
+ // Replace '[li]' with '<li>'
785
+ $SMF_markup = preg_replace( '/\[li\]/', '<li>', $SMF_markup );
786
+ // Replace '[/li]' with '</li>'
787
+ $SMF_markup = preg_replace( '/\[\/li\]/', '</li>', $SMF_markup );
788
+
789
+ // Replace '[tt]' with '<tt>'
790
+ $SMF_markup = preg_replace( '/\[tt\]/', '<tt>', $SMF_markup );
791
+ // Replace '[/tt]' with '</tt>'
792
+ $SMF_markup = preg_replace( '/\[\/tt\]/', '</tt>', $SMF_markup );
793
+
794
+ // Replace '<br />' with '<br>'
795
+ $SMF_markup = preg_replace( '/\<br \/\>/', '<br>', $SMF_markup );
796
+
797
+ // Replace '[size=$1]' with '<span style="font-size:$1%;">$3</span>'
798
+ $SMF_markup = preg_replace( '/\[size=(.*?)\]/', '<span style="font-size:$1">', $SMF_markup );
799
+ // Replace '[/size]' with '</span>'
800
+ $SMF_markup = preg_replace( '/\[\/size\]/', '</span>', $SMF_markup );
801
+
802
+ // Replace non-break space '&nbsp;' with space ' '
803
+ $SMF_markup = preg_replace ( '/&nbsp;/', ' ', $SMF_markup );
804
+
805
+ // Now that SMF custom HTML has been stripped put the cleaned HTML back in $field
806
+ $field = $SMF_markup;
807
+
808
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
809
+ require_once( bbpress()->admin->admin_dir . 'parser.php' );
810
+ $bbcode = BBCode::getInstance();
811
+ $bbcode->enable_smileys = false;
812
+ $bbcode->smiley_regex = false;
813
+ return html_entity_decode( $bbcode->Parse( $field ) );
814
+ }
815
+ }
includes/admin/converters/SimplePress5.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of SimplePress v5 converter.
5
  *
6
- * @since bbPress (r4638)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/simplepress/
 
8
  */
9
  class SimplePress5 extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class SimplePress5 extends BBP_Converter_Base {
25
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
30
  'from_tablename' => 'sfforums',
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)
@@ -38,7 +46,7 @@ class SimplePress5 extends BBP_Converter_Base {
38
  'from_tablename' => 'sfforums',
39
  'from_fieldname' => 'parent',
40
  'to_type' => 'forum',
41
- 'to_fieldname' => '_bbp_forum_parent_id'
42
  );
43
 
44
  // Forum topic count (Stored in postmeta)
@@ -107,6 +115,20 @@ class SimplePress5 extends BBP_Converter_Base {
107
  'to_fieldname' => 'menu_order'
108
  );
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  // Forum dates.
111
  $this->field_map[] = array(
112
  'to_type' => 'forums',
@@ -131,12 +153,12 @@ class SimplePress5 extends BBP_Converter_Base {
131
 
132
  /** Topic Section *****************************************************/
133
 
134
- // Topic id (Stored in postmeta)
135
  $this->field_map[] = array(
136
  'from_tablename' => 'sftopics',
137
  'from_fieldname' => 'topic_id',
138
  'to_type' => 'topic',
139
- 'to_fieldname' => '_bbp_topic_id'
140
  );
141
 
142
  // Topic reply count (Stored in postmeta)
@@ -166,6 +188,37 @@ class SimplePress5 extends BBP_Converter_Base {
166
  'callback_method' => 'callback_userid'
167
  );
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  // Topic content.
170
  // Note: We join the sfposts table because sftopics do not have content.
171
  $this->field_map[] = array(
@@ -210,16 +263,16 @@ class SimplePress5 extends BBP_Converter_Base {
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
 
@@ -263,21 +316,22 @@ class SimplePress5 extends BBP_Converter_Base {
263
 
264
  /** Reply Section *****************************************************/
265
 
266
- // Reply id (Stored in postmeta)
267
  $this->field_map[] = array(
268
  'from_tablename' => 'sfposts',
269
  'from_fieldname' => 'post_id',
270
  'to_type' => 'reply',
271
- 'to_fieldname' => '_bbp_post_id'
272
  );
273
 
274
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
275
  $this->field_map[] = array(
276
  'from_tablename' => 'sfposts',
277
  'from_fieldname' => 'forum_id',
 
278
  'to_type' => 'reply',
279
  'to_fieldname' => '_bbp_forum_id',
280
- 'callback_method' => 'callback_topicid_to_forumid'
281
  );
282
 
283
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
@@ -306,30 +360,21 @@ class SimplePress5 extends BBP_Converter_Base {
306
  'callback_method' => 'callback_userid'
307
  );
308
 
309
- // Reply title.
310
- // Note: We join the sftopics table because sfposts table does not include topic title.
311
  $this->field_map[] = array(
312
- 'from_tablename' => 'sftopics',
313
- 'from_fieldname' => 'topic_name',
314
- 'join_tablename' => 'sfposts',
315
- 'join_type' => 'LEFT',
316
- 'join_expression' => 'USING (topic_id) WHERE sfposts.post_index != 1',
317
  'to_type' => 'reply',
318
- 'to_fieldname' => 'post_title',
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.
@@ -378,15 +423,15 @@ class SimplePress5 extends BBP_Converter_Base {
378
 
379
  /** User Section ******************************************************/
380
 
381
- // Store old User id (Stored in usermeta)
382
  $this->field_map[] = array(
383
  'from_tablename' => 'users',
384
  'from_fieldname' => 'ID',
385
  'to_type' => 'user',
386
- 'to_fieldname' => '_bbp_user_id'
387
  );
388
 
389
- // Store old User password (Stored in usermeta)
390
  $this->field_map[] = array(
391
  'from_tablename' => 'users',
392
  'from_fieldname' => 'user_pass',
@@ -527,17 +572,6 @@ class SimplePress5 extends BBP_Converter_Base {
527
  return $count;
528
  }
529
 
530
- /**
531
- * Set the reply title
532
- *
533
- * @param string $title Simple:Press v5.x topic title of this reply
534
- * @return string Prefixed topic title, or empty string
535
- */
536
- public function callback_reply_title( $title = '' ) {
537
- $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
538
- return $title;
539
- }
540
-
541
  /**
542
  * This callback processes any custom parser.php attributes and custom HTML code with preg_replace
543
  */
1
  <?php
2
 
3
+ /**
4
+ * bbPress SimplePress5 Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of SimplePress v5 converter.
12
  *
13
+ * @since 2.3.0 bbPress (r4638)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/simplepress/
16
  */
17
  class SimplePress5 extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'sfforums',
39
  'from_fieldname' => 'forum_id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'sfforums',
47
  'from_fieldname' => 'parent',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
115
  'to_fieldname' => 'menu_order'
116
  );
117
 
118
+ // Forum type (Set a default value 'forum', Stored in postmeta)
119
+ $this->field_map[] = array(
120
+ 'to_type' => 'forum',
121
+ 'to_fieldname' => '_bbp_forum_type',
122
+ 'default' => 'forum'
123
+ );
124
+
125
+ // Forum status (Set a default value 'open', Stored in postmeta)
126
+ $this->field_map[] = array(
127
+ 'to_type' => 'forum',
128
+ 'to_fieldname' => '_bbp_status',
129
+ 'default' => 'open'
130
+ );
131
+
132
  // Forum dates.
133
  $this->field_map[] = array(
134
  'to_type' => 'forums',
153
 
154
  /** Topic Section *****************************************************/
155
 
156
+ // Old topic id (Stored in postmeta)
157
  $this->field_map[] = array(
158
  'from_tablename' => 'sftopics',
159
  'from_fieldname' => 'topic_id',
160
  'to_type' => 'topic',
161
+ 'to_fieldname' => '_bbp_old_topic_id'
162
  );
163
 
164
  // Topic reply count (Stored in postmeta)
188
  'callback_method' => 'callback_userid'
189
  );
190
 
191
+ // Topic author ip (Stored in postmeta)
192
+ $this->field_map[] = array(
193
+ 'from_tablename' => 'sfposts',
194
+ 'from_fieldname' => 'poster_ip',
195
+ 'join_tablename' => 'sftopics',
196
+ 'join_type' => 'INNER',
197
+ 'join_expression' => 'USING (topic_id) WHERE sfposts.post_index = 1',
198
+ 'to_type' => 'topic',
199
+ 'to_fieldname' => '_bbp_author_ip'
200
+ );
201
+
202
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
203
+ $this->field_map[] = array(
204
+ 'from_tablename' => 'sfposts',
205
+ 'from_fieldname' => 'guest_name',
206
+ 'join_tablename' => 'sftopics',
207
+ 'join_type' => 'INNER',
208
+ 'join_expression' => 'USING (topic_id) WHERE sfposts.post_index = 1',
209
+ 'to_type' => 'topic',
210
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
211
+ );
212
+
213
+ // Is the topic anonymous (Stored in postmeta)
214
+ $this->field_map[] = array(
215
+ 'from_tablename' => 'sftopics',
216
+ 'from_fieldname' => 'user_id',
217
+ 'to_type' => 'topic',
218
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
219
+ 'callback_method' => 'callback_check_anonymous'
220
+ );
221
+
222
  // Topic content.
223
  // Note: We join the sfposts table because sftopics do not have content.
224
  $this->field_map[] = array(
263
  'from_tablename' => 'sftopics',
264
  'from_fieldname' => 'topic_status',
265
  'to_type' => 'topic',
266
+ 'to_fieldname' => '_bbp_old_closed_status_id',
267
  'callback_method' => 'callback_status'
268
  );
269
 
270
+ // Sticky status (Stored in postmeta)
271
  $this->field_map[] = array(
272
  'from_tablename' => 'sftopics',
273
  'from_fieldname' => 'topic_pinned',
274
  'to_type' => 'topic',
275
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
276
  'callback_method' => 'callback_sticky_status'
277
  );
278
 
316
 
317
  /** Reply Section *****************************************************/
318
 
319
+ // Old reply id (Stored in postmeta)
320
  $this->field_map[] = array(
321
  'from_tablename' => 'sfposts',
322
  'from_fieldname' => 'post_id',
323
  'to_type' => 'reply',
324
+ 'to_fieldname' => '_bbp_old_reply_id'
325
  );
326
 
327
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
328
  $this->field_map[] = array(
329
  'from_tablename' => 'sfposts',
330
  'from_fieldname' => 'forum_id',
331
+ 'from_expression' => 'WHERE post_index != 1',
332
  'to_type' => 'reply',
333
  'to_fieldname' => '_bbp_forum_id',
334
+ 'callback_method' => 'callback_forumid'
335
  );
336
 
337
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
360
  'callback_method' => 'callback_userid'
361
  );
362
 
363
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
 
364
  $this->field_map[] = array(
365
+ 'from_tablename' => 'sfposts',
366
+ 'from_fieldname' => 'guest_name',
 
 
 
367
  'to_type' => 'reply',
368
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
 
369
  );
370
 
371
+ // Is the reply anonymous (Stored in postmeta)
 
372
  $this->field_map[] = array(
373
+ 'from_tablename' => 'sfposts',
374
+ 'from_fieldname' => 'user_id',
 
 
 
375
  'to_type' => 'reply',
376
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
377
+ 'callback_method' => 'callback_check_anonymous'
378
  );
379
 
380
  // Reply content.
423
 
424
  /** User Section ******************************************************/
425
 
426
+ // Store old user id (Stored in usermeta)
427
  $this->field_map[] = array(
428
  'from_tablename' => 'users',
429
  'from_fieldname' => 'ID',
430
  'to_type' => 'user',
431
+ 'to_fieldname' => '_bbp_old_user_id'
432
  );
433
 
434
+ // Store old user password (Stored in usermeta)
435
  $this->field_map[] = array(
436
  'from_tablename' => 'users',
437
  'from_fieldname' => 'user_pass',
572
  return $count;
573
  }
574
 
 
 
 
 
 
 
 
 
 
 
 
575
  /**
576
  * This callback processes any custom parser.php attributes and custom HTML code with preg_replace
577
  */
includes/admin/converters/Vanilla.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Vanilla 2.0.18.1 Converter
5
  *
6
- * @since bbPress (r4717)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/vanilla
 
8
  */
9
  class Vanilla extends BBP_Converter_Base {
10
 
@@ -25,13 +33,13 @@ class Vanilla extends BBP_Converter_Base {
25
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
30
  'from_tablename' => 'Category',
31
  'from_fieldname' => 'CategoryID',
32
  'from_expression' => 'WHERE Category.CategoryID > 0',
33
  'to_type' => 'forum',
34
- 'to_fieldname' => '_bbp_forum_id'
35
  );
36
 
37
  // Forum parent id (If no parent, then 0. Stored in postmeta)
@@ -39,7 +47,7 @@ class Vanilla extends BBP_Converter_Base {
39
  'from_tablename' => 'Category',
40
  'from_fieldname' => 'ParentCategoryID',
41
  'to_type' => 'forum',
42
- 'to_fieldname' => '_bbp_forum_parent_id',
43
  'callback_method' => 'callback_forum_parent'
44
  );
45
 
@@ -109,6 +117,20 @@ class Vanilla extends BBP_Converter_Base {
109
  'to_fieldname' => 'menu_order'
110
  );
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  // Forum dates.
113
  $this->field_map[] = array(
114
  'from_tablename' => 'Category',
@@ -137,12 +159,14 @@ class Vanilla extends BBP_Converter_Base {
137
 
138
  /** Topic Section *****************************************************/
139
 
140
- // Topic id (Stored in postmeta)
 
141
  $this->field_map[] = array(
142
- 'from_tablename' => 'Discussion',
143
- 'from_fieldname' => 'DiscussionID',
144
- 'to_type' => 'topic',
145
- 'to_fieldname' => '_bbp_topic_id'
 
146
  );
147
 
148
  // Topic reply count (Stored in postmeta)
@@ -181,6 +205,22 @@ class Vanilla extends BBP_Converter_Base {
181
  'callback_method' => 'callback_userid'
182
  );
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  // Topic title.
185
  $this->field_map[] = array(
186
  'from_tablename' => 'Discussion',
@@ -212,7 +252,7 @@ class Vanilla extends BBP_Converter_Base {
212
  'from_tablename' => 'Discussion',
213
  'from_fieldname' => 'closed',
214
  'to_type' => 'topic',
215
- 'to_fieldname' => 'post_status',
216
  'callback_method' => 'callback_topic_status'
217
  );
218
 
@@ -233,6 +273,15 @@ class Vanilla extends BBP_Converter_Base {
233
  'callback_method' => 'callback_forumid'
234
  );
235
 
 
 
 
 
 
 
 
 
 
236
  // Topic dates.
237
  $this->field_map[] = array(
238
  'from_tablename' => 'Discussion',
@@ -297,12 +346,14 @@ class Vanilla extends BBP_Converter_Base {
297
 
298
  /** Reply Section *****************************************************/
299
 
300
- // Reply id (Stored in postmeta)
 
301
  $this->field_map[] = array(
302
  'from_tablename' => 'Comment',
303
  'from_fieldname' => 'CommentID',
 
304
  'to_type' => 'reply',
305
- 'to_fieldname' => '_bbp_post_id'
306
  );
307
 
308
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
@@ -316,42 +367,13 @@ class Vanilla extends BBP_Converter_Base {
316
 
317
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
318
  $this->field_map[] = array(
319
- 'from_tablename' => 'Discussion',
320
- 'from_fieldname' => 'CategoryID',
321
- 'join_tablename' => 'Comment',
322
- 'join_type' => 'INNER',
323
- 'join_expression' => 'USING (DiscussionID)',
324
  'to_type' => 'reply',
325
  'to_fieldname' => '_bbp_forum_id',
326
  'callback_method' => 'callback_topicid_to_forumid'
327
  );
328
 
329
- // Reply title.
330
- // Note: We join the Discussion table because Comment table does not include topic title.
331
- $this->field_map[] = array(
332
- 'from_tablename' => 'Discussion',
333
- 'from_fieldname' => 'Name',
334
- 'join_tablename' => 'Comment',
335
- 'join_type' => 'INNER',
336
- 'join_expression' => 'USING (DiscussionID)',
337
- 'to_type' => 'reply',
338
- 'to_fieldname' => 'post_title',
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',
@@ -369,6 +391,22 @@ class Vanilla extends BBP_Converter_Base {
369
  'callback_method' => 'callback_userid'
370
  );
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  // Reply content.
373
  $this->field_map[] = array(
374
  'from_tablename' => 'Comment',
@@ -415,15 +453,17 @@ class Vanilla extends BBP_Converter_Base {
415
 
416
  /** User Section ******************************************************/
417
 
418
- // Store old User id (Stored in usermeta)
 
419
  $this->field_map[] = array(
420
  'from_tablename' => 'User',
421
  'from_fieldname' => 'UserID',
 
422
  'to_type' => 'user',
423
- 'to_fieldname' => '_bbp_user_id'
424
  );
425
 
426
- // Store old User password (Stored in usermeta)
427
  $this->field_map[] = array(
428
  'from_tablename' => 'User',
429
  'from_fieldname' => 'Password',
@@ -500,6 +540,26 @@ class Vanilla extends BBP_Converter_Base {
500
  return $status;
501
  }
502
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
  /**
504
  * Clean Root Parent ID -1 to 0
505
  *
@@ -525,17 +585,6 @@ class Vanilla extends BBP_Converter_Base {
525
  return $count;
526
  }
527
 
528
- /**
529
- * Set the reply title
530
- *
531
- * @param string $title Vanilla v2.x topic title of this reply
532
- * @return string Prefixed topic title, or empty string
533
- */
534
- public function callback_reply_title( $title = '' ) {
535
- $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
536
- return $title;
537
- }
538
-
539
  /**
540
  * This method is to save the salt and password together. That
541
  * way when we authenticate it we can get it out of the database
@@ -554,8 +603,8 @@ class Vanilla extends BBP_Converter_Base {
554
  }
555
 
556
  /**
557
- * This callback processes any custom BBCodes with parser.php
558
- */
559
  protected function callback_html( $field ) {
560
  require_once( bbpress()->admin->admin_dir . 'parser.php' );
561
  $bbcode = BBCode::getInstance();
1
  <?php
2
 
3
+ /**
4
+ * bbPress Vanilla Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of Vanilla 2.0.18.1 Converter
12
  *
13
+ * @since 2.3.0 bbPress (r4717)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/vanilla
16
  */
17
  class Vanilla extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'Category',
39
  'from_fieldname' => 'CategoryID',
40
  'from_expression' => 'WHERE Category.CategoryID > 0',
41
  'to_type' => 'forum',
42
+ 'to_fieldname' => '_bbp_old_forum_id'
43
  );
44
 
45
  // Forum parent id (If no parent, then 0. Stored in postmeta)
47
  'from_tablename' => 'Category',
48
  'from_fieldname' => 'ParentCategoryID',
49
  'to_type' => 'forum',
50
+ 'to_fieldname' => '_bbp_old_forum_parent_id',
51
  'callback_method' => 'callback_forum_parent'
52
  );
53
 
117
  'to_fieldname' => 'menu_order'
118
  );
119
 
120
+ // Forum type (Set a default value 'forum', Stored in postmeta)
121
+ $this->field_map[] = array(
122
+ 'to_type' => 'forum',
123
+ 'to_fieldname' => '_bbp_forum_type',
124
+ 'default' => 'forum'
125
+ );
126
+
127
+ // Forum status (Set a default value 'open', Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => '_bbp_status',
131
+ 'default' => 'open'
132
+ );
133
+
134
  // Forum dates.
135
  $this->field_map[] = array(
136
  'from_tablename' => 'Category',
159
 
160
  /** Topic Section *****************************************************/
161
 
162
+ // Old topic id (Stored in postmeta)
163
+ // Don't import Vanilla 2's deleted topics
164
  $this->field_map[] = array(
165
+ 'from_tablename' => 'Discussion',
166
+ 'from_fieldname' => 'DiscussionID',
167
+ 'from_expression' => 'WHERE Format != "Deleted"',
168
+ 'to_type' => 'topic',
169
+ 'to_fieldname' => '_bbp_old_topic_id'
170
  );
171
 
172
  // Topic reply count (Stored in postmeta)
205
  'callback_method' => 'callback_userid'
206
  );
207
 
208
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
209
+ $this->field_map[] = array(
210
+ 'to_type' => 'topic',
211
+ 'to_fieldname' => '_bbp_old_topic_author_name_id',
212
+ 'default' => 'Anonymous'
213
+ );
214
+
215
+ // Is the topic anonymous (Stored in postmeta)
216
+ $this->field_map[] = array(
217
+ 'from_tablename' => 'Discussion',
218
+ 'from_fieldname' => 'InsertUserID',
219
+ 'to_type' => 'topic',
220
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
221
+ 'callback_method' => 'callback_check_anonymous'
222
+ );
223
+
224
  // Topic title.
225
  $this->field_map[] = array(
226
  'from_tablename' => 'Discussion',
252
  'from_tablename' => 'Discussion',
253
  'from_fieldname' => 'closed',
254
  'to_type' => 'topic',
255
+ 'to_fieldname' => '_bbp_old_closed_status_id',
256
  'callback_method' => 'callback_topic_status'
257
  );
258
 
273
  'callback_method' => 'callback_forumid'
274
  );
275
 
276
+ // Sticky status (Stored in postmeta)
277
+ $this->field_map[] = array(
278
+ 'from_tablename' => 'Discussion',
279
+ 'from_fieldname' => 'Announce',
280
+ 'to_type' => 'topic',
281
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
282
+ 'callback_method' => 'callback_sticky_status'
283
+ );
284
+
285
  // Topic dates.
286
  $this->field_map[] = array(
287
  'from_tablename' => 'Discussion',
346
 
347
  /** Reply Section *****************************************************/
348
 
349
+ // Old reply id (Stored in postmeta)
350
+ // Don't import Vanilla 2's deleted replies
351
  $this->field_map[] = array(
352
  'from_tablename' => 'Comment',
353
  'from_fieldname' => 'CommentID',
354
+ 'from_expression' => 'WHERE Format != "Deleted"',
355
  'to_type' => 'reply',
356
+ 'to_fieldname' => '_bbp_old_reply_id'
357
  );
358
 
359
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
367
 
368
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
369
  $this->field_map[] = array(
370
+ 'from_tablename' => 'Comment',
371
+ 'from_fieldname' => 'DiscussionID',
 
 
 
372
  'to_type' => 'reply',
373
  'to_fieldname' => '_bbp_forum_id',
374
  'callback_method' => 'callback_topicid_to_forumid'
375
  );
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  // Reply author ip (Stored in postmeta)
378
  $this->field_map[] = array(
379
  'from_tablename' => 'Comment',
391
  'callback_method' => 'callback_userid'
392
  );
393
 
394
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
395
+ $this->field_map[] = array(
396
+ 'to_type' => 'reply',
397
+ 'to_fieldname' => '_bbp_old_reply_author_name_id',
398
+ 'default' => 'Anonymous'
399
+ );
400
+
401
+ // Is the reply anonymous (Stored in postmeta)
402
+ $this->field_map[] = array(
403
+ 'from_tablename' => 'Comment',
404
+ 'from_fieldname' => 'InsertUserID',
405
+ 'to_type' => 'reply',
406
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
407
+ 'callback_method' => 'callback_check_anonymous'
408
+ );
409
+
410
  // Reply content.
411
  $this->field_map[] = array(
412
  'from_tablename' => 'Comment',
453
 
454
  /** User Section ******************************************************/
455
 
456
+ // Store old user id (Stored in usermeta)
457
+ // Don't import user Vanilla's deleted users
458
  $this->field_map[] = array(
459
  'from_tablename' => 'User',
460
  'from_fieldname' => 'UserID',
461
+ 'from_expression' => 'WHERE Deleted !=1',
462
  'to_type' => 'user',
463
+ 'to_fieldname' => '_bbp_old_user_id'
464
  );
465
 
466
+ // Store old user password (Stored in usermeta)
467
  $this->field_map[] = array(
468
  'from_tablename' => 'User',
469
  'from_fieldname' => 'Password',
540
  return $status;
541
  }
542
 
543
+ /**
544
+ * Translate the topic sticky status type from Vanilla v2.x numeric's to WordPress's strings.
545
+ *
546
+ * @param int $status Vanilla v2.x numeric forum type
547
+ * @return string WordPress safe
548
+ */
549
+ public function callback_sticky_status( $status = 0 ) {
550
+ switch ( $status ) {
551
+ case 1 :
552
+ $status = 'sticky'; // Vanilla Sticky 'Announce = 1'
553
+ break;
554
+
555
+ case 0 :
556
+ default :
557
+ $status = 'normal'; // Vanilla normal topic 'Announce = 0'
558
+ break;
559
+ }
560
+ return $status;
561
+ }
562
+
563
  /**
564
  * Clean Root Parent ID -1 to 0
565
  *
585
  return $count;
586
  }
587
 
 
 
 
 
 
 
 
 
 
 
 
588
  /**
589
  * This method is to save the salt and password together. That
590
  * way when we authenticate it we can get it out of the database
603
  }
604
 
605
  /**
606
+ * This callback processes any custom BBCodes with parser.php
607
+ */
608
  protected function callback_html( $field ) {
609
  require_once( bbpress()->admin->admin_dir . 'parser.php' );
610
  $bbcode = BBCode::getInstance();
includes/admin/converters/XMB.php CHANGED
@@ -1,709 +1,726 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress XMB Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
+ /**
11
+ * Implementation of XMB Forum converter.
12
+ *
13
+ * @since 2.5.0 bbPress (r5143)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/xmb
16
+ */
17
+ class XMB extends BBP_Converter_Base {
18
+
19
+ /**
20
+ * Main Constructor
21
+ *
22
+ * @uses XMB::setup_globals()
23
+ */
24
+ function __construct() {
25
+ parent::__construct();
26
+ $this->setup_globals();
27
+ }
28
+
29
+ /**
30
+ * Sets up the field mappings
31
+ */
32
+ public function setup_globals() {
33
+
34
+ /** Forum Section *****************************************************/
35
+
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'forums',
39
+ 'from_fieldname' => 'fid',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
+ );
43
+
44
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'forums',
47
+ 'from_fieldname' => 'fup',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
+ );
51
+
52
+ // Forum topic count (Stored in postmeta)
53
+ $this->field_map[] = array(
54
+ 'from_tablename' => 'forums',
55
+ 'from_fieldname' => 'threads',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_topic_count'
58
+ );
59
+
60
+ // Forum reply count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'posts',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_reply_count'
66
+ );
67
+
68
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'threads',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_topic_count'
74
+ );
75
+
76
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'forums',
79
+ 'from_fieldname' => 'posts',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => '_bbp_total_reply_count'
82
+ );
83
+
84
+ // Forum title.
85
+ $this->field_map[] = array(
86
+ 'from_tablename' => 'forums',
87
+ 'from_fieldname' => 'name',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => 'post_title'
90
+ );
91
+
92
+ // Forum slug (Clean name to avoid conflicts)
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'forums',
95
+ 'from_fieldname' => 'name',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_name',
98
+ 'callback_method' => 'callback_slug'
99
+ );
100
+
101
+ // Forum description.
102
+ $this->field_map[] = array(
103
+ 'from_tablename' => 'forums',
104
+ 'from_fieldname' => 'description',
105
+ 'to_type' => 'forum',
106
+ 'to_fieldname' => 'post_content',
107
+ 'callback_method' => 'callback_null'
108
+ );
109
+
110
+ // Forum display order (Starts from 1)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forums',
113
+ 'from_fieldname' => 'displayorder',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'menu_order'
116
+ );
117
+
118
+ // Forum type (Category = 'group', Forum = 'forum' or 'sub', Stored in postmeta)
119
+ $this->field_map[] = array(
120
+ 'from_tablename' => 'forums',
121
+ 'from_fieldname' => 'type',
122
+ 'to_type' => 'forum',
123
+ 'to_fieldname' => '_bbp_forum_type',
124
+ 'callback_method' => 'callback_forum_type'
125
+ );
126
+
127
+ // Forum status (Set a default value 'open', Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => '_bbp_status',
131
+ 'default' => 'open'
132
+ );
133
+
134
+ // Forum dates.
135
+ $this->field_map[] = array(
136
+ 'to_type' => 'forum',
137
+ 'to_fieldname' => 'post_date',
138
+ 'default' => date('Y-m-d H:i:s')
139
+ );
140
+ $this->field_map[] = array(
141
+ 'to_type' => 'forum',
142
+ 'to_fieldname' => 'post_date_gmt',
143
+ 'default' => date('Y-m-d H:i:s')
144
+ );
145
+ $this->field_map[] = array(
146
+ 'to_type' => 'forum',
147
+ 'to_fieldname' => 'post_modified',
148
+ 'default' => date('Y-m-d H:i:s')
149
+ );
150
+ $this->field_map[] = array(
151
+ 'to_type' => 'forum',
152
+ 'to_fieldname' => 'post_modified_gmt',
153
+ 'default' => date('Y-m-d H:i:s')
154
+ );
155
+
156
+ /** Topic Section *****************************************************/
157
+
158
+ // Old topic id (Stored in postmeta)
159
+ $this->field_map[] = array(
160
+ 'from_tablename' => 'threads',
161
+ 'from_fieldname' => 'tid',
162
+ 'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
+ );
165
+
166
+ // Topic reply count (Stored in postmeta)
167
+ $this->field_map[] = array(
168
+ 'from_tablename' => 'threads',
169
+ 'from_fieldname' => 'replies',
170
+ 'to_type' => 'topic',
171
+ 'to_fieldname' => '_bbp_reply_count',
172
+ 'callback_method' => 'callback_topic_reply_count'
173
+ );
174
+
175
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'threads',
178
+ 'from_fieldname' => 'replies',
179
+ 'to_type' => 'topic',
180
+ 'to_fieldname' => '_bbp_total_reply_count',
181
+ 'callback_method' => 'callback_topic_reply_count'
182
+ );
183
+
184
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
185
+ $this->field_map[] = array(
186
+ 'from_tablename' => 'threads',
187
+ 'from_fieldname' => 'fid',
188
+ 'to_type' => 'topic',
189
+ 'to_fieldname' => '_bbp_forum_id',
190
+ 'callback_method' => 'callback_forumid'
191
+ );
192
+
193
+ // Topic author.
194
+ // Note: We join the 'members' table because 'threads' table does not have numerical author id.
195
+ $this->field_map[] = array(
196
+ 'from_tablename' => 'members',
197
+ 'from_fieldname' => 'uid',
198
+ 'join_tablename' => 'threads',
199
+ 'join_type' => 'LEFT',
200
+ 'join_expression' => 'ON threads.author = members.username',
201
+ 'to_type' => 'topic',
202
+ 'to_fieldname' => 'post_author',
203
+ 'callback_method' => 'callback_userid'
204
+ );
205
+
206
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
207
+ $this->field_map[] = array(
208
+ 'from_tablename' => 'threads',
209
+ 'from_fieldname' => 'author',
210
+ 'to_type' => 'topic',
211
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
212
+ );
213
+
214
+ // Is the topic anonymous (Stored in postmeta)
215
+ $this->field_map[] = array(
216
+ 'from_tablename' => 'members',
217
+ 'from_fieldname' => 'uid',
218
+ 'join_tablename' => 'threads',
219
+ 'join_type' => 'LEFT',
220
+ 'join_expression' => 'ON threads.author = members.username WHERE posts.subject = ""',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
223
+ 'callback_method' => 'callback_check_anonymous'
224
+ );
225
+
226
+ // Topic Author ip (Stored in postmeta)
227
+ // Note: We join the 'posts' table because 'threads' table does not have author ip.
228
+ $this->field_map[] = array(
229
+ 'from_tablename' => 'posts',
230
+ 'from_fieldname' => 'useip',
231
+ 'join_tablename' => 'threads',
232
+ 'join_type' => 'INNER',
233
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
234
+ 'to_type' => 'topic',
235
+ 'to_fieldname' => '_bbp_author_ip'
236
+ );
237
+
238
+ // Topic content.
239
+ // Note: We join the 'posts' table because 'threads' table does not have content.
240
+ $this->field_map[] = array(
241
+ 'from_tablename' => 'posts',
242
+ 'from_fieldname' => 'message',
243
+ 'join_tablename' => 'threads',
244
+ 'join_type' => 'INNER',
245
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
246
+ 'to_type' => 'topic',
247
+ 'to_fieldname' => 'post_content',
248
+ 'callback_method' => 'callback_html'
249
+ );
250
+
251
+ // Topic title.
252
+ $this->field_map[] = array(
253
+ 'from_tablename' => 'threads',
254
+ 'from_fieldname' => 'subject',
255
+ 'to_type' => 'topic',
256
+ 'to_fieldname' => 'post_title'
257
+ );
258
+
259
+ // Topic slug (Clean name to avoid conflicts)
260
+ $this->field_map[] = array(
261
+ 'from_tablename' => 'threads',
262
+ 'from_fieldname' => 'subject',
263
+ 'to_type' => 'topic',
264
+ 'to_fieldname' => 'post_name',
265
+ 'callback_method' => 'callback_slug'
266
+ );
267
+
268
+ // Topic parent forum id (If no parent, then 0)
269
+ $this->field_map[] = array(
270
+ 'from_tablename' => 'threads',
271
+ 'from_fieldname' => 'fid',
272
+ 'to_type' => 'topic',
273
+ 'to_fieldname' => 'post_parent',
274
+ 'callback_method' => 'callback_forumid'
275
+ );
276
+
277
+ // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)
278
+ $this->field_map[] = array(
279
+ 'from_tablename' => 'threads',
280
+ 'from_fieldname' => 'closed',
281
+ 'to_type' => 'topic',
282
+ 'to_fieldname' => '_bbp_old_closed_status_id',
283
+ 'callback_method' => 'callback_topic_status'
284
+ );
285
+
286
+ // Sticky status (Stored in postmeta)
287
+ $this->field_map[] = array(
288
+ 'from_tablename' => 'threads',
289
+ 'from_fieldname' => 'topped',
290
+ 'to_type' => 'topic',
291
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
292
+ 'callback_method' => 'callback_sticky_status'
293
+ );
294
+
295
+ // Topic dates.
296
+ // Note: We join the 'posts' table because 'threads' table does not include dates.
297
+ $this->field_map[] = array(
298
+ 'from_tablename' => 'posts',
299
+ 'from_fieldname' => 'dateline',
300
+ 'join_tablename' => 'threads',
301
+ 'join_type' => 'INNER',
302
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
303
+ 'to_type' => 'topic',
304
+ 'to_fieldname' => 'post_date',
305
+ 'callback_method' => 'callback_datetime'
306
+ );
307
+ $this->field_map[] = array(
308
+ 'from_tablename' => 'posts',
309
+ 'from_fieldname' => 'dateline',
310
+ 'join_tablename' => 'threads',
311
+ 'join_type' => 'INNER',
312
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
313
+ 'to_type' => 'topic',
314
+ 'to_fieldname' => 'post_date_gmt',
315
+ 'callback_method' => 'callback_datetime'
316
+ );
317
+ $this->field_map[] = array(
318
+ 'from_tablename' => 'posts',
319
+ 'from_fieldname' => 'dateline',
320
+ 'join_tablename' => 'threads',
321
+ 'join_type' => 'INNER',
322
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
323
+ 'to_type' => 'topic',
324
+ 'to_fieldname' => 'post_modified',
325
+ 'callback_method' => 'callback_datetime'
326
+ );
327
+ $this->field_map[] = array(
328
+ 'from_tablename' => 'posts',
329
+ 'from_fieldname' => 'dateline',
330
+ 'join_tablename' => 'threads',
331
+ 'join_type' => 'INNER',
332
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
333
+ 'to_type' => 'topic',
334
+ 'to_fieldname' => 'post_modified_gmt',
335
+ 'callback_method' => 'callback_datetime'
336
+ );
337
+ $this->field_map[] = array(
338
+ 'from_tablename' => 'posts',
339
+ 'from_fieldname' => 'dateline',
340
+ 'join_tablename' => 'threads',
341
+ 'join_type' => 'INNER',
342
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
343
+ 'to_type' => 'topic',
344
+ 'to_fieldname' => '_bbp_last_active_time',
345
+ 'callback_method' => 'callback_datetime'
346
+ );
347
+
348
+ /** Tags Section ******************************************************/
349
+
350
+ /**
351
+ * XMB v1.9.11.13 Forums do not support topic tags out of the box
352
+ */
353
+
354
+ /** Reply Section *****************************************************/
355
+
356
+ // Old reply id (Stored in postmeta)
357
+ $this->field_map[] = array(
358
+ 'from_tablename' => 'posts',
359
+ 'from_fieldname' => 'pid',
360
+ 'to_type' => 'reply',
361
+ 'to_fieldname' => '_bbp_old_reply_id'
362
+ );
363
+
364
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
365
+ $this->field_map[] = array(
366
+ 'from_tablename' => 'posts',
367
+ 'from_fieldname' => 'fid',
368
+ 'to_type' => 'reply',
369
+ 'to_fieldname' => '_bbp_forum_id',
370
+ 'callback_method' => 'callback_topicid_to_forumid'
371
+ );
372
+
373
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
374
+ $this->field_map[] = array(
375
+ 'from_tablename' => 'posts',
376
+ 'from_fieldname' => 'tid',
377
+ 'to_type' => 'reply',
378
+ 'to_fieldname' => '_bbp_topic_id',
379
+ 'callback_method' => 'callback_topicid'
380
+ );
381
+
382
+ // Reply author ip (Stored in postmeta)
383
+ $this->field_map[] = array(
384
+ 'from_tablename' => 'posts',
385
+ 'from_fieldname' => 'useip',
386
+ 'to_type' => 'reply',
387
+ 'to_fieldname' => '_bbp_author_ip'
388
+ );
389
+
390
+ // Reply author.
391
+ // Note: We join the 'members' table because 'posts' table does not have numerical author id.
392
+ $this->field_map[] = array(
393
+ 'from_tablename' => 'members',
394
+ 'from_fieldname' => 'uid',
395
+ 'join_tablename' => 'posts',
396
+ 'join_type' => 'LEFT',
397
+ 'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
398
+ 'to_type' => 'reply',
399
+ 'to_fieldname' => 'post_author',
400
+ 'callback_method' => 'callback_userid'
401
+ );
402
+
403
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
404
+ $this->field_map[] = array(
405
+ 'from_tablename' => 'posts',
406
+ 'from_fieldname' => 'author',
407
+ 'to_type' => 'reply',
408
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
409
+ );
410
+
411
+ // Is the reply anonymous (Stored in postmeta)
412
+ $this->field_map[] = array(
413
+ 'from_tablename' => 'members',
414
+ 'from_fieldname' => 'uid',
415
+ 'join_tablename' => 'posts',
416
+ 'join_type' => 'LEFT',
417
+ 'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
418
+ 'to_type' => 'reply',
419
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
420
+ 'callback_method' => 'callback_check_anonymous'
421
+ );
422
+
423
+ // Reply content.
424
+ $this->field_map[] = array(
425
+ 'from_tablename' => 'posts',
426
+ 'from_fieldname' => 'message',
427
+ 'to_type' => 'reply',
428
+ 'to_fieldname' => 'post_content',
429
+ 'callback_method' => 'callback_html'
430
+ );
431
+
432
+ // Reply parent topic id (If no parent, then 0)
433
+ $this->field_map[] = array(
434
+ 'from_tablename' => 'posts',
435
+ 'from_fieldname' => 'tid',
436
+ 'to_type' => 'reply',
437
+ 'to_fieldname' => 'post_parent',
438
+ 'callback_method' => 'callback_topicid'
439
+ );
440
+
441
+ // Reply dates.
442
+ $this->field_map[] = array(
443
+ 'from_tablename' => 'posts',
444
+ 'from_fieldname' => 'dateline',
445
+ 'to_type' => 'reply',
446
+ 'to_fieldname' => 'post_date',
447
+ 'callback_method' => 'callback_datetime'
448
+ );
449
+ $this->field_map[] = array(
450
+ 'from_tablename' => 'posts',
451
+ 'from_fieldname' => 'dateline',
452
+ 'to_type' => 'reply',
453
+ 'to_fieldname' => 'post_date_gmt',
454
+ 'callback_method' => 'callback_datetime'
455
+ );
456
+ $this->field_map[] = array(
457
+ 'from_tablename' => 'posts',
458
+ 'from_fieldname' => 'dateline',
459
+ 'to_type' => 'reply',
460
+ 'to_fieldname' => 'post_modified',
461
+ 'callback_method' => 'callback_datetime'
462
+ );
463
+ $this->field_map[] = array(
464
+ 'from_tablename' => 'posts',
465
+ 'from_fieldname' => 'dateline',
466
+ 'to_type' => 'reply',
467
+ 'to_fieldname' => 'post_modified_gmt',
468
+ 'callback_method' => 'callback_datetime'
469
+ );
470
+
471
+ /** User Section ******************************************************/
472
+
473
+ // Store old user id (Stored in usermeta)
474
+ $this->field_map[] = array(
475
+ 'from_tablename' => 'members',
476
+ 'from_fieldname' => 'uid',
477
+ 'to_type' => 'user',
478
+ 'to_fieldname' => '_bbp_old_user_id'
479
+ );
480
+
481
+ // Store old User password (Stored in usermeta serialized with salt)
482
+ $this->field_map[] = array(
483
+ 'from_tablename' => 'members',
484
+ 'from_fieldname' => 'password',
485
+ 'to_type' => 'user',
486
+ 'to_fieldname' => '_bbp_password',
487
+ 'callback_method' => 'callback_savepass'
488
+ );
489
+
490
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
491
+ // $this->field_map[] = array(
492
+ // 'from_tablename' => 'members',
493
+ // 'from_fieldname' => 'salt',
494
+ // 'to_type' => 'user',
495
+ // 'to_fieldname' => ''
496
+ // );
497
+
498
+ // User password verify class (Stored in usermeta for verifying password)
499
+ $this->field_map[] = array(
500
+ 'to_type' => 'members',
501
+ 'to_fieldname' => '_bbp_class',
502
+ 'default' => 'XMB'
503
+ );
504
+
505
+ // User name.
506
+ $this->field_map[] = array(
507
+ 'from_tablename' => 'members',
508
+ 'from_fieldname' => 'username',
509
+ 'to_type' => 'user',
510
+ 'to_fieldname' => 'user_login'
511
+ );
512
+
513
+ // User nice name.
514
+ $this->field_map[] = array(
515
+ 'from_tablename' => 'members',
516
+ 'from_fieldname' => 'username',
517
+ 'to_type' => 'user',
518
+ 'to_fieldname' => 'user_nicename'
519
+ );
520
+
521
+ // User email.
522
+ $this->field_map[] = array(
523
+ 'from_tablename' => 'members',
524
+ 'from_fieldname' => 'email',
525
+ 'to_type' => 'user',
526
+ 'to_fieldname' => 'user_email'
527
+ );
528
+
529
+ // User homepage.
530
+ $this->field_map[] = array(
531
+ 'from_tablename' => 'members',
532
+ 'from_fieldname' => 'site',
533
+ 'to_type' => 'user',
534
+ 'to_fieldname' => 'user_url'
535
+ );
536
+
537
+ // User registered.
538
+ $this->field_map[] = array(
539
+ 'from_tablename' => 'members',
540
+ 'from_fieldname' => 'regdate',
541
+ 'to_type' => 'user',
542
+ 'to_fieldname' => 'user_registered',
543
+ 'callback_method' => 'callback_datetime'
544
+ );
545
+
546
+ // User AIM (Stored in usermeta)
547
+ $this->field_map[] = array(
548
+ 'from_tablename' => 'members',
549
+ 'from_fieldname' => 'aim',
550
+ 'to_type' => 'user',
551
+ 'to_fieldname' => '_bbp_xmb_user_aim'
552
+ );
553
+
554
+ // User Yahoo (Stored in usermeta)
555
+ $this->field_map[] = array(
556
+ 'from_tablename' => 'members',
557
+ 'from_fieldname' => 'yahoo',
558
+ 'to_type' => 'user',
559
+ 'to_fieldname' => '_bbp_xmb_user_yim'
560
+ );
561
+
562
+ // Store ICQ (Stored in usermeta)
563
+ $this->field_map[] = array(
564
+ 'from_tablename' => 'members',
565
+ 'from_fieldname' => 'icq',
566
+ 'to_type' => 'user',
567
+ 'to_fieldname' => '_bbp_xmb_user_icq'
568
+ );
569
+
570
+ // Store MSN (Stored in usermeta)
571
+ $this->field_map[] = array(
572
+ 'from_tablename' => 'members',
573
+ 'from_fieldname' => 'msn',
574
+ 'to_type' => 'user',
575
+ 'to_fieldname' => '_bbp_xmb_user_msn'
576
+ );
577
+
578
+ // Store Signature (Stored in usermeta)
579
+ $this->field_map[] = array(
580
+ 'from_tablename' => 'members',
581
+ 'from_fieldname' => 'sig',
582
+ 'to_type' => 'user',
583
+ 'to_fieldname' => '_bbp_xmb_user_sig',
584
+ 'callback_method' => 'callback_html'
585
+ );
586
+
587
+ // Store Bio (Stored in usermeta)
588
+ $this->field_map[] = array(
589
+ 'from_tablename' => 'members',
590
+ 'from_fieldname' => 'bio',
591
+ 'to_type' => 'user',
592
+ 'to_fieldname' => '_bbp_xmb_user_bio',
593
+ 'callback_method' => 'callback_html'
594
+ );
595
+
596
+ // Store Location (Stored in usermeta)
597
+ $this->field_map[] = array(
598
+ 'from_tablename' => 'members',
599
+ 'from_fieldname' => 'location',
600
+ 'to_type' => 'user',
601
+ 'to_fieldname' => '_bbp_xmb_user_location'
602
+ );
603
+
604
+ // Store Avatar (Stored in usermeta)
605
+ $this->field_map[] = array(
606
+ 'from_tablename' => 'members',
607
+ 'from_fieldname' => 'avatar',
608
+ 'to_type' => 'user',
609
+ 'to_fieldname' => '_bbp_xmb_user_avatar'
610
+ );
611
+
612
+ // Store Mood (Stored in usermeta)
613
+ $this->field_map[] = array(
614
+ 'from_tablename' => 'members',
615
+ 'from_fieldname' => 'mood',
616
+ 'to_type' => 'user',
617
+ 'to_fieldname' => '_bbp_xmb_user_mood'
618
+ );
619
+
620
+ }
621
+
622
+ /**
623
+ * This method allows us to indicates what is or is not converted for each
624
+ * converter.
625
+ */
626
+ public function info()
627
+ {
628
+ return '';
629
+ }
630
+
631
+ /**
632
+ * This method is to save the salt and password together. That
633
+ * way when we authenticate it we can get it out of the database
634
+ * as one value. Array values are auto sanitized by WordPress.
635
+ */
636
+ public function callback_savepass( $field, $row )
637
+ {
638
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
639
+ return $pass_array;
640
+ }
641
+
642
+ /**
643
+ * This method is to take the pass out of the database and compare
644
+ * to a pass the user has typed in.
645
+ */
646
+ public function authenticate_pass( $password, $serialized_pass )
647
+ {
648
+ $pass_array = unserialize( $serialized_pass );
649
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
650
+ }
651
+
652
+ /**
653
+ * Translate the forum type from XMB v1.9.11.13 Capitalised case to WordPress's non-capatilise case strings.
654
+ *
655
+ * @param int $status XMB v1.9.11.13 numeric forum type
656
+ * @return string WordPress safe
657
+ */
658
+ public function callback_forum_type( $status = 1 ) {
659
+ switch ( $status ) {
660
+ case 'group' :
661
+ $status = 'category';
662
+ break;
663
+
664
+ case 'sub' :
665
+ $status = 'forum';
666
+ break;
667
+
668
+ case 'forum' :
669
+ default :
670
+ $status = 'forum';
671
+ break;
672
+ }
673
+ return $status;
674
+ }
675
+
676
+ /**
677
+ * Translate the post status from XMB v1.9.11.13 numeric's to WordPress's strings.
678
+ *
679
+ * @param int $status XMB v1.9.11.13 numeric topic status
680
+ * @return string WordPress safe
681
+ */
682
+ public function callback_topic_status( $status = '' ) {
683
+ switch ( $status ) {
684
+ case 'yes' :
685
+ $status = 'closed';
686
+ break;
687
+
688
+ case '' :
689
+ default :
690
+ $status = 'publish';
691
+ break;
692
+ }
693
+ return $status;
694
+ }
695
+
696
+ /**
697
+ * Translate the topic sticky status type from XMB v1.9.11.13 numeric's to WordPress's strings.
698
+ *
699
+ * @param int $status XMB v1.9.11.13 numeric forum type
700
+ * @return string WordPress safe
701
+ */
702
+ public function callback_sticky_status( $status = 0 ) {
703
+ switch ( $status ) {
704
+ case 1 :
705
+ $status = 'sticky'; // XMB Sticky 'topped = 1'
706
+ break;
707
+
708
+ case 0 :
709
+ default :
710
+ $status = 'normal'; // XMB Normal Topic 'topped = 0'
711
+ break;
712
+ }
713
+ return $status;
714
+ }
715
+
716
+ /**
717
+ * Verify the topic/reply count.
718
+ *
719
+ * @param int $count XMB v1.9.11.13 topic/reply counts
720
+ * @return string WordPress safe
721
+ */
722
+ public function callback_topic_reply_count( $count = 1 ) {
723
+ $count = absint( (int) $count - 1 );
724
+ return $count;
725
+ }
726
+ }
includes/admin/converters/XenForo.php CHANGED
@@ -1,725 +1,853 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress XenForo Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
+ /**
11
+ * Implementation of XenForo converter.
12
+ *
13
+ * @since 2.5.0 bbPress (r5145)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/xenforo
16
+ */
17
+ class XenForo extends BBP_Converter_Base {
18
+
19
+ /**
20
+ * Main constructor
21
+ *
22
+ * @uses XenForo::setup_globals()
23
+ */
24
+ function __construct() {
25
+ parent::__construct();
26
+ $this->setup_globals();
27
+ }
28
+
29
+ /**
30
+ * Sets up the field mappings
31
+ */
32
+ public function setup_globals() {
33
+
34
+ /** Forum Section *****************************************************/
35
+
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'node',
39
+ 'from_fieldname' => 'node_id',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
+ );
43
+
44
+ // Forum parent id (If no parent, then 0. Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'node',
47
+ 'from_fieldname' => 'parent_node_id',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
+ );
51
+
52
+ // Forum topic count (Stored in postmeta)
53
+ // Note: We join the 'forum' table because 'node' does not include topic counts.
54
+ $this->field_map[] = array(
55
+ 'from_tablename' => 'forum',
56
+ 'from_fieldname' => 'discussion_count',
57
+ 'join_tablename' => 'node',
58
+ 'join_type' => 'LEFT',
59
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
60
+ 'to_type' => 'forum',
61
+ 'to_fieldname' => '_bbp_topic_count'
62
+ );
63
+
64
+ // Forum reply count (Stored in postmeta)
65
+ // Note: We join the 'forum' table because 'node' does not include reply counts.
66
+ $this->field_map[] = array(
67
+ 'from_tablename' => 'forum',
68
+ 'from_fieldname' => 'message_count',
69
+ 'join_tablename' => 'node',
70
+ 'join_type' => 'LEFT',
71
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_reply_count'
74
+ );
75
+
76
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
77
+ // Note: We join the 'forum' table because 'node' does not include topic counts.
78
+ $this->field_map[] = array(
79
+ 'from_tablename' => 'forum',
80
+ 'from_fieldname' => 'discussion_count',
81
+ 'join_tablename' => 'node',
82
+ 'join_type' => 'LEFT',
83
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
84
+ 'to_type' => 'forum',
85
+ 'to_fieldname' => '_bbp_total_topic_count'
86
+ );
87
+
88
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
89
+ // Note: We join the 'forum' table because 'node' does not include reply counts.
90
+ $this->field_map[] = array(
91
+ 'from_tablename' => 'forum',
92
+ 'from_fieldname' => 'message_count',
93
+ 'join_tablename' => 'node',
94
+ 'join_type' => 'LEFT',
95
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => '_bbp_total_reply_count'
98
+ );
99
+
100
+ // Forum title.
101
+ $this->field_map[] = array(
102
+ 'from_tablename' => 'node',
103
+ 'from_fieldname' => 'title',
104
+ 'to_type' => 'forum',
105
+ 'to_fieldname' => 'post_title'
106
+ );
107
+
108
+ // Forum slug (Clean name to avoid confilcts)
109
+ // 'node_name' only has slug for explictly named forums
110
+ $this->field_map[] = array(
111
+ 'from_tablename' => 'node',
112
+ 'from_fieldname' => 'node_name',
113
+ 'to_type' => 'forum',
114
+ 'to_fieldname' => 'post_name',
115
+ 'callback_method' => 'callback_slug'
116
+ );
117
+
118
+ // Forum description.
119
+ $this->field_map[] = array(
120
+ 'from_tablename' => 'node',
121
+ 'from_fieldname' => 'description',
122
+ 'to_type' => 'forum',
123
+ 'to_fieldname' => 'post_content',
124
+ 'callback_method' => 'callback_null'
125
+ );
126
+
127
+ // Forum display order (Starts from 1)
128
+ $this->field_map[] = array(
129
+ 'from_tablename' => 'node',
130
+ 'from_fieldname' => 'display_order',
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => 'menu_order'
133
+ );
134
+
135
+ // Forum type (Category = Category or Forum = Forum, Stored in postmeta)
136
+ $this->field_map[] = array(
137
+ 'from_tablename' => 'node',
138
+ 'from_fieldname' => 'node_type_id',
139
+ 'to_type' => 'forum',
140
+ 'to_fieldname' => '_bbp_forum_type',
141
+ 'callback_method' => 'callback_forum_type'
142
+ );
143
+
144
+ // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta)
145
+ // Note: We join the 'forum' table because 'node' does not include forum status.
146
+ $this->field_map[] = array(
147
+ 'from_tablename' => 'forum',
148
+ 'from_fieldname' => 'allow_posting',
149
+ 'join_tablename' => 'node',
150
+ 'join_type' => 'LEFT',
151
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
152
+ 'to_type' => 'forum',
153
+ 'to_fieldname' => '_bbp_status',
154
+ 'callback_method' => 'callback_forum_status'
155
+ );
156
+
157
+ // Forum dates.
158
+ $this->field_map[] = array(
159
+ 'to_type' => 'forum',
160
+ 'to_fieldname' => 'post_date',
161
+ 'default' => date('Y-m-d H:i:s')
162
+ );
163
+ $this->field_map[] = array(
164
+ 'to_type' => 'forum',
165
+ 'to_fieldname' => 'post_date_gmt',
166
+ 'default' => date('Y-m-d H:i:s')
167
+ );
168
+ $this->field_map[] = array(
169
+ 'to_type' => 'forum',
170
+ 'to_fieldname' => 'post_modified',
171
+ 'default' => date('Y-m-d H:i:s')
172
+ );
173
+ $this->field_map[] = array(
174
+ 'to_type' => 'forum',
175
+ 'to_fieldname' => 'post_modified_gmt',
176
+ 'default' => date('Y-m-d H:i:s')
177
+ );
178
+
179
+ /** Forum Subscriptions Section ***************************************/
180
+
181
+ // Subscribed forum ID (Stored in usermeta)
182
+ $this->field_map[] = array(
183
+ 'from_tablename' => 'forum_watch',
184
+ 'from_fieldname' => 'node_id',
185
+ 'to_type' => 'forum_subscriptions',
186
+ 'to_fieldname' => '_bbp_forum_subscriptions'
187
+ );
188
+
189
+ // Subscribed user ID (Stored in usermeta)
190
+ $this->field_map[] = array(
191
+ 'from_tablename' => 'forum_watch',
192
+ 'from_fieldname' => 'user_id',
193
+ 'to_type' => 'forum_subscriptions',
194
+ 'to_fieldname' => 'user_id',
195
+ 'callback_method' => 'callback_userid'
196
+ );
197
+
198
+ /** Topic Section *****************************************************/
199
+
200
+ // Old topic id (Stored in postmeta)
201
+ $this->field_map[] = array(
202
+ 'from_tablename' => 'thread',
203
+ 'from_fieldname' => 'thread_id',
204
+ 'to_type' => 'topic',
205
+ 'to_fieldname' => '_bbp_old_topic_id'
206
+ );
207
+
208
+ // Topic reply count (Stored in postmeta)
209
+ $this->field_map[] = array(
210
+ 'from_tablename' => 'thread',
211
+ 'from_fieldname' => 'reply_count',
212
+ 'to_type' => 'topic',
213
+ 'to_fieldname' => '_bbp_reply_count',
214
+ 'callback_method' => 'callback_topic_reply_count'
215
+ );
216
+
217
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'thread',
220
+ 'from_fieldname' => 'reply_count',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => '_bbp_total_reply_count',
223
+ 'callback_method' => 'callback_topic_reply_count'
224
+ );
225
+
226
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
227
+ $this->field_map[] = array(
228
+ 'from_tablename' => 'thread',
229
+ 'from_fieldname' => 'node_id',
230
+ 'to_type' => 'topic',
231
+ 'to_fieldname' => '_bbp_forum_id',
232
+ 'callback_method' => 'callback_forumid'
233
+ );
234
+
235
+ // Topic author.
236
+ $this->field_map[] = array(
237
+ 'from_tablename' => 'thread',
238
+ 'from_fieldname' => 'user_id',
239
+ 'to_type' => 'topic',
240
+ 'to_fieldname' => 'post_author',
241
+ 'callback_method' => 'callback_userid'
242
+ );
243
+
244
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
245
+ $this->field_map[] = array(
246
+ 'from_tablename' => 'thread',
247
+ 'from_fieldname' => 'username',
248
+ 'to_type' => 'topic',
249
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
250
+ );
251
+
252
+ // Is the topic anonymous (Stored in postmeta)
253
+ $this->field_map[] = array(
254
+ 'from_tablename' => 'thread',
255
+ 'from_fieldname' => 'user_id',
256
+ 'to_type' => 'topic',
257
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
258
+ 'callback_method' => 'callback_check_anonymous'
259
+ );
260
+
261
+ // Topic title.
262
+ $this->field_map[] = array(
263
+ 'from_tablename' => 'thread',
264
+ 'from_fieldname' => 'title',
265
+ 'to_type' => 'topic',
266
+ 'to_fieldname' => 'post_title'
267
+ );
268
+
269
+ // Topic slug (Clean name to avoid conflicts)
270
+ $this->field_map[] = array(
271
+ 'from_tablename' => 'thread',
272
+ 'from_fieldname' => 'title',
273
+ 'to_type' => 'topic',
274
+ 'to_fieldname' => 'post_name',
275
+ 'callback_method' => 'callback_slug'
276
+ );
277
+
278
+ // Topic content.
279
+ // Note: We join the 'post' table because 'thread' table does not include content.
280
+ $this->field_map[] = array(
281
+ 'from_tablename' => 'post',
282
+ 'from_fieldname' => 'message',
283
+ 'join_tablename' => 'thread',
284
+ 'join_type' => 'INNER',
285
+ 'join_expression' => 'ON thread.first_post_id = post.post_id',
286
+ 'to_type' => 'topic',
287
+ 'to_fieldname' => 'post_content',
288
+ 'callback_method' => 'callback_html'
289
+ );
290
+
291
+ // Topic status (Visible or Deleted)
292
+ $this->field_map[] = array(
293
+ 'from_tablename' => 'thread',
294
+ 'from_fieldname' => 'discussion_state',
295
+ 'to_type' => 'topic',
296
+ 'to_fieldname' => 'post_status',
297
+ 'callback_method' => 'callback_status'
298
+ );
299
+
300
+ // Topic status (Open = 1 or Closed = 0)
301
+ $this->field_map[] = array(
302
+ 'from_tablename' => 'thread',
303
+ 'from_fieldname' => 'discussion_open',
304
+ 'to_type' => 'topic',
305
+ 'to_fieldname' => '_bbp_old_closed_status_id',
306
+ 'callback_method' => 'callback_topic_status'
307
+ );
308
+
309
+ // Topic parent forum id (If no parent, then 0)
310
+ $this->field_map[] = array(
311
+ 'from_tablename' => 'thread',
312
+ 'from_fieldname' => 'node_id',
313
+ 'to_type' => 'topic',
314
+ 'to_fieldname' => 'post_parent',
315
+ 'callback_method' => 'callback_forumid'
316
+ );
317
+
318
+ // Sticky status (Stored in postmeta)
319
+ $this->field_map[] = array(
320
+ 'from_tablename' => 'thread',
321
+ 'from_fieldname' => 'sticky',
322
+ 'to_type' => 'topic',
323
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
324
+ 'callback_method' => 'callback_sticky_status'
325
+ );
326
+
327
+ // Topic dates.
328
+ $this->field_map[] = array(
329
+ 'from_tablename' => 'thread',
330
+ 'from_fieldname' => 'post_date',
331
+ 'to_type' => 'topic',
332
+ 'to_fieldname' => 'post_date',
333
+ 'callback_method' => 'callback_datetime'
334
+ );
335
+ $this->field_map[] = array(
336
+ 'from_tablename' => 'thread',
337
+ 'from_fieldname' => 'post_date',
338
+ 'to_type' => 'topic',
339
+ 'to_fieldname' => 'post_date_gmt',
340
+ 'callback_method' => 'callback_datetime'
341
+ );
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'thread',
344
+ 'from_fieldname' => 'last_post_date',
345
+ 'to_type' => 'topic',
346
+ 'to_fieldname' => 'post_modified',
347
+ 'callback_method' => 'callback_datetime'
348
+ );
349
+ $this->field_map[] = array(
350
+ 'from_tablename' => 'thread',
351
+ 'from_fieldname' => 'last_post_date',
352
+ 'to_type' => 'topic',
353
+ 'to_fieldname' => 'post_modified_gmt',
354
+ 'callback_method' => 'callback_datetime'
355
+ );
356
+ $this->field_map[] = array(
357
+ 'from_tablename' => 'thread',
358
+ 'from_fieldname' => 'last_post_date',
359
+ 'to_type' => 'topic',
360
+ 'to_fieldname' => '_bbp_last_active_time',
361
+ 'callback_method' => 'callback_datetime'
362
+ );
363
+
364
+ /** Tags Section ******************************************************/
365
+
366
+ /**
367
+ * XenForo Forums do not support topic tags out of the box
368
+ */
369
+
370
+ /** Topic Subscriptions Section ***************************************/
371
+
372
+ // Subscribed topic ID (Stored in usermeta)
373
+ $this->field_map[] = array(
374
+ 'from_tablename' => 'thread_watch',
375
+ 'from_fieldname' => 'thread_id',
376
+ 'to_type' => 'topic_subscriptions',
377
+ 'to_fieldname' => '_bbp_subscriptions'
378
+ );
379
+
380
+ // Subscribed user ID (Stored in usermeta)
381
+ $this->field_map[] = array(
382
+ 'from_tablename' => 'thread_watch',
383
+ 'from_fieldname' => 'user_id',
384
+ 'to_type' => 'topic_subscriptions',
385
+ 'to_fieldname' => 'user_id',
386
+ 'callback_method' => 'callback_userid'
387
+ );
388
+
389
+ /** Reply Section *****************************************************/
390
+
391
+ // Old reply id (Stored in postmeta)
392
+ $this->field_map[] = array(
393
+ 'from_tablename' => 'post',
394
+ 'from_fieldname' => 'post_id',
395
+ 'to_type' => 'reply',
396
+ 'to_fieldname' => '_bbp_old_reply_id'
397
+ );
398
+
399
+ // Join the 'thread' table to exclude topics from being imported as replies
400
+ $this->field_map[] = array(
401
+ 'from_tablename' => 'thread',
402
+ 'from_fieldname' => 'thread_id',
403
+ 'join_tablename' => 'post',
404
+ 'join_type' => 'LEFT',
405
+ 'join_expression' => 'USING (thread_id) WHERE thread.first_post_id != post.post_id',
406
+ 'to_type' => 'reply'
407
+ );
408
+
409
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
410
+ $this->field_map[] = array(
411
+ 'from_tablename' => 'post',
412
+ 'from_fieldname' => 'thread_id',
413
+ 'to_type' => 'reply',
414
+ 'to_fieldname' => '_bbp_forum_id',
415
+ 'callback_method' => 'callback_topicid_to_forumid'
416
+ );
417
+
418
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
419
+ $this->field_map[] = array(
420
+ 'from_tablename' => 'post',
421
+ 'from_fieldname' => 'thread_id',
422
+ 'to_type' => 'reply',
423
+ 'to_fieldname' => '_bbp_topic_id',
424
+ 'callback_method' => 'callback_topicid'
425
+ );
426
+
427
+ // Reply author.
428
+ $this->field_map[] = array(
429
+ 'from_tablename' => 'post',
430
+ 'from_fieldname' => 'user_id',
431
+ 'to_type' => 'reply',
432
+ 'to_fieldname' => 'post_author',
433
+ 'callback_method' => 'callback_userid'
434
+ );
435
+
436
+ // Reply status (Visible or Deleted)
437
+ $this->field_map[] = array(
438
+ 'from_tablename' => 'post',
439
+ 'from_fieldname' => 'message_state',
440
+ 'to_type' => 'reply',
441
+ 'to_fieldname' => 'post_status',
442
+ 'callback_method' => 'callback_status'
443
+ );
444
+
445
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
446
+ $this->field_map[] = array(
447
+ 'from_tablename' => 'post',
448
+ 'from_fieldname' => 'username',
449
+ 'to_type' => 'reply',
450
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
451
+ );
452
+
453
+ // Is the reply anonymous (Stored in postmeta)
454
+ $this->field_map[] = array(
455
+ 'from_tablename' => 'post',
456
+ 'from_fieldname' => 'user_id',
457
+ 'to_type' => 'reply',
458
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
459
+ 'callback_method' => 'callback_check_anonymous'
460
+ );
461
+
462
+ // Reply content.
463
+ $this->field_map[] = array(
464
+ 'from_tablename' => 'post',
465
+ 'from_fieldname' => 'message',
466
+ 'to_type' => 'reply',
467
+ 'to_fieldname' => 'post_content',
468
+ 'callback_method' => 'callback_html'
469
+ );
470
+
471
+ // Reply parent topic id (If no parent, then 0)
472
+ $this->field_map[] = array(
473
+ 'from_tablename' => 'post',
474
+ 'from_fieldname' => 'thread_id',
475
+ 'to_type' => 'reply',
476
+ 'to_fieldname' => 'post_parent',
477
+ 'callback_method' => 'callback_topicid'
478
+ );
479
+
480
+ // Reply dates.
481
+ $this->field_map[] = array(
482
+ 'from_tablename' => 'post',
483
+ 'from_fieldname' => 'post_date',
484
+ 'to_type' => 'reply',
485
+ 'to_fieldname' => 'post_date',
486
+ 'callback_method' => 'callback_datetime'
487
+ );
488
+ $this->field_map[] = array(
489
+ 'from_tablename' => 'post',
490
+ 'from_fieldname' => 'post_date',
491
+ 'to_type' => 'reply',
492
+ 'to_fieldname' => 'post_date_gmt',
493
+ 'callback_method' => 'callback_datetime'
494
+ );
495
+ $this->field_map[] = array(
496
+ 'from_tablename' => 'post',
497
+ 'from_fieldname' => 'post_date',
498
+ 'to_type' => 'reply',
499
+ 'to_fieldname' => 'post_modified',
500
+ 'callback_method' => 'callback_datetime'
501
+ );
502
+ $this->field_map[] = array(
503
+ 'from_tablename' => 'post',
504
+ 'from_fieldname' => 'post_date',
505
+ 'to_type' => 'reply',
506
+ 'to_fieldname' => 'post_modified_gmt',
507
+ 'callback_method' => 'callback_datetime'
508
+ );
509
+
510
+ /** User Section ******************************************************/
511
+
512
+ // Store old user id (Stored in usermeta)
513
+ $this->field_map[] = array(
514
+ 'from_tablename' => 'user',
515
+ 'from_fieldname' => 'user_id',
516
+ 'to_type' => 'user',
517
+ 'to_fieldname' => '_bbp_old_user_id'
518
+ );
519
+
520
+ /* // User password.
521
+ // Note: We join the 'user_authenticate' table because 'user' does not include password.
522
+ $this->field_map[] = array(
523
+ 'from_tablename' => 'user_authenticate',
524
+ 'from_fieldname' => 'data',
525
+ 'join_tablename' => 'user',
526
+ 'join_type' => 'LEFT',
527
+ 'join_expression' => 'USING (user_id)',
528
+ 'to_type' => 'user',
529
+ 'to_fieldname' => '_bbp_converter_password'
530
+ );
531
+
532
+ // Store old User password (Stored in usermeta serialized with salt)
533
+ $this->field_map[] = array(
534
+ 'from_tablename' => 'user',
535
+ 'from_fieldname' => 'password',
536
+ 'to_type' => 'user',
537
+ 'to_fieldname' => '_bbp_password',
538
+ 'callback_method' => 'callback_savepass'
539
+ );
540
+
541
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
542
+ $this->field_map[] = array(
543
+ 'from_tablename' => 'user',
544
+ 'from_fieldname' => 'salt',
545
+ 'to_type' => 'user',
546
+ 'to_fieldname' => ''
547
+ );
548
+ */
549
+ // User password verify class (Stored in usermeta for verifying password)
550
+ $this->field_map[] = array(
551
+ 'to_type' => 'user',
552
+ 'to_fieldname' => '_bbp_class',
553
+ 'default' => 'XenForo'
554
+ );
555
+
556
+ // User name.
557
+ $this->field_map[] = array(
558
+ 'from_tablename' => 'user',
559
+ 'from_fieldname' => 'username',
560
+ 'to_type' => 'user',
561
+ 'to_fieldname' => 'user_login'
562
+ );
563
+
564
+ // User email.
565
+ $this->field_map[] = array(
566
+ 'from_tablename' => 'user',
567
+ 'from_fieldname' => 'email',
568
+ 'to_type' => 'user',
569
+ 'to_fieldname' => 'user_email'
570
+ );
571
+
572
+ // User homepage.
573
+ // Note: We join the 'user_profile' table because 'user' does not include user homepage.
574
+ $this->field_map[] = array(
575
+ 'from_tablename' => 'user_profile',
576
+ 'from_fieldname' => 'homepage',
577
+ 'join_tablename' => 'user',
578
+ 'join_type' => 'LEFT',
579
+ 'join_expression' => 'USING (user_id)',
580
+ 'to_type' => 'user',
581
+ 'to_fieldname' => 'user_url'
582
+ );
583
+
584
+ // User registered.
585
+ $this->field_map[] = array(
586
+ 'from_tablename' => 'user',
587
+ 'from_fieldname' => 'register_date',
588
+ 'to_type' => 'user',
589
+ 'to_fieldname' => 'user_registered',
590
+ 'callback_method' => 'callback_datetime'
591
+ );
592
+
593
+ // User display name.
594
+ $this->field_map[] = array(
595
+ 'from_tablename' => 'user',
596
+ 'from_fieldname' => 'username',
597
+ 'to_type' => 'user',
598
+ 'to_fieldname' => 'display_name'
599
+ );
600
+
601
+ // Store Custom Title (Stored in usermeta)
602
+ $this->field_map[] = array(
603
+ 'from_tablename' => 'user',
604
+ 'from_fieldname' => 'custom_title',
605
+ 'to_type' => 'user',
606
+ 'to_fieldname' => '_bbp_xenforo_user_custom_title'
607
+ );
608
+
609
+ // Store Status (Stored in usermeta)
610
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user status.
611
+ $this->field_map[] = array(
612
+ 'from_tablename' => 'user_profile',
613
+ 'from_fieldname' => 'status',
614
+ 'join_tablename' => 'user',
615
+ 'join_type' => 'LEFT',
616
+ 'join_expression' => 'USING (user_id)',
617
+ 'to_type' => 'user',
618
+ 'to_fieldname' => '_bbp_xenforo_user_status'
619
+ );
620
+
621
+ // Store Signature (Stored in usermeta)
622
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user signature.
623
+ $this->field_map[] = array(
624
+ 'from_tablename' => 'user_profile',
625
+ 'from_fieldname' => 'signature',
626
+ 'join_tablename' => 'user',
627
+ 'join_type' => 'LEFT',
628
+ 'join_expression' => 'USING (user_id)',
629
+ 'to_fieldname' => '_bbp_xenforo_user_sig',
630
+ 'to_type' => 'user',
631
+ 'callback_method' => 'callback_html'
632
+ );
633
+
634
+ // Store Location (Stored in usermeta)
635
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user location.
636
+ $this->field_map[] = array(
637
+ 'from_tablename' => 'user_profile',
638
+ 'from_fieldname' => 'location',
639
+ 'join_tablename' => 'user',
640
+ 'join_type' => 'LEFT',
641
+ 'join_expression' => 'USING (user_id)',
642
+ 'to_type' => 'user',
643
+ 'to_fieldname' => '_bbp_xenforo_user_location'
644
+ );
645
+
646
+ // Store Occupation (Stored in usermeta)
647
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user occupation.
648
+ $this->field_map[] = array(
649
+ 'from_tablename' => 'user_profile',
650
+ 'from_fieldname' => 'occupation',
651
+ 'join_tablename' => 'user',
652
+ 'join_type' => 'LEFT',
653
+ 'join_expression' => 'USING (user_id)',
654
+ 'to_type' => 'user',
655
+ 'to_fieldname' => '_bbp_xenforo_user_occupation'
656
+ );
657
+
658
+ // Store About (Stored in usermeta)
659
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user about.
660
+ $this->field_map[] = array(
661
+ 'from_tablename' => 'user_profile',
662
+ 'from_fieldname' => 'about',
663
+ 'join_tablename' => 'user',
664
+ 'join_type' => 'LEFT',
665
+ 'join_expression' => 'USING (user_id)',
666
+ 'to_type' => 'user',
667
+ 'to_fieldname' => '_bbp_xenforo_user_about',
668
+ 'callback_method' => 'callback_html'
669
+ );
670
+ }
671
+
672
+ /**
673
+ * This method allows us to indicates what is or is not converted for each
674
+ * converter.
675
+ */
676
+ public function info() {
677
+ return '';
678
+ }
679
+
680
+ /**
681
+ * This method is to save the salt and password together. That
682
+ * way when we authenticate it we can get it out of the database
683
+ * as one value. Array values are auto sanitized by wordpress.
684
+ */
685
+ public function translate_savepass( $field, $row )
686
+ {
687
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
688
+ return $pass_array;
689
+ }
690
+
691
+ /**
692
+ * This method is to take the pass out of the database and compare
693
+ * to a pass the user has typed in.
694
+ */
695
+ public function authenticate_pass( $password, $serialized_pass )
696
+ {
697
+ $pass_array = unserialize( $serialized_pass );
698
+ switch( $pass_array['hashFunc'] )
699
+ {
700
+ case 'sha256':
701
+ return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) );
702
+ case 'sha1':
703
+ return ( $pass_array['hash'] == sha1( sha1( $password ) . $pass_array['salt'] ) );
704
+ }
705
+ }
706
+
707
+ /**
708
+ * Translate the forum type from XenForo Capitalised case to WordPress's non-capatilise case strings.
709
+ *
710
+ * @param int $status XenForo numeric forum type
711
+ * @return string WordPress safe
712
+ */
713
+ public function callback_forum_type( $status = 1 ) {
714
+ switch ( $status ) {
715
+ case 'Category' :
716
+ $status = 'category';
717
+ break;
718
+
719
+ case 'Forum' :
720
+ default :
721
+ $status = 'forum';
722
+ break;
723
+ }
724
+ return $status;
725
+ }
726
+
727
+ /**
728
+ * Translate the forum status from XenForo numeric's to WordPress's strings.
729
+ *
730
+ * @param int $status XenForo numeric forum status
731
+ * @return string WordPress safe
732
+ */
733
+ public function callback_forum_status( $status = 1 ) {
734
+ switch ( $status ) {
735
+ case 0 :
736
+ $status = 'closed';
737
+ break;
738
+
739
+ case 1 :
740
+ default :
741
+ $status = 'open';
742
+ break;
743
+ }
744
+ return $status;
745
+ }
746
+
747
+ /**
748
+ * Translate the post status from XenForo to WordPress' strings.
749
+ *
750
+ * @param int $status XenForo post status
751
+ * @return string WordPress safe
752
+ */
753
+ public function callback_status( $status = 1 ) {
754
+ switch ( $status ) {
755
+ case 'deleted' :
756
+ $status = 'pending'; // bbp_get_pending_status_id()
757
+ break;
758
+
759
+ case 'visible' :
760
+ default :
761
+ $status = 'publish'; // bbp_get_public_status_id()
762
+ break;
763
+ }
764
+ return $status;
765
+ }
766
+
767
+ /**
768
+ * Translate the topic status from XenForo numeric's to WordPress's strings.
769
+ *
770
+ * @param int $status XenForo numeric topic status
771
+ * @return string WordPress safe
772
+ */
773
+ public function callback_topic_status( $status = 1 ) {
774
+ switch ( $status ) {
775
+ case 0 :
776
+ $status = 'closed';
777
+ break;
778
+
779
+ case 1 :
780
+ default :
781
+ $status = 'publish';
782
+ break;
783
+ }
784
+ return $status;
785
+ }
786
+
787
+ /**
788
+ * Translate the topic sticky status type from XenForo numeric's to WordPress's strings.
789
+ *
790
+ * @param int $status XenForo numeric forum type
791
+ * @return string WordPress safe
792
+ */
793
+ public function callback_sticky_status( $status = 0 ) {
794
+ switch ( $status ) {
795
+ case 1 :
796
+ $status = 'sticky'; // XenForo Sticky 'sticky = 1'
797
+ break;
798
+
799
+ case 0 :
800
+ default :
801
+ $status = 'normal'; // XenForo Normal Topic 'sticky = 0'
802
+ break;
803
+ }
804
+ return $status;
805
+ }
806
+
807
+ /**
808
+ * Verify the topic reply count.
809
+ *
810
+ * @param int $count XenForo reply count
811
+ * @return string WordPress safe
812
+ */
813
+ public function callback_topic_reply_count( $count = 1 ) {
814
+ $count = absint( (int) $count - 1 );
815
+ return $count;
816
+ }
817
+
818
+ /**
819
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
820
+ */
821
+ protected function callback_html( $field ) {
822
+
823
+ // Strips Xenforo custom HTML first from $field before parsing $field to parser.php
824
+ $xenforo_markup = $field;
825
+ $xenforo_markup = html_entity_decode( $xenforo_markup );
826
+
827
+ // Replace '[QUOTE]' with '<blockquote>'
828
+ $xenforo_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $xenforo_markup );
829
+ // Replace '[/QUOTE]' with '</blockquote>'
830
+ $xenforo_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $xenforo_markup );
831
+ // Replace '[QUOTE=User Name($1)]' with '<em>@$1 wrote:</em><blockquote>"
832
+ $xenforo_markup = preg_replace( '/\[quote=\"(.*?)\,\spost\:\s(.*?)\,\s\member\:\s(.*?)\"\](.*?)\[\/quote\]/', '<em>@$1 wrote:</em><blockquote>', $xenforo_markup );
833
+ // Replace '[/quote]' with '</blockquote>'
834
+ $xenforo_markup = preg_replace( '/\[\/quote\]/', '</blockquote>', $xenforo_markup );
835
+
836
+ // Replace '[media=youtube]$1[/media]' with '$1"
837
+ $xenforo_markup = preg_replace( '/\[media\=youtube\](.*?)\[\/media\]/', 'https://youtu.be/$1', $xenforo_markup );
838
+ // Replace '[media=dailymotion]$1[/media]' with '$1"
839
+ $xenforo_markup = preg_replace( '/\[media\=dailymotion\](.*?)\[\/media\]/', 'https://www.dailymotion.com/video/$1', $xenforo_markup );
840
+ // Replace '[media=vimeo]$1[/media]' with '$1"
841
+ $xenforo_markup = preg_replace( '/\[media\=vimeo\](.*?)\[\/media\]/', 'https://vimeo.com/$1', $xenforo_markup );
842
+
843
+ // Now that Xenforo custom HTML has been stripped put the cleaned HTML back in $field
844
+ $field = $xenforo_markup;
845
+
846
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
847
+ require_once( bbpress()->admin->admin_dir . 'parser.php' );
848
+ $bbcode = BBCode::getInstance();
849
+ $bbcode->enable_smileys = false;
850
+ $bbcode->smiley_regex = false;
851
+ return html_entity_decode( $bbcode->Parse( $field ) );
852
+ }
853
+ }
includes/admin/converters/bbPress1.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * bbPress 1.1 Converter
5
  *
6
- * @since bbPress (r3816)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/bbpress-1-x-buddypress-group-forums
 
8
  */
9
  class bbPress1 extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class bbPress1 extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class bbPress1 extends BBP_Converter_Base {
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'forum_parent',
40
  'to_type' => 'forum',
41
- 'to_fieldname' => '_bbp_forum_parent_id'
42
  );
43
 
44
  // Forum topic count (Stored in postmeta)
@@ -119,6 +127,13 @@ class bbPress1 extends BBP_Converter_Base {
119
  'callback_method' => 'callback_forum_type'
120
  );
121
 
 
 
 
 
 
 
 
122
  // Forum dates.
123
  $this->field_map[] = array(
124
  'to_type' => 'forum',
@@ -141,14 +156,20 @@ class bbPress1 extends BBP_Converter_Base {
141
  'default' => date('Y-m-d H:i:s')
142
  );
143
 
 
 
 
 
 
 
144
  /** Topic Section *****************************************************/
145
 
146
- // Topic id (Stored in postmeta)
147
  $this->field_map[] = array(
148
  'from_tablename' => 'topics',
149
  'from_fieldname' => 'topic_id',
150
  'to_type' => 'topic',
151
- 'to_fieldname' => '_bbp_topic_id'
152
  );
153
 
154
  // Topic reply count (Stored in postmeta)
@@ -229,6 +250,15 @@ class bbPress1 extends BBP_Converter_Base {
229
  'callback_method' => 'callback_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(
@@ -250,12 +280,12 @@ class bbPress1 extends BBP_Converter_Base {
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
 
@@ -313,13 +343,25 @@ class bbPress1 extends BBP_Converter_Base {
313
  'to_fieldname' => 'taxonomy'
314
  );
315
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  // Term text.
317
  $this->field_map[] = array(
318
  'from_tablename' => 'terms',
319
  'from_fieldname' => 'name',
320
  'join_tablename' => 'term_taxonomy',
321
  'join_type' => 'INNER',
322
- 'join_expression' => 'USING (term_id)',
323
  'to_type' => 'tags',
324
  'to_fieldname' => 'name'
325
  );
@@ -330,26 +372,84 @@ class bbPress1 extends BBP_Converter_Base {
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)
342
  $this->field_map[] = array(
343
  'from_tablename' => 'posts',
344
  'from_fieldname' => 'post_id',
345
  'to_type' => 'reply',
346
- 'to_fieldname' => '_bbp_post_id'
347
  );
348
 
349
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
 
350
  $this->field_map[] = array(
351
- 'from_tablename' => 'posts',
352
  'from_fieldname' => 'topic_id',
 
 
 
353
  'to_type' => 'reply',
354
  'to_fieldname' => '_bbp_topic_id',
355
  'callback_method' => 'callback_topicid'
@@ -364,32 +464,6 @@ class bbPress1 extends BBP_Converter_Base {
364
  'callback_method' => 'callback_forumid'
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',
372
- 'join_tablename' => 'posts',
373
- 'join_type' => 'INNER',
374
- 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0,1)',
375
- 'to_type' => 'reply',
376
- 'to_fieldname' => 'post_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',
@@ -470,15 +544,15 @@ class bbPress1 extends BBP_Converter_Base {
470
 
471
  /** User Section ******************************************************/
472
 
473
- // Store old User id (Stored in usermeta)
474
  $this->field_map[] = array(
475
  'from_tablename' => 'users',
476
  'from_fieldname' => 'ID',
477
  'to_type' => 'user',
478
- 'to_fieldname' => '_bbp_user_id'
479
  );
480
 
481
- // Store old User password (Stored in usermeta)
482
  $this->field_map[] = array(
483
  'from_tablename' => 'users',
484
  'from_fieldname' => 'user_pass',
@@ -591,6 +665,27 @@ class bbPress1 extends BBP_Converter_Base {
591
  return $status;
592
  }
593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  /**
595
  * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings.
596
  *
@@ -626,17 +721,6 @@ class bbPress1 extends BBP_Converter_Base {
626
  return $count;
627
  }
628
 
629
- /**
630
- * Set the reply title
631
- *
632
- * @param string $title bbPress 1.x topic title of this reply
633
- * @return string Prefixed topic title, or empty string
634
- */
635
- public function callback_reply_title( $title = '' ) {
636
- $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
637
- return $title;
638
- }
639
-
640
  /**
641
  * This method is to save the salt and password together. That
642
  * way when we authenticate it we can get it out of the database
@@ -654,6 +738,21 @@ class bbPress1 extends BBP_Converter_Base {
654
  return false;
655
  }
656
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  /**
658
  * This callback:
659
  *
1
  <?php
2
 
3
+ /**
4
+ * bbPress 1.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * bbPress 1.1 Converter
12
  *
13
+ * @since 2.1.0 bbPress (r3816)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/bbpress-1-x-buddypress-group-forums
16
  */
17
  class bbPress1 extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'forum_id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0. Stored in postmeta)
46
  'from_tablename' => 'forums',
47
  'from_fieldname' => 'forum_parent',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
127
  'callback_method' => 'callback_forum_type'
128
  );
129
 
130
+ // Forum status (Set a default value 'open', Stored in postmeta)
131
+ $this->field_map[] = array(
132
+ 'to_type' => 'forum',
133
+ 'to_fieldname' => '_bbp_status',
134
+ 'default' => 'open'
135
+ );
136
+
137
  // Forum dates.
138
  $this->field_map[] = array(
139
  'to_type' => 'forum',
156
  'default' => date('Y-m-d H:i:s')
157
  );
158
 
159
+ /** Forum Subscriptions Section ***************************************/
160
+
161
+ /**
162
+ * bbPress 1.x Forums do not support forum subscriptions
163
+ */
164
+
165
  /** Topic Section *****************************************************/
166
 
167
+ // Old topic id (Stored in postmeta)
168
  $this->field_map[] = array(
169
  'from_tablename' => 'topics',
170
  'from_fieldname' => 'topic_id',
171
  'to_type' => 'topic',
172
+ 'to_fieldname' => '_bbp_old_topic_id'
173
  );
174
 
175
  // Topic reply count (Stored in postmeta)
250
  'callback_method' => 'callback_status'
251
  );
252
 
253
+ // Topic status (Publish or Closed to new replies)
254
+ $this->field_map[] = array(
255
+ 'from_tablename' => 'topics',
256
+ 'from_fieldname' => 'topic_open',
257
+ 'to_type' => 'topic',
258
+ 'to_fieldname' => '_bbp_old_closed_status_id',
259
+ 'callback_method' => 'callback_topic_status'
260
+ );
261
+
262
  // Topic author ip (Stored in postmeta)
263
  // Note: We join the 'posts' table because 'topics' table does not include author ip.
264
  $this->field_map[] = array(
280
  'callback_method' => 'callback_forumid'
281
  );
282
 
283
+ // Sticky status (Stored in postmeta)
284
  $this->field_map[] = array(
285
  'from_tablename' => 'topics',
286
  'from_fieldname' => 'topic_sticky',
287
  'to_type' => 'topic',
288
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
289
  'callback_method' => 'callback_sticky_status'
290
  );
291
 
343
  'to_fieldname' => 'taxonomy'
344
  );
345
 
346
+ // Term description.
347
+ $this->field_map[] = array(
348
+ 'from_tablename' => 'term_taxonomy',
349
+ 'from_fieldname' => 'description',
350
+ 'join_tablename' => 'term_relationships',
351
+ 'join_type' => 'INNER',
352
+ 'join_expression' => 'USING (term_taxonomy_id)',
353
+ 'to_type' => 'tags',
354
+ 'to_fieldname' => 'description',
355
+ 'callback_method' => 'callback_html'
356
+ );
357
+
358
  // Term text.
359
  $this->field_map[] = array(
360
  'from_tablename' => 'terms',
361
  'from_fieldname' => 'name',
362
  'join_tablename' => 'term_taxonomy',
363
  'join_type' => 'INNER',
364
+ 'join_expression' => 'USING (term_id) WHERE term_taxonomy.taxonomy = "bb_topic_tag"',
365
  'to_type' => 'tags',
366
  'to_fieldname' => 'name'
367
  );
372
  'from_fieldname' => 'slug',
373
  'join_tablename' => 'term_taxonomy',
374
  'join_type' => 'INNER',
375
+ 'join_expression' => 'USING (term_id) WHERE term_taxonomy.taxonomy = "bb_topic_tag"',
376
  'to_type' => 'tags',
377
  'to_fieldname' => 'slug',
378
  'callback_method' => 'callback_slug'
379
  );
380
 
381
+ /** Topic Subscriptions Section ***************************************/
382
+
383
+ // Subscribed user ID (Stored in usermeta)
384
+ $this->field_map[] = array(
385
+ 'from_tablename' => 'term_relationships',
386
+ 'from_fieldname' => 'user_id',
387
+ 'to_type' => 'topic_subscriptions',
388
+ 'to_fieldname' => 'user_id',
389
+ 'callback_method' => 'callback_userid'
390
+ );
391
+
392
+ // Join the 'term_taxonomy' table to link 'terms' 'term_relationships' tables
393
+ $this->field_map[] = array(
394
+ 'from_tablename' => 'term_taxonomy',
395
+ 'from_fieldname' => 'term_taxonomy_id',
396
+ 'join_tablename' => 'term_relationships',
397
+ 'join_type' => 'INNER',
398
+ 'join_expression' => 'USING (term_taxonomy_id)',
399
+ 'to_type' => 'topic_subscriptions'
400
+ );
401
+
402
+ // Subscribed topic ID (Stored in usermeta)
403
+ $this->field_map[] = array(
404
+ 'from_tablename' => 'terms',
405
+ 'from_fieldname' => 'name',
406
+ 'join_tablename' => 'term_taxonomy',
407
+ 'join_type' => 'INNER',
408
+ 'join_expression' => 'USING (term_id) WHERE term_taxonomy.taxonomy = "bb_subscribe"',
409
+ 'to_type' => 'topic_subscriptions',
410
+ 'to_fieldname' => '_bbp_subscriptions',
411
+ 'callback_method' => 'callback_topic_subscriptions'
412
+ );
413
+
414
+ /** Favorites Section *************************************************/
415
+
416
+ // Favorited topic ID (Stored in usermeta)
417
+ $this->field_map[] = array(
418
+ 'from_tablename' => 'usermeta',
419
+ 'from_fieldname' => 'meta_value',
420
+ 'from_expression' => 'WHERE usermeta.meta_key = "bb_favorites"',
421
+ 'to_type' => 'favorites',
422
+ 'to_fieldname' => '_bbp_favorites'
423
+ );
424
+
425
+ // Favorited user ID (Stored in usermeta)
426
+ $this->field_map[] = array(
427
+ 'from_tablename' => 'usermeta',
428
+ 'from_fieldname' => 'user_id',
429
+ 'from_expression' => 'WHERE usermeta.meta_key = "bb_favorites"',
430
+ 'to_type' => 'favorites',
431
+ 'to_fieldname' => 'user_id',
432
+ 'callback_method' => 'callback_userid'
433
+ );
434
+
435
  /** Reply Section *****************************************************/
436
 
437
+ // Old reply id (Stored in postmeta)
438
  $this->field_map[] = array(
439
  'from_tablename' => 'posts',
440
  'from_fieldname' => 'post_id',
441
  'to_type' => 'reply',
442
+ 'to_fieldname' => '_bbp_old_reply_id'
443
  );
444
 
445
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
446
+ // Note: We join the 'topics' table to limit the replies section to only import replies
447
  $this->field_map[] = array(
448
+ 'from_tablename' => 'topics',
449
  'from_fieldname' => 'topic_id',
450
+ 'join_tablename' => 'posts',
451
+ 'join_type' => 'INNER',
452
+ 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0,1)',
453
  'to_type' => 'reply',
454
  'to_fieldname' => '_bbp_topic_id',
455
  'callback_method' => 'callback_topicid'
464
  'callback_method' => 'callback_forumid'
465
  );
466
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  // Reply author ip (Stored in postmeta)
468
  $this->field_map[] = array(
469
  'from_tablename' => 'posts',
544
 
545
  /** User Section ******************************************************/
546
 
547
+ // Store old user id (Stored in usermeta)
548
  $this->field_map[] = array(
549
  'from_tablename' => 'users',
550
  'from_fieldname' => 'ID',
551
  'to_type' => 'user',
552
+ 'to_fieldname' => '_bbp_old_user_id'
553
  );
554
 
555
+ // Store old user password (Stored in usermeta)
556
  $this->field_map[] = array(
557
  'from_tablename' => 'users',
558
  'from_fieldname' => 'user_pass',
665
  return $status;
666
  }
667
 
668
+ /**
669
+ * Translate the topic status from bbPress 1's numeric's to WordPress's
670
+ * strings.
671
+ *
672
+ * @param int $topic_status bbPress 1.x numeric status
673
+ * @return string WordPress safe
674
+ */
675
+ public function callback_topic_status( $topic_status = 1 ) {
676
+ switch ( $topic_status ) {
677
+ case 0 :
678
+ $topic_status = 'closed'; // bbp_get_closed_status_id()
679
+ break;
680
+
681
+ case 1 :
682
+ default :
683
+ $topic_status = 'publish'; // bbp_get_public_status_id()
684
+ break;
685
+ }
686
+ return $topic_status;
687
+ }
688
+
689
  /**
690
  * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings.
691
  *
721
  return $count;
722
  }
723
 
 
 
 
 
 
 
 
 
 
 
 
724
  /**
725
  * This method is to save the salt and password together. That
726
  * way when we authenticate it we can get it out of the database
738
  return false;
739
  }
740
 
741
+ /**
742
+ * This callback strips `topic-` from topic subscriptions taxonomy
743
+ *
744
+ * @since 2.6.0 bbPress (r5572)
745
+ *
746
+ * @param string $field Topic ID
747
+ * @return integer WordPress safe
748
+ */
749
+ protected function callback_topic_subscriptions( $field ) {
750
+
751
+ // Replace 'topic-' with '' so that only the original topic ID remains
752
+ $field = absint( (int) preg_replace( '/(topic-)(\d+)/', '$2', $field ) );
753
+ return $field;
754
+ }
755
+
756
  /**
757
  * This callback:
758
  *
includes/admin/converters/e107v1.php ADDED
@@ -0,0 +1,640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress e107 1.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
+ /**
11
+ * Implementation of e107 v1.x Forum converter.
12
+ *
13
+ * @since 2.6.0 bbPress (r5352)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/e107
16
+ */
17
+ class e107v1 extends BBP_Converter_Base {
18
+
19
+ /**
20
+ * Main Constructor
21
+ *
22
+ * @uses e107v1::setup_globals()
23
+ */
24
+ function __construct() {
25
+ parent::__construct();
26
+ $this->setup_globals();
27
+ }
28
+
29
+ /**
30
+ * Sets up the field mappings
31
+ */
32
+ public function setup_globals() {
33
+
34
+ /** Forum Section *****************************************************/
35
+
36
+ // Old forum id (Stored in postmeta)
37
+ $this->field_map[] = array(
38
+ 'from_tablename' => 'forum',
39
+ 'from_fieldname' => 'forum_id',
40
+ 'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
+ );
43
+
44
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
45
+ $this->field_map[] = array(
46
+ 'from_tablename' => 'forum',
47
+ 'from_fieldname' => 'forum_parent',
48
+ 'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
+ );
51
+
52
+ // Forum topic count (Stored in postmeta)
53
+ $this->field_map[] = array(
54
+ 'from_tablename' => 'forum',
55
+ 'from_fieldname' => 'forum_threads',
56
+ 'to_type' => 'forum',
57
+ 'to_fieldname' => '_bbp_topic_count'
58
+ );
59
+
60
+ // Forum reply count (Stored in postmeta)
61
+ $this->field_map[] = array(
62
+ 'from_tablename' => 'forum',
63
+ 'from_fieldname' => 'forum_replies',
64
+ 'to_type' => 'forum',
65
+ 'to_fieldname' => '_bbp_reply_count'
66
+ );
67
+
68
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
69
+ $this->field_map[] = array(
70
+ 'from_tablename' => 'forum',
71
+ 'from_fieldname' => 'forum_threads',
72
+ 'to_type' => 'forum',
73
+ 'to_fieldname' => '_bbp_total_topic_count'
74
+ );
75
+
76
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
77
+ $this->field_map[] = array(
78
+ 'from_tablename' => 'forum',
79
+ 'from_fieldname' => 'forum_replies',
80
+ 'to_type' => 'forum',
81
+ 'to_fieldname' => '_bbp_total_reply_count'
82
+ );
83
+
84
+ // Forum title.
85
+ $this->field_map[] = array(
86
+ 'from_tablename' => 'forum',
87
+ 'from_fieldname' => 'forum_name',
88
+ 'to_type' => 'forum',
89
+ 'to_fieldname' => 'post_title'
90
+ );
91
+
92
+ // Forum slug (Clean name to avoid conflicts)
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'forum',
95
+ 'from_fieldname' => 'forum_name',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'post_name',
98
+ 'callback_method' => 'callback_slug'
99
+ );
100
+
101
+ // Forum description.
102
+ $this->field_map[] = array(
103
+ 'from_tablename' => 'forum',
104
+ 'from_fieldname' => 'forum_description',
105
+ 'to_type' => 'forum',
106
+ 'to_fieldname' => 'post_content',
107
+ 'callback_method' => 'callback_null'
108
+ );
109
+
110
+ // Forum display order (Starts from 1)
111
+ $this->field_map[] = array(
112
+ 'from_tablename' => 'forum',
113
+ 'from_fieldname' => 'forum_order',
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'menu_order'
116
+ );
117
+
118
+ // Forum type (Category = 0 or Forum > 0, Stored in postmeta)
119
+ $this->field_map[] = array(
120
+ 'from_tablename' => 'forum',
121
+ 'from_fieldname' => 'forum_parent',
122
+ 'to_type' => 'forum',
123
+ 'to_fieldname' => '_bbp_forum_type',
124
+ 'callback_method' => 'callback_forum_type'
125
+ );
126
+
127
+ // Forum status (Set a default value 'open', Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => '_bbp_status',
131
+ 'default' => 'open'
132
+ );
133
+
134
+ // Forum dates.
135
+ $this->field_map[] = array(
136
+ 'to_type' => 'forum',
137
+ 'to_fieldname' => 'post_date',
138
+ 'default' => date('Y-m-d H:i:s')
139
+ );
140
+ $this->field_map[] = array(
141
+ 'to_type' => 'forum',
142
+ 'to_fieldname' => 'post_date_gmt',
143
+ 'default' => date('Y-m-d H:i:s')
144
+ );
145
+ $this->field_map[] = array(
146
+ 'to_type' => 'forum',
147
+ 'to_fieldname' => 'post_modified',
148
+ 'default' => date('Y-m-d H:i:s')
149
+ );
150
+ $this->field_map[] = array(
151
+ 'to_type' => 'forum',
152
+ 'to_fieldname' => 'post_modified_gmt',
153
+ 'default' => date('Y-m-d H:i:s')
154
+ );
155
+
156
+ /** Topic Section *****************************************************/
157
+
158
+ // Old topic id (Stored in postmeta)
159
+ $this->field_map[] = array(
160
+ 'from_tablename' => 'forum_t',
161
+ 'from_fieldname' => 'thread_id',
162
+ 'from_expression' => 'WHERE thread_parent = 0',
163
+ 'to_type' => 'topic',
164
+ 'to_fieldname' => '_bbp_old_topic_id'
165
+ );
166
+
167
+ // Topic reply count (Stored in postmeta)
168
+ $this->field_map[] = array(
169
+ 'from_tablename' => 'forum_t',
170
+ 'from_fieldname' => 'thread_total_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' => 'forum_t',
179
+ 'from_fieldname' => 'thread_total_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' => 'forum_t',
188
+ 'from_fieldname' => 'thread_forum_id',
189
+ 'to_type' => 'topic',
190
+ 'to_fieldname' => '_bbp_forum_id',
191
+ 'callback_method' => 'callback_forumid'
192
+ );
193
+
194
+ // Topic author.
195
+ // Note: Uses a custom callback to transform user id from '1.Administrator e107v1' to numeric user id.
196
+ $this->field_map[] = array(
197
+ 'from_tablename' => 'forum_t',
198
+ 'from_fieldname' => 'thread_user',
199
+ 'to_type' => 'topic',
200
+ 'to_fieldname' => 'post_author',
201
+ 'callback_method' => 'callback_e107v1_userid'
202
+ );
203
+
204
+ // Topic content.
205
+ $this->field_map[] = array(
206
+ 'from_tablename' => 'forum_t',
207
+ 'from_fieldname' => 'thread_thread',
208
+ 'to_type' => 'topic',
209
+ 'to_fieldname' => 'post_content',
210
+ 'callback_method' => 'callback_html'
211
+ );
212
+
213
+ // Topic title.
214
+ $this->field_map[] = array(
215
+ 'from_tablename' => 'forum_t',
216
+ 'from_fieldname' => 'thread_name',
217
+ 'to_type' => 'topic',
218
+ 'to_fieldname' => 'post_title'
219
+ );
220
+
221
+ // Topic slug (Clean name to avoid conflicts)
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'forum_t',
224
+ 'from_fieldname' => 'thread_name',
225
+ 'to_type' => 'topic',
226
+ 'to_fieldname' => 'post_name',
227
+ 'callback_method' => 'callback_slug'
228
+ );
229
+
230
+ // Topic status (Open or Closed, e107 v1.x open = 1 & closed = 0)
231
+ $this->field_map[] = array(
232
+ 'from_tablename' => 'forum_t',
233
+ 'from_fieldname' => 'thread_active',
234
+ 'to_type' => 'topic',
235
+ 'to_fieldname' => '_bbp_old_closed_status_id',
236
+ 'callback_method' => 'callback_topic_status'
237
+ );
238
+
239
+ // Topic parent forum id (If no parent, then 0)
240
+ $this->field_map[] = array(
241
+ 'from_tablename' => 'forum_t',
242
+ 'from_fieldname' => 'thread_forum_id',
243
+ 'to_type' => 'topic',
244
+ 'to_fieldname' => 'post_parent',
245
+ 'callback_method' => 'callback_forumid'
246
+ );
247
+
248
+ // Sticky status (Stored in postmeta)
249
+ $this->field_map[] = array(
250
+ 'from_tablename' => 'forum_t',
251
+ 'from_fieldname' => 'thread_s',
252
+ 'to_type' => 'topic',
253
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
254
+ 'callback_method' => 'callback_sticky_status'
255
+ );
256
+
257
+ // Topic dates.
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'forum_t',
260
+ 'from_fieldname' => 'thread_datestamp',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => 'post_date',
263
+ 'callback_method' => 'callback_datetime'
264
+ );
265
+ $this->field_map[] = array(
266
+ 'from_tablename' => 'forum_t',
267
+ 'from_fieldname' => 'thread_datestamp',
268
+ 'to_type' => 'topic',
269
+ 'to_fieldname' => 'post_date_gmt',
270
+ 'callback_method' => 'callback_datetime'
271
+ );
272
+ $this->field_map[] = array(
273
+ 'from_tablename' => 'forum_t',
274
+ 'from_fieldname' => 'thread_datestamp',
275
+ 'to_type' => 'topic',
276
+ 'to_fieldname' => 'post_modified',
277
+ 'callback_method' => 'callback_datetime'
278
+ );
279
+ $this->field_map[] = array(
280
+ 'from_tablename' => 'forum_t',
281
+ 'from_fieldname' => 'thread_datestamp',
282
+ 'to_type' => 'topic',
283
+ 'to_fieldname' => 'post_modified_gmt',
284
+ 'callback_method' => 'callback_datetime'
285
+ );
286
+ $this->field_map[] = array(
287
+ 'from_tablename' => 'forum_t',
288
+ 'from_fieldname' => 'thread_datestamp',
289
+ 'to_type' => 'topic',
290
+ 'to_fieldname' => '_bbp_last_active_time',
291
+ 'callback_method' => 'callback_datetime'
292
+ );
293
+
294
+ /** Tags Section ******************************************************/
295
+
296
+ /**
297
+ * e107 v1.x Forums do not support topic tags out of the box
298
+ */
299
+
300
+ /** Reply Section *****************************************************/
301
+
302
+ // Old reply id (Stored in postmeta)
303
+ $this->field_map[] = array(
304
+ 'from_tablename' => 'forum_t',
305
+ 'from_fieldname' => 'thread_id',
306
+ 'from_expression' => 'WHERE thread_parent != 0',
307
+ 'to_type' => 'reply',
308
+ 'to_fieldname' => '_bbp_old_reply_id'
309
+ );
310
+
311
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
312
+ $this->field_map[] = array(
313
+ 'from_tablename' => 'forum_t',
314
+ 'from_fieldname' => 'thread_forum_id',
315
+ 'to_type' => 'reply',
316
+ 'to_fieldname' => '_bbp_forum_id',
317
+ 'callback_method' => 'callback_topicid_to_forumid'
318
+ );
319
+
320
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
321
+ $this->field_map[] = array(
322
+ 'from_tablename' => 'forum_t',
323
+ 'from_fieldname' => 'thread_parent',
324
+ 'to_type' => 'reply',
325
+ 'to_fieldname' => '_bbp_topic_id',
326
+ 'callback_method' => 'callback_topicid'
327
+ );
328
+
329
+ // Reply author.
330
+ // Note: Uses a custom callback to transform user id from '1.Administrator e107v1' to numeric user id.
331
+ $this->field_map[] = array(
332
+ 'from_tablename' => 'forum_t',
333
+ 'from_fieldname' => 'thread_user',
334
+ 'to_type' => 'reply',
335
+ 'to_fieldname' => 'post_author',
336
+ 'callback_method' => 'callback_e107v1_userid'
337
+ );
338
+
339
+ // Reply content.
340
+ $this->field_map[] = array(
341
+ 'from_tablename' => 'forum_t',
342
+ 'from_fieldname' => 'thread_thread',
343
+ 'to_type' => 'reply',
344
+ 'to_fieldname' => 'post_content',
345
+ 'callback_method' => 'callback_html'
346
+ );
347
+
348
+ // Reply parent topic id (If no parent, then 0)
349
+ $this->field_map[] = array(
350
+ 'from_tablename' => 'forum_t',
351
+ 'from_fieldname' => 'thread_parent',
352
+ 'to_type' => 'reply',
353
+ 'to_fieldname' => 'post_parent',
354
+ 'callback_method' => 'callback_topicid'
355
+ );
356
+
357
+ // Reply dates.
358
+ $this->field_map[] = array(
359
+ 'from_tablename' => 'forum_t',
360
+ 'from_fieldname' => 'thread_datestamp',
361
+ 'to_type' => 'reply',
362
+ 'to_fieldname' => 'post_date',
363
+ 'callback_method' => 'callback_datetime'
364
+ );
365
+ $this->field_map[] = array(
366
+ 'from_tablename' => 'forum_t',
367
+ 'from_fieldname' => 'thread_datestamp',
368
+ 'to_type' => 'reply',
369
+ 'to_fieldname' => 'post_date_gmt',
370
+ 'callback_method' => 'callback_datetime'
371
+ );
372
+ $this->field_map[] = array(
373
+ 'from_tablename' => 'forum_t',
374
+ 'from_fieldname' => 'thread_datestamp',
375
+ 'to_type' => 'reply',
376
+ 'to_fieldname' => 'post_modified',
377
+ 'callback_method' => 'callback_datetime'
378
+ );
379
+ $this->field_map[] = array(
380
+ 'from_tablename' => 'forum_t',
381
+ 'from_fieldname' => 'thread_datestamp',
382
+ 'to_type' => 'reply',
383
+ 'to_fieldname' => 'post_modified_gmt',
384
+ 'callback_method' => 'callback_datetime'
385
+ );
386
+
387
+ /** User Section ******************************************************/
388
+
389
+ // Store old user id (Stored in usermeta)
390
+ $this->field_map[] = array(
391
+ 'from_tablename' => 'user',
392
+ 'from_fieldname' => 'user_id',
393
+ 'to_type' => 'user',
394
+ 'to_fieldname' => '_bbp_old_user_id'
395
+ );
396
+
397
+ // Store old user password (Stored in usermeta serialized with salt)
398
+ $this->field_map[] = array(
399
+ 'from_tablename' => 'user',
400
+ 'from_fieldname' => 'user_password',
401
+ 'to_type' => 'user',
402
+ 'to_fieldname' => '_bbp_password',
403
+ 'callback_method' => 'callback_savepass'
404
+ );
405
+
406
+ // User password verify class (Stored in usermeta for verifying password)
407
+ $this->field_map[] = array(
408
+ 'to_type' => 'user',
409
+ 'to_fieldname' => '_bbp_class',
410
+ 'default' => 'e107v1'
411
+ );
412
+
413
+ // User name.
414
+ $this->field_map[] = array(
415
+ 'from_tablename' => 'user',
416
+ 'from_fieldname' => 'user_loginname',
417
+ 'to_type' => 'user',
418
+ 'to_fieldname' => 'user_login'
419
+ );
420
+
421
+ // User nice name.
422
+ $this->field_map[] = array(
423
+ 'from_tablename' => 'user',
424
+ 'from_fieldname' => 'user_loginname',
425
+ 'to_type' => 'user',
426
+ 'to_fieldname' => 'user_nicename'
427
+ );
428
+
429
+ // User email.
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'user',
432
+ 'from_fieldname' => 'user_email',
433
+ 'to_type' => 'user',
434
+ 'to_fieldname' => 'user_email'
435
+ );
436
+
437
+ // User registered.
438
+ $this->field_map[] = array(
439
+ 'from_tablename' => 'user',
440
+ 'from_fieldname' => 'user_join',
441
+ 'to_type' => 'user',
442
+ 'to_fieldname' => 'user_registered',
443
+ 'callback_method' => 'callback_datetime'
444
+ );
445
+
446
+ // User display name.
447
+ $this->field_map[] = array(
448
+ 'from_tablename' => 'user',
449
+ 'from_fieldname' => 'user_name',
450
+ 'to_type' => 'user',
451
+ 'to_fieldname' => 'display_name'
452
+ );
453
+
454
+ // Store Signature (Stored in usermeta)
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'user',
457
+ 'from_fieldname' => 'user_signature',
458
+ 'to_fieldname' => '_bbp_e107v1_user_sig',
459
+ 'to_type' => 'user',
460
+ 'callback_method' => 'callback_html'
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 e107 v1.x numeric's to WordPress's strings.
496
+ *
497
+ * @param int $status e107 v1.x numeric forum type
498
+ * @return string WordPress safe
499
+ */
500
+ public function callback_forum_type( $status = 0 ) {
501
+ if ( $status == 0 ) {
502
+ $status = 'category';
503
+ } else {
504
+ $status = 'forum';
505
+ }
506
+ return $status;
507
+ }
508
+
509
+ /**
510
+ * Translate the post status from e107 v1.x numeric's to WordPress's strings.
511
+ *
512
+ * @param int $status e107 v1.x numeric topic status
513
+ * @return string WordPress safe
514
+ */
515
+ public function callback_topic_status( $status = 1 ) {
516
+ switch ( $status ) {
517
+ case 0 :
518
+ $status = 'closed';
519
+ break;
520
+
521
+ case 1 :
522
+ default :
523
+ $status = 'publish';
524
+ break;
525
+ }
526
+ return $status;
527
+ }
528
+
529
+ /**
530
+ * Translate the topic sticky status type from e107 v1.x numeric's to WordPress's strings.
531
+ *
532
+ * @param int $status e107 v1.x numeric forum type
533
+ * @return string WordPress safe
534
+ */
535
+ public function callback_sticky_status( $status = 0 ) {
536
+ switch ( $status ) {
537
+ case 2 :
538
+ $status = 'super-sticky'; // e107 Announcement Sticky 'thread_s = 2'
539
+ break;
540
+
541
+ case 1 :
542
+ $status = 'sticky'; // e107 Sticky 'thread_s = 1'
543
+ break;
544
+
545
+ case 0 :
546
+ default :
547
+ $status = 'normal'; // e107 normal topic 'thread_s = 0'
548
+ break;
549
+ }
550
+ return $status;
551
+ }
552
+
553
+ /**
554
+ * Verify the topic/reply count.
555
+ *
556
+ * @param int $count e107 v1.x topic/reply counts
557
+ * @return string WordPress safe
558
+ */
559
+ public function callback_topic_reply_count( $count = 1 ) {
560
+ $count = absint( (int) $count - 1 );
561
+ return $count;
562
+ }
563
+
564
+ /**
565
+ * Override the `callback_user` function in 'converter.php' for custom e107v1 imports
566
+ *
567
+ * A mini cache system to reduce database calls to user ID's
568
+ *
569
+ * @param string $field
570
+ * @return string
571
+ */
572
+ protected function callback_e107v1_userid( $field ) {
573
+
574
+ // Strip only the user id from the topic and reply authors
575
+ $field = preg_replace( '/(\d+?)+\.[\S\s]+/', '$1', $field );
576
+
577
+ if ( ! isset( $this->map_userid[ $field ] ) ) {
578
+ if ( ! empty( $this->sync_table ) ) {
579
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_user_id', $field ) );
580
+ } else {
581
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT user_id AS value_id FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_user_id', $field ) );
582
+ }
583
+
584
+ if ( ! is_null( $row ) ) {
585
+ $this->map_userid[ $field ] = $row->value_id;
586
+ } else {
587
+ if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {
588
+ $this->map_userid[ $field ] = 0;
589
+ } else {
590
+ $this->map_userid[ $field ] = $field;
591
+ }
592
+ }
593
+ }
594
+ return $this->map_userid[ $field ];
595
+ }
596
+
597
+ /**
598
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
599
+ */
600
+ protected function callback_html( $field ) {
601
+
602
+ // Strips custom e107v1 'magic_url' and 'bbcode_uid' first from $field before parsing $field to parser.php
603
+ $e107v1_markup = $field;
604
+ $e107v1_markup = html_entity_decode( $e107v1_markup );
605
+
606
+ // Replace '[blockquote]' with '<blockquote>'
607
+ $e107v1_markup = preg_replace( '/\[blockquote\]/', '<blockquote>', $e107v1_markup );
608
+ // Replace '[/blockquote]' with '</blockquote>'
609
+ $e107v1_markup = preg_replace( '/\[\/blockquote\]/', '</blockquote>', $e107v1_markup );
610
+
611
+ // Replace '[quote$1=$2]' with '<em>$2 wrote:</em><blockquote>"
612
+ $e107v1_markup = preg_replace( '/\[quote(.*?)=(.*?)\]/', '<em>@$2 wrote:</em><blockquote>', $e107v1_markup );
613
+ // Replace '[/quote$1]' with '</blockquote>"
614
+ $e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/' , '</blockquote>', $e107v1_markup );
615
+
616
+ // Remove '[justify]'
617
+ $e107v1_markup = preg_replace( '/\[justify\]/', '', $e107v1_markup );
618
+ // Remove '[/justify]'
619
+ $e107v1_markup = preg_replace( '/\[\/justify\]/', '', $e107v1_markup );
620
+
621
+ // Replace '[link=(https|http)://$2]$3[/link]' with '<a href="$1://$2">$3</a>'
622
+ $e107v1_markup = preg_replace( '/\[link\=(https|http)\:\/\/(.*?)\](.*?)\[\/link\]/i', '<a href="$1://$2">$3</a>', $e107v1_markup );
623
+
624
+ // Replace '[list=(decimal|lower-roman|upper-roman|lower-alpha|upper-alpha)]' with '[list]'
625
+ $e107v1_markup = preg_replace( '/\[list\=(decimal|lower-roman|upper-roman|lower-alpha|upper-alpha)\]/i', '[list]', $e107v1_markup );
626
+
627
+ // Replace '[youtube]$1[/youtube]' with '$1"
628
+ $e107v1_markup = preg_replace( '/\[youtube\](.*?)\[\/youtube\]/', 'https://youtu.be/$1', $e107v1_markup );
629
+
630
+ // Now that e107v1 custom HTML has been stripped put the cleaned HTML back in $field
631
+ $field = $e107v1_markup;
632
+
633
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
634
+ require_once( bbpress()->admin->admin_dir . 'parser.php' );
635
+ $bbcode = BBCode::getInstance();
636
+ $bbcode->enable_smileys = false;
637
+ $bbcode->smiley_regex = false;
638
+ return html_entity_decode( $bbcode->Parse( $field ) );
639
+ }
640
+ }
includes/admin/converters/phpBB.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of phpBB v3 Converter.
5
  *
6
- * @since bbPress (r4689)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/phpbb
 
8
  */
9
  class phpBB extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class phpBB extends BBP_Converter_Base {
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)
@@ -38,13 +46,13 @@ class phpBB extends BBP_Converter_Base {
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' => 'forum_topics',
48
  'to_type' => 'forum',
49
  'to_fieldname' => '_bbp_topic_count'
50
  );
@@ -52,7 +60,7 @@ class phpBB extends BBP_Converter_Base {
52
  // Forum reply count (Stored in postmeta)
53
  $this->field_map[] = array(
54
  'from_tablename' => 'forums',
55
- 'from_fieldname' => 'forum_posts',
56
  'to_type' => 'forum',
57
  'to_fieldname' => '_bbp_reply_count'
58
  );
@@ -60,7 +68,7 @@ class phpBB extends BBP_Converter_Base {
60
  // Forum total topic count (Includes unpublished topics, Stored in postmeta)
61
  $this->field_map[] = array(
62
  'from_tablename' => 'forums',
63
- 'from_fieldname' => 'forum_topics_real',
64
  'to_type' => 'forum',
65
  'to_fieldname' => '_bbp_total_topic_count'
66
  );
@@ -68,7 +76,7 @@ class phpBB extends BBP_Converter_Base {
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',
72
  'to_type' => 'forum',
73
  'to_fieldname' => '_bbp_total_reply_count'
74
  );
@@ -147,20 +155,39 @@ class phpBB extends BBP_Converter_Base {
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' => 'topics',
155
  'from_fieldname' => 'topic_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' => 'topics',
163
- 'from_fieldname' => 'topic_replies',
164
  'to_type' => 'topic',
165
  'to_fieldname' => '_bbp_reply_count',
166
  'callback_method' => 'callback_topic_reply_count'
@@ -169,7 +196,7 @@ class phpBB extends BBP_Converter_Base {
169
  // Topic total reply count (Includes unpublished replies, Stored in postmeta)
170
  $this->field_map[] = array(
171
  'from_tablename' => 'topics',
172
- 'from_fieldname' => 'topic_replies_real',
173
  'to_type' => 'topic',
174
  'to_fieldname' => '_bbp_total_reply_count',
175
  'callback_method' => 'callback_topic_reply_count'
@@ -193,6 +220,23 @@ class phpBB extends BBP_Converter_Base {
193
  'callback_method' => 'callback_userid'
194
  );
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  // Topic Author ip (Stored in postmeta)
197
  $this->field_map[] = array(
198
  'from_tablename' => 'posts',
@@ -239,7 +283,7 @@ class phpBB extends BBP_Converter_Base {
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
 
@@ -252,12 +296,12 @@ class phpBB extends BBP_Converter_Base {
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
 
@@ -291,10 +335,10 @@ class phpBB extends BBP_Converter_Base {
291
  'callback_method' => 'callback_datetime'
292
  );
293
  $this->field_map[] = array(
294
- 'from_tablename' => 'topics',
295
- 'from_fieldname' => 'topic_last_post_time',
296
- 'to_type' => 'topic',
297
- 'to_fieldname' => '_bbp_last_active_time',
298
  'callback_method' => 'callback_datetime'
299
  );
300
 
@@ -304,14 +348,52 @@ class phpBB extends BBP_Converter_Base {
304
  * phpBB Forums do not support topic tags
305
  */
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  /** Reply Section *****************************************************/
308
 
309
- // Reply id (Stored in postmeta)
310
  $this->field_map[] = array(
311
  'from_tablename' => 'posts',
312
  'from_fieldname' => 'post_id',
313
  'to_type' => 'reply',
314
- 'to_fieldname' => '_bbp_post_id'
315
  );
316
 
317
  // Setup reply section table joins
@@ -330,7 +412,7 @@ class phpBB extends BBP_Converter_Base {
330
  'from_fieldname' => 'forum_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)
@@ -359,22 +441,21 @@ class phpBB extends BBP_Converter_Base {
359
  'callback_method' => 'callback_userid'
360
  );
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)
372
  $this->field_map[] = array(
373
  'from_tablename' => 'posts',
374
- 'from_fieldname' => 'post_subject',
375
  'to_type' => 'reply',
376
- 'to_fieldname' => 'post_name',
377
- 'callback_method' => 'callback_slug'
378
  );
379
 
380
  // Reply content.
@@ -427,15 +508,16 @@ class phpBB extends BBP_Converter_Base {
427
 
428
  /** User Section ******************************************************/
429
 
430
- // Store old User id (Stored in usermeta)
 
431
  $this->field_map[] = array(
432
- 'from_tablename' => 'users',
433
- 'from_fieldname' => 'user_id',
434
- 'to_type' => 'user',
435
- 'to_fieldname' => '_bbp_user_id'
436
  );
437
 
438
- // Store old User password (Stored in usermeta serialized with salt)
439
  $this->field_map[] = array(
440
  'from_tablename' => 'users',
441
  'from_fieldname' => 'user_password',
@@ -444,7 +526,7 @@ class phpBB extends BBP_Converter_Base {
444
  'callback_method' => 'callback_savepass'
445
  );
446
 
447
- // Store old User Salt (This is only used for the SELECT row info for the above password save)
448
  $this->field_map[] = array(
449
  'from_tablename' => 'users',
450
  'from_fieldname' => 'user_form_salt',
@@ -477,10 +559,13 @@ class phpBB extends BBP_Converter_Base {
477
 
478
  // User homepage.
479
  $this->field_map[] = array(
480
- 'from_tablename' => 'users',
481
- 'from_fieldname' => 'user_website',
482
- 'to_type' => 'user',
483
- 'to_fieldname' => 'user_url'
 
 
 
484
  );
485
 
486
  // User registered.
@@ -492,58 +577,98 @@ class phpBB extends BBP_Converter_Base {
492
  'callback_method' => 'callback_datetime'
493
  );
494
 
495
- // User AIM (Stored in usermeta)
496
  $this->field_map[] = array(
497
- 'from_tablename' => 'users',
498
- 'from_fieldname' => 'user_aim',
499
  'to_type' => 'user',
500
- 'to_fieldname' => 'aim'
501
  );
502
 
503
  // User Yahoo (Stored in usermeta)
504
  $this->field_map[] = array(
505
- 'from_tablename' => 'users',
506
- 'from_fieldname' => 'user_yim',
507
  'to_type' => 'user',
508
- 'to_fieldname' => 'yim'
509
  );
510
 
511
  // Store ICQ (Stored in usermeta)
512
  $this->field_map[] = array(
513
- 'from_tablename' => 'users',
514
- 'from_fieldname' => 'user_icq',
515
  'to_type' => 'user',
516
  'to_fieldname' => '_bbp_phpbb_user_icq'
517
  );
518
 
519
- // Store MSN (Stored in usermeta)
520
  $this->field_map[] = array(
521
- 'from_tablename' => 'users',
522
- 'from_fieldname' => 'user_msnm',
523
  'to_type' => 'user',
524
  'to_fieldname' => '_bbp_phpbb_user_msnm'
525
  );
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  // Store Jabber
528
  $this->field_map[] = array(
529
  'from_tablename' => 'users',
530
  'from_fieldname' => 'user_jabber',
531
  'to_type' => 'user',
532
- 'to_fieldname' => 'jabber'
533
  );
534
 
535
  // Store Occupation (Stored in usermeta)
536
  $this->field_map[] = array(
537
- 'from_tablename' => 'users',
538
- 'from_fieldname' => 'user_occ',
539
  'to_type' => 'user',
540
  'to_fieldname' => '_bbp_phpbb_user_occ'
541
  );
542
 
543
  // Store Interests (Stored in usermeta)
544
  $this->field_map[] = array(
545
- 'from_tablename' => 'users',
546
- 'from_fieldname' => 'user_interests',
547
  'to_type' => 'user',
548
  'to_fieldname' => '_bbp_phpbb_user_interests'
549
  );
@@ -559,8 +684,8 @@ class phpBB extends BBP_Converter_Base {
559
 
560
  // Store Location (Stored in usermeta)
561
  $this->field_map[] = array(
562
- 'from_tablename' => 'users',
563
- 'from_fieldname' => 'user_from',
564
  'to_type' => 'user',
565
  'to_fieldname' => '_bbp_phpbb_user_from'
566
  );
@@ -603,7 +728,7 @@ class phpBB extends BBP_Converter_Base {
603
  * @param string $hash The stored password hash
604
  *
605
  * @link Original source for password functions http://openwall.com/phpass/
606
- * @link phpass is now included in WP Core http://core.trac.wordpress.org/browser/trunk/wp-includes/class-phpass.php
607
  *
608
  * @return bool Returns true if the password is correct, false if not.
609
  */
@@ -678,11 +803,11 @@ class phpBB extends BBP_Converter_Base {
678
  $i = 0;
679
 
680
  do {
681
- $value = ord( $input[$i++] );
682
- $output .= $itoa64[$value & 0x3f];
683
 
684
  if ($i < $count) {
685
- $value |= ord( $input[$i] ) << 8;
686
  }
687
 
688
  $output .= $itoa64[( $value >> 6 ) & 0x3f];
@@ -692,7 +817,7 @@ class phpBB extends BBP_Converter_Base {
692
  }
693
 
694
  if ( $i < $count ) {
695
- $value |= ord( $input[$i] ) << 16;
696
  }
697
 
698
  $output .= $itoa64[( $value >> 12 ) & 0x3f];
@@ -806,17 +931,6 @@ class phpBB extends BBP_Converter_Base {
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
  */
1
  <?php
2
 
3
+ /**
4
+ * bbPress phpBB 3.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of phpBB v3 Converter.
12
  *
13
+ * @since 2.3.0 bbPress (r4689)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/phpbb
16
  */
17
  class phpBB extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forums',
39
  'from_fieldname' => 'forum_id',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0, Stored in postmeta)
46
  'from_tablename' => 'forums',
47
  'from_fieldname' => 'parent_id',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
53
  $this->field_map[] = array(
54
  'from_tablename' => 'forums',
55
+ 'from_fieldname' => 'forum_topics_approved',
56
  'to_type' => 'forum',
57
  'to_fieldname' => '_bbp_topic_count'
58
  );
60
  // Forum reply count (Stored in postmeta)
61
  $this->field_map[] = array(
62
  'from_tablename' => 'forums',
63
+ 'from_fieldname' => 'forum_posts_approved',
64
  'to_type' => 'forum',
65
  'to_fieldname' => '_bbp_reply_count'
66
  );
68
  // Forum total topic count (Includes unpublished topics, Stored in postmeta)
69
  $this->field_map[] = array(
70
  'from_tablename' => 'forums',
71
+ 'from_fieldname' => 'forum_topics_approved',
72
  'to_type' => 'forum',
73
  'to_fieldname' => '_bbp_total_topic_count'
74
  );
76
  // Forum total reply count (Includes unpublished replies, Stored in postmeta)
77
  $this->field_map[] = array(
78
  'from_tablename' => 'forums',
79
+ 'from_fieldname' => 'forum_posts_approved',
80
  'to_type' => 'forum',
81
  'to_fieldname' => '_bbp_total_reply_count'
82
  );
155
  'default' => date('Y-m-d H:i:s')
156
  );
157
 
158
+ /** Forum Subscriptions Section ***************************************/
159
+
160
+ // Subscribed forum ID (Stored in usermeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'forums_watch',
163
+ 'from_fieldname' => 'forum_id',
164
+ 'to_type' => 'forum_subscriptions',
165
+ 'to_fieldname' => '_bbp_forum_subscriptions'
166
+ );
167
+
168
+ // Subscribed user ID (Stored in usermeta)
169
+ $this->field_map[] = array(
170
+ 'from_tablename' => 'forums_watch',
171
+ 'from_fieldname' => 'user_id',
172
+ 'to_type' => 'forum_subscriptions',
173
+ 'to_fieldname' => 'user_id',
174
+ 'callback_method' => 'callback_userid'
175
+ );
176
+
177
  /** Topic Section *****************************************************/
178
 
179
+ // Old topic id (Stored in postmeta)
180
  $this->field_map[] = array(
181
  'from_tablename' => 'topics',
182
  'from_fieldname' => 'topic_id',
183
  'to_type' => 'topic',
184
+ 'to_fieldname' => '_bbp_old_topic_id'
185
  );
186
 
187
  // Topic reply count (Stored in postmeta)
188
  $this->field_map[] = array(
189
  'from_tablename' => 'topics',
190
+ 'from_fieldname' => 'topic_posts_approved',
191
  'to_type' => 'topic',
192
  'to_fieldname' => '_bbp_reply_count',
193
  'callback_method' => 'callback_topic_reply_count'
196
  // Topic total reply count (Includes unpublished replies, Stored in postmeta)
197
  $this->field_map[] = array(
198
  'from_tablename' => 'topics',
199
+ 'from_fieldname' => 'topic_posts_approved',
200
  'to_type' => 'topic',
201
  'to_fieldname' => '_bbp_total_reply_count',
202
  'callback_method' => 'callback_topic_reply_count'
220
  'callback_method' => 'callback_userid'
221
  );
222
 
223
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
224
+ $this->field_map[] = array(
225
+ 'from_tablename' => 'topics',
226
+ 'from_fieldname' => 'topic_first_poster_name',
227
+ 'to_type' => 'topic',
228
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
229
+ );
230
+
231
+ // Is the topic anonymous (Stored in postmeta)
232
+ $this->field_map[] = array(
233
+ 'from_tablename' => 'topics',
234
+ 'from_fieldname' => 'topic_poster',
235
+ 'to_type' => 'topic',
236
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
237
+ 'callback_method' => 'callback_check_anonymous'
238
+ );
239
+
240
  // Topic Author ip (Stored in postmeta)
241
  $this->field_map[] = array(
242
  'from_tablename' => 'posts',
283
  'from_tablename' => 'topics',
284
  'from_fieldname' => 'topic_status',
285
  'to_type' => 'topic',
286
+ 'to_fieldname' => '_bbp_old_closed_status_id',
287
  'callback_method' => 'callback_topic_status'
288
  );
289
 
296
  'callback_method' => 'callback_forumid'
297
  );
298
 
299
+ // Sticky status (Stored in postmeta)
300
  $this->field_map[] = array(
301
  'from_tablename' => 'topics',
302
  'from_fieldname' => 'topic_type',
303
  'to_type' => 'topic',
304
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
305
  'callback_method' => 'callback_sticky_status'
306
  );
307
 
335
  'callback_method' => 'callback_datetime'
336
  );
337
  $this->field_map[] = array(
338
+ 'from_tablename' => 'topics',
339
+ 'from_fieldname' => 'topic_last_post_time',
340
+ 'to_type' => 'topic',
341
+ 'to_fieldname' => '_bbp_last_active_time',
342
  'callback_method' => 'callback_datetime'
343
  );
344
 
348
  * phpBB Forums do not support topic tags
349
  */
350
 
351
+ /** Topic Subscriptions Section ***************************************/
352
+
353
+ // Subscribed topic ID (Stored in usermeta)
354
+ $this->field_map[] = array(
355
+ 'from_tablename' => 'topics_watch',
356
+ 'from_fieldname' => 'topic_id',
357
+ 'to_type' => 'topic_subscriptions',
358
+ 'to_fieldname' => '_bbp_subscriptions'
359
+ );
360
+
361
+ // Subscribed user ID (Stored in usermeta)
362
+ $this->field_map[] = array(
363
+ 'from_tablename' => 'topics_watch',
364
+ 'from_fieldname' => 'user_id',
365
+ 'to_type' => 'topic_subscriptions',
366
+ 'to_fieldname' => 'user_id',
367
+ 'callback_method' => 'callback_userid'
368
+ );
369
+
370
+ /** Favorites Section *************************************************/
371
+
372
+ // Favorited topic ID (Stored in usermeta)
373
+ $this->field_map[] = array(
374
+ 'from_tablename' => 'bookmarks',
375
+ 'from_fieldname' => 'topic_id',
376
+ 'to_type' => 'favorites',
377
+ 'to_fieldname' => '_bbp_favorites'
378
+ );
379
+
380
+ // Favorited user ID (Stored in usermeta)
381
+ $this->field_map[] = array(
382
+ 'from_tablename' => 'bookmarks',
383
+ 'from_fieldname' => 'user_id',
384
+ 'to_type' => 'favorites',
385
+ 'to_fieldname' => 'user_id',
386
+ 'callback_method' => 'callback_userid'
387
+ );
388
+
389
  /** Reply Section *****************************************************/
390
 
391
+ // Old reply id (Stored in postmeta)
392
  $this->field_map[] = array(
393
  'from_tablename' => 'posts',
394
  'from_fieldname' => 'post_id',
395
  'to_type' => 'reply',
396
+ 'to_fieldname' => '_bbp_old_reply_id'
397
  );
398
 
399
  // Setup reply section table joins
412
  'from_fieldname' => 'forum_id',
413
  'to_type' => 'reply',
414
  'to_fieldname' => '_bbp_forum_id',
415
+ 'callback_method' => 'callback_forumid'
416
  );
417
 
418
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
441
  'callback_method' => 'callback_userid'
442
  );
443
 
444
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
445
  $this->field_map[] = array(
446
  'from_tablename' => 'posts',
447
+ 'from_fieldname' => 'post_username',
448
  'to_type' => 'reply',
449
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
 
450
  );
451
 
452
+ // Is the reply anonymous (Stored in postmeta)
453
  $this->field_map[] = array(
454
  'from_tablename' => 'posts',
455
+ 'from_fieldname' => 'poster_id',
456
  'to_type' => 'reply',
457
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
458
+ 'callback_method' => 'callback_check_anonymous'
459
  );
460
 
461
  // Reply content.
508
 
509
  /** User Section ******************************************************/
510
 
511
+ // Store old user id (Stored in usermeta)
512
+ // Don't import users with id 2, these are phpBB bot/crawler accounts
513
  $this->field_map[] = array(
514
+ 'from_tablename' => 'users',
515
+ 'from_fieldname' => 'user_id',
516
+ 'to_type' => 'user',
517
+ 'to_fieldname' => '_bbp_old_user_id'
518
  );
519
 
520
+ // Store old user password (Stored in usermeta serialized with salt)
521
  $this->field_map[] = array(
522
  'from_tablename' => 'users',
523
  'from_fieldname' => 'user_password',
526
  'callback_method' => 'callback_savepass'
527
  );
528
 
529
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
530
  $this->field_map[] = array(
531
  'from_tablename' => 'users',
532
  'from_fieldname' => 'user_form_salt',
559
 
560
  // User homepage.
561
  $this->field_map[] = array(
562
+ 'from_tablename' => 'profile_fields_data',
563
+ 'from_fieldname' => 'pf_phpbb_website',
564
+ 'join_tablename' => 'users',
565
+ 'join_type' => 'LEFT',
566
+ 'join_expression' => 'USING (user_id) WHERE users.user_type !=2',
567
+ 'to_type' => 'user',
568
+ 'to_fieldname' => 'user_url'
569
  );
570
 
571
  // User registered.
577
  'callback_method' => 'callback_datetime'
578
  );
579
 
580
+ // User AOL/AIM (Stored in usermeta)
581
  $this->field_map[] = array(
582
+ 'from_tablename' => 'profile_fields_data',
583
+ 'from_fieldname' => 'pf_phpbb_aol',
584
  'to_type' => 'user',
585
+ 'to_fieldname' => '_bbp_phpbb_user_aim'
586
  );
587
 
588
  // User Yahoo (Stored in usermeta)
589
  $this->field_map[] = array(
590
+ 'from_tablename' => 'profile_fields_data',
591
+ 'from_fieldname' => 'pf_phpbb_yahoo',
592
  'to_type' => 'user',
593
+ 'to_fieldname' => '_bbp_phpbb_user_yim'
594
  );
595
 
596
  // Store ICQ (Stored in usermeta)
597
  $this->field_map[] = array(
598
+ 'from_tablename' => 'profile_fields_data',
599
+ 'from_fieldname' => 'pf_phpbb_icq',
600
  'to_type' => 'user',
601
  'to_fieldname' => '_bbp_phpbb_user_icq'
602
  );
603
 
604
+ // Store MSN/WLM (Stored in usermeta)
605
  $this->field_map[] = array(
606
+ 'from_tablename' => 'profile_fields_data',
607
+ 'from_fieldname' => 'pf_phpbb_wlm',
608
  'to_type' => 'user',
609
  'to_fieldname' => '_bbp_phpbb_user_msnm'
610
  );
611
 
612
+ // Store Facebook (Stored in usermeta)
613
+ $this->field_map[] = array(
614
+ 'from_tablename' => 'profile_fields_data',
615
+ 'from_fieldname' => 'pf_phpbb_facebook',
616
+ 'to_type' => 'user',
617
+ 'to_fieldname' => '_bbp_phpbb_user_facebook'
618
+ );
619
+
620
+ // Store Google+ (Stored in usermeta)
621
+ $this->field_map[] = array(
622
+ 'from_tablename' => 'profile_fields_data',
623
+ 'from_fieldname' => 'pf_phpbb_googleplus',
624
+ 'to_type' => 'user',
625
+ 'to_fieldname' => '_bbp_phpbb_user_googleplus'
626
+ );
627
+
628
+ // Store Skype (Stored in usermeta)
629
+ $this->field_map[] = array(
630
+ 'from_tablename' => 'profile_fields_data',
631
+ 'from_fieldname' => 'pf_phpbb_skype',
632
+ 'to_type' => 'user',
633
+ 'to_fieldname' => '_bbp_phpbb_user_skype'
634
+ );
635
+
636
+ // Store Twitter (Stored in usermeta)
637
+ $this->field_map[] = array(
638
+ 'from_tablename' => 'profile_fields_data',
639
+ 'from_fieldname' => 'pf_phpbb_twitter',
640
+ 'to_type' => 'user',
641
+ 'to_fieldname' => '_bbp_phpbb_user_twitter'
642
+ );
643
+
644
+ // Store Youtube (Stored in usermeta)
645
+ $this->field_map[] = array(
646
+ 'from_tablename' => 'profile_fields_data',
647
+ 'from_fieldname' => 'pf_phpbb_youtube',
648
+ 'to_type' => 'user',
649
+ 'to_fieldname' => '_bbp_phpbb_user_youtube'
650
+ );
651
+
652
  // Store Jabber
653
  $this->field_map[] = array(
654
  'from_tablename' => 'users',
655
  'from_fieldname' => 'user_jabber',
656
  'to_type' => 'user',
657
+ 'to_fieldname' => '_bbp_phpbb_user_jabber'
658
  );
659
 
660
  // Store Occupation (Stored in usermeta)
661
  $this->field_map[] = array(
662
+ 'from_tablename' => 'profile_fields_data',
663
+ 'from_fieldname' => 'pf_phpbb_occupation',
664
  'to_type' => 'user',
665
  'to_fieldname' => '_bbp_phpbb_user_occ'
666
  );
667
 
668
  // Store Interests (Stored in usermeta)
669
  $this->field_map[] = array(
670
+ 'from_tablename' => 'profile_fields_data',
671
+ 'from_fieldname' => 'pf_phpbb_interests',
672
  'to_type' => 'user',
673
  'to_fieldname' => '_bbp_phpbb_user_interests'
674
  );
684
 
685
  // Store Location (Stored in usermeta)
686
  $this->field_map[] = array(
687
+ 'from_tablename' => 'profile_fields_data',
688
+ 'from_fieldname' => 'pf_phpbb_location',
689
  'to_type' => 'user',
690
  'to_fieldname' => '_bbp_phpbb_user_from'
691
  );
728
  * @param string $hash The stored password hash
729
  *
730
  * @link Original source for password functions http://openwall.com/phpass/
731
+ * @link phpass is now included in WP Core https://core.trac.wordpress.org/browser/trunk/wp-includes/class-phpass.php
732
  *
733
  * @return bool Returns true if the password is correct, false if not.
734
  */
803
  $i = 0;
804
 
805
  do {
806
+ $value = ord( $input[ $i++ ] );
807
+ $output .= $itoa64[ $value & 0x3f ];
808
 
809
  if ($i < $count) {
810
+ $value |= ord( $input[ $i ] ) << 8;
811
  }
812
 
813
  $output .= $itoa64[( $value >> 6 ) & 0x3f];
817
  }
818
 
819
  if ( $i < $count ) {
820
+ $value |= ord( $input[ $i ] ) << 16;
821
  }
822
 
823
  $output .= $itoa64[( $value >> 12 ) & 0x3f];
931
  return $count;
932
  }
933
 
 
 
 
 
 
 
 
 
 
 
 
934
  /**
935
  * This callback processes any custom parser.php attributes and custom code with preg_replace
936
  */
includes/admin/converters/vBulletin.php CHANGED
@@ -1,10 +1,18 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of vBulletin v4.x Converter.
5
  *
6
- * @since bbPress (r4724)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/vbulletin
 
8
  */
9
  class vBulletin extends BBP_Converter_Base {
10
 
@@ -25,12 +33,12 @@ class vBulletin extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class vBulletin extends BBP_Converter_Base {
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)
@@ -116,6 +124,13 @@ class vBulletin extends BBP_Converter_Base {
116
  'callback_method' => 'callback_forum_type'
117
  );
118
 
 
 
 
 
 
 
 
119
  // Forum dates.
120
  $this->field_map[] = array(
121
  'to_type' => 'forum',
@@ -138,14 +153,33 @@ class vBulletin 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(
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)
@@ -184,6 +218,23 @@ class vBulletin extends BBP_Converter_Base {
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(
@@ -240,16 +291,16 @@ class vBulletin extends BBP_Converter_Base {
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
 
@@ -332,24 +383,40 @@ class vBulletin extends BBP_Converter_Base {
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'
@@ -381,31 +448,22 @@ class vBulletin extends BBP_Converter_Base {
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(
@@ -457,15 +515,15 @@ class vBulletin extends BBP_Converter_Base {
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',
@@ -474,7 +532,7 @@ class vBulletin extends BBP_Converter_Base {
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',
@@ -527,7 +585,7 @@ class vBulletin extends BBP_Converter_Base {
527
  'from_tablename' => 'user',
528
  'from_fieldname' => 'aim',
529
  'to_type' => 'user',
530
- 'to_fieldname' => 'aim'
531
  );
532
 
533
  // User Yahoo (Stored in usermeta)
@@ -535,7 +593,7 @@ class vBulletin extends BBP_Converter_Base {
535
  'from_tablename' => 'user',
536
  'from_fieldname' => 'yahoo',
537
  'to_type' => 'user',
538
- 'to_fieldname' => 'yim'
539
  );
540
 
541
  // User ICQ (Stored in usermeta)
@@ -642,17 +700,6 @@ class vBulletin extends BBP_Converter_Base {
642
  return $count;
643
  }
644
 
645
- /**
646
- * Set the reply title
647
- *
648
- * @param string $title vBulletin v4.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 numeric's to WordPress's strings.
658
  *
@@ -685,7 +732,7 @@ class vBulletin extends BBP_Converter_Base {
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"
@@ -693,6 +740,8 @@ class vBulletin extends BBP_Converter_Base {
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;
1
  <?php
2
 
3
+ /**
4
+ * bbPress vBulletin 4.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of vBulletin v4.x Converter.
12
  *
13
+ * @since 2.3.0 bbPress (r4724)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/vbulletin
16
  */
17
  class vBulletin extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forum',
39
  'from_fieldname' => 'forumid',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0. Stored in postmeta)
46
  'from_tablename' => 'forum',
47
  'from_fieldname' => 'parentid',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
124
  'callback_method' => 'callback_forum_type'
125
  );
126
 
127
+ // Forum status (Set a default value 'open', Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => '_bbp_status',
131
+ 'default' => 'open'
132
+ );
133
+
134
  // Forum dates.
135
  $this->field_map[] = array(
136
  'to_type' => 'forum',
153
  'default' => date( 'Y-m-d H:i:s' )
154
  );
155
 
156
+ /** Forum Subscriptions Section ***************************************/
157
+
158
+ // Subscribed forum ID (Stored in usermeta)
159
+ $this->field_map[] = array(
160
+ 'from_tablename' => 'subscribeforum',
161
+ 'from_fieldname' => 'forumid',
162
+ 'to_type' => 'forum_subscriptions',
163
+ 'to_fieldname' => '_bbp_forum_subscriptions'
164
+ );
165
+
166
+ // Subscribed user ID (Stored in usermeta)
167
+ $this->field_map[] = array(
168
+ 'from_tablename' => 'subscribeforum',
169
+ 'from_fieldname' => 'userid',
170
+ 'to_type' => 'forum_subscriptions',
171
+ 'to_fieldname' => 'user_id',
172
+ 'callback_method' => 'callback_userid'
173
+ );
174
+
175
  /** Topic Section *****************************************************/
176
 
177
+ // Old topic id (Stored in postmeta)
178
  $this->field_map[] = array(
179
  'from_tablename' => 'thread',
180
  'from_fieldname' => 'threadid',
181
  'to_type' => 'topic',
182
+ 'to_fieldname' => '_bbp_old_topic_id'
183
  );
184
 
185
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
218
  'callback_method' => 'callback_userid'
219
  );
220
 
221
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'thread',
224
+ 'from_fieldname' => 'postusername',
225
+ 'to_type' => 'topic',
226
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
227
+ );
228
+
229
+ // Is the topic anonymous (Stored in postmeta)
230
+ $this->field_map[] = array(
231
+ 'from_tablename' => 'thread',
232
+ 'from_fieldname' => 'postuserid',
233
+ 'to_type' => 'topic',
234
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
235
+ 'callback_method' => 'callback_check_anonymous'
236
+ );
237
+
238
  // Topic Author ip (Stored in postmeta)
239
  // Note: We join the 'post' table because 'thread' table does not include topic content.
240
  $this->field_map[] = array(
291
  'from_tablename' => 'thread',
292
  'from_fieldname' => 'open',
293
  'to_type' => 'topic',
294
+ 'to_fieldname' => '_bbp_old_closed_status_id',
295
  'callback_method' => 'callback_topic_status'
296
  );
297
 
298
+ // Sticky status (Stored in postmeta)
299
  $this->field_map[] = array(
300
  'from_tablename' => 'thread',
301
  'from_fieldname' => 'sticky',
302
  'to_type' => 'topic',
303
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
304
  'callback_method' => 'callback_sticky_status'
305
  );
306
 
383
  'callback_method' => 'callback_slug'
384
  );
385
 
386
+ /** Topic Subscriptions Section ***************************************/
387
+
388
+ // Subscribed topic ID (Stored in usermeta)
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'subscribethread',
391
+ 'from_fieldname' => 'threadid',
392
+ 'to_type' => 'topic_subscriptions',
393
+ 'to_fieldname' => '_bbp_subscriptions'
394
+ );
395
+
396
+ // Subscribed user ID (Stored in usermeta)
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'subscribethread',
399
+ 'from_fieldname' => 'userid',
400
+ 'to_type' => 'topic_subscriptions',
401
+ 'to_fieldname' => 'user_id',
402
+ 'callback_method' => 'callback_userid'
403
+ );
404
+
405
  /** Reply Section *****************************************************/
406
 
407
+ // Old reply id (Stored in postmeta)
408
  $this->field_map[] = array(
409
  'from_tablename' => 'post',
410
  'from_fieldname' => 'postid',
411
  'to_type' => 'reply',
412
+ 'to_fieldname' => '_bbp_old_reply_id'
413
  );
414
 
415
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
 
416
  $this->field_map[] = array(
417
+ 'from_tablename' => 'post',
418
+ 'from_fieldname' => 'threadid',
419
+ 'from_expression' => 'WHERE parentid != 0',
 
 
420
  'to_type' => 'reply',
421
  'to_fieldname' => '_bbp_forum_id',
422
  'callback_method' => 'callback_topicid_to_forumid'
448
  'callback_method' => 'callback_userid'
449
  );
450
 
451
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
 
452
  $this->field_map[] = array(
453
+ 'from_tablename' => 'post',
454
+ 'from_fieldname' => 'username',
 
 
 
455
  'to_type' => 'reply',
456
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
457
+ );
458
+
459
+ // Is the reply anonymous (Stored in postmeta)
460
+ $this->field_map[] = array(
461
+ 'from_tablename' => 'post',
462
+ 'from_fieldname' => 'userid',
463
+ 'to_type' => 'reply',
464
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
465
+ 'callback_method' => 'callback_check_anonymous'
466
+ );
 
 
 
 
 
467
 
468
  // Reply content.
469
  $this->field_map[] = array(
515
 
516
  /** User Section ******************************************************/
517
 
518
+ // Store old user id (Stored in usermeta)
519
  $this->field_map[] = array(
520
  'from_tablename' => 'user',
521
  'from_fieldname' => 'userid',
522
  'to_type' => 'user',
523
+ 'to_fieldname' => '_bbp_old_user_id'
524
  );
525
 
526
+ // Store old user password (Stored in usermeta serialized with salt)
527
  $this->field_map[] = array(
528
  'from_tablename' => 'user',
529
  'from_fieldname' => 'password',
532
  'callback_method' => 'callback_savepass'
533
  );
534
 
535
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
536
  $this->field_map[] = array(
537
  'from_tablename' => 'user',
538
  'from_fieldname' => 'salt',
585
  'from_tablename' => 'user',
586
  'from_fieldname' => 'aim',
587
  'to_type' => 'user',
588
+ 'to_fieldname' => '_bbp_vbulletin_user_aim'
589
  );
590
 
591
  // User Yahoo (Stored in usermeta)
593
  'from_tablename' => 'user',
594
  'from_fieldname' => 'yahoo',
595
  'to_type' => 'user',
596
+ 'to_fieldname' => '_bbp_vbulletin_user_yim'
597
  );
598
 
599
  // User ICQ (Stored in usermeta)
700
  return $count;
701
  }
702
 
 
 
 
 
 
 
 
 
 
 
 
703
  /**
704
  * Translate the post status from vBulletin numeric's to WordPress's strings.
705
  *
732
  // Replace '[QUOTE]' with '<blockquote>'
733
  $vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup );
734
  // Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>"
735
+ $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/', '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
736
  // Replace '[/QUOTE]' with '</blockquote>'
737
  $vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup );
738
  // Replace '[MENTION=###($1)]User Name($2)[/MENTION]' with '@$2"
740
 
741
  // Replace '[video=youtube;$1]$2[/video]' with '$2"
742
  $vbulletin_markup = preg_replace( '/\[video\=youtube;(.*?)\](.*?)\[\/video\]/', '$2', $vbulletin_markup );
743
+ // Replace '[video=youtube_share;$1]$2[/video]' with '$2"
744
+ $vbulletin_markup = preg_replace( '/\[video\=youtube_share;(.*?)\](.*?)\[\/video\]/', '$2', $vbulletin_markup );
745
 
746
  // Now that vBulletin custom HTML has been stripped put the cleaned HTML back in $field
747
  $field = $vbulletin_markup;
includes/admin/converters/vBulletin3.php CHANGED
@@ -1,10 +1,18 @@
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
 
@@ -25,12 +33,12 @@ class vBulletin3 extends BBP_Converter_Base {
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)
@@ -38,7 +46,7 @@ class vBulletin3 extends BBP_Converter_Base {
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)
@@ -116,6 +124,13 @@ class vBulletin3 extends BBP_Converter_Base {
116
  'callback_method' => 'callback_forum_type'
117
  );
118
 
 
 
 
 
 
 
 
119
  // Forum dates.
120
  $this->field_map[] = array(
121
  'to_type' => 'forum',
@@ -138,14 +153,33 @@ class vBulletin3 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(
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)
@@ -184,6 +218,23 @@ class vBulletin3 extends BBP_Converter_Base {
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(
@@ -240,16 +291,16 @@ class vBulletin3 extends BBP_Converter_Base {
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
 
@@ -332,24 +383,40 @@ class vBulletin3 extends BBP_Converter_Base {
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'
@@ -381,30 +448,21 @@ class vBulletin3 extends BBP_Converter_Base {
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.
@@ -457,15 +515,15 @@ class vBulletin3 extends BBP_Converter_Base {
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',
@@ -474,7 +532,7 @@ class vBulletin3 extends BBP_Converter_Base {
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',
@@ -527,7 +585,7 @@ class vBulletin3 extends BBP_Converter_Base {
527
  'from_tablename' => 'user',
528
  'from_fieldname' => 'aim',
529
  'to_type' => 'user',
530
- 'to_fieldname' => 'aim'
531
  );
532
 
533
  // User Yahoo (Stored in usermeta)
@@ -535,7 +593,7 @@ class vBulletin3 extends BBP_Converter_Base {
535
  'from_tablename' => 'user',
536
  'from_fieldname' => 'yahoo',
537
  'to_type' => 'user',
538
- 'to_fieldname' => 'yim'
539
  );
540
 
541
  // User ICQ (Stored in usermeta)
@@ -588,8 +646,8 @@ class vBulletin3 extends BBP_Converter_Base {
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 );
@@ -642,17 +700,6 @@ class vBulletin3 extends BBP_Converter_Base {
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
  *
1
  <?php
2
 
3
+ /**
4
+ * bbPress vBulletin 3.x Converter
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Converters
8
+ */
9
+
10
  /**
11
  * Implementation of vBulletin v3.x Converter.
12
  *
13
+ * @since 2.5.0 bbPress (r5151)
14
+ *
15
+ * @link Codex Docs https://codex.bbpress.org/import-forums/vbulletin
16
  */
17
  class vBulletin3 extends BBP_Converter_Base {
18
 
33
 
34
  /** Forum Section *****************************************************/
35
 
36
+ // Old forum id (Stored in postmeta)
37
  $this->field_map[] = array(
38
  'from_tablename' => 'forum',
39
  'from_fieldname' => 'forumid',
40
  'to_type' => 'forum',
41
+ 'to_fieldname' => '_bbp_old_forum_id'
42
  );
43
 
44
  // Forum parent id (If no parent, then 0. Stored in postmeta)
46
  'from_tablename' => 'forum',
47
  'from_fieldname' => 'parentid',
48
  'to_type' => 'forum',
49
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
50
  );
51
 
52
  // Forum topic count (Stored in postmeta)
124
  'callback_method' => 'callback_forum_type'
125
  );
126
 
127
+ // Forum status (Set a default value 'open', Stored in postmeta)
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => '_bbp_status',
131
+ 'default' => 'open'
132
+ );
133
+
134
  // Forum dates.
135
  $this->field_map[] = array(
136
  'to_type' => 'forum',
153
  'default' => date( 'Y-m-d H:i:s' )
154
  );
155
 
156
+ /** Forum Subscriptions Section ***************************************/
157
+
158
+ // Subscribed forum ID (Stored in usermeta)
159
+ $this->field_map[] = array(
160
+ 'from_tablename' => 'subscribeforum',
161
+ 'from_fieldname' => 'forumid',
162
+ 'to_type' => 'forum_subscriptions',
163
+ 'to_fieldname' => '_bbp_forum_subscriptions'
164
+ );
165
+
166
+ // Subscribed user ID (Stored in usermeta)
167
+ $this->field_map[] = array(
168
+ 'from_tablename' => 'subscribeforum',
169
+ 'from_fieldname' => 'userid',
170
+ 'to_type' => 'forum_subscriptions',
171
+ 'to_fieldname' => 'user_id',
172
+ 'callback_method' => 'callback_userid'
173
+ );
174
+
175
  /** Topic Section *****************************************************/
176
 
177
+ // Old topic id (Stored in postmeta)
178
  $this->field_map[] = array(
179
  'from_tablename' => 'thread',
180
  'from_fieldname' => 'threadid',
181
  'to_type' => 'topic',
182
+ 'to_fieldname' => '_bbp_old_topic_id'
183
  );
184
 
185
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
218
  'callback_method' => 'callback_userid'
219
  );
220
 
221
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'thread',
224
+ 'from_fieldname' => 'postusername',
225
+ 'to_type' => 'topic',
226
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
227
+ );
228
+
229
+ // Is the topic anonymous (Stored in postmeta)
230
+ $this->field_map[] = array(
231
+ 'from_tablename' => 'thread',
232
+ 'from_fieldname' => 'postuserid',
233
+ 'to_type' => 'topic',
234
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
235
+ 'callback_method' => 'callback_check_anonymous'
236
+ );
237
+
238
  // Topic Author ip (Stored in postmeta)
239
  // Note: We join the 'post' table because 'thread' table does not include topic content.
240
  $this->field_map[] = array(
291
  'from_tablename' => 'thread',
292
  'from_fieldname' => 'open',
293
  'to_type' => 'topic',
294
+ 'to_fieldname' => '_bbp_old_closed_status_id',
295
  'callback_method' => 'callback_topic_status'
296
  );
297
 
298
+ // Sticky status (Stored in postmeta)
299
  $this->field_map[] = array(
300
  'from_tablename' => 'thread',
301
  'from_fieldname' => 'sticky',
302
  'to_type' => 'topic',
303
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
304
  'callback_method' => 'callback_sticky_status'
305
  );
306
 
383
  'callback_method' => 'callback_slug'
384
  );
385
 
386
+ /** Topic Subscriptions Section ***************************************/
387
+
388
+ // Subscribed topic ID (Stored in usermeta)
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'subscribethread',
391
+ 'from_fieldname' => 'threadid',
392
+ 'to_type' => 'topic_subscriptions',
393
+ 'to_fieldname' => '_bbp_subscriptions'
394
+ );
395
+
396
+ // Subscribed user ID (Stored in usermeta)
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'subscribethread',
399
+ 'from_fieldname' => 'userid',
400
+ 'to_type' => 'topic_subscriptions',
401
+ 'to_fieldname' => 'user_id',
402
+ 'callback_method' => 'callback_userid'
403
+ );
404
+
405
  /** Reply Section *****************************************************/
406
 
407
+ // Old reply id (Stored in postmeta)
408
  $this->field_map[] = array(
409
  'from_tablename' => 'post',
410
  'from_fieldname' => 'postid',
411
  'to_type' => 'reply',
412
+ 'to_fieldname' => '_bbp_old_reply_id'
413
  );
414
 
415
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
 
416
  $this->field_map[] = array(
417
+ 'from_tablename' => 'post',
418
+ 'from_fieldname' => 'threadid',
419
+ 'from_expression' => 'WHERE parentid != 0',
 
 
420
  'to_type' => 'reply',
421
  'to_fieldname' => '_bbp_forum_id',
422
  'callback_method' => 'callback_topicid_to_forumid'
448
  'callback_method' => 'callback_userid'
449
  );
450
 
451
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
 
452
  $this->field_map[] = array(
453
+ 'from_tablename' => 'post',
454
+ 'from_fieldname' => 'username',
 
 
 
455
  'to_type' => 'reply',
456
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
 
457
  );
458
 
459
+ // Is the reply anonymous (Stored in postmeta)
460
+ $this->field_map[] = array(
461
+ 'from_tablename' => 'post',
462
+ 'from_fieldname' => 'userid',
 
 
 
 
463
  'to_type' => 'reply',
464
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
465
+ 'callback_method' => 'callback_check_anonymous'
466
  );
467
 
468
  // Reply content.
515
 
516
  /** User Section ******************************************************/
517
 
518
+ // Store old user id (Stored in usermeta)
519
  $this->field_map[] = array(
520
  'from_tablename' => 'user',
521
  'from_fieldname' => 'userid',
522
  'to_type' => 'user',
523
+ 'to_fieldname' => '_bbp_old_user_id'
524
  );
525
 
526
+ // Store old user password (Stored in usermeta serialized with salt)
527
  $this->field_map[] = array(
528
  'from_tablename' => 'user',
529
  'from_fieldname' => 'password',
532
  'callback_method' => 'callback_savepass'
533
  );
534
 
535
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
536
  $this->field_map[] = array(
537
  'from_tablename' => 'user',
538
  'from_fieldname' => 'salt',
585
  'from_tablename' => 'user',
586
  'from_fieldname' => 'aim',
587
  'to_type' => 'user',
588
+ 'to_fieldname' => '_bbp_vbulletin3_user_aim'
589
  );
590
 
591
  // User Yahoo (Stored in usermeta)
593
  'from_tablename' => 'user',
594
  'from_fieldname' => 'yahoo',
595
  'to_type' => 'user',
596
+ 'to_fieldname' => '_bbp_vbulletin3_user_yim'
597
  );
598
 
599
  // User ICQ (Stored in usermeta)
646
  *
647
  * vBulletin passwords do not work. Maybe use the below plugin's approach?
648
  *
649
+ * @link https://wordpress.org/extend/plugins/vb-user-copy/
650
+ * @link https://plugins.trac.wordpress.org/browser/vb-user-copy/trunk/vb_user_copy.php
651
  */
652
  public function authenticate_pass( $password, $serialized_pass ) {
653
  $pass_array = unserialize( $serialized_pass );
700
  return $count;
701
  }
702
 
 
 
 
 
 
 
 
 
 
 
 
703
  /**
704
  * Translate the post status from vBulletin v3.x numeric's to WordPress's strings.
705
  *
includes/admin/css/admin-rtl.css ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Kludge for too-wide forums dropdown */
3
+ #poststuff #bbp_forum_attributes select#parent_id,
4
+ #poststuff #bbp_topic_attributes select#parent_id,
5
+ #poststuff #bbp_reply_attributes select#bbp_forum_id,
6
+ #poststuff #bbp_reply_attributes select#bbp_reply_to {
7
+ max-width: 170px;
8
+ }
9
+
10
+ /* Version Badge */
11
+
12
+ .bbp-badge {
13
+ font: 400 150px/1 dashicons !important;
14
+ color: #000;
15
+ display: inline-block;
16
+ }
17
+
18
+ .bbp-badge:before {
19
+ content: "\f451";
20
+ }
21
+
22
+ .about-wrap .bbp-badge {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ }
27
+
28
+ body.rtl .about-wrap .bbp-badge {
29
+ left: auto;
30
+ right: 0;
31
+ }
32
+
33
+ /* Dashicons */
34
+
35
+ th .bbp_forums_column:before,
36
+ #dashboard_right_now a.bbp-glance-forums:before,
37
+ #adminmenu #menu-posts-forum .wp-menu-image:before {
38
+ content: "\f449";
39
+ }
40
+
41
+ th .bbp_topics_column:before,
42
+ #dashboard_right_now a.bbp-glance-topics:before,
43
+ #adminmenu #menu-posts-topic .wp-menu-image:before {
44
+ content: "\f450";
45
+ }
46
+
47
+ th .bbp_replies_column:before,
48
+ #dashboard_right_now a.bbp-glance-replies:before,
49
+ #adminmenu #menu-posts-reply .wp-menu-image:before {
50
+ content: "\f451";
51
+ }
52
+
53
+ #dashboard_right_now a.bbp-glance-topic-tags:before {
54
+ content: "\f323";
55
+ }
56
+
57
+ th .bbp_forums_column,
58
+ th .bbp_topics_column,
59
+ th .bbp_replies_column {
60
+ height: 16px;
61
+ width: 16px;
62
+ }
63
+
64
+ th .bbp_forums_column:before,
65
+ th .bbp_topics_column:before,
66
+ th .bbp_replies_column:before {
67
+ font: 400 20px/0.5 dashicons;
68
+ speak: none;
69
+ display: inline-block;
70
+ padding: 0;
71
+ top: 4px;
72
+ right: -4px;
73
+ position: relative;
74
+ vertical-align: top;
75
+ -webkit-font-smoothing: antialiased;
76
+ -moz-osx-font-smoothing: grayscale;
77
+ text-decoration: none !important;
78
+ color: #444;
79
+ }
80
+
81
+ /* Deprecated Dashboard Metabox */
82
+
83
+ #bbp-dashboard-right-now p.sub,
84
+ #bbp-dashboard-right-now .table,
85
+ #bbp-dashboard-right-now .versions {
86
+ margin: -12px;
87
+ }
88
+
89
+ #bbp-dashboard-right-now .inside {
90
+ font-size: 12px;
91
+ padding-top: 20px;
92
+ margin-bottom: 0;
93
+ }
94
+
95
+ #bbp-dashboard-right-now p.sub {
96
+ padding: 5px 0 15px;
97
+ color: #8f8f8f;
98
+ font-size: 14px;
99
+ position: absolute;
100
+ top: -17px;
101
+ right: 15px;
102
+ }
103
+
104
+ body.rtl #bbp-dashboard-right-now p.sub {
105
+ left: 15px;
106
+ right: 0;
107
+ }
108
+
109
+ #bbp-dashboard-right-now .table {
110
+ margin: 0;
111
+ padding: 0;
112
+ position: relative;
113
+ }
114
+
115
+ #bbp-dashboard-right-now .table_content {
116
+ float: right;
117
+ border-top: #ececec 1px solid;
118
+ width: 45%;
119
+ }
120
+
121
+ body.rtl #bbp-dashboard-right-now .table_content {
122
+ float: left;
123
+ }
124
+
125
+ #bbp-dashboard-right-now .table_discussion {
126
+ float: left;
127
+ border-top: #ececec 1px solid;
128
+ width: 45%;
129
+ }
130
+
131
+ body.rtl #bbp-dashboard-right-now .table_discussion {
132
+ float: right;
133
+ }
134
+
135
+ #bbp-dashboard-right-now table td {
136
+ padding: 3px 0;
137
+ white-space: nowrap;
138
+ }
139
+
140
+ #bbp-dashboard-right-now table tr.first td {
141
+ border-top: none;
142
+ }
143
+
144
+ #bbp-dashboard-right-now td.b {
145
+ padding-left: 6px;
146
+ text-align: left;
147
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
148
+ font-size: 14px;
149
+ width: 1%;
150
+ }
151
+
152
+ body.rtl #bbp-dashboard-right-now td.b {
153
+ padding-right: 6px;
154
+ padding-left: 0;
155
+ }
156
+
157
+ #bbp-dashboard-right-now td.b a {
158
+ font-size: 18px;
159
+ }
160
+
161
+ #bbp-dashboard-right-now td.b a:hover {
162
+ color: #d54e21;
163
+ }
164
+
165
+ #bbp-dashboard-right-now .t {
166
+ font-size: 12px;
167
+ padding-left: 12px;
168
+ padding-top: 6px;
169
+ color: #777;
170
+ }
171
+
172
+ body.rtl #bbp-dashboard-right-now .t {
173
+ padding-right: 12px;
174
+ padding-left: 0;
175
+ }
176
+
177
+ #bbp-dashboard-right-now .t a {
178
+ white-space: nowrap;
179
+ }
180
+
181
+ #bbp-dashboard-right-now .spam {
182
+ color: #f00;
183
+ }
184
+
185
+ #bbp-dashboard-right-now .waiting {
186
+ color: #e66f00;
187
+ }
188
+
189
+ #bbp-dashboard-right-now .approved {
190
+ color: #0f0;
191
+ }
192
+
193
+ #bbp-dashboard-right-now .versions {
194
+ padding: 6px 10px 12px;
195
+ clear: both;
196
+ }
197
+
198
+ #bbp-dashboard-right-now .versions .b {
199
+ font-weight: 700;
200
+ }
201
+
202
+ #bbp-dashboard-right-now a.button {
203
+ float: left;
204
+ clear: left;
205
+ position: relative;
206
+ top: -5px;
207
+ }
208
+
209
+ body.rtl #bbp-dashboard-right-now a.button {
210
+ float: right;
211
+ clear: right;
212
+ }
includes/admin/css/admin-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #poststuff #bbp_forum_attributes select#parent_id,#poststuff #bbp_reply_attributes select#bbp_forum_id,#poststuff #bbp_reply_attributes select#bbp_reply_to,#poststuff #bbp_topic_attributes select#parent_id{max-width:170px}.bbp-badge{font:400 150px/1 dashicons!important;color:#000;display:inline-block}.bbp-badge:before{content:"\f451"}.about-wrap .bbp-badge{position:absolute;top:0;left:0}body.rtl .about-wrap .bbp-badge{left:auto;right:0}#adminmenu #menu-posts-forum .wp-menu-image:before,#dashboard_right_now a.bbp-glance-forums:before,th .bbp_forums_column:before{content:"\f449"}#adminmenu #menu-posts-topic .wp-menu-image:before,#dashboard_right_now a.bbp-glance-topics:before,th .bbp_topics_column:before{content:"\f450"}#adminmenu #menu-posts-reply .wp-menu-image:before,#dashboard_right_now a.bbp-glance-replies:before,th .bbp_replies_column:before{content:"\f451"}#dashboard_right_now a.bbp-glance-topic-tags:before{content:"\f323"}th .bbp_forums_column,th .bbp_replies_column,th .bbp_topics_column{height:16px;width:16px}th .bbp_forums_column:before,th .bbp_replies_column:before,th .bbp_topics_column:before{font:400 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;right:-4px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}#bbp-dashboard-right-now .table,#bbp-dashboard-right-now .versions,#bbp-dashboard-right-now p.sub{margin:-12px}#bbp-dashboard-right-now .inside{font-size:12px;padding-top:20px;margin-bottom:0}#bbp-dashboard-right-now p.sub{padding:5px 0 15px;color:#8f8f8f;font-size:14px;position:absolute;top:-17px;right:15px}body.rtl #bbp-dashboard-right-now p.sub{left:15px;right:0}#bbp-dashboard-right-now .table{margin:0;padding:0;position:relative}#bbp-dashboard-right-now .table_content{float:right;border-top:#ececec 1px solid;width:45%}body.rtl #bbp-dashboard-right-now .table_content{float:left}#bbp-dashboard-right-now .table_discussion{float:left;border-top:#ececec 1px solid;width:45%}body.rtl #bbp-dashboard-right-now .table_discussion{float:right}#bbp-dashboard-right-now table td{padding:3px 0;white-space:nowrap}#bbp-dashboard-right-now table tr.first td{border-top:none}#bbp-dashboard-right-now td.b{padding-left:6px;text-align:left;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;width:1%}body.rtl #bbp-dashboard-right-now td.b{padding-right:6px;padding-left:0}#bbp-dashboard-right-now td.b a{font-size:18px}#bbp-dashboard-right-now td.b a:hover{color:#d54e21}#bbp-dashboard-right-now .t{font-size:12px;padding-left:12px;padding-top:6px;color:#777}body.rtl #bbp-dashboard-right-now .t{padding-right:12px;padding-left:0}#bbp-dashboard-right-now .t a{white-space:nowrap}#bbp-dashboard-right-now .spam{color:red}#bbp-dashboard-right-now .waiting{color:#e66f00}#bbp-dashboard-right-now .approved{color:#0f0}#bbp-dashboard-right-now .versions{padding:6px 10px 12px;clear:both}#bbp-dashboard-right-now .versions .b{font-weight:700}#bbp-dashboard-right-now a.button{float:left;clear:left;position:relative;top:-5px}body.rtl #bbp-dashboard-right-now a.button{float:right;clear:right}
includes/admin/css/admin.css CHANGED
@@ -2,22 +2,21 @@
2
  /* Kludge for too-wide forums dropdown */
3
  #poststuff #bbp_forum_attributes select#parent_id,
4
  #poststuff #bbp_topic_attributes select#parent_id,
5
- #poststuff #bbp_reply_attributes select#bbp_forum_id {
 
6
  max-width: 170px;
7
  }
8
 
9
  /* Version Badge */
10
 
11
  .bbp-badge {
12
- padding-top: 142px;
13
- height: 50px;
14
- width: 173px;
15
- color: #fafafa;
16
- font-weight: bold;
17
- font-size: 14px;
18
- text-align: center;
19
- margin: 0 -5px;
20
- background: url('../images/badge.png') no-repeat;
21
  }
22
 
23
  .about-wrap .bbp-badge {
@@ -25,10 +24,61 @@
25
  top: 0;
26
  right: 0;
27
  }
28
- body.rtl .about-wrap .bbp-badge {
29
- right: auto;
30
- left: 0;
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  #bbp-dashboard-right-now p.sub,
34
  #bbp-dashboard-right-now .table,
@@ -50,10 +100,11 @@
50
  top: -17px;
51
  left: 15px;
52
  }
53
- body.rtl #bbp-dashboard-right-now p.sub {
54
- right: 15px;
55
- left: 0;
56
- }
 
57
 
58
  #bbp-dashboard-right-now .table {
59
  margin: 0;
@@ -66,18 +117,20 @@
66
  border-top: #ececec 1px solid;
67
  width: 45%;
68
  }
69
- body.rtl #bbp-dashboard-right-now .table_content {
70
- float: right;
71
- }
 
72
 
73
  #bbp-dashboard-right-now .table_discussion {
74
  float: right;
75
  border-top: #ececec 1px solid;
76
  width: 45%;
77
  }
78
- body.rtl #bbp-dashboard-right-now .table_discussion {
79
- float: left;
80
- }
 
81
 
82
  #bbp-dashboard-right-now table td {
83
  padding: 3px 0;
@@ -95,10 +148,11 @@
95
  font-size: 14px;
96
  width: 1%;
97
  }
98
- body.rtl #bbp-dashboard-right-now td.b {
99
- padding-left: 6px;
100
- padding-right: 0;
101
- }
 
102
 
103
  #bbp-dashboard-right-now td.b a {
104
  font-size: 18px;
@@ -114,17 +168,18 @@
114
  padding-top: 6px;
115
  color: #777;
116
  }
117
- body.rtl #bbp-dashboard-right-now .t {
118
- padding-left: 12px;
119
- padding-right: 0;
120
- }
 
121
 
122
  #bbp-dashboard-right-now .t a {
123
  white-space: nowrap;
124
  }
125
 
126
  #bbp-dashboard-right-now .spam {
127
- color: red;
128
  }
129
 
130
  #bbp-dashboard-right-now .waiting {
@@ -132,7 +187,7 @@
132
  }
133
 
134
  #bbp-dashboard-right-now .approved {
135
- color: green;
136
  }
137
 
138
  #bbp-dashboard-right-now .versions {
@@ -141,7 +196,7 @@
141
  }
142
 
143
  #bbp-dashboard-right-now .versions .b {
144
- font-weight: bold;
145
  }
146
 
147
  #bbp-dashboard-right-now a.button {
@@ -150,28 +205,8 @@
150
  position: relative;
151
  top: -5px;
152
  }
153
- body.rtl #bbp-dashboard-right-now a.button {
154
- float: left;
155
- clear: left;
156
- }
157
 
158
- /* Dashicons */
159
- #adminmenu #menu-posts-forum .wp-menu-image:before {
160
- content: "\f449";
161
- }
162
-
163
- #adminmenu #menu-posts-topic .wp-menu-image:before {
164
- content: "\f450";
165
- }
166
-
167
- #adminmenu #menu-posts-reply .wp-menu-image:before {
168
- content: "\f451";
169
- }
170
-
171
- /* Ratio 2x */
172
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
173
- .bbp-badge {
174
- background-image: url('../images/badge-2x.png');
175
- background-size: 173px 194px;
176
- }
177
  }
2
  /* Kludge for too-wide forums dropdown */
3
  #poststuff #bbp_forum_attributes select#parent_id,
4
  #poststuff #bbp_topic_attributes select#parent_id,
5
+ #poststuff #bbp_reply_attributes select#bbp_forum_id,
6
+ #poststuff #bbp_reply_attributes select#bbp_reply_to {
7
  max-width: 170px;
8
  }
9
 
10
  /* Version Badge */
11
 
12
  .bbp-badge {
13
+ font: 400 150px/1 dashicons !important;
14
+ color: #000;
15
+ display: inline-block;
16
+ }
17
+
18
+ .bbp-badge:before {
19
+ content: "\f451";
 
 
20
  }
21
 
22
  .about-wrap .bbp-badge {
24
  top: 0;
25
  right: 0;
26
  }
27
+
28
+ body.rtl .about-wrap .bbp-badge {
29
+ right: auto;
30
+ left: 0;
31
+ }
32
+
33
+ /* Dashicons */
34
+
35
+ th .bbp_forums_column:before,
36
+ #dashboard_right_now a.bbp-glance-forums:before,
37
+ #adminmenu #menu-posts-forum .wp-menu-image:before {
38
+ content: "\f449";
39
+ }
40
+
41
+ th .bbp_topics_column:before,
42
+ #dashboard_right_now a.bbp-glance-topics:before,
43
+ #adminmenu #menu-posts-topic .wp-menu-image:before {
44
+ content: "\f450";
45
+ }
46
+
47
+ th .bbp_replies_column:before,
48
+ #dashboard_right_now a.bbp-glance-replies:before,
49
+ #adminmenu #menu-posts-reply .wp-menu-image:before {
50
+ content: "\f451";
51
+ }
52
+
53
+ #dashboard_right_now a.bbp-glance-topic-tags:before {
54
+ content: "\f323";
55
+ }
56
+
57
+ th .bbp_forums_column,
58
+ th .bbp_topics_column,
59
+ th .bbp_replies_column {
60
+ height: 16px;
61
+ width: 16px;
62
+ }
63
+
64
+ th .bbp_forums_column:before,
65
+ th .bbp_topics_column:before,
66
+ th .bbp_replies_column:before {
67
+ font: 400 20px/0.5 dashicons;
68
+ speak: none;
69
+ display: inline-block;
70
+ padding: 0;
71
+ top: 4px;
72
+ left: -4px;
73
+ position: relative;
74
+ vertical-align: top;
75
+ -webkit-font-smoothing: antialiased;
76
+ -moz-osx-font-smoothing: grayscale;
77
+ text-decoration: none !important;
78
+ color: #444;
79
+ }
80
+
81
+ /* Deprecated Dashboard Metabox */
82
 
83
  #bbp-dashboard-right-now p.sub,
84
  #bbp-dashboard-right-now .table,
100
  top: -17px;
101
  left: 15px;
102
  }
103
+
104
+ body.rtl #bbp-dashboard-right-now p.sub {
105
+ right: 15px;
106
+ left: 0;
107
+ }
108
 
109
  #bbp-dashboard-right-now .table {
110
  margin: 0;
117
  border-top: #ececec 1px solid;
118
  width: 45%;
119
  }
120
+
121
+ body.rtl #bbp-dashboard-right-now .table_content {
122
+ float: right;
123
+ }
124
 
125
  #bbp-dashboard-right-now .table_discussion {
126
  float: right;
127
  border-top: #ececec 1px solid;
128
  width: 45%;
129
  }
130
+
131
+ body.rtl #bbp-dashboard-right-now .table_discussion {
132
+ float: left;
133
+ }
134
 
135
  #bbp-dashboard-right-now table td {
136
  padding: 3px 0;
148
  font-size: 14px;
149
  width: 1%;
150
  }
151
+
152
+ body.rtl #bbp-dashboard-right-now td.b {
153
+ padding-left: 6px;
154
+ padding-right: 0;
155
+ }
156
 
157
  #bbp-dashboard-right-now td.b a {
158
  font-size: 18px;
168
  padding-top: 6px;
169
  color: #777;
170
  }
171
+
172
+ body.rtl #bbp-dashboard-right-now .t {
173
+ padding-left: 12px;
174
+ padding-right: 0;
175
+ }
176
 
177
  #bbp-dashboard-right-now .t a {
178
  white-space: nowrap;
179
  }
180
 
181
  #bbp-dashboard-right-now .spam {
182
+ color: #f00;
183
  }
184
 
185
  #bbp-dashboard-right-now .waiting {
187
  }
188
 
189
  #bbp-dashboard-right-now .approved {
190
+ color: #0f0;
191
  }
192
 
193
  #bbp-dashboard-right-now .versions {
196
  }
197
 
198
  #bbp-dashboard-right-now .versions .b {
199
+ font-weight: 700;
200
  }
201
 
202
  #bbp-dashboard-right-now a.button {
205
  position: relative;
206
  top: -5px;
207
  }
 
 
 
 
208
 
209
+ body.rtl #bbp-dashboard-right-now a.button {
210
+ float: left;
211
+ clear: left;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  }
includes/admin/css/admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #poststuff #bbp_forum_attributes select#parent_id,#poststuff #bbp_reply_attributes select#bbp_forum_id,#poststuff #bbp_reply_attributes select#bbp_reply_to,#poststuff #bbp_topic_attributes select#parent_id{max-width:170px}.bbp-badge{font:400 150px/1 dashicons!important;color:#000;display:inline-block}.bbp-badge:before{content:"\f451"}.about-wrap .bbp-badge{position:absolute;top:0;right:0}body.rtl .about-wrap .bbp-badge{right:auto;left:0}#adminmenu #menu-posts-forum .wp-menu-image:before,#dashboard_right_now a.bbp-glance-forums:before,th .bbp_forums_column:before{content:"\f449"}#adminmenu #menu-posts-topic .wp-menu-image:before,#dashboard_right_now a.bbp-glance-topics:before,th .bbp_topics_column:before{content:"\f450"}#adminmenu #menu-posts-reply .wp-menu-image:before,#dashboard_right_now a.bbp-glance-replies:before,th .bbp_replies_column:before{content:"\f451"}#dashboard_right_now a.bbp-glance-topic-tags:before{content:"\f323"}th .bbp_forums_column,th .bbp_replies_column,th .bbp_topics_column{height:16px;width:16px}th .bbp_forums_column:before,th .bbp_replies_column:before,th .bbp_topics_column:before{font:400 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;left:-4px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}#bbp-dashboard-right-now .table,#bbp-dashboard-right-now .versions,#bbp-dashboard-right-now p.sub{margin:-12px}#bbp-dashboard-right-now .inside{font-size:12px;padding-top:20px;margin-bottom:0}#bbp-dashboard-right-now p.sub{padding:5px 0 15px;color:#8f8f8f;font-size:14px;position:absolute;top:-17px;left:15px}body.rtl #bbp-dashboard-right-now p.sub{right:15px;left:0}#bbp-dashboard-right-now .table{margin:0;padding:0;position:relative}#bbp-dashboard-right-now .table_content{float:left;border-top:#ececec 1px solid;width:45%}body.rtl #bbp-dashboard-right-now .table_content{float:right}#bbp-dashboard-right-now .table_discussion{float:right;border-top:#ececec 1px solid;width:45%}body.rtl #bbp-dashboard-right-now .table_discussion{float:left}#bbp-dashboard-right-now table td{padding:3px 0;white-space:nowrap}#bbp-dashboard-right-now table tr.first td{border-top:none}#bbp-dashboard-right-now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;width:1%}body.rtl #bbp-dashboard-right-now td.b{padding-left:6px;padding-right:0}#bbp-dashboard-right-now td.b a{font-size:18px}#bbp-dashboard-right-now td.b a:hover{color:#d54e21}#bbp-dashboard-right-now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777}body.rtl #bbp-dashboard-right-now .t{padding-left:12px;padding-right:0}#bbp-dashboard-right-now .t a{white-space:nowrap}#bbp-dashboard-right-now .spam{color:red}#bbp-dashboard-right-now .waiting{color:#e66f00}#bbp-dashboard-right-now .approved{color:#0f0}#bbp-dashboard-right-now .versions{padding:6px 10px 12px;clear:both}#bbp-dashboard-right-now .versions .b{font-weight:700}#bbp-dashboard-right-now a.button{float:right;clear:right;position:relative;top:-5px}body.rtl #bbp-dashboard-right-now a.button{float:left;clear:left}
includes/admin/forums.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Forums_Admin' ) ) :
14
  /**
@@ -16,14 +16,14 @@ if ( !class_exists( 'BBP_Forums_Admin' ) ) :
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
- * @since bbPress (r2464)
20
  */
21
  class BBP_Forums_Admin {
22
 
23
  /** Variables *************************************************************/
24
 
25
  /**
26
- * @var The post type of this admin component
27
  */
28
  private $post_type = '';
29
 
@@ -32,7 +32,7 @@ class BBP_Forums_Admin {
32
  /**
33
  * The main bbPress forums admin loader
34
  *
35
- * @since bbPress (r2515)
36
  *
37
  * @uses BBP_Forums_Admin::setup_globals() Setup the globals needed
38
  * @uses BBP_Forums_Admin::setup_actions() Setup the hooks and actions
@@ -46,7 +46,8 @@ class BBP_Forums_Admin {
46
  /**
47
  * Setup the admin hooks, actions and filters
48
  *
49
- * @since bbPress (r2646)
 
50
  * @access private
51
  *
52
  * @uses add_action() To add various actions
@@ -63,40 +64,35 @@ class BBP_Forums_Admin {
63
  // Messages
64
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
65
 
66
- // Metabox actions
67
- add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
68
- add_action( 'save_post', array( $this, 'attributes_metabox_save' ) );
69
-
70
- // Column headers.
71
  add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
72
 
73
- // Columns (in page row)
74
  add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
75
  add_filter( 'page_row_actions', array( $this, 'row_actions' ), 10, 2 );
76
 
 
 
 
 
 
 
 
 
 
 
 
77
  // Contextual Help
78
  add_action( 'load-edit.php', array( $this, 'edit_help' ) );
79
  add_action( 'load-post.php', array( $this, 'new_help' ) );
80
  add_action( 'load-post-new.php', array( $this, 'new_help' ) );
81
  }
82
 
83
- /**
84
- * Should we bail out of this method?
85
- *
86
- * @since bbPress (r4067)
87
- * @return boolean
88
- */
89
- private function bail() {
90
- if ( !isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) )
91
- return true;
92
-
93
- return false;
94
- }
95
-
96
  /**
97
  * Admin globals
98
  *
99
- * @since bbPress (r2646)
 
100
  * @access private
101
  */
102
  private function setup_globals() {
@@ -108,13 +104,12 @@ class BBP_Forums_Admin {
108
  /**
109
  * Contextual help for bbPress forum edit page
110
  *
111
- * @since bbPress (r3119)
 
112
  * @uses get_current_screen()
113
  */
114
  public function edit_help() {
115
 
116
- if ( $this->bail() ) return;
117
-
118
  // Overview
119
  get_current_screen()->add_help_tab( array(
120
  'id' => 'overview',
@@ -161,21 +156,20 @@ class BBP_Forums_Admin {
161
  // Help Sidebar
162
  get_current_screen()->set_help_sidebar(
163
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
164
- '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
165
- '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
166
  );
167
  }
168
 
169
  /**
170
  * Contextual help for bbPress forum edit page
171
  *
172
- * @since bbPress (r3119)
 
173
  * @uses get_current_screen()
174
  */
175
  public function new_help() {
176
 
177
- if ( $this->bail() ) return;
178
-
179
  $customize_display = '<p>' . __( 'The title field and the big forum editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
180
 
181
  get_current_screen()->add_help_tab( array(
@@ -207,7 +201,7 @@ class BBP_Forums_Admin {
207
  '<li>' . __( '<strong>Type</strong> indicates if the forum is a category or forum. Categories generally contain other forums.', 'bbpress' ) . '</li>' .
208
  '<li>' . __( '<strong>Status</strong> allows you to close a forum to new topics and forums.', 'bbpress' ) . '</li>' .
209
  '<li>' . __( '<strong>Visibility</strong> lets you pick the scope of each forum and what users are allowed to access it.', 'bbpress' ) . '</li>' .
210
- '<li>' . __( '<strong>Parent</strong> dropdown determines the parent forum. Select the forum or category from the dropdown, or leave the default (No Parent) to create the forum at the root of your forums.', 'bbpress' ) . '</li>' .
211
  '<li>' . __( '<strong>Order</strong> allows you to order your forums numerically.', 'bbpress' ) . '</li>' .
212
  '</ul>'
213
  ) );
@@ -220,25 +214,22 @@ class BBP_Forums_Admin {
220
 
221
  get_current_screen()->set_help_sidebar(
222
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
223
- '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
224
- '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
225
  );
226
  }
227
 
228
  /**
229
  * Add the forum attributes metabox
230
  *
231
- * @since bbPress (r2746)
232
  *
233
  * @uses bbp_get_forum_post_type() To get the forum post type
234
  * @uses add_meta_box() To add the metabox
235
  * @uses do_action() Calls 'bbp_forum_attributes_metabox'
236
  */
237
  public function attributes_metabox() {
238
-
239
- if ( $this->bail() ) return;
240
-
241
- add_meta_box (
242
  'bbp_forum_attributes',
243
  __( 'Forum Attributes', 'bbpress' ),
244
  'bbp_forum_metabox',
@@ -246,14 +237,83 @@ class BBP_Forums_Admin {
246
  'side',
247
  'high'
248
  );
 
 
 
 
 
 
 
 
 
 
 
 
249
 
250
- do_action( 'bbp_forum_attributes_metabox' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  }
252
 
253
  /**
254
  * Pass the forum attributes for processing
255
  *
256
- * @since bbPress (r2746)
257
  *
258
  * @param int $forum_id Forum id
259
  * @uses current_user_can() To check if the current user is capable of
@@ -272,37 +332,42 @@ class BBP_Forums_Admin {
272
  * forum id
273
  * @return int Forum id
274
  */
275
- public function attributes_metabox_save( $forum_id ) {
276
-
277
- if ( $this->bail() ) return $forum_id;
278
 
279
  // Bail if doing an autosave
280
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
281
  return $forum_id;
 
282
 
283
  // Bail if not a post request
284
- if ( ! bbp_is_post_request() )
285
  return $forum_id;
 
286
 
287
  // Nonce check
288
- if ( empty( $_POST['bbp_forum_metabox'] ) || !wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) )
289
  return $forum_id;
 
290
 
291
  // Only save for forum post-types
292
- if ( ! bbp_is_forum( $forum_id ) )
293
  return $forum_id;
 
294
 
295
  // Bail if current user cannot edit this forum
296
- if ( !current_user_can( 'edit_forum', $forum_id ) )
297
  return $forum_id;
 
298
 
299
  // Parent ID
300
- $parent_id = ( !empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0;
 
 
301
 
302
  // Update the forum meta bidness
303
  bbp_update_forum( array(
304
  'forum_id' => $forum_id,
305
- 'post_parent' => (int) $parent_id
306
  ) );
307
 
308
  do_action( 'bbp_forum_attributes_metabox_save', $forum_id );
@@ -313,7 +378,7 @@ class BBP_Forums_Admin {
313
  /**
314
  * Add some general styling to the admin area
315
  *
316
- * @since bbPress (r2464)
317
  *
318
  * @uses bbp_get_forum_post_type() To get the forum post type
319
  * @uses bbp_get_topic_post_type() To get the topic post type
@@ -322,15 +387,12 @@ class BBP_Forums_Admin {
322
  * @uses do_action() Calls 'bbp_admin_head'
323
  */
324
  public function admin_head() {
325
-
326
- if ( $this->bail() ) return;
327
-
328
  ?>
329
 
330
  <style type="text/css" media="screen">
331
  /*<![CDATA[*/
332
 
333
- #misc-publishing-actions,
334
  #save-post {
335
  display: none;
336
  }
@@ -340,6 +402,10 @@ class BBP_Forums_Admin {
340
  width: 60px;
341
  }
342
 
 
 
 
 
343
  #bbp_forum_attributes hr {
344
  border-style: solid;
345
  border-width: 1px;
@@ -354,6 +420,7 @@ class BBP_Forums_Admin {
354
  }
355
 
356
  .column-author,
 
357
  .column-bbp_reply_author,
358
  .column-bbp_topic_author {
359
  width: 10% !important;
@@ -390,10 +457,143 @@ class BBP_Forums_Admin {
390
  <?php
391
  }
392
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
  /**
394
  * Manage the column headers for the forums page
395
  *
396
- * @since bbPress (r2485)
397
  *
398
  * @param array $columns The columns
399
  * @uses apply_filters() Calls 'bbp_admin_forums_column_headers' with
@@ -402,25 +602,30 @@ class BBP_Forums_Admin {
402
  */
403
  public function column_headers( $columns ) {
404
 
405
- if ( $this->bail() ) return $columns;
406
-
407
- $columns = array (
408
  'cb' => '<input type="checkbox" />',
409
- 'title' => __( 'Forum', 'bbpress' ),
410
- 'bbp_forum_topic_count' => __( 'Topics', 'bbpress' ),
411
- 'bbp_forum_reply_count' => __( 'Replies', 'bbpress' ),
412
- 'author' => __( 'Creator', 'bbpress' ),
413
- 'bbp_forum_created' => __( 'Created' , 'bbpress' ),
414
- 'bbp_forum_freshness' => __( 'Freshness', 'bbpress' )
 
415
  );
416
 
 
 
 
 
 
417
  return apply_filters( 'bbp_admin_forums_column_headers', $columns );
418
  }
419
 
420
  /**
421
  * Print extra columns for the forums page
422
  *
423
- * @since bbPress (r2485)
424
  *
425
  * @param string $column Column
426
  * @param int $forum_id Forum id
@@ -436,8 +641,6 @@ class BBP_Forums_Admin {
436
  */
437
  public function column_data( $column, $forum_id ) {
438
 
439
- if ( $this->bail() ) return;
440
-
441
  switch ( $column ) {
442
  case 'bbp_forum_topic_count' :
443
  bbp_forum_topic_count( $forum_id );
@@ -447,6 +650,14 @@ class BBP_Forums_Admin {
447
  bbp_forum_reply_count( $forum_id );
448
  break;
449
 
 
 
 
 
 
 
 
 
450
  case 'bbp_forum_created':
451
  printf( '%1$s <br /> %2$s',
452
  get_the_date(),
@@ -457,10 +668,11 @@ class BBP_Forums_Admin {
457
 
458
  case 'bbp_forum_freshness' :
459
  $last_active = bbp_get_forum_last_active_time( $forum_id, false );
460
- if ( !empty( $last_active ) )
461
  echo esc_html( $last_active );
462
- else
463
  esc_html_e( 'No Topics', 'bbpress' );
 
464
 
465
  break;
466
 
@@ -474,21 +686,39 @@ class BBP_Forums_Admin {
474
  * Forum Row actions
475
  *
476
  * Remove the quick-edit action link and display the description under
477
- * the forum title
478
  *
479
- * @since bbPress (r2577)
480
  *
481
  * @param array $actions Actions
482
  * @param array $forum Forum object
 
 
 
 
 
 
483
  * @uses bbp_forum_content() To output forum description
484
  * @return array $actions Actions
485
  */
486
  public function row_actions( $actions, $forum ) {
487
 
488
- if ( $this->bail() ) return $actions;
489
-
490
  unset( $actions['inline hide-if-no-js'] );
491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  // simple hack to show the forum description under the title
493
  bbp_forum_content( $forum->ID );
494
 
@@ -498,7 +728,7 @@ class BBP_Forums_Admin {
498
  /**
499
  * Custom user feedback messages for forum post type
500
  *
501
- * @since bbPress (r3080)
502
  *
503
  * @global int $post_ID
504
  * @uses bbp_get_forum_permalink()
@@ -513,8 +743,6 @@ class BBP_Forums_Admin {
513
  public function updated_messages( $messages ) {
514
  global $post_ID;
515
 
516
- if ( $this->bail() ) return $messages;
517
-
518
  // URL for the current forum
519
  $forum_url = bbp_get_forum_permalink( $post_ID );
520
 
@@ -522,11 +750,16 @@ class BBP_Forums_Admin {
522
  $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
523
 
524
  // Messages array
525
- $messages[$this->post_type] = array(
526
  0 => '', // Left empty on purpose
527
 
528
  // Updated
529
- 1 => sprintf( __( 'Forum updated. <a href="%s">View forum</a>', 'bbpress' ), $forum_url ),
 
 
 
 
 
530
 
531
  // Custom field updated
532
  2 => __( 'Custom field updated.', 'bbpress' ),
@@ -544,23 +777,43 @@ class BBP_Forums_Admin {
544
  : false,
545
 
546
  // Forum created
547
- 6 => sprintf( __( 'Forum created. <a href="%s">View forum</a>', 'bbpress' ), $forum_url ),
 
 
 
 
 
548
 
549
  // Forum saved
550
  7 => __( 'Forum saved.', 'bbpress' ),
551
 
552
  // Forum submitted
553
- 8 => sprintf( __( 'Forum submitted. <a target="_blank" href="%s">Preview forum</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
 
 
 
 
 
554
 
555
  // Forum scheduled
556
- 9 => sprintf( __( 'Forum scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview forum</a>', 'bbpress' ),
 
 
 
557
  // translators: Publish box date format, see http://php.net/date
558
- date_i18n( __( 'M j, Y @ G:i', 'bbpress' ),
559
- strtotime( $post_date ) ),
560
- $forum_url ),
 
 
561
 
562
  // Forum draft updated
563
- 10 => sprintf( __( 'Forum draft updated. <a target="_blank" href="%s">Preview forum</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
 
 
 
 
 
564
  );
565
 
566
  return $messages;
@@ -574,10 +827,18 @@ endif; // class_exists check
574
  * This is currently here to make hooking and unhooking of the admin UI easy.
575
  * It could use dependency injection in the future, but for now this is easier.
576
  *
577
- * @since bbPress (r2596)
578
  *
 
579
  * @uses BBP_Forums_Admin
580
  */
581
- function bbp_admin_forums() {
 
 
 
 
 
 
 
582
  bbpress()->admin->forums = new BBP_Forums_Admin();
583
  }
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
  if ( !class_exists( 'BBP_Forums_Admin' ) ) :
14
  /**
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
+ * @since 2.0.0 bbPress (r2464)
20
  */
21
  class BBP_Forums_Admin {
22
 
23
  /** Variables *************************************************************/
24
 
25
  /**
26
+ * @var string The post type of this admin component
27
  */
28
  private $post_type = '';
29
 
32
  /**
33
  * The main bbPress forums admin loader
34
  *
35
+ * @since 2.0.0 bbPress (r2515)
36
  *
37
  * @uses BBP_Forums_Admin::setup_globals() Setup the globals needed
38
  * @uses BBP_Forums_Admin::setup_actions() Setup the hooks and actions
46
  /**
47
  * Setup the admin hooks, actions and filters
48
  *
49
+ * @since 2.0.0 bbPress (r2646)
50
+ *
51
  * @access private
52
  *
53
  * @uses add_action() To add various actions
64
  // Messages
65
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
66
 
67
+ // Forum Column headers.
 
 
 
 
68
  add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
69
 
70
+ // Forum Columns (in page row)
71
  add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
72
  add_filter( 'page_row_actions', array( $this, 'row_actions' ), 10, 2 );
73
 
74
+ // Metabox actions
75
+ add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
76
+ add_action( 'add_meta_boxes', array( $this, 'moderators_metabox' ) );
77
+ add_action( 'add_meta_boxes', array( $this, 'subscriptions_metabox' ) );
78
+ add_action( 'add_meta_boxes', array( $this, 'comments_metabox' ) );
79
+ add_action( 'save_post', array( $this, 'save_meta_boxes' ) );
80
+
81
+ // Check if there are any bbp_toggle_forum_* requests on admin_init, also have a message displayed
82
+ add_action( 'load-edit.php', array( $this, 'toggle_forum' ) );
83
+ add_action( 'admin_notices', array( $this, 'toggle_forum_notice' ) );
84
+
85
  // Contextual Help
86
  add_action( 'load-edit.php', array( $this, 'edit_help' ) );
87
  add_action( 'load-post.php', array( $this, 'new_help' ) );
88
  add_action( 'load-post-new.php', array( $this, 'new_help' ) );
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Admin globals
93
  *
94
+ * @since 2.0.0 bbPress (r2646)
95
+ *
96
  * @access private
97
  */
98
  private function setup_globals() {
104
  /**
105
  * Contextual help for bbPress forum edit page
106
  *
107
+ * @since 2.0.0 bbPress (r3119)
108
+ *
109
  * @uses get_current_screen()
110
  */
111
  public function edit_help() {
112
 
 
 
113
  // Overview
114
  get_current_screen()->add_help_tab( array(
115
  'id' => 'overview',
156
  // Help Sidebar
157
  get_current_screen()->set_help_sidebar(
158
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
159
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
160
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
161
  );
162
  }
163
 
164
  /**
165
  * Contextual help for bbPress forum edit page
166
  *
167
+ * @since 2.0.0 bbPress (r3119)
168
+ *
169
  * @uses get_current_screen()
170
  */
171
  public function new_help() {
172
 
 
 
173
  $customize_display = '<p>' . __( 'The title field and the big forum editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
174
 
175
  get_current_screen()->add_help_tab( array(
201
  '<li>' . __( '<strong>Type</strong> indicates if the forum is a category or forum. Categories generally contain other forums.', 'bbpress' ) . '</li>' .
202
  '<li>' . __( '<strong>Status</strong> allows you to close a forum to new topics and forums.', 'bbpress' ) . '</li>' .
203
  '<li>' . __( '<strong>Visibility</strong> lets you pick the scope of each forum and what users are allowed to access it.', 'bbpress' ) . '</li>' .
204
+ '<li>' . __( '<strong>Parent</strong> dropdown determines the parent forum. Select the forum or category from the dropdown, or leave the default "No parent" to create the forum at the root of your forums.', 'bbpress' ) . '</li>' .
205
  '<li>' . __( '<strong>Order</strong> allows you to order your forums numerically.', 'bbpress' ) . '</li>' .
206
  '</ul>'
207
  ) );
214
 
215
  get_current_screen()->set_help_sidebar(
216
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
217
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
218
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
219
  );
220
  }
221
 
222
  /**
223
  * Add the forum attributes metabox
224
  *
225
+ * @since 2.0.0 bbPress (r2746)
226
  *
227
  * @uses bbp_get_forum_post_type() To get the forum post type
228
  * @uses add_meta_box() To add the metabox
229
  * @uses do_action() Calls 'bbp_forum_attributes_metabox'
230
  */
231
  public function attributes_metabox() {
232
+ add_meta_box(
 
 
 
233
  'bbp_forum_attributes',
234
  __( 'Forum Attributes', 'bbpress' ),
235
  'bbp_forum_metabox',
237
  'side',
238
  'high'
239
  );
240
+ }
241
+
242
+ /**
243
+ * Add the forum moderators metabox
244
+ *
245
+ * @since 2.6.0 bbPress
246
+ *
247
+ * @uses bbp_get_forum_post_type() To get the forum post type
248
+ * @uses add_meta_box() To add the metabox
249
+ * @uses do_action() Calls 'bbp_forum_attributes_metabox'
250
+ */
251
+ public function moderators_metabox() {
252
 
253
+ // Bail if feature not active or user cannot assign moderators
254
+ if ( ! bbp_allow_forum_mods() || ! current_user_can( 'assign_moderators' ) ) {
255
+ return;
256
+ }
257
+
258
+ // Moderators
259
+ add_meta_box(
260
+ 'bbp_moderator_assignment_metabox',
261
+ __( 'Forum Moderators', 'bbpress' ),
262
+ 'bbp_moderator_assignment_metabox',
263
+ $this->post_type,
264
+ 'side',
265
+ 'high'
266
+ );
267
+ }
268
+
269
+ /**
270
+ * Add the subscriptions metabox
271
+ *
272
+ * Allows viewing of users who have subscribed to a forum.
273
+ *
274
+ * @since 2.6.0 bbPress (r6197)
275
+ *
276
+ * @uses add_meta_box() To add the metabox
277
+ */
278
+ public function subscriptions_metabox() {
279
+
280
+ // Bail if post_type is not a reply
281
+ if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) ) {
282
+ return;
283
+ }
284
+
285
+ // Bail if no subscriptions
286
+ if ( ! bbp_is_subscriptions_active() ) {
287
+ return;
288
+ }
289
+
290
+ // Add the metabox
291
+ add_meta_box(
292
+ 'bbp_forum_subscriptions_metabox',
293
+ __( 'Subscriptions', 'bbpress' ),
294
+ 'bbp_forum_subscriptions_metabox',
295
+ $this->post_type,
296
+ 'normal',
297
+ 'high'
298
+ );
299
+ }
300
+
301
+ /**
302
+ * Remove comments & discussion metaboxes if comments are not supported
303
+ *
304
+ * @since 2.6.0 bbPress (r6186)
305
+ */
306
+ public function comments_metabox() {
307
+ if ( ! post_type_supports( $this->post_type, 'comments' ) ) {
308
+ remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
309
+ remove_meta_box( 'commentsdiv', $this->post_type, 'normal' );
310
+ }
311
  }
312
 
313
  /**
314
  * Pass the forum attributes for processing
315
  *
316
+ * @since 2.0.0 bbPress (r2746)
317
  *
318
  * @param int $forum_id Forum id
319
  * @uses current_user_can() To check if the current user is capable of
332
  * forum id
333
  * @return int Forum id
334
  */
335
+ public function save_meta_boxes( $forum_id ) {
 
 
336
 
337
  // Bail if doing an autosave
338
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
339
  return $forum_id;
340
+ }
341
 
342
  // Bail if not a post request
343
+ if ( ! bbp_is_post_request() ) {
344
  return $forum_id;
345
+ }
346
 
347
  // Nonce check
348
+ if ( empty( $_POST['bbp_forum_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) ) {
349
  return $forum_id;
350
+ }
351
 
352
  // Only save for forum post-types
353
+ if ( ! bbp_is_forum( $forum_id ) ) {
354
  return $forum_id;
355
+ }
356
 
357
  // Bail if current user cannot edit this forum
358
+ if ( ! current_user_can( 'edit_forum', $forum_id ) ) {
359
  return $forum_id;
360
+ }
361
 
362
  // Parent ID
363
+ $parent_id = ( ! empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) )
364
+ ? (int) $_POST['parent_id']
365
+ : 0;
366
 
367
  // Update the forum meta bidness
368
  bbp_update_forum( array(
369
  'forum_id' => $forum_id,
370
+ 'post_parent' => $parent_id
371
  ) );
372
 
373
  do_action( 'bbp_forum_attributes_metabox_save', $forum_id );
378
  /**
379
  * Add some general styling to the admin area
380
  *
381
+ * @since 2.0.0 bbPress (r2464)
382
  *
383
  * @uses bbp_get_forum_post_type() To get the forum post type
384
  * @uses bbp_get_topic_post_type() To get the topic post type
387
  * @uses do_action() Calls 'bbp_admin_head'
388
  */
389
  public function admin_head() {
 
 
 
390
  ?>
391
 
392
  <style type="text/css" media="screen">
393
  /*<![CDATA[*/
394
 
395
+ #minor-publishing,
396
  #save-post {
397
  display: none;
398
  }
402
  width: 60px;
403
  }
404
 
405
+ #bbp_moderators {
406
+ width: 100%;
407
+ }
408
+
409
  #bbp_forum_attributes hr {
410
  border-style: solid;
411
  border-width: 1px;
420
  }
421
 
422
  .column-author,
423
+ .column-bbp_forum_mods,
424
  .column-bbp_reply_author,
425
  .column-bbp_topic_author {
426
  width: 10% !important;
457
  <?php
458
  }
459
 
460
+ /**
461
+ * Toggle forum
462
+ *
463
+ * Handles the admin-side opening/closing of forums
464
+ *
465
+ * @since 2.6.0 bbPress (r5254)
466
+ *
467
+ * @uses bbp_get_forum() To get the forum
468
+ * @uses current_user_can() To check if the user is capable of editing
469
+ * the forum
470
+ * @uses wp_die() To die if the user isn't capable or the post wasn't
471
+ * found
472
+ * @uses check_admin_referer() To verify the nonce and check referer
473
+ * @uses bbp_is_forum_open() To check if the forum is open
474
+ * @uses bbp_close_forum() To close the forum
475
+ * @uses bbp_open_forum() To open the forum
476
+ * @uses do_action() Calls 'bbp_toggle_forum_admin' with success, post
477
+ * data, action and message
478
+ * @uses add_query_arg() To add custom args to the url
479
+ * @uses bbp_redirect() Redirect the page to custom url
480
+ */
481
+ public function toggle_forum() {
482
+
483
+ // Only proceed if GET is a forum toggle action
484
+ if ( bbp_is_get_request() && ! empty( $_GET['forum_id'] ) && ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_forum_close' ) ) ) {
485
+ $action = $_GET['action']; // What action is taking place?
486
+ $forum_id = (int) $_GET['forum_id']; // What's the forum id?
487
+ $success = false; // Flag
488
+ $post_data = array( 'ID' => $forum_id ); // Prelim array
489
+ $forum = bbp_get_forum( $forum_id );
490
+
491
+ // Bail if forum is missing
492
+ if ( empty( $forum ) ) {
493
+ wp_die( __( 'The forum was not found.', 'bbpress' ) );
494
+ }
495
+
496
+ // What is the user doing here?
497
+ if ( ! current_user_can( 'keep_gate', $forum->ID ) ) {
498
+ wp_die( __( 'You do not have permission to do that.', 'bbpress' ) );
499
+ }
500
+
501
+ switch ( $action ) {
502
+ case 'bbp_toggle_forum_close' :
503
+ check_admin_referer( 'close-forum_' . $forum_id );
504
+
505
+ $is_open = bbp_is_forum_open( $forum_id );
506
+ $message = ( true === $is_open )
507
+ ? 'closed'
508
+ : 'opened';
509
+ $success = ( true === $is_open )
510
+ ? bbp_close_forum( $forum_id )
511
+ : bbp_open_forum( $forum_id );
512
+
513
+ break;
514
+ }
515
+
516
+ $message = array( 'bbp_forum_toggle_notice' => $message, 'forum_id' => $forum->ID );
517
+
518
+ if ( false === $success || is_wp_error( $success ) ) {
519
+ $message['failed'] = '1';
520
+ }
521
+
522
+ // Do additional forum toggle actions (admin side)
523
+ do_action( 'bbp_toggle_forum_admin', $success, $post_data, $action, $message );
524
+
525
+ // Redirect back to the forum
526
+ $redirect = add_query_arg( $message, remove_query_arg( array( 'action', 'forum_id' ) ) );
527
+ bbp_redirect( $redirect );
528
+ }
529
+ }
530
+
531
+ /**
532
+ * Toggle forum notices
533
+ *
534
+ * Display the success/error notices from
535
+ * {@link BBP_Admin::toggle_forum()}
536
+ *
537
+ * @since 2.6.0 bbPress (r5254)
538
+ *
539
+ * @uses bbp_get_forum() To get the forum
540
+ * @uses bbp_get_forum_title() To get the forum title of the forum
541
+ * @uses esc_html() To sanitize the forum title
542
+ * @uses apply_filters() Calls 'bbp_toggle_forum_notice_admin' with
543
+ * message, forum id, notice and is it a failure
544
+ */
545
+ public function toggle_forum_notice() {
546
+
547
+ // Only proceed if GET is a forum toggle action
548
+ if ( bbp_is_get_request() && ! empty( $_GET['bbp_forum_toggle_notice'] ) && in_array( $_GET['bbp_forum_toggle_notice'], array( 'opened', 'closed' ) ) && ! empty( $_GET['forum_id'] ) ) {
549
+ $notice = $_GET['bbp_forum_toggle_notice']; // Which notice?
550
+ $forum_id = (int) $_GET['forum_id']; // What's the forum id?
551
+ $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure?
552
+
553
+ // Bail if no forum_id or notice
554
+ if ( empty( $notice ) || empty( $forum_id ) ) {
555
+ return;
556
+ }
557
+
558
+ // Bail if forum is missing
559
+ $forum = bbp_get_forum( $forum_id );
560
+ if ( empty( $forum ) ) {
561
+ return;
562
+ }
563
+
564
+ $forum_title = bbp_get_forum_title( $forum->ID );
565
+
566
+ switch ( $notice ) {
567
+ case 'opened' :
568
+ $message = ( $is_failure === true )
569
+ ? sprintf( __( 'There was a problem opening the forum "%1$s".', 'bbpress' ), $forum_title )
570
+ : sprintf( __( 'Forum "%1$s" successfully opened.', 'bbpress' ), $forum_title );
571
+ break;
572
+
573
+ case 'closed' :
574
+ $message = ( $is_failure === true )
575
+ ? sprintf( __( 'There was a problem closing the forum "%1$s".', 'bbpress' ), $forum_title )
576
+ : sprintf( __( 'Forum "%1$s" successfully closed.', 'bbpress' ), $forum_title );
577
+ break;
578
+ }
579
+
580
+ // Do additional forum toggle notice filters (admin side)
581
+ $message = apply_filters( 'bbp_toggle_forum_notice_admin', $message, $forum->ID, $notice, $is_failure );
582
+
583
+ ?>
584
+
585
+ <div id="message" class="<?php echo $is_failure === true ? 'error' : 'updated'; ?> fade">
586
+ <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
587
+ </div>
588
+
589
+ <?php
590
+ }
591
+ }
592
+
593
  /**
594
  * Manage the column headers for the forums page
595
  *
596
+ * @since 2.0.0 bbPress (r2485)
597
  *
598
  * @param array $columns The columns
599
  * @uses apply_filters() Calls 'bbp_admin_forums_column_headers' with
602
  */
603
  public function column_headers( $columns ) {
604
 
605
+ // Set list table column headers
606
+ $columns = array(
 
607
  'cb' => '<input type="checkbox" />',
608
+ 'title' => __( 'Forum', 'bbpress' ),
609
+ 'bbp_forum_topic_count' => __( 'Topics', 'bbpress' ),
610
+ 'bbp_forum_reply_count' => __( 'Replies', 'bbpress' ),
611
+ 'bbp_forum_mods' => __( 'Moderators', 'bbpress' ),
612
+ 'author' => __( 'Creator', 'bbpress' ),
613
+ 'bbp_forum_created' => __( 'Created' , 'bbpress' ),
614
+ 'bbp_forum_freshness' => __( 'Last Post', 'bbpress' )
615
  );
616
 
617
+ // Remove forum mods column if not enabled
618
+ if ( ! bbp_allow_forum_mods() ) {
619
+ unset( $columns['bbp_forum_mods'] );
620
+ }
621
+
622
  return apply_filters( 'bbp_admin_forums_column_headers', $columns );
623
  }
624
 
625
  /**
626
  * Print extra columns for the forums page
627
  *
628
+ * @since 2.0.0 bbPress (r2485)
629
  *
630
  * @param string $column Column
631
  * @param int $forum_id Forum id
641
  */
642
  public function column_data( $column, $forum_id ) {
643
 
 
 
644
  switch ( $column ) {
645
  case 'bbp_forum_topic_count' :
646
  bbp_forum_topic_count( $forum_id );
650
  bbp_forum_reply_count( $forum_id );
651
  break;
652
 
653
+ case 'bbp_forum_mods' :
654
+ bbp_moderator_list( $forum_id, array(
655
+ 'before' => '',
656
+ 'after' => '',
657
+ 'none' => esc_html__( '&mdash;', 'bbpress' )
658
+ ) );
659
+ break;
660
+
661
  case 'bbp_forum_created':
662
  printf( '%1$s <br /> %2$s',
663
  get_the_date(),
668
 
669
  case 'bbp_forum_freshness' :
670
  $last_active = bbp_get_forum_last_active_time( $forum_id, false );
671
+ if ( ! empty( $last_active ) ) {
672
  echo esc_html( $last_active );
673
+ } else {
674
  esc_html_e( 'No Topics', 'bbpress' );
675
+ }
676
 
677
  break;
678
 
686
  * Forum Row actions
687
  *
688
  * Remove the quick-edit action link and display the description under
689
+ * the forum title and add the open/close links
690
  *
691
+ * @since 2.0.0 bbPress (r2577)
692
  *
693
  * @param array $actions Actions
694
  * @param array $forum Forum object
695
+ * @uses bbp_get_public_status_id() To get the published forum id's
696
+ * @uses bbp_get_private_status_id() To get the private forum id's
697
+ * @uses bbp_get_hidden_status_id() To get the hidden forum id's
698
+ * @uses bbp_get_closed_status_id() To get the closed forum id's
699
+ * @uses wp_nonce_url() To nonce the url
700
+ * @uses bbp_is_forum_open() To check if a forum is open
701
  * @uses bbp_forum_content() To output forum description
702
  * @return array $actions Actions
703
  */
704
  public function row_actions( $actions, $forum ) {
705
 
 
 
706
  unset( $actions['inline hide-if-no-js'] );
707
 
708
+ // Only show the actions if the user is capable of viewing them :)
709
+ if ( current_user_can( 'keep_gate', $forum->ID ) ) {
710
+
711
+ // Show the 'close' and 'open' link on published, private, hidden and closed posts only
712
+ if ( in_array( $forum->post_status, array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id(), bbp_get_closed_status_id() ) ) ) {
713
+ $close_uri = wp_nonce_url( add_query_arg( array( 'forum_id' => $forum->ID, 'action' => 'bbp_toggle_forum_close' ), remove_query_arg( array( 'bbp_forum_toggle_notice', 'forum_id', 'failed', 'super' ) ) ), 'close-forum_' . $forum->ID );
714
+ if ( bbp_is_forum_open( $forum->ID ) ) {
715
+ $actions['closed'] = '<a href="' . esc_url( $close_uri ) . '" title="' . esc_attr__( 'Close this forum', 'bbpress' ) . '">' . _x( 'Close', 'Close a Forum', 'bbpress' ) . '</a>';
716
+ } else {
717
+ $actions['closed'] = '<a href="' . esc_url( $close_uri ) . '" title="' . esc_attr__( 'Open this forum', 'bbpress' ) . '">' . _x( 'Open', 'Open a Forum', 'bbpress' ) . '</a>';
718
+ }
719
+ }
720
+ }
721
+
722
  // simple hack to show the forum description under the title
723
  bbp_forum_content( $forum->ID );
724
 
728
  /**
729
  * Custom user feedback messages for forum post type
730
  *
731
+ * @since 2.0.0 bbPress (r3080)
732
  *
733
  * @global int $post_ID
734
  * @uses bbp_get_forum_permalink()
743
  public function updated_messages( $messages ) {
744
  global $post_ID;
745
 
 
 
746
  // URL for the current forum
747
  $forum_url = bbp_get_forum_permalink( $post_ID );
748
 
750
  $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
751
 
752
  // Messages array
753
+ $messages[ $this->post_type ] = array(
754
  0 => '', // Left empty on purpose
755
 
756
  // Updated
757
+ 1 => sprintf(
758
+ '%1$s <a href="%2$s">%3$s</a>',
759
+ __( 'Forum updated.', 'bbpress' ),
760
+ $forum_url,
761
+ __( 'View forum', 'bbpress' )
762
+ ),
763
 
764
  // Custom field updated
765
  2 => __( 'Custom field updated.', 'bbpress' ),
777
  : false,
778
 
779
  // Forum created
780
+ 6 => sprintf(
781
+ '%1$s <a href="%2$s">%3$s</a>',
782
+ __( 'Forum created.', 'bbpress' ),
783
+ $forum_url,
784
+ __( 'View forum', 'bbpress' )
785
+ ),
786
 
787
  // Forum saved
788
  7 => __( 'Forum saved.', 'bbpress' ),
789
 
790
  // Forum submitted
791
+ 8 => sprintf(
792
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
793
+ __( 'Forum submitted.', 'bbpress' ),
794
+ esc_url( add_query_arg( 'preview', 'true', $forum_url ) ),
795
+ __( 'Preview forum', 'bbpress' )
796
+ ),
797
 
798
  // Forum scheduled
799
+ 9 => sprintf(
800
+ '%1$s <a target="_blank" href="%2$s">%3$s</a>',
801
+ sprintf(
802
+ __( 'Forum scheduled for: %s.', 'bbpress' ),
803
  // translators: Publish box date format, see http://php.net/date
804
+ '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'bbpress' ), strtotime( $post_date ) ) . '</strong>'
805
+ ),
806
+ $forum_url,
807
+ __( 'Preview forum', 'bbpress' )
808
+ ),
809
 
810
  // Forum draft updated
811
+ 10 => sprintf(
812
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
813
+ __( 'Forum draft updated.', 'bbpress' ),
814
+ esc_url( add_query_arg( 'preview', 'true', $forum_url ) ),
815
+ __( 'Preview forum', 'bbpress' )
816
+ ),
817
  );
818
 
819
  return $messages;
827
  * This is currently here to make hooking and unhooking of the admin UI easy.
828
  * It could use dependency injection in the future, but for now this is easier.
829
  *
830
+ * @since 2.0.0 bbPress (r2596)
831
  *
832
+ * @param WP_Screen $current_screen Current screen object
833
  * @uses BBP_Forums_Admin
834
  */
835
+ function bbp_admin_forums( $current_screen ) {
836
+
837
+ // Bail if not a forum screen
838
+ if ( empty( $current_screen->post_type ) || ( bbp_get_forum_post_type() !== $current_screen->post_type ) ) {
839
+ return;
840
+ }
841
+
842
+ // Init the forums admin
843
  bbpress()->admin->forums = new BBP_Forums_Admin();
844
  }
includes/admin/functions.php CHANGED
@@ -8,14 +8,14 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Admin Menus ***************************************************************/
14
 
15
  /**
16
  * Add a separator to the WordPress admin menus
17
  *
18
- * @since bbPress (r2957)
19
  */
20
  function bbp_admin_separator() {
21
 
@@ -47,14 +47,15 @@ function bbp_admin_separator() {
47
  /**
48
  * Tell WordPress we have a custom menu order
49
  *
50
- * @since bbPress (r2957)
51
  *
52
  * @param bool $menu_order Menu order
53
  * @return mixed True if separator, false if not
54
  */
55
  function bbp_admin_custom_menu_order( $menu_order = false ) {
56
- if ( false === bbpress()->admin->show_separator )
57
  return $menu_order;
 
58
 
59
  return true;
60
  }
@@ -62,7 +63,7 @@ function bbp_admin_custom_menu_order( $menu_order = false ) {
62
  /**
63
  * Move our custom separator above our custom post types
64
  *
65
- * @since bbPress (r2957)
66
  *
67
  * @param array $menu_order Menu Order
68
  * @uses bbp_get_forum_post_type() To get the forum post type
@@ -71,8 +72,9 @@ function bbp_admin_custom_menu_order( $menu_order = false ) {
71
  function bbp_admin_menu_order( $menu_order ) {
72
 
73
  // Bail if user cannot see any top level bbPress menus
74
- if ( empty( $menu_order ) || ( false === bbpress()->admin->show_separator ) )
75
  return $menu_order;
 
76
 
77
  // Initialize our custom order array
78
  $bbp_menu_order = array();
@@ -115,7 +117,7 @@ function bbp_admin_menu_order( $menu_order ) {
115
  /**
116
  * Filter sample permalinks so that certain languages display properly.
117
  *
118
- * @since bbPress (r3336)
119
  *
120
  * @param string $post_link Custom post type permalink
121
  * @param object $_post Post data object
@@ -130,8 +132,9 @@ function bbp_admin_menu_order( $menu_order ) {
130
  function bbp_filter_sample_permalink( $post_link, $_post, $leavename = false, $sample = false ) {
131
 
132
  // Bail if not on an admin page and not getting a sample permalink
133
- if ( !empty( $sample ) && is_admin() && bbp_is_custom_post_type() )
134
  return urldecode( $post_link );
 
135
 
136
  // Return post link
137
  return $post_link;
@@ -140,7 +143,7 @@ function bbp_filter_sample_permalink( $post_link, $_post, $leavename = false, $s
140
  /**
141
  * Sanitize permalink slugs when saving the settings page.
142
  *
143
- * @since bbPress (r5364)
144
  *
145
  * @param string $slug
146
  * @return string
@@ -170,15 +173,18 @@ function bbp_sanitize_slug( $slug = '' ) {
170
  /**
171
  * Uninstall all bbPress options and capabilities from a specific site.
172
  *
173
- * @since bbPress (r3765)
 
174
  * @param type $site_id
175
  */
176
  function bbp_do_uninstall( $site_id = 0 ) {
177
- if ( empty( $site_id ) )
178
  $site_id = get_current_blog_id();
 
179
 
180
  switch_to_blog( $site_id );
181
  bbp_delete_options();
 
182
  bbp_remove_caps();
183
  flush_rewrite_rules();
184
  restore_current_blog();
@@ -187,14 +193,14 @@ function bbp_do_uninstall( $site_id = 0 ) {
187
  /**
188
  * Redirect user to bbPress's What's New page on activation
189
  *
190
- * @since bbPress (r4389)
191
  *
192
  * @internal Used internally to redirect bbPress to the about page on activation
193
  *
194
  * @uses get_transient() To see if transient to redirect exists
195
  * @uses delete_transient() To delete the transient if it exists
196
  * @uses is_network_admin() To bail if being network activated
197
- * @uses wp_safe_redirect() To redirect
198
  * @uses add_query_arg() To help build the URL to redirect to
199
  * @uses admin_url() To get the admin URL to index.php
200
  *
@@ -203,7 +209,7 @@ function bbp_do_uninstall( $site_id = 0 ) {
203
  function bbp_do_activation_redirect() {
204
 
205
  // Bail if no activation redirect
206
- if ( ! get_transient( '_bbp_activation_redirect' ) ) {
207
  return;
208
  }
209
 
@@ -221,7 +227,7 @@ function bbp_do_activation_redirect() {
221
  }
222
 
223
  // Redirect to bbPress about page
224
- wp_safe_redirect( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) );
225
  }
226
 
227
  /**
@@ -231,7 +237,8 @@ function bbp_do_activation_redirect() {
231
  * The conditional prevents the override when the user is viewing settings or
232
  * any third-party plugins.
233
  *
234
- * @since bbPress (r3888)
 
235
  * @global string $plugin_page
236
  * @global array $submenu_file
237
  */
@@ -239,14 +246,16 @@ function bbp_tools_modify_menu_highlight() {
239
  global $plugin_page, $submenu_file;
240
 
241
  // This tweaks the Tools subnav menu to only show one bbPress menu item
242
- if ( ! in_array( $plugin_page, array( 'bbp-settings' ) ) )
243
  $submenu_file = 'bbp-repair';
 
244
  }
245
 
246
  /**
247
  * Output the tabs in the admin area
248
  *
249
- * @since bbPress (r3872)
 
250
  * @param string $active_tab Name of the tab that is active
251
  */
252
  function bbp_tools_admin_tabs( $active_tab = '' ) {
@@ -256,7 +265,8 @@ function bbp_tools_admin_tabs( $active_tab = '' ) {
256
  /**
257
  * Output the tabs in the admin area
258
  *
259
- * @since bbPress (r3872)
 
260
  * @param string $active_tab Name of the tab that is active
261
  */
262
  function bbp_get_tools_admin_tabs( $active_tab = '' ) {
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
  /** Admin Menus ***************************************************************/
14
 
15
  /**
16
  * Add a separator to the WordPress admin menus
17
  *
18
+ * @since 2.0.0 bbPress (r2957)
19
  */
20
  function bbp_admin_separator() {
21
 
47
  /**
48
  * Tell WordPress we have a custom menu order
49
  *
50
+ * @since 2.0.0 bbPress (r2957)
51
  *
52
  * @param bool $menu_order Menu order
53
  * @return mixed True if separator, false if not
54
  */
55
  function bbp_admin_custom_menu_order( $menu_order = false ) {
56
+ if ( false === bbpress()->admin->show_separator ) {
57
  return $menu_order;
58
+ }
59
 
60
  return true;
61
  }
63
  /**
64
  * Move our custom separator above our custom post types
65
  *
66
+ * @since 2.0.0 bbPress (r2957)
67
  *
68
  * @param array $menu_order Menu Order
69
  * @uses bbp_get_forum_post_type() To get the forum post type
72
  function bbp_admin_menu_order( $menu_order ) {
73
 
74
  // Bail if user cannot see any top level bbPress menus
75
+ if ( empty( $menu_order ) || ( false === bbpress()->admin->show_separator ) ) {
76
  return $menu_order;
77
+ }
78
 
79
  // Initialize our custom order array
80
  $bbp_menu_order = array();
117
  /**
118
  * Filter sample permalinks so that certain languages display properly.
119
  *
120
+ * @since 2.0.0 bbPress (r3336)
121
  *
122
  * @param string $post_link Custom post type permalink
123
  * @param object $_post Post data object
132
  function bbp_filter_sample_permalink( $post_link, $_post, $leavename = false, $sample = false ) {
133
 
134
  // Bail if not on an admin page and not getting a sample permalink
135
+ if ( ! empty( $sample ) && is_admin() && bbp_is_custom_post_type() ) {
136
  return urldecode( $post_link );
137
+ }
138
 
139
  // Return post link
140
  return $post_link;
143
  /**
144
  * Sanitize permalink slugs when saving the settings page.
145
  *
146
+ * @since 2.6.0 bbPress (r5364)
147
  *
148
  * @param string $slug
149
  * @return string
173
  /**
174
  * Uninstall all bbPress options and capabilities from a specific site.
175
  *
176
+ * @since 2.1.0 bbPress (r3765)
177
+ *
178
  * @param type $site_id
179
  */
180
  function bbp_do_uninstall( $site_id = 0 ) {
181
+ if ( empty( $site_id ) ) {
182
  $site_id = get_current_blog_id();
183
+ }
184
 
185
  switch_to_blog( $site_id );
186
  bbp_delete_options();
187
+ bbp_remove_roles();
188
  bbp_remove_caps();
189
  flush_rewrite_rules();
190
  restore_current_blog();
193
  /**
194
  * Redirect user to bbPress's What's New page on activation
195
  *
196
+ * @since 2.2.0 bbPress (r4389)
197
  *
198
  * @internal Used internally to redirect bbPress to the about page on activation
199
  *
200
  * @uses get_transient() To see if transient to redirect exists
201
  * @uses delete_transient() To delete the transient if it exists
202
  * @uses is_network_admin() To bail if being network activated
203
+ * @uses bbp_redirect() To redirect
204
  * @uses add_query_arg() To help build the URL to redirect to
205
  * @uses admin_url() To get the admin URL to index.php
206
  *
209
  function bbp_do_activation_redirect() {
210
 
211
  // Bail if no activation redirect
212
+ if ( ! get_transient( '_bbp_activation_redirect' ) ) {
213
  return;
214
  }
215
 
227
  }
228
 
229
  // Redirect to bbPress about page
230
+ bbp_redirect( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) );
231
  }
232
 
233
  /**
237
  * The conditional prevents the override when the user is viewing settings or
238
  * any third-party plugins.
239
  *
240
+ * @since 2.1.0 bbPress (r3888)
241
+ *
242
  * @global string $plugin_page
243
  * @global array $submenu_file
244
  */
246
  global $plugin_page, $submenu_file;
247
 
248
  // This tweaks the Tools subnav menu to only show one bbPress menu item
249
+ if ( ! in_array( $plugin_page, array( 'bbp-settings' ) ) ) {
250
  $submenu_file = 'bbp-repair';
251
+ }
252
  }
253
 
254
  /**
255
  * Output the tabs in the admin area
256
  *
257
+ * @since 2.1.0 bbPress (r3872)
258
+ *
259
  * @param string $active_tab Name of the tab that is active
260
  */
261
  function bbp_tools_admin_tabs( $active_tab = '' ) {
265
  /**
266
  * Output the tabs in the admin area
267
  *
268
+ * @since 2.1.0 bbPress (r3872)
269
+ *
270
  * @param string $active_tab Name of the tab that is active
271
  */
272
  function bbp_get_tools_admin_tabs( $active_tab = '' ) {
includes/admin/images/badge-2x.png DELETED
Binary file
includes/admin/images/badge.png DELETED
Binary file
includes/admin/images/button-grad.png DELETED
Binary file
includes/admin/images/icons32-2x.png DELETED
Binary file
includes/admin/images/icons32.png DELETED
Binary file
includes/admin/images/index.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Do not modify the files in this folder.
5
- */
 
 
 
 
 
includes/admin/images/menu-2x.png DELETED
Binary file
includes/admin/images/menu.png DELETED
Binary file
includes/admin/js/common.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! This file is automatically generated. */
2
+ jQuery(document).ready(function(){var a=jQuery("#bbp_author_id");a.suggest(a.data("ajax-url"),{onSelect:function(){var b=this.value;a.val(b.substr(0,b.indexOf(" ")))}})});
includes/admin/js/replies.js CHANGED
@@ -1,5 +1,8 @@
1
  jQuery( document ).ready(function() {
2
 
 
 
 
3
  var bbp_topic_id = jQuery( '#bbp_topic_id' );
4
 
5
  bbp_topic_id.suggest(
1
  jQuery( document ).ready(function() {
2
 
3
+ jQuery( '#misc-publishing-actions' ).find( '.misc-pub-section' ).first().remove();
4
+ jQuery( '#save-action' ).remove();
5
+
6
  var bbp_topic_id = jQuery( '#bbp_topic_id' );
7
 
8
  bbp_topic_id.suggest(
includes/admin/js/replies.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! This file is automatically generated. */
2
+ jQuery(document).ready(function(){jQuery("#misc-publishing-actions").find(".misc-pub-section").first().remove(),jQuery("#save-action").remove();var a=jQuery("#bbp_topic_id");a.suggest(a.data("ajax-url"),{onSelect:function(){var b=this.value;a.val(b.substr(0,b.indexOf(" ")))}})});
includes/admin/js/topics.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! This file is automatically generated. */
2
+ jQuery(document).ready(function(){jQuery("#misc-publishing-actions").find(".misc-pub-section").first().remove(),jQuery("#save-action").remove()});
includes/admin/list-tables/topic-replies.php ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Topic Replies List Table class.
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Administration
8
+ * @since 2.6.0
9
+ * @access private
10
+ *
11
+ * @see WP_Posts_List_Table
12
+ */
13
+
14
+ // Include the main list table class if it's not included yet
15
+ if ( ! class_exists( 'WP_List_Table' ) ) {
16
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
17
+ }
18
+
19
+ if ( class_exists( 'WP_List_Table' ) ) :
20
+ /**
21
+ * Topic replies list table
22
+ *
23
+ * This list table is responsible for showing the replies to a topic in a
24
+ * metabox, similar to comments in posts and pages.
25
+ *
26
+ * @since 2.6.0 bbPress (r5886)
27
+ */
28
+ class BBP_Topic_Replies_List_Table extends WP_List_Table {
29
+
30
+ /**
31
+ * The main constructor method
32
+ *
33
+ * @since 2.6.0 bbPress (r5886)
34
+ */
35
+ public function __construct( $args = array() ) {
36
+ $args = array(
37
+ 'singular' => esc_html_x( 'Reply', 'noun', 'bbpress' ),
38
+ 'plural' => esc_html__( 'Replies', 'bbpress' ),
39
+ 'ajax' => true
40
+ );
41
+ parent::__construct( $args );
42
+ }
43
+
44
+ /**
45
+ * Setup the list-table's columns
46
+ *
47
+ * @since 2.6.0 bbPress (r5886)
48
+ *
49
+ * @see WP_List_Table::::single_row_columns()
50
+ *
51
+ * @return array An associative array containing column information
52
+ */
53
+ public function get_columns() {
54
+ return array(
55
+ //'cb' => '<input type="checkbox" />',
56
+ 'bbp_topic_reply_author' => esc_html__( 'Author', 'bbpress' ),
57
+ 'bbp_reply_content' => esc_html__( 'Content', 'bbpress' ),
58
+ 'bbp_reply_created' => esc_html__( 'Replied', 'bbpress' ),
59
+ );
60
+ }
61
+
62
+ /**
63
+ * Allow `bbp_reply_created` to be sortable
64
+ *
65
+ * @since 2.6.0 bbPress (r5886)
66
+ *
67
+ * @return array An associative array containing the `bbp_reply_created` column
68
+ */
69
+ public function get_sortable_columns() {
70
+ return array(
71
+ 'bbp_reply_created' => array( 'bbp_reply_created', false )
72
+ );
73
+ }
74
+
75
+ /**
76
+ * Setup the bulk actions
77
+ *
78
+ * @since 2.6.0 bbPress (r5886)
79
+ *
80
+ * @return array An associative array containing all the bulk actions
81
+ */
82
+ public function get_bulk_actions() {
83
+ return array();
84
+
85
+ // @todo cap checks
86
+ return array(
87
+ 'unapprove' => esc_html__( 'Unapprove', 'bbpress' ),
88
+ 'spam' => esc_html__( 'Spam', 'bbpress' ),
89
+ 'trash' => esc_html__( 'Trash', 'bbpress' )
90
+ );
91
+ }
92
+
93
+ /**
94
+ * Output the `cb` column for bulk actions (if we implement them)
95
+ *
96
+ * @since 2.6.0 bbPress (r5886)
97
+ */
98
+ public function column_cb( $item = '' ) {
99
+ return sprintf(
100
+ '<input type="checkbox" name="%1$s[]" value="%2$s" />',
101
+ $this->_args['singular'],
102
+ $item->ID
103
+ );
104
+ }
105
+
106
+ /**
107
+ * Output the contents of the `bbp_topic_reply_author` column
108
+ *
109
+ * @since 2.6.0 bbPress (r5886)
110
+ */
111
+ public function column_bbp_topic_reply_author( $item = '' ) {
112
+ bbp_reply_author_avatar( $item->ID, 50 );
113
+ bbp_reply_author_display_name( $item->ID );
114
+ echo '<br>';
115
+ bbp_reply_author_email( $item->ID );
116
+ echo '<br>';
117
+ bbp_author_ip( array( 'post_id' => $item->ID ) );
118
+ }
119
+
120
+ /**
121
+ * Output the contents of the `bbp_reply_created` column
122
+ *
123
+ * @since 2.6.0 bbPress (r5886)
124
+ */
125
+ public function column_bbp_reply_created( $item = '' ) {
126
+ return sprintf( '%1$s <br /> %2$s',
127
+ esc_attr( get_the_date( '', $item ) ),
128
+ esc_attr( get_the_time( '', $item ) )
129
+ );
130
+ }
131
+
132
+ /**
133
+ * Output the contents of the `bbp_reply_content` column
134
+ *
135
+ * @since 2.6.0 bbPress (r5886)
136
+ */
137
+ public function column_bbp_reply_content( $item = '' ) {
138
+
139
+ // Define actions array
140
+ $actions = array(
141
+ 'view' => '<a href="' . bbp_get_reply_url( $item->ID ) . '">' . esc_html__( 'View', 'bbpress' ) . '</a>'
142
+ );
143
+
144
+ // Prepend `edit` link
145
+ if ( current_user_can( 'edit_reply', $item->ID ) ) {
146
+ $actions['edit'] = '<a href="' . get_edit_post_link( $item->ID ) . '">' . esc_html__( 'Edit', 'bbpress' ) . '</a>';
147
+ $actions = array_reverse( $actions );
148
+ }
149
+
150
+ // Filter the reply content
151
+ $reply_content = apply_filters( 'bbp_get_reply_content', $item->post_content, $item->ID );
152
+ $reply_actions = $this->row_actions( $actions );
153
+
154
+ // Return content & actions
155
+ return $reply_content . $reply_actions;
156
+ }
157
+
158
+ /**
159
+ * Handle bulk action requests
160
+ *
161
+ * @since 2.6.0 bbPress (r5886)
162
+ */
163
+ public function process_bulk_action() {
164
+ switch ( $this->current_action() ) {
165
+ case 'trash' :
166
+ break;
167
+ case 'unapprove' :
168
+ break;
169
+ case 'spam' :
170
+ break;
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Prepare the list-table items for display
176
+ *
177
+ * @since 2.6.0 bbPress (r5886)
178
+ *
179
+ * @uses $this->_column_headers
180
+ * @uses $this->items
181
+ * @uses $this->get_columns()
182
+ * @uses $this->get_sortable_columns()
183
+ * @uses $this->get_pagenum()
184
+ * @uses $this->set_pagination_args()
185
+ */
186
+ public function prepare_items( $topic_id = 0 ) {
187
+
188
+ // Sanitize the topic ID
189
+ $topic_id = bbp_get_topic_id( $topic_id );
190
+
191
+ // Set column headers
192
+ $this->_column_headers = array(
193
+ $this->get_columns(),
194
+ array(),
195
+ $this->get_sortable_columns()
196
+ );
197
+
198
+ // Handle bulk actions
199
+ $this->process_bulk_action();
200
+
201
+ // Query parameters
202
+ $per_page = 5;
203
+ $current_page = $this->get_pagenum();
204
+ $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'date';
205
+ $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc';
206
+
207
+ // Query for replies
208
+ $reply_query = new WP_Query( array(
209
+ 'post_type' => bbp_get_reply_post_type(),
210
+ 'post_parent' => $topic_id,
211
+ 'posts_per_page' => $per_page,
212
+ 'paged' => $current_page,
213
+ 'orderby' => $orderby,
214
+ 'order' => ucwords( $order ),
215
+ 'hierarchical' => false,
216
+ 'ignore_sticky_posts' => true,
217
+ ) );
218
+
219
+ // Get the total number of replies, for pagination
220
+ $total_items = bbp_get_topic_reply_count( $topic_id );
221
+
222
+ // Set list table items to queried posts
223
+ $this->items = $reply_query->posts;
224
+
225
+ // Set the pagination arguments
226
+ $this->set_pagination_args( array(
227
+ 'total_items' => $total_items,
228
+ 'per_page' => $per_page,
229
+ 'total_pages' => ceil( $total_items / $per_page )
230
+ ) );
231
+ }
232
+
233
+ /**
234
+ * Message to be displayed when there are no items
235
+ *
236
+ * @since 2.6.0 bbPress (r5930)
237
+ */
238
+ public function no_items() {
239
+ esc_html_e( 'No replies to this topic.', 'bbpress' );
240
+ }
241
+
242
+ /**
243
+ * Display the list table
244
+ *
245
+ * This custom method is necessary because the one in `WP_List_Table` comes
246
+ * with a nonce and check that we do not need.
247
+ *
248
+ * @since 2.6.0 bbPress (r5930)
249
+ */
250
+ public function display() {
251
+
252
+ // Top
253
+ $this->display_tablenav( 'top' ); ?>
254
+
255
+ <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
256
+ <thead>
257
+ <tr>
258
+ <?php $this->print_column_headers(); ?>
259
+ </tr>
260
+ </thead>
261
+
262
+ <tbody id="the-list" data-wp-lists='list:<?php echo $this->_args['singular']; ?>'>
263
+ <?php $this->display_rows_or_placeholder(); ?>
264
+ </tbody>
265
+
266
+ <tfoot>
267
+ <tr>
268
+ <?php $this->print_column_headers( false ); ?>
269
+ </tr>
270
+ </tfoot>
271
+ </table>
272
+
273
+ <?php
274
+
275
+ // Bottom
276
+ $this->display_tablenav( 'bottom' );
277
+ }
278
+
279
+ /**
280
+ * Generate the table navigation above or below the table
281
+ *
282
+ * This custom method is necessary because the one in `WP_List_Table` comes
283
+ * with a nonce and check that we do not need.
284
+ *
285
+ * @since 2.6.0 bbPress (r5930)
286
+ *
287
+ * @param string $which
288
+ */
289
+ protected function display_tablenav( $which = '' ) {
290
+ ?>
291
+
292
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
293
+ <?php
294
+ $this->extra_tablenav( $which );
295
+ $this->pagination( $which );
296
+ ?>
297
+ <br class="clear" />
298
+ </div>
299
+
300
+ <?php
301
+ }
302
+ }
303
+ endif;
includes/admin/metaboxes.php CHANGED
@@ -9,12 +9,59 @@
9
 
10
  /** Dashboard *****************************************************************/
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
  * bbPress Dashboard Right Now Widget
14
  *
15
  * Adds a dashboard widget with forum statistics
16
  *
17
- * @since bbPress (r2770)
 
 
18
  *
19
  * @uses bbp_get_version() To get the current bbPress version
20
  * @uses bbp_get_statistics() To get the forum statistics
@@ -47,7 +94,7 @@ function bbp_dashboard_widget_right_now() {
47
 
48
  <?php
49
  $num = $r['forum_count'];
50
- $text = _n( 'Forum', 'Forums', $r['forum_count'], 'bbpress' );
51
  if ( current_user_can( 'publish_forums' ) ) {
52
  $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) );
53
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
@@ -64,7 +111,7 @@ function bbp_dashboard_widget_right_now() {
64
 
65
  <?php
66
  $num = $r['topic_count'];
67
- $text = _n( 'Topic', 'Topics', $r['topic_count'], 'bbpress' );
68
  if ( current_user_can( 'publish_topics' ) ) {
69
  $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
70
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
@@ -81,7 +128,7 @@ function bbp_dashboard_widget_right_now() {
81
 
82
  <?php
83
  $num = $r['reply_count'];
84
- $text = _n( 'Reply', 'Replies', $r['reply_count'], 'bbpress' );
85
  if ( current_user_can( 'publish_replies' ) ) {
86
  $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
87
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
@@ -100,7 +147,7 @@ function bbp_dashboard_widget_right_now() {
100
 
101
  <?php
102
  $num = $r['topic_tag_count'];
103
- $text = _n( 'Topic Tag', 'Topic Tags', $r['topic_tag_count'], 'bbpress' );
104
  if ( current_user_can( 'manage_topic_tags' ) ) {
105
  $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
106
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
@@ -132,11 +179,11 @@ function bbp_dashboard_widget_right_now() {
132
 
133
  <?php
134
  $num = $r['user_count'];
135
- $text = _n( 'User', 'Users', $r['user_count'], 'bbpress' );
136
  if ( current_user_can( 'edit_users' ) ) {
137
  $link = get_admin_url( null, 'users.php' );
138
- $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
139
- $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
140
  }
141
  ?>
142
 
@@ -151,12 +198,12 @@ function bbp_dashboard_widget_right_now() {
151
 
152
  <?php
153
  $num = $r['topic_count_hidden'];
154
- $text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden'], 'bbpress' );
155
  $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
156
  if ( '0' !== $num ) {
157
  $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
158
  }
159
- $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';
160
  $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';
161
  ?>
162
 
@@ -173,12 +220,12 @@ function bbp_dashboard_widget_right_now() {
173
 
174
  <?php
175
  $num = $r['reply_count_hidden'];
176
- $text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress' );
177
  $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
178
  if ( '0' !== $num ) {
179
  $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
180
  }
181
- $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';
182
  $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';
183
  ?>
184
 
@@ -195,7 +242,7 @@ function bbp_dashboard_widget_right_now() {
195
 
196
  <?php
197
  $num = $r['empty_topic_tag_count'];
198
- $text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress' );
199
  $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
200
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
201
  $text = '<a class="waiting" href="' . esc_url( $link ) . '">' . $text . '</a>';
@@ -238,7 +285,7 @@ function bbp_dashboard_widget_right_now() {
238
  *
239
  * The metabox that holds all of the additional forum information
240
  *
241
- * @since bbPress (r2744)
242
  *
243
  * @uses bbp_is_forum_closed() To check if a forum is closed or not
244
  * @uses bbp_is_forum_category() To check if a forum is a category or not
@@ -246,10 +293,9 @@ function bbp_dashboard_widget_right_now() {
246
  * @uses bbp_dropdown() To show a dropdown of the forums for forum parent
247
  * @uses do_action() Calls 'bbp_forum_metabox'
248
  */
249
- function bbp_forum_metabox() {
250
 
251
  // Post ID
252
- $post_id = get_the_ID();
253
  $post_parent = bbp_get_global_post_field( 'post_parent', 'raw' );
254
  $menu_order = bbp_get_global_post_field( 'menu_order', 'edit' );
255
 
@@ -260,7 +306,7 @@ function bbp_forum_metabox() {
260
  <p>
261
  <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
262
  <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label>
263
- <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post_id ) ); ?>
264
  </p>
265
 
266
  <?php
@@ -272,7 +318,7 @@ function bbp_forum_metabox() {
272
  <p>
273
  <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
274
  <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label>
275
- <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post_id ) ); ?>
276
  </p>
277
 
278
  <?php
@@ -284,7 +330,7 @@ function bbp_forum_metabox() {
284
  <p>
285
  <strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong>
286
  <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label>
287
- <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post_id ) ); ?>
288
  </p>
289
 
290
  <hr />
@@ -305,13 +351,12 @@ function bbp_forum_metabox() {
305
  'orderby' => 'title',
306
  'order' => 'ASC',
307
  'walker' => '',
308
- 'exclude' => $post_id,
309
 
310
  // Output-related
311
  'select_id' => 'parent_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
  ) ); ?>
@@ -327,7 +372,7 @@ function bbp_forum_metabox() {
327
 
328
  <?php
329
  wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' );
330
- do_action( 'bbp_forum_metabox', $post_id );
331
  }
332
 
333
  /** Topics ********************************************************************/
@@ -337,15 +382,12 @@ function bbp_forum_metabox() {
337
  *
338
  * The metabox that holds all of the additional topic information
339
  *
340
- * @since bbPress (r2464)
341
  *
342
  * @uses bbp_get_topic_forum_id() To get the topic forum id
343
  * @uses do_action() Calls 'bbp_topic_metabox'
344
  */
345
- function bbp_topic_metabox() {
346
-
347
- // Post ID
348
- $post_id = get_the_ID();
349
 
350
  /** Type ******************************************************************/
351
 
@@ -354,7 +396,7 @@ function bbp_topic_metabox() {
354
  <p>
355
  <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
356
  <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Topic Type', 'bbpress' ); ?></label>
357
- <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post_id ) ); ?>
358
  </p>
359
 
360
  <?php
@@ -365,8 +407,9 @@ function bbp_topic_metabox() {
365
 
366
  <p>
367
  <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
 
368
  <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', 'bbpress' ); ?></label>
369
- <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post_id ) ); ?>
370
  </p>
371
 
372
  <?php
@@ -375,12 +418,14 @@ function bbp_topic_metabox() {
375
 
376
  ?>
377
 
 
 
378
  <p>
379
  <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
380
  <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label>
381
  <?php bbp_dropdown( array(
382
  'post_type' => bbp_get_forum_post_type(),
383
- 'selected' => bbp_get_topic_forum_id( $post_id ),
384
  'numberposts' => -1,
385
  'orderby' => 'title',
386
  'order' => 'ASC',
@@ -389,7 +434,6 @@ function bbp_topic_metabox() {
389
 
390
  // Output-related
391
  'select_id' => 'parent_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' ),
@@ -401,7 +445,7 @@ function bbp_topic_metabox() {
401
 
402
  <?php
403
  wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' );
404
- do_action( 'bbp_topic_metabox', $post_id );
405
  }
406
 
407
  /** Replies *******************************************************************/
@@ -411,23 +455,37 @@ function bbp_topic_metabox() {
411
  *
412
  * The metabox that holds all of the additional reply information
413
  *
414
- * @since bbPress (r2464)
415
  *
416
  * @uses bbp_get_topic_post_type() To get the topic post type
417
  * @uses do_action() Calls 'bbp_reply_metabox'
418
  */
419
- function bbp_reply_metabox() {
420
-
421
- // Post ID
422
- $post_id = get_the_ID();
423
 
424
  // Get some meta
425
- $reply_topic_id = bbp_get_reply_topic_id( $post_id );
426
- $reply_forum_id = bbp_get_reply_forum_id( $post_id );
427
- $reply_to = bbp_get_reply_to( $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
 
429
- // Allow individual manipulation of reply forum
430
- if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?>
 
 
431
 
432
  <p>
433
  <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
@@ -443,33 +501,88 @@ function bbp_reply_metabox() {
443
 
444
  // Output-related
445
  'select_id' => 'bbp_forum_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
  ) ); ?>
452
  </p>
453
 
454
- <?php endif; ?>
 
 
 
 
455
 
456
  <p>
457
  <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong>
458
  <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label>
459
- <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_topic_nonce' ); ?>" />
460
  </p>
461
 
462
- <p>
463
- <strong class="label"><?php esc_html_e( 'Reply To:', 'bbpress' ); ?></strong>
464
- <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', 'bbpress' ); ?></label>
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 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  }
474
 
475
  /** Users *********************************************************************/
@@ -477,37 +590,34 @@ function bbp_reply_metabox() {
477
  /**
478
  * Anonymous user information metabox
479
  *
480
- * @since bbPress (r2828)
481
  *
 
482
  * @uses bbp_is_reply_anonymous() To check if reply is anonymous
483
  * @uses bbp_is_topic_anonymous() To check if topic is anonymous
484
- * @uses get_the_ID() To get the global post ID
485
  * @uses get_post_meta() To get the author user information
486
  */
487
- function bbp_author_metabox() {
488
-
489
- // Post ID
490
- $post_id = get_the_ID();
491
 
492
  // Show extra bits if topic/reply is anonymous
493
- if ( bbp_is_reply_anonymous( $post_id ) || bbp_is_topic_anonymous( $post_id ) ) : ?>
494
 
495
  <p>
496
  <strong class="label"><?php esc_html_e( 'Name:', 'bbpress' ); ?></strong>
497
  <label class="screen-reader-text" for="bbp_anonymous_name"><?php esc_html_e( 'Name', 'bbpress' ); ?></label>
498
- <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_name', true ) ); ?>" />
499
  </p>
500
 
501
  <p>
502
  <strong class="label"><?php esc_html_e( 'Email:', 'bbpress' ); ?></strong>
503
  <label class="screen-reader-text" for="bbp_anonymous_email"><?php esc_html_e( 'Email', 'bbpress' ); ?></label>
504
- <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_email', true ) ); ?>" />
505
  </p>
506
 
507
  <p>
508
  <strong class="label"><?php esc_html_e( 'Website:', 'bbpress' ); ?></strong>
509
  <label class="screen-reader-text" for="bbp_anonymous_website"><?php esc_html_e( 'Website', 'bbpress' ); ?></label>
510
- <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_website', true ) ); ?>" />
511
  </p>
512
 
513
  <?php else : ?>
@@ -515,7 +625,7 @@ function bbp_author_metabox() {
515
  <p>
516
  <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong>
517
  <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label>
518
- <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_user_nonce' ); ?>" />
519
  </p>
520
 
521
  <?php endif; ?>
@@ -523,10 +633,127 @@ function bbp_author_metabox() {
523
  <p>
524
  <strong class="label"><?php esc_html_e( 'IP:', 'bbpress' ); ?></strong>
525
  <label class="screen-reader-text" for="bbp_author_ip_address"><?php esc_html_e( 'IP Address', 'bbpress' ); ?></label>
526
- <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_author_ip', true ) ); ?>" disabled="disabled" />
527
  </p>
528
 
529
  <?php
530
 
531
- do_action( 'bbp_author_metabox', $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  }
9
 
10
  /** Dashboard *****************************************************************/
11
 
12
+ /**
13
+ * Filter the Dashboard "at a glance" items and append bbPress elements to it.
14
+ *
15
+ * @since 2.6.0 bbPress (r5268)
16
+ *
17
+ * @param array $elements
18
+ * @return array
19
+ */
20
+ function bbp_filter_dashboard_glance_items( $elements = array() ) {
21
+
22
+ // Get the statistics
23
+ $r = bbp_get_statistics();
24
+
25
+ // Forums
26
+ if ( current_user_can( 'publish_forums' ) ) {
27
+ $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) );
28
+ $text = sprintf( _n( '%s Forum', '%s Forums', $r['forum_count_int'], 'bbpress' ), $r['forum_count'] );
29
+ $elements[] = '<a href="' . esc_url( $link ) . '" class="bbp-glance-forums">' . esc_html( $text ) . '</a>';
30
+ }
31
+
32
+ // Topics
33
+ if ( current_user_can( 'publish_topics' ) ) {
34
+ $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
35
+ $text = sprintf( _n( '%s Topic', '%s Topics', $r['topic_count_int'], 'bbpress' ), $r['topic_count'] );
36
+ $elements[] = '<a href="' . esc_url( $link ) . '" class="bbp-glance-topics">' . esc_html( $text ) . '</a>';
37
+ }
38
+
39
+ // Replies
40
+ if ( current_user_can( 'publish_replies' ) ) {
41
+ $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
42
+ $text = sprintf( _n( '%s Reply', '%s Replies', $r['reply_count_int'], 'bbpress' ), $r['reply_count'] );
43
+ $elements[] = '<a href="' . esc_url( $link ) . '" class="bbp-glance-replies">' . esc_html( $text ) . '</a>';
44
+ }
45
+
46
+ // Topic Tags
47
+ if ( bbp_allow_topic_tags() && current_user_can( 'manage_topic_tags' ) ) {
48
+ $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
49
+ $text = sprintf( _n( '%s Topic Tag', '%s Topic Tags', $r['topic_tag_count_int'], 'bbpress' ), $r['topic_tag_count'] );
50
+ $elements[] = '<a href="' . esc_url( $link ) . '" class="bbp-glance-topic-tags">' . esc_html( $text ) . '</a>';
51
+ }
52
+
53
+ // Filter and return
54
+ return apply_filters( 'bbp_dashboard_at_a_glance', $elements, $r );
55
+ }
56
+
57
  /**
58
  * bbPress Dashboard Right Now Widget
59
  *
60
  * Adds a dashboard widget with forum statistics
61
  *
62
+ * @since 2.0.0 bbPress (r2770)
63
+ *
64
+ * @deprecated 2.6.0 bbPress (r5268)
65
  *
66
  * @uses bbp_get_version() To get the current bbPress version
67
  * @uses bbp_get_statistics() To get the forum statistics
94
 
95
  <?php
96
  $num = $r['forum_count'];
97
+ $text = _n( 'Forum', 'Forums', $r['forum_count_int'], 'bbpress' );
98
  if ( current_user_can( 'publish_forums' ) ) {
99
  $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) );
100
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
111
 
112
  <?php
113
  $num = $r['topic_count'];
114
+ $text = _n( 'Topic', 'Topics', $r['topic_count_int'], 'bbpress' );
115
  if ( current_user_can( 'publish_topics' ) ) {
116
  $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
117
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
128
 
129
  <?php
130
  $num = $r['reply_count'];
131
+ $text = _n( 'Reply', 'Replies', $r['reply_count_int'], 'bbpress' );
132
  if ( current_user_can( 'publish_replies' ) ) {
133
  $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
134
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
147
 
148
  <?php
149
  $num = $r['topic_tag_count'];
150
+ $text = _n( 'Topic Tag', 'Topic Tags', $r['topic_tag_count_int'], 'bbpress' );
151
  if ( current_user_can( 'manage_topic_tags' ) ) {
152
  $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
153
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
179
 
180
  <?php
181
  $num = $r['user_count'];
182
+ $text = _n( 'User', 'Users', $r['user_count_int'], 'bbpress' );
183
  if ( current_user_can( 'edit_users' ) ) {
184
  $link = get_admin_url( null, 'users.php' );
185
+ $num = '<a href="' . $link . '">' . $num . '</a>';
186
+ $text = '<a href="' . $link . '">' . $text . '</a>';
187
  }
188
  ?>
189
 
198
 
199
  <?php
200
  $num = $r['topic_count_hidden'];
201
+ $text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden_int'], 'bbpress' );
202
  $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
203
  if ( '0' !== $num ) {
204
  $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
205
  }
206
+ $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';
207
  $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';
208
  ?>
209
 
220
 
221
  <?php
222
  $num = $r['reply_count_hidden'];
223
+ $text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden_int'], 'bbpress' );
224
  $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
225
  if ( '0' !== $num ) {
226
  $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
227
  }
228
+ $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';
229
  $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';
230
  ?>
231
 
242
 
243
  <?php
244
  $num = $r['empty_topic_tag_count'];
245
+ $text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count_int'], 'bbpress' );
246
  $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
247
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
248
  $text = '<a class="waiting" href="' . esc_url( $link ) . '">' . $text . '</a>';
285
  *
286
  * The metabox that holds all of the additional forum information
287
  *
288
+ * @since 2.0.0 bbPress (r2744)
289
  *
290
  * @uses bbp_is_forum_closed() To check if a forum is closed or not
291
  * @uses bbp_is_forum_category() To check if a forum is a category or not
293
  * @uses bbp_dropdown() To show a dropdown of the forums for forum parent
294
  * @uses do_action() Calls 'bbp_forum_metabox'
295
  */
296
+ function bbp_forum_metabox( $post ) {
297
 
298
  // Post ID
 
299
  $post_parent = bbp_get_global_post_field( 'post_parent', 'raw' );
300
  $menu_order = bbp_get_global_post_field( 'menu_order', 'edit' );
301
 
306
  <p>
307
  <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
308
  <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label>
309
+ <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post->ID ) ); ?>
310
  </p>
311
 
312
  <?php
318
  <p>
319
  <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
320
  <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label>
321
+ <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post->ID ) ); ?>
322
  </p>
323
 
324
  <?php
330
  <p>
331
  <strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong>
332
  <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label>
333
+ <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post->ID ) ); ?>
334
  </p>
335
 
336
  <hr />
351
  'orderby' => 'title',
352
  'order' => 'ASC',
353
  'walker' => '',
354
+ 'exclude' => $post->ID,
355
 
356
  // Output-related
357
  'select_id' => 'parent_id',
 
358
  'options_only' => false,
359
+ 'show_none' => __( '&mdash; No forum &mdash;', 'bbpress' ),
360
  'disable_categories' => false,
361
  'disabled' => ''
362
  ) ); ?>
372
 
373
  <?php
374
  wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' );
375
+ do_action( 'bbp_forum_metabox', $post );
376
  }
377
 
378
  /** Topics ********************************************************************/
382
  *
383
  * The metabox that holds all of the additional topic information
384
  *
385
+ * @since 2.0.0 bbPress (r2464)
386
  *
387
  * @uses bbp_get_topic_forum_id() To get the topic forum id
388
  * @uses do_action() Calls 'bbp_topic_metabox'
389
  */
390
+ function bbp_topic_metabox( $post ) {
 
 
 
391
 
392
  /** Type ******************************************************************/
393
 
396
  <p>
397
  <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
398
  <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Topic Type', 'bbpress' ); ?></label>
399
+ <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post->ID ) ); ?>
400
  </p>
401
 
402
  <?php
407
 
408
  <p>
409
  <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
410
+ <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" />
411
  <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', 'bbpress' ); ?></label>
412
+ <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post->ID ) ); ?>
413
  </p>
414
 
415
  <?php
418
 
419
  ?>
420
 
421
+ <hr />
422
+
423
  <p>
424
  <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
425
  <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label>
426
  <?php bbp_dropdown( array(
427
  'post_type' => bbp_get_forum_post_type(),
428
+ 'selected' => bbp_get_topic_forum_id( $post->ID ),
429
  'numberposts' => -1,
430
  'orderby' => 'title',
431
  'order' => 'ASC',
434
 
435
  // Output-related
436
  'select_id' => 'parent_id',
 
437
  'options_only' => false,
438
  'show_none' => __( '&mdash; No parent &mdash;', 'bbpress' ),
439
  'disable_categories' => current_user_can( 'edit_forums' ),
445
 
446
  <?php
447
  wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' );
448
+ do_action( 'bbp_topic_metabox', $post );
449
  }
450
 
451
  /** Replies *******************************************************************/
455
  *
456
  * The metabox that holds all of the additional reply information
457
  *
458
+ * @since 2.0.0 bbPress (r2464)
459
  *
460
  * @uses bbp_get_topic_post_type() To get the topic post type
461
  * @uses do_action() Calls 'bbp_reply_metabox'
462
  */
463
+ function bbp_reply_metabox( $post ) {
 
 
 
464
 
465
  // Get some meta
466
+ $reply_topic_id = bbp_get_reply_topic_id( $post->ID );
467
+ $reply_forum_id = bbp_get_reply_forum_id( $post->ID );
468
+ $topic_forum_id = bbp_get_topic_forum_id( $reply_topic_id );
469
+
470
+ /** Status ****************************************************************/
471
+
472
+ ?>
473
+
474
+ <p>
475
+ <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
476
+ <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" />
477
+ <label class="screen-reader-text" for="post_status"><?php esc_html_e( 'Select what status to give the reply.', 'bbpress' ); ?></label>
478
+ <?php bbp_form_reply_status_dropdown( array( 'select_id' => 'post_status', 'reply_id' => $post->ID ) ); ?>
479
+ </p>
480
+
481
+ <hr />
482
+
483
+ <?php
484
 
485
+ /** Forum *****************************************************************/
486
+
487
+ // Only allow individual manipulation of reply forum if there is a mismatch
488
+ if ( ( $reply_forum_id !== $topic_forum_id ) && ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $post->ID ) ) ) : ?>
489
 
490
  <p>
491
  <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
501
 
502
  // Output-related
503
  'select_id' => 'bbp_forum_id',
 
504
  'options_only' => false,
505
+ 'show_none' => __( '&mdash; No reply &mdash;', 'bbpress' ),
506
  'disable_categories' => current_user_can( 'edit_forums' ),
507
  'disabled' => ''
508
  ) ); ?>
509
  </p>
510
 
511
+ <?php endif;
512
+
513
+ /** Topic *****************************************************************/
514
+
515
+ ?>
516
 
517
  <p>
518
  <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong>
519
  <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label>
520
+ <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ), 'bbp_suggest_topic_nonce' ) ); ?>" />
521
  </p>
522
 
523
+ <?php
524
+
525
+ /** Reply To **************************************************************/
526
+
527
+ // Only show reply-to drop-down when editing an existing reply
528
+ if ( ! empty( $reply_topic_id ) ) : ?>
529
+
530
+ <p>
531
+ <strong class="label"><?php esc_html_e( 'Reply To:', 'bbpress' ); ?></strong>
532
+ <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', 'bbpress' ); ?></label>
533
+ <?php bbp_reply_to_dropdown( $post->ID ); ?>
534
+ </p>
535
+
536
+ <?php
537
+
538
+ endif;
539
+
540
+ ?>
541
 
542
  <input name="ping_status" type="hidden" id="ping_status" value="open" />
543
 
544
  <?php
545
  wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
546
+ do_action( 'bbp_reply_metabox', $post );
547
+ }
548
+
549
+ /**
550
+ * Output the topic replies metabox
551
+ *
552
+ * @since 2.6.0 bbPress (r5886)
553
+ *
554
+ * @param type $topic
555
+ *
556
+ * @return type
557
+ */
558
+ function bbp_topic_replies_metabox( $topic = false ) {
559
+
560
+ // Bail if no topic to load replies for
561
+ if ( empty( $topic ) ) {
562
+ return;
563
+ }
564
+
565
+ // Pull in the list table class
566
+ if ( ! class_exists( 'BBP_Topic_Replies_List_Table' ) ) {
567
+ require_once bbpress()->admin->admin_dir . '/list-tables/topic-replies.php';
568
+ }
569
+
570
+ // Look for pagination value
571
+ $page = isset( $_REQUEST['page'] )
572
+ ? (int) $_REQUEST['page']
573
+ : 0;
574
+
575
+ // Load up the list table
576
+ $replies_list_table = new BBP_Topic_Replies_List_Table();
577
+ $replies_list_table->prepare_items( $topic->ID ); ?>
578
+
579
+ <form id="bbp-topic-replies" method="get">
580
+ <input type="hidden" name="page" value="<?php echo esc_attr( $page ); ?>" />
581
+
582
+ <?php $replies_list_table->display(); ?>
583
+ </form>
584
+
585
+ <?php
586
  }
587
 
588
  /** Users *********************************************************************/
590
  /**
591
  * Anonymous user information metabox
592
  *
593
+ * @since 2.0.0 bbPress (r2828)
594
  *
595
+ * @param WP_Post $post The current post object
596
  * @uses bbp_is_reply_anonymous() To check if reply is anonymous
597
  * @uses bbp_is_topic_anonymous() To check if topic is anonymous
 
598
  * @uses get_post_meta() To get the author user information
599
  */
600
+ function bbp_author_metabox( $post ) {
 
 
 
601
 
602
  // Show extra bits if topic/reply is anonymous
603
+ if ( bbp_is_reply_anonymous( $post->ID ) || bbp_is_topic_anonymous( $post->ID ) ) : ?>
604
 
605
  <p>
606
  <strong class="label"><?php esc_html_e( 'Name:', 'bbpress' ); ?></strong>
607
  <label class="screen-reader-text" for="bbp_anonymous_name"><?php esc_html_e( 'Name', 'bbpress' ); ?></label>
608
+ <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo esc_attr( get_post_meta( $post->ID, '_bbp_anonymous_name', true ) ); ?>" />
609
  </p>
610
 
611
  <p>
612
  <strong class="label"><?php esc_html_e( 'Email:', 'bbpress' ); ?></strong>
613
  <label class="screen-reader-text" for="bbp_anonymous_email"><?php esc_html_e( 'Email', 'bbpress' ); ?></label>
614
+ <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo esc_attr( get_post_meta( $post->ID, '_bbp_anonymous_email', true ) ); ?>" />
615
  </p>
616
 
617
  <p>
618
  <strong class="label"><?php esc_html_e( 'Website:', 'bbpress' ); ?></strong>
619
  <label class="screen-reader-text" for="bbp_anonymous_website"><?php esc_html_e( 'Website', 'bbpress' ); ?></label>
620
+ <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo esc_attr( get_post_meta( $post->ID, '_bbp_anonymous_website', true ) ); ?>" />
621
  </p>
622
 
623
  <?php else : ?>
625
  <p>
626
  <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong>
627
  <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label>
628
+ <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative' ) ), 'bbp_suggest_user_nonce' ) ); ?>" />
629
  </p>
630
 
631
  <?php endif; ?>
633
  <p>
634
  <strong class="label"><?php esc_html_e( 'IP:', 'bbpress' ); ?></strong>
635
  <label class="screen-reader-text" for="bbp_author_ip_address"><?php esc_html_e( 'IP Address', 'bbpress' ); ?></label>
636
+ <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo esc_attr( get_post_meta( $post->ID, '_bbp_author_ip', true ) ); ?>" disabled="disabled" />
637
  </p>
638
 
639
  <?php
640
 
641
+ do_action( 'bbp_author_metabox', $post );
642
+ }
643
+
644
+ /**
645
+ * Moderator assignment metabox
646
+ *
647
+ * @since 2.6.0 bbPress (r2828)
648
+ *
649
+ * @uses get_the_ID() To get the global post ID
650
+ * @uses get_post_meta() To get the author user information
651
+ */
652
+ function bbp_moderator_assignment_metabox( $post ) {
653
+
654
+ // Get nicenames
655
+ $user_ids = bbp_get_moderator_ids( $post->ID );
656
+ $user_nicenames = bbp_get_user_nicenames_from_ids( $user_ids );
657
+ $moderators = ! empty( $user_nicenames )
658
+ ? implode( ', ', array_map( 'esc_attr', $user_nicenames ) )
659
+ : ''; ?>
660
+
661
+ <p>
662
+ <label class="screen-reader-text" for="bbp_moderators"><?php esc_html_e( 'Moderators', 'bbpress' ); ?></label>
663
+ <input type="text" id="bbp_moderators" name="bbp_moderators" value="<?php echo esc_attr( $moderators ); ?>" />
664
+ </p>
665
+
666
+ <?php
667
+
668
+ do_action( 'bbp_moderator_assignment_metabox', $post );
669
+ }
670
+
671
+ /**
672
+ * See who marked a topic as a favorite
673
+ *
674
+ * @since 2.6.0 bbPress (r6197)
675
+ */
676
+ function bbp_topic_favorites_metabox( $post ) {
677
+
678
+ // Get user IDs
679
+ $user_ids = bbp_get_topic_favoriters( $post->ID );
680
+
681
+ // Output
682
+ ?><p><?php
683
+
684
+ // Users were found
685
+ if ( ! empty( $user_ids ) ) :
686
+
687
+ foreach ( $user_ids as $user_id ) :
688
+ echo get_avatar( $user_id, 32 );
689
+ endforeach;
690
+
691
+ // No users
692
+ else :
693
+ esc_html_e( 'No users have favorited this topic.', 'bbpress' );
694
+ endif;
695
+
696
+ ?></p><?php
697
+
698
+ do_action( 'bbp_favorites_metabox', $post );
699
+ }
700
+
701
+ /**
702
+ * See who subscribed to a topic
703
+ *
704
+ * @since 2.6.0 bbPress (r6197)
705
+ */
706
+ function bbp_topic_subscriptions_metabox( $post ) {
707
+
708
+ // Get user IDs
709
+ $user_ids = bbp_get_topic_subscribers( $post->ID );
710
+
711
+ // Output
712
+ ?><p><?php
713
+
714
+ // Users were found
715
+ if ( ! empty( $user_ids ) ) :
716
+
717
+ foreach ( $user_ids as $user_id ) :
718
+ echo get_avatar( $user_id, 32 );
719
+ endforeach;
720
+
721
+ // No users
722
+ else :
723
+ esc_html_e( 'No users have subscribed to this topic.', 'bbpress' );
724
+ endif;
725
+
726
+ ?></p><?php
727
+
728
+ do_action( 'bbp_subscriptions_metabox', $post );
729
+ }
730
+
731
+ /**
732
+ * See who subscribed to a forum
733
+ *
734
+ * @since 2.6.0 bbPress (r6197)
735
+ */
736
+ function bbp_forum_subscriptions_metabox( $post ) {
737
+
738
+ // Get user IDs
739
+ $user_ids = bbp_get_forum_subscribers( $post->ID );
740
+
741
+ // Output
742
+ ?><p><?php
743
+
744
+ // Users were found
745
+ if ( ! empty( $user_ids ) ) :
746
+
747
+ foreach ( $user_ids as $user_id ) :
748
+ echo get_avatar( $user_id, 32 );
749
+ endforeach;
750
+
751
+ // No users
752
+ else :
753
+ esc_html_e( 'No users have subscribed to this forum.', 'bbpress' );
754
+ endif;
755
+
756
+ ?></p><?php
757
+
758
+ do_action( 'bbp_forum_subscriptions_metabox', $post );
759
  }
includes/admin/parser.php CHANGED
@@ -1,4 +1,12 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  /*
3
  This is a compressed copy of NBBC. Do not edit!
4
 
@@ -80,7 +88,7 @@ var $pat_main;
80
  var $pat_comment;
81
  var $pat_comment2;
82
  var $pat_wiki;
83
- function BBCodeLexer($string, $tagmarker = '[') {
84
  $regex_beginmarkers = Array( '[' => '\[', '<' => '<', '{' => '\{', '(' => '\(' );
85
  $regex_endmarkers = Array( '[' => '\]', '<' => '>', '{' => '\}', '(' => '\)' );
86
  $endmarkers = Array( '[' => ']', '<' => '>', '{' => '}', '(' => ')' );
@@ -114,6 +122,9 @@ $this->token = BBCODE_EOI;
114
  $this->tag = false;
115
  $this->text = "";
116
  }
 
 
 
117
  function GuessTextLength() {
118
  $length = 0;
119
  $ptr = 0;
@@ -1146,12 +1157,18 @@ return preg_replace("/\\x0A|\\x0D|\\x0A\\x0D|\\x0D\\x0A/", "<br />\n", $string);
1146
  function UnHTMLEncode($string) {
1147
  if (function_exists("html_entity_decode"))
1148
  return html_entity_decode($string);
1149
- $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
1150
- $string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string);
1151
  $trans_tbl = get_html_translation_table(HTML_ENTITIES);
1152
  $trans_tbl = array_flip($trans_tbl);
1153
  return strtr($string, $trans_tbl);
1154
  }
 
 
 
 
 
 
1155
  function Wikify($string) {
1156
  return rawurlencode(str_replace(" ", "_",
1157
  trim(preg_replace("/[!?;@#\$%\\^&*<>=+`~\\x00-\\x20_-]+/", " ", $string))));
@@ -1383,7 +1400,7 @@ if (isset($insert_array[$matches[1]]))
1383
  $value = @$insert_array[$matches[1]];
1384
  else $value = @$default_array[$matches[1]];
1385
  if (strlen(@$matches[2])) {
1386
- foreach (split(".", substr($matches[2], 1)) as $index) {
1387
  if (is_array($value))
1388
  $value = @$value[$index];
1389
  else if (is_object($value)) {
1
  <?php
2
+
3
+ /**
4
+ * bbPress BBCode Parser
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Administration
8
+ */
9
+
10
  /*
11
  This is a compressed copy of NBBC. Do not edit!
12
 
88
  var $pat_comment;
89
  var $pat_comment2;
90
  var $pat_wiki;
91
+ function __construct($string, $tagmarker = '[') {
92
  $regex_beginmarkers = Array( '[' => '\[', '<' => '<', '{' => '\{', '(' => '\(' );
93
  $regex_endmarkers = Array( '[' => '\]', '<' => '>', '{' => '\}', '(' => '\)' );
94
  $endmarkers = Array( '[' => ']', '<' => '>', '{' => '}', '(' => ')' );
122
  $this->tag = false;
123
  $this->text = "";
124
  }
125
+ function BBCodeLexer($string, $tagmarker = '[') {
126
+ $this->__construct($string, $tagmarker);
127
+ }
128
  function GuessTextLength() {
129
  $length = 0;
130
  $ptr = 0;
1157
  function UnHTMLEncode($string) {
1158
  if (function_exists("html_entity_decode"))
1159
  return html_entity_decode($string);
1160
+ $string = preg_replace_callback('~&#x([0-9a-f]+);~i', array( $this, '_UnHTMLEncode_chr_callback'), $string);
1161
+ $string = preg_replace_callback('~&#([0-9]+);~', array($this, '_UnHTMLEncode_chr_hexdec_callback'), $string);
1162
  $trans_tbl = get_html_translation_table(HTML_ENTITIES);
1163
  $trans_tbl = array_flip($trans_tbl);
1164
  return strtr($string, $trans_tbl);
1165
  }
1166
+ function _UnHTMLEncode_chr_callback($match) {
1167
+ return chr(hexdec($match[1]));
1168
+ }
1169
+ function _UnHTMLEncode_chr_hexdec_callback($match) {
1170
+ return chr(hexdec($match[1]));
1171
+ }
1172
  function Wikify($string) {
1173
  return rawurlencode(str_replace(" ", "_",
1174
  trim(preg_replace("/[!?;@#\$%\\^&*<>=+`~\\x00-\\x20_-]+/", " ", $string))));
1400
  $value = @$insert_array[$matches[1]];
1401
  else $value = @$default_array[$matches[1]];
1402
  if (strlen(@$matches[2])) {
1403
+ foreach (explode(".", substr($matches[2], 1)) as $index) {
1404
  if (is_array($value))
1405
  $value = @$value[$index];
1406
  else if (is_object($value)) {
includes/admin/replies.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Replies_Admin' ) ) :
14
  /**
@@ -16,7 +16,7 @@ if ( !class_exists( 'BBP_Replies_Admin' ) ) :
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
- * @since bbPress (r2464)
20
  */
21
  class BBP_Replies_Admin {
22
 
@@ -32,7 +32,7 @@ class BBP_Replies_Admin {
32
  /**
33
  * The main bbPress admin loader
34
  *
35
- * @since bbPress (r2515)
36
  *
37
  * @uses BBP_Replies_Admin::setup_globals() Setup the globals needed
38
  * @uses BBP_Replies_Admin::setup_actions() Setup the hooks and actions
@@ -46,7 +46,9 @@ class BBP_Replies_Admin {
46
  /**
47
  * Setup the admin hooks, actions and filters
48
  *
49
- * @since bbPress (r2646)
 
 
50
  * @access private
51
  *
52
  * @uses add_action() To add various actions
@@ -63,6 +65,13 @@ class BBP_Replies_Admin {
63
  // Messages
64
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
65
 
 
 
 
 
 
 
 
66
  // Reply column headers.
67
  add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
68
 
@@ -71,16 +80,15 @@ class BBP_Replies_Admin {
71
  add_filter( 'post_row_actions', array( $this, 'row_actions' ), 10, 2 );
72
 
73
  // Reply metabox actions
74
- add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
75
- add_action( 'save_post', array( $this, 'attributes_metabox_save' ) );
 
 
76
 
77
  // Check if there are any bbp_toggle_reply_* requests on admin_init, also have a message displayed
78
  add_action( 'load-edit.php', array( $this, 'toggle_reply' ) );
79
  add_action( 'admin_notices', array( $this, 'toggle_reply_notice' ) );
80
 
81
- // Anonymous metabox actions
82
- add_action( 'add_meta_boxes', array( $this, 'author_metabox' ) );
83
-
84
  // Add ability to filter topics and replies per forum
85
  add_filter( 'restrict_manage_posts', array( $this, 'filter_dropdown' ) );
86
  add_filter( 'bbp_request', array( $this, 'filter_post_rows' ) );
@@ -91,23 +99,11 @@ class BBP_Replies_Admin {
91
  add_action( 'load-post-new.php', array( $this, 'new_help' ) );
92
  }
93
 
94
- /**
95
- * Should we bail out of this method?
96
- *
97
- * @since bbPress (r4067)
98
- * @return boolean
99
- */
100
- private function bail() {
101
- if ( !isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) )
102
- return true;
103
-
104
- return false;
105
- }
106
-
107
  /**
108
  * Admin globals
109
  *
110
- * @since bbPress (r2646)
 
111
  * @access private
112
  */
113
  private function setup_globals() {
@@ -119,13 +115,12 @@ class BBP_Replies_Admin {
119
  /**
120
  * Contextual help for bbPress reply edit page
121
  *
122
- * @since bbPress (r3119)
 
123
  * @uses get_current_screen()
124
  */
125
  public function edit_help() {
126
 
127
- if ( $this->bail() ) return;
128
-
129
  // Overview
130
  get_current_screen()->add_help_tab( array(
131
  'id' => 'overview',
@@ -141,10 +136,10 @@ class BBP_Replies_Admin {
141
  'content' =>
142
  '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:', 'bbpress' ) . '</p>' .
143
  '<ul>' .
144
- '<li>' . __( 'You can hide/display columns based on your needs and decide how many replies to list per screen using the Screen Options tab.', 'bbpress' ) . '</li>' .
145
- '<li>' . __( 'You can filter the list of replies by reply status using the text links in the upper left to show All, Published, Draft, or Trashed replies. The default view is to show all replies.', 'bbpress' ) . '</li>' .
146
- '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.', 'bbpress' ) . '</li>' .
147
- '<li>' . __( 'You can refine the list to show only replies in a specific category or from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection. You also can refine the list by clicking on the reply author, category or tag in the replies list.', 'bbpress' ) . '</li>' .
148
  '</ul>'
149
  ) );
150
 
@@ -155,11 +150,12 @@ class BBP_Replies_Admin {
155
  'content' =>
156
  '<p>' . __( 'Hovering over a row in the replies list will display action links that allow you to manage your reply. You can perform the following actions:', 'bbpress' ) . '</p>' .
157
  '<ul>' .
158
- '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that reply. You can also reach that screen by clicking on the reply title.', 'bbpress' ) . '</li>' .
159
- //'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your reply, allowing you to update reply details without leaving this screen.', 'bbpress' ) . '</li>' .
160
- '<li>' . __( '<strong>Trash</strong> removes your reply from this list and places it in the trash, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
161
- '<li>' . __( '<strong>Spam</strong> removes your reply from this list and places it in the spam queue, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
162
- '<li>' . __( '<strong>Preview</strong> will show you what your draft reply will look like if you publish it. View will take you to your live site to view the reply. Which link is available depends on your reply&#8217;s status.', 'bbpress' ) . '</li>' .
 
163
  '</ul>'
164
  ) );
165
 
@@ -168,28 +164,27 @@ class BBP_Replies_Admin {
168
  'id' => 'bulk-actions',
169
  'title' => __( 'Bulk Actions', 'bbpress' ),
170
  'content' =>
171
- '<p>' . __( 'You can also edit or move multiple replies to the trash at once. Select the replies you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.', 'bbpress' ) . '</p>' .
172
  '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected replies at once. To remove a reply from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' ) . '</p>'
173
  ) );
174
 
175
  // Help Sidebar
176
  get_current_screen()->set_help_sidebar(
177
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
178
- '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
179
- '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
180
  );
181
  }
182
 
183
  /**
184
  * Contextual help for bbPress reply edit page
185
  *
186
- * @since bbPress (r3119)
 
187
  * @uses get_current_screen()
188
  */
189
  public function new_help() {
190
 
191
- if ( $this->bail() ) return;
192
-
193
  $customize_display = '<p>' . __( 'The title field and the big reply editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
194
 
195
  get_current_screen()->add_help_tab( array(
@@ -232,25 +227,120 @@ class BBP_Replies_Admin {
232
 
233
  get_current_screen()->set_help_sidebar(
234
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
235
- '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
236
- '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
237
  );
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  /**
241
  * Add the reply attributes metabox
242
  *
243
- * @since bbPress (r2746)
244
  *
245
  * @uses bbp_get_reply_post_type() To get the reply post type
246
  * @uses add_meta_box() To add the metabox
247
  * @uses do_action() Calls 'bbp_reply_attributes_metabox'
248
  */
249
  public function attributes_metabox() {
250
-
251
- if ( $this->bail() ) return;
252
-
253
- add_meta_box (
254
  'bbp_reply_attributes',
255
  __( 'Reply Attributes', 'bbpress' ),
256
  'bbp_reply_metabox',
@@ -258,14 +348,55 @@ class BBP_Replies_Admin {
258
  'side',
259
  'high'
260
  );
 
261
 
262
- do_action( 'bbp_reply_attributes_metabox' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  }
264
 
265
  /**
266
  * Pass the reply attributes for processing
267
  *
268
- * @since bbPress (r2746)
269
  *
270
  * @param int $reply_id Reply id
271
  * @uses current_user_can() To check if the current user is capable of
@@ -274,39 +405,42 @@ class BBP_Replies_Admin {
274
  * reply id and parent id
275
  * @return int Parent id
276
  */
277
- public function attributes_metabox_save( $reply_id ) {
278
-
279
- if ( $this->bail() ) return $reply_id;
280
 
281
  // Bail if doing an autosave
282
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
283
  return $reply_id;
 
284
 
285
  // Bail if not a post request
286
- if ( ! bbp_is_post_request() )
287
  return $reply_id;
 
288
 
289
  // Check action exists
290
- if ( empty( $_POST['action'] ) )
291
  return $reply_id;
 
292
 
293
  // Nonce check
294
- if ( empty( $_POST['bbp_reply_metabox'] ) || !wp_verify_nonce( $_POST['bbp_reply_metabox'], 'bbp_reply_metabox_save' ) )
295
  return $reply_id;
 
296
 
297
  // Current user cannot edit this reply
298
- if ( !current_user_can( 'edit_reply', $reply_id ) )
299
  return $reply_id;
 
300
 
301
  // Get the reply meta post values
302
- $topic_id = !empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0;
303
- $forum_id = !empty( $_POST['bbp_forum_id'] ) ? (int) $_POST['bbp_forum_id'] : bbp_get_topic_forum_id( $topic_id );
304
- $reply_to = !empty( $_POST['bbp_reply_to'] ) ? (int) $_POST['bbp_reply_to'] : 0;
305
 
306
  // Get reply author data
307
  $anonymous_data = bbp_filter_anonymous_post_data();
308
  $author_id = bbp_get_reply_author_id( $reply_id );
309
- $is_edit = (bool) isset( $_POST['save'] );
310
 
311
  // Formally update the reply
312
  bbp_update_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit, $reply_to );
@@ -318,46 +452,10 @@ class BBP_Replies_Admin {
318
  return $reply_id;
319
  }
320
 
321
- /**
322
- * Add the author info metabox
323
- *
324
- * Allows editing of information about an author
325
- *
326
- * @since bbPress (r2828)
327
- *
328
- * @uses bbp_get_topic() To get the topic
329
- * @uses bbp_get_reply() To get the reply
330
- * @uses bbp_get_topic_post_type() To get the topic post type
331
- * @uses bbp_get_reply_post_type() To get the reply post type
332
- * @uses add_meta_box() To add the metabox
333
- * @uses do_action() Calls 'bbp_author_metabox' with the topic/reply
334
- * id
335
- */
336
- public function author_metabox() {
337
-
338
- if ( $this->bail() ) return;
339
-
340
- // Bail if post_type is not a reply
341
- if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) )
342
- return;
343
-
344
- // Add the metabox
345
- add_meta_box(
346
- 'bbp_author_metabox',
347
- __( 'Author Information', 'bbpress' ),
348
- 'bbp_author_metabox',
349
- $this->post_type,
350
- 'side',
351
- 'high'
352
- );
353
-
354
- do_action( 'bbp_author_metabox', get_the_ID() );
355
- }
356
-
357
  /**
358
  * Add some general styling to the admin area
359
  *
360
- * @since bbPress (r2464)
361
  *
362
  * @uses bbp_get_forum_post_type() To get the forum post type
363
  * @uses bbp_get_topic_post_type() To get the topic post type
@@ -366,9 +464,6 @@ class BBP_Replies_Admin {
366
  * @uses do_action() Calls 'bbp_admin_head'
367
  */
368
  public function admin_head() {
369
-
370
- if ( $this->bail() ) return;
371
-
372
  ?>
373
 
374
  <style type="text/css" media="screen">
@@ -417,6 +512,10 @@ class BBP_Replies_Admin {
417
  background-color: #faeaea;
418
  }
419
 
 
 
 
 
420
  /*]]>*/
421
  </style>
422
 
@@ -428,7 +527,7 @@ class BBP_Replies_Admin {
428
  *
429
  * Handles the admin-side spamming/unspamming of replies
430
  *
431
- * @since bbPress (r2740)
432
  *
433
  * @uses bbp_get_reply() To get the reply
434
  * @uses current_user_can() To check if the user is capable of editing
@@ -442,14 +541,12 @@ class BBP_Replies_Admin {
442
  * @uses do_action() Calls 'bbp_toggle_reply_admin' with success, post
443
  * data, action and message
444
  * @uses add_query_arg() To add custom args to the url
445
- * @uses wp_safe_redirect() Redirect the page to custom url
446
  */
447
  public function toggle_reply() {
448
 
449
- if ( $this->bail() ) return;
450
-
451
  // Only proceed if GET is a reply toggle action
452
- if ( bbp_is_get_request() && !empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_reply_spam' ) ) && !empty( $_GET['reply_id'] ) ) {
453
  $action = $_GET['action']; // What action is taking place?
454
  $reply_id = (int) $_GET['reply_id']; // What's the reply id?
455
  $success = false; // Flag
@@ -457,13 +554,25 @@ class BBP_Replies_Admin {
457
 
458
  // Get reply and die if empty
459
  $reply = bbp_get_reply( $reply_id );
460
- if ( empty( $reply ) ) // Which reply?
461
- wp_die( __( 'The reply was not found!', 'bbpress' ) );
 
462
 
463
- if ( !current_user_can( 'moderate', $reply->ID ) ) // What is the user doing here?
464
- wp_die( __( 'You do not have the permission to do that!', 'bbpress' ) );
 
 
465
 
466
  switch ( $action ) {
 
 
 
 
 
 
 
 
 
467
  case 'bbp_toggle_reply_spam' :
468
  check_admin_referer( 'spam-reply_' . $reply_id );
469
 
@@ -474,21 +583,18 @@ class BBP_Replies_Admin {
474
  break;
475
  }
476
 
477
- $success = wp_update_post( $post_data );
478
  $message = array( 'bbp_reply_toggle_notice' => $message, 'reply_id' => $reply->ID );
479
 
480
- if ( false === $success || is_wp_error( $success ) )
481
  $message['failed'] = '1';
 
482
 
483
  // Do additional reply toggle actions (admin side)
484
  do_action( 'bbp_toggle_reply_admin', $success, $post_data, $action, $message );
485
 
486
  // Redirect back to the reply
487
  $redirect = add_query_arg( $message, remove_query_arg( array( 'action', 'reply_id' ) ) );
488
- wp_safe_redirect( $redirect );
489
-
490
- // For good measure
491
- exit();
492
  }
493
  }
494
 
@@ -498,7 +604,7 @@ class BBP_Replies_Admin {
498
  * Display the success/error notices from
499
  * {@link BBP_Admin::toggle_reply()}
500
  *
501
- * @since bbPress (r2740)
502
  *
503
  * @uses bbp_get_reply() To get the reply
504
  * @uses bbp_get_reply_title() To get the reply title of the reply
@@ -508,32 +614,48 @@ class BBP_Replies_Admin {
508
  */
509
  public function toggle_reply_notice() {
510
 
511
- if ( $this->bail() ) return;
512
-
513
  // Only proceed if GET is a reply toggle action
514
- if ( bbp_is_get_request() && !empty( $_GET['bbp_reply_toggle_notice'] ) && in_array( $_GET['bbp_reply_toggle_notice'], array( 'spammed', 'unspammed' ) ) && !empty( $_GET['reply_id'] ) ) {
515
  $notice = $_GET['bbp_reply_toggle_notice']; // Which notice?
516
  $reply_id = (int) $_GET['reply_id']; // What's the reply id?
517
- $is_failure = !empty( $_GET['failed'] ) ? true : false; // Was that a failure?
518
 
519
  // Empty? No reply?
520
- if ( empty( $notice ) || empty( $reply_id ) )
521
  return;
 
522
 
523
  // Get reply and bail if empty
524
  $reply = bbp_get_reply( $reply_id );
525
- if ( empty( $reply ) )
526
  return;
 
527
 
528
  $reply_title = bbp_get_reply_title( $reply->ID );
529
 
530
  switch ( $notice ) {
531
  case 'spammed' :
532
- $message = $is_failure === true ? sprintf( __( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) : sprintf( __( 'Reply "%1$s" successfully marked as spam.', 'bbpress' ), $reply_title );
 
 
533
  break;
534
 
535
  case 'unspammed' :
536
- $message = $is_failure === true ? sprintf( __( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) : sprintf( __( 'Reply "%1$s" successfully unmarked as spam.', 'bbpress' ), $reply_title );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  break;
538
  }
539
 
@@ -553,7 +675,7 @@ class BBP_Replies_Admin {
553
  /**
554
  * Manage the column headers for the replies page
555
  *
556
- * @since bbPress (r2577)
557
  *
558
  * @param array $columns The columns
559
  * @uses apply_filters() Calls 'bbp_admin_replies_column_headers' with
@@ -561,9 +683,6 @@ class BBP_Replies_Admin {
561
  * @return array $columns bbPress reply columns
562
  */
563
  public function column_headers( $columns ) {
564
-
565
- if ( $this->bail() ) return $columns;
566
-
567
  $columns = array(
568
  'cb' => '<input type="checkbox" />',
569
  'title' => __( 'Title', 'bbpress' ),
@@ -579,7 +698,7 @@ class BBP_Replies_Admin {
579
  /**
580
  * Print extra columns for the replies page
581
  *
582
- * @since bbPress (r2577)
583
  *
584
  * @param string $column Column
585
  * @param int $reply_id reply id
@@ -605,8 +724,6 @@ class BBP_Replies_Admin {
605
  */
606
  public function column_data( $column, $reply_id ) {
607
 
608
- if ( $this->bail() ) return;
609
-
610
  // Get topic ID
611
  $topic_id = bbp_get_reply_topic_id( $reply_id );
612
 
@@ -617,7 +734,7 @@ class BBP_Replies_Admin {
617
  case 'bbp_reply_topic' :
618
 
619
  // Output forum name
620
- if ( !empty( $topic_id ) ) {
621
 
622
  // Topic Title
623
  $topic_title = bbp_get_topic_title( $topic_id );
@@ -643,7 +760,7 @@ class BBP_Replies_Admin {
643
  $topic_forum_id = bbp_get_topic_forum_id( $topic_id );
644
 
645
  // Output forum name
646
- if ( !empty( $reply_forum_id ) ) {
647
 
648
  // Forum Title
649
  $forum_title = bbp_get_forum_title( $reply_forum_id );
@@ -653,7 +770,7 @@ class BBP_Replies_Admin {
653
 
654
  // Alert capable users of reply forum mismatch
655
  if ( $reply_forum_id !== $topic_forum_id ) {
656
- if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) {
657
  $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>';
658
  }
659
  }
@@ -697,13 +814,13 @@ class BBP_Replies_Admin {
697
  * Remove the quick-edit action link under the reply title and add the
698
  * content and spam link
699
  *
700
- * @since bbPress (r2577)
701
  *
702
  * @param array $actions Actions
703
  * @param array $reply Reply object
704
  * @uses bbp_get_reply_post_type() To get the reply post type
705
  * @uses bbp_reply_content() To output reply content
706
- * @uses bbp_get_reply_permalink() To get the reply link
707
  * @uses bbp_get_reply_title() To get the reply title
708
  * @uses current_user_can() To check if the current user can edit or
709
  * delete the reply
@@ -717,20 +834,29 @@ class BBP_Replies_Admin {
717
  */
718
  public function row_actions( $actions, $reply ) {
719
 
720
- if ( $this->bail() ) return $actions;
721
-
722
  unset( $actions['inline hide-if-no-js'] );
723
 
724
  // Reply view links to topic
725
  $actions['view'] = '<a href="' . esc_url( bbp_get_reply_url( $reply->ID ) ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
726
 
727
  // User cannot view replies in trash
728
- if ( ( bbp_get_trash_status_id() === $reply->post_status ) && !current_user_can( 'view_trash' ) )
729
  unset( $actions['view'] );
 
730
 
731
  // Only show the actions if the user is capable of viewing them
732
  if ( current_user_can( 'moderate', $reply->ID ) ) {
733
- if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_spam_status_id() ) ) ) {
 
 
 
 
 
 
 
 
 
 
734
  $spam_uri = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_' . $reply->ID );
735
  if ( bbp_is_reply_spam( $reply->ID ) ) {
736
  $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
@@ -762,7 +888,7 @@ class BBP_Replies_Admin {
762
  /**
763
  * Add forum dropdown to topic and reply list table filters
764
  *
765
- * @since bbPress (r2991)
766
  *
767
  * @uses bbp_get_reply_post_type() To get the reply post type
768
  * @uses bbp_get_topic_post_type() To get the topic post type
@@ -771,17 +897,21 @@ class BBP_Replies_Admin {
771
  */
772
  public function filter_dropdown() {
773
 
774
- if ( $this->bail() ) return;
775
-
776
- // Add Empty Spam button
777
- if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
778
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
779
- $title = esc_attr__( 'Empty Spam', 'bbpress' );
780
- submit_button( $title, 'button-secondary apply', 'delete_all', false );
 
 
 
 
781
  }
782
 
783
  // Get which forum is selected
784
- $selected = !empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : '';
 
 
785
 
786
  // Show the forums dropdown
787
  bbp_dropdown( array(
@@ -793,7 +923,7 @@ class BBP_Replies_Admin {
793
  /**
794
  * Adjust the request query and include the forum id
795
  *
796
- * @since bbPress (r2991)
797
  *
798
  * @param array $query_vars Query variables from {@link WP_Query}
799
  * @uses is_admin() To check if it's the admin section
@@ -803,11 +933,10 @@ class BBP_Replies_Admin {
803
  */
804
  public function filter_post_rows( $query_vars ) {
805
 
806
- if ( $this->bail() ) return $query_vars;
807
-
808
  // Add post_parent query_var if one is present
809
- if ( !empty( $_GET['bbp_forum_id'] ) ) {
810
  $query_vars['meta_key'] = '_bbp_forum_id';
 
811
  $query_vars['meta_value'] = $_GET['bbp_forum_id'];
812
  }
813
 
@@ -818,7 +947,7 @@ class BBP_Replies_Admin {
818
  /**
819
  * Custom user feedback messages for reply post type
820
  *
821
- * @since bbPress (r3080)
822
  *
823
  * @global int $post_ID
824
  * @uses bbp_get_topic_permalink()
@@ -833,8 +962,6 @@ class BBP_Replies_Admin {
833
  public function updated_messages( $messages ) {
834
  global $post_ID;
835
 
836
- if ( $this->bail() ) return $messages;
837
-
838
  // URL for the current topic
839
  $topic_url = bbp_get_topic_permalink( bbp_get_reply_topic_id( $post_ID ) );
840
 
@@ -842,11 +969,16 @@ class BBP_Replies_Admin {
842
  $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
843
 
844
  // Messages array
845
- $messages[$this->post_type] = array(
846
  0 => '', // Left empty on purpose
847
 
848
  // Updated
849
- 1 => sprintf( __( 'Reply updated. <a href="%s">View topic</a>', 'bbpress' ), $topic_url ),
 
 
 
 
 
850
 
851
  // Custom field updated
852
  2 => __( 'Custom field updated.', 'bbpress' ),
@@ -864,23 +996,43 @@ class BBP_Replies_Admin {
864
  : false,
865
 
866
  // Reply created
867
- 6 => sprintf( __( 'Reply created. <a href="%s">View topic</a>', 'bbpress' ), $topic_url ),
 
 
 
 
 
868
 
869
  // Reply saved
870
  7 => __( 'Reply saved.', 'bbpress' ),
871
 
872
  // Reply submitted
873
- 8 => sprintf( __( 'Reply submitted. <a target="_blank" href="%s">Preview topic</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $topic_url ) ) ),
 
 
 
 
 
874
 
875
  // Reply scheduled
876
- 9 => sprintf( __( 'Reply scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview topic</a>', 'bbpress' ),
 
 
 
877
  // translators: Publish box date format, see http://php.net/date
878
- date_i18n( __( 'M j, Y @ G:i', 'bbpress' ),
879
- strtotime( $post_date ) ),
880
- $topic_url ),
 
 
881
 
882
  // Reply draft updated
883
- 10 => sprintf( __( 'Reply draft updated. <a target="_blank" href="%s">Preview topic</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $topic_url ) ) ),
 
 
 
 
 
884
  );
885
 
886
  return $messages;
@@ -894,10 +1046,18 @@ endif; // class_exists check
894
  * This is currently here to make hooking and unhooking of the admin UI easy.
895
  * It could use dependency injection in the future, but for now this is easier.
896
  *
897
- * @since bbPress (r2596)
898
  *
 
899
  * @uses BBP_Replies_Admin
900
  */
901
- function bbp_admin_replies() {
 
 
 
 
 
 
 
902
  bbpress()->admin->replies = new BBP_Replies_Admin();
903
  }
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
  if ( !class_exists( 'BBP_Replies_Admin' ) ) :
14
  /**
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
+ * @since 2.0.0 bbPress (r2464)
20
  */
21
  class BBP_Replies_Admin {
22
 
32
  /**
33
  * The main bbPress admin loader
34
  *
35
+ * @since 2.0.0 bbPress (r2515)
36
  *
37
  * @uses BBP_Replies_Admin::setup_globals() Setup the globals needed
38
  * @uses BBP_Replies_Admin::setup_actions() Setup the hooks and actions
46
  /**
47
  * Setup the admin hooks, actions and filters
48
  *
49
+ * @since 2.0.0 bbPress (r2646)
50
+ * @since 2.6.0 bbPress (r6101) Added bulk actions
51
+ *
52
  * @access private
53
  *
54
  * @uses add_action() To add various actions
65
  // Messages
66
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
67
 
68
+ // Reply bulk actions, added in WordPress 4.7, see #WP16031
69
+ if ( bbp_get_major_wp_version() >= 4.7 ) {
70
+ add_filter( 'bulk_actions-edit-reply', array( $this, 'bulk_actions' ) );
71
+ add_filter( 'handle_bulk_actions-edit-reply', array( $this, 'handle_bulk_actions' ), 10, 3 );
72
+ add_filter( 'bulk_post_updated_messages', array( $this, 'bulk_post_updated_messages' ), 10, 2 );
73
+ }
74
+
75
  // Reply column headers.
76
  add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
77
 
80
  add_filter( 'post_row_actions', array( $this, 'row_actions' ), 10, 2 );
81
 
82
  // Reply metabox actions
83
+ add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
84
+ add_action( 'add_meta_boxes', array( $this, 'author_metabox' ) );
85
+ add_action( 'add_meta_boxes', array( $this, 'comments_metabox' ) );
86
+ add_action( 'save_post', array( $this, 'save_meta_boxes' ) );
87
 
88
  // Check if there are any bbp_toggle_reply_* requests on admin_init, also have a message displayed
89
  add_action( 'load-edit.php', array( $this, 'toggle_reply' ) );
90
  add_action( 'admin_notices', array( $this, 'toggle_reply_notice' ) );
91
 
 
 
 
92
  // Add ability to filter topics and replies per forum
93
  add_filter( 'restrict_manage_posts', array( $this, 'filter_dropdown' ) );
94
  add_filter( 'bbp_request', array( $this, 'filter_post_rows' ) );
99
  add_action( 'load-post-new.php', array( $this, 'new_help' ) );
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  /**
103
  * Admin globals
104
  *
105
+ * @since 2.0.0 bbPress (r2646)
106
+ *
107
  * @access private
108
  */
109
  private function setup_globals() {
115
  /**
116
  * Contextual help for bbPress reply edit page
117
  *
118
+ * @since 2.0.0 bbPress (r3119)
119
+ *
120
  * @uses get_current_screen()
121
  */
122
  public function edit_help() {
123
 
 
 
124
  // Overview
125
  get_current_screen()->add_help_tab( array(
126
  'id' => 'overview',
136
  'content' =>
137
  '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:', 'bbpress' ) . '</p>' .
138
  '<ul>' .
139
+ '<li>' . __( 'You can hide/display columns based on your needs and decide how many replies to list per screen using the Screen Options tab.', 'bbpress' ) . '</li>' .
140
+ '<li>' . __( 'You can filter the list of replies by reply status using the text links in the upper left to show All, Published, Draft, Pending, Trashed, or Spam replies. The default view is to show all replies.', 'bbpress' ) . '</li>' .
141
+ '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.', 'bbpress' ) . '</li>' .
142
+ '<li>' . __( 'You can refine the list to show only replies in a specific forum or from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection.', 'bbpress' ) . '</li>' .
143
  '</ul>'
144
  ) );
145
 
150
  'content' =>
151
  '<p>' . __( 'Hovering over a row in the replies list will display action links that allow you to manage your reply. You can perform the following actions:', 'bbpress' ) . '</p>' .
152
  '<ul>' .
153
+ '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that reply. You can also reach that screen by clicking on the reply title.', 'bbpress' ) . '</li>' .
154
+ //'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your reply, allowing you to update reply details without leaving this screen.', 'bbpress' ) . '</li>' .
155
+ '<li>' . __( '<strong>Trash</strong> removes your reply from this list and places it in the trash, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
156
+ '<li>' . __( '<strong>Spam</strong> removes your reply from this list and places it in the spam queue, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
157
+ '<li>' . __( '<strong>View</strong> will take you to your live site to view the reply.', 'bbpress' ) . '</li>' .
158
+ '<li>' . __( '<strong>Approve</strong> will change the status from pending to publish.', 'bbpress' ) . '</li>' .
159
  '</ul>'
160
  ) );
161
 
164
  'id' => 'bulk-actions',
165
  'title' => __( 'Bulk Actions', 'bbpress' ),
166
  'content' =>
167
+ '<p>' . __( 'You can also edit, spam, or move multiple replies to the trash at once. Select the replies you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.', 'bbpress' ) . '</p>' .
168
  '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected replies at once. To remove a reply from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' ) . '</p>'
169
  ) );
170
 
171
  // Help Sidebar
172
  get_current_screen()->set_help_sidebar(
173
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
174
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
175
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
176
  );
177
  }
178
 
179
  /**
180
  * Contextual help for bbPress reply edit page
181
  *
182
+ * @since 2.0.0 bbPress (r3119)
183
+ *
184
  * @uses get_current_screen()
185
  */
186
  public function new_help() {
187
 
 
 
188
  $customize_display = '<p>' . __( 'The title field and the big reply editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
189
 
190
  get_current_screen()->add_help_tab( array(
227
 
228
  get_current_screen()->set_help_sidebar(
229
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
230
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
231
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
232
  );
233
  }
234
 
235
+ /**
236
+ * Add spam/unspam bulk actions to the bulk action dropdown.
237
+ *
238
+ * @since 2.6.0 bbPress (r6101)
239
+ *
240
+ * @param array $actions The list of bulk actions.
241
+ * @return array The filtered list of bulk actions.
242
+ */
243
+ public function bulk_actions( $actions ) {
244
+
245
+ if ( current_user_can( 'moderate' ) ) {
246
+ if ( bbp_get_spam_status_id() === get_query_var( 'post_status' ) ) {
247
+ $actions['unspam'] = __( 'Unspam', 'bbpress' );
248
+ } else {
249
+ $actions['spam'] = __( 'Spam', 'bbpress' );
250
+ }
251
+ }
252
+
253
+ return $actions;
254
+ }
255
+
256
+ /**
257
+ * Add custom bulk action updated messages for replies.
258
+ *
259
+ * @since 2.6.0 bbPress (r6101)
260
+ *
261
+ * @param array $bulk_messages Arrays of messages, each keyed by the corresponding post type.
262
+ * @param array $bulk_counts Array of item counts for each message, used to build internationalized strings.
263
+ */
264
+ public function bulk_post_updated_messages( $bulk_messages, $bulk_counts ) {
265
+
266
+ $bulk_messages['reply']['updated'] = _n( '%s reply updated.', '%s replies updated.', $bulk_counts['updated'], 'bbpress' );
267
+ $bulk_messages['reply']['locked'] = ( 1 === $bulk_counts['locked'] ) ? __( '1 reply not updated, somebody is editing it.', 'bbpress' ) :
268
+ _n( '%s reply not updated, somebody is editing it.', '%s replies not updated, somebody is editing them.', $bulk_counts['locked'], 'bbpress' );
269
+ return $bulk_messages;
270
+ }
271
+
272
+ /**
273
+ * Handle spam/unspam bulk actions.
274
+ *
275
+ * @since 2.6.0 bbPress (r6101)
276
+ *
277
+ * @param string $sendback The sendback URL.
278
+ * @param string $doaction The action to be taken.
279
+ * @param array $post_ids The post IDS to take the action on.
280
+ * @return string The sendback URL.
281
+ */
282
+ public function handle_bulk_actions( $sendback, $doaction, $post_ids ) {
283
+
284
+ $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
285
+ $updated = $locked = 0;
286
+
287
+ if ( 'spam' === $doaction ) {
288
+
289
+ foreach ( (array) $post_ids as $post_id ) {
290
+ if ( ! current_user_can( 'moderate', $post_id ) ) {
291
+ wp_die( __( 'Sorry, you are not allowed to spam this item.', 'bbpress' ) );
292
+ }
293
+
294
+ if ( wp_check_post_lock( $post_id ) ) {
295
+ $locked++;
296
+ continue;
297
+ }
298
+
299
+ if ( ! bbp_spam_reply( $post_id ) ) {
300
+ wp_die( __( 'Error in spamming reply.', 'bbpress' ) );
301
+ }
302
+
303
+ $updated++;
304
+ }
305
+
306
+ $sendback = add_query_arg( array( 'updated' => $updated, 'ids' => join( ',', $post_ids ), 'locked' => $locked ), $sendback );
307
+
308
+ } elseif ( 'unspam' === $doaction ) {
309
+
310
+ foreach ( (array) $post_ids as $post_id ) {
311
+ if ( ! current_user_can( 'moderate', $post_id ) ) {
312
+ wp_die( __( 'Sorry, you are not allowed to unspam this reply.', 'bbpress' ) );
313
+ }
314
+
315
+ if ( wp_check_post_lock( $post_id ) ) {
316
+ $locked++;
317
+ continue;
318
+ }
319
+
320
+ if ( ! bbp_unspam_reply( $post_id ) ) {
321
+ wp_die( __( 'Error in unspamming reply.', 'bbpress' ) );
322
+ }
323
+
324
+ $updated++;
325
+ }
326
+
327
+ $sendback = add_query_arg( array( 'updated' => $updated, 'ids' => join( ',', $post_ids ), 'locked' => $locked ), $sendback );
328
+ }
329
+
330
+ return $sendback;
331
+ }
332
+
333
  /**
334
  * Add the reply attributes metabox
335
  *
336
+ * @since 2.0.0 bbPress (r2746)
337
  *
338
  * @uses bbp_get_reply_post_type() To get the reply post type
339
  * @uses add_meta_box() To add the metabox
340
  * @uses do_action() Calls 'bbp_reply_attributes_metabox'
341
  */
342
  public function attributes_metabox() {
343
+ add_meta_box(
 
 
 
344
  'bbp_reply_attributes',
345
  __( 'Reply Attributes', 'bbpress' ),
346
  'bbp_reply_metabox',
348
  'side',
349
  'high'
350
  );
351
+ }
352
 
353
+ /**
354
+ * Add the author info metabox
355
+ *
356
+ * Allows editing of information about an author
357
+ *
358
+ * @since 2.0.0 bbPress (r2828)
359
+ *
360
+ * @uses bbp_get_topic() To get the topic
361
+ * @uses bbp_get_reply() To get the reply
362
+ * @uses bbp_get_topic_post_type() To get the topic post type
363
+ * @uses bbp_get_reply_post_type() To get the reply post type
364
+ * @uses add_meta_box() To add the metabox
365
+ */
366
+ public function author_metabox() {
367
+
368
+ // Bail if post_type is not a reply
369
+ if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) ) {
370
+ return;
371
+ }
372
+
373
+ // Add the metabox
374
+ add_meta_box(
375
+ 'bbp_author_metabox',
376
+ __( 'Author Information', 'bbpress' ),
377
+ 'bbp_author_metabox',
378
+ $this->post_type,
379
+ 'side',
380
+ 'high'
381
+ );
382
+ }
383
+
384
+ /**
385
+ * Remove comments & discussion metaboxes if comments are not supported
386
+ *
387
+ * @since 2.6.0 bbPress (r6186)
388
+ */
389
+ public function comments_metabox() {
390
+ if ( ! post_type_supports( $this->post_type, 'comments' ) ) {
391
+ remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
392
+ remove_meta_box( 'commentsdiv', $this->post_type, 'normal' );
393
+ }
394
  }
395
 
396
  /**
397
  * Pass the reply attributes for processing
398
  *
399
+ * @since 2.0.0 bbPress (r2746)
400
  *
401
  * @param int $reply_id Reply id
402
  * @uses current_user_can() To check if the current user is capable of
405
  * reply id and parent id
406
  * @return int Parent id
407
  */
408
+ public function save_meta_boxes( $reply_id ) {
 
 
409
 
410
  // Bail if doing an autosave
411
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
412
  return $reply_id;
413
+ }
414
 
415
  // Bail if not a post request
416
+ if ( ! bbp_is_post_request() ) {
417
  return $reply_id;
418
+ }
419
 
420
  // Check action exists
421
+ if ( empty( $_POST['action'] ) ) {
422
  return $reply_id;
423
+ }
424
 
425
  // Nonce check
426
+ if ( empty( $_POST['bbp_reply_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_reply_metabox'], 'bbp_reply_metabox_save' ) ) {
427
  return $reply_id;
428
+ }
429
 
430
  // Current user cannot edit this reply
431
+ if ( !current_user_can( 'edit_reply', $reply_id ) ) {
432
  return $reply_id;
433
+ }
434
 
435
  // Get the reply meta post values
436
+ $topic_id = ! empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0;
437
+ $forum_id = ! empty( $_POST['bbp_forum_id'] ) ? (int) $_POST['bbp_forum_id'] : bbp_get_topic_forum_id( $topic_id );
438
+ $reply_to = ! empty( $_POST['bbp_reply_to'] ) ? (int) $_POST['bbp_reply_to'] : 0;
439
 
440
  // Get reply author data
441
  $anonymous_data = bbp_filter_anonymous_post_data();
442
  $author_id = bbp_get_reply_author_id( $reply_id );
443
+ $is_edit = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) );
444
 
445
  // Formally update the reply
446
  bbp_update_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit, $reply_to );
452
  return $reply_id;
453
  }
454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  /**
456
  * Add some general styling to the admin area
457
  *
458
+ * @since 2.0.0 bbPress (r2464)
459
  *
460
  * @uses bbp_get_forum_post_type() To get the forum post type
461
  * @uses bbp_get_topic_post_type() To get the topic post type
464
  * @uses do_action() Calls 'bbp_admin_head'
465
  */
466
  public function admin_head() {
 
 
 
467
  ?>
468
 
469
  <style type="text/css" media="screen">
512
  background-color: #faeaea;
513
  }
514
 
515
+ .status-pending {
516
+ background-color: #fef7f1;
517
+ }
518
+
519
  /*]]>*/
520
  </style>
521
 
527
  *
528
  * Handles the admin-side spamming/unspamming of replies
529
  *
530
+ * @since 2.0.0 bbPress (r2740)
531
  *
532
  * @uses bbp_get_reply() To get the reply
533
  * @uses current_user_can() To check if the user is capable of editing
541
  * @uses do_action() Calls 'bbp_toggle_reply_admin' with success, post
542
  * data, action and message
543
  * @uses add_query_arg() To add custom args to the url
544
+ * @uses bbp_redirect() Redirect the page to custom url
545
  */
546
  public function toggle_reply() {
547
 
 
 
548
  // Only proceed if GET is a reply toggle action
549
+ if ( bbp_is_get_request() && ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_reply_spam', 'bbp_toggle_reply_approve' ) ) && ! empty( $_GET['reply_id'] ) ) {
550
  $action = $_GET['action']; // What action is taking place?
551
  $reply_id = (int) $_GET['reply_id']; // What's the reply id?
552
  $success = false; // Flag
554
 
555
  // Get reply and die if empty
556
  $reply = bbp_get_reply( $reply_id );
557
+ if ( empty( $reply ) ) {
558
+ wp_die( __( 'The reply was not found.', 'bbpress' ) );
559
+ }
560
 
561
+ // What is the user doing here?
562
+ if ( !current_user_can( 'moderate', $reply->ID ) ) {
563
+ wp_die( __( 'You do not have permission to do that.', 'bbpress' ) );
564
+ }
565
 
566
  switch ( $action ) {
567
+ case 'bbp_toggle_reply_approve' :
568
+ check_admin_referer( 'approve-reply_' . $reply_id );
569
+
570
+ $is_approve = bbp_is_reply_pending( $reply_id );
571
+ $message = $is_approve ? 'approved' : 'unapproved';
572
+ $success = $is_approve ? bbp_approve_reply( $reply_id ) : bbp_unapprove_reply( $reply_id );
573
+
574
+ break;
575
+
576
  case 'bbp_toggle_reply_spam' :
577
  check_admin_referer( 'spam-reply_' . $reply_id );
578
 
583
  break;
584
  }
585
 
 
586
  $message = array( 'bbp_reply_toggle_notice' => $message, 'reply_id' => $reply->ID );
587
 
588
+ if ( false === $success || is_wp_error( $success ) ) {
589
  $message['failed'] = '1';
590
+ }
591
 
592
  // Do additional reply toggle actions (admin side)
593
  do_action( 'bbp_toggle_reply_admin', $success, $post_data, $action, $message );
594
 
595
  // Redirect back to the reply
596
  $redirect = add_query_arg( $message, remove_query_arg( array( 'action', 'reply_id' ) ) );
597
+ bbp_redirect( $redirect );
 
 
 
598
  }
599
  }
600
 
604
  * Display the success/error notices from
605
  * {@link BBP_Admin::toggle_reply()}
606
  *
607
+ * @since 2.0.0 bbPress (r2740)
608
  *
609
  * @uses bbp_get_reply() To get the reply
610
  * @uses bbp_get_reply_title() To get the reply title of the reply
614
  */
615
  public function toggle_reply_notice() {
616
 
 
 
617
  // Only proceed if GET is a reply toggle action
618
+ if ( bbp_is_get_request() && ! empty( $_GET['bbp_reply_toggle_notice'] ) && in_array( $_GET['bbp_reply_toggle_notice'], array( 'spammed', 'unspammed', 'approved', 'unapproved' ) ) && ! empty( $_GET['reply_id'] ) ) {
619
  $notice = $_GET['bbp_reply_toggle_notice']; // Which notice?
620
  $reply_id = (int) $_GET['reply_id']; // What's the reply id?
621
+ $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure?
622
 
623
  // Empty? No reply?
624
+ if ( empty( $notice ) || empty( $reply_id ) ) {
625
  return;
626
+ }
627
 
628
  // Get reply and bail if empty
629
  $reply = bbp_get_reply( $reply_id );
630
+ if ( empty( $reply ) ) {
631
  return;
632
+ }
633
 
634
  $reply_title = bbp_get_reply_title( $reply->ID );
635
 
636
  switch ( $notice ) {
637
  case 'spammed' :
638
+ $message = ( $is_failure === true )
639
+ ? sprintf( __( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title )
640
+ : sprintf( __( 'Reply "%1$s" successfully marked as spam.', 'bbpress' ), $reply_title );
641
  break;
642
 
643
  case 'unspammed' :
644
+ $message = ( $is_failure === true )
645
+ ? sprintf( __( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title )
646
+ : sprintf( __( 'Reply "%1$s" successfully unmarked as spam.', 'bbpress' ), $reply_title );
647
+ break;
648
+
649
+ case 'approved' :
650
+ $message = ( $is_failure === true )
651
+ ? sprintf( __( 'There was a problem approving the reply "%1$s".', 'bbpress' ), $reply_title )
652
+ : sprintf( __( 'Reply "%1$s" successfully approved.', 'bbpress' ), $reply_title );
653
+ break;
654
+
655
+ case 'unapproved' :
656
+ $message = ( $is_failure === true )
657
+ ? sprintf( __( 'There was a problem unapproving the reply "%1$s".', 'bbpress' ), $reply_title )
658
+ : sprintf( __( 'Reply "%1$s" successfully unapproved.', 'bbpress' ), $reply_title );
659
  break;
660
  }
661
 
675
  /**
676
  * Manage the column headers for the replies page
677
  *
678
+ * @since 2.0.0 bbPress (r2577)
679
  *
680
  * @param array $columns The columns
681
  * @uses apply_filters() Calls 'bbp_admin_replies_column_headers' with
683
  * @return array $columns bbPress reply columns
684
  */
685
  public function column_headers( $columns ) {
 
 
 
686
  $columns = array(
687
  'cb' => '<input type="checkbox" />',
688
  'title' => __( 'Title', 'bbpress' ),
698
  /**
699
  * Print extra columns for the replies page
700
  *
701
+ * @since 2.0.0 bbPress (r2577)
702
  *
703
  * @param string $column Column
704
  * @param int $reply_id reply id
724
  */
725
  public function column_data( $column, $reply_id ) {
726
 
 
 
727
  // Get topic ID
728
  $topic_id = bbp_get_reply_topic_id( $reply_id );
729
 
734
  case 'bbp_reply_topic' :
735
 
736
  // Output forum name
737
+ if ( ! empty( $topic_id ) ) {
738
 
739
  // Topic Title
740
  $topic_title = bbp_get_topic_title( $topic_id );
760
  $topic_forum_id = bbp_get_topic_forum_id( $topic_id );
761
 
762
  // Output forum name
763
+ if ( ! empty( $reply_forum_id ) ) {
764
 
765
  // Forum Title
766
  $forum_title = bbp_get_forum_title( $reply_forum_id );
770
 
771
  // Alert capable users of reply forum mismatch
772
  if ( $reply_forum_id !== $topic_forum_id ) {
773
+ if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $reply_id ) ) {
774
  $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>';
775
  }
776
  }
814
  * Remove the quick-edit action link under the reply title and add the
815
  * content and spam link
816
  *
817
+ * @since 2.0.0 bbPress (r2577)
818
  *
819
  * @param array $actions Actions
820
  * @param array $reply Reply object
821
  * @uses bbp_get_reply_post_type() To get the reply post type
822
  * @uses bbp_reply_content() To output reply content
823
+ * @uses bbp_get_reply_url() To get the reply link
824
  * @uses bbp_get_reply_title() To get the reply title
825
  * @uses current_user_can() To check if the current user can edit or
826
  * delete the reply
834
  */
835
  public function row_actions( $actions, $reply ) {
836
 
 
 
837
  unset( $actions['inline hide-if-no-js'] );
838
 
839
  // Reply view links to topic
840
  $actions['view'] = '<a href="' . esc_url( bbp_get_reply_url( $reply->ID ) ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
841
 
842
  // User cannot view replies in trash
843
+ if ( ( bbp_get_trash_status_id() === $reply->post_status ) && !current_user_can( 'view_trash' ) ) {
844
  unset( $actions['view'] );
845
+ }
846
 
847
  // Only show the actions if the user is capable of viewing them
848
  if ( current_user_can( 'moderate', $reply->ID ) ) {
849
+
850
+ // Show the 'approve' link on pending posts only and 'unapprove' on published posts only
851
+ $approve_uri = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_approve' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'approve-reply_' . $reply->ID );
852
+ if ( bbp_is_reply_published( $reply->ID ) ) {
853
+ $actions['unapproved'] = '<a href="' . esc_url( $approve_uri ) . '" title="' . esc_attr__( 'Unapprove this reply', 'bbpress' ) . '">' . _x( 'Unapprove', 'Unapprove reply', 'bbpress' ) . '</a>';
854
+ } elseif ( ! bbp_is_reply_private( $reply->ID ) ) {
855
+ $actions['approved'] = '<a href="' . esc_url( $approve_uri ) . '" title="' . esc_attr__( 'Approve this reply', 'bbpress' ) . '">' . _x( 'Approve', 'Approve reply', 'bbpress' ) . '</a>';
856
+ }
857
+
858
+ // Show the 'spam' link on published and pending replies and 'not spam' on spammed replies
859
+ if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_pending_status_id(), bbp_get_spam_status_id() ) ) ) {
860
  $spam_uri = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_' . $reply->ID );
861
  if ( bbp_is_reply_spam( $reply->ID ) ) {
862
  $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
888
  /**
889
  * Add forum dropdown to topic and reply list table filters
890
  *
891
+ * @since 2.0.0 bbPress (r2991)
892
  *
893
  * @uses bbp_get_reply_post_type() To get the reply post type
894
  * @uses bbp_get_topic_post_type() To get the topic post type
897
  */
898
  public function filter_dropdown() {
899
 
900
+ // Add "Empty Spam" button for moderators
901
+ if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
 
 
902
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
903
+ submit_button(
904
+ esc_attr__( 'Empty Spam', 'bbpress' ),
905
+ 'button-secondary apply',
906
+ 'delete_all',
907
+ false
908
+ );
909
  }
910
 
911
  // Get which forum is selected
912
+ $selected = ! empty( $_GET['bbp_forum_id'] )
913
+ ? (int) $_GET['bbp_forum_id']
914
+ : 0;
915
 
916
  // Show the forums dropdown
917
  bbp_dropdown( array(
923
  /**
924
  * Adjust the request query and include the forum id
925
  *
926
+ * @since 2.0.0 bbPress (r2991)
927
  *
928
  * @param array $query_vars Query variables from {@link WP_Query}
929
  * @uses is_admin() To check if it's the admin section
933
  */
934
  public function filter_post_rows( $query_vars ) {
935
 
 
 
936
  // Add post_parent query_var if one is present
937
+ if ( ! empty( $_GET['bbp_forum_id'] ) ) {
938
  $query_vars['meta_key'] = '_bbp_forum_id';
939
+ $query_vars['meta_type'] = 'NUMERIC';
940
  $query_vars['meta_value'] = $_GET['bbp_forum_id'];
941
  }
942
 
947
  /**
948
  * Custom user feedback messages for reply post type
949
  *
950
+ * @since 2.0.0 bbPress (r3080)
951
  *
952
  * @global int $post_ID
953
  * @uses bbp_get_topic_permalink()
962
  public function updated_messages( $messages ) {
963
  global $post_ID;
964
 
 
 
965
  // URL for the current topic
966
  $topic_url = bbp_get_topic_permalink( bbp_get_reply_topic_id( $post_ID ) );
967
 
969
  $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
970
 
971
  // Messages array
972
+ $messages[ $this->post_type ] = array(
973
  0 => '', // Left empty on purpose
974
 
975
  // Updated
976
+ 1 => sprintf(
977
+ '%1$s <a href="%2$s">%3$s</a>',
978
+ __( 'Reply updated.', 'bbpress' ),
979
+ $topic_url,
980
+ __( 'View topic', 'bbpress' )
981
+ ),
982
 
983
  // Custom field updated
984
  2 => __( 'Custom field updated.', 'bbpress' ),
996
  : false,
997
 
998
  // Reply created
999
+ 6 => sprintf(
1000
+ '%1$s <a href="%2$s">%3$s</a>',
1001
+ __( 'Reply created.', 'bbpress' ),
1002
+ $topic_url,
1003
+ __( 'View topic', 'bbpress' )
1004
+ ),
1005
 
1006
  // Reply saved
1007
  7 => __( 'Reply saved.', 'bbpress' ),
1008
 
1009
  // Reply submitted
1010
+ 8 => sprintf(
1011
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
1012
+ __( 'Reply submitted.', 'bbpress' ),
1013
+ esc_url( add_query_arg( 'preview', 'true', $topic_url ) ),
1014
+ __( 'Preview topic', 'bbpress' )
1015
+ ),
1016
 
1017
  // Reply scheduled
1018
+ 9 => sprintf(
1019
+ '%1$s <a target="_blank" href="%2$s">%3$s</a>',
1020
+ sprintf(
1021
+ __( 'Reply scheduled for: %s.', 'bbpress' ),
1022
  // translators: Publish box date format, see http://php.net/date
1023
+ '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'bbpress' ), strtotime( $post_date ) ) . '</strong>'
1024
+ ),
1025
+ $topic_url,
1026
+ __( 'Preview topic', 'bbpress' )
1027
+ ),
1028
 
1029
  // Reply draft updated
1030
+ 10 => sprintf(
1031
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
1032
+ __( 'Reply draft updated.', 'bbpress' ),
1033
+ esc_url( add_query_arg( 'preview', 'true', $topic_url ) ),
1034
+ __( 'Preview topic', 'bbpress' )
1035
+ ),
1036
  );
1037
 
1038
  return $messages;
1046
  * This is currently here to make hooking and unhooking of the admin UI easy.
1047
  * It could use dependency injection in the future, but for now this is easier.
1048
  *
1049
+ * @since 2.0.0 bbPress (r2596)
1050
  *
1051
+ * @param WP_Screen $current_screen Current screen object
1052
  * @uses BBP_Replies_Admin
1053
  */
1054
+ function bbp_admin_replies( $current_screen ) {
1055
+
1056
+ // Bail if not a forum screen
1057
+ if ( empty( $current_screen->post_type ) || ( bbp_get_reply_post_type() !== $current_screen->post_type ) ) {
1058
+ return;
1059
+ }
1060
+
1061
+ // Init the replies admin
1062
  bbpress()->admin->replies = new BBP_Replies_Admin();
1063
  }
includes/admin/settings.php CHANGED
@@ -8,14 +8,15 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Sections ******************************************************************/
14
 
15
  /**
16
  * Get the Forums settings sections.
17
  *
18
- * @since bbPress (r4001)
 
19
  * @return array
20
  */
21
  function bbp_admin_get_settings_sections() {
@@ -76,7 +77,8 @@ function bbp_admin_get_settings_sections() {
76
  /**
77
  * Get all of the settings fields.
78
  *
79
- * @since bbPress (r4001)
 
80
  * @return type
81
  */
82
  function bbp_admin_get_settings_fields() {
@@ -91,7 +93,7 @@ function bbp_admin_get_settings_fields() {
91
  'title' => __( 'Disallow editing after', 'bbpress' ),
92
  'callback' => 'bbp_admin_setting_callback_editlock',
93
  'sanitize_callback' => 'intval',
94
- 'args' => array()
95
  ),
96
 
97
  // Throttle setting
@@ -99,7 +101,7 @@ function bbp_admin_get_settings_fields() {
99
  'title' => __( 'Throttle posting every', 'bbpress' ),
100
  'callback' => 'bbp_admin_setting_callback_throttle',
101
  'sanitize_callback' => 'intval',
102
- 'args' => array()
103
  ),
104
 
105
  // Allow anonymous posting setting
@@ -161,6 +163,14 @@ function bbp_admin_get_settings_fields() {
161
  'args' => array()
162
  ),
163
 
 
 
 
 
 
 
 
 
164
  // Allow topic tags
165
  '_bbp_allow_search' => array(
166
  'title' => __( 'Search', 'bbpress' ),
@@ -222,7 +232,7 @@ function bbp_admin_get_settings_fields() {
222
  'title' => __( 'Topics', 'bbpress' ),
223
  'callback' => 'bbp_admin_setting_callback_topics_per_page',
224
  'sanitize_callback' => 'intval',
225
- 'args' => array()
226
  ),
227
 
228
  // Replies per page setting
@@ -230,7 +240,7 @@ function bbp_admin_get_settings_fields() {
230
  'title' => __( 'Replies', 'bbpress' ),
231
  'callback' => 'bbp_admin_setting_callback_replies_per_page',
232
  'sanitize_callback' => 'intval',
233
- 'args' => array()
234
  )
235
  ),
236
 
@@ -243,7 +253,7 @@ function bbp_admin_get_settings_fields() {
243
  'title' => __( 'Topics', 'bbpress' ),
244
  'callback' => 'bbp_admin_setting_callback_topics_per_rss_page',
245
  'sanitize_callback' => 'intval',
246
- 'args' => array()
247
  ),
248
 
249
  // Replies per page setting
@@ -251,7 +261,7 @@ function bbp_admin_get_settings_fields() {
251
  'title' => __( 'Replies', 'bbpress' ),
252
  'callback' => 'bbp_admin_setting_callback_replies_per_rss_page',
253
  'sanitize_callback' => 'intval',
254
- 'args' => array()
255
  )
256
  ),
257
 
@@ -264,7 +274,7 @@ function bbp_admin_get_settings_fields() {
264
  'title' => __( 'Forum Root', 'bbpress' ),
265
  'callback' => 'bbp_admin_setting_callback_root_slug',
266
  'sanitize_callback' => 'bbp_sanitize_slug',
267
- 'args' => array()
268
  ),
269
 
270
  // Include root setting
@@ -280,7 +290,7 @@ function bbp_admin_get_settings_fields() {
280
  'title' => __( 'Forum root should show', 'bbpress' ),
281
  'callback' => 'bbp_admin_setting_callback_show_on_root',
282
  'sanitize_callback' => 'sanitize_text_field',
283
- 'args' => array()
284
  ),
285
  ),
286
 
@@ -293,7 +303,7 @@ function bbp_admin_get_settings_fields() {
293
  'title' => __( 'Forum', 'bbpress' ),
294
  'callback' => 'bbp_admin_setting_callback_forum_slug',
295
  'sanitize_callback' => 'bbp_sanitize_slug',
296
- 'args' => array()
297
  ),
298
 
299
  // Topic slug setting
@@ -301,7 +311,7 @@ function bbp_admin_get_settings_fields() {
301
  'title' => __( 'Topic', 'bbpress' ),
302
  'callback' => 'bbp_admin_setting_callback_topic_slug',
303
  'sanitize_callback' => 'bbp_sanitize_slug',
304
- 'args' => array()
305
  ),
306
 
307
  // Topic tag slug setting
@@ -309,7 +319,7 @@ function bbp_admin_get_settings_fields() {
309
  'title' => __( 'Topic Tag', 'bbpress' ),
310
  'callback' => 'bbp_admin_setting_callback_topic_tag_slug',
311
  'sanitize_callback' => 'bbp_sanitize_slug',
312
- 'args' => array()
313
  ),
314
 
315
  // View slug setting
@@ -317,15 +327,15 @@ function bbp_admin_get_settings_fields() {
317
  'title' => __( 'Topic View', 'bbpress' ),
318
  'callback' => 'bbp_admin_setting_callback_view_slug',
319
  'sanitize_callback' => 'bbp_sanitize_slug',
320
- 'args' => array()
321
  ),
322
 
323
  // Reply slug setting
324
  '_bbp_reply_slug' => array(
325
- 'title' => __( 'Reply', 'bbpress' ),
326
  'callback' => 'bbp_admin_setting_callback_reply_slug',
327
  'sanitize_callback' => 'bbp_sanitize_slug',
328
- 'args' => array()
329
  ),
330
 
331
  // Search slug setting
@@ -333,7 +343,7 @@ function bbp_admin_get_settings_fields() {
333
  'title' => __( 'Search', 'bbpress' ),
334
  'callback' => 'bbp_admin_setting_callback_search_slug',
335
  'sanitize_callback' => 'bbp_sanitize_slug',
336
- 'args' => array()
337
  )
338
  ),
339
 
@@ -346,7 +356,7 @@ function bbp_admin_get_settings_fields() {
346
  'title' => __( 'User Base', 'bbpress' ),
347
  'callback' => 'bbp_admin_setting_callback_user_slug',
348
  'sanitize_callback' => 'bbp_sanitize_slug',
349
- 'args' => array()
350
  ),
351
 
352
  // Topics slug setting
@@ -354,7 +364,7 @@ function bbp_admin_get_settings_fields() {
354
  'title' => __( 'Topics Started', 'bbpress' ),
355
  'callback' => 'bbp_admin_setting_callback_topic_archive_slug',
356
  'sanitize_callback' => 'bbp_sanitize_slug',
357
- 'args' => array()
358
  ),
359
 
360
  // Replies slug setting
@@ -362,7 +372,7 @@ function bbp_admin_get_settings_fields() {
362
  'title' => __( 'Replies Created', 'bbpress' ),
363
  'callback' => 'bbp_admin_setting_callback_reply_archive_slug',
364
  'sanitize_callback' => 'bbp_sanitize_slug',
365
- 'args' => array()
366
  ),
367
 
368
  // Favorites slug setting
@@ -370,15 +380,15 @@ function bbp_admin_get_settings_fields() {
370
  'title' => __( 'Favorite Topics', 'bbpress' ),
371
  'callback' => 'bbp_admin_setting_callback_user_favs_slug',
372
  'sanitize_callback' => 'bbp_sanitize_slug',
373
- 'args' => array()
374
  ),
375
 
376
  // Subscriptions slug setting
377
  '_bbp_user_subs_slug' => array(
378
- 'title' => __( 'Topic Subscriptions', 'bbpress' ),
379
  'callback' => 'bbp_admin_setting_callback_user_subs_slug',
380
  'sanitize_callback' => 'bbp_sanitize_slug',
381
- 'args' => array()
382
  )
383
  ),
384
 
@@ -399,7 +409,7 @@ function bbp_admin_get_settings_fields() {
399
  'title' => __( 'Group Forums Parent', 'bbpress' ),
400
  'callback' => 'bbp_admin_setting_callback_group_forums_root_id',
401
  'sanitize_callback' => 'intval',
402
- 'args' => array()
403
  )
404
  ),
405
 
@@ -421,18 +431,22 @@ function bbp_admin_get_settings_fields() {
421
  /**
422
  * Get settings fields by section.
423
  *
424
- * @since bbPress (r4001)
 
425
  * @param string $section_id
426
  * @return mixed False if section is invalid, array of fields otherwise.
427
  */
428
  function bbp_admin_get_settings_fields_for_section( $section_id = '' ) {
429
 
430
  // Bail if section is empty
431
- if ( empty( $section_id ) )
432
  return false;
 
433
 
434
  $fields = bbp_admin_get_settings_fields();
435
- $retval = isset( $fields[$section_id] ) ? $fields[$section_id] : false;
 
 
436
 
437
  return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
438
  }
@@ -442,7 +456,7 @@ function bbp_admin_get_settings_fields_for_section( $section_id = '' ) {
442
  /**
443
  * User settings section description for the settings page
444
  *
445
- * @since bbPress (r2786)
446
  */
447
  function bbp_admin_setting_callback_user_section() {
448
  ?>
@@ -456,7 +470,7 @@ function bbp_admin_setting_callback_user_section() {
456
  /**
457
  * Edit lock setting field
458
  *
459
- * @since bbPress (r2737)
460
  *
461
  * @uses bbp_form_option() To output the option value
462
  */
@@ -464,7 +478,7 @@ function bbp_admin_setting_callback_editlock() {
464
  ?>
465
 
466
  <input name="_bbp_edit_lock" id="_bbp_edit_lock" type="number" min="0" step="1" value="<?php bbp_form_option( '_bbp_edit_lock', '5' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_edit_lock' ); ?> />
467
- <label for="_bbp_edit_lock"><?php esc_html_e( 'minutes', 'bbpress' ); ?></label>
468
 
469
  <?php
470
  }
@@ -472,7 +486,7 @@ function bbp_admin_setting_callback_editlock() {
472
  /**
473
  * Throttle setting field
474
  *
475
- * @since bbPress (r2737)
476
  *
477
  * @uses bbp_form_option() To output the option value
478
  */
@@ -480,7 +494,7 @@ function bbp_admin_setting_callback_throttle() {
480
  ?>
481
 
482
  <input name="_bbp_throttle_time" id="_bbp_throttle_time" type="number" min="0" step="1" value="<?php bbp_form_option( '_bbp_throttle_time', '10' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_throttle_time' ); ?> />
483
- <label for="_bbp_throttle_time"><?php esc_html_e( 'seconds', 'bbpress' ); ?></label>
484
 
485
  <?php
486
  }
@@ -488,7 +502,7 @@ function bbp_admin_setting_callback_throttle() {
488
  /**
489
  * Allow anonymous posting setting field
490
  *
491
- * @since bbPress (r2737)
492
  *
493
  * @uses checked() To display the checked attribute
494
  */
@@ -504,7 +518,7 @@ function bbp_admin_setting_callback_anonymous() {
504
  /**
505
  * Allow global access setting field
506
  *
507
- * @since bbPress (r3378)
508
  *
509
  * @uses checked() To display the checked attribute
510
  */
@@ -541,7 +555,7 @@ function bbp_admin_setting_callback_global_access() {
541
  /**
542
  * Features settings section description for the settings page
543
  *
544
- * @since bbPress (r2786)
545
  */
546
  function bbp_admin_setting_callback_features_section() {
547
  ?>
@@ -554,7 +568,7 @@ function bbp_admin_setting_callback_features_section() {
554
  /**
555
  * Allow favorites setting field
556
  *
557
- * @since bbPress (r2786)
558
  *
559
  * @uses checked() To display the checked attribute
560
  */
@@ -570,7 +584,7 @@ function bbp_admin_setting_callback_favorites() {
570
  /**
571
  * Allow subscriptions setting field
572
  *
573
- * @since bbPress (r2737)
574
  *
575
  * @uses checked() To display the checked attribute
576
  */
@@ -586,7 +600,7 @@ function bbp_admin_setting_callback_subscriptions() {
586
  /**
587
  * Allow topic tags setting field
588
  *
589
- * @since bbPress (r4944)
590
  *
591
  * @uses checked() To display the checked attribute
592
  */
@@ -599,10 +613,26 @@ function bbp_admin_setting_callback_topic_tags() {
599
  <?php
600
  }
601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  /**
603
  * Allow forum wide search
604
  *
605
- * @since bbPress (r4970)
606
  *
607
  * @uses checked() To display the checked attribute
608
  */
@@ -620,7 +650,7 @@ function bbp_admin_setting_callback_search() {
620
  *
621
  * Replies will be threaded if depth is 2 or greater
622
  *
623
- * @since bbPress (r4944)
624
  *
625
  * @uses apply_filters() Calls 'bbp_thread_replies_depth_max' to set a
626
  * maximum displayed level
@@ -658,7 +688,7 @@ function bbp_admin_setting_callback_thread_replies_depth() {
658
  /**
659
  * Allow topic and reply revisions
660
  *
661
- * @since bbPress (r3412)
662
  *
663
  * @uses checked() To display the checked attribute
664
  */
@@ -674,7 +704,7 @@ function bbp_admin_setting_callback_revisions() {
674
  /**
675
  * Use the WordPress editor setting field
676
  *
677
- * @since bbPress (r3586)
678
  *
679
  * @uses checked() To display the checked attribute
680
  */
@@ -690,7 +720,7 @@ function bbp_admin_setting_callback_use_wp_editor() {
690
  /**
691
  * Main subtheme section
692
  *
693
- * @since bbPress (r2786)
694
  */
695
  function bbp_admin_setting_callback_subtheme_section() {
696
  ?>
@@ -703,7 +733,7 @@ function bbp_admin_setting_callback_subtheme_section() {
703
  /**
704
  * Use the WordPress editor setting field
705
  *
706
- * @since bbPress (r3586)
707
  *
708
  * @uses checked() To display the checked attribute
709
  */
@@ -722,7 +752,7 @@ function bbp_admin_setting_callback_subtheme_id() {
722
  $theme_options .= '<option value="' . esc_attr( $id ) . '"' . selected( $theme->id, $current_package, false ) . '>' . sprintf( esc_html__( '%1$s - %2$s', 'bbpress' ), esc_html( $theme->name ), esc_html( str_replace( WP_CONTENT_DIR, '', $theme->dir ) ) ) . '</option>';
723
  }
724
 
725
- if ( !empty( $theme_options ) ) : ?>
726
 
727
  <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select>
728
  <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
@@ -737,7 +767,7 @@ function bbp_admin_setting_callback_subtheme_id() {
737
  /**
738
  * Allow oEmbed in replies
739
  *
740
- * @since bbPress (r3752)
741
  *
742
  * @uses checked() To display the checked attribute
743
  */
@@ -755,7 +785,7 @@ function bbp_admin_setting_callback_use_autoembed() {
755
  /**
756
  * Per page settings section description for the settings page
757
  *
758
- * @since bbPress (r2786)
759
  */
760
  function bbp_admin_setting_callback_per_page_section() {
761
  ?>
@@ -768,7 +798,7 @@ function bbp_admin_setting_callback_per_page_section() {
768
  /**
769
  * Topics per page setting field
770
  *
771
- * @since bbPress (r2786)
772
  *
773
  * @uses bbp_form_option() To output the option value
774
  */
@@ -776,7 +806,7 @@ function bbp_admin_setting_callback_topics_per_page() {
776
  ?>
777
 
778
  <input name="_bbp_topics_per_page" id="_bbp_topics_per_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_topics_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_page' ); ?> />
779
- <label for="_bbp_topics_per_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
780
 
781
  <?php
782
  }
@@ -784,7 +814,7 @@ function bbp_admin_setting_callback_topics_per_page() {
784
  /**
785
  * Replies per page setting field
786
  *
787
- * @since bbPress (r2786)
788
  *
789
  * @uses bbp_form_option() To output the option value
790
  */
@@ -792,7 +822,7 @@ function bbp_admin_setting_callback_replies_per_page() {
792
  ?>
793
 
794
  <input name="_bbp_replies_per_page" id="_bbp_replies_per_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_replies_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_page' ); ?> />
795
- <label for="_bbp_replies_per_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
796
 
797
  <?php
798
  }
@@ -802,7 +832,7 @@ function bbp_admin_setting_callback_replies_per_page() {
802
  /**
803
  * Per page settings section description for the settings page
804
  *
805
- * @since bbPress (r2786)
806
  */
807
  function bbp_admin_setting_callback_per_rss_page_section() {
808
  ?>
@@ -815,7 +845,7 @@ function bbp_admin_setting_callback_per_rss_page_section() {
815
  /**
816
  * Topics per RSS page setting field
817
  *
818
- * @since bbPress (r2786)
819
  *
820
  * @uses bbp_form_option() To output the option value
821
  */
@@ -823,7 +853,7 @@ function bbp_admin_setting_callback_topics_per_rss_page() {
823
  ?>
824
 
825
  <input name="_bbp_topics_per_rss_page" id="_bbp_topics_per_rss_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_topics_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_rss_page' ); ?> />
826
- <label for="_bbp_topics_per_rss_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
827
 
828
  <?php
829
  }
@@ -831,7 +861,7 @@ function bbp_admin_setting_callback_topics_per_rss_page() {
831
  /**
832
  * Replies per RSS page setting field
833
  *
834
- * @since bbPress (r2786)
835
  *
836
  * @uses bbp_form_option() To output the option value
837
  */
@@ -839,7 +869,7 @@ function bbp_admin_setting_callback_replies_per_rss_page() {
839
  ?>
840
 
841
  <input name="_bbp_replies_per_rss_page" id="_bbp_replies_per_rss_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_replies_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_rss_page' ); ?> />
842
- <label for="_bbp_replies_per_rss_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
843
 
844
  <?php
845
  }
@@ -849,13 +879,14 @@ function bbp_admin_setting_callback_replies_per_rss_page() {
849
  /**
850
  * Slugs settings section description for the settings page
851
  *
852
- * @since bbPress (r2786)
853
  */
854
  function bbp_admin_setting_callback_root_slug_section() {
855
 
856
  // Flush rewrite rules when this section is saved
857
- if ( isset( $_GET['settings-updated'] ) && isset( $_GET['page'] ) )
858
- flush_rewrite_rules(); ?>
 
859
 
860
  <p><?php esc_html_e( 'Customize your Forums root. Partner with a WordPress Page and use Shortcodes for more flexibility.', 'bbpress' ); ?></p>
861
 
@@ -865,14 +896,14 @@ function bbp_admin_setting_callback_root_slug_section() {
865
  /**
866
  * Root slug setting field
867
  *
868
- * @since bbPress (r2786)
869
  *
870
  * @uses bbp_form_option() To output the option value
871
  */
872
  function bbp_admin_setting_callback_root_slug() {
873
  ?>
874
 
875
- <input name="_bbp_root_slug" id="_bbp_root_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_root_slug', 'forums', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_root_slug' ); ?> />
876
 
877
  <?php
878
  // Slug Check
@@ -882,7 +913,7 @@ function bbp_admin_setting_callback_root_slug() {
882
  /**
883
  * Include root slug setting field
884
  *
885
- * @since bbPress (r2786)
886
  *
887
  * @uses checked() To display the checked attribute
888
  */
@@ -898,7 +929,7 @@ function bbp_admin_setting_callback_include_root() {
898
  /**
899
  * Include root slug setting field
900
  *
901
- * @since bbPress (r2786)
902
  *
903
  * @uses checked() To display the checked attribute
904
  */
@@ -913,7 +944,7 @@ function bbp_admin_setting_callback_show_on_root() {
913
  'name' => __( 'Forum Index', 'bbpress' )
914
  ),
915
  'topics' => array(
916
- 'name' => __( 'Topics by Freshness', 'bbpress' )
917
  )
918
  ); ?>
919
 
@@ -935,7 +966,7 @@ function bbp_admin_setting_callback_show_on_root() {
935
  /**
936
  * Slugs settings section description for the settings page
937
  *
938
- * @since bbPress (r2786)
939
  */
940
  function bbp_admin_setting_callback_user_slug_section() {
941
  ?>
@@ -948,7 +979,7 @@ function bbp_admin_setting_callback_user_slug_section() {
948
  /**
949
  * User slug setting field
950
  *
951
- * @since bbPress (r2786)
952
  *
953
  * @uses bbp_form_option() To output the option value
954
  */
@@ -965,7 +996,7 @@ function bbp_admin_setting_callback_user_slug() {
965
  /**
966
  * Topic archive slug setting field
967
  *
968
- * @since bbPress (r2786)
969
  *
970
  * @uses bbp_form_option() To output the option value
971
  */
@@ -982,7 +1013,7 @@ function bbp_admin_setting_callback_topic_archive_slug() {
982
  /**
983
  * Reply archive slug setting field
984
  *
985
- * @since bbPress (r4932)
986
  *
987
  * @uses bbp_form_option() To output the option value
988
  */
@@ -999,7 +1030,7 @@ function bbp_admin_setting_callback_reply_archive_slug() {
999
  /**
1000
  * Favorites slug setting field
1001
  *
1002
- * @since bbPress (r4932)
1003
  *
1004
  * @uses bbp_form_option() To output the option value
1005
  */
@@ -1010,13 +1041,13 @@ function bbp_admin_setting_callback_user_favs_slug() {
1010
 
1011
  <?php
1012
  // Slug Check
1013
- bbp_form_slug_conflict_check( '_bbp_reply_archive_slug', 'favorites' );
1014
  }
1015
 
1016
  /**
1017
- * Favorites slug setting field
1018
  *
1019
- * @since bbPress (r4932)
1020
  *
1021
  * @uses bbp_form_option() To output the option value
1022
  */
@@ -1035,7 +1066,7 @@ function bbp_admin_setting_callback_user_subs_slug() {
1035
  /**
1036
  * Slugs settings section description for the settings page
1037
  *
1038
- * @since bbPress (r2786)
1039
  */
1040
  function bbp_admin_setting_callback_single_slug_section() {
1041
  ?>
@@ -1048,7 +1079,7 @@ function bbp_admin_setting_callback_single_slug_section() {
1048
  /**
1049
  * Forum slug setting field
1050
  *
1051
- * @since bbPress (r2786)
1052
  *
1053
  * @uses bbp_form_option() To output the option value
1054
  */
@@ -1065,7 +1096,7 @@ function bbp_admin_setting_callback_forum_slug() {
1065
  /**
1066
  * Topic slug setting field
1067
  *
1068
- * @since bbPress (r2786)
1069
  *
1070
  * @uses bbp_form_option() To output the option value
1071
  */
@@ -1082,7 +1113,7 @@ function bbp_admin_setting_callback_topic_slug() {
1082
  /**
1083
  * Reply slug setting field
1084
  *
1085
- * @since bbPress (r2786)
1086
  *
1087
  * @uses bbp_form_option() To output the option value
1088
  */
@@ -1099,7 +1130,7 @@ function bbp_admin_setting_callback_reply_slug() {
1099
  /**
1100
  * Topic tag slug setting field
1101
  *
1102
- * @since bbPress (r2786)
1103
  *
1104
  * @uses bbp_form_option() To output the option value
1105
  */
@@ -1117,7 +1148,7 @@ function bbp_admin_setting_callback_topic_tag_slug() {
1117
  /**
1118
  * View slug setting field
1119
  *
1120
- * @since bbPress (r2789)
1121
  *
1122
  * @uses bbp_form_option() To output the option value
1123
  */
@@ -1134,7 +1165,7 @@ function bbp_admin_setting_callback_view_slug() {
1134
  /**
1135
  * Search slug setting field
1136
  *
1137
- * @since bbPress (r4579)
1138
  *
1139
  * @uses bbp_form_option() To output the option value
1140
  */
@@ -1153,7 +1184,7 @@ function bbp_admin_setting_callback_search_slug() {
1153
  /**
1154
  * Extension settings section description for the settings page
1155
  *
1156
- * @since bbPress (r3575)
1157
  */
1158
  function bbp_admin_setting_callback_buddypress_section() {
1159
  ?>
@@ -1166,7 +1197,7 @@ function bbp_admin_setting_callback_buddypress_section() {
1166
  /**
1167
  * Allow BuddyPress group forums setting field
1168
  *
1169
- * @since bbPress (r3575)
1170
  *
1171
  * @uses checked() To display the checked attribute
1172
  */
@@ -1182,7 +1213,7 @@ function bbp_admin_setting_callback_group_forums() {
1182
  /**
1183
  * Replies per page setting field
1184
  *
1185
- * @since bbPress (r3575)
1186
  *
1187
  * @uses bbp_form_option() To output the option value
1188
  */
@@ -1199,7 +1230,7 @@ function bbp_admin_setting_callback_group_forums_root_id() {
1199
  'disabled' => '_bbp_group_forums_root_id'
1200
  ) ); ?>
1201
 
1202
- <label for="_bbp_group_forums_root_id"><?php esc_html_e( 'is the parent for all group forums', 'bbpress' ); ?></label>
1203
  <p class="description"><?php esc_html_e( 'Using the Forum Root is not recommended. Changing this does not move existing forums.', 'bbpress' ); ?></p>
1204
 
1205
  <?php
@@ -1210,7 +1241,7 @@ function bbp_admin_setting_callback_group_forums_root_id() {
1210
  /**
1211
  * Extension settings section description for the settings page
1212
  *
1213
- * @since bbPress (r3575)
1214
  */
1215
  function bbp_admin_setting_callback_akismet_section() {
1216
  ?>
@@ -1224,7 +1255,7 @@ function bbp_admin_setting_callback_akismet_section() {
1224
  /**
1225
  * Allow Akismet setting field
1226
  *
1227
- * @since bbPress (r3575)
1228
  *
1229
  * @uses checked() To display the checked attribute
1230
  */
@@ -1242,9 +1273,8 @@ function bbp_admin_setting_callback_akismet() {
1242
  /**
1243
  * The main settings page
1244
  *
1245
- * @since bbPress (r2643)
1246
  *
1247
- * @uses screen_icon() To display the screen icon
1248
  * @uses settings_fields() To output the hidden fields for the form
1249
  * @uses do_settings_sections() To output the settings sections
1250
  */
@@ -1253,9 +1283,7 @@ function bbp_admin_settings() {
1253
 
1254
  <div class="wrap">
1255
 
1256
- <?php screen_icon(); ?>
1257
-
1258
- <h2><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h2>
1259
 
1260
  <form action="options.php" method="post">
1261
 
@@ -1278,7 +1306,7 @@ function bbp_admin_settings() {
1278
  /**
1279
  * Main settings section description for the settings page
1280
  *
1281
- * @since bbPress (r3813)
1282
  */
1283
  function bbp_converter_setting_callback_main_section() {
1284
  ?>
@@ -1291,7 +1319,7 @@ function bbp_converter_setting_callback_main_section() {
1291
  /**
1292
  * Edit Platform setting field
1293
  *
1294
- * @since bbPress (r3813)
1295
  */
1296
  function bbp_converter_setting_callback_platform() {
1297
 
@@ -1299,14 +1327,15 @@ function bbp_converter_setting_callback_platform() {
1299
  $curdir = opendir( bbpress()->admin->admin_dir . 'converters/' );
1300
 
1301
  // Bail if no directory was found (how did this happen?)
1302
- if ( empty( $curdir ) )
1303
  return;
 
1304
 
1305
  // Loop through files in the converters folder and assemble some options
1306
  while ( $file = readdir( $curdir ) ) {
1307
  if ( ( stristr( $file, '.php' ) ) && ( stristr( $file, 'index' ) === false ) ) {
1308
  $file = preg_replace( '/.php/', '', $file );
1309
- $platform_options .= '<option value="' . $file . '">' . esc_html( $file ) . '</option>';
1310
  }
1311
  }
1312
 
@@ -1321,7 +1350,7 @@ function bbp_converter_setting_callback_platform() {
1321
  /**
1322
  * Edit Database Server setting field
1323
  *
1324
- * @since bbPress (r3813)
1325
  */
1326
  function bbp_converter_setting_callback_dbserver() {
1327
  ?>
@@ -1335,7 +1364,7 @@ function bbp_converter_setting_callback_dbserver() {
1335
  /**
1336
  * Edit Database Server Port setting field
1337
  *
1338
- * @since bbPress (r3813)
1339
  */
1340
  function bbp_converter_setting_callback_dbport() {
1341
  ?>
@@ -1349,7 +1378,7 @@ function bbp_converter_setting_callback_dbport() {
1349
  /**
1350
  * Edit Database User setting field
1351
  *
1352
- * @since bbPress (r3813)
1353
  */
1354
  function bbp_converter_setting_callback_dbuser() {
1355
  ?>
@@ -1363,12 +1392,12 @@ function bbp_converter_setting_callback_dbuser() {
1363
  /**
1364
  * Edit Database Pass setting field
1365
  *
1366
- * @since bbPress (r3813)
1367
  */
1368
  function bbp_converter_setting_callback_dbpass() {
1369
  ?>
1370
 
1371
- <input name="_bbp_converter_db_pass" id="_bbp_converter_db_pass" type="password" value="<?php bbp_form_option( '_bbp_converter_db_pass' ); ?>" class="medium-text" />
1372
  <label for="_bbp_converter_db_pass"><?php esc_html_e( 'Password to access the database', 'bbpress' ); ?></label>
1373
 
1374
  <?php
@@ -1377,7 +1406,7 @@ function bbp_converter_setting_callback_dbpass() {
1377
  /**
1378
  * Edit Database Name setting field
1379
  *
1380
- * @since bbPress (r3813)
1381
  */
1382
  function bbp_converter_setting_callback_dbname() {
1383
  ?>
@@ -1391,7 +1420,7 @@ function bbp_converter_setting_callback_dbname() {
1391
  /**
1392
  * Main settings section description for the settings page
1393
  *
1394
- * @since bbPress (r3813)
1395
  */
1396
  function bbp_converter_setting_callback_options_section() {
1397
  ?>
@@ -1404,7 +1433,7 @@ function bbp_converter_setting_callback_options_section() {
1404
  /**
1405
  * Edit Table Prefix setting field
1406
  *
1407
- * @since bbPress (r3813)
1408
  */
1409
  function bbp_converter_setting_callback_dbprefix() {
1410
  ?>
@@ -1418,7 +1447,7 @@ function bbp_converter_setting_callback_dbprefix() {
1418
  /**
1419
  * Edit Rows Limit setting field
1420
  *
1421
- * @since bbPress (r3813)
1422
  */
1423
  function bbp_converter_setting_callback_rows() {
1424
  ?>
@@ -1433,7 +1462,7 @@ function bbp_converter_setting_callback_rows() {
1433
  /**
1434
  * Edit Delay Time setting field
1435
  *
1436
- * @since bbPress (r3813)
1437
  */
1438
  function bbp_converter_setting_callback_delay_time() {
1439
  ?>
@@ -1448,7 +1477,7 @@ function bbp_converter_setting_callback_delay_time() {
1448
  /**
1449
  * Edit Restart setting field
1450
  *
1451
- * @since bbPress (r3813)
1452
  */
1453
  function bbp_converter_setting_callback_restart() {
1454
  ?>
@@ -1463,7 +1492,7 @@ function bbp_converter_setting_callback_restart() {
1463
  /**
1464
  * Edit Clean setting field
1465
  *
1466
- * @since bbPress (r3813)
1467
  */
1468
  function bbp_converter_setting_callback_clean() {
1469
  ?>
@@ -1478,7 +1507,7 @@ function bbp_converter_setting_callback_clean() {
1478
  /**
1479
  * Edit Convert Users setting field
1480
  *
1481
- * @since bbPress (r3813)
1482
  */
1483
  function bbp_converter_setting_callback_convert_users() {
1484
  ?>
@@ -1495,7 +1524,6 @@ function bbp_converter_setting_callback_convert_users() {
1495
  /**
1496
  * The main settings page
1497
  *
1498
- * @uses screen_icon() To display the screen icon
1499
  * @uses settings_fields() To output the hidden fields for the form
1500
  * @uses do_settings_sections() To output the settings sections
1501
  */
@@ -1503,9 +1531,7 @@ function bbp_converter_settings() {
1503
  ?>
1504
 
1505
  <div class="wrap">
1506
-
1507
- <?php screen_icon( 'tools' ); ?>
1508
-
1509
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( esc_html__( 'Import Forums', 'bbpress' ) ); ?></h2>
1510
 
1511
  <form action="#" method="post" id="bbp-converter-settings">
@@ -1532,7 +1558,8 @@ function bbp_converter_settings() {
1532
  /**
1533
  * Contextual help for Forums settings page
1534
  *
1535
- * @since bbPress (r3119)
 
1536
  * @uses get_current_screen()
1537
  */
1538
  function bbp_admin_settings_help() {
@@ -1540,15 +1567,16 @@ function bbp_admin_settings_help() {
1540
  $current_screen = get_current_screen();
1541
 
1542
  // Bail if current screen could not be found
1543
- if ( empty( $current_screen ) )
1544
  return;
 
1545
 
1546
  // Overview
1547
  $current_screen->add_help_tab( array(
1548
  'id' => 'overview',
1549
  'title' => __( 'Overview', 'bbpress' ),
1550
  'content' => '<p>' . __( 'This screen provides access to all of the Forums settings.', 'bbpress' ) . '</p>' .
1551
- '<p>' . __( 'Please see the additional help tabs for more information on each indiviual section.', 'bbpress' ) . '</p>'
1552
  ) );
1553
 
1554
  // Main Settings
@@ -1593,8 +1621,8 @@ function bbp_admin_settings_help() {
1593
  // Help Sidebar
1594
  $current_screen->set_help_sidebar(
1595
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
1596
- '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
1597
- '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
1598
  );
1599
  }
1600
 
@@ -1602,18 +1630,18 @@ function bbp_admin_settings_help() {
1602
  * Disable a settings field if the value is forcibly set in bbPress's global
1603
  * options array.
1604
  *
1605
- * @since bbPress (r4347)
1606
  *
1607
  * @param string $option_key
1608
  */
1609
  function bbp_maybe_admin_setting_disabled( $option_key = '' ) {
1610
- disabled( isset( bbpress()->options[$option_key] ) );
1611
  }
1612
 
1613
  /**
1614
  * Output settings API option
1615
  *
1616
- * @since bbPress (r3203)
1617
  *
1618
  * @uses bbp_get_bbp_form_option()
1619
  *
@@ -1627,7 +1655,7 @@ function bbp_form_option( $option, $default = '' , $slug = false ) {
1627
  /**
1628
  * Return settings API option
1629
  *
1630
- * @since bbPress (r3203)
1631
  *
1632
  * @uses get_option()
1633
  * @uses esc_attr()
@@ -1652,8 +1680,9 @@ function bbp_form_option( $option, $default = '' , $slug = false ) {
1652
  }
1653
 
1654
  // Fallback to default
1655
- if ( empty( $value ) )
1656
  $value = $default;
 
1657
 
1658
  // Allow plugins to further filter the output
1659
  return apply_filters( 'bbp_get_form_option', $value, $option );
@@ -1662,7 +1691,7 @@ function bbp_form_option( $option, $default = '' , $slug = false ) {
1662
  /**
1663
  * Used to check if a bbPress slug conflicts with an existing known slug.
1664
  *
1665
- * @since bbPress (r3306)
1666
  *
1667
  * @param string $slug
1668
  * @param string $default
@@ -1730,11 +1759,15 @@ function bbp_form_slug_conflict_check( $slug, $default ) {
1730
  $bp = buddypress();
1731
 
1732
  // Loop through root slugs and check for conflict
1733
- if ( !empty( $bp->pages ) ) {
1734
  foreach ( $bp->pages as $page => $page_data ) {
1735
  $page_base = $page . '_base';
1736
  $page_title = sprintf( __( '%s page', 'bbpress' ), $page_data->title );
1737
- $core_slugs[$page_base] = array( 'name' => $page_title, 'default' => $page_data->slug, 'context' => 'BuddyPress' );
 
 
 
 
1738
  }
1739
  }
1740
  }
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
  /** Sections ******************************************************************/
14
 
15
  /**
16
  * Get the Forums settings sections.
17
  *
18
+ * @since 2.1.0 bbPress (r4001)
19
+ *
20
  * @return array
21
  */
22
  function bbp_admin_get_settings_sections() {
77
  /**
78
  * Get all of the settings fields.
79
  *
80
+ * @since 2.1.0 bbPress (r4001)
81
+ *
82
  * @return type
83
  */
84
  function bbp_admin_get_settings_fields() {
93
  'title' => __( 'Disallow editing after', 'bbpress' ),
94
  'callback' => 'bbp_admin_setting_callback_editlock',
95
  'sanitize_callback' => 'intval',
96
+ 'args' => array( 'label_for' => '_bbp_edit_lock' )
97
  ),
98
 
99
  // Throttle setting
101
  'title' => __( 'Throttle posting every', 'bbpress' ),
102
  'callback' => 'bbp_admin_setting_callback_throttle',
103
  'sanitize_callback' => 'intval',
104
+ 'args' => array( 'label_for' => '_bbp_throttle_time' )
105
  ),
106
 
107
  // Allow anonymous posting setting
163
  'args' => array()
164
  ),
165
 
166
+ // Allow per-forum moderators
167
+ '_bbp_allow_forum_mods' => array(
168
+ 'title' => __( 'Forum Moderators', 'bbpress' ),
169
+ 'callback' => 'bbp_admin_setting_callback_forum_mods',
170
+ 'sanitize_callback' => 'intval',
171
+ 'args' => array()
172
+ ),
173
+
174
  // Allow topic tags
175
  '_bbp_allow_search' => array(
176
  'title' => __( 'Search', 'bbpress' ),
232
  'title' => __( 'Topics', 'bbpress' ),
233
  'callback' => 'bbp_admin_setting_callback_topics_per_page',
234
  'sanitize_callback' => 'intval',
235
+ 'args' => array( 'label_for' => '_bbp_topics_per_page' )
236
  ),
237
 
238
  // Replies per page setting
240
  'title' => __( 'Replies', 'bbpress' ),
241
  'callback' => 'bbp_admin_setting_callback_replies_per_page',
242
  'sanitize_callback' => 'intval',
243
+ 'args' => array( 'label_for' => '_bbp_replies_per_page' )
244
  )
245
  ),
246
 
253
  'title' => __( 'Topics', 'bbpress' ),
254
  'callback' => 'bbp_admin_setting_callback_topics_per_rss_page',
255
  'sanitize_callback' => 'intval',
256
+ 'args' => array( 'label_for' => '_bbp_topics_per_rss_page' )
257
  ),
258
 
259
  // Replies per page setting
261
  'title' => __( 'Replies', 'bbpress' ),
262
  'callback' => 'bbp_admin_setting_callback_replies_per_rss_page',
263
  'sanitize_callback' => 'intval',
264
+ 'args' => array( 'label_for' => '_bbp_replies_per_rss_page' )
265
  )
266
  ),
267
 
274
  'title' => __( 'Forum Root', 'bbpress' ),
275
  'callback' => 'bbp_admin_setting_callback_root_slug',
276
  'sanitize_callback' => 'bbp_sanitize_slug',
277
+ 'args' => array( 'label_for' => '_bbp_root_slug' )
278
  ),
279
 
280
  // Include root setting
290
  'title' => __( 'Forum root should show', 'bbpress' ),
291
  'callback' => 'bbp_admin_setting_callback_show_on_root',
292
  'sanitize_callback' => 'sanitize_text_field',
293
+ 'args' => array( 'label_for'=>'_bbp_show_on_root' )
294
  ),
295
  ),
296
 
303
  'title' => __( 'Forum', 'bbpress' ),
304
  'callback' => 'bbp_admin_setting_callback_forum_slug',
305
  'sanitize_callback' => 'bbp_sanitize_slug',
306
+ 'args' => array( 'label_for'=>'_bbp_forum_slug' )
307
  ),
308
 
309
  // Topic slug setting
311
  'title' => __( 'Topic', 'bbpress' ),
312
  'callback' => 'bbp_admin_setting_callback_topic_slug',
313
  'sanitize_callback' => 'bbp_sanitize_slug',
314
+ 'args' => array( 'label_for'=>'_bbp_topic_slug' )
315
  ),
316
 
317
  // Topic tag slug setting
319
  'title' => __( 'Topic Tag', 'bbpress' ),
320
  'callback' => 'bbp_admin_setting_callback_topic_tag_slug',
321
  'sanitize_callback' => 'bbp_sanitize_slug',
322
+ 'args' => array( 'label_for'=>'_bbp_topic_tag_slug' )
323
  ),
324
 
325
  // View slug setting
327
  'title' => __( 'Topic View', 'bbpress' ),
328
  'callback' => 'bbp_admin_setting_callback_view_slug',
329
  'sanitize_callback' => 'bbp_sanitize_slug',
330
+ 'args' => array( 'label_for'=>'_bbp_view_slug' )
331
  ),
332
 
333
  // Reply slug setting
334
  '_bbp_reply_slug' => array(
335
+ 'title' => _x( 'Reply', 'noun', 'bbpress' ),
336
  'callback' => 'bbp_admin_setting_callback_reply_slug',
337
  'sanitize_callback' => 'bbp_sanitize_slug',
338
+ 'args' => array( 'label_for'=>'_bbp_reply_slug' )
339
  ),
340
 
341
  // Search slug setting
343
  'title' => __( 'Search', 'bbpress' ),
344
  'callback' => 'bbp_admin_setting_callback_search_slug',
345
  'sanitize_callback' => 'bbp_sanitize_slug',
346
+ 'args' => array( 'label_for'=>'_bbp_search_slug' )
347
  )
348
  ),
349
 
356
  'title' => __( 'User Base', 'bbpress' ),
357
  'callback' => 'bbp_admin_setting_callback_user_slug',
358
  'sanitize_callback' => 'bbp_sanitize_slug',
359
+ 'args' => array( 'label_for'=>'_bbp_user_slug' )
360
  ),
361
 
362
  // Topics slug setting
364
  'title' => __( 'Topics Started', 'bbpress' ),
365
  'callback' => 'bbp_admin_setting_callback_topic_archive_slug',
366
  'sanitize_callback' => 'bbp_sanitize_slug',
367
+ 'args' => array( 'label_for'=>'_bbp_topic_archive_slug' )
368
  ),
369
 
370
  // Replies slug setting
372
  'title' => __( 'Replies Created', 'bbpress' ),
373
  'callback' => 'bbp_admin_setting_callback_reply_archive_slug',
374
  'sanitize_callback' => 'bbp_sanitize_slug',
375
+ 'args' => array( 'label_for'=>'_bbp_reply_archive_slug' )
376
  ),
377
 
378
  // Favorites slug setting
380
  'title' => __( 'Favorite Topics', 'bbpress' ),
381
  'callback' => 'bbp_admin_setting_callback_user_favs_slug',
382
  'sanitize_callback' => 'bbp_sanitize_slug',
383
+ 'args' => array( 'label_for'=>'_bbp_user_favs_slug' )
384
  ),
385
 
386
  // Subscriptions slug setting
387
  '_bbp_user_subs_slug' => array(
388
+ 'title' => __( 'Subscriptions', 'bbpress' ),
389
  'callback' => 'bbp_admin_setting_callback_user_subs_slug',
390
  'sanitize_callback' => 'bbp_sanitize_slug',
391
+ 'args' => array( 'label_for'=>'_bbp_user_subs_slug' )
392
  )
393
  ),
394
 
409
  'title' => __( 'Group Forums Parent', 'bbpress' ),
410
  'callback' => 'bbp_admin_setting_callback_group_forums_root_id',
411
  'sanitize_callback' => 'intval',
412
+ 'args' => array( 'label_for'=>'_bbp_group_forums_root_id' )
413
  )
414
  ),
415
 
431
  /**
432
  * Get settings fields by section.
433
  *
434
+ * @since 2.1.0 bbPress (r4001)
435
+ *
436
  * @param string $section_id
437
  * @return mixed False if section is invalid, array of fields otherwise.
438
  */
439
  function bbp_admin_get_settings_fields_for_section( $section_id = '' ) {
440
 
441
  // Bail if section is empty
442
+ if ( empty( $section_id ) ) {
443
  return false;
444
+ }
445
 
446
  $fields = bbp_admin_get_settings_fields();
447
+ $retval = isset( $fields[ $section_id ] )
448
+ ? $fields[ $section_id ]
449
+ : false;
450
 
451
  return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
452
  }
456
  /**
457
  * User settings section description for the settings page
458
  *
459
+ * @since 2.0.0 bbPress (r2786)
460
  */
461
  function bbp_admin_setting_callback_user_section() {
462
  ?>
470
  /**
471
  * Edit lock setting field
472
  *
473
+ * @since 2.0.0 bbPress (r2737)
474
  *
475
  * @uses bbp_form_option() To output the option value
476
  */
478
  ?>
479
 
480
  <input name="_bbp_edit_lock" id="_bbp_edit_lock" type="number" min="0" step="1" value="<?php bbp_form_option( '_bbp_edit_lock', '5' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_edit_lock' ); ?> />
481
+ <?php esc_html_e( 'minutes', 'bbpress' ); ?>
482
 
483
  <?php
484
  }
486
  /**
487
  * Throttle setting field
488
  *
489
+ * @since 2.0.0 bbPress (r2737)
490
  *
491
  * @uses bbp_form_option() To output the option value
492
  */
494
  ?>
495
 
496
  <input name="_bbp_throttle_time" id="_bbp_throttle_time" type="number" min="0" step="1" value="<?php bbp_form_option( '_bbp_throttle_time', '10' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_throttle_time' ); ?> />
497
+ <?php esc_html_e( 'seconds', 'bbpress' ); ?>
498
 
499
  <?php
500
  }
502
  /**
503
  * Allow anonymous posting setting field
504
  *
505
+ * @since 2.0.0 bbPress (r2737)
506
  *
507
  * @uses checked() To display the checked attribute
508
  */
518
  /**
519
  * Allow global access setting field
520
  *
521
+ * @since 2.0.0 bbPress (r3378)
522
  *
523
  * @uses checked() To display the checked attribute
524
  */
555
  /**
556
  * Features settings section description for the settings page
557
  *
558
+ * @since 2.0.0 bbPress (r2786)
559
  */
560
  function bbp_admin_setting_callback_features_section() {
561
  ?>
568
  /**
569
  * Allow favorites setting field
570
  *
571
+ * @since 2.0.0 bbPress (r2786)
572
  *
573
  * @uses checked() To display the checked attribute
574
  */
584
  /**
585
  * Allow subscriptions setting field
586
  *
587
+ * @since 2.0.0 bbPress (r2737)
588
  *
589
  * @uses checked() To display the checked attribute
590
  */
600
  /**
601
  * Allow topic tags setting field
602
  *
603
+ * @since 2.4.0 bbPress (r4944)
604
  *
605
  * @uses checked() To display the checked attribute
606
  */
613
  <?php
614
  }
615
 
616
+ /**
617
+ * Allow forum-mods setting field
618
+ *
619
+ * @since 2.6.0 bbPress (r5834)
620
+ *
621
+ * @uses checked() To display the checked attribute
622
+ */
623
+ function bbp_admin_setting_callback_forum_mods() {
624
+ ?>
625
+
626
+ <input name="_bbp_allow_forum_mods" id="_bbp_allow_forum_mods" type="checkbox" value="1" <?php checked( bbp_allow_forum_mods( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_forum_mods' ); ?> />
627
+ <label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label>
628
+
629
+ <?php
630
+ }
631
+
632
  /**
633
  * Allow forum wide search
634
  *
635
+ * @since 2.4.0 bbPress (r4970)
636
  *
637
  * @uses checked() To display the checked attribute
638
  */
650
  *
651
  * Replies will be threaded if depth is 2 or greater
652
  *
653
+ * @since 2.4.0 bbPress (r4944)
654
  *
655
  * @uses apply_filters() Calls 'bbp_thread_replies_depth_max' to set a
656
  * maximum displayed level
688
  /**
689
  * Allow topic and reply revisions
690
  *
691
+ * @since 2.0.0 bbPress (r3412)
692
  *
693
  * @uses checked() To display the checked attribute
694
  */
704
  /**
705
  * Use the WordPress editor setting field
706
  *
707
+ * @since 2.1.0 bbPress (r3586)
708
  *
709
  * @uses checked() To display the checked attribute
710
  */
720
  /**
721
  * Main subtheme section
722
  *
723
+ * @since 2.0.0 bbPress (r2786)
724
  */
725
  function bbp_admin_setting_callback_subtheme_section() {
726
  ?>
733
  /**
734
  * Use the WordPress editor setting field
735
  *
736
+ * @since 2.1.0 bbPress (r3586)
737
  *
738
  * @uses checked() To display the checked attribute
739
  */
752
  $theme_options .= '<option value="' . esc_attr( $id ) . '"' . selected( $theme->id, $current_package, false ) . '>' . sprintf( esc_html__( '%1$s - %2$s', 'bbpress' ), esc_html( $theme->name ), esc_html( str_replace( WP_CONTENT_DIR, '', $theme->dir ) ) ) . '</option>';
753
  }
754
 
755
+ if ( ! empty( $theme_options ) ) : ?>
756
 
757
  <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select>
758
  <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
767
  /**
768
  * Allow oEmbed in replies
769
  *
770
+ * @since 2.1.0 bbPress (r3752)
771
  *
772
  * @uses checked() To display the checked attribute
773
  */
785
  /**
786
  * Per page settings section description for the settings page
787
  *
788
+ * @since 2.0.0 bbPress (r2786)
789
  */
790
  function bbp_admin_setting_callback_per_page_section() {
791
  ?>
798
  /**
799
  * Topics per page setting field
800
  *
801
+ * @since 2.0.0 bbPress (r2786)
802
  *
803
  * @uses bbp_form_option() To output the option value
804
  */
806
  ?>
807
 
808
  <input name="_bbp_topics_per_page" id="_bbp_topics_per_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_topics_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_page' ); ?> />
809
+ <?php esc_html_e( 'per page', 'bbpress' ); ?>
810
 
811
  <?php
812
  }
814
  /**
815
  * Replies per page setting field
816
  *
817
+ * @since 2.0.0 bbPress (r2786)
818
  *
819
  * @uses bbp_form_option() To output the option value
820
  */
822
  ?>
823
 
824
  <input name="_bbp_replies_per_page" id="_bbp_replies_per_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_replies_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_page' ); ?> />
825
+ <?php esc_html_e( 'per page', 'bbpress' ); ?>
826
 
827
  <?php
828
  }
832
  /**
833
  * Per page settings section description for the settings page
834
  *
835
+ * @since 2.0.0 bbPress (r2786)
836
  */
837
  function bbp_admin_setting_callback_per_rss_page_section() {
838
  ?>
845
  /**
846
  * Topics per RSS page setting field
847
  *
848
+ * @since 2.0.0 bbPress (r2786)
849
  *
850
  * @uses bbp_form_option() To output the option value
851
  */
853
  ?>
854
 
855
  <input name="_bbp_topics_per_rss_page" id="_bbp_topics_per_rss_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_topics_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_rss_page' ); ?> />
856
+ <?php esc_html_e( 'per page', 'bbpress' ); ?>
857
 
858
  <?php
859
  }
861
  /**
862
  * Replies per RSS page setting field
863
  *
864
+ * @since 2.0.0 bbPress (r2786)
865
  *
866
  * @uses bbp_form_option() To output the option value
867
  */
869
  ?>
870
 
871
  <input name="_bbp_replies_per_rss_page" id="_bbp_replies_per_rss_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_replies_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_rss_page' ); ?> />
872
+ <?php esc_html_e( 'per page', 'bbpress' ); ?>
873
 
874
  <?php
875
  }
879
  /**
880
  * Slugs settings section description for the settings page
881
  *
882
+ * @since 2.0.0 bbPress (r2786)
883
  */
884
  function bbp_admin_setting_callback_root_slug_section() {
885
 
886
  // Flush rewrite rules when this section is saved
887
+ if ( isset( $_GET['settings-updated'] ) && isset( $_GET['page'] ) ) {
888
+ flush_rewrite_rules();
889
+ } ?>
890
 
891
  <p><?php esc_html_e( 'Customize your Forums root. Partner with a WordPress Page and use Shortcodes for more flexibility.', 'bbpress' ); ?></p>
892
 
896
  /**
897
  * Root slug setting field
898
  *
899
+ * @since 2.0.0 bbPress (r2786)
900
  *
901
  * @uses bbp_form_option() To output the option value
902
  */
903
  function bbp_admin_setting_callback_root_slug() {
904
  ?>
905
 
906
+ <input name="_bbp_root_slug" id="_bbp_root_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_root_slug', 'forums', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_root_slug' ); ?> />
907
 
908
  <?php
909
  // Slug Check
913
  /**
914
  * Include root slug setting field
915
  *
916
+ * @since 2.0.0 bbPress (r2786)
917
  *
918
  * @uses checked() To display the checked attribute
919
  */
929
  /**
930
  * Include root slug setting field
931
  *
932
+ * @since 2.0.0 bbPress (r2786)
933
  *
934
  * @uses checked() To display the checked attribute
935
  */
944
  'name' => __( 'Forum Index', 'bbpress' )
945
  ),
946
  'topics' => array(
947
+ 'name' => __( 'Topics by Last Post', 'bbpress' )
948
  )
949
  ); ?>
950
 
966
  /**
967
  * Slugs settings section description for the settings page
968
  *
969
+ * @since 2.0.0 bbPress (r2786)
970
  */
971
  function bbp_admin_setting_callback_user_slug_section() {
972
  ?>
979
  /**
980
  * User slug setting field
981
  *
982
+ * @since 2.0.0 bbPress (r2786)
983
  *
984
  * @uses bbp_form_option() To output the option value
985
  */
996
  /**
997
  * Topic archive slug setting field
998
  *
999
+ * @since 2.0.0 bbPress (r2786)
1000
  *
1001
  * @uses bbp_form_option() To output the option value
1002
  */
1013
  /**
1014
  * Reply archive slug setting field
1015
  *
1016
+ * @since 2.4.0 bbPress (r4932)
1017
  *
1018
  * @uses bbp_form_option() To output the option value
1019
  */
1030
  /**
1031
  * Favorites slug setting field
1032
  *
1033
+ * @since 2.4.0 bbPress (r4932)
1034
  *
1035
  * @uses bbp_form_option() To output the option value
1036
  */
1041
 
1042
  <?php
1043
  // Slug Check
1044
+ bbp_form_slug_conflict_check( '_bbp_user_favs_slug', 'favorites' );
1045
  }
1046
 
1047
  /**
1048
+ * Subscriptions slug setting field
1049
  *
1050
+ * @since 2.4.0 bbPress (r4932)
1051
  *
1052
  * @uses bbp_form_option() To output the option value
1053
  */
1066
  /**
1067
  * Slugs settings section description for the settings page
1068
  *
1069
+ * @since 2.0.0 bbPress (r2786)
1070
  */
1071
  function bbp_admin_setting_callback_single_slug_section() {
1072
  ?>
1079
  /**
1080
  * Forum slug setting field
1081
  *
1082
+ * @since 2.0.0 bbPress (r2786)
1083
  *
1084
  * @uses bbp_form_option() To output the option value
1085
  */
1096
  /**
1097
  * Topic slug setting field
1098
  *
1099
+ * @since 2.0.0 bbPress (r2786)
1100
  *
1101
  * @uses bbp_form_option() To output the option value
1102
  */
1113
  /**
1114
  * Reply slug setting field
1115
  *
1116
+ * @since 2.0.0 bbPress (r2786)
1117
  *
1118
  * @uses bbp_form_option() To output the option value
1119
  */
1130
  /**
1131
  * Topic tag slug setting field
1132
  *
1133
+ * @since 2.0.0 bbPress (r2786)
1134
  *
1135
  * @uses bbp_form_option() To output the option value
1136
  */
1148
  /**
1149
  * View slug setting field
1150
  *
1151
+ * @since 2.0.0 bbPress (r2789)
1152
  *
1153
  * @uses bbp_form_option() To output the option value
1154
  */
1165
  /**
1166
  * Search slug setting field
1167
  *
1168
+ * @since 2.3.0 bbPress (r4579)
1169
  *
1170
  * @uses bbp_form_option() To output the option value
1171
  */
1184
  /**
1185
  * Extension settings section description for the settings page
1186
  *
1187
+ * @since 2.1.0 bbPress (r3575)
1188
  */
1189
  function bbp_admin_setting_callback_buddypress_section() {
1190
  ?>
1197
  /**
1198
  * Allow BuddyPress group forums setting field
1199
  *
1200
+ * @since 2.1.0 bbPress (r3575)
1201
  *
1202
  * @uses checked() To display the checked attribute
1203
  */
1213
  /**
1214
  * Replies per page setting field
1215
  *
1216
+ * @since 2.1.0 bbPress (r3575)
1217
  *
1218
  * @uses bbp_form_option() To output the option value
1219
  */
1230
  'disabled' => '_bbp_group_forums_root_id'
1231
  ) ); ?>
1232
 
1233
+ <?php esc_html_e( 'is the parent for all group forums', 'bbpress' ); ?>
1234
  <p class="description"><?php esc_html_e( 'Using the Forum Root is not recommended. Changing this does not move existing forums.', 'bbpress' ); ?></p>
1235
 
1236
  <?php
1241
  /**
1242
  * Extension settings section description for the settings page
1243
  *
1244
+ * @since 2.1.0 bbPress (r3575)
1245
  */
1246
  function bbp_admin_setting_callback_akismet_section() {
1247
  ?>
1255
  /**
1256
  * Allow Akismet setting field
1257
  *
1258
+ * @since 2.1.0 bbPress (r3575)
1259
  *
1260
  * @uses checked() To display the checked attribute
1261
  */
1273
  /**
1274
  * The main settings page
1275
  *
1276
+ * @since 2.0.0 bbPress (r2643)
1277
  *
 
1278
  * @uses settings_fields() To output the hidden fields for the form
1279
  * @uses do_settings_sections() To output the settings sections
1280
  */
1283
 
1284
  <div class="wrap">
1285
 
1286
+ <h1><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h1>
 
 
1287
 
1288
  <form action="options.php" method="post">
1289
 
1306
  /**
1307
  * Main settings section description for the settings page
1308
  *
1309
+ * @since 2.1.0 bbPress (r3813)
1310
  */
1311
  function bbp_converter_setting_callback_main_section() {
1312
  ?>
1319
  /**
1320
  * Edit Platform setting field
1321
  *
1322
+ * @since 2.1.0 bbPress (r3813)
1323
  */
1324
  function bbp_converter_setting_callback_platform() {
1325
 
1327
  $curdir = opendir( bbpress()->admin->admin_dir . 'converters/' );
1328
 
1329
  // Bail if no directory was found (how did this happen?)
1330
+ if ( empty( $curdir ) ) {
1331
  return;
1332
+ }
1333
 
1334
  // Loop through files in the converters folder and assemble some options
1335
  while ( $file = readdir( $curdir ) ) {
1336
  if ( ( stristr( $file, '.php' ) ) && ( stristr( $file, 'index' ) === false ) ) {
1337
  $file = preg_replace( '/.php/', '', $file );
1338
+ $platform_options .= '<option value="' . esc_attr( $file ) . '">' . esc_html( $file ) . '</option>';
1339
  }
1340
  }
1341
 
1350
  /**
1351
  * Edit Database Server setting field
1352
  *
1353
+ * @since 2.1.0 bbPress (r3813)
1354
  */
1355
  function bbp_converter_setting_callback_dbserver() {
1356
  ?>
1364
  /**
1365
  * Edit Database Server Port setting field
1366
  *
1367
+ * @since 2.1.0 bbPress (r3813)
1368
  */
1369
  function bbp_converter_setting_callback_dbport() {
1370
  ?>
1378
  /**
1379
  * Edit Database User setting field
1380
  *
1381
+ * @since 2.1.0 bbPress (r3813)
1382
  */
1383
  function bbp_converter_setting_callback_dbuser() {
1384
  ?>
1392
  /**
1393
  * Edit Database Pass setting field
1394
  *
1395
+ * @since 2.1.0 bbPress (r3813)
1396
  */
1397
  function bbp_converter_setting_callback_dbpass() {
1398
  ?>
1399
 
1400
+ <input name="_bbp_converter_db_pass" id="_bbp_converter_db_pass" type="password" value="<?php bbp_form_option( '_bbp_converter_db_pass' ); ?>" class="medium-text" autocomplete="off" />
1401
  <label for="_bbp_converter_db_pass"><?php esc_html_e( 'Password to access the database', 'bbpress' ); ?></label>
1402
 
1403
  <?php
1406
  /**
1407
  * Edit Database Name setting field
1408
  *
1409
+ * @since 2.1.0 bbPress (r3813)
1410
  */
1411
  function bbp_converter_setting_callback_dbname() {
1412
  ?>
1420
  /**
1421
  * Main settings section description for the settings page
1422
  *
1423
+ * @since 2.1.0 bbPress (r3813)
1424
  */
1425
  function bbp_converter_setting_callback_options_section() {
1426
  ?>
1433
  /**
1434
  * Edit Table Prefix setting field
1435
  *
1436
+ * @since 2.1.0 bbPress (r3813)
1437
  */
1438
  function bbp_converter_setting_callback_dbprefix() {
1439
  ?>
1447
  /**
1448
  * Edit Rows Limit setting field
1449
  *
1450
+ * @since 2.1.0 bbPress (r3813)
1451
  */
1452
  function bbp_converter_setting_callback_rows() {
1453
  ?>
1462
  /**
1463
  * Edit Delay Time setting field
1464
  *
1465
+ * @since 2.1.0 bbPress (r3813)
1466
  */
1467
  function bbp_converter_setting_callback_delay_time() {
1468
  ?>
1477
  /**
1478
  * Edit Restart setting field
1479
  *
1480
+ * @since 2.1.0 bbPress (r3813)
1481
  */
1482
  function bbp_converter_setting_callback_restart() {
1483
  ?>
1492
  /**
1493
  * Edit Clean setting field
1494
  *
1495
+ * @since 2.1.0 bbPress (r3813)
1496
  */
1497
  function bbp_converter_setting_callback_clean() {
1498
  ?>
1507
  /**
1508
  * Edit Convert Users setting field
1509
  *
1510
+ * @since 2.1.0 bbPress (r3813)
1511
  */
1512
  function bbp_converter_setting_callback_convert_users() {
1513
  ?>
1524
  /**
1525
  * The main settings page
1526
  *
 
1527
  * @uses settings_fields() To output the hidden fields for the form
1528
  * @uses do_settings_sections() To output the settings sections
1529
  */
1531
  ?>
1532
 
1533
  <div class="wrap">
1534
+ <h1><?php esc_html_e( 'Forum Tools', 'bbpress' ); ?></h1>
 
 
1535
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( esc_html__( 'Import Forums', 'bbpress' ) ); ?></h2>
1536
 
1537
  <form action="#" method="post" id="bbp-converter-settings">
1558
  /**
1559
  * Contextual help for Forums settings page
1560
  *
1561
+ * @since 2.0.0 bbPress (r3119)
1562
+ *
1563
  * @uses get_current_screen()
1564
  */
1565
  function bbp_admin_settings_help() {
1567
  $current_screen = get_current_screen();
1568
 
1569
  // Bail if current screen could not be found
1570
+ if ( empty( $current_screen ) ) {
1571
  return;
1572
+ }
1573
 
1574
  // Overview
1575
  $current_screen->add_help_tab( array(
1576
  'id' => 'overview',
1577
  'title' => __( 'Overview', 'bbpress' ),
1578
  'content' => '<p>' . __( 'This screen provides access to all of the Forums settings.', 'bbpress' ) . '</p>' .
1579
+ '<p>' . __( 'Please see the additional help tabs for more information on each individual section.', 'bbpress' ) . '</p>'
1580
  ) );
1581
 
1582
  // Main Settings
1621
  // Help Sidebar
1622
  $current_screen->set_help_sidebar(
1623
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
1624
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
1625
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
1626
  );
1627
  }
1628
 
1630
  * Disable a settings field if the value is forcibly set in bbPress's global
1631
  * options array.
1632
  *
1633
+ * @since 2.2.0 bbPress (r4347)
1634
  *
1635
  * @param string $option_key
1636
  */
1637
  function bbp_maybe_admin_setting_disabled( $option_key = '' ) {
1638
+ disabled( isset( bbpress()->options[ $option_key ] ) );
1639
  }
1640
 
1641
  /**
1642
  * Output settings API option
1643
  *
1644
+ * @since 2.0.0 bbPress (r3203)
1645
  *
1646
  * @uses bbp_get_bbp_form_option()
1647
  *
1655
  /**
1656
  * Return settings API option
1657
  *
1658
+ * @since 2.0.0 bbPress (r3203)
1659
  *
1660
  * @uses get_option()
1661
  * @uses esc_attr()
1680
  }
1681
 
1682
  // Fallback to default
1683
+ if ( empty( $value ) ) {
1684
  $value = $default;
1685
+ }
1686
 
1687
  // Allow plugins to further filter the output
1688
  return apply_filters( 'bbp_get_form_option', $value, $option );
1691
  /**
1692
  * Used to check if a bbPress slug conflicts with an existing known slug.
1693
  *
1694
+ * @since 2.0.0 bbPress (r3306)
1695
  *
1696
  * @param string $slug
1697
  * @param string $default
1759
  $bp = buddypress();
1760
 
1761
  // Loop through root slugs and check for conflict
1762
+ if ( ! empty( $bp->pages ) ) {
1763
  foreach ( $bp->pages as $page => $page_data ) {
1764
  $page_base = $page . '_base';
1765
  $page_title = sprintf( __( '%s page', 'bbpress' ), $page_data->title );
1766
+ $core_slugs[ $page_base ] = array(
1767
+ 'name' => $page_title,
1768
+ 'default' => $page_data->slug,
1769
+ 'context' => 'BuddyPress'
1770
+ );
1771
  }
1772
  }
1773
  }
includes/admin/styles/evergreen-rtl.css DELETED
@@ -1,168 +0,0 @@
1
- /* Dashicons mixin use: @include dashicons( '\f140' ); */
2
- /* Button mixin- creates 3d-ish button effect with correct highlights/shadows, based on a base color. */
3
- html { background: #f2f2f2; }
4
-
5
- /* Links */
6
- a { color: #0074a2; }
7
- a:hover, a:active, a:focus { color: #0099d5; }
8
-
9
- #rightnow a:hover, #media-upload a.del-link:hover, div.dashboard-widget-submit input:hover, .subsubsub a:hover, .subsubsub a.current:hover, .ui-tabs-nav a:hover { color: #0099d5; }
10
-
11
- /* Forms */
12
- input[type=checkbox]:checked:before { color: #56b274; }
13
-
14
- input[type=radio]:checked:before { background: #56b274; }
15
-
16
- .wp-core-ui input[type="reset"]:hover, .wp-core-ui input[type="reset"]:active { color: #0099d5; }
17
-
18
- /* Core UI */
19
- .wp-core-ui .button-primary { background: #56b274; border-color: #43925d; color: white; -webkit-box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); }
20
- .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus { background: #469961; border-color: #3b8152; color: white; -webkit-box-shadow: inset 0 1px 0 #79c291, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #79c291, 0 1px 0 rgba(0, 0, 0, 0.15); }
21
- .wp-core-ui .button-primary:active { background: #469961; border-color: #3b8152; color: white; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); }
22
- .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled { color: #c7d1ca !important; background: #469961 !important; border-color: #3b8152 !important; text-shadow: none !important; }
23
- .wp-core-ui .wp-ui-primary { color: white; background-color: #446950; }
24
- .wp-core-ui .wp-ui-text-primary { color: #446950; }
25
- .wp-core-ui .wp-ui-highlight { color: white; background-color: #56b274; }
26
- .wp-core-ui .wp-ui-text-highlight { color: #56b274; }
27
- .wp-core-ui .wp-ui-notification { color: white; background-color: #36b360; }
28
- .wp-core-ui .wp-ui-text-notification { color: #36b360; }
29
- .wp-core-ui .wp-ui-text-icon { color: #f1f3f2; }
30
-
31
- /* List tables */
32
- .wrap .add-new-h2:hover, #add-new-comment a:hover, .tablenav .tablenav-pages a:hover, .tablenav .tablenav-pages a:focus { color: white; background-color: #446950; }
33
-
34
- .view-switch a.current:before { color: #446950; }
35
-
36
- .view-switch a:hover:before { color: #36b360; }
37
-
38
- .post-com-count:hover:after { border-top-color: #446950; }
39
-
40
- .post-com-count:hover span { color: white; background-color: #446950; }
41
-
42
- strong .post-com-count:after { border-top-color: #36b360; }
43
-
44
- strong .post-com-count span { background-color: #36b360; }
45
-
46
- /* Admin Menu */
47
- #adminmenuback, #adminmenuwrap, #adminmenu { background: #446950; }
48
-
49
- #adminmenu a { color: white; }
50
-
51
- #adminmenu div.wp-menu-image:before { color: #f1f3f2; }
52
-
53
- #adminmenu a:hover, #adminmenu li.menu-top:hover, #adminmenu li.opensub > a.menu-top, #adminmenu li > a.menu-top:focus { color: white; background-color: #56b274; }
54
-
55
- #adminmenu li.menu-top:hover div.wp-menu-image:before, #adminmenu li.opensub > a.menu-top div.wp-menu-image:before { color: white; }
56
-
57
- /* Admin Menu: submenu */
58
- #adminmenu .wp-submenu, #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .wp-has-current-submenu.opensub .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu { background: #36533f; }
59
-
60
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after { border-left-color: #36533f; }
61
-
62
- #adminmenu .wp-submenu .wp-submenu-head { color: #c6d2ca; }
63
-
64
- #adminmenu .wp-submenu a, #adminmenu .wp-has-current-submenu .wp-submenu a, .folded #adminmenu .wp-has-current-submenu .wp-submenu a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a { color: #c6d2ca; }
65
- #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover, #adminmenu .wp-has-current-submenu .wp-submenu a:focus, #adminmenu .wp-has-current-submenu .wp-submenu a:hover, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover { color: #56b274; }
66
-
67
- /* Admin Menu: current */
68
- #adminmenu .wp-submenu li.current a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a { color: white; }
69
- #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus { color: #56b274; }
70
-
71
- ul#adminmenu a.wp-has-current-submenu:after, ul#adminmenu > li.current > a.current:after { border-left-color: #eeeeee; }
72
-
73
- #adminmenu li.current a.menu-top, #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head, .folded #adminmenu li.current.menu-top { color: white; background: #56b274; }
74
-
75
- #adminmenu li.wp-has-current-submenu div.wp-menu-image:before { color: white; }
76
-
77
- /* Admin Menu: bubble */
78
- #adminmenu .awaiting-mod, #adminmenu .update-plugins { color: white; background: #36b360; }
79
-
80
- #adminmenu li.current a .awaiting-mod, #adminmenu li a.wp-has-current-submenu .update-plugins, #adminmenu li:hover a .awaiting-mod, #adminmenu li.menu-top:hover > a .update-plugins { color: white; background: #36533f; }
81
-
82
- /* Admin Menu: collapse button */
83
- #collapse-menu { color: #f1f3f2; }
84
-
85
- #collapse-menu:hover { color: white; }
86
-
87
- #collapse-button div:after { color: #f1f3f2; }
88
-
89
- #collapse-menu:hover #collapse-button div:after { color: white; }
90
-
91
- /* Admin Bar */
92
- #wpadminbar { color: white; background: #446950; }
93
-
94
- #wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon { color: white; }
95
-
96
- #wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after { color: #f1f3f2; }
97
-
98
- #wpadminbar .ab-top-menu > li:hover > .ab-item, #wpadminbar .ab-top-menu > li.hover > .ab-item, #wpadminbar .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar-nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { color: #56b274; background: #36533f; }
99
-
100
- #wpadminbar > #wp-toolbar li:hover span.ab-label, #wpadminbar > #wp-toolbar li.hover span.ab-label, #wpadminbar > #wp-toolbar a:focus span.ab-label { color: #56b274; }
101
-
102
- #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: white; }
103
-
104
- /* Admin Bar: submenu */
105
- #wpadminbar .menupop .ab-sub-wrapper { background: #36533f; }
106
-
107
- #wpadminbar .quicklinks .menupop ul.ab-sub-secondary, #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu { background: #597763; }
108
-
109
- #wpadminbar .ab-submenu .ab-item, #wpadminbar .quicklinks .menupop ul li a, #wpadminbar .quicklinks .menupop.hover ul li a, #wpadminbar-nojs .quicklinks .menupop:hover ul li a { color: #c6d2ca; }
110
-
111
- #wpadminbar .quicklinks li .blavatar, #wpadminbar .menupop .menupop > .ab-item:before { color: #f1f3f2; }
112
-
113
- #wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus, #wpadminbar .quicklinks .menupop ul li a:hover strong, #wpadminbar .quicklinks .menupop ul li a:focus strong, #wpadminbar .quicklinks .menupop.hover ul li a:hover, #wpadminbar .quicklinks .menupop.hover ul li a:focus, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li a:focus .ab-icon:before, #wpadminbar li .ab-item:focus:before, #wpadminbar li.hover .ab-icon:before, #wpadminbar li.hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li.hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: #56b274; }
114
-
115
- #wpadminbar .quicklinks li a:hover .blavatar, #wpadminbar .menupop .menupop > .ab-item:hover:before { color: #56b274; }
116
-
117
- /* Admin Bar: search */
118
- #wpadminbar #adminbarsearch:before { color: #f1f3f2; }
119
-
120
- #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus { color: white; background: #527f61; }
121
-
122
- #wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder { color: white; opacity: .7; }
123
-
124
- #wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder { color: white; opacity: .7; }
125
-
126
- #wpadminbar #adminbarsearch .adminbar-input::-moz-placeholder { color: white; opacity: .7; }
127
-
128
- #wpadminbar #adminbarsearch .adminbar-input:-ms-input-placeholder { color: white; opacity: .7; }
129
-
130
- /* Admin Bar: my account */
131
- #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { border-color: #527f61; background-color: #527f61; }
132
-
133
- #wpadminbar #wp-admin-bar-user-info .display-name { color: white; }
134
-
135
- #wpadminbar #wp-admin-bar-user-info a:hover .display-name { color: #56b274; }
136
-
137
- #wpadminbar #wp-admin-bar-user-info .username { color: #c6d2ca; }
138
-
139
- /* Pointers */
140
- .wp-pointer .wp-pointer-content h3 { background-color: #56b274; }
141
-
142
- .wp-pointer.wp-pointer-top .wp-pointer-arrow, .wp-pointer.wp-pointer-undefined .wp-pointer-arrow { border-bottom-color: #56b274; }
143
-
144
- /* Media Uploader */
145
- .media-item .bar, .media-progress-bar div { background-color: #56b274; }
146
-
147
- .details.attachment { box-shadow: 0 0 0 1px white, 0 0 0 5px #56b274; }
148
-
149
- .attachment.details .check { background-color: #56b274; box-shadow: 0 0 0 1px white, 0 0 0 2px #56b274; }
150
-
151
- /* Themes */
152
- .theme-browser .theme.active .theme-name, .theme-browser .theme.add-new-theme:hover:after { background: #56b274; }
153
-
154
- .theme-browser .theme.add-new-theme:hover span:after { color: #56b274; }
155
-
156
- .theme-overlay .theme-header .close:hover, .theme-overlay .theme-header .right:hover, .theme-overlay .theme-header .left:hover { background: #56b274; }
157
-
158
- /* jQuery UI Slider */
159
- .wp-slider .ui-slider-handle, .wp-slider .ui-slider-handle.ui-state-hover, .wp-slider .ui-slider-handle.focus { background: #56b274; border-color: #43925d; -webkit-box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); }
160
-
161
- /* Responsive Component */
162
- div#wp-responsive-toggle a:before { color: #f1f3f2; }
163
-
164
- .wp-responsive-open div#wp-responsive-toggle a { border-color: transparent; background: #56b274; }
165
-
166
- .star-rating .star { color: #56b274; }
167
-
168
- .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a { background: #36533f; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/styles/evergreen.css DELETED
@@ -1,168 +0,0 @@
1
- /* Dashicons mixin use: @include dashicons( '\f140' ); */
2
- /* Button mixin- creates 3d-ish button effect with correct highlights/shadows, based on a base color. */
3
- html { background: #f2f2f2; }
4
-
5
- /* Links */
6
- a { color: #0074a2; }
7
- a:hover, a:active, a:focus { color: #0099d5; }
8
-
9
- #rightnow a:hover, #media-upload a.del-link:hover, div.dashboard-widget-submit input:hover, .subsubsub a:hover, .subsubsub a.current:hover, .ui-tabs-nav a:hover { color: #0099d5; }
10
-
11
- /* Forms */
12
- input[type=checkbox]:checked:before { color: #56b274; }
13
-
14
- input[type=radio]:checked:before { background: #56b274; }
15
-
16
- .wp-core-ui input[type="reset"]:hover, .wp-core-ui input[type="reset"]:active { color: #0099d5; }
17
-
18
- /* Core UI */
19
- .wp-core-ui .button-primary { background: #56b274; border-color: #43925d; color: white; -webkit-box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); }
20
- .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus { background: #469961; border-color: #3b8152; color: white; -webkit-box-shadow: inset 0 1px 0 #79c291, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #79c291, 0 1px 0 rgba(0, 0, 0, 0.15); }
21
- .wp-core-ui .button-primary:active { background: #469961; border-color: #3b8152; color: white; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); }
22
- .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled { color: #c7d1ca !important; background: #469961 !important; border-color: #3b8152 !important; text-shadow: none !important; }
23
- .wp-core-ui .wp-ui-primary { color: white; background-color: #446950; }
24
- .wp-core-ui .wp-ui-text-primary { color: #446950; }
25
- .wp-core-ui .wp-ui-highlight { color: white; background-color: #56b274; }
26
- .wp-core-ui .wp-ui-text-highlight { color: #56b274; }
27
- .wp-core-ui .wp-ui-notification { color: white; background-color: #36b360; }
28
- .wp-core-ui .wp-ui-text-notification { color: #36b360; }
29
- .wp-core-ui .wp-ui-text-icon { color: #f1f3f2; }
30
-
31
- /* List tables */
32
- .wrap .add-new-h2:hover, #add-new-comment a:hover, .tablenav .tablenav-pages a:hover, .tablenav .tablenav-pages a:focus { color: white; background-color: #446950; }
33
-
34
- .view-switch a.current:before { color: #446950; }
35
-
36
- .view-switch a:hover:before { color: #36b360; }
37
-
38
- .post-com-count:hover:after { border-top-color: #446950; }
39
-
40
- .post-com-count:hover span { color: white; background-color: #446950; }
41
-
42
- strong .post-com-count:after { border-top-color: #36b360; }
43
-
44
- strong .post-com-count span { background-color: #36b360; }
45
-
46
- /* Admin Menu */
47
- #adminmenuback, #adminmenuwrap, #adminmenu { background: #446950; }
48
-
49
- #adminmenu a { color: white; }
50
-
51
- #adminmenu div.wp-menu-image:before { color: #f1f3f2; }
52
-
53
- #adminmenu a:hover, #adminmenu li.menu-top:hover, #adminmenu li.opensub > a.menu-top, #adminmenu li > a.menu-top:focus { color: white; background-color: #56b274; }
54
-
55
- #adminmenu li.menu-top:hover div.wp-menu-image:before, #adminmenu li.opensub > a.menu-top div.wp-menu-image:before { color: white; }
56
-
57
- /* Admin Menu: submenu */
58
- #adminmenu .wp-submenu, #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .wp-has-current-submenu.opensub .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu { background: #36533f; }
59
-
60
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after { border-right-color: #36533f; }
61
-
62
- #adminmenu .wp-submenu .wp-submenu-head { color: #c6d2ca; }
63
-
64
- #adminmenu .wp-submenu a, #adminmenu .wp-has-current-submenu .wp-submenu a, .folded #adminmenu .wp-has-current-submenu .wp-submenu a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a { color: #c6d2ca; }
65
- #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover, #adminmenu .wp-has-current-submenu .wp-submenu a:focus, #adminmenu .wp-has-current-submenu .wp-submenu a:hover, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover { color: #56b274; }
66
-
67
- /* Admin Menu: current */
68
- #adminmenu .wp-submenu li.current a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a { color: white; }
69
- #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus { color: #56b274; }
70
-
71
- ul#adminmenu a.wp-has-current-submenu:after, ul#adminmenu > li.current > a.current:after { border-right-color: #eeeeee; }
72
-
73
- #adminmenu li.current a.menu-top, #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head, .folded #adminmenu li.current.menu-top { color: white; background: #56b274; }
74
-
75
- #adminmenu li.wp-has-current-submenu div.wp-menu-image:before { color: white; }
76
-
77
- /* Admin Menu: bubble */
78
- #adminmenu .awaiting-mod, #adminmenu .update-plugins { color: white; background: #36b360; }
79
-
80
- #adminmenu li.current a .awaiting-mod, #adminmenu li a.wp-has-current-submenu .update-plugins, #adminmenu li:hover a .awaiting-mod, #adminmenu li.menu-top:hover > a .update-plugins { color: white; background: #36533f; }
81
-
82
- /* Admin Menu: collapse button */
83
- #collapse-menu { color: #f1f3f2; }
84
-
85
- #collapse-menu:hover { color: white; }
86
-
87
- #collapse-button div:after { color: #f1f3f2; }
88
-
89
- #collapse-menu:hover #collapse-button div:after { color: white; }
90
-
91
- /* Admin Bar */
92
- #wpadminbar { color: white; background: #446950; }
93
-
94
- #wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon { color: white; }
95
-
96
- #wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after { color: #f1f3f2; }
97
-
98
- #wpadminbar .ab-top-menu > li:hover > .ab-item, #wpadminbar .ab-top-menu > li.hover > .ab-item, #wpadminbar .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar-nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { color: #56b274; background: #36533f; }
99
-
100
- #wpadminbar > #wp-toolbar li:hover span.ab-label, #wpadminbar > #wp-toolbar li.hover span.ab-label, #wpadminbar > #wp-toolbar a:focus span.ab-label { color: #56b274; }
101
-
102
- #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: white; }
103
-
104
- /* Admin Bar: submenu */
105
- #wpadminbar .menupop .ab-sub-wrapper { background: #36533f; }
106
-
107
- #wpadminbar .quicklinks .menupop ul.ab-sub-secondary, #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu { background: #597763; }
108
-
109
- #wpadminbar .ab-submenu .ab-item, #wpadminbar .quicklinks .menupop ul li a, #wpadminbar .quicklinks .menupop.hover ul li a, #wpadminbar-nojs .quicklinks .menupop:hover ul li a { color: #c6d2ca; }
110
-
111
- #wpadminbar .quicklinks li .blavatar, #wpadminbar .menupop .menupop > .ab-item:before { color: #f1f3f2; }
112
-
113
- #wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus, #wpadminbar .quicklinks .menupop ul li a:hover strong, #wpadminbar .quicklinks .menupop ul li a:focus strong, #wpadminbar .quicklinks .menupop.hover ul li a:hover, #wpadminbar .quicklinks .menupop.hover ul li a:focus, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li a:focus .ab-icon:before, #wpadminbar li .ab-item:focus:before, #wpadminbar li.hover .ab-icon:before, #wpadminbar li.hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li.hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: #56b274; }
114
-
115
- #wpadminbar .quicklinks li a:hover .blavatar, #wpadminbar .menupop .menupop > .ab-item:hover:before { color: #56b274; }
116
-
117
- /* Admin Bar: search */
118
- #wpadminbar #adminbarsearch:before { color: #f1f3f2; }
119
-
120
- #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus { color: white; background: #527f61; }
121
-
122
- #wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder { color: white; opacity: .7; }
123
-
124
- #wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder { color: white; opacity: .7; }
125
-
126
- #wpadminbar #adminbarsearch .adminbar-input::-moz-placeholder { color: white; opacity: .7; }
127
-
128
- #wpadminbar #adminbarsearch .adminbar-input:-ms-input-placeholder { color: white; opacity: .7; }
129
-
130
- /* Admin Bar: my account */
131
- #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { border-color: #527f61; background-color: #527f61; }
132
-
133
- #wpadminbar #wp-admin-bar-user-info .display-name { color: white; }
134
-
135
- #wpadminbar #wp-admin-bar-user-info a:hover .display-name { color: #56b274; }
136
-
137
- #wpadminbar #wp-admin-bar-user-info .username { color: #c6d2ca; }
138
-
139
- /* Pointers */
140
- .wp-pointer .wp-pointer-content h3 { background-color: #56b274; }
141
-
142
- .wp-pointer.wp-pointer-top .wp-pointer-arrow, .wp-pointer.wp-pointer-undefined .wp-pointer-arrow { border-bottom-color: #56b274; }
143
-
144
- /* Media Uploader */
145
- .media-item .bar, .media-progress-bar div { background-color: #56b274; }
146
-
147
- .details.attachment { box-shadow: 0 0 0 1px white, 0 0 0 5px #56b274; }
148
-
149
- .attachment.details .check { background-color: #56b274; box-shadow: 0 0 0 1px white, 0 0 0 2px #56b274; }
150
-
151
- /* Themes */
152
- .theme-browser .theme.active .theme-name, .theme-browser .theme.add-new-theme:hover:after { background: #56b274; }
153
-
154
- .theme-browser .theme.add-new-theme:hover span:after { color: #56b274; }
155
-
156
- .theme-overlay .theme-header .close:hover, .theme-overlay .theme-header .right:hover, .theme-overlay .theme-header .left:hover { background: #56b274; }
157
-
158
- /* jQuery UI Slider */
159
- .wp-slider .ui-slider-handle, .wp-slider .ui-slider-handle.ui-state-hover, .wp-slider .ui-slider-handle.focus { background: #56b274; border-color: #43925d; -webkit-box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #8bca9f, 0 1px 0 rgba(0, 0, 0, 0.15); }
160
-
161
- /* Responsive Component */
162
- div#wp-responsive-toggle a:before { color: #f1f3f2; }
163
-
164
- .wp-responsive-open div#wp-responsive-toggle a { border-color: transparent; background: #56b274; }
165
-
166
- .star-rating .star { color: #56b274; }
167
-
168
- .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a { background: #36533f; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/styles/evergreen/colors-rtl.css ADDED
@@ -0,0 +1,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Button mixin- creates 3d-ish button effect with correct
3
+ * highlights/shadows, based on a base color.
4
+ */
5
+ body {
6
+ background: #f1f1f1;
7
+ }
8
+
9
+ /* Links */
10
+ a {
11
+ color: #0073aa;
12
+ }
13
+
14
+ a:hover, a:active, a:focus {
15
+ color: #0096dd;
16
+ }
17
+
18
+ #media-upload a.del-link:hover,
19
+ div.dashboard-widget-submit input:hover,
20
+ .subsubsub a:hover,
21
+ .subsubsub a.current:hover {
22
+ color: #0096dd;
23
+ }
24
+
25
+ /* Forms */
26
+ input[type=checkbox]:checked:before {
27
+ color: #56b274;
28
+ }
29
+
30
+ input[type=radio]:checked:before {
31
+ background: #56b274;
32
+ }
33
+
34
+ .wp-core-ui input[type="reset"]:hover,
35
+ .wp-core-ui input[type="reset"]:active {
36
+ color: #0096dd;
37
+ }
38
+
39
+ /* Core UI */
40
+ .wp-core-ui .button-primary {
41
+ background: #56b274;
42
+ border-color: #43925d #3b8152 #3b8152;
43
+ color: white;
44
+ -webkit-box-shadow: 0 1px 0 #3b8152;
45
+ box-shadow: 0 1px 0 #3b8152;
46
+ text-shadow: 0 -1px 1px #3b8152, -1px 0 1px #3b8152, 0 1px 1px #3b8152, 1px 0 1px #3b8152;
47
+ }
48
+
49
+ .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
50
+ background: #61b77d;
51
+ border-color: #3b8152;
52
+ color: white;
53
+ -webkit-box-shadow: 0 1px 0 #3b8152;
54
+ box-shadow: 0 1px 0 #3b8152;
55
+ }
56
+
57
+ .wp-core-ui .button-primary:focus {
58
+ -webkit-box-shadow: inset 0 1px 0 #43925d, 0 0 2px 1px #33b3db;
59
+ box-shadow: inset 0 1px 0 #43925d, 0 0 2px 1px #33b3db;
60
+ }
61
+
62
+ .wp-core-ui .button-primary:active {
63
+ background: #43925d;
64
+ border-color: #3b8152;
65
+ -webkit-box-shadow: inset 0 2px 0 #3b8152;
66
+ box-shadow: inset 0 2px 0 #3b8152;
67
+ }
68
+
69
+ .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
70
+ color: #c7d1ca !important;
71
+ background: #469961 !important;
72
+ border-color: #3b8152 !important;
73
+ text-shadow: none !important;
74
+ }
75
+
76
+ .wp-core-ui .button-primary.button-hero {
77
+ -webkit-box-shadow: 0 2px 0 #3b8152 !important;
78
+ box-shadow: 0 2px 0 #3b8152 !important;
79
+ }
80
+
81
+ .wp-core-ui .button-primary.button-hero:active {
82
+ -webkit-box-shadow: inset 0 3px 0 #3b8152 !important;
83
+ box-shadow: inset 0 3px 0 #3b8152 !important;
84
+ }
85
+
86
+ .wp-core-ui .wp-ui-primary {
87
+ color: #fff;
88
+ background-color: #446950;
89
+ }
90
+
91
+ .wp-core-ui .wp-ui-text-primary {
92
+ color: #446950;
93
+ }
94
+
95
+ .wp-core-ui .wp-ui-highlight {
96
+ color: #fff;
97
+ background-color: #56b274;
98
+ }
99
+
100
+ .wp-core-ui .wp-ui-text-highlight {
101
+ color: #56b274;
102
+ }
103
+
104
+ .wp-core-ui .wp-ui-notification {
105
+ color: #fff;
106
+ background-color: #36b360;
107
+ }
108
+
109
+ .wp-core-ui .wp-ui-text-notification {
110
+ color: #36b360;
111
+ }
112
+
113
+ .wp-core-ui .wp-ui-text-icon {
114
+ color: #f1f3f2;
115
+ }
116
+
117
+ /* List tables */
118
+ .wrap .add-new-h2:hover,
119
+ .wrap .page-title-action:hover,
120
+ .tablenav .tablenav-pages a:hover,
121
+ .tablenav .tablenav-pages a:focus {
122
+ color: #fff;
123
+ background-color: #446950;
124
+ }
125
+
126
+ .view-switch a.current:before {
127
+ color: #446950;
128
+ }
129
+
130
+ .view-switch a:hover:before {
131
+ color: #36b360;
132
+ }
133
+
134
+ /* Admin Menu */
135
+ #adminmenuback,
136
+ #adminmenuwrap,
137
+ #adminmenu {
138
+ background: #446950;
139
+ }
140
+
141
+ #adminmenu a {
142
+ color: #fff;
143
+ }
144
+
145
+ #adminmenu div.wp-menu-image:before {
146
+ color: #f1f3f2;
147
+ }
148
+
149
+ #adminmenu a:hover,
150
+ #adminmenu li.menu-top:hover,
151
+ #adminmenu li.opensub > a.menu-top,
152
+ #adminmenu li > a.menu-top:focus {
153
+ color: #fff;
154
+ background-color: #56b274;
155
+ }
156
+
157
+ #adminmenu li.menu-top:hover div.wp-menu-image:before,
158
+ #adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
159
+ color: #fff;
160
+ }
161
+
162
+ /* Active tabs use a bottom border color that matches the page background color. */
163
+ .about-wrap h2 .nav-tab-active,
164
+ .nav-tab-active,
165
+ .nav-tab-active:hover {
166
+ background-color: #f1f1f1;
167
+ border-bottom-color: #f1f1f1;
168
+ }
169
+
170
+ /* Admin Menu: submenu */
171
+ #adminmenu .wp-submenu,
172
+ #adminmenu .wp-has-current-submenu .wp-submenu,
173
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
174
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu,
175
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
176
+ background: #36533f;
177
+ }
178
+
179
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
180
+ border-left-color: #36533f;
181
+ }
182
+
183
+ #adminmenu .wp-submenu .wp-submenu-head {
184
+ color: #c7d2cb;
185
+ }
186
+
187
+ #adminmenu .wp-submenu a,
188
+ #adminmenu .wp-has-current-submenu .wp-submenu a,
189
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a,
190
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
191
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
192
+ color: #c7d2cb;
193
+ }
194
+
195
+ #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
196
+ #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
197
+ #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
198
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
199
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
200
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
201
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
202
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
203
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
204
+ color: #56b274;
205
+ }
206
+
207
+ /* Admin Menu: current */
208
+ #adminmenu .wp-submenu li.current a,
209
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
210
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
211
+ color: #fff;
212
+ }
213
+
214
+ #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
215
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
216
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
217
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
218
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
219
+ color: #56b274;
220
+ }
221
+
222
+ ul#adminmenu a.wp-has-current-submenu:after,
223
+ ul#adminmenu > li.current > a.current:after {
224
+ border-left-color: #f1f1f1;
225
+ }
226
+
227
+ #adminmenu li.current a.menu-top,
228
+ #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
229
+ #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
230
+ .folded #adminmenu li.current.menu-top {
231
+ color: #fff;
232
+ background: #56b274;
233
+ }
234
+
235
+ #adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
236
+ #adminmenu a.current:hover div.wp-menu-image:before,
237
+ #adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
238
+ #adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
239
+ #adminmenu li:hover div.wp-menu-image:before,
240
+ #adminmenu li a:focus div.wp-menu-image:before,
241
+ #adminmenu li.opensub div.wp-menu-image:before,
242
+ .ie8 #adminmenu li.opensub div.wp-menu-image:before {
243
+ color: #fff;
244
+ }
245
+
246
+ /* Admin Menu: bubble */
247
+ #adminmenu .awaiting-mod,
248
+ #adminmenu .update-plugins {
249
+ color: #fff;
250
+ background: #36b360;
251
+ }
252
+
253
+ #adminmenu li.current a .awaiting-mod,
254
+ #adminmenu li a.wp-has-current-submenu .update-plugins,
255
+ #adminmenu li:hover a .awaiting-mod,
256
+ #adminmenu li.menu-top:hover > a .update-plugins {
257
+ color: #fff;
258
+ background: #36533f;
259
+ }
260
+
261
+ /* Admin Menu: collapse button */
262
+ #collapse-button {
263
+ color: #f1f3f2;
264
+ }
265
+
266
+ #collapse-button:hover,
267
+ #collapse-button:focus {
268
+ color: #56b274;
269
+ }
270
+
271
+ /* Admin Bar */
272
+ #wpadminbar {
273
+ color: #fff;
274
+ background: #446950;
275
+ }
276
+
277
+ #wpadminbar .ab-item,
278
+ #wpadminbar a.ab-item,
279
+ #wpadminbar > #wp-toolbar span.ab-label,
280
+ #wpadminbar > #wp-toolbar span.noticon {
281
+ color: #fff;
282
+ }
283
+
284
+ #wpadminbar .ab-icon,
285
+ #wpadminbar .ab-icon:before,
286
+ #wpadminbar .ab-item:before,
287
+ #wpadminbar .ab-item:after {
288
+ color: #f1f3f2;
289
+ }
290
+
291
+ #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
292
+ #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
293
+ #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
294
+ #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
295
+ #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
296
+ color: #56b274;
297
+ background: #36533f;
298
+ }
299
+
300
+ #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
301
+ #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
302
+ #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
303
+ color: #56b274;
304
+ }
305
+
306
+ #wpadminbar:not(.mobile) li:hover .ab-icon:before,
307
+ #wpadminbar:not(.mobile) li:hover .ab-item:before,
308
+ #wpadminbar:not(.mobile) li:hover .ab-item:after,
309
+ #wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
310
+ color: #fff;
311
+ }
312
+
313
+ /* Admin Bar: submenu */
314
+ #wpadminbar .menupop .ab-sub-wrapper {
315
+ background: #36533f;
316
+ }
317
+
318
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
319
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
320
+ background: #597763;
321
+ }
322
+
323
+ #wpadminbar .ab-submenu .ab-item,
324
+ #wpadminbar .quicklinks .menupop ul li a,
325
+ #wpadminbar .quicklinks .menupop.hover ul li a,
326
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a {
327
+ color: #c7d2cb;
328
+ }
329
+
330
+ #wpadminbar .quicklinks li .blavatar,
331
+ #wpadminbar .menupop .menupop > .ab-item:before {
332
+ color: #f1f3f2;
333
+ }
334
+
335
+ #wpadminbar .quicklinks .menupop ul li a:hover,
336
+ #wpadminbar .quicklinks .menupop ul li a:focus,
337
+ #wpadminbar .quicklinks .menupop ul li a:hover strong,
338
+ #wpadminbar .quicklinks .menupop ul li a:focus strong,
339
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
340
+ #wpadminbar .quicklinks .menupop.hover ul li a:hover,
341
+ #wpadminbar .quicklinks .menupop.hover ul li a:focus,
342
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
343
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
344
+ #wpadminbar li:hover .ab-icon:before,
345
+ #wpadminbar li:hover .ab-item:before,
346
+ #wpadminbar li a:focus .ab-icon:before,
347
+ #wpadminbar li .ab-item:focus:before,
348
+ #wpadminbar li .ab-item:focus .ab-icon:before,
349
+ #wpadminbar li.hover .ab-icon:before,
350
+ #wpadminbar li.hover .ab-item:before,
351
+ #wpadminbar li:hover #adminbarsearch:before,
352
+ #wpadminbar li #adminbarsearch.adminbar-focused:before {
353
+ color: #56b274;
354
+ }
355
+
356
+ #wpadminbar .quicklinks li a:hover .blavatar,
357
+ #wpadminbar .quicklinks li a:focus .blavatar,
358
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
359
+ #wpadminbar .menupop .menupop > .ab-item:hover:before,
360
+ #wpadminbar.mobile .quicklinks .ab-icon:before,
361
+ #wpadminbar.mobile .quicklinks .ab-item:before {
362
+ color: #56b274;
363
+ }
364
+
365
+ #wpadminbar.mobile .quicklinks .hover .ab-icon:before,
366
+ #wpadminbar.mobile .quicklinks .hover .ab-item:before {
367
+ color: #f1f3f2;
368
+ }
369
+
370
+ /* Admin Bar: search */
371
+ #wpadminbar #adminbarsearch:before {
372
+ color: #f1f3f2;
373
+ }
374
+
375
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
376
+ color: #fff;
377
+ background: #527f61;
378
+ }
379
+
380
+ /* Admin Bar: my account */
381
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
382
+ border-color: #527f61;
383
+ background-color: #527f61;
384
+ }
385
+
386
+ #wpadminbar #wp-admin-bar-user-info .display-name {
387
+ color: #fff;
388
+ }
389
+
390
+ #wpadminbar #wp-admin-bar-user-info a:hover .display-name {
391
+ color: #56b274;
392
+ }
393
+
394
+ #wpadminbar #wp-admin-bar-user-info .username {
395
+ color: #c7d2cb;
396
+ }
397
+
398
+ /* Pointers */
399
+ .wp-pointer .wp-pointer-content h3 {
400
+ background-color: #56b274;
401
+ border-color: #4ba468;
402
+ }
403
+
404
+ .wp-pointer .wp-pointer-content h3:before {
405
+ color: #56b274;
406
+ }
407
+
408
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow,
409
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
410
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
411
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
412
+ border-bottom-color: #56b274;
413
+ }
414
+
415
+ /* Media */
416
+ .media-item .bar,
417
+ .media-progress-bar div {
418
+ background-color: #56b274;
419
+ }
420
+
421
+ .details.attachment {
422
+ -webkit-box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #56b274;
423
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #56b274;
424
+ }
425
+
426
+ .attachment.details .check {
427
+ background-color: #56b274;
428
+ -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 2px #56b274;
429
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #56b274;
430
+ }
431
+
432
+ .media-selection .attachment.selection.details .thumbnail {
433
+ -webkit-box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #56b274;
434
+ box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #56b274;
435
+ }
436
+
437
+ /* Themes */
438
+ .theme-browser .theme.active .theme-name,
439
+ .theme-browser .theme.add-new-theme a:hover:after,
440
+ .theme-browser .theme.add-new-theme a:focus:after {
441
+ background: #56b274;
442
+ }
443
+
444
+ .theme-browser .theme.add-new-theme a:hover span:after,
445
+ .theme-browser .theme.add-new-theme a:focus span:after {
446
+ color: #56b274;
447
+ }
448
+
449
+ .theme-section.current,
450
+ .theme-filter.current {
451
+ border-bottom-color: #446950;
452
+ }
453
+
454
+ body.more-filters-opened .more-filters {
455
+ color: #fff;
456
+ background-color: #446950;
457
+ }
458
+
459
+ body.more-filters-opened .more-filters:before {
460
+ color: #fff;
461
+ }
462
+
463
+ body.more-filters-opened .more-filters:hover,
464
+ body.more-filters-opened .more-filters:focus {
465
+ background-color: #56b274;
466
+ color: #fff;
467
+ }
468
+
469
+ body.more-filters-opened .more-filters:hover:before,
470
+ body.more-filters-opened .more-filters:focus:before {
471
+ color: #fff;
472
+ }
473
+
474
+ /* Widgets */
475
+ .widgets-chooser li.widgets-chooser-selected {
476
+ background-color: #56b274;
477
+ color: #fff;
478
+ }
479
+
480
+ .widgets-chooser li.widgets-chooser-selected:before,
481
+ .widgets-chooser li.widgets-chooser-selected:focus:before {
482
+ color: #fff;
483
+ }
484
+
485
+ /* Responsive Component */
486
+ div#wp-responsive-toggle a:before {
487
+ color: #f1f3f2;
488
+ }
489
+
490
+ .wp-responsive-open div#wp-responsive-toggle a {
491
+ border-color: transparent;
492
+ background: #56b274;
493
+ }
494
+
495
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
496
+ background: #36533f;
497
+ }
498
+
499
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
500
+ color: #f1f3f2;
501
+ }
502
+
503
+ /* TinyMCE */
504
+ .mce-container.mce-menu .mce-menu-item:hover,
505
+ .mce-container.mce-menu .mce-menu-item.mce-selected,
506
+ .mce-container.mce-menu .mce-menu-item:focus,
507
+ .mce-container.mce-menu .mce-menu-item-normal.mce-active,
508
+ .mce-container.mce-menu .mce-menu-item-preview.mce-active {
509
+ background: #56b274;
510
+ }
includes/admin/styles/evergreen/colors-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body{background:#f1f1f1}a{color:#0073aa}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,a:active,a:focus,a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#56b274}input[type=radio]:checked:before{background:#56b274}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#56b274;border-color:#43925d #3b8152 #3b8152;color:#fff;-webkit-box-shadow:0 1px 0 #3b8152;box-shadow:0 1px 0 #3b8152;text-shadow:0 -1px 1px #3b8152,-1px 0 1px #3b8152,0 1px 1px #3b8152,1px 0 1px #3b8152}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#61b77d;border-color:#3b8152;color:#fff;-webkit-box-shadow:0 1px 0 #3b8152;box-shadow:0 1px 0 #3b8152}.wp-core-ui .button-primary:focus{-webkit-box-shadow:inset 0 1px 0 #43925d,0 0 2px 1px #33b3db;box-shadow:inset 0 1px 0 #43925d,0 0 2px 1px #33b3db}.wp-core-ui .button-primary:active{background:#43925d;border-color:#3b8152;-webkit-box-shadow:inset 0 2px 0 #3b8152;box-shadow:inset 0 2px 0 #3b8152}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7d1ca!important;background:#469961!important;border-color:#3b8152!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{-webkit-box-shadow:0 2px 0 #3b8152!important;box-shadow:0 2px 0 #3b8152!important}.wp-core-ui .button-primary.button-hero:active{-webkit-box-shadow:inset 0 3px 0 #3b8152!important;box-shadow:inset 0 3px 0 #3b8152!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#446950}.wp-core-ui .wp-ui-text-primary{color:#446950}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#56b274}.wp-core-ui .wp-ui-text-highlight{color:#56b274}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#36b360}.wp-core-ui .wp-ui-text-notification{color:#36b360}.wp-core-ui .wp-ui-text-icon{color:#f1f3f2}.tablenav .tablenav-pages a:focus,.tablenav .tablenav-pages a:hover,.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#446950}.view-switch a.current:before{color:#446950}.view-switch a:hover:before{color:#36b360}#adminmenu,#adminmenuback,#adminmenuwrap{background:#446950}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f1f3f2}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#56b274}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap h2 .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#36533f}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#36533f}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu .wp-submenu-head,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#c7d2cb}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#56b274}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#56b274}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#56b274}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#36b360}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#36533f}#collapse-button{color:#f1f3f2}#collapse-button:focus,#collapse-button:hover{color:#56b274}#wpadminbar{color:#fff;background:#446950}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f1f3f2}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#56b274;background:#36533f}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#56b274}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#36533f}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#597763}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#c7d2cb}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f1f3f2}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#56b274}#wpadminbar #adminbarsearch:before,#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f1f3f2}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#527f61}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#527f61;background-color:#527f61}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#56b274}#wpadminbar #wp-admin-bar-user-info .username{color:#c7d2cb}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after,.wp-pointer .wp-pointer-content h3:before{color:#56b274}.wp-pointer .wp-pointer-content h3{background-color:#56b274;border-color:#4ba468}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#56b274}.media-item .bar,.media-progress-bar div{background-color:#56b274}.details.attachment{-webkit-box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #56b274;box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #56b274}.attachment.details .check{background-color:#56b274;-webkit-box-shadow:0 0 0 1px #fff,0 0 0 2px #56b274;box-shadow:0 0 0 1px #fff,0 0 0 2px #56b274}.media-selection .attachment.selection.details .thumbnail{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #56b274;box-shadow:0 0 0 1px #fff,0 0 0 3px #56b274}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#56b274}.theme-filter.current,.theme-section.current{border-bottom-color:#446950}body.more-filters-opened .more-filters{color:#fff;background-color:#446950}.widgets-chooser li.widgets-chooser-selected,body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#56b274;color:#fff}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before,div#wp-responsive-toggle a:before{color:#f1f3f2}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#56b274}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#36533f}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#56b274}
includes/admin/styles/evergreen/colors.css ADDED
@@ -0,0 +1,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Button mixin- creates 3d-ish button effect with correct
3
+ * highlights/shadows, based on a base color.
4
+ */
5
+ body {
6
+ background: #f1f1f1;
7
+ }
8
+
9
+ /* Links */
10
+ a {
11
+ color: #0073aa;
12
+ }
13
+
14
+ a:hover, a:active, a:focus {
15
+ color: #0096dd;
16
+ }
17
+
18
+ #media-upload a.del-link:hover,
19
+ div.dashboard-widget-submit input:hover,
20
+ .subsubsub a:hover,
21
+ .subsubsub a.current:hover {
22
+ color: #0096dd;
23
+ }
24
+
25
+ /* Forms */
26
+ input[type=checkbox]:checked:before {
27
+ color: #56b274;
28
+ }
29
+
30
+ input[type=radio]:checked:before {
31
+ background: #56b274;
32
+ }
33
+
34
+ .wp-core-ui input[type="reset"]:hover,
35
+ .wp-core-ui input[type="reset"]:active {
36
+ color: #0096dd;
37
+ }
38
+
39
+ /* Core UI */
40
+ .wp-core-ui .button-primary {
41
+ background: #56b274;
42
+ border-color: #43925d #3b8152 #3b8152;
43
+ color: white;
44
+ -webkit-box-shadow: 0 1px 0 #3b8152;
45
+ box-shadow: 0 1px 0 #3b8152;
46
+ text-shadow: 0 -1px 1px #3b8152, 1px 0 1px #3b8152, 0 1px 1px #3b8152, -1px 0 1px #3b8152;
47
+ }
48
+
49
+ .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
50
+ background: #61b77d;
51
+ border-color: #3b8152;
52
+ color: white;
53
+ -webkit-box-shadow: 0 1px 0 #3b8152;
54
+ box-shadow: 0 1px 0 #3b8152;
55
+ }
56
+
57
+ .wp-core-ui .button-primary:focus {
58
+ -webkit-box-shadow: inset 0 1px 0 #43925d, 0 0 2px 1px #33b3db;
59
+ box-shadow: inset 0 1px 0 #43925d, 0 0 2px 1px #33b3db;
60
+ }
61
+
62
+ .wp-core-ui .button-primary:active {
63
+ background: #43925d;
64
+ border-color: #3b8152;
65
+ -webkit-box-shadow: inset 0 2px 0 #3b8152;
66
+ box-shadow: inset 0 2px 0 #3b8152;
67
+ }
68
+
69
+ .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
70
+ color: #c7d1ca !important;
71
+ background: #469961 !important;
72
+ border-color: #3b8152 !important;
73
+ text-shadow: none !important;
74
+ }
75
+
76
+ .wp-core-ui .button-primary.button-hero {
77
+ -webkit-box-shadow: 0 2px 0 #3b8152 !important;
78
+ box-shadow: 0 2px 0 #3b8152 !important;
79
+ }
80
+
81
+ .wp-core-ui .button-primary.button-hero:active {
82
+ -webkit-box-shadow: inset 0 3px 0 #3b8152 !important;
83
+ box-shadow: inset 0 3px 0 #3b8152 !important;
84
+ }
85
+
86
+ .wp-core-ui .wp-ui-primary {
87
+ color: #fff;
88
+ background-color: #446950;
89
+ }
90
+
91
+ .wp-core-ui .wp-ui-text-primary {
92
+ color: #446950;
93
+ }
94
+
95
+ .wp-core-ui .wp-ui-highlight {
96
+ color: #fff;
97
+ background-color: #56b274;
98
+ }
99
+
100
+ .wp-core-ui .wp-ui-text-highlight {
101
+ color: #56b274;
102
+ }
103
+
104
+ .wp-core-ui .wp-ui-notification {
105
+ color: #fff;
106
+ background-color: #36b360;
107
+ }
108
+
109
+ .wp-core-ui .wp-ui-text-notification {
110
+ color: #36b360;
111
+ }
112
+
113
+ .wp-core-ui .wp-ui-text-icon {
114
+ color: #f1f3f2;
115
+ }
116
+
117
+ /* List tables */
118
+ .wrap .add-new-h2:hover,
119
+ .wrap .page-title-action:hover,
120
+ .tablenav .tablenav-pages a:hover,
121
+ .tablenav .tablenav-pages a:focus {
122
+ color: #fff;
123
+ background-color: #446950;
124
+ }
125
+
126
+ .view-switch a.current:before {
127
+ color: #446950;
128
+ }
129
+
130
+ .view-switch a:hover:before {
131
+ color: #36b360;
132
+ }
133
+
134
+ /* Admin Menu */
135
+ #adminmenuback,
136
+ #adminmenuwrap,
137
+ #adminmenu {
138
+ background: #446950;
139
+ }
140
+
141
+ #adminmenu a {
142
+ color: #fff;
143
+ }
144
+
145
+ #adminmenu div.wp-menu-image:before {
146
+ color: #f1f3f2;
147
+ }
148
+
149
+ #adminmenu a:hover,
150
+ #adminmenu li.menu-top:hover,
151
+ #adminmenu li.opensub > a.menu-top,
152
+ #adminmenu li > a.menu-top:focus {
153
+ color: #fff;
154
+ background-color: #56b274;
155
+ }
156
+
157
+ #adminmenu li.menu-top:hover div.wp-menu-image:before,
158
+ #adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
159
+ color: #fff;
160
+ }
161
+
162
+ /* Active tabs use a bottom border color that matches the page background color. */
163
+ .about-wrap h2 .nav-tab-active,
164
+ .nav-tab-active,
165
+ .nav-tab-active:hover {
166
+ background-color: #f1f1f1;
167
+ border-bottom-color: #f1f1f1;
168
+ }
169
+
170
+ /* Admin Menu: submenu */
171
+ #adminmenu .wp-submenu,
172
+ #adminmenu .wp-has-current-submenu .wp-submenu,
173
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
174
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu,
175
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
176
+ background: #36533f;
177
+ }
178
+
179
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
180
+ border-right-color: #36533f;
181
+ }
182
+
183
+ #adminmenu .wp-submenu .wp-submenu-head {
184
+ color: #c7d2cb;
185
+ }
186
+
187
+ #adminmenu .wp-submenu a,
188
+ #adminmenu .wp-has-current-submenu .wp-submenu a,
189
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a,
190
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
191
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
192
+ color: #c7d2cb;
193
+ }
194
+
195
+ #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
196
+ #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
197
+ #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
198
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
199
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
200
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
201
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
202
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
203
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
204
+ color: #56b274;
205
+ }
206
+
207
+ /* Admin Menu: current */
208
+ #adminmenu .wp-submenu li.current a,
209
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
210
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
211
+ color: #fff;
212
+ }
213
+
214
+ #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
215
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
216
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
217
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
218
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
219
+ color: #56b274;
220
+ }
221
+
222
+ ul#adminmenu a.wp-has-current-submenu:after,
223
+ ul#adminmenu > li.current > a.current:after {
224
+ border-right-color: #f1f1f1;
225
+ }
226
+
227
+ #adminmenu li.current a.menu-top,
228
+ #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
229
+ #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
230
+ .folded #adminmenu li.current.menu-top {
231
+ color: #fff;
232
+ background: #56b274;
233
+ }
234
+
235
+ #adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
236
+ #adminmenu a.current:hover div.wp-menu-image:before,
237
+ #adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
238
+ #adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
239
+ #adminmenu li:hover div.wp-menu-image:before,
240
+ #adminmenu li a:focus div.wp-menu-image:before,
241
+ #adminmenu li.opensub div.wp-menu-image:before,
242
+ .ie8 #adminmenu li.opensub div.wp-menu-image:before {
243
+ color: #fff;
244
+ }
245
+
246
+ /* Admin Menu: bubble */
247
+ #adminmenu .awaiting-mod,
248
+ #adminmenu .update-plugins {
249
+ color: #fff;
250
+ background: #36b360;
251
+ }
252
+
253
+ #adminmenu li.current a .awaiting-mod,
254
+ #adminmenu li a.wp-has-current-submenu .update-plugins,
255
+ #adminmenu li:hover a .awaiting-mod,
256
+ #adminmenu li.menu-top:hover > a .update-plugins {
257
+ color: #fff;
258
+ background: #36533f;
259
+ }
260
+
261
+ /* Admin Menu: collapse button */
262
+ #collapse-button {
263
+ color: #f1f3f2;
264
+ }
265
+
266
+ #collapse-button:hover,
267
+ #collapse-button:focus {
268
+ color: #56b274;
269
+ }
270
+
271
+ /* Admin Bar */
272
+ #wpadminbar {
273
+ color: #fff;
274
+ background: #446950;
275
+ }
276
+
277
+ #wpadminbar .ab-item,
278
+ #wpadminbar a.ab-item,
279
+ #wpadminbar > #wp-toolbar span.ab-label,
280
+ #wpadminbar > #wp-toolbar span.noticon {
281
+ color: #fff;
282
+ }
283
+
284
+ #wpadminbar .ab-icon,
285
+ #wpadminbar .ab-icon:before,
286
+ #wpadminbar .ab-item:before,
287
+ #wpadminbar .ab-item:after {
288
+ color: #f1f3f2;
289
+ }
290
+
291
+ #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
292
+ #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
293
+ #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
294
+ #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
295
+ #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
296
+ color: #56b274;
297
+ background: #36533f;
298
+ }
299
+
300
+ #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
301
+ #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
302
+ #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
303
+ color: #56b274;
304
+ }
305
+
306
+ #wpadminbar:not(.mobile) li:hover .ab-icon:before,
307
+ #wpadminbar:not(.mobile) li:hover .ab-item:before,
308
+ #wpadminbar:not(.mobile) li:hover .ab-item:after,
309
+ #wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
310
+ color: #fff;
311
+ }
312
+
313
+ /* Admin Bar: submenu */
314
+ #wpadminbar .menupop .ab-sub-wrapper {
315
+ background: #36533f;
316
+ }
317
+
318
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
319
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
320
+ background: #597763;
321
+ }
322
+
323
+ #wpadminbar .ab-submenu .ab-item,
324
+ #wpadminbar .quicklinks .menupop ul li a,
325
+ #wpadminbar .quicklinks .menupop.hover ul li a,
326
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a {
327
+ color: #c7d2cb;
328
+ }
329
+
330
+ #wpadminbar .quicklinks li .blavatar,
331
+ #wpadminbar .menupop .menupop > .ab-item:before {
332
+ color: #f1f3f2;
333
+ }
334
+
335
+ #wpadminbar .quicklinks .menupop ul li a:hover,
336
+ #wpadminbar .quicklinks .menupop ul li a:focus,
337
+ #wpadminbar .quicklinks .menupop ul li a:hover strong,
338
+ #wpadminbar .quicklinks .menupop ul li a:focus strong,
339
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
340
+ #wpadminbar .quicklinks .menupop.hover ul li a:hover,
341
+ #wpadminbar .quicklinks .menupop.hover ul li a:focus,
342
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
343
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
344
+ #wpadminbar li:hover .ab-icon:before,
345
+ #wpadminbar li:hover .ab-item:before,
346
+ #wpadminbar li a:focus .ab-icon:before,
347
+ #wpadminbar li .ab-item:focus:before,
348
+ #wpadminbar li .ab-item:focus .ab-icon:before,
349
+ #wpadminbar li.hover .ab-icon:before,
350
+ #wpadminbar li.hover .ab-item:before,
351
+ #wpadminbar li:hover #adminbarsearch:before,
352
+ #wpadminbar li #adminbarsearch.adminbar-focused:before {
353
+ color: #56b274;
354
+ }
355
+
356
+ #wpadminbar .quicklinks li a:hover .blavatar,
357
+ #wpadminbar .quicklinks li a:focus .blavatar,
358
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
359
+ #wpadminbar .menupop .menupop > .ab-item:hover:before,
360
+ #wpadminbar.mobile .quicklinks .ab-icon:before,
361
+ #wpadminbar.mobile .quicklinks .ab-item:before {
362
+ color: #56b274;
363
+ }
364
+
365
+ #wpadminbar.mobile .quicklinks .hover .ab-icon:before,
366
+ #wpadminbar.mobile .quicklinks .hover .ab-item:before {
367
+ color: #f1f3f2;
368
+ }
369
+
370
+ /* Admin Bar: search */
371
+ #wpadminbar #adminbarsearch:before {
372
+ color: #f1f3f2;
373
+ }
374
+
375
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
376
+ color: #fff;
377
+ background: #527f61;
378
+ }
379
+
380
+ /* Admin Bar: my account */
381
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
382
+ border-color: #527f61;
383
+ background-color: #527f61;
384
+ }
385
+
386
+ #wpadminbar #wp-admin-bar-user-info .display-name {
387
+ color: #fff;
388
+ }
389
+
390
+ #wpadminbar #wp-admin-bar-user-info a:hover .display-name {
391
+ color: #56b274;
392
+ }
393
+
394
+ #wpadminbar #wp-admin-bar-user-info .username {
395
+ color: #c7d2cb;
396
+ }
397
+
398
+ /* Pointers */
399
+ .wp-pointer .wp-pointer-content h3 {
400
+ background-color: #56b274;
401
+ border-color: #4ba468;
402
+ }
403
+
404
+ .wp-pointer .wp-pointer-content h3:before {
405
+ color: #56b274;
406
+ }
407
+
408
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow,
409
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
410
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
411
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
412
+ border-bottom-color: #56b274;
413
+ }
414
+
415
+ /* Media */
416
+ .media-item .bar,
417
+ .media-progress-bar div {
418
+ background-color: #56b274;
419
+ }
420
+
421
+ .details.attachment {
422
+ -webkit-box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #56b274;
423
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #56b274;
424
+ }
425
+
426
+ .attachment.details .check {
427
+ background-color: #56b274;
428
+ -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 2px #56b274;
429
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #56b274;
430
+ }
431
+
432
+ .media-selection .attachment.selection.details .thumbnail {
433
+ -webkit-box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #56b274;
434
+ box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #56b274;
435
+ }
436
+
437
+ /* Themes */
438
+ .theme-browser .theme.active .theme-name,
439
+ .theme-browser .theme.add-new-theme a:hover:after,
440
+ .theme-browser .theme.add-new-theme a:focus:after {
441
+ background: #56b274;
442
+ }
443
+
444
+ .theme-browser .theme.add-new-theme a:hover span:after,
445
+ .theme-browser .theme.add-new-theme a:focus span:after {
446
+ color: #56b274;
447
+ }
448
+
449
+ .theme-section.current,
450
+ .theme-filter.current {
451
+ border-bottom-color: #446950;
452
+ }
453
+
454
+ body.more-filters-opened .more-filters {
455
+ color: #fff;
456
+ background-color: #446950;
457
+ }
458
+
459
+ body.more-filters-opened .more-filters:before {
460
+ color: #fff;
461
+ }
462
+
463
+ body.more-filters-opened .more-filters:hover,
464
+ body.more-filters-opened .more-filters:focus {
465
+ background-color: #56b274;
466
+ color: #fff;
467
+ }
468
+
469
+ body.more-filters-opened .more-filters:hover:before,
470
+ body.more-filters-opened .more-filters:focus:before {
471
+ color: #fff;
472
+ }
473
+
474
+ /* Widgets */
475
+ .widgets-chooser li.widgets-chooser-selected {
476
+ background-color: #56b274;
477
+ color: #fff;
478
+ }
479
+
480
+ .widgets-chooser li.widgets-chooser-selected:before,
481
+ .widgets-chooser li.widgets-chooser-selected:focus:before {
482
+ color: #fff;
483
+ }
484
+
485
+ /* Responsive Component */
486
+ div#wp-responsive-toggle a:before {
487
+ color: #f1f3f2;
488
+ }
489
+
490
+ .wp-responsive-open div#wp-responsive-toggle a {
491
+ border-color: transparent;
492
+ background: #56b274;
493
+ }
494
+
495
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
496
+ background: #36533f;
497
+ }
498
+
499
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
500
+ color: #f1f3f2;
501
+ }
502
+
503
+ /* TinyMCE */
504
+ .mce-container.mce-menu .mce-menu-item:hover,
505
+ .mce-container.mce-menu .mce-menu-item.mce-selected,
506
+ .mce-container.mce-menu .mce-menu-item:focus,
507
+ .mce-container.mce-menu .mce-menu-item-normal.mce-active,
508
+ .mce-container.mce-menu .mce-menu-item-preview.mce-active {
509
+ background: #56b274;
510
+ }
includes/admin/styles/evergreen/colors.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body{background:#f1f1f1}a{color:#0073aa}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,a:active,a:focus,a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#56b274}input[type=radio]:checked:before{background:#56b274}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#56b274;border-color:#43925d #3b8152 #3b8152;color:#fff;-webkit-box-shadow:0 1px 0 #3b8152;box-shadow:0 1px 0 #3b8152;text-shadow:0 -1px 1px #3b8152,1px 0 1px #3b8152,0 1px 1px #3b8152,-1px 0 1px #3b8152}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#61b77d;border-color:#3b8152;color:#fff;-webkit-box-shadow:0 1px 0 #3b8152;box-shadow:0 1px 0 #3b8152}.wp-core-ui .button-primary:focus{-webkit-box-shadow:inset 0 1px 0 #43925d,0 0 2px 1px #33b3db;box-shadow:inset 0 1px 0 #43925d,0 0 2px 1px #33b3db}.wp-core-ui .button-primary:active{background:#43925d;border-color:#3b8152;-webkit-box-shadow:inset 0 2px 0 #3b8152;box-shadow:inset 0 2px 0 #3b8152}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7d1ca!important;background:#469961!important;border-color:#3b8152!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{-webkit-box-shadow:0 2px 0 #3b8152!important;box-shadow:0 2px 0 #3b8152!important}.wp-core-ui .button-primary.button-hero:active{-webkit-box-shadow:inset 0 3px 0 #3b8152!important;box-shadow:inset 0 3px 0 #3b8152!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#446950}.wp-core-ui .wp-ui-text-primary{color:#446950}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#56b274}.wp-core-ui .wp-ui-text-highlight{color:#56b274}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#36b360}.wp-core-ui .wp-ui-text-notification{color:#36b360}.wp-core-ui .wp-ui-text-icon{color:#f1f3f2}.tablenav .tablenav-pages a:focus,.tablenav .tablenav-pages a:hover,.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#446950}.view-switch a.current:before{color:#446950}.view-switch a:hover:before{color:#36b360}#adminmenu,#adminmenuback,#adminmenuwrap{background:#446950}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f1f3f2}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#56b274}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap h2 .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#36533f}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#36533f}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu .wp-submenu-head,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#c7d2cb}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#56b274}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#56b274}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#56b274}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#36b360}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#36533f}#collapse-button{color:#f1f3f2}#collapse-button:focus,#collapse-button:hover{color:#56b274}#wpadminbar{color:#fff;background:#446950}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f1f3f2}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#56b274;background:#36533f}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#56b274}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#36533f}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#597763}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#c7d2cb}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f1f3f2}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#56b274}#wpadminbar #adminbarsearch:before,#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f1f3f2}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#527f61}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#527f61;background-color:#527f61}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#56b274}#wpadminbar #wp-admin-bar-user-info .username{color:#c7d2cb}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after,.wp-pointer .wp-pointer-content h3:before{color:#56b274}.wp-pointer .wp-pointer-content h3{background-color:#56b274;border-color:#4ba468}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#56b274}.media-item .bar,.media-progress-bar div{background-color:#56b274}.details.attachment{-webkit-box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #56b274;box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #56b274}.attachment.details .check{background-color:#56b274;-webkit-box-shadow:0 0 0 1px #fff,0 0 0 2px #56b274;box-shadow:0 0 0 1px #fff,0 0 0 2px #56b274}.media-selection .attachment.selection.details .thumbnail{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #56b274;box-shadow:0 0 0 1px #fff,0 0 0 3px #56b274}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#56b274}.theme-filter.current,.theme-section.current{border-bottom-color:#446950}body.more-filters-opened .more-filters{color:#fff;background-color:#446950}.widgets-chooser li.widgets-chooser-selected,body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#56b274;color:#fff}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before,div#wp-responsive-toggle a:before{color:#f1f3f2}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#56b274}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#36533f}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#56b274}
includes/admin/styles/mint-rtl.css DELETED
@@ -1,168 +0,0 @@
1
- /* Dashicons mixin use: @include dashicons( '\f140' ); */
2
- /* Button mixin- creates 3d-ish button effect with correct highlights/shadows, based on a base color. */
3
- html { background: #f2f2f2; }
4
-
5
- /* Links */
6
- a { color: #0074a2; }
7
- a:hover, a:active, a:focus { color: #0099d5; }
8
-
9
- #rightnow a:hover, #media-upload a.del-link:hover, div.dashboard-widget-submit input:hover, .subsubsub a:hover, .subsubsub a.current:hover, .ui-tabs-nav a:hover { color: #0099d5; }
10
-
11
- /* Forms */
12
- input[type=checkbox]:checked:before { color: #4f6d59; }
13
-
14
- input[type=radio]:checked:before { background: #4f6d59; }
15
-
16
- .wp-core-ui input[type="reset"]:hover, .wp-core-ui input[type="reset"]:active { color: #0099d5; }
17
-
18
- /* Core UI */
19
- .wp-core-ui .button-primary { background: #4f6d59; border-color: #3a4f41; color: white; -webkit-box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); }
20
- .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus { background: #3e5546; border-color: #2f4035; color: white; -webkit-box-shadow: inset 0 1px 0 #658a71, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #658a71, 0 1px 0 rgba(0, 0, 0, 0.15); }
21
- .wp-core-ui .button-primary:active { background: #3e5546; border-color: #2f4035; color: white; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); }
22
- .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled { color: #c7d1ca !important; background: #3e5546 !important; border-color: #2f4035 !important; text-shadow: none !important; }
23
- .wp-core-ui .wp-ui-primary { color: white; background-color: #5fb37c; }
24
- .wp-core-ui .wp-ui-text-primary { color: #5fb37c; }
25
- .wp-core-ui .wp-ui-highlight { color: white; background-color: #4f6d59; }
26
- .wp-core-ui .wp-ui-text-highlight { color: #4f6d59; }
27
- .wp-core-ui .wp-ui-notification { color: white; background-color: #33834e; }
28
- .wp-core-ui .wp-ui-text-notification { color: #33834e; }
29
- .wp-core-ui .wp-ui-text-icon { color: #f1f3f2; }
30
-
31
- /* List tables */
32
- .wrap .add-new-h2:hover, #add-new-comment a:hover, .tablenav .tablenav-pages a:hover, .tablenav .tablenav-pages a:focus { color: white; background-color: #5fb37c; }
33
-
34
- .view-switch a.current:before { color: #5fb37c; }
35
-
36
- .view-switch a:hover:before { color: #33834e; }
37
-
38
- .post-com-count:hover:after { border-top-color: #5fb37c; }
39
-
40
- .post-com-count:hover span { color: white; background-color: #5fb37c; }
41
-
42
- strong .post-com-count:after { border-top-color: #33834e; }
43
-
44
- strong .post-com-count span { background-color: #33834e; }
45
-
46
- /* Admin Menu */
47
- #adminmenuback, #adminmenuwrap, #adminmenu { background: #5fb37c; }
48
-
49
- #adminmenu a { color: white; }
50
-
51
- #adminmenu div.wp-menu-image:before { color: #f1f3f2; }
52
-
53
- #adminmenu a:hover, #adminmenu li.menu-top:hover, #adminmenu li.opensub > a.menu-top, #adminmenu li > a.menu-top:focus { color: white; background-color: #4f6d59; }
54
-
55
- #adminmenu li.menu-top:hover div.wp-menu-image:before, #adminmenu li.opensub > a.menu-top div.wp-menu-image:before { color: white; }
56
-
57
- /* Admin Menu: submenu */
58
- #adminmenu .wp-submenu, #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .wp-has-current-submenu.opensub .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu { background: #4ca26a; }
59
-
60
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after { border-left-color: #4ca26a; }
61
-
62
- #adminmenu .wp-submenu .wp-submenu-head { color: #cfe8d7; }
63
-
64
- #adminmenu .wp-submenu a, #adminmenu .wp-has-current-submenu .wp-submenu a, .folded #adminmenu .wp-has-current-submenu .wp-submenu a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a { color: #cfe8d7; }
65
- #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover, #adminmenu .wp-has-current-submenu .wp-submenu a:focus, #adminmenu .wp-has-current-submenu .wp-submenu a:hover, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover { color: #4f6d59; }
66
-
67
- /* Admin Menu: current */
68
- #adminmenu .wp-submenu li.current a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a { color: white; }
69
- #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus { color: #4f6d59; }
70
-
71
- ul#adminmenu a.wp-has-current-submenu:after, ul#adminmenu > li.current > a.current:after { border-left-color: #eeeeee; }
72
-
73
- #adminmenu li.current a.menu-top, #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head, .folded #adminmenu li.current.menu-top { color: white; background: #4f6d59; }
74
-
75
- #adminmenu li.wp-has-current-submenu div.wp-menu-image:before { color: white; }
76
-
77
- /* Admin Menu: bubble */
78
- #adminmenu .awaiting-mod, #adminmenu .update-plugins { color: white; background: #33834e; }
79
-
80
- #adminmenu li.current a .awaiting-mod, #adminmenu li a.wp-has-current-submenu .update-plugins, #adminmenu li:hover a .awaiting-mod, #adminmenu li.menu-top:hover > a .update-plugins { color: white; background: #4ca26a; }
81
-
82
- /* Admin Menu: collapse button */
83
- #collapse-menu { color: #f1f3f2; }
84
-
85
- #collapse-menu:hover { color: white; }
86
-
87
- #collapse-button div:after { color: #f1f3f2; }
88
-
89
- #collapse-menu:hover #collapse-button div:after { color: white; }
90
-
91
- /* Admin Bar */
92
- #wpadminbar { color: white; background: #5fb37c; }
93
-
94
- #wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon { color: white; }
95
-
96
- #wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after { color: #f1f3f2; }
97
-
98
- #wpadminbar .ab-top-menu > li:hover > .ab-item, #wpadminbar .ab-top-menu > li.hover > .ab-item, #wpadminbar .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar-nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { color: #4f6d59; background: #4ca26a; }
99
-
100
- #wpadminbar > #wp-toolbar li:hover span.ab-label, #wpadminbar > #wp-toolbar li.hover span.ab-label, #wpadminbar > #wp-toolbar a:focus span.ab-label { color: #4f6d59; }
101
-
102
- #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: white; }
103
-
104
- /* Admin Bar: submenu */
105
- #wpadminbar .menupop .ab-sub-wrapper { background: #4ca26a; }
106
-
107
- #wpadminbar .quicklinks .menupop ul.ab-sub-secondary, #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu { background: #7eb892; }
108
-
109
- #wpadminbar .ab-submenu .ab-item, #wpadminbar .quicklinks .menupop ul li a, #wpadminbar .quicklinks .menupop.hover ul li a, #wpadminbar-nojs .quicklinks .menupop:hover ul li a { color: #cfe8d7; }
110
-
111
- #wpadminbar .quicklinks li .blavatar, #wpadminbar .menupop .menupop > .ab-item:before { color: #f1f3f2; }
112
-
113
- #wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus, #wpadminbar .quicklinks .menupop ul li a:hover strong, #wpadminbar .quicklinks .menupop ul li a:focus strong, #wpadminbar .quicklinks .menupop.hover ul li a:hover, #wpadminbar .quicklinks .menupop.hover ul li a:focus, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li a:focus .ab-icon:before, #wpadminbar li .ab-item:focus:before, #wpadminbar li.hover .ab-icon:before, #wpadminbar li.hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li.hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: #4f6d59; }
114
-
115
- #wpadminbar .quicklinks li a:hover .blavatar, #wpadminbar .menupop .menupop > .ab-item:hover:before { color: #4f6d59; }
116
-
117
- /* Admin Bar: search */
118
- #wpadminbar #adminbarsearch:before { color: #f1f3f2; }
119
-
120
- #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus { color: white; background: #77bf8f; }
121
-
122
- #wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder { color: white; opacity: .7; }
123
-
124
- #wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder { color: white; opacity: .7; }
125
-
126
- #wpadminbar #adminbarsearch .adminbar-input::-moz-placeholder { color: white; opacity: .7; }
127
-
128
- #wpadminbar #adminbarsearch .adminbar-input:-ms-input-placeholder { color: white; opacity: .7; }
129
-
130
- /* Admin Bar: my account */
131
- #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { border-color: #77bf8f; background-color: #77bf8f; }
132
-
133
- #wpadminbar #wp-admin-bar-user-info .display-name { color: white; }
134
-
135
- #wpadminbar #wp-admin-bar-user-info a:hover .display-name { color: #4f6d59; }
136
-
137
- #wpadminbar #wp-admin-bar-user-info .username { color: #cfe8d7; }
138
-
139
- /* Pointers */
140
- .wp-pointer .wp-pointer-content h3 { background-color: #4f6d59; }
141
-
142
- .wp-pointer.wp-pointer-top .wp-pointer-arrow, .wp-pointer.wp-pointer-undefined .wp-pointer-arrow { border-bottom-color: #4f6d59; }
143
-
144
- /* Media Uploader */
145
- .media-item .bar, .media-progress-bar div { background-color: #4f6d59; }
146
-
147
- .details.attachment { box-shadow: 0 0 0 1px white, 0 0 0 5px #4f6d59; }
148
-
149
- .attachment.details .check { background-color: #4f6d59; box-shadow: 0 0 0 1px white, 0 0 0 2px #4f6d59; }
150
-
151
- /* Themes */
152
- .theme-browser .theme.active .theme-name, .theme-browser .theme.add-new-theme:hover:after { background: #4f6d59; }
153
-
154
- .theme-browser .theme.add-new-theme:hover span:after { color: #4f6d59; }
155
-
156
- .theme-overlay .theme-header .close:hover, .theme-overlay .theme-header .right:hover, .theme-overlay .theme-header .left:hover { background: #4f6d59; }
157
-
158
- /* jQuery UI Slider */
159
- .wp-slider .ui-slider-handle, .wp-slider .ui-slider-handle.ui-state-hover, .wp-slider .ui-slider-handle.focus { background: #4f6d59; border-color: #3a4f41; -webkit-box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); }
160
-
161
- /* Responsive Component */
162
- div#wp-responsive-toggle a:before { color: #f1f3f2; }
163
-
164
- .wp-responsive-open div#wp-responsive-toggle a { border-color: transparent; background: #4f6d59; }
165
-
166
- .star-rating .star { color: #4f6d59; }
167
-
168
- .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a { background: #4ca26a; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/styles/mint.css DELETED
@@ -1,168 +0,0 @@
1
- /* Dashicons mixin use: @include dashicons( '\f140' ); */
2
- /* Button mixin- creates 3d-ish button effect with correct highlights/shadows, based on a base color. */
3
- html { background: #f2f2f2; }
4
-
5
- /* Links */
6
- a { color: #0074a2; }
7
- a:hover, a:active, a:focus { color: #0099d5; }
8
-
9
- #rightnow a:hover, #media-upload a.del-link:hover, div.dashboard-widget-submit input:hover, .subsubsub a:hover, .subsubsub a.current:hover, .ui-tabs-nav a:hover { color: #0099d5; }
10
-
11
- /* Forms */
12
- input[type=checkbox]:checked:before { color: #4f6d59; }
13
-
14
- input[type=radio]:checked:before { background: #4f6d59; }
15
-
16
- .wp-core-ui input[type="reset"]:hover, .wp-core-ui input[type="reset"]:active { color: #0099d5; }
17
-
18
- /* Core UI */
19
- .wp-core-ui .button-primary { background: #4f6d59; border-color: #3a4f41; color: white; -webkit-box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); }
20
- .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus { background: #3e5546; border-color: #2f4035; color: white; -webkit-box-shadow: inset 0 1px 0 #658a71, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #658a71, 0 1px 0 rgba(0, 0, 0, 0.15); }
21
- .wp-core-ui .button-primary:active { background: #3e5546; border-color: #2f4035; color: white; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); }
22
- .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled { color: #c7d1ca !important; background: #3e5546 !important; border-color: #2f4035 !important; text-shadow: none !important; }
23
- .wp-core-ui .wp-ui-primary { color: white; background-color: #5fb37c; }
24
- .wp-core-ui .wp-ui-text-primary { color: #5fb37c; }
25
- .wp-core-ui .wp-ui-highlight { color: white; background-color: #4f6d59; }
26
- .wp-core-ui .wp-ui-text-highlight { color: #4f6d59; }
27
- .wp-core-ui .wp-ui-notification { color: white; background-color: #33834e; }
28
- .wp-core-ui .wp-ui-text-notification { color: #33834e; }
29
- .wp-core-ui .wp-ui-text-icon { color: #f1f3f2; }
30
-
31
- /* List tables */
32
- .wrap .add-new-h2:hover, #add-new-comment a:hover, .tablenav .tablenav-pages a:hover, .tablenav .tablenav-pages a:focus { color: white; background-color: #5fb37c; }
33
-
34
- .view-switch a.current:before { color: #5fb37c; }
35
-
36
- .view-switch a:hover:before { color: #33834e; }
37
-
38
- .post-com-count:hover:after { border-top-color: #5fb37c; }
39
-
40
- .post-com-count:hover span { color: white; background-color: #5fb37c; }
41
-
42
- strong .post-com-count:after { border-top-color: #33834e; }
43
-
44
- strong .post-com-count span { background-color: #33834e; }
45
-
46
- /* Admin Menu */
47
- #adminmenuback, #adminmenuwrap, #adminmenu { background: #5fb37c; }
48
-
49
- #adminmenu a { color: white; }
50
-
51
- #adminmenu div.wp-menu-image:before { color: #f1f3f2; }
52
-
53
- #adminmenu a:hover, #adminmenu li.menu-top:hover, #adminmenu li.opensub > a.menu-top, #adminmenu li > a.menu-top:focus { color: white; background-color: #4f6d59; }
54
-
55
- #adminmenu li.menu-top:hover div.wp-menu-image:before, #adminmenu li.opensub > a.menu-top div.wp-menu-image:before { color: white; }
56
-
57
- /* Admin Menu: submenu */
58
- #adminmenu .wp-submenu, #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .wp-has-current-submenu.opensub .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu { background: #4ca26a; }
59
-
60
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after { border-right-color: #4ca26a; }
61
-
62
- #adminmenu .wp-submenu .wp-submenu-head { color: #cfe8d7; }
63
-
64
- #adminmenu .wp-submenu a, #adminmenu .wp-has-current-submenu .wp-submenu a, .folded #adminmenu .wp-has-current-submenu .wp-submenu a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a { color: #cfe8d7; }
65
- #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover, #adminmenu .wp-has-current-submenu .wp-submenu a:focus, #adminmenu .wp-has-current-submenu .wp-submenu a:hover, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus, .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover { color: #4f6d59; }
66
-
67
- /* Admin Menu: current */
68
- #adminmenu .wp-submenu li.current a, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a { color: white; }
69
- #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover, #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover, #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus { color: #4f6d59; }
70
-
71
- ul#adminmenu a.wp-has-current-submenu:after, ul#adminmenu > li.current > a.current:after { border-right-color: #eeeeee; }
72
-
73
- #adminmenu li.current a.menu-top, #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head, .folded #adminmenu li.current.menu-top { color: white; background: #4f6d59; }
74
-
75
- #adminmenu li.wp-has-current-submenu div.wp-menu-image:before { color: white; }
76
-
77
- /* Admin Menu: bubble */
78
- #adminmenu .awaiting-mod, #adminmenu .update-plugins { color: white; background: #33834e; }
79
-
80
- #adminmenu li.current a .awaiting-mod, #adminmenu li a.wp-has-current-submenu .update-plugins, #adminmenu li:hover a .awaiting-mod, #adminmenu li.menu-top:hover > a .update-plugins { color: white; background: #4ca26a; }
81
-
82
- /* Admin Menu: collapse button */
83
- #collapse-menu { color: #f1f3f2; }
84
-
85
- #collapse-menu:hover { color: white; }
86
-
87
- #collapse-button div:after { color: #f1f3f2; }
88
-
89
- #collapse-menu:hover #collapse-button div:after { color: white; }
90
-
91
- /* Admin Bar */
92
- #wpadminbar { color: white; background: #5fb37c; }
93
-
94
- #wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon { color: white; }
95
-
96
- #wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after { color: #f1f3f2; }
97
-
98
- #wpadminbar .ab-top-menu > li:hover > .ab-item, #wpadminbar .ab-top-menu > li.hover > .ab-item, #wpadminbar .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar-nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { color: #4f6d59; background: #4ca26a; }
99
-
100
- #wpadminbar > #wp-toolbar li:hover span.ab-label, #wpadminbar > #wp-toolbar li.hover span.ab-label, #wpadminbar > #wp-toolbar a:focus span.ab-label { color: #4f6d59; }
101
-
102
- #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: white; }
103
-
104
- /* Admin Bar: submenu */
105
- #wpadminbar .menupop .ab-sub-wrapper { background: #4ca26a; }
106
-
107
- #wpadminbar .quicklinks .menupop ul.ab-sub-secondary, #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu { background: #7eb892; }
108
-
109
- #wpadminbar .ab-submenu .ab-item, #wpadminbar .quicklinks .menupop ul li a, #wpadminbar .quicklinks .menupop.hover ul li a, #wpadminbar-nojs .quicklinks .menupop:hover ul li a { color: #cfe8d7; }
110
-
111
- #wpadminbar .quicklinks li .blavatar, #wpadminbar .menupop .menupop > .ab-item:before { color: #f1f3f2; }
112
-
113
- #wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus, #wpadminbar .quicklinks .menupop ul li a:hover strong, #wpadminbar .quicklinks .menupop ul li a:focus strong, #wpadminbar .quicklinks .menupop.hover ul li a:hover, #wpadminbar .quicklinks .menupop.hover ul li a:focus, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li a:focus .ab-icon:before, #wpadminbar li .ab-item:focus:before, #wpadminbar li.hover .ab-icon:before, #wpadminbar li.hover .ab-item:before, #wpadminbar li:hover .ab-item:after, #wpadminbar li.hover .ab-item:after, #wpadminbar li:hover #adminbarsearch:before { color: #4f6d59; }
114
-
115
- #wpadminbar .quicklinks li a:hover .blavatar, #wpadminbar .menupop .menupop > .ab-item:hover:before { color: #4f6d59; }
116
-
117
- /* Admin Bar: search */
118
- #wpadminbar #adminbarsearch:before { color: #f1f3f2; }
119
-
120
- #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus { color: white; background: #77bf8f; }
121
-
122
- #wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder { color: white; opacity: .7; }
123
-
124
- #wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder { color: white; opacity: .7; }
125
-
126
- #wpadminbar #adminbarsearch .adminbar-input::-moz-placeholder { color: white; opacity: .7; }
127
-
128
- #wpadminbar #adminbarsearch .adminbar-input:-ms-input-placeholder { color: white; opacity: .7; }
129
-
130
- /* Admin Bar: my account */
131
- #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { border-color: #77bf8f; background-color: #77bf8f; }
132
-
133
- #wpadminbar #wp-admin-bar-user-info .display-name { color: white; }
134
-
135
- #wpadminbar #wp-admin-bar-user-info a:hover .display-name { color: #4f6d59; }
136
-
137
- #wpadminbar #wp-admin-bar-user-info .username { color: #cfe8d7; }
138
-
139
- /* Pointers */
140
- .wp-pointer .wp-pointer-content h3 { background-color: #4f6d59; }
141
-
142
- .wp-pointer.wp-pointer-top .wp-pointer-arrow, .wp-pointer.wp-pointer-undefined .wp-pointer-arrow { border-bottom-color: #4f6d59; }
143
-
144
- /* Media Uploader */
145
- .media-item .bar, .media-progress-bar div { background-color: #4f6d59; }
146
-
147
- .details.attachment { box-shadow: 0 0 0 1px white, 0 0 0 5px #4f6d59; }
148
-
149
- .attachment.details .check { background-color: #4f6d59; box-shadow: 0 0 0 1px white, 0 0 0 2px #4f6d59; }
150
-
151
- /* Themes */
152
- .theme-browser .theme.active .theme-name, .theme-browser .theme.add-new-theme:hover:after { background: #4f6d59; }
153
-
154
- .theme-browser .theme.add-new-theme:hover span:after { color: #4f6d59; }
155
-
156
- .theme-overlay .theme-header .close:hover, .theme-overlay .theme-header .right:hover, .theme-overlay .theme-header .left:hover { background: #4f6d59; }
157
-
158
- /* jQuery UI Slider */
159
- .wp-slider .ui-slider-handle, .wp-slider .ui-slider-handle.ui-state-hover, .wp-slider .ui-slider-handle.focus { background: #4f6d59; border-color: #3a4f41; -webkit-box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 1px 0 #71977e, 0 1px 0 rgba(0, 0, 0, 0.15); }
160
-
161
- /* Responsive Component */
162
- div#wp-responsive-toggle a:before { color: #f1f3f2; }
163
-
164
- .wp-responsive-open div#wp-responsive-toggle a { border-color: transparent; background: #4f6d59; }
165
-
166
- .star-rating .star { color: #4f6d59; }
167
-
168
- .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a { background: #4ca26a; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/styles/mint/colors-rtl.css ADDED
@@ -0,0 +1,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Button mixin- creates 3d-ish button effect with correct
3
+ * highlights/shadows, based on a base color.
4
+ */
5
+ body {
6
+ background: #f1f1f1;
7
+ }
8
+
9
+ /* Links */
10
+ a {
11
+ color: #0073aa;
12
+ }
13
+
14
+ a:hover, a:active, a:focus {
15
+ color: #0096dd;
16
+ }
17
+
18
+ #media-upload a.del-link:hover,
19
+ div.dashboard-widget-submit input:hover,
20
+ .subsubsub a:hover,
21
+ .subsubsub a.current:hover {
22
+ color: #0096dd;
23
+ }
24
+
25
+ /* Forms */
26
+ input[type=checkbox]:checked:before {
27
+ color: #4f6d59;
28
+ }
29
+
30
+ input[type=radio]:checked:before {
31
+ background: #4f6d59;
32
+ }
33
+
34
+ .wp-core-ui input[type="reset"]:hover,
35
+ .wp-core-ui input[type="reset"]:active {
36
+ color: #0096dd;
37
+ }
38
+
39
+ /* Core UI */
40
+ .wp-core-ui .button-primary {
41
+ background: #4f6d59;
42
+ border-color: #3a4f41 #2f4035 #2f4035;
43
+ color: white;
44
+ -webkit-box-shadow: 0 1px 0 #2f4035;
45
+ box-shadow: 0 1px 0 #2f4035;
46
+ text-shadow: 0 -1px 1px #2f4035, -1px 0 1px #2f4035, 0 1px 1px #2f4035, 1px 0 1px #2f4035;
47
+ }
48
+
49
+ .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
50
+ background: #567560;
51
+ border-color: #2f4035;
52
+ color: white;
53
+ -webkit-box-shadow: 0 1px 0 #2f4035;
54
+ box-shadow: 0 1px 0 #2f4035;
55
+ }
56
+
57
+ .wp-core-ui .button-primary:focus {
58
+ -webkit-box-shadow: inset 0 1px 0 #3a4f41, 0 0 2px 1px #33b3db;
59
+ box-shadow: inset 0 1px 0 #3a4f41, 0 0 2px 1px #33b3db;
60
+ }
61
+
62
+ .wp-core-ui .button-primary:active {
63
+ background: #3a4f41;
64
+ border-color: #2f4035;
65
+ -webkit-box-shadow: inset 0 2px 0 #2f4035;
66
+ box-shadow: inset 0 2px 0 #2f4035;
67
+ }
68
+
69
+ .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
70
+ color: #c7d1ca !important;
71
+ background: #3e5546 !important;
72
+ border-color: #2f4035 !important;
73
+ text-shadow: none !important;
74
+ }
75
+
76
+ .wp-core-ui .button-primary.button-hero {
77
+ -webkit-box-shadow: 0 2px 0 #2f4035 !important;
78
+ box-shadow: 0 2px 0 #2f4035 !important;
79
+ }
80
+
81
+ .wp-core-ui .button-primary.button-hero:active {
82
+ -webkit-box-shadow: inset 0 3px 0 #2f4035 !important;
83
+ box-shadow: inset 0 3px 0 #2f4035 !important;
84
+ }
85
+
86
+ .wp-core-ui .wp-ui-primary {
87
+ color: #fff;
88
+ background-color: #5fb37c;
89
+ }
90
+
91
+ .wp-core-ui .wp-ui-text-primary {
92
+ color: #5fb37c;
93
+ }
94
+
95
+ .wp-core-ui .wp-ui-highlight {
96
+ color: #fff;
97
+ background-color: #4f6d59;
98
+ }
99
+
100
+ .wp-core-ui .wp-ui-text-highlight {
101
+ color: #4f6d59;
102
+ }
103
+
104
+ .wp-core-ui .wp-ui-notification {
105
+ color: #fff;
106
+ background-color: #33834e;
107
+ }
108
+
109
+ .wp-core-ui .wp-ui-text-notification {
110
+ color: #33834e;
111
+ }
112
+
113
+ .wp-core-ui .wp-ui-text-icon {
114
+ color: #f1f3f2;
115
+ }
116
+
117
+ /* List tables */
118
+ .wrap .add-new-h2:hover,
119
+ .wrap .page-title-action:hover,
120
+ .tablenav .tablenav-pages a:hover,
121
+ .tablenav .tablenav-pages a:focus {
122
+ color: #fff;
123
+ background-color: #5fb37c;
124
+ }
125
+
126
+ .view-switch a.current:before {
127
+ color: #5fb37c;
128
+ }
129
+
130
+ .view-switch a:hover:before {
131
+ color: #33834e;
132
+ }
133
+
134
+ /* Admin Menu */
135
+ #adminmenuback,
136
+ #adminmenuwrap,
137
+ #adminmenu {
138
+ background: #5fb37c;
139
+ }
140
+
141
+ #adminmenu a {
142
+ color: #fff;
143
+ }
144
+
145
+ #adminmenu div.wp-menu-image:before {
146
+ color: #f1f3f2;
147
+ }
148
+
149
+ #adminmenu a:hover,
150
+ #adminmenu li.menu-top:hover,
151
+ #adminmenu li.opensub > a.menu-top,
152
+ #adminmenu li > a.menu-top:focus {
153
+ color: #fff;
154
+ background-color: #4f6d59;
155
+ }
156
+
157
+ #adminmenu li.menu-top:hover div.wp-menu-image:before,
158
+ #adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
159
+ color: #fff;
160
+ }
161
+
162
+ /* Active tabs use a bottom border color that matches the page background color. */
163
+ .about-wrap h2 .nav-tab-active,
164
+ .nav-tab-active,
165
+ .nav-tab-active:hover {
166
+ background-color: #f1f1f1;
167
+ border-bottom-color: #f1f1f1;
168
+ }
169
+
170
+ /* Admin Menu: submenu */
171
+ #adminmenu .wp-submenu,
172
+ #adminmenu .wp-has-current-submenu .wp-submenu,
173
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
174
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu,
175
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
176
+ background: #4ca26a;
177
+ }
178
+
179
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
180
+ border-left-color: #4ca26a;
181
+ }
182
+
183
+ #adminmenu .wp-submenu .wp-submenu-head {
184
+ color: #cfe8d8;
185
+ }
186
+
187
+ #adminmenu .wp-submenu a,
188
+ #adminmenu .wp-has-current-submenu .wp-submenu a,
189
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a,
190
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
191
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
192
+ color: #cfe8d8;
193
+ }
194
+
195
+ #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
196
+ #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
197
+ #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
198
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
199
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
200
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
201
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
202
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
203
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
204
+ color: #4f6d59;
205
+ }
206
+
207
+ /* Admin Menu: current */
208
+ #adminmenu .wp-submenu li.current a,
209
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
210
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
211
+ color: #fff;
212
+ }
213
+
214
+ #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
215
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
216
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
217
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
218
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
219
+ color: #4f6d59;
220
+ }
221
+
222
+ ul#adminmenu a.wp-has-current-submenu:after,
223
+ ul#adminmenu > li.current > a.current:after {
224
+ border-left-color: #f1f1f1;
225
+ }
226
+
227
+ #adminmenu li.current a.menu-top,
228
+ #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
229
+ #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
230
+ .folded #adminmenu li.current.menu-top {
231
+ color: #fff;
232
+ background: #4f6d59;
233
+ }
234
+
235
+ #adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
236
+ #adminmenu a.current:hover div.wp-menu-image:before,
237
+ #adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
238
+ #adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
239
+ #adminmenu li:hover div.wp-menu-image:before,
240
+ #adminmenu li a:focus div.wp-menu-image:before,
241
+ #adminmenu li.opensub div.wp-menu-image:before,
242
+ .ie8 #adminmenu li.opensub div.wp-menu-image:before {
243
+ color: #fff;
244
+ }
245
+
246
+ /* Admin Menu: bubble */
247
+ #adminmenu .awaiting-mod,
248
+ #adminmenu .update-plugins {
249
+ color: #fff;
250
+ background: #33834e;
251
+ }
252
+
253
+ #adminmenu li.current a .awaiting-mod,
254
+ #adminmenu li a.wp-has-current-submenu .update-plugins,
255
+ #adminmenu li:hover a .awaiting-mod,
256
+ #adminmenu li.menu-top:hover > a .update-plugins {
257
+ color: #fff;
258
+ background: #4ca26a;
259
+ }
260
+
261
+ /* Admin Menu: collapse button */
262
+ #collapse-button {
263
+ color: #f1f3f2;
264
+ }
265
+
266
+ #collapse-button:hover,
267
+ #collapse-button:focus {
268
+ color: #4f6d59;
269
+ }
270
+
271
+ /* Admin Bar */
272
+ #wpadminbar {
273
+ color: #fff;
274
+ background: #5fb37c;
275
+ }
276
+
277
+ #wpadminbar .ab-item,
278
+ #wpadminbar a.ab-item,
279
+ #wpadminbar > #wp-toolbar span.ab-label,
280
+ #wpadminbar > #wp-toolbar span.noticon {
281
+ color: #fff;
282
+ }
283
+
284
+ #wpadminbar .ab-icon,
285
+ #wpadminbar .ab-icon:before,
286
+ #wpadminbar .ab-item:before,
287
+ #wpadminbar .ab-item:after {
288
+ color: #f1f3f2;
289
+ }
290
+
291
+ #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
292
+ #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
293
+ #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
294
+ #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
295
+ #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
296
+ color: #4f6d59;
297
+ background: #4ca26a;
298
+ }
299
+
300
+ #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
301
+ #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
302
+ #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
303
+ color: #4f6d59;
304
+ }
305
+
306
+ #wpadminbar:not(.mobile) li:hover .ab-icon:before,
307
+ #wpadminbar:not(.mobile) li:hover .ab-item:before,
308
+ #wpadminbar:not(.mobile) li:hover .ab-item:after,
309
+ #wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
310
+ color: #fff;
311
+ }
312
+
313
+ /* Admin Bar: submenu */
314
+ #wpadminbar .menupop .ab-sub-wrapper {
315
+ background: #4ca26a;
316
+ }
317
+
318
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
319
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
320
+ background: #7eb892;
321
+ }
322
+
323
+ #wpadminbar .ab-submenu .ab-item,
324
+ #wpadminbar .quicklinks .menupop ul li a,
325
+ #wpadminbar .quicklinks .menupop.hover ul li a,
326
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a {
327
+ color: #cfe8d8;
328
+ }
329
+
330
+ #wpadminbar .quicklinks li .blavatar,
331
+ #wpadminbar .menupop .menupop > .ab-item:before {
332
+ color: #f1f3f2;
333
+ }
334
+
335
+ #wpadminbar .quicklinks .menupop ul li a:hover,
336
+ #wpadminbar .quicklinks .menupop ul li a:focus,
337
+ #wpadminbar .quicklinks .menupop ul li a:hover strong,
338
+ #wpadminbar .quicklinks .menupop ul li a:focus strong,
339
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
340
+ #wpadminbar .quicklinks .menupop.hover ul li a:hover,
341
+ #wpadminbar .quicklinks .menupop.hover ul li a:focus,
342
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
343
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
344
+ #wpadminbar li:hover .ab-icon:before,
345
+ #wpadminbar li:hover .ab-item:before,
346
+ #wpadminbar li a:focus .ab-icon:before,
347
+ #wpadminbar li .ab-item:focus:before,
348
+ #wpadminbar li .ab-item:focus .ab-icon:before,
349
+ #wpadminbar li.hover .ab-icon:before,
350
+ #wpadminbar li.hover .ab-item:before,
351
+ #wpadminbar li:hover #adminbarsearch:before,
352
+ #wpadminbar li #adminbarsearch.adminbar-focused:before {
353
+ color: #4f6d59;
354
+ }
355
+
356
+ #wpadminbar .quicklinks li a:hover .blavatar,
357
+ #wpadminbar .quicklinks li a:focus .blavatar,
358
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
359
+ #wpadminbar .menupop .menupop > .ab-item:hover:before,
360
+ #wpadminbar.mobile .quicklinks .ab-icon:before,
361
+ #wpadminbar.mobile .quicklinks .ab-item:before {
362
+ color: #4f6d59;
363
+ }
364
+
365
+ #wpadminbar.mobile .quicklinks .hover .ab-icon:before,
366
+ #wpadminbar.mobile .quicklinks .hover .ab-item:before {
367
+ color: #f1f3f2;
368
+ }
369
+
370
+ /* Admin Bar: search */
371
+ #wpadminbar #adminbarsearch:before {
372
+ color: #f1f3f2;
373
+ }
374
+
375
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
376
+ color: #fff;
377
+ background: #77bf8f;
378
+ }
379
+
380
+ /* Admin Bar: my account */
381
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
382
+ border-color: #77bf8f;
383
+ background-color: #77bf8f;
384
+ }
385
+
386
+ #wpadminbar #wp-admin-bar-user-info .display-name {
387
+ color: #fff;
388
+ }
389
+
390
+ #wpadminbar #wp-admin-bar-user-info a:hover .display-name {
391
+ color: #4f6d59;
392
+ }
393
+
394
+ #wpadminbar #wp-admin-bar-user-info .username {
395
+ color: #cfe8d8;
396
+ }
397
+
398
+ /* Pointers */
399
+ .wp-pointer .wp-pointer-content h3 {
400
+ background-color: #4f6d59;
401
+ border-color: #455e4d;
402
+ }
403
+
404
+ .wp-pointer .wp-pointer-content h3:before {
405
+ color: #4f6d59;
406
+ }
407
+
408
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow,
409
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
410
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
411
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
412
+ border-bottom-color: #4f6d59;
413
+ }
414
+
415
+ /* Media */
416
+ .media-item .bar,
417
+ .media-progress-bar div {
418
+ background-color: #4f6d59;
419
+ }
420
+
421
+ .details.attachment {
422
+ -webkit-box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #4f6d59;
423
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #4f6d59;
424
+ }
425
+
426
+ .attachment.details .check {
427
+ background-color: #4f6d59;
428
+ -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 2px #4f6d59;
429
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #4f6d59;
430
+ }
431
+
432
+ .media-selection .attachment.selection.details .thumbnail {
433
+ -webkit-box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #4f6d59;
434
+ box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #4f6d59;
435
+ }
436
+
437
+ /* Themes */
438
+ .theme-browser .theme.active .theme-name,
439
+ .theme-browser .theme.add-new-theme a:hover:after,
440
+ .theme-browser .theme.add-new-theme a:focus:after {
441
+ background: #4f6d59;
442
+ }
443
+
444
+ .theme-browser .theme.add-new-theme a:hover span:after,
445
+ .theme-browser .theme.add-new-theme a:focus span:after {
446
+ color: #4f6d59;
447
+ }
448
+
449
+ .theme-section.current,
450
+ .theme-filter.current {
451
+ border-bottom-color: #5fb37c;
452
+ }
453
+
454
+ body.more-filters-opened .more-filters {
455
+ color: #fff;
456
+ background-color: #5fb37c;
457
+ }
458
+
459
+ body.more-filters-opened .more-filters:before {
460
+ color: #fff;
461
+ }
462
+
463
+ body.more-filters-opened .more-filters:hover,
464
+ body.more-filters-opened .more-filters:focus {
465
+ background-color: #4f6d59;
466
+ color: #fff;
467
+ }
468
+
469
+ body.more-filters-opened .more-filters:hover:before,
470
+ body.more-filters-opened .more-filters:focus:before {
471
+ color: #fff;
472
+ }
473
+
474
+ /* Widgets */
475
+ .widgets-chooser li.widgets-chooser-selected {
476
+ background-color: #4f6d59;
477
+ color: #fff;
478
+ }
479
+
480
+ .widgets-chooser li.widgets-chooser-selected:before,
481
+ .widgets-chooser li.widgets-chooser-selected:focus:before {
482
+ color: #fff;
483
+ }
484
+
485
+ /* Responsive Component */
486
+ div#wp-responsive-toggle a:before {
487
+ color: #f1f3f2;
488
+ }
489
+
490
+ .wp-responsive-open div#wp-responsive-toggle a {
491
+ border-color: transparent;
492
+ background: #4f6d59;
493
+ }
494
+
495
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
496
+ background: #4ca26a;
497
+ }
498
+
499
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
500
+ color: #f1f3f2;
501
+ }
502
+
503
+ /* TinyMCE */
504
+ .mce-container.mce-menu .mce-menu-item:hover,
505
+ .mce-container.mce-menu .mce-menu-item.mce-selected,
506
+ .mce-container.mce-menu .mce-menu-item:focus,
507
+ .mce-container.mce-menu .mce-menu-item-normal.mce-active,
508
+ .mce-container.mce-menu .mce-menu-item-preview.mce-active {
509
+ background: #4f6d59;
510
+ }
includes/admin/styles/mint/colors-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body{background:#f1f1f1}a{color:#0073aa}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,a:active,a:focus,a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#4f6d59}input[type=radio]:checked:before{background:#4f6d59}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#4f6d59;border-color:#3a4f41 #2f4035 #2f4035;color:#fff;-webkit-box-shadow:0 1px 0 #2f4035;box-shadow:0 1px 0 #2f4035;text-shadow:0 -1px 1px #2f4035,-1px 0 1px #2f4035,0 1px 1px #2f4035,1px 0 1px #2f4035}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#567560;border-color:#2f4035;color:#fff;-webkit-box-shadow:0 1px 0 #2f4035;box-shadow:0 1px 0 #2f4035}.wp-core-ui .button-primary:focus{-webkit-box-shadow:inset 0 1px 0 #3a4f41,0 0 2px 1px #33b3db;box-shadow:inset 0 1px 0 #3a4f41,0 0 2px 1px #33b3db}.wp-core-ui .button-primary:active{background:#3a4f41;border-color:#2f4035;-webkit-box-shadow:inset 0 2px 0 #2f4035;box-shadow:inset 0 2px 0 #2f4035}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7d1ca!important;background:#3e5546!important;border-color:#2f4035!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{-webkit-box-shadow:0 2px 0 #2f4035!important;box-shadow:0 2px 0 #2f4035!important}.wp-core-ui .button-primary.button-hero:active{-webkit-box-shadow:inset 0 3px 0 #2f4035!important;box-shadow:inset 0 3px 0 #2f4035!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#5fb37c}.wp-core-ui .wp-ui-text-primary{color:#5fb37c}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#4f6d59}.wp-core-ui .wp-ui-text-highlight{color:#4f6d59}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#33834e}.wp-core-ui .wp-ui-text-notification{color:#33834e}.wp-core-ui .wp-ui-text-icon{color:#f1f3f2}.tablenav .tablenav-pages a:focus,.tablenav .tablenav-pages a:hover,.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#5fb37c}.view-switch a.current:before{color:#5fb37c}.view-switch a:hover:before{color:#33834e}#adminmenu,#adminmenuback,#adminmenuwrap{background:#5fb37c}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f1f3f2}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#4f6d59}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap h2 .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#4ca26a}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#4ca26a}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu .wp-submenu-head,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#cfe8d8}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#4f6d59}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#4f6d59}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#4f6d59}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#33834e}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#4ca26a}#collapse-button{color:#f1f3f2}#collapse-button:focus,#collapse-button:hover{color:#4f6d59}#wpadminbar{color:#fff;background:#5fb37c}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f1f3f2}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#4f6d59;background:#4ca26a}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#4f6d59}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#4ca26a}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#7eb892}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#cfe8d8}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f1f3f2}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#4f6d59}#wpadminbar #adminbarsearch:before,#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f1f3f2}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#77bf8f}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#77bf8f;background-color:#77bf8f}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#4f6d59}#wpadminbar #wp-admin-bar-user-info .username{color:#cfe8d8}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after,.wp-pointer .wp-pointer-content h3:before{color:#4f6d59}.wp-pointer .wp-pointer-content h3{background-color:#4f6d59;border-color:#455e4d}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#4f6d59}.media-item .bar,.media-progress-bar div{background-color:#4f6d59}.details.attachment{-webkit-box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #4f6d59;box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #4f6d59}.attachment.details .check{background-color:#4f6d59;-webkit-box-shadow:0 0 0 1px #fff,0 0 0 2px #4f6d59;box-shadow:0 0 0 1px #fff,0 0 0 2px #4f6d59}.media-selection .attachment.selection.details .thumbnail{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #4f6d59;box-shadow:0 0 0 1px #fff,0 0 0 3px #4f6d59}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#4f6d59}.theme-filter.current,.theme-section.current{border-bottom-color:#5fb37c}body.more-filters-opened .more-filters{color:#fff;background-color:#5fb37c}.widgets-chooser li.widgets-chooser-selected,body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#4f6d59;color:#fff}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before,div#wp-responsive-toggle a:before{color:#f1f3f2}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#4f6d59}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#4ca26a}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#4f6d59}
includes/admin/styles/mint/colors.css ADDED
@@ -0,0 +1,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Button mixin- creates 3d-ish button effect with correct
3
+ * highlights/shadows, based on a base color.
4
+ */
5
+ body {
6
+ background: #f1f1f1;
7
+ }
8
+
9
+ /* Links */
10
+ a {
11
+ color: #0073aa;
12
+ }
13
+
14
+ a:hover, a:active, a:focus {
15
+ color: #0096dd;
16
+ }
17
+
18
+ #media-upload a.del-link:hover,
19
+ div.dashboard-widget-submit input:hover,
20
+ .subsubsub a:hover,
21
+ .subsubsub a.current:hover {
22
+ color: #0096dd;
23
+ }
24
+
25
+ /* Forms */
26
+ input[type=checkbox]:checked:before {
27
+ color: #4f6d59;
28
+ }
29
+
30
+ input[type=radio]:checked:before {
31
+ background: #4f6d59;
32
+ }
33
+
34
+ .wp-core-ui input[type="reset"]:hover,
35
+ .wp-core-ui input[type="reset"]:active {
36
+ color: #0096dd;
37
+ }
38
+
39
+ /* Core UI */
40
+ .wp-core-ui .button-primary {
41
+ background: #4f6d59;
42
+ border-color: #3a4f41 #2f4035 #2f4035;
43
+ color: white;
44
+ -webkit-box-shadow: 0 1px 0 #2f4035;
45
+ box-shadow: 0 1px 0 #2f4035;
46
+ text-shadow: 0 -1px 1px #2f4035, 1px 0 1px #2f4035, 0 1px 1px #2f4035, -1px 0 1px #2f4035;
47
+ }
48
+
49
+ .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
50
+ background: #567560;
51
+ border-color: #2f4035;
52
+ color: white;
53
+ -webkit-box-shadow: 0 1px 0 #2f4035;
54
+ box-shadow: 0 1px 0 #2f4035;
55
+ }
56
+
57
+ .wp-core-ui .button-primary:focus {
58
+ -webkit-box-shadow: inset 0 1px 0 #3a4f41, 0 0 2px 1px #33b3db;
59
+ box-shadow: inset 0 1px 0 #3a4f41, 0 0 2px 1px #33b3db;
60
+ }
61
+
62
+ .wp-core-ui .button-primary:active {
63
+ background: #3a4f41;
64
+ border-color: #2f4035;
65
+ -webkit-box-shadow: inset 0 2px 0 #2f4035;
66
+ box-shadow: inset 0 2px 0 #2f4035;
67
+ }
68
+
69
+ .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
70
+ color: #c7d1ca !important;
71
+ background: #3e5546 !important;
72
+ border-color: #2f4035 !important;
73
+ text-shadow: none !important;
74
+ }
75
+
76
+ .wp-core-ui .button-primary.button-hero {
77
+ -webkit-box-shadow: 0 2px 0 #2f4035 !important;
78
+ box-shadow: 0 2px 0 #2f4035 !important;
79
+ }
80
+
81
+ .wp-core-ui .button-primary.button-hero:active {
82
+ -webkit-box-shadow: inset 0 3px 0 #2f4035 !important;
83
+ box-shadow: inset 0 3px 0 #2f4035 !important;
84
+ }
85
+
86
+ .wp-core-ui .wp-ui-primary {
87
+ color: #fff;
88
+ background-color: #5fb37c;
89
+ }
90
+
91
+ .wp-core-ui .wp-ui-text-primary {
92
+ color: #5fb37c;
93
+ }
94
+
95
+ .wp-core-ui .wp-ui-highlight {
96
+ color: #fff;
97
+ background-color: #4f6d59;
98
+ }
99
+
100
+ .wp-core-ui .wp-ui-text-highlight {
101
+ color: #4f6d59;
102
+ }
103
+
104
+ .wp-core-ui .wp-ui-notification {
105
+ color: #fff;
106
+ background-color: #33834e;
107
+ }
108
+
109
+ .wp-core-ui .wp-ui-text-notification {
110
+ color: #33834e;
111
+ }
112
+
113
+ .wp-core-ui .wp-ui-text-icon {
114
+ color: #f1f3f2;
115
+ }
116
+
117
+ /* List tables */
118
+ .wrap .add-new-h2:hover,
119
+ .wrap .page-title-action:hover,
120
+ .tablenav .tablenav-pages a:hover,
121
+ .tablenav .tablenav-pages a:focus {
122
+ color: #fff;
123
+ background-color: #5fb37c;
124
+ }
125
+
126
+ .view-switch a.current:before {
127
+ color: #5fb37c;
128
+ }
129
+
130
+ .view-switch a:hover:before {
131
+ color: #33834e;
132
+ }
133
+
134
+ /* Admin Menu */
135
+ #adminmenuback,
136
+ #adminmenuwrap,
137
+ #adminmenu {
138
+ background: #5fb37c;
139
+ }
140
+
141
+ #adminmenu a {
142
+ color: #fff;
143
+ }
144
+
145
+ #adminmenu div.wp-menu-image:before {
146
+ color: #f1f3f2;
147
+ }
148
+
149
+ #adminmenu a:hover,
150
+ #adminmenu li.menu-top:hover,
151
+ #adminmenu li.opensub > a.menu-top,
152
+ #adminmenu li > a.menu-top:focus {
153
+ color: #fff;
154
+ background-color: #4f6d59;
155
+ }
156
+
157
+ #adminmenu li.menu-top:hover div.wp-menu-image:before,
158
+ #adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
159
+ color: #fff;
160
+ }
161
+
162
+ /* Active tabs use a bottom border color that matches the page background color. */
163
+ .about-wrap h2 .nav-tab-active,
164
+ .nav-tab-active,
165
+ .nav-tab-active:hover {
166
+ background-color: #f1f1f1;
167
+ border-bottom-color: #f1f1f1;
168
+ }
169
+
170
+ /* Admin Menu: submenu */
171
+ #adminmenu .wp-submenu,
172
+ #adminmenu .wp-has-current-submenu .wp-submenu,
173
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
174
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu,
175
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
176
+ background: #4ca26a;
177
+ }
178
+
179
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
180
+ border-right-color: #4ca26a;
181
+ }
182
+
183
+ #adminmenu .wp-submenu .wp-submenu-head {
184
+ color: #cfe8d8;
185
+ }
186
+
187
+ #adminmenu .wp-submenu a,
188
+ #adminmenu .wp-has-current-submenu .wp-submenu a,
189
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a,
190
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
191
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
192
+ color: #cfe8d8;
193
+ }
194
+
195
+ #adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
196
+ #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
197
+ #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
198
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
199
+ .folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
200
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
201
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
202
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
203
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
204
+ color: #4f6d59;
205
+ }
206
+
207
+ /* Admin Menu: current */
208
+ #adminmenu .wp-submenu li.current a,
209
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
210
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
211
+ color: #fff;
212
+ }
213
+
214
+ #adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
215
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
216
+ #adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
217
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
218
+ #adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
219
+ color: #4f6d59;
220
+ }
221
+
222
+ ul#adminmenu a.wp-has-current-submenu:after,
223
+ ul#adminmenu > li.current > a.current:after {
224
+ border-right-color: #f1f1f1;
225
+ }
226
+
227
+ #adminmenu li.current a.menu-top,
228
+ #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
229
+ #adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
230
+ .folded #adminmenu li.current.menu-top {
231
+ color: #fff;
232
+ background: #4f6d59;
233
+ }
234
+
235
+ #adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
236
+ #adminmenu a.current:hover div.wp-menu-image:before,
237
+ #adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
238
+ #adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
239
+ #adminmenu li:hover div.wp-menu-image:before,
240
+ #adminmenu li a:focus div.wp-menu-image:before,
241
+ #adminmenu li.opensub div.wp-menu-image:before,
242
+ .ie8 #adminmenu li.opensub div.wp-menu-image:before {
243
+ color: #fff;
244
+ }
245
+
246
+ /* Admin Menu: bubble */
247
+ #adminmenu .awaiting-mod,
248
+ #adminmenu .update-plugins {
249
+ color: #fff;
250
+ background: #33834e;
251
+ }
252
+
253
+ #adminmenu li.current a .awaiting-mod,
254
+ #adminmenu li a.wp-has-current-submenu .update-plugins,
255
+ #adminmenu li:hover a .awaiting-mod,
256
+ #adminmenu li.menu-top:hover > a .update-plugins {
257
+ color: #fff;
258
+ background: #4ca26a;
259
+ }
260
+
261
+ /* Admin Menu: collapse button */
262
+ #collapse-button {
263
+ color: #f1f3f2;
264
+ }
265
+
266
+ #collapse-button:hover,
267
+ #collapse-button:focus {
268
+ color: #4f6d59;
269
+ }
270
+
271
+ /* Admin Bar */
272
+ #wpadminbar {
273
+ color: #fff;
274
+ background: #5fb37c;
275
+ }
276
+
277
+ #wpadminbar .ab-item,
278
+ #wpadminbar a.ab-item,
279
+ #wpadminbar > #wp-toolbar span.ab-label,
280
+ #wpadminbar > #wp-toolbar span.noticon {
281
+ color: #fff;
282
+ }
283
+
284
+ #wpadminbar .ab-icon,
285
+ #wpadminbar .ab-icon:before,
286
+ #wpadminbar .ab-item:before,
287
+ #wpadminbar .ab-item:after {
288
+ color: #f1f3f2;
289
+ }
290
+
291
+ #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
292
+ #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
293
+ #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
294
+ #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
295
+ #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
296
+ color: #4f6d59;
297
+ background: #4ca26a;
298
+ }
299
+
300
+ #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
301
+ #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
302
+ #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
303
+ color: #4f6d59;
304
+ }
305
+
306
+ #wpadminbar:not(.mobile) li:hover .ab-icon:before,
307
+ #wpadminbar:not(.mobile) li:hover .ab-item:before,
308
+ #wpadminbar:not(.mobile) li:hover .ab-item:after,
309
+ #wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
310
+ color: #fff;
311
+ }
312
+
313
+ /* Admin Bar: submenu */
314
+ #wpadminbar .menupop .ab-sub-wrapper {
315
+ background: #4ca26a;
316
+ }
317
+
318
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
319
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
320
+ background: #7eb892;
321
+ }
322
+
323
+ #wpadminbar .ab-submenu .ab-item,
324
+ #wpadminbar .quicklinks .menupop ul li a,
325
+ #wpadminbar .quicklinks .menupop.hover ul li a,
326
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a {
327
+ color: #cfe8d8;
328
+ }
329
+
330
+ #wpadminbar .quicklinks li .blavatar,
331
+ #wpadminbar .menupop .menupop > .ab-item:before {
332
+ color: #f1f3f2;
333
+ }
334
+
335
+ #wpadminbar .quicklinks .menupop ul li a:hover,
336
+ #wpadminbar .quicklinks .menupop ul li a:focus,
337
+ #wpadminbar .quicklinks .menupop ul li a:hover strong,
338
+ #wpadminbar .quicklinks .menupop ul li a:focus strong,
339
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
340
+ #wpadminbar .quicklinks .menupop.hover ul li a:hover,
341
+ #wpadminbar .quicklinks .menupop.hover ul li a:focus,
342
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
343
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
344
+ #wpadminbar li:hover .ab-icon:before,
345
+ #wpadminbar li:hover .ab-item:before,
346
+ #wpadminbar li a:focus .ab-icon:before,
347
+ #wpadminbar li .ab-item:focus:before,
348
+ #wpadminbar li .ab-item:focus .ab-icon:before,
349
+ #wpadminbar li.hover .ab-icon:before,
350
+ #wpadminbar li.hover .ab-item:before,
351
+ #wpadminbar li:hover #adminbarsearch:before,
352
+ #wpadminbar li #adminbarsearch.adminbar-focused:before {
353
+ color: #4f6d59;
354
+ }
355
+
356
+ #wpadminbar .quicklinks li a:hover .blavatar,
357
+ #wpadminbar .quicklinks li a:focus .blavatar,
358
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
359
+ #wpadminbar .menupop .menupop > .ab-item:hover:before,
360
+ #wpadminbar.mobile .quicklinks .ab-icon:before,
361
+ #wpadminbar.mobile .quicklinks .ab-item:before {
362
+ color: #4f6d59;
363
+ }
364
+
365
+ #wpadminbar.mobile .quicklinks .hover .ab-icon:before,
366
+ #wpadminbar.mobile .quicklinks .hover .ab-item:before {
367
+ color: #f1f3f2;
368
+ }
369
+
370
+ /* Admin Bar: search */
371
+ #wpadminbar #adminbarsearch:before {
372
+ color: #f1f3f2;
373
+ }
374
+
375
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
376
+ color: #fff;
377
+ background: #77bf8f;
378
+ }
379
+
380
+ /* Admin Bar: my account */
381
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
382
+ border-color: #77bf8f;
383
+ background-color: #77bf8f;
384
+ }
385
+
386
+ #wpadminbar #wp-admin-bar-user-info .display-name {
387
+ color: #fff;
388
+ }
389
+
390
+ #wpadminbar #wp-admin-bar-user-info a:hover .display-name {
391
+ color: #4f6d59;
392
+ }
393
+
394
+ #wpadminbar #wp-admin-bar-user-info .username {
395
+ color: #cfe8d8;
396
+ }
397
+
398
+ /* Pointers */
399
+ .wp-pointer .wp-pointer-content h3 {
400
+ background-color: #4f6d59;
401
+ border-color: #455e4d;
402
+ }
403
+
404
+ .wp-pointer .wp-pointer-content h3:before {
405
+ color: #4f6d59;
406
+ }
407
+
408
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow,
409
+ .wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
410
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
411
+ .wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
412
+ border-bottom-color: #4f6d59;
413
+ }
414
+
415
+ /* Media */
416
+ .media-item .bar,
417
+ .media-progress-bar div {
418
+ background-color: #4f6d59;
419
+ }
420
+
421
+ .details.attachment {
422
+ -webkit-box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #4f6d59;
423
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #4f6d59;
424
+ }
425
+
426
+ .attachment.details .check {
427
+ background-color: #4f6d59;
428
+ -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 2px #4f6d59;
429
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #4f6d59;
430
+ }
431
+
432
+ .media-selection .attachment.selection.details .thumbnail {
433
+ -webkit-box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #4f6d59;
434
+ box-shadow: 0px 0px 0px 1px #fff, 0px 0px 0px 3px #4f6d59;
435
+ }
436
+
437
+ /* Themes */
438
+ .theme-browser .theme.active .theme-name,
439
+ .theme-browser .theme.add-new-theme a:hover:after,
440
+ .theme-browser .theme.add-new-theme a:focus:after {
441
+ background: #4f6d59;
442
+ }
443
+
444
+ .theme-browser .theme.add-new-theme a:hover span:after,
445
+ .theme-browser .theme.add-new-theme a:focus span:after {
446
+ color: #4f6d59;
447
+ }
448
+
449
+ .theme-section.current,
450
+ .theme-filter.current {
451
+ border-bottom-color: #5fb37c;
452
+ }
453
+
454
+ body.more-filters-opened .more-filters {
455
+ color: #fff;
456
+ background-color: #5fb37c;
457
+ }
458
+
459
+ body.more-filters-opened .more-filters:before {
460
+ color: #fff;
461
+ }
462
+
463
+ body.more-filters-opened .more-filters:hover,
464
+ body.more-filters-opened .more-filters:focus {
465
+ background-color: #4f6d59;
466
+ color: #fff;
467
+ }
468
+
469
+ body.more-filters-opened .more-filters:hover:before,
470
+ body.more-filters-opened .more-filters:focus:before {
471
+ color: #fff;
472
+ }
473
+
474
+ /* Widgets */
475
+ .widgets-chooser li.widgets-chooser-selected {
476
+ background-color: #4f6d59;
477
+ color: #fff;
478
+ }
479
+
480
+ .widgets-chooser li.widgets-chooser-selected:before,
481
+ .widgets-chooser li.widgets-chooser-selected:focus:before {
482
+ color: #fff;
483
+ }
484
+
485
+ /* Responsive Component */
486
+ div#wp-responsive-toggle a:before {
487
+ color: #f1f3f2;
488
+ }
489
+
490
+ .wp-responsive-open div#wp-responsive-toggle a {
491
+ border-color: transparent;
492
+ background: #4f6d59;
493
+ }
494
+
495
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
496
+ background: #4ca26a;
497
+ }
498
+
499
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
500
+ color: #f1f3f2;
501
+ }
502
+
503
+ /* TinyMCE */
504
+ .mce-container.mce-menu .mce-menu-item:hover,
505
+ .mce-container.mce-menu .mce-menu-item.mce-selected,
506
+ .mce-container.mce-menu .mce-menu-item:focus,
507
+ .mce-container.mce-menu .mce-menu-item-normal.mce-active,
508
+ .mce-container.mce-menu .mce-menu-item-preview.mce-active {
509
+ background: #4f6d59;
510
+ }
includes/admin/styles/mint/colors.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body{background:#f1f1f1}a{color:#0073aa}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,a:active,a:focus,a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#4f6d59}input[type=radio]:checked:before{background:#4f6d59}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#4f6d59;border-color:#3a4f41 #2f4035 #2f4035;color:#fff;-webkit-box-shadow:0 1px 0 #2f4035;box-shadow:0 1px 0 #2f4035;text-shadow:0 -1px 1px #2f4035,1px 0 1px #2f4035,0 1px 1px #2f4035,-1px 0 1px #2f4035}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#567560;border-color:#2f4035;color:#fff;-webkit-box-shadow:0 1px 0 #2f4035;box-shadow:0 1px 0 #2f4035}.wp-core-ui .button-primary:focus{-webkit-box-shadow:inset 0 1px 0 #3a4f41,0 0 2px 1px #33b3db;box-shadow:inset 0 1px 0 #3a4f41,0 0 2px 1px #33b3db}.wp-core-ui .button-primary:active{background:#3a4f41;border-color:#2f4035;-webkit-box-shadow:inset 0 2px 0 #2f4035;box-shadow:inset 0 2px 0 #2f4035}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7d1ca!important;background:#3e5546!important;border-color:#2f4035!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{-webkit-box-shadow:0 2px 0 #2f4035!important;box-shadow:0 2px 0 #2f4035!important}.wp-core-ui .button-primary.button-hero:active{-webkit-box-shadow:inset 0 3px 0 #2f4035!important;box-shadow:inset 0 3px 0 #2f4035!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#5fb37c}.wp-core-ui .wp-ui-text-primary{color:#5fb37c}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#4f6d59}.wp-core-ui .wp-ui-text-highlight{color:#4f6d59}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#33834e}.wp-core-ui .wp-ui-text-notification{color:#33834e}.wp-core-ui .wp-ui-text-icon{color:#f1f3f2}.tablenav .tablenav-pages a:focus,.tablenav .tablenav-pages a:hover,.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#5fb37c}.view-switch a.current:before{color:#5fb37c}.view-switch a:hover:before{color:#33834e}#adminmenu,#adminmenuback,#adminmenuwrap{background:#5fb37c}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f1f3f2}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#4f6d59}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap h2 .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#4ca26a}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#4ca26a}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu .wp-submenu-head,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#cfe8d8}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#4f6d59}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#4f6d59}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#4f6d59}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#33834e}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#4ca26a}#collapse-button{color:#f1f3f2}#collapse-button:focus,#collapse-button:hover{color:#4f6d59}#wpadminbar{color:#fff;background:#5fb37c}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f1f3f2}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#4f6d59;background:#4ca26a}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#4f6d59}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#4ca26a}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#7eb892}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#cfe8d8}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f1f3f2}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#4f6d59}#wpadminbar #adminbarsearch:before,#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f1f3f2}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#77bf8f}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#77bf8f;background-color:#77bf8f}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#4f6d59}#wpadminbar #wp-admin-bar-user-info .username{color:#cfe8d8}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after,.wp-pointer .wp-pointer-content h3:before{color:#4f6d59}.wp-pointer .wp-pointer-content h3{background-color:#4f6d59;border-color:#455e4d}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#4f6d59}.media-item .bar,.media-progress-bar div{background-color:#4f6d59}.details.attachment{-webkit-box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #4f6d59;box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #4f6d59}.attachment.details .check{background-color:#4f6d59;-webkit-box-shadow:0 0 0 1px #fff,0 0 0 2px #4f6d59;box-shadow:0 0 0 1px #fff,0 0 0 2px #4f6d59}.media-selection .attachment.selection.details .thumbnail{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #4f6d59;box-shadow:0 0 0 1px #fff,0 0 0 3px #4f6d59}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#4f6d59}.theme-filter.current,.theme-section.current{border-bottom-color:#5fb37c}body.more-filters-opened .more-filters{color:#fff;background-color:#5fb37c}.widgets-chooser li.widgets-chooser-selected,body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#4f6d59;color:#fff}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before,div#wp-responsive-toggle a:before{color:#f1f3f2}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#4f6d59}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#4ca26a}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#4f6d59}
includes/admin/tools.php CHANGED
@@ -8,59 +8,151 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Repair ********************************************************************/
14
 
15
  /**
16
  * Admin repair page
17
  *
18
- * @since bbPress (r2613)
 
 
 
19
  *
20
  * @uses bbp_admin_repair_list() To get the recount list
21
  * @uses check_admin_referer() To verify the nonce and the referer
22
  * @uses wp_cache_flush() To flush the cache
23
  * @uses do_action() Calls 'admin_notices' to display the notices
24
- * @uses screen_icon() To display the screen icon
25
  * @uses wp_nonce_field() To add a hidden nonce field
26
  */
27
  function bbp_admin_repair() {
28
- ?>
 
 
29
 
30
  <div class="wrap">
 
 
31
 
32
- <?php screen_icon( 'tools' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Repair Forums', 'bbpress' ) ); ?></h2>
35
 
36
- <p><?php esc_html_e( 'bbPress keeps track of relationships between forums, topics, replies, and topic tags, and users. Occasionally these relationships become out of sync, most often after an import or migration. Use the tools below to manually recalculate these relationships.', 'bbpress' ); ?></p>
37
- <p class="description"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than 1 repair job at a time.', 'bbpress' ); ?></p>
38
 
39
- <form class="settings" method="post" action="">
40
- <table class="form-table">
41
- <tbody>
42
- <tr valign="top">
43
- <th scope="row"><?php esc_html_e( 'Relationships to Repair:', 'bbpress' ) ?></th>
44
- <td>
45
- <fieldset>
46
- <legend class="screen-reader-text"><span><?php esc_html_e( 'Repair', 'bbpress' ) ?></span></legend>
47
 
48
- <?php foreach ( bbp_admin_repair_list() as $item ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
- <label><input type="checkbox" class="checkbox" name="<?php echo esc_attr( $item[0] ) . '" id="' . esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="1" /> <?php echo esc_html( $item[1] ); ?></label><br />
51
 
52
- <?php endforeach; ?>
 
 
 
53
 
54
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  </td>
 
 
 
56
  </tr>
57
- </tbody>
58
  </table>
59
-
60
- <fieldset class="submit">
61
- <input class="button-primary" type="submit" name="submit" value="<?php esc_attr_e( 'Repair Items', 'bbpress' ); ?>" />
62
- <?php wp_nonce_field( 'bbpress-do-counts' ); ?>
63
- </fieldset>
 
 
 
 
 
64
  </form>
65
  </div>
66
 
@@ -70,7 +162,7 @@ function bbp_admin_repair() {
70
  /**
71
  * Handle the processing and feedback of the admin tools page
72
  *
73
- * @since bbPress (r2613)
74
  *
75
  * @uses bbp_admin_repair_list() To get the recount list
76
  * @uses check_admin_referer() To verify the nonce and the referer
@@ -79,33 +171,216 @@ function bbp_admin_repair() {
79
  */
80
  function bbp_admin_repair_handler() {
81
 
82
- if ( ! bbp_is_post_request() )
 
 
 
 
 
 
 
 
 
83
  return;
 
 
 
 
 
 
84
 
85
  check_admin_referer( 'bbpress-do-counts' );
86
 
87
  // Stores messages
88
  $messages = array();
89
 
 
90
  wp_cache_flush();
91
 
92
- foreach ( (array) bbp_admin_repair_list() as $item ) {
93
- if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === absint( $_POST[$item[0]] ) && is_callable( $item[2] ) ) {
94
- $messages[] = call_user_func( $item[2] );
 
 
 
 
 
 
95
  }
96
  }
97
 
 
98
  if ( count( $messages ) ) {
99
  foreach ( $messages as $message ) {
100
  bbp_admin_tools_feedback( $message[1] );
101
  }
102
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
 
105
  /**
106
  * Assemble the admin notices
107
  *
108
- * @since bbPress (r2613)
109
  *
110
  * @param string|WP_Error $message A message to be displayed or {@link WP_Error}
111
  * @param string $class Optional. A class to be added to the message div
@@ -114,16 +389,22 @@ function bbp_admin_repair_handler() {
114
  * @return string The message HTML
115
  */
116
  function bbp_admin_tools_feedback( $message, $class = false ) {
 
 
 
 
 
117
  if ( is_string( $message ) ) {
118
  $message = '<p>' . $message . '</p>';
119
- $class = $class ? $class : 'updated';
 
 
120
  } elseif ( is_wp_error( $message ) ) {
121
- $errors = $message->get_error_messages();
122
 
123
  switch ( count( $errors ) ) {
124
  case 0:
125
  return false;
126
- break;
127
 
128
  case 1:
129
  $message = '<p>' . $errors[0] . '</p>';
@@ -134,67 +415,661 @@ function bbp_admin_tools_feedback( $message, $class = false ) {
134
  break;
135
  }
136
 
137
- $class = $class ? $class : 'error';
138
  } else {
139
  return false;
140
  }
141
 
142
- $message = '<div id="message" class="' . esc_attr( $class ) . '">' . $message . '</div>';
 
143
  $message = str_replace( "'", "\'", $message );
144
- $lambda = create_function( '', "echo '$message';" );
145
 
 
 
146
  add_action( 'admin_notices', $lambda );
147
 
148
  return $lambda;
149
  }
150
 
151
- /**
152
- * Get the array of the repair list
153
- *
154
- * @since bbPress (r2613)
155
- *
156
- * @uses apply_filters() Calls 'bbp_repair_list' with the list array
157
- * @return array Repair list of options
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-sync-all-reply-positions', __( 'Recalculate the position of each reply', 'bbpress' ), 'bbp_admin_repair_reply_menu_order' ),
167
- 30 => array( 'bbp-group-forums', __( 'Repair BuddyPress Group Forum relationships', 'bbpress' ), 'bbp_admin_repair_group_forum_relationship' ),
168
- 35 => array( 'bbp-forum-topics', __( 'Count topics in each forum', 'bbpress' ), 'bbp_admin_repair_forum_topic_count' ),
169
- 40 => array( 'bbp-forum-replies', __( 'Count replies in each forum', 'bbpress' ), 'bbp_admin_repair_forum_reply_count' ),
170
- 45 => array( 'bbp-topic-replies', __( 'Count replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_reply_count' ),
171
- 50 => array( 'bbp-topic-voices', __( 'Count voices in each topic', 'bbpress' ), 'bbp_admin_repair_topic_voice_count' ),
172
- 55 => array( 'bbp-topic-hidden-replies', __( 'Count spammed & trashed replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_hidden_reply_count' ),
173
- 60 => array( 'bbp-user-topics', __( 'Count topics for each user', 'bbpress' ), 'bbp_admin_repair_user_topic_count' ),
174
- 65 => array( 'bbp-user-replies', __( 'Count replies for each user', 'bbpress' ), 'bbp_admin_repair_user_reply_count' ),
175
- 70 => array( 'bbp-user-favorites', __( 'Remove trashed topics from user favorites', 'bbpress' ), 'bbp_admin_repair_user_favorites' ),
176
- 75 => array( 'bbp-user-topic-subscriptions', __( 'Remove trashed topics from user subscriptions', 'bbpress' ), 'bbp_admin_repair_user_topic_subscriptions' ),
177
- 80 => array( 'bbp-user-forum-subscriptions', __( 'Remove trashed forums from user subscriptions', 'bbpress' ), 'bbp_admin_repair_user_forum_subscriptions' ),
178
- 85 => array( 'bbp-user-role-map', __( 'Remap existing users to default forum roles', 'bbpress' ), 'bbp_admin_repair_user_roles' )
179
- );
180
- ksort( $repair_list );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
- return (array) apply_filters( 'bbp_repair_list', $repair_list );
 
 
 
 
183
  }
184
 
185
  /**
186
  * Recount topic replies
187
  *
188
- * @since bbPress (r2613)
189
  *
190
- * @uses bbp_get_reply_post_type() To get the reply post type
191
  * @uses wpdb::query() To run our recount sql queries
192
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
 
 
 
 
193
  * @return array An array of the status code and the message
194
  */
195
  function bbp_admin_repair_topic_reply_count() {
196
- global $wpdb;
197
 
 
 
198
  $statement = __( 'Counting the number of replies in each topic&hellip; %s', 'bbpress' );
199
  $result = __( 'Failed!', 'bbpress' );
200
 
@@ -205,28 +1080,28 @@ function bbp_admin_repair_topic_reply_count() {
205
  $cps = bbp_get_closed_status_id();
206
 
207
  // Delete the meta key _bbp_reply_count for each topic
208
- $sql_delete = "DELETE `postmeta` FROM `{$wpdb->postmeta}` AS `postmeta`
209
- LEFT JOIN `{$wpdb->posts}` AS `posts` ON `posts`.`ID` = `postmeta`.`post_id`
210
  WHERE `posts`.`post_type` = '{$tpt}'
211
  AND `postmeta`.`meta_key` = '_bbp_reply_count'";
212
 
213
- if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) {
214
  return array( 1, sprintf( $statement, $result ) );
215
  }
216
 
217
  // Recalculate the meta key _bbp_reply_count for each topic
218
- $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (
219
  SELECT `topics`.`ID` AS `post_id`, '_bbp_reply_count' AS `meta_key`, COUNT(`replies`.`ID`) As `meta_value`
220
- FROM `{$wpdb->posts}` AS `topics`
221
- LEFT JOIN `{$wpdb->posts}` as `replies`
222
  ON `replies`.`post_parent` = `topics`.`ID`
223
  AND `replies`.`post_status` = '{$pps}'
224
  AND `replies`.`post_type` = '{$rpt}'
225
  WHERE `topics`.`post_type` = '{$tpt}'
226
  AND `topics`.`post_status` IN ( '{$pps}', '{$cps}' )
227
- GROUP BY `topics`.`ID`);";
228
 
229
- if ( is_wp_error( $wpdb->query( $sql ) ) ) {
230
  return array( 2, sprintf( $statement, $result ) );
231
  }
232
 
@@ -236,22 +1111,27 @@ function bbp_admin_repair_topic_reply_count() {
236
  /**
237
  * Recount topic voices
238
  *
239
- * @since bbPress (r2613)
240
  *
241
- * @uses bbp_get_reply_post_type() To get the reply post type
242
  * @uses wpdb::query() To run our recount sql queries
243
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
 
 
 
 
244
  * @return array An array of the status code and the message
245
  */
246
  function bbp_admin_repair_topic_voice_count() {
247
- global $wpdb;
248
 
 
 
249
  $statement = __( 'Counting the number of voices in each topic&hellip; %s', 'bbpress' );
250
  $result = __( 'Failed!', 'bbpress' );
251
 
252
- $sql_delete = "DELETE FROM `{$wpdb->postmeta}` WHERE `meta_key` = '_bbp_voice_count';";
253
- if ( is_wp_error( $wpdb->query( $sql_delete ) ) )
254
  return array( 1, sprintf( $statement, $result ) );
 
255
 
256
  // Post types and status
257
  $tpt = bbp_get_topic_post_type();
@@ -259,19 +1139,20 @@ function bbp_admin_repair_topic_voice_count() {
259
  $pps = bbp_get_public_status_id();
260
  $cps = bbp_get_closed_status_id();
261
 
262
- $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (
263
  SELECT `postmeta`.`meta_value`, '_bbp_voice_count', COUNT(DISTINCT `post_author`) as `meta_value`
264
- FROM `{$wpdb->posts}` AS `posts`
265
- LEFT JOIN `{$wpdb->postmeta}` AS `postmeta`
266
  ON `posts`.`ID` = `postmeta`.`post_id`
267
  AND `postmeta`.`meta_key` = '_bbp_topic_id'
268
  WHERE `posts`.`post_type` IN ( '{$tpt}', '{$rpt}' )
269
  AND `posts`.`post_status` IN ( '{$pps}', '{$cps}' )
270
  AND `posts`.`post_author` != '0'
271
- GROUP BY `postmeta`.`meta_value`);";
272
 
273
- if ( is_wp_error( $wpdb->query( $sql ) ) )
274
  return array( 2, sprintf( $statement, $result ) );
 
275
 
276
  return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
277
  }
@@ -279,25 +1160,38 @@ function bbp_admin_repair_topic_voice_count() {
279
  /**
280
  * Recount topic hidden replies (spammed/trashed)
281
  *
282
- * @since bbPress (r2747)
283
  *
284
  * @uses wpdb::query() To run our recount sql queries
285
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
 
 
 
 
286
  * @return array An array of the status code and the message
287
  */
288
  function bbp_admin_repair_topic_hidden_reply_count() {
289
- global $wpdb;
290
 
291
- $statement = __( 'Counting the number of spammed and trashed replies in each topic&hellip; %s', 'bbpress' );
 
 
292
  $result = __( 'Failed!', 'bbpress' );
293
 
294
- $sql_delete = "DELETE FROM `{$wpdb->postmeta}` WHERE `meta_key` = '_bbp_reply_count_hidden';";
295
- if ( is_wp_error( $wpdb->query( $sql_delete ) ) )
296
  return array( 1, sprintf( $statement, $result ) );
 
 
 
 
 
 
 
297
 
298
- $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);";
299
- if ( is_wp_error( $wpdb->query( $sql ) ) )
300
  return array( 2, sprintf( $statement, $result ) );
 
301
 
302
  return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
303
  }
@@ -305,64 +1199,67 @@ function bbp_admin_repair_topic_hidden_reply_count() {
305
  /**
306
  * Repair group forum ID mappings after a bbPress 1.1 to bbPress 2.2 conversion
307
  *
308
- * @since bbPress (r4395)
309
  *
310
- * @global WPDB $wpdb
311
  * @return If a wp_error() occurs and no converted forums are found
312
  */
313
  function bbp_admin_repair_group_forum_relationship() {
314
- global $wpdb;
315
 
 
 
316
  $statement = __( 'Repairing BuddyPress group-forum relationships&hellip; %s', 'bbpress' );
317
- $g_count = 0;
318
- $f_count = 0;
319
- $s_count = 0;
320
 
321
  // Copy the BuddyPress filter here, incase BuddyPress is not active
322
- $prefix = apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix );
323
  $groups_table = $prefix . 'bp_groups';
324
  $groups_meta_table = $prefix . 'bp_groups_groupmeta';
325
 
326
  // Get the converted forum IDs
327
- $forum_ids = $wpdb->query( "SELECT `forum`.`ID`, `forummeta`.`meta_value`
328
- FROM `{$wpdb->posts}` AS `forum`
329
- LEFT JOIN `{$wpdb->postmeta}` AS `forummeta`
330
  ON `forum`.`ID` = `forummeta`.`post_id`
331
  AND `forummeta`.`meta_key` = '_bbp_old_forum_id'
332
- WHERE `forum`.`post_type` = 'forum'
333
- GROUP BY `forum`.`ID`;" );
334
 
335
  // Bail if forum IDs returned an error
336
- if ( is_wp_error( $forum_ids ) || empty( $wpdb->last_result ) )
337
  return array( 2, sprintf( $statement, __( 'Failed!', 'bbpress' ) ) );
 
338
 
339
  // Stash the last results
340
- $results = $wpdb->last_result;
341
 
342
  // Update each group forum
343
  foreach ( $results as $group_forums ) {
344
 
345
  // Only update if is a converted forum
346
- if ( ! isset( $group_forums->meta_value ) )
347
  continue;
 
348
 
349
  // Attempt to update group meta
350
- $updated = $wpdb->query( "UPDATE `{$groups_meta_table}` SET `meta_value` = '{$group_forums->ID}' WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->meta_value}';" );
351
 
352
  // Bump the count
353
- if ( !empty( $updated ) && ! is_wp_error( $updated ) ) {
354
  ++$g_count;
355
  }
356
 
357
  // Update group to forum relationship data
358
- $group_id = (int) $wpdb->get_var( "SELECT `group_id` FROM `{$groups_meta_table}` WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->ID}';" );
359
- if ( !empty( $group_id ) ) {
360
 
361
  // Update the group to forum meta connection in forums
362
  update_post_meta( $group_forums->ID, '_bbp_group_ids', array( $group_id ) );
363
 
364
  // Get the group status
365
- $group_status = $wpdb->get_var( "SELECT `status` FROM `{$groups_table}` WHERE `id` = '{$group_id}';" );
366
 
367
  // Sync up forum visibility based on group status
368
  switch ( $group_status ) {
@@ -403,6 +1300,7 @@ function bbp_admin_repair_group_forum_relationship() {
403
  $posts = get_posts( array(
404
  'post_type' => bbp_get_forum_post_type(),
405
  'meta_key' => '_bbp_old_forum_id',
 
406
  'meta_value' => $old_default_forum_id,
407
  'numberposts' => 1
408
  ) );
@@ -438,7 +1336,7 @@ function bbp_admin_repair_group_forum_relationship() {
438
  /**
439
  * Recount forum topics
440
  *
441
- * @since bbPress (r2613)
442
  *
443
  * @uses wpdb::query() To run our recount sql queries
444
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
@@ -448,19 +1346,22 @@ function bbp_admin_repair_group_forum_relationship() {
448
  * @return array An array of the status code and the message
449
  */
450
  function bbp_admin_repair_forum_topic_count() {
451
- global $wpdb;
452
 
 
 
453
  $statement = __( 'Counting the number of topics in each forum&hellip; %s', 'bbpress' );
454
  $result = __( 'Failed!', 'bbpress' );
455
 
456
- $sql_delete = "DELETE FROM {$wpdb->postmeta} WHERE meta_key IN ( '_bbp_topic_count', '_bbp_total_topic_count' );";
457
- if ( is_wp_error( $wpdb->query( $sql_delete ) ) )
458
  return array( 1, sprintf( $statement, $result ) );
 
459
 
460
  $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
461
- if ( !empty( $forums ) ) {
462
  foreach ( $forums as $forum ) {
463
  bbp_update_forum_topic_count( $forum->ID );
 
464
  }
465
  } else {
466
  return array( 2, sprintf( $statement, $result ) );
@@ -472,7 +1373,7 @@ function bbp_admin_repair_forum_topic_count() {
472
  /**
473
  * Recount forum replies
474
  *
475
- * @since bbPress (r2613)
476
  *
477
  * @uses wpdb::query() To run our recount sql queries
478
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
@@ -482,8 +1383,9 @@ function bbp_admin_repair_forum_topic_count() {
482
  * @return array An array of the status code and the message
483
  */
484
  function bbp_admin
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
  /** Repair ********************************************************************/
14
 
15
  /**
16
  * Admin repair page
17
  *
18
+ * @since 2.0.0 bbPress (r2613) Converted from bbPress 1.2
19
+ * @since 2.6.0 bbPress (r5885) Upgraded to list-table UI
20
+ *
21
+ * @todo Use a real list table
22
  *
23
  * @uses bbp_admin_repair_list() To get the recount list
24
  * @uses check_admin_referer() To verify the nonce and the referer
25
  * @uses wp_cache_flush() To flush the cache
26
  * @uses do_action() Calls 'admin_notices' to display the notices
 
27
  * @uses wp_nonce_field() To add a hidden nonce field
28
  */
29
  function bbp_admin_repair() {
30
+
31
+ // Get the registered repair tools
32
+ $tools = bbp_admin_repair_list(); ?>
33
 
34
  <div class="wrap">
35
+ <h1><?php esc_html_e( 'Forum Tools', 'bbpress' ); ?></h1>
36
+ <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Repair Forums', 'bbpress' ) ); ?></h2>
37
 
38
+ <p><?php esc_html_e( 'bbPress keeps track of relationships between forums, topics, replies, topic-tags, favorites, subscriptions, and users. Occasionally these relationships become out of sync, most often after an import or migration. Use the tools below to manually recalculate these relationships.', 'bbpress' ); ?></p>
39
+ <p class="description"><?php esc_html_e( 'Some of these tools create substantial database overhead. Use caution when running more than 1 repair at a time.', 'bbpress' ); ?></p>
40
+
41
+ <?php bbp_admin_repair_tool_overhead_filters(); ?>
42
+
43
+ <form class="settings" method="get" action="">
44
+
45
+ <?php bbp_admin_repair_list_search_form(); ?>
46
+
47
+ <input type="hidden" name="page" value="bbp-repair" />
48
+ <?php wp_nonce_field( 'bbpress-do-counts' ); ?>
49
+
50
+ <div class="tablenav top">
51
+ <div class="alignleft actions bulkactions">
52
+ <label for="bulk-action-selector-top" class="screen-reader-text"><?php esc_html_e( 'Select bulk action', 'bbpress' ); ?></label>
53
+ <select name="action" id="bulk-action-selector-top">
54
+ <option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'bbpress' ); ?></option>
55
+ <option value="run" class="hide-if-no-js"><?php esc_html_e( 'Run', 'bbpress' ); ?></option>
56
+ </select>
57
+ <input type="submit" id="doaction" class="button action" value="<?php esc_attr_e( 'Apply', 'bbpress' ); ?>">
58
+ </div>
59
+ <div class="alignleft actions">
60
+
61
+ <?php bbp_admin_repair_list_components_filter(); ?>
62
+
63
+ </div>
64
+ <br class="clear">
65
+ </div>
66
+ <table class="wp-list-table widefat striped posts">
67
+ <thead>
68
+ <tr>
69
+ <td id="cb" class="manage-column column-cb check-column">
70
+ <label class="screen-reader-text" for="cb-select-all-1">
71
+ <?php esc_html_e( 'Select All', 'bbpress' ); ?>
72
+ </label>
73
+ <input id="cb-select-all-1" type="checkbox">
74
+ </td>
75
+ <th scope="col" id="description" class="manage-column column-primary column-description"><?php esc_html_e( 'Description', 'bbpress' ); ?></th>
76
+ <th scope="col" id="components" class="manage-column column-components"><?php esc_html_e( 'Components', 'bbpress' ); ?></th>
77
+ <th scope="col" id="overhead" class="manage-column column-overhead"><?php esc_html_e( 'Overhead', 'bbpress' ); ?></th>
78
+ </tr>
79
+ </thead>
80
 
81
+ <tbody id="the-list">
82
 
83
+ <?php if ( ! empty( $tools ) ) : ?>
 
84
 
85
+ <?php foreach ( $tools as $item ) : ?>
 
 
 
 
 
 
 
86
 
87
+ <tr id="bbp-repair-tools" class="inactive">
88
+ <th scope="row" class="check-column">
89
+ <label class="screen-reader-text" for="<?php echo esc_attr( str_replace( '_', '-', $item['id'] ) ); ?>"></label>
90
+ <input type="checkbox" name="checked[]" value="<?php echo esc_attr( $item['id'] ); ?>" id="<?php echo esc_attr( str_replace( '_', '-', $item['id'] ) ); ?>">
91
+ </th>
92
+ <td class="bbp-tool-title column-primary column-description" data-colname="<?php esc_html_e( 'Description', 'bbpress' ); ?>">
93
+ <strong><?php echo esc_html( $item['description'] ); ?></strong>
94
+ <div class="row-actions hide-if-no-js">
95
+ <span class="run">
96
+ <a href="<?php bbp_admin_repair_tool_run_url( $item['id'] ); ?>" aria-label="<?php printf( esc_html__( 'Run %s', 'bbpress' ), $item['description'] ); ?>" id="<?php echo esc_attr( $item['id'] ); ?>" ><?php esc_html_e( 'Run', 'bbpress' ); ?></a>
97
+ </span>
98
+ </div>
99
+ <button type="button" class="toggle-row">
100
+ <span class="screen-reader-text"><?php esc_html_e( 'Show more details', 'bbpress' ); ?></span>
101
+ </button>
102
+ </td>
103
+ <td class="column-components desc" data-colname="<?php esc_html_e( 'Components', 'bbpress' ); ?>">
104
+ <div class="bbp-tool-overhead">
105
 
106
+ <?php echo implode( ', ', bbp_get_admin_repair_tool_components( $item ) ); ?>
107
 
108
+ </div>
109
+ </td>
110
+ <td class="column-overhead desc" data-colname="<?php esc_html_e( 'Overhead', 'bbpress' ); ?>">
111
+ <div class="bbp-tool-overhead">
112
 
113
+ <?php echo implode( ', ', bbp_get_admin_repair_tool_overhead( $item ) ); ?>
114
+
115
+ </div>
116
+ </td>
117
+ </tr>
118
+
119
+ <?php endforeach; ?>
120
+
121
+ <?php else : ?>
122
+
123
+ <tr>
124
+ <td colspan="4">
125
+ <?php esc_html_e( 'No repair tools match this criteria.', 'bbpress' ); ?>
126
+ </td>
127
+ </tr>
128
+
129
+ <?php endif; ?>
130
+
131
+ </tbody>
132
+ <tfoot>
133
+ <tr>
134
+ <td class="manage-column column-cb check-column">
135
+ <label class="screen-reader-text" for="cb-select-all-2">
136
+ <?php esc_html_e( 'Select All', 'bbpress' ); ?>
137
+ </label>
138
+ <input id="cb-select-all-2" type="checkbox">
139
  </td>
140
+ <th scope="col" class="manage-column column-primary column-description"><?php esc_html_e( 'Description', 'bbpress' ); ?></th>
141
+ <th scope="col" class="manage-column column-components"><?php esc_html_e( 'Components', 'bbpress' ); ?></th>
142
+ <th scope="col" class="manage-column column-overhead"><?php esc_html_e( 'Overhead', 'bbpress' ); ?></th>
143
  </tr>
144
+ </tfoot>
145
  </table>
146
+ <div class="tablenav bottom">
147
+ <div class="alignleft actions bulkactions">
148
+ <label for="bulk-action-selector-bottom" class="screen-reader-text"><?php esc_html_e( 'Select bulk action', 'bbpress' ); ?></label>
149
+ <select name="action2" id="bulk-action-selector-bottom">
150
+ <option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'bbpress' ); ?></option>
151
+ <option value="run" class="hide-if-no-js"><?php esc_html_e( 'Run', 'bbpress' ); ?></option>
152
+ </select>
153
+ <input type="submit" id="doaction2" class="button action" value="<?php esc_attr_e( 'Apply', 'bbpress' ); ?>">
154
+ </div>
155
+ </div>
156
  </form>
157
  </div>
158
 
162
  /**
163
  * Handle the processing and feedback of the admin tools page
164
  *
165
+ * @since 2.0.0 bbPress (r2613)
166
  *
167
  * @uses bbp_admin_repair_list() To get the recount list
168
  * @uses check_admin_referer() To verify the nonce and the referer
171
  */
172
  function bbp_admin_repair_handler() {
173
 
174
+ if ( ! bbp_is_get_request() ) {
175
+ return;
176
+ }
177
+
178
+ // Get the current action or bail
179
+ if ( ! empty( $_GET['action'] ) ) {
180
+ $action = sanitize_key( $_GET['action'] );
181
+ } elseif ( ! empty( $_GET['action2'] ) ) {
182
+ $action = sanitize_key( $_GET['action2'] );
183
+ } else {
184
  return;
185
+ }
186
+
187
+ // Bail if not running an action
188
+ if ( 'run' !== $action ) {
189
+ return;
190
+ }
191
 
192
  check_admin_referer( 'bbpress-do-counts' );
193
 
194
  // Stores messages
195
  $messages = array();
196
 
197
+ // Kill all the caches, because we don't know what's where anymore
198
  wp_cache_flush();
199
 
200
+ // Get the list
201
+ $list = bbp_get_admin_repair_tools();
202
+
203
+ // Run through checked repair tools
204
+ if ( ! empty( $_GET['checked'] ) ) {
205
+ foreach ( $_GET['checked'] as $item_id ) {
206
+ if ( isset( $list[ $item_id ] ) && is_callable( $list[ $item_id ]['callback'] ) ) {
207
+ $messages[] = call_user_func( $list[ $item_id ]['callback'] );
208
+ }
209
  }
210
  }
211
 
212
+ // Feedback
213
  if ( count( $messages ) ) {
214
  foreach ( $messages as $message ) {
215
  bbp_admin_tools_feedback( $message[1] );
216
  }
217
  }
218
+
219
+ // @todo Redirect away from here
220
+ }
221
+
222
+ /**
223
+ * Output the URL to run a specific repair tool
224
+ *
225
+ * @since 2.6.0 bbPress (r5885)
226
+ *
227
+ * @param string $component
228
+ */
229
+ function bbp_admin_repair_tool_run_url( $component = '' ) {
230
+ echo esc_url( bbp_get_admin_repair_tool_run_url( $component ) );
231
+ }
232
+
233
+ /**
234
+ * Return the URL to run a specific repair tool
235
+ *
236
+ * @since 2.6.0 bbPress (r5885)
237
+ *
238
+ * @param string $component
239
+ */
240
+ function bbp_get_admin_repair_tool_run_url( $component = '' ) {
241
+ $tools = admin_url( 'tools.php' );
242
+ $args = array( 'page' => 'bbp-repair', 'action' => 'run', 'checked' => array( $component ) );
243
+ $url = add_query_arg( $args, $tools );
244
+ $nonced = wp_nonce_url( $url, 'bbpress-do-counts' );
245
+
246
+ return apply_filters( 'bbp_get_admin_repair_tool_run_url', $nonced, $component );
247
+ }
248
+
249
+ /**
250
+ * Contextual help for Repair Forums tools page
251
+ *
252
+ * @since 2.6.0 bbPress (r5314)
253
+ *
254
+ * @uses get_current_screen()
255
+ */
256
+
257
+ function bbp_admin_tools_repair_help() {
258
+
259
+ $current_screen = get_current_screen();
260
+
261
+ // Bail if current screen could not be found
262
+ if ( empty( $current_screen ) ) {
263
+ return;
264
+ }
265
+
266
+ // Repair Forums
267
+ $current_screen->add_help_tab( array(
268
+ 'id' => 'repair_forums',
269
+ 'title' => __( 'Repair Forums', 'bbpress' ),
270
+ 'content' => '<p>' . __( 'There is more detailed information available on the bbPress and BuddyPress codex for the following:', 'bbpress' ) . '</p>' .
271
+ '<p>' .
272
+ '<ul>' .
273
+ '<li>' . __( 'BuddyPress Group Forums: <a href="https://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/">Installing Group and Sitewide Forums</a> and <a href="https://codex.buddypress.org/getting-started/guides/migrating-from-old-forums-to-bbpress-2/">Migrating from old forums to bbPress 2.2+</a>.', 'bbpress' ) . '</li>' .
274
+ '<li>' . __( 'bbPress roles: <a href="https://codex.bbpress.org/bbpress-user-roles-and-capabilities/" target="_blank">bbPress User Roles and Capabilities</a>', 'bbpress' ) . '</li>' .
275
+ '</ul>' .
276
+ '</p>' .
277
+ '<p>' . __( 'Also see <a href="https://codex.bbpress.org/repair-forums/">bbPress: Repair Forums</a>.', 'bbpress' ) . '</p>'
278
+ ) );
279
+
280
+ // Help Sidebar
281
+ $current_screen->set_help_sidebar(
282
+ '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
283
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
284
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
285
+ );
286
+ }
287
+
288
+ /**
289
+ * Contextual help for Reset Forums tools page
290
+ *
291
+ * @since 2.6.0 bbPress (r5314)
292
+ *
293
+ * @uses get_current_screen()
294
+ */
295
+
296
+ function bbp_admin_tools_reset_help() {
297
+
298
+ $current_screen = get_current_screen();
299
+
300
+ // Bail if current screen could not be found
301
+ if ( empty( $current_screen ) ) {
302
+ return;
303
+ }
304
+
305
+ // Reset Forums
306
+ $current_screen->add_help_tab( array(
307
+ 'id' => 'reset_forums',
308
+ 'title' => __( 'Reset Forums', 'bbpress' ),
309
+ 'content' => '<p>' . __( 'Also see <a href="https://codex.bbpress.org/reset-forums/">bbPress: Reset Forums</a>.', 'bbpress' ) . '</p>'
310
+ ) );
311
+
312
+ // Help Sidebar
313
+ $current_screen->set_help_sidebar(
314
+ '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
315
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
316
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
317
+ );
318
+ }
319
+
320
+ /**
321
+ * Contextual help for Import Forums tools page
322
+ *
323
+ * @since 2.6.0 bbPress (r5314)
324
+ *
325
+ * @uses get_current_screen()
326
+ */
327
+
328
+ function bbp_admin_tools_converter_help() {
329
+
330
+ $current_screen = get_current_screen();
331
+
332
+ // Bail if current screen could not be found
333
+ if ( empty( $current_screen ) ) {
334
+ return;
335
+ }
336
+
337
+ // Overview
338
+ $current_screen->add_help_tab( array(
339
+ 'id' => 'overview',
340
+ 'title' => __( 'Overview', 'bbpress' ),
341
+ 'content' => '<p>' . __( 'This screen provides access to all of the bbPress Import Forums settings and resources.', 'bbpress' ) . '</p>' .
342
+ '<p>' . __( 'Please see the additional help tabs for more information on each individual section.', 'bbpress' ) . '</p>' .
343
+ '<p>' . __( 'Also see the main article on the bbPress codex <a href="https://codex.bbpress.org/import-forums/">bbPress: Import Forums</a>.', 'bbpress' ) . '</p>'
344
+ ) );
345
+
346
+ // Database Settings
347
+ $current_screen->add_help_tab( array(
348
+ 'id' => 'database_settings',
349
+ 'title' => __( 'Database Settings', 'bbpress' ),
350
+ 'content' => '<p>' . __( 'In the Database Settings you have a number of options:', 'bbpress' ) . '</p>' .
351
+ '<p>' .
352
+ '<ul>' .
353
+ '<li>' . __( 'The settings in this section refer to the database connection strings used by your old forum software. The best way to determine the exact settings you need is to copy them from your legacy forums configuration file or contact your web hosting provider.', 'bbpress' ) . '</li>' .
354
+ '</ul>' .
355
+ '</p>'
356
+ ) );
357
+
358
+ // Importer Options
359
+ $current_screen->add_help_tab( array(
360
+ 'id' => 'importer_options',
361
+ 'title' => __( 'Importer Options', 'bbpress' ),
362
+ 'content' => '<p>' . __( 'In the Options you have a number of options:', 'bbpress' ) . '</p>' .
363
+ '<p>' .
364
+ '<ul>' .
365
+ '<li>' . __( 'Depending on your MySQL configuration you can tweak the "Rows Limit" and "Delay Time" that may help to improve the overall time it takes to perform a complete forum import.', 'bbpress' ) . '</li>' .
366
+ '<li>' . __( '"Convert Users" will import your legacy forum members as WordPress Users.', 'bbpress' ) . '</li>' .
367
+ '<li>' . __( '"Start Over" will start the importer fresh, if your import failed for any reason leaving this setting unchecked the importer will begin from where it left off.', 'bbpress' ) . '</li>' .
368
+ '<li>' . __( '"Purge Previous Import" will remove data imported from a failed import without removing your existing forum data.', 'bbpress' ) . '</li>' .
369
+ '</ul>' .
370
+ '</p>'
371
+ ) );
372
+ // Help Sidebar
373
+ $current_screen->set_help_sidebar(
374
+ '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
375
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
376
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
377
+ );
378
  }
379
 
380
  /**
381
  * Assemble the admin notices
382
  *
383
+ * @since 2.0.0 bbPress (r2613)
384
  *
385
  * @param string|WP_Error $message A message to be displayed or {@link WP_Error}
386
  * @param string $class Optional. A class to be added to the message div
389
  * @return string The message HTML
390
  */
391
  function bbp_admin_tools_feedback( $message, $class = false ) {
392
+
393
+ // Dismiss button
394
+ $dismiss = '<button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss this notice.', 'bbpress' ) . '</span></button>';
395
+
396
+ // One message as string
397
  if ( is_string( $message ) ) {
398
  $message = '<p>' . $message . '</p>';
399
+ $class = $class ? $class : 'updated';
400
+
401
+ // Messages as objects
402
  } elseif ( is_wp_error( $message ) ) {
403
+ $errors = $message->get_error_messages();
404
 
405
  switch ( count( $errors ) ) {
406
  case 0:
407
  return false;
 
408
 
409
  case 1:
410
  $message = '<p>' . $errors[0] . '</p>';
415
  break;
416
  }
417
 
418
+ $class = $class ? $class : 'is-error';
419
  } else {
420
  return false;
421
  }
422
 
423
+ // Assemble the message
424
+ $message = '<div id="message" class="is-dismissible notice ' . esc_attr( $class ) . '">' . $message . $dismiss . '</div>';
425
  $message = str_replace( "'", "\'", $message );
 
426
 
427
+ // Ugh
428
+ $lambda = create_function( '', "echo '$message';" );
429
  add_action( 'admin_notices', $lambda );
430
 
431
  return $lambda;
432
  }
433
 
434
+ /**
435
+ * Register an admin area repair tool
436
+ *
437
+ * @since 2.6.0 bbPress (r5885)
438
+ *
439
+ * @param array $args
440
+ * @return
441
+ */
442
+ function bbp_register_repair_tool( $args = array() ) {
443
+
444
+ // Parse arguments
445
+ $r = bbp_parse_args( $args, array(
446
+ 'id' => '',
447
+ 'description' => '',
448
+ 'callback' => '',
449
+ 'priority' => 0,
450
+ 'overhead' => 'low',
451
+ 'components' => array(),
452
+
453
+ // @todo
454
+ 'success' => esc_html__( 'The repair was completed successfully', 'bbpress' ),
455
+ 'failure' => esc_html__( 'The repair was not successful', 'bbpress' )
456
+ ), 'register_repair_tool' );
457
+
458
+ // Bail if missing required values
459
+ if ( empty( $r['id'] ) || empty( $r['priority'] ) || empty( $r['description'] ) || empty( $r['callback'] ) ) {
460
+ return;
461
+ }
462
+
463
+ // Add tool to the registered tools array
464
+ bbpress()->admin->tools[ $r['id'] ] = array(
465
+ 'description' => $r['description'],
466
+ 'priority' => $r['priority'],
467
+ 'callback' => $r['callback'],
468
+ 'overhead' => $r['overhead'],
469
+ 'components' => $r['components'],
470
+
471
+ // @todo
472
+ 'success' => $r['success'],
473
+ 'failure' => $r['failure'],
474
+ );
475
+ }
476
+
477
+ /**
478
+ * Register the default repair tools
479
+ *
480
+ * @since 2.6.0 bbPress (r5885)
481
+ */
482
+ function bbp_register_default_repair_tools() {
483
+
484
+ // Topic meta
485
+ bbp_register_repair_tool( array(
486
+ 'id' => 'bbp-sync-topic-meta',
487
+ 'description' => __( 'Recalculate parent topic for each reply', 'bbpress' ),
488
+ 'callback' => 'bbp_admin_repair_topic_meta',
489
+ 'priority' => 5,
490
+ 'overhead' => 'low',
491
+ 'components' => array( bbp_get_reply_post_type() )
492
+ ) );
493
+
494
+ // Forum meta
495
+ bbp_register_repair_tool( array(
496
+ 'id' => 'bbp-sync-forum-meta',
497
+ 'description' => __( 'Recalculate parent forum for each topic and reply', 'bbpress' ),
498
+ 'callback' => 'bbp_admin_repair_forum_meta',
499
+ 'priority' => 10,
500
+ 'overhead' => 'low',
501
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() )
502
+ ) );
503
+
504
+ // Forum visibility
505
+ bbp_register_repair_tool( array(
506
+ 'id' => 'bbp-sync-forum-visibility',
507
+ 'description' => __( 'Recalculate private and hidden forums', 'bbpress' ),
508
+ 'callback' => 'bbp_admin_repair_forum_visibility',
509
+ 'priority' => 15,
510
+ 'overhead' => 'low',
511
+ 'components' => array( bbp_get_forum_post_type() )
512
+ ) );
513
+
514
+ // Sync all topics in all forums
515
+ bbp_register_repair_tool( array(
516
+ 'id' => 'bbp-sync-all-topics-forums',
517
+ 'description' => __( 'Recalculate last activity in each topic and forum', 'bbpress' ),
518
+ 'callback' => 'bbp_admin_repair_freshness',
519
+ 'priority' => 20,
520
+ 'overhead' => 'high',
521
+ 'components' => array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() )
522
+ ) );
523
+
524
+ // Sync all sticky topics in all forums
525
+ bbp_register_repair_tool( array(
526
+ 'id' => 'bbp-sync-all-topics-sticky',
527
+ 'description' => __( 'Recalculate sticky relationship of each topic', 'bbpress' ),
528
+ 'callback' => 'bbp_admin_repair_sticky',
529
+ 'priority' => 25,
530
+ 'overhead' => 'low',
531
+ 'components' => array( bbp_get_topic_post_type() )
532
+ ) );
533
+
534
+ // Sync all hierarchical reply positions
535
+ bbp_register_repair_tool( array(
536
+ 'id' => 'bbp-sync-all-reply-positions',
537
+ 'description' => __( 'Recalculate the position of each reply', 'bbpress' ),
538
+ 'callback' => 'bbp_admin_repair_reply_menu_order',
539
+ 'priority' => 30,
540
+ 'overhead' => 'high',
541
+ 'components' => array( bbp_get_reply_post_type() )
542
+ ) );
543
+
544
+ // Sync all BuddyPress group forum relationships
545
+ bbp_register_repair_tool( array(
546
+ 'id' => 'bbp-group-forums',
547
+ 'description' => __( 'Repair BuddyPress Group Forum relationships', 'bbpress' ),
548
+ 'callback' => 'bbp_admin_repair_group_forum_relationship',
549
+ 'priority' => 35,
550
+ 'overhead' => 'low',
551
+ 'components' => array( bbp_get_forum_post_type() )
552
+ ) );
553
+
554
+ // Update closed topic counts
555
+ bbp_register_repair_tool( array(
556
+ 'id' => 'bbp-sync-closed-topics',
557
+ 'description' => __( 'Repair closed topics', 'bbpress' ),
558
+ 'callback' => 'bbp_admin_repair_closed_topics',
559
+ 'priority' => 40,
560
+ 'overhead' => 'medium',
561
+ 'components' => array( bbp_get_topic_post_type() )
562
+ ) );
563
+
564
+ // Count topics
565
+ bbp_register_repair_tool( array(
566
+ 'id' => 'bbp-forum-topics',
567
+ 'description' => __( 'Count topics in each forum', 'bbpress' ),
568
+ 'callback' => 'bbp_admin_repair_forum_topic_count',
569
+ 'priority' => 45,
570
+ 'overhead' => 'medium',
571
+ 'components' => array( bbp_get_forum_post_type(), bbp_get_topic_post_type() )
572
+ ) );
573
+
574
+ // Count forum replies
575
+ bbp_register_repair_tool( array(
576
+ 'id' => 'bbp-forum-replies',
577
+ 'description' => __( 'Count replies in each forum', 'bbpress' ),
578
+ 'callback' => 'bbp_admin_repair_forum_reply_count',
579
+ 'priority' => 50,
580
+ 'overhead' => 'high',
581
+ 'components' => array( bbp_get_forum_post_type(), bbp_get_reply_post_type() )
582
+ ) );
583
+
584
+ // Count topic replies
585
+ bbp_register_repair_tool( array(
586
+ 'id' => 'bbp-topic-replies',
587
+ 'description' => __( 'Count replies in each topic', 'bbpress' ),
588
+ 'callback' => 'bbp_admin_repair_topic_reply_count',
589
+ 'priority' => 55,
590
+ 'overhead' => 'high',
591
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() )
592
+ ) );
593
+
594
+ // Count topic voices
595
+ bbp_register_repair_tool( array(
596
+ 'id' => 'bbp-topic-voices',
597
+ 'description' => __( 'Count voices in each topic', 'bbpress' ),
598
+ 'callback' => 'bbp_admin_repair_topic_voice_count',
599
+ 'priority' => 60,
600
+ 'overhead' => 'medium',
601
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
602
+ ) );
603
+
604
+ // Count non-published replies to each topic
605
+ bbp_register_repair_tool( array(
606
+ 'id' => 'bbp-topic-hidden-replies',
607
+ 'description' => __( 'Count pending, spammed, & trashed replies in each topic', 'bbpress' ),
608
+ 'callback' => 'bbp_admin_repair_topic_hidden_reply_count',
609
+ 'priority' => 65,
610
+ 'overhead' => 'high',
611
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() )
612
+ ) );
613
+
614
+ // Recount topics for each user
615
+ bbp_register_repair_tool( array(
616
+ 'id' => 'bbp-user-topics',
617
+ 'description' => __( 'Recount topics for each user', 'bbpress' ),
618
+ 'callback' => 'bbp_admin_repair_user_topic_count',
619
+ 'priority' => 70,
620
+ 'overhead' => 'medium',
621
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
622
+ ) );
623
+
624
+ // Recount topics for each user
625
+ bbp_register_repair_tool( array(
626
+ 'id' => 'bbp-user-replies',
627
+ 'description' => __( 'Recount replies for each user', 'bbpress' ),
628
+ 'callback' => 'bbp_admin_repair_user_reply_count',
629
+ 'priority' => 75,
630
+ 'overhead' => 'medium',
631
+ 'components' => array( bbp_get_reply_post_type(), bbp_get_user_rewrite_id() )
632
+ ) );
633
+
634
+ // Remove unpublished topics from user favorites
635
+ bbp_register_repair_tool( array(
636
+ 'id' => 'bbp-user-favorites',
637
+ 'description' => __( 'Remove unpublished topics from user favorites', 'bbpress' ),
638
+ 'callback' => 'bbp_admin_repair_user_favorites',
639
+ 'priority' => 80,
640
+ 'overhead' => 'medium',
641
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
642
+ ) );
643
+
644
+ // Remove unpublished topics from user subscriptions
645
+ bbp_register_repair_tool( array(
646
+ 'id' => 'bbp-user-topic-subscriptions',
647
+ 'description' => __( 'Remove unpublished topics from user subscriptions', 'bbpress' ),
648
+ 'callback' => 'bbp_admin_repair_user_topic_subscriptions',
649
+ 'priority' => 85,
650
+ 'overhead' => 'medium',
651
+ 'components' => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
652
+ ) );
653
+
654
+ // Remove unpublished forums from user subscriptions
655
+ bbp_register_repair_tool( array(
656
+ 'id' => 'bbp-user-forum-subscriptions',
657
+ 'description' => __( 'Remove unpublished forums from user subscriptions', 'bbpress' ),
658
+ 'callback' => 'bbp_admin_repair_user_forum_subscriptions',
659
+ 'priority' => 90,
660
+ 'overhead' => 'medium',
661
+ 'components' => array( bbp_get_forum_post_type(), bbp_get_user_rewrite_id() )
662
+ ) );
663
+
664
+ // Remove unpublished forums from user subscriptions
665
+ bbp_register_repair_tool( array(
666
+ 'id' => 'bbp-user-role-map',
667
+ 'description' => __( 'Remap existing users to default forum roles', 'bbpress' ),
668
+ 'callback' => 'bbp_admin_repair_user_roles',
669
+ 'priority' => 95,
670
+ 'overhead' => 'low',
671
+ 'components' => array( bbp_get_user_rewrite_id() )
672
+ ) );
673
+
674
+ // Migrate favorites from user-meta to post-meta
675
+ bbp_register_repair_tool( array(
676
+ 'id' => 'bbp-user-favorites-move',
677
+ 'description' => __( 'Upgrade user favorites', 'bbpress' ),
678
+ 'callback' => 'bbp_admin_upgrade_user_favorites',
679
+ 'priority' => 100,
680
+ 'overhead' => 'high',
681
+ 'components' => array( bbp_get_user_rewrite_id() )
682
+ ) );
683
+
684
+ // Migrate topic subscriptions from user-meta to post-meta
685
+ bbp_register_repair_tool( array(
686
+ 'id' => 'bbp-user-topic-subscriptions-move',
687
+ 'description' => __( 'Upgrade user topic subscriptions', 'bbpress' ),
688
+ 'callback' => 'bbp_admin_upgrade_user_topic_subscriptions',
689
+ 'priority' => 105,
690
+ 'overhead' => 'high',
691
+ 'components' => array( bbp_get_user_rewrite_id() )
692
+ ) );
693
+
694
+ // Migrate forum subscriptions from user-meta to post-meta
695
+ bbp_register_repair_tool( array(
696
+ 'id' => 'bbp-user-forum-subscriptions-move',
697
+ 'description' => __( 'Upgrade user forum subscriptions', 'bbpress' ),
698
+ 'callback' => 'bbp_admin_upgrade_user_forum_subscriptions',
699
+ 'priority' => 110,
700
+ 'overhead' => 'high',
701
+ 'components' => array( bbp_get_user_rewrite_id() )
702
+ ) );
703
+ }
704
+
705
+ /**
706
+ * Get the array of available repair tools
707
+ *
708
+ * @since 2.6.0 bbPress (r5885)
709
+ *
710
+ * @return array
711
+ */
712
+ function bbp_get_admin_repair_tools() {
713
+
714
+ // Get tools array
715
+ $tools = ! empty( bbpress()->admin->tools )
716
+ ? bbpress()->admin->tools
717
+ : array();
718
+
719
+ return apply_filters( 'bbp_get_admin_repair_tools', $tools );
720
+ }
721
+
722
+ function bbp_get_admin_repair_tool_registered_components() {
723
+ $tools = bbp_get_admin_repair_tools();
724
+ $plucked = wp_list_pluck( $tools, 'components' );
725
+ $retval = array();
726
+
727
+ foreach ( $plucked as $components ) {
728
+ foreach ( $components as $component ) {
729
+ if ( in_array( $component, $retval ) ) {
730
+ continue;
731
+ }
732
+ $retval[] = $component;
733
+ }
734
+ }
735
+
736
+ return apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval );
737
+ }
738
+
739
+ /**
740
+ * Output the repair list search form
741
+ *
742
+ * @since 2.6.0 bbPress (r5885)
743
+ */
744
+ function bbp_admin_repair_list_search_form() {
745
+ ?>
746
+
747
+ <p class="search-box">
748
+ <label class="screen-reader-text" for="bbp-repair-search-input"><?php esc_html_e( 'Search Tools:', 'bbpress' ); ?></label>
749
+ <input type="search" id="bbp-repair-search-input" name="s" value="<?php _admin_search_query(); ?>">
750
+ <input type="submit" id="search-submit" class="button" value="<?php esc_html_e( 'Search Tools', 'bbpress' ); ?>">
751
+ </p>
752
+
753
+ <?php
754
+ }
755
+
756
+ /**
757
+ * Output a select drop-down of components to filter by
758
+ *
759
+ * @since 2.5.0 bbPress (r5885)
760
+ */
761
+ function bbp_admin_repair_list_components_filter() {
762
+
763
+ // Sanitize component value, if exists
764
+ $selected = ! empty( $_GET['components'] )
765
+ ? sanitize_key( $_GET['components'] )
766
+ : '';
767
+
768
+ // Get registered components
769
+ $components = bbp_get_admin_repair_tool_registered_components(); ?>
770
+
771
+ <label class="screen-reader-text" for="cat"><?php esc_html_e( 'Filter by Component', 'bbpress' ); ?></label>
772
+ <select name="components" id="components" class="postform">
773
+ <option value="" <?php selected( $selected, false ); ?>><?php esc_html_e( 'All Components', 'bbpress' ); ?></option>
774
+
775
+ <?php foreach ( $components as $component ) : ?>
776
+
777
+ <option class="level-0" value="<?php echo esc_attr( $component ); ?>" <?php selected( $selected, $component ); ?>><?php echo esc_html( bbp_admin_repair_tool_translate_component( $component ) ); ?></option>
778
+
779
+ <?php endforeach; ?>
780
+
781
+ </select>
782
+ <input type="submit" name="filter_action" id="components-submit" class="button" value="<?php esc_html_e( 'Filter', 'bbpress' ); ?>">
783
+
784
+ <?php
785
+ }
786
+
787
+ /**
788
+ * Maybe translate a repair tool overhead name
789
+ *
790
+ * @since 2.6.0 bbPress (r6177)
791
+ *
792
+ * @param string $overhead
793
+ * @return string
794
+ */
795
+ function bbp_admin_repair_tool_translate_overhead( $overhead = '' ) {
796
+
797
+ // Get the name of the component
798
+ switch ( $overhead ) {
799
+ case 'low' :
800
+ $name = esc_html__( 'Low', 'bbpress' );
801
+ break;
802
+ case 'medium' :
803
+ $name = esc_html__( 'Medium', 'bbpress' );
804
+ break;
805
+ case 'high' :
806
+ $name = esc_html__( 'High', 'bbpress' );
807
+ break;
808
+ default :
809
+ $name = ucwords( $overhead );
810
+ break;
811
+ }
812
+
813
+ return $name;
814
+ }
815
+
816
+ /**
817
+ * Maybe translate a repair tool component name
818
+ *
819
+ * @since 2.6.0 bbPress (r5885)
820
+ *
821
+ * @param string $component
822
+ * @return string
823
+ */
824
+ function bbp_admin_repair_tool_translate_component( $component = '' ) {
825
+
826
+ // Get the name of the component
827
+ switch ( $component ) {
828
+ case 'bbp_user' :
829
+ $name = esc_html__( 'Users', 'bbpress' );
830
+ break;
831
+ case bbp_get_forum_post_type() :
832
+ $name = esc_html__( 'Forums', 'bbpress' );
833
+ break;
834
+ case bbp_get_topic_post_type() :
835
+ $name = esc_html__( 'Topics', 'bbpress' );
836
+ break;
837
+ case bbp_get_reply_post_type() :
838
+ $name = esc_html__( 'Replies', 'bbpress' );
839
+ break;
840
+ default :
841
+ $name = ucwords( $component );
842
+ break;
843
+ }
844
+
845
+ return $name;
846
+ }
847
+
848
+ /**
849
+ * Get the array of the repair list
850
+ *
851
+ * @since 2.0.0 bbPress (r2613)
852
+ *
853
+ * @uses apply_filters() Calls 'bbp_repair_list' with the list array
854
+ * @return array Repair list of options
855
+ */
856
+ function bbp_admin_repair_list() {
857
+
858
+ // Define empty array
859
+ $repair_list = array();
860
+
861
+ // Get the available tools
862
+ $list = bbp_get_admin_repair_tools();
863
+ $search = ! empty( $_GET['s'] ) ? stripslashes( $_GET['s'] ) : '';
864
+ $overhead = ! empty( $_GET['overhead'] ) ? sanitize_key( $_GET['overhead'] ) : '';
865
+ $component = ! empty( $_GET['components'] ) ? sanitize_key( $_GET['components'] ) : '';
866
+
867
+ // Overhead filter
868
+ if ( ! empty( $overhead ) ) {
869
+ $list = wp_list_filter( $list, array( 'overhead' => $overhead ) );
870
+ }
871
+
872
+ // Loop through and key by priority for sorting
873
+ foreach ( $list as $id => $tool ) {
874
+
875
+ // Component filter
876
+ if ( ! empty( $component ) ) {
877
+ if ( ! in_array( $component, $tool['components'] ) ) {
878
+ continue;
879
+ }
880
+ }
881
+
882
+ // Search
883
+ if ( ! empty( $search ) ) {
884
+ if ( ! strstr( strtolower( $tool['description'] ), strtolower( $search ) ) ) {
885
+ continue;
886
+ }
887
+ }
888
+
889
+ // Add to repair list
890
+ $repair_list[ $tool['priority'] ] = array(
891
+ 'id' => sanitize_key( $id ),
892
+ 'description' => $tool['description'],
893
+ 'callback' => $tool['callback'],
894
+ 'overhead' => $tool['overhead'],
895
+ 'components' => $tool['components'],
896
+ );
897
+ }
898
+
899
+ // Sort
900
+ ksort( $repair_list );
901
+
902
+ return (array) apply_filters( 'bbp_repair_list', $repair_list );
903
+ }
904
+
905
+ /**
906
+ * Get filter links for components for a specific admin repair tool
907
+ *
908
+ * @since 2.6.0 bbPress (r5885)
909
+ *
910
+ * @param array $item
911
+ * @return array
912
+ */
913
+ function bbp_get_admin_repair_tool_components( $item = array() ) {
914
+
915
+ // Get the tools URL
916
+ $tools_url = add_query_arg( array( 'page' => 'bbp-repair' ), admin_url( 'tools.php' ) );
917
+
918
+ // Define links array
919
+ $links = array();
920
+
921
+ // Loop through tool components and build links
922
+ foreach ( $item['components'] as $component ) {
923
+ $args = array( 'components' => $component );
924
+ $filter_url = add_query_arg( $args, $tools_url );
925
+ $name = bbp_admin_repair_tool_translate_component( $component );
926
+ $links[] = '<a href="' . esc_url( $filter_url ) . '">' . esc_html( $name ) . '</a>';
927
+ }
928
+
929
+ // Filter & return
930
+ return apply_filters( 'bbp_get_admin_repair_tool_components', $links, $item );
931
+ }
932
+
933
+ /**
934
+ * Output filter links for components for a specific admin repair tool
935
+ *
936
+ * @since 2.6.0 bbPress (r5885)
937
+ *
938
+ * @param type array
939
+ */
940
+ function bbp_admin_repair_tool_overhead_filters( $args = array() ) {
941
+ echo bbp_get_admin_repair_tool_overhead_filters( $args );
942
+ }
943
+
944
+ /**
945
+ * Get filter links for overhead for a specific admin repair tool
946
+ *
947
+ * @since 2.6.0 bbPress (r5885)
948
+ *
949
+ * @param array $item
950
+ * @return array
951
+ */
952
+ function bbp_get_admin_repair_tool_overhead( $item = array() ) {
953
+
954
+ // Get the tools URL
955
+ $tools_url = add_query_arg( array( 'page' => 'bbp-repair' ), admin_url( 'tools.php' ) );
956
+
957
+ // Define links array
958
+ $links = array();
959
+ $overheads = array( $item['overhead'] );
960
+
961
+ // Loop through tool overhead and build links
962
+ foreach ( $overheads as $overhead ) {
963
+ $args = array( 'overhead' => $overhead );
964
+ $filter_url = add_query_arg( $args, $tools_url );
965
+ $name = bbp_admin_repair_tool_translate_overhead( $overhead );
966
+ $links[] = '<a href="' . esc_url( $filter_url ) . '">' . esc_html( $name ) . '</a>';
967
+ }
968
+
969
+ // Filter & return
970
+ return apply_filters( 'bbp_get_admin_repair_tool_overhead', $links, $item );
971
+ }
972
+
973
+ /**
974
+ * Get filter links for components for a specific admin repair tool
975
+ *
976
+ * @since 2.6.0 bbPress (r5885)
977
+ *
978
+ * @param array $args
979
+ * @return array
980
+ */
981
+ function bbp_get_admin_repair_tool_overhead_filters( $args = array() ) {
982
+
983
+ // Parse args
984
+ $r = bbp_parse_args( $args, array(
985
+ 'before' => '<ul class="subsubsub">',
986
+ 'after' => '</ul>',
987
+ 'link_before' => '<li>',
988
+ 'link_after' => '</li>',
989
+ 'count_before' => ' <span class="count">(',
990
+ 'count_after' => ')</span>',
991
+ 'separator' => ' | ',
992
+ ), 'get_admin_repair_tool_overhead_filters' );
993
+
994
+ // Count the tools
995
+ $tools = bbp_get_admin_repair_tools();
996
+
997
+ // Get the tools URL
998
+ $tools_url = add_query_arg( array( 'page' => 'bbp-repair' ), admin_url( 'tools.php' ) );
999
+
1000
+ // Define arrays
1001
+ $overheads = array();
1002
+
1003
+ // Loop through tools and count overheads
1004
+ foreach ( $tools as $id => $tool ) {
1005
+
1006
+ // Get the overhead level
1007
+ $overhead = $tool['overhead'];
1008
+
1009
+ // Set an empty count
1010
+ if ( empty( $overheads[ $overhead ] ) ) {
1011
+ $overheads[ $overhead ] = 0;
1012
+ }
1013
+
1014
+ // Bump the overhead count
1015
+ $overheads[ $overhead ]++;
1016
+ }
1017
+
1018
+ // Create the "All" link
1019
+ $current = empty( $_GET['overhead'] ) ? 'current' : '';
1020
+ $output = $r['link_before']. '<a href="' . esc_url( $tools_url ) . '" class="' . esc_attr( $current ) . '">' . sprintf( esc_html__( 'All %s', 'bbpress' ), $r['count_before'] . count( $tools ) . $r['count_after'] ) . '</a>' . $r['separator'] . $r['link_after'];
1021
+
1022
+ // Default ticker
1023
+ $i = 0;
1024
+
1025
+ // Loop through overheads and build filter
1026
+ foreach ( $overheads as $overhead => $count ) {
1027
+
1028
+ // Separator count
1029
+ $i++;
1030
+
1031
+ // Build the filter URL
1032
+ $key = sanitize_key( $overhead );
1033
+ $args = array( 'overhead' => $key );
1034
+ $filter_url = add_query_arg( $args, $tools_url );
1035
+
1036
+ // Figure out separator and active class
1037
+ $show_sep = count( $overheads ) > $i ? $r['separator'] : '';
1038
+ $current = ! empty( $_GET['overhead'] ) && ( sanitize_key( $_GET['overhead'] ) === $key ) ? 'current' : '';
1039
+
1040
+ // Counts to show
1041
+ if ( ! empty( $count ) ) {
1042
+ $overhead_count = $r['count_before'] . $count . $r['count_after'];
1043
+ }
1044
+
1045
+ // Build the link
1046
+ $output .= $r['link_before'] . '<a href="' . esc_url( $filter_url ) . '" class="' . esc_attr( $current ) . '">' . bbp_admin_repair_tool_translate_overhead( $overhead ) . $overhead_count . '</a>' . $show_sep . $r['link_after'];
1047
+ }
1048
 
1049
+ // Surround output with before & after strings
1050
+ $output = $r['before'] . $output . $r['after'];
1051
+
1052
+ // Filter & return
1053
+ return apply_filters( 'bbp_get_admin_repair_tool_components', $output, $r, $args );
1054
  }
1055
 
1056
  /**
1057
  * Recount topic replies
1058
  *
1059
+ * @since 2.0.0 bbPress (r2613)
1060
  *
 
1061
  * @uses wpdb::query() To run our recount sql queries
1062
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
1063
+ * @uses bbp_get_topic_post_type() To get the topic post type
1064
+ * @uses bbp_get_reply_post_type() To get the reply post type
1065
+ * @uses bbp_get_public_status_id() To get the public status id
1066
+ * @uses bbp_get_closed_status_id() To get the closed status id
1067
  * @return array An array of the status code and the message
1068
  */
1069
  function bbp_admin_repair_topic_reply_count() {
 
1070
 
1071
+ // Define variables
1072
+ $bbp_db = bbp_db();
1073
  $statement = __( 'Counting the number of replies in each topic&hellip; %s', 'bbpress' );
1074
  $result = __( 'Failed!', 'bbpress' );
1075
 
1080
  $cps = bbp_get_closed_status_id();
1081
 
1082
  // Delete the meta key _bbp_reply_count for each topic
1083
+ $sql_delete = "DELETE `postmeta` FROM `{$bbp_db->postmeta}` AS `postmeta`
1084
+ LEFT JOIN `{$bbp_db->posts}` AS `posts` ON `posts`.`ID` = `postmeta`.`post_id`
1085
  WHERE `posts`.`post_type` = '{$tpt}'
1086
  AND `postmeta`.`meta_key` = '_bbp_reply_count'";
1087
 
1088
+ if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
1089
  return array( 1, sprintf( $statement, $result ) );
1090
  }
1091
 
1092
  // Recalculate the meta key _bbp_reply_count for each topic
1093
+ $sql = "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`) (
1094
  SELECT `topics`.`ID` AS `post_id`, '_bbp_reply_count' AS `meta_key`, COUNT(`replies`.`ID`) As `meta_value`
1095
+ FROM `{$bbp_db->posts}` AS `topics`
1096
+ LEFT JOIN `{$bbp_db->posts}` as `replies`
1097
  ON `replies`.`post_parent` = `topics`.`ID`
1098
  AND `replies`.`post_status` = '{$pps}'
1099
  AND `replies`.`post_type` = '{$rpt}'
1100
  WHERE `topics`.`post_type` = '{$tpt}'
1101
  AND `topics`.`post_status` IN ( '{$pps}', '{$cps}' )
1102
+ GROUP BY `topics`.`ID`)";
1103
 
1104
+ if ( is_wp_error( $bbp_db->query( $sql ) ) ) {
1105
  return array( 2, sprintf( $statement, $result ) );
1106
  }
1107
 
1111
  /**
1112
  * Recount topic voices
1113
  *
1114
+ * @since 2.0.0 bbPress (r2613)
1115
  *
 
1116
  * @uses wpdb::query() To run our recount sql queries
1117
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
1118
+ * @uses bbp_get_topic_post_type() To get the topic post type
1119
+ * @uses bbp_get_reply_post_type() To get the reply post type
1120
+ * @uses bbp_get_public_status_id() To get the public status id
1121
+ * @uses bbp_get_closed_status_id() To get the closed status id
1122
  * @return array An array of the status code and the message
1123
  */
1124
  function bbp_admin_repair_topic_voice_count() {
 
1125
 
1126
+ // Define variables
1127
+ $bbp_db = bbp_db();
1128
  $statement = __( 'Counting the number of voices in each topic&hellip; %s', 'bbpress' );
1129
  $result = __( 'Failed!', 'bbpress' );
1130
 
1131
+ $sql_delete = "DELETE FROM `{$bbp_db->postmeta}` WHERE `meta_key` = '_bbp_voice_count'";
1132
+ if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
1133
  return array( 1, sprintf( $statement, $result ) );
1134
+ }
1135
 
1136
  // Post types and status
1137
  $tpt = bbp_get_topic_post_type();
1139
  $pps = bbp_get_public_status_id();
1140
  $cps = bbp_get_closed_status_id();
1141
 
1142
+ $sql = "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`) (
1143
  SELECT `postmeta`.`meta_value`, '_bbp_voice_count', COUNT(DISTINCT `post_author`) as `meta_value`
1144
+ FROM `{$bbp_db->posts}` AS `posts`
1145
+ LEFT JOIN `{$bbp_db->postmeta}` AS `postmeta`
1146
  ON `posts`.`ID` = `postmeta`.`post_id`
1147
  AND `postmeta`.`meta_key` = '_bbp_topic_id'
1148
  WHERE `posts`.`post_type` IN ( '{$tpt}', '{$rpt}' )
1149
  AND `posts`.`post_status` IN ( '{$pps}', '{$cps}' )
1150
  AND `posts`.`post_author` != '0'
1151
+ GROUP BY `postmeta`.`meta_value`)";
1152
 
1153
+ if ( is_wp_error( $bbp_db->query( $sql ) ) ) {
1154
  return array( 2, sprintf( $statement, $result ) );
1155
+ }
1156
 
1157
  return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
1158
  }
1160
  /**
1161
  * Recount topic hidden replies (spammed/trashed)
1162
  *
1163
+ * @since 2.0.0 bbPress (r2747)
1164
  *
1165
  * @uses wpdb::query() To run our recount sql queries
1166
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
1167
+ * @uses bbp_get_reply_post_type() To get the reply post type
1168
+ * @uses bbp_get_trash_status_id() To get the trash status id
1169
+ * @uses bbp_get_spam_status_id() To get the spam status id
1170
+ * @uses bbp_get_pending_status_id() To get the pending status id
1171
  * @return array An array of the status code and the message
1172
  */
1173
  function bbp_admin_repair_topic_hidden_reply_count() {
 
1174
 
1175
+ // Define variables
1176
+ $bbp_db = bbp_db();
1177
+ $statement = __( 'Counting the number of pending, spammed, and trashed replies in each topic&hellip; %s', 'bbpress' );
1178
  $result = __( 'Failed!', 'bbpress' );
1179
 
1180
+ $sql_delete = "DELETE FROM `{$bbp_db->postmeta}` WHERE `meta_key` = '_bbp_reply_count_hidden'";
1181
+ if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
1182
  return array( 1, sprintf( $statement, $result ) );
1183
+ }
1184
+
1185
+ // Post types and status
1186
+ $rpt = bbp_get_reply_post_type();
1187
+ $tps = bbp_get_trash_status_id();
1188
+ $sps = bbp_get_spam_status_id();
1189
+ $pps = bbp_get_pending_status_id();
1190
 
1191
+ $sql = "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$bbp_db->posts}` WHERE `post_type` = '{$rpt}' AND `post_status` IN ( '{$tps}', '{$sps}', '{$pps}' ) GROUP BY `post_parent`)";
1192
+ if ( is_wp_error( $bbp_db->query( $sql ) ) ) {
1193
  return array( 2, sprintf( $statement, $result ) );
1194
+ }
1195
 
1196
  return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
1197
  }
1199
  /**
1200
  * Repair group forum ID mappings after a bbPress 1.1 to bbPress 2.2 conversion
1201
  *
1202
+ * @since 2.2.0 bbPress (r4395)
1203
  *
1204
+ * @uses bbp_get_forum_post_type() To get the forum post type
1205
  * @return If a wp_error() occurs and no converted forums are found
1206
  */
1207
  function bbp_admin_repair_group_forum_relationship() {
 
1208
 
1209
+ // Define variables
1210
+ $bbp_db = bbp_db();
1211
  $statement = __( 'Repairing BuddyPress group-forum relationships&hellip; %s', 'bbpress' );
1212
+ $g_count = 0;
1213
+ $f_count = 0;
1214
+ $s_count = 0;
1215
 
1216
  // Copy the BuddyPress filter here, incase BuddyPress is not active
1217
+ $prefix = apply_filters( 'bp_core_get_table_prefix', $bbp_db->base_prefix );
1218
  $groups_table = $prefix . 'bp_groups';
1219
  $groups_meta_table = $prefix . 'bp_groups_groupmeta';
1220
 
1221
  // Get the converted forum IDs
1222
+ $forum_ids = $bbp_db->query( "SELECT `forum`.`ID`, `forummeta`.`meta_value`
1223
+ FROM `{$bbp_db->posts}` AS `forum`
1224
+ LEFT JOIN `{$bbp_db->postmeta}` AS `forummeta`
1225
  ON `forum`.`ID` = `forummeta`.`post_id`
1226
  AND `forummeta`.`meta_key` = '_bbp_old_forum_id'
1227
+ WHERE `forum`.`post_type` = '" . bbp_get_forum_post_type() . "'
1228
+ GROUP BY `forum`.`ID`" );
1229
 
1230
  // Bail if forum IDs returned an error
1231
+ if ( is_wp_error( $forum_ids ) || empty( $bbp_db->last_result ) ) {
1232
  return array( 2, sprintf( $statement, __( 'Failed!', 'bbpress' ) ) );
1233
+ }
1234
 
1235
  // Stash the last results
1236
+ $results = $bbp_db->last_result;
1237
 
1238
  // Update each group forum
1239
  foreach ( $results as $group_forums ) {
1240
 
1241
  // Only update if is a converted forum
1242
+ if ( ! isset( $group_forums->meta_value ) ) {
1243
  continue;
1244
+ }
1245
 
1246
  // Attempt to update group meta
1247
+ $updated = $bbp_db->query( "UPDATE `{$groups_meta_table}` SET `meta_value` = '{$group_forums->ID}' WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->meta_value}'" );
1248
 
1249
  // Bump the count
1250
+ if ( ! empty( $updated ) && ! is_wp_error( $updated ) ) {
1251
  ++$g_count;
1252
  }
1253
 
1254
  // Update group to forum relationship data
1255
+ $group_id = (int) $bbp_db->get_var( "SELECT `group_id` FROM `{$groups_meta_table}` WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->ID}'" );
1256
+ if ( ! empty( $group_id ) ) {
1257
 
1258
  // Update the group to forum meta connection in forums
1259
  update_post_meta( $group_forums->ID, '_bbp_group_ids', array( $group_id ) );
1260
 
1261
  // Get the group status
1262
+ $group_status = $bbp_db->get_var( "SELECT `status` FROM `{$groups_table}` WHERE `id` = '{$group_id}'" );
1263
 
1264
  // Sync up forum visibility based on group status
1265
  switch ( $group_status ) {
1300
  $posts = get_posts( array(
1301
  'post_type' => bbp_get_forum_post_type(),
1302
  'meta_key' => '_bbp_old_forum_id',
1303
+ 'meta_type' => 'NUMERIC',
1304
  'meta_value' => $old_default_forum_id,
1305
  'numberposts' => 1
1306
  ) );
1336
  /**
1337
  * Recount forum topics
1338
  *
1339
+ * @since 2.0.0 bbPress (r2613)
1340
  *
1341
  * @uses wpdb::query() To run our recount sql queries
1342
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
1346
  * @return array An array of the status code and the message
1347
  */
1348
  function bbp_admin_repair_forum_topic_count() {
 
1349
 
1350
+ // Define variables
1351
+ $bbp_db = bbp_db();
1352
  $statement = __( 'Counting the number of topics in each forum&hellip; %s', 'bbpress' );
1353
  $result = __( 'Failed!', 'bbpress' );
1354
 
1355
+ $sql_delete = "DELETE FROM {$bbp_db->postmeta} WHERE meta_key IN ( '_bbp_topic_count', '_bbp_total_topic_count', '_bbp_topic_count_hidden' )";
1356
+ if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
1357
  return array( 1, sprintf( $statement, $result ) );
1358
+ }
1359
 
1360
  $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
1361
+ if ( ! empty( $forums ) ) {
1362
  foreach ( $forums as $forum ) {
1363
  bbp_update_forum_topic_count( $forum->ID );
1364
+ bbp_update_forum_topic_count_hidden( $forum->ID );
1365
  }
1366
  } else {
1367
  return array( 2, sprintf( $statement, $result ) );
1373
  /**
1374
  * Recount forum replies
1375
  *
1376
+ * @since 2.0.0 bbPress (r2613)
1377
  *
1378
  * @uses wpdb::query() To run our recount sql queries
1379
  * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
1383
  * @return array An array of the status code and the message
1384
  */
1385
  function bbp_admin