bbPress - Version 2.6-rc-5

Version Description

Download this release

Release Info

Developer netweb
Plugin Icon 128x128 bbPress
Version 2.6-rc-5
Comparing to
See all releases

Code changes from version 2.5.14 to 2.6-rc-5

Files changed (63) hide show
  1. bbpress.php +266 -176
  2. bbpress.pot +6178 -0
  3. composer.json +29 -0
  4. humans.txt +8 -3
  5. includes/admin/actions.php +137 -29
  6. includes/admin/assets/css/admin-rtl.css +601 -0
  7. includes/admin/assets/css/admin-rtl.min.css +1 -0
  8. includes/admin/assets/css/admin.css +601 -0
  9. includes/admin/assets/css/admin.min.css +1 -0
  10. includes/admin/assets/js/badge.js +46 -0
  11. includes/admin/assets/js/badge.min.js +3 -0
  12. includes/admin/{js → assets/js}/common.js +0 -0
  13. includes/admin/assets/js/common.min.js +3 -0
  14. includes/admin/assets/js/converter.js +335 -0
  15. includes/admin/assets/js/converter.min.js +3 -0
  16. includes/admin/{js → assets/js}/replies.js +3 -0
  17. includes/admin/assets/js/replies.min.js +3 -0
  18. includes/admin/{js → assets/js}/topics.js +0 -0
  19. includes/admin/assets/js/topics.min.js +3 -0
  20. includes/admin/{admin.php → classes/class-bbp-admin.php} +419 -349
  21. includes/admin/classes/class-bbp-converter-base.php +1209 -0
  22. includes/admin/classes/class-bbp-converter.php +845 -0
  23. includes/admin/classes/class-bbp-topic-replies-list-table.php +329 -0
  24. includes/admin/{functions.php → common.php} +27 -80
  25. includes/admin/converter.php +0 -1497
  26. includes/admin/converters/AEF.php +41 -69
  27. includes/admin/converters/Drupal7.php +121 -46
  28. includes/admin/converters/Example.php +121 -45
  29. includes/admin/converters/FluxBB.php +85 -67
  30. includes/admin/converters/Invision.php +44 -52
  31. includes/admin/converters/Kunena1.php +258 -281
  32. includes/admin/converters/Kunena2.php +118 -142
  33. includes/admin/converters/Kunena3.php +33 -59
  34. includes/admin/converters/Mingle.php +47 -50
  35. includes/admin/converters/MyBB.php +590 -591
  36. includes/admin/converters/PHPFox3.php +33 -65
  37. includes/admin/converters/PHPWind.php +34 -50
  38. includes/admin/converters/Phorum.php +82 -37
  39. includes/admin/converters/PunBB.php +737 -680
  40. includes/admin/converters/SMF.php +812 -743
  41. includes/admin/converters/SimplePress5.php +92 -58
  42. includes/admin/converters/Vanilla.php +115 -73
  43. includes/admin/converters/XMB.php +721 -709
  44. includes/admin/converters/XenForo.php +850 -725
  45. includes/admin/converters/bbPress1.php +158 -70
  46. includes/admin/converters/e107v1.php +637 -0
  47. includes/admin/converters/phpBB.php +204 -91
  48. includes/admin/converters/vBulletin.php +119 -70
  49. includes/admin/converters/vBulletin3.php +114 -67
  50. includes/admin/css/admin.css +0 -177
  51. includes/admin/forums.php +350 -196
  52. includes/admin/images/badge-2x.png +0 -0
  53. includes/admin/images/badge.png +0 -0
  54. includes/admin/images/button-grad.png +0 -0
  55. includes/admin/images/icons32-2x.png +0 -0
  56. includes/admin/images/icons32.png +0 -0
  57. includes/admin/images/index.php +0 -5
  58. includes/admin/images/menu-2x.png +0 -0
  59. includes/admin/images/menu.png +0 -0
  60. includes/admin/metaboxes.php +389 -112
  61. includes/admin/parser.php +11 -3
  62. includes/admin/replies.php +468 -383
  63. includes/admin/settings.php +367 -131
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 6686 2017-09-09 15:04:06Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
@@ -15,23 +15,24 @@
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.14
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
  /**
30
  * Main bbPress Class
31
  *
32
  * "How doth the little busy bee, improve each shining hour..."
33
  *
34
- * @since bbPress (r2464)
35
  */
36
  final class bbPress {
37
 
@@ -43,7 +44,7 @@ final class bbPress {
43
  * private array that gets updated with the help of PHP magic methods.
44
  *
45
  * This is a precautionary measure, to avoid potential errors produced by
46
- * unanticipated direct manipulation of bbPress's run-time data.
47
  *
48
  * @see bbPress::setup_globals()
49
  * @var array
@@ -58,25 +59,35 @@ 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 +100,11 @@ 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
 
@@ -105,8 +114,9 @@ final class bbPress {
105
  // Only run these methods if they haven't been ran previously
106
  if ( null === $instance ) {
107
  $instance = new bbPress;
108
- $instance->setup_globals();
109
  $instance->includes();
 
110
  $instance->setup_actions();
111
  }
112
 
@@ -119,7 +129,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,97 +139,111 @@ 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
 
177
  /** Private Methods *******************************************************/
178
 
179
  /**
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
187
- * @uses apply_filters() Calls various filters
188
  */
189
- private function setup_globals() {
190
 
191
  /** Versions **********************************************************/
192
 
193
- $this->version = '2.5.14-6684';
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_basename', 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' ) );
206
  $this->includes_url = apply_filters( 'bbp_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );
207
 
208
  // Languages
 
209
  $this->lang_dir = apply_filters( 'bbp_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );
210
 
211
  // Templates
212
  $this->themes_dir = apply_filters( 'bbp_themes_dir', trailingslashit( $this->plugin_dir . 'templates' ) );
213
  $this->themes_url = apply_filters( 'bbp_themes_url', trailingslashit( $this->plugin_url . 'templates' ) );
 
 
 
 
 
 
 
 
214
 
215
  /** Identifiers *******************************************************/
216
 
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' );
@@ -231,15 +256,16 @@ final class bbPress {
231
  $this->trash_status_id = apply_filters( 'bbp_trash_post_status', 'trash' );
232
 
233
  // Other identifiers
234
- $this->user_id = apply_filters( 'bbp_user_id', 'bbp_user' );
235
- $this->tops_id = apply_filters( 'bbp_tops_id', 'bbp_tops' );
236
- $this->reps_id = apply_filters( 'bbp_reps_id', 'bbp_reps' );
237
- $this->favs_id = apply_filters( 'bbp_favs_id', 'bbp_favs' );
238
- $this->subs_id = apply_filters( 'bbp_subs_id', 'bbp_subs' );
239
- $this->view_id = apply_filters( 'bbp_view_id', 'bbp_view' );
240
- $this->edit_id = apply_filters( 'bbp_edit_id', 'edit' );
241
- $this->paged_id = apply_filters( 'bbp_paged_id', 'paged' );
242
- $this->search_id = apply_filters( 'bbp_search_id', 'bbp_search' );
 
243
 
244
  /** Queries ***********************************************************/
245
 
@@ -248,11 +274,13 @@ final class bbPress {
248
  $this->current_topic_id = 0; // Current topic id
249
  $this->current_reply_id = 0; // Current reply id
250
  $this->current_topic_tag_id = 0; // Current topic tag id
 
251
 
252
- $this->forum_query = new WP_Query(); // Main forum query
253
- $this->topic_query = new WP_Query(); // Main topic query
254
- $this->reply_query = new WP_Query(); // Main reply query
255
- $this->search_query = new WP_Query(); // Main search query
 
256
 
257
  /** Theme Compat ******************************************************/
258
 
@@ -269,88 +297,94 @@ 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
  */
282
  private function includes() {
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
  */
355
  private function setup_actions() {
356
 
@@ -359,13 +393,16 @@ 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 +416,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,81 +433,69 @@ 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
 
 
 
 
 
402
  // Register the default theme compatibility package
403
  bbp_register_theme_package( array(
404
  'id' => 'default',
405
- 'name' => __( 'bbPress Default', 'bbpress' ),
406
  'version' => bbp_get_version(),
407
  'dir' => trailingslashit( $this->themes_dir . 'default' ),
408
  'url' => trailingslashit( $this->themes_url . 'default' )
409
  ) );
410
-
411
- // Register the basic theme stack. This is really dope.
412
- bbp_register_template_stack( 'get_stylesheet_directory', 10 );
413
- bbp_register_template_stack( 'get_template_directory', 12 );
414
- bbp_register_template_stack( 'bbp_get_theme_compat_dir', 14 );
415
  }
416
 
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
445
  */
446
  public function load_textdomain() {
447
 
448
- // Traditional WordPress plugin locale filter
449
- $locale = apply_filters( 'plugin_locale', get_locale(), $this->domain );
450
- $mofile = sprintf( '%1$s-%2$s.mo', $this->domain, $locale );
451
 
452
- // Setup paths to current locale file
453
- $mofile_local = $this->lang_dir . $mofile;
454
- $mofile_global = WP_LANG_DIR . '/bbpress/' . $mofile;
455
 
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/
463
- load_plugin_textdomain( $this->domain );
464
  }
465
 
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()
473
  */
474
  public static function register_post_types() {
475
 
@@ -494,7 +520,8 @@ final class bbPress {
494
  'can_export' => true,
495
  'hierarchical' => true,
496
  'query_var' => true,
497
- 'menu_icon' => ''
 
498
  ) )
499
  );
500
 
@@ -519,7 +546,8 @@ final class bbPress {
519
  'can_export' => true,
520
  'hierarchical' => false,
521
  'query_var' => true,
522
- 'menu_icon' => ''
 
523
  )
524
  ) );
525
 
@@ -544,7 +572,8 @@ final class bbPress {
544
  'can_export' => true,
545
  'hierarchical' => false,
546
  'query_var' => true,
547
- 'menu_icon' => ''
 
548
  ) )
549
  );
550
  }
@@ -555,11 +584,7 @@ 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 &
562
- * modify $wp_post_statuses accordingly
563
  */
564
  public static function register_post_statuses() {
565
 
@@ -567,10 +592,12 @@ final class bbPress {
567
  register_post_status(
568
  bbp_get_closed_status_id(),
569
  apply_filters( 'bbp_register_closed_post_status', array(
570
- 'label' => _x( 'Closed', 'post', 'bbpress' ),
571
- 'label_count' => _nx_noop( 'Closed <span class="count">(%s)</span>', 'Closed <span class="count">(%s)</span>', 'post', 'bbpress' ),
572
- 'public' => true,
573
- 'show_in_admin_all' => true
 
 
574
  ) )
575
  );
576
 
@@ -583,7 +610,8 @@ final class bbPress {
583
  'protected' => true,
584
  'exclude_from_search' => true,
585
  'show_in_admin_status_list' => true,
586
- 'show_in_admin_all_list' => false
 
587
  ) )
588
  );
589
 
@@ -596,7 +624,8 @@ final class bbPress {
596
  'protected' => true,
597
  'exclude_from_search' => true,
598
  'show_in_admin_status_list' => true,
599
- 'show_in_admin_all_list' => false
 
600
  ) )
601
  );
602
 
@@ -609,7 +638,8 @@ final class bbPress {
609
  'private' => true,
610
  'exclude_from_search' => true,
611
  'show_in_admin_status_list' => true,
612
- 'show_in_admin_all_list' => true
 
613
  ) )
614
  );
615
 
@@ -623,7 +653,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 +668,13 @@ 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(),
@@ -653,13 +682,14 @@ final class bbPress {
653
  'labels' => bbp_get_topic_tag_tax_labels(),
654
  'rewrite' => bbp_get_topic_tag_tax_rewrite(),
655
  'capabilities' => bbp_get_topic_tag_caps(),
656
- 'update_count_callback' => '_update_post_term_count',
657
  'query_var' => true,
658
  'show_tagcloud' => true,
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,8 +697,7 @@ 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() {
674
 
@@ -678,6 +707,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 +720,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,36 +732,87 @@ final class bbPress {
701
  /**
702
  * Register the bbPress shortcodes
703
  *
704
- * @since bbPress (r3031)
705
- *
706
- * @uses BBP_Shortcodes
707
  */
708
  public function register_shortcodes() {
709
  $this->shortcodes = new BBP_Shortcodes();
710
  }
711
 
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() {
736
  add_rewrite_tag( '%' . bbp_get_view_rewrite_id() . '%', '([^/]+)' ); // View Page tag
@@ -739,6 +821,7 @@ final class bbPress {
739
  add_rewrite_tag( '%' . bbp_get_user_rewrite_id() . '%', '([^/]+)' ); // User Profile tag
740
  add_rewrite_tag( '%' . bbp_get_user_favorites_rewrite_id() . '%', '([1]{1,})' ); // User Favorites tag
741
  add_rewrite_tag( '%' . bbp_get_user_subscriptions_rewrite_id() . '%', '([1]{1,})' ); // User Subscriptions tag
 
742
  add_rewrite_tag( '%' . bbp_get_user_topics_rewrite_id() . '%', '([1]{1,})' ); // User Topics Tag
743
  add_rewrite_tag( '%' . bbp_get_user_replies_rewrite_id() . '%', '([1]{1,})' ); // User Replies Tag
744
  }
@@ -750,7 +833,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() {
@@ -779,6 +863,7 @@ final class bbPress {
779
  $paged_slug = bbp_get_paged_slug();
780
  $user_favs_slug = bbp_get_user_favorites_slug();
781
  $user_subs_slug = bbp_get_user_subscriptions_slug();
 
782
 
783
  // Unique rewrite ID's
784
  $feed_id = 'feed';
@@ -791,6 +876,7 @@ final class bbPress {
791
  $user_subs_id = bbp_get_user_subscriptions_rewrite_id();
792
  $user_tops_id = bbp_get_user_topics_rewrite_id();
793
  $user_reps_id = bbp_get_user_replies_rewrite_id();
 
794
 
795
  // Rewrite rule matches used repeatedly below
796
  $root_rule = '/([^/]+)/?$';
@@ -809,10 +895,12 @@ final class bbPress {
809
  $reps_rule = '/([^/]+)/' . $reply_archive_slug . '/?$';
810
  $favs_rule = '/([^/]+)/' . $user_favs_slug . '/?$';
811
  $subs_rule = '/([^/]+)/' . $user_subs_slug . '/?$';
 
812
  $tops_paged_rule = '/([^/]+)/' . $topic_archive_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
813
  $reps_paged_rule = '/([^/]+)/' . $reply_archive_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
814
  $favs_paged_rule = '/([^/]+)/' . $user_favs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
815
  $subs_paged_rule = '/([^/]+)/' . $user_subs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
 
816
 
817
  // Edit Forum|Topic|Reply|Topic-tag
818
  add_rewrite_rule( $forum_slug . $edit_rule, 'index.php?' . bbp_get_forum_post_type() . '=$matches[1]&' . $edit_id . '=1', $priority );
@@ -825,10 +913,12 @@ final class bbPress {
825
  add_rewrite_rule( $user_slug . $reps_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_reps_id . '=1&' . $paged_id . '=$matches[2]', $priority );
826
  add_rewrite_rule( $user_slug . $favs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_favs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
827
  add_rewrite_rule( $user_slug . $subs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_subs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
 
828
  add_rewrite_rule( $user_slug . $tops_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_tops_id . '=1', $priority );
829
  add_rewrite_rule( $user_slug . $reps_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_reps_id . '=1', $priority );
830
  add_rewrite_rule( $user_slug . $favs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_favs_id . '=1', $priority );
831
  add_rewrite_rule( $user_slug . $subs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_subs_id . '=1', $priority );
 
832
  add_rewrite_rule( $user_slug . $edit_rule, 'index.php?' . $user_id . '=$matches[1]&' . $edit_id . '=1', $priority );
833
  add_rewrite_rule( $user_slug . $root_rule, 'index.php?' . $user_id . '=$matches[1]', $priority );
834
 
@@ -849,7 +939,7 @@ final class bbPress {
849
  * - Topic Views
850
  * - Search
851
  *
852
- * @since bbPress (r4930)
853
  */
854
  public static function add_permastructs() {
855
 
@@ -886,7 +976,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 +997,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 6705 2017-09-14 22:57:06Z 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-rc-5
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
  /**
31
  * Main bbPress Class
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
 
44
  * private array that gets updated with the help of PHP magic methods.
45
  *
46
  * This is a precautionary measure, to avoid potential errors produced by
47
+ * unanticipated direct manipulation of run-time data.
48
  *
49
  * @see bbPress::setup_globals()
50
  * @var array
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 Storage of options not in the database
78
+ */
79
+ public $not_options = array();
80
 
81
  /**
82
  * @var array Overloads get_user_meta()
83
  */
84
  public $user_options = array();
85
 
86
+ /**
87
+ * @var array Dynamically initialized user roles
88
+ */
89
+ public $roles = array();
90
+
91
  /** Singleton *************************************************************/
92
 
93
  /**
100
  * Insures that only one instance of bbPress exists in memory at any one
101
  * time. Also prevents needing to define globals all over the place.
102
  *
103
+ * @since 2.1.0 bbPress (r3757)
104
+ *
105
  * @staticvar object $instance
 
 
 
106
  * @see bbpress()
107
+ * @return bbPress The one true bbPress
108
  */
109
  public static function instance() {
110
 
114
  // Only run these methods if they haven't been ran previously
115
  if ( null === $instance ) {
116
  $instance = new bbPress;
117
+ $instance->setup_environment();
118
  $instance->includes();
119
+ $instance->setup_variables();
120
  $instance->setup_actions();
121
  }
122
 
129
  /**
130
  * A dummy constructor to prevent bbPress from being loaded more than once.
131
  *
132
+ * @since 2.0.0 bbPress (r2464)
133
+ *
134
  * @see bbPress::instance()
135
  * @see bbpress();
136
  */
139
  /**
140
  * A dummy magic method to prevent bbPress from being cloned
141
  *
142
+ * @since 2.0.0 bbPress (r2464)
143
  */
144
  public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'bbpress' ), '2.1' ); }
145
 
146
  /**
147
  * A dummy magic method to prevent bbPress from being unserialized
148
  *
149
+ * @since 2.0.0 bbPress (r2464)
150
  */
151
  public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'bbpress' ), '2.1' ); }
152
 
153
  /**
154
  * Magic method for checking the existence of a certain custom field
155
  *
156
+ * @since 2.1.0 bbPress (r3951)
157
  */
158
+ public function __isset( $key ) { return isset( $this->data[ $key ] ); }
159
 
160
  /**
161
  * Magic method for getting bbPress variables
162
  *
163
+ * @since 2.1.0 bbPress (r3951)
164
  */
165
+ public function __get( $key ) { return isset( $this->data[ $key ] ) ? $this->data[ $key ] : null; }
166
 
167
  /**
168
  * Magic method for setting bbPress variables
169
  *
170
+ * @since 2.1.0 bbPress (r3951)
171
  */
172
+ public function __set( $key , $value ) { $this->data[ $key ] = $value; }
173
 
174
  /**
175
  * Magic method for unsetting bbPress variables
176
  *
177
+ * @since 2.3.0 bbPress (r4628)
178
  */
179
+ public function __unset( $key ) {
180
+ if ( isset( $this->data[ $key ] ) ) {
181
+ unset( $this->data[ $key ] );
182
+ }
183
+ }
184
 
185
  /**
186
  * Magic method to prevent notices and errors from invalid method calls
187
  *
188
+ * @since 2.2.0 bbPress (r4252)
189
  */
190
  public function __call( $name = '', $args = array() ) { unset( $name, $args ); return null; }
191
 
192
  /** Private Methods *******************************************************/
193
 
194
  /**
195
+ * Setup the environment variables to allow the rest of bbPress to function
196
+ * more easily.
197
+ *
198
+ * @since 2.0.0 bbPress (r2626)
199
  *
 
200
  * @access private
 
 
 
201
  */
202
+ private function setup_environment() {
203
 
204
  /** Versions **********************************************************/
205
 
206
+ $this->version = '2.6-rc-6701';
207
+ $this->db_version = '262';
208
 
209
  /** Paths *************************************************************/
210
 
211
+ // File & base
212
+ $this->file = __FILE__;
213
+ $this->basename = apply_filters( 'bbp_plugin_basename', str_replace( array( 'build/', 'src/' ), '', plugin_basename( $this->file ) ) );
214
+ $this->basepath = apply_filters( 'bbp_plugin_basepath', trailingslashit( dirname( $this->basename ) ) );
215
+
216
+ // Path and URL
217
+ $this->plugin_dir = apply_filters( 'bbp_plugin_dir_path', plugin_dir_path( $this->file ) );
218
+ $this->plugin_url = apply_filters( 'bbp_plugin_dir_url', plugin_dir_url ( $this->file ) );
219
 
220
  // Includes
221
  $this->includes_dir = apply_filters( 'bbp_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );
222
  $this->includes_url = apply_filters( 'bbp_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );
223
 
224
  // Languages
225
+ $this->lang_base = apply_filters( 'bbp_lang_base', trailingslashit( $this->basepath . 'languages' ) );
226
  $this->lang_dir = apply_filters( 'bbp_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );
227
 
228
  // Templates
229
  $this->themes_dir = apply_filters( 'bbp_themes_dir', trailingslashit( $this->plugin_dir . 'templates' ) );
230
  $this->themes_url = apply_filters( 'bbp_themes_url', trailingslashit( $this->plugin_url . 'templates' ) );
231
+ }
232
+
233
+ /**
234
+ * Smart defaults to many bbPress specific class variables.
235
+ *
236
+ * @since 2.6.0 bbPress (r6330)
237
+ */
238
+ private function setup_variables() {
239
 
240
  /** Identifiers *******************************************************/
241
 
242
  // Post type identifiers
243
  $this->forum_post_type = apply_filters( 'bbp_forum_post_type', 'forum' );
244
  $this->topic_post_type = apply_filters( 'bbp_topic_post_type', 'topic' );
 
245
  $this->topic_tag_tax_id = apply_filters( 'bbp_topic_tag_tax_id', 'topic-tag' );
246
+ $this->reply_post_type = apply_filters( 'bbp_reply_post_type', 'reply' );
247
 
248
  // Status identifiers
249
  $this->spam_status_id = apply_filters( 'bbp_spam_post_status', 'spam' );
256
  $this->trash_status_id = apply_filters( 'bbp_trash_post_status', 'trash' );
257
 
258
  // Other identifiers
259
+ $this->user_id = apply_filters( 'bbp_user_id', 'bbp_user' );
260
+ $this->tops_id = apply_filters( 'bbp_tops_id', 'bbp_tops' );
261
+ $this->reps_id = apply_filters( 'bbp_reps_id', 'bbp_reps' );
262
+ $this->favs_id = apply_filters( 'bbp_favs_id', 'bbp_favs' );
263
+ $this->subs_id = apply_filters( 'bbp_subs_id', 'bbp_subs' );
264
+ $this->view_id = apply_filters( 'bbp_view_id', 'bbp_view' );
265
+ $this->edit_id = apply_filters( 'bbp_edit_id', 'edit' );
266
+ $this->paged_id = apply_filters( 'bbp_paged_id', 'paged' );
267
+ $this->search_id = apply_filters( 'bbp_search_id', 'bbp_search' );
268
+ $this->engagements_id = apply_filters( 'bbp_engagements_id', 'bbp_engagements' );
269
 
270
  /** Queries ***********************************************************/
271
 
274
  $this->current_topic_id = 0; // Current topic id
275
  $this->current_reply_id = 0; // Current reply id
276
  $this->current_topic_tag_id = 0; // Current topic tag id
277
+ $this->current_user_id = 0; // Current topic tag id
278
 
279
+ $this->forum_query = new WP_Query(); // Main forum query
280
+ $this->topic_query = new WP_Query(); // Main topic query
281
+ $this->reply_query = new WP_Query(); // Main reply query
282
+ $this->search_query = new WP_Query(); // Main search query
283
+ $this->user_query = new BBP_User_Query(); // Main user query
284
 
285
  /** Theme Compat ******************************************************/
286
 
297
  $this->domain = 'bbpress'; // Unique identifier for retrieving translated strings
298
  $this->extend = new stdClass(); // Plugins add data here
299
  $this->errors = new WP_Error(); // Feedback
300
+
301
+ /** Deprecated ********************************************************/
302
+
303
  $this->tab_index = apply_filters( 'bbp_default_tab_index', 100 );
304
  }
305
 
306
  /**
307
  * Include required files
308
  *
309
+ * @since 2.0.0 bbPress (r2626)
310
+ *
311
  * @access private
 
312
  */
313
  private function includes() {
314
 
315
  /** Core **************************************************************/
316
 
317
+ require $this->includes_dir . 'core/abstraction.php';
318
+ require $this->includes_dir . 'core/sub-actions.php';
319
+ require $this->includes_dir . 'core/functions.php';
320
+ require $this->includes_dir . 'core/cache.php';
321
+ require $this->includes_dir . 'core/options.php';
322
+ require $this->includes_dir . 'core/capabilities.php';
323
+ require $this->includes_dir . 'core/update.php';
324
+ require $this->includes_dir . 'core/template-functions.php';
325
+ require $this->includes_dir . 'core/template-loader.php';
326
+ require $this->includes_dir . 'core/theme-compat.php';
327
 
328
  /** Components ********************************************************/
329
 
330
  // Common
331
+ require $this->includes_dir . 'common/ajax.php';
332
+ require $this->includes_dir . 'common/classes.php';
333
+ require $this->includes_dir . 'common/functions.php';
334
+ require $this->includes_dir . 'common/formatting.php';
335
+ require $this->includes_dir . 'common/locale.php';
336
+ require $this->includes_dir . 'common/locks.php';
337
+ require $this->includes_dir . 'common/template.php';
338
+ require $this->includes_dir . 'common/widgets.php';
339
+ require $this->includes_dir . 'common/shortcodes.php';
340
 
341
  // Forums
342
+ require $this->includes_dir . 'forums/capabilities.php';
343
+ require $this->includes_dir . 'forums/functions.php';
344
+ require $this->includes_dir . 'forums/template.php';
345
 
346
  // Topics
347
+ require $this->includes_dir . 'topics/capabilities.php';
348
+ require $this->includes_dir . 'topics/functions.php';
349
+ require $this->includes_dir . 'topics/template.php';
350
 
351
  // Replies
352
+ require $this->includes_dir . 'replies/capabilities.php';
353
+ require $this->includes_dir . 'replies/functions.php';
354
+ require $this->includes_dir . 'replies/template.php';
355
 
356
  // Search
357
+ require $this->includes_dir . 'search/functions.php';
358
+ require $this->includes_dir . 'search/template.php';
359
 
360
  // Users
361
+ require $this->includes_dir . 'users/capabilities.php';
362
+ require $this->includes_dir . 'users/engagements.php';
363
+ require $this->includes_dir . 'users/functions.php';
364
+ require $this->includes_dir . 'users/template.php';
365
+ require $this->includes_dir . 'users/options.php';
366
+ require $this->includes_dir . 'users/signups.php';
367
 
368
  /** Hooks *************************************************************/
369
 
370
+ require $this->includes_dir . 'core/extend.php';
371
+ require $this->includes_dir . 'core/actions.php';
372
+ require $this->includes_dir . 'core/filters.php';
373
 
374
  /** Admin *************************************************************/
375
 
376
  // Quick admin check and load if needed
377
  if ( is_admin() ) {
378
+ require $this->includes_dir . 'admin/actions.php';
 
379
  }
380
  }
381
 
382
  /**
383
  * Setup the default hooks and actions
384
  *
385
+ * @since 2.0.0 bbPress (r2644)
386
+ *
387
  * @access private
 
388
  */
389
  private function setup_actions() {
390
 
393
  add_action( 'deactivate_' . $this->basename, 'bbp_deactivation' );
394
 
395
  // If bbPress is being deactivated, do not add any actions
396
+ if ( bbp_is_deactivation( $this->basename ) ) {
397
  return;
398
+ }
399
 
400
  // Array of bbPress core actions
401
  $actions = array(
402
  'setup_theme', // Setup the default theme compat
403
  'setup_current_user', // Setup currently logged in user
404
+ 'roles_init', // User roles init
405
+ 'register_meta', // Register meta (forum|topic|reply|user)
406
  'register_post_types', // Register post types (forum|topic|reply)
407
  'register_post_statuses', // Register post statuses (closed|spam|orphan|hidden)
408
  'register_taxonomies', // Register taxonomies (topic-tag)
416
  );
417
 
418
  // Add the actions
419
+ foreach ( $actions as $class_action ) {
420
  add_action( 'bbp_' . $class_action, array( $this, $class_action ), 5 );
421
+ }
422
 
423
  // All bbPress actions are setup (includes bbp-core-hooks.php)
424
  do_action_ref_array( 'bbp_after_setup_actions', array( &$this ) );
433
  * the bbp-theme-compat folders, it's fine to hardcode these here. If at a
434
  * later date we need to automate this, and API will need to be built.
435
  *
436
+ * @since 2.1.0 bbPress (r3829)
437
  */
438
  public function register_theme_packages() {
439
 
440
+ // Register the basic theme stack. This is really dope.
441
+ bbp_register_template_stack( 'get_stylesheet_directory', 6 );
442
+ bbp_register_template_stack( 'get_template_directory', 8 );
443
+
444
  // Register the default theme compatibility package
445
  bbp_register_theme_package( array(
446
  'id' => 'default',
447
+ 'name' => 'bbPress Default',
448
  'version' => bbp_get_version(),
449
  'dir' => trailingslashit( $this->themes_dir . 'default' ),
450
  'url' => trailingslashit( $this->themes_url . 'default' )
451
  ) );
 
 
 
 
 
452
  }
453
 
454
  /**
455
  * Setup the default bbPress theme compatibility location.
456
  *
457
+ * @since 2.1.0 bbPress (r3778)
458
  */
459
  public function setup_theme() {
 
 
 
 
 
 
460
  bbp_setup_theme_compat( bbp_get_theme_package_id() );
461
  }
462
 
463
  /**
464
+ * Load the translation file for current language. Checks the deprecated
465
+ * languages folder inside the bbPress plugin first, and then the default
466
+ * WordPress languages folder.
467
  *
468
  * Note that custom translation files inside the bbPress plugin folder
469
  * will be removed on bbPress updates. If you're creating custom
470
  * translation files, please use the global language folder.
471
  *
472
+ * @since 2.0.0 bbPress (r2596)
 
 
 
473
  */
474
  public function load_textdomain() {
475
 
476
+ // Define the old directory
477
+ $old_dir = WP_LANG_DIR . '/bbpress/';
 
478
 
479
+ // Old location, deprecated in 2.6.0
480
+ if ( is_dir( $old_dir ) ) {
 
481
 
482
+ // Get locale & file-name
483
+ $type = is_admin() ? get_user_locale() : get_locale();
484
+ $locale = apply_filters( 'plugin_locale', $type, $this->domain );
485
+ $mofile = sprintf( '%1$s-%2$s.mo', $this->domain, $locale );
486
 
487
+ // Look in global /wp-content/languages/bbpress/ folder
488
+ load_textdomain( $this->domain, $old_dir . $mofile );
489
+ }
490
 
491
  // Look in global /wp-content/languages/plugins/
492
+ load_plugin_textdomain( $this->domain, false, $this->lang_base );
493
  }
494
 
495
  /**
496
  * Setup the post types for forums, topics and replies
497
  *
498
+ * @since 2.0.0 bbPress (r2597)
 
 
 
499
  */
500
  public static function register_post_types() {
501
 
520
  'can_export' => true,
521
  'hierarchical' => true,
522
  'query_var' => true,
523
+ 'menu_icon' => '',
524
+ 'source' => 'bbpress',
525
  ) )
526
  );
527
 
546
  'can_export' => true,
547
  'hierarchical' => false,
548
  'query_var' => true,
549
+ 'menu_icon' => '',
550
+ 'source' => 'bbpress',
551
  )
552
  ) );
553
 
572
  'can_export' => true,
573
  'hierarchical' => false,
574
  'query_var' => true,
575
+ 'menu_icon' => '',
576
+ 'source' => 'bbpress',
577
  ) )
578
  );
579
  }
584
  * We do some manipulation of the 'trash' status so trashed topics and
585
  * replies can be viewed from within the theme.
586
  *
587
+ * @since 2.0.0 bbPress (r2727)
 
 
 
 
588
  */
589
  public static function register_post_statuses() {
590
 
592
  register_post_status(
593
  bbp_get_closed_status_id(),
594
  apply_filters( 'bbp_register_closed_post_status', array(
595
+ 'label' => _x( 'Closed', 'post', 'bbpress' ),
596
+ 'label_count' => _nx_noop( 'Closed <span class="count">(%s)</span>', 'Closed <span class="count">(%s)</span>', 'post', 'bbpress' ),
597
+ 'public' => true,
598
+ 'show_in_admin_status_list' => true,
599
+ 'show_in_admin_all_list' => true,
600
+ 'source' => 'bbpress'
601
  ) )
602
  );
603
 
610
  'protected' => true,
611
  'exclude_from_search' => true,
612
  'show_in_admin_status_list' => true,
613
+ 'show_in_admin_all_list' => false,
614
+ 'source' => 'bbpress'
615
  ) )
616
  );
617
 
624
  'protected' => true,
625
  'exclude_from_search' => true,
626
  'show_in_admin_status_list' => true,
627
+ 'show_in_admin_all_list' => false,
628
+ 'source' => 'bbpress'
629
  ) )
630
  );
631
 
638
  'private' => true,
639
  'exclude_from_search' => true,
640
  'show_in_admin_status_list' => true,
641
+ 'show_in_admin_all_list' => true,
642
+ 'source' => 'bbpress'
643
  ) )
644
  );
645
 
653
  */
654
  global $wp_post_statuses;
655
 
656
+ if ( ! empty( $wp_post_statuses['trash'] ) ) {
657
 
658
  // User can view trash so set internal to false
659
  if ( current_user_can( 'view_trash' ) ) {
668
  }
669
 
670
  /**
671
+ * Register the topic tag and forum moderator taxonomies
672
  *
673
+ * @since 2.0.0 bbPress (r2464) Added bbp_get_topic_tag_tax_id() taxonomy
 
674
  */
675
  public static function register_taxonomies() {
676
 
677
+ // Register the topic-tag taxonomy.
678
  register_taxonomy(
679
  bbp_get_topic_tag_tax_id(),
680
  bbp_get_topic_post_type(),
682
  'labels' => bbp_get_topic_tag_tax_labels(),
683
  'rewrite' => bbp_get_topic_tag_tax_rewrite(),
684
  'capabilities' => bbp_get_topic_tag_caps(),
685
+ 'update_count_callback' => 'bbp_update_topic_tag_count',
686
  'query_var' => true,
687
  'show_tagcloud' => true,
688
  'hierarchical' => false,
689
  'show_in_nav_menus' => false,
690
  'public' => true,
691
+ 'show_ui' => bbp_allow_topic_tags() && current_user_can( 'bbp_topic_tags_admin' ),
692
+ 'source' => 'bbpress'
693
  )
694
  ) );
695
  }
697
  /**
698
  * Register the bbPress views
699
  *
700
+ * @since 2.0.0 bbPress (r2789)
 
701
  */
702
  public static function register_views() {
703
 
707
  __( 'Most popular topics', 'bbpress' ),
708
  apply_filters( 'bbp_register_view_popular', array(
709
  'meta_key' => '_bbp_reply_count',
710
+ 'meta_type' => 'NUMERIC',
711
  'max_num_pages' => 1,
712
  'orderby' => 'meta_value_num',
713
  'show_stickies' => false
720
  __( 'Topics with no replies', 'bbpress' ),
721
  apply_filters( 'bbp_register_view_no_replies', array(
722
  'meta_key' => '_bbp_reply_count',
723
+ 'meta_type' => 'NUMERIC',
724
  'meta_value' => 1,
725
  'meta_compare' => '<',
726
  'orderby' => '',
732
  /**
733
  * Register the bbPress shortcodes
734
  *
735
+ * @since 2.0.0 bbPress (r3031)
 
 
736
  */
737
  public function register_shortcodes() {
738
  $this->shortcodes = new BBP_Shortcodes();
739
  }
740
 
741
  /**
742
+ * Register bbPress meta-data
743
  *
744
+ * Counts added in 2.6.0 to avoid negative values
 
 
 
745
  *
746
+ * @since 2.6.0 bbPress (r6300)
747
+ */
748
+ public function register_meta() {
749
+
750
+ // Define "count" meta-type array
751
+ $count = array(
752
+ 'type' => 'integer',
753
+ 'description' => esc_html__( 'bbPress Item Count', 'bbpress' ),
754
+ 'single' => true,
755
+ 'sanitize_callback' => 'bbp_number_not_negative',
756
+ 'show_in_rest' => true
757
+ );
758
+
759
+ /** Post **************************************************************/
760
+
761
+ // Counts
762
+ register_meta( 'post', '_bbp_topic_count', $count );
763
+ register_meta( 'post', '_bbp_reply_count', $count );
764
+ register_meta( 'post', '_bbp_total_topic_count', $count );
765
+ register_meta( 'post', '_bbp_total_reply_count', $count );
766
+ register_meta( 'post', '_bbp_voice_count', $count );
767
+ register_meta( 'post', '_bbp_anonymous_reply_count', $count );
768
+ register_meta( 'post', '_bbp_topic_count_hidden', $count );
769
+ register_meta( 'post', '_bbp_reply_count_hidden', $count );
770
+ register_meta( 'post', '_bbp_forum_subforum_count', $count );
771
+
772
+ /* User ***************************************************************/
773
+
774
+ // Counts
775
+ register_meta( 'user', '_bbp_topic_count', $count );
776
+ register_meta( 'user', '_bbp_reply_count', $count );
777
+ }
778
+
779
+ /**
780
+ * Setup the currently logged-in user
781
+ *
782
+ * @since 2.0.0 bbPress (r2697)
783
  */
784
  public function setup_current_user() {
785
  $this->current_user = wp_get_current_user();
786
  }
787
 
788
+ /**
789
+ * Initialize forum-specific roles
790
+ *
791
+ * @since 2.6.0
792
+ */
793
+ public function roles_init() {
794
+
795
+ // Get role IDs
796
+ $keymaster = bbp_get_keymaster_role();
797
+ $moderator = bbp_get_moderator_role();
798
+ $participant = bbp_get_participant_role();
799
+ $spectator = bbp_get_spectator_role();
800
+ $blocked = bbp_get_blocked_role();
801
+
802
+ // Build the roles into one useful array
803
+ $this->roles[ $keymaster ] = new WP_Role( 'Keymaster', bbp_get_caps_for_role( $keymaster ) );
804
+ $this->roles[ $moderator ] = new WP_Role( 'Moderator', bbp_get_caps_for_role( $moderator ) );
805
+ $this->roles[ $participant ] = new WP_Role( 'Participant', bbp_get_caps_for_role( $participant ) );
806
+ $this->roles[ $spectator ] = new WP_Role( 'Spectator', bbp_get_caps_for_role( $spectator ) );
807
+ $this->roles[ $blocked ] = new WP_Role( 'Blocked', bbp_get_caps_for_role( $blocked ) );
808
+ }
809
+
810
  /** Custom Rewrite Rules **************************************************/
811
 
812
  /**
813
  * Add the bbPress-specific rewrite tags
814
  *
815
+ * @since 2.0.0 bbPress (r2753)
 
816
  */
817
  public static function add_rewrite_tags() {
818
  add_rewrite_tag( '%' . bbp_get_view_rewrite_id() . '%', '([^/]+)' ); // View Page tag
821
  add_rewrite_tag( '%' . bbp_get_user_rewrite_id() . '%', '([^/]+)' ); // User Profile tag
822
  add_rewrite_tag( '%' . bbp_get_user_favorites_rewrite_id() . '%', '([1]{1,})' ); // User Favorites tag
823
  add_rewrite_tag( '%' . bbp_get_user_subscriptions_rewrite_id() . '%', '([1]{1,})' ); // User Subscriptions tag
824
+ add_rewrite_tag( '%' . bbp_get_user_engagements_rewrite_id() . '%', '([1]{1,})' ); // User Engagements tag
825
  add_rewrite_tag( '%' . bbp_get_user_topics_rewrite_id() . '%', '([1]{1,})' ); // User Topics Tag
826
  add_rewrite_tag( '%' . bbp_get_user_replies_rewrite_id() . '%', '([1]{1,})' ); // User Replies Tag
827
  }
833
  * - Topic views
834
  * - User profiles
835
  *
836
+ * @since 2.0.0 bbPress (r2688)
837
+ *
838
  * @todo Extract into an API
839
  */
840
  public static function add_rewrite_rules() {
863
  $paged_slug = bbp_get_paged_slug();
864
  $user_favs_slug = bbp_get_user_favorites_slug();
865
  $user_subs_slug = bbp_get_user_subscriptions_slug();
866
+ $user_engs_slug = bbp_get_user_engagements_slug();
867
 
868
  // Unique rewrite ID's
869
  $feed_id = 'feed';
876
  $user_subs_id = bbp_get_user_subscriptions_rewrite_id();
877
  $user_tops_id = bbp_get_user_topics_rewrite_id();
878
  $user_reps_id = bbp_get_user_replies_rewrite_id();
879
+ $user_engs_id = bbp_get_user_engagements_rewrite_id();
880
 
881
  // Rewrite rule matches used repeatedly below
882
  $root_rule = '/([^/]+)/?$';
895
  $reps_rule = '/([^/]+)/' . $reply_archive_slug . '/?$';
896
  $favs_rule = '/([^/]+)/' . $user_favs_slug . '/?$';
897
  $subs_rule = '/([^/]+)/' . $user_subs_slug . '/?$';
898
+ $engs_rule = '/([^/]+)/' . $user_engs_slug . '/?$';
899
  $tops_paged_rule = '/([^/]+)/' . $topic_archive_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
900
  $reps_paged_rule = '/([^/]+)/' . $reply_archive_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
901
  $favs_paged_rule = '/([^/]+)/' . $user_favs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
902
  $subs_paged_rule = '/([^/]+)/' . $user_subs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
903
+ $engs_paged_rule = '/([^/]+)/' . $user_engs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
904
 
905
  // Edit Forum|Topic|Reply|Topic-tag
906
  add_rewrite_rule( $forum_slug . $edit_rule, 'index.php?' . bbp_get_forum_post_type() . '=$matches[1]&' . $edit_id . '=1', $priority );
913
  add_rewrite_rule( $user_slug . $reps_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_reps_id . '=1&' . $paged_id . '=$matches[2]', $priority );
914
  add_rewrite_rule( $user_slug . $favs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_favs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
915
  add_rewrite_rule( $user_slug . $subs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_subs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
916
+ add_rewrite_rule( $user_slug . $engs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_engs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
917
  add_rewrite_rule( $user_slug . $tops_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_tops_id . '=1', $priority );
918
  add_rewrite_rule( $user_slug . $reps_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_reps_id . '=1', $priority );
919
  add_rewrite_rule( $user_slug . $favs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_favs_id . '=1', $priority );
920
  add_rewrite_rule( $user_slug . $subs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_subs_id . '=1', $priority );
921
+ add_rewrite_rule( $user_slug . $engs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_engs_id . '=1', $priority );
922
  add_rewrite_rule( $user_slug . $edit_rule, 'index.php?' . $user_id . '=$matches[1]&' . $edit_id . '=1', $priority );
923
  add_rewrite_rule( $user_slug . $root_rule, 'index.php?' . $user_id . '=$matches[1]', $priority );
924
 
939
  * - Topic Views
940
  * - Search
941
  *
942
+ * @since 2.4.0 bbPress (r4930)
943
  */
944
  public static function add_permastructs() {
945
 
976
  ) );
977
 
978
  // Search Permastruct
979
+ add_permastruct( $search_id, $search_slug . '/%' . $search_id . '%', array(
980
  'with_front' => false,
981
  'ep_mask' => EP_NONE,
982
  'paged' => true,
997
  *
998
  * Example: <?php $bbp = bbpress(); ?>
999
  *
1000
+ * @return bbPress The one true bbPress Instance
1001
  */
1002
  function bbpress() {
1003
+ return bbPress::instance();
1004
  }
1005
 
1006
  /**
bbpress.pot ADDED
@@ -0,0 +1,6178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-rc-5\n"
6
+ "Report-Msgid-Bugs-To: https://bbpress.trac.wordpress.org\n"
7
+ "POT-Creation-Date: 2017-09-15 14:01:43+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-i18n1.0.0\n"
15
+
16
+ #: bbpress.php:144 bbpress.php:151
17
+ msgid "Cheatin&#8217; huh?"
18
+ msgstr ""
19
+
20
+ #: bbpress.php:511
21
+ msgid "bbPress Forums"
22
+ msgstr ""
23
+
24
+ #: bbpress.php:537
25
+ msgid "bbPress Topics"
26
+ msgstr ""
27
+
28
+ #: bbpress.php:563
29
+ msgid "bbPress Replies"
30
+ msgstr ""
31
+
32
+ #: bbpress.php:707
33
+ msgid "Most popular topics"
34
+ msgstr ""
35
+
36
+ #: bbpress.php:720
37
+ msgid "Topics with no replies"
38
+ msgstr ""
39
+
40
+ #: bbpress.php:753
41
+ msgid "bbPress Item Count"
42
+ msgstr ""
43
+
44
+ #: includes/admin/actions.php:175 includes/admin/forums.php:522
45
+ #: includes/admin/settings.php:280 includes/admin/settings.php:301
46
+ #: includes/admin/tools/common.php:317 includes/admin/topics.php:831
47
+ #: includes/extend/buddypress/activity.php:197
48
+ #: includes/extend/buddypress/activity.php:389
49
+ #: includes/forums/template.php:2591 includes/topics/template.php:47
50
+ #: includes/topics/template.php:48
51
+ #: templates/default/bbpress/content-statistics.php:30
52
+ #: templates/default/bbpress/loop-forums.php:21
53
+ msgid "Topics"
54
+ msgstr ""
55
+
56
+ #: includes/admin/actions.php:180 includes/admin/actions.php:192
57
+ #: includes/admin/forums.php:523 includes/admin/settings.php:288
58
+ #: includes/admin/settings.php:309 includes/admin/tools/common.php:320
59
+ #: includes/admin/topics.php:387 includes/admin/topics.php:833
60
+ #: includes/core/theme-compat.php:694
61
+ #: includes/extend/buddypress/activity.php:207
62
+ #: includes/extend/buddypress/activity.php:390
63
+ #: includes/forums/template.php:2645 includes/replies/template.php:49
64
+ #: includes/replies/template.php:50
65
+ #: templates/default/bbpress/content-statistics.php:35
66
+ #: templates/default/bbpress/loop-forums.php:23
67
+ #: templates/default/bbpress/loop-replies.php:20
68
+ #: templates/default/bbpress/loop-replies.php:46
69
+ #: templates/default/bbpress/loop-topics.php:21
70
+ msgid "Replies"
71
+ msgstr ""
72
+
73
+ #: includes/admin/actions.php:187 includes/admin/actions.php:199
74
+ #: includes/admin/forums.php:521 includes/admin/metaboxes.php:113
75
+ #: includes/admin/metaboxes.php:432 includes/admin/metaboxes.php:496
76
+ #: includes/admin/replies.php:644 includes/admin/settings.php:351
77
+ #: includes/admin/topics.php:832 includes/extend/buddypress/groups.php:50
78
+ #: includes/extend/buddypress/groups.php:51 includes/forums/template.php:50
79
+ #: templates/default/bbpress/loop-forums.php:20
80
+ msgid "Forum"
81
+ msgstr ""
82
+
83
+ #: includes/admin/actions.php:204 includes/admin/metaboxes.php:130
84
+ #: includes/admin/metaboxes.php:523 includes/admin/replies.php:645
85
+ #: includes/admin/settings.php:359 includes/topics/template.php:49
86
+ #: templates/default/bbpress/content-single-topic-lead.php:23
87
+ #: templates/default/bbpress/content-single-topic-lead.php:91
88
+ #: templates/default/bbpress/loop-topics.php:18
89
+ msgid "Topic"
90
+ msgstr ""
91
+
92
+ #: includes/admin/classes/class-bbp-admin.php:207
93
+ msgid "Go Upgrade"
94
+ msgstr ""
95
+
96
+ #: includes/admin/classes/class-bbp-admin.php:208
97
+ msgid "Hide Forever"
98
+ msgstr ""
99
+
100
+ #: includes/admin/classes/class-bbp-admin.php:211
101
+ msgid "bbPress requires a manual database upgrade. %s or %s"
102
+ msgstr ""
103
+
104
+ #: includes/admin/classes/class-bbp-admin.php:283
105
+ #: includes/admin/classes/class-bbp-admin.php:284
106
+ #: includes/admin/classes/class-bbp-admin.php:293
107
+ #: includes/admin/classes/class-bbp-admin.php:294
108
+ #: includes/admin/tools/common.php:314 includes/admin/tools.php:30
109
+ #: includes/admin/users.php:93 includes/common/widgets.php:622
110
+ #: includes/extend/buddypress/loader.php:42
111
+ #: includes/extend/buddypress/loader.php:177
112
+ #: includes/extend/buddypress/loader.php:299
113
+ #: includes/extend/buddypress/loader.php:364 includes/forums/template.php:48
114
+ #: includes/forums/template.php:49
115
+ #: templates/default/bbpress/content-statistics.php:25
116
+ #: templates/default/bbpress/user-profile.php:34
117
+ msgid "Forums"
118
+ msgstr ""
119
+
120
+ #: includes/admin/classes/class-bbp-admin.php:306
121
+ #: includes/admin/classes/class-bbp-admin.php:307
122
+ #: includes/admin/classes/class-bbp-admin.php:315
123
+ #: includes/admin/classes/class-bbp-admin.php:316
124
+ msgid "Welcome to bbPress"
125
+ msgstr ""
126
+
127
+ #: includes/admin/classes/class-bbp-admin.php:330
128
+ #: includes/admin/classes/class-bbp-admin.php:331
129
+ #: includes/admin/classes/class-bbp-admin.php:352
130
+ #: includes/admin/classes/class-bbp-admin.php:353
131
+ #: includes/admin/classes/class-bbp-admin.php:1083
132
+ #: includes/admin/classes/class-bbp-admin.php:1180
133
+ msgid "Update Forums"
134
+ msgstr ""
135
+
136
+ #: includes/admin/classes/class-bbp-admin.php:564
137
+ msgid "Settings"
138
+ msgstr ""
139
+
140
+ #: includes/admin/classes/class-bbp-admin.php:569
141
+ msgid "About"
142
+ msgstr ""
143
+
144
+ #: includes/admin/classes/class-bbp-admin.php:747
145
+ #: includes/admin/classes/class-bbp-admin.php:784
146
+ msgid "%s - %s"
147
+ msgstr ""
148
+
149
+ #: includes/admin/classes/class-bbp-admin.php:802
150
+ msgid "Welcome to bbPress %s"
151
+ msgstr ""
152
+
153
+ #: includes/admin/classes/class-bbp-admin.php:803
154
+ msgid ""
155
+ "bbPress is fun to use, contains no artificial colors or preservatives, and "
156
+ "is absolutely wonderful in every environment. Your community is going to "
157
+ "love using it."
158
+ msgstr ""
159
+
160
+ #: includes/admin/classes/class-bbp-admin.php:829
161
+ #: includes/admin/classes/class-bbp-admin.php:903
162
+ msgid "What&#8217;s New"
163
+ msgstr ""
164
+
165
+ #: includes/admin/classes/class-bbp-admin.php:831
166
+ #: includes/admin/classes/class-bbp-admin.php:905
167
+ msgid "Credits"
168
+ msgstr ""
169
+
170
+ #: includes/admin/classes/class-bbp-admin.php:836
171
+ msgid "Forum Subscriptions"
172
+ msgstr ""
173
+
174
+ #: includes/admin/classes/class-bbp-admin.php:840
175
+ msgid "Subscribe to Forums"
176
+ msgstr ""
177
+
178
+ #: includes/admin/classes/class-bbp-admin.php:841
179
+ msgid "Now your users can subscribe to new topics in specific forums."
180
+ msgstr ""
181
+
182
+ #: includes/admin/classes/class-bbp-admin.php:845
183
+ msgid "Manage Subscriptions"
184
+ msgstr ""
185
+
186
+ #: includes/admin/classes/class-bbp-admin.php:846
187
+ msgid "Your users can manage all of their subscriptions in one convenient location."
188
+ msgstr ""
189
+
190
+ #: includes/admin/classes/class-bbp-admin.php:852
191
+ msgid "Converters"
192
+ msgstr ""
193
+
194
+ #: includes/admin/classes/class-bbp-admin.php:856
195
+ msgid ""
196
+ "We&#8217;re all abuzz about the hive of new importers, AEF, Drupal, FluxBB, "
197
+ "Kunena Forums for Joomla, MyBB, Phorum, PHPFox, PHPWind, PunBB, SMF, "
198
+ "Xenforo and XMB. Existing importers are now sweeter than honey with "
199
+ "improved importing stickies, topic tags, forum categories and the sting is "
200
+ "now gone if you need to remove imported users."
201
+ msgstr ""
202
+
203
+ #: includes/admin/classes/class-bbp-admin.php:862
204
+ msgid "Theme Compatibility"
205
+ msgstr ""
206
+
207
+ #: includes/admin/classes/class-bbp-admin.php:863
208
+ msgid "Better handling of styles and scripts in the template stack."
209
+ msgstr ""
210
+
211
+ #: includes/admin/classes/class-bbp-admin.php:867
212
+ msgid "Polyglot support"
213
+ msgstr ""
214
+
215
+ #: includes/admin/classes/class-bbp-admin.php:868
216
+ msgid "bbPress fully supports automatic translation updates."
217
+ msgstr ""
218
+
219
+ #: includes/admin/classes/class-bbp-admin.php:872
220
+ msgid "User capabilities"
221
+ msgstr ""
222
+
223
+ #: includes/admin/classes/class-bbp-admin.php:873
224
+ msgid "Roles and capabilities have been swept through, cleaned up, and simplified."
225
+ msgstr ""
226
+
227
+ #: includes/admin/classes/class-bbp-admin.php:879
228
+ #: includes/admin/classes/class-bbp-admin.php:1019
229
+ msgid "Go to Forum Settings"
230
+ msgstr ""
231
+
232
+ #: includes/admin/classes/class-bbp-admin.php:909
233
+ msgid "bbPress is created by a worldwide swarm of busy, busy bees."
234
+ msgstr ""
235
+
236
+ #: includes/admin/classes/class-bbp-admin.php:911
237
+ msgid "Project Leaders"
238
+ msgstr ""
239
+
240
+ #: includes/admin/classes/class-bbp-admin.php:915
241
+ msgid "Founding Developer"
242
+ msgstr ""
243
+
244
+ #: includes/admin/classes/class-bbp-admin.php:919
245
+ msgid "Lead Developer"
246
+ msgstr ""
247
+
248
+ #: includes/admin/classes/class-bbp-admin.php:923
249
+ msgid "Feature Virtuoso"
250
+ msgstr ""
251
+
252
+ #: includes/admin/classes/class-bbp-admin.php:927
253
+ msgid "Tool Maven"
254
+ msgstr ""
255
+
256
+ #: includes/admin/classes/class-bbp-admin.php:931
257
+ msgid "Contributing Developers"
258
+ msgstr ""
259
+
260
+ #: includes/admin/classes/class-bbp-admin.php:935
261
+ #: includes/admin/classes/class-bbp-admin.php:939
262
+ msgid "Core Developer"
263
+ msgstr ""
264
+
265
+ #: includes/admin/classes/class-bbp-admin.php:943
266
+ msgid "Project Emeriti"
267
+ msgstr ""
268
+
269
+ #: includes/admin/classes/class-bbp-admin.php:947
270
+ msgid "Feature Developer"
271
+ msgstr ""
272
+
273
+ #: includes/admin/classes/class-bbp-admin.php:951
274
+ msgid "Integration Testing"
275
+ msgstr ""
276
+
277
+ #: includes/admin/classes/class-bbp-admin.php:955
278
+ msgid "Contributors to bbPress 2.6"
279
+ msgstr ""
280
+
281
+ #: includes/admin/classes/class-bbp-admin.php:1040
282
+ #: includes/admin/classes/class-bbp-admin.php:1062
283
+ msgid "Update Forum"
284
+ msgstr ""
285
+
286
+ #: includes/admin/classes/class-bbp-admin.php:1051
287
+ #: includes/admin/classes/class-bbp-admin.php:1100
288
+ msgid "All done!"
289
+ msgstr ""
290
+
291
+ #: includes/admin/classes/class-bbp-admin.php:1052
292
+ #: includes/admin/classes/class-bbp-admin.php:1101
293
+ msgid "Go Back"
294
+ msgstr ""
295
+
296
+ #: includes/admin/classes/class-bbp-admin.php:1061
297
+ msgid "You can update your forum through this page. Hit the link below to update."
298
+ msgstr ""
299
+
300
+ #: includes/admin/classes/class-bbp-admin.php:1135
301
+ msgid ""
302
+ "Warning! Problem updating %1$s. Your server may not be able to connect to "
303
+ "sites running on it. Error message: %2$s"
304
+ msgstr ""
305
+
306
+ #: includes/admin/classes/class-bbp-admin.php:1160
307
+ msgid ""
308
+ "If your browser doesn&#8217;t start loading the next page automatically, "
309
+ "click this link:"
310
+ msgstr ""
311
+
312
+ #: includes/admin/classes/class-bbp-admin.php:1161
313
+ msgid "Next Forums"
314
+ msgstr ""
315
+
316
+ #: includes/admin/classes/class-bbp-admin.php:1179
317
+ msgid ""
318
+ "You can update all the forums on your network through this page. It works "
319
+ "by calling the update script of each site automatically. Hit the link below "
320
+ "to update."
321
+ msgstr ""
322
+
323
+ #: includes/admin/classes/class-bbp-converter-base.php:157
324
+ msgid "Database connection failed."
325
+ msgstr ""
326
+
327
+ #: includes/admin/classes/class-bbp-converter.php:162
328
+ #: includes/admin/settings.php:1768
329
+ msgid "Start"
330
+ msgstr ""
331
+
332
+ #: includes/admin/classes/class-bbp-converter.php:163
333
+ msgid "Continue"
334
+ msgstr ""
335
+
336
+ #: includes/admin/classes/class-bbp-converter.php:166
337
+ msgid "Starting Import..."
338
+ msgstr ""
339
+
340
+ #: includes/admin/classes/class-bbp-converter.php:167
341
+ msgid "Continuing Import..."
342
+ msgstr ""
343
+
344
+ #: includes/admin/classes/class-bbp-converter.php:170
345
+ msgid "Import Finished."
346
+ msgstr ""
347
+
348
+ #: includes/admin/classes/class-bbp-converter.php:171
349
+ msgid "Import Stopped (by User.)"
350
+ msgstr ""
351
+
352
+ #: includes/admin/classes/class-bbp-converter.php:172
353
+ msgid "Import Halted (Error.)"
354
+ msgstr ""
355
+
356
+ #: includes/admin/classes/class-bbp-converter.php:173
357
+ msgid "Database Connection Failed."
358
+ msgstr ""
359
+
360
+ #: includes/admin/classes/class-bbp-converter.php:176
361
+ msgid "Finished"
362
+ msgstr ""
363
+
364
+ #: includes/admin/classes/class-bbp-converter.php:177
365
+ msgid "Stopped"
366
+ msgstr ""
367
+
368
+ #: includes/admin/classes/class-bbp-converter.php:178
369
+ msgid "Starting"
370
+ msgstr ""
371
+
372
+ #: includes/admin/classes/class-bbp-converter.php:179
373
+ msgid "Doing step %s..."
374
+ msgstr ""
375
+
376
+ #: includes/admin/classes/class-bbp-converter.php:180
377
+ msgid "Next in %s seconds..."
378
+ msgstr ""
379
+
380
+ #: includes/admin/classes/class-bbp-converter.php:465
381
+ msgid "Readying sync-table"
382
+ msgstr ""
383
+
384
+ #: includes/admin/classes/class-bbp-converter.php:466
385
+ msgid "Sync-table ready"
386
+ msgstr ""
387
+
388
+ #: includes/admin/classes/class-bbp-converter.php:469
389
+ msgid "Deleting previously converted data (%1$s through %2$s of %3$s)"
390
+ msgstr ""
391
+
392
+ #: includes/admin/classes/class-bbp-converter.php:476
393
+ msgid "Skipping sync-table clean-up"
394
+ msgstr ""
395
+
396
+ #: includes/admin/classes/class-bbp-converter.php:491
397
+ msgid "No users to import"
398
+ msgstr ""
399
+
400
+ #: includes/admin/classes/class-bbp-converter.php:492
401
+ msgid "All users imported"
402
+ msgstr ""
403
+
404
+ #: includes/admin/classes/class-bbp-converter.php:495
405
+ msgid "Converting users (%1$s through %2$s of %3$s)"
406
+ msgstr ""
407
+
408
+ #: includes/admin/classes/class-bbp-converter.php:499
409
+ msgid "Skipping user clean-up"
410
+ msgstr ""
411
+
412
+ #: includes/admin/classes/class-bbp-converter.php:514
413
+ msgid "No passwords to clear"
414
+ msgstr ""
415
+
416
+ #: includes/admin/classes/class-bbp-converter.php:515
417
+ msgid "All passwords cleared"
418
+ msgstr ""
419
+
420
+ #: includes/admin/classes/class-bbp-converter.php:518
421
+ msgid "Delete default WordPress user passwords (%1$s through %2$s of %3$s)"
422
+ msgstr ""
423
+
424
+ #: includes/admin/classes/class-bbp-converter.php:522
425
+ msgid "Skipping password clean-up"
426
+ msgstr ""
427
+
428
+ #: includes/admin/classes/class-bbp-converter.php:536
429
+ msgid "No forums to import"
430
+ msgstr ""
431
+
432
+ #: includes/admin/classes/class-bbp-converter.php:537
433
+ msgid "All forums imported"
434
+ msgstr ""
435
+
436
+ #: includes/admin/classes/class-bbp-converter.php:540
437
+ msgid "Converting forums (%1$s through %2$s of %3$s)"
438
+ msgstr ""
439
+
440
+ #: includes/admin/classes/class-bbp-converter.php:554
441
+ msgid "No forum parents to import"
442
+ msgstr ""
443
+
444
+ #: includes/admin/classes/class-bbp-converter.php:555
445
+ msgid "All forum parents imported"
446
+ msgstr ""
447
+
448
+ #: includes/admin/classes/class-bbp-converter.php:558
449
+ msgid "Calculating forum hierarchy (%1$s through %2$s of %3$s)"
450
+ msgstr ""
451
+
452
+ #: includes/admin/classes/class-bbp-converter.php:572
453
+ msgid "No forum subscriptions to import"
454
+ msgstr ""
455
+
456
+ #: includes/admin/classes/class-bbp-converter.php:573
457
+ msgid "All forum subscriptions imported"
458
+ msgstr ""
459
+
460
+ #: includes/admin/classes/class-bbp-converter.php:576
461
+ msgid "Converting forum subscriptions (%1$s through %2$s of %3$s)"
462
+ msgstr ""
463
+
464
+ #: includes/admin/classes/class-bbp-converter.php:590
465
+ msgid "No topics to import"
466
+ msgstr ""
467
+
468
+ #: includes/admin/classes/class-bbp-converter.php:591
469
+ msgid "All topics imported"
470
+ msgstr ""
471
+
472
+ #: includes/admin/classes/class-bbp-converter.php:594
473
+ msgid "Converting topics (%1$s through %2$s of %3$s)"
474
+ msgstr ""
475
+
476
+ #: includes/admin/classes/class-bbp-converter.php:608
477
+ msgid "No anonymous topic authors to import"
478
+ msgstr ""
479
+
480
+ #: includes/admin/classes/class-bbp-converter.php:609
481
+ msgid "All anonymous topic authors imported"
482
+ msgstr ""
483
+
484
+ #: includes/admin/classes/class-bbp-converter.php:612
485
+ msgid "Converting anonymous topic authors (%1$s through %2$s of %3$s)"
486
+ msgstr ""
487
+
488
+ #: includes/admin/classes/class-bbp-converter.php:626
489
+ msgid "No stickies to import"
490
+ msgstr ""
491
+
492
+ #: includes/admin/classes/class-bbp-converter.php:627
493
+ msgid "All stickies imported"
494
+ msgstr ""
495
+
496
+ #: includes/admin/classes/class-bbp-converter.php:630
497
+ msgid "Calculating topic stickies (%1$s through %2$s of %3$s)"
498
+ msgstr ""
499
+
500
+ #: includes/admin/classes/class-bbp-converter.php:644
501
+ msgid "No super stickies to import"
502
+ msgstr ""
503
+
504
+ #: includes/admin/classes/class-bbp-converter.php:645
505
+ msgid "All super stickies imported"
506
+ msgstr ""
507
+
508
+ #: includes/admin/classes/class-bbp-converter.php:648
509
+ msgid "Calculating topic super stickies (%1$s through %2$s of %3$s)"
510
+ msgstr ""
511
+
512
+ #: includes/admin/classes/class-bbp-converter.php:662
513
+ msgid "No closed topics to import"
514
+ msgstr ""
515
+
516
+ #: includes/admin/classes/class-bbp-converter.php:663
517
+ msgid "All closed topics imported"
518
+ msgstr ""
519
+
520
+ #: includes/admin/classes/class-bbp-converter.php:666
521
+ msgid "Calculating closed topics (%1$s through %2$s of %3$s)"
522
+ msgstr ""
523
+
524
+ #: includes/admin/classes/class-bbp-converter.php:680
525
+ msgid "No topic tags to import"
526
+ msgstr ""
527
+
528
+ #: includes/admin/classes/class-bbp-converter.php:681
529
+ msgid "All topic tags imported"
530
+ msgstr ""
531
+
532
+ #: includes/admin/classes/class-bbp-converter.php:684
533
+ msgid "Converting topic tags (%1$s through %2$s of %3$s)"
534
+ msgstr ""
535
+
536
+ #: includes/admin/classes/class-bbp-converter.php:698
537
+ msgid "No topic subscriptions to import"
538
+ msgstr ""
539
+
540
+ #: includes/admin/classes/class-bbp-converter.php:699
541
+ msgid "All topic subscriptions imported"
542
+ msgstr ""
543
+
544
+ #: includes/admin/classes/class-bbp-converter.php:702
545
+ msgid "Converting topic subscriptions (%1$s through %2$s of %3$s)"
546
+ msgstr ""
547
+
548
+ #: includes/admin/classes/class-bbp-converter.php:716
549
+ msgid "No favorites to import"
550
+ msgstr ""
551
+
552
+ #: includes/admin/classes/class-bbp-converter.php:717
553
+ msgid "All favorites imported"
554
+ msgstr ""
555
+
556
+ #: includes/admin/classes/class-bbp-converter.php:720
557
+ msgid "Converting favorites (%1$s through %2$s of %3$s)"
558
+ msgstr ""
559
+
560
+ #: includes/admin/classes/class-bbp-converter.php:734
561
+ msgid "No replies to import"
562
+ msgstr ""
563
+
564
+ #: includes/admin/classes/class-bbp-converter.php:735
565
+ msgid "All replies imported"
566
+ msgstr ""
567
+
568
+ #: includes/admin/classes/class-bbp-converter.php:738
569
+ msgid "Converting replies (%1$s through %2$s of %3$s)"
570
+ msgstr ""
571
+
572
+ #: includes/admin/classes/class-bbp-converter.php:752
573
+ msgid "No anonymous reply authors to import"
574
+ msgstr ""
575
+
576
+ #: includes/admin/classes/class-bbp-converter.php:753
577
+ msgid "All anonymous reply authors imported"
578
+ msgstr ""
579
+
580
+ #: includes/admin/classes/class-bbp-converter.php:756
581
+ msgid "Converting anonymous reply authors (%1$s through %2$s of %3$s)"
582
+ msgstr ""
583
+
584
+ #: includes/admin/classes/class-bbp-converter.php:770
585
+ msgid "No threaded replies to import"
586
+ msgstr ""
587
+
588
+ #: includes/admin/classes/class-bbp-converter.php:771
589
+ msgid "All threaded replies imported"
590
+ msgstr ""
591
+
592
+ #: includes/admin/classes/class-bbp-converter.php:774
593
+ msgid "Calculating threaded replies parents (%1$s through %2$s of %3$s)"
594
+ msgstr ""
595
+
596
+ #: includes/admin/classes/class-bbp-converter.php:785
597
+ msgid "Import Finished"
598
+ msgstr ""
599
+
600
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:56
601
+ #: includes/admin/replies.php:646 includes/admin/topics.php:835
602
+ #: templates/default/bbpress/loop-replies.php:18
603
+ #: templates/default/bbpress/loop-replies.php:44
604
+ #: templates/default/bbpress/loop-search.php:19
605
+ #: templates/default/bbpress/loop-search.php:41
606
+ msgid "Author"
607
+ msgstr ""
608
+
609
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:57
610
+ msgid "Content"
611
+ msgstr ""
612
+
613
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:58
614
+ msgid "Replied"
615
+ msgstr ""
616
+
617
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:87
618
+ msgid "Unapprove"
619
+ msgstr ""
620
+
621
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:88
622
+ #: includes/admin/replies.php:232 includes/admin/replies.php:798
623
+ #: includes/admin/topics.php:237 includes/admin/topics.php:994
624
+ #: includes/replies/template.php:1970 includes/topics/template.php:2821
625
+ msgid "Spam"
626
+ msgstr ""
627
+
628
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:89
629
+ #: includes/admin/replies.php:811 includes/admin/topics.php:1006
630
+ #: includes/replies/template.php:1902 includes/topics/template.php:2529
631
+ msgid "Trash"
632
+ msgstr ""
633
+
634
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:141
635
+ #: includes/admin/replies.php:774 includes/admin/topics.php:950
636
+ #: includes/admin/topics.php:963 includes/admin/users.php:260
637
+ msgid "View"
638
+ msgstr ""
639
+
640
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:146
641
+ #: includes/common/template.php:2257 includes/forums/template.php:54
642
+ #: includes/replies/template.php:55 includes/replies/template.php:1790
643
+ #: includes/topics/template.php:53 includes/topics/template.php:2417
644
+ #: templates/default/bbpress/user-details.php:74
645
+ msgid "Edit"
646
+ msgstr ""
647
+
648
+ #: includes/admin/classes/class-bbp-topic-replies-list-table.php:232
649
+ msgid "No replies to this topic."
650
+ msgstr ""
651
+
652
+ #: includes/admin/forums.php:101 includes/admin/replies.php:112
653
+ #: includes/admin/settings.php:1844 includes/admin/tools/help.php:95
654
+ #: includes/admin/topics.php:116
655
+ msgid "Overview"
656
+ msgstr ""
657
+
658
+ #: includes/admin/forums.php:103
659
+ msgid ""
660
+ "This screen displays the individual forums on your site. You can customize "
661
+ "the display of this screen to suit your workflow."
662
+ msgstr ""
663
+
664
+ #: includes/admin/forums.php:109 includes/admin/replies.php:120
665
+ #: includes/admin/topics.php:124
666
+ msgid "Screen Content"
667
+ msgstr ""
668
+
669
+ #: includes/admin/forums.php:111 includes/admin/replies.php:122
670
+ #: includes/admin/topics.php:126
671
+ msgid ""
672
+ "You can customize the display of this screen&#8217;s contents in a number "
673
+ "of ways:"
674
+ msgstr ""
675
+
676
+ #: includes/admin/forums.php:113
677
+ msgid ""
678
+ "You can hide/display columns based on your needs and decide how many forums "
679
+ "to list per screen using the Screen Options tab."
680
+ msgstr ""
681
+
682
+ #: includes/admin/forums.php:114
683
+ msgid ""
684
+ "You can filter the list of forums by forum status using the text links in "
685
+ "the upper left to show All, Published, or Trashed forums. The default view "
686
+ "is to show all forums."
687
+ msgstr ""
688
+
689
+ #: includes/admin/forums.php:115
690
+ msgid ""
691
+ "You can refine the list to show only forums from a specific month by using "
692
+ "the dropdown menus above the forums list. Click the Filter button after "
693
+ "making your selection. You also can refine the list by clicking on the "
694
+ "forum creator in the forums list."
695
+ msgstr ""
696
+
697
+ #: includes/admin/forums.php:122 includes/admin/replies.php:134
698
+ #: includes/admin/topics.php:138
699
+ msgid "Available Actions"
700
+ msgstr ""
701
+
702
+ #: includes/admin/forums.php:124
703
+ msgid ""
704
+ "Hovering over a row in the forums list will display action links that allow "
705
+ "you to manage your forum. You can perform the following actions:"
706
+ msgstr ""
707
+
708
+ #: includes/admin/forums.php:126
709
+ msgid ""
710
+ "<strong>Edit</strong> takes you to the editing screen for that forum. You "
711
+ "can also reach that screen by clicking on the forum title."
712
+ msgstr ""
713
+
714
+ #: includes/admin/forums.php:127
715
+ msgid ""
716
+ "<strong>Trash</strong> removes your forum from this list and places it in "
717
+ "the trash, from which you can permanently delete it."
718
+ msgstr ""
719
+
720
+ #: includes/admin/forums.php:128
721
+ msgid ""
722
+ "<strong>View</strong> will show you what your draft forum will look like if "
723
+ "you publish it. View will take you to your live site to view the forum. "
724
+ "Which link is available depends on your forum&#8217;s status."
725
+ msgstr ""
726
+
727
+ #: includes/admin/forums.php:135 includes/admin/replies.php:150
728
+ #: includes/admin/tools/repair.php:47 includes/admin/tools/repair.php:149
729
+ #: includes/admin/tools/upgrade.php:44 includes/admin/tools/upgrade.php:146
730
+ #: includes/admin/topics.php:156
731
+ msgid "Bulk Actions"
732
+ msgstr ""
733
+
734
+ #: includes/admin/forums.php:137
735
+ msgid ""
736
+ "You can also edit or move multiple forums to the trash at once. Select the "
737
+ "forums you want to act on using the checkboxes, then select the action you "
738
+ "want to take from the Bulk Actions menu and click Apply."
739
+ msgstr ""
740
+
741
+ #: includes/admin/forums.php:138
742
+ msgid ""
743
+ "When using Bulk Edit, you can change the metadata (categories, author, "
744
+ "etc.) for all selected forums at once. To remove a forum from the grouping, "
745
+ "just click the x next to its name in the Bulk Edit area that appears."
746
+ msgstr ""
747
+
748
+ #: includes/admin/forums.php:143 includes/admin/forums.php:199
749
+ #: includes/admin/replies.php:158 includes/admin/replies.php:212
750
+ #: includes/admin/settings.php:1910 includes/admin/tools/help.php:43
751
+ #: includes/admin/tools/help.php:72 includes/admin/tools/help.php:130
752
+ #: includes/admin/topics.php:164 includes/admin/topics.php:217
753
+ msgid "For more information:"
754
+ msgstr ""
755
+
756
+ #: includes/admin/forums.php:144 includes/admin/forums.php:200
757
+ #: includes/admin/replies.php:159 includes/admin/replies.php:213
758
+ #: includes/admin/settings.php:1911 includes/admin/tools/help.php:44
759
+ #: includes/admin/tools/help.php:73 includes/admin/tools/help.php:131
760
+ #: includes/admin/topics.php:165 includes/admin/topics.php:218
761
+ msgid ""
762
+ "<a href=\"https://codex.bbpress.org\" target=\"_blank\">bbPress "
763
+ "Documentation</a>"
764
+ msgstr ""
765
+
766
+ #: includes/admin/forums.php:145 includes/admin/forums.php:201
767
+ #: includes/admin/replies.php:160 includes/admin/replies.php:214
768
+ #: includes/admin/settings.php:1912 includes/admin/tools/help.php:45
769
+ #: includes/admin/tools/help.php:74 includes/admin/tools/help.php:132
770
+ #: includes/admin/topics.php:166 includes/admin/topics.php:219
771
+ msgid ""
772
+ "<a href=\"https://bbpress.org/forums/\" target=\"_blank\">bbPress Support "
773
+ "Forums</a>"
774
+ msgstr ""
775
+
776
+ #: includes/admin/forums.php:156
777
+ msgid ""
778
+ "The title field and the big forum editing Area are fixed in place, but you "
779
+ "can reposition all the other boxes using drag and drop, and can minimize or "
780
+ "expand them by clicking the title bar of each box. Use the Screen Options "
781
+ "tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, "
782
+ "Discussion, Slug, Author) or to choose a 1- or 2-column layout for this "
783
+ "screen."
784
+ msgstr ""
785
+
786
+ #: includes/admin/forums.php:160 includes/admin/replies.php:175
787
+ #: includes/admin/topics.php:181
788
+ msgid "Customizing This Display"
789
+ msgstr ""
790
+
791
+ #: includes/admin/forums.php:166
792
+ msgid "Title and Forum Editor"
793
+ msgstr ""
794
+
795
+ #: includes/admin/forums.php:168
796
+ msgid ""
797
+ "<strong>Title</strong> - Enter a title for your forum. After you enter a "
798
+ "title, you&#8217;ll see the permalink below, which you can edit."
799
+ msgstr ""
800
+
801
+ #: includes/admin/forums.php:169
802
+ msgid ""
803
+ "<strong>Forum Editor</strong> - Enter the text for your forum. There are "
804
+ "two modes of editing: Visual and HTML. Choose the mode by clicking on the "
805
+ "appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last "
806
+ "icon in the row to get a second row of controls. The HTML mode allows you "
807
+ "to enter raw HTML along with your forum text. You can insert media files by "
808
+ "clicking the icons above the forum editor and following the directions. You "
809
+ "can go to the distraction-free writing screen via the Fullscreen icon in "
810
+ "Visual mode (second to last in the top row) or the Fullscreen button in "
811
+ "HTML mode (last in the row). Once there, you can make buttons visible by "
812
+ "hovering over the top area. Exit Fullscreen back to the regular forum "
813
+ "editor."
814
+ msgstr ""
815
+
816
+ #: includes/admin/forums.php:172
817
+ msgid ""
818
+ "<strong>Publish</strong> - You can set the terms of publishing your forum "
819
+ "in the Publish box. For Status, Visibility, and Publish (immediately), "
820
+ "click on the Edit link to reveal more options. Visibility includes options "
821
+ "for password-protecting a forum or making it stay at the top of your blog "
822
+ "indefinitely (sticky). Publish (immediately) allows you to set a future or "
823
+ "past date and time, so you can schedule a forum to be published in the "
824
+ "future or backdate a forum."
825
+ msgstr ""
826
+
827
+ #: includes/admin/forums.php:175
828
+ msgid ""
829
+ "<strong>Featured Image</strong> - This allows you to associate an image "
830
+ "with your forum without inserting it. This is usually useful only if your "
831
+ "theme makes use of the featured image as a forum thumbnail on the home "
832
+ "page, a custom header, etc."
833
+ msgstr ""
834
+
835
+ #: includes/admin/forums.php:180 includes/admin/forums.php:213
836
+ msgid "Forum Attributes"
837
+ msgstr ""
838
+
839
+ #: includes/admin/forums.php:182
840
+ msgid "Select the attributes that your forum should have:"
841
+ msgstr ""
842
+
843
+ #: includes/admin/forums.php:184
844
+ msgid ""
845
+ "<strong>Type</strong> indicates if the forum is a category or forum. "
846
+ "Categories generally contain other forums."
847
+ msgstr ""
848
+
849
+ #: includes/admin/forums.php:185
850
+ msgid ""
851
+ "<strong>Status</strong> allows you to close a forum to new topics and "
852
+ "forums."
853
+ msgstr ""
854
+
855
+ #: includes/admin/forums.php:186
856
+ msgid ""
857
+ "<strong>Visibility</strong> lets you pick the scope of each forum and what "
858
+ "users are allowed to access it."
859
+ msgstr ""
860
+
861
+ #: includes/admin/forums.php:187
862
+ msgid ""
863
+ "<strong>Parent</strong> dropdown determines the parent forum. Select the "
864
+ "forum or category from the dropdown, or leave the default \"No parent\" to "
865
+ "create the forum at the root of your forums."
866
+ msgstr ""
867
+
868
+ #: includes/admin/forums.php:188
869
+ msgid "<strong>Order</strong> allows you to order your forums numerically."
870
+ msgstr ""
871
+
872
+ #: includes/admin/forums.php:194 includes/admin/replies.php:207
873
+ #: includes/admin/topics.php:212
874
+ msgid "Publish Box"
875
+ msgstr ""
876
+
877
+ #: includes/admin/forums.php:236 includes/admin/settings.php:208
878
+ #: includes/admin/tools/reset.php:41
879
+ msgid "Forum Moderators"
880
+ msgstr ""
881
+
882
+ #: includes/admin/forums.php:266 includes/admin/settings.php:184
883
+ #: includes/admin/settings.php:436 includes/admin/tools/common.php:332
884
+ #: includes/admin/topics.php:477 includes/extend/buddypress/loader.php:248
885
+ #: templates/default/bbpress/user-details.php:67
886
+ msgid "Subscriptions"
887
+ msgstr ""
888
+
889
+ #: includes/admin/forums.php:360
890
+ msgid "The forum was not found."
891
+ msgstr ""
892
+
893
+ #: includes/admin/forums.php:365 includes/admin/replies.php:461
894
+ #: includes/admin/topics.php:579
895
+ msgid "You do not have permission to do that."
896
+ msgstr ""
897
+
898
+ #: includes/admin/forums.php:450
899
+ msgid "There was a problem opening the forum \"%1$s\"."
900
+ msgstr ""
901
+
902
+ #: includes/admin/forums.php:451
903
+ msgid "Forum \"%1$s\" successfully opened."
904
+ msgstr ""
905
+
906
+ #: includes/admin/forums.php:456
907
+ msgid "There was a problem closing the forum \"%1$s\"."
908
+ msgstr ""
909
+
910
+ #: includes/admin/forums.php:457
911
+ msgid "Forum \"%1$s\" successfully closed."
912
+ msgstr ""
913
+
914
+ #: includes/admin/forums.php:524 includes/admin/metaboxes.php:659
915
+ msgid "Moderators"
916
+ msgstr ""
917
+
918
+ #: includes/admin/forums.php:525
919
+ #: templates/default/bbpress/content-single-topic-lead.php:19
920
+ #: templates/default/bbpress/content-single-topic-lead.php:87
921
+ msgid "Creator"
922
+ msgstr ""
923
+
924
+ #: includes/admin/forums.php:526 includes/admin/replies.php:647
925
+ #: includes/admin/topics.php:836
926
+ msgid "Created"
927
+ msgstr ""
928
+
929
+ #: includes/admin/forums.php:527 includes/admin/topics.php:837
930
+ #: templates/default/bbpress/loop-forums.php:26
931
+ #: templates/default/bbpress/loop-topics.php:24
932
+ msgid "Last Post"
933
+ msgstr ""
934
+
935
+ #: includes/admin/forums.php:562
936
+ msgid "&mdash;"
937
+ msgstr ""
938
+
939
+ #: includes/admin/forums.php:579 includes/forums/template.php:560
940
+ msgid "No Topics"
941
+ msgstr ""
942
+
943
+ #: includes/admin/forums.php:613
944
+ msgid "Close this forum"
945
+ msgstr ""
946
+
947
+ #: includes/admin/forums.php:615
948
+ msgid "Open this forum"
949
+ msgstr ""
950
+
951
+ #: includes/admin/forums.php:653 includes/admin/forums.php:665
952
+ msgid "Forum updated."
953
+ msgstr ""
954
+
955
+ #: includes/admin/forums.php:655 includes/admin/forums.php:678
956
+ msgid "View forum"
957
+ msgstr ""
958
+
959
+ #: includes/admin/forums.php:659 includes/admin/replies.php:910
960
+ #: includes/admin/topics.php:1105
961
+ msgid "Custom field updated."
962
+ msgstr ""
963
+
964
+ #: includes/admin/forums.php:662 includes/admin/replies.php:913
965
+ #: includes/admin/topics.php:1108
966
+ msgid "Custom field deleted."
967
+ msgstr ""
968
+
969
+ #: includes/admin/forums.php:670
970
+ #. translators: %s: date and time of the revision
971
+ msgid "Forum restored to revision from %s"
972
+ msgstr ""
973
+
974
+ #: includes/admin/forums.php:676
975
+ msgid "Forum created."
976
+ msgstr ""
977
+
978
+ #: includes/admin/forums.php:682
979
+ msgid "Forum saved."
980
+ msgstr ""
981
+
982
+ #: includes/admin/forums.php:687
983
+ msgid "Forum submitted."
984
+ msgstr ""
985
+
986
+ #: includes/admin/forums.php:689 includes/admin/forums.php:701
987
+ #: includes/admin/forums.php:709
988
+ msgid "Preview forum"
989
+ msgstr ""
990
+
991
+ #: includes/admin/forums.php:696
992
+ msgid "Forum scheduled for: %s."
993
+ msgstr ""
994
+
995
+ #: includes/admin/forums.php:698 includes/admin/replies.php:949
996
+ #: includes/admin/topics.php:1144
997
+ #. translators: Publish box date format, see http:php.net/date
998
+ msgid "M j, Y @ G:i"
999
+ msgstr ""
1000
+
1001
+ #: includes/admin/forums.php:707
1002
+ msgid "Forum draft updated."
1003
+ msgstr ""
1004
+
1005
+ #: includes/admin/metaboxes.php:43
1006
+ msgid "%s User"
1007
+ msgid_plural "%s Users"
1008
+ msgstr[0] ""
1009
+ msgstr[1] ""
1010
+
1011
+ #: includes/admin/metaboxes.php:52
1012
+ msgid "%s Forum"
1013
+ msgid_plural "%s Forums"
1014
+ msgstr[0] ""
1015
+ msgstr[1] ""
1016
+
1017
+ #: includes/admin/metaboxes.php:61
1018
+ msgid "%s Topic"
1019
+ msgid_plural "%s Topics"
1020
+ msgstr[0] ""
1021
+ msgstr[1] ""
1022
+
1023
+ #: includes/admin/metaboxes.php:70
1024
+ msgid "%s Reply"
1025
+ msgid_plural "%s Replies"
1026
+ msgstr[0] ""
1027
+ msgstr[1] ""
1028
+
1029
+ #: includes/admin/metaboxes.php:79
1030
+ msgid "%s Topic Tag"
1031
+ msgid_plural "%s Topic Tags"
1032
+ msgstr[0] ""
1033
+ msgstr[1] ""
1034
+
1035
+ #: includes/admin/metaboxes.php:105
1036
+ msgid "Discussion"
1037
+ msgstr ""
1038
+
1039
+ #: includes/admin/metaboxes.php:147
1040
+ msgid "Reply"
1041
+ msgid_plural "Replies"
1042
+ msgstr[0] ""
1043
+ msgstr[1] ""
1044
+
1045
+ #: includes/admin/metaboxes.php:166 includes/admin/settings.php:367
1046
+ #: includes/topics/template.php:3380
1047
+ msgid "Topic Tag"
1048
+ msgid_plural "Topic Tags"
1049
+ msgstr[0] ""
1050
+ msgstr[1] ""
1051
+
1052
+ #: includes/admin/metaboxes.php:190
1053
+ msgid "Users &amp; Moderation"
1054
+ msgstr ""
1055
+
1056
+ #: includes/admin/metaboxes.php:198
1057
+ msgid "User"
1058
+ msgid_plural "Users"
1059
+ msgstr[0] ""
1060
+ msgstr[1] ""
1061
+
1062
+ #: includes/admin/metaboxes.php:217
1063
+ msgid "Hidden Topic"
1064
+ msgid_plural "Hidden Topics"
1065
+ msgstr[0] ""
1066
+ msgstr[1] ""
1067
+
1068
+ #: includes/admin/metaboxes.php:239
1069
+ msgid "Hidden Reply"
1070
+ msgid_plural "Hidden Replies"
1071
+ msgstr[0] ""
1072
+ msgstr[1] ""
1073
+
1074
+ #: includes/admin/metaboxes.php:261
1075
+ msgid "Empty Topic Tag"
1076
+ msgid_plural "Empty Topic Tags"
1077
+ msgstr[0] ""
1078
+ msgstr[1] ""
1079
+
1080
+ #: includes/admin/metaboxes.php:285
1081
+ msgid "You are using <span class=\"b\">bbPress %s</span>."
1082
+ msgstr ""
1083
+
1084
+ #: includes/admin/metaboxes.php:317 includes/admin/metaboxes.php:318
1085
+ #: includes/admin/metaboxes.php:404
1086
+ msgid "Type:"
1087
+ msgstr ""
1088
+
1089
+ #: includes/admin/metaboxes.php:329 includes/admin/metaboxes.php:330
1090
+ #: includes/admin/metaboxes.php:416 includes/admin/metaboxes.php:479
1091
+ #: templates/default/bbpress/form-forum.php:121
1092
+ msgid "Status:"
1093
+ msgstr ""
1094
+
1095
+ #: includes/admin/metaboxes.php:341 includes/admin/metaboxes.php:342
1096
+ #: templates/default/bbpress/form-forum.php:130
1097
+ msgid "Visibility:"
1098
+ msgstr ""
1099
+
1100
+ #: includes/admin/metaboxes.php:355
1101
+ msgid "Parent:"
1102
+ msgstr ""
1103
+
1104
+ #: includes/admin/metaboxes.php:356
1105
+ msgid "Forum Parent"
1106
+ msgstr ""
1107
+
1108
+ #: includes/admin/metaboxes.php:369 includes/admin/settings.php:1421
1109
+ #: templates/default/bbpress/form-forum.php:144
1110
+ msgid "&mdash; No parent &mdash;"
1111
+ msgstr ""
1112
+
1113
+ #: includes/admin/metaboxes.php:376
1114
+ msgid "Order:"
1115
+ msgstr ""
1116
+
1117
+ #: includes/admin/metaboxes.php:377
1118
+ msgid "Forum Order"
1119
+ msgstr ""
1120
+
1121
+ #: includes/admin/metaboxes.php:405
1122
+ msgid "Topic Type"
1123
+ msgstr ""
1124
+
1125
+ #: includes/admin/metaboxes.php:418
1126
+ msgid "Select whether to open or close the topic."
1127
+ msgstr ""
1128
+
1129
+ #: includes/admin/metaboxes.php:431 includes/admin/metaboxes.php:495
1130
+ #: includes/extend/buddypress/groups.php:1180 includes/topics/template.php:65
1131
+ #: templates/default/bbpress/form-topic.php:124
1132
+ #: templates/default/bbpress/loop-search-forum.php:25
1133
+ msgid "Forum:"
1134
+ msgstr ""
1135
+
1136
+ #: includes/admin/metaboxes.php:445 includes/extend/buddypress/groups.php:350
1137
+ #: templates/default/bbpress/form-topic.php:127
1138
+ msgid "&mdash; No forum &mdash;"
1139
+ msgstr ""
1140
+
1141
+ #: includes/admin/metaboxes.php:481
1142
+ msgid "Select what status to give the reply."
1143
+ msgstr ""
1144
+
1145
+ #: includes/admin/metaboxes.php:509
1146
+ msgid "&mdash; No reply &mdash;"
1147
+ msgstr ""
1148
+
1149
+ #: includes/admin/metaboxes.php:522 includes/replies/template.php:67
1150
+ #: templates/default/bbpress/loop-search-topic.php:25
1151
+ msgid "Topic:"
1152
+ msgstr ""
1153
+
1154
+ #: includes/admin/metaboxes.php:535
1155
+ #: templates/default/bbpress/form-reply.php:129
1156
+ msgid "Reply To:"
1157
+ msgstr ""
1158
+
1159
+ #: includes/admin/metaboxes.php:536
1160
+ msgid "Reply To"
1161
+ msgstr ""
1162
+
1163
+ #: includes/admin/metaboxes.php:607
1164
+ #: templates/default/bbpress/form-topic-tag.php:40
1165
+ msgid "Name:"
1166
+ msgstr ""
1167
+
1168
+ #: includes/admin/metaboxes.php:608
1169
+ #: templates/default/bbpress/form-user-edit.php:17
1170
+ #: templates/default/bbpress/form-user-edit.php:22
1171
+ msgid "Name"
1172
+ msgstr ""
1173
+
1174
+ #: includes/admin/metaboxes.php:613
1175
+ msgid "Email:"
1176
+ msgstr ""
1177
+
1178
+ #: includes/admin/metaboxes.php:614
1179
+ #: templates/default/bbpress/form-user-edit.php:112
1180
+ #: templates/default/bbpress/form-user-register.php:34
1181
+ msgid "Email"
1182
+ msgstr ""
1183
+
1184
+ #: includes/admin/metaboxes.php:619
1185
+ #: templates/default/bbpress/form-anonymous.php:33
1186
+ msgid "Website:"
1187
+ msgstr ""
1188
+
1189
+ #: includes/admin/metaboxes.php:620
1190
+ #: templates/default/bbpress/form-user-edit.php:60
1191
+ msgid "Website"
1192
+ msgstr ""
1193
+
1194
+ #: includes/admin/metaboxes.php:627
1195
+ msgid "ID:"
1196
+ msgstr ""
1197
+
1198
+ #: includes/admin/metaboxes.php:628
1199
+ msgid "ID"
1200
+ msgstr ""
1201
+
1202
+ #: includes/admin/metaboxes.php:635
1203
+ msgid "IP:"
1204
+ msgstr ""
1205
+
1206
+ #: includes/admin/metaboxes.php:636
1207
+ msgid "IP Address"
1208
+ msgstr ""
1209
+
1210
+ #: includes/admin/metaboxes.php:661
1211
+ msgid "Separate user-names with commas"
1212
+ msgstr ""
1213
+
1214
+ #: includes/admin/metaboxes.php:695
1215
+ msgid "No users have engaged to this topic."
1216
+ msgstr ""
1217
+
1218
+ #: includes/admin/metaboxes.php:731
1219
+ msgid "No users have favorited this topic."
1220
+ msgstr ""
1221
+
1222
+ #: includes/admin/metaboxes.php:767
1223
+ msgid "No users have subscribed to this topic."
1224
+ msgstr ""
1225
+
1226
+ #: includes/admin/metaboxes.php:803
1227
+ msgid "No users have subscribed to this forum."
1228
+ msgstr ""
1229
+
1230
+ #: includes/admin/replies.php:114
1231
+ msgid ""
1232
+ "This screen provides access to all of your replies. You can customize the "
1233
+ "display of this screen to suit your workflow."
1234
+ msgstr ""
1235
+
1236
+ #: includes/admin/replies.php:124
1237
+ msgid ""
1238
+ "You can hide/display columns based on your needs and decide how many "
1239
+ "replies to list per screen using the Screen Options tab."
1240
+ msgstr ""
1241
+
1242
+ #: includes/admin/replies.php:125
1243
+ msgid ""
1244
+ "You can filter the list of replies by reply status using the text links in "
1245
+ "the upper left to show All, Published, Draft, Pending, Trashed, or Spam "
1246
+ "replies. The default view is to show all replies."
1247
+ msgstr ""
1248
+
1249
+ #: includes/admin/replies.php:126
1250
+ msgid ""
1251
+ "You can view replies in a simple title list or with an excerpt. Choose the "
1252
+ "view you prefer by clicking on the icons at the top of the list on the "
1253
+ "right."
1254
+ msgstr ""
1255
+
1256
+ #: includes/admin/replies.php:127
1257
+ msgid ""
1258
+ "You can refine the list to show only replies in a specific forum or from a "
1259
+ "specific month by using the dropdown menus above the replies list. Click "
1260
+ "the Filter button after making your selection."
1261
+ msgstr ""
1262
+
1263
+ #: includes/admin/replies.php:136
1264
+ msgid ""
1265
+ "Hovering over a row in the replies list will display action links that "
1266
+ "allow you to manage your reply. You can perform the following actions:"
1267
+ msgstr ""
1268
+
1269
+ #: includes/admin/replies.php:138
1270
+ msgid ""
1271
+ "<strong>Edit</strong> takes you to the editing screen for that reply. You "
1272
+ "can also reach that screen by clicking on the reply title."
1273
+ msgstr ""
1274
+
1275
+ #: includes/admin/replies.php:140
1276
+ msgid ""
1277
+ "<strong>Trash</strong> removes your reply from this list and places it in "
1278
+ "the trash, from which you can permanently delete it."
1279
+ msgstr ""
1280
+
1281
+ #: includes/admin/replies.php:141
1282
+ msgid ""
1283
+ "<strong>Spam</strong> removes your reply from this list and places it in "
1284
+ "the spam queue, from which you can permanently delete it."
1285
+ msgstr ""
1286
+
1287
+ #: includes/admin/replies.php:142
1288
+ msgid "<strong>View</strong> will take you to your live site to view the reply."
1289
+ msgstr ""
1290
+
1291
+ #: includes/admin/replies.php:143 includes/admin/topics.php:146
1292
+ msgid "<strong>Approve</strong> will change the status from pending to publish."
1293
+ msgstr ""
1294
+
1295
+ #: includes/admin/replies.php:152
1296
+ msgid ""
1297
+ "You can also edit, spam, or move multiple replies to the trash at once. "
1298
+ "Select the replies you want to act on using the checkboxes, then select the "
1299
+ "action you want to take from the Bulk Actions menu and click Apply."
1300
+ msgstr ""
1301
+
1302
+ #: includes/admin/replies.php:153
1303
+ msgid ""
1304
+ "When using Bulk Edit, you can change the metadata (categories, author, "
1305
+ "etc.) for all selected replies at once. To remove a reply from the "
1306
+ "grouping, just click the x next to its name in the Bulk Edit area that "
1307
+ "appears."
1308
+ msgstr ""
1309
+
1310
+ #: includes/admin/replies.php:171
1311
+ msgid ""
1312
+ "The title field and the big reply editing Area are fixed in place, but you "
1313
+ "can reposition all the other boxes using drag and drop, and can minimize or "
1314
+ "expand them by clicking the title bar of each box. Use the Screen Options "
1315
+ "tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, "
1316
+ "Discussion, Slug, Author) or to choose a 1- or 2-column layout for this "
1317
+ "screen."
1318
+ msgstr ""
1319
+
1320
+ #: includes/admin/replies.php:181
1321
+ msgid "Title and Reply Editor"
1322
+ msgstr ""
1323
+
1324
+ #: includes/admin/replies.php:183
1325
+ msgid ""
1326
+ "<strong>Title</strong> - Enter a title for your reply. After you enter a "
1327
+ "title, you&#8217;ll see the permalink below, which you can edit."
1328
+ msgstr ""
1329
+
1330
+ #: includes/admin/replies.php:184
1331
+ msgid ""
1332
+ "<strong>Reply Editor</strong> - Enter the text for your reply. There are "
1333
+ "two modes of editing: Visual and HTML. Choose the mode by clicking on the "
1334
+ "appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last "
1335
+ "icon in the row to get a second row of controls. The HTML mode allows you "
1336
+ "to enter raw HTML along with your reply text. You can insert media files by "
1337
+ "clicking the icons above the reply editor and following the directions. You "
1338
+ "can go to the distraction-free writing screen via the Fullscreen icon in "
1339
+ "Visual mode (second to last in the top row) or the Fullscreen button in "
1340
+ "HTML mode (last in the row). Once there, you can make buttons visible by "
1341
+ "hovering over the top area. Exit Fullscreen back to the regular reply "
1342
+ "editor."
1343
+ msgstr ""
1344
+
1345
+ #: includes/admin/replies.php:187
1346
+ msgid ""
1347
+ "<strong>Publish</strong> - You can set the terms of publishing your reply "
1348
+ "in the Publish box. For Status, Visibility, and Publish (immediately), "
1349
+ "click on the Edit link to reveal more options. Visibility includes options "
1350
+ "for password-protecting a reply or making it stay at the top of your blog "
1351
+ "indefinitely (sticky). Publish (immediately) allows you to set a future or "
1352
+ "past date and time, so you can schedule a reply to be published in the "
1353
+ "future or backdate a reply."
1354
+ msgstr ""
1355
+
1356
+ #: includes/admin/replies.php:190
1357
+ msgid ""
1358
+ "<strong>Featured Image</strong> - This allows you to associate an image "
1359
+ "with your reply without inserting it. This is usually useful only if your "
1360
+ "theme makes use of the featured image as a reply thumbnail on the home "
1361
+ "page, a custom header, etc."
1362
+ msgstr ""
1363
+
1364
+ #: includes/admin/replies.php:195 includes/admin/replies.php:333
1365
+ msgid "Reply Attributes"
1366
+ msgstr ""
1367
+
1368
+ #: includes/admin/replies.php:197
1369
+ msgid "Select the attributes that your reply should have:"
1370
+ msgstr ""
1371
+
1372
+ #: includes/admin/replies.php:199
1373
+ msgid ""
1374
+ "<strong>Forum</strong> dropdown determines the parent forum that the reply "
1375
+ "belongs to. Select the forum, or leave the default (Use Forum of Topic) to "
1376
+ "post the reply in forum of the topic."
1377
+ msgstr ""
1378
+
1379
+ #: includes/admin/replies.php:200
1380
+ msgid ""
1381
+ "<strong>Topic</strong> determines the parent topic that the reply belongs "
1382
+ "to."
1383
+ msgstr ""
1384
+
1385
+ #: includes/admin/replies.php:201
1386
+ msgid "<strong>Reply To</strong> determines the threading of the reply."
1387
+ msgstr ""
1388
+
1389
+ #: includes/admin/replies.php:230 includes/admin/topics.php:235
1390
+ #: includes/replies/template.php:1971 includes/topics/template.php:2822
1391
+ msgid "Unspam"
1392
+ msgstr ""
1393
+
1394
+ #: includes/admin/replies.php:248
1395
+ msgid "%s reply updated."
1396
+ msgid_plural "%s replies updated."
1397
+ msgstr[0] ""
1398
+ msgstr[1] ""
1399
+
1400
+ #: includes/admin/replies.php:250
1401
+ msgid "1 reply not updated, somebody is editing it."
1402
+ msgstr ""
1403
+
1404
+ #: includes/admin/replies.php:251
1405
+ msgid "%s reply not updated, somebody is editing it."
1406
+ msgid_plural "%s replies not updated, somebody is editing them."
1407
+ msgstr[0] ""
1408
+ msgstr[1] ""
1409
+
1410
+ #: includes/admin/replies.php:275 includes/admin/topics.php:280
1411
+ msgid "Sorry, you are not allowed to spam this item."
1412
+ msgstr ""
1413
+
1414
+ #: includes/admin/replies.php:284
1415
+ msgid "Error in spamming reply."
1416
+ msgstr ""
1417
+
1418
+ #: includes/admin/replies.php:300
1419
+ msgid "Sorry, you are not allowed to unspam this reply."
1420
+ msgstr ""
1421
+
1422
+ #: includes/admin/replies.php:309
1423
+ msgid "Error in unspamming reply."
1424
+ msgstr ""
1425
+
1426
+ #: includes/admin/replies.php:358 includes/admin/topics.php:361
1427
+ #: templates/default/bbpress/form-anonymous.php:18
1428
+ msgid "Author Information"
1429
+ msgstr ""
1430
+
1431
+ #: includes/admin/replies.php:456
1432
+ msgid "The reply was not found."
1433
+ msgstr ""
1434
+
1435
+ #: includes/admin/replies.php:559
1436
+ msgid "There was a problem marking the reply \"%1$s\" as spam."
1437
+ msgstr ""
1438
+
1439
+ #: includes/admin/replies.php:560
1440
+ msgid "Reply \"%1$s\" successfully marked as spam."
1441
+ msgstr ""
1442
+
1443
+ #: includes/admin/replies.php:565
1444
+ msgid "There was a problem unmarking the reply \"%1$s\" as spam."
1445
+ msgstr ""
1446
+
1447
+ #: includes/admin/replies.php:566
1448
+ msgid "Reply \"%1$s\" successfully unmarked as spam."
1449
+ msgstr ""
1450
+
1451
+ #: includes/admin/replies.php:571
1452
+ msgid "There was a problem approving the reply \"%1$s\"."
1453
+ msgstr ""
1454
+
1455
+ #: includes/admin/replies.php:572
1456
+ msgid "Reply \"%1$s\" successfully approved."
1457
+ msgstr ""
1458
+
1459
+ #: includes/admin/replies.php:577
1460
+ msgid "There was a problem unapproving the reply \"%1$s\"."
1461
+ msgstr ""
1462
+
1463
+ #: includes/admin/replies.php:578
1464
+ msgid "Reply \"%1$s\" successfully unapproved."
1465
+ msgstr ""
1466
+
1467
+ #: includes/admin/replies.php:643
1468
+ msgid "Title"
1469
+ msgstr ""
1470
+
1471
+ #: includes/admin/replies.php:686
1472
+ msgid "No topic"
1473
+ msgstr ""
1474
+
1475
+ #: includes/admin/replies.php:707
1476
+ msgid "(Mismatch)"
1477
+ msgstr ""
1478
+
1479
+ #: includes/admin/replies.php:719 includes/admin/topics.php:876
1480
+ msgid "No forum"
1481
+ msgstr ""
1482
+
1483
+ #: includes/admin/replies.php:774 includes/admin/topics.php:950
1484
+ #: includes/admin/topics.php:963
1485
+ msgid "View &#8220;%s&#8221;"
1486
+ msgstr ""
1487
+
1488
+ #: includes/admin/replies.php:787
1489
+ msgid "Unapprove this reply"
1490
+ msgstr ""
1491
+
1492
+ #: includes/admin/replies.php:789
1493
+ msgid "Approve this reply"
1494
+ msgstr ""
1495
+
1496
+ #: includes/admin/replies.php:796
1497
+ msgid "Mark the reply as not spam"
1498
+ msgstr ""
1499
+
1500
+ #: includes/admin/replies.php:796 includes/admin/topics.php:992
1501
+ msgid "Not spam"
1502
+ msgstr ""
1503
+
1504
+ #: includes/admin/replies.php:798
1505
+ msgid "Mark this reply as spam"
1506
+ msgstr ""
1507
+
1508
+ #: includes/admin/replies.php:809 includes/admin/topics.php:1004
1509
+ #: includes/replies/template.php:1920 includes/topics/template.php:2546
1510
+ msgid "Restore this item from the Trash"
1511
+ msgstr ""
1512
+
1513
+ #: includes/admin/replies.php:809 includes/admin/topics.php:1004
1514
+ #: includes/replies/template.php:1903 includes/topics/template.php:2530
1515
+ msgid "Restore"
1516
+ msgstr ""
1517
+
1518
+ #: includes/admin/replies.php:811 includes/admin/topics.php:1006
1519
+ #: includes/replies/template.php:1924 includes/topics/template.php:2548
1520
+ msgid "Move this item to the Trash"
1521
+ msgstr ""
1522
+
1523
+ #: includes/admin/replies.php:815 includes/admin/topics.php:1010
1524
+ #: includes/replies/template.php:1929 includes/topics/template.php:2552
1525
+ msgid "Delete this item permanently"
1526
+ msgstr ""
1527
+
1528
+ #: includes/admin/replies.php:815 includes/admin/topics.php:1010
1529
+ msgid "Delete Permanently"
1530
+ msgstr ""
1531
+
1532
+ #: includes/admin/replies.php:837 includes/admin/topics.php:1032
1533
+ msgid "Empty Spam"
1534
+ msgstr ""
1535
+
1536
+ #: includes/admin/replies.php:852 includes/admin/topics.php:1047
1537
+ msgid "In all forums"
1538
+ msgstr ""
1539
+
1540
+ #: includes/admin/replies.php:904 includes/admin/replies.php:916
1541
+ msgid "Reply updated."
1542
+ msgstr ""
1543
+
1544
+ #: includes/admin/replies.php:906 includes/admin/replies.php:929
1545
+ #: includes/admin/topics.php:1101 includes/admin/topics.php:1124
1546
+ msgid "View topic"
1547
+ msgstr ""
1548
+
1549
+ #: includes/admin/replies.php:921
1550
+ #. translators: %s: date and time of the revision
1551
+ msgid "Reply restored to revision from %s"
1552
+ msgstr ""
1553
+
1554
+ #: includes/admin/replies.php:927
1555
+ msgid "Reply created."
1556
+ msgstr ""
1557
+
1558
+ #: includes/admin/replies.php:933
1559
+ msgid "Reply saved."
1560
+ msgstr ""
1561
+
1562
+ #: includes/admin/replies.php:938
1563
+ msgid "Reply submitted."
1564
+ msgstr ""
1565
+
1566
+ #: includes/admin/replies.php:940 includes/admin/replies.php:952
1567
+ #: includes/admin/replies.php:960 includes/admin/topics.php:1135
1568
+ #: includes/admin/topics.php:1147 includes/admin/topics.php:1155
1569
+ msgid "Preview topic"
1570
+ msgstr ""
1571
+
1572
+ #: includes/admin/replies.php:947
1573
+ msgid "Reply scheduled for: %s."
1574
+ msgstr ""
1575
+
1576
+ #: includes/admin/replies.php:958
1577
+ msgid "Reply draft updated."
1578
+ msgstr ""
1579
+
1580
+ #: includes/admin/settings.php:29
1581
+ msgid "Forum User Settings"
1582
+ msgstr ""
1583
+
1584
+ #: includes/admin/settings.php:34
1585
+ msgid "Forum Features"
1586
+ msgstr ""
1587
+
1588
+ #: includes/admin/settings.php:39
1589
+ msgid "Forum Theme Packages"
1590
+ msgstr ""
1591
+
1592
+ #: includes/admin/settings.php:44
1593
+ msgid "Topics and Replies Per Page"
1594
+ msgstr ""
1595
+
1596
+ #: includes/admin/settings.php:49
1597
+ msgid "Topics and Replies Per RSS Page"
1598
+ msgstr ""
1599
+
1600
+ #: includes/admin/settings.php:54
1601
+ msgid "Forum Root Slug"
1602
+ msgstr ""
1603
+
1604
+ #: includes/admin/settings.php:59
1605
+ msgid "Forum Single Slugs"
1606
+ msgstr ""
1607
+
1608
+ #: includes/admin/settings.php:64
1609
+ msgid "Forum User Slugs"
1610
+ msgstr ""
1611
+
1612
+ #: includes/admin/settings.php:71
1613
+ msgid "Forum Integration for BuddyPress"
1614
+ msgstr ""
1615
+
1616
+ #: includes/admin/settings.php:76
1617
+ msgid "Forum Integration for Akismet"
1618
+ msgstr ""
1619
+
1620
+ #: includes/admin/settings.php:83 includes/admin/tools/help.php:104
1621
+ msgid "Database Settings"
1622
+ msgstr ""
1623
+
1624
+ #: includes/admin/settings.php:88
1625
+ msgid "Options"
1626
+ msgstr ""
1627
+
1628
+ #: includes/admin/settings.php:119
1629
+ msgid "Roles"
1630
+ msgstr ""
1631
+
1632
+ #: includes/admin/settings.php:133
1633
+ msgid "Flooding"
1634
+ msgstr ""
1635
+
1636
+ #: includes/admin/settings.php:147
1637
+ msgid "Editing"
1638
+ msgstr ""
1639
+
1640
+ #: includes/admin/settings.php:155 includes/users/template.php:799
1641
+ msgid "Anonymous"
1642
+ msgstr ""
1643
+
1644
+ #: includes/admin/settings.php:168 includes/admin/settings.php:1997
1645
+ msgid "Revisions"
1646
+ msgstr ""
1647
+
1648
+ #: includes/admin/settings.php:176 includes/admin/tools/common.php:329
1649
+ #: includes/admin/topics.php:447 includes/extend/buddypress/loader.php:235
1650
+ #: templates/default/bbpress/user-details.php:57
1651
+ msgid "Favorites"
1652
+ msgstr ""
1653
+
1654
+ #: includes/admin/settings.php:192 includes/admin/settings.php:444
1655
+ #: includes/admin/tools/common.php:335 includes/admin/topics.php:417
1656
+ #: includes/extend/buddypress/loader.php:222
1657
+ #: includes/extend/buddypress/loader.php:324
1658
+ #: templates/default/bbpress/user-details.php:49
1659
+ msgid "Engagements"
1660
+ msgstr ""
1661
+
1662
+ #: includes/admin/settings.php:200
1663
+ msgid "Topic tags"
1664
+ msgstr ""
1665
+
1666
+ #: includes/admin/settings.php:216
1667
+ msgid "Super Moderators"
1668
+ msgstr ""
1669
+
1670
+ #: includes/admin/settings.php:224 includes/admin/settings.php:391
1671
+ #: includes/common/template.php:2372 includes/search/template.php:175
1672
+ #: templates/default/bbpress/form-reply-search.php:20
1673
+ #: templates/default/bbpress/form-search.php:21
1674
+ #: templates/default/bbpress/form-topic-search.php:20
1675
+ msgid "Search"
1676
+ msgstr ""
1677
+
1678
+ #: includes/admin/settings.php:232
1679
+ msgid "Post Formatting"
1680
+ msgstr ""
1681
+
1682
+ #: includes/admin/settings.php:240
1683
+ msgid "Auto-embed links"
1684
+ msgstr ""
1685
+
1686
+ #: includes/admin/settings.php:248
1687
+ msgid "Reply Threading"
1688
+ msgstr ""
1689
+
1690
+ #: includes/admin/settings.php:267
1691
+ msgid "Current Package"
1692
+ msgstr ""
1693
+
1694
+ #: includes/admin/settings.php:322
1695
+ msgid "Forum Root"
1696
+ msgstr ""
1697
+
1698
+ #: includes/admin/settings.php:330
1699
+ msgid "Forum Prefix"
1700
+ msgstr ""
1701
+
1702
+ #: includes/admin/settings.php:338
1703
+ msgid "Forum root should show"
1704
+ msgstr ""
1705
+
1706
+ #: includes/admin/settings.php:375
1707
+ msgid "Topic View"
1708
+ msgstr ""
1709
+
1710
+ #: includes/admin/settings.php:404
1711
+ msgid "User Base"
1712
+ msgstr ""
1713
+
1714
+ #: includes/admin/settings.php:412 includes/extend/buddypress/loader.php:199
1715
+ #: includes/extend/buddypress/loader.php:307
1716
+ #: templates/default/bbpress/user-details.php:36
1717
+ msgid "Topics Started"
1718
+ msgstr ""
1719
+
1720
+ #: includes/admin/settings.php:420 includes/extend/buddypress/loader.php:210
1721
+ #: includes/extend/buddypress/loader.php:315
1722
+ #: templates/default/bbpress/user-details.php:42
1723
+ msgid "Replies Created"
1724
+ msgstr ""
1725
+
1726
+ #: includes/admin/settings.php:428 includes/extend/buddypress/loader.php:334
1727
+ msgid "Favorite Topics"
1728
+ msgstr ""
1729
+
1730
+ #: includes/admin/settings.php:457 includes/admin/tools/upgrade.php:325
1731
+ #: includes/extend/buddypress/functions.php:341
1732
+ msgid "Group Forums"
1733
+ msgstr ""
1734
+
1735
+ #: includes/admin/settings.php:465
1736
+ msgid "Primary Forum"
1737
+ msgstr ""
1738
+
1739
+ #: includes/admin/settings.php:478
1740
+ msgid "Use Akismet"
1741
+ msgstr ""
1742
+
1743
+ #: includes/admin/settings.php:492
1744
+ msgid "Select Platform"
1745
+ msgstr ""
1746
+
1747
+ #: includes/admin/settings.php:500
1748
+ msgid "Database Server"
1749
+ msgstr ""
1750
+
1751
+ #: includes/admin/settings.php:508
1752
+ msgid "Database Port"
1753
+ msgstr ""
1754
+
1755
+ #: includes/admin/settings.php:516
1756
+ msgid "Database Name"
1757
+ msgstr ""
1758
+
1759
+ #: includes/admin/settings.php:524
1760
+ msgid "Database User"
1761
+ msgstr ""
1762
+
1763
+ #: includes/admin/settings.php:532
1764
+ msgid "Database Password"
1765
+ msgstr ""
1766
+
1767
+ #: includes/admin/settings.php:540
1768
+ msgid "Table Prefix"
1769
+ msgstr ""
1770
+
1771
+ #: includes/admin/settings.php:552
1772
+ msgid "Rows Limit"
1773
+ msgstr ""
1774
+
1775
+ #: includes/admin/settings.php:560
1776
+ msgid "Delay Time"
1777
+ msgstr ""
1778
+
1779
+ #: includes/admin/settings.php:568
1780
+ msgid "Convert Users"
1781
+ msgstr ""
1782
+
1783
+ #: includes/admin/settings.php:576
1784
+ msgid "Stop on Error"
1785
+ msgstr ""
1786
+
1787
+ #: includes/admin/settings.php:584
1788
+ msgid "Start Over"
1789
+ msgstr ""
1790
+
1791
+ #: includes/admin/settings.php:592
1792
+ msgid "Helper Data"
1793
+ msgstr ""
1794
+
1795
+ #: includes/admin/settings.php:645
1796
+ msgid "Setting time limits and other user posting capabilities"
1797
+ msgstr ""
1798
+
1799
+ #: includes/admin/settings.php:669
1800
+ msgid "Allow users to edit their content for %s minutes after posting"
1801
+ msgstr ""
1802
+
1803
+ #: includes/admin/settings.php:671
1804
+ msgid "If checked, setting to \"0 minutes\" allows editing forever."
1805
+ msgstr ""
1806
+
1807
+ #: includes/admin/settings.php:694
1808
+ msgid "Allow flood protection by throttling users for %s seconds after posting"
1809
+ msgstr ""
1810
+
1811
+ #: includes/admin/settings.php:696
1812
+ msgid "Use this to discourage users from spamming your forums."
1813
+ msgstr ""
1814
+
1815
+ #: includes/admin/settings.php:710
1816
+ msgid "Allow guest users without accounts to create topics and replies"
1817
+ msgstr ""
1818
+
1819
+ #: includes/admin/settings.php:711
1820
+ msgid "Works best on intranets or paired with antispam measures like Akismet."
1821
+ msgstr ""
1822
+
1823
+ #: includes/admin/settings.php:744
1824
+ msgid "Automatically give registered visitors the %s forum role"
1825
+ msgstr ""
1826
+
1827
+ #: includes/admin/settings.php:746
1828
+ msgid "Uncheck this to manually assign all user access to your forums."
1829
+ msgstr ""
1830
+
1831
+ #: includes/admin/settings.php:761
1832
+ msgid "Forum features that can be toggled on and off"
1833
+ msgstr ""
1834
+
1835
+ #: includes/admin/settings.php:775
1836
+ msgid "Allow users to mark topics as favorites"
1837
+ msgstr ""
1838
+
1839
+ #: includes/admin/settings.php:789
1840
+ msgid "Allow users to subscribe to forums and topics"
1841
+ msgstr ""
1842
+
1843
+ #: includes/admin/settings.php:803
1844
+ msgid "Allow tracking of topics each user engages in"
1845
+ msgstr ""
1846
+
1847
+ #: includes/admin/settings.php:817
1848
+ msgid "Allow topics to have tags"
1849
+ msgstr ""
1850
+
1851
+ #: includes/admin/settings.php:831
1852
+ msgid "Allow forums to have dedicated moderators"
1853
+ msgstr ""
1854
+
1855
+ #: includes/admin/settings.php:845
1856
+ msgid "Allow moderators to edit other users"
1857
+ msgstr ""
1858
+
1859
+ #: includes/admin/settings.php:859
1860
+ msgid "Allow forum wide search"
1861
+ msgstr ""
1862
+
1863
+ #: includes/admin/settings.php:894
1864
+ msgid "Enable threaded (nested) replies %s levels deep"
1865
+ msgstr ""
1866
+
1867
+ #: includes/admin/settings.php:909
1868
+ msgid "Allow topic and reply revision logging"
1869
+ msgstr ""
1870
+
1871
+ #: includes/admin/settings.php:923
1872
+ msgid "Add toolbar & buttons to textareas to help with HTML formatting"
1873
+ msgstr ""
1874
+
1875
+ #: includes/admin/settings.php:936
1876
+ msgid "How your forum content is displayed within your existing theme."
1877
+ msgstr ""
1878
+
1879
+ #: includes/admin/settings.php:964
1880
+ msgid "will serve all bbPress templates"
1881
+ msgstr ""
1882
+
1883
+ #: includes/admin/settings.php:968
1884
+ msgid "No template packages available."
1885
+ msgstr ""
1886
+
1887
+ #: includes/admin/settings.php:982
1888
+ msgid ""
1889
+ "Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and "
1890
+ "replies"
1891
+ msgstr ""
1892
+
1893
+ #: includes/admin/settings.php:997
1894
+ msgid "How many topics and replies to show per page"
1895
+ msgstr ""
1896
+
1897
+ #: includes/admin/settings.php:1011 includes/admin/settings.php:1025
1898
+ #: includes/admin/settings.php:1054 includes/admin/settings.php:1068
1899
+ msgid "per page"
1900
+ msgstr ""
1901
+
1902
+ #: includes/admin/settings.php:1040
1903
+ msgid "How many topics and replies to show per RSS page"
1904
+ msgstr ""
1905
+
1906
+ #: includes/admin/settings.php:1087
1907
+ msgid ""
1908
+ "Customize your Forums root. Partner with a WordPress Page and use "
1909
+ "Shortcodes for more flexibility."
1910
+ msgstr ""
1911
+
1912
+ #: includes/admin/settings.php:1116
1913
+ msgid "Prefix all forum content with the Forum Root slug (Recommended)"
1914
+ msgstr ""
1915
+
1916
+ #: includes/admin/settings.php:1134
1917
+ msgid "Forum Index"
1918
+ msgstr ""
1919
+
1920
+ #: includes/admin/settings.php:1137
1921
+ msgid "Topics by Last Post"
1922
+ msgstr ""
1923
+
1924
+ #: includes/admin/settings.php:1159
1925
+ msgid "This setting will be ignored because %s was found in your theme."
1926
+ msgstr ""
1927
+
1928
+ #: includes/admin/settings.php:1174
1929
+ msgid "Customize your user profile slugs."
1930
+ msgstr ""
1931
+
1932
+ #: includes/admin/settings.php:1279
1933
+ msgid "Custom slugs for single forums, topics, replies, tags, views, and search."
1934
+ msgstr ""
1935
+
1936
+ #: includes/admin/settings.php:1385
1937
+ msgid "Configure how Forum settings for BuddyPress"
1938
+ msgstr ""
1939
+
1940
+ #: includes/admin/settings.php:1399
1941
+ msgid "Allow BuddyPress Groups to have their own forums"
1942
+ msgstr ""
1943
+
1944
+ #: includes/admin/settings.php:1443
1945
+ msgid "create a new one"
1946
+ msgstr ""
1947
+
1948
+ #: includes/admin/settings.php:1444
1949
+ msgid "Use %s to contain your group forums, or %s"
1950
+ msgstr ""
1951
+
1952
+ #: includes/admin/settings.php:1446
1953
+ msgid "Use %s to contain your group forums"
1954
+ msgstr ""
1955
+
1956
+ #: includes/admin/settings.php:1451
1957
+ msgid "Changing this will not move existing forums."
1958
+ msgstr ""
1959
+
1960
+ #: includes/admin/settings.php:1466
1961
+ msgid "Forum settings for Akismet"
1962
+ msgstr ""
1963
+
1964
+ #: includes/admin/settings.php:1481
1965
+ msgid "Allow Akismet to actively prevent forum spam."
1966
+ msgstr ""
1967
+
1968
+ #: includes/admin/settings.php:1497
1969
+ msgid "Forums Settings"
1970
+ msgstr ""
1971
+
1972
+ #: includes/admin/settings.php:1507
1973
+ #: templates/default/bbpress/form-user-edit.php:161
1974
+ msgid "Save Changes"
1975
+ msgstr ""
1976
+
1977
+ #: includes/admin/settings.php:1525
1978
+ msgid ""
1979
+ "Information about your previous forums database so that they can be "
1980
+ "converted. <strong>Backup your database before proceeding.</strong>"
1981
+ msgstr ""
1982
+
1983
+ #: includes/admin/settings.php:1548
1984
+ msgid "is the previous forum software"
1985
+ msgstr ""
1986
+
1987
+ #: includes/admin/settings.php:1562
1988
+ msgid "Use default \"localhost\" if on the same server, otherwise IP or hostname"
1989
+ msgstr ""
1990
+
1991
+ #: includes/admin/settings.php:1576
1992
+ msgid "Use default \"3306\" if unsure"
1993
+ msgstr ""
1994
+
1995
+ #: includes/admin/settings.php:1590
1996
+ msgid "User to access the database"
1997
+ msgstr ""
1998
+
1999
+ #: includes/admin/settings.php:1606
2000
+ msgid "Toggle"
2001
+ msgstr ""
2002
+
2003
+ #: includes/admin/settings.php:1610
2004
+ msgid "Password for the above database user"
2005
+ msgstr ""
2006
+
2007
+ #: includes/admin/settings.php:1624
2008
+ msgid "Name of the database with your old forum data"
2009
+ msgstr ""
2010
+
2011
+ #: includes/admin/settings.php:1637
2012
+ msgid "Some optional parameters to help tune the conversion process."
2013
+ msgstr ""
2014
+
2015
+ #: includes/admin/settings.php:1651
2016
+ msgid "(If converting from BuddyPress Forums, use \"wp_bb_\" or your custom prefix)"
2017
+ msgstr ""
2018
+
2019
+ #: includes/admin/settings.php:1665
2020
+ msgid "entry maximum when querying for data to convert"
2021
+ msgstr ""
2022
+
2023
+ #: includes/admin/settings.php:1666
2024
+ msgid "Keep this low if you experience out-of-memory issues."
2025
+ msgstr ""
2026
+
2027
+ #: includes/admin/settings.php:1680
2028
+ msgid "second delay between each query of rows above"
2029
+ msgstr ""
2030
+
2031
+ #: includes/admin/settings.php:1681
2032
+ msgid "Keep this high to prevent too-many-connection issues."
2033
+ msgstr ""
2034
+
2035
+ #: includes/admin/settings.php:1695
2036
+ msgid "Halt the conversion if an error occurs"
2037
+ msgstr ""
2038
+
2039
+ #: includes/admin/settings.php:1696
2040
+ msgid "This is helpful if you want to debug problems."
2041
+ msgstr ""
2042
+
2043
+ #: includes/admin/settings.php:1711
2044
+ msgid "Restart the converter from the beginning"
2045
+ msgstr ""
2046
+
2047
+ #: includes/admin/settings.php:1712
2048
+ msgid ""
2049
+ "This forces all steps back to 0. Avoid duplicate data by purging or "
2050
+ "resetting first."
2051
+ msgstr ""
2052
+
2053
+ #: includes/admin/settings.php:1726
2054
+ msgid "Purge all meta-data from a previous import"
2055
+ msgstr ""
2056
+
2057
+ #: includes/admin/settings.php:1727
2058
+ msgid ""
2059
+ "Use this if an import failed, or you just want to remove the relationship "
2060
+ "data."
2061
+ msgstr ""
2062
+
2063
+ #: includes/admin/settings.php:1741
2064
+ msgid "Import user accounts from previous forums"
2065
+ msgstr ""
2066
+
2067
+ #: includes/admin/settings.php:1742
2068
+ msgid "Passwords remain encrypted, and are converted as individual users log in."
2069
+ msgstr ""
2070
+
2071
+ #: includes/admin/settings.php:1762
2072
+ msgid "Up next: step %s"
2073
+ msgstr ""
2074
+
2075
+ #: includes/admin/settings.php:1763
2076
+ msgid "Ready"
2077
+ msgstr ""
2078
+
2079
+ #: includes/admin/settings.php:1767
2080
+ msgid "Resume"
2081
+ msgstr ""
2082
+
2083
+ #: includes/admin/settings.php:1772
2084
+ msgid "Previously stopped at step %d of %d"
2085
+ msgstr ""
2086
+
2087
+ #: includes/admin/settings.php:1773
2088
+ msgid "Ready to go."
2089
+ msgstr ""
2090
+
2091
+ #: includes/admin/settings.php:1776 includes/admin/tools/repair.php:28
2092
+ #: includes/admin/tools/reset.php:23 includes/admin/tools/upgrade.php:25
2093
+ msgid "Forum Tools"
2094
+ msgstr ""
2095
+
2096
+ #: includes/admin/settings.php:1778 includes/admin/tools.php:517
2097
+ msgid "Import Forums"
2098
+ msgstr ""
2099
+
2100
+ #: includes/admin/settings.php:1792
2101
+ msgid "Pause"
2102
+ msgstr ""
2103
+
2104
+ #: includes/admin/settings.php:1802
2105
+ msgid "Toggle panel: Import Status"
2106
+ msgstr ""
2107
+
2108
+ #: includes/admin/settings.php:1806
2109
+ msgid "Import Monitor"
2110
+ msgstr ""
2111
+
2112
+ #: includes/admin/settings.php:1845
2113
+ msgid "This screen provides access to all of the Forums settings."
2114
+ msgstr ""
2115
+
2116
+ #: includes/admin/settings.php:1846 includes/admin/tools/help.php:97
2117
+ msgid ""
2118
+ "Please see the additional help tabs for more information on each individual "
2119
+ "section."
2120
+ msgstr ""
2121
+
2122
+ #: includes/admin/settings.php:1852
2123
+ msgid "Main Settings"
2124
+ msgstr ""
2125
+
2126
+ #: includes/admin/settings.php:1853
2127
+ msgid "The \"Main Settings\" section includes a number of options:"
2128
+ msgstr ""
2129
+
2130
+ #: includes/admin/settings.php:1856
2131
+ msgid ""
2132
+ "You can choose to lock a post after a certain number of minutes. \"Locking "
2133
+ "post editing\" will prevent the author from editing some amount of time "
2134
+ "after saving a post."
2135
+ msgstr ""
2136
+
2137
+ #: includes/admin/settings.php:1857
2138
+ msgid ""
2139
+ "\"Throttle time\" is the amount of time required between posts from a "
2140
+ "single author. The higher the throttle time, the longer a user will need to "
2141
+ "wait between posting to the forum."
2142
+ msgstr ""
2143
+
2144
+ #: includes/admin/settings.php:1858
2145
+ msgid ""
2146
+ "Favorites are a way for users to save and later return to topics they "
2147
+ "favor. This is enabled by default."
2148
+ msgstr ""
2149
+
2150
+ #: includes/admin/settings.php:1859
2151
+ msgid ""
2152
+ "Subscriptions allow users to subscribe for notifications to topics that "
2153
+ "interest them. This is enabled by default."
2154
+ msgstr ""
2155
+
2156
+ #: includes/admin/settings.php:1860
2157
+ msgid ""
2158
+ "Topic-Tags allow users to filter topics between forums. This is enabled by "
2159
+ "default."
2160
+ msgstr ""
2161
+
2162
+ #: includes/admin/settings.php:1861
2163
+ msgid ""
2164
+ "\"Anonymous Posting\" allows guest users who do not have accounts on your "
2165
+ "site to both create topics as well as replies."
2166
+ msgstr ""
2167
+
2168
+ #: includes/admin/settings.php:1862
2169
+ msgid ""
2170
+ "The Fancy Editor brings the luxury of the Visual editor and HTML editor "
2171
+ "from the traditional WordPress dashboard into your theme."
2172
+ msgstr ""
2173
+
2174
+ #: includes/admin/settings.php:1863
2175
+ msgid ""
2176
+ "Auto-embed will embed the media content from a URL directly into the "
2177
+ "replies. For example: links to Flickr and YouTube."
2178
+ msgstr ""
2179
+
2180
+ #: includes/admin/settings.php:1866
2181
+ msgid ""
2182
+ "You must click the Save Changes button at the bottom of the screen for new "
2183
+ "settings to take effect."
2184
+ msgstr ""
2185
+
2186
+ #: includes/admin/settings.php:1872
2187
+ msgid "Theme Packages"
2188
+ msgstr ""
2189
+
2190
+ #: includes/admin/settings.php:1873
2191
+ msgid ""
2192
+ "The \"Theme Packages\" section allows you to choose which theme package "
2193
+ "should be used."
2194
+ msgstr ""
2195
+
2196
+ #: includes/admin/settings.php:1876
2197
+ msgid "The \"bbPress Default\" package is installed by default."
2198
+ msgstr ""
2199
+
2200
+ #: includes/admin/settings.php:1877
2201
+ msgid "Some themes may choose to ignore this setting entirely."
2202
+ msgstr ""
2203
+
2204
+ #: includes/admin/settings.php:1878
2205
+ msgid "Packages can be stacked to allow for intelligent fallbacks."
2206
+ msgstr ""
2207
+
2208
+ #: includes/admin/settings.php:1886
2209
+ msgid "Per Page"
2210
+ msgstr ""
2211
+
2212
+ #: includes/admin/settings.php:1887
2213
+ msgid ""
2214
+ "The \"Per Page\" section allows you to control the number of topics and "
2215
+ "replies appear on each page."
2216
+ msgstr ""
2217
+
2218
+ #: includes/admin/settings.php:1889
2219
+ msgid ""
2220
+ "This is comparable to the WordPress \"Reading Settings\" page, where you "
2221
+ "can set the number of posts that should show on blog pages and in feeds."
2222
+ msgstr ""
2223
+
2224
+ #: includes/admin/settings.php:1890
2225
+ msgid ""
2226
+ "These are broken up into two separate groups: one for what appears in your "
2227
+ "theme, another for RSS feeds."
2228
+ msgstr ""
2229
+
2230
+ #: includes/admin/settings.php:1898
2231
+ msgid "Slugs"
2232
+ msgstr ""
2233
+
2234
+ #: includes/admin/settings.php:1899
2235
+ msgid ""
2236
+ "The \"Slugs\" section allows you to control the permalink structure for "
2237
+ "your forums."
2238
+ msgstr ""
2239
+
2240
+ #: includes/admin/settings.php:1901
2241
+ msgid ""
2242
+ "\"Archive Slugs\" are used as the \"root\" for your forums and topics. If "
2243
+ "you combine these values with existing page slugs, bbPress will attempt to "
2244
+ "output the most correct title and content."
2245
+ msgstr ""
2246
+
2247
+ #: includes/admin/settings.php:1902
2248
+ msgid ""
2249
+ "\"Single Slugs\" are used as a prefix when viewing an individual forum, "
2250
+ "topic, reply, user, or view."
2251
+ msgstr ""
2252
+
2253
+ #: includes/admin/settings.php:1903
2254
+ msgid ""
2255
+ "In the event of a slug collision with WordPress or BuddyPress, a warning "
2256
+ "will appear next to the problem slug(s)."
2257
+ msgstr ""
2258
+
2259
+ #: includes/admin/settings.php:1995
2260
+ #: templates/default/bbpress/loop-forums.php:24
2261
+ #: templates/default/bbpress/loop-replies.php:21
2262
+ #: templates/default/bbpress/loop-replies.php:47
2263
+ #: templates/default/bbpress/loop-topics.php:22
2264
+ msgid "Posts"
2265
+ msgstr ""
2266
+
2267
+ #: includes/admin/settings.php:1996
2268
+ msgid "Pages"
2269
+ msgstr ""
2270
+
2271
+ #: includes/admin/settings.php:1998
2272
+ msgid "Attachments"
2273
+ msgstr ""
2274
+
2275
+ #: includes/admin/settings.php:1999
2276
+ msgid "Menus"
2277
+ msgstr ""
2278
+
2279
+ #: includes/admin/settings.php:2002
2280
+ msgid "Tag base"
2281
+ msgstr ""
2282
+
2283
+ #: includes/admin/settings.php:2005
2284
+ msgid "Category base"
2285
+ msgstr ""
2286
+
2287
+ #: includes/admin/settings.php:2010
2288
+ msgid "Forums base"
2289
+ msgstr ""
2290
+
2291
+ #: includes/admin/settings.php:2013
2292
+ msgid "Topics base"
2293
+ msgstr ""
2294
+
2295
+ #: includes/admin/settings.php:2016
2296
+ msgid "Forum slug"
2297
+ msgstr ""
2298
+
2299
+ #: includes/admin/settings.php:2019
2300
+ msgid "Topic slug"
2301
+ msgstr ""
2302
+
2303
+ #: includes/admin/settings.php:2022
2304
+ msgid "Reply slug"
2305
+ msgstr ""
2306
+
2307
+ #: includes/admin/settings.php:2025
2308
+ msgid "User base"
2309
+ msgstr ""
2310
+
2311
+ #: includes/admin/settings.php:2028
2312
+ msgid "View base"
2313
+ msgstr ""
2314
+
2315
+ #: includes/admin/settings.php:2031
2316
+ msgid "Topic tag slug"
2317
+ msgstr ""
2318
+
2319
+ #: includes/admin/settings.php:2043
2320
+ msgid "%s page"
2321
+ msgstr ""
2322
+
2323
+ #: includes/admin/settings.php:2066
2324
+ msgid "Possible %1$s conflict: %2$s"
2325
+ msgstr ""
2326
+
2327
+ #: includes/admin/tools/common.php:230
2328
+ msgid "Search Tools:"
2329
+ msgstr ""
2330
+
2331
+ #: includes/admin/tools/common.php:232
2332
+ msgid "Search Tools"
2333
+ msgstr ""
2334
+
2335
+ #: includes/admin/tools/common.php:253
2336
+ msgid "Filter by Component"
2337
+ msgstr ""
2338
+
2339
+ #: includes/admin/tools/common.php:255
2340
+ msgid "All Components"
2341
+ msgstr ""
2342
+
2343
+ #: includes/admin/tools/common.php:264
2344
+ msgid "Filter"
2345
+ msgstr ""
2346
+
2347
+ #: includes/admin/tools/common.php:282
2348
+ msgid "Low"
2349
+ msgstr ""
2350
+
2351
+ #: includes/admin/tools/common.php:285
2352
+ msgid "Medium"
2353
+ msgstr ""
2354
+
2355
+ #: includes/admin/tools/common.php:288
2356
+ msgid "High"
2357
+ msgstr ""
2358
+
2359
+ #: includes/admin/tools/common.php:311 includes/admin/tools/common.php:326
2360
+ msgid "Users"
2361
+ msgstr ""
2362
+
2363
+ #: includes/admin/tools/common.php:323 includes/topics/template.php:3379
2364
+ #: templates/default/bbpress/content-statistics.php:40
2365
+ msgid "Topic Tags"
2366
+ msgstr ""
2367
+
2368
+ #: includes/admin/tools/common.php:504
2369
+ msgid "All %s"
2370
+ msgstr ""
2371
+
2372
+ #: includes/admin/tools/help.php:30 includes/admin/tools/repair.php:29
2373
+ #: includes/admin/tools.php:499
2374
+ msgid "Repair Forums"
2375
+ msgstr ""
2376
+
2377
+ #: includes/admin/tools/help.php:31
2378
+ msgid ""
2379
+ "There is more detailed information available on the bbPress and BuddyPress "
2380
+ "codex for the following:"
2381
+ msgstr ""
2382
+
2383
+ #: includes/admin/tools/help.php:34
2384
+ msgid ""
2385
+ "BuddyPress Group Forums: <a "
2386
+ "href=\"https://codex.buddypress.org/getting-started/installing-group-and-"
2387
+ "sitewide-forums/\">Installing Group and Sitewide Forums</a> and <a "
2388
+ "href=\"https://codex.buddypress.org/getting-started/guides/migrating-from-"
2389
+ "old-forums-to-bbpress-2/\">Migrating from old forums to bbPress 2.2+</a>."
2390
+ msgstr ""
2391
+
2392
+ #: includes/admin/tools/help.php:35
2393
+ msgid ""
2394
+ "bbPress roles: <a "
2395
+ "href=\"https://codex.bbpress.org/bbpress-user-roles-and-capabilities/\" "
2396
+ "target=\"_blank\">bbPress User Roles and Capabilities</a>"
2397
+ msgstr ""
2398
+
2399
+ #: includes/admin/tools/help.php:38
2400
+ msgid ""
2401
+ "Also see <a href=\"https://codex.bbpress.org/repair-forums/\">bbPress: "
2402
+ "Repair Forums</a>."
2403
+ msgstr ""
2404
+
2405
+ #: includes/admin/tools/help.php:66 includes/admin/tools/reset.php:24
2406
+ #: includes/admin/tools.php:526
2407
+ msgid "Reset Forums"
2408
+ msgstr ""
2409
+
2410
+ #: includes/admin/tools/help.php:67
2411
+ msgid ""
2412
+ "Also see <a href=\"https://codex.bbpress.org/reset-forums/\">bbPress: Reset "
2413
+ "Forums</a>."
2414
+ msgstr ""
2415
+
2416
+ #: includes/admin/tools/help.php:96
2417
+ msgid ""
2418
+ "This screen provides access to all of the bbPress Import Forums settings "
2419
+ "and resources."
2420
+ msgstr ""
2421
+
2422
+ #: includes/admin/tools/help.php:98
2423
+ msgid ""
2424
+ "Also see the main article on the bbPress codex <a "
2425
+ "href=\"https://codex.bbpress.org/import-forums/\">bbPress: Import "
2426
+ "Forums</a>."
2427
+ msgstr ""
2428
+
2429
+ #: includes/admin/tools/help.php:105
2430
+ msgid "In the Database Settings you have a number of options:"
2431
+ msgstr ""
2432
+
2433
+ #: includes/admin/tools/help.php:108
2434
+ msgid ""
2435
+ "The settings in this section refer to the database connection strings used "
2436
+ "by your old forum software. The best way to determine the exact settings "
2437
+ "you need is to copy them from your legacy forums configuration file or "
2438
+ "contact your web hosting provider."
2439
+ msgstr ""
2440
+
2441
+ #: includes/admin/tools/help.php:116
2442
+ msgid "Importer Options"
2443
+ msgstr ""
2444
+
2445
+ #: includes/admin/tools/help.php:117
2446
+ msgid "In the Options you have a number of options:"
2447
+ msgstr ""
2448
+
2449
+ #: includes/admin/tools/help.php:120
2450
+ msgid ""
2451
+ "Depending on your MySQL configuration you can tweak the \"Rows Limit\" and "
2452
+ "\"Delay Time\" that may help to improve the overall time it takes to "
2453
+ "perform a complete forum import."
2454
+ msgstr ""
2455
+
2456
+ #: includes/admin/tools/help.php:121
2457
+ msgid "\"Convert Users\" will import your legacy forum members as WordPress Users."
2458
+ msgstr ""
2459
+
2460
+ #: includes/admin/tools/help.php:122
2461
+ msgid ""
2462
+ "\"Start Over\" will start the importer fresh, if your import failed for any "
2463
+ "reason leaving this setting unchecked the importer will begin from where it "
2464
+ "left off."
2465
+ msgstr ""
2466
+
2467
+ #: includes/admin/tools/help.php:123
2468
+ msgid ""
2469
+ "\"Purge Previous Import\" will remove data imported from a failed import "
2470
+ "without removing your existing forum data."
2471
+ msgstr ""
2472
+
2473
+ #: includes/admin/tools/repair.php:31
2474
+ msgid ""
2475
+ "bbPress keeps track of relationships between forums, topics, replies, "
2476
+ "topic-tags, favorites, subscriptions, and users. Occasionally these "
2477
+ "relationships become out of sync, most often after an import or migration. "
2478
+ "Use the tools below to manually recalculate these relationships."
2479
+ msgstr ""
2480
+
2481
+ #: includes/admin/tools/repair.php:32
2482
+ msgid ""
2483
+ "Some of these tools create substantial database overhead. Use caution when "
2484
+ "running more than 1 repair at a time."
2485
+ msgstr ""
2486
+
2487
+ #: includes/admin/tools/repair.php:45 includes/admin/tools/repair.php:147
2488
+ #: includes/admin/tools/upgrade.php:42 includes/admin/tools/upgrade.php:144
2489
+ msgid "Select bulk action"
2490
+ msgstr ""
2491
+
2492
+ #: includes/admin/tools/repair.php:48 includes/admin/tools/repair.php:95
2493
+ #: includes/admin/tools/repair.php:150 includes/admin/tools/upgrade.php:45
2494
+ #: includes/admin/tools/upgrade.php:92 includes/admin/tools/upgrade.php:147
2495
+ msgid "Run"
2496
+ msgstr ""
2497
+
2498
+ #: includes/admin/tools/repair.php:50 includes/admin/tools/repair.php:152
2499
+ #: includes/admin/tools/upgrade.php:47 includes/admin/tools/upgrade.php:149
2500
+ msgid "Apply"
2501
+ msgstr ""
2502
+
2503
+ #: includes/admin/tools/repair.php:64 includes/admin/tools/repair.php:135
2504
+ #: includes/admin/tools/upgrade.php:61 includes/admin/tools/upgrade.php:132
2505
+ msgid "Select All"
2506
+ msgstr ""
2507
+
2508
+ #: includes/admin/tools/repair.php:68 includes/admin/tools/repair.php:85
2509
+ #: includes/admin/tools/repair.php:139 includes/admin/tools/upgrade.php:65
2510
+ #: includes/admin/tools/upgrade.php:82 includes/admin/tools/upgrade.php:136
2511
+ msgid "Description"
2512
+ msgstr ""
2513
+
2514
+ #: includes/admin/tools/repair.php:69 includes/admin/tools/repair.php:102
2515
+ #: includes/admin/tools/repair.php:140 includes/admin/tools/upgrade.php:66
2516
+ #: includes/admin/tools/upgrade.php:99 includes/admin/tools/upgrade.php:137
2517
+ msgid "Components"
2518
+ msgstr ""
2519
+
2520
+ #: includes/admin/tools/repair.php:70 includes/admin/tools/repair.php:109
2521
+ #: includes/admin/tools/repair.php:141 includes/admin/tools/upgrade.php:67
2522
+ #: includes/admin/tools/upgrade.php:106 includes/admin/tools/upgrade.php:138
2523
+ msgid "Overhead"
2524
+ msgstr ""
2525
+
2526
+ #: includes/admin/tools/repair.php:95 includes/admin/tools/upgrade.php:92
2527
+ msgid "Run %s"
2528
+ msgstr ""
2529
+
2530
+ #: includes/admin/tools/repair.php:99 includes/admin/tools/upgrade.php:96
2531
+ msgid "Show more details"
2532
+ msgstr ""
2533
+
2534
+ #: includes/admin/tools/repair.php:124 includes/admin/tools/upgrade.php:121
2535
+ msgid "No repair tools match this criteria."
2536
+ msgstr ""
2537
+
2538
+ #: includes/admin/tools/repair.php:172
2539
+ msgid "Counting the number of replies in each topic&hellip; %s"
2540
+ msgstr ""
2541
+
2542
+ #: includes/admin/tools/repair.php:173 includes/admin/tools/repair.php:222
2543
+ #: includes/admin/tools/repair.php:274 includes/admin/tools/repair.php:308
2544
+ #: includes/admin/tools/repair.php:339 includes/admin/tools/repair.php:384
2545
+ #: includes/admin/tools/repair.php:425 includes/admin/tools/repair.php:473
2546
+ #: includes/admin/tools/repair.php:521 includes/admin/tools/repair.php:588
2547
+ #: includes/admin/tools/repair.php:653 includes/admin/tools/repair.php:722
2548
+ #: includes/admin/tools/repair.php:830 includes/admin/tools/repair.php:951
2549
+ #: includes/admin/tools/repair.php:1063 includes/admin/tools/repair.php:1083
2550
+ #: includes/admin/tools/repair.php:1134 includes/admin/tools/reset.php:99
2551
+ #: includes/admin/tools/upgrade.php:242
2552
+ msgid "Failed!"
2553
+ msgstr ""
2554
+
2555
+ #: includes/admin/tools/repair.php:207 includes/admin/tools/repair.php:259
2556
+ #: includes/admin/tools/repair.php:293 includes/admin/tools/repair.php:325
2557
+ #: includes/admin/tools/repair.php:369 includes/admin/tools/repair.php:410
2558
+ #: includes/admin/tools/repair.php:458 includes/admin/tools/repair.php:506
2559
+ #: includes/admin/tools/repair.php:573 includes/admin/tools/repair.php:638
2560
+ #: includes/admin/tools/repair.php:703 includes/admin/tools/repair.php:936
2561
+ #: includes/admin/tools/repair.php:996 includes/admin/tools/repair.php:1067
2562
+ #: includes/admin/tools/repair.php:1119 includes/admin/tools/repair.php:1170
2563
+ #: includes/admin/tools/repair.php:1223
2564
+ msgid "Complete!"
2565
+ msgstr ""
2566
+
2567
+ #: includes/admin/tools/repair.php:221
2568
+ msgid "Counting the number of voices in each topic&hellip; %s"
2569
+ msgstr ""
2570
+
2571
+ #: includes/admin/tools/repair.php:273
2572
+ msgid ""
2573
+ "Counting the number of pending, spammed, and trashed replies in each "
2574
+ "topic&hellip; %s"
2575
+ msgstr ""
2576
+
2577
+ #: includes/admin/tools/repair.php:307
2578
+ msgid "Counting the number of topics in each forum&hellip; %s"
2579
+ msgstr ""
2580
+
2581
+ #: includes/admin/tools/repair.php:338
2582
+ msgid "Counting the number of topics in each topic-tag&hellip; %s"
2583
+ msgstr ""
2584
+
2585
+ #: includes/admin/tools/repair.php:383
2586
+ msgid "Counting the number of replies in each forum&hellip; %s"
2587
+ msgstr ""
2588
+
2589
+ #: includes/admin/tools/repair.php:424
2590
+ msgid "Counting the number of topics each user has created&hellip; %s"
2591
+ msgstr ""
2592
+
2593
+ #: includes/admin/tools/repair.php:472
2594
+ msgid "Counting the number of topics to which each user has replied&hellip; %s"
2595
+ msgstr ""
2596
+
2597
+ #: includes/admin/tools/repair.php:520
2598
+ msgid "Removing unpublished topics from user favorites&hellip; %s"
2599
+ msgstr ""
2600
+
2601
+ #: includes/admin/tools/repair.php:556 includes/admin/tools/repair.php:621
2602
+ #: includes/admin/tools/repair.php:686
2603
+ msgid "Nothing to remove!"
2604
+ msgstr ""
2605
+
2606
+ #: includes/admin/tools/repair.php:587
2607
+ msgid "Removing trashed topics from user subscriptions&hellip; %s"
2608
+ msgstr ""
2609
+
2610
+ #: includes/admin/tools/repair.php:652
2611
+ msgid "Removing trashed forums from user subscriptions&hellip; %s"
2612
+ msgstr ""
2613
+
2614
+ #: includes/admin/tools/repair.php:715
2615
+ msgid "Remapping forum role for each user on this site&hellip; %s"
2616
+ msgstr ""
2617
+
2618
+ #: includes/admin/tools/repair.php:813
2619
+ msgid "Complete! %s users updated."
2620
+ msgstr ""
2621
+
2622
+ #: includes/admin/tools/repair.php:829
2623
+ msgid "Recomputing latest post in every topic and forum&hellip; %s"
2624
+ msgstr ""
2625
+
2626
+ #: includes/admin/tools/repair.php:950
2627
+ msgid "Repairing the sticky topic to the parent forum relationships&hellip; %s"
2628
+ msgstr ""
2629
+
2630
+ #: includes/admin/tools/repair.php:1015
2631
+ msgid "Repairing closed topics&hellip; %s"
2632
+ msgstr ""
2633
+
2634
+ #: includes/admin/tools/repair.php:1016
2635
+ msgid "No closed topics to repair."
2636
+ msgstr ""
2637
+
2638
+ #: includes/admin/tools/repair.php:1046
2639
+ msgid "Complete! %d closed topic repaired."
2640
+ msgid_plural "Complete! %d closed topics repaired."
2641
+ msgstr[0] ""
2642
+ msgstr[1] ""
2643
+
2644
+ #: includes/admin/tools/repair.php:1059
2645
+ msgid "Recalculating forum visibility&hellip; %s"
2646
+ msgstr ""
2647
+
2648
+ #: includes/admin/tools/repair.php:1082
2649
+ msgid "Recalculating the forum for each post&hellip; %s"
2650
+ msgstr ""
2651
+
2652
+ #: includes/admin/tools/repair.php:1133
2653
+ msgid "Recalculating the topic for each post&hellip; %s"
2654
+ msgstr ""
2655
+
2656
+ #: includes/admin/tools/repair.php:1184
2657
+ msgid "Recalculating reply menu order&hellip; %s"
2658
+ msgstr ""
2659
+
2660
+ #: includes/admin/tools/repair.php:1185
2661
+ msgid "No reply positions to recalculate."
2662
+ msgstr ""
2663
+
2664
+ #: includes/admin/tools/reset.php:25
2665
+ msgid ""
2666
+ "Revert your forums back to a brand new installation, as if bbPress were "
2667
+ "never installed. This process cannot be undone."
2668
+ msgstr ""
2669
+
2670
+ #: includes/admin/tools/reset.php:31
2671
+ msgid "The following data will be removed:"
2672
+ msgstr ""
2673
+
2674
+ #: includes/admin/tools/reset.php:33 includes/forums/template.php:51
2675
+ msgid "All Forums"
2676
+ msgstr ""
2677
+
2678
+ #: includes/admin/tools/reset.php:34 includes/topics/functions.php:3653
2679
+ #: includes/topics/template.php:50
2680
+ msgid "All Topics"
2681
+ msgstr ""
2682
+
2683
+ #: includes/admin/tools/reset.php:35 includes/replies/functions.php:2057
2684
+ #: includes/replies/template.php:52
2685
+ msgid "All Replies"
2686
+ msgstr ""
2687
+
2688
+ #: includes/admin/tools/reset.php:36
2689
+ msgid "All Topic Tags"
2690
+ msgstr ""
2691
+
2692
+ #: includes/admin/tools/reset.php:37
2693
+ msgid "All Meta Data"
2694
+ msgstr ""
2695
+
2696
+ #: includes/admin/tools/reset.php:38
2697
+ msgid "Forum Settings"
2698
+ msgstr ""
2699
+
2700
+ #: includes/admin/tools/reset.php:39
2701
+ msgid "Forum Activity"
2702
+ msgstr ""
2703
+
2704
+ #: includes/admin/tools/reset.php:40
2705
+ msgid "Forum User Roles"
2706
+ msgstr ""
2707
+
2708
+ #: includes/admin/tools/reset.php:42
2709
+ msgid "Importer Helper Data"
2710
+ msgstr ""
2711
+
2712
+ #: includes/admin/tools/reset.php:46
2713
+ msgid "Delete imported users?"
2714
+ msgstr ""
2715
+
2716
+ #: includes/admin/tools/reset.php:49 includes/admin/tools/reset.php:59
2717
+ msgid "Say it ain't so!"
2718
+ msgstr ""
2719
+
2720
+ #: includes/admin/tools/reset.php:50
2721
+ msgid "This option will delete all previously imported users, and cannot be undone."
2722
+ msgstr ""
2723
+
2724
+ #: includes/admin/tools/reset.php:51
2725
+ msgid ""
2726
+ "Proceeding without this checked removes the meta-data necessary to delete "
2727
+ "these users later."
2728
+ msgstr ""
2729
+
2730
+ #: includes/admin/tools/reset.php:56
2731
+ msgid "Do you really want to do this?"
2732
+ msgstr ""
2733
+
2734
+ #: includes/admin/tools/reset.php:60
2735
+ #: templates/default/bbpress/form-reply-move.php:76
2736
+ #: templates/default/bbpress/form-topic-merge.php:98
2737
+ #: templates/default/bbpress/form-topic-split.php:102
2738
+ msgid "This process cannot be undone."
2739
+ msgstr ""
2740
+
2741
+ #: includes/admin/tools/reset.php:61
2742
+ msgid "Backup your database before proceeding."
2743
+ msgstr ""
2744
+
2745
+ #: includes/admin/tools/reset.php:69
2746
+ msgid "Reset bbPress"
2747
+ msgstr ""
2748
+
2749
+ #: includes/admin/tools/reset.php:100
2750
+ msgid "Success!"
2751
+ msgstr ""
2752
+
2753
+ #: includes/admin/tools/reset.php:114
2754
+ msgid "Deleting Posts&hellip; %s"
2755
+ msgstr ""
2756
+
2757
+ #: includes/admin/tools/reset.php:128
2758
+ msgid "Deleting Post Meta&hellip; %s"
2759
+ msgstr ""
2760
+
2761
+ #: includes/admin/tools/reset.php:142
2762
+ msgid "Deleting Post Revisions&hellip; %s"
2763
+ msgstr ""
2764
+
2765
+ #: includes/admin/tools/reset.php:151
2766
+ msgid "Deleting Forum Moderators&hellip; %s"
2767
+ msgstr ""
2768
+
2769
+ #: includes/admin/tools/reset.php:158
2770
+ msgid "Deleting Topic Tags&hellip; %s"
2771
+ msgstr ""
2772
+
2773
+ #: includes/admin/tools/reset.php:173
2774
+ msgid "Deleting Imported Users&hellip; %s"
2775
+ msgstr ""
2776
+
2777
+ #: includes/admin/tools/reset.php:178
2778
+ msgid "Deleting Imported User Meta&hellip; %s"
2779
+ msgstr ""
2780
+
2781
+ #: includes/admin/tools/reset.php:186
2782
+ msgid "Deleting User Meta&hellip; %s"
2783
+ msgstr ""
2784
+
2785
+ #: includes/admin/tools/reset.php:193
2786
+ msgid "Deleting Conversion Table&hellip; %s"
2787
+ msgstr ""
2788
+
2789
+ #: includes/admin/tools/reset.php:205
2790
+ msgid "Deleting Settings&hellip; %s"
2791
+ msgstr ""
2792
+
2793
+ #: includes/admin/tools/reset.php:211
2794
+ msgid "Deleting Roles and Capabilities&hellip; %s"
2795
+ msgstr ""
2796
+
2797
+ #: includes/admin/tools/upgrade.php:26 includes/admin/tools.php:508
2798
+ msgid "Upgrade Forums"
2799
+ msgstr ""
2800
+
2801
+ #: includes/admin/tools/upgrade.php:28
2802
+ msgid ""
2803
+ "As bbPress improves, occasionally database upgrades are required but some "
2804
+ "forums are too large to upgrade automatically. Use the tools below to "
2805
+ "manually run upgrade routines."
2806
+ msgstr ""
2807
+
2808
+ #: includes/admin/tools/upgrade.php:29
2809
+ msgid ""
2810
+ "Some of these tools create substantial database overhead. Use caution when "
2811
+ "running more than 1 upgrade at a time."
2812
+ msgstr ""
2813
+
2814
+ #: includes/admin/tools/upgrade.php:169
2815
+ msgid "Upgrading user engagements&hellip; %s"
2816
+ msgstr ""
2817
+
2818
+ #: includes/admin/tools/upgrade.php:170
2819
+ msgid "No engagements to upgrade."
2820
+ msgstr ""
2821
+
2822
+ #: includes/admin/tools/upgrade.php:203
2823
+ msgid "Complete! %d engagements upgraded."
2824
+ msgid_plural "Complete! %d engagements upgraded."
2825
+ msgstr[0] ""
2826
+ msgstr[1] ""
2827
+
2828
+ #: includes/admin/tools/upgrade.php:221
2829
+ msgid "Upgrading BuddyPress group-forum relationships&hellip; %s"
2830
+ msgstr ""
2831
+
2832
+ #: includes/admin/tools/upgrade.php:326
2833
+ msgid "group-forums"
2834
+ msgstr ""
2835
+
2836
+ #: includes/admin/tools/upgrade.php:342
2837
+ msgid "Complete! %s groups updated; %s forums updated; %s forum statuses synced."
2838
+ msgstr ""
2839
+
2840
+ #: includes/admin/tools/upgrade.php:357
2841
+ msgid "Upgrading user favorites&hellip; %s"
2842
+ msgstr ""
2843
+
2844
+ #: includes/admin/tools/upgrade.php:358
2845
+ msgid "No favorites to upgrade."
2846
+ msgstr ""
2847
+
2848
+ #: includes/admin/tools/upgrade.php:401
2849
+ msgid "Complete! %d favorite upgraded."
2850
+ msgid_plural "Complete! %d favorites upgraded."
2851
+ msgstr[0] ""
2852
+ msgstr[1] ""
2853
+
2854
+ #: includes/admin/tools/upgrade.php:417
2855
+ msgid "Upgrading user topic subscriptions&hellip; %s"
2856
+ msgstr ""
2857
+
2858
+ #: includes/admin/tools/upgrade.php:418
2859
+ msgid "No topic subscriptions to upgrade."
2860
+ msgstr ""
2861
+
2862
+ #: includes/admin/tools/upgrade.php:461
2863
+ msgid "Complete! %d topic subscription upgraded."
2864
+ msgid_plural "Complete! %d topic subscriptions upgraded."
2865
+ msgstr[0] ""
2866
+ msgstr[1] ""
2867
+
2868
+ #: includes/admin/tools/upgrade.php:477
2869
+ msgid "Upgrading user forum subscriptions&hellip; %s"
2870
+ msgstr ""
2871
+
2872
+ #: includes/admin/tools/upgrade.php:478
2873
+ msgid "No forum subscriptions to upgrade."
2874
+ msgstr ""
2875
+
2876
+ #: includes/admin/tools/upgrade.php:521
2877
+ msgid "Complete! %d forum subscription upgraded."
2878
+ msgid_plural "Complete! %d forum subscriptions upgraded."
2879
+ msgstr[0] ""
2880
+ msgstr[1] ""
2881
+
2882
+ #: includes/admin/tools/upgrade.php:537
2883
+ msgid "Remove favorites from usermeta&hellip; %s"
2884
+ msgstr ""
2885
+
2886
+ #: includes/admin/tools/upgrade.php:538
2887
+ msgid "No favorites to remove."
2888
+ msgstr ""
2889
+
2890
+ #: includes/admin/tools/upgrade.php:557
2891
+ msgid "Complete! %d favorites deleted."
2892
+ msgid_plural "Complete! %d favorites deleted."
2893
+ msgstr[0] ""
2894
+ msgstr[1] ""
2895
+
2896
+ #: includes/admin/tools/upgrade.php:573
2897
+ msgid "Remove topic subscriptions from usermeta&hellip; %s"
2898
+ msgstr ""
2899
+
2900
+ #: includes/admin/tools/upgrade.php:574
2901
+ msgid "No topic subscriptions to remove."
2902
+ msgstr ""
2903
+
2904
+ #: includes/admin/tools/upgrade.php:593
2905
+ msgid "Complete! %d topic subscription deleted."
2906
+ msgid_plural "Complete! %d topic subscriptions deleted."
2907
+ msgstr[0] ""
2908
+ msgstr[1] ""
2909
+
2910
+ #: includes/admin/tools/upgrade.php:609
2911
+ msgid "Remove forum subscriptions from usermeta&hellip; %s"
2912
+ msgstr ""
2913
+
2914
+ #: includes/admin/tools/upgrade.php:610
2915
+ msgid "No forum subscriptions to remove."
2916
+ msgstr ""
2917
+
2918
+ #: includes/admin/tools/upgrade.php:629
2919
+ msgid "Complete! %d forum subscription deleted."
2920
+ msgid_plural "Complete! %d forum subscriptions deleted."
2921
+ msgstr[0] ""
2922
+ msgstr[1] ""
2923
+
2924
+ #: includes/admin/tools.php:31
2925
+ msgid "bbPress provides the following tools to help you manage your forums:"
2926
+ msgstr ""
2927
+
2928
+ #: includes/admin/tools.php:77
2929
+ msgid "The repair was completed successfully"
2930
+ msgstr ""
2931
+
2932
+ #: includes/admin/tools.php:78
2933
+ msgid "The repair was not successful"
2934
+ msgstr ""
2935
+
2936
+ #: includes/admin/tools.php:113
2937
+ msgid "Recalculate parent topic for each reply"
2938
+ msgstr ""
2939
+
2940
+ #: includes/admin/tools.php:114
2941
+ msgid "Run this if replies appear in the wrong topics."
2942
+ msgstr ""
2943
+
2944
+ #: includes/admin/tools.php:125
2945
+ msgid "Recalculate parent forum for each topic and reply"
2946
+ msgstr ""
2947
+
2948
+ #: includes/admin/tools.php:126
2949
+ msgid "Run this if topics or replies appear in the wrong forums."
2950
+ msgstr ""
2951
+
2952
+ #: includes/admin/tools.php:137
2953
+ msgid "Recalculate private and hidden forums"
2954
+ msgstr ""
2955
+
2956
+ #: includes/admin/tools.php:138
2957
+ msgid "Run this if non-public forums are publicly visible."
2958
+ msgstr ""
2959
+
2960
+ #: includes/admin/tools.php:149
2961
+ msgid "Recalculate last activity in each topic and forum"
2962
+ msgstr ""
2963
+
2964
+ #: includes/admin/tools.php:150
2965
+ msgid "Run this if freshness appears incorrectly."
2966
+ msgstr ""
2967
+
2968
+ #: includes/admin/tools.php:161
2969
+ msgid "Recalculate sticky relationship of each topic"
2970
+ msgstr ""
2971
+
2972
+ #: includes/admin/tools.php:162
2973
+ msgid "Run this if sticky topics appear incorrectly."
2974
+ msgstr ""
2975
+
2976
+ #: includes/admin/tools.php:173
2977
+ msgid "Recalculate position of each reply in each topic"
2978
+ msgstr ""
2979
+
2980
+ #: includes/admin/tools.php:174
2981
+ msgid "Run this if replies appear in the wrong order."
2982
+ msgstr ""
2983
+
2984
+ #: includes/admin/tools.php:185
2985
+ msgid "Recalculate engagements in each topic for each user"
2986
+ msgstr ""
2987
+
2988
+ #: includes/admin/tools.php:186
2989
+ msgid "Run this if voices appear incorrectly."
2990
+ msgstr ""
2991
+
2992
+ #: includes/admin/tools.php:197
2993
+ msgid "Repair closed topic statuses"
2994
+ msgstr ""
2995
+
2996
+ #: includes/admin/tools.php:198
2997
+ msgid "Run this if closed topics appear incorrectly."
2998
+ msgstr ""
2999
+
3000
+ #: includes/admin/tools.php:209
3001
+ msgid "Recount topics in each forum"
3002
+ msgstr ""
3003
+
3004
+ #: includes/admin/tools.php:210
3005
+ msgid "Run this if the number of topics in any forums are incorrect."
3006
+ msgstr ""
3007
+
3008
+ #: includes/admin/tools.php:221
3009
+ msgid "Recount topics in each topic-tag"
3010
+ msgstr ""
3011
+
3012
+ #: includes/admin/tools.php:222
3013
+ msgid "Run this if the number of topics in any topic-tags are incorrect."
3014
+ msgstr ""
3015
+
3016
+ #: includes/admin/tools.php:233
3017
+ msgid "Recount replies in each forum"
3018
+ msgstr ""
3019
+
3020
+ #: includes/admin/tools.php:234
3021
+ msgid "Run this if the number of replies in any forums are incorrect."
3022
+ msgstr ""
3023
+
3024
+ #: includes/admin/tools.php:245
3025
+ msgid "Recount replies in each topic"
3026
+ msgstr ""
3027
+
3028
+ #: includes/admin/tools.php:246
3029
+ msgid "Run this if the number of topics in any topics are incorrect."
3030
+ msgstr ""
3031
+
3032
+ #: includes/admin/tools.php:257
3033
+ msgid "Recount pending, spammed, and trashed replies in each topic"
3034
+ msgstr ""
3035
+
3036
+ #: includes/admin/tools.php:258
3037
+ msgid "Run this if non-public replies display incorrectly."
3038
+ msgstr ""
3039
+
3040
+ #: includes/admin/tools.php:269
3041
+ msgid "Recount topics for each user"
3042
+ msgstr ""
3043
+
3044
+ #: includes/admin/tools.php:270
3045
+ msgid "Run this to get fresh topic counts for all users."
3046
+ msgstr ""
3047
+
3048
+ #: includes/admin/tools.php:281
3049
+ msgid "Recount replies for each user"
3050
+ msgstr ""
3051
+
3052
+ #: includes/admin/tools.php:282
3053
+ msgid "Run this to get fresh reply counts for all users."
3054
+ msgstr ""
3055
+
3056
+ #: includes/admin/tools.php:293
3057
+ msgid "Remove unpublished topics from user favorites"
3058
+ msgstr ""
3059
+
3060
+ #: includes/admin/tools.php:294
3061
+ msgid "Run this to remove trashed or deleted topics from all user favorites."
3062
+ msgstr ""
3063
+
3064
+ #: includes/admin/tools.php:305
3065
+ msgid "Remove unpublished topics from user subscriptions"
3066
+ msgstr ""
3067
+
3068
+ #: includes/admin/tools.php:306
3069
+ msgid "Run this to remove trashed or deleted topics from all user subscriptions."
3070
+ msgstr ""
3071
+
3072
+ #: includes/admin/tools.php:317
3073
+ msgid "Remove unpublished forums from user subscriptions"
3074
+ msgstr ""
3075
+
3076
+ #: includes/admin/tools.php:318
3077
+ msgid "Run this to remove trashed or deleted forums from all user subscriptions."
3078
+ msgstr ""
3079
+
3080
+ #: includes/admin/tools.php:329
3081
+ msgid "Remap all users to default forum roles"
3082
+ msgstr ""
3083
+
3084
+ #: includes/admin/tools.php:330
3085
+ msgid "Run this if users have issues accessing the forums."
3086
+ msgstr ""
3087
+
3088
+ #: includes/admin/tools.php:341
3089
+ msgid "Upgrade user topic engagements"
3090
+ msgstr ""
3091
+
3092
+ #: includes/admin/tools.php:342 includes/admin/tools.php:354
3093
+ #: includes/admin/tools.php:366 includes/admin/tools.php:378
3094
+ msgid "Run this if you just upgraded to 2.6."
3095
+ msgstr ""
3096
+
3097
+ #: includes/admin/tools.php:353
3098
+ msgid "Upgrade user topic favorites"
3099
+ msgstr ""
3100
+
3101
+ #: includes/admin/tools.php:365
3102
+ msgid "Upgrade user topic subscriptions"
3103
+ msgstr ""
3104
+
3105
+ #: includes/admin/tools.php:377
3106
+ msgid "Upgrade user forum subscriptions"
3107
+ msgstr ""
3108
+
3109
+ #: includes/admin/tools.php:389
3110
+ msgid "Remove favorites from user-meta"
3111
+ msgstr ""
3112
+
3113
+ #: includes/admin/tools.php:390
3114
+ msgid ""
3115
+ "Run this to delete old data, after confirming successful favorites upgrade "
3116
+ "above."
3117
+ msgstr ""
3118
+
3119
+ #: includes/admin/tools.php:401
3120
+ msgid "Remove topic subscriptions from user-meta"
3121
+ msgstr ""
3122
+
3123
+ #: includes/admin/tools.php:402
3124
+ msgid ""
3125
+ "Run this to delete old data, after confirming successful topic "
3126
+ "subscriptions upgrade above."
3127
+ msgstr ""
3128
+
3129
+ #: includes/admin/tools.php:413
3130
+ msgid "Remove forum subscriptions from user-meta"
3131
+ msgstr ""
3132
+
3133
+ #: includes/admin/tools.php:414
3134
+ msgid ""
3135
+ "Run this to delete old data, after confirming successful forum "
3136
+ "subscriptions upgrade above."
3137
+ msgstr ""
3138
+
3139
+ #: includes/admin/tools.php:425
3140
+ msgid "Upgrade BuddyPress Group Forum relationships"
3141
+ msgstr ""
3142
+
3143
+ #: includes/admin/tools.php:426
3144
+ msgid "Run this if you just upgraded BuddyPress Forums from Legacy."
3145
+ msgstr ""
3146
+
3147
+ #: includes/admin/topics.php:118
3148
+ msgid ""
3149
+ "This screen displays the individual topics on your site. You can customize "
3150
+ "the display of this screen to suit your workflow."
3151
+ msgstr ""
3152
+
3153
+ #: includes/admin/topics.php:128
3154
+ msgid ""
3155
+ "You can hide/display columns based on your needs and decide how many topics "
3156
+ "to list per screen using the Screen Options tab."
3157
+ msgstr ""
3158
+
3159
+ #: includes/admin/topics.php:129
3160
+ msgid ""
3161
+ "You can filter the list of topics by topic status using the text links in "
3162
+ "the upper left to show All, Published, Draft, Pending, Trashed, Closed, or "
3163
+ "Spam topics. The default view is to show all topics."
3164
+ msgstr ""
3165
+
3166
+ #: includes/admin/topics.php:130
3167
+ msgid ""
3168
+ "You can view topics in a simple title list or with an excerpt. Choose the "
3169
+ "view you prefer by clicking on the icons at the top of the list on the "
3170
+ "right."
3171
+ msgstr ""
3172
+
3173
+ #: includes/admin/topics.php:131
3174
+ msgid ""
3175
+ "You can refine the list to show only topics in a specific forum or from a "
3176
+ "specific month by using the dropdown menus above the topics list. Click the "
3177
+ "Filter button after making your selection."
3178
+ msgstr ""
3179
+
3180
+ #: includes/admin/topics.php:140
3181
+ msgid ""
3182
+ "Hovering over a row in the topics list will display action links that allow "
3183
+ "you to manage your topic. You can perform the following actions:"
3184
+ msgstr ""
3185
+
3186
+ #: includes/admin/topics.php:142
3187
+ msgid ""
3188
+ "<strong>Edit</strong> takes you to the editing screen for that topic. You "
3189
+ "can also reach that screen by clicking on the topic title."
3190
+ msgstr ""
3191
+
3192
+ #: includes/admin/topics.php:143
3193
+ msgid ""
3194
+ "<strong>Trash</strong> removes your topic from this list and places it in "
3195
+ "the trash, from which you can permanently delete it."
3196
+ msgstr ""
3197
+
3198
+ #: includes/admin/topics.php:144
3199
+ msgid ""
3200
+ "<strong>Spam</strong> removes your topic from this list and places it in "
3201
+ "the spam queue, from which you can permanently delete it."
3202
+ msgstr ""
3203
+
3204
+ #: includes/admin/topics.php:145
3205
+ msgid "<strong>View</strong> will take you to your live site to view the topic."
3206
+ msgstr ""
3207
+
3208
+ #: includes/admin/topics.php:147
3209
+ msgid ""
3210
+ "<strong>Close</strong> will mark the selected topic as &#8217;closed&#8217; "
3211
+ "and disable the option to post new replies to the topic."
3212
+ msgstr ""
3213
+
3214
+ #: includes/admin/topics.php:148
3215
+ msgid ""
3216
+ "<strong>Stick</strong> will keep the selected topic &#8217;pinned&#8217; to "
3217
+ "the top the parent forum topic list."
3218
+ msgstr ""
3219
+
3220
+ #: includes/admin/topics.php:149
3221
+ msgid ""
3222
+ "<strong>Stick <em>(to front)</em></strong> will keep the selected topic "
3223
+ "&#8217;pinned&#8217; to the top of ALL forums and be visable in any forums "
3224
+ "topics list."
3225
+ msgstr ""
3226
+
3227
+ #: includes/admin/topics.php:158
3228
+ msgid ""
3229
+ "You can also edit, spam, or move multiple topics to the trash at once. "
3230
+ "Select the topics you want to act on using the checkboxes, then select the "
3231
+ "action you want to take from the Bulk Actions menu and click Apply."
3232
+ msgstr ""
3233
+
3234
+ #: includes/admin/topics.php:159
3235
+ msgid ""
3236
+ "When using Bulk Edit, you can change the metadata (categories, author, "
3237
+ "etc.) for all selected topics at once. To remove a topic from the grouping, "
3238
+ "just click the x next to its name in the Bulk Edit area that appears."
3239
+ msgstr ""
3240
+
3241
+ #: includes/admin/topics.php:177
3242
+ msgid ""
3243
+ "The title field and the big topic editing Area are fixed in place, but you "
3244
+ "can reposition all the other boxes using drag and drop, and can minimize or "
3245
+ "expand them by clicking the title bar of each box. Use the Screen Options "
3246
+ "tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, "
3247
+ "Discussion, Slug, Author) or to choose a 1- or 2-column layout for this "
3248
+ "screen."
3249
+ msgstr ""
3250
+
3251
+ #: includes/admin/topics.php:187
3252
+ msgid "Title and Topic Editor"
3253
+ msgstr ""
3254
+
3255
+ #: includes/admin/topics.php:189
3256
+ msgid ""
3257
+ "<strong>Title</strong> - Enter a title for your topic. After you enter a "
3258
+ "title, you&#8217;ll see the permalink below, which you can edit."
3259
+ msgstr ""
3260
+
3261
+ #: includes/admin/topics.php:190
3262
+ msgid ""
3263
+ "<strong>Topic Editor</strong> - Enter the text for your topic. There are "
3264
+ "two modes of editing: Visual and HTML. Choose the mode by clicking on the "
3265
+ "appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last "
3266
+ "icon in the row to get a second row of controls. The HTML mode allows you "
3267
+ "to enter raw HTML along with your topic text. You can insert media files by "
3268
+ "clicking the icons above the topic editor and following the directions. You "
3269
+ "can go to the distraction-free writing screen via the Fullscreen icon in "
3270
+ "Visual mode (second to last in the top row) or the Fullscreen button in "
3271
+ "HTML mode (last in the row). Once there, you can make buttons visible by "
3272
+ "hovering over the top area. Exit Fullscreen back to the regular topic "
3273
+ "editor."
3274
+ msgstr ""
3275
+
3276
+ #: includes/admin/topics.php:193
3277
+ msgid ""
3278
+ "<strong>Publish</strong> - You can set the terms of publishing your topic "
3279
+ "in the Publish box. For Status, Visibility, and Publish (immediately), "
3280
+ "click on the Edit link to reveal more options. Visibility includes options "
3281
+ "for password-protecting a topic or making it stay at the top of your blog "
3282
+ "indefinitely (sticky). Publish (immediately) allows you to set a future or "
3283
+ "past date and time, so you can schedule a topic to be published in the "
3284
+ "future or backdate a topic."
3285
+ msgstr ""
3286
+
3287
+ #: includes/admin/topics.php:196
3288
+ msgid ""
3289
+ "<strong>Featured Image</strong> - This allows you to associate an image "
3290
+ "with your topic without inserting it. This is usually useful only if your "
3291
+ "theme makes use of the featured image as a topic thumbnail on the home "
3292
+ "page, a custom header, etc."
3293
+ msgstr ""
3294
+
3295
+ #: includes/admin/topics.php:201 includes/admin/topics.php:338
3296
+ msgid "Topic Attributes"
3297
+ msgstr ""
3298
+
3299
+ #: includes/admin/topics.php:203
3300
+ msgid "Select the attributes that your topic should have:"
3301
+ msgstr ""
3302
+
3303
+ #: includes/admin/topics.php:205
3304
+ msgid ""
3305
+ "<strong>Forum</strong> dropdown determines the parent forum that the topic "
3306
+ "belongs to. Select the forum or category from the dropdown, or leave the "
3307
+ "default \"No forum\" to post the topic without an assigned forum."
3308
+ msgstr ""
3309
+
3310
+ #: includes/admin/topics.php:206
3311
+ msgid ""
3312
+ "<strong>Topic Type</strong> dropdown indicates the sticky status of the "
3313
+ "topic. Selecting the super sticky option would stick the topic to the front "
3314
+ "of your forums, i.e. the topic index, sticky option would stick the topic "
3315
+ "to its respective forum. Selecting normal would not stick the topic "
3316
+ "anywhere."
3317
+ msgstr ""
3318
+
3319
+ #: includes/admin/topics.php:253
3320
+ msgid "%s topic updated."
3321
+ msgid_plural "%s topics updated."
3322
+ msgstr[0] ""
3323
+ msgstr[1] ""
3324
+
3325
+ #: includes/admin/topics.php:255
3326
+ msgid "1 topic not updated, somebody is editing it."
3327
+ msgstr ""
3328
+
3329
+ #: includes/admin/topics.php:256
3330
+ msgid "%s topic not updated, somebody is editing it."
3331
+ msgid_plural "%s topics not updated, somebody is editing them."
3332
+ msgstr[0] ""
3333
+ msgstr[1] ""
3334
+
3335
+ #: includes/admin/topics.php:289
3336
+ msgid "Error in spamming topic."
3337
+ msgstr ""
3338
+
3339
+ #: includes/admin/topics.php:305
3340
+ msgid "Sorry, you are not allowed to unspam this topic."
3341
+ msgstr ""
3342
+
3343
+ #: includes/admin/topics.php:314
3344
+ msgid "Error in unspamming topic."
3345
+ msgstr ""
3346
+
3347
+ #: includes/admin/topics.php:574
3348
+ msgid "The topic was not found."
3349
+ msgstr ""
3350
+
3351
+ #: includes/admin/topics.php:710
3352
+ msgid "There was a problem opening the topic \"%1$s\"."
3353
+ msgstr ""
3354
+
3355
+ #: includes/admin/topics.php:711
3356
+ msgid "Topic \"%1$s\" successfully opened."
3357
+ msgstr ""
3358
+
3359
+ #: includes/admin/topics.php:716
3360
+ msgid "There was a problem closing the topic \"%1$s\"."
3361
+ msgstr ""
3362
+
3363
+ #: includes/admin/topics.php:717
3364
+ msgid "Topic \"%1$s\" successfully closed."
3365
+ msgstr ""
3366
+
3367
+ #: includes/admin/topics.php:722
3368
+ msgid "There was a problem sticking the topic \"%1$s\" to front."
3369
+ msgstr ""
3370
+
3371
+ #: includes/admin/topics.php:723
3372
+ msgid "Topic \"%1$s\" successfully stuck to front."
3373
+ msgstr ""
3374
+
3375
+ #: includes/admin/topics.php:728
3376
+ msgid "There was a problem sticking the topic \"%1$s\"."
3377
+ msgstr ""
3378
+
3379
+ #: includes/admin/topics.php:729
3380
+ msgid "Topic \"%1$s\" successfully stuck."
3381
+ msgstr ""
3382
+
3383
+ #: includes/admin/topics.php:734
3384
+ msgid "There was a problem unsticking the topic \"%1$s\"."
3385
+ msgstr ""
3386
+
3387
+ #: includes/admin/topics.php:735
3388
+ msgid "Topic \"%1$s\" successfully unstuck."
3389
+ msgstr ""
3390
+
3391
+ #: includes/admin/topics.php:740
3392
+ msgid "There was a problem marking the topic \"%1$s\" as spam."
3393
+ msgstr ""
3394
+
3395
+ #: includes/admin/topics.php:741
3396
+ msgid "Topic \"%1$s\" successfully marked as spam."
3397
+ msgstr ""
3398
+
3399
+ #: includes/admin/topics.php:746
3400
+ msgid "There was a problem unmarking the topic \"%1$s\" as spam."
3401
+ msgstr ""
3402
+
3403
+ #: includes/admin/topics.php:747
3404
+ msgid "Topic \"%1$s\" successfully unmarked as spam."
3405
+ msgstr ""
3406
+
3407
+ #: includes/admin/topics.php:752
3408
+ msgid "There was a problem approving the topic \"%1$s\"."
3409
+ msgstr ""
3410
+
3411
+ #: includes/admin/topics.php:753
3412
+ msgid "Topic \"%1$s\" successfully approved."
3413
+ msgstr ""
3414
+
3415
+ #: includes/admin/topics.php:758
3416
+ msgid "There was a problem unapproving the topic \"%1$s\"."
3417
+ msgstr ""
3418
+
3419
+ #: includes/admin/topics.php:759
3420
+ msgid "Topic \"%1$s\" successfully unapproved."
3421
+ msgstr ""
3422
+
3423
+ #: includes/admin/topics.php:834 templates/default/bbpress/loop-topics.php:19
3424
+ msgid "Voices"
3425
+ msgstr ""
3426
+
3427
+ #: includes/admin/topics.php:912 includes/topics/template.php:2002
3428
+ msgid "No Replies"
3429
+ msgstr ""
3430
+
3431
+ #: includes/admin/topics.php:960
3432
+ msgid "Unapprove this topic"
3433
+ msgstr ""
3434
+
3435
+ #: includes/admin/topics.php:962
3436
+ msgid "Approve this topic"
3437
+ msgstr ""
3438
+
3439
+ #: includes/admin/topics.php:971
3440
+ msgid "Close this topic"
3441
+ msgstr ""
3442
+
3443
+ #: includes/admin/topics.php:973
3444
+ msgid "Open this topic"
3445
+ msgstr ""
3446
+
3447
+ #: includes/admin/topics.php:982
3448
+ msgid "Unstick this topic"
3449
+ msgstr ""
3450
+
3451
+ #: includes/admin/topics.php:982 includes/topics/template.php:2703
3452
+ msgid "Unstick"
3453
+ msgstr ""
3454
+
3455
+ #: includes/admin/topics.php:985
3456
+ msgid "Stick this topic to its forum"
3457
+ msgstr ""
3458
+
3459
+ #: includes/admin/topics.php:985 includes/topics/template.php:2702
3460
+ msgid "Stick"
3461
+ msgstr ""
3462
+
3463
+ #: includes/admin/topics.php:985
3464
+ msgid "Stick this topic to front"
3465
+ msgstr ""
3466
+
3467
+ #: includes/admin/topics.php:985 includes/topics/template.php:2704
3468
+ msgid "(to front)"
3469
+ msgstr ""
3470
+
3471
+ #: includes/admin/topics.php:992
3472
+ msgid "Mark the topic as not spam"
3473
+ msgstr ""
3474
+
3475
+ #: includes/admin/topics.php:994
3476
+ msgid "Mark this topic as spam"
3477
+ msgstr ""
3478
+
3479
+ #: includes/admin/topics.php:1099 includes/admin/topics.php:1111
3480
+ msgid "Topic updated."
3481
+ msgstr ""
3482
+
3483
+ #: includes/admin/topics.php:1116
3484
+ #. translators: %s: date and time of the revision
3485
+ msgid "Topic restored to revision from %s"
3486
+ msgstr ""
3487
+
3488
+ #: includes/admin/topics.php:1122
3489
+ msgid "Topic created."
3490
+ msgstr ""
3491
+
3492
+ #: includes/admin/topics.php:1128
3493
+ msgid "Topic saved."
3494
+ msgstr ""
3495
+
3496
+ #: includes/admin/topics.php:1133
3497
+ msgid "Topic submitted."
3498
+ msgstr ""
3499
+
3500
+ #: includes/admin/topics.php:1142
3501
+ msgid "Topic scheduled for: %s."
3502
+ msgstr ""
3503
+
3504
+ #: includes/admin/topics.php:1153
3505
+ msgid "Topic draft updated."
3506
+ msgstr ""
3507
+
3508
+ #: includes/admin/users.php:98 includes/admin/users.php:277
3509
+ #: includes/users/signups.php:26
3510
+ #: templates/default/bbpress/form-user-roles.php:23
3511
+ msgid "Forum Role"
3512
+ msgstr ""
3513
+
3514
+ #: includes/admin/users.php:107 includes/admin/users.php:111
3515
+ #: includes/users/template.php:1540
3516
+ msgid "&mdash; No role for these forums &mdash;"
3517
+ msgstr ""
3518
+
3519
+ #: includes/admin/users.php:164 includes/admin/users.php:166
3520
+ msgid "Change forum role to&hellip;"
3521
+ msgstr ""
3522
+
3523
+ #: includes/admin/users.php:170
3524
+ msgid "Change"
3525
+ msgstr ""
3526
+
3527
+ #: includes/admin/users.php:276
3528
+ msgid "Site Role"
3529
+ msgstr ""
3530
+
3531
+ #: includes/common/classes.php:493 includes/replies/template.php:2506
3532
+ msgid "%1$s - %2$s"
3533
+ msgstr ""
3534
+
3535
+ #: includes/common/formatting.php:626
3536
+ msgid "sometime"
3537
+ msgstr ""
3538
+
3539
+ #: includes/common/formatting.php:627
3540
+ msgid "right now"
3541
+ msgstr ""
3542
+
3543
+ #: includes/common/formatting.php:628
3544
+ msgid "%s ago"
3545
+ msgstr ""
3546
+
3547
+ #: includes/common/formatting.php:632
3548
+ msgid "%s year"
3549
+ msgid_plural "%s years"
3550
+ msgstr[0] ""
3551
+ msgstr[1] ""
3552
+
3553
+ #: includes/common/formatting.php:633
3554
+ msgid "%s month"
3555
+ msgid_plural "%s months"
3556
+ msgstr[0] ""
3557
+ msgstr[1] ""
3558
+
3559
+ #: includes/common/formatting.php:634
3560
+ msgid "%s week"
3561
+ msgid_plural "%s weeks"
3562
+ msgstr[0] ""
3563
+ msgstr[1] ""
3564
+
3565
+ #: includes/common/formatting.php:635
3566
+ msgid "%s day"
3567
+ msgid_plural "%s days"
3568
+ msgstr[0] ""
3569
+ msgstr[1] ""
3570
+
3571
+ #: includes/common/formatting.php:636
3572
+ msgid "%s hour"
3573
+ msgid_plural "%s hours"
3574
+ msgstr[0] ""
3575
+ msgstr[1] ""
3576
+
3577
+ #: includes/common/formatting.php:637
3578
+ msgid "%s minute"
3579
+ msgid_plural "%s minutes"
3580
+ msgstr[0] ""
3581
+ msgstr[1] ""
3582
+
3583
+ #: includes/common/formatting.php:638
3584
+ msgid "%s second"
3585
+ msgid_plural "%s seconds"
3586
+ msgstr[0] ""
3587
+ msgstr[1] ""
3588
+
3589
+ #: includes/common/functions.php:355 includes/common/functions.php:413
3590
+ msgid "Pending: %s"
3591
+ msgstr ""
3592
+
3593
+ #: includes/common/functions.php:359 includes/common/functions.php:416
3594
+ msgid "Private: %s"
3595
+ msgstr ""
3596
+
3597
+ #: includes/common/functions.php:363 includes/common/functions.php:420
3598
+ msgid "Spammed: %s"
3599
+ msgstr ""
3600
+
3601
+ #: includes/common/functions.php:367 includes/common/functions.php:424
3602
+ msgid "Trashed: %s"
3603
+ msgstr ""
3604
+
3605
+ #: includes/common/functions.php:508
3606
+ msgid "<strong>ERROR</strong>: Invalid author name."
3607
+ msgstr ""
3608
+
3609
+ #: includes/common/functions.php:514
3610
+ msgid "<strong>ERROR</strong>: Invalid email address."
3611
+ msgstr ""
3612
+
3613
+ #: includes/common/functions.php:1094
3614
+ msgid ""
3615
+ "%1$s wrote:\n"
3616
+ "\n"
3617
+ "%2$s\n"
3618
+ "\n"
3619
+ "Post Link: %3$s\n"
3620
+ "\n"
3621
+ "-----------\n"
3622
+ "\n"
3623
+ "You are receiving this email because you subscribed to a forum topic.\n"
3624
+ "\n"
3625
+ "Login and visit the topic to unsubscribe from these emails."
3626
+ msgstr ""
3627
+
3628
+ #: includes/common/functions.php:1247
3629
+ msgid ""
3630
+ "%1$s wrote:\n"
3631
+ "\n"
3632
+ "%2$s\n"
3633
+ "\n"
3634
+ "Topic Link: %3$s\n"
3635
+ "\n"
3636
+ "-----------\n"
3637
+ "\n"
3638
+ "You are receiving this email because you subscribed to a forum.\n"
3639
+ "\n"
3640
+ "Login and visit the topic to unsubscribe from these emails."
3641
+ msgstr ""
3642
+
3643
+ #: includes/common/template.php:1560
3644
+ msgid "No topics available"
3645
+ msgstr ""
3646
+
3647
+ #: includes/common/template.php:1565
3648
+ msgid "No forums available"
3649
+ msgstr ""
3650
+
3651
+ #: includes/common/template.php:1570
3652
+ msgid "None available"
3653
+ msgstr ""
3654
+
3655
+ #: includes/common/template.php:2179
3656
+ msgid "Home"
3657
+ msgstr ""
3658
+
3659
+ #: includes/common/template.php:2249
3660
+ msgid "(Edit)"
3661
+ msgstr ""
3662
+
3663
+ #: includes/common/template.php:2253 includes/common/template.php:2368
3664
+ #: includes/common/template.php:2613 includes/core/theme-compat.php:794
3665
+ #: templates/default/extras/taxonomy-topic-tag-edit.php:17
3666
+ #: templates/default/extras/taxonomy-topic-tag.php:17
3667
+ msgid "Topic Tag: %s"
3668
+ msgstr ""
3669
+
3670
+ #: includes/common/template.php:2274
3671
+ msgid "&lsaquo;"
3672
+ msgstr ""
3673
+
3674
+ #: includes/common/template.php:2274
3675
+ msgid "&rsaquo;"
3676
+ msgstr ""
3677
+
3678
+ #: includes/common/template.php:2537
3679
+ msgid "Log Out"
3680
+ msgstr ""
3681
+
3682
+ #: includes/common/template.php:2577
3683
+ msgid "Forum Edit: %s"
3684
+ msgstr ""
3685
+
3686
+ #: includes/common/template.php:2582
3687
+ msgid "Topic Edit: %s"
3688
+ msgstr ""
3689
+
3690
+ #: includes/common/template.php:2587
3691
+ msgid "Reply Edit: %s"
3692
+ msgstr ""
3693
+
3694
+ #: includes/common/template.php:2592
3695
+ msgid "Topic Tag Edit: %s"
3696
+ msgstr ""
3697
+
3698
+ #: includes/common/template.php:2599
3699
+ msgid "Forum: %s"
3700
+ msgstr ""
3701
+
3702
+ #: includes/common/template.php:2604
3703
+ msgid "Topic: %s"
3704
+ msgstr ""
3705
+
3706
+ #: includes/common/template.php:2626
3707
+ msgid "Your Topics"
3708
+ msgstr ""
3709
+
3710
+ #: includes/common/template.php:2630
3711
+ #. translators: user's display name
3712
+ msgid "%s's Topics"
3713
+ msgstr ""
3714
+
3715
+ #: includes/common/template.php:2636
3716
+ msgid "Your Replies"
3717
+ msgstr ""
3718
+
3719
+ #: includes/common/template.php:2640
3720
+ #. translators: user's display name
3721
+ msgid "%s's Replies"
3722
+ msgstr ""
3723
+
3724
+ #: includes/common/template.php:2646
3725
+ msgid "Your Favorites"
3726
+ msgstr ""
3727
+
3728
+ #: includes/common/template.php:2650
3729
+ #: templates/default/bbpress/user-details.php:57
3730
+ #. translators: user's display name
3731
+ msgid "%s's Favorites"
3732
+ msgstr ""
3733
+
3734
+ #: includes/common/template.php:2656
3735
+ msgid "Your Subscriptions"
3736
+ msgstr ""
3737
+
3738
+ #: includes/common/template.php:2660
3739
+ #: templates/default/bbpress/user-details.php:67
3740
+ #. translators: user's display name
3741
+ msgid "%s's Subscriptions"
3742
+ msgstr ""
3743
+
3744
+ #: includes/common/template.php:2666
3745
+ msgid "Your Profile"
3746
+ msgstr ""
3747
+
3748
+ #: includes/common/template.php:2670
3749
+ #: templates/default/bbpress/user-details.php:30
3750
+ #. translators: user's display name
3751
+ msgid "%s's Profile"
3752
+ msgstr ""
3753
+
3754
+ #: includes/common/template.php:2679
3755
+ msgid "Edit Your Profile"
3756
+ msgstr ""
3757
+
3758
+ #: includes/common/template.php:2684
3759
+ #: templates/default/bbpress/user-details.php:74
3760
+ msgid "Edit %s's Profile"
3761
+ msgstr ""
3762
+
3763
+ #: includes/common/template.php:2692
3764
+ msgid "View: %s"
3765
+ msgstr ""
3766
+
3767
+ #: includes/common/widgets.php:34
3768
+ msgid "A simple login form with optional links to sign-up and lost password pages."
3769
+ msgstr ""
3770
+
3771
+ #: includes/common/widgets.php:37
3772
+ msgid "(bbPress) Login Widget"
3773
+ msgstr ""
3774
+
3775
+ #: includes/common/widgets.php:80 includes/common/widgets.php:101
3776
+ #: templates/default/bbpress/form-user-login.php:17
3777
+ #: templates/default/bbpress/form-user-login.php:38
3778
+ msgid "Log In"
3779
+ msgstr ""
3780
+
3781
+ #: includes/common/widgets.php:83
3782
+ #: templates/default/bbpress/form-user-edit.php:107
3783
+ #: templates/default/bbpress/form-user-login.php:20
3784
+ #: templates/default/bbpress/form-user-register.php:29
3785
+ msgid "Username"
3786
+ msgstr ""
3787
+
3788
+ #: includes/common/widgets.php:88
3789
+ #: templates/default/bbpress/form-user-login.php:25
3790
+ #: templates/default/bbpress/form-user-passwords.php:17
3791
+ msgid "Password"
3792
+ msgstr ""
3793
+
3794
+ #: includes/common/widgets.php:94
3795
+ msgid "Remember Me"
3796
+ msgstr ""
3797
+
3798
+ #: includes/common/widgets.php:113
3799
+ #: templates/default/bbpress/form-user-register.php:42
3800
+ msgid "Register"
3801
+ msgstr ""
3802
+
3803
+ #: includes/common/widgets.php:119
3804
+ #: templates/default/bbpress/form-user-lost-pass.php:17
3805
+ msgid "Lost Password"
3806
+ msgstr ""
3807
+
3808
+ #: includes/common/widgets.php:174 includes/common/widgets.php:318
3809
+ #: includes/common/widgets.php:434 includes/common/widgets.php:595
3810
+ #: includes/common/widgets.php:866 includes/common/widgets.php:1009
3811
+ #: includes/common/widgets.php:1214
3812
+ msgid "Title:"
3813
+ msgstr ""
3814
+
3815
+ #: includes/common/widgets.php:179
3816
+ msgid "Register URI:"
3817
+ msgstr ""
3818
+
3819
+ #: includes/common/widgets.php:184
3820
+ msgid "Lost Password URI:"
3821
+ msgstr ""
3822
+
3823
+ #: includes/common/widgets.php:226
3824
+ msgid "A list of registered optional topic views."
3825
+ msgstr ""
3826
+
3827
+ #: includes/common/widgets.php:229
3828
+ msgid "(bbPress) Topic Views List"
3829
+ msgstr ""
3830
+
3831
+ #: includes/common/widgets.php:359
3832
+ msgid "The bbPress forum search form."
3833
+ msgstr ""
3834
+
3835
+ #: includes/common/widgets.php:362
3836
+ msgid "(bbPress) Forum Search Form"
3837
+ msgstr ""
3838
+
3839
+ #: includes/common/widgets.php:451 includes/forums/template.php:60
3840
+ msgid "Search Forums"
3841
+ msgstr ""
3842
+
3843
+ #: includes/common/widgets.php:475
3844
+ msgid "A list of forums with an option to set the parent."
3845
+ msgstr ""
3846
+
3847
+ #: includes/common/widgets.php:478
3848
+ msgid "(bbPress) Forums List"
3849
+ msgstr ""
3850
+
3851
+ #: includes/common/widgets.php:601 includes/common/widgets.php:870
3852
+ msgid "Parent Forum ID:"
3853
+ msgstr ""
3854
+
3855
+ #: includes/common/widgets.php:607 includes/common/widgets.php:876
3856
+ msgid "\"0\" to show only root - \"any\" to show all"
3857
+ msgstr ""
3858
+
3859
+ #: includes/common/widgets.php:647
3860
+ msgid "A list of recent topics, sorted by: newness, popularity, or recent replies."
3861
+ msgstr ""
3862
+
3863
+ #: includes/common/widgets.php:650
3864
+ msgid "(bbPress) Recent Topics"
3865
+ msgstr ""
3866
+
3867
+ #: includes/common/widgets.php:867
3868
+ msgid "Maximum topics to show:"
3869
+ msgstr ""
3870
+
3871
+ #: includes/common/widgets.php:879 includes/common/widgets.php:1216
3872
+ msgid "Show post date:"
3873
+ msgstr ""
3874
+
3875
+ #: includes/common/widgets.php:880
3876
+ msgid "Show topic author:"
3877
+ msgstr ""
3878
+
3879
+ #: includes/common/widgets.php:883
3880
+ msgid "Order By:"
3881
+ msgstr ""
3882
+
3883
+ #: includes/common/widgets.php:885
3884
+ msgid "Newest Topics"
3885
+ msgstr ""
3886
+
3887
+ #: includes/common/widgets.php:886
3888
+ #: templates/default/extras/page-forum-statistics.php:34
3889
+ msgid "Popular Topics"
3890
+ msgstr ""
3891
+
3892
+ #: includes/common/widgets.php:887
3893
+ msgid "Topics With Recent Replies"
3894
+ msgstr ""
3895
+
3896
+ #: includes/common/widgets.php:903
3897
+ msgid "Recent Topics"
3898
+ msgstr ""
3899
+
3900
+ #: includes/common/widgets.php:932
3901
+ msgid "Some statistics from your forum."
3902
+ msgstr ""
3903
+
3904
+ #: includes/common/widgets.php:935
3905
+ msgid "(bbPress) Statistics"
3906
+ msgstr ""
3907
+
3908
+ #: includes/common/widgets.php:1026
3909
+ msgid "Forum Statistics"
3910
+ msgstr ""
3911
+
3912
+ #: includes/common/widgets.php:1050
3913
+ msgid "A list of the most recent replies."
3914
+ msgstr ""
3915
+
3916
+ #: includes/common/widgets.php:1053
3917
+ msgid "(bbPress) Recent Replies"
3918
+ msgstr ""
3919
+
3920
+ #: includes/common/widgets.php:1215
3921
+ msgid "Maximum replies to show:"
3922
+ msgstr ""
3923
+
3924
+ #: includes/common/widgets.php:1217
3925
+ msgid "Show reply author:"
3926
+ msgstr ""
3927
+
3928
+ #: includes/common/widgets.php:1231
3929
+ msgid "Recent Replies"
3930
+ msgstr ""
3931
+
3932
+ #: includes/core/capabilities.php:501
3933
+ msgid "Editable forum roles no longer exist."
3934
+ msgstr ""
3935
+
3936
+ #: includes/core/update.php:183
3937
+ msgid "General"
3938
+ msgstr ""
3939
+
3940
+ #: includes/core/update.php:184
3941
+ msgid "General chit-chat"
3942
+ msgstr ""
3943
+
3944
+ #: includes/core/update.php:187
3945
+ msgid "Hello World!"
3946
+ msgstr ""
3947
+
3948
+ #: includes/core/update.php:188
3949
+ msgid "I am the first topic in your new forums."
3950
+ msgstr ""
3951
+
3952
+ #: includes/core/update.php:191
3953
+ msgid "Oh, and this is what a reply looks like."
3954
+ msgstr ""
3955
+
3956
+ #: includes/extend/akismet.php:315
3957
+ #. translators: %s: reporter name
3958
+ msgid "%s reported this topic as spam"
3959
+ msgstr ""
3960
+
3961
+ #: includes/extend/akismet.php:320
3962
+ #. translators: %s: reporter name
3963
+ msgid "%s reported this reply as spam"
3964
+ msgstr ""
3965
+
3966
+ #: includes/extend/akismet.php:325
3967
+ #. translators: 1: reporter name, 2: comment type
3968
+ msgid "%1$s reported this %2$s as spam"
3969
+ msgstr ""
3970
+
3971
+ #: includes/extend/akismet.php:340
3972
+ #. translators: %s: reporter name
3973
+ msgid "%s reported this topic as not spam"
3974
+ msgstr ""
3975
+
3976
+ #: includes/extend/akismet.php:345
3977
+ #. translators: %s: reporter name
3978
+ msgid "%s reported this reply as not spam"
3979
+ msgstr ""
3980
+
3981
+ #: includes/extend/akismet.php:350
3982
+ #. translators: 1: reporter name, 2: comment type
3983
+ msgid "%1$s reported this %2$s as not spam"
3984
+ msgstr ""
3985
+
3986
+ #: includes/extend/akismet.php:441
3987
+ msgid "No response"
3988
+ msgstr ""
3989
+
3990
+ #: includes/extend/akismet.php:495
3991
+ msgid "Akismet caught this post as spam"
3992
+ msgstr ""
3993
+
3994
+ #: includes/extend/akismet.php:499 includes/extend/akismet.php:514
3995
+ msgid "Post status was changed to %s"
3996
+ msgstr ""
3997
+
3998
+ #: includes/extend/akismet.php:507
3999
+ msgid "Akismet cleared this post as not spam"
4000
+ msgstr ""
4001
+
4002
+ #: includes/extend/akismet.php:521
4003
+ msgid ""
4004
+ "Akismet was unable to check this post (response: %s), will automatically "
4005
+ "retry again later."
4006
+ msgstr ""
4007
+
4008
+ #: includes/extend/akismet.php:722 includes/extend/akismet.php:732
4009
+ msgid "Akismet History"
4010
+ msgstr ""
4011
+
4012
+ #: includes/extend/akismet.php:776
4013
+ msgid "No recorded history. Akismet has not checked this post."
4014
+ msgstr ""
4015
+
4016
+ #: includes/extend/buddypress/activity.php:195
4017
+ msgid "New forum topic"
4018
+ msgstr ""
4019
+
4020
+ #: includes/extend/buddypress/activity.php:205
4021
+ msgid "New forum reply"
4022
+ msgstr ""
4023
+
4024
+ #: includes/extend/buddypress/activity.php:450
4025
+ #: includes/extend/buddypress/functions.php:769
4026
+ msgid "%1$s started the topic %2$s in the forum %3$s"
4027
+ msgstr ""
4028
+
4029
+ #: includes/extend/buddypress/activity.php:588
4030
+ #: includes/extend/buddypress/functions.php:770
4031
+ msgid "%1$s replied to the topic %2$s in the forum %3$s"
4032
+ msgstr ""
4033
+
4034
+ #: includes/extend/buddypress/groups.php:330
4035
+ #: includes/extend/buddypress/groups.php:333
4036
+ msgid "Group Forum Settings"
4037
+ msgstr ""
4038
+
4039
+ #: includes/extend/buddypress/groups.php:334
4040
+ #: includes/extend/buddypress/groups.php:533
4041
+ msgid ""
4042
+ "Create a discussion forum to allow members of this group to communicate in "
4043
+ "a structured, bulletin-board style fashion."
4044
+ msgstr ""
4045
+
4046
+ #: includes/extend/buddypress/groups.php:338
4047
+ #: includes/extend/buddypress/groups.php:536
4048
+ msgid "Yes. I want this group to have a forum."
4049
+ msgstr ""
4050
+
4051
+ #: includes/extend/buddypress/groups.php:341
4052
+ msgid "Saying no will not delete existing forum content."
4053
+ msgstr ""
4054
+
4055
+ #: includes/extend/buddypress/groups.php:346
4056
+ msgid "Group Forum:"
4057
+ msgstr ""
4058
+
4059
+ #: includes/extend/buddypress/groups.php:354
4060
+ msgid "Network administrators can reconfigure which forum belongs to this group."
4061
+ msgstr ""
4062
+
4063
+ #: includes/extend/buddypress/groups.php:359
4064
+ msgid "Save Settings"
4065
+ msgstr ""
4066
+
4067
+ #: includes/extend/buddypress/groups.php:394
4068
+ #: includes/extend/buddypress/groups.php:551
4069
+ #: includes/extend/buddypress/notifications.php:195
4070
+ #: includes/forums/functions.php:122 includes/forums/functions.php:384
4071
+ #: includes/replies/functions.php:129 includes/replies/functions.php:507
4072
+ #: includes/replies/functions.php:1210 includes/topics/functions.php:105
4073
+ #: includes/topics/functions.php:463 includes/topics/functions.php:1067
4074
+ #: includes/topics/functions.php:1342 includes/topics/functions.php:1678
4075
+ #: includes/topics/functions.php:1718 includes/topics/functions.php:1776
4076
+ #: includes/users/engagements.php:633 includes/users/engagements.php:925
4077
+ #: includes/users/functions.php:199 includes/users/functions.php:205
4078
+ #: includes/users/functions.php:385
4079
+ msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
4080
+ msgstr ""
4081
+
4082
+ #: includes/extend/buddypress/groups.php:531
4083
+ msgid "Group Forum"
4084
+ msgstr ""
4085
+
4086
+ #: includes/extend/buddypress/groups.php:878
4087
+ msgid "This group does not currently have a forum."
4088
+ msgstr ""
4089
+
4090
+ #: includes/extend/buddypress/loader.php:107
4091
+ msgid "Search Forums..."
4092
+ msgstr ""
4093
+
4094
+ #: includes/extend/buddypress/loader.php:344
4095
+ #: templates/default/bbpress/user-subscriptions.php:41
4096
+ msgid "Subscribed Topics"
4097
+ msgstr ""
4098
+
4099
+ #: includes/extend/buddypress/notifications.php:89
4100
+ msgid "You have %d new replies"
4101
+ msgstr ""
4102
+
4103
+ #: includes/extend/buddypress/notifications.php:95
4104
+ msgid "You have %d new reply to %2$s from %3$s"
4105
+ msgstr ""
4106
+
4107
+ #: includes/extend/buddypress/notifications.php:96
4108
+ msgid "You have %d new reply to %s"
4109
+ msgstr ""
4110
+
4111
+ #: includes/extend/buddypress/notifications.php:101
4112
+ msgid "Topic Replies"
4113
+ msgstr ""
4114
+
4115
+ #: includes/extend/buddypress/notifications.php:199
4116
+ msgid ""
4117
+ "<strong>ERROR</strong>: You do not have permission to mark notifications "
4118
+ "for that user."
4119
+ msgstr ""
4120
+
4121
+ #: includes/forums/functions.php:136
4122
+ msgid "<strong>ERROR</strong>: You do not have permission to create new forums."
4123
+ msgstr ""
4124
+
4125
+ #: includes/forums/functions.php:161 includes/forums/functions.php:445
4126
+ msgid "<strong>ERROR</strong>: Your forum needs a title."
4127
+ msgstr ""
4128
+
4129
+ #: includes/forums/functions.php:175 includes/forums/functions.php:459
4130
+ msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
4131
+ msgstr ""
4132
+
4133
+ #: includes/forums/functions.php:190
4134
+ msgid "<strong>ERROR</strong>: Your forum must have a parent."
4135
+ msgstr ""
4136
+
4137
+ #: includes/forums/functions.php:197
4138
+ msgid ""
4139
+ "<strong>ERROR</strong>: This forum is a category. No forums can be created "
4140
+ "in this forum."
4141
+ msgstr ""
4142
+
4143
+ #: includes/forums/functions.php:202 includes/forums/functions.php:420
4144
+ msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
4145
+ msgstr ""
4146
+
4147
+ #: includes/forums/functions.php:207 includes/forums/functions.php:425
4148
+ msgid ""
4149
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
4150
+ "capability to read or create new forums in it."
4151
+ msgstr ""
4152
+
4153
+ #: includes/forums/functions.php:212 includes/forums/functions.php:430
4154
+ msgid ""
4155
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
4156
+ "capability to read or create new forums in it."
4157
+ msgstr ""
4158
+
4159
+ #: includes/forums/functions.php:219 includes/replies/functions.php:294
4160
+ #: includes/topics/functions.php:242
4161
+ msgid "<strong>ERROR</strong>: Slow down; you move too fast."
4162
+ msgstr ""
4163
+
4164
+ #: includes/forums/functions.php:225
4165
+ msgid "<strong>ERROR</strong>: This forum already exists."
4166
+ msgstr ""
4167
+
4168
+ #: includes/forums/functions.php:231
4169
+ msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
4170
+ msgstr ""
4171
+
4172
+ #: includes/forums/functions.php:344 includes/replies/functions.php:464
4173
+ #: includes/topics/functions.php:395
4174
+ msgid "<strong>ERROR</strong>: The following problem(s) occurred: %s"
4175
+ msgstr ""
4176
+
4177
+ #: includes/forums/functions.php:348
4178
+ msgid "<strong>ERROR</strong>: The forum was not created."
4179
+ msgstr ""
4180
+
4181
+ #: includes/forums/functions.php:373
4182
+ msgid "<strong>ERROR</strong>: Forum ID not found."
4183
+ msgstr ""
4184
+
4185
+ #: includes/forums/functions.php:389
4186
+ msgid "<strong>ERROR</strong>: The forum you want to edit was not found."
4187
+ msgstr ""
4188
+
4189
+ #: includes/forums/functions.php:394
4190
+ msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
4191
+ msgstr ""
4192
+
4193
+ #: includes/forums/functions.php:465
4194
+ msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
4195
+ msgstr ""
4196
+
4197
+ #: includes/forums/template.php:52 includes/replies/template.php:53
4198
+ #: includes/topics/template.php:51
4199
+ msgid "Add New"
4200
+ msgstr ""
4201
+
4202
+ #: includes/forums/template.php:53 templates/default/bbpress/form-forum.php:40
4203
+ msgid "Create New Forum"
4204
+ msgstr ""
4205
+
4206
+ #: includes/forums/template.php:55
4207
+ msgid "Edit Forum"
4208
+ msgstr ""
4209
+
4210
+ #: includes/forums/template.php:56
4211
+ msgid "New Forum"
4212
+ msgstr ""
4213
+
4214
+ #: includes/forums/template.php:57 includes/forums/template.php:58
4215
+ msgid "View Forum"
4216
+ msgstr ""
4217
+
4218
+ #: includes/forums/template.php:59
4219
+ msgid "View Forums"
4220
+ msgstr ""
4221
+
4222
+ #: includes/forums/template.php:61
4223
+ msgid "No forums found"
4224
+ msgstr ""
4225
+
4226
+ #: includes/forums/template.php:62
4227
+ msgid "No forums found in Trash"
4228
+ msgstr ""
4229
+
4230
+ #: includes/forums/template.php:63
4231
+ msgid "Filter forums list"
4232
+ msgstr ""
4233
+
4234
+ #: includes/forums/template.php:64
4235
+ msgid "Forums list"
4236
+ msgstr ""
4237
+
4238
+ #: includes/forums/template.php:65
4239
+ msgid "Forums list navigation"
4240
+ msgstr ""
4241
+
4242
+ #: includes/forums/template.php:66 templates/default/bbpress/form-forum.php:139
4243
+ msgid "Parent Forum:"
4244
+ msgstr ""
4245
+
4246
+ #: includes/forums/template.php:794 includes/topics/template.php:1796
4247
+ #: includes/users/template.php:1272
4248
+ msgid "Subscribe"
4249
+ msgstr ""
4250
+
4251
+ #: includes/forums/template.php:795 includes/topics/template.php:1797
4252
+ #: includes/users/template.php:1273
4253
+ msgid "Unsubscribe"
4254
+ msgstr ""
4255
+
4256
+ #: includes/forums/template.php:1131 includes/forums/template.php:1932
4257
+ msgid "%s topic"
4258
+ msgid_plural "%s topics"
4259
+ msgstr[0] ""
4260
+ msgstr[1] ""
4261
+
4262
+ #: includes/forums/template.php:1146 includes/topics/template.php:2045
4263
+ msgid "(+%s hidden)"
4264
+ msgid_plural "(+%s hidden)"
4265
+ msgstr[0] ""
4266
+ msgstr[1] ""
4267
+
4268
+ #: includes/forums/template.php:1921 includes/topics/template.php:2030
4269
+ msgid "%s reply"
4270
+ msgid_plural "%s replies"
4271
+ msgstr[0] ""
4272
+ msgstr[1] ""
4273
+
4274
+ #: includes/forums/template.php:1941
4275
+ msgid "This category has %1$s, %2$s, and was last updated %3$s by %4$s."
4276
+ msgstr ""
4277
+
4278
+ #: includes/forums/template.php:1942
4279
+ msgid "This forum has %1$s, %2$s, and was last updated %3$s by %4$s."
4280
+ msgstr ""
4281
+
4282
+ #: includes/forums/template.php:1947
4283
+ msgid "This category has %1$s, and was last updated %2$s by %3$s."
4284
+ msgstr ""
4285
+
4286
+ #: includes/forums/template.php:1948
4287
+ msgid "This forum has %1$s, and was last updated %2$s by %3$s."
4288
+ msgstr ""
4289
+
4290
+ #: includes/forums/template.php:1954
4291
+ msgid "This category has %1$s and %2$s."
4292
+ msgstr ""
4293
+
4294
+ #: includes/forums/template.php:1955
4295
+ msgid "This forum has %1$s and %2$s."
4296
+ msgstr ""
4297
+
4298
+ #: includes/forums/template.php:1960
4299
+ msgid "This category has %1$s."
4300
+ msgstr ""
4301
+
4302
+ #: includes/forums/template.php:1961
4303
+ msgid "This forum has %1$s."
4304
+ msgstr ""
4305
+
4306
+ #: includes/forums/template.php:1965
4307
+ msgid "This forum is empty."
4308
+ msgstr ""
4309
+
4310
+ #: includes/replies/functions.php:154
4311
+ msgid "<strong>ERROR</strong>: You do not have permission to reply."
4312
+ msgstr ""
4313
+
4314
+ #: includes/replies/functions.php:165
4315
+ msgid "<strong>ERROR</strong>: Topic ID is missing."
4316
+ msgstr ""
4317
+
4318
+ #: includes/replies/functions.php:169
4319
+ msgid "<strong>ERROR</strong>: Topic ID must be a number."
4320
+ msgstr ""
4321
+
4322
+ #: includes/replies/functions.php:179
4323
+ msgid "<strong>ERROR</strong>: Topic ID cannot be a negative number."
4324
+ msgstr ""
4325
+
4326
+ #: includes/replies/functions.php:183
4327
+ msgid "<strong>ERROR</strong>: Topic does not exist."
4328
+ msgstr ""
4329
+
4330
+ #: includes/replies/functions.php:202 includes/replies/functions.php:216
4331
+ #: includes/topics/functions.php:182 includes/topics/functions.php:196
4332
+ #: includes/topics/functions.php:478
4333
+ msgid "<strong>ERROR</strong>: Forum ID is missing."
4334
+ msgstr ""
4335
+
4336
+ #: includes/replies/functions.php:206 includes/topics/functions.php:186
4337
+ msgid "<strong>ERROR</strong>: Forum ID must be a number."
4338
+ msgstr ""
4339
+
4340
+ #: includes/replies/functions.php:220 includes/topics/functions.php:200
4341
+ msgid "<strong>ERROR</strong>: Forum ID cannot be a negative number."
4342
+ msgstr ""
4343
+
4344
+ #: includes/replies/functions.php:224 includes/topics/functions.php:204
4345
+ msgid "<strong>ERROR</strong>: Forum does not exist."
4346
+ msgstr ""
4347
+
4348
+ #: includes/replies/functions.php:238 includes/replies/functions.php:559
4349
+ msgid ""
4350
+ "<strong>ERROR</strong>: This forum is a category. No replies can be created "
4351
+ "in this forum."
4352
+ msgstr ""
4353
+
4354
+ #: includes/replies/functions.php:245 includes/replies/functions.php:566
4355
+ msgid "<strong>ERROR</strong>: This forum has been closed to new replies."
4356
+ msgstr ""
4357
+
4358
+ #: includes/replies/functions.php:250 includes/replies/functions.php:571
4359
+ msgid ""
4360
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
4361
+ "capability to read or create new replies in it."
4362
+ msgstr ""
4363
+
4364
+ #: includes/replies/functions.php:254 includes/replies/functions.php:575
4365
+ msgid ""
4366
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
4367
+ "capability to read or create new replies in it."
4368
+ msgstr ""
4369
+
4370
+ #: includes/replies/functions.php:288 includes/replies/functions.php:600
4371
+ msgid "<strong>ERROR</strong>: Your reply cannot be empty."
4372
+ msgstr ""
4373
+
4374
+ #: includes/replies/functions.php:300
4375
+ msgid ""
4376
+ "<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
4377
+ "you&#8217;ve already said that."
4378
+ msgstr ""
4379
+
4380
+ #: includes/replies/functions.php:306
4381
+ msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
4382
+ msgstr ""
4383
+
4384
+ #: includes/replies/functions.php:331
4385
+ msgid "<strong>ERROR</strong>: Topic is closed."
4386
+ msgstr ""
4387
+
4388
+ #: includes/replies/functions.php:391 includes/replies/functions.php:694
4389
+ msgid "<strong>ERROR</strong>: There was a problem adding the tags to the topic."
4390
+ msgstr ""
4391
+
4392
+ #: includes/replies/functions.php:468
4393
+ msgid "<strong>ERROR</strong>: The reply was not created."
4394
+ msgstr ""
4395
+
4396
+ #: includes/replies/functions.php:496
4397
+ msgid "<strong>ERROR</strong>: Reply ID not found."
4398
+ msgstr ""
4399
+
4400
+ #: includes/replies/functions.php:513
4401
+ msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
4402
+ msgstr ""
4403
+
4404
+ #: includes/replies/functions.php:524
4405
+ msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
4406
+ msgstr ""
4407
+
4408
+ #: includes/replies/functions.php:606
4409
+ msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
4410
+ msgstr ""
4411
+
4412
+ #: includes/replies/functions.php:1186
4413
+ msgid "<strong>ERROR</strong>: A reply ID is required"
4414
+ msgstr ""
4415
+
4416
+ #: includes/replies/functions.php:1195
4417
+ msgid "<strong>ERROR</strong>: The reply you want to move was not found."
4418
+ msgstr ""
4419
+
4420
+ #: includes/replies/functions.php:1205
4421
+ msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
4422
+ msgstr ""
4423
+
4424
+ #: includes/replies/functions.php:1216 includes/topics/functions.php:1078
4425
+ #: includes/topics/functions.php:1348
4426
+ msgid "<strong>ERROR</strong>: You do not have permission to edit the source topic."
4427
+ msgstr ""
4428
+
4429
+ #: includes/replies/functions.php:1226
4430
+ msgid "<strong>ERROR</strong>: You need to choose a valid move option."
4431
+ msgstr ""
4432
+
4433
+ #: includes/replies/functions.php:1239 includes/topics/functions.php:1371
4434
+ msgid "<strong>ERROR</strong>: A topic ID is required."
4435
+ msgstr ""
4436
+
4437
+ #: includes/replies/functions.php:1249
4438
+ msgid "<strong>ERROR</strong>: The topic you want to move to was not found."
4439
+ msgstr ""
4440
+
4441
+ #: includes/replies/functions.php:1254 includes/topics/functions.php:1098
4442
+ #: includes/topics/functions.php:1386
4443
+ msgid ""
4444
+ "<strong>ERROR</strong>: You do not have permission to edit the destination "
4445
+ "topic."
4446
+ msgstr ""
4447
+
4448
+ #: includes/replies/functions.php:1308 includes/topics/functions.php:1424
4449
+ msgid ""
4450
+ "<strong>ERROR</strong>: There was a problem converting the reply into the "
4451
+ "topic. Please try again."
4452
+ msgstr ""
4453
+
4454
+ #: includes/replies/functions.php:1313 includes/topics/functions.php:1429
4455
+ msgid ""
4456
+ "<strong>ERROR</strong>: You do not have permission to create new topics. "
4457
+ "The reply could not be converted into a topic."
4458
+ msgstr ""
4459
+
4460
+ #: includes/replies/functions.php:1461
4461
+ msgid "<strong>ERROR:</strong> This reply could not be found or no longer exists."
4462
+ msgstr ""
4463
+
4464
+ #: includes/replies/functions.php:1467 includes/topics/functions.php:1958
4465
+ msgid "<strong>ERROR:</strong> You do not have permission to do that."
4466
+ msgstr ""
4467
+
4468
+ #: includes/replies/functions.php:1543
4469
+ msgid "<strong>ERROR</strong>: There was a problem approving the reply."
4470
+ msgstr ""
4471
+
4472
+ #: includes/replies/functions.php:1543
4473
+ msgid "<strong>ERROR</strong>: There was a problem unapproving the reply."
4474
+ msgstr ""
4475
+
4476
+ #: includes/replies/functions.php:1554
4477
+ msgid "<strong>ERROR</strong>: There was a problem unmarking the reply as spam."
4478
+ msgstr ""
4479
+
4480
+ #: includes/replies/functions.php:1554
4481
+ msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam."
4482
+ msgstr ""
4483
+
4484
+ #: includes/replies/functions.php:1569
4485
+ msgid "<strong>ERROR</strong>: There was a problem trashing the reply."
4486
+ msgstr ""
4487
+
4488
+ #: includes/replies/functions.php:1577
4489
+ msgid "<strong>ERROR</strong>: There was a problem untrashing the reply."
4490
+ msgstr ""
4491
+
4492
+ #: includes/replies/functions.php:1585
4493
+ msgid "<strong>ERROR</strong>: There was a problem deleting the reply."
4494
+ msgstr ""
4495
+
4496
+ #: includes/replies/functions.php:2055
4497
+ msgid "All Posts"
4498
+ msgstr ""
4499
+
4500
+ #: includes/replies/functions.php:2101 includes/topics/functions.php:3697
4501
+ msgid "Replies: %s"
4502
+ msgstr ""
4503
+
4504
+ #: includes/replies/template.php:54
4505
+ msgid "Create New Reply"
4506
+ msgstr ""
4507
+
4508
+ #: includes/replies/template.php:56
4509
+ msgid "Edit Reply"
4510
+ msgstr ""
4511
+
4512
+ #: includes/replies/template.php:57
4513
+ msgid "New Reply"
4514
+ msgstr ""
4515
+
4516
+ #: includes/replies/template.php:58 includes/replies/template.php:59
4517
+ msgid "View Reply"
4518
+ msgstr ""
4519
+
4520
+ #: includes/replies/template.php:60
4521
+ msgid "View Replies"
4522
+ msgstr ""
4523
+
4524
+ #: includes/replies/template.php:61
4525
+ msgid "Search Replies"
4526
+ msgstr ""
4527
+
4528
+ #: includes/replies/template.php:62
4529
+ msgid "No replies found"
4530
+ msgstr ""
4531
+
4532
+ #: includes/replies/template.php:63
4533
+ msgid "No replies found in Trash"
4534
+ msgstr ""
4535
+
4536
+ #: includes/replies/template.php:64
4537
+ msgid "Filter replies list"
4538
+ msgstr ""
4539
+
4540
+ #: includes/replies/template.php:65
4541
+ msgid "Replies list"
4542
+ msgstr ""
4543
+
4544
+ #: includes/replies/template.php:66
4545
+ msgid "Replies list navigation"
4546
+ msgstr ""
4547
+
4548
+ #: includes/replies/template.php:520
4549
+ #: templates/default/bbpress/form-reply.php:30
4550
+ msgid "Reply To: %s"
4551
+ msgstr ""
4552
+
4553
+ #: includes/replies/template.php:732
4554
+ msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
4555
+ msgstr ""
4556
+
4557
+ #: includes/replies/template.php:734
4558
+ msgid "This reply was modified %1$s by %2$s."
4559
+ msgstr ""
4560
+
4561
+ #: includes/replies/template.php:1138 includes/topics/template.php:1445
4562
+ #: includes/users/template.php:1991
4563
+ msgid "View %s's profile"
4564
+ msgstr ""
4565
+
4566
+ #: includes/replies/template.php:1139 includes/topics/template.php:1446
4567
+ #: includes/users/template.php:1991
4568
+ msgid "Visit %s's website"
4569
+ msgstr ""
4570
+
4571
+ #: includes/replies/template.php:1594
4572
+ #: templates/default/bbpress/form-user-passwords.php:31
4573
+ msgid "Cancel"
4574
+ msgstr ""
4575
+
4576
+ #: includes/replies/template.php:1904 includes/topics/template.php:2531
4577
+ #: templates/default/bbpress/form-topic-tag.php:100
4578
+ #: templates/default/bbpress/form-topic-tag.php:117
4579
+ msgid "Delete"
4580
+ msgstr ""
4581
+
4582
+ #: includes/replies/template.php:1929 includes/topics/template.php:2552
4583
+ msgid "Are you sure you want to delete that permanently?"
4584
+ msgstr ""
4585
+
4586
+ #: includes/replies/template.php:2026
4587
+ msgid "Move"
4588
+ msgstr ""
4589
+
4590
+ #: includes/replies/template.php:2027
4591
+ msgid "Move this reply"
4592
+ msgstr ""
4593
+
4594
+ #: includes/replies/template.php:2085
4595
+ msgid "Split"
4596
+ msgstr ""
4597
+
4598
+ #: includes/replies/template.php:2086
4599
+ msgid "Split the topic from this reply"
4600
+ msgstr ""
4601
+
4602
+ #: includes/replies/template.php:2320
4603
+ msgid "Viewing %1$s reply thread"
4604
+ msgid_plural "Viewing %1$s reply threads"
4605
+ msgstr[0] ""
4606
+ msgstr[1] ""
4607
+
4608
+ #: includes/replies/template.php:2327
4609
+ msgid "Viewing %1$s reply"
4610
+ msgid_plural "Viewing %1$s replies"
4611
+ msgstr[0] ""
4612
+ msgstr[1] ""
4613
+
4614
+ #: includes/replies/template.php:2331
4615
+ msgid "Viewing %2$s replies (of %4$s total)"
4616
+ msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
4617
+ msgstr[0] ""
4618
+ msgstr[1] ""
4619
+
4620
+ #: includes/replies/template.php:2339
4621
+ msgid "Viewing %1$s post"
4622
+ msgid_plural "Viewing %1$s posts"
4623
+ msgstr[0] ""
4624
+ msgstr[1] ""
4625
+
4626
+ #: includes/replies/template.php:2343
4627
+ msgid "Viewing %2$s post (of %4$s total)"
4628
+ msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
4629
+ msgstr[0] ""
4630
+ msgstr[1] ""
4631
+
4632
+ #: includes/search/template.php:179
4633
+ msgid "Search Results for '%s'"
4634
+ msgstr ""
4635
+
4636
+ #: includes/search/template.php:392
4637
+ msgid "Viewing %1$s result"
4638
+ msgid_plural "Viewing %1$s results"
4639
+ msgstr[0] ""
4640
+ msgstr[1] ""
4641
+
4642
+ #: includes/search/template.php:396
4643
+ msgid "Viewing %2$s results (of %4$s total)"
4644
+ msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
4645
+ msgstr[0] ""
4646
+ msgstr[1] ""
4647
+
4648
+ #: includes/topics/functions.php:132
4649
+ msgid "<strong>ERROR</strong>: You do not have permission to create new topics."
4650
+ msgstr ""
4651
+
4652
+ #: includes/topics/functions.php:158 includes/topics/functions.php:525
4653
+ msgid "<strong>ERROR</strong>: Your topic needs a title."
4654
+ msgstr ""
4655
+
4656
+ #: includes/topics/functions.php:172 includes/topics/functions.php:539
4657
+ msgid "<strong>ERROR</strong>: Your topic cannot be empty."
4658
+ msgstr ""
4659
+
4660
+ #: includes/topics/functions.php:218
4661
+ msgid ""
4662
+ "<strong>ERROR</strong>: This forum is a category. No topics can be created "
4663
+ "in this forum."
4664
+ msgstr ""
4665
+
4666
+ #: includes/topics/functions.php:225 includes/topics/functions.php:500
4667
+ msgid "<strong>ERROR</strong>: This forum has been closed to new topics."
4668
+ msgstr ""
4669
+
4670
+ #: includes/topics/functions.php:230 includes/topics/functions.php:505
4671
+ msgid ""
4672
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
4673
+ "capability to read or create new topics in it."
4674
+ msgstr ""
4675
+
4676
+ #: includes/topics/functions.php:234 includes/topics/functions.php:509
4677
+ msgid ""
4678
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
4679
+ "capability to read or create new topics in it."
4680
+ msgstr ""
4681
+
4682
+ #: includes/topics/functions.php:248
4683
+ msgid ""
4684
+ "<strong>ERROR</strong>: Duplicate topic detected; it looks as though "
4685
+ "you&#8217;ve already said that."
4686
+ msgstr ""
4687
+
4688
+ #: includes/topics/functions.php:254
4689
+ msgid "<strong>ERROR</strong>: Your topic cannot be created at this time."
4690
+ msgstr ""
4691
+
4692
+ #: includes/topics/functions.php:399
4693
+ msgid "<strong>ERROR</strong>: The topic was not created."
4694
+ msgstr ""
4695
+
4696
+ #: includes/topics/functions.php:425 includes/topics/functions.php:1060
4697
+ msgid "<strong>ERROR</strong>: Topic ID not found."
4698
+ msgstr ""
4699
+
4700
+ #: includes/topics/functions.php:436
4701
+ msgid "<strong>ERROR</strong>: The topic you want to edit was not found."
4702
+ msgstr ""
4703
+
4704
+ #: includes/topics/functions.php:447
4705
+ msgid "<strong>ERROR</strong>: You do not have permission to edit that topic."
4706
+ msgstr ""
4707
+
4708
+ #: includes/topics/functions.php:493
4709
+ msgid ""
4710
+ "<strong>ERROR</strong>: This forum is a category. No topics can be created "
4711
+ "in it."
4712
+ msgstr ""
4713
+
4714
+ #: includes/topics/functions.php:545
4715
+ msgid "<strong>ERROR</strong>: Your topic cannot be edited at this time."
4716
+ msgstr ""
4717
+
4718
+ #: includes/topics/functions.php:1072
4719
+ msgid "<strong>ERROR</strong>: The topic you want to merge was not found."
4720
+ msgstr ""
4721
+
4722
+ #: includes/topics/functions.php:1086
4723
+ msgid "<strong>ERROR</strong>: Destination topic ID not found."
4724
+ msgstr ""
4725
+
4726
+ #: includes/topics/functions.php:1093
4727
+ msgid "<strong>ERROR</strong>: The topic you want to merge to was not found."
4728
+ msgstr ""
4729
+
4730
+ #: includes/topics/functions.php:1318
4731
+ msgid "<strong>ERROR</strong>: A reply ID is required."
4732
+ msgstr ""
4733
+
4734
+ #: includes/topics/functions.php:1327
4735
+ msgid "<strong>ERROR</strong>: The reply you want to split from was not found."
4736
+ msgstr ""
4737
+
4738
+ #: includes/topics/functions.php:1337
4739
+ msgid "<strong>ERROR</strong>: The topic you want to split was not found."
4740
+ msgstr ""
4741
+
4742
+ #: includes/topics/functions.php:1358
4743
+ msgid "<strong>ERROR</strong>: You need to choose a valid split option."
4744
+ msgstr ""
4745
+
4746
+ #: includes/topics/functions.php:1381
4747
+ msgid "<strong>ERROR</strong>: The topic you want to split to was not found."
4748
+ msgstr ""
4749
+
4750
+ #: includes/topics/functions.php:1666
4751
+ msgid ""
4752
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4753
+ "getting the tag: %s"
4754
+ msgstr ""
4755
+
4756
+ #: includes/topics/functions.php:1684 includes/topics/functions.php:1724
4757
+ msgid "<strong>ERROR</strong>: You do not have permission to edit the topic tags."
4758
+ msgstr ""
4759
+
4760
+ #: includes/topics/functions.php:1690 includes/topics/functions.php:1730
4761
+ msgid "<strong>ERROR</strong>: You need to enter a tag name."
4762
+ msgstr ""
4763
+
4764
+ #: includes/topics/functions.php:1701
4765
+ msgid ""
4766
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4767
+ "updating the tag: %s"
4768
+ msgstr ""
4769
+
4770
+ #: includes/topics/functions.php:1741 includes/topics/functions.php:1759
4771
+ msgid ""
4772
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4773
+ "merging the tags: %s"
4774
+ msgstr ""
4775
+
4776
+ #: includes/topics/functions.php:1750
4777
+ msgid "<strong>ERROR</strong>: The tags which are being merged can not be the same."
4778
+ msgstr ""
4779
+
4780
+ #: includes/topics/functions.php:1782
4781
+ msgid "<strong>ERROR</strong>: You do not have permission to delete the topic tags."
4782
+ msgstr ""
4783
+
4784
+ #: includes/topics/functions.php:1791
4785
+ msgid ""
4786
+ "<strong>ERROR</strong>: The following problem(s) have been found while "
4787
+ "deleting the tag: %s"
4788
+ msgstr ""
4789
+
4790
+ #: includes/topics/functions.php:1952
4791
+ msgid "<strong>ERROR:</strong> This topic could not be found or no longer exists."
4792
+ msgstr ""
4793
+
4794
+ #: includes/topics/functions.php:2042
4795
+ msgid "<strong>ERROR</strong>: There was a problem approving the topic."
4796
+ msgstr ""
4797
+
4798
+ #: includes/topics/functions.php:2043
4799
+ msgid "<strong>ERROR</strong>: There was a problem unapproving the topic."
4800
+ msgstr ""
4801
+
4802
+ #: includes/topics/functions.php:2060
4803
+ msgid "<strong>ERROR</strong>: There was a problem closing the topic."
4804
+ msgstr ""
4805
+
4806
+ #: includes/topics/functions.php:2061
4807
+ msgid "<strong>ERROR</strong>: There was a problem opening the topic."
4808
+ msgstr ""
4809
+
4810
+ #: includes/topics/functions.php:2079
4811
+ msgid "<strong>ERROR</strong>: There was a problem unsticking the topic."
4812
+ msgstr ""
4813
+
4814
+ #: includes/topics/functions.php:2080
4815
+ msgid "<strong>ERROR</strong>: There was a problem sticking the topic."
4816
+ msgstr ""
4817
+
4818
+ #: includes/topics/functions.php:2098
4819
+ msgid "<strong>ERROR</strong>: There was a problem unmarking the topic as spam."
4820
+ msgstr ""
4821
+
4822
+ #: includes/topics/functions.php:2099
4823
+ msgid "<strong>ERROR</strong>: There was a problem marking the topic as spam."
4824
+ msgstr ""
4825
+
4826
+ #: includes/topics/functions.php:2112
4827
+ msgid "<strong>ERROR</strong>: There was a problem trashing the topic."
4828
+ msgstr ""
4829
+
4830
+ #: includes/topics/functions.php:2123
4831
+ msgid "<strong>ERROR</strong>: There was a problem untrashing the topic."
4832
+ msgstr ""
4833
+
4834
+ #: includes/topics/functions.php:2132
4835
+ msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
4836
+ msgstr ""
4837
+
4838
+ #: includes/topics/template.php:52 templates/default/bbpress/form-topic.php:48
4839
+ msgid "Create New Topic"
4840
+ msgstr ""
4841
+
4842
+ #: includes/topics/template.php:54
4843
+ msgid "Edit Topic"
4844
+ msgstr ""
4845
+
4846
+ #: includes/topics/template.php:55
4847
+ msgid "New Topic"
4848
+ msgstr ""
4849
+
4850
+ #: includes/topics/template.php:56 includes/topics/template.php:57
4851
+ msgid "View Topic"
4852
+ msgstr ""
4853
+
4854
+ #: includes/topics/template.php:58
4855
+ msgid "View Topics"
4856
+ msgstr ""
4857
+
4858
+ #: includes/topics/template.php:59
4859
+ msgid "Search Topics"
4860
+ msgstr ""
4861
+
4862
+ #: includes/topics/template.php:60
4863
+ msgid "No topics found"
4864
+ msgstr ""
4865
+
4866
+ #: includes/topics/template.php:61
4867
+ msgid "No topics found in Trash"
4868
+ msgstr ""
4869
+
4870
+ #: includes/topics/template.php:62
4871
+ msgid "Filter topics list"
4872
+ msgstr ""
4873
+
4874
+ #: includes/topics/template.php:63
4875
+ msgid "Topics list"
4876
+ msgstr ""
4877
+
4878
+ #: includes/topics/template.php:64
4879
+ msgid "Topics list navigation"
4880
+ msgstr ""
4881
+
4882
+ #: includes/topics/template.php:911
4883
+ msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
4884
+ msgstr ""
4885
+
4886
+ #: includes/topics/template.php:913
4887
+ msgid "This topic was modified %1$s by %2$s."
4888
+ msgstr ""
4889
+
4890
+ #: includes/topics/template.php:1843 includes/users/template.php:1074
4891
+ msgid "Favorite"
4892
+ msgstr ""
4893
+
4894
+ #: includes/topics/template.php:1844 includes/users/template.php:1075
4895
+ msgid "Unfavorite"
4896
+ msgstr ""
4897
+
4898
+ #: includes/topics/template.php:2209
4899
+ msgid "Tagged:"
4900
+ msgstr ""
4901
+
4902
+ #: includes/topics/template.php:2770
4903
+ #: templates/default/bbpress/form-topic-tag.php:69
4904
+ #: templates/default/bbpress/form-topic-tag.php:85
4905
+ msgid "Merge"
4906
+ msgstr ""
4907
+
4908
+ #: includes/topics/template.php:3002
4909
+ msgid "Viewing %1$s topic"
4910
+ msgid_plural "Viewing %1$s topics"
4911
+ msgstr[0] ""
4912
+ msgstr[1] ""
4913
+
4914
+ #: includes/topics/template.php:3006
4915
+ msgid "Viewing topic %2$s (of %4$s total)"
4916
+ msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
4917
+ msgstr[0] ""
4918
+ msgstr[1] ""
4919
+
4920
+ #: includes/topics/template.php:3063
4921
+ msgid "This topic is marked as spam."
4922
+ msgstr ""
4923
+
4924
+ #: includes/topics/template.php:3068
4925
+ msgid "This topic is in the trash."
4926
+ msgstr ""
4927
+
4928
+ #: includes/topics/template.php:3318
4929
+ msgid "%s voice"
4930
+ msgid_plural "%s voices"
4931
+ msgstr[0] ""
4932
+ msgstr[1] ""
4933
+
4934
+ #: includes/topics/template.php:3324
4935
+ msgid "This topic has %1$s, %2$s, and was last updated %3$s by %4$s."
4936
+ msgstr ""
4937
+
4938
+ #: includes/topics/template.php:3328
4939
+ msgid "This topic has %1$s and %2$s."
4940
+ msgstr ""
4941
+
4942
+ #: includes/topics/template.php:3332
4943
+ msgid "This topic has no replies."
4944
+ msgstr ""
4945
+
4946
+ #: includes/topics/template.php:3381
4947
+ msgid "Search Tags"
4948
+ msgstr ""
4949
+
4950
+ #: includes/topics/template.php:3382
4951
+ msgid "Popular Tags"
4952
+ msgstr ""
4953
+
4954
+ #: includes/topics/template.php:3383
4955
+ msgid "All Tags"
4956
+ msgstr ""
4957
+
4958
+ #: includes/topics/template.php:3384
4959
+ msgid "Edit Tag"
4960
+ msgstr ""
4961
+
4962
+ #: includes/topics/template.php:3385
4963
+ msgid "Update Tag"
4964
+ msgstr ""
4965
+
4966
+ #: includes/topics/template.php:3386
4967
+ msgid "Add New Tag"
4968
+ msgstr ""
4969
+
4970
+ #: includes/topics/template.php:3387
4971
+ msgid "New Tag Name"
4972
+ msgstr ""
4973
+
4974
+ #: includes/topics/template.php:3388
4975
+ msgid "View Topic Tag"
4976
+ msgstr ""
4977
+
4978
+ #: includes/topics/template.php:3389
4979
+ msgid "View Topic Tags"
4980
+ msgstr ""
4981
+
4982
+ #: includes/topics/template.php:3390
4983
+ msgid "Topic tags list"
4984
+ msgstr ""
4985
+
4986
+ #: includes/topics/template.php:3391
4987
+ msgid "Topic tags list navigation"
4988
+ msgstr ""
4989
+
4990
+ #: includes/topics/template.php:3392
4991
+ msgid "Separate topic tags with commas"
4992
+ msgstr ""
4993
+
4994
+ #: includes/topics/template.php:4018
4995
+ msgid "Nobody"
4996
+ msgstr ""
4997
+
4998
+ #: includes/topics/template.php:4022
4999
+ msgid "%1$s is currently editing this topic."
5000
+ msgstr ""
5001
+
5002
+ #: includes/users/engagements.php:629
5003
+ msgid ""
5004
+ "<strong>ERROR</strong>: No topic was found. Which topic are you "
5005
+ "marking/unmarking as favorite?"
5006
+ msgstr ""
5007
+
5008
+ #: includes/users/engagements.php:637
5009
+ msgid ""
5010
+ "<strong>ERROR</strong>: You do not have permission to edit favorites for "
5011
+ "that user!."
5012
+ msgstr ""
5013
+
5014
+ #: includes/users/engagements.php:678
5015
+ msgid ""
5016
+ "<strong>ERROR</strong>: There was a problem removing that topic from "
5017
+ "favorites."
5018
+ msgstr ""
5019
+
5020
+ #: includes/users/engagements.php:680
5021
+ msgid "<strong>ERROR</strong>: There was a problem favoriting that topic."
5022
+ msgstr ""
5023
+
5024
+ #: includes/users/engagements.php:921
5025
+ msgid ""
5026
+ "<strong>ERROR</strong>: Not found. What are you subscribing/unsubscribing "
5027
+ "to?"
5028
+ msgstr ""
5029
+
5030
+ #: includes/users/engagements.php:929
5031
+ msgid ""
5032
+ "<strong>ERROR</strong>: You do not have permission to edit subscriptions of "
5033
+ "that user."
5034
+ msgstr ""
5035
+
5036
+ #: includes/users/engagements.php:972
5037
+ msgid "<strong>ERROR</strong>: There was a problem unsubscribing."
5038
+ msgstr ""
5039
+
5040
+ #: includes/users/engagements.php:974
5041
+ msgid "<strong>ERROR</strong>: There was a problem subscribing."
5042
+ msgstr ""
5043
+
5044
+ #: includes/users/functions.php:211 includes/users/functions.php:223
5045
+ msgid "<strong>ERROR</strong>: That is not a valid email address."
5046
+ msgstr ""
5047
+
5048
+ #: includes/users/functions.php:229 includes/users/functions.php:348
5049
+ msgid "<strong>ERROR</strong>: That email address is already in use."
5050
+ msgstr ""
5051
+
5052
+ #: includes/users/functions.php:411
5053
+ msgid "<strong>ERROR</strong>: An error occurred while updating your email address."
5054
+ msgstr ""
5055
+
5056
+ #: includes/users/functions.php:423
5057
+ msgid ""
5058
+ "%1$s\n"
5059
+ "\n"
5060
+ "Someone requested a change to the email address on your account.\n"
5061
+ "\n"
5062
+ "Please click the following link to confirm this change:\n"
5063
+ "%2$s\n"
5064
+ "\n"
5065
+ "If you did not request this, you can safely ignore and delete this "
5066
+ "notification.\n"
5067
+ "\n"
5068
+ "This email was sent to: %3$s\n"
5069
+ "\n"
5070
+ "Regards,\n"
5071
+ "The %4$s Team\n"
5072
+ "%5$s"
5073
+ msgstr ""
5074
+
5075
+ #: includes/users/functions.php:458
5076
+ msgid "[%s] New Email Address"
5077
+ msgstr ""
5078
+
5079
+ #: includes/users/template.php:676
5080
+ msgid "Guest"
5081
+ msgstr ""
5082
+
5083
+ #: includes/users/template.php:680
5084
+ msgid "Inactive"
5085
+ msgstr ""
5086
+
5087
+ #: includes/users/template.php:690
5088
+ msgid "Member"
5089
+ msgstr ""
5090
+
5091
+ #: includes/users/template.php:731
5092
+ msgid "Admin"
5093
+ msgstr ""
5094
+
5095
+ #: includes/users/template.php:1368
5096
+ msgid "User updated."
5097
+ msgstr ""
5098
+
5099
+ #: includes/users/template.php:1412
5100
+ msgid "There is a pending email address change to %1$s. %2$s"
5101
+ msgstr ""
5102
+
5103
+ #: includes/users/template.php:1429
5104
+ msgid "You have super admin privileges."
5105
+ msgstr ""
5106
+
5107
+ #: includes/users/template.php:1429
5108
+ msgid "This user has super admin privileges."
5109
+ msgstr ""
5110
+
5111
+ #: includes/users/template.php:1503
5112
+ msgid "&mdash; No role for this site &mdash;"
5113
+ msgstr ""
5114
+
5115
+ #: includes/users/template.php:1823
5116
+ msgid "You are now logged out."
5117
+ msgstr ""
5118
+
5119
+ #: includes/users/template.php:1827
5120
+ msgid "New user registration is currently not allowed."
5121
+ msgstr ""
5122
+
5123
+ #: includes/users/template.php:1836
5124
+ msgid "Check your e-mail for the confirmation link."
5125
+ msgstr ""
5126
+
5127
+ #: includes/users/template.php:1841
5128
+ msgid "Check your e-mail for your new password."
5129
+ msgstr ""
5130
+
5131
+ #: includes/users/template.php:1846
5132
+ msgid "Registration complete. Please check your e-mail."
5133
+ msgstr ""
5134
+
5135
+ #: includes/users/template.php:2351
5136
+ msgid "Moderators:"
5137
+ msgstr ""
5138
+
5139
+ #: templates/default/bbpress/alert-topic-lock.php:21
5140
+ msgid "Leave"
5141
+ msgstr ""
5142
+
5143
+ #: templates/default/bbpress/alert-topic-lock.php:22
5144
+ msgid "Stay"
5145
+ msgstr ""
5146
+
5147
+ #: templates/default/bbpress/content-statistics.php:20
5148
+ msgid "Registered Users"
5149
+ msgstr ""
5150
+
5151
+ #: templates/default/bbpress/content-statistics.php:47
5152
+ msgid "Empty Topic Tags"
5153
+ msgstr ""
5154
+
5155
+ #: templates/default/bbpress/content-statistics.php:56
5156
+ msgid "Hidden Topics"
5157
+ msgstr ""
5158
+
5159
+ #: templates/default/bbpress/content-statistics.php:67
5160
+ msgid "Hidden Replies"
5161
+ msgstr ""
5162
+
5163
+ #: templates/default/bbpress/feedback-logged-in.php:17
5164
+ msgid "You are already logged in."
5165
+ msgstr ""
5166
+
5167
+ #: templates/default/bbpress/feedback-no-access.php:16
5168
+ msgid "Private"
5169
+ msgstr ""
5170
+
5171
+ #: templates/default/bbpress/feedback-no-access.php:20
5172
+ msgid "You do not have permission to view this forum."
5173
+ msgstr ""
5174
+
5175
+ #: templates/default/bbpress/feedback-no-forums.php:17
5176
+ msgid "Oh, bother! No forums were found here."
5177
+ msgstr ""
5178
+
5179
+ #: templates/default/bbpress/feedback-no-replies.php:17
5180
+ msgid "Oh, bother! No replies were found here."
5181
+ msgstr ""
5182
+
5183
+ #: templates/default/bbpress/feedback-no-search.php:17
5184
+ msgid "Oh, bother! No search results were found here."
5185
+ msgstr ""
5186
+
5187
+ #: templates/default/bbpress/feedback-no-topics.php:17
5188
+ msgid "Oh, bother! No topics were found here."
5189
+ msgstr ""
5190
+
5191
+ #: templates/default/bbpress/form-anonymous.php:18
5192
+ msgid "Your information:"
5193
+ msgstr ""
5194
+
5195
+ #: templates/default/bbpress/form-anonymous.php:23
5196
+ msgid "Name (required):"
5197
+ msgstr ""
5198
+
5199
+ #: templates/default/bbpress/form-anonymous.php:28
5200
+ msgid "Mail (will not be published) (required):"
5201
+ msgstr ""
5202
+
5203
+ #: templates/default/bbpress/form-forum.php:36
5204
+ #: templates/default/bbpress/form-topic.php:44
5205
+ msgid "Now Editing &ldquo;%s&rdquo;"
5206
+ msgstr ""
5207
+
5208
+ #: templates/default/bbpress/form-forum.php:39
5209
+ msgid "Create New Forum in &ldquo;%s&rdquo;"
5210
+ msgstr ""
5211
+
5212
+ #: templates/default/bbpress/form-forum.php:52
5213
+ #: templates/default/bbpress/form-reply.php:48
5214
+ msgid ""
5215
+ "This forum is closed to new content, however your posting capabilities "
5216
+ "still allow you to post."
5217
+ msgstr ""
5218
+
5219
+ #: templates/default/bbpress/form-forum.php:62
5220
+ #: templates/default/bbpress/form-reply.php:58
5221
+ #: templates/default/bbpress/form-topic.php:70
5222
+ msgid "Your account has the ability to post unrestricted HTML content."
5223
+ msgstr ""
5224
+
5225
+ #: templates/default/bbpress/form-forum.php:75
5226
+ msgid "Forum Name (Maximum Length: %d):"
5227
+ msgstr ""
5228
+
5229
+ #: templates/default/bbpress/form-forum.php:90
5230
+ #: templates/default/bbpress/form-reply.php:79
5231
+ msgid ""
5232
+ "You may use these <abbr title=\"HyperText Markup Language\">HTML</abbr> "
5233
+ "tags and attributes:"
5234
+ msgstr ""
5235
+
5236
+ #: templates/default/bbpress/form-forum.php:101
5237
+ msgid "Forum Moderators:"
5238
+ msgstr ""
5239
+
5240
+ #: templates/default/bbpress/form-forum.php:112
5241
+ msgid "Forum Type:"
5242
+ msgstr ""
5243
+
5244
+ #: templates/default/bbpress/form-forum.php:159
5245
+ #: templates/default/bbpress/form-reply-move.php:81
5246
+ #: templates/default/bbpress/form-reply.php:176
5247
+ #: templates/default/bbpress/form-topic-merge.php:103
5248
+ #: templates/default/bbpress/form-topic-split.php:107
5249
+ #: templates/default/bbpress/form-topic.php:213
5250
+ msgid "Submit"
5251
+ msgstr ""
5252
+
5253
+ #: templates/default/bbpress/form-forum.php:183
5254
+ msgid "The forum &#8216;%s&#8217; is closed to new content."
5255
+ msgstr ""
5256
+
5257
+ #: templates/default/bbpress/form-forum.php:194
5258
+ msgid "You cannot create new forums."
5259
+ msgstr ""
5260
+
5261
+ #: templates/default/bbpress/form-forum.php:195
5262
+ msgid "You must be logged in to create new forums."
5263
+ msgstr ""
5264
+
5265
+ #: templates/default/bbpress/form-protected.php:17
5266
+ msgid "Protected"
5267
+ msgstr ""
5268
+
5269
+ #: templates/default/bbpress/form-reply-move.php:27
5270
+ msgid "Move reply \"%s\""
5271
+ msgstr ""
5272
+
5273
+ #: templates/default/bbpress/form-reply-move.php:33
5274
+ msgid ""
5275
+ "You can either make this reply a new topic with a new title, or merge it "
5276
+ "into an existing topic."
5277
+ msgstr ""
5278
+
5279
+ #: templates/default/bbpress/form-reply-move.php:39
5280
+ msgid ""
5281
+ "If you choose an existing topic, replies will be ordered by the time and "
5282
+ "date they were created."
5283
+ msgstr ""
5284
+
5285
+ #: templates/default/bbpress/form-reply-move.php:44
5286
+ msgid "Move Method"
5287
+ msgstr ""
5288
+
5289
+ #: templates/default/bbpress/form-reply-move.php:48
5290
+ #: templates/default/bbpress/form-topic-split.php:48
5291
+ msgid "New topic in %s titled:"
5292
+ msgstr ""
5293
+
5294
+ #: templates/default/bbpress/form-reply-move.php:49
5295
+ msgid "Moved: %s"
5296
+ msgstr ""
5297
+
5298
+ #: templates/default/bbpress/form-reply-move.php:56
5299
+ #: templates/default/bbpress/form-topic-split.php:56
5300
+ msgid "Use an existing topic in this forum:"
5301
+ msgstr ""
5302
+
5303
+ #: templates/default/bbpress/form-reply-move.php:95
5304
+ msgid "You do not have permission to edit this reply."
5305
+ msgstr ""
5306
+
5307
+ #: templates/default/bbpress/form-reply-move.php:96
5308
+ msgid "You cannot edit this reply."
5309
+ msgstr ""
5310
+
5311
+ #: templates/default/bbpress/form-reply-search.php:18
5312
+ msgid "Search replies:"
5313
+ msgstr ""
5314
+
5315
+ #: templates/default/bbpress/form-reply.php:30
5316
+ msgid "Reply #%1$s in %2$s"
5317
+ msgstr ""
5318
+
5319
+ #: templates/default/bbpress/form-reply.php:38
5320
+ msgid ""
5321
+ "This topic is marked as closed to new replies, however your posting "
5322
+ "capabilities still allow you to reply."
5323
+ msgstr ""
5324
+
5325
+ #: templates/default/bbpress/form-reply.php:90
5326
+ msgid "Tags:"
5327
+ msgstr ""
5328
+
5329
+ #: templates/default/bbpress/form-reply.php:108
5330
+ #: templates/default/bbpress/form-topic.php:174
5331
+ msgid "Notify the author of follow-up replies via email"
5332
+ msgstr ""
5333
+
5334
+ #: templates/default/bbpress/form-reply.php:112
5335
+ #: templates/default/bbpress/form-topic.php:178
5336
+ msgid "Notify me of follow-up replies via email"
5337
+ msgstr ""
5338
+
5339
+ #: templates/default/bbpress/form-reply.php:138
5340
+ msgid "Reply Status:"
5341
+ msgstr ""
5342
+
5343
+ #: templates/default/bbpress/form-reply.php:153
5344
+ #: templates/default/bbpress/form-topic.php:194
5345
+ msgid "Keep a log of this edit:"
5346
+ msgstr ""
5347
+
5348
+ #: templates/default/bbpress/form-reply.php:157
5349
+ #: templates/default/bbpress/form-topic.php:198
5350
+ msgid "Optional reason for editing:"
5351
+ msgstr ""
5352
+
5353
+ #: templates/default/bbpress/form-reply.php:200
5354
+ msgid "The topic &#8216;%s&#8217; is closed to new replies."
5355
+ msgstr ""
5356
+
5357
+ #: templates/default/bbpress/form-reply.php:210
5358
+ #: templates/default/bbpress/form-topic.php:237
5359
+ msgid "The forum &#8216;%s&#8217; is closed to new topics and replies."
5360
+ msgstr ""
5361
+
5362
+ #: templates/default/bbpress/form-reply.php:221
5363
+ msgid "You cannot reply to this topic."
5364
+ msgstr ""
5365
+
5366
+ #: templates/default/bbpress/form-reply.php:222
5367
+ msgid "You must be logged in to reply to this topic."
5368
+ msgstr ""
5369
+
5370
+ #: templates/default/bbpress/form-search.php:18
5371
+ msgid "Search for:"
5372
+ msgstr ""
5373
+
5374
+ #: templates/default/bbpress/form-topic-merge.php:27
5375
+ msgid "Merge topic \"%s\""
5376
+ msgstr ""
5377
+
5378
+ #: templates/default/bbpress/form-topic-merge.php:33
5379
+ msgid ""
5380
+ "Select the topic to merge this one into. The destination topic will remain "
5381
+ "the lead topic, and this one will change into a reply."
5382
+ msgstr ""
5383
+
5384
+ #: templates/default/bbpress/form-topic-merge.php:34
5385
+ msgid ""
5386
+ "To keep this topic as the lead, go to the other topic and use the merge "
5387
+ "tool from there instead."
5388
+ msgstr ""
5389
+
5390
+ #: templates/default/bbpress/form-topic-merge.php:40
5391
+ msgid ""
5392
+ "Replies to both topics are merged chronologically, ordered by the time and "
5393
+ "date they were published. Topics may be updated to a 1 second difference to "
5394
+ "maintain chronological order based on the merge direction."
5395
+ msgstr ""
5396
+
5397
+ #: templates/default/bbpress/form-topic-merge.php:45
5398
+ msgid "Destination"
5399
+ msgstr ""
5400
+
5401
+ #: templates/default/bbpress/form-topic-merge.php:49
5402
+ msgid "Merge with this topic:"
5403
+ msgstr ""
5404
+
5405
+ #: templates/default/bbpress/form-topic-merge.php:64
5406
+ msgid "There are no other topics in this forum to merge with."
5407
+ msgstr ""
5408
+
5409
+ #: templates/default/bbpress/form-topic-merge.php:72
5410
+ #: templates/default/bbpress/form-topic-split.php:76
5411
+ msgid "Topic Extras"
5412
+ msgstr ""
5413
+
5414
+ #: templates/default/bbpress/form-topic-merge.php:79
5415
+ msgid "Merge topic subscribers"
5416
+ msgstr ""
5417
+
5418
+ #: templates/default/bbpress/form-topic-merge.php:84
5419
+ msgid "Merge topic favoriters"
5420
+ msgstr ""
5421
+
5422
+ #: templates/default/bbpress/form-topic-merge.php:89
5423
+ msgid "Merge topic tags"
5424
+ msgstr ""
5425
+
5426
+ #: templates/default/bbpress/form-topic-merge.php:117
5427
+ #: templates/default/bbpress/form-topic-split.php:121
5428
+ msgid "You do not have permission to edit this topic."
5429
+ msgstr ""
5430
+
5431
+ #: templates/default/bbpress/form-topic-merge.php:118
5432
+ #: templates/default/bbpress/form-topic-split.php:122
5433
+ msgid "You cannot edit this topic."
5434
+ msgstr ""
5435
+
5436
+ #: templates/default/bbpress/form-topic-search.php:18
5437
+ msgid "Search topics:"
5438
+ msgstr ""
5439
+
5440
+ #: templates/default/bbpress/form-topic-split.php:27
5441
+ msgid "Split topic \"%s\""
5442
+ msgstr ""
5443
+
5444
+ #: templates/default/bbpress/form-topic-split.php:33
5445
+ msgid ""
5446
+ "When you split a topic, you are slicing it in half starting with the reply "
5447
+ "you just selected. Choose to use that reply as a new topic with a new "
5448
+ "title, or merge those replies into an existing topic."
5449
+ msgstr ""
5450
+
5451
+ #: templates/default/bbpress/form-topic-split.php:39
5452
+ msgid ""
5453
+ "If you use the existing topic option, replies within both topics will be "
5454
+ "merged chronologically. The order of the merged replies is based on the "
5455
+ "time and date they were posted."
5456
+ msgstr ""
5457
+
5458
+ #: templates/default/bbpress/form-topic-split.php:44
5459
+ msgid "Split Method"
5460
+ msgstr ""
5461
+
5462
+ #: templates/default/bbpress/form-topic-split.php:49
5463
+ msgid "Split: %s"
5464
+ msgstr ""
5465
+
5466
+ #: templates/default/bbpress/form-topic-split.php:83
5467
+ msgid "Copy subscribers to the new topic"
5468
+ msgstr ""
5469
+
5470
+ #: templates/default/bbpress/form-topic-split.php:88
5471
+ msgid "Copy favoriters to the new topic"
5472
+ msgstr ""
5473
+
5474
+ #: templates/default/bbpress/form-topic-split.php:93
5475
+ msgid "Copy topic tags to the new topic"
5476
+ msgstr ""
5477
+
5478
+ #: templates/default/bbpress/form-topic-tag.php:19
5479
+ msgid "Manage Tag: \"%s\""
5480
+ msgstr ""
5481
+
5482
+ #: templates/default/bbpress/form-topic-tag.php:23
5483
+ msgid "Rename"
5484
+ msgstr ""
5485
+
5486
+ #: templates/default/bbpress/form-topic-tag.php:27
5487
+ msgid "Leave the slug empty to have one automatically generated."
5488
+ msgstr ""
5489
+
5490
+ #: templates/default/bbpress/form-topic-tag.php:33
5491
+ msgid ""
5492
+ "Changing the slug affects its permalink. Any links to the old slug will "
5493
+ "stop working."
5494
+ msgstr ""
5495
+
5496
+ #: templates/default/bbpress/form-topic-tag.php:45
5497
+ msgid "Slug:"
5498
+ msgstr ""
5499
+
5500
+ #: templates/default/bbpress/form-topic-tag.php:50
5501
+ msgid "Description:"
5502
+ msgstr ""
5503
+
5504
+ #: templates/default/bbpress/form-topic-tag.php:55
5505
+ msgid "Update"
5506
+ msgstr ""
5507
+
5508
+ #: templates/default/bbpress/form-topic-tag.php:73
5509
+ msgid "Merging tags together cannot be undone."
5510
+ msgstr ""
5511
+
5512
+ #: templates/default/bbpress/form-topic-tag.php:80
5513
+ msgid "Existing tag:"
5514
+ msgstr ""
5515
+
5516
+ #: templates/default/bbpress/form-topic-tag.php:85
5517
+ msgid "Are you sure you want to merge the \"%s\" tag into the tag you specified?"
5518
+ msgstr ""
5519
+
5520
+ #: templates/default/bbpress/form-topic-tag.php:104
5521
+ msgid "This does not delete your topics. Only the tag itself is deleted."
5522
+ msgstr ""
5523
+
5524
+ #: templates/default/bbpress/form-topic-tag.php:109
5525
+ msgid "Deleting a tag cannot be undone."
5526
+ msgstr ""
5527
+
5528
+ #: templates/default/bbpress/form-topic-tag.php:110
5529
+ msgid "Any links to this tag will no longer function."
5530
+ msgstr ""
5531
+
5532
+ #: templates/default/bbpress/form-topic-tag.php:117
5533
+ msgid ""
5534
+ "Are you sure you want to delete the \"%s\" tag? This is permanent and "
5535
+ "cannot be undone."
5536
+ msgstr ""
5537
+
5538
+ #: templates/default/bbpress/form-topic.php:47
5539
+ msgid "Create New Topic in &ldquo;%s&rdquo;"
5540
+ msgstr ""
5541
+
5542
+ #: templates/default/bbpress/form-topic.php:60
5543
+ msgid ""
5544
+ "This forum is marked as closed to new topics, however your posting "
5545
+ "capabilities still allow you to create a topic."
5546
+ msgstr ""
5547
+
5548
+ #: templates/default/bbpress/form-topic.php:85
5549
+ msgid "Topic Title (Maximum Length: %d):"
5550
+ msgstr ""
5551
+
5552
+ #: templates/default/bbpress/form-topic.php:100
5553
+ msgid "You may use these %s tags and attributes:"
5554
+ msgstr ""
5555
+
5556
+ #: templates/default/bbpress/form-topic.php:111
5557
+ msgid "Topic Tags:"
5558
+ msgstr ""
5559
+
5560
+ #: templates/default/bbpress/form-topic.php:143
5561
+ msgid "Topic Type:"
5562
+ msgstr ""
5563
+
5564
+ #: templates/default/bbpress/form-topic.php:155
5565
+ msgid "Topic Status:"
5566
+ msgstr ""
5567
+
5568
+ #: templates/default/bbpress/form-topic.php:248
5569
+ msgid "You cannot create new topics."
5570
+ msgstr ""
5571
+
5572
+ #: templates/default/bbpress/form-topic.php:249
5573
+ msgid "You must be logged in to create new topics."
5574
+ msgstr ""
5575
+
5576
+ #: templates/default/bbpress/form-user-edit.php:27
5577
+ msgid "First Name"
5578
+ msgstr ""
5579
+
5580
+ #: templates/default/bbpress/form-user-edit.php:32
5581
+ msgid "Last Name"
5582
+ msgstr ""
5583
+
5584
+ #: templates/default/bbpress/form-user-edit.php:37
5585
+ msgid "Nickname"
5586
+ msgstr ""
5587
+
5588
+ #: templates/default/bbpress/form-user-edit.php:42
5589
+ msgid "Display Name"
5590
+ msgstr ""
5591
+
5592
+ #: templates/default/bbpress/form-user-edit.php:52
5593
+ #: templates/default/bbpress/form-user-edit.php:55
5594
+ msgid "Contact Info"
5595
+ msgstr ""
5596
+
5597
+ #: templates/default/bbpress/form-user-edit.php:78
5598
+ #: templates/default/bbpress/form-user-edit.php:84
5599
+ msgid "About Yourself"
5600
+ msgstr ""
5601
+
5602
+ #: templates/default/bbpress/form-user-edit.php:79
5603
+ #: templates/default/bbpress/form-user-edit.php:85
5604
+ msgid "About the user"
5605
+ msgstr ""
5606
+
5607
+ #: templates/default/bbpress/form-user-edit.php:91
5608
+ msgid "Biographical Info"
5609
+ msgstr ""
5610
+
5611
+ #: templates/default/bbpress/form-user-edit.php:99
5612
+ #: templates/default/bbpress/form-user-edit.php:102
5613
+ msgid "Account"
5614
+ msgstr ""
5615
+
5616
+ #: templates/default/bbpress/form-user-edit.php:119
5617
+ msgid "Language"
5618
+ msgstr ""
5619
+
5620
+ #: templates/default/bbpress/form-user-edit.php:131
5621
+ #: templates/default/bbpress/form-user-edit.php:134
5622
+ msgid "User Role"
5623
+ msgstr ""
5624
+
5625
+ #: templates/default/bbpress/form-user-edit.php:141
5626
+ msgid "Network Role"
5627
+ msgstr ""
5628
+
5629
+ #: templates/default/bbpress/form-user-edit.php:144
5630
+ msgid "Grant this user super admin privileges for the Network."
5631
+ msgstr ""
5632
+
5633
+ #: templates/default/bbpress/form-user-edit.php:167
5634
+ msgid "Update Profile"
5635
+ msgstr ""
5636
+
5637
+ #: templates/default/bbpress/form-user-edit.php:168
5638
+ msgid "Update User"
5639
+ msgstr ""
5640
+
5641
+ #: templates/default/bbpress/form-user-login.php:31
5642
+ msgid "Keep me signed in"
5643
+ msgstr ""
5644
+
5645
+ #: templates/default/bbpress/form-user-lost-pass.php:21
5646
+ msgid "Username or Email"
5647
+ msgstr ""
5648
+
5649
+ #: templates/default/bbpress/form-user-lost-pass.php:30
5650
+ msgid "Reset My Password"
5651
+ msgstr ""
5652
+
5653
+ #: templates/default/bbpress/form-user-passwords.php:18
5654
+ msgid "Generate Password"
5655
+ msgstr ""
5656
+
5657
+ #: templates/default/bbpress/form-user-passwords.php:26
5658
+ msgid "Hide password"
5659
+ msgstr ""
5660
+
5661
+ #: templates/default/bbpress/form-user-passwords.php:28
5662
+ msgid "Hide"
5663
+ msgstr ""
5664
+
5665
+ #: templates/default/bbpress/form-user-passwords.php:29
5666
+ msgid "Cancel password change"
5667
+ msgstr ""
5668
+
5669
+ #: templates/default/bbpress/form-user-passwords.php:40
5670
+ msgid "Repeat New Password"
5671
+ msgstr ""
5672
+
5673
+ #: templates/default/bbpress/form-user-passwords.php:42
5674
+ msgid "Type your new password again."
5675
+ msgstr ""
5676
+
5677
+ #: templates/default/bbpress/form-user-passwords.php:46
5678
+ msgid "Confirm"
5679
+ msgstr ""
5680
+
5681
+ #: templates/default/bbpress/form-user-register.php:17
5682
+ msgid "Create an Account"
5683
+ msgstr ""
5684
+
5685
+ #: templates/default/bbpress/form-user-register.php:23
5686
+ msgid "Your username must be unique, and cannot be changed later."
5687
+ msgstr ""
5688
+
5689
+ #: templates/default/bbpress/form-user-register.php:24
5690
+ msgid ""
5691
+ "We use your email address to email you a secure password and verify your "
5692
+ "account."
5693
+ msgstr ""
5694
+
5695
+ #: templates/default/bbpress/form-user-roles.php:16
5696
+ msgid "Blog Role"
5697
+ msgstr ""
5698
+
5699
+ #: templates/default/bbpress/loop-search-forum.php:17
5700
+ msgid "Last updated %s"
5701
+ msgstr ""
5702
+
5703
+ #: templates/default/bbpress/loop-search-reply.php:22
5704
+ msgid "In reply to: "
5705
+ msgstr ""
5706
+
5707
+ #: templates/default/bbpress/loop-search-topic.php:32
5708
+ msgid "in group forum "
5709
+ msgstr ""
5710
+
5711
+ #: templates/default/bbpress/loop-search-topic.php:36
5712
+ msgid "in forum "
5713
+ msgstr ""
5714
+
5715
+ #: templates/default/bbpress/loop-search.php:23
5716
+ #: templates/default/bbpress/loop-search.php:45
5717
+ msgid "Search Results"
5718
+ msgstr ""
5719
+
5720
+ #: templates/default/bbpress/loop-single-reply.php:22
5721
+ msgid "in reply to: "
5722
+ msgstr ""
5723
+
5724
+ #: templates/default/bbpress/loop-single-topic.php:62
5725
+ msgid "Started by: %1$s"
5726
+ msgstr ""
5727
+
5728
+ #: templates/default/bbpress/loop-single-topic.php:70
5729
+ msgid "in: %1$s"
5730
+ msgstr ""
5731
+
5732
+ #: templates/default/bbpress/user-details.php:30
5733
+ #: templates/default/bbpress/user-profile.php:18
5734
+ msgid "Profile"
5735
+ msgstr ""
5736
+
5737
+ #: templates/default/bbpress/user-details.php:36
5738
+ msgid "%s's Topics Started"
5739
+ msgstr ""
5740
+
5741
+ #: templates/default/bbpress/user-details.php:42
5742
+ msgid "%s's Replies Created"
5743
+ msgstr ""
5744
+
5745
+ #: templates/default/bbpress/user-details.php:49
5746
+ msgid "%s's Engagements"
5747
+ msgstr ""
5748
+
5749
+ #: templates/default/bbpress/user-engagements.php:19
5750
+ msgid "Topics Engaged In"
5751
+ msgstr ""
5752
+
5753
+ #: templates/default/bbpress/user-favorites.php:19
5754
+ msgid "Favorite Forum Topics"
5755
+ msgstr ""
5756
+
5757
+ #: templates/default/bbpress/user-profile.php:19
5758
+ msgid "Registered: %s"
5759
+ msgstr ""
5760
+
5761
+ #: templates/default/bbpress/user-profile.php:29
5762
+ msgid "Website: %s"
5763
+ msgstr ""
5764
+
5765
+ #: templates/default/bbpress/user-profile.php:38
5766
+ msgid "Last Activity: %s"
5767
+ msgstr ""
5768
+
5769
+ #: templates/default/bbpress/user-profile.php:42
5770
+ msgid "Topics Started: %s"
5771
+ msgstr ""
5772
+
5773
+ #: templates/default/bbpress/user-profile.php:43
5774
+ msgid "Replies Created: %s"
5775
+ msgstr ""
5776
+
5777
+ #: templates/default/bbpress/user-profile.php:44
5778
+ msgid "Forum Role: %s"
5779
+ msgstr ""
5780
+
5781
+ #: templates/default/bbpress/user-replies-created.php:19
5782
+ msgid "Forum Replies Created"
5783
+ msgstr ""
5784
+
5785
+ #: templates/default/bbpress/user-subscriptions.php:23
5786
+ msgid "Subscribed Forums"
5787
+ msgstr ""
5788
+
5789
+ #: templates/default/bbpress/user-subscriptions.php:33
5790
+ msgid "You are not currently subscribed to any forums."
5791
+ msgstr ""
5792
+
5793
+ #: templates/default/bbpress/user-subscriptions.php:34
5794
+ msgid "This user is not currently subscribed to any forums."
5795
+ msgstr ""
5796
+
5797
+ #: templates/default/bbpress/user-topics-created.php:19
5798
+ msgid "Forum Topics Started"
5799
+ msgstr ""
5800
+
5801
+ #: templates/default/bbpress-functions.php:220
5802
+ msgid "Something went wrong. Refresh your browser and try again."
5803
+ msgstr ""
5804
+
5805
+ #: templates/default/bbpress-functions.php:235
5806
+ msgid "Favorites are no longer active."
5807
+ msgstr ""
5808
+
5809
+ #: templates/default/bbpress-functions.php:240
5810
+ msgid "Please login to favorite."
5811
+ msgstr ""
5812
+
5813
+ #: templates/default/bbpress-functions.php:250
5814
+ #: templates/default/bbpress-functions.php:314
5815
+ msgid "You do not have permission to do this."
5816
+ msgstr ""
5817
+
5818
+ #: templates/default/bbpress-functions.php:260
5819
+ msgid "Favorite failed."
5820
+ msgstr ""
5821
+
5822
+ #: templates/default/bbpress-functions.php:265
5823
+ #: templates/default/bbpress-functions.php:329
5824
+ msgid "Are you sure you meant to do that?"
5825
+ msgstr ""
5826
+
5827
+ #: templates/default/bbpress-functions.php:275
5828
+ #: templates/default/bbpress-functions.php:339
5829
+ msgid "The request was unsuccessful. Please try again."
5830
+ msgstr ""
5831
+
5832
+ #: templates/default/bbpress-functions.php:299
5833
+ msgid "Subscriptions are no longer active."
5834
+ msgstr ""
5835
+
5836
+ #: templates/default/bbpress-functions.php:304
5837
+ msgid "Please login to subscribe."
5838
+ msgstr ""
5839
+
5840
+ #: templates/default/bbpress-functions.php:324
5841
+ msgid "Subcription failed."
5842
+ msgstr ""
5843
+
5844
+ #: templates/default/extras/page-forum-statistics.php:22
5845
+ msgid "Here are the statistics and popular topics of our forums."
5846
+ msgstr ""
5847
+
5848
+ #: templates/default/extras/page-topic-tags.php:22
5849
+ msgid "This is a collection of tags that are currently popular on our forums."
5850
+ msgstr ""
5851
+
5852
+ #. Plugin Name of the plugin/theme
5853
+ msgid "bbPress"
5854
+ msgstr ""
5855
+
5856
+ #. Author URI of the plugin/theme
5857
+ msgid "https://bbpress.org"
5858
+ msgstr ""
5859
+
5860
+ #. Description of the plugin/theme
5861
+ msgid "bbPress is forum software with a twist from the creators of WordPress."
5862
+ msgstr ""
5863
+
5864
+ #. Author of the plugin/theme
5865
+ msgid "The bbPress Contributors"
5866
+ msgstr ""
5867
+
5868
+ #: bbpress.php:595
5869
+ msgctxt "post"
5870
+ msgid "Closed"
5871
+ msgstr ""
5872
+
5873
+ #: bbpress.php:596
5874
+ msgctxt "post"
5875
+ msgid "Closed <span class=\"count\">(%s)</span>"
5876
+ msgid_plural "Closed <span class=\"count\">(%s)</span>"
5877
+ msgstr[0] ""
5878
+ msgstr[1] ""
5879
+
5880
+ #: bbpress.php:608
5881
+ msgctxt "post"
5882
+ msgid "Spam"
5883
+ msgstr ""
5884
+
5885
+ #: bbpress.php:609
5886
+ msgctxt "post"
5887
+ msgid "Spam <span class=\"count\">(%s)</span>"
5888
+ msgid_plural "Spam <span class=\"count\">(%s)</span>"
5889
+ msgstr[0] ""
5890
+ msgstr[1] ""
5891
+
5892
+ #: bbpress.php:622
5893
+ msgctxt "post"
5894
+ msgid "Orphan"
5895
+ msgstr ""
5896
+
5897
+ #: bbpress.php:623
5898
+ msgctxt "post"
5899
+ msgid "Orphan <span class=\"count\">(%s)</span>"
5900
+ msgid_plural "Orphans <span class=\"count\">(%s)</span>"
5901
+ msgstr[0] ""
5902
+ msgstr[1] ""
5903
+
5904
+ #: bbpress.php:636
5905
+ msgctxt "post"
5906
+ msgid "Hidden"
5907
+ msgstr ""
5908
+
5909
+ #: bbpress.php:637
5910
+ msgctxt "post"
5911
+ msgid "Hidden <span class=\"count\">(%s)</span>"
5912
+ msgid_plural "Hidden <span class=\"count\">(%s)</span>"
5913
+ msgstr[0] ""
5914
+ msgstr[1] ""
5915
+
5916
+ #: includes/admin/classes/class-bbp-admin.php:687
5917
+ msgctxt "admin color scheme"
5918
+ msgid "Mint"
5919
+ msgstr ""
5920
+
5921
+ #: includes/admin/classes/class-bbp-admin.php:696
5922
+ msgctxt "admin color scheme"
5923
+ msgid "Evergreen"
5924
+ msgstr ""
5925
+
5926
+ #: includes/admin/forums.php:613
5927
+ msgctxt "Close a Forum"
5928
+ msgid "Close"
5929
+ msgstr ""
5930
+
5931
+ #: includes/admin/forums.php:615
5932
+ msgctxt "Open a Forum"
5933
+ msgid "Open"
5934
+ msgstr ""
5935
+
5936
+ #: includes/admin/replies.php:787
5937
+ msgctxt "Unapprove reply"
5938
+ msgid "Unapprove"
5939
+ msgstr ""
5940
+
5941
+ #: includes/admin/replies.php:789
5942
+ msgctxt "Approve reply"
5943
+ msgid "Approve"
5944
+ msgstr ""
5945
+
5946
+ #: includes/admin/settings.php:383 includes/replies/template.php:51
5947
+ msgctxt "noun"
5948
+ msgid "Reply"
5949
+ msgstr ""
5950
+
5951
+ #: includes/admin/topics.php:960
5952
+ msgctxt "Unapprove Topic"
5953
+ msgid "Unapprove"
5954
+ msgstr ""
5955
+
5956
+ #: includes/admin/topics.php:962
5957
+ msgctxt "Approve Topic"
5958
+ msgid "Approve"
5959
+ msgstr ""
5960
+
5961
+ #: includes/admin/topics.php:971
5962
+ msgctxt "Close a Topic"
5963
+ msgid "Close"
5964
+ msgstr ""
5965
+
5966
+ #: includes/admin/topics.php:973
5967
+ msgctxt "Open a Topic"
5968
+ msgid "Open"
5969
+ msgstr ""
5970
+
5971
+ #: includes/common/formatting.php:692
5972
+ msgctxt "Separator in time since"
5973
+ msgid ","
5974
+ msgstr ""
5975
+
5976
+ #: includes/common/locale.php:44
5977
+ #. translators: user role
5978
+ msgctxt "User role"
5979
+ msgid "Keymaster"
5980
+ msgstr ""
5981
+
5982
+ #: includes/common/locale.php:47
5983
+ #. translators: user role
5984
+ msgctxt "User role"
5985
+ msgid "Moderator"
5986
+ msgstr ""
5987
+
5988
+ #: includes/common/locale.php:50
5989
+ #. translators: user role
5990
+ msgctxt "User role"
5991
+ msgid "Participant"
5992
+ msgstr ""
5993
+
5994
+ #: includes/common/locale.php:53
5995
+ #. translators: user role
5996
+ msgctxt "User role"
5997
+ msgid "Spectator"
5998
+ msgstr ""
5999
+
6000
+ #: includes/common/locale.php:56
6001
+ #. translators: user role
6002
+ msgctxt "User role"
6003
+ msgid "Blocked"
6004
+ msgstr ""
6005
+
6006
+ #: includes/common/widgets.php:796
6007
+ msgctxt "widgets"
6008
+ msgid "by %1$s"
6009
+ msgstr ""
6010
+
6011
+ #: includes/common/widgets.php:1137
6012
+ #. translators: 1: reply author, 2: reply link, 3: reply timestamp
6013
+ msgctxt "widgets"
6014
+ msgid "%1$s on %2$s %3$s"
6015
+ msgstr ""
6016
+
6017
+ #: includes/common/widgets.php:1143
6018
+ #. translators: 1: reply link, 2: reply timestamp
6019
+ msgctxt "widgets"
6020
+ msgid "%1$s %2$s"
6021
+ msgstr ""
6022
+
6023
+ #: includes/common/widgets.php:1149
6024
+ #. translators: 1: reply author, 2: reply link
6025
+ msgctxt "widgets"
6026
+ msgid "%1$s on %2$s"
6027
+ msgstr ""
6028
+
6029
+ #: includes/common/widgets.php:1155
6030
+ #. translators: 1: reply link
6031
+ msgctxt "widgets"
6032
+ msgid "%1$s"
6033
+ msgstr ""
6034
+
6035
+ #: includes/extend/buddypress/groups.php:491
6036
+ msgctxt "group admin edit screen"
6037
+ msgid "Discussion Forum"
6038
+ msgstr ""
6039
+
6040
+ #: includes/forums/functions.php:1830
6041
+ msgctxt "Open the forum"
6042
+ msgid "Open"
6043
+ msgstr ""
6044
+
6045
+ #: includes/forums/functions.php:1831
6046
+ msgctxt "Close the forum"
6047
+ msgid "Closed"
6048
+ msgstr ""
6049
+
6050
+ #: includes/forums/functions.php:1848
6051
+ msgctxt "Forum accepts new topics"
6052
+ msgid "Forum"
6053
+ msgstr ""
6054
+
6055
+ #: includes/forums/functions.php:1849
6056
+ msgctxt "Forum is a category"
6057
+ msgid "Category"
6058
+ msgstr ""
6059
+
6060
+ #: includes/forums/functions.php:1866
6061
+ msgctxt "Make forum public"
6062
+ msgid "Public"
6063
+ msgstr ""
6064
+
6065
+ #: includes/forums/functions.php:1867
6066
+ msgctxt "Make forum private"
6067
+ msgid "Private"
6068
+ msgstr ""
6069
+
6070
+ #: includes/forums/functions.php:1868
6071
+ msgctxt "Make forum hidden"
6072
+ msgid "Hidden"
6073
+ msgstr ""
6074
+
6075
+ #: includes/replies/functions.php:1617
6076
+ msgctxt "Publish the reply"
6077
+ msgid "Publish"
6078
+ msgstr ""
6079
+
6080
+ #: includes/replies/functions.php:1618
6081
+ msgctxt "Spam the reply"
6082
+ msgid "Spam"
6083
+ msgstr ""
6084
+
6085
+ #: includes/replies/functions.php:1619
6086
+ msgctxt "Trash the reply"
6087
+ msgid "Trash"
6088
+ msgstr ""
6089
+
6090
+ #: includes/replies/functions.php:1620
6091
+ msgctxt "Mark reply as pending"
6092
+ msgid "Pending"
6093
+ msgstr ""
6094
+
6095
+ #: includes/replies/template.php:642 includes/topics/template.php:751
6096
+ msgctxt "date at time"
6097
+ msgid "%1$s at %2$s"
6098
+ msgstr ""
6099
+
6100
+ #: includes/replies/template.php:1521 includes/topics/template.php:2867
6101
+ msgctxt "verb"
6102
+ msgid "Reply"
6103
+ msgstr ""
6104
+
6105
+ #: includes/replies/template.php:2142
6106
+ msgctxt "Pending Status"
6107
+ msgid "Approve"
6108
+ msgstr ""
6109
+
6110
+ #: includes/replies/template.php:2143
6111
+ msgctxt "Pending Status"
6112
+ msgid "Unapprove"
6113
+ msgstr ""
6114
+
6115
+ #: includes/replies/template.php:2505
6116
+ msgctxt "Default reply to dropdown text"
6117
+ msgid "None"
6118
+ msgstr ""
6119
+
6120
+ #: includes/topics/functions.php:1826 includes/topics/template.php:2595
6121
+ msgctxt "Open the topic"
6122
+ msgid "Open"
6123
+ msgstr ""
6124
+
6125
+ #: includes/topics/functions.php:1827
6126
+ msgctxt "Close the topic"
6127
+ msgid "Closed"
6128
+ msgstr ""
6129
+
6130
+ #: includes/topics/template.php:2594
6131
+ msgctxt "Close the topic"
6132
+ msgid "Close"
6133
+ msgstr ""
6134
+
6135
+ #: includes/topics/functions.php:1828
6136
+ msgctxt "Spam the topic"
6137
+ msgid "Spam"
6138
+ msgstr ""
6139
+
6140
+ #: includes/topics/functions.php:1829
6141
+ msgctxt "Trash the topic"
6142
+ msgid "Trash"
6143
+ msgstr ""
6144
+
6145
+ #: includes/topics/functions.php:1830
6146
+ msgctxt "Unapprove the topic"
6147
+ msgid "Pending"
6148
+ msgstr ""
6149
+
6150
+ #: includes/topics/template.php:2649
6151
+ msgctxt "Unapprove the topic"
6152
+ msgid "Unapprove"
6153
+ msgstr ""
6154
+
6155
+ #: includes/topics/functions.php:1847
6156
+ msgctxt "Unstick a topic"
6157
+ msgid "Normal"
6158
+ msgstr ""
6159
+
6160
+ #: includes/topics/functions.php:1848
6161
+ msgctxt "Make topic sticky"
6162
+ msgid "Sticky"
6163
+ msgstr ""
6164
+
6165
+ #: includes/topics/functions.php:1849
6166
+ msgctxt "Make topic super sticky"
6167
+ msgid "Super Sticky"
6168
+ msgstr ""
6169
+
6170
+ #: includes/topics/template.php:2648
6171
+ msgctxt "Approve the topic"
6172
+ msgid "Approve"
6173
+ msgstr ""
6174
+
6175
+ #: includes/users/template.php:1407
6176
+ msgctxt "Dismiss pending user email address change"
6177
+ msgid "Cancel"
6178
+ 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
+ }
humans.txt CHANGED
@@ -45,10 +45,15 @@ Twitter: jmdodd
45
  Name: Stephen Edgar
46
  Title: Core Contributor
47
  Twitter: netweb
 
 
 
 
 
48
 
49
  /* THANKS */
50
- Mike Adams, Gautam Gupta, Ben L, Justin Tadlock, cnorris23, anointed, andy, nacin
51
 
52
  /* META */
53
- Updated: 2013/11/25
54
- See: http://humanstxt.org/
45
  Name: Stephen Edgar
46
  Title: Core Contributor
47
  Twitter: netweb
48
+ Favorite Food: Tacos 🌮
49
+
50
+ Name: Sergey Biryukov
51
+ Title: Core Contributor
52
+ Twitter: sergeybiryukov
53
 
54
  /* THANKS */
55
+ Mike Adams, Gautam Gupta, Ben L, Justin Tadlock, Pippin Williamson, cnorris23, anointed, andy, nacin
56
 
57
  /* META */
58
+ Updated: 2017/09/09
59
+ See: http://humanstxt.org/
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.
@@ -13,14 +10,17 @@
13
  * There are a few common places that additional actions can currently be found
14
  *
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,22 +42,26 @@ 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
 
62
  // Reset the menu order
63
  add_action( 'bbp_admin_menu', 'bbp_admin_separator' );
@@ -73,21 +77,56 @@ 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' );
81
- add_action( 'load-tools_page_bbp-reset', 'bbp_admin_reset_handler' );
 
 
82
 
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 +138,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,13 +152,67 @@ 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() {
124
  do_action( 'bbp_admin_init' );
@@ -127,8 +221,7 @@ 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() {
134
  do_action( 'bbp_admin_menu' );
@@ -137,8 +230,7 @@ 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() {
144
  do_action( 'bbp_admin_head' );
@@ -147,8 +239,7 @@ 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() {
154
  do_action( 'bbp_admin_notices' );
@@ -157,8 +248,7 @@ 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() {
164
  do_action( 'bbp_register_importers' );
@@ -167,8 +257,7 @@ 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() {
174
  do_action( 'bbp_register_admin_style' );
@@ -177,9 +266,28 @@ 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.
10
  * There are a few common places that additional actions can currently be found
11
  *
12
  * - bbPress: In {@link bbPress::setup_actions()} in bbpress.php
13
+ * - Admin: More in {@link BBP_Admin::setup_actions()} in class-bbp-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
+ add_action( 'tool_box', 'bbp_admin_tool_box' );
50
 
51
  // Hook on to admin_init
 
 
 
52
  add_action( 'bbp_admin_init', 'bbp_setup_updater', 999 );
53
  add_action( 'bbp_admin_init', 'bbp_register_importers' );
54
  add_action( 'bbp_admin_init', 'bbp_register_admin_style' );
55
  add_action( 'bbp_admin_init', 'bbp_register_admin_settings' );
56
  add_action( 'bbp_admin_init', 'bbp_do_activation_redirect', 1 );
57
 
58
+ // Hook on to current_screen
59
+ add_action( 'bbp_current_screen', 'bbp_admin_forums' );
60
+ add_action( 'bbp_current_screen', 'bbp_admin_topics' );
61
+ add_action( 'bbp_current_screen', 'bbp_admin_replies' );
62
+
63
  // Initialize the admin area
64
+ add_action( 'bbp_init', 'bbp_setup_admin' );
65
 
66
  // Reset the menu order
67
  add_action( 'bbp_admin_menu', 'bbp_admin_separator' );
77
  // New Site
78
  add_action( 'bbp_new_site', 'bbp_create_initial_content', 8 );
79
 
80
+ // Load the default repair tools
81
+ add_action( 'load-tools_page_bbp-repair', 'bbp_register_default_repair_tools' );
82
+ add_action( 'load-tools_page_bbp-upgrade', 'bbp_register_default_repair_tools' );
83
+
84
  // Contextual Helpers
85
+ add_action( 'load-settings_page_bbpress', 'bbp_admin_settings_help' );
86
+ add_action( 'load-tools_page_bbp-repair', 'bbp_admin_tools_repair_help' );
87
+ add_action( 'load-tools_page_bbp-upgrade', 'bbp_admin_tools_repair_help' );
88
+ add_action( 'load-tools_page_bbp-converter', 'bbp_admin_tools_converter_help' );
89
+ add_action( 'load-tools_page_bbp-reset', 'bbp_admin_tools_reset_help' );
90
 
91
  // Handle submission of Tools pages
92
+ add_action( 'load-tools_page_bbp-repair', 'bbp_admin_repair_handler' );
93
+ add_action( 'load-tools_page_bbp-upgrade', 'bbp_admin_repair_handler' );
94
+ add_action( 'load-tools_page_bbp-reset', 'bbp_admin_reset_handler' );
95
+ add_action( 'bbp_admin_tool_box', 'bbp_admin_tools_box' );
96
 
97
  // Add sample permalink filter
98
  add_filter( 'post_type_link', 'bbp_filter_sample_permalink', 10, 4 );
99
 
100
+ // Add quick stats to dashboard glance elements
101
+ add_filter( 'dashboard_glance_items', 'bbp_filter_dashboard_glance_items', -99 );
102
+
103
+ // Maybe use icons for column headers
104
+ add_filter( 'bbp_admin_forums_column_headers', 'bbp_filter_column_headers' );
105
+ add_filter( 'bbp_admin_topics_column_headers', 'bbp_filter_column_headers' );
106
+ add_filter( 'bbp_admin_replies_column_headers', 'bbp_filter_column_headers' );
107
+
108
+ // Load the converter early (page and AJAX)
109
+ add_action( 'load-tools_page_bbp-converter', 'bbp_setup_converter', 2 );
110
+ add_action( 'wp_ajax_bbp_converter_process', 'bbp_setup_converter', 2 );
111
+
112
+ // Add New User
113
+ add_action( 'user_new_form', 'bbp_add_user_form_role_field', 10, 1 );
114
+
115
+ /**
116
+ * Setup bbPress admin
117
+ *
118
+ * @since 2.0.0 bbPress (r1000)
119
+ * @since 2.6.0 bbPress (r6598) Moved to actions.php
120
+ */
121
+ function bbp_admin() {
122
+ return bbp_setup_admin();
123
+ }
124
+
125
  /**
126
  * When a new site is created in a multisite installation, run the activation
127
  * routine on that site
128
  *
129
+ * @since 2.0.0 bbPress (r3283)
130
  *
131
  * @param int $blog_id
132
  * @param int $user_id
138
  function bbp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
139
 
140
  // Bail if plugin is not network activated
141
+ if ( ! is_plugin_active_for_network( bbpress()->basename ) ) {
142
  return;
143
+ }
144
 
145
  // Switch to the new blog
146
  switch_to_blog( $blog_id );
152
  restore_current_blog();
153
  }
154
 
155
+ /**
156
+ * Show icons in list-table column headers instead of strings
157
+ *
158
+ * @since 2.6.0 bbPress (r5833)
159
+ *
160
+ * @param array $columns Column headers fed into list-table objects
161
+ *
162
+ * @return array Possibly altered column headers
163
+ */
164
+ function bbp_filter_column_headers( $columns = array() ) {
165
+
166
+ // Do not filter column headers by default - maybe we'll turn it on later
167
+ if ( ! apply_filters( 'bbp_filter_column_headers', false ) ) {
168
+ return $columns;
169
+ }
170
+
171
+ /** Forums ****************************************************************/
172
+
173
+ // Forum topic count
174
+ if ( isset( $columns[ 'bbp_forum_topic_count' ] ) ) {
175
+ $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>';
176
+ }
177
+
178
+ // Forum reply count
179
+ if ( isset( $columns[ 'bbp_forum_reply_count' ] ) ) {
180
+ $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>';
181
+ }
182
+
183
+ /** Topics ****************************************************************/
184
+
185
+ // Topic forum
186
+ if ( isset( $columns[ 'bbp_topic_forum' ] ) ) {
187
+ $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>';
188
+ }
189
+
190
+ // Topic reply count
191
+ if ( isset( $columns[ 'bbp_topic_reply_count' ] ) ) {
192
+ $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>';
193
+ }
194
+
195
+ /** Replies ***************************************************************/
196
+
197
+ // Reply forum
198
+ if ( isset( $columns[ 'bbp_reply_forum' ] ) ) {
199
+ $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>';
200
+ }
201
+
202
+ // Reply topic
203
+ if ( isset( $columns[ 'bbp_reply_topic' ] ) ) {
204
+ $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>';
205
+ }
206
+
207
+ return $columns;
208
+ }
209
+
210
  /** Sub-Actions ***************************************************************/
211
 
212
  /**
213
  * Piggy back admin_init action
214
  *
215
+ * @since 2.1.0 bbPress (r3766)
 
216
  */
217
  function bbp_admin_init() {
218
  do_action( 'bbp_admin_init' );
221
  /**
222
  * Piggy back admin_menu action
223
  *
224
+ * @since 2.1.0 bbPress (r3766)
 
225
  */
226
  function bbp_admin_menu() {
227
  do_action( 'bbp_admin_menu' );
230
  /**
231
  * Piggy back admin_head action
232
  *
233
+ * @since 2.1.0 bbPress (r3766)
 
234
  */
235
  function bbp_admin_head() {
236
  do_action( 'bbp_admin_head' );
239
  /**
240
  * Piggy back admin_notices action
241
  *
242
+ * @since 2.1.0 bbPress (r3766)
 
243
  */
244
  function bbp_admin_notices() {
245
  do_action( 'bbp_admin_notices' );
248
  /**
249
  * Dedicated action to register bbPress importers
250
  *
251
+ * @since 2.1.0 bbPress (r3766)
 
252
  */
253
  function bbp_register_importers() {
254
  do_action( 'bbp_register_importers' );
257
  /**
258
  * Dedicated action to register admin styles
259
  *
260
+ * @since 2.1.0 bbPress (r3766)
 
261
  */
262
  function bbp_register_admin_style() {
263
  do_action( 'bbp_register_admin_style' );
266
  /**
267
  * Dedicated action to register admin settings
268
  *
269
+ * @since 2.1.0 bbPress (r3766)
 
270
  */
271
  function bbp_register_admin_settings() {
272
  do_action( 'bbp_register_admin_settings' );
273
  }
274
+
275
+ /**
276
+ * Dedicated action to output admin tools.php sections
277
+ *
278
+ * @since 2.6.0 bbPress (r6273)
279
+ */
280
+ function bbp_admin_tool_box() {
281
+ do_action( 'bbp_admin_tool_box' );
282
+ }
283
+
284
+ /**
285
+ * Dedicated action to hook into the current screen
286
+ *
287
+ * @since 2.6.0 bbPress (r6185)
288
+ *
289
+ * @param WP_Screen $current_screen
290
+ */
291
+ function bbp_current_screen( $current_screen = '' ) {
292
+ do_action( 'bbp_current_screen', $current_screen );
293
+ }
includes/admin/assets/css/admin-rtl.css ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ -webkit-transform-origin: top right;
14
+ transform-origin: top right;
15
+ -webkit-animation: swoop 16s infinite linear;
16
+ animation: swoop 16s infinite linear;
17
+ }
18
+
19
+ .bbp-bee {
20
+ font: 400 80px/1 dashicons !important;
21
+ color: #000;
22
+ position: absolute;
23
+ height: 60px;
24
+ width: 60px;
25
+ }
26
+
27
+ .bbp-hive {
28
+ font: 400 150px/1 dashicons !important;
29
+ color: #ccc;
30
+ position: absolute;
31
+ height: 150px;
32
+ width: 150px;
33
+ top: 0;
34
+ left: 0;
35
+ display: block;
36
+ }
37
+
38
+ .bbp-bee:before {
39
+ content: "\f451";
40
+ }
41
+
42
+ .bbp-hive:before {
43
+ content: "\f449";
44
+ }
45
+
46
+ .notice-bbpress {
47
+ border-right: 4px solid #78cd95;
48
+ padding-right: 36px;
49
+ background-color: rgb(235, 255, 235);
50
+ position: relative;
51
+ }
52
+
53
+ .notice-bbpress .bbpress-logo-icon {
54
+ position: absolute;
55
+ height: auto;
56
+ width: auto;
57
+ padding: 7px 9px;
58
+ top: 50%;
59
+ right: 0;
60
+ transform: translateY(-50%);
61
+ font: 400 24px/1 dashicons !important;
62
+ }
63
+
64
+ .notice-bbpress .bbpress-logo-icon:before {
65
+ content: "\f477";
66
+ color: #555;
67
+ }
68
+
69
+ @-webkit-keyframes buzz {
70
+
71
+ 0% {
72
+ left: -2px;
73
+ top: -1px;
74
+ }
75
+
76
+ 25% {
77
+ left: 1px;
78
+ top: 2px;
79
+ }
80
+
81
+ 50% {
82
+ left: -3px;
83
+ top: -1px;
84
+ }
85
+
86
+ 75% {
87
+ left: 2px;
88
+ top: 1px;
89
+ }
90
+
91
+ 0% {
92
+ left: -2px;
93
+ top: -1px;
94
+ }
95
+ }
96
+
97
+ @keyframes buzz {
98
+
99
+ 0% {
100
+ left: -2px;
101
+ top: -1px;
102
+ }
103
+
104
+ 25% {
105
+ left: 1px;
106
+ top: 2px;
107
+ }
108
+
109
+ 50% {
110
+ left: -3px;
111
+ top: -1px;
112
+ }
113
+
114
+ 75% {
115
+ left: 2px;
116
+ top: 1px;
117
+ }
118
+
119
+ 0% {
120
+ left: -2px;
121
+ top: -1px;
122
+ }
123
+ }
124
+
125
+ @-webkit-keyframes swoop {
126
+
127
+ 0% {
128
+ -webkit-transform: rotate(-95deg);
129
+ transform: rotate(-95deg);
130
+ }
131
+
132
+ 100% {
133
+ -webkit-transform: rotate(-455deg);
134
+ transform: rotate(-455deg);
135
+ }
136
+ }
137
+
138
+ @keyframes swoop {
139
+
140
+ 0% {
141
+ -webkit-transform: rotate(-95deg);
142
+ transform: rotate(-95deg);
143
+ }
144
+
145
+ 100% {
146
+ -webkit-transform: rotate(-455deg);
147
+ transform: rotate(-455deg);
148
+ }
149
+ }
150
+
151
+ .about-wrap .bbp-badge {
152
+ position: absolute;
153
+ left: 50px;
154
+ top: 50px;
155
+ height: 25px;
156
+ width: 25px;
157
+ }
158
+
159
+ body.rtl .about-wrap .bbp-badge {
160
+ left: auto;
161
+ right: 50px;
162
+ }
163
+
164
+ /* Dashicons */
165
+
166
+ th .bbp_forums_column:before,
167
+ #dashboard_right_now a.bbp-glance-forums:before,
168
+ #adminmenu #menu-posts-forum .wp-menu-image:before {
169
+ content: "\f449";
170
+ }
171
+
172
+ th .bbp_topics_column:before,
173
+ #dashboard_right_now a.bbp-glance-topics:before,
174
+ #adminmenu #menu-posts-topic .wp-menu-image:before {
175
+ content: "\f450";
176
+ }
177
+
178
+ th .bbp_replies_column:before,
179
+ #dashboard_right_now a.bbp-glance-replies:before,
180
+ #adminmenu #menu-posts-reply .wp-menu-image:before {
181
+ content: "\f451";
182
+ }
183
+
184
+ #dashboard_right_now a.bbp-glance-topic-tags:before {
185
+ content: "\f323";
186
+ }
187
+
188
+ #dashboard_right_now a.bbp-glance-users:before {
189
+ content: "\f110";
190
+ }
191
+
192
+ th .bbp_forums_column,
193
+ th .bbp_topics_column,
194
+ th .bbp_replies_column {
195
+ height: 16px;
196
+ width: 16px;
197
+ }
198
+
199
+ th .bbp_forums_column:before,
200
+ th .bbp_topics_column:before,
201
+ th .bbp_replies_column:before {
202
+ font: 400 20px/0.5 dashicons;
203
+ speak: none;
204
+ display: inline-block;
205
+ padding: 0;
206
+ top: 4px;
207
+ right: -4px;
208
+ position: relative;
209
+ vertical-align: top;
210
+ -webkit-font-smoothing: antialiased;
211
+ -moz-osx-font-smoothing: grayscale;
212
+ text-decoration: none !important;
213
+ color: #444;
214
+ }
215
+
216
+ /* Deprecated Dashboard Metabox */
217
+
218
+ #bbp-dashboard-right-now p.sub,
219
+ #bbp-dashboard-right-now .table,
220
+ #bbp-dashboard-right-now .versions {
221
+ margin: -12px;
222
+ }
223
+
224
+ #bbp-dashboard-right-now .inside {
225
+ font-size: 12px;
226
+ padding-top: 20px;
227
+ margin-bottom: 0;
228
+ }
229
+
230
+ #bbp-dashboard-right-now p.sub {
231
+ padding: 5px 0 15px;
232
+ color: #8f8f8f;
233
+ font-size: 14px;
234
+ position: absolute;
235
+ top: -17px;
236
+ right: 15px;
237
+ }
238
+
239
+ body.rtl #bbp-dashboard-right-now p.sub {
240
+ left: 15px;
241
+ right: 0;
242
+ }
243
+
244
+ #bbp-dashboard-right-now .table {
245
+ margin: 0;
246
+ padding: 0;
247
+ position: relative;
248
+ }
249
+
250
+ #bbp-dashboard-right-now .table_content {
251
+ float: right;
252
+ border-top: #ececec 1px solid;
253
+ width: 45%;
254
+ }
255
+
256
+ body.rtl #bbp-dashboard-right-now .table_content {
257
+ float: left;
258
+ }
259
+
260
+ #bbp-dashboard-right-now .table_discussion {
261
+ float: left;
262
+ border-top: #ececec 1px solid;
263
+ width: 45%;
264
+ }
265
+
266
+ body.rtl #bbp-dashboard-right-now .table_discussion {
267
+ float: right;
268
+ }
269
+
270
+ #bbp-dashboard-right-now table td {
271
+ padding: 3px 0;
272
+ white-space: nowrap;
273
+ }
274
+
275
+ #bbp-dashboard-right-now table tr.first td {
276
+ border-top: none;
277
+ }
278
+
279
+ #bbp-dashboard-right-now td.b {
280
+ padding-left: 6px;
281
+ text-align: left;
282
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
283
+ font-size: 14px;
284
+ width: 1%;
285
+ }
286
+
287
+ body.rtl #bbp-dashboard-right-now td.b {
288
+ padding-right: 6px;
289
+ padding-left: 0;
290
+ }
291
+
292
+ #bbp-dashboard-right-now td.b a {
293
+ font-size: 18px;
294
+ }
295
+
296
+ #bbp-dashboard-right-now td.b a:hover {
297
+ color: #d54e21;
298
+ }
299
+
300
+ #bbp-dashboard-right-now .t {
301
+ font-size: 12px;
302
+ padding-left: 12px;
303
+ padding-top: 6px;
304
+ color: #777;
305
+ }
306
+
307
+ body.rtl #bbp-dashboard-right-now .t {
308
+ padding-right: 12px;
309
+ padding-left: 0;
310
+ }
311
+
312
+ #bbp-dashboard-right-now .t a {
313
+ white-space: nowrap;
314
+ }
315
+
316
+ #bbp-dashboard-right-now .spam {
317
+ color: #f00;
318
+ }
319
+
320
+ #bbp-dashboard-right-now .waiting {
321
+ color: #e66f00;
322
+ }
323
+
324
+ #bbp-dashboard-right-now .approved {
325
+ color: #0f0;
326
+ }
327
+
328
+ #bbp-dashboard-right-now .versions {
329
+ padding: 6px 10px 12px;
330
+ clear: both;
331
+ }
332
+
333
+ #bbp-dashboard-right-now .versions .b {
334
+ font-weight: 700;
335
+ }
336
+
337
+ #bbp-dashboard-right-now a.button {
338
+ float: left;
339
+ clear: left;
340
+ position: relative;
341
+ top: -5px;
342
+ }
343
+
344
+ body.rtl #bbp-dashboard-right-now a.button {
345
+ float: right;
346
+ clear: right;
347
+ }
348
+
349
+ /* List Tables */
350
+
351
+ body.post-type-forum #minor-publishing,
352
+ body.post-type-forum #save-post {
353
+ display: none;
354
+ }
355
+
356
+ body.post-type-forum strong.label,
357
+ body.post-type-topic strong.label,
358
+ body.post-type-reply strong.label {
359
+ display: inline-block;
360
+ width: 60px;
361
+ }
362
+
363
+ .column-bbp_forum_topic_count,
364
+ .column-bbp_forum_reply_count,
365
+ .column-bbp_topic_reply_count,
366
+ .column-bbp_topic_voice_count {
367
+ width: 8% !important;
368
+ }
369
+
370
+ .column-author,
371
+ .column-bbp_forum_mods,
372
+ .column-bbp_reply_author,
373
+ .column-bbp_topic_author {
374
+ width: 10% !important;
375
+ }
376
+
377
+ .column-bbp_topic_forum,
378
+ .column-bbp_reply_forum,
379
+ .column-bbp_reply_topic {
380
+ width: 10% !important;
381
+ }
382
+
383
+ .column-bbp_forum_freshness,
384
+ .column-bbp_topic_freshness {
385
+ width: 10% !important;
386
+ }
387
+
388
+ .column-bbp_forum_created,
389
+ .column-bbp_topic_created,
390
+ .column-bbp_reply_created {
391
+ width: 15% !important;
392
+ }
393
+
394
+ .column-bbp_topic_reply_author,
395
+ .column-bbp_forum_topic_author {
396
+ width: 25% !important;
397
+ }
398
+
399
+ .column-bbp_topic_reply_author .avatar,
400
+ .column-bbp_forum_topic_author .avatar {
401
+ float: right;
402
+ margin-left: 10px;
403
+ }
404
+
405
+ #bbp_moderators {
406
+ width: 100%;
407
+ }
408
+
409
+ #bbp_forum_attributes hr {
410
+ border-style: solid;
411
+ border-width: 1px;
412
+ border-color: #ccc #ccc #fff #fff;
413
+ }
414
+
415
+ #the-list .status-closed {
416
+ background-color: #f5f5f5;
417
+ }
418
+
419
+ #the-list .status-closed:nth-child(odd) {
420
+ background-color: #f0f0f0;
421
+ }
422
+
423
+ #the-list .status-spam {
424
+ background-color: #fee;
425
+ }
426
+
427
+ #the-list .status-spam:nth-child(odd) {
428
+ background-color: #fdd;
429
+ }
430
+
431
+ #the-list .status-pending {
432
+ background-color: #fff2e8;
433
+ }
434
+
435
+ #the-list .status-pending:nth-child(odd) {
436
+ background-color: #fff7f1;
437
+ }
438
+
439
+ #the-list .status-closed td,
440
+ #the-list .status-spam td {
441
+ color: #999;
442
+ }
443
+
444
+ /* User Relationships */
445
+
446
+ #bbp_topic_engagements_metabox .avatar,
447
+ #bbp_topic_favorites_metabox .avatar,
448
+ #bbp_topic_subscriptions_metabox .avatar {
449
+ margin: 3px;
450
+ }
451
+
452
+ /* Converter */
453
+
454
+ #bbp-converter-monitor h2 {
455
+ position: relative;
456
+ }
457
+
458
+ #bbp-converter-monitor .inside {
459
+ margin-bottom: 0;
460
+ }
461
+
462
+ div.bbp-converter-log,
463
+ div.bbp-converter-warning {
464
+ padding: 5px 5px 5px 0;
465
+ }
466
+
467
+ div.bbp-converter-log.started {
468
+ height: 300px;
469
+ overflow: auto;
470
+ }
471
+
472
+ div.bbp-converter-log p {
473
+ margin: 0;
474
+ padding: 2px;
475
+ }
476
+
477
+ div.bbp-converter-log p:only-child {
478
+ float: none;
479
+ margin-bottom: 0;
480
+ }
481
+
482
+ div.bbp-converter-log div {
483
+ padding: 10px;
484
+ margin: 5px;
485
+ background: #f4f4f4;
486
+ border: 1px solid #ddd;
487
+ }
488
+
489
+ div.bbp-converter-log div code {
490
+ margin-top: 5px;
491
+ display: block;
492
+ }
493
+
494
+ div.bbp-converter-log .step {
495
+ text-align: left;
496
+ font-weight: 600;
497
+ }
498
+
499
+ div.bbp-converter-log .output {
500
+ margin: 0 5px;
501
+ }
502
+
503
+ div.bbp-converter-log .mini-step {
504
+ padding: 3px 5px;
505
+ vertical-align: middle;
506
+ font-size: 8px;
507
+ font-weight: 600;
508
+ border-radius: 6px;
509
+ background-color: #aaa;
510
+ color: #fff;
511
+ }
512
+
513
+ #bbp-converter-monitor .bbp-progress-bar {
514
+ position: absolute;
515
+ right: 0;
516
+ height: 1px;
517
+ width: 0;
518
+ background-color: #00b9eb;
519
+ transition-property: width;
520
+ transition-timing-function: ease-out;
521
+ transition-duration: 1s;
522
+ }
523
+
524
+ #bbp-converter-monitor #bbp-converter-step-percentage {
525
+ bottom: 1px;
526
+ }
527
+
528
+ #bbp-converter-monitor #bbp-converter-total-percentage {
529
+ bottom: 0;
530
+ }
531
+
532
+ #bbp-converter-stop {
533
+ display: none;
534
+ }
535
+
536
+ #bbp-converter-status {
537
+ font-weight: 400;
538
+ font-size: 12px;
539
+ color: #aaa;
540
+ display: block;
541
+ margin-top: 2px;
542
+ }
543
+
544
+ .bbp-converter-db-password-wrapper {
545
+ display: inline-block;
546
+ position: relative;
547
+ }
548
+
549
+ .bbp-converter-db-pass::-webkit-credentials-auto-fill-button {
550
+ display: none;
551
+ visibility: hidden;
552
+ pointer-events: none;
553
+ position: absolute;
554
+ left: 0;
555
+ }
556
+
557
+ button.bbp-db-pass-toggle {
558
+ border: none;
559
+ background: #fff;
560
+ position: absolute;
561
+ left: 3px;
562
+ top: 3px;
563
+ padding: 0;
564
+ margin: 0;
565
+ cursor: pointer;
566
+ color: #aaa;
567
+ height: 25px;
568
+ width: 25px;
569
+ font: 400 20px/1 dashicons !important;
570
+ }
571
+
572
+ button.bbp-db-pass-toggle:hover {
573
+ color: #888;
574
+ }
575
+
576
+ button.bbp-db-pass-toggle.text:after {
577
+ content: "\f530";
578
+ }
579
+
580
+ button.bbp-db-pass-toggle.password:after {
581
+ content: "\f177";
582
+ }
583
+
584
+ @media screen and ( max-width: 782px ) {
585
+
586
+ .bbp-converter-db-password-wrapper {
587
+ width: 100%;
588
+ }
589
+
590
+ button.bbp-db-pass-toggle {
591
+ height: 35px;
592
+ width: 35px;
593
+ font: 400 20px/1 dashicons !important;
594
+ }
595
+ }
596
+
597
+ /* Tools */
598
+
599
+ td.bbp-tool-title strong {
600
+ display: block;
601
+ }
includes/admin/assets/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{-webkit-transform-origin:top right;transform-origin:top right;-webkit-animation:swoop 16s infinite linear;animation:swoop 16s infinite linear}.bbp-bee{font:400 80px/1 dashicons!important;color:#000;position:absolute;height:60px;width:60px}.bbp-hive{font:400 150px/1 dashicons!important;color:#ccc;position:absolute;height:150px;width:150px;top:0;left:0;display:block}.bbp-bee:before{content:"\f451"}.bbp-hive:before{content:"\f449"}.notice-bbpress{border-right:4px solid #78cd95;padding-right:36px;background-color:#ebffeb;position:relative}.notice-bbpress .bbpress-logo-icon{position:absolute;height:auto;width:auto;padding:7px 9px;top:50%;right:0;transform:translateY(-50%);font:400 24px/1 dashicons!important}.notice-bbpress .bbpress-logo-icon:before{content:"\f477";color:#555}@-webkit-keyframes buzz{0%{left:-2px;top:-1px}25%{left:1px;top:2px}50%{left:-3px;top:-1px}75%{left:2px;top:1px}0%{left:-2px;top:-1px}}@keyframes buzz{0%{left:-2px;top:-1px}25%{left:1px;top:2px}50%{left:-3px;top:-1px}75%{left:2px;top:1px}0%{left:-2px;top:-1px}}@-webkit-keyframes swoop{0%{-webkit-transform:rotate(-95deg);transform:rotate(-95deg)}100%{-webkit-transform:rotate(-455deg);transform:rotate(-455deg)}}@keyframes swoop{0%{-webkit-transform:rotate(-95deg);transform:rotate(-95deg)}100%{-webkit-transform:rotate(-455deg);transform:rotate(-455deg)}}.about-wrap .bbp-badge{position:absolute;left:50px;top:50px;height:25px;width:25px}body.rtl .about-wrap .bbp-badge{left:auto;right:50px}#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"}#dashboard_right_now a.bbp-glance-users:before{content:"\f110"}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}body.post-type-forum #minor-publishing,body.post-type-forum #save-post{display:none}body.post-type-forum strong.label,body.post-type-reply strong.label,body.post-type-topic strong.label{display:inline-block;width:60px}.column-bbp_forum_reply_count,.column-bbp_forum_topic_count,.column-bbp_topic_reply_count,.column-bbp_topic_voice_count{width:8%!important}.column-author,.column-bbp_forum_mods,.column-bbp_reply_author,.column-bbp_topic_author{width:10%!important}.column-bbp_reply_forum,.column-bbp_reply_topic,.column-bbp_topic_forum{width:10%!important}.column-bbp_forum_freshness,.column-bbp_topic_freshness{width:10%!important}.column-bbp_forum_created,.column-bbp_reply_created,.column-bbp_topic_created{width:15%!important}.column-bbp_forum_topic_author,.column-bbp_topic_reply_author{width:25%!important}.column-bbp_forum_topic_author .avatar,.column-bbp_topic_reply_author .avatar{float:right;margin-left:10px}#bbp_moderators{width:100%}#bbp_forum_attributes hr{border-style:solid;border-width:1px;border-color:#ccc #ccc #fff #fff}#the-list .status-closed{background-color:#f5f5f5}#the-list .status-closed:nth-child(odd){background-color:#f0f0f0}#the-list .status-spam{background-color:#fee}#the-list .status-spam:nth-child(odd){background-color:#fdd}#the-list .status-pending{background-color:#fff2e8}#the-list .status-pending:nth-child(odd){background-color:#fff7f1}#the-list .status-closed td,#the-list .status-spam td{color:#999}#bbp_topic_engagements_metabox .avatar,#bbp_topic_favorites_metabox .avatar,#bbp_topic_subscriptions_metabox .avatar{margin:3px}#bbp-converter-monitor h2{position:relative}#bbp-converter-monitor .inside{margin-bottom:0}div.bbp-converter-log,div.bbp-converter-warning{padding:5px 5px 5px 0}div.bbp-converter-log.started{height:300px;overflow:auto}div.bbp-converter-log p{margin:0;padding:2px}div.bbp-converter-log p:only-child{float:none;margin-bottom:0}div.bbp-converter-log div{padding:10px;margin:5px;background:#f4f4f4;border:1px solid #ddd}div.bbp-converter-log div code{margin-top:5px;display:block}div.bbp-converter-log .step{text-align:left;font-weight:600}div.bbp-converter-log .output{margin:0 5px}div.bbp-converter-log .mini-step{padding:3px 5px;vertical-align:middle;font-size:8px;font-weight:600;border-radius:6px;background-color:#aaa;color:#fff}#bbp-converter-monitor .bbp-progress-bar{position:absolute;right:0;height:1px;width:0;background-color:#00b9eb;transition-property:width;transition-timing-function:ease-out;transition-duration:1s}#bbp-converter-monitor #bbp-converter-step-percentage{bottom:1px}#bbp-converter-monitor #bbp-converter-total-percentage{bottom:0}#bbp-converter-stop{display:none}#bbp-converter-status{font-weight:400;font-size:12px;color:#aaa;display:block;margin-top:2px}.bbp-converter-db-password-wrapper{display:inline-block;position:relative}.bbp-converter-db-pass::-webkit-credentials-auto-fill-button{display:none;visibility:hidden;pointer-events:none;position:absolute;left:0}button.bbp-db-pass-toggle{border:none;background:#fff;position:absolute;left:3px;top:3px;padding:0;margin:0;cursor:pointer;color:#aaa;height:25px;width:25px;font:400 20px/1 dashicons!important}button.bbp-db-pass-toggle:hover{color:#888}button.bbp-db-pass-toggle.text:after{content:"\f530"}button.bbp-db-pass-toggle.password:after{content:"\f177"}@media screen and (max-width:782px){.bbp-converter-db-password-wrapper{width:100%}button.bbp-db-pass-toggle{height:35px;width:35px;font:400 20px/1 dashicons!important}}td.bbp-tool-title strong{display:block}
includes/admin/assets/css/admin.css ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ -webkit-transform-origin: top left;
14
+ transform-origin: top left;
15
+ -webkit-animation: swoop 16s infinite linear;
16
+ animation: swoop 16s infinite linear;
17
+ }
18
+
19
+ .bbp-bee {
20
+ font: 400 80px/1 dashicons !important;
21
+ color: #000;
22
+ position: absolute;
23
+ height: 60px;
24
+ width: 60px;
25
+ }
26
+
27
+ .bbp-hive {
28
+ font: 400 150px/1 dashicons !important;
29
+ color: #ccc;
30
+ position: absolute;
31
+ height: 150px;
32
+ width: 150px;
33
+ top: 0;
34
+ right: 0;
35
+ display: block;
36
+ }
37
+
38
+ .bbp-bee:before {
39
+ content: "\f451";
40
+ }
41
+
42
+ .bbp-hive:before {
43
+ content: "\f449";
44
+ }
45
+
46
+ .notice-bbpress {
47
+ border-left: 4px solid #78cd95;
48
+ padding-left: 36px;
49
+ background-color: rgb(235, 255, 235);
50
+ position: relative;
51
+ }
52
+
53
+ .notice-bbpress .bbpress-logo-icon {
54
+ position: absolute;
55
+ height: auto;
56
+ width: auto;
57
+ padding: 7px 9px;
58
+ top: 50%;
59
+ left: 0;
60
+ transform: translateY(-50%);
61
+ font: 400 24px/1 dashicons !important;
62
+ }
63
+
64
+ .notice-bbpress .bbpress-logo-icon:before {
65
+ content: "\f477";
66
+ color: #555;
67
+ }
68
+
69
+ @-webkit-keyframes buzz {
70
+
71
+ 0% {
72
+ right: -2px;
73
+ top: -1px;
74
+ }
75
+
76
+ 25% {
77
+ right: 1px;
78
+ top: 2px;
79
+ }
80
+
81
+ 50% {
82
+ right: -3px;
83
+ top: -1px;
84
+ }
85
+
86
+ 75% {
87
+ right: 2px;
88
+ top: 1px;
89
+ }
90
+
91
+ 0% {
92
+ right: -2px;
93
+ top: -1px;
94
+ }
95
+ }
96
+
97
+ @keyframes buzz {
98
+
99
+ 0% {
100
+ right: -2px;
101
+ top: -1px;
102
+ }
103
+
104
+ 25% {
105
+ right: 1px;
106
+ top: 2px;
107
+ }
108
+
109
+ 50% {
110
+ right: -3px;
111
+ top: -1px;
112
+ }
113
+
114
+ 75% {
115
+ right: 2px;
116
+ top: 1px;
117
+ }
118
+
119
+ 0% {
120
+ right: -2px;
121
+ top: -1px;
122
+ }
123
+ }
124
+
125
+ @-webkit-keyframes swoop {
126
+
127
+ 0% {
128
+ -webkit-transform: rotate(95deg);
129
+ transform: rotate(95deg);
130
+ }
131
+
132
+ 100% {
133
+ -webkit-transform: rotate(455deg);
134
+ transform: rotate(455deg);
135
+ }
136
+ }
137
+
138
+ @keyframes swoop {
139
+
140
+ 0% {
141
+ -webkit-transform: rotate(95deg);
142
+ transform: rotate(95deg);
143
+ }
144
+
145
+ 100% {
146
+ -webkit-transform: rotate(455deg);
147
+ transform: rotate(455deg);
148
+ }
149
+ }
150
+
151
+ .about-wrap .bbp-badge {
152
+ position: absolute;
153
+ right: 50px;
154
+ top: 50px;
155
+ height: 25px;
156
+ width: 25px;
157
+ }
158
+
159
+ body.rtl .about-wrap .bbp-badge {
160
+ right: auto;
161
+ left: 50px;
162
+ }
163
+
164
+ /* Dashicons */
165
+
166
+ th .bbp_forums_column:before,
167
+ #dashboard_right_now a.bbp-glance-forums:before,
168
+ #adminmenu #menu-posts-forum .wp-menu-image:before {
169
+ content: "\f449";
170
+ }
171
+
172
+ th .bbp_topics_column:before,
173
+ #dashboard_right_now a.bbp-glance-topics:before,
174
+ #adminmenu #menu-posts-topic .wp-menu-image:before {
175
+ content: "\f450";
176
+ }
177
+
178
+ th .bbp_replies_column:before,
179
+ #dashboard_right_now a.bbp-glance-replies:before,
180
+ #adminmenu #menu-posts-reply .wp-menu-image:before {
181
+ content: "\f451";
182
+ }
183
+
184
+ #dashboard_right_now a.bbp-glance-topic-tags:before {
185
+ content: "\f323";
186
+ }
187
+
188
+ #dashboard_right_now a.bbp-glance-users:before {
189
+ content: "\f110";
190
+ }
191
+
192
+ th .bbp_forums_column,
193
+ th .bbp_topics_column,
194
+ th .bbp_replies_column {
195
+ height: 16px;
196
+ width: 16px;
197
+ }
198
+
199
+ th .bbp_forums_column:before,
200
+ th .bbp_topics_column:before,
201
+ th .bbp_replies_column:before {
202
+ font: 400 20px/0.5 dashicons;
203
+ speak: none;
204
+ display: inline-block;
205
+ padding: 0;
206
+ top: 4px;
207
+ left: -4px;
208
+ position: relative;
209
+ vertical-align: top;
210
+ -webkit-font-smoothing: antialiased;
211
+ -moz-osx-font-smoothing: grayscale;
212
+ text-decoration: none !important;
213
+ color: #444;
214
+ }
215
+
216
+ /* Deprecated Dashboard Metabox */
217
+
218
+ #bbp-dashboard-right-now p.sub,
219
+ #bbp-dashboard-right-now .table,
220
+ #bbp-dashboard-right-now .versions {
221
+ margin: -12px;
222
+ }
223
+
224
+ #bbp-dashboard-right-now .inside {
225
+ font-size: 12px;
226
+ padding-top: 20px;
227
+ margin-bottom: 0;
228
+ }
229
+
230
+ #bbp-dashboard-right-now p.sub {
231
+ padding: 5px 0 15px;
232
+ color: #8f8f8f;
233
+ font-size: 14px;
234
+ position: absolute;
235
+ top: -17px;
236
+ left: 15px;
237
+ }
238
+
239
+ body.rtl #bbp-dashboard-right-now p.sub {
240
+ right: 15px;
241
+ left: 0;
242
+ }
243
+
244
+ #bbp-dashboard-right-now .table {
245
+ margin: 0;
246
+ padding: 0;
247
+ position: relative;
248
+ }
249
+
250
+ #bbp-dashboard-right-now .table_content {
251
+ float: left;
252
+ border-top: #ececec 1px solid;
253
+ width: 45%;
254
+ }
255
+
256
+ body.rtl #bbp-dashboard-right-now .table_content {
257
+ float: right;
258
+ }
259
+
260
+ #bbp-dashboard-right-now .table_discussion {
261
+ float: right;
262
+ border-top: #ececec 1px solid;
263
+ width: 45%;
264
+ }
265
+
266
+ body.rtl #bbp-dashboard-right-now .table_discussion {
267
+ float: left;
268
+ }
269
+
270
+ #bbp-dashboard-right-now table td {
271
+ padding: 3px 0;
272
+ white-space: nowrap;
273
+ }
274
+
275
+ #bbp-dashboard-right-now table tr.first td {
276
+ border-top: none;
277
+ }
278
+
279
+ #bbp-dashboard-right-now td.b {
280
+ padding-right: 6px;
281
+ text-align: right;
282
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
283
+ font-size: 14px;
284
+ width: 1%;
285
+ }
286
+
287
+ body.rtl #bbp-dashboard-right-now td.b {
288
+ padding-left: 6px;
289
+ padding-right: 0;
290
+ }
291
+
292
+ #bbp-dashboard-right-now td.b a {
293
+ font-size: 18px;
294
+ }
295
+
296
+ #bbp-dashboard-right-now td.b a:hover {
297
+ color: #d54e21;
298
+ }
299
+
300
+ #bbp-dashboard-right-now .t {
301
+ font-size: 12px;
302
+ padding-right: 12px;
303
+ padding-top: 6px;
304
+ color: #777;
305
+ }
306
+
307
+ body.rtl #bbp-dashboard-right-now .t {
308
+ padding-left: 12px;
309
+ padding-right: 0;
310
+ }
311
+
312
+ #bbp-dashboard-right-now .t a {
313
+ white-space: nowrap;
314
+ }
315
+
316
+ #bbp-dashboard-right-now .spam {
317
+ color: #f00;
318
+ }
319
+
320
+ #bbp-dashboard-right-now .waiting {
321
+ color: #e66f00;
322
+ }
323
+
324
+ #bbp-dashboard-right-now .approved {
325
+ color: #0f0;
326
+ }
327
+
328
+ #bbp-dashboard-right-now .versions {
329
+ padding: 6px 10px 12px;
330
+ clear: both;
331
+ }
332
+
333
+ #bbp-dashboard-right-now .versions .b {
334
+ font-weight: 700;
335
+ }
336
+
337
+ #bbp-dashboard-right-now a.button {
338
+ float: right;
339
+ clear: right;
340
+ position: relative;
341
+ top: -5px;
342
+ }
343
+
344
+ body.rtl #bbp-dashboard-right-now a.button {
345
+ float: left;
346
+ clear: left;
347
+ }
348
+
349
+ /* List Tables */
350
+
351
+ body.post-type-forum #minor-publishing,
352
+ body.post-type-forum #save-post {
353
+ display: none;
354
+ }
355
+
356
+ body.post-type-forum strong.label,
357
+ body.post-type-topic strong.label,
358
+ body.post-type-reply strong.label {
359
+ display: inline-block;
360
+ width: 60px;
361
+ }
362
+
363
+ .column-bbp_forum_topic_count,
364
+ .column-bbp_forum_reply_count,
365
+ .column-bbp_topic_reply_count,
366
+ .column-bbp_topic_voice_count {
367
+ width: 8% !important;
368
+ }
369
+
370
+ .column-author,
371
+ .column-bbp_forum_mods,
372
+ .column-bbp_reply_author,
373
+ .column-bbp_topic_author {
374
+ width: 10% !important;
375
+ }
376
+
377
+ .column-bbp_topic_forum,
378
+ .column-bbp_reply_forum,
379
+ .column-bbp_reply_topic {
380
+ width: 10% !important;
381
+ }
382
+
383
+ .column-bbp_forum_freshness,
384
+ .column-bbp_topic_freshness {
385
+ width: 10% !important;
386
+ }
387
+
388
+ .column-bbp_forum_created,
389
+ .column-bbp_topic_created,
390
+ .column-bbp_reply_created {
391
+ width: 15% !important;
392
+ }
393
+
394
+ .column-bbp_topic_reply_author,
395
+ .column-bbp_forum_topic_author {
396
+ width: 25% !important;
397
+ }
398
+
399
+ .column-bbp_topic_reply_author .avatar,
400
+ .column-bbp_forum_topic_author .avatar {
401
+ float: left;
402
+ margin-right: 10px;
403
+ }
404
+
405
+ #bbp_moderators {
406
+ width: 100%;
407
+ }
408
+
409
+ #bbp_forum_attributes hr {
410
+ border-style: solid;
411
+ border-width: 1px;
412
+ border-color: #ccc #fff #fff #ccc;
413
+ }
414
+
415
+ #the-list .status-closed {
416
+ background-color: #f5f5f5;
417
+ }
418
+
419
+ #the-list .status-closed:nth-child(odd) {
420
+ background-color: #f0f0f0;
421
+ }
422
+
423
+ #the-list .status-spam {
424
+ background-color: #fee;
425
+ }
426
+
427
+ #the-list .status-spam:nth-child(odd) {
428
+ background-color: #fdd;
429
+ }
430
+
431
+ #the-list .status-pending {
432
+ background-color: #fff2e8;
433
+ }
434
+
435
+ #the-list .status-pending:nth-child(odd) {
436
+ background-color: #fff7f1;
437
+ }
438
+
439
+ #the-list .status-closed td,
440
+ #the-list .status-spam td {
441
+ color: #999;
442
+ }
443
+
444
+ /* User Relationships */
445
+
446
+ #bbp_topic_engagements_metabox .avatar,
447
+ #bbp_topic_favorites_metabox .avatar,
448
+ #bbp_topic_subscriptions_metabox .avatar {
449
+ margin: 3px;
450
+ }
451
+
452
+ /* Converter */
453
+
454
+ #bbp-converter-monitor h2 {
455
+ position: relative;
456
+ }
457
+
458
+ #bbp-converter-monitor .inside {
459
+ margin-bottom: 0;
460
+ }
461
+
462
+ div.bbp-converter-log,
463
+ div.bbp-converter-warning {
464
+ padding: 5px 0 5px 5px;
465
+ }
466
+
467
+ div.bbp-converter-log.started {
468
+ height: 300px;
469
+ overflow: auto;
470
+ }
471
+
472
+ div.bbp-converter-log p {
473
+ margin: 0;
474
+ padding: 2px;
475
+ }
476
+
477
+ div.bbp-converter-log p:only-child {
478
+ float: none;
479
+ margin-bottom: 0;
480
+ }
481
+
482
+ div.bbp-converter-log div {
483
+ padding: 10px;
484
+ margin: 5px;
485
+ background: #f4f4f4;
486
+ border: 1px solid #ddd;
487
+ }
488
+
489
+ div.bbp-converter-log div code {
490
+ margin-top: 5px;
491
+ display: block;
492
+ }
493
+
494
+ div.bbp-converter-log .step {
495
+ text-align: right;
496
+ font-weight: 600;
497
+ }
498
+
499
+ div.bbp-converter-log .output {
500
+ margin: 0 5px;
501
+ }
502
+
503
+ div.bbp-converter-log .mini-step {
504
+ padding: 3px 5px;
505
+ vertical-align: middle;
506
+ font-size: 8px;
507
+ font-weight: 600;
508
+ border-radius: 6px;
509
+ background-color: #aaa;
510
+ color: #fff;
511
+ }
512
+
513
+ #bbp-converter-monitor .bbp-progress-bar {
514
+ position: absolute;
515
+ left: 0;
516
+ height: 1px;
517
+ width: 0;
518
+ background-color: #00b9eb;
519
+ transition-property: width;
520
+ transition-timing-function: ease-out;
521
+ transition-duration: 1s;
522
+ }
523
+
524
+ #bbp-converter-monitor #bbp-converter-step-percentage {
525
+ bottom: 1px;
526
+ }
527
+
528
+ #bbp-converter-monitor #bbp-converter-total-percentage {
529
+ bottom: 0;
530
+ }
531
+
532
+ #bbp-converter-stop {
533
+ display: none;
534
+ }
535
+
536
+ #bbp-converter-status {
537
+ font-weight: 400;
538
+ font-size: 12px;
539
+ color: #aaa;
540
+ display: block;
541
+ margin-top: 2px;
542
+ }
543
+
544
+ .bbp-converter-db-password-wrapper {
545
+ display: inline-block;
546
+ position: relative;
547
+ }
548
+
549
+ .bbp-converter-db-pass::-webkit-credentials-auto-fill-button {
550
+ display: none;
551
+ visibility: hidden;
552
+ pointer-events: none;
553
+ position: absolute;
554
+ right: 0;
555
+ }
556
+
557
+ button.bbp-db-pass-toggle {
558
+ border: none;
559
+ background: #fff;
560
+ position: absolute;
561
+ right: 3px;
562
+ top: 3px;
563
+ padding: 0;
564
+ margin: 0;
565
+ cursor: pointer;
566
+ color: #aaa;
567
+ height: 25px;
568
+ width: 25px;
569
+ font: 400 20px/1 dashicons !important;
570
+ }
571
+
572
+ button.bbp-db-pass-toggle:hover {
573
+ color: #888;
574
+ }
575
+
576
+ button.bbp-db-pass-toggle.text:after {
577
+ content: "\f530";
578
+ }
579
+
580
+ button.bbp-db-pass-toggle.password:after {
581
+ content: "\f177";
582
+ }
583
+
584
+ @media screen and ( max-width: 782px ) {
585
+
586
+ .bbp-converter-db-password-wrapper {
587
+ width: 100%;
588
+ }
589
+
590
+ button.bbp-db-pass-toggle {
591
+ height: 35px;
592
+ width: 35px;
593
+ font: 400 20px/1 dashicons !important;
594
+ }
595
+ }
596
+
597
+ /* Tools */
598
+
599
+ td.bbp-tool-title strong {
600
+ display: block;
601
+ }
includes/admin/assets/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{-webkit-transform-origin:top left;transform-origin:top left;-webkit-animation:swoop 16s infinite linear;animation:swoop 16s infinite linear}.bbp-bee{font:400 80px/1 dashicons!important;color:#000;position:absolute;height:60px;width:60px}.bbp-hive{font:400 150px/1 dashicons!important;color:#ccc;position:absolute;height:150px;width:150px;top:0;right:0;display:block}.bbp-bee:before{content:"\f451"}.bbp-hive:before{content:"\f449"}.notice-bbpress{border-left:4px solid #78cd95;padding-left:36px;background-color:#ebffeb;position:relative}.notice-bbpress .bbpress-logo-icon{position:absolute;height:auto;width:auto;padding:7px 9px;top:50%;left:0;transform:translateY(-50%);font:400 24px/1 dashicons!important}.notice-bbpress .bbpress-logo-icon:before{content:"\f477";color:#555}@-webkit-keyframes buzz{0%{right:-2px;top:-1px}25%{right:1px;top:2px}50%{right:-3px;top:-1px}75%{right:2px;top:1px}0%{right:-2px;top:-1px}}@keyframes buzz{0%{right:-2px;top:-1px}25%{right:1px;top:2px}50%{right:-3px;top:-1px}75%{right:2px;top:1px}0%{right:-2px;top:-1px}}@-webkit-keyframes swoop{0%{-webkit-transform:rotate(95deg);transform:rotate(95deg)}100%{-webkit-transform:rotate(455deg);transform:rotate(455deg)}}@keyframes swoop{0%{-webkit-transform:rotate(95deg);transform:rotate(95deg)}100%{-webkit-transform:rotate(455deg);transform:rotate(455deg)}}.about-wrap .bbp-badge{position:absolute;right:50px;top:50px;height:25px;width:25px}body.rtl .about-wrap .bbp-badge{right:auto;left:50px}#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"}#dashboard_right_now a.bbp-glance-users:before{content:"\f110"}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}body.post-type-forum #minor-publishing,body.post-type-forum #save-post{display:none}body.post-type-forum strong.label,body.post-type-reply strong.label,body.post-type-topic strong.label{display:inline-block;width:60px}.column-bbp_forum_reply_count,.column-bbp_forum_topic_count,.column-bbp_topic_reply_count,.column-bbp_topic_voice_count{width:8%!important}.column-author,.column-bbp_forum_mods,.column-bbp_reply_author,.column-bbp_topic_author{width:10%!important}.column-bbp_reply_forum,.column-bbp_reply_topic,.column-bbp_topic_forum{width:10%!important}.column-bbp_forum_freshness,.column-bbp_topic_freshness{width:10%!important}.column-bbp_forum_created,.column-bbp_reply_created,.column-bbp_topic_created{width:15%!important}.column-bbp_forum_topic_author,.column-bbp_topic_reply_author{width:25%!important}.column-bbp_forum_topic_author .avatar,.column-bbp_topic_reply_author .avatar{float:left;margin-right:10px}#bbp_moderators{width:100%}#bbp_forum_attributes hr{border-style:solid;border-width:1px;border-color:#ccc #fff #fff #ccc}#the-list .status-closed{background-color:#f5f5f5}#the-list .status-closed:nth-child(odd){background-color:#f0f0f0}#the-list .status-spam{background-color:#fee}#the-list .status-spam:nth-child(odd){background-color:#fdd}#the-list .status-pending{background-color:#fff2e8}#the-list .status-pending:nth-child(odd){background-color:#fff7f1}#the-list .status-closed td,#the-list .status-spam td{color:#999}#bbp_topic_engagements_metabox .avatar,#bbp_topic_favorites_metabox .avatar,#bbp_topic_subscriptions_metabox .avatar{margin:3px}#bbp-converter-monitor h2{position:relative}#bbp-converter-monitor .inside{margin-bottom:0}div.bbp-converter-log,div.bbp-converter-warning{padding:5px 0 5px 5px}div.bbp-converter-log.started{height:300px;overflow:auto}div.bbp-converter-log p{margin:0;padding:2px}div.bbp-converter-log p:only-child{float:none;margin-bottom:0}div.bbp-converter-log div{padding:10px;margin:5px;background:#f4f4f4;border:1px solid #ddd}div.bbp-converter-log div code{margin-top:5px;display:block}div.bbp-converter-log .step{text-align:right;font-weight:600}div.bbp-converter-log .output{margin:0 5px}div.bbp-converter-log .mini-step{padding:3px 5px;vertical-align:middle;font-size:8px;font-weight:600;border-radius:6px;background-color:#aaa;color:#fff}#bbp-converter-monitor .bbp-progress-bar{position:absolute;left:0;height:1px;width:0;background-color:#00b9eb;transition-property:width;transition-timing-function:ease-out;transition-duration:1s}#bbp-converter-monitor #bbp-converter-step-percentage{bottom:1px}#bbp-converter-monitor #bbp-converter-total-percentage{bottom:0}#bbp-converter-stop{display:none}#bbp-converter-status{font-weight:400;font-size:12px;color:#aaa;display:block;margin-top:2px}.bbp-converter-db-password-wrapper{display:inline-block;position:relative}.bbp-converter-db-pass::-webkit-credentials-auto-fill-button{display:none;visibility:hidden;pointer-events:none;position:absolute;right:0}button.bbp-db-pass-toggle{border:none;background:#fff;position:absolute;right:3px;top:3px;padding:0;margin:0;cursor:pointer;color:#aaa;height:25px;width:25px;font:400 20px/1 dashicons!important}button.bbp-db-pass-toggle:hover{color:#888}button.bbp-db-pass-toggle.text:after{content:"\f530"}button.bbp-db-pass-toggle.password:after{content:"\f177"}@media screen and (max-width:782px){.bbp-converter-db-password-wrapper{width:100%}button.bbp-db-pass-toggle{height:35px;width:35px;font:400 20px/1 dashicons!important}}td.bbp-tool-title strong{display:block}
includes/admin/assets/js/badge.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function () {
2
+ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
3
+
4
+ var field = document.getElementById( 'bbp-badge' ),
5
+ bee = document.getElementById( 'bbp-bee' ),
6
+
7
+ max_x = field.clientWidth - bee.offsetWidth,
8
+ max_y = field.clientHeight - bee.offsetHeight,
9
+ angle = 95,
10
+ offset = 95,
11
+
12
+ duration = 4,
13
+ canvas = 50,
14
+ start = null,
15
+ variance = 1;
16
+
17
+ function step( timestamp ) {
18
+ var progress, x, y;
19
+
20
+ if ( start === null ) {
21
+ start = timestamp;
22
+ variance = 1;
23
+ angle = 95;
24
+ }
25
+
26
+ progress = ( timestamp - start ) / duration / 1000;
27
+ angle = ( 360 * progress ) + offset;
28
+
29
+ x = variance * Math.sin( progress * 2 * Math.PI );
30
+ y = Math.cos( progress * 2 * Math.PI );
31
+
32
+ bee.style.left = max_x / 2 + ( canvas * x ) + 'px';
33
+ bee.style.bottom = max_y / 2 + ( canvas * y ) + 'px';
34
+ bee.style.transform = 'rotate(' + angle + 'deg)';
35
+ bee.style.webkitTransform = 'rotate(' + angle + 'deg)';
36
+
37
+ // Reset
38
+ if ( progress >= 1 ) {
39
+ start = null;
40
+ }
41
+
42
+ requestAnimationFrame( step );
43
+ }
44
+
45
+ requestAnimationFrame( step );
46
+ })();
includes/admin/assets/js/badge.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! This file is automatically generated. */
2
+
3
+ !function(){function e(t){var u,w,b;null===l&&(l=t,d=1,a=95),a=360*(u=(t-l)/r/1e3)+m,w=d*Math.sin(2*u*Math.PI),b=Math.cos(2*u*Math.PI),n.style.left=i/2+s*w+"px",n.style.bottom=o/2+s*b+"px",n.style.transform="rotate("+a+"deg)",n.style.webkitTransform="rotate("+a+"deg)",u>=1&&(l=null),requestAnimationFrame(e)}window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var t=document.getElementById("bbp-badge"),n=document.getElementById("bbp-bee"),i=t.clientWidth-n.offsetWidth,o=t.clientHeight-n.offsetHeight,a=95,m=95,r=4,s=50,l=null,d=1;requestAnimationFrame(e)}();
includes/admin/{js → assets/js}/common.js RENAMED
File without changes
includes/admin/assets/js/common.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! This file is automatically generated. */
2
+
3
+ jQuery(document).ready(function(){var a=jQuery("#bbp_author_id");a.suggest(a.data("ajax-url"),{onSelect:function(){var u=this.value;a.val(u.substr(0,u.indexOf(" ")))}})});
includes/admin/assets/js/converter.js ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*jshint sub:true*/
2
+ /* global document, jQuery, ajaxurl, BBP_Converter */
3
+ jQuery( document ).ready( function ( $ ) {
4
+ 'use strict';
5
+
6
+ // Variables
7
+ var message = $( '#bbp-converter-message' ),
8
+ stop = $( '#bbp-converter-stop' ),
9
+ start = $( '#bbp-converter-start' ),
10
+ restart = $( '#_bbp_converter_restart' ),
11
+ status = $( '#bbp-converter-status' ),
12
+ settings = $( '#bbp-converter-settings' ),
13
+ password = $( '#_bbp_converter_db_pass' ),
14
+ toggle = $( '.bbp-db-pass-toggle' ),
15
+ step_p = $( '#bbp-converter-step-percentage' ),
16
+ total_p = $( '#bbp-converter-total-percentage' );
17
+
18
+ /**
19
+ * Show/hide db password button toggle
20
+ *
21
+ * @since 2.6.0 bbPress (r6676)
22
+ *
23
+ * @param {element} e
24
+ */
25
+ toggle.on( 'click', function( e ) {
26
+ var type = ( password.attr( 'type' ) === 'password' ) ? 'text' : 'password';
27
+
28
+ password.attr( 'type', type );
29
+
30
+ toggle
31
+ .toggleClass( 'password' )
32
+ .toggleClass( 'text' );
33
+
34
+ e.preventDefault();
35
+ });
36
+
37
+ /**
38
+ * Start button click
39
+ *
40
+ * @since 2.6.0 bbPress (r6470)
41
+ *
42
+ * @param {element} e
43
+ */
44
+ start.on( 'click', function( e ) {
45
+ bbp_converter_user_start();
46
+ e.preventDefault();
47
+ } );
48
+
49
+ /**
50
+ * Stop button click
51
+ *
52
+ * @since 2.6.0 bbPress (r6470)
53
+ *
54
+ * @param {element} e
55
+ */
56
+ $( stop ).on( 'click', function( e ) {
57
+ bbp_converter_user_stop();
58
+ e.preventDefault();
59
+ } );
60
+
61
+ /**
62
+ * Start the converter
63
+ *
64
+ * @since 2.6.0 bbPress (r6470)
65
+ *
66
+ * @returns {void}
67
+ */
68
+ function bbp_converter_user_start() {
69
+ bbp_converter_start();
70
+ }
71
+
72
+ /**
73
+ * Stop the converter
74
+ *
75
+ * @since 2.6.0 bbPress (r6470)
76
+ *
77
+ * @returns {void}
78
+ */
79
+ function bbp_converter_user_stop() {
80
+ bbp_converter_stop(
81
+ BBP_Converter.strings.button_continue,
82
+ BBP_Converter.strings.import_stopped_user
83
+ );
84
+ }
85
+
86
+ /**
87
+ * Return values of converter settings
88
+ *
89
+ * @since 2.6.0 bbPress (r6470)
90
+ *
91
+ * @returns {converterL#2.bbp_converter_settings.values}
92
+ */
93
+ function bbp_converter_settings() {
94
+ var values = {};
95
+
96
+ $.each( settings.serializeArray(), function( i, field ) {
97
+ values[ field.name ] = field.value;
98
+ } );
99
+
100
+ if ( values['_bbp_converter_restart'] ) {
101
+ restart.removeAttr( 'checked' );
102
+ }
103
+
104
+ if ( values['_bbp_converter_delay_time'] ) {
105
+ BBP_Converter.state.delay = parseInt( values['_bbp_converter_delay_time'], 10 ) * 1000;
106
+ }
107
+
108
+ values['action'] = 'bbp_converter_process';
109
+ values['_ajax_nonce'] = BBP_Converter.ajax_nonce;
110
+
111
+ return values;
112
+ }
113
+
114
+ /**
115
+ * Run the converter step
116
+ *
117
+ * @since 2.6.0 bbPress (r6470)
118
+ *
119
+ * @returns {void}
120
+ */
121
+ function bbp_converter_post() {
122
+ $.post( ajaxurl, bbp_converter_settings(), function( response ) {
123
+
124
+ // Parse the json response
125
+ try {
126
+ var data = response.data;
127
+
128
+ // Success
129
+ if ( true === response.success ) {
130
+ bbp_converter_step( data );
131
+
132
+ // Failure
133
+ } else {
134
+ bbp_converter_stop();
135
+ }
136
+
137
+ } catch( e ) {
138
+ bbp_converter_stop();
139
+ }
140
+ }, 'json' );
141
+ }
142
+
143
+ /**
144
+ * Process the next step
145
+ *
146
+ * @since 2.6.0 bbPress (r6600)
147
+ *
148
+ * @param {object} data
149
+ * @returns {void}
150
+ */
151
+ function bbp_converter_step( data ) {
152
+
153
+ // Bail if not running
154
+ if ( ! BBP_Converter.state.running ) {
155
+ return;
156
+ }
157
+
158
+ // Do the step
159
+ bbp_converter_log( data.progress );
160
+ bbp_converter_percentages( data.step_percent, data.total_percent );
161
+ bbp_converter_status( data );
162
+ bbp_converter_wait();
163
+
164
+ // Done
165
+ if ( data.current_step === data.final_step ) {
166
+ bbp_converter_stop(
167
+ BBP_Converter.strings.button_start,
168
+ BBP_Converter.strings.import_complete
169
+ );
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Wait to do the next AJAX request
175
+ *
176
+ * @since 2.6.0 bbPress (r6600)
177
+ *
178
+ * @returns {void}
179
+ */
180
+ function bbp_converter_wait() {
181
+ clearTimeout( BBP_Converter.state.running );
182
+
183
+ // Bail if not running
184
+ if ( ! BBP_Converter.state.running ) {
185
+ return;
186
+ }
187
+
188
+ // Wait, then POST
189
+ BBP_Converter.state.running = setTimeout( function() {
190
+ bbp_converter_post();
191
+ }, parseInt( BBP_Converter.state.delay, 10 ) );
192
+ }
193
+
194
+ /**
195
+ * Start the converter and set the various flags
196
+ *
197
+ * @since 2.6.0 bbPress (r6600)
198
+ *
199
+ * @returns {void}
200
+ */
201
+ function bbp_converter_start() {
202
+ clearTimeout( BBP_Converter.state.running );
203
+ clearInterval( BBP_Converter.state.status );
204
+
205
+ BBP_Converter.state.running = true;
206
+
207
+ var log = BBP_Converter.strings.start_continue;
208
+ if ( false === BBP_Converter.state.started ) {
209
+ log = BBP_Converter.strings.start_start;
210
+ BBP_Converter.state.started = true;
211
+ }
212
+
213
+ bbp_converter_update(
214
+ BBP_Converter.strings.button_continue,
215
+ log,
216
+ BBP_Converter.strings.status_starting
217
+ );
218
+
219
+ message.addClass( 'started' );
220
+ start.hide();
221
+ stop.show();
222
+
223
+ bbp_converter_post();
224
+ }
225
+
226
+ /**
227
+ * Stop the converter, and update the UI
228
+ *
229
+ * @since 2.6.0 bbPress (r6470)
230
+ *
231
+ * @param {string} button New text for button
232
+ * @param {string} log New text to add to import monitor
233
+ *
234
+ * @returns {void}
235
+ */
236
+ function bbp_converter_stop( button, log ) {
237
+ clearTimeout( BBP_Converter.state.running );
238
+ clearInterval( BBP_Converter.state.status );
239
+
240
+ BBP_Converter.state.running = false;
241
+ BBP_Converter.state.status = false;
242
+
243
+ if ( ! button ) {
244
+ button = BBP_Converter.strings.button_continue;
245
+ }
246
+
247
+ if ( ! log ) {
248
+ log = BBP_Converter.strings.status_stopped;
249
+ }
250
+
251
+ bbp_converter_update(
252
+ button,
253
+ log,
254
+ BBP_Converter.strings.status_stopped
255
+ );
256
+
257
+ start.show();
258
+ stop.hide();
259
+ }
260
+
261
+ /**
262
+ * Update the various screen texts
263
+ *
264
+ * @since 2.6.0 bbPress (r6600)
265
+ *
266
+ * @param {string} b_text
267
+ * @param {string} p_text
268
+ * @param {string} s_text
269
+ *
270
+ * @returns {void}
271
+ */
272
+ function bbp_converter_update( b_text, p_text, s_text ) {
273
+ start.val( b_text );
274
+ bbp_converter_log( p_text );
275
+ status.text( s_text );
276
+ }
277
+
278
+ /**
279
+ * Update the status
280
+ *
281
+ * @since 2.6.0 bbPress (r6513)
282
+ *
283
+ * @param {object} data
284
+ *
285
+ * @returns {void}
286
+ */
287
+ function bbp_converter_status( data ) {
288
+ var remaining = parseInt( BBP_Converter.state.delay, 10 ) / 1000;
289
+
290
+ status.text( BBP_Converter.strings.status_counting.replace( '%s', remaining ) );
291
+ clearInterval( BBP_Converter.state.status );
292
+
293
+ BBP_Converter.state.status = setInterval( function() {
294
+ remaining--;
295
+ status.text( BBP_Converter.strings.status_counting.replace( '%s', remaining ) );
296
+
297
+ if ( remaining <= 0 ) {
298
+ clearInterval( BBP_Converter.state.status );
299
+
300
+ if ( parseInt( data.current_step, 10 ) < parseInt( data.final_step, 10 ) ) {
301
+ status.text( BBP_Converter.strings.status_up_next.replace( '%s', data.current_step ) );
302
+ } else {
303
+ status.text( BBP_Converter.strings.status_complete );
304
+ }
305
+ }
306
+ }, 1000 );
307
+ }
308
+
309
+ /**
310
+ * Prepend some text to the import monitor
311
+ *
312
+ * @since 2.6.0 bbPress (r6470)
313
+ *
314
+ * @param {string} text Text to prepend to the import monitor
315
+ *
316
+ * @returns {void}
317
+ */
318
+ function bbp_converter_log( text ) {
319
+ text = '<p>' + text + '</p>';
320
+
321
+ message.prepend( text );
322
+ }
323
+
324
+ /**
325
+ * Prepend some text to the import monitor
326
+ *
327
+ * @since 2.6.0 bbPress (r6470)
328
+ *
329
+ * @returns {void}
330
+ */
331
+ function bbp_converter_percentages( step_percent, total_percent ) {
332
+ step_p.width( step_percent + '%' );
333
+ total_p.width( total_percent + '%' );
334
+ }
335
+ } );
includes/admin/assets/js/converter.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! This file is automatically generated. */
2
+
3
+ jQuery(document).ready(function(t){"use strict";function e(){_()}function r(){c(BBP_Converter.strings.button_continue,BBP_Converter.strings.import_stopped_user)}function n(){var e={};return t.each(b.serializeArray(),function(t,r){e[r.name]=r.value}),e._bbp_converter_restart&&g.removeAttr("checked"),e._bbp_converter_delay_time&&(BBP_Converter.state.delay=1e3*parseInt(e._bbp_converter_delay_time,10)),e.action="bbp_converter_process",e._ajax_nonce=BBP_Converter.ajax_nonce,e}function s(){t.post(ajaxurl,n(),function(t){try{var e=t.data;!0===t.success?a(e):c()}catch(t){c()}},"json")}function a(t){BBP_Converter.state.running&&(B(t.progress),v(t.step_percent,t.total_percent),u(t),o(),t.current_step===t.final_step&&c(BBP_Converter.strings.button_start,BBP_Converter.strings.import_complete))}function o(){clearTimeout(BBP_Converter.state.running),BBP_Converter.state.running&&(BBP_Converter.state.running=setTimeout(function(){s()},parseInt(BBP_Converter.state.delay,10)))}function _(){clearTimeout(BBP_Converter.state.running),clearInterval(BBP_Converter.state.status),BBP_Converter.state.running=!0;var t=BBP_Converter.strings.start_continue;!1===BBP_Converter.state.started&&(t=BBP_Converter.strings.start_start,BBP_Converter.state.started=!0),i(BBP_Converter.strings.button_continue,t,BBP_Converter.strings.status_starting),p.addClass("started"),C.hide(),l.show(),s()}function c(t,e){clearTimeout(BBP_Converter.state.running),clearInterval(BBP_Converter.state.status),BBP_Converter.state.running=!1,BBP_Converter.state.status=!1,t||(t=BBP_Converter.strings.button_continue),e||(e=BBP_Converter.strings.status_stopped),i(t,e,BBP_Converter.strings.status_stopped),C.show(),l.hide()}function i(t,e,r){C.val(t),B(e),P.text(r)}function u(t){var e=parseInt(BBP_Converter.state.delay,10)/1e3;P.text(BBP_Converter.strings.status_counting.replace("%s",e)),clearInterval(BBP_Converter.state.status),BBP_Converter.state.status=setInterval(function(){e--,P.text(BBP_Converter.strings.status_counting.replace("%s",e)),e<=0&&(clearInterval(BBP_Converter.state.status),parseInt(t.current_step,10)<parseInt(t.final_step,10)?P.text(BBP_Converter.strings.status_up_next.replace("%s",t.current_step)):P.text(BBP_Converter.strings.status_complete))},1e3)}function B(t){t="<p>"+t+"</p>",p.prepend(t)}function v(t,e){m.width(t+"%"),x.width(e+"%")}var p=t("#bbp-converter-message"),l=t("#bbp-converter-stop"),C=t("#bbp-converter-start"),g=t("#_bbp_converter_restart"),P=t("#bbp-converter-status"),b=t("#bbp-converter-settings"),d=t("#_bbp_converter_db_pass"),f=t(".bbp-db-pass-toggle"),m=t("#bbp-converter-step-percentage"),x=t("#bbp-converter-total-percentage");f.on("click",function(t){var e="password"===d.attr("type")?"text":"password";d.attr("type",e),f.toggleClass("password").toggleClass("text"),t.preventDefault()}),C.on("click",function(t){e(),t.preventDefault()}),t(l).on("click",function(t){r(),t.preventDefault()})});
includes/admin/{js → assets/js}/replies.js RENAMED
@@ -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/assets/js/replies.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! This file is automatically generated. */
2
+
3
+ jQuery(document).ready(function(){jQuery("#misc-publishing-actions").find(".misc-pub-section").first().remove(),jQuery("#save-action").remove();var e=jQuery("#bbp_topic_id");e.suggest(e.data("ajax-url"),{onSelect:function(){var i=this.value;e.val(i.substr(0,i.indexOf(" ")))}})});
includes/admin/{js → assets/js}/topics.js RENAMED
File without changes
includes/admin/assets/js/topics.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! This file is automatically generated. */
2
+
3
+ jQuery(document).ready(function(){jQuery("#misc-publishing-actions").find(".misc-pub-section").first().remove(),jQuery("#save-action").remove()});
includes/admin/{admin.php → classes/class-bbp-admin.php} RENAMED
@@ -8,15 +8,15 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
- if ( !class_exists( 'BBP_Admin' ) ) :
14
  /**
15
  * Loads bbPress plugin admin area
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
- * @since bbPress (r2464)
20
  */
21
  class BBP_Admin {
22
 
@@ -68,16 +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
80
- * @uses BBP_Admin::setup_actions() Setup the hooks and actions
81
  */
82
  public function __construct() {
83
  $this->setup_globals();
@@ -88,64 +91,74 @@ class BBP_Admin {
88
  /**
89
  * Admin globals
90
  *
91
- * @since bbPress (r2646)
 
92
  * @access private
93
  */
94
  private function setup_globals() {
95
- $bbp = bbpress();
96
- $this->admin_dir = trailingslashit( $bbp->includes_dir . 'admin' ); // Admin path
97
- $this->admin_url = trailingslashit( $bbp->includes_url . 'admin' ); // Admin url
98
- $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL
99
- $this->styles_url = trailingslashit( $this->admin_url . 'styles' ); // Admin styles URL
100
- $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL
101
- $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin js URL
102
  }
103
 
104
  /**
105
  * Include required files
106
  *
107
- * @since bbPress (r2646)
 
108
  * @access private
109
  */
110
  private function includes() {
111
- require( $this->admin_dir . 'tools.php' );
112
- require( $this->admin_dir . 'converter.php' );
113
- require( $this->admin_dir . 'settings.php' );
114
- require( $this->admin_dir . 'functions.php' );
115
- require( $this->admin_dir . 'metaboxes.php' );
116
- require( $this->admin_dir . 'forums.php' );
117
- require( $this->admin_dir . 'topics.php' );
118
- require( $this->admin_dir . 'replies.php' );
119
- require( $this->admin_dir . 'users.php' );
 
 
 
 
 
 
 
 
 
120
  }
121
 
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
129
- * @uses add_filter() To add various filters
130
  */
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
 
@@ -155,15 +168,12 @@ class BBP_Admin {
155
 
156
  /** Filters ***********************************************************/
157
 
158
- // Modify bbPress's admin links
159
  add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
160
 
161
  // Map settings capabilities
162
  add_filter( 'bbp_map_meta_caps', array( $this, 'map_settings_meta_caps' ), 10, 4 );
163
 
164
- // Hide the theme compat package selection
165
- add_filter( 'bbp_admin_get_settings_sections', array( $this, 'hide_theme_compat_packages' ) );
166
-
167
  // Allow keymasters to save forums settings
168
  add_filter( 'option_page_capability_bbpress', array( $this, 'option_page_capability_bbpress' ) );
169
 
@@ -179,71 +189,110 @@ class BBP_Admin {
179
  }
180
 
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
188
- * section
189
  */
190
  public function admin_menus() {
191
 
192
  $hooks = array();
193
 
194
- // These are later removed in admin_head
195
- if ( current_user_can( 'bbp_tools_page' ) ) {
196
- if ( current_user_can( 'bbp_tools_repair_page' ) ) {
197
- $hooks[] = add_management_page(
198
- __( 'Repair Forums', 'bbpress' ),
199
- __( 'Forum Repair', 'bbpress' ),
200
- $this->minimum_capability,
201
- 'bbp-repair',
202
- 'bbp_admin_repair'
203
- );
204
- }
205
 
206
- if ( current_user_can( 'bbp_tools_import_page' ) ) {
207
- $hooks[] = add_management_page(
208
- __( 'Import Forums', 'bbpress' ),
209
- __( 'Forum Import', 'bbpress' ),
210
- $this->minimum_capability,
211
- 'bbp-converter',
212
- 'bbp_converter_settings'
213
- );
214
- }
215
 
216
- if ( current_user_can( 'bbp_tools_reset_page' ) ) {
217
- $hooks[] = add_management_page(
218
- __( 'Reset Forums', 'bbpress' ),
219
- __( 'Forum Reset', 'bbpress' ),
220
- $this->minimum_capability,
221
- 'bbp-reset',
222
- 'bbp_admin_reset'
223
- );
224
- }
225
 
226
- // Fudge the highlighted subnav item when on a bbPress admin page
227
- foreach ( $hooks as $hook ) {
228
- add_action( "admin_head-$hook", 'bbp_tools_modify_menu_highlight' );
229
  }
 
230
 
231
- // Forums Tools Root
232
- add_management_page(
233
- __( 'Forums', 'bbpress' ),
234
- __( 'Forums', 'bbpress' ),
235
- $this->minimum_capability,
236
- 'bbp-repair',
237
- 'bbp_admin_repair'
238
- );
239
  }
240
 
 
 
 
 
 
 
 
 
 
241
  // Are settings enabled?
242
- if ( ! bbp_settings_integration() && current_user_can( 'bbp_settings_page' ) ) {
243
  add_options_page(
244
- __( 'Forums', 'bbpress' ),
245
- __( 'Forums', 'bbpress' ),
246
- $this->minimum_capability,
247
  'bbpress',
248
  'bbp_admin_settings'
249
  );
@@ -254,31 +303,32 @@ class BBP_Admin {
254
 
255
  // About
256
  add_dashboard_page(
257
- __( 'Welcome to bbPress', 'bbpress' ),
258
- __( 'Welcome to bbPress', 'bbpress' ),
259
- $this->minimum_capability,
260
  'bbp-about',
261
  array( $this, 'about_screen' )
262
  );
263
 
264
  // Credits
265
  add_dashboard_page(
266
- __( 'Welcome to bbPress', 'bbpress' ),
267
- __( 'Welcome to bbPress', 'bbpress' ),
268
- $this->minimum_capability,
269
  'bbp-credits',
270
  array( $this, 'credits_screen' )
271
  );
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',
280
- __( 'Update Forums', 'bbpress' ),
281
- __( 'Update Forums', 'bbpress' ),
282
  'manage_network',
283
  'bbp-update',
284
  array( $this, 'update_screen' )
@@ -288,19 +338,19 @@ 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',
302
- __( 'Update Forums', 'bbpress' ),
303
- __( 'Update Forums', 'bbpress' ),
304
  'manage_network',
305
  'bbpress-update',
306
  array( $this, 'network_update_screen' )
@@ -310,12 +360,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,19 +375,17 @@ 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
330
- * @uses register_setting() To register various settings
331
  * @todo Put fields into multidimensional array
332
  */
333
  public static function register_admin_settings() {
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 +394,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 +418,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,15 +431,13 @@ 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
391
  * @return array Actual capabilities for meta capability
392
  */
393
  public static function map_settings_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
@@ -395,7 +445,32 @@ class BBP_Admin {
395
  // What capability is being checked?
396
  switch ( $cap ) {
397
 
398
- // BuddyPress
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  case 'bbp_settings_buddypress' :
400
  if ( ( is_plugin_active( 'buddypress/bp-loader.php' ) && defined( 'BP_VERSION' ) && bp_is_root_blog() ) && is_super_admin() ) {
401
  $caps = array( bbpress()->admin->minimum_capability );
@@ -405,7 +480,7 @@ class BBP_Admin {
405
 
406
  break;
407
 
408
- // Akismet
409
  case 'bbp_settings_akismet' :
410
  if ( ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) && is_super_admin() ) {
411
  $caps = array( bbpress()->admin->minimum_capability );
@@ -414,45 +489,26 @@ class BBP_Admin {
414
  }
415
 
416
  break;
417
-
418
- // bbPress
419
- case 'bbp_about_page' : // About and Credits
420
- case 'bbp_tools_page' : // Tools Page
421
- case 'bbp_tools_repair_page' : // Tools - Repair Page
422
- case 'bbp_tools_import_page' : // Tools - Import Page
423
- case 'bbp_tools_reset_page' : // Tools - Reset Page
424
- case 'bbp_settings_page' : // Settings Page
425
- case 'bbp_settings_users' : // Settings - Users
426
- case 'bbp_settings_features' : // Settings - Features
427
- case 'bbp_settings_theme_compat' : // Settings - Theme compat
428
- case 'bbp_settings_root_slugs' : // Settings - Root slugs
429
- case 'bbp_settings_single_slugs' : // Settings - Single slugs
430
- case 'bbp_settings_user_slugs' : // Settings - User slugs
431
- case 'bbp_settings_per_page' : // Settings - Per page
432
- case 'bbp_settings_per_rss_page' : // Settings - Per RSS page
433
- $caps = array( bbpress()->admin->minimum_capability );
434
- break;
435
  }
436
 
437
- return apply_filters( 'bbp_map_settings_meta_caps', $caps, $cap, $user_id, $args );
 
438
  }
439
 
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.
447
  */
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' );
456
 
457
  // Load our importers
458
  $importers = apply_filters( 'bbp_importers', array( 'bbpress' ) );
@@ -468,7 +524,7 @@ class BBP_Admin {
468
 
469
  // If the file exists, include it
470
  if ( file_exists( $import_file ) ) {
471
- require( $import_file );
472
  }
473
  }
474
  }
@@ -478,9 +534,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
  */
485
  public function activation_notice() {
486
  // @todo - something fun
@@ -489,7 +543,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 +552,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,92 +573,92 @@ 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',
545
- 'title' => esc_html__( 'About bbPress', 'bbpress' ),
546
- 'href' => add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) )
547
- ) );
548
- }
549
- }
550
-
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
 
 
 
 
 
 
 
 
 
 
562
  // Post type checker (only topics and replies)
563
  if ( 'post' === get_current_screen()->base ) {
564
- switch( get_current_screen()->post_type ) {
565
  case bbp_get_reply_post_type() :
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;
581
  }
 
 
 
 
582
  }
583
  }
584
 
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
  */
602
  public function admin_head() {
603
- remove_submenu_page( 'tools.php', 'bbp-repair' );
604
- remove_submenu_page( 'tools.php', 'bbp-converter' );
605
- remove_submenu_page( 'tools.php', 'bbp-reset' );
606
- remove_submenu_page( 'index.php', 'bbp-about' );
607
- remove_submenu_page( 'index.php', 'bbp-credits' );
 
 
 
 
608
  }
609
 
610
  /**
@@ -614,21 +668,24 @@ 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,46 +694,22 @@ 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
  }
669
 
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
677
  */
678
  public function option_page_capability_bbpress( $capability = 'manage_options' ) {
679
- $capability = 'keep_gate';
680
  return $capability;
681
  }
682
 
@@ -685,15 +718,9 @@ 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()
692
- * @uses bbp_get_topic_id()
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 +737,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 +753,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 +772,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'
@@ -763,24 +789,45 @@ class BBP_Admin {
763
 
764
  /** About *****************************************************************/
765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
  /**
767
  * Output the about screen
768
  *
769
- * @since bbPress (r4159)
 
 
770
  */
771
  public function about_screen() {
772
-
773
- list( $display_version ) = explode( '-', bbp_get_version() ); ?>
774
 
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' ) ) ); ?>">
782
  <?php esc_html_e( 'What&#8217;s New', 'bbpress' ); ?>
783
- </a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>">
784
  <?php esc_html_e( 'Credits', 'bbpress' ); ?>
785
  </a>
786
  </h2>
@@ -829,7 +876,7 @@ class BBP_Admin {
829
  </div>
830
 
831
  <div class="return-to-dashboard">
832
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a>
833
  </div>
834
 
835
  </div>
@@ -840,100 +887,136 @@ class BBP_Admin {
840
  /**
841
  * Output the credits screen
842
  *
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
-
850
- list( $display_version ) = explode( '-', bbp_get_version() ); ?>
851
 
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">
859
  <?php esc_html_e( 'What&#8217;s New', 'bbpress' ); ?>
860
- </a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
861
  <?php esc_html_e( 'Credits', 'bbpress' ); ?>
862
  </a>
863
  </h2>
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">
936
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a>
937
  </div>
938
 
939
  </div>
@@ -946,11 +1029,7 @@ 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
  */
955
  public static function update_screen() {
956
 
@@ -958,8 +1037,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 +1071,16 @@ 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 +1092,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 ) ) : ?>
@@ -1036,21 +1109,31 @@ class BBP_Admin {
1036
 
1037
  <?php foreach ( (array) $blogs as $details ) :
1038
 
1039
- $siteurl = get_blog_option( $details['blog_id'], 'siteurl' ); ?>
 
 
 
 
 
 
1040
 
1041
- <li><?php echo $siteurl; ?></li>
1042
 
1043
  <?php
1044
 
1045
  // Get the response of the bbPress update on this site
1046
  $response = wp_remote_get(
1047
- trailingslashit( $siteurl ) . 'wp-admin/index.php?page=bbp-update&action=bbp-update',
1048
- array( 'timeout' => 30, 'httpversion' => '1.1' )
 
 
 
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' ] );
@@ -1104,16 +1187,3 @@ class BBP_Admin {
1104
  }
1105
  }
1106
  endif; // class_exists check
1107
-
1108
- /**
1109
- * Setup bbPress Admin
1110
- *
1111
- * @since bbPress (r2596)
1112
- *
1113
- * @uses BBP_Admin
1114
- */
1115
- function bbp_admin() {
1116
- bbpress()->admin = new BBP_Admin();
1117
-
1118
- bbpress()->admin->converter = new BBP_Converter();
1119
- }
8
  */
9
 
10
  // Exit if accessed directly
11
+ defined( 'ABSPATH' ) || exit;
12
 
13
+ if ( ! class_exists( 'BBP_Admin' ) ) :
14
  /**
15
  * Loads bbPress plugin admin area
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
  public function __construct() {
86
  $this->setup_globals();
91
  /**
92
  * Admin globals
93
  *
94
+ * @since 2.0.0 bbPress (r2646)
95
+ *
96
  * @access private
97
  */
98
  private function setup_globals() {
99
+ $bbp = bbpress();
100
+ $this->admin_dir = trailingslashit( $bbp->includes_dir . 'admin' ); // Admin path
101
+ $this->admin_url = trailingslashit( $bbp->includes_url . 'admin' ); // Admin url
102
+ $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL
103
+ $this->styles_url = trailingslashit( $this->admin_url . 'styles' ); // Admin styles URL
104
+ $this->css_url = trailingslashit( $this->admin_url . 'assets/css' ); // Admin css URL
105
+ $this->js_url = trailingslashit( $this->admin_url . 'assets/js' ); // Admin js URL
106
  }
107
 
108
  /**
109
  * Include required files
110
  *
111
+ * @since 2.0.0 bbPress (r2646)
112
+ *
113
  * @access private
114
  */
115
  private function includes() {
116
+
117
+ // Tools
118
+ require $this->admin_dir . 'tools.php';
119
+ require $this->admin_dir . 'tools/common.php';
120
+ require $this->admin_dir . 'tools/converter.php';
121
+ require $this->admin_dir . 'tools/repair.php';
122
+ require $this->admin_dir . 'tools/upgrade.php';
123
+ require $this->admin_dir . 'tools/reset.php';
124
+ require $this->admin_dir . 'tools/help.php';
125
+
126
+ // Components
127
+ require $this->admin_dir . 'settings.php';
128
+ require $this->admin_dir . 'common.php';
129
+ require $this->admin_dir . 'metaboxes.php';
130
+ require $this->admin_dir . 'forums.php';
131
+ require $this->admin_dir . 'topics.php';
132
+ require $this->admin_dir . 'replies.php';
133
+ require $this->admin_dir . 'users.php';
134
  }
135
 
136
  /**
137
  * Setup the admin hooks, actions and filters
138
  *
139
+ * @since 2.0.0 bbPress (r2646)
 
140
  *
141
+ * @access private
 
142
  */
143
  private function setup_actions() {
144
 
145
  // Bail to prevent interfering with the deactivation process
146
+ if ( bbp_is_deactivation() ) {
147
  return;
148
+ }
149
 
150
  /** General Actions ***************************************************/
151
 
152
+ add_action( 'bbp_admin_init', array( $this, 'setup_notices' ) );
153
+ add_action( 'bbp_admin_init', array( $this, 'hide_notices' ) );
154
+ add_action( 'bbp_admin_menu', array( $this, 'admin_menus' ) ); // Add menu item to settings menu
155
+ add_action( 'bbp_admin_head', array( $this, 'admin_head' ) ); // Add some general styling to the admin area
156
+ add_action( 'bbp_admin_notices', array( $this, 'activation_notice' ) ); // Add notice if not using a bbPress theme
157
+ add_action( 'bbp_register_admin_style', array( $this, 'register_admin_style' ) ); // Add green admin style
158
+ add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) ); // Add settings
159
+ add_action( 'bbp_activation', array( $this, 'new_install' ) ); // Add menu item to settings menu
160
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Add enqueued CSS
161
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Add enqueued JS
162
 
163
  /** Ajax **************************************************************/
164
 
168
 
169
  /** Filters ***********************************************************/
170
 
171
+ // Modify admin links
172
  add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
173
 
174
  // Map settings capabilities
175
  add_filter( 'bbp_map_meta_caps', array( $this, 'map_settings_meta_caps' ), 10, 4 );
176
 
 
 
 
177
  // Allow keymasters to save forums settings
178
  add_filter( 'option_page_capability_bbpress', array( $this, 'option_page_capability_bbpress' ) );
179
 
189
  }
190
 
191
  /**
192
+ * Setup general admin area notices.
193
+ *
194
+ * @since 2.6.0 bbPress (r6701)
195
+ */
196
+ public function setup_notices() {
197
+
198
+ // Database upgrade skipped?
199
+ $skipped = get_option( '_bbp_db_upgrade_skipped', 0 );
200
+
201
+ // Database upgrade skipped!
202
+ if ( ! empty( $skipped ) && ( $skipped < 260 ) && current_user_can( 'bbp_tools_upgrade_page' ) ) {
203
+
204
+ // Link to upgrade page
205
+ $upgrade_url = add_query_arg( array( 'page' => 'bbp-upgrade' ), admin_url( 'tools.php' ) );
206
+ $dismiss_url = wp_nonce_url( add_query_arg( array( 'bbp-hide-notice' => 'bbp-skip-upgrade' ) ), 'bbp-hide-notice' );
207
+ $upgrade_link = '<a href="' . esc_url( $upgrade_url ) . '">' . esc_html__( 'Go Upgrade', 'bbpress' ) . '</a>';
208
+ $dismiss_link = '<a href="' . esc_url( $dismiss_url ) . '">' . esc_html__( 'Hide Forever', 'bbpress' ) . '</a>';
209
+ $bbp_dashicon = '<span class="bbpress-logo-icon"></span>';
210
+ $message = $bbp_dashicon . sprintf(
211
+ esc_html__( 'bbPress requires a manual database upgrade. %s or %s', 'bbpress' ),
212
+ $upgrade_link,
213
+ $dismiss_link
214
+ );
215
+
216
+ // Add tools feedback
217
+ bbp_admin_tools_feedback( $message, 'notice-bbpress', false );
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Handle hiding of general admin area notices.
223
  *
224
+ * @since 2.6.0 bbPress (r6701)
225
+ */
226
+ public function hide_notices() {
227
+
228
+ // Bail if not hiding a notice
229
+ if ( empty( $_GET['bbp-hide-notice'] ) ) {
230
+ return;
231
+ }
232
+
233
+ // Check the admin referer
234
+ check_admin_referer( 'bbp-hide-notice' );
235
+
236
+ // Maybe delete notices
237
+ switch ( $_GET['bbp-hide-notice'] ) {
238
+
239
+ // Skipped upgrade notice
240
+ case 'bbp-skip-upgrade' :
241
+ delete_option( '_bbp_db_upgrade_skipped' );
242
+ break;
243
+ }
244
+ }
245
+
246
+ /**
247
+ * Add the admin menus
248
  *
249
+ * @since 2.0.0 bbPress (r2646)
 
 
250
  */
251
  public function admin_menus() {
252
 
253
  $hooks = array();
254
 
255
+ // Get the tools pages
256
+ $tools = bbp_get_tools_admin_pages();
 
 
 
 
 
 
 
 
 
257
 
258
+ // Loop through tools and check
259
+ foreach ( $tools as $tool ) {
 
 
 
 
 
 
 
260
 
261
+ // Try to add the admin page
262
+ $page = add_management_page(
263
+ $tool['name'],
264
+ $tool['name'],
265
+ $tool['cap'],
266
+ $tool['page'],
267
+ $tool['func']
268
+ );
 
269
 
270
+ // Add page to hook if user can view it
271
+ if ( false !== $page ) {
272
+ $hooks[] = $page;
273
  }
274
+ }
275
 
276
+ // Fudge the highlighted subnav item when on a bbPress admin page
277
+ foreach ( $hooks as $hook ) {
278
+ add_action( "admin_head-{$hook}", 'bbp_tools_modify_menu_highlight' );
 
 
 
 
 
279
  }
280
 
281
+ // Forums Tools Root
282
+ add_management_page(
283
+ esc_html__( 'Forums', 'bbpress' ),
284
+ esc_html__( 'Forums', 'bbpress' ),
285
+ 'bbp_tools_page',
286
+ 'bbp-repair',
287
+ 'bbp_admin_repair_page'
288
+ );
289
+
290
  // Are settings enabled?
291
+ if ( 'basic' === bbp_settings_integration() ) {
292
  add_options_page(
293
+ esc_html__( 'Forums', 'bbpress' ),
294
+ esc_html__( 'Forums', 'bbpress' ),
295
+ 'bbp_settings_page',
296
  'bbpress',
297
  'bbp_admin_settings'
298
  );
303
 
304
  // About
305
  add_dashboard_page(
306
+ esc_html__( 'Welcome to bbPress', 'bbpress' ),
307
+ esc_html__( 'Welcome to bbPress', 'bbpress' ),
308
+ 'bbp_about_page',
309
  'bbp-about',
310
  array( $this, 'about_screen' )
311
  );
312
 
313
  // Credits
314
  add_dashboard_page(
315
+ esc_html__( 'Welcome to bbPress', 'bbpress' ),
316
+ esc_html__( 'Welcome to bbPress', 'bbpress' ),
317
+ 'bbp_about_page',
318
  'bbp-credits',
319
  array( $this, 'credits_screen' )
320
  );
321
  }
322
 
323
  // Bail if plugin is not network activated
324
+ if ( ! is_plugin_active_for_network( bbpress()->basename ) ) {
325
  return;
326
+ }
327
 
328
  add_submenu_page(
329
  'index.php',
330
+ esc_html__( 'Update Forums', 'bbpress' ),
331
+ esc_html__( 'Update Forums', 'bbpress' ),
332
  'manage_network',
333
  'bbp-update',
334
  array( $this, 'update_screen' )
338
  /**
339
  * Add the network admin menus
340
  *
341
+ * @since 2.1.0 bbPress (r3689)
 
342
  */
343
  public function network_admin_menus() {
344
 
345
  // Bail if plugin is not network activated
346
+ if ( ! is_plugin_active_for_network( bbpress()->basename ) ) {
347
  return;
348
+ }
349
 
350
  add_submenu_page(
351
  'upgrade.php',
352
+ esc_html__( 'Update Forums', 'bbpress' ),
353
+ esc_html__( 'Update Forums', 'bbpress' ),
354
  'manage_network',
355
  'bbpress-update',
356
  array( $this, 'network_update_screen' )
360
  /**
361
  * If this is a new installation, create some initial forum content.
362
  *
363
+ * @since 2.1.0 bbPress (r3767)
364
+ *
365
  * @return type
366
  */
367
  public static function new_install() {
368
+ if ( ! bbp_is_install() ) {
369
  return;
370
+ }
371
 
372
  bbp_create_initial_content();
373
  }
375
  /**
376
  * Register the settings
377
  *
378
+ * @since 2.0.0 bbPress (r2737)
379
  *
 
 
 
380
  * @todo Put fields into multidimensional array
381
  */
382
  public static function register_admin_settings() {
383
 
384
  // Bail if no sections available
385
  $sections = bbp_admin_get_settings_sections();
386
+ if ( empty( $sections ) ) {
387
  return false;
388
+ }
389
 
390
  // Are we using settings integration?
391
  $settings_integration = bbp_settings_integration();
394
  foreach ( (array) $sections as $section_id => $section ) {
395
 
396
  // Only proceed if current user can see this section
397
+ if ( ! current_user_can( $section_id ) ) {
398
  continue;
399
+ }
400
 
401
  // Only add section and fields if section has fields
402
  $fields = bbp_admin_get_settings_fields_for_section( $section_id );
403
+ if ( empty( $fields ) ) {
404
  continue;
405
+ }
406
 
407
+ // Overload the converter page
408
+ if ( ! empty( $section['page'] ) && ( ( 'converter' === $section['page'] ) || ( 'deep' === $settings_integration ) ) ) {
409
  $page = $section['page'];
410
  } else {
411
  $page = 'bbpress';
418
  foreach ( (array) $fields as $field_id => $field ) {
419
 
420
  // Add the field
421
+ if ( ! empty( $field['callback'] ) && ! empty( $field['title'] ) ) {
422
  add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] );
423
  }
424
 
431
  /**
432
  * Maps settings capabilities
433
  *
434
+ * @since 2.2.0 bbPress (r4242)
435
  *
436
  * @param array $caps Capabilities for meta capability
437
  * @param string $cap Capability name
438
  * @param int $user_id User id
439
+ * @param array $args Arguments
440
+ *
 
 
441
  * @return array Actual capabilities for meta capability
442
  */
443
  public static function map_settings_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
445
  // What capability is being checked?
446
  switch ( $cap ) {
447
 
448
+ // Pages
449
+ case 'bbp_about_page' : // About and Credits
450
+ case 'bbp_tools_page' : // Tools Page
451
+ case 'bbp_tools_repair_page' : // Tools - Repair Page
452
+ case 'bbp_tools_upgrade_page' : // Tools - Upgrade Page
453
+ case 'bbp_tools_import_page' : // Tools - Import Page
454
+ case 'bbp_tools_reset_page' : // Tools - Reset Page
455
+ case 'bbp_settings_page' : // Settings Page
456
+
457
+ // Converter Sections
458
+ case 'bbp_converter_connection' : // Converter - Connection
459
+ case 'bbp_converter_options' : // Converter - Options
460
+
461
+ // Settings Sections
462
+ case 'bbp_settings_users' : // Settings - Users
463
+ case 'bbp_settings_features' : // Settings - Features
464
+ case 'bbp_settings_theme_compat' : // Settings - Theme compat
465
+ case 'bbp_settings_root_slugs' : // Settings - Root slugs
466
+ case 'bbp_settings_single_slugs' : // Settings - Single slugs
467
+ case 'bbp_settings_user_slugs' : // Settings - User slugs
468
+ case 'bbp_settings_per_page' : // Settings - Per page
469
+ case 'bbp_settings_per_rss_page' : // Settings - Per RSS page
470
+ $caps = array( bbpress()->admin->minimum_capability );
471
+ break;
472
+
473
+ // Extend - BuddyPress
474
  case 'bbp_settings_buddypress' :
475
  if ( ( is_plugin_active( 'buddypress/bp-loader.php' ) && defined( 'BP_VERSION' ) && bp_is_root_blog() ) && is_super_admin() ) {
476
  $caps = array( bbpress()->admin->minimum_capability );
480
 
481
  break;
482
 
483
+ // Extend - Akismet
484
  case 'bbp_settings_akismet' :
485
  if ( ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) && is_super_admin() ) {
486
  $caps = array( bbpress()->admin->minimum_capability );
489
  }
490
 
491
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  }
493
 
494
+ // Filter & return
495
+ return (array) apply_filters( 'bbp_map_settings_meta_caps', $caps, $cap, $user_id, $args );
496
  }
497
 
498
  /**
499
  * Register the importers
500
  *
501
+ * @since 2.0.0 bbPress (r2737)
 
 
 
502
  */
503
  public function register_importers() {
504
 
505
  // Leave if we're not in the import section
506
+ if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
507
  return;
508
+ }
509
 
510
  // Load Importer API
511
+ require_once ABSPATH . 'wp-admin/includes/import.php';
512
 
513
  // Load our importers
514
  $importers = apply_filters( 'bbp_importers', array( 'bbpress' ) );
524
 
525
  // If the file exists, include it
526
  if ( file_exists( $import_file ) ) {
527
+ require $import_file;
528
  }
529
  }
530
  }
534
  *
535
  * Shows a nag message in admin area about the theme not supporting bbPress
536
  *
537
+ * @since 2.0.0 bbPress (r2743)
 
 
538
  */
539
  public function activation_notice() {
540
  // @todo - something fun
543
  /**
544
  * Add Settings link to plugins area
545
  *
546
+ * @since 2.0.0 bbPress (r2737)
547
  *
548
  * @param array $links Links array in which we would prepend our link
549
  * @param string $file Current plugin basename
552
  public static function modify_plugin_action_links( $links, $file ) {
553
 
554
  // Return normal links if not bbPress
555
+ if ( plugin_basename( bbpress()->basename ) !== $file ) {
556
  return $links;
557
  }
558
 
573
  return array_merge( $links, $new_links );
574
  }
575
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
576
  /**
577
  * Enqueue any admin scripts we might need
578
  *
579
+ * @since 2.2.0 bbPress (r4260)
580
  */
581
  public function enqueue_scripts() {
582
+
583
+ // Enqueue suggest for forum/topic/reply autocompletes
584
  wp_enqueue_script( 'suggest' );
585
 
586
+ // Minified
587
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
588
+
589
  // Get the version to use for JS
590
  $version = bbp_get_version();
591
 
592
+ // Footer JS
593
+ wp_register_script( 'bbp-admin-badge-js', $this->js_url . 'badge' . $suffix . '.js', array(), $version, true );
594
+
595
+ // Header JS
596
+ wp_register_script( 'bbp-admin-common-js', $this->js_url . 'common' . $suffix . '.js', array( 'jquery', 'suggest' ), $version );
597
+ wp_register_script( 'bbp-admin-topics-js', $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version );
598
+ wp_register_script( 'bbp-admin-replies-js', $this->js_url . 'replies' . $suffix . '.js', array( 'jquery', 'suggest' ), $version );
599
+ wp_register_script( 'bbp-converter', $this->js_url . 'converter' . $suffix . '.js', array( 'jquery', 'postbox', 'dashboard' ), $version );
600
+
601
  // Post type checker (only topics and replies)
602
  if ( 'post' === get_current_screen()->base ) {
603
+ switch ( get_current_screen()->post_type ) {
604
  case bbp_get_reply_post_type() :
605
  case bbp_get_topic_post_type() :
606
 
607
  // Enqueue the common JS
608
+ wp_enqueue_script( 'bbp-admin-common-js' );
609
 
610
  // Topics admin
611
  if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) {
612
+ wp_enqueue_script( 'bbp-admin-topics-js' );
613
 
614
  // Replies admin
615
  } elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) {
616
+ wp_enqueue_script( 'bbp-admin-replies-js' );
617
  }
618
 
619
  break;
620
  }
621
+
622
+ // Enqueue the badge JS
623
+ } elseif ( in_array( get_current_screen()->id, array( 'dashboard_page_bbp-about', 'dashboard_page_bbp-credits' ), true ) ) {
624
+ wp_enqueue_script( 'bbp-admin-badge-js' );
625
  }
626
  }
627
 
628
  /**
629
  * Enqueue any admin scripts we might need
630
  *
631
+ * @since 2.6.0 bbPress (r5224)
632
  */
633
  public function enqueue_styles() {
634
+
635
+ // RTL and/or minified
636
+ $suffix = is_rtl() ? '-rtl' : '';
637
+ $suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
638
+
639
+ // Register admin CSS with dashicons dependency
640
+ wp_register_style( 'bbp-admin-css', $this->css_url . 'admin' . $suffix . '.css', array( 'dashicons' ), bbp_get_version() );
641
+
642
+ // Enqueue
643
+ wp_enqueue_style( 'bbp-admin-css' );
644
  }
645
 
646
  /**
647
  * Remove the individual recount and converter menus.
648
  * They are grouped together by h2 tabs
649
  *
650
+ * @since 2.0.0 bbPress (r2464)
 
 
651
  */
652
  public function admin_head() {
653
+
654
+ // Tools
655
+ foreach ( bbp_get_tools_admin_pages() as $tool ) {
656
+ remove_submenu_page( 'tools.php', $tool['page'] );
657
+ }
658
+
659
+ // About
660
+ remove_submenu_page( 'index.php', 'bbp-about' );
661
+ remove_submenu_page( 'index.php', 'bbp-credits' );
662
  }
663
 
664
  /**
668
  * way to be certain what the relative path of the admin images is.
669
  * We are including the two most common configurations here, just in case.
670
  *
671
+ * @since 2.0.0 bbPress (r2521)
 
 
672
  */
673
+ public function register_admin_style() {
674
+
675
+ // Color schemes are not available when running out of src
676
+ if ( false !== strpos( plugin_basename( bbpress()->file ), 'src' ) ) {
677
+ return;
678
+ }
679
 
680
  // RTL and/or minified
681
+ $suffix = is_rtl() ? '-rtl' : '';
682
+ $suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
683
 
684
  // Mint
685
  wp_admin_css_color(
686
  'bbp-mint',
687
+ esc_html_x( 'Mint', 'admin color scheme', 'bbpress' ),
688
+ $this->styles_url . 'mint/colors' . $suffix . '.css',
689
  array( '#4f6d59', '#33834e', '#5FB37C', '#81c498' ),
690
  array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
691
  );
694
  wp_admin_css_color(
695
  'bbp-evergreen',
696
  esc_html_x( 'Evergreen', 'admin color scheme', 'bbpress' ),
697
+ $this->styles_url . 'evergreen/colors' . $suffix . '.css',
698
  array( '#324d3a', '#446950', '#56b274', '#324d3a' ),
699
  array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
700
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  }
702
 
703
  /**
704
  * Allow keymaster role to save Forums settings
705
  *
706
+ * @since 2.3.0 bbPress (r4678)
707
  *
708
  * @param string $capability
709
+ * @return string Return minimum capability
710
  */
711
  public function option_page_capability_bbpress( $capability = 'manage_options' ) {
712
+ $capability = $this->minimum_capability;
713
  return $capability;
714
  }
715
 
718
  /**
719
  * Ajax action for facilitating the forum auto-suggest
720
  *
721
+ * @since 2.2.0 bbPress (r4261)
 
 
 
 
 
722
  */
723
  public function suggest_topic() {
 
724
 
725
  // Bail early if no request
726
  if ( empty( $_REQUEST['q'] ) ) {
737
 
738
  // Try to get some topics
739
  $topics = get_posts( array(
740
+ 's' => bbp_db()->esc_like( $_REQUEST['q'] ),
741
  'post_type' => bbp_get_topic_post_type()
742
  ) );
743
 
753
  /**
754
  * Ajax action for facilitating the topic and reply author auto-suggest
755
  *
756
+ * @since 2.4.0 bbPress (r5014)
757
  */
758
  public function suggest_user() {
 
759
 
760
  // Bail early if no request
761
  if ( empty( $_REQUEST['q'] ) ) {
772
 
773
  // Try to get some users
774
  $users_query = new WP_User_Query( array(
775
+ 'search' => '*' . bbp_db()->esc_like( $_REQUEST['q'] ) . '*',
776
  'fields' => array( 'ID', 'user_nicename' ),
777
  'search_columns' => array( 'ID', 'user_nicename', 'user_email' ),
778
  'orderby' => 'ID'
789
 
790
  /** About *****************************************************************/
791
 
792
+ /**
793
+ * Output the shared screen header for about_screen() & credits_screen()
794
+ *
795
+ * Contains title, subtitle, and badge area
796
+ *
797
+ * @since 2.6.0 bbPress (r6604)
798
+ */
799
+ private function screen_header() {
800
+ list( $display_version ) = explode( '-', bbp_get_version() ); ?>
801
+
802
+ <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
803
+ <div class="about-text"><?php printf( esc_html__( 'bbPress is fun to use, contains no artificial colors or preservatives, and is absolutely wonderful in every environment. Your community is going to love using it.', 'bbpress' ), $display_version ); ?></div>
804
+
805
+ <span class="bbp-hive" id="bbp-hive"></span>
806
+ <div class="bbp-badge" id="bbp-badge">
807
+ <span class="bbp-bee" id="bbp-bee"></span>
808
+ </div>
809
+
810
+ <?php
811
+ }
812
+
813
  /**
814
  * Output the about screen
815
  *
816
+ * @since 2.2.0 bbPress (r4159)
817
+ *
818
+ * @todo Host this remotely.
819
  */
820
  public function about_screen() {
821
+ ?>
 
822
 
823
  <div class="wrap about-wrap">
824
+
825
+ <?php $this->screen_header(); ?>
 
826
 
827
  <h2 class="nav-tab-wrapper">
828
+ <a class="nav-tab nav-tab-active" href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) ); ?>">
829
  <?php esc_html_e( 'What&#8217;s New', 'bbpress' ); ?>
830
+ </a><a class="nav-tab" href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-credits' ), admin_url( 'index.php' ) ) ); ?>">
831
  <?php esc_html_e( 'Credits', 'bbpress' ); ?>
832
  </a>
833
  </h2>
876
  </div>
877
 
878
  <div class="return-to-dashboard">
879
+ <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a>
880
  </div>
881
 
882
  </div>
887
  /**
888
  * Output the credits screen
889
  *
890
+ * @since 2.2.0 bbPress (r4159)
 
891
  *
892
+ * @todo Host this remotely.
893
  */
894
  public function credits_screen() {
895
+ ?>
 
896
 
897
  <div class="wrap about-wrap">
898
+
899
+ <?php $this->screen_header(); ?>
 
900
 
901
  <h2 class="nav-tab-wrapper">
902
+ <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) ); ?>" class="nav-tab">
903
  <?php esc_html_e( 'What&#8217;s New', 'bbpress' ); ?>
904
+ </a><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-credits' ), admin_url( 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
905
  <?php esc_html_e( 'Credits', 'bbpress' ); ?>
906
  </a>
907
  </h2>
908
 
909
  <p class="about-description"><?php esc_html_e( 'bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress' ); ?></p>
910
 
911
+ <h3 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'bbpress' ); ?></h3>
912
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
913
  <li class="wp-person" id="wp-person-matt">
914
+ <a href="https://profiles.wordpress.org/matt" class="web"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=120" class="gravatar" alt="" />Matt Mullenweg</a>
 
915
  <span class="title"><?php esc_html_e( 'Founding Developer', 'bbpress' ); ?></span>
916
  </li>
917
  <li class="wp-person" id="wp-person-johnjamesjacoby">
918
+ <a href="https://profiles.wordpress.org/johnjamesjacoby" class="web"><img src="http://0.gravatar.com/avatar/7a2644fb53ae2f7bfd7143b504af396c?s=120" class="gravatar" alt="" />John James Jacoby</a>
 
919
  <span class="title"><?php esc_html_e( 'Lead Developer', 'bbpress' ); ?></span>
920
  </li>
921
  <li class="wp-person" id="wp-person-jmdodd">
922
+ <a href="https://profiles.wordpress.org/jmdodd" class="web"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=120" class="gravatar" alt="" />Jennifer M. Dodd</a>
923
+ <span class="title"><?php esc_html_e( 'Feature Virtuoso', 'bbpress' ); ?></span>
 
924
  </li>
925
  <li class="wp-person" id="wp-person-netweb">
926
+ <a href="https://profiles.wordpress.org/netweb" class="web"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=120" class="gravatar" alt="" />Stephen Edgar</a>
927
+ <span class="title"><?php esc_html_e( 'Tool Maven', 'bbpress' ); ?></span>
 
928
  </li>
929
  </ul>
930
 
931
+ <h3 class="wp-people-group"><?php esc_html_e( 'Contributing Developers', 'bbpress' ); ?></h3>
932
  <ul class="wp-people-group " id="wp-people-group-contributing-developers">
933
+ <li class="wp-person" id="wp-person-sergeybiryukov">
934
+ <a href="https://profiles.wordpress.org/SergeyBiryukov" class="web"><img src="http://0.gravatar.com/avatar/750b7b0fcd855389264c2b1294d61bd6?s?s=120" class="gravatar" alt="" />Sergey Biryukov</a>
935
+ <span class="title"><?php esc_html_e( 'Core Developer', 'bbpress' ); ?></span>
 
936
  </li>
937
+ <li class="wp-person" id="wp-person-thebrandonallen">
938
+ <a href="https://profiles.wordpress.org/thebrandonallen" class="web"><img src="http://0.gravatar.com/avatar/6d3f77bf3c9ca94c406dea401b566950?s?s=120" class="gravatar" alt="" />Brandon Allen</a>
939
+ <span class="title"><?php esc_html_e( 'Core Developer', 'bbpress' ); ?></span>
940
+ </li>
941
+ </ul>
942
+
943
+ <h3 class="wp-people-group"><?php esc_html_e( 'Project Emeriti', 'bbpress' ); ?></h3>
944
+ <ul class="wp-people-group " id="wp-people-group-project-emeriti">
945
  <li class="wp-person" id="wp-person-gautamgupta">
946
+ <a href="https://profiles.wordpress.org/gautamgupta" class="web"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=120" class="gravatar" alt="" />Gautam Gupta</a>
 
947
  <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
948
  </li>
949
+ <li class="wp-person" id="wp-person-jaredatch">
950
+ <a href="https://profiles.wordpress.org/jaredatch" class="web"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=120" class="gravatar" alt="" />Jared Atchison</a>
951
+ <span class="title"><?php esc_html_e( 'Integration Testing', 'bbpress' ); ?></span>
952
+ </li>
953
  </ul>
954
 
955
+ <h3 class="wp-people-group"><?php esc_html_e( 'Contributors to bbPress 2.6', 'bbpress' ); ?></h3>
956
  <p class="wp-credits-list">
957
+ <a href="https://profiles.wordpress.org/alex-ye">alex-ye</a>,
958
+ <a href="https://profiles.wordpress.org/ankit-k-gupta">ankit-k-gupta</a>,
959
+ <a href="https://profiles.wordpress.org/barryhughes-1">barryhughes-1</a>,
960
+ <a href="https://profiles.wordpress.org/boonebgorges">boonebgorges</a>,
961
+ <a href="https://profiles.wordpress.org/casiepa">casiepa</a>,
962
+ <a href="https://profiles.wordpress.org/cfinke">cfinke</a>,
963
+ <a href="https://profiles.wordpress.org/danielbachhuber">danielbachhuber</a>,
964
+ <a href="https://profiles.wordpress.org/dimitrovadrian">dimitrov.adrian</a>,
965
+ <a href="https://profiles.wordpress.org/DJPaul">DJPaul</a>,
966
+ <a href="https://profiles.wordpress.org/DrPepper75">DrPepper75</a>,
967
+ <a href="https://profiles.wordpress.org/eoigal">eoigal</a>,
968
+ <a href="https://profiles.wordpress.org/ericlewis">ericlewis</a>,
969
+ <a href="https://profiles.wordpress.org/extendwings">extendwings</a>,
970
+ <a href="https://profiles.wordpress.org/Faison">Faison</a>,
971
+ <a href="https://profiles.wordpress.org/gautamgupta">gautamgupta</a>,
972
+ <a href="https://profiles.wordpress.org/glynwintle">glynwintle</a>,
973
+ <a href="https://profiles.wordpress.org/gusrb84">gusrb84</a>,
974
+ <a href="https://profiles.wordpress.org/hellofromTonya">hellofromTonya</a>,
975
+ <a href="https://profiles.wordpress.org/icu0755">icu0755</a>,
976
+ <a href="https://profiles.wordpress.org/imath">imath</a>,
977
+ <a href="https://profiles.wordpress.org/jbrinley">jbrinley</a>,
978
+ <a href="https://profiles.wordpress.org/jdgrimes">jdgrimes</a>,
979
+ <a href="https://profiles.wordpress.org/jmdodd">jmdodd</a>,
980
+ <a href="https://profiles.wordpress.org/joedolson">joedolson</a>,
981
+ <a href="https://profiles.wordpress.org/johnbillion">johnbillion</a>,
982
+ <a href="https://profiles.wordpress.org/johnjamesjacoby">johnjamesjacoby</a>,
983
+ <a href="https://profiles.wordpress.org/jorbin">jorbin</a>,
984
+ <a href="https://profiles.wordpress.org/jreeve">jreeve</a>,
985
+ <a href="https://profiles.wordpress.org/kadamwhite ">kadamwhite</a>,
986
+ <a href="https://profiles.wordpress.org/karlgroves">karlgroves</a>,
987
+ <a href="https://profiles.wordpress.org/mat-lipe">mat-lipe</a>,
988
+ <a href="https://profiles.wordpress.org/mazengamal">mazengamal</a>,
989
+ <a href="https://profiles.wordpress.org/melchoyce">melchoyce</a>,
990
+ <a href="https://profiles.wordpress.org/mercime">mercime</a>,
991
+ <a href="https://profiles.wordpress.org/michaelbeil">michaelbeil</a>,
992
+ <a href="https://profiles.wordpress.org/mikelopez">mikelopez</a>,
993
+ <a href="https://profiles.wordpress.org/mordauk">mordauk</a>,
994
+ <a href="https://profiles.wordpress.org/mspecht">mspecht</a>,
995
+ <a href="https://profiles.wordpress.org/MZAWeb">MZAWeb</a>,
996
+ <a href="https://profiles.wordpress.org/netweb">netweb</a>,
997
+ <a href="https://profiles.wordpress.org/ocean90">ocean90</a>,
998
+ <a href="https://profiles.wordpress.org/offereins">offereins</a>,
999
+ <a href="https://profiles.wordpress.org/pareshradadiya">pareshradadiya</a>,
1000
+ <a href="https://profiles.wordpress.org/r-a-y">r-a-y</a>,
1001
+ <a href="https://profiles.wordpress.org/ramiy">ramiy</a>,
1002
+ <a href="https://profiles.wordpress.org/robin-w">robin-w</a>,
1003
+ <a href="https://profiles.wordpress.org/robkk">robkk</a>,
1004
+ <a href="https://profiles.wordpress.org/ryelle">ryelle</a>,
1005
+ <a href="https://profiles.wordpress.org/satollo">satollo</a>,
1006
+ <a href="https://profiles.wordpress.org/SergeyBiryukov">Sergey Biryukov</a>,
1007
+ <a href="https://profiles.wordpress.org/SGr33n">SGr33n</a>,
1008
+ <a href="https://profiles.wordpress.org/stephdau">stephdau</a>,
1009
+ <a href="https://profiles.wordpress.org/tharsheblows">tharsheblows</a>,
1010
+ <a href="https://profiles.wordpress.org/thebrandonallen">thebrandonallen</a>,
1011
+ <a href="https://profiles.wordpress.org/tobyhawkins">tobyhawkins</a>,
1012
+ <a href="https://profiles.wordpress.org/tonyrix">tonyrix</a>,
1013
+ <a href="https://profiles.wordpress.org/treyhunner">treyhunner</a>,
1014
+ <a href="https://profiles.wordpress.org/tw2113">tw2113</a>,
1015
+ <a href="https://profiles.wordpress.org/xknown">xknown</a>
1016
  </p>
1017
 
1018
  <div class="return-to-dashboard">
1019
+ <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a>
1020
  </div>
1021
 
1022
  </div>
1029
  /**
1030
  * Update all bbPress forums across all sites
1031
  *
1032
+ * @since 2.1.0 bbPress (r3689)
 
 
 
 
1033
  */
1034
  public static function update_screen() {
1035
 
1037
  $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; ?>
1038
 
1039
  <div class="wrap">
1040
+ <h1><?php esc_html_e( 'Update Forum', 'bbpress' ); ?></h1>
 
1041
 
1042
  <?php
1043
 
1071
  /**
1072
  * Update all bbPress forums across all sites
1073
  *
1074
+ * @since 2.1.0 bbPress (r3689)
 
 
 
 
1075
  */
1076
  public static function network_update_screen() {
1077
+ $bbp_db = bbp_db();
1078
 
1079
  // Get action
1080
  $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; ?>
1081
 
1082
  <div class="wrap">
1083
+ <h1><?php esc_html_e( 'Update Forums', 'bbpress' ); ?></h1>
 
1084
 
1085
  <?php
1086
 
1092
  $n = isset( $_GET['n'] ) ? intval( $_GET['n'] ) : 0;
1093
 
1094
  // Get blogs 5 at a time
1095
+ $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 );
1096
 
1097
  // No blogs so all done!
1098
  if ( empty( $blogs ) ) : ?>
1109
 
1110
  <?php foreach ( (array) $blogs as $details ) :
1111
 
1112
+ // Get site URLs
1113
+ $site_url = get_site_url( $details['blog_id'] );
1114
+ $admin_url = get_site_url( $details['blog_id'], 'wp-admin.php', 'admin' );
1115
+ $remote_url = add_query_arg( array(
1116
+ 'page' => 'bbp-update',
1117
+ 'action' => 'bbp-update'
1118
+ ), $admin_url ); ?>
1119
 
1120
+ <li><?php echo esc_html( $site_url ); ?></li>
1121
 
1122
  <?php
1123
 
1124
  // Get the response of the bbPress update on this site
1125
  $response = wp_remote_get(
1126
+ $remote_url,
1127
+ array(
1128
+ 'timeout' => 30,
1129
+ 'httpversion' => '1.1'
1130
+ )
1131
  );
1132
 
1133
  // Site errored out, no response?
1134
+ if ( is_wp_error( $response ) ) {
1135
+ wp_die( sprintf( esc_html__( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s', 'bbpress' ), $site_url, '<em>' . $response->get_error_message() . '</em>' ) );
1136
+ }
1137
 
1138
  // Switch to the new blog
1139
  switch_to_blog( $details[ 'blog_id' ] );
1187
  }
1188
  }
1189
  endif; // class_exists check
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/classes/class-bbp-converter-base.php ADDED
@@ -0,0 +1,1209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress Converter Base Class
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
+ if ( ! class_exists( 'BBP_Converter_Base' ) ) :
16
+ /**
17
+ * Base class to be extended by specific individual importers
18
+ *
19
+ * @since 2.1.0 bbPress (r3813)
20
+ */
21
+ abstract class BBP_Converter_Base {
22
+
23
+ /**
24
+ * @var array() This is the field mapping array to process.
25
+ */
26
+ protected $field_map = array();
27
+
28
+ /**
29
+ * @var object This is the connection to the WordPress database.
30
+ */
31
+ protected $wpdb;
32
+
33
+ /**
34
+ * @var object This is the connection to the other platforms database.
35
+ */
36
+ protected $opdb;
37
+
38
+ /**
39
+ * @var int Maximum number of rows to convert at 1 time. Default 100.
40
+ */
41
+ protected $max_rows = 100;
42
+
43
+ /**
44
+ * @var array() Map of topic to forum. It is for optimization.
45
+ */
46
+ private $map_topicid_to_forumid = array();
47
+
48
+ /**
49
+ * @var array() Map of from old forum ids to new forum ids. It is for optimization.
50
+ */
51
+ private $map_forumid = array();
52
+
53
+ /**
54
+ * @var array() Map of from old topic ids to new topic ids. It is for optimization.
55
+ */
56
+ private $map_topicid = array();
57
+
58
+ /**
59
+ * @var array() Map of from old reply_to ids to new reply_to ids. It is for optimization.
60
+ */
61
+ private $map_reply_to = array();
62
+
63
+ /**
64
+ * @var array() Map of from old user ids to new user ids. It is for optimization.
65
+ */
66
+ private $map_userid = array();
67
+
68
+ /**
69
+ * @var str This is the charset for your wp database.
70
+ */
71
+ public $charset = '';
72
+
73
+ /**
74
+ * @var boolean Sync table available.
75
+ */
76
+ public $sync_table = false;
77
+
78
+ /**
79
+ * @var str Sync table name.
80
+ */
81
+ public $sync_table_name = '';
82
+
83
+ /**
84
+ * @var bool Whether users should be converted or not. Default false.
85
+ */
86
+ public $convert_users = false;
87
+
88
+ /**
89
+ * @var bool Whether to clean up any old converter data. Default false.
90
+ */
91
+ public $clean = false;
92
+
93
+ /**
94
+ * @var array Custom BBCode class properties in a key => value format
95
+ */
96
+ public $bbcode_parser_properties = array();
97
+
98
+ /** Methods ***************************************************************/
99
+
100
+ /**
101
+ * This is the constructor and it connects to the platform databases.
102
+ */
103
+ public function __construct() {
104
+ $this->init();
105
+ $this->setup_globals();
106
+ }
107
+
108
+ /**
109
+ * Initialize the converter
110
+ *
111
+ * @since 2.1.0
112
+ */
113
+ private function init() {
114
+
115
+ /** BBCode Parse Properties *******************************************/
116
+
117
+ // Setup smiley URL & path
118
+ $this->bbcode_parser_properties = array(
119
+ 'smiley_url' => includes_url( 'images/smilies' ),
120
+ 'smiley_dir' => '/' . WPINC . '/images/smilies'
121
+ );
122
+
123
+ /** Sanitize Options **************************************************/
124
+
125
+ $this->clean = ! empty( $_POST['_bbp_converter_clean'] );
126
+ $this->convert_users = (bool) get_option( '_bbp_converter_convert_users', false );
127
+ $this->halt = (bool) get_option( '_bbp_converter_halt', 0 );
128
+ $this->max_rows = (int) get_option( '_bbp_converter_rows', 100 );
129
+
130
+ /** Sanitize Connection ***********************************************/
131
+
132
+ $db_user = get_option( '_bbp_converter_db_user', DB_USER );
133
+ $db_pass = get_option( '_bbp_converter_db_pass', DB_PASSWORD );
134
+ $db_name = get_option( '_bbp_converter_db_name', DB_NAME );
135
+ $db_host = get_option( '_bbp_converter_db_server', DB_HOST );
136
+ $db_port = get_option( '_bbp_converter_db_port', '' );
137
+ $db_prefix = get_option( '_bbp_converter_db_prefix', '' );
138
+
139
+ // Maybe add port to server
140
+ if ( ! empty( $db_port ) && ! empty( $db_host ) && ! strstr( $db_host, ':' ) ) {
141
+ $db_host = $db_host . ':' . $db_port;
142
+ }
143
+
144
+ /** Get database connections ******************************************/
145
+
146
+ // Setup WordPress Database
147
+ $this->wpdb = bbp_db();
148
+
149
+ // Control WPDB db_connect() bailing
150
+ define( 'WP_SETUP_CONFIG', true );
151
+
152
+ // Setup old forum Database
153
+ $this->opdb = new wpdb( $db_user, $db_pass, $db_name, $db_host );
154
+
155
+ // Connection failed
156
+ if ( ! $this->opdb->db_connect( false ) ) {
157
+ $error = new WP_Error( 'bbp_converter_db_connection_failed', esc_html__( 'Database connection failed.', 'bbpress' ) );
158
+ wp_send_json_error( $error );
159
+ }
160
+
161
+ // Maybe setup the database prefix
162
+ $this->opdb->prefix = $db_prefix;
163
+
164
+ /**
165
+ * Don't wp_die() uncontrollably
166
+ */
167
+ $this->wpdb->show_errors( false );
168
+ $this->opdb->show_errors( false );
169
+
170
+ /**
171
+ * Syncing
172
+ */
173
+ $this->sync_table_name = $this->wpdb->prefix . 'bbp_converter_translator';
174
+ $this->sync_table = $this->sync_table_name === $this->wpdb->get_var( "SHOW TABLES LIKE '{$this->sync_table_name}'" )
175
+ ? true
176
+ : false;
177
+
178
+ /**
179
+ * Character set
180
+ */
181
+ $this->charset = ! empty( $this->wpdb->charset )
182
+ ? $this->wpdb->charset
183
+ : 'UTF8';
184
+
185
+ /**
186
+ * Default mapping.
187
+ */
188
+
189
+ /** Forum Section *****************************************************/
190
+
191
+ $this->field_map[] = array(
192
+ 'to_type' => 'forum',
193
+ 'to_fieldname' => 'post_status',
194
+ 'default' => 'publish'
195
+ );
196
+ $this->field_map[] = array(
197
+ 'to_type' => 'forum',
198
+ 'to_fieldname' => 'comment_status',
199
+ 'default' => 'closed'
200
+ );
201
+ $this->field_map[] = array(
202
+ 'to_type' => 'forum',
203
+ 'to_fieldname' => 'ping_status',
204
+ 'default' => 'closed'
205
+ );
206
+ $this->field_map[] = array(
207
+ 'to_type' => 'forum',
208
+ 'to_fieldname' => 'post_type',
209
+ 'default' => 'forum'
210
+ );
211
+
212
+ /** Topic Section *****************************************************/
213
+
214
+ $this->field_map[] = array(
215
+ 'to_type' => 'topic',
216
+ 'to_fieldname' => 'post_status',
217
+ 'default' => 'publish'
218
+ );
219
+ $this->field_map[] = array(
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'comment_status',
222
+ 'default' => 'closed'
223
+ );
224
+ $this->field_map[] = array(
225
+ 'to_type' => 'topic',
226
+ 'to_fieldname' => 'ping_status',
227
+ 'default' => 'closed'
228
+ );
229
+ $this->field_map[] = array(
230
+ 'to_type' => 'topic',
231
+ 'to_fieldname' => 'post_type',
232
+ 'default' => 'topic'
233
+ );
234
+
235
+ /** Post Section ******************************************************/
236
+
237
+ $this->field_map[] = array(
238
+ 'to_type' => 'reply',
239
+ 'to_fieldname' => 'post_status',
240
+ 'default' => 'publish'
241
+ );
242
+ $this->field_map[] = array(
243
+ 'to_type' => 'reply',
244
+ 'to_fieldname' => 'comment_status',
245
+ 'default' => 'closed'
246
+ );
247
+ $this->field_map[] = array(
248
+ 'to_type' => 'reply',
249
+ 'to_fieldname' => 'ping_status',
250
+ 'default' => 'closed'
251
+ );
252
+ $this->field_map[] = array(
253
+ 'to_type' => 'reply',
254
+ 'to_fieldname' => 'post_type',
255
+ 'default' => 'reply'
256
+ );
257
+
258
+ /** User Section ******************************************************/
259
+
260
+ $this->field_map[] = array(
261
+ 'to_type' => 'user',
262
+ 'to_fieldname' => 'role',
263
+ 'default' => get_option( 'default_role' )
264
+ );
265
+ }
266
+
267
+ /**
268
+ * Setup global values
269
+ */
270
+ public function setup_globals() {}
271
+
272
+ /**
273
+ * Convert Forums
274
+ */
275
+ public function convert_forums( $start = 1 ) {
276
+ return $this->convert_table( 'forum', $start );
277
+ }
278
+
279
+ /**
280
+ * Convert Topics / Threads
281
+ */
282
+ public function convert_topics( $start = 1 ) {
283
+ return $this->convert_table( 'topic', $start );
284
+ }
285
+
286
+ /**
287
+ * Convert Posts
288
+ */
289
+ public function convert_replies( $start = 1 ) {
290
+ return $this->convert_table( 'reply', $start );
291
+ }
292
+
293
+ /**
294
+ * Convert Users
295
+ */
296
+ public function convert_users( $start = 1 ) {
297
+ return $this->convert_table( 'user', $start );
298
+ }
299
+
300
+ /**
301
+ * Convert Topic Tags
302
+ */
303
+ public function convert_tags( $start = 1 ) {
304
+ return $this->convert_table( 'tags', $start );
305
+ }
306
+
307
+ /**
308
+ * Convert Forum Subscriptions
309
+ */
310
+ public function convert_forum_subscriptions( $start = 1 ) {
311
+ return $this->convert_table( 'forum_subscriptions', $start );
312
+ }
313
+
314
+ /**
315
+ * Convert Topic Subscriptions
316
+ */
317
+ public function convert_topic_subscriptions( $start = 1 ) {
318
+ return $this->convert_table( 'topic_subscriptions', $start );
319
+ }
320
+
321
+ /**
322
+ * Convert Favorites
323
+ */
324
+ public function convert_favorites( $start = 1 ) {
325
+ return $this->convert_table( 'favorites', $start );
326
+ }
327
+
328
+ /**
329
+ * Convert Table
330
+ *
331
+ * @param string to type
332
+ * @param int Start row
333
+ */
334
+ public function convert_table( $to_type, $start ) {
335
+
336
+ // Set some defaults
337
+ $has_insert = false;
338
+ $from_tablename = '';
339
+ $field_list = $from_tables = $tablefield_array = array();
340
+
341
+ // Toggle Table Name based on $to_type (destination)
342
+ switch ( $to_type ) {
343
+ case 'user' :
344
+ $tablename = $this->wpdb->users;
345
+ break;
346
+
347
+ case 'tags' :
348
+ $tablename = '';
349
+ break;
350
+
351
+ case 'forum_subscriptions' :
352
+ $tablename = $this->wpdb->postmeta;
353
+ break;
354
+
355
+ case 'topic_subscriptions' :
356
+ $tablename = $this->wpdb->postmeta;
357
+ break;
358
+
359
+ case 'favorites' :
360
+ $tablename = $this->wpdb->postmeta;
361
+ break;
362
+
363
+ default :
364
+ $tablename = $this->wpdb->posts;
365
+ }
366
+
367
+ // Get the fields from the destination table
368
+ if ( ! empty( $tablename ) ) {
369
+ $tablefield_array = $this->get_fields( $tablename );
370
+ }
371
+
372
+ /** Step 1 ************************************************************/
373
+
374
+ // Loop through the field maps, and look for to_type matches
375
+ foreach ( $this->field_map as $item ) {
376
+
377
+ // Yay a match, and we have a from table, too
378
+ if ( ( $item['to_type'] === $to_type ) && ! empty( $item['from_tablename'] ) ) {
379
+
380
+ // $from_tablename was set from a previous loop iteration
381
+ if ( ! empty( $from_tablename ) ) {
382
+
383
+ // Doing some joining
384
+ if ( ! in_array( $item['from_tablename'], $from_tables, true ) && in_array( $item['join_tablename'], $from_tables, true ) ) {
385
+ $from_tablename .= ' ' . $item['join_type'] . ' JOIN ' . $this->opdb->prefix . $item['from_tablename'] . ' AS ' . $item['from_tablename'] . ' ' . $item['join_expression'];
386
+ }
387
+
388
+ // $from_tablename needs to be set
389
+ } else {
390
+ $from_tablename = $item['from_tablename'] . ' AS ' . $item['from_tablename'];
391
+ }
392
+
393
+ // Specific FROM expression data used
394
+ if ( ! empty( $item['from_expression'] ) ) {
395
+
396
+ // No 'WHERE' in expression
397
+ if ( stripos( $from_tablename, "WHERE" ) === false ) {
398
+ $from_tablename .= ' ' . $item['from_expression'];
399
+
400
+ // 'WHERE' in expression, so replace with 'AND'
401
+ } else {
402
+ $from_tablename .= ' ' . str_replace( "WHERE", "AND", $item['from_expression'] );
403
+ }
404
+ }
405
+
406
+ // Add tablename and fieldname to arrays, formatted for querying
407
+ $from_tables[] = $item['from_tablename'];
408
+ $field_list[] = 'convert(' . $item['from_tablename'] . '.' . $item['from_fieldname'] . ' USING "' . $this->charset . '") AS ' . $item['from_fieldname'];
409
+ }
410
+ }
411
+
412
+ /** Step 2 ************************************************************/
413
+
414
+ // We have a $from_tablename, so we want to get some data to convert
415
+ if ( ! empty( $from_tablename ) ) {
416
+
417
+ // Update rows
418
+ $this->count_rows_by_table( "{$this->opdb->prefix}{$from_tablename}" );
419
+
420
+ // Get some data from the old forums
421
+ $field_list = array_unique( $field_list );
422
+ $fields = implode( ',', $field_list );
423
+ $forum_query = "SELECT {$fields} FROM {$this->opdb->prefix}{$from_tablename} LIMIT {$start}, {$this->max_rows}";
424
+
425
+ // Set this query as the last one ran
426
+ $this->update_query( $forum_query );
427
+
428
+ // Get results as an array
429
+ $forum_array = $this->opdb->get_results( $forum_query, ARRAY_A );
430
+
431
+ // Query returned some results
432
+ if ( ! empty( $forum_array ) ) {
433
+
434
+ // Loop through results
435
+ foreach ( (array) $forum_array as $forum ) {
436
+
437
+ // Reset some defaults
438
+ $insert_post = $insert_postmeta = $insert_data = array();
439
+
440
+ // Loop through field map, again...
441
+ foreach ( $this->field_map as $row ) {
442
+
443
+ // Types match and to_fieldname is present. This means
444
+ // we have some work to do here.
445
+ if ( ( $row['to_type'] === $to_type ) && isset( $row['to_fieldname'] ) ) {
446
+
447
+ // This row has a destination that matches one of the
448
+ // columns in this table.
449
+ if ( in_array( $row['to_fieldname'], $tablefield_array, true ) ) {
450
+
451
+ // Allows us to set default fields.
452
+ if ( isset( $row['default'] ) ) {
453
+ $insert_post[ $row['to_fieldname'] ] = $row['default'];
454
+
455
+ // Translates a field from the old forum.
456
+ } elseif ( isset( $row['callback_method'] ) ) {
457
+ if ( ( 'callback_userid' === $row['callback_method'] ) && ( false === $this->convert_users ) ) {
458
+ $insert_post[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
459
+ } else {
460
+ $insert_post[ $row['to_fieldname'] ] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[ $row['from_fieldname'] ], $forum ) );
461
+ }
462
+
463
+ // Maps the field from the old forum.
464
+ } else {
465
+ $insert_post[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
466
+ }
467
+
468
+ // Destination field is not empty, so we might need
469
+ // to do some extra work or set a default.
470
+ } elseif ( ! empty( $row['to_fieldname'] ) ) {
471
+
472
+ // Allows us to set default fields.
473
+ if ( isset( $row['default'] ) ) {
474
+ $insert_postmeta[ $row['to_fieldname'] ] = $row['default'];
475
+
476
+ // Translates a field from the old forum.
477
+ } elseif ( isset( $row['callback_method'] ) ) {
478
+ if ( ( $row['callback_method'] === 'callback_userid' ) && ( false === $this->convert_users ) ) {
479
+ $insert_postmeta[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
480
+ } else {
481
+ $insert_postmeta[ $row['to_fieldname'] ] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[ $row['from_fieldname'] ], $forum ) );
482
+ }
483
+
484
+ // Maps the field from the old forum.
485
+ } else {
486
+ $insert_postmeta[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
487
+ }
488
+ }
489
+ }
490
+ }
491
+
492
+ /** Step 3 ************************************************/
493
+
494
+ // Something to insert into the destination field
495
+ if ( count( $insert_post ) > 0 || ( $to_type == 'tags' && count( $insert_postmeta ) > 0 ) ) {
496
+
497
+ switch ( $to_type ) {
498
+
499
+ /** New user **************************************/
500
+
501
+ case 'user':
502
+ if ( username_exists( $insert_post['user_login'] ) ) {
503
+ $insert_post['user_login'] = 'imported_' . $insert_post['user_login'];
504
+ }
505
+
506
+ if ( email_exists( $insert_post['user_email'] ) ) {
507
+ $insert_post['user_email'] = 'imported_' . $insert_post['user_email'];
508
+ }
509
+
510
+ if ( empty( $insert_post['user_pass'] ) ) {
511
+ $insert_post['user_pass'] = '';
512
+ }
513
+
514
+ $post_id = wp_insert_user( $insert_post );
515
+
516
+ if ( is_numeric( $post_id ) ) {
517
+
518
+ foreach ( $insert_postmeta as $key => $value ) {
519
+
520
+ add_user_meta( $post_id, $key, $value, true );
521
+
522
+ if ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
523
+ $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'user', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
524
+ }
525
+ }
526
+ }
527
+ break;
528
+
529
+ /** New Topic-Tag *********************************/
530
+
531
+ case 'tags':
532
+ $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
533
+ $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
534
+ if ( false !== $term ) {
535
+ wp_update_term( $term->term_id, 'topic-tag', array(
536
+ 'description' => $insert_postmeta['description'],
537
+ 'slug' => $insert_postmeta['slug']
538
+ ) );
539
+ }
540
+ break;
541
+
542
+ /** Forum Subscriptions ***************************/
543
+
544
+ case 'forum_subscriptions':
545
+ $user_id = $insert_post['user_id'];
546
+ $items = wp_list_pluck( $insert_postmeta, '_bbp_forum_subscriptions' );
547
+ if ( is_numeric( $user_id ) && ! empty( $items ) ) {
548
+ foreach ( $items as $value ) {
549
+
550
+ // Maybe string with commas
551
+ $value = is_string( $value )
552
+ ? explode( ',', $value )
553
+ : (array) $value;
554
+
555
+ // Add user ID to forums subscribed users
556
+ foreach ( $value as $fav ) {
557
+ bbp_add_user_subscription( $user_id, $this->callback_forumid( $fav ) );
558
+ }
559
+ }
560
+ }
561
+ break;
562
+
563
+ /** Subscriptions *********************************/
564
+
565
+ case 'topic_subscriptions':
566
+ $user_id = $insert_post['user_id'];
567
+ $items = wp_list_pluck( $insert_postmeta, '_bbp_subscriptions' );
568
+ if ( is_numeric( $user_id ) && ! empty( $items ) ) {
569
+ foreach ( $items as $value ) {
570
+
571
+ // Maybe string with commas
572
+ $value = is_string( $value )
573
+ ? explode( ',', $value )
574
+ : (array) $value;
575
+
576
+ // Add user ID to topics subscribed users
577
+ foreach ( $value as $fav ) {
578
+ bbp_add_user_subscription( $user_id, $this->callback_topicid( $fav ) );
579
+ }
580
+ }
581
+ }
582
+ break;
583
+
584
+ /** Favorites *************************************/
585
+
586
+ case 'favorites':
587
+ $user_id = $insert_post['user_id'];
588
+ $items = wp_list_pluck( $insert_postmeta, '_bbp_favorites' );
589
+ if ( is_numeric( $user_id ) && ! empty( $items ) ) {
590
+ foreach ( $items as $value ) {
591
+
592
+ // Maybe string with commas
593
+ $value = is_string( $value )
594
+ ? explode( ',', $value )
595
+ : (array) $value;
596
+
597
+ // Add user ID to topics favorited users
598
+ foreach ( $value as $fav ) {
599
+ bbp_add_user_favorite( $user_id, $this->callback_topicid( $fav ) );
600
+ }
601
+ }
602
+ }
603
+ break;
604
+
605
+ /** Forum, Topic, Reply ***************************/
606
+
607
+ default:
608
+ $post_id = wp_insert_post( $insert_post, true );
609
+
610
+ if ( is_numeric( $post_id ) ) {
611
+
612
+ foreach ( $insert_postmeta as $key => $value ) {
613
+
614
+ add_post_meta( $post_id, $key, $value, true );
615
+
616
+ /**
617
+ * If we are using the sync_table add
618
+ * the meta '_id' keys to the table
619
+ *
620
+ * Forums: _bbp_old_forum_id // The old forum ID
621
+ * _bbp_old_forum_parent_id // The old forum parent ID
622
+ *
623
+ * Topics: _bbp_forum_id // The new forum ID
624
+ * _bbp_old_topic_id // The old topic ID
625
+ * _bbp_old_closed_status_id // The old topic open/closed status
626
+ * _bbp_old_sticky_status_id // The old topic sticky status
627
+ *
628
+ * Replies: _bbp_forum_id // The new forum ID
629
+ * _bbp_topic_id // The new topic ID
630
+ * _bbp_old_reply_id // The old reply ID
631
+ * _bbp_old_reply_to_id // The old reply to ID
632
+ */
633
+ if ( '_id' === substr( $key, -3 ) && ( true === $this->sync_table ) ) {
634
+ $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
635
+ }
636
+
637
+ /**
638
+ * Replies need to save their old reply_to ID for
639
+ * hierarchical replies association. Later we update
640
+ * the _bbp_reply_to value with the new bbPress
641
+ * value using convert_reply_to_parents()
642
+ */
643
+ if ( ( 'reply' === $to_type ) && ( '_bbp_old_reply_to_id' === $key ) ) {
644
+ add_post_meta( $post_id, '_bbp_reply_to', $value );
645
+ }
646
+ }
647
+ }
648
+ break;
649
+ }
650
+ $has_insert = true;
651
+ }
652
+ }
653
+ }
654
+ }
655
+
656
+ return ! $has_insert;
657
+ }
658
+
659
+ /**
660
+ * This method converts old forum hierarchy to new bbPress hierarchy.
661
+ */
662
+ public function convert_forum_parents( $start = 1 ) {
663
+ $has_update = false;
664
+ $query = ! empty( $this->sync_table )
665
+ ? $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' )
666
+ : $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' );
667
+
668
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
669
+ $parent_id = $this->callback_forumid( $row->meta_value );
670
+ $this->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->posts} SET post_parent = %d WHERE ID = %d LIMIT 1", $parent_id, $row->value_id ) );
671
+ $has_update = true;
672
+ }
673
+
674
+ return ! $has_update;
675
+ }
676
+
677
+ /**
678
+ * This method converts old topic stickies to new bbPress stickies.
679
+ *
680
+ * @since 2.5.0 bbPress (r5170)
681
+ */
682
+ public function convert_topic_stickies( $start = 1 ) {
683
+ $has_update = false;
684
+ $query = ! empty( $this->sync_table )
685
+ ? $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' )
686
+ : $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' );
687
+
688
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
689
+ bbp_stick_topic( $row->value_id );
690
+ $has_update = true;
691
+ }
692
+
693
+ return ! $has_update;
694
+ }
695
+
696
+ /**
697
+ * This method converts old topic super stickies to new bbPress super stickies.
698
+ *
699
+ * @since 2.5.0 bbPress (r5170)
700
+ */
701
+ public function convert_topic_super_stickies( $start = 1 ) {
702
+ $has_update = false;
703
+ $query = ! empty( $this->sync_table )
704
+ ? $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' )
705
+ : $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' );
706
+
707
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
708
+ $super = true;
709
+ bbp_stick_topic( $row->value_id, $super );
710
+ $has_update = true;
711
+ }
712
+
713
+ return ! $has_update;
714
+ }
715
+
716
+ /**
717
+ * This method converts old closed topics to bbPress closed topics.
718
+ *
719
+ * @since 2.6.0 bbPress (r5425)
720
+ */
721
+ public function convert_topic_closed_topics( $start = 1 ) {
722
+ $has_update = false;
723
+ $query = ! empty( $this->sync_table )
724
+ ? $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' )
725
+ : $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' );
726
+
727
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
728
+ bbp_close_topic( $row->value_id );
729
+ $has_update = true;
730
+ }
731
+
732
+ return ! $has_update;
733
+ }
734
+
735
+ /**
736
+ * This method converts old reply_to post id to new bbPress reply_to post id.
737
+ *
738
+ * @since 2.4.0 bbPress (r5093)
739
+ */
740
+ public function convert_reply_to_parents( $start = 1 ) {
741
+ $has_update = false;
742
+ $query = ! empty( $this->sync_table )
743
+ ? $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' )
744
+ : $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' );
745
+
746
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
747
+ $reply_to = $this->callback_reply_to( $row->meta_value );
748
+ $this->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 ) );
749
+ $has_update = true;
750
+ }
751
+
752
+ return ! $has_update;
753
+ }
754
+
755
+ /**
756
+ * This method converts anonymous topics.
757
+ *
758
+ * @since 2.6.0 bbPress (r5538)
759
+ */
760
+ public function convert_anonymous_topic_authors( $start = 1 ) {
761
+
762
+ $has_update = false;
763
+
764
+ if ( ! empty( $this->sync_table ) ) {
765
+ $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
766
+ FROM {$this->sync_table_name} AS sync_table1
767
+ INNER JOIN {$this->sync_table_name} AS sync_table2
768
+ ON ( sync_table1.value_id = sync_table2.value_id )
769
+ WHERE sync_table1.meta_value = %s
770
+ AND sync_table2.meta_key = %s
771
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_topic_author_name_id' );
772
+ } else {
773
+ $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
774
+ FROM {$this->wpdb->postmeta} AS wp_postmeta1
775
+ INNER JOIN {$this->wpdb->postmeta} AS wp_postmeta2
776
+ ON ( wp_postmeta1.post_id = wp_postmeta2.post_id )
777
+ WHERE wp_postmeta1.meta_value = %s
778
+ AND wp_postmeta2.meta_key = %s
779
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_topic_author_name_id' );
780
+ }
781
+
782
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
783
+ $anonymous_topic_author_id = 0;
784
+ $this->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->posts} SET post_author = %d WHERE ID = %d LIMIT 1", $anonymous_topic_author_id, $row->topic_id ) );
785
+
786
+ add_post_meta( $row->topic_id, '_bbp_anonymous_name', $row->topic_author );
787
+
788
+ $has_update = true;
789
+ }
790
+
791
+ return ! $has_update;
792
+ }
793
+
794
+ /**
795
+ * This method converts anonymous replies.
796
+ *
797
+ * @since 2.6.0 bbPress (r5538)
798
+ */
799
+ public function convert_anonymous_reply_authors( $start = 1 ) {
800
+
801
+ $has_update = false;
802
+
803
+ if ( ! empty( $this->sync_table ) ) {
804
+ $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
805
+ FROM {$this->sync_table_name} AS sync_table1
806
+ INNER JOIN {$this->sync_table_name} AS sync_table2
807
+ ON ( sync_table1.value_id = sync_table2.value_id )
808
+ WHERE sync_table1.meta_value = %s
809
+ AND sync_table2.meta_key = %s
810
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_reply_author_name_id' );
811
+ } else {
812
+ $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
813
+ FROM {$this->wpdb->postmeta} AS wp_postmeta1
814
+ INNER JOIN {$this->wpdb->postmeta} AS wp_postmeta2
815
+ ON ( wp_postmeta1.post_id = wp_postmeta2.post_id )
816
+ WHERE wp_postmeta1.meta_value = %s
817
+ AND wp_postmeta2.meta_key = %s
818
+ LIMIT {$start}, {$this->max_rows}", 'true', '_bbp_old_reply_author_name_id' );
819
+ }
820
+
821
+ foreach ( $this->count_rows_by_results( $query ) as $row ) {
822
+ $anonymous_reply_author_id = 0;
823
+ $this->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->posts} SET post_author = %d WHERE ID = %d LIMIT 1", $anonymous_reply_author_id, $row->reply_id ) );
824
+
825
+ add_post_meta( $row->reply_id, '_bbp_anonymous_name', $row->reply_author );
826
+
827
+ $has_update = true;
828
+ }
829
+
830
+ return ! $has_update;
831
+ }
832
+
833
+ /**
834
+ * This method deletes data from the wp database.
835
+ */
836
+ public function clean( $start = 1 ) {
837
+
838
+ // Defaults
839
+ $has_delete = false;
840
+
841
+ /** Delete topics/forums/posts ****************************************/
842
+
843
+ $query = ! empty( $this->sync_table )
844
+ ? $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' )
845
+ : $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key LIKE %s GROUP BY post_id ORDER BY post_id DESC LIMIT {$this->max_rows}", $this->wpdb->esc_like( '_bbp_' ) . '%' );
846
+
847
+ $posts = $this->get_results( $query, ARRAY_A );
848
+
849
+ if ( isset( $posts[0] ) && ! empty( $posts[0]['value_id'] ) ) {
850
+ foreach ( (array) $posts as $value ) {
851
+ $deleted = wp_delete_post( $value['value_id'], true );
852
+
853
+ // Only flag if not empty or error
854
+ if ( ( false === $has_delete ) && ! empty( $deleted ) && ! is_wp_error( $deleted ) ) {
855
+ $has_delete = true;
856
+ }
857
+ }
858
+ }
859
+
860
+ /** Delete users ******************************************************/
861
+
862
+ $query = ! empty( $this->sync_table )
863
+ ? $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' )
864
+ : $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' );
865
+
866
+ $users = $this->get_results( $query, ARRAY_A );
867
+
868
+ if ( ! empty( $users ) ) {
869
+ foreach ( $users as $value ) {
870
+ $deleted = wp_delete_user( $value['value_id'] );
871
+
872
+ // Only flag if not empty or error
873
+ if ( ( false === $has_delete ) && ! empty( $deleted ) && ! is_wp_error( $deleted ) ) {
874
+ $has_delete = true;
875
+ }
876
+ }
877
+ }
878
+
879
+ unset( $posts );
880
+ unset( $users );
881
+
882
+ return ! $has_delete;
883
+ }
884
+
885
+ /**
886
+ * This method deletes passwords from the wp database.
887
+ *
888
+ * @param int Start row
889
+ */
890
+ public function clean_passwords( $start = 1 ) {
891
+ $has_delete = false;
892
+ $query = $this->wpdb->prepare( "SELECT user_id, meta_value FROM {$this->wpdb->usermeta} WHERE meta_key = %s LIMIT {$start}, {$this->max_rows}", '_bbp_password' );
893
+ $converted = $this->get_results( $query, ARRAY_A );
894
+
895
+ if ( ! empty( $converted ) ) {
896
+ foreach ( $converted as $value ) {
897
+ if ( is_serialized( $value['meta_value'] ) ) {
898
+ $this->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->users} SET user_pass = '' WHERE ID = %d", $value['user_id'] ) );
899
+ } else {
900
+ $this->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->users} SET user_pass = %s WHERE ID = %d", $value['meta_value'], $value['user_id'] ) );
901
+ $this->query( $this->wpdb->prepare( "DELETE FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND user_id = %d", '_bbp_password', $value['user_id'] ) );
902
+ }
903
+ }
904
+ $has_delete = true;
905
+ }
906
+
907
+ return ! $has_delete;
908
+ }
909
+
910
+ /**
911
+ * This method implements the authentication for the different forums.
912
+ *
913
+ * @param string Un-encoded password.
914
+ */
915
+ abstract protected function authenticate_pass( $password, $hash );
916
+
917
+ /**
918
+ * Info
919
+ */
920
+ abstract protected function info();
921
+
922
+ /**
923
+ * This method grabs appropriate fields from the table specified
924
+ *
925
+ * @param string The table name to grab fields from
926
+ */
927
+ private function get_fields( $tablename ) {
928
+ $rval = array();
929
+ $field_array = $this->get_results( 'DESCRIBE ' . $tablename, ARRAY_A );
930
+
931
+ foreach ( $field_array as $field ) {
932
+ $rval[] = $field['Field'];
933
+ }
934
+
935
+ if ( $tablename === $this->wpdb->users ) {
936
+ $rval[] = 'role';
937
+ $rval[] = 'yim';
938
+ $rval[] = 'aim';
939
+ $rval[] = 'jabber';
940
+ }
941
+
942
+ return $rval;
943
+ }
944
+
945
+ /** Database Wrappers *****************************************************/
946
+
947
+ /**
948
+ * Update the last query option and return results
949
+ *
950
+ * @param string $query
951
+ * @param string $output
952
+ */
953
+ private function get_row( $query = '' ) {
954
+ $this->update_query( $query );
955
+
956
+ return $this->wpdb->get_row( $query );
957
+ }
958
+
959
+ /**
960
+ * Update the last query option and return results
961
+ *
962
+ * @param string $query
963
+ * @param string $output
964
+ */
965
+ private function get_results( $query = '', $output = OBJECT ) {
966
+ $this->update_query( $query );
967
+
968
+ return (array) $this->wpdb->get_results( $query, $output );
969
+ }
970
+
971
+ /**
972
+ * Update the last query option and do a general query
973
+ *
974
+ * @param string $query
975
+ */
976
+ private function query( $query = '' ) {
977
+ $this->update_query( $query );
978
+
979
+ return $this->wpdb->query( $query );
980
+ }
981
+
982
+ /**
983
+ * Update the last query ran
984
+ *
985
+ * @since 2.6.0 bbPress (r6637)
986
+ *
987
+ * @param string $query The literal MySQL query
988
+ * @return bool
989
+ */
990
+ private function update_query( $query = '' ) {
991
+ return update_option( '_bbp_converter_query', $query );
992
+ }
993
+
994
+ /**
995
+ * Update the number of rows in the current step
996
+ *
997
+ * @since 2.6.0 bbPress (r6637)
998
+ *
999
+ * @param string $query The literal MySQL query
1000
+ * @return bool
1001
+ */
1002
+ private function count_rows_by_results( $query = '' ) {
1003
+ $results = $this->get_results( $query );
1004
+
1005
+ update_option( '_bbp_converter_rows_in_step', count( $results ) );
1006
+
1007
+ return $results;
1008
+ }
1009
+
1010
+ /**
1011
+ * Update the number of rows in the current step
1012
+ *
1013
+ * @since 2.6.0 bbPress (r6637)
1014
+ *
1015
+ * @param string $table_name The literal MySQL query
1016
+ * @return bool
1017
+ */
1018
+ private function count_rows_by_table( $table_name = '' ) {
1019
+ $count = (int) $this->opdb->get_var( "SELECT COUNT(*) FROM {$table_name}" );
1020
+
1021
+ return update_option( '_bbp_converter_rows_in_step', $count );
1022
+ }
1023
+
1024
+ /** Callbacks *************************************************************/
1025
+
1026
+ /**
1027
+ * Run password through wp_hash_password()
1028
+ *
1029
+ * @param string $username
1030
+ * @param string $password
1031
+ */
1032
+ public function callback_pass( $username, $password ) {
1033
+ $user = $this->get_row( $this->wpdb->prepare( "SELECT * FROM {$this->wpdb->users} WHERE user_login = %s AND user_pass = '' LIMIT 1", $username ) );
1034
+ if ( ! empty( $user ) ) {
1035
+ $usermeta = $this->get_row( $this->wpdb->prepare( "SELECT * FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND user_id = %d LIMIT 1", '_bbp_password', $user->ID ) );
1036
+
1037
+ if ( ! empty( $usermeta ) ) {
1038
+ if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
1039
+ $this->query( $this->wpdb->prepare( "UPDATE {$this->wpdb->users} SET user_pass = %s WHERE ID = %d", wp_hash_password( $password ), $user->ID ) );
1040
+ $this->query( $this->wpdb->prepare( "DELETE FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND user_id = %d", '_bbp_password', $user->ID ) );
1041
+
1042
+ // Clean the cache for this user since their password was
1043
+ // upgraded from the old platform to the new.
1044
+ clean_user_cache( $user->ID );
1045
+ }
1046
+ }
1047
+ }
1048
+ }
1049
+
1050
+ /**
1051
+ * A mini cache system to reduce database calls to forum ID's
1052
+ *
1053
+ * @param string $field
1054
+ * @return string
1055
+ */
1056
+ private function callback_forumid( $field ) {
1057
+ if ( ! isset( $this->map_forumid[ $field ] ) ) {
1058
+ $row = ! empty( $this->sync_table )
1059
+ ? $this->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 ) )
1060
+ : $this->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 ) );
1061
+
1062
+ $this->map_forumid[ $field ] = ! is_null( $row )
1063
+ ? $row->value_id
1064
+ : 0;
1065
+ }
1066
+
1067
+ return $this->map_forumid[ $field ];
1068
+ }
1069
+
1070
+ /**
1071
+ * A mini cache system to reduce database calls to topic ID's
1072
+ *
1073
+ * @param string $field
1074
+ * @return string
1075
+ */
1076
+ private function callback_topicid( $field ) {
1077
+ if ( ! isset( $this->map_topicid[ $field ] ) ) {
1078
+ $row = ! empty( $this->sync_table )
1079
+ ? $this->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 ) )
1080
+ : $this->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 ) );
1081
+
1082
+ $this->map_topicid[ $field ] = ! is_null( $row )
1083
+ ? $row->value_id
1084
+ : 0;
1085
+ }
1086
+
1087
+ return $this->map_topicid[ $field ];
1088
+ }
1089
+
1090
+ /**
1091
+ * A mini cache system to reduce database calls to reply_to post id.
1092
+ *
1093
+ * @since 2.4.0 bbPress (r5093)
1094
+ *
1095
+ * @param string $field
1096
+ * @return string
1097
+ */
1098
+ private function callback_reply_to( $field ) {
1099
+ if ( ! isset( $this->map_reply_to[ $field ] ) ) {
1100
+ $row = ! empty( $this->sync_table )
1101
+ ? $this->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 ) )
1102
+ : $this->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 ) );
1103
+
1104
+ $this->map_reply_to[ $field ] = ! is_null( $row )
1105
+ ? $row->value_id
1106
+ : 0;
1107
+ }
1108
+
1109
+ return $this->map_reply_to[ $field ];
1110
+ }
1111
+
1112
+ /**
1113
+ * A mini cache system to reduce database calls to user ID's
1114
+ *
1115
+ * @param string $field
1116
+ * @return string
1117
+ */
1118
+ private function callback_userid( $field ) {
1119
+ if ( ! isset( $this->map_userid[ $field ] ) ) {
1120
+ $row = ! empty( $this->sync_table )
1121
+ ? $this->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 ) )
1122
+ : $this->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 ) );
1123
+
1124
+ if ( ! is_null( $row ) ) {
1125
+ $this->map_userid[ $field ] = $row->value_id;
1126
+ } else {
1127
+ $this->map_userid[ $field ] = ( true === $this->convert_users )
1128
+ ? 0
1129
+ : $field;
1130
+ }
1131
+ }
1132
+
1133
+ return $this->map_userid[ $field ];
1134
+ }
1135
+
1136
+ /**
1137
+ * Check if the topic or reply author is anonymous
1138
+ *
1139
+ * @since 2.6.0 bbPress (r5544)
1140
+ *
1141
+ * @param string $field
1142
+ * @return string
1143
+ */
1144
+ private function callback_check_anonymous( $field ) {
1145
+ $field = ( $this->callback_userid( $field ) == 0 )
1146
+ ? 'true'
1147
+ : 'false';
1148
+
1149
+ return $field;
1150
+ }
1151
+
1152
+ /**
1153
+ * A mini cache system to reduce database calls map topics ID's to forum ID's
1154
+ *
1155
+ * @param string $field
1156
+ * @return string
1157
+ */
1158
+ private function callback_topicid_to_forumid( $field ) {
1159
+ $topicid = $this->callback_topicid( $field );
1160
+ if ( empty( $topicid ) ) {
1161
+ $this->map_topicid_to_forumid[ $topicid ] = 0;
1162
+ } elseif ( ! isset( $this->map_topicid_to_forumid[ $topicid ] ) ) {
1163
+ $row = $this->get_row( $this->wpdb->prepare( "SELECT post_parent FROM {$this->wpdb->posts} WHERE ID = %d LIMIT 1", $topicid ) );
1164
+
1165
+ $this->map_topicid_to_forumid[ $topicid ] = ! is_null( $row )
1166
+ ? $row->post_parent
1167
+ : 0;
1168
+ }
1169
+
1170
+ return $this->map_topicid_to_forumid[ $topicid ];
1171
+ }
1172
+
1173
+ protected function callback_slug( $field ) {
1174
+ return sanitize_title( $field );
1175
+ }
1176
+
1177
+ protected function callback_negative( $field ) {
1178
+ return ( $field < 0 )
1179
+ ? 0
1180
+ : $field;
1181
+ }
1182
+
1183
+ protected function callback_html( $field ) {
1184
+ require_once bbpress()->admin->admin_dir . 'parser.php';
1185
+
1186
+ // Setup the BBCode parser
1187
+ $bbcode = BBCode::getInstance();
1188
+
1189
+ // Pass BBCode properties to the parser
1190
+ foreach ( $this->bbcode_parser_properties as $prop => $value ) {
1191
+ $bbcode->{$prop} = $value;
1192
+ }
1193
+
1194
+ return html_entity_decode( $bbcode->Parse( $field ) );
1195
+ }
1196
+
1197
+ protected function callback_null( $field ) {
1198
+ return is_null( $field )
1199
+ ? ''
1200
+ : $field;
1201
+ }
1202
+
1203
+ protected function callback_datetime( $field ) {
1204
+ return is_numeric( $field )
1205
+ ? date( 'Y-m-d H:i:s', $field )
1206
+ : date( 'Y-m-d H:i:s', strtotime( $field ) );
1207
+ }
1208
+ }
1209
+ endif;
includes/admin/classes/class-bbp-converter.php ADDED
@@ -0,0 +1,845 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ if ( ! class_exists( 'BBP_Converter' ) ) :
16
+ /**
17
+ * Main BBP_Converter Class
18
+ */
19
+ class BBP_Converter {
20
+
21
+ /**
22
+ * @var int Number of rows
23
+ */
24
+ public $max = 0;
25
+
26
+ /**
27
+ * @var int Start
28
+ */
29
+ public $start = 0;
30
+
31
+ /**
32
+ * @var int Step in converter process
33
+ */
34
+ public $step = 0;
35
+
36
+ /**
37
+ * @var int Number of rows
38
+ */
39
+ public $rows = 0;
40
+
41
+ /**
42
+ * @var int Maximum number of converter steps
43
+ */
44
+ public $max_steps = 17;
45
+
46
+ /**
47
+ * @var int Number of rows in the current step
48
+ */
49
+ public $rows_in_step = 0;
50
+
51
+ /**
52
+ * @var int Percent complete of current step
53
+ */
54
+ public $step_percentage = 0;
55
+
56
+ /**
57
+ * @var int Percent complete of all step
58
+ */
59
+ public $total_percentage = 0;
60
+
61
+ /**
62
+ * @var int Name of source forum platform
63
+ */
64
+ public $platform = '';
65
+
66
+ /**
67
+ * @var BBP_Converter_Base Type of converter to use
68
+ */
69
+ public $converter = null;
70
+
71
+ /**
72
+ * @var string Path to included platforms
73
+ */
74
+ public $converters_dir = '';
75
+
76
+ /**
77
+ * @var array Map of steps to methods
78
+ */
79
+ private $steps = array(
80
+ 1 => 'sync_table',
81
+ 2 => 'users',
82
+ 3 => 'passwords',
83
+ 4 => 'forums',
84
+ 5 => 'forum_hierarchy',
85
+ 6 => 'forum_subscriptions',
86
+ 7 => 'topics',
87
+ 8 => 'topics_authors',
88
+ 9 => 'stickies',
89
+ 10 => 'super_stickies',
90
+ 11 => 'closed_topics',
91
+ 12 => 'topic_tags',
92
+ 13 => 'topic_subscriptions',
93
+ 14 => 'topic_favorites',
94
+ 15 => 'replies',
95
+ 16 => 'reply_authors',
96
+ 17 => 'reply_hierarchy'
97
+ );
98
+
99
+ /**
100
+ * The main bbPress Converter loader
101
+ *
102
+ * @since 2.1.0 bbPress (r3813)
103
+ */
104
+ public function __construct() {
105
+ $this->setup_globals();
106
+ $this->setup_actions();
107
+ }
108
+
109
+ /**
110
+ * Admin globals
111
+ *
112
+ * @since 2.6.0 bbPress (r6598)
113
+ */
114
+ public function setup_globals() {
115
+ $this->converters_dir = bbp_setup_admin()->admin_dir . 'converters/';
116
+ }
117
+
118
+ /**
119
+ * Setup the default actions
120
+ *
121
+ * @since 2.1.0 bbPress (r3813)
122
+ */
123
+ public function setup_actions() {
124
+
125
+ // Attach to the admin head with our ajax requests cycle and css
126
+ add_action( 'admin_head-tools_page_bbp-converter', array( $this, 'admin_head' ) );
127
+
128
+ // Attach to the admin ajax request to process cycles
129
+ add_action( 'wp_ajax_bbp_converter_process', array( $this, 'process_callback' ) );
130
+ }
131
+
132
+ /**
133
+ * Admin scripts
134
+ *
135
+ * @since 2.1.0 bbPress (r3813)
136
+ */
137
+ public function admin_head() {
138
+
139
+ // Enqueue scripts
140
+ wp_enqueue_script( 'bbp-converter' );
141
+
142
+ // Localize JS
143
+ wp_localize_script( 'bbp-converter', 'BBP_Converter', array(
144
+
145
+ // Nonce
146
+ 'ajax_nonce' => wp_create_nonce( 'bbp_converter_process' ),
147
+
148
+ // UI State
149
+ 'state' => array(
150
+ 'delay' => (int) get_option( '_bbp_converter_delay_time', 2 ),
151
+ 'started' => (bool) get_option( '_bbp_converter_step', 0 ),
152
+ 'running' => false,
153
+ 'status' => false,
154
+ 'step_percent' => $this->step_percentage,
155
+ 'total_percent' => $this->total_percentage
156
+ ),
157
+
158
+ // Strings
159
+ 'strings' => array(
160
+
161
+ // Button text
162
+ 'button_start' => esc_html__( 'Start', 'bbpress' ),
163
+ 'button_continue' => esc_html__( 'Continue', 'bbpress' ),
164
+
165
+ // Start button clicked
166
+ 'start_start' => esc_html__( 'Starting Import...', 'bbpress' ),
167
+ 'start_continue' => esc_html__( 'Continuing Import...', 'bbpress' ),
168
+
169
+ // Import
170
+ 'import_complete' => esc_html__( 'Import Finished.', 'bbpress' ),
171
+ 'import_stopped_user' => esc_html__( 'Import Stopped (by User.)', 'bbpress' ),
172
+ 'import_error_halt' => esc_html__( 'Import Halted (Error.)', 'bbpress' ),
173
+ 'import_error_db' => esc_html__( 'Database Connection Failed.', 'bbpress' ),
174
+
175
+ // Status
176
+ 'status_complete' => esc_html__( 'Finished', 'bbpress' ),
177
+ 'status_stopped' => esc_html__( 'Stopped', 'bbpress' ),
178
+ 'status_starting' => esc_html__( 'Starting', 'bbpress' ),
179
+ 'status_up_next' => esc_html__( 'Doing step %s...', 'bbpress' ),
180
+ 'status_counting' => esc_html__( 'Next in %s seconds...', 'bbpress' )
181
+ )
182
+ ) );
183
+ }
184
+
185
+ /**
186
+ * Callback processor
187
+ *
188
+ * @since 2.1.0 bbPress (r3813)
189
+ */
190
+ public function process_callback() {
191
+
192
+ // Ready the converter
193
+ $this->check_access();
194
+ $this->maybe_set_memory();
195
+ $this->maybe_restart();
196
+ $this->setup_options();
197
+ $this->maybe_update_options();
198
+
199
+ // Bail if no converter
200
+ if ( ! empty( $this->converter ) ) {
201
+ $this->do_steps();
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Wrap the converter output in HTML, so styling can be applied
207
+ *
208
+ * @since 2.1.0 bbPress (r4052)
209
+ *
210
+ * @param string $output
211
+ */
212
+ private function converter_response( $output = '' ) {
213
+
214
+ // Sanitize output
215
+ $output = wp_kses_data( $output );
216
+
217
+ // Maybe prepend the step
218
+ $progress = ! empty( $this->step )
219
+ ? sprintf( '<span class="step">%s.</span><span class="output">%s</span><span class="mini-step">%s</span>', $this->step, $output, $this->step_percentage . '%' )
220
+ : $output;
221
+
222
+ // Output
223
+ wp_send_json_success( array(
224
+ 'query' => get_option( '_bbp_converter_query', '' ),
225
+ 'current_step' => $this->step,
226
+ 'final_step' => $this->max_steps,
227
+ 'rows_in_step' => $this->rows_in_step,
228
+ 'step_percent' => $this->step_percentage,
229
+ 'total_percent' => $this->total_percentage,
230
+ 'progress' => $progress
231
+ ) );
232
+ }
233
+
234
+ /**
235
+ * Attempt to increase memory and set other system settings
236
+ *
237
+ * @since 2.6.0 bbPress (r6460)
238
+ */
239
+ private function maybe_set_memory() {
240
+ if ( ! ini_get( 'safe_mode' ) ) {
241
+ set_time_limit( 0 );
242
+ ini_set( 'memory_limit', '256M' );
243
+ ini_set( 'implicit_flush', '1' );
244
+ ignore_user_abort( true );
245
+ }
246
+ }
247
+
248
+ /**
249
+ * Maybe restart the converter
250
+ *
251
+ * @since 2.6.0 bbPress (r6460)
252
+ */
253
+ private function maybe_restart() {
254
+
255
+ // Save step and count so that it can be restarted.
256
+ if ( ! get_option( '_bbp_converter_step' ) || ! empty( $_POST['_bbp_converter_restart'] ) ) {
257
+ $this->step = 1;
258
+ $this->start = 0;
259
+ $this->step_percentage = 0;
260
+ $this->total_percentage = 0;
261
+ $this->rows_in_step = 0;
262
+ $this->maybe_update_options();
263
+ }
264
+ }
265
+
266
+ /**
267
+ * Maybe update options
268
+ *
269
+ * @since 2.6.0 bbPress (r6637)
270
+ */
271
+ private function maybe_update_options() {
272
+
273
+ // Default options
274
+ $options = array(
275
+
276
+ // Step & Start
277
+ '_bbp_converter_step' => $this->step,
278
+ '_bbp_converter_start' => $this->start,
279
+ '_bbp_converter_rows_in_step' => $this->rows_in_step,
280
+
281
+ // Halt
282
+ '_bbp_converter_halt' => ! empty( $_POST['_bbp_converter_halt'] )
283
+ ? (int) $_POST['_bbp_converter_halt']
284
+ : 0,
285
+
286
+ // Rows (bound between 1 and 5000)
287
+ '_bbp_converter_rows' => ! empty( $_POST['_bbp_converter_rows'] )
288
+ ? min( max( (int) $_POST['_bbp_converter_rows'], 1 ), 5000 )
289
+ : 0,
290
+
291
+ // Platform
292
+ '_bbp_converter_platform' => ! empty( $_POST['_bbp_converter_platform' ] )
293
+ ? sanitize_text_field( $_POST['_bbp_converter_platform' ] )
294
+ : '',
295
+
296
+ // Convert Users
297
+ '_bbp_converter_convert_users' => ! empty( $_POST['_bbp_converter_convert_users'] )
298
+ ? (bool) $_POST['_bbp_converter_convert_users']
299
+ : false,
300
+
301
+ // DB User
302
+ '_bbp_converter_db_user' => ! empty( $_POST['_bbp_converter_db_user'] )
303
+ ? sanitize_text_field( $_POST['_bbp_converter_db_user'] )
304
+ : '',
305
+
306
+ // DB Password
307
+ '_bbp_converter_db_pass' => ! empty( $_POST['_bbp_converter_db_pass'] )
308
+ ? sanitize_text_field( $_POST['_bbp_converter_db_pass'] )
309
+ : '',
310
+
311
+ // DB Name
312
+ '_bbp_converter_db_name' => ! empty( $_POST['_bbp_converter_db_name'] )
313
+ ? sanitize_text_field( $_POST['_bbp_converter_db_name'] )
314
+ : '',
315
+
316
+ // DB Server
317
+ '_bbp_converter_db_server' => ! empty( $_POST['_bbp_converter_db_server'] )
318
+ ? sanitize_text_field( $_POST['_bbp_converter_db_server'] )
319
+ : '',
320
+
321
+ // DB Port
322
+ '_bbp_converter_db_port' => ! empty( $_POST['_bbp_converter_db_port'] )
323
+ ? (int) sanitize_text_field( $_POST['_bbp_converter_db_port'] )
324
+ : '',
325
+
326
+ // DB Table Prefix
327
+ '_bbp_converter_db_prefix' => ! empty( $_POST['_bbp_converter_db_prefix'] )
328
+ ? sanitize_text_field( $_POST['_bbp_converter_db_prefix'] )
329
+ : ''
330
+ );
331
+
332
+ // Update/delete options
333
+ foreach ( $options as $key => $value ) {
334
+ update_option( $key, $value );
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Setup converter options
340
+ *
341
+ * @since 2.6.0 bbPress (r6460)
342
+ */
343
+ private function setup_options() {
344
+
345
+ // Set starting point & rows
346
+ $this->step = (int) get_option( '_bbp_converter_step', 1 );
347
+ $this->start = (int) get_option( '_bbp_converter_start', 0 );
348
+ $this->rows = (int) get_option( '_bbp_converter_rows', 100 );
349
+ $this->rows_in_step = (int) get_option( '_bbp_converter_rows_in_step', 0 );
350
+
351
+ // Set boundaries
352
+ $this->max = ( $this->start + $this->rows ) - 1;
353
+
354
+ // Set platform
355
+ $this->platform = get_option( '_bbp_converter_platform' );
356
+
357
+ // Total percentage
358
+ $this->total_percentage = round( ( $this->step / $this->max_steps ) * 100, 2 );
359
+
360
+ // Total mini steps
361
+ if ( $this->rows_in_step > 0 ) {
362
+ $total_mini_steps = ceil( $this->rows_in_step / $this->rows );
363
+ $current_mini_step = ceil( $this->start / $this->rows );
364
+ $this->step_percentage = round( ( $current_mini_step / $total_mini_steps ) * 100, 2 );
365
+ } else {
366
+ $this->step_percentage = 0;
367
+ }
368
+
369
+ // Maybe include the appropriate converter.
370
+ if ( ! empty( $this->platform ) ) {
371
+ $this->converter = bbp_new_converter( $this->platform );
372
+ }
373
+ }
374
+
375
+ /**
376
+ * Check that user can access the converter
377
+ *
378
+ * @since 2.6.0 bbPress (r6460)
379
+ */
380
+ private function check_access() {
381
+
382
+ // Bail if user cannot view import page
383
+ if ( ! current_user_can( 'bbp_tools_import_page' ) ) {
384
+ wp_die( '0' );
385
+ }
386
+
387
+ // Verify intent
388
+ check_ajax_referer( 'bbp_converter_process' );
389
+ }
390
+
391
+ /**
392
+ * Reset the converter
393
+ *
394
+ * @since 2.6.0 bbPress (r6460)
395
+ */
396
+ private function reset() {
397
+ update_option( '_bbp_converter_step', 0 );
398
+ update_option( '_bbp_converter_start', 0 );
399
+ update_option( '_bbp_converter_rows_in_step', 0 );
400
+ update_option( '_bbp_converter_query', '' );
401
+ }
402
+
403
+ /**
404
+ * Bump the step and reset the start
405
+ *
406
+ * @since 2.6.0 bbPress (r6460)
407
+ */
408
+ private function bump_step() {
409
+
410
+ // Next step
411
+ $next_step = (int) ( $this->step + 1 );
412
+
413
+ // Don't let step go over max
414
+ $step = ( $next_step <= $this->max_steps )
415
+ ? $next_step
416
+ : 0;
417
+
418
+ // Update step and start at 0
419
+ update_option( '_bbp_converter_step', $step );
420
+ update_option( '_bbp_converter_start', 0 );
421
+ update_option( '_bbp_converter_rows_in_step', 0 );
422
+ }
423
+
424
+ /**
425
+ * Bump the start within the current step
426
+ *
427
+ * @since 2.6.0 bbPress (r6460)
428
+ */
429
+ private function bump_start() {
430
+ $start = (int) ( $this->start + $this->rows );
431
+
432
+ update_option( '_bbp_converter_start', $start );
433
+ }
434
+
435
+ /**
436
+ * Do the converter step
437
+ *
438
+ * @since 2.6.0 bbPress (r6460)
439
+ */
440
+ private function do_steps() {
441
+
442
+ // Step exists in map, and method exists
443
+ if ( isset( $this->steps[ $this->step ] ) && method_exists( $this, "step_{$this->steps[ $this->step ]}" ) ) {
444
+ return call_user_func( array( $this, "step_{$this->steps[ $this->step ]}" ) );
445
+ }
446
+
447
+ // Done!
448
+ $this->step_done();
449
+ }
450
+
451
+ /** Steps *****************************************************************/
452
+
453
+ /**
454
+ * Maybe clean the sync table
455
+ *
456
+ * @since 2.6.0 bbPress (r6513)
457
+ */
458
+ private function step_sync_table() {
459
+ if ( true === $this->converter->clean ) {
460
+ if ( $this->converter->clean( $this->start ) ) {
461
+ $this->bump_step();
462
+ $this->sync_table( true );
463
+
464
+ empty( $this->start )
465
+ ? $this->converter_response( esc_html__( 'Readying sync-table', 'bbpress' ) )
466
+ : $this->converter_response( esc_html__( 'Sync-table ready', 'bbpress' ) );
467
+ } else {
468
+ $this->bump_start();
469
+ $this->converter_response( sprintf( esc_html__( 'Deleting previously converted data (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step) );
470
+ }
471
+
472
+ $this->converter->clean = false;
473
+ } else {
474
+ $this->bump_step();
475
+ $this->sync_table( false );
476
+ $this->converter_response( esc_html__( 'Skipping sync-table clean-up', 'bbpress' ) );
477
+ }
478
+ }
479
+
480
+ /**
481
+ * Maybe convert users
482
+ *
483
+ * @since 2.6.0 bbPress (r6513)
484
+ */
485
+ private function step_users() {
486
+ if ( true === $this->converter->convert_users ) {
487
+ if ( $this->converter->convert_users( $this->start ) ) {
488
+ $this->bump_step();
489
+
490
+ empty( $this->start )
491
+ ? $this->converter_response( esc_html__( 'No users to import', 'bbpress' ) )
492
+ : $this->converter_response( esc_html__( 'All users imported', 'bbpress' ) );
493
+ } else {
494
+ $this->bump_start();
495
+ $this->converter_response( sprintf( esc_html__( 'Converting users (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
496
+ }
497
+ } else {
498
+ $this->bump_step();
499
+ $this->converter_response( esc_html__( 'Skipping user clean-up', 'bbpress' ) );
500
+ }
501
+ }
502
+
503
+ /**
504
+ * Maybe clean up passwords
505
+ *
506
+ * @since 2.6.0 bbPress (r6513)
507
+ */
508
+ private function step_passwords() {
509
+ if ( true === $this->converter->convert_users ) {
510
+ if ( $this->converter->clean_passwords( $this->start ) ) {
511
+ $this->bump_step();
512
+
513
+ empty( $this->start )
514
+ ? $this->converter_response( esc_html__( 'No passwords to clear', 'bbpress' ) )
515
+ : $this->converter_response( esc_html__( 'All passwords cleared', 'bbpress' ) );
516
+ } else {
517
+ $this->bump_start();
518
+ $this->converter_response( sprintf( esc_html__( 'Delete default WordPress user passwords (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
519
+ }
520
+ } else {
521
+ $this->bump_step();
522
+ $this->converter_response( esc_html__( 'Skipping password clean-up', 'bbpress' ) );
523
+ }
524
+ }
525
+
526
+ /**
527
+ * Maybe convert forums
528
+ *
529
+ * @since 2.6.0 bbPress (r6513)
530
+ */
531
+ private function step_forums() {
532
+ if ( $this->converter->convert_forums( $this->start ) ) {
533
+ $this->bump_step();
534
+
535
+ empty( $this->start )
536
+ ? $this->converter_response( esc_html__( 'No forums to import', 'bbpress' ) )
537
+ : $this->converter_response( esc_html__( 'All forums imported', 'bbpress' ) );
538
+ } else {
539
+ $this->bump_start();
540
+ $this->converter_response( sprintf( esc_html__( 'Converting forums (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
541
+ }
542
+ }
543
+
544
+ /**
545
+ * Maybe walk the forum hierarchy
546
+ *
547
+ * @since 2.6.0 bbPress (r6513)
548
+ */
549
+ private function step_forum_hierarchy() {
550
+ if ( $this->converter->convert_forum_parents( $this->start ) ) {
551
+ $this->bump_step();
552
+
553
+ empty( $this->start )
554
+ ? $this->converter_response( esc_html__( 'No forum parents to import', 'bbpress' ) )
555
+ : $this->converter_response( esc_html__( 'All forum parents imported', 'bbpress' ) );
556
+ } else {
557
+ $this->bump_start();
558
+ $this->converter_response( sprintf( esc_html__( 'Calculating forum hierarchy (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
559
+ }
560
+ }
561
+
562
+ /**
563
+ * Maybe convert forum subscriptions
564
+ *
565
+ * @since 2.6.0 bbPress (r6513)
566
+ */
567
+ private function step_forum_subscriptions() {
568
+ if ( $this->converter->convert_forum_subscriptions( $this->start ) ) {
569
+ $this->bump_step();
570
+
571
+ empty( $this->start )
572
+ ? $this->converter_response( esc_html__( 'No forum subscriptions to import', 'bbpress' ) )
573
+ : $this->converter_response( esc_html__( 'All forum subscriptions imported', 'bbpress' ) );
574
+ } else {
575
+ $this->bump_start();
576
+ $this->converter_response( sprintf( esc_html__( 'Converting forum subscriptions (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
577
+ }
578
+ }
579
+
580
+ /**
581
+ * Maybe convert topics
582
+ *
583
+ * @since 2.6.0 bbPress (r6513)
584
+ */
585
+ private function step_topics() {
586
+ if ( $this->converter->convert_topics( $this->start ) ) {
587
+ $this->bump_step();
588
+
589
+ empty( $this->start )
590
+ ? $this->converter_response( esc_html__( 'No topics to import', 'bbpress' ) )
591
+ : $this->converter_response( esc_html__( 'All topics imported', 'bbpress' ) );
592
+ } else {
593
+ $this->bump_start();
594
+ $this->converter_response( sprintf( esc_html__( 'Converting topics (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
595
+ }
596
+ }
597
+
598
+ /**
599
+ * Maybe convert topic authors (anonymous)
600
+ *
601
+ * @since 2.6.0 bbPress (r6513)
602
+ */
603
+ private function step_topics_authors() {
604
+ if ( $this->converter->convert_anonymous_topic_authors( $this->start ) ) {
605
+ $this->bump_step();
606
+
607
+ empty( $this->start )
608
+ ? $this->converter_response( esc_html__( 'No anonymous topic authors to import', 'bbpress' ) )
609
+ : $this->converter_response( esc_html__( 'All anonymous topic authors imported', 'bbpress' ) );
610
+ } else {
611
+ $this->bump_start();
612
+ $this->converter_response( sprintf( esc_html__( 'Converting anonymous topic authors (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
613
+ }
614
+ }
615
+
616
+ /**
617
+ * Maybe convert sticky topics (not super stickies)
618
+ *
619
+ * @since 2.6.0 bbPress (r6513)
620
+ */
621
+ private function step_stickies() {
622
+ if ( $this->converter->convert_topic_stickies( $this->start ) ) {
623
+ $this->bump_step();
624
+
625
+ empty( $this->start )
626
+ ? $this->converter_response( esc_html__( 'No stickies to import', 'bbpress' ) )
627
+ : $this->converter_response( esc_html__( 'All stickies imported', 'bbpress' ) );
628
+ } else {
629
+ $this->bump_start();
630
+ $this->converter_response( sprintf( esc_html__( 'Calculating topic stickies (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
631
+ }
632
+ }
633
+
634
+ /**
635
+ * Maybe convert super-sticky topics (not per-forum)
636
+ *
637
+ * @since 2.6.0 bbPress (r6513)
638
+ */
639
+ private function step_super_stickies() {
640
+ if ( $this->converter->convert_topic_super_stickies( $this->start ) ) {
641
+ $this->bump_step();
642
+
643
+ empty( $this->start )
644
+ ? $this->converter_response( esc_html__( 'No super stickies to import', 'bbpress' ) )
645
+ : $this->converter_response( esc_html__( 'All super stickies imported', 'bbpress' ) );
646
+ } else {
647
+ $this->bump_start();
648
+ $this->converter_response( sprintf( esc_html__( 'Calculating topic super stickies (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
649
+ }
650
+ }
651
+
652
+ /**
653
+ * Maybe close converted topics
654
+ *
655
+ * @since 2.6.0 bbPress (r6513)
656
+ */
657
+ private function step_closed_topics() {
658
+ if ( $this->converter->convert_topic_closed_topics( $this->start ) ) {
659
+ $this->bump_step();
660
+
661
+ empty( $this->start )
662
+ ? $this->converter_response( esc_html__( 'No closed topics to import', 'bbpress' ) )
663
+ : $this->converter_response( esc_html__( 'All closed topics imported', 'bbpress' ) );
664
+ } else {
665
+ $this->bump_start();
666
+ $this->converter_response( sprintf( esc_html__( 'Calculating closed topics (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
667
+ }
668
+ }
669
+
670
+ /**
671
+ * Maybe convert topic tags
672
+ *
673
+ * @since 2.6.0 bbPress (r6513)
674
+ */
675
+ private function step_topic_tags() {
676
+ if ( $this->converter->convert_tags( $this->start ) ) {
677
+ $this->bump_step();
678
+
679
+ empty( $this->start )
680
+ ? $this->converter_response( esc_html__( 'No topic tags to import', 'bbpress' ) )
681
+ : $this->converter_response( esc_html__( 'All topic tags imported', 'bbpress' ) );
682
+ } else {
683
+ $this->bump_start();
684
+ $this->converter_response( sprintf( esc_html__( 'Converting topic tags (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
685
+ }
686
+ }
687
+
688
+ /**
689
+ * Maybe convert topic subscriptions
690
+ *
691
+ * @since 2.6.0 bbPress (r6513)
692
+ */
693
+ private function step_topic_subscriptions() {
694
+ if ( $this->converter->convert_topic_subscriptions( $this->start ) ) {
695
+ $this->bump_step();
696
+
697
+ empty( $this->start )
698
+ ? $this->converter_response( esc_html__( 'No topic subscriptions to import', 'bbpress' ) )
699
+ : $this->converter_response( esc_html__( 'All topic subscriptions imported', 'bbpress' ) );
700
+ } else {
701
+ $this->bump_start();
702
+ $this->converter_response( sprintf( esc_html__( 'Converting topic subscriptions (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
703
+ }
704
+ }
705
+
706
+ /**
707
+ * Maybe convert topic favorites
708
+ *
709
+ * @since 2.6.0 bbPress (r6513)
710
+ */
711
+ private function step_topic_favorites() {
712
+ if ( $this->converter->convert_favorites( $this->start ) ) {
713
+ $this->bump_step();
714
+
715
+ empty( $this->start )
716
+ ? $this->converter_response( esc_html__( 'No favorites to import', 'bbpress' ) )
717
+ : $this->converter_response( esc_html__( 'All favorites imported', 'bbpress' ) );
718
+ } else {
719
+ $this->bump_start();
720
+ $this->converter_response( sprintf( esc_html__( 'Converting favorites (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
721
+ }
722
+ }
723
+
724
+ /**
725
+ * Maybe convert replies
726
+ *
727
+ * @since 2.6.0 bbPress (r6513)
728
+ */
729
+ private function step_replies() {
730
+ if ( $this->converter->convert_replies( $this->start ) ) {
731
+ $this->bump_step();
732
+
733
+ empty( $this->start )
734
+ ? $this->converter_response( esc_html__( 'No replies to import', 'bbpress' ) )
735
+ : $this->converter_response( esc_html__( 'All replies imported', 'bbpress' ) );
736
+ } else {
737
+ $this->bump_start();
738
+ $this->converter_response( sprintf( esc_html__( 'Converting replies (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
739
+ }
740
+ }
741
+
742
+ /**
743
+ * Maybe convert reply authors (anonymous)
744
+ *
745
+ * @since 2.6.0 bbPress (r6513)
746
+ */
747
+ private function step_reply_authors() {
748
+ if ( $this->converter->convert_anonymous_reply_authors( $this->start ) ) {
749
+ $this->bump_step();
750
+
751
+ empty( $this->start )
752
+ ? $this->converter_response( esc_html__( 'No anonymous reply authors to import', 'bbpress' ) )
753
+ : $this->converter_response( esc_html__( 'All anonymous reply authors imported', 'bbpress' ) );
754
+ } else {
755
+ $this->bump_start();
756
+ $this->converter_response( sprintf( esc_html__( 'Converting anonymous reply authors (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
757
+ }
758
+ }
759
+
760
+ /**
761
+ * Maybe convert the threaded reply hierarchy
762
+ *
763
+ * @since 2.6.0 bbPress (r6513)
764
+ */
765
+ private function step_reply_hierarchy() {
766
+ if ( $this->converter->convert_reply_to_parents( $this->start ) ) {
767
+ $this->bump_step();
768
+
769
+ empty( $this->start )
770
+ ? $this->converter_response( esc_html__( 'No threaded replies to import', 'bbpress' ) )
771
+ : $this->converter_response( esc_html__( 'All threaded replies imported', 'bbpress' ) );
772
+ } else {
773
+ $this->bump_start();
774
+ $this->converter_response( sprintf( esc_html__( 'Calculating threaded replies parents (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) );
775
+ }
776
+ }
777
+
778
+ /**
779
+ * Done!
780
+ *
781
+ * @since 2.6.0 bbPress (r6513)
782
+ */
783
+ private function step_done() {
784
+ $this->reset();
785
+ $this->converter_response( esc_html__( 'Import Finished', 'bbpress' ) );
786
+ }
787
+
788
+ /** Helper Table **********************************************************/
789
+
790
+ /**
791
+ * Create Tables for fast syncing
792
+ *
793
+ * @since 2.1.0 bbPress (r3813)
794
+ */
795
+ public static function sync_table( $drop = false ) {
796
+
797
+ // Setup DB
798
+ $bbp_db = bbp_db();
799
+ $table_name = $bbp_db->prefix . 'bbp_converter_translator';
800
+ $table_exists = $bbp_db->get_var( "SHOW TABLES LIKE '{$table_name}'" ) === $table_name;
801
+
802
+ // Maybe drop the sync table
803
+ if ( ( true === $drop ) && ( true === $table_exists ) ) {
804
+ $bbp_db->query( "DROP TABLE {$table_name}" );
805
+ }
806
+
807
+ // Maybe include the upgrade functions, for dbDelta()
808
+ if ( ! function_exists( 'dbDelta' ) ) {
809
+ require_once ABSPATH . '/wp-admin/includes/upgrade.php';
810
+ }
811
+
812
+ // Defaults
813
+ $sql = array();
814
+ $charset_collate = '';
815
+
816
+ // https://bbpress.trac.wordpress.org/ticket/3145
817
+ $max_index_length = 75;
818
+
819
+ // Maybe override the character set
820
+ if ( ! empty( $bbp_db->charset ) ) {
821
+ $charset_collate .= "DEFAULT CHARACTER SET {$bbp_db->charset}";
822
+ }
823
+
824
+ // Maybe override the collation
825
+ if ( ! empty( $bbp_db->collate ) ) {
826
+ $charset_collate .= " COLLATE {$bbp_db->collate}";
827
+ }
828
+
829
+ /** Translator ********************************************************/
830
+
831
+ $sql[] = "CREATE TABLE {$table_name} (
832
+ meta_id mediumint(8) unsigned not null auto_increment,
833
+ value_type varchar(25) null,
834
+ value_id bigint(20) unsigned not null default '0',
835
+ meta_key varchar({$max_index_length}) null,
836
+ meta_value varchar({$max_index_length}) null,
837
+ PRIMARY KEY (meta_id),
838
+ KEY value_id (value_id),
839
+ KEY meta_join (meta_key({$max_index_length}), meta_value({$max_index_length}))
840
+ ) {$charset_collate}";
841
+
842
+ dbDelta( $sql );
843
+ }
844
+ }
845
+ endif;
includes/admin/classes/class-bbp-topic-replies-list-table.php ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * meta-box, 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' => 'reply',
38
+ 'plural' => 'replies',
39
+ 'ajax' => false
40
+ );
41
+ parent::__construct( $args );
42
+ }
43
+
44
+ /**
45
+ * Setup the list-table 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 check-box 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
+ public function prepare_items( $topic_id = 0 ) {
180
+
181
+ // Sanitize the topic ID
182
+ $topic_id = bbp_get_topic_id( $topic_id );
183
+
184
+ // Set column headers
185
+ $this->_column_headers = array(
186
+ $this->get_columns(),
187
+ array(),
188
+ $this->get_sortable_columns()
189
+ );
190
+
191
+ // Handle bulk actions
192
+ $this->process_bulk_action();
193
+
194
+ // Query parameters
195
+ $per_page = 5;
196
+ $current_page = $this->get_pagenum();
197
+ $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? sanitize_key( $_REQUEST['orderby'] ) : 'date';
198
+ $order = ( ! empty( $_REQUEST['order'] ) ) ? sanitize_key( $_REQUEST['order'] ) : 'asc';
199
+
200
+ // Query for replies
201
+ $reply_query = new WP_Query( array(
202
+ 'post_type' => bbp_get_reply_post_type(),
203
+ 'post_parent' => $topic_id,
204
+ 'posts_per_page' => $per_page,
205
+ 'paged' => $current_page,
206
+ 'orderby' => $orderby,
207
+ 'order' => ucwords( $order ),
208
+ 'hierarchical' => false,
209
+ 'ignore_sticky_posts' => true,
210
+ ) );
211
+
212
+ // Get the total number of replies, for pagination
213
+ $total_items = bbp_get_topic_reply_count( $topic_id );
214
+
215
+ // Set list table items to queried posts
216
+ $this->items = $reply_query->posts;
217
+
218
+ // Set the pagination arguments
219
+ $this->set_pagination_args( array(
220
+ 'total_items' => $total_items,
221
+ 'per_page' => $per_page,
222
+ 'total_pages' => ceil( $total_items / $per_page )
223
+ ) );
224
+ }
225
+
226
+ /**
227
+ * Message to be displayed when there are no items
228
+ *
229
+ * @since 2.6.0 bbPress (r5930)
230
+ */
231
+ public function no_items() {
232
+ esc_html_e( 'No replies to this topic.', 'bbpress' );
233
+ }
234
+
235
+ /**
236
+ * Display the list table
237
+ *
238
+ * This custom method is necessary because the one in `WP_List_Table` comes
239
+ * with a nonce and check that we do not need.
240
+ *
241
+ * @since 2.6.0 bbPress (r5930)
242
+ */
243
+ public function display() {
244
+
245
+ // Top
246
+ $this->display_tablenav( 'top' ); ?>
247
+
248
+ <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
249
+ <thead>
250
+ <tr>
251
+ <?php $this->print_column_headers(); ?>
252
+ </tr>
253
+ </thead>
254
+
255
+ <tbody id="the-list" data-wp-lists='list:<?php echo $this->_args['singular']; ?>'>
256
+ <?php $this->display_rows_or_placeholder(); ?>
257
+ </tbody>
258
+
259
+ <tfoot>
260
+ <tr>
261
+ <?php $this->print_column_headers( false ); ?>
262
+ </tr>
263
+ </tfoot>
264
+ </table>
265
+
266
+ <?php
267
+
268
+ // Bottom
269
+ $this->display_tablenav( 'bottom' );
270
+ }
271
+
272
+ /**
273
+ * Generate the table navigation above or below the table
274
+ *
275
+ * This custom method is necessary because the one in `WP_List_Table` comes
276
+ * with a nonce and check that we do not need.
277
+ *
278
+ * @since 2.6.0 bbPress (r5930)
279
+ *
280
+ * @param string $which
281
+ */
282
+ protected function display_tablenav( $which = '' ) {
283
+ ?>
284
+
285
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
286
+ <?php
287
+ $this->extra_tablenav( $which );
288
+ $this->pagination( $which );
289
+ ?>
290
+ <br class="clear" />
291
+ </div>
292
+
293
+ <?php
294
+ }
295
+
296
+ /**
297
+ * Generates content for a single row of the table
298
+ *
299
+ * @since 2.6.0
300
+ * @access public
301
+ *
302
+ * @param object $item The current item
303
+ */
304
+ public function single_row( $item ) {
305
+
306
+ // Author
307
+ $classes = 'author-' . ( get_current_user_id() == $item->post_author ? 'self' : 'other' );
308
+
309
+ // Locked
310
+ if ( wp_check_post_lock( $item->ID ) ) {
311
+ $classes .= ' wp-locked';
312
+ }
313
+
314
+ // Hierarchy
315
+ if ( ! empty( $item->post_parent ) ) {
316
+ $count = count( get_post_ancestors( $item->ID ) );
317
+ $classes .= ' level-'. $count;
318
+ } else {
319
+ $classes .= ' level-0';
320
+ } ?>
321
+
322
+ <tr id="post-<?php echo esc_attr( $item->ID ); ?>" class="<?php echo implode( ' ', get_post_class( $classes, $item->ID ) ); ?>">
323
+ <?php $this->single_row_columns( $item ); ?>
324
+ </tr>
325
+
326
+ <?php
327
+ }
328
+ }
329
+ endif;
includes/admin/{functions.php → common.php} RENAMED
@@ -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,17 +63,17 @@ 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
69
  * @return array Modified menu order
70
  */
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();
@@ -103,7 +104,7 @@ function bbp_admin_menu_order( $menu_order ) {
103
  $bbp_menu_order[] = $second_sep;
104
 
105
  // Skip our menu items
106
- } elseif ( ! in_array( $item, $custom_menus ) ) {
107
  $bbp_menu_order[] = $item;
108
  }
109
  }
@@ -115,23 +116,21 @@ 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
122
  * @param bool $leavename Optional, defaults to false. Whether to keep post name or page name.
123
  * @param bool $sample Optional, defaults to false. Is it a sample permalink.
124
  *
125
- * @uses is_admin() To make sure we're on an admin page
126
- * @uses bbp_is_custom_post_type() To get the forum post type
127
- *
128
  * @return string The custom post type permalink
129
  */
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 +139,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
@@ -163,47 +162,43 @@ function bbp_sanitize_slug( $slug = '' ) {
163
  $value = ltrim( $value, '/' );
164
  $value = rtrim( $value, '/' );
165
 
166
- // Filter the result and return
167
  return apply_filters( 'bbp_sanitize_slug', $value, $slug );
168
  }
169
 
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();
185
  }
186
 
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
- *
201
  * @return If no transient, or in network admin, or is bulk activation
202
  */
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 +216,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 +226,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,56 +235,7 @@ 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 = '' ) {
253
- echo bbp_get_tools_admin_tabs( $active_tab );
254
- }
255
-
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 = '' ) {
263
-
264
- // Declare local variables
265
- $tabs_html = '';
266
- $idle_class = 'nav-tab';
267
- $active_class = 'nav-tab nav-tab-active';
268
-
269
- // Setup core admin tabs
270
- $tabs = apply_filters( 'bbp_tools_admin_tabs', array(
271
- '0' => array(
272
- 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-repair' ), 'tools.php' ) ),
273
- 'name' => __( 'Repair Forums', 'bbpress' )
274
- ),
275
- '1' => array(
276
- 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-converter' ), 'tools.php' ) ),
277
- 'name' => __( 'Import Forums', 'bbpress' )
278
- ),
279
- '2' => array(
280
- 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-reset' ), 'tools.php' ) ),
281
- 'name' => __( 'Reset Forums', 'bbpress' )
282
- )
283
- ) );
284
-
285
- // Loop through tabs and build navigation
286
- foreach ( array_values( $tabs ) as $tab_data ) {
287
- $is_current = (bool) ( $tab_data['name'] == $active_tab );
288
- $tab_class = $is_current ? $active_class : $idle_class;
289
- $tabs_html .= '<a href="' . esc_url( $tab_data['href'] ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab_data['name'] ) . '</a>';
290
- }
291
-
292
- // Output the tabs
293
- return $tabs_html;
294
  }
 
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
  * @return array Modified menu order
70
  */
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
 
78
  // Initialize our custom order array
79
  $bbp_menu_order = array();
104
  $bbp_menu_order[] = $second_sep;
105
 
106
  // Skip our menu items
107
+ } elseif ( ! in_array( $item, $custom_menus, true ) ) {
108
  $bbp_menu_order[] = $item;
109
  }
110
  }
116
  /**
117
  * Filter sample permalinks so that certain languages display properly.
118
  *
119
+ * @since 2.0.0 bbPress (r3336)
120
  *
121
  * @param string $post_link Custom post type permalink
122
  * @param object $_post Post data object
123
  * @param bool $leavename Optional, defaults to false. Whether to keep post name or page name.
124
  * @param bool $sample Optional, defaults to false. Is it a sample permalink.
125
  *
 
 
 
126
  * @return string The custom post type permalink
127
  */
128
  function bbp_filter_sample_permalink( $post_link, $_post, $leavename = false, $sample = false ) {
129
 
130
  // Bail if not on an admin page and not getting a sample permalink
131
+ if ( ! empty( $sample ) && is_admin() && bbp_is_custom_post_type() ) {
132
  return urldecode( $post_link );
133
+ }
134
 
135
  // Return post link
136
  return $post_link;
139
  /**
140
  * Sanitize permalink slugs when saving the settings page.
141
  *
142
+ * @since 2.6.0 bbPress (r5364)
143
  *
144
  * @param string $slug
145
  * @return string
162
  $value = ltrim( $value, '/' );
163
  $value = rtrim( $value, '/' );
164
 
165
+ // Filter & return
166
  return apply_filters( 'bbp_sanitize_slug', $value, $slug );
167
  }
168
 
169
  /**
170
  * Uninstall all bbPress options and capabilities from a specific site.
171
  *
172
+ * @since 2.1.0 bbPress (r3765)
173
+ *
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
 
181
  switch_to_blog( $site_id );
182
  bbp_delete_options();
183
+ bbp_remove_roles();
184
  bbp_remove_caps();
185
  flush_rewrite_rules();
186
  restore_current_blog();
187
  }
188
 
189
  /**
190
+ * Redirect user to "What's New" page on activation
191
  *
192
+ * @since 2.2.0 bbPress (r4389)
193
  *
194
  * @internal Used internally to redirect bbPress to the about page on activation
195
  *
 
 
 
 
 
 
 
196
  * @return If no transient, or in network admin, or is bulk activation
197
  */
198
  function bbp_do_activation_redirect() {
199
 
200
  // Bail if no activation redirect
201
+ if ( ! get_transient( '_bbp_activation_redirect' ) ) {
202
  return;
203
  }
204
 
216
  }
217
 
218
  // Redirect to bbPress about page
219
+ bbp_redirect( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) );
220
  }
221
 
222
  /**
226
  * The conditional prevents the override when the user is viewing settings or
227
  * any third-party plugins.
228
  *
229
+ * @since 2.1.0 bbPress (r3888)
230
+ *
231
  * @global string $plugin_page
232
  * @global array $submenu_file
233
  */
235
  global $plugin_page, $submenu_file;
236
 
237
  // This tweaks the Tools subnav menu to only show one bbPress menu item
238
+ if ( ! in_array( $plugin_page, array( 'bbp-settings' ), true ) ) {
239
  $submenu_file = 'bbp-repair';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  }
241
+ }
includes/admin/converter.php DELETED
@@ -1,1497 +0,0 @@
1
- <?php
2
-
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
17
- */
18
- class BBP_Converter {
19
-
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
- }
50
-
51
- // Proceed with the actions
52
- $this->setup_actions();
53
- }
54
-
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() {
62
-
63
- // Attach to the admin head with our ajax requests cycle and css
64
- add_action( 'bbp_admin_head', array( $this, 'admin_head' ) );
65
-
66
- // Attach the bbConverter admin settings action to the WordPress admin init action.
67
- add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) );
68
-
69
- // Attach to the admin ajax request to process cycles
70
- add_action( 'wp_ajax_bbconverter_process', array( $this, 'process_callback' ) );
71
- }
72
-
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
80
- */
81
- public function register_admin_settings() {
82
-
83
- // Add the main section
84
- add_settings_section( 'bbpress_converter_main', __( 'Database Settings', 'bbpress' ), 'bbp_converter_setting_callback_main_section', 'bbpress_converter' );
85
-
86
- // System Select
87
- add_settings_field( '_bbp_converter_platform', __( 'Select Platform', 'bbpress' ), 'bbp_converter_setting_callback_platform', 'bbpress_converter', 'bbpress_converter_main' );
88
- register_setting ( 'bbpress_converter_main', '_bbp_converter_platform', 'sanitize_title' );
89
-
90
- // Database Server
91
- add_settings_field( '_bbp_converter_db_server', __( 'Database Server', 'bbpress' ), 'bbp_converter_setting_callback_dbserver', 'bbpress_converter', 'bbpress_converter_main' );
92
- register_setting ( 'bbpress_converter_main', '_bbp_converter_db_server', 'sanitize_title' );
93
-
94
- // Database Server Port
95
- add_settings_field( '_bbp_converter_db_port', __( 'Database Port', 'bbpress' ), 'bbp_converter_setting_callback_dbport', 'bbpress_converter', 'bbpress_converter_main' );
96
- register_setting ( 'bbpress_converter_main', '_bbp_converter_db_port', 'sanitize_title' );
97
-
98
- // Database Name
99
- add_settings_field( '_bbp_converter_db_name', __( 'Database Name', 'bbpress' ), 'bbp_converter_setting_callback_dbname', 'bbpress_converter', 'bbpress_converter_main' );
100
- register_setting ( 'bbpress_converter_main', '_bbp_converter_db_name', 'sanitize_title' );
101
-
102
- // Database User
103
- add_settings_field( '_bbp_converter_db_user', __( 'Database User', 'bbpress' ), 'bbp_converter_setting_callback_dbuser', 'bbpress_converter', 'bbpress_converter_main' );
104
- register_setting ( 'bbpress_converter_main', '_bbp_converter_db_user', 'sanitize_title' );
105
-
106
- // Database Pass
107
- add_settings_field( '_bbp_converter_db_pass', __( 'Database Password', 'bbpress' ), 'bbp_converter_setting_callback_dbpass', 'bbpress_converter', 'bbpress_converter_main' );
108
- register_setting ( 'bbpress_converter_main', '_bbp_converter_db_pass', 'sanitize_title' );
109
-
110
- // Database Prefix
111
- add_settings_field( '_bbp_converter_db_prefix', __( 'Table Prefix', 'bbpress' ), 'bbp_converter_setting_callback_dbprefix', 'bbpress_converter', 'bbpress_converter_main' );
112
- register_setting ( 'bbpress_converter_main', '_bbp_converter_db_prefix', 'sanitize_title' );
113
-
114
- // Add the options section
115
- add_settings_section( 'bbpress_converter_opt', __( 'Options', 'bbpress' ), 'bbp_converter_setting_callback_options_section', 'bbpress_converter' );
116
-
117
- // Rows Limit
118
- add_settings_field( '_bbp_converter_rows', __( 'Rows Limit', 'bbpress' ), 'bbp_converter_setting_callback_rows', 'bbpress_converter', 'bbpress_converter_opt' );
119
- register_setting ( 'bbpress_converter_opt', '_bbp_converter_rows', 'intval' );
120
-
121
- // Delay Time
122
- add_settings_field( '_bbp_converter_delay_time', __( 'Delay Time', 'bbpress' ), 'bbp_converter_setting_callback_delay_time', 'bbpress_converter', 'bbpress_converter_opt' );
123
- register_setting ( 'bbpress_converter_opt', '_bbp_converter_delay_time', 'intval' );
124
-
125
- // Convert Users ?
126
- add_settings_field( '_bbp_converter_convert_users', __( 'Convert Users', 'bbpress' ), 'bbp_converter_setting_callback_convert_users', 'bbpress_converter', 'bbpress_converter_opt' );
127
- register_setting ( 'bbpress_converter_opt', '_bbp_converter_convert_users', 'intval' );
128
-
129
- // Restart
130
- add_settings_field( '_bbp_converter_restart', __( 'Start Over', 'bbpress' ), 'bbp_converter_setting_callback_restart', 'bbpress_converter', 'bbpress_converter_opt' );
131
- register_setting ( 'bbpress_converter_opt', '_bbp_converter_restart', 'intval' );
132
-
133
- // Clean
134
- add_settings_field( '_bbp_converter_clean', __( 'Purge Previous Import', 'bbpress' ), 'bbp_converter_setting_callback_clean', 'bbpress_converter', 'bbpress_converter_opt' );
135
- register_setting ( 'bbpress_converter_opt', '_bbp_converter_clean', 'intval' );
136
- }
137
-
138
- /**
139
- * Admin scripts
140
- *
141
- * @since bbPress (r3813)
142
- */
143
- public function admin_head() { ?>
144
-
145
- <style type="text/css" media="screen">
146
- /*<![CDATA[*/
147
-
148
- div.bbp-converter-updated,
149
- div.bbp-converter-warning {
150
- border-radius: 3px 3px 3px 3px;
151
- border-style: solid;
152
- border-width: 1px;
153
- padding: 5px 5px 5px 5px;
154
- }
155
-
156
- div.bbp-converter-updated {
157
- height: 300px;
158
- overflow: auto;
159
- display: none;
160
- background-color: #FFFFE0;
161
- border-color: #E6DB55;
162
- font-family: monospace;
163
- font-weight: bold;
164
- }
165
-
166
- div.bbp-converter-updated p {
167
- margin: 0.5em 0;
168
- padding: 2px;
169
- float: left;
170
- clear: left;
171
- }
172
-
173
- div.bbp-converter-updated p.loading {
174
- padding: 2px 20px 2px 2px;
175
- background-image: url('<?php echo admin_url(); ?>images/wpspin_light.gif');
176
- background-repeat: no-repeat;
177
- background-position: center right;
178
- }
179
-
180
- #bbp-converter-stop {
181
- display:none;
182
- }
183
-
184
- #bbp-converter-progress {
185
- display:none;
186
- }
187
-
188
- /*]]>*/
189
- </style>
190
-
191
- <script language="javascript">
192
-
193
- var bbconverter_is_running = false;
194
- var bbconverter_run_timer;
195
- var bbconverter_delay_time = 0;
196
-
197
- function bbconverter_grab_data() {
198
- var values = {};
199
- jQuery.each(jQuery('#bbp-converter-settings').serializeArray(), function(i, field) {
200
- values[field.name] = field.value;
201
- });
202
-
203
- if( values['_bbp_converter_restart'] ) {
204
- jQuery('#_bbp_converter_restart').removeAttr("checked");
205
- }
206
-
207
- if( values['_bbp_converter_delay_time'] ) {
208
- bbconverter_delay_time = values['_bbp_converter_delay_time'] * 1000;
209
- }
210
-
211
- values['action'] = 'bbconverter_process';
212
- values['_ajax_nonce'] = '<?php echo wp_create_nonce( 'bbp_converter_process' ); ?>';
213
-
214
- return values;
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();
222
- jQuery('#bbp-converter-progress').show();
223
- bbconverter_log( '<p class="loading"><?php esc_html_e( 'Starting Conversion', 'bbpress' ); ?></p>' );
224
- bbconverter_run();
225
- }
226
- }
227
-
228
- function bbconverter_run() {
229
- jQuery.post(ajaxurl, bbconverter_grab_data(), function(response) {
230
- var response_length = response.length - 1;
231
- response = response.substring(0,response_length);
232
- bbconverter_success(response);
233
- });
234
- }
235
-
236
- function bbconverter_stop() {
237
- jQuery('#bbp-converter-start').show();
238
- jQuery('#bbp-converter-stop').hide();
239
- jQuery('#bbp-converter-progress').hide();
240
- jQuery('#bbp-converter-message p').removeClass( 'loading' );
241
- bbconverter_is_running = false;
242
- clearTimeout( bbconverter_run_timer );
243
- }
244
-
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
252
- jQuery('#bbp-converter-progress').show();
253
- clearTimeout( bbconverter_run_timer );
254
- bbconverter_run_timer = setTimeout( 'bbconverter_run()', bbconverter_delay_time );
255
- } else {
256
- bbconverter_stop();
257
- }
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 ) {
265
- jQuery('#bbp-converter-message p').removeClass( 'loading' );
266
- jQuery('#bbp-converter-message').prepend( text );
267
- }
268
- }
269
-
270
- </script>
271
-
272
- <?php
273
- }
274
-
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
- */
282
- private static function converter_output( $output = '' ) {
283
-
284
- // Get the last query
285
- $before = '<p class="loading">';
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
- }
294
-
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' );
313
- ini_set( 'implicit_flush', '1' );
314
- ignore_user_abort( true );
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
- }
322
-
323
- $step = (int) get_option( '_bbp_converter_step', 1 );
324
- $min = (int) get_option( '_bbp_converter_start', 0 );
325
- $count = ! empty( $_POST['_bbp_converter_rows'] ) ? min( max( (int) $_POST['_bbp_converter_rows'], 1 ), 5000 ) : 100;
326
- $max = ( $min + $count ) - 1;
327
- $start = $min;
328
-
329
- // Bail if platform did not get saved
330
- $platform = !empty( $_POST['_bbp_converter_platform' ] ) ? sanitize_text_field( $_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 );
336
-
337
- switch ( $step ) {
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 );
345
- $this->sync_table( true );
346
- if ( empty( $start ) ) {
347
- $this->converter_output( __( 'No data to clean', 'bbpress' ) );
348
- }
349
- } else {
350
- update_option( '_bbp_converter_start', $max + 1 );
351
- $this->converter_output( sprintf( __( 'Deleting previously converted data (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
352
- }
353
- } else {
354
- update_option( '_bbp_converter_step', $step + 1 );
355
- update_option( '_bbp_converter_start', 0 );
356
- }
357
-
358
- break;
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 );
366
- if ( empty( $start ) ) {
367
- $this->converter_output( __( 'No users to convert', 'bbpress' ) );
368
- }
369
- } else {
370
- update_option( '_bbp_converter_start', $max + 1 );
371
- $this->converter_output( sprintf( __( 'Converting users (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
372
- }
373
- } else {
374
- update_option( '_bbp_converter_step', $step + 1 );
375
- update_option( '_bbp_converter_start', 0 );
376
- }
377
-
378
- break;
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 );
386
- if ( empty( $start ) ) {
387
- $this->converter_output( __( 'No passwords to clear', 'bbpress' ) );
388
- }
389
- } else {
390
- update_option( '_bbp_converter_start', $max + 1 );
391
- $this->converter_output( sprintf( __( 'Delete users WordPress default passwords (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
392
- }
393
- } else {
394
- update_option( '_bbp_converter_step', $step + 1 );
395
- update_option( '_bbp_converter_start', 0 );
396
- }
397
-
398
- break;
399
-
400
- // STEP 4. Convert forums.
401
- case 4 :
402
- if ( $converter->convert_forums( $start ) ) {
403
- update_option( '_bbp_converter_step', $step + 1 );
404
- update_option( '_bbp_converter_start', 0 );
405
- if ( empty( $start ) ) {
406
- $this->converter_output( __( 'No forums to convert', 'bbpress' ) );
407
- }
408
- } else {
409
- update_option( '_bbp_converter_start', $max + 1 );
410
- $this->converter_output( sprintf( __( 'Converting forums (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
411
- }
412
-
413
- break;
414
-
415
- // STEP 5. Convert forum parents.
416
- case 5 :
417
- if ( $converter->convert_forum_parents( $start ) ) {
418
- update_option( '_bbp_converter_step', $step + 1 );
419
- update_option( '_bbp_converter_start', 0 );
420
- if ( empty( $start ) ) {
421
- $this->converter_output( __( 'No forum parents to convert', 'bbpress' ) );
422
- }
423
- } else {
424
- update_option( '_bbp_converter_start', $max + 1 );
425
- $this->converter_output( sprintf( __( 'Calculating forum hierarchy (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
426
- }
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 );
435
- if ( empty( $start ) ) {
436
- $this->converter_output( __( 'No topics to convert', 'bbpress' ) );
437
- }
438
- } else {
439
- update_option( '_bbp_converter_start', $max + 1 );
440
- $this->converter_output( sprintf( __( 'Converting topics (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
441
- }
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 );
450
- if ( empty( $start ) ) {
451
- $this->converter_output( __( 'No stickies to stick', 'bbpress' ) );
452
- }
453
- } else {
454
- update_option( '_bbp_converter_start', $max + 1 );
455
- $this->converter_output( sprintf( __( 'Calculating topic stickies (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
456
- }
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 );
465
- if ( empty( $start ) ) {
466
- $this->converter_output( __( 'No super stickies to stick', 'bbpress' ) );
467
- }
468
- } else {
469
- update_option( '_bbp_converter_start', $max + 1 );
470
- $this->converter_output( sprintf( __( 'Calculating topic super stickies (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
471
- }
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 );
485
- $this->converter_output( sprintf( __( 'Converting topic tags (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
486
- }
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 );
495
- if ( empty( $start ) ) {
496
- $this->converter_output( __( 'No replies to convert', 'bbpress' ) );
497
- }
498
- } else {
499
- update_option( '_bbp_converter_start', $max + 1 );
500
- $this->converter_output( sprintf( __( 'Converting replies (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
501
- }
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;
519
-
520
- default :
521
- delete_option( '_bbp_converter_step' );
522
- delete_option( '_bbp_converter_start' );
523
- delete_option( '_bbp_converter_query' );
524
-
525
- $this->converter_output( __( 'Conversion Complete', 'bbpress' ) );
526
-
527
- break;
528
- }
529
- }
530
-
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,
561
- value_id bigint(20) unsigned not null default '0',
562
- meta_key varchar(255) null,
563
- meta_value varchar(255) null,
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
- }
571
- }
572
-
573
- /**
574
- * Base class to be extended by specific individual importers
575
- *
576
- * @since bbPress (r3813)
577
- */
578
- abstract class BBP_Converter_Base {
579
-
580
- /**
581
- * @var array() This is the field mapping array to process.
582
- */
583
- protected $field_map = array();
584
-
585
- /**
586
- * @var object This is the connection to the WordPress datbase.
587
- */
588
- protected $wpdb;
589
-
590
- /**
591
- * @var object This is the connection to the other platforms database.
592
- */
593
- protected $opdb;
594
-
595
- /**
596
- * @var int This is the max rows to process at a time.
597
- */
598
- public $max_rows;
599
-
600
- /**
601
- * @var array() Map of topic to forum. It is for optimization.
602
- */
603
- private $map_topicid_to_forumid = array();
604
-
605
- /**
606
- * @var array() Map of from old forum ids to new forum ids. It is for optimization.
607
- */
608
- private $map_forumid = array();
609
-
610
- /**
611
- * @var array() Map of from old topic ids to new topic ids. It is for optimization.
612
- */
613
- private $map_topicid = array();
614
-
615
- /**
616
- * @var array() Map of from old reply_to ids to new reply_to ids. It is for optimization.
617
- */
618
- private $map_reply_to = array();
619
-
620
- /**
621
- * @var array() Map of from old user ids to new user ids. It is for optimization.
622
- */
623
- private $map_userid = array();
624
-
625
- /**
626
- * @var str This is the charset for your wp database.
627
- */
628
- public $charset;
629
-
630
- /**
631
- * @var boolean Sync table available.
632
- */
633
- public $sync_table = false;
634
-
635
- /**
636
- * @var str Sync table name.
637
- */
638
- public $sync_table_name;
639
-
640
- /** Methods ***************************************************************/
641
-
642
- /**
643
- * This is the constructor and it connects to the platform databases.
644
- */
645
- public function __construct() {
646
- $this->setup_globals();
647
- }
648
-
649
- private function setup_globals() {
650
- global $wpdb;
651
-
652
- /** Get database connections ******************************************/
653
-
654
- $this->wpdb = $wpdb;
655
- $this->max_rows = ! empty( $_POST['_bbp_converter_rows'] )
656
- ? min( max( (int) $_POST['_bbp_converter_rows'], 1 ), 5000 )
657
- : 100;
658
-
659
- $this->opdb = new wpdb(
660
- sanitize_text_field( $_POST['_bbp_converter_db_user'] ),
661
- sanitize_text_field( $_POST['_bbp_converter_db_pass'] ),
662
- sanitize_text_field( $_POST['_bbp_converter_db_name'] ),
663
- sanitize_text_field( $_POST['_bbp_converter_db_server'] )
664
- );
665
-
666
- $this->opdb->prefix = sanitize_text_field( $_POST['_bbp_converter_db_prefix'] );
667
-
668
- /**
669
- * Error Reporting
670
- */
671
- $this->wpdb->show_errors();
672
- $this->opdb->show_errors();
673
-
674
- /**
675
- * Syncing
676
- */
677
- $this->sync_table_name = $this->wpdb->prefix . 'bbp_converter_translator';
678
- if ( $this->wpdb->get_var( "SHOW TABLES LIKE '" . $this->sync_table_name . "'" ) == $this->sync_table_name ) {
679
- $this->sync_table = true;
680
- } else {
681
- $this->sync_table = false;
682
- }
683
-
684
- /**
685
- * Charset
686
- */
687
- if ( empty( $this->wpdb->charset ) ) {
688
- $this->charset = 'UTF8';
689
- } else {
690
- $this->charset = $this->wpdb->charset;
691
- }
692
-
693
- /**
694
- * Default mapping.
695
- */
696
-
697
- /** Forum Section *****************************************************/
698
-
699
- $this->field_map[] = array(
700
- 'to_type' => 'forum',
701
- 'to_fieldname' => 'post_status',
702
- 'default' => 'publish'
703
- );
704
- $this->field_map[] = array(
705
- 'to_type' => 'forum',
706
- 'to_fieldname' => 'comment_status',
707
- 'default' => 'closed'
708
- );
709
- $this->field_map[] = array(
710
- 'to_type' => 'forum',
711
- 'to_fieldname' => 'ping_status',
712
- 'default' => 'closed'
713
- );
714
- $this->field_map[] = array(
715
- 'to_type' => 'forum',
716
- 'to_fieldname' => 'post_type',
717
- 'default' => 'forum'
718
- );
719
-
720
- /** Topic Section *****************************************************/
721
-
722
- $this->field_map[] = array(
723
- 'to_type' => 'topic',
724
- 'to_fieldname' => 'post_status',
725
- 'default' => 'publish'
726
- );
727
- $this->field_map[] = array(
728
- 'to_type' => 'topic',
729
- 'to_fieldname' => 'comment_status',
730
- 'default' => 'closed'
731
- );
732
- $this->field_map[] = array(
733
- 'to_type' => 'topic',
734
- 'to_fieldname' => 'ping_status',
735
- 'default' => 'closed'
736
- );
737
- $this->field_map[] = array(
738
- 'to_type' => 'topic',
739
- 'to_fieldname' => 'post_type',
740
- 'default' => 'topic'
741
- );
742
-
743
- /** Post Section ******************************************************/
744
-
745
- $this->field_map[] = array(
746
- 'to_type' => 'reply',
747
- 'to_fieldname' => 'post_status',
748
- 'default' => 'publish'
749
- );
750
- $this->field_map[] = array(
751
- 'to_type' => 'reply',
752
- 'to_fieldname' => 'comment_status',
753
- 'default' => 'closed'
754
- );
755
- $this->field_map[] = array(
756
- 'to_type' => 'reply',
757
- 'to_fieldname' => 'ping_status',
758
- 'default' => 'closed'
759
- );
760
- $this->field_map[] = array(
761
- 'to_type' => 'reply',
762
- 'to_fieldname' => 'post_type',
763
- 'default' => 'reply'
764
- );
765
-
766
- /** User Section ******************************************************/
767
-
768
- $this->field_map[] = array(
769
- 'to_type' => 'user',
770
- 'to_fieldname' => 'role',
771
- 'default' => get_option( 'default_role' )
772
- );
773
- }
774
-
775
- /**
776
- * Convert Forums
777
- */
778
- public function convert_forums( $start = 1 ) {
779
- return $this->convert_table( 'forum', $start );
780
- }
781
-
782
- /**
783
- * Convert Topics / Threads
784
- */
785
- public function convert_topics( $start = 1 ) {
786
- return $this->convert_table( 'topic', $start );
787
- }
788
-
789
- /**
790
- * Convert Posts
791
- */
792
- public function convert_replies( $start = 1 ) {
793
- return $this->convert_table( 'reply', $start );
794
- }
795
-
796
- /**
797
- * Convert Users
798
- */
799
- public function convert_users( $start = 1 ) {
800
- return $this->convert_table( 'user', $start );
801
- }
802
-
803
- /**
804
- * Convert Tags
805
- */
806
- public function convert_tags( $start = 1 ) {
807
- return $this->convert_table( 'tags', $start );
808
- }
809
-
810
- /**
811
- * Convert Table
812
- *
813
- * @param string to type
814
- * @param int Start row
815
- */
816
- public function convert_table( $to_type, $start ) {
817
-
818
- // Are we usig a sync table, or postmeta?
819
- if ( $this->wpdb->get_var( "SHOW TABLES LIKE '" . $this->sync_table_name . "'" ) == $this->sync_table_name ) {
820
- $this->sync_table = true;
821
- } else {
822
- $this->sync_table = false;
823
- }
824
-
825
- // Set some defaults
826
- $has_insert = false;
827
- $from_tablename = '';
828
- $field_list = $from_tables = $tablefield_array = array();
829
-
830
- // Toggle Table Name based on $to_type (destination)
831
- switch ( $to_type ) {
832
- case 'user' :
833
- $tablename = $this->wpdb->users;
834
- break;
835
-
836
- case 'tags' :
837
- $tablename = '';
838
- break;
839
-
840
- default :
841
- $tablename = $this->wpdb->posts;
842
- }
843
-
844
- // Get the fields from the destination table
845
- if ( !empty( $tablename ) ) {
846
- $tablefield_array = $this->get_fields( $tablename );
847
- }
848
-
849
- /** Step 1 ************************************************************/
850
-
851
- // Loop through the field maps, and look for to_type matches
852
- foreach ( $this->field_map as $item ) {
853
-
854
- // Yay a match, and we have a from table, too
855
- if ( ( $item['to_type'] == $to_type ) && !empty( $item['from_tablename'] ) ) {
856
-
857
- // $from_tablename was set from a previous loop iteration
858
- if ( ! empty( $from_tablename ) ) {
859
-
860
- // Doing some joining
861
- if ( !in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) {
862
- $from_tablename .= ' ' . $item['join_type'] . ' JOIN ' . $this->opdb->prefix . $item['from_tablename'] . ' AS ' . $item['from_tablename'] . ' ' . $item['join_expression'];
863
- }
864
-
865
- // $from_tablename needs to be set
866
- } else {
867
- $from_tablename = $item['from_tablename'] . ' AS ' . $item['from_tablename'];
868
- }
869
-
870
- // Specific FROM expression data used
871
- if ( !empty( $item['from_expression'] ) ) {
872
-
873
- // No 'WHERE' in expression
874
- if ( stripos( $from_tablename, "WHERE" ) === false ) {
875
- $from_tablename .= ' ' . $item['from_expression'];
876
-
877
- // 'WHERE' in expression, so replace with 'AND'
878
- } else {
879
- $from_tablename .= ' ' . str_replace( "WHERE", "AND", $item['from_expression'] );
880
- }
881
- }
882
-
883
- // Add tablename and fieldname to arrays, formatted for querying
884
- $from_tables[] = $item['from_tablename'];
885
- $field_list[] = 'convert(' . $item['from_tablename'] . '.' . $item['from_fieldname'] . ' USING "' . $this->charset . '") AS ' . $item['from_fieldname'];
886
- }
887
- }
888
-
889
- /** Step 2 ************************************************************/
890
-
891
- // We have a $from_tablename, so we want to get some data to convert
892
- if ( !empty( $from_tablename ) ) {
893
-
894
- // Get some data from the old forums
895
- $field_list = array_unique( $field_list );
896
- $forum_query = 'SELECT ' . implode( ',', $field_list ) . ' FROM ' . $this->opdb->prefix . $from_tablename . ' LIMIT ' . $start . ', ' . $this->max_rows;
897
- $forum_array = $this->opdb->get_results( $forum_query, ARRAY_A );
898
-
899
- // Set this query as the last one ran
900
- update_option( '_bbp_converter_query', $forum_query );
901
-
902
- // Query returned some results
903
- if ( !empty( $forum_array ) ) {
904
-
905
- // Loop through results
906
- foreach ( (array) $forum_array as $forum ) {
907
-
908
- // Reset some defaults
909
- $insert_post = $insert_postmeta = $insert_data = array();
910
-
911
- // Loop through field map, again...
912
- foreach ( $this->field_map as $row ) {
913
-
914
- // Types matchand to_fieldname is present. This means
915
- // we have some work to do here.
916
- if ( ( $row['to_type'] == $to_type ) && ! is_null( $row['to_fieldname'] ) ) {
917
-
918
- // This row has a destination that matches one of the
919
- // columns in this table.
920
- if ( in_array( $row['to_fieldname'], $tablefield_array ) ) {
921
-
922
- // Allows us to set default fields.
923
- if ( isset( $row['default'] ) ) {
924
- $insert_post[$row['to_fieldname']] = $row['default'];
925
-
926
- // Translates a field from the old forum.
927
- } elseif ( isset( $row['callback_method'] ) ) {
928
- if ( ( 'callback_userid' == $row['callback_method'] ) && empty( $_POST['_bbp_converter_convert_users'] ) ) {
929
- $insert_post[$row['to_fieldname']] = $forum[$row['from_fieldname']];
930
- } else {
931
- $insert_post[$row['to_fieldname']] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[$row['from_fieldname']], $forum ) );
932
- }
933
-
934
- // Maps the field from the old forum.
935
- } else {
936
- $insert_post[$row['to_fieldname']] = $forum[$row['from_fieldname']];
937
- }
938
-
939
- // Destination field is not empty, so we might need
940
- // to do some extra work or set a default.
941
- } elseif ( !empty( $row['to_fieldname'] ) ) {
942
-
943
- // Allows us to set default fields.
944
- if ( isset( $row['default'] ) ) {
945
- $insert_postmeta[$row['to_fieldname']] = $row['default'];
946
-
947
- // Translates a field from the old forum.
948
- } elseif ( isset( $row['callback_method'] ) ) {
949
- if ( ( $row['callback_method'] == 'callback_userid' ) && ( 0 == $_POST['_bbp_converter_convert_users'] ) ) {
950
- $insert_postmeta[$row['to_fieldname']] = $forum[$row['from_fieldname']];
951
- } else {
952
- $insert_postmeta[$row['to_fieldname']] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[$row['from_fieldname']], $forum ) );
953
- }
954
-
955
- // Maps the field from the old forum.
956
- } else {
957
- $insert_postmeta[$row['to_fieldname']] = $forum[$row['from_fieldname']];
958
- }
959
- }
960
- }
961
- }
962
-
963
- /** Step 3 ************************************************/
964
-
965
- // Something to insert into the destination field
966
- if ( count( $insert_post ) > 0 || ( $to_type == 'tags' && count( $insert_postmeta ) > 0 ) ) {
967
-
968
- switch ( $to_type ) {
969
-
970
- /** New user **************************************/
971
-
972
- case 'user':
973
- if ( username_exists( $insert_post['user_login'] ) ) {
974
- $insert_post['user_login'] = 'imported_' . $insert_post['user_login'];
975
- }
976
-
977
- if ( email_exists( $insert_post['user_email'] ) ) {
978
- $insert_post['user_email'] = 'imported_' . $insert_post['user_email'];
979
- }
980
-
981
- $post_id = wp_insert_user( $insert_post );
982
-
983
- if ( is_numeric( $post_id ) ) {
984
-
985
- foreach ( $insert_postmeta as $key => $value ) {
986
-
987
- add_user_meta( $post_id, $key, $value, true );
988
-
989
- if ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
990
- $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'user', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
991
- }
992
- }
993
- }
994
- break;
995
-
996
- /** New Topic-Tag *********************************/
997
-
998
- case 'tags':
999
- $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
1000
- $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
1001
- if ( false !== $term ) {
1002
- wp_update_term( $term->term_id, 'topic-tag', array(
1003
- 'description' => $insert_postmeta['description'],
1004
- 'slug' => $insert_postmeta['slug']
1005
- ) );
1006
- }
1007
- break;
1008
-
1009
- /** Forum, Topic, Reply ***************************/
1010
-
1011
- default:
1012
- $post_id = wp_insert_post( $insert_post );
1013
-
1014
- if ( is_numeric( $post_id ) ) {
1015
-
1016
- foreach ( $insert_postmeta as $key => $value ) {
1017
-
1018
- add_post_meta( $post_id, $key, $value, true );
1019
-
1020
- // Forums need to save their old ID for group forum association
1021
- if ( ( 'forum' == $to_type ) && ( '_bbp_forum_id' == $key ) )
1022
- add_post_meta( $post_id, '_bbp_old_forum_id', $value );
1023
-
1024
- // Topics need an extra bit of metadata
1025
- // to be keyed to the new post_id
1026
- if ( ( 'topic' == $to_type ) && ( '_bbp_topic_id' == $key ) ) {
1027
-
1028
- // Update the live topic ID
1029
- update_post_meta( $post_id, $key, $post_id );
1030
-
1031
- // Save the old topic ID
1032
- add_post_meta( $post_id, '_bbp_old_topic_id', $value );
1033
- if ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
1034
- $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => '_bbp_topic_id', 'meta_value' => $post_id ) );
1035
- $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => '_bbp_old_topic_id', 'meta_value' => $value ) );
1036
- }
1037
-
1038
- } elseif ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
1039
- $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
1040
- }
1041
-
1042
- // Replies need to save their old reply_to ID for hierarchical replies association
1043
- if ( ( 'reply' == $to_type ) && ( '_bbp_reply_to' == $key ) ) {
1044
- add_post_meta( $post_id, '_bbp_old_reply_to', $value );
1045
- }
1046
- }
1047
- }
1048
- break;
1049
- }
1050
- $has_insert = true;
1051
- }
1052
- }
1053
- }
1054
- }
1055
-
1056
- return ! $has_insert;
1057
- }
1058
-
1059
- /**
1060
- * This method converts old forum heirarchy to new bbPress heirarchy.
1061
- */
1062
- public function convert_forum_parents( $start ) {
1063
-
1064
- $has_update = false;
1065
-
1066
- if ( !empty( $this->sync_table ) ) {
1067
- $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;
1068
- } else {
1069
- $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;
1070
- }
1071
-
1072
- update_option( '_bbp_converter_query', $query );
1073
-
1074
- $forum_array = $this->wpdb->get_results( $query );
1075
-
1076
- foreach ( (array) $forum_array as $row ) {
1077
- $parent_id = $this->callback_forumid( $row->meta_value );
1078
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->posts . ' SET post_parent = "' . $parent_id . '" WHERE ID = "' . $row->value_id . '" LIMIT 1' );
1079
- $has_update = true;
1080
- }
1081
-
1082
- return ! $has_update;
1083
- }
1084
-
1085
- /**
1086
- * This method converts old topic stickies to new bbPress stickies.
1087
- *
1088
- * @since bbPress (r)
1089
- *
1090
- * @uses WPDB $wpdb
1091
- * @uses bbp_stick_topic() to set the imported topic as sticky
1092
- *
1093
- */
1094
- public function convert_topic_stickies( $start ) {
1095
-
1096
- $has_update = false;
1097
-
1098
- if ( !empty( $this->sync_table ) ) {
1099
- $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;
1100
- } else {
1101
- $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;
1102
- }
1103
-
1104
- update_option( '_bbp_converter_query', $query );
1105
-
1106
- $sticky_array = $this->wpdb->get_results( $query );
1107
-
1108
- foreach ( (array) $sticky_array as $row ) {
1109
- bbp_stick_topic( $row->value_id );
1110
- $has_update = true;
1111
- }
1112
-
1113
- return ! $has_update;
1114
- }
1115
-
1116
- /**
1117
- * This method converts old topic super stickies to new bbPress super stickies.
1118
- *
1119
- * @since bbPress (r)
1120
- *
1121
- * @uses WPDB $wpdb
1122
- * @uses bbp_stick_topic() to set the imported topic as super sticky
1123
- *
1124
- */
1125
- public function convert_topic_super_stickies( $start ) {
1126
-
1127
- $has_update = false;
1128
-
1129
- if ( !empty( $this->sync_table ) ) {
1130
- $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;
1131
- } else {
1132
- $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;
1133
- }
1134
-
1135
- update_option( '_bbp_converter_query', $query );
1136
-
1137
- $sticky_array = $this->wpdb->get_results( $query );
1138
-
1139
- foreach ( (array) $sticky_array as $row ) {
1140
- $super = true;
1141
- bbp_stick_topic( $row->value_id, $super );
1142
- $has_update = true;
1143
- }
1144
-
1145
- return ! $has_update;
1146
- }
1147
-
1148
- /**
1149
- * This method converts old reply_to post id to new bbPress reply_to post id.
1150
- */
1151
- public function convert_reply_to_parents( $start ) {
1152
-
1153
- $has_update = false;
1154
-
1155
- if ( !empty( $this->sync_table ) ) {
1156
- $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;
1157
- } else {
1158
- $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;
1159
- }
1160
-
1161
- update_option( '_bbp_converter_query', $query );
1162
-
1163
- $reply_to_array = $this->wpdb->get_results( $query );
1164
-
1165
- foreach ( (array) $reply_to_array as $row ) {
1166
- $reply_to = $this->callback_reply_to( $row->meta_value );
1167
- $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' );
1168
- $has_update = true;
1169
- }
1170
-
1171
- return ! $has_update;
1172
- }
1173
-
1174
- /**
1175
- * This method deletes data from the wp database.
1176
- */
1177
- public function clean( $start ) {
1178
-
1179
- $start = 0;
1180
- $has_delete = false;
1181
-
1182
- /** Delete bbconverter topics/forums/posts ****************************/
1183
-
1184
- if ( true === $this->sync_table ) {
1185
- $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;
1186
- } else {
1187
- $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;
1188
- }
1189
-
1190
- update_option( '_bbp_converter_query', $query );
1191
-
1192
- $posts = $this->wpdb->get_results( $query, ARRAY_A );
1193
-
1194
- if ( isset( $posts[0] ) && ! empty( $posts[0]['value_id'] ) ) {
1195
- foreach ( (array) $posts as $value ) {
1196
- wp_delete_post( $value['value_id'], true );
1197
- }
1198
- $has_delete = true;
1199
- }
1200
-
1201
- /** Delete bbconverter users ******************************************/
1202
-
1203
- if ( true === $this->sync_table ) {
1204
- $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;
1205
- } else {
1206
- $query = 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_user_id" LIMIT ' . $this->max_rows;
1207
- }
1208
-
1209
- update_option( '_bbp_converter_query', $query );
1210
-
1211
- $users = $this->wpdb->get_results( $query, ARRAY_A );
1212
-
1213
- if ( !empty( $users ) ) {
1214
- foreach ( $users as $value ) {
1215
- wp_delete_user( $value['value_id'] );
1216
- }
1217
- $has_delete = true;
1218
- }
1219
-
1220
- unset( $posts );
1221
- unset( $users );
1222
-
1223
- return ! $has_delete;
1224
- }
1225
-
1226
- /**
1227
- * This method deletes passwords from the wp database.
1228
- *
1229
- * @param int Start row
1230
- */
1231
- public function clean_passwords( $start ) {
1232
-
1233
- $has_delete = false;
1234
-
1235
- /** Delete bbconverter passwords **************************************/
1236
-
1237
- $query = 'SELECT user_id, meta_value FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" LIMIT ' . $start . ', ' . $this->max_rows;
1238
- update_option( '_bbp_converter_query', $query );
1239
-
1240
- $bbconverter = $this->wpdb->get_results( $query, ARRAY_A );
1241
-
1242
- if ( !empty( $bbconverter ) ) {
1243
-
1244
- foreach ( $bbconverter as $value ) {
1245
- if ( is_serialized( $value['meta_value'] ) ) {
1246
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "" ' . 'WHERE ID = "' . $value['user_id'] . '"' );
1247
- } else {
1248
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . $value['meta_value'] . '" ' . 'WHERE ID = "' . $value['user_id'] . '"' );
1249
- $this->wpdb->query( 'DELETE FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $value['user_id'] . '"' );
1250
- }
1251
- }
1252
- $has_delete = true;
1253
- }
1254
-
1255
- return ! $has_delete;
1256
- }
1257
-
1258
- /**
1259
- * This method implements the authentication for the different forums.
1260
- *
1261
- * @param string Unencoded password.
1262
- */
1263
- abstract protected function authenticate_pass( $password, $hash );
1264
-
1265
- /**
1266
- * Info
1267
- */
1268
- abstract protected function info();
1269
-
1270
- /**
1271
- * This method grabs appropriate fields from the table specified
1272
- *
1273
- * @param string The table name to grab fields from
1274
- */
1275
- private function get_fields( $tablename ) {
1276
- $rval = array();
1277
- $field_array = $this->wpdb->get_results( 'DESCRIBE ' . $tablename, ARRAY_A );
1278
-
1279
- foreach ( $field_array as $field ) {
1280
- $rval[] = $field['Field'];
1281
- }
1282
-
1283
- if ( $tablename == $this->wpdb->users ) {
1284
- $rval[] = 'role';
1285
- $rval[] = 'yim';
1286
- $rval[] = 'aim';
1287
- $rval[] = 'jabber';
1288
- }
1289
- return $rval;
1290
- }
1291
-
1292
- /** Callbacks *************************************************************/
1293
-
1294
- /**
1295
- * Run password through wp_hash_password()
1296
- *
1297
- * @param string $username
1298
- * @param string $password
1299
- */
1300
- public function callback_pass( $username, $password ) {
1301
- $user = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT * FROM ' . $this->wpdb->users . ' WHERE user_login = "%s" AND user_pass = "" LIMIT 1', $username ) );
1302
- if ( !empty( $user ) ) {
1303
- $usermeta = $this->wpdb->get_row( 'SELECT * FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '" LIMIT 1' );
1304
-
1305
- if ( !empty( $usermeta ) ) {
1306
- if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
1307
- $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . wp_hash_password( $password ) . '" ' . 'WHERE ID = "' . $user->ID . '"' );
1308
- $this->wpdb->query( 'DELETE FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '"' );
1309
- }
1310
- }
1311
- }
1312
- }
1313
-
1314
- /**
1315
- * A mini cache system to reduce database calls to forum ID's
1316
- *
1317
- * @param string $field
1318
- * @return string
1319
- */
1320
- private function callback_forumid( $field ) {
1321
- if ( !isset( $this->map_forumid[$field] ) ) {
1322
- if ( !empty( $this->sync_table ) ) {
1323
- $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 ) );
1324
- } else {
1325
- $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 ) );
1326
- }
1327
-
1328
- if ( !is_null( $row ) ) {
1329
- $this->map_forumid[$field] = $row->value_id;
1330
- } else {
1331
- $this->map_forumid[$field] = 0;
1332
- }
1333
- }
1334
- return $this->map_forumid[$field];
1335
- }
1336
-
1337
- /**
1338
- * A mini cache system to reduce database calls to topic ID's
1339
- *
1340
- * @param string $field
1341
- * @return string
1342
- */
1343
- private function callback_topicid( $field ) {
1344
- if ( !isset( $this->map_topicid[$field] ) ) {
1345
- if ( !empty( $this->sync_table ) ) {
1346
- $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 ) );
1347
- } else {
1348
- $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 ) );
1349
- }
1350
-
1351
- if ( !is_null( $row ) ) {
1352
- $this->map_topicid[$field] = $row->value_id;
1353
- } else {
1354
- $this->map_topicid[$field] = 0;
1355
- }
1356
- }
1357
- return $this->map_topicid[$field];
1358
- }
1359
-
1360
- /**
1361
- * A mini cache system to reduce database calls to reply_to post id.
1362
- *
1363
- * @param string $field
1364
- * @return string
1365
- */
1366
- private function callback_reply_to( $field ) {
1367
- if ( !isset( $this->map_reply_to[$field] ) ) {
1368
- if ( !empty( $this->sync_table ) ) {
1369
- $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 ) );
1370
- } else {
1371
- $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 ) );
1372
- }
1373
-
1374
- if ( !is_null( $row ) ) {
1375
- $this->map_reply_to[$field] = $row->value_id;
1376
- } else {
1377
- $this->map_reply_to[$field] = 0;
1378
- }
1379
- }
1380
- return $this->map_reply_to[$field];
1381
- }
1382
-
1383
- /**
1384
- * A mini cache system to reduce database calls to user ID's
1385
- *
1386
- * @param string $field
1387
- * @return string
1388
- */
1389
- private function callback_userid( $field ) {
1390
- if ( !isset( $this->map_userid[$field] ) ) {
1391
- if ( !empty( $this->sync_table ) ) {
1392
- $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 ) );
1393
- } else {
1394
- $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 ) );
1395
- }
1396
-
1397
- if ( !is_null( $row ) ) {
1398
- $this->map_userid[$field] = $row->value_id;
1399
- } else {
1400
- if ( !empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {
1401
- $this->map_userid[$field] = 0;
1402
- } else {
1403
- $this->map_userid[$field] = $field;
1404
- }
1405
- }
1406
- }
1407
- return $this->map_userid[$field];
1408
- }
1409
-
1410
- /**
1411
- * A mini cache system to reduce database calls map topics ID's to forum ID's
1412
- *
1413
- * @param string $field
1414
- * @return string
1415
- */
1416
- private function callback_topicid_to_forumid( $field ) {
1417
- $topicid = $this->callback_topicid( $field );
1418
- if ( empty( $topicid ) ) {
1419
- $this->map_topicid_to_forumid[$topicid] = 0;
1420
- } elseif ( ! isset( $this->map_topicid_to_forumid[$topicid] ) ) {
1421
- $row = $this->wpdb->get_row( 'SELECT post_parent FROM ' . $this->wpdb->posts . ' WHERE ID = "' . $topicid . '" LIMIT 1' );
1422
-
1423
- if ( !is_null( $row ) ) {
1424
- $this->map_topicid_to_forumid[$topicid] = $row->post_parent;
1425
- } else {
1426
- $this->map_topicid_to_forumid[$topicid] = 0;
1427
- }
1428
- }
1429
-
1430
- return $this->map_topicid_to_forumid[$topicid];
1431
- }
1432
-
1433
- protected function callback_slug( $field ) {
1434
- return sanitize_title( $field );
1435
- }
1436
-
1437
- protected function callback_negative( $field ) {
1438
- if ( $field < 0 ) {
1439
- return 0;
1440
- } else {
1441
- return $field;
1442
- }
1443
- }
1444
-
1445
- protected function callback_html( $field ) {
1446
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
1447
- $bbcode = BBCode::getInstance();
1448
- return html_entity_decode( $bbcode->Parse( $field ) );
1449
- }
1450
-
1451
- protected function callback_null( $field ) {
1452
- if ( is_null( $field ) ) {
1453
- return '';
1454
- } else {
1455
- return $field;
1456
- }
1457
- }
1458
-
1459
- protected function callback_datetime( $field ) {
1460
- if ( is_numeric( $field ) ) {
1461
- return date( 'Y-m-d H:i:s', $field );
1462
- } else {
1463
- return date( 'Y-m-d H:i:s', strtotime( $field ) );
1464
- }
1465
- }
1466
- }
1467
-
1468
- /**
1469
- * This is a function that is purposely written to look like a "new" statement.
1470
- * It is basically a dynamic loader that will load in the platform conversion
1471
- * of your choice.
1472
- *
1473
- * @param string $platform Name of valid platform class.
1474
- */
1475
- function bbp_new_converter( $platform ) {
1476
- $found = false;
1477
-
1478
- if ( $curdir = opendir( bbpress()->admin->admin_dir . 'converters/' ) ) {
1479
- while ( $file = readdir( $curdir ) ) {
1480
- if ( stristr( $file, '.php' ) && stristr( $file, 'index' ) === FALSE ) {
1481
- $file = preg_replace( '/.php/', '', $file );
1482
- if ( $platform == $file ) {
1483
- $found = true;
1484
- continue;
1485
- }
1486
- }
1487
- }
1488
- closedir( $curdir );
1489
- }
1490
-
1491
- if ( true === $found ) {
1492
- require_once( bbpress()->admin->admin_dir . 'converters/' . $platform . '.php' );
1493
- return new $platform;
1494
- } else {
1495
- return null;
1496
- }
1497
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/AEF.php CHANGED
@@ -1,21 +1,26 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of AEF Forum converter.
5
  *
6
- * @since bbPress (r5139)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/aef
 
8
  */
9
  class AEF extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
- *
14
- * @uses AEF::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +30,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 +43,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 +112,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 +152,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 +251,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 +318,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 +330,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 +373,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 +423,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 +440,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 +501,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 +509,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)
@@ -581,8 +567,7 @@ class AEF extends BBP_Converter_Base {
581
  * This method allows us to indicates what is or is not converted for each
582
  * converter.
583
  */
584
- public function info()
585
- {
586
  return '';
587
  }
588
 
@@ -591,8 +576,7 @@ class AEF extends BBP_Converter_Base {
591
  * way when we authenticate it we can get it out of the database
592
  * as one value. Array values are auto sanitized by WordPress.
593
  */
594
- public function callback_savepass( $field, $row )
595
- {
596
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
597
  return $pass_array;
598
  }
@@ -601,14 +585,13 @@ class AEF extends BBP_Converter_Base {
601
  * This method is to take the pass out of the database and compare
602
  * to a pass the user has typed in.
603
  */
604
- public function authenticate_pass( $password, $serialized_pass )
605
- {
606
  $pass_array = unserialize( $serialized_pass );
607
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
608
  }
609
 
610
  /**
611
- * Translate the forum status from AEF v1.0.9 numeric's to WordPress's strings.
612
  *
613
  * @param int $status AEF v1.0.9 numeric forum status
614
  * @return string WordPress safe
@@ -628,7 +611,7 @@ class AEF extends BBP_Converter_Base {
628
  }
629
 
630
  /**
631
- * Translate the post status from AEF v1.0.9 numeric's to WordPress's strings.
632
  *
633
  * @param int $status AEF v1.0.9 numeric topic status
634
  * @return string WordPress safe
@@ -648,7 +631,7 @@ class AEF extends BBP_Converter_Base {
648
  }
649
 
650
  /**
651
- * Translate the topic sticky status type from AEF 1.x numeric's to WordPress's strings.
652
  *
653
  * @param int $status AEF 1.x numeric forum type
654
  * @return string WordPress safe
@@ -677,15 +660,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
 
19
  /**
20
  * Main Constructor
 
 
21
  */
22
+ public function __construct() {
23
  parent::__construct();
 
24
  }
25
 
26
  /**
30
 
31
  /** Forum Section *****************************************************/
32
 
33
+ // Old forum id (Stored in postmeta)
34
  $this->field_map[] = array(
35
  'from_tablename' => 'forums',
36
  'from_fieldname' => 'fid',
37
  'to_type' => 'forum',
38
+ 'to_fieldname' => '_bbp_old_forum_id'
39
  );
40
 
41
  // Forum parent id (If no parent, then 0, Stored in postmeta)
43
  'from_tablename' => 'forums',
44
  'from_fieldname' => 'par_board_id',
45
  'to_type' => 'forum',
46
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
47
  );
48
 
49
  // Forum topic count (Stored in postmeta)
112
  'to_fieldname' => 'menu_order'
113
  );
114
 
115
+ // Forum type (Set a default value 'forum', Stored in postmeta)
116
+ $this->field_map[] = array(
117
+ 'to_type' => 'forum',
118
+ 'to_fieldname' => '_bbp_forum_type',
119
+ 'default' => 'forum'
120
+ );
121
+
122
  // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta)
123
  $this->field_map[] = array(
124
  'from_tablename' => 'forums',
152
 
153
  /** Topic Section *****************************************************/
154
 
155
+ // Old topic id (Stored in postmeta)
156
  $this->field_map[] = array(
157
  'from_tablename' => 'topics',
158
  'from_fieldname' => 'tid',
159
  'to_type' => 'topic',
160
+ 'to_fieldname' => '_bbp_old_topic_id'
161
  );
162
 
163
  // Topic reply count (Stored in postmeta)
251
  'callback_method' => 'callback_forumid'
252
  );
253
 
254
+ // Sticky status (Stored in postmeta)
255
  $this->field_map[] = array(
256
  'from_tablename' => 'topics',
257
  'from_fieldname' => 't_sticky',
258
  'to_type' => 'topic',
259
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
260
  'callback_method' => 'callback_sticky_status'
261
  );
262
 
318
  'from_tablename' => 'topics',
319
  'from_fieldname' => 't_status',
320
  'to_type' => 'topic',
321
+ 'to_fieldname' => '_bbp_old_closed_status_id',
322
  'callback_method' => 'callback_topic_status'
323
  );
324
 
330
 
331
  /** Reply Section *****************************************************/
332
 
333
+ // Old reply id (Stored in postmeta)
334
  $this->field_map[] = array(
335
  'from_tablename' => 'posts',
336
  'from_fieldname' => 'pid',
337
  'to_type' => 'reply',
338
+ 'to_fieldname' => '_bbp_old_reply_id'
339
  );
340
 
341
  // Reply parent forum id (If no parent, then 0, Stored in postmeta)
373
  'callback_method' => 'callback_userid'
374
  );
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  // Reply content.
377
  $this->field_map[] = array(
378
  'from_tablename' => 'posts',
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 serialized with salt)
435
  $this->field_map[] = array(
436
  'from_tablename' => 'users',
437
  'from_fieldname' => 'password',
440
  'callback_method' => 'callback_savepass'
441
  );
442
 
443
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
444
  $this->field_map[] = array(
445
  'from_tablename' => 'users',
446
  'from_fieldname' => 'salt',
501
  'from_tablename' => 'users',
502
  'from_fieldname' => 'aim',
503
  'to_type' => 'user',
504
+ 'to_fieldname' => '_bbp_aef_user_aim'
505
  );
506
 
507
  // User Yahoo (Stored in usermeta)
509
  'from_tablename' => 'users',
510
  'from_fieldname' => 'yim',
511
  'to_type' => 'user',
512
+ 'to_fieldname' => '_bbp_aef_user_yim'
513
  );
514
 
515
  // Store ICQ (Stored in usermeta)
567
  * This method allows us to indicates what is or is not converted for each
568
  * converter.
569
  */
570
+ public function info() {
 
571
  return '';
572
  }
573
 
576
  * way when we authenticate it we can get it out of the database
577
  * as one value. Array values are auto sanitized by WordPress.
578
  */
579
+ public function callback_savepass( $field, $row ) {
 
580
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
581
  return $pass_array;
582
  }
585
  * This method is to take the pass out of the database and compare
586
  * to a pass the user has typed in.
587
  */
588
+ public function authenticate_pass( $password, $serialized_pass ) {
 
589
  $pass_array = unserialize( $serialized_pass );
590
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
591
  }
592
 
593
  /**
594
+ * Translate the forum status from AEF v1.0.9 numerics to WordPress's strings.
595
  *
596
  * @param int $status AEF v1.0.9 numeric forum status
597
  * @return string WordPress safe
611
  }
612
 
613
  /**
614
+ * Translate the post status from AEF v1.0.9 numerics to WordPress's strings.
615
  *
616
  * @param int $status AEF v1.0.9 numeric topic status
617
  * @return string WordPress safe
631
  }
632
 
633
  /**
634
+ * Translate the topic sticky status type from AEF 1.x numerics to WordPress's strings.
635
  *
636
  * @param int $status AEF 1.x numeric forum type
637
  * @return string WordPress safe
660
  $count = absint( (int) $count - 1 );
661
  return $count;
662
  }
663
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Drupal7.php CHANGED
@@ -1,21 +1,26 @@
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
 
11
  /**
12
  * Main Constructor
13
- *
14
- * @uses Drupal7::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +30,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 +47,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 +84,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 +122,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 +170,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 +228,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 +294,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 +353,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 +384,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 +404,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 +484,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 +503,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',
@@ -508,8 +565,7 @@ class Drupal7 extends BBP_Converter_Base {
508
  * This method allows us to indicates what is or is not converted for each
509
  * converter.
510
  */
511
- public function info()
512
- {
513
  return '';
514
  }
515
 
@@ -518,8 +574,7 @@ class Drupal7 extends BBP_Converter_Base {
518
  * way when we authenticate it we can get it out of the database
519
  * as one value. Array values are auto sanitized by WordPress.
520
  */
521
- public function callback_savepass( $field, $row )
522
- {
523
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
524
  return $pass_array;
525
  }
@@ -528,14 +583,34 @@ class Drupal7 extends BBP_Converter_Base {
528
  * This method is to take the pass out of the database and compare
529
  * to a pass the user has typed in.
530
  */
531
- public function authenticate_pass( $password, $serialized_pass )
532
- {
533
  $pass_array = unserialize( $serialized_pass );
534
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
535
  }
536
 
537
  /**
538
- * Translate the post status from Drupal v7.x numeric's to WordPress's strings.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  *
540
  * @param int $status Drupal v7.x numeric topic status
541
  * @return string WordPress safe
@@ -555,7 +630,7 @@ class Drupal7 extends BBP_Converter_Base {
555
  }
556
 
557
  /**
558
- * Translate the topic sticky status type from Drupal v7.x numeric's to WordPress's strings.
559
  *
560
  * @param int $status Drupal v7.x numeric forum type
561
  * @return string WordPress safe
@@ -584,4 +659,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
 
19
  /**
20
  * Main Constructor
 
 
21
  */
22
+ public function __construct() {
23
  parent::__construct();
 
24
  }
25
 
26
  /**
30
 
31
  /** Forum Section *****************************************************/
32
 
33
+ // Old forum id (Stored in postmeta)
34
  $this->field_map[] = array(
35
  'from_tablename' => 'taxonomy_term_data',
36
  'from_fieldname' => 'tid',
37
  'to_type' => 'forum',
38
+ 'to_fieldname' => '_bbp_old_forum_id'
39
  );
40
 
41
  // Forum parent id (If no parent, then 0, Stored in postmeta)
47
  'join_expression' => 'USING (tid)',
48
  'from_expression' => 'LEFT JOIN taxonomy_vocabulary AS taxonomy_vocabulary USING (vid) WHERE module = "forum"',
49
  'to_type' => 'forum',
50
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
51
  );
52
 
53
  // Forum title.
84
  'to_fieldname' => 'menu_order'
85
  );
86
 
87
+ // Forum type (Set a default value 'forum', Stored in postmeta)
88
+ $this->field_map[] = array(
89
+ 'to_type' => 'forum',
90
+ 'to_fieldname' => '_bbp_forum_type',
91
+ 'default' => 'forum'
92
+ );
93
+
94
+ // Forum status (Set a default value 'open', Stored in postmeta)
95
+ $this->field_map[] = array(
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => '_bbp_status',
98
+ 'default' => 'open'
99
+ );
100
+
101
  // Forum dates.
102
  $this->field_map[] = array(
103
  'to_type' => 'forum',
122
 
123
  /** Topic Section *****************************************************/
124
 
125
+ // Old topic id (Stored in postmeta)
126
  $this->field_map[] = array(
127
  'from_tablename' => 'forum_index',
128
  'from_fieldname' => 'nid',
129
  'to_type' => 'topic',
130
+ 'to_fieldname' => '_bbp_old_topic_id'
131
  );
132
 
133
  // Topic reply count (Stored in postmeta)
170
  'callback_method' => 'callback_userid'
171
  );
172
 
173
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
174
+ $this->field_map[] = array(
175
+ 'to_type' => 'topic',
176
+ 'to_fieldname' => '_bbp_old_topic_author_name_id',
177
+ 'default' => 'Anonymous'
178
+ );
179
+
180
+ // Is the topic anonymous (Stored in postmeta)
181
+ $this->field_map[] = array(
182
+ 'from_tablename' => 'node',
183
+ 'from_fieldname' => 'uid',
184
+ 'join_tablename' => 'forum_index',
185
+ 'join_type' => 'INNER',
186
+ 'join_expression' => 'ON node.nid = forum_index.nid',
187
+ 'to_type' => 'topic',
188
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
189
+ 'callback_method' => 'callback_check_anonymous'
190
+ );
191
+
192
  // Topic content.
193
  // Note: We join the 'field_data_body' table because 'node' or 'forum_index' table does not include topic content.
194
  $this->field_map[] = array(
228
  'callback_method' => 'callback_forumid'
229
  );
230
 
231
+ // Topic status (Publish or Unpublished, Drupal v7.x publish = 1, pending = 0)
232
+ $this->field_map[] = array(
233
+ 'from_tablename' => 'node',
234
+ 'from_fieldname' => 'status',
235
+ 'join_tablename' => 'forum_index',
236
+ 'join_type' => 'INNER',
237
+ 'join_expression' => 'ON node.nid = forum_index.nid',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => 'post_status',
240
+ 'callback_method' => 'callback_status'
241
+ );
242
+
243
+ // Sticky status (Stored in postmeta)
244
  $this->field_map[] = array(
245
  'from_tablename' => 'forum_index',
246
  'from_fieldname' => 'sticky',
247
  'to_type' => 'topic',
248
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
249
  'callback_method' => 'callback_sticky_status'
250
  );
251
 
294
  'join_type' => 'INNER',
295
  'join_expression' => 'ON node.nid = forum_index.nid',
296
  'to_type' => 'topic',
297
+ 'to_fieldname' => '_bbp_old_closed_status_id',
298
  'callback_method' => 'callback_topic_status'
299
  );
300
 
353
 
354
  /** Reply Section *****************************************************/
355
 
356
+ // Old reply id (Stored in postmeta)
357
  $this->field_map[] = array(
358
  'from_tablename' => 'comment',
359
  'from_fieldname' => 'cid',
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' => 'comment',
367
+ 'from_fieldname' => 'nid',
 
 
 
368
  'to_type' => 'reply',
369
  'to_fieldname' => '_bbp_forum_id',
370
  'callback_method' => 'callback_topicid_to_forumid'
384
  'from_tablename' => 'comment',
385
  'from_fieldname' => 'pid',
386
  'to_type' => 'reply',
387
+ 'to_fieldname' => '_bbp_old_reply_to_id'
388
  );
389
 
390
  // Reply author ip (Stored in postmeta)
404
  'callback_method' => 'callback_userid'
405
  );
406
 
407
+ // Reply status (Publish or Unpublished, Drupal v7.x publish = 1, pending = 0)
408
+ $this->field_map[] = array(
409
+ 'from_tablename' => 'comment',
410
+ 'from_fieldname' => 'status',
411
+ 'to_type' => 'reply',
412
+ 'to_fieldname' => 'post_status',
413
+ 'callback_method' => 'callback_status'
414
+ );
415
+
416
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
417
  $this->field_map[] = array(
418
  'from_tablename' => 'comment',
419
+ 'from_fieldname' => 'name',
420
  'to_type' => 'reply',
421
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
422
  );
423
 
424
+ // Is the reply anonymous (Stored in postmeta)
425
  $this->field_map[] = array(
426
  'from_tablename' => 'comment',
427
+ 'from_fieldname' => 'uid',
428
  'to_type' => 'reply',
429
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
430
+ 'callback_method' => 'callback_check_anonymous'
431
  );
432
 
433
  // Reply content.
484
 
485
  /** User Section ******************************************************/
486
 
487
+ // Store old user id (Stored in usermeta)
488
+ // Don't import user uid = 0, this is Drupal 7's guest user
489
  $this->field_map[] = array(
490
+ 'from_tablename' => 'users',
491
+ 'from_fieldname' => 'uid',
492
+ 'from_expression' => 'WHERE uid != 0',
493
+ 'to_type' => 'user',
494
+ 'to_fieldname' => '_bbp_old_user_id'
495
  );
496
 
497
+ // Store old user password (Stored in usermeta serialized with salt)
498
  $this->field_map[] = array(
499
  'from_tablename' => 'users',
500
  'from_fieldname' => 'pass',
503
  // 'callback_method' => 'callback_savepass'
504
  );
505
 
506
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
507
  $this->field_map[] = array(
508
  'from_tablename' => 'users',
509
  'from_fieldname' => 'pass',
565
  * This method allows us to indicates what is or is not converted for each
566
  * converter.
567
  */
568
+ public function info() {
 
569
  return '';
570
  }
571
 
574
  * way when we authenticate it we can get it out of the database
575
  * as one value. Array values are auto sanitized by WordPress.
576
  */
577
+ public function callback_savepass( $field, $row ) {
 
578
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
579
  return $pass_array;
580
  }
583
  * This method is to take the pass out of the database and compare
584
  * to a pass the user has typed in.
585
  */
586
+ public function authenticate_pass( $password, $serialized_pass ) {
 
587
  $pass_array = unserialize( $serialized_pass );
588
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
589
  }
590
 
591
  /**
592
+ * Translate the post status from Drupal v7.x numerics to WordPress's
593
+ * strings.
594
+ *
595
+ * @param int $status Drupal v7.x numeric post status
596
+ * @return string WordPress safe
597
+ */
598
+ public function callback_status( $status = 1 ) {
599
+ switch ( $status ) {
600
+ case 0 :
601
+ $status = 'pending'; // bbp_get_pending_status_id()
602
+ break;
603
+
604
+ case 1 :
605
+ default :
606
+ $status = 'publish'; // bbp_get_public_status_id()
607
+ break;
608
+ }
609
+ return $status;
610
+ }
611
+
612
+ /**
613
+ * Translate the post status from Drupal v7.x numerics to WordPress's strings.
614
  *
615
  * @param int $status Drupal v7.x numeric topic status
616
  * @return string WordPress safe
630
  }
631
 
632
  /**
633
+ * Translate the topic sticky status type from Drupal v7.x numerics to WordPress's strings.
634
  *
635
  * @param int $status Drupal v7.x numeric forum type
636
  * @return string WordPress safe
659
  $count = absint( (int) $count - 1 );
660
  return $count;
661
  }
662
+ }
includes/admin/converters/Example.php CHANGED
@@ -1,21 +1,26 @@
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
 
11
  /**
12
  * Main Constructor
13
- *
14
- * @uses Example_Converter::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -27,12 +32,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 +45,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 +114,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 +165,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 +266,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 +284,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 +397,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 +453,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 +482,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 +557,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 +574,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 +646,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
 
19
  /**
20
  * Main Constructor
 
 
21
  */
22
+ public function __construct() {
23
  parent::__construct();
 
24
  }
25
 
26
  /**
32
 
33
  // Setup table joins for the forum section at the base of this section
34
 
35
+ // Old forum id (Stored in postmeta)
36
  $this->field_map[] = array(
37
  'from_tablename' => 'forums_table',
38
  'from_fieldname' => 'the_forum_id',
39
  'to_type' => 'forum',
40
+ 'to_fieldname' => '_bbp_old_forum_id'
41
  );
42
 
43
  // Forum parent id (If no parent, then 0. Stored in postmeta)
45
  'from_tablename' => 'forums_table',
46
  'from_fieldname' => 'the_parent_id',
47
  'to_type' => 'forum',
48
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
49
  );
50
 
51
  // Forum topic count (Stored in postmeta)
114
  'to_fieldname' => 'menu_order'
115
  );
116
 
117
+ // Forum type (Category = 0 or Forum = 1, Stored in postmeta)
118
+ $this->field_map[] = array(
119
+ 'from_tablename' => 'forums_table',
120
+ 'from_fieldname' => 'the_forum_type',
121
+ 'to_type' => 'forum',
122
+ 'to_fieldname' => '_bbp_forum_type',
123
+ 'callback_method' => 'callback_forum_type'
124
+ );
125
+
126
+ // Forum status (Unlocked = 0 or Locked = 1, Stored in postmeta)
127
+ $this->field_map[] = array(
128
+ 'from_tablename' => 'forums_table',
129
+ 'from_fieldname' => 'the_forum_status',
130
+ 'to_type' => 'forum',
131
+ 'to_fieldname' => '_bbp_status',
132
+ 'callback_method' => 'callback_forum_status'
133
+ );
134
+
135
  // Forum dates.
136
  $this->field_map[] = array(
137
  'to_type' => 'forum',
165
  'to_type' => 'forum'
166
  );
167
 
168
+ /** Forum Subscriptions Section ***************************************/
169
+
170
+ // Subscribed forum ID (Stored in usermeta)
171
+ $this->field_map[] = array(
172
+ 'from_tablename' => 'forum_subscriptions_table',
173
+ 'from_fieldname' => 'the_forum_id',
174
+ 'to_type' => 'forum_subscriptions',
175
+ 'to_fieldname' => '_bbp_forum_subscriptions'
176
+ );
177
+
178
+ // Subscribed user ID (Stored in usermeta)
179
+ $this->field_map[] = array(
180
+ 'from_tablename' => 'forum_subscriptions_table',
181
+ 'from_fieldname' => 'the_user_id',
182
+ 'to_type' => 'forum_subscriptions',
183
+ 'to_fieldname' => 'user_id',
184
+ 'callback_method' => 'callback_userid'
185
+ );
186
+
187
  /** Topic Section *****************************************************/
188
 
189
  // Setup table joins for the topic section at the base of this section
190
 
191
+ // Old topic id (Stored in postmeta)
192
  $this->field_map[] = array(
193
  'from_tablename' => 'topics_table',
194
  'from_fieldname' => 'the_topic_id',
195
  'to_type' => 'topic',
196
+ 'to_fieldname' => '_bbp_old_topic_id'
197
  );
198
 
199
  // Topic reply count (Stored in postmeta)
266
  'callback_method' => 'callback_slug'
267
  );
268
 
269
+ // Topic status (Open or Closed)
270
+ $this->field_map[] = array(
271
+ 'from_tablename' => 'topics_table',
272
+ 'from_fieldname' => 'the_topic_status',
273
+ 'to_type' => 'topic',
274
+ 'to_fieldname' => '_bbp_old_closed_status_id',
275
+ 'callback_method' => 'callback_topic_status'
276
+ );
277
+
278
  // Topic parent forum id (If no parent, then 0)
279
  $this->field_map[] = array(
280
  'from_tablename' => 'topics_table',
284
  'callback_method' => 'callback_forumid'
285
  );
286
 
287
+ // Sticky status (Stored in postmeta)
288
  $this->field_map[] = array(
289
  'from_tablename' => 'topics_table',
290
  'from_fieldname' => 'the_topic_sticky_status',
291
  'to_type' => 'topic',
292
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
293
  'callback_method' => 'callback_sticky_status'
294
  );
295
 
397
  'to_fieldname' => 'description'
398
  );
399
 
400
+ /** Topic Subscriptions Section ***************************************/
401
+
402
+ // Subscribed topic ID (Stored in usermeta)
403
+ $this->field_map[] = array(
404
+ 'from_tablename' => 'topic_subscriptions_table',
405
+ 'from_fieldname' => 'the_topic_id',
406
+ 'to_type' => 'topic_subscriptions',
407
+ 'to_fieldname' => '_bbp_subscriptions'
408
+ );
409
+
410
+ // Subscribed user ID (Stored in usermeta)
411
+ $this->field_map[] = array(
412
+ 'from_tablename' => 'topic_subscriptions_table',
413
+ 'from_fieldname' => 'the_user_id',
414
+ 'to_type' => 'topic_subscriptions',
415
+ 'to_fieldname' => 'user_id',
416
+ 'callback_method' => 'callback_userid'
417
+ );
418
+
419
+ /** Favorites Section *************************************************/
420
+
421
+ // Favorited topic ID (Stored in usermeta)
422
+ $this->field_map[] = array(
423
+ 'from_tablename' => 'favorites_table',
424
+ 'from_fieldname' => 'the_favorite_topic_id',
425
+ 'to_type' => 'favorites',
426
+ 'to_fieldname' => '_bbp_favorites'
427
+ );
428
+
429
+ // Favorited user ID (Stored in usermeta)
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'favorites_table',
432
+ 'from_fieldname' => 'the_user_id',
433
+ 'to_type' => 'favorites',
434
+ 'to_fieldname' => 'user_id',
435
+ 'callback_method' => 'callback_userid'
436
+ );
437
+
438
  /** Reply Section *****************************************************/
439
 
440
  // Setup table joins for the reply section at the base of this section
441
 
442
+ // Old reply id (Stored in postmeta)
443
  $this->field_map[] = array(
444
  'from_tablename' => 'replies_table',
445
  'from_fieldname' => 'the_reply_id',
446
  'to_type' => 'reply',
447
+ 'to_fieldname' => '_bbp_old_reply_id'
448
  );
449
 
450
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
453
  'from_fieldname' => 'the_reply_parent_forum_id',
454
  'to_type' => 'reply',
455
  'to_fieldname' => '_bbp_forum_id',
456
+ 'callback_method' => 'callback_forumid'
457
  );
458
 
459
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
482
  'callback_method' => 'callback_userid'
483
  );
484
 
485
+ // Reply title and reply slugs
486
+ // Note: We don't actually want either a reply title or a reply slug as
487
+ // we want single replies to use their ID as the permalink.
 
 
 
 
 
 
 
 
 
 
 
 
 
488
 
489
  // Reply content.
490
  $this->field_map[] = array(
557
 
558
  // Setup table joins for the user section at the base of this section
559
 
560
+ // Store old user id (Stored in usermeta)
561
  $this->field_map[] = array(
562
  'from_tablename' => 'users_table',
563
  'from_fieldname' => 'the_users_id',
564
  'to_type' => 'user',
565
+ 'to_fieldname' => '_bbp_old_user_id'
566
  );
567
 
568
+ // Store old user password (Stored in usermeta serialized with salt)
569
  $this->field_map[] = array(
570
  'from_tablename' => 'users_table',
571
  'from_fieldname' => 'the_users_password',
574
  'callback_method' => 'callback_savepass'
575
  );
576
 
577
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
578
  $this->field_map[] = array(
579
  'from_tablename' => 'users_table',
580
  'from_fieldname' => 'the_users_password_salt',
646
  'to_fieldname' => 'display_name'
647
  );
648
 
649
+ // User Profile Field 1 (Stored in usermeta)
650
  $this->field_map[] = array(
651
  'from_tablename' => 'users_table',
652
+ 'from_fieldname' => 'the_users_custom_profile_field_1',
653
  'to_type' => 'user',
654
+ 'to_fieldname' => '_bbp_example_profile_field_1'
655
  );
656
 
657
+ // User Profile Field 2 (Stored in usermeta)
658
  $this->field_map[] = array(
659
  'from_tablename' => 'users_table',
660
+ 'from_fieldname' => 'the_users_custom_profile_field_2',
661
  'to_type' => 'user',
662
+ 'to_fieldname' => '_bbp_example_profile_field_2'
663
  );
664
 
665
+ // User Profile Field 3 (Stored in usermeta)
666
  $this->field_map[] = array(
667
  'from_tablename' => 'users_table',
668
+ 'from_fieldname' => 'the_users_custom_profile_field_3',
669
  'to_type' => 'user',
670
+ 'to_fieldname' => '_bbp_example_profile_field_3'
671
  );
672
 
673
  // Setup any table joins needed for the user section
includes/admin/converters/FluxBB.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of FluxBB Forum converter.
5
  *
6
- * @since bbPress (r5138)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/fluxbb
 
8
  */
9
  class FluxBB extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses FluxBB::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +31,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 +105,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 +141,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 +261,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 +312,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 +322,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 +386,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 +436,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 +453,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 +522,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 +530,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 +538,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)
@@ -556,8 +588,7 @@ class FluxBB extends BBP_Converter_Base {
556
  * This method allows us to indicates what is or is not converted for each
557
  * converter.
558
  */
559
- public function info()
560
- {
561
  return '';
562
  }
563
 
@@ -566,8 +597,7 @@ class FluxBB extends BBP_Converter_Base {
566
  * way when we authenticate it we can get it out of the database
567
  * as one value. Array values are auto sanitized by WordPress.
568
  */
569
- public function callback_savepass( $field, $row )
570
- {
571
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
572
  return $pass_array;
573
  }
@@ -576,14 +606,13 @@ class FluxBB extends BBP_Converter_Base {
576
  * This method is to take the pass out of the database and compare
577
  * to a pass the user has typed in.
578
  */
579
- public function authenticate_pass( $password, $serialized_pass )
580
- {
581
  $pass_array = unserialize( $serialized_pass );
582
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
583
  }
584
 
585
  /**
586
- * Translate the post status from FluxBB v1.5.3 numeric's to WordPress's strings.
587
  *
588
  * @param int $status FluxBB v1.5.3 numeric topic status
589
  * @return string WordPress safe
@@ -603,7 +632,7 @@ class FluxBB extends BBP_Converter_Base {
603
  }
604
 
605
  /**
606
- * Translate the topic sticky status type from FluxBB v1.5.3 numeric's to WordPress's strings.
607
  *
608
  * @param int $status FluxBB v1.5.3 numeric forum type
609
  * @return string WordPress safe
@@ -632,15 +661,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
31
 
32
  /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
35
  $this->field_map[] = array(
36
  'from_tablename' => 'forums',
37
  'from_fieldname' => 'id',
38
  'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
  // Forum topic count (Stored in postmeta)
105
  'to_fieldname' => 'menu_order'
106
  );
107
 
108
+ // Forum type (Set a default value 'forum', Stored in postmeta)
109
+ $this->field_map[] = array(
110
+ 'to_type' => 'forum',
111
+ 'to_fieldname' => '_bbp_forum_type',
112
+ 'default' => 'forum'
113
+ );
114
+
115
+ // Forum status (Set a default value 'open', Stored in postmeta)
116
+ $this->field_map[] = array(
117
+ 'to_type' => 'forum',
118
+ 'to_fieldname' => '_bbp_status',
119
+ 'default' => 'open'
120
+ );
121
+
122
  // Forum dates.
123
  $this->field_map[] = array(
124
  'to_type' => 'forum',
141
  'default' => date('Y-m-d H:i:s')
142
  );
143
 
144
+ /** Forum Subscriptions Section ***************************************/
145
+
146
+ // Subscribed forum ID (Stored in usermeta)
147
+ $this->field_map[] = array(
148
+ 'from_tablename' => 'forum_subscriptions',
149
+ 'from_fieldname' => 'forum_id',
150
+ 'to_type' => 'forum_subscriptions',
151
+ 'to_fieldname' => '_bbp_forum_subscriptions'
152
+ );
153
+
154
+ // Subscribed user ID (Stored in usermeta)
155
+ $this->field_map[] = array(
156
+ 'from_tablename' => 'forum_subscriptions',
157
+ 'from_fieldname' => 'user_id',
158
+ 'to_type' => 'forum_subscriptions',
159
+ 'to_fieldname' => 'user_id',
160
+ 'callback_method' => 'callback_userid'
161
+ );
162
+
163
  /** Topic Section *****************************************************/
164
 
165
+ // Old topic id (Stored in postmeta)
166
  $this->field_map[] = array(
167
  'from_tablename' => 'topics',
168
  'from_fieldname' => 'id',
169
  'to_type' => 'topic',
170
+ 'to_fieldname' => '_bbp_old_topic_id'
171
  );
172
 
173
  // Topic reply count (Stored in postmeta)
261
  'callback_method' => 'callback_forumid'
262
  );
263
 
264
+ // Sticky status (Stored in postmeta)
265
  $this->field_map[] = array(
266
  'from_tablename' => 'topics',
267
  'from_fieldname' => 'sticky',
268
  'to_type' => 'topic',
269
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
270
  'callback_method' => 'callback_sticky_status'
271
  );
272
 
312
  'from_tablename' => 'topics',
313
  'from_fieldname' => 'closed',
314
  'to_type' => 'topic',
315
+ 'to_fieldname' => '_bbp_old_closed_status_id',
316
  'callback_method' => 'callback_topic_status'
317
  );
318
 
322
  * FluxBB v1.5.3 Forums do not support topic tags out of the box
323
  */
324
 
325
+ /** Topic Subscriptions Section ***************************************/
326
+
327
+ // Subscribed topic ID (Stored in usermeta)
328
+ $this->field_map[] = array(
329
+ 'from_tablename' => 'topic_subscriptions',
330
+ 'from_fieldname' => 'topic_id',
331
+ 'to_type' => 'topic_subscriptions',
332
+ 'to_fieldname' => '_bbp_subscriptions'
333
+ );
334
+
335
+ // Subscribed user ID (Stored in usermeta)
336
+ $this->field_map[] = array(
337
+ 'from_tablename' => 'topic_subscriptions',
338
+ 'from_fieldname' => 'user_id',
339
+ 'to_type' => 'topic_subscriptions',
340
+ 'to_fieldname' => 'user_id',
341
+ 'callback_method' => 'callback_userid'
342
+ );
343
+
344
  /** Reply Section *****************************************************/
345
 
346
+ // Old reply id (Stored in postmeta)
347
  $this->field_map[] = array(
348
  'from_tablename' => 'posts',
349
  'from_fieldname' => 'id',
350
  'to_type' => 'reply',
351
+ 'to_fieldname' => '_bbp_old_reply_id'
352
  );
353
 
354
  // Reply parent forum id (If no parent, then 0, Stored in postmeta)
386
  'callback_method' => 'callback_userid'
387
  );
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  // Reply content.
390
  $this->field_map[] = array(
391
  'from_tablename' => 'posts',
436
 
437
  /** User Section ******************************************************/
438
 
439
+ // Store old user id (Stored in usermeta)
440
  $this->field_map[] = array(
441
  'from_tablename' => 'users',
442
  'from_fieldname' => 'id',
443
  'to_type' => 'user',
444
+ 'to_fieldname' => '_bbp_old_user_id'
445
  );
446
 
447
+ // Store old user password (Stored in usermeta serialized with salt)
448
  $this->field_map[] = array(
449
  'from_tablename' => 'users',
450
  'from_fieldname' => 'password',
453
  'callback_method' => 'callback_savepass'
454
  );
455
 
456
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
457
  // $this->field_map[] = array(
458
  // 'from_tablename' => 'users',
459
  // 'from_fieldname' => 'salt',
522
  'from_tablename' => 'users',
523
  'from_fieldname' => 'aim',
524
  'to_type' => 'user',
525
+ 'to_fieldname' => '_bbp_fluxbb_user_aim'
526
  );
527
 
528
  // User Yahoo (Stored in usermeta)
530
  'from_tablename' => 'users',
531
  'from_fieldname' => 'yahoo',
532
  'to_type' => 'user',
533
+ 'to_fieldname' => '_bbp_fluxbb_user_yim'
534
  );
535
 
536
  // Store Jabber
538
  'from_tablename' => 'users',
539
  'from_fieldname' => 'jabber',
540
  'to_type' => 'user',
541
+ 'to_fieldname' => '_bbp_fluxbb_user_jabber'
542
  );
543
 
544
  // Store ICQ (Stored in usermeta)
588
  * This method allows us to indicates what is or is not converted for each
589
  * converter.
590
  */
591
+ public function info() {
 
592
  return '';
593
  }
594
 
597
  * way when we authenticate it we can get it out of the database
598
  * as one value. Array values are auto sanitized by WordPress.
599
  */
600
+ public function callback_savepass( $field, $row ) {
 
601
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
602
  return $pass_array;
603
  }
606
  * This method is to take the pass out of the database and compare
607
  * to a pass the user has typed in.
608
  */
609
+ public function authenticate_pass( $password, $serialized_pass ) {
 
610
  $pass_array = unserialize( $serialized_pass );
611
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
612
  }
613
 
614
  /**
615
+ * Translate the post status from FluxBB v1.5.3 numerics to WordPress's strings.
616
  *
617
  * @param int $status FluxBB v1.5.3 numeric topic status
618
  * @return string WordPress safe
632
  }
633
 
634
  /**
635
+ * Translate the topic sticky status type from FluxBB v1.5.3 numerics to WordPress's strings.
636
  *
637
  * @param int $status FluxBB v1.5.3 numeric forum type
638
  * @return string WordPress safe
661
  $count = absint( (int) $count - 1 );
662
  return $count;
663
  }
664
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Invision.php CHANGED
@@ -1,36 +1,48 @@
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
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses Invision::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 parent id (If no parent, then 0, Stored in postmeta)
@@ -38,7 +50,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 +128,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 +159,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 +233,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 +300,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 +343,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 +393,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 +410,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',
@@ -470,7 +476,7 @@ class Invision extends BBP_Converter_Base {
470
  }
471
 
472
  /**
473
- * Translate the forum type from Invision numeric's to WordPress's strings.
474
  *
475
  * @param int $status Invision numeric forum type
476
  * @return string WordPress safe
@@ -485,7 +491,7 @@ class Invision extends BBP_Converter_Base {
485
  }
486
 
487
  /**
488
- * Translate the topic sticky status type from Invision numeric's to WordPress's strings.
489
  *
490
  * @param int $status Invision numeric forum type
491
  * @return string WordPress safe
@@ -515,17 +521,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
@@ -561,8 +556,8 @@ class Invision extends BBP_Converter_Base {
561
  }
562
 
563
  /**
564
- * This callback processes any custom BBCodes with parser.php
565
- */
566
  protected function callback_html( $field ) {
567
 
568
  // Strips Invision custom HTML first from $field before parsing $field to parser.php
@@ -637,10 +632,7 @@ class Invision extends BBP_Converter_Base {
637
  // Now that Invision custom HTML has been stripped put the cleaned HTML back in $field
638
  $field = $invision_markup;
639
 
640
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
641
- $bbcode = BBCode::getInstance();
642
- $bbcode->enable_smileys = false;
643
- $bbcode->smiley_regex = false;
644
- return html_entity_decode( $bbcode->Parse( $field ) );
645
  }
646
  }
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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
28
  * Sets up the field mappings
29
  */
30
+ public function setup_globals() {
31
+
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
 
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'forums',
43
  'from_fieldname' => 'id',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0, Stored in postmeta)
50
  'from_tablename' => 'forums',
51
  'from_fieldname' => 'parent_id',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum topic count (Stored in postmeta)
128
  'callback_method' => 'callback_forum_type'
129
  );
130
 
131
+ // Forum status (Set a default value 'open', Stored in postmeta)
132
+ $this->field_map[] = array(
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => '_bbp_status',
135
+ 'default' => 'open'
136
+ );
137
+
138
  // Forum dates.
139
  $this->field_map[] = array(
140
  'to_type' => 'forum',
159
 
160
  /** Topic Section *****************************************************/
161
 
162
+ // Old topic id (Stored in postmeta)
163
  $this->field_map[] = array(
164
  'from_tablename' => 'topics',
165
  'from_fieldname' => 'tid',
166
  'to_type' => 'topic',
167
+ 'to_fieldname' => '_bbp_old_topic_id'
168
  );
169
 
170
  // Topic reply count (Stored in postmeta)
233
  'callback_method' => 'callback_forumid'
234
  );
235
 
236
+ // Sticky status (Stored in postmeta)
237
  $this->field_map[] = array(
238
  'from_tablename' => 'topics',
239
  'from_fieldname' => 'pinned',
240
  'to_type' => 'topic',
241
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
242
  'callback_method' => 'callback_sticky_status'
243
  );
244
 
300
 
301
  /** Reply Section *****************************************************/
302
 
303
+ // Old reply id (Stored in postmeta)
304
  $this->field_map[] = array(
305
  'from_tablename' => 'posts',
306
  'from_fieldname' => 'pid',
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)
343
  'callback_method' => 'callback_userid'
344
  );
345
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  // Reply content.
347
  $this->field_map[] = array(
348
  'from_tablename' => 'posts',
393
 
394
  /** User Section ******************************************************/
395
 
396
+ // Store old user id (Stored in usermeta)
397
  $this->field_map[] = array(
398
  'from_tablename' => 'members',
399
  'from_fieldname' => 'member_id',
400
  'to_type' => 'user',
401
+ 'to_fieldname' => '_bbp_old_user_id'
402
  );
403
 
404
+ // Store old user password (Stored in usermeta serialized with salt)
405
  $this->field_map[] = array(
406
  'from_tablename' => 'members',
407
  'from_fieldname' => 'members_pass_hash',
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' => 'members',
416
  'from_fieldname' => 'members_pass_salt',
476
  }
477
 
478
  /**
479
+ * Translate the forum type from Invision numerics to WordPress's strings.
480
  *
481
  * @param int $status Invision numeric forum type
482
  * @return string WordPress safe
491
  }
492
 
493
  /**
494
+ * Translate the topic sticky status type from Invision numerics to WordPress's strings.
495
  *
496
  * @param int $status Invision numeric forum type
497
  * @return string WordPress safe
521
  return $count;
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
556
  }
557
 
558
  /**
559
+ * This callback processes any custom BBCodes with parser.php
560
+ */
561
  protected function callback_html( $field ) {
562
 
563
  // Strips Invision custom HTML first from $field before parsing $field to parser.php
632
  // Now that Invision custom HTML has been stripped put the cleaned HTML back in $field
633
  $field = $invision_markup;
634
 
635
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
636
+ return parent::callback_html( $field );
 
 
 
637
  }
638
  }
includes/admin/converters/Kunena1.php CHANGED
@@ -1,44 +1,50 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Kunena v1.x Forums for Joomla Forum converter.
5
  *
6
- * @since bbPress (r5144)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/kunena/
 
8
  */
9
  class Kunena1 extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses Kunena1::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
22
  * Sets up the field mappings
23
  */
24
- public function setup_globals() {
25
 
26
- /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
- $this->field_map[] = array(
30
- 'from_tablename' => 'kunena_categories',
31
- 'from_fieldname' => 'id',
32
- 'to_type' => 'forum',
33
- 'to_fieldname' => '_bbp_forum_id'
34
  );
35
 
36
- // Forum parent id (If no parent, then 0, Stored in postmeta)
37
- $this->field_map[] = array(
38
- 'from_tablename' => 'kunena_categories',
39
- 'from_fieldname' => 'parent',
40
- 'to_type' => 'forum',
41
- 'to_fieldname' => '_bbp_forum_parent_id'
42
  );
43
 
44
  // Forum topic count (Stored in postmeta)
@@ -73,38 +79,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 +131,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,222 +270,204 @@ 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.
483
  *
484
  * @param int $status Kunena v1.x numeric forum type
485
  * @return string WordPress safe
@@ -494,7 +482,7 @@ class Kunena1 extends BBP_Converter_Base {
494
  }
495
 
496
  /**
497
- * Translate the forum status from Kunena v1.x numeric's to WordPress's strings.
498
  *
499
  * @param int $status Kunena v1.x numeric forum status
500
  * @return string WordPress safe
@@ -514,7 +502,7 @@ class Kunena1 extends BBP_Converter_Base {
514
  }
515
 
516
  /**
517
- * Translate the post status from Kunena v1.x numeric's to WordPress's strings.
518
  *
519
  * @param int $status Kunena v1.x numeric topic status
520
  * @return string WordPress safe
@@ -532,15 +520,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
28
  * Sets up the field mappings
29
  */
30
+ public function setup_globals() {
31
 
32
+ /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
35
+ $this->field_map[] = array(
36
+ 'from_tablename' => 'kunena_categories',
37
+ 'from_fieldname' => 'id',
38
+ 'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
43
+ $this->field_map[] = array(
44
+ 'from_tablename' => 'kunena_categories',
45
+ 'from_fieldname' => 'parent',
46
+ 'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
  );
49
 
50
  // Forum topic count (Stored in postmeta)
79
  'to_fieldname' => '_bbp_total_reply_count'
80
  );
81
 
82
+ // Forum title.
83
+ $this->field_map[] = array(
84
+ 'from_tablename' => 'kunena_categories',
85
+ 'from_fieldname' => 'name',
86
+ 'to_type' => 'forum',
87
+ 'to_fieldname' => 'post_title'
88
  );
89
 
90
+ // Forum slug (Clean name to avoid conflicts)
91
+ $this->field_map[] = array(
92
+ 'from_tablename' => 'kunena_categories',
93
+ 'from_fieldname' => 'name',
94
+ 'to_type' => 'forum',
95
+ 'to_fieldname' => 'post_name',
96
+ 'callback_method' => 'callback_slug'
97
  );
98
 
99
+ // Forum description.
100
+ $this->field_map[] = array(
101
+ 'from_tablename' => 'kunena_categories',
102
+ 'from_fieldname' => 'description',
103
+ 'to_type' => 'forum',
104
+ 'to_fieldname' => 'post_content',
105
+ 'callback_method' => 'callback_null'
106
  );
107
 
108
+ // Forum display order (Starts from 1)
109
+ $this->field_map[] = array(
110
+ 'from_tablename' => 'kunena_categories',
111
+ 'from_fieldname' => 'ordering',
112
+ 'to_type' => 'forum',
113
+ 'to_fieldname' => 'menu_order'
114
  );
115
 
116
  // Forum type (Category = 0 or Forum > 0, Stored in postmeta)
131
  'callback_method' => 'callback_forum_status'
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' => 'kunena_messages',
161
  'from_fieldname' => 'thread',
162
  'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
  );
165
 
166
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
270
  'from_tablename' => 'kunena_messages',
271
  'from_fieldname' => 'locked',
272
  'to_type' => 'topic',
273
+ 'to_fieldname' => '_bbp_old_closed_status_id',
274
  'callback_method' => 'callback_topic_status'
275
  );
276
 
277
+ /** Tags Section ******************************************************/
278
 
279
  /**
280
  * Kunena v1.x Forums do not support topic tags out of the box
281
  */
282
 
283
+ /** Reply Section *****************************************************/
284
+
285
+ // Old reply id (Stored in postmeta)
286
+ $this->field_map[] = array(
287
+ 'from_tablename' => 'kunena_messages',
288
+ 'from_fieldname' => 'id',
289
+ 'to_type' => 'reply',
290
+ 'to_fieldname' => '_bbp_old_reply_id'
291
+ );
292
+
293
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
294
+ $this->field_map[] = array(
295
+ 'from_tablename' => 'kunena_messages',
296
+ 'from_fieldname' => 'catid',
297
+ 'to_type' => 'reply',
298
+ 'to_fieldname' => '_bbp_forum_id',
299
+ 'callback_method' => 'callback_topicid_to_forumid'
300
+ );
301
+
302
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
303
+ $this->field_map[] = array(
304
+ 'from_tablename' => 'kunena_messages',
305
+ 'from_fieldname' => 'thread',
306
+ 'to_type' => 'reply',
307
+ 'to_fieldname' => '_bbp_topic_id',
308
+ 'callback_method' => 'callback_topicid'
309
+ );
310
+
311
+ // Reply author ip (Stored in postmeta)
312
+ $this->field_map[] = array(
313
+ 'from_tablename' => 'kunena_messages',
314
+ 'from_fieldname' => 'ip',
315
+ 'to_type' => 'reply',
316
+ 'to_fieldname' => '_bbp_author_ip'
317
+ );
318
+
319
+ // Reply author.
320
+ $this->field_map[] = array(
321
+ 'from_tablename' => 'kunena_messages',
322
+ 'from_fieldname' => 'userid',
323
+ 'to_type' => 'reply',
324
+ 'to_fieldname' => 'post_author',
325
+ 'callback_method' => 'callback_userid'
326
+ );
327
+
328
+ // Reply content.
329
+ // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'kunena_messages_text',
332
+ 'from_fieldname' => 'message',
333
+ 'join_tablename' => 'kunena_messages',
334
+ 'join_type' => 'INNER',
335
+ 'join_expression' => 'ON kunena_messages.id = kunena_messages_text.mesid WHERE kunena_messages.parent != 0',
336
+ 'to_type' => 'reply',
337
+ 'to_fieldname' => 'post_content',
338
+ 'callback_method' => 'callback_html'
339
+ );
340
+
341
+ // Reply parent topic id (If no parent, then 0)
342
+ $this->field_map[] = array(
343
+ 'from_tablename' => 'kunena_messages',
344
+ 'from_fieldname' => 'thread',
345
+ 'to_type' => 'reply',
346
+ 'to_fieldname' => 'post_parent',
347
+ 'callback_method' => 'callback_topicid'
348
+ );
349
+
350
+ // Reply dates.
351
+ $this->field_map[] = array(
352
+ 'from_tablename' => 'kunena_messages',
353
+ 'from_fieldname' => 'time',
354
+ 'to_type' => 'reply',
355
+ 'to_fieldname' => 'post_date',
356
+ 'callback_method' => 'callback_datetime'
357
+ );
358
+ $this->field_map[] = array(
359
+ 'from_tablename' => 'kunena_messages',
360
+ 'from_fieldname' => 'time',
361
+ 'to_type' => 'reply',
362
+ 'to_fieldname' => 'post_date_gmt',
363
+ 'callback_method' => 'callback_datetime'
364
+ );
365
+ $this->field_map[] = array(
366
+ 'from_tablename' => 'kunena_messages',
367
+ 'from_fieldname' => 'time',
368
+ 'to_type' => 'reply',
369
+ 'to_fieldname' => 'post_modified',
370
+ 'callback_method' => 'callback_datetime'
371
+ );
372
+ $this->field_map[] = array(
373
+ 'from_tablename' => 'kunena_messages',
374
+ 'from_fieldname' => 'time',
375
+ 'to_type' => 'reply',
376
+ 'to_fieldname' => 'post_modified_gmt',
377
+ 'callback_method' => 'callback_datetime'
378
+ );
379
+
380
+ /** User Section ******************************************************/
381
+
382
+ //Note: We are importing the Joomla User details and the Kunena v1.x user profile details.
383
+
384
+ // Store old user id (Stored in usermeta)
385
+ $this->field_map[] = array(
386
+ 'from_tablename' => 'users',
387
+ 'from_fieldname' => 'id',
388
+ 'to_type' => 'user',
389
+ 'to_fieldname' => '_bbp_old_user_id'
390
+ );
391
+
392
+ // Store old user password (Stored in usermeta serialized with salt)
393
+ $this->field_map[] = array(
394
+ 'from_tablename' => 'users',
395
+ 'from_fieldname' => 'password',
396
+ 'to_type' => 'user',
397
+ 'to_fieldname' => '_bbp_password',
398
+ 'callback_method' => 'callback_savepass'
399
+ );
400
+
401
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
402
+ // $this->field_map[] = array(
403
+ // 'from_tablename' => 'user',
404
+ // 'from_fieldname' => 'salt',
405
+ // 'to_type' => 'user',
406
+ // 'to_fieldname' => ''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  // );
408
 
409
+ // User password verify class (Stored in usermeta for verifying password)
410
+ // $this->field_map[] = array(
411
+ // 'to_type' => 'user',
412
+ // 'to_fieldname' => '_bbp_class',
413
+ // 'default' => 'Kunena1'
414
  // );
415
 
416
+ // User name.
417
+ $this->field_map[] = array(
418
+ 'from_tablename' => 'users',
419
+ 'from_fieldname' => 'username',
420
+ 'to_type' => 'user',
421
+ 'to_fieldname' => 'user_login'
422
+ );
423
+
424
+ // User email.
425
+ $this->field_map[] = array(
426
+ 'from_tablename' => 'users',
427
+ 'from_fieldname' => 'email',
428
+ 'to_type' => 'user',
429
+ 'to_fieldname' => 'user_email'
430
+ );
431
+
432
+ // User registered.
433
+ $this->field_map[] = array(
434
+ 'from_tablename' => 'users',
435
+ 'from_fieldname' => 'registerDate',
436
+ 'to_type' => 'user',
437
+ 'to_fieldname' => 'user_registered',
438
+ 'callback_method' => 'callback_datetime'
439
+ );
440
+ }
441
+
442
+ /**
443
+ * This method allows us to indicates what is or is not converted for each
444
+ * converter.
445
+ */
446
+ public function info() {
447
+ return '';
448
+ }
449
+
450
+ /**
451
+ * This method is to save the salt and password together. That
452
+ * way when we authenticate it we can get it out of the database
453
+ * as one value. Array values are auto sanitized by WordPress.
454
+ */
455
+ public function callback_savepass($field, $row) {
456
+ $pass_array = array('hash' => $field, 'salt' => $row['salt']);
457
+ return $pass_array;
458
+ }
459
+
460
+ /**
461
+ * This method is to take the pass out of the database and compare
462
+ * to a pass the user has typed in.
463
+ */
464
+ public function authenticate_pass($password, $serialized_pass) {
465
+ $pass_array = unserialize($serialized_pass);
466
+ return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
467
+ }
468
 
469
  /**
470
+ * Translate the forum type from Kunena v1.x numerics to WordPress's strings.
471
  *
472
  * @param int $status Kunena v1.x numeric forum type
473
  * @return string WordPress safe
482
  }
483
 
484
  /**
485
+ * Translate the forum status from Kunena v1.x numerics to WordPress's strings.
486
  *
487
  * @param int $status Kunena v1.x numeric forum status
488
  * @return string WordPress safe
502
  }
503
 
504
  /**
505
+ * Translate the post status from Kunena v1.x numerics to WordPress's strings.
506
  *
507
  * @param int $status Kunena v1.x numeric topic status
508
  * @return string WordPress safe
520
  }
521
  return $status;
522
  }
523
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Kunena2.php CHANGED
@@ -1,37 +1,42 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Kunena v2.x Forums for Joomla Forum converter.
5
  *
6
- * @since bbPress (r5144)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/kunena/
 
8
  */
9
  class Kunena2 extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses Kunena2::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
22
  * Sets up the field mappings
23
  */
24
- public function setup_globals() {
25
 
26
- /** Forum Section *****************************************************/
27
 
28
-
29
- // Forum id (Stored in postmeta)
30
  $this->field_map[] = array(
31
  'from_tablename' => 'kunena_categories',
32
  'from_fieldname' => 'id',
33
  'to_type' => 'forum',
34
- 'to_fieldname' => '_bbp_forum_id'
35
  );
36
 
37
  // Forum parent id (If no parent, then 0, Stored in postmeta)
@@ -39,7 +44,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 +155,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 +288,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 +300,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 +343,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 +395,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,36 +468,36 @@ 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
  *
515
  * @param int $status Kunena v2.x numeric forum type
516
  * @return string WordPress safe
@@ -525,7 +512,7 @@ class Kunena2 extends BBP_Converter_Base {
525
  }
526
 
527
  /**
528
- * Translate the forum status from Kunena v2.x numeric's to WordPress's strings.
529
  *
530
  * @param int $status Kunena v2.x numeric forum status
531
  * @return string WordPress safe
@@ -545,7 +532,7 @@ class Kunena2 extends BBP_Converter_Base {
545
  }
546
 
547
  /**
548
- * Translate the post status from Kunena v2.x numeric's to WordPress's strings.
549
  *
550
  * @param int $status Kunena v2.x numeric topic status
551
  * @return string WordPress safe
@@ -574,15 +561,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
28
  * Sets up the field mappings
29
  */
30
+ public function setup_globals() {
31
 
32
+ /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
 
35
  $this->field_map[] = array(
36
  'from_tablename' => 'kunena_categories',
37
  'from_fieldname' => 'id',
38
  'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
  // Forum parent id (If no parent, then 0, Stored in postmeta)
44
  'from_tablename' => 'kunena_categories',
45
  'from_fieldname' => 'parent_id',
46
  'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
  );
49
 
50
  // Forum topic count (Stored in postmeta)
155
 
156
  /** Topic Section *****************************************************/
157
 
158
+ // Old topic id (Stored in postmeta)
159
  $this->field_map[] = array(
160
  'from_tablename' => 'kunena_topics',
161
  'from_fieldname' => 'id',
162
  'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
  );
165
 
166
  // Topic reply count (Stored in postmeta)
288
  'from_tablename' => 'kunena_topics',
289
  'from_fieldname' => 'locked',
290
  'to_type' => 'topic',
291
+ 'to_fieldname' => '_bbp_old_closed_status_id',
292
  'callback_method' => 'callback_topic_status'
293
  );
294
 
295
+ /** Tags Section ******************************************************/
296
 
297
  /**
298
  * Kunena v2.x Forums do not support topic tags out of the box
300
 
301
  /** Reply Section *****************************************************/
302
 
303
+ // Old reply id (Stored in postmeta)
304
  $this->field_map[] = array(
305
  'from_tablename' => 'kunena_messages',
306
  'from_fieldname' => 'id',
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)
343
  'callback_method' => 'callback_userid'
344
  );
345
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  // Reply content.
347
  // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
348
  $this->field_map[] = array(
395
  'callback_method' => 'callback_datetime'
396
  );
397
 
398
+ /** User Section ******************************************************/
399
+
400
+ //Note: We are importing the Joomla User details and the Kunena v2.x user profile details.
401
+
402
+ // Store old user id (Stored in usermeta)
403
+ $this->field_map[] = array(
404
+ 'from_tablename' => 'users',
405
+ 'from_fieldname' => 'id',
406
+ 'to_type' => 'user',
407
+ 'to_fieldname' => '_bbp_old_user_id'
408
+ );
409
+
410
+ // Store old user password (Stored in usermeta serialized with salt)
411
+ $this->field_map[] = array(
412
+ 'from_tablename' => 'users',
413
+ 'from_fieldname' => 'password',
414
+ 'to_type' => 'user',
415
+ 'to_fieldname' => '_bbp_password',
416
+ 'callback_method' => 'callback_savepass'
417
+ );
418
+
419
+ // Store old user salt. This is only used for the SELECT row info for the above password save
420
+ /*
421
+ $this->field_map[] = array(
422
+ 'from_tablename' => 'users',
423
+ 'from_fieldname' => 'salt',
424
+ 'to_type' => 'user',
425
+ 'to_fieldname' => ''
426
+ );
427
+ */
428
+
429
+ // User password verify class. Stores in usermeta for verifying password.
430
+ /*
431
+ $this->field_map[] = array(
432
+ 'to_type' => 'user',
433
+ 'to_fieldname' => '_bbp_class',
434
+ 'default' => 'Kunena2'
435
+ );
436
+ */
437
+
438
+ // User name.
439
+ $this->field_map[] = array(
440
+ 'from_tablename' => 'users',
441
+ 'from_fieldname' => 'username',
442
+ 'to_type' => 'user',
443
+ 'to_fieldname' => 'user_login'
444
+ );
445
+
446
+ // User email.
447
+ $this->field_map[] = array(
448
+ 'from_tablename' => 'users',
449
+ 'from_fieldname' => 'email',
450
+ 'to_type' => 'user',
451
+ 'to_fieldname' => 'user_email'
452
+ );
453
+
454
+ // User registered.
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'users',
457
+ 'from_fieldname' => 'registerDate',
458
+ 'to_type' => 'user',
459
+ 'to_fieldname' => 'user_registered',
460
+ 'callback_method' => 'callback_datetime'
461
+ );
462
 
463
  // User display name.
464
  $this->field_map[] = array(
468
  'to_fieldname' => 'display_name'
469
  );
470
 
471
+ }
472
+
473
+ /**
474
+ * This method allows us to indicates what is or is not converted for each
475
+ * converter.
476
+ */
477
+ public function info() {
478
+ return '';
479
+ }
480
+
481
+ /**
482
+ * This method is to save the salt and password together. That
483
+ * way when we authenticate it we can get it out of the database
484
+ * as one value. Array values are auto sanitized by WordPress.
485
+ */
486
+ public function callback_savepass($field, $row) {
487
+ $pass_array = array('hash' => $field, 'salt' => $row['salt']);
488
+ return $pass_array;
489
+ }
490
+
 
 
 
 
 
 
 
 
491
  /**
492
+ * This method is to take the pass out of the database and compare
493
+ * to a pass the user has typed in.
494
+ */
495
+ public function authenticate_pass($password, $serialized_pass) {
496
+ $pass_array = unserialize($serialized_pass);
497
+ return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
498
+ }
499
+ /**
500
+ * Translate the forum type from Kunena v2.x numerics to WordPress's strings.
501
  *
502
  * @param int $status Kunena v2.x numeric forum type
503
  * @return string WordPress safe
512
  }
513
 
514
  /**
515
+ * Translate the forum status from Kunena v2.x numerics to WordPress's strings.
516
  *
517
  * @param int $status Kunena v2.x numeric forum status
518
  * @return string WordPress safe
532
  }
533
 
534
  /**
535
+ * Translate the post status from Kunena v2.x numerics to WordPress's strings.
536
  *
537
  * @param int $status Kunena v2.x numeric topic status
538
  * @return string WordPress safe
561
  $count = absint( (int) $count - 1 );
562
  return $count;
563
  }
564
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Kunena3.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Kunena v3.x Forums for Joomla Forum converter.
5
  *
6
- * @since bbPress (r5144)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/kunena/
 
8
  */
9
  class Kunena3 extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses Kunena3::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +31,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 +44,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 +155,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 +288,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 +300,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 +343,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 +399,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 +416,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 +491,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 +502,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 +513,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)
@@ -710,8 +698,7 @@ class Kunena3 extends BBP_Converter_Base {
710
  * This method allows us to indicates what is or is not converted for each
711
  * converter.
712
  */
713
- public function info()
714
- {
715
  return '';
716
  }
717
 
@@ -720,8 +707,7 @@ class Kunena3 extends BBP_Converter_Base {
720
  * way when we authenticate it we can get it out of the database
721
  * as one value. Array values are auto sanitized by WordPress.
722
  */
723
- public function callback_savepass( $field, $row )
724
- {
725
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
726
  return $pass_array;
727
  }
@@ -730,14 +716,13 @@ class Kunena3 extends BBP_Converter_Base {
730
  * This method is to take the pass out of the database and compare
731
  * to a pass the user has typed in.
732
  */
733
- public function authenticate_pass( $password, $serialized_pass )
734
- {
735
  $pass_array = unserialize( $serialized_pass );
736
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
737
  }
738
 
739
  /**
740
- * Translate the forum type from Kunena v3.x numeric's to WordPress's strings.
741
  *
742
  * @param int $status Kunena v3.x numeric forum type
743
  * @return string WordPress safe
@@ -752,7 +737,7 @@ class Kunena3 extends BBP_Converter_Base {
752
  }
753
 
754
  /**
755
- * Translate the forum status from Kunena v3.x numeric's to WordPress's strings.
756
  *
757
  * @param int $status Kunena v3.x numeric forum status
758
  * @return string WordPress safe
@@ -772,7 +757,7 @@ class Kunena3 extends BBP_Converter_Base {
772
  }
773
 
774
  /**
775
- * Translate the post status from Kunena v3.x numeric's to WordPress's strings.
776
  *
777
  * @param int $status Kunena v3.x numeric topic status
778
  * @return string WordPress safe
@@ -801,15 +786,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
31
 
32
  /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
35
  $this->field_map[] = array(
36
  'from_tablename' => 'kunena_categories',
37
  'from_fieldname' => 'id',
38
  'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
  // Forum parent id (If no parent, then 0, Stored in postmeta)
44
  'from_tablename' => 'kunena_categories',
45
  'from_fieldname' => 'parent_id',
46
  'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
  );
49
 
50
  // Forum topic count (Stored in postmeta)
155
 
156
  /** Topic Section *****************************************************/
157
 
158
+ // Old topic id (Stored in postmeta)
159
  $this->field_map[] = array(
160
  'from_tablename' => 'kunena_topics',
161
  'from_fieldname' => 'id',
162
  'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
  );
165
 
166
  // Topic reply count (Stored in postmeta)
288
  'from_tablename' => 'kunena_topics',
289
  'from_fieldname' => 'locked',
290
  'to_type' => 'topic',
291
+ 'to_fieldname' => '_bbp_old_closed_status_id',
292
  'callback_method' => 'callback_topic_status'
293
  );
294
 
300
 
301
  /** Reply Section ******************************************************/
302
 
303
+ // Old reply id (Stored in postmeta)
304
  $this->field_map[] = array(
305
  'from_tablename' => 'kunena_messages',
306
  'from_fieldname' => 'id',
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)
343
  'callback_method' => 'callback_userid'
344
  );
345
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  // Reply content.
347
  // Note: We join the 'kunena_messages_text' table because 'kunena_messages' table does not include reply content.
348
  $this->field_map[] = array(
399
 
400
  //Note: We are importing the Joomla User details and the Kunena v3.x user profile details.
401
 
402
+ // Store old user id (Stored in usermeta)
403
  $this->field_map[] = array(
404
  'from_tablename' => 'users',
405
  'from_fieldname' => 'id',
406
  'to_type' => 'user',
407
+ 'to_fieldname' => '_bbp_old_user_id'
408
  );
409
 
410
+ // Store old user password (Stored in usermeta serialized with salt)
411
  $this->field_map[] = array(
412
  'from_tablename' => 'users',
413
  'from_fieldname' => 'password',
416
  'callback_method' => 'callback_savepass'
417
  );
418
 
419
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
420
  // $this->field_map[] = array(
421
  // 'from_tablename' => 'users',
422
  // 'from_fieldname' => 'salt',
491
  'join_type' => 'LEFT',
492
  'join_expression' => 'ON kunena_users.userid = users.id',
493
  'to_type' => 'user',
494
+ 'to_fieldname' => '_bbp_kunena3_user_aim'
495
  );
496
 
497
  // User Yahoo (Stored in usermeta)
502
  'join_type' => 'LEFT',
503
  'join_expression' => 'ON kunena_users.userid = users.id',
504
  'to_type' => 'user',
505
+ 'to_fieldname' => '_bbp_kunena3_user_yim'
506
  );
507
 
508
  // Store Google Tak (Stored in usermeta)
513
  'join_type' => 'LEFT',
514
  'join_expression' => 'ON kunena_users.userid = users.id',
515
  'to_type' => 'user',
516
+ 'to_fieldname' => '_bbp_kunena3_user_jabber'
517
  );
518
 
519
  // Store ICQ (Stored in usermeta)
698
  * This method allows us to indicates what is or is not converted for each
699
  * converter.
700
  */
701
+ public function info() {
 
702
  return '';
703
  }
704
 
707
  * way when we authenticate it we can get it out of the database
708
  * as one value. Array values are auto sanitized by WordPress.
709
  */
710
+ public function callback_savepass( $field, $row ) {
 
711
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
712
  return $pass_array;
713
  }
716
  * This method is to take the pass out of the database and compare
717
  * to a pass the user has typed in.
718
  */
719
+ public function authenticate_pass( $password, $serialized_pass ) {
 
720
  $pass_array = unserialize( $serialized_pass );
721
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
722
  }
723
 
724
  /**
725
+ * Translate the forum type from Kunena v3.x numerics to WordPress's strings.
726
  *
727
  * @param int $status Kunena v3.x numeric forum type
728
  * @return string WordPress safe
737
  }
738
 
739
  /**
740
+ * Translate the forum status from Kunena v3.x numerics to WordPress's strings.
741
  *
742
  * @param int $status Kunena v3.x numeric forum status
743
  * @return string WordPress safe
757
  }
758
 
759
  /**
760
+ * Translate the post status from Kunena v3.x numerics to WordPress's strings.
761
  *
762
  * @param int $status Kunena v3.x numeric topic status
763
  * @return string WordPress safe
786
  $count = absint( (int) $count - 1 );
787
  return $count;
788
  }
789
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/Mingle.php CHANGED
@@ -1,21 +1,27 @@
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
 
11
  /**
12
  * Main constructor
13
  *
14
- * @uses Mingle::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,14 +29,20 @@ class Mingle extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section ******************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
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 +50,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 +86,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 +124,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 +188,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 +234,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 +242,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 +294,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 +340,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',
@@ -430,7 +439,7 @@ class Mingle extends BBP_Converter_Base {
430
  }
431
 
432
  /**
433
- * Translate the topic status from Mingle numeric's to WordPress's strings.
434
  *
435
  * @param int $status Mingle v1.x numeric topic status
436
  * @return string WordPress safe
@@ -450,7 +459,7 @@ class Mingle extends BBP_Converter_Base {
450
  }
451
 
452
  /**
453
- * Translate the topic sticky status type from Mingle numeric's to WordPress's strings.
454
  *
455
  * @param int $status Mingle numeric forum type
456
  * @return string WordPress safe
@@ -468,16 +477,4 @@ class Mingle extends BBP_Converter_Base {
468
  }
469
  return $status;
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();
478
- $bbcode->enable_smileys = false;
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
 
19
  /**
20
  * Main constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  public function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section ******************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'forum_forums',
43
  'from_fieldname' => 'id',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0. Stored in postmeta)
50
  'from_tablename' => 'forum_forums',
51
  'from_fieldname' => 'parent_id',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum title.
86
  'to_fieldname' => 'menu_order'
87
  );
88
 
89
+ // Forum type (Set a default value 'forum', Stored in postmeta)
90
+ $this->field_map[] = array(
91
+ 'to_type' => 'forum',
92
+ 'to_fieldname' => '_bbp_forum_type',
93
+ 'default' => 'forum'
94
+ );
95
+
96
+ // Forum status (Set a default value 'open', Stored in postmeta)
97
+ $this->field_map[] = array(
98
+ 'to_type' => 'forum',
99
+ 'to_fieldname' => '_bbp_status',
100
+ 'default' => 'open'
101
+ );
102
+
103
  // Forum dates.
104
  $this->field_map[] = array(
105
  'to_type' => 'forum',
124
 
125
  /** Topic Section ******************************************************/
126
 
127
+ // Old topic id (Stored in postmeta)
128
  $this->field_map[] = array(
129
  'from_tablename' => 'forum_threads',
130
  'from_fieldname' => 'id',
131
  'to_type' => 'topic',
132
+ 'to_fieldname' => '_bbp_old_topic_id'
133
  );
134
 
135
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
188
  'callback_method' => 'callback_forumid'
189
  );
190
 
191
+ // Sticky status (Stored in postmeta)
192
  $this->field_map[] = array(
193
  'from_tablename' => 'forum_threads',
194
  'from_fieldname' => 'status',
195
  'to_type' => 'topic',
196
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
197
  'callback_method' => 'callback_sticky_status'
198
  );
199
 
234
  'from_tablename' => 'forum_threads',
235
  'from_fieldname' => 'closed',
236
  'to_type' => 'topic',
237
+ 'to_fieldname' => '_bbp_old_closed_status_id',
238
  'callback_method' => 'callback_topic_status'
239
  );
240
 
242
 
243
  /**
244
  * Mingle Forums do not support topic tags
245
+ */
246
 
247
  /** Reply Section ******************************************************/
248
 
249
+ // Old reply id (Stored in postmeta)
250
  $this->field_map[] = array(
251
  'from_tablename' => 'forum_posts',
252
  'from_fieldname' => 'id',
253
  'to_type' => 'reply',
254
+ 'to_fieldname' => '_bbp_old_reply_id'
255
  );
256
 
257
  // Setup reply section table joins
294
  'callback_method' => 'callback_userid'
295
  );
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  // Reply content.
298
  $this->field_map[] = array(
299
  'from_tablename' => 'forum_posts',
340
 
341
  /** User Section ******************************************************/
342
 
343
+ // Store old user id (Stored in usermeta)
344
  $this->field_map[] = array(
345
  'from_tablename' => 'users',
346
  'from_fieldname' => 'ID',
347
  'to_type' => 'user',
348
+ 'to_fieldname' => '_bbp_old_user_id'
349
  );
350
 
351
+ // Store old user password (Stored in usermeta)
352
  $this->field_map[] = array(
353
  'from_tablename' => 'users',
354
  'from_fieldname' => 'user_pass',
439
  }
440
 
441
  /**
442
+ * Translate the topic status from Mingle numerics to WordPress's strings.
443
  *
444
  * @param int $status Mingle v1.x numeric topic status
445
  * @return string WordPress safe
459
  }
460
 
461
  /**
462
+ * Translate the topic sticky status type from Mingle numerics to WordPress's strings.
463
  *
464
  * @param int $status Mingle numeric forum type
465
  * @return string WordPress safe
477
  }
478
  return $status;
479
  }
 
 
 
 
 
 
 
 
 
 
 
 
480
  }
includes/admin/converters/MyBB.php CHANGED
@@ -1,591 +1,590 @@
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
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ /**
28
+ * Sets up the field mappings
29
+ */
30
+ public function setup_globals() {
31
+
32
+ /** Forum Section *****************************************************/
33
+
34
+ // Old forum id (Stored in postmeta)
35
+ $this->field_map[] = array(
36
+ 'from_tablename' => 'forums',
37
+ 'from_fieldname' => 'fid',
38
+ 'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
+ );
41
+
42
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
43
+ $this->field_map[] = array(
44
+ 'from_tablename' => 'forums',
45
+ 'from_fieldname' => 'pid',
46
+ 'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
+ );
49
+
50
+ // Forum topic count (Stored in postmeta)
51
+ $this->field_map[] = array(
52
+ 'from_tablename' => 'forums',
53
+ 'from_fieldname' => 'threads',
54
+ 'to_type' => 'forum',
55
+ 'to_fieldname' => '_bbp_topic_count'
56
+ );
57
+
58
+ // Forum reply count (Stored in postmeta)
59
+ $this->field_map[] = array(
60
+ 'from_tablename' => 'forums',
61
+ 'from_fieldname' => 'posts',
62
+ 'to_type' => 'forum',
63
+ 'to_fieldname' => '_bbp_reply_count'
64
+ );
65
+
66
+ // Forum title.
67
+ $this->field_map[] = array(
68
+ 'from_tablename' => 'forums',
69
+ 'from_fieldname' => 'name',
70
+ 'to_type' => 'forum',
71
+ 'to_fieldname' => 'post_title'
72
+ );
73
+
74
+ // Forum slug (Clean name to avoid conflicts)
75
+ $this->field_map[] = array(
76
+ 'from_tablename' => 'forums',
77
+ 'from_fieldname' => 'name',
78
+ 'to_type' => 'forum',
79
+ 'to_fieldname' => 'post_name',
80
+ 'callback_method' => 'callback_slug'
81
+ );
82
+
83
+ // Forum description.
84
+ $this->field_map[] = array(
85
+ 'from_tablename' => 'forums',
86
+ 'from_fieldname' => 'description',
87
+ 'to_type' => 'forum',
88
+ 'to_fieldname' => 'post_content',
89
+ 'callback_method' => 'callback_null'
90
+ );
91
+
92
+ // Forum display order (Starts from 1)
93
+ $this->field_map[] = array(
94
+ 'from_tablename' => 'forums',
95
+ 'from_fieldname' => 'disporder',
96
+ 'to_type' => 'forum',
97
+ 'to_fieldname' => 'menu_order'
98
+ );
99
+
100
+ // Forum type (Set a default value 'forum', Stored in postmeta)
101
+ $this->field_map[] = array(
102
+ 'to_type' => 'forum',
103
+ 'to_fieldname' => '_bbp_forum_type',
104
+ 'default' => 'forum'
105
+ );
106
+
107
+ // Forum status (Set a default value 'open', Stored in postmeta)
108
+ $this->field_map[] = array(
109
+ 'to_type' => 'forum',
110
+ 'to_fieldname' => '_bbp_status',
111
+ 'default' => 'open'
112
+ );
113
+
114
+ // Forum dates.
115
+ $this->field_map[] = array(
116
+ 'to_type' => 'forum',
117
+ 'to_fieldname' => 'post_date',
118
+ 'default' => date('Y-m-d H:i:s')
119
+ );
120
+ $this->field_map[] = array(
121
+ 'to_type' => 'forum',
122
+ 'to_fieldname' => 'post_date_gmt',
123
+ 'default' => date('Y-m-d H:i:s')
124
+ );
125
+ $this->field_map[] = array(
126
+ 'to_type' => 'forum',
127
+ 'to_fieldname' => 'post_modified',
128
+ 'default' => date('Y-m-d H:i:s')
129
+ );
130
+ $this->field_map[] = array(
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => 'post_modified_gmt',
133
+ 'default' => date('Y-m-d H:i:s')
134
+ );
135
+
136
+ /** Topic Section *****************************************************/
137
+
138
+ // Old topic id (Stored in postmeta)
139
+ $this->field_map[] = array(
140
+ 'from_tablename' => 'threads',
141
+ 'from_fieldname' => 'tid',
142
+ 'to_type' => 'topic',
143
+ 'to_fieldname' => '_bbp_old_topic_id'
144
+ );
145
+
146
+ // Topic reply count (Stored in postmeta)
147
+ $this->field_map[] = array(
148
+ 'from_tablename' => 'threads',
149
+ 'from_fieldname' => 'replies',
150
+ 'to_type' => 'topic',
151
+ 'to_fieldname' => '_bbp_reply_count',
152
+ 'callback_method' => 'callback_topic_reply_count'
153
+ );
154
+
155
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
156
+ $this->field_map[] = array(
157
+ 'from_tablename' => 'threads',
158
+ 'from_fieldname' => 'replies',
159
+ 'to_type' => 'topic',
160
+ 'to_fieldname' => '_bbp_total_reply_count',
161
+ 'callback_method' => 'callback_topic_reply_count'
162
+ );
163
+
164
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
165
+ $this->field_map[] = array(
166
+ 'from_tablename' => 'threads',
167
+ 'from_fieldname' => 'fid',
168
+ 'to_type' => 'topic',
169
+ 'to_fieldname' => '_bbp_forum_id',
170
+ 'callback_method' => 'callback_forumid'
171
+ );
172
+
173
+ // Topic author.
174
+ $this->field_map[] = array(
175
+ 'from_tablename' => 'threads',
176
+ 'from_fieldname' => 'uid',
177
+ 'to_type' => 'topic',
178
+ 'to_fieldname' => 'post_author',
179
+ 'callback_method' => 'callback_userid'
180
+ );
181
+
182
+ // Topic Author ip (Stored in postmeta)
183
+ $this->field_map[] = array(
184
+ 'from_tablename' => 'posts',
185
+ 'from_fieldname' => 'ipaddress',
186
+ 'join_tablename' => 'threads',
187
+ 'join_type' => 'INNER',
188
+ 'join_expression' => 'USING (tid) WHERE replyto = 0',
189
+ 'to_type' => 'topic',
190
+ 'to_fieldname' => '_bbp_author_ip'
191
+ );
192
+
193
+ // Topic content.
194
+ // Note: We join the 'posts' table because 'threads' table does not have content.
195
+ $this->field_map[] = array(
196
+ 'from_tablename' => 'posts',
197
+ 'from_fieldname' => 'message',
198
+ 'join_tablename' => 'threads',
199
+ 'join_type' => 'INNER',
200
+ 'join_expression' => 'USING (tid) WHERE replyto = 0',
201
+ 'to_type' => 'topic',
202
+ 'to_fieldname' => 'post_content',
203
+ 'callback_method' => 'callback_html'
204
+ );
205
+
206
+ // Topic title.
207
+ $this->field_map[] = array(
208
+ 'from_tablename' => 'threads',
209
+ 'from_fieldname' => 'subject',
210
+ 'to_type' => 'topic',
211
+ 'to_fieldname' => 'post_title'
212
+ );
213
+
214
+ // Topic slug (Clean name to avoid conflicts)
215
+ $this->field_map[] = array(
216
+ 'from_tablename' => 'threads',
217
+ 'from_fieldname' => 'subject',
218
+ 'to_type' => 'topic',
219
+ 'to_fieldname' => 'post_name',
220
+ 'callback_method' => 'callback_slug'
221
+ );
222
+
223
+ // Topic parent forum id (If no parent, then 0)
224
+ $this->field_map[] = array(
225
+ 'from_tablename' => 'threads',
226
+ 'from_fieldname' => 'fid',
227
+ 'to_type' => 'topic',
228
+ 'to_fieldname' => 'post_parent',
229
+ 'callback_method' => 'callback_forumid'
230
+ );
231
+
232
+ // Sticky status (Stored in postmeta)
233
+ $this->field_map[] = array(
234
+ 'from_tablename' => 'threads',
235
+ 'from_fieldname' => 'sticky',
236
+ 'to_type' => 'topic',
237
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
238
+ 'callback_method' => 'callback_sticky_status'
239
+ );
240
+
241
+ // Topic dates.
242
+ $this->field_map[] = array(
243
+ 'from_tablename' => 'threads',
244
+ 'from_fieldname' => 'dateline',
245
+ 'to_type' => 'topic',
246
+ 'to_fieldname' => 'post_date',
247
+ 'callback_method' => 'callback_datetime'
248
+ );
249
+ $this->field_map[] = array(
250
+ 'from_tablename' => 'threads',
251
+ 'from_fieldname' => 'dateline',
252
+ 'to_type' => 'topic',
253
+ 'to_fieldname' => 'post_date_gmt',
254
+ 'callback_method' => 'callback_datetime'
255
+ );
256
+ $this->field_map[] = array(
257
+ 'from_tablename' => 'threads',
258
+ 'from_fieldname' => 'lastpost',
259
+ 'to_type' => 'topic',
260
+ 'to_fieldname' => 'post_modified',
261
+ 'callback_method' => 'callback_datetime'
262
+ );
263
+ $this->field_map[] = array(
264
+ 'from_tablename' => 'threads',
265
+ 'from_fieldname' => 'lastpost',
266
+ 'to_type' => 'topic',
267
+ 'to_fieldname' => 'post_modified_gmt',
268
+ 'callback_method' => 'callback_datetime'
269
+ );
270
+ $this->field_map[] = array(
271
+ 'from_tablename' => 'threads',
272
+ 'from_fieldname' => 'lastpost',
273
+ 'to_type' => 'topic',
274
+ 'to_fieldname' => '_bbp_last_active_time',
275
+ 'callback_method' => 'callback_datetime'
276
+ );
277
+
278
+ // Topic status (Open or Closed, MyBB v1.6.10 open = null & closed = 1)
279
+ $this->field_map[] = array(
280
+ 'from_tablename' => 'threads',
281
+ 'from_fieldname' => 'closed',
282
+ 'to_type' => 'topic',
283
+ 'to_fieldname' => '_bbp_old_closed_status_id',
284
+ 'callback_method' => 'callback_topic_status'
285
+ );
286
+
287
+ /** Tags Section ******************************************************/
288
+
289
+ /**
290
+ * MyBB v1.6.10 Forums do not support topic tags out of the box
291
+ */
292
+
293
+ /** Reply Section *****************************************************/
294
+
295
+ // Old reply id (Stored in postmeta)
296
+ $this->field_map[] = array(
297
+ 'from_tablename' => 'posts',
298
+ 'from_fieldname' => 'pid',
299
+ 'from_expression' => 'WHERE replyto != 0',
300
+ 'to_type' => 'reply',
301
+ 'to_fieldname' => '_bbp_old_reply_id'
302
+ );
303
+
304
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'posts',
307
+ 'from_fieldname' => 'fid',
308
+ 'to_type' => 'reply',
309
+ 'to_fieldname' => '_bbp_forum_id',
310
+ 'callback_method' => 'callback_topicid_to_forumid'
311
+ );
312
+
313
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
314
+ $this->field_map[] = array(
315
+ 'from_tablename' => 'posts',
316
+ 'from_fieldname' => 'tid',
317
+ 'to_type' => 'reply',
318
+ 'to_fieldname' => '_bbp_topic_id',
319
+ 'callback_method' => 'callback_topicid'
320
+ );
321
+
322
+ // Reply author ip (Stored in postmeta)
323
+ $this->field_map[] = array(
324
+ 'from_tablename' => 'posts',
325
+ 'from_fieldname' => 'ipaddress',
326
+ 'to_type' => 'reply',
327
+ 'to_fieldname' => '_bbp_author_ip'
328
+ );
329
+
330
+ // Reply author.
331
+ $this->field_map[] = array(
332
+ 'from_tablename' => 'posts',
333
+ 'from_fieldname' => 'uid',
334
+ 'to_type' => 'reply',
335
+ 'to_fieldname' => 'post_author',
336
+ 'callback_method' => 'callback_userid'
337
+ );
338
+
339
+ // Reply content.
340
+ $this->field_map[] = array(
341
+ 'from_tablename' => 'posts',
342
+ 'from_fieldname' => 'message',
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' => 'posts',
351
+ 'from_fieldname' => 'tid',
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' => 'posts',
360
+ 'from_fieldname' => 'dateline',
361
+ 'to_type' => 'reply',
362
+ 'to_fieldname' => 'post_date',
363
+ 'callback_method' => 'callback_datetime'
364
+ );
365
+ $this->field_map[] = array(
366
+ 'from_tablename' => 'posts',
367
+ 'from_fieldname' => 'dateline',
368
+ 'to_type' => 'reply',
369
+ 'to_fieldname' => 'post_date_gmt',
370
+ 'callback_method' => 'callback_datetime'
371
+ );
372
+ $this->field_map[] = array(
373
+ 'from_tablename' => 'posts',
374
+ 'from_fieldname' => 'edittime',
375
+ 'to_type' => 'reply',
376
+ 'to_fieldname' => 'post_modified',
377
+ 'callback_method' => 'callback_datetime'
378
+ );
379
+ $this->field_map[] = array(
380
+ 'from_tablename' => 'posts',
381
+ 'from_fieldname' => 'edittime',
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' => 'users',
392
+ 'from_fieldname' => 'uid',
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' => 'users',
400
+ 'from_fieldname' => 'password',
401
+ 'to_type' => 'user',
402
+ 'to_fieldname' => '_bbp_password',
403
+ 'callback_method' => 'callback_savepass'
404
+ );
405
+
406
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
407
+ $this->field_map[] = array(
408
+ 'from_tablename' => 'users',
409
+ 'from_fieldname' => 'salt',
410
+ 'to_type' => 'user',
411
+ 'to_fieldname' => ''
412
+ );
413
+
414
+ // User password verify class (Stored in usermeta for verifying password)
415
+ $this->field_map[] = array(
416
+ 'to_type' => 'users',
417
+ 'to_fieldname' => '_bbp_class',
418
+ 'default' => 'MyBB'
419
+ );
420
+
421
+ // User name.
422
+ $this->field_map[] = array(
423
+ 'from_tablename' => 'users',
424
+ 'from_fieldname' => 'username',
425
+ 'to_type' => 'user',
426
+ 'to_fieldname' => 'user_login'
427
+ );
428
+
429
+ // User nice name.
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'users',
432
+ 'from_fieldname' => 'username',
433
+ 'to_type' => 'user',
434
+ 'to_fieldname' => 'user_nicename'
435
+ );
436
+
437
+ // User email.
438
+ $this->field_map[] = array(
439
+ 'from_tablename' => 'users',
440
+ 'from_fieldname' => 'email',
441
+ 'to_type' => 'user',
442
+ 'to_fieldname' => 'user_email'
443
+ );
444
+
445
+ // User homepage.
446
+ $this->field_map[] = array(
447
+ 'from_tablename' => 'users',
448
+ 'from_fieldname' => 'website',
449
+ 'to_type' => 'user',
450
+ 'to_fieldname' => 'user_url'
451
+ );
452
+
453
+ // User registered.
454
+ $this->field_map[] = array(
455
+ 'from_tablename' => 'users',
456
+ 'from_fieldname' => 'regdate',
457
+ 'to_type' => 'user',
458
+ 'to_fieldname' => 'user_registered',
459
+ 'callback_method' => 'callback_datetime'
460
+ );
461
+
462
+ // User display name.
463
+ $this->field_map[] = array(
464
+ 'from_tablename' => 'users',
465
+ 'from_fieldname' => 'usertitle',
466
+ 'to_type' => 'user',
467
+ 'to_fieldname' => 'display_name'
468
+ );
469
+
470
+ // User AIM (Stored in usermeta)
471
+ $this->field_map[] = array(
472
+ 'from_tablename' => 'users',
473
+ 'from_fieldname' => 'aim',
474
+ 'to_type' => 'user',
475
+ 'to_fieldname' => '_bbp_mybb_user_aim'
476
+ );
477
+
478
+ // User Yahoo (Stored in usermeta)
479
+ $this->field_map[] = array(
480
+ 'from_tablename' => 'users',
481
+ 'from_fieldname' => 'yahoo',
482
+ 'to_type' => 'user',
483
+ 'to_fieldname' => '_bbp_mybb_user_yim'
484
+ );
485
+
486
+ // Store ICQ (Stored in usermeta)
487
+ $this->field_map[] = array(
488
+ 'from_tablename' => 'users',
489
+ 'from_fieldname' => 'icq',
490
+ 'to_type' => 'user',
491
+ 'to_fieldname' => '_bbp_mybb_user_icq'
492
+ );
493
+
494
+ // Store MSN (Stored in usermeta)
495
+ $this->field_map[] = array(
496
+ 'from_tablename' => 'users',
497
+ 'from_fieldname' => 'msn',
498
+ 'to_type' => 'user',
499
+ 'to_fieldname' => '_bbp_mybb_user_msn'
500
+ );
501
+
502
+ // Store Signature (Stored in usermeta)
503
+ $this->field_map[] = array(
504
+ 'from_tablename' => 'users',
505
+ 'from_fieldname' => 'signature',
506
+ 'to_type' => 'user',
507
+ 'to_fieldname' => '_bbp_mybb_user_sig',
508
+ 'callback_method' => 'callback_html'
509
+ );
510
+
511
+ }
512
+
513
+ /**
514
+ * This method allows us to indicates what is or is not converted for each
515
+ * converter.
516
+ */
517
+ public function info() {
518
+ return '';
519
+ }
520
+
521
+ /**
522
+ * This method is to save the salt and password together. That
523
+ * way when we authenticate it we can get it out of the database
524
+ * as one value. Array values are auto sanitized by WordPress.
525
+ */
526
+ public function callback_savepass( $field, $row ) {
527
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
528
+ return $pass_array;
529
+ }
530
+
531
+ /**
532
+ * This method is to take the pass out of the database and compare
533
+ * to a pass the user has typed in.
534
+ */
535
+ public function authenticate_pass( $password, $serialized_pass ) {
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 numerics 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 numerics 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
+ }
 
includes/admin/converters/PHPFox3.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of PHPFox v3.x Forum converter.
5
  *
6
- * @since bbPress (r5146)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/phpfox
 
8
  */
9
  class PHPFox3 extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses PHPFox3::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +31,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 +44,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 +155,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 +244,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 +332,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 +370,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 +425,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 +442,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',
@@ -522,8 +504,7 @@ class PHPFox3 extends BBP_Converter_Base {
522
  * This method allows us to indicates what is or is not converted for each
523
  * converter.
524
  */
525
- public function info()
526
- {
527
  return '';
528
  }
529
 
@@ -532,8 +513,7 @@ class PHPFox3 extends BBP_Converter_Base {
532
  * way when we authenticate it we can get it out of the database
533
  * as one value. Array values are auto sanitized by WordPress.
534
  */
535
- public function callback_savepass( $field, $row )
536
- {
537
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
538
  return $pass_array;
539
  }
@@ -542,14 +522,13 @@ class PHPFox3 extends BBP_Converter_Base {
542
  * This method is to take the pass out of the database and compare
543
  * to a pass the user has typed in.
544
  */
545
- public function authenticate_pass( $password, $serialized_pass )
546
- {
547
  $pass_array = unserialize( $serialized_pass );
548
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
549
  }
550
 
551
  /**
552
- * Translate the forum type from PHPFox v3.5.x numeric's to WordPress's strings.
553
  *
554
  * @param int $status PHPFox v3.5.x numeric forum type
555
  * @return string WordPress safe
@@ -569,7 +548,7 @@ class PHPFox3 extends BBP_Converter_Base {
569
  }
570
 
571
  /**
572
- * Translate the forum status from PHPFox v3.5.x numeric's to WordPress's strings.
573
  *
574
  * @param int $status PHPFox v3.5.x numeric forum status
575
  * @return string WordPress safe
@@ -589,7 +568,7 @@ class PHPFox3 extends BBP_Converter_Base {
589
  }
590
 
591
  /**
592
- * Translate the post status from PHPFox v3.5.x numeric's to WordPress's strings.
593
  *
594
  * @param int $status PHPFox v3.5.x numeric topic status
595
  * @return string WordPress safe
@@ -609,7 +588,7 @@ class PHPFox3 extends BBP_Converter_Base {
609
  }
610
 
611
  /**
612
- * Translate the topic sticky status type from PHPFox v3.5.x numeric's to WordPress's strings.
613
  *
614
  * @param int $status PHPFox v3.5.x numeric forum type
615
  * @return string WordPress safe
@@ -638,15 +617,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
31
 
32
  /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
35
  $this->field_map[] = array(
36
  'from_tablename' => 'forum',
37
  'from_fieldname' => 'forum_id',
38
  'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
  // Forum parent id (If no parent, then 0, Stored in postmeta)
44
  'from_tablename' => 'forum',
45
  'from_fieldname' => 'parent_id',
46
  'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
  );
49
 
50
  // Forum topic count (Stored in postmeta)
155
 
156
  /** Topic Section *****************************************************/
157
 
158
+ // Old topic id (Stored in postmeta)
159
  $this->field_map[] = array(
160
  'from_tablename' => 'forum_thread',
161
  'from_fieldname' => 'thread_id',
162
  'to_type' => 'topic',
163
+ 'to_fieldname' => '_bbp_old_topic_id'
164
  );
165
 
166
  // Topic reply count (Stored in postmeta)
244
  'from_tablename' => 'forum_thread',
245
  'from_fieldname' => 'is_closed',
246
  'to_type' => 'topic',
247
+ 'to_fieldname' => '_bbp_old_closed_status_id',
248
  'callback_method' => 'callback_topic_status'
249
  );
250
 
251
+ // Sticky status (Stored in postmeta)
252
  $this->field_map[] = array(
253
  'from_tablename' => 'forum_thread',
254
  'from_fieldname' => 'order_id',
255
  'to_type' => 'topic',
256
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
257
  'callback_method' => 'callback_sticky_status'
258
  );
259
 
332
 
333
  /** Reply Section *****************************************************/
334
 
335
+ // Old reply id (Stored in postmeta)
336
  $this->field_map[] = array(
337
  'from_tablename' => 'forum_post',
338
  'from_fieldname' => 'post_id',
339
  'to_type' => 'reply',
340
+ 'to_fieldname' => '_bbp_old_reply_id'
341
  );
342
 
343
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
370
  'callback_method' => 'callback_userid'
371
  );
372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  // Reply content.
374
  // Note: We join the 'forum_post_text' table because 'forum_post' table does not include content.
375
  // Note: We can use 'text' for original text OR 'text_parsed' for pre-parsed text output
425
 
426
  /** User Section ******************************************************/
427
 
428
+ // Store old user id (Stored in usermeta)
429
  $this->field_map[] = array(
430
  'from_tablename' => 'user',
431
  'from_fieldname' => 'user_id',
432
  'to_type' => 'user',
433
+ 'to_fieldname' => '_bbp_old_user_id'
434
  );
435
 
436
+ // Store old user password (Stored in usermeta serialized with salt)
437
  $this->field_map[] = array(
438
  'from_tablename' => 'user',
439
  'from_fieldname' => 'password',
442
  'callback_method' => 'callback_savepass'
443
  );
444
 
445
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
446
  $this->field_map[] = array(
447
  'from_tablename' => 'user',
448
  'from_fieldname' => 'password_salt',
504
  * This method allows us to indicates what is or is not converted for each
505
  * converter.
506
  */
507
+ public function info() {
 
508
  return '';
509
  }
510
 
513
  * way when we authenticate it we can get it out of the database
514
  * as one value. Array values are auto sanitized by WordPress.
515
  */
516
+ public function callback_savepass( $field, $row ) {
 
517
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
518
  return $pass_array;
519
  }
522
  * This method is to take the pass out of the database and compare
523
  * to a pass the user has typed in.
524
  */
525
+ public function authenticate_pass( $password, $serialized_pass ) {
 
526
  $pass_array = unserialize( $serialized_pass );
527
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
528
  }
529
 
530
  /**
531
+ * Translate the forum type from PHPFox v3.5.x numerics to WordPress's strings.
532
  *
533
  * @param int $status PHPFox v3.5.x numeric forum type
534
  * @return string WordPress safe
548
  }
549
 
550
  /**
551
+ * Translate the forum status from PHPFox v3.5.x numerics to WordPress's strings.
552
  *
553
  * @param int $status PHPFox v3.5.x numeric forum status
554
  * @return string WordPress safe
568
  }
569
 
570
  /**
571
+ * Translate the post status from PHPFox v3.5.x numerics to WordPress's strings.
572
  *
573
  * @param int $status PHPFox v3.5.x numeric topic status
574
  * @return string WordPress safe
588
  }
589
 
590
  /**
591
+ * Translate the topic sticky status type from PHPFox v3.5.x numerics to WordPress's strings.
592
  *
593
  * @param int $status PHPFox v3.5.x numeric forum type
594
  * @return string WordPress safe
617
  $count = absint( (int) $count - 1 );
618
  return $count;
619
  }
620
+ }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/converters/PHPWind.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of PHPWind Forum converter.
5
  *
6
- * @since bbPress (r5142)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/phpwind
 
8
  */
9
  class PHPWind extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses PHPWind::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +31,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 +44,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 +138,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 +168,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 +301,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 +313,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 +356,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 +406,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 +423,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',
@@ -497,8 +484,7 @@ class PHPWind extends BBP_Converter_Base {
497
  * This method allows us to indicates what is or is not converted for each
498
  * converter.
499
  */
500
- public function info()
501
- {
502
  return '';
503
  }
504
 
@@ -507,8 +493,7 @@ class PHPWind extends BBP_Converter_Base {
507
  * way when we authenticate it we can get it out of the database
508
  * as one value. Array values are auto sanitized by WordPress.
509
  */
510
- public function callback_savepass( $field, $row )
511
- {
512
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
513
  return $pass_array;
514
  }
@@ -517,8 +502,7 @@ class PHPWind extends BBP_Converter_Base {
517
  * This method is to take the pass out of the database and compare
518
  * to a pass the user has typed in.
519
  */
520
- public function authenticate_pass( $password, $serialized_pass )
521
- {
522
  $pass_array = unserialize( $serialized_pass );
523
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
524
  }
@@ -552,7 +536,7 @@ class PHPWind extends BBP_Converter_Base {
552
  }
553
 
554
  /**
555
- * Translate the post status from PHPWind v9.x numeric's to WordPress's strings.
556
  *
557
  * @param int $status PHPWind v9.x numeric topic status
558
  * @return string WordPress safe
@@ -582,4 +566,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
31
 
32
  /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
35
  $this->field_map[] = array(
36
  'from_tablename' => 'bbs_forum',
37
  'from_fieldname' => 'fid',
38
  'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
  // Forum parent id (If no parent, then 0, Stored in postmeta)
44
  'from_tablename' => 'bbs_forum',
45
  'from_fieldname' => 'parentid',
46
  'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
  );
49
 
50
  // Forum topic count (Stored in postmeta)
138
  'callback_method' => 'callback_forum_type'
139
  );
140
 
141
+ // Forum status (Set a default value 'open', Stored in postmeta)
142
+ $this->field_map[] = array(
143
+ 'to_type' => 'forum',
144
+ 'to_fieldname' => '_bbp_status',
145
+ 'default' => 'open'
146
+ );
147
  // Forum dates.
148
  $this->field_map[] = array(
149
  'to_type' => 'bbs_forum',
168
 
169
  /** Topic Section *****************************************************/
170
 
171
+ // Old topic id (Stored in postmeta)
172
  $this->field_map[] = array(
173
  'from_tablename' => 'bbs_threads',
174
  'from_fieldname' => 'tid',
175
  'to_type' => 'topic',
176
+ 'to_fieldname' => '_bbp_old_topic_id'
177
  );
178
 
179
  // Topic reply count (Stored in postmeta)
301
  'from_tablename' => 'bbs_threads',
302
  'from_fieldname' => 'tpcstatus',
303
  'to_type' => 'topic',
304
+ 'to_fieldname' => '_bbp_old_closed_status_id',
305
  'callback_method' => 'callback_topic_status'
306
  );
307
 
313
 
314
  /** Reply Section *****************************************************/
315
 
316
+ // Old reply id (Stored in postmeta)
317
  $this->field_map[] = array(
318
  'from_tablename' => 'bbs_posts',
319
  'from_fieldname' => 'pid',
320
  'to_type' => 'reply',
321
+ 'to_fieldname' => '_bbp_old_reply_id'
322
  );
323
 
324
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
356
  'callback_method' => 'callback_userid'
357
  );
358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  // Reply content.
360
  $this->field_map[] = array(
361
  'from_tablename' => 'bbs_posts',
406
 
407
  /** User Section ******************************************************/
408
 
409
+ // Store old user id (Stored in usermeta)
410
  $this->field_map[] = array(
411
  'from_tablename' => 'user',
412
  'from_fieldname' => 'uid',
413
  'to_type' => 'user',
414
+ 'to_fieldname' => '_bbp_old_user_id'
415
  );
416
 
417
+ // Store old user password (Stored in usermeta serialized with salt)
418
  $this->field_map[] = array(
419
  'from_tablename' => 'user',
420
  'from_fieldname' => 'password',
423
  // 'callback_method' => 'callback_savepass'
424
  );
425
 
426
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
427
  /* $this->field_map[] = array(
428
  'from_tablename' => 'user',
429
  'from_fieldname' => 'pass',
484
  * This method allows us to indicates what is or is not converted for each
485
  * converter.
486
  */
487
+ public function info() {
 
488
  return '';
489
  }
490
 
493
  * way when we authenticate it we can get it out of the database
494
  * as one value. Array values are auto sanitized by WordPress.
495
  */
496
+ public function callback_savepass( $field, $row ) {
 
497
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
498
  return $pass_array;
499
  }
502
  * This method is to take the pass out of the database and compare
503
  * to a pass the user has typed in.
504
  */
505
+ public function authenticate_pass( $password, $serialized_pass ) {
 
506
  $pass_array = unserialize( $serialized_pass );
507
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
508
  }
536
  }
537
 
538
  /**
539
+ * Translate the post status from PHPWind v9.x numerics to WordPress's strings.
540
  *
541
  * @param int $status PHPWind v9.x numeric topic status
542
  * @return string WordPress safe
566
  return $count;
567
  }
568
 
569
+ }
includes/admin/converters/Phorum.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of Phorum Forum converter.
5
  *
6
- * @since bbPress (r5141)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/phorum
 
8
  */
9
  class Phorum extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses Phorum::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -25,12 +31,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 +44,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 +106,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 +137,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 +182,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 +284,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 +294,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 +330,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 +359,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 +426,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 +443,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',
@@ -465,8 +514,7 @@ class Phorum extends BBP_Converter_Base {
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
 
@@ -475,8 +523,7 @@ class Phorum extends BBP_Converter_Base {
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
  }
@@ -485,14 +532,13 @@ class Phorum extends BBP_Converter_Base {
485
  * This method is to take the pass out of the database and compare
486
  * to a pass the user has typed in.
487
  */
488
- public function authenticate_pass( $password, $serialized_pass )
489
- {
490
  $pass_array = unserialize( $serialized_pass );
491
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
492
  }
493
 
494
  /**
495
- * Translate the forum type from Phorum v5.2.19 numeric's to WordPress's strings.
496
  *
497
  * @param int $status Phorum v5.2.19 numeric forum type
498
  * @return string WordPress safe
@@ -512,7 +558,7 @@ class Phorum extends BBP_Converter_Base {
512
  }
513
 
514
  /**
515
- * Translate the post status from Phorum v5.2.19 numeric's to WordPress's strings.
516
  *
517
  * @param int $status Phorum v5.2.19 numeric topic status
518
  * @return string WordPress safe
@@ -541,5 +587,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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
31
 
32
  /** Forum Section *****************************************************/
33
 
34
+ // Old forum id (Stored in postmeta)
35
  $this->field_map[] = array(
36
  'from_tablename' => 'forums',
37
  'from_fieldname' => 'forum_id',
38
  'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
  );
41
 
42
  // Forum parent id (If no parent, then 0, Stored in postmeta)
44
  'from_tablename' => 'forums',
45
  'from_fieldname' => 'parent_id',
46
  'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
  );
49
 
50
  // Forum topic count (Stored in postmeta)
106
  'callback_method' => 'callback_forum_type'
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',
137
 
138
  /** Topic Section *****************************************************/
139
 
140
+ // Old topic id (Stored in postmeta)
141
  $this->field_map[] = array(
142
  'from_tablename' => 'messages',
143
  'from_fieldname' => 'thread',
144
  'from_expression' => 'WHERE parent_id = 0',
145
  'to_type' => 'topic',
146
+ 'to_fieldname' => '_bbp_old_topic_id'
147
  );
148
 
149
  // Topic reply count (Stored in postmeta)
182
  'callback_method' => 'callback_userid'
183
  );
184
 
185
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
186
+ $this->field_map[] = array(
187
+ 'from_tablename' => 'messages',
188
+ 'from_fieldname' => 'author',
189
+ 'to_type' => 'topic',
190
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
191
+ );
192
+
193
+ // Is the topic anonymous (Stored in postmeta)
194
+ $this->field_map[] = array(
195
+ 'from_tablename' => 'messages',
196
+ 'from_fieldname' => 'user_id',
197
+ 'to_type' => 'topic',
198
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
199
+ 'callback_method' => 'callback_check_anonymous'
200
+ );
201
+
202
  // Topic Author ip (Stored in postmeta)
203
  $this->field_map[] = array(
204
  'from_tablename' => 'messages',
284
  'from_tablename' => 'messages',
285
  'from_fieldname' => 'closed',
286
  'to_type' => 'topic',
287
+ 'to_fieldname' => '_bbp_old_closed_status_id',
288
  'callback_method' => 'callback_topic_status'
289
  );
290
 
294
  * Phorum v5.2.19 Forums do not support topic tags out of the box
295
  */
296
 
297
+ /** Topic Subscriptions Section ***************************************/
298
+
299
+ // Subscribed topic ID (Stored in usermeta)
300
+ $this->field_map[] = array(
301
+ 'from_tablename' => 'subscribers',
302
+ 'from_fieldname' => 'thread',
303
+ 'to_type' => 'topic_subscriptions',
304
+ 'to_fieldname' => '_bbp_subscriptions'
305
+ );
306
+
307
+ // Subscribed user ID (Stored in usermeta)
308
+ $this->field_map[] = array(
309
+ 'from_tablename' => 'subscribers',
310
+ 'from_fieldname' => 'user_id',
311
+ 'to_type' => 'topic_subscriptions',
312
+ 'to_fieldname' => 'user_id',
313
+ 'callback_method' => 'callback_userid'
314
+ );
315
+
316
  /** Reply Section *****************************************************/
317
 
318
+ // Old reply id (Stored in postmeta)
319
  $this->field_map[] = array(
320
  'from_tablename' => 'messages',
321
  'from_fieldname' => 'message_id',
322
  'from_expression' => 'WHERE parent_id != 0',
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)
330
  'from_fieldname' => 'forum_id',
331
  'to_type' => 'reply',
332
  'to_fieldname' => '_bbp_forum_id',
333
+ 'callback_method' => 'callback_forumid'
334
  );
335
 
336
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
359
  'callback_method' => 'callback_userid'
360
  );
361
 
362
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
363
  $this->field_map[] = array(
364
+ 'from_tablename' => 'messages',
365
+ 'from_fieldname' => 'author',
366
+ 'to_type' => 'reply',
367
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
368
  );
369
 
370
+ // Is the reply anonymous (Stored in postmeta)
371
  $this->field_map[] = array(
372
  'from_tablename' => 'messages',
373
+ 'from_fieldname' => 'user_id',
374
  'to_type' => 'reply',
375
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
376
+ 'callback_method' => 'callback_check_anonymous'
377
  );
378
 
379
  // Reply content.
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' => 'user_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',
514
  * This method allows us to indicates what is or is not converted for each
515
  * converter.
516
  */
517
+ public function info() {
 
518
  return '';
519
  }
520
 
523
  * way when we authenticate it we can get it out of the database
524
  * as one value. Array values are auto sanitized by WordPress.
525
  */
526
+ public function callback_savepass( $field, $row ) {
 
527
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
528
  return $pass_array;
529
  }
532
  * This method is to take the pass out of the database and compare
533
  * to a pass the user has typed in.
534
  */
535
+ public function authenticate_pass( $password, $serialized_pass ) {
 
536
  $pass_array = unserialize( $serialized_pass );
537
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
538
  }
539
 
540
  /**
541
+ * Translate the forum type from Phorum v5.2.19 numerics to WordPress's strings.
542
  *
543
  * @param int $status Phorum v5.2.19 numeric forum type
544
  * @return string WordPress safe
558
  }
559
 
560
  /**
561
+ * Translate the post status from Phorum v5.2.19 numerics to WordPress's strings.
562
  *
563
  * @param int $status Phorum v5.2.19 numeric topic status
564
  * @return string WordPress safe
587
  $count = absint( (int) $count - 1 );
588
  return $count;
589
  }
590
+ }
 
includes/admin/converters/PunBB.php CHANGED
@@ -1,680 +1,737 @@
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
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ /**
28
+ * Sets up the field mappings
29
+ */
30
+ public function setup_globals() {
31
+
32
+ /** Forum Section *****************************************************/
33
+
34
+ // Old forum id (Stored in postmeta)
35
+ $this->field_map[] = array(
36
+ 'from_tablename' => 'forums',
37
+ 'from_fieldname' => 'id',
38
+ 'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
+ );
41
+
42
+ // Forum topic count (Stored in postmeta)
43
+ $this->field_map[] = array(
44
+ 'from_tablename' => 'forums',
45
+ 'from_fieldname' => 'num_topics',
46
+ 'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_topic_count'
48
+ );
49
+
50
+ // Forum reply count (Stored in postmeta)
51
+ $this->field_map[] = array(
52
+ 'from_tablename' => 'forums',
53
+ 'from_fieldname' => 'num_posts',
54
+ 'to_type' => 'forum',
55
+ 'to_fieldname' => '_bbp_reply_count'
56
+ );
57
+
58
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
59
+ $this->field_map[] = array(
60
+ 'from_tablename' => 'forums',
61
+ 'from_fieldname' => 'num_topics',
62
+ 'to_type' => 'forum',
63
+ 'to_fieldname' => '_bbp_total_topic_count'
64
+ );
65
+
66
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
67
+ $this->field_map[] = array(
68
+ 'from_tablename' => 'forums',
69
+ 'from_fieldname' => 'num_posts',
70
+ 'to_type' => 'forum',
71
+ 'to_fieldname' => '_bbp_total_reply_count'
72
+ );
73
+
74
+ // Forum title.
75
+ $this->field_map[] = array(
76
+ 'from_tablename' => 'forums',
77
+ 'from_fieldname' => 'forum_name',
78
+ 'to_type' => 'forum',
79
+ 'to_fieldname' => 'post_title'
80
+ );
81
+
82
+ // Forum slug (Clean name to avoid conflicts)
83
+ $this->field_map[] = array(
84
+ 'from_tablename' => 'forums',
85
+ 'from_fieldname' => 'forum_name',
86
+ 'to_type' => 'forum',
87
+ 'to_fieldname' => 'post_name',
88
+ 'callback_method' => 'callback_slug'
89
+ );
90
+
91
+ // Forum description.
92
+ $this->field_map[] = array(
93
+ 'from_tablename' => 'forums',
94
+ 'from_fieldname' => 'forum_desc',
95
+ 'to_type' => 'forum',
96
+ 'to_fieldname' => 'post_content',
97
+ 'callback_method' => 'callback_null'
98
+ );
99
+
100
+ // Forum display order (Starts from 1)
101
+ $this->field_map[] = array(
102
+ 'from_tablename' => 'forums',
103
+ 'from_fieldname' => 'disp_position',
104
+ 'to_type' => 'forum',
105
+ 'to_fieldname' => 'menu_order'
106
+ );
107
+
108
+ // Forum type (Set a default value 'forum', Stored in postmeta)
109
+ $this->field_map[] = array(
110
+ 'to_type' => 'forum',
111
+ 'to_fieldname' => '_bbp_forum_type',
112
+ 'default' => 'forum'
113
+ );
114
+
115
+ // Forum status (Set a default value 'open', Stored in postmeta)
116
+ $this->field_map[] = array(
117
+ 'to_type' => 'forum',
118
+ 'to_fieldname' => '_bbp_status',
119
+ 'default' => 'open'
120
+ );
121
+
122
+ // Forum dates.
123
+ $this->field_map[] = array(
124
+ 'to_type' => 'forum',
125
+ 'to_fieldname' => 'post_date',
126
+ 'default' => date('Y-m-d H:i:s')
127
+ );
128
+ $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => 'post_date_gmt',
131
+ 'default' => date('Y-m-d H:i:s')
132
+ );
133
+ $this->field_map[] = array(
134
+ 'to_type' => 'forum',
135
+ 'to_fieldname' => 'post_modified',
136
+ 'default' => date('Y-m-d H:i:s')
137
+ );
138
+ $this->field_map[] = array(
139
+ 'to_type' => 'forum',
140
+ 'to_fieldname' => 'post_modified_gmt',
141
+ 'default' => date('Y-m-d H:i:s')
142
+ );
143
+
144
+ /** Forum Subscriptions Section ***************************************/
145
+
146
+ // Subscribed forum ID (Stored in usermeta)
147
+ $this->field_map[] = array(
148
+ 'from_tablename' => 'forum_subscriptions',
149
+ 'from_fieldname' => 'forum_id',
150
+ 'to_type' => 'forum_subscriptions',
151
+ 'to_fieldname' => '_bbp_forum_subscriptions'
152
+ );
153
+
154
+ // Subscribed user ID (Stored in usermeta)
155
+ $this->field_map[] = array(
156
+ 'from_tablename' => 'forum_subscriptions',
157
+ 'from_fieldname' => 'user_id',
158
+ 'to_type' => 'forum_subscriptions',
159
+ 'to_fieldname' => 'user_id',
160
+ 'callback_method' => 'callback_userid'
161
+ );
162
+
163
+ /** Topic Section *****************************************************/
164
+
165
+ // Old topic id (Stored in postmeta)
166
+ $this->field_map[] = array(
167
+ 'from_tablename' => 'topics',
168
+ 'from_fieldname' => 'id',
169
+ 'to_type' => 'topic',
170
+ 'to_fieldname' => '_bbp_old_topic_id'
171
+ );
172
+
173
+ // Topic reply count (Stored in postmeta)
174
+ $this->field_map[] = array(
175
+ 'from_tablename' => 'topics',
176
+ 'from_fieldname' => 'num_replies',
177
+ 'to_type' => 'topic',
178
+ 'to_fieldname' => '_bbp_reply_count',
179
+ 'callback_method' => 'callback_topic_reply_count'
180
+ );
181
+
182
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
183
+ $this->field_map[] = array(
184
+ 'from_tablename' => 'topics',
185
+ 'from_fieldname' => 'num_replies',
186
+ 'to_type' => 'topic',
187
+ 'to_fieldname' => '_bbp_total_reply_count',
188
+ 'callback_method' => 'callback_topic_reply_count'
189
+ );
190
+
191
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
192
+ $this->field_map[] = array(
193
+ 'from_tablename' => 'topics',
194
+ 'from_fieldname' => 'forum_id',
195
+ 'to_type' => 'topic',
196
+ 'to_fieldname' => '_bbp_forum_id',
197
+ 'callback_method' => 'callback_forumid'
198
+ );
199
+
200
+ // Topic author.
201
+ // Note: We join the 'posts' table because 'topics' table does not have user id's.
202
+ $this->field_map[] = array(
203
+ 'from_tablename' => 'posts',
204
+ 'from_fieldname' => 'poster_id',
205
+ 'join_tablename' => 'topics',
206
+ 'join_type' => 'LEFT',
207
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
208
+ 'to_type' => 'topic',
209
+ 'to_fieldname' => 'post_author',
210
+ 'callback_method' => 'callback_userid'
211
+ );
212
+
213
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
214
+ $this->field_map[] = array(
215
+ 'from_tablename' => 'topics',
216
+ 'from_fieldname' => 'poster',
217
+ 'to_type' => 'topic',
218
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
219
+ );
220
+
221
+ // Is the topic anonymous (Stored in postmeta)
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'posts',
224
+ 'from_fieldname' => 'poster_id',
225
+ 'join_tablename' => 'topics',
226
+ 'join_type' => 'LEFT',
227
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
228
+ 'to_type' => 'topic',
229
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
230
+ 'callback_method' => 'callback_check_anonymous'
231
+ );
232
+
233
+ // Topic Author ip (Stored in postmeta)
234
+ // Note: We join the 'posts' table because 'topics' table does not have author ip.
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'posts',
237
+ 'from_fieldname' => 'poster_ip',
238
+ 'join_tablename' => 'topics',
239
+ 'join_type' => 'LEFT',
240
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
241
+ 'to_type' => 'topic',
242
+ 'to_fieldname' => '_bbp_author_ip'
243
+ );
244
+
245
+ // Topic content.
246
+ // Note: We join the 'posts' table because 'topics' table does not have content.
247
+ $this->field_map[] = array(
248
+ 'from_tablename' => 'posts',
249
+ 'from_fieldname' => 'message',
250
+ 'join_tablename' => 'topics',
251
+ 'join_type' => 'LEFT',
252
+ 'join_expression' => 'ON topics.first_post_id = posts.id',
253
+ 'to_type' => 'topic',
254
+ 'to_fieldname' => 'post_content',
255
+ 'callback_method' => 'callback_html'
256
+ );
257
+
258
+ // Topic title.
259
+ $this->field_map[] = array(
260
+ 'from_tablename' => 'topics',
261
+ 'from_fieldname' => 'subject',
262
+ 'to_type' => 'topic',
263
+ 'to_fieldname' => 'post_title'
264
+ );
265
+
266
+ // Topic slug (Clean name to avoid conflicts)
267
+ $this->field_map[] = array(
268
+ 'from_tablename' => 'topics',
269
+ 'from_fieldname' => 'subject',
270
+ 'to_type' => 'topic',
271
+ 'to_fieldname' => 'post_name',
272
+ 'callback_method' => 'callback_slug'
273
+ );
274
+
275
+ // Topic parent forum id (If no parent, then 0)
276
+ $this->field_map[] = array(
277
+ 'from_tablename' => 'topics',
278
+ 'from_fieldname' => 'forum_id',
279
+ 'to_type' => 'topic',
280
+ 'to_fieldname' => 'post_parent',
281
+ 'callback_method' => 'callback_forumid'
282
+ );
283
+
284
+ // Topic status (Open or Closed, PunBB v1.4.2 0=open & 1=closed)
285
+ $this->field_map[] = array(
286
+ 'from_tablename' => 'topics',
287
+ 'from_fieldname' => 'closed',
288
+ 'to_type' => 'topic',
289
+ 'to_fieldname' => '_bbp_old_closed_status_id',
290
+ 'callback_method' => 'callback_topic_status'
291
+ );
292
+
293
+ // Sticky status (Stored in postmeta)
294
+ $this->field_map[] = array(
295
+ 'from_tablename' => 'topics',
296
+ 'from_fieldname' => 'sticky',
297
+ 'to_type' => 'topic',
298
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
299
+ 'callback_method' => 'callback_sticky_status'
300
+ );
301
+ // Topic dates.
302
+ $this->field_map[] = array(
303
+ 'from_tablename' => 'topics',
304
+ 'from_fieldname' => 'posted',
305
+ 'to_type' => 'topic',
306
+ 'to_fieldname' => 'post_date',
307
+ 'callback_method' => 'callback_datetime'
308
+ );
309
+ $this->field_map[] = array(
310
+ 'from_tablename' => 'topics',
311
+ 'from_fieldname' => 'posted',
312
+ 'to_type' => 'topic',
313
+ 'to_fieldname' => 'post_date_gmt',
314
+ 'callback_method' => 'callback_datetime'
315
+ );
316
+ $this->field_map[] = array(
317
+ 'from_tablename' => 'topics',
318
+ 'from_fieldname' => 'last_post',
319
+ 'to_type' => 'topic',
320
+ 'to_fieldname' => 'post_modified',
321
+ 'callback_method' => 'callback_datetime'
322
+ );
323
+ $this->field_map[] = array(
324
+ 'from_tablename' => 'topics',
325
+ 'from_fieldname' => 'last_post',
326
+ 'to_type' => 'topic',
327
+ 'to_fieldname' => 'post_modified_gmt',
328
+ 'callback_method' => 'callback_datetime'
329
+ );
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'topics',
332
+ 'from_fieldname' => 'last_post',
333
+ 'to_type' => 'topic',
334
+ 'to_fieldname' => '_bbp_last_active_time',
335
+ 'callback_method' => 'callback_datetime'
336
+ );
337
+
338
+ /** Tags Section ******************************************************/
339
+
340
+ /**
341
+ * PunBB v1.4.2 Forums do not support topic tags out of the box
342
+ */
343
+
344
+ /** Topic Subscriptions Section ***************************************/
345
+
346
+ // Subscribed topic ID (Stored in usermeta)
347
+ $this->field_map[] = array(
348
+ 'from_tablename' => 'subscriptions',
349
+ 'from_fieldname' => 'topic_id',
350
+ 'to_type' => 'topic_subscriptions',
351
+ 'to_fieldname' => '_bbp_subscriptions'
352
+ );
353
+
354
+ // Subscribed user ID (Stored in usermeta)
355
+ $this->field_map[] = array(
356
+ 'from_tablename' => 'subscriptions',
357
+ 'from_fieldname' => 'user_id',
358
+ 'to_type' => 'topic_subscriptions',
359
+ 'to_fieldname' => 'user_id',
360
+ 'callback_method' => 'callback_userid'
361
+ );
362
+
363
+ /** Reply Section *****************************************************/
364
+
365
+ // Old reply id (Stored in postmeta)
366
+ $this->field_map[] = array(
367
+ 'from_tablename' => 'posts',
368
+ 'from_fieldname' => 'id',
369
+ 'to_type' => 'reply',
370
+ 'to_fieldname' => '_bbp_old_reply_id'
371
+ );
372
+
373
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
374
+ // Note: We join the 'topics' table because 'posts' table does not have parent forum id's.
375
+ $this->field_map[] = array(
376
+ 'from_tablename' => 'topics',
377
+ 'from_fieldname' => 'forum_id',
378
+ 'join_tablename' => 'posts',
379
+ 'join_type' => 'LEFT',
380
+ 'join_expression' => 'ON topics.id = posts.topic_id WHERE topics.first_post_id != posts.id',
381
+ 'to_type' => 'reply',
382
+ 'to_fieldname' => '_bbp_forum_id',
383
+ 'callback_method' => 'callback_topicid_to_forumid'
384
+ );
385
+
386
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
387
+ $this->field_map[] = array(
388
+ 'from_tablename' => 'posts',
389
+ 'from_fieldname' => 'topic_id',
390
+ 'to_type' => 'reply',
391
+ 'to_fieldname' => '_bbp_topic_id',
392
+ 'callback_method' => 'callback_topicid'
393
+ );
394
+
395
+ // Reply author ip (Stored in postmeta)
396
+ $this->field_map[] = array(
397
+ 'from_tablename' => 'posts',
398
+ 'from_fieldname' => 'poster_ip',
399
+ 'to_type' => 'reply',
400
+ 'to_fieldname' => '_bbp_author_ip'
401
+ );
402
+
403
+ // Reply author.
404
+ $this->field_map[] = array(
405
+ 'from_tablename' => 'posts',
406
+ 'from_fieldname' => 'poster_id',
407
+ 'to_type' => 'reply',
408
+ 'to_fieldname' => 'post_author',
409
+ 'callback_method' => 'callback_userid'
410
+ );
411
+
412
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
413
+ $this->field_map[] = array(
414
+ 'from_tablename' => 'posts',
415
+ 'from_fieldname' => 'poster',
416
+ 'to_type' => 'reply',
417
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
418
+ );
419
+
420
+ // Is the reply anonymous (Stored in postmeta)
421
+ $this->field_map[] = array(
422
+ 'from_tablename' => 'posts',
423
+ 'from_fieldname' => 'poster_id',
424
+ 'to_type' => 'reply',
425
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
426
+ 'callback_method' => 'callback_check_anonymous'
427
+ );
428
+
429
+ // Reply content.
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'posts',
432
+ 'from_fieldname' => 'message',
433
+ 'to_type' => 'reply',
434
+ 'to_fieldname' => 'post_content',
435
+ 'callback_method' => 'callback_html'
436
+ );
437
+
438
+ // Reply parent topic id (If no parent, then 0)
439
+ $this->field_map[] = array(
440
+ 'from_tablename' => 'posts',
441
+ 'from_fieldname' => 'topic_id',
442
+ 'to_type' => 'reply',
443
+ 'to_fieldname' => 'post_parent',
444
+ 'callback_method' => 'callback_topicid'
445
+ );
446
+
447
+ // Reply dates.
448
+ $this->field_map[] = array(
449
+ 'from_tablename' => 'posts',
450
+ 'from_fieldname' => 'posted',
451
+ 'to_type' => 'reply',
452
+ 'to_fieldname' => 'post_date',
453
+ 'callback_method' => 'callback_datetime'
454
+ );
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'posts',
457
+ 'from_fieldname' => 'posted',
458
+ 'to_type' => 'reply',
459
+ 'to_fieldname' => 'post_date_gmt',
460
+ 'callback_method' => 'callback_datetime'
461
+ );
462
+ $this->field_map[] = array(
463
+ 'from_tablename' => 'posts',
464
+ 'from_fieldname' => 'edited',
465
+ 'to_type' => 'reply',
466
+ 'to_fieldname' => 'post_modified',
467
+ 'callback_method' => 'callback_datetime'
468
+ );
469
+ $this->field_map[] = array(
470
+ 'from_tablename' => 'posts',
471
+ 'from_fieldname' => 'edited',
472
+ 'to_type' => 'reply',
473
+ 'to_fieldname' => 'post_modified_gmt',
474
+ 'callback_method' => 'callback_datetime'
475
+ );
476
+
477
+ /** User Section ******************************************************/
478
+
479
+ // Store old user id (Stored in usermeta)
480
+ // Don't import user id 1, this is PunBB's guest user
481
+ $this->field_map[] = array(
482
+ 'from_tablename' => 'users',
483
+ 'from_fieldname' => 'id',
484
+ 'from_expression' => 'WHERE id != 1',
485
+ 'to_type' => 'user',
486
+ 'to_fieldname' => '_bbp_old_user_id'
487
+ );
488
+
489
+ // Store old user password (Stored in usermeta serialized with salt)
490
+ $this->field_map[] = array(
491
+ 'from_tablename' => 'users',
492
+ 'from_fieldname' => 'password',
493
+ 'to_type' => 'user',
494
+ 'to_fieldname' => '_bbp_password',
495
+ 'callback_method' => 'callback_savepass'
496
+ );
497
+
498
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
499
+ $this->field_map[] = array(
500
+ 'from_tablename' => 'users',
501
+ 'from_fieldname' => 'salt',
502
+ 'to_type' => 'user',
503
+ 'to_fieldname' => ''
504
+ );
505
+
506
+ // User password verify class (Stored in usermeta for verifying password)
507
+ $this->field_map[] = array(
508
+ 'to_type' => 'users',
509
+ 'to_fieldname' => '_bbp_class',
510
+ 'default' => 'PunBB'
511
+ );
512
+
513
+ // User name.
514
+ $this->field_map[] = array(
515
+ 'from_tablename' => 'users',
516
+ 'from_fieldname' => 'username',
517
+ 'to_type' => 'user',
518
+ 'to_fieldname' => 'user_login'
519
+ );
520
+
521
+ // User nice name.
522
+ $this->field_map[] = array(
523
+ 'from_tablename' => 'users',
524
+ 'from_fieldname' => 'username',
525
+ 'to_type' => 'user',
526
+ 'to_fieldname' => 'user_nicename'
527
+ );
528
+
529
+ // User email.
530
+ $this->field_map[] = array(
531
+ 'from_tablename' => 'users',
532
+ 'from_fieldname' => 'email',
533
+ 'to_type' => 'user',
534
+ 'to_fieldname' => 'user_email'
535
+ );
536
+
537
+ // User homepage.
538
+ $this->field_map[] = array(
539
+ 'from_tablename' => 'users',
540
+ 'from_fieldname' => 'url',
541
+ 'to_type' => 'user',
542
+ 'to_fieldname' => 'user_url'
543
+ );
544
+
545
+ // User registered.
546
+ $this->field_map[] = array(
547
+ 'from_tablename' => 'users',
548
+ 'from_fieldname' => 'registered',
549
+ 'to_type' => 'user',
550
+ 'to_fieldname' => 'user_registered',
551
+ 'callback_method' => 'callback_datetime'
552
+ );
553
+
554
+ // User display name.
555
+ $this->field_map[] = array(
556
+ 'from_tablename' => 'users',
557
+ 'from_fieldname' => 'realname',
558
+ 'to_type' => 'user',
559
+ 'to_fieldname' => 'display_name'
560
+ );
561
+
562
+ // User AIM (Stored in usermeta)
563
+ $this->field_map[] = array(
564
+ 'from_tablename' => 'users',
565
+ 'from_fieldname' => 'aim',
566
+ 'to_type' => 'user',
567
+ 'to_fieldname' => '_bbp_punbb_user_aim'
568
+ );
569
+
570
+ // User Yahoo (Stored in usermeta)
571
+ $this->field_map[] = array(
572
+ 'from_tablename' => 'users',
573
+ 'from_fieldname' => 'yahoo',
574
+ 'to_type' => 'user',
575
+ 'to_fieldname' => '_bbp_punbb_user_yim'
576
+ );
577
+
578
+ // Store Jabber
579
+ $this->field_map[] = array(
580
+ 'from_tablename' => 'users',
581
+ 'from_fieldname' => 'jabber',
582
+ 'to_type' => 'user',
583
+ 'to_fieldname' => '_bbp_punbb_user_jabber'
584
+ );
585
+
586
+ // Store ICQ (Stored in usermeta)
587
+ $this->field_map[] = array(
588
+ 'from_tablename' => 'users',
589
+ 'from_fieldname' => 'icq',
590
+ 'to_type' => 'user',
591
+ 'to_fieldname' => '_bbp_punbb_user_icq'
592
+ );
593
+
594
+ // Store MSN (Stored in usermeta)
595
+ $this->field_map[] = array(
596
+ 'from_tablename' => 'users',
597
+ 'from_fieldname' => 'msn',
598
+ 'to_type' => 'user',
599
+ 'to_fieldname' => '_bbp_punbb_user_msn'
600
+ );
601
+
602
+ // Store Facebook (Stored in usermeta)
603
+ $this->field_map[] = array(
604
+ 'from_tablename' => 'users',
605
+ 'from_fieldname' => 'facebook',
606
+ 'to_type' => 'user',
607
+ 'to_fieldname' => '_bbp_punbb_user_facebook'
608
+ );
609
+
610
+ // Store Twitter (Stored in usermeta)
611
+ $this->field_map[] = array(
612
+ 'from_tablename' => 'users',
613
+ 'from_fieldname' => 'twitter',
614
+ 'to_type' => 'user',
615
+ 'to_fieldname' => '_bbp_punbb_user_twitter'
616
+ );
617
+
618
+ // Store LinkedIn (Stored in usermeta)
619
+ $this->field_map[] = array(
620
+ 'from_tablename' => 'users',
621
+ 'from_fieldname' => 'linkedin',
622
+ 'to_type' => 'user',
623
+ 'to_fieldname' => '_bbp_punbb_user_linkedin'
624
+ );
625
+
626
+ // Store Skype (Stored in usermeta)
627
+ $this->field_map[] = array(
628
+ 'from_tablename' => 'users',
629
+ 'from_fieldname' => 'skype',
630
+ 'to_type' => 'user',
631
+ 'to_fieldname' => '_bbp_punbb_user_skype'
632
+ );
633
+
634
+ // Store Signature (Stored in usermeta)
635
+ $this->field_map[] = array(
636
+ 'from_tablename' => 'users',
637
+ 'from_fieldname' => 'signature',
638
+ 'to_type' => 'user',
639
+ 'to_fieldname' => '_bbp_punbb_user_sig',
640
+ 'callback_method' => 'callback_html'
641
+ );
642
+
643
+ // Store Location (Stored in usermeta)
644
+ $this->field_map[] = array(
645
+ 'from_tablename' => 'users',
646
+ 'from_fieldname' => 'location',
647
+ 'to_type' => 'user',
648
+ 'to_fieldname' => '_bbp_punbb_user_from'
649
+ );
650
+
651
+ // Store Admin Note (Stored in usermeta)
652
+ $this->field_map[] = array(
653
+ 'from_tablename' => 'users',
654
+ 'from_fieldname' => 'admin_note',
655
+ 'to_type' => 'user',
656
+ 'to_fieldname' => '_bbp_punbb_user_admin_note'
657
+ );
658
+ }
659
+
660
+ /**
661
+ * This method allows us to indicates what is or is not converted for each
662
+ * converter.
663
+ */
664
+ public function info() {
665
+ return '';
666
+ }
667
+
668
+ /**
669
+ * This method is to save the salt and password together. That
670
+ * way when we authenticate it we can get it out of the database
671
+ * as one value. Array values are auto sanitized by WordPress.
672
+ */
673
+ public function callback_savepass( $field, $row ) {
674
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
675
+ return $pass_array;
676
+ }
677
+
678
+ /**
679
+ * This method is to take the pass out of the database and compare
680
+ * to a pass the user has typed in.
681
+ */
682
+ public function authenticate_pass( $password, $serialized_pass ) {
683
+ $pass_array = unserialize( $serialized_pass );
684
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
685
+ }
686
+
687
+ /**
688
+ * Translate the post status from PunBB v1.4.2 numerics to WordPress's strings.
689
+ *
690
+ * @param int $status PunBB v1.4.2 numeric topic status
691
+ * @return string WordPress safe
692
+ */
693
+ public function callback_topic_status( $status = 0 ) {
694
+ switch ( $status ) {
695
+ case 1 :
696
+ $status = 'closed';
697
+ break;
698
+
699
+ case 0 :
700
+ default :
701
+ $status = 'publish';
702
+ break;
703
+ }
704
+ return $status;
705
+ }
706
+
707
+ /**
708
+ * Translate the topic sticky status type from PunBB v1.4.2 numerics to WordPress's strings.
709
+ *
710
+ * @param int $status PunBB v1.4.2 numeric forum type
711
+ * @return string WordPress safe
712
+ */
713
+ public function callback_sticky_status( $status = 0 ) {
714
+ switch ( $status ) {
715
+ case 1 :
716
+ $status = 'sticky'; // PunBB Sticky 'topic_sticky = 1'
717
+ break;
718
+
719
+ case 0 :
720
+ default :
721
+ $status = 'normal'; // PunBB Normal Topic 'topic_sticky = 0'
722
+ break;
723
+ }
724
+ return $status;
725
+ }
726
+
727
+ /**
728
+ * Verify the topic/reply count.
729
+ *
730
+ * @param int $count PunBB v1.4.2 topic/reply counts
731
+ * @return string WordPress safe
732
+ */
733
+ public function callback_topic_reply_count( $count = 1 ) {
734
+ $count = absint( (int) $count - 1 );
735
+ return $count;
736
+ }
737
+ }
includes/admin/converters/SMF.php CHANGED
@@ -1,743 +1,812 @@
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 '<br>'
723
- $SMF_markup = preg_replace( '/\<br \/\>/', '<br>', $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
- // Replace non-break space '&nbsp;' with space ' '
731
- $SMF_markup = preg_replace ( '/&nbsp;/', ' ', $SMF_markup );
732
-
733
- // Now that SMF custom HTML has been stripped put the cleaned HTML back in $field
734
- $field = $SMF_markup;
735
-
736
- // Parse out any bbCodes in $field with the BBCode 'parser.php'
737
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
738
- $bbcode = BBCode::getInstance();
739
- $bbcode->enable_smileys = false;
740
- $bbcode->smiley_regex = false;
741
- return html_entity_decode( $bbcode->Parse( $field ) );
742
- }
743
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ /**
28
+ * Sets up the field mappings
29
+ */
30
+ public function setup_globals() {
31
+
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
+ /** Forum Section ******************************************************/
39
+
40
+ // Old forum id (Stored in postmeta)
41
+ $this->field_map[] = array(
42
+ 'from_tablename' => 'boards',
43
+ 'from_fieldname' => 'id_board',
44
+ 'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
+ );
47
+
48
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
49
+ $this->field_map[] = array(
50
+ 'from_tablename' => 'boards',
51
+ 'from_fieldname' => 'id_parent',
52
+ 'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
+ );
55
+
56
+ // Forum topic count (Stored in postmeta)
57
+ $this->field_map[] = array(
58
+ 'from_tablename' => 'boards',
59
+ 'from_fieldname' => 'num_topics',
60
+ 'to_type' => 'forum',
61
+ 'to_fieldname' => '_bbp_topic_count'
62
+ );
63
+
64
+ // Forum reply count (Stored in postmeta)
65
+ $this->field_map[] = array(
66
+ 'from_tablename' => 'boards',
67
+ 'from_fieldname' => 'num_posts',
68
+ 'to_type' => 'forum',
69
+ 'to_fieldname' => '_bbp_reply_count'
70
+ );
71
+
72
+ // Forum total topic count (Stored in postmeta)
73
+ $this->field_map[] = array(
74
+ 'from_tablename' => 'boards',
75
+ 'from_fieldname' => 'num_topics',
76
+ 'to_type' => 'forum',
77
+ 'to_fieldname' => '_bbp_total_topic_count'
78
+ );
79
+
80
+ // Forum total reply count (Stored in postmeta)
81
+ $this->field_map[] = array(
82
+ 'from_tablename' => 'boards',
83
+ 'from_fieldname' => 'num_posts',
84
+ 'to_type' => 'forum',
85
+ 'to_fieldname' => '_bbp_total_reply_count'
86
+ );
87
+
88
+ // Forum title.
89
+ $this->field_map[] = array(
90
+ 'from_tablename' => 'boards',
91
+ 'from_fieldname' => 'name',
92
+ 'to_type' => 'forum',
93
+ 'to_fieldname' => 'post_title'
94
+ );
95
+
96
+ // Forum slug (Clean name to avoid conflicts)
97
+ $this->field_map[] = array(
98
+ 'from_tablename' => 'boards',
99
+ 'from_fieldname' => 'name',
100
+ 'to_type' => 'forum',
101
+ 'to_fieldname' => 'post_name',
102
+ 'callback_method' => 'callback_slug'
103
+ );
104
+
105
+ // Forum description.
106
+ $this->field_map[] = array(
107
+ 'from_tablename' => 'boards',
108
+ 'from_fieldname' => 'description',
109
+ 'to_type' => 'forum',
110
+ 'to_fieldname' => 'post_content',
111
+ 'callback_method' => 'callback_null'
112
+ );
113
+
114
+ // Forum display order (Starts from 1)
115
+ $this->field_map[] = array(
116
+ 'from_tablename' => 'boards',
117
+ 'from_fieldname' => 'board_order',
118
+ 'to_type' => 'forum',
119
+ 'to_fieldname' => 'menu_order'
120
+ );
121
+
122
+ // Forum type (Set a default value 'forum', Stored in postmeta)
123
+ $this->field_map[] = array(
124
+ 'to_type' => 'forum',
125
+ 'to_fieldname' => '_bbp_forum_type',
126
+ 'default' => 'forum'
127
+ );
128
+
129
+ // Forum status (Set a default value 'open', Stored in postmeta)
130
+ $this->field_map[] = array(
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => '_bbp_status',
133
+ 'default' => 'open'
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
+ /** Forum Subscriptions Section ***************************************/
159
+
160
+ // Subscribed forum ID (Stored in usermeta)
161
+ $this->field_map[] = array(
162
+ 'from_tablename' => 'log_notify',
163
+ 'from_fieldname' => 'id_board',
164
+ 'from_expression' => 'WHERE log_notify.id_board != 0',
165
+ 'to_type' => 'forum_subscriptions',
166
+ 'to_fieldname' => '_bbp_forum_subscriptions'
167
+ );
168
+
169
+ // Subscribed user ID (Stored in usermeta)
170
+ $this->field_map[] = array(
171
+ 'from_tablename' => 'log_notify',
172
+ 'from_fieldname' => 'id_member',
173
+ 'from_expression' => 'WHERE log_notify.id_board != 0',
174
+ 'to_type' => 'forum_subscriptions',
175
+ 'to_fieldname' => 'user_id',
176
+ 'callback_method' => 'callback_userid'
177
+ );
178
+
179
+ /** Topic Section ******************************************************/
180
+
181
+ // Old topic id (Stored in postmeta)
182
+ $this->field_map[] = array(
183
+ 'from_tablename' => 'topics',
184
+ 'from_fieldname' => 'id_topic',
185
+ 'to_type' => 'topic',
186
+ 'to_fieldname' => '_bbp_old_topic_id'
187
+ );
188
+
189
+ // Topic reply count (Stored in postmeta)
190
+ $this->field_map[] = array(
191
+ 'from_tablename' => 'topics',
192
+ 'from_fieldname' => 'num_replies',
193
+ 'to_type' => 'topic',
194
+ 'to_fieldname' => '_bbp_reply_count',
195
+ 'callback_method' => 'callback_topic_reply_count'
196
+ );
197
+
198
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
199
+ $this->field_map[] = array(
200
+ 'from_tablename' => 'topics',
201
+ 'from_fieldname' => 'num_replies',
202
+ 'to_type' => 'topic',
203
+ 'to_fieldname' => '_bbp_total_reply_count',
204
+ 'callback_method' => 'callback_topic_reply_count'
205
+ );
206
+
207
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
208
+ $this->field_map[] = array(
209
+ 'from_tablename' => 'topics',
210
+ 'from_fieldname' => 'id_board',
211
+ 'to_type' => 'topic',
212
+ 'to_fieldname' => '_bbp_forum_id',
213
+ 'callback_method' => 'callback_forumid'
214
+ );
215
+
216
+ // Topic author.
217
+ $this->field_map[] = array(
218
+ 'from_tablename' => 'topics',
219
+ 'from_fieldname' => 'id_member_started',
220
+ 'to_type' => 'topic',
221
+ 'to_fieldname' => 'post_author',
222
+ 'callback_method' => 'callback_userid'
223
+ );
224
+
225
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'messages',
228
+ 'from_fieldname' => 'poster_name',
229
+ 'join_tablename' => 'topics',
230
+ 'join_type' => 'LEFT',
231
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
232
+ 'to_type' => 'topic',
233
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
234
+ );
235
+
236
+ // Is the topic anonymous (Stored in postmeta)
237
+ $this->field_map[] = array(
238
+ 'from_tablename' => 'topics',
239
+ 'from_fieldname' => 'id_member_started',
240
+ 'to_type' => 'topic',
241
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
242
+ 'callback_method' => 'callback_check_anonymous'
243
+ );
244
+
245
+ // Topic Author ip (Stored in postmeta)
246
+ $this->field_map[] = array(
247
+ 'from_tablename' => 'messages',
248
+ 'from_fieldname' => 'poster_ip',
249
+ 'join_tablename' => 'topics',
250
+ 'join_type' => 'LEFT',
251
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
252
+ 'to_type' => 'topic',
253
+ 'to_fieldname' => '_bbp_author_ip'
254
+ );
255
+
256
+ // Topic content.
257
+ // Note: We join the 'messages' table because 'topics' table does not have content.
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'messages',
260
+ 'from_fieldname' => 'body',
261
+ 'join_tablename' => 'topics',
262
+ 'join_type' => 'LEFT',
263
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
264
+ 'to_type' => 'topic',
265
+ 'to_fieldname' => 'post_content',
266
+ 'callback_method' => 'callback_html'
267
+ );
268
+
269
+ // Topic title.
270
+ $this->field_map[] = array(
271
+ 'from_tablename' => 'messages',
272
+ 'from_fieldname' => 'subject',
273
+ 'join_tablename' => 'topics',
274
+ 'join_type' => 'LEFT',
275
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
276
+ 'to_type' => 'topic',
277
+ 'to_fieldname' => 'post_title'
278
+ );
279
+
280
+ // Topic slug (Clean name to avoid conflicts)
281
+ $this->field_map[] = array(
282
+ 'from_tablename' => 'messages',
283
+ 'from_fieldname' => 'subject',
284
+ 'join_tablename' => 'topics',
285
+ 'join_type' => 'LEFT',
286
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
287
+ 'to_type' => 'topic',
288
+ 'to_fieldname' => 'post_name',
289
+ 'callback_method' => 'callback_slug'
290
+ );
291
+
292
+ // Topic parent forum id (If no parent, then 0)
293
+ $this->field_map[] = array(
294
+ 'from_tablename' => 'topics',
295
+ 'from_fieldname' => 'id_board',
296
+ 'to_type' => 'topic',
297
+ 'to_fieldname' => 'post_parent',
298
+ 'callback_method' => 'callback_forumid'
299
+ );
300
+
301
+ // Topic status (Open or Closed, SMF v2.0.4 0=open & 1=closed)
302
+ $this->field_map[] = array(
303
+ 'from_tablename' => 'topics',
304
+ 'from_fieldname' => 'locked',
305
+ 'to_type' => 'topic',
306
+ 'to_fieldname' => '_bbp_old_closed_status_id',
307
+ 'callback_method' => 'callback_topic_status'
308
+ );
309
+
310
+ // Sticky status (Stored in postmeta)
311
+ $this->field_map[] = array(
312
+ 'from_tablename' => 'topics',
313
+ 'from_fieldname' => 'is_sticky',
314
+ 'to_type' => 'topic',
315
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
316
+ 'callback_method' => 'callback_sticky_status'
317
+ );
318
+
319
+ // Topic dates.
320
+ $this->field_map[] = array(
321
+ 'from_tablename' => 'messages',
322
+ 'from_fieldname' => 'poster_time',
323
+ 'join_tablename' => 'topics',
324
+ 'join_type' => 'LEFT',
325
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
326
+ 'to_type' => 'topic',
327
+ 'to_fieldname' => 'post_date',
328
+ 'callback_method' => 'callback_datetime'
329
+ );
330
+ $this->field_map[] = array(
331
+ 'from_tablename' => 'messages',
332
+ 'from_fieldname' => 'poster_time',
333
+ 'join_tablename' => 'topics',
334
+ 'join_type' => 'LEFT',
335
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
336
+ 'to_type' => 'topic',
337
+ 'to_fieldname' => 'post_date_gmt',
338
+ 'callback_method' => 'callback_datetime'
339
+ );
340
+ $this->field_map[] = array(
341
+ 'from_tablename' => 'messages',
342
+ 'from_fieldname' => 'poster_time',
343
+ 'join_tablename' => 'topics',
344
+ 'join_type' => 'LEFT',
345
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
346
+ 'to_type' => 'topic',
347
+ 'to_fieldname' => 'post_modified',
348
+ 'callback_method' => 'callback_datetime'
349
+ );
350
+ $this->field_map[] = array(
351
+ 'from_tablename' => 'messages',
352
+ 'from_fieldname' => 'poster_time',
353
+ 'join_tablename' => 'topics',
354
+ 'join_type' => 'LEFT',
355
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
356
+ 'to_type' => 'topic',
357
+ 'to_fieldname' => 'post_modified_gmt',
358
+ 'callback_method' => 'callback_datetime'
359
+ );
360
+ $this->field_map[] = array(
361
+ 'from_tablename' => 'messages',
362
+ 'from_fieldname' => 'poster_time',
363
+ 'join_tablename' => 'topics',
364
+ 'join_type' => 'LEFT',
365
+ 'join_expression' => 'ON topics.id_first_msg = messages.id_msg',
366
+ 'to_type' => 'topic',
367
+ 'to_fieldname' => '_bbp_last_active_time',
368
+ 'callback_method' => 'callback_datetime'
369
+ );
370
+
371
+ /** Tags Section ******************************************************/
372
+
373
+ /**
374
+ * SMF v2.0.4 Forums do not support topic tags out of the box
375
+ */
376
+
377
+ /** Topic Subscriptions Section ***************************************/
378
+
379
+ // Subscribed topic ID (Stored in usermeta)
380
+ $this->field_map[] = array(
381
+ 'from_tablename' => 'log_notify',
382
+ 'from_fieldname' => 'id_topic',
383
+ 'from_expression' => 'WHERE log_notify.id_topic != 0',
384
+ 'to_type' => 'topic_subscriptions',
385
+ 'to_fieldname' => '_bbp_subscriptions'
386
+ );
387
+
388
+ // Subscribed user ID (Stored in usermeta)
389
+ $this->field_map[] = array(
390
+ 'from_tablename' => 'log_notify',
391
+ 'from_fieldname' => 'id_member',
392
+ 'from_expression' => 'WHERE log_notify.id_topic != 0',
393
+ 'to_type' => 'topic_subscriptions',
394
+ 'to_fieldname' => 'user_id',
395
+ 'callback_method' => 'callback_userid'
396
+ );
397
+
398
+ /** Reply Section *****************************************************/
399
+
400
+ // Old reply id (Stored in postmeta)
401
+ $this->field_map[] = array(
402
+ 'from_tablename' => 'messages',
403
+ 'from_fieldname' => 'id_msg',
404
+ 'to_type' => 'reply',
405
+ 'to_fieldname' => '_bbp_old_reply_id'
406
+ );
407
+
408
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
409
+ $this->field_map[] = array(
410
+ 'from_tablename' => 'topics',
411
+ 'from_fieldname' => 'id_board',
412
+ 'join_tablename' => 'messages',
413
+ 'join_type' => 'LEFT',
414
+ 'join_expression' => 'USING (id_topic) WHERE topics.id_first_msg != messages.id_msg',
415
+ 'to_type' => 'reply',
416
+ 'to_fieldname' => '_bbp_forum_id',
417
+ 'callback_method' => 'callback_topicid_to_forumid'
418
+ );
419
+
420
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
421
+ $this->field_map[] = array(
422
+ 'from_tablename' => 'messages',
423
+ 'from_fieldname' => 'id_topic',
424
+ 'to_type' => 'reply',
425
+ 'to_fieldname' => '_bbp_topic_id',
426
+ 'callback_method' => 'callback_topicid'
427
+ );
428
+
429
+ // Reply author ip (Stored in postmeta)
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'messages',
432
+ 'from_fieldname' => 'poster_ip',
433
+ 'to_type' => 'reply',
434
+ 'to_fieldname' => '_bbp_author_ip'
435
+ );
436
+
437
+ // Reply author.
438
+ $this->field_map[] = array(
439
+ 'from_tablename' => 'messages',
440
+ 'from_fieldname' => 'id_member',
441
+ 'to_type' => 'reply',
442
+ 'to_fieldname' => 'post_author',
443
+ 'callback_method' => 'callback_userid'
444
+ );
445
+
446
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
447
+ $this->field_map[] = array(
448
+ 'from_tablename' => 'messages',
449
+ 'from_fieldname' => 'poster_name',
450
+ 'to_type' => 'reply',
451
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
452
+ );
453
+
454
+ // Is the reply anonymous (Stored in postmeta)
455
+ $this->field_map[] = array(
456
+ 'from_tablename' => 'messages',
457
+ 'from_fieldname' => 'id_member',
458
+ 'to_type' => 'reply',
459
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
460
+ 'callback_method' => 'callback_check_anonymous'
461
+ );
462
+
463
+ // Reply content.
464
+ $this->field_map[] = array(
465
+ 'from_tablename' => 'messages',
466
+ 'from_fieldname' => 'body',
467
+ 'to_type' => 'reply',
468
+ 'to_fieldname' => 'post_content',
469
+ 'callback_method' => 'callback_html'
470
+ );
471
+
472
+ // Reply parent topic id (If no parent, then 0)
473
+ $this->field_map[] = array(
474
+ 'from_tablename' => 'messages',
475
+ 'from_fieldname' => 'id_topic',
476
+ 'to_type' => 'reply',
477
+ 'to_fieldname' => 'post_parent',
478
+ 'callback_method' => 'callback_topicid'
479
+ );
480
+
481
+ // Reply dates.
482
+ $this->field_map[] = array(
483
+ 'from_tablename' => 'messages',
484
+ 'from_fieldname' => 'poster_time',
485
+ 'to_type' => 'reply',
486
+ 'to_fieldname' => 'post_date',
487
+ 'callback_method' => 'callback_datetime'
488
+ );
489
+ $this->field_map[] = array(
490
+ 'from_tablename' => 'messages',
491
+ 'from_fieldname' => 'poster_time',
492
+ 'to_type' => 'reply',
493
+ 'to_fieldname' => 'post_date_gmt',
494
+ 'callback_method' => 'callback_datetime'
495
+ );
496
+ $this->field_map[] = array(
497
+ 'from_tablename' => 'messages',
498
+ 'from_fieldname' => 'poster_time',
499
+ 'to_type' => 'reply',
500
+ 'to_fieldname' => 'post_modified',
501
+ 'callback_method' => 'callback_datetime'
502
+ );
503
+ $this->field_map[] = array(
504
+ 'from_tablename' => 'messages',
505
+ 'from_fieldname' => 'poster_time',
506
+ 'to_type' => 'reply',
507
+ 'to_fieldname' => 'post_modified_gmt',
508
+ 'callback_method' => 'callback_datetime'
509
+ );
510
+
511
+ /** User Section ******************************************************/
512
+
513
+ // Store old user id (Stored in usermeta)
514
+ $this->field_map[] = array(
515
+ 'from_tablename' => 'members',
516
+ 'from_fieldname' => 'id_member',
517
+ 'to_type' => 'user',
518
+ 'to_fieldname' => '_bbp_old_user_id'
519
+ );
520
+
521
+ // Store old user password (Stored in usermeta serialized with salt)
522
+ $this->field_map[] = array(
523
+ 'from_tablename' => 'members',
524
+ 'from_fieldname' => 'passwd',
525
+ 'to_type' => 'user',
526
+ 'to_fieldname' => '_bbp_password',
527
+ 'callback_method' => 'callback_savepass'
528
+ );
529
+
530
+ // User password verify class (Stored in usermeta for verifying password)
531
+ $this->field_map[] = array(
532
+ 'to_type' => 'user',
533
+ 'to_fieldname' => '_bbp_class',
534
+ 'default' => 'SMF'
535
+ );
536
+
537
+ // User name.
538
+ $this->field_map[] = array(
539
+ 'from_tablename' => 'members',
540
+ 'from_fieldname' => 'member_name',
541
+ 'to_type' => 'user',
542
+ 'to_fieldname' => 'user_login'
543
+ );
544
+
545
+ // User nice name.
546
+ $this->field_map[] = array(
547
+ 'from_tablename' => 'members',
548
+ 'from_fieldname' => 'member_name',
549
+ 'to_type' => 'user',
550
+ 'to_fieldname' => 'user_nicename'
551
+ );
552
+
553
+ // User email.
554
+ $this->field_map[] = array(
555
+ 'from_tablename' => 'members',
556
+ 'from_fieldname' => 'email_address',
557
+ 'to_type' => 'user',
558
+ 'to_fieldname' => 'user_email'
559
+ );
560
+
561
+ // User homepage.
562
+ $this->field_map[] = array(
563
+ 'from_tablename' => 'members',
564
+ 'from_fieldname' => 'website_url',
565
+ 'to_type' => 'user',
566
+ 'to_fieldname' => 'user_url'
567
+ );
568
+
569
+ // User registered.
570
+ $this->field_map[] = array(
571
+ 'from_tablename' => 'members',
572
+ 'from_fieldname' => 'date_registered',
573
+ 'to_type' => 'user',
574
+ 'to_fieldname' => 'user_registered',
575
+ 'callback_method' => 'callback_datetime'
576
+ );
577
+
578
+ // User display name.
579
+ $this->field_map[] = array(
580
+ 'from_tablename' => 'members',
581
+ 'from_fieldname' => 'real_name',
582
+ 'to_type' => 'user',
583
+ 'to_fieldname' => 'display_name'
584
+ );
585
+
586
+ // User AIM (Stored in usermeta)
587
+ $this->field_map[] = array(
588
+ 'from_tablename' => 'members',
589
+ 'from_fieldname' => 'aim',
590
+ 'to_type' => 'user',
591
+ 'to_fieldname' => '_bbp_smf_user_aim'
592
+ );
593
+
594
+ // User Yahoo (Stored in usermeta)
595
+ $this->field_map[] = array(
596
+ 'from_tablename' => 'members',
597
+ 'from_fieldname' => 'yim',
598
+ 'to_type' => 'user',
599
+ 'to_fieldname' => '_bbp_smf_user_yim'
600
+ );
601
+
602
+ // Store ICQ (Stored in usermeta)
603
+ $this->field_map[] = array(
604
+ 'from_tablename' => 'members',
605
+ 'from_fieldname' => 'icq',
606
+ 'to_type' => 'user',
607
+ 'to_fieldname' => '_bbp_smf_user_icq'
608
+ );
609
+
610
+ // Store MSN (Stored in usermeta)
611
+ $this->field_map[] = array(
612
+ 'from_tablename' => 'members',
613
+ 'from_fieldname' => 'msn',
614
+ 'to_type' => 'user',
615
+ 'to_fieldname' => '_bbp_smf_user_msn'
616
+ );
617
+
618
+ // Store Signature (Stored in usermeta)
619
+ $this->field_map[] = array(
620
+ 'from_tablename' => 'members',
621
+ 'from_fieldname' => 'signature',
622
+ 'to_type' => 'user',
623
+ 'to_fieldname' => '_bbp_smf_user_sig',
624
+ 'callback_method' => 'callback_html'
625
+ );
626
+
627
+ // Store Avatar (Stored in usermeta)
628
+ $this->field_map[] = array(
629
+ 'from_tablename' => 'members',
630
+ 'from_fieldname' => 'avatar',
631
+ 'to_type' => 'user',
632
+ 'to_fieldname' => '_bbp_smf_user_avatar',
633
+ 'callback_method' => 'callback_html'
634
+ );
635
+
636
+ // Store Location (Stored in usermeta)
637
+ $this->field_map[] = array(
638
+ 'from_tablename' => 'members',
639
+ 'from_fieldname' => 'location',
640
+ 'to_type' => 'user',
641
+ 'to_fieldname' => '_bbp_smf_user_location',
642
+ 'callback_method' => 'callback_html'
643
+ );
644
+
645
+ // Store Personal Text (Stored in usermeta)
646
+ $this->field_map[] = array(
647
+ 'from_tablename' => 'members',
648
+ 'from_fieldname' => 'personal_text',
649
+ 'to_type' => 'user',
650
+ 'to_fieldname' => '_bbp_smf_user_personal_text',
651
+ 'callback_method' => 'callback_html'
652
+ );
653
+ }
654
+
655
+ /**
656
+ * This method allows us to indicates what is or is not converted for each
657
+ * converter.
658
+ */
659
+ public function info() {
660
+ return '';
661
+ }
662
+
663
+ /**
664
+ * This method is to save the salt and password together. That
665
+ * way when we authenticate it we can get it out of the database
666
+ * as one value. Array values are auto sanitized by WordPress.
667
+ */
668
+ public function callback_savepass( $field, $row ) {
669
+ $pass_array = array( 'hash' => $field, 'username' => $row['member_name'] );
670
+ return $pass_array;
671
+ }
672
+
673
+ /**
674
+ * This method is to take the pass out of the database and compare
675
+ * to a pass the user has typed in.
676
+ */
677
+ public function authenticate_pass( $password, $serialized_pass ) {
678
+ $pass_array = unserialize( $serialized_pass );
679
+ return ( $pass_array['hash'] === sha1( strtolower( $pass_array['username'] ) . $password ) ? true : false );
680
+ }
681
+
682
+ /**
683
+ * Translate the post status from SMF v2.0.4 numerics to WordPress's strings.
684
+ *
685
+ * @param int $status SMF v2.0.4 numeric topic status
686
+ * @return string WordPress safe
687
+ */
688
+ public function callback_topic_status( $status = 0 ) {
689
+ switch ( $status ) {
690
+ case 1 :
691
+ $status = 'closed';
692
+ break;
693
+
694
+ case 0 :
695
+ default :
696
+ $status = 'publish';
697
+ break;
698
+ }
699
+ return $status;
700
+ }
701
+
702
+ /**
703
+ * Translate the topic sticky status type from SMF v2.0.4 numerics to WordPress's strings.
704
+ *
705
+ * @param int $status SMF v2.0.4 numeric forum type
706
+ * @return string WordPress safe
707
+ */
708
+ public function callback_sticky_status( $status = 0 ) {
709
+ switch ( $status ) {
710
+ case 1 :
711
+ $status = 'sticky'; // SMF Sticky 'is_sticky = 1'
712
+ break;
713
+
714
+ case 0 :
715
+ default :
716
+ $status = 'normal'; // SMF normal topic 'is_sticky = 0'
717
+ break;
718
+ }
719
+ return $status;
720
+ }
721
+
722
+ /**
723
+ * Verify the topic/reply count.
724
+ *
725
+ * @param int $count SMF v2.0.4 topic/reply counts
726
+ * @return string WordPress safe
727
+ */
728
+ public function callback_topic_reply_count( $count = 1 ) {
729
+ $count = absint( (int) $count - 1 );
730
+ return $count;
731
+ }
732
+
733
+ /**
734
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
735
+ */
736
+ protected function callback_html( $field ) {
737
+
738
+ // Strips SMF custom HTML first from $field before parsing $field to parser.php
739
+ $SMF_markup = $field;
740
+ $SMF_markup = html_entity_decode( $SMF_markup );
741
+
742
+ // Replace '[quote]' with '<blockquote>'
743
+ $SMF_markup = preg_replace( '/\[quote\]/', '<blockquote>', $SMF_markup );
744
+ // Replace '[quote ($1)]' with '<blockquote>"
745
+ $SMF_markup = preg_replace( '/\[quote (.*?)\]/' , '<blockquote>', $SMF_markup );
746
+ // Replace '[/quote]' with '</blockquote>'
747
+ $SMF_markup = preg_replace( '/\[\/quote\]/', '</blockquote>', $SMF_markup );
748
+
749
+ // Replace '[glow]' with ''
750
+ $SMF_markup = preg_replace( '/\[glow\]/', '', $SMF_markup );
751
+ // Replace '[glow]' with ''
752
+ $SMF_markup = preg_replace( '/\[glow=(.*?)\]/', '', $SMF_markup );
753
+ // Replace '[/glow]' with ''
754
+ $SMF_markup = preg_replace( '/\[\/glow\]/', '', $SMF_markup );
755
+
756
+ // Replace '[shadow]' with ''
757
+ $SMF_markup = preg_replace( '/\[shadow\]/', '', $SMF_markup );
758
+ // Replace '[shadow]' with ''
759
+ $SMF_markup = preg_replace( '/\[shadow=(.*?)\]/', '', $SMF_markup );
760
+ // Replace '[/shadow]' with ''
761
+ $SMF_markup = preg_replace( '/\[\/shadow\]/', '', $SMF_markup );
762
+
763
+ // Replace '[move]' with ''
764
+ $SMF_markup = preg_replace( '/\[move\]/', '', $SMF_markup );
765
+ // Replace '[/move]' with ''
766
+ $SMF_markup = preg_replace( '/\[\/move\]/', '', $SMF_markup );
767
+
768
+ // Replace '[table]' with '<table>'
769
+ $SMF_markup = preg_replace( '/\[table\]/', '<table>', $SMF_markup );
770
+ // Replace '[/table]' with '</table>'
771
+ $SMF_markup = preg_replace( '/\[\/table\]/', '</table>', $SMF_markup );
772
+ // Replace '[tr]' with '<tr>'
773
+ $SMF_markup = preg_replace( '/\[tr\]/', '<tr>', $SMF_markup );
774
+ // Replace '[/tr]' with '</tr>'
775
+ $SMF_markup = preg_replace( '/\[\/tr\]/', '</tr>', $SMF_markup );
776
+ // Replace '[td]' with '<td>'
777
+ $SMF_markup = preg_replace( '/\[td\]/', '<td>', $SMF_markup );
778
+ // Replace '[/td]' with '</td>'
779
+ $SMF_markup = preg_replace( '/\[\/td\]/', '</td>', $SMF_markup );
780
+
781
+ // Replace '[list]' with '<ul>'
782
+ $SMF_markup = preg_replace( '/\[list\]/', '<ul>', $SMF_markup );
783
+ // Replace '[liist type=decimal]' with '<ol type="a">'
784
+ $SMF_markup = preg_replace( '/\[list\ type=decimal\]/', '<ol type="a">', $SMF_markup );
785
+ // Replace '[li]' with '<li>'
786
+ $SMF_markup = preg_replace( '/\[li\]/', '<li>', $SMF_markup );
787
+ // Replace '[/li]' with '</li>'
788
+ $SMF_markup = preg_replace( '/\[\/li\]/', '</li>', $SMF_markup );
789
+
790
+ // Replace '[tt]' with '<tt>'
791
+ $SMF_markup = preg_replace( '/\[tt\]/', '<tt>', $SMF_markup );
792
+ // Replace '[/tt]' with '</tt>'
793
+ $SMF_markup = preg_replace( '/\[\/tt\]/', '</tt>', $SMF_markup );
794
+
795
+ // Replace '<br />' with '<br>'
796
+ $SMF_markup = preg_replace( '/\<br \/\>/', '<br>', $SMF_markup );
797
+
798
+ // Replace '[size=$1]' with '<span style="font-size:$1%;">$3</span>'
799
+ $SMF_markup = preg_replace( '/\[size=(.*?)\]/', '<span style="font-size:$1">', $SMF_markup );
800
+ // Replace '[/size]' with '</span>'
801
+ $SMF_markup = preg_replace( '/\[\/size\]/', '</span>', $SMF_markup );
802
+
803
+ // Replace non-break space '&nbsp;' with space ' '
804
+ $SMF_markup = preg_replace( '/&nbsp;/', ' ', $SMF_markup );
805
+
806
+ // Now that SMF custom HTML has been stripped put the cleaned HTML back in $field
807
+ $field = $SMF_markup;
808
+
809
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
810
+ return parent::callback_html( $field );
811
+ }
812
+ }
includes/admin/converters/SimplePress5.php CHANGED
@@ -1,21 +1,27 @@
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
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses SimplePress5::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,14 +29,20 @@ class SimplePress5 extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
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 +50,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 +119,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 +157,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 +192,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 +267,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 +320,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 +364,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 +427,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',
@@ -477,7 +526,7 @@ class SimplePress5 extends BBP_Converter_Base {
477
  }
478
 
479
  /**
480
- * Translate the post status from Simple:Press v5.x numeric's to WordPress's strings.
481
  *
482
  * @param int $status Simple:Press numeric status
483
  * @return string WordPress safe
@@ -497,7 +546,7 @@ class SimplePress5 extends BBP_Converter_Base {
497
  }
498
 
499
  /**
500
- * Translate the topic sticky status type from Simple:Press v5.x numeric's to WordPress's strings.
501
  *
502
  * @param int $status Simple:Press v5.x numeric forum type
503
  * @return string WordPress safe
@@ -527,17 +576,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
  */
@@ -564,19 +602,15 @@ class SimplePress5 extends BBP_Converter_Base {
564
  $simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/' , '<code>$1</code>' , $simplepress_markup );
565
 
566
  // Replace '<strong>username said </strong>' with '@username said:'
567
- $simplepress_markup = preg_replace ( '/\<strong\>(.*?)\ said\ \<\/strong\>/', '@$1 said:', $simplepress_markup );
568
 
569
  // Replace '<p>&nbsp;</p>' with '<p>&nbsp;</p>'
570
- $simplepress_markup = preg_replace ( '/\n(&nbsp;|[\s\p{Z}\xA0\x{00A0}]+)\r/', '<br>', $simplepress_markup );
571
 
572
  // Now that SimplePress' custom HTML codes have been stripped put the cleaned HTML back in $field
573
  $field = $simplepress_markup;
574
 
575
- // Parse out any bbCodes with the BBCode 'parser.php'
576
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
577
- $bbcode = BBCode::getInstance();
578
- $bbcode->enable_smileys = false;
579
- $bbcode->smiley_regex = false;
580
- return html_entity_decode( $bbcode->Parse( $field ) );
581
  }
582
  }
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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  public function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'sfforums',
43
  'from_fieldname' => 'forum_id',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0, Stored in postmeta)
50
  'from_tablename' => 'sfforums',
51
  'from_fieldname' => 'parent',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum topic count (Stored in postmeta)
119
  'to_fieldname' => 'menu_order'
120
  );
121
 
122
+ // Forum type (Set a default value 'forum', Stored in postmeta)
123
+ $this->field_map[] = array(
124
+ 'to_type' => 'forum',
125
+ 'to_fieldname' => '_bbp_forum_type',
126
+ 'default' => 'forum'
127
+ );
128
+
129
+ // Forum status (Set a default value 'open', Stored in postmeta)
130
+ $this->field_map[] = array(
131
+ 'to_type' => 'forum',
132
+ 'to_fieldname' => '_bbp_status',
133
+ 'default' => 'open'
134
+ );
135
+
136
  // Forum dates.
137
  $this->field_map[] = array(
138
  'to_type' => 'forums',
157
 
158
  /** Topic Section *****************************************************/
159
 
160
+ // Old topic id (Stored in postmeta)
161
  $this->field_map[] = array(
162
  'from_tablename' => 'sftopics',
163
  'from_fieldname' => 'topic_id',
164
  'to_type' => 'topic',
165
+ 'to_fieldname' => '_bbp_old_topic_id'
166
  );
167
 
168
  // Topic reply count (Stored in postmeta)
192
  'callback_method' => 'callback_userid'
193
  );
194
 
195
+ // Topic author ip (Stored in postmeta)
196
+ $this->field_map[] = array(
197
+ 'from_tablename' => 'sfposts',
198
+ 'from_fieldname' => 'poster_ip',
199
+ 'join_tablename' => 'sftopics',
200
+ 'join_type' => 'INNER',
201
+ 'join_expression' => 'USING (topic_id) WHERE sfposts.post_index = 1',
202
+ 'to_type' => 'topic',
203
+ 'to_fieldname' => '_bbp_author_ip'
204
+ );
205
+
206
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
207
+ $this->field_map[] = array(
208
+ 'from_tablename' => 'sfposts',
209
+ 'from_fieldname' => 'guest_name',
210
+ 'join_tablename' => 'sftopics',
211
+ 'join_type' => 'INNER',
212
+ 'join_expression' => 'USING (topic_id) WHERE sfposts.post_index = 1',
213
+ 'to_type' => 'topic',
214
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
215
+ );
216
+
217
+ // Is the topic anonymous (Stored in postmeta)
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'sftopics',
220
+ 'from_fieldname' => 'user_id',
221
+ 'to_type' => 'topic',
222
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
223
+ 'callback_method' => 'callback_check_anonymous'
224
+ );
225
+
226
  // Topic content.
227
  // Note: We join the sfposts table because sftopics do not have content.
228
  $this->field_map[] = array(
267
  'from_tablename' => 'sftopics',
268
  'from_fieldname' => 'topic_status',
269
  'to_type' => 'topic',
270
+ 'to_fieldname' => '_bbp_old_closed_status_id',
271
  'callback_method' => 'callback_status'
272
  );
273
 
274
+ // Sticky status (Stored in postmeta)
275
  $this->field_map[] = array(
276
  'from_tablename' => 'sftopics',
277
  'from_fieldname' => 'topic_pinned',
278
  'to_type' => 'topic',
279
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
280
  'callback_method' => 'callback_sticky_status'
281
  );
282
 
320
 
321
  /** Reply Section *****************************************************/
322
 
323
+ // Old reply id (Stored in postmeta)
324
  $this->field_map[] = array(
325
  'from_tablename' => 'sfposts',
326
  'from_fieldname' => 'post_id',
327
  'to_type' => 'reply',
328
+ 'to_fieldname' => '_bbp_old_reply_id'
329
  );
330
 
331
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
332
  $this->field_map[] = array(
333
  'from_tablename' => 'sfposts',
334
  'from_fieldname' => 'forum_id',
335
+ 'from_expression' => 'WHERE post_index != 1',
336
  'to_type' => 'reply',
337
  'to_fieldname' => '_bbp_forum_id',
338
+ 'callback_method' => 'callback_forumid'
339
  );
340
 
341
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
364
  'callback_method' => 'callback_userid'
365
  );
366
 
367
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
 
368
  $this->field_map[] = array(
369
+ 'from_tablename' => 'sfposts',
370
+ 'from_fieldname' => 'guest_name',
 
 
 
371
  'to_type' => 'reply',
372
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
 
373
  );
374
 
375
+ // Is the reply anonymous (Stored in postmeta)
 
376
  $this->field_map[] = array(
377
+ 'from_tablename' => 'sfposts',
378
+ 'from_fieldname' => 'user_id',
 
 
 
379
  'to_type' => 'reply',
380
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
381
+ 'callback_method' => 'callback_check_anonymous'
382
  );
383
 
384
  // Reply content.
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' => 'ID',
434
  'to_type' => 'user',
435
+ 'to_fieldname' => '_bbp_old_user_id'
436
  );
437
 
438
+ // Store old user password (Stored in usermeta)
439
  $this->field_map[] = array(
440
  'from_tablename' => 'users',
441
  'from_fieldname' => 'user_pass',
526
  }
527
 
528
  /**
529
+ * Translate the post status from Simple:Press v5.x numerics to WordPress's strings.
530
  *
531
  * @param int $status Simple:Press numeric status
532
  * @return string WordPress safe
546
  }
547
 
548
  /**
549
+ * Translate the topic sticky status type from Simple:Press v5.x numerics to WordPress's strings.
550
  *
551
  * @param int $status Simple:Press v5.x numeric forum type
552
  * @return string WordPress safe
576
  return $count;
577
  }
578
 
 
 
 
 
 
 
 
 
 
 
 
579
  /**
580
  * This callback processes any custom parser.php attributes and custom HTML code with preg_replace
581
  */
602
  $simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/' , '<code>$1</code>' , $simplepress_markup );
603
 
604
  // Replace '<strong>username said </strong>' with '@username said:'
605
+ $simplepress_markup = preg_replace( '/\<strong\>(.*?)\ said\ \<\/strong\>/', '@$1 said:', $simplepress_markup );
606
 
607
  // Replace '<p>&nbsp;</p>' with '<p>&nbsp;</p>'
608
+ $simplepress_markup = preg_replace( '/\n(&nbsp;|[\s\p{Z}\xA0\x{00A0}]+)\r/', '<br>', $simplepress_markup );
609
 
610
  // Now that SimplePress' custom HTML codes have been stripped put the cleaned HTML back in $field
611
  $field = $simplepress_markup;
612
 
613
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
614
+ return parent::callback_html( $field );
 
 
 
 
615
  }
616
  }
includes/admin/converters/Vanilla.php CHANGED
@@ -1,21 +1,27 @@
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
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses Vanilla::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,15 +29,21 @@ class Vanilla extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
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 +51,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 +121,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 +163,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 +209,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 +256,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 +277,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 +350,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 +371,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 +395,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 +457,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',
@@ -481,7 +525,7 @@ class Vanilla extends BBP_Converter_Base {
481
  }
482
 
483
  /**
484
- * Translate the topic status from Vanilla v2.x numeric's to WordPress's strings.
485
  *
486
  * @param int $status Vanilla v2.x numeric topic status
487
  * @return string WordPress safe
@@ -500,6 +544,26 @@ class Vanilla extends BBP_Converter_Base {
500
  return $status;
501
  }
502
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
  /**
504
  * Clean Root Parent ID -1 to 0
505
  *
@@ -525,17 +589,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
@@ -552,15 +605,4 @@ class Vanilla extends BBP_Converter_Base {
552
  public function authenticate_pass( $password, $serialized_pass ) {
553
  return false;
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();
562
- $bbcode->enable_smileys = false;
563
- $bbcode->smiley_regex = false;
564
- return html_entity_decode( $bbcode->Parse( $field ) );
565
- }
566
  }
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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  public function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'Category',
43
  'from_fieldname' => 'CategoryID',
44
  'from_expression' => 'WHERE Category.CategoryID > 0',
45
  'to_type' => 'forum',
46
+ 'to_fieldname' => '_bbp_old_forum_id'
47
  );
48
 
49
  // Forum parent id (If no parent, then 0. Stored in postmeta)
51
  'from_tablename' => 'Category',
52
  'from_fieldname' => 'ParentCategoryID',
53
  'to_type' => 'forum',
54
+ 'to_fieldname' => '_bbp_old_forum_parent_id',
55
  'callback_method' => 'callback_forum_parent'
56
  );
57
 
121
  'to_fieldname' => 'menu_order'
122
  );
123
 
124
+ // Forum type (Set a default value 'forum', Stored in postmeta)
125
+ $this->field_map[] = array(
126
+ 'to_type' => 'forum',
127
+ 'to_fieldname' => '_bbp_forum_type',
128
+ 'default' => 'forum'
129
+ );
130
+
131
+ // Forum status (Set a default value 'open', Stored in postmeta)
132
+ $this->field_map[] = array(
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => '_bbp_status',
135
+ 'default' => 'open'
136
+ );
137
+
138
  // Forum dates.
139
  $this->field_map[] = array(
140
  'from_tablename' => 'Category',
163
 
164
  /** Topic Section *****************************************************/
165
 
166
+ // Old topic id (Stored in postmeta)
167
+ // Don't import Vanilla 2's deleted topics
168
  $this->field_map[] = array(
169
+ 'from_tablename' => 'Discussion',
170
+ 'from_fieldname' => 'DiscussionID',
171
+ 'from_expression' => 'WHERE Format != "Deleted"',
172
+ 'to_type' => 'topic',
173
+ 'to_fieldname' => '_bbp_old_topic_id'
174
  );
175
 
176
  // Topic reply count (Stored in postmeta)
209
  'callback_method' => 'callback_userid'
210
  );
211
 
212
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
213
+ $this->field_map[] = array(
214
+ 'to_type' => 'topic',
215
+ 'to_fieldname' => '_bbp_old_topic_author_name_id',
216
+ 'default' => 'Anonymous'
217
+ );
218
+
219
+ // Is the topic anonymous (Stored in postmeta)
220
+ $this->field_map[] = array(
221
+ 'from_tablename' => 'Discussion',
222
+ 'from_fieldname' => 'InsertUserID',
223
+ 'to_type' => 'topic',
224
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
225
+ 'callback_method' => 'callback_check_anonymous'
226
+ );
227
+
228
  // Topic title.
229
  $this->field_map[] = array(
230
  'from_tablename' => 'Discussion',
256
  'from_tablename' => 'Discussion',
257
  'from_fieldname' => 'closed',
258
  'to_type' => 'topic',
259
+ 'to_fieldname' => '_bbp_old_closed_status_id',
260
  'callback_method' => 'callback_topic_status'
261
  );
262
 
277
  'callback_method' => 'callback_forumid'
278
  );
279
 
280
+ // Sticky status (Stored in postmeta)
281
+ $this->field_map[] = array(
282
+ 'from_tablename' => 'Discussion',
283
+ 'from_fieldname' => 'Announce',
284
+ 'to_type' => 'topic',
285
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
286
+ 'callback_method' => 'callback_sticky_status'
287
+ );
288
+
289
  // Topic dates.
290
  $this->field_map[] = array(
291
  'from_tablename' => 'Discussion',
350
 
351
  /** Reply Section *****************************************************/
352
 
353
+ // Old reply id (Stored in postmeta)
354
+ // Don't import Vanilla 2's deleted replies
355
  $this->field_map[] = array(
356
  'from_tablename' => 'Comment',
357
  'from_fieldname' => 'CommentID',
358
+ 'from_expression' => 'WHERE Format != "Deleted"',
359
  'to_type' => 'reply',
360
+ 'to_fieldname' => '_bbp_old_reply_id'
361
  );
362
 
363
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
371
 
372
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
373
  $this->field_map[] = array(
374
+ 'from_tablename' => 'Comment',
375
+ 'from_fieldname' => 'DiscussionID',
 
 
 
376
  'to_type' => 'reply',
377
  'to_fieldname' => '_bbp_forum_id',
378
  'callback_method' => 'callback_topicid_to_forumid'
379
  );
380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  // Reply author ip (Stored in postmeta)
382
  $this->field_map[] = array(
383
  'from_tablename' => 'Comment',
395
  'callback_method' => 'callback_userid'
396
  );
397
 
398
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
399
+ $this->field_map[] = array(
400
+ 'to_type' => 'reply',
401
+ 'to_fieldname' => '_bbp_old_reply_author_name_id',
402
+ 'default' => 'Anonymous'
403
+ );
404
+
405
+ // Is the reply anonymous (Stored in postmeta)
406
+ $this->field_map[] = array(
407
+ 'from_tablename' => 'Comment',
408
+ 'from_fieldname' => 'InsertUserID',
409
+ 'to_type' => 'reply',
410
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
411
+ 'callback_method' => 'callback_check_anonymous'
412
+ );
413
+
414
  // Reply content.
415
  $this->field_map[] = array(
416
  'from_tablename' => 'Comment',
457
 
458
  /** User Section ******************************************************/
459
 
460
+ // Store old user id (Stored in usermeta)
461
+ // Don't import user Vanilla's deleted users
462
  $this->field_map[] = array(
463
  'from_tablename' => 'User',
464
  'from_fieldname' => 'UserID',
465
+ 'from_expression' => 'WHERE Deleted !=1',
466
  'to_type' => 'user',
467
+ 'to_fieldname' => '_bbp_old_user_id'
468
  );
469
 
470
+ // Store old user password (Stored in usermeta)
471
  $this->field_map[] = array(
472
  'from_tablename' => 'User',
473
  'from_fieldname' => 'Password',
525
  }
526
 
527
  /**
528
+ * Translate the topic status from Vanilla v2.x numerics to WordPress's strings.
529
  *
530
  * @param int $status Vanilla v2.x numeric topic status
531
  * @return string WordPress safe
544
  return $status;
545
  }
546
 
547
+ /**
548
+ * Translate the topic sticky status type from Vanilla v2.x numerics to WordPress's strings.
549
+ *
550
+ * @param int $status Vanilla v2.x numeric forum type
551
+ * @return string WordPress safe
552
+ */
553
+ public function callback_sticky_status( $status = 0 ) {
554
+ switch ( $status ) {
555
+ case 1 :
556
+ $status = 'sticky'; // Vanilla Sticky 'Announce = 1'
557
+ break;
558
+
559
+ case 0 :
560
+ default :
561
+ $status = 'normal'; // Vanilla normal topic 'Announce = 0'
562
+ break;
563
+ }
564
+ return $status;
565
+ }
566
+
567
  /**
568
  * Clean Root Parent ID -1 to 0
569
  *
589
  return $count;
590
  }
591
 
 
 
 
 
 
 
 
 
 
 
 
592
  /**
593
  * This method is to save the salt and password together. That
594
  * way when we authenticate it we can get it out of the database
605
  public function authenticate_pass( $password, $serialized_pass ) {
606
  return false;
607
  }
 
 
 
 
 
 
 
 
 
 
 
608
  }
includes/admin/converters/XMB.php CHANGED
@@ -1,709 +1,721 @@
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
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ /**
28
+ * Sets up the field mappings
29
+ */
30
+ public function setup_globals() {
31
+
32
+ /** Forum Section *****************************************************/
33
+
34
+ // Old forum id (Stored in postmeta)
35
+ $this->field_map[] = array(
36
+ 'from_tablename' => 'forums',
37
+ 'from_fieldname' => 'fid',
38
+ 'to_type' => 'forum',
39
+ 'to_fieldname' => '_bbp_old_forum_id'
40
+ );
41
+
42
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
43
+ $this->field_map[] = array(
44
+ 'from_tablename' => 'forums',
45
+ 'from_fieldname' => 'fup',
46
+ 'to_type' => 'forum',
47
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
48
+ );
49
+
50
+ // Forum topic count (Stored in postmeta)
51
+ $this->field_map[] = array(
52
+ 'from_tablename' => 'forums',
53
+ 'from_fieldname' => 'threads',
54
+ 'to_type' => 'forum',
55
+ 'to_fieldname' => '_bbp_topic_count'
56
+ );
57
+
58
+ // Forum reply count (Stored in postmeta)
59
+ $this->field_map[] = array(
60
+ 'from_tablename' => 'forums',
61
+ 'from_fieldname' => 'posts',
62
+ 'to_type' => 'forum',
63
+ 'to_fieldname' => '_bbp_reply_count'
64
+ );
65
+
66
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
67
+ $this->field_map[] = array(
68
+ 'from_tablename' => 'forums',
69
+ 'from_fieldname' => 'threads',
70
+ 'to_type' => 'forum',
71
+ 'to_fieldname' => '_bbp_total_topic_count'
72
+ );
73
+
74
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
75
+ $this->field_map[] = array(
76
+ 'from_tablename' => 'forums',
77
+ 'from_fieldname' => 'posts',
78
+ 'to_type' => 'forum',
79
+ 'to_fieldname' => '_bbp_total_reply_count'
80
+ );
81
+
82
+ // Forum title.
83
+ $this->field_map[] = array(
84
+ 'from_tablename' => 'forums',
85
+ 'from_fieldname' => 'name',
86
+ 'to_type' => 'forum',
87
+ 'to_fieldname' => 'post_title'
88
+ );
89
+
90
+ // Forum slug (Clean name to avoid conflicts)
91
+ $this->field_map[] = array(
92
+ 'from_tablename' => 'forums',
93
+ 'from_fieldname' => 'name',
94
+ 'to_type' => 'forum',
95
+ 'to_fieldname' => 'post_name',
96
+ 'callback_method' => 'callback_slug'
97
+ );
98
+
99
+ // Forum description.
100
+ $this->field_map[] = array(
101
+ 'from_tablename' => 'forums',
102
+ 'from_fieldname' => 'description',
103
+ 'to_type' => 'forum',
104
+ 'to_fieldname' => 'post_content',
105
+ 'callback_method' => 'callback_null'
106
+ );
107
+
108
+ // Forum display order (Starts from 1)
109
+ $this->field_map[] = array(
110
+ 'from_tablename' => 'forums',
111
+ 'from_fieldname' => 'displayorder',
112
+ 'to_type' => 'forum',
113
+ 'to_fieldname' => 'menu_order'
114
+ );
115
+
116
+ // Forum type (Category = 'group', Forum = 'forum' or 'sub', Stored in postmeta)
117
+ $this->field_map[] = array(
118
+ 'from_tablename' => 'forums',
119
+ 'from_fieldname' => 'type',
120
+ 'to_type' => 'forum',
121
+ 'to_fieldname' => '_bbp_forum_type',
122
+ 'callback_method' => 'callback_forum_type'
123
+ );
124
+
125
+ // Forum status (Set a default value 'open', Stored in postmeta)
126
+ $this->field_map[] = array(
127
+ 'to_type' => 'forum',
128
+ 'to_fieldname' => '_bbp_status',
129
+ 'default' => 'open'
130
+ );
131
+
132
+ // Forum dates.
133
+ $this->field_map[] = array(
134
+ 'to_type' => 'forum',
135
+ 'to_fieldname' => 'post_date',
136
+ 'default' => date('Y-m-d H:i:s')
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
+ /** Topic Section *****************************************************/
155
+
156
+ // Old topic id (Stored in postmeta)
157
+ $this->field_map[] = array(
158
+ 'from_tablename' => 'threads',
159
+ 'from_fieldname' => 'tid',
160
+ 'to_type' => 'topic',
161
+ 'to_fieldname' => '_bbp_old_topic_id'
162
+ );
163
+
164
+ // Topic reply count (Stored in postmeta)
165
+ $this->field_map[] = array(
166
+ 'from_tablename' => 'threads',
167
+ 'from_fieldname' => 'replies',
168
+ 'to_type' => 'topic',
169
+ 'to_fieldname' => '_bbp_reply_count',
170
+ 'callback_method' => 'callback_topic_reply_count'
171
+ );
172
+
173
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
174
+ $this->field_map[] = array(
175
+ 'from_tablename' => 'threads',
176
+ 'from_fieldname' => 'replies',
177
+ 'to_type' => 'topic',
178
+ 'to_fieldname' => '_bbp_total_reply_count',
179
+ 'callback_method' => 'callback_topic_reply_count'
180
+ );
181
+
182
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
183
+ $this->field_map[] = array(
184
+ 'from_tablename' => 'threads',
185
+ 'from_fieldname' => 'fid',
186
+ 'to_type' => 'topic',
187
+ 'to_fieldname' => '_bbp_forum_id',
188
+ 'callback_method' => 'callback_forumid'
189
+ );
190
+
191
+ // Topic author.
192
+ // Note: We join the 'members' table because 'threads' table does not have numerical author id.
193
+ $this->field_map[] = array(
194
+ 'from_tablename' => 'members',
195
+ 'from_fieldname' => 'uid',
196
+ 'join_tablename' => 'threads',
197
+ 'join_type' => 'LEFT',
198
+ 'join_expression' => 'ON threads.author = members.username',
199
+ 'to_type' => 'topic',
200
+ 'to_fieldname' => 'post_author',
201
+ 'callback_method' => 'callback_userid'
202
+ );
203
+
204
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
205
+ $this->field_map[] = array(
206
+ 'from_tablename' => 'threads',
207
+ 'from_fieldname' => 'author',
208
+ 'to_type' => 'topic',
209
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
210
+ );
211
+
212
+ // Is the topic anonymous (Stored in postmeta)
213
+ $this->field_map[] = array(
214
+ 'from_tablename' => 'members',
215
+ 'from_fieldname' => 'uid',
216
+ 'join_tablename' => 'threads',
217
+ 'join_type' => 'LEFT',
218
+ 'join_expression' => 'ON threads.author = members.username WHERE posts.subject = ""',
219
+ 'to_type' => 'topic',
220
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
221
+ 'callback_method' => 'callback_check_anonymous'
222
+ );
223
+
224
+ // Topic Author ip (Stored in postmeta)
225
+ // Note: We join the 'posts' table because 'threads' table does not have author ip.
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'posts',
228
+ 'from_fieldname' => 'useip',
229
+ 'join_tablename' => 'threads',
230
+ 'join_type' => 'INNER',
231
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
232
+ 'to_type' => 'topic',
233
+ 'to_fieldname' => '_bbp_author_ip'
234
+ );
235
+
236
+ // Topic content.
237
+ // Note: We join the 'posts' table because 'threads' table does not have content.
238
+ $this->field_map[] = array(
239
+ 'from_tablename' => 'posts',
240
+ 'from_fieldname' => 'message',
241
+ 'join_tablename' => 'threads',
242
+ 'join_type' => 'INNER',
243
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
244
+ 'to_type' => 'topic',
245
+ 'to_fieldname' => 'post_content',
246
+ 'callback_method' => 'callback_html'
247
+ );
248
+
249
+ // Topic title.
250
+ $this->field_map[] = array(
251
+ 'from_tablename' => 'threads',
252
+ 'from_fieldname' => 'subject',
253
+ 'to_type' => 'topic',
254
+ 'to_fieldname' => 'post_title'
255
+ );
256
+
257
+ // Topic slug (Clean name to avoid conflicts)
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'threads',
260
+ 'from_fieldname' => 'subject',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => 'post_name',
263
+ 'callback_method' => 'callback_slug'
264
+ );
265
+
266
+ // Topic parent forum id (If no parent, then 0)
267
+ $this->field_map[] = array(
268
+ 'from_tablename' => 'threads',
269
+ 'from_fieldname' => 'fid',
270
+ 'to_type' => 'topic',
271
+ 'to_fieldname' => 'post_parent',
272
+ 'callback_method' => 'callback_forumid'
273
+ );
274
+
275
+ // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)
276
+ $this->field_map[] = array(
277
+ 'from_tablename' => 'threads',
278
+ 'from_fieldname' => 'closed',
279
+ 'to_type' => 'topic',
280
+ 'to_fieldname' => '_bbp_old_closed_status_id',
281
+ 'callback_method' => 'callback_topic_status'
282
+ );
283
+
284
+ // Sticky status (Stored in postmeta)
285
+ $this->field_map[] = array(
286
+ 'from_tablename' => 'threads',
287
+ 'from_fieldname' => 'topped',
288
+ 'to_type' => 'topic',
289
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
290
+ 'callback_method' => 'callback_sticky_status'
291
+ );
292
+
293
+ // Topic dates.
294
+ // Note: We join the 'posts' table because 'threads' table does not include dates.
295
+ $this->field_map[] = array(
296
+ 'from_tablename' => 'posts',
297
+ 'from_fieldname' => 'dateline',
298
+ 'join_tablename' => 'threads',
299
+ 'join_type' => 'INNER',
300
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
301
+ 'to_type' => 'topic',
302
+ 'to_fieldname' => 'post_date',
303
+ 'callback_method' => 'callback_datetime'
304
+ );
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'posts',
307
+ 'from_fieldname' => 'dateline',
308
+ 'join_tablename' => 'threads',
309
+ 'join_type' => 'INNER',
310
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
311
+ 'to_type' => 'topic',
312
+ 'to_fieldname' => 'post_date_gmt',
313
+ 'callback_method' => 'callback_datetime'
314
+ );
315
+ $this->field_map[] = array(
316
+ 'from_tablename' => 'posts',
317
+ 'from_fieldname' => 'dateline',
318
+ 'join_tablename' => 'threads',
319
+ 'join_type' => 'INNER',
320
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
321
+ 'to_type' => 'topic',
322
+ 'to_fieldname' => 'post_modified',
323
+ 'callback_method' => 'callback_datetime'
324
+ );
325
+ $this->field_map[] = array(
326
+ 'from_tablename' => 'posts',
327
+ 'from_fieldname' => 'dateline',
328
+ 'join_tablename' => 'threads',
329
+ 'join_type' => 'INNER',
330
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
331
+ 'to_type' => 'topic',
332
+ 'to_fieldname' => 'post_modified_gmt',
333
+ 'callback_method' => 'callback_datetime'
334
+ );
335
+ $this->field_map[] = array(
336
+ 'from_tablename' => 'posts',
337
+ 'from_fieldname' => 'dateline',
338
+ 'join_tablename' => 'threads',
339
+ 'join_type' => 'INNER',
340
+ 'join_expression' => 'USING (tid) WHERE posts.subject != ""',
341
+ 'to_type' => 'topic',
342
+ 'to_fieldname' => '_bbp_last_active_time',
343
+ 'callback_method' => 'callback_datetime'
344
+ );
345
+
346
+ /** Tags Section ******************************************************/
347
+
348
+ /**
349
+ * XMB v1.9.11.13 Forums do not support topic tags out of the box
350
+ */
351
+
352
+ /** Reply Section *****************************************************/
353
+
354
+ // Old reply id (Stored in postmeta)
355
+ $this->field_map[] = array(
356
+ 'from_tablename' => 'posts',
357
+ 'from_fieldname' => 'pid',
358
+ 'to_type' => 'reply',
359
+ 'to_fieldname' => '_bbp_old_reply_id'
360
+ );
361
+
362
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
363
+ $this->field_map[] = array(
364
+ 'from_tablename' => 'posts',
365
+ 'from_fieldname' => 'fid',
366
+ 'to_type' => 'reply',
367
+ 'to_fieldname' => '_bbp_forum_id',
368
+ 'callback_method' => 'callback_topicid_to_forumid'
369
+ );
370
+
371
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
372
+ $this->field_map[] = array(
373
+ 'from_tablename' => 'posts',
374
+ 'from_fieldname' => 'tid',
375
+ 'to_type' => 'reply',
376
+ 'to_fieldname' => '_bbp_topic_id',
377
+ 'callback_method' => 'callback_topicid'
378
+ );
379
+
380
+ // Reply author ip (Stored in postmeta)
381
+ $this->field_map[] = array(
382
+ 'from_tablename' => 'posts',
383
+ 'from_fieldname' => 'useip',
384
+ 'to_type' => 'reply',
385
+ 'to_fieldname' => '_bbp_author_ip'
386
+ );
387
+
388
+ // Reply author.
389
+ // Note: We join the 'members' table because 'posts' table does not have numerical author id.
390
+ $this->field_map[] = array(
391
+ 'from_tablename' => 'members',
392
+ 'from_fieldname' => 'uid',
393
+ 'join_tablename' => 'posts',
394
+ 'join_type' => 'LEFT',
395
+ 'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
396
+ 'to_type' => 'reply',
397
+ 'to_fieldname' => 'post_author',
398
+ 'callback_method' => 'callback_userid'
399
+ );
400
+
401
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
402
+ $this->field_map[] = array(
403
+ 'from_tablename' => 'posts',
404
+ 'from_fieldname' => 'author',
405
+ 'to_type' => 'reply',
406
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
407
+ );
408
+
409
+ // Is the reply anonymous (Stored in postmeta)
410
+ $this->field_map[] = array(
411
+ 'from_tablename' => 'members',
412
+ 'from_fieldname' => 'uid',
413
+ 'join_tablename' => 'posts',
414
+ 'join_type' => 'LEFT',
415
+ 'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
416
+ 'to_type' => 'reply',
417
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
418
+ 'callback_method' => 'callback_check_anonymous'
419
+ );
420
+
421
+ // Reply content.
422
+ $this->field_map[] = array(
423
+ 'from_tablename' => 'posts',
424
+ 'from_fieldname' => 'message',
425
+ 'to_type' => 'reply',
426
+ 'to_fieldname' => 'post_content',
427
+ 'callback_method' => 'callback_html'
428
+ );
429
+
430
+ // Reply parent topic id (If no parent, then 0)
431
+ $this->field_map[] = array(
432
+ 'from_tablename' => 'posts',
433
+ 'from_fieldname' => 'tid',
434
+ 'to_type' => 'reply',
435
+ 'to_fieldname' => 'post_parent',
436
+ 'callback_method' => 'callback_topicid'
437
+ );
438
+
439
+ // Reply dates.
440
+ $this->field_map[] = array(
441
+ 'from_tablename' => 'posts',
442
+ 'from_fieldname' => 'dateline',
443
+ 'to_type' => 'reply',
444
+ 'to_fieldname' => 'post_date',
445
+ 'callback_method' => 'callback_datetime'
446
+ );
447
+ $this->field_map[] = array(
448
+ 'from_tablename' => 'posts',
449
+ 'from_fieldname' => 'dateline',
450
+ 'to_type' => 'reply',
451
+ 'to_fieldname' => 'post_date_gmt',
452
+ 'callback_method' => 'callback_datetime'
453
+ );
454
+ $this->field_map[] = array(
455
+ 'from_tablename' => 'posts',
456
+ 'from_fieldname' => 'dateline',
457
+ 'to_type' => 'reply',
458
+ 'to_fieldname' => 'post_modified',
459
+ 'callback_method' => 'callback_datetime'
460
+ );
461
+ $this->field_map[] = array(
462
+ 'from_tablename' => 'posts',
463
+ 'from_fieldname' => 'dateline',
464
+ 'to_type' => 'reply',
465
+ 'to_fieldname' => 'post_modified_gmt',
466
+ 'callback_method' => 'callback_datetime'
467
+ );
468
+
469
+ /** User Section ******************************************************/
470
+
471
+ // Store old user id (Stored in usermeta)
472
+ $this->field_map[] = array(
473
+ 'from_tablename' => 'members',
474
+ 'from_fieldname' => 'uid',
475
+ 'to_type' => 'user',
476
+ 'to_fieldname' => '_bbp_old_user_id'
477
+ );
478
+
479
+ // Store old User password (Stored in usermeta serialized with salt)
480
+ $this->field_map[] = array(
481
+ 'from_tablename' => 'members',
482
+ 'from_fieldname' => 'password',
483
+ 'to_type' => 'user',
484
+ 'to_fieldname' => '_bbp_password',
485
+ 'callback_method' => 'callback_savepass'
486
+ );
487
+
488
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
489
+ // $this->field_map[] = array(
490
+ // 'from_tablename' => 'members',
491
+ // 'from_fieldname' => 'salt',
492
+ // 'to_type' => 'user',
493
+ // 'to_fieldname' => ''
494
+ // );
495
+
496
+ // User password verify class (Stored in usermeta for verifying password)
497
+ $this->field_map[] = array(
498
+ 'to_type' => 'members',
499
+ 'to_fieldname' => '_bbp_class',
500
+ 'default' => 'XMB'
501
+ );
502
+
503
+ // User name.
504
+ $this->field_map[] = array(
505
+ 'from_tablename' => 'members',
506
+ 'from_fieldname' => 'username',
507
+ 'to_type' => 'user',
508
+ 'to_fieldname' => 'user_login'
509
+ );
510
+
511
+ // User nice name.
512
+ $this->field_map[] = array(
513
+ 'from_tablename' => 'members',
514
+ 'from_fieldname' => 'username',
515
+ 'to_type' => 'user',
516
+ 'to_fieldname' => 'user_nicename'
517
+ );
518
+
519
+ // User email.
520
+ $this->field_map[] = array(
521
+ 'from_tablename' => 'members',
522
+ 'from_fieldname' => 'email',
523
+ 'to_type' => 'user',
524
+ 'to_fieldname' => 'user_email'
525
+ );
526
+
527
+ // User homepage.
528
+ $this->field_map[] = array(
529
+ 'from_tablename' => 'members',
530
+ 'from_fieldname' => 'site',
531
+ 'to_type' => 'user',
532
+ 'to_fieldname' => 'user_url'
533
+ );
534
+
535
+ // User registered.
536
+ $this->field_map[] = array(
537
+ 'from_tablename' => 'members',
538
+ 'from_fieldname' => 'regdate',
539
+ 'to_type' => 'user',
540
+ 'to_fieldname' => 'user_registered',
541
+ 'callback_method' => 'callback_datetime'
542
+ );
543
+
544
+ // User AIM (Stored in usermeta)
545
+ $this->field_map[] = array(
546
+ 'from_tablename' => 'members',
547
+ 'from_fieldname' => 'aim',
548
+ 'to_type' => 'user',
549
+ 'to_fieldname' => '_bbp_xmb_user_aim'
550
+ );
551
+
552
+ // User Yahoo (Stored in usermeta)
553
+ $this->field_map[] = array(
554
+ 'from_tablename' => 'members',
555
+ 'from_fieldname' => 'yahoo',
556
+ 'to_type' => 'user',
557
+ 'to_fieldname' => '_bbp_xmb_user_yim'
558
+ );
559
+
560
+ // Store ICQ (Stored in usermeta)
561
+ $this->field_map[] = array(
562
+ 'from_tablename' => 'members',
563
+ 'from_fieldname' => 'icq',
564
+ 'to_type' => 'user',
565
+ 'to_fieldname' => '_bbp_xmb_user_icq'
566
+ );
567
+
568
+ // Store MSN (Stored in usermeta)
569
+ $this->field_map[] = array(
570
+ 'from_tablename' => 'members',
571
+ 'from_fieldname' => 'msn',
572
+ 'to_type' => 'user',
573
+ 'to_fieldname' => '_bbp_xmb_user_msn'
574
+ );
575
+
576
+ // Store Signature (Stored in usermeta)
577
+ $this->field_map[] = array(
578
+ 'from_tablename' => 'members',
579
+ 'from_fieldname' => 'sig',
580
+ 'to_type' => 'user',
581
+ 'to_fieldname' => '_bbp_xmb_user_sig',
582
+ 'callback_method' => 'callback_html'
583
+ );
584
+
585
+ // Store Bio (Stored in usermeta)
586
+ $this->field_map[] = array(
587
+ 'from_tablename' => 'members',
588
+ 'from_fieldname' => 'bio',
589
+ 'to_type' => 'user',
590
+ 'to_fieldname' => '_bbp_xmb_user_bio',
591
+ 'callback_method' => 'callback_html'
592
+ );
593
+
594
+ // Store Location (Stored in usermeta)
595
+ $this->field_map[] = array(
596
+ 'from_tablename' => 'members',
597
+ 'from_fieldname' => 'location',
598
+ 'to_type' => 'user',
599
+ 'to_fieldname' => '_bbp_xmb_user_location'
600
+ );
601
+
602
+ // Store Avatar (Stored in usermeta)
603
+ $this->field_map[] = array(
604
+ 'from_tablename' => 'members',
605
+ 'from_fieldname' => 'avatar',
606
+ 'to_type' => 'user',
607
+ 'to_fieldname' => '_bbp_xmb_user_avatar'
608
+ );
609
+
610
+ // Store Mood (Stored in usermeta)
611
+ $this->field_map[] = array(
612
+ 'from_tablename' => 'members',
613
+ 'from_fieldname' => 'mood',
614
+ 'to_type' => 'user',
615
+ 'to_fieldname' => '_bbp_xmb_user_mood'
616
+ );
617
+
618
+ }
619
+
620
+ /**
621
+ * This method allows us to indicates what is or is not converted for each
622
+ * converter.
623
+ */
624
+ public function info() {
625
+ return '';
626
+ }
627
+
628
+ /**
629
+ * This method is to save the salt and password together. That
630
+ * way when we authenticate it we can get it out of the database
631
+ * as one value. Array values are auto sanitized by WordPress.
632
+ */
633
+ public function callback_savepass( $field, $row ) {
634
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
635
+ return $pass_array;
636
+ }
637
+
638
+ /**
639
+ * This method is to take the pass out of the database and compare
640
+ * to a pass the user has typed in.
641
+ */
642
+ public function authenticate_pass( $password, $serialized_pass ) {
643
+ $pass_array = unserialize( $serialized_pass );
644
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
645
+ }
646
+
647
+ /**
648
+ * Translate the forum type from XMB v1.9.11.13 Capitalised case to WordPress's non-capatilise case strings.
649
+ *
650
+ * @param int $status XMB v1.9.11.13 numeric forum type
651
+ * @return string WordPress safe
652
+ */
653
+ public function callback_forum_type( $status = 1 ) {
654
+ switch ( $status ) {
655
+ case 'group' :
656
+ $status = 'category';
657
+ break;
658
+
659
+ case 'sub' :
660
+ $status = 'forum';
661
+ break;
662
+
663
+ case 'forum' :
664
+ default :
665
+ $status = 'forum';
666
+ break;
667
+ }
668
+ return $status;
669
+ }
670
+
671
+ /**
672
+ * Translate the post status from XMB v1.9.11.13 numerics to WordPress's strings.
673
+ *
674
+ * @param int $status XMB v1.9.11.13 numeric topic status
675
+ * @return string WordPress safe
676
+ */
677
+ public function callback_topic_status( $status = '' ) {
678
+ switch ( $status ) {
679
+ case 'yes' :
680
+ $status = 'closed';
681
+ break;
682
+
683
+ case '' :
684
+ default :
685
+ $status = 'publish';
686
+ break;
687
+ }
688
+ return $status;
689
+ }
690
+
691
+ /**
692
+ * Translate the topic sticky status type from XMB v1.9.11.13 numerics to WordPress's strings.
693
+ *
694
+ * @param int $status XMB v1.9.11.13 numeric forum type
695
+ * @return string WordPress safe
696
+ */
697
+ public function callback_sticky_status( $status = 0 ) {
698
+ switch ( $status ) {
699
+ case 1 :
700
+ $status = 'sticky'; // XMB Sticky 'topped = 1'
701
+ break;
702
+
703
+ case 0 :
704
+ default :
705
+ $status = 'normal'; // XMB Normal Topic 'topped = 0'
706
+ break;
707
+ }
708
+ return $status;
709
+ }
710
+
711
+ /**
712
+ * Verify the topic/reply count.
713
+ *
714
+ * @param int $count XMB v1.9.11.13 topic/reply counts
715
+ * @return string WordPress safe
716
+ */
717
+ public function callback_topic_reply_count( $count = 1 ) {
718
+ $count = absint( (int) $count - 1 );
719
+ return $count;
720
+ }
721
+ }
includes/admin/converters/XenForo.php CHANGED
@@ -1,725 +1,850 @@
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
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ /**
28
+ * Sets up the field mappings
29
+ */
30
+ public function setup_globals() {
31
+
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
+ /** Forum Section *****************************************************/
39
+
40
+ // Old forum id (Stored in postmeta)
41
+ $this->field_map[] = array(
42
+ 'from_tablename' => 'node',
43
+ 'from_fieldname' => 'node_id',
44
+ 'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
+ );
47
+
48
+ // Forum parent id (If no parent, then 0. Stored in postmeta)
49
+ $this->field_map[] = array(
50
+ 'from_tablename' => 'node',
51
+ 'from_fieldname' => 'parent_node_id',
52
+ 'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
+ );
55
+
56
+ // Forum topic count (Stored in postmeta)
57
+ // Note: We join the 'forum' table because 'node' does not include topic counts.
58
+ $this->field_map[] = array(
59
+ 'from_tablename' => 'forum',
60
+ 'from_fieldname' => 'discussion_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_topic_count'
66
+ );
67
+
68
+ // Forum reply count (Stored in postmeta)
69
+ // Note: We join the 'forum' table because 'node' does not include reply counts.
70
+ $this->field_map[] = array(
71
+ 'from_tablename' => 'forum',
72
+ 'from_fieldname' => 'message_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_reply_count'
78
+ );
79
+
80
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
81
+ // Note: We join the 'forum' table because 'node' does not include topic counts.
82
+ $this->field_map[] = array(
83
+ 'from_tablename' => 'forum',
84
+ 'from_fieldname' => 'discussion_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_topic_count'
90
+ );
91
+
92
+ // Forum total reply count (Includes unpublished replies, Stored in postmeta)
93
+ // Note: We join the 'forum' table because 'node' does not include reply counts.
94
+ $this->field_map[] = array(
95
+ 'from_tablename' => 'forum',
96
+ 'from_fieldname' => 'message_count',
97
+ 'join_tablename' => 'node',
98
+ 'join_type' => 'LEFT',
99
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
100
+ 'to_type' => 'forum',
101
+ 'to_fieldname' => '_bbp_total_reply_count'
102
+ );
103
+
104
+ // Forum title.
105
+ $this->field_map[] = array(
106
+ 'from_tablename' => 'node',
107
+ 'from_fieldname' => 'title',
108
+ 'to_type' => 'forum',
109
+ 'to_fieldname' => 'post_title'
110
+ );
111
+
112
+ // Forum slug (Clean name to avoid confilcts)
113
+ // 'node_name' only has slug for explictly named forums
114
+ $this->field_map[] = array(
115
+ 'from_tablename' => 'node',
116
+ 'from_fieldname' => 'node_name',
117
+ 'to_type' => 'forum',
118
+ 'to_fieldname' => 'post_name',
119
+ 'callback_method' => 'callback_slug'
120
+ );
121
+
122
+ // Forum description.
123
+ $this->field_map[] = array(
124
+ 'from_tablename' => 'node',
125
+ 'from_fieldname' => 'description',
126
+ 'to_type' => 'forum',
127
+ 'to_fieldname' => 'post_content',
128
+ 'callback_method' => 'callback_null'
129
+ );
130
+
131
+ // Forum display order (Starts from 1)
132
+ $this->field_map[] = array(
133
+ 'from_tablename' => 'node',
134
+ 'from_fieldname' => 'display_order',
135
+ 'to_type' => 'forum',
136
+ 'to_fieldname' => 'menu_order'
137
+ );
138
+
139
+ // Forum type (Category = Category or Forum = Forum, Stored in postmeta)
140
+ $this->field_map[] = array(
141
+ 'from_tablename' => 'node',
142
+ 'from_fieldname' => 'node_type_id',
143
+ 'to_type' => 'forum',
144
+ 'to_fieldname' => '_bbp_forum_type',
145
+ 'callback_method' => 'callback_forum_type'
146
+ );
147
+
148
+ // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta)
149
+ // Note: We join the 'forum' table because 'node' does not include forum status.
150
+ $this->field_map[] = array(
151
+ 'from_tablename' => 'forum',
152
+ 'from_fieldname' => 'allow_posting',
153
+ 'join_tablename' => 'node',
154
+ 'join_type' => 'LEFT',
155
+ 'join_expression' => 'USING (node_id) WHERE node.node_type_id = "Category" OR node.node_type_id = "Forum" ',
156
+ 'to_type' => 'forum',
157
+ 'to_fieldname' => '_bbp_status',
158
+ 'callback_method' => 'callback_forum_status'
159
+ );
160
+
161
+ // Forum dates.
162
+ $this->field_map[] = array(
163
+ 'to_type' => 'forum',
164
+ 'to_fieldname' => 'post_date',
165
+ 'default' => date('Y-m-d H:i:s')
166
+ );
167
+ $this->field_map[] = array(
168
+ 'to_type' => 'forum',
169
+ 'to_fieldname' => 'post_date_gmt',
170
+ 'default' => date('Y-m-d H:i:s')
171
+ );
172
+ $this->field_map[] = array(
173
+ 'to_type' => 'forum',
174
+ 'to_fieldname' => 'post_modified',
175
+ 'default' => date('Y-m-d H:i:s')
176
+ );
177
+ $this->field_map[] = array(
178
+ 'to_type' => 'forum',
179
+ 'to_fieldname' => 'post_modified_gmt',
180
+ 'default' => date('Y-m-d H:i:s')
181
+ );
182
+
183
+ /** Forum Subscriptions Section ***************************************/
184
+
185
+ // Subscribed forum ID (Stored in usermeta)
186
+ $this->field_map[] = array(
187
+ 'from_tablename' => 'forum_watch',
188
+ 'from_fieldname' => 'node_id',
189
+ 'to_type' => 'forum_subscriptions',
190
+ 'to_fieldname' => '_bbp_forum_subscriptions'
191
+ );
192
+
193
+ // Subscribed user ID (Stored in usermeta)
194
+ $this->field_map[] = array(
195
+ 'from_tablename' => 'forum_watch',
196
+ 'from_fieldname' => 'user_id',
197
+ 'to_type' => 'forum_subscriptions',
198
+ 'to_fieldname' => 'user_id',
199
+ 'callback_method' => 'callback_userid'
200
+ );
201
+
202
+ /** Topic Section *****************************************************/
203
+
204
+ // Old topic id (Stored in postmeta)
205
+ $this->field_map[] = array(
206
+ 'from_tablename' => 'thread',
207
+ 'from_fieldname' => 'thread_id',
208
+ 'to_type' => 'topic',
209
+ 'to_fieldname' => '_bbp_old_topic_id'
210
+ );
211
+
212
+ // Topic reply count (Stored in postmeta)
213
+ $this->field_map[] = array(
214
+ 'from_tablename' => 'thread',
215
+ 'from_fieldname' => 'reply_count',
216
+ 'to_type' => 'topic',
217
+ 'to_fieldname' => '_bbp_reply_count',
218
+ 'callback_method' => 'callback_topic_reply_count'
219
+ );
220
+
221
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
222
+ $this->field_map[] = array(
223
+ 'from_tablename' => 'thread',
224
+ 'from_fieldname' => 'reply_count',
225
+ 'to_type' => 'topic',
226
+ 'to_fieldname' => '_bbp_total_reply_count',
227
+ 'callback_method' => 'callback_topic_reply_count'
228
+ );
229
+
230
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
231
+ $this->field_map[] = array(
232
+ 'from_tablename' => 'thread',
233
+ 'from_fieldname' => 'node_id',
234
+ 'to_type' => 'topic',
235
+ 'to_fieldname' => '_bbp_forum_id',
236
+ 'callback_method' => 'callback_forumid'
237
+ );
238
+
239
+ // Topic author.
240
+ $this->field_map[] = array(
241
+ 'from_tablename' => 'thread',
242
+ 'from_fieldname' => 'user_id',
243
+ 'to_type' => 'topic',
244
+ 'to_fieldname' => 'post_author',
245
+ 'callback_method' => 'callback_userid'
246
+ );
247
+
248
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
249
+ $this->field_map[] = array(
250
+ 'from_tablename' => 'thread',
251
+ 'from_fieldname' => 'username',
252
+ 'to_type' => 'topic',
253
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
254
+ );
255
+
256
+ // Is the topic anonymous (Stored in postmeta)
257
+ $this->field_map[] = array(
258
+ 'from_tablename' => 'thread',
259
+ 'from_fieldname' => 'user_id',
260
+ 'to_type' => 'topic',
261
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
262
+ 'callback_method' => 'callback_check_anonymous'
263
+ );
264
+
265
+ // Topic title.
266
+ $this->field_map[] = array(
267
+ 'from_tablename' => 'thread',
268
+ 'from_fieldname' => 'title',
269
+ 'to_type' => 'topic',
270
+ 'to_fieldname' => 'post_title'
271
+ );
272
+
273
+ // Topic slug (Clean name to avoid conflicts)
274
+ $this->field_map[] = array(
275
+ 'from_tablename' => 'thread',
276
+ 'from_fieldname' => 'title',
277
+ 'to_type' => 'topic',
278
+ 'to_fieldname' => 'post_name',
279
+ 'callback_method' => 'callback_slug'
280
+ );
281
+
282
+ // Topic content.
283
+ // Note: We join the 'post' table because 'thread' table does not include content.
284
+ $this->field_map[] = array(
285
+ 'from_tablename' => 'post',
286
+ 'from_fieldname' => 'message',
287
+ 'join_tablename' => 'thread',
288
+ 'join_type' => 'INNER',
289
+ 'join_expression' => 'ON thread.first_post_id = post.post_id',
290
+ 'to_type' => 'topic',
291
+ 'to_fieldname' => 'post_content',
292
+ 'callback_method' => 'callback_html'
293
+ );
294
+
295
+ // Topic status (Visible or Deleted)
296
+ $this->field_map[] = array(
297
+ 'from_tablename' => 'thread',
298
+ 'from_fieldname' => 'discussion_state',
299
+ 'to_type' => 'topic',
300
+ 'to_fieldname' => 'post_status',
301
+ 'callback_method' => 'callback_status'
302
+ );
303
+
304
+ // Topic status (Open = 1 or Closed = 0)
305
+ $this->field_map[] = array(
306
+ 'from_tablename' => 'thread',
307
+ 'from_fieldname' => 'discussion_open',
308
+ 'to_type' => 'topic',
309
+ 'to_fieldname' => '_bbp_old_closed_status_id',
310
+ 'callback_method' => 'callback_topic_status'
311
+ );
312
+
313
+ // Topic parent forum id (If no parent, then 0)
314
+ $this->field_map[] = array(
315
+ 'from_tablename' => 'thread',
316
+ 'from_fieldname' => 'node_id',
317
+ 'to_type' => 'topic',
318
+ 'to_fieldname' => 'post_parent',
319
+ 'callback_method' => 'callback_forumid'
320
+ );
321
+
322
+ // Sticky status (Stored in postmeta)
323
+ $this->field_map[] = array(
324
+ 'from_tablename' => 'thread',
325
+ 'from_fieldname' => 'sticky',
326
+ 'to_type' => 'topic',
327
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
328
+ 'callback_method' => 'callback_sticky_status'
329
+ );
330
+
331
+ // Topic dates.
332
+ $this->field_map[] = array(
333
+ 'from_tablename' => 'thread',
334
+ 'from_fieldname' => 'post_date',
335
+ 'to_type' => 'topic',
336
+ 'to_fieldname' => 'post_date',
337
+ 'callback_method' => 'callback_datetime'
338
+ );
339
+ $this->field_map[] = array(
340
+ 'from_tablename' => 'thread',
341
+ 'from_fieldname' => 'post_date',
342
+ 'to_type' => 'topic',
343
+ 'to_fieldname' => 'post_date_gmt',
344
+ 'callback_method' => 'callback_datetime'
345
+ );
346
+ $this->field_map[] = array(
347
+ 'from_tablename' => 'thread',
348
+ 'from_fieldname' => 'last_post_date',
349
+ 'to_type' => 'topic',
350
+ 'to_fieldname' => 'post_modified',
351
+ 'callback_method' => 'callback_datetime'
352
+ );
353
+ $this->field_map[] = array(
354
+ 'from_tablename' => 'thread',
355
+ 'from_fieldname' => 'last_post_date',
356
+ 'to_type' => 'topic',
357
+ 'to_fieldname' => 'post_modified_gmt',
358
+ 'callback_method' => 'callback_datetime'
359
+ );
360
+ $this->field_map[] = array(
361
+ 'from_tablename' => 'thread',
362
+ 'from_fieldname' => 'last_post_date',
363
+ 'to_type' => 'topic',
364
+ 'to_fieldname' => '_bbp_last_active_time',
365
+ 'callback_method' => 'callback_datetime'
366
+ );
367
+
368
+ /** Tags Section ******************************************************/
369
+
370
+ /**
371
+ * XenForo Forums do not support topic tags out of the box
372
+ */
373
+
374
+ /** Topic Subscriptions Section ***************************************/
375
+
376
+ // Subscribed topic ID (Stored in usermeta)
377
+ $this->field_map[] = array(
378
+ 'from_tablename' => 'thread_watch',
379
+ 'from_fieldname' => 'thread_id',
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' => 'thread_watch',
387
+ 'from_fieldname' => 'user_id',
388
+ 'to_type' => 'topic_subscriptions',
389
+ 'to_fieldname' => 'user_id',
390
+ 'callback_method' => 'callback_userid'
391
+ );
392
+
393
+ /** Reply Section *****************************************************/
394
+
395
+ // Old reply id (Stored in postmeta)
396
+ $this->field_map[] = array(
397
+ 'from_tablename' => 'post',
398
+ 'from_fieldname' => 'post_id',
399
+ 'to_type' => 'reply',
400
+ 'to_fieldname' => '_bbp_old_reply_id'
401
+ );
402
+
403
+ // Join the 'thread' table to exclude topics from being imported as replies
404
+ $this->field_map[] = array(
405
+ 'from_tablename' => 'thread',
406
+ 'from_fieldname' => 'thread_id',
407
+ 'join_tablename' => 'post',
408
+ 'join_type' => 'LEFT',
409
+ 'join_expression' => 'USING (thread_id) WHERE thread.first_post_id != post.post_id',
410
+ 'to_type' => 'reply'
411
+ );
412
+
413
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
414
+ $this->field_map[] = array(
415
+ 'from_tablename' => 'post',
416
+ 'from_fieldname' => 'thread_id',
417
+ 'to_type' => 'reply',
418
+ 'to_fieldname' => '_bbp_forum_id',
419
+ 'callback_method' => 'callback_topicid_to_forumid'
420
+ );
421
+
422
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
423
+ $this->field_map[] = array(
424
+ 'from_tablename' => 'post',
425
+ 'from_fieldname' => 'thread_id',
426
+ 'to_type' => 'reply',
427
+ 'to_fieldname' => '_bbp_topic_id',
428
+ 'callback_method' => 'callback_topicid'
429
+ );
430
+
431
+ // Reply author.
432
+ $this->field_map[] = array(
433
+ 'from_tablename' => 'post',
434
+ 'from_fieldname' => 'user_id',
435
+ 'to_type' => 'reply',
436
+ 'to_fieldname' => 'post_author',
437
+ 'callback_method' => 'callback_userid'
438
+ );
439
+
440
+ // Reply status (Visible or Deleted)
441
+ $this->field_map[] = array(
442
+ 'from_tablename' => 'post',
443
+ 'from_fieldname' => 'message_state',
444
+ 'to_type' => 'reply',
445
+ 'to_fieldname' => 'post_status',
446
+ 'callback_method' => 'callback_status'
447
+ );
448
+
449
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
450
+ $this->field_map[] = array(
451
+ 'from_tablename' => 'post',
452
+ 'from_fieldname' => 'username',
453
+ 'to_type' => 'reply',
454
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
455
+ );
456
+
457
+ // Is the reply anonymous (Stored in postmeta)
458
+ $this->field_map[] = array(
459
+ 'from_tablename' => 'post',
460
+ 'from_fieldname' => 'user_id',
461
+ 'to_type' => 'reply',
462
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
463
+ 'callback_method' => 'callback_check_anonymous'
464
+ );
465
+
466
+ // Reply content.
467
+ $this->field_map[] = array(
468
+ 'from_tablename' => 'post',
469
+ 'from_fieldname' => 'message',
470
+ 'to_type' => 'reply',
471
+ 'to_fieldname' => 'post_content',
472
+ 'callback_method' => 'callback_html'
473
+ );
474
+
475
+ // Reply parent topic id (If no parent, then 0)
476
+ $this->field_map[] = array(
477
+ 'from_tablename' => 'post',
478
+ 'from_fieldname' => 'thread_id',
479
+ 'to_type' => 'reply',
480
+ 'to_fieldname' => 'post_parent',
481
+ 'callback_method' => 'callback_topicid'
482
+ );
483
+
484
+ // Reply dates.
485
+ $this->field_map[] = array(
486
+ 'from_tablename' => 'post',
487
+ 'from_fieldname' => 'post_date',
488
+ 'to_type' => 'reply',
489
+ 'to_fieldname' => 'post_date',
490
+ 'callback_method' => 'callback_datetime'
491
+ );
492
+ $this->field_map[] = array(
493
+ 'from_tablename' => 'post',
494
+ 'from_fieldname' => 'post_date',
495
+ 'to_type' => 'reply',
496
+ 'to_fieldname' => 'post_date_gmt',
497
+ 'callback_method' => 'callback_datetime'
498
+ );
499
+ $this->field_map[] = array(
500
+ 'from_tablename' => 'post',
501
+ 'from_fieldname' => 'post_date',
502
+ 'to_type' => 'reply',
503
+ 'to_fieldname' => 'post_modified',
504
+ 'callback_method' => 'callback_datetime'
505
+ );
506
+ $this->field_map[] = array(
507
+ 'from_tablename' => 'post',
508
+ 'from_fieldname' => 'post_date',
509
+ 'to_type' => 'reply',
510
+ 'to_fieldname' => 'post_modified_gmt',
511
+ 'callback_method' => 'callback_datetime'
512
+ );
513
+
514
+ /** User Section ******************************************************/
515
+
516
+ // Store old user id (Stored in usermeta)
517
+ $this->field_map[] = array(
518
+ 'from_tablename' => 'user',
519
+ 'from_fieldname' => 'user_id',
520
+ 'to_type' => 'user',
521
+ 'to_fieldname' => '_bbp_old_user_id'
522
+ );
523
+
524
+ /* // User password.
525
+ // Note: We join the 'user_authenticate' table because 'user' does not include password.
526
+ $this->field_map[] = array(
527
+ 'from_tablename' => 'user_authenticate',
528
+ 'from_fieldname' => 'data',
529
+ 'join_tablename' => 'user',
530
+ 'join_type' => 'LEFT',
531
+ 'join_expression' => 'USING (user_id)',
532
+ 'to_type' => 'user',
533
+ 'to_fieldname' => '_bbp_converter_password'
534
+ );
535
+
536
+ // Store old User password (Stored in usermeta serialized with salt)
537
+ $this->field_map[] = array(
538
+ 'from_tablename' => 'user',
539
+ 'from_fieldname' => 'password',
540
+ 'to_type' => 'user',
541
+ 'to_fieldname' => '_bbp_password',
542
+ 'callback_method' => 'callback_savepass'
543
+ );
544
+
545
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
546
+ $this->field_map[] = array(
547
+ 'from_tablename' => 'user',
548
+ 'from_fieldname' => 'salt',
549
+ 'to_type' => 'user',
550
+ 'to_fieldname' => ''
551
+ );
552
+ */
553
+ // User password verify class (Stored in usermeta for verifying password)
554
+ $this->field_map[] = array(
555
+ 'to_type' => 'user',
556
+ 'to_fieldname' => '_bbp_class',
557
+ 'default' => 'XenForo'
558
+ );
559
+
560
+ // User name.
561
+ $this->field_map[] = array(
562
+ 'from_tablename' => 'user',
563
+ 'from_fieldname' => 'username',
564
+ 'to_type' => 'user',
565
+ 'to_fieldname' => 'user_login'
566
+ );
567
+
568
+ // User email.
569
+ $this->field_map[] = array(
570
+ 'from_tablename' => 'user',
571
+ 'from_fieldname' => 'email',
572
+ 'to_type' => 'user',
573
+ 'to_fieldname' => 'user_email'
574
+ );
575
+
576
+ // User homepage.
577
+ // Note: We join the 'user_profile' table because 'user' does not include user homepage.
578
+ $this->field_map[] = array(
579
+ 'from_tablename' => 'user_profile',
580
+ 'from_fieldname' => 'homepage',
581
+ 'join_tablename' => 'user',
582
+ 'join_type' => 'LEFT',
583
+ 'join_expression' => 'USING (user_id)',
584
+ 'to_type' => 'user',
585
+ 'to_fieldname' => 'user_url'
586
+ );
587
+
588
+ // User registered.
589
+ $this->field_map[] = array(
590
+ 'from_tablename' => 'user',
591
+ 'from_fieldname' => 'register_date',
592
+ 'to_type' => 'user',
593
+ 'to_fieldname' => 'user_registered',
594
+ 'callback_method' => 'callback_datetime'
595
+ );
596
+
597
+ // User display name.
598
+ $this->field_map[] = array(
599
+ 'from_tablename' => 'user',
600
+ 'from_fieldname' => 'username',
601
+ 'to_type' => 'user',
602
+ 'to_fieldname' => 'display_name'
603
+ );
604
+
605
+ // Store Custom Title (Stored in usermeta)
606
+ $this->field_map[] = array(
607
+ 'from_tablename' => 'user',
608
+ 'from_fieldname' => 'custom_title',
609
+ 'to_type' => 'user',
610
+ 'to_fieldname' => '_bbp_xenforo_user_custom_title'
611
+ );
612
+
613
+ // Store Status (Stored in usermeta)
614
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user status.
615
+ $this->field_map[] = array(
616
+ 'from_tablename' => 'user_profile',
617
+ 'from_fieldname' => 'status',
618
+ 'join_tablename' => 'user',
619
+ 'join_type' => 'LEFT',
620
+ 'join_expression' => 'USING (user_id)',
621
+ 'to_type' => 'user',
622
+ 'to_fieldname' => '_bbp_xenforo_user_status'
623
+ );
624
+
625
+ // Store Signature (Stored in usermeta)
626
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user signature.
627
+ $this->field_map[] = array(
628
+ 'from_tablename' => 'user_profile',
629
+ 'from_fieldname' => 'signature',
630
+ 'join_tablename' => 'user',
631
+ 'join_type' => 'LEFT',
632
+ 'join_expression' => 'USING (user_id)',
633
+ 'to_fieldname' => '_bbp_xenforo_user_sig',
634
+ 'to_type' => 'user',
635
+ 'callback_method' => 'callback_html'
636
+ );
637
+
638
+ // Store Location (Stored in usermeta)
639
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user location.
640
+ $this->field_map[] = array(
641
+ 'from_tablename' => 'user_profile',
642
+ 'from_fieldname' => 'location',
643
+ 'join_tablename' => 'user',
644
+ 'join_type' => 'LEFT',
645
+ 'join_expression' => 'USING (user_id)',
646
+ 'to_type' => 'user',
647
+ 'to_fieldname' => '_bbp_xenforo_user_location'
648
+ );
649
+
650
+ // Store Occupation (Stored in usermeta)
651
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user occupation.
652
+ $this->field_map[] = array(
653
+ 'from_tablename' => 'user_profile',
654
+ 'from_fieldname' => 'occupation',
655
+ 'join_tablename' => 'user',
656
+ 'join_type' => 'LEFT',
657
+ 'join_expression' => 'USING (user_id)',
658
+ 'to_type' => 'user',
659
+ 'to_fieldname' => '_bbp_xenforo_user_occupation'
660
+ );
661
+
662
+ // Store About (Stored in usermeta)
663
+ // Note: We join the 'user_profile' table because 'user' does not include user custom XenForo field user about.
664
+ $this->field_map[] = array(
665
+ 'from_tablename' => 'user_profile',
666
+ 'from_fieldname' => 'about',
667
+ 'join_tablename' => 'user',
668
+ 'join_type' => 'LEFT',
669
+ 'join_expression' => 'USING (user_id)',
670
+ 'to_type' => 'user',
671
+ 'to_fieldname' => '_bbp_xenforo_user_about',
672
+ 'callback_method' => 'callback_html'
673
+ );
674
+ }
675
+
676
+ /**
677
+ * This method allows us to indicates what is or is not converted for each
678
+ * converter.
679
+ */
680
+ public function info() {
681
+ return '';
682
+ }
683
+
684
+ /**
685
+ * This method is to save the salt and password together. That
686
+ * way when we authenticate it we can get it out of the database
687
+ * as one value. Array values are auto sanitized by wordpress.
688
+ */
689
+ public function translate_savepass( $field, $row ) {
690
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
691
+ return $pass_array;
692
+ }
693
+
694
+ /**
695
+ * This method is to take the pass out of the database and compare
696
+ * to a pass the user has typed in.
697
+ */
698
+ public function authenticate_pass( $password, $serialized_pass ) {
699
+ $pass_array = unserialize( $serialized_pass );
700
+ switch( $pass_array['hashFunc'] ) {
701
+ case 'sha256':
702
+ return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) );
703
+ case 'sha1':
704
+ return ( $pass_array['hash'] == sha1( sha1( $password ) . $pass_array['salt'] ) );
705
+ }
706
+ }
707
+
708
+ /**
709
+ * Translate the forum type from XenForo Capitalised case to WordPress's non-capatilise case strings.
710
+ *
711
+ * @param int $status XenForo numeric forum type
712
+ * @return string WordPress safe
713
+ */
714
+ public function callback_forum_type( $status = 1 ) {
715
+ switch ( $status ) {
716
+ case 'Category' :
717
+ $status = 'category';
718
+ break;
719
+
720
+ case 'Forum' :
721
+ default :
722
+ $status = 'forum';
723
+ break;
724
+ }
725
+ return $status;
726
+ }
727
+
728
+ /**
729
+ * Translate the forum status from XenForo numerics to WordPress's strings.
730
+ *
731
+ * @param int $status XenForo numeric forum status
732
+ * @return string WordPress safe
733
+ */
734
+ public function callback_forum_status( $status = 1 ) {
735
+ switch ( $status ) {
736
+ case 0 :
737
+ $status = 'closed';
738
+ break;
739
+
740
+ case 1 :
741
+ default :
742
+ $status = 'open';
743
+ break;
744
+ }
745
+ return $status;
746
+ }
747
+
748
+ /**
749
+ * Translate the post status from XenForo to WordPress' strings.
750
+ *
751
+ * @param int $status XenForo post status
752
+ * @return string WordPress safe
753
+ */
754
+ public function callback_status( $status = 1 ) {
755
+ switch ( $status ) {
756
+ case 'deleted' :
757
+ $status = 'pending'; // bbp_get_pending_status_id()
758
+ break;
759
+
760
+ case 'visible' :
761
+ default :
762
+ $status = 'publish'; // bbp_get_public_status_id()
763
+ break;
764
+ }
765
+ return $status;
766
+ }
767
+
768
+ /**
769
+ * Translate the topic status from XenForo numerics to WordPress's strings.
770
+ *
771
+ * @param int $status XenForo numeric topic status
772
+ * @return string WordPress safe
773
+ */
774
+ public function callback_topic_status( $status = 1 ) {
775
+ switch ( $status ) {
776
+ case 0 :
777
+ $status = 'closed';
778
+ break;
779
+
780
+ case 1 :
781
+ default :
782
+ $status = 'publish';
783
+ break;
784
+ }
785
+ return $status;
786
+ }
787
+
788
+ /**
789
+ * Translate the topic sticky status type from XenForo numerics to WordPress's strings.
790
+ *
791
+ * @param int $status XenForo numeric forum type
792
+ * @return string WordPress safe
793
+ */
794
+ public function callback_sticky_status( $status = 0 ) {
795
+ switch ( $status ) {
796
+ case 1 :
797
+ $status = 'sticky'; // XenForo Sticky 'sticky = 1'
798
+ break;
799
+
800
+ case 0 :
801
+ default :
802
+ $status = 'normal'; // XenForo Normal Topic 'sticky = 0'
803
+ break;
804
+ }
805
+ return $status;
806
+ }
807
+
808
+ /**
809
+ * Verify the topic reply count.
810
+ *
811
+ * @param int $count XenForo reply count
812
+ * @return string WordPress safe
813
+ */
814
+ public function callback_topic_reply_count( $count = 1 ) {
815
+ $count = absint( (int) $count - 1 );
816
+ return $count;
817
+ }
818
+
819
+ /**
820
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
821
+ */
822
+ protected function callback_html( $field ) {
823
+
824
+ // Strips Xenforo custom HTML first from $field before parsing $field to parser.php
825
+ $xenforo_markup = $field;
826
+ $xenforo_markup = html_entity_decode( $xenforo_markup );
827
+
828
+ // Replace '[QUOTE]' with '<blockquote>'
829
+ $xenforo_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $xenforo_markup );
830
+ // Replace '[/QUOTE]' with '</blockquote>'
831
+ $xenforo_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $xenforo_markup );
832
+ // Replace '[QUOTE=User Name($1)]' with '<em>@$1 wrote:</em><blockquote>"
833
+ $xenforo_markup = preg_replace( '/\[quote=\"(.*?)\,\spost\:\s(.*?)\,\s\member\:\s(.*?)\"\](.*?)\[\/quote\]/', '<em>@$1 wrote:</em><blockquote>', $xenforo_markup );
834
+ // Replace '[/quote]' with '</blockquote>'
835
+ $xenforo_markup = preg_replace( '/\[\/quote\]/', '</blockquote>', $xenforo_markup );
836
+
837
+ // Replace '[media=youtube]$1[/media]' with '$1"
838
+ $xenforo_markup = preg_replace( '/\[media\=youtube\](.*?)\[\/media\]/', 'https://youtu.be/$1', $xenforo_markup );
839
+ // Replace '[media=dailymotion]$1[/media]' with '$1"
840
+ $xenforo_markup = preg_replace( '/\[media\=dailymotion\](.*?)\[\/media\]/', 'https://www.dailymotion.com/video/$1', $xenforo_markup );
841
+ // Replace '[media=vimeo]$1[/media]' with '$1"
842
+ $xenforo_markup = preg_replace( '/\[media\=vimeo\](.*?)\[\/media\]/', 'https://vimeo.com/$1', $xenforo_markup );
843
+
844
+ // Now that Xenforo custom HTML has been stripped put the cleaned HTML back in $field
845
+ $field = $xenforo_markup;
846
+
847
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
848
+ return parent::callback_html( $field );
849
+ }
850
+ }
includes/admin/converters/bbPress1.php CHANGED
@@ -1,21 +1,27 @@
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
 
11
  /**
12
  * Main constructor
13
  *
14
- * @uses bbPress1::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,14 +29,20 @@ class bbPress1 extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
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 +50,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 +131,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 +160,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 +254,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 +284,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 +347,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 +376,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 +468,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 +548,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',
@@ -552,7 +630,7 @@ class bbPress1 extends BBP_Converter_Base {
552
  }
553
 
554
  /**
555
- * Translate the post status from bbPress 1's numeric's to WordPress's
556
  * strings.
557
  *
558
  * @param int $status bbPress 1.x numeric post status
@@ -577,7 +655,7 @@ class bbPress1 extends BBP_Converter_Base {
577
  }
578
 
579
  /**
580
- * Translate the forum type from bbPress 1.x numeric's to WordPress's strings.
581
  *
582
  * @param int $status bbPress 1.x numeric forum type
583
  * @return string WordPress safe
@@ -592,7 +670,28 @@ class bbPress1 extends BBP_Converter_Base {
592
  }
593
 
594
  /**
595
- * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596
  *
597
  * @param int $status bbPress 1.x numeric forum type
598
  * @return string WordPress safe
@@ -626,17 +725,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
@@ -655,17 +743,17 @@ class bbPress1 extends BBP_Converter_Base {
655
  }
656
 
657
  /**
658
- * This callback:
 
 
659
  *
660
- * - turns off smiley parsing
661
- * - processes any custom parser.php attributes
662
- * - decodes necessary HTML entities
663
  */
664
- protected function callback_html( $field ) {
665
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
666
- $bbcode = BBCode::getInstance();
667
- $bbcode->enable_smileys = false;
668
- $bbcode->smiley_regex = false;
669
- return html_entity_decode( $bbcode->Parse( $field ) );
670
  }
671
  }
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
 
19
  /**
20
  * Main constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  public function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'forums',
43
  'from_fieldname' => 'forum_id',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0. Stored in postmeta)
50
  'from_tablename' => 'forums',
51
  'from_fieldname' => 'forum_parent',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum topic count (Stored in postmeta)
131
  'callback_method' => 'callback_forum_type'
132
  );
133
 
134
+ // Forum status (Set a default value 'open', Stored in postmeta)
135
+ $this->field_map[] = array(
136
+ 'to_type' => 'forum',
137
+ 'to_fieldname' => '_bbp_status',
138
+ 'default' => 'open'
139
+ );
140
+
141
  // Forum dates.
142
  $this->field_map[] = array(
143
  'to_type' => 'forum',
160
  'default' => date('Y-m-d H:i:s')
161
  );
162
 
163
+ /** Forum Subscriptions Section ***************************************/
164
+
165
+ /**
166
+ * bbPress 1.x Forums do not support forum subscriptions
167
+ */
168
+
169
  /** Topic Section *****************************************************/
170
 
171
+ // Old topic id (Stored in postmeta)
172
  $this->field_map[] = array(
173
  'from_tablename' => 'topics',
174
  'from_fieldname' => 'topic_id',
175
  'to_type' => 'topic',
176
+ 'to_fieldname' => '_bbp_old_topic_id'
177
  );
178
 
179
  // Topic reply count (Stored in postmeta)
254
  'callback_method' => 'callback_status'
255
  );
256
 
257
+ // Topic status (Publish or Closed to new replies)
258
+ $this->field_map[] = array(
259
+ 'from_tablename' => 'topics',
260
+ 'from_fieldname' => 'topic_open',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => '_bbp_old_closed_status_id',
263
+ 'callback_method' => 'callback_topic_status'
264
+ );
265
+
266
  // Topic author ip (Stored in postmeta)
267
  // Note: We join the 'posts' table because 'topics' table does not include author ip.
268
  $this->field_map[] = array(
284
  'callback_method' => 'callback_forumid'
285
  );
286
 
287
+ // Sticky status (Stored in postmeta)
288
  $this->field_map[] = array(
289
  'from_tablename' => 'topics',
290
  'from_fieldname' => 'topic_sticky',
291
  'to_type' => 'topic',
292
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
293
  'callback_method' => 'callback_sticky_status'
294
  );
295
 
347
  'to_fieldname' => 'taxonomy'
348
  );
349
 
350
+ // Term description.
351
+ $this->field_map[] = array(
352
+ 'from_tablename' => 'term_taxonomy',
353
+ 'from_fieldname' => 'description',
354
+ 'join_tablename' => 'term_relationships',
355
+ 'join_type' => 'INNER',
356
+ 'join_expression' => 'USING (term_taxonomy_id)',
357
+ 'to_type' => 'tags',
358
+ 'to_fieldname' => 'description',
359
+ 'callback_method' => 'callback_html'
360
+ );
361
+
362
  // Term text.
363
  $this->field_map[] = array(
364
  'from_tablename' => 'terms',
365
  'from_fieldname' => 'name',
366
  'join_tablename' => 'term_taxonomy',
367
  'join_type' => 'INNER',
368
+ 'join_expression' => 'USING (term_id) WHERE term_taxonomy.taxonomy = "bb_topic_tag"',
369
  'to_type' => 'tags',
370
  'to_fieldname' => 'name'
371
  );
376
  'from_fieldname' => 'slug',
377
  'join_tablename' => 'term_taxonomy',
378
  'join_type' => 'INNER',
379
+ 'join_expression' => 'USING (term_id) WHERE term_taxonomy.taxonomy = "bb_topic_tag"',
380
  'to_type' => 'tags',
381
  'to_fieldname' => 'slug',
382
  'callback_method' => 'callback_slug'
383
  );
384
 
385
+ /** Topic Subscriptions Section ***************************************/
386
+
387
+ // Subscribed user ID (Stored in usermeta)
388
+ $this->field_map[] = array(
389
+ 'from_tablename' => 'term_relationships',
390
+ 'from_fieldname' => 'user_id',
391
+ 'to_type' => 'topic_subscriptions',
392
+ 'to_fieldname' => 'user_id',
393
+ 'callback_method' => 'callback_userid'
394
+ );
395
+
396
+ // Join the 'term_taxonomy' table to link 'terms' 'term_relationships' tables
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'term_taxonomy',
399
+ 'from_fieldname' => 'term_taxonomy_id',
400
+ 'join_tablename' => 'term_relationships',
401
+ 'join_type' => 'INNER',
402
+ 'join_expression' => 'USING (term_taxonomy_id)',
403
+ 'to_type' => 'topic_subscriptions'
404
+ );
405
+
406
+ // Subscribed topic ID (Stored in usermeta)
407
+ $this->field_map[] = array(
408
+ 'from_tablename' => 'terms',
409
+ 'from_fieldname' => 'name',
410
+ 'join_tablename' => 'term_taxonomy',
411
+ 'join_type' => 'INNER',
412
+ 'join_expression' => 'USING (term_id) WHERE term_taxonomy.taxonomy = "bb_subscribe"',
413
+ 'to_type' => 'topic_subscriptions',
414
+ 'to_fieldname' => '_bbp_subscriptions',
415
+ 'callback_method' => 'callback_topic_subscriptions'
416
+ );
417
+
418
+ /** Favorites Section *************************************************/
419
+
420
+ // Favorited topic ID (Stored in usermeta)
421
+ $this->field_map[] = array(
422
+ 'from_tablename' => 'usermeta',
423
+ 'from_fieldname' => 'meta_value',
424
+ 'from_expression' => 'WHERE usermeta.meta_key = "bb_favorites"',
425
+ 'to_type' => 'favorites',
426
+ 'to_fieldname' => '_bbp_favorites'
427
+ );
428
+
429
+ // Favorited user ID (Stored in usermeta)
430
+ $this->field_map[] = array(
431
+ 'from_tablename' => 'usermeta',
432
+ 'from_fieldname' => 'user_id',
433
+ 'from_expression' => 'WHERE usermeta.meta_key = "bb_favorites"',
434
+ 'to_type' => 'favorites',
435
+ 'to_fieldname' => 'user_id',
436
+ 'callback_method' => 'callback_userid'
437
+ );
438
+
439
  /** Reply Section *****************************************************/
440
 
441
+ // Old reply id (Stored in postmeta)
442
  $this->field_map[] = array(
443
  'from_tablename' => 'posts',
444
  'from_fieldname' => 'post_id',
445
  'to_type' => 'reply',
446
+ 'to_fieldname' => '_bbp_old_reply_id'
447
  );
448
 
449
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
450
+ // Note: We join the 'topics' table to limit the replies section to only import replies
451
  $this->field_map[] = array(
452
+ 'from_tablename' => 'topics',
453
  'from_fieldname' => 'topic_id',
454
+ 'join_tablename' => 'posts',
455
+ 'join_type' => 'INNER',
456
+ 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0,1)',
457
  'to_type' => 'reply',
458
  'to_fieldname' => '_bbp_topic_id',
459
  'callback_method' => 'callback_topicid'
468
  'callback_method' => 'callback_forumid'
469
  );
470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  // Reply author ip (Stored in postmeta)
472
  $this->field_map[] = array(
473
  'from_tablename' => 'posts',
548
 
549
  /** User Section ******************************************************/
550
 
551
+ // Store old user id (Stored in usermeta)
552
  $this->field_map[] = array(
553
  'from_tablename' => 'users',
554
  'from_fieldname' => 'ID',
555
  'to_type' => 'user',
556
+ 'to_fieldname' => '_bbp_old_user_id'
557
  );
558
 
559
+ // Store old user password (Stored in usermeta)
560
  $this->field_map[] = array(
561
  'from_tablename' => 'users',
562
  'from_fieldname' => 'user_pass',
630
  }
631
 
632
  /**
633
+ * Translate the post status from bbPress 1's numerics to WordPress's
634
  * strings.
635
  *
636
  * @param int $status bbPress 1.x numeric post status
655
  }
656
 
657
  /**
658
+ * Translate the forum type from bbPress 1.x numerics to WordPress's strings.
659
  *
660
  * @param int $status bbPress 1.x numeric forum type
661
  * @return string WordPress safe
670
  }
671
 
672
  /**
673
+ * Translate the topic status from bbPress 1's numerics to WordPress's
674
+ * strings.
675
+ *
676
+ * @param int $topic_status bbPress 1.x numeric status
677
+ * @return string WordPress safe
678
+ */
679
+ public function callback_topic_status( $topic_status = 1 ) {
680
+ switch ( $topic_status ) {
681
+ case 0 :
682
+ $topic_status = 'closed'; // bbp_get_closed_status_id()
683
+ break;
684
+
685
+ case 1 :
686
+ default :
687
+ $topic_status = 'publish'; // bbp_get_public_status_id()
688
+ break;
689
+ }
690
+ return $topic_status;
691
+ }
692
+
693
+ /**
694
+ * Translate the topic sticky status type from bbPress 1.x numerics to WordPress's strings.
695
  *
696
  * @param int $status bbPress 1.x numeric forum type
697
  * @return string WordPress safe
725
  return $count;
726
  }
727
 
 
 
 
 
 
 
 
 
 
 
 
728
  /**
729
  * This method is to save the salt and password together. That
730
  * way when we authenticate it we can get it out of the database
743
  }
744
 
745
  /**
746
+ * This callback strips `topic-` from topic subscriptions taxonomy
747
+ *
748
+ * @since 2.6.0 bbPress (r5572)
749
  *
750
+ * @param string $field Topic ID
751
+ * @return integer WordPress safe
 
752
  */
753
+ protected function callback_topic_subscriptions( $field ) {
754
+
755
+ // Replace 'topic-' with '' so that only the original topic ID remains
756
+ $field = absint( (int) preg_replace( '/(topic-)(\d+)/', '$2', $field ) );
757
+ return $field;
 
758
  }
759
  }
includes/admin/converters/e107v1.php ADDED
@@ -0,0 +1,637 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ /**
28
+ * Sets up the field mappings
29
+ */
30
+ public function setup_globals() {
31
+
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
+ /** Forum Section *****************************************************/
39
+
40
+ // Old forum id (Stored in postmeta)
41
+ $this->field_map[] = array(
42
+ 'from_tablename' => 'forum',
43
+ 'from_fieldname' => 'forum_id',
44
+ 'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
+ );
47
+
48
+ // Forum parent id (If no parent, then 0, Stored in postmeta)
49
+ $this->field_map[] = array(
50
+ 'from_tablename' => 'forum',
51
+ 'from_fieldname' => 'forum_parent',
52
+ 'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
+ );
55
+
56
+ // Forum topic count (Stored in postmeta)
57
+ $this->field_map[] = array(
58
+ 'from_tablename' => 'forum',
59
+ 'from_fieldname' => 'forum_threads',
60
+ 'to_type' => 'forum',
61
+ 'to_fieldname' => '_bbp_topic_count'
62
+ );
63
+
64
+ // Forum reply count (Stored in postmeta)
65
+ $this->field_map[] = array(
66
+ 'from_tablename' => 'forum',
67
+ 'from_fieldname' => 'forum_replies',
68
+ 'to_type' => 'forum',
69
+ 'to_fieldname' => '_bbp_reply_count'
70
+ );
71
+
72
+ // Forum total topic count (Includes unpublished topics, Stored in postmeta)
73
+ $this->field_map[] = array(
74
+ 'from_tablename' => 'forum',
75
+ 'from_fieldname' => 'forum_threads',
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
+ $this->field_map[] = array(
82
+ 'from_tablename' => 'forum',
83
+ 'from_fieldname' => 'forum_replies',
84
+ 'to_type' => 'forum',
85
+ 'to_fieldname' => '_bbp_total_reply_count'
86
+ );
87
+
88
+ // Forum title.
89
+ $this->field_map[] = array(
90
+ 'from_tablename' => 'forum',
91
+ 'from_fieldname' => 'forum_name',
92
+ 'to_type' => 'forum',
93
+ 'to_fieldname' => 'post_title'
94
+ );
95
+
96
+ // Forum slug (Clean name to avoid conflicts)
97
+ $this->field_map[] = array(
98
+ 'from_tablename' => 'forum',
99
+ 'from_fieldname' => 'forum_name',
100
+ 'to_type' => 'forum',
101
+ 'to_fieldname' => 'post_name',
102
+ 'callback_method' => 'callback_slug'
103
+ );
104
+
105
+ // Forum description.
106
+ $this->field_map[] = array(
107
+ 'from_tablename' => 'forum',
108
+ 'from_fieldname' => 'forum_description',
109
+ 'to_type' => 'forum',
110
+ 'to_fieldname' => 'post_content',
111
+ 'callback_method' => 'callback_null'
112
+ );
113
+
114
+ // Forum display order (Starts from 1)
115
+ $this->field_map[] = array(
116
+ 'from_tablename' => 'forum',
117
+ 'from_fieldname' => 'forum_order',
118
+ 'to_type' => 'forum',
119
+ 'to_fieldname' => 'menu_order'
120
+ );
121
+
122
+ // Forum type (Category = 0 or Forum > 0, Stored in postmeta)
123
+ $this->field_map[] = array(
124
+ 'from_tablename' => 'forum',
125
+ 'from_fieldname' => 'forum_parent',
126
+ 'to_type' => 'forum',
127
+ 'to_fieldname' => '_bbp_forum_type',
128
+ 'callback_method' => 'callback_forum_type'
129
+ );
130
+
131
+ // Forum status (Set a default value 'open', Stored in postmeta)
132
+ $this->field_map[] = array(
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => '_bbp_status',
135
+ 'default' => 'open'
136
+ );
137
+
138
+ // Forum dates.
139
+ $this->field_map[] = array(
140
+ 'to_type' => 'forum',
141
+ 'to_fieldname' => 'post_date',
142
+ 'default' => date('Y-m-d H:i:s')
143
+ );
144
+ $this->field_map[] = array(
145
+ 'to_type' => 'forum',
146
+ 'to_fieldname' => 'post_date_gmt',
147
+ 'default' => date('Y-m-d H:i:s')
148
+ );
149
+ $this->field_map[] = array(
150
+ 'to_type' => 'forum',
151
+ 'to_fieldname' => 'post_modified',
152
+ 'default' => date('Y-m-d H:i:s')
153
+ );
154
+ $this->field_map[] = array(
155
+ 'to_type' => 'forum',
156
+ 'to_fieldname' => 'post_modified_gmt',
157
+ 'default' => date('Y-m-d H:i:s')
158
+ );
159
+
160
+ /** Topic Section *****************************************************/
161
+
162
+ // Old topic id (Stored in postmeta)
163
+ $this->field_map[] = array(
164
+ 'from_tablename' => 'forum_t',
165
+ 'from_fieldname' => 'thread_id',
166
+ 'from_expression' => 'WHERE thread_parent = 0',
167
+ 'to_type' => 'topic',
168
+ 'to_fieldname' => '_bbp_old_topic_id'
169
+ );
170
+
171
+ // Topic reply count (Stored in postmeta)
172
+ $this->field_map[] = array(
173
+ 'from_tablename' => 'forum_t',
174
+ 'from_fieldname' => 'thread_total_replies',
175
+ 'to_type' => 'topic',
176
+ 'to_fieldname' => '_bbp_reply_count',
177
+ 'callback_method' => 'callback_topic_reply_count'
178
+ );
179
+
180
+ // Topic total reply count (Includes unpublished replies, Stored in postmeta)
181
+ $this->field_map[] = array(
182
+ 'from_tablename' => 'forum_t',
183
+ 'from_fieldname' => 'thread_total_replies',
184
+ 'to_type' => 'topic',
185
+ 'to_fieldname' => '_bbp_total_reply_count',
186
+ 'callback_method' => 'callback_topic_reply_count'
187
+ );
188
+
189
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
190
+ $this->field_map[] = array(
191
+ 'from_tablename' => 'forum_t',
192
+ 'from_fieldname' => 'thread_forum_id',
193
+ 'to_type' => 'topic',
194
+ 'to_fieldname' => '_bbp_forum_id',
195
+ 'callback_method' => 'callback_forumid'
196
+ );
197
+
198
+ // Topic author.
199
+ // Note: Uses a custom callback to transform user id from '1.Administrator e107v1' to numeric user id.
200
+ $this->field_map[] = array(
201
+ 'from_tablename' => 'forum_t',
202
+ 'from_fieldname' => 'thread_user',
203
+ 'to_type' => 'topic',
204
+ 'to_fieldname' => 'post_author',
205
+ 'callback_method' => 'callback_e107v1_userid'
206
+ );
207
+
208
+ // Topic content.
209
+ $this->field_map[] = array(
210
+ 'from_tablename' => 'forum_t',
211
+ 'from_fieldname' => 'thread_thread',
212
+ 'to_type' => 'topic',
213
+ 'to_fieldname' => 'post_content',
214
+ 'callback_method' => 'callback_html'
215
+ );
216
+
217
+ // Topic title.
218
+ $this->field_map[] = array(
219
+ 'from_tablename' => 'forum_t',
220
+ 'from_fieldname' => 'thread_name',
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' => 'forum_t',
228
+ 'from_fieldname' => 'thread_name',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => 'post_name',
231
+ 'callback_method' => 'callback_slug'
232
+ );
233
+
234
+ // Topic status (Open or Closed, e107 v1.x open = 1 & closed = 0)
235
+ $this->field_map[] = array(
236
+ 'from_tablename' => 'forum_t',
237
+ 'from_fieldname' => 'thread_active',
238
+ 'to_type' => 'topic',
239
+ 'to_fieldname' => '_bbp_old_closed_status_id',
240
+ 'callback_method' => 'callback_topic_status'
241
+ );
242
+
243
+ // Topic parent forum id (If no parent, then 0)
244
+ $this->field_map[] = array(
245
+ 'from_tablename' => 'forum_t',
246
+ 'from_fieldname' => 'thread_forum_id',
247
+ 'to_type' => 'topic',
248
+ 'to_fieldname' => 'post_parent',
249
+ 'callback_method' => 'callback_forumid'
250
+ );
251
+
252
+ // Sticky status (Stored in postmeta)
253
+ $this->field_map[] = array(
254
+ 'from_tablename' => 'forum_t',
255
+ 'from_fieldname' => 'thread_s',
256
+ 'to_type' => 'topic',
257
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
258
+ 'callback_method' => 'callback_sticky_status'
259
+ );
260
+
261
+ // Topic dates.
262
+ $this->field_map[] = array(
263
+ 'from_tablename' => 'forum_t',
264
+ 'from_fieldname' => 'thread_datestamp',
265
+ 'to_type' => 'topic',
266
+ 'to_fieldname' => 'post_date',
267
+ 'callback_method' => 'callback_datetime'
268
+ );
269
+ $this->field_map[] = array(
270
+ 'from_tablename' => 'forum_t',
271
+ 'from_fieldname' => 'thread_datestamp',
272
+ 'to_type' => 'topic',
273
+ 'to_fieldname' => 'post_date_gmt',
274
+ 'callback_method' => 'callback_datetime'
275
+ );
276
+ $this->field_map[] = array(
277
+ 'from_tablename' => 'forum_t',
278
+ 'from_fieldname' => 'thread_datestamp',
279
+ 'to_type' => 'topic',
280
+ 'to_fieldname' => 'post_modified',
281
+ 'callback_method' => 'callback_datetime'
282
+ );
283
+ $this->field_map[] = array(
284
+ 'from_tablename' => 'forum_t',
285
+ 'from_fieldname' => 'thread_datestamp',
286
+ 'to_type' => 'topic',
287
+ 'to_fieldname' => 'post_modified_gmt',
288
+ 'callback_method' => 'callback_datetime'
289
+ );
290
+ $this->field_map[] = array(
291
+ 'from_tablename' => 'forum_t',
292
+ 'from_fieldname' => 'thread_datestamp',
293
+ 'to_type' => 'topic',
294
+ 'to_fieldname' => '_bbp_last_active_time',
295
+ 'callback_method' => 'callback_datetime'
296
+ );
297
+
298
+ /** Tags Section ******************************************************/
299
+
300
+ /**
301
+ * e107 v1.x Forums do not support topic tags out of the box
302
+ */
303
+
304
+ /** Reply Section *****************************************************/
305
+
306
+ // Old reply id (Stored in postmeta)
307
+ $this->field_map[] = array(
308
+ 'from_tablename' => 'forum_t',
309
+ 'from_fieldname' => 'thread_id',
310
+ 'from_expression' => 'WHERE thread_parent != 0',
311
+ 'to_type' => 'reply',
312
+ 'to_fieldname' => '_bbp_old_reply_id'
313
+ );
314
+
315
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
316
+ $this->field_map[] = array(
317
+ 'from_tablename' => 'forum_t',
318
+ 'from_fieldname' => 'thread_forum_id',
319
+ 'to_type' => 'reply',
320
+ 'to_fieldname' => '_bbp_forum_id',
321
+ 'callback_method' => 'callback_topicid_to_forumid'
322
+ );
323
+
324
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
325
+ $this->field_map[] = array(
326
+ 'from_tablename' => 'forum_t',
327
+ 'from_fieldname' => 'thread_parent',
328
+ 'to_type' => 'reply',
329
+ 'to_fieldname' => '_bbp_topic_id',
330
+ 'callback_method' => 'callback_topicid'
331
+ );
332
+
333
+ // Reply author.
334
+ // Note: Uses a custom callback to transform user id from '1.Administrator e107v1' to numeric user id.
335
+ $this->field_map[] = array(
336
+ 'from_tablename' => 'forum_t',
337
+ 'from_fieldname' => 'thread_user',
338
+ 'to_type' => 'reply',
339
+ 'to_fieldname' => 'post_author',
340
+ 'callback_method' => 'callback_e107v1_userid'
341
+ );
342
+
343
+ // Reply content.
344
+ $this->field_map[] = array(
345
+ 'from_tablename' => 'forum_t',
346
+ 'from_fieldname' => 'thread_thread',
347
+ 'to_type' => 'reply',
348
+ 'to_fieldname' => 'post_content',
349
+ 'callback_method' => 'callback_html'
350
+ );
351
+
352
+ // Reply parent topic id (If no parent, then 0)
353
+ $this->field_map[] = array(
354
+ 'from_tablename' => 'forum_t',
355
+ 'from_fieldname' => 'thread_parent',
356
+ 'to_type' => 'reply',
357
+ 'to_fieldname' => 'post_parent',
358
+ 'callback_method' => 'callback_topicid'
359
+ );
360
+
361
+ // Reply dates.
362
+ $this->field_map[] = array(
363
+ 'from_tablename' => 'forum_t',
364
+ 'from_fieldname' => 'thread_datestamp',
365
+ 'to_type' => 'reply',
366
+ 'to_fieldname' => 'post_date',
367
+ 'callback_method' => 'callback_datetime'
368
+ );
369
+ $this->field_map[] = array(
370
+ 'from_tablename' => 'forum_t',
371
+ 'from_fieldname' => 'thread_datestamp',
372
+ 'to_type' => 'reply',
373
+ 'to_fieldname' => 'post_date_gmt',
374
+ 'callback_method' => 'callback_datetime'
375
+ );
376
+ $this->field_map[] = array(
377
+ 'from_tablename' => 'forum_t',
378
+ 'from_fieldname' => 'thread_datestamp',
379
+ 'to_type' => 'reply',
380
+ 'to_fieldname' => 'post_modified',
381
+ 'callback_method' => 'callback_datetime'
382
+ );
383
+ $this->field_map[] = array(
384
+ 'from_tablename' => 'forum_t',
385
+ 'from_fieldname' => 'thread_datestamp',
386
+ 'to_type' => 'reply',
387
+ 'to_fieldname' => 'post_modified_gmt',
388
+ 'callback_method' => 'callback_datetime'
389
+ );
390
+
391
+ /** User Section ******************************************************/
392
+
393
+ // Store old user id (Stored in usermeta)
394
+ $this->field_map[] = array(
395
+ 'from_tablename' => 'user',
396
+ 'from_fieldname' => 'user_id',
397
+ 'to_type' => 'user',
398
+ 'to_fieldname' => '_bbp_old_user_id'
399
+ );
400
+
401
+ // Store old user password (Stored in usermeta serialized with salt)
402
+ $this->field_map[] = array(
403
+ 'from_tablename' => 'user',
404
+ 'from_fieldname' => 'user_password',
405
+ 'to_type' => 'user',
406
+ 'to_fieldname' => '_bbp_password',
407
+ 'callback_method' => 'callback_savepass'
408
+ );
409
+
410
+ // User password verify class (Stored in usermeta for verifying password)
411
+ $this->field_map[] = array(
412
+ 'to_type' => 'user',
413
+ 'to_fieldname' => '_bbp_class',
414
+ 'default' => 'e107v1'
415
+ );
416
+
417
+ // User name.
418
+ $this->field_map[] = array(
419
+ 'from_tablename' => 'user',
420
+ 'from_fieldname' => 'user_loginname',
421
+ 'to_type' => 'user',
422
+ 'to_fieldname' => 'user_login'
423
+ );
424
+
425
+ // User nice name.
426
+ $this->field_map[] = array(
427
+ 'from_tablename' => 'user',
428
+ 'from_fieldname' => 'user_loginname',
429
+ 'to_type' => 'user',
430
+ 'to_fieldname' => 'user_nicename'
431
+ );
432
+
433
+ // User email.
434
+ $this->field_map[] = array(
435
+ 'from_tablename' => 'user',
436
+ 'from_fieldname' => 'user_email',
437
+ 'to_type' => 'user',
438
+ 'to_fieldname' => 'user_email'
439
+ );
440
+
441
+ // User registered.
442
+ $this->field_map[] = array(
443
+ 'from_tablename' => 'user',
444
+ 'from_fieldname' => 'user_join',
445
+ 'to_type' => 'user',
446
+ 'to_fieldname' => 'user_registered',
447
+ 'callback_method' => 'callback_datetime'
448
+ );
449
+
450
+ // User display name.
451
+ $this->field_map[] = array(
452
+ 'from_tablename' => 'user',
453
+ 'from_fieldname' => 'user_name',
454
+ 'to_type' => 'user',
455
+ 'to_fieldname' => 'display_name'
456
+ );
457
+
458
+ // Store Signature (Stored in usermeta)
459
+ $this->field_map[] = array(
460
+ 'from_tablename' => 'user',
461
+ 'from_fieldname' => 'user_signature',
462
+ 'to_fieldname' => '_bbp_e107v1_user_sig',
463
+ 'to_type' => 'user',
464
+ 'callback_method' => 'callback_html'
465
+ );
466
+ }
467
+
468
+ /**
469
+ * This method allows us to indicates what is or is not converted for each
470
+ * converter.
471
+ */
472
+ public function info() {
473
+ return '';
474
+ }
475
+
476
+ /**
477
+ * This method is to save the salt and password together. That
478
+ * way when we authenticate it we can get it out of the database
479
+ * as one value. Array values are auto sanitized by WordPress.
480
+ */
481
+ public function callback_savepass( $field, $row ) {
482
+ $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
483
+ return $pass_array;
484
+ }
485
+
486
+ /**
487
+ * This method is to take the pass out of the database and compare
488
+ * to a pass the user has typed in.
489
+ */
490
+ public function authenticate_pass( $password, $serialized_pass ) {
491
+ $pass_array = unserialize( $serialized_pass );
492
+ return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
493
+ }
494
+
495
+ /**
496
+ * Translate the forum type from e107 v1.x numerics to WordPress's strings.
497
+ *
498
+ * @param int $status e107 v1.x numeric forum type
499
+ * @return string WordPress safe
500
+ */
501
+ public function callback_forum_type( $status = 0 ) {
502
+ if ( $status == 0 ) {
503
+ $status = 'category';
504
+ } else {
505
+ $status = 'forum';
506
+ }
507
+ return $status;
508
+ }
509
+
510
+ /**
511
+ * Translate the post status from e107 v1.x numerics to WordPress's strings.
512
+ *
513
+ * @param int $status e107 v1.x numeric topic status
514
+ * @return string WordPress safe
515
+ */
516
+ public function callback_topic_status( $status = 1 ) {
517
+ switch ( $status ) {
518
+ case 0 :
519
+ $status = 'closed';
520
+ break;
521
+
522
+ case 1 :
523
+ default :
524
+ $status = 'publish';
525
+ break;
526
+ }
527
+ return $status;
528
+ }
529
+
530
+ /**
531
+ * Translate the topic sticky status type from e107 v1.x numerics to WordPress's strings.
532
+ *
533
+ * @param int $status e107 v1.x numeric forum type
534
+ * @return string WordPress safe
535
+ */
536
+ public function callback_sticky_status( $status = 0 ) {
537
+ switch ( $status ) {
538
+ case 2 :
539
+ $status = 'super-sticky'; // e107 Announcement Sticky 'thread_s = 2'
540
+ break;
541
+
542
+ case 1 :
543
+ $status = 'sticky'; // e107 Sticky 'thread_s = 1'
544
+ break;
545
+
546
+ case 0 :
547
+ default :
548
+ $status = 'normal'; // e107 normal topic 'thread_s = 0'
549
+ break;
550
+ }
551
+ return $status;
552
+ }
553
+
554
+ /**
555
+ * Verify the topic/reply count.
556
+ *
557
+ * @param int $count e107 v1.x topic/reply counts
558
+ * @return string WordPress safe
559
+ */
560
+ public function callback_topic_reply_count( $count = 1 ) {
561
+ $count = absint( (int) $count - 1 );
562
+ return $count;
563
+ }
564
+
565
+ /**
566
+ * Override the `callback_user` function in 'converter.php' for custom e107v1 imports
567
+ *
568
+ * A mini cache system to reduce database calls to user ID's
569
+ *
570
+ * @param string $field
571
+ * @return string
572
+ */
573
+ protected function callback_e107v1_userid( $field ) {
574
+
575
+ // Strip only the user id from the topic and reply authors
576
+ $field = preg_replace( '/(\d+?)+\.[\S\s]+/', '$1', $field );
577
+
578
+ if ( ! isset( $this->map_userid[ $field ] ) ) {
579
+ if ( ! empty( $this->sync_table ) ) {
580
+ $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 ) );
581
+ } else {
582
+ $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 ) );
583
+ }
584
+
585
+ if ( ! is_null( $row ) ) {
586
+ $this->map_userid[ $field ] = $row->value_id;
587
+ } else {
588
+ if ( true === $this->convert_users ) {
589
+ $this->map_userid[ $field ] = 0;
590
+ } else {
591
+ $this->map_userid[ $field ] = $field;
592
+ }
593
+ }
594
+ }
595
+ return $this->map_userid[ $field ];
596
+ }
597
+
598
+ /**
599
+ * This callback processes any custom parser.php attributes and custom code with preg_replace
600
+ */
601
+ protected function callback_html( $field ) {
602
+
603
+ // Strips custom e107v1 'magic_url' and 'bbcode_uid' first from $field before parsing $field to parser.php
604
+ $e107v1_markup = $field;
605
+ $e107v1_markup = html_entity_decode( $e107v1_markup );
606
+
607
+ // Replace '[blockquote]' with '<blockquote>'
608
+ $e107v1_markup = preg_replace( '/\[blockquote\]/', '<blockquote>', $e107v1_markup );
609
+ // Replace '[/blockquote]' with '</blockquote>'
610
+ $e107v1_markup = preg_replace( '/\[\/blockquote\]/', '</blockquote>', $e107v1_markup );
611
+
612
+ // Replace '[quote$1=$2]' with '<em>$2 wrote:</em><blockquote>"
613
+ $e107v1_markup = preg_replace( '/\[quote(.*?)=(.*?)\]/', '<em>@$2 wrote:</em><blockquote>', $e107v1_markup );
614
+ // Replace '[/quote$1]' with '</blockquote>"
615
+ $e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/' , '</blockquote>', $e107v1_markup );
616
+
617
+ // Remove '[justify]'
618
+ $e107v1_markup = preg_replace( '/\[justify\]/', '', $e107v1_markup );
619
+ // Remove '[/justify]'
620
+ $e107v1_markup = preg_replace( '/\[\/justify\]/', '', $e107v1_markup );
621
+
622
+ // Replace '[link=(https|http)://$2]$3[/link]' with '<a href="$1://$2">$3</a>'
623
+ $e107v1_markup = preg_replace( '/\[link\=(https|http)\:\/\/(.*?)\](.*?)\[\/link\]/i', '<a href="$1://$2">$3</a>', $e107v1_markup );
624
+
625
+ // Replace '[list=(decimal|lower-roman|upper-roman|lower-alpha|upper-alpha)]' with '[list]'
626
+ $e107v1_markup = preg_replace( '/\[list\=(decimal|lower-roman|upper-roman|lower-alpha|upper-alpha)\]/i', '[list]', $e107v1_markup );
627
+
628
+ // Replace '[youtube]$1[/youtube]' with '$1"
629
+ $e107v1_markup = preg_replace( '/\[youtube\](.*?)\[\/youtube\]/', 'https://youtu.be/$1', $e107v1_markup );
630
+
631
+ // Now that e107v1 custom HTML has been stripped put the cleaned HTML back in $field
632
+ $field = $e107v1_markup;
633
+
634
+ // Parse out any bbCodes in $field with the BBCode 'parser.php'
635
+ return parent::callback_html( $field );
636
+ }
637
+ }
includes/admin/converters/phpBB.php CHANGED
@@ -1,21 +1,27 @@
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
 
11
  /**
12
  * Main Constructor
13
  *
14
- * @uses phpBB::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,14 +29,20 @@ class phpBB extends BBP_Converter_Base {
23
  */
24
  public function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
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 +50,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 +64,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 +72,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 +80,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 +159,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 +200,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 +224,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 +287,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 +300,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 +339,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 +352,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 +416,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 +445,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 +512,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 +530,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 +563,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 +581,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 +688,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 +732,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
  */
@@ -651,8 +780,7 @@ class phpBB extends BBP_Converter_Base {
651
  */
652
  if ( floatval( phpversion() ) >= 5 ) {
653
  $hash = md5( $salt . $password, true );
654
- do
655
- {
656
  $hash = md5( $hash . $password, true );
657
  }
658
  while ( --$count );
@@ -678,11 +806,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 +820,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];
@@ -708,7 +836,7 @@ class phpBB extends BBP_Converter_Base {
708
  }
709
 
710
  /**
711
- * Translate the forum type from phpBB v3.x numeric's to WordPress's strings.
712
  *
713
  * @param int $status phpBB v3.x numeric forum type
714
  * @return string WordPress safe
@@ -728,7 +856,7 @@ class phpBB extends BBP_Converter_Base {
728
  }
729
 
730
  /**
731
- * Translate the forum status from phpBB v3.x numeric's to WordPress's strings.
732
  *
733
  * @param int $status phpBB v3.x numeric forum status
734
  * @return string WordPress safe
@@ -748,7 +876,7 @@ class phpBB extends BBP_Converter_Base {
748
  }
749
 
750
  /**
751
- * Translate the topic status from phpBB v3.x numeric's to WordPress's strings.
752
  *
753
  * @param int $status phpBB v3.x numeric topic status
754
  * @return string WordPress safe
@@ -768,7 +896,7 @@ class phpBB extends BBP_Converter_Base {
768
  }
769
 
770
  /**
771
- * Translate the topic sticky status type from phpBB 3.x numeric's to WordPress's strings.
772
  *
773
  * @param int $status phpBB 3.x numeric forum type
774
  * @return string WordPress safe
@@ -806,17 +934,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
  */
@@ -905,10 +1022,6 @@ class phpBB extends BBP_Converter_Base {
905
  $field = $phpbb_uid;
906
 
907
  // Parse out any bbCodes in $field with the BBCode 'parser.php'
908
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
909
- $bbcode = BBCode::getInstance();
910
- $bbcode->enable_smileys = false;
911
- $bbcode->smiley_regex = false;
912
- return html_entity_decode( $bbcode->Parse( $field ) );
913
  }
914
  }
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
 
19
  /**
20
  * Main Constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  public function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'forums',
43
  'from_fieldname' => 'forum_id',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0, Stored in postmeta)
50
  'from_tablename' => 'forums',
51
  'from_fieldname' => 'parent_id',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum topic count (Stored in postmeta)
57
  $this->field_map[] = array(
58
  'from_tablename' => 'forums',
59
+ 'from_fieldname' => 'forum_topics_approved',
60
  'to_type' => 'forum',
61
  'to_fieldname' => '_bbp_topic_count'
62
  );
64
  // Forum reply count (Stored in postmeta)
65
  $this->field_map[] = array(
66
  'from_tablename' => 'forums',
67
+ 'from_fieldname' => 'forum_posts_approved',
68
  'to_type' => 'forum',
69
  'to_fieldname' => '_bbp_reply_count'
70
  );
72
  // Forum total topic count (Includes unpublished topics, Stored in postmeta)
73
  $this->field_map[] = array(
74
  'from_tablename' => 'forums',
75
+ 'from_fieldname' => 'forum_topics_approved',
76
  'to_type' => 'forum',
77
  'to_fieldname' => '_bbp_total_topic_count'
78
  );
80
  // Forum total reply count (Includes unpublished replies, Stored in postmeta)
81
  $this->field_map[] = array(
82
  'from_tablename' => 'forums',
83
+ 'from_fieldname' => 'forum_posts_approved',
84
  'to_type' => 'forum',
85
  'to_fieldname' => '_bbp_total_reply_count'
86
  );
159
  'default' => date('Y-m-d H:i:s')
160
  );
161
 
162
+ /** Forum Subscriptions Section ***************************************/
163
+
164
+ // Subscribed forum ID (Stored in usermeta)
165
+ $this->field_map[] = array(
166
+ 'from_tablename' => 'forums_watch',
167
+ 'from_fieldname' => 'forum_id',
168
+ 'to_type' => 'forum_subscriptions',
169
+ 'to_fieldname' => '_bbp_forum_subscriptions'
170
+ );
171
+
172
+ // Subscribed user ID (Stored in usermeta)
173
+ $this->field_map[] = array(
174
+ 'from_tablename' => 'forums_watch',
175
+ 'from_fieldname' => 'user_id',
176
+ 'to_type' => 'forum_subscriptions',
177
+ 'to_fieldname' => 'user_id',
178
+ 'callback_method' => 'callback_userid'
179
+ );
180
+
181
  /** Topic Section *****************************************************/
182
 
183
+ // Old topic id (Stored in postmeta)
184
  $this->field_map[] = array(
185
  'from_tablename' => 'topics',
186
  'from_fieldname' => 'topic_id',
187
  'to_type' => 'topic',
188
+ 'to_fieldname' => '_bbp_old_topic_id'
189
  );
190
 
191
  // Topic reply count (Stored in postmeta)
192
  $this->field_map[] = array(
193
  'from_tablename' => 'topics',
194
+ 'from_fieldname' => 'topic_posts_approved',
195
  'to_type' => 'topic',
196
  'to_fieldname' => '_bbp_reply_count',
197
  'callback_method' => 'callback_topic_reply_count'
200
  // Topic total reply count (Includes unpublished replies, Stored in postmeta)
201
  $this->field_map[] = array(
202
  'from_tablename' => 'topics',
203
+ 'from_fieldname' => 'topic_posts_approved',
204
  'to_type' => 'topic',
205
  'to_fieldname' => '_bbp_total_reply_count',
206
  'callback_method' => 'callback_topic_reply_count'
224
  'callback_method' => 'callback_userid'
225
  );
226
 
227
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
228
+ $this->field_map[] = array(
229
+ 'from_tablename' => 'topics',
230
+ 'from_fieldname' => 'topic_first_poster_name',
231
+ 'to_type' => 'topic',
232
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
233
+ );
234
+
235
+ // Is the topic anonymous (Stored in postmeta)
236
+ $this->field_map[] = array(
237
+ 'from_tablename' => 'topics',
238
+ 'from_fieldname' => 'topic_poster',
239
+ 'to_type' => 'topic',
240
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
241
+ 'callback_method' => 'callback_check_anonymous'
242
+ );
243
+
244
  // Topic Author ip (Stored in postmeta)
245
  $this->field_map[] = array(
246
  'from_tablename' => 'posts',
287
  'from_tablename' => 'topics',
288
  'from_fieldname' => 'topic_status',
289
  'to_type' => 'topic',
290
+ 'to_fieldname' => '_bbp_old_closed_status_id',
291
  'callback_method' => 'callback_topic_status'
292
  );
293
 
300
  'callback_method' => 'callback_forumid'
301
  );
302
 
303
+ // Sticky status (Stored in postmeta)
304
  $this->field_map[] = array(
305
  'from_tablename' => 'topics',
306
  'from_fieldname' => 'topic_type',
307
  'to_type' => 'topic',
308
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
309
  'callback_method' => 'callback_sticky_status'
310
  );
311
 
339
  'callback_method' => 'callback_datetime'
340
  );
341
  $this->field_map[] = array(
342
+ 'from_tablename' => 'topics',
343
+ 'from_fieldname' => 'topic_last_post_time',
344
+ 'to_type' => 'topic',
345
+ 'to_fieldname' => '_bbp_last_active_time',
346
  'callback_method' => 'callback_datetime'
347
  );
348
 
352
  * phpBB Forums do not support topic tags
353
  */
354
 
355
+ /** Topic Subscriptions Section ***************************************/
356
+
357
+ // Subscribed topic ID (Stored in usermeta)
358
+ $this->field_map[] = array(
359
+ 'from_tablename' => 'topics_watch',
360
+ 'from_fieldname' => 'topic_id',
361
+ 'to_type' => 'topic_subscriptions',
362
+ 'to_fieldname' => '_bbp_subscriptions'
363
+ );
364
+
365
+ // Subscribed user ID (Stored in usermeta)
366
+ $this->field_map[] = array(
367
+ 'from_tablename' => 'topics_watch',
368
+ 'from_fieldname' => 'user_id',
369
+ 'to_type' => 'topic_subscriptions',
370
+ 'to_fieldname' => 'user_id',
371
+ 'callback_method' => 'callback_userid'
372
+ );
373
+
374
+ /** Favorites Section *************************************************/
375
+
376
+ // Favorited topic ID (Stored in usermeta)
377
+ $this->field_map[] = array(
378
+ 'from_tablename' => 'bookmarks',
379
+ 'from_fieldname' => 'topic_id',
380
+ 'to_type' => 'favorites',
381
+ 'to_fieldname' => '_bbp_favorites'
382
+ );
383
+
384
+ // Favorited user ID (Stored in usermeta)
385
+ $this->field_map[] = array(
386
+ 'from_tablename' => 'bookmarks',
387
+ 'from_fieldname' => 'user_id',
388
+ 'to_type' => 'favorites',
389
+ 'to_fieldname' => 'user_id',
390
+ 'callback_method' => 'callback_userid'
391
+ );
392
+
393
  /** Reply Section *****************************************************/
394
 
395
+ // Old reply id (Stored in postmeta)
396
  $this->field_map[] = array(
397
  'from_tablename' => 'posts',
398
  'from_fieldname' => 'post_id',
399
  'to_type' => 'reply',
400
+ 'to_fieldname' => '_bbp_old_reply_id'
401
  );
402
 
403
  // Setup reply section table joins
416
  'from_fieldname' => 'forum_id',
417
  'to_type' => 'reply',
418
  'to_fieldname' => '_bbp_forum_id',
419
+ 'callback_method' => 'callback_forumid'
420
  );
421
 
422
  // Reply parent topic id (If no parent, then 0. Stored in postmeta)
445
  'callback_method' => 'callback_userid'
446
  );
447
 
448
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
449
  $this->field_map[] = array(
450
  'from_tablename' => 'posts',
451
+ 'from_fieldname' => 'post_username',
452
  'to_type' => 'reply',
453
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
 
454
  );
455
 
456
+ // Is the reply anonymous (Stored in postmeta)
457
  $this->field_map[] = array(
458
  'from_tablename' => 'posts',
459
+ 'from_fieldname' => 'poster_id',
460
  'to_type' => 'reply',
461
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
462
+ 'callback_method' => 'callback_check_anonymous'
463
  );
464
 
465
  // Reply content.
512
 
513
  /** User Section ******************************************************/
514
 
515
+ // Store old user id (Stored in usermeta)
516
+ // Don't import users with id 2, these are phpBB bot/crawler accounts
517
  $this->field_map[] = array(
518
+ 'from_tablename' => 'users',
519
+ 'from_fieldname' => 'user_id',
520
+ 'to_type' => 'user',
521
+ 'to_fieldname' => '_bbp_old_user_id'
522
  );
523
 
524
+ // Store old user password (Stored in usermeta serialized with salt)
525
  $this->field_map[] = array(
526
  'from_tablename' => 'users',
527
  'from_fieldname' => 'user_password',
530
  'callback_method' => 'callback_savepass'
531
  );
532
 
533
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
534
  $this->field_map[] = array(
535
  'from_tablename' => 'users',
536
  'from_fieldname' => 'user_form_salt',
563
 
564
  // User homepage.
565
  $this->field_map[] = array(
566
+ 'from_tablename' => 'profile_fields_data',
567
+ 'from_fieldname' => 'pf_phpbb_website',
568
+ 'join_tablename' => 'users',
569
+ 'join_type' => 'LEFT',
570
+ 'join_expression' => 'USING (user_id) WHERE users.user_type !=2',
571
+ 'to_type' => 'user',
572
+ 'to_fieldname' => 'user_url'
573
  );
574
 
575
  // User registered.
581
  'callback_method' => 'callback_datetime'
582
  );
583
 
584
+ // User AOL/AIM (Stored in usermeta)
585
  $this->field_map[] = array(
586
+ 'from_tablename' => 'profile_fields_data',
587
+ 'from_fieldname' => 'pf_phpbb_aol',
588
  'to_type' => 'user',
589
+ 'to_fieldname' => '_bbp_phpbb_user_aim'
590
  );
591
 
592
  // User Yahoo (Stored in usermeta)
593
  $this->field_map[] = array(
594
+ 'from_tablename' => 'profile_fields_data',
595
+ 'from_fieldname' => 'pf_phpbb_yahoo',
596
  'to_type' => 'user',
597
+ 'to_fieldname' => '_bbp_phpbb_user_yim'
598
  );
599
 
600
  // Store ICQ (Stored in usermeta)
601
  $this->field_map[] = array(
602
+ 'from_tablename' => 'profile_fields_data',
603
+ 'from_fieldname' => 'pf_phpbb_icq',
604
  'to_type' => 'user',
605
  'to_fieldname' => '_bbp_phpbb_user_icq'
606
  );
607
 
608
+ // Store MSN/WLM (Stored in usermeta)
609
  $this->field_map[] = array(
610
+ 'from_tablename' => 'profile_fields_data',
611
+ 'from_fieldname' => 'pf_phpbb_wlm',
612
  'to_type' => 'user',
613
  'to_fieldname' => '_bbp_phpbb_user_msnm'
614
  );
615
 
616
+ // Store Facebook (Stored in usermeta)
617
+ $this->field_map[] = array(
618
+ 'from_tablename' => 'profile_fields_data',
619
+ 'from_fieldname' => 'pf_phpbb_facebook',
620
+ 'to_type' => 'user',
621
+ 'to_fieldname' => '_bbp_phpbb_user_facebook'
622
+ );
623
+
624
+ // Store Google+ (Stored in usermeta)
625
+ $this->field_map[] = array(
626
+ 'from_tablename' => 'profile_fields_data',
627
+ 'from_fieldname' => 'pf_phpbb_googleplus',
628
+ 'to_type' => 'user',
629
+ 'to_fieldname' => '_bbp_phpbb_user_googleplus'
630
+ );
631
+
632
+ // Store Skype (Stored in usermeta)
633
+ $this->field_map[] = array(
634
+ 'from_tablename' => 'profile_fields_data',
635
+ 'from_fieldname' => 'pf_phpbb_skype',
636
+ 'to_type' => 'user',
637
+ 'to_fieldname' => '_bbp_phpbb_user_skype'
638
+ );
639
+
640
+ // Store Twitter (Stored in usermeta)
641
+ $this->field_map[] = array(
642
+ 'from_tablename' => 'profile_fields_data',
643
+ 'from_fieldname' => 'pf_phpbb_twitter',
644
+ 'to_type' => 'user',
645
+ 'to_fieldname' => '_bbp_phpbb_user_twitter'
646
+ );
647
+
648
+ // Store Youtube (Stored in usermeta)
649
+ $this->field_map[] = array(
650
+ 'from_tablename' => 'profile_fields_data',
651
+ 'from_fieldname' => 'pf_phpbb_youtube',
652
+ 'to_type' => 'user',
653
+ 'to_fieldname' => '_bbp_phpbb_user_youtube'
654
+ );
655
+
656
  // Store Jabber
657
  $this->field_map[] = array(
658
  'from_tablename' => 'users',
659
  'from_fieldname' => 'user_jabber',
660
  'to_type' => 'user',
661
+ 'to_fieldname' => '_bbp_phpbb_user_jabber'
662
  );
663
 
664
  // Store Occupation (Stored in usermeta)
665
  $this->field_map[] = array(
666
+ 'from_tablename' => 'profile_fields_data',
667
+ 'from_fieldname' => 'pf_phpbb_occupation',
668
  'to_type' => 'user',
669
  'to_fieldname' => '_bbp_phpbb_user_occ'
670
  );
671
 
672
  // Store Interests (Stored in usermeta)
673
  $this->field_map[] = array(
674
+ 'from_tablename' => 'profile_fields_data',
675
+ 'from_fieldname' => 'pf_phpbb_interests',
676
  'to_type' => 'user',
677
  'to_fieldname' => '_bbp_phpbb_user_interests'
678
  );
688
 
689
  // Store Location (Stored in usermeta)
690
  $this->field_map[] = array(
691
+ 'from_tablename' => 'profile_fields_data',
692
+ 'from_fieldname' => 'pf_phpbb_location',
693
  'to_type' => 'user',
694
  'to_fieldname' => '_bbp_phpbb_user_from'
695
  );
732
  * @param string $hash The stored password hash
733
  *
734
  * @link Original source for password functions http://openwall.com/phpass/
735
+ * @link phpass is now included in WP Core https://core.trac.wordpress.org/browser/trunk/wp-includes/class-phpass.php
736
  *
737
  * @return bool Returns true if the password is correct, false if not.
738
  */
780
  */
781
  if ( floatval( phpversion() ) >= 5 ) {
782
  $hash = md5( $salt . $password, true );
783
+ do {
 
784
  $hash = md5( $hash . $password, true );
785
  }
786
  while ( --$count );
806
  $i = 0;
807
 
808
  do {
809
+ $value = ord( $input[ $i++ ] );
810
+ $output .= $itoa64[ $value & 0x3f ];
811
 
812
  if ($i < $count) {
813
+ $value |= ord( $input[ $i ] ) << 8;
814
  }
815
 
816
  $output .= $itoa64[( $value >> 6 ) & 0x3f];
820
  }
821
 
822
  if ( $i < $count ) {
823
+ $value |= ord( $input[ $i ] ) << 16;
824
  }
825
 
826
  $output .= $itoa64[( $value >> 12 ) & 0x3f];
836
  }
837
 
838
  /**
839
+ * Translate the forum type from phpBB v3.x numerics to WordPress's strings.
840
  *
841
  * @param int $status phpBB v3.x numeric forum type
842
  * @return string WordPress safe
856
  }
857
 
858
  /**
859
+ * Translate the forum status from phpBB v3.x numerics to WordPress's strings.
860
  *
861
  * @param int $status phpBB v3.x numeric forum status
862
  * @return string WordPress safe
876
  }
877
 
878
  /**
879
+ * Translate the topic status from phpBB v3.x numerics to WordPress's strings.
880
  *
881
  * @param int $status phpBB v3.x numeric topic status
882
  * @return string WordPress safe
896
  }
897
 
898
  /**
899
+ * Translate the topic sticky status type from phpBB 3.x numerics to WordPress's strings.
900
  *
901
  * @param int $status phpBB 3.x numeric forum type
902
  * @return string WordPress safe
934
  return $count;
935
  }
936
 
 
 
 
 
 
 
 
 
 
 
 
937
  /**
938
  * This callback processes any custom parser.php attributes and custom code with preg_replace
939
  */
1022
  $field = $phpbb_uid;
1023
 
1024
  // Parse out any bbCodes in $field with the BBCode 'parser.php'
1025
+ return parent::callback_html( $field );
 
 
 
 
1026
  }
1027
  }
includes/admin/converters/vBulletin.php CHANGED
@@ -1,21 +1,27 @@
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
 
11
  /**
12
  * Main constructor
13
  *
14
- * @uses vBulletin::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,14 +29,20 @@ class vBulletin extends BBP_Converter_Base {
23
  */
24
  private function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
30
  'from_tablename' => 'forum',
31
  'from_fieldname' => 'forumid',
32
  'to_type' => 'forum',
33
- 'to_fieldname' => '_bbp_forum_id'
34
  );
35
 
36
  // Forum parent id (If no parent, then 0. Stored in postmeta)
@@ -38,7 +50,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 +128,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 +157,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 +222,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 +295,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 +387,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 +452,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 +519,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 +536,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 +589,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 +597,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)
@@ -593,7 +655,7 @@ class vBulletin extends BBP_Converter_Base {
593
  }
594
 
595
  /**
596
- * Translate the forum type from vBulletin v4.x numeric's to WordPress's strings.
597
  *
598
  * @param int $status vBulletin v4.x numeric forum type
599
  * @return string WordPress safe
@@ -608,7 +670,7 @@ class vBulletin extends BBP_Converter_Base {
608
  }
609
 
610
  /**
611
- * Translate the topic sticky status type from vBulletin v4.x numeric's to WordPress's strings.
612
  *
613
  * @param int $status vBulletin v4.x numeric forum type
614
  * @return string WordPress safe
@@ -643,18 +705,7 @@ class vBulletin extends BBP_Converter_Base {
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
  *
659
  * @param int $status vBulletin v4.x numeric topic status
660
  * @return string WordPress safe
@@ -685,7 +736,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,15 +744,13 @@ 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;
699
 
700
  // Parse out any bbCodes in $field with the BBCode 'parser.php'
701
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
702
- $bbcode = BBCode::getInstance();
703
- $bbcode->enable_smileys = false;
704
- $bbcode->smiley_regex = false;
705
- return html_entity_decode( $bbcode->Parse( $field ) );
706
  }
707
  }
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
 
19
  /**
20
  * Main constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  private function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'forum',
43
  'from_fieldname' => 'forumid',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0. Stored in postmeta)
50
  'from_tablename' => 'forum',
51
  'from_fieldname' => 'parentid',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum topic count (Stored in postmeta)
128
  'callback_method' => 'callback_forum_type'
129
  );
130
 
131
+ // Forum status (Set a default value 'open', Stored in postmeta)
132
+ $this->field_map[] = array(
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => '_bbp_status',
135
+ 'default' => 'open'
136
+ );
137
+
138
  // Forum dates.
139
  $this->field_map[] = array(
140
  'to_type' => 'forum',
157
  'default' => date( 'Y-m-d H:i:s' )
158
  );
159
 
160
+ /** Forum Subscriptions Section ***************************************/
161
+
162
+ // Subscribed forum ID (Stored in usermeta)
163
+ $this->field_map[] = array(
164
+ 'from_tablename' => 'subscribeforum',
165
+ 'from_fieldname' => 'forumid',
166
+ 'to_type' => 'forum_subscriptions',
167
+ 'to_fieldname' => '_bbp_forum_subscriptions'
168
+ );
169
+
170
+ // Subscribed user ID (Stored in usermeta)
171
+ $this->field_map[] = array(
172
+ 'from_tablename' => 'subscribeforum',
173
+ 'from_fieldname' => 'userid',
174
+ 'to_type' => 'forum_subscriptions',
175
+ 'to_fieldname' => 'user_id',
176
+ 'callback_method' => 'callback_userid'
177
+ );
178
+
179
  /** Topic Section *****************************************************/
180
 
181
+ // Old topic id (Stored in postmeta)
182
  $this->field_map[] = array(
183
  'from_tablename' => 'thread',
184
  'from_fieldname' => 'threadid',
185
  'to_type' => 'topic',
186
+ 'to_fieldname' => '_bbp_old_topic_id'
187
  );
188
 
189
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
222
  'callback_method' => 'callback_userid'
223
  );
224
 
225
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'thread',
228
+ 'from_fieldname' => 'postusername',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
231
+ );
232
+
233
+ // Is the topic anonymous (Stored in postmeta)
234
+ $this->field_map[] = array(
235
+ 'from_tablename' => 'thread',
236
+ 'from_fieldname' => 'postuserid',
237
+ 'to_type' => 'topic',
238
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
239
+ 'callback_method' => 'callback_check_anonymous'
240
+ );
241
+
242
  // Topic Author ip (Stored in postmeta)
243
  // Note: We join the 'post' table because 'thread' table does not include topic content.
244
  $this->field_map[] = array(
295
  'from_tablename' => 'thread',
296
  'from_fieldname' => 'open',
297
  'to_type' => 'topic',
298
+ 'to_fieldname' => '_bbp_old_closed_status_id',
299
  'callback_method' => 'callback_topic_status'
300
  );
301
 
302
+ // Sticky status (Stored in postmeta)
303
  $this->field_map[] = array(
304
  'from_tablename' => 'thread',
305
  'from_fieldname' => 'sticky',
306
  'to_type' => 'topic',
307
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
308
  'callback_method' => 'callback_sticky_status'
309
  );
310
 
387
  'callback_method' => 'callback_slug'
388
  );
389
 
390
+ /** Topic Subscriptions Section ***************************************/
391
+
392
+ // Subscribed topic ID (Stored in usermeta)
393
+ $this->field_map[] = array(
394
+ 'from_tablename' => 'subscribethread',
395
+ 'from_fieldname' => 'threadid',
396
+ 'to_type' => 'topic_subscriptions',
397
+ 'to_fieldname' => '_bbp_subscriptions'
398
+ );
399
+
400
+ // Subscribed user ID (Stored in usermeta)
401
+ $this->field_map[] = array(
402
+ 'from_tablename' => 'subscribethread',
403
+ 'from_fieldname' => 'userid',
404
+ 'to_type' => 'topic_subscriptions',
405
+ 'to_fieldname' => 'user_id',
406
+ 'callback_method' => 'callback_userid'
407
+ );
408
+
409
  /** Reply Section *****************************************************/
410
 
411
+ // Old reply id (Stored in postmeta)
412
  $this->field_map[] = array(
413
  'from_tablename' => 'post',
414
  'from_fieldname' => 'postid',
415
  'to_type' => 'reply',
416
+ 'to_fieldname' => '_bbp_old_reply_id'
417
  );
418
 
419
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
 
420
  $this->field_map[] = array(
421
+ 'from_tablename' => 'post',
422
+ 'from_fieldname' => 'threadid',
423
+ 'from_expression' => 'WHERE parentid != 0',
 
 
424
  'to_type' => 'reply',
425
  'to_fieldname' => '_bbp_forum_id',
426
  'callback_method' => 'callback_topicid_to_forumid'
452
  'callback_method' => 'callback_userid'
453
  );
454
 
455
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
 
456
  $this->field_map[] = array(
457
+ 'from_tablename' => 'post',
458
+ 'from_fieldname' => 'username',
 
 
 
459
  'to_type' => 'reply',
460
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
461
+ );
462
+
463
+ // Is the reply anonymous (Stored in postmeta)
464
+ $this->field_map[] = array(
465
+ 'from_tablename' => 'post',
466
+ 'from_fieldname' => 'userid',
467
+ 'to_type' => 'reply',
468
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
469
+ 'callback_method' => 'callback_check_anonymous'
470
+ );
 
 
 
 
 
471
 
472
  // Reply content.
473
  $this->field_map[] = array(
519
 
520
  /** User Section ******************************************************/
521
 
522
+ // Store old user id (Stored in usermeta)
523
  $this->field_map[] = array(
524
  'from_tablename' => 'user',
525
  'from_fieldname' => 'userid',
526
  'to_type' => 'user',
527
+ 'to_fieldname' => '_bbp_old_user_id'
528
  );
529
 
530
+ // Store old user password (Stored in usermeta serialized with salt)
531
  $this->field_map[] = array(
532
  'from_tablename' => 'user',
533
  'from_fieldname' => 'password',
536
  'callback_method' => 'callback_savepass'
537
  );
538
 
539
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
540
  $this->field_map[] = array(
541
  'from_tablename' => 'user',
542
  'from_fieldname' => 'salt',
589
  'from_tablename' => 'user',
590
  'from_fieldname' => 'aim',
591
  'to_type' => 'user',
592
+ 'to_fieldname' => '_bbp_vbulletin_user_aim'
593
  );
594
 
595
  // User Yahoo (Stored in usermeta)
597
  'from_tablename' => 'user',
598
  'from_fieldname' => 'yahoo',
599
  'to_type' => 'user',
600
+ 'to_fieldname' => '_bbp_vbulletin_user_yim'
601
  );
602
 
603
  // User ICQ (Stored in usermeta)
655
  }
656
 
657
  /**
658
+ * Translate the forum type from vBulletin v4.x numerics to WordPress's strings.
659
  *
660
  * @param int $status vBulletin v4.x numeric forum type
661
  * @return string WordPress safe
670
  }
671
 
672
  /**
673
+ * Translate the topic sticky status type from vBulletin v4.x numerics to WordPress's strings.
674
  *
675
  * @param int $status vBulletin v4.x numeric forum type
676
  * @return string WordPress safe
705
  }
706
 
707
  /**
708
+ * Translate the post status from vBulletin numerics to WordPress's strings.
 
 
 
 
 
 
 
 
 
 
 
709
  *
710
  * @param int $status vBulletin v4.x numeric topic status
711
  * @return string WordPress safe
736
  // Replace '[QUOTE]' with '<blockquote>'
737
  $vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup );
738
  // Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>"
739
+ $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/', '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
740
  // Replace '[/QUOTE]' with '</blockquote>'
741
  $vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup );
742
  // Replace '[MENTION=###($1)]User Name($2)[/MENTION]' with '@$2"
744
 
745
  // Replace '[video=youtube;$1]$2[/video]' with '$2"
746
  $vbulletin_markup = preg_replace( '/\[video\=youtube;(.*?)\](.*?)\[\/video\]/', '$2', $vbulletin_markup );
747
+ // Replace '[video=youtube_share;$1]$2[/video]' with '$2"
748
+ $vbulletin_markup = preg_replace( '/\[video\=youtube_share;(.*?)\](.*?)\[\/video\]/', '$2', $vbulletin_markup );
749
 
750
  // Now that vBulletin custom HTML has been stripped put the cleaned HTML back in $field
751
  $field = $vbulletin_markup;
752
 
753
  // Parse out any bbCodes in $field with the BBCode 'parser.php'
754
+ return parent::callback_html( $field );
 
 
 
 
755
  }
756
  }
includes/admin/converters/vBulletin3.php CHANGED
@@ -1,21 +1,27 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  /**
4
  * Implementation of vBulletin v3.x Converter.
5
  *
6
- * @since bbPress (r5151)
7
- * @link Codex Docs http://codex.bbpress.org/import-forums/vbulletin
 
8
  */
9
  class vBulletin3 extends BBP_Converter_Base {
10
 
11
  /**
12
  * Main constructor
13
  *
14
- * @uses vBulletin::setup_globals()
15
  */
16
- function __construct() {
17
  parent::__construct();
18
- $this->setup_globals();
19
  }
20
 
21
  /**
@@ -23,14 +29,20 @@ class vBulletin3 extends BBP_Converter_Base {
23
  */
24
  private function setup_globals() {
25
 
 
 
 
 
 
 
26
  /** Forum Section *****************************************************/
27
 
28
- // Forum id (Stored in postmeta)
29
  $this->field_map[] = array(
30
  'from_tablename' => 'forum',
31
  'from_fieldname' => 'forumid',
32
  'to_type' => 'forum',
33
- 'to_fieldname' => '_bbp_forum_id'
34
  );
35
 
36
  // Forum parent id (If no parent, then 0. Stored in postmeta)
@@ -38,7 +50,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 +128,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 +157,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 +222,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 +295,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 +387,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 +452,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 +519,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 +536,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 +589,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 +597,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 +650,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 );
@@ -597,7 +659,7 @@ class vBulletin3 extends BBP_Converter_Base {
597
  }
598
 
599
  /**
600
- * Translate the forum type from vBulletin v3.x numeric's to WordPress's strings.
601
  *
602
  * @param int $status vBulletin v3.x numeric forum type
603
  * @return string WordPress safe
@@ -612,7 +674,7 @@ class vBulletin3 extends BBP_Converter_Base {
612
  }
613
 
614
  /**
615
- * Translate the topic sticky status type from vBulletin v3.x numeric's to WordPress's strings.
616
  *
617
  * @param int $status vBulletin v3.x numeric forum type
618
  * @return string WordPress safe
@@ -643,18 +705,7 @@ class vBulletin3 extends BBP_Converter_Base {
643
  }
644
 
645
  /**
646
- * Set the reply title
647
- *
648
- * @param string $title vBulletin v3.x topic title of this reply
649
- * @return string Prefixed topic title, or empty string
650
- */
651
- public function callback_reply_title( $title = '' ) {
652
- $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
653
- return $title;
654
- }
655
-
656
- /**
657
- * Translate the post status from vBulletin v3.x numeric's to WordPress's strings.
658
  *
659
  * @param int $status vBulletin v3.x numeric topic status
660
  * @return string WordPress safe
@@ -698,10 +749,6 @@ class vBulletin3 extends BBP_Converter_Base {
698
  $field = $vbulletin_markup;
699
 
700
  // Parse out any bbCodes in $field with the BBCode 'parser.php'
701
- require_once( bbpress()->admin->admin_dir . 'parser.php' );
702
- $bbcode = BBCode::getInstance();
703
- $bbcode->enable_smileys = false;
704
- $bbcode->smiley_regex = false;
705
- return html_entity_decode( $bbcode->Parse( $field ) );
706
  }
707
  }
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
 
19
  /**
20
  * Main constructor
21
  *
 
22
  */
23
+ public function __construct() {
24
  parent::__construct();
 
25
  }
26
 
27
  /**
29
  */
30
  private function setup_globals() {
31
 
32
+ // Setup smiley URL & path
33
+ $this->bbcode_parser_properties = array(
34
+ 'smiley_url' => false,
35
+ 'smiley_dir' => false
36
+ );
37
+
38
  /** Forum Section *****************************************************/
39
 
40
+ // Old forum id (Stored in postmeta)
41
  $this->field_map[] = array(
42
  'from_tablename' => 'forum',
43
  'from_fieldname' => 'forumid',
44
  'to_type' => 'forum',
45
+ 'to_fieldname' => '_bbp_old_forum_id'
46
  );
47
 
48
  // Forum parent id (If no parent, then 0. Stored in postmeta)
50
  'from_tablename' => 'forum',
51
  'from_fieldname' => 'parentid',
52
  'to_type' => 'forum',
53
+ 'to_fieldname' => '_bbp_old_forum_parent_id'
54
  );
55
 
56
  // Forum topic count (Stored in postmeta)
128
  'callback_method' => 'callback_forum_type'
129
  );
130
 
131
+ // Forum status (Set a default value 'open', Stored in postmeta)
132
+ $this->field_map[] = array(
133
+ 'to_type' => 'forum',
134
+ 'to_fieldname' => '_bbp_status',
135
+ 'default' => 'open'
136
+ );
137
+
138
  // Forum dates.
139
  $this->field_map[] = array(
140
  'to_type' => 'forum',
157
  'default' => date( 'Y-m-d H:i:s' )
158
  );
159
 
160
+ /** Forum Subscriptions Section ***************************************/
161
+
162
+ // Subscribed forum ID (Stored in usermeta)
163
+ $this->field_map[] = array(
164
+ 'from_tablename' => 'subscribeforum',
165
+ 'from_fieldname' => 'forumid',
166
+ 'to_type' => 'forum_subscriptions',
167
+ 'to_fieldname' => '_bbp_forum_subscriptions'
168
+ );
169
+
170
+ // Subscribed user ID (Stored in usermeta)
171
+ $this->field_map[] = array(
172
+ 'from_tablename' => 'subscribeforum',
173
+ 'from_fieldname' => 'userid',
174
+ 'to_type' => 'forum_subscriptions',
175
+ 'to_fieldname' => 'user_id',
176
+ 'callback_method' => 'callback_userid'
177
+ );
178
+
179
  /** Topic Section *****************************************************/
180
 
181
+ // Old topic id (Stored in postmeta)
182
  $this->field_map[] = array(
183
  'from_tablename' => 'thread',
184
  'from_fieldname' => 'threadid',
185
  'to_type' => 'topic',
186
+ 'to_fieldname' => '_bbp_old_topic_id'
187
  );
188
 
189
  // Topic parent forum id (If no parent, then 0. Stored in postmeta)
222
  'callback_method' => 'callback_userid'
223
  );
224
 
225
+ // Topic author name (Stored in postmeta as _bbp_anonymous_name)
226
+ $this->field_map[] = array(
227
+ 'from_tablename' => 'thread',
228
+ 'from_fieldname' => 'postusername',
229
+ 'to_type' => 'topic',
230
+ 'to_fieldname' => '_bbp_old_topic_author_name_id'
231
+ );
232
+
233
+ // Is the topic anonymous (Stored in postmeta)
234
+ $this->field_map[] = array(
235
+ 'from_tablename' => 'thread',
236
+ 'from_fieldname' => 'postuserid',
237
+ 'to_type' => 'topic',
238
+ 'to_fieldname' => '_bbp_old_is_topic_anonymous_id',
239
+ 'callback_method' => 'callback_check_anonymous'
240
+ );
241
+
242
  // Topic Author ip (Stored in postmeta)
243
  // Note: We join the 'post' table because 'thread' table does not include topic content.
244
  $this->field_map[] = array(
295
  'from_tablename' => 'thread',
296
  'from_fieldname' => 'open',
297
  'to_type' => 'topic',
298
+ 'to_fieldname' => '_bbp_old_closed_status_id',
299
  'callback_method' => 'callback_topic_status'
300
  );
301
 
302
+ // Sticky status (Stored in postmeta)
303
  $this->field_map[] = array(
304
  'from_tablename' => 'thread',
305
  'from_fieldname' => 'sticky',
306
  'to_type' => 'topic',
307
+ 'to_fieldname' => '_bbp_old_sticky_status_id',
308
  'callback_method' => 'callback_sticky_status'
309
  );
310
 
387
  'callback_method' => 'callback_slug'
388
  );
389
 
390
+ /** Topic Subscriptions Section ***************************************/
391
+
392
+ // Subscribed topic ID (Stored in usermeta)
393
+ $this->field_map[] = array(
394
+ 'from_tablename' => 'subscribethread',
395
+ 'from_fieldname' => 'threadid',
396
+ 'to_type' => 'topic_subscriptions',
397
+ 'to_fieldname' => '_bbp_subscriptions'
398
+ );
399
+
400
+ // Subscribed user ID (Stored in usermeta)
401
+ $this->field_map[] = array(
402
+ 'from_tablename' => 'subscribethread',
403
+ 'from_fieldname' => 'userid',
404
+ 'to_type' => 'topic_subscriptions',
405
+ 'to_fieldname' => 'user_id',
406
+ 'callback_method' => 'callback_userid'
407
+ );
408
+
409
  /** Reply Section *****************************************************/
410
 
411
+ // Old reply id (Stored in postmeta)
412
  $this->field_map[] = array(
413
  'from_tablename' => 'post',
414
  'from_fieldname' => 'postid',
415
  'to_type' => 'reply',
416
+ 'to_fieldname' => '_bbp_old_reply_id'
417
  );
418
 
419
  // Reply parent forum id (If no parent, then 0. Stored in postmeta)
 
420
  $this->field_map[] = array(
421
+ 'from_tablename' => 'post',
422
+ 'from_fieldname' => 'threadid',
423
+ 'from_expression' => 'WHERE parentid != 0',
 
 
424
  'to_type' => 'reply',
425
  'to_fieldname' => '_bbp_forum_id',
426
  'callback_method' => 'callback_topicid_to_forumid'
452
  'callback_method' => 'callback_userid'
453
  );
454
 
455
+ // Reply author name (Stored in postmeta as _bbp_anonymous_name)
 
456
  $this->field_map[] = array(
457
+ 'from_tablename' => 'post',
458
+ 'from_fieldname' => 'username',
 
 
 
459
  'to_type' => 'reply',
460
+ 'to_fieldname' => '_bbp_old_reply_author_name_id'
 
461
  );
462
 
463
+ // Is the reply anonymous (Stored in postmeta)
464
+ $this->field_map[] = array(
465
+ 'from_tablename' => 'post',
466
+ 'from_fieldname' => 'userid',
 
 
 
 
467
  'to_type' => 'reply',
468
+ 'to_fieldname' => '_bbp_old_is_reply_anonymous_id',
469
+ 'callback_method' => 'callback_check_anonymous'
470
  );
471
 
472
  // Reply content.
519
 
520
  /** User Section ******************************************************/
521
 
522
+ // Store old user id (Stored in usermeta)
523
  $this->field_map[] = array(
524
  'from_tablename' => 'user',
525
  'from_fieldname' => 'userid',
526
  'to_type' => 'user',
527
+ 'to_fieldname' => '_bbp_old_user_id'
528
  );
529
 
530
+ // Store old user password (Stored in usermeta serialized with salt)
531
  $this->field_map[] = array(
532
  'from_tablename' => 'user',
533
  'from_fieldname' => 'password',
536
  'callback_method' => 'callback_savepass'
537
  );
538
 
539
+ // Store old user salt (This is only used for the SELECT row info for the above password save)
540
  $this->field_map[] = array(
541
  'from_tablename' => 'user',
542
  'from_fieldname' => 'salt',
589
  'from_tablename' => 'user',
590
  'from_fieldname' => 'aim',
591
  'to_type' => 'user',
592
+ 'to_fieldname' => '_bbp_vbulletin3_user_aim'
593
  );
594
 
595
  // User Yahoo (Stored in usermeta)
597
  'from_tablename' => 'user',
598
  'from_fieldname' => 'yahoo',
599
  'to_type' => 'user',
600
+ 'to_fieldname' => '_bbp_vbulletin3_user_yim'
601
  );
602
 
603
  // User ICQ (Stored in usermeta)
650
  *
651
  * vBulletin passwords do not work. Maybe use the below plugin's approach?
652
  *
653
+ * @link https://wordpress.org/extend/plugins/vb-user-copy/
654
+ * @link https://plugins.trac.wordpress.org/browser/vb-user-copy/trunk/vb_user_copy.php
655
  */
656
  public function authenticate_pass( $password, $serialized_pass ) {
657
  $pass_array = unserialize( $serialized_pass );
659
  }
660
 
661
  /**
662
+ * Translate the forum type from vBulletin v3.x numerics to WordPress's strings.
663
  *
664
  * @param int $status vBulletin v3.x numeric forum type
665
  * @return string WordPress safe
674
  }
675
 
676
  /**
677
+ * Translate the topic sticky status type from vBulletin v3.x numerics to WordPress's strings.
678
  *
679
  * @param int $status vBulletin v3.x numeric forum type
680
  * @return string WordPress safe
705
  }
706
 
707
  /**
708
+ * Translate the post status from vBulletin v3.x numerics to WordPress's strings.
 
 
 
 
 
 
 
 
 
 
 
709
  *
710
  * @param int $status vBulletin v3.x numeric topic status
711
  * @return string WordPress safe
749
  $field = $vbulletin_markup;
750
 
751
  // Parse out any bbCodes in $field with the BBCode 'parser.php'
752
+ return parent::callback_html( $field );
 
 
 
 
753
  }
754
  }
includes/admin/css/admin.css DELETED
@@ -1,177 +0,0 @@
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
- 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 {
24
- position: absolute;
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,
35
- #bbp-dashboard-right-now .versions {
36
- margin: -12px;
37
- }
38
-
39
- #bbp-dashboard-right-now .inside {
40
- font-size: 12px;
41
- padding-top: 20px;
42
- margin-bottom: 0;
43
- }
44
-
45
- #bbp-dashboard-right-now p.sub {
46
- padding: 5px 0 15px;
47
- color: #8f8f8f;
48
- font-size: 14px;
49
- position: absolute;
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;
60
- padding: 0;
61
- position: relative;
62
- }
63
-
64
- #bbp-dashboard-right-now .table_content {
65
- float: left;
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;
84
- white-space: nowrap;
85
- }
86
-
87
- #bbp-dashboard-right-now table tr.first td {
88
- border-top: none;
89
- }
90
-
91
- #bbp-dashboard-right-now td.b {
92
- padding-right: 6px;
93
- text-align: right;
94
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
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;
105
- }
106
-
107
- #bbp-dashboard-right-now td.b a:hover {
108
- color: #d54e21;
109
- }
110
-
111
- #bbp-dashboard-right-now .t {
112
- font-size: 12px;
113
- padding-right: 12px;
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 {
131
- color: #e66f00;
132
- }
133
-
134
- #bbp-dashboard-right-now .approved {
135
- color: green;
136
- }
137
-
138
- #bbp-dashboard-right-now .versions {
139
- padding: 6px 10px 12px;
140
- clear: both;
141
- }
142
-
143
- #bbp-dashboard-right-now .versions .b {
144
- font-weight: bold;
145
- }
146
-
147
- #bbp-dashboard-right-now a.button {
148
- float: right;
149
- clear: right;
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/forums.php CHANGED
@@ -8,22 +8,22 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
- if ( !class_exists( 'BBP_Forums_Admin' ) ) :
14
  /**
15
  * Loads bbPress forums admin area
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,11 +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
39
- * @uses BBP_Forums_Admin::setup_help() Setup the help text
40
  */
41
  public function __construct() {
42
  $this->setup_globals();
@@ -46,57 +42,44 @@ 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
53
- * @uses add_filter() To add various filters
54
- * @uses bbp_get_forum_post_type() To get the forum post type
55
- * @uses bbp_get_topic_post_type() To get the topic post type
56
- * @uses bbp_get_reply_post_type() To get the reply post type
57
  */
58
  private function setup_actions() {
59
 
60
- // Add some general styling to the admin area
61
- add_action( 'bbp_admin_head', array( $this, 'admin_head' ) );
62
-
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 +91,10 @@ 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 +141,18 @@ 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 +184,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 +197,18 @@ 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,63 +216,117 @@ 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
260
- * editing the forum
261
- * @uses bbp_get_forum() To get the forum
262
- * @uses bbp_is_forum_closed() To check if the forum is closed
263
- * @uses bbp_is_forum_category() To check if the forum is a category
264
- * @uses bbp_is_forum_private() To check if the forum is private
265
- * @uses bbp_close_forum() To close the forum
266
- * @uses bbp_open_forum() To open the forum
267
- * @uses bbp_categorize_forum() To make the forum a category
268
- * @uses bbp_normalize_forum() To make the forum normal (not category)
269
- * @uses bbp_privatize_forum() To mark the forum as private
270
- * @uses bbp_publicize_forum() To mark the forum as public
271
- * @uses do_action() Calls 'bbp_forum_attributes_metabox_save' with the
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 );
@@ -311,133 +335,217 @@ class BBP_Forums_Admin {
311
  }
312
 
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
320
- * @uses bbp_get_reply_post_type() To get the reply post type
321
- * @uses sanitize_html_class() To sanitize the classes
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
- }
337
 
338
- strong.label {
339
- display: inline-block;
340
- width: 60px;
341
- }
342
 
343
- #bbp_forum_attributes hr {
344
- border-style: solid;
345
- border-width: 1px;
346
- border-color: #ccc #fff #fff #ccc;
347
- }
348
 
349
- .column-bbp_forum_topic_count,
350
- .column-bbp_forum_reply_count,
351
- .column-bbp_topic_reply_count,
352
- .column-bbp_topic_voice_count {
353
- width: 8% !important;
354
- }
 
355
 
356
- .column-author,
357
- .column-bbp_reply_author,
358
- .column-bbp_topic_author {
359
- width: 10% !important;
360
- }
361
 
362
- .column-bbp_topic_forum,
363
- .column-bbp_reply_forum,
364
- .column-bbp_reply_topic {
365
- width: 10% !important;
366
- }
367
 
368
- .column-bbp_forum_freshness,
369
- .column-bbp_topic_freshness {
370
- width: 10% !important;
371
- }
372
 
373
- .column-bbp_forum_created,
374
- .column-bbp_topic_created,
375
- .column-bbp_reply_created {
376
- width: 15% !important;
377
- }
378
 
379
- .status-closed {
380
- background-color: #eaeaea;
381
- }
382
 
383
- .status-spam {
384
- background-color: #faeaea;
385
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
 
387
- /*]]>*/
388
- </style>
 
389
 
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
400
- * the columns
401
  * @return array $columns bbPress forum columns
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
427
- * @uses bbp_forum_topic_count() To output the forum topic count
428
- * @uses bbp_forum_reply_count() To output the forum reply count
429
- * @uses get_the_date() Get the forum creation date
430
- * @uses get_the_time() Get the forum creation time
431
- * @uses esc_attr() To sanitize the forum creation time
432
- * @uses bbp_get_forum_last_active_time() To get the time when the forum was
433
- * last active
434
- * @uses do_action() Calls 'bbp_admin_forums_column_data' with the
435
- * column and forum id
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 +555,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 +573,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 +591,32 @@ 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,13 +626,9 @@ 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()
505
- * @uses wp_post_revision_title()
506
- * @uses esc_url()
507
- * @uses add_query_arg()
508
  *
509
  * @param array $messages
510
  *
@@ -513,8 +637,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 +644,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 +671,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 +721,17 @@ 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
  /**
15
  * Loads bbPress forums admin area
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
  public function __construct() {
38
  $this->setup_globals();
42
  /**
43
  * Setup the admin hooks, actions and filters
44
  *
45
+ * @since 2.0.0 bbPress (r2646)
 
46
  *
47
+ * @access private
 
 
 
 
48
  */
49
  private function setup_actions() {
50
 
 
 
 
51
  // Messages
52
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
53
 
54
+ // Forum Column headers.
 
 
 
 
55
  add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
56
 
57
+ // Forum Columns (in page row)
58
  add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
59
  add_filter( 'page_row_actions', array( $this, 'row_actions' ), 10, 2 );
60
 
61
+ // Metabox actions
62
+ add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
63
+ add_action( 'add_meta_boxes', array( $this, 'moderators_metabox' ) );
64
+ add_action( 'add_meta_boxes', array( $this, 'subscriptions_metabox' ) );
65
+ add_action( 'add_meta_boxes', array( $this, 'comments_metabox' ) );
66
+ add_action( 'save_post', array( $this, 'save_meta_boxes' ) );
67
+
68
+ // Check if there are any bbp_toggle_forum_* requests on admin_init, also have a message displayed
69
+ add_action( 'load-edit.php', array( $this, 'toggle_forum' ) );
70
+ add_action( 'admin_notices', array( $this, 'toggle_forum_notice' ) );
71
+
72
  // Contextual Help
73
  add_action( 'load-edit.php', array( $this, 'edit_help' ) );
74
  add_action( 'load-post.php', array( $this, 'new_help' ) );
75
  add_action( 'load-post-new.php', array( $this, 'new_help' ) );
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * Admin globals
80
  *
81
+ * @since 2.0.0 bbPress (r2646)
82
+ *
83
  * @access private
84
  */
85
  private function setup_globals() {
91
  /**
92
  * Contextual help for bbPress forum edit page
93
  *
94
+ * @since 2.0.0 bbPress (r3119)
 
95
  */
96
  public function edit_help() {
97
 
 
 
98
  // Overview
99
  get_current_screen()->add_help_tab( array(
100
  'id' => 'overview',
141
  // Help Sidebar
142
  get_current_screen()->set_help_sidebar(
143
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
144
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
145
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
146
  );
147
  }
148
 
149
  /**
150
  * Contextual help for bbPress forum edit page
151
  *
152
+ * @since 2.0.0 bbPress (r3119)
 
153
  */
154
  public function new_help() {
155
 
 
 
156
  $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>';
157
 
158
  get_current_screen()->add_help_tab( array(
184
  '<li>' . __( '<strong>Type</strong> indicates if the forum is a category or forum. Categories generally contain other forums.', 'bbpress' ) . '</li>' .
185
  '<li>' . __( '<strong>Status</strong> allows you to close a forum to new topics and forums.', 'bbpress' ) . '</li>' .
186
  '<li>' . __( '<strong>Visibility</strong> lets you pick the scope of each forum and what users are allowed to access it.', 'bbpress' ) . '</li>' .
187
+ '<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>' .
188
  '<li>' . __( '<strong>Order</strong> allows you to order your forums numerically.', 'bbpress' ) . '</li>' .
189
  '</ul>'
190
  ) );
197
 
198
  get_current_screen()->set_help_sidebar(
199
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
200
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
201
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
202
  );
203
  }
204
 
205
  /**
206
+ * Add the forum attributes meta-box
 
 
207
  *
208
+ * @since 2.0.0 bbPress (r2746)
 
 
209
  */
210
  public function attributes_metabox() {
211
+ add_meta_box(
 
 
 
212
  'bbp_forum_attributes',
213
  __( 'Forum Attributes', 'bbpress' ),
214
  'bbp_forum_metabox',
216
  'side',
217
  'high'
218
  );
219
+ }
220
+
221
+ /**
222
+ * Add the forum moderators meta-box
223
+ *
224
+ * @since 2.6.0 bbPress
225
+ */
226
+ public function moderators_metabox() {
227
 
228
+ // Bail if feature not active or user cannot assign moderators
229
+ if ( ! bbp_allow_forum_mods() || ! current_user_can( 'assign_moderators' ) ) {
230
+ return;
231
+ }
232
+
233
+ // Moderators
234
+ add_meta_box(
235
+ 'bbp_moderator_assignment_metabox',
236
+ __( 'Forum Moderators', 'bbpress' ),
237
+ 'bbp_moderator_assignment_metabox',
238
+ $this->post_type,
239
+ 'side',
240
+ 'high'
241
+ );
242
+ }
243
+
244
+ /**
245
+ * Add the subscriptions meta-box
246
+ *
247
+ * Allows viewing of users who have subscribed to a forum.
248
+ *
249
+ * @since 2.6.0 bbPress (r6197)
250
+ */
251
+ public function subscriptions_metabox() {
252
+
253
+ // Bail if post_type is not a reply
254
+ if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) ) {
255
+ return;
256
+ }
257
+
258
+ // Bail if no subscriptions
259
+ if ( ! bbp_is_subscriptions_active() ) {
260
+ return;
261
+ }
262
+
263
+ // Add the meta-box
264
+ add_meta_box(
265
+ 'bbp_forum_subscriptions_metabox',
266
+ __( 'Subscriptions', 'bbpress' ),
267
+ 'bbp_forum_subscriptions_metabox',
268
+ $this->post_type,
269
+ 'normal',
270
+ 'high'
271
+ );
272
+ }
273
+
274
+ /**
275
+ * Remove comments & discussion meta-boxes if comments are not supported
276
+ *
277
+ * @since 2.6.0 bbPress (r6186)
278
+ */
279
+ public function comments_metabox() {
280
+ if ( ! post_type_supports( $this->post_type, 'comments' ) ) {
281
+ remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
282
+ remove_meta_box( 'commentsdiv', $this->post_type, 'normal' );
283
+ }
284
  }
285
 
286
  /**
287
  * Pass the forum attributes for processing
288
  *
289
+ * @since 2.0.0 bbPress (r2746)
290
  *
291
  * @param int $forum_id Forum id
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  * @return int Forum id
293
  */
294
+ public function save_meta_boxes( $forum_id ) {
 
 
295
 
296
  // Bail if doing an autosave
297
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
298
  return $forum_id;
299
+ }
300
 
301
  // Bail if not a post request
302
+ if ( ! bbp_is_post_request() ) {
303
  return $forum_id;
304
+ }
305
 
306
  // Nonce check
307
+ if ( empty( $_POST['bbp_forum_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) ) {
308
  return $forum_id;
309
+ }
310
 
311
  // Only save for forum post-types
312
+ if ( ! bbp_is_forum( $forum_id ) ) {
313
  return $forum_id;
314
+ }
315
 
316
  // Bail if current user cannot edit this forum
317
+ if ( ! current_user_can( 'edit_forum', $forum_id ) ) {
318
  return $forum_id;
319
+ }
320
 
321
  // Parent ID
322
+ $parent_id = ( ! empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) )
323
+ ? (int) $_POST['parent_id']
324
+ : 0;
325
 
326
  // Update the forum meta bidness
327
  bbp_update_forum( array(
328
  'forum_id' => $forum_id,
329
+ 'post_parent' => $parent_id
330
  ) );
331
 
332
  do_action( 'bbp_forum_attributes_metabox_save', $forum_id );
335
  }
336
 
337
  /**
338
+ * Toggle forum
339
  *
340
+ * Handles the admin-side opening/closing of forums
341
  *
342
+ * @since 2.6.0 bbPress (r5254)
 
 
 
 
343
  */
344
+ public function toggle_forum() {
345
 
346
+ // Bail if not a forum toggle action
347
+ if ( ! bbp_is_get_request() || empty( $_GET['action'] ) || empty( $_GET['forum_id'] ) ) {
348
+ return;
349
+ }
350
 
351
+ // Bail if not an allowed action
352
+ $action = sanitize_key( $_GET['action'] );
353
+ if ( empty( $action ) || ! in_array( $action, $this->get_allowed_action_toggles(), true ) ) {
354
+ return;
355
+ }
356
 
357
+ // Bail if forum is missing
358
+ $forum_id = bbp_get_forum_id( $_GET['forum_id'] );
359
+ if ( ! bbp_get_forum( $forum_id ) ) {
360
+ wp_die( __( 'The forum was not found.', 'bbpress' ) );
361
+ }
362
 
363
+ // What is the user doing here?
364
+ if ( ! current_user_can( 'edit_forum', $forum_id ) ) {
365
+ wp_die( __( 'You do not have permission to do that.', 'bbpress' ) );
366
+ }
367
 
368
+ // Defaults
369
+ $post_data = array( 'ID' => $forum_id );
370
+ $message = '';
371
+ $success = false;
372
 
373
+ switch ( $action ) {
374
+ case 'bbp_toggle_forum_close' :
375
+ check_admin_referer( 'close-forum_' . $forum_id );
 
 
376
 
377
+ $is_open = bbp_is_forum_open( $forum_id );
378
+ $message = ( true === $is_open )
379
+ ? 'closed'
380
+ : 'opened';
381
+ $success = ( true === $is_open )
382
+ ? bbp_close_forum( $forum_id )
383
+ : bbp_open_forum( $forum_id );
384
 
385
+ break;
386
+ }
 
 
 
387
 
388
+ // Setup the message
389
+ $retval = array(
390
+ 'bbp_forum_toggle_notice' => $message,
391
+ 'forum_id' => $forum_id
392
+ );
393
 
394
+ // Prepare for failure
395
+ if ( ( false === $success ) || is_wp_error( $success ) ) {
396
+ $retval['failed'] = '1';
397
+ }
398
 
399
+ // Filter all message args
400
+ $retval = apply_filters( 'bbp_toggle_forum_action_admin', $retval, $forum_id, $action );
 
 
 
401
 
402
+ // Do additional forum toggle actions (admin side)
403
+ do_action( 'bbp_toggle_forum_admin', $success, $post_data, $action, $retval );
 
404
 
405
+ // Redirect back to the forum
406
+ $redirect = add_query_arg( $retval, remove_query_arg( array( 'action', 'forum_id' ) ) );
407
+ bbp_redirect( $redirect );
408
+ }
409
+
410
+ /**
411
+ * Toggle forum notices
412
+ *
413
+ * Display the success/error notices from
414
+ * {@link BBP_Admin::toggle_forum()}
415
+ *
416
+ * @since 2.6.0 bbPress (r5254)
417
+ */
418
+ public function toggle_forum_notice() {
419
+
420
+ // Bail if missing topic toggle action
421
+ if ( ! bbp_is_get_request() || empty( $_GET['forum_id'] ) || empty( $_GET['bbp_forum_toggle_notice'] ) ) {
422
+ return;
423
+ }
424
+
425
+ // Bail if not an allowed notice
426
+ $notice = sanitize_key( $_GET['bbp_forum_toggle_notice'] );
427
+ if ( empty( $notice ) || ! in_array( $notice, $this->get_allowed_notice_toggles(), true ) ) {
428
+ return;
429
+ }
430
+
431
+ // Bail if no forum_id or notice
432
+ $forum_id = bbp_get_forum_id( $_GET['forum_id'] );
433
+ if ( empty( $forum_id ) ) {
434
+ return;
435
+ }
436
+
437
+ // Bail if forum is missing
438
+ if ( ! bbp_get_forum( $forum_id ) ) {
439
+ return;
440
+ }
441
+
442
+ // Use the title in the responses
443
+ $forum_title = bbp_get_forum_title( $forum_id );
444
+ $is_failure = ! empty( $_GET['failed'] );
445
+ $message = '';
446
+
447
+ switch ( $notice ) {
448
+ case 'opened' :
449
+ $message = ( $is_failure === true )
450
+ ? sprintf( __( 'There was a problem opening the forum "%1$s".', 'bbpress' ), $forum_title )
451
+ : sprintf( __( 'Forum "%1$s" successfully opened.', 'bbpress' ), $forum_title );
452
+ break;
453
+
454
+ case 'closed' :
455
+ $message = ( $is_failure === true )
456
+ ? sprintf( __( 'There was a problem closing the forum "%1$s".', 'bbpress' ), $forum_title )
457
+ : sprintf( __( 'Forum "%1$s" successfully closed.', 'bbpress' ), $forum_title );
458
+ break;
459
+ }
460
+
461
+ // Do additional forum toggle notice filters (admin side)
462
+ $message = apply_filters( 'bbp_toggle_forum_notice_admin', $message, $forum_id, $notice, $is_failure );
463
+ $class = ( $is_failure === true )
464
+ ? 'error'
465
+ : 'updated';
466
+
467
+ ?>
468
 
469
+ <div id="message" class="<?php echo esc_html( $class ); ?> fade">
470
+ <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
471
+ </div>
472
 
473
  <?php
474
  }
475
 
476
+ /**
477
+ * Returns an array of notice toggles
478
+ *
479
+ * @since 2.6.0 bbPress (r6396)
480
+ *
481
+ * @return array
482
+ */
483
+ private function get_allowed_notice_toggles() {
484
+
485
+ // Filter & return
486
+ return apply_filters( 'bbp_admin_forums_allowed_notice_toggles', array(
487
+ 'opened',
488
+ 'closed'
489
+ ) );
490
+ }
491
+
492
+ /**
493
+ * Returns an array of notice toggles
494
+ *
495
+ * @since 2.6.0 bbPress (r6396)
496
+ *
497
+ * @return array
498
+ */
499
+ private function get_allowed_action_toggles() {
500
+
501
+ // Filter & return
502
+ return apply_filters( 'bbp_admin_forums_allowed_action_toggles', array(
503
+ 'bbp_toggle_forum_close'
504
+ ) );
505
+ }
506
+
507
  /**
508
  * Manage the column headers for the forums page
509
  *
510
+ * @since 2.0.0 bbPress (r2485)
511
  *
512
  * @param array $columns The columns
513
+ *
 
514
  * @return array $columns bbPress forum columns
515
  */
516
  public function column_headers( $columns ) {
517
 
518
+ // Set list table column headers
519
+ $columns = array(
 
520
  'cb' => '<input type="checkbox" />',
521
+ 'title' => __( 'Forum', 'bbpress' ),
522
+ 'bbp_forum_topic_count' => __( 'Topics', 'bbpress' ),
523
+ 'bbp_forum_reply_count' => __( 'Replies', 'bbpress' ),
524
+ 'bbp_forum_mods' => __( 'Moderators', 'bbpress' ),
525
+ 'author' => __( 'Creator', 'bbpress' ),
526
+ 'bbp_forum_created' => __( 'Created' , 'bbpress' ),
527
+ 'bbp_forum_freshness' => __( 'Last Post', 'bbpress' )
528
  );
529
 
530
+ // Remove forum mods column if not enabled
531
+ if ( ! bbp_allow_forum_mods() ) {
532
+ unset( $columns['bbp_forum_mods'] );
533
+ }
534
+
535
+ // Filter & return
536
  return apply_filters( 'bbp_admin_forums_column_headers', $columns );
537
  }
538
 
539
  /**
540
  * Print extra columns for the forums page
541
  *
542
+ * @since 2.0.0 bbPress (r2485)
543
  *
544
  * @param string $column Column
545
  * @param int $forum_id Forum id
 
 
 
 
 
 
 
 
 
546
  */
547
  public function column_data( $column, $forum_id ) {
548
 
 
 
549
  switch ( $column ) {
550
  case 'bbp_forum_topic_count' :
551
  bbp_forum_topic_count( $forum_id );
555
  bbp_forum_reply_count( $forum_id );
556
  break;
557
 
558
+ case 'bbp_forum_mods' :
559
+ bbp_moderator_list( $forum_id, array(
560
+ 'before' => '',
561
+ 'after' => '',
562
+ 'none' => esc_html__( '&mdash;', 'bbpress' )
563
+ ) );
564
+ break;
565
+
566
  case 'bbp_forum_created':
567
  printf( '%1$s <br /> %2$s',
568
  get_the_date(),
573
 
574
  case 'bbp_forum_freshness' :
575
  $last_active = bbp_get_forum_last_active_time( $forum_id, false );
576
+ if ( ! empty( $last_active ) ) {
577
  echo esc_html( $last_active );
578
+ } else {
579
  esc_html_e( 'No Topics', 'bbpress' );
580
+ }
581
 
582
  break;
583
 
591
  * Forum Row actions
592
  *
593
  * Remove the quick-edit action link and display the description under
594
+ * the forum title and add the open/close links
595
  *
596
+ * @since 2.0.0 bbPress (r2577)
597
  *
598
  * @param array $actions Actions
599
  * @param array $forum Forum object
 
600
  * @return array $actions Actions
601
  */
602
  public function row_actions( $actions, $forum ) {
603
 
 
 
604
  unset( $actions['inline hide-if-no-js'] );
605
 
606
+ // Only show the actions if the user is capable of viewing them :)
607
+ if ( current_user_can( 'edit_forum', $forum->ID ) ) {
608
+
609
+ // Show the 'close' and 'open' link on published, private, hidden and closed posts only
610
+ 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() ), true ) ) {
611
+ $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 );
612
+ if ( bbp_is_forum_open( $forum->ID ) ) {
613
+ $actions['closed'] = '<a href="' . esc_url( $close_uri ) . '" title="' . esc_attr__( 'Close this forum', 'bbpress' ) . '">' . _x( 'Close', 'Close a Forum', 'bbpress' ) . '</a>';
614
+ } else {
615
+ $actions['closed'] = '<a href="' . esc_url( $close_uri ) . '" title="' . esc_attr__( 'Open this forum', 'bbpress' ) . '">' . _x( 'Open', 'Open a Forum', 'bbpress' ) . '</a>';
616
+ }
617
+ }
618
+ }
619
+
620
  // simple hack to show the forum description under the title
621
  bbp_forum_content( $forum->ID );
622
 
626
  /**
627
  * Custom user feedback messages for forum post type
628
  *
629
+ * @since 2.0.0 bbPress (r3080)
630
  *
631
  * @global int $post_ID
 
 
 
 
632
  *
633
  * @param array $messages
634
  *
637
  public function updated_messages( $messages ) {
638
  global $post_ID;
639
 
 
 
640
  // URL for the current forum
641
  $forum_url = bbp_get_forum_permalink( $post_ID );
642
 
644
  $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
645
 
646
  // Messages array
647
+ $messages[ $this->post_type ] = array(
648
  0 => '', // Left empty on purpose
649
 
650
  // Updated
651
+ 1 => sprintf(
652
+ '%1$s <a href="%2$s">%3$s</a>',
653
+ __( 'Forum updated.', 'bbpress' ),
654
+ $forum_url,
655
+ __( 'View forum', 'bbpress' )
656
+ ),
657
 
658
  // Custom field updated
659
  2 => __( 'Custom field updated.', 'bbpress' ),
671
  : false,
672
 
673
  // Forum created
674
+ 6 => sprintf(
675
+ '%1$s <a href="%2$s">%3$s</a>',
676
+ __( 'Forum created.', 'bbpress' ),
677
+ $forum_url,
678
+ __( 'View forum', 'bbpress' )
679
+ ),
680
 
681
  // Forum saved
682
  7 => __( 'Forum saved.', 'bbpress' ),
683
 
684
  // Forum submitted
685
+ 8 => sprintf(
686
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
687
+ __( 'Forum submitted.', 'bbpress' ),
688
+ esc_url( add_query_arg( 'preview', 'true', $forum_url ) ),
689
+ __( 'Preview forum', 'bbpress' )
690
+ ),
691
 
692
  // Forum scheduled
693
+ 9 => sprintf(
694
+ '%1$s <a target="_blank" href="%2$s">%3$s</a>',
695
+ sprintf(
696
+ __( 'Forum scheduled for: %s.', 'bbpress' ),
697
  // translators: Publish box date format, see http://php.net/date
698
+ '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'bbpress' ), strtotime( $post_date ) ) . '</strong>'
699
+ ),
700
+ $forum_url,
701
+ __( 'Preview forum', 'bbpress' )
702
+ ),
703
 
704
  // Forum draft updated
705
+ 10 => sprintf(
706
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
707
+ __( 'Forum draft updated.', 'bbpress' ),
708
+ esc_url( add_query_arg( 'preview', 'true', $forum_url ) ),
709
+ __( 'Preview forum', 'bbpress' )
710
+ ),
711
  );
712
 
713
  return $messages;
721
  * This is currently here to make hooking and unhooking of the admin UI easy.
722
  * It could use dependency injection in the future, but for now this is easier.
723
  *
724
+ * @since 2.0.0 bbPress (r2596)
725
  *
726
+ * @param WP_Screen $current_screen Current screen object
727
  */
728
+ function bbp_admin_forums( $current_screen ) {
729
+
730
+ // Bail if not a forum screen
731
+ if ( empty( $current_screen->post_type ) || ( bbp_get_forum_post_type() !== $current_screen->post_type ) ) {
732
+ return;
733
+ }
734
+
735
+ // Init the forums admin
736
  bbpress()->admin->forums = new BBP_Forums_Admin();
737
  }
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/metaboxes.php CHANGED
@@ -9,28 +9,91 @@
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
21
- * @uses current_user_can() To check if the user is capable of doing things
22
- * @uses bbp_get_forum_post_type() To get the forum post type
23
- * @uses bbp_get_topic_post_type() To get the topic post type
24
- * @uses bbp_get_reply_post_type() To get the reply post type
25
- * @uses get_admin_url() To get the administration url
26
- * @uses add_query_arg() To add custom args to the url
27
- * @uses do_action() Calls 'bbp_dashboard_widget_right_now_content_table_end'
28
- * below the content table
29
- * @uses do_action() Calls 'bbp_dashboard_widget_right_now_table_end'
30
- * below the discussion table
31
- * @uses do_action() Calls 'bbp_dashboard_widget_right_now_discussion_table_end'
32
- * below the discussion table
33
- * @uses do_action() Calls 'bbp_dashboard_widget_right_now_end' below the widget
34
  */
35
  function bbp_dashboard_widget_right_now() {
36
 
@@ -47,9 +110,9 @@ 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>';
54
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
55
  }
@@ -64,9 +127,9 @@ 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>';
71
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
72
  }
@@ -81,9 +144,9 @@ 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>';
88
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
89
  }
@@ -100,9 +163,9 @@ 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>';
107
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
108
  }
@@ -132,11 +195,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 +214,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 +236,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,8 +258,8 @@ 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>';
202
  ?>
@@ -234,22 +297,15 @@ function bbp_dashboard_widget_right_now() {
234
  /** Forums ********************************************************************/
235
 
236
  /**
237
- * Forum metabox
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
245
- * @uses bbp_is_forum_private() To check if a forum is private or not
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 +316,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 +328,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 +340,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 +361,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,25 +382,19 @@ 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 ********************************************************************/
334
 
335
  /**
336
- * Topic 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 +403,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 +414,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 +425,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,9 +441,8 @@ 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' ),
396
  'disabled' => ''
397
  ) ); ?>
@@ -401,33 +452,44 @@ 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 *******************************************************************/
408
 
409
  /**
410
- * Reply 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,71 +505,120 @@ 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 *********************************************************************/
476
 
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 +626,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 +634,176 @@ 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
+ // Bail if user cannot spectate
23
+ if ( ! current_user_can( 'spectate' ) ) {
24
+ return $elements;
25
+ }
26
+
27
+ // Get the statistics
28
+ $r = bbp_get_statistics( array(
29
+ 'count_pending_topics' => false,
30
+ 'count_private_topics' => false,
31
+ 'count_spammed_topics' => false,
32
+ 'count_trashed_topics' => false,
33
+ 'count_pending_replies' => false,
34
+ 'count_private_replies' => false,
35
+ 'count_spammed_replies' => false,
36
+ 'count_trashed_replies' => false,
37
+ 'count_empty_tags' => false
38
+ ));
39
+
40
+ // Users
41
+ if ( isset( $r['user_count'] ) ) {
42
+ $link = admin_url( 'users.php' );
43
+ $text = sprintf( _n( '%s User', '%s Users', $r['user_count_int'], 'bbpress' ), $r['user_count'] );
44
+ $elements[] = current_user_can( 'edit_users' )
45
+ ? '<a href="' . esc_url( $link ) . '" class="bbp-glance-users">' . esc_html( $text ) . '</a>'
46
+ : esc_html( $text );
47
+ }
48
+
49
+ // Forums
50
+ if ( isset( $r['forum_count'] ) ) {
51
+ $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), admin_url( 'edit.php' ) );
52
+ $text = sprintf( _n( '%s Forum', '%s Forums', $r['forum_count_int'], 'bbpress' ), $r['forum_count'] );
53
+ $elements[] = current_user_can( 'publish_forums' )
54
+ ? '<a href="' . esc_url( $link ) . '" class="bbp-glance-forums">' . esc_html( $text ) . '</a>'
55
+ : esc_html( $text );
56
+ }
57
+
58
+ // Topics
59
+ if ( isset( $r['topic_count'] ) ) {
60
+ $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) );
61
+ $text = sprintf( _n( '%s Topic', '%s Topics', $r['topic_count_int'], 'bbpress' ), $r['topic_count'] );
62
+ $elements[] = current_user_can( 'publish_topics' )
63
+ ? '<a href="' . esc_url( $link ) . '" class="bbp-glance-topics">' . esc_html( $text ) . '</a>'
64
+ : esc_html( $text );
65
+ }
66
+
67
+ // Replies
68
+ if ( isset( $r['reply_count'] ) ) {
69
+ $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) );
70
+ $text = sprintf( _n( '%s Reply', '%s Replies', $r['reply_count_int'], 'bbpress' ), $r['reply_count'] );
71
+ $elements[] = current_user_can( 'publish_replies' )
72
+ ? '<a href="' . esc_url( $link ) . '" class="bbp-glance-replies">' . esc_html( $text ) . '</a>'
73
+ : esc_html( $text );
74
+ }
75
+
76
+ // Topic Tags
77
+ if ( bbp_allow_topic_tags() && isset( $r['topic_tag_count'] ) ) {
78
+ $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit-tags.php' ) );
79
+ $text = sprintf( _n( '%s Topic Tag', '%s Topic Tags', $r['topic_tag_count_int'], 'bbpress' ), $r['topic_tag_count'] );
80
+ $elements[] = current_user_can( 'manage_topic_tags' )
81
+ ? '<a href="' . esc_url( $link ) . '" class="bbp-glance-topic-tags">' . esc_html( $text ) . '</a>'
82
+ : esc_html( $text );
83
+ }
84
+
85
+ // Filter & return
86
+ return apply_filters( 'bbp_dashboard_at_a_glance', $elements, $r );
87
+ }
88
+
89
  /**
90
  * bbPress Dashboard Right Now Widget
91
  *
92
  * Adds a dashboard widget with forum statistics
93
  *
94
+ * @since 2.0.0 bbPress (r2770)
95
  *
96
+ * @deprecated 2.6.0 bbPress (r5268)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  */
98
  function bbp_dashboard_widget_right_now() {
99
 
110
 
111
  <?php
112
  $num = $r['forum_count'];
113
+ $text = _n( 'Forum', 'Forums', $r['forum_count_int'], 'bbpress' );
114
  if ( current_user_can( 'publish_forums' ) ) {
115
+ $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), admin_url( 'edit.php' ) );
116
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
117
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
118
  }
127
 
128
  <?php
129
  $num = $r['topic_count'];
130
+ $text = _n( 'Topic', 'Topics', $r['topic_count_int'], 'bbpress' );
131
  if ( current_user_can( 'publish_topics' ) ) {
132
+ $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) );
133
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
134
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
135
  }
144
 
145
  <?php
146
  $num = $r['reply_count'];
147
+ $text = _n( 'Reply', 'Replies', $r['reply_count_int'], 'bbpress' );
148
  if ( current_user_can( 'publish_replies' ) ) {
149
+ $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) );
150
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
151
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
152
  }
163
 
164
  <?php
165
  $num = $r['topic_tag_count'];
166
+ $text = _n( 'Topic Tag', 'Topic Tags', $r['topic_tag_count_int'], 'bbpress' );
167
  if ( current_user_can( 'manage_topic_tags' ) ) {
168
+ $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit-tags.php' ) );
169
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
170
  $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
171
  }
195
 
196
  <?php
197
  $num = $r['user_count'];
198
+ $text = _n( 'User', 'Users', $r['user_count_int'], 'bbpress' );
199
  if ( current_user_can( 'edit_users' ) ) {
200
+ $link = admin_url( 'users.php' );
201
+ $num = '<a href="' . $link . '">' . $num . '</a>';
202
+ $text = '<a href="' . $link . '">' . $text . '</a>';
203
  }
204
  ?>
205
 
214
 
215
  <?php
216
  $num = $r['topic_count_hidden'];
217
+ $text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden_int'], 'bbpress' );
218
+ $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) );
219
  if ( '0' !== $num ) {
220
  $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
221
  }
222
+ $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';
223
  $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';
224
  ?>
225
 
236
 
237
  <?php
238
  $num = $r['reply_count_hidden'];
239
+ $text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden_int'], 'bbpress' );
240
+ $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) );
241
  if ( '0' !== $num ) {
242
  $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
243
  }
244
+ $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';
245
  $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';
246
  ?>
247
 
258
 
259
  <?php
260
  $num = $r['empty_topic_tag_count'];
261
+ $text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count_int'], 'bbpress' );
262
+ $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit-tags.php' ) );
263
  $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>';
264
  $text = '<a class="waiting" href="' . esc_url( $link ) . '">' . $text . '</a>';
265
  ?>
297
  /** Forums ********************************************************************/
298
 
299
  /**
300
+ * Forum meta-box
301
  *
302
+ * The meta-box that holds all of the additional forum information
303
  *
304
+ * @since 2.0.0 bbPress (r2744)
 
 
 
 
 
 
305
  */
306
+ function bbp_forum_metabox( $post ) {
307
 
308
  // Post ID
 
309
  $post_parent = bbp_get_global_post_field( 'post_parent', 'raw' );
310
  $menu_order = bbp_get_global_post_field( 'menu_order', 'edit' );
311
 
316
  <p>
317
  <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
318
  <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label>
319
+ <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post->ID ) ); ?>
320
  </p>
321
 
322
  <?php
328
  <p>
329
  <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
330
  <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label>
331
+ <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post->ID ) ); ?>
332
  </p>
333
 
334
  <?php
340
  <p>
341
  <strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong>
342
  <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label>
343
+ <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post->ID ) ); ?>
344
  </p>
345
 
346
  <hr />
361
  'orderby' => 'title',
362
  'order' => 'ASC',
363
  'walker' => '',
364
+ 'exclude' => $post->ID,
365
 
366
  // Output-related
367
  'select_id' => 'parent_id',
 
368
  'options_only' => false,
369
+ 'show_none' => esc_html__( '&mdash; No parent &mdash;', 'bbpress' ),
370
  'disable_categories' => false,
371
  'disabled' => ''
372
  ) ); ?>
382
 
383
  <?php
384
  wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' );
385
+ do_action( 'bbp_forum_metabox', $post );
386
  }
387
 
388
  /** Topics ********************************************************************/
389
 
390
  /**
391
+ * Topic meta-box
 
 
392
  *
393
+ * The meta-box that holds all of the additional topic information
394
  *
395
+ * @since 2.0.0 bbPress (r2464)
 
396
  */
397
+ function bbp_topic_metabox( $post ) {
 
 
 
398
 
399
  /** Type ******************************************************************/
400
 
403
  <p>
404
  <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
405
  <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Topic Type', 'bbpress' ); ?></label>
406
+ <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post->ID ) ); ?>
407
  </p>
408
 
409
  <?php
414
 
415
  <p>
416
  <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
417
+ <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 ); ?>" />
418
  <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', 'bbpress' ); ?></label>
419
+ <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post->ID ) ); ?>
420
  </p>
421
 
422
  <?php
425
 
426
  ?>
427
 
428
+ <hr />
429
+
430
  <p>
431
  <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
432
  <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label>
433
  <?php bbp_dropdown( array(
434
  'post_type' => bbp_get_forum_post_type(),
435
+ 'selected' => bbp_get_topic_forum_id( $post->ID ),
436
  'numberposts' => -1,
437
  'orderby' => 'title',
438
  'order' => 'ASC',
441
 
442
  // Output-related
443
  'select_id' => 'parent_id',
 
444
  'options_only' => false,
445
+ 'show_none' => esc_html__( '&mdash; No forum &mdash;', 'bbpress' ),
446
  'disable_categories' => current_user_can( 'edit_forums' ),
447
  'disabled' => ''
448
  ) ); ?>
452
 
453
  <?php
454
  wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' );
455
+ do_action( 'bbp_topic_metabox', $post );
456
  }
457
 
458
  /** Replies *******************************************************************/
459
 
460
  /**
461
+ * Reply meta-box
462
  *
463
+ * The meta-box that holds all of the additional reply information
464
  *
465
+ * @since 2.0.0 bbPress (r2464)
 
 
 
466
  */
467
+ function bbp_reply_metabox( $post ) {
 
 
 
468
 
469
  // Get some meta
470
+ $reply_topic_id = bbp_get_reply_topic_id( $post->ID );
471
+ $reply_forum_id = bbp_get_reply_forum_id( $post->ID );
472
+ $topic_forum_id = bbp_get_topic_forum_id( $reply_topic_id );
473
+
474
+ /** Status ****************************************************************/
475
+
476
+ ?>
477
+
478
+ <p>
479
+ <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
480
+ <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 ); ?>" />
481
+ <label class="screen-reader-text" for="post_status"><?php esc_html_e( 'Select what status to give the reply.', 'bbpress' ); ?></label>
482
+ <?php bbp_form_reply_status_dropdown( array( 'select_id' => 'post_status', 'reply_id' => $post->ID ) ); ?>
483
+ </p>
484
+
485
+ <hr />
486
+
487
+ <?php
488
+
489
+ /** Forum *****************************************************************/
490
 
491
+ // Only allow individual manipulation of reply forum if there is a mismatch
492
+ if ( ( $reply_forum_id !== $topic_forum_id ) && ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $post->ID ) ) ) : ?>
493
 
494
  <p>
495
  <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
505
 
506
  // Output-related
507
  'select_id' => 'bbp_forum_id',
 
508
  'options_only' => false,
509
+ 'show_none' => esc_html__( '&mdash; No reply &mdash;', 'bbpress' ),
510
  'disable_categories' => current_user_can( 'edit_forums' ),
511
  'disabled' => ''
512
  ) ); ?>
513
  </p>
514
 
515
+ <?php endif;
516
+
517
+ /** Topic *****************************************************************/
518
+
519
+ ?>
520
 
521
  <p>
522
  <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong>
523
  <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label>
524
+ <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' ) ); ?>" />
525
  </p>
526
 
527
+ <?php
528
+
529
+ /** Reply To **************************************************************/
530
+
531
+ // Only show reply-to drop-down when editing an existing reply
532
+ if ( ! empty( $reply_topic_id ) ) : ?>
533
+
534
+ <p>
535
+ <strong class="label"><?php esc_html_e( 'Reply To:', 'bbpress' ); ?></strong>
536
+ <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', 'bbpress' ); ?></label>
537
+ <?php bbp_reply_to_dropdown( $post->ID ); ?>
538
+ </p>
539
+
540
+ <?php
541
+
542
+ endif;
543
+
544
+ ?>
545
 
546
  <input name="ping_status" type="hidden" id="ping_status" value="open" />
547
 
548
  <?php
549
  wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
550
+ do_action( 'bbp_reply_metabox', $post );
551
+ }
552
+
553
+ /**
554
+ * Output the topic replies meta-box
555
+ *
556
+ * @since 2.6.0 bbPress (r5886)
557
+ *
558
+ * @param type $topic
559
+ *
560
+ * @return type
561
+ */
562
+ function bbp_topic_replies_metabox( $topic = false ) {
563
+
564
+ // Bail if no topic to load replies for
565
+ if ( empty( $topic ) ) {
566
+ return;
567
+ }
568
+
569
+ // Pull in the list table class
570
+ if ( ! class_exists( 'BBP_Topic_Replies_List_Table' ) ) {
571
+ require_once bbpress()->admin->admin_dir . '/classes/class-bbp-topic-replies-list-table.php';
572
+ }
573
+
574
+ // Look for pagination value
575
+ $page = isset( $_REQUEST['page'] )
576
+ ? (int) $_REQUEST['page']
577
+ : 0;
578
+
579
+ // Load up the list table
580
+ $replies_list_table = new BBP_Topic_Replies_List_Table();
581
+ $replies_list_table->prepare_items( $topic->ID ); ?>
582
+
583
+ <form id="bbp-topic-replies" method="get">
584
+ <input type="hidden" name="page" value="<?php echo esc_attr( $page ); ?>" />
585
+
586
+ <?php $replies_list_table->display(); ?>
587
+ </form>
588
+
589
+ <?php
590
  }
591
 
592
  /** Users *********************************************************************/
593
 
594
  /**
595
+ * Anonymous user information meta-box
596
  *
597
+ * @since 2.0.0 bbPress (r2828)
598
  *
599
+ * @param WP_Post $post The current post object
 
 
 
600
  */
601
+ function bbp_author_metabox( $post ) {
 
 
 
602
 
603
  // Show extra bits if topic/reply is anonymous
604
+ if ( bbp_is_reply_anonymous( $post->ID ) || bbp_is_topic_anonymous( $post->ID ) ) : ?>
605
 
606
  <p>
607
  <strong class="label"><?php esc_html_e( 'Name:', 'bbpress' ); ?></strong>
608
  <label class="screen-reader-text" for="bbp_anonymous_name"><?php esc_html_e( 'Name', 'bbpress' ); ?></label>
609
+ <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 ) ); ?>" />
610
  </p>
611
 
612
  <p>
613
  <strong class="label"><?php esc_html_e( 'Email:', 'bbpress' ); ?></strong>
614
  <label class="screen-reader-text" for="bbp_anonymous_email"><?php esc_html_e( 'Email', 'bbpress' ); ?></label>
615
+ <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 ) ); ?>" />
616
  </p>
617
 
618
  <p>
619
  <strong class="label"><?php esc_html_e( 'Website:', 'bbpress' ); ?></strong>
620
  <label class="screen-reader-text" for="bbp_anonymous_website"><?php esc_html_e( 'Website', 'bbpress' ); ?></label>
621
+ <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 ) ); ?>" />
622
  </p>
623
 
624
  <?php else : ?>
626
  <p>
627
  <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong>
628
  <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label>
629
+ <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' ) ); ?>" />
630
  </p>
631
 
632
  <?php endif; ?>
634
  <p>
635
  <strong class="label"><?php esc_html_e( 'IP:', 'bbpress' ); ?></strong>
636
  <label class="screen-reader-text" for="bbp_author_ip_address"><?php esc_html_e( 'IP Address', 'bbpress' ); ?></label>
637
+ <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" />
638
  </p>
639
 
640
  <?php
641
 
642
+ do_action( 'bbp_author_metabox', $post );
643
+ }
644
+
645
+ /**
646
+ * Moderator assignment meta-box
647
+ *
648
+ * @since 2.6.0 bbPress (r2828)
649
+ */
650
+ function bbp_moderator_assignment_metabox( $post ) {
651
+
652
+ // Get nicenames
653
+ $user_ids = bbp_get_moderator_ids( $post->ID );
654
+ $user_nicenames = bbp_get_user_nicenames_from_ids( $user_ids );
655
+ $moderators = ! empty( $user_nicenames )
656
+ ? implode( ', ', array_map( 'esc_attr', $user_nicenames ) )
657
+ : ''; ?>
658
+
659
+ <label class="screen-reader-text" for="bbp_moderators"><?php esc_html_e( 'Moderators', 'bbpress' ); ?></label>
660
+ <input type="text" id="bbp_moderators" name="bbp_moderators" value="<?php echo esc_attr( $moderators ); ?>" />
661
+ <p class="howto"><?php esc_html_e( 'Separate user-names with commas', 'bbpress' ); ?></p>
662
+
663
+ <?php
664
+
665
+ do_action( 'bbp_moderator_assignment_metabox', $post );
666
+ }
667
+
668
+ /**
669
+ * See who engaged with a topic
670
+ *
671
+ * @since 2.6.0 bbPress (r6333)
672
+ */
673
+ function bbp_topic_engagements_metabox( $post ) {
674
+
675
+ // Get user IDs
676
+ $user_ids = bbp_get_topic_engagements( $post->ID );
677
+
678
+ // Output
679
+ ?><p><?php
680
+
681
+ // Relationships
682
+ $args = array(
683
+ 'include' => $user_ids
684
+ );
685
+
686
+ // Users were found
687
+ if ( ! empty( $user_ids ) && bbp_has_users( $args ) ) :
688
+
689
+ while ( bbp_users() ) : bbp_the_user();
690
+ echo get_avatar( bbp_get_user_id(), 32 );
691
+ endwhile;
692
+
693
+ // No users
694
+ else :
695
+ esc_html_e( 'No users have engaged to this topic.', 'bbpress' );
696
+ endif;
697
+
698
+ ?></p><?php
699
+
700
+ do_action( 'bbp_topic_engagements_metabox', $post );
701
+ }
702
+
703
+ /**
704
+ * See who marked a topic as a favorite
705
+ *
706
+ * @since 2.6.0 bbPress (r6197)
707
+ * @since 2.6.0 bbPress (r6333) Updated to use BBP_User_Query
708
+ */
709
+ function bbp_topic_favorites_metabox( $post ) {
710
+
711
+ // Get user IDs
712
+ $user_ids = bbp_get_topic_favoriters( $post->ID );
713
+
714
+ // Output
715
+ ?><p><?php
716
+
717
+ // Relationships
718
+ $args = array(
719
+ 'include' => $user_ids
720
+ );
721
+
722
+ // Users were found
723
+ if ( ! empty( $user_ids ) && bbp_has_users( $args ) ) :
724
+
725
+ while ( bbp_users() ) : bbp_the_user();
726
+ echo get_avatar( bbp_get_user_id(), 32 );
727
+ endwhile;
728
+
729
+ // No users
730
+ else :
731
+ esc_html_e( 'No users have favorited this topic.', 'bbpress' );
732
+ endif;
733
+
734
+ ?></p><?php
735
+
736
+ do_action( 'bbp_favorites_metabox', $post );
737
+ }
738
+
739
+ /**
740
+ * See who subscribed to a topic
741
+ *
742
+ * @since 2.6.0 bbPress (r6197)
743
+ * @since 2.6.0 bbPress (r6333) Updated to use BBP_User_Query
744
+ */
745
+ function bbp_topic_subscriptions_metabox( $post ) {
746
+
747
+ // Get user IDs
748
+ $user_ids = bbp_get_subscribers( $post->ID );
749
+
750
+ // Output
751
+ ?><p><?php
752
+
753
+ // Relationships
754
+ $args = array(
755
+ 'include' => $user_ids
756
+ );
757
+
758
+ // Users were found
759
+ if ( ! empty( $user_ids ) && bbp_has_users( $args ) ) :
760
+
761
+ while ( bbp_users() ) : bbp_the_user();
762
+ echo get_avatar( bbp_get_user_id(), 32 );
763
+ endwhile;
764
+
765
+ // No users
766
+ else :
767
+ esc_html_e( 'No users have subscribed to this topic.', 'bbpress' );
768
+ endif;
769
+
770
+ ?></p><?php
771
+
772
+ do_action( 'bbp_subscriptions_metabox', $post );
773
+ }
774
+
775
+ /**
776
+ * See who subscribed to a forum
777
+ *
778
+ * @since 2.6.0 bbPress (r6197)
779
+ * @since 2.6.0 bbPress (r6333) Updated to use BBP_User_Query
780
+ */
781
+ function bbp_forum_subscriptions_metabox( $post ) {
782
+
783
+ // Get user IDs
784
+ $user_ids = bbp_get_subscribers( $post->ID );
785
+
786
+ // Output
787
+ ?><p><?php
788
+
789
+ // Relationships
790
+ $args = array(
791
+ 'include' => $user_ids
792
+ );
793
+
794
+ // Users were found
795
+ if ( ! empty( $user_ids ) && bbp_has_users( $args ) ) :
796
+
797
+ while ( bbp_users() ) : bbp_the_user();
798
+ echo get_avatar( bbp_get_user_id(), 32 );
799
+ endwhile;
800
+
801
+ // No users
802
+ else :
803
+ esc_html_e( 'No users have subscribed to this forum.', 'bbpress' );
804
+ endif;
805
+
806
+ ?></p><?php
807
+
808
+ do_action( 'bbp_forum_subscriptions_metabox', $post );
809
  }
includes/admin/parser.php CHANGED
@@ -1,4 +1,12 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  /*
3
  This is a compressed copy of NBBC. Do not edit!
4
 
@@ -1150,7 +1158,7 @@ function UnHTMLEncode($string) {
1150
  if (function_exists("html_entity_decode"))
1151
  return html_entity_decode($string);
1152
  $string = preg_replace_callback('~&#x([0-9a-f]+);~i', array( $this, '_UnHTMLEncode_chr_callback'), $string);
1153
- $string = preg_replace_callback('~&#([0-9]+);~', array($this, '_UnHTMLEncode_chr_hexdec_callback'), $string);
1154
  $trans_tbl = get_html_translation_table(HTML_ENTITIES);
1155
  $trans_tbl = array_flip($trans_tbl);
1156
  return strtr($string, $trans_tbl);
@@ -1392,7 +1400,7 @@ if (isset($insert_array[$matches[1]]))
1392
  $value = @$insert_array[$matches[1]];
1393
  else $value = @$default_array[$matches[1]];
1394
  if (strlen(@$matches[2])) {
1395
- foreach (explode(".", substr($matches[2], 1)) as $index) {
1396
  if (is_array($value))
1397
  $value = @$value[$index];
1398
  else if (is_object($value)) {
@@ -1474,7 +1482,7 @@ $end = $this->Internal_CleanupWSByIteratingPointer(@$rule['before_endtag'], 0, $
1474
  $this->Internal_CleanupWSByPoppingStack(@$rule['after_tag'], $output);
1475
  $tag_body = $this->Internal_CollectTextReverse($output, count($output)-1, $end);
1476
  $this->Internal_CleanupWSByPoppingStack(@$rule['before_tag'], $this->stack);
1477
- $this->Internal_UpdateParamsForMissingEndTag(@$token[BBCODE_STACK_TAG]);
1478
  $tag_output = $this->DoTag(BBCODE_OUTPUT, $name,
1479
  @$token[BBCODE_STACK_TAG]['_default'], @$token[BBCODE_STACK_TAG], $tag_body);
1480
  $output = Array(Array(
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
 
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);
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)) {
1482
  $this->Internal_CleanupWSByPoppingStack(@$rule['after_tag'], $output);
1483
  $tag_body = $this->Internal_CollectTextReverse($output, count($output)-1, $end);
1484
  $this->Internal_CleanupWSByPoppingStack(@$rule['before_tag'], $this->stack);
1485
+ @$this->Internal_UpdateParamsForMissingEndTag(@$token[BBCODE_STACK_TAG]);
1486
  $tag_output = $this->DoTag(BBCODE_OUTPUT, $name,
1487
  @$token[BBCODE_STACK_TAG]['_default'], @$token[BBCODE_STACK_TAG], $tag_body);
1488
  $output = Array(Array(
includes/admin/replies.php CHANGED
@@ -8,15 +8,15 @@
8
  */
9
 
10
  // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
- if ( !class_exists( 'BBP_Replies_Admin' ) ) :
14
  /**
15
  * Loads bbPress replies admin area
16
  *
17
  * @package bbPress
18
  * @subpackage Administration
19
- * @since bbPress (r2464)
20
  */
21
  class BBP_Replies_Admin {
22
 
@@ -32,11 +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
39
- * @uses BBP_Replies_Admin::setup_actions() Setup the help text
40
  */
41
  public function __construct() {
42
  $this->setup_globals();
@@ -46,23 +42,23 @@ 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
53
- * @uses add_filter() To add various filters
54
- * @uses bbp_get_forum_post_type() To get the forum post type
55
- * @uses bbp_get_topic_post_type() To get the topic post type
56
- * @uses bbp_get_reply_post_type() To get the reply post type
57
  */
58
  private function setup_actions() {
59
 
60
- // Add some general styling to the admin area
61
- add_action( 'bbp_admin_head', array( $this, 'admin_head' ) );
62
-
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
 
@@ -70,17 +66,16 @@ class BBP_Replies_Admin {
70
  add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
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 +86,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 +102,10 @@ 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 +121,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 +135,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 +149,25 @@ 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,116 +210,149 @@ 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',
257
- $this->post_type,
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
272
- * editing the reply
273
- * @uses do_action() Calls 'bbp_reply_attributes_metabox_save' with the
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 );
 
 
313
 
314
- // Allow other fun things to happen
315
- do_action( 'bbp_reply_attributes_metabox_save', $reply_id, $topic_id, $forum_id, $reply_to );
316
- do_action( 'bbp_author_metabox_save', $reply_id, $anonymous_data );
 
317
 
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' ),
@@ -350,77 +361,73 @@ class BBP_Replies_Admin {
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
364
- * @uses bbp_get_reply_post_type() To get the reply post type
365
- * @uses sanitize_html_class() To sanitize the classes
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">
375
- /*<![CDATA[*/
376
-
377
- strong.label {
378
- display: inline-block;
379
- width: 60px;
380
- }
381
 
382
- .column-bbp_forum_topic_count,
383
- .column-bbp_forum_reply_count,
384
- .column-bbp_topic_reply_count,
385
- .column-bbp_topic_voice_count {
386
- width: 8% !important;
387
- }
388
 
389
- .column-author,
390
- .column-bbp_reply_author,
391
- .column-bbp_topic_author {
392
- width: 10% !important;
393
- }
394
 
395
- .column-bbp_topic_forum,
396
- .column-bbp_reply_forum,
397
- .column-bbp_reply_topic {
398
- width: 10% !important;
399
- }
400
 
401
- .column-bbp_forum_freshness,
402
- .column-bbp_topic_freshness {
403
- width: 10% !important;
404
- }
405
 
406
- .column-bbp_forum_created,
407
- .column-bbp_topic_created,
408
- .column-bbp_reply_created {
409
- width: 15% !important;
410
- }
411
 
412
- .status-closed {
413
- background-color: #eaeaea;
414
- }
 
415
 
416
- .status-spam {
417
- background-color: #faeaea;
418
- }
419
 
420
- /*]]>*/
421
- </style>
 
422
 
423
- <?php
424
  }
425
 
426
  /**
@@ -428,68 +435,85 @@ 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
435
- * the reply
436
- * @uses wp_die() To die if the user isn't capable or the post wasn't
437
- * found
438
- * @uses check_admin_referer() To verify the nonce and check referer
439
- * @uses bbp_is_reply_spam() To check if the reply is marked as spam
440
- * @uses bbp_unspam_reply() To unmark the reply as spam
441
- * @uses bbp_spam_reply() To mark the reply as spam
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
456
- $post_data = array( 'ID' => $reply_id ); // Prelim array
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
 
470
- $is_spam = bbp_is_reply_spam( $reply_id );
471
- $message = $is_spam ? 'unspammed' : 'spammed';
472
- $success = $is_spam ? bbp_unspam_reply( $reply_id ) : bbp_spam_reply( $reply_id );
 
 
 
 
473
 
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
 
495
  /**
@@ -498,72 +522,122 @@ 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
505
- * @uses esc_html() To sanitize the reply title
506
- * @uses apply_filters() Calls 'bbp_toggle_reply_notice_admin' with
507
- * message, reply id, notice and is it a failure
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
 
540
- // Do additional reply toggle notice filters (admin side)
541
- $message = apply_filters( 'bbp_toggle_reply_notice_admin', $message, $reply->ID, $notice, $is_failure );
 
 
 
 
542
 
543
- ?>
 
 
 
 
544
 
545
- <div id="message" class="<?php echo $is_failure === true ? 'error' : 'updated'; ?> fade">
546
- <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
547
- </div>
548
 
549
- <?php
550
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  }
552
 
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
560
- * the columns
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' ),
@@ -573,40 +647,20 @@ class BBP_Replies_Admin {
573
  'bbp_reply_created' => __( 'Created', 'bbpress' ),
574
  );
575
 
 
576
  return apply_filters( 'bbp_admin_replies_column_headers', $columns );
577
  }
578
 
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
586
- * @uses bbp_get_reply_topic_id() To get the topic id of the reply
587
- * @uses bbp_topic_title() To output the reply's topic title
588
- * @uses apply_filters() Calls 'reply_topic_row_actions' with an array
589
- * of reply topic actions
590
- * @uses bbp_get_topic_permalink() To get the topic permalink
591
- * @uses bbp_get_topic_forum_id() To get the forum id of the topic of
592
- * the reply
593
- * @uses bbp_get_forum_permalink() To get the forum permalink
594
- * @uses admin_url() To get the admin url of post.php
595
- * @uses apply_filters() Calls 'reply_topic_forum_row_actions' with an
596
- * array of reply topic forum actions
597
- * @uses bbp_reply_author_display_name() To output the reply author name
598
- * @uses get_the_date() Get the reply creation date
599
- * @uses get_the_time() Get the reply creation time
600
- * @uses esc_attr() To sanitize the reply creation time
601
- * @uses bbp_get_reply_last_active_time() To get the time when the reply was
602
- * last active
603
- * @uses do_action() Calls 'bbp_admin_replies_column_data' with the
604
- * column and reply id
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
 
@@ -616,21 +670,21 @@ class BBP_Replies_Admin {
616
  // Topic
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 );
624
- if ( empty( $topic_title ) ) {
625
- $topic_title = esc_html__( 'No Topic', 'bbpress' );
626
- }
627
-
628
- // Output the title
629
  echo $topic_title;
630
 
631
- // Reply has no topic
632
  } else {
633
- esc_html_e( 'No Topic', 'bbpress' );
 
 
 
634
  }
635
 
636
  break;
@@ -642,35 +696,35 @@ class BBP_Replies_Admin {
642
  $reply_forum_id = bbp_get_reply_forum_id( $reply_id );
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 );
650
- if ( empty( $forum_title ) ) {
651
- $forum_title = esc_html__( 'No Forum', 'bbpress' );
652
- }
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
  }
 
660
 
661
- // Output the title
 
662
  echo $forum_title;
663
 
664
  // Reply has no forum
665
  } else {
666
- _e( 'No Forum', 'bbpress' );
 
 
 
667
  }
668
 
669
  break;
670
 
671
  // Author
672
  case 'bbp_reply_author' :
673
- bbp_reply_author_display_name ( $reply_id );
674
  break;
675
 
676
  // Freshness
@@ -697,40 +751,46 @@ 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
710
- * @uses bbp_is_reply_spam() To check if the reply is marked as spam
711
- * @uses get_post_type_object() To get the reply post type object
712
- * @uses add_query_arg() To add custom args to the url
713
- * @uses remove_query_arg() To remove custom args from the url
714
- * @uses wp_nonce_url() To nonce the url
715
- * @uses get_delete_post_link() To get the delete post link of the reply
716
  * @return array $actions Actions
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>';
@@ -742,15 +802,17 @@ class BBP_Replies_Admin {
742
 
743
  // Trash
744
  if ( current_user_can( 'delete_reply', $reply->ID ) ) {
 
 
745
  if ( bbp_get_trash_status_id() === $reply->post_status ) {
746
  $post_type_object = get_post_type_object( bbp_get_reply_post_type() );
747
- $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
748
- } elseif ( EMPTY_TRASH_DAYS ) {
749
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
750
  }
751
 
752
- if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) {
753
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
754
  } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
755
  unset( $actions['trash'] );
756
  }
@@ -762,52 +824,49 @@ 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
769
- * @uses bbp_dropdown() To generate a forum dropdown
770
  * @return bool False. If post type is not topic or reply
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(
788
  'selected' => $selected,
789
- 'show_none' => __( 'In all forums', 'bbpress' )
790
  ) );
791
  }
792
 
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
800
- * @uses bbp_get_topic_post_type() To get the topic post type
801
- * @uses bbp_get_reply_post_type() To get the reply post type
802
  * @return array Processed Query Vars
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,13 +877,9 @@ 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()
825
- * @uses wp_post_revision_title()
826
- * @uses esc_url()
827
- * @uses add_query_arg()
828
  *
829
  * @param array $messages
830
  *
@@ -833,8 +888,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 +895,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 +922,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 +972,17 @@ 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
  /**
15
  * Loads bbPress replies admin area
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
  public function __construct() {
38
  $this->setup_globals();
42
  /**
43
  * Setup the admin hooks, actions and filters
44
  *
45
+ * @since 2.0.0 bbPress (r2646)
46
+ * @since 2.6.0 bbPress (r6101) Added bulk actions
47
  *
48
+ * @access private
 
 
 
 
49
  */
50
  private function setup_actions() {
51
 
 
 
 
52
  // Messages
53
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
54
 
55
+ // Reply bulk actions, added in WordPress 4.7, see #WP16031
56
+ if ( bbp_get_major_wp_version() >= 4.7 ) {
57
+ add_filter( 'bulk_actions-edit-reply', array( $this, 'bulk_actions' ) );
58
+ add_filter( 'handle_bulk_actions-edit-reply', array( $this, 'handle_bulk_actions' ), 10, 3 );
59
+ add_filter( 'bulk_post_updated_messages', array( $this, 'bulk_post_updated_messages' ), 10, 2 );
60
+ }
61
+
62
  // Reply column headers.
63
  add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
64
 
66
  add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
67
  add_filter( 'post_row_actions', array( $this, 'row_actions' ), 10, 2 );
68
 
69
+ // Reply meta-box actions
70
+ add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
71
+ add_action( 'add_meta_boxes', array( $this, 'author_metabox' ) );
72
+ add_action( 'add_meta_boxes', array( $this, 'comments_metabox' ) );
73
+ add_action( 'save_post', array( $this, 'save_meta_boxes' ) );
74
 
75
  // Check if there are any bbp_toggle_reply_* requests on admin_init, also have a message displayed
76
  add_action( 'load-edit.php', array( $this, 'toggle_reply' ) );
77
  add_action( 'admin_notices', array( $this, 'toggle_reply_notice' ) );
78
 
 
 
 
79
  // Add ability to filter topics and replies per forum
80
  add_filter( 'restrict_manage_posts', array( $this, 'filter_dropdown' ) );
81
  add_filter( 'bbp_request', array( $this, 'filter_post_rows' ) );
86
  add_action( 'load-post-new.php', array( $this, 'new_help' ) );
87
  }
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  /**
90
  * Admin globals
91
  *
92
+ * @since 2.0.0 bbPress (r2646)
93
+ *
94
  * @access private
95
  */
96
  private function setup_globals() {
102
  /**
103
  * Contextual help for bbPress reply edit page
104
  *
105
+ * @since 2.0.0 bbPress (r3119)
 
106
  */
107
  public function edit_help() {
108
 
 
 
109
  // Overview
110
  get_current_screen()->add_help_tab( array(
111
  'id' => 'overview',
121
  'content' =>
122
  '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:', 'bbpress' ) . '</p>' .
123
  '<ul>' .
124
+ '<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>' .
125
+ '<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>' .
126
+ '<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>' .
127
+ '<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>' .
128
  '</ul>'
129
  ) );
130
 
135
  'content' =>
136
  '<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>' .
137
  '<ul>' .
138
+ '<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>' .
139
+ //'<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>' .
140
+ '<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>' .
141
+ '<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>' .
142
+ '<li>' . __( '<strong>View</strong> will take you to your live site to view the reply.', 'bbpress' ) . '</li>' .
143
+ '<li>' . __( '<strong>Approve</strong> will change the status from pending to publish.', 'bbpress' ) . '</li>' .
144
  '</ul>'
145
  ) );
146
 
149
  'id' => 'bulk-actions',
150
  'title' => __( 'Bulk Actions', 'bbpress' ),
151
  'content' =>
152
+ '<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>' .
153
  '<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>'
154
  ) );
155
 
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 reply edit page
166
  *
167
+ * @since 2.0.0 bbPress (r3119)
 
168
  */
169
  public function new_help() {
170
 
 
 
171
  $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>';
172
 
173
  get_current_screen()->add_help_tab( array(
210
 
211
  get_current_screen()->set_help_sidebar(
212
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
213
+ '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
214
+ '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
215
  );
216
  }
217
 
218
  /**
219
+ * Add spam/unspam bulk actions to the bulk action dropdown.
220
  *
221
+ * @since 2.6.0 bbPress (r6101)
222
  *
223
+ * @param array $actions The list of bulk actions.
224
+ * @return array The filtered list of bulk actions.
 
225
  */
226
+ public function bulk_actions( $actions ) {
227
 
228
+ if ( current_user_can( 'moderate' ) ) {
229
+ if ( bbp_get_spam_status_id() === get_query_var( 'post_status' ) ) {
230
+ $actions['unspam'] = __( 'Unspam', 'bbpress' );
231
+ } else {
232
+ $actions['spam'] = __( 'Spam', 'bbpress' );
233
+ }
234
+ }
235
 
236
+ return $actions;
237
+ }
 
 
 
 
 
 
238
 
239
+ /**
240
+ * Add custom bulk action updated messages for replies.
241
+ *
242
+ * @since 2.6.0 bbPress (r6101)
243
+ *
244
+ * @param array $bulk_messages Arrays of messages, each keyed by the corresponding post type.
245
+ * @param array $bulk_counts Array of item counts for each message, used to build internationalized strings.
246
+ */
247
+ public function bulk_post_updated_messages( $bulk_messages, $bulk_counts ) {
248
+ $bulk_messages['reply']['updated'] = _n( '%s reply updated.', '%s replies updated.', $bulk_counts['updated'], 'bbpress');
249
+ $bulk_messages['reply']['locked'] = ( 1 === $bulk_counts['locked'] )
250
+ ? __( '1 reply not updated, somebody is editing it.', 'bbpress' )
251
+ : _n( '%s reply not updated, somebody is editing it.', '%s replies not updated, somebody is editing them.', $bulk_counts['locked'], 'bbpress' );
252
+
253
+ return $bulk_messages;
254
  }
255
 
256
  /**
257
+ * Handle spam/unspam bulk actions.
258
  *
259
+ * @since 2.6.0 bbPress (r6101)
260
  *
261
+ * @param string $sendback The sendback URL.
262
+ * @param string $doaction The action to be taken.
263
+ * @param array $post_ids The post IDS to take the action on.
264
+ * @return string The sendback URL.
 
 
265
  */
266
+ public function handle_bulk_actions( $sendback, $doaction, $post_ids ) {
267
 
268
+ $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
269
+ $updated = $locked = 0;
270
 
271
+ if ( 'spam' === $doaction ) {
 
 
272
 
273
+ foreach ( (array) $post_ids as $post_id ) {
274
+ if ( ! current_user_can( 'moderate', $post_id ) ) {
275
+ wp_die( __( 'Sorry, you are not allowed to spam this item.', 'bbpress' ) );
276
+ }
277
 
278
+ if ( wp_check_post_lock( $post_id ) ) {
279
+ $locked++;
280
+ continue;
281
+ }
282
 
283
+ if ( ! bbp_spam_reply( $post_id ) ) {
284
+ wp_die( __( 'Error in spamming reply.', 'bbpress' ) );
285
+ }
286
 
287
+ $updated++;
288
+ }
 
289
 
290
+ $sendback = add_query_arg( array(
291
+ 'updated' => $updated,
292
+ 'ids' => implode( ',', $post_ids ),
293
+ 'locked' => $locked
294
+ ), $sendback );
295
 
296
+ } elseif ( 'unspam' === $doaction ) {
 
 
 
297
 
298
+ foreach ( (array) $post_ids as $post_id ) {
299
+ if ( ! current_user_can( 'moderate', $post_id ) ) {
300
+ wp_die( __( 'Sorry, you are not allowed to unspam this reply.', 'bbpress' ) );
301
+ }
302
 
303
+ if ( wp_check_post_lock( $post_id ) ) {
304
+ $locked++;
305
+ continue;
306
+ }
307
 
308
+ if ( ! bbp_unspam_reply( $post_id ) ) {
309
+ wp_die( __( 'Error in unspamming reply.', 'bbpress' ) );
310
+ }
311
+
312
+ $updated++;
313
+ }
314
+
315
+ $sendback = add_query_arg( array(
316
+ 'updated' => $updated,
317
+ 'ids' => implode( ',', $post_ids ),
318
+ 'locked' => $locked
319
+ ), $sendback );
320
+ }
321
+
322
+ return $sendback;
323
  }
324
 
325
  /**
326
+ * Add the reply attributes meta-box
327
  *
328
+ * @since 2.0.0 bbPress (r2746)
329
+ */
330
+ public function attributes_metabox() {
331
+ add_meta_box(
332
+ 'bbp_reply_attributes',
333
+ __( 'Reply Attributes', 'bbpress' ),
334
+ 'bbp_reply_metabox',
335
+ $this->post_type,
336
+ 'side',
337
+ 'high'
338
+ );
339
+ }
340
+
341
+ /**
342
+ * Add the author info meta-box
343
  *
344
+ * Allows editing of information about an author
345
  *
346
+ * @since 2.0.0 bbPress (r2828)
 
 
 
 
 
 
347
  */
348
  public function author_metabox() {
349
 
 
 
350
  // Bail if post_type is not a reply
351
+ if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) ) {
352
  return;
353
+ }
354
 
355
+ // Add the meta-box
356
  add_meta_box(
357
  'bbp_author_metabox',
358
  __( 'Author Information', 'bbpress' ),
361
  'side',
362
  'high'
363
  );
364
+ }
365
 
366
+ /**
367
+ * Remove comments & discussion meta-boxes if comments are not supported
368
+ *
369
+ * @since 2.6.0 bbPress (r6186)
370
+ */
371
+ public function comments_metabox() {
372
+ if ( ! post_type_supports( $this->post_type, 'comments' ) ) {
373
+ remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
374
+ remove_meta_box( 'commentsdiv', $this->post_type, 'normal' );
375
+ }
376
  }
377
 
378
  /**
379
+ * Pass the reply attributes for processing
380
  *
381
+ * @since 2.0.0 bbPress (r2746)
382
  *
383
+ * @param int $reply_id Reply id
384
+ * @return int Parent id
 
 
 
385
  */
386
+ public function save_meta_boxes( $reply_id ) {
387
 
388
+ // Bail if doing an autosave
389
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
390
+ return $reply_id;
391
+ }
 
 
 
 
 
 
 
392
 
393
+ // Bail if not a post request
394
+ if ( ! bbp_is_post_request() ) {
395
+ return $reply_id;
396
+ }
 
 
397
 
398
+ // Check action exists
399
+ if ( empty( $_POST['action'] ) ) {
400
+ return $reply_id;
401
+ }
 
402
 
403
+ // Nonce check
404
+ if ( empty( $_POST['bbp_reply_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_reply_metabox'], 'bbp_reply_metabox_save' ) ) {
405
+ return $reply_id;
406
+ }
 
407
 
408
+ // Bail if current user cannot edit this reply
409
+ if ( ! current_user_can( 'edit_reply', $reply_id ) ) {
410
+ return $reply_id;
411
+ }
412
 
413
+ // Get the reply meta post values
414
+ $topic_id = ! empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0;
415
+ $forum_id = ! empty( $_POST['bbp_forum_id'] ) ? (int) $_POST['bbp_forum_id'] : bbp_get_topic_forum_id( $topic_id );
416
+ $reply_to = ! empty( $_POST['bbp_reply_to'] ) ? (int) $_POST['bbp_reply_to'] : 0;
 
417
 
418
+ // Get reply author data
419
+ $anonymous_data = bbp_filter_anonymous_post_data();
420
+ $author_id = bbp_get_reply_author_id( $reply_id );
421
+ $is_edit = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) );
422
 
423
+ // Formally update the reply
424
+ bbp_update_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit, $reply_to );
 
425
 
426
+ // Allow other fun things to happen
427
+ do_action( 'bbp_reply_attributes_metabox_save', $reply_id, $topic_id, $forum_id, $reply_to );
428
+ do_action( 'bbp_author_metabox_save', $reply_id, $anonymous_data );
429
 
430
+ return $reply_id;
431
  }
432
 
433
  /**
435
  *
436
  * Handles the admin-side spamming/unspamming of replies
437
  *
438
+ * @since 2.0.0 bbPress (r2740)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
  */
440
  public function toggle_reply() {
441
 
442
+ // Bail if not a topic toggle action
443
+ if ( ! bbp_is_get_request() || empty( $_GET['action'] ) || empty( $_GET['reply_id'] ) ) {
444
+ return;
445
+ }
446
+
447
+ // Bail if not an allowed action
448
+ $action = sanitize_key( $_GET['action'] );
449
+ if ( empty( $action ) || ! in_array( $action, $this->get_allowed_action_toggles(), true ) ) {
450
+ return;
451
+ }
452
 
453
+ // Get reply and die if empty
454
+ $reply_id = bbp_get_reply_id( $_GET['reply_id'] );
455
+ if ( ! bbp_get_reply( $reply_id ) ) {
456
+ wp_die( __( 'The reply was not found.', 'bbpress' ) );
457
+ }
 
458
 
459
+ // What is the user doing here?
460
+ if ( ! current_user_can( 'moderate', $reply_id ) ) {
461
+ wp_die( __( 'You do not have permission to do that.', 'bbpress' ) );
462
+ }
463
 
464
+ // Defaults
465
+ $post_data = array( 'ID' => $reply_id );
466
+ $message = '';
467
+ $success = false;
468
 
469
+ switch ( $action ) {
470
+ case 'bbp_toggle_reply_approve' :
471
+ check_admin_referer( 'approve-reply_' . $reply_id );
472
 
473
+ $is_approve = bbp_is_reply_pending( $reply_id );
474
+ $message = ( true === $is_approve )
475
+ ? 'approved'
476
+ : 'unapproved';
477
+ $success = ( true === $is_approve )
478
+ ? bbp_approve_reply( $reply_id )
479
+ : bbp_unapprove_reply( $reply_id );
480
 
481
+ break;
 
482
 
483
+ case 'bbp_toggle_reply_spam' :
484
+ check_admin_referer( 'spam-reply_' . $reply_id );
485
 
486
+ $is_spam = bbp_is_reply_spam( $reply_id );
487
+ $message = ( true === $is_spam )
488
+ ? 'unspammed'
489
+ : 'spammed';
490
+ $success = ( true === $is_spam )
491
+ ? bbp_unspam_reply( $reply_id )
492
+ : bbp_spam_reply( $reply_id );
493
 
494
+ break;
495
+ }
496
 
497
+ // Setup the message
498
+ $retval = array(
499
+ 'bbp_reply_toggle_notice' => $message,
500
+ 'reply_id' => $reply_id
501
+ );
502
 
503
+ // Prepare for failure
504
+ if ( ( false === $success ) || is_wp_error( $success ) ) {
505
+ $retval['failed'] = '1';
506
  }
507
+
508
+ // Filter all message args
509
+ $retval = apply_filters( 'bbp_toggle_reply_action_admin', $retval, $reply_id, $action );
510
+
511
+ // Do additional reply toggle actions (admin side)
512
+ do_action( 'bbp_toggle_reply_admin', $success, $post_data, $action, $retval );
513
+
514
+ // Redirect back to the reply
515
+ $redirect = add_query_arg( $retval, remove_query_arg( array( 'action', 'reply_id' ) ) );
516
+ bbp_redirect( $redirect );
517
  }
518
 
519
  /**
522
  * Display the success/error notices from
523
  * {@link BBP_Admin::toggle_reply()}
524
  *
525
+ * @since 2.0.0 bbPress (r2740)
 
 
 
 
 
 
526
  */
527
  public function toggle_reply_notice() {
528
 
529
+ // Bail if missing reply toggle action
530
+ if ( ! bbp_is_get_request() || empty( $_GET['reply_id'] ) || empty( $_GET['bbp_reply_toggle_notice'] ) ) {
531
+ return;
532
+ }
533
 
534
+ // Bail if not an allowed notice
535
+ $notice = sanitize_key( $_GET['bbp_reply_toggle_notice'] );
536
+ if ( empty( $notice ) || ! in_array( $notice, $this->get_allowed_notice_toggles(), true ) ) {
537
+ return;
538
+ }
539
 
540
+ // Bail if no reply_id or notice
541
+ $reply_id = bbp_get_reply_id( $_GET['reply_id'] );
542
+ if ( empty( $reply_id ) ) {
543
+ return;
544
+ }
545
 
546
+ // Bail if reply is missing
547
+ if ( ! bbp_get_reply( $reply_id ) ) {
548
+ return;
549
+ }
550
+
551
+ // Use the title in the responses
552
+ $reply_title = bbp_get_reply_title( $reply_id );
553
+ $is_failure = ! empty( $_GET['failed'] );
554
+ $message = '';
555
 
556
+ switch ( $notice ) {
557
+ case 'spammed' :
558
+ $message = ( $is_failure === true )
559
+ ? sprintf( __( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title )
560
+ : sprintf( __( 'Reply "%1$s" successfully marked as spam.', 'bbpress' ), $reply_title );
561
+ break;
562
 
563
+ case 'unspammed' :
564
+ $message = ( $is_failure === true )
565
+ ? sprintf( __( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title )
566
+ : sprintf( __( 'Reply "%1$s" successfully unmarked as spam.', 'bbpress' ), $reply_title );
567
+ break;
568
 
569
+ case 'approved' :
570
+ $message = ( $is_failure === true )
571
+ ? sprintf( __( 'There was a problem approving the reply "%1$s".', 'bbpress' ), $reply_title )
572
+ : sprintf( __( 'Reply "%1$s" successfully approved.', 'bbpress' ), $reply_title );
573
+ break;
574
 
575
+ case 'unapproved' :
576
+ $message = ( $is_failure === true )
577
+ ? sprintf( __( 'There was a problem unapproving the reply "%1$s".', 'bbpress' ), $reply_title )
578
+ : sprintf( __( 'Reply "%1$s" successfully unapproved.', 'bbpress' ), $reply_title );
579
+ break;
580
+ }
581
 
582
+ // Do additional reply toggle notice filters (admin side)
583
+ $message = apply_filters( 'bbp_toggle_reply_notice_admin', $message, $reply_id, $notice, $is_failure );
584
+ $class = ( $is_failure === true )
585
+ ? 'error'
586
+ : 'updated';
587
 
588
+ ?>
 
 
589
 
590
+ <div id="message" class="<?php echo esc_html( $class ); ?> fade">
591
+ <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
592
+ </div>
593
+
594
+ <?php
595
+ }
596
+
597
+ /**
598
+ * Returns an array of notice toggles
599
+ *
600
+ * @since 2.6.0 bbPress (r6396)
601
+ *
602
+ * @return array
603
+ */
604
+ private function get_allowed_notice_toggles() {
605
+
606
+ // Filter & return
607
+ return apply_filters( 'bbp_admin_replies_allowed_notice_toggles', array(
608
+ 'spammed',
609
+ 'unspammed',
610
+ 'approved',
611
+ 'unapproved'
612
+ ) );
613
+ }
614
+
615
+ /**
616
+ * Returns an array of notice toggles
617
+ *
618
+ * @since 2.6.0 bbPress (r6396)
619
+ *
620
+ * @return array
621
+ */
622
+ private function get_allowed_action_toggles() {
623
+
624
+ // Filter & return
625
+ return apply_filters( 'bbp_admin_replies_allowed_action_toggles', array(
626
+ 'bbp_toggle_reply_spam',
627
+ 'bbp_toggle_reply_approve'
628
+ ) );
629
  }
630
 
631
  /**
632
  * Manage the column headers for the replies page
633
  *
634
+ * @since 2.0.0 bbPress (r2577)
635
  *
636
  * @param array $columns The columns
637
+ *
 
638
  * @return array $columns bbPress reply columns
639
  */
640
  public function column_headers( $columns ) {
 
 
 
641
  $columns = array(
642
  'cb' => '<input type="checkbox" />',
643
  'title' => __( 'Title', 'bbpress' ),
647
  'bbp_reply_created' => __( 'Created', 'bbpress' ),
648
  );
649
 
650
+ // Filter & return
651
  return apply_filters( 'bbp_admin_replies_column_headers', $columns );
652
  }
653
 
654
  /**
655
  * Print extra columns for the replies page
656
  *
657
+ * @since 2.0.0 bbPress (r2577)
658
  *
659
  * @param string $column Column
660
  * @param int $reply_id reply id
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  */
662
  public function column_data( $column, $reply_id ) {
663
 
 
 
664
  // Get topic ID
665
  $topic_id = bbp_get_reply_topic_id( $reply_id );
666
 
670
  // Topic
671
  case 'bbp_reply_topic' :
672
 
673
+ // Get title
674
+ $topic_title = ! empty( $topic_id )
675
+ ? bbp_get_topic_title( $topic_id )
676
+ : '';
677
 
678
+ // Output topic name
679
+ if ( ! empty( $topic_title ) ) {
 
 
 
 
 
680
  echo $topic_title;
681
 
682
+ // Output dash
683
  } else {
684
+ ?>
685
+ <span aria-hidden="true">&mdash;</span>
686
+ <span class="screen-reader-text"><?php esc_html_e( 'No topic', 'bbpress' ); ?></span>
687
+ <?php
688
  }
689
 
690
  break;
696
  $reply_forum_id = bbp_get_reply_forum_id( $reply_id );
697
  $topic_forum_id = bbp_get_topic_forum_id( $topic_id );
698
 
699
+ // Forum Title
700
+ $forum_title = ! empty( $reply_forum_id )
701
+ ? bbp_get_forum_title( $reply_forum_id )
702
+ : '';
703
 
704
+ // Alert capable users of reply forum mismatch
705
+ if ( $reply_forum_id !== $topic_forum_id ) {
706
+ if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $reply_id ) ) {
707
+ $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>';
 
 
 
 
 
 
 
708
  }
709
+ }
710
 
711
+ // Output forum name
712
+ if ( ! empty( $forum_title ) ) {
713
  echo $forum_title;
714
 
715
  // Reply has no forum
716
  } else {
717
+ ?>
718
+ <span aria-hidden="true">&mdash;</span>
719
+ <span class="screen-reader-text"><?php esc_html_e( 'No forum', 'bbpress' ); ?></span>
720
+ <?php
721
  }
722
 
723
  break;
724
 
725
  // Author
726
  case 'bbp_reply_author' :
727
+ bbp_reply_author_display_name( $reply_id );
728
  break;
729
 
730
  // Freshness
751
  * Remove the quick-edit action link under the reply title and add the
752
  * content and spam link
753
  *
754
+ * @since 2.0.0 bbPress (r2577)
755
  *
756
  * @param array $actions Actions
757
  * @param array $reply Reply object
758
+ *
 
 
 
 
 
 
 
 
 
 
 
759
  * @return array $actions Actions
760
  */
761
  public function row_actions( $actions, $reply ) {
762
 
 
 
763
  unset( $actions['inline hide-if-no-js'] );
764
 
765
+ // View link
766
+ $view_link = bbp_get_reply_url( $reply->ID );
767
+
768
+ // Maybe add view=all
769
+ if ( ! in_array( $reply->post_status, array( bbp_get_closed_status_id(), bbp_get_public_status_id() ), true ) ) {
770
+ $view_link = bbp_add_view_all( $view_link, true );
771
+ }
772
+
773
  // Reply view links to topic
774
+ $actions['view'] = '<a href="' . esc_url( $view_link ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
775
 
776
  // User cannot view replies in trash
777
+ if ( ( bbp_get_trash_status_id() === $reply->post_status ) && ! current_user_can( 'view_trash' ) ) {
778
  unset( $actions['view'] );
779
+ }
780
 
781
  // Only show the actions if the user is capable of viewing them
782
  if ( current_user_can( 'moderate', $reply->ID ) ) {
783
+
784
+ // Show the 'approve' link on pending posts only and 'unapprove' on published posts only
785
+ $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 );
786
+ if ( bbp_is_reply_published( $reply->ID ) ) {
787
+ $actions['unapproved'] = '<a href="' . esc_url( $approve_uri ) . '" title="' . esc_attr__( 'Unapprove this reply', 'bbpress' ) . '">' . _x( 'Unapprove', 'Unapprove reply', 'bbpress' ) . '</a>';
788
+ } elseif ( ! bbp_is_reply_private( $reply->ID ) ) {
789
+ $actions['approved'] = '<a href="' . esc_url( $approve_uri ) . '" title="' . esc_attr__( 'Approve this reply', 'bbpress' ) . '">' . _x( 'Approve', 'Approve reply', 'bbpress' ) . '</a>';
790
+ }
791
+
792
+ // Show the 'spam' link on published and pending replies and 'not spam' on spammed replies
793
+ if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_pending_status_id(), bbp_get_spam_status_id() ), true ) ) {
794
  $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 );
795
  if ( bbp_is_reply_spam( $reply->ID ) ) {
796
  $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
802
 
803
  // Trash
804
  if ( current_user_can( 'delete_reply', $reply->ID ) ) {
805
+ $trash_days = bbp_get_trash_days( bbp_get_reply_post_type() );
806
+
807
  if ( bbp_get_trash_status_id() === $reply->post_status ) {
808
  $post_type_object = get_post_type_object( bbp_get_reply_post_type() );
809
+ $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-post_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
810
+ } elseif ( ! empty( $trash_days ) ) {
811
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
812
  }
813
 
814
+ if ( ( bbp_get_trash_status_id() === $reply->post_status ) || empty( $trash_days ) ) {
815
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
816
  } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
817
  unset( $actions['trash'] );
818
  }
824
  /**
825
  * Add forum dropdown to topic and reply list table filters
826
  *
827
+ * @since 2.0.0 bbPress (r2991)
828
  *
 
 
 
829
  * @return bool False. If post type is not topic or reply
830
  */
831
  public function filter_dropdown() {
832
 
833
+ // Add "Empty Spam" button for moderators
834
+ if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
 
 
835
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
836
+ submit_button(
837
+ esc_attr__( 'Empty Spam', 'bbpress' ),
838
+ 'button-secondary apply',
839
+ 'delete_all',
840
+ false
841
+ );
842
  }
843
 
844
  // Get which forum is selected
845
+ $selected = ! empty( $_GET['bbp_forum_id'] )
846
+ ? (int) $_GET['bbp_forum_id']
847
+ : 0;
848
 
849
  // Show the forums dropdown
850
  bbp_dropdown( array(
851
  'selected' => $selected,
852
+ 'show_none' => esc_html__( 'In all forums', 'bbpress' )
853
  ) );
854
  }
855
 
856
  /**
857
  * Adjust the request query and include the forum id
858
  *
859
+ * @since 2.0.0 bbPress (r2991)
860
  *
861
  * @param array $query_vars Query variables from {@link WP_Query}
 
 
 
862
  * @return array Processed Query Vars
863
  */
864
  public function filter_post_rows( $query_vars ) {
865
 
 
 
866
  // Add post_parent query_var if one is present
867
+ if ( ! empty( $_GET['bbp_forum_id'] ) ) {
868
  $query_vars['meta_key'] = '_bbp_forum_id';
869
+ $query_vars['meta_type'] = 'NUMERIC';
870
  $query_vars['meta_value'] = $_GET['bbp_forum_id'];
871
  }
872
 
877
  /**
878
  * Custom user feedback messages for reply post type
879
  *
880
+ * @since 2.0.0 bbPress (r3080)
881
  *
882
  * @global int $post_ID
 
 
 
 
883
  *
884
  * @param array $messages
885
  *
888
  public function updated_messages( $messages ) {
889
  global $post_ID;
890
 
 
 
891
  // URL for the current topic
892
  $topic_url = bbp_get_topic_permalink( bbp_get_reply_topic_id( $post_ID ) );
893
 
895
  $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
896
 
897
  // Messages array
898
+ $messages[ $this->post_type ] = array(
899
  0 => '', // Left empty on purpose
900
 
901
  // Updated
902
+ 1 => sprintf(
903
+ '%1$s <a href="%2$s">%3$s</a>',
904
+ __( 'Reply updated.', 'bbpress' ),
905
+ $topic_url,
906
+ __( 'View topic', 'bbpress' )
907
+ ),
908
 
909
  // Custom field updated
910
  2 => __( 'Custom field updated.', 'bbpress' ),
922
  : false,
923
 
924
  // Reply created
925
+ 6 => sprintf(
926
+ '%1$s <a href="%2$s">%3$s</a>',
927
+ __( 'Reply created.', 'bbpress' ),
928
+ $topic_url,
929
+ __( 'View topic', 'bbpress' )
930
+ ),
931
 
932
  // Reply saved
933
  7 => __( 'Reply saved.', 'bbpress' ),
934
 
935
  // Reply submitted
936
+ 8 => sprintf(
937
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
938
+ __( 'Reply submitted.', 'bbpress' ),
939
+ esc_url( add_query_arg( 'preview', 'true', $topic_url ) ),
940
+ __( 'Preview topic', 'bbpress' )
941
+ ),
942
 
943
  // Reply scheduled
944
+ 9 => sprintf(
945
+ '%1$s <a target="_blank" href="%2$s">%3$s</a>',
946
+ sprintf(
947
+ __( 'Reply scheduled for: %s.', 'bbpress' ),
948
  // translators: Publish box date format, see http://php.net/date
949
+ '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'bbpress' ), strtotime( $post_date ) ) . '</strong>'
950
+ ),
951
+ $topic_url,
952
+ __( 'Preview topic', 'bbpress' )
953
+ ),
954
 
955
  // Reply draft updated
956
+ 10 => sprintf(
957
+ '%1$s <a href="%2$s" target="_blank">%3$s</a>',
958
+ __( 'Reply draft updated.', 'bbpress' ),
959
+ esc_url( add_query_arg( 'preview', 'true', $topic_url ) ),
960
+ __( 'Preview topic', 'bbpress' )
961
+ ),
962
  );
963
 
964
  return $messages;
972
  * This is currently here to make hooking and unhooking of the admin UI easy.
973
  * It could use dependency injection in the future, but for now this is easier.
974
  *
975
+ * @since 2.0.0 bbPress (r2596)
976
  *
977
+ * @param WP_Screen $current_screen Current screen object
978
  */
979
+ function bbp_admin_replies( $current_screen ) {
980
+
981
+ // Bail if not a forum screen
982
+ if ( empty( $current_screen->post_type ) || ( bbp_get_reply_post_type() !== $current_screen->post_type ) ) {
983
+ return;
984
+ }
985
+
986
+ // Init the replies admin
987
  bbpress()->admin->replies = new BBP_Replies_Admin();
988
  }
includes/admin/settings.php CHANGED
@@ -8,67 +8,86 @@
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() {
 
 
22
  return (array) apply_filters( 'bbp_admin_get_settings_sections', array(
 
 
23
  'bbp_settings_users' => array(
24
- 'title' => __( 'Forum User Settings', 'bbpress' ),
25
  'callback' => 'bbp_admin_setting_callback_user_section',
26
  'page' => 'discussion'
27
  ),
28
  'bbp_settings_features' => array(
29
- 'title' => __( 'Forum Features', 'bbpress' ),
30
  'callback' => 'bbp_admin_setting_callback_features_section',
31
  'page' => 'discussion'
32
  ),
33
  'bbp_settings_theme_compat' => array(
34
- 'title' => __( 'Forum Theme Packages', 'bbpress' ),
35
  'callback' => 'bbp_admin_setting_callback_subtheme_section',
36
  'page' => 'general'
37
  ),
38
  'bbp_settings_per_page' => array(
39
- 'title' => __( 'Topics and Replies Per Page', 'bbpress' ),
40
  'callback' => 'bbp_admin_setting_callback_per_page_section',
41
  'page' => 'reading'
42
  ),
43
  'bbp_settings_per_rss_page' => array(
44
- 'title' => __( 'Topics and Replies Per RSS Page', 'bbpress' ),
45
  'callback' => 'bbp_admin_setting_callback_per_rss_page_section',
46
  'page' => 'reading',
47
  ),
48
  'bbp_settings_root_slugs' => array(
49
- 'title' => __( 'Forum Root Slug', 'bbpress' ),
50
  'callback' => 'bbp_admin_setting_callback_root_slug_section',
51
  'page' => 'permalink'
52
  ),
53
  'bbp_settings_single_slugs' => array(
54
- 'title' => __( 'Single Forum Slugs', 'bbpress' ),
55
  'callback' => 'bbp_admin_setting_callback_single_slug_section',
56
  'page' => 'permalink',
57
  ),
58
  'bbp_settings_user_slugs' => array(
59
- 'title' => __( 'Forum User Slugs', 'bbpress' ),
60
  'callback' => 'bbp_admin_setting_callback_user_slug_section',
61
  'page' => 'permalink',
62
  ),
 
 
63
  'bbp_settings_buddypress' => array(
64
- 'title' => __( 'BuddyPress Integration', 'bbpress' ),
65
  'callback' => 'bbp_admin_setting_callback_buddypress_section',
66
  'page' => 'buddypress',
67
  ),
68
  'bbp_settings_akismet' => array(
69
- 'title' => __( 'Akismet Integration', 'bbpress' ),
70
  'callback' => 'bbp_admin_setting_callback_akismet_section',
71
  'page' => 'discussion'
 
 
 
 
 
 
 
 
 
 
 
 
72
  )
73
  ) );
74
  }
@@ -76,51 +95,66 @@ 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() {
 
 
83
  return (array) apply_filters( 'bbp_admin_get_settings_fields', array(
84
 
85
  /** User Section ******************************************************/
86
 
87
  'bbp_settings_users' => array(
88
 
89
- // Edit lock setting
90
- '_bbp_edit_lock' => array(
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
98
  '_bbp_throttle_time' => array(
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
106
- '_bbp_allow_anonymous' => array(
107
- 'title' => __( 'Anonymous posting', 'bbpress' ),
108
- 'callback' => 'bbp_admin_setting_callback_anonymous',
109
  'sanitize_callback' => 'intval',
110
  'args' => array()
111
  ),
112
 
113
- // Allow global access (on multisite)
114
- '_bbp_allow_global_access' => array(
115
- 'title' => __( 'Auto role', 'bbpress' ),
116
- 'callback' => 'bbp_admin_setting_callback_global_access',
117
  'sanitize_callback' => 'intval',
118
  'args' => array()
119
  ),
120
 
121
- // Allow global access (on multisite)
122
- '_bbp_default_role' => array(
123
- 'sanitize_callback' => 'sanitize_text_field',
 
 
124
  'args' => array()
125
  )
126
  ),
@@ -131,7 +165,7 @@ function bbp_admin_get_settings_fields() {
131
 
132
  // Allow topic and reply revisions
133
  '_bbp_allow_revisions' => array(
134
- 'title' => __( 'Revisions', 'bbpress' ),
135
  'callback' => 'bbp_admin_setting_callback_revisions',
136
  'sanitize_callback' => 'intval',
137
  'args' => array()
@@ -139,7 +173,7 @@ function bbp_admin_get_settings_fields() {
139
 
140
  // Allow favorites setting
141
  '_bbp_enable_favorites' => array(
142
- 'title' => __( 'Favorites', 'bbpress' ),
143
  'callback' => 'bbp_admin_setting_callback_favorites',
144
  'sanitize_callback' => 'intval',
145
  'args' => array()
@@ -147,23 +181,47 @@ function bbp_admin_get_settings_fields() {
147
 
148
  // Allow subscriptions setting
149
  '_bbp_enable_subscriptions' => array(
150
- 'title' => __( 'Subscriptions', 'bbpress' ),
151
  'callback' => 'bbp_admin_setting_callback_subscriptions',
152
  'sanitize_callback' => 'intval',
153
  'args' => array()
154
  ),
155
 
 
 
 
 
 
 
 
 
156
  // Allow topic tags
157
  '_bbp_allow_topic_tags' => array(
158
- 'title' => __( 'Topic tags', 'bbpress' ),
159
  'callback' => 'bbp_admin_setting_callback_topic_tags',
160
  'sanitize_callback' => 'intval',
161
  'args' => array()
162
  ),
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  // Allow topic tags
165
  '_bbp_allow_search' => array(
166
- 'title' => __( 'Search', 'bbpress' ),
167
  'callback' => 'bbp_admin_setting_callback_search',
168
  'sanitize_callback' => 'intval',
169
  'args' => array()
@@ -171,7 +229,7 @@ function bbp_admin_get_settings_fields() {
171
 
172
  // Allow fancy editor setting
173
  '_bbp_use_wp_editor' => array(
174
- 'title' => __( 'Post Formatting', 'bbpress' ),
175
  'callback' => 'bbp_admin_setting_callback_use_wp_editor',
176
  'args' => array(),
177
  'sanitize_callback' => 'intval'
@@ -179,7 +237,7 @@ function bbp_admin_get_settings_fields() {
179
 
180
  // Allow auto embedding setting
181
  '_bbp_use_autoembed' => array(
182
- 'title' => __( 'Auto-embed links', 'bbpress' ),
183
  'callback' => 'bbp_admin_setting_callback_use_autoembed',
184
  'sanitize_callback' => 'intval',
185
  'args' => array()
@@ -187,7 +245,7 @@ function bbp_admin_get_settings_fields() {
187
 
188
  // Set reply threading level
189
  '_bbp_thread_replies_depth' => array(
190
- 'title' => __( 'Reply Threading', 'bbpress' ),
191
  'callback' => 'bbp_admin_setting_callback_thread_replies_depth',
192
  'sanitize_callback' => 'intval',
193
  'args' => array()
@@ -206,7 +264,7 @@ function bbp_admin_get_settings_fields() {
206
 
207
  // Theme package setting
208
  '_bbp_theme_package_id' => array(
209
- 'title' => __( 'Current Package', 'bbpress' ),
210
  'callback' => 'bbp_admin_setting_callback_subtheme_id',
211
  'sanitize_callback' => 'esc_sql',
212
  'args' => array()
@@ -219,18 +277,18 @@ function bbp_admin_get_settings_fields() {
219
 
220
  // Replies per page setting
221
  '_bbp_topics_per_page' => array(
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
229
  '_bbp_replies_per_page' => array(
230
- 'title' => __( 'Replies', 'bbpress' ),
231
  'callback' => 'bbp_admin_setting_callback_replies_per_page',
232
  'sanitize_callback' => 'intval',
233
- 'args' => array()
234
  )
235
  ),
236
 
@@ -240,18 +298,18 @@ function bbp_admin_get_settings_fields() {
240
 
241
  // Replies per page setting
242
  '_bbp_topics_per_rss_page' => array(
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
250
  '_bbp_replies_per_rss_page' => array(
251
- 'title' => __( 'Replies', 'bbpress' ),
252
  'callback' => 'bbp_admin_setting_callback_replies_per_rss_page',
253
  'sanitize_callback' => 'intval',
254
- 'args' => array()
255
  )
256
  ),
257
 
@@ -261,15 +319,15 @@ function bbp_admin_get_settings_fields() {
261
 
262
  // Root slug setting
263
  '_bbp_root_slug' => array(
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
271
  '_bbp_include_root' => array(
272
- 'title' => __( 'Forum Prefix', 'bbpress' ),
273
  'callback' => 'bbp_admin_setting_callback_include_root',
274
  'sanitize_callback' => 'intval',
275
  'args' => array()
@@ -277,10 +335,10 @@ function bbp_admin_get_settings_fields() {
277
 
278
  // What to show on Forum Root
279
  '_bbp_show_on_root' => array(
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
 
@@ -290,50 +348,50 @@ function bbp_admin_get_settings_fields() {
290
 
291
  // Forum slug setting
292
  '_bbp_forum_slug' => array(
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
300
  '_bbp_topic_slug' => array(
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
308
  '_bbp_topic_tag_slug' => array(
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
316
  '_bbp_view_slug' => array(
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
332
  '_bbp_search_slug' => array(
333
- 'title' => __( 'Search', 'bbpress' ),
334
  'callback' => 'bbp_admin_setting_callback_search_slug',
335
  'sanitize_callback' => 'bbp_sanitize_slug',
336
- 'args' => array()
337
  )
338
  ),
339
 
@@ -343,42 +401,50 @@ function bbp_admin_get_settings_fields() {
343
 
344
  // User slug setting
345
  '_bbp_user_slug' => array(
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
353
  '_bbp_topic_archive_slug' => array(
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
361
  '_bbp_reply_archive_slug' => array(
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
369
  '_bbp_user_favs_slug' => array(
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
 
@@ -388,7 +454,7 @@ function bbp_admin_get_settings_fields() {
388
 
389
  // Are group forums enabled?
390
  '_bbp_enable_group_forums' => array(
391
- 'title' => __( 'Enable Group Forums', 'bbpress' ),
392
  'callback' => 'bbp_admin_setting_callback_group_forums',
393
  'sanitize_callback' => 'intval',
394
  'args' => array()
@@ -396,10 +462,10 @@ function bbp_admin_get_settings_fields() {
396
 
397
  // Group forums parent forum ID
398
  '_bbp_group_forums_root_id' => array(
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
 
@@ -409,11 +475,125 @@ function bbp_admin_get_settings_fields() {
409
 
410
  // Should we use Akismet
411
  '_bbp_enable_akismet' => array(
412
- 'title' => __( 'Use Akismet', 'bbpress' ),
413
  'callback' => 'bbp_admin_setting_callback_akismet',
414
  'sanitize_callback' => 'intval',
415
  'args' => array()
416
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  )
418
  ) );
419
  }
@@ -421,19 +601,34 @@ 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
  }
439
 
@@ -442,7 +637,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,15 +651,24 @@ 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
  */
463
  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,15 +676,24 @@ 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
  */
479
  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,15 +701,14 @@ 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
  */
495
  function bbp_admin_setting_callback_anonymous() {
496
  ?>
497
 
498
  <input name="_bbp_allow_anonymous" id="_bbp_allow_anonymous" type="checkbox" value="1" <?php checked( bbp_allow_anonymous( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_anonymous' ); ?> />
499
  <label for="_bbp_allow_anonymous"><?php esc_html_e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
 
500
 
501
  <?php
502
  }
@@ -504,14 +716,13 @@ 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
  */
511
  function bbp_admin_setting_callback_global_access() {
512
 
513
  // Get the default role once rather than loop repeatedly below
514
  $default_role = bbp_get_default_role();
 
515
 
516
  // Start the output buffer for the select dropdown
517
  ob_start(); ?>
@@ -519,7 +730,7 @@ function bbp_admin_setting_callback_global_access() {
519
  </label>
520
  <label for="_bbp_default_role">
521
  <select name="_bbp_default_role" id="_bbp_default_role" <?php bbp_maybe_admin_setting_disabled( '_bbp_default_role' ); ?>>
522
- <?php foreach ( bbp_get_dynamic_roles() as $role => $details ) : ?>
523
 
524
  <option <?php selected( $default_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo bbp_translate_user_role( $details['name'] ); ?></option>
525
 
@@ -532,6 +743,7 @@ function bbp_admin_setting_callback_global_access() {
532
  <input name="_bbp_allow_global_access" id="_bbp_allow_global_access" type="checkbox" value="1" <?php checked( bbp_allow_global_access( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> />
533
  <?php printf( esc_html__( 'Automatically give registered visitors the %s forum role', 'bbpress' ), $select ); ?>
534
  </label>
 
535
 
536
  <?php
537
  }
@@ -541,7 +753,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,9 +766,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
  */
561
  function bbp_admin_setting_callback_favorites() {
562
  ?>
@@ -570,9 +780,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
  */
577
  function bbp_admin_setting_callback_subscriptions() {
578
  ?>
@@ -584,11 +792,23 @@ function bbp_admin_setting_callback_subscriptions() {
584
  }
585
 
586
  /**
587
- * Allow topic tags setting field
588
  *
589
- * @since bbPress (r4944)
 
 
 
 
 
 
 
 
 
 
 
 
590
  *
591
- * @uses checked() To display the checked attribute
592
  */
593
  function bbp_admin_setting_callback_topic_tags() {
594
  ?>
@@ -600,11 +820,37 @@ function bbp_admin_setting_callback_topic_tags() {
600
  }
601
 
602
  /**
603
- * Allow forum wide search
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
  *
605
- * @since bbPress (r4970)
 
 
 
 
 
 
 
 
 
 
 
 
606
  *
607
- * @uses checked() To display the checked attribute
608
  */
609
  function bbp_admin_setting_callback_search() {
610
  ?>
@@ -620,11 +866,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
627
- * @uses selected() To display the selected attribute
628
  */
629
  function bbp_admin_setting_callback_thread_replies_depth() {
630
 
@@ -658,9 +900,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
  */
665
  function bbp_admin_setting_callback_revisions() {
666
  ?>
@@ -674,9 +914,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
  */
681
  function bbp_admin_setting_callback_use_wp_editor() {
682
  ?>
@@ -690,7 +928,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,9 +941,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
  */
710
  function bbp_admin_setting_callback_subtheme_id() {
711
 
@@ -719,10 +955,10 @@ function bbp_admin_setting_callback_subtheme_id() {
719
  //
720
  // @see bbPress::register_theme_packages()
721
  foreach ( (array) bbpress()->theme_compat->packages as $id => $theme ) {
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>';
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() {
23
+
24
+ // Filter & return
25
  return (array) apply_filters( 'bbp_admin_get_settings_sections', array(
26
+
27
+ // Settings
28
  'bbp_settings_users' => array(
29
+ 'title' => esc_html__( 'Forum User Settings', 'bbpress' ),
30
  'callback' => 'bbp_admin_setting_callback_user_section',
31
  'page' => 'discussion'
32
  ),
33
  'bbp_settings_features' => array(
34
+ 'title' => esc_html__( 'Forum Features', 'bbpress' ),
35
  'callback' => 'bbp_admin_setting_callback_features_section',
36
  'page' => 'discussion'
37
  ),
38
  'bbp_settings_theme_compat' => array(
39
+ 'title' => esc_html__( 'Forum Theme Packages', 'bbpress' ),
40
  'callback' => 'bbp_admin_setting_callback_subtheme_section',
41
  'page' => 'general'
42
  ),
43
  'bbp_settings_per_page' => array(
44
+ 'title' => esc_html__( 'Topics and Replies Per Page', 'bbpress' ),
45
  'callback' => 'bbp_admin_setting_callback_per_page_section',
46
  'page' => 'reading'
47
  ),
48
  'bbp_settings_per_rss_page' => array(
49
+ 'title' => esc_html__( 'Topics and Replies Per RSS Page', 'bbpress' ),
50
  'callback' => 'bbp_admin_setting_callback_per_rss_page_section',
51
  'page' => 'reading',
52
  ),
53
  'bbp_settings_root_slugs' => array(
54
+ 'title' => esc_html__( 'Forum Root Slug', 'bbpress' ),
55
  'callback' => 'bbp_admin_setting_callback_root_slug_section',
56
  'page' => 'permalink'
57
  ),
58
  'bbp_settings_single_slugs' => array(
59
+ 'title' => esc_html__( 'Forum Single Slugs', 'bbpress' ),
60
  'callback' => 'bbp_admin_setting_callback_single_slug_section',
61
  'page' => 'permalink',
62
  ),
63
  'bbp_settings_user_slugs' => array(
64
+ 'title' => esc_html__( 'Forum User Slugs', 'bbpress' ),
65
  'callback' => 'bbp_admin_setting_callback_user_slug_section',
66
  'page' => 'permalink',
67
  ),
68
+
69
+ // Extend
70
  'bbp_settings_buddypress' => array(
71
+ 'title' => esc_html__( 'Forum Integration for BuddyPress', 'bbpress' ),
72
  'callback' => 'bbp_admin_setting_callback_buddypress_section',
73
  'page' => 'buddypress',
74
  ),
75
  'bbp_settings_akismet' => array(
76
+ 'title' => esc_html__( 'Forum Integration for Akismet', 'bbpress' ),
77
  'callback' => 'bbp_admin_setting_callback_akismet_section',
78
  'page' => 'discussion'
79
+ ),
80
+
81
+ // Converter
82
+ 'bbp_converter_connection' => array(
83
+ 'title' => esc_html__( 'Database Settings', 'bbpress' ),
84
+ 'callback' => 'bbp_converter_setting_callback_main_section',
85
+ 'page' => 'converter'
86
+ ),
87
+ 'bbp_converter_options' => array(
88
+ 'title' => esc_html__( 'Options', 'bbpress' ),
89
+ 'callback' => 'bbp_converter_setting_callback_options_section',
90
+ 'page' => 'converter'
91
  )
92
  ) );
93
  }
95
  /**
96
  * Get all of the settings fields.
97
  *
98
+ * @since 2.1.0 bbPress (r4001)
99
+ *
100
  * @return type
101
  */
102
  function bbp_admin_get_settings_fields() {
103
+
104
+ // Filter & return
105
  return (array) apply_filters( 'bbp_admin_get_settings_fields', array(
106
 
107
  /** User Section ******************************************************/
108
 
109
  'bbp_settings_users' => array(
110
 
111
+ // Allow global access
112
+ '_bbp_default_role' => array(
113
+ 'sanitize_callback' => 'sanitize_text_field',
114
+ 'args' => array()
115
+ ),
116
+
117
+ // Allow global access
118
+ '_bbp_allow_global_access' => array(
119
+ 'title' => esc_html__( 'Roles', 'bbpress' ),
120
+ 'callback' => 'bbp_admin_setting_callback_global_access',
121
+ 'sanitize_callback' => 'intval',
122
+ 'args' => array()
123
+ ),
124
+
125
+ // Allow content throttling
126
+ '_bbp_allow_content_throttle' => array(
127
  'sanitize_callback' => 'intval',
128
  'args' => array()
129
  ),
130
 
131
  // Throttle setting
132
  '_bbp_throttle_time' => array(
133
+ 'title' => esc_html__( 'Flooding', 'bbpress' ),
134
  'callback' => 'bbp_admin_setting_callback_throttle',
135
  'sanitize_callback' => 'intval',
136
  'args' => array()
137
  ),
138
 
139
+ // Allow content editing
140
+ '_bbp_allow_content_edit' => array(
 
 
141
  'sanitize_callback' => 'intval',
142
  'args' => array()
143
  ),
144
 
145
+ // Edit lock setting
146
+ '_bbp_edit_lock' => array(
147
+ 'title' => esc_html__( 'Editing', 'bbpress' ),
148
+ 'callback' => 'bbp_admin_setting_callback_editlock',
149
  'sanitize_callback' => 'intval',
150
  'args' => array()
151
  ),
152
 
153
+ // Allow anonymous posting setting
154
+ '_bbp_allow_anonymous' => array(
155
+ 'title' => esc_html__( 'Anonymous', 'bbpress' ),
156
+ 'callback' => 'bbp_admin_setting_callback_anonymous',
157
+ 'sanitize_callback' => 'intval',
158
  'args' => array()
159
  )
160
  ),
165
 
166
  // Allow topic and reply revisions
167
  '_bbp_allow_revisions' => array(
168
+ 'title' => esc_html__( 'Revisions', 'bbpress' ),
169
  'callback' => 'bbp_admin_setting_callback_revisions',
170
  'sanitize_callback' => 'intval',
171
  'args' => array()
173
 
174
  // Allow favorites setting
175
  '_bbp_enable_favorites' => array(
176
+ 'title' => esc_html__( 'Favorites', 'bbpress' ),
177
  'callback' => 'bbp_admin_setting_callback_favorites',
178
  'sanitize_callback' => 'intval',
179
  'args' => array()
181
 
182
  // Allow subscriptions setting
183
  '_bbp_enable_subscriptions' => array(
184
+ 'title' => esc_html__( 'Subscriptions', 'bbpress' ),
185
  'callback' => 'bbp_admin_setting_callback_subscriptions',
186
  'sanitize_callback' => 'intval',
187
  'args' => array()
188
  ),
189
 
190
+ // Allow engagements setting
191
+ '_bbp_enable_engagements' => array(
192
+ 'title' => esc_html__( 'Engagements', 'bbpress' ),
193
+ 'callback' => 'bbp_admin_setting_callback_engagements',
194
+ 'sanitize_callback' => 'intval',
195
+ 'args' => array()
196
+ ),
197
+
198
  // Allow topic tags
199
  '_bbp_allow_topic_tags' => array(
200
+ 'title' => esc_html__( 'Topic tags', 'bbpress' ),
201
  'callback' => 'bbp_admin_setting_callback_topic_tags',
202
  'sanitize_callback' => 'intval',
203
  'args' => array()
204
  ),
205
 
206
+ // Allow per-forum moderators
207
+ '_bbp_allow_forum_mods' => array(
208
+ 'title' => esc_html__( 'Forum Moderators', 'bbpress' ),
209
+ 'callback' => 'bbp_admin_setting_callback_forum_mods',
210
+ 'sanitize_callback' => 'intval',
211
+ 'args' => array()
212
+ ),
213
+
214
+ // Allow moderators to edit users
215
+ '_bbp_allow_super_mods' => array(
216
+ 'title' => esc_html__( 'Super Moderators', 'bbpress' ),
217
+ 'callback' => 'bbp_admin_setting_callback_super_mods',
218
+ 'sanitize_callback' => 'intval',
219
+ 'args' => array()
220
+ ),
221
+
222
  // Allow topic tags
223
  '_bbp_allow_search' => array(
224
+ 'title' => esc_html__( 'Search', 'bbpress' ),
225
  'callback' => 'bbp_admin_setting_callback_search',
226
  'sanitize_callback' => 'intval',
227
  'args' => array()
229
 
230
  // Allow fancy editor setting
231
  '_bbp_use_wp_editor' => array(
232
+ 'title' => esc_html__( 'Post Formatting', 'bbpress' ),
233
  'callback' => 'bbp_admin_setting_callback_use_wp_editor',
234
  'args' => array(),
235
  'sanitize_callback' => 'intval'
237
 
238
  // Allow auto embedding setting
239
  '_bbp_use_autoembed' => array(
240
+ 'title' => esc_html__( 'Auto-embed links', 'bbpress' ),
241
  'callback' => 'bbp_admin_setting_callback_use_autoembed',
242
  'sanitize_callback' => 'intval',
243
  'args' => array()
245
 
246
  // Set reply threading level
247
  '_bbp_thread_replies_depth' => array(
248
+ 'title' => esc_html__( 'Reply Threading', 'bbpress' ),
249
  'callback' => 'bbp_admin_setting_callback_thread_replies_depth',
250
  'sanitize_callback' => 'intval',
251
  'args' => array()
264
 
265
  // Theme package setting
266
  '_bbp_theme_package_id' => array(
267
+ 'title' => esc_html__( 'Current Package', 'bbpress' ),
268
  'callback' => 'bbp_admin_setting_callback_subtheme_id',
269
  'sanitize_callback' => 'esc_sql',
270
  'args' => array()
277
 
278
  // Replies per page setting
279
  '_bbp_topics_per_page' => array(
280
+ 'title' => esc_html__( 'Topics', 'bbpress' ),
281
  'callback' => 'bbp_admin_setting_callback_topics_per_page',
282
  'sanitize_callback' => 'intval',
283
+ 'args' => array( 'label_for' => '_bbp_topics_per_page' )
284
  ),
285
 
286
  // Replies per page setting
287
  '_bbp_replies_per_page' => array(
288
+ 'title' => esc_html__( 'Replies', 'bbpress' ),
289
  'callback' => 'bbp_admin_setting_callback_replies_per_page',
290
  'sanitize_callback' => 'intval',
291
+ 'args' => array( 'label_for' => '_bbp_replies_per_page' )
292
  )
293
  ),
294
 
298
 
299
  // Replies per page setting
300
  '_bbp_topics_per_rss_page' => array(
301
+ 'title' => esc_html__( 'Topics', 'bbpress' ),
302
  'callback' => 'bbp_admin_setting_callback_topics_per_rss_page',
303
  'sanitize_callback' => 'intval',
304
+ 'args' => array( 'label_for' => '_bbp_topics_per_rss_page' )
305
  ),
306
 
307
  // Replies per page setting
308
  '_bbp_replies_per_rss_page' => array(
309
+ 'title' => esc_html__( 'Replies', 'bbpress' ),
310
  'callback' => 'bbp_admin_setting_callback_replies_per_rss_page',
311
  'sanitize_callback' => 'intval',
312
+ 'args' => array( 'label_for' => '_bbp_replies_per_rss_page' )
313
  )
314
  ),
315
 
319
 
320
  // Root slug setting
321
  '_bbp_root_slug' => array(
322
+ 'title' => esc_html__( 'Forum Root', 'bbpress' ),
323
  'callback' => 'bbp_admin_setting_callback_root_slug',
324
  'sanitize_callback' => 'bbp_sanitize_slug',
325
+ 'args' => array( 'label_for' => '_bbp_root_slug' )
326
  ),
327
 
328
  // Include root setting
329
  '_bbp_include_root' => array(
330
+ 'title' => esc_html__( 'Forum Prefix', 'bbpress' ),
331
  'callback' => 'bbp_admin_setting_callback_include_root',
332
  'sanitize_callback' => 'intval',
333
  'args' => array()
335
 
336
  // What to show on Forum Root
337
  '_bbp_show_on_root' => array(
338
+ 'title' => esc_html__( 'Forum root should show', 'bbpress' ),
339
  'callback' => 'bbp_admin_setting_callback_show_on_root',
340
  'sanitize_callback' => 'sanitize_text_field',
341
+ 'args' => array( 'label_for'=>'_bbp_show_on_root' )
342
  ),
343
  ),
344
 
348
 
349
  // Forum slug setting
350
  '_bbp_forum_slug' => array(
351
+ 'title' => esc_html__( 'Forum', 'bbpress' ),
352
  'callback' => 'bbp_admin_setting_callback_forum_slug',
353
  'sanitize_callback' => 'bbp_sanitize_slug',
354
+ 'args' => array( 'label_for'=>'_bbp_forum_slug' )
355
  ),
356
 
357
  // Topic slug setting
358
  '_bbp_topic_slug' => array(
359
+ 'title' => esc_html__( 'Topic', 'bbpress' ),
360
  'callback' => 'bbp_admin_setting_callback_topic_slug',
361
  'sanitize_callback' => 'bbp_sanitize_slug',
362
+ 'args' => array( 'label_for'=>'_bbp_topic_slug' )
363
  ),
364
 
365
  // Topic tag slug setting
366
  '_bbp_topic_tag_slug' => array(
367
+ 'title' => esc_html__( 'Topic Tag', 'bbpress' ),
368
  'callback' => 'bbp_admin_setting_callback_topic_tag_slug',
369
  'sanitize_callback' => 'bbp_sanitize_slug',
370
+ 'args' => array( 'label_for'=>'_bbp_topic_tag_slug' )
371
  ),
372
 
373
  // View slug setting
374
  '_bbp_view_slug' => array(
375
+ 'title' => esc_html__( 'Topic View', 'bbpress' ),
376
  'callback' => 'bbp_admin_setting_callback_view_slug',
377
  'sanitize_callback' => 'bbp_sanitize_slug',
378
+ 'args' => array( 'label_for'=>'_bbp_view_slug' )
379
  ),
380
 
381
  // Reply slug setting
382
  '_bbp_reply_slug' => array(
383
+ 'title' => _x( 'Reply', 'noun', 'bbpress' ),
384
  'callback' => 'bbp_admin_setting_callback_reply_slug',
385
  'sanitize_callback' => 'bbp_sanitize_slug',
386
+ 'args' => array( 'label_for'=>'_bbp_reply_slug' )
387
  ),
388
 
389
  // Search slug setting
390
  '_bbp_search_slug' => array(
391
+ 'title' => esc_html__( 'Search', 'bbpress' ),
392
  'callback' => 'bbp_admin_setting_callback_search_slug',
393
  'sanitize_callback' => 'bbp_sanitize_slug',
394
+ 'args' => array( 'label_for'=>'_bbp_search_slug' )
395
  )
396
  ),
397
 
401
 
402
  // User slug setting
403
  '_bbp_user_slug' => array(
404
+ 'title' => esc_html__( 'User Base', 'bbpress' ),
405
  'callback' => 'bbp_admin_setting_callback_user_slug',
406
  'sanitize_callback' => 'bbp_sanitize_slug',
407
+ 'args' => array( 'label_for'=>'_bbp_user_slug' )
408
  ),
409
 
410
  // Topics slug setting
411
  '_bbp_topic_archive_slug' => array(
412
+ 'title' => esc_html__( 'Topics Started', 'bbpress' ),
413
  'callback' => 'bbp_admin_setting_callback_topic_archive_slug',
414
  'sanitize_callback' => 'bbp_sanitize_slug',
415
+ 'args' => array( 'label_for'=>'_bbp_topic_archive_slug' )
416
  ),
417
 
418
  // Replies slug setting
419
  '_bbp_reply_archive_slug' => array(
420
+ 'title' => esc_html__( 'Replies Created', 'bbpress' ),
421
  'callback' => 'bbp_admin_setting_callback_reply_archive_slug',
422
  'sanitize_callback' => 'bbp_sanitize_slug',
423
+ 'args' => array( 'label_for'=>'_bbp_reply_archive_slug' )
424
  ),
425
 
426
  // Favorites slug setting
427
  '_bbp_user_favs_slug' => array(
428
+ 'title' => esc_html__( 'Favorite Topics', 'bbpress' ),
429
  'callback' => 'bbp_admin_setting_callback_user_favs_slug',
430
  'sanitize_callback' => 'bbp_sanitize_slug',
431
+ 'args' => array( 'label_for'=>'_bbp_user_favs_slug' )
432
  ),
433
 
434
  // Subscriptions slug setting
435
  '_bbp_user_subs_slug' => array(
436
+ 'title' => esc_html__( 'Subscriptions', 'bbpress' ),
437
  'callback' => 'bbp_admin_setting_callback_user_subs_slug',
438
  'sanitize_callback' => 'bbp_sanitize_slug',
439
+ 'args' => array( 'label_for'=>'_bbp_user_subs_slug' )
440
+ ),
441
+
442
+ // Engagements slug setting
443
+ '_bbp_user_engs_slug' => array(
444
+ 'title' => esc_html__( 'Engagements', 'bbpress' ),
445
+ 'callback' => 'bbp_admin_setting_callback_user_engagements_slug',
446
+ 'sanitize_callback' => 'bbp_sanitize_slug',
447
+ 'args' => array( 'label_for'=>'_bbp_user_engs_slug' )
448
  )
449
  ),
450
 
454
 
455
  // Are group forums enabled?
456
  '_bbp_enable_group_forums' => array(
457
+ 'title' => esc_html__( 'Group Forums', 'bbpress' ),
458
  'callback' => 'bbp_admin_setting_callback_group_forums',
459
  'sanitize_callback' => 'intval',
460
  'args' => array()
462
 
463
  // Group forums parent forum ID
464
  '_bbp_group_forums_root_id' => array(
465
+ 'title' => esc_html__( 'Primary Forum', 'bbpress' ),
466
  'callback' => 'bbp_admin_setting_callback_group_forums_root_id',
467
  'sanitize_callback' => 'intval',
468
+ 'args' => array( 'label_for'=>'_bbp_group_forums_root_id' )
469
  )
470
  ),
471
 
475
 
476
  // Should we use Akismet
477
  '_bbp_enable_akismet' => array(
478
+ 'title' => esc_html__( 'Use Akismet', 'bbpress' ),
479
  'callback' => 'bbp_admin_setting_callback_akismet',
480
  'sanitize_callback' => 'intval',
481
  'args' => array()
482
  )
483
+ ),
484
+
485
+ /** Converter Page ****************************************************/
486
+
487
+ // Connection
488
+ 'bbp_converter_connection' => array(
489
+
490
+ // System Select
491
+ '_bbp_converter_platform' => array(
492
+ 'title' => esc_html__( 'Select Platform', 'bbpress' ),
493
+ 'callback' => 'bbp_converter_setting_callback_platform',
494
+ 'sanitize_callback' => 'sanitize_text_field',
495
+ 'args' => array()
496
+ ),
497
+
498
+ // Database Server
499
+ '_bbp_converter_db_server' => array(
500
+ 'title' => esc_html__( 'Database Server', 'bbpress' ),
501
+ 'callback' => 'bbp_converter_setting_callback_dbserver',
502
+ 'sanitize_callback' => 'sanitize_text_field',
503
+ 'args' => array()
504
+ ),
505
+
506
+ // Database Server Port
507
+ '_bbp_converter_db_port' => array(
508
+ 'title' => esc_html__( 'Database Port', 'bbpress' ),
509
+ 'callback' => 'bbp_converter_setting_callback_dbport',
510
+ 'sanitize_callback' => 'intval',
511
+ 'args' => array()
512
+ ),
513
+
514
+ // Database Name
515
+ '_bbp_converter_db_name' => array(
516
+ 'title' => esc_html__( 'Database Name', 'bbpress' ),
517
+ 'callback' => 'bbp_converter_setting_callback_dbname',
518
+ 'sanitize_callback' => 'sanitize_text_field',
519
+ 'args' => array()
520
+ ),
521
+
522
+ // Database User
523
+ '_bbp_converter_db_user' => array(
524
+ 'title' => esc_html__( 'Database User', 'bbpress' ),
525
+ 'callback' => 'bbp_converter_setting_callback_dbuser',
526
+ 'sanitize_callback' => 'sanitize_text_field',
527
+ 'args' => array()
528
+ ),
529
+
530
+ // Database User
531
+ '_bbp_converter_db_pass' => array(
532
+ 'title' => esc_html__( 'Database Password', 'bbpress' ),
533
+ 'callback' => 'bbp_converter_setting_callback_dbpass',
534
+ 'sanitize_callback' => 'sanitize_text_field',
535
+ 'args' => array()
536
+ ),
537
+
538
+ // Database User
539
+ '_bbp_converter_db_prefix' => array(
540
+ 'title' => esc_html__( 'Table Prefix', 'bbpress' ),
541
+ 'callback' => 'bbp_converter_setting_callback_dbprefix',
542
+ 'sanitize_callback' => 'sanitize_text_field',
543
+ 'args' => array()
544
+ )
545
+ ),
546
+
547
+ // Options
548
+ 'bbp_converter_options' => array(
549
+
550
+ // Rows Limit
551
+ '_bbp_converter_rows' => array(
552
+ 'title' => esc_html__( 'Rows Limit', 'bbpress' ),
553
+ 'callback' => 'bbp_converter_setting_callback_rows',
554
+ 'sanitize_callback' => 'intval',
555
+ 'args' => array()
556
+ ),
557
+
558
+ // Delay Time
559
+ '_bbp_converter_delay_time' => array(
560
+ 'title' => esc_html__( 'Delay Time', 'bbpress' ),
561
+ 'callback' => 'bbp_converter_setting_callback_delay_time',
562
+ 'sanitize_callback' => 'intval',
563
+ 'args' => array()
564
+ ),
565
+
566
+ // Convert Users
567
+ '_bbp_converter_convert_users' => array(
568
+ 'title' => esc_html__( 'Convert Users', 'bbpress' ),
569
+ 'callback' => 'bbp_converter_setting_callback_convert_users',
570
+ 'sanitize_callback' => 'intval',
571
+ 'args' => array()
572
+ ),
573
+
574
+ // Halt
575
+ '_bbp_converter_halt' => array(
576
+ 'title' => esc_html__( 'Stop on Error', 'bbpress' ),
577
+ 'callback' => 'bbp_converter_setting_callback_halt',
578
+ 'sanitize_callback' => 'intval',
579
+ 'args' => array()
580
+ ),
581
+
582
+ // Restart
583
+ '_bbp_converter_restart' => array(
584
+ 'title' => esc_html__( 'Start Over', 'bbpress' ),
585
+ 'callback' => 'bbp_converter_setting_callback_restart',
586
+ 'sanitize_callback' => 'intval',
587
+ 'args' => array()
588
+ ),
589
+
590
+ // Clean
591
+ '_bbp_converter_clean' => array(
592
+ 'title' => esc_html__( 'Helper Data', 'bbpress' ),
593
+ 'callback' => 'bbp_converter_setting_callback_clean',
594
+ 'sanitize_callback' => 'intval',
595
+ 'args' => array()
596
+ )
597
  )
598
  ) );
599
  }
601
  /**
602
  * Get settings fields by section.
603
  *
604
+ * @since 2.1.0 bbPress (r4001)
605
+ *
606
+ * @param string $section_id ID of the section to get fields for
607
+ * @staticvar array $fields All of the available fields
608
  * @return mixed False if section is invalid, array of fields otherwise.
609
  */
610
  function bbp_admin_get_settings_fields_for_section( $section_id = '' ) {
611
+ static $fields = array();
612
+
613
+ // Default return value
614
+ $retval = array();
615
 
616
  // Bail if section is empty
617
+ if ( empty( $section_id ) ) {
618
  return false;
619
+ }
620
 
621
+ // Get all of the fields (so we can snag one section of them)
622
+ if ( empty( $fields ) ) {
623
+ $fields = bbp_admin_get_settings_fields();
624
+ }
625
 
626
+ // Get the field by section
627
+ if ( isset( $fields[ $section_id ] ) ) {
628
+ $retval = $fields[ $section_id ];
629
+ }
630
+
631
+ // Filter & return
632
  return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
633
  }
634
 
637
  /**
638
  * User settings section description for the settings page
639
  *
640
+ * @since 2.0.0 bbPress (r2786)
641
  */
642
  function bbp_admin_setting_callback_user_section() {
643
  ?>
651
  /**
652
  * Edit lock setting field
653
  *
654
+ * @since 2.0.0 bbPress (r2737)
 
 
655
  */
656
  function bbp_admin_setting_callback_editlock() {
 
657
 
658
+ // Start the output buffer for the second option
659
+ ob_start(); ?>
660
+
661
+ </label>
662
+ <label for="_bbp_edit_lock">
663
+ <input name="_bbp_edit_lock" id="_bbp_edit_lock" type="number" min="0" step="1" value="<?php bbp_form_option( '_bbp_edit_lock', '0' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_edit_lock' ); ?> />
664
+
665
+ <?php $select = ob_get_clean(); ?>
666
+
667
+ <label for="_bbp_allow_content_edit">
668
+ <input name="_bbp_allow_content_edit" id="_bbp_allow_content_edit" type="checkbox" value="1" <?php checked( bbp_allow_content_edit( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_content_edit' ); ?> />
669
+ <?php printf( esc_html__( 'Allow users to edit their content for %s minutes after posting', 'bbpress' ), $select ); ?>
670
+ </label>
671
+ <p class="description"><?php esc_html_e( 'If checked, setting to "0 minutes" allows editing forever.', 'bbpress' ); ?></p>
672
 
673
  <?php
674
  }
676
  /**
677
  * Throttle setting field
678
  *
679
+ * @since 2.0.0 bbPress (r2737)
 
 
680
  */
681
  function bbp_admin_setting_callback_throttle() {
 
682
 
683
+ // Start the output buffer for the second option
684
+ ob_start(); ?>
685
+
686
+ </label>
687
+ <label for="_bbp_throttle_time">
688
+ <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' ); ?> />
689
+
690
+ <?php $select = ob_get_clean(); ?>
691
+
692
+ <label for="_bbp_allow_content_throttle">
693
+ <input name="_bbp_allow_content_throttle" id="_bbp_allow_content_throttle" type="checkbox" value="1" <?php checked( bbp_allow_content_throttle( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_content_throttle' ); ?> />
694
+ <?php printf( esc_html__( 'Allow flood protection by throttling users for %s seconds after posting', 'bbpress' ), $select ); ?>
695
+ </label>
696
+ <p class="description"><?php esc_html_e( 'Use this to discourage users from spamming your forums.', 'bbpress' ); ?></p>
697
 
698
  <?php
699
  }
701
  /**
702
  * Allow anonymous posting setting field
703
  *
704
+ * @since 2.0.0 bbPress (r2737)
 
 
705
  */
706
  function bbp_admin_setting_callback_anonymous() {
707
  ?>
708
 
709
  <input name="_bbp_allow_anonymous" id="_bbp_allow_anonymous" type="checkbox" value="1" <?php checked( bbp_allow_anonymous( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_anonymous' ); ?> />
710
  <label for="_bbp_allow_anonymous"><?php esc_html_e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
711
+ <p class="description"><?php esc_html_e( 'Works best on intranets or paired with antispam measures like Akismet.', 'bbpress' ); ?></p>
712
 
713
  <?php
714
  }
716
  /**
717
  * Allow global access setting field
718
  *
719
+ * @since 2.0.0 bbPress (r3378)
 
 
720
  */
721
  function bbp_admin_setting_callback_global_access() {
722
 
723
  // Get the default role once rather than loop repeatedly below
724
  $default_role = bbp_get_default_role();
725
+ $roles = bbp_get_dynamic_roles();
726
 
727
  // Start the output buffer for the select dropdown
728
  ob_start(); ?>
730
  </label>
731
  <label for="_bbp_default_role">
732
  <select name="_bbp_default_role" id="_bbp_default_role" <?php bbp_maybe_admin_setting_disabled( '_bbp_default_role' ); ?>>
733
+ <?php foreach ( $roles as $role => $details ) : ?>
734
 
735
  <option <?php selected( $default_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo bbp_translate_user_role( $details['name'] ); ?></option>
736
 
743
  <input name="_bbp_allow_global_access" id="_bbp_allow_global_access" type="checkbox" value="1" <?php checked( bbp_allow_global_access( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> />
744
  <?php printf( esc_html__( 'Automatically give registered visitors the %s forum role', 'bbpress' ), $select ); ?>
745
  </label>
746
+ <p class="description"><?php esc_html_e( 'Uncheck this to manually assign all user access to your forums.', 'bbpress' ); ?></p>
747
 
748
  <?php
749
  }
753
  /**
754
  * Features settings section description for the settings page
755
  *
756
+ * @since 2.0.0 bbPress (r2786)
757
  */
758
  function bbp_admin_setting_callback_features_section() {
759
  ?>
766
  /**
767
  * Allow favorites setting field
768
  *
769
+ * @since 2.0.0 bbPress (r2786)
 
 
770
  */
771
  function bbp_admin_setting_callback_favorites() {
772
  ?>
780
  /**
781
  * Allow subscriptions setting field
782
  *
783
+ * @since 2.0.0 bbPress (r2737)
 
 
784
  */
785
  function bbp_admin_setting_callback_subscriptions() {
786
  ?>
792
  }
793
 
794
  /**
795
+ * Allow engagements setting field
796
  *
797
+ * @since 2.0.0 bbPress (r2737)
798
+ */
799
+ function bbp_admin_setting_callback_engagements() {
800
+ ?>
801
+
802
+ <input name="_bbp_enable_engagements" id="_bbp_enable_engagements" type="checkbox" value="1" <?php checked( bbp_is_engagements_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_engagements' ); ?> />
803
+ <label for="_bbp_enable_engagements"><?php esc_html_e( 'Allow tracking of topics each user engages in', 'bbpress' ); ?></label>
804
+
805
+ <?php
806
+ }
807
+
808
+ /**
809
+ * Allow topic tags setting field
810
  *
811
+ * @since 2.4.0 bbPress (r4944)
812
  */
813
  function bbp_admin_setting_callback_topic_tags() {
814
  ?>
820
  }
821
 
822
  /**
823
+ * Allow forum-mods setting field
824
+ *
825
+ * @since 2.6.0 bbPress (r5834)
826
+ */
827
+ function bbp_admin_setting_callback_forum_mods() {
828
+ ?>
829
+
830
+ <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' ); ?> />
831
+ <label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label>
832
+
833
+ <?php
834
+ }
835
+
836
+ /**
837
+ * Allow super-mods setting field
838
  *
839
+ * @since 2.6.0 bbPress (r6562)
840
+ */
841
+ function bbp_admin_setting_callback_super_mods() {
842
+ ?>
843
+
844
+ <input name="_bbp_allow_super_mods" id="_bbp_allow_super_mods" type="checkbox" value="1" <?php checked( bbp_allow_super_mods( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_super_mods' ); ?> />
845
+ <label for="_bbp_allow_super_mods"><?php esc_html_e( 'Allow moderators to edit other users', 'bbpress' ); ?></label>
846
+
847
+ <?php
848
+ }
849
+
850
+ /**
851
+ * Allow forum wide search
852
  *
853
+ * @since 2.4.0 bbPress (r4970)
854
  */
855
  function bbp_admin_setting_callback_search() {
856
  ?>
866
  *
867
  * Replies will be threaded if depth is 2 or greater
868
  *
869
+ * @since 2.4.0 bbPress (r4944)
 
 
 
 
870
  */
871
  function bbp_admin_setting_callback_thread_replies_depth() {
872
 
900
  /**
901
  * Allow topic and reply revisions
902
  *
903
+ * @since 2.0.0 bbPress (r3412)
 
 
904
  */
905
  function bbp_admin_setting_callback_revisions() {
906
  ?>
914
  /**
915
  * Use the WordPress editor setting field
916
  *
917
+ * @since 2.1.0 bbPress (r3586)
 
 
918
  */
919
  function bbp_admin_setting_callback_use_wp_editor() {
920
  ?>
928
  /**
929
  * Main subtheme section
930
  *
931
+ * @since 2.0.0 bbPress (r2786)
932
  */
933
  function bbp_admin_setting_callback_subtheme_section() {
934
  ?>
941
  /**
942
  * Use the WordPress editor setting field
943
  *
944
+ * @since 2.1.0 bbPress (r3586)
 
 
945
  */
946
  function bbp_admin_setting_callback_subtheme_id() {
947
 
955
  //
956
  // @see bbPress::register_theme_packages()
957
  foreach ( (array) bbpress()->theme_compat->packages as $id => $theme ) {
958
+ $theme_options .= '<option value="