bbPress - Version 2.4

Version Description

  • Added hierarchical reply support
  • Added ability to disable forum search
  • Reorganized settings page
  • Improved rewrite rules
  • Improved responsive CSS
  • Improved code posting
  • Improved user capability integration
  • Improved cache getting and setting
  • Audit strict type comparisons
  • Audit GlotPress string escaping
  • Audit title attribute usage
  • Audit WordPress core function usage
  • General code clean-up
Download this release

Release Info

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

Code changes from version 2.3.2 to 2.4

Files changed (77) hide show
  1. bbpress.php +198 -135
  2. includes/admin/actions.php +2 -1
  3. includes/admin/admin.php +161 -130
  4. includes/admin/converter.php +79 -2
  5. includes/admin/converters/Example.php +440 -163
  6. includes/admin/forums.php +5 -17
  7. includes/admin/functions.php +3 -3
  8. includes/admin/images/badge-2x.png +0 -0
  9. includes/admin/images/badge.png +0 -0
  10. includes/admin/metaboxes.php +72 -35
  11. includes/admin/replies.php +43 -53
  12. includes/admin/settings.php +460 -222
  13. includes/admin/tools.php +41 -67
  14. includes/admin/topics.php +52 -64
  15. includes/admin/users.php +9 -9
  16. includes/common/ajax.php +2 -2
  17. includes/common/classes.php +170 -9
  18. includes/common/formatting.php +90 -6
  19. includes/common/functions.php +128 -91
  20. includes/common/shortcodes.php +66 -25
  21. includes/common/{template-tags.php → template.php} +179 -116
  22. includes/common/widgets.php +54 -43
  23. includes/core/actions.php +15 -12
  24. includes/core/capabilities.php +40 -64
  25. includes/core/filters.php +2 -2
  26. includes/core/functions.php +45 -7
  27. includes/core/options.php +112 -14
  28. includes/core/sub-actions.php +33 -2
  29. includes/core/template-functions.php +50 -22
  30. includes/core/template-loader.php +26 -7
  31. includes/core/theme-compat.php +197 -318
  32. includes/core/update.php +61 -7
  33. includes/extend/akismet.php +106 -22
  34. includes/extend/buddypress/activity.php +11 -11
  35. includes/extend/buddypress/functions.php +4 -4
  36. includes/extend/buddypress/{group.php → groups.php} +72 -30
  37. includes/extend/buddypress/loader.php +28 -31
  38. includes/extend/buddypress/members.php +15 -12
  39. includes/forums/capabilities.php +5 -5
  40. includes/forums/functions.php +146 -53
  41. includes/forums/{template-tags.php → template.php} +216 -78
  42. includes/replies/capabilities.php +4 -4
  43. includes/replies/functions.php +286 -96
  44. includes/replies/{template-tags.php → template.php} +379 -97
  45. includes/search/functions.php +33 -3
  46. includes/search/{template-tags.php → template.php} +107 -32
  47. includes/topics/capabilities.php +4 -4
  48. includes/topics/functions.php +247 -142
  49. includes/topics/{template-tags.php → template.php} +300 -140
  50. includes/users/capabilities.php +28 -21
  51. includes/users/functions.php +61 -77
  52. includes/users/options.php +5 -5
  53. includes/users/{template-tags.php → template.php} +61 -43
  54. languages/bbpress.pot +1148 -1123
  55. readme.txt +39 -8
  56. templates/default/bbpress-functions.php +8 -1
  57. templates/default/bbpress/content-archive-forum.php +7 -3
  58. templates/default/bbpress/content-archive-topic.php +10 -0
  59. templates/default/bbpress/content-single-topic-lead.php +1 -1
  60. templates/default/bbpress/form-forum.php +2 -13
  61. templates/default/bbpress/form-reply.php +7 -17
  62. templates/default/bbpress/form-search.php +1 -0
  63. templates/default/bbpress/form-topic.php +24 -19
  64. templates/default/bbpress/form-user-edit.php +10 -10
  65. templates/default/bbpress/loop-replies.php +11 -3
  66. templates/default/bbpress/loop-search-forum.php +3 -3
  67. templates/default/bbpress/loop-search-reply.php +2 -8
  68. templates/default/bbpress/loop-search-topic.php +3 -9
  69. templates/default/bbpress/loop-single-forum.php +2 -2
  70. templates/default/bbpress/loop-single-reply.php +2 -2
  71. templates/default/bbpress/loop-single-topic.php +2 -2
  72. templates/default/bbpress/user-details.php +7 -7
  73. templates/default/css/bbpress-rtl.css +283 -8
  74. templates/default/css/bbpress-rtl.min.css +1 -1
  75. templates/default/css/bbpress.css +283 -9
  76. templates/default/css/bbpress.min.css +1 -1
  77. templates/default/js/reply.js +47 -0
bbpress.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * bbPress is forum software with a twist from the creators of WordPress.
7
  *
8
- * $Id: bbpress.php 4891 2013-05-06 21:42:11Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
@@ -17,7 +17,7 @@
17
  * Description: bbPress is forum software with a twist from the creators of WordPress.
18
  * Author: The bbPress Community
19
  * Author URI: http://bbpress.org
20
- * Version: 2.3.2
21
  * Text Domain: bbpress
22
  * Domain Path: /languages/
23
  */
@@ -79,11 +79,6 @@ final class bbPress {
79
 
80
  /** Singleton *************************************************************/
81
 
82
- /**
83
- * @var bbPress The one true bbPress
84
- */
85
- private static $instance;
86
-
87
  /**
88
  * Main bbPress Instance
89
  *
@@ -95,7 +90,7 @@ final class bbPress {
95
  * time. Also prevents needing to define globals all over the place.
96
  *
97
  * @since bbPress (r3757)
98
- * @staticvar array $instance
99
  * @uses bbPress::setup_globals() Setup the globals needed
100
  * @uses bbPress::includes() Include the required files
101
  * @uses bbPress::setup_actions() Setup the hooks and actions
@@ -103,13 +98,20 @@ final class bbPress {
103
  * @return The one true bbPress
104
  */
105
  public static function instance() {
106
- if ( ! isset( self::$instance ) ) {
107
- self::$instance = new bbPress;
108
- self::$instance->setup_globals();
109
- self::$instance->includes();
110
- self::$instance->setup_actions();
 
 
 
 
 
111
  }
112
- return self::$instance;
 
 
113
  }
114
 
115
  /** Magic Methods *********************************************************/
@@ -188,8 +190,8 @@ final class bbPress {
188
 
189
  /** Versions **********************************************************/
190
 
191
- $this->version = '2.3.2';
192
- $this->db_version = '230';
193
 
194
  /** Paths *************************************************************/
195
 
@@ -235,8 +237,9 @@ final class bbPress {
235
  $this->favs_id = apply_filters( 'bbp_favs_id', 'bbp_favs' );
236
  $this->subs_id = apply_filters( 'bbp_subs_id', 'bbp_subs' );
237
  $this->view_id = apply_filters( 'bbp_view_id', 'bbp_view' );
238
- $this->search_id = apply_filters( 'bbp_search_id', 'bbp_search' );
239
  $this->edit_id = apply_filters( 'bbp_edit_id', 'edit' );
 
 
240
 
241
  /** Queries ***********************************************************/
242
 
@@ -245,10 +248,10 @@ final class bbPress {
245
  $this->current_reply_id = 0; // Current reply id
246
  $this->current_topic_tag_id = 0; // Current topic tag id
247
 
248
- $this->forum_query = new stdClass(); // Main forum query
249
- $this->topic_query = new stdClass(); // Main topic query
250
- $this->reply_query = new stdClass(); // Main reply query
251
- $this->search_query = new stdClass(); // Main search query
252
 
253
  /** Theme Compat ******************************************************/
254
 
@@ -257,8 +260,8 @@ final class bbPress {
257
 
258
  /** Users *************************************************************/
259
 
260
- $this->current_user = new stdClass(); // Currently logged in user
261
- $this->displayed_user = new stdClass(); // Currently displayed user
262
 
263
  /** Misc **************************************************************/
264
 
@@ -292,38 +295,38 @@ final class bbPress {
292
  /** Components ********************************************************/
293
 
294
  // Common
295
- require( $this->includes_dir . 'common/ajax.php' );
296
- require( $this->includes_dir . 'common/classes.php' );
297
- require( $this->includes_dir . 'common/functions.php' );
298
- require( $this->includes_dir . 'common/formatting.php' );
299
- require( $this->includes_dir . 'common/template-tags.php' );
300
- require( $this->includes_dir . 'common/widgets.php' );
301
- require( $this->includes_dir . 'common/shortcodes.php' );
302
 
303
  // Forums
304
- require( $this->includes_dir . 'forums/capabilities.php' );
305
- require( $this->includes_dir . 'forums/functions.php' );
306
- require( $this->includes_dir . 'forums/template-tags.php' );
307
 
308
  // Topics
309
- require( $this->includes_dir . 'topics/capabilities.php' );
310
- require( $this->includes_dir . 'topics/functions.php' );
311
- require( $this->includes_dir . 'topics/template-tags.php' );
312
 
313
  // Replies
314
- require( $this->includes_dir . 'replies/capabilities.php' );
315
- require( $this->includes_dir . 'replies/functions.php' );
316
- require( $this->includes_dir . 'replies/template-tags.php' );
317
 
318
  // Search
319
- require( $this->includes_dir . 'search/functions.php' );
320
- require( $this->includes_dir . 'search/template-tags.php' );
321
 
322
  // Users
323
- require( $this->includes_dir . 'users/capabilities.php' );
324
- require( $this->includes_dir . 'users/functions.php' );
325
- require( $this->includes_dir . 'users/template-tags.php' );
326
- require( $this->includes_dir . 'users/options.php' );
327
 
328
  /** Hooks *************************************************************/
329
 
@@ -369,11 +372,12 @@ final class bbPress {
369
  'register_theme_packages', // Register bundled theme packages (bbp-theme-compat/bbp-themes)
370
  'load_textdomain', // Load textdomain (bbpress)
371
  'add_rewrite_tags', // Add rewrite tags (view|user|edit|search)
372
- 'generate_rewrite_rules' // Generate rewrite rules (view|edit|search)
 
373
  );
374
 
375
  // Add the actions
376
- foreach( $actions as $class_action )
377
  add_action( 'bbp_' . $class_action, array( $this, $class_action ), 5 );
378
 
379
  // All bbPress actions are setup (includes bbp-core-hooks.php)
@@ -434,15 +438,13 @@ final class bbPress {
434
  *
435
  * @since bbPress (r2596)
436
  *
437
- * @uses apply_filters() Calls 'bbpress_locale' with the
438
- * {@link get_locale()} value
439
  * @uses load_textdomain() To load the textdomain
440
- * @return bool True on success, false on failure
441
  */
442
  public function load_textdomain() {
443
 
444
  // Traditional WordPress plugin locale filter
445
- $locale = apply_filters( 'plugin_locale', get_locale(), $this->domain );
446
  $mofile = sprintf( '%1$s-%2$s.mo', $this->domain, $locale );
447
 
448
  // Setup paths to current locale file
@@ -450,16 +452,10 @@ final class bbPress {
450
  $mofile_global = WP_LANG_DIR . '/bbpress/' . $mofile;
451
 
452
  // Look in global /wp-content/languages/bbpress folder
453
- if ( file_exists( $mofile_global ) ) {
454
- return load_textdomain( $this->domain, $mofile_global );
455
 
456
  // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
457
- } elseif ( file_exists( $mofile_local ) ) {
458
- return load_textdomain( $this->domain, $mofile_local );
459
- }
460
-
461
- // Nothing found
462
- return false;
463
  }
464
 
465
  /**
@@ -577,7 +573,7 @@ final class bbPress {
577
  'capabilities' => bbp_get_topic_caps(),
578
  'capability_type' => array( 'topic', 'topics' ),
579
  'menu_position' => 555555,
580
- 'has_archive' => bbp_get_topic_archive_slug(),
581
  'exclude_from_search' => true,
582
  'show_in_nav_menus' => false,
583
  'public' => true,
@@ -842,7 +838,7 @@ final class bbPress {
842
  * @uses wp_get_current_user()
843
  */
844
  public function setup_current_user() {
845
- $this->current_user = &wp_get_current_user();
846
  }
847
 
848
  /** Custom Rewrite Rules **************************************************/
@@ -854,101 +850,168 @@ final class bbPress {
854
  * @uses add_rewrite_tag() To add the rewrite tags
855
  */
856
  public static function add_rewrite_tags() {
857
- add_rewrite_tag( '%%' . bbp_get_view_rewrite_id() . '%%', '([^/]+)' ); // View Page tag
858
- add_rewrite_tag( '%%' . bbp_get_edit_rewrite_id() . '%%', '([1]{1,})' ); // Edit Page tag
859
- add_rewrite_tag( '%%' . bbp_get_search_rewrite_id() . '%%', '([^/]+)' ); // Search Results tag
860
- add_rewrite_tag( '%%' . bbp_get_user_rewrite_id() . '%%', '([^/]+)' ); // User Profile tag
861
- add_rewrite_tag( '%%' . bbp_get_user_favorites_rewrite_id() . '%%', '([1]{1,})' ); // User Favorites tag
862
- add_rewrite_tag( '%%' . bbp_get_user_subscriptions_rewrite_id() . '%%', '([1]{1,})' ); // User Subscriptions tag
863
- add_rewrite_tag( '%%' . bbp_get_user_topics_rewrite_id() . '%%', '([1]{1,})' ); // User Topics Tag
864
- add_rewrite_tag( '%%' . bbp_get_user_replies_rewrite_id() . '%%', '([1]{1,})' ); // User Replies Tag
865
  }
866
 
867
  /**
868
- * Register bbPress-specific rewrite rules for uri's that are not
869
  * setup for us by way of custom post types or taxonomies. This includes:
870
  * - Front-end editing
871
  * - Topic views
872
  * - User profiles
873
  *
874
  * @since bbPress (r2688)
875
- * @param WP_Rewrite $wp_rewrite bbPress-sepecific rules are appended in
876
- * $wp_rewrite->rules
877
  */
878
- public static function generate_rewrite_rules( $wp_rewrite ) {
879
 
880
- // Slugs
881
- $view_slug = bbp_get_view_slug();
882
- $search_slug = bbp_get_search_slug();
883
- $user_slug = bbp_get_user_slug();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
884
 
885
  // Unique rewrite ID's
886
- $edit_id = bbp_get_edit_rewrite_id();
887
- $view_id = bbp_get_view_rewrite_id();
888
- $search_id = bbp_get_search_rewrite_id();
889
- $user_id = bbp_get_user_rewrite_id();
890
- $favs_id = bbp_get_user_favorites_rewrite_id();
891
- $subs_id = bbp_get_user_subscriptions_rewrite_id();
892
- $tops_id = bbp_get_user_topics_rewrite_id();
893
- $reps_id = bbp_get_user_replies_rewrite_id();
 
 
894
 
895
  // Rewrite rule matches used repeatedly below
896
- $root_rule = '/([^/]+)/?$';
897
- $edit_rule = '/([^/]+)/edit/?$';
898
- $feed_rule = '/([^/]+)/feed/?$';
899
- $page_rule = '/([^/]+)/page/?([0-9]{1,})/?$';
900
 
901
  // Search rules (without slug check)
902
- $search_root_rule = '/?$';
903
- $search_page_rule = '/page/?([0-9]{1,})/?$';
 
 
904
 
905
  // User profile rules
906
- $tops_rule = '/([^/]+)/topics/?$';
907
- $reps_rule = '/([^/]+)/replies/?$';
908
- $favs_rule = '/([^/]+)/' . bbp_get_user_favorites_slug() . '/?$';
909
- $subs_rule = '/([^/]+)/' . bbp_get_user_subscriptions_slug() . '/?$';
910
- $tops_page_rule = '/([^/]+)/topics/page/?([0-9]{1,})/?$';
911
- $reps_page_rule = '/([^/]+)/replies/page/?([0-9]{1,})/?$';
912
- $favs_page_rule = '/([^/]+)/' . bbp_get_user_favorites_slug() . '/page/?([0-9]{1,})/?$';
913
- $subs_page_rule = '/([^/]+)/' . bbp_get_user_subscriptions_slug() . '/page/?([0-9]{1,})/?$';
914
-
915
- // New bbPress specific rules to merge with existing that are not
916
- // handled automatically by custom post types or taxonomy types
917
- $bbp_rules = array(
918
-
919
- // Edit Forum|Topic|Reply|Topic-tag
920
- bbp_get_forum_slug() . $edit_rule => 'index.php?' . bbp_get_forum_post_type() . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $edit_id . '=1',
921
- bbp_get_topic_slug() . $edit_rule => 'index.php?' . bbp_get_topic_post_type() . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $edit_id . '=1',
922
- bbp_get_reply_slug() . $edit_rule => 'index.php?' . bbp_get_reply_post_type() . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $edit_id . '=1',
923
- bbp_get_topic_tag_tax_slug() . $edit_rule => 'index.php?' . bbp_get_topic_tag_tax_id() . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $edit_id . '=1',
924
-
925
- // User Pagination|Edit|View
926
- $user_slug . $tops_page_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $tops_id . '=1&paged=' . $wp_rewrite->preg_index( 2 ),
927
- $user_slug . $reps_page_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $reps_id . '=1&paged=' . $wp_rewrite->preg_index( 2 ),
928
- $user_slug . $favs_page_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $favs_id . '=1&paged=' . $wp_rewrite->preg_index( 2 ),
929
- $user_slug . $subs_page_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $subs_id . '=1&paged=' . $wp_rewrite->preg_index( 2 ),
930
- $user_slug . $tops_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $tops_id . '=1',
931
- $user_slug . $reps_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $reps_id . '=1',
932
- $user_slug . $favs_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $favs_id . '=1',
933
- $user_slug . $subs_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $subs_id . '=1',
934
- $user_slug . $edit_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&' . $edit_id . '=1',
935
- $user_slug . $root_rule => 'index.php?' . $user_id . '=' . $wp_rewrite->preg_index( 1 ),
936
-
937
- // Topic-View Pagination|Feed|View
938
- $view_slug . $page_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
939
- $view_slug . $feed_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&feed=' . $wp_rewrite->preg_index( 2 ),
940
- $view_slug . $root_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ),
941
-
942
- // Search All
943
- $search_slug . $search_page_rule => 'index.php?paged=' . $wp_rewrite->preg_index( 1 ),
944
- $search_slug . $search_root_rule => 'index.php?' . $search_id,
945
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
946
 
947
- // Merge bbPress rules with existing
948
- $wp_rewrite->rules = array_merge( $bbp_rules, $wp_rewrite->rules );
 
 
 
 
 
 
 
 
949
 
950
- // Return merged rules
951
- return $wp_rewrite;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
952
  }
953
  }
954
 
5
  *
6
  * bbPress is forum software with a twist from the creators of WordPress.
7
  *
8
+ * $Id: bbpress.php 5096 2013-09-02 17:42:26Z johnjamesjacoby $
9
  *
10
  * @package bbPress
11
  * @subpackage Main
17
  * Description: bbPress is forum software with a twist from the creators of WordPress.
18
  * Author: The bbPress Community
19
  * Author URI: http://bbpress.org
20
+ * Version: 2.4
21
  * Text Domain: bbpress
22
  * Domain Path: /languages/
23
  */
79
 
80
  /** Singleton *************************************************************/
81
 
 
 
 
 
 
82
  /**
83
  * Main bbPress Instance
84
  *
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
98
  * @return The one true bbPress
99
  */
100
  public static function instance() {
101
+
102
+ // Store the instance locally to avoid private static replication
103
+ static $instance = null;
104
+
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
+
113
+ // Always return the instance
114
+ return $instance;
115
  }
116
 
117
  /** Magic Methods *********************************************************/
190
 
191
  /** Versions **********************************************************/
192
 
193
+ $this->version = '2.4';
194
+ $this->db_version = '240';
195
 
196
  /** Paths *************************************************************/
197
 
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
  $this->current_reply_id = 0; // Current reply id
249
  $this->current_topic_tag_id = 0; // Current topic tag id
250
 
251
+ $this->forum_query = new WP_Query(); // Main forum query
252
+ $this->topic_query = new WP_Query(); // Main topic query
253
+ $this->reply_query = new WP_Query(); // Main reply query
254
+ $this->search_query = new WP_Query(); // Main search query
255
 
256
  /** Theme Compat ******************************************************/
257
 
260
 
261
  /** Users *************************************************************/
262
 
263
+ $this->current_user = new WP_User(); // Currently logged in user
264
+ $this->displayed_user = new WP_User(); // Currently displayed user
265
 
266
  /** Misc **************************************************************/
267
 
295
  /** Components ********************************************************/
296
 
297
  // Common
298
+ require( $this->includes_dir . 'common/ajax.php' );
299
+ require( $this->includes_dir . 'common/classes.php' );
300
+ require( $this->includes_dir . 'common/functions.php' );
301
+ require( $this->includes_dir . 'common/formatting.php' );
302
+ require( $this->includes_dir . 'common/template.php' );
303
+ require( $this->includes_dir . 'common/widgets.php' );
304
+ require( $this->includes_dir . 'common/shortcodes.php' );
305
 
306
  // Forums
307
+ require( $this->includes_dir . 'forums/capabilities.php' );
308
+ require( $this->includes_dir . 'forums/functions.php' );
309
+ require( $this->includes_dir . 'forums/template.php' );
310
 
311
  // Topics
312
+ require( $this->includes_dir . 'topics/capabilities.php' );
313
+ require( $this->includes_dir . 'topics/functions.php' );
314
+ require( $this->includes_dir . 'topics/template.php' );
315
 
316
  // Replies
317
+ require( $this->includes_dir . 'replies/capabilities.php' );
318
+ require( $this->includes_dir . 'replies/functions.php' );
319
+ require( $this->includes_dir . 'replies/template.php' );
320
 
321
  // Search
322
+ require( $this->includes_dir . 'search/functions.php' );
323
+ require( $this->includes_dir . 'search/template.php' );
324
 
325
  // Users
326
+ require( $this->includes_dir . 'users/capabilities.php' );
327
+ require( $this->includes_dir . 'users/functions.php' );
328
+ require( $this->includes_dir . 'users/template.php' );
329
+ require( $this->includes_dir . 'users/options.php' );
330
 
331
  /** Hooks *************************************************************/
332
 
372
  'register_theme_packages', // Register bundled theme packages (bbp-theme-compat/bbp-themes)
373
  'load_textdomain', // Load textdomain (bbpress)
374
  'add_rewrite_tags', // Add rewrite tags (view|user|edit|search)
375
+ 'add_rewrite_rules', // Generate rewrite rules (view|edit|paged|search)
376
+ 'add_permastructs' // Add permalink structures (view|user|search)
377
  );
378
 
379
  // Add the actions
380
+ foreach ( $actions as $class_action )
381
  add_action( 'bbp_' . $class_action, array( $this, $class_action ), 5 );
382
 
383
  // All bbPress actions are setup (includes bbp-core-hooks.php)
438
  *
439
  * @since bbPress (r2596)
440
  *
441
+ * @uses apply_filters() Calls 'plugin_locale' with {@link get_locale()} value
 
442
  * @uses load_textdomain() To load the textdomain
 
443
  */
444
  public function load_textdomain() {
445
 
446
  // Traditional WordPress plugin locale filter
447
+ $locale = apply_filters( 'plugin_locale', get_locale(), $this->domain );
448
  $mofile = sprintf( '%1$s-%2$s.mo', $this->domain, $locale );
449
 
450
  // Setup paths to current locale file
452
  $mofile_global = WP_LANG_DIR . '/bbpress/' . $mofile;
453
 
454
  // Look in global /wp-content/languages/bbpress folder
455
+ load_textdomain( $this->domain, $mofile_global );
 
456
 
457
  // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
458
+ load_textdomain( $this->domain, $mofile_local );
 
 
 
 
 
459
  }
460
 
461
  /**
573
  'capabilities' => bbp_get_topic_caps(),
574
  'capability_type' => array( 'topic', 'topics' ),
575
  'menu_position' => 555555,
576
+ 'has_archive' => ( 'forums' === bbp_show_on_root() ) ? bbp_get_topic_archive_slug() : false,
577
  'exclude_from_search' => true,
578
  'show_in_nav_menus' => false,
579
  'public' => true,
838
  * @uses wp_get_current_user()
839
  */
840
  public function setup_current_user() {
841
+ $this->current_user = wp_get_current_user();
842
  }
843
 
844
  /** Custom Rewrite Rules **************************************************/
850
  * @uses add_rewrite_tag() To add the rewrite tags
851
  */
852
  public static function add_rewrite_tags() {
853
+ add_rewrite_tag( '%' . bbp_get_view_rewrite_id() . '%', '([^/]+)' ); // View Page tag
854
+ add_rewrite_tag( '%' . bbp_get_edit_rewrite_id() . '%', '([1]{1,})' ); // Edit Page tag
855
+ add_rewrite_tag( '%' . bbp_get_search_rewrite_id() . '%', '([^/]+)' ); // Search Results tag
856
+ add_rewrite_tag( '%' . bbp_get_user_rewrite_id() . '%', '([^/]+)' ); // User Profile tag
857
+ add_rewrite_tag( '%' . bbp_get_user_favorites_rewrite_id() . '%', '([1]{1,})' ); // User Favorites tag
858
+ add_rewrite_tag( '%' . bbp_get_user_subscriptions_rewrite_id() . '%', '([1]{1,})' ); // User Subscriptions tag
859
+ add_rewrite_tag( '%' . bbp_get_user_topics_rewrite_id() . '%', '([1]{1,})' ); // User Topics Tag
860
+ add_rewrite_tag( '%' . bbp_get_user_replies_rewrite_id() . '%', '([1]{1,})' ); // User Replies Tag
861
  }
862
 
863
  /**
864
+ * Add bbPress-specific rewrite rules for uri's that are not
865
  * setup for us by way of custom post types or taxonomies. This includes:
866
  * - Front-end editing
867
  * - Topic views
868
  * - User profiles
869
  *
870
  * @since bbPress (r2688)
871
+ * @todo Extract into an API
 
872
  */
873
+ public static function add_rewrite_rules() {
874
 
875
+ /** Setup *************************************************************/
876
+
877
+ // Add rules to top or bottom?
878
+ $priority = 'top';
879
+
880
+ // Single Slugs
881
+ $forum_slug = bbp_get_forum_slug();
882
+ $topic_slug = bbp_get_topic_slug();
883
+ $reply_slug = bbp_get_reply_slug();
884
+ $ttag_slug = bbp_get_topic_tag_tax_slug();
885
+
886
+ // Archive Slugs
887
+ $user_slug = bbp_get_user_slug();
888
+ $view_slug = bbp_get_view_slug();
889
+ $search_slug = bbp_get_search_slug();
890
+ $topic_archive_slug = bbp_get_topic_archive_slug();
891
+ $reply_archive_slug = bbp_get_reply_archive_slug();
892
+
893
+ // Tertiary Slugs
894
+ $feed_slug = 'feed';
895
+ $edit_slug = 'edit';
896
+ $paged_slug = bbp_get_paged_slug();
897
+ $user_favs_slug = bbp_get_user_favorites_slug();
898
+ $user_subs_slug = bbp_get_user_subscriptions_slug();
899
 
900
  // Unique rewrite ID's
901
+ $feed_id = 'feed';
902
+ $edit_id = 'edit';
903
+ $view_id = bbp_get_view_rewrite_id();
904
+ $paged_id = bbp_get_paged_rewrite_id();
905
+ $search_id = bbp_get_search_rewrite_id();
906
+ $user_id = bbp_get_user_rewrite_id();
907
+ $user_favs_id = bbp_get_user_favorites_rewrite_id();
908
+ $user_subs_id = bbp_get_user_subscriptions_rewrite_id();
909
+ $user_tops_id = bbp_get_user_topics_rewrite_id();
910
+ $user_reps_id = bbp_get_user_replies_rewrite_id();
911
 
912
  // Rewrite rule matches used repeatedly below
913
+ $root_rule = '/([^/]+)/?$';
914
+ $feed_rule = '/([^/]+)/' . $feed_slug . '/?$';
915
+ $edit_rule = '/([^/]+)/' . $edit_slug . '/?$';
916
+ $paged_rule = '/([^/]+)/' . $paged_slug . '/?([0-9]{1,})/?$';
917
 
918
  // Search rules (without slug check)
919
+ $search_root_rule = '/?$';
920
+ $search_paged_rule = '/' . $paged_slug . '/?([0-9]{1,})/?$';
921
+
922
+ /** Add ***************************************************************/
923
 
924
  // User profile rules
925
+ $tops_rule = '/([^/]+)/' . $topic_archive_slug . '/?$';
926
+ $reps_rule = '/([^/]+)/' . $reply_archive_slug . '/?$';
927
+ $favs_rule = '/([^/]+)/' . $user_favs_slug . '/?$';
928
+ $subs_rule = '/([^/]+)/' . $user_subs_slug . '/?$';
929
+ $tops_paged_rule = '/([^/]+)/' . $topic_archive_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
930
+ $reps_paged_rule = '/([^/]+)/' . $reply_archive_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
931
+ $favs_paged_rule = '/([^/]+)/' . $user_favs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
932
+ $subs_paged_rule = '/([^/]+)/' . $user_subs_slug . '/' . $paged_slug . '/?([0-9]{1,})/?$';
933
+
934
+ // Edit Forum|Topic|Reply|Topic-tag
935
+ add_rewrite_rule( $forum_slug . $edit_rule, 'index.php?' . bbp_get_forum_post_type() . '=$matches[1]&' . $edit_id . '=1', $priority );
936
+ add_rewrite_rule( $topic_slug . $edit_rule, 'index.php?' . bbp_get_topic_post_type() . '=$matches[1]&' . $edit_id . '=1', $priority );
937
+ add_rewrite_rule( $reply_slug . $edit_rule, 'index.php?' . bbp_get_reply_post_type() . '=$matches[1]&' . $edit_id . '=1', $priority );
938
+ add_rewrite_rule( $ttag_slug . $edit_rule, 'index.php?' . bbp_get_topic_tag_tax_id() . '=$matches[1]&' . $edit_id . '=1', $priority );
939
+
940
+ // User Pagination|Edit|View
941
+ add_rewrite_rule( $user_slug . $tops_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_tops_id . '=1&' . $paged_id . '=$matches[2]', $priority );
942
+ add_rewrite_rule( $user_slug . $reps_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_reps_id . '=1&' . $paged_id . '=$matches[2]', $priority );
943
+ add_rewrite_rule( $user_slug . $favs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_favs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
944
+ add_rewrite_rule( $user_slug . $subs_paged_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_subs_id . '=1&' . $paged_id . '=$matches[2]', $priority );
945
+ add_rewrite_rule( $user_slug . $tops_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_tops_id . '=1', $priority );
946
+ add_rewrite_rule( $user_slug . $reps_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_reps_id . '=1', $priority );
947
+ add_rewrite_rule( $user_slug . $favs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_favs_id . '=1', $priority );
948
+ add_rewrite_rule( $user_slug . $subs_rule, 'index.php?' . $user_id . '=$matches[1]&' . $user_subs_id . '=1', $priority );
949
+ add_rewrite_rule( $user_slug . $edit_rule, 'index.php?' . $user_id . '=$matches[1]&' . $edit_id . '=1', $priority );
950
+ add_rewrite_rule( $user_slug . $root_rule, 'index.php?' . $user_id . '=$matches[1]', $priority );
951
+
952
+ // Topic-View Pagination|Feed|View
953
+ add_rewrite_rule( $view_slug . $paged_rule, 'index.php?' . $view_id . '=$matches[1]&' . $paged_id . '=$matches[2]', $priority );
954
+ add_rewrite_rule( $view_slug . $feed_rule, 'index.php?' . $view_id . '=$matches[1]&' . $feed_id . '=$matches[2]', $priority );
955
+ add_rewrite_rule( $view_slug . $root_rule, 'index.php?' . $view_id . '=$matches[1]', $priority );
956
+
957
+ // Search All
958
+ add_rewrite_rule( $search_slug . $search_paged_rule, 'index.php?' . $paged_id .'=$matches[1]', $priority );
959
+ add_rewrite_rule( $search_slug . $search_root_rule, 'index.php?' . $search_id, $priority );
960
+ }
961
+
962
+ /**
963
+ * Add permalink structures for new archive-style destinations.
964
+ *
965
+ * - Users
966
+ * - Topic Views
967
+ * - Search
968
+ *
969
+ * @since bbPress (r4930)
970
+ */
971
+ public static function add_permastructs() {
972
+
973
+ // Get unique ID's
974
+ $user_id = bbp_get_user_rewrite_id();
975
+ $view_id = bbp_get_view_rewrite_id();
976
+ $search_id = bbp_get_search_rewrite_id();
977
+
978
+ // Get root slugs
979
+ $user_slug = bbp_get_user_slug();
980
+ $view_slug = bbp_get_view_slug();
981
+ $search_slug = bbp_get_search_slug();
982
 
983
+ // User Permastruct
984
+ add_permastruct( $user_id, $user_slug . '/%' . $user_id . '%', array(
985
+ 'with_front' => false,
986
+ 'ep_mask' => EP_NONE,
987
+ 'paged' => false,
988
+ 'feed' => false,
989
+ 'forcomments' => false,
990
+ 'walk_dirs' => true,
991
+ 'endpoints' => false,
992
+ ) );
993
 
994
+ // Topic View Permastruct
995
+ add_permastruct( $view_id, $view_slug . '/%' . $view_id . '%', array(
996
+ 'with_front' => false,
997
+ 'ep_mask' => EP_NONE,
998
+ 'paged' => false,
999
+ 'feed' => false,
1000
+ 'forcomments' => false,
1001
+ 'walk_dirs' => true,
1002
+ 'endpoints' => false,
1003
+ ) );
1004
+
1005
+ // Search Permastruct
1006
+ add_permastruct( $user_id, $search_slug . '/%' . $search_id . '%', array(
1007
+ 'with_front' => false,
1008
+ 'ep_mask' => EP_NONE,
1009
+ 'paged' => true,
1010
+ 'feed' => false,
1011
+ 'forcomments' => false,
1012
+ 'walk_dirs' => true,
1013
+ 'endpoints' => false,
1014
+ ) );
1015
  }
1016
  }
1017
 
includes/admin/actions.php CHANGED
@@ -63,7 +63,8 @@ add_action( 'bbp_init', 'bbp_admin' );
63
  add_action( 'bbp_admin_menu', 'bbp_admin_separator' );
64
 
65
  // Activation
66
- add_action( 'bbp_activation', 'bbp_delete_rewrite_rules' );
 
67
 
68
  // Deactivation
69
  add_action( 'bbp_deactivation', 'bbp_remove_caps' );
63
  add_action( 'bbp_admin_menu', 'bbp_admin_separator' );
64
 
65
  // Activation
66
+ add_action( 'bbp_activation', 'bbp_delete_rewrite_rules' );
67
+ add_action( 'bbp_activation', 'bbp_make_current_user_keymaster' );
68
 
69
  // Deactivation
70
  add_action( 'bbp_deactivation', 'bbp_remove_caps' );
includes/admin/admin.php CHANGED
@@ -138,6 +138,9 @@ class BBP_Admin {
138
  add_action( 'wp_ajax_bbp_suggest_topic', array( $this, 'suggest_topic' ) );
139
  add_action( 'wp_ajax_nopriv_bbp_suggest_topic', array( $this, 'suggest_topic' ) );
140
 
 
 
 
141
  /** Filters ***********************************************************/
142
 
143
  // Modify bbPress's admin links
@@ -209,7 +212,7 @@ class BBP_Admin {
209
  }
210
 
211
  // Fudge the highlighted subnav item when on a bbPress admin page
212
- foreach( $hooks as $hook ) {
213
  add_action( "admin_head-$hook", 'bbp_tools_modify_menu_highlight' );
214
  }
215
 
@@ -224,7 +227,7 @@ class BBP_Admin {
224
  }
225
 
226
  // Are settings enabled?
227
- if ( current_user_can( 'bbp_settings_page' ) ) {
228
  add_options_page(
229
  __( 'Forums', 'bbpress' ),
230
  __( 'Forums', 'bbpress' ),
@@ -322,6 +325,9 @@ class BBP_Admin {
322
  if ( empty( $sections ) )
323
  return false;
324
 
 
 
 
325
  // Loop through sections
326
  foreach ( (array) $sections as $section_id => $section ) {
327
 
@@ -334,17 +340,26 @@ class BBP_Admin {
334
  if ( empty( $fields ) )
335
  continue;
336
 
 
 
 
 
 
 
 
337
  // Add the section
338
- add_settings_section( $section_id, $section['title'], $section['callback'], $section['page'] );
339
 
340
  // Loop through fields for this section
341
  foreach ( (array) $fields as $field_id => $field ) {
342
 
343
  // Add the field
344
- add_settings_field( $field_id, $field['title'], $field['callback'], $section['page'], $section_id, $field['args'] );
 
 
345
 
346
  // Register the setting
347
- register_setting( $section['page'], $field_id, $field['sanitize_callback'] );
348
  }
349
  }
350
  }
@@ -396,10 +411,12 @@ class BBP_Admin {
396
  case 'bbp_tools_import_page' : // Tools - Import Page
397
  case 'bbp_tools_reset_page' : // Tools - Reset Page
398
  case 'bbp_settings_page' : // Settings Page
399
- case 'bbp_settings_main' : // Settings - General
 
400
  case 'bbp_settings_theme_compat' : // Settings - Theme compat
401
  case 'bbp_settings_root_slugs' : // Settings - Root slugs
402
  case 'bbp_settings_single_slugs' : // Settings - Single slugs
 
403
  case 'bbp_settings_per_page' : // Settings - Per page
404
  case 'bbp_settings_per_rss_page' : // Settings - Per RSS page
405
  $caps = array( bbpress()->admin->minimum_capability );
@@ -470,7 +487,7 @@ class BBP_Admin {
470
  public static function modify_plugin_action_links( $links, $file ) {
471
 
472
  // Return normal links if not bbPress
473
- if ( plugin_basename( bbpress()->file ) != $file )
474
  return $links;
475
 
476
  // Add a few links to the existing links array
@@ -543,23 +560,39 @@ class BBP_Admin {
543
  $topic_class = sanitize_html_class( bbp_get_topic_post_type() );
544
  $reply_class = sanitize_html_class( bbp_get_reply_post_type() );
545
 
546
- if ( ( 'post' == get_current_screen()->base ) && ( bbp_get_reply_post_type() == get_current_screen()->post_type ) ) : ?>
547
-
548
- <script type="text/javascript">
549
- jQuery(document).ready(function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
 
551
- var bbp_topic_id = jQuery( '#bbp_topic_id' );
552
-
553
- bbp_topic_id.suggest( ajaxurl + '?action=bbp_suggest_topic', {
554
- onSelect: function() {
555
- var value = this.value;
556
- bbp_topic_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
557
- }
558
- } );
559
- });
560
- </script>
561
 
562
- <?php endif; ?>
 
 
563
 
564
  <style type="text/css" media="screen">
565
  /*<![CDATA[*/
@@ -813,7 +846,7 @@ class BBP_Admin {
813
  }
814
  }
815
 
816
- <?php if ( 'bbpress' == get_user_option( 'admin_color' ) ) : ?>
817
 
818
  /* Green Scheme Images */
819
 
@@ -1306,7 +1339,31 @@ class BBP_Admin {
1306
  // If we found some topics, loop through and display them
1307
  if ( ! empty( $topics ) ) {
1308
  foreach ( (array) $topics as $post ) {
1309
- echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) ) . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1310
  }
1311
  }
1312
  die();
@@ -1324,89 +1381,74 @@ class BBP_Admin {
1324
  list( $display_version ) = explode( '-', bbp_get_version() ); ?>
1325
 
1326
  <div class="wrap about-wrap">
1327
- <h1><?php printf( __( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
1328
- <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! bbPress %s goes great with pizza and popcorn, and will nicely complement your community too!', 'bbpress' ), $display_version ); ?></div>
1329
- <div class="bbp-badge"><?php printf( __( 'Version %s', 'bbpress' ), $display_version ); ?></div>
1330
 
1331
  <h2 class="nav-tab-wrapper">
1332
  <a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>">
1333
- <?php _e( 'What&#8217;s New', 'bbpress' ); ?>
1334
  </a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>">
1335
- <?php _e( 'Credits', 'bbpress' ); ?>
1336
  </a>
1337
  </h2>
1338
 
1339
  <div class="changelog">
1340
- <h3><?php _e( 'Forum Search', 'bbpress' ); ?></h3>
1341
 
1342
- <div class="feature-section">
1343
- <h4><?php _e( 'Only Forum Content', 'bbpress' ); ?></h4>
1344
- <p><?php _e( 'Allow your forums to be searched without mixing in your posts or pages.', 'bbpress' ); ?></p>
 
 
1345
 
1346
- <h4><?php _e( 'Choose Your Own Slug', 'bbpress' ); ?></h4>
1347
- <p><?php _e( 'Setup your forum search to live anywhere relative to the forum index.', 'bbpress' ); ?></p>
 
 
1348
  </div>
1349
  </div>
1350
 
1351
  <div class="changelog">
1352
- <h3><?php _e( 'New & Improved Forum Importers', 'bbpress' ); ?></h3>
1353
-
1354
- <div class="feature-section">
1355
- <h4><?php _e( 'BBCodes & Smilies', 'bbpress' ); ?></h4>
1356
- <p><?php _e( 'Happy faces all-around now that the importers properly convert BBCodes & smilies. :)', 'bbpress' ); ?></p>
1357
-
1358
- <h4><?php _e( 'Vanilla', 'bbpress' ); ?></h4>
1359
- <p><?php _e( 'Tired of plain old Vanilla? Now you can easily switch to <del>Mint Chocolate Chip</del> bbPress!', 'bbpress' ); ?></p>
1360
 
1361
- <h4><?php _e( 'SimplePress', 'bbpress' ); ?></h4>
1362
- <p><?php _e( 'Converting an existing SimplePress powered forum to bbPress has never been "simpler!"', 'bbpress' ); ?></p>
1363
-
1364
- <h4><?php _e( 'Mingle', 'bbpress' ); ?></h4>
1365
- <p><?php _e( 'No time to... chit-chat; convert your Mingle forums to bbPress today!', 'bbpress' ); ?></p>
1366
- </div>
1367
- </div>
1368
 
1369
- <div class="changelog">
1370
- <h3><?php _e( 'Even Better BuddyPress Integration', 'bbpress' ); ?></h3>
 
 
1371
 
1372
- <div class="feature-section">
1373
- <h4><?php _e( 'bbPress powered BuddyPress Group Forums', 'bbpress' ); ?></h4>
1374
- <p><?php _e( 'Use bbPress to manage your BuddyPress Group Forums, allowing for seamless integration and improved plugin performance.', 'bbpress' ); ?></p>
 
1375
  </div>
1376
- </div>
1377
-
1378
- <div class="changelog">
1379
- <h3><?php _e( 'Under the Hood', 'bbpress' ); ?></h3>
1380
 
1381
  <div class="feature-section col three-col">
1382
  <div>
1383
- <h4><?php _e( 'Smarter Fancy Editor', 'bbpress' ); ?></h4>
1384
- <p><?php _e( 'We simplified the Fancy Editor, and the allowed HTML tags that work with it.', 'bbpress' ); ?></p>
1385
-
1386
- <h4><?php _e( 'Better Code Posting', 'bbpress' ); ?></h4>
1387
- <p><?php _e( 'Your users can now post code snippets without too much hassle.', 'bbpress' ); ?></p>
1388
  </div>
1389
 
1390
  <div>
1391
- <h4><?php _e( 'Template Stacking', 'bbpress' ); ?></h4>
1392
- <p><?php _e( 'Now you can replace specific template parts on the fly without modifying the existing theme.', 'bbpress' ); ?></p>
1393
-
1394
- <h4><?php _e( 'TwentyThirteen Tested', 'bbpress' ); ?></h4>
1395
- <p><?php _e( 'bbPress 2.3 already works with the in-development TwentyThirteen theme, coming in a future version of WordPress.', 'bbpress' ); ?></p>
1396
  </div>
1397
 
1398
  <div class="last-feature">
1399
- <h4><?php _e( 'Statistics Shortcode', 'bbpress' ); ?></h4>
1400
- <p><?php _e( 'The old statistics easter-egg page was turned into an easy to use shortcode.', 'bbpress' ); ?></p>
1401
-
1402
- <h4><?php _e( 'Green Theme Updated', 'bbpress' ); ?></h4>
1403
- <p><?php _e( 'The green admin theme easter-egg was updated to work with WordPress 3.5 changes.', 'bbpress' ); ?></p>
1404
  </div>
1405
  </div>
1406
  </div>
1407
 
1408
  <div class="return-to-dashboard">
1409
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ) ); ?>"><?php _e( 'Go to Forum Settings', 'bbpress' ); ?></a>
1410
  </div>
1411
 
1412
  </div>
@@ -1427,101 +1469,90 @@ class BBP_Admin {
1427
  list( $display_version ) = explode( '-', bbp_get_version() ); ?>
1428
 
1429
  <div class="wrap about-wrap">
1430
- <h1><?php printf( __( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
1431
- <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! bbPress %s goes great with pizza and popcorn, and will nicely complement your community too!', 'bbpress' ), $display_version ); ?></div>
1432
- <div class="bbp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
1433
 
1434
  <h2 class="nav-tab-wrapper">
1435
  <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
1436
- <?php _e( 'What&#8217;s New', 'bbpress' ); ?>
1437
  </a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
1438
- <?php _e( 'Credits', 'bbpress' ); ?>
1439
  </a>
1440
  </h2>
1441
 
1442
- <p class="about-description"><?php _e( 'bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress' ); ?></p>
1443
 
1444
- <h4 class="wp-people-group"><?php _e( 'Project Leaders', 'bbpress' ); ?></h4>
1445
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
1446
  <li class="wp-person" id="wp-person-matt">
1447
  <a href="http://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a>
1448
  <a class="web" href="http://profiles.wordpress.org/matt">Matt Mullenweg</a>
1449
- <span class="title"><?php _e( 'Founding Developer', 'bbpress' ); ?></span>
1450
  </li>
1451
  <li class="wp-person" id="wp-person-johnjamesjacoby">
1452
  <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
1453
  <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
1454
- <span class="title"><?php _e( 'Lead Developer', 'bbpress' ); ?></span>
1455
  </li>
1456
  <li class="wp-person" id="wp-person-jmdodd">
1457
  <a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>
1458
  <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
1459
- <span class="title"></span>
1460
  </li>
1461
  </ul>
1462
 
1463
- <h4 class="wp-people-group"><?php _e( 'Contributing Developers', 'bbpress' ); ?></h4>
1464
  <ul class="wp-people-group " id="wp-people-group-contributing-developers">
1465
  <li class="wp-person" id="wp-person-netweb">
1466
  <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
1467
  <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
1468
- <span class="title"></span>
1469
  </li>
1470
  <li class="wp-person" id="wp-person-jaredatch">
1471
  <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
1472
  <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
1473
- <span class="title"></span>
1474
  </li>
1475
  <li class="wp-person" id="wp-person-gautamgupta">
1476
  <a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>
1477
  <a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a>
1478
- <span class="title"></span>
1479
  </li>
1480
  </ul>
1481
 
1482
- <h4 class="wp-people-group"><?php _e( 'Core Contributors to bbPress 2.3', 'bbpress' ); ?></h4>
1483
  <p class="wp-credits-list">
1484
- <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>,
1485
  <a href="http://profiles.wordpress.org/alex-ye">alex-ye</a>,
1486
- <a href="http://profiles.wordpress.org/anointed">anointed</a>,
 
1487
  <a href="http://profiles.wordpress.org/boonebgorges">boonebgorges</a>,
1488
- <a href="http://profiles.wordpress.org/chexee">chexee</a>,
1489
- <a href="http://profiles.wordpress.org/cnorris23">cnorris23</a>,
1490
- <a href="http://profiles.wordpress.org/DanielJuhl">DanielJuhl</a>,
1491
  <a href="http://profiles.wordpress.org/daveshine">daveshine</a>,
1492
- <a href="http://profiles.wordpress.org/dimadin">dimadin</a>,
1493
  <a href="http://profiles.wordpress.org/DJPaul">DJPaul</a>,
1494
- <a href="http://profiles.wordpress.org/duck_">duck_</a>,
1495
  <a href="http://profiles.wordpress.org/ethitter">ethitter</a>,
1496
- <a href="http://profiles.wordpress.org/gawain">gawain</a>,
1497
- <a href="http://profiles.wordpress.org/iamzippy">iamzippy</a>,
1498
- <a href="http://profiles.wordpress.org/isaacchapman">isaacchapman</a>,
1499
- <a href="http://profiles.wordpress.org/jane">jane</a>,
1500
  <a href="http://profiles.wordpress.org/jkudish">jkudish</a>,
 
 
 
1501
  <a href="http://profiles.wordpress.org/mamaduka">mamaduka</a>,
 
1502
  <a href="http://profiles.wordpress.org/mercime">mercime</a>,
1503
- <a href="http://profiles.wordpress.org/mesayre">mesayre</a>,
1504
  <a href="http://profiles.wordpress.org/mordauk">mordauk</a>,
 
1505
  <a href="http://profiles.wordpress.org/MZAWeb">MZAWeb</a>,
1506
- <a href="http://profiles.wordpress.org/nexia">nexia</a>,
1507
- <a href="http://profiles.wordpress.org/Omicron7">Omicron7</a>,
1508
- <a href="http://profiles.wordpress.org/otto42">otto42</a>,
1509
- <a href="http://profiles.wordpress.org/pavelevap">pavelevap</a>,
1510
- <a href="http://profiles.wordpress.org/plescheff">plescheff</a>,
1511
- <a href="http://profiles.wordpress.org/scribu">scribu</a>,
1512
- <a href="http://profiles.wordpress.org/sorich87">sorich87</a>,
1513
- <a href="http://profiles.wordpress.org/SteveAtty">SteveAtty</a>,
1514
- <a href="http://profiles.wordpress.org/tmoorewp">tmoorewp</a>,
1515
- <a href="http://profiles.wordpress.org/tott">tott</a>,
1516
- <a href="http://profiles.wordpress.org/tungdo">tungdo</a>,
1517
- <a href="http://profiles.wordpress.org/vibol">vibol</a>,
1518
- <a href="http://profiles.wordpress.org/wonderboymusic">wonderboymusic</a>,
1519
- <a href="http://profiles.wordpress.org/westi">westi</a>,
1520
- <a href="http://profiles.wordpress.org/xiosen">xiosen</a>,
1521
  </p>
1522
 
1523
  <div class="return-to-dashboard">
1524
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ) ); ?>"><?php _e( 'Go to Forum Settings', 'bbpress' ); ?></a>
1525
  </div>
1526
 
1527
  </div>
@@ -1547,7 +1578,7 @@ class BBP_Admin {
1547
 
1548
  <div class="wrap">
1549
  <div id="icon-edit" class="icon32 icon32-posts-topic"><br /></div>
1550
- <h2><?php _e( 'Update Forum', 'bbpress' ); ?></h2>
1551
 
1552
  <?php
1553
 
@@ -1558,8 +1589,8 @@ class BBP_Admin {
1558
  // Run the full updater
1559
  bbp_version_updater(); ?>
1560
 
1561
- <p><?php _e( 'All done!', 'bbpress' ); ?></p>
1562
- <a class="button" href="index.php?page=bbp-update"><?php _e( 'Go Back', 'bbpress' ); ?></a>
1563
 
1564
  <?php
1565
 
@@ -1568,8 +1599,8 @@ class BBP_Admin {
1568
  case 'show' :
1569
  default : ?>
1570
 
1571
- <p><?php _e( 'You can update your forum through this page. Hit the link below to update.', 'bbpress' ); ?></p>
1572
- <p><a class="button" href="index.php?page=bbp-update&amp;action=bbp-update"><?php _e( 'Update Forum', 'bbpress' ); ?></a></p>
1573
 
1574
  <?php break;
1575
 
@@ -1595,7 +1626,7 @@ class BBP_Admin {
1595
 
1596
  <div class="wrap">
1597
  <div id="icon-edit" class="icon32 icon32-posts-topic"><br /></div>
1598
- <h2><?php _e( 'Update Forums', 'bbpress' ); ?></h2>
1599
 
1600
  <?php
1601
 
@@ -1612,8 +1643,8 @@ class BBP_Admin {
1612
  // No blogs so all done!
1613
  if ( empty( $blogs ) ) : ?>
1614
 
1615
- <p><?php _e( 'All done!', 'bbpress' ); ?></p>
1616
- <a class="button" href="update-core.php?page=bbpress-update"><?php _e( 'Go Back', 'bbpress' ); ?></a>
1617
 
1618
  <?php break; ?>
1619
 
@@ -1664,8 +1695,8 @@ class BBP_Admin {
1664
  </ul>
1665
 
1666
  <p>
1667
- <?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:', 'bbpress' ); ?>
1668
- <a class="button" href="update-core.php?page=bbpress-update&amp;action=bbpress-update&amp;n=<?php echo ( $n + 5 ); ?>"><?php _e( 'Next Forums', 'bbpress' ); ?></a>
1669
  </p>
1670
  <script type='text/javascript'>
1671
  <!--
@@ -1683,8 +1714,8 @@ class BBP_Admin {
1683
  case 'show' :
1684
  default : ?>
1685
 
1686
- <p><?php _e( 'You can update all the forums on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.', 'bbpress' ); ?></p>
1687
- <p><a class="button" href="update-core.php?page=bbpress-update&amp;action=bbpress-update"><?php _e( 'Update Forums', 'bbpress' ); ?></a></p>
1688
 
1689
  <?php break;
1690
 
138
  add_action( 'wp_ajax_bbp_suggest_topic', array( $this, 'suggest_topic' ) );
139
  add_action( 'wp_ajax_nopriv_bbp_suggest_topic', array( $this, 'suggest_topic' ) );
140
 
141
+ add_action( 'wp_ajax_bbp_suggest_user', array( $this, 'suggest_user' ) );
142
+ add_action( 'wp_ajax_nopriv_bbp_suggest_user', array( $this, 'suggest_user' ) );
143
+
144
  /** Filters ***********************************************************/
145
 
146
  // Modify bbPress's admin links
212
  }
213
 
214
  // Fudge the highlighted subnav item when on a bbPress admin page
215
+ foreach ( $hooks as $hook ) {
216
  add_action( "admin_head-$hook", 'bbp_tools_modify_menu_highlight' );
217
  }
218
 
227
  }
228
 
229
  // Are settings enabled?
230
+ if ( ! bbp_settings_integration() && current_user_can( 'bbp_settings_page' ) ) {
231
  add_options_page(
232
  __( 'Forums', 'bbpress' ),
233
  __( 'Forums', 'bbpress' ),
325
  if ( empty( $sections ) )
326
  return false;
327
 
328
+ // Are we using settings integration?
329
+ $settings_integration = bbp_settings_integration();
330
+
331
  // Loop through sections
332
  foreach ( (array) $sections as $section_id => $section ) {
333
 
340
  if ( empty( $fields ) )
341
  continue;
342
 
343
+ // Toggle the section if core integration is on
344
+ if ( ( true === $settings_integration ) && !empty( $section['page'] ) ) {
345
+ $page = $section['page'];
346
+ } else {
347
+ $page = 'bbpress';
348
+ }
349
+
350
  // Add the section
351
+ add_settings_section( $section_id, $section['title'], $section['callback'], $page );
352
 
353
  // Loop through fields for this section
354
  foreach ( (array) $fields as $field_id => $field ) {
355
 
356
  // Add the field
357
+ if ( ! empty( $field['callback'] ) && !empty( $field['title'] ) ) {
358
+ add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] );
359
+ }
360
 
361
  // Register the setting
362
+ register_setting( $page, $field_id, $field['sanitize_callback'] );
363
  }
364
  }
365
  }
411
  case 'bbp_tools_import_page' : // Tools - Import Page
412
  case 'bbp_tools_reset_page' : // Tools - Reset Page
413
  case 'bbp_settings_page' : // Settings Page
414
+ case 'bbp_settings_users' : // Settings - Users
415
+ case 'bbp_settings_features' : // Settings - Features
416
  case 'bbp_settings_theme_compat' : // Settings - Theme compat
417
  case 'bbp_settings_root_slugs' : // Settings - Root slugs
418
  case 'bbp_settings_single_slugs' : // Settings - Single slugs
419
+ case 'bbp_settings_user_slugs' : // Settings - User slugs
420
  case 'bbp_settings_per_page' : // Settings - Per page
421
  case 'bbp_settings_per_rss_page' : // Settings - Per RSS page
422
  $caps = array( bbpress()->admin->minimum_capability );
487
  public static function modify_plugin_action_links( $links, $file ) {
488
 
489
  // Return normal links if not bbPress
490
+ if ( plugin_basename( bbpress()->file ) !== $file )
491
  return $links;
492
 
493
  // Add a few links to the existing links array
560
  $topic_class = sanitize_html_class( bbp_get_topic_post_type() );
561
  $reply_class = sanitize_html_class( bbp_get_reply_post_type() );
562
 
563
+ // Post type checker (only topics and replies)
564
+ if ( 'post' === get_current_screen()->base ) :
565
+ switch( get_current_screen()->post_type ) :
566
+ case bbp_get_reply_post_type() :
567
+ case bbp_get_topic_post_type() : ?>
568
+ <script type="text/javascript">
569
+ jQuery(document).ready(function() {
570
+ var bbp_author_id = jQuery( '#bbp_author_id' );
571
+ bbp_author_id.suggest( ajaxurl + '?action=bbp_suggest_user', {
572
+ onSelect: function() {
573
+ var value = this.value;
574
+ bbp_author_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
575
+ }
576
+ } );
577
+ <?php if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) : ?>
578
+ jQuery( '#misc-publishing-actions' ).find( '.misc-pub-section' ).first().remove();
579
+ jQuery( '#save-action' ).remove();
580
+ <?php elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) : ?>
581
+ var bbp_topic_id = jQuery( '#bbp_topic_id' );
582
+ bbp_topic_id.suggest( ajaxurl + '?action=bbp_suggest_topic', {
583
+ onSelect: function() {
584
+ var value = this.value;
585
+ bbp_topic_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
586
+ }
587
+ } );
588
+ <?php endif; ?>
589
+ });
590
 
591
+ </script><?php
 
 
 
 
 
 
 
 
 
592
 
593
+ break;
594
+ endswitch;
595
+ endif; ?>
596
 
597
  <style type="text/css" media="screen">
598
  /*<![CDATA[*/
846
  }
847
  }
848
 
849
+ <?php if ( 'bbpress' === get_user_option( 'admin_color' ) ) : ?>
850
 
851
  /* Green Scheme Images */
852
 
1339
  // If we found some topics, loop through and display them
1340
  if ( ! empty( $topics ) ) {
1341
  foreach ( (array) $topics as $post ) {
1342
+ printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );
1343
+ }
1344
+ }
1345
+ die();
1346
+ }
1347
+
1348
+ /**
1349
+ * Ajax action for facilitating the topic and reply author auto-suggest
1350
+ *
1351
+ * @since bbPress (r5014)
1352
+ */
1353
+ public function suggest_user() {
1354
+
1355
+ // Try to get some users
1356
+ $users_query = new WP_User_Query( array(
1357
+ 'search' => '*' . like_escape( $_REQUEST['q'] ) . '*',
1358
+ 'fields' => array( 'ID', 'user_nicename' ),
1359
+ 'search_columns' => array( 'ID', 'user_nicename', 'user_email' ),
1360
+ 'orderby' => 'ID'
1361
+ ) );
1362
+
1363
+ // If we found some users, loop through and display them
1364
+ if ( ! empty( $users_query->results ) ) {
1365
+ foreach ( (array) $users_query->results as $user ) {
1366
+ printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" );
1367
  }
1368
  }
1369
  die();
1381
  list( $display_version ) = explode( '-', bbp_get_version() ); ?>
1382
 
1383
  <div class="wrap about-wrap">
1384
+ <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
1385
+ <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', 'bbpress' ), $display_version ); ?></div>
1386
+ <div class="bbp-badge"><?php printf( esc_html__( 'Version %s', 'bbpress' ), $display_version ); ?></div>
1387
 
1388
  <h2 class="nav-tab-wrapper">
1389
  <a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>">
1390
+ <?php esc_html_e( 'What&#8217;s New', 'bbpress' ); ?>
1391
  </a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>">
1392
+ <?php esc_html_e( 'Credits', 'bbpress' ); ?>
1393
  </a>
1394
  </h2>
1395
 
1396
  <div class="changelog">
1397
+ <h3><?php esc_html_e( 'Hierarchical Replies', 'bbpress' ); ?></h3>
1398
 
1399
+ <div class="feature-section col two-col">
1400
+ <div class="last-feature">
1401
+ <h4><?php esc_html_e( 'Reply to replies', 'bbpress' ); ?></h4>
1402
+ <p><?php esc_html_e( 'Now your users can reply to specific replies, providing context to each inidividual post.', 'bbpress' ); ?></p>
1403
+ </div>
1404
 
1405
+ <div>
1406
+ <h4><?php esc_html_e( 'Choose your own discussion style', 'bbpress' ); ?></h4>
1407
+ <p><?php esc_html_e( 'Stay flat or go threaded, and seamlessly switch between the two.', 'bbpress' ); ?></p>
1408
+ </div>
1409
  </div>
1410
  </div>
1411
 
1412
  <div class="changelog">
1413
+ <h3><?php esc_html_e( 'Under the Hood', 'bbpress' ); ?></h3>
 
 
 
 
 
 
 
1414
 
1415
+ <div class="feature-section col three-col">
1416
+ <div>
1417
+ <h4><?php esc_html_e( 'Preformatted text', 'bbpress' ); ?></h4>
1418
+ <p><?php esc_html_e( 'Forum users can post code snippets with confidence.', 'bbpress' ); ?></p>
1419
+ </div>
 
 
1420
 
1421
+ <div>
1422
+ <h4><?php esc_html_e( 'Polyglot support', 'bbpress' ); ?></h4>
1423
+ <p><?php esc_html_e( 'bbPress is ready for future translation API improvements.', 'bbpress' ); ?></p>
1424
+ </div>
1425
 
1426
+ <div class="last-feature">
1427
+ <h4><?php esc_html_e( 'User capabilities', 'bbpress' ); ?></h4>
1428
+ <p><?php esc_html_e( 'Roles and capabilities have been swept through, cleaned up, and simplified.', 'bbpress' ); ?></p>
1429
+ </div>
1430
  </div>
 
 
 
 
1431
 
1432
  <div class="feature-section col three-col">
1433
  <div>
1434
+ <h4><?php esc_html_e( 'Search', 'bbpress' ); ?></h4>
1435
+ <p><?php esc_html_e( 'Search results use pretty permalinks, and have a dedicated output page.', 'bbpress' ); ?></p>
 
 
 
1436
  </div>
1437
 
1438
  <div>
1439
+ <h4><?php esc_html_e( 'Settings', 'bbpress' ); ?></h4>
1440
+ <p><?php esc_html_e( 'Fields and sections have been reordered and reorganized.', 'bbpress' ); ?></p>
 
 
 
1441
  </div>
1442
 
1443
  <div class="last-feature">
1444
+ <h4><?php esc_html_e( 'BuddyPress', 'bbpress' ); ?></h4>
1445
+ <p><?php esc_html_e( 'Forums are now fully and seamlessly integrated into BuddyPress Groups.', 'bbpress' ); ?></p>
 
 
 
1446
  </div>
1447
  </div>
1448
  </div>
1449
 
1450
  <div class="return-to-dashboard">
1451
+ <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>
1452
  </div>
1453
 
1454
  </div>
1469
  list( $display_version ) = explode( '-', bbp_get_version() ); ?>
1470
 
1471
  <div class="wrap about-wrap">
1472
+ <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
1473
+ <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>
1474
+ <div class="bbp-badge"><?php printf( esc_html__( 'Version %s', 'bbpress' ), $display_version ); ?></div>
1475
 
1476
  <h2 class="nav-tab-wrapper">
1477
  <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
1478
+ <?php esc_html_e( 'What&#8217;s New', 'bbpress' ); ?>
1479
  </a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
1480
+ <?php esc_html_e( 'Credits', 'bbpress' ); ?>
1481
  </a>
1482
  </h2>
1483
 
1484
+ <p class="about-description"><?php esc_html_e( 'bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress' ); ?></p>
1485
 
1486
+ <h4 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'bbpress' ); ?></h4>
1487
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
1488
  <li class="wp-person" id="wp-person-matt">
1489
  <a href="http://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a>
1490
  <a class="web" href="http://profiles.wordpress.org/matt">Matt Mullenweg</a>
1491
+ <span class="title"><?php esc_html_e( 'Founding Developer', 'bbpress' ); ?></span>
1492
  </li>
1493
  <li class="wp-person" id="wp-person-johnjamesjacoby">
1494
  <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
1495
  <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
1496
+ <span class="title"><?php esc_html_e( 'Lead Developer', 'bbpress' ); ?></span>
1497
  </li>
1498
  <li class="wp-person" id="wp-person-jmdodd">
1499
  <a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>
1500
  <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
1501
+ <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
1502
  </li>
1503
  </ul>
1504
 
1505
+ <h4 class="wp-people-group"><?php esc_html_e( 'Contributing Developers', 'bbpress' ); ?></h4>
1506
  <ul class="wp-people-group " id="wp-people-group-contributing-developers">
1507
  <li class="wp-person" id="wp-person-netweb">
1508
  <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
1509
  <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
1510
+ <span class="title"><?php esc_html_e( 'Converter Specialist', 'bbpress' ); ?></span>
1511
  </li>
1512
  <li class="wp-person" id="wp-person-jaredatch">
1513
  <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
1514
  <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
1515
+ <span class="title"><?php esc_html_e( 'Bug Testing', 'bbpress' ); ?></span>
1516
  </li>
1517
  <li class="wp-person" id="wp-person-gautamgupta">
1518
  <a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>
1519
  <a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a>
1520
+ <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>
1521
  </li>
1522
  </ul>
1523
 
1524
+ <h4 class="wp-people-group"><?php esc_html_e( 'Core Contributors to bbPress 2.4', 'bbpress' ); ?></h4>
1525
  <p class="wp-credits-list">
 
1526
  <a href="http://profiles.wordpress.org/alex-ye">alex-ye</a>,
1527
+ <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>,
1528
+ <a href="http://profiles.wordpress.org/aliso">aliso</a>,
1529
  <a href="http://profiles.wordpress.org/boonebgorges">boonebgorges</a>,
 
 
 
1530
  <a href="http://profiles.wordpress.org/daveshine">daveshine</a>,
 
1531
  <a href="http://profiles.wordpress.org/DJPaul">DJPaul</a>,
 
1532
  <a href="http://profiles.wordpress.org/ethitter">ethitter</a>,
1533
+ <a href="http://profiles.wordpress.org/fanquake">fanquake</a>,
1534
+ <a href="http://profiles.wordpress.org/GargajCNS">GargajCNS</a>,
1535
+ <a href="http://profiles.wordpress.org/GautamGupta">GautamGupta</a>,
1536
+ <a href="http://profiles.wordpress.org/imath">imath</a>,
1537
  <a href="http://profiles.wordpress.org/jkudish">jkudish</a>,
1538
+ <a href="http://profiles.wordpress.org/kobenland">kobenland</a>,
1539
+ <a href="http://profiles.wordpress.org/lakrisgubben">lakrisgubben</a>,
1540
+ <a href="http://profiles.wordpress.org/loki_racer">loki_racer</a>,
1541
  <a href="http://profiles.wordpress.org/mamaduka">mamaduka</a>,
1542
+ <a href="http://profiles.wordpress.org/Maty">Maty</a>,
1543
  <a href="http://profiles.wordpress.org/mercime">mercime</a>,
 
1544
  <a href="http://profiles.wordpress.org/mordauk">mordauk</a>,
1545
+ <a href="http://profiles.wordpress.org/mrcl">mrcl</a>,
1546
  <a href="http://profiles.wordpress.org/MZAWeb">MZAWeb</a>,
1547
+ <a href="http://profiles.wordpress.org/r-a-y">r-a-y</a>,
1548
+ <a href="http://profiles.wordpress.org/strangerstudios">strangerstudios</a>,
1549
+ <a href="http://profiles.wordpress.org/thebrandonallen">thebrandonallen</a>,
1550
+ <a href="http://profiles.wordpress.org/tlovett1">tlovett1</a>,
1551
+ <a href="http://profiles.wordpress.org/wpdennis">wpdennis</a>,
 
 
 
 
 
 
 
 
 
 
1552
  </p>
1553
 
1554
  <div class="return-to-dashboard">
1555
+ <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>
1556
  </div>
1557
 
1558
  </div>
1578
 
1579
  <div class="wrap">
1580
  <div id="icon-edit" class="icon32 icon32-posts-topic"><br /></div>
1581
+ <h2><?php esc_html_e( 'Update Forum', 'bbpress' ); ?></h2>
1582
 
1583
  <?php
1584
 
1589
  // Run the full updater
1590
  bbp_version_updater(); ?>
1591
 
1592
+ <p><?php esc_html_e( 'All done!', 'bbpress' ); ?></p>
1593
+ <a class="button" href="index.php?page=bbp-update"><?php esc_html_e( 'Go Back', 'bbpress' ); ?></a>
1594
 
1595
  <?php
1596
 
1599
  case 'show' :
1600
  default : ?>
1601
 
1602
+ <p><?php esc_html_e( 'You can update your forum through this page. Hit the link below to update.', 'bbpress' ); ?></p>
1603
+ <p><a class="button" href="index.php?page=bbp-update&amp;action=bbp-update"><?php esc_html_e( 'Update Forum', 'bbpress' ); ?></a></p>
1604
 
1605
  <?php break;
1606
 
1626
 
1627
  <div class="wrap">
1628
  <div id="icon-edit" class="icon32 icon32-posts-topic"><br /></div>
1629
+ <h2><?php esc_html_e( 'Update Forums', 'bbpress' ); ?></h2>
1630
 
1631
  <?php
1632
 
1643
  // No blogs so all done!
1644
  if ( empty( $blogs ) ) : ?>
1645
 
1646
+ <p><?php esc_html_e( 'All done!', 'bbpress' ); ?></p>
1647
+ <a class="button" href="update-core.php?page=bbpress-update"><?php esc_html_e( 'Go Back', 'bbpress' ); ?></a>
1648
 
1649
  <?php break; ?>
1650
 
1695
  </ul>
1696
 
1697
  <p>
1698
+ <?php esc_html_e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:', 'bbpress' ); ?>
1699
+ <a class="button" href="update-core.php?page=bbpress-update&amp;action=bbpress-update&amp;n=<?php echo ( $n + 5 ); ?>"><?php esc_html_e( 'Next Forums', 'bbpress' ); ?></a>
1700
  </p>
1701
  <script type='text/javascript'>
1702
  <!--
1714
  case 'show' :
1715
  default : ?>
1716
 
1717
+ <p><?php esc_html_e( 'You can update all the forums on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.', 'bbpress' ); ?></p>
1718
+ <p><a class="button" href="update-core.php?page=bbpress-update&amp;action=bbpress-update"><?php esc_html_e( 'Update Forums', 'bbpress' ); ?></a></p>
1719
 
1720
  <?php break;
1721
 
includes/admin/converter.php CHANGED
@@ -220,7 +220,7 @@ class BBP_Converter {
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 _e( 'Starting Conversion', 'bbpress' ); ?></p>' );
224
  bbconverter_run();
225
  }
226
  }
@@ -245,7 +245,7 @@ class BBP_Converter {
245
  function bbconverter_success(response) {
246
  bbconverter_log(response);
247
 
248
- if ( response == '<p class="loading"><?php _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
@@ -467,6 +467,21 @@ class BBP_Converter {
467
 
468
  break;
469
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  default :
471
  delete_option( '_bbp_converter_step' );
472
  delete_option( '_bbp_converter_start' );
@@ -558,6 +573,11 @@ abstract class BBP_Converter_Base {
558
  */
559
  private $map_topicid = array();
560
 
 
 
 
 
 
561
  /**
562
  * @var array() Map of from old user ids to new user ids. It is for optimization.
563
  */
@@ -963,6 +983,11 @@ abstract class BBP_Converter_Base {
963
  } elseif ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
964
  $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
965
  }
 
 
 
 
 
966
  }
967
  }
968
  break;
@@ -976,6 +1001,9 @@ abstract class BBP_Converter_Base {
976
  return ! $has_insert;
977
  }
978
 
 
 
 
979
  public function convert_forum_parents( $start ) {
980
 
981
  $has_update = false;
@@ -999,6 +1027,32 @@ abstract class BBP_Converter_Base {
999
  return ! $has_update;
1000
  }
1001
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1002
  /**
1003
  * This method deletes data from the wp database.
1004
  */
@@ -1185,6 +1239,29 @@ abstract class BBP_Converter_Base {
1185
  return $this->map_topicid[$field];
1186
  }
1187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1188
  /**
1189
  * A mini cache system to reduce database calls to user ID's
1190
  *
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
  }
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
467
 
468
  break;
469
 
470
+ // STEP 9. Convert reply_to parents.
471
+ case 9 :
472
+ if ( $converter->convert_reply_to_parents( $start ) ) {
473
+ update_option( '_bbp_converter_step', $step + 1 );
474
+ update_option( '_bbp_converter_start', 0 );
475
+ if ( empty( $start ) ) {
476
+ $this->converter_output( __( 'No reply_to parents to convert', 'bbpress' ) );
477
+ }
478
+ } else {
479
+ update_option( '_bbp_converter_start', $max + 1 );
480
+ $this->converter_output( sprintf( __( 'Calculating reply_to parents (%1$s - %2$s)', 'bbpress' ), $min, $max ) );
481
+ }
482
+
483
+ break;
484
+
485
  default :
486
  delete_option( '_bbp_converter_step' );
487
  delete_option( '_bbp_converter_start' );
573
  */
574
  private $map_topicid = array();
575
 
576
+ /**
577
+ * @var array() Map of from old reply_to ids to new reply_to ids. It is for optimization.
578
+ */
579
+ private $map_reply_to = array();
580
+
581
  /**
582
  * @var array() Map of from old user ids to new user ids. It is for optimization.
583
  */
983
  } elseif ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
984
  $this->wpdb->insert( $this->sync_table_name, array( 'value_type' => 'post', 'value_id' => $post_id, 'meta_key' => $key, 'meta_value' => $value ) );
985
  }
986
+
987
+ // Replies need to save their old reply_to ID for hierarchical replies association
988
+ if ( ( 'reply' == $to_type ) && ( '_bbp_reply_to' == $key ) ) {
989
+ add_post_meta( $post_id, '_bbp_old_reply_to', $value );
990
+ }
991
  }
992
  }
993
  break;
1001
  return ! $has_insert;
1002
  }
1003
 
1004
+ /**
1005
+ * This method conerts old forum heirarchy to new bbPress heirarchy.
1006
+ */
1007
  public function convert_forum_parents( $start ) {
1008
 
1009
  $has_update = false;
1027
  return ! $has_update;
1028
  }
1029
 
1030
+ /**
1031
+ * This method conerts old reply_to post id to new bbPress reply_to post id.
1032
+ */
1033
+ public function convert_reply_to_parents( $start ) {
1034
+
1035
+ $has_update = false;
1036
+
1037
+ if ( !empty( $this->sync_table ) ) {
1038
+ $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;
1039
+ } else {
1040
+ $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;
1041
+ }
1042
+
1043
+ update_option( '_bbp_converter_query', $query );
1044
+
1045
+ $reply_to_array = $this->wpdb->get_results( $query );
1046
+
1047
+ foreach ( (array) $reply_to_array as $row ) {
1048
+ $reply_to = $this->callback_reply_to( $row->meta_value );
1049
+ $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' );
1050
+ $has_update = true;
1051
+ }
1052
+
1053
+ return ! $has_update;
1054
+ }
1055
+
1056
  /**
1057
  * This method deletes data from the wp database.
1058
  */
1239
  return $this->map_topicid[$field];
1240
  }
1241
 
1242
+ /**
1243
+ * A mini cache system to reduce database calls to reply_to post id.
1244
+ *
1245
+ * @param string $field
1246
+ * @return string
1247
+ */
1248
+ private function callback_reply_to( $field ) {
1249
+ if ( !isset( $this->map_reply_to[$field] ) ) {
1250
+ if ( !empty( $this->sync_table ) ) {
1251
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_reply_to" AND meta_value = "%s" LIMIT 1', $field ) );
1252
+ } else {
1253
+ $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_reply_to" AND meta_value = "%s" LIMIT 1', $field ) );
1254
+ }
1255
+
1256
+ if ( !is_null( $row ) ) {
1257
+ $this->map_reply_to[$field] = $row->value_id;
1258
+ } else {
1259
+ $this->map_reply_to[$field] = 0;
1260
+ }
1261
+ }
1262
+ return $this->map_reply_to[$field];
1263
+ }
1264
+
1265
  /**
1266
  * A mini cache system to reduce database calls to user ID's
1267
  *
includes/admin/converters/Example.php CHANGED
@@ -1,311 +1,590 @@
1
  <?php
2
 
3
  /**
4
- * Implementation of Example converter.
 
 
 
5
  */
6
- class Example_Converter extends BBP_Converter_Base
7
- {
8
- function __construct()
9
- {
 
 
 
 
10
  parent::__construct();
11
  $this->setup_globals();
12
  }
13
 
14
- public function setup_globals()
15
- {
16
- /** Forum Section ******************************************************/
 
17
 
18
- // Forum id. Stored in postmeta.
 
 
 
 
19
  $this->field_map[] = array(
20
- 'from_tablename' => 'forum', 'from_fieldname' => 'forumid',
21
- 'to_type' => 'forum', 'to_fieldname' => '_bbp_forum_id'
 
 
22
  );
23
-
24
- // Forum parent id. If no parent, than 0. Stored in postmeta.
25
  $this->field_map[] = array(
26
- 'from_tablename' => 'forum', 'from_fieldname' => 'parentid',
27
- 'to_type' => 'forum', 'to_fieldname' => '_bbp_parent_id'
 
 
28
  );
29
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  // Forum title.
31
  $this->field_map[] = array(
32
- 'from_tablename' => 'forum', 'from_fieldname' => 'title',
33
- 'to_type' => 'forum', 'to_fieldname' => 'post_title'
 
 
34
  );
35
-
36
- // Forum slug. Clean name.
37
  $this->field_map[] = array(
38
- 'from_tablename' => 'forum', 'from_fieldname' => 'title_clean',
39
- 'to_type' => 'forum', 'to_fieldname' => 'post_name',
 
 
40
  'callback_method' => 'callback_slug'
41
  );
42
-
43
  // Forum description.
44
  $this->field_map[] = array(
45
- 'from_tablename' => 'forum', 'from_fieldname' => 'description',
46
- 'to_type' => 'forum', 'to_fieldname' => 'post_content',
 
 
47
  'callback_method' => 'callback_null'
48
  );
49
-
50
- // Forum display order. Starts from 1.
51
  $this->field_map[] = array(
52
- 'from_tablename' => 'forum', 'from_fieldname' => 'displayorder',
53
- 'to_type' => 'forum', 'to_fieldname' => 'menu_order'
 
 
54
  );
55
-
56
- // Forum date update.
57
  $this->field_map[] = array(
58
- 'to_type' => 'forum', 'to_fieldname' => 'post_date',
 
59
  'default' => date('Y-m-d H:i:s')
60
  );
61
  $this->field_map[] = array(
62
- 'to_type' => 'forum', 'to_fieldname' => 'post_date_gmt',
 
63
  'default' => date('Y-m-d H:i:s')
64
  );
65
  $this->field_map[] = array(
66
- 'to_type' => 'forum', 'to_fieldname' => 'post_modified',
 
67
  'default' => date('Y-m-d H:i:s')
68
  );
69
  $this->field_map[] = array(
70
- 'to_type' => 'forum', 'to_fieldname' => 'post_modified_gmt',
 
71
  'default' => date('Y-m-d H:i:s')
72
  );
73
 
74
- /** Topic Section ******************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
- // Topic id. Stored in postmeta.
77
  $this->field_map[] = array(
78
- 'from_tablename' => 'thread', 'from_fieldname' => 'threadid',
79
- 'to_type' => 'topic', 'to_fieldname' => '_bbp_topic_id'
 
 
80
  );
81
-
82
- // Forum id. Stored in postmeta.
83
  $this->field_map[] = array(
84
- 'from_tablename' => 'thread', 'from_fieldname' => 'forumid',
85
- 'to_type' => 'topic', 'to_fieldname' => '_bbp_forum_id',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  'callback_method' => 'callback_forumid'
87
  );
88
-
89
  // Topic author.
90
  $this->field_map[] = array(
91
- 'from_tablename' => 'thread', 'from_fieldname' => 'postuserid',
92
- 'to_type' => 'topic', 'to_fieldname' => 'post_author',
 
 
93
  'callback_method' => 'callback_userid'
94
  );
95
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  // Topic title.
97
  $this->field_map[] = array(
98
- 'from_tablename' => 'thread', 'from_fieldname' => 'title',
99
- 'to_type' => 'topic', 'to_fieldname' => 'post_title'
 
 
100
  );
101
-
102
- // Topic slug. Clean name.
103
  $this->field_map[] = array(
104
- 'from_tablename' => 'thread', 'from_fieldname' => 'title',
105
- 'to_type' => 'topic', 'to_fieldname' => 'post_name',
 
 
106
  'callback_method' => 'callback_slug'
107
  );
108
-
109
- // Forum id. If no parent, than 0.
110
  $this->field_map[] = array(
111
- 'from_tablename' => 'thread', 'from_fieldname' => 'forumid',
112
- 'to_type' => 'topic', 'to_fieldname' => 'post_parent',
 
 
113
  'callback_method' => 'callback_forumid'
114
  );
115
 
116
- // Topic date update.
 
 
 
 
 
 
 
117
  $this->field_map[] = array(
118
- 'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
119
- 'to_type' => 'topic', 'to_fieldname' => 'post_date',
 
 
120
  'callback_method' => 'callback_datetime'
121
  );
122
  $this->field_map[] = array(
123
- 'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
124
- 'to_type' => 'topic', 'to_fieldname' => 'post_date_gmt',
 
 
125
  'callback_method' => 'callback_datetime'
126
  );
127
  $this->field_map[] = array(
128
- 'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
129
- 'to_type' => 'topic', 'to_fieldname' => 'post_modified',
 
 
130
  'callback_method' => 'callback_datetime'
131
  );
132
  $this->field_map[] = array(
133
- 'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
134
- 'to_type' => 'topic', 'to_fieldname' => 'post_modified_gmt',
 
 
135
  'callback_method' => 'callback_datetime'
136
  );
137
 
 
 
 
 
 
 
 
 
 
 
 
138
  /** Tags Section ******************************************************/
139
-
 
 
 
 
 
 
 
 
 
 
 
 
140
  // Topic id.
141
  $this->field_map[] = array(
142
- 'from_tablename' => 'tagcontent', 'from_fieldname' => 'contentid',
143
- 'to_type' => 'tags', 'to_fieldname' => 'objectid',
 
 
144
  'callback_method' => 'callback_topicid'
145
  );
146
-
147
- // Tags text.
148
  $this->field_map[] = array(
149
- 'from_tablename' => 'tag', 'from_fieldname' => 'tagtext',
150
- 'join_tablename' => 'tagcontent', 'join_type' => 'INNER', 'join_expression' => 'USING (tagid)',
151
- 'to_type' => 'tags', 'to_fieldname' => 'name'
152
- );
 
 
 
 
 
 
 
 
 
 
 
153
 
154
- /** Post Section ******************************************************/
155
 
156
- // Post id. Stores in postmeta.
157
  $this->field_map[] = array(
158
- 'from_tablename' => 'post', 'from_fieldname' => 'postid',
159
- 'to_type' => 'reply', 'to_fieldname' => '_bbp_post_id'
 
 
160
  );
161
-
162
- // Forum id. Stores in postmeta.
163
  $this->field_map[] = array(
164
- 'from_tablename' => 'post', 'from_fieldname' => 'threadid',
165
- 'to_type' => 'reply', 'to_fieldname' => '_bbp_forum_id',
 
 
166
  'callback_method' => 'callback_topicid_to_forumid'
167
  );
168
-
169
- // Topic id. Stores in postmeta.
170
  $this->field_map[] = array(
171
- 'from_tablename' => 'post', 'from_fieldname' => 'threadid',
172
- 'to_type' => 'reply', 'to_fieldname' => '_bbp_topic_id',
 
 
173
  'callback_method' => 'callback_topicid'
174
  );
175
-
176
- // Author ip.
177
  $this->field_map[] = array(
178
- 'from_tablename' => 'post', 'from_fieldname' => 'ipaddress',
179
- 'to_type' => 'reply', 'to_fieldname' => '__bbp_author_ip'
180
- );
181
-
182
- // Post author.
 
 
183
  $this->field_map[] = array(
184
- 'from_tablename' => 'post', 'from_fieldname' => 'userid',
185
- 'to_type' => 'reply', 'to_fieldname' => 'post_author',
 
 
186
  'callback_method' => 'callback_userid'
187
  );
188
-
189
- // Topic title.
190
  $this->field_map[] = array(
191
- 'from_tablename' => 'post', 'from_fieldname' => 'title',
192
- 'to_type' => 'reply', 'to_fieldname' => 'post_title'
 
 
193
  );
194
-
195
- // Topic slug. Clean name.
196
  $this->field_map[] = array(
197
- 'from_tablename' => 'post', 'from_fieldname' => 'title',
198
- 'to_type' => 'reply', 'to_fieldname' => 'post_name',
 
 
199
  'callback_method' => 'callback_slug'
200
  );
201
-
202
- // Post content.
203
  $this->field_map[] = array(
204
- 'from_tablename' => 'post', 'from_fieldname' => 'pagetext',
205
- 'to_type' => 'reply', 'to_fieldname' => 'post_content',
 
 
206
  'callback_method' => 'callback_html'
207
  );
208
-
209
- // Topic id. If no parent, than 0.
 
 
 
 
 
 
 
 
210
  $this->field_map[] = array(
211
- 'from_tablename' => 'post', 'from_fieldname' => 'threadid',
212
- 'to_type' => 'reply', 'to_fieldname' => 'post_parent',
 
 
213
  'callback_method' => 'callback_topicid'
214
  );
215
 
216
- // Topic date update.
217
  $this->field_map[] = array(
218
- 'from_tablename' => 'post', 'from_fieldname' => 'dateline',
219
- 'to_type' => 'reply', 'to_fieldname' => 'post_date',
 
 
220
  'callback_method' => 'callback_datetime'
221
  );
222
  $this->field_map[] = array(
223
- 'from_tablename' => 'post', 'from_fieldname' => 'dateline',
224
- 'to_type' => 'reply', 'to_fieldname' => 'post_date_gmt',
 
 
225
  'callback_method' => 'callback_datetime'
226
  );
227
  $this->field_map[] = array(
228
- 'from_tablename' => 'post', 'from_fieldname' => 'dateline',
229
- 'to_type' => 'reply', 'to_fieldname' => 'post_modified',
 
 
230
  'callback_method' => 'callback_datetime'
231
  );
232
  $this->field_map[] = array(
233
- 'from_tablename' => 'post', 'from_fieldname' => 'dateline',
234
- 'to_type' => 'reply', 'to_fieldname' => 'post_modified_gmt',
 
 
235
  'callback_method' => 'callback_datetime'
236
  );
237
 
 
 
 
 
 
 
 
 
 
 
 
238
  /** User Section ******************************************************/
239
 
240
- // Store old User id. Stores in usermeta.
 
 
241
  $this->field_map[] = array(
242
- 'from_tablename' => 'user', 'from_fieldname' => 'userid',
243
- 'to_type' => 'user', 'to_fieldname' => '_bbp_user_id'
 
 
244
  );
245
-
246
- // Store old User password. Stores in usermeta serialized with salt.
247
  $this->field_map[] = array(
248
- 'from_tablename' => 'user', 'from_fieldname' => 'password',
249
- 'to_type' => 'user', 'to_fieldname' => '_bbp_password',
 
 
250
  'callback_method' => 'callback_savepass'
251
  );
252
 
253
- // Store old User Salt. This is only used for the SELECT row info for the above password save
254
  $this->field_map[] = array(
255
- 'from_tablename' => 'user', 'from_fieldname' => 'salt',
256
- 'to_type' => 'user', 'to_fieldname' => ''
 
 
257
  );
258
-
259
- // User password verify class. Stores in usermeta for verifying password.
260
  $this->field_map[] = array(
261
- 'to_type' => 'user', 'to_fieldname' => '_bbp_class',
262
- 'default' => 'Vbulletin'
 
263
  );
264
-
265
  // User name.
266
  $this->field_map[] = array(
267
- 'from_tablename' => 'user', 'from_fieldname' => 'username',
268
- 'to_type' => 'user', 'to_fieldname' => 'user_login'
 
 
 
 
 
 
 
 
 
 
269
  );
270
-
271
  // User email.
272
  $this->field_map[] = array(
273
- 'from_tablename' => 'user', 'from_fieldname' => 'email',
274
- 'to_type' => 'user', 'to_fieldname' => 'user_email'
 
 
275
  );
276
-
277
  // User homepage.
278
  $this->field_map[] = array(
279
- 'from_tablename' => 'user', 'from_fieldname' => 'homepage',
280
- 'to_type' => 'user', 'to_fieldname' => 'user_url'
 
 
281
  );
282
-
283
  // User registered.
284
  $this->field_map[] = array(
285
- 'from_tablename' => 'user', 'from_fieldname' => 'joindate',
286
- 'to_type' => 'user', 'to_fieldname' => 'user_registered',
 
 
287
  'callback_method' => 'callback_datetime'
288
  );
289
-
290
- // User aim.
291
  $this->field_map[] = array(
292
- 'from_tablename' => 'user', 'from_fieldname' => 'aim',
293
- 'to_type' => 'user', 'to_fieldname' => 'aim'
 
 
294
  );
295
-
296
- // User yahoo.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  $this->field_map[] = array(
298
- 'from_tablename' => 'user', 'from_fieldname' => 'yahoo',
299
- 'to_type' => 'user', 'to_fieldname' => 'yim'
300
- );
 
 
 
 
 
301
  }
302
-
303
  /**
304
  * This method allows us to indicates what is or is not converted for each
305
  * converter.
306
  */
307
- public function info()
308
- {
309
  return '';
310
  }
311
 
@@ -314,8 +593,7 @@ class Example_Converter extends BBP_Converter_Base
314
  * way when we authenticate it we can get it out of the database
315
  * as one value. Array values are auto sanitized by WordPress.
316
  */
317
- public function callback_savepass( $field, $row )
318
- {
319
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
320
  return $pass_array;
321
  }
@@ -324,8 +602,7 @@ class Example_Converter extends BBP_Converter_Base
324
  * This method is to take the pass out of the database and compare
325
  * to a pass the user has typed in.
326
  */
327
- public function authenticate_pass( $password, $serialized_pass )
328
- {
329
  $pass_array = unserialize( $serialized_pass );
330
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
331
  }
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
+ /**
22
+ * Sets up the field mappings
23
+ */
24
+ public function setup_globals() {
25
 
26
+ /** Forum Section *****************************************************/
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)
39
  $this->field_map[] = array(
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)
47
+ $this->field_map[] = array(
48
+ 'from_tablename' => 'forums_table',
49
+ 'from_fieldname' => 'the_topic_count',
50
+ 'to_type' => 'forum',
51
+ 'to_fieldname' => '_bbp_topic_count'
52
+ );
53
+
54
+ // Forum reply count (Stored in postmeta)
55
+ $this->field_map[] = array(
56
+ 'from_tablename' => 'forums_table',
57
+ 'from_fieldname' => 'the_reply_count',
58
+ 'to_type' => 'forum',
59
+ 'to_fieldname' => '_bbp_reply_count'
60
+ );
61
+
62
+ // Forum total topic count (Stored in postmeta)
63
+ $this->field_map[] = array(
64
+ 'from_tablename' => 'forums_table',
65
+ 'from_fieldname' => 'the_total_topic_count',
66
+ 'to_type' => 'forum',
67
+ 'to_fieldname' => '_bbp_total_topic_count'
68
+ );
69
+
70
+ // Forum total reply count (Stored in postmeta)
71
+ $this->field_map[] = array(
72
+ 'from_tablename' => 'forums_table',
73
+ 'from_fieldname' => 'the_total_reply_count',
74
+ 'to_type' => 'forum',
75
+ 'to_fieldname' => '_bbp_total_reply_count'
76
+ );
77
+
78
  // Forum title.
79
  $this->field_map[] = array(
80
+ 'from_tablename' => 'forums_table',
81
+ 'from_fieldname' => 'the_forum_title',
82
+ 'to_type' => 'forum',
83
+ 'to_fieldname' => 'post_title'
84
  );
85
+
86
+ // Forum slug (Clean name to avoid confilcts)
87
  $this->field_map[] = array(
88
+ 'from_tablename' => 'forums_table',
89
+ 'from_fieldname' => 'the_forum_slug',
90
+ 'to_type' => 'forum',
91
+ 'to_fieldname' => 'post_name',
92
  'callback_method' => 'callback_slug'
93
  );
94
+
95
  // Forum description.
96
  $this->field_map[] = array(
97
+ 'from_tablename' => 'forums_table',
98
+ 'from_fieldname' => 'the_forum_description',
99
+ 'to_type' => 'forum',
100
+ 'to_fieldname' => 'post_content',
101
  'callback_method' => 'callback_null'
102
  );
103
+
104
+ // Forum display order (Starts from 1)
105
  $this->field_map[] = array(
106
+ 'from_tablename' => 'forums_table',
107
+ 'from_fieldname' => 'the_forum_order',
108
+ 'to_type' => 'forum',
109
+ 'to_fieldname' => 'menu_order'
110
  );
111
+
112
+ // Forum dates.
113
  $this->field_map[] = array(
114
+ 'to_type' => 'forum',
115
+ 'to_fieldname' => 'post_date',
116
  'default' => date('Y-m-d H:i:s')
117
  );
118
  $this->field_map[] = array(
119
+ 'to_type' => 'forum',
120
+ 'to_fieldname' => 'post_date_gmt',
121
  'default' => date('Y-m-d H:i:s')
122
  );
123
  $this->field_map[] = array(
124
+ 'to_type' => 'forum',
125
+ 'to_fieldname' => 'post_modified',
126
  'default' => date('Y-m-d H:i:s')
127
  );
128
  $this->field_map[] = array(
129
+ 'to_type' => 'forum',
130
+ 'to_fieldname' => 'post_modified_gmt',
131
  'default' => date('Y-m-d H:i:s')
132
  );
133
 
134
+ // Setup the table joins for the forum section
135
+ $this->field_map[] = array(
136
+ 'from_tablename' => 'groups_table',
137
+ 'from_fieldname' => 'forum_id',
138
+ 'join_tablename' => 'forums_table',
139
+ 'join_type' => 'INNER',
140
+ 'join_expression' => 'USING groups_table.forum_id = forums_table.forum_id',
141
+ // 'from_expression' => 'WHERE forums_table.forum_id != 1',
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)
158
  $this->field_map[] = array(
159
+ 'from_tablename' => 'topics_table',
160
+ 'from_fieldname' => 'the_topic_reply_count',
161
+ 'to_type' => 'topic',
162
+ 'to_fieldname' => '_bbp_reply_count',
163
+ 'callback_method' => 'callback_topic_reply_count'
164
+ );
165
+
166
+ // Topic total reply count (Stored in postmeta)
167
+ $this->field_map[] = array(
168
+ 'from_tablename' => 'topics_table',
169
+ 'from_fieldname' => 'the_total_topic_reply_count',
170
+ 'to_type' => 'topic',
171
+ 'to_fieldname' => '_bbp_total_reply_count',
172
+ 'callback_method' => 'callback_topic_reply_count'
173
+ );
174
+
175
+ // Topic parent forum id (If no parent, then 0. Stored in postmeta)
176
+ $this->field_map[] = array(
177
+ 'from_tablename' => 'topics_table',
178
+ 'from_fieldname' => 'the_topic_parent_forum_id',
179
+ 'to_type' => 'topic',
180
+ 'to_fieldname' => '_bbp_forum_id',
181
  'callback_method' => 'callback_forumid'
182
  );
183
+
184
  // Topic author.
185
  $this->field_map[] = array(
186
+ 'from_tablename' => 'topics_table',
187
+ 'from_fieldname' => 'the_topic_author_id',
188
+ 'to_type' => 'topic',
189
+ 'to_fieldname' => 'post_author',
190
  'callback_method' => 'callback_userid'
191
  );
192
+
193
+ // Topic author ip (Stored in postmeta)
194
+ $this->field_map[] = array(
195
+ 'from_tablename' => 'topics_table',
196
+ 'from_fieldname' => 'the_topic_author_ip_address',
197
+ 'to_type' => 'topic',
198
+ 'to_fieldname' => '_bbp_author_ip'
199
+ );
200
+
201
+ // Topic content.
202
+ $this->field_map[] = array(
203
+ 'from_tablename' => 'topics_table',
204
+ 'from_fieldname' => 'the_topic_content',
205
+ 'to_type' => 'topic',
206
+ 'to_fieldname' => 'post_content',
207
+ 'callback_method' => 'callback_html'
208
+ );
209
+
210
  // Topic title.
211
  $this->field_map[] = array(
212
+ 'from_tablename' => 'topics_table',
213
+ 'from_fieldname' => 'the_topic_title',
214
+ 'to_type' => 'topic',
215
+ 'to_fieldname' => 'post_title'
216
  );
217
+
218
+ // Topic slug (Clean name to avoid conflicts)
219
  $this->field_map[] = array(
220
+ 'from_tablename' => 'topics_table',
221
+ 'from_fieldname' => 'the_topic_slug',
222
+ 'to_type' => 'topic',
223
+ 'to_fieldname' => 'post_name',
224
  'callback_method' => 'callback_slug'
225
  );
226
+
227
+ // Topic parent forum id (If no parent, then 0)
228
  $this->field_map[] = array(
229
+ 'from_tablename' => 'topics_table',
230
+ 'from_fieldname' => 'the_topic_parent_forum_id',
231
+ 'to_type' => 'topic',
232
+ 'to_fieldname' => 'post_parent',
233
  'callback_method' => 'callback_forumid'
234
  );
235
 
236
+ // Topic dates.
237
+ $this->field_map[] = array(
238
+ 'from_tablename' => 'topics_table',
239
+ 'from_fieldname' => 'the_topic_creation_date',
240
+ 'to_type' => 'topic',
241
+ 'to_fieldname' => 'post_date',
242
+ 'callback_method' => 'callback_datetime'
243
+ );
244
  $this->field_map[] = array(
245
+ 'from_tablename' => 'topics_table',
246
+ 'from_fieldname' => 'the_topic_creation_date',
247
+ 'to_type' => 'topic',
248
+ 'to_fieldname' => 'post_date_gmt',
249
  'callback_method' => 'callback_datetime'
250
  );
251
  $this->field_map[] = array(
252
+ 'from_tablename' => 'topics_table',
253
+ 'from_fieldname' => 'the_topic_modified_date',
254
+ 'to_type' => 'topic',
255
+ 'to_fieldname' => 'post_modified',
256
  'callback_method' => 'callback_datetime'
257
  );
258
  $this->field_map[] = array(
259
+ 'from_tablename' => 'topics_table',
260
+ 'from_fieldname' => 'the_topic_modified_date',
261
+ 'to_type' => 'topic',
262
+ 'to_fieldname' => 'post_modified_gmt',
263
  'callback_method' => 'callback_datetime'
264
  );
265
  $this->field_map[] = array(
266
+ 'from_tablename' => 'topics_table',
267
+ 'from_fieldname' => 'the_topic_modified_date',
268
+ 'to_type' => 'topic',
269
+ 'to_fieldname' => '_bbp_last_active_time',
270
  'callback_method' => 'callback_datetime'
271
  );
272
 
273
+ // Setup any table joins needed for the topic section
274
+ $this->field_map[] = array(
275
+ 'from_tablename' => 'replies_table',
276
+ 'from_fieldname' => 'the_topic_id',
277
+ 'join_tablename' => 'topics_table',
278
+ 'join_type' => 'INNER',
279
+ 'join_expression' => 'USING replies_table.the_topic_id = topics_table.the_topic_id',
280
+ 'from_expression' => 'WHERE forums_table.the_topic_id = 0',
281
+ 'to_type' => 'topic'
282
+ );
283
+
284
  /** Tags Section ******************************************************/
285
+
286
+ // Setup table joins for the tag section at the base of this section
287
+ // Setup any table joins needed for the tags section
288
+ $this->field_map[] = array(
289
+ 'from_tablename' => 'tag_table',
290
+ 'from_fieldname' => 'the_topic_id',
291
+ 'join_tablename' => 'tagcontent_table',
292
+ 'join_type' => 'INNER',
293
+ 'join_expression' => 'USING tagcontent_table.tag_id = tags_table.tag_id',
294
+ 'from_expression' => 'WHERE tagcontent_table.tag_id = tag_table.tag_id',
295
+ 'to_type' => 'tags'
296
+ );
297
+
298
  // Topic id.
299
  $this->field_map[] = array(
300
+ 'from_tablename' => 'tagcontent_table',
301
+ 'from_fieldname' => 'contentid',
302
+ 'to_type' => 'tags',
303
+ 'to_fieldname' => 'objectid',
304
  'callback_method' => 'callback_topicid'
305
  );
306
+
307
+ // Taxonomy ID.
308
  $this->field_map[] = array(
309
+ 'from_tablename' => 'tagcontent_table',
310
+ 'from_fieldname' => 'tagid',
311
+ 'to_type' => 'tags',
312
+ 'to_fieldname' => 'taxonomy'
313
+ );
314
+
315
+ // Term text.
316
+ $this->field_map[] = array(
317
+ 'from_tablename' => 'tag_table',
318
+ 'from_fieldname' => 'tagtext',
319
+ 'to_type' => 'tags',
320
+ 'to_fieldname' => 'name'
321
+ );
322
+
323
+ /** Reply Section *****************************************************/
324
 
325
+ // Setup table joins for the reply section at the base of this section
326
 
327
+ // Reply id (Stored in postmeta)
328
  $this->field_map[] = array(
329
+ 'from_tablename' => 'replies_table',
330
+ 'from_fieldname' => 'the_reply_id',
331
+ 'to_type' => 'reply',
332
+ 'to_fieldname' => '_bbp_post_id'
333
  );
334
+
335
+ // Reply parent forum id (If no parent, then 0. Stored in postmeta)
336
  $this->field_map[] = array(
337
+ 'from_tablename' => 'replies_table',
338
+ 'from_fieldname' => 'the_reply_parent_forum_id',
339
+ 'to_type' => 'reply',
340
+ 'to_fieldname' => '_bbp_forum_id',
341
  'callback_method' => 'callback_topicid_to_forumid'
342
  );
343
+
344
+ // Reply parent topic id (If no parent, then 0. Stored in postmeta)
345
  $this->field_map[] = array(
346
+ 'from_tablename' => 'replies_table',
347
+ 'from_fieldname' => 'the_reply_parent_topic_id',
348
+ 'to_type' => 'reply',
349
+ 'to_fieldname' => '_bbp_topic_id',
350
  'callback_method' => 'callback_topicid'
351
  );
352
+
353
+ // Reply author ip (Stored in postmeta)
354
  $this->field_map[] = array(
355
+ 'from_tablename' => 'replies_table',
356
+ 'from_fieldname' => 'the_reply_author_ip_address',
357
+ 'to_type' => 'reply',
358
+ 'to_fieldname' => '_bbp_author_ip'
359
+ );
360
+
361
+ // Reply author.
362
  $this->field_map[] = array(
363
+ 'from_tablename' => 'replies_table',
364
+ 'from_fieldname' => 'the_reply_author_id',
365
+ 'to_type' => 'reply',
366
+ 'to_fieldname' => 'post_author',
367
  'callback_method' => 'callback_userid'
368
  );
369
+
370
+ // Reply title.
371
  $this->field_map[] = array(
372
+ 'from_tablename' => 'replies_table',
373
+ 'from_fieldname' => 'the_reply_title',
374
+ 'to_type' => 'reply',
375
+ 'to_fieldname' => 'post_title'
376
  );
377
+
378
+ // Reply slug (Clean name to avoid conflicts)
379
  $this->field_map[] = array(
380
+ 'from_tablename' => 'replies_table',
381
+ 'from_fieldname' => 'the_reply_slug',
382
+ 'to_type' => 'reply',
383
+ 'to_fieldname' => 'post_name',
384
  'callback_method' => 'callback_slug'
385
  );
386
+
387
+ // Reply content.
388
  $this->field_map[] = array(
389
+ 'from_tablename' => 'replies_table',
390
+ 'from_fieldname' => 'the_reply_content',
391
+ 'to_type' => 'reply',
392
+ 'to_fieldname' => 'post_content',
393
  'callback_method' => 'callback_html'
394
  );
395
+
396
+ // Reply order.
397
+ $this->field_map[] = array(
398
+ 'from_tablename' => 'replies_table',
399
+ 'from_fieldname' => 'the_reply_order',
400
+ 'to_type' => 'reply',
401
+ 'to_fieldname' => 'menu_order'
402
+ );
403
+
404
+ // Reply parent topic id (If no parent, then 0)
405
  $this->field_map[] = array(
406
+ 'from_tablename' => 'replies_table',
407
+ 'from_fieldname' => 'the_reply_parent_topic_id',
408
+ 'to_type' => 'reply',
409
+ 'to_fieldname' => 'post_parent',
410
  'callback_method' => 'callback_topicid'
411
  );
412
 
413
+ // Reply dates.
414
  $this->field_map[] = array(
415
+ 'from_tablename' => 'replies_table',
416
+ 'from_fieldname' => 'the_reply_creation_date',
417
+ 'to_type' => 'reply',
418
+ 'to_fieldname' => 'post_date',
419
  'callback_method' => 'callback_datetime'
420
  );
421
  $this->field_map[] = array(
422
+ 'from_tablename' => 'replies_table',
423
+ 'from_fieldname' => 'the_reply_creation_date',
424
+ 'to_type' => 'reply',
425
+ 'to_fieldname' => 'post_date_gmt',
426
  'callback_method' => 'callback_datetime'
427
  );
428
  $this->field_map[] = array(
429
+ 'from_tablename' => 'replies_table',
430
+ 'from_fieldname' => 'the_reply_modified_date',
431
+ 'to_type' => 'reply',
432
+ 'to_fieldname' => 'post_modified',
433
  'callback_method' => 'callback_datetime'
434
  );
435
  $this->field_map[] = array(
436
+ 'from_tablename' => 'replies_table',
437
+ 'from_fieldname' => 'the_reply_modified_date',
438
+ 'to_type' => 'reply',
439
+ 'to_fieldname' => 'post_modified_gmt',
440
  'callback_method' => 'callback_datetime'
441
  );
442
 
443
+ // Setup any table joins needed for the reply section
444
+ $this->field_map[] = array(
445
+ 'from_tablename' => 'topics_table',
446
+ 'from_fieldname' => 'the_topic_id',
447
+ 'join_tablename' => 'replies_table',
448
+ 'join_type' => 'INNER',
449
+ 'join_expression' => 'USING topics_table.the_topic_id = replies_table.the_topic_id',
450
+ 'from_expression' => 'WHERE topics_table.first_post != 0',
451
+ 'to_type' => 'reply'
452
+ );
453
+
454
  /** User Section ******************************************************/
455
 
456
+ // Setup table joins for the user section at the base of this section
457
+
458
+ // Store old User id (Stored in usermeta)
459
  $this->field_map[] = array(
460
+ 'from_tablename' => 'users_table',
461
+ 'from_fieldname' => 'the_users_id',
462
+ 'to_type' => 'user',
463
+ 'to_fieldname' => '_bbp_user_id'
464
  );
465
+
466
+ // Store old User password (Stored in usermeta serialized with salt)
467
  $this->field_map[] = array(
468
+ 'from_tablename' => 'users_table',
469
+ 'from_fieldname' => 'the_users_password',
470
+ 'to_type' => 'user',
471
+ 'to_fieldname' => '_bbp_password',
472
  'callback_method' => 'callback_savepass'
473
  );
474
 
475
+ // Store old User Salt (This is only used for the SELECT row info for the above password save)
476
  $this->field_map[] = array(
477
+ 'from_tablename' => 'users_table',
478
+ 'from_fieldname' => 'the_users_password_salt',
479
+ 'to_type' => 'user',
480
+ 'to_fieldname' => ''
481
  );
482
+
483
+ // User password verify class (Stored in usermeta for verifying password)
484
  $this->field_map[] = array(
485
+ 'to_type' => 'user',
486
+ 'to_fieldname' => '_bbp_class',
487
+ 'default' => 'Example'
488
  );
489
+
490
  // User name.
491
  $this->field_map[] = array(
492
+ 'from_tablename' => 'users_table',
493
+ 'from_fieldname' => 'the_users_username',
494
+ 'to_type' => 'user',
495
+ 'to_fieldname' => 'user_login'
496
+ );
497
+
498
+ // User nice name.
499
+ $this->field_map[] = array(
500
+ 'from_tablename' => 'users_table',
501
+ 'from_fieldname' => 'the_users_nicename',
502
+ 'to_type' => 'user',
503
+ 'to_fieldname' => 'user_nicename'
504
  );
505
+
506
  // User email.
507
  $this->field_map[] = array(
508
+ 'from_tablename' => 'users_table',
509
+ 'from_fieldname' => 'the_users_email_address',
510
+ 'to_type' => 'user',
511
+ 'to_fieldname' => 'user_email'
512
  );
513
+
514
  // User homepage.
515
  $this->field_map[] = array(
516
+ 'from_tablename' => 'users_table',
517
+ 'from_fieldname' => 'the_users_homepage_url',
518
+ 'to_type' => 'user',
519
+ 'to_fieldname' => 'user_url'
520
  );
521
+
522
  // User registered.
523
  $this->field_map[] = array(
524
+ 'from_tablename' => 'users_table',
525
+ 'from_fieldname' => 'the_users_registration_date',
526
+ 'to_type' => 'user',
527
+ 'to_fieldname' => 'user_registered',
528
  'callback_method' => 'callback_datetime'
529
  );
530
+
531
+ // User status.
532
  $this->field_map[] = array(
533
+ 'from_tablename' => 'users_table',
534
+ 'from_fieldname' => 'the_users_status',
535
+ 'to_type' => 'user',
536
+ 'to_fieldname' => 'user_status'
537
  );
538
+
539
+ // User display name.
540
+ $this->field_map[] = array(
541
+ 'from_tablename' => 'users_table',
542
+ 'from_fieldname' => 'the_users_display_name',
543
+ 'to_type' => 'user',
544
+ 'to_fieldname' => 'display_name'
545
+ );
546
+
547
+ // User AIM (Stored in usermeta)
548
+ $this->field_map[] = array(
549
+ 'from_tablename' => 'users_table',
550
+ 'from_fieldname' => 'the_users_aim',
551
+ 'to_type' => 'user',
552
+ 'to_fieldname' => 'aim'
553
+ );
554
+
555
+ // User Yahoo (Stored in usermeta)
556
+ $this->field_map[] = array(
557
+ 'from_tablename' => 'users_table',
558
+ 'from_fieldname' => 'the_users_yahoo',
559
+ 'to_type' => 'user',
560
+ 'to_fieldname' => 'yim'
561
+ );
562
+
563
+ // User Jabber (Stored in usermeta)
564
+ $this->field_map[] = array(
565
+ 'from_tablename' => 'users_table',
566
+ 'from_fieldname' => 'the_users_jabber',
567
+ 'to_type' => 'user',
568
+ 'to_fieldname' => 'jabber'
569
+ );
570
+
571
+ // Setup any table joins needed for the user section
572
  $this->field_map[] = array(
573
+ 'from_tablename' => 'users_profile_table',
574
+ 'from_fieldname' => 'the_users_id',
575
+ 'join_tablename' => 'users_table',
576
+ 'join_type' => 'INNER',
577
+ 'join_expression' => 'USING users_profile_table.the_user_id = users_table.the_user_id',
578
+ 'from_expression' => 'WHERE users_table.the_user_id != -1',
579
+ 'to_type' => 'user'
580
+ );
581
  }
582
+
583
  /**
584
  * This method allows us to indicates what is or is not converted for each
585
  * converter.
586
  */
587
+ public function info() {
 
588
  return '';
589
  }
590
 
593
  * way when we authenticate it we can get it out of the database
594
  * as one value. Array values are auto sanitized by WordPress.
595
  */
596
+ public function callback_savepass( $field, $row ) {
 
597
  $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
598
  return $pass_array;
599
  }
602
  * This method is to take the pass out of the database and compare
603
  * to a pass the user has typed in.
604
  */
605
+ public function authenticate_pass( $password, $serialized_pass ) {
 
606
  $pass_array = unserialize( $serialized_pass );
607
  return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
608
  }
includes/admin/forums.php CHANGED
@@ -194,11 +194,7 @@ class BBP_Forums_Admin {
194
 
195
  $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your forum in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a forum or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a forum to be published in the future or backdate a forum.', 'bbpress' ) . '</p>';
196
 
197
- if ( current_theme_supports( 'forum-formats' ) && forum_type_supports( 'forum', 'forum-formats' ) ) {
198
- $publish_box .= '<p>' . __( '<strong>forum Format</strong> - This designates how your theme will display a specific forum. For example, you could have a <em>standard</em> blog forum with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each forum format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
199
- }
200
-
201
- if ( current_theme_supports( 'forum-thumbnails' ) && forum_type_supports( 'forum', 'thumbnail' ) ) {
202
  $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your forum without inserting it. This is usually useful only if your theme makes use of the featured image as a forum thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
203
  }
204
 
@@ -222,14 +218,6 @@ class BBP_Forums_Admin {
222
  'content' => $publish_box,
223
  ) );
224
 
225
- get_current_screen()->add_help_tab( array(
226
- 'id' => 'discussion-settings',
227
- 'title' => __( 'Discussion Settings', 'bbpress' ),
228
- 'content' =>
229
- '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
230
- '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the forum, you can see them here and moderate them.', 'bbpress' ) . '</p>'
231
- ) );
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>' .
@@ -460,7 +448,7 @@ class BBP_Forums_Admin {
460
  break;
461
 
462
  case 'bbp_forum_created':
463
- printf( __( '%1$s <br /> %2$s', 'bbpress' ),
464
  get_the_date(),
465
  esc_attr( get_the_time() )
466
  );
@@ -470,9 +458,9 @@ class BBP_Forums_Admin {
470
  case 'bbp_forum_freshness' :
471
  $last_active = bbp_get_forum_last_active_time( $forum_id, false );
472
  if ( !empty( $last_active ) )
473
- echo $last_active;
474
  else
475
- _e( 'No Topics', 'bbpress' );
476
 
477
  break;
478
 
@@ -492,7 +480,7 @@ class BBP_Forums_Admin {
492
  *
493
  * @param array $actions Actions
494
  * @param array $forum Forum object
495
- * @uses the_content() To output forum description
496
  * @return array $actions Actions
497
  */
498
  public function row_actions( $actions, $forum ) {
194
 
195
  $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your forum in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a forum or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a forum to be published in the future or backdate a forum.', 'bbpress' ) . '</p>';
196
 
197
+ if ( current_theme_supports( 'forum-thumbnails' ) && post_type_supports( 'forum', 'thumbnail' ) ) {
 
 
 
 
198
  $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your forum without inserting it. This is usually useful only if your theme makes use of the featured image as a forum thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
199
  }
200
 
218
  'content' => $publish_box,
219
  ) );
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>' .
448
  break;
449
 
450
  case 'bbp_forum_created':
451
+ printf( '%1$s <br /> %2$s',
452
  get_the_date(),
453
  esc_attr( get_the_time() )
454
  );
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
 
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 ) {
includes/admin/functions.php CHANGED
@@ -93,7 +93,7 @@ function bbp_admin_menu_order( $menu_order ) {
93
  if ( $second_sep == $item ) {
94
 
95
  // Add our custom menus
96
- foreach( $custom_menus as $custom_menu ) {
97
  if ( array_search( $custom_menu, $menu_order ) ) {
98
  $bbp_menu_order[] = $custom_menu;
99
  }
@@ -246,10 +246,10 @@ function bbp_tools_admin_tabs( $active_tab = '' ) {
246
  ) );
247
 
248
  // Loop through tabs and build navigation
249
- foreach( $tabs as $tab_id => $tab_data ) {
250
  $is_current = (bool) ( $tab_data['name'] == $active_tab );
251
  $tab_class = $is_current ? $active_class : $idle_class;
252
- $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
253
  }
254
 
255
  // Output the tabs
93
  if ( $second_sep == $item ) {
94
 
95
  // Add our custom menus
96
+ foreach ( $custom_menus as $custom_menu ) {
97
  if ( array_search( $custom_menu, $menu_order ) ) {
98
  $bbp_menu_order[] = $custom_menu;
99
  }
246
  ) );
247
 
248
  // Loop through tabs and build navigation
249
+ foreach ( array_values( $tabs ) as $tab_data ) {
250
  $is_current = (bool) ( $tab_data['name'] == $active_tab );
251
  $tab_class = $is_current ? $active_class : $idle_class;
252
+ $tabs_html .= '<a href="' . esc_url( $tab_data['href'] ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab_data['name'] ) . '</a>';
253
  }
254
 
255
  // Output the tabs
includes/admin/images/badge-2x.png CHANGED
Binary file
includes/admin/images/badge.png CHANGED
Binary file
includes/admin/metaboxes.php CHANGED
@@ -39,7 +39,7 @@ function bbp_dashboard_widget_right_now() {
39
 
40
  <div class="table table_content">
41
 
42
- <p class="sub"><?php _e( 'Discussion', 'bbpress' ); ?></p>
43
 
44
  <table>
45
 
@@ -124,7 +124,7 @@ function bbp_dashboard_widget_right_now() {
124
 
125
  <div class="table table_discussion">
126
 
127
- <p class="sub"><?php _e( 'Users &amp; Moderation', 'bbpress' ); ?></p>
128
 
129
  <table>
130
 
@@ -153,7 +153,7 @@ function bbp_dashboard_widget_right_now() {
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="' . $link . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';
@@ -175,7 +175,7 @@ function bbp_dashboard_widget_right_now() {
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="' . $link . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';
@@ -258,9 +258,9 @@ function bbp_forum_metabox() {
258
  ?>
259
 
260
  <p>
261
- <strong class="label"><?php _e( 'Type:', 'bbpress' ); ?></strong>
262
- <label class="screen-reader-text" for="bbp_forum_type_select"><?php _e( 'Type:', 'bbpress' ) ?></label>
263
- <?php bbp_form_forum_type_dropdown( $post_id ); ?>
264
  </p>
265
 
266
  <?php
@@ -270,9 +270,9 @@ function bbp_forum_metabox() {
270
  ?>
271
 
272
  <p>
273
- <strong class="label"><?php _e( 'Status:', 'bbpress' ); ?></strong>
274
- <label class="screen-reader-text" for="bbp_forum_status_select"><?php _e( 'Status:', 'bbpress' ) ?></label>
275
- <?php bbp_form_forum_status_dropdown( $post_id ); ?>
276
  </p>
277
 
278
  <?php
@@ -282,9 +282,9 @@ function bbp_forum_metabox() {
282
  ?>
283
 
284
  <p>
285
- <strong class="label"><?php _e( 'Visibility:', 'bbpress' ); ?></strong>
286
- <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php _e( 'Visibility:', 'bbpress' ) ?></label>
287
- <?php bbp_form_forum_visibility_dropdown( $post_id ); ?>
288
  </p>
289
 
290
  <hr />
@@ -296,8 +296,8 @@ function bbp_forum_metabox() {
296
  ?>
297
 
298
  <p>
299
- <strong class="label"><?php _e( 'Parent:', 'bbpress' ); ?></strong>
300
- <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum Parent', 'bbpress' ); ?></label>
301
  <?php bbp_dropdown( array(
302
  'post_type' => bbp_get_forum_post_type(),
303
  'selected' => $post_parent,
@@ -319,8 +319,8 @@ function bbp_forum_metabox() {
319
  </p>
320
 
321
  <p>
322
- <strong class="label"><?php _e( 'Order:', 'bbpress' ); ?></strong>
323
- <label class="screen-reader-text" for="menu_order"><?php _e( 'Forum Order', 'bbpress' ); ?></label>
324
  <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" />
325
  </p>
326
 
@@ -344,17 +344,39 @@ function bbp_forum_metabox() {
344
  function bbp_topic_metabox() {
345
 
346
  // Post ID
347
- $post_id = get_the_ID(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
  <p>
350
- <strong class="label"><?php _e( 'Type:', 'bbpress' ); ?></strong>
351
- <label class="screen-reader-text" for="bbp_stick_topic"><?php _e( 'Topic Type', 'bbpress' ); ?></label>
352
- <?php bbp_topic_type_select( array( 'topic_id' => $post_id ) ); ?>
353
  </p>
354
 
 
 
 
 
 
 
355
  <p>
356
- <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong>
357
- <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
358
  <?php bbp_dropdown( array(
359
  'post_type' => bbp_get_forum_post_type(),
360
  'selected' => bbp_get_topic_forum_id( $post_id ),
@@ -400,13 +422,14 @@ function bbp_reply_metabox() {
400
  // Get some meta
401
  $reply_topic_id = bbp_get_reply_topic_id( $post_id );
402
  $reply_forum_id = bbp_get_reply_forum_id( $post_id );
 
403
 
404
  // Allow individual manipulation of reply forum
405
  if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?>
406
 
407
  <p>
408
- <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong>
409
- <label class="screen-reader-text" for="bbp_forum_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
410
  <?php bbp_dropdown( array(
411
  'post_type' => bbp_get_forum_post_type(),
412
  'selected' => $reply_forum_id,
@@ -430,11 +453,17 @@ function bbp_reply_metabox() {
430
  <?php endif; ?>
431
 
432
  <p>
433
- <strong class="label"><?php _e( 'Topic:', 'bbpress' ); ?></strong>
434
- <label class="screen-reader-text" for="parent_id"><?php _e( 'Topic', 'bbpress' ); ?></label>
435
  <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" />
436
  </p>
437
 
 
 
 
 
 
 
438
  <?php
439
  wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
440
  do_action( 'bbp_reply_metabox', $post_id );
@@ -461,28 +490,36 @@ function bbp_author_metabox() {
461
  if ( bbp_is_reply_anonymous( $post_id ) || bbp_is_topic_anonymous( $post_id ) ) : ?>
462
 
463
  <p>
464
- <strong class="label"><?php _e( 'Name:', 'bbpress' ); ?></strong>
465
- <label class="screen-reader-text" for="bbp_anonymous_name"><?php _e( 'Name', 'bbpress' ); ?></label>
466
  <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 ) ); ?>" />
467
  </p>
468
 
469
  <p>
470
- <strong class="label"><?php _e( 'Email:', 'bbpress' ); ?></strong>
471
- <label class="screen-reader-text" for="bbp_anonymous_email"><?php _e( 'Email', 'bbpress' ); ?></label>
472
  <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 ) ); ?>" />
473
  </p>
474
 
475
  <p>
476
- <strong class="label"><?php _e( 'Website:', 'bbpress' ); ?></strong>
477
- <label class="screen-reader-text" for="bbp_anonymous_website"><?php _e( 'Website', 'bbpress' ); ?></label>
478
  <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 ) ); ?>" />
479
  </p>
480
 
 
 
 
 
 
 
 
 
481
  <?php endif; ?>
482
 
483
  <p>
484
- <strong class="label"><?php _e( 'IP:', 'bbpress' ); ?></strong>
485
- <label class="screen-reader-text" for="bbp_author_ip_address"><?php _e( 'IP Address', 'bbpress' ); ?></label>
486
  <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" />
487
  </p>
488
 
39
 
40
  <div class="table table_content">
41
 
42
+ <p class="sub"><?php esc_html_e( 'Discussion', 'bbpress' ); ?></p>
43
 
44
  <table>
45
 
124
 
125
  <div class="table table_discussion">
126
 
127
+ <p class="sub"><?php esc_html_e( 'Users &amp; Moderation', 'bbpress' ); ?></p>
128
 
129
  <table>
130
 
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="' . $link . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';
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="' . $link . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';
258
  ?>
259
 
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
270
  ?>
271
 
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
282
  ?>
283
 
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 />
296
  ?>
297
 
298
  <p>
299
+ <strong class="label"><?php esc_html_e( 'Parent:', 'bbpress' ); ?></strong>
300
+ <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum Parent', 'bbpress' ); ?></label>
301
  <?php bbp_dropdown( array(
302
  'post_type' => bbp_get_forum_post_type(),
303
  'selected' => $post_parent,
319
  </p>
320
 
321
  <p>
322
+ <strong class="label"><?php esc_html_e( 'Order:', 'bbpress' ); ?></strong>
323
+ <label class="screen-reader-text" for="menu_order"><?php esc_html_e( 'Forum Order', 'bbpress' ); ?></label>
324
  <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" />
325
  </p>
326
 
344
  function bbp_topic_metabox() {
345
 
346
  // Post ID
347
+ $post_id = get_the_ID();
348
+
349
+ /** Type ******************************************************************/
350
+
351
+ ?>
352
+
353
+ <p>
354
+ <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
355
+ <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Topic Type', 'bbpress' ); ?></label>
356
+ <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post_id ) ); ?>
357
+ </p>
358
+
359
+ <?php
360
+
361
+ /** Status ****************************************************************/
362
+
363
+ ?>
364
 
365
  <p>
366
+ <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
367
+ <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', 'bbpress' ); ?></label>
368
+ <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post_id ) ); ?>
369
  </p>
370
 
371
+ <?php
372
+
373
+ /** Parent *****************************************************************/
374
+
375
+ ?>
376
+
377
  <p>
378
+ <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
379
+ <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label>
380
  <?php bbp_dropdown( array(
381
  'post_type' => bbp_get_forum_post_type(),
382
  'selected' => bbp_get_topic_forum_id( $post_id ),
422
  // Get some meta
423
  $reply_topic_id = bbp_get_reply_topic_id( $post_id );
424
  $reply_forum_id = bbp_get_reply_forum_id( $post_id );
425
+ $reply_to = bbp_get_reply_to( $post_id );
426
 
427
  // Allow individual manipulation of reply forum
428
  if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?>
429
 
430
  <p>
431
+ <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong>
432
+ <label class="screen-reader-text" for="bbp_forum_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label>
433
  <?php bbp_dropdown( array(
434
  'post_type' => bbp_get_forum_post_type(),
435
  'selected' => $reply_forum_id,
453
  <?php endif; ?>
454
 
455
  <p>
456
+ <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong>
457
+ <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label>
458
  <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" />
459
  </p>
460
 
461
+ <p>
462
+ <strong class="label"><?php esc_html_e( 'Reply To:', 'bbpress' ); ?></strong>
463
+ <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', 'bbpress' ); ?></label>
464
+ <input name="bbp_reply_to" id="bbp_reply_to" type="text" value="<?php echo esc_attr( $reply_to ); ?>" />
465
+ </p>
466
+
467
  <?php
468
  wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
469
  do_action( 'bbp_reply_metabox', $post_id );
490
  if ( bbp_is_reply_anonymous( $post_id ) || bbp_is_topic_anonymous( $post_id ) ) : ?>
491
 
492
  <p>
493
+ <strong class="label"><?php esc_html_e( 'Name:', 'bbpress' ); ?></strong>
494
+ <label class="screen-reader-text" for="bbp_anonymous_name"><?php esc_html_e( 'Name', 'bbpress' ); ?></label>
495
  <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 ) ); ?>" />
496
  </p>
497
 
498
  <p>
499
+ <strong class="label"><?php esc_html_e( 'Email:', 'bbpress' ); ?></strong>
500
+ <label class="screen-reader-text" for="bbp_anonymous_email"><?php esc_html_e( 'Email', 'bbpress' ); ?></label>
501
  <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 ) ); ?>" />
502
  </p>
503
 
504
  <p>
505
+ <strong class="label"><?php esc_html_e( 'Website:', 'bbpress' ); ?></strong>
506
+ <label class="screen-reader-text" for="bbp_anonymous_website"><?php esc_html_e( 'Website', 'bbpress' ); ?></label>
507
  <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 ) ); ?>" />
508
  </p>
509
 
510
+ <?php else : ?>
511
+
512
+ <p>
513
+ <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong>
514
+ <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label>
515
+ <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" />
516
+ </p>
517
+
518
  <?php endif; ?>
519
 
520
  <p>
521
+ <strong class="label"><?php esc_html_e( 'IP:', 'bbpress' ); ?></strong>
522
+ <label class="screen-reader-text" for="bbp_author_ip_address"><?php esc_html_e( 'IP Address', 'bbpress' ); ?></label>
523
  <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" />
524
  </p>
525
 
includes/admin/replies.php CHANGED
@@ -64,15 +64,15 @@ class BBP_Replies_Admin {
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, 'replies_column_headers' ) );
68
 
69
  // Reply columns (in post row)
70
- add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'replies_column_data' ), 10, 2 );
71
- add_filter( 'post_row_actions', array( $this, 'replies_row_actions' ), 10, 2 );
72
 
73
  // Reply metabox actions
74
- add_action( 'add_meta_boxes', array( $this, 'reply_attributes_metabox' ) );
75
- add_action( 'save_post', array( $this, 'reply_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' ) );
@@ -98,7 +98,7 @@ class BBP_Replies_Admin {
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;
@@ -208,11 +208,7 @@ class BBP_Replies_Admin {
208
 
209
  $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your reply in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a reply or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a reply to be published in the future or backdate a reply.', 'bbpress' ) . '</p>';
210
 
211
- if ( current_theme_supports( 'reply-formats' ) && reply_type_supports( 'reply', 'reply-formats' ) ) {
212
- $publish_box .= '<p>' . __( '<strong>reply Format</strong> - This designates how your theme will display a specific reply. For example, you could have a <em>standard</em> blog reply with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each reply format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
213
- }
214
-
215
- if ( current_theme_supports( 'reply-thumbnails' ) && reply_type_supports( 'reply', 'thumbnail' ) ) {
216
  $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your reply without inserting it. This is usually useful only if your theme makes use of the featured image as a reply thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
217
  }
218
 
@@ -224,6 +220,7 @@ class BBP_Replies_Admin {
224
  '<ul>' .
225
  '<li>' . __( '<strong>Forum</strong> dropdown determines the parent forum that the reply belongs to. Select the forum, or leave the default (Use Forum of Topic) to post the reply in forum of the topic.', 'bbpress' ) . '</li>' .
226
  '<li>' . __( '<strong>Topic</strong> determines the parent topic that the reply belongs to.', 'bbpress' ) . '</li>' .
 
227
  '</ul>'
228
  ) );
229
 
@@ -233,14 +230,6 @@ class BBP_Replies_Admin {
233
  'content' => $publish_box,
234
  ) );
235
 
236
- get_current_screen()->add_help_tab( array(
237
- 'id' => 'discussion-settings',
238
- 'title' => __( 'Discussion Settings', 'bbpress' ),
239
- 'content' =>
240
- '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
241
- '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the reply, you can see them here and moderate them.', 'bbpress' ) . '</p>'
242
- ) );
243
-
244
  get_current_screen()->set_help_sidebar(
245
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
246
  '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
@@ -257,7 +246,7 @@ class BBP_Replies_Admin {
257
  * @uses add_meta_box() To add the metabox
258
  * @uses do_action() Calls 'bbp_reply_attributes_metabox'
259
  */
260
- public function reply_attributes_metabox() {
261
 
262
  if ( $this->bail() ) return;
263
 
@@ -285,7 +274,7 @@ class BBP_Replies_Admin {
285
  * reply id and parent id
286
  * @return int Parent id
287
  */
288
- public function reply_attributes_metabox_save( $reply_id ) {
289
 
290
  if ( $this->bail() ) return $reply_id;
291
 
@@ -312,6 +301,7 @@ class BBP_Replies_Admin {
312
  // Get the reply meta post values
313
  $topic_id = !empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0;
314
  $forum_id = !empty( $_POST['bbp_forum_id'] ) ? (int) $_POST['bbp_forum_id'] : bbp_get_topic_forum_id( $topic_id );
 
315
 
316
  // Get reply author data
317
  $anonymous_data = bbp_filter_anonymous_post_data();
@@ -319,11 +309,11 @@ class BBP_Replies_Admin {
319
  $is_edit = (bool) isset( $_POST['save'] );
320
 
321
  // Formally update the reply
322
- bbp_update_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit );
323
 
324
  // Allow other fun things to happen
325
- do_action( 'bbp_reply_attributes_metabox_save', $reply_id, $topic_id, $forum_id );
326
- do_action( 'bbp_author_metabox_save', $reply_id, $anonymous_data );
327
 
328
  return $reply_id;
329
  }
@@ -348,7 +338,7 @@ class BBP_Replies_Admin {
348
  if ( $this->bail() ) return;
349
 
350
  // Bail if post_type is not a reply
351
- if ( empty( $_GET['action'] ) || ( 'edit' != $_GET['action'] ) )
352
  return;
353
 
354
  // Add the metabox
@@ -487,7 +477,7 @@ class BBP_Replies_Admin {
487
  $success = wp_update_post( $post_data );
488
  $message = array( 'bbp_reply_toggle_notice' => $message, 'reply_id' => $reply->ID );
489
 
490
- if ( false == $success || is_wp_error( $success ) )
491
  $message['failed'] = '1';
492
 
493
  // Do additional reply toggle actions (admin side)
@@ -535,15 +525,15 @@ class BBP_Replies_Admin {
535
  if ( empty( $reply ) )
536
  return;
537
 
538
- $reply_title = esc_html( bbp_get_reply_title( $reply->ID ) );
539
 
540
  switch ( $notice ) {
541
  case 'spammed' :
542
- $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 );
543
  break;
544
 
545
  case 'unspammed' :
546
- $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 );
547
  break;
548
  }
549
 
@@ -552,8 +542,8 @@ class BBP_Replies_Admin {
552
 
553
  ?>
554
 
555
- <div id="message" class="<?php echo $is_failure == true ? 'error' : 'updated'; ?> fade">
556
- <p style="line-height: 150%"><?php echo $message; ?></p>
557
  </div>
558
 
559
  <?php
@@ -570,7 +560,7 @@ class BBP_Replies_Admin {
570
  * the columns
571
  * @return array $columns bbPress reply columns
572
  */
573
- public function replies_column_headers( $columns ) {
574
 
575
  if ( $this->bail() ) return $columns;
576
 
@@ -614,7 +604,7 @@ class BBP_Replies_Admin {
614
  * @uses do_action() Calls 'bbp_admin_replies_column_data' with the
615
  * column and reply id
616
  */
617
- public function replies_column_data( $column, $reply_id ) {
618
 
619
  if ( $this->bail() ) return;
620
 
@@ -633,7 +623,7 @@ class BBP_Replies_Admin {
633
  // Topic Title
634
  $topic_title = bbp_get_topic_title( $topic_id );
635
  if ( empty( $topic_title ) ) {
636
- $topic_title = __( 'No Topic', 'bbpress' );
637
  }
638
 
639
  // Output the title
@@ -641,7 +631,7 @@ class BBP_Replies_Admin {
641
 
642
  // Reply has no topic
643
  } else {
644
- _e( 'No Topic', 'bbpress' );
645
  }
646
 
647
  break;
@@ -659,13 +649,13 @@ class BBP_Replies_Admin {
659
  // Forum Title
660
  $forum_title = bbp_get_forum_title( $reply_forum_id );
661
  if ( empty( $forum_title ) ) {
662
- $forum_title = __( 'No Forum', 'bbpress' );
663
  }
664
 
665
  // Alert capable users of reply forum mismatch
666
- if ( $reply_forum_id != $topic_forum_id ) {
667
  if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) {
668
- $forum_title .= '<div class="attention">' . __( '(Mismatch)', 'bbpress' ) . '</div>';
669
  }
670
  }
671
 
@@ -688,7 +678,7 @@ class BBP_Replies_Admin {
688
  case 'bbp_reply_created':
689
 
690
  // Output last activity time and date
691
- printf( __( '%1$s <br /> %2$s', 'bbpress' ),
692
  get_the_date(),
693
  esc_attr( get_the_time() )
694
  );
@@ -726,43 +716,43 @@ class BBP_Replies_Admin {
726
  * @uses get_delete_post_link() To get the delete post link of the reply
727
  * @return array $actions Actions
728
  */
729
- public function replies_row_actions( $actions, $reply ) {
730
 
731
  if ( $this->bail() ) return $actions;
732
 
733
  unset( $actions['inline hide-if-no-js'] );
734
 
735
  // Reply view links to topic
736
- $actions['view'] = '<a href="' . bbp_get_reply_url( $reply->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . __( 'View', 'bbpress' ) . '</a>';
737
 
738
  // User cannot view replies in trash
739
- if ( ( bbp_get_trash_status_id() == $reply->post_status ) && !current_user_can( 'view_trash' ) )
740
  unset( $actions['view'] );
741
 
742
  // Only show the actions if the user is capable of viewing them
743
  if ( current_user_can( 'moderate', $reply->ID ) ) {
744
  if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_spam_status_id() ) ) ) {
745
- $spam_uri = esc_url( 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 ) );
746
  if ( bbp_is_reply_spam( $reply->ID ) ) {
747
- $actions['spam'] = '<a href="' . $spam_uri . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . __( 'Not spam', 'bbpress' ) . '</a>';
748
  } else {
749
- $actions['spam'] = '<a href="' . $spam_uri . '" title="' . esc_attr__( 'Mark this reply as spam', 'bbpress' ) . '">' . __( 'Spam', 'bbpress' ) . '</a>';
750
  }
751
  }
752
  }
753
 
754
  // Trash
755
  if ( current_user_can( 'delete_reply', $reply->ID ) ) {
756
- if ( bbp_get_trash_status_id() == $reply->post_status ) {
757
- $post_type_object = get_post_type_object( bbp_get_reply_post_type() );
758
- $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . 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 ) ) . "'>" . __( 'Restore', 'bbpress' ) . "</a>";
759
  } elseif ( EMPTY_TRASH_DAYS ) {
760
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . 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 ) ) . "'>" . __( 'Trash', 'bbpress' ) . "</a>";
761
  }
762
 
763
- if ( bbp_get_trash_status_id() == $reply->post_status || !EMPTY_TRASH_DAYS ) {
764
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . 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 ) ) . "'>" . __( 'Delete Permanently', 'bbpress' ) . "</a>";
765
- } elseif ( bbp_get_spam_status_id() == $reply->post_status ) {
766
  unset( $actions['trash'] );
767
  }
768
  }
@@ -785,7 +775,7 @@ class BBP_Replies_Admin {
785
  if ( $this->bail() ) return;
786
 
787
  // Add Empty Spam button
788
- if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() == $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
789
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
790
  $title = esc_attr__( 'Empty Spam', 'bbpress' );
791
  submit_button( $title, 'button-secondary apply', 'delete_all', false );
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
 
69
  // Reply columns (in post row)
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' ) );
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;
208
 
209
  $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your reply in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a reply or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a reply to be published in the future or backdate a reply.', 'bbpress' ) . '</p>';
210
 
211
+ if ( current_theme_supports( 'reply-thumbnails' ) && post_type_supports( 'reply', 'thumbnail' ) ) {
 
 
 
 
212
  $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your reply without inserting it. This is usually useful only if your theme makes use of the featured image as a reply thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
213
  }
214
 
220
  '<ul>' .
221
  '<li>' . __( '<strong>Forum</strong> dropdown determines the parent forum that the reply belongs to. Select the forum, or leave the default (Use Forum of Topic) to post the reply in forum of the topic.', 'bbpress' ) . '</li>' .
222
  '<li>' . __( '<strong>Topic</strong> determines the parent topic that the reply belongs to.', 'bbpress' ) . '</li>' .
223
+ '<li>' . __( '<strong>Reply To</strong> determines the threading of the reply.', 'bbpress' ) . '</li>' .
224
  '</ul>'
225
  ) );
226
 
230
  'content' => $publish_box,
231
  ) );
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>' .
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
 
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
 
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();
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
  }
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
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)
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
 
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
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
 
604
  * @uses do_action() Calls 'bbp_admin_replies_column_data' with the
605
  * column and reply id
606
  */
607
+ public function column_data( $column, $reply_id ) {
608
 
609
  if ( $this->bail() ) return;
610
 
623
  // Topic Title
624
  $topic_title = bbp_get_topic_title( $topic_id );
625
  if ( empty( $topic_title ) ) {
626
+ $topic_title = esc_html__( 'No Topic', 'bbpress' );
627
  }
628
 
629
  // Output the title
631
 
632
  // Reply has no topic
633
  } else {
634
+ esc_html_e( 'No Topic', 'bbpress' );
635
  }
636
 
637
  break;
649
  // Forum Title
650
  $forum_title = bbp_get_forum_title( $reply_forum_id );
651
  if ( empty( $forum_title ) ) {
652
+ $forum_title = esc_html__( 'No Forum', 'bbpress' );
653
  }
654
 
655
  // Alert capable users of reply forum mismatch
656
+ if ( $reply_forum_id !== $topic_forum_id ) {
657
  if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) {
658
+ $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>';
659
  }
660
  }
661
 
678
  case 'bbp_reply_created':
679
 
680
  // Output last activity time and date
681
+ printf( '%1$s <br /> %2$s',
682
  get_the_date(),
683
  esc_attr( get_the_time() )
684
  );
716
  * @uses get_delete_post_link() To get the delete post link of the reply
717
  * @return array $actions Actions
718
  */
719
+ public function row_actions( $actions, $reply ) {
720
 
721
  if ( $this->bail() ) return $actions;
722
 
723
  unset( $actions['inline hide-if-no-js'] );
724
 
725
  // Reply view links to topic
726
+ $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>';
727
 
728
  // User cannot view replies in trash
729
+ if ( ( bbp_get_trash_status_id() === $reply->post_status ) && !current_user_can( 'view_trash' ) )
730
  unset( $actions['view'] );
731
 
732
  // Only show the actions if the user is capable of viewing them
733
  if ( current_user_can( 'moderate', $reply->ID ) ) {
734
  if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_spam_status_id() ) ) ) {
735
+ $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 );
736
  if ( bbp_is_reply_spam( $reply->ID ) ) {
737
+ $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
738
  } else {
739
+ $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam', 'bbpress' ) . '">' . esc_html__( 'Spam', 'bbpress' ) . '</a>';
740
  }
741
  }
742
  }
743
 
744
  // Trash
745
  if ( current_user_can( 'delete_reply', $reply->ID ) ) {
746
+ if ( bbp_get_trash_status_id() === $reply->post_status ) {
747
+ $post_type_object = get_post_type_object( bbp_get_reply_post_type() );
748
+ $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . 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>";
749
  } elseif ( EMPTY_TRASH_DAYS ) {
750
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . 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>";
751
  }
752
 
753
+ if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) {
754
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . 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>";
755
+ } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
756
  unset( $actions['trash'] );
757
  }
758
  }
775
  if ( $this->bail() ) return;
776
 
777
  // Add Empty Spam button
778
+ if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
779
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
780
  $title = esc_attr__( 'Empty Spam', 'bbpress' );
781
  submit_button( $title, 'button-secondary apply', 'delete_all', false );
includes/admin/settings.php CHANGED
@@ -20,45 +20,55 @@ if ( !defined( 'ABSPATH' ) ) exit;
20
  */
21
  function bbp_admin_get_settings_sections() {
22
  return (array) apply_filters( 'bbp_admin_get_settings_sections', array(
23
- 'bbp_settings_main' => array(
24
- 'title' => __( 'Main Settings', 'bbpress' ),
25
- 'callback' => 'bbp_admin_setting_callback_main_section',
26
- 'page' => 'bbpress',
 
 
 
 
 
27
  ),
28
  'bbp_settings_theme_compat' => array(
29
- 'title' => __( 'Theme Packages', 'bbpress' ),
30
  'callback' => 'bbp_admin_setting_callback_subtheme_section',
31
- 'page' => 'bbpress',
32
  ),
33
  'bbp_settings_per_page' => array(
34
- 'title' => __( 'Per Page', 'bbpress' ),
35
  'callback' => 'bbp_admin_setting_callback_per_page_section',
36
- 'page' => 'bbpress',
37
  ),
38
  'bbp_settings_per_rss_page' => array(
39
- 'title' => __( 'Per RSS Page', 'bbpress' ),
40
  'callback' => 'bbp_admin_setting_callback_per_rss_page_section',
41
- 'page' => 'bbpress',
42
  ),
43
  'bbp_settings_root_slugs' => array(
44
- 'title' => __( 'Archive Slugs', 'bbpress' ),
45
  'callback' => 'bbp_admin_setting_callback_root_slug_section',
46
- 'page' => 'bbpress',
47
  ),
48
  'bbp_settings_single_slugs' => array(
49
- 'title' => __( 'Single Slugs', 'bbpress' ),
50
  'callback' => 'bbp_admin_setting_callback_single_slug_section',
51
- 'page' => 'bbpress',
 
 
 
 
 
52
  ),
53
  'bbp_settings_buddypress' => array(
54
- 'title' => __( 'BuddyPress', 'bbpress' ),
55
  'callback' => 'bbp_admin_setting_callback_buddypress_section',
56
- 'page' => 'bbpress',
57
  ),
58
  'bbp_settings_akismet' => array(
59
- 'title' => __( 'Akismet', 'bbpress' ),
60
  'callback' => 'bbp_admin_setting_callback_akismet_section',
61
- 'page' => 'bbpress'
62
  )
63
  ) );
64
  }
@@ -72,9 +82,9 @@ function bbp_admin_get_settings_sections() {
72
  function bbp_admin_get_settings_fields() {
73
  return (array) apply_filters( 'bbp_admin_get_settings_fields', array(
74
 
75
- /** Main Section ******************************************************/
76
 
77
- 'bbp_settings_main' => array(
78
 
79
  // Edit lock setting
80
  '_bbp_edit_lock' => array(
@@ -92,6 +102,33 @@ function bbp_admin_get_settings_fields() {
92
  'args' => array()
93
  ),
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  // Allow topic and reply revisions
96
  '_bbp_allow_revisions' => array(
97
  'title' => __( 'Revisions', 'bbpress' ),
@@ -124,33 +161,17 @@ function bbp_admin_get_settings_fields() {
124
  'args' => array()
125
  ),
126
 
127
- // Allow anonymous posting setting
128
- '_bbp_allow_anonymous' => array(
129
- 'title' => __( 'Anonymous posting', 'bbpress' ),
130
- 'callback' => 'bbp_admin_setting_callback_anonymous',
131
- 'sanitize_callback' => 'intval',
132
- 'args' => array()
133
- ),
134
-
135
- // Allow global access (on multisite)
136
- '_bbp_default_role' => array(
137
- 'title' => __( 'Default user role', 'bbpress' ),
138
- 'callback' => 'bbp_admin_setting_callback_default_role',
139
- 'sanitize_callback' => 'sanitize_text_field',
140
- 'args' => array()
141
- ),
142
-
143
- // Allow global access (on multisite)
144
- '_bbp_allow_global_access' => array(
145
- 'title' => __( 'Auto role', 'bbpress' ),
146
- 'callback' => 'bbp_admin_setting_callback_global_access',
147
  'sanitize_callback' => 'intval',
148
  'args' => array()
149
  ),
150
 
151
  // Allow fancy editor setting
152
  '_bbp_use_wp_editor' => array(
153
- 'title' => __( 'Fancy editor', 'bbpress' ),
154
  'callback' => 'bbp_admin_setting_callback_use_wp_editor',
155
  'args' => array(),
156
  'sanitize_callback' => 'intval'
@@ -162,6 +183,20 @@ function bbp_admin_get_settings_fields() {
162
  'callback' => 'bbp_admin_setting_callback_use_autoembed',
163
  'sanitize_callback' => 'intval',
164
  'args' => array()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  )
166
  ),
167
 
@@ -169,7 +204,7 @@ function bbp_admin_get_settings_fields() {
169
 
170
  'bbp_settings_theme_compat' => array(
171
 
172
- // Replies per page setting
173
  '_bbp_theme_package_id' => array(
174
  'title' => __( 'Current Package', 'bbpress' ),
175
  'callback' => 'bbp_admin_setting_callback_subtheme_id',
@@ -226,25 +261,12 @@ function bbp_admin_get_settings_fields() {
226
 
227
  // Root slug setting
228
  '_bbp_root_slug' => array(
229
- 'title' => __( 'Forums base', 'bbpress' ),
230
  'callback' => 'bbp_admin_setting_callback_root_slug',
231
  'sanitize_callback' => 'esc_sql',
232
  'args' => array()
233
  ),
234
 
235
- // Topic archive setting
236
- '_bbp_topic_archive_slug' => array(
237
- 'title' => __( 'Topics base', 'bbpress' ),
238
- 'callback' => 'bbp_admin_setting_callback_topic_archive_slug',
239
- 'sanitize_callback' => 'esc_sql',
240
- 'args' => array()
241
- )
242
- ),
243
-
244
- /** Single Slugs ******************************************************/
245
-
246
- 'bbp_settings_single_slugs' => array(
247
-
248
  // Include root setting
249
  '_bbp_include_root' => array(
250
  'title' => __( 'Forum Prefix', 'bbpress' ),
@@ -253,9 +275,22 @@ function bbp_admin_get_settings_fields() {
253
  'args' => array()
254
  ),
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  // Forum slug setting
257
  '_bbp_forum_slug' => array(
258
- 'title' => __( 'Forum slug', 'bbpress' ),
259
  'callback' => 'bbp_admin_setting_callback_forum_slug',
260
  'sanitize_callback' => 'sanitize_title',
261
  'args' => array()
@@ -263,7 +298,7 @@ function bbp_admin_get_settings_fields() {
263
 
264
  // Topic slug setting
265
  '_bbp_topic_slug' => array(
266
- 'title' => __( 'Topic slug', 'bbpress' ),
267
  'callback' => 'bbp_admin_setting_callback_topic_slug',
268
  'sanitize_callback' => 'sanitize_title',
269
  'args' => array()
@@ -271,41 +306,78 @@ function bbp_admin_get_settings_fields() {
271
 
272
  // Topic tag slug setting
273
  '_bbp_topic_tag_slug' => array(
274
- 'title' => __( 'Topic tag slug', 'bbpress' ),
275
  'callback' => 'bbp_admin_setting_callback_topic_tag_slug',
276
  'sanitize_callback' => 'sanitize_title',
277
  'args' => array()
278
  ),
279
 
 
 
 
 
 
 
 
 
280
  // Reply slug setting
281
  '_bbp_reply_slug' => array(
282
- 'title' => __( 'Reply slug', 'bbpress' ),
283
  'callback' => 'bbp_admin_setting_callback_reply_slug',
284
  'sanitize_callback' => 'sanitize_title',
285
  'args' => array()
286
  ),
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  // User slug setting
289
  '_bbp_user_slug' => array(
290
- 'title' => __( 'User slug', 'bbpress' ),
291
  'callback' => 'bbp_admin_setting_callback_user_slug',
292
  'sanitize_callback' => 'sanitize_title',
293
  'args' => array()
294
  ),
295
 
296
- // View slug setting
297
- '_bbp_view_slug' => array(
298
- 'title' => __( 'Topic view slug', 'bbpress' ),
299
- 'callback' => 'bbp_admin_setting_callback_view_slug',
300
- 'sanitize_callback' => 'sanitize_title',
301
  'args' => array()
302
  ),
303
 
304
- // Search slug setting
305
- '_bbp_search_slug' => array(
306
- 'title' => __( 'Search slug', 'bbpress' ),
307
- 'callback' => 'bbp_admin_setting_callback_search_slug',
308
- 'sanitize_callback' => 'sanitize_title',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  'args' => array()
310
  )
311
  ),
@@ -365,21 +437,22 @@ function bbp_admin_get_settings_fields_for_section( $section_id = '' ) {
365
  return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
366
  }
367
 
368
- /** Main Section **************************************************************/
369
 
370
  /**
371
- * Main settings section description for the settings page
372
  *
373
  * @since bbPress (r2786)
374
  */
375
- function bbp_admin_setting_callback_main_section() {
376
  ?>
377
 
378
- <p><?php _e( 'Main forum settings for enabling features and setting time limits', 'bbpress' ); ?></p>
379
 
380
  <?php
381
  }
382
 
 
383
  /**
384
  * Edit lock setting field
385
  *
@@ -390,8 +463,8 @@ function bbp_admin_setting_callback_main_section() {
390
  function bbp_admin_setting_callback_editlock() {
391
  ?>
392
 
393
- <input name="_bbp_edit_lock" type="number" min="0" step="1" id="_bbp_edit_lock" value="<?php bbp_form_option( '_bbp_edit_lock', '5' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_edit_lock' ); ?> />
394
- <label for="_bbp_edit_lock"><?php _e( 'minutes', 'bbpress' ); ?></label>
395
 
396
  <?php
397
  }
@@ -406,128 +479,194 @@ function bbp_admin_setting_callback_editlock() {
406
  function bbp_admin_setting_callback_throttle() {
407
  ?>
408
 
409
- <input name="_bbp_throttle_time" type="number" min="0" step="1" id="_bbp_throttle_time" value="<?php bbp_form_option( '_bbp_throttle_time', '10' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_throttle_time' ); ?> />
410
- <label for="_bbp_throttle_time"><?php _e( 'seconds', 'bbpress' ); ?></label>
411
 
412
  <?php
413
  }
414
 
415
  /**
416
- * Allow favorites setting field
417
  *
418
- * @since bbPress (r2786)
419
  *
420
  * @uses checked() To display the checked attribute
421
  */
422
- function bbp_admin_setting_callback_favorites() {
423
  ?>
424
 
425
- <input id="_bbp_enable_favorites" name="_bbp_enable_favorites" type="checkbox" id="_bbp_enable_favorites" value="1" <?php checked( bbp_is_favorites_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_favorites' ); ?> />
426
- <label for="_bbp_enable_favorites"><?php _e( 'Allow users to mark topics as favorites', 'bbpress' ); ?></label>
427
 
428
  <?php
429
  }
430
 
431
  /**
432
- * Allow subscriptions setting field
433
  *
434
- * @since bbPress (r2737)
435
  *
436
  * @uses checked() To display the checked attribute
437
  */
438
- function bbp_admin_setting_callback_subscriptions() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
  ?>
440
 
441
- <input id="_bbp_enable_subscriptions" name="_bbp_enable_subscriptions" type="checkbox" id="_bbp_enable_subscriptions" value="1" <?php checked( bbp_is_subscriptions_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_subscriptions' ); ?> />
442
- <label for="_bbp_enable_subscriptions"><?php _e( 'Allow users to subscribe to topics', 'bbpress' ); ?></label>
443
 
444
  <?php
445
  }
446
 
447
  /**
448
- * Allow topic tags setting field
449
  *
450
- * @since bbPress (r####)
451
  *
452
  * @uses checked() To display the checked attribute
453
  */
454
- function bbp_admin_setting_callback_topic_tags() {
455
  ?>
456
 
457
- <input id="_bbp_allow_topic_tags" name="_bbp_allow_topic_tags" type="checkbox" id="_bbp_allow_topic_tags" value="1" <?php checked( bbp_allow_topic_tags( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_topic_tags' ); ?> />
458
- <label for="_bbp_allow_topic_tags"><?php _e( 'Allow topics to have tags', 'bbpress' ); ?></label>
459
 
460
  <?php
461
  }
462
 
463
  /**
464
- * Allow topic and reply revisions
465
  *
466
- * @since bbPress (r3412)
467
  *
468
  * @uses checked() To display the checked attribute
469
  */
470
- function bbp_admin_setting_callback_revisions() {
471
  ?>
472
 
473
- <input id="_bbp_allow_revisions" name="_bbp_allow_revisions" type="checkbox" id="_bbp_allow_revisions" value="1" <?php checked( bbp_allow_revisions( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_revisions' ); ?> />
474
- <label for="_bbp_allow_revisions"><?php _e( 'Allow topic and reply revision logging', 'bbpress' ); ?></label>
475
 
476
  <?php
477
  }
478
 
479
  /**
480
- * Allow anonymous posting setting field
481
  *
482
- * @since bbPress (r2737)
483
  *
484
  * @uses checked() To display the checked attribute
485
  */
486
- function bbp_admin_setting_callback_anonymous() {
487
  ?>
488
 
489
- <input id="_bbp_allow_anonymous" name="_bbp_allow_anonymous" type="checkbox" id="_bbp_allow_anonymous" value="1" <?php checked( bbp_allow_anonymous( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_anonymous' ); ?> />
490
- <label for="_bbp_allow_anonymous"><?php _e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
491
 
492
  <?php
493
  }
494
 
495
  /**
496
- * Allow global access setting field
497
  *
498
- * @since bbPress (r3378)
499
  *
500
  * @uses checked() To display the checked attribute
501
  */
502
- function bbp_admin_setting_callback_global_access() {
503
  ?>
504
 
505
- <input id="_bbp_allow_global_access" name="_bbp_allow_global_access" type="checkbox" id="_bbp_allow_global_access" value="1" <?php checked( bbp_allow_global_access( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> />
506
- <label for="_bbp_allow_global_access"><?php _e( 'Automatically assign default role to new, registered users upon visiting the site.', 'bbpress' ); ?></label>
507
 
508
  <?php
509
  }
510
 
511
  /**
512
- * Output forum role selector (for user edit)
 
 
513
  *
514
- * @since bbPress (r4284)
 
 
 
 
515
  */
516
- function bbp_admin_setting_callback_default_role() {
517
-
518
- $default_role = bbp_get_default_role(); ?>
519
 
520
- <select name="_bbp_default_role" id="_bbp_default_role" <?php bbp_maybe_admin_setting_disabled( '_bbp_default_role' ); ?>>
 
 
521
 
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 translate_user_role( $details['name'] ); ?></option>
 
525
 
526
- <?php endforeach; ?>
527
 
 
528
  </select>
529
 
530
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
  }
532
 
533
  /**
@@ -540,8 +679,8 @@ function bbp_admin_setting_callback_default_role() {
540
  function bbp_admin_setting_callback_use_wp_editor() {
541
  ?>
542
 
543
- <input id="_bbp_use_wp_editor" name="_bbp_use_wp_editor" type="checkbox" id="_bbp_use_wp_editor" value="1" <?php checked( bbp_use_wp_editor( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_use_wp_editor' ); ?> />
544
- <label for="_bbp_use_wp_editor"><?php _e( 'Use the fancy WordPress editor to create and edit topics and replies', 'bbpress' ); ?></label>
545
 
546
  <?php
547
  }
@@ -554,7 +693,7 @@ function bbp_admin_setting_callback_use_wp_editor() {
554
  function bbp_admin_setting_callback_subtheme_section() {
555
  ?>
556
 
557
- <p><?php _e( 'How your forum content is displayed within your existing theme.', 'bbpress' ); ?></p>
558
 
559
  <?php
560
  }
@@ -578,17 +717,17 @@ function bbp_admin_setting_callback_subtheme_id() {
578
  //
579
  // @see bbPress::register_theme_packages()
580
  foreach ( (array) bbpress()->theme_compat->packages as $id => $theme ) {
581
- $theme_options .= '<option value="' . esc_attr( $id ) . '"' . selected( $theme->id, $current_package, false ) . '>' . sprintf( __( '%1$s - %2$s', 'bbpress' ), esc_html( $theme->name ), esc_html( str_replace( WP_CONTENT_DIR, '', $theme->dir ) ) ) . '</option>';
582
  }
583
 
584
  if ( !empty( $theme_options ) ) : ?>
585
 
586
  <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select>
587
- <label for="_bbp_theme_package_id"><?php _e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
588
 
589
  <?php else : ?>
590
 
591
- <p><?php _e( 'No template packages available.', 'bbpress' ); ?></p>
592
 
593
  <?php endif;
594
  }
@@ -603,8 +742,8 @@ function bbp_admin_setting_callback_subtheme_id() {
603
  function bbp_admin_setting_callback_use_autoembed() {
604
  ?>
605
 
606
- <input id="_bbp_use_autoembed" name="_bbp_use_autoembed" type="checkbox" id="_bbp_use_autoembed" value="1" <?php checked( bbp_use_autoembed( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_use_autoembed' ); ?> />
607
- <label for="_bbp_use_autoembed"><?php _e( 'Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and replies', 'bbpress' ); ?></label>
608
 
609
  <?php
610
  }
@@ -619,7 +758,7 @@ function bbp_admin_setting_callback_use_autoembed() {
619
  function bbp_admin_setting_callback_per_page_section() {
620
  ?>
621
 
622
- <p><?php _e( 'How many topics and replies to show per page', 'bbpress' ); ?></p>
623
 
624
  <?php
625
  }
@@ -634,8 +773,8 @@ function bbp_admin_setting_callback_per_page_section() {
634
  function bbp_admin_setting_callback_topics_per_page() {
635
  ?>
636
 
637
- <input name="_bbp_topics_per_page" type="number" min="1" step="1" id="_bbp_topics_per_page" value="<?php bbp_form_option( '_bbp_topics_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_page' ); ?> />
638
- <label for="_bbp_topics_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
639
 
640
  <?php
641
  }
@@ -650,8 +789,8 @@ function bbp_admin_setting_callback_topics_per_page() {
650
  function bbp_admin_setting_callback_replies_per_page() {
651
  ?>
652
 
653
- <input name="_bbp_replies_per_page" type="number" min="1" step="1" id="_bbp_replies_per_page" value="<?php bbp_form_option( '_bbp_replies_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_page' ); ?> />
654
- <label for="_bbp_replies_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
655
 
656
  <?php
657
  }
@@ -666,7 +805,7 @@ function bbp_admin_setting_callback_replies_per_page() {
666
  function bbp_admin_setting_callback_per_rss_page_section() {
667
  ?>
668
 
669
- <p><?php _e( 'How many topics and replies to show per RSS page', 'bbpress' ); ?></p>
670
 
671
  <?php
672
  }
@@ -681,8 +820,8 @@ function bbp_admin_setting_callback_per_rss_page_section() {
681
  function bbp_admin_setting_callback_topics_per_rss_page() {
682
  ?>
683
 
684
- <input name="_bbp_topics_per_rss_page" type="number" min="1" step="1" id="_bbp_topics_per_rss_page" value="<?php bbp_form_option( '_bbp_topics_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_rss_page' ); ?> />
685
- <label for="_bbp_topics_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
686
 
687
  <?php
688
  }
@@ -697,8 +836,8 @@ function bbp_admin_setting_callback_topics_per_rss_page() {
697
  function bbp_admin_setting_callback_replies_per_rss_page() {
698
  ?>
699
 
700
- <input name="_bbp_replies_per_rss_page" type="number" min="1" step="1" id="_bbp_replies_per_rss_page" value="<?php bbp_form_option( '_bbp_replies_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_rss_page' ); ?> />
701
- <label for="_bbp_replies_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
702
 
703
  <?php
704
  }
@@ -716,7 +855,7 @@ function bbp_admin_setting_callback_root_slug_section() {
716
  if ( isset( $_GET['settings-updated'] ) && isset( $_GET['page'] ) )
717
  flush_rewrite_rules(); ?>
718
 
719
- <p><?php printf( __( 'Custom root slugs to prefix your forums and topics with. These can be partnered with WordPress pages to allow more flexibility.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
720
 
721
  <?php
722
  }
@@ -731,13 +870,96 @@ function bbp_admin_setting_callback_root_slug_section() {
731
  function bbp_admin_setting_callback_root_slug() {
732
  ?>
733
 
734
- <input name="_bbp_root_slug" type="text" id="_bbp_root_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_root_slug', 'forums', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_root_slug' ); ?> />
735
 
736
  <?php
737
  // Slug Check
738
  bbp_form_slug_conflict_check( '_bbp_root_slug', 'forums' );
739
  }
740
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
  /**
742
  * Topic archive slug setting field
743
  *
@@ -748,40 +970,75 @@ function bbp_admin_setting_callback_root_slug() {
748
  function bbp_admin_setting_callback_topic_archive_slug() {
749
  ?>
750
 
751
- <input name="_bbp_topic_archive_slug" type="text" id="_bbp_topic_archive_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_topic_archive_slug', 'topics', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_topic_archive_slug' ); ?> />
752
 
753
  <?php
754
  // Slug Check
755
  bbp_form_slug_conflict_check( '_bbp_topic_archive_slug', 'topics' );
756
  }
757
 
758
- /** Single Slugs **************************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
 
760
  /**
761
- * Slugs settings section description for the settings page
762
  *
763
- * @since bbPress (r2786)
 
 
764
  */
765
- function bbp_admin_setting_callback_single_slug_section() {
766
  ?>
767
 
768
- <p><?php printf( __( 'Custom slugs for single forums, topics, replies, tags, users, and views here. If you change these, existing permalinks will also change.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
769
 
770
  <?php
 
 
771
  }
772
 
773
  /**
774
- * Include root slug setting field
775
  *
776
- * @since bbPress (r2786)
777
  *
778
- * @uses checked() To display the checked attribute
779
  */
780
- function bbp_admin_setting_callback_include_root() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781
  ?>
782
 
783
- <input id="_bbp_include_root" name="_bbp_include_root" type="checkbox" id="_bbp_include_root" value="1" <?php checked( get_option( '_bbp_include_root', true ) ); bbp_maybe_admin_setting_disabled( '_bbp_include_root' ); ?> />
784
- <label for="_bbp_include_root"><?php _e( 'Prefix your forum area with the Forum Base slug (Recommended)', 'bbpress' ); ?></label>
785
 
786
  <?php
787
  }
@@ -796,7 +1053,7 @@ function bbp_admin_setting_callback_include_root() {
796
  function bbp_admin_setting_callback_forum_slug() {
797
  ?>
798
 
799
- <input name="_bbp_forum_slug" type="text" id="_bbp_forum_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_forum_slug', 'forum', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_forum_slug' ); ?> />
800
 
801
  <?php
802
  // Slug Check
@@ -813,7 +1070,7 @@ function bbp_admin_setting_callback_forum_slug() {
813
  function bbp_admin_setting_callback_topic_slug() {
814
  ?>
815
 
816
- <input name="_bbp_topic_slug" type="text" id="_bbp_topic_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_topic_slug', 'topic', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_topic_slug' ); ?> />
817
 
818
  <?php
819
  // Slug Check
@@ -830,7 +1087,7 @@ function bbp_admin_setting_callback_topic_slug() {
830
  function bbp_admin_setting_callback_reply_slug() {
831
  ?>
832
 
833
- <input name="_bbp_reply_slug" type="text" id="_bbp_reply_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_reply_slug', 'reply', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_reply_slug' ); ?> />
834
 
835
  <?php
836
  // Slug Check
@@ -847,7 +1104,7 @@ function bbp_admin_setting_callback_reply_slug() {
847
  function bbp_admin_setting_callback_topic_tag_slug() {
848
  ?>
849
 
850
- <input name="_bbp_topic_tag_slug" type="text" id="_bbp_topic_tag_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_topic_tag_slug', 'topic-tag', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_topic_tag_slug' ); ?> />
851
 
852
  <?php
853
 
@@ -855,25 +1112,6 @@ function bbp_admin_setting_callback_topic_tag_slug() {
855
  bbp_form_slug_conflict_check( '_bbp_topic_tag_slug', 'topic-tag' );
856
  }
857
 
858
- /** Other Slugs ***************************************************************/
859
-
860
- /**
861
- * User slug setting field
862
- *
863
- * @since bbPress (r2786)
864
- *
865
- * @uses bbp_form_option() To output the option value
866
- */
867
- function bbp_admin_setting_callback_user_slug() {
868
- ?>
869
-
870
- <input name="_bbp_user_slug" type="text" id="_bbp_user_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_user_slug', 'users', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_user_slug' ); ?> />
871
-
872
- <?php
873
- // Slug Check
874
- bbp_form_slug_conflict_check( '_bbp_user_slug', 'users' );
875
- }
876
-
877
  /**
878
  * View slug setting field
879
  *
@@ -884,7 +1122,7 @@ function bbp_admin_setting_callback_user_slug() {
884
  function bbp_admin_setting_callback_view_slug() {
885
  ?>
886
 
887
- <input name="_bbp_view_slug" type="text" id="_bbp_view_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_view_slug', 'view', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_view_slug' ); ?> />
888
 
889
  <?php
890
  // Slug Check
@@ -901,7 +1139,7 @@ function bbp_admin_setting_callback_view_slug() {
901
  function bbp_admin_setting_callback_search_slug() {
902
  ?>
903
 
904
- <input name="_bbp_search_slug" type="text" id="_bbp_search_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_search_slug', 'search', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_search_slug' ); ?> />
905
 
906
  <?php
907
  // Slug Check
@@ -918,7 +1156,7 @@ function bbp_admin_setting_callback_search_slug() {
918
  function bbp_admin_setting_callback_buddypress_section() {
919
  ?>
920
 
921
- <p><?php _e( 'Forum settings for BuddyPress', 'bbpress' ); ?></p>
922
 
923
  <?php
924
  }
@@ -933,8 +1171,8 @@ function bbp_admin_setting_callback_buddypress_section() {
933
  function bbp_admin_setting_callback_group_forums() {
934
  ?>
935
 
936
- <input id="_bbp_enable_group_forums" name="_bbp_enable_group_forums" type="checkbox" id="_bbp_enable_group_forums" value="1" <?php checked( bbp_is_group_forums_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_group_forums' ); ?> />
937
- <label for="_bbp_enable_group_forums"><?php _e( 'Allow BuddyPress Groups to have their own forums', 'bbpress' ); ?></label>
938
 
939
  <?php
940
  }
@@ -959,8 +1197,8 @@ function bbp_admin_setting_callback_group_forums_root_id() {
959
  'disabled' => '_bbp_group_forums_root_id'
960
  ) ); ?>
961
 
962
- <label for="_bbp_group_forums_root_id"><?php _e( 'is the parent for all group forums', 'bbpress' ); ?></label>
963
- <p class="description"><?php _e( 'Using the Forum Root is not recommended. Changing this does not move existing forums.', 'bbpress' ); ?></p>
964
 
965
  <?php
966
  }
@@ -975,7 +1213,7 @@ function bbp_admin_setting_callback_group_forums_root_id() {
975
  function bbp_admin_setting_callback_akismet_section() {
976
  ?>
977
 
978
- <p><?php _e( 'Forum settings for Akismet', 'bbpress' ); ?></p>
979
 
980
  <?php
981
  }
@@ -991,8 +1229,8 @@ function bbp_admin_setting_callback_akismet_section() {
991
  function bbp_admin_setting_callback_akismet() {
992
  ?>
993
 
994
- <input id="_bbp_enable_akismet" name="_bbp_enable_akismet" type="checkbox" id="_bbp_enable_akismet" value="1" <?php checked( bbp_is_akismet_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_akismet' ); ?> />
995
- <label for="_bbp_enable_akismet"><?php _e( 'Allow Akismet to actively prevent forum spam.', 'bbpress' ); ?></label>
996
 
997
  <?php
998
  }
@@ -1015,7 +1253,7 @@ function bbp_admin_settings() {
1015
 
1016
  <?php screen_icon(); ?>
1017
 
1018
- <h2><?php _e( 'Forums Settings', 'bbpress' ) ?></h2>
1019
 
1020
  <form action="options.php" method="post">
1021
 
@@ -1043,7 +1281,7 @@ function bbp_admin_settings() {
1043
  function bbp_converter_setting_callback_main_section() {
1044
  ?>
1045
 
1046
- <p><?php _e( 'Information about your previous forums database so that they can be converted. <strong>Backup your database before proceeding.</strong>', 'bbpress' ); ?></p>
1047
 
1048
  <?php
1049
  }
@@ -1066,14 +1304,14 @@ function bbp_converter_setting_callback_platform() {
1066
  while ( $file = readdir( $curdir ) ) {
1067
  if ( ( stristr( $file, '.php' ) ) && ( stristr( $file, 'index' ) === false ) ) {
1068
  $file = preg_replace( '/.php/', '', $file );
1069
- $platform_options .= '<option value="' . $file . '">' . $file . '</option>';
1070
  }
1071
  }
1072
 
1073
  closedir( $curdir ); ?>
1074
 
1075
  <select name="_bbp_converter_platform" id="_bbp_converter_platform" /><?php echo $platform_options ?></select>
1076
- <label for="_bbp_converter_platform"><?php _e( 'is the previous forum software', 'bbpress' ); ?></label>
1077
 
1078
  <?php
1079
  }
@@ -1086,8 +1324,8 @@ function bbp_converter_setting_callback_platform() {
1086
  function bbp_converter_setting_callback_dbserver() {
1087
  ?>
1088
 
1089
- <input name="_bbp_converter_db_server" type="text" id="_bbp_converter_db_server" value="<?php bbp_form_option( '_bbp_converter_db_server', 'localhost' ); ?>" class="medium-text" />
1090
- <label for="_bbp_converter_db_server"><?php _e( 'IP or hostname', 'bbpress' ); ?></label>
1091
 
1092
  <?php
1093
  }
@@ -1100,8 +1338,8 @@ function bbp_converter_setting_callback_dbserver() {
1100
  function bbp_converter_setting_callback_dbport() {
1101
  ?>
1102
 
1103
- <input name="_bbp_converter_db_port" type="text" id="_bbp_converter_db_port" value="<?php bbp_form_option( '_bbp_converter_db_port', '3306' ); ?>" class="small-text" />
1104
- <label for="_bbp_converter_db_port"><?php _e( 'Use default 3306 if unsure', 'bbpress' ); ?></label>
1105
 
1106
  <?php
1107
  }
@@ -1114,8 +1352,8 @@ function bbp_converter_setting_callback_dbport() {
1114
  function bbp_converter_setting_callback_dbuser() {
1115
  ?>
1116
 
1117
- <input name="_bbp_converter_db_user" type="text" id="_bbp_converter_db_user" value="<?php bbp_form_option( '_bbp_converter_db_user' ); ?>" class="medium-text" />
1118
- <label for="_bbp_converter_db_user"><?php _e( 'User for your database connection', 'bbpress' ); ?></label>
1119
 
1120
  <?php
1121
  }
@@ -1128,8 +1366,8 @@ function bbp_converter_setting_callback_dbuser() {
1128
  function bbp_converter_setting_callback_dbpass() {
1129
  ?>
1130
 
1131
- <input name="_bbp_converter_db_pass" type="password" id="_bbp_converter_db_pass" value="<?php bbp_form_option( '_bbp_converter_db_pass' ); ?>" class="medium-text" />
1132
- <label for="_bbp_converter_db_pass"><?php _e( 'Password to access the database', 'bbpress' ); ?></label>
1133
 
1134
  <?php
1135
  }
@@ -1142,8 +1380,8 @@ function bbp_converter_setting_callback_dbpass() {
1142
  function bbp_converter_setting_callback_dbname() {
1143
  ?>
1144
 
1145
- <input name="_bbp_converter_db_name" type="text" id="_bbp_converter_db_name" value="<?php bbp_form_option( '_bbp_converter_db_name' ); ?>" class="medium-text" />
1146
- <label for="_bbp_converter_db_name"><?php _e( 'Name of the database with your old forum data', 'bbpress' ); ?></label>
1147
 
1148
  <?php
1149
  }
@@ -1156,7 +1394,7 @@ function bbp_converter_setting_callback_dbname() {
1156
  function bbp_converter_setting_callback_options_section() {
1157
  ?>
1158
 
1159
- <p><?php _e( 'Some optional parameters to help tune the conversion process.', 'bbpress' ); ?></p>
1160
 
1161
  <?php
1162
  }
@@ -1169,8 +1407,8 @@ function bbp_converter_setting_callback_options_section() {
1169
  function bbp_converter_setting_callback_dbprefix() {
1170
  ?>
1171
 
1172
- <input name="_bbp_converter_db_prefix" type="text" id="_bbp_converter_db_prefix" value="<?php bbp_form_option( '_bbp_converter_db_prefix' ); ?>" class="medium-text" />
1173
- <label for="_bbp_converter_db_prefix"><?php _e( '(If converting from BuddyPress Forums, use "wp_bb_" or your custom prefix)', 'bbpress' ); ?></label>
1174
 
1175
  <?php
1176
  }
@@ -1183,9 +1421,9 @@ function bbp_converter_setting_callback_dbprefix() {
1183
  function bbp_converter_setting_callback_rows() {
1184
  ?>
1185
 
1186
- <input name="_bbp_converter_rows" type="text" id="_bbp_converter_rows" value="<?php bbp_form_option( '_bbp_converter_rows', '100' ); ?>" class="small-text" />
1187
- <label for="_bbp_converter_rows"><?php _e( 'rows to process at a time', 'bbpress' ); ?></label>
1188
- <p class="description"><?php _e( 'Keep this low if you experience out-of-memory issues.', 'bbpress' ); ?></p>
1189
 
1190
  <?php
1191
  }
@@ -1198,9 +1436,9 @@ function bbp_converter_setting_callback_rows() {
1198
  function bbp_converter_setting_callback_delay_time() {
1199
  ?>
1200
 
1201
- <input name="_bbp_converter_delay_time" type="text" id="_bbp_converter_delay_time" value="<?php bbp_form_option( '_bbp_converter_delay_time', '1' ); ?>" class="small-text" />
1202
- <label for="_bbp_converter_delay_time"><?php _e( 'second(s) delay between each group of rows', 'bbpress' ); ?></label>
1203
- <p class="description"><?php _e( 'Keep this high to prevent too-many-connection issues.', 'bbpress' ); ?></p>
1204
 
1205
  <?php
1206
  }
@@ -1213,9 +1451,9 @@ function bbp_converter_setting_callback_delay_time() {
1213
  function bbp_converter_setting_callback_restart() {
1214
  ?>
1215
 
1216
- <input id="_bbp_converter_restart" name="_bbp_converter_restart" type="checkbox" id="_bbp_converter_restart" value="1" <?php checked( get_option( '_bbp_converter_restart', false ) ); ?> />
1217
- <label for="_bbp_converter_restart"><?php _e( 'Start a fresh conversion from the beginning', 'bbpress' ); ?></label>
1218
- <p class="description"><?php _e( 'You should clean old conversion information before starting over.', 'bbpress' ); ?></p>
1219
 
1220
  <?php
1221
  }
@@ -1228,9 +1466,9 @@ function bbp_converter_setting_callback_restart() {
1228
  function bbp_converter_setting_callback_clean() {
1229
  ?>
1230
 
1231
- <input id="_bbp_converter_clean" name="_bbp_converter_clean" type="checkbox" id="_bbp_converter_clean" value="1" <?php checked( get_option( '_bbp_converter_clean', false ) ); ?> />
1232
- <label for="_bbp_converter_clean"><?php _e( 'Purge all information from a previously attempted import', 'bbpress' ); ?></label>
1233
- <p class="description"><?php _e( 'Use this if an import failed and you want to remove that incomplete data.', 'bbpress' ); ?></p>
1234
 
1235
  <?php
1236
  }
@@ -1243,9 +1481,9 @@ function bbp_converter_setting_callback_clean() {
1243
  function bbp_converter_setting_callback_convert_users() {
1244
  ?>
1245
 
1246
- <input id="_bbp_converter_convert_users" name="_bbp_converter_convert_users" type="checkbox" id="_bbp_converter_convert_users" value="1" <?php checked( get_option( '_bbp_converter_convert_users', false ) ); ?> />
1247
- <label for="_bbp_converter_convert_users"><?php _e( 'Attempt to import user accounts from previous forums', 'bbpress' ); ?></label>
1248
- <p class="description"><?php _e( 'Non-bbPress passwords cannot be automatically converted. They will be converted as each user logs in.', 'bbpress' ); ?></p>
1249
 
1250
  <?php
1251
  }
@@ -1266,7 +1504,7 @@ function bbp_converter_settings() {
1266
 
1267
  <?php screen_icon( 'tools' ); ?>
1268
 
1269
- <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Import Forums', 'bbpress' ) ); ?></h2>
1270
 
1271
  <form action="#" method="post" id="bbp-converter-settings">
1272
 
@@ -1275,8 +1513,8 @@ function bbp_converter_settings() {
1275
  <?php do_settings_sections( 'bbpress_converter' ); ?>
1276
 
1277
  <p class="submit">
1278
- <input type="button" name="submit" class="button-primary" id="bbp-converter-start" value="<?php esc_attr_e( 'Start', 'bbpress' ); ?>" onclick="bbconverter_start()" />
1279
- <input type="button" name="submit" class="button-primary" id="bbp-converter-stop" value="<?php esc_attr_e( 'Stop', 'bbpress' ); ?>" onclick="bbconverter_stop()" />
1280
  <img id="bbp-converter-progress" src="">
1281
  </p>
1282
 
@@ -1504,15 +1742,15 @@ function bbp_form_slug_conflict_check( $slug, $default ) {
1504
  }
1505
 
1506
  // Loop through slugs to check
1507
- foreach( $the_core_slugs as $key => $value ) {
1508
 
1509
  // Get the slug
1510
  $slug_check = bbp_get_form_option( $key, $value['default'], true );
1511
 
1512
  // Compare
1513
- if ( ( $slug != $key ) && ( $slug_check == $this_slug ) ) : ?>
1514
 
1515
- <span class="attention"><?php printf( __( 'Possible %1$s conflict: <strong>%2$s</strong>', 'bbpress' ), $value['context'], $value['name'] ); ?></span>
1516
 
1517
  <?php endif;
1518
  }
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
  }
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(
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
+ ),
127
+
128
+ /** Features Section **************************************************/
129
+
130
+ 'bbp_settings_features' => array(
131
+
132
  // Allow topic and reply revisions
133
  '_bbp_allow_revisions' => array(
134
  'title' => __( 'Revisions', 'bbpress' ),
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()
170
  ),
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'
183
  'callback' => 'bbp_admin_setting_callback_use_autoembed',
184
  'sanitize_callback' => 'intval',
185
  'args' => array()
186
+ ),
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()
194
+ ),
195
+
196
+ // Allow threadde replies
197
+ '_bbp_allow_threaded_replies' => array(
198
+ 'sanitize_callback' => 'intval',
199
+ 'args' => array()
200
  )
201
  ),
202
 
204
 
205
  'bbp_settings_theme_compat' => array(
206
 
207
+ // Theme package setting
208
  '_bbp_theme_package_id' => array(
209
  'title' => __( 'Current Package', 'bbpress' ),
210
  'callback' => 'bbp_admin_setting_callback_subtheme_id',
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' => 'esc_sql',
267
  'args' => array()
268
  ),
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  // Include root setting
271
  '_bbp_include_root' => array(
272
  'title' => __( 'Forum Prefix', 'bbpress' ),
275
  'args' => array()
276
  ),
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
+
287
+ /** Single Slugs ******************************************************/
288
+
289
+ 'bbp_settings_single_slugs' => array(
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' => 'sanitize_title',
296
  'args' => array()
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' => 'sanitize_title',
304
  'args' => array()
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' => 'sanitize_title',
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' => 'sanitize_title',
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' => 'sanitize_title',
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' => 'sanitize_title',
336
+ 'args' => array()
337
+ )
338
+ ),
339
+
340
+ /** User Slugs ********************************************************/
341
+
342
+ 'bbp_settings_user_slugs' => array(
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' => 'sanitize_title',
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' => 'esc_sql',
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' => 'esc_sql',
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' => 'esc_sql',
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' => 'esc_sql',
381
  'args' => array()
382
  )
383
  ),
437
  return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
438
  }
439
 
440
+ /** User Section **************************************************************/
441
 
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
  ?>
449
 
450
+ <p><?php esc_html_e( 'Setting time limits and other user posting capabilities', 'bbpress' ); ?></p>
451
 
452
  <?php
453
  }
454
 
455
+
456
  /**
457
  * Edit lock setting field
458
  *
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
  }
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
  }
487
 
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
  }
503
 
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(); ?>
518
+
519
+ <select name="_bbp_default_role" id="_bbp_default_role" <?php bbp_maybe_admin_setting_disabled( '_bbp_default_role' ); ?>>
520
+
521
+ <?php foreach ( bbp_get_dynamic_roles() as $role => $details ) : ?>
522
+
523
+ <option <?php selected( $default_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
524
+
525
+ <?php endforeach; ?>
526
+
527
+ </select>
528
+
529
+ <?php $select = ob_get_clean(); ?>
530
+
531
+ <label for="_bbp_allow_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
+ }
538
+
539
+ /** Features Section **********************************************************/
540
+
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
  ?>
548
 
549
+ <p><?php esc_html_e( 'Forum features that can be toggled on and off', 'bbpress' ); ?></p>
 
550
 
551
  <?php
552
  }
553
 
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
  ?>
563
 
564
+ <input name="_bbp_enable_favorites" id="_bbp_enable_favorites" type="checkbox" value="1" <?php checked( bbp_is_favorites_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_favorites' ); ?> />
565
+ <label for="_bbp_enable_favorites"><?php esc_html_e( 'Allow users to mark topics as favorites', 'bbpress' ); ?></label>
566
 
567
  <?php
568
  }
569
 
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
  ?>
579
 
580
+ <input name="_bbp_enable_subscriptions" id="_bbp_enable_subscriptions" type="checkbox" value="1" <?php checked( bbp_is_subscriptions_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_subscriptions' ); ?> />
581
+ <label for="_bbp_enable_subscriptions"><?php esc_html_e( 'Allow users to subscribe to topics', 'bbpress' ); ?></label>
582
 
583
  <?php
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
  ?>
595
 
596
+ <input name="_bbp_allow_topic_tags" id="_bbp_allow_topic_tags" type="checkbox" value="1" <?php checked( bbp_allow_topic_tags( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_topic_tags' ); ?> />
597
+ <label for="_bbp_allow_topic_tags"><?php esc_html_e( 'Allow topics to have tags', 'bbpress' ); ?></label>
598
 
599
  <?php
600
  }
601
 
602
  /**
603
+ * Allow forum wide search
604
  *
605
+ * @since bbPress (r4970)
606
  *
607
  * @uses checked() To display the checked attribute
608
  */
609
+ function bbp_admin_setting_callback_search() {
610
  ?>
611
 
612
+ <input name="_bbp_allow_search" id="_bbp_allow_search" type="checkbox" value="1" <?php checked( bbp_allow_search( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_search' ); ?> />
613
+ <label for="_bbp_allow_search"><?php esc_html_e( 'Allow forum wide search', 'bbpress' ); ?></label>
614
 
615
  <?php
616
  }
617
 
618
  /**
619
+ * Hierarchical reply maximum depth level setting field
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
 
631
+ // Set maximum depth for dropdown
632
+ $max_depth = (int) apply_filters( 'bbp_thread_replies_depth_max', 10 );
633
+ $current_depth = bbp_thread_replies_depth();
634
 
635
+ // Start an output buffer for the select dropdown
636
+ ob_start(); ?>
637
 
638
+ <select name="_bbp_thread_replies_depth" id="_bbp_thread_replies_depth" <?php bbp_maybe_admin_setting_disabled( '_bbp_thread_replies_depth' ); ?>>
639
+ <?php for ( $i = 2; $i <= $max_depth; $i++ ) : ?>
640
 
641
+ <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, $current_depth ); ?>><?php echo esc_html( $i ); ?></option>
642
 
643
+ <?php endfor; ?>
644
  </select>
645
 
646
+ <?php $select = ob_get_clean(); ?>
647
+
648
+ <label for="_bbp_allow_threaded_replies">
649
+ <input name="_bbp_allow_threaded_replies" id="_bbp_allow_threaded_replies" type="checkbox" value="1" <?php checked( '1', bbp_allow_threaded_replies( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_threaded_replies' ); ?> />
650
+ <?php printf( esc_html__( 'Enable threaded (nested) replies %s levels deep', 'bbpress' ), $select ); ?>
651
+ </label>
652
+
653
+ <?php
654
+ }
655
+
656
+ /**
657
+ * Allow topic and reply revisions
658
+ *
659
+ * @since bbPress (r3412)
660
+ *
661
+ * @uses checked() To display the checked attribute
662
+ */
663
+ function bbp_admin_setting_callback_revisions() {
664
+ ?>
665
+
666
+ <input name="_bbp_allow_revisions" id="_bbp_allow_revisions" type="checkbox" value="1" <?php checked( bbp_allow_revisions( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_revisions' ); ?> />
667
+ <label for="_bbp_allow_revisions"><?php esc_html_e( 'Allow topic and reply revision logging', 'bbpress' ); ?></label>
668
+
669
+ <?php
670
  }
671
 
672
  /**
679
  function bbp_admin_setting_callback_use_wp_editor() {
680
  ?>
681
 
682
+ <input name="_bbp_use_wp_editor" id="_bbp_use_wp_editor" type="checkbox" value="1" <?php checked( bbp_use_wp_editor( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_use_wp_editor' ); ?> />
683
+ <label for="_bbp_use_wp_editor"><?php esc_html_e( 'Add toolbar & buttons to textareas to help with HTML formatting', 'bbpress' ); ?></label>
684
 
685
  <?php
686
  }
693
  function bbp_admin_setting_callback_subtheme_section() {
694
  ?>
695
 
696
+ <p><?php esc_html_e( 'How your forum content is displayed within your existing theme.', 'bbpress' ); ?></p>
697
 
698
  <?php
699
  }
717
  //
718
  // @see bbPress::register_theme_packages()
719
  foreach ( (array) bbpress()->theme_compat->packages as $id => $theme ) {
720
+ $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>';
721
  }
722
 
723
  if ( !empty( $theme_options ) ) : ?>
724
 
725
  <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select>
726
+ <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
727
 
728
  <?php else : ?>
729
 
730
+ <p><?php esc_html_e( 'No template packages available.', 'bbpress' ); ?></p>
731
 
732
  <?php endif;
733
  }
742
  function bbp_admin_setting_callback_use_autoembed() {
743
  ?>
744
 
745
+ <input name="_bbp_use_autoembed" id="_bbp_use_autoembed" type="checkbox" value="1" <?php checked( bbp_use_autoembed( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_use_autoembed' ); ?> />
746
+ <label for="_bbp_use_autoembed"><?php esc_html_e( 'Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and replies', 'bbpress' ); ?></label>
747
 
748
  <?php
749
  }
758
  function bbp_admin_setting_callback_per_page_section() {
759
  ?>
760
 
761
+ <p><?php esc_html_e( 'How many topics and replies to show per page', 'bbpress' ); ?></p>
762
 
763
  <?php
764
  }
773
  function bbp_admin_setting_callback_topics_per_page() {
774
  ?>
775
 
776
+ <input name="_bbp_topics_per_page" id="_bbp_topics_per_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_topics_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_page' ); ?> />
777
+ <label for="_bbp_topics_per_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
778
 
779
  <?php
780
  }
789
  function bbp_admin_setting_callback_replies_per_page() {
790
  ?>
791
 
792
+ <input name="_bbp_replies_per_page" id="_bbp_replies_per_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_replies_per_page', '15' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_page' ); ?> />
793
+ <label for="_bbp_replies_per_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
794
 
795
  <?php
796
  }
805
  function bbp_admin_setting_callback_per_rss_page_section() {
806
  ?>
807
 
808
+ <p><?php esc_html_e( 'How many topics and replies to show per RSS page', 'bbpress' ); ?></p>
809
 
810
  <?php
811
  }
820
  function bbp_admin_setting_callback_topics_per_rss_page() {
821
  ?>
822
 
823
+ <input name="_bbp_topics_per_rss_page" id="_bbp_topics_per_rss_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_topics_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_topics_per_rss_page' ); ?> />
824
+ <label for="_bbp_topics_per_rss_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
825
 
826
  <?php
827
  }
836
  function bbp_admin_setting_callback_replies_per_rss_page() {
837
  ?>
838
 
839
+ <input name="_bbp_replies_per_rss_page" id="_bbp_replies_per_rss_page" type="number" min="1" step="1" value="<?php bbp_form_option( '_bbp_replies_per_rss_page', '25' ); ?>" class="small-text"<?php bbp_maybe_admin_setting_disabled( '_bbp_replies_per_rss_page' ); ?> />
840
+ <label for="_bbp_replies_per_rss_page"><?php esc_html_e( 'per page', 'bbpress' ); ?></label>
841
 
842
  <?php
843
  }
855
  if ( isset( $_GET['settings-updated'] ) && isset( $_GET['page'] ) )
856
  flush_rewrite_rules(); ?>
857
 
858
+ <p><?php esc_html_e( 'Customize your Forums root. Partner with a WordPress Page and use Shortcodes for more flexibility.', 'bbpress' ); ?></p>
859
 
860
  <?php
861
  }
870
  function bbp_admin_setting_callback_root_slug() {
871
  ?>
872
 
873
+ <input name="_bbp_root_slug" id="_bbp_root_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_root_slug', 'forums', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_root_slug' ); ?> />
874
 
875
  <?php
876
  // Slug Check
877
  bbp_form_slug_conflict_check( '_bbp_root_slug', 'forums' );
878
  }
879
 
880
+ /**
881
+ * Include root slug setting field
882
+ *
883
+ * @since bbPress (r2786)
884
+ *
885
+ * @uses checked() To display the checked attribute
886
+ */
887
+ function bbp_admin_setting_callback_include_root() {
888
+ ?>
889
+
890
+ <input name="_bbp_include_root" id="_bbp_include_root" type="checkbox" value="1" <?php checked( bbp_include_root_slug() ); bbp_maybe_admin_setting_disabled( '_bbp_include_root' ); ?> />
891
+ <label for="_bbp_include_root"><?php esc_html_e( 'Prefix all forum content with the Forum Root slug (Recommended)', 'bbpress' ); ?></label>
892
+
893
+ <?php
894
+ }
895
+
896
+ /**
897
+ * Include root slug setting field
898
+ *
899
+ * @since bbPress (r2786)
900
+ *
901
+ * @uses checked() To display the checked attribute
902
+ */
903
+ function bbp_admin_setting_callback_show_on_root() {
904
+
905
+ // Current setting
906
+ $show_on_root = bbp_show_on_root();
907
+
908
+ // Options for forum root output
909
+ $root_options = array(
910
+ 'forums' => array(
911
+ 'name' => __( 'Forum Index', 'bbpress' )
912
+ ),
913
+ 'topics' => array(
914
+ 'name' => __( 'Topics by Freshness', 'bbpress' )
915
+ )
916
+ ); ?>
917
+
918
+ <select name="_bbp_show_on_root" id="_bbp_show_on_root" <?php bbp_maybe_admin_setting_disabled( '_bbp_show_on_root' ); ?>>
919
+
920
+ <?php foreach ( $root_options as $option_id => $details ) : ?>
921
+
922
+ <option <?php selected( $show_on_root, $option_id ); ?> value="<?php echo esc_attr( $option_id ); ?>"><?php echo esc_html( $details['name'] ); ?></option>
923
+
924
+ <?php endforeach; ?>
925
+
926
+ </select>
927
+
928
+ <?php
929
+ }
930
+
931
+ /** User Slug Section *********************************************************/
932
+
933
+ /**
934
+ * Slugs settings section description for the settings page
935
+ *
936
+ * @since bbPress (r2786)
937
+ */
938
+ function bbp_admin_setting_callback_user_slug_section() {
939
+ ?>
940
+
941
+ <p><?php esc_html_e( 'Customize your user profile slugs.', 'bbpress' ); ?></p>
942
+
943
+ <?php
944
+ }
945
+
946
+ /**
947
+ * User slug setting field
948
+ *
949
+ * @since bbPress (r2786)
950
+ *
951
+ * @uses bbp_form_option() To output the option value
952
+ */
953
+ function bbp_admin_setting_callback_user_slug() {
954
+ ?>
955
+
956
+ <input name="_bbp_user_slug" id="_bbp_user_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_user_slug', 'users', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_user_slug' ); ?> />
957
+
958
+ <?php
959
+ // Slug Check
960
+ bbp_form_slug_conflict_check( '_bbp_user_slug', 'users' );
961
+ }
962
+
963
  /**
964
  * Topic archive slug setting field
965
  *
970
  function bbp_admin_setting_callback_topic_archive_slug() {
971
  ?>
972
 
973
+ <input name="_bbp_topic_archive_slug" id="_bbp_topic_archive_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_topic_archive_slug', 'topics', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_topic_archive_slug' ); ?> />
974
 
975
  <?php
976
  // Slug Check
977
  bbp_form_slug_conflict_check( '_bbp_topic_archive_slug', 'topics' );
978
  }
979
 
980
+ /**
981
+ * Reply archive slug setting field
982
+ *
983
+ * @since bbPress (r4932)
984
+ *
985
+ * @uses bbp_form_option() To output the option value
986
+ */
987
+ function bbp_admin_setting_callback_reply_archive_slug() {
988
+ ?>
989
+
990
+ <input name="_bbp_reply_archive_slug" id="_bbp_reply_archive_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_reply_archive_slug', 'replies', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_reply_archive_slug' ); ?> />
991
+
992
+ <?php
993
+ // Slug Check
994
+ bbp_form_slug_conflict_check( '_bbp_reply_archive_slug', 'replies' );
995
+ }
996
 
997
  /**
998
+ * Favorites slug setting field
999
  *
1000
+ * @since bbPress (r4932)
1001
+ *
1002
+ * @uses bbp_form_option() To output the option value
1003
  */
1004
+ function bbp_admin_setting_callback_user_favs_slug() {
1005
  ?>
1006
 
1007
+ <input name="_bbp_user_favs_slug" id="_bbp_user_favs_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_user_favs_slug', 'favorites', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_user_favs_slug' ); ?> />
1008
 
1009
  <?php
1010
+ // Slug Check
1011
+ bbp_form_slug_conflict_check( '_bbp_reply_archive_slug', 'favorites' );
1012
  }
1013
 
1014
  /**
1015
+ * Favorites slug setting field
1016
  *
1017
+ * @since bbPress (r4932)
1018
  *
1019
+ * @uses bbp_form_option() To output the option value
1020
  */
1021
+ function bbp_admin_setting_callback_user_subs_slug() {
1022
+ ?>
1023
+
1024
+ <input name="_bbp_user_subs_slug" id="_bbp_user_subs_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_user_subs_slug', 'subscriptions', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_user_subs_slug' ); ?> />
1025
+
1026
+ <?php
1027
+ // Slug Check
1028
+ bbp_form_slug_conflict_check( '_bbp_user_subs_slug', 'subscriptions' );
1029
+ }
1030
+
1031
+ /** Single Slugs **************************************************************/
1032
+
1033
+ /**
1034
+ * Slugs settings section description for the settings page
1035
+ *
1036
+ * @since bbPress (r2786)
1037
+ */
1038
+ function bbp_admin_setting_callback_single_slug_section() {
1039
  ?>
1040
 
1041
+ <p><?php printf( esc_html__( 'Custom slugs for single forums, topics, replies, tags, views, and search.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
 
1042
 
1043
  <?php
1044
  }
1053
  function bbp_admin_setting_callback_forum_slug() {
1054
  ?>
1055
 
1056
+ <input name="_bbp_forum_slug" id="_bbp_forum_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_forum_slug', 'forum', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_forum_slug' ); ?> />
1057
 
1058
  <?php
1059
  // Slug Check
1070
  function bbp_admin_setting_callback_topic_slug() {
1071
  ?>
1072
 
1073
+ <input name="_bbp_topic_slug" id="_bbp_topic_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_topic_slug', 'topic', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_topic_slug' ); ?> />
1074
 
1075
  <?php
1076
  // Slug Check
1087
  function bbp_admin_setting_callback_reply_slug() {
1088
  ?>
1089
 
1090
+ <input name="_bbp_reply_slug" id="_bbp_reply_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_reply_slug', 'reply', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_reply_slug' ); ?> />
1091
 
1092
  <?php
1093
  // Slug Check
1104
  function bbp_admin_setting_callback_topic_tag_slug() {
1105
  ?>
1106
 
1107
+ <input name="_bbp_topic_tag_slug" id="_bbp_topic_tag_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_topic_tag_slug', 'topic-tag', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_topic_tag_slug' ); ?> />
1108
 
1109
  <?php
1110
 
1112
  bbp_form_slug_conflict_check( '_bbp_topic_tag_slug', 'topic-tag' );
1113
  }
1114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1115
  /**
1116
  * View slug setting field
1117
  *
1122
  function bbp_admin_setting_callback_view_slug() {
1123
  ?>
1124
 
1125
+ <input name="_bbp_view_slug" id="_bbp_view_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_view_slug', 'view', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_view_slug' ); ?> />
1126
 
1127
  <?php
1128
  // Slug Check
1139
  function bbp_admin_setting_callback_search_slug() {
1140
  ?>
1141
 
1142
+ <input name="_bbp_search_slug" id="_bbp_search_slug" type="text" class="regular-text code" value="<?php bbp_form_option( '_bbp_search_slug', 'search', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_search_slug' ); ?> />
1143
 
1144
  <?php
1145
  // Slug Check
1156
  function bbp_admin_setting_callback_buddypress_section() {
1157
  ?>
1158
 
1159
+ <p><?php esc_html_e( 'Forum settings for BuddyPress', 'bbpress' ); ?></p>
1160
 
1161
  <?php
1162
  }
1171
  function bbp_admin_setting_callback_group_forums() {
1172
  ?>
1173
 
1174
+ <input name="_bbp_enable_group_forums" id="_bbp_enable_group_forums" type="checkbox" value="1" <?php checked( bbp_is_group_forums_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_group_forums' ); ?> />
1175
+ <label for="_bbp_enable_group_forums"><?php esc_html_e( 'Allow BuddyPress Groups to have their own forums', 'bbpress' ); ?></label>
1176
 
1177
  <?php
1178
  }
1197
  'disabled' => '_bbp_group_forums_root_id'
1198
  ) ); ?>
1199
 
1200
+ <label for="_bbp_group_forums_root_id"><?php esc_html_e( 'is the parent for all group forums', 'bbpress' ); ?></label>
1201
+ <p class="description"><?php esc_html_e( 'Using the Forum Root is not recommended. Changing this does not move existing forums.', 'bbpress' ); ?></p>
1202
 
1203
  <?php
1204
  }
1213
  function bbp_admin_setting_callback_akismet_section() {
1214
  ?>
1215
 
1216
+ <p><?php esc_html_e( 'Forum settings for Akismet', 'bbpress' ); ?></p>
1217
 
1218
  <?php
1219
  }
1229
  function bbp_admin_setting_callback_akismet() {
1230
  ?>
1231
 
1232
+ <input name="_bbp_enable_akismet" id="_bbp_enable_akismet" type="checkbox" value="1" <?php checked( bbp_is_akismet_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_akismet' ); ?> />
1233
+ <label for="_bbp_enable_akismet"><?php esc_html_e( 'Allow Akismet to actively prevent forum spam.', 'bbpress' ); ?></label>
1234
 
1235
  <?php
1236
  }
1253
 
1254
  <?php screen_icon(); ?>
1255
 
1256
+ <h2><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h2>
1257
 
1258
  <form action="options.php" method="post">
1259
 
1281
  function bbp_converter_setting_callback_main_section() {
1282
  ?>
1283
 
1284
+ <p><?php esc_html_e( 'Information about your previous forums database so that they can be converted. <strong>Backup your database before proceeding.</strong>', 'bbpress' ); ?></p>
1285
 
1286
  <?php
1287
  }
1304
  while ( $file = readdir( $curdir ) ) {
1305
  if ( ( stristr( $file, '.php' ) ) && ( stristr( $file, 'index' ) === false ) ) {
1306
  $file = preg_replace( '/.php/', '', $file );
1307
+ $platform_options .= '<option value="' . $file . '">' . esc_html( $file ) . '</option>';
1308
  }
1309
  }
1310
 
1311
  closedir( $curdir ); ?>
1312
 
1313
  <select name="_bbp_converter_platform" id="_bbp_converter_platform" /><?php echo $platform_options ?></select>
1314
+ <label for="_bbp_converter_platform"><?php esc_html_e( 'is the previous forum software', 'bbpress' ); ?></label>
1315
 
1316
  <?php
1317
  }
1324
  function bbp_converter_setting_callback_dbserver() {
1325
  ?>
1326
 
1327
+ <input name="_bbp_converter_db_server" id="_bbp_converter_db_server" type="text" value="<?php bbp_form_option( '_bbp_converter_db_server', 'localhost' ); ?>" class="medium-text" />
1328
+ <label for="_bbp_converter_db_server"><?php esc_html_e( 'IP or hostname', 'bbpress' ); ?></label>
1329
 
1330
  <?php
1331
  }
1338
  function bbp_converter_setting_callback_dbport() {
1339
  ?>
1340
 
1341
+ <input name="_bbp_converter_db_port" id="_bbp_converter_db_port" type="text" value="<?php bbp_form_option( '_bbp_converter_db_port', '3306' ); ?>" class="small-text" />
1342
+ <label for="_bbp_converter_db_port"><?php esc_html_e( 'Use default 3306 if unsure', 'bbpress' ); ?></label>
1343
 
1344
  <?php
1345
  }
1352
  function bbp_converter_setting_callback_dbuser() {
1353
  ?>
1354
 
1355
+ <input name="_bbp_converter_db_user" id="_bbp_converter_db_user" type="text" value="<?php bbp_form_option( '_bbp_converter_db_user' ); ?>" class="medium-text" />
1356
+ <label for="_bbp_converter_db_user"><?php esc_html_e( 'User for your database connection', 'bbpress' ); ?></label>
1357
 
1358
  <?php
1359
  }
1366
  function bbp_converter_setting_callback_dbpass() {
1367
  ?>
1368
 
1369
+ <input name="_bbp_converter_db_pass" id="_bbp_converter_db_pass" type="password" value="<?php bbp_form_option( '_bbp_converter_db_pass' ); ?>" class="medium-text" />
1370
+ <label for="_bbp_converter_db_pass"><?php esc_html_e( 'Password to access the database', 'bbpress' ); ?></label>
1371
 
1372
  <?php
1373
  }
1380
  function bbp_converter_setting_callback_dbname() {
1381
  ?>
1382
 
1383
+ <input name="_bbp_converter_db_name" id="_bbp_converter_db_name" type="text" value="<?php bbp_form_option( '_bbp_converter_db_name' ); ?>" class="medium-text" />
1384
+ <label for="_bbp_converter_db_name"><?php esc_html_e( 'Name of the database with your old forum data', 'bbpress' ); ?></label>
1385
 
1386
  <?php
1387
  }
1394
  function bbp_converter_setting_callback_options_section() {
1395
  ?>
1396
 
1397
+ <p><?php esc_html_e( 'Some optional parameters to help tune the conversion process.', 'bbpress' ); ?></p>
1398
 
1399
  <?php
1400
  }
1407
  function bbp_converter_setting_callback_dbprefix() {
1408
  ?>
1409
 
1410
+ <input name="_bbp_converter_db_prefix" id="_bbp_converter_db_prefix" type="text" value="<?php bbp_form_option( '_bbp_converter_db_prefix' ); ?>" class="medium-text" />
1411
+ <label for="_bbp_converter_db_prefix"><?php esc_html_e( '(If converting from BuddyPress Forums, use "wp_bb_" or your custom prefix)', 'bbpress' ); ?></label>
1412
 
1413
  <?php
1414
  }
1421
  function bbp_converter_setting_callback_rows() {
1422
  ?>
1423
 
1424
+ <input name="_bbp_converter_rows" id="_bbp_converter_rows" type="text" value="<?php bbp_form_option( '_bbp_converter_rows', '100' ); ?>" class="small-text" />
1425
+ <label for="_bbp_converter_rows"><?php esc_html_e( 'rows to process at a time', 'bbpress' ); ?></label>
1426
+ <p class="description"><?php esc_html_e( 'Keep this low if you experience out-of-memory issues.', 'bbpress' ); ?></p>
1427
 
1428
  <?php
1429
  }
1436
  function bbp_converter_setting_callback_delay_time() {
1437
  ?>
1438
 
1439
+ <input name="_bbp_converter_delay_time" id="_bbp_converter_delay_time" type="text" value="<?php bbp_form_option( '_bbp_converter_delay_time', '1' ); ?>" class="small-text" />
1440
+ <label for="_bbp_converter_delay_time"><?php esc_html_e( 'second(s) delay between each group of rows', 'bbpress' ); ?></label>
1441
+ <p class="description"><?php esc_html_e( 'Keep this high to prevent too-many-connection issues.', 'bbpress' ); ?></p>
1442
 
1443
  <?php
1444
  }
1451
  function bbp_converter_setting_callback_restart() {
1452
  ?>
1453
 
1454
+ <input name="_bbp_converter_restart" id="_bbp_converter_restart" type="checkbox" value="1" <?php checked( get_option( '_bbp_converter_restart', false ) ); ?> />
1455
+ <label for="_bbp_converter_restart"><?php esc_html_e( 'Start a fresh conversion from the beginning', 'bbpress' ); ?></label>
1456
+ <p class="description"><?php esc_html_e( 'You should clean old conversion information before starting over.', 'bbpress' ); ?></p>
1457
 
1458
  <?php
1459
  }
1466
  function bbp_converter_setting_callback_clean() {
1467
  ?>
1468
 
1469
+ <input name="_bbp_converter_clean" id="_bbp_converter_clean" type="checkbox" value="1" <?php checked( get_option( '_bbp_converter_clean', false ) ); ?> />
1470
+ <label for="_bbp_converter_clean"><?php esc_html_e( 'Purge all information from a previously attempted import', 'bbpress' ); ?></label>
1471
+ <p class="description"><?php esc_html_e( 'Use this if an import failed and you want to remove that incomplete data.', 'bbpress' ); ?></p>
1472
 
1473
  <?php
1474
  }
1481
  function bbp_converter_setting_callback_convert_users() {
1482
  ?>
1483
 
1484
+ <input name="_bbp_converter_convert_users" id="_bbp_converter_convert_users" type="checkbox" value="1" <?php checked( get_option( '_bbp_converter_convert_users', false ) ); ?> />
1485
+ <label for="_bbp_converter_convert_users"><?php esc_html_e( 'Attempt to import user accounts from previous forums', 'bbpress' ); ?></label>
1486
+ <p class="description"><?php esc_html_e( 'Non-bbPress passwords cannot be automatically converted. They will be converted as each user logs in.', 'bbpress' ); ?></p>
1487
 
1488
  <?php
1489
  }
1504
 
1505
  <?php screen_icon( 'tools' ); ?>
1506
 
1507
+ <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( esc_html__( 'Import Forums', 'bbpress' ) ); ?></h2>
1508
 
1509
  <form action="#" method="post" id="bbp-converter-settings">
1510
 
1513
  <?php do_settings_sections( 'bbpress_converter' ); ?>
1514
 
1515
  <p class="submit">
1516
+ <input type="button" name="submit" class="button-primary" id="bbp-converter-start" value="<?php esc_attr_e( 'Start', 'bbpress' ); ?>" onclick="bbconverter_start();" />
1517
+ <input type="button" name="submit" class="button-primary" id="bbp-converter-stop" value="<?php esc_attr_e( 'Stop', 'bbpress' ); ?>" onclick="bbconverter_stop();" />
1518
  <img id="bbp-converter-progress" src="">
1519
  </p>
1520
 
1742
  }
1743
 
1744
  // Loop through slugs to check
1745
+ foreach ( $the_core_slugs as $key => $value ) {
1746
 
1747
  // Get the slug
1748
  $slug_check = bbp_get_form_option( $key, $value['default'], true );
1749
 
1750
  // Compare
1751
+ if ( ( $slug !== $key ) && ( $slug_check === $this_slug ) ) : ?>
1752
 
1753
+ <span class="attention"><?php printf( esc_html__( 'Possible %1$s conflict: %2$s', 'bbpress' ), $value['context'], '<strong>' . $value['name'] . '</strong>' ); ?></span>
1754
 
1755
  <?php endif;
1756
  }
includes/admin/tools.php CHANGED
@@ -33,17 +33,17 @@ function bbp_admin_repair() {
33
 
34
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Repair Forums', 'bbpress' ) ); ?></h2>
35
 
36
- <p><?php _e( 'bbPress keeps track of relationships between forums, topics, replies, and topic tags, and users. Occasionally these relationships become out of sync, most often after an import or migration. Use the tools below to manually recalculate these relationships.', 'bbpress' ); ?></p>
37
- <p class="description"><?php _e( 'Some of these tools create substantial database overhead. Avoid running more than 1 repair job at a time.', 'bbpress' ); ?></p>
38
 
39
  <form class="settings" method="post" action="">
40
  <table class="form-table">
41
  <tbody>
42
  <tr valign="top">
43
- <th scope="row"><?php _e( 'Relationships to Repair:', 'bbpress' ) ?></th>
44
  <td>
45
  <fieldset>
46
- <legend class="screen-reader-text"><span><?php _e( 'Repair', 'bbpress' ) ?></span></legend>
47
 
48
  <?php foreach ( bbp_admin_repair_list() as $item ) : ?>
49
 
@@ -90,7 +90,7 @@ function bbp_admin_repair_handler() {
90
  wp_cache_flush();
91
 
92
  foreach ( (array) bbp_admin_repair_list() as $item ) {
93
- if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 == $_POST[$item[0]] && is_callable( $item[2] ) ) {
94
  $messages[] = call_user_func( $item[2] );
95
  }
96
  }
@@ -130,7 +130,7 @@ function bbp_admin_tools_feedback( $message, $class = false ) {
130
  break;
131
 
132
  default:
133
- $message = '<ul>' . "\n\t" . '<li>' . join( '</li>' . "\n\t" . '<li>', $errors ) . '</li>' . "\n" . '</ul>';
134
  break;
135
  }
136
 
@@ -285,7 +285,7 @@ function bbp_admin_repair_topic_hidden_reply_count() {
285
  if ( is_wp_error( $wpdb->query( $sql_delete ) ) )
286
  return array( 1, sprintf( $statement, $result ) );
287
 
288
- $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . join( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);";
289
  if ( is_wp_error( $wpdb->query( $sql ) ) )
290
  return array( 2, sprintf( $statement, $result ) );
291
 
@@ -401,7 +401,7 @@ function bbp_admin_repair_group_forum_relationship() {
401
  if ( ! empty( $posts ) ) {
402
 
403
  // Rename 'Default Forum' since it's now visible in sitewide forums
404
- if ( 'Default Forum' == $posts[0]->post_title ) {
405
  wp_update_post( array(
406
  'ID' => $posts[0]->ID,
407
  'post_title' => __( 'Group Forums', 'bbpress' ),
@@ -449,7 +449,7 @@ function bbp_admin_repair_forum_topic_count() {
449
 
450
  $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
451
  if ( !empty( $forums ) ) {
452
- foreach( $forums as $forum ) {
453
  bbp_update_forum_topic_count( $forum->ID );
454
  }
455
  } else {
@@ -483,7 +483,7 @@ function bbp_admin_repair_forum_reply_count() {
483
 
484
  $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
485
  if ( !empty( $forums ) ) {
486
- foreach( $forums as $forum ) {
487
  bbp_update_forum_reply_count( $forum->ID );
488
  }
489
  } else {
@@ -527,7 +527,7 @@ function bbp_admin_repair_user_topic_count() {
527
  return array( 3, sprintf( $statement, $result ) );
528
 
529
  foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) {
530
- $chunk = "\n" . join( ",\n", $chunk );
531
  $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
532
 
533
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
@@ -572,7 +572,7 @@ function bbp_admin_repair_user_reply_count() {
572
  return array( 3, sprintf( $statement, $result ) );
573
 
574
  foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) {
575
- $chunk = "\n" . join( ",\n", $chunk );
576
  $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
577
 
578
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
@@ -614,11 +614,11 @@ function bbp_admin_repair_user_favorites() {
614
  if ( empty( $user->favorites ) || !is_string( $user->favorites ) )
615
  continue;
616
 
617
- $favorites = array_intersect( $topics, (array) explode( ',', $user->favorites ) );
618
  if ( empty( $favorites ) || !is_array( $favorites ) )
619
  continue;
620
 
621
- $favorites_joined = join( ',', $favorites );
622
  $values[] = "('{$user->user_id}', '{$key}, '{$favorites_joined}')";
623
 
624
  // Cleanup
@@ -635,7 +635,7 @@ function bbp_admin_repair_user_favorites() {
635
  return array( 4, sprintf( $statement, $result ) );
636
 
637
  foreach ( array_chunk( $values, 10000 ) as $chunk ) {
638
- $chunk = "\n" . join( ",\n", $chunk );
639
  $sql_insert = "INSERT INTO `$wpdb->usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
640
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
641
  return array( 5, sprintf( $statement, $result ) );
@@ -675,11 +675,11 @@ function bbp_admin_repair_user_subscriptions() {
675
  if ( empty( $user->subscriptions ) || !is_string( $user->subscriptions ) )
676
  continue;
677
 
678
- $subscriptions = array_intersect( $topics, (array) explode( ',', $user->subscriptions ) );
679
  if ( empty( $subscriptions ) || !is_array( $subscriptions ) )
680
  continue;
681
 
682
- $subscriptions_joined = join( ',', $subscriptions );
683
  $values[] = "('{$user->user_id}', '{$key}', '{$subscriptions_joined}')";
684
 
685
  // Cleanup
@@ -696,7 +696,7 @@ function bbp_admin_repair_user_subscriptions() {
696
  return array( 4, sprintf( $statement, $result ) );
697
 
698
  foreach ( array_chunk( $values, 10000 ) as $chunk ) {
699
- $chunk = "\n" . join( ",\n", $chunk );
700
  $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
701
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
702
  return array( 5, sprintf( $statement, $result ) );
@@ -730,7 +730,7 @@ function bbp_admin_repair_user_roles() {
730
  return array( 1, sprintf( $statement, __( 'Failed!', 'bbpress' ) ) );
731
 
732
  // Iterate through each role...
733
- foreach ( array_keys( get_editable_roles() ) as $role ) {
734
 
735
  // Reset the offset
736
  $offset = 0;
@@ -909,7 +909,7 @@ function bbp_admin_repair_sticky() {
909
 
910
  // If the topic is not a super sticky, and the forum ID does not
911
  // match the topic's forum ID, unset the forum's sticky meta.
912
- if ( ! bbp_is_topic_super_sticky( $topic_id ) && $forum_id != bbp_get_topic_forum_id( $topic_id ) ) {
913
  unset( $forum_stickies[$forum_id][$id] );
914
  }
915
  }
@@ -937,42 +937,16 @@ function bbp_admin_repair_sticky() {
937
  * @return array An array of the status code and the message
938
  */
939
  function bbp_admin_repair_forum_visibility() {
940
-
941
  $statement = __( 'Recalculating forum visibility &hellip; %s', 'bbpress' );
942
- $result = __( 'Failed!', 'bbpress' );
943
-
944
- // First, delete everything.
945
- delete_option( '_bbp_private_forums' );
946
- delete_option( '_bbp_hidden_forums' );
947
-
948
- // Next, get all the private and hidden forums
949
- $private_forums = new WP_Query( array(
950
- 'suppress_filters' => true,
951
- 'nopaging' => true,
952
- 'post_type' => bbp_get_forum_post_type(),
953
- 'post_status' => bbp_get_private_status_id(),
954
- 'fields' => 'ids'
955
- ) );
956
- $hidden_forums = new WP_Query( array(
957
- 'suppress_filters' => true,
958
- 'nopaging' => true,
959
- 'post_type' => bbp_get_forum_post_type(),
960
- 'post_status' => bbp_get_hidden_status_id(),
961
- 'fields' => 'ids'
962
- ) );
963
 
964
  // Bail if queries returned errors
965
- if ( is_wp_error( $private_forums ) || is_wp_error( $hidden_forums ) )
966
- return array( 2, sprintf( $statement, $result ) );
967
-
968
- update_option( '_bbp_private_forums', $private_forums->posts ); // Private forums
969
- update_option( '_bbp_hidden_forums', $hidden_forums->posts ); // Hidden forums
970
-
971
- // Reset the $post global
972
- wp_reset_postdata();
973
 
974
  // Complete results
975
- return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
 
 
976
  }
977
 
978
  /**
@@ -1094,31 +1068,31 @@ function bbp_admin_reset() {
1094
  <?php screen_icon( 'tools' ); ?>
1095
 
1096
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Reset Forums', 'bbpress' ) ); ?></h2>
1097
- <p><?php _e( 'This will revert your forums back to a brand new installation. This process cannot be undone. <strong>Backup your database before proceeding</strong>.', 'bbpress' ); ?></p>
1098
 
1099
  <form class="settings" method="post" action="">
1100
  <table class="form-table">
1101
  <tbody>
1102
  <tr valign="top">
1103
- <th scope="row"><?php _e( 'The following data will be removed:', 'bbpress' ) ?></th>
1104
  <td>
1105
- <?php _e( 'All Forums', 'bbpress' ); ?><br />
1106
- <?php _e( 'All Topics', 'bbpress' ); ?><br />
1107
- <?php _e( 'All Replies', 'bbpress' ); ?><br />
1108
- <?php _e( 'All Topic Tags', 'bbpress' ); ?><br />
1109
- <?php _e( 'Related Meta Data', 'bbpress' ); ?><br />
1110
- <?php _e( 'Forum Settings', 'bbpress' ); ?><br />
1111
- <?php _e( 'Forum Activity', 'bbpress' ); ?><br />
1112
- <?php _e( 'Forum User Roles', 'bbpress' ); ?><br />
1113
- <?php _e( 'Importer Helper Data', 'bbpress' ); ?><br />
1114
  </td>
1115
  </tr>
1116
  <tr valign="top">
1117
- <th scope="row"><?php _e( 'Are you sure you want to do this?', 'bbpress' ) ?></th>
1118
  <td>
1119
  <fieldset>
1120
- <legend class="screen-reader-text"><span><?php _e( "Say it ain't so!", 'bbpress' ) ?></span></legend>
1121
- <label><input type="checkbox" class="checkbox" name="bbpress-are-you-sure" id="bbpress-are-you-sure" value="1" /> <?php _e( 'This process cannot be undone.', 'bbpress' ); ?></label>
1122
  </fieldset>
1123
  </td>
1124
  </tr>
@@ -1177,7 +1151,7 @@ function bbp_admin_reset_handler() {
1177
  /** Post Meta *********************************************************/
1178
 
1179
  if ( !empty( $sql_posts ) ) {
1180
- foreach( $sql_posts as $key => $value ) {
1181
  $sql_meta[] = $key;
1182
  }
1183
  $statement = __( 'Deleting Post Meta&hellip; %s', 'bbpress' );
@@ -1205,7 +1179,7 @@ function bbp_admin_reset_handler() {
1205
 
1206
  $statement = __( 'Deleting Conversion Table&hellip; %s', 'bbpress' );
1207
  $table_name = $wpdb->prefix . 'bbp_converter_translator';
1208
- if ( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) {
1209
  $wpdb->query( "DROP TABLE {$table_name}" );
1210
  $result = $success;
1211
  } else {
33
 
34
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Repair Forums', 'bbpress' ) ); ?></h2>
35
 
36
+ <p><?php esc_html_e( 'bbPress keeps track of relationships between forums, topics, replies, and topic tags, and users. Occasionally these relationships become out of sync, most often after an import or migration. Use the tools below to manually recalculate these relationships.', 'bbpress' ); ?></p>
37
+ <p class="description"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than 1 repair job at a time.', 'bbpress' ); ?></p>
38
 
39
  <form class="settings" method="post" action="">
40
  <table class="form-table">
41
  <tbody>
42
  <tr valign="top">
43
+ <th scope="row"><?php esc_html_e( 'Relationships to Repair:', 'bbpress' ) ?></th>
44
  <td>
45
  <fieldset>
46
+ <legend class="screen-reader-text"><span><?php esc_html_e( 'Repair', 'bbpress' ) ?></span></legend>
47
 
48
  <?php foreach ( bbp_admin_repair_list() as $item ) : ?>
49
 
90
  wp_cache_flush();
91
 
92
  foreach ( (array) bbp_admin_repair_list() as $item ) {
93
+ if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === absint( $_POST[$item[0]] ) && is_callable( $item[2] ) ) {
94
  $messages[] = call_user_func( $item[2] );
95
  }
96
  }
130
  break;
131
 
132
  default:
133
+ $message = '<ul>' . "\n\t" . '<li>' . implode( '</li>' . "\n\t" . '<li>', $errors ) . '</li>' . "\n" . '</ul>';
134
  break;
135
  }
136
 
285
  if ( is_wp_error( $wpdb->query( $sql_delete ) ) )
286
  return array( 1, sprintf( $statement, $result ) );
287
 
288
+ $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);";
289
  if ( is_wp_error( $wpdb->query( $sql ) ) )
290
  return array( 2, sprintf( $statement, $result ) );
291
 
401
  if ( ! empty( $posts ) ) {
402
 
403
  // Rename 'Default Forum' since it's now visible in sitewide forums
404
+ if ( 'Default Forum' === $posts[0]->post_title ) {
405
  wp_update_post( array(
406
  'ID' => $posts[0]->ID,
407
  'post_title' => __( 'Group Forums', 'bbpress' ),
449
 
450
  $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
451
  if ( !empty( $forums ) ) {
452
+ foreach ( $forums as $forum ) {
453
  bbp_update_forum_topic_count( $forum->ID );
454
  }
455
  } else {
483
 
484
  $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
485
  if ( !empty( $forums ) ) {
486
+ foreach ( $forums as $forum ) {
487
  bbp_update_forum_reply_count( $forum->ID );
488
  }
489
  } else {
527
  return array( 3, sprintf( $statement, $result ) );
528
 
529
  foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) {
530
+ $chunk = "\n" . implode( ",\n", $chunk );
531
  $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
532
 
533
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
572
  return array( 3, sprintf( $statement, $result ) );
573
 
574
  foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) {
575
+ $chunk = "\n" . implode( ",\n", $chunk );
576
  $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
577
 
578
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
614
  if ( empty( $user->favorites ) || !is_string( $user->favorites ) )
615
  continue;
616
 
617
+ $favorites = array_intersect( $topics, explode( ',', $user->favorites ) );
618
  if ( empty( $favorites ) || !is_array( $favorites ) )
619
  continue;
620
 
621
+ $favorites_joined = implode( ',', $favorites );
622
  $values[] = "('{$user->user_id}', '{$key}, '{$favorites_joined}')";
623
 
624
  // Cleanup
635
  return array( 4, sprintf( $statement, $result ) );
636
 
637
  foreach ( array_chunk( $values, 10000 ) as $chunk ) {
638
+ $chunk = "\n" . implode( ",\n", $chunk );
639
  $sql_insert = "INSERT INTO `$wpdb->usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
640
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
641
  return array( 5, sprintf( $statement, $result ) );
675
  if ( empty( $user->subscriptions ) || !is_string( $user->subscriptions ) )
676
  continue;
677
 
678
+ $subscriptions = array_intersect( $topics, explode( ',', $user->subscriptions ) );
679
  if ( empty( $subscriptions ) || !is_array( $subscriptions ) )
680
  continue;
681
 
682
+ $subscriptions_joined = implode( ',', $subscriptions );
683
  $values[] = "('{$user->user_id}', '{$key}', '{$subscriptions_joined}')";
684
 
685
  // Cleanup
696
  return array( 4, sprintf( $statement, $result ) );
697
 
698
  foreach ( array_chunk( $values, 10000 ) as $chunk ) {
699
+ $chunk = "\n" . implode( ",\n", $chunk );
700
  $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
701
  if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
702
  return array( 5, sprintf( $statement, $result ) );
730
  return array( 1, sprintf( $statement, __( 'Failed!', 'bbpress' ) ) );
731
 
732
  // Iterate through each role...
733
+ foreach ( array_keys( bbp_get_blog_roles() ) as $role ) {
734
 
735
  // Reset the offset
736
  $offset = 0;
909
 
910
  // If the topic is not a super sticky, and the forum ID does not
911
  // match the topic's forum ID, unset the forum's sticky meta.
912
+ if ( ! bbp_is_topic_super_sticky( $topic_id ) && $forum_id !== bbp_get_topic_forum_id( $topic_id ) ) {
913
  unset( $forum_stickies[$forum_id][$id] );
914
  }
915
  }
937
  * @return array An array of the status code and the message
938
  */
939
  function bbp_admin_repair_forum_visibility() {
 
940
  $statement = __( 'Recalculating forum visibility &hellip; %s', 'bbpress' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
941
 
942
  // Bail if queries returned errors
943
+ if ( ! bbp_repair_forum_visibility() ) {
944
+ return array( 2, sprintf( $statement, __( 'Failed!', 'bbpress' ) ) );
 
 
 
 
 
 
945
 
946
  // Complete results
947
+ } else {
948
+ return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
949
+ }
950
  }
951
 
952
  /**
1068
  <?php screen_icon( 'tools' ); ?>
1069
 
1070
  <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Reset Forums', 'bbpress' ) ); ?></h2>
1071
+ <p><?php esc_html_e( 'This will revert your forums back to a brand new installation. This process cannot be undone. <strong>Backup your database before proceeding</strong>.', 'bbpress' ); ?></p>
1072
 
1073
  <form class="settings" method="post" action="">
1074
  <table class="form-table">
1075
  <tbody>
1076
  <tr valign="top">
1077
+ <th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ) ?></th>
1078
  <td>
1079
+ <?php esc_html_e( 'All Forums', 'bbpress' ); ?><br />
1080
+ <?php esc_html_e( 'All Topics', 'bbpress' ); ?><br />
1081
+ <?php esc_html_e( 'All Replies', 'bbpress' ); ?><br />
1082
+ <?php esc_html_e( 'All Topic Tags', 'bbpress' ); ?><br />
1083
+ <?php esc_html_e( 'Related Meta Data', 'bbpress' ); ?><br />
1084
+ <?php esc_html_e( 'Forum Settings', 'bbpress' ); ?><br />
1085
+ <?php esc_html_e( 'Forum Activity', 'bbpress' ); ?><br />
1086
+ <?php esc_html_e( 'Forum User Roles', 'bbpress' ); ?><br />
1087
+ <?php esc_html_e( 'Importer Helper Data', 'bbpress' ); ?><br />
1088
  </td>
1089
  </tr>
1090
  <tr valign="top">
1091
+ <th scope="row"><?php esc_html_e( 'Are you sure you want to do this?', 'bbpress' ) ?></th>
1092
  <td>
1093
  <fieldset>
1094
+ <legend class="screen-reader-text"><span><?php esc_html_e( "Say it ain't so!", 'bbpress' ) ?></span></legend>
1095
+ <label><input type="checkbox" class="checkbox" name="bbpress-are-you-sure" id="bbpress-are-you-sure" value="1" /> <?php esc_html_e( 'This process cannot be undone.', 'bbpress' ); ?></label>
1096
  </fieldset>
1097
  </td>
1098
  </tr>
1151
  /** Post Meta *********************************************************/
1152
 
1153
  if ( !empty( $sql_posts ) ) {
1154
+ foreach ( $sql_posts as $key => $value ) {
1155
  $sql_meta[] = $key;
1156
  }
1157
  $statement = __( 'Deleting Post Meta&hellip; %s', 'bbpress' );
1179
 
1180
  $statement = __( 'Deleting Conversion Table&hellip; %s', 'bbpress' );
1181
  $table_name = $wpdb->prefix . 'bbp_converter_translator';
1182
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) === $table_name ) {
1183
  $wpdb->query( "DROP TABLE {$table_name}" );
1184
  $result = $success;
1185
  } else {
includes/admin/topics.php CHANGED
@@ -64,11 +64,11 @@ class BBP_Topics_Admin {
64
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
65
 
66
  // Topic column headers.
67
- add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'topics_column_headers' ) );
68
 
69
  // Topic columns (in post row)
70
- add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'topics_column_data' ), 10, 2 );
71
- add_filter( 'post_row_actions', array( $this, 'topics_row_actions' ), 10, 2 );
72
 
73
  // Topic metabox actions
74
  add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
@@ -98,7 +98,7 @@ class BBP_Topics_Admin {
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;
@@ -209,11 +209,7 @@ class BBP_Topics_Admin {
209
 
210
  $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your topic in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a topic or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a topic to be published in the future or backdate a topic.', 'bbpress' ) . '</p>';
211
 
212
- if ( current_theme_supports( 'topic-formats' ) && topic_type_supports( 'topic', 'topic-formats' ) ) {
213
- $publish_box .= '<p>' . __( '<strong>topic Format</strong> - This designates how your theme will display a specific topic. For example, you could have a <em>standard</em> blog topic with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each topic format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
214
- }
215
-
216
- if ( current_theme_supports( 'topic-thumbnails' ) && topic_type_supports( 'topic', 'thumbnail' ) ) {
217
  $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your topic without inserting it. This is usually useful only if your theme makes use of the featured image as a topic thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
218
  }
219
 
@@ -234,14 +230,6 @@ class BBP_Topics_Admin {
234
  'content' => $publish_box,
235
  ) );
236
 
237
- get_current_screen()->add_help_tab( array(
238
- 'id' => 'discussion-settings',
239
- 'title' => __( 'Discussion Settings', 'bbpress' ),
240
- 'content' =>
241
- '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
242
- '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the topic, you can see them here and moderate them.', 'bbpress' ) . '</p>'
243
- ) );
244
-
245
  get_current_screen()->set_help_sidebar(
246
  '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
247
  '<p>' . __( '<a href="http://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
@@ -366,7 +354,7 @@ class BBP_Topics_Admin {
366
  if ( $this->bail() ) return;
367
 
368
  // Bail if post_type is not a topic
369
- if ( empty( $_GET['action'] ) || ( 'edit' != $_GET['action'] ) )
370
  return;
371
 
372
  // Add the metabox
@@ -504,8 +492,8 @@ class BBP_Topics_Admin {
504
  check_admin_referer( 'close-topic_' . $topic_id );
505
 
506
  $is_open = bbp_is_topic_open( $topic_id );
507
- $message = true == $is_open ? 'closed' : 'opened';
508
- $success = true == $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
509
 
510
  break;
511
 
@@ -513,10 +501,10 @@ class BBP_Topics_Admin {
513
  check_admin_referer( 'stick-topic_' . $topic_id );
514
 
515
  $is_sticky = bbp_is_topic_sticky( $topic_id );
516
- $is_super = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 == (int) $_GET['super'] ) ? true : false;
517
- $message = true == $is_sticky ? 'unsticked' : 'sticked';
518
- $message = true == $is_super ? 'super_sticked' : $message;
519
- $success = true == $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
520
 
521
  break;
522
 
@@ -524,15 +512,15 @@ class BBP_Topics_Admin {
524
  check_admin_referer( 'spam-topic_' . $topic_id );
525
 
526
  $is_spam = bbp_is_topic_spam( $topic_id );
527
- $message = true == $is_spam ? 'unspammed' : 'spammed';
528
- $success = true == $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
529
 
530
  break;
531
  }
532
 
533
  $message = array( 'bbp_topic_toggle_notice' => $message, 'topic_id' => $topic->ID );
534
 
535
- if ( false == $success || is_wp_error( $success ) )
536
  $message['failed'] = '1';
537
 
538
  // Do additional topic toggle actions (admin side)
@@ -580,35 +568,35 @@ class BBP_Topics_Admin {
580
  if ( empty( $topic ) )
581
  return;
582
 
583
- $topic_title = esc_html( bbp_get_topic_title( $topic->ID ) );
584
 
585
  switch ( $notice ) {
586
  case 'opened' :
587
- $message = $is_failure == true ? sprintf( __( 'There was a problem opening the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully opened.', 'bbpress' ), $topic_title );
588
  break;
589
 
590
  case 'closed' :
591
- $message = $is_failure == true ? sprintf( __( 'There was a problem closing the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully closed.', 'bbpress' ), $topic_title );
592
  break;
593
 
594
  case 'super_sticked' :
595
- $message = $is_failure == true ? sprintf( __( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked to front.', 'bbpress' ), $topic_title );
596
  break;
597
 
598
  case 'sticked' :
599
- $message = $is_failure == true ? sprintf( __( 'There was a problem sticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked.', 'bbpress' ), $topic_title );
600
  break;
601
 
602
  case 'unsticked' :
603
- $message = $is_failure == true ? sprintf( __( 'There was a problem unsticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unsticked.', 'bbpress' ), $topic_title );
604
  break;
605
 
606
  case 'spammed' :
607
- $message = $is_failure == true ? sprintf( __( 'There was a problem marking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully marked as spam.', 'bbpress' ), $topic_title );
608
  break;
609
 
610
  case 'unspammed' :
611
- $message = $is_failure == true ? sprintf( __( 'There was a problem unmarking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unmarked as spam.', 'bbpress' ), $topic_title );
612
  break;
613
  }
614
 
@@ -617,8 +605,8 @@ class BBP_Topics_Admin {
617
 
618
  ?>
619
 
620
- <div id="message" class="<?php echo $is_failure == true ? 'error' : 'updated'; ?> fade">
621
- <p style="line-height: 150%"><?php echo $message; ?></p>
622
  </div>
623
 
624
  <?php
@@ -635,7 +623,7 @@ class BBP_Topics_Admin {
635
  * the columns
636
  * @return array $columns bbPress topic columns
637
  */
638
- public function topics_column_headers( $columns ) {
639
 
640
  if ( $this->bail() ) return $columns;
641
 
@@ -678,7 +666,7 @@ class BBP_Topics_Admin {
678
  * @uses do_action() Calls 'bbp_admin_topics_column_data' with the
679
  * column and topic id
680
  */
681
- function topics_column_data( $column, $topic_id ) {
682
 
683
  if ( $this->bail() ) return;
684
 
@@ -697,14 +685,14 @@ class BBP_Topics_Admin {
697
  // Forum Title
698
  $forum_title = bbp_get_forum_title( $forum_id );
699
  if ( empty( $forum_title ) ) {
700
- $forum_title = __( 'No Forum', 'bbpress' );
701
  }
702
 
703
  // Output the title
704
  echo $forum_title;
705
 
706
  } else {
707
- _e( '(No Forum)', 'bbpress' );
708
  }
709
 
710
  break;
@@ -726,7 +714,7 @@ class BBP_Topics_Admin {
726
 
727
  // Freshness
728
  case 'bbp_topic_created':
729
- printf( __( '%1$s <br /> %2$s', 'bbpress' ),
730
  get_the_date(),
731
  esc_attr( get_the_time() )
732
  );
@@ -737,9 +725,9 @@ class BBP_Topics_Admin {
737
  case 'bbp_topic_freshness' :
738
  $last_active = bbp_get_topic_last_active_time( $topic_id, false );
739
  if ( !empty( $last_active ) ) {
740
- echo $last_active;
741
  } else {
742
- _e( 'No Replies', 'bbpress' ); // This should never happen
743
  }
744
 
745
  break;
@@ -778,15 +766,15 @@ class BBP_Topics_Admin {
778
  * @uses get_delete_post_link() To get the delete post link of the topic
779
  * @return array $actions Actions
780
  */
781
- public function topics_row_actions( $actions, $topic ) {
782
 
783
  if ( $this->bail() ) return $actions;
784
 
785
  unset( $actions['inline hide-if-no-js'] );
786
 
787
  // Show view link if it's not set, the topic is trashed and the user can view trashed topics
788
- if ( empty( $actions['view'] ) && ( bbp_get_trash_status_id() == $topic->post_status ) && current_user_can( 'view_trash' ) )
789
- $actions['view'] = '<a href="' . bbp_get_topic_permalink( $topic->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_topic_title( $topic->ID ) ) ) . '" rel="permalink">' . __( 'View', 'bbpress' ) . '</a>';
790
 
791
  // Only show the actions if the user is capable of viewing them :)
792
  if ( current_user_can( 'moderate', $topic->ID ) ) {
@@ -794,47 +782,47 @@ class BBP_Topics_Admin {
794
  // Close
795
  // Show the 'close' and 'open' link on published and closed posts only
796
  if ( in_array( $topic->post_status, array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ) ) {
797
- $close_uri = esc_url( wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_close' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'close-topic_' . $topic->ID ) );
798
  if ( bbp_is_topic_open( $topic->ID ) )
799
- $actions['closed'] = '<a href="' . $close_uri . '" title="' . esc_attr__( 'Close this topic', 'bbpress' ) . '">' . _x( 'Close', 'Close a Topic', 'bbpress' ) . '</a>';
800
  else
801
- $actions['closed'] = '<a href="' . $close_uri . '" title="' . esc_attr__( 'Open this topic', 'bbpress' ) . '">' . _x( 'Open', 'Open a Topic', 'bbpress' ) . '</a>';
802
  }
803
 
804
  // Dont show sticky if topic links is spam or trash
805
  if ( !bbp_is_topic_spam( $topic->ID ) && !bbp_is_topic_trash( $topic->ID ) ) {
806
 
807
  // Sticky
808
- $stick_uri = esc_url( wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_stick' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'stick-topic_' . $topic->ID ) );
809
  if ( bbp_is_topic_sticky( $topic->ID ) ) {
810
- $actions['stick'] = '<a href="' . $stick_uri . '" title="' . esc_attr__( 'Unstick this topic', 'bbpress' ) . '">' . __( 'Unstick', 'bbpress' ) . '</a>';
811
  } else {
812
- $super_uri = esc_url( wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_stick', 'super' => '1' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'stick-topic_' . $topic->ID ) );
813
- $actions['stick'] = '<a href="' . $stick_uri . '" title="' . esc_attr__( 'Stick this topic to its forum', 'bbpress' ) . '">' . __( 'Stick', 'bbpress' ) . '</a> (<a href="' . $super_uri . '" title="' . esc_attr__( 'Stick this topic to front', 'bbpress' ) . '">' . __( 'to front', 'bbpress' ) . '</a>)';
814
  }
815
  }
816
 
817
  // Spam
818
- $spam_uri = esc_url( wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_spam' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'spam-topic_' . $topic->ID ) );
819
  if ( bbp_is_topic_spam( $topic->ID ) )
820
- $actions['spam'] = '<a href="' . $spam_uri . '" title="' . esc_attr__( 'Mark the topic as not spam', 'bbpress' ) . '">' . __( 'Not spam', 'bbpress' ) . '</a>';
821
  else
822
- $actions['spam'] = '<a href="' . $spam_uri . '" title="' . esc_attr__( 'Mark this topic as spam', 'bbpress' ) . '">' . __( 'Spam', 'bbpress' ) . '</a>';
823
 
824
  }
825
 
826
  // Do not show trash links for spam topics, or spam links for trashed topics
827
  if ( current_user_can( 'delete_topic', $topic->ID ) ) {
828
- if ( bbp_get_trash_status_id() == $topic->post_status ) {
829
  $post_type_object = get_post_type_object( bbp_get_topic_post_type() );
830
- $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) . "'>" . __( 'Restore', 'bbpress' ) . "</a>";
831
  } elseif ( EMPTY_TRASH_DAYS ) {
832
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID ) ) . "'>" . __( 'Trash', 'bbpress' ) . "</a>";
833
  }
834
 
835
- if ( bbp_get_trash_status_id() == $topic->post_status || !EMPTY_TRASH_DAYS ) {
836
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) . "'>" . __( 'Delete Permanently', 'bbpress' ) . "</a>";
837
- } elseif ( bbp_get_spam_status_id() == $topic->post_status ) {
838
  unset( $actions['trash'] );
839
  }
840
  }
@@ -857,7 +845,7 @@ class BBP_Topics_Admin {
857
  if ( $this->bail() ) return;
858
 
859
  // Add Empty Spam button
860
- if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() == $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
861
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
862
  $title = esc_attr__( 'Empty Spam', 'bbpress' );
863
  submit_button( $title, 'button-secondary apply', 'delete_all', false );
64
  add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
65
 
66
  // Topic column headers.
67
+ add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
68
 
69
  // Topic columns (in post row)
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
  // Topic metabox actions
74
  add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
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;
209
 
210
  $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your topic in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a topic or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a topic to be published in the future or backdate a topic.', 'bbpress' ) . '</p>';
211
 
212
+ if ( current_theme_supports( 'topic-thumbnails' ) && post_type_supports( 'topic', 'thumbnail' ) ) {
 
 
 
 
213
  $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your topic without inserting it. This is usually useful only if your theme makes use of the featured image as a topic thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
214
  }
215
 
230
  'content' => $publish_box,
231
  ) );
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>' .
354
  if ( $this->bail() ) return;
355
 
356
  // Bail if post_type is not a topic
357
+ if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) )
358
  return;
359
 
360
  // Add the metabox
492
  check_admin_referer( 'close-topic_' . $topic_id );
493
 
494
  $is_open = bbp_is_topic_open( $topic_id );
495
+ $message = true === $is_open ? 'closed' : 'opened';
496
+ $success = true === $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
497
 
498
  break;
499
 
501
  check_admin_referer( 'stick-topic_' . $topic_id );
502
 
503
  $is_sticky = bbp_is_topic_sticky( $topic_id );
504
+ $is_super = false === $is_sticky && !empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
505
+ $message = true === $is_sticky ? 'unsticked' : 'sticked';
506
+ $message = true === $is_super ? 'super_sticked' : $message;
507
+ $success = true === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
508
 
509
  break;
510
 
512
  check_admin_referer( 'spam-topic_' . $topic_id );
513
 
514
  $is_spam = bbp_is_topic_spam( $topic_id );
515
+ $message = true === $is_spam ? 'unspammed' : 'spammed';
516
+ $success = true === $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
517
 
518
  break;
519
  }
520
 
521
  $message = array( 'bbp_topic_toggle_notice' => $message, 'topic_id' => $topic->ID );
522
 
523
+ if ( false === $success || is_wp_error( $success ) )
524
  $message['failed'] = '1';
525
 
526
  // Do additional topic toggle actions (admin side)
568
  if ( empty( $topic ) )
569
  return;
570
 
571
+ $topic_title = bbp_get_topic_title( $topic->ID );
572
 
573
  switch ( $notice ) {
574
  case 'opened' :
575
+ $message = $is_failure === true ? sprintf( __( 'There was a problem opening the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully opened.', 'bbpress' ), $topic_title );
576
  break;
577
 
578
  case 'closed' :
579
+ $message = $is_failure === true ? sprintf( __( 'There was a problem closing the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully closed.', 'bbpress' ), $topic_title );
580
  break;
581
 
582
  case 'super_sticked' :
583
+ $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked to front.', 'bbpress' ), $topic_title );
584
  break;
585
 
586
  case 'sticked' :
587
+ $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked.', 'bbpress' ), $topic_title );
588
  break;
589
 
590
  case 'unsticked' :
591
+ $message = $is_failure === true ? sprintf( __( 'There was a problem unsticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unsticked.', 'bbpress' ), $topic_title );
592
  break;
593
 
594
  case 'spammed' :
595
+ $message = $is_failure === true ? sprintf( __( 'There was a problem marking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully marked as spam.', 'bbpress' ), $topic_title );
596
  break;
597
 
598
  case 'unspammed' :
599
+ $message = $is_failure === true ? sprintf( __( 'There was a problem unmarking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unmarked as spam.', 'bbpress' ), $topic_title );
600
  break;
601
  }
602
 
605
 
606
  ?>
607
 
608
+ <div id="message" class="<?php echo $is_failure === true ? 'error' : 'updated'; ?> fade">
609
+ <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
610
  </div>
611
 
612
  <?php
623
  * the columns
624
  * @return array $columns bbPress topic columns
625
  */
626
+ public function column_headers( $columns ) {
627
 
628
  if ( $this->bail() ) return $columns;
629
 
666
  * @uses do_action() Calls 'bbp_admin_topics_column_data' with the
667
  * column and topic id
668
  */
669
+ public function column_data( $column, $topic_id ) {
670
 
671
  if ( $this->bail() ) return;
672
 
685
  // Forum Title
686
  $forum_title = bbp_get_forum_title( $forum_id );
687
  if ( empty( $forum_title ) ) {
688
+ $forum_title = esc_html__( 'No Forum', 'bbpress' );
689
  }
690
 
691
  // Output the title
692
  echo $forum_title;
693
 
694
  } else {
695
+ esc_html_e( '(No Forum)', 'bbpress' );
696
  }
697
 
698
  break;
714
 
715
  // Freshness
716
  case 'bbp_topic_created':
717
+ printf( '%1$s <br /> %2$s',
718
  get_the_date(),
719
  esc_attr( get_the_time() )
720
  );
725
  case 'bbp_topic_freshness' :
726
  $last_active = bbp_get_topic_last_active_time( $topic_id, false );
727
  if ( !empty( $last_active ) ) {
728
+ echo esc_html( $last_active );
729
  } else {
730
+ esc_html_e( 'No Replies', 'bbpress' ); // This should never happen
731
  }
732
 
733
  break;
766
  * @uses get_delete_post_link() To get the delete post link of the topic
767
  * @return array $actions Actions
768
  */
769
+ public function row_actions( $actions, $topic ) {
770
 
771
  if ( $this->bail() ) return $actions;
772
 
773
  unset( $actions['inline hide-if-no-js'] );
774
 
775
  // Show view link if it's not set, the topic is trashed and the user can view trashed topics
776
+ if ( empty( $actions['view'] ) && ( bbp_get_trash_status_id() === $topic->post_status ) && current_user_can( 'view_trash' ) )
777
+ $actions['view'] = '<a href="' . esc_url( bbp_get_topic_permalink( $topic->ID ) ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_topic_title( $topic->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
778
 
779
  // Only show the actions if the user is capable of viewing them :)
780
  if ( current_user_can( 'moderate', $topic->ID ) ) {
782
  // Close
783
  // Show the 'close' and 'open' link on published and closed posts only
784
  if ( in_array( $topic->post_status, array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ) ) {
785
+ $close_uri = wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_close' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'close-topic_' . $topic->ID );
786
  if ( bbp_is_topic_open( $topic->ID ) )
787
+ $actions['closed'] = '<a href="' . esc_url( $close_uri ) . '" title="' . esc_attr__( 'Close this topic', 'bbpress' ) . '">' . _x( 'Close', 'Close a Topic', 'bbpress' ) . '</a>';
788
  else
789
+ $actions['closed'] = '<a href="' . esc_url( $close_uri ) . '" title="' . esc_attr__( 'Open this topic', 'bbpress' ) . '">' . _x( 'Open', 'Open a Topic', 'bbpress' ) . '</a>';
790
  }
791
 
792
  // Dont show sticky if topic links is spam or trash
793
  if ( !bbp_is_topic_spam( $topic->ID ) && !bbp_is_topic_trash( $topic->ID ) ) {
794
 
795
  // Sticky
796
+ $stick_uri = wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_stick' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'stick-topic_' . $topic->ID );
797
  if ( bbp_is_topic_sticky( $topic->ID ) ) {
798
+ $actions['stick'] = '<a href="' . esc_url( $stick_uri ) . '" title="' . esc_attr__( 'Unstick this topic', 'bbpress' ) . '">' . esc_html__( 'Unstick', 'bbpress' ) . '</a>';
799
  } else {
800
+ $super_uri = wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_stick', 'super' => '1' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'stick-topic_' . $topic->ID );
801
+ $actions['stick'] = '<a href="' . esc_url( $stick_uri ) . '" title="' . esc_attr__( 'Stick this topic to its forum', 'bbpress' ) . '">' . esc_html__( 'Stick', 'bbpress' ) . '</a> <a href="' . esc_url( $super_uri ) . '" title="' . esc_attr__( 'Stick this topic to front', 'bbpress' ) . '">' . esc_html__( '(to front)', 'bbpress' ) . '</a>';
802
  }
803
  }
804
 
805
  // Spam
806
+ $spam_uri = wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_spam' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'spam-topic_' . $topic->ID );
807
  if ( bbp_is_topic_spam( $topic->ID ) )
808
+ $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the topic as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
809
  else
810
+ $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this topic as spam', 'bbpress' ) . '">' . esc_html__( 'Spam', 'bbpress' ) . '</a>';
811
 
812
  }
813
 
814
  // Do not show trash links for spam topics, or spam links for trashed topics
815
  if ( current_user_can( 'delete_topic', $topic->ID ) ) {
816
+ if ( bbp_get_trash_status_id() === $topic->post_status ) {
817
  $post_type_object = get_post_type_object( bbp_get_topic_post_type() );
818
+ $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
819
  } elseif ( EMPTY_TRASH_DAYS ) {
820
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
821
  }
822
 
823
+ if ( bbp_get_trash_status_id() === $topic->post_status || !EMPTY_TRASH_DAYS ) {
824
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
825
+ } elseif ( bbp_get_spam_status_id() === $topic->post_status ) {
826
  unset( $actions['trash'] );
827
  }
828
  }
845
  if ( $this->bail() ) return;
846
 
847
  // Add Empty Spam button
848
+ if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
849
  wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
850
  $title = esc_attr__( 'Empty Spam', 'bbpress' );
851
  submit_button( $title, 'button-secondary apply', 'delete_all', false );
includes/admin/users.php CHANGED
@@ -79,12 +79,12 @@ class BBP_Users_Admin {
79
  if ( ! bbp_is_user_keymaster() )
80
  unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?>
81
 
82
- <h3><?php _e( 'Forums', 'bbpress' ); ?></h3>
83
 
84
  <table class="form-table">
85
  <tbody>
86
  <tr>
87
- <th><label for="bbp-forums-role"><?php _e( 'Forum Role', 'bbpress' ); ?></label></th>
88
  <td>
89
 
90
  <?php $user_role = bbp_get_user_role( $profileuser->ID ); ?>
@@ -93,11 +93,11 @@ class BBP_Users_Admin {
93
 
94
  <?php if ( ! empty( $user_role ) ) : ?>
95
 
96
- <option value=""><?php _e( '&mdash; No role for these forums &mdash;', 'bbpress' ); ?></option>
97
 
98
  <?php else : ?>
99
 
100
- <option value="" selected="selected"><?php _e( '&mdash; No role for these forums &mdash;', 'bbpress' ); ?></option>
101
 
102
  <?php endif; ?>
103
 
@@ -135,9 +135,9 @@ class BBP_Users_Admin {
135
  if ( ! bbp_is_user_keymaster() )
136
  unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?>
137
 
138
- <label class="screen-reader-text" for="bbp-new-role"><?php _e( 'Change forum role to&hellip;', 'bbpress' ) ?></label>
139
  <select name="bbp-new-role" id="bbp-new-role" style="display:inline-block; float:none;">
140
- <option value=''><?php _e( 'Change forum role to&hellip;', 'bbpress' ) ?></option>
141
  <?php foreach ( $dynamic_roles as $role => $details ) : ?>
142
  <option value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
143
  <?php endforeach; ?>
@@ -181,7 +181,7 @@ class BBP_Users_Admin {
181
  $user_id = (int) $user_id;
182
 
183
  // Don't let a user change their own role
184
- if ( $user_id == $current_user_id )
185
  continue;
186
 
187
  // Set up user and role data
@@ -193,7 +193,7 @@ class BBP_Users_Admin {
193
  continue;
194
 
195
  // Set the new forums role
196
- if ( $new_role != $user_role ) {
197
  bbp_set_user_role( $user_id, $new_role );
198
  }
199
  }
@@ -229,7 +229,7 @@ class BBP_Users_Admin {
229
  public static function user_role_row( $retval = '', $column_name = '', $user_id = 0 ) {
230
 
231
  // Only looking for bbPress's user role column
232
- if ( 'bbp_user_role' == $column_name ) {
233
 
234
  // Get the users role
235
  $user_role = bbp_get_user_role( $user_id );
79
  if ( ! bbp_is_user_keymaster() )
80
  unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?>
81
 
82
+ <h3><?php esc_html_e( 'Forums', 'bbpress' ); ?></h3>
83
 
84
  <table class="form-table">
85
  <tbody>
86
  <tr>
87
+ <th><label for="bbp-forums-role"><?php esc_html_e( 'Forum Role', 'bbpress' ); ?></label></th>
88
  <td>
89
 
90
  <?php $user_role = bbp_get_user_role( $profileuser->ID ); ?>
93
 
94
  <?php if ( ! empty( $user_role ) ) : ?>
95
 
96
+ <option value=""><?php esc_html_e( '&mdash; No role for these forums &mdash;', 'bbpress' ); ?></option>
97
 
98
  <?php else : ?>
99
 
100
+ <option value="" selected="selected"><?php esc_html_e( '&mdash; No role for these forums &mdash;', 'bbpress' ); ?></option>
101
 
102
  <?php endif; ?>
103
 
135
  if ( ! bbp_is_user_keymaster() )
136
  unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?>
137
 
138
+ <label class="screen-reader-text" for="bbp-new-role"><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ) ?></label>
139
  <select name="bbp-new-role" id="bbp-new-role" style="display:inline-block; float:none;">
140
+ <option value=''><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ) ?></option>
141
  <?php foreach ( $dynamic_roles as $role => $details ) : ?>
142
  <option value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
143
  <?php endforeach; ?>
181
  $user_id = (int) $user_id;
182
 
183
  // Don't let a user change their own role
184
+ if ( $user_id === $current_user_id )
185
  continue;
186
 
187
  // Set up user and role data
193
  continue;
194
 
195
  // Set the new forums role
196
+ if ( $new_role !== $user_role ) {
197
  bbp_set_user_role( $user_id, $new_role );
198
  }
199
  }
229
  public static function user_role_row( $retval = '', $column_name = '', $user_id = 0 ) {
230
 
231
  // Only looking for bbPress's user role column
232
+ if ( 'bbp_user_role' === $column_name ) {
233
 
234
  // Get the users role
235
  $user_role = bbp_get_user_role( $user_id );
includes/common/ajax.php CHANGED
@@ -21,7 +21,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
21
  * @uses bbp_get_ajax_url() To get the URL to use for AJAX requests
22
  */
23
  function bbp_ajax_url() {
24
- echo bbp_get_ajax_url();
25
  }
26
  /**
27
  * Return the URL to use for theme-side bbPress AJAX requests
@@ -48,7 +48,7 @@ function bbp_ajax_url() {
48
  * @return bool Looking for bbp-ajax
49
  */
50
  function bbp_is_ajax() {
51
- return (bool) ( isset( $_GET['bbp-ajax'] ) && ! empty( $_REQUEST['action'] ) );
52
  }
53
 
54
  /**
21
  * @uses bbp_get_ajax_url() To get the URL to use for AJAX requests
22
  */
23
  function bbp_ajax_url() {
24
+ echo esc_url( bbp_get_ajax_url() );
25
  }
26
  /**
27
  * Return the URL to use for theme-side bbPress AJAX requests
48
  * @return bool Looking for bbp-ajax
49
  */
50
  function bbp_is_ajax() {
51
+ return (bool) ( ( isset( $_GET['bbp-ajax'] ) || isset( $_POST['bbp-ajax'] ) ) && ! empty( $_REQUEST['action'] ) );
52
  }
53
 
54
  /**
includes/common/classes.php CHANGED
@@ -225,6 +225,7 @@ class BBP_Walker_Dropdown extends Walker {
225
  * for padding.
226
  * @param array $args Uses 'selected' argument for selected post to set
227
  * selected HTML attribute for option element.
 
228
  * @uses bbp_is_forum_category() To check if the forum is a category
229
  * @uses current_user_can() To check if the current user can post in
230
  * closed forums
@@ -232,31 +233,191 @@ class BBP_Walker_Dropdown extends Walker {
232
  * @uses apply_filters() Calls 'bbp_walker_dropdown_post_title' with the
233
  * title, output, post, depth and args
234
  */
235
- public function start_el( &$output, $_post, $depth, $args ) {
236
- $pad = str_repeat( '&nbsp;', $depth * 3 );
237
- $output .= '<option class="level-' . $depth . '"';
238
 
239
  // Disable the <option> if:
240
  // - we're told to do so
241
  // - the post type is a forum
242
  // - the forum is a category
243
  // - forum is closed
244
- if ( ( true == $args['disable_categories'] )
245
- && ( bbp_get_forum_post_type() == $_post->post_type )
246
- && ( bbp_is_forum_category( $_post->ID )
247
- || ( !current_user_can( 'edit_forum', $_post->ID ) && bbp_is_forum_closed( $_post->ID )
248
  )
249
  ) ) {
250
  $output .= ' disabled="disabled" value=""';
251
  } else {
252
- $output .= ' value="' . $_post->ID .'"' . selected( $args['selected'], $_post->ID, false );
253
  }
254
 
255
  $output .= '>';
256
- $title = apply_filters( 'bbp_walker_dropdown_post_title', $_post->post_title, $output, $_post, $depth, $args );
257
  $output .= $pad . esc_html( $title );
258
  $output .= "</option>\n";
259
  }
260
  }
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  endif; // class_exists check
225
  * for padding.
226
  * @param array $args Uses 'selected' argument for selected post to set
227
  * selected HTML attribute for option element.
228
+ * @param int $current_object_id
229
  * @uses bbp_is_forum_category() To check if the forum is a category
230
  * @uses current_user_can() To check if the current user can post in
231
  * closed forums
233
  * @uses apply_filters() Calls 'bbp_walker_dropdown_post_title' with the
234
  * title, output, post, depth and args
235
  */
236
+ public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
237
+ $pad = str_repeat( '&nbsp;', (int) $depth * 3 );
238
+ $output .= '<option class="level-' . (int) $depth . '"';
239
 
240
  // Disable the <option> if:
241
  // - we're told to do so
242
  // - the post type is a forum
243
  // - the forum is a category
244
  // - forum is closed
245
+ if ( ( true === $args['disable_categories'] )
246
+ && ( bbp_get_forum_post_type() === $object->post_type )
247
+ && ( bbp_is_forum_category( $object->ID )
248
+ || ( !current_user_can( 'edit_forum', $object->ID ) && bbp_is_forum_closed( $object->ID )
249
  )
250
  ) ) {
251
  $output .= ' disabled="disabled" value=""';
252
  } else {
253
+ $output .= ' value="' . (int) $object->ID .'"' . selected( $args['selected'], $object->ID, false );
254
  }
255
 
256
  $output .= '>';
257
+ $title = apply_filters( 'bbp_walker_dropdown_post_title', $object->post_title, $output, $object, $depth, $args );
258
  $output .= $pad . esc_html( $title );
259
  $output .= "</option>\n";
260
  }
261
  }
262
 
263
+ /**
264
+ * Create hierarchical list of bbPress replies.
265
+ *
266
+ * @package bbPress
267
+ * @subpackage Classes
268
+ *
269
+ * @since bbPress (r4944)
270
+ */
271
+ class BBP_Walker_Reply extends Walker {
272
+
273
+ /**
274
+ * @see Walker::$tree_type
275
+ *
276
+ * @since bbPress (r4944)
277
+ *
278
+ * @var string
279
+ */
280
+ var $tree_type = 'reply';
281
+
282
+ /**
283
+ * @see Walker::$db_fields
284
+ *
285
+ * @since bbPress (r4944)
286
+ *
287
+ * @var array
288
+ */
289
+ var $db_fields = array(
290
+ 'parent' => 'reply_to',
291
+ 'id' => 'ID'
292
+ );
293
+
294
+ /**
295
+ * @see Walker::start_lvl()
296
+ *
297
+ * @since bbPress (r4944)
298
+ *
299
+ * @param string $output Passed by reference. Used to append additional content
300
+ * @param int $depth Depth of reply
301
+ * @param array $args Uses 'style' argument for type of HTML list
302
+ */
303
+ public function start_lvl( &$output = '', $depth = 0, $args = array() ) {
304
+ bbpress()->reply_query->reply_depth = $depth + 1;
305
+
306
+ switch ( $args['style'] ) {
307
+ case 'div':
308
+ break;
309
+ case 'ol':
310
+ echo "<ol class='bbp-threaded-replies'>\n";
311
+ break;
312
+ case 'ul':
313
+ default:
314
+ echo "<ul class='bbp-threaded-replies'>\n";
315
+ break;
316
+ }
317
+ }
318
+
319
+ /**
320
+ * @see Walker::end_lvl()
321
+ *
322
+ * @since bbPress (r4944)
323
+ *
324
+ * @param string $output Passed by reference. Used to append additional content
325
+ * @param int $depth Depth of reply
326
+ * @param array $args Will only append content if style argument value is 'ol' or 'ul'
327
+ */
328
+ public function end_lvl( &$output = '', $depth = 0, $args = array() ) {
329
+ bbpress()->reply_query->reply_depth = (int) $depth + 1;
330
+
331
+ switch ( $args['style'] ) {
332
+ case 'div':
333
+ break;
334
+ case 'ol':
335
+ echo "</ol>\n";
336
+ break;
337
+ case 'ul':
338
+ default:
339
+ echo "</ul>\n";
340
+ break;
341
+ }
342
+ }
343
+
344
+ /**
345
+ * @since bbPress (r4944)
346
+ */
347
+ public function display_element( $element = false, &$children_elements = array(), $max_depth = 0, $depth = 0, $args = array(), &$output = '' ) {
348
+
349
+ if ( empty( $element ) )
350
+ return;
351
+
352
+ // Get element's id
353
+ $id_field = $this->db_fields['id'];
354
+ $id = $element->$id_field;
355
+
356
+ // Display element
357
+ parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
358
+
359
+ // If we're at the max depth and the current element still has children, loop over those
360
+ // and display them at this level to prevent them being orphaned to the end of the list.
361
+ if ( ( $max_depth <= (int) $depth + 1 ) && isset( $children_elements[$id] ) ) {
362
+ foreach ( $children_elements[$id] as $child ) {
363
+ $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output );
364
+ }
365
+ unset( $children_elements[$id] );
366
+ }
367
+ }
368
+
369
+ /**
370
+ * @see Walker:start_el()
371
+ *
372
+ * @since bbPress (r4944)
373
+ */
374
+ public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
375
+
376
+ // Set up reply
377
+ $depth++;
378
+ bbpress()->reply_query->reply_depth = $depth;
379
+ bbpress()->reply_query->post = $object;
380
+ bbpress()->current_reply_id = $object->ID;
381
+
382
+ // Check for a callback and use it if specified
383
+ if ( !empty( $args['callback'] ) ) {
384
+ call_user_func( $args['callback'], $object, $args, $depth );
385
+ return;
386
+ }
387
+
388
+ // Style for div or list element
389
+ if ( 'div' === $args['style'] ) {
390
+ $tag = 'div';
391
+ } else {
392
+ $tag = 'li';
393
+ } ?>
394
+
395
+ <<?php echo $tag ?>>
396
+
397
+ <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
398
+
399
+ </<?php echo $tag ?>>
400
+
401
+ <?php
402
+ }
403
+
404
+ /**
405
+ * @since bbPress (r4944)
406
+ */
407
+ public function end_el( &$output = '', $object = false, $depth = 0, $args = array() ) {
408
+
409
+ // Check for a callback and use it if specified
410
+ if ( !empty( $args['end-callback'] ) ) {
411
+ call_user_func( $args['end-callback'], $object, $args, $depth );
412
+ return;
413
+ }
414
+
415
+ // Style for div or list element
416
+ if ( !empty( $args['style'] ) && ( 'div' === $args['style'] ) ) {
417
+ echo "</div>\n";
418
+ } else {
419
+ echo "</li>\n";
420
+ }
421
+ }
422
+ }
423
  endif; // class_exists check
includes/common/formatting.php CHANGED
@@ -170,7 +170,7 @@ function bbp_encode_bad( $content = '' ) {
170
  }
171
 
172
  // Return the joined content array
173
- return join( '', $content );
174
  }
175
 
176
  /** Code Callbacks ************************************************************/
@@ -186,7 +186,7 @@ function bbp_encode_bad( $content = '' ) {
186
  function bbp_encode_callback( $matches = array() ) {
187
 
188
  // Trim inline code, not pre blocks (to prevent removing indentation)
189
- if ( "`" == $matches[1] ) {
190
  $content = trim( $matches[2] );
191
  } else {
192
  $content = $matches[2];
@@ -204,8 +204,8 @@ function bbp_encode_callback( $matches = array() ) {
204
  $content = '<code>' . $content . '</code>';
205
 
206
  // Wrap blocks in pre tags
207
- if ( "`" != $matches[1] ) {
208
- $content = '<pre>' . $content . '</pre>';
209
  }
210
 
211
  return $content;
@@ -217,13 +217,15 @@ function bbp_encode_callback( $matches = array() ) {
217
  * @since bbPress (r4641)
218
  *
219
  * @param array $matches
 
220
  * @return string
221
  */
222
  function bbp_decode_callback( $matches = array() ) {
223
 
224
  // Setup variables
225
  $trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
226
- $amps = array( '&#38;','&amp;' );
 
227
  $content = $matches[2];
228
  $content = strtr( $content, $trans_table );
229
 
@@ -232,7 +234,7 @@ function bbp_decode_callback( $matches = array() ) {
232
  $content = str_replace( '<p>', '<coded_p>', $content );
233
  $content = str_replace( '</p>', '</coded_p>', $content );
234
  $content = str_replace( $amps, '&', $content );
235
- $content = str_replace( '&#39;', "'", $content );
236
 
237
  // Return content wrapped in code tags
238
  return '`' . $content . '`';
@@ -295,3 +297,85 @@ function bbp_rel_nofollow_callback( $matches = array() ) {
295
  $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'" ), '', $text );
296
  return "<a $text rel=\"nofollow\">";
297
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  }
171
 
172
  // Return the joined content array
173
+ return implode( '', $content );
174
  }
175
 
176
  /** Code Callbacks ************************************************************/
186
  function bbp_encode_callback( $matches = array() ) {
187
 
188
  // Trim inline code, not pre blocks (to prevent removing indentation)
189
+ if ( "`" === $matches[1] ) {
190
  $content = trim( $matches[2] );
191
  } else {
192
  $content = $matches[2];
204
  $content = '<code>' . $content . '</code>';
205
 
206
  // Wrap blocks in pre tags
207
+ if ( "`" !== $matches[1] ) {
208
+ $content = "\n<pre>" . $content . "</pre>\n";
209
  }
210
 
211
  return $content;
217
  * @since bbPress (r4641)
218
  *
219
  * @param array $matches
220
+ * @todo Experiment with _wp_specialchars()
221
  * @return string
222
  */
223
  function bbp_decode_callback( $matches = array() ) {
224
 
225
  // Setup variables
226
  $trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
227
+ $amps = array( '&#38;','&#038;', '&amp;' );
228
+ $single = array( '&#39;','&#039;' );
229
  $content = $matches[2];
230
  $content = strtr( $content, $trans_table );
231
 
234
  $content = str_replace( '<p>', '<coded_p>', $content );
235
  $content = str_replace( '</p>', '</coded_p>', $content );
236
  $content = str_replace( $amps, '&', $content );
237
+ $content = str_replace( $single, "'", $content );
238
 
239
  // Return content wrapped in code tags
240
  return '`' . $content . '`';
297
  $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'" ), '', $text );
298
  return "<a $text rel=\"nofollow\">";
299
  }
300
+
301
+ /** Make Clickable ************************************************************/
302
+
303
+ /**
304
+ * Convert plaintext URI to HTML links.
305
+ *
306
+ * Converts URI, www and ftp, and email addresses. Finishes by fixing links
307
+ * within links.
308
+ *
309
+ * This custom version of WordPress's make_clickable() skips links inside of
310
+ * pre and code tags.
311
+ *
312
+ * @since bbPress (r4941)
313
+ *
314
+ * @param string $text Content to convert URIs.
315
+ * @return string Content with converted URIs.
316
+ */
317
+ function bbp_make_clickable( $text ) {
318
+ $r = '';
319
+ $in_code = false;
320
+ $textarr = preg_split( '/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // split out HTML tags
321
+
322
+ foreach ( $textarr as $piece ) {
323
+
324
+ switch ( $piece ) {
325
+ case '<code>' :
326
+ case '<pre>' :
327
+ $in_code = true;
328
+ break;
329
+ case '</code>' :
330
+ case '</pre>' :
331
+ $in_code = false;
332
+ break;
333
+ }
334
+
335
+ if ( $in_code || empty( $piece ) || ( $piece[0] === '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
336
+ $r .= $piece;
337
+ continue;
338
+ }
339
+
340
+ // Long strings might contain expensive edge cases ...
341
+ if ( 10000 < strlen( $piece ) ) {
342
+ // ... break it up
343
+ foreach ( _split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
344
+ if ( 2101 < strlen( $chunk ) ) {
345
+ $r .= $chunk; // Too big, no whitespace: bail.
346
+ } else {
347
+ $r .= make_clickable( $chunk );
348
+ }
349
+ }
350
+ } else {
351
+ $ret = " $piece "; // Pad with whitespace to simplify the regexes
352
+
353
+ $url_clickable = '~
354
+ ([\\s(<.,;:!?]) # 1: Leading whitespace, or punctuation
355
+ ( # 2: URL
356
+ [\\w]{1,20}+:// # Scheme and hier-part prefix
357
+ (?=\S{1,2000}\s) # Limit to URLs less than about 2000 characters long
358
+ [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+ # Non-punctuation URL character
359
+ (?: # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character
360
+ [\'.,;:!?)] # Punctuation URL character
361
+ [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++ # Non-punctuation URL character
362
+ )*
363
+ )
364
+ (\)?) # 3: Trailing closing parenthesis (for parethesis balancing post processing)
365
+ ~xS'; // The regex is a non-anchored pattern and does not have a single fixed starting character.
366
+ // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
367
+
368
+ $ret = preg_replace_callback( $url_clickable, '_make_url_clickable_cb', $ret );
369
+
370
+ $ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
371
+ $ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret );
372
+
373
+ $ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
374
+ $r .= $ret;
375
+ }
376
+ }
377
+
378
+ // Cleanup of accidental links within links
379
+ $r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
380
+ return $r;
381
+ }
includes/common/functions.php CHANGED
@@ -85,10 +85,11 @@ function bbp_convert_date( $time, $d = 'U', $translate = false ) {
85
  * @param string $older_date Unix timestamp from which the difference begins.
86
  * @param string $newer_date Optional. Unix timestamp from which the
87
  * difference ends. False for current time.
 
88
  * @uses bbp_get_time_since() To get the formatted time
89
  */
90
- function bbp_time_since( $older_date, $newer_date = false ) {
91
- echo bbp_get_time_since( $older_date, $newer_date );
92
  }
93
  /**
94
  * Return formatted time to display human readable time difference.
@@ -98,13 +99,14 @@ function bbp_time_since( $older_date, $newer_date = false ) {
98
  * @param string $older_date Unix timestamp from which the difference begins.
99
  * @param string $newer_date Optional. Unix timestamp from which the
100
  * difference ends. False for current time.
 
101
  * @uses current_time() To get the current time in mysql format
102
  * @uses human_time_diff() To get the time differene in since format
103
  * @uses apply_filters() Calls 'bbp_get_time_since' with the time
104
  * difference and time
105
  * @return string Formatted time
106
  */
107
- function bbp_get_time_since( $older_date, $newer_date = false ) {
108
 
109
  // Setup the strings
110
  $unknown_text = apply_filters( 'bbp_core_time_since_unknown_text', __( 'sometime', 'bbpress' ) );
@@ -131,7 +133,7 @@ function bbp_time_since( $older_date, $newer_date = false ) {
131
  // $newer_date will equal false if we want to know the time elapsed
132
  // between a date and the current time. $newer_date will have a value if
133
  // we want to work out time elapsed between two known dates.
134
- $newer_date = ( !$newer_date ) ? strtotime( current_time( 'mysql' ) ) : $newer_date;
135
 
136
  // Difference in seconds
137
  $since = $newer_date - $older_date;
@@ -217,7 +219,7 @@ function bbp_format_revision_reason( $reason = '' ) {
217
  $reason = trim( $reason );
218
 
219
  // We add our own full stop.
220
- while ( substr( $reason, -1 ) == '.' )
221
  $reason = substr( $reason, 0, -1 );
222
 
223
  // Trim again
@@ -290,7 +292,7 @@ function bbp_remove_view_all( $original_link = '' ) {
290
  * @return bool Whether current user can and is viewing all
291
  */
292
  function bbp_get_view_all( $cap = 'moderate' ) {
293
- $retval = ( ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] ) && current_user_can( $cap ) ) );
294
  return apply_filters( 'bbp_get_view_all', (bool) $retval );
295
  }
296
 
@@ -350,8 +352,8 @@ function bbp_fix_post_author( $data = array(), $postarr = array() ) {
350
  return $data;
351
 
352
  // Is the post by an anonymous user?
353
- if ( ( bbp_get_topic_post_type() == $data['post_type'] && !bbp_is_topic_anonymous( $postarr['ID'] ) ) ||
354
- ( bbp_get_reply_post_type() == $data['post_type'] && !bbp_is_reply_anonymous( $postarr['ID'] ) ) )
355
  return $data;
356
 
357
  // The post is being updated. It is a topic or a reply and is written by an anonymous user.
@@ -861,7 +863,7 @@ function bbp_check_for_moderation( $anonymous_data = false, $author_id = 0, $tit
861
  $pattern = "#$word#i";
862
 
863
  // Loop through post data
864
- foreach( $_post as $post_data ) {
865
 
866
  // Check each user data for current word
867
  if ( preg_match( $pattern, $post_data ) ) {
@@ -962,7 +964,7 @@ function bbp_check_for_blacklist( $anonymous_data = false, $author_id = 0, $titl
962
  $pattern = "#$word#i";
963
 
964
  // Loop through post data
965
- foreach( $_post as $post_data ) {
966
 
967
  // Check each user data for current word
968
  if ( preg_match( $pattern, $post_data ) ) {
@@ -1061,7 +1063,7 @@ function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $a
1061
  foreach ( (array) $user_ids as $user_id ) {
1062
 
1063
  // Don't send notifications to the person who made the post
1064
- if ( !empty( $reply_author ) && (int) $user_id == (int) $reply_author )
1065
  continue;
1066
 
1067
  // For plugins to filter messages per reply/topic/user
@@ -1123,7 +1125,7 @@ function bbp_logout_url( $url = '', $redirect_to = '' ) {
1123
  if ( empty( $redirect_to ) && !strstr( $url, 'redirect_to' ) ) {
1124
 
1125
  // Rejig the $redirect_to
1126
- if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to != home_url( $_SERVER['REDIRECT_URL'] ) ) ) {
1127
  $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
1128
  }
1129
 
@@ -1155,27 +1157,31 @@ function bbp_logout_url( $url = '', $redirect_to = '' ) {
1155
  * @param string $filter_key String to key the filters from
1156
  * @return array Merged user defined values with defaults.
1157
  */
1158
- function bbp_parse_args( $args, $defaults = '', $filter_key = '' ) {
1159
 
1160
  // Setup a temporary array from $args
1161
- if ( is_object( $args ) )
1162
  $r = get_object_vars( $args );
1163
- elseif ( is_array( $args ) )
1164
  $r =& $args;
1165
- else
1166
  wp_parse_str( $args, $r );
 
1167
 
1168
  // Passively filter the args before the parse
1169
- if ( !empty( $filter_key ) )
1170
  $r = apply_filters( 'bbp_before_' . $filter_key . '_parse_args', $r );
 
1171
 
1172
  // Parse
1173
- if ( is_array( $defaults ) )
1174
  $r = array_merge( $defaults, $r );
 
1175
 
1176
  // Aggressively filter the args after the parse
1177
- if ( !empty( $filter_key ) )
1178
  $r = apply_filters( 'bbp_after_' . $filter_key . '_parse_args', $r );
 
1179
 
1180
  // Return the parsed results
1181
  return $r;
@@ -1209,13 +1215,13 @@ function bbp_query_post_parent__in( $where, $object = '' ) {
1209
 
1210
  // Including specific post_parent's
1211
  if ( ! empty( $object->query_vars['post_parent__in'] ) ) {
1212
- $ids = implode( ',', array_map( 'absint', $object->query_vars['post_parent__in'] ) );
1213
- $where .= " AND $wpdb->posts.post_parent IN ($ids)";
1214
 
1215
  // Excluding specific post_parent's
1216
  } elseif ( ! empty( $object->query_vars['post_parent__not_in'] ) ) {
1217
- $ids = implode( ',', array_map( 'absint', $object->query_vars['post_parent__not_in'] ) );
1218
- $where .= " AND $wpdb->posts.post_parent NOT IN ($ids)";
1219
  }
1220
 
1221
  // Return possibly modified $where
@@ -1244,25 +1250,27 @@ function bbp_get_public_child_last_id( $parent_id = 0, $post_type = 'post' ) {
1244
  return false;
1245
 
1246
  // The ID of the cached query
1247
- $cache_id = 'bbp_parent_' . $parent_id . '_type_' . $post_type . '_child_last_id';
1248
- $post_status = array( bbp_get_public_status_id() );
1249
-
1250
- // Add closed status if topic post type
1251
- if ( $post_type == bbp_get_topic_post_type() )
1252
- $post_status[] = bbp_get_closed_status_id();
1253
-
1254
- // Join post statuses together
1255
- $post_status = "'" . join( "', '", $post_status ) . "'";
1256
 
1257
  // Check for cache and set if needed
1258
  $child_id = wp_cache_get( $cache_id, 'bbpress_posts' );
1259
- if ( empty( $child_id ) ) {
 
 
 
 
 
 
 
 
 
 
1260
  $child_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", $parent_id, $post_type ) );
1261
  wp_cache_set( $cache_id, $child_id, 'bbpress_posts' );
1262
  }
1263
 
1264
  // Filter and return
1265
- return apply_filters( 'bbp_get_public_child_last_id', (int) $child_id, (int) $parent_id, $post_type );
1266
  }
1267
 
1268
  /**
@@ -1288,24 +1296,26 @@ function bbp_get_public_child_count( $parent_id = 0, $post_type = 'post' ) {
1288
 
1289
  // The ID of the cached query
1290
  $cache_id = 'bbp_parent_' . $parent_id . '_type_' . $post_type . '_child_count';
1291
- $post_status = array( bbp_get_public_status_id() );
1292
-
1293
- // Add closed status if topic post type
1294
- if ( $post_type == bbp_get_topic_post_type() )
1295
- $post_status[] = bbp_get_closed_status_id();
1296
-
1297
- // Join post statuses together
1298
- $post_status = "'" . join( "', '", $post_status ) . "'";
1299
 
1300
  // Check for cache and set if needed
1301
  $child_count = wp_cache_get( $cache_id, 'bbpress_posts' );
1302
- if ( empty( $child_count ) ) {
 
 
 
 
 
 
 
 
 
 
1303
  $child_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $parent_id, $post_type ) );
1304
  wp_cache_set( $cache_id, $child_count, 'bbpress_posts' );
1305
  }
1306
 
1307
  // Filter and return
1308
- return apply_filters( 'bbp_get_public_child_count', (int) $child_count, (int) $parent_id, $post_type );
1309
  }
1310
 
1311
  /**
@@ -1330,26 +1340,29 @@ function bbp_get_public_child_ids( $parent_id = 0, $post_type = 'post' ) {
1330
  return false;
1331
 
1332
  // The ID of the cached query
1333
- $cache_id = 'bbp_parent_public_' . $parent_id . '_type_' . $post_type . '_child_ids';
1334
- $post_status = array( bbp_get_public_status_id() );
1335
-
1336
- // Add closed status if topic post type
1337
- if ( $post_type == bbp_get_topic_post_type() )
1338
- $post_status[] = bbp_get_closed_status_id();
1339
-
1340
- // Join post statuses together
1341
- $post_status = "'" . join( "', '", $post_status ) . "'";
1342
 
1343
  // Check for cache and set if needed
1344
  $child_ids = wp_cache_get( $cache_id, 'bbpress_posts' );
1345
- if ( empty( $child_ids ) ) {
 
 
 
 
 
 
 
 
 
 
1346
  $child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) );
1347
  wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
1348
  }
1349
 
1350
  // Filter and return
1351
- return apply_filters( 'bbp_get_public_child_ids', $child_ids, (int) $parent_id, $post_type );
1352
  }
 
1353
  /**
1354
  * Query the DB and get a the child id's of all children
1355
  *
@@ -1372,38 +1385,39 @@ function bbp_get_all_child_ids( $parent_id = 0, $post_type = 'post' ) {
1372
  return false;
1373
 
1374
  // The ID of the cached query
1375
- $cache_id = 'bbp_parent_all_' . $parent_id . '_type_' . $post_type . '_child_ids';
1376
- $post_status = array( bbp_get_public_status_id() );
1377
-
1378
- // Extra post statuses based on post type
1379
- switch ( $post_type ) {
1380
-
1381
- // Forum
1382
- case bbp_get_forum_post_type() :
1383
- $post_status[] = bbp_get_private_status_id();
1384
- $post_status[] = bbp_get_hidden_status_id();
1385
- break;
1386
-
1387
- // Topic
1388
- case bbp_get_topic_post_type() :
1389
- $post_status[] = bbp_get_closed_status_id();
1390
- $post_status[] = bbp_get_trash_status_id();
1391
- $post_status[] = bbp_get_spam_status_id();
1392
- break;
1393
-
1394
- // Reply
1395
- case bbp_get_reply_post_type() :
1396
- $post_status[] = bbp_get_trash_status_id();
1397
- $post_status[] = bbp_get_spam_status_id();
1398
- break;
1399
- }
1400
-
1401
- // Join post statuses together
1402
- $post_status = "'" . join( "', '", $post_status ) . "'";
1403
 
1404
  // Check for cache and set if needed
1405
  $child_ids = wp_cache_get( $cache_id, 'bbpress_posts' );
1406
- if ( empty( $child_ids ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1407
  $child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) );
1408
  wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
1409
  }
@@ -1450,24 +1464,47 @@ function bbp_get_global_post_field( $field = 'ID', $context = 'edit' ) {
1450
  */
1451
  function bbp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
1452
 
 
 
1453
  // Parse home_url() into pieces to remove query-strings, strange characters,
1454
  // and other funny things that plugins might to do to it.
1455
- $parsed_home = parse_url( home_url( '/', ( is_ssl() ? 'https://' : 'http://' ) ) );
1456
- $home_url = trim( strtolower( $parsed_home['scheme'] . '://' . $parsed_home['host'] . $parsed_home['path'] ), '/' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1457
 
1458
  // Build the currently requested URL
1459
  $scheme = is_ssl() ? 'https://' : 'http://';
1460
- $requested_url = strtolower( $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
 
 
1461
 
1462
  // Filter the requested URL, for configurations like reverse proxying
1463
- $matched_url = apply_filters( 'bbp_verify_nonce_request_url', $requested_url );
1464
 
1465
  // Check the nonce
1466
  $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false;
1467
 
1468
  // Nonce check failed
1469
- if ( empty( $result ) || empty( $action ) || ( strpos( $matched_url, $home_url ) !== 0 ) )
1470
  $result = false;
 
1471
 
1472
  // Do extra things
1473
  do_action( 'bbp_verify_nonce_request', $action, $result );
@@ -1540,7 +1577,7 @@ function bbp_request_feed_trap( $query_vars = array() ) {
1540
  }
1541
 
1542
  // Only forum replies
1543
- if ( !empty( $_GET['type'] ) && ( bbp_get_reply_post_type() == $_GET['type'] ) ) {
1544
 
1545
  // The query
1546
  $the_query = array(
@@ -1558,7 +1595,7 @@ function bbp_request_feed_trap( $query_vars = array() ) {
1558
  bbp_display_replies_feed_rss2( $the_query );
1559
 
1560
  // Only forum topics
1561
- } elseif ( !empty( $_GET['type'] ) && ( bbp_get_topic_post_type() == $_GET['type'] ) ) {
1562
 
1563
  // The query
1564
  $the_query = array(
85
  * @param string $older_date Unix timestamp from which the difference begins.
86
  * @param string $newer_date Optional. Unix timestamp from which the
87
  * difference ends. False for current time.
88
+ * @param int $gmt Optional. Whether to use GMT timezone. Default is false.
89
  * @uses bbp_get_time_since() To get the formatted time
90
  */
91
+ function bbp_time_since( $older_date, $newer_date = false, $gmt = false ) {
92
+ echo bbp_get_time_since( $older_date, $newer_date, $gmt );
93
  }
94
  /**
95
  * Return formatted time to display human readable time difference.
99
  * @param string $older_date Unix timestamp from which the difference begins.
100
  * @param string $newer_date Optional. Unix timestamp from which the
101
  * difference ends. False for current time.
102
+ * @param int $gmt Optional. Whether to use GMT timezone. Default is false.
103
  * @uses current_time() To get the current time in mysql format
104
  * @uses human_time_diff() To get the time differene in since format
105
  * @uses apply_filters() Calls 'bbp_get_time_since' with the time
106
  * difference and time
107
  * @return string Formatted time
108
  */
109
+ function bbp_get_time_since( $older_date, $newer_date = false, $gmt = false ) {
110
 
111
  // Setup the strings
112
  $unknown_text = apply_filters( 'bbp_core_time_since_unknown_text', __( 'sometime', 'bbpress' ) );
133
  // $newer_date will equal false if we want to know the time elapsed
134
  // between a date and the current time. $newer_date will have a value if
135
  // we want to work out time elapsed between two known dates.
136
+ $newer_date = ( !$newer_date ) ? strtotime( current_time( 'mysql', $gmt ) ) : $newer_date;
137
 
138
  // Difference in seconds
139
  $since = $newer_date - $older_date;
219
  $reason = trim( $reason );
220
 
221
  // We add our own full stop.
222
+ while ( substr( $reason, -1 ) === '.' )
223
  $reason = substr( $reason, 0, -1 );
224
 
225
  // Trim again
292
  * @return bool Whether current user can and is viewing all
293
  */
294
  function bbp_get_view_all( $cap = 'moderate' ) {
295
+ $retval = ( ( !empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) && current_user_can( $cap ) ) );
296
  return apply_filters( 'bbp_get_view_all', (bool) $retval );
297
  }
298
 
352
  return $data;
353
 
354
  // Is the post by an anonymous user?
355
+ if ( ( bbp_get_topic_post_type() === $data['post_type'] && !bbp_is_topic_anonymous( $postarr['ID'] ) ) ||
356
+ ( bbp_get_reply_post_type() === $data['post_type'] && !bbp_is_reply_anonymous( $postarr['ID'] ) ) )
357
  return $data;
358
 
359
  // The post is being updated. It is a topic or a reply and is written by an anonymous user.
863
  $pattern = "#$word#i";
864
 
865
  // Loop through post data
866
+ foreach ( $_post as $post_data ) {
867
 
868
  // Check each user data for current word
869
  if ( preg_match( $pattern, $post_data ) ) {
964
  $pattern = "#$word#i";
965
 
966
  // Loop through post data
967
+ foreach ( $_post as $post_data ) {
968
 
969
  // Check each user data for current word
970
  if ( preg_match( $pattern, $post_data ) ) {
1063
  foreach ( (array) $user_ids as $user_id ) {
1064
 
1065
  // Don't send notifications to the person who made the post
1066
+ if ( !empty( $reply_author ) && (int) $user_id === (int) $reply_author )
1067
  continue;
1068
 
1069
  // For plugins to filter messages per reply/topic/user
1125
  if ( empty( $redirect_to ) && !strstr( $url, 'redirect_to' ) ) {
1126
 
1127
  // Rejig the $redirect_to
1128
+ if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to !== home_url( $_SERVER['REDIRECT_URL'] ) ) ) {
1129
  $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
1130
  }
1131
 
1157
  * @param string $filter_key String to key the filters from
1158
  * @return array Merged user defined values with defaults.
1159
  */
1160
+ function bbp_parse_args( $args, $defaults = array(), $filter_key = '' ) {
1161
 
1162
  // Setup a temporary array from $args
1163
+ if ( is_object( $args ) ) {
1164
  $r = get_object_vars( $args );
1165
+ } elseif ( is_array( $args ) ) {
1166
  $r =& $args;
1167
+ } else {
1168
  wp_parse_str( $args, $r );
1169
+ }
1170
 
1171
  // Passively filter the args before the parse
1172
+ if ( !empty( $filter_key ) ) {
1173
  $r = apply_filters( 'bbp_before_' . $filter_key . '_parse_args', $r );
1174
+ }
1175
 
1176
  // Parse
1177
+ if ( is_array( $defaults ) && !empty( $defaults ) ) {
1178
  $r = array_merge( $defaults, $r );
1179
+ }
1180
 
1181
  // Aggressively filter the args after the parse
1182
+ if ( !empty( $filter_key ) ) {
1183
  $r = apply_filters( 'bbp_after_' . $filter_key . '_parse_args', $r );
1184
+ }
1185
 
1186
  // Return the parsed results
1187
  return $r;
1215
 
1216
  // Including specific post_parent's
1217
  if ( ! empty( $object->query_vars['post_parent__in'] ) ) {
1218
+ $ids = implode( ',', wp_parse_id_list( $object->query_vars['post_parent__in'] ) );
1219
+ $where .= " AND {$wpdb->posts}.post_parent IN ($ids)";
1220
 
1221
  // Excluding specific post_parent's
1222
  } elseif ( ! empty( $object->query_vars['post_parent__not_in'] ) ) {
1223
+ $ids = implode( ',', wp_parse_id_list( $object->query_vars['post_parent__not_in'] ) );
1224
+ $where .= " AND {$wpdb->posts}.post_parent NOT IN ($ids)";
1225
  }
1226
 
1227
  // Return possibly modified $where
1250
  return false;
1251
 
1252
  // The ID of the cached query
1253
+ $cache_id = 'bbp_parent_' . $parent_id . '_type_' . $post_type . '_child_last_id';
 
 
 
 
 
 
 
 
1254
 
1255
  // Check for cache and set if needed
1256
  $child_id = wp_cache_get( $cache_id, 'bbpress_posts' );
1257
+ if ( false === $child_id ) {
1258
+ $post_status = array( bbp_get_public_status_id() );
1259
+
1260
+ // Add closed status if topic post type
1261
+ if ( $post_type === bbp_get_topic_post_type() ) {
1262
+ $post_status[] = bbp_get_closed_status_id();
1263
+ }
1264
+
1265
+ // Join post statuses together
1266
+ $post_status = "'" . implode( "', '", $post_status ) . "'";
1267
+
1268
  $child_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", $parent_id, $post_type ) );
1269
  wp_cache_set( $cache_id, $child_id, 'bbpress_posts' );
1270
  }
1271
 
1272
  // Filter and return
1273
+ return apply_filters( 'bbp_get_public_child_last_id', (int) $child_id, $parent_id, $post_type );
1274
  }
1275
 
1276
  /**
1296
 
1297
  // The ID of the cached query
1298
  $cache_id = 'bbp_parent_' . $parent_id . '_type_' . $post_type . '_child_count';
 
 
 
 
 
 
 
 
1299
 
1300
  // Check for cache and set if needed
1301
  $child_count = wp_cache_get( $cache_id, 'bbpress_posts' );
1302
+ if ( false === $child_count ) {
1303
+ $post_status = array( bbp_get_public_status_id() );
1304
+
1305
+ // Add closed status if topic post type
1306
+ if ( $post_type === bbp_get_topic_post_type() ) {
1307
+ $post_status[] = bbp_get_closed_status_id();
1308
+ }
1309
+
1310
+ // Join post statuses together
1311
+ $post_status = "'" . implode( "', '", $post_status ) . "'";
1312
+
1313
  $child_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $parent_id, $post_type ) );
1314
  wp_cache_set( $cache_id, $child_count, 'bbpress_posts' );
1315
  }
1316
 
1317
  // Filter and return
1318
+ return apply_filters( 'bbp_get_public_child_count', (int) $child_count, $parent_id, $post_type );
1319
  }
1320
 
1321
  /**
1340
  return false;
1341
 
1342
  // The ID of the cached query
1343
+ $cache_id = 'bbp_parent_public_' . $parent_id . '_type_' . $post_type . '_child_ids';
 
 
 
 
 
 
 
 
1344
 
1345
  // Check for cache and set if needed
1346
  $child_ids = wp_cache_get( $cache_id, 'bbpress_posts' );
1347
+ if ( false === $child_ids ) {
1348
+ $post_status = array( bbp_get_public_status_id() );
1349
+
1350
+ // Add closed status if topic post type
1351
+ if ( $post_type === bbp_get_topic_post_type() ) {
1352
+ $post_status[] = bbp_get_closed_status_id();
1353
+ }
1354
+
1355
+ // Join post statuses together
1356
+ $post_status = "'" . implode( "', '", $post_status ) . "'";
1357
+
1358
  $child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) );
1359
  wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
1360
  }
1361
 
1362
  // Filter and return
1363
+ return apply_filters( 'bbp_get_public_child_ids', $child_ids, $parent_id, $post_type );
1364
  }
1365
+
1366
  /**
1367
  * Query the DB and get a the child id's of all children
1368
  *
1385
  return false;
1386
 
1387
  // The ID of the cached query
1388
+ $cache_id = 'bbp_parent_all_' . $parent_id . '_type_' . $post_type . '_child_ids';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1389
 
1390
  // Check for cache and set if needed
1391
  $child_ids = wp_cache_get( $cache_id, 'bbpress_posts' );
1392
+ if ( false === $child_ids ) {
1393
+ $post_status = array( bbp_get_public_status_id() );
1394
+
1395
+ // Extra post statuses based on post type
1396
+ switch ( $post_type ) {
1397
+
1398
+ // Forum
1399
+ case bbp_get_forum_post_type() :
1400
+ $post_status[] = bbp_get_private_status_id();
1401
+ $post_status[] = bbp_get_hidden_status_id();
1402
+ break;
1403
+
1404
+ // Topic
1405
+ case bbp_get_topic_post_type() :
1406
+ $post_status[] = bbp_get_closed_status_id();
1407
+ $post_status[] = bbp_get_trash_status_id();
1408
+ $post_status[] = bbp_get_spam_status_id();
1409
+ break;
1410
+
1411
+ // Reply
1412
+ case bbp_get_reply_post_type() :
1413
+ $post_status[] = bbp_get_trash_status_id();
1414
+ $post_status[] = bbp_get_spam_status_id();
1415
+ break;
1416
+ }
1417
+
1418
+ // Join post statuses together
1419
+ $post_status = "'" . implode( "', '", $post_status ) . "'";
1420
+
1421
  $child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) );
1422
  wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
1423
  }
1464
  */
1465
  function bbp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
1466
 
1467
+ /** Home URL **************************************************************/
1468
+
1469
  // Parse home_url() into pieces to remove query-strings, strange characters,
1470
  // and other funny things that plugins might to do to it.
1471
+ $parsed_home = parse_url( home_url( '/', ( is_ssl() ? 'https://' : 'http://' ) ) );
1472
+
1473
+ // Maybe include the port, if it's included
1474
+ if ( isset( $parsed_home['port'] ) ) {
1475
+ $parsed_host = $parsed_home['host'] . ':' . $parsed_home['port'];
1476
+ } else {
1477
+ $parsed_host = $parsed_home['host'];
1478
+ }
1479
+
1480
+ // Set the home URL for use in comparisons
1481
+ $home_url = trim( strtolower( $parsed_home['scheme'] . '://' . $parsed_host . $parsed_home['path'] ), '/' );
1482
+
1483
+ /** Requested URL *********************************************************/
1484
+
1485
+ // Maybe include the port, if it's included in home_url()
1486
+ if ( isset( $parsed_home['port'] ) ) {
1487
+ $request_host = $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'];
1488
+ } else {
1489
+ $request_host = $_SERVER['HTTP_HOST'];
1490
+ }
1491
 
1492
  // Build the currently requested URL
1493
  $scheme = is_ssl() ? 'https://' : 'http://';
1494
+ $requested_url = strtolower( $scheme . $request_host . $_SERVER['REQUEST_URI'] );
1495
+
1496
+ /** Look for match ********************************************************/
1497
 
1498
  // Filter the requested URL, for configurations like reverse proxying
1499
+ $matched_url = apply_filters( 'bbp_verify_nonce_request_url', $requested_url );
1500
 
1501
  // Check the nonce
1502
  $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false;
1503
 
1504
  // Nonce check failed
1505
+ if ( empty( $result ) || empty( $action ) || ( strpos( $matched_url, $home_url ) !== 0 ) ) {
1506
  $result = false;
1507
+ }
1508
 
1509
  // Do extra things
1510
  do_action( 'bbp_verify_nonce_request', $action, $result );
1577
  }
1578
 
1579
  // Only forum replies
1580
+ if ( !empty( $_GET['type'] ) && ( bbp_get_reply_post_type() === $_GET['type'] ) ) {
1581
 
1582
  // The query
1583
  $the_query = array(
1595
  bbp_display_replies_feed_rss2( $the_query );
1596
 
1597
  // Only forum topics
1598
+ } elseif ( !empty( $_GET['type'] ) && ( bbp_get_topic_post_type() === $_GET['type'] ) ) {
1599
 
1600
  // The query
1601
  $the_query = array(
includes/common/shortcodes.php CHANGED
@@ -105,7 +105,7 @@ class BBP_Shortcodes {
105
  * @uses do_action()
106
  */
107
  private function add_shortcodes() {
108
- foreach( (array) $this->codes as $code => $function ) {
109
  add_shortcode( $code, $function );
110
  }
111
  }
@@ -119,10 +119,10 @@ class BBP_Shortcodes {
119
  $bbp = bbpress();
120
 
121
  // Unset global queries
122
- $bbp->forum_query = new stdClass;
123
- $bbp->topic_query = new stdClass;
124
- $bbp->reply_query = new stdClass;
125
- $bbp->search_query = new stdClass;
126
 
127
  // Unset global ID's
128
  $bbp->current_forum_id = 0;
@@ -155,9 +155,6 @@ class BBP_Shortcodes {
155
  // Set query name
156
  bbp_set_query_name( $query_name );
157
 
158
- // Remove 'bbp_replace_the_content' filter to prevent infinite loops
159
- remove_filter( 'the_content', 'bbp_replace_the_content' );
160
-
161
  // Start output buffer
162
  ob_start();
163
  }
@@ -172,22 +169,14 @@ class BBP_Shortcodes {
172
  */
173
  private function end() {
174
 
175
- // Put output into usable variable
176
- $output = ob_get_contents();
177
-
178
  // Unset globals
179
  $this->unset_globals();
180
 
181
- // Flush the output buffer
182
- ob_end_clean();
183
-
184
  // Reset the query name
185
  bbp_reset_query_name();
186
 
187
- // Add 'bbp_replace_the_content' filter back (@see $this::start())
188
- add_filter( 'the_content', 'bbp_replace_the_content' );
189
-
190
- return $output;
191
  }
192
 
193
  /** Forum shortcodes ******************************************************/
@@ -377,17 +366,53 @@ class BBP_Shortcodes {
377
  * Display the topic form in an output buffer and return to ensure
378
  * post/page contents are displayed first.
379
  *
 
 
 
 
380
  * @since bbPress (r3031)
381
  *
 
 
382
  * @uses get_template_part()
 
383
  */
384
- public function display_topic_form() {
385
 
386
- // Start output buffer
387
- $this->start( 'bbp_topic_form' );
 
388
 
389
- // Output templates
390
- bbp_get_template_part( 'form', 'topic' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
 
392
  // Return contents of output buffer
393
  return $this->end();
@@ -620,6 +645,11 @@ class BBP_Shortcodes {
620
  */
621
  public function display_search_form() {
622
 
 
 
 
 
 
623
  // Start output buffer
624
  $this->start( 'bbp_search_form' );
625
 
@@ -644,8 +674,19 @@ class BBP_Shortcodes {
644
  public function display_search( $attr, $content = '' ) {
645
 
646
  // Sanity check required info
647
- if ( !empty( $content ) )
648
  return $content;
 
 
 
 
 
 
 
 
 
 
 
649
 
650
  // Set passed attribute to $search_terms for clarity
651
  $search_terms = empty( $attr['search'] ) ? bbp_get_search_terms() : $attr['search'];
@@ -738,7 +779,7 @@ class BBP_Shortcodes {
738
  bbp_get_template_part( 'form', 'user-lost-pass' );
739
  else
740
  bbp_get_template_part( 'feedback', 'logged-in' );
741
-
742
  // Return contents of output buffer
743
  return $this->end();
744
  }
105
  * @uses do_action()
106
  */
107
  private function add_shortcodes() {
108
+ foreach ( (array) $this->codes as $code => $function ) {
109
  add_shortcode( $code, $function );
110
  }
111
  }
119
  $bbp = bbpress();
120
 
121
  // Unset global queries
122
+ $bbp->forum_query = new WP_Query();
123
+ $bbp->topic_query = new WP_Query();
124
+ $bbp->reply_query = new WP_Query();
125
+ $bbp->search_query = new WP_Query();
126
 
127
  // Unset global ID's
128
  $bbp->current_forum_id = 0;
155
  // Set query name
156
  bbp_set_query_name( $query_name );
157
 
 
 
 
158
  // Start output buffer
159
  ob_start();
160
  }
169
  */
170
  private function end() {
171
 
 
 
 
172
  // Unset globals
173
  $this->unset_globals();
174
 
 
 
 
175
  // Reset the query name
176
  bbp_reset_query_name();
177
 
178
+ // Return and flush the output buffer
179
+ return ob_get_clean();
 
 
180
  }
181
 
182
  /** Forum shortcodes ******************************************************/
366
  * Display the topic form in an output buffer and return to ensure
367
  * post/page contents are displayed first.
368
  *
369
+ * Supports 'forum_id' attribute to display the topic form for a particular
370
+ * forum. This currently has styling issues from not being wrapped in
371
+ * <div id="bbpress-forums"></div> which will need to be sorted out later.
372
+ *
373
  * @since bbPress (r3031)
374
  *
375
+ * @param array $attr
376
+ * @param string $content
377
  * @uses get_template_part()
378
+ * @return string
379
  */
380
+ public function display_topic_form( $attr = array(), $content = '' ) {
381
 
382
+ // Sanity check supplied info
383
+ if ( !empty( $content ) || ( !empty( $attr['forum_id'] ) && ( !is_numeric( $attr['forum_id'] ) || !bbp_is_forum( $attr['forum_id'] ) ) ) )
384
+ return $content;
385
 
386
+ // Unset globals
387
+ $this->unset_globals();
388
+
389
+ // If forum id is set, use the 'bbp_single_forum' query name
390
+ if ( !empty( $attr['forum_id'] ) ) {
391
+
392
+ // Set the global current_forum_id for future requests
393
+ bbpress()->current_forum_id = $forum_id = bbp_get_forum_id( $attr['forum_id'] );
394
+
395
+ // Start output buffer
396
+ $this->start( 'bbp_single_forum' );
397
+
398
+ // No forum id was passed
399
+ } else {
400
+
401
+ // Set the $forum_id variable to satisfy checks below
402
+ $forum_id = 0;
403
+
404
+ // Start output buffer
405
+ $this->start( 'bbp_topic_form' );
406
+ }
407
+
408
+ // If the forum id is set, check forum caps else display normal topic form
409
+ if ( empty( $forum_id ) || bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
410
+ bbp_get_template_part( 'form', 'topic' );
411
+
412
+ // Forum is private and user does not have caps
413
+ } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
414
+ bbp_get_template_part( 'feedback', 'no-access' );
415
+ }
416
 
417
  // Return contents of output buffer
418
  return $this->end();
645
  */
646
  public function display_search_form() {
647
 
648
+ // Bail if search is disabled
649
+ if ( ! bbp_allow_search() ) {
650
+ return;
651
+ }
652
+
653
  // Start output buffer
654
  $this->start( 'bbp_search_form' );
655
 
674
  public function display_search( $attr, $content = '' ) {
675
 
676
  // Sanity check required info
677
+ if ( !empty( $content ) ) {
678
  return $content;
679
+ }
680
+
681
+ // Bail if search is disabled
682
+ if ( ! bbp_allow_search() ) {
683
+ return;
684
+ }
685
+
686
+ // Trim search attribute if it's set
687
+ if ( isset( $attr['search'] ) ) {
688
+ $attr['search'] = trim( $attr['search'] );
689
+ }
690
 
691
  // Set passed attribute to $search_terms for clarity
692
  $search_terms = empty( $attr['search'] ) ? bbp_get_search_terms() : $attr['search'];
779
  bbp_get_template_part( 'form', 'user-lost-pass' );
780
  else
781
  bbp_get_template_part( 'feedback', 'logged-in' );
782
+
783
  // Return contents of output buffer
784
  return $this->end();
785
  }
includes/common/{template-tags.php → template.php} RENAMED
@@ -24,7 +24,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
24
  * @param string $path Additional path with leading slash
25
  */
26
  function bbp_forums_url( $path = '/' ) {
27
- echo bbp_get_forums_url( $path );
28
  }
29
  /**
30
  * Return the forum URL
@@ -48,7 +48,7 @@ function bbp_forums_url( $path = '/' ) {
48
  * @param string $path Additional path with leading slash
49
  */
50
  function bbp_topics_url( $path = '/' ) {
51
- echo bbp_get_topics_url( $path );
52
  }
53
  /**
54
  * Return the forum URL
@@ -128,7 +128,7 @@ function bbp_is_forum( $post_id = 0 ) {
128
  $retval = false;
129
 
130
  // Supplied ID is a forum
131
- if ( !empty( $post_id ) && ( bbp_get_forum_post_type() == get_post_type( $post_id ) ))
132
  $retval = true;
133
 
134
  return (bool) apply_filters( 'bbp_is_forum', $retval, $post_id );
@@ -145,12 +145,13 @@ function bbp_is_forum( $post_id = 0 ) {
145
  * @return bool
146
  */
147
  function bbp_is_forum_archive() {
 
148
 
149
  // Default to false
150
  $retval = false;
151
 
152
  // In forum archive
153
- if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) )
154
  $retval = true;
155
 
156
  return (bool) apply_filters( 'bbp_is_forum_archive', $retval );
@@ -199,11 +200,11 @@ function bbp_is_forum_edit() {
199
  $retval = false;
200
 
201
  // Check query
202
- if ( !empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit == true ) )
203
  $retval = true;
204
 
205
  // Editing in admin
206
- elseif ( is_admin() && ( 'post.php' == $pagenow ) && ( get_post_type() == bbp_get_forum_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
207
  $retval = true;
208
 
209
  return (bool) apply_filters( 'bbp_is_forum_edit', $retval );
@@ -225,7 +226,7 @@ function bbp_is_topic( $post_id = 0 ) {
225
  $retval = false;
226
 
227
  // Supplied ID is a topic
228
- if ( !empty( $post_id ) && ( bbp_get_topic_post_type() == get_post_type( $post_id ) ) )
229
  $retval = true;
230
 
231
  return (bool) apply_filters( 'bbp_is_topic', $retval, $post_id );
@@ -296,11 +297,11 @@ function bbp_is_topic_edit() {
296
  $retval = false;
297
 
298
  // Check query
299
- if ( !empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit == true ) )
300
  $retval = true;
301
 
302
  // Editing in admin
303
- elseif ( is_admin() && ( 'post.php' == $pagenow ) && ( get_post_type() == bbp_get_topic_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
304
  $retval = true;
305
 
306
  return (bool) apply_filters( 'bbp_is_topic_edit', $retval );
@@ -320,7 +321,7 @@ function bbp_is_topic_merge() {
320
  $retval = false;
321
 
322
  // Check topic edit and GET params
323
- if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'merge' == $_GET['action'] ) )
324
  return true;
325
 
326
  return (bool) apply_filters( 'bbp_is_topic_merge', $retval );
@@ -340,7 +341,7 @@ function bbp_is_topic_split() {
340
  $retval = false;
341
 
342
  // Check topic edit and GET params
343
- if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'split' == $_GET['action'] ) )
344
  $retval = true;
345
 
346
  return (bool) apply_filters( 'bbp_is_topic_split', $retval );
@@ -392,11 +393,11 @@ function bbp_is_topic_tag_edit() {
392
  $retval = false;
393
 
394
  // Check query
395
- if ( !empty( $wp_query->bbp_is_topic_tag_edit ) && ( true == $wp_query->bbp_is_topic_tag_edit ) )
396
  $retval = true;
397
 
398
  // Editing in admin
399
- elseif ( is_admin() && ( 'edit-tags.php' == $pagenow ) && ( bbp_get_topic_tag_tax_id() == $taxnow ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
400
  $retval = true;
401
 
402
  return (bool) apply_filters( 'bbp_is_topic_tag_edit', $retval );
@@ -447,7 +448,7 @@ function bbp_is_reply( $post_id = 0 ) {
447
  $retval = false;
448
 
449
  // Supplied ID is a reply
450
- if ( !empty( $post_id ) && ( bbp_get_reply_post_type() == get_post_type( $post_id ) ) )
451
  $retval = true;
452
 
453
  return (bool) apply_filters( 'bbp_is_reply', $retval, $post_id );
@@ -468,11 +469,11 @@ function bbp_is_reply_edit() {
468
  $retval = false;
469
 
470
  // Check query
471
- if ( !empty( $wp_query->bbp_is_reply_edit ) && ( true == $wp_query->bbp_is_reply_edit ) )
472
  $retval = true;
473
 
474
  // Editing in admin
475
- elseif ( is_admin() && ( 'post.php' == $pagenow ) && ( get_post_type() == bbp_get_reply_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
476
  $retval = true;
477
 
478
  return (bool) apply_filters( 'bbp_is_reply_edit', $retval );
@@ -490,7 +491,7 @@ function bbp_is_reply_move() {
490
  $retval = false;
491
 
492
  // Check reply edit and GET params
493
- if ( bbp_is_reply_edit() && !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) )
494
  $retval = true;
495
 
496
  return (bool) apply_filters( 'bbp_is_reply_move', $retval );
@@ -538,7 +539,7 @@ function bbp_is_favorites() {
538
  $retval = false;
539
 
540
  // Check query
541
- if ( !empty( $wp_query->bbp_is_single_user_favs ) && ( true == $wp_query->bbp_is_single_user_favs ) )
542
  $retval = true;
543
 
544
  return (bool) apply_filters( 'bbp_is_favorites', $retval );
@@ -558,7 +559,7 @@ function bbp_is_subscriptions() {
558
  $retval = false;
559
 
560
  // Check query
561
- if ( !empty( $wp_query->bbp_is_single_user_subs ) && ( true == $wp_query->bbp_is_single_user_subs ) )
562
  $retval = true;
563
 
564
  return (bool) apply_filters( 'bbp_is_subscriptions', $retval );
@@ -579,7 +580,7 @@ function bbp_is_topics_created() {
579
  $retval = false;
580
 
581
  // Check query
582
- if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true == $wp_query->bbp_is_single_user_topics ) )
583
  $retval = true;
584
 
585
  return (bool) apply_filters( 'bbp_is_topics_created', $retval );
@@ -600,7 +601,7 @@ function bbp_is_replies_created() {
600
  $retval = false;
601
 
602
  // Check query
603
- if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true == $wp_query->bbp_is_single_user_replies ) )
604
  $retval = true;
605
 
606
  return (bool) apply_filters( 'bbp_is_replies_created', $retval );
@@ -623,7 +624,7 @@ function bbp_is_user_home() {
623
  $retval = false;
624
 
625
  // Check query
626
- if ( !empty( $wp_query->bbp_is_single_user_home ) && ( true == $wp_query->bbp_is_single_user_home ) )
627
  $retval = true;
628
 
629
  return (bool) apply_filters( 'bbp_is_user_home', $retval );
@@ -665,7 +666,7 @@ function bbp_is_single_user() {
665
  $retval = false;
666
 
667
  // Check query
668
- if ( !empty( $wp_query->bbp_is_single_user ) && ( true == $wp_query->bbp_is_single_user ) )
669
  $retval = true;
670
 
671
  return (bool) apply_filters( 'bbp_is_single_user', $retval );
@@ -686,7 +687,7 @@ function bbp_is_single_user_edit() {
686
  $retval = false;
687
 
688
  // Check query
689
- if ( !empty( $wp_query->bbp_is_single_user_edit ) && ( true == $wp_query->bbp_is_single_user_edit ) )
690
  $retval = true;
691
 
692
  return (bool) apply_filters( 'bbp_is_single_user_edit', $retval );
@@ -707,7 +708,7 @@ function bbp_is_single_user_profile() {
707
  $retval = false;
708
 
709
  // Check query
710
- if ( !empty( $wp_query->bbp_is_single_user_profile ) && ( true == $wp_query->bbp_is_single_user_profile ) )
711
  $retval = true;
712
 
713
  return (bool) apply_filters( 'bbp_is_single_user_profile', $retval );
@@ -728,7 +729,7 @@ function bbp_is_single_user_topics() {
728
  $retval = false;
729
 
730
  // Check query
731
- if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true == $wp_query->bbp_is_single_user_topics ) )
732
  $retval = true;
733
 
734
  return (bool) apply_filters( 'bbp_is_single_user_topics', $retval );
@@ -749,7 +750,7 @@ function bbp_is_single_user_replies() {
749
  $retval = false;
750
 
751
  // Check query
752
- if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true == $wp_query->bbp_is_single_user_replies ) )
753
  $retval = true;
754
 
755
  return (bool) apply_filters( 'bbp_is_single_user_replies', $retval );
@@ -771,7 +772,7 @@ function bbp_is_single_view() {
771
  $retval = false;
772
 
773
  // Check query
774
- if ( !empty( $wp_query->bbp_is_view ) && ( true == $wp_query->bbp_is_view ) )
775
  $retval = true;
776
 
777
  // Check query name
@@ -793,11 +794,15 @@ function bbp_is_single_view() {
793
  function bbp_is_search() {
794
  global $wp_query;
795
 
 
 
 
 
796
  // Assume false
797
  $retval = false;
798
 
799
  // Check query
800
- if ( !empty( $wp_query->bbp_is_search ) && ( true == $wp_query->bbp_is_search ) )
801
  $retval = true;
802
 
803
  // Check query name
@@ -805,12 +810,46 @@ function bbp_is_search() {
805
  $retval = true;
806
 
807
  // Check $_GET
808
- if ( empty( $retval ) && isset( $_GET[bbp_get_search_rewrite_id()] ) )
809
  $retval = true;
810
 
811
  return (bool) apply_filters( 'bbp_is_search', $retval );
812
  }
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  /**
815
  * Check if current page is an edit page
816
  *
@@ -826,7 +865,7 @@ function bbp_is_edit() {
826
  $retval = false;
827
 
828
  // Check query
829
- if ( !empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit == true ) )
830
  $retval = true;
831
 
832
  return (bool) apply_filters( 'bbp_is_edit', $retval );
@@ -957,6 +996,10 @@ function bbp_body_class( $wp_classes, $custom_classes = false ) {
957
  } elseif ( bbp_is_search() ) {
958
  $bbp_classes[] = 'bbp-search';
959
  $bbp_classes[] = 'forum-search';
 
 
 
 
960
  }
961
 
962
  /** Clean up **************************************************************/
@@ -1074,6 +1117,9 @@ function is_bbpress() {
1074
 
1075
  } elseif ( bbp_is_search() ) {
1076
  $retval = true;
 
 
 
1077
  }
1078
 
1079
  /** Done ******************************************************************/
@@ -1271,7 +1317,7 @@ function bbp_dropdown( $args = '' ) {
1271
  * anything smaller than 0 (due to the nature of select
1272
  * box, the first value would of course be selected -
1273
  * though you can have that as none (pass 'show_none' arg))
1274
- * - sort_column: Sort by? Defaults to 'menu_order, post_title'
1275
  * - post_parent: Post parent. Defaults to 0
1276
  * - post_status: Which all post_statuses to find in? Can be an array
1277
  * or CSV of publish, category, closed, private, spam,
@@ -1310,12 +1356,12 @@ function bbp_dropdown( $args = '' ) {
1310
  // Parse arguments against default values
1311
  $r = bbp_parse_args( $args, array(
1312
  'post_type' => bbp_get_forum_post_type(),
 
 
1313
  'selected' => 0,
1314
- 'sort_column' => 'menu_order',
1315
  'exclude' => array(),
1316
- 'post_parent' => null,
1317
  'numberposts' => -1,
1318
- 'orderby' => 'menu_order',
1319
  'order' => 'ASC',
1320
  'walker' => '',
1321
 
@@ -1344,42 +1390,12 @@ function bbp_dropdown( $args = '' ) {
1344
  $r['exclude'] = explode( ',', $r['exclude'] );
1345
  }
1346
 
1347
- /** Post Status *******************************************************/
1348
-
1349
- // Define local variable(s)
1350
- $post_stati = array();
1351
-
1352
- // Public
1353
- $post_stati[] = bbp_get_public_status_id();
1354
-
1355
- // Forums
1356
- if ( bbp_get_forum_post_type() == $r['post_type'] ) {
1357
-
1358
- // Private forums
1359
- if ( current_user_can( 'read_private_forums' ) ) {
1360
- $post_stati[] = bbp_get_private_status_id();
1361
- }
1362
-
1363
- // Hidden forums
1364
- if ( current_user_can( 'read_hidden_forums' ) ) {
1365
- $post_stati[] = bbp_get_hidden_status_id();
1366
- }
1367
- }
1368
-
1369
- // Setup the post statuses
1370
- $r['post_status'] = implode( ',', $post_stati );
1371
-
1372
  /** Setup variables ***************************************************/
1373
 
1374
- $name = esc_attr( $r['select_id'] );
1375
- $select_id = $name;
1376
- $tab = (int) $r['tab'];
1377
- $retval = '';
1378
- $disabled = disabled( isset( bbpress()->options[$r['disabled']] ), true, false );
1379
- $post_arr = array(
1380
  'post_type' => $r['post_type'],
1381
  'post_status' => $r['post_status'],
1382
- 'sort_column' => $r['sort_column'],
1383
  'exclude' => $r['exclude'],
1384
  'post_parent' => $r['post_parent'],
1385
  'numberposts' => $r['numberposts'],
@@ -1387,22 +1403,31 @@ function bbp_dropdown( $args = '' ) {
1387
  'order' => $r['order'],
1388
  'walker' => $r['walker'],
1389
  'disable_categories' => $r['disable_categories']
1390
- );
1391
-
1392
- $posts = get_posts( $post_arr );
1393
 
1394
  /** Drop Down *********************************************************/
1395
 
1396
  // Items found
1397
  if ( !empty( $posts ) ) {
 
 
1398
  if ( empty( $r['options_only'] ) ) {
1399
- $tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : '';
1400
- $retval .= '<select name="' . $name . '" id="' . $select_id . '"' . $tab . $disabled . '>' . "\n";
 
 
 
 
 
 
 
1401
  }
1402
 
1403
- $retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . $r['show_none'] . '</option>' : '';
 
1404
  $retval .= walk_page_dropdown_tree( $posts, 0, $r );
1405
 
 
1406
  if ( empty( $r['options_only'] ) ) {
1407
  $retval .= '</select>';
1408
  }
@@ -1544,6 +1569,7 @@ function bbp_reply_form_fields() {
1544
 
1545
  <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php bbp_reply_title(); ?>" />
1546
  <input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php bbp_reply_id(); ?>" />
 
1547
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-reply" />
1548
 
1549
  <?php if ( current_user_can( 'unfiltered_html' ) )
@@ -1555,6 +1581,7 @@ function bbp_reply_form_fields() {
1555
 
1556
  <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" />
1557
  <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" />
 
1558
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-reply" />
1559
 
1560
  <?php if ( current_user_can( 'unfiltered_html' ) )
@@ -1576,8 +1603,7 @@ function bbp_reply_form_fields() {
1576
  * @since bbPress (r2690)
1577
  *
1578
  * @uses bbp_displayed_user_id() To output the displayed user id
1579
- * @uses wp_nonce_field() To generate a hidden nonce field
1580
- * @uses wp_referer_field() To generate a hidden referer field
1581
  */
1582
  function bbp_edit_user_form_fields() {
1583
  ?>
@@ -1687,7 +1713,7 @@ function bbp_the_content( $args = array() ) {
1687
  ), 'get_the_content' );
1688
 
1689
  // If using tinymce, remove our escaping and trust tinymce
1690
- if ( bbp_use_wp_editor() && ( true === $r['tinymce'] ) ) {
1691
  remove_filter( 'bbp_get_form_forum_content', 'esc_textarea' );
1692
  remove_filter( 'bbp_get_form_topic_content', 'esc_textarea' );
1693
  remove_filter( 'bbp_get_form_reply_content', 'esc_textarea' );
@@ -1751,10 +1777,7 @@ function bbp_the_content( $args = array() ) {
1751
  }
1752
 
1753
  // Put the output into a usable variable
1754
- $output = ob_get_contents();
1755
-
1756
- // Flush the output buffer
1757
- ob_end_clean();
1758
 
1759
  return apply_filters( 'bbp_get_the_content', $output, $args, $post_content );
1760
  }
@@ -1772,7 +1795,7 @@ function bbp_get_tiny_mce_plugins( $plugins = array() ) {
1772
 
1773
  // Unset fullscreen
1774
  foreach ( $plugins as $key => $value ) {
1775
- if ( 'fullscreen' == $value ) {
1776
  unset( $plugins[$key] );
1777
  break;
1778
  }
@@ -1917,7 +1940,7 @@ function bbp_view_title( $view = '' ) {
1917
  * @uses bbp_get_view_url() To get the view url
1918
  */
1919
  function bbp_view_url( $view = false ) {
1920
- echo bbp_get_view_url( $view );
1921
  }
1922
  /**
1923
  * Return the view url
@@ -1963,7 +1986,7 @@ function bbp_view_url( $view = false ) {
1963
  * @return bool True if match, false if not
1964
  */
1965
  function bbp_is_query_name( $name = '' ) {
1966
- return (bool) ( bbp_get_query_name() == $name );
1967
  }
1968
 
1969
  /**
@@ -2097,7 +2120,7 @@ function bbp_breadcrumb( $args = array() ) {
2097
  /** Includes **********************************************************/
2098
 
2099
  // Root slug is also the front page
2100
- if ( !empty( $front_id ) && ( $front_id == $root_id ) ) {
2101
  $pre_include_root = false;
2102
  }
2103
 
@@ -2107,7 +2130,7 @@ function bbp_breadcrumb( $args = array() ) {
2107
  }
2108
 
2109
  // Don't show root if viewing page in place of forum archive
2110
- if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id == get_the_ID() ) ) ) {
2111
  $pre_include_root = false;
2112
  }
2113
 
@@ -2149,7 +2172,7 @@ function bbp_breadcrumb( $args = array() ) {
2149
 
2150
  // If capable, include a link to edit the tag
2151
  if ( current_user_can( 'manage_topic_tags' ) ) {
2152
- $tag_data[] = '<a href="' . bbp_get_topic_tag_edit_link() . '" class="bbp-edit-topic-tag-link">' . __( '(Edit)', 'bbpress' ) . '</a>';
2153
  }
2154
 
2155
  // Implode the results of the tag data
@@ -2224,14 +2247,14 @@ function bbp_breadcrumb( $args = array() ) {
2224
  }
2225
 
2226
  // Add the breadcrumb
2227
- $crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';
2228
  }
2229
 
2230
  // Ancestors exist
2231
  if ( !empty( $ancestors ) ) {
2232
 
2233
  // Loop through parents
2234
- foreach( (array) $ancestors as $parent_id ) {
2235
 
2236
  // Parents
2237
  $parent = get_post( $parent_id );
@@ -2245,39 +2268,39 @@ function bbp_breadcrumb( $args = array() ) {
2245
 
2246
  // Forum
2247
  case bbp_get_forum_post_type() :
2248
- $crumbs[] = '<a href="' . bbp_get_forum_permalink( $parent->ID ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title( $parent->ID ) . '</a>';
2249
  break;
2250
 
2251
  // Topic
2252
  case bbp_get_topic_post_type() :
2253
- $crumbs[] = '<a href="' . bbp_get_topic_permalink( $parent->ID ) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title( $parent->ID ) . '</a>';
2254
  break;
2255
 
2256
  // Reply (Note: not in most themes)
2257
  case bbp_get_reply_post_type() :
2258
- $crumbs[] = '<a href="' . bbp_get_reply_permalink( $parent->ID ) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title( $parent->ID ) . '</a>';
2259
  break;
2260
 
2261
  // WordPress Post/Page/Other
2262
  default :
2263
- $crumbs[] = '<a href="' . get_permalink( $parent->ID ) . '" class="bbp-breadcrumb-item">' . get_the_title( $parent->ID ) . '</a>';
2264
  break;
2265
  }
2266
  }
2267
 
2268
  // Edit topic tag
2269
  } elseif ( bbp_is_topic_tag_edit() ) {
2270
- $crumbs[] = '<a href="' . get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>';
2271
 
2272
  // Search
2273
  } elseif ( bbp_is_search() && bbp_get_search_terms() ) {
2274
- $crumbs[] = '<a href="' . home_url( bbp_get_search_slug() ) . '" class="bbp-breadcrumb-search">' . __( 'Search', 'bbpress' ) . '</a>';
2275
  }
2276
 
2277
  /** Current ***********************************************************/
2278
 
2279
  // Add current page to breadcrumb
2280
- if ( !empty( $r['include_current'] ) || empty( $r['pre_current_text'] ) ) {
2281
  $crumbs[] = $r['current_before'] . $r['current_text'] . $r['current_after'];
2282
  }
2283
 
@@ -2386,7 +2409,7 @@ function bbp_template_notices() {
2386
 
2387
  // Loop through notices and separate errors from messages
2388
  foreach ( $bbp->errors->get_error_messages( $code ) as $error ) {
2389
- if ( 'message' == $severity ) {
2390
  $messages[] = $error;
2391
  } else {
2392
  $errors[] = $error;
@@ -2442,7 +2465,7 @@ function bbp_logout_link( $redirect_to = '' ) {
2442
  * @return string The logout link
2443
  */
2444
  function bbp_get_logout_link( $redirect_to = '' ) {
2445
- return apply_filters( 'bbp_get_logout_link', '<a href="' . wp_logout_url( $redirect_to ) . '" class="button logout-link">' . __( 'Log Out', 'bbpress' ) . '</a>', $redirect_to );
2446
  }
2447
 
2448
  /** Title *********************************************************************/
@@ -2481,34 +2504,61 @@ function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
2481
  // Store original title to compare
2482
  $_title = $title;
2483
 
 
 
 
2484
  /** Archives **************************************************************/
2485
 
2486
  // Forum Archive
2487
  if ( bbp_is_forum_archive() ) {
2488
- $title = bbp_get_forum_archive_title();
2489
 
2490
  // Topic Archive
2491
  } elseif ( bbp_is_topic_archive() ) {
2492
- $title = bbp_get_topic_archive_title();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2493
 
2494
  /** Singles ***************************************************************/
2495
 
2496
  // Forum page
2497
  } elseif ( bbp_is_single_forum() ) {
2498
- $title = sprintf( __( 'Forum: %s', 'bbpress' ), bbp_get_forum_title() );
 
2499
 
2500
  // Topic page
2501
  } elseif ( bbp_is_single_topic() ) {
2502
- $title = sprintf( __( 'Topic: %s', 'bbpress' ), bbp_get_topic_title() );
 
2503
 
2504
  // Replies
2505
  } elseif ( bbp_is_single_reply() ) {
2506
- $title = bbp_get_reply_title();
2507
 
2508
- // Topic tag page (or edit)
2509
- } elseif ( bbp_is_topic_tag() || bbp_is_topic_tag_edit() || get_query_var( 'bbp_topic_tag' ) ) {
2510
- $term = get_queried_object();
2511
- $title = sprintf( __( 'Topic Tag: %s', 'bbpress' ), $term->name );
2512
 
2513
  /** Users *****************************************************************/
2514
 
@@ -2517,12 +2567,12 @@ function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
2517
 
2518
  // Current users profile
2519
  if ( bbp_is_user_home() ) {
2520
- $title = __( 'Your Profile', 'bbpress' );
2521
 
2522
  // Other users profile
2523
  } else {
2524
- $userdata = get_userdata( bbp_get_user_id() );
2525
- $title = sprintf( __( '%s\'s Profile', 'bbpress' ), $userdata->display_name );
2526
  }
2527
 
2528
  // Profile edit page
@@ -2530,32 +2580,45 @@ function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
2530
 
2531
  // Current users profile
2532
  if ( bbp_is_user_home_edit() ) {
2533
- $title = __( 'Edit Your Profile', 'bbpress' );
2534
 
2535
  // Other users profile
2536
  } else {
2537
- $userdata = get_userdata( bbp_get_user_id() );
2538
- $title = sprintf( __( 'Edit %s\'s Profile', 'bbpress' ), $userdata->display_name );
2539
  }
2540
 
2541
  /** Views *****************************************************************/
2542
 
2543
  // Views
2544
  } elseif ( bbp_is_single_view() ) {
2545
- $title = sprintf( __( 'View: %s', 'bbpress' ), bbp_get_view_title() );
 
2546
 
2547
  /** Search ****************************************************************/
2548
 
2549
  // Search
2550
  } elseif ( bbp_is_search() ) {
2551
- $title = bbp_get_search_title();
2552
  }
2553
 
 
 
 
 
 
 
 
 
 
 
 
 
2554
  // Filter the raw title
2555
  $title = apply_filters( 'bbp_raw_title', $title, $sep, $seplocation );
2556
 
2557
  // Compare new title with original title
2558
- if ( $title == $_title )
2559
  return $title;
2560
 
2561
  // Temporary separator, for accurate flipping, if necessary
@@ -2566,7 +2629,7 @@ function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
2566
  $prefix = " $sep ";
2567
 
2568
  // sep on right, so reverse the order
2569
- if ( 'right' == $seplocation ) {
2570
  $title_array = array_reverse( explode( $t_sep, $title ) );
2571
  $title = implode( " $sep ", $title_array ) . $prefix;
2572
 
24
  * @param string $path Additional path with leading slash
25
  */
26
  function bbp_forums_url( $path = '/' ) {
27
+ echo esc_url( bbp_get_forums_url( $path ) );
28
  }
29
  /**
30
  * Return the forum URL
48
  * @param string $path Additional path with leading slash
49
  */
50
  function bbp_topics_url( $path = '/' ) {
51
+ echo esc_url( bbp_get_topics_url( $path ) );
52
  }
53
  /**
54
  * Return the forum URL
128
  $retval = false;
129
 
130
  // Supplied ID is a forum
131
+ if ( !empty( $post_id ) && ( bbp_get_forum_post_type() === get_post_type( $post_id ) ) )
132
  $retval = true;
133
 
134
  return (bool) apply_filters( 'bbp_is_forum', $retval, $post_id );
145
  * @return bool
146
  */
147
  function bbp_is_forum_archive() {
148
+ global $wp_query;
149
 
150
  // Default to false
151
  $retval = false;
152
 
153
  // In forum archive
154
+ if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || !empty( $wp_query->bbp_show_topics_on_root ) )
155
  $retval = true;
156
 
157
  return (bool) apply_filters( 'bbp_is_forum_archive', $retval );
200
  $retval = false;
201
 
202
  // Check query
203
+ if ( !empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) )
204
  $retval = true;
205
 
206
  // Editing in admin
207
+ elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_forum_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
208
  $retval = true;
209
 
210
  return (bool) apply_filters( 'bbp_is_forum_edit', $retval );
226
  $retval = false;
227
 
228
  // Supplied ID is a topic
229
+ if ( !empty( $post_id ) && ( bbp_get_topic_post_type() === get_post_type( $post_id ) ) )
230
  $retval = true;
231
 
232
  return (bool) apply_filters( 'bbp_is_topic', $retval, $post_id );
297
  $retval = false;
298
 
299
  // Check query
300
+ if ( !empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) )
301
  $retval = true;
302
 
303
  // Editing in admin
304
+ elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_topic_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
305
  $retval = true;
306
 
307
  return (bool) apply_filters( 'bbp_is_topic_edit', $retval );
321
  $retval = false;
322
 
323
  // Check topic edit and GET params
324
+ if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'merge' === $_GET['action'] ) )
325
  return true;
326
 
327
  return (bool) apply_filters( 'bbp_is_topic_merge', $retval );
341
  $retval = false;
342
 
343
  // Check topic edit and GET params
344
+ if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'split' === $_GET['action'] ) )
345
  $retval = true;
346
 
347
  return (bool) apply_filters( 'bbp_is_topic_split', $retval );
393
  $retval = false;
394
 
395
  // Check query
396
+ if ( !empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) )
397
  $retval = true;
398
 
399
  // Editing in admin
400
+ elseif ( is_admin() && ( 'edit-tags.php' === $pagenow ) && ( bbp_get_topic_tag_tax_id() === $taxnow ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
401
  $retval = true;
402
 
403
  return (bool) apply_filters( 'bbp_is_topic_tag_edit', $retval );
448
  $retval = false;
449
 
450
  // Supplied ID is a reply
451
+ if ( !empty( $post_id ) && ( bbp_get_reply_post_type() === get_post_type( $post_id ) ) )
452
  $retval = true;
453
 
454
  return (bool) apply_filters( 'bbp_is_reply', $retval, $post_id );
469
  $retval = false;
470
 
471
  // Check query
472
+ if ( !empty( $wp_query->bbp_is_reply_edit ) && ( true === $wp_query->bbp_is_reply_edit ) )
473
  $retval = true;
474
 
475
  // Editing in admin
476
+ elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_reply_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
477
  $retval = true;
478
 
479
  return (bool) apply_filters( 'bbp_is_reply_edit', $retval );
491
  $retval = false;
492
 
493
  // Check reply edit and GET params
494
+ if ( bbp_is_reply_edit() && !empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) )
495
  $retval = true;
496
 
497
  return (bool) apply_filters( 'bbp_is_reply_move', $retval );
539
  $retval = false;
540
 
541
  // Check query
542
+ if ( !empty( $wp_query->bbp_is_single_user_favs ) && ( true === $wp_query->bbp_is_single_user_favs ) )
543
  $retval = true;
544
 
545
  return (bool) apply_filters( 'bbp_is_favorites', $retval );
559
  $retval = false;
560
 
561
  // Check query
562
+ if ( !empty( $wp_query->bbp_is_single_user_subs ) && ( true === $wp_query->bbp_is_single_user_subs ) )
563
  $retval = true;
564
 
565
  return (bool) apply_filters( 'bbp_is_subscriptions', $retval );
580
  $retval = false;
581
 
582
  // Check query
583
+ if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) )
584
  $retval = true;
585
 
586
  return (bool) apply_filters( 'bbp_is_topics_created', $retval );
601
  $retval = false;
602
 
603
  // Check query
604
+ if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) )
605
  $retval = true;
606
 
607
  return (bool) apply_filters( 'bbp_is_replies_created', $retval );
624
  $retval = false;
625
 
626
  // Check query
627
+ if ( !empty( $wp_query->bbp_is_single_user_home ) && ( true === $wp_query->bbp_is_single_user_home ) )
628
  $retval = true;
629
 
630
  return (bool) apply_filters( 'bbp_is_user_home', $retval );
666
  $retval = false;
667
 
668
  // Check query
669
+ if ( !empty( $wp_query->bbp_is_single_user ) && ( true === $wp_query->bbp_is_single_user ) )
670
  $retval = true;
671
 
672
  return (bool) apply_filters( 'bbp_is_single_user', $retval );
687
  $retval = false;
688
 
689
  // Check query
690
+ if ( !empty( $wp_query->bbp_is_single_user_edit ) && ( true === $wp_query->bbp_is_single_user_edit ) )
691
  $retval = true;
692
 
693
  return (bool) apply_filters( 'bbp_is_single_user_edit', $retval );
708
  $retval = false;
709
 
710
  // Check query
711
+ if ( !empty( $wp_query->bbp_is_single_user_profile ) && ( true === $wp_query->bbp_is_single_user_profile ) )
712
  $retval = true;
713
 
714
  return (bool) apply_filters( 'bbp_is_single_user_profile', $retval );
729
  $retval = false;
730
 
731
  // Check query
732
+ if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) )
733
  $retval = true;
734
 
735
  return (bool) apply_filters( 'bbp_is_single_user_topics', $retval );
750
  $retval = false;
751
 
752
  // Check query
753
+ if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) )
754
  $retval = true;
755
 
756
  return (bool) apply_filters( 'bbp_is_single_user_replies', $retval );
772
  $retval = false;
773
 
774
  // Check query
775
+ if ( !empty( $wp_query->bbp_is_view ) && ( true === $wp_query->bbp_is_view ) )
776
  $retval = true;
777
 
778
  // Check query name
794
  function bbp_is_search() {
795
  global $wp_query;
796
 
797
+ // Bail if search is disabled
798
+ if ( ! bbp_allow_search() )
799
+ return false;
800
+
801
  // Assume false
802
  $retval = false;
803
 
804
  // Check query
805
+ if ( !empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) )
806
  $retval = true;
807
 
808
  // Check query name
810
  $retval = true;
811
 
812
  // Check $_GET
813
+ if ( empty( $retval ) && isset( $_REQUEST[ bbp_get_search_rewrite_id() ] ) && empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) )
814
  $retval = true;
815
 
816
  return (bool) apply_filters( 'bbp_is_search', $retval );
817
  }
818
 
819
+ /**
820
+ * Check if current page is a search results page
821
+ *
822
+ * @since bbPress (r4919)
823
+ *
824
+ * @global WP_Query $wp_query To check if WP_Query::bbp_is_search is true
825
+ * @uses bbp_is_query_name() To get the query name
826
+ * @return bool Is it a search page?
827
+ */
828
+ function bbp_is_search_results() {
829
+ global $wp_query;
830
+
831
+ // Bail if search is disabled
832
+ if ( ! bbp_allow_search() )
833
+ return false;
834
+
835
+ // Assume false
836
+ $retval = false;
837
+
838
+ // Check query
839
+ if ( !empty( $wp_query->bbp_search_terms ) )
840
+ $retval = true;
841
+
842
+ // Check query name
843
+ if ( empty( $retval ) && bbp_is_query_name( 'bbp_search_results' ) )
844
+ $retval = true;
845
+
846
+ // Check $_REQUEST
847
+ if ( empty( $retval ) && !empty( $_REQUEST[bbp_get_search_rewrite_id()] ) )
848
+ $retval = true;
849
+
850
+ return (bool) apply_filters( 'bbp_is_search_results', $retval );
851
+ }
852
+
853
  /**
854
  * Check if current page is an edit page
855
  *
865
  $retval = false;
866
 
867
  // Check query
868
+ if ( !empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) )
869
  $retval = true;
870
 
871
  return (bool) apply_filters( 'bbp_is_edit', $retval );
996
  } elseif ( bbp_is_search() ) {
997
  $bbp_classes[] = 'bbp-search';
998
  $bbp_classes[] = 'forum-search';
999
+
1000
+ } elseif ( bbp_is_search_results() ) {
1001
+ $bbp_classes[] = 'bbp-search-results';
1002
+ $bbp_classes[] = 'forum-search-results';
1003
  }
1004
 
1005
  /** Clean up **************************************************************/
1117
 
1118
  } elseif ( bbp_is_search() ) {
1119
  $retval = true;
1120
+
1121
+ } elseif ( bbp_is_search_results() ) {
1122
+ $retval = true;
1123
  }
1124
 
1125
  /** Done ******************************************************************/
1317
  * anything smaller than 0 (due to the nature of select
1318
  * box, the first value would of course be selected -
1319
  * though you can have that as none (pass 'show_none' arg))
1320
+ * - orderby: Defaults to 'menu_order title'
1321
  * - post_parent: Post parent. Defaults to 0
1322
  * - post_status: Which all post_statuses to find in? Can be an array
1323
  * or CSV of publish, category, closed, private, spam,
1356
  // Parse arguments against default values
1357
  $r = bbp_parse_args( $args, array(
1358
  'post_type' => bbp_get_forum_post_type(),
1359
+ 'post_parent' => null,
1360
+ 'post_status' => null,
1361
  'selected' => 0,
 
1362
  'exclude' => array(),
 
1363
  'numberposts' => -1,
1364
+ 'orderby' => 'menu_order title',
1365
  'order' => 'ASC',
1366
  'walker' => '',
1367
 
1390
  $r['exclude'] = explode( ',', $r['exclude'] );
1391
  }
1392
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1393
  /** Setup variables ***************************************************/
1394
 
1395
+ $retval = '';
1396
+ $posts = get_posts( array(
 
 
 
 
1397
  'post_type' => $r['post_type'],
1398
  'post_status' => $r['post_status'],
 
1399
  'exclude' => $r['exclude'],
1400
  'post_parent' => $r['post_parent'],
1401
  'numberposts' => $r['numberposts'],
1403
  'order' => $r['order'],
1404
  'walker' => $r['walker'],
1405
  'disable_categories' => $r['disable_categories']
1406
+ ) );
 
 
1407
 
1408
  /** Drop Down *********************************************************/
1409
 
1410
  // Items found
1411
  if ( !empty( $posts ) ) {
1412
+
1413
+ // Build the opening tag for the select element
1414
  if ( empty( $r['options_only'] ) ) {
1415
+
1416
+ // Should this select appear disabled?
1417
+ $disabled = disabled( isset( bbpress()->options[ $r['disabled'] ] ), true, false );
1418
+
1419
+ // Setup the tab index attribute
1420
+ $tab = !empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : '';
1421
+
1422
+ // Build the opening tag
1423
+ $retval .= '<select name="' . esc_attr( $r['select_id'] ) . '" id="' . esc_attr( $r['select_id'] ) . '"' . $disabled . $tab . '>' . "\n";
1424
  }
1425
 
1426
+ // Get the options
1427
+ $retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . esc_html( $r['show_none'] ) . '</option>' : '';
1428
  $retval .= walk_page_dropdown_tree( $posts, 0, $r );
1429
 
1430
+ // Build the closing tag for the select element
1431
  if ( empty( $r['options_only'] ) ) {
1432
  $retval .= '</select>';
1433
  }
1569
 
1570
  <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php bbp_reply_title(); ?>" />
1571
  <input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php bbp_reply_id(); ?>" />
1572
+ <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" />
1573
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-reply" />
1574
 
1575
  <?php if ( current_user_can( 'unfiltered_html' ) )
1581
 
1582
  <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" />
1583
  <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" />
1584
+ <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" />
1585
  <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-reply" />
1586
 
1587
  <?php if ( current_user_can( 'unfiltered_html' ) )
1603
  * @since bbPress (r2690)
1604
  *
1605
  * @uses bbp_displayed_user_id() To output the displayed user id
1606
+ * @uses wp_nonce_field() To generate a hidden referer field
 
1607
  */
1608
  function bbp_edit_user_form_fields() {
1609
  ?>
1713
  ), 'get_the_content' );
1714
 
1715
  // If using tinymce, remove our escaping and trust tinymce
1716
+ if ( bbp_use_wp_editor() && ( false !== $r['tinymce'] ) ) {
1717
  remove_filter( 'bbp_get_form_forum_content', 'esc_textarea' );
1718
  remove_filter( 'bbp_get_form_topic_content', 'esc_textarea' );
1719
  remove_filter( 'bbp_get_form_reply_content', 'esc_textarea' );
1777
  }
1778
 
1779
  // Put the output into a usable variable
1780
+ $output = ob_get_clean();
 
 
 
1781
 
1782
  return apply_filters( 'bbp_get_the_content', $output, $args, $post_content );
1783
  }
1795
 
1796
  // Unset fullscreen
1797
  foreach ( $plugins as $key => $value ) {
1798
+ if ( 'fullscreen' === $value ) {
1799
  unset( $plugins[$key] );
1800
  break;
1801
  }
1940
  * @uses bbp_get_view_url() To get the view url
1941
  */
1942
  function bbp_view_url( $view = false ) {
1943
+ echo esc_url( bbp_get_view_url( $view ) );
1944
  }
1945
  /**
1946
  * Return the view url
1986
  * @return bool True if match, false if not
1987
  */
1988
  function bbp_is_query_name( $name = '' ) {
1989
+ return (bool) ( bbp_get_query_name() === $name );
1990
  }
1991
 
1992
  /**
2120
  /** Includes **********************************************************/
2121
 
2122
  // Root slug is also the front page
2123
+ if ( !empty( $front_id ) && ( $front_id === $root_id ) ) {
2124
  $pre_include_root = false;
2125
  }
2126
 
2130
  }
2131
 
2132
  // Don't show root if viewing page in place of forum archive
2133
+ if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) {
2134
  $pre_include_root = false;
2135
  }
2136
 
2172
 
2173
  // If capable, include a link to edit the tag
2174
  if ( current_user_can( 'manage_topic_tags' ) ) {
2175
+ $tag_data[] = '<a href="' . esc_url( bbp_get_topic_tag_edit_link() ) . '" class="bbp-edit-topic-tag-link">' . esc_html__( '(Edit)', 'bbpress' ) . '</a>';
2176
  }
2177
 
2178
  // Implode the results of the tag data
2247
  }
2248
 
2249
  // Add the breadcrumb
2250
+ $crumbs[] = '<a href="' . esc_url( $root_url ) . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';
2251
  }
2252
 
2253
  // Ancestors exist
2254
  if ( !empty( $ancestors ) ) {
2255
 
2256
  // Loop through parents
2257
+ foreach ( (array) $ancestors as $parent_id ) {
2258
 
2259
  // Parents
2260
  $parent = get_post( $parent_id );
2268
 
2269
  // Forum
2270
  case bbp_get_forum_post_type() :
2271
+ $crumbs[] = '<a href="' . esc_url( bbp_get_forum_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title( $parent->ID ) . '</a>';
2272
  break;
2273
 
2274
  // Topic
2275
  case bbp_get_topic_post_type() :
2276
+ $crumbs[] = '<a href="' . esc_url( bbp_get_topic_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title( $parent->ID ) . '</a>';
2277
  break;
2278
 
2279
  // Reply (Note: not in most themes)
2280
  case bbp_get_reply_post_type() :
2281
+ $crumbs[] = '<a href="' . esc_url( bbp_get_reply_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title( $parent->ID ) . '</a>';
2282
  break;
2283
 
2284
  // WordPress Post/Page/Other
2285
  default :
2286
+ $crumbs[] = '<a href="' . esc_url( get_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-item">' . get_the_title( $parent->ID ) . '</a>';
2287
  break;
2288
  }
2289
  }
2290
 
2291
  // Edit topic tag
2292
  } elseif ( bbp_is_topic_tag_edit() ) {
2293
+ $crumbs[] = '<a href="' . esc_url( get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>';
2294
 
2295
  // Search
2296
  } elseif ( bbp_is_search() && bbp_get_search_terms() ) {
2297
+ $crumbs[] = '<a href="' . esc_url( bbp_get_search_url() ) . '" class="bbp-breadcrumb-search">' . esc_html__( 'Search', 'bbpress' ) . '</a>';
2298
  }
2299
 
2300
  /** Current ***********************************************************/
2301
 
2302
  // Add current page to breadcrumb
2303
+ if ( !empty( $r['include_current'] ) || empty( $r['current_text'] ) ) {
2304
  $crumbs[] = $r['current_before'] . $r['current_text'] . $r['current_after'];
2305
  }
2306
 
2409
 
2410
  // Loop through notices and separate errors from messages
2411
  foreach ( $bbp->errors->get_error_messages( $code ) as $error ) {
2412
+ if ( 'message' === $severity ) {
2413
  $messages[] = $error;
2414
  } else {
2415
  $errors[] = $error;
2465
  * @return string The logout link
2466
  */
2467
  function bbp_get_logout_link( $redirect_to = '' ) {
2468
+ return apply_filters( 'bbp_get_logout_link', '<a href="' . wp_logout_url( $redirect_to ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>', $redirect_to );
2469
  }
2470
 
2471
  /** Title *********************************************************************/
2504
  // Store original title to compare
2505
  $_title = $title;
2506
 
2507
+ // Title array
2508
+ $title = array();
2509
+
2510
  /** Archives **************************************************************/
2511
 
2512
  // Forum Archive
2513
  if ( bbp_is_forum_archive() ) {
2514
+ $title['text'] = bbp_get_forum_archive_title();
2515
 
2516
  // Topic Archive
2517
  } elseif ( bbp_is_topic_archive() ) {
2518
+ $title['text'] = bbp_get_topic_archive_title();
2519
+
2520
+ /** Edit ******************************************************************/
2521
+
2522
+ // Forum edit page
2523
+ } elseif ( bbp_is_forum_edit() ) {
2524
+ $title['text'] = bbp_get_forum_title();
2525
+ $title['format'] = esc_attr__( 'Forum Edit: %s', 'bbpress' );
2526
+
2527
+ // Topic edit page
2528
+ } elseif ( bbp_is_topic_edit() ) {
2529
+ $title['text'] = bbp_get_topic_title();
2530
+ $title['format'] = esc_attr__( 'Topic Edit: %s', 'bbpress' );
2531
+
2532
+ // Reply edit page
2533
+ } elseif ( bbp_is_reply_edit() ) {
2534
+ $title['text'] = bbp_get_reply_title();
2535
+ $title['format'] = esc_attr__( 'Reply Edit: %s', 'bbpress' );
2536
+
2537
+ // Topic tag edit page
2538
+ } elseif ( bbp_is_topic_tag_edit() ) {
2539
+ $title['text'] = bbp_get_topic_tag_name();
2540
+ $title['format'] = esc_attr__( 'Topic Tag Edit: %s', 'bbpress' );
2541
 
2542
  /** Singles ***************************************************************/
2543
 
2544
  // Forum page
2545
  } elseif ( bbp_is_single_forum() ) {
2546
+ $title['text'] = bbp_get_forum_title();
2547
+ $title['format'] = esc_attr__( 'Forum: %s', 'bbpress' );
2548
 
2549
  // Topic page
2550
  } elseif ( bbp_is_single_topic() ) {
2551
+ $title['text'] = bbp_get_topic_title();
2552
+ $title['format'] = esc_attr__( 'Topic: %s', 'bbpress' );
2553
 
2554
  // Replies
2555
  } elseif ( bbp_is_single_reply() ) {
2556
+ $title['text'] = bbp_get_reply_title();
2557
 
2558
+ // Topic tag page
2559
+ } elseif ( bbp_is_topic_tag() || get_query_var( 'bbp_topic_tag' ) ) {
2560
+ $title['text'] = bbp_get_topic_tag_name();
2561
+ $title['format'] = esc_attr__( 'Topic Tag: %s', 'bbpress' );
2562
 
2563
  /** Users *****************************************************************/
2564
 
2567
 
2568
  // Current users profile
2569
  if ( bbp_is_user_home() ) {
2570
+ $title['text'] = esc_attr__( 'Your Profile', 'bbpress' );
2571
 
2572
  // Other users profile
2573
  } else {
2574
+ $title['text'] = get_userdata( bbp_get_user_id() )->display_name;
2575
+ $title['format'] = esc_attr__( "%s's Profile", 'bbpress' );
2576
  }
2577
 
2578
  // Profile edit page
2580
 
2581
  // Current users profile
2582
  if ( bbp_is_user_home_edit() ) {
2583
+ $title['text'] = esc_attr__( 'Edit Your Profile', 'bbpress' );
2584
 
2585
  // Other users profile
2586
  } else {
2587
+ $title['text'] = get_userdata( bbp_get_user_id() )->display_name;
2588
+ $title['format'] = esc_attr__( "Edit %s's Profile", 'bbpress' );
2589
  }
2590
 
2591
  /** Views *****************************************************************/
2592
 
2593
  // Views
2594
  } elseif ( bbp_is_single_view() ) {
2595
+ $title['text'] = bbp_get_view_title();
2596
+ $title['format'] = esc_attr__( 'View: %s', 'bbpress' );
2597
 
2598
  /** Search ****************************************************************/
2599
 
2600
  // Search
2601
  } elseif ( bbp_is_search() ) {
2602
+ $title['text'] = bbp_get_search_title();
2603
  }
2604
 
2605
+ // This filter is deprecated. Use 'bbp_before_title_parse_args' instead.
2606
+ $title = apply_filters( 'bbp_raw_title_array', $title );
2607
+
2608
+ // Set title array defaults
2609
+ $title = bbp_parse_args( $title, array(
2610
+ 'text' => '',
2611
+ 'format' => '%s'
2612
+ ), 'title' );
2613
+
2614
+ // Get the formatted raw title
2615
+ $title = sprintf( $title['format'], $title['text'] );
2616
+
2617
  // Filter the raw title
2618
  $title = apply_filters( 'bbp_raw_title', $title, $sep, $seplocation );
2619
 
2620
  // Compare new title with original title
2621
+ if ( $title === $_title )
2622
  return $title;
2623
 
2624
  // Temporary separator, for accurate flipping, if necessary
2629
  $prefix = " $sep ";
2630
 
2631
  // sep on right, so reverse the order
2632
+ if ( 'right' === $seplocation ) {
2633
  $title_array = array_reverse( explode( $t_sep, $title ) );
2634
  $title = implode( " $sep ", $title_array ) . $prefix;
2635
 
includes/common/widgets.php CHANGED
@@ -295,7 +295,7 @@ class BBP_Views_Widget extends WP_Widget {
295
 
296
  <?php foreach ( array_keys( bbp_get_views() ) as $view ) : ?>
297
 
298
- <li><a class="bbp-view-title" href="<?php bbp_view_url( $view ); ?>" title="<?php bbp_view_title( $view ); ?>"><?php bbp_view_title( $view ); ?></a></li>
299
 
300
  <?php endforeach; ?>
301
 
@@ -408,6 +408,10 @@ class BBP_Search_Widget extends WP_Widget {
408
  */
409
  public function widget( $args, $instance ) {
410
 
 
 
 
 
411
  // Get widget settings
412
  $settings = $this->parse_settings( $instance );
413
 
@@ -552,14 +556,16 @@ class BBP_Forums_Widget extends WP_Widget {
552
  $settings['title'] = apply_filters( 'bbp_forum_widget_title', $settings['title'], $instance, $this->id_base );
553
 
554
  // Note: private and hidden forums will be excluded via the
555
- // bbp_pre_get_posts_exclude_forums filter and function.
556
  $widget_query = new WP_Query( array(
557
- 'post_type' => bbp_get_forum_post_type(),
558
- 'post_parent' => $settings['parent_forum'],
559
- 'post_status' => bbp_get_public_status_id(),
560
- 'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
561
- 'orderby' => 'menu_order',
562
- 'order' => 'ASC'
 
 
563
  ) );
564
 
565
  // Bail if no posts
@@ -577,7 +583,7 @@ class BBP_Forums_Widget extends WP_Widget {
577
 
578
  <?php while ( $widget_query->have_posts() ) : $widget_query->the_post(); ?>
579
 
580
- <li><a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>" title="<?php bbp_forum_title( $widget_query->post->ID ); ?>"><?php bbp_forum_title( $widget_query->post->ID ); ?></a></li>
581
 
582
  <?php endwhile; ?>
583
 
@@ -731,28 +737,30 @@ class BBP_Topics_Widget extends WP_Widget {
731
  // Order by most recent replies
732
  case 'freshness' :
733
  $topics_query = array(
734
- 'post_type' => bbp_get_topic_post_type(),
735
- 'post_parent' => $settings['parent_forum'],
736
- 'posts_per_page' => (int) $settings['max_shown'],
737
- 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
738
- 'show_stickies' => false,
739
- 'meta_key' => '_bbp_last_active_time',
740
- 'orderby' => 'meta_value',
741
- 'order' => 'DESC',
 
742
  );
743
  break;
744
 
745
  // Order by total number of replies
746
  case 'popular' :
747
  $topics_query = array(
748
- 'post_type' => bbp_get_topic_post_type(),
749
- 'post_parent' => $settings['parent_forum'],
750
- 'posts_per_page' => (int) $settings['max_shown'],
751
- 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
752
- 'show_stickies' => false,
753
- 'meta_key' => '_bbp_reply_count',
754
- 'orderby' => 'meta_value',
755
- 'order' => 'DESC'
 
756
  );
757
  break;
758
 
@@ -760,18 +768,19 @@ class BBP_Topics_Widget extends WP_Widget {
760
  case 'newness' :
761
  default :
762
  $topics_query = array(
763
- 'post_type' => bbp_get_topic_post_type(),
764
- 'post_parent' => $settings['parent_forum'],
765
- 'posts_per_page' => (int) $settings['max_shown'],
766
- 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
767
- 'show_stickies' => false,
768
- 'order' => 'DESC'
 
769
  );
770
  break;
771
  }
772
 
773
  // Note: private and hidden forums will be excluded via the
774
- // bbp_pre_get_posts_exclude_forums filter and function.
775
  $widget_query = new WP_Query( $topics_query );
776
 
777
  // Bail if no topics are found
@@ -794,12 +803,12 @@ class BBP_Topics_Widget extends WP_Widget {
794
  $author_link = '';
795
 
796
  // Maybe get the topic author
797
- if ( 'on' == $settings['show_user'] ) :
798
  $author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) );
799
  endif; ?>
800
 
801
  <li>
802
- <a class="bbp-forum-title" href="<?php echo esc_url( bbp_get_topic_permalink( $topic_id ) ); ?>" title="<?php echo esc_attr( bbp_get_topic_title( $topic_id ) ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>
803
 
804
  <?php if ( ! empty( $author_link ) ) : ?>
805
 
@@ -807,7 +816,7 @@ class BBP_Topics_Widget extends WP_Widget {
807
 
808
  <?php endif; ?>
809
 
810
- <?php if ( 'on' == $settings['show_date'] ) : ?>
811
 
812
  <div><?php bbp_topic_last_active_time( $topic_id ); ?></div>
813
 
@@ -1112,11 +1121,13 @@ class BBP_Replies_Widget extends WP_Widget {
1112
  $settings['title'] = apply_filters( 'bbp_replies_widget_title', $settings['title'], $instance, $this->id_base );
1113
 
1114
  // Note: private and hidden forums will be excluded via the
1115
- // bbp_pre_get_posts_exclude_forums filter and function.
1116
  $widget_query = new WP_Query( array(
1117
- 'post_type' => bbp_get_reply_post_type(),
1118
- 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
1119
- 'posts_per_page' => (int) $settings['max_shown']
 
 
1120
  ) );
1121
 
1122
  // Bail if no replies
@@ -1143,20 +1154,20 @@ class BBP_Replies_Widget extends WP_Widget {
1143
  $reply_link = '<a class="bbp-reply-topic-title" href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . esc_attr( bbp_get_reply_excerpt( $reply_id, 50 ) ) . '">' . bbp_get_reply_topic_title( $reply_id ) . '</a>';
1144
 
1145
  // Only query user if showing them
1146
- if ( 'on' == $settings['show_user'] ) :
1147
  $author_link = bbp_get_reply_author_link( array( 'post_id' => $reply_id, 'type' => 'both', 'size' => 14 ) );
1148
  else :
1149
  $author_link = false;
1150
  endif;
1151
 
1152
  // Reply author, link, and timestamp
1153
- if ( ( 'on' == $settings['show_date'] ) && !empty( $author_link ) ) :
1154
 
1155
  // translators: 1: reply author, 2: reply link, 3: reply timestamp
1156
  printf( _x( '%1$s on %2$s %3$s', 'widgets', 'bbpress' ), $author_link, $reply_link, '<div>' . bbp_get_time_since( get_the_time( 'U' ) ) . '</div>' );
1157
 
1158
  // Reply link and timestamp
1159
- elseif ( 'on' == $settings['show_date'] ) :
1160
 
1161
  // translators: 1: reply link, 2: reply timestamp
1162
  printf( _x( '%1$s %2$s', 'widgets', 'bbpress' ), $reply_link, '<div>' . bbp_get_time_since( get_the_time( 'U' ) ) . '</div>' );
@@ -1246,4 +1257,4 @@ class BBP_Replies_Widget extends WP_Widget {
1246
  ),
1247
  'replies_widget_settings' );
1248
  }
1249
- }
295
 
296
  <?php foreach ( array_keys( bbp_get_views() ) as $view ) : ?>
297
 
298
+ <li><a class="bbp-view-title" href="<?php bbp_view_url( $view ); ?>"><?php bbp_view_title( $view ); ?></a></li>
299
 
300
  <?php endforeach; ?>
301
 
408
  */
409
  public function widget( $args, $instance ) {
410
 
411
+ // Bail if search is disabled
412
+ if ( ! bbp_allow_search() )
413
+ return;
414
+
415
  // Get widget settings
416
  $settings = $this->parse_settings( $instance );
417
 
556
  $settings['title'] = apply_filters( 'bbp_forum_widget_title', $settings['title'], $instance, $this->id_base );
557
 
558
  // Note: private and hidden forums will be excluded via the
559
+ // bbp_pre_get_posts_normalize_forum_visibility action and function.
560
  $widget_query = new WP_Query( array(
561
+ 'post_type' => bbp_get_forum_post_type(),
562
+ 'post_parent' => $settings['parent_forum'],
563
+ 'post_status' => bbp_get_public_status_id(),
564
+ 'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
565
+ 'ignore_sticky_posts' => true,
566
+ 'no_found_rows' => true,
567
+ 'orderby' => 'menu_order title',
568
+ 'order' => 'ASC'
569
  ) );
570
 
571
  // Bail if no posts
583
 
584
  <?php while ( $widget_query->have_posts() ) : $widget_query->the_post(); ?>
585
 
586
+ <li><a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>"><?php bbp_forum_title( $widget_query->post->ID ); ?></a></li>
587
 
588
  <?php endwhile; ?>
589
 
737
  // Order by most recent replies
738
  case 'freshness' :
739
  $topics_query = array(
740
+ 'post_type' => bbp_get_topic_post_type(),
741
+ 'post_parent' => $settings['parent_forum'],
742
+ 'posts_per_page' => (int) $settings['max_shown'],
743
+ 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
744
+ 'ignore_sticky_posts' => true,
745
+ 'no_found_rows' => true,
746
+ 'meta_key' => '_bbp_last_active_time',
747
+ 'orderby' => 'meta_value',
748
+ 'order' => 'DESC',
749
  );
750
  break;
751
 
752
  // Order by total number of replies
753
  case 'popular' :
754
  $topics_query = array(
755
+ 'post_type' => bbp_get_topic_post_type(),
756
+ 'post_parent' => $settings['parent_forum'],
757
+ 'posts_per_page' => (int) $settings['max_shown'],
758
+ 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
759
+ 'ignore_sticky_posts' => true,
760
+ 'no_found_rows' => true,
761
+ 'meta_key' => '_bbp_reply_count',
762
+ 'orderby' => 'meta_value',
763
+ 'order' => 'DESC'
764
  );
765
  break;
766
 
768
  case 'newness' :
769
  default :
770
  $topics_query = array(
771
+ 'post_type' => bbp_get_topic_post_type(),
772
+ 'post_parent' => $settings['parent_forum'],
773
+ 'posts_per_page' => (int) $settings['max_shown'],
774
+ 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
775
+ 'ignore_sticky_posts' => true,
776
+ 'no_found_rows' => true,
777
+ 'order' => 'DESC'
778
  );
779
  break;
780
  }
781
 
782
  // Note: private and hidden forums will be excluded via the
783
+ // bbp_pre_get_posts_normalize_forum_visibility action and function.
784
  $widget_query = new WP_Query( $topics_query );
785
 
786
  // Bail if no topics are found
803
  $author_link = '';
804
 
805
  // Maybe get the topic author
806
+ if ( 'on' === $settings['show_user'] ) :
807
  $author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) );
808
  endif; ?>
809
 
810
  <li>
811
+ <a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>
812
 
813
  <?php if ( ! empty( $author_link ) ) : ?>
814
 
816
 
817
  <?php endif; ?>
818
 
819
+ <?php if ( 'on' === $settings['show_date'] ) : ?>
820
 
821
  <div><?php bbp_topic_last_active_time( $topic_id ); ?></div>
822
 
1121
  $settings['title'] = apply_filters( 'bbp_replies_widget_title', $settings['title'], $instance, $this->id_base );
1122
 
1123
  // Note: private and hidden forums will be excluded via the
1124
+ // bbp_pre_get_posts_normalize_forum_visibility action and function.
1125
  $widget_query = new WP_Query( array(
1126
+ 'post_type' => bbp_get_reply_post_type(),
1127
+ 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
1128
+ 'posts_per_page' => (int) $settings['max_shown'],
1129
+ 'ignore_sticky_posts' => true,
1130
+ 'no_found_rows' => true,
1131
  ) );
1132
 
1133
  // Bail if no replies
1154
  $reply_link = '<a class="bbp-reply-topic-title" href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . esc_attr( bbp_get_reply_excerpt( $reply_id, 50 ) ) . '">' . bbp_get_reply_topic_title( $reply_id ) . '</a>';
1155
 
1156
  // Only query user if showing them
1157
+ if ( 'on' === $settings['show_user'] ) :
1158
  $author_link = bbp_get_reply_author_link( array( 'post_id' => $reply_id, 'type' => 'both', 'size' => 14 ) );
1159
  else :
1160
  $author_link = false;
1161
  endif;
1162
 
1163
  // Reply author, link, and timestamp
1164
+ if ( ( 'on' === $settings['show_date'] ) && !empty( $author_link ) ) :
1165
 
1166
  // translators: 1: reply author, 2: reply link, 3: reply timestamp
1167
  printf( _x( '%1$s on %2$s %3$s', 'widgets', 'bbpress' ), $author_link, $reply_link, '<div>' . bbp_get_time_since( get_the_time( 'U' ) ) . '</div>' );
1168
 
1169
  // Reply link and timestamp
1170
+ elseif ( 'on' === $settings['show_date'] ) :
1171
 
1172
  // translators: 1: reply link, 2: reply timestamp
1173
  printf( _x( '%1$s %2$s', 'widgets', 'bbpress' ), $reply_link, '<div>' . bbp_get_time_since( get_the_time( 'U' ) ) . '</div>' );
1257
  ),
1258
  'replies_widget_settings' );
1259
  }
1260
+ }
includes/core/actions.php CHANGED
@@ -74,12 +74,14 @@ add_action( 'bbp_loaded', 'bbp_filter_user_roles_option', 16 );
74
  *
75
  * Attach various initialization actions to the init action.
76
  * The load order helps to execute code at the correct time.
77
- * v---Load order
78
  */
79
- add_action( 'bbp_init', 'bbp_load_textdomain', 0 );
80
- add_action( 'bbp_init', 'bbp_register', 0 );
81
- add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20 );
82
- add_action( 'bbp_init', 'bbp_ready', 999 );
 
 
83
 
84
  /**
85
  * There is no action API for roles to use, so hook in immediately after
@@ -179,8 +181,8 @@ add_action( 'bbp_edit_forum_post_extras', 'bbp_save_forum_extras', 2 );
179
  add_action( 'bbp_forum_attributes_metabox_save', 'bbp_save_forum_extras', 2 );
180
 
181
  // New/Edit Reply
182
- add_action( 'bbp_new_reply', 'bbp_update_reply', 10, 6 );
183
- add_action( 'bbp_edit_reply', 'bbp_update_reply', 10, 6 );
184
 
185
  // Before Delete/Trash/Untrash Reply
186
  add_action( 'wp_trash_post', 'bbp_trash_reply' );
@@ -295,12 +297,13 @@ add_action( 'bbp_post_request', 'bbp_new_reply_handler', 10 );
295
  add_action( 'bbp_post_request', 'bbp_new_topic_handler', 10 );
296
 
297
  // Theme-side GET requests
298
- add_action( 'bbp_get_request', 'bbp_toggle_topic_handler', 1 );
299
- add_action( 'bbp_get_request', 'bbp_toggle_reply_handler', 1 );
300
- add_action( 'bbp_get_request', 'bbp_favorites_handler', 1 );
301
- add_action( 'bbp_get_request', 'bbp_subscriptions_handler', 1 );
 
302
 
303
  // Maybe convert the users password
304
  add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
305
 
306
- add_action( 'bbp_activation', 'bbp_add_activation_redirect' );
74
  *
75
  * Attach various initialization actions to the init action.
76
  * The load order helps to execute code at the correct time.
77
+ * v---Load order
78
  */
79
+ add_action( 'bbp_init', 'bbp_load_textdomain', 0 );
80
+ add_action( 'bbp_init', 'bbp_register', 0 );
81
+ add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20 );
82
+ add_action( 'bbp_init', 'bbp_add_rewrite_rules', 30 );
83
+ add_action( 'bbp_init', 'bbp_add_permastructs', 40 );
84
+ add_action( 'bbp_init', 'bbp_ready', 999 );
85
 
86
  /**
87
  * There is no action API for roles to use, so hook in immediately after
181
  add_action( 'bbp_forum_attributes_metabox_save', 'bbp_save_forum_extras', 2 );
182
 
183
  // New/Edit Reply
184
+ add_action( 'bbp_new_reply', 'bbp_update_reply', 10, 7 );
185
+ add_action( 'bbp_edit_reply', 'bbp_update_reply', 10, 7 );
186
 
187
  // Before Delete/Trash/Untrash Reply
188
  add_action( 'wp_trash_post', 'bbp_trash_reply' );
297
  add_action( 'bbp_post_request', 'bbp_new_topic_handler', 10 );
298
 
299
  // Theme-side GET requests
300
+ add_action( 'bbp_get_request', 'bbp_toggle_topic_handler', 1 );
301
+ add_action( 'bbp_get_request', 'bbp_toggle_reply_handler', 1 );
302
+ add_action( 'bbp_get_request', 'bbp_favorites_handler', 1 );
303
+ add_action( 'bbp_get_request', 'bbp_subscriptions_handler', 1 );
304
+ add_action( 'bbp_get_request', 'bbp_search_results_redirect', 10 );
305
 
306
  // Maybe convert the users password
307
  add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
308
 
309
+ add_action( 'bbp_activation', 'bbp_add_activation_redirect' );
includes/core/capabilities.php CHANGED
@@ -95,9 +95,6 @@ function bbp_get_caps_for_role( $role = '' ) {
95
  // Forum caps
96
  'publish_forums' => true,
97
  'edit_forums' => true,
98
- 'edit_others_forums' => false,
99
- 'delete_forums' => false,
100
- 'delete_others_forums' => false,
101
  'read_private_forums' => true,
102
  'read_hidden_forums' => true,
103
 
@@ -132,41 +129,6 @@ function bbp_get_caps_for_role( $role = '' ) {
132
 
133
  // Primary caps
134
  'spectate' => true,
135
- 'participate' => false,
136
- 'moderate' => false,
137
- 'throttle' => false,
138
- 'view_trash' => false,
139
-
140
- // Forum caps
141
- 'publish_forums' => false,
142
- 'edit_forums' => false,
143
- 'edit_others_forums' => false,
144
- 'delete_forums' => false,
145
- 'delete_others_forums' => false,
146
- 'read_private_forums' => false,
147
- 'read_hidden_forums' => false,
148
-
149
- // Topic caps
150
- 'publish_topics' => false,
151
- 'edit_topics' => false,
152
- 'edit_others_topics' => false,
153
- 'delete_topics' => false,
154
- 'delete_others_topics' => false,
155
- 'read_private_topics' => false,
156
-
157
- // Reply caps
158
- 'publish_replies' => false,
159
- 'edit_replies' => false,
160
- 'edit_others_replies' => false,
161
- 'delete_replies' => false,
162
- 'delete_others_replies' => false,
163
- 'read_private_replies' => false,
164
-
165
- // Topic tag caps
166
- 'manage_topic_tags' => false,
167
- 'edit_topic_tags' => false,
168
- 'delete_topic_tags' => false,
169
- 'assign_topic_tags' => false,
170
  );
171
 
172
  break;
@@ -224,39 +186,19 @@ function bbp_get_caps_for_role( $role = '' ) {
224
  // Primary caps
225
  'spectate' => true,
226
  'participate' => true,
227
- 'moderate' => false,
228
- 'throttle' => false,
229
- 'view_trash' => false,
230
 
231
  // Forum caps
232
- 'publish_forums' => false,
233
- 'edit_forums' => false,
234
- 'edit_others_forums' => false,
235
- 'delete_forums' => false,
236
- 'delete_others_forums' => false,
237
  'read_private_forums' => true,
238
- 'read_hidden_forums' => false,
239
 
240
  // Topic caps
241
  'publish_topics' => true,
242
  'edit_topics' => true,
243
- 'edit_others_topics' => false,
244
- 'delete_topics' => false,
245
- 'delete_others_topics' => false,
246
- 'read_private_topics' => false,
247
 
248
  // Reply caps
249
  'publish_replies' => true,
250
  'edit_replies' => true,
251
- 'edit_others_replies' => false,
252
- 'delete_replies' => false,
253
- 'delete_others_replies' => false,
254
- 'read_private_replies' => false,
255
 
256
  // Topic tag caps
257
- 'manage_topic_tags' => false,
258
- 'edit_topic_tags' => false,
259
- 'delete_topic_tags' => false,
260
  'assign_topic_tags' => true,
261
  );
262
 
@@ -274,7 +216,7 @@ function bbp_get_caps_for_role( $role = '' ) {
274
  function bbp_add_caps() {
275
 
276
  // Loop through available roles and add caps
277
- foreach( bbp_get_wp_roles()->role_objects as $role ) {
278
  foreach ( bbp_get_caps_for_role( $role->name ) as $cap => $value ) {
279
  $role->add_cap( $cap, $value );
280
  }
@@ -291,7 +233,7 @@ function bbp_add_caps() {
291
  function bbp_remove_caps() {
292
 
293
  // Loop through available roles and remove caps
294
- foreach( bbp_get_wp_roles()->role_objects as $role ) {
295
  foreach ( array_keys( bbp_get_caps_for_role( $role->name ) ) as $cap ) {
296
  $role->remove_cap( $cap );
297
  }
@@ -318,6 +260,29 @@ function bbp_get_wp_roles() {
318
  return $wp_roles;
319
  }
320
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  /** Forum Roles ***************************************************************/
322
 
323
  /**
@@ -326,12 +291,15 @@ function bbp_get_wp_roles() {
326
  * We do this to avoid adding these values to the database.
327
  *
328
  * @since bbPress (r4290)
 
 
 
329
  * @return WP_Roles The main $wp_roles global
330
  */
331
  function bbp_add_forums_roles() {
332
  $wp_roles = bbp_get_wp_roles();
333
 
334
- foreach( bbp_get_dynamic_roles() as $role_id => $details ) {
335
  $wp_roles->roles[$role_id] = $details;
336
  $wp_roles->role_objects[$role_id] = new WP_Role( $role_id, $details['capabilities'] );
337
  $wp_roles->role_names[$role_id] = $details['name'];
@@ -381,7 +349,7 @@ function bbp_filter_user_roles_option() {
381
  * @return array Combined array of database roles and dynamic bbPress roles
382
  */
383
  function _bbp_reinit_dynamic_roles( $roles = array() ) {
384
- foreach( bbp_get_dynamic_roles() as $role_id => $details ) {
385
  $roles[$role_id] = $details;
386
  }
387
  return $roles;
@@ -474,7 +442,7 @@ function bbp_filter_blog_editable_roles( $all_roles = array() ) {
474
  foreach ( array_keys( $all_roles ) as $wp_role ) {
475
 
476
  // If keys match, unset
477
- if ( $wp_role == $bbp_role ) {
478
  unset( $all_roles[$wp_role] );
479
  }
480
  }
@@ -562,5 +530,13 @@ function bbp_add_roles() {
562
  * @deprecated since version 2.2
563
  */
564
  function bbp_remove_roles() {
565
- _doing_it_wrong( 'bbp_remove_roles', __( 'Editable forum roles no longer exist.', 'bbpress' ), '2.2' );
 
 
 
 
 
 
 
 
566
  }
95
  // Forum caps
96
  'publish_forums' => true,
97
  'edit_forums' => true,
 
 
 
98
  'read_private_forums' => true,
99
  'read_hidden_forums' => true,
100
 
129
 
130
  // Primary caps
131
  'spectate' => true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  );
133
 
134
  break;
186
  // Primary caps
187
  'spectate' => true,
188
  'participate' => true,
 
 
 
189
 
190
  // Forum caps
 
 
 
 
 
191
  'read_private_forums' => true,
 
192
 
193
  // Topic caps
194
  'publish_topics' => true,
195
  'edit_topics' => true,
 
 
 
 
196
 
197
  // Reply caps
198
  'publish_replies' => true,
199
  'edit_replies' => true,
 
 
 
 
200
 
201
  // Topic tag caps
 
 
 
202
  'assign_topic_tags' => true,
203
  );
204
 
216
  function bbp_add_caps() {
217
 
218
  // Loop through available roles and add caps
219
+ foreach ( bbp_get_wp_roles()->role_objects as $role ) {
220
  foreach ( bbp_get_caps_for_role( $role->name ) as $cap => $value ) {
221
  $role->add_cap( $cap, $value );
222
  }
233
  function bbp_remove_caps() {
234
 
235
  // Loop through available roles and remove caps
236
+ foreach ( bbp_get_wp_roles()->role_objects as $role ) {
237
  foreach ( array_keys( bbp_get_caps_for_role( $role->name ) ) as $cap ) {
238
  $role->remove_cap( $cap );
239
  }
260
  return $wp_roles;
261
  }
262
 
263
+ /**
264
+ * Get the available roles minus bbPress's dynamic roles
265
+ *
266
+ * @since bbPress (r5064)
267
+ *
268
+ * @uses bbp_get_wp_roles() To load and get the $wp_roles global
269
+ * @return array
270
+ */
271
+ function bbp_get_blog_roles() {
272
+
273
+ // Get WordPress's roles (returns $wp_roles global)
274
+ $wp_roles = bbp_get_wp_roles();
275
+
276
+ // Apply the WordPress 'editable_roles' filter to let plugins ride along.
277
+ //
278
+ // We use this internally via bbp_filter_blog_editable_roles() to remove
279
+ // any custom bbPress roles that are added to the global.
280
+ $the_roles = isset( $wp_roles->roles ) ? $wp_roles->roles : false;
281
+ $all_roles = apply_filters( 'editable_roles', $the_roles );
282
+
283
+ return apply_filters( 'bbp_get_blog_roles', $all_roles, $wp_roles );
284
+ }
285
+
286
  /** Forum Roles ***************************************************************/
287
 
288
  /**
291
  * We do this to avoid adding these values to the database.
292
  *
293
  * @since bbPress (r4290)
294
+ *
295
+ * @uses bbp_get_wp_roles() To load and get the $wp_roles global
296
+ * @uses bbp_get_dynamic_roles() To get and add bbPress's roles to $wp_roles
297
  * @return WP_Roles The main $wp_roles global
298
  */
299
  function bbp_add_forums_roles() {
300
  $wp_roles = bbp_get_wp_roles();
301
 
302
+ foreach ( bbp_get_dynamic_roles() as $role_id => $details ) {
303
  $wp_roles->roles[$role_id] = $details;
304
  $wp_roles->role_objects[$role_id] = new WP_Role( $role_id, $details['capabilities'] );
305
  $wp_roles->role_names[$role_id] = $details['name'];
349
  * @return array Combined array of database roles and dynamic bbPress roles
350
  */
351
  function _bbp_reinit_dynamic_roles( $roles = array() ) {
352
+ foreach ( bbp_get_dynamic_roles() as $role_id => $details ) {
353
  $roles[$role_id] = $details;
354
  }
355
  return $roles;
442
  foreach ( array_keys( $all_roles ) as $wp_role ) {
443
 
444
  // If keys match, unset
445
+ if ( $wp_role === $bbp_role ) {
446
  unset( $all_roles[$wp_role] );
447
  }
448
  }
530
  * @deprecated since version 2.2
531
  */
532
  function bbp_remove_roles() {
533
+
534
+ // Remove the bbPress roles
535
+ foreach ( array_keys( bbp_get_dynamic_roles() ) as $bbp_role ) {
536
+ remove_role( $bbp_role );
537
+ }
538
+
539
+ // Some early adopters may have a deprecated visitor role. It was later
540
+ // replaced by the Spectator role.
541
+ remove_role( 'bbp_visitor' );
542
  }
includes/core/filters.php CHANGED
@@ -135,7 +135,7 @@ add_filter( 'bbp_get_user_profile_edit_link', 'bbp_rel_nofollow' );
135
  add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' );
136
 
137
  // Run filters on reply content
138
- add_filter( 'bbp_get_reply_content', 'make_clickable', 4 );
139
  add_filter( 'bbp_get_reply_content', 'bbp_mention_filter', 5 );
140
  add_filter( 'bbp_get_reply_content', 'wptexturize', 6 );
141
  add_filter( 'bbp_get_reply_content', 'convert_chars', 8 );
@@ -146,7 +146,7 @@ add_filter( 'bbp_get_reply_content', 'wpautop', 40 );
146
  add_filter( 'bbp_get_reply_content', 'bbp_rel_nofollow', 50 );
147
 
148
  // Run filters on topic content
149
- add_filter( 'bbp_get_topic_content', 'make_clickable', 4 );
150
  add_filter( 'bbp_get_topic_content', 'bbp_mention_filter', 5 );
151
  add_filter( 'bbp_get_topic_content', 'wptexturize', 6 );
152
  add_filter( 'bbp_get_topic_content', 'convert_chars', 8 );
135
  add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' );
136
 
137
  // Run filters on reply content
138
+ add_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4 );
139
  add_filter( 'bbp_get_reply_content', 'bbp_mention_filter', 5 );
140
  add_filter( 'bbp_get_reply_content', 'wptexturize', 6 );
141
  add_filter( 'bbp_get_reply_content', 'convert_chars', 8 );
146
  add_filter( 'bbp_get_reply_content', 'bbp_rel_nofollow', 50 );
147
 
148
  // Run filters on topic content
149
+ add_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4 );
150
  add_filter( 'bbp_get_topic_content', 'bbp_mention_filter', 5 );
151
  add_filter( 'bbp_get_topic_content', 'wptexturize', 6 );
152
  add_filter( 'bbp_get_topic_content', 'convert_chars', 8 );
includes/core/functions.php CHANGED
@@ -283,6 +283,19 @@ function bbp_has_errors() {
283
 
284
  /** Mentions ******************************************************************/
285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  /**
287
  * Searches through the content to locate usernames, designated by an @ sign.
288
  *
@@ -292,15 +305,16 @@ function bbp_has_errors() {
292
  * @return bool|array $usernames Existing usernames. False if no matches.
293
  */
294
  function bbp_find_mentions( $content = '' ) {
295
- $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/';
296
  preg_match_all( $pattern, $content, $usernames );
297
  $usernames = array_unique( array_filter( $usernames[1] ) );
298
 
299
  // Bail if no usernames
300
- if ( empty( $usernames ) )
301
- return false;
 
302
 
303
- return $usernames;
304
  }
305
 
306
  /**
@@ -319,7 +333,7 @@ function bbp_mention_filter( $content = '' ) {
319
  return $content;
320
 
321
  // Loop through usernames and link to profiles
322
- foreach( (array) $usernames as $username ) {
323
 
324
  // Skip if username does not exist or user is not active
325
  $user = get_user_by( 'slug', $username );
@@ -507,6 +521,30 @@ function bbp_get_view_rewrite_id() {
507
  return bbpress()->view_id;
508
  }
509
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
510
  /**
511
  * Delete a blogs rewrite rules, so that they are automatically rebuilt on
512
  * the subsequent page load.
@@ -526,7 +564,7 @@ function bbp_delete_rewrite_rules() {
526
  * @return bool
527
  */
528
  function bbp_is_post_request() {
529
- return (bool) ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) );
530
  }
531
 
532
  /**
@@ -536,6 +574,6 @@ function bbp_is_post_request() {
536
  * @return bool
537
  */
538
  function bbp_is_get_request() {
539
- return (bool) ( 'GET' == strtoupper( $_SERVER['REQUEST_METHOD'] ) );
540
  }
541
 
283
 
284
  /** Mentions ******************************************************************/
285
 
286
+ /**
287
+ * Set the pattern used for matching usernames for mentions.
288
+ *
289
+ * Moved into its own function to allow filtering of the regex pattern
290
+ * anywhere mentions might be used.
291
+ *
292
+ * @since bbPress (r4997)
293
+ * @return string Pattern to match usernames with
294
+ */
295
+ function bbp_find_mentions_pattern() {
296
+ return apply_filters( 'bbp_find_mentions_pattern', '/[@]+([A-Za-z0-9-_\.@]+)\b/' );
297
+ }
298
+
299
  /**
300
  * Searches through the content to locate usernames, designated by an @ sign.
301
  *
305
  * @return bool|array $usernames Existing usernames. False if no matches.
306
  */
307
  function bbp_find_mentions( $content = '' ) {
308
+ $pattern = bbp_find_mentions_pattern();
309
  preg_match_all( $pattern, $content, $usernames );
310
  $usernames = array_unique( array_filter( $usernames[1] ) );
311
 
312
  // Bail if no usernames
313
+ if ( empty( $usernames ) ) {
314
+ $usernames = false;
315
+ }
316
 
317
+ return apply_filters( 'bbp_find_mentions', $usernames, $pattern, $content );
318
  }
319
 
320
  /**
333
  return $content;
334
 
335
  // Loop through usernames and link to profiles
336
+ foreach ( (array) $usernames as $username ) {
337
 
338
  // Skip if username does not exist or user is not active
339
  $user = get_user_by( 'slug', $username );
521
  return bbpress()->view_id;
522
  }
523
 
524
+ /** Rewrite Extras ************************************************************/
525
+
526
+ /**
527
+ * Get the id used for paginated requests
528
+ *
529
+ * @since bbPress (r4926)
530
+ * @return string
531
+ */
532
+ function bbp_get_paged_rewrite_id() {
533
+ return bbpress()->paged_id;
534
+ }
535
+
536
+ /**
537
+ * Get the slug used for paginated requests
538
+ *
539
+ * @since bbPress (r4926)
540
+ * @global object $wp_rewrite The WP_Rewrite object
541
+ * @return string
542
+ */
543
+ function bbp_get_paged_slug() {
544
+ global $wp_rewrite;
545
+ return $wp_rewrite->pagination_base;
546
+ }
547
+
548
  /**
549
  * Delete a blogs rewrite rules, so that they are automatically rebuilt on
550
  * the subsequent page load.
564
  * @return bool
565
  */
566
  function bbp_is_post_request() {
567
+ return (bool) ( 'POST' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );
568
  }
569
 
570
  /**
574
  * @return bool
575
  */
576
  function bbp_is_get_request() {
577
+ return (bool) ( 'GET' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );
578
  }
579
 
includes/core/options.php CHANGED
@@ -29,17 +29,22 @@ function bbp_get_default_options() {
29
 
30
  /** Settings **********************************************************/
31
 
32
- '_bbp_edit_lock' => 5, // Lock post editing after 5 minutes
33
- '_bbp_throttle_time' => 10, // Throttle post time to 10 seconds
34
- '_bbp_enable_favorites' => 1, // Favorites
35
- '_bbp_enable_subscriptions' => 1, // Subscriptions
36
- '_bbp_allow_topic_tags' => 1, // Topic Tags
37
- '_bbp_allow_anonymous' => 0, // Allow anonymous posting
38
- '_bbp_allow_global_access' => 1, // Users from all sites can post
39
- '_bbp_use_wp_editor' => 1, // Use the WordPress editor if available
40
- '_bbp_use_autoembed' => 0, // Allow oEmbed in topics and replies
41
- '_bbp_theme_package_id' => 'default', // The ID for the current theme package.
42
- '_bbp_default_role' => bbp_get_participant_role(), // Default forums role
 
 
 
 
 
43
 
44
  /** Per Page **********************************************************/
45
 
@@ -57,14 +62,14 @@ function bbp_get_default_options() {
57
  '_bbp_page_for_register' => 0, // Page for register
58
  '_bbp_page_for_lost_pass' => 0, // Page for lost-pass
59
 
60
- /** Archive Slugs *****************************************************/
61
 
62
  '_bbp_root_slug' => 'forums', // Forum archive slug
63
- '_bbp_topic_archive_slug' => 'topics', // Topic archive slug
 
64
 
65
  /** Single Slugs ******************************************************/
66
 
67
- '_bbp_include_root' => 1, // Include forum-archive before single slugs
68
  '_bbp_forum_slug' => 'forum', // Forum slug
69
  '_bbp_topic_slug' => 'topic', // Topic slug
70
  '_bbp_reply_slug' => 'reply', // Reply slug
@@ -75,6 +80,8 @@ function bbp_get_default_options() {
75
  '_bbp_user_slug' => 'users', // User profile slug
76
  '_bbp_user_favs_slug' => 'favorites', // User favorites slug
77
  '_bbp_user_subs_slug' => 'subscriptions', // User subscriptions slug
 
 
78
 
79
  /** Other Slugs *******************************************************/
80
 
@@ -223,6 +230,64 @@ function bbp_allow_topic_tags( $default = 1 ) {
223
  return (bool) apply_filters( 'bbp_allow_topic_tags', (bool) get_option( '_bbp_allow_topic_tags', $default ) );
224
  }
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  /**
227
  * Are topic and reply revisions allowed
228
  *
@@ -373,6 +438,18 @@ function bbp_is_akismet_active( $default = 1 ) {
373
  return (bool) apply_filters( 'bbp_is_akismet_active', (bool) get_option( '_bbp_enable_akismet', $default ) );
374
  }
375
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  /** Slugs *********************************************************************/
377
 
378
  /**
@@ -395,6 +472,17 @@ function bbp_include_root_slug( $default = 1 ) {
395
  return (bool) apply_filters( 'bbp_include_root_slug', (bool) get_option( '_bbp_include_root', $default ) );
396
  }
397
 
 
 
 
 
 
 
 
 
 
 
 
398
  /**
399
  * Maybe return the root slug, based on whether or not it's included in the url
400
  *
@@ -430,6 +518,16 @@ function bbp_get_topic_archive_slug( $default = 'topics' ) {
430
  return apply_filters( 'bbp_get_topic_archive_slug', get_option( '_bbp_topic_archive_slug', $default ) );
431
  }
432
 
 
 
 
 
 
 
 
 
 
 
433
  /**
434
  * Return the single topic slug
435
  *
29
 
30
  /** Settings **********************************************************/
31
 
32
+ '_bbp_edit_lock' => 5, // Lock post editing after 5 minutes
33
+ '_bbp_throttle_time' => 10, // Throttle post time to 10 seconds
34
+ '_bbp_enable_favorites' => 1, // Favorites
35
+ '_bbp_enable_subscriptions' => 1, // Subscriptions
36
+ '_bbp_allow_anonymous' => 0, // Allow anonymous posting
37
+ '_bbp_allow_global_access' => 1, // Users from all sites can post
38
+ '_bbp_allow_revisions' => 1, // Allow revisions
39
+ '_bbp_allow_topic_tags' => 1, // Allow topic tagging
40
+ '_bbp_allow_threaded_replies' => 0, // Allow threaded replies
41
+ '_bbp_allow_search' => 1, // Allow forum-wide search
42
+ '_bbp_thread_replies_depth' => 2, // Thread replies depth
43
+ '_bbp_use_wp_editor' => 1, // Use the WordPress editor if available
44
+ '_bbp_use_autoembed' => 0, // Allow oEmbed in topics and replies
45
+ '_bbp_theme_package_id' => 'default', // The ID for the current theme package
46
+ '_bbp_default_role' => bbp_get_participant_role(), // Default forums role
47
+ '_bbp_settings_integration' => 0, // Put settings into existing admin pages
48
 
49
  /** Per Page **********************************************************/
50
 
62
  '_bbp_page_for_register' => 0, // Page for register
63
  '_bbp_page_for_lost_pass' => 0, // Page for lost-pass
64
 
65
+ /** Forum Root ********************************************************/
66
 
67
  '_bbp_root_slug' => 'forums', // Forum archive slug
68
+ '_bbp_show_on_root' => 'forums', // What to show on root (forums|topics)
69
+ '_bbp_include_root' => 1, // Include forum-archive before single slugs
70
 
71
  /** Single Slugs ******************************************************/
72
 
 
73
  '_bbp_forum_slug' => 'forum', // Forum slug
74
  '_bbp_topic_slug' => 'topic', // Topic slug
75
  '_bbp_reply_slug' => 'reply', // Reply slug
80
  '_bbp_user_slug' => 'users', // User profile slug
81
  '_bbp_user_favs_slug' => 'favorites', // User favorites slug
82
  '_bbp_user_subs_slug' => 'subscriptions', // User subscriptions slug
83
+ '_bbp_topic_archive_slug' => 'topics', // Topic archive slug
84
+ '_bbp_reply_archive_slug' => 'replies', // Reply archive slug
85
 
86
  /** Other Slugs *******************************************************/
87
 
230
  return (bool) apply_filters( 'bbp_allow_topic_tags', (bool) get_option( '_bbp_allow_topic_tags', $default ) );
231
  }
232
 
233
+ /**
234
+ * Is forum-wide searching allowed
235
+ *
236
+ * @since bbPress (r4970)
237
+ * @param $default bool Optional. Default value true
238
+ * @uses get_option() To get the forum-wide search setting
239
+ * @return bool Is forum-wide searching allowed?
240
+ */
241
+ function bbp_allow_search( $default = 1 ) {
242
+ return (bool) apply_filters( 'bbp_allow_search', (bool) get_option( '_bbp_allow_search', $default ) );
243
+ }
244
+
245
+ /**
246
+ * Are replies threaded
247
+ *
248
+ * @since bbPress (r4944)
249
+ *
250
+ * @param bool $default Optional. Default value true
251
+ * @uses apply_filters() Calls 'bbp_thread_replies' with the calculated value and
252
+ * the thread replies depth
253
+ * @uses get_option() To get thread replies option
254
+ * @return bool Are replies threaded?
255
+ */
256
+ function bbp_thread_replies() {
257
+ $depth = bbp_thread_replies_depth();
258
+ $allow = bbp_allow_threaded_replies();
259
+ $retval = (bool) ( ( $depth >= 2 ) && ( true === $allow ) );
260
+
261
+ return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow );
262
+ }
263
+
264
+ /**
265
+ * Are threaded replies allowed
266
+ *
267
+ * @since bbPress (r4964)
268
+ * @param $default bool Optional. Default value false
269
+ * @uses get_option() To get the threaded replies setting
270
+ * @return bool Are threaded replies allowed?
271
+ */
272
+ function bbp_allow_threaded_replies( $default = 0 ) {
273
+ return (bool) apply_filters( '_bbp_allow_threaded_replies', (bool) get_option( '_bbp_allow_threaded_replies', $default ) );
274
+ }
275
+
276
+ /**
277
+ * Maximum reply thread depth
278
+ *
279
+ * @since bbPress (r4944)
280
+ *
281
+ * @param int $default Thread replies depth
282
+ * @uses apply_filters() Calls 'bbp_thread_replies_depth' with the option value and
283
+ * the default depth
284
+ * @uses get_option() To get the thread replies depth
285
+ * @return int Thread replies depth
286
+ */
287
+ function bbp_thread_replies_depth( $default = 2 ) {
288
+ return (int) apply_filters( 'bbp_thread_replies_depth', (int) get_option( '_bbp_thread_replies_depth', $default ) );
289
+ }
290
+
291
  /**
292
  * Are topic and reply revisions allowed
293
  *
438
  return (bool) apply_filters( 'bbp_is_akismet_active', (bool) get_option( '_bbp_enable_akismet', $default ) );
439
  }
440
 
441
+ /**
442
+ * Integrate settings into existing WordPress pages
443
+ *
444
+ * @since bbPress (r4932)
445
+ * @param $default bool Optional. Default value false
446
+ * @uses get_option() To get the admin integration setting
447
+ * @return bool To deeply integrate settings, or not
448
+ */
449
+ function bbp_settings_integration( $default = 0 ) {
450
+ return (bool) apply_filters( 'bbp_settings_integration', (bool) get_option( '_bbp_settings_integration', $default ) );
451
+ }
452
+
453
  /** Slugs *********************************************************************/
454
 
455
  /**
472
  return (bool) apply_filters( 'bbp_include_root_slug', (bool) get_option( '_bbp_include_root', $default ) );
473
  }
474
 
475
+ /**
476
+ * Return the search slug
477
+ *
478
+ * @since bbPress (r4932)
479
+ *
480
+ * @return string
481
+ */
482
+ function bbp_show_on_root( $default = 'forums' ) {
483
+ return apply_filters( 'bbp_show_on_root', get_option( '_bbp_show_on_root', $default ) );
484
+ }
485
+
486
  /**
487
  * Maybe return the root slug, based on whether or not it's included in the url
488
  *
518
  return apply_filters( 'bbp_get_topic_archive_slug', get_option( '_bbp_topic_archive_slug', $default ) );
519
  }
520
 
521
+ /**
522
+ * Return the reply archive slug
523
+ *
524
+ * @since bbPress (r4925)
525
+ * @return string
526
+ */
527
+ function bbp_get_reply_archive_slug( $default = 'replies' ) {
528
+ return apply_filters( 'bbp_get_reply_archive_slug', get_option( '_bbp_reply_archive_slug', $default ) );
529
+ }
530
+
531
  /**
532
  * Return the single topic slug
533
  *
includes/core/sub-actions.php CHANGED
@@ -232,6 +232,26 @@ function bbp_add_rewrite_tags() {
232
  do_action( 'bbp_add_rewrite_tags' );
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  /**
236
  * Add the bbPress-specific login forum action
237
  *
@@ -341,7 +361,12 @@ function bbp_post_request() {
341
  if ( empty( $_POST['action'] ) )
342
  return;
343
 
344
- do_action( 'bbp_post_request', $_POST['action'] );
 
 
 
 
 
345
  }
346
 
347
  /**
@@ -360,7 +385,12 @@ function bbp_get_request() {
360
  if ( empty( $_GET['action'] ) )
361
  return;
362
 
363
- do_action( 'bbp_get_request', $_GET['action'] );
 
 
 
 
 
364
  }
365
 
366
  /** Filters *******************************************************************/
@@ -405,6 +435,7 @@ function bbp_template_include( $template = '' ) {
405
  * Generate bbPress-specific rewrite rules
406
  *
407
  * @since bbPress (r2688)
 
408
  * @param WP_Rewrite $wp_rewrite
409
  * @uses do_action() Calls 'bbp_generate_rewrite_rules' with {@link WP_Rewrite}
410
  */
232
  do_action( 'bbp_add_rewrite_tags' );
233
  }
234
 
235
+ /**
236
+ * Add the bbPress-specific rewrite rules
237
+ *
238
+ * @since bbPress (r4918)
239
+ * @uses do_action() Calls 'bbp_add_rewrite_rules'
240
+ */
241
+ function bbp_add_rewrite_rules() {
242
+ do_action( 'bbp_add_rewrite_rules' );
243
+ }
244
+
245
+ /**
246
+ * Add the bbPress-specific permalink structures
247
+ *
248
+ * @since bbPress (r4918)
249
+ * @uses do_action() Calls 'bbp_add_permastructs'
250
+ */
251
+ function bbp_add_permastructs() {
252
+ do_action( 'bbp_add_permastructs' );
253
+ }
254
+
255
  /**
256
  * Add the bbPress-specific login forum action
257
  *
361
  if ( empty( $_POST['action'] ) )
362
  return;
363
 
364
+ // This dynamic action is probably the one you want to use. It narrows down
365
+ // the scope of the 'action' without needing to check it in your function.
366
+ do_action( 'bbp_post_request_' . $_POST['action'] );
367
+
368
+ // Use this static action if you don't mind checking the 'action' yourself.
369
+ do_action( 'bbp_post_request', $_POST['action'] );
370
  }
371
 
372
  /**
385
  if ( empty( $_GET['action'] ) )
386
  return;
387
 
388
+ // This dynamic action is probably the one you want to use. It narrows down
389
+ // the scope of the 'action' without needing to check it in your function.
390
+ do_action( 'bbp_get_request_' . $_GET['action'] );
391
+
392
+ // Use this static action if you don't mind checking the 'action' yourself.
393
+ do_action( 'bbp_get_request', $_GET['action'] );
394
  }
395
 
396
  /** Filters *******************************************************************/
435
  * Generate bbPress-specific rewrite rules
436
  *
437
  * @since bbPress (r2688)
438
+ * @deprecated since bbPress (r4918)
439
  * @param WP_Rewrite $wp_rewrite
440
  * @uses do_action() Calls 'bbp_generate_rewrite_rules' with {@link WP_Rewrite}
441
  */
includes/core/template-functions.php CHANGED
@@ -101,7 +101,7 @@ function bbp_locate_template( $template_names, $load = false, $require_once = tr
101
  do_action( 'bbp_locate_template', $located, $template_name, $template_names, $template_locations, $load, $require_once );
102
 
103
  // Maybe load the template if one was located
104
- if ( ( true == $load ) && !empty( $located ) ) {
105
  load_template( $located, $require_once );
106
  }
107
 
@@ -185,7 +185,7 @@ function bbp_get_template_stack() {
185
 
186
  // Loop through 'bbp_template_stack' filters, and call callback functions
187
  do {
188
- foreach( (array) current( $wp_filter[$tag] ) as $the_ ) {
189
  if ( ! is_null( $the_['function'] ) ) {
190
  $args[1] = $stack;
191
  $stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) );
@@ -202,6 +202,31 @@ function bbp_get_template_stack() {
202
  return (array) apply_filters( 'bbp_get_template_stack', $stack ) ;
203
  }
204
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  /**
206
  * Retrieve path to a template
207
  *
@@ -315,7 +340,7 @@ function bbp_parse_query( $posts_query ) {
315
  return;
316
 
317
  // Bail if filters are suppressed on this query
318
- if ( true == $posts_query->get( 'suppress_filters' ) )
319
  return;
320
 
321
  // Bail if in admin
@@ -330,29 +355,31 @@ function bbp_parse_query( $posts_query ) {
330
  // It is a user page - We'll also check if it is user edit
331
  if ( !empty( $bbp_user ) ) {
332
 
333
- // Not a user_id so try email and slug
334
- if ( get_option( 'permalink_structure' ) || ! is_numeric( $bbp_user ) ) {
 
 
 
 
 
335
 
336
  // Email was passed
337
  if ( is_email( $bbp_user ) ) {
338
- $bbp_user = get_user_by( 'email', $bbp_user );
339
 
340
  // Try nicename
341
  } else {
342
- $bbp_user = get_user_by( 'slug', $bbp_user );
343
- }
344
-
345
- // If we were successful, set to ID
346
- if ( is_object( $bbp_user ) ) {
347
- $bbp_user = $bbp_user->ID;
348
  }
349
  }
350
 
351
- // Cast as int, just in case
352
- $bbp_user = (int) $bbp_user;
 
 
353
 
354
  // 404 and bail if user does not have a profile
355
- if ( ! bbp_user_has_profile( $bbp_user ) ) {
356
  $posts_query->set_404();
357
  return;
358
  }
@@ -418,22 +445,19 @@ function bbp_parse_query( $posts_query ) {
418
  // Correct is_home variable
419
  $posts_query->is_home = false;
420
 
421
- // Get the user data
422
- $user = get_userdata( $bbp_user );
423
-
424
  // User is looking at their own profile
425
- if ( get_current_user_id() == $user->ID ) {
426
  $posts_query->bbp_is_single_user_home = true;
427
  }
428
 
429
  // Set bbp_user_id for future reference
430
- $posts_query->set( 'bbp_user_id', $user->ID );
431
 
432
  // Set author_name as current user's nicename to get correct posts
433
- $posts_query->set( 'author_name', $user->user_nicename );
434
 
435
  // Set the displayed user global to this user
436
- bbpress()->displayed_user = $user;
437
 
438
  // View Page
439
  } elseif ( !empty( $bbp_view ) ) {
@@ -510,5 +534,9 @@ function bbp_parse_query( $posts_query ) {
510
  $posts_query->set( 'bbp_topic_tag', get_query_var( 'term' ) );
511
  $posts_query->set( 'post_type', bbp_get_topic_post_type() );
512
  $posts_query->set( 'posts_per_page', bbp_get_topics_per_page() );
 
 
 
 
513
  }
514
  }
101
  do_action( 'bbp_locate_template', $located, $template_name, $template_names, $template_locations, $load, $require_once );
102
 
103
  // Maybe load the template if one was located
104
+ if ( ( true === $load ) && !empty( $located ) ) {
105
  load_template( $located, $require_once );
106
  }
107
 
185
 
186
  // Loop through 'bbp_template_stack' filters, and call callback functions
187
  do {
188
+ foreach ( (array) current( $wp_filter[$tag] ) as $the_ ) {
189
  if ( ! is_null( $the_['function'] ) ) {
190
  $args[1] = $stack;
191
  $stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) );
202
  return (array) apply_filters( 'bbp_get_template_stack', $stack ) ;
203
  }
204
 
205
+ /**
206
+ * Get a template part in an output buffer, and return it
207
+ *
208
+ * @since bbPress (r5043)
209
+ *
210
+ * @param string $slug
211
+ * @param string $name
212
+ * @return string
213
+ */
214
+ function bbp_buffer_template_part( $slug, $name = null, $echo = true ) {
215
+ ob_start();
216
+
217
+ bbp_get_template_part( $slug, $name );
218
+
219
+ // Get the output buffer contents
220
+ $output = ob_get_clean();
221
+
222
+ // Echo or return the output buffer contents
223
+ if ( true === $echo ) {
224
+ echo $output;
225
+ } else {
226
+ return $output;
227
+ }
228
+ }
229
+
230
  /**
231
  * Retrieve path to a template
232
  *
340
  return;
341
 
342
  // Bail if filters are suppressed on this query
343
+ if ( true === $posts_query->get( 'suppress_filters' ) )
344
  return;
345
 
346
  // Bail if in admin
355
  // It is a user page - We'll also check if it is user edit
356
  if ( !empty( $bbp_user ) ) {
357
 
358
+ /** Find User *********************************************************/
359
+
360
+ // Setup the default user variable
361
+ $the_user = false;
362
+
363
+ // If using pretty permalinks, use the email or slug
364
+ if ( get_option( 'permalink_structure' ) ) {
365
 
366
  // Email was passed
367
  if ( is_email( $bbp_user ) ) {
368
+ $the_user = get_user_by( 'email', $bbp_user );
369
 
370
  // Try nicename
371
  } else {
372
+ $the_user = get_user_by( 'slug', $bbp_user );
 
 
 
 
 
373
  }
374
  }
375
 
376
+ // No user found by slug/email, so try the ID if it's numeric
377
+ if ( empty( $the_user ) && is_numeric( $bbp_user ) ) {
378
+ $the_user = get_user_by( 'id', $bbp_user );
379
+ }
380
 
381
  // 404 and bail if user does not have a profile
382
+ if ( empty( $the_user->ID ) || ! bbp_user_has_profile( $the_user->ID ) ) {
383
  $posts_query->set_404();
384
  return;
385
  }
445
  // Correct is_home variable
446
  $posts_query->is_home = false;
447
 
 
 
 
448
  // User is looking at their own profile
449
+ if ( get_current_user_id() === $the_user->ID ) {
450
  $posts_query->bbp_is_single_user_home = true;
451
  }
452
 
453
  // Set bbp_user_id for future reference
454
+ $posts_query->set( 'bbp_user_id', $the_user->ID );
455
 
456
  // Set author_name as current user's nicename to get correct posts
457
+ $posts_query->set( 'author_name', $the_user->user_nicename );
458
 
459
  // Set the displayed user global to this user
460
+ bbpress()->displayed_user = $the_user;
461
 
462
  // View Page
463
  } elseif ( !empty( $bbp_view ) ) {
534
  $posts_query->set( 'bbp_topic_tag', get_query_var( 'term' ) );
535
  $posts_query->set( 'post_type', bbp_get_topic_post_type() );
536
  $posts_query->set( 'posts_per_page', bbp_get_topics_per_page() );
537
+
538
+ // Do topics on forums root
539
+ } elseif ( is_post_type_archive( array( bbp_get_forum_post_type(), bbp_get_topic_post_type() ) ) && ( 'topics' === bbp_show_on_root() ) ) {
540
+ $posts_query->bbp_show_topics_on_root = true;
541
  }
542
  }
includes/core/template-loader.php CHANGED
@@ -108,19 +108,38 @@ function bbp_template_include_theme_supports( $template = '' ) {
108
  elseif ( bbp_is_topic_tag() && ( $new_template = bbp_get_topic_tag_template() ) ) :
109
  endif;
110
 
111
- // bbPress template file exists
 
112
  if ( !empty( $new_template ) ) {
113
-
114
- // Override the WordPress template with a bbPress one
115
- $template = $new_template;
116
-
117
- // @see: bbp_template_include_theme_compat()
118
- bbpress()->theme_compat->bbpress_template = true;
119
  }
120
 
121
  return apply_filters( 'bbp_template_include_theme_supports', $template );
122
  }
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  /** Custom Functions **********************************************************/
125
 
126
  /**
108
  elseif ( bbp_is_topic_tag() && ( $new_template = bbp_get_topic_tag_template() ) ) :
109
  endif;
110
 
111
+ // A bbPress template file was located, so override the WordPress template
112
+ // and use it to switch off bbPress's theme compatibility.
113
  if ( !empty( $new_template ) ) {
114
+ $template = bbp_set_template_included( $new_template );
 
 
 
 
 
115
  }
116
 
117
  return apply_filters( 'bbp_template_include_theme_supports', $template );
118
  }
119
 
120
+ /**
121
+ * Set the included template
122
+ *
123
+ * @since bbPress (r4975)
124
+ * @param mixed $template Default false
125
+ * @return mixed False if empty. Template name if template included
126
+ */
127
+ function bbp_set_template_included( $template = false ) {
128
+ bbpress()->theme_compat->bbpress_template = $template;
129
+
130
+ return bbpress()->theme_compat->bbpress_template;
131
+ }
132
+
133
+ /**
134
+ * Is a bbPress template being included?
135
+ *
136
+ * @since bbPress (r4975)
137
+ * @return bool True if yes, false if no
138
+ */
139
+ function bbp_is_template_included() {
140
+ return ! empty( bbpress()->theme_compat->bbpress_template );
141
+ }
142
+
143
  /** Custom Functions **********************************************************/
144
 
145
  /**
includes/core/theme-compat.php CHANGED
@@ -45,7 +45,7 @@ class BBP_Theme_Compat {
45
  * 'dir' => Path to theme
46
  * 'url' => URL to theme
47
  * );
48
- * @var array
49
  */
50
  private $_data = array();
51
 
@@ -258,7 +258,7 @@ function bbp_is_theme_compat_original_template( $template = '' ) {
258
  if ( empty( $bbp->theme_compat->original_template ) )
259
  return false;
260
 
261
- return (bool) ( $bbp->theme_compat->original_template == $template );
262
  }
263
 
264
  /**
@@ -297,42 +297,9 @@ function bbp_register_theme_package( $theme = array(), $override = true ) {
297
  function bbp_theme_compat_reset_post( $args = array() ) {
298
  global $wp_query, $post;
299
 
300
- // Default arguments
301
- $defaults = array(
302
- 'ID' => -9999,
303
- 'post_status' => bbp_get_public_status_id(),
304
- 'post_author' => 0,
305
- 'post_parent' => 0,
306
- 'post_type' => 'page',
307
- 'post_date' => 0,
308
- 'post_date_gmt' => 0,
309
- 'post_modified' => 0,
310
- 'post_modified_gmt' => 0,
311
- 'post_content' => '',
312
- 'post_title' => '',
313
- 'post_excerpt' => '',
314
- 'post_content_filtered' => '',
315
- 'post_mime_type' => '',
316
- 'post_password' => '',
317
- 'post_name' => '',
318
- 'guid' => '',
319
- 'menu_order' => 0,
320
- 'pinged' => '',
321
- 'to_ping' => '',
322
- 'ping_status' => '',
323
- 'comment_status' => 'closed',
324
- 'comment_count' => 0,
325
-
326
- 'is_404' => false,
327
- 'is_page' => false,
328
- 'is_single' => false,
329
- 'is_archive' => false,
330
- 'is_tax' => false,
331
- );
332
-
333
  // Switch defaults if post is set
334
- if ( isset( $wp_query->post ) ) {
335
- $defaults = array(
336
  'ID' => $wp_query->post->ID,
337
  'post_status' => $wp_query->post->post_status,
338
  'post_author' => $wp_query->post->post_author,
@@ -356,52 +323,60 @@ function bbp_theme_compat_reset_post( $args = array() ) {
356
  'ping_status' => $wp_query->post->ping_status,
357
  'comment_status' => $wp_query->post->comment_status,
358
  'comment_count' => $wp_query->post->comment_count,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
 
360
- 'is_404' => false,
361
- 'is_page' => false,
362
- 'is_single' => false,
363
- 'is_archive' => false,
364
- 'is_tax' => false,
365
- );
366
  }
367
- $dummy = bbp_parse_args( $args, $defaults, 'theme_compat_reset_post' );
368
-
369
- // Clear out the post related globals
370
- unset( $wp_query->posts );
371
- unset( $wp_query->post );
372
- unset( $post );
373
-
374
- // Setup the dummy post object
375
- $wp_query->post = new stdClass;
376
- $wp_query->post->ID = $dummy['ID'];
377
- $wp_query->post->post_status = $dummy['post_status'];
378
- $wp_query->post->post_author = $dummy['post_author'];
379
- $wp_query->post->post_parent = $dummy['post_parent'];
380
- $wp_query->post->post_type = $dummy['post_type'];
381
- $wp_query->post->post_date = $dummy['post_date'];
382
- $wp_query->post->post_date_gmt = $dummy['post_date_gmt'];
383
- $wp_query->post->post_modified = $dummy['post_modified'];
384
- $wp_query->post->post_modified_gmt = $dummy['post_modified_gmt'];
385
- $wp_query->post->post_content = $dummy['post_content'];
386
- $wp_query->post->post_title = $dummy['post_title'];
387
- $wp_query->post->post_excerpt = $dummy['post_excerpt'];
388
- $wp_query->post->post_content_filtered = $dummy['post_content_filtered'];
389
- $wp_query->post->post_mime_type = $dummy['post_mime_type'];
390
- $wp_query->post->post_password = $dummy['post_password'];
391
- $wp_query->post->post_name = $dummy['post_name'];
392
- $wp_query->post->guid = $dummy['guid'];
393
- $wp_query->post->menu_order = $dummy['menu_order'];
394
- $wp_query->post->pinged = $dummy['pinged'];
395
- $wp_query->post->to_ping = $dummy['to_ping'];
396
- $wp_query->post->ping_status = $dummy['ping_status'];
397
- $wp_query->post->comment_status = $dummy['comment_status'];
398
- $wp_query->post->comment_count = $dummy['comment_count'];
399
 
400
  // Set the $post global
401
- $post = $wp_query->post;
402
 
403
- // Setup the dummy post loop
404
- $wp_query->posts[0] = $wp_query->post;
 
405
 
406
  // Prevent comments form from appearing
407
  $wp_query->post_count = 1;
@@ -411,16 +386,20 @@ function bbp_theme_compat_reset_post( $args = array() ) {
411
  $wp_query->is_archive = $dummy['is_archive'];
412
  $wp_query->is_tax = $dummy['is_tax'];
413
 
 
 
 
414
  /**
415
  * Force the header back to 200 status if not a deliberate 404
416
  *
417
  * @see http://bbpress.trac.wordpress.org/ticket/1973
418
  */
419
- if ( ! $wp_query->is_404() )
420
  status_header( 200 );
 
421
 
422
  // If we are resetting a post, we are in theme compat
423
- bbp_set_theme_compat_active();
424
  }
425
 
426
  /**
@@ -464,6 +443,13 @@ function bbp_template_include_theme_compat( $template = '' ) {
464
  if ( function_exists( 'is_buddypress' ) && is_buddypress() )
465
  return $template;
466
 
 
 
 
 
 
 
 
467
  /** Users *************************************************************/
468
 
469
  if ( bbp_is_single_user_edit() || bbp_is_single_user() ) {
@@ -473,9 +459,9 @@ function bbp_template_include_theme_compat( $template = '' ) {
473
  'ID' => 0,
474
  'post_author' => 0,
475
  'post_date' => 0,
476
- 'post_content' => '',
477
  'post_type' => '',
478
- 'post_title' => esc_attr( bbp_get_displayed_user_field( 'display_name' ) ),
479
  'post_status' => bbp_get_public_status_id(),
480
  'is_archive' => false,
481
  'comment_status' => 'closed'
@@ -486,13 +472,50 @@ function bbp_template_include_theme_compat( $template = '' ) {
486
  // Forum archive
487
  } elseif ( bbp_is_forum_archive() ) {
488
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  // Reset post
490
  bbp_theme_compat_reset_post( array(
491
- 'ID' => 0,
492
- 'post_title' => bbp_get_forum_archive_title(),
493
  'post_author' => 0,
494
  'post_date' => 0,
495
- 'post_content' => '',
496
  'post_type' => bbp_get_forum_post_type(),
497
  'post_status' => bbp_get_public_status_id(),
498
  'is_archive' => true,
@@ -500,7 +523,7 @@ function bbp_template_include_theme_compat( $template = '' ) {
500
  ) );
501
 
502
  // Single Forum
503
- } elseif ( bbp_is_forum_edit() || bbp_is_single_forum() ) {
504
 
505
  // Reset post
506
  bbp_theme_compat_reset_post( array(
@@ -508,7 +531,22 @@ function bbp_template_include_theme_compat( $template = '' ) {
508
  'post_title' => bbp_get_forum_title(),
509
  'post_author' => bbp_get_forum_author_id(),
510
  'post_date' => 0,
511
- 'post_content' => get_post_field( 'post_content', bbp_get_forum_id() ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  'post_type' => bbp_get_forum_post_type(),
513
  'post_status' => bbp_get_forum_visibility(),
514
  'is_single' => true,
@@ -520,13 +558,34 @@ function bbp_template_include_theme_compat( $template = '' ) {
520
  // Topic archive
521
  } elseif ( bbp_is_topic_archive() ) {
522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  // Reset post
524
  bbp_theme_compat_reset_post( array(
525
- 'ID' => 0,
526
  'post_title' => bbp_get_topic_archive_title(),
527
  'post_author' => 0,
528
  'post_date' => 0,
529
- 'post_content' => '',
530
  'post_type' => bbp_get_topic_post_type(),
531
  'post_status' => bbp_get_public_status_id(),
532
  'is_archive' => true,
@@ -536,13 +595,30 @@ function bbp_template_include_theme_compat( $template = '' ) {
536
  // Single Topic
537
  } elseif ( bbp_is_topic_edit() || bbp_is_single_topic() ) {
538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  // Reset post
540
  bbp_theme_compat_reset_post( array(
541
  'ID' => bbp_get_topic_id(),
542
  'post_title' => bbp_get_topic_title(),
543
  'post_author' => bbp_get_topic_author_id(),
544
  'post_date' => 0,
545
- 'post_content' => get_post_field( 'post_content', bbp_get_topic_id() ),
546
  'post_type' => bbp_get_topic_post_type(),
547
  'post_status' => bbp_get_topic_status(),
548
  'is_single' => true,
@@ -560,7 +636,7 @@ function bbp_template_include_theme_compat( $template = '' ) {
560
  'post_title' => __( 'Replies', 'bbpress' ),
561
  'post_author' => 0,
562
  'post_date' => 0,
563
- 'post_content' => '',
564
  'post_type' => bbp_get_reply_post_type(),
565
  'post_status' => bbp_get_public_status_id(),
566
  'comment_status' => 'closed'
@@ -569,13 +645,26 @@ function bbp_template_include_theme_compat( $template = '' ) {
569
  // Single Reply
570
  } elseif ( bbp_is_reply_edit() || bbp_is_single_reply() ) {
571
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  // Reset post
573
  bbp_theme_compat_reset_post( array(
574
  'ID' => bbp_get_reply_id(),
575
  'post_title' => bbp_get_reply_title(),
576
  'post_author' => bbp_get_reply_author_id(),
577
  'post_date' => 0,
578
- 'post_content' => get_post_field( 'post_content', bbp_get_reply_id() ),
579
  'post_type' => bbp_get_reply_post_type(),
580
  'post_status' => bbp_get_reply_status(),
581
  'comment_status' => 'closed'
@@ -591,7 +680,7 @@ function bbp_template_include_theme_compat( $template = '' ) {
591
  'post_title' => bbp_get_view_title(),
592
  'post_author' => 0,
593
  'post_date' => 0,
594
- 'post_content' => '',
595
  'post_type' => '',
596
  'post_status' => bbp_get_public_status_id(),
597
  'comment_status' => 'closed'
@@ -607,7 +696,7 @@ function bbp_template_include_theme_compat( $template = '' ) {
607
  'post_title' => bbp_get_search_title(),
608
  'post_author' => 0,
609
  'post_date' => 0,
610
- 'post_content' => '',
611
  'post_type' => '',
612
  'post_status' => bbp_get_public_status_id(),
613
  'comment_status' => 'closed'
@@ -621,12 +710,21 @@ function bbp_template_include_theme_compat( $template = '' ) {
621
  // Stash the current term in a new var
622
  set_query_var( 'bbp_topic_tag', get_query_var( 'term' ) );
623
 
 
 
 
 
 
 
 
 
 
624
  // Reset the post with our new title
625
  bbp_theme_compat_reset_post( array(
626
  'ID' => 0,
627
  'post_author' => 0,
628
  'post_date' => 0,
629
- 'post_content' => '',
630
  'post_type' => '',
631
  'post_title' => sprintf( __( 'Topic Tag: %s', 'bbpress' ), '<span>' . bbp_get_topic_tag_name() . '</span>' ),
632
  'post_status' => bbp_get_public_status_id(),
@@ -641,11 +739,11 @@ function bbp_template_include_theme_compat( $template = '' ) {
641
  * template files for users, topics, forums, etc...
642
  *
643
  * We do this after the above checks to prevent incorrect 404 body classes
644
- * and header statuses.
645
  *
646
  * @see http://bbpress.trac.wordpress.org/ticket/1478/
647
  */
648
- if ( !empty( bbpress()->theme_compat->bbpress_template ) )
649
  return $template;
650
 
651
  /**
@@ -661,238 +759,19 @@ function bbp_template_include_theme_compat( $template = '' ) {
661
  * Uses bbp_get_theme_compat_templates() to provide fall-backs that
662
  * should be coded without superfluous mark-up and logic (prev/next
663
  * navigation, comments, date/time, etc...)
664
- *
665
  * Hook into the 'bbp_get_bbpress_template' to override the array of
666
  * possible templates, or 'bbp_bbpress_template' to override the result.
667
  */
668
- if ( bbp_is_theme_compat_active() ) {
669
-
670
- // Remove all filters from the_content
671
  bbp_remove_all_filters( 'the_content' );
672
 
673
- // Add a filter on the_content late, which we will later remove
674
- add_filter( 'the_content', 'bbp_replace_the_content' );
675
-
676
- // Find the appropriate template file
677
  $template = bbp_get_theme_compat_templates();
678
  }
679
 
680
  return apply_filters( 'bbp_template_include_theme_compat', $template );
681
  }
682
 
683
- /**
684
- * Replaces the_content() if the post_type being displayed is one that would
685
- * normally be handled by bbPress, but proper single page templates do not
686
- * exist in the currently active theme.
687
- *
688
- * Note that we do *not* currently use is_main_query() here. This is because so
689
- * many existing themes either use query_posts() or fail to use wp_reset_query()
690
- * when running queries before the main loop, causing theme compat to fail.
691
- *
692
- * @since bbPress (r3034)
693
- * @param string $content
694
- * @return type
695
- */
696
- function bbp_replace_the_content( $content = '' ) {
697
-
698
- // Bail if not inside the query loop
699
- if ( ! in_the_loop() )
700
- return $content;
701
-
702
- $bbp = bbpress();
703
-
704
- // Define local variable(s)
705
- $new_content = '';
706
-
707
- // Bail if shortcodes are unset somehow
708
- if ( !is_a( $bbp->shortcodes, 'BBP_Shortcodes' ) )
709
- return $content;
710
-
711
- // Use shortcode API to display forums/topics/replies because they are
712
- // already output buffered and ready to fit inside the_content
713
-
714
- /** Users *************************************************************/
715
-
716
- // Profile View
717
- if ( bbp_is_single_user_edit() || bbp_is_single_user() ) {
718
- ob_start();
719
-
720
- bbp_get_template_part( 'content', 'single-user' );
721
-
722
- $new_content = ob_get_contents();
723
-
724
- ob_end_clean();
725
-
726
- /** Forums ************************************************************/
727
-
728
- // Forum archive
729
- } elseif ( bbp_is_forum_archive() ) {
730
-
731
- // Page exists where this archive should be
732
- $page = bbp_get_page_by_path( bbp_get_root_slug() );
733
- if ( !empty( $page ) ) {
734
-
735
- // Restore previously unset filters
736
- bbp_restore_all_filters( 'the_content' );
737
-
738
- // Remove 'bbp_replace_the_content' filter to prevent infinite loops
739
- remove_filter( 'the_content', 'bbp_replace_the_content' );
740
-
741
- // Start output buffer
742
- ob_start();
743
-
744
- // Grab the content of this page
745
- $new_content = apply_filters( 'the_content', $page->post_content );
746
-
747
- // Clean up the buffer
748
- ob_end_clean();
749
-
750
- // Add 'bbp_replace_the_content' filter back (@see $this::start())
751
- add_filter( 'the_content', 'bbp_replace_the_content' );
752
-
753
- // No page so show the archive
754
- } else {
755
- $new_content = $bbp->shortcodes->display_forum_index();
756
- }
757
-
758
- // Forum Edit
759
- } elseif ( bbp_is_forum_edit() ) {
760
- $new_content = $bbp->shortcodes->display_forum_form();
761
-
762
- // Single Forum
763
- } elseif ( bbp_is_single_forum() ) {
764
- $new_content = $bbp->shortcodes->display_forum( array( 'id' => get_the_ID() ) );
765
-
766
- /** Topics ************************************************************/
767
-
768
- // Topic archive
769
- } elseif ( bbp_is_topic_archive() ) {
770
-
771
- // Page exists where this archive should be
772
- $page = bbp_get_page_by_path( bbp_get_topic_archive_slug() );
773
- if ( !empty( $page ) ) {
774
-
775
- // Restore previously unset filters
776
- bbp_restore_all_filters( 'the_content' );
777
-
778
- // Remove 'bbp_replace_the_content' filter to prevent infinite loops
779
- remove_filter( 'the_content', 'bbp_replace_the_content' );
780
-
781
- // Start output buffer
782
- ob_start();
783
-
784
- // Grab the content of this page
785
- $new_content = apply_filters( 'the_content', $page->post_content );
786
-
787
- // Clean up the buffer
788
- ob_end_clean();
789
-
790
- // Add 'bbp_replace_the_content' filter back (@see $this::start())
791
- add_filter( 'the_content', 'bbp_replace_the_content' );
792
-
793
- // No page so show the archive
794
- } else {
795
- $new_content = $bbp->shortcodes->display_topic_index();
796
- }
797
-
798
- // Topic Edit
799
- } elseif ( bbp_is_topic_edit() ) {
800
-
801
- // Split
802
- if ( bbp_is_topic_split() ) {
803
- ob_start();
804
-
805
- bbp_get_template_part( 'form', 'topic-split' );
806
-
807
- $new_content = ob_get_contents();
808
-
809
- ob_end_clean();
810
-
811
- // Merge
812
- } elseif ( bbp_is_topic_merge() ) {
813
- ob_start();
814
-
815
- bbp_get_template_part( 'form', 'topic-merge' );
816
-
817
- $new_content = ob_get_contents();
818
-
819
- ob_end_clean();
820
-
821
- // Edit
822
- } else {
823
- $new_content = $bbp->shortcodes->display_topic_form();
824
- }
825
-
826
- // Single Topic
827
- } elseif ( bbp_is_single_topic() ) {
828
- $new_content = $bbp->shortcodes->display_topic( array( 'id' => get_the_ID() ) );
829
-
830
- /** Replies ***********************************************************/
831
-
832
- // Reply archive
833
- } elseif ( is_post_type_archive( bbp_get_reply_post_type() ) ) {
834
- //$new_content = $bbp->shortcodes->display_reply_index();
835
-
836
- // Reply Edit
837
- } elseif ( bbp_is_reply_edit() ) {
838
-
839
- // Move
840
- if ( bbp_is_reply_move() ) {
841
- ob_start();
842
-
843
- bbp_get_template_part( 'form', 'reply-move' );
844
-
845
- $new_content = ob_get_contents();
846
-
847
- ob_end_clean();
848
-
849
- // Edit
850
- } else {
851
- $new_content = $bbp->shortcodes->display_reply_form();
852
- }
853
-
854
- // Single Reply
855
- } elseif ( bbp_is_single_reply() ) {
856
- $new_content = $bbp->shortcodes->display_reply( array( 'id' => get_the_ID() ) );
857
-
858
- /** Views *************************************************************/
859
-
860
- } elseif ( bbp_is_single_view() ) {
861
- $new_content = $bbp->shortcodes->display_view( array( 'id' => get_query_var( 'bbp_view' ) ) );
862
-
863
- /** Search ************************************************************/
864
-
865
- } elseif ( bbp_is_search() ) {
866
- $new_content = $bbp->shortcodes->display_search( array( 'search' => get_query_var( 'bbp_search' ) ) );
867
-
868
- /** Topic Tags ********************************************************/
869
-
870
- // Show topics of tag
871
- } elseif ( bbp_is_topic_tag() ) {
872
- $new_content = $bbp->shortcodes->display_topics_of_tag( array( 'id' => bbp_get_topic_tag_id() ) );
873
-
874
- // Edit topic tag
875
- } elseif ( bbp_is_topic_tag_edit() ) {
876
- $new_content = $bbp->shortcodes->display_topic_tag_form();
877
- }
878
-
879
- // Juggle the content around and try to prevent unsightly comments
880
- if ( !empty( $new_content ) && ( $new_content != $content ) ) {
881
-
882
- // Set the content to be the new content
883
- $content = apply_filters( 'bbp_replace_the_content', $new_content, $content );
884
-
885
- // Clean up after ourselves
886
- unset( $new_content );
887
-
888
- // Reset the $post global
889
- wp_reset_postdata();
890
- }
891
-
892
- // Return possibly hi-jacked content
893
- return $content;
894
- }
895
-
896
  /** Helpers *******************************************************************/
897
 
898
  /**
45
  * 'dir' => Path to theme
46
  * 'url' => URL to theme
47
  * );
48
+ * @var array
49
  */
50
  private $_data = array();
51
 
258
  if ( empty( $bbp->theme_compat->original_template ) )
259
  return false;
260
 
261
+ return (bool) ( $bbp->theme_compat->original_template === $template );
262
  }
263
 
264
  /**
297
  function bbp_theme_compat_reset_post( $args = array() ) {
298
  global $wp_query, $post;
299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  // Switch defaults if post is set
301
+ if ( isset( $wp_query->post ) ) {
302
+ $dummy = bbp_parse_args( $args, array(
303
  'ID' => $wp_query->post->ID,
304
  'post_status' => $wp_query->post->post_status,
305
  'post_author' => $wp_query->post->post_author,
323
  'ping_status' => $wp_query->post->ping_status,
324
  'comment_status' => $wp_query->post->comment_status,
325
  'comment_count' => $wp_query->post->comment_count,
326
+ 'filter' => $wp_query->post->filter,
327
+
328
+ 'is_404' => false,
329
+ 'is_page' => false,
330
+ 'is_single' => false,
331
+ 'is_archive' => false,
332
+ 'is_tax' => false,
333
+ ), 'theme_compat_reset_post' );
334
+ } else {
335
+ $dummy = bbp_parse_args( $args, array(
336
+ 'ID' => -9999,
337
+ 'post_status' => bbp_get_public_status_id(),
338
+ 'post_author' => 0,
339
+ 'post_parent' => 0,
340
+ 'post_type' => 'page',
341
+ 'post_date' => 0,
342
+ 'post_date_gmt' => 0,
343
+ 'post_modified' => 0,
344
+ 'post_modified_gmt' => 0,
345
+ 'post_content' => '',
346
+ 'post_title' => '',
347
+ 'post_excerpt' => '',
348
+ 'post_content_filtered' => '',
349
+ 'post_mime_type' => '',
350
+ 'post_password' => '',
351
+ 'post_name' => '',
352
+ 'guid' => '',
353
+ 'menu_order' => 0,
354
+ 'pinged' => '',
355
+ 'to_ping' => '',
356
+ 'ping_status' => '',
357
+ 'comment_status' => 'closed',
358
+ 'comment_count' => 0,
359
+ 'filter' => 'raw',
360
+
361
+ 'is_404' => false,
362
+ 'is_page' => false,
363
+ 'is_single' => false,
364
+ 'is_archive' => false,
365
+ 'is_tax' => false,
366
+ ), 'theme_compat_reset_post' );
367
+ }
368
 
369
+ // Bail if dummy post is empty
370
+ if ( empty( $dummy ) ) {
371
+ return;
 
 
 
372
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
 
374
  // Set the $post global
375
+ $post = new WP_Post( (object) $dummy );
376
 
377
+ // Copy the new post global into the main $wp_query
378
+ $wp_query->post = $post;
379
+ $wp_query->posts = array( $post );
380
 
381
  // Prevent comments form from appearing
382
  $wp_query->post_count = 1;
386
  $wp_query->is_archive = $dummy['is_archive'];
387
  $wp_query->is_tax = $dummy['is_tax'];
388
 
389
+ // Clean up the dummy post
390
+ unset( $dummy );
391
+
392
  /**
393
  * Force the header back to 200 status if not a deliberate 404
394
  *
395
  * @see http://bbpress.trac.wordpress.org/ticket/1973
396
  */
397
+ if ( ! $wp_query->is_404() ) {
398
  status_header( 200 );
399
+ }
400
 
401
  // If we are resetting a post, we are in theme compat
402
+ bbp_set_theme_compat_active( true );
403
  }
404
 
405
  /**
443
  if ( function_exists( 'is_buddypress' ) && is_buddypress() )
444
  return $template;
445
 
446
+ // Define local variable(s)
447
+ $bbp_shortcodes = bbpress()->shortcodes;
448
+
449
+ // Bail if shortcodes are unset somehow
450
+ if ( !is_a( $bbp_shortcodes, 'BBP_Shortcodes' ) )
451
+ return $template;
452
+
453
  /** Users *************************************************************/
454
 
455
  if ( bbp_is_single_user_edit() || bbp_is_single_user() ) {
459
  'ID' => 0,
460
  'post_author' => 0,
461
  'post_date' => 0,
462
+ 'post_content' => bbp_buffer_template_part( 'content', 'single-user', false ),
463
  'post_type' => '',
464
+ 'post_title' => bbp_get_displayed_user_field( 'display_name' ),
465
  'post_status' => bbp_get_public_status_id(),
466
  'is_archive' => false,
467
  'comment_status' => 'closed'
472
  // Forum archive
473
  } elseif ( bbp_is_forum_archive() ) {
474
 
475
+ // Page exists where this archive should be
476
+ $page = bbp_get_page_by_path( bbp_get_root_slug() );
477
+
478
+ // Should we replace the content...
479
+ if ( empty( $page->post_content ) ) {
480
+
481
+ // Use the topics archive
482
+ if ( 'topics' === bbp_show_on_root() ) {
483
+ $new_content = $bbp_shortcodes->display_topic_index();
484
+
485
+ // No page so show the archive
486
+ } else {
487
+ $new_content = $bbp_shortcodes->display_forum_index();
488
+ }
489
+
490
+ // ...or use the existing page content?
491
+ } else {
492
+ $new_content = apply_filters( 'the_content', $page->post_content );
493
+ }
494
+
495
+ // Should we replace the title...
496
+ if ( empty( $page->post_title ) ) {
497
+
498
+ // Use the topics archive
499
+ if ( 'topics' === bbp_show_on_root() ) {
500
+ $new_title = bbp_get_topic_archive_title();
501
+
502
+ // No page so show the archive
503
+ } else {
504
+ $new_title = bbp_get_forum_archive_title();
505
+ }
506
+
507
+ // ...or use the existing page title?
508
+ } else {
509
+ $new_title = apply_filters( 'the_title', $page->post_title );
510
+ }
511
+
512
  // Reset post
513
  bbp_theme_compat_reset_post( array(
514
+ 'ID' => !empty( $page->ID ) ? $page->ID : 0,
515
+ 'post_title' => $new_title,
516
  'post_author' => 0,
517
  'post_date' => 0,
518
+ 'post_content' => $new_content,
519
  'post_type' => bbp_get_forum_post_type(),
520
  'post_status' => bbp_get_public_status_id(),
521
  'is_archive' => true,
523
  ) );
524
 
525
  // Single Forum
526
+ } elseif ( bbp_is_forum_edit() ) {
527
 
528
  // Reset post
529
  bbp_theme_compat_reset_post( array(
531
  'post_title' => bbp_get_forum_title(),
532
  'post_author' => bbp_get_forum_author_id(),
533
  'post_date' => 0,
534
+ 'post_content' => $bbp_shortcodes->display_forum_form(),
535
+ 'post_type' => bbp_get_forum_post_type(),
536
+ 'post_status' => bbp_get_forum_visibility(),
537
+ 'is_single' => true,
538
+ 'comment_status' => 'closed'
539
+ ) );
540
+
541
+ } elseif ( bbp_is_single_forum() ) {
542
+
543
+ // Reset post
544
+ bbp_theme_compat_reset_post( array(
545
+ 'ID' => bbp_get_forum_id(),
546
+ 'post_title' => bbp_get_forum_title(),
547
+ 'post_author' => bbp_get_forum_author_id(),
548
+ 'post_date' => 0,
549
+ 'post_content' => $bbp_shortcodes->display_forum( array( 'id' => bbp_get_forum_id() ) ),
550
  'post_type' => bbp_get_forum_post_type(),
551
  'post_status' => bbp_get_forum_visibility(),
552
  'is_single' => true,
558
  // Topic archive
559
  } elseif ( bbp_is_topic_archive() ) {
560
 
561
+ // Page exists where this archive should be
562
+ $page = bbp_get_page_by_path( bbp_get_topic_archive_slug() );
563
+
564
+ // Should we replace the content...
565
+ if ( empty( $page->post_content ) ) {
566
+ $new_content = $bbp_shortcodes->display_topic_index();
567
+
568
+ // ...or use the existing page content?
569
+ } else {
570
+ $new_content = apply_filters( 'the_content', $page->post_content );
571
+ }
572
+
573
+ // Should we replace the title...
574
+ if ( empty( $page->post_title ) ) {
575
+ $new_title = bbp_get_topic_archive_title();
576
+
577
+ // ...or use the existing page title?
578
+ } else {
579
+ $new_title = apply_filters( 'the_title', $page->post_title );
580
+ }
581
+
582
  // Reset post
583
  bbp_theme_compat_reset_post( array(
584
+ 'ID' => !empty( $page->ID ) ? $page->ID : 0,
585
  'post_title' => bbp_get_topic_archive_title(),
586
  'post_author' => 0,
587
  'post_date' => 0,
588
+ 'post_content' => $new_content,
589
  'post_type' => bbp_get_topic_post_type(),
590
  'post_status' => bbp_get_public_status_id(),
591
  'is_archive' => true,
595
  // Single Topic
596
  } elseif ( bbp_is_topic_edit() || bbp_is_single_topic() ) {
597
 
598
+ // Split
599
+ if ( bbp_is_topic_split() ) {
600
+ $new_content = bbp_buffer_template_part( 'form', 'topic-split', false );
601
+
602
+ // Merge
603
+ } elseif ( bbp_is_topic_merge() ) {
604
+ $new_content = bbp_buffer_template_part( 'form', 'topic-merge', false );
605
+
606
+ // Edit
607
+ } elseif ( bbp_is_topic_edit() ) {
608
+ $new_content = $bbp_shortcodes->display_topic_form();
609
+
610
+ // Single
611
+ } else {
612
+ $new_content = $bbp_shortcodes->display_topic( array( 'id' => bbp_get_topic_id() ) );
613
+ }
614
+
615
  // Reset post
616
  bbp_theme_compat_reset_post( array(
617
  'ID' => bbp_get_topic_id(),
618
  'post_title' => bbp_get_topic_title(),
619
  'post_author' => bbp_get_topic_author_id(),
620
  'post_date' => 0,
621
+ 'post_content' => $new_content,
622
  'post_type' => bbp_get_topic_post_type(),
623
  'post_status' => bbp_get_topic_status(),
624
  'is_single' => true,
636
  'post_title' => __( 'Replies', 'bbpress' ),
637
  'post_author' => 0,
638
  'post_date' => 0,
639
+ 'post_content' => $bbp_shortcodes->display_reply_index(),
640
  'post_type' => bbp_get_reply_post_type(),
641
  'post_status' => bbp_get_public_status_id(),
642
  'comment_status' => 'closed'
645
  // Single Reply
646
  } elseif ( bbp_is_reply_edit() || bbp_is_single_reply() ) {
647
 
648
+ // Move
649
+ if ( bbp_is_reply_move() ) {
650
+ $new_content = bbp_buffer_template_part( 'form', 'reply-move', false );
651
+
652
+ // Edit
653
+ } elseif ( bbp_is_reply_edit() ) {
654
+ $new_content = $bbp_shortcodes->display_reply_form();
655
+
656
+ // Single
657
+ } else {
658
+ $new_content = $bbp_shortcodes->display_reply( array( 'id' => get_the_ID() ) );
659
+ }
660
+
661
  // Reset post
662
  bbp_theme_compat_reset_post( array(
663
  'ID' => bbp_get_reply_id(),
664
  'post_title' => bbp_get_reply_title(),
665
  'post_author' => bbp_get_reply_author_id(),
666
  'post_date' => 0,
667
+ 'post_content' => $new_content,
668
  'post_type' => bbp_get_reply_post_type(),
669
  'post_status' => bbp_get_reply_status(),
670
  'comment_status' => 'closed'
680
  'post_title' => bbp_get_view_title(),
681
  'post_author' => 0,
682
  'post_date' => 0,
683
+ 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( 'bbp_view' ) ) ),
684
  'post_type' => '',
685
  'post_status' => bbp_get_public_status_id(),
686
  'comment_status' => 'closed'
696
  'post_title' => bbp_get_search_title(),
697
  'post_author' => 0,
698
  'post_date' => 0,
699
+ 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( 'bbp_search' ) ) ),
700
  'post_type' => '',
701
  'post_status' => bbp_get_public_status_id(),
702
  'comment_status' => 'closed'
710
  // Stash the current term in a new var
711
  set_query_var( 'bbp_topic_tag', get_query_var( 'term' ) );
712
 
713
+ // Show topics of tag
714
+ if ( bbp_is_topic_tag() ) {
715
+ $new_content = $bbp_shortcodes->display_topics_of_tag( array( 'id' => bbp_get_topic_tag_id() ) );
716
+
717
+ // Edit topic tag
718
+ } elseif ( bbp_is_topic_tag_edit() ) {
719
+ $new_content = $bbp_shortcodes->display_topic_tag_form();
720
+ }
721
+
722
  // Reset the post with our new title
723
  bbp_theme_compat_reset_post( array(
724
  'ID' => 0,
725
  'post_author' => 0,
726
  'post_date' => 0,
727
+ 'post_content' => $new_content,
728
  'post_type' => '',
729
  'post_title' => sprintf( __( 'Topic Tag: %s', 'bbpress' ), '<span>' . bbp_get_topic_tag_name() . '</span>' ),
730
  'post_status' => bbp_get_public_status_id(),
739
  * template files for users, topics, forums, etc...
740
  *
741
  * We do this after the above checks to prevent incorrect 404 body classes
742
+ * and header statuses, as well as to set the post global as needed.
743
  *
744
  * @see http://bbpress.trac.wordpress.org/ticket/1478/
745
  */
746
+ if ( bbp_is_template_included() ) {
747
  return $template;
748
 
749
  /**
759
  * Uses bbp_get_theme_compat_templates() to provide fall-backs that
760
  * should be coded without superfluous mark-up and logic (prev/next
761
  * navigation, comments, date/time, etc...)
762
+ *
763
  * Hook into the 'bbp_get_bbpress_template' to override the array of
764
  * possible templates, or 'bbp_bbpress_template' to override the result.
765
  */
766
+ } elseif ( bbp_is_theme_compat_active() ) {
 
 
767
  bbp_remove_all_filters( 'the_content' );
768
 
 
 
 
 
769
  $template = bbp_get_theme_compat_templates();
770
  }
771
 
772
  return apply_filters( 'bbp_template_include_theme_compat', $template );
773
  }
774
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  /** Helpers *******************************************************************/
776
 
777
  /**
includes/core/update.php CHANGED
@@ -50,12 +50,19 @@ function bbp_is_update() {
50
  * @return bool True if activating bbPress, false if not
51
  */
52
  function bbp_is_activation( $basename = '' ) {
 
 
53
  $bbp = bbpress();
54
  $action = false;
55
 
56
- if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
 
 
 
 
 
57
  $action = $_REQUEST['action'];
58
- } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
59
  $action = $_REQUEST['action2'];
60
  }
61
 
@@ -65,7 +72,7 @@ function bbp_is_activation( $basename = '' ) {
65
  }
66
 
67
  // The plugin(s) being activated
68
- if ( $action == 'activate' ) {
69
  $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
70
  } else {
71
  $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
@@ -92,12 +99,19 @@ function bbp_is_activation( $basename = '' ) {
92
  * @return bool True if deactivating bbPress, false if not
93
  */
94
  function bbp_is_deactivation( $basename = '' ) {
 
 
95
  $bbp = bbpress();
96
  $action = false;
97
-
98
- if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
 
 
 
 
 
99
  $action = $_REQUEST['action'];
100
- } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
101
  $action = $_REQUEST['action2'];
102
  }
103
 
@@ -107,7 +121,7 @@ function bbp_is_deactivation( $basename = '' ) {
107
  }
108
 
109
  // The plugin(s) being deactivated
110
- if ( $action == 'deactivate' ) {
111
  $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
112
  } else {
113
  $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
@@ -301,3 +315,43 @@ function bbp_add_activation_redirect() {
301
  // Add the transient to redirect
302
  set_transient( '_bbp_activation_redirect', true, 30 );
303
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  * @return bool True if activating bbPress, false if not
51
  */
52
  function bbp_is_activation( $basename = '' ) {
53
+ global $pagenow;
54
+
55
  $bbp = bbpress();
56
  $action = false;
57
 
58
+ // Bail if not in admin/plugins
59
+ if ( ! ( is_admin() && ( 'plugins.php' === $pagenow ) ) ) {
60
+ return false;
61
+ }
62
+
63
+ if ( ! empty( $_REQUEST['action'] ) && ( '-1' !== $_REQUEST['action'] ) ) {
64
  $action = $_REQUEST['action'];
65
+ } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' !== $_REQUEST['action2'] ) ) {
66
  $action = $_REQUEST['action2'];
67
  }
68
 
72
  }
73
 
74
  // The plugin(s) being activated
75
+ if ( $action === 'activate' ) {
76
  $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
77
  } else {
78
  $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
99
  * @return bool True if deactivating bbPress, false if not
100
  */
101
  function bbp_is_deactivation( $basename = '' ) {
102
+ global $pagenow;
103
+
104
  $bbp = bbpress();
105
  $action = false;
106
+
107
+ // Bail if not in admin/plugins
108
+ if ( ! ( is_admin() && ( 'plugins.php' === $pagenow ) ) ) {
109
+ return false;
110
+ }
111
+
112
+ if ( ! empty( $_REQUEST['action'] ) && ( '-1' !== $_REQUEST['action'] ) ) {
113
  $action = $_REQUEST['action'];
114
+ } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' !== $_REQUEST['action2'] ) ) {
115
  $action = $_REQUEST['action2'];
116
  }
117
 
121
  }
122
 
123
  // The plugin(s) being deactivated
124
+ if ( $action === 'deactivate' ) {
125
  $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
126
  } else {
127
  $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
315
  // Add the transient to redirect
316
  set_transient( '_bbp_activation_redirect', true, 30 );
317
  }
318
+
319
+ /**
320
+ * Hooked to the 'bbp_activate' action, this helper function automatically makes
321
+ * the current user a Key Master in the forums if they just activated bbPress,
322
+ * regardless of the bbp_allow_global_access() setting.
323
+ *
324
+ * @since bbPress (r4910)
325
+ *
326
+ * @internal Used to internally make the current user a keymaster on activation
327
+ *
328
+ * @uses current_user_can() to bail if user cannot activate plugins
329
+ * @uses get_current_user_id() to get the current user ID
330
+ * @uses get_current_blog_id() to get the current blog ID
331
+ * @uses is_user_member_of_blog() to bail if the current user does not have a role
332
+ * @uses bbp_is_user_keymaster() to bail if the user is already a keymaster
333
+ * @uses bbp_set_user_role() to make the current user a keymaster
334
+ *
335
+ * @return If user can't activate plugins or is already a keymaster
336
+ */
337
+ function bbp_make_current_user_keymaster() {
338
+
339
+ // Bail if the current user can't activate plugins since previous pageload
340
+ if ( ! current_user_can( 'activate_plugins' ) )
341
+ return;
342
+
343
+ // Get the current user ID
344
+ $user_id = get_current_user_id();
345
+ $blog_id = get_current_blog_id();
346
+
347
+ // Bail if user is not actually a member of this site
348
+ if ( ! is_user_member_of_blog( $user_id, $blog_id ) )
349
+ return;
350
+
351
+ // Bail if the current user is already a keymaster
352
+ if ( bbp_is_user_keymaster( $user_id ) )
353
+ return;
354
+
355
+ // Make the current user a keymaster
356
+ bbp_set_user_role( $user_id, bbp_get_keymaster_role() );
357
+ }
includes/extend/akismet.php CHANGED
@@ -64,11 +64,16 @@ class BBP_Akismet {
64
 
65
  // Add the checks
66
  foreach ( $checks as $type => $functions )
67
- foreach( $functions as $function => $priority )
68
  add_filter( $function, array( $this, $type . '_post' ), $priority );
69
 
70
  // Update post meta
71
  add_action( 'wp_insert_post', array( $this, 'update_post_meta' ), 10, 2 );
 
 
 
 
 
72
  }
73
 
74
  /**
@@ -97,7 +102,7 @@ class BBP_Akismet {
97
  $post_permalink = '';
98
 
99
  // Post is not published
100
- if ( bbp_get_public_status_id() != $post_data['post_status'] )
101
  return $post_data;
102
 
103
  // Cast the post_author to 0 if it's empty
@@ -165,7 +170,7 @@ class BBP_Akismet {
165
  do_action_ref_array( 'bbp_akismet_check_post', $post_data );
166
 
167
  // Spam
168
- if ( 'true' == $post_data['bbp_akismet_result'] ) {
169
 
170
  // Let plugins do their thing
171
  do_action( 'bbp_akismet_spam_caught' );
@@ -254,7 +259,7 @@ class BBP_Akismet {
254
  return;
255
 
256
  // Bail if we're spamming, but the post_status isn't spam
257
- if ( ( 'spam' == $request_type ) && ( bbp_get_spam_status_id() != $_post->post_status ) )
258
  return;
259
 
260
  // Set some default post_data
@@ -301,14 +306,14 @@ class BBP_Akismet {
301
 
302
  // Spammy
303
  case 'spam' :
304
- $this->update_post_history( $post_id, sprintf( __( '%1$s reported this %2$s as spam', 'bbpress' ), $post_data['reporter'], $post_data['comment_type'] ), 'report-spam' );
305
  update_post_meta( $post_id, '_bbp_akismet_user_result', 'true' );
306
  update_post_meta( $post_id, '_bbp_akismet_user', $post_data['reporter'] );
307
  break;
308
 
309
  // Hammy
310
  case 'ham' :
311
- $this->update_post_history( $post_id, sprintf( __( '%1$s reported this %2$s as not spam', 'bbpress' ), $post_data['reporter'], $post_data['comment_type'] ), 'report-ham' );
312
  update_post_meta( $post_id, '_bbp_akismet_user_result', 'false' );
313
  update_post_meta( $post_id, '_bbp_akismet_user', $post_data['reporter'] );
314
 
@@ -384,9 +389,9 @@ class BBP_Akismet {
384
  $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
385
 
386
  // Aim...
387
- if ( 'check' == $check ) {
388
  $path = '/1.1/comment-check';
389
- } elseif ( 'submit' == $check ) {
390
  $path = '/1.1/submit-' . $spam;
391
  }
392
 
@@ -397,7 +402,7 @@ class BBP_Akismet {
397
  if ( !empty( $response[1] ) ) {
398
  $post_data['bbp_akismet_result'] = $response[1];
399
  } else {
400
- $post_data['bbp_akismet_result'] = __( 'No response', 'bbpress' );
401
  }
402
 
403
  // This is ham
@@ -445,43 +450,43 @@ class BBP_Akismet {
445
  $anonymous_data = bbp_filter_anonymous_post_data();
446
 
447
  // More checks
448
- if ( intval( $as_submitted['comment_post_ID'] ) == intval( $_post->post_parent )
449
- && $as_submitted['comment_author'] == ( $anonymous_data ? $anonymous_data['bbp_anonymous_name'] : $userdata->display_name )
450
- && $as_submitted['comment_author_email'] == ( $anonymous_data ? $anonymous_data['bbp_anonymous_email'] : $userdata->user_email )
451
  ) {
452
 
453
  // Normal result: true
454
- if ( $this->last_post['bbp_akismet_result'] == 'true' ) {
455
 
456
  // Leave a trail so other's know what we did
457
  update_post_meta( $post_id, '_bbp_akismet_result', 'true' );
458
- $this->update_post_history( $post_id, __( 'Akismet caught this post as spam', 'bbpress' ), 'check-spam' );
459
 
460
  // If post_status isn't the spam status, as expected, leave a note
461
- if ( $_post->post_status != bbp_get_spam_status_id() ) {
462
- $this->update_post_history( $post_id, sprintf( __( 'Post status was changed to %s', 'bbpress' ), $_post->post_status ), 'status-changed-' . $_post->post_status );
463
  }
464
 
465
  // Normal result: false
466
- } elseif ( $this->last_post['bbp_akismet_result'] == 'false' ) {
467
 
468
  // Leave a trail so other's know what we did
469
  update_post_meta( $post_id, '_bbp_akismet_result', 'false' );
470
- $this->update_post_history( $post_id, __( 'Akismet cleared this post', 'bbpress' ), 'check-ham' );
471
 
472
  // If post_status is the spam status, which isn't expected, leave a note
473
- if ( $_post->post_status == bbp_get_spam_status_id() ) {
474
 
475
  // @todo Use wp_blacklist_check()
476
 
477
- $this->update_post_history( $post_id, sprintf( __( 'Post status was changed to %s', 'bbpress' ), $_post->post_status ), 'status-changed-' . $_post->post_status );
478
  }
479
 
480
  // Abnormal result: error
481
  } else {
482
  // Leave a trail so other's know what we did
483
  update_post_meta( $post_id, '_bbp_akismet_error', time() );
484
- $this->update_post_history( $post_id, sprintf( __( 'Akismet was unable to check this post (response: %s), will automatically retry again later.', 'bbpress' ), $this->last_post['bbp_akismet_result'] ), 'check-error' );
485
  }
486
 
487
  // Record the complete original data as submitted for checking
@@ -660,7 +665,7 @@ class BBP_Akismet {
660
  $http_request .= $request;
661
 
662
  // Open a socket connection
663
- if ( false != ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
664
 
665
  // Write our request to the pointer
666
  fwrite( $fs, $http_request );
@@ -714,5 +719,84 @@ class BBP_Akismet {
714
 
715
  return implode( ',', $roles );
716
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  }
718
  endif;
64
 
65
  // Add the checks
66
  foreach ( $checks as $type => $functions )
67
+ foreach ( $functions as $function => $priority )
68
  add_filter( $function, array( $this, $type . '_post' ), $priority );
69
 
70
  // Update post meta
71
  add_action( 'wp_insert_post', array( $this, 'update_post_meta' ), 10, 2 );
72
+
73
+ // Admin
74
+ if ( is_admin() ) {
75
+ add_action( 'add_meta_boxes', array( $this, 'add_metaboxes' ) );
76
+ }
77
  }
78
 
79
  /**
102
  $post_permalink = '';
103
 
104
  // Post is not published
105
+ if ( bbp_get_public_status_id() !== $post_data['post_status'] )
106
  return $post_data;
107
 
108
  // Cast the post_author to 0 if it's empty
170
  do_action_ref_array( 'bbp_akismet_check_post', $post_data );
171
 
172
  // Spam
173
+ if ( 'true' === $post_data['bbp_akismet_result'] ) {
174
 
175
  // Let plugins do their thing
176
  do_action( 'bbp_akismet_spam_caught' );
259
  return;
260
 
261
  // Bail if we're spamming, but the post_status isn't spam
262
+ if ( ( 'spam' === $request_type ) && ( bbp_get_spam_status_id() !== $_post->post_status ) )
263
  return;
264
 
265
  // Set some default post_data
306
 
307
  // Spammy
308
  case 'spam' :
309
+ $this->update_post_history( $post_id, sprintf( esc_html__( '%1$s reported this %2$s as spam', 'bbpress' ), $post_data['reporter'], $post_data['comment_type'] ), 'report-spam' );
310
  update_post_meta( $post_id, '_bbp_akismet_user_result', 'true' );
311
  update_post_meta( $post_id, '_bbp_akismet_user', $post_data['reporter'] );
312
  break;
313
 
314
  // Hammy
315
  case 'ham' :
316
+ $this->update_post_history( $post_id, sprintf( esc_html__( '%1$s reported this %2$s as not spam', 'bbpress' ), $post_data['reporter'], $post_data['comment_type'] ), 'report-ham' );
317
  update_post_meta( $post_id, '_bbp_akismet_user_result', 'false' );
318
  update_post_meta( $post_id, '_bbp_akismet_user', $post_data['reporter'] );
319
 
389
  $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
390
 
391
  // Aim...
392
+ if ( 'check' === $check ) {
393
  $path = '/1.1/comment-check';
394
+ } elseif ( 'submit' === $check ) {
395
  $path = '/1.1/submit-' . $spam;
396
  }
397
 
402
  if ( !empty( $response[1] ) ) {
403
  $post_data['bbp_akismet_result'] = $response[1];
404
  } else {
405
+ $post_data['bbp_akismet_result'] = esc_html__( 'No response', 'bbpress' );
406
  }
407
 
408
  // This is ham
450
  $anonymous_data = bbp_filter_anonymous_post_data();
451
 
452
  // More checks
453
+ if ( intval( $as_submitted['comment_post_ID'] ) === intval( $_post->post_parent )
454
+ && $as_submitted['comment_author'] === ( $anonymous_data ? $anonymous_data['bbp_anonymous_name'] : $userdata->display_name )
455
+ && $as_submitted['comment_author_email'] === ( $anonymous_data ? $anonymous_data['bbp_anonymous_email'] : $userdata->user_email )
456
  ) {
457
 
458
  // Normal result: true
459
+ if ( $this->last_post['bbp_akismet_result'] === 'true' ) {
460
 
461
  // Leave a trail so other's know what we did
462
  update_post_meta( $post_id, '_bbp_akismet_result', 'true' );
463
+ $this->update_post_history( $post_id, esc_html__( 'Akismet caught this post as spam', 'bbpress' ), 'check-spam' );
464
 
465
  // If post_status isn't the spam status, as expected, leave a note
466
+ if ( bbp_get_spam_status_id() !== $_post->post_status ) {
467
+ $this->update_post_history( $post_id, sprintf( esc_html__( 'Post status was changed to %s', 'bbpress' ), $_post->post_status ), 'status-changed-' . $_post->post_status );
468
  }
469
 
470
  // Normal result: false
471
+ } elseif ( $this->last_post['bbp_akismet_result'] === 'false' ) {
472
 
473
  // Leave a trail so other's know what we did
474
  update_post_meta( $post_id, '_bbp_akismet_result', 'false' );
475
+ $this->update_post_history( $post_id, esc_html__( 'Akismet cleared this post as not spam', 'bbpress' ), 'check-ham' );
476
 
477
  // If post_status is the spam status, which isn't expected, leave a note
478
+ if ( bbp_get_spam_status_id() === $_post->post_status ) {
479
 
480
  // @todo Use wp_blacklist_check()
481
 
482
+ $this->update_post_history( $post_id, sprintf( esc_html__( 'Post status was changed to %s', 'bbpress' ), $_post->post_status ), 'status-changed-' . $_post->post_status );
483
  }
484
 
485
  // Abnormal result: error
486
  } else {
487
  // Leave a trail so other's know what we did
488
  update_post_meta( $post_id, '_bbp_akismet_error', time() );
489
+ $this->update_post_history( $post_id, sprintf( esc_html__( 'Akismet was unable to check this post (response: %s), will automatically retry again later.', 'bbpress' ), $this->last_post['bbp_akismet_result'] ), 'check-error' );
490
  }
491
 
492
  // Record the complete original data as submitted for checking
665
  $http_request .= $request;
666
 
667
  // Open a socket connection
668
+ if ( false !== ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
669
 
670
  // Write our request to the pointer
671
  fwrite( $fs, $http_request );
719
 
720
  return implode( ',', $roles );
721
  }
722
+
723
+ /** Admin *****************************************************************/
724
+
725
+ /**
726
+ * Add Aksimet History metaboxes to topics and replies
727
+ *
728
+ * @since bbPress (r5049)
729
+ */
730
+ public function add_metaboxes() {
731
+
732
+ // Topics
733
+ add_meta_box(
734
+ 'bbp_akismet_topic_history',
735
+ __( 'Akismet History', 'bbpress' ),
736
+ array( $this, 'history_metabox' ),
737
+ bbp_get_topic_post_type(),
738
+ 'normal',
739
+ 'core'
740
+ );
741
+
742
+ // Replies
743
+ add_meta_box(
744
+ 'bbp_akismet_reply_history',
745
+ __( 'Akismet History', 'bbpress' ),
746
+ array( $this, 'history_metabox' ),
747
+ bbp_get_reply_post_type(),
748
+ 'normal',
749
+ 'core'
750
+ );
751
+ }
752
+
753
+ /**
754
+ * Output for Akismet History metabox
755
+ *
756
+ * @since bbPress (r5049)
757
+ *
758
+ * @uses get_post_history() To get the Akismet history for the post
759
+ * @uses get_the_ID() To get the post ID
760
+ * @uses bbp_time_since() To get the human readable time
761
+ */
762
+ public function history_metabox() {
763
+
764
+ // Post ID
765
+ $history = $this->get_post_history( get_the_ID() ); ?>
766
+
767
+ <div class="akismet-history" style="margin: 13px 0;">
768
+
769
+ <?php if ( !empty( $history ) ) : ?>
770
+
771
+ <table>
772
+ <tbody>
773
+
774
+ <?php foreach ( $history as $row ) : ?>
775
+
776
+ <tr>
777
+ <td style="color: #999; text-align: right; white-space: nowrap;">
778
+ <span title="<?php echo esc_attr( date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT' ); ?>">
779
+ <?php bbp_time_since( $row['time'], false, true ); ?>
780
+ </span>
781
+ </td>
782
+ <td style="padding-left: 5px;">
783
+ <?php echo esc_html( $row['message'] ); ?>
784
+ </td>
785
+ </tr>
786
+
787
+ <?php endforeach; ?>
788
+ </tbody>
789
+ </table>
790
+
791
+ <?php else : ?>
792
+
793
+ <p><?php esc_html_e( 'No recorded history. Akismet has not checked this post.', 'bbpress' ); ?></p>
794
+
795
+ <?php endif; ?>
796
+
797
+ </div>
798
+
799
+ <?php
800
+ }
801
  }
802
  endif;
includes/extend/buddypress/activity.php CHANGED
@@ -192,8 +192,8 @@ class BBP_BuddyPress_Activity {
192
  public function register_activity_actions() {
193
 
194
  // Sitewide activity stream items
195
- bp_activity_set_action( $this->component, $this->topic_create, __( 'New forum topic', 'bbpress' ) );
196
- bp_activity_set_action( $this->component, $this->reply_create, __( 'New forum reply', 'bbpress' ) );
197
  }
198
 
199
  /**
@@ -351,8 +351,8 @@ class BBP_BuddyPress_Activity {
351
  function activity_filter_options() {
352
  ?>
353
 
354
- <option value="<?php echo $this->topic_create; ?>"><?php _e( 'Topics', 'bbpress' ); ?></option>
355
- <option value="<?php echo $this->reply_create; ?>"><?php _e( 'Replies', 'bbpress' ); ?></option>
356
 
357
  <?php
358
  }
@@ -409,15 +409,15 @@ class BBP_BuddyPress_Activity {
409
  $topic_permalink = bbp_get_topic_permalink( $topic_id );
410
  $topic_title = get_post_field( 'post_title', $topic_id, 'raw' );
411
  $topic_content = get_post_field( 'post_content', $topic_id, 'raw' );
412
- $topic_link = '<a href="' . $topic_permalink . '" title="' . $topic_title . '">' . $topic_title . '</a>';
413
 
414
  // Forum
415
  $forum_permalink = bbp_get_forum_permalink( $forum_id );
416
  $forum_title = get_post_field( 'post_title', $forum_id, 'raw' );
417
- $forum_link = '<a href="' . $forum_permalink . '" title="' . $forum_title . '">' . $forum_title . '</a>';
418
 
419
  // Activity action & text
420
- $activity_text = sprintf( __( '%1$s started the topic %2$s in the forum %3$s', 'bbpress' ), $user_link, $topic_link, $forum_link );
421
  $activity_action = apply_filters( 'bbp_activity_topic_create', $activity_text, $user_id, $topic_id, $forum_id );
422
  $activity_content = apply_filters( 'bbp_activity_topic_create_excerpt', $topic_content );
423
 
@@ -554,15 +554,15 @@ class BBP_BuddyPress_Activity {
554
  // Topic
555
  $topic_permalink = bbp_get_topic_permalink( $topic_id );
556
  $topic_title = get_post_field( 'post_title', $topic_id, 'raw' );
557
- $topic_link = '<a href="' . $topic_permalink . '" title="' . $topic_title . '">' . $topic_title . '</a>';
558
 
559
  // Forum
560
  $forum_permalink = bbp_get_forum_permalink( $forum_id );
561
  $forum_title = get_post_field( 'post_title', $forum_id, 'raw' );
562
- $forum_link = '<a href="' . $forum_permalink . '" title="' . $forum_title . '">' . $forum_title . '</a>';
563
 
564
  // Activity action & text
565
- $activity_text = sprintf( __( '%1$s replied to the topic %2$s in the forum %3$s', 'bbpress' ), $user_link, $topic_link, $forum_link );
566
  $activity_action = apply_filters( 'bbp_activity_reply_create', $activity_text, $user_id, $reply_id, $topic_id );
567
  $activity_content = apply_filters( 'bbp_activity_reply_create_excerpt', $reply_content );
568
 
@@ -631,7 +631,7 @@ class BBP_BuddyPress_Activity {
631
  return;
632
 
633
  // Action based on new status
634
- if ( $post->post_status == bbp_get_public_status_id() ) {
635
 
636
  // Validate reply data
637
  $topic_id = bbp_get_reply_topic_id( $reply_id );
192
  public function register_activity_actions() {
193
 
194
  // Sitewide activity stream items
195
+ bp_activity_set_action( $this->component, $this->topic_create, esc_html__( 'New forum topic', 'bbpress' ) );
196
+ bp_activity_set_action( $this->component, $this->reply_create, esc_html__( 'New forum reply', 'bbpress' ) );
197
  }
198
 
199
  /**
351
  function activity_filter_options() {
352
  ?>
353
 
354
+ <option value="<?php echo $this->topic_create; ?>"><?php esc_html_e( 'Topics', 'bbpress' ); ?></option>
355
+ <option value="<?php echo $this->reply_create; ?>"><?php esc_html_e( 'Replies', 'bbpress' ); ?></option>
356
 
357
  <?php
358
  }
409
  $topic_permalink = bbp_get_topic_permalink( $topic_id );
410
  $topic_title = get_post_field( 'post_title', $topic_id, 'raw' );
411
  $topic_content = get_post_field( 'post_content', $topic_id, 'raw' );
412
+ $topic_link = '<a href="' . $topic_permalink . '">' . $topic_title . '</a>';
413
 
414
  // Forum
415
  $forum_permalink = bbp_get_forum_permalink( $forum_id );
416
  $forum_title = get_post_field( 'post_title', $forum_id, 'raw' );
417
+ $forum_link = '<a href="' . $forum_permalink . '">' . $forum_title . '</a>';
418
 
419
  // Activity action & text
420
+ $activity_text = sprintf( esc_html__( '%1$s started the topic %2$s in the forum %3$s', 'bbpress' ), $user_link, $topic_link, $forum_link );
421
  $activity_action = apply_filters( 'bbp_activity_topic_create', $activity_text, $user_id, $topic_id, $forum_id );
422
  $activity_content = apply_filters( 'bbp_activity_topic_create_excerpt', $topic_content );
423
 
554
  // Topic
555
  $topic_permalink = bbp_get_topic_permalink( $topic_id );
556
  $topic_title = get_post_field( 'post_title', $topic_id, 'raw' );
557
+ $topic_link = '<a href="' . $topic_permalink . '">' . $topic_title . '</a>';
558
 
559
  // Forum
560
  $forum_permalink = bbp_get_forum_permalink( $forum_id );
561
  $forum_title = get_post_field( 'post_title', $forum_id, 'raw' );
562
+ $forum_link = '<a href="' . $forum_permalink . '">' . $forum_title . '</a>';
563
 
564
  // Activity action & text
565
+ $activity_text = sprintf( esc_html__( '%1$s replied to the topic %2$s in the forum %3$s', 'bbpress' ), $user_link, $topic_link, $forum_link );
566
  $activity_action = apply_filters( 'bbp_activity_reply_create', $activity_text, $user_id, $reply_id, $topic_id );
567
  $activity_content = apply_filters( 'bbp_activity_reply_create_excerpt', $reply_content );
568
 
631
  return;
632
 
633
  // Action based on new status
634
+ if ( bbp_get_public_status_id() === $post->post_status ) {
635
 
636
  // Validate reply data
637
  $topic_id = bbp_get_reply_topic_id( $reply_id );
includes/extend/buddypress/functions.php CHANGED
@@ -38,11 +38,11 @@ function bbp_filter_user_id( $user_id = 0, $displayed_user_fallback = true, $cur
38
  $bbp_user_id = $user_id;
39
 
40
  // Currently viewing or editing a user
41
- elseif ( ( true == $displayed_user_fallback ) && !empty( $did ) )
42
  $bbp_user_id = $did;
43
 
44
  // Maybe fallback on the current_user ID
45
- elseif ( ( true == $current_user_fallback ) && !empty( $lid ) )
46
  $bbp_user_id = $lid;
47
 
48
  return $bbp_user_id;
@@ -431,7 +431,7 @@ function bbp_remove_group_id_from_all_forums( $group_id = 0 ) {
431
  $forum_ids = bbp_get_group_forum_ids( $group_id );
432
 
433
  // Loop through forums and remove this group from each one
434
- foreach( (array) $forum_ids as $forum_id ) {
435
  bbp_remove_group_id_from_forum( $group_id, $forum_id );
436
  }
437
  }
@@ -449,7 +449,7 @@ function bbp_remove_forum_id_from_all_groups( $forum_id = 0 ) {
449
  $group_ids = bbp_get_forum_group_ids( $forum_id );
450
 
451
  // Loop through groups and remove this forum from each one
452
- foreach( (array) $group_ids as $group_id ) {
453
  bbp_remove_forum_id_from_group( $forum_id, $group_id );
454
  }
455
  }
38
  $bbp_user_id = $user_id;
39
 
40
  // Currently viewing or editing a user
41
+ elseif ( ( true === $displayed_user_fallback ) && !empty( $did ) )
42
  $bbp_user_id = $did;
43
 
44
  // Maybe fallback on the current_user ID
45
+ elseif ( ( true === $current_user_fallback ) && !empty( $lid ) )
46
  $bbp_user_id = $lid;
47
 
48
  return $bbp_user_id;
431
  $forum_ids = bbp_get_group_forum_ids( $group_id );
432
 
433
  // Loop through forums and remove this group from each one
434
+ foreach ( (array) $forum_ids as $forum_id ) {
435
  bbp_remove_group_id_from_forum( $group_id, $forum_id );
436
  }
437
  }
449
  $group_ids = bbp_get_forum_group_ids( $forum_id );
450
 
451
  // Loop through groups and remove this forum from each one
452
+ foreach ( (array) $group_ids as $group_id ) {
453
  bbp_remove_forum_id_from_group( $forum_id, $group_id );
454
  }
455
  }
includes/extend/buddypress/{group.php → groups.php} RENAMED
@@ -95,6 +95,9 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
95
 
96
  // Saves the bbPress options if they come from the BuddyPress Group Admin UI
97
  add_action( 'bp_group_admin_edit_after', array( $this, 'edit_screen_save' ) );
 
 
 
98
  }
99
 
100
  /**
@@ -265,23 +268,23 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
265
  // Should box be checked already?
266
  $checked = is_admin() ? bp_group_is_forum_enabled( $group ) : bp_get_new_group_enable_forum() || bp_group_is_forum_enabled( bp_get_group_id() ); ?>
267
 
268
- <h4><?php _e( 'Group Forum Settings', 'bbpress' ); ?></h4>
269
 
270
  <fieldset>
271
- <legend class="screen-reader-text"><?php _e( 'Group Forum Settings', 'bbpress' ); ?></legend>
272
- <p><?php _e( 'Create a discussion forum to allow members of this group to communicate in a structured, bulletin-board style fashion.', 'bbpress' ); ?></p>
273
 
274
  <div class="field-group">
275
  <div class="checkbox">
276
- <label><input type="checkbox" name="bbp-edit-group-forum" id="bbp-edit-group-forum" value="1"<?php checked( $checked ); ?> /> <?php _e( 'Yes. I want this group to have a forum.', 'bbpress' ); ?></label>
277
  </div>
278
 
279
- <p class="description"><?php _e( 'Saying no will not delete existing forum content.', 'bbpress' ); ?></p>
280
  </div>
281
 
282
  <?php if ( bbp_is_user_keymaster() ) : ?>
283
  <div class="field-group">
284
- <label for="bbp_group_forum_id"><?php _e( 'Group Forum:', 'bbpress' ); ?></label>
285
  <?php
286
  bbp_dropdown( array(
287
  'select_id' => 'bbp_group_forum_id',
@@ -289,7 +292,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
289
  'selected' => $forum_id
290
  ) );
291
  ?>
292
- <p class="description"><?php _e( 'Network administrators can reconfigure which forum belongs to this group.', 'bbpress' ); ?></p>
293
  </div>
294
  <?php endif; ?>
295
 
@@ -428,7 +431,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
428
  add_meta_box(
429
  'bbpress_group_admin_ui_meta_box',
430
  _x( 'Discussion Forum', 'group admin edit screen', 'bbpress' ),
431
- array( &$this, 'group_admin_ui_display_metabox' ),
432
  get_current_screen()->id,
433
  'side',
434
  'core'
@@ -455,26 +458,28 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
455
  *
456
  * @since bbPress (r3465)
457
  */
458
- public function create_screen() {
459
 
460
  // Bail if not looking at this screen
461
  if ( !bp_is_group_creation_step( $this->slug ) )
462
  return false;
463
 
464
- $checked = bp_get_new_group_enable_forum() || groups_get_groupmeta( bp_get_new_group_id(), 'forum_id' ); ?>
 
 
 
 
 
465
 
466
- <h4><?php _e( 'Group Forum', 'bbpress' ); ?></h4>
467
 
468
- <p><?php _e( 'Create a discussion forum to allow members of this group to communicate in a structured, bulletin-board style fashion.', 'bbpress' ); ?></p>
469
 
470
  <div class="checkbox">
471
- <label><input type="checkbox" name="bbp-create-group-forum" id="bbp-create-group-forum" value="1"<?php checked( $checked ); ?> /> <?php _e( 'Yes. I want this group to have a forum.', 'bbpress' ); ?></label>
472
  </div>
473
 
474
  <?php
475
-
476
- // Verify intent
477
- wp_nonce_field( 'groups_create_save_' . $this->slug );
478
  }
479
 
480
  /**
@@ -482,7 +487,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
482
  *
483
  * @since bbPress (r3465)
484
  */
485
- public function create_screen_save() {
486
 
487
  // Nonce check
488
  if ( ! bbp_verify_nonce_request( 'groups_create_save_' . $this->slug ) ) {
@@ -490,9 +495,14 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
490
  return;
491
  }
492
 
 
 
 
 
 
493
  $create_forum = !empty( $_POST['bbp-create-group-forum'] ) ? true : false;
494
  $forum_id = 0;
495
- $forum_ids = bbp_get_group_forum_ids( bp_get_new_group_id() );
496
 
497
  if ( !empty( $forum_ids ) )
498
  $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
@@ -680,6 +690,9 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
680
  $this->disconnect_forum_from_group( $group_id );
681
  }
682
 
 
 
 
683
  // Return the group
684
  return $group;
685
  }
@@ -711,7 +724,8 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
711
 
712
  // Forum data
713
  $forum_action = bp_action_variable( $offset );
714
- $forum_id = array_shift( bbp_get_group_forum_ids( bp_get_current_group_id() ) );
 
715
 
716
  // Always load up the group forum
717
  bbp_has_forums( array(
@@ -735,10 +749,10 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
735
  case 'page' :
736
 
737
  // Strip the super stickies from topic query
738
- add_filter( 'bbp_get_super_stickies', array( $this, 'no_super_stickies' ), 10, 1 );
739
 
740
  // Unset the super sticky option on topic form
741
- add_filter( 'bbp_after_topic_type_select_parse_args', array( $this, 'unset_super_sticky' ), 10, 1 );
742
 
743
  // Query forums and show them if they exist
744
  if ( bbp_forums() ) :
@@ -754,7 +768,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
754
  else : ?>
755
 
756
  <div id="message" class="info">
757
- <p><?php _e( 'This group does not currently have a forum.', 'bbpress' ); ?></p>
758
  </div>
759
 
760
  <?php endif;
@@ -791,10 +805,10 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
791
  <?php
792
 
793
  // Topic edit
794
- if ( bp_action_variable( $offset + 2 ) == bbp_get_edit_rewrite_id() ) :
795
 
796
  // Unset the super sticky link on edit topic template
797
- add_filter( 'bbp_after_topic_type_select_parse_args', array( $this, 'unset_super_sticky' ), 10, 1 );
798
 
799
  // Set the edit switches
800
  $wp_query->bbp_is_edit = true;
@@ -804,12 +818,12 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
804
  $bbp->current_topic_id = get_the_ID();
805
 
806
  // Merge
807
- if ( !empty( $_GET['action'] ) && 'merge' == $_GET['action'] ) :
808
  bbp_set_query_name( 'bbp_topic_merge' );
809
  bbp_get_template_part( 'form', 'topic-merge' );
810
 
811
  // Split
812
- elseif ( !empty( $_GET['action'] ) && 'split' == $_GET['action'] ) :
813
  bbp_set_query_name( 'bbp_topic_split' );
814
  bbp_get_template_part( 'form', 'topic-split' );
815
 
@@ -850,7 +864,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
850
 
851
  <h3><?php bbp_reply_title(); ?></h3>
852
 
853
- <?php if ( bp_action_variable( $offset + 2 ) == bbp_get_edit_rewrite_id() ) :
854
 
855
  // Set the edit switches
856
  $wp_query->bbp_is_edit = true;
@@ -860,7 +874,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
860
  $bbp->current_reply_id = get_the_ID();
861
 
862
  // Move
863
- if ( !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) ) :
864
  bbp_set_query_name( 'bbp_reply_move' );
865
  bbp_get_template_part( 'form', 'reply-move' );
866
 
@@ -908,7 +922,9 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
908
  * @return array $args without the to-front link
909
  */
910
  public function unset_super_sticky( $args = array() ) {
911
- $args['super_text'] = '';
 
 
912
  return $args;
913
  }
914
 
@@ -1019,7 +1035,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
1019
  $forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() ); ?>
1020
 
1021
  <p>
1022
- <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
1023
  <?php bbp_dropdown( array( 'include' => $forum_ids, 'selected' => bbp_get_form_topic_forum() ) ); ?>
1024
  </p>
1025
 
@@ -1067,6 +1083,29 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
1067
  return $retval;
1068
  }
1069
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1070
  /** Permalink Mappers *****************************************************/
1071
 
1072
  /**
@@ -1350,6 +1389,9 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
1350
  // Set the item ID to the group ID so the activity item shows up in the group
1351
  $args['item_id'] = $group->id;
1352
 
 
 
 
1353
  return $args;
1354
  }
1355
  }
95
 
96
  // Saves the bbPress options if they come from the BuddyPress Group Admin UI
97
  add_action( 'bp_group_admin_edit_after', array( $this, 'edit_screen_save' ) );
98
+
99
+ // Adds a hidden input value to the "Group Settings" page
100
+ add_action( 'bp_before_group_settings_admin', array( $this, 'group_settings_hidden_field' ) );
101
  }
102
 
103
  /**
268
  // Should box be checked already?
269
  $checked = is_admin() ? bp_group_is_forum_enabled( $group ) : bp_get_new_group_enable_forum() || bp_group_is_forum_enabled( bp_get_group_id() ); ?>
270
 
271
+ <h4><?php esc_html_e( 'Group Forum Settings', 'bbpress' ); ?></h4>
272
 
273
  <fieldset>
274
+ <legend class="screen-reader-text"><?php esc_html_e( 'Group Forum Settings', 'bbpress' ); ?></legend>
275
+ <p><?php esc_html_e( 'Create a discussion forum to allow members of this group to communicate in a structured, bulletin-board style fashion.', 'bbpress' ); ?></p>
276
 
277
  <div class="field-group">
278
  <div class="checkbox">
279
+ <label><input type="checkbox" name="bbp-edit-group-forum" id="bbp-edit-group-forum" value="1"<?php checked( $checked ); ?> /> <?php esc_html_e( 'Yes. I want this group to have a forum.', 'bbpress' ); ?></label>
280
  </div>
281
 
282
+ <p class="description"><?php esc_html_e( 'Saying no will not delete existing forum content.', 'bbpress' ); ?></p>
283
  </div>
284
 
285
  <?php if ( bbp_is_user_keymaster() ) : ?>
286
  <div class="field-group">
287
+ <label for="bbp_group_forum_id"><?php esc_html_e( 'Group Forum:', 'bbpress' ); ?></label>
288
  <?php
289
  bbp_dropdown( array(
290
  'select_id' => 'bbp_group_forum_id',
292
  'selected' => $forum_id
293
  ) );
294
  ?>
295
+ <p class="description"><?php esc_html_e( 'Network administrators can reconfigure which forum belongs to this group.', 'bbpress' ); ?></p>
296
  </div>
297
  <?php endif; ?>
298
 
431
  add_meta_box(
432
  'bbpress_group_admin_ui_meta_box',
433
  _x( 'Discussion Forum', 'group admin edit screen', 'bbpress' ),
434
+ array( $this, 'group_admin_ui_display_metabox' ),
435
  get_current_screen()->id,
436
  'side',
437
  'core'
458
  *
459
  * @since bbPress (r3465)
460
  */
461
+ public function create_screen( $group_id = 0 ) {
462
 
463
  // Bail if not looking at this screen
464
  if ( !bp_is_group_creation_step( $this->slug ) )
465
  return false;
466
 
467
+ // Check for possibly empty group_id
468
+ if ( empty( $group_id ) ) {
469
+ $group_id = bp_get_new_group_id();
470
+ }
471
+
472
+ $checked = bp_get_new_group_enable_forum() || groups_get_groupmeta( $group_id, 'forum_id' ); ?>
473
 
474
+ <h4><?php esc_html_e( 'Group Forum', 'bbpress' ); ?></h4>
475
 
476
+ <p><?php esc_html_e( 'Create a discussion forum to allow members of this group to communicate in a structured, bulletin-board style fashion.', 'bbpress' ); ?></p>
477
 
478
  <div class="checkbox">
479
+ <label><input type="checkbox" name="bbp-create-group-forum" id="bbp-create-group-forum" value="1"<?php checked( $checked ); ?> /> <?php esc_html_e( 'Yes. I want this group to have a forum.', 'bbpress' ); ?></label>
480
  </div>
481
 
482
  <?php
 
 
 
483
  }
484
 
485
  /**
487
  *
488
  * @since bbPress (r3465)
489
  */
490
+ public function create_screen_save( $group_id = 0 ) {
491
 
492
  // Nonce check
493
  if ( ! bbp_verify_nonce_request( 'groups_create_save_' . $this->slug ) ) {
495
  return;
496
  }
497
 
498
+ // Check for possibly empty group_id
499
+ if ( empty( $group_id ) ) {
500
+ $group_id = bp_get_new_group_id();
501
+ }
502
+
503
  $create_forum = !empty( $_POST['bbp-create-group-forum'] ) ? true : false;
504
  $forum_id = 0;
505
+ $forum_ids = bbp_get_group_forum_ids( $group_id );
506
 
507
  if ( !empty( $forum_ids ) )
508
  $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
690
  $this->disconnect_forum_from_group( $group_id );
691
  }
692
 
693
+ // Update bbPress' internal private and forum ID variables
694
+ bbp_repair_forum_visibility();
695
+
696
  // Return the group
697
  return $group;
698
  }
724
 
725
  // Forum data
726
  $forum_action = bp_action_variable( $offset );
727
+ $forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() );
728
+ $forum_id = array_shift( $forum_ids );
729
 
730
  // Always load up the group forum
731
  bbp_has_forums( array(
749
  case 'page' :
750
 
751
  // Strip the super stickies from topic query
752
+ add_filter( 'bbp_get_super_stickies', array( $this, 'no_super_stickies' ), 10, 1 );
753
 
754
  // Unset the super sticky option on topic form
755
+ add_filter( 'bbp_get_topic_types', array( $this, 'unset_super_sticky' ), 10, 1 );
756
 
757
  // Query forums and show them if they exist
758
  if ( bbp_forums() ) :
768
  else : ?>
769
 
770
  <div id="message" class="info">
771
+ <p><?php esc_html_e( 'This group does not currently have a forum.', 'bbpress' ); ?></p>
772
  </div>
773
 
774
  <?php endif;
805
  <?php
806
 
807
  // Topic edit
808
+ if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
809
 
810
  // Unset the super sticky link on edit topic template
811
+ add_filter( 'bbp_get_topic_types', array( $this, 'unset_super_sticky' ), 10, 1 );
812
 
813
  // Set the edit switches
814
  $wp_query->bbp_is_edit = true;
818
  $bbp->current_topic_id = get_the_ID();
819
 
820
  // Merge
821
+ if ( !empty( $_GET['action'] ) && 'merge' === $_GET['action'] ) :
822
  bbp_set_query_name( 'bbp_topic_merge' );
823
  bbp_get_template_part( 'form', 'topic-merge' );
824
 
825
  // Split
826
+ elseif ( !empty( $_GET['action'] ) && 'split' === $_GET['action'] ) :
827
  bbp_set_query_name( 'bbp_topic_split' );
828
  bbp_get_template_part( 'form', 'topic-split' );
829
 
864
 
865
  <h3><?php bbp_reply_title(); ?></h3>
866
 
867
+ <?php if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
868
 
869
  // Set the edit switches
870
  $wp_query->bbp_is_edit = true;
874
  $bbp->current_reply_id = get_the_ID();
875
 
876
  // Move
877
+ if ( !empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) :
878
  bbp_set_query_name( 'bbp_reply_move' );
879
  bbp_get_template_part( 'form', 'reply-move' );
880
 
922
  * @return array $args without the to-front link
923
  */
924
  public function unset_super_sticky( $args = array() ) {
925
+ if ( isset( $args['super'] ) ) {
926
+ unset( $args['super'] );
927
+ }
928
  return $args;
929
  }
930
 
1035
  $forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() ); ?>
1036
 
1037
  <p>
1038
+ <label for="bbp_forum_id"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></label><br />
1039
  <?php bbp_dropdown( array( 'include' => $forum_ids, 'selected' => bbp_get_form_topic_forum() ) ); ?>
1040
  </p>
1041
 
1083
  return $retval;
1084
  }
1085
 
1086
+ /**
1087
+ * Add a hidden input field on the group settings page if the group forum is
1088
+ * enabled.
1089
+ *
1090
+ * Due to the way BuddyPress' group admin settings page saves its settings,
1091
+ * we need to let BP know that bbPress added a forum.
1092
+ *
1093
+ * @since bbPress (r5026)
1094
+ *
1095
+ * @link http://bbpress.trac.wordpress.org/ticket/2339/
1096
+ * @see groups_screen_group_admin_settings()
1097
+ */
1098
+ public function group_settings_hidden_field() {
1099
+
1100
+ // if a forum is not enabled, we don't need to add this field
1101
+ if ( ! bp_group_is_forum_enabled() )
1102
+ return; ?>
1103
+
1104
+ <input type="hidden" name="group-show-forum" id="group-show-forum" value="1" />
1105
+
1106
+ <?php
1107
+ }
1108
+
1109
  /** Permalink Mappers *****************************************************/
1110
 
1111
  /**
1389
  // Set the item ID to the group ID so the activity item shows up in the group
1390
  $args['item_id'] = $group->id;
1391
 
1392
+ // Update the group's last activity
1393
+ groups_update_last_activity( $group->id );
1394
+
1395
  return $args;
1396
  }
1397
  }
includes/extend/buddypress/loader.php CHANGED
@@ -40,7 +40,7 @@ class BBP_Forums_Component extends BP_Component {
40
  parent::start(
41
  'forums',
42
  __( 'Forums', 'bbpress' ),
43
- BP_PLUGIN_DIR
44
  );
45
  $this->includes();
46
  $this->setup_globals();
@@ -51,23 +51,25 @@ class BBP_Forums_Component extends BP_Component {
51
  /**
52
  * Include BuddyPress classes and functions
53
  */
54
- public function includes() {
55
 
56
  // Helper BuddyPress functions
57
- require( bbpress()->includes_dir . 'extend/buddypress/functions.php' );
58
 
59
  // Members modifications
60
- require( bbpress()->includes_dir . 'extend/buddypress/members.php' );
61
 
62
  // BuddyPress Activity Extension class
63
  if ( bp_is_active( 'activity' ) ) {
64
- require( bbpress()->includes_dir . 'extend/buddypress/activity.php' );
65
  }
66
 
67
  // BuddyPress Group Extension class
68
  if ( bbp_is_group_forums_active() && bp_is_active( 'groups' ) ) {
69
- require( bbpress()->includes_dir . 'extend/buddypress/group.php' );
70
  }
 
 
71
  }
72
 
73
  /**
@@ -78,7 +80,7 @@ class BBP_Forums_Component extends BP_Component {
78
  *
79
  * @since bbPress (r3552)
80
  */
81
- public function setup_globals() {
82
  $bp = buddypress();
83
 
84
  // Define the parent forum ID
@@ -89,17 +91,16 @@ class BBP_Forums_Component extends BP_Component {
89
  if ( !defined( 'BP_FORUMS_SLUG' ) )
90
  define( 'BP_FORUMS_SLUG', $this->id );
91
 
92
- // All globals for messaging component.
93
- $globals = array(
94
- 'path' => BP_PLUGIN_DIR,
95
- 'slug' => BP_FORUMS_SLUG,
96
- 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG,
97
- 'has_directory' => false,
98
- 'notification_callback' => 'messages_format_notifications',
99
- 'search_string' => __( 'Search Forums...', 'bbpress' ),
100
  );
101
 
102
- parent::setup_globals( $globals );
103
  }
104
 
105
  /**
@@ -155,14 +156,13 @@ class BBP_Forums_Component extends BP_Component {
155
  *
156
  * @since bbPress (r3552)
157
  */
158
- public function setup_nav() {
159
 
160
  // Stop if there is no user displayed or logged in
161
  if ( !is_user_logged_in() && !bp_displayed_user_id() )
162
  return;
163
 
164
  // Define local variable(s)
165
- $sub_nav = array();
166
  $user_domain = '';
167
 
168
  // Add 'Forums' to the main navigation
@@ -171,7 +171,7 @@ class BBP_Forums_Component extends BP_Component {
171
  'slug' => $this->slug,
172
  'position' => 80,
173
  'screen_function' => 'bbp_member_forums_screen_topics',
174
- 'default_subnav_slug' => 'topics',
175
  'item_css_id' => $this->id
176
  );
177
 
@@ -189,7 +189,7 @@ class BBP_Forums_Component extends BP_Component {
189
  // Topics started
190
  $sub_nav[] = array(
191
  'name' => __( 'Topics Started', 'bbpress' ),
192
- 'slug' => 'topics',
193
  'parent_url' => $forums_link,
194
  'parent_slug' => $this->slug,
195
  'screen_function' => 'bbp_member_forums_screen_topics',
@@ -200,7 +200,7 @@ class BBP_Forums_Component extends BP_Component {
200
  // Replies to topics
201
  $sub_nav[] = array(
202
  'name' => __( 'Replies Created', 'bbpress' ),
203
- 'slug' => 'replies',
204
  'parent_url' => $forums_link,
205
  'parent_slug' => $this->slug,
206
  'screen_function' => 'bbp_member_forums_screen_replies',
@@ -211,7 +211,7 @@ class BBP_Forums_Component extends BP_Component {
211
  // Favorite topics
212
  $sub_nav[] = array(
213
  'name' => __( 'Favorites', 'bbpress' ),
214
- 'slug' => 'favorites',
215
  'parent_url' => $forums_link,
216
  'parent_slug' => $this->slug,
217
  'screen_function' => 'bbp_member_forums_screen_favorites',
@@ -223,7 +223,7 @@ class BBP_Forums_Component extends BP_Component {
223
  if ( bp_is_my_profile() ) {
224
  $sub_nav[] = array(
225
  'name' => __( 'Subscriptions', 'bbpress' ),
226
- 'slug' => 'subscriptions',
227
  'parent_url' => $forums_link,
228
  'parent_slug' => $this->slug,
229
  'screen_function' => 'bbp_member_forums_screen_subscriptions',
@@ -240,10 +240,7 @@ class BBP_Forums_Component extends BP_Component {
240
  *
241
  * @since bbPress (r3552)
242
  */
243
- public function setup_admin_bar() {
244
-
245
- // Prevent debug notices
246
- $wp_admin_nav = array();
247
 
248
  // Menus for logged in user
249
  if ( is_user_logged_in() ) {
@@ -265,7 +262,7 @@ class BBP_Forums_Component extends BP_Component {
265
  'parent' => 'my-account-' . $this->id,
266
  'id' => 'my-account-' . $this->id . '-topics',
267
  'title' => __( 'Topics Started', 'bbpress' ),
268
- 'href' => trailingslashit( $forums_link . 'topics' )
269
  );
270
 
271
  // Replies
@@ -273,7 +270,7 @@ class BBP_Forums_Component extends BP_Component {
273
  'parent' => 'my-account-' . $this->id,
274
  'id' => 'my-account-' . $this->id . '-replies',
275
  'title' => __( 'Replies Created', 'bbpress' ),
276
- 'href' => trailingslashit( $forums_link . 'replies' )
277
  );
278
 
279
  // Favorites
@@ -281,7 +278,7 @@ class BBP_Forums_Component extends BP_Component {
281
  'parent' => 'my-account-' . $this->id,
282
  'id' => 'my-account-' . $this->id . '-favorites',
283
  'title' => __( 'Favorite Topics', 'bbpress' ),
284
- 'href' => trailingslashit( $forums_link . 'favorites' )
285
  );
286
 
287
  // Subscriptions
@@ -289,7 +286,7 @@ class BBP_Forums_Component extends BP_Component {
289
  'parent' => 'my-account-' . $this->id,
290
  'id' => 'my-account-' . $this->id . '-subscriptions',
291
  'title' => __( 'Subscribed Topics', 'bbpress' ),
292
- 'href' => trailingslashit( $forums_link . 'subscriptions' )
293
  );
294
  }
295
 
40
  parent::start(
41
  'forums',
42
  __( 'Forums', 'bbpress' ),
43
+ bbpress()->includes_dir . 'extend/buddypress/'
44
  );
45
  $this->includes();
46
  $this->setup_globals();
51
  /**
52
  * Include BuddyPress classes and functions
53
  */
54
+ public function includes( $includes = array() ) {
55
 
56
  // Helper BuddyPress functions
57
+ $includes[] = 'functions.php';
58
 
59
  // Members modifications
60
+ $includes[] = 'members.php';
61
 
62
  // BuddyPress Activity Extension class
63
  if ( bp_is_active( 'activity' ) ) {
64
+ $includes[] = 'activity.php';
65
  }
66
 
67
  // BuddyPress Group Extension class
68
  if ( bbp_is_group_forums_active() && bp_is_active( 'groups' ) ) {
69
+ $includes[] = 'groups.php';
70
  }
71
+
72
+ parent::includes( $includes );
73
  }
74
 
75
  /**
80
  *
81
  * @since bbPress (r3552)
82
  */
83
+ public function setup_globals( $args = array() ) {
84
  $bp = buddypress();
85
 
86
  // Define the parent forum ID
91
  if ( !defined( 'BP_FORUMS_SLUG' ) )
92
  define( 'BP_FORUMS_SLUG', $this->id );
93
 
94
+ // All arguments for forums component
95
+ $args = array(
96
+ 'path' => BP_PLUGIN_DIR,
97
+ 'slug' => BP_FORUMS_SLUG,
98
+ 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG,
99
+ 'has_directory' => false,
100
+ 'search_string' => __( 'Search Forums...', 'bbpress' ),
 
101
  );
102
 
103
+ parent::setup_globals( $args );
104
  }
105
 
106
  /**
156
  *
157
  * @since bbPress (r3552)
158
  */
159
+ public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
160
 
161
  // Stop if there is no user displayed or logged in
162
  if ( !is_user_logged_in() && !bp_displayed_user_id() )
163
  return;
164
 
165
  // Define local variable(s)
 
166
  $user_domain = '';
167
 
168
  // Add 'Forums' to the main navigation
171
  'slug' => $this->slug,
172
  'position' => 80,
173
  'screen_function' => 'bbp_member_forums_screen_topics',
174
+ 'default_subnav_slug' => bbp_get_topic_archive_slug(),
175
  'item_css_id' => $this->id
176
  );
177
 
189
  // Topics started
190
  $sub_nav[] = array(
191
  'name' => __( 'Topics Started', 'bbpress' ),
192
+ 'slug' => bbp_get_topic_archive_slug(),
193
  'parent_url' => $forums_link,
194
  'parent_slug' => $this->slug,
195
  'screen_function' => 'bbp_member_forums_screen_topics',
200
  // Replies to topics
201
  $sub_nav[] = array(
202
  'name' => __( 'Replies Created', 'bbpress' ),
203
+ 'slug' => bbp_get_reply_archive_slug(),
204
  'parent_url' => $forums_link,
205
  'parent_slug' => $this->slug,
206
  'screen_function' => 'bbp_member_forums_screen_replies',
211
  // Favorite topics
212
  $sub_nav[] = array(
213
  'name' => __( 'Favorites', 'bbpress' ),
214
+ 'slug' => bbp_get_user_favorites_slug(),
215
  'parent_url' => $forums_link,
216
  'parent_slug' => $this->slug,
217
  'screen_function' => 'bbp_member_forums_screen_favorites',
223
  if ( bp_is_my_profile() ) {
224
  $sub_nav[] = array(
225
  'name' => __( 'Subscriptions', 'bbpress' ),
226
+ 'slug' => bbp_get_user_subscriptions_slug(),
227
  'parent_url' => $forums_link,
228
  'parent_slug' => $this->slug,
229
  'screen_function' => 'bbp_member_forums_screen_subscriptions',
240
  *
241
  * @since bbPress (r3552)
242
  */
243
+ public function setup_admin_bar( $wp_admin_nav = array() ) {
 
 
 
244
 
245
  // Menus for logged in user
246
  if ( is_user_logged_in() ) {
262
  'parent' => 'my-account-' . $this->id,
263
  'id' => 'my-account-' . $this->id . '-topics',
264
  'title' => __( 'Topics Started', 'bbpress' ),
265
+ 'href' => trailingslashit( $forums_link . bbp_get_topic_archive_slug() )
266
  );
267
 
268
  // Replies
270
  'parent' => 'my-account-' . $this->id,
271
  'id' => 'my-account-' . $this->id . '-replies',
272
  'title' => __( 'Replies Created', 'bbpress' ),
273
+ 'href' => trailingslashit( $forums_link . bbp_get_reply_archive_slug() )
274
  );
275
 
276
  // Favorites
278
  'parent' => 'my-account-' . $this->id,
279
  'id' => 'my-account-' . $this->id . '-favorites',
280
  'title' => __( 'Favorite Topics', 'bbpress' ),
281
+ 'href' => trailingslashit( $forums_link . bbp_get_user_favorites_slug() )
282
  );
283
 
284
  // Subscriptions
286
  'parent' => 'my-account-' . $this->id,
287
  'id' => 'my-account-' . $this->id . '-subscriptions',
288
  'title' => __( 'Subscribed Topics', 'bbpress' ),
289
+ 'href' => trailingslashit( $forums_link . bbp_get_user_subscriptions_slug() )
290
  );
291
  }
292
 
includes/extend/buddypress/members.php CHANGED
@@ -87,25 +87,26 @@ class BBP_BuddyPress_Members {
87
  public function user_profile_url( $user_id ) {
88
 
89
  // Define local variable(s)
90
- $profile_url = '';
 
91
 
92
  // Special handling for forum component
93
- if ( bp_is_current_component( 'forums' ) ) {
94
 
95
  // Empty action or 'topics' action
96
- if ( !bp_current_action() || bp_is_current_action( 'topics' ) ) {
97
- $profile_url = bp_core_get_user_domain( $user_id ) . 'forums/topics';
98
 
99
  // Empty action or 'topics' action
100
- } elseif ( bp_is_current_action( 'replies' ) ) {
101
- $profile_url = bp_core_get_user_domain( $user_id ) . 'forums/replies';
102
 
103
  // 'favorites' action
104
- } elseif ( bbp_is_favorites_active() && bp_is_current_action( 'favorites' ) ) {
105
  $profile_url = $this->get_favorites_permalink( '', $user_id );
106
 
107
  // 'subscriptions' action
108
- } elseif ( bbp_is_subscriptions_active() && bp_is_current_action( 'subscriptions' ) ) {
109
  $profile_url = $this->get_subscriptions_permalink( '', $user_id );
110
  }
111
 
@@ -126,7 +127,8 @@ class BBP_BuddyPress_Members {
126
  * @return string
127
  */
128
  public function get_favorites_permalink( $url, $user_id ) {
129
- $url = trailingslashit( bp_core_get_user_domain( $user_id ) . 'forums/favorites' );
 
130
  return $url;
131
  }
132
 
@@ -139,7 +141,8 @@ class BBP_BuddyPress_Members {
139
  * @return string
140
  */
141
  public function get_subscriptions_permalink( $url, $user_id ) {
142
- $url = trailingslashit( bp_core_get_user_domain( $user_id ) . 'forums/subscriptions' );
 
143
  return $url;
144
  }
145
 
@@ -161,11 +164,11 @@ class BBP_BuddyPress_Members {
161
  global $wp_query;
162
 
163
  // 'favorites' action
164
- if ( bbp_is_favorites_active() && bp_is_current_action( 'favorites' ) ) {
165
  $wp_query->bbp_is_single_user_favs = true;
166
 
167
  // 'subscriptions' action
168
- } elseif ( bbp_is_subscriptions_active() && bp_is_current_action( 'subscriptions' ) ) {
169
  $wp_query->bbp_is_single_user_subs = true;
170
  }
171
  }
87
  public function user_profile_url( $user_id ) {
88
 
89
  // Define local variable(s)
90
+ $profile_url = '';
91
+ $component_slug = bbpress()->extend->buddypress->slug;
92
 
93
  // Special handling for forum component
94
+ if ( bp_is_current_component( $component_slug ) ) {
95
 
96
  // Empty action or 'topics' action
97
+ if ( !bp_current_action() || bp_is_current_action( bbp_get_topic_archive_slug() ) ) {
98
+ $profile_url = bp_core_get_user_domain( $user_id ) . $component_slug . '/' . bbp_get_topic_archive_slug();
99
 
100
  // Empty action or 'topics' action
101
+ } elseif ( bp_is_current_action( bbp_get_reply_archive_slug() ) ) {
102
+ $profile_url = bp_core_get_user_domain( $user_id ) . $component_slug . '/' . bbp_get_reply_archive_slug();
103
 
104
  // 'favorites' action
105
+ } elseif ( bbp_is_favorites_active() && bp_is_current_action( bbp_get_user_favorites_slug() ) ) {
106
  $profile_url = $this->get_favorites_permalink( '', $user_id );
107
 
108
  // 'subscriptions' action
109
+ } elseif ( bbp_is_subscriptions_active() && bp_is_current_action( bbp_get_user_subscriptions_slug() ) ) {
110
  $profile_url = $this->get_subscriptions_permalink( '', $user_id );
111
  }
112
 
127
  * @return string
128
  */
129
  public function get_favorites_permalink( $url, $user_id ) {
130
+ $component_slug = bbpress()->extend->buddypress->slug;
131
+ $url = trailingslashit( bp_core_get_user_domain( $user_id ) . $component_slug . '/' . bbp_get_user_favorites_slug() );
132
  return $url;
133
  }
134
 
141
  * @return string
142
  */
143
  public function get_subscriptions_permalink( $url, $user_id ) {
144
+ $component_slug = bbpress()->extend->buddypress->slug;
145
+ $url = trailingslashit( bp_core_get_user_domain( $user_id ) . $component_slug . '/' . bbp_get_user_subscriptions_slug() );
146
  return $url;
147
  }
148
 
164
  global $wp_query;
165
 
166
  // 'favorites' action
167
+ if ( bbp_is_favorites_active() && bp_is_current_action( bbp_get_user_favorites_slug() ) ) {
168
  $wp_query->bbp_is_single_user_favs = true;
169
 
170
  // 'subscriptions' action
171
+ } elseif ( bbp_is_subscriptions_active() && bp_is_current_action( bbp_get_user_subscriptions_slug() ) ) {
172
  $wp_query->bbp_is_single_user_subs = true;
173
  }
174
  }
includes/forums/capabilities.php CHANGED
@@ -77,11 +77,11 @@ function bbp_map_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
77
  $post_type = get_post_type_object( $_post->post_type );
78
 
79
  // Post is public
80
- if ( bbp_get_public_status_id() == $_post->post_status ) {
81
  $caps = array( 'spectate' );
82
 
83
  // User is author so allow read
84
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
85
  $caps = array( 'spectate' );
86
 
87
  // Unknown so map to private posts
@@ -136,8 +136,8 @@ function bbp_map_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
136
  if ( bbp_is_user_inactive( $user_id ) ) {
137
  $caps[] = 'do_not_allow';
138
 
139
- // User is author so allow edit
140
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
141
  $caps[] = $post_type->cap->edit_posts;
142
 
143
  // Unknown, so map to edit_others_posts
@@ -166,7 +166,7 @@ function bbp_map_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
166
  $caps[] = 'do_not_allow';
167
 
168
  // User is author so allow to delete
169
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
170
  $caps[] = $post_type->cap->delete_posts;
171
 
172
  // Unknown so map to delete_others_posts
77
  $post_type = get_post_type_object( $_post->post_type );
78
 
79
  // Post is public
80
+ if ( bbp_get_public_status_id() === $_post->post_status ) {
81
  $caps = array( 'spectate' );
82
 
83
  // User is author so allow read
84
+ } elseif ( (int) $user_id === (int) $_post->post_author ) {
85
  $caps = array( 'spectate' );
86
 
87
  // Unknown so map to private posts
136
  if ( bbp_is_user_inactive( $user_id ) ) {
137
  $caps[] = 'do_not_allow';
138
 
139
+ // User is author so allow edit if not in admin
140
+ } elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
141
  $caps[] = $post_type->cap->edit_posts;
142
 
143
  // Unknown, so map to edit_others_posts
166
  $caps[] = 'do_not_allow';
167
 
168
  // User is author so allow to delete
169
+ } elseif ( (int) $user_id === (int) $_post->post_author ) {
170
  $caps[] = $post_type->cap->delete_posts;
171
 
172
  // Unknown so map to delete_others_posts
includes/forums/functions.php CHANGED
@@ -29,7 +29,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
29
  function bbp_insert_forum( $forum_data = array(), $forum_meta = array() ) {
30
 
31
  // Forum
32
- $default_forum = array(
33
  'post_parent' => 0, // forum ID
34
  'post_status' => bbp_get_public_status_id(),
35
  'post_type' => bbp_get_forum_post_type(),
@@ -39,18 +39,18 @@ function bbp_insert_forum( $forum_data = array(), $forum_meta = array() ) {
39
  'post_title' => '',
40
  'menu_order' => 0,
41
  'comment_status' => 'closed'
42
- );
43
- $forum_data = bbp_parse_args( $forum_data, $default_forum, 'insert_forum' );
44
 
45
  // Insert forum
46
  $forum_id = wp_insert_post( $forum_data );
47
 
48
  // Bail if no forum was added
49
- if ( empty( $forum_id ) )
50
  return false;
 
51
 
52
  // Forum meta
53
- $default_meta = array(
54
  'reply_count' => 0,
55
  'topic_count' => 0,
56
  'topic_count_hidden' => 0,
@@ -61,12 +61,12 @@ function bbp_insert_forum( $forum_data = array(), $forum_meta = array() ) {
61
  'last_active_id' => 0,
62
  'last_active_time' => 0,
63
  'forum_subforum_count' => 0,
64
- );
65
- $forum_meta = bbp_parse_args( $forum_meta, $default_meta, 'insert_forum_meta' );
66
 
67
  // Insert forum meta
68
- foreach ( $forum_meta as $meta_key => $meta_value )
69
  update_post_meta( $forum_id, '_bbp_' . $meta_key, $meta_value );
 
70
 
71
  // Return new forum ID
72
  return $forum_id;
@@ -136,7 +136,7 @@ function bbp_new_forum_handler( $action = '' ) {
136
  $forum_author = bbp_get_current_user_id();
137
 
138
  // Remove kses filters from title and content for capable users and if the nonce is verified
139
- if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) == $_POST['_bbp_unfiltered_html_forum'] ) {
140
  remove_filter( 'bbp_new_forum_pre_title', 'wp_filter_kses' );
141
  remove_filter( 'bbp_new_forum_pre_content', 'bbp_encode_bad', 10 );
142
  remove_filter( 'bbp_new_forum_pre_content', 'bbp_filter_kses', 30 );
@@ -257,7 +257,7 @@ function bbp_new_forum_handler( $action = '' ) {
257
 
258
  // If the forum is trash, or the forum_status is switched to
259
  // trash, trash it properly
260
- if ( ( get_post_field( 'post_status', $forum_id ) == bbp_get_trash_status_id() ) || ( $forum_data['post_status'] == bbp_get_trash_status_id() ) ) {
261
 
262
  // Trash the reply
263
  wp_trash_post( $forum_id );
@@ -269,7 +269,7 @@ function bbp_new_forum_handler( $action = '' ) {
269
  /** Spam Check ********************************************************/
270
 
271
  // If reply or forum are spam, officially spam this reply
272
- if ( $forum_data['post_status'] == bbp_get_spam_status_id() ) {
273
  add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
274
 
275
  // Force view=all
@@ -278,7 +278,7 @@ function bbp_new_forum_handler( $action = '' ) {
278
 
279
  /** Update counts, etc... *********************************************/
280
 
281
- $forum_args = array(
282
  'forum_id' => $forum_id,
283
  'post_parent' => $forum_parent_id,
284
  'forum_author' => $forum_author,
@@ -287,8 +287,7 @@ function bbp_new_forum_handler( $action = '' ) {
287
  'last_active_id' => 0,
288
  'last_active_time' => 0,
289
  'last_active_status' => bbp_get_public_status_id()
290
- );
291
- do_action( 'bbp_new_forum', $forum_args );
292
 
293
  /** Additional Actions (After Save) ***********************************/
294
 
@@ -407,7 +406,7 @@ function bbp_edit_forum_handler( $action = '' ) {
407
  }
408
 
409
  // Remove kses filters from title and content for capable users and if the nonce is verified
410
- if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) == $_POST['_bbp_unfiltered_html_forum'] ) ) {
411
  remove_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' );
412
  remove_filter( 'bbp_edit_forum_pre_content', 'bbp_encode_bad', 10 );
413
  remove_filter( 'bbp_edit_forum_pre_content', 'bbp_filter_kses', 30 );
@@ -509,7 +508,7 @@ function bbp_edit_forum_handler( $action = '' ) {
509
  $forum_edit_reason = esc_attr( strip_tags( $_POST['bbp_forum_edit_reason'] ) );
510
 
511
  // Update revision log
512
- if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( 1 == $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {
513
  bbp_update_forum_revision_log( array(
514
  'forum_id' => $forum_id,
515
  'revision_id' => $revision_id,
@@ -524,7 +523,7 @@ function bbp_edit_forum_handler( $action = '' ) {
524
  if ( !empty( $forum_id ) && !is_wp_error( $forum_id ) ) {
525
 
526
  // Update counts, etc...
527
- $forum_args = array(
528
  'forum_id' => $forum_id,
529
  'post_parent' => $forum_parent_id,
530
  'forum_author' => $forum->post_author,
@@ -533,14 +532,13 @@ function bbp_edit_forum_handler( $action = '' ) {
533
  'last_active_id' => 0,
534
  'last_active_time' => 0,
535
  'last_active_status' => bbp_get_public_status_id()
536
- );
537
- do_action( 'bbp_edit_forum', $forum_args );
538
 
539
  // If the new forum parent id is not equal to the old forum parent
540
  // id, run the bbp_move_forum action and pass the forum's parent id
541
  // as the first arg and new forum parent id as the second.
542
  // @todo implement
543
- //if ( $forum_id != $forum->post_parent )
544
  // bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id );
545
 
546
  /** Additional Actions (After Save) ***********************************/
@@ -613,9 +611,9 @@ function bbp_save_forum_extras( $forum_id = 0 ) {
613
  /** Forum Status ******************************************************/
614
 
615
  if ( !empty( $_POST['bbp_forum_status'] ) && in_array( $_POST['bbp_forum_status'], array( 'open', 'closed' ) ) ) {
616
- if ( 'closed' == $_POST['bbp_forum_status'] && !bbp_is_forum_closed( $forum_id, false ) ) {
617
  bbp_close_forum( $forum_id );
618
- } elseif ( 'open' == $_POST['bbp_forum_status'] && bbp_is_forum_closed( $forum_id, false ) ) {
619
  bbp_open_forum( $forum_id );
620
  }
621
  }
@@ -623,9 +621,9 @@ function bbp_save_forum_extras( $forum_id = 0 ) {
623
  /** Forum Type ********************************************************/
624
 
625
  if ( !empty( $_POST['bbp_forum_type'] ) && in_array( $_POST['bbp_forum_type'], array( 'forum', 'category' ) ) ) {
626
- if ( 'category' == $_POST['bbp_forum_type'] && !bbp_is_forum_category( $forum_id ) ) {
627
  bbp_categorize_forum( $forum_id );
628
- } elseif ( 'forum' == $_POST['bbp_forum_type'] && bbp_is_forum_category( $forum_id ) ) {
629
  bbp_normalize_forum( $forum_id );
630
  }
631
  }
@@ -800,12 +798,13 @@ function bbp_publicize_forum( $forum_id = 0, $current_visibility = '' ) {
800
  }
801
 
802
  // Only run queries if visibility is changing
803
- if ( bbp_get_public_status_id() != $current_visibility ) {
804
 
805
- // Update forum post_status
806
- global $wpdb;
807
- $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_public_status_id() ), array( 'ID' => $forum_id ) );
808
- wp_transition_post_status( bbp_get_public_status_id(), $current_visibility, get_post( $forum_id ) );
 
809
  }
810
 
811
  do_action( 'bbp_publicized_forum', $forum_id );
@@ -829,7 +828,7 @@ function bbp_privatize_forum( $forum_id = 0, $current_visibility = '' ) {
829
  do_action( 'bbp_privatize_forum', $forum_id );
830
 
831
  // Only run queries if visibility is changing
832
- if ( bbp_get_private_status_id() != $current_visibility ) {
833
 
834
  // Get hidden forums
835
  $hidden = bbp_get_hidden_forum_ids();
@@ -852,9 +851,10 @@ function bbp_privatize_forum( $forum_id = 0, $current_visibility = '' ) {
852
  update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) ) ) );
853
 
854
  // Update forums visibility setting
855
- global $wpdb;
856
- $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_private_status_id() ), array( 'ID' => $forum_id ) );
857
- wp_transition_post_status( bbp_get_private_status_id(), $current_visibility, get_post( $forum_id ) );
 
858
  }
859
 
860
  do_action( 'bbp_privatized_forum', $forum_id );
@@ -878,7 +878,7 @@ function bbp_hide_forum( $forum_id = 0, $current_visibility = '' ) {
878
  do_action( 'bbp_hide_forum', $forum_id );
879
 
880
  // Only run queries if visibility is changing
881
- if ( bbp_get_hidden_status_id() != $current_visibility ) {
882
 
883
  // Get private forums
884
  $private = bbp_get_private_forum_ids();
@@ -901,9 +901,10 @@ function bbp_hide_forum( $forum_id = 0, $current_visibility = '' ) {
901
  update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) ) ) );
902
 
903
  // Update forums visibility setting
904
- global $wpdb;
905
- $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_hidden_status_id() ), array( 'ID' => $forum_id ) );
906
- wp_transition_post_status( bbp_get_hidden_status_id(), $current_visibility, get_post( $forum_id ) );
 
907
  }
908
 
909
  do_action( 'bbp_hid_forum', $forum_id );
@@ -911,6 +912,54 @@ function bbp_hide_forum( $forum_id = 0, $current_visibility = '' ) {
911
  return $forum_id;
912
  }
913
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
914
  /** Count Bumpers *************************************************************/
915
 
916
  /**
@@ -1227,7 +1276,7 @@ function bbp_update_forum_last_active_id( $forum_id = 0, $active_id = 0 ) {
1227
  $active_id = $children_last_active;
1228
 
1229
  // Update only if published
1230
- if ( bbp_get_public_status_id() == get_post_status( $active_id ) )
1231
  update_post_meta( $forum_id, '_bbp_last_active_id', (int) $active_id );
1232
 
1233
  return (int) apply_filters( 'bbp_update_forum_last_active_id', (int) $active_id, $forum_id );
@@ -1361,8 +1410,10 @@ function bbp_update_forum_topic_count_hidden( $forum_id = 0, $topic_count = 0 )
1361
  if ( !empty( $forum_id ) ) {
1362
 
1363
  // Get topics of forum
1364
- if ( empty( $topic_count ) )
1365
- $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) );
 
 
1366
 
1367
  // Update the count
1368
  update_post_meta( $forum_id, '_bbp_topic_count_hidden', (int) $topic_count );
@@ -1409,7 +1460,8 @@ function bbp_update_forum_reply_count( $forum_id = 0 ) {
1409
  // Don't count replies if the forum is a category
1410
  $topic_ids = bbp_forum_query_topic_ids( $forum_id );
1411
  if ( !empty( $topic_ids ) ) {
1412
- $reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
 
1413
  } else {
1414
  $reply_count = 0;
1415
  }
@@ -1474,7 +1526,7 @@ function bbp_update_forum( $args = '' ) {
1474
  $r['last_active_time'] = get_post_field( 'post_date', $r['last_active_id'] );
1475
  }
1476
 
1477
- if ( bbp_get_public_status_id() == $r['last_active_status'] ) {
1478
  bbp_update_forum_last_active_time( $r['forum_id'], $r['last_active_time'] );
1479
  }
1480
 
@@ -1493,6 +1545,51 @@ function bbp_update_forum( $args = '' ) {
1493
  }
1494
  }
1495
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1496
  /** Queries *******************************************************************/
1497
 
1498
  /**
@@ -1574,7 +1671,7 @@ function bbp_exclude_forum_ids( $type = 'string' ) {
1574
  $hidden = bbp_get_hidden_forum_ids();
1575
 
1576
  // Merge private and hidden forums together
1577
- $forum_ids = (array) array_filter( array_merge( $private, $hidden ) );
1578
 
1579
  // There are forums that need to be excluded
1580
  if ( !empty( $forum_ids ) ) {
@@ -1639,16 +1736,11 @@ function bbp_pre_get_posts_normalize_forum_visibility( $posts_query = null ) {
1639
  return;
1640
  }
1641
 
1642
- // Bail if filters are suppressed on this query
1643
- if ( true == $posts_query->get( 'suppress_filters' ) ) {
1644
- return;
1645
- }
1646
-
1647
  // Get query post types array .
1648
  $post_types = (array) $posts_query->get( 'post_type' );
1649
 
1650
  // Forums
1651
- if ( in_array( bbp_get_forum_post_type() , $post_types ) ) {
1652
 
1653
  // Prevent accidental wp-admin post_row override
1654
  if ( is_admin() && isset( $_REQUEST['post_status'] ) ) {
@@ -1698,7 +1790,7 @@ function bbp_pre_get_posts_normalize_forum_visibility( $posts_query = null ) {
1698
  }
1699
 
1700
  // Add the statuses
1701
- $posts_query->set( 'post_status', $post_stati );
1702
  }
1703
 
1704
  // Topics Or Replies
@@ -1798,14 +1890,15 @@ function bbp_forum_query_last_reply_id( $forum_id, $topic_ids = 0 ) {
1798
  $cache_id = 'bbp_get_forum_' . $forum_id . '_reply_id';
1799
  $reply_id = (int) wp_cache_get( $cache_id, 'bbpress_posts' );
1800
 
1801
- if ( empty( $reply_id ) ) {
1802
 
1803
  if ( empty( $topic_ids ) ) {
1804
  $topic_ids = bbp_forum_query_topic_ids( $forum_id );
1805
  }
1806
 
1807
  if ( !empty( $topic_ids ) ) {
1808
- $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
 
1809
  wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 0
1810
  } else {
1811
  wp_cache_set( $cache_id, '0', 'bbpress_posts' );
@@ -2021,7 +2114,7 @@ function bbp_trash_forum_topics( $forum_id = 0 ) {
2021
  return;
2022
 
2023
  // Allowed post statuses to pre-trash
2024
- $post_stati = join( ',', array(
2025
  bbp_get_public_status_id(),
2026
  bbp_get_closed_status_id(),
2027
  bbp_get_pending_status_id()
29
  function bbp_insert_forum( $forum_data = array(), $forum_meta = array() ) {
30
 
31
  // Forum
32
+ $forum_data = bbp_parse_args( $forum_data, array(
33
  'post_parent' => 0, // forum ID
34
  'post_status' => bbp_get_public_status_id(),
35
  'post_type' => bbp_get_forum_post_type(),
39
  'post_title' => '',
40
  'menu_order' => 0,
41
  'comment_status' => 'closed'
42
+ ), 'insert_forum' );
 
43
 
44
  // Insert forum
45
  $forum_id = wp_insert_post( $forum_data );
46
 
47
  // Bail if no forum was added
48
+ if ( empty( $forum_id ) ) {
49
  return false;
50
+ }
51
 
52
  // Forum meta
53
+ $forum_meta = bbp_parse_args( $forum_meta, array(
54
  'reply_count' => 0,
55
  'topic_count' => 0,
56
  'topic_count_hidden' => 0,
61
  'last_active_id' => 0,
62
  'last_active_time' => 0,
63
  'forum_subforum_count' => 0,
64
+ ), 'insert_forum_meta' );
 
65
 
66
  // Insert forum meta
67
+ foreach ( $forum_meta as $meta_key => $meta_value ) {
68
  update_post_meta( $forum_id, '_bbp_' . $meta_key, $meta_value );
69
+ }
70
 
71
  // Return new forum ID
72
  return $forum_id;
136
  $forum_author = bbp_get_current_user_id();
137
 
138
  // Remove kses filters from title and content for capable users and if the nonce is verified
139
+ if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) === $_POST['_bbp_unfiltered_html_forum'] ) {
140
  remove_filter( 'bbp_new_forum_pre_title', 'wp_filter_kses' );
141
  remove_filter( 'bbp_new_forum_pre_content', 'bbp_encode_bad', 10 );
142
  remove_filter( 'bbp_new_forum_pre_content', 'bbp_filter_kses', 30 );
257
 
258
  // If the forum is trash, or the forum_status is switched to
259
  // trash, trash it properly
260
+ if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $forum_data['post_status'] === bbp_get_trash_status_id() ) ) {
261
 
262
  // Trash the reply
263
  wp_trash_post( $forum_id );
269
  /** Spam Check ********************************************************/
270
 
271
  // If reply or forum are spam, officially spam this reply
272
+ if ( $forum_data['post_status'] === bbp_get_spam_status_id() ) {
273
  add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
274
 
275
  // Force view=all
278
 
279
  /** Update counts, etc... *********************************************/
280
 
281
+ do_action( 'bbp_new_forum', array(
282
  'forum_id' => $forum_id,
283
  'post_parent' => $forum_parent_id,
284
  'forum_author' => $forum_author,
287
  'last_active_id' => 0,
288
  'last_active_time' => 0,
289
  'last_active_status' => bbp_get_public_status_id()
290
+ ) );
 
291
 
292
  /** Additional Actions (After Save) ***********************************/
293
 
406
  }
407
 
408
  // Remove kses filters from title and content for capable users and if the nonce is verified
409
+ if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) === $_POST['_bbp_unfiltered_html_forum'] ) ) {
410
  remove_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' );
411
  remove_filter( 'bbp_edit_forum_pre_content', 'bbp_encode_bad', 10 );
412
  remove_filter( 'bbp_edit_forum_pre_content', 'bbp_filter_kses', 30 );
508
  $forum_edit_reason = esc_attr( strip_tags( $_POST['bbp_forum_edit_reason'] ) );
509
 
510
  // Update revision log
511
+ if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( "1" === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {
512
  bbp_update_forum_revision_log( array(
513
  'forum_id' => $forum_id,
514
  'revision_id' => $revision_id,
523
  if ( !empty( $forum_id ) && !is_wp_error( $forum_id ) ) {
524
 
525
  // Update counts, etc...
526
+ do_action( 'bbp_edit_forum', array(
527
  'forum_id' => $forum_id,
528
  'post_parent' => $forum_parent_id,
529
  'forum_author' => $forum->post_author,
532
  'last_active_id' => 0,
533
  'last_active_time' => 0,
534
  'last_active_status' => bbp_get_public_status_id()
535
+ ) );
 
536
 
537
  // If the new forum parent id is not equal to the old forum parent
538
  // id, run the bbp_move_forum action and pass the forum's parent id
539
  // as the first arg and new forum parent id as the second.
540
  // @todo implement
541
+ //if ( $forum_id !== $forum->post_parent )
542
  // bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id );
543
 
544
  /** Additional Actions (After Save) ***********************************/
611
  /** Forum Status ******************************************************/
612
 
613
  if ( !empty( $_POST['bbp_forum_status'] ) && in_array( $_POST['bbp_forum_status'], array( 'open', 'closed' ) ) ) {
614
+ if ( 'closed' === $_POST['bbp_forum_status'] && !bbp_is_forum_closed( $forum_id, false ) ) {
615
  bbp_close_forum( $forum_id );
616
+ } elseif ( 'open' === $_POST['bbp_forum_status'] && bbp_is_forum_closed( $forum_id, false ) ) {
617
  bbp_open_forum( $forum_id );
618
  }
619
  }
621
  /** Forum Type ********************************************************/
622
 
623
  if ( !empty( $_POST['bbp_forum_type'] ) && in_array( $_POST['bbp_forum_type'], array( 'forum', 'category' ) ) ) {
624
+ if ( 'category' === $_POST['bbp_forum_type'] && !bbp_is_forum_category( $forum_id ) ) {
625
  bbp_categorize_forum( $forum_id );
626
+ } elseif ( 'forum' === $_POST['bbp_forum_type'] && bbp_is_forum_category( $forum_id ) ) {
627
  bbp_normalize_forum( $forum_id );
628
  }
629
  }
798
  }
799
 
800
  // Only run queries if visibility is changing
801
+ if ( bbp_get_public_status_id() !== $current_visibility ) {
802
 
803
+ // Update forums visibility setting
804
+ wp_insert_post( array(
805
+ 'ID' => $forum_id,
806
+ 'post_status' => bbp_get_public_status_id()
807
+ ) );
808
  }
809
 
810
  do_action( 'bbp_publicized_forum', $forum_id );
828
  do_action( 'bbp_privatize_forum', $forum_id );
829
 
830
  // Only run queries if visibility is changing
831
+ if ( bbp_get_private_status_id() !== $current_visibility ) {
832
 
833
  // Get hidden forums
834
  $hidden = bbp_get_hidden_forum_ids();
851
  update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) ) ) );
852
 
853
  // Update forums visibility setting
854
+ wp_insert_post( array(
855
+ 'ID' => $forum_id,
856
+ 'post_status' => bbp_get_private_status_id()
857
+ ) );
858
  }
859
 
860
  do_action( 'bbp_privatized_forum', $forum_id );
878
  do_action( 'bbp_hide_forum', $forum_id );
879
 
880
  // Only run queries if visibility is changing
881
+ if ( bbp_get_hidden_status_id() !== $current_visibility ) {
882
 
883
  // Get private forums
884
  $private = bbp_get_private_forum_ids();
901
  update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) ) ) );
902
 
903
  // Update forums visibility setting
904
+ wp_insert_post( array(
905
+ 'ID' => $forum_id,
906
+ 'post_status' => bbp_get_hidden_status_id()
907
+ ) );
908
  }
909
 
910
  do_action( 'bbp_hid_forum', $forum_id );
912
  return $forum_id;
913
  }
914
 
915
+ /**
916
+ * Recaches the private and hidden forums
917
+ *
918
+ * @since bbPress (r5017)
919
+ *
920
+ * @uses delete_option() to delete private and hidden forum pointers
921
+ * @uses WP_Query() To query post IDs
922
+ * @uses is_wp_error() To return if error occurred
923
+ * @uses update_option() To update the private and hidden post ID pointers
924
+ * @return array An array of the status code and the message
925
+ */
926
+ function bbp_repair_forum_visibility() {
927
+
928
+ // First, delete everything.
929
+ delete_option( '_bbp_private_forums' );
930
+ delete_option( '_bbp_hidden_forums' );
931
+
932
+ // Next, get all the private and hidden forums
933
+ $private_forums = new WP_Query( array(
934
+ 'suppress_filters' => true,
935
+ 'nopaging' => true,
936
+ 'post_type' => bbp_get_forum_post_type(),
937
+ 'post_status' => bbp_get_private_status_id(),
938
+ 'fields' => 'ids'
939
+ ) );
940
+ $hidden_forums = new WP_Query( array(
941
+ 'suppress_filters' => true,
942
+ 'nopaging' => true,
943
+ 'post_type' => bbp_get_forum_post_type(),
944
+ 'post_status' => bbp_get_hidden_status_id(),
945
+ 'fields' => 'ids'
946
+ ) );
947
+
948
+ // Reset the $post global
949
+ wp_reset_postdata();
950
+
951
+ // Bail if queries returned errors
952
+ if ( is_wp_error( $private_forums ) || is_wp_error( $hidden_forums ) )
953
+ return false;
954
+
955
+ // Update the private/hidden options
956
+ update_option( '_bbp_private_forums', $private_forums->posts ); // Private forums
957
+ update_option( '_bbp_hidden_forums', $hidden_forums->posts ); // Hidden forums
958
+
959
+ // Complete results
960
+ return true;
961
+ }
962
+
963
  /** Count Bumpers *************************************************************/
964
 
965
  /**
1276
  $active_id = $children_last_active;
1277
 
1278
  // Update only if published
1279
+ if ( bbp_get_public_status_id() === get_post_status( $active_id ) )
1280
  update_post_meta( $forum_id, '_bbp_last_active_id', (int) $active_id );
1281
 
1282
  return (int) apply_filters( 'bbp_update_forum_last_active_id', (int) $active_id, $forum_id );
1410
  if ( !empty( $forum_id ) ) {
1411
 
1412
  // Get topics of forum
1413
+ if ( empty( $topic_count ) ) {
1414
+ $post_status = "'" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "'";
1415
+ $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) );
1416
+ }
1417
 
1418
  // Update the count
1419
  update_post_meta( $forum_id, '_bbp_topic_count_hidden', (int) $topic_count );
1460
  // Don't count replies if the forum is a category
1461
  $topic_ids = bbp_forum_query_topic_ids( $forum_id );
1462
  if ( !empty( $topic_ids ) ) {
1463
+ $topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) );
1464
+ $reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( {$topic_ids} ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
1465
  } else {
1466
  $reply_count = 0;
1467
  }
1526
  $r['last_active_time'] = get_post_field( 'post_date', $r['last_active_id'] );
1527
  }
1528
 
1529
+ if ( bbp_get_public_status_id() === $r['last_active_status'] ) {
1530
  bbp_update_forum_last_active_time( $r['forum_id'], $r['last_active_time'] );
1531
  }
1532
 
1545
  }
1546
  }
1547
 
1548
+ /** Helpers *******************************************************************/
1549
+
1550
+ /**
1551
+ * Return an associative array of available topic statuses
1552
+ *
1553
+ * @since bbPress (r5059)
1554
+ *
1555
+ * @return array
1556
+ */
1557
+ function bbp_get_forum_statuses() {
1558
+ return apply_filters( 'bbp_get_forum_statuses', array(
1559
+ 'open' => _x( 'Open', 'Open the forum', 'bbpress' ),
1560
+ 'closed' => _x( 'Closed', 'Close the forum', 'bbpress' )
1561
+ ) );
1562
+ }
1563
+
1564
+ /**
1565
+ * Return an associative array of forum types
1566
+ *
1567
+ * @since bbPress (r5059)
1568
+ *
1569
+ * @return array
1570
+ */
1571
+ function bbp_get_forum_types() {
1572
+ return apply_filters( 'bbp_get_forum_types', array(
1573
+ 'forum' => _x( 'Forum', 'Forum accepts new topics', 'bbpress' ),
1574
+ 'category' => _x( 'Category', 'Forum is a category', 'bbpress' )
1575
+ ) );
1576
+ }
1577
+
1578
+ /**
1579
+ * Return an associative array of forum visibility
1580
+ *
1581
+ * @since bbPress (r5059)
1582
+ *
1583
+ * @return array
1584
+ */
1585
+ function bbp_get_forum_visibilities() {
1586
+ return apply_filters( 'bbp_get_forum_visibilities', array(
1587
+ bbp_get_public_status_id() => _x( 'Public', 'Make forum public', 'bbpress' ),
1588
+ bbp_get_private_status_id() => _x( 'Private', 'Make forum private', 'bbpress' ),
1589
+ bbp_get_hidden_status_id() => _x( 'Hidden', 'Make forum hidden', 'bbpress' )
1590
+ ) );
1591
+ }
1592
+
1593
  /** Queries *******************************************************************/
1594
 
1595
  /**
1671
  $hidden = bbp_get_hidden_forum_ids();
1672
 
1673
  // Merge private and hidden forums together
1674
+ $forum_ids = (array) array_filter( wp_parse_id_list( array_merge( $private, $hidden ) ) );
1675
 
1676
  // There are forums that need to be excluded
1677
  if ( !empty( $forum_ids ) ) {
1736
  return;
1737
  }
1738
 
 
 
 
 
 
1739
  // Get query post types array .
1740
  $post_types = (array) $posts_query->get( 'post_type' );
1741
 
1742
  // Forums
1743
+ if ( bbp_get_forum_post_type() === implode( '', $post_types ) ) {
1744
 
1745
  // Prevent accidental wp-admin post_row override
1746
  if ( is_admin() && isset( $_REQUEST['post_status'] ) ) {
1790
  }
1791
 
1792
  // Add the statuses
1793
+ $posts_query->set( 'post_status', array_unique( array_filter( $post_stati ) ) );
1794
  }
1795
 
1796
  // Topics Or Replies
1890
  $cache_id = 'bbp_get_forum_' . $forum_id . '_reply_id';
1891
  $reply_id = (int) wp_cache_get( $cache_id, 'bbpress_posts' );
1892
 
1893
+ if ( false === $reply_id ) {
1894
 
1895
  if ( empty( $topic_ids ) ) {
1896
  $topic_ids = bbp_forum_query_topic_ids( $forum_id );
1897
  }
1898
 
1899
  if ( !empty( $topic_ids ) ) {
1900
+ $topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) );
1901
+ $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( {$topic_ids} ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
1902
  wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 0
1903
  } else {
1904
  wp_cache_set( $cache_id, '0', 'bbpress_posts' );
2114
  return;
2115
 
2116
  // Allowed post statuses to pre-trash
2117
+ $post_stati = implode( ',', array(
2118
  bbp_get_public_status_id(),
2119
  bbp_get_closed_status_id(),
2120
  bbp_get_pending_status_id()
includes/forums/{template-tags.php → template.php} RENAMED
@@ -59,12 +59,13 @@ function bbp_has_forums( $args = '' ) {
59
 
60
  // Parse arguments with default forum query for most circumstances
61
  $bbp_f = bbp_parse_args( $args, array(
62
- 'post_type' => bbp_get_forum_post_type(),
63
- 'post_parent' => bbp_is_forum_archive() ? 0 : bbp_get_forum_id() ,
64
- 'post_status' => bbp_get_public_status_id(),
65
- 'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
66
- 'orderby' => 'menu_order',
67
- 'order' => 'ASC'
 
68
  ), 'has_forums' );
69
 
70
  // Run the query
@@ -204,14 +205,14 @@ function bbp_get_forum( $forum, $output = OBJECT, $filter = 'raw' ) {
204
  return null;
205
 
206
  // Tweak the data type to return
207
- if ( $output == OBJECT ) {
208
  return $forum;
209
 
210
- } elseif ( $output == ARRAY_A ) {
211
  $_forum = get_object_vars( $forum );
212
  return $_forum;
213
 
214
- } elseif ( $output == ARRAY_N ) {
215
  $_forum = array_values( get_object_vars( $forum ) );
216
  return $_forum;
217
 
@@ -229,7 +230,7 @@ function bbp_get_forum( $forum, $output = OBJECT, $filter = 'raw' ) {
229
  * @uses bbp_get_forum_permalink() To get the permalink
230
  */
231
  function bbp_forum_permalink( $forum_id = 0 ) {
232
- echo bbp_get_forum_permalink( $forum_id );
233
  }
234
  /**
235
  * Return the link to the forum
@@ -525,9 +526,9 @@ function bbp_forum_freshness_link( $forum_id = 0) {
525
  $time_since = bbp_get_forum_last_active_time( $forum_id );
526
 
527
  if ( !empty( $time_since ) && !empty( $link_url ) )
528
- $anchor = '<a href="' . $link_url . '" title="' . esc_attr( $title ) . '">' . $time_since . '</a>';
529
  else
530
- $anchor = __( 'No Topics', 'bbpress' );
531
 
532
  return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
533
  }
@@ -635,7 +636,7 @@ function bbp_forum_get_subforums( $args = '' ) {
635
  'post_type' => bbp_get_forum_post_type(),
636
  'post_status' => implode( ',', $post_stati ),
637
  'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
638
- 'orderby' => 'menu_order',
639
  'order' => 'ASC',
640
  'ignore_sticky_posts' => true,
641
  'no_found_rows' => true
@@ -723,7 +724,7 @@ function bbp_list_forums( $args = '' ) {
723
  }
724
 
725
  // Build this sub forums link
726
- $output .= $r['link_before'] . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
727
  }
728
 
729
  // Output the list
@@ -805,7 +806,7 @@ function bbp_forum_last_topic_title( $forum_id = 0 ) {
805
  * permanent link
806
  */
807
  function bbp_forum_last_topic_permalink( $forum_id = 0 ) {
808
- echo bbp_get_forum_last_topic_permalink( $forum_id );
809
  }
810
  /**
811
  * Return the link to the last topic in a forum
@@ -947,7 +948,7 @@ function bbp_forum_last_reply_title( $forum_id = 0 ) {
947
  * @uses bbp_get_forum_last_reply_permalink() To get the forum last reply link
948
  */
949
  function bbp_forum_last_reply_permalink( $forum_id = 0 ) {
950
- echo bbp_get_forum_last_reply_permalink( $forum_id );
951
  }
952
  /**
953
  * Return the link to the last reply in a forum
@@ -976,7 +977,7 @@ function bbp_forum_last_reply_permalink( $forum_id = 0 ) {
976
  * @uses bbp_get_forum_last_reply_url() To get the forum last reply url
977
  */
978
  function bbp_forum_last_reply_url( $forum_id = 0 ) {
979
- echo bbp_get_forum_last_reply_url( $forum_id );
980
  }
981
  /**
982
  * Return the url to the last reply in a forum
@@ -1122,9 +1123,9 @@ function bbp_forum_topics_link( $forum_id = 0 ) {
1122
 
1123
  // First link never has view=all
1124
  if ( bbp_get_view_all( 'edit_others_topics' ) )
1125
- $retval .= "<a href='" . esc_url( bbp_remove_view_all( bbp_get_forum_permalink( $forum_id ) ) ) . "'>$topics</a>";
1126
  else
1127
- $retval .= $topics;
1128
 
1129
  // Get deleted topics
1130
  $deleted = bbp_get_forum_topic_count_hidden( $forum_id );
@@ -1141,7 +1142,7 @@ function bbp_forum_topics_link( $forum_id = 0 ) {
1141
 
1142
  // Link
1143
  } else {
1144
- $retval .= " <a href='" . esc_url( bbp_add_view_all( bbp_get_forum_permalink( $forum_id ), true ) ) . "'>$extra</a>";
1145
  }
1146
  }
1147
 
@@ -1431,7 +1432,7 @@ function bbp_forum_type( $forum_id = 0 ) {
1431
  function bbp_is_forum_category( $forum_id = 0 ) {
1432
  $forum_id = bbp_get_forum_id( $forum_id );
1433
  $type = bbp_get_forum_type( $forum_id );
1434
- $retval = ( !empty( $type ) && 'category' == $type );
1435
 
1436
  return (bool) apply_filters( 'bbp_is_forum_category', (bool) $retval, $forum_id );
1437
  }
@@ -1467,7 +1468,7 @@ function bbp_is_forum_open( $forum_id = 0 ) {
1467
  function bbp_is_forum_closed( $forum_id = 0, $check_ancestors = true ) {
1468
 
1469
  $forum_id = bbp_get_forum_id( $forum_id );
1470
- $retval = ( bbp_get_closed_status_id() == bbp_get_forum_status( $forum_id ) );
1471
 
1472
  if ( !empty( $check_ancestors ) ) {
1473
  $ancestors = bbp_get_forum_ancestors( $forum_id );
@@ -1502,7 +1503,7 @@ function bbp_is_forum_public( $forum_id = 0, $check_ancestors = true ) {
1502
  $visibility = bbp_get_forum_visibility( $forum_id );
1503
 
1504
  // If post status is public, return true
1505
- $retval = ( bbp_get_public_status_id() == $visibility );
1506
 
1507
  // Check ancestors and inherit their privacy setting for display
1508
  if ( !empty( $check_ancestors ) ) {
@@ -1538,7 +1539,7 @@ function bbp_is_forum_private( $forum_id = 0, $check_ancestors = true ) {
1538
  $visibility = bbp_get_forum_visibility( $forum_id );
1539
 
1540
  // If post status is private, return true
1541
- $retval = ( bbp_get_private_status_id() == $visibility );
1542
 
1543
  // Check ancestors and inherit their privacy setting for display
1544
  if ( !empty( $check_ancestors ) ) {
@@ -1574,7 +1575,7 @@ function bbp_is_forum_hidden( $forum_id = 0, $check_ancestors = true ) {
1574
  $visibility = bbp_get_forum_visibility( $forum_id );
1575
 
1576
  // If post status is private, return true
1577
- $retval = ( bbp_get_hidden_status_id() == $visibility );
1578
 
1579
  // Check ancestors and inherit their privacy setting for display
1580
  if ( !empty( $check_ancestors ) ) {
@@ -1777,7 +1778,7 @@ function bbp_forum_class( $forum_id = 0, $classes = array() ) {
1777
 
1778
  // Filter the results
1779
  $classes = apply_filters( 'bbp_get_forum_class', $classes, $forum_id );
1780
- $retval = 'class="' . join( ' ', $classes ) . '"';
1781
 
1782
  return $retval;
1783
  }
@@ -1864,17 +1865,17 @@ function bbp_single_forum_description( $args = '' ) {
1864
  if ( !empty( $reply_count ) ) {
1865
 
1866
  if ( bbp_is_forum_category( $forum_id ) ) {
1867
- $retstr = sprintf( __( 'This category contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since );
1868
  } else {
1869
- $retstr = sprintf( __( 'This forum contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since );
1870
  }
1871
 
1872
  } else {
1873
 
1874
  if ( bbp_is_forum_category( $forum_id ) ) {
1875
- $retstr = sprintf( __( 'This category contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since );
1876
  } else {
1877
- $retstr = sprintf( __( 'This forum contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since );
1878
  }
1879
  }
1880
 
@@ -1884,9 +1885,9 @@ function bbp_single_forum_description( $args = '' ) {
1884
  if ( !empty( $reply_count ) ) {
1885
 
1886
  if ( bbp_is_forum_category( $forum_id ) ) {
1887
- $retstr = sprintf( __( 'This category contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );
1888
  } else {
1889
- $retstr = sprintf( __( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );
1890
  }
1891
 
1892
  } else {
@@ -1894,13 +1895,13 @@ function bbp_single_forum_description( $args = '' ) {
1894
  if ( !empty( $topic_count ) ) {
1895
 
1896
  if ( bbp_is_forum_category( $forum_id ) ) {
1897
- $retstr = sprintf( __( 'This category contains %1$s.', 'bbpress' ), $topic_text );
1898
  } else {
1899
- $retstr = sprintf( __( 'This forum contains %1$s.', 'bbpress' ), $topic_text );
1900
  }
1901
 
1902
  } else {
1903
- $retstr = __( 'This forum is empty.', 'bbpress' );
1904
  }
1905
  }
1906
  }
@@ -2108,7 +2109,7 @@ function bbp_form_forum_visibility() {
2108
  return apply_filters( 'bbp_get_form_forum_visibility', esc_attr( $forum_visibility ) );
2109
  }
2110
 
2111
- /** Form Dropdows *************************************************************/
2112
 
2113
  /**
2114
  * Output value forum type dropdown
@@ -2118,8 +2119,8 @@ function bbp_form_forum_visibility() {
2118
  * @param int $forum_id The forum id to use
2119
  * @uses bbp_get_form_forum_type() To get the topic's forum id
2120
  */
2121
- function bbp_form_forum_type_dropdown( $forum_id = 0 ) {
2122
- echo bbp_get_form_forum_type_dropdown( $forum_id );
2123
  }
2124
  /**
2125
  * Return the forum type dropdown
@@ -2132,20 +2133,66 @@ function bbp_form_forum_type_dropdown( $forum_id = 0 ) {
2132
  * @uses apply_filters()
2133
  * @return string HTML select list for selecting forum type
2134
  */
2135
- function bbp_get_form_forum_type_dropdown( $forum_id = 0 ) {
2136
- $forum_id = bbp_get_forum_id( $forum_id );
2137
- $forum_attr = apply_filters( 'bbp_forum_types', array(
2138
- 'forum' => __( 'Forum', 'bbpress' ),
2139
- 'category' => __( 'Category', 'bbpress' )
2140
- ) );
2141
- $type_output = '<select name="bbp_forum_type" id="bbp_forum_type_select">' . "\n";
 
 
 
 
 
 
 
 
 
 
2142
 
2143
- foreach( $forum_attr as $value => $label )
2144
- $type_output .= "\t" . '<option value="' . $value . '"' . selected( bbp_get_forum_type( $forum_id ), $value, false ) . '>' . esc_html( $label ) . '</option>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2145
 
2146
- $type_output .= '</select>';
 
2147
 
2148
- return apply_filters( 'bbp_get_form_forum_type_dropdown', $type_output, $forum_id, $forum_attr );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2149
  }
2150
 
2151
  /**
@@ -2156,8 +2203,8 @@ function bbp_form_forum_type_dropdown( $forum_id = 0 ) {
2156
  * @param int $forum_id The forum id to use
2157
  * @uses bbp_get_form_forum_status() To get the topic's forum id
2158
  */
2159
- function bbp_form_forum_status_dropdown( $forum_id = 0 ) {
2160
- echo bbp_get_form_forum_status_dropdown( $forum_id );
2161
  }
2162
  /**
2163
  * Return the forum status dropdown
@@ -2170,20 +2217,66 @@ function bbp_form_forum_status_dropdown( $forum_id = 0 ) {
2170
  * @uses apply_filters()
2171
  * @return string HTML select list for selecting forum status
2172
  */
2173
- function bbp_get_form_forum_status_dropdown( $forum_id = 0 ) {
2174
- $forum_id = bbp_get_forum_id( $forum_id );
2175
- $forum_attr = apply_filters( 'bbp_forum_statuses', array(
2176
- 'open' => _x( 'Open', 'Forum Status', 'bbpress' ),
2177
- 'closed' => _x( 'Closed', 'Forum Status', 'bbpress' )
2178
- ) );
2179
- $status_output = '<select name="bbp_forum_status" id="bbp_forum_status_select">' . "\n";
2180
 
2181
- foreach( $forum_attr as $value => $label )
2182
- $status_output .= "\t" . '<option value="' . $value . '"' . selected( bbp_get_forum_status( $forum_id ), $value, false ) . '>' . esc_html( $label ) . '</option>' . "\n";
 
 
 
 
 
2183
 
2184
- $status_output .= '</select>';
 
 
 
 
 
 
 
 
 
 
 
 
 
2185
 
2186
- return apply_filters( 'bbp_get_form_forum_status_dropdown', $status_output, $forum_id, $forum_attr );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2187
  }
2188
 
2189
  /**
@@ -2194,8 +2287,8 @@ function bbp_form_forum_status_dropdown( $forum_id = 0 ) {
2194
  * @param int $forum_id The forum id to use
2195
  * @uses bbp_get_form_forum_visibility() To get the topic's forum id
2196
  */
2197
- function bbp_form_forum_visibility_dropdown( $forum_id = 0 ) {
2198
- echo bbp_get_form_forum_visibility_dropdown( $forum_id );
2199
  }
2200
  /**
2201
  * Return the forum visibility dropdown
@@ -2208,21 +2301,66 @@ function bbp_form_forum_visibility_dropdown( $forum_id = 0 ) {
2208
  * @uses apply_filters()
2209
  * @return string HTML select list for selecting forum visibility
2210
  */
2211
- function bbp_get_form_forum_visibility_dropdown( $forum_id = 0 ) {
2212
- $forum_id = bbp_get_forum_id( $forum_id );
2213
- $forum_attr = apply_filters( 'bbp_forum_visibilities', array(
2214
- bbp_get_public_status_id() => __( 'Public', 'bbpress' ),
2215
- bbp_get_private_status_id() => __( 'Private', 'bbpress' ),
2216
- bbp_get_hidden_status_id() => __( 'Hidden', 'bbpress' )
2217
- ) );
2218
- $visibility_output = '<select name="bbp_forum_visibility" id="bbp_forum_visibility_select">' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2219
 
2220
- foreach( $forum_attr as $value => $label )
2221
- $visibility_output .= "\t" . '<option value="' . $value . '"' . selected( bbp_get_forum_visibility( $forum_id ), $value, false ) . '>' . esc_html( $label ) . '</option>' . "\n";
2222
 
2223
- $visibility_output .= '</select>';
2224
 
2225
- return apply_filters( 'bbp_get_form_forum_visibility_dropdown', $visibility_output, $forum_id, $forum_attr );
 
2226
  }
2227
 
2228
  /** Feeds *********************************************************************/
@@ -2283,7 +2421,7 @@ function bbp_forum_topics_feed_link( $forum_id = 0 ) {
2283
  ) ) );
2284
  }
2285
 
2286
- $link = '<a href="' . $url . '" class="bbp-forum-rss-link topics"><span>' . __( 'Topics', 'bbpress' ) . '</span></a>';
2287
  }
2288
 
2289
  return apply_filters( 'bbp_get_forum_topics_feed_link', $link, $url, $forum_id );
@@ -2347,7 +2485,7 @@ function bbp_forum_replies_feed_link( $forum_id = 0 ) {
2347
  ) ) );
2348
  }
2349
 
2350
- $link = '<a href="' . $url . '" class="bbp-forum-rss-link replies"><span>' . __( 'Replies', 'bbpress' ) . '</span></a>';
2351
  }
2352
 
2353
  return apply_filters( 'bbp_get_forum_replies_feed_link', $link, $url, $forum_id );
59
 
60
  // Parse arguments with default forum query for most circumstances
61
  $bbp_f = bbp_parse_args( $args, array(
62
+ 'post_type' => bbp_get_forum_post_type(),
63
+ 'post_parent' => bbp_is_forum_archive() ? 0 : bbp_get_forum_id(),
64
+ 'post_status' => bbp_get_public_status_id(),
65
+ 'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
66
+ 'ignore_sticky_posts' => true,
67
+ 'orderby' => 'menu_order title',
68
+ 'order' => 'ASC'
69
  ), 'has_forums' );
70
 
71
  // Run the query
205
  return null;
206
 
207
  // Tweak the data type to return
208
+ if ( $output === OBJECT ) {
209
  return $forum;
210
 
211
+ } elseif ( $output === ARRAY_A ) {
212
  $_forum = get_object_vars( $forum );
213
  return $_forum;
214
 
215
+ } elseif ( $output === ARRAY_N ) {
216
  $_forum = array_values( get_object_vars( $forum ) );
217
  return $_forum;
218
 
230
  * @uses bbp_get_forum_permalink() To get the permalink
231
  */
232
  function bbp_forum_permalink( $forum_id = 0 ) {
233
+ echo esc_url( bbp_get_forum_permalink( $forum_id ) );
234
  }
235
  /**
236
  * Return the link to the forum
526
  $time_since = bbp_get_forum_last_active_time( $forum_id );
527
 
528
  if ( !empty( $time_since ) && !empty( $link_url ) )
529
+ $anchor = '<a href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $time_since ) . '</a>';
530
  else
531
+ $anchor = esc_html__( 'No Topics', 'bbpress' );
532
 
533
  return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
534
  }
636
  'post_type' => bbp_get_forum_post_type(),
637
  'post_status' => implode( ',', $post_stati ),
638
  'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
639
+ 'orderby' => 'menu_order title',
640
  'order' => 'ASC',
641
  'ignore_sticky_posts' => true,
642
  'no_found_rows' => true
724
  }
725
 
726
  // Build this sub forums link
727
+ $output .= $r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
728
  }
729
 
730
  // Output the list
806
  * permanent link
807
  */
808
  function bbp_forum_last_topic_permalink( $forum_id = 0 ) {
809
+ echo esc_url( bbp_get_forum_last_topic_permalink( $forum_id ) );
810
  }
811
  /**
812
  * Return the link to the last topic in a forum
948
  * @uses bbp_get_forum_last_reply_permalink() To get the forum last reply link
949
  */
950
  function bbp_forum_last_reply_permalink( $forum_id = 0 ) {
951
+ echo esc_url( bbp_get_forum_last_reply_permalink( $forum_id ) );
952
  }
953
  /**
954
  * Return the link to the last reply in a forum
977
  * @uses bbp_get_forum_last_reply_url() To get the forum last reply url
978
  */
979
  function bbp_forum_last_reply_url( $forum_id = 0 ) {
980
+ echo esc_url( bbp_get_forum_last_reply_url( $forum_id ) );
981
  }
982
  /**
983
  * Return the url to the last reply in a forum
1123
 
1124
  // First link never has view=all
1125
  if ( bbp_get_view_all( 'edit_others_topics' ) )
1126
+ $retval .= "<a href='" . esc_url( bbp_remove_view_all( bbp_get_forum_permalink( $forum_id ) ) ) . "'>" . esc_html( $topics ) . "</a>";
1127
  else
1128
+ $retval .= esc_html( $topics );
1129
 
1130
  // Get deleted topics
1131
  $deleted = bbp_get_forum_topic_count_hidden( $forum_id );
1142
 
1143
  // Link
1144
  } else {
1145
+ $retval .= " <a href='" . esc_url( bbp_add_view_all( bbp_get_forum_permalink( $forum_id ), true ) ) . "'>" . esc_html( $extra ) . "</a>";
1146
  }
1147
  }
1148
 
1432
  function bbp_is_forum_category( $forum_id = 0 ) {
1433
  $forum_id = bbp_get_forum_id( $forum_id );
1434
  $type = bbp_get_forum_type( $forum_id );
1435
+ $retval = ( !empty( $type ) && 'category' === $type );
1436
 
1437
  return (bool) apply_filters( 'bbp_is_forum_category', (bool) $retval, $forum_id );
1438
  }
1468
  function bbp_is_forum_closed( $forum_id = 0, $check_ancestors = true ) {
1469
 
1470
  $forum_id = bbp_get_forum_id( $forum_id );
1471
+ $retval = ( bbp_get_closed_status_id() === bbp_get_forum_status( $forum_id ) );
1472
 
1473
  if ( !empty( $check_ancestors ) ) {
1474
  $ancestors = bbp_get_forum_ancestors( $forum_id );
1503
  $visibility = bbp_get_forum_visibility( $forum_id );
1504
 
1505
  // If post status is public, return true
1506
+ $retval = ( bbp_get_public_status_id() === $visibility );
1507
 
1508
  // Check ancestors and inherit their privacy setting for display
1509
  if ( !empty( $check_ancestors ) ) {
1539
  $visibility = bbp_get_forum_visibility( $forum_id );
1540
 
1541
  // If post status is private, return true
1542
+ $retval = ( bbp_get_private_status_id() === $visibility );
1543
 
1544
  // Check ancestors and inherit their privacy setting for display
1545
  if ( !empty( $check_ancestors ) ) {
1575
  $visibility = bbp_get_forum_visibility( $forum_id );
1576
 
1577
  // If post status is private, return true
1578
+ $retval = ( bbp_get_hidden_status_id() === $visibility );
1579
 
1580
  // Check ancestors and inherit their privacy setting for display
1581
  if ( !empty( $check_ancestors ) ) {
1778
 
1779
  // Filter the results
1780
  $classes = apply_filters( 'bbp_get_forum_class', $classes, $forum_id );
1781
+ $retval = 'class="' . implode( ' ', $classes ) . '"';
1782
 
1783
  return $retval;
1784
  }
1865
  if ( !empty( $reply_count ) ) {
1866
 
1867
  if ( bbp_is_forum_category( $forum_id ) ) {
1868
+ $retstr = sprintf( esc_html__( 'This category contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since );
1869
  } else {
1870
+ $retstr = sprintf( esc_html__( 'This forum contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since );
1871
  }
1872
 
1873
  } else {
1874
 
1875
  if ( bbp_is_forum_category( $forum_id ) ) {
1876
+ $retstr = sprintf( esc_html__( 'This category contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since );
1877
  } else {
1878
+ $retstr = sprintf( esc_html__( 'This forum contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since );
1879
  }
1880
  }
1881
 
1885
  if ( !empty( $reply_count ) ) {
1886
 
1887
  if ( bbp_is_forum_category( $forum_id ) ) {
1888
+ $retstr = sprintf( esc_html__( 'This category contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );
1889
  } else {
1890
+ $retstr = sprintf( esc_html__( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );
1891
  }
1892
 
1893
  } else {
1895
  if ( !empty( $topic_count ) ) {
1896
 
1897
  if ( bbp_is_forum_category( $forum_id ) ) {
1898
+ $retstr = sprintf( esc_html__( 'This category contains %1$s.', 'bbpress' ), $topic_text );
1899
  } else {
1900
+ $retstr = sprintf( esc_html__( 'This forum contains %1$s.', 'bbpress' ), $topic_text );
1901
  }
1902
 
1903
  } else {
1904
+ $retstr = esc_html__( 'This forum is empty.', 'bbpress' );
1905
  }
1906
  }
1907
  }
2109
  return apply_filters( 'bbp_get_form_forum_visibility', esc_attr( $forum_visibility ) );
2110
  }
2111
 
2112
+ /** Form Dropdowns ************************************************************/
2113
 
2114
  /**
2115
  * Output value forum type dropdown
2119
  * @param int $forum_id The forum id to use
2120
  * @uses bbp_get_form_forum_type() To get the topic's forum id
2121
  */
2122
+ function bbp_form_forum_type_dropdown( $args = '' ) {
2123
+ echo bbp_get_form_forum_type_dropdown( $args );
2124
  }
2125
  /**
2126
  * Return the forum type dropdown
2133
  * @uses apply_filters()
2134
  * @return string HTML select list for selecting forum type
2135
  */
2136
+ function bbp_get_form_forum_type_dropdown( $args = '' ) {
2137
+
2138
+ // Backpat for handling passing of a forum ID as integer
2139
+ if ( is_int( $args ) ) {
2140
+ $forum_id = (int) $args;
2141
+ $args = array();
2142
+ } else {
2143
+ $forum_id = 0;
2144
+ }
2145
+
2146
+ // Parse arguments against default values
2147
+ $r = bbp_parse_args( $args, array(
2148
+ 'select_id' => 'bbp_forum_type',
2149
+ 'tab' => bbp_get_tab_index(),
2150
+ 'forum_id' => $forum_id,
2151
+ 'selected' => false
2152
+ ), 'forum_type_select' );
2153
 
2154
+ // No specific selected value passed
2155
+ if ( empty( $r['selected'] ) ) {
2156
+
2157
+ // Post value is passed
2158
+ if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
2159
+ $r['selected'] = $_POST[ $r['select_id'] ];
2160
+
2161
+ // No Post value was passed
2162
+ } else {
2163
+
2164
+ // Edit topic
2165
+ if ( bbp_is_forum_edit() ) {
2166
+ $r['forum_id'] = bbp_get_forum_id( $r['forum_id'] );
2167
+ $r['selected'] = bbp_get_forum_type( $r['forum_id'] );
2168
+
2169
+ // New topic
2170
+ } else {
2171
+ $r['selected'] = bbp_get_public_status_id();
2172
+ }
2173
+ }
2174
+ }
2175
 
2176
+ // Used variables
2177
+ $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
2178
 
2179
+ // Start an output buffer, we'll finish it after the select loop
2180
+ ob_start(); ?>
2181
+
2182
+ <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>>
2183
+
2184
+ <?php foreach ( bbp_get_forum_types() as $key => $label ) : ?>
2185
+
2186
+ <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
2187
+
2188
+ <?php endforeach; ?>
2189
+
2190
+ </select>
2191
+
2192
+ <?php
2193
+
2194
+ // Return the results
2195
+ return apply_filters( 'bbp_get_form_forum_type_dropdown', ob_get_clean(), $r );
2196
  }
2197
 
2198
  /**
2203
  * @param int $forum_id The forum id to use
2204
  * @uses bbp_get_form_forum_status() To get the topic's forum id
2205
  */
2206
+ function bbp_form_forum_status_dropdown( $args = '' ) {
2207
+ echo bbp_get_form_forum_status_dropdown( $args );
2208
  }
2209
  /**
2210
  * Return the forum status dropdown
2217
  * @uses apply_filters()
2218
  * @return string HTML select list for selecting forum status
2219
  */
2220
+ function bbp_get_form_forum_status_dropdown( $args = '' ) {
 
 
 
 
 
 
2221
 
2222
+ // Backpat for handling passing of a forum ID
2223
+ if ( is_int( $args ) ) {
2224
+ $forum_id = (int) $args;
2225
+ $args = array();
2226
+ } else {
2227
+ $forum_id = 0;
2228
+ }
2229
 
2230
+ // Parse arguments against default values
2231
+ $r = bbp_parse_args( $args, array(
2232
+ 'select_id' => 'bbp_forum_status',
2233
+ 'tab' => bbp_get_tab_index(),
2234
+ 'forum_id' => $forum_id,
2235
+ 'selected' => false
2236
+ ), 'forum_status_select' );
2237
+
2238
+ // No specific selected value passed
2239
+ if ( empty( $r['selected'] ) ) {
2240
+
2241
+ // Post value is passed
2242
+ if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
2243
+ $r['selected'] = $_POST[ $r['select_id'] ];
2244
 
2245
+ // No Post value was passed
2246
+ } else {
2247
+
2248
+ // Edit topic
2249
+ if ( bbp_is_forum_edit() ) {
2250
+ $r['forum_id'] = bbp_get_forum_id( $r['forum_id'] );
2251
+ $r['selected'] = bbp_get_forum_status( $r['forum_id'] );
2252
+
2253
+ // New topic
2254
+ } else {
2255
+ $r['selected'] = bbp_get_public_status_id();
2256
+ }
2257
+ }
2258
+ }
2259
+
2260
+ // Used variables
2261
+ $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
2262
+
2263
+ // Start an output buffer, we'll finish it after the select loop
2264
+ ob_start(); ?>
2265
+
2266
+ <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>>
2267
+
2268
+ <?php foreach ( bbp_get_forum_statuses() as $key => $label ) : ?>
2269
+
2270
+ <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
2271
+
2272
+ <?php endforeach; ?>
2273
+
2274
+ </select>
2275
+
2276
+ <?php
2277
+
2278
+ // Return the results
2279
+ return apply_filters( 'bbp_get_form_forum_status_dropdown', ob_get_clean(), $r );
2280
  }
2281
 
2282
  /**
2287
  * @param int $forum_id The forum id to use
2288
  * @uses bbp_get_form_forum_visibility() To get the topic's forum id
2289
  */
2290
+ function bbp_form_forum_visibility_dropdown( $args = '' ) {
2291
+ echo bbp_get_form_forum_visibility_dropdown( $args );
2292
  }
2293
  /**
2294
  * Return the forum visibility dropdown
2301
  * @uses apply_filters()
2302
  * @return string HTML select list for selecting forum visibility
2303
  */
2304
+ function bbp_get_form_forum_visibility_dropdown( $args = '' ) {
2305
+
2306
+ // Backpat for handling passing of a forum ID
2307
+ if ( is_int( $args ) ) {
2308
+ $forum_id = (int) $args;
2309
+ $args = array();
2310
+ } else {
2311
+ $forum_id = 0;
2312
+ }
2313
+
2314
+ // Parse arguments against default values
2315
+ $r = bbp_parse_args( $args, array(
2316
+ 'select_id' => 'bbp_forum_visibility',
2317
+ 'tab' => bbp_get_tab_index(),
2318
+ 'forum_id' => $forum_id,
2319
+ 'selected' => false
2320
+ ), 'forum_type_select' );
2321
+
2322
+ // No specific selected value passed
2323
+ if ( empty( $r['selected'] ) ) {
2324
+
2325
+ // Post value is passed
2326
+ if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
2327
+ $r['selected'] = $_POST[ $r['select_id'] ];
2328
+
2329
+ // No Post value was passed
2330
+ } else {
2331
+
2332
+ // Edit topic
2333
+ if ( bbp_is_forum_edit() ) {
2334
+ $r['forum_id'] = bbp_get_forum_id( $r['forum_id'] );
2335
+ $r['selected'] = bbp_get_forum_visibility( $r['forum_id'] );
2336
+
2337
+ // New topic
2338
+ } else {
2339
+ $r['selected'] = bbp_get_public_status_id();
2340
+ }
2341
+ }
2342
+ }
2343
+
2344
+ // Used variables
2345
+ $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
2346
+
2347
+ // Start an output buffer, we'll finish it after the select loop
2348
+ ob_start(); ?>
2349
+
2350
+ <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>>
2351
+
2352
+ <?php foreach ( bbp_get_forum_visibilities() as $key => $label ) : ?>
2353
+
2354
+ <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
2355
+
2356
+ <?php endforeach; ?>
2357
 
2358
+ </select>
 
2359
 
2360
+ <?php
2361
 
2362
+ // Return the results
2363
+ return apply_filters( 'bbp_get_form_forum_type_dropdown', ob_get_clean(), $r );
2364
  }
2365
 
2366
  /** Feeds *********************************************************************/
2421
  ) ) );
2422
  }
2423
 
2424
+ $link = '<a href="' . esc_url( $url ) . '" class="bbp-forum-rss-link topics"><span>' . esc_attr__( 'Topics', 'bbpress' ) . '</span></a>';
2425
  }
2426
 
2427
  return apply_filters( 'bbp_get_forum_topics_feed_link', $link, $url, $forum_id );
2485
  ) ) );
2486
  }
2487
 
2488
+ $link = '<a href="' . esc_url( $url ) . '" class="bbp-forum-rss-link replies"><span>' . esc_html__( 'Replies', 'bbpress' ) . '</span></a>';
2489
  }
2490
 
2491
  return apply_filters( 'bbp_get_forum_replies_feed_link', $link, $url, $forum_id );
includes/replies/capabilities.php CHANGED
@@ -66,11 +66,11 @@ function bbp_map_reply_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
66
  $post_type = get_post_type_object( $_post->post_type );
67
 
68
  // Post is public
69
- if ( bbp_get_public_status_id() == $_post->post_status ) {
70
  $caps = array( 'spectate' );
71
 
72
  // User is author so allow read
73
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
74
  $caps = array( 'spectate' );
75
 
76
  // Unknown so map to private posts
@@ -125,8 +125,8 @@ function bbp_map_reply_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
125
  if ( bbp_is_user_inactive( $user_id ) ) {
126
  $caps[] = 'do_not_allow';
127
 
128
- // User is author so allow edit
129
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
130
  $caps[] = $post_type->cap->edit_posts;
131
 
132
  // Unknown, so map to edit_others_posts
66
  $post_type = get_post_type_object( $_post->post_type );
67
 
68
  // Post is public
69
+ if ( bbp_get_public_status_id() === $_post->post_status ) {
70
  $caps = array( 'spectate' );
71
 
72
  // User is author so allow read
73
+ } elseif ( (int) $user_id === (int) $_post->post_author ) {
74
  $caps = array( 'spectate' );
75
 
76
  // Unknown so map to private posts
125
  if ( bbp_is_user_inactive( $user_id ) ) {
126
  $caps[] = 'do_not_allow';
127
 
128
+ // User is author so allow edit if not in admin
129
+ } elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
130
  $caps[] = $post_type->cap->edit_posts;
131
 
132
  // Unknown, so map to edit_others_posts
includes/replies/functions.php CHANGED
@@ -29,7 +29,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
29
  function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
30
 
31
  // Forum
32
- $default_reply = array(
33
  'post_parent' => 0, // topic ID
34
  'post_status' => bbp_get_public_status_id(),
35
  'post_type' => bbp_get_reply_post_type(),
@@ -39,32 +39,33 @@ function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
39
  'post_title' => '',
40
  'menu_order' => 0,
41
  'comment_status' => 'closed'
42
- );
43
- $reply_data = bbp_parse_args( $reply_data, $default_reply, 'insert_reply' );
44
 
45
  // Insert reply
46
  $reply_id = wp_insert_post( $reply_data );
47
 
48
  // Bail if no reply was added
49
- if ( empty( $reply_id ) )
50
  return false;
 
51
 
52
  // Forum meta
53
- $default_meta = array(
54
  'author_ip' => bbp_current_author_ip(),
55
  'forum_id' => 0,
56
  'topic_id' => 0,
57
- );
58
- $reply_meta = bbp_parse_args( $reply_meta, $default_meta, 'insert_reply_meta' );
59
 
60
  // Insert reply meta
61
- foreach ( $reply_meta as $meta_key => $meta_value )
62
  update_post_meta( $reply_id, '_bbp_' . $meta_key, $meta_value );
 
63
 
64
  // Update the topic
65
  $topic_id = bbp_get_reply_topic_id( $reply_id );
66
- if ( !empty( $topic_id ) )
67
  bbp_update_topic( $topic_id );
 
68
 
69
  // Return new reply ID
70
  return $reply_id;
@@ -97,7 +98,8 @@ function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
97
  * @uses wp_set_post_terms() To set the topic tags
98
  * @uses wp_insert_post() To insert the reply
99
  * @uses do_action() Calls 'bbp_new_reply' with the reply id, topic id, forum
100
- * id, anonymous data and reply author
 
101
  * @uses bbp_get_reply_url() To get the paginated url to the reply
102
  * @uses wp_safe_redirect() To redirect to the reply url
103
  * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
@@ -116,7 +118,7 @@ function bbp_new_reply_handler( $action = '' ) {
116
  }
117
 
118
  // Define local variable(s)
119
- $topic_id = $forum_id = $reply_author = $anonymous_data = 0;
120
  $reply_title = $reply_content = $terms = '';
121
 
122
  /** Reply Author **********************************************************/
@@ -147,28 +149,119 @@ function bbp_new_reply_handler( $action = '' ) {
147
 
148
  /** Topic ID **************************************************************/
149
 
150
- // Handle Topic ID to append reply to
151
- if ( isset( $_POST['bbp_topic_id'] ) ) {
152
- $topic_id = (int) $_POST['bbp_topic_id'];
153
- } else {
154
  bbp_add_error( 'bbp_reply_topic_id', __( '<strong>ERROR</strong>: Topic ID is missing.', 'bbpress' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  }
156
 
157
  /** Forum ID **************************************************************/
158
 
159
- // Handle Forum ID to adjust counts of
160
- if ( isset( $_POST['bbp_forum_id'] ) ) {
161
- $forum_id = (int) $_POST['bbp_forum_id'];
162
- } elseif ( !empty( $topic_id ) ) {
163
  $forum_id = bbp_get_topic_forum_id( $topic_id );
164
- } else {
165
- bbp_add_error( 'bbp_reply_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  /** Unfiltered HTML *******************************************************/
169
 
170
  // Remove kses filters from title and content for capable users and if the nonce is verified
171
- if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $topic_id ) == $_POST['_bbp_unfiltered_html_reply'] ) {
172
  remove_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' );
173
  remove_filter( 'bbp_new_reply_pre_content', 'bbp_encode_bad', 10 );
174
  remove_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses', 30 );
@@ -294,7 +387,7 @@ function bbp_new_reply_handler( $action = '' ) {
294
 
295
  // If this reply starts as trash, add it to pre_trashed_replies
296
  // for the topic, so it is properly restored.
297
- if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] == bbp_get_trash_status_id() ) ) {
298
 
299
  // Trash the reply
300
  wp_trash_post( $reply_id );
@@ -315,7 +408,7 @@ function bbp_new_reply_handler( $action = '' ) {
315
  /** Spam Check ********************************************************/
316
 
317
  // If reply or topic are spam, officially spam this reply
318
- } elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] == bbp_get_spam_status_id() ) ) {
319
  add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
320
 
321
  // Only add to pre-spammed array if topic is spam
@@ -334,7 +427,7 @@ function bbp_new_reply_handler( $action = '' ) {
334
 
335
  /** Update counts, etc... *********************************************/
336
 
337
- do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author );
338
 
339
  /** Additional Actions (After Save) ***********************************/
340
 
@@ -391,8 +484,10 @@ function bbp_new_reply_handler( $action = '' ) {
391
  * @uses wp_update_post() To update the reply
392
  * @uses bbp_get_reply_topic_id() To get the reply topic id
393
  * @uses bbp_get_topic_forum_id() To get the topic forum id
 
394
  * @uses do_action() Calls 'bbp_edit_reply' with the reply id, topic id, forum
395
- * id, anonymous data, reply author and bool true (for edit)
 
396
  * @uses bbp_get_reply_url() To get the paginated url to the reply
397
  * @uses wp_safe_redirect() To redirect to the reply url
398
  * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
@@ -457,7 +552,7 @@ function bbp_edit_reply_handler( $action = '' ) {
457
  }
458
 
459
  // Remove kses filters from title and content for capable users and if the nonce is verified
460
- if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $reply_id ) == $_POST['_bbp_unfiltered_html_reply'] ) {
461
  remove_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' );
462
  remove_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad', 10 );
463
  remove_filter( 'bbp_edit_reply_pre_content', 'bbp_filter_kses', 30 );
@@ -471,24 +566,38 @@ function bbp_edit_reply_handler( $action = '' ) {
471
 
472
  $forum_id = bbp_get_topic_forum_id( $topic_id );
473
 
 
 
 
 
474
  // Forum exists
475
  if ( !empty( $forum_id ) && ( $forum_id !== bbp_get_reply_forum_id( $reply_id ) ) ) {
476
 
477
  // Forum is a category
478
- if ( bbp_is_forum_category( $forum_id ) )
479
- bbp_add_error( 'bbp_edit_reply_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No topics or replies can be created in it.', 'bbpress' ) );
480
 
481
- // Forum is closed and user cannot access
482
- if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) )
483
- bbp_add_error( 'bbp_edit_reply_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new topics and replies.', 'bbpress' ) );
484
 
485
- // Forum is private and user cannot access
486
- if ( bbp_is_forum_private( $forum_id ) && !current_user_can( 'read_private_forums' ) )
487
- bbp_add_error( 'bbp_edit_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) );
 
 
 
 
 
 
 
488
 
489
- // Forum is hidden and user cannot access
490
- if ( bbp_is_forum_hidden( $forum_id ) && !current_user_can( 'read_hidden_forums' ) )
491
- bbp_add_error( 'bbp_edit_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) );
 
 
 
 
492
  }
493
 
494
  /** Reply Title ***********************************************************/
@@ -522,7 +631,7 @@ function bbp_edit_reply_handler( $action = '' ) {
522
  if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
523
 
524
  // Set post status to pending if public
525
- if ( bbp_get_public_status_id() == $reply->post_status ) {
526
  $reply_status = bbp_get_pending_status_id();
527
  }
528
 
@@ -603,7 +712,7 @@ function bbp_edit_reply_handler( $action = '' ) {
603
  $reply_edit_reason = esc_attr( strip_tags( $_POST['bbp_reply_edit_reason'] ) );
604
 
605
  // Update revision log
606
- if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 == $_POST['bbp_log_reply_edit'] ) ) {
607
  $revision_id = wp_save_post_revision( $reply_id );
608
  if ( !empty( $revision_id ) ) {
609
  bbp_update_reply_revision_log( array(
@@ -620,7 +729,7 @@ function bbp_edit_reply_handler( $action = '' ) {
620
  if ( !empty( $reply_id ) && !is_wp_error( $reply_id ) ) {
621
 
622
  // Update counts, etc...
623
- do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true /* Is edit */ );
624
 
625
  /** Additional Actions (After Save) ***********************************/
626
 
@@ -662,6 +771,7 @@ function bbp_edit_reply_handler( $action = '' ) {
662
  * @param bool|array $anonymous_data Optional logged-out user data.
663
  * @param int $author_id Author id
664
  * @param bool $is_edit Optional. Is the post being edited? Defaults to false.
 
665
  * @uses bbp_get_reply_id() To get the reply id
666
  * @uses bbp_get_topic_id() To get the topic id
667
  * @uses bbp_get_forum_id() To get the forum id
@@ -678,14 +788,16 @@ function bbp_edit_reply_handler( $action = '' ) {
678
  * @uses bbp_add_user_subscription() To add the user's subscription
679
  * @uses bbp_update_reply_forum_id() To update the reply forum id
680
  * @uses bbp_update_reply_topic_id() To update the reply topic id
 
681
  * @uses bbp_update_reply_walker() To update the reply's ancestors' counts
682
  */
683
- function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false ) {
684
 
685
  // Validate the ID's passed from 'bbp_new_reply' action
686
  $reply_id = bbp_get_reply_id( $reply_id );
687
  $topic_id = bbp_get_topic_id( $topic_id );
688
  $forum_id = bbp_get_forum_id( $forum_id );
 
689
 
690
  // Bail if there is no reply
691
  if ( empty( $reply_id ) )
@@ -716,7 +828,7 @@ function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymo
716
  ), 'update_reply' );
717
 
718
  // Update all anonymous metas
719
- foreach( $r as $anon_key => $anon_value ) {
720
  update_post_meta( $reply_id, '_' . $anon_key, (string) $anon_value, false );
721
  }
722
 
@@ -734,14 +846,14 @@ function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymo
734
  // Handle Subscription Checkbox
735
  if ( bbp_is_subscriptions_active() && !empty( $author_id ) && !empty( $topic_id ) ) {
736
  $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
737
- $subscheck = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' == $_POST['bbp_topic_subscription'] ) ) ? true : false;
738
 
739
  // Subscribed and unsubscribing
740
- if ( true == $subscribed && false == $subscheck ) {
741
  bbp_remove_user_subscription( $author_id, $topic_id );
742
 
743
  // Subscribing
744
- } elseif ( false == $subscribed && true == $subscheck ) {
745
  bbp_add_user_subscription( $author_id, $topic_id );
746
  }
747
  }
@@ -749,6 +861,7 @@ function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymo
749
  // Reply meta relating to reply position in tree
750
  bbp_update_reply_forum_id( $reply_id, $forum_id );
751
  bbp_update_reply_topic_id( $reply_id, $topic_id );
 
752
 
753
  // Update associated topic values if this is a new reply
754
  if ( empty( $is_edit ) ) {
@@ -824,7 +937,7 @@ function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id =
824
  $ancestors = array_values( array_unique( array_merge( array( $topic_id, $forum_id ), (array) get_post_ancestors( $topic_id ) ) ) );
825
 
826
  // If we want a full refresh, unset any of the possibly passed variables
827
- if ( true == $refresh )
828
  $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
829
 
830
  // Walk up ancestors
@@ -921,7 +1034,7 @@ function bbp_update_reply_forum_id( $reply_id = 0, $forum_id = 0 ) {
921
  foreach ( $ancestors as $ancestor ) {
922
 
923
  // Get first parent that is a forum
924
- if ( get_post_field( 'post_type', $ancestor ) == bbp_get_forum_post_type() ) {
925
  $forum_id = $ancestor;
926
 
927
  // Found a forum, so exit the loop and continue
@@ -970,7 +1083,7 @@ function bbp_update_reply_topic_id( $reply_id = 0, $topic_id = 0 ) {
970
  foreach ( $ancestors as $ancestor ) {
971
 
972
  // Get first parent that is a forum
973
- if ( get_post_field( 'post_type', $ancestor ) == bbp_get_topic_post_type() ) {
974
  $topic_id = $ancestor;
975
 
976
  // Found a forum, so exit the loop and continue
@@ -986,6 +1099,41 @@ function bbp_update_reply_topic_id( $reply_id = 0, $topic_id = 0 ) {
986
  return apply_filters( 'bbp_update_reply_topic_id', (int) $topic_id, $reply_id );
987
  }
988
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
989
  /**
990
  * Update the revision log of the reply
991
  *
@@ -1145,21 +1293,18 @@ function bbp_move_reply_handler( $action = '' ) {
1145
  bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>ERROR</strong>: You do not have the permissions to edit the destination topic!', 'bbpress' ) );
1146
  }
1147
 
1148
- // Reply position
1149
  $reply_position = bbp_get_topic_reply_count( $destination_topic->ID ) + 1;
1150
 
1151
- // New reply data
1152
- $postarr = array(
1153
- 'ID' => $move_reply->ID,
1154
- 'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
1155
- 'post_name' => false, // will be automatically generated
1156
- 'post_parent' => $destination_topic->ID,
1157
- 'post_position' => $reply_position,
1158
- 'guid' => ''
1159
- );
1160
-
1161
  // Update the reply
1162
- wp_update_post( $postarr );
 
 
 
 
 
 
 
1163
 
1164
  // Adjust reply meta values
1165
  bbp_update_reply_topic_id( $move_reply->ID, $destination_topic->ID );
@@ -1183,25 +1328,22 @@ function bbp_move_reply_handler( $action = '' ) {
1183
  $destination_topic_title = $source_topic->post_title;
1184
  }
1185
 
1186
- // Setup the updated topic parameters
1187
- $postarr = array(
1188
  'ID' => $move_reply->ID,
1189
  'post_title' => $destination_topic_title,
1190
  'post_name' => false,
1191
  'post_type' => bbp_get_topic_post_type(),
1192
  'post_parent' => $source_topic->post_parent,
1193
  'guid' => ''
1194
- );
1195
-
1196
- // Update the topic
1197
- $destination_topic_id = wp_update_post( $postarr );
1198
- $destination_topic = bbp_get_topic( $destination_topic_id );
1199
 
1200
  // Make sure the new topic knows its a topic
1201
  bbp_update_topic_topic_id( $move_reply->ID );
1202
 
1203
  // Shouldn't happen
1204
- if ( false == $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
1205
  bbp_add_error( 'bbp_move_reply_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
1206
  }
1207
 
@@ -1232,23 +1374,36 @@ function bbp_move_reply_handler( $action = '' ) {
1232
  // Set destination topic post_date to 1 second before from reply
1233
  $destination_post_date = date( 'Y-m-d H:i:s', strtotime( $move_reply->post_date ) - 1 );
1234
 
1235
- $postarr = array(
 
1236
  'ID' => $destination_topic_id,
1237
  'post_date' => $destination_post_date,
1238
  'post_date_gmt' => get_gmt_from_date( $destination_post_date )
1239
- );
1240
-
1241
- // Update destination topic
1242
- wp_update_post( $postarr );
1243
  }
1244
 
1245
  // Set the last reply ID and freshness to the move_reply
1246
  $last_reply_id = $move_reply->ID;
1247
  $freshness = $move_reply->post_date;
1248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1249
  // It is a new topic and we need to set some default metas to make
1250
  // the topic display in bbp_has_topics() list
1251
- if ( 'topic' == $move_option ) {
1252
  bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id );
1253
  bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id );
1254
  bbp_update_topic_last_active_time( $destination_topic->ID, $freshness );
@@ -1375,7 +1530,7 @@ function bbp_toggle_reply_handler( $action = '' ) {
1375
  return;
1376
 
1377
  // What is the user doing here?
1378
- if ( !current_user_can( 'edit_reply', $reply->ID ) || ( 'bbp_toggle_reply_trash' == $action && !current_user_can( 'delete_reply', $reply->ID ) ) ) {
1379
  bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that!', 'bbpress' ) );
1380
  return;
1381
  }
@@ -1436,7 +1591,7 @@ function bbp_toggle_reply_handler( $action = '' ) {
1436
  do_action( 'bbp_toggle_reply_handler', $success, $post_data, $action );
1437
 
1438
  // No errors
1439
- if ( ( false != $success ) && !is_wp_error( $success ) ) {
1440
 
1441
  /** Redirect **********************************************************/
1442
 
@@ -1470,38 +1625,38 @@ function bbp_toggle_reply_handler( $action = '' ) {
1470
  * @since bbPress (r2740)
1471
  *
1472
  * @param int $reply_id Reply id
1473
- * @uses get_post() To get the reply
1474
  * @uses do_action() Calls 'bbp_spam_reply' with the reply ID
1475
  * @uses add_post_meta() To add the previous status to a meta
1476
- * @uses wp_insert_post() To insert the updated post
1477
  * @uses do_action() Calls 'bbp_spammed_reply' with the reply ID
1478
  * @return mixed False or {@link WP_Error} on failure, reply id on success
1479
  */
1480
  function bbp_spam_reply( $reply_id = 0 ) {
1481
 
1482
  // Get reply
1483
- $reply = get_post( $reply_id, ARRAY_A );
1484
  if ( empty( $reply ) )
1485
  return $reply;
1486
 
1487
  // Bail if already spam
1488
- if ( bbp_get_spam_status_id() == $reply['post_status'] )
1489
  return false;
1490
 
1491
  // Execute pre spam code
1492
  do_action( 'bbp_spam_reply', $reply_id );
1493
 
1494
  // Add the original post status as post meta for future restoration
1495
- add_post_meta( $reply_id, '_bbp_spam_meta_status', $reply['post_status'] );
1496
 
1497
  // Set post status to spam
1498
- $reply['post_status'] = bbp_get_spam_status_id();
1499
 
1500
  // No revisions
1501
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
1502
 
1503
  // Update the reply
1504
- $reply_id = wp_insert_post( $reply );
1505
 
1506
  // Execute post spam code
1507
  do_action( 'bbp_spammed_reply', $reply_id );
@@ -1516,34 +1671,34 @@ function bbp_spam_reply( $reply_id = 0 ) {
1516
  * @since bbPress (r2740)
1517
  *
1518
  * @param int $reply_id Reply id
1519
- * @uses get_post() To get the reply
1520
  * @uses do_action() Calls 'bbp_unspam_reply' with the reply ID
1521
  * @uses get_post_meta() To get the previous status meta
1522
  * @uses delete_post_meta() To delete the previous status meta
1523
- * @uses wp_insert_post() To insert the updated post
1524
  * @uses do_action() Calls 'bbp_unspammed_reply' with the reply ID
1525
  * @return mixed False or {@link WP_Error} on failure, reply id on success
1526
  */
1527
  function bbp_unspam_reply( $reply_id = 0 ) {
1528
 
1529
  // Get reply
1530
- $reply = get_post( $reply_id, ARRAY_A );
1531
  if ( empty( $reply ) )
1532
  return $reply;
1533
 
1534
  // Bail if already not spam
1535
- if ( bbp_get_spam_status_id() != $reply['post_status'] )
1536
  return false;
1537
 
1538
  // Execute pre unspam code
1539
  do_action( 'bbp_unspam_reply', $reply_id );
1540
 
1541
  // Get pre spam status
1542
- $reply['post_status'] = get_post_meta( $reply_id, '_bbp_spam_meta_status', true );
1543
 
1544
  // If no previous status, default to publish
1545
- if ( empty( $reply['post_status'] ) ) {
1546
- $reply['post_status'] = bbp_get_public_status_id();
1547
  }
1548
 
1549
  // Delete pre spam meta
@@ -1553,7 +1708,7 @@ function bbp_unspam_reply( $reply_id = 0 ) {
1553
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
1554
 
1555
  // Update the reply
1556
- $reply_id = wp_insert_post( $reply );
1557
 
1558
  // Execute post unspam code
1559
  do_action( 'bbp_unspammed_reply', $reply_id );
@@ -1754,7 +1909,7 @@ function _bbp_has_replies_where( $where = '', $query = false ) {
1754
  }
1755
 
1756
  // Bail if not a topic and reply query
1757
- if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) != $query->get( 'post_type' ) ) {
1758
  return $where;
1759
  }
1760
 
@@ -1987,8 +2142,10 @@ function bbp_update_reply_position( $reply_id = 0, $reply_position = 0 ) {
1987
  }
1988
 
1989
  // Update the replies' 'menp_order' with the reply position
1990
- global $wpdb;
1991
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $reply_position ), array( 'ID' => $reply_id ) );
 
 
1992
 
1993
  return (int) $reply_position;
1994
  }
@@ -2010,7 +2167,7 @@ function bbp_get_reply_position_raw( $reply_id = 0, $topic_id = 0 ) {
2010
  $reply_position = 0;
2011
 
2012
  // If reply is actually the first post in a topic, return 0
2013
- if ( $reply_id != $topic_id ) {
2014
 
2015
  // Make sure the topic has replies before running another query
2016
  $reply_count = bbp_get_topic_reply_count( $topic_id, false );
@@ -2032,3 +2189,36 @@ function bbp_get_reply_position_raw( $reply_id = 0, $topic_id = 0 ) {
2032
 
2033
  return (int) $reply_position;
2034
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
30
 
31
  // Forum
32
+ $reply_data = bbp_parse_args( $reply_data, array(
33
  'post_parent' => 0, // topic ID
34
  'post_status' => bbp_get_public_status_id(),
35
  'post_type' => bbp_get_reply_post_type(),
39
  'post_title' => '',
40
  'menu_order' => 0,
41
  'comment_status' => 'closed'
42
+ ), 'insert_reply' );
 
43
 
44
  // Insert reply
45
  $reply_id = wp_insert_post( $reply_data );
46
 
47
  // Bail if no reply was added
48
+ if ( empty( $reply_id ) ) {
49
  return false;
50
+ }
51
 
52
  // Forum meta
53
+ $reply_meta = bbp_parse_args( $reply_meta, array(
54
  'author_ip' => bbp_current_author_ip(),
55
  'forum_id' => 0,
56
  'topic_id' => 0,
57
+ ), 'insert_reply_meta' );
 
58
 
59
  // Insert reply meta
60
+ foreach ( $reply_meta as $meta_key => $meta_value ) {
61
  update_post_meta( $reply_id, '_bbp_' . $meta_key, $meta_value );
62
+ }
63
 
64
  // Update the topic
65
  $topic_id = bbp_get_reply_topic_id( $reply_id );
66
+ if ( !empty( $topic_id ) ) {
67
  bbp_update_topic( $topic_id );
68
+ }
69
 
70
  // Return new reply ID
71
  return $reply_id;
98
  * @uses wp_set_post_terms() To set the topic tags
99
  * @uses wp_insert_post() To insert the reply
100
  * @uses do_action() Calls 'bbp_new_reply' with the reply id, topic id, forum
101
+ * id, anonymous data, reply author, edit (false), and
102
+ * the reply to id
103
  * @uses bbp_get_reply_url() To get the paginated url to the reply
104
  * @uses wp_safe_redirect() To redirect to the reply url
105
  * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
118
  }
119
 
120
  // Define local variable(s)
121
+ $topic_id = $forum_id = $reply_author = $anonymous_data = $reply_to = 0;
122
  $reply_title = $reply_content = $terms = '';
123
 
124
  /** Reply Author **********************************************************/
149
 
150
  /** Topic ID **************************************************************/
151
 
152
+ // Topic id was not passed
153
+ if ( empty( $_POST['bbp_topic_id'] ) ) {
 
 
154
  bbp_add_error( 'bbp_reply_topic_id', __( '<strong>ERROR</strong>: Topic ID is missing.', 'bbpress' ) );
155
+
156
+ // Topic id is not a number
157
+ } elseif ( ! is_numeric( $_POST['bbp_topic_id'] ) ) {
158
+ bbp_add_error( 'bbp_reply_topic_id', __( '<strong>ERROR</strong>: Topic ID must be a number.', 'bbpress' ) );
159
+
160
+ // Topic id might be valid
161
+ } else {
162
+
163
+ // Get the topic id
164
+ $posted_topic_id = intval( $_POST['bbp_topic_id'] );
165
+
166
+ // Topic id is a negative number
167
+ if ( 0 > $posted_topic_id ) {
168
+ bbp_add_error( 'bbp_reply_topic_id', __( '<strong>ERROR</strong>: Topic ID cannot be a negative number.', 'bbpress' ) );
169
+
170
+ // Topic does not exist
171
+ } elseif ( ! bbp_get_topic( $posted_topic_id ) ) {
172
+ bbp_add_error( 'bbp_reply_topic_id', __( '<strong>ERROR</strong>: Topic does not exist.', 'bbpress' ) );
173
+
174
+ // Use the POST'ed topic id
175
+ } else {
176
+ $topic_id = $posted_topic_id;
177
+ }
178
  }
179
 
180
  /** Forum ID **************************************************************/
181
 
182
+ // Try to use the forum id of the topic
183
+ if ( !isset( $_POST['bbp_forum_id'] ) && !empty( $topic_id ) ) {
 
 
184
  $forum_id = bbp_get_topic_forum_id( $topic_id );
185
+
186
+ // Error check the POST'ed forum id
187
+ } elseif ( isset( $_POST['bbp_forum_id'] ) ) {
188
+
189
+ // Empty Forum id was passed
190
+ if ( empty( $_POST['bbp_forum_id'] ) ) {
191
+ bbp_add_error( 'bbp_reply_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
192
+
193
+ // Forum id is not a number
194
+ } elseif ( ! is_numeric( $_POST['bbp_forum_id'] ) ) {
195
+ bbp_add_error( 'bbp_reply_forum_id', __( '<strong>ERROR</strong>: Forum ID must be a number.', 'bbpress' ) );
196
+
197
+ // Forum id might be valid
198
+ } else {
199
+
200
+ // Get the forum id
201
+ $posted_forum_id = intval( $_POST['bbp_forum_id'] );
202
+
203
+ // Forum id is empty
204
+ if ( 0 === $posted_forum_id ) {
205
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
206
+
207
+ // Forum id is a negative number
208
+ } elseif ( 0 > $posted_forum_id ) {
209
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID cannot be a negative number.', 'bbpress' ) );
210
+
211
+ // Forum does not exist
212
+ } elseif ( ! bbp_get_forum( $posted_forum_id ) ) {
213
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum does not exist.', 'bbpress' ) );
214
+
215
+ // Use the POST'ed forum id
216
+ } else {
217
+ $forum_id = $posted_forum_id;
218
+ }
219
+ }
220
  }
221
 
222
+ // Forum exists
223
+ if ( !empty( $forum_id ) ) {
224
+
225
+ // Forum is a category
226
+ if ( bbp_is_forum_category( $forum_id ) ) {
227
+ bbp_add_error( 'bbp_new_reply_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No replies can be created in this forum.', 'bbpress' ) );
228
+
229
+ // Forum is not a category
230
+ } else {
231
+
232
+ // Forum is closed and user cannot access
233
+ if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) ) {
234
+ bbp_add_error( 'bbp_new_reply_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new replies.', 'bbpress' ) );
235
+ }
236
+
237
+ // Forum is private and user cannot access
238
+ if ( bbp_is_forum_private( $forum_id ) ) {
239
+ if ( !current_user_can( 'read_private_forums' ) ) {
240
+ bbp_add_error( 'bbp_new_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) );
241
+ }
242
+
243
+ // Forum is hidden and user cannot access
244
+ } elseif ( bbp_is_forum_hidden( $forum_id ) ) {
245
+ if ( !current_user_can( 'read_hidden_forums' ) ) {
246
+ bbp_add_error( 'bbp_new_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) );
247
+ }
248
+ }
249
+ }
250
+ }
251
+
252
+ /** Reply To **************************************************************/
253
+
254
+ // Handle Reply To of the reply; $_REQUEST for non-JS submissions
255
+ if ( isset( $_REQUEST['bbp_reply_to'] ) ) {
256
+ $reply_to = (int) $_REQUEST['bbp_reply_to'];
257
+ }
258
+
259
+ $reply_to = bbp_get_reply_id( $reply_to );
260
+
261
  /** Unfiltered HTML *******************************************************/
262
 
263
  // Remove kses filters from title and content for capable users and if the nonce is verified
264
+ if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $topic_id ) === $_POST['_bbp_unfiltered_html_reply'] ) {
265
  remove_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' );
266
  remove_filter( 'bbp_new_reply_pre_content', 'bbp_encode_bad', 10 );
267
  remove_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses', 30 );
387
 
388
  // If this reply starts as trash, add it to pre_trashed_replies
389
  // for the topic, so it is properly restored.
390
+ if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] === bbp_get_trash_status_id() ) ) {
391
 
392
  // Trash the reply
393
  wp_trash_post( $reply_id );
408
  /** Spam Check ********************************************************/
409
 
410
  // If reply or topic are spam, officially spam this reply
411
+ } elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] === bbp_get_spam_status_id() ) ) {
412
  add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
413
 
414
  // Only add to pre-spammed array if topic is spam
427
 
428
  /** Update counts, etc... *********************************************/
429
 
430
+ do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, false, $reply_to );
431
 
432
  /** Additional Actions (After Save) ***********************************/
433
 
484
  * @uses wp_update_post() To update the reply
485
  * @uses bbp_get_reply_topic_id() To get the reply topic id
486
  * @uses bbp_get_topic_forum_id() To get the topic forum id
487
+ * @uses bbp_get_reply_to() To get the reply to id
488
  * @uses do_action() Calls 'bbp_edit_reply' with the reply id, topic id, forum
489
+ * id, anonymous data, reply author, bool true (for edit),
490
+ * and the reply to id
491
  * @uses bbp_get_reply_url() To get the paginated url to the reply
492
  * @uses wp_safe_redirect() To redirect to the reply url
493
  * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
552
  }
553
 
554
  // Remove kses filters from title and content for capable users and if the nonce is verified
555
+ if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $reply_id ) === $_POST['_bbp_unfiltered_html_reply'] ) {
556
  remove_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' );
557
  remove_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad', 10 );
558
  remove_filter( 'bbp_edit_reply_pre_content', 'bbp_filter_kses', 30 );
566
 
567
  $forum_id = bbp_get_topic_forum_id( $topic_id );
568
 
569
+ /** Reply To **************************************************************/
570
+
571
+ $reply_to = bbp_get_reply_to( $reply_id );
572
+
573
  // Forum exists
574
  if ( !empty( $forum_id ) && ( $forum_id !== bbp_get_reply_forum_id( $reply_id ) ) ) {
575
 
576
  // Forum is a category
577
+ if ( bbp_is_forum_category( $forum_id ) ) {
578
+ bbp_add_error( 'bbp_edit_reply_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No replies can be created in this forum.', 'bbpress' ) );
579
 
580
+ // Forum is not a category
581
+ } else {
 
582
 
583
+ // Forum is closed and user cannot access
584
+ if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) ) {
585
+ bbp_add_error( 'bbp_edit_reply_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new replies.', 'bbpress' ) );
586
+ }
587
+
588
+ // Forum is private and user cannot access
589
+ if ( bbp_is_forum_private( $forum_id ) ) {
590
+ if ( !current_user_can( 'read_private_forums' ) ) {
591
+ bbp_add_error( 'bbp_edit_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) );
592
+ }
593
 
594
+ // Forum is hidden and user cannot access
595
+ } elseif ( bbp_is_forum_hidden( $forum_id ) ) {
596
+ if ( !current_user_can( 'read_hidden_forums' ) ) {
597
+ bbp_add_error( 'bbp_edit_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) );
598
+ }
599
+ }
600
+ }
601
  }
602
 
603
  /** Reply Title ***********************************************************/
631
  if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
632
 
633
  // Set post status to pending if public
634
+ if ( bbp_get_public_status_id() === $reply->post_status ) {
635
  $reply_status = bbp_get_pending_status_id();
636
  }
637
 
712
  $reply_edit_reason = esc_attr( strip_tags( $_POST['bbp_reply_edit_reason'] ) );
713
 
714
  // Update revision log
715
+ if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) {
716
  $revision_id = wp_save_post_revision( $reply_id );
717
  if ( !empty( $revision_id ) ) {
718
  bbp_update_reply_revision_log( array(
729
  if ( !empty( $reply_id ) && !is_wp_error( $reply_id ) ) {
730
 
731
  // Update counts, etc...
732
+ do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true, $reply_to );
733
 
734
  /** Additional Actions (After Save) ***********************************/
735
 
771
  * @param bool|array $anonymous_data Optional logged-out user data.
772
  * @param int $author_id Author id
773
  * @param bool $is_edit Optional. Is the post being edited? Defaults to false.
774
+ * @param int $reply_to Optional. Reply to id
775
  * @uses bbp_get_reply_id() To get the reply id
776
  * @uses bbp_get_topic_id() To get the topic id
777
  * @uses bbp_get_forum_id() To get the forum id
788
  * @uses bbp_add_user_subscription() To add the user's subscription
789
  * @uses bbp_update_reply_forum_id() To update the reply forum id
790
  * @uses bbp_update_reply_topic_id() To update the reply topic id
791
+ * @uses bbp_update_reply_to() To update the reply to id
792
  * @uses bbp_update_reply_walker() To update the reply's ancestors' counts
793
  */
794
+ function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false, $reply_to = 0 ) {
795
 
796
  // Validate the ID's passed from 'bbp_new_reply' action
797
  $reply_id = bbp_get_reply_id( $reply_id );
798
  $topic_id = bbp_get_topic_id( $topic_id );
799
  $forum_id = bbp_get_forum_id( $forum_id );
800
+ $reply_to = bbp_get_reply_id( $reply_to );
801
 
802
  // Bail if there is no reply
803
  if ( empty( $reply_id ) )
828
  ), 'update_reply' );
829
 
830
  // Update all anonymous metas
831
+ foreach ( $r as $anon_key => $anon_value ) {
832
  update_post_meta( $reply_id, '_' . $anon_key, (string) $anon_value, false );
833
  }
834
 
846
  // Handle Subscription Checkbox
847
  if ( bbp_is_subscriptions_active() && !empty( $author_id ) && !empty( $topic_id ) ) {
848
  $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
849
+ $subscheck = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) ) ? true : false;
850
 
851
  // Subscribed and unsubscribing
852
+ if ( true === $subscribed && false === $subscheck ) {
853
  bbp_remove_user_subscription( $author_id, $topic_id );
854
 
855
  // Subscribing
856
+ } elseif ( false === $subscribed && true === $subscheck ) {
857
  bbp_add_user_subscription( $author_id, $topic_id );
858
  }
859
  }
861
  // Reply meta relating to reply position in tree
862
  bbp_update_reply_forum_id( $reply_id, $forum_id );
863
  bbp_update_reply_topic_id( $reply_id, $topic_id );
864
+ bbp_update_reply_to ( $reply_id, $reply_to );
865
 
866
  // Update associated topic values if this is a new reply
867
  if ( empty( $is_edit ) ) {
937
  $ancestors = array_values( array_unique( array_merge( array( $topic_id, $forum_id ), (array) get_post_ancestors( $topic_id ) ) ) );
938
 
939
  // If we want a full refresh, unset any of the possibly passed variables
940
+ if ( true === $refresh )
941
  $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
942
 
943
  // Walk up ancestors
1034
  foreach ( $ancestors as $ancestor ) {
1035
 
1036
  // Get first parent that is a forum
1037
+ if ( get_post_field( 'post_type', $ancestor ) === bbp_get_forum_post_type() ) {
1038
  $forum_id = $ancestor;
1039
 
1040
  // Found a forum, so exit the loop and continue
1083
  foreach ( $ancestors as $ancestor ) {
1084
 
1085
  // Get first parent that is a forum
1086
+ if ( get_post_field( 'post_type', $ancestor ) === bbp_get_topic_post_type() ) {
1087
  $topic_id = $ancestor;
1088
 
1089
  // Found a forum, so exit the loop and continue
1099
  return apply_filters( 'bbp_update_reply_topic_id', (int) $topic_id, $reply_id );
1100
  }
1101
 
1102
+ /*
1103
+ * Update the reply's meta data with its reply to id
1104
+ *
1105
+ * @since bbPress (r4944)
1106
+ *
1107
+ * @param int $reply_id Reply id to update
1108
+ * @param int $reply_to Optional. Reply to id
1109
+ * @uses bbp_get_reply_id() To get the reply id
1110
+ * @uses update_post_meta() To update the reply to meta
1111
+ * @uses apply_filters() Calls 'bbp_update_reply_to' with the reply id and
1112
+ * and reply to id
1113
+ * @return bool Reply's parent reply id
1114
+ */
1115
+ function bbp_update_reply_to( $reply_id = 0, $reply_to = 0 ) {
1116
+
1117
+ // Validation
1118
+ $reply_id = bbp_get_reply_id( $reply_id );
1119
+ $reply_to = bbp_get_reply_id( $reply_to );
1120
+
1121
+ // Return if no reply
1122
+ if ( empty( $reply_id ) )
1123
+ return;
1124
+
1125
+ // Set the reply to
1126
+ if ( !empty( $reply_to ) ) {
1127
+ update_post_meta( $reply_id, '_bbp_reply_to', $reply_to );
1128
+
1129
+ // Delete the reply to
1130
+ } else {
1131
+ delete_post_meta( $reply_id, '_bbp_reply_to' );
1132
+ }
1133
+
1134
+ return (int) apply_filters( 'bbp_update_reply_to', (int) $reply_to, $reply_id );
1135
+ }
1136
+
1137
  /**
1138
  * Update the revision log of the reply
1139
  *
1293
  bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>ERROR</strong>: You do not have the permissions to edit the destination topic!', 'bbpress' ) );
1294
  }
1295
 
1296
+ // Bump the reply position
1297
  $reply_position = bbp_get_topic_reply_count( $destination_topic->ID ) + 1;
1298
 
 
 
 
 
 
 
 
 
 
 
1299
  // Update the reply
1300
+ wp_update_post( array(
1301
+ 'ID' => $move_reply->ID,
1302
+ 'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
1303
+ 'post_name' => false, // will be automatically generated
1304
+ 'post_parent' => $destination_topic->ID,
1305
+ 'menu_order' => $reply_position,
1306
+ 'guid' => ''
1307
+ ) );
1308
 
1309
  // Adjust reply meta values
1310
  bbp_update_reply_topic_id( $move_reply->ID, $destination_topic->ID );
1328
  $destination_topic_title = $source_topic->post_title;
1329
  }
1330
 
1331
+ // Update the topic
1332
+ $destination_topic_id = wp_update_post( array(
1333
  'ID' => $move_reply->ID,
1334
  'post_title' => $destination_topic_title,
1335
  'post_name' => false,
1336
  'post_type' => bbp_get_topic_post_type(),
1337
  'post_parent' => $source_topic->post_parent,
1338
  'guid' => ''
1339
+ ) );
1340
+ $destination_topic = bbp_get_topic( $destination_topic_id );
 
 
 
1341
 
1342
  // Make sure the new topic knows its a topic
1343
  bbp_update_topic_topic_id( $move_reply->ID );
1344
 
1345
  // Shouldn't happen
1346
+ if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
1347
  bbp_add_error( 'bbp_move_reply_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
1348
  }
1349
 
1374
  // Set destination topic post_date to 1 second before from reply
1375
  $destination_post_date = date( 'Y-m-d H:i:s', strtotime( $move_reply->post_date ) - 1 );
1376
 
1377
+ // Update destination topic
1378
+ wp_update_post( array(
1379
  'ID' => $destination_topic_id,
1380
  'post_date' => $destination_post_date,
1381
  'post_date_gmt' => get_gmt_from_date( $destination_post_date )
1382
+ ) );
 
 
 
1383
  }
1384
 
1385
  // Set the last reply ID and freshness to the move_reply
1386
  $last_reply_id = $move_reply->ID;
1387
  $freshness = $move_reply->post_date;
1388
 
1389
+ // Get the reply to
1390
+ $parent = bbp_get_reply_to( $move_reply->ID );
1391
+
1392
+ // Fix orphaned children
1393
+ $children = get_posts( array(
1394
+ 'post_type' => bbp_get_reply_post_type(),
1395
+ 'meta_key' => '_bbp_reply_to',
1396
+ 'meta_value' => $move_reply->ID,
1397
+ ) );
1398
+ foreach ( $children as $child )
1399
+ bbp_update_reply_to( $child->ID, $parent );
1400
+
1401
+ // Remove reply_to from moved reply
1402
+ delete_post_meta( $move_reply->ID, '_bbp_reply_to' );
1403
+
1404
  // It is a new topic and we need to set some default metas to make
1405
  // the topic display in bbp_has_topics() list
1406
+ if ( 'topic' === $move_option ) {
1407
  bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id );
1408
  bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id );
1409
  bbp_update_topic_last_active_time( $destination_topic->ID, $freshness );
1530
  return;
1531
 
1532
  // What is the user doing here?
1533
+ if ( !current_user_can( 'edit_reply', $reply->ID ) || ( 'bbp_toggle_reply_trash' === $action && !current_user_can( 'delete_reply', $reply->ID ) ) ) {
1534
  bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that!', 'bbpress' ) );
1535
  return;
1536
  }
1591
  do_action( 'bbp_toggle_reply_handler', $success, $post_data, $action );
1592
 
1593
  // No errors
1594
+ if ( ( false !== $success ) && !is_wp_error( $success ) ) {
1595
 
1596
  /** Redirect **********************************************************/
1597
 
1625
  * @since bbPress (r2740)
1626
  *
1627
  * @param int $reply_id Reply id
1628
+ * @uses bbp_get_reply() To get the reply
1629
  * @uses do_action() Calls 'bbp_spam_reply' with the reply ID
1630
  * @uses add_post_meta() To add the previous status to a meta
1631
+ * @uses wp_update_post() To insert the updated post
1632
  * @uses do_action() Calls 'bbp_spammed_reply' with the reply ID
1633
  * @return mixed False or {@link WP_Error} on failure, reply id on success
1634
  */
1635
  function bbp_spam_reply( $reply_id = 0 ) {
1636
 
1637
  // Get reply
1638
+ $reply = bbp_get_reply( $reply_id );
1639
  if ( empty( $reply ) )
1640
  return $reply;
1641
 
1642
  // Bail if already spam
1643
+ if ( bbp_get_spam_status_id() === $reply->post_status )
1644
  return false;
1645
 
1646
  // Execute pre spam code
1647
  do_action( 'bbp_spam_reply', $reply_id );
1648
 
1649
  // Add the original post status as post meta for future restoration
1650
+ add_post_meta( $reply_id, '_bbp_spam_meta_status', $reply->post_status );
1651
 
1652
  // Set post status to spam
1653
+ $reply->post_status = bbp_get_spam_status_id();
1654
 
1655
  // No revisions
1656
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
1657
 
1658
  // Update the reply
1659
+ $reply_id = wp_update_post( $reply );
1660
 
1661
  // Execute post spam code
1662
  do_action( 'bbp_spammed_reply', $reply_id );
1671
  * @since bbPress (r2740)
1672
  *
1673
  * @param int $reply_id Reply id
1674
+ * @uses bbp_get_reply() To get the reply
1675
  * @uses do_action() Calls 'bbp_unspam_reply' with the reply ID
1676
  * @uses get_post_meta() To get the previous status meta
1677
  * @uses delete_post_meta() To delete the previous status meta
1678
+ * @uses wp_update_post() To insert the updated post
1679
  * @uses do_action() Calls 'bbp_unspammed_reply' with the reply ID
1680
  * @return mixed False or {@link WP_Error} on failure, reply id on success
1681
  */
1682
  function bbp_unspam_reply( $reply_id = 0 ) {
1683
 
1684
  // Get reply
1685
+ $reply = bbp_get_reply( $reply_id );
1686
  if ( empty( $reply ) )
1687
  return $reply;
1688
 
1689
  // Bail if already not spam
1690
+ if ( bbp_get_spam_status_id() !== $reply->post_status )
1691
  return false;
1692
 
1693
  // Execute pre unspam code
1694
  do_action( 'bbp_unspam_reply', $reply_id );
1695
 
1696
  // Get pre spam status
1697
+ $reply->post_status = get_post_meta( $reply_id, '_bbp_spam_meta_status', true );
1698
 
1699
  // If no previous status, default to publish
1700
+ if ( empty( $reply->post_status ) ) {
1701
+ $reply->post_status = bbp_get_public_status_id();
1702
  }
1703
 
1704
  // Delete pre spam meta
1708
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
1709
 
1710
  // Update the reply
1711
+ $reply_id = wp_update_post( $reply );
1712
 
1713
  // Execute post unspam code
1714
  do_action( 'bbp_unspammed_reply', $reply_id );
1909
  }
1910
 
1911
  // Bail if not a topic and reply query
1912
+ if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) !== $query->get( 'post_type' ) ) {
1913
  return $where;
1914
  }
1915
 
2142
  }
2143
 
2144
  // Update the replies' 'menp_order' with the reply position
2145
+ wp_update_post( array(
2146
+ 'ID' => $reply_id,
2147
+ 'menu_order' => $reply_position
2148
+ ) );
2149
 
2150
  return (int) $reply_position;
2151
  }
2167
  $reply_position = 0;
2168
 
2169
  // If reply is actually the first post in a topic, return 0
2170
+ if ( $reply_id !== $topic_id ) {
2171
 
2172
  // Make sure the topic has replies before running another query
2173
  $reply_count = bbp_get_topic_reply_count( $topic_id, false );
2189
 
2190
  return (int) $reply_position;
2191
  }
2192
+
2193
+ /** Hierarchical Replies ******************************************************/
2194
+
2195
+ /**
2196
+ * List replies
2197
+ *
2198
+ * @since bbPress (r4944)
2199
+ */
2200
+ function bbp_list_replies( $args = array() ) {
2201
+
2202
+ // Reset the reply depth
2203
+ bbpress()->reply_query->reply_depth = 0;
2204
+
2205
+ // In reply loop
2206
+ bbpress()->reply_query->in_the_loop = true;
2207
+
2208
+ $r = bbp_parse_args( $args, array(
2209
+ 'walker' => null,
2210
+ 'max_depth' => bbp_thread_replies_depth(),
2211
+ 'style' => 'ul',
2212
+ 'callback' => null,
2213
+ 'end_callback' => null,
2214
+ 'page' => 1,
2215
+ 'per_page' => -1
2216
+ ), 'list_replies' );
2217
+
2218
+ // Get replies to loop through in $_replies
2219
+ $walker = new BBP_Walker_Reply;
2220
+ $walker->paged_walk( bbpress()->reply_query->posts, $r['max_depth'], $r['page'], $r['per_page'], $r );
2221
+
2222
+ bbpress()->max_num_pages = $walker->max_pages;
2223
+ bbpress()->reply_query->in_the_loop = false;
2224
+ }
includes/replies/{template-tags.php → template.php} RENAMED
@@ -68,19 +68,22 @@ function bbp_has_replies( $args = '' ) {
68
  /** Defaults **************************************************************/
69
 
70
  // Other defaults
71
- $default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false;
72
- $default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
73
- $default_post_type = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
 
74
 
75
  // Default query args
76
  $default = array(
77
- 'post_type' => $default_post_type, // Only replies
78
- 'post_parent' => $default_post_parent, // Of this topic
79
- 'posts_per_page' => bbp_get_replies_per_page(), // This many
80
- 'paged' => bbp_get_paged(), // On this page
81
- 'orderby' => 'date', // Sorted by date
82
- 'order' => 'ASC', // Oldest to newest
83
- 's' => $default_reply_search, // Maybe search
 
 
84
  );
85
 
86
  // What are the default allowed statuses (based on user caps)
@@ -100,7 +103,7 @@ function bbp_has_replies( $args = '' ) {
100
  }
101
 
102
  // Join post statuses together
103
- $default['post_status'] = join( ',', $post_statuses );
104
 
105
  // Lean on the 'perm' query var value of 'readable' to provide statuses
106
  } else {
@@ -112,6 +115,12 @@ function bbp_has_replies( $args = '' ) {
112
  // Parse arguments against default values
113
  $r = bbp_parse_args( $args, $default, 'has_replies' );
114
 
 
 
 
 
 
 
115
  // Get bbPress
116
  $bbp = bbpress();
117
 
@@ -119,7 +128,7 @@ function bbp_has_replies( $args = '' ) {
119
  $bbp->reply_query = new WP_Query( $r );
120
 
121
  // Add pagination values to query object
122
- $bbp->reply_query->posts_per_page = $r['posts_per_page'];
123
  $bbp->reply_query->paged = $r['paged'];
124
 
125
  // Never home, regardless of what parse_query says
@@ -130,6 +139,27 @@ function bbp_has_replies( $args = '' ) {
130
  $bbp->reply_query->is_single = true;
131
  }
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  // Only add pagination if query returned results
134
  if ( (int) $bbp->reply_query->found_posts && (int) $bbp->reply_query->posts_per_page ) {
135
 
@@ -160,25 +190,31 @@ function bbp_has_replies( $args = '' ) {
160
  $base = add_query_arg( 'paged', '%#%' );
161
  }
162
 
163
- // Add pagination to query object
164
- $bbp->reply_query->pagination_links = paginate_links(
165
- apply_filters( 'bbp_replies_pagination', array(
 
 
 
 
 
 
166
  'base' => $base,
167
  'format' => '',
168
- 'total' => ceil( (int) $bbp->reply_query->found_posts / (int) $r['posts_per_page'] ),
169
  'current' => (int) $bbp->reply_query->paged,
170
  'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
171
  'next_text' => is_rtl() ? '&larr;' : '&rarr;',
172
  'mid_size' => 1,
173
  'add_args' => ( bbp_get_view_all() ) ? array( 'view' => 'all' ) : false
174
- ) )
175
- );
176
 
177
- // Remove first page from pagination
178
- if ( $wp_rewrite->using_permalinks() ) {
179
- $bbp->reply_query->pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $bbp->reply_query->pagination_links );
180
- } else {
181
- $bbp->reply_query->pagination_links = str_replace( '&#038;paged=1', '', $bbp->reply_query->pagination_links );
 
182
  }
183
  }
184
 
@@ -305,14 +341,14 @@ function bbp_get_reply( $reply, $output = OBJECT, $filter = 'raw' ) {
305
  if ( $reply->post_type !== bbp_get_reply_post_type() )
306
  return null;
307
 
308
- if ( $output == OBJECT ) {
309
  return $reply;
310
 
311
- } elseif ( $output == ARRAY_A ) {
312
  $_reply = get_object_vars( $reply );
313
  return $_reply;
314
 
315
- } elseif ( $output == ARRAY_N ) {
316
  $_reply = array_values( get_object_vars( $reply ) );
317
  return $_reply;
318
 
@@ -330,7 +366,7 @@ function bbp_get_reply( $reply, $output = OBJECT, $filter = 'raw' ) {
330
  * @uses bbp_get_reply_permalink() To get the reply permalink
331
  */
332
  function bbp_reply_permalink( $reply_id = 0 ) {
333
- echo bbp_get_reply_permalink( $reply_id );
334
  }
335
  /**
336
  * Return the link to the reply
@@ -358,7 +394,7 @@ function bbp_reply_permalink( $reply_id = 0 ) {
358
  * @uses bbp_get_reply_url() To get the reply url
359
  */
360
  function bbp_reply_url( $reply_id = 0 ) {
361
- echo bbp_get_reply_url( $reply_id );
362
  }
363
  /**
364
  * Return the paginated url to the reply in the reply loop
@@ -385,7 +421,16 @@ function bbp_reply_url( $reply_id = 0 ) {
385
  // Set needed variables
386
  $reply_id = bbp_get_reply_id ( $reply_id );
387
  $topic_id = bbp_get_reply_topic_id( $reply_id );
388
- $reply_page = ceil( (int) bbp_get_reply_position( $reply_id, $topic_id ) / (int) bbp_get_replies_per_page() );
 
 
 
 
 
 
 
 
 
389
  $reply_hash = '#post-' . $reply_id;
390
  $topic_link = bbp_get_topic_permalink( $topic_id, $redirect_to );
391
  $topic_url = remove_query_arg( 'view', $topic_link );
@@ -655,7 +700,7 @@ function bbp_reply_revision_log( $reply_id = 0 ) {
655
  if ( empty( $revisions ) )
656
  return false;
657
 
658
- $r = "\n\n" . '<ul id="bbp-reply-revision-log-' . $reply_id . '" class="bbp-reply-revision-log">' . "\n\n";
659
 
660
  // Loop through revisions
661
  foreach ( (array) $revisions as $revision ) {
@@ -671,11 +716,11 @@ function bbp_reply_revision_log( $reply_id = 0 ) {
671
  $author = bbp_get_author_link( array( 'size' => 14, 'link_text' => bbp_get_reply_author_display_name( $revision->ID ), 'post_id' => $revision->ID ) );
672
  $since = bbp_get_time_since( bbp_convert_date( $revision->post_modified ) );
673
 
674
- $r .= "\t" . '<li id="bbp-reply-revision-log-' . $reply_id . '-item-' . $revision->ID . '" class="bbp-reply-revision-log-item">' . "\n";
675
  if ( !empty( $reason ) ) {
676
- $r .= "\t\t" . sprintf( __( 'This reply was modified %1$s by %2$s. Reason: %3$s', 'bbpress' ), $since, $author, $reason ) . "\n";
677
  } else {
678
- $r .= "\t\t" . sprintf( __( 'This reply was modified %1$s by %2$s.', 'bbpress' ), $since, $author ) . "\n";
679
  }
680
  $r .= "\t" . '</li>' . "\n";
681
 
@@ -781,7 +826,7 @@ function bbp_reply_status( $reply_id = 0 ) {
781
  * @return bool True if published, false if not.
782
  */
783
  function bbp_is_reply_published( $reply_id = 0 ) {
784
- $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) == bbp_get_public_status_id();
785
  return (bool) apply_filters( 'bbp_is_reply_published', (bool) $reply_status, $reply_id );
786
  }
787
 
@@ -796,7 +841,7 @@ function bbp_is_reply_published( $reply_id = 0 ) {
796
  * @return bool True if spam, false if not.
797
  */
798
  function bbp_is_reply_spam( $reply_id = 0 ) {
799
- $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) == bbp_get_spam_status_id();
800
  return (bool) apply_filters( 'bbp_is_reply_spam', (bool) $reply_status, $reply_id );
801
  }
802
 
@@ -811,7 +856,7 @@ function bbp_is_reply_spam( $reply_id = 0 ) {
811
  * @return bool True if spam, false if not.
812
  */
813
  function bbp_is_reply_trash( $reply_id = 0 ) {
814
- $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) == bbp_get_trash_status_id();
815
  return (bool) apply_filters( 'bbp_is_reply_trash', (bool) $reply_status, $reply_id );
816
  }
817
 
@@ -1082,21 +1127,21 @@ function bbp_reply_author_link( $args = '' ) {
1082
  }
1083
 
1084
  // Setup title and author_links array
1085
- $link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : '';
1086
  $author_links = array();
1087
 
1088
  // Get avatar
1089
- if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
1090
  $author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] );
1091
  }
1092
 
1093
  // Get display name
1094
- if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
1095
  $author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
1096
  }
1097
 
1098
  // Link class
1099
- $link_class = ' class="bbp-author-' . $r['type'] . '"';
1100
 
1101
  // Add links if not anonymous
1102
  if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
@@ -1104,18 +1149,18 @@ function bbp_reply_author_link( $args = '' ) {
1104
  // Assemble the links
1105
  foreach ( $author_links as $link => $link_text ) {
1106
  $link_class = ' class="bbp-author-' . $link . '"';
1107
- $author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text );
1108
  }
1109
 
1110
  if ( true === $r['show_role'] ) {
1111
  $author_link[] = bbp_get_reply_author_role( array( 'reply_id' => $reply_id ) );
1112
  }
1113
 
1114
- $author_link = join( $r['sep'], $author_link );
1115
 
1116
  // No links if anonymous
1117
  } else {
1118
- $author_link = join( $r['sep'], $author_links );
1119
  }
1120
 
1121
  // No replies so link is empty
@@ -1135,7 +1180,7 @@ function bbp_reply_author_link( $args = '' ) {
1135
  * @uses bbp_get_reply_author_url() To get the reply author url
1136
  */
1137
  function bbp_reply_author_url( $reply_id = 0 ) {
1138
- echo bbp_get_reply_author_url( $reply_id );
1139
  }
1140
  /**
1141
  * Return the author url of the reply
@@ -1258,7 +1303,7 @@ function bbp_reply_author_role( $args = array() ) {
1258
 
1259
  $reply_id = bbp_get_reply_id( $r['reply_id'] );
1260
  $role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );
1261
- $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], $r['class'], $role, $r['after'] );
1262
 
1263
  return apply_filters( 'bbp_get_reply_author_role', $author_role, $r );
1264
  }
@@ -1375,6 +1420,200 @@ function bbp_reply_forum_id( $reply_id = 0 ) {
1375
  return (int) apply_filters( 'bbp_get_reply_forum_id', $forum_id, $reply_id );
1376
  }
1377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1378
  /**
1379
  * Output the numeric position of a reply within a topic
1380
  *
@@ -1416,7 +1655,7 @@ function bbp_reply_position( $reply_id = 0, $topic_id = 0 ) {
1416
  $topic_id = !empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id );
1417
 
1418
  // Post is not the topic
1419
- if ( $reply_id != $topic_id ) {
1420
  $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id );
1421
 
1422
  // Update the reply position in the posts table so we'll never have
@@ -1445,10 +1684,10 @@ function bbp_reply_position( $reply_id = 0, $topic_id = 0 ) {
1445
  *
1446
  * @since bbPress (r2667)
1447
  *
1448
- * @param mixed $args See {@link bbp_get_reply_admin_links()}
1449
  * @uses bbp_get_reply_admin_links() To get the reply admin links
1450
  */
1451
- function bbp_reply_admin_links( $args = '' ) {
1452
  echo bbp_get_reply_admin_links( $args );
1453
  }
1454
  /**
@@ -1456,7 +1695,7 @@ function bbp_reply_admin_links( $args = '' ) {
1456
  *
1457
  * @since bbPress (r2667)
1458
  *
1459
- * @param mixed $args This function supports these arguments:
1460
  * - id: Optional. Reply id
1461
  * - before: HTML before the links. Defaults to
1462
  * '<span class="bbp-admin-links">'
@@ -1478,7 +1717,7 @@ function bbp_reply_admin_links( $args = '' ) {
1478
  * reply admin links and args
1479
  * @return string Reply admin links
1480
  */
1481
- function bbp_get_reply_admin_links( $args = '' ) {
1482
 
1483
  // Parse arguments against default values
1484
  $r = bbp_parse_args( $args, array(
@@ -1492,20 +1731,19 @@ function bbp_reply_admin_links( $args = '' ) {
1492
  $r['id'] = bbp_get_reply_id( (int) $r['id'] );
1493
 
1494
  // If post is a topic, return the topic admin links instead
1495
- if ( bbp_is_topic( $r['id'] ) )
1496
  return bbp_get_topic_admin_links( $args );
 
1497
 
1498
  // If post is not a reply, return
1499
- if ( !bbp_is_reply( $r['id'] ) )
1500
- return;
1501
-
1502
- // Make sure user can edit this reply
1503
- if ( !current_user_can( 'edit_reply', $r['id'] ) )
1504
  return;
 
1505
 
1506
  // If topic is trashed, do not show admin links
1507
- if ( bbp_is_topic_trash( bbp_get_reply_topic_id( $r['id'] ) ) )
1508
  return;
 
1509
 
1510
  // If no links were passed, default to the standard
1511
  if ( empty( $r['links'] ) ) {
@@ -1515,23 +1753,20 @@ function bbp_reply_admin_links( $args = '' ) {
1515
  'split' => bbp_get_topic_split_link( $r ),
1516
  'trash' => bbp_get_reply_trash_link( $r ),
1517
  'spam' => bbp_get_reply_spam_link ( $r ),
 
1518
  ), $r['id'] );
1519
  }
1520
 
1521
- // Check caps for trashing the topic
1522
- if ( !current_user_can( 'delete_reply', $r['id'] ) && !empty( $r['links']['trash'] ) )
1523
- unset( $r['links']['trash'] );
1524
-
1525
  // See if links need to be unset
1526
  $reply_status = bbp_get_reply_status( $r['id'] );
1527
  if ( in_array( $reply_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) {
1528
 
1529
  // Spam link shouldn't be visible on trashed topics
1530
- if ( bbp_get_trash_status_id() == $reply_status ) {
1531
  unset( $r['links']['spam'] );
1532
 
1533
  // Trash link shouldn't be visible on spam topics
1534
- } elseif ( isset( $r['links']['trash'] ) && ( bbp_get_spam_status_id() == $reply_status ) ) {
1535
  unset( $r['links']['trash'] );
1536
  }
1537
  }
@@ -1540,7 +1775,7 @@ function bbp_reply_admin_links( $args = '' ) {
1540
  $links = implode( $r['sep'], array_filter( $r['links'] ) );
1541
  $retval = $r['before'] . $links . $r['after'];
1542
 
1543
- return apply_filters( 'bbp_get_reply_admin_links', $retval, $r );
1544
  }
1545
 
1546
  /**
@@ -1581,7 +1816,7 @@ function bbp_reply_edit_link( $args = '' ) {
1581
  'id' => 0,
1582
  'link_before' => '',
1583
  'link_after' => '',
1584
- 'edit_text' => __( 'Edit', 'bbpress' )
1585
  ), 'get_reply_edit_link' );
1586
 
1587
  $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
@@ -1602,7 +1837,7 @@ function bbp_reply_edit_link( $args = '' ) {
1602
  if ( empty( $uri ) )
1603
  return;
1604
 
1605
- $retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['edit_text'] . '</a>' . $r['link_after'];
1606
 
1607
  return apply_filters( 'bbp_get_reply_edit_link', $retval, $r );
1608
  }
@@ -1616,7 +1851,7 @@ function bbp_reply_edit_link( $args = '' ) {
1616
  * @uses bbp_get_reply_edit_url() To get the reply edit url
1617
  */
1618
  function bbp_reply_edit_url( $reply_id = 0 ) {
1619
- echo bbp_get_reply_edit_url( $reply_id );
1620
  }
1621
  /**
1622
  * Return URL to the reply edit page
@@ -1705,9 +1940,9 @@ function bbp_reply_trash_link( $args = '' ) {
1705
  'link_before' => '',
1706
  'link_after' => '',
1707
  'sep' => ' | ',
1708
- 'trash_text' => __( 'Trash', 'bbpress' ),
1709
- 'restore_text' => __( 'Restore', 'bbpress' ),
1710
- 'delete_text' => __( 'Delete', 'bbpress' )
1711
  ), 'get_reply_trash_link' );
1712
 
1713
  $actions = array();
@@ -1718,13 +1953,13 @@ function bbp_reply_trash_link( $args = '' ) {
1718
  }
1719
 
1720
  if ( bbp_is_reply_trash( $reply->ID ) ) {
1721
- $actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '">' . esc_html( $r['restore_text'] ) . '</a>';
1722
  } elseif ( EMPTY_TRASH_DAYS ) {
1723
- $actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash', 'reply_id' => $reply->ID ) ), 'trash-' . $reply->post_type . '_' . $reply->ID ) ) . '">' . esc_html( $r['trash_text'] ) . '</a>';
1724
  }
1725
 
1726
  if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
1727
- $actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete', 'reply_id' => $reply->ID ) ), 'delete-' . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );">' . esc_html( $r['delete_text'] ) . '</a>';
1728
  }
1729
 
1730
  // Process the admin links
@@ -1776,8 +2011,8 @@ function bbp_reply_spam_link( $args = '' ) {
1776
  'id' => 0,
1777
  'link_before' => '',
1778
  'link_after' => '',
1779
- 'spam_text' => __( 'Spam', 'bbpress' ),
1780
- 'unspam_text' => __( 'Unspam', 'bbpress' )
1781
  ), 'get_reply_spam_link' );
1782
 
1783
  $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
@@ -1787,8 +2022,8 @@ function bbp_reply_spam_link( $args = '' ) {
1787
 
1788
  $display = bbp_is_reply_spam( $reply->ID ) ? $r['unspam_text'] : $r['spam_text'];
1789
  $uri = add_query_arg( array( 'action' => 'bbp_toggle_reply_spam', 'reply_id' => $reply->ID ) );
1790
- $uri = esc_url( wp_nonce_url( $uri, 'spam-reply_' . $reply->ID ) );
1791
- $retval = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
1792
 
1793
  return apply_filters( 'bbp_get_reply_spam_link', $retval, $r );
1794
  }
@@ -1840,8 +2075,8 @@ function bbp_reply_move_link( $args = '' ) {
1840
  'id' => 0,
1841
  'link_before' => '',
1842
  'link_after' => '',
1843
- 'split_text' => __( 'Move', 'bbpress' ),
1844
- 'split_title' => __( 'Move this reply', 'bbpress' )
1845
  ), 'get_reply_move_link' );
1846
 
1847
  $reply_id = bbp_get_reply_id( $r['id'] );
@@ -1850,12 +2085,12 @@ function bbp_reply_move_link( $args = '' ) {
1850
  if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
1851
  return;
1852
 
1853
- $uri = esc_url( add_query_arg( array(
1854
  'action' => 'move',
1855
  'reply_id' => $reply_id
1856
- ), bbp_get_reply_edit_url( $reply_id ) ) );
1857
 
1858
- $retval = $r['link_before'] . '<a href="' . $uri . '" title="' . esc_attr( $r['split_title'] ) . '">' . esc_html( $r['split_text'] ) . '</a>' . $r['link_after'];
1859
 
1860
  return apply_filters( 'bbp_get_reply_move_link', $retval, $r );
1861
  }
@@ -1907,8 +2142,8 @@ function bbp_topic_split_link( $args = '' ) {
1907
  'id' => 0,
1908
  'link_before' => '',
1909
  'link_after' => '',
1910
- 'split_text' => __( 'Split', 'bbpress' ),
1911
- 'split_title' => __( 'Split the topic from this reply', 'bbpress' )
1912
  ), 'get_topic_split_link' );
1913
 
1914
  $reply_id = bbp_get_reply_id( $r['id'] );
@@ -1917,16 +2152,12 @@ function bbp_topic_split_link( $args = '' ) {
1917
  if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
1918
  return;
1919
 
1920
- $uri = esc_url(
1921
- add_query_arg(
1922
- array(
1923
- 'action' => 'split',
1924
- 'reply_id' => $reply_id
1925
- ),
1926
- bbp_get_topic_edit_url( $topic_id )
1927
- ) );
1928
 
1929
- $retval = $r['link_before'] . '<a href="' . $uri . '" title="' . esc_attr( $r['split_title'] ) . '">' . esc_html( $r['split_text'] ) . '</a>' . $r['link_after'];
1930
 
1931
  return apply_filters( 'bbp_get_topic_split_link', $retval, $r );
1932
  }
@@ -1967,11 +2198,11 @@ function bbp_reply_class( $reply_id = 0, $classes = array() ) {
1967
  $classes[] = 'bbp-parent-topic-' . bbp_get_reply_topic_id( $reply_id );
1968
  $classes[] = 'bbp-reply-position-' . bbp_get_reply_position( $reply_id );
1969
  $classes[] = 'user-id-' . bbp_get_reply_author_id( $reply_id );
1970
- $classes[] = ( bbp_get_reply_author_id( $reply_id ) == bbp_get_topic_author_id( bbp_get_reply_topic_id( $reply_id ) ) ? 'topic-author' : '' );
1971
  $classes = array_filter( $classes );
1972
  $classes = get_post_class( $classes, $reply_id );
1973
  $classes = apply_filters( 'bbp_get_reply_class', $classes, $reply_id );
1974
- $retval = 'class="' . join( ' ', $classes ) . '"';
1975
 
1976
  return $retval;
1977
  }
@@ -2010,8 +2241,18 @@ function bbp_topic_pagination_count() {
2010
  $total_int = (int) $bbp->reply_query->found_posts;
2011
  $total = bbp_number_format( $total_int );
2012
 
 
 
 
 
 
 
 
 
 
 
2013
  // We are not including the lead topic
2014
- if ( bbp_show_lead_topic() ) {
2015
 
2016
  // Several replies in a topic with a single page
2017
  if ( empty( $to_num ) ) {
@@ -2036,7 +2277,7 @@ function bbp_topic_pagination_count() {
2036
  }
2037
 
2038
  // Filter and return
2039
- return apply_filters( 'bbp_get_topic_pagination_count', $retstr );
2040
  }
2041
 
2042
  /**
@@ -2106,6 +2347,47 @@ function bbp_form_reply_content() {
2106
  return apply_filters( 'bbp_get_form_reply_content', $reply_content );
2107
  }
2108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2109
  /**
2110
  * Output checked value of reply log edit field
2111
  *
68
  /** Defaults **************************************************************/
69
 
70
  // Other defaults
71
+ $default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false;
72
+ $default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
73
+ $default_post_type = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
74
+ $default_thread_replies = (bool) ( bbp_is_single_topic() && bbp_thread_replies() );
75
 
76
  // Default query args
77
  $default = array(
78
+ 'post_type' => $default_post_type, // Only replies
79
+ 'post_parent' => $default_post_parent, // Of this topic
80
+ 'posts_per_page' => bbp_get_replies_per_page(), // This many
81
+ 'paged' => bbp_get_paged(), // On this page
82
+ 'orderby' => 'date', // Sorted by date
83
+ 'order' => 'ASC', // Oldest to newest
84
+ 'hierarchical' => $default_thread_replies, // Hierarchical replies
85
+ 'ignore_sticky_posts' => true, // Stickies not supported
86
+ 's' => $default_reply_search, // Maybe search
87
  );
88
 
89
  // What are the default allowed statuses (based on user caps)
103
  }
104
 
105
  // Join post statuses together
106
+ $default['post_status'] = implode( ',', $post_statuses );
107
 
108
  // Lean on the 'perm' query var value of 'readable' to provide statuses
109
  } else {
115
  // Parse arguments against default values
116
  $r = bbp_parse_args( $args, $default, 'has_replies' );
117
 
118
+ // Set posts_per_page value if replies are threaded
119
+ $replies_per_page = $r['posts_per_page'];
120
+ if ( true === $r['hierarchical'] ) {
121
+ $r['posts_per_page'] = -1;
122
+ }
123
+
124
  // Get bbPress
125
  $bbp = bbpress();
126
 
128
  $bbp->reply_query = new WP_Query( $r );
129
 
130
  // Add pagination values to query object
131
+ $bbp->reply_query->posts_per_page = $replies_per_page;
132
  $bbp->reply_query->paged = $r['paged'];
133
 
134
  // Never home, regardless of what parse_query says
139
  $bbp->reply_query->is_single = true;
140
  }
141
 
142
+ // Only add reply to if query returned results
143
+ if ( (int) $bbp->reply_query->found_posts ) {
144
+
145
+ // Get reply to for each reply
146
+ foreach ( $bbp->reply_query->posts as &$post ) {
147
+
148
+ // Check for reply post type
149
+ if ( bbp_get_reply_post_type() === $post->post_type ) {
150
+ $reply_to = bbp_get_reply_to( $post->ID );
151
+
152
+ // Make sure it's a reply to a reply
153
+ if ( empty( $reply_to ) || ( bbp_get_reply_topic_id( $post->ID ) === $reply_to ) ) {
154
+ $reply_to = 0;
155
+ }
156
+
157
+ // Add reply_to to the post object so we can walk it later
158
+ $post->reply_to = $reply_to;
159
+ }
160
+ }
161
+ }
162
+
163
  // Only add pagination if query returned results
164
  if ( (int) $bbp->reply_query->found_posts && (int) $bbp->reply_query->posts_per_page ) {
165
 
190
  $base = add_query_arg( 'paged', '%#%' );
191
  }
192
 
193
+ // Figure out total pages
194
+ if ( true === $r['hierarchical'] ) {
195
+ $walker = new BBP_Walker_Reply;
196
+ $total_pages = ceil( (int) $walker->get_number_of_root_elements( $bbp->reply_query->posts ) / (int) $replies_per_page );
197
+ } else {
198
+ $total_pages = ceil( (int) $bbp->reply_query->found_posts / (int) $replies_per_page );
199
+
200
+ // Add pagination to query object
201
+ $bbp->reply_query->pagination_links = paginate_links( apply_filters( 'bbp_replies_pagination', array(
202
  'base' => $base,
203
  'format' => '',
204
+ 'total' => $total_pages,
205
  'current' => (int) $bbp->reply_query->paged,
206
  'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
207
  'next_text' => is_rtl() ? '&larr;' : '&rarr;',
208
  'mid_size' => 1,
209
  'add_args' => ( bbp_get_view_all() ) ? array( 'view' => 'all' ) : false
210
+ ) ) );
 
211
 
212
+ // Remove first page from pagination
213
+ if ( $wp_rewrite->using_permalinks() ) {
214
+ $bbp->reply_query->pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $bbp->reply_query->pagination_links );
215
+ } else {
216
+ $bbp->reply_query->pagination_links = str_replace( '&#038;paged=1', '', $bbp->reply_query->pagination_links );
217
+ }
218
  }
219
  }
220
 
341
  if ( $reply->post_type !== bbp_get_reply_post_type() )
342
  return null;
343
 
344
+ if ( $output === OBJECT ) {
345
  return $reply;
346
 
347
+ } elseif ( $output === ARRAY_A ) {
348
  $_reply = get_object_vars( $reply );
349
  return $_reply;
350
 
351
+ } elseif ( $output === ARRAY_N ) {
352
  $_reply = array_values( get_object_vars( $reply ) );
353
  return $_reply;
354
 
366
  * @uses bbp_get_reply_permalink() To get the reply permalink
367
  */
368
  function bbp_reply_permalink( $reply_id = 0 ) {
369
+ echo esc_url( bbp_get_reply_permalink( $reply_id ) );
370
  }
371
  /**
372
  * Return the link to the reply
394
  * @uses bbp_get_reply_url() To get the reply url
395
  */
396
  function bbp_reply_url( $reply_id = 0 ) {
397
+ echo esc_url( bbp_get_reply_url( $reply_id ) );
398
  }
399
  /**
400
  * Return the paginated url to the reply in the reply loop
421
  // Set needed variables
422
  $reply_id = bbp_get_reply_id ( $reply_id );
423
  $topic_id = bbp_get_reply_topic_id( $reply_id );
424
+
425
+ // Hierarchical reply page
426
+ if ( bbp_thread_replies() ) {
427
+ $reply_page = 1;
428
+
429
+ // Standard reply page
430
+ } else {
431
+ $reply_page = ceil( (int) bbp_get_reply_position( $reply_id, $topic_id ) / (int) bbp_get_replies_per_page() );
432
+ }
433
+
434
  $reply_hash = '#post-' . $reply_id;
435
  $topic_link = bbp_get_topic_permalink( $topic_id, $redirect_to );
436
  $topic_url = remove_query_arg( 'view', $topic_link );
700
  if ( empty( $revisions ) )
701
  return false;
702
 
703
+ $r = "\n\n" . '<ul id="bbp-reply-revision-log-' . esc_attr( $reply_id ) . '" class="bbp-reply-revision-log">' . "\n\n";
704
 
705
  // Loop through revisions
706
  foreach ( (array) $revisions as $revision ) {
716
  $author = bbp_get_author_link( array( 'size' => 14, 'link_text' => bbp_get_reply_author_display_name( $revision->ID ), 'post_id' => $revision->ID ) );
717
  $since = bbp_get_time_since( bbp_convert_date( $revision->post_modified ) );
718
 
719
+ $r .= "\t" . '<li id="bbp-reply-revision-log-' . esc_attr( $reply_id ) . '-item-' . esc_attr( $revision->ID ) . '" class="bbp-reply-revision-log-item">' . "\n";
720
  if ( !empty( $reason ) ) {
721
+ $r .= "\t\t" . sprintf( esc_html__( 'This reply was modified %1$s by %2$s. Reason: %3$s', 'bbpress' ), esc_html( $since ), $author, esc_html( $reason ) ) . "\n";
722
  } else {
723
+ $r .= "\t\t" . sprintf( esc_html__( 'This reply was modified %1$s by %2$s.', 'bbpress' ), esc_html( $since ), $author ) . "\n";
724
  }
725
  $r .= "\t" . '</li>' . "\n";
726
 
826
  * @return bool True if published, false if not.
827
  */
828
  function bbp_is_reply_published( $reply_id = 0 ) {
829
+ $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) === bbp_get_public_status_id();
830
  return (bool) apply_filters( 'bbp_is_reply_published', (bool) $reply_status, $reply_id );
831
  }
832
 
841
  * @return bool True if spam, false if not.
842
  */
843
  function bbp_is_reply_spam( $reply_id = 0 ) {
844
+ $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) === bbp_get_spam_status_id();
845
  return (bool) apply_filters( 'bbp_is_reply_spam', (bool) $reply_status, $reply_id );
846
  }
847
 
856
  * @return bool True if spam, false if not.
857
  */
858
  function bbp_is_reply_trash( $reply_id = 0 ) {
859
+ $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) === bbp_get_trash_status_id();
860
  return (bool) apply_filters( 'bbp_is_reply_trash', (bool) $reply_status, $reply_id );
861
  }
862
 
1127
  }
1128
 
1129
  // Setup title and author_links array
1130
+ $link_title = !empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';
1131
  $author_links = array();
1132
 
1133
  // Get avatar
1134
+ if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
1135
  $author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] );
1136
  }
1137
 
1138
  // Get display name
1139
+ if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
1140
  $author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
1141
  }
1142
 
1143
  // Link class
1144
+ $link_class = ' class="bbp-author-' . esc_attr( $r['type'] ) . '"';
1145
 
1146
  // Add links if not anonymous
1147
  if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
1149
  // Assemble the links
1150
  foreach ( $author_links as $link => $link_text ) {
1151
  $link_class = ' class="bbp-author-' . $link . '"';
1152
+ $author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', esc_url( $author_url ), $link_title, $link_class, $link_text );
1153
  }
1154
 
1155
  if ( true === $r['show_role'] ) {
1156
  $author_link[] = bbp_get_reply_author_role( array( 'reply_id' => $reply_id ) );
1157
  }
1158
 
1159
+ $author_link = implode( $r['sep'], $author_link );
1160
 
1161
  // No links if anonymous
1162
  } else {
1163
+ $author_link = implode( $r['sep'], $author_links );
1164
  }
1165
 
1166
  // No replies so link is empty
1180
  * @uses bbp_get_reply_author_url() To get the reply author url
1181
  */
1182
  function bbp_reply_author_url( $reply_id = 0 ) {
1183
+ echo esc_url( bbp_get_reply_author_url( $reply_id ) );
1184
  }
1185
  /**
1186
  * Return the author url of the reply
1303
 
1304
  $reply_id = bbp_get_reply_id( $r['reply_id'] );
1305
  $role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );
1306
+ $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], esc_attr( $r['class'] ), esc_html( $role ), $r['after'] );
1307
 
1308
  return apply_filters( 'bbp_get_reply_author_role', $author_role, $r );
1309
  }
1420
  return (int) apply_filters( 'bbp_get_reply_forum_id', $forum_id, $reply_id );
1421
  }
1422
 
1423
+ /**
1424
+ * Output the reply's ancestor reply id
1425
+ *
1426
+ * @since bbPress (r4944)
1427
+ *
1428
+ * @param int $reply_id Optional. Reply id
1429
+ * @uses bbp_get_reply_ancestor_id() To get the reply's ancestor id
1430
+ */
1431
+ function bbp_reply_ancestor_id( $reply_id = 0 ) {
1432
+ echo bbp_get_reply_ancestor_id( $reply_id );
1433
+ }
1434
+ /**
1435
+ * Return the reply's ancestor reply id
1436
+ *
1437
+ * @since bbPress (r4944)
1438
+ *
1439
+ * @param in $reply_id Reply id
1440
+ * @uses bbp_get_reply_id() To get the reply id
1441
+ */
1442
+ function bbp_get_reply_ancestor_id( $reply_id = 0 ) {
1443
+
1444
+ // Validation
1445
+ $reply_id = bbp_get_reply_id( $reply_id );
1446
+ if ( empty( $reply_id ) )
1447
+ return false;
1448
+
1449
+ // Find highest reply ancestor
1450
+ $ancestor_id = $reply_id;
1451
+ while ( $parent_id = bbp_get_reply_to( $ancestor_id ) ) {
1452
+ if ( empty( $parent_id ) || ( $parent_id === $ancestor_id ) || ( bbp_get_reply_topic_id( $reply_id ) === $parent_id ) || ( $parent_id === $reply_id ) ) {
1453
+ break;
1454
+ }
1455
+ $ancestor_id = $parent_id;
1456
+ }
1457
+
1458
+ return (int) $ancestor_id;
1459
+ }
1460
+
1461
+ /**
1462
+ * Output the reply to id of a reply
1463
+ *
1464
+ * @since bbPress (r4944)
1465
+ *
1466
+ * @param int $reply_id Optional. Reply id
1467
+ * @uses bbp_get_reply_to() To get the reply to id
1468
+ */
1469
+ function bbp_reply_to( $reply_id = 0 ) {
1470
+ echo bbp_get_reply_to( $reply_id );
1471
+ }
1472
+ /**
1473
+ * Return the reply to id of a reply
1474
+ *
1475
+ * @since bbPress (r4944)
1476
+ *
1477
+ * @param int $reply_id Optional. Reply id
1478
+ * @uses bbp_get_reply_id() To get the reply id
1479
+ * @uses get_post_meta() To get the reply to id
1480
+ * @uses apply_filters() Calls 'bbp_get_reply_to' with the reply to id and
1481
+ * reply id
1482
+ * @return int Reply's reply to id
1483
+ */
1484
+ function bbp_get_reply_to( $reply_id = 0 ) {
1485
+
1486
+ // Assume there is no reply_to set
1487
+ $reply_to = 0;
1488
+
1489
+ // Check that reply_id is valid
1490
+ if ( $reply_id = bbp_get_reply_id( $reply_id ) )
1491
+
1492
+ // Get reply_to value
1493
+ $reply_to = (int) get_post_meta( $reply_id, '_bbp_reply_to', true );
1494
+
1495
+ return (int) apply_filters( 'bbp_get_reply_to', $reply_to, $reply_id );
1496
+ }
1497
+
1498
+ /**
1499
+ * Output the link for the reply to
1500
+ *
1501
+ * @since bbPress (r4944)
1502
+ *
1503
+ * @param array $args
1504
+ * @uses bbp_get_reply_to_link() To get the reply to link
1505
+ */
1506
+ function bbp_reply_to_link( $args = array() ) {
1507
+ echo bbp_get_reply_to_link( $args );
1508
+ }
1509
+
1510
+ /**
1511
+ * Return the link for a reply to a reply
1512
+ *
1513
+ * @since bbPress (r4944)
1514
+ *
1515
+ * @param array $args Arguments
1516
+ * @uses bbp_current_user_can_access_create_reply_form() To check permissions
1517
+ * @uses bbp_get_reply_id() To validate the reply id
1518
+ * @uses bbp_get_reply() To get the reply
1519
+ * @uses apply_filters() Calls 'bbp_get_reply_to_link' with the formatted link,
1520
+ * the arguments array, and the reply
1521
+ * @return string Link for a reply to a reply
1522
+ */
1523
+ function bbp_get_reply_to_link( $args = array() ) {
1524
+
1525
+ // Parse arguments against default values
1526
+ $r = bbp_parse_args( $args, array(
1527
+ 'id' => 0,
1528
+ 'link_before' => '',
1529
+ 'link_after' => '',
1530
+ 'reply_text' => __( 'Reply', 'bbpress' ),
1531
+ 'depth' => 0,
1532
+ 'add_below' => 'post',
1533
+ 'respond_id' => 'new-reply-' . bbp_get_topic_id(),
1534
+ ), 'get_reply_to_link' );
1535
+
1536
+ // Get the reply to use it's ID and post_parent
1537
+ $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
1538
+
1539
+ // Bail if no reply or user cannot reply
1540
+ if ( empty( $reply ) || ! bbp_current_user_can_access_create_reply_form() )
1541
+ return;
1542
+
1543
+ // Build the URI and return value
1544
+ $uri = remove_query_arg( array( 'bbp_reply_to' ) );
1545
+ $uri = add_query_arg( array( 'bbp_reply_to' => $reply->ID ) );
1546
+ $uri = wp_nonce_url( $uri, 'respond_id_' . $reply->ID );
1547
+ $uri = $uri . '#new-post';
1548
+
1549
+ // Only add onclick if replies are threaded
1550
+ if ( bbp_thread_replies() ) {
1551
+
1552
+ // Array of classes to pass to moveForm
1553
+ $move_form = array(
1554
+ $r['add_below'] . '-' . $reply->ID,
1555
+ $reply->ID,
1556
+ $r['respond_id'],
1557
+ $reply->post_parent
1558
+ );
1559
+
1560
+ // Build the onclick
1561
+ $onclick = ' onclick="return addReply.moveForm(\'' . implode( "','", $move_form ) . '\');"';
1562
+
1563
+ // No onclick if replies are not threaded
1564
+ } else {
1565
+ $onclick = '';
1566
+ }
1567
+
1568
+ // Add $uri to the array, to be passed through the filter
1569
+ $r['uri'] = $uri;
1570
+ $retval = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-reply-to-link"' . $onclick . '>' . esc_html( $r['reply_text'] ) . '</a>' . $r['link_after'];
1571
+
1572
+ return apply_filters( 'bbp_get_reply_to_link', $retval, $r, $args );
1573
+ }
1574
+
1575
+ /**
1576
+ * Output the reply to a reply cancellation link
1577
+ *
1578
+ * @since bbPress (r4944)
1579
+ *
1580
+ * @uses bbp_get_cancel_reply_to_link() To get the reply cancellation link
1581
+ */
1582
+ function bbp_cancel_reply_to_link( $text = '' ) {
1583
+ echo bbp_get_cancel_reply_to_link( $text );
1584
+ }
1585
+ /**
1586
+ * Return the cancellation link for a reply to a reply
1587
+ *
1588
+ * @since bbPress (r4944)
1589
+ *
1590
+ * @param string $text The cancel text
1591
+ * @uses apply_filters() Calls 'bbp_get_cancel_reply_to_link' with the cancellation
1592
+ * link and the cancel text
1593
+ * @return string The cancellation link
1594
+ */
1595
+ function bbp_get_cancel_reply_to_link( $text = '' ) {
1596
+
1597
+ // Bail if not hierarchical or editing a reply
1598
+ if ( ! bbp_thread_replies() || bbp_is_reply_edit() ) {
1599
+ return;
1600
+ }
1601
+
1602
+ // Set default text
1603
+ if ( empty( $text ) ) {
1604
+ $text = __( 'Cancel', 'bbpress' );
1605
+ }
1606
+
1607
+ $reply_to = isset( $_GET['bbp_reply_to'] ) ? (int) $_GET['bbp_reply_to'] : 0;
1608
+
1609
+ // Set visibility
1610
+ $style = !empty( $reply_to ) ? '' : ' style="display:none;"';
1611
+ $link = remove_query_arg( array( 'bbp_reply_to', '_wpnonce' ) ) . '#post-' . $reply_to;
1612
+ $retval = '<a rel="nofollow" id="bbp-cancel-reply-to-link" href="' . esc_url( $link ) . '"' . $style . '>' . esc_html( $text ) . '</a>';
1613
+
1614
+ return apply_filters( 'bbp_get_cancel_reply_to_link', $retval, $link, $text );
1615
+ }
1616
+
1617
  /**
1618
  * Output the numeric position of a reply within a topic
1619
  *
1655
  $topic_id = !empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id );
1656
 
1657
  // Post is not the topic
1658
+ if ( $reply_id !== $topic_id ) {
1659
  $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id );
1660
 
1661
  // Update the reply position in the posts table so we'll never have
1684
  *
1685
  * @since bbPress (r2667)
1686
  *
1687
+ * @param array $args See {@link bbp_get_reply_admin_links()}
1688
  * @uses bbp_get_reply_admin_links() To get the reply admin links
1689
  */
1690
+ function bbp_reply_admin_links( $args = array() ) {
1691
  echo bbp_get_reply_admin_links( $args );
1692
  }
1693
  /**
1695
  *
1696
  * @since bbPress (r2667)
1697
  *
1698
+ * @param array $args This function supports these arguments:
1699
  * - id: Optional. Reply id
1700
  * - before: HTML before the links. Defaults to
1701
  * '<span class="bbp-admin-links">'
1717
  * reply admin links and args
1718
  * @return string Reply admin links
1719
  */
1720
+ function bbp_get_reply_admin_links( $args = array() ) {
1721
 
1722
  // Parse arguments against default values
1723
  $r = bbp_parse_args( $args, array(
1731
  $r['id'] = bbp_get_reply_id( (int) $r['id'] );
1732
 
1733
  // If post is a topic, return the topic admin links instead
1734
+ if ( bbp_is_topic( $r['id'] ) ) {
1735
  return bbp_get_topic_admin_links( $args );
1736
+ }
1737
 
1738
  // If post is not a reply, return
1739
+ if ( !bbp_is_reply( $r['id'] ) ) {
 
 
 
 
1740
  return;
1741
+ }
1742
 
1743
  // If topic is trashed, do not show admin links
1744
+ if ( bbp_is_topic_trash( bbp_get_reply_topic_id( $r['id'] ) ) ) {
1745
  return;
1746
+ }
1747
 
1748
  // If no links were passed, default to the standard
1749
  if ( empty( $r['links'] ) ) {
1753
  'split' => bbp_get_topic_split_link( $r ),
1754
  'trash' => bbp_get_reply_trash_link( $r ),
1755
  'spam' => bbp_get_reply_spam_link ( $r ),
1756
+ 'reply' => bbp_get_reply_to_link ( $r )
1757
  ), $r['id'] );
1758
  }
1759
 
 
 
 
 
1760
  // See if links need to be unset
1761
  $reply_status = bbp_get_reply_status( $r['id'] );
1762
  if ( in_array( $reply_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) {
1763
 
1764
  // Spam link shouldn't be visible on trashed topics
1765
+ if ( bbp_get_trash_status_id() === $reply_status ) {
1766
  unset( $r['links']['spam'] );
1767
 
1768
  // Trash link shouldn't be visible on spam topics
1769
+ } elseif ( bbp_get_spam_status_id() === $reply_status ) {
1770
  unset( $r['links']['trash'] );
1771
  }
1772
  }
1775
  $links = implode( $r['sep'], array_filter( $r['links'] ) );
1776
  $retval = $r['before'] . $links . $r['after'];
1777
 
1778
+ return apply_filters( 'bbp_get_reply_admin_links', $retval, $r, $args );
1779
  }
1780
 
1781
  /**
1816
  'id' => 0,
1817
  'link_before' => '',
1818
  'link_after' => '',
1819
+ 'edit_text' => esc_html__( 'Edit', 'bbpress' )
1820
  ), 'get_reply_edit_link' );
1821
 
1822
  $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
1837
  if ( empty( $uri ) )
1838
  return;
1839
 
1840
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-edit-link">' . $r['edit_text'] . '</a>' . $r['link_after'];
1841
 
1842
  return apply_filters( 'bbp_get_reply_edit_link', $retval, $r );
1843
  }
1851
  * @uses bbp_get_reply_edit_url() To get the reply edit url
1852
  */
1853
  function bbp_reply_edit_url( $reply_id = 0 ) {
1854
+ echo esc_url( bbp_get_reply_edit_url( $reply_id ) );
1855
  }
1856
  /**
1857
  * Return URL to the reply edit page
1940
  'link_before' => '',
1941
  'link_after' => '',
1942
  'sep' => ' | ',
1943
+ 'trash_text' => esc_html__( 'Trash', 'bbpress' ),
1944
+ 'restore_text' => esc_html__( 'Restore', 'bbpress' ),
1945
+ 'delete_text' => esc_html__( 'Delete', 'bbpress' )
1946
  ), 'get_reply_trash_link' );
1947
 
1948
  $actions = array();
1953
  }
1954
 
1955
  if ( bbp_is_reply_trash( $reply->ID ) ) {
1956
+ $actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-restore-link">' . $r['restore_text'] . '</a>';
1957
  } elseif ( EMPTY_TRASH_DAYS ) {
1958
+ $actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash', 'reply_id' => $reply->ID ) ), 'trash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-trash-link">' . $r['trash_text'] . '</a>';
1959
  }
1960
 
1961
  if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
1962
+ $actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete', 'reply_id' => $reply->ID ) ), 'delete-' . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-reply-delete-link">' . $r['delete_text'] . '</a>';
1963
  }
1964
 
1965
  // Process the admin links
2011
  'id' => 0,
2012
  'link_before' => '',
2013
  'link_after' => '',
2014
+ 'spam_text' => esc_html__( 'Spam', 'bbpress' ),
2015
+ 'unspam_text' => esc_html__( 'Unspam', 'bbpress' )
2016
  ), 'get_reply_spam_link' );
2017
 
2018
  $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
2022
 
2023
  $display = bbp_is_reply_spam( $reply->ID ) ? $r['unspam_text'] : $r['spam_text'];
2024
  $uri = add_query_arg( array( 'action' => 'bbp_toggle_reply_spam', 'reply_id' => $reply->ID ) );
2025
+ $uri = wp_nonce_url( $uri, 'spam-reply_' . $reply->ID );
2026
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-spam-link">' . $display . '</a>' . $r['link_after'];
2027
 
2028
  return apply_filters( 'bbp_get_reply_spam_link', $retval, $r );
2029
  }
2075
  'id' => 0,
2076
  'link_before' => '',
2077
  'link_after' => '',
2078
+ 'split_text' => esc_html__( 'Move', 'bbpress' ),
2079
+ 'split_title' => esc_attr__( 'Move this reply', 'bbpress' )
2080
  ), 'get_reply_move_link' );
2081
 
2082
  $reply_id = bbp_get_reply_id( $r['id'] );
2085
  if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
2086
  return;
2087
 
2088
+ $uri = add_query_arg( array(
2089
  'action' => 'move',
2090
  'reply_id' => $reply_id
2091
+ ), bbp_get_reply_edit_url( $reply_id ) );
2092
 
2093
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-reply-move-link">' . $r['split_text'] . '</a>' . $r['link_after'];
2094
 
2095
  return apply_filters( 'bbp_get_reply_move_link', $retval, $r );
2096
  }
2142
  'id' => 0,
2143
  'link_before' => '',
2144
  'link_after' => '',
2145
+ 'split_text' => esc_html__( 'Split', 'bbpress' ),
2146
+ 'split_title' => esc_attr__( 'Split the topic from this reply', 'bbpress' )
2147
  ), 'get_topic_split_link' );
2148
 
2149
  $reply_id = bbp_get_reply_id( $r['id'] );
2152
  if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
2153
  return;
2154
 
2155
+ $uri = add_query_arg( array(
2156
+ 'action' => 'split',
2157
+ 'reply_id' => $reply_id
2158
+ ), bbp_get_topic_edit_url( $topic_id ) );
 
 
 
 
2159
 
2160
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after'];
2161
 
2162
  return apply_filters( 'bbp_get_topic_split_link', $retval, $r );
2163
  }
2198
  $classes[] = 'bbp-parent-topic-' . bbp_get_reply_topic_id( $reply_id );
2199
  $classes[] = 'bbp-reply-position-' . bbp_get_reply_position( $reply_id );
2200
  $classes[] = 'user-id-' . bbp_get_reply_author_id( $reply_id );
2201
+ $classes[] = ( bbp_get_reply_author_id( $reply_id ) === bbp_get_topic_author_id( bbp_get_reply_topic_id( $reply_id ) ) ? 'topic-author' : '' );
2202
  $classes = array_filter( $classes );
2203
  $classes = get_post_class( $classes, $reply_id );
2204
  $classes = apply_filters( 'bbp_get_reply_class', $classes, $reply_id );
2205
+ $retval = 'class="' . implode( ' ', $classes ) . '"';
2206
 
2207
  return $retval;
2208
  }
2241
  $total_int = (int) $bbp->reply_query->found_posts;
2242
  $total = bbp_number_format( $total_int );
2243
 
2244
+ // We are threading replies
2245
+ if ( bbp_thread_replies() && bbp_is_single_topic() ) {
2246
+ return;
2247
+ $walker = new BBP_Walker_Reply;
2248
+ $threads = (int) $walker->get_number_of_root_elements( $bbp->reply_query->posts );
2249
+
2250
+ // Adjust for topic
2251
+ $threads--;
2252
+ $retstr = sprintf( _n( 'Viewing %1$s reply thread', 'Viewing %1$s reply threads', $threads, 'bbbpress' ), bbp_number_format( $threads ) );
2253
+
2254
  // We are not including the lead topic
2255
+ } elseif ( bbp_show_lead_topic() ) {
2256
 
2257
  // Several replies in a topic with a single page
2258
  if ( empty( $to_num ) ) {
2277
  }
2278
 
2279
  // Filter and return
2280
+ return apply_filters( 'bbp_get_topic_pagination_count', esc_html( $retstr ) );
2281
  }
2282
 
2283
  /**
2347
  return apply_filters( 'bbp_get_form_reply_content', $reply_content );
2348
  }
2349
 
2350
+ /**
2351
+ * Output the value of the reply to field
2352
+ *
2353
+ * @since bbPress (r4944)
2354
+ *
2355
+ * @uses bbp_get_form_reply_to() To get value of the reply to field
2356
+ */
2357
+ function bbp_form_reply_to() {
2358
+ echo bbp_get_form_reply_to();
2359
+ }
2360
+
2361
+ /**
2362
+ * Return the value of reply to field
2363
+ *
2364
+ * @since bbPress (r4944)
2365
+ *
2366
+ * @uses bbp_get_reply_id() To validate the reply to
2367
+ * @uses apply_filters() Calls 'bbp_get_form_reply_to' with the reply to
2368
+ * @return string Value of reply to field
2369
+ */
2370
+ function bbp_get_form_reply_to() {
2371
+
2372
+ // Set initial value
2373
+ $reply_to = 0;
2374
+
2375
+ // Get $_REQUEST data
2376
+ if ( isset( $_REQUEST['bbp_reply_to'] ) ) {
2377
+ $reply_to = (int) $_REQUEST['bbp_reply_to'];
2378
+ }
2379
+
2380
+ // If empty, get from meta
2381
+ if ( empty( $reply_to ) ) {
2382
+ $reply_to = bbp_get_reply_to();
2383
+ }
2384
+
2385
+ // Validate
2386
+ $reply_to = bbp_get_reply_id( $reply_to );
2387
+
2388
+ return (int) apply_filters( 'bbp_get_form_reply_to', $reply_to );
2389
+ }
2390
+
2391
  /**
2392
  * Output checked value of reply log edit field
2393
  *
includes/search/functions.php CHANGED
@@ -23,14 +23,14 @@ if ( !defined( 'ABSPATH' ) ) exit;
23
  * @uses bbp_has_search_results() To make the search query
24
  * @return bool False if no results, otherwise if search results are there
25
  */
26
- function bbp_search_query( $new_args = '' ) {
27
 
28
  // Existing arguments
29
  $query_args = bbp_get_search_query_args();
30
 
31
  // Merge arguments
32
  if ( !empty( $new_args ) ) {
33
- $new_args = bbp_parse_args( $new_args, '', 'search_query' );
34
  $query_args = array_merge( $query_args, $new_args );
35
  }
36
 
@@ -49,7 +49,37 @@ function bbp_get_search_query_args() {
49
 
50
  // Get search terms
51
  $search_terms = bbp_get_search_terms();
52
- $retval = !empty( $search_terms ) ? array( 's' => $search_terms ) : array();
53
 
54
  return apply_filters( 'bbp_get_search_query_args', $retval );
55
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  * @uses bbp_has_search_results() To make the search query
24
  * @return bool False if no results, otherwise if search results are there
25
  */
26
+ function bbp_search_query( $new_args = array() ) {
27
 
28
  // Existing arguments
29
  $query_args = bbp_get_search_query_args();
30
 
31
  // Merge arguments
32
  if ( !empty( $new_args ) ) {
33
+ $new_args = bbp_parse_args( $new_args, array(), 'search_query' );
34
  $query_args = array_merge( $query_args, $new_args );
35
  }
36
 
49
 
50
  // Get search terms
51
  $search_terms = bbp_get_search_terms();
52
+ $retval = !empty( $search_terms ) ? array( 's' => $search_terms ) : array();
53
 
54
  return apply_filters( 'bbp_get_search_query_args', $retval );
55
  }
56
+
57
+ /**
58
+ * Redirect to search results page if needed
59
+ *
60
+ * @since bbPress (r4928)
61
+ * @return If a redirect is not needed
62
+ */
63
+ function bbp_search_results_redirect() {
64
+ global $wp_rewrite;
65
+
66
+ // Bail if not a search request action
67
+ if ( empty( $_GET['action'] ) || ( 'bbp-search-request' !== $_GET['action'] ) ) {
68
+ return;
69
+ }
70
+
71
+ // Bail if not using pretty permalinks
72
+ if ( ! $wp_rewrite->using_permalinks() ) {
73
+ return;
74
+ }
75
+
76
+ // Get the redirect URL
77
+ $redirect_to = bbp_get_search_results_url();
78
+ if ( empty( $redirect_to ) ) {
79
+ return;
80
+ }
81
+
82
+ // Redirect and bail
83
+ wp_safe_redirect( $redirect_to );
84
+ exit();
85
+ }
includes/search/{template-tags.php → template.php} RENAMED
@@ -43,27 +43,43 @@ function bbp_has_search_results( $args = '' ) {
43
 
44
  /** Defaults **************************************************************/
45
 
46
- // What are the default allowed statuses (based on user caps)
47
- if ( bbp_get_view_all( 'edit_others_replies' ) ) {
48
- $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() );
49
- } else {
50
- $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() );
51
- }
52
-
53
- $default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
54
- $default_post_status = join( ',', $post_statuses );
55
 
56
  // Default query args
57
  $default = array(
58
- 'post_type' => $default_post_type, // Forums, topics, and replies
59
- 'post_status' => $default_post_status, // Of this status
60
- 'posts_per_page' => bbp_get_replies_per_page(), // This many
61
- 'paged' => bbp_get_paged(), // On this page
62
- 'orderby' => 'date', // Sorted by date
63
- 'order' => 'DESC', // Most recent first
64
- 's' => bbp_get_search_terms(), // This is a search
65
  );
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  /** Setup *****************************************************************/
68
 
69
  // Parse arguments against default values
@@ -93,6 +109,9 @@ function bbp_has_search_results( $args = '' ) {
93
  // Only add pagination is query returned results
94
  if ( (int) $bbp->search_query->found_posts && (int) $bbp->search_query->posts_per_page ) {
95
 
 
 
 
96
  // If pretty permalinks are enabled, make our pagination pretty
97
  if ( $wp_rewrite->using_permalinks() ) {
98
 
@@ -102,8 +121,7 @@ function bbp_has_search_results( $args = '' ) {
102
 
103
  // Default search location
104
  } else {
105
- $base = trailingslashit( bbp_get_search_url() );
106
-
107
  }
108
 
109
  // Add pagination base
@@ -115,9 +133,9 @@ function bbp_has_search_results( $args = '' ) {
115
  }
116
 
117
  // Add args
118
- $add_args = isset( $_GET[bbp_get_search_rewrite_id()] ) ? array( bbp_get_search_rewrite_id() => urlencode( bbp_get_search_terms() ) ) : array();
119
- if ( bbp_get_view_all() )
120
  $add_args['view'] = 'all';
 
121
 
122
  // Add pagination to query object
123
  $bbp->search_query->pagination_links = paginate_links(
@@ -210,12 +228,14 @@ function bbp_search_title() {
210
 
211
  // No search terms specified
212
  if ( empty( $search_terms ) ) {
213
- return __( 'Search', 'bbpress' );
214
 
215
  // Include search terms in title
216
  } else {
217
- return sprintf( __( "Search Results for '%s'", 'bbpress' ), esc_attr( $search_terms ) );
218
  }
 
 
219
  }
220
 
221
  /**
@@ -226,7 +246,7 @@ function bbp_search_title() {
226
  * @uses bbp_get_search_url() To get the search url
227
  */
228
  function bbp_search_url() {
229
- echo bbp_get_search_url();
230
  }
231
  /**
232
  * Return the search url
@@ -250,13 +270,61 @@ function bbp_search_url() {
250
 
251
  // Unpretty permalinks
252
  } else {
253
- $search_terms = bbp_get_search_terms();
254
- $url = add_query_arg( array( 'bbp_search' => urlencode( $search_terms ) ), home_url( '/' ) );
255
  }
256
 
257
  return apply_filters( 'bbp_get_search_url', $url );
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
  /**
262
  * Output the search terms
@@ -278,19 +346,26 @@ function bbp_search_terms( $search_terms = '' ) {
278
  * If search terms are supplied, those are used. Otherwise check the
279
  * search rewrite id query var.
280
  *
281
- * @param string $search_terms Optional. Search terms
282
  * @uses sanitize_title() To sanitize the search terms
283
  * @uses get_query_var*( To get the search terms from query var 'bbp_search'
284
  * @return bool|string Search terms on success, false on failure
285
  */
286
- function bbp_get_search_terms( $search_terms = '' ) {
287
 
288
- $search_terms = !empty( $search_terms ) ? sanitize_title( $search_terms ) : get_query_var( bbp_get_search_rewrite_id() );
 
 
289
 
290
- if ( !empty( $search_terms ) )
291
- return $search_terms;
 
 
292
 
293
- return false;
 
 
 
294
  }
295
 
296
  /**
@@ -338,7 +413,7 @@ function bbp_search_pagination_count() {
338
  }
339
 
340
  // Filter and return
341
- return apply_filters( 'bbp_get_search_pagination_count', $retstr );
342
  }
343
 
344
  /**
43
 
44
  /** Defaults **************************************************************/
45
 
46
+ $default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
 
 
 
 
 
 
 
 
47
 
48
  // Default query args
49
  $default = array(
50
+ 'post_type' => $default_post_type, // Forums, topics, and replies
51
+ 'posts_per_page' => bbp_get_replies_per_page(), // This many
52
+ 'paged' => bbp_get_paged(), // On this page
53
+ 'orderby' => 'date', // Sorted by date
54
+ 'order' => 'DESC', // Most recent first
55
+ 'ignore_sticky_posts' => true, // Stickies not supported
56
+ 's' => bbp_get_search_terms(), // This is a search
57
  );
58
 
59
+ // What are the default allowed statuses (based on user caps)
60
+ if ( bbp_get_view_all() ) {
61
+
62
+ // Default view=all statuses
63
+ $post_statuses = array(
64
+ bbp_get_public_status_id(),
65
+ bbp_get_closed_status_id(),
66
+ bbp_get_spam_status_id(),
67
+ bbp_get_trash_status_id()
68
+ );
69
+
70
+ // Add support for private status
71
+ if ( current_user_can( 'read_private_topics' ) ) {
72
+ $post_statuses[] = bbp_get_private_status_id();
73
+ }
74
+
75
+ // Join post statuses together
76
+ $default['post_status'] = implode( ',', $post_statuses );
77
+
78
+ // Lean on the 'perm' query var value of 'readable' to provide statuses
79
+ } else {
80
+ $default['perm'] = 'readable';
81
+ }
82
+
83
  /** Setup *****************************************************************/
84
 
85
  // Parse arguments against default values
109
  // Only add pagination is query returned results
110
  if ( (int) $bbp->search_query->found_posts && (int) $bbp->search_query->posts_per_page ) {
111
 
112
+ // Array of arguments to add after pagination links
113
+ $add_args = array();
114
+
115
  // If pretty permalinks are enabled, make our pagination pretty
116
  if ( $wp_rewrite->using_permalinks() ) {
117
 
121
 
122
  // Default search location
123
  } else {
124
+ $base = trailingslashit( bbp_get_search_results_url() );
 
125
  }
126
 
127
  // Add pagination base
133
  }
134
 
135
  // Add args
136
+ if ( bbp_get_view_all() ) {
 
137
  $add_args['view'] = 'all';
138
+ }
139
 
140
  // Add pagination to query object
141
  $bbp->search_query->pagination_links = paginate_links(
228
 
229
  // No search terms specified
230
  if ( empty( $search_terms ) ) {
231
+ $title = esc_html__( 'Search', 'bbpress' );
232
 
233
  // Include search terms in title
234
  } else {
235
+ $title = sprintf( esc_html__( "Search Results for '%s'", 'bbpress' ), esc_attr( $search_terms ) );
236
  }
237
+
238
+ return apply_filters( 'bbp_get_search_title', $title, $search_terms );
239
  }
240
 
241
  /**
246
  * @uses bbp_get_search_url() To get the search url
247
  */
248
  function bbp_search_url() {
249
+ echo esc_url( bbp_get_search_url() );
250
  }
251
  /**
252
  * Return the search url
270
 
271
  // Unpretty permalinks
272
  } else {
273
+ $url = add_query_arg( array( 'bbp_search' => '' ), home_url( '/' ) );
 
274
  }
275
 
276
  return apply_filters( 'bbp_get_search_url', $url );
277
  }
278
 
279
+ /**
280
+ * Output the search results url
281
+ *
282
+ * @since bbPress (r4928)
283
+ *
284
+ * @uses bbp_get_search_url() To get the search url
285
+ */
286
+ function bbp_search_results_url() {
287
+ echo esc_url( bbp_get_search_results_url() );
288
+ }
289
+ /**
290
+ * Return the search url
291
+ *
292
+ * @since bbPress (r4928)
293
+ *
294
+ * @uses user_trailingslashit() To fix slashes
295
+ * @uses trailingslashit() To fix slashes
296
+ * @uses bbp_get_forums_url() To get the root forums url
297
+ * @uses bbp_get_search_slug() To get the search slug
298
+ * @uses add_query_arg() To help make unpretty permalinks
299
+ * @return string Search url
300
+ */
301
+ function bbp_get_search_results_url() {
302
+ global $wp_rewrite;
303
+
304
+ // Get the search terms
305
+ $search_terms = bbp_get_search_terms();
306
+
307
+ // Pretty permalinks
308
+ if ( $wp_rewrite->using_permalinks() ) {
309
+
310
+ // Root search URL
311
+ $url = $wp_rewrite->root . bbp_get_search_slug();
312
+
313
+ // Append search terms
314
+ if ( !empty( $search_terms ) ) {
315
+ $url = user_trailingslashit( $url ) . user_trailingslashit( urlencode( $search_terms ) );
316
+ }
317
+
318
+ // Run through home_url()
319
+ $url = home_url( user_trailingslashit( $url ) );
320
+
321
+ // Unpretty permalinks
322
+ } else {
323
+ $url = add_query_arg( array( 'bbp_search' => urlencode( $search_terms ) ), home_url( '/' ) );
324
+ }
325
+
326
+ return apply_filters( 'bbp_get_search_results_url', $url );
327
+ }
328
 
329
  /**
330
  * Output the search terms
346
  * If search terms are supplied, those are used. Otherwise check the
347
  * search rewrite id query var.
348
  *
349
+ * @param string $passed_terms Optional. Search terms
350
  * @uses sanitize_title() To sanitize the search terms
351
  * @uses get_query_var*( To get the search terms from query var 'bbp_search'
352
  * @return bool|string Search terms on success, false on failure
353
  */
354
+ function bbp_get_search_terms( $passed_terms = '' ) {
355
 
356
+ // Sanitize terms if they were passed in
357
+ if ( !empty( $passed_terms ) ) {
358
+ $search_terms = sanitize_title( $passed_terms );
359
 
360
+ // Use query variable if not
361
+ } else {
362
+ $search_terms = get_query_var( bbp_get_search_rewrite_id() );
363
+ }
364
 
365
+ // Trim whitespace and decode, or set explicitly to false if empty
366
+ $search_terms = !empty( $search_terms ) ? urldecode( trim( $search_terms ) ) : false;
367
+
368
+ return apply_filters( 'bbp_get_search_terms', $search_terms, $passed_terms );
369
  }
370
 
371
  /**
413
  }
414
 
415
  // Filter and return
416
+ return apply_filters( 'bbp_get_search_pagination_count', esc_html( $retstr ) );
417
  }
418
 
419
  /**
includes/topics/capabilities.php CHANGED
@@ -84,11 +84,11 @@ function bbp_map_topic_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
84
  $post_type = get_post_type_object( $_post->post_type );
85
 
86
  // Post is public
87
- if ( bbp_get_public_status_id() == $_post->post_status ) {
88
  $caps = array( 'spectate' );
89
 
90
  // User is author so allow read
91
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
92
  $caps = array( 'spectate' );
93
 
94
  // Unknown so map to private posts
@@ -143,8 +143,8 @@ function bbp_map_topic_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
143
  if ( bbp_is_user_inactive( $user_id ) ) {
144
  $caps[] = 'do_not_allow';
145
 
146
- // User is author so allow edit
147
- } elseif ( (int) $user_id == (int) $_post->post_author ) {
148
  $caps[] = $post_type->cap->edit_posts;
149
 
150
  // Unknown, so map to edit_others_posts
84
  $post_type = get_post_type_object( $_post->post_type );
85
 
86
  // Post is public
87
+ if ( bbp_get_public_status_id() === $_post->post_status ) {
88
  $caps = array( 'spectate' );
89
 
90
  // User is author so allow read
91
+ } elseif ( (int) $user_id === (int) $_post->post_author ) {
92
  $caps = array( 'spectate' );
93
 
94
  // Unknown so map to private posts
143
  if ( bbp_is_user_inactive( $user_id ) ) {
144
  $caps[] = 'do_not_allow';
145
 
146
+ // User is author so allow edit if not in admin
147
+ } elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
148
  $caps[] = $post_type->cap->edit_posts;
149
 
150
  // Unknown, so map to edit_others_posts
includes/topics/functions.php CHANGED
@@ -62,13 +62,15 @@ function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
62
  ), 'insert_topic_meta' );
63
 
64
  // Insert topic meta
65
- foreach ( $topic_meta as $meta_key => $meta_value )
66
  update_post_meta( $topic_id, '_bbp_' . $meta_key, $meta_value );
 
67
 
68
  // Update the forum
69
  $forum_id = bbp_get_topic_forum_id( $topic_id );
70
- if ( !empty( $forum_id ) )
71
  bbp_update_forum( array( 'forum_id' => $forum_id ) );
 
72
 
73
  // Return new topic ID
74
  return $topic_id;
@@ -154,7 +156,7 @@ function bbp_new_topic_handler( $action = '' ) {
154
  }
155
 
156
  // Remove kses filters from title and content for capable users and if the nonce is verified
157
- if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && wp_create_nonce( 'bbp-unfiltered-html-topic_new' ) == $_POST['_bbp_unfiltered_html_topic'] ) {
158
  remove_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' );
159
  remove_filter( 'bbp_new_topic_pre_content', 'bbp_encode_bad', 10 );
160
  remove_filter( 'bbp_new_topic_pre_content', 'bbp_filter_kses', 30 );
@@ -186,13 +188,40 @@ function bbp_new_topic_handler( $action = '' ) {
186
 
187
  /** Topic Forum ***********************************************************/
188
 
189
- // Forum id was not passed
190
- if ( empty( $_POST['bbp_forum_id'] ) ) {
191
- bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
192
 
193
- // Forum id was passed
194
- } elseif ( is_numeric( $_POST['bbp_forum_id'] ) ) {
195
- $forum_id = (int) $_POST['bbp_forum_id'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  }
197
 
198
  // Forum exists
@@ -200,26 +229,26 @@ function bbp_new_topic_handler( $action = '' ) {
200
 
201
  // Forum is a category
202
  if ( bbp_is_forum_category( $forum_id ) ) {
203
- bbp_add_error( 'bbp_edit_topic_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No topics can be created in this forum.', 'bbpress' ) );
204
 
205
  // Forum is not a category
206
  } else {
207
 
208
  // Forum is closed and user cannot access
209
  if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) ) {
210
- bbp_add_error( 'bbp_edit_topic_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new topics.', 'bbpress' ) );
211
  }
212
 
213
  // Forum is private and user cannot access
214
  if ( bbp_is_forum_private( $forum_id ) ) {
215
  if ( !current_user_can( 'read_private_forums' ) ) {
216
- bbp_add_error( 'bbp_edit_topic_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new topics in it.', 'bbpress' ) );
217
  }
218
 
219
  // Forum is hidden and user cannot access
220
  } elseif ( bbp_is_forum_hidden( $forum_id ) ) {
221
  if ( !current_user_can( 'read_hidden_forums' ) ) {
222
- bbp_add_error( 'bbp_edit_topic_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new topics in it.', 'bbpress' ) );
223
  }
224
  }
225
  }
@@ -246,7 +275,11 @@ function bbp_new_topic_handler( $action = '' ) {
246
  if ( !bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) {
247
  $topic_status = bbp_get_pending_status_id();
248
 
249
- // Default to published
 
 
 
 
250
  } else {
251
  $topic_status = bbp_get_public_status_id();
252
  }
@@ -301,7 +334,7 @@ function bbp_new_topic_handler( $action = '' ) {
301
 
302
  // If the forum is trash, or the topic_status is switched to
303
  // trash, trash it properly
304
- if ( ( get_post_field( 'post_status', $forum_id ) == bbp_get_trash_status_id() ) || ( $topic_data['post_status'] == bbp_get_trash_status_id() ) ) {
305
 
306
  // Trash the reply
307
  wp_trash_post( $topic_id );
@@ -313,7 +346,7 @@ function bbp_new_topic_handler( $action = '' ) {
313
  /** Spam Check ********************************************************/
314
 
315
  // If reply or topic are spam, officially spam this reply
316
- if ( $topic_data['post_status'] == bbp_get_spam_status_id() ) {
317
  add_post_meta( $topic_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
318
 
319
  // Force view=all
@@ -329,23 +362,27 @@ function bbp_new_topic_handler( $action = '' ) {
329
  // Sticky check after 'bbp_new_topic' action so forum ID meta is set
330
  if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {
331
 
332
- // What's the haps?
333
- switch ( $_POST['bbp_stick_topic'] ) {
334
 
335
- // Sticky in this forum
336
- case 'stick' :
337
- bbp_stick_topic( $topic_id );
338
- break;
339
 
340
- // Super sticky in all forums
341
- case 'super' :
342
- bbp_stick_topic( $topic_id, true );
343
- break;
344
 
345
- // We can avoid this as it is a new topic
346
- case 'unstick' :
347
- default :
348
- break;
 
 
 
 
 
 
349
  }
350
  }
351
 
@@ -485,7 +522,7 @@ function bbp_edit_topic_handler( $action = '' ) {
485
  }
486
 
487
  // Remove kses filters from title and content for capable users and if the nonce is verified
488
- if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-topic_' . $topic_id ) == $_POST['_bbp_unfiltered_html_topic'] ) ) {
489
  remove_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' );
490
  remove_filter( 'bbp_edit_topic_pre_content', 'bbp_encode_bad', 10 );
491
  remove_filter( 'bbp_edit_topic_pre_content', 'bbp_filter_kses', 30 );
@@ -574,6 +611,10 @@ function bbp_edit_topic_handler( $action = '' ) {
574
  $topic_status = bbp_get_pending_status_id();
575
  }
576
 
 
 
 
 
577
  // Use existing post_status
578
  } else {
579
  $topic_status = $topic->post_status;
@@ -656,7 +697,7 @@ function bbp_edit_topic_handler( $action = '' ) {
656
  }
657
 
658
  // Update revision log
659
- if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( 1 == $_POST['bbp_log_topic_edit'] ) ) {
660
  $revision_id = wp_save_post_revision( $topic_id );
661
  if ( ! empty( $revision_id ) ) {
662
  bbp_update_topic_revision_log( array(
@@ -673,32 +714,36 @@ function bbp_edit_topic_handler( $action = '' ) {
673
  // If the new forum id is not equal to the old forum id, run the
674
  // bbp_move_topic action and pass the topic's forum id as the
675
  // first arg and topic id as the second to update counts.
676
- if ( $forum_id != $topic->post_parent ) {
677
  bbp_move_topic_handler( $topic_id, $topic->post_parent, $forum_id );
678
  }
679
 
680
  /** Stickies **********************************************************/
681
 
682
- if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {
683
 
684
- // What's the dilly?
685
- switch ( $_POST['bbp_stick_topic'] ) {
686
 
687
- // Sticky in forum
688
- case 'stick' :
689
- bbp_stick_topic( $topic_id );
690
- break;
691
 
692
- // Sticky in all forums
693
- case 'super' :
694
- bbp_stick_topic( $topic_id, true );
695
- break;
696
 
697
- // Normal
698
- case 'unstick' :
699
- default :
700
- bbp_unstick_topic( $topic_id );
701
- break;
 
 
 
 
 
 
702
  }
703
  }
704
 
@@ -801,7 +846,7 @@ function bbp_update_topic( $topic_id = 0, $forum_id = 0, $anonymous_data = false
801
  ), 'update_topic' );
802
 
803
  // Update all anonymous metas
804
- foreach( $r as $anon_key => $anon_value ) {
805
  update_post_meta( $topic_id, '_' . $anon_key, (string) $anon_value, false );
806
  }
807
 
@@ -819,14 +864,14 @@ function bbp_update_topic( $topic_id = 0, $forum_id = 0, $anonymous_data = false
819
  // Handle Subscription Checkbox
820
  if ( bbp_is_subscriptions_active() && !empty( $author_id ) ) {
821
  $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
822
- $subscheck = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' == $_POST['bbp_topic_subscription'] ) ) ? true : false;
823
 
824
  // Subscribed and unsubscribing
825
- if ( true == $subscribed && false == $subscheck ) {
826
  bbp_remove_user_subscription( $author_id, $topic_id );
827
 
828
  // Subscribing
829
- } elseif ( false == $subscribed && true == $subscheck ) {
830
  bbp_add_user_subscription( $author_id, $topic_id );
831
  }
832
  }
@@ -902,7 +947,7 @@ function bbp_update_topic_walker( $topic_id, $last_active_time = '', $forum_id =
902
  $topic_status = get_post_status( $topic_id );
903
 
904
  // If we want a full refresh, unset any of the possibly passed variables
905
- if ( true == $refresh ) {
906
  $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
907
  $topic_status = bbp_get_public_status_id();
908
  }
@@ -972,13 +1017,13 @@ function bbp_move_topic_handler( $topic_id, $old_forum_id, $new_forum_id ) {
972
 
973
  // Loop through stickies of forum and add misses to the updated array
974
  foreach ( (array) $old_stickies as $sticky_topic_id ) {
975
- if ( $topic_id != $sticky_topic_id ) {
976
  $updated_stickies[] = $sticky_topic_id;
977
  }
978
  }
979
 
980
  // If stickies are different, update or delete them
981
- if ( $updated_stickies != $old_stickies ) {
982
 
983
  // No more stickies so delete the meta
984
  if ( empty( $updated_stickies ) ) {
@@ -1153,14 +1198,12 @@ function bbp_merge_topic_handler( $action = '' ) {
1153
  // Set destination topic post_date to 1 second before source topic
1154
  $destination_post_date = date( 'Y-m-d H:i:s', strtotime( $source_topic->post_date ) - 1 );
1155
 
1156
- $postarr = array(
 
1157
  'ID' => $destination_topic_id,
1158
  'post_date' => $destination_post_date,
1159
  'post_date_gmt' => get_gmt_from_date( $destination_post_date )
1160
- );
1161
-
1162
- // Update destination topic
1163
- wp_update_post( $postarr );
1164
  }
1165
 
1166
  /** Subscriptions *********************************************************/
@@ -1175,7 +1218,7 @@ function bbp_merge_topic_handler( $action = '' ) {
1175
  foreach ( (array) $subscribers as $subscriber ) {
1176
 
1177
  // Shift the subscriber if told to
1178
- if ( !empty( $_POST['bbp_topic_subscribers'] ) && ( 1 == $_POST['bbp_topic_subscribers'] ) && bbp_is_subscriptions_active() )
1179
  bbp_add_user_subscription( $subscriber, $destination_topic->ID );
1180
 
1181
  // Remove old subscription
@@ -1195,7 +1238,7 @@ function bbp_merge_topic_handler( $action = '' ) {
1195
  foreach ( (array) $favoriters as $favoriter ) {
1196
 
1197
  // Shift the favoriter if told to
1198
- if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 == $_POST['bbp_topic_favoriters'] )
1199
  bbp_add_user_favorite( $favoriter, $destination_topic->ID );
1200
 
1201
  // Remove old favorite
@@ -1212,7 +1255,7 @@ function bbp_merge_topic_handler( $action = '' ) {
1212
  if ( !empty( $source_topic_tags ) && !is_wp_error( $source_topic_tags ) ) {
1213
 
1214
  // Shift the tags if told to
1215
- if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 == $_POST['bbp_topic_tags'] ) )
1216
  wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
1217
 
1218
  // Delete the tags from the source topic
@@ -1244,21 +1287,27 @@ function bbp_merge_topic_handler( $action = '' ) {
1244
 
1245
  // Change the post_parent of each reply to the destination topic id
1246
  foreach ( $replies as $reply ) {
1247
- $postarr = array(
 
 
1248
  'ID' => $reply->ID,
1249
  'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
1250
  'post_name' => false,
1251
  'post_type' => bbp_get_reply_post_type(),
1252
  'post_parent' => $destination_topic->ID,
1253
  'guid' => ''
1254
- );
1255
-
1256
- wp_update_post( $postarr );
1257
 
1258
  // Adjust reply meta values
1259
  bbp_update_reply_topic_id( $reply->ID, $destination_topic->ID );
1260
  bbp_update_reply_forum_id( $reply->ID, bbp_get_topic_forum_id( $destination_topic->ID ) );
1261
 
 
 
 
 
 
 
1262
  // Do additional actions per merged reply
1263
  do_action( 'bbp_merged_topic_reply', $reply->ID, $destination_topic->ID );
1264
  }
@@ -1464,25 +1513,23 @@ function bbp_split_topic_handler( $action = '' ) {
1464
  $destination_topic_title = $source_topic->post_title;
1465
  }
1466
 
1467
- // Setup the updated topic parameters
1468
- $postarr = array(
1469
  'ID' => $from_reply->ID,
1470
  'post_title' => $destination_topic_title,
1471
  'post_name' => false,
1472
  'post_type' => bbp_get_topic_post_type(),
1473
  'post_parent' => $source_topic->post_parent,
 
1474
  'guid' => ''
1475
- );
1476
-
1477
- // Update the topic
1478
- $destination_topic_id = wp_update_post( $postarr );
1479
- $destination_topic = bbp_get_topic( $destination_topic_id );
1480
 
1481
  // Make sure the new topic knows its a topic
1482
  bbp_update_topic_topic_id( $from_reply->ID );
1483
 
1484
  // Shouldn't happen
1485
- if ( false == $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
1486
  bbp_add_error( 'bbp_split_topic_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
1487
  }
1488
 
@@ -1512,20 +1559,18 @@ function bbp_split_topic_handler( $action = '' ) {
1512
  // Set destination topic post_date to 1 second before from reply
1513
  $destination_post_date = date( 'Y-m-d H:i:s', strtotime( $from_reply->post_date ) - 1 );
1514
 
1515
- $postarr = array(
 
1516
  'ID' => $destination_topic_id,
1517
  'post_date' => $destination_post_date,
1518
  'post_date_gmt' => get_gmt_from_date( $destination_post_date )
1519
- );
1520
-
1521
- // Update destination topic
1522
- wp_update_post( $postarr );
1523
  }
1524
 
1525
  /** Subscriptions *********************************************************/
1526
 
1527
  // Copy the subscribers
1528
- if ( !empty( $_POST['bbp_topic_subscribers'] ) && 1 == $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
1529
 
1530
  // Get the subscribers
1531
  $subscribers = bbp_get_topic_subscribers( $source_topic->ID );
@@ -1542,7 +1587,7 @@ function bbp_split_topic_handler( $action = '' ) {
1542
  /** Favorites *************************************************************/
1543
 
1544
  // Copy the favoriters if told to
1545
- if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 == $_POST['bbp_topic_favoriters'] ) {
1546
 
1547
  // Get the favoriters
1548
  $favoriters = bbp_get_topic_favoriters( $source_topic->ID );
@@ -1559,7 +1604,7 @@ function bbp_split_topic_handler( $action = '' ) {
1559
  /** Tags ******************************************************************/
1560
 
1561
  // Copy the tags if told to
1562
- if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 == $_POST['bbp_topic_tags'] ) ) {
1563
 
1564
  // Get the source topic tags
1565
  $source_topic_tags = wp_get_post_terms( $source_topic->ID, bbp_get_topic_tag_tax_id(), array( 'fields' => 'names' ) );
@@ -1592,33 +1637,54 @@ function bbp_split_topic_handler( $action = '' ) {
1592
  break;
1593
  }
1594
 
 
 
 
1595
  // Change the post_parent of each reply to the destination topic id
1596
  foreach ( $replies as $reply ) {
1597
 
1598
  // Bump the reply position each iteration through the loop
1599
  $reply_position++;
1600
 
1601
- // New reply data
1602
- $postarr = array(
1603
- 'ID' => $reply->ID,
1604
- 'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
1605
- 'post_name' => false, // will be automatically generated
1606
- 'post_parent' => $destination_topic->ID,
1607
- 'post_position' => $reply_position,
1608
- 'guid' => ''
1609
- );
1610
-
1611
  // Update the reply
1612
- wp_update_post( $postarr );
 
 
 
 
 
 
 
 
 
 
1613
 
1614
  // Adjust reply meta values
1615
  bbp_update_reply_topic_id( $reply->ID, $destination_topic->ID );
1616
  bbp_update_reply_forum_id( $reply->ID, bbp_get_topic_forum_id( $destination_topic->ID ) );
1617
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1618
  // Do additional actions per split reply
1619
  do_action( 'bbp_split_topic_reply', $reply->ID, $destination_topic->ID );
1620
  }
1621
 
 
 
 
 
 
1622
  // Set the last reply ID and freshness
1623
  $last_reply_id = $reply->ID;
1624
  $freshness = $reply->post_date;
@@ -1631,7 +1697,7 @@ function bbp_split_topic_handler( $action = '' ) {
1631
 
1632
  // It is a new topic and we need to set some default metas to make
1633
  // the topic display in bbp_has_topics() list
1634
- if ( 'reply' == $split_option ) {
1635
  bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id );
1636
  bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id );
1637
  bbp_update_topic_last_active_time( $destination_topic->ID, $freshness );
@@ -1820,7 +1886,7 @@ function bbp_edit_topic_tag_handler( $action = '' ) {
1820
  $to_tag = $tag['term_id'];
1821
 
1822
  // Attempting to merge a tag into itself
1823
- if ( $tag_id == $to_tag ) {
1824
  bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>ERROR</strong>: The tags which are being merged can not be the same.', 'bbpress' ) );
1825
  return;
1826
  }
@@ -1885,6 +1951,40 @@ function bbp_edit_topic_tag_handler( $action = '' ) {
1885
  exit();
1886
  }
1887
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1888
  /** Stickies ******************************************************************/
1889
 
1890
  /**
@@ -1986,7 +2086,7 @@ function bbp_toggle_topic_handler( $action = '' ) {
1986
  return;
1987
 
1988
  // What is the user doing here?
1989
- if ( !current_user_can( 'edit_topic', $topic->ID ) || ( 'bbp_toggle_topic_trash' == $action && !current_user_can( 'delete_topic', $topic->ID ) ) ) {
1990
  bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that.', 'bbpress' ) );
1991
  return;
1992
  }
@@ -1999,8 +2099,8 @@ function bbp_toggle_topic_handler( $action = '' ) {
1999
  check_ajax_referer( 'close-topic_' . $topic_id );
2000
 
2001
  $is_open = bbp_is_topic_open( $topic_id );
2002
- $success = $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
2003
- $failure = $is_open ? __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'bbpress' );
2004
 
2005
  break;
2006
 
@@ -2009,9 +2109,9 @@ function bbp_toggle_topic_handler( $action = '' ) {
2009
  check_ajax_referer( 'stick-topic_' . $topic_id );
2010
 
2011
  $is_sticky = bbp_is_topic_sticky( $topic_id );
2012
- $is_super = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 == (int) $_GET['super'] ) ? true : false;
2013
- $success = $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
2014
- $failure = $is_sticky ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' );
2015
 
2016
  break;
2017
 
@@ -2020,8 +2120,8 @@ function bbp_toggle_topic_handler( $action = '' ) {
2020
  check_ajax_referer( 'spam-topic_' . $topic_id );
2021
 
2022
  $is_spam = bbp_is_topic_spam( $topic_id );
2023
- $success = $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
2024
- $failure = $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );
2025
  $view_all = !$is_spam;
2026
 
2027
  break;
@@ -2029,7 +2129,7 @@ function bbp_toggle_topic_handler( $action = '' ) {
2029
  // Toggle trash
2030
  case 'bbp_toggle_topic_trash' :
2031
 
2032
- $sub_action = in_array( $_GET['sub_action'], array( 'trash', 'untrash', 'delete' ) ) ? $_GET['sub_action'] : false;
2033
 
2034
  if ( empty( $sub_action ) )
2035
  break;
@@ -2068,10 +2168,10 @@ function bbp_toggle_topic_handler( $action = '' ) {
2068
  do_action( 'bbp_toggle_topic_handler', $success, $post_data, $action );
2069
 
2070
  // No errors
2071
- if ( false != $success && !is_wp_error( $success ) ) {
2072
 
2073
  // Redirect back to the topic's forum
2074
- if ( isset( $sub_action ) && ( 'delete' == $sub_action ) ) {
2075
  $redirect = bbp_get_forum_permalink( $success->post_parent );
2076
 
2077
  // Redirect back to the topic
@@ -2340,7 +2440,8 @@ function bbp_update_topic_reply_count_hidden( $topic_id = 0, $reply_count = 0 )
2340
 
2341
  // Get replies of topic
2342
  if ( empty( $reply_count ) ) {
2343
- $reply_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() ) );
 
2344
  }
2345
 
2346
  update_post_meta( $topic_id, '_bbp_reply_count_hidden', (int) $reply_count );
@@ -2385,7 +2486,7 @@ function bbp_update_topic_last_active_id( $topic_id = 0, $active_id = 0 ) {
2385
  }
2386
 
2387
  // Update only if published
2388
- if ( bbp_get_public_status_id() == get_post_status( $active_id ) ) {
2389
  update_post_meta( $topic_id, '_bbp_last_active_id', (int) $active_id );
2390
  }
2391
 
@@ -2602,37 +2703,38 @@ function bbp_update_topic_revision_log( $args = '' ) {
2602
  * @since bbPress (r2740)
2603
  *
2604
  * @param int $topic_id Topic id
2605
- * @uses get_post() To get the topic
2606
  * @uses do_action() Calls 'bbp_close_topic' with the topic id
2607
  * @uses add_post_meta() To add the previous status to a meta
2608
- * @uses wp_insert_post() To update the topic with the new status
2609
  * @uses do_action() Calls 'bbp_opened_topic' with the topic id
2610
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2611
  */
2612
  function bbp_close_topic( $topic_id = 0 ) {
2613
 
2614
  // Get topic
2615
- if ( !$topic = get_post( $topic_id, ARRAY_A ) )
 
2616
  return $topic;
2617
 
2618
  // Bail if already closed
2619
- if ( bbp_get_closed_status_id() == $topic['post_status'] )
2620
  return false;
2621
 
2622
  // Execute pre close code
2623
  do_action( 'bbp_close_topic', $topic_id );
2624
 
2625
  // Add pre close status
2626
- add_post_meta( $topic_id, '_bbp_status', $topic['post_status'] );
2627
 
2628
  // Set closed status
2629
- $topic['post_status'] = bbp_get_closed_status_id();
2630
 
2631
  // No revisions
2632
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2633
 
2634
  // Update topic
2635
- $topic_id = wp_insert_post( $topic );
2636
 
2637
  // Execute post close code
2638
  do_action( 'bbp_closed_topic', $topic_id );
@@ -2647,32 +2749,33 @@ function bbp_close_topic( $topic_id = 0 ) {
2647
  * @since bbPress (r2740)
2648
  *
2649
  * @param int $topic_id Topic id
2650
- * @uses get_post() To get the topic
2651
  * @uses do_action() Calls 'bbp_open_topic' with the topic id
2652
  * @uses get_post_meta() To get the previous status
2653
  * @uses delete_post_meta() To delete the previous status meta
2654
- * @uses wp_insert_post() To update the topic with the new status
2655
  * @uses do_action() Calls 'bbp_opened_topic' with the topic id
2656
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2657
  */
2658
  function bbp_open_topic( $topic_id = 0 ) {
2659
 
2660
  // Get topic
2661
- if ( !$topic = get_post( $topic_id, ARRAY_A ) )
 
2662
  return $topic;
2663
 
2664
  // Bail if already open
2665
- if ( bbp_get_closed_status_id() != $topic['post_status'])
2666
  return false;
2667
 
2668
  // Execute pre open code
2669
  do_action( 'bbp_open_topic', $topic_id );
2670
 
2671
  // Get previous status
2672
- $topic_status = get_post_meta( $topic_id, '_bbp_status', true );
2673
 
2674
  // Set previous status
2675
- $topic['post_status'] = $topic_status;
2676
 
2677
  // Remove old status meta
2678
  delete_post_meta( $topic_id, '_bbp_status' );
@@ -2681,7 +2784,7 @@ function bbp_open_topic( $topic_id = 0 ) {
2681
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2682
 
2683
  // Update topic
2684
- $topic_id = wp_insert_post( $topic );
2685
 
2686
  // Execute post open code
2687
  do_action( 'bbp_opened_topic', $topic_id );
@@ -2696,21 +2799,22 @@ function bbp_open_topic( $topic_id = 0 ) {
2696
  * @since bbPress (r2740)
2697
  *
2698
  * @param int $topic_id Topic id
2699
- * @uses get_post() To get the topic
2700
  * @uses do_action() Calls 'bbp_spam_topic' with the topic id
2701
  * @uses add_post_meta() To add the previous status to a meta
2702
- * @uses wp_insert_post() To update the topic with the new status
2703
  * @uses do_action() Calls 'bbp_spammed_topic' with the topic id
2704
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2705
  */
2706
  function bbp_spam_topic( $topic_id = 0 ) {
2707
 
2708
  // Get the topic
2709
- if ( !$topic = get_post( $topic_id, ARRAY_A ) )
 
2710
  return $topic;
2711
 
2712
  // Bail if topic is spam
2713
- if ( bbp_get_spam_status_id() == $topic['post_status'] )
2714
  return false;
2715
 
2716
  // Execute pre spam code
@@ -2755,7 +2859,7 @@ function bbp_spam_topic( $topic_id = 0 ) {
2755
  /** Topic Tags ************************************************************/
2756
 
2757
  // Add the original post status as post meta for future restoration
2758
- add_post_meta( $topic_id, '_bbp_spam_meta_status', $topic['post_status'] );
2759
 
2760
  // Get topic tags
2761
  $terms = get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() );
@@ -2767,7 +2871,7 @@ function bbp_spam_topic( $topic_id = 0 ) {
2767
  if ( !empty( $terms ) ) {
2768
 
2769
  // Loop through and collect term names
2770
- foreach( $terms as $term ) {
2771
  $term_names[] = $term->name;
2772
  }
2773
 
@@ -2778,18 +2882,18 @@ function bbp_spam_topic( $topic_id = 0 ) {
2778
  add_post_meta( $topic_id, '_bbp_spam_topic_tags', $term_names );
2779
 
2780
  // Empty the topic of its tags
2781
- $topic['tax_input'] = array( bbp_get_topic_tag_tax_id() => '' );
2782
  }
2783
  }
2784
 
2785
  // Set post status to spam
2786
- $topic['post_status'] = bbp_get_spam_status_id();
2787
 
2788
  // No revisions
2789
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2790
 
2791
  // Update the topic
2792
- $topic_id = wp_insert_post( $topic );
2793
 
2794
  // Execute post spam code
2795
  do_action( 'bbp_spammed_topic', $topic_id );
@@ -2804,22 +2908,23 @@ function bbp_spam_topic( $topic_id = 0 ) {
2804
  * @since bbPress (r2740)
2805
  *
2806
  * @param int $topic_id Topic id
2807
- * @uses get_post() To get the topic
2808
  * @uses do_action() Calls 'bbp_unspam_topic' with the topic id
2809
  * @uses get_post_meta() To get the previous status
2810
  * @uses delete_post_meta() To delete the previous status meta
2811
- * @uses wp_insert_post() To update the topic with the new status
2812
  * @uses do_action() Calls 'bbp_unspammed_topic' with the topic id
2813
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2814
  */
2815
  function bbp_unspam_topic( $topic_id = 0 ) {
2816
 
2817
  // Get the topic
2818
- if ( !$topic = get_post( $topic_id, ARRAY_A ) )
 
2819
  return $topic;
2820
 
2821
  // Bail if already not spam
2822
- if ( bbp_get_spam_status_id() != $topic['post_status'] )
2823
  return false;
2824
 
2825
  // Execute pre unspam code
@@ -2852,7 +2957,7 @@ function bbp_unspam_topic( $topic_id = 0 ) {
2852
  if ( !empty( $terms ) ) {
2853
 
2854
  // Set the tax_input of the topic
2855
- $topic['tax_input'] = array( bbp_get_topic_tag_tax_id() => $terms );
2856
 
2857
  // Delete pre-spam topic tag meta
2858
  delete_post_meta( $topic_id, '_bbp_spam_topic_tags' );
@@ -2869,7 +2974,7 @@ function bbp_unspam_topic( $topic_id = 0 ) {
2869
  }
2870
 
2871
  // Set post status to pre spam
2872
- $topic['post_status'] = $topic_status;
2873
 
2874
  // Delete pre spam meta
2875
  delete_post_meta( $topic_id, '_bbp_spam_meta_status' );
@@ -2878,7 +2983,7 @@ function bbp_unspam_topic( $topic_id = 0 ) {
2878
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2879
 
2880
  // Update the topic
2881
- $topic_id = wp_insert_post( $topic );
2882
 
2883
  // Execute post unspam code
2884
  do_action( 'bbp_unspammed_topic', $topic_id );
@@ -3253,7 +3358,7 @@ function bbp_get_topic_tag_names( $topic_id = 0, $sep = ', ' ) {
3253
  $topic_id = bbp_get_topic_id( $topic_id );
3254
  $topic_tags = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) );
3255
  $terms = array();
3256
- foreach( $topic_tags as $term ) {
3257
  $terms[] = $term->name;
3258
  }
3259
  $terms = !empty( $terms ) ? implode( $sep, $terms ) : '';
@@ -3355,7 +3460,7 @@ function bbp_display_topics_feed_rss2( $topics_query = array() ) {
3355
 
3356
  <description>
3357
  <![CDATA[
3358
- <p><?php printf( __( 'Replies: %s', 'bbpress' ), bbp_get_topic_reply_count() ); ?></p>
3359
  <?php bbp_topic_content(); ?>
3360
  ]]>
3361
  </description>
62
  ), 'insert_topic_meta' );
63
 
64
  // Insert topic meta
65
+ foreach ( $topic_meta as $meta_key => $meta_value ) {
66
  update_post_meta( $topic_id, '_bbp_' . $meta_key, $meta_value );
67
+ }
68
 
69
  // Update the forum
70
  $forum_id = bbp_get_topic_forum_id( $topic_id );
71
+ if ( !empty( $forum_id ) ) {
72
  bbp_update_forum( array( 'forum_id' => $forum_id ) );
73
+ }
74
 
75
  // Return new topic ID
76
  return $topic_id;
156
  }
157
 
158
  // Remove kses filters from title and content for capable users and if the nonce is verified
159
+ if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && wp_create_nonce( 'bbp-unfiltered-html-topic_new' ) === $_POST['_bbp_unfiltered_html_topic'] ) {
160
  remove_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' );
161
  remove_filter( 'bbp_new_topic_pre_content', 'bbp_encode_bad', 10 );
162
  remove_filter( 'bbp_new_topic_pre_content', 'bbp_filter_kses', 30 );
188
 
189
  /** Topic Forum ***********************************************************/
190
 
191
+ // Error check the POST'ed topic id
192
+ if ( isset( $_POST['bbp_forum_id'] ) ) {
 
193
 
194
+ // Empty Forum id was passed
195
+ if ( empty( $_POST['bbp_forum_id'] ) ) {
196
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
197
+
198
+ // Forum id is not a number
199
+ } elseif ( ! is_numeric( $_POST['bbp_forum_id'] ) ) {
200
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID must be a number.', 'bbpress' ) );
201
+
202
+ // Forum id might be valid
203
+ } else {
204
+
205
+ // Get the forum id
206
+ $posted_forum_id = intval( $_POST['bbp_forum_id'] );
207
+
208
+ // Forum id is empty
209
+ if ( 0 === $posted_forum_id ) {
210
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
211
+
212
+ // Forum id is a negative number
213
+ } elseif ( 0 > $posted_forum_id ) {
214
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID cannot be a negative number.', 'bbpress' ) );
215
+
216
+ // Forum does not exist
217
+ } elseif ( ! bbp_get_forum( $posted_forum_id ) ) {
218
+ bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum does not exist.', 'bbpress' ) );
219
+
220
+ // Use the POST'ed forum id
221
+ } else {
222
+ $forum_id = $posted_forum_id;
223
+ }
224
+ }
225
  }
226
 
227
  // Forum exists
229
 
230
  // Forum is a category
231
  if ( bbp_is_forum_category( $forum_id ) ) {
232
+ bbp_add_error( 'bbp_new_topic_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No topics can be created in this forum.', 'bbpress' ) );
233
 
234
  // Forum is not a category
235
  } else {
236
 
237
  // Forum is closed and user cannot access
238
  if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) ) {
239
+ bbp_add_error( 'bbp_new_topic_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new topics.', 'bbpress' ) );
240
  }
241
 
242
  // Forum is private and user cannot access
243
  if ( bbp_is_forum_private( $forum_id ) ) {
244
  if ( !current_user_can( 'read_private_forums' ) ) {
245
+ bbp_add_error( 'bbp_new_topic_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new topics in it.', 'bbpress' ) );
246
  }
247
 
248
  // Forum is hidden and user cannot access
249
  } elseif ( bbp_is_forum_hidden( $forum_id ) ) {
250
  if ( !current_user_can( 'read_hidden_forums' ) ) {
251
+ bbp_add_error( 'bbp_new_topic_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new topics in it.', 'bbpress' ) );
252
  }
253
  }
254
  }
275
  if ( !bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) {
276
  $topic_status = bbp_get_pending_status_id();
277
 
278
+ // Check a whitelist of possible topic status ID's
279
+ } elseif ( !empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( bbp_get_topic_statuses() ) ) ) {
280
+ $topic_status = $_POST['bbp_topic_status'];
281
+
282
+ // Default to published if nothing else
283
  } else {
284
  $topic_status = bbp_get_public_status_id();
285
  }
334
 
335
  // If the forum is trash, or the topic_status is switched to
336
  // trash, trash it properly
337
+ if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $topic_data['post_status'] === bbp_get_trash_status_id() ) ) {
338
 
339
  // Trash the reply
340
  wp_trash_post( $topic_id );
346
  /** Spam Check ********************************************************/
347
 
348
  // If reply or topic are spam, officially spam this reply
349
+ if ( $topic_data['post_status'] === bbp_get_spam_status_id() ) {
350
  add_post_meta( $topic_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
351
 
352
  // Force view=all
362
  // Sticky check after 'bbp_new_topic' action so forum ID meta is set
363
  if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {
364
 
365
+ // What's the caps?
366
+ if ( current_user_can( 'moderate' ) ) {
367
 
368
+ // What's the haps?
369
+ switch ( $_POST['bbp_stick_topic'] ) {
 
 
370
 
371
+ // Sticky in this forum
372
+ case 'stick' :
373
+ bbp_stick_topic( $topic_id );
374
+ break;
375
 
376
+ // Super sticky in all forums
377
+ case 'super' :
378
+ bbp_stick_topic( $topic_id, true );
379
+ break;
380
+
381
+ // We can avoid this as it is a new topic
382
+ case 'unstick' :
383
+ default :
384
+ break;
385
+ }
386
  }
387
  }
388
 
522
  }
523
 
524
  // Remove kses filters from title and content for capable users and if the nonce is verified
525
+ if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-topic_' . $topic_id ) === $_POST['_bbp_unfiltered_html_topic'] ) ) {
526
  remove_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' );
527
  remove_filter( 'bbp_edit_topic_pre_content', 'bbp_encode_bad', 10 );
528
  remove_filter( 'bbp_edit_topic_pre_content', 'bbp_filter_kses', 30 );
611
  $topic_status = bbp_get_pending_status_id();
612
  }
613
 
614
+ // Check a whitelist of possible topic status ID's
615
+ } elseif ( !empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( bbp_get_topic_statuses() ) ) ) {
616
+ $topic_status = $_POST['bbp_topic_status'];
617
+
618
  // Use existing post_status
619
  } else {
620
  $topic_status = $topic->post_status;
697
  }
698
 
699
  // Update revision log
700
+ if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( "1" === $_POST['bbp_log_topic_edit'] ) ) {
701
  $revision_id = wp_save_post_revision( $topic_id );
702
  if ( ! empty( $revision_id ) ) {
703
  bbp_update_topic_revision_log( array(
714
  // If the new forum id is not equal to the old forum id, run the
715
  // bbp_move_topic action and pass the topic's forum id as the
716
  // first arg and topic id as the second to update counts.
717
+ if ( $forum_id !== $topic->post_parent ) {
718
  bbp_move_topic_handler( $topic_id, $topic->post_parent, $forum_id );
719
  }
720
 
721
  /** Stickies **********************************************************/
722
 
723
+ if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array_keys( bbp_get_topic_types() ) ) ) {
724
 
725
+ // What's the caps?
726
+ if ( current_user_can( 'moderate' ) ) {
727
 
728
+ // What's the haps?
729
+ switch ( $_POST['bbp_stick_topic'] ) {
 
 
730
 
731
+ // Sticky in forum
732
+ case 'stick' :
733
+ bbp_stick_topic( $topic_id );
734
+ break;
735
 
736
+ // Sticky in all forums
737
+ case 'super' :
738
+ bbp_stick_topic( $topic_id, true );
739
+ break;
740
+
741
+ // Normal
742
+ case 'unstick' :
743
+ default :
744
+ bbp_unstick_topic( $topic_id );
745
+ break;
746
+ }
747
  }
748
  }
749
 
846
  ), 'update_topic' );
847
 
848
  // Update all anonymous metas
849
+ foreach ( $r as $anon_key => $anon_value ) {
850
  update_post_meta( $topic_id, '_' . $anon_key, (string) $anon_value, false );
851
  }
852
 
864
  // Handle Subscription Checkbox
865
  if ( bbp_is_subscriptions_active() && !empty( $author_id ) ) {
866
  $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
867
+ $subscheck = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) ) ? true : false;
868
 
869
  // Subscribed and unsubscribing
870
+ if ( true === $subscribed && false === $subscheck ) {
871
  bbp_remove_user_subscription( $author_id, $topic_id );
872
 
873
  // Subscribing
874
+ } elseif ( false === $subscribed && true === $subscheck ) {
875
  bbp_add_user_subscription( $author_id, $topic_id );
876
  }
877
  }
947
  $topic_status = get_post_status( $topic_id );
948
 
949
  // If we want a full refresh, unset any of the possibly passed variables
950
+ if ( true === $refresh ) {
951
  $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
952
  $topic_status = bbp_get_public_status_id();
953
  }
1017
 
1018
  // Loop through stickies of forum and add misses to the updated array
1019
  foreach ( (array) $old_stickies as $sticky_topic_id ) {
1020
+ if ( $topic_id !== $sticky_topic_id ) {
1021
  $updated_stickies[] = $sticky_topic_id;
1022
  }
1023
  }
1024
 
1025
  // If stickies are different, update or delete them
1026
+ if ( $updated_stickies !== $old_stickies ) {
1027
 
1028
  // No more stickies so delete the meta
1029
  if ( empty( $updated_stickies ) ) {
1198
  // Set destination topic post_date to 1 second before source topic
1199
  $destination_post_date = date( 'Y-m-d H:i:s', strtotime( $source_topic->post_date ) - 1 );
1200
 
1201
+ // Update destination topic
1202
+ wp_update_post( array(
1203
  'ID' => $destination_topic_id,
1204
  'post_date' => $destination_post_date,
1205
  'post_date_gmt' => get_gmt_from_date( $destination_post_date )
1206
+ ) );
 
 
 
1207
  }
1208
 
1209
  /** Subscriptions *********************************************************/
1218
  foreach ( (array) $subscribers as $subscriber ) {
1219
 
1220
  // Shift the subscriber if told to
1221
+ if ( !empty( $_POST['bbp_topic_subscribers'] ) && ( "1" === $_POST['bbp_topic_subscribers'] ) && bbp_is_subscriptions_active() )
1222
  bbp_add_user_subscription( $subscriber, $destination_topic->ID );
1223
 
1224
  // Remove old subscription
1238
  foreach ( (array) $favoriters as $favoriter ) {
1239
 
1240
  // Shift the favoriter if told to
1241
+ if ( !empty( $_POST['bbp_topic_favoriters'] ) && "1" === $_POST['bbp_topic_favoriters'] )
1242
  bbp_add_user_favorite( $favoriter, $destination_topic->ID );
1243
 
1244
  // Remove old favorite
1255
  if ( !empty( $source_topic_tags ) && !is_wp_error( $source_topic_tags ) ) {
1256
 
1257
  // Shift the tags if told to
1258
+ if ( !empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) )
1259
  wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
1260
 
1261
  // Delete the tags from the source topic
1287
 
1288
  // Change the post_parent of each reply to the destination topic id
1289
  foreach ( $replies as $reply ) {
1290
+
1291
+ // Update the reply
1292
+ wp_update_post( array(
1293
  'ID' => $reply->ID,
1294
  'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
1295
  'post_name' => false,
1296
  'post_type' => bbp_get_reply_post_type(),
1297
  'post_parent' => $destination_topic->ID,
1298
  'guid' => ''
1299
+ ) );
 
 
1300
 
1301
  // Adjust reply meta values
1302
  bbp_update_reply_topic_id( $reply->ID, $destination_topic->ID );
1303
  bbp_update_reply_forum_id( $reply->ID, bbp_get_topic_forum_id( $destination_topic->ID ) );
1304
 
1305
+ // Adjust reply to values
1306
+ $reply_to = bbp_get_reply_to( $reply->ID );
1307
+ if ( empty( $reply_to ) ) {
1308
+ bbp_update_reply_to( $reply->ID, $source_topic->ID );
1309
+ }
1310
+
1311
  // Do additional actions per merged reply
1312
  do_action( 'bbp_merged_topic_reply', $reply->ID, $destination_topic->ID );
1313
  }
1513
  $destination_topic_title = $source_topic->post_title;
1514
  }
1515
 
1516
+ // Update the topic
1517
+ $destination_topic_id = wp_update_post( array(
1518
  'ID' => $from_reply->ID,
1519
  'post_title' => $destination_topic_title,
1520
  'post_name' => false,
1521
  'post_type' => bbp_get_topic_post_type(),
1522
  'post_parent' => $source_topic->post_parent,
1523
+ 'menu_order' => 0,
1524
  'guid' => ''
1525
+ ) );
1526
+ $destination_topic = bbp_get_topic( $destination_topic_id );
 
 
 
1527
 
1528
  // Make sure the new topic knows its a topic
1529
  bbp_update_topic_topic_id( $from_reply->ID );
1530
 
1531
  // Shouldn't happen
1532
+ if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
1533
  bbp_add_error( 'bbp_split_topic_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
1534
  }
1535
 
1559
  // Set destination topic post_date to 1 second before from reply
1560
  $destination_post_date = date( 'Y-m-d H:i:s', strtotime( $from_reply->post_date ) - 1 );
1561
 
1562
+ // Update destination topic
1563
+ wp_update_post( array(
1564
  'ID' => $destination_topic_id,
1565
  'post_date' => $destination_post_date,
1566
  'post_date_gmt' => get_gmt_from_date( $destination_post_date )
1567
+ ) );
 
 
 
1568
  }
1569
 
1570
  /** Subscriptions *********************************************************/
1571
 
1572
  // Copy the subscribers
1573
+ if ( !empty( $_POST['bbp_topic_subscribers'] ) && "1" === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
1574
 
1575
  // Get the subscribers
1576
  $subscribers = bbp_get_topic_subscribers( $source_topic->ID );
1587
  /** Favorites *************************************************************/
1588
 
1589
  // Copy the favoriters if told to
1590
+ if ( !empty( $_POST['bbp_topic_favoriters'] ) && ( "1" === $_POST['bbp_topic_favoriters'] ) ) {
1591
 
1592
  // Get the favoriters
1593
  $favoriters = bbp_get_topic_favoriters( $source_topic->ID );
1604
  /** Tags ******************************************************************/
1605
 
1606
  // Copy the tags if told to
1607
+ if ( !empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
1608
 
1609
  // Get the source topic tags
1610
  $source_topic_tags = wp_get_post_terms( $source_topic->ID, bbp_get_topic_tag_tax_id(), array( 'fields' => 'names' ) );
1637
  break;
1638
  }
1639
 
1640
+ // Save reply ids
1641
+ $reply_ids = array();
1642
+
1643
  // Change the post_parent of each reply to the destination topic id
1644
  foreach ( $replies as $reply ) {
1645
 
1646
  // Bump the reply position each iteration through the loop
1647
  $reply_position++;
1648
 
 
 
 
 
 
 
 
 
 
 
1649
  // Update the reply
1650
+ wp_update_post( array(
1651
+ 'ID' => $reply->ID,
1652
+ 'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
1653
+ 'post_name' => false, // will be automatically generated
1654
+ 'post_parent' => $destination_topic->ID,
1655
+ 'menu_order' => $reply_position,
1656
+ 'guid' => ''
1657
+ ) );
1658
+
1659
+ // Gather reply ids
1660
+ $reply_ids[] = $reply->ID;
1661
 
1662
  // Adjust reply meta values
1663
  bbp_update_reply_topic_id( $reply->ID, $destination_topic->ID );
1664
  bbp_update_reply_forum_id( $reply->ID, bbp_get_topic_forum_id( $destination_topic->ID ) );
1665
 
1666
+ // Adjust reply to values
1667
+ $reply_to = bbp_get_reply_to( $reply->ID );
1668
+
1669
+ // Not a reply to a reply that moved over
1670
+ if ( !in_array( $reply_to, $reply_ids ) ) {
1671
+ bbp_update_reply_to( $reply->ID, 0 );
1672
+ }
1673
+
1674
+ // New topic from reply can't be a reply to
1675
+ if ( ( $from_reply->ID === $destination_topic->ID && $from_reply->ID === $reply_to ) ) {
1676
+ bbp_update_reply_to( $reply->ID, 0 );
1677
+ }
1678
+
1679
  // Do additional actions per split reply
1680
  do_action( 'bbp_split_topic_reply', $reply->ID, $destination_topic->ID );
1681
  }
1682
 
1683
+ // Remove reply to from new topic
1684
+ if ( $from_reply->ID === $destination_topic->ID ) {
1685
+ delete_post_meta( $from_reply->ID, '_bbp_reply_to' );
1686
+ }
1687
+
1688
  // Set the last reply ID and freshness
1689
  $last_reply_id = $reply->ID;
1690
  $freshness = $reply->post_date;
1697
 
1698
  // It is a new topic and we need to set some default metas to make
1699
  // the topic display in bbp_has_topics() list
1700
+ if ( 'reply' === $split_option ) {
1701
  bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id );
1702
  bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id );
1703
  bbp_update_topic_last_active_time( $destination_topic->ID, $freshness );
1886
  $to_tag = $tag['term_id'];
1887
 
1888
  // Attempting to merge a tag into itself
1889
+ if ( $tag_id === $to_tag ) {
1890
  bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>ERROR</strong>: The tags which are being merged can not be the same.', 'bbpress' ) );
1891
  return;
1892
  }
1951
  exit();
1952
  }
1953
 
1954
+ /** Helpers *******************************************************************/
1955
+
1956
+ /**
1957
+ * Return an associative array of available topic statuses
1958
+ *
1959
+ * @since bbPress (r5059)
1960
+ *
1961
+ * @return array
1962
+ */
1963
+ function bbp_get_topic_statuses() {
1964
+ return apply_filters( 'bbp_get_topic_statuses', array(
1965
+ bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ),
1966
+ bbp_get_closed_status_id() => _x( 'Closed', 'Close the topic', 'bbpress' ),
1967
+ bbp_get_spam_status_id() => _x( 'Spam', 'Spam the topic', 'bbpress' ),
1968
+ bbp_get_trash_status_id() => _x( 'Trash', 'Trash the topic', 'bbpress' ),
1969
+ bbp_get_pending_status_id() => _x( 'Pending', 'Mark topic as pending', 'bbpress' ),
1970
+ ) );
1971
+ }
1972
+
1973
+ /**
1974
+ * Return an associative array of topic sticky types
1975
+ *
1976
+ * @since bbPress (r5059)
1977
+ *
1978
+ * @return array
1979
+ */
1980
+ function bbp_get_topic_types() {
1981
+ return apply_filters( 'bbp_get_topic_types', array(
1982
+ 'unstick' => _x( 'Normal', 'Unstick a topic', 'bbpress' ),
1983
+ 'stick' => _x( 'Sticky', 'Make topic sticky', 'bbpress' ),
1984
+ 'super' => _x( 'Super Sticky', 'Make topic super sticky', 'bbpress' )
1985
+ ) );
1986
+ }
1987
+
1988
  /** Stickies ******************************************************************/
1989
 
1990
  /**
2086
  return;
2087
 
2088
  // What is the user doing here?
2089
+ if ( !current_user_can( 'edit_topic', $topic->ID ) || ( 'bbp_toggle_topic_trash' === $action && !current_user_can( 'delete_topic', $topic->ID ) ) ) {
2090
  bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that.', 'bbpress' ) );
2091
  return;
2092
  }
2099
  check_ajax_referer( 'close-topic_' . $topic_id );
2100
 
2101
  $is_open = bbp_is_topic_open( $topic_id );
2102
+ $success = true === $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
2103
+ $failure = true === $is_open ? __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'bbpress' );
2104
 
2105
  break;
2106
 
2109
  check_ajax_referer( 'stick-topic_' . $topic_id );
2110
 
2111
  $is_sticky = bbp_is_topic_sticky( $topic_id );
2112
+ $is_super = false === $is_sticky && !empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
2113
+ $success = true === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
2114
+ $failure = true === $is_sticky ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' );
2115
 
2116
  break;
2117
 
2120
  check_ajax_referer( 'spam-topic_' . $topic_id );
2121
 
2122
  $is_spam = bbp_is_topic_spam( $topic_id );
2123
+ $success = true === $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
2124
+ $failure = true === $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );
2125
  $view_all = !$is_spam;
2126
 
2127
  break;
2129
  // Toggle trash
2130
  case 'bbp_toggle_topic_trash' :
2131
 
2132
+ $sub_action = !empty( $_GET['sub_action'] ) && in_array( $_GET['sub_action'], array( 'trash', 'untrash', 'delete' ) ) ? $_GET['sub_action'] : false;
2133
 
2134
  if ( empty( $sub_action ) )
2135
  break;
2168
  do_action( 'bbp_toggle_topic_handler', $success, $post_data, $action );
2169
 
2170
  // No errors
2171
+ if ( false !== $success && !is_wp_error( $success ) ) {
2172
 
2173
  // Redirect back to the topic's forum
2174
+ if ( isset( $sub_action ) && ( 'delete' === $sub_action ) ) {
2175
  $redirect = bbp_get_forum_permalink( $success->post_parent );
2176
 
2177
  // Redirect back to the topic
2440
 
2441
  // Get replies of topic
2442
  if ( empty( $reply_count ) ) {
2443
+ $post_status = "'" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "'";
2444
+ $reply_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() ) );
2445
  }
2446
 
2447
  update_post_meta( $topic_id, '_bbp_reply_count_hidden', (int) $reply_count );
2486
  }
2487
 
2488
  // Update only if published
2489
+ if ( bbp_get_public_status_id() === get_post_status( $active_id ) ) {
2490
  update_post_meta( $topic_id, '_bbp_last_active_id', (int) $active_id );
2491
  }
2492
 
2703
  * @since bbPress (r2740)
2704
  *
2705
  * @param int $topic_id Topic id
2706
+ * @uses bbp_get_topic() To get the topic
2707
  * @uses do_action() Calls 'bbp_close_topic' with the topic id
2708
  * @uses add_post_meta() To add the previous status to a meta
2709
+ * @uses wp_update_post() To update the topic with the new status
2710
  * @uses do_action() Calls 'bbp_opened_topic' with the topic id
2711
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2712
  */
2713
  function bbp_close_topic( $topic_id = 0 ) {
2714
 
2715
  // Get topic
2716
+ $topic = bbp_get_topic( $topic_id );
2717
+ if ( empty( $topic ) )
2718
  return $topic;
2719
 
2720
  // Bail if already closed
2721
+ if ( bbp_get_closed_status_id() === $topic->post_status )
2722
  return false;
2723
 
2724
  // Execute pre close code
2725
  do_action( 'bbp_close_topic', $topic_id );
2726
 
2727
  // Add pre close status
2728
+ add_post_meta( $topic_id, '_bbp_status', $topic->post_status );
2729
 
2730
  // Set closed status
2731
+ $topic->post_status = bbp_get_closed_status_id();
2732
 
2733
  // No revisions
2734
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2735
 
2736
  // Update topic
2737
+ $topic_id = wp_update_post( $topic );
2738
 
2739
  // Execute post close code
2740
  do_action( 'bbp_closed_topic', $topic_id );
2749
  * @since bbPress (r2740)
2750
  *
2751
  * @param int $topic_id Topic id
2752
+ * @uses bbp_get_topic() To get the topic
2753
  * @uses do_action() Calls 'bbp_open_topic' with the topic id
2754
  * @uses get_post_meta() To get the previous status
2755
  * @uses delete_post_meta() To delete the previous status meta
2756
+ * @uses wp_update_post() To update the topic with the new status
2757
  * @uses do_action() Calls 'bbp_opened_topic' with the topic id
2758
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2759
  */
2760
  function bbp_open_topic( $topic_id = 0 ) {
2761
 
2762
  // Get topic
2763
+ $topic = bbp_get_topic( $topic_id );
2764
+ if ( empty( $topic ) )
2765
  return $topic;
2766
 
2767
  // Bail if already open
2768
+ if ( bbp_get_closed_status_id() !== $topic->post_status )
2769
  return false;
2770
 
2771
  // Execute pre open code
2772
  do_action( 'bbp_open_topic', $topic_id );
2773
 
2774
  // Get previous status
2775
+ $topic_status = get_post_meta( $topic_id, '_bbp_status', true );
2776
 
2777
  // Set previous status
2778
+ $topic->post_status = $topic_status;
2779
 
2780
  // Remove old status meta
2781
  delete_post_meta( $topic_id, '_bbp_status' );
2784
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2785
 
2786
  // Update topic
2787
+ $topic_id = wp_update_post( $topic );
2788
 
2789
  // Execute post open code
2790
  do_action( 'bbp_opened_topic', $topic_id );
2799
  * @since bbPress (r2740)
2800
  *
2801
  * @param int $topic_id Topic id
2802
+ * @uses bbp_get_topic() To get the topic
2803
  * @uses do_action() Calls 'bbp_spam_topic' with the topic id
2804
  * @uses add_post_meta() To add the previous status to a meta
2805
+ * @uses wp_update_post() To update the topic with the new status
2806
  * @uses do_action() Calls 'bbp_spammed_topic' with the topic id
2807
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2808
  */
2809
  function bbp_spam_topic( $topic_id = 0 ) {
2810
 
2811
  // Get the topic
2812
+ $topic = bbp_get_topic( $topic_id );
2813
+ if ( empty( $topic ) )
2814
  return $topic;
2815
 
2816
  // Bail if topic is spam
2817
+ if ( bbp_get_spam_status_id() === $topic->post_status )
2818
  return false;
2819
 
2820
  // Execute pre spam code
2859
  /** Topic Tags ************************************************************/
2860
 
2861
  // Add the original post status as post meta for future restoration
2862
+ add_post_meta( $topic_id, '_bbp_spam_meta_status', $topic->post_status );
2863
 
2864
  // Get topic tags
2865
  $terms = get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() );
2871
  if ( !empty( $terms ) ) {
2872
 
2873
  // Loop through and collect term names
2874
+ foreach ( $terms as $term ) {
2875
  $term_names[] = $term->name;
2876
  }
2877
 
2882
  add_post_meta( $topic_id, '_bbp_spam_topic_tags', $term_names );
2883
 
2884
  // Empty the topic of its tags
2885
+ $topic->tax_input = array( bbp_get_topic_tag_tax_id() => '' );
2886
  }
2887
  }
2888
 
2889
  // Set post status to spam
2890
+ $topic->post_status = bbp_get_spam_status_id();
2891
 
2892
  // No revisions
2893
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2894
 
2895
  // Update the topic
2896
+ $topic_id = wp_update_post( $topic );
2897
 
2898
  // Execute post spam code
2899
  do_action( 'bbp_spammed_topic', $topic_id );
2908
  * @since bbPress (r2740)
2909
  *
2910
  * @param int $topic_id Topic id
2911
+ * @uses bbp_get_topic() To get the topic
2912
  * @uses do_action() Calls 'bbp_unspam_topic' with the topic id
2913
  * @uses get_post_meta() To get the previous status
2914
  * @uses delete_post_meta() To delete the previous status meta
2915
+ * @uses wp_update_post() To update the topic with the new status
2916
  * @uses do_action() Calls 'bbp_unspammed_topic' with the topic id
2917
  * @return mixed False or {@link WP_Error} on failure, topic id on success
2918
  */
2919
  function bbp_unspam_topic( $topic_id = 0 ) {
2920
 
2921
  // Get the topic
2922
+ $topic = bbp_get_topic( $topic_id );
2923
+ if ( empty( $topic ) )
2924
  return $topic;
2925
 
2926
  // Bail if already not spam
2927
+ if ( bbp_get_spam_status_id() !== $topic->post_status )
2928
  return false;
2929
 
2930
  // Execute pre unspam code
2957
  if ( !empty( $terms ) ) {
2958
 
2959
  // Set the tax_input of the topic
2960
+ $topic->tax_input = array( bbp_get_topic_tag_tax_id() => $terms );
2961
 
2962
  // Delete pre-spam topic tag meta
2963
  delete_post_meta( $topic_id, '_bbp_spam_topic_tags' );
2974
  }
2975
 
2976
  // Set post status to pre spam
2977
+ $topic->post_status = $topic_status;
2978
 
2979
  // Delete pre spam meta
2980
  delete_post_meta( $topic_id, '_bbp_spam_meta_status' );
2983
  remove_action( 'pre_post_update', 'wp_save_post_revision' );
2984
 
2985
  // Update the topic
2986
+ $topic_id = wp_update_post( $topic );
2987
 
2988
  // Execute post unspam code
2989
  do_action( 'bbp_unspammed_topic', $topic_id );
3358
  $topic_id = bbp_get_topic_id( $topic_id );
3359
  $topic_tags = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) );
3360
  $terms = array();
3361
+ foreach ( $topic_tags as $term ) {
3362
  $terms[] = $term->name;
3363
  }
3364
  $terms = !empty( $terms ) ? implode( $sep, $terms ) : '';
3460
 
3461
  <description>
3462
  <![CDATA[
3463
+ <p><?php printf( esc_html__( 'Replies: %s', 'bbpress' ), bbp_get_topic_reply_count() ); ?></p>
3464
  <?php bbp_topic_content(); ?>
3465
  ]]>
3466
  </description>
includes/topics/{template-tags.php → template.php} RENAMED
@@ -122,7 +122,7 @@ function bbp_has_topics( $args = '' ) {
122
  }
123
 
124
  // Join post statuses together
125
- $default['post_status'] = join( ',', $post_statuses );
126
 
127
  // Lean on the 'perm' query var value of 'readable' to provide statuses
128
  } else {
@@ -147,7 +147,7 @@ function bbp_has_topics( $args = '' ) {
147
  $bbp->topic_query = new WP_Query( $r );
148
 
149
  // Set post_parent back to 0 if originally set to 'any'
150
- if ( 'any' == $r['post_parent'] )
151
  $r['post_parent'] = 0;
152
 
153
  // Limited the number of pages shown
@@ -232,6 +232,12 @@ function bbp_has_topics( $args = '' ) {
232
  // Cleanup
233
  unset( $stickies );
234
 
 
 
 
 
 
 
235
  // What are the default allowed statuses (based on user caps)
236
  if ( bbp_get_view_all() ) {
237
  $sticky_query['post_status'] = $r['post_status'];
@@ -263,7 +269,7 @@ function bbp_has_topics( $args = '' ) {
263
  }
264
 
265
  // If no limit to posts per page, set it to the current post_count
266
- if ( -1 == $r['posts_per_page'] )
267
  $r['posts_per_page'] = $bbp->topic_query->post_count;
268
 
269
  // Add pagination values to query object
@@ -308,6 +314,10 @@ function bbp_has_topics( $args = '' ) {
308
  } elseif ( is_page() || is_single() ) {
309
  $base = get_permalink();
310
 
 
 
 
 
311
  // Topic archive
312
  } elseif ( bbp_is_topic_archive() ) {
313
  $base = bbp_get_topics_url();
@@ -329,7 +339,7 @@ function bbp_has_topics( $args = '' ) {
329
  $bbp_topic_pagination = apply_filters( 'bbp_topic_pagination', array (
330
  'base' => $base,
331
  'format' => '',
332
- 'total' => $r['posts_per_page'] == $bbp->topic_query->found_posts ? 1 : ceil( (int) $bbp->topic_query->found_posts / (int) $r['posts_per_page'] ),
333
  'current' => (int) $bbp->topic_query->paged,
334
  'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
335
  'next_text' => is_rtl() ? '&larr;' : '&rarr;',
@@ -475,14 +485,14 @@ function bbp_get_topic( $topic, $output = OBJECT, $filter = 'raw' ) {
475
  return null;
476
 
477
  // Tweak the data type to return
478
- if ( $output == OBJECT ) {
479
  return $topic;
480
 
481
- } elseif ( $output == ARRAY_A ) {
482
  $_topic = get_object_vars( $topic );
483
  return $_topic;
484
 
485
- } elseif ( $output == ARRAY_N ) {
486
  $_topic = array_values( get_object_vars( $topic ) );
487
  return $_topic;
488
 
@@ -502,7 +512,7 @@ function bbp_get_topic( $topic, $output = OBJECT, $filter = 'raw' ) {
502
  * @uses bbp_get_topic_permalink() To get the topic permalink
503
  */
504
  function bbp_topic_permalink( $topic_id = 0, $redirect_to = '' ) {
505
- echo bbp_get_topic_permalink( $topic_id, $redirect_to );
506
  }
507
  /**
508
  * Return the link to the topic
@@ -784,6 +794,11 @@ function bbp_topic_pagination( $args = '' ) {
784
  function bbp_get_topic_pagination( $args = '' ) {
785
  global $wp_rewrite;
786
 
 
 
 
 
 
787
  // Parse arguments against default values
788
  $r = bbp_parse_args( $args, array(
789
  'topic_id' => bbp_get_topic_id(),
@@ -899,7 +914,7 @@ function bbp_topic_revision_log( $topic_id = 0 ) {
899
  if ( empty( $revisions ) )
900
  return false;
901
 
902
- $r = "\n\n" . '<ul id="bbp-topic-revision-log-' . $topic_id . '" class="bbp-topic-revision-log">' . "\n\n";
903
 
904
  // Loop through revisions
905
  foreach ( (array) $revisions as $revision ) {
@@ -915,11 +930,11 @@ function bbp_topic_revision_log( $topic_id = 0 ) {
915
  $author = bbp_get_author_link( array( 'size' => 14, 'link_text' => bbp_get_topic_author_display_name( $revision->ID ), 'post_id' => $revision->ID ) );
916
  $since = bbp_get_time_since( bbp_convert_date( $revision->post_modified ) );
917
 
918
- $r .= "\t" . '<li id="bbp-topic-revision-log-' . $topic_id . '-item-' . $revision->ID . '" class="bbp-topic-revision-log-item">' . "\n";
919
  if ( !empty( $reason ) ) {
920
- $r .= "\t\t" . sprintf( __( 'This topic was modified %1$s by %2$s. Reason: %3$s', 'bbpress' ), $since, $author, $reason ) . "\n";
921
  } else {
922
- $r .= "\t\t" . sprintf( __( 'This topic was modified %1$s by %2$s.', 'bbpress' ), $since, $author ) . "\n";
923
  }
924
  $r .= "\t" . '</li>' . "\n";
925
 
@@ -1043,7 +1058,7 @@ function bbp_is_topic_open( $topic_id = 0 ) {
1043
  * @return bool True if closed, false if not.
1044
  */
1045
  function bbp_is_topic_closed( $topic_id = 0 ) {
1046
- $closed = bbp_get_topic_status( $topic_id ) == bbp_get_closed_status_id();
1047
  return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $closed, $topic_id );
1048
  }
1049
 
@@ -1102,7 +1117,7 @@ function bbp_is_topic_super_sticky( $topic_id = 0 ) {
1102
  * @return bool True if published, false if not.
1103
  */
1104
  function bbp_is_topic_published( $topic_id = 0 ) {
1105
- $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_public_status_id();
1106
  return (bool) apply_filters( 'bbp_is_topic_published', (bool) $topic_status, $topic_id );
1107
  }
1108
 
@@ -1118,7 +1133,7 @@ function bbp_is_topic_published( $topic_id = 0 ) {
1118
  * @return bool True if spam, false if not.
1119
  */
1120
  function bbp_is_topic_spam( $topic_id = 0 ) {
1121
- $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_spam_status_id();
1122
  return (bool) apply_filters( 'bbp_is_topic_spam', (bool) $topic_status, $topic_id );
1123
  }
1124
 
@@ -1134,7 +1149,7 @@ function bbp_is_topic_spam( $topic_id = 0 ) {
1134
  * @return bool True if trashed, false if not.
1135
  */
1136
  function bbp_is_topic_trash( $topic_id = 0 ) {
1137
- $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_trash_status_id();
1138
  return (bool) apply_filters( 'bbp_is_topic_trash', (bool) $topic_status, $topic_id );
1139
  }
1140
 
@@ -1409,40 +1424,40 @@ function bbp_topic_author_link( $args = '' ) {
1409
  }
1410
 
1411
  // Setup title and author_links array
1412
- $link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : '';
1413
  $author_links = array();
1414
 
1415
  // Get avatar
1416
- if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
1417
  $author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] );
1418
  }
1419
 
1420
  // Get display name
1421
- if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
1422
  $author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
1423
  }
1424
 
1425
  // Link class
1426
- $link_class = ' class="bbp-author-' . $r['type'] . '"';
1427
 
1428
  // Add links if not anonymous
1429
  if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
1430
 
1431
  // Assemble the links
1432
  foreach ( $author_links as $link => $link_text ) {
1433
- $link_class = ' class="bbp-author-' . $link . '"';
1434
- $author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text );
1435
  }
1436
 
1437
  if ( true === $r['show_role'] ) {
1438
  $author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) );
1439
  }
1440
 
1441
- $author_link = join( $r['sep'], $author_link );
1442
 
1443
  // No links if anonymous
1444
  } else {
1445
- $author_link = join( $r['sep'], $author_links );
1446
  }
1447
 
1448
  } else {
@@ -1461,7 +1476,7 @@ function bbp_topic_author_link( $args = '' ) {
1461
  * @uses bbp_get_topic_author_url() To get the topic author url
1462
  */
1463
  function bbp_topic_author_url( $topic_id = 0 ) {
1464
- echo bbp_get_topic_author_url( $topic_id );
1465
  }
1466
 
1467
  /**
@@ -1799,7 +1814,7 @@ function bbp_topic_last_reply_title( $topic_id = 0 ) {
1799
  * @uses bbp_get_topic_last_reply_permalink() To get the topic's last reply link
1800
  */
1801
  function bbp_topic_last_reply_permalink( $topic_id = 0 ) {
1802
- echo bbp_get_topic_last_reply_permalink( $topic_id );
1803
  }
1804
  /**
1805
  * Return the link to the last reply in a topic
@@ -1828,7 +1843,7 @@ function bbp_topic_last_reply_permalink( $topic_id = 0 ) {
1828
  * @uses bbp_get_topic_last_reply_url() To get the topic last reply url
1829
  */
1830
  function bbp_topic_last_reply_url( $topic_id = 0 ) {
1831
- echo bbp_get_topic_last_reply_url( $topic_id );
1832
  }
1833
  /**
1834
  * Return the link to the last reply in a topic
@@ -1848,7 +1863,7 @@ function bbp_topic_last_reply_url( $topic_id = 0 ) {
1848
  $topic_id = bbp_get_topic_id( $topic_id );
1849
  $reply_id = bbp_get_topic_last_reply_id( $topic_id );
1850
 
1851
- if ( !empty( $reply_id ) && ( $reply_id != $topic_id ) ) {
1852
  $reply_url = bbp_get_reply_url( $reply_id );
1853
  } else {
1854
  $reply_url = bbp_get_topic_permalink( $topic_id );
@@ -1891,7 +1906,7 @@ function bbp_topic_freshness_link( $topic_id = 0 ) {
1891
  $time_since = bbp_get_topic_last_active_time( $topic_id );
1892
 
1893
  if ( !empty( $time_since ) )
1894
- $anchor = '<a href="' . $link_url . '" title="' . esc_attr( $title ) . '">' . $time_since . '</a>';
1895
  else
1896
  $anchor = __( 'No Replies', 'bbpress' );
1897
 
@@ -2126,7 +2141,7 @@ function bbp_topic_tag_list( $topic_id = 0, $args = '' ) {
2126
 
2127
  // Parse arguments against default values
2128
  $r = bbp_parse_args( $args, array(
2129
- 'before' => '<div class="bbp-topic-tags"><p>' . __( 'Tagged:', 'bbpress' ) . '&nbsp;',
2130
  'sep' => ', ',
2131
  'after' => '</p></div>'
2132
  ), 'get_topic_tag_list' );
@@ -2197,7 +2212,7 @@ function bbp_topic_class( $topic_id = 0, $classes = array() ) {
2197
  $classes = array_filter( $classes );
2198
  $classes = get_post_class( $classes, $topic_id );
2199
  $classes = apply_filters( 'bbp_get_topic_class', $classes, $topic_id );
2200
- $retval = 'class="' . join( ' ', $classes ) . '"';
2201
 
2202
  return $retval;
2203
  }
@@ -2207,10 +2222,10 @@ function bbp_topic_class( $topic_id = 0, $classes = array() ) {
2207
  /**
2208
  * Output admin links for topic
2209
  *
2210
- * @param mixed $args See {@link bbp_get_topic_admin_links()}
2211
  * @uses bbp_get_topic_admin_links() To get the topic admin links
2212
  */
2213
- function bbp_topic_admin_links( $args = '' ) {
2214
  echo bbp_get_topic_admin_links( $args );
2215
  }
2216
  /**
@@ -2218,7 +2233,7 @@ function bbp_topic_admin_links( $args = '' ) {
2218
  *
2219
  * Move topic functionality is handled by the edit topic page.
2220
  *
2221
- * @param mixed $args This function supports these arguments:
2222
  * - id: Optional. Topic id
2223
  * - before: Before the links
2224
  * - after: After the links
@@ -2237,10 +2252,7 @@ function bbp_topic_admin_links( $args = '' ) {
2237
  * topic admin links and args
2238
  * @return string Topic admin links
2239
  */
2240
- function bbp_get_topic_admin_links( $args = '' ) {
2241
-
2242
- if ( !bbp_is_single_topic() )
2243
- return;
2244
 
2245
  // Parse arguments against default values
2246
  $r = bbp_parse_args( $args, array (
@@ -2251,9 +2263,6 @@ function bbp_topic_admin_links( $args = '' ) {
2251
  'links' => array()
2252
  ), 'get_topic_admin_links' );
2253
 
2254
- if ( !current_user_can( 'edit_topic', $r['id'] ) )
2255
- return;
2256
-
2257
  if ( empty( $r['links'] ) ) {
2258
  $r['links'] = apply_filters( 'bbp_topic_admin_links', array(
2259
  'edit' => bbp_get_topic_edit_link ( $r ),
@@ -2262,13 +2271,10 @@ function bbp_topic_admin_links( $args = '' ) {
2262
  'merge' => bbp_get_topic_merge_link( $r ),
2263
  'trash' => bbp_get_topic_trash_link( $r ),
2264
  'spam' => bbp_get_topic_spam_link ( $r ),
 
2265
  ), $r['id'] );
2266
  }
2267
 
2268
- // Check caps for trashing the topic
2269
- if ( !current_user_can( 'delete_topic', $r['id'] ) && !empty( $r['links']['trash'] ) )
2270
- unset( $r['links']['trash'] );
2271
-
2272
  // See if links need to be unset
2273
  $topic_status = bbp_get_topic_status( $r['id'] );
2274
  if ( in_array( $topic_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) {
@@ -2277,18 +2283,20 @@ function bbp_topic_admin_links( $args = '' ) {
2277
  unset( $r['links']['close'] );
2278
 
2279
  // Spam link shouldn't be visible on trashed topics
2280
- if ( $topic_status == bbp_get_trash_status_id() )
2281
  unset( $r['links']['spam'] );
2282
 
2283
  // Trash link shouldn't be visible on spam topics
2284
- elseif ( $topic_status == bbp_get_spam_status_id() )
2285
  unset( $r['links']['trash'] );
 
2286
  }
2287
 
2288
  // Process the admin links
2289
- $links = implode( $r['sep'], array_filter( $r['links'] ) );
 
2290
 
2291
- return apply_filters( 'bbp_get_topic_admin_links', $r['before'] . $links . $r['after'], $r );
2292
  }
2293
 
2294
  /**
@@ -2329,7 +2337,7 @@ function bbp_topic_edit_link( $args = '' ) {
2329
  'id' => 0,
2330
  'link_before' => '',
2331
  'link_after' => '',
2332
- 'edit_text' => __( 'Edit', 'bbpress' )
2333
  ), 'get_topic_edit_link' );
2334
 
2335
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
@@ -2350,7 +2358,7 @@ function bbp_topic_edit_link( $args = '' ) {
2350
  if ( empty( $uri ) )
2351
  return;
2352
 
2353
- $retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['edit_text'] . '</a>' . $r['link_after'];
2354
 
2355
  return apply_filters( 'bbp_get_topic_edit_link', $retval, $r );
2356
  }
@@ -2364,7 +2372,7 @@ function bbp_topic_edit_link( $args = '' ) {
2364
  * @uses bbp_get_topic_edit_url() To get the topic edit url
2365
  */
2366
  function bbp_topic_edit_url( $topic_id = 0 ) {
2367
- echo bbp_get_topic_edit_url( $topic_id );
2368
  }
2369
  /**
2370
  * Return URL to the topic edit page
@@ -2453,9 +2461,9 @@ function bbp_topic_trash_link( $args = '' ) {
2453
  'link_before' => '',
2454
  'link_after' => '',
2455
  'sep' => ' | ',
2456
- 'trash_text' => __( 'Trash', 'bbpress' ),
2457
- 'restore_text' => __( 'Restore', 'bbpress' ),
2458
- 'delete_text' => __( 'Delete', 'bbpress' )
2459
  ), 'get_topic_trash_link' );
2460
 
2461
  $actions = array();
@@ -2466,13 +2474,13 @@ function bbp_topic_trash_link( $args = '' ) {
2466
  }
2467
 
2468
  if ( bbp_is_topic_trash( $topic->ID ) ) {
2469
- $actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '">' . esc_html( $r['restore_text'] ) . '</a>';
2470
  } elseif ( EMPTY_TRASH_DAYS ) {
2471
- $actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash', 'topic_id' => $topic->ID ) ), 'trash-' . $topic->post_type . '_' . $topic->ID ) ) . '">' . esc_html( $r['trash_text'] ) . '</a>';
2472
  }
2473
 
2474
  if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
2475
- $actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete', 'topic_id' => $topic->ID ) ), 'delete-' . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );">' . esc_html( $r['delete_text'] ) . '</a>';
2476
  }
2477
 
2478
  // Process the admin links
@@ -2534,8 +2542,8 @@ function bbp_topic_close_link( $args = '' ) {
2534
 
2535
  $display = bbp_is_topic_open( $topic->ID ) ? $r['close_text'] : $r['open_text'];
2536
  $uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_close', 'topic_id' => $topic->ID ) );
2537
- $uri = esc_url( wp_nonce_url( $uri, 'close-topic_' . $topic->ID ) );
2538
- $retval = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
2539
 
2540
  return apply_filters( 'bbp_get_topic_close_link', $retval, $r );
2541
  }
@@ -2583,9 +2591,9 @@ function bbp_topic_stick_link( $args = '' ) {
2583
  'id' => 0,
2584
  'link_before' => '',
2585
  'link_after' => '',
2586
- 'stick_text' => __( 'Stick', 'bbpress' ),
2587
- 'unstick_text' => __( 'Unstick', 'bbpress' ),
2588
- 'super_text' => __( 'to front', 'bbpress' ),
2589
  ), 'get_topic_stick_link' );
2590
 
2591
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
@@ -2596,16 +2604,16 @@ function bbp_topic_stick_link( $args = '' ) {
2596
  $is_sticky = bbp_is_topic_sticky( $topic->ID );
2597
 
2598
  $stick_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID ) );
2599
- $stick_uri = esc_url( wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID ) );
2600
 
2601
- $stick_display = true == $is_sticky ? $r['unstick_text'] : $r['stick_text'];
2602
- $stick_display = '<a href="' . $stick_uri . '">' . $stick_display . '</a>';
2603
 
2604
  if ( empty( $is_sticky ) ) {
2605
  $super_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID, 'super' => 1 ) );
2606
- $super_uri = esc_url( wp_nonce_url( $super_uri, 'stick-topic_' . $topic->ID ) );
2607
 
2608
- $super_display = ' (<a href="' . $super_uri . '">' . $r['super_text'] . '</a>)';
2609
  } else {
2610
  $super_display = '';
2611
  }
@@ -2654,7 +2662,7 @@ function bbp_topic_merge_link( $args = '' ) {
2654
  'id' => 0,
2655
  'link_before' => '',
2656
  'link_after' => '',
2657
- 'merge_text' => __( 'Merge', 'bbpress' ),
2658
  ), 'get_topic_merge_link' );
2659
 
2660
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
@@ -2662,8 +2670,8 @@ function bbp_topic_merge_link( $args = '' ) {
2662
  if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
2663
  return;
2664
 
2665
- $uri = esc_url( add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) ) );
2666
- $retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['merge_text'] . '</a>' . $r['link_after'];
2667
 
2668
  return apply_filters( 'bbp_get_topic_merge_link', $retval, $args );
2669
  }
@@ -2710,8 +2718,8 @@ function bbp_topic_spam_link( $args = '' ) {
2710
  'link_before' => '',
2711
  'link_after' => '',
2712
  'sep' => ' | ',
2713
- 'spam_text' => __( 'Spam', 'bbpress' ),
2714
- 'unspam_text' => __( 'Unspam', 'bbpress' )
2715
  ), 'get_topic_spam_link' );
2716
 
2717
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
@@ -2721,12 +2729,63 @@ function bbp_topic_spam_link( $args = '' ) {
2721
 
2722
  $display = bbp_is_topic_spam( $topic->ID ) ? $r['unspam_text'] : $r['spam_text'];
2723
  $uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_spam', 'topic_id' => $topic->ID ) );
2724
- $uri = esc_url( wp_nonce_url( $uri, 'spam-topic_' . $topic->ID ) );
2725
- $retval = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
2726
 
2727
  return apply_filters( 'bbp_get_topic_spam_link', $retval, $r );
2728
  }
2729
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2730
  /** Topic Pagination **********************************************************/
2731
 
2732
  /**
@@ -2772,7 +2831,7 @@ function bbp_forum_pagination_count() {
2772
  }
2773
 
2774
  // Filter and return
2775
- return apply_filters( 'bbp_get_topic_pagination_count', $retstr );
2776
  }
2777
 
2778
  /**
@@ -2853,86 +2912,187 @@ function bbp_topic_notices() {
2853
  /**
2854
  * Displays topic type select box (normal/sticky/super sticky)
2855
  *
2856
- * @since bbPress (r2784)
 
2857
  *
2858
  * @param $args This function supports these arguments:
2859
- * - stick_text: Sticky text
2860
- * - super_text: Super Sticky text
2861
- * - unstick_text: Unstick (normal) text
2862
  * - select_id: Select id. Defaults to bbp_stick_topic
2863
  * - tab: Tabindex
2864
  * - topic_id: Topic id
2865
- * @uses bbp_get_topic_id() To get the topic id
2866
- * @uses bbp_is_single_topic() To check if we're viewing a single topic
2867
- * @uses bbp_is_topic_edit() To check if it is the topic edit page
2868
- * @uses bbp_is_topic_super_sticky() To check if the topic is a super sticky
2869
- * @uses bbp_is_topic_sticky() To check if the topic is a sticky
2870
  */
2871
  function bbp_topic_type_select( $args = '' ) {
 
 
2872
 
2873
- // Parse arguments against default values
2874
- $r = bbp_parse_args( $args, array(
2875
- 'unstick_text' => __( 'Normal', 'bbpress' ),
2876
- 'stick_text' => __( 'Sticky', 'bbpress' ),
2877
- 'super_text' => __( 'Super Sticky', 'bbpress' ),
2878
- 'select_id' => 'bbp_stick_topic',
2879
- 'tab' => bbp_get_tab_index(),
2880
- 'topic_id' => 0
2881
- ), 'topic_type_select' );
2882
-
2883
- // Edit topic
2884
- if ( bbp_is_single_topic() || bbp_is_topic_edit() ) {
2885
-
2886
- // Get current topic id
2887
- $topic_id = bbp_get_topic_id( $r['topic_id'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2888
 
2889
- // Post value is passed
2890
- if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
2891
- $sticky_current = $_POST[ $r['select_id'] ];
 
 
 
 
2892
 
2893
- // Topic is super sticky
2894
- } elseif ( bbp_is_topic_super_sticky( $topic_id ) ) {
2895
- $sticky_current = 'super';
2896
 
2897
- // Topic is sticky or normal
2898
- } else {
2899
- $sticky_current = bbp_is_topic_sticky( $topic_id, false ) ? 'stick' : 'unstick';
2900
- }
2901
 
2902
- // New topic
2903
- } else {
2904
 
2905
- // Post value is passed
2906
- if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
2907
- $sticky_current = $_POST[ $r['select_id'] ];
2908
 
2909
- // Default to unstick
2910
- } else {
2911
- $sticky_current = 'unstick';
 
 
 
 
 
 
 
 
 
 
2912
  }
2913
- }
2914
 
2915
- // Used variables
2916
- $tab = !empty( $r['tab'] ) ? ' tabindex="' . $r['tab'] . '"' : '';
2917
- $select_id = esc_attr( $r['select_id'] );
2918
- $sticky_statuses = array_filter( array(
2919
- 'unstick' => $r['unstick_text'],
2920
- 'stick' => $r['stick_text'],
2921
- 'super' => $r['super_text'],
2922
- ) ); ?>
 
2923
 
2924
- <select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>"<?php echo $tab; ?>>
2925
 
2926
- <?php foreach ( $sticky_statuses as $sticky_status => $label ) : ?>
2927
 
2928
- <option value="<?php echo esc_attr( $sticky_status ); ?>"<?php selected( $sticky_current, $sticky_status ); ?>><?php echo esc_html( $label ); ?></option>
2929
 
2930
- <?php endforeach; ?>
2931
 
2932
- </select>
 
 
2933
 
2934
- <?php
 
 
 
 
 
 
 
 
2935
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2936
 
2937
  /** Single Topic **************************************************************/
2938
 
@@ -2998,15 +3158,15 @@ function bbp_single_topic_description( $args = '' ) {
2998
  $last_reply = bbp_get_topic_last_reply_id( $topic_id );
2999
  if ( !empty( $last_reply ) ) {
3000
  $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_reply, 'size' => $r['size'] ) );
3001
- $retstr = sprintf( __( 'This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $reply_count, $voice_count, $last_updated_by, $time_since );
3002
 
3003
  // Topic has no replies
3004
  } elseif ( ! empty( $voice_count ) && ! empty( $reply_count ) ) {
3005
- $retstr = sprintf( __( 'This topic contains %1$s and has %2$s.', 'bbpress' ), $voice_count, $reply_count );
3006
 
3007
  // Topic has no replies and no voices
3008
  } elseif ( empty( $voice_count ) && empty( $reply_count ) ) {
3009
- $retstr = sprintf( __( 'This topic has no replies.', 'bbpress' ), $voice_count, $reply_count );
3010
  }
3011
 
3012
  // Add the 'view all' filter back
@@ -3183,7 +3343,7 @@ function bbp_topic_tag_slug( $tag = '' ) {
3183
  * @uses bbp_get_topic_tag_link()
3184
  */
3185
  function bbp_topic_tag_link( $tag = '' ) {
3186
- echo bbp_get_topic_tag_link( $tag );
3187
  }
3188
  /**
3189
  * Return the link of the current tag
@@ -3227,7 +3387,7 @@ function bbp_topic_tag_link( $tag = '' ) {
3227
  * @uses bbp_get_topic_tag_edit_link()
3228
  */
3229
  function bbp_topic_tag_edit_link( $tag = '' ) {
3230
- echo bbp_get_topic_tag_edit_link( $tag );
3231
  }
3232
  /**
3233
  * Return the link of the current tag
@@ -3474,7 +3634,7 @@ function bbp_form_topic_tags() {
3474
  $terms = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) );
3475
 
3476
  // Loop through them
3477
- foreach( $terms as $term ) {
3478
  $new_terms[] = $term->name;
3479
  }
3480
  }
@@ -3568,7 +3728,7 @@ function bbp_form_topic_subscribed() {
3568
  $post_author = bbp_get_global_post_field( 'post_author', 'raw' );
3569
 
3570
  // Post author is not the current user
3571
- if ( bbp_get_current_user_id() != $post_author ) {
3572
  $topic_subscribed = bbp_is_user_subscribed( $post_author );
3573
 
3574
  // Post author is the current user
122
  }
123
 
124
  // Join post statuses together
125
+ $default['post_status'] = implode( ',', $post_statuses );
126
 
127
  // Lean on the 'perm' query var value of 'readable' to provide statuses
128
  } else {
147
  $bbp->topic_query = new WP_Query( $r );
148
 
149
  // Set post_parent back to 0 if originally set to 'any'
150
+ if ( 'any' === $r['post_parent'] )
151
  $r['post_parent'] = 0;
152
 
153
  // Limited the number of pages shown
232
  // Cleanup
233
  unset( $stickies );
234
 
235
+ // Conditionally exclude private/hidden forum ID's
236
+ $exclude_forum_ids = bbp_exclude_forum_ids( 'array' );
237
+ if ( ! empty( $exclude_forum_ids ) ) {
238
+ $sticky_query['post_parent__not_in'] = $exclude_forum_ids;
239
+ }
240
+
241
  // What are the default allowed statuses (based on user caps)
242
  if ( bbp_get_view_all() ) {
243
  $sticky_query['post_status'] = $r['post_status'];
269
  }
270
 
271
  // If no limit to posts per page, set it to the current post_count
272
+ if ( -1 === $r['posts_per_page'] )
273
  $r['posts_per_page'] = $bbp->topic_query->post_count;
274
 
275
  // Add pagination values to query object
314
  } elseif ( is_page() || is_single() ) {
315
  $base = get_permalink();
316
 
317
+ // Forum archive
318
+ } elseif ( bbp_is_forum_archive() ) {
319
+ $base = bbp_get_forums_url();
320
+
321
  // Topic archive
322
  } elseif ( bbp_is_topic_archive() ) {
323
  $base = bbp_get_topics_url();
339
  $bbp_topic_pagination = apply_filters( 'bbp_topic_pagination', array (
340
  'base' => $base,
341
  'format' => '',
342
+ 'total' => $r['posts_per_page'] === $bbp->topic_query->found_posts ? 1 : ceil( (int) $bbp->topic_query->found_posts / (int) $r['posts_per_page'] ),
343
  'current' => (int) $bbp->topic_query->paged,
344
  'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
345
  'next_text' => is_rtl() ? '&larr;' : '&rarr;',
485
  return null;
486
 
487
  // Tweak the data type to return
488
+ if ( $output === OBJECT ) {
489
  return $topic;
490
 
491
+ } elseif ( $output === ARRAY_A ) {
492
  $_topic = get_object_vars( $topic );
493
  return $_topic;
494
 
495
+ } elseif ( $output === ARRAY_N ) {
496
  $_topic = array_values( get_object_vars( $topic ) );
497
  return $_topic;
498
 
512
  * @uses bbp_get_topic_permalink() To get the topic permalink
513
  */
514
  function bbp_topic_permalink( $topic_id = 0, $redirect_to = '' ) {
515
+ echo esc_url( bbp_get_topic_permalink( $topic_id, $redirect_to ) );
516
  }
517
  /**
518
  * Return the link to the topic
794
  function bbp_get_topic_pagination( $args = '' ) {
795
  global $wp_rewrite;
796
 
797
+ // Bail if threading replies
798
+ if ( bbp_thread_replies() ) {
799
+ return;
800
+ }
801
+
802
  // Parse arguments against default values
803
  $r = bbp_parse_args( $args, array(
804
  'topic_id' => bbp_get_topic_id(),
914
  if ( empty( $revisions ) )
915
  return false;
916
 
917
+ $r = "\n\n" . '<ul id="bbp-topic-revision-log-' . esc_attr( $topic_id ) . '" class="bbp-topic-revision-log">' . "\n\n";
918
 
919
  // Loop through revisions
920
  foreach ( (array) $revisions as $revision ) {
930
  $author = bbp_get_author_link( array( 'size' => 14, 'link_text' => bbp_get_topic_author_display_name( $revision->ID ), 'post_id' => $revision->ID ) );
931
  $since = bbp_get_time_since( bbp_convert_date( $revision->post_modified ) );
932
 
933
+ $r .= "\t" . '<li id="bbp-topic-revision-log-' . esc_attr( $topic_id ) . '-item-' . esc_attr( $revision->ID ) . '" class="bbp-topic-revision-log-item">' . "\n";
934
  if ( !empty( $reason ) ) {
935
+ $r .= "\t\t" . sprintf( __( 'This topic was modified %1$s by %2$s. Reason: %3$s', 'bbpress' ), esc_html( $since ), $author, esc_html( $reason ) ) . "\n";
936
  } else {
937
+ $r .= "\t\t" . sprintf( __( 'This topic was modified %1$s by %2$s.', 'bbpress' ), esc_html( $since ), $author ) . "\n";
938
  }
939
  $r .= "\t" . '</li>' . "\n";
940
 
1058
  * @return bool True if closed, false if not.
1059
  */
1060
  function bbp_is_topic_closed( $topic_id = 0 ) {
1061
+ $closed = bbp_get_topic_status( $topic_id ) === bbp_get_closed_status_id();
1062
  return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $closed, $topic_id );
1063
  }
1064
 
1117
  * @return bool True if published, false if not.
1118
  */
1119
  function bbp_is_topic_published( $topic_id = 0 ) {
1120
+ $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) === bbp_get_public_status_id();
1121
  return (bool) apply_filters( 'bbp_is_topic_published', (bool) $topic_status, $topic_id );
1122
  }
1123
 
1133
  * @return bool True if spam, false if not.
1134
  */
1135
  function bbp_is_topic_spam( $topic_id = 0 ) {
1136
+ $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) === bbp_get_spam_status_id();
1137
  return (bool) apply_filters( 'bbp_is_topic_spam', (bool) $topic_status, $topic_id );
1138
  }
1139
 
1149
  * @return bool True if trashed, false if not.
1150
  */
1151
  function bbp_is_topic_trash( $topic_id = 0 ) {
1152
+ $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) === bbp_get_trash_status_id();
1153
  return (bool) apply_filters( 'bbp_is_topic_trash', (bool) $topic_status, $topic_id );
1154
  }
1155
 
1424
  }
1425
 
1426
  // Setup title and author_links array
1427
+ $link_title = !empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';
1428
  $author_links = array();
1429
 
1430
  // Get avatar
1431
+ if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
1432
  $author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] );
1433
  }
1434
 
1435
  // Get display name
1436
+ if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
1437
  $author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
1438
  }
1439
 
1440
  // Link class
1441
+ $link_class = ' class="bbp-author-' . esc_attr( $r['type'] ) . '"';
1442
 
1443
  // Add links if not anonymous
1444
  if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
1445
 
1446
  // Assemble the links
1447
  foreach ( $author_links as $link => $link_text ) {
1448
+ $link_class = ' class="bbp-author-' . esc_attr( $link ) . '"';
1449
+ $author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', esc_url( $author_url ), $link_title, $link_class, $link_text );
1450
  }
1451
 
1452
  if ( true === $r['show_role'] ) {
1453
  $author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) );
1454
  }
1455
 
1456
+ $author_link = implode( $r['sep'], $author_link );
1457
 
1458
  // No links if anonymous
1459
  } else {
1460
+ $author_link = implode( $r['sep'], $author_links );
1461
  }
1462
 
1463
  } else {
1476
  * @uses bbp_get_topic_author_url() To get the topic author url
1477
  */
1478
  function bbp_topic_author_url( $topic_id = 0 ) {
1479
+ echo esc_url( bbp_get_topic_author_url( $topic_id ) );
1480
  }
1481
 
1482
  /**
1814
  * @uses bbp_get_topic_last_reply_permalink() To get the topic's last reply link
1815
  */
1816
  function bbp_topic_last_reply_permalink( $topic_id = 0 ) {
1817
+ echo esc_url( bbp_get_topic_last_reply_permalink( $topic_id ) );
1818
  }
1819
  /**
1820
  * Return the link to the last reply in a topic
1843
  * @uses bbp_get_topic_last_reply_url() To get the topic last reply url
1844
  */
1845
  function bbp_topic_last_reply_url( $topic_id = 0 ) {
1846
+ echo esc_url( bbp_get_topic_last_reply_url( $topic_id ) );
1847
  }
1848
  /**
1849
  * Return the link to the last reply in a topic
1863
  $topic_id = bbp_get_topic_id( $topic_id );
1864
  $reply_id = bbp_get_topic_last_reply_id( $topic_id );
1865
 
1866
+ if ( !empty( $reply_id ) && ( $reply_id !== $topic_id ) ) {
1867
  $reply_url = bbp_get_reply_url( $reply_id );
1868
  } else {
1869
  $reply_url = bbp_get_topic_permalink( $topic_id );
1906
  $time_since = bbp_get_topic_last_active_time( $topic_id );
1907
 
1908
  if ( !empty( $time_since ) )
1909
+ $anchor = '<a href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $time_since ) . '</a>';
1910
  else
1911
  $anchor = __( 'No Replies', 'bbpress' );
1912
 
2141
 
2142
  // Parse arguments against default values
2143
  $r = bbp_parse_args( $args, array(
2144
+ 'before' => '<div class="bbp-topic-tags"><p>' . esc_html__( 'Tagged:', 'bbpress' ) . '&nbsp;',
2145
  'sep' => ', ',
2146
  'after' => '</p></div>'
2147
  ), 'get_topic_tag_list' );
2212
  $classes = array_filter( $classes );
2213
  $classes = get_post_class( $classes, $topic_id );
2214
  $classes = apply_filters( 'bbp_get_topic_class', $classes, $topic_id );
2215
+ $retval = 'class="' . implode( ' ', $classes ) . '"';
2216
 
2217
  return $retval;
2218
  }
2222
  /**
2223
  * Output admin links for topic
2224
  *
2225
+ * @param array $args See {@link bbp_get_topic_admin_links()}
2226
  * @uses bbp_get_topic_admin_links() To get the topic admin links
2227
  */
2228
+ function bbp_topic_admin_links( $args = array() ) {
2229
  echo bbp_get_topic_admin_links( $args );
2230
  }
2231
  /**
2233
  *
2234
  * Move topic functionality is handled by the edit topic page.
2235
  *
2236
+ * @param array $args This function supports these arguments:
2237
  * - id: Optional. Topic id
2238
  * - before: Before the links
2239
  * - after: After the links
2252
  * topic admin links and args
2253
  * @return string Topic admin links
2254
  */
2255
+ function bbp_get_topic_admin_links( $args = array() ) {
 
 
 
2256
 
2257
  // Parse arguments against default values
2258
  $r = bbp_parse_args( $args, array (
2263
  'links' => array()
2264
  ), 'get_topic_admin_links' );
2265
 
 
 
 
2266
  if ( empty( $r['links'] ) ) {
2267
  $r['links'] = apply_filters( 'bbp_topic_admin_links', array(
2268
  'edit' => bbp_get_topic_edit_link ( $r ),
2271
  'merge' => bbp_get_topic_merge_link( $r ),
2272
  'trash' => bbp_get_topic_trash_link( $r ),
2273
  'spam' => bbp_get_topic_spam_link ( $r ),
2274
+ 'reply' => bbp_get_topic_reply_link( $r )
2275
  ), $r['id'] );
2276
  }
2277
 
 
 
 
 
2278
  // See if links need to be unset
2279
  $topic_status = bbp_get_topic_status( $r['id'] );
2280
  if ( in_array( $topic_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) {
2283
  unset( $r['links']['close'] );
2284
 
2285
  // Spam link shouldn't be visible on trashed topics
2286
+ if ( bbp_get_trash_status_id() === $topic_status ) {
2287
  unset( $r['links']['spam'] );
2288
 
2289
  // Trash link shouldn't be visible on spam topics
2290
+ } elseif ( bbp_get_spam_status_id() === $topic_status ) {
2291
  unset( $r['links']['trash'] );
2292
+ }
2293
  }
2294
 
2295
  // Process the admin links
2296
+ $links = implode( $r['sep'], array_filter( $r['links'] ) );
2297
+ $retval = $r['before'] . $links . $r['after'];
2298
 
2299
+ return apply_filters( 'bbp_get_topic_admin_links', $retval, $r, $args );
2300
  }
2301
 
2302
  /**
2337
  'id' => 0,
2338
  'link_before' => '',
2339
  'link_after' => '',
2340
+ 'edit_text' => esc_html__( 'Edit', 'bbpress' )
2341
  ), 'get_topic_edit_link' );
2342
 
2343
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
2358
  if ( empty( $uri ) )
2359
  return;
2360
 
2361
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-edit-link">' . $r['edit_text'] . '</a>' . $r['link_after'];
2362
 
2363
  return apply_filters( 'bbp_get_topic_edit_link', $retval, $r );
2364
  }
2372
  * @uses bbp_get_topic_edit_url() To get the topic edit url
2373
  */
2374
  function bbp_topic_edit_url( $topic_id = 0 ) {
2375
+ echo esc_url( bbp_get_topic_edit_url( $topic_id ) );
2376
  }
2377
  /**
2378
  * Return URL to the topic edit page
2461
  'link_before' => '',
2462
  'link_after' => '',
2463
  'sep' => ' | ',
2464
+ 'trash_text' => esc_html__( 'Trash', 'bbpress' ),
2465
+ 'restore_text' => esc_html__( 'Restore', 'bbpress' ),
2466
+ 'delete_text' => esc_html__( 'Delete', 'bbpress' )
2467
  ), 'get_topic_trash_link' );
2468
 
2469
  $actions = array();
2474
  }
2475
 
2476
  if ( bbp_is_topic_trash( $topic->ID ) ) {
2477
+ $actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-restore-link">' . $r['restore_text'] . '</a>';
2478
  } elseif ( EMPTY_TRASH_DAYS ) {
2479
+ $actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash', 'topic_id' => $topic->ID ) ), 'trash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-trash-link">' . $r['trash_text'] . '</a>';
2480
  }
2481
 
2482
  if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
2483
+ $actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete', 'topic_id' => $topic->ID ) ), 'delete-' . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-topic-delete-link">' . $r['delete_text'] . '</a>';
2484
  }
2485
 
2486
  // Process the admin links
2542
 
2543
  $display = bbp_is_topic_open( $topic->ID ) ? $r['close_text'] : $r['open_text'];
2544
  $uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_close', 'topic_id' => $topic->ID ) );
2545
+ $uri = wp_nonce_url( $uri, 'close-topic_' . $topic->ID );
2546
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-close-link">' . $display . '</a>' . $r['link_after'];
2547
 
2548
  return apply_filters( 'bbp_get_topic_close_link', $retval, $r );
2549
  }
2591
  'id' => 0,
2592
  'link_before' => '',
2593
  'link_after' => '',
2594
+ 'stick_text' => esc_html__( 'Stick', 'bbpress' ),
2595
+ 'unstick_text' => esc_html__( 'Unstick', 'bbpress' ),
2596
+ 'super_text' => esc_html__( '(to front)', 'bbpress' ),
2597
  ), 'get_topic_stick_link' );
2598
 
2599
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
2604
  $is_sticky = bbp_is_topic_sticky( $topic->ID );
2605
 
2606
  $stick_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID ) );
2607
+ $stick_uri = wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID );
2608
 
2609
+ $stick_display = ( true === $is_sticky ) ? $r['unstick_text'] : $r['stick_text'];
2610
+ $stick_display = '<a href="' . esc_url( $stick_uri ) . '" class="bbp-topic-sticky-link">' . $stick_display . '</a>';
2611
 
2612
  if ( empty( $is_sticky ) ) {
2613
  $super_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID, 'super' => 1 ) );
2614
+ $super_uri = wp_nonce_url( $super_uri, 'stick-topic_' . $topic->ID );
2615
 
2616
+ $super_display = ' <a href="' . esc_url( $super_uri ) . '" class="bbp-topic-super-sticky-link">' . $r['super_text'] . '</a>';
2617
  } else {
2618
  $super_display = '';
2619
  }
2662
  'id' => 0,
2663
  'link_before' => '',
2664
  'link_after' => '',
2665
+ 'merge_text' => esc_html__( 'Merge', 'bbpress' ),
2666
  ), 'get_topic_merge_link' );
2667
 
2668
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
2670
  if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
2671
  return;
2672
 
2673
+ $uri = add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) );
2674
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-merge-link">' . $r['merge_text'] . '</a>' . $r['link_after'];
2675
 
2676
  return apply_filters( 'bbp_get_topic_merge_link', $retval, $args );
2677
  }
2718
  'link_before' => '',
2719
  'link_after' => '',
2720
  'sep' => ' | ',
2721
+ 'spam_text' => esc_html__( 'Spam', 'bbpress' ),
2722
+ 'unspam_text' => esc_html__( 'Unspam', 'bbpress' )
2723
  ), 'get_topic_spam_link' );
2724
 
2725
  $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
2729
 
2730
  $display = bbp_is_topic_spam( $topic->ID ) ? $r['unspam_text'] : $r['spam_text'];
2731
  $uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_spam', 'topic_id' => $topic->ID ) );
2732
+ $uri = wp_nonce_url( $uri, 'spam-topic_' . $topic->ID );
2733
+ $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-spam-link">' . $display . '</a>' . $r['link_after'];
2734
 
2735
  return apply_filters( 'bbp_get_topic_spam_link', $retval, $r );
2736
  }
2737
 
2738
+ /**
2739
+ * Output the link to go directly to the reply form
2740
+ *
2741
+ * @since bbPress (r4966)
2742
+ *
2743
+ * @param array $args
2744
+ * @uses bbp_get_reply_to_link() To get the reply to link
2745
+ */
2746
+ function bbp_topic_reply_link( $args = array() ) {
2747
+ echo bbp_get_topic_reply_link( $args );
2748
+ }
2749
+
2750
+ /**
2751
+ * Return the link to go directly to the reply form
2752
+ *
2753
+ * @since bbPress (r4966)
2754
+ *
2755
+ * @param array $args Arguments
2756
+ * @uses bbp_current_user_can_access_create_reply_form() To check permissions
2757
+ * @uses bbp_get_topic_id() To validate the topic id
2758
+ * @uses bbp_get_topic() To get the topic
2759
+ * @uses apply_filters() Calls 'bbp_get_topic_reply_link' with the formatted link,
2760
+ * the arguments array, and the topic
2761
+ * @return string Link for a reply to a topic
2762
+ */
2763
+ function bbp_get_topic_reply_link( $args = array() ) {
2764
+
2765
+ // Parse arguments against default values
2766
+ $r = bbp_parse_args( $args, array(
2767
+ 'id' => 0,
2768
+ 'link_before' => '',
2769
+ 'link_after' => '',
2770
+ 'reply_text' => esc_html__( 'Reply', 'bbpress' ),
2771
+ ), 'get_topic_reply_link' );
2772
+
2773
+ // Get the reply to use it's ID and post_parent
2774
+ $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
2775
+
2776
+ // Bail if no reply or user cannot reply
2777
+ if ( empty( $topic ) || ! bbp_current_user_can_access_create_reply_form() )
2778
+ return;
2779
+
2780
+ $uri = '#new-post';
2781
+
2782
+ // Add $uri to the array, to be passed through the filter
2783
+ $r['uri'] = $uri;
2784
+ $retval = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after'];
2785
+
2786
+ return apply_filters( 'bbp_get_topic_reply_link', $retval, $r, $args );
2787
+ }
2788
+
2789
  /** Topic Pagination **********************************************************/
2790
 
2791
  /**
2831
  }
2832
 
2833
  // Filter and return
2834
+ return apply_filters( 'bbp_get_forum_pagination_count', esc_html( $retstr ) );
2835
  }
2836
 
2837
  /**
2912
  /**
2913
  * Displays topic type select box (normal/sticky/super sticky)
2914
  *
2915
+ * @since bbPress (r5059)
2916
+ * @deprecated since bbPress (r5059)
2917
  *
2918
  * @param $args This function supports these arguments:
 
 
 
2919
  * - select_id: Select id. Defaults to bbp_stick_topic
2920
  * - tab: Tabindex
2921
  * - topic_id: Topic id
2922
+ * - selected: Override the selected option
 
 
 
 
2923
  */
2924
  function bbp_topic_type_select( $args = '' ) {
2925
+ echo bbp_get_form_topic_type_dropdown( $args );
2926
+ }
2927
 
2928
+ /**
2929
+ * Displays topic type select box (normal/sticky/super sticky)
2930
+ *
2931
+ * @since bbPress (r5059)
2932
+ *
2933
+ * @param $args This function supports these arguments:
2934
+ * - select_id: Select id. Defaults to bbp_stick_topic
2935
+ * - tab: Tabindex
2936
+ * - topic_id: Topic id
2937
+ * - selected: Override the selected option
2938
+ */
2939
+ function bbp_form_topic_type_dropdown( $args = '' ) {
2940
+ echo bbp_get_form_topic_type_dropdown( $args );
2941
+ }
2942
+ /**
2943
+ * Returns topic type select box (normal/sticky/super sticky)
2944
+ *
2945
+ * @since bbPress (r5059)
2946
+ *
2947
+ * @param $args This function supports these arguments:
2948
+ * - select_id: Select id. Defaults to bbp_stick_topic
2949
+ * - tab: Tabindex
2950
+ * - topic_id: Topic id
2951
+ * - selected: Override the selected option
2952
+ * @uses bbp_get_topic_id() To get the topic id
2953
+ * @uses bbp_is_single_topic() To check if we're viewing a single topic
2954
+ * @uses bbp_is_topic_edit() To check if it is the topic edit page
2955
+ * @uses bbp_is_topic_super_sticky() To check if the topic is a super sticky
2956
+ * @uses bbp_is_topic_sticky() To check if the topic is a sticky
2957
+ */
2958
+ function bbp_get_form_topic_type_dropdown( $args = '' ) {
2959
 
2960
+ // Parse arguments against default values
2961
+ $r = bbp_parse_args( $args, array(
2962
+ 'select_id' => 'bbp_stick_topic',
2963
+ 'tab' => bbp_get_tab_index(),
2964
+ 'topic_id' => 0,
2965
+ 'selected' => false
2966
+ ), 'topic_type_select' );
2967
 
2968
+ // No specific selected value passed
2969
+ if ( empty( $r['selected'] ) ) {
 
2970
 
2971
+ // Post value is passed
2972
+ if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
2973
+ $r['selected'] = $_POST[ $r['select_id'] ];
 
2974
 
2975
+ // No Post value passed
2976
+ } else {
2977
 
2978
+ // Edit topic
2979
+ if ( bbp_is_single_topic() || bbp_is_topic_edit() ) {
 
2980
 
2981
+ // Get current topic id
2982
+ $topic_id = bbp_get_topic_id( $r['topic_id'] );
2983
+
2984
+ // Topic is super sticky
2985
+ if ( bbp_is_topic_super_sticky( $topic_id ) ) {
2986
+ $r['selected'] = 'super';
2987
+
2988
+ // Topic is sticky or normal
2989
+ } else {
2990
+ $r['selected'] = bbp_is_topic_sticky( $topic_id, false ) ? 'stick' : 'unstick';
2991
+ }
2992
+ }
2993
+ }
2994
  }
 
2995
 
2996
+ // Used variables
2997
+ $tab = !empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
2998
+
2999
+ // Start an output buffer, we'll finish it after the select loop
3000
+ ob_start(); ?>
3001
+
3002
+ <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
3003
+
3004
+ <?php foreach ( bbp_get_topic_types() as $key => $label ) : ?>
3005
 
3006
+ <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
3007
 
3008
+ <?php endforeach; ?>
3009
 
3010
+ </select>
3011
 
3012
+ <?php
3013
 
3014
+ // Return the results
3015
+ return apply_filters( 'bbp_get_form_topic_type_dropdown', ob_get_clean(), $r );
3016
+ }
3017
 
3018
+ /**
3019
+ * Output value topic status dropdown
3020
+ *
3021
+ * @since bbPress (r5059)
3022
+ *
3023
+ * @param int $topic_id The topic id to use
3024
+ */
3025
+ function bbp_form_topic_status_dropdown( $args = '' ) {
3026
+ echo bbp_get_form_topic_status_dropdown( $args );
3027
  }
3028
+ /**
3029
+ * Returns topic status downdown
3030
+ *
3031
+ * This dropdown is only intended to be seen by users with the 'moderate'
3032
+ * capability. Because of this, no additional capablitiy checks are performed
3033
+ * within this function to check available topic statuses.
3034
+ *
3035
+ * @since bbPress (r5059)
3036
+ *
3037
+ * @param $args This function supports these arguments:
3038
+ * - select_id: Select id. Defaults to bbp_open_close_topic
3039
+ * - tab: Tabindex
3040
+ * - topic_id: Topic id
3041
+ * - selected: Override the selected option
3042
+ */
3043
+ function bbp_get_form_topic_status_dropdown( $args = '' ) {
3044
+
3045
+ // Parse arguments against default values
3046
+ $r = bbp_parse_args( $args, array(
3047
+ 'select_id' => 'bbp_topic_status',
3048
+ 'tab' => bbp_get_tab_index(),
3049
+ 'topic_id' => 0,
3050
+ 'selected' => false
3051
+ ), 'topic_open_close_select' );
3052
+
3053
+ // No specific selected value passed
3054
+ if ( empty( $r['selected'] ) ) {
3055
+
3056
+ // Post value is passed
3057
+ if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) {
3058
+ $r['selected'] = $_POST[ $r['select_id'] ];
3059
+
3060
+ // No Post value was passed
3061
+ } else {
3062
+
3063
+ // Edit topic
3064
+ if ( bbp_is_topic_edit() ) {
3065
+ $r['topic_id'] = bbp_get_topic_id( $r['topic_id'] );
3066
+ $r['selected'] = bbp_get_topic_status( $r['topic_id'] );
3067
+
3068
+ // New topic
3069
+ } else {
3070
+ $r['selected'] = bbp_get_public_status_id();
3071
+ }
3072
+ }
3073
+ }
3074
+
3075
+ // Used variables
3076
+ $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
3077
+
3078
+ // Start an output buffer, we'll finish it after the select loop
3079
+ ob_start(); ?>
3080
+
3081
+ <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
3082
+
3083
+ <?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) : ?>
3084
+
3085
+ <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
3086
+
3087
+ <?php endforeach; ?>
3088
+
3089
+ </select>
3090
+
3091
+ <?php
3092
+
3093
+ // Return the results
3094
+ return apply_filters( 'bbp_get_form_topic_status_dropdown', ob_get_clean(), $r );
3095
+ }
3096
 
3097
  /** Single Topic **************************************************************/
3098
 
3158
  $last_reply = bbp_get_topic_last_reply_id( $topic_id );
3159
  if ( !empty( $last_reply ) ) {
3160
  $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_reply, 'size' => $r['size'] ) );
3161
+ $retstr = sprintf( esc_html__( 'This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $reply_count, $voice_count, $last_updated_by, $time_since );
3162
 
3163
  // Topic has no replies
3164
  } elseif ( ! empty( $voice_count ) && ! empty( $reply_count ) ) {
3165
+ $retstr = sprintf( esc_html__( 'This topic contains %1$s and has %2$s.', 'bbpress' ), $voice_count, $reply_count );
3166
 
3167
  // Topic has no replies and no voices
3168
  } elseif ( empty( $voice_count ) && empty( $reply_count ) ) {
3169
+ $retstr = sprintf( esc_html__( 'This topic has no replies.', 'bbpress' ), $voice_count, $reply_count );
3170
  }
3171
 
3172
  // Add the 'view all' filter back
3343
  * @uses bbp_get_topic_tag_link()
3344
  */
3345
  function bbp_topic_tag_link( $tag = '' ) {
3346
+ echo esc_url( bbp_get_topic_tag_link( $tag ) );
3347
  }
3348
  /**
3349
  * Return the link of the current tag
3387
  * @uses bbp_get_topic_tag_edit_link()
3388
  */
3389
  function bbp_topic_tag_edit_link( $tag = '' ) {
3390
+ echo esc_url( bbp_get_topic_tag_edit_link( $tag ) );
3391
  }
3392
  /**
3393
  * Return the link of the current tag
3634
  $terms = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) );
3635
 
3636
  // Loop through them
3637
+ foreach ( $terms as $term ) {
3638
  $new_terms[] = $term->name;
3639
  }
3640
  }
3728
  $post_author = bbp_get_global_post_field( 'post_author', 'raw' );
3729
 
3730
  // Post author is not the current user
3731
+ if ( bbp_get_current_user_id() !== $post_author ) {
3732
  $topic_subscribed = bbp_is_user_subscribed( $post_author );
3733
 
3734
  // Post author is the current user
includes/users/capabilities.php CHANGED
@@ -68,7 +68,7 @@ function bbp_set_user_role( $user_id = 0, $new_role = '' ) {
68
  $role = bbp_get_user_role( $user_id );
69
 
70
  // User already has this role so no new role is set
71
- if ( $new_role == $role ) {
72
  $new_role = false;
73
 
74
  // Users role is different than the new role
@@ -115,13 +115,20 @@ function bbp_get_user_role( $user_id = 0 ) {
115
  $user = get_userdata( $user_id );
116
  $role = false;
117
 
118
- // User has roles so lets
119
  if ( ! empty( $user->roles ) ) {
120
- $roles = array_intersect( array_values( $user->roles ), array_keys( bbp_get_dynamic_roles() ) );
121
 
122
- // If there's a role in the array, use the first one
 
 
 
 
 
 
 
 
123
  if ( !empty( $roles ) ) {
124
- $role = array_shift( array_values( $roles ) );
125
  }
126
  }
127
 
@@ -152,15 +159,17 @@ function bbp_get_user_blog_role( $user_id = 0 ) {
152
  // User has roles so lets
153
  if ( ! empty( $user->roles ) ) {
154
 
155
- // Apply the WordPress 'editable_roles' filter to let plugins ride along
156
- $all_roles = apply_filters( 'editable_roles', $wp_roles->roles );
 
 
 
157
 
158
- // Look for an intersection of user roles to available blog roles
159
- $roles = array_intersect( array_values( $user->roles ), array_keys( $all_roles ) );
160
-
161
- // If there's a role in the array, use the first one
162
  if ( !empty( $roles ) ) {
163
- $role = array_shift( array_values( $roles ) );
164
  }
165
  }
166
 
@@ -192,7 +201,7 @@ function bbp_profile_update_role( $user_id = 0 ) {
192
  $forums_role = bbp_get_user_role( $user_id );
193
 
194
  // Bail if no role change
195
- if ( $new_role == $forums_role )
196
  return;
197
 
198
  // Bail if trying to set their own role
@@ -280,7 +289,7 @@ function bbp_set_current_user_default_role() {
280
  /** Add or Map ************************************************************/
281
 
282
  // Add the user to the site
283
- if ( true == $add_to_site ) {
284
 
285
  // Make sure bbPress roles are added
286
  bbp_add_forums_roles();
@@ -366,7 +375,7 @@ function bbp_is_user_spammer( $user_id = 0 ) {
366
 
367
  * @uses bbp_is_single_user()
368
  * @uses bbp_is_user_home()
369
- * @uses bbp_get_displayed_user_field()
370
  * @uses bbp_is_user_keymaster()
371
  * @uses get_blogs_of_user()
372
  * @uses get_current_blog_id()
@@ -407,7 +416,6 @@ function bbp_make_spam_user( $user_id = 0 ) {
407
  // Make array of post types to mark as spam
408
  $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
409
  $post_types = "'" . implode( "', '", $post_types ) . "'";
410
- $status = bbp_get_public_status_id();
411
 
412
  // Loop through blogs and remove their posts
413
  foreach ( (array) array_keys( $blogs ) as $blog_id ) {
@@ -416,7 +424,7 @@ function bbp_make_spam_user( $user_id = 0 ) {
416
  switch_to_blog( $blog_id );
417
 
418
  // Get topics and replies
419
- $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = '{$status}' AND post_type IN ({$post_types})" );
420
 
421
  // Loop through posts and spam them
422
  if ( !empty( $posts ) ) {
@@ -455,7 +463,7 @@ function bbp_make_spam_user( $user_id = 0 ) {
455
  *
456
  * @uses bbp_is_single_user()
457
  * @uses bbp_is_user_home()
458
- * @uses bbp_get_displayed_user_field()
459
  * @uses bbp_is_user_keymaster()
460
  * @uses get_blogs_of_user()
461
  * @uses bbp_get_topic_post_type()
@@ -472,7 +480,7 @@ function bbp_make_ham_user( $user_id = 0 ) {
472
 
473
  // Use displayed user if it's not yourself
474
  if ( empty( $user_id ) && bbp_is_single_user() && !bbp_is_user_home() )
475
- $user_id = bbp_get_displayed_user_field();
476
 
477
  // Bail if no user ID
478
  if ( empty( $user_id ) )
@@ -495,7 +503,6 @@ function bbp_make_ham_user( $user_id = 0 ) {
495
  // Make array of post types to mark as spam
496
  $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
497
  $post_types = "'" . implode( "', '", $post_types ) . "'";
498
- $status = bbp_get_spam_status_id();
499
 
500
  // Loop through blogs and remove their posts
501
  foreach ( (array) array_keys( $blogs ) as $blog_id ) {
@@ -504,7 +511,7 @@ function bbp_make_ham_user( $user_id = 0 ) {
504
  switch_to_blog( $blog_id );
505
 
506
  // Get topics and replies
507
- $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = '{$status}' AND post_type IN ({$post_types})" );
508
 
509
  // Loop through posts and spam them
510
  if ( !empty( $posts ) ) {
68
  $role = bbp_get_user_role( $user_id );
69
 
70
  // User already has this role so no new role is set
71
+ if ( $new_role === $role ) {
72
  $new_role = false;
73
 
74
  // Users role is different than the new role
115
  $user = get_userdata( $user_id );
116
  $role = false;
117
 
118
+ // User has roles so look for a bbPress one
119
  if ( ! empty( $user->roles ) ) {
 
120
 
121
+ // Look for a bbPress role
122
+ $roles = array_intersect(
123
+ array_values( $user->roles ),
124
+ array_keys( bbp_get_dynamic_roles() )
125
+ );
126
+
127
+ // If there's a role in the array, use the first one. This isn't very
128
+ // smart, but since roles aren't exactly hierarchical, and bbPress
129
+ // does not yet have a UI for multiple user roles, it's fine for now.
130
  if ( !empty( $roles ) ) {
131
+ $role = array_shift( $roles );
132
  }
133
  }
134
 
159
  // User has roles so lets
160
  if ( ! empty( $user->roles ) ) {
161
 
162
+ // Look for a non bbPress role
163
+ $roles = array_intersect(
164
+ array_values( $user->roles ),
165
+ array_keys( bbp_get_blog_roles() )
166
+ );
167
 
168
+ // If there's a role in the array, use the first one. This isn't very
169
+ // smart, but since roles aren't exactly hierarchical, and WordPress
170
+ // does not yet have a UI for multiple user roles, it's fine for now.
 
171
  if ( !empty( $roles ) ) {
172
+ $role = array_shift( $roles );
173
  }
174
  }
175
 
201
  $forums_role = bbp_get_user_role( $user_id );
202
 
203
  // Bail if no role change
204
+ if ( $new_role === $forums_role )
205
  return;
206
 
207
  // Bail if trying to set their own role
289
  /** Add or Map ************************************************************/
290
 
291
  // Add the user to the site
292
+ if ( true === $add_to_site ) {
293
 
294
  // Make sure bbPress roles are added
295
  bbp_add_forums_roles();
375
 
376
  * @uses bbp_is_single_user()
377
  * @uses bbp_is_user_home()
378
+ * @uses bbp_get_displayed_user_id()
379
  * @uses bbp_is_user_keymaster()
380
  * @uses get_blogs_of_user()
381
  * @uses get_current_blog_id()
416
  // Make array of post types to mark as spam
417
  $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
418
  $post_types = "'" . implode( "', '", $post_types ) . "'";
 
419
 
420
  // Loop through blogs and remove their posts
421
  foreach ( (array) array_keys( $blogs ) as $blog_id ) {
424
  switch_to_blog( $blog_id );
425
 
426
  // Get topics and replies
427
+ $posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = '%s' AND post_type IN ( {$post_types} )", $user_id, bbp_get_public_status_id() ) );
428
 
429
  // Loop through posts and spam them
430
  if ( !empty( $posts ) ) {
463
  *
464
  * @uses bbp_is_single_user()
465
  * @uses bbp_is_user_home()
466
+ * @uses bbp_get_displayed_user_id()
467
  * @uses bbp_is_user_keymaster()
468
  * @uses get_blogs_of_user()
469
  * @uses bbp_get_topic_post_type()
480
 
481
  // Use displayed user if it's not yourself
482
  if ( empty( $user_id ) && bbp_is_single_user() && !bbp_is_user_home() )
483
+ $user_id = bbp_get_displayed_user_id();
484
 
485
  // Bail if no user ID
486
  if ( empty( $user_id ) )
503
  // Make array of post types to mark as spam
504
  $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
505
  $post_types = "'" . implode( "', '", $post_types ) . "'";
 
506
 
507
  // Loop through blogs and remove their posts
508
  foreach ( (array) array_keys( $blogs ) as $blog_id ) {
511
  switch_to_blog( $blog_id );
512
 
513
  // Get topics and replies
514
+ $posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = '%s' AND post_type IN ( {$post_types} )", $user_id, bbp_get_spam_status_id() ) );
515
 
516
  // Loop through posts and spam them
517
  if ( !empty( $posts ) ) {
includes/users/functions.php CHANGED
@@ -31,7 +31,7 @@ function bbp_redirect_login( $url = '', $raw_url = '', $user = '' ) {
31
  $url = $raw_url;
32
 
33
  // $url was manually set in wp-login.php to redirect to admin
34
- elseif ( admin_url() == $url )
35
  $url = home_url();
36
 
37
  // $url is empty
@@ -221,20 +221,20 @@ function bbp_get_user_reply_count_raw( $user_id = 0 ) {
221
  * @return array|bool Results if the topic has any favoriters, otherwise false
222
  */
223
  function bbp_get_topic_favoriters( $topic_id = 0 ) {
 
224
  if ( empty( $topic_id ) )
225
  return;
226
 
227
  global $wpdb;
228
 
229
- // Get the users who have favorited the topic
230
  $key = $wpdb->prefix . '_bbp_favorites';
231
- $users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$topic_id}', meta_value) > 0" );
232
- $users = apply_filters( 'bbp_get_topic_favoriters', $users, $topic_id );
233
-
234
- if ( !empty( $users ) )
235
- return $users;
236
 
237
- return false;
238
  }
239
 
240
  /**
@@ -257,14 +257,12 @@ function bbp_get_user_favorites( $user_id = 0 ) {
257
  // If user has favorites, load them
258
  $favorites = bbp_get_user_favorites_topic_ids( $user_id );
259
  if ( !empty( $favorites ) ) {
260
-
261
- // Setup the topics query
262
- $topics_query = bbp_has_topics( array( 'post__in' => $favorites ) );
263
-
264
- return apply_filters( 'bbp_get_user_favorites', $topics_query, $user_id );
265
  }
266
 
267
- return false;
268
  }
269
 
270
  /**
@@ -284,11 +282,10 @@ function bbp_get_user_favorites_topic_ids( $user_id = 0 ) {
284
  if ( empty( $user_id ) )
285
  return false;
286
 
287
- $favorites = (string) get_user_option( '_bbp_favorites', $user_id );
288
- $favorites = (array) explode( ',', $favorites );
289
- $favorites = array_filter( $favorites );
290
 
291
- return apply_filters( 'bbp_get_user_favorites_topic_ids', $favorites, $user_id );
292
  }
293
 
294
  /**
@@ -356,15 +353,14 @@ function bbp_add_user_favorite( $user_id = 0, $topic_id = 0 ) {
356
  if ( empty( $user_id ) || empty( $topic_id ) )
357
  return false;
358
 
359
- $favorites = (array) bbp_get_user_favorites_topic_ids( $user_id );
360
- $topic = bbp_get_topic( $topic_id );
361
  if ( empty( $topic ) )
362
  return false;
363
 
 
364
  if ( !in_array( $topic_id, $favorites ) ) {
365
  $favorites[] = $topic_id;
366
- $favorites = array_filter( $favorites );
367
- $favorites = (string) implode( ',', $favorites );
368
  update_user_option( $user_id, '_bbp_favorites', $favorites );
369
  }
370
 
@@ -401,7 +397,7 @@ function bbp_remove_user_favorite( $user_id, $topic_id ) {
401
  $favorites = array_filter( $favorites );
402
 
403
  if ( !empty( $favorites ) ) {
404
- $favorites = implode( ',', $favorites );
405
  update_user_option( $user_id, '_bbp_favorites', $favorites );
406
  } else {
407
  delete_user_option( $user_id, '_bbp_favorites' );
@@ -476,16 +472,16 @@ function bbp_favorites_handler( $action = '' ) {
476
  $is_favorite = bbp_is_user_favorite( $user_id, $topic_id );
477
  $success = false;
478
 
479
- if ( true == $is_favorite && 'bbp_favorite_remove' == $action )
480
  $success = bbp_remove_user_favorite( $user_id, $topic_id );
481
- elseif ( false == $is_favorite && 'bbp_favorite_add' == $action )
482
  $success = bbp_add_user_favorite( $user_id, $topic_id );
483
 
484
  // Do additional favorites actions
485
  do_action( 'bbp_favorites_handler', $success, $user_id, $topic_id, $action );
486
 
487
  // Success!
488
- if ( true == $success ) {
489
 
490
  // Redirect back from whence we came
491
  if ( bbp_is_favorites() ) {
@@ -506,9 +502,9 @@ function bbp_favorites_handler( $action = '' ) {
506
  exit();
507
 
508
  // Fail! Handle errors
509
- } elseif ( true == $is_favorite && 'bbp_favorite_remove' == $action ) {
510
  bbp_add_error( 'bbp_favorite_remove', __( '<strong>ERROR</strong>: There was a problem removing that topic from favorites!', 'bbpress' ) );
511
- } elseif ( false == $is_favorite && 'bbp_favorite_add' == $action ) {
512
  bbp_add_error( 'bbp_favorite_add', __( '<strong>ERROR</strong>: There was a problem favoriting that topic!', 'bbpress' ) );
513
  }
514
  }
@@ -526,23 +522,20 @@ function bbp_favorites_handler( $action = '' ) {
526
  * @return array|bool Results if the topic has any subscribers, otherwise false
527
  */
528
  function bbp_get_topic_subscribers( $topic_id = 0 ) {
529
- if ( empty( $topic_id ) ) return;
 
 
530
 
531
  global $wpdb;
532
 
533
  $key = $wpdb->prefix . '_bbp_subscriptions';
534
  $users = wp_cache_get( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
535
- if ( empty( $users ) ) {
536
  $users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$topic_id}', meta_value) > 0" );
537
  wp_cache_set( 'bbp_get_topic_subscribers_' . $topic_id, $users, 'bbpress_users' );
538
  }
539
 
540
- if ( !empty( $users ) ) {
541
- $users = apply_filters( 'bbp_get_topic_subscribers', $users );
542
- return $users;
543
- }
544
-
545
- return false;
546
  }
547
 
548
  /**
@@ -568,10 +561,11 @@ function bbp_get_user_subscriptions( $user_id = 0 ) {
568
  $subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
569
  if ( !empty( $subscriptions ) ) {
570
  $query = bbp_has_topics( array( 'post__in' => $subscriptions ) );
571
- return apply_filters( 'bbp_get_user_subscriptions', $query, $user_id );
 
572
  }
573
 
574
- return false;
575
  }
576
 
577
  /**
@@ -591,11 +585,10 @@ function bbp_get_user_subscribed_topic_ids( $user_id = 0 ) {
591
  if ( empty( $user_id ) )
592
  return false;
593
 
594
- $subscriptions = (string) get_user_option( '_bbp_subscriptions', $user_id );
595
- $subscriptions = (array) explode( ',', $subscriptions );
596
- $subscriptions = array_filter( $subscriptions );
597
 
598
- return apply_filters( 'bbp_get_user_subscribed_topic_ids', $subscriptions, $user_id );
599
  }
600
 
601
  /**
@@ -665,19 +658,17 @@ function bbp_add_user_subscription( $user_id = 0, $topic_id = 0 ) {
665
  if ( empty( $user_id ) || empty( $topic_id ) )
666
  return false;
667
 
668
- $subscriptions = (array) bbp_get_user_subscribed_topic_ids( $user_id );
669
-
670
  $topic = bbp_get_topic( $topic_id );
671
  if ( empty( $topic ) )
672
  return false;
673
 
 
674
  if ( !in_array( $topic_id, $subscriptions ) ) {
675
  $subscriptions[] = $topic_id;
676
- $subscriptions = array_filter( $subscriptions );
677
- $subscriptions = (string) implode( ',', $subscriptions );
678
  update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
679
 
680
- wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress' );
681
  }
682
 
683
  do_action( 'bbp_add_user_subscription', $user_id, $topic_id );
@@ -715,13 +706,13 @@ function bbp_remove_user_subscription( $user_id, $topic_id ) {
715
  $subscriptions = array_filter( $subscriptions );
716
 
717
  if ( !empty( $subscriptions ) ) {
718
- $subscriptions = implode( ',', $subscriptions );
719
  update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
720
  } else {
721
  delete_user_option( $user_id, '_bbp_subscriptions' );
722
  }
723
 
724
- wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress' );
725
  }
726
 
727
  do_action( 'bbp_remove_user_subscription', $user_id, $topic_id );
@@ -794,16 +785,16 @@ function bbp_subscriptions_handler( $action = '' ) {
794
  $is_subscription = bbp_is_user_subscribed( $user_id, $topic_id );
795
  $success = false;
796
 
797
- if ( true == $is_subscription && 'bbp_unsubscribe' == $action )
798
  $success = bbp_remove_user_subscription( $user_id, $topic_id );
799
- elseif ( false == $is_subscription && 'bbp_subscribe' == $action )
800
  $success = bbp_add_user_subscription( $user_id, $topic_id );
801
 
802
  // Do additional subscriptions actions
803
  do_action( 'bbp_subscriptions_handler', $success, $user_id, $topic_id, $action );
804
 
805
  // Success!
806
- if ( true == $success ) {
807
 
808
  // Redirect back from whence we came
809
  if ( bbp_is_subscriptions() ) {
@@ -824,9 +815,9 @@ function bbp_subscriptions_handler( $action = '' ) {
824
  exit();
825
 
826
  // Fail! Handle errors
827
- } elseif ( true == $is_subscription && 'bbp_unsubscribe' == $action ) {
828
  bbp_add_error( 'bbp_unsubscribe', __( '<strong>ERROR</strong>: There was a problem unsubscribing from that topic!', 'bbpress' ) );
829
- } elseif ( false == $is_subscription && 'bbp_subscribe' == $action ) {
830
  bbp_add_error( 'bbp_subscribe', __( '<strong>ERROR</strong>: There was a problem subscribing to that topic!', 'bbpress' ) );
831
  }
832
  }
@@ -876,15 +867,15 @@ function bbp_edit_user_handler( $action = '' ) {
876
 
877
  $new_email = get_option( $user_id . '_new_email' );
878
 
879
- if ( $new_email['hash'] == $_GET['newuseremail'] ) {
880
- $user = new stdClass();
881
  $user->ID = $user_id;
882
  $user->user_email = esc_html( trim( $new_email['newemail'] ) );
883
 
884
  global $wpdb;
885
 
886
- if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", bbp_get_displayed_user_field( 'user_login' ) ) ) ) {
887
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, bbp_get_displayed_user_field( 'user_login' ) ) );
888
  }
889
 
890
  wp_update_user( get_object_vars( $user ) );
@@ -895,7 +886,7 @@ function bbp_edit_user_handler( $action = '' ) {
895
  }
896
 
897
  // Delete new email address from user options
898
- } elseif ( is_multisite() && bbp_is_user_home_edit() && !empty( $_GET['dismiss'] ) && ( $user_id . '_new_email' == $_GET['dismiss'] ) ) {
899
  delete_option( $user_id . '_new_email' );
900
  wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
901
  exit();
@@ -917,6 +908,11 @@ function bbp_edit_user_handler( $action = '' ) {
917
  $edit_action = bbp_is_user_home_edit() ? 'personal_options_update' : 'edit_user_profile_update';
918
  do_action( $edit_action, $user_id );
919
 
 
 
 
 
 
920
  // Handle user edit
921
  $edit_user = edit_user( $user_id );
922
 
@@ -978,17 +974,10 @@ function bbp_get_user_topics_started( $user_id = 0 ) {
978
  if ( empty( $user_id ) )
979
  return false;
980
 
981
- // Query defaults
982
- $default_query = array(
983
- 'author' => $user_id,
984
- 'show_stickies' => false,
985
- 'order' => 'DESC',
986
- );
987
-
988
  // Try to get the topics
989
- $query = bbp_has_topics( $default_query );
990
- if ( empty( $query ) )
991
- return false;
992
 
993
  return apply_filters( 'bbp_get_user_topics_started', $query, $user_id );
994
  }
@@ -1012,14 +1001,9 @@ function bbp_get_user_replies_created( $user_id = 0 ) {
1012
 
1013
  // Try to get the topics
1014
  $query = bbp_has_replies( array(
1015
- 'post_type' => bbp_get_reply_post_type(),
1016
- 'post_parent' => 'any',
1017
- 'posts_per_page' => bbp_get_replies_per_page(),
1018
- 'paged' => bbp_get_paged(),
1019
- 'orderby' => 'date',
1020
- 'order' => 'DESC',
1021
- 'author' => $user_id,
1022
- 'show_stickies' => false,
1023
  ) );
1024
 
1025
  return apply_filters( 'bbp_get_user_replies_created', $query, $user_id );
31
  $url = $raw_url;
32
 
33
  // $url was manually set in wp-login.php to redirect to admin
34
+ elseif ( admin_url() === $url )
35
  $url = home_url();
36
 
37
  // $url is empty
221
  * @return array|bool Results if the topic has any favoriters, otherwise false
222
  */
223
  function bbp_get_topic_favoriters( $topic_id = 0 ) {
224
+ $topic_id = bbp_get_topic_id( $topic_id );
225
  if ( empty( $topic_id ) )
226
  return;
227
 
228
  global $wpdb;
229
 
 
230
  $key = $wpdb->prefix . '_bbp_favorites';
231
+ $users = wp_cache_get( 'bbp_get_topic_favoriters_' . $topic_id, 'bbpress_users' );
232
+ if ( false === $users ) {
233
+ $users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$topic_id}', meta_value) > 0" );
234
+ wp_cache_set( 'bbp_get_topic_favoriters_' . $topic_id, $users, 'bbpress_users' );
235
+ }
236
 
237
+ return apply_filters( 'bbp_get_topic_favoriters', $users );
238
  }
239
 
240
  /**
257
  // If user has favorites, load them
258
  $favorites = bbp_get_user_favorites_topic_ids( $user_id );
259
  if ( !empty( $favorites ) ) {
260
+ $query = bbp_has_topics( array( 'post__in' => $favorites ) );
261
+ } else {
262
+ $query = false;
 
 
263
  }
264
 
265
+ return apply_filters( 'bbp_get_user_favorites', $query, $user_id, $favorites );
266
  }
267
 
268
  /**
282
  if ( empty( $user_id ) )
283
  return false;
284
 
285
+ $favorites = get_user_option( '_bbp_favorites', $user_id );
286
+ $favorites = array_filter( wp_parse_id_list( $favorites ) );
 
287
 
288
+ return (array) apply_filters( 'bbp_get_user_favorites_topic_ids', $favorites, $user_id );
289
  }
290
 
291
  /**
353
  if ( empty( $user_id ) || empty( $topic_id ) )
354
  return false;
355
 
356
+ $topic = bbp_get_topic( $topic_id );
 
357
  if ( empty( $topic ) )
358
  return false;
359
 
360
+ $favorites = bbp_get_user_favorites_topic_ids( $user_id );
361
  if ( !in_array( $topic_id, $favorites ) ) {
362
  $favorites[] = $topic_id;
363
+ $favorites = implode( ',', wp_parse_id_list( array_filter( $favorites ) ) );
 
364
  update_user_option( $user_id, '_bbp_favorites', $favorites );
365
  }
366
 
397
  $favorites = array_filter( $favorites );
398
 
399
  if ( !empty( $favorites ) ) {
400
+ $favorites = implode( ',', wp_parse_id_list( $favorites ) );
401
  update_user_option( $user_id, '_bbp_favorites', $favorites );
402
  } else {
403
  delete_user_option( $user_id, '_bbp_favorites' );
472
  $is_favorite = bbp_is_user_favorite( $user_id, $topic_id );
473
  $success = false;
474
 
475
+ if ( true === $is_favorite && 'bbp_favorite_remove' === $action )
476
  $success = bbp_remove_user_favorite( $user_id, $topic_id );
477
+ elseif ( false === $is_favorite && 'bbp_favorite_add' === $action )
478
  $success = bbp_add_user_favorite( $user_id, $topic_id );
479
 
480
  // Do additional favorites actions
481
  do_action( 'bbp_favorites_handler', $success, $user_id, $topic_id, $action );
482
 
483
  // Success!
484
+ if ( true === $success ) {
485
 
486
  // Redirect back from whence we came
487
  if ( bbp_is_favorites() ) {
502
  exit();
503
 
504
  // Fail! Handle errors
505
+ } elseif ( true === $is_favorite && 'bbp_favorite_remove' === $action ) {
506
  bbp_add_error( 'bbp_favorite_remove', __( '<strong>ERROR</strong>: There was a problem removing that topic from favorites!', 'bbpress' ) );
507
+ } elseif ( false === $is_favorite && 'bbp_favorite_add' === $action ) {
508
  bbp_add_error( 'bbp_favorite_add', __( '<strong>ERROR</strong>: There was a problem favoriting that topic!', 'bbpress' ) );
509
  }
510
  }
522
  * @return array|bool Results if the topic has any subscribers, otherwise false
523
  */
524
  function bbp_get_topic_subscribers( $topic_id = 0 ) {
525
+ $topic_id = bbp_get_topic_id( $topic_id );
526
+ if ( empty( $topic_id ) )
527
+ return;
528
 
529
  global $wpdb;
530
 
531
  $key = $wpdb->prefix . '_bbp_subscriptions';
532
  $users = wp_cache_get( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
533
+ if ( false === $users ) {
534
  $users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$topic_id}', meta_value) > 0" );
535
  wp_cache_set( 'bbp_get_topic_subscribers_' . $topic_id, $users, 'bbpress_users' );
536
  }
537
 
538
+ return apply_filters( 'bbp_get_topic_subscribers', $users );
 
 
 
 
 
539
  }
540
 
541
  /**
561
  $subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
562
  if ( !empty( $subscriptions ) ) {
563
  $query = bbp_has_topics( array( 'post__in' => $subscriptions ) );
564
+ } else {
565
+ $query = false;
566
  }
567
 
568
+ return apply_filters( 'bbp_get_user_subscriptions', $query, $user_id );
569
  }
570
 
571
  /**
585
  if ( empty( $user_id ) )
586
  return false;
587
 
588
+ $subscriptions = get_user_option( '_bbp_subscriptions', $user_id );
589
+ $subscriptions = array_filter( wp_parse_id_list( $subscriptions ) );
 
590
 
591
+ return (array) apply_filters( 'bbp_get_user_subscribed_topic_ids', $subscriptions, $user_id );
592
  }
593
 
594
  /**
658
  if ( empty( $user_id ) || empty( $topic_id ) )
659
  return false;
660
 
 
 
661
  $topic = bbp_get_topic( $topic_id );
662
  if ( empty( $topic ) )
663
  return false;
664
 
665
+ $subscriptions = (array) bbp_get_user_subscribed_topic_ids( $user_id );
666
  if ( !in_array( $topic_id, $subscriptions ) ) {
667
  $subscriptions[] = $topic_id;
668
+ $subscriptions = implode( ',', wp_parse_id_list( array_filter( $subscriptions ) ) );
 
669
  update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
670
 
671
+ wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
672
  }
673
 
674
  do_action( 'bbp_add_user_subscription', $user_id, $topic_id );
706
  $subscriptions = array_filter( $subscriptions );
707
 
708
  if ( !empty( $subscriptions ) ) {
709
+ $subscriptions = implode( ',', wp_parse_id_list( $subscriptions ) );
710
  update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
711
  } else {
712
  delete_user_option( $user_id, '_bbp_subscriptions' );
713
  }
714
 
715
+ wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
716
  }
717
 
718
  do_action( 'bbp_remove_user_subscription', $user_id, $topic_id );
785
  $is_subscription = bbp_is_user_subscribed( $user_id, $topic_id );
786
  $success = false;
787
 
788
+ if ( true === $is_subscription && 'bbp_unsubscribe' === $action )
789
  $success = bbp_remove_user_subscription( $user_id, $topic_id );
790
+ elseif ( false === $is_subscription && 'bbp_subscribe' === $action )
791
  $success = bbp_add_user_subscription( $user_id, $topic_id );
792
 
793
  // Do additional subscriptions actions
794
  do_action( 'bbp_subscriptions_handler', $success, $user_id, $topic_id, $action );
795
 
796
  // Success!
797
+ if ( true === $success ) {
798
 
799
  // Redirect back from whence we came
800
  if ( bbp_is_subscriptions() ) {
815
  exit();
816
 
817
  // Fail! Handle errors
818
+ } elseif ( true === $is_subscription && 'bbp_unsubscribe' === $action ) {
819
  bbp_add_error( 'bbp_unsubscribe', __( '<strong>ERROR</strong>: There was a problem unsubscribing from that topic!', 'bbpress' ) );
820
+ } elseif ( false === $is_subscription && 'bbp_subscribe' === $action ) {
821
  bbp_add_error( 'bbp_subscribe', __( '<strong>ERROR</strong>: There was a problem subscribing to that topic!', 'bbpress' ) );
822
  }
823
  }
867
 
868
  $new_email = get_option( $user_id . '_new_email' );
869
 
870
+ if ( $new_email['hash'] === $_GET['newuseremail'] ) {
871
+ $user = new WP_User();
872
  $user->ID = $user_id;
873
  $user->user_email = esc_html( trim( $new_email['newemail'] ) );
874
 
875
  global $wpdb;
876
 
877
+ if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", bbp_get_displayed_user_field( 'user_login', 'raw' ) ) ) ) {
878
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, bbp_get_displayed_user_field( 'user_login', 'raw' ) ) );
879
  }
880
 
881
  wp_update_user( get_object_vars( $user ) );
886
  }
887
 
888
  // Delete new email address from user options
889
+ } elseif ( is_multisite() && bbp_is_user_home_edit() && !empty( $_GET['dismiss'] ) && ( $user_id . '_new_email' === $_GET['dismiss'] ) ) {
890
  delete_option( $user_id . '_new_email' );
891
  wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
892
  exit();
908
  $edit_action = bbp_is_user_home_edit() ? 'personal_options_update' : 'edit_user_profile_update';
909
  do_action( $edit_action, $user_id );
910
 
911
+ // Prevent edit_user() from wiping out the user's Toolbar on front setting
912
+ if ( !isset( $_POST['admin_bar_front'] ) && _get_admin_bar_pref( 'front', $user_id ) ) {
913
+ $_POST['admin_bar_front'] = 1;
914
+ }
915
+
916
  // Handle user edit
917
  $edit_user = edit_user( $user_id );
918
 
974
  if ( empty( $user_id ) )
975
  return false;
976
 
 
 
 
 
 
 
 
977
  // Try to get the topics
978
+ $query = bbp_has_topics( array(
979
+ 'author' => $user_id
980
+ ) );
981
 
982
  return apply_filters( 'bbp_get_user_topics_started', $query, $user_id );
983
  }
1001
 
1002
  // Try to get the topics
1003
  $query = bbp_has_replies( array(
1004
+ 'post_type' => bbp_get_reply_post_type(),
1005
+ 'order' => 'DESC',
1006
+ 'author' => $user_id
 
 
 
 
 
1007
  ) );
1008
 
1009
  return apply_filters( 'bbp_get_user_replies_created', $query, $user_id );
includes/users/options.php CHANGED
@@ -72,7 +72,7 @@ function bbp_delete_user_options( $user_id = 0 ) {
72
  return;
73
 
74
  // Add default options
75
- foreach ( bbp_get_default_user_options() as $key => $value )
76
  delete_user_option( $user_id, $key );
77
 
78
  // Allow previously activated plugins to append their own options.
@@ -91,7 +91,7 @@ function bbp_delete_user_options( $user_id = 0 ) {
91
  function bbp_setup_user_option_filters() {
92
 
93
  // Add filters to each bbPress option
94
- foreach ( bbp_get_default_user_options() as $key => $value )
95
  add_filter( 'get_user_option_' . $key, 'bbp_filter_get_user_option', 10, 3 );
96
 
97
  // Allow previously activated plugins to append their own options.
@@ -152,7 +152,7 @@ function bbp_user_topic_count( $user_id = 0, $integer = false ) {
152
  return false;
153
 
154
  $count = (int) get_user_option( '_bbp_topic_count', $user_id );
155
- $filter = ( false == $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
156
 
157
  return apply_filters( $filter, $count, $user_id );
158
  }
@@ -190,7 +190,7 @@ function bbp_user_reply_count( $user_id = 0, $integer = false ) {
190
  return false;
191
 
192
  $count = (int) get_user_option( '_bbp_reply_count', $user_id );
193
- $filter = ( true == $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
194
 
195
  return apply_filters( $filter, $count, $user_id );
196
  }
@@ -230,7 +230,7 @@ function bbp_user_post_count( $user_id = 0, $integer = false ) {
230
  $topics = bbp_get_user_topic_count( $user_id, true );
231
  $replies = bbp_get_user_reply_count( $user_id, true );
232
  $count = (int) $topics + $replies;
233
- $filter = ( true == $integer ) ? 'bbp_get_user_post_count_int' : 'bbp_get_user_post_count';
234
 
235
  return apply_filters( $filter, $count, $user_id );
236
  }
72
  return;
73
 
74
  // Add default options
75
+ foreach ( array_keys( bbp_get_default_user_options() ) as $key )
76
  delete_user_option( $user_id, $key );
77
 
78
  // Allow previously activated plugins to append their own options.
91
  function bbp_setup_user_option_filters() {
92
 
93
  // Add filters to each bbPress option
94
+ foreach ( array_keys( bbp_get_default_user_options() ) as $key )
95
  add_filter( 'get_user_option_' . $key, 'bbp_filter_get_user_option', 10, 3 );
96
 
97
  // Allow previously activated plugins to append their own options.
152
  return false;
153
 
154
  $count = (int) get_user_option( '_bbp_topic_count', $user_id );
155
+ $filter = ( false === $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
156
 
157
  return apply_filters( $filter, $count, $user_id );
158
  }
190
  return false;
191
 
192
  $count = (int) get_user_option( '_bbp_reply_count', $user_id );
193
+ $filter = ( true === $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
194
 
195
  return apply_filters( $filter, $count, $user_id );
196
  }
230
  $topics = bbp_get_user_topic_count( $user_id, true );
231
  $replies = bbp_get_user_reply_count( $user_id, true );
232
  $count = (int) $topics + $replies;
233
+ $filter = ( true === $integer ) ? 'bbp_get_user_post_count_int' : 'bbp_get_user_post_count';
234
 
235
  return apply_filters( $filter, $count, $user_id );
236
  }
includes/users/{template-tags.php → template.php} RENAMED
@@ -109,32 +109,51 @@ function bbp_displayed_user_id() {
109
  /**
110
  * Output a sanitized user field value
111
  *
 
 
 
 
112
  * @since bbPress (r2688)
113
  *
114
  * @param string $field Field to get
 
115
  * @uses bbp_get_displayed_user_field() To get the field
116
  */
117
- function bbp_displayed_user_field( $field = '' ) {
118
- echo bbp_get_displayed_user_field( $field );
119
  }
120
  /**
121
  * Return a sanitized user field value
122
  *
 
 
 
 
123
  * @since bbPress (r2688)
124
  *
125
  * @param string $field Field to get
126
- * @uses sanitize_text_field() To sanitize the field
127
- * @uses esc_attr() To sanitize the field
 
128
  * @uses apply_filters() Calls 'bbp_get_displayed_user_field' with the value
129
  * @return string|bool Value of the field if it exists, else false
130
  */
131
- function bbp_get_displayed_user_field( $field = '' ) {
132
- $bbp = bbpress();
133
- $value = false;
 
 
 
 
 
 
134
 
135
- // Return field if exists
136
- if ( isset( $bbp->displayed_user->$field ) )
137
- $value = esc_attr( sanitize_text_field( $bbp->displayed_user->$field ) );
 
 
 
138
 
139
  // Return empty
140
  return apply_filters( 'bbp_get_displayed_user_field', $value, $field );
@@ -236,8 +255,7 @@ function bbp_user_profile_link( $user_id = 0 ) {
236
  return false;
237
 
238
  $user = get_userdata( $user_id );
239
- $name = esc_attr( $user->display_name );
240
- $user_link = '<a href="' . bbp_get_user_profile_url( $user_id ) . '" title="' . $name . '">' . $name . '</a>';
241
 
242
  return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id );
243
  }
@@ -304,7 +322,7 @@ function bbp_user_nicename( $user_id = 0, $args = array() ) {
304
  * @uses bbp_get_user_profile_url() To get user profile url
305
  */
306
  function bbp_user_profile_url( $user_id = 0, $user_nicename = '' ) {
307
- echo bbp_get_user_profile_url( $user_id, $user_nicename );
308
  }
309
  /**
310
  * Return URL to the profile page of a user
@@ -387,9 +405,8 @@ function bbp_user_profile_edit_link( $user_id = 0 ) {
387
  return false;
388
 
389
  $user = get_userdata( $user_id );
390
- $name = $user->display_name;
391
- $edit_link = '<a href="' . bbp_get_user_profile_url( $user_id ) . '" title="' . esc_attr( $name ) . '">' . $name . '</a>';
392
- return apply_filters( 'bbp_get_user_profile_link', $edit_link, $user_id );
393
  }
394
 
395
  /**
@@ -402,7 +419,7 @@ function bbp_user_profile_edit_link( $user_id = 0 ) {
402
  * @uses bbp_get_user_profile_edit_url() To get user profile edit url
403
  */
404
  function bbp_user_profile_edit_url( $user_id = 0, $user_nicename = '' ) {
405
- echo bbp_get_user_profile_edit_url( $user_id, $user_nicename );
406
  }
407
  /**
408
  * Return URL to the profile edit page of a user
@@ -470,7 +487,6 @@ function bbp_user_display_role( $user_id = 0 ) {
470
  *
471
  * @param int $user_id
472
  * @uses bbp_get_user_id() to verify the user ID
473
- * @uses bbp_is_user_keymaster() to check if user is a keymaster
474
  * @uses bbp_is_user_inactive() to check if user is inactive
475
  * @uses user_can() to check if user has special capabilities
476
  * @uses apply_filters() Calls 'bbp_get_user_display_role' with the
@@ -543,7 +559,7 @@ function bbp_admin_link( $args = '' ) {
543
  'after' => ''
544
  ), 'get_admin_link' );
545
 
546
- $retval = $r['before'] . '<a href="' . admin_url() . '">' . $r['text'] . '</a>' . $r['after'];
547
 
548
  return apply_filters( 'bbp_get_admin_link', $retval, $r );
549
  }
@@ -606,7 +622,7 @@ function bbp_author_ip( $args = '' ) {
606
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
607
  */
608
  function bbp_favorites_permalink( $user_id = 0 ) {
609
- echo bbp_get_favorites_permalink( $user_id );
610
  }
611
  /**
612
  * Return the link to the user's favorites page (profile page)
@@ -768,7 +784,7 @@ function bbp_user_favorites_link( $args = array(), $user_id = 0, $wrap = true )
768
  * @uses bbp_get_subscriptions_permalink() To get the subscriptions link
769
  */
770
  function bbp_subscriptions_permalink( $user_id = 0 ) {
771
- echo bbp_get_subscriptions_permalink( $user_id );
772
  }
773
  /**
774
  * Return the link to the user's subscriptions page (profile page)
@@ -930,7 +946,7 @@ function bbp_notice_edit_user_success() {
930
  if ( isset( $_GET['updated'] ) && ( bbp_is_single_user() || bbp_is_single_user_edit() ) ) : ?>
931
 
932
  <div class="bbp-template-notice updated">
933
- <p><?php _e( 'User updated.', 'bbpress' ); ?></p>
934
  </div>
935
 
936
  <?php endif;
@@ -955,7 +971,7 @@ function bbp_notice_edit_user_is_super_admin() {
955
  if ( is_multisite() && ( bbp_is_single_user() || bbp_is_single_user_edit() ) && current_user_can( 'manage_network_options' ) && is_super_admin( bbp_get_displayed_user_id() ) ) : ?>
956
 
957
  <div class="bbp-template-notice important">
958
- <p><?php bbp_is_user_home() || bbp_is_user_home_edit() ? _e( 'You have super admin privileges.', 'bbpress' ) : _e( 'This user has super admin privileges.', 'bbpress' ); ?></p>
959
  </div>
960
 
961
  <?php endif;
@@ -1016,13 +1032,15 @@ function bbp_edit_user_blog_role() {
1016
  return;
1017
 
1018
  // Get users current blog role
1019
- $user = get_userdata( bbp_get_displayed_user_id() );
1020
- $user_role = isset( $user->roles ) ? array_shift( $user->roles ) : ''; ?>
 
 
1021
 
1022
  <select name="role" id="role">
1023
- <option value=""><?php _e( '&mdash; No role for this site &mdash;', 'bbpress' ); ?></option>
1024
 
1025
- <?php foreach ( get_editable_roles() as $role => $details ) : ?>
1026
 
1027
  <option <?php selected( $user_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
1028
 
@@ -1044,10 +1062,10 @@ function bbp_edit_user_forums_role() {
1044
  if ( ! bbp_is_single_user_edit() )
1045
  return;
1046
 
1047
- // Get the user's role
1048
  $user_role = bbp_get_user_role( bbp_get_displayed_user_id() );
1049
 
1050
- // Get the roles
1051
  $dynamic_roles = bbp_get_dynamic_roles();
1052
 
1053
  // Only keymasters can set other keymasters
@@ -1055,7 +1073,7 @@ function bbp_edit_user_forums_role() {
1055
  unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?>
1056
 
1057
  <select name="bbp-forums-role" id="bbp-forums-role">
1058
- <option value=""><?php _e( '&mdash; No role for these forums &mdash;', 'bbpress' ); ?></option>
1059
 
1060
  <?php foreach ( $dynamic_roles as $role => $details ) : ?>
1061
 
@@ -1096,7 +1114,7 @@ function bbp_edit_user_contact_methods() {
1096
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
1097
  */
1098
  function bbp_user_topics_created_url( $user_id = 0 ) {
1099
- echo bbp_get_user_topics_created_url( $user_id );
1100
  }
1101
  /**
1102
  * Return the link to the user's topics
@@ -1156,7 +1174,7 @@ function bbp_user_topics_created_url( $user_id = 0 ) {
1156
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
1157
  */
1158
  function bbp_user_replies_created_url( $user_id = 0 ) {
1159
- echo bbp_get_user_replies_created_url( $user_id );
1160
  }
1161
  /**
1162
  * Return the link to the user's replies
@@ -1217,11 +1235,11 @@ function bbp_user_replies_created_url( $user_id = 0 ) {
1217
  function bbp_login_notices() {
1218
 
1219
  // loggedout was passed
1220
- if ( !empty( $_GET['loggedout'] ) && ( true == $_GET['loggedout'] ) ) {
1221
  bbp_add_error( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' );
1222
 
1223
  // registration is disabled
1224
- } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' == $_GET['registration'] ) ) {
1225
  bbp_add_error( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) );
1226
 
1227
  // Prompt user to check their email
@@ -1336,7 +1354,7 @@ function bbp_user_register_fields() {
1336
  * @since bbPress (r2815)
1337
  *
1338
  * @uses apply_filters() To allow custom redirection
1339
- * @uses wp_referer_field() Set referer
1340
  * @uses wp_nonce_field() To generate hidden nonce fields
1341
  */
1342
  function bbp_user_lost_pass_fields() {
@@ -1425,12 +1443,12 @@ function bbp_author_link( $args = '' ) {
1425
  $anonymous = bbp_is_reply_anonymous( $r['post_id'] );
1426
 
1427
  // Get avatar
1428
- if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
1429
  $author_links[] = get_avatar( $user_id, $r['size'] );
1430
  }
1431
 
1432
  // Get display name
1433
- if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
1434
  $author_links[] = get_the_author_meta( 'display_name', $user_id );
1435
  }
1436
 
@@ -1439,11 +1457,11 @@ function bbp_author_link( $args = '' ) {
1439
  foreach ( $author_links as $link_text ) {
1440
  $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', $author_url, $link_title, $link_text );
1441
  }
1442
- $author_link = join( '&nbsp;', $author_link );
1443
 
1444
  // No links if anonymous
1445
  } else {
1446
- $author_link = join( '&nbsp;', $author_links );
1447
  }
1448
 
1449
  // No post so link is empty
@@ -1486,16 +1504,16 @@ function bbp_user_can_view_forum( $args = '' ) {
1486
  ), 'user_can_view_forum' );
1487
 
1488
  // Validate parsed values
1489
- $user_id = bbp_get_user_id ( $r['user_id'], false, false );
1490
  $forum_id = bbp_get_forum_id( $r['forum_id'] );
1491
  $retval = false;
1492
 
1493
  // User is a keymaster
1494
- if ( bbp_is_user_keymaster() ) {
1495
  $retval = true;
1496
 
1497
  // Forum is public, and user can read forums or is not logged in
1498
- } elseif ( bbp_is_forum_public ( $forum_id, $r['check_ancestors'] ) ) {
1499
  $retval = true;
1500
 
1501
  // Forum is private, and user can see it
@@ -1645,7 +1663,7 @@ function bbp_get_forums_for_current_user( $args = array() ) {
1645
  $hidden = bbp_get_hidden_forum_ids();
1646
 
1647
  // Merge private and hidden forums together and remove any empties
1648
- $forum_ids = (array) array_filter( array_merge( $private, $hidden ) );
1649
 
1650
  // There are forums that need to be ex
1651
  if ( !empty( $forum_ids ) )
109
  /**
110
  * Output a sanitized user field value
111
  *
112
+ * This function relies on the $filter parameter to decide how to sanitize
113
+ * the field value that it finds. Since it uses the WP_User object's magic
114
+ * __get() method, it can also be used to get user_meta values.
115
+ *
116
  * @since bbPress (r2688)
117
  *
118
  * @param string $field Field to get
119
+ * @param string $filter How to filter the field value (null|raw|db|display|edit)
120
  * @uses bbp_get_displayed_user_field() To get the field
121
  */
122
+ function bbp_displayed_user_field( $field = '', $filter = 'display' ) {
123
+ echo bbp_get_displayed_user_field( $field, $filter );
124
  }
125
  /**
126
  * Return a sanitized user field value
127
  *
128
+ * This function relies on the $filter parameter to decide how to sanitize
129
+ * the field value that it finds. Since it uses the WP_User object's magic
130
+ * __get() method, it can also be used to get user_meta values.
131
+ *
132
  * @since bbPress (r2688)
133
  *
134
  * @param string $field Field to get
135
+ * @param string $filter How to filter the field value (null|raw|db|display|edit)
136
+ * @see WP_User::__get() for more on how the value is retrieved
137
+ * @see sanitize_user_field() for more on how the value is sanitized
138
  * @uses apply_filters() Calls 'bbp_get_displayed_user_field' with the value
139
  * @return string|bool Value of the field if it exists, else false
140
  */
141
+ function bbp_get_displayed_user_field( $field = '', $filter = 'display' ) {
142
+
143
+ // Get the displayed user
144
+ $user = bbpress()->displayed_user;
145
+
146
+ // Juggle the user filter property because we don't want to muck up how
147
+ // other code might interact with this object.
148
+ $old_filter = $user->filter;
149
+ $user->filter = $filter;
150
 
151
+ // Get the field value from the WP_User object. We don't need to perform
152
+ // an isset() because the WP_User::__get() does it for us.
153
+ $value = $user->$field;
154
+
155
+ // Put back the user filter property that was previously juggled above.
156
+ $user->filter = $old_filter;
157
 
158
  // Return empty
159
  return apply_filters( 'bbp_get_displayed_user_field', $value, $field );
255
  return false;
256
 
257
  $user = get_userdata( $user_id );
258
+ $user_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>';
 
259
 
260
  return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id );
261
  }
322
  * @uses bbp_get_user_profile_url() To get user profile url
323
  */
324
  function bbp_user_profile_url( $user_id = 0, $user_nicename = '' ) {
325
+ echo esc_url( bbp_get_user_profile_url( $user_id, $user_nicename ) );
326
  }
327
  /**
328
  * Return URL to the profile page of a user
405
  return false;
406
 
407
  $user = get_userdata( $user_id );
408
+ $edit_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>';
409
+ return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id );
 
410
  }
411
 
412
  /**
419
  * @uses bbp_get_user_profile_edit_url() To get user profile edit url
420
  */
421
  function bbp_user_profile_edit_url( $user_id = 0, $user_nicename = '' ) {
422
+ echo esc_url( bbp_get_user_profile_edit_url( $user_id, $user_nicename ) );
423
  }
424
  /**
425
  * Return URL to the profile edit page of a user
487
  *
488
  * @param int $user_id
489
  * @uses bbp_get_user_id() to verify the user ID
 
490
  * @uses bbp_is_user_inactive() to check if user is inactive
491
  * @uses user_can() to check if user has special capabilities
492
  * @uses apply_filters() Calls 'bbp_get_user_display_role' with the
559
  'after' => ''
560
  ), 'get_admin_link' );
561
 
562
+ $retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after'];
563
 
564
  return apply_filters( 'bbp_get_admin_link', $retval, $r );
565
  }
622
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
623
  */
624
  function bbp_favorites_permalink( $user_id = 0 ) {
625
+ echo esc_url( bbp_get_favorites_permalink( $user_id ) );
626
  }
627
  /**
628
  * Return the link to the user's favorites page (profile page)
784
  * @uses bbp_get_subscriptions_permalink() To get the subscriptions link
785
  */
786
  function bbp_subscriptions_permalink( $user_id = 0 ) {
787
+ echo esc_url( bbp_get_subscriptions_permalink( $user_id ) );
788
  }
789
  /**
790
  * Return the link to the user's subscriptions page (profile page)
946
  if ( isset( $_GET['updated'] ) && ( bbp_is_single_user() || bbp_is_single_user_edit() ) ) : ?>
947
 
948
  <div class="bbp-template-notice updated">
949
+ <p><?php esc_html_e( 'User updated.', 'bbpress' ); ?></p>
950
  </div>
951
 
952
  <?php endif;
971
  if ( is_multisite() && ( bbp_is_single_user() || bbp_is_single_user_edit() ) && current_user_can( 'manage_network_options' ) && is_super_admin( bbp_get_displayed_user_id() ) ) : ?>
972
 
973
  <div class="bbp-template-notice important">
974
+ <p><?php bbp_is_user_home() || bbp_is_user_home_edit() ? esc_html_e( 'You have super admin privileges.', 'bbpress' ) : esc_html_e( 'This user has super admin privileges.', 'bbpress' ); ?></p>
975
  </div>
976
 
977
  <?php endif;
1032
  return;
1033
 
1034
  // Get users current blog role
1035
+ $user_role = bbp_get_user_blog_role( bbp_get_displayed_user_id() );
1036
+
1037
+ // Get the blog roles
1038
+ $blog_roles = bbp_get_blog_roles(); ?>
1039
 
1040
  <select name="role" id="role">
1041
+ <option value=""><?php esc_html_e( '&mdash; No role for this site &mdash;', 'bbpress' ); ?></option>
1042
 
1043
+ <?php foreach ( $blog_roles as $role => $details ) : ?>
1044
 
1045
  <option <?php selected( $user_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
1046
 
1062
  if ( ! bbp_is_single_user_edit() )
1063
  return;
1064
 
1065
+ // Get the user's current forum role
1066
  $user_role = bbp_get_user_role( bbp_get_displayed_user_id() );
1067
 
1068
+ // Get the folum roles
1069
  $dynamic_roles = bbp_get_dynamic_roles();
1070
 
1071
  // Only keymasters can set other keymasters
1073
  unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?>
1074
 
1075
  <select name="bbp-forums-role" id="bbp-forums-role">
1076
+ <option value=""><?php esc_html_e( '&mdash; No role for these forums &mdash;', 'bbpress' ); ?></option>
1077
 
1078
  <?php foreach ( $dynamic_roles as $role => $details ) : ?>
1079
 
1114
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
1115
  */
1116
  function bbp_user_topics_created_url( $user_id = 0 ) {
1117
+ echo esc_url( bbp_get_user_topics_created_url( $user_id ) );
1118
  }
1119
  /**
1120
  * Return the link to the user's topics
1174
  * @uses bbp_get_favorites_permalink() To get the favorites permalink
1175
  */
1176
  function bbp_user_replies_created_url( $user_id = 0 ) {
1177
+ echo esc_url( bbp_get_user_replies_created_url( $user_id ) );
1178
  }
1179
  /**
1180
  * Return the link to the user's replies
1235
  function bbp_login_notices() {
1236
 
1237
  // loggedout was passed
1238
+ if ( !empty( $_GET['loggedout'] ) && ( true === $_GET['loggedout'] ) ) {
1239
  bbp_add_error( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' );
1240
 
1241
  // registration is disabled
1242
+ } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' === $_GET['registration'] ) ) {
1243
  bbp_add_error( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) );
1244
 
1245
  // Prompt user to check their email
1354
  * @since bbPress (r2815)
1355
  *
1356
  * @uses apply_filters() To allow custom redirection
1357
+ * @uses bbp_redirect_to_field() Set referer
1358
  * @uses wp_nonce_field() To generate hidden nonce fields
1359
  */
1360
  function bbp_user_lost_pass_fields() {
1443
  $anonymous = bbp_is_reply_anonymous( $r['post_id'] );
1444
 
1445
  // Get avatar
1446
+ if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
1447
  $author_links[] = get_avatar( $user_id, $r['size'] );
1448
  }
1449
 
1450
  // Get display name
1451
+ if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
1452
  $author_links[] = get_the_author_meta( 'display_name', $user_id );
1453
  }
1454
 
1457
  foreach ( $author_links as $link_text ) {
1458
  $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', $author_url, $link_title, $link_text );
1459
  }
1460
+ $author_link = implode( '&nbsp;', $author_link );
1461
 
1462
  // No links if anonymous
1463
  } else {
1464
+ $author_link = implode( '&nbsp;', $author_links );
1465
  }
1466
 
1467
  // No post so link is empty
1504
  ), 'user_can_view_forum' );
1505
 
1506
  // Validate parsed values
1507
+ $user_id = bbp_get_user_id( $r['user_id'], false, false );
1508
  $forum_id = bbp_get_forum_id( $r['forum_id'] );
1509
  $retval = false;
1510
 
1511
  // User is a keymaster
1512
+ if ( bbp_is_user_keymaster( $user_id ) ) {
1513
  $retval = true;
1514
 
1515
  // Forum is public, and user can read forums or is not logged in
1516
+ } elseif ( bbp_is_forum_public( $forum_id, $r['check_ancestors'] ) ) {
1517
  $retval = true;
1518
 
1519
  // Forum is private, and user can see it
1663
  $hidden = bbp_get_hidden_forum_ids();
1664
 
1665
  // Merge private and hidden forums together and remove any empties
1666
+ $forum_ids = (array) array_filter( wp_parse_id_list( array_merge( $private, $hidden ) ) );
1667
 
1668
  // There are forums that need to be ex
1669
  if ( !empty( $forum_ids ) )
languages/bbpress.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the bbPress package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: bbPress 2.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/bbpress\n"
7
- "POT-Creation-Date: 2013-04-10 04:43:09+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,581 +12,529 @@ msgstr ""
12
  "Last-Translator: JOHN JAMES JACOBY <jjj@bbpress.org>\n"
13
  "Language-Team: ENGLISH <jjj@bbpress.org>\n"
14
 
15
- #: bbpress.php:131 bbpress.php:138
16
  msgid "Cheatin&#8217; huh?"
17
  msgstr ""
18
 
19
- #: bbpress.php:404 templates/default/bbpress-functions.php:68
20
  msgid "bbPress Default"
21
  msgstr ""
22
 
23
- #: bbpress.php:487 bbpress.php:488 includes/admin/admin.php:218
24
- #: includes/admin/admin.php:219 includes/admin/admin.php:229
25
- #: includes/admin/admin.php:230 includes/admin/users.php:82
26
- #: includes/common/widgets.php:656 includes/extend/buddypress/loader.php:42
27
  #: includes/extend/buddypress/loader.php:170
28
- #: includes/extend/buddypress/loader.php:259
29
- #: includes/extend/buddypress/loader.php:310
30
  #: templates/default/bbpress/content-statistics.php:22
31
  msgid "Forums"
32
  msgstr ""
33
 
34
- #: bbpress.php:489 includes/admin/forums.php:420
35
- #: includes/admin/metaboxes.php:50 includes/admin/metaboxes.php:357
36
- #: includes/admin/metaboxes.php:409 includes/admin/replies.php:579
37
- #: includes/admin/topics.php:644 includes/extend/buddypress/group.php:52
38
- #: includes/extend/buddypress/group.php:53
39
- #: includes/forums/template-tags.php:2138
40
  #: templates/default/bbpress/loop-forums.php:19
41
  msgid "Forum"
42
  msgstr ""
43
 
44
- #: bbpress.php:490 includes/admin/tools.php:1105
45
  msgid "All Forums"
46
  msgstr ""
47
 
48
- #: bbpress.php:491 bbpress.php:495
49
  msgid "New Forum"
50
  msgstr ""
51
 
52
- #: bbpress.php:492 templates/default/bbpress/form-forum.php:37
53
  msgid "Create New Forum"
54
  msgstr ""
55
 
56
- #: bbpress.php:493 bbpress.php:550 bbpress.php:607
57
- #: includes/common/template-tags.php:2150
58
- #: includes/replies/template-tags.php:1584
59
- #: includes/topics/template-tags.php:2332
60
  #: templates/default/bbpress/user-details.php:65
61
  msgid "Edit"
62
  msgstr ""
63
 
64
- #: bbpress.php:494
65
  msgid "Edit Forum"
66
  msgstr ""
67
 
68
- #: bbpress.php:496 bbpress.php:497
69
  msgid "View Forum"
70
  msgstr ""
71
 
72
- #: bbpress.php:498 includes/common/widgets.php:479
73
  msgid "Search Forums"
74
  msgstr ""
75
 
76
- #: bbpress.php:499
77
  msgid "No forums found"
78
  msgstr ""
79
 
80
- #: bbpress.php:500
81
  msgid "No forums found in Trash"
82
  msgstr ""
83
 
84
- #: bbpress.php:501 templates/default/bbpress/form-forum.php:129
85
  msgid "Parent Forum:"
86
  msgstr ""
87
 
88
- #: bbpress.php:524
89
  msgid "bbPress Forums"
90
  msgstr ""
91
 
92
- #: bbpress.php:544 bbpress.php:545 includes/admin/forums.php:421
93
- #: includes/admin/settings.php:187 includes/admin/settings.php:208
94
- #: includes/admin/topics.php:643 includes/extend/buddypress/activity.php:357
95
- #: includes/forums/template-tags.php:2286
96
  #: templates/default/bbpress/content-statistics.php:27
97
  #: templates/default/bbpress/loop-forums.php:20
98
  msgid "Topics"
99
  msgstr ""
100
 
101
- #: bbpress.php:546 includes/admin/metaboxes.php:67
102
- #: includes/admin/metaboxes.php:434 includes/admin/replies.php:580
 
103
  #: templates/default/bbpress/content-single-topic-lead.php:22
104
  #: templates/default/bbpress/content-single-topic-lead.php:94
105
  #: templates/default/bbpress/loop-topics.php:19
106
  msgid "Topic"
107
  msgstr ""
108
 
109
- #: bbpress.php:547 includes/admin/tools.php:1106
110
- #: includes/topics/functions.php:3331
111
  msgid "All Topics"
112
  msgstr ""
113
 
114
- #: bbpress.php:548 bbpress.php:552
115
  msgid "New Topic"
116
  msgstr ""
117
 
118
- #: bbpress.php:549 templates/default/bbpress/form-topic.php:43
119
  msgid "Create New Topic"
120
  msgstr ""
121
 
122
- #: bbpress.php:551
123
  msgid "Edit Topic"
124
  msgstr ""
125
 
126
- #: bbpress.php:553 bbpress.php:554
127
  msgid "View Topic"
128
  msgstr ""
129
 
130
- #: bbpress.php:555
131
  msgid "Search Topics"
132
  msgstr ""
133
 
134
- #: bbpress.php:556
135
  msgid "No topics found"
136
  msgstr ""
137
 
138
- #: bbpress.php:557
139
  msgid "No topics found in Trash"
140
  msgstr ""
141
 
142
- #: bbpress.php:558 includes/admin/metaboxes.php:356
143
- #: includes/admin/metaboxes.php:408 includes/extend/buddypress/group.php:1022
144
- #: templates/default/bbpress/form-topic.php:125
145
  msgid "Forum:"
146
  msgstr ""
147
 
148
- #: bbpress.php:581
149
  msgid "bbPress Topics"
150
  msgstr ""
151
 
152
- #: bbpress.php:601 bbpress.php:602 includes/admin/forums.php:422
153
- #: includes/admin/settings.php:195 includes/admin/settings.php:216
154
- #: includes/admin/topics.php:645 includes/core/theme-compat.php:560
155
- #: includes/extend/buddypress/activity.php:358
156
- #: includes/forums/template-tags.php:2350
157
  #: templates/default/bbpress/content-statistics.php:32
158
  #: templates/default/bbpress/loop-forums.php:21
159
  #: templates/default/bbpress/loop-replies.php:32
160
- #: templates/default/bbpress/loop-replies.php:62
161
  #: templates/default/bbpress/loop-topics.php:21
162
  msgid "Replies"
163
  msgstr ""
164
 
165
- #: bbpress.php:603 includes/admin/metaboxes.php:84
 
 
166
  msgid "Reply"
167
  msgstr ""
168
 
169
- #: bbpress.php:604 includes/admin/tools.php:1107
170
- #: includes/replies/functions.php:1834
171
  msgid "All Replies"
172
  msgstr ""
173
 
174
- #: bbpress.php:605 bbpress.php:609
175
  msgid "New Reply"
176
  msgstr ""
177
 
178
- #: bbpress.php:606
179
  msgid "Create New Reply"
180
  msgstr ""
181
 
182
- #: bbpress.php:608
183
  msgid "Edit Reply"
184
  msgstr ""
185
 
186
- #: bbpress.php:610 bbpress.php:611
187
  msgid "View Reply"
188
  msgstr ""
189
 
190
- #: bbpress.php:612
191
  msgid "Search Replies"
192
  msgstr ""
193
 
194
- #: bbpress.php:613
195
  msgid "No replies found"
196
  msgstr ""
197
 
198
- #: bbpress.php:614
199
  msgid "No replies found in Trash"
200
  msgstr ""
201
 
202
- #: bbpress.php:615 includes/admin/metaboxes.php:433
203
- #: templates/default/bbpress/form-topic.php:86
204
  msgid "Topic:"
205
  msgstr ""
206
 
207
- #: bbpress.php:638
208
  msgid "bbPress Replies"
209
  msgstr ""
210
 
211
- #: bbpress.php:673
212
  msgctxt "post"
213
  msgid "Closed"
214
  msgstr ""
215
 
216
- #: bbpress.php:674
217
  msgctxt "post"
218
  msgid "Closed <span class=\"count\">(%s)</span>"
219
  msgid_plural "Closed <span class=\"count\">(%s)</span>"
220
  msgstr[0] ""
221
  msgstr[1] ""
222
 
223
- #: bbpress.php:684
224
  msgctxt "post"
225
  msgid "Spam"
226
  msgstr ""
227
 
228
- #: bbpress.php:685
229
  msgctxt "post"
230
  msgid "Spam <span class=\"count\">(%s)</span>"
231
  msgid_plural "Spam <span class=\"count\">(%s)</span>"
232
  msgstr[0] ""
233
  msgstr[1] ""
234
 
235
- #: bbpress.php:697
236
  msgctxt "post"
237
  msgid "Orphan"
238
  msgstr ""
239
 
240
- #: bbpress.php:698
241
  msgctxt "post"
242
  msgid "Orphan <span class=\"count\">(%s)</span>"
243
  msgid_plural "Orphans <span class=\"count\">(%s)</span>"
244
  msgstr[0] ""
245
  msgstr[1] ""
246
 
247
- #: bbpress.php:710
248
  msgctxt "post"
249
  msgid "Hidden"
250
  msgstr ""
251
 
252
- #: bbpress.php:711
253
  msgctxt "post"
254
  msgid "Hidden <span class=\"count\">(%s)</span>"
255
  msgid_plural "Hidden <span class=\"count\">(%s)</span>"
256
  msgstr[0] ""
257
  msgstr[1] ""
258
 
259
- #: bbpress.php:756 templates/default/bbpress/content-statistics.php:37
260
  msgid "Topic Tags"
261
  msgstr ""
262
 
263
- #: bbpress.php:757 includes/admin/metaboxes.php:103
 
264
  msgid "Topic Tag"
265
  msgstr ""
266
 
267
- #: bbpress.php:758
268
  msgid "Search Tags"
269
  msgstr ""
270
 
271
- #: bbpress.php:759
272
  msgid "Popular Tags"
273
  msgstr ""
274
 
275
- #: bbpress.php:760
276
  msgid "All Tags"
277
  msgstr ""
278
 
279
- #: bbpress.php:761
280
  msgid "Edit Tag"
281
  msgstr ""
282
 
283
- #: bbpress.php:762
284
  msgid "Update Tag"
285
  msgstr ""
286
 
287
- #: bbpress.php:763
288
  msgid "Add New Tag"
289
  msgstr ""
290
 
291
- #: bbpress.php:764
292
  msgid "New Tag Name"
293
  msgstr ""
294
 
295
- #: bbpress.php:765
296
  msgid "View Topic Tag"
297
  msgstr ""
298
 
299
- #: bbpress.php:803
300
  msgid "Most popular topics"
301
  msgstr ""
302
 
303
- #: bbpress.php:815
304
  msgid "Topics with no replies"
305
  msgstr ""
306
 
307
- #: includes/admin/admin.php:183 includes/admin/functions.php:236
308
  #: includes/admin/tools.php:34
309
  msgid "Repair Forums"
310
  msgstr ""
311
 
312
- #: includes/admin/admin.php:184
313
  msgid "Forum Repair"
314
  msgstr ""
315
 
316
- #: includes/admin/admin.php:193 includes/admin/functions.php:240
317
- #: includes/admin/settings.php:1269
318
  msgid "Import Forums"
319
  msgstr ""
320
 
321
- #: includes/admin/admin.php:194
322
  msgid "Forum Import"
323
  msgstr ""
324
 
325
- #: includes/admin/admin.php:203 includes/admin/functions.php:244
326
- #: includes/admin/tools.php:1096
327
  msgid "Reset Forums"
328
  msgstr ""
329
 
330
- #: includes/admin/admin.php:204
331
  msgid "Forum Reset"
332
  msgstr ""
333
 
334
- #: includes/admin/admin.php:242 includes/admin/admin.php:243
335
- #: includes/admin/admin.php:251 includes/admin/admin.php:252
336
  msgid "Welcome to bbPress"
337
  msgstr ""
338
 
339
- #: includes/admin/admin.php:265 includes/admin/admin.php:266
340
- #: includes/admin/admin.php:287 includes/admin/admin.php:288
341
- #: includes/admin/admin.php:1611 includes/admin/admin.php:1700
342
  msgid "Update Forums"
343
  msgstr ""
344
 
345
- #: includes/admin/admin.php:478
346
  msgid "Settings"
347
  msgstr ""
348
 
349
- #: includes/admin/admin.php:479
350
  msgid "About"
351
  msgstr ""
352
 
353
- #: includes/admin/admin.php:491
354
  msgid "Right Now in Forums"
355
  msgstr ""
356
 
357
- #: includes/admin/admin.php:1255
358
  msgctxt "admin color scheme"
359
  msgid "Green"
360
  msgstr ""
361
 
362
- #: includes/admin/admin.php:1309
363
  msgid "%s - %s"
364
  msgstr ""
365
 
366
- #: includes/admin/admin.php:1327 includes/admin/admin.php:1430
367
  msgid "Welcome to bbPress %s"
368
  msgstr ""
369
 
370
- #: includes/admin/admin.php:1328 includes/admin/admin.php:1431
371
  msgid ""
372
- "Thank you for updating to the latest version! bbPress %s goes great with "
373
- "pizza and popcorn, and will nicely complement your community too!"
374
  msgstr ""
375
 
376
- #: includes/admin/admin.php:1329 includes/admin/admin.php:1432
377
  msgid "Version %s"
378
  msgstr ""
379
 
380
- #: includes/admin/admin.php:1333 includes/admin/admin.php:1436
381
  msgid "What&#8217;s New"
382
  msgstr ""
383
 
384
- #: includes/admin/admin.php:1335 includes/admin/admin.php:1438
385
  msgid "Credits"
386
  msgstr ""
387
 
388
- #: includes/admin/admin.php:1340
389
- msgid "Forum Search"
390
  msgstr ""
391
 
392
- #: includes/admin/admin.php:1343
393
- msgid "Only Forum Content"
394
  msgstr ""
395
 
396
- #: includes/admin/admin.php:1344
397
- msgid "Allow your forums to be searched without mixing in your posts or pages."
398
- msgstr ""
399
-
400
- #: includes/admin/admin.php:1346
401
- msgid "Choose Your Own Slug"
402
- msgstr ""
403
-
404
- #: includes/admin/admin.php:1347
405
- msgid "Setup your forum search to live anywhere relative to the forum index."
406
- msgstr ""
407
-
408
- #: includes/admin/admin.php:1352
409
- msgid "New & Improved Forum Importers"
410
- msgstr ""
411
-
412
- #: includes/admin/admin.php:1355
413
- msgid "BBCodes & Smilies"
414
- msgstr ""
415
-
416
- #: includes/admin/admin.php:1356
417
- msgid ""
418
- "Happy faces all-around now that the importers properly convert BBCodes & "
419
- "smilies. :)"
420
- msgstr ""
421
-
422
- #: includes/admin/admin.php:1358
423
- msgid "Vanilla"
424
- msgstr ""
425
-
426
- #: includes/admin/admin.php:1359
427
- msgid ""
428
- "Tired of plain old Vanilla? Now you can easily switch to <del>Mint Chocolate "
429
- "Chip</del> bbPress!"
430
- msgstr ""
431
-
432
- #: includes/admin/admin.php:1361
433
- msgid "SimplePress"
434
- msgstr ""
435
-
436
- #: includes/admin/admin.php:1362
437
  msgid ""
438
- "Converting an existing SimplePress powered forum to bbPress has never been "
439
- "\"simpler!\""
440
- msgstr ""
441
-
442
- #: includes/admin/admin.php:1364
443
- msgid "Mingle"
444
- msgstr ""
445
-
446
- #: includes/admin/admin.php:1365
447
- msgid "No time to... chit-chat; convert your Mingle forums to bbPress today!"
448
- msgstr ""
449
-
450
- #: includes/admin/admin.php:1370
451
- msgid "Even Better BuddyPress Integration"
452
  msgstr ""
453
 
454
- #: includes/admin/admin.php:1373
455
- msgid "bbPress powered BuddyPress Group Forums"
456
  msgstr ""
457
 
458
- #: includes/admin/admin.php:1374
459
- msgid ""
460
- "Use bbPress to manage your BuddyPress Group Forums, allowing for seamless "
461
- "integration and improved plugin performance."
462
  msgstr ""
463
 
464
- #: includes/admin/admin.php:1379
465
  msgid "Under the Hood"
466
  msgstr ""
467
 
468
- #: includes/admin/admin.php:1383
469
- msgid "Smarter Fancy Editor"
470
  msgstr ""
471
 
472
- #: includes/admin/admin.php:1384
473
- msgid ""
474
- "We simplified the Fancy Editor, and the allowed HTML tags that work with it."
475
  msgstr ""
476
 
477
- #: includes/admin/admin.php:1386
478
- msgid "Better Code Posting"
479
  msgstr ""
480
 
481
- #: includes/admin/admin.php:1387
482
- msgid "Your users can now post code snippets without too much hassle."
483
  msgstr ""
484
 
485
- #: includes/admin/admin.php:1391
486
- msgid "Template Stacking"
487
  msgstr ""
488
 
489
- #: includes/admin/admin.php:1392
490
  msgid ""
491
- "Now you can replace specific template parts on the fly without modifying the "
492
- "existing theme."
493
- msgstr ""
494
-
495
- #: includes/admin/admin.php:1394
496
- msgid "TwentyThirteen Tested"
497
  msgstr ""
498
 
499
- #: includes/admin/admin.php:1395
500
- msgid ""
501
- "bbPress 2.3 already works with the in-development TwentyThirteen theme, "
502
- "coming in a future version of WordPress."
 
503
  msgstr ""
504
 
505
- #: includes/admin/admin.php:1399
506
- msgid "Statistics Shortcode"
507
  msgstr ""
508
 
509
- #: includes/admin/admin.php:1400
510
- msgid ""
511
- "The old statistics easter-egg page was turned into an easy to use shortcode."
512
  msgstr ""
513
 
514
- #: includes/admin/admin.php:1402
515
- msgid "Green Theme Updated"
516
  msgstr ""
517
 
518
- #: includes/admin/admin.php:1403
519
- msgid ""
520
- "The green admin theme easter-egg was updated to work with WordPress 3.5 "
521
- "changes."
522
  msgstr ""
523
 
524
- #: includes/admin/admin.php:1409 includes/admin/admin.php:1537
525
  msgid "Go to Forum Settings"
526
  msgstr ""
527
 
528
- #: includes/admin/admin.php:1442
529
  msgid "bbPress is created by a worldwide swarm of busy, busy bees."
530
  msgstr ""
531
 
532
- #: includes/admin/admin.php:1444
533
  msgid "Project Leaders"
534
  msgstr ""
535
 
536
- #: includes/admin/admin.php:1449
537
  msgid "Founding Developer"
538
  msgstr ""
539
 
540
- #: includes/admin/admin.php:1454
541
  msgid "Lead Developer"
542
  msgstr ""
543
 
544
- #: includes/admin/admin.php:1458
 
 
 
 
545
  msgid "Contributing Developers"
546
  msgstr ""
547
 
548
- #: includes/admin/admin.php:1477
549
- msgid "Codex Rockstars"
550
  msgstr ""
551
 
552
- #: includes/admin/admin.php:1496
553
- msgid "Core Contributors to bbPress 2.3"
 
 
 
 
554
  msgstr ""
555
 
556
- #: includes/admin/admin.php:1563 includes/admin/admin.php:1585
557
  msgid "Update Forum"
558
  msgstr ""
559
 
560
- #: includes/admin/admin.php:1574 includes/admin/admin.php:1628
561
  msgid "All done!"
562
  msgstr ""
563
 
564
- #: includes/admin/admin.php:1575 includes/admin/admin.php:1629
565
  msgid "Go Back"
566
  msgstr ""
567
 
568
- #: includes/admin/admin.php:1584
569
  msgid ""
570
  "You can update your forum through this page. Hit the link below to update."
571
  msgstr ""
572
 
573
- #: includes/admin/admin.php:1656
574
  msgid ""
575
  "Warning! Problem updating %1$s. Your server may not be able to connect to "
576
  "sites running on it. Error message: <em>%2$s</em>"
577
  msgstr ""
578
 
579
- #: includes/admin/admin.php:1680
580
  msgid ""
581
  "If your browser doesn&#8217;t start loading the next page automatically, "
582
  "click this link:"
583
  msgstr ""
584
 
585
- #: includes/admin/admin.php:1681
586
  msgid "Next Forums"
587
  msgstr ""
588
 
589
- #: includes/admin/admin.php:1699
590
  msgid ""
591
  "You can update all the forums on your network through this page. It works by "
592
  "calling the update script of each site automatically. Hit the link below to "
@@ -653,7 +601,7 @@ msgstr ""
653
  msgid "Starting Conversion"
654
  msgstr ""
655
 
656
- #: includes/admin/converter.php:248 includes/admin/converter.php:475
657
  msgid "Conversion Complete"
658
  msgstr ""
659
 
@@ -721,6 +669,14 @@ msgstr ""
721
  msgid "Converting replies (%1$s - %2$s)"
722
  msgstr ""
723
 
 
 
 
 
 
 
 
 
724
  #: includes/admin/converters/Invision.php:502
725
  #: includes/admin/converters/SimplePress5.php:495
726
  #: includes/admin/converters/Vanilla.php:514
@@ -729,43 +685,43 @@ msgstr ""
729
  msgid "Re: "
730
  msgstr ""
731
 
732
- #: includes/admin/forums.php:120 includes/admin/replies.php:131
733
- #: includes/admin/settings.php:1309 includes/admin/topics.php:131
734
  msgid "Overview"
735
  msgstr ""
736
 
737
- #: includes/admin/forums.php:122
738
  msgid ""
739
  "This screen displays the individual forums on your site. You can customize "
740
  "the display of this screen to suit your workflow."
741
  msgstr ""
742
 
743
- #: includes/admin/forums.php:128 includes/admin/replies.php:139
744
- #: includes/admin/topics.php:139
745
  msgid "Screen Content"
746
  msgstr ""
747
 
748
- #: includes/admin/forums.php:130 includes/admin/replies.php:141
749
- #: includes/admin/topics.php:141
750
  msgid ""
751
  "You can customize the display of this screen&#8217;s contents in a number of "
752
  "ways:"
753
  msgstr ""
754
 
755
- #: includes/admin/forums.php:132
756
  msgid ""
757
  "You can hide/display columns based on your needs and decide how many forums "
758
  "to list per screen using the Screen Options tab."
759
  msgstr ""
760
 
761
- #: includes/admin/forums.php:133
762
  msgid ""
763
  "You can filter the list of forums by forum status using the text links in "
764
  "the upper left to show All, Published, or Trashed forums. The default view "
765
  "is to show all forums."
766
  msgstr ""
767
 
768
- #: includes/admin/forums.php:134
769
  msgid ""
770
  "You can refine the list to show only forums from a specific month by using "
771
  "the dropdown menus above the forums list. Click the Filter button after "
@@ -773,81 +729,81 @@ msgid ""
773
  "creator in the forums list."
774
  msgstr ""
775
 
776
- #: includes/admin/forums.php:141 includes/admin/replies.php:153
777
- #: includes/admin/topics.php:152
778
  msgid "Available Actions"
779
  msgstr ""
780
 
781
- #: includes/admin/forums.php:143
782
  msgid ""
783
  "Hovering over a row in the forums list will display action links that allow "
784
  "you to manage your forum. You can perform the following actions:"
785
  msgstr ""
786
 
787
- #: includes/admin/forums.php:145
788
  msgid ""
789
  "<strong>Edit</strong> takes you to the editing screen for that forum. You "
790
  "can also reach that screen by clicking on the forum title."
791
  msgstr ""
792
 
793
- #: includes/admin/forums.php:146
794
  msgid ""
795
  "<strong>Trash</strong> removes your forum from this list and places it in "
796
  "the trash, from which you can permanently delete it."
797
  msgstr ""
798
 
799
- #: includes/admin/forums.php:147
800
  msgid ""
801
  "<strong>View</strong> will show you what your draft forum will look like if "
802
  "you publish it. View will take you to your live site to view the forum. "
803
  "Which link is available depends on your forum&#8217;s status."
804
  msgstr ""
805
 
806
- #: includes/admin/forums.php:154 includes/admin/replies.php:168
807
- #: includes/admin/topics.php:169
808
  msgid "Bulk Actions"
809
  msgstr ""
810
 
811
- #: includes/admin/forums.php:156
812
  msgid ""
813
  "You can also edit or move multiple forums to the trash at once. Select the "
814
  "forums you want to act on using the checkboxes, then select the action you "
815
  "want to take from the Bulk Actions menu and click Apply."
816
  msgstr ""
817
 
818
- #: includes/admin/forums.php:157
819
  msgid ""
820
  "When using Bulk Edit, you can change the metadata (categories, author, etc.) "
821
  "for all selected forums at once. To remove a forum from the grouping, just "
822
  "click the x next to its name in the Bulk Edit area that appears."
823
  msgstr ""
824
 
825
- #: includes/admin/forums.php:162 includes/admin/forums.php:233
826
- #: includes/admin/replies.php:176 includes/admin/replies.php:244
827
- #: includes/admin/settings.php:1355 includes/admin/topics.php:177
828
- #: includes/admin/topics.php:245
829
  msgid "For more information:"
830
  msgstr ""
831
 
832
- #: includes/admin/forums.php:163 includes/admin/forums.php:234
833
- #: includes/admin/replies.php:177 includes/admin/replies.php:245
834
- #: includes/admin/settings.php:1356 includes/admin/topics.php:178
835
- #: includes/admin/topics.php:246
836
  msgid ""
837
  "<a href=\"http://codex.bbpress.org\" target=\"_blank\">bbPress "
838
  "Documentation</a>"
839
  msgstr ""
840
 
841
- #: includes/admin/forums.php:164 includes/admin/forums.php:235
842
- #: includes/admin/replies.php:178 includes/admin/replies.php:246
843
- #: includes/admin/settings.php:1357 includes/admin/topics.php:179
844
- #: includes/admin/topics.php:247
845
  msgid ""
846
  "<a href=\"http://bbpress.org/forums/\" target=\"_blank\">bbPress Support "
847
  "Forums</a>"
848
  msgstr ""
849
 
850
- #: includes/admin/forums.php:178
851
  msgid ""
852
  "The title field and the big forum editing Area are fixed in place, but you "
853
  "can reposition all the other boxes using drag and drop, and can minimize or "
@@ -857,22 +813,22 @@ msgid ""
857
  "screen."
858
  msgstr ""
859
 
860
- #: includes/admin/forums.php:182 includes/admin/replies.php:196
861
- #: includes/admin/topics.php:197
862
  msgid "Customizing This Display"
863
  msgstr ""
864
 
865
- #: includes/admin/forums.php:188
866
  msgid "Title and Forum Editor"
867
  msgstr ""
868
 
869
- #: includes/admin/forums.php:190
870
  msgid ""
871
  "<strong>Title</strong> - Enter a title for your forum. After you enter a "
872
  "title, you&#8217;ll see the permalink below, which you can edit."
873
  msgstr ""
874
 
875
- #: includes/admin/forums.php:191
876
  msgid ""
877
  "<strong>Forum Editor</strong> - Enter the text for your forum. There are two "
878
  "modes of editing: Visual and HTML. Choose the mode by clicking on the "
@@ -886,7 +842,7 @@ msgid ""
886
  "over the top area. Exit Fullscreen back to the regular forum editor."
887
  msgstr ""
888
 
889
- #: includes/admin/forums.php:194
890
  msgid ""
891
  "<strong>Publish</strong> - You can set the terms of publishing your forum in "
892
  "the Publish box. For Status, Visibility, and Publish (immediately), click on "
@@ -897,18 +853,7 @@ msgid ""
897
  "future or backdate a forum."
898
  msgstr ""
899
 
900
- #: includes/admin/forums.php:197
901
- msgid ""
902
- "<strong>forum Format</strong> - This designates how your theme will display "
903
- "a specific forum. For example, you could have a <em>standard</em> blog forum "
904
- "with a title and paragraphs, or a short <em>aside</em> that omits the title "
905
- "and contains a short text blurb. Please refer to the Codex for <a href="
906
- "\"http://codex.wordpress.org/Post_Formats#Supported_Formats\">descriptions "
907
- "of each forum format</a>. Your theme could enable all or some of 10 possible "
908
- "formats."
909
- msgstr ""
910
-
911
- #: includes/admin/forums.php:201
912
  msgid ""
913
  "<strong>Featured Image</strong> - This allows you to associate an image with "
914
  "your forum without inserting it. This is usually useful only if your theme "
@@ -916,141 +861,116 @@ msgid ""
916
  "custom header, etc."
917
  msgstr ""
918
 
919
- #: includes/admin/forums.php:206 includes/admin/forums.php:254
920
  msgid "Forum Attributes"
921
  msgstr ""
922
 
923
- #: includes/admin/forums.php:208
924
  msgid "Select the attributes that your forum should have:"
925
  msgstr ""
926
 
927
- #: includes/admin/forums.php:210
928
  msgid ""
929
  "<strong>Type</strong> indicates if the forum is a category or forum. "
930
  "Categories generally contain other forums."
931
  msgstr ""
932
 
933
- #: includes/admin/forums.php:211
934
  msgid ""
935
  "<strong>Status</strong> allows you to close a forum to new topics and forums."
936
  msgstr ""
937
 
938
- #: includes/admin/forums.php:212
939
  msgid ""
940
  "<strong>Visibility</strong> lets you pick the scope of each forum and what "
941
  "users are allowed to access it."
942
  msgstr ""
943
 
944
- #: includes/admin/forums.php:213
945
  msgid ""
946
  "<strong>Parent</strong> dropdown determines the parent forum. Select the "
947
  "forum or category from the dropdown, or leave the default (No Parent) to "
948
  "create the forum at the root of your forums."
949
  msgstr ""
950
 
951
- #: includes/admin/forums.php:214
952
  msgid "<strong>Order</strong> allows you to order your forums numerically."
953
  msgstr ""
954
 
955
- #: includes/admin/forums.php:220 includes/admin/replies.php:231
956
- #: includes/admin/topics.php:232
957
  msgid "Publish Box"
958
  msgstr ""
959
 
960
- #: includes/admin/forums.php:226 includes/admin/replies.php:237
961
- #: includes/admin/topics.php:238
962
- msgid "Discussion Settings"
963
- msgstr ""
964
-
965
- #: includes/admin/forums.php:228 includes/admin/replies.php:239
966
- #: includes/admin/topics.php:240
967
- msgid ""
968
- "<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy "
969
- "blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to "
970
- "send trackbacks. If you link to other WordPress sites they&#8217;ll be "
971
- "notified automatically using pingbacks, and this field is unnecessary."
972
- msgstr ""
973
-
974
- #: includes/admin/forums.php:229
975
- msgid ""
976
- "<strong>Discussion</strong> - You can turn comments and pings on or off, and "
977
- "if there are comments on the forum, you can see them here and moderate them."
978
- msgstr ""
979
-
980
- #: includes/admin/forums.php:423
981
  #: templates/default/bbpress/content-single-topic-lead.php:18
982
  #: templates/default/bbpress/content-single-topic-lead.php:90
983
  msgid "Creator"
984
  msgstr ""
985
 
986
- #: includes/admin/forums.php:424 includes/admin/replies.php:582
987
- #: includes/admin/topics.php:648
988
  msgid "Created"
989
  msgstr ""
990
 
991
- #: includes/admin/forums.php:425 includes/admin/topics.php:649
992
  #: templates/default/bbpress/loop-forums.php:22
993
  #: templates/default/bbpress/loop-topics.php:22
994
  msgid "Freshness"
995
  msgstr ""
996
 
997
- #: includes/admin/forums.php:462 includes/admin/replies.php:690
998
- #: includes/admin/topics.php:728
999
- msgid "%1$s <br /> %2$s"
1000
- msgstr ""
1001
-
1002
- #: includes/admin/forums.php:474 includes/forums/template-tags.php:530
1003
  msgid "No Topics"
1004
  msgstr ""
1005
 
1006
- #: includes/admin/forums.php:540
1007
  msgid "Forum updated. <a href=\"%s\">View forum</a>"
1008
  msgstr ""
1009
 
1010
- #: includes/admin/forums.php:543 includes/admin/replies.php:862
1011
- #: includes/admin/topics.php:934
1012
  msgid "Custom field updated."
1013
  msgstr ""
1014
 
1015
- #: includes/admin/forums.php:546 includes/admin/replies.php:865
1016
- #: includes/admin/topics.php:937
1017
  msgid "Custom field deleted."
1018
  msgstr ""
1019
 
1020
- #: includes/admin/forums.php:549
1021
  msgid "Forum updated."
1022
  msgstr ""
1023
 
1024
  #. translators: %s: date and time of the revision
1025
- #: includes/admin/forums.php:554
1026
  msgid "Forum restored to revision from %s"
1027
  msgstr ""
1028
 
1029
- #: includes/admin/forums.php:558
1030
  msgid "Forum created. <a href=\"%s\">View forum</a>"
1031
  msgstr ""
1032
 
1033
- #: includes/admin/forums.php:561
1034
  msgid "Forum saved."
1035
  msgstr ""
1036
 
1037
- #: includes/admin/forums.php:564
1038
  msgid "Forum submitted. <a target=\"_blank\" href=\"%s\">Preview forum</a>"
1039
  msgstr ""
1040
 
1041
- #: includes/admin/forums.php:567
1042
  msgid ""
1043
  "Forum scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
1044
  "\">Preview forum</a>"
1045
  msgstr ""
1046
 
1047
  #. translators: Publish box date format, see http:php.net/date
1048
- #: includes/admin/forums.php:569 includes/admin/replies.php:888
1049
- #: includes/admin/topics.php:960
1050
  msgid "M j, Y @ G:i"
1051
  msgstr ""
1052
 
1053
- #: includes/admin/forums.php:574
1054
  msgid "Forum draft updated. <a target=\"_blank\" href=\"%s\">Preview forum</a>"
1055
  msgstr ""
1056
 
@@ -1091,17 +1011,18 @@ msgid "You are using <span class=\"b\">bbPress %s</span>."
1091
  msgstr ""
1092
 
1093
  #: includes/admin/metaboxes.php:261 includes/admin/metaboxes.php:262
1094
- #: includes/admin/metaboxes.php:350
1095
  msgid "Type:"
1096
  msgstr ""
1097
 
1098
  #: includes/admin/metaboxes.php:273 includes/admin/metaboxes.php:274
1099
- #: templates/default/bbpress/form-forum.php:111
 
1100
  msgid "Status:"
1101
  msgstr ""
1102
 
1103
  #: includes/admin/metaboxes.php:285 includes/admin/metaboxes.php:286
1104
- #: templates/default/bbpress/form-forum.php:120
1105
  msgid "Visibility:"
1106
  msgstr ""
1107
 
@@ -1113,8 +1034,8 @@ msgstr ""
1113
  msgid "Forum Parent"
1114
  msgstr ""
1115
 
1116
- #: includes/admin/metaboxes.php:314 includes/admin/metaboxes.php:371
1117
- #: includes/admin/metaboxes.php:423
1118
  msgid "&mdash; No parent &mdash;"
1119
  msgstr ""
1120
 
@@ -1126,75 +1047,95 @@ msgstr ""
1126
  msgid "Forum Order"
1127
  msgstr ""
1128
 
1129
- #: includes/admin/metaboxes.php:351
1130
  msgid "Topic Type"
1131
  msgstr ""
1132
 
1133
- #: includes/admin/metaboxes.php:464
 
 
 
 
 
 
 
 
 
 
 
 
1134
  #: templates/default/bbpress/form-topic-tag.php:35
1135
  msgid "Name:"
1136
  msgstr ""
1137
 
1138
- #: includes/admin/metaboxes.php:465
1139
  #: templates/default/bbpress/form-user-edit.php:14
1140
  #: templates/default/bbpress/form-user-edit.php:19
1141
  msgid "Name"
1142
  msgstr ""
1143
 
1144
- #: includes/admin/metaboxes.php:470
1145
  msgid "Email:"
1146
  msgstr ""
1147
 
1148
- #: includes/admin/metaboxes.php:471
1149
  #: templates/default/bbpress/form-user-edit.php:103
1150
  #: templates/default/bbpress/form-user-register.php:28
1151
  msgid "Email"
1152
  msgstr ""
1153
 
1154
- #: includes/admin/metaboxes.php:476
1155
  #: templates/default/bbpress/form-anonymous.php:32
1156
  msgid "Website:"
1157
  msgstr ""
1158
 
1159
- #: includes/admin/metaboxes.php:477
1160
  #: templates/default/bbpress/form-user-edit.php:57
1161
  msgid "Website"
1162
  msgstr ""
1163
 
1164
- #: includes/admin/metaboxes.php:484
 
 
 
 
 
 
 
 
1165
  msgid "IP:"
1166
  msgstr ""
1167
 
1168
- #: includes/admin/metaboxes.php:485
1169
  msgid "IP Address"
1170
  msgstr ""
1171
 
1172
- #: includes/admin/replies.php:133
1173
  msgid ""
1174
  "This screen provides access to all of your replies. You can customize the "
1175
  "display of this screen to suit your workflow."
1176
  msgstr ""
1177
 
1178
- #: includes/admin/replies.php:143
1179
  msgid ""
1180
  "You can hide/display columns based on your needs and decide how many replies "
1181
  "to list per screen using the Screen Options tab."
1182
  msgstr ""
1183
 
1184
- #: includes/admin/replies.php:144
1185
  msgid ""
1186
  "You can filter the list of replies by reply status using the text links in "
1187
  "the upper left to show All, Published, Draft, or Trashed replies. The "
1188
  "default view is to show all replies."
1189
  msgstr ""
1190
 
1191
- #: includes/admin/replies.php:145
1192
  msgid ""
1193
  "You can view replies in a simple title list or with an excerpt. Choose the "
1194
  "view you prefer by clicking on the icons at the top of the list on the right."
1195
  msgstr ""
1196
 
1197
- #: includes/admin/replies.php:146
1198
  msgid ""
1199
  "You can refine the list to show only replies in a specific category or from "
1200
  "a specific month by using the dropdown menus above the replies list. Click "
@@ -1202,52 +1143,52 @@ msgid ""
1202
  "by clicking on the reply author, category or tag in the replies list."
1203
  msgstr ""
1204
 
1205
- #: includes/admin/replies.php:155
1206
  msgid ""
1207
  "Hovering over a row in the replies list will display action links that allow "
1208
  "you to manage your reply. You can perform the following actions:"
1209
  msgstr ""
1210
 
1211
- #: includes/admin/replies.php:157
1212
  msgid ""
1213
  "<strong>Edit</strong> takes you to the editing screen for that reply. You "
1214
  "can also reach that screen by clicking on the reply title."
1215
  msgstr ""
1216
 
1217
- #: includes/admin/replies.php:159
1218
  msgid ""
1219
  "<strong>Trash</strong> removes your reply from this list and places it in "
1220
  "the trash, from which you can permanently delete it."
1221
  msgstr ""
1222
 
1223
- #: includes/admin/replies.php:160
1224
  msgid ""
1225
  "<strong>Spam</strong> removes your reply from this list and places it in the "
1226
  "spam queue, from which you can permanently delete it."
1227
  msgstr ""
1228
 
1229
- #: includes/admin/replies.php:161
1230
  msgid ""
1231
  "<strong>Preview</strong> will show you what your draft reply will look like "
1232
  "if you publish it. View will take you to your live site to view the reply. "
1233
  "Which link is available depends on your reply&#8217;s status."
1234
  msgstr ""
1235
 
1236
- #: includes/admin/replies.php:170
1237
  msgid ""
1238
  "You can also edit or move multiple replies to the trash at once. Select the "
1239
  "replies you want to act on using the checkboxes, then select the action you "
1240
  "want to take from the Bulk Actions menu and click Apply."
1241
  msgstr ""
1242
 
1243
- #: includes/admin/replies.php:171
1244
  msgid ""
1245
  "When using Bulk Edit, you can change the metadata (categories, author, etc.) "
1246
  "for all selected replies at once. To remove a reply from the grouping, just "
1247
  "click the x next to its name in the Bulk Edit area that appears."
1248
  msgstr ""
1249
 
1250
- #: includes/admin/replies.php:192
1251
  msgid ""
1252
  "The title field and the big reply editing Area are fixed in place, but you "
1253
  "can reposition all the other boxes using drag and drop, and can minimize or "
@@ -1257,17 +1198,17 @@ msgid ""
1257
  "screen."
1258
  msgstr ""
1259
 
1260
- #: includes/admin/replies.php:202
1261
  msgid "Title and Reply Editor"
1262
  msgstr ""
1263
 
1264
- #: includes/admin/replies.php:204
1265
  msgid ""
1266
  "<strong>Title</strong> - Enter a title for your reply. After you enter a "
1267
  "title, you&#8217;ll see the permalink below, which you can edit."
1268
  msgstr ""
1269
 
1270
- #: includes/admin/replies.php:205
1271
  msgid ""
1272
  "<strong>Reply Editor</strong> - Enter the text for your reply. There are two "
1273
  "modes of editing: Visual and HTML. Choose the mode by clicking on the "
@@ -1281,7 +1222,7 @@ msgid ""
1281
  "over the top area. Exit Fullscreen back to the regular reply editor."
1282
  msgstr ""
1283
 
1284
- #: includes/admin/replies.php:208
1285
  msgid ""
1286
  "<strong>Publish</strong> - You can set the terms of publishing your reply in "
1287
  "the Publish box. For Status, Visibility, and Publish (immediately), click on "
@@ -1292,18 +1233,7 @@ msgid ""
1292
  "future or backdate a reply."
1293
  msgstr ""
1294
 
1295
- #: includes/admin/replies.php:211
1296
- msgid ""
1297
- "<strong>reply Format</strong> - This designates how your theme will display "
1298
- "a specific reply. For example, you could have a <em>standard</em> blog reply "
1299
- "with a title and paragraphs, or a short <em>aside</em> that omits the title "
1300
- "and contains a short text blurb. Please refer to the Codex for <a href="
1301
- "\"http://codex.wordpress.org/Post_Formats#Supported_Formats\">descriptions "
1302
- "of each reply format</a>. Your theme could enable all or some of 10 possible "
1303
- "formats."
1304
- msgstr ""
1305
-
1306
- #: includes/admin/replies.php:215
1307
  msgid ""
1308
  "<strong>Featured Image</strong> - This allows you to associate an image with "
1309
  "your reply without inserting it. This is usually useful only if your theme "
@@ -1311,704 +1241,757 @@ msgid ""
1311
  "custom header, etc."
1312
  msgstr ""
1313
 
1314
- #: includes/admin/replies.php:220 includes/admin/replies.php:265
1315
  msgid "Reply Attributes"
1316
  msgstr ""
1317
 
1318
- #: includes/admin/replies.php:222
1319
  msgid "Select the attributes that your reply should have:"
1320
  msgstr ""
1321
 
1322
- #: includes/admin/replies.php:224
1323
  msgid ""
1324
  "<strong>Forum</strong> dropdown determines the parent forum that the reply "
1325
  "belongs to. Select the forum, or leave the default (Use Forum of Topic) to "
1326
  "post the reply in forum of the topic."
1327
  msgstr ""
1328
 
1329
- #: includes/admin/replies.php:225
1330
  msgid ""
1331
  "<strong>Topic</strong> determines the parent topic that the reply belongs to."
1332
  msgstr ""
1333
 
1334
- #: includes/admin/replies.php:240
1335
- msgid ""
1336
- "<strong>Discussion</strong> - You can turn comments and pings on or off, and "
1337
- "if there are comments on the reply, you can see them here and moderate them."
1338
  msgstr ""
1339
 
1340
- #: includes/admin/replies.php:356 includes/admin/topics.php:374
1341
  #: templates/default/bbpress/form-anonymous.php:17
1342
  msgid "Author Information"
1343
  msgstr ""
1344
 
1345
- #: includes/admin/replies.php:470
1346
  msgid "The reply was not found!"
1347
  msgstr ""
1348
 
1349
- #: includes/admin/replies.php:473 includes/admin/topics.php:499
1350
  msgid "You do not have the permission to do that!"
1351
  msgstr ""
1352
 
1353
- #: includes/admin/replies.php:541
1354
  msgid "There was a problem marking the reply \"%1$s\" as spam."
1355
  msgstr ""
1356
 
1357
- #: includes/admin/replies.php:541
1358
  msgid "Reply \"%1$s\" successfully marked as spam."
1359
  msgstr ""
1360
 
1361
- #: includes/admin/replies.php:545
1362
  msgid "There was a problem unmarking the reply \"%1$s\" as spam."
1363
  msgstr ""
1364
 
1365
- #: includes/admin/replies.php:545
1366
  msgid "Reply \"%1$s\" successfully unmarked as spam."
1367
  msgstr ""
1368
 
1369
- #: includes/admin/replies.php:578
1370
  msgid "Title"
1371
  msgstr ""
1372
 
1373
- #: includes/admin/replies.php:581 includes/admin/topics.php:647
1374
  #: templates/default/bbpress/loop-replies.php:18
1375
- #: templates/default/bbpress/loop-replies.php:52
1376
  #: templates/default/bbpress/loop-search.php:18
1377
  #: templates/default/bbpress/loop-search.php:40
1378
  msgid "Author"
1379
  msgstr ""
1380
 
1381
- #: includes/admin/replies.php:635 includes/admin/replies.php:643
1382
  msgid "No Topic"
1383
  msgstr ""
1384
 
1385
- #: includes/admin/replies.php:661 includes/admin/replies.php:676
1386
- #: includes/admin/topics.php:699
1387
  msgid "No Forum"
1388
  msgstr ""
1389
 
1390
- #: includes/admin/replies.php:667
1391
  msgid "(Mismatch)"
1392
  msgstr ""
1393
 
1394
- #: includes/admin/replies.php:735 includes/admin/topics.php:788
1395
  msgid "View &#8220;%s&#8221;"
1396
  msgstr ""
1397
 
1398
- #: includes/admin/replies.php:735 includes/admin/topics.php:788
1399
  msgid "View"
1400
  msgstr ""
1401
 
1402
- #: includes/admin/replies.php:746
1403
  msgid "Mark the reply as not spam"
1404
  msgstr ""
1405
 
1406
- #: includes/admin/replies.php:746 includes/admin/topics.php:819
1407
  msgid "Not spam"
1408
  msgstr ""
1409
 
1410
- #: includes/admin/replies.php:748
1411
  msgid "Mark this reply as spam"
1412
  msgstr ""
1413
 
1414
- #: includes/admin/replies.php:748 includes/admin/topics.php:821
1415
- #: includes/replies/template-tags.php:1779
1416
- #: includes/topics/template-tags.php:2713
1417
  msgid "Spam"
1418
  msgstr ""
1419
 
1420
- #: includes/admin/replies.php:757 includes/admin/topics.php:829
1421
- #: includes/replies/template-tags.php:1721
1422
- #: includes/topics/template-tags.php:2469
1423
  msgid "Restore this item from the Trash"
1424
  msgstr ""
1425
 
1426
- #: includes/admin/replies.php:757 includes/admin/topics.php:829
1427
- #: includes/replies/template-tags.php:1709
1428
- #: includes/topics/template-tags.php:2457
1429
  msgid "Restore"
1430
  msgstr ""
1431
 
1432
- #: includes/admin/replies.php:759 includes/admin/topics.php:831
1433
- #: includes/replies/template-tags.php:1723
1434
- #: includes/topics/template-tags.php:2471
1435
  msgid "Move this item to the Trash"
1436
  msgstr ""
1437
 
1438
- #: includes/admin/replies.php:759 includes/admin/topics.php:831
1439
- #: includes/replies/template-tags.php:1708
1440
- #: includes/topics/template-tags.php:2456
1441
  msgid "Trash"
1442
  msgstr ""
1443
 
1444
- #: includes/admin/replies.php:763 includes/admin/topics.php:835
1445
- #: includes/replies/template-tags.php:1727
1446
- #: includes/topics/template-tags.php:2475
1447
  msgid "Delete this item permanently"
1448
  msgstr ""
1449
 
1450
- #: includes/admin/replies.php:763 includes/admin/topics.php:835
1451
  msgid "Delete Permanently"
1452
  msgstr ""
1453
 
1454
- #: includes/admin/replies.php:789 includes/admin/topics.php:861
1455
  msgid "Empty Spam"
1456
  msgstr ""
1457
 
1458
- #: includes/admin/replies.php:799 includes/admin/topics.php:871
1459
  msgid "In all forums"
1460
  msgstr ""
1461
 
1462
- #: includes/admin/replies.php:859
1463
  msgid "Reply updated. <a href=\"%s\">View topic</a>"
1464
  msgstr ""
1465
 
1466
- #: includes/admin/replies.php:868
1467
  msgid "Reply updated."
1468
  msgstr ""
1469
 
1470
  #. translators: %s: date and time of the revision
1471
- #: includes/admin/replies.php:873
1472
  msgid "Reply restored to revision from %s"
1473
  msgstr ""
1474
 
1475
- #: includes/admin/replies.php:877
1476
  msgid "Reply created. <a href=\"%s\">View topic</a>"
1477
  msgstr ""
1478
 
1479
- #: includes/admin/replies.php:880
1480
  msgid "Reply saved."
1481
  msgstr ""
1482
 
1483
- #: includes/admin/replies.php:883
1484
  msgid "Reply submitted. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
1485
  msgstr ""
1486
 
1487
- #: includes/admin/replies.php:886
1488
  msgid ""
1489
  "Reply scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
1490
  "\">Preview topic</a>"
1491
  msgstr ""
1492
 
1493
- #: includes/admin/replies.php:893
1494
  msgid "Reply draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
1495
  msgstr ""
1496
 
1497
- #: includes/admin/settings.php:24 includes/admin/settings.php:1317
1498
- msgid "Main Settings"
1499
  msgstr ""
1500
 
1501
  #: includes/admin/settings.php:29
1502
- msgid "Theme Packages"
1503
  msgstr ""
1504
 
1505
- #: includes/admin/settings.php:34 includes/admin/settings.php:1337
1506
- msgid "Per Page"
1507
  msgstr ""
1508
 
1509
  #: includes/admin/settings.php:39
1510
- msgid "Per RSS Page"
1511
  msgstr ""
1512
 
1513
  #: includes/admin/settings.php:44
1514
- msgid "Archive Slugs"
1515
  msgstr ""
1516
 
1517
  #: includes/admin/settings.php:49
1518
- msgid "Single Slugs"
1519
  msgstr ""
1520
 
1521
  #: includes/admin/settings.php:54
1522
- msgid "BuddyPress"
1523
  msgstr ""
1524
 
1525
  #: includes/admin/settings.php:59
1526
- msgid "Akismet"
 
 
 
 
1527
  msgstr ""
1528
 
1529
- #: includes/admin/settings.php:81
 
 
 
 
1530
  msgid "Disallow editing after"
1531
  msgstr ""
1532
 
1533
- #: includes/admin/settings.php:89
1534
  msgid "Throttle posting every"
1535
  msgstr ""
1536
 
1537
- #: includes/admin/settings.php:97 includes/admin/settings.php:1450
 
 
 
 
 
 
 
 
1538
  msgid "Revisions"
1539
  msgstr ""
1540
 
1541
- #: includes/admin/settings.php:105 includes/extend/buddypress/loader.php:213
1542
  #: templates/default/bbpress/user-details.php:48
1543
  msgid "Favorites"
1544
  msgstr ""
1545
 
1546
- #: includes/admin/settings.php:113 includes/extend/buddypress/loader.php:225
1547
  #: templates/default/bbpress/user-details.php:58
1548
  msgid "Subscriptions"
1549
  msgstr ""
1550
 
1551
- #: includes/admin/settings.php:121
1552
  msgid "Topic tags"
1553
  msgstr ""
1554
 
1555
- #: includes/admin/settings.php:129
1556
- msgid "Anonymous posting"
1557
- msgstr ""
1558
-
1559
- #: includes/admin/settings.php:137
1560
- msgid "Default user role"
1561
- msgstr ""
1562
-
1563
- #: includes/admin/settings.php:145
1564
- msgid "Auto role"
1565
- msgstr ""
1566
-
1567
- #: includes/admin/settings.php:153
1568
- msgid "Fancy editor"
1569
  msgstr ""
1570
 
1571
- #: includes/admin/settings.php:161
1572
  msgid "Auto-embed links"
1573
  msgstr ""
1574
 
1575
- #: includes/admin/settings.php:174
1576
- msgid "Current Package"
1577
  msgstr ""
1578
 
1579
- #: includes/admin/settings.php:229 includes/admin/settings.php:1463
1580
- msgid "Forums base"
1581
  msgstr ""
1582
 
1583
- #: includes/admin/settings.php:237 includes/admin/settings.php:1466
1584
- msgid "Topics base"
1585
  msgstr ""
1586
 
1587
- #: includes/admin/settings.php:250
1588
  msgid "Forum Prefix"
1589
  msgstr ""
1590
 
1591
- #: includes/admin/settings.php:258 includes/admin/settings.php:1469
1592
- msgid "Forum slug"
1593
  msgstr ""
1594
 
1595
- #: includes/admin/settings.php:266 includes/admin/settings.php:1472
1596
- msgid "Topic slug"
1597
  msgstr ""
1598
 
1599
- #: includes/admin/settings.php:274 includes/admin/settings.php:1484
1600
- msgid "Topic tag slug"
1601
  msgstr ""
1602
 
1603
- #: includes/admin/settings.php:282 includes/admin/settings.php:1475
1604
- msgid "Reply slug"
 
 
1605
  msgstr ""
1606
 
1607
- #: includes/admin/settings.php:290
1608
- msgid "User slug"
 
 
1609
  msgstr ""
1610
 
1611
- #: includes/admin/settings.php:298
1612
- msgid "Topic view slug"
1613
  msgstr ""
1614
 
1615
- #: includes/admin/settings.php:306
1616
- msgid "Search slug"
1617
  msgstr ""
1618
 
1619
- #: includes/admin/settings.php:319
1620
  msgid "Enable Group Forums"
1621
  msgstr ""
1622
 
1623
- #: includes/admin/settings.php:327
1624
  msgid "Group Forums Parent"
1625
  msgstr ""
1626
 
1627
- #: includes/admin/settings.php:340
1628
  msgid "Use Akismet"
1629
  msgstr ""
1630
 
1631
- #: includes/admin/settings.php:378
1632
- msgid "Main forum settings for enabling features and setting time limits"
1633
  msgstr ""
1634
 
1635
- #: includes/admin/settings.php:394 includes/common/functions.php:121
1636
  msgid "minutes"
1637
  msgstr ""
1638
 
1639
- #: includes/admin/settings.php:410 includes/common/functions.php:122
1640
  msgid "seconds"
1641
  msgstr ""
1642
 
1643
- #: includes/admin/settings.php:426
 
 
 
 
 
 
 
 
 
 
 
 
1644
  msgid "Allow users to mark topics as favorites"
1645
  msgstr ""
1646
 
1647
- #: includes/admin/settings.php:442
1648
  msgid "Allow users to subscribe to topics"
1649
  msgstr ""
1650
 
1651
- #: includes/admin/settings.php:458
1652
  msgid "Allow topics to have tags"
1653
  msgstr ""
1654
 
1655
- #: includes/admin/settings.php:474
1656
- msgid "Allow topic and reply revision logging"
1657
  msgstr ""
1658
 
1659
- #: includes/admin/settings.php:490
1660
- msgid "Allow guest users without accounts to create topics and replies"
1661
  msgstr ""
1662
 
1663
- #: includes/admin/settings.php:506
1664
- msgid ""
1665
- "Automatically assign default role to new, registered users upon visiting the "
1666
- "site."
1667
  msgstr ""
1668
 
1669
- #: includes/admin/settings.php:544
1670
- msgid "Use the fancy WordPress editor to create and edit topics and replies"
1671
  msgstr ""
1672
 
1673
- #: includes/admin/settings.php:557
1674
  msgid "How your forum content is displayed within your existing theme."
1675
  msgstr ""
1676
 
1677
- #: includes/admin/settings.php:581
1678
  msgid "%1$s - %2$s"
1679
  msgstr ""
1680
 
1681
- #: includes/admin/settings.php:587
1682
  msgid "will serve all bbPress templates"
1683
  msgstr ""
1684
 
1685
- #: includes/admin/settings.php:591
1686
  msgid "No template packages available."
1687
  msgstr ""
1688
 
1689
- #: includes/admin/settings.php:607
1690
  msgid ""
1691
  "Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and "
1692
  "replies"
1693
  msgstr ""
1694
 
1695
- #: includes/admin/settings.php:622
1696
  msgid "How many topics and replies to show per page"
1697
  msgstr ""
1698
 
1699
- #: includes/admin/settings.php:638 includes/admin/settings.php:654
1700
- #: includes/admin/settings.php:685 includes/admin/settings.php:701
1701
  msgid "per page"
1702
  msgstr ""
1703
 
1704
- #: includes/admin/settings.php:669
1705
  msgid "How many topics and replies to show per RSS page"
1706
  msgstr ""
1707
 
1708
- #: includes/admin/settings.php:719
1709
  msgid ""
1710
- "Custom root slugs to prefix your forums and topics with. These can be "
1711
- "partnered with WordPress pages to allow more flexibility."
1712
  msgstr ""
1713
 
1714
- #: includes/admin/settings.php:768
1715
- msgid ""
1716
- "Custom slugs for single forums, topics, replies, tags, users, and views "
1717
- "here. If you change these, existing permalinks will also change."
 
 
 
 
 
 
1718
  msgstr ""
1719
 
1720
- #: includes/admin/settings.php:784
1721
- msgid "Prefix your forum area with the Forum Base slug (Recommended)"
1722
  msgstr ""
1723
 
1724
- #: includes/admin/settings.php:921
 
 
 
 
 
1725
  msgid "Forum settings for BuddyPress"
1726
  msgstr ""
1727
 
1728
- #: includes/admin/settings.php:937
1729
  msgid "Allow BuddyPress Groups to have their own forums"
1730
  msgstr ""
1731
 
1732
- #: includes/admin/settings.php:954
1733
  msgid "&mdash; Forum root &mdash;"
1734
  msgstr ""
1735
 
1736
- #: includes/admin/settings.php:962
1737
  msgid "is the parent for all group forums"
1738
  msgstr ""
1739
 
1740
- #: includes/admin/settings.php:963
1741
  msgid ""
1742
  "Using the Forum Root is not recommended. Changing this does not move "
1743
  "existing forums."
1744
  msgstr ""
1745
 
1746
- #: includes/admin/settings.php:978
1747
  msgid "Forum settings for Akismet"
1748
  msgstr ""
1749
 
1750
- #: includes/admin/settings.php:995
1751
  msgid "Allow Akismet to actively prevent forum spam."
1752
  msgstr ""
1753
 
1754
- #: includes/admin/settings.php:1018
1755
  msgid "Forums Settings"
1756
  msgstr ""
1757
 
1758
- #: includes/admin/settings.php:1027
1759
  #: templates/default/bbpress/form-user-edit.php:173
1760
  msgid "Save Changes"
1761
  msgstr ""
1762
 
1763
- #: includes/admin/settings.php:1046
1764
  msgid ""
1765
  "Information about your previous forums database so that they can be "
1766
  "converted. <strong>Backup your database before proceeding.</strong>"
1767
  msgstr ""
1768
 
1769
- #: includes/admin/settings.php:1076
1770
  msgid "is the previous forum software"
1771
  msgstr ""
1772
 
1773
- #: includes/admin/settings.php:1090
1774
  msgid "IP or hostname"
1775
  msgstr ""
1776
 
1777
- #: includes/admin/settings.php:1104
1778
  msgid "Use default 3306 if unsure"
1779
  msgstr ""
1780
 
1781
- #: includes/admin/settings.php:1118
1782
  msgid "User for your database connection"
1783
  msgstr ""
1784
 
1785
- #: includes/admin/settings.php:1132
1786
  msgid "Password to access the database"
1787
  msgstr ""
1788
 
1789
- #: includes/admin/settings.php:1146
1790
  msgid "Name of the database with your old forum data"
1791
  msgstr ""
1792
 
1793
- #: includes/admin/settings.php:1159
1794
  msgid "Some optional parameters to help tune the conversion process."
1795
  msgstr ""
1796
 
1797
- #: includes/admin/settings.php:1173
1798
  msgid ""
1799
  "(If converting from BuddyPress Forums, use \"wp_bb_\" or your custom prefix)"
1800
  msgstr ""
1801
 
1802
- #: includes/admin/settings.php:1187
1803
  msgid "rows to process at a time"
1804
  msgstr ""
1805
 
1806
- #: includes/admin/settings.php:1188
1807
  msgid "Keep this low if you experience out-of-memory issues."
1808
  msgstr ""
1809
 
1810
- #: includes/admin/settings.php:1202
1811
  msgid "second(s) delay between each group of rows"
1812
  msgstr ""
1813
 
1814
- #: includes/admin/settings.php:1203
1815
  msgid "Keep this high to prevent too-many-connection issues."
1816
  msgstr ""
1817
 
1818
- #: includes/admin/settings.php:1217
1819
  msgid "Start a fresh conversion from the beginning"
1820
  msgstr ""
1821
 
1822
- #: includes/admin/settings.php:1218
1823
  msgid "You should clean old conversion information before starting over."
1824
  msgstr ""
1825
 
1826
- #: includes/admin/settings.php:1232
1827
  msgid "Purge all information from a previously attempted import"
1828
  msgstr ""
1829
 
1830
- #: includes/admin/settings.php:1233
1831
  msgid ""
1832
  "Use this if an import failed and you want to remove that incomplete data."
1833
  msgstr ""
1834
 
1835
- #: includes/admin/settings.php:1247
1836
  msgid "Attempt to import user accounts from previous forums"
1837
  msgstr ""
1838
 
1839
- #: includes/admin/settings.php:1248
1840
  msgid ""
1841
  "Non-bbPress passwords cannot be automatically converted. They will be "
1842
  "converted as each user logs in."
1843
  msgstr ""
1844
 
1845
- #: includes/admin/settings.php:1278
1846
  msgid "Start"
1847
  msgstr ""
1848
 
1849
- #: includes/admin/settings.php:1279
1850
  msgid "Stop"
1851
  msgstr ""
1852
 
1853
- #: includes/admin/settings.php:1310
1854
  msgid "This screen provides access to all of the Forums settings."
1855
  msgstr ""
1856
 
1857
- #: includes/admin/settings.php:1311
1858
  msgid ""
1859
  "Please see the additional help tabs for more information on each indiviual "
1860
  "section."
1861
  msgstr ""
1862
 
1863
- #: includes/admin/settings.php:1318
 
 
 
 
1864
  msgid "In the Main Settings you have a number of options:"
1865
  msgstr ""
1866
 
1867
- #: includes/admin/settings.php:1321
1868
  msgid ""
1869
  "You can choose to lock a post after a certain number of minutes. \"Locking "
1870
  "post editing\" will prevent the author from editing some amount of time "
1871
  "after saving a post."
1872
  msgstr ""
1873
 
1874
- #: includes/admin/settings.php:1322
1875
  msgid ""
1876
  "\"Throttle time\" is the amount of time required between posts from a single "
1877
  "author. The higher the throttle time, the longer a user will need to wait "
1878
  "between posting to the forum."
1879
  msgstr ""
1880
 
1881
- #: includes/admin/settings.php:1323
1882
  msgid ""
1883
  "Favorites are a way for users to save and later return to topics they favor. "
1884
  "This is enabled by default."
1885
  msgstr ""
1886
 
1887
- #: includes/admin/settings.php:1324
1888
  msgid ""
1889
  "Subscriptions allow users to subscribe for notifications to topics that "
1890
  "interest them. This is enabled by default."
1891
  msgstr ""
1892
 
1893
- #: includes/admin/settings.php:1325
1894
  msgid ""
1895
  "Topic-Tags allow users to filter topics between forums. This is enabled by "
1896
  "default."
1897
  msgstr ""
1898
 
1899
- #: includes/admin/settings.php:1326
1900
  msgid ""
1901
  "\"Anonymous Posting\" allows guest users who do not have accounts on your "
1902
  "site to both create topics as well as replies."
1903
  msgstr ""
1904
 
1905
- #: includes/admin/settings.php:1327
1906
  msgid ""
1907
  "The Fancy Editor brings the luxury of the Visual editor and HTML editor from "
1908
  "the traditional WordPress dashboard into your theme."
1909
  msgstr ""
1910
 
1911
- #: includes/admin/settings.php:1328
1912
  msgid ""
1913
  "Auto-embed will embed the media content from a URL directly into the "
1914
  "replies. For example: links to Flickr and YouTube."
1915
  msgstr ""
1916
 
1917
- #: includes/admin/settings.php:1331
1918
  msgid ""
1919
  "You must click the Save Changes button at the bottom of the screen for new "
1920
  "settings to take effect."
1921
  msgstr ""
1922
 
1923
- #: includes/admin/settings.php:1338
 
 
 
 
1924
  msgid ""
1925
  "Per Page settings allow you to control the number of topics and replies "
1926
  "appear on each page."
1927
  msgstr ""
1928
 
1929
- #: includes/admin/settings.php:1339
1930
  msgid ""
1931
  "This is comparable to the WordPress \"Reading Settings\" page, where you can "
1932
  "set the number of posts that should show on blog pages and in feeds."
1933
  msgstr ""
1934
 
1935
- #: includes/admin/settings.php:1340
1936
  msgid ""
1937
  "These are broken up into two separate groups: one for what appears in your "
1938
  "theme, another for RSS feeds."
1939
  msgstr ""
1940
 
1941
- #: includes/admin/settings.php:1346
1942
  msgid "Slugs"
1943
  msgstr ""
1944
 
1945
- #: includes/admin/settings.php:1347
1946
  msgid ""
1947
  "The Slugs section allows you to control the permalink structure for your "
1948
  "forums."
1949
  msgstr ""
1950
 
1951
- #: includes/admin/settings.php:1348
1952
  msgid ""
1953
  "\"Archive Slugs\" are used as the \"root\" for your forums and topics. If "
1954
  "you combine these values with existing page slugs, bbPress will attempt to "
1955
  "output the most correct title and content."
1956
  msgstr ""
1957
 
1958
- #: includes/admin/settings.php:1349
1959
  msgid ""
1960
  "\"Single Slugs\" are used as a prefix when viewing an individual forum, "
1961
  "topic, reply, user, or view."
1962
  msgstr ""
1963
 
1964
- #: includes/admin/settings.php:1350
1965
  msgid ""
1966
  "In the event of a slug collision with WordPress or BuddyPress, a warning "
1967
  "will appear next to the problem slug(s)."
1968
  msgstr ""
1969
 
1970
- #: includes/admin/settings.php:1448
1971
  #: templates/default/bbpress/loop-forums.php:21
1972
  #: templates/default/bbpress/loop-replies.php:24
1973
- #: templates/default/bbpress/loop-replies.php:58
1974
  #: templates/default/bbpress/loop-topics.php:21
1975
  msgid "Posts"
1976
  msgstr ""
1977
 
1978
- #: includes/admin/settings.php:1449
1979
  msgid "Pages"
1980
  msgstr ""
1981
 
1982
- #: includes/admin/settings.php:1451
1983
  msgid "Attachments"
1984
  msgstr ""
1985
 
1986
- #: includes/admin/settings.php:1452
1987
  msgid "Menus"
1988
  msgstr ""
1989
 
1990
- #: includes/admin/settings.php:1455
1991
  msgid "Tag base"
1992
  msgstr ""
1993
 
1994
- #: includes/admin/settings.php:1458
1995
  msgid "Category base"
1996
  msgstr ""
1997
 
1998
- #: includes/admin/settings.php:1478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1999
  msgid "User base"
2000
  msgstr ""
2001
 
2002
- #: includes/admin/settings.php:1481
2003
  msgid "View base"
2004
  msgstr ""
2005
 
2006
- #: includes/admin/settings.php:1496
 
 
 
 
2007
  msgid "%s page"
2008
  msgstr ""
2009
 
2010
- #: includes/admin/settings.php:1515
2011
- msgid "Possible %1$s conflict: <strong>%2$s</strong>"
2012
  msgstr ""
2013
 
2014
  #: includes/admin/tools.php:36
@@ -2111,8 +2094,8 @@ msgstr ""
2111
  #: includes/admin/tools.php:510 includes/admin/tools.php:555
2112
  #: includes/admin/tools.php:600 includes/admin/tools.php:662
2113
  #: includes/admin/tools.php:730 includes/admin/tools.php:778
2114
- #: includes/admin/tools.php:884 includes/admin/tools.php:942
2115
- #: includes/admin/tools.php:991 includes/admin/tools.php:1045
2116
  msgid "Failed!"
2117
  msgstr ""
2118
 
@@ -2121,8 +2104,8 @@ msgstr ""
2121
  #: includes/admin/tools.php:493 includes/admin/tools.php:538
2122
  #: includes/admin/tools.php:583 includes/admin/tools.php:645
2123
  #: includes/admin/tools.php:706 includes/admin/tools.php:868
2124
- #: includes/admin/tools.php:925 includes/admin/tools.php:975
2125
- #: includes/admin/tools.php:1029 includes/admin/tools.php:1074
2126
  msgid "Complete!"
2127
  msgstr ""
2128
 
@@ -2196,124 +2179,124 @@ msgstr ""
2196
  msgid "Repairing the sticky topic to the parent forum relationships&hellip; %s"
2197
  msgstr ""
2198
 
2199
- #: includes/admin/tools.php:941
2200
  msgid "Recalculating forum visibility &hellip; %s"
2201
  msgstr ""
2202
 
2203
- #: includes/admin/tools.php:990
2204
  msgid "Recalculating the forum for each post &hellip; %s"
2205
  msgstr ""
2206
 
2207
- #: includes/admin/tools.php:1044
2208
  msgid "Recalculating the topic for each post &hellip; %s"
2209
  msgstr ""
2210
 
2211
- #: includes/admin/tools.php:1097
2212
  msgid ""
2213
  "This will revert your forums back to a brand new installation. This process "
2214
  "cannot be undone. <strong>Backup your database before proceeding</strong>."
2215
  msgstr ""
2216
 
2217
- #: includes/admin/tools.php:1103
2218
  msgid "The following data will be removed:"
2219
  msgstr ""
2220
 
2221
- #: includes/admin/tools.php:1108
2222
  msgid "All Topic Tags"
2223
  msgstr ""
2224
 
2225
- #: includes/admin/tools.php:1109
2226
  msgid "Related Meta Data"
2227
  msgstr ""
2228
 
2229
- #: includes/admin/tools.php:1110
2230
  msgid "Forum Settings"
2231
  msgstr ""
2232
 
2233
- #: includes/admin/tools.php:1111
2234
  msgid "Forum Activity"
2235
  msgstr ""
2236
 
2237
- #: includes/admin/tools.php:1112
2238
  msgid "Forum User Roles"
2239
  msgstr ""
2240
 
2241
- #: includes/admin/tools.php:1113
2242
  msgid "Importer Helper Data"
2243
  msgstr ""
2244
 
2245
- #: includes/admin/tools.php:1117
2246
  msgid "Are you sure you want to do this?"
2247
  msgstr ""
2248
 
2249
- #: includes/admin/tools.php:1120
2250
  msgid "Say it ain't so!"
2251
  msgstr ""
2252
 
2253
- #: includes/admin/tools.php:1121
2254
  msgid "This process cannot be undone."
2255
  msgstr ""
2256
 
2257
- #: includes/admin/tools.php:1129
2258
  msgid "Reset bbPress"
2259
  msgstr ""
2260
 
2261
- #: includes/admin/tools.php:1162
2262
  msgid "Failed"
2263
  msgstr ""
2264
 
2265
- #: includes/admin/tools.php:1163
2266
  msgid "Success!"
2267
  msgstr ""
2268
 
2269
- #: includes/admin/tools.php:1170
2270
  msgid "Deleting Posts&hellip; %s"
2271
  msgstr ""
2272
 
2273
- #: includes/admin/tools.php:1183
2274
  msgid "Deleting Post Meta&hellip; %s"
2275
  msgstr ""
2276
 
2277
- #: includes/admin/tools.php:1192
2278
  msgid "Deleting Topic Tags&hellip; %s"
2279
  msgstr ""
2280
 
2281
- #: includes/admin/tools.php:1199
2282
  msgid "Deleting User Meta&hellip; %s"
2283
  msgstr ""
2284
 
2285
- #: includes/admin/tools.php:1206
2286
  msgid "Deleting Conversion Table&hellip; %s"
2287
  msgstr ""
2288
 
2289
- #: includes/admin/tools.php:1218
2290
  msgid "Deleting Settings&hellip; %s"
2291
  msgstr ""
2292
 
2293
- #: includes/admin/tools.php:1224
2294
  msgid "Deleting Roles and Capabilities&hellip; %s"
2295
  msgstr ""
2296
 
2297
- #: includes/admin/topics.php:133
2298
  msgid ""
2299
  "This screen displays the individual topics on your site. You can customize "
2300
  "the display of this screen to suit your workflow."
2301
  msgstr ""
2302
 
2303
- #: includes/admin/topics.php:143
2304
  msgid ""
2305
  "You can hide/display columns based on your needs and decide how many topics "
2306
  "to list per screen using the Screen Options tab."
2307
  msgstr ""
2308
 
2309
- #: includes/admin/topics.php:144
2310
  msgid ""
2311
  "You can filter the list of topics by topic status using the text links in "
2312
  "the upper left to show All, Published, or Trashed topics. The default view "
2313
  "is to show all topics."
2314
  msgstr ""
2315
 
2316
- #: includes/admin/topics.php:145
2317
  msgid ""
2318
  "You can refine the list to show only topics from a specific month by using "
2319
  "the dropdown menus above the topics list. Click the Filter button after "
@@ -2321,71 +2304,71 @@ msgid ""
2321
  "creator in the topics list."
2322
  msgstr ""
2323
 
2324
- #: includes/admin/topics.php:154
2325
  msgid ""
2326
  "Hovering over a row in the topics list will display action links that allow "
2327
  "you to manage your topic. You can perform the following actions:"
2328
  msgstr ""
2329
 
2330
- #: includes/admin/topics.php:156
2331
  msgid ""
2332
  "<strong>Edit</strong> takes you to the editing screen for that topic. You "
2333
  "can also reach that screen by clicking on the topic title."
2334
  msgstr ""
2335
 
2336
- #: includes/admin/topics.php:157
2337
  msgid ""
2338
  "<strong>Trash</strong> removes your topic from this list and places it in "
2339
  "the trash, from which you can permanently delete it."
2340
  msgstr ""
2341
 
2342
- #: includes/admin/topics.php:158
2343
  msgid ""
2344
  "<strong>Spam</strong> removes your topic from this list and places it in the "
2345
  "spam queue, from which you can permanently delete it."
2346
  msgstr ""
2347
 
2348
- #: includes/admin/topics.php:159
2349
  msgid ""
2350
  "<strong>Preview</strong> will show you what your draft topic will look like "
2351
  "if you publish it. View will take you to your live site to view the topic. "
2352
  "Which link is available depends on your topic&#8217;s status."
2353
  msgstr ""
2354
 
2355
- #: includes/admin/topics.php:160
2356
  msgid ""
2357
  "<strong>Close</strong> will mark the selected topic as &#8217;closed&#8217; "
2358
  "and disable the option to post new replies to the topic."
2359
  msgstr ""
2360
 
2361
- #: includes/admin/topics.php:161
2362
  msgid ""
2363
  "<strong>Stick</strong> will keep the selected topic &#8217;pinned&#8217; to "
2364
  "the top the parent forum topic list."
2365
  msgstr ""
2366
 
2367
- #: includes/admin/topics.php:162
2368
  msgid ""
2369
  "<strong>Stick <em>(to front)</em></strong> will keep the selected topic "
2370
  "&#8217;pinned&#8217; to the top of ALL forums and be visable in any forums "
2371
  "topics list."
2372
  msgstr ""
2373
 
2374
- #: includes/admin/topics.php:171
2375
  msgid ""
2376
  "You can also edit or move multiple topics to the trash at once. Select the "
2377
  "topics you want to act on using the checkboxes, then select the action you "
2378
  "want to take from the Bulk Actions menu and click Apply."
2379
  msgstr ""
2380
 
2381
- #: includes/admin/topics.php:172
2382
  msgid ""
2383
  "When using Bulk Edit, you can change the metadata (categories, author, etc.) "
2384
  "for all selected topics at once. To remove a topic from the grouping, just "
2385
  "click the x next to its name in the Bulk Edit area that appears."
2386
  msgstr ""
2387
 
2388
- #: includes/admin/topics.php:193
2389
  msgid ""
2390
  "The title field and the big topic editing Area are fixed in place, but you "
2391
  "can reposition all the other boxes using drag and drop, and can minimize or "
@@ -2395,17 +2378,17 @@ msgid ""
2395
  "screen."
2396
  msgstr ""
2397
 
2398
- #: includes/admin/topics.php:203
2399
  msgid "Title and Topic Editor"
2400
  msgstr ""
2401
 
2402
- #: includes/admin/topics.php:205
2403
  msgid ""
2404
  "<strong>Title</strong> - Enter a title for your topic. After you enter a "
2405
  "title, you&#8217;ll see the permalink below, which you can edit."
2406
  msgstr ""
2407
 
2408
- #: includes/admin/topics.php:206
2409
  msgid ""
2410
  "<strong>Topic Editor</strong> - Enter the text for your topic. There are two "
2411
  "modes of editing: Visual and HTML. Choose the mode by clicking on the "
@@ -2419,7 +2402,7 @@ msgid ""
2419
  "over the top area. Exit Fullscreen back to the regular topic editor."
2420
  msgstr ""
2421
 
2422
- #: includes/admin/topics.php:209
2423
  msgid ""
2424
  "<strong>Publish</strong> - You can set the terms of publishing your topic in "
2425
  "the Publish box. For Status, Visibility, and Publish (immediately), click on "
@@ -2430,18 +2413,7 @@ msgid ""
2430
  "future or backdate a topic."
2431
  msgstr ""
2432
 
2433
- #: includes/admin/topics.php:212
2434
- msgid ""
2435
- "<strong>topic Format</strong> - This designates how your theme will display "
2436
- "a specific topic. For example, you could have a <em>standard</em> blog topic "
2437
- "with a title and paragraphs, or a short <em>aside</em> that omits the title "
2438
- "and contains a short text blurb. Please refer to the Codex for <a href="
2439
- "\"http://codex.wordpress.org/Post_Formats#Supported_Formats\">descriptions "
2440
- "of each topic format</a>. Your theme could enable all or some of 10 possible "
2441
- "formats."
2442
- msgstr ""
2443
-
2444
- #: includes/admin/topics.php:216
2445
  msgid ""
2446
  "<strong>Featured Image</strong> - This allows you to associate an image with "
2447
  "your topic without inserting it. This is usually useful only if your theme "
@@ -2449,22 +2421,22 @@ msgid ""
2449
  "custom header, etc."
2450
  msgstr ""
2451
 
2452
- #: includes/admin/topics.php:221 includes/admin/topics.php:266
2453
  msgid "Topic Attributes"
2454
  msgstr ""
2455
 
2456
- #: includes/admin/topics.php:223
2457
  msgid "Select the attributes that your topic should have:"
2458
  msgstr ""
2459
 
2460
- #: includes/admin/topics.php:225
2461
  msgid ""
2462
  "<strong>Forum</strong> dropdown determines the parent forum that the topic "
2463
  "belongs to. Select the forum or category from the dropdown, or leave the "
2464
  "default (No Forum) to post the topic without an assigned forum."
2465
  msgstr ""
2466
 
2467
- #: includes/admin/topics.php:226
2468
  msgid ""
2469
  "<strong>Topic Type</strong> dropdown indicates the sticky status of the "
2470
  "topic. Selecting the super sticky option would stick the topic to the front "
@@ -2472,166 +2444,161 @@ msgid ""
2472
  "its respective forum. Selecting normal would not stick the topic anywhere."
2473
  msgstr ""
2474
 
2475
- #: includes/admin/topics.php:241
2476
- msgid ""
2477
- "<strong>Discussion</strong> - You can turn comments and pings on or off, and "
2478
- "if there are comments on the topic, you can see them here and moderate them."
2479
- msgstr ""
2480
-
2481
- #: includes/admin/topics.php:496
2482
  msgid "The topic was not found!"
2483
  msgstr ""
2484
 
2485
- #: includes/admin/topics.php:586
2486
  msgid "There was a problem opening the topic \"%1$s\"."
2487
  msgstr ""
2488
 
2489
- #: includes/admin/topics.php:586
2490
  msgid "Topic \"%1$s\" successfully opened."
2491
  msgstr ""
2492
 
2493
- #: includes/admin/topics.php:590
2494
  msgid "There was a problem closing the topic \"%1$s\"."
2495
  msgstr ""
2496
 
2497
- #: includes/admin/topics.php:590
2498
  msgid "Topic \"%1$s\" successfully closed."
2499
  msgstr ""
2500
 
2501
- #: includes/admin/topics.php:594
2502
  msgid "There was a problem sticking the topic \"%1$s\" to front."
2503
  msgstr ""
2504
 
2505
- #: includes/admin/topics.php:594
2506
  msgid "Topic \"%1$s\" successfully sticked to front."
2507
  msgstr ""
2508
 
2509
- #: includes/admin/topics.php:598
2510
  msgid "There was a problem sticking the topic \"%1$s\"."
2511
  msgstr ""
2512
 
2513
- #: includes/admin/topics.php:598
2514
  msgid "Topic \"%1$s\" successfully sticked."
2515
  msgstr ""
2516
 
2517
- #: includes/admin/topics.php:602
2518
  msgid "There was a problem unsticking the topic \"%1$s\"."
2519
  msgstr ""
2520
 
2521
- #: includes/admin/topics.php:602
2522
  msgid "Topic \"%1$s\" successfully unsticked."
2523
  msgstr ""
2524
 
2525
- #: includes/admin/topics.php:606
2526
  msgid "There was a problem marking the topic \"%1$s\" as spam."
2527
  msgstr ""
2528
 
2529
- #: includes/admin/topics.php:606
2530
  msgid "Topic \"%1$s\" successfully marked as spam."
2531
  msgstr ""
2532
 
2533
- #: includes/admin/topics.php:610
2534
  msgid "There was a problem unmarking the topic \"%1$s\" as spam."
2535
  msgstr ""
2536
 
2537
- #: includes/admin/topics.php:610
2538
  msgid "Topic \"%1$s\" successfully unmarked as spam."
2539
  msgstr ""
2540
 
2541
- #: includes/admin/topics.php:646 templates/default/bbpress/loop-topics.php:20
2542
  msgid "Voices"
2543
  msgstr ""
2544
 
2545
- #: includes/admin/topics.php:706 includes/extend/buddypress/group.php:288
 
2546
  msgid "(No Forum)"
2547
  msgstr ""
2548
 
2549
- #: includes/admin/topics.php:741 includes/topics/template-tags.php:1896
2550
  msgid "No Replies"
2551
  msgstr ""
2552
 
2553
- #: includes/admin/topics.php:798
2554
  msgid "Close this topic"
2555
  msgstr ""
2556
 
2557
- #: includes/admin/topics.php:798
2558
  msgctxt "Close a Topic"
2559
  msgid "Close"
2560
  msgstr ""
2561
 
2562
- #: includes/admin/topics.php:800
2563
  msgid "Open this topic"
2564
  msgstr ""
2565
 
2566
- #: includes/admin/topics.php:800
2567
  msgctxt "Open a Topic"
2568
  msgid "Open"
2569
  msgstr ""
2570
 
2571
- #: includes/admin/topics.php:809
2572
  msgid "Unstick this topic"
2573
  msgstr ""
2574
 
2575
- #: includes/admin/topics.php:809 includes/topics/template-tags.php:2587
2576
  msgid "Unstick"
2577
  msgstr ""
2578
 
2579
- #: includes/admin/topics.php:812
2580
  msgid "Stick this topic to its forum"
2581
  msgstr ""
2582
 
2583
- #: includes/admin/topics.php:812 includes/topics/template-tags.php:2586
2584
  msgid "Stick"
2585
  msgstr ""
2586
 
2587
- #: includes/admin/topics.php:812
2588
  msgid "Stick this topic to front"
2589
  msgstr ""
2590
 
2591
- #: includes/admin/topics.php:812 includes/topics/template-tags.php:2588
2592
- msgid "to front"
2593
  msgstr ""
2594
 
2595
- #: includes/admin/topics.php:819
2596
  msgid "Mark the topic as not spam"
2597
  msgstr ""
2598
 
2599
- #: includes/admin/topics.php:821
2600
  msgid "Mark this topic as spam"
2601
  msgstr ""
2602
 
2603
- #: includes/admin/topics.php:931
2604
  msgid "Topic updated. <a href=\"%s\">View topic</a>"
2605
  msgstr ""
2606
 
2607
- #: includes/admin/topics.php:940
2608
  msgid "Topic updated."
2609
  msgstr ""
2610
 
2611
  #. translators: %s: date and time of the revision
2612
- #: includes/admin/topics.php:945
2613
  msgid "Topic restored to revision from %s"
2614
  msgstr ""
2615
 
2616
- #: includes/admin/topics.php:949
2617
  msgid "Topic created. <a href=\"%s\">View topic</a>"
2618
  msgstr ""
2619
 
2620
- #: includes/admin/topics.php:952
2621
  msgid "Topic saved."
2622
  msgstr ""
2623
 
2624
- #: includes/admin/topics.php:955
2625
  msgid "Topic submitted. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
2626
  msgstr ""
2627
 
2628
- #: includes/admin/topics.php:958
2629
  msgid ""
2630
  "Topic scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
2631
  "\">Preview topic</a>"
2632
  msgstr ""
2633
 
2634
- #: includes/admin/topics.php:965
2635
  msgid "Topic draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
2636
  msgstr ""
2637
 
@@ -2641,7 +2608,7 @@ msgid "Forum Role"
2641
  msgstr ""
2642
 
2643
  #: includes/admin/users.php:96 includes/admin/users.php:100
2644
- #: includes/users/template-tags.php:1058
2645
  msgid "&mdash; No role for these forums &mdash;"
2646
  msgstr ""
2647
 
@@ -2657,92 +2624,92 @@ msgstr ""
2657
  msgid "Site Role"
2658
  msgstr ""
2659
 
2660
- #: includes/common/functions.php:110
2661
  msgid "sometime"
2662
  msgstr ""
2663
 
2664
- #: includes/common/functions.php:111
2665
  msgid "right now"
2666
  msgstr ""
2667
 
2668
- #: includes/common/functions.php:112
2669
  msgid "%s ago"
2670
  msgstr ""
2671
 
2672
- #: includes/common/functions.php:116
2673
  msgid "year"
2674
  msgstr ""
2675
 
2676
- #: includes/common/functions.php:116
2677
  msgid "years"
2678
  msgstr ""
2679
 
2680
- #: includes/common/functions.php:117
2681
  msgid "month"
2682
  msgstr ""
2683
 
2684
- #: includes/common/functions.php:117
2685
  msgid "months"
2686
  msgstr ""
2687
 
2688
- #: includes/common/functions.php:118
2689
  msgid "week"
2690
  msgstr ""
2691
 
2692
- #: includes/common/functions.php:118
2693
  msgid "weeks"
2694
  msgstr ""
2695
 
2696
- #: includes/common/functions.php:119
2697
  msgid "day"
2698
  msgstr ""
2699
 
2700
- #: includes/common/functions.php:119
2701
  msgid "days"
2702
  msgstr ""
2703
 
2704
- #: includes/common/functions.php:120
2705
  msgid "hour"
2706
  msgstr ""
2707
 
2708
- #: includes/common/functions.php:120
2709
  msgid "hours"
2710
  msgstr ""
2711
 
2712
- #: includes/common/functions.php:121
2713
  msgid "minute"
2714
  msgstr ""
2715
 
2716
- #: includes/common/functions.php:122
2717
  msgid "second"
2718
  msgstr ""
2719
 
2720
- #: includes/common/functions.php:177
2721
  msgctxt "Separator in time since"
2722
  msgid ","
2723
  msgstr ""
2724
 
2725
- #: includes/common/functions.php:510 includes/common/functions.php:542
2726
  msgid "Private: %s"
2727
  msgstr ""
2728
 
2729
- #: includes/common/functions.php:511 includes/common/functions.php:543
2730
  msgid "Spammed: %s"
2731
  msgstr ""
2732
 
2733
- #: includes/common/functions.php:512 includes/common/functions.php:544
2734
  msgid "Trashed: %s"
2735
  msgstr ""
2736
 
2737
- #: includes/common/functions.php:622
2738
  msgid "<strong>ERROR</strong>: Invalid author name submitted!"
2739
  msgstr ""
2740
 
2741
- #: includes/common/functions.php:626
2742
  msgid "<strong>ERROR</strong>: Invalid email address submitted!"
2743
  msgstr ""
2744
 
2745
- #: includes/common/functions.php:1065
2746
  msgid ""
2747
  "%1$s wrote:\n"
2748
  "\n"
@@ -2757,90 +2724,100 @@ msgid ""
2757
  "Login and visit the topic to unsubscribe from these emails."
2758
  msgstr ""
2759
 
2760
- #: includes/common/functions.php:1718
2761
  msgid ""
2762
  "Conditional query tags do not work before the query is run. Before then, "
2763
  "they always return false."
2764
  msgstr ""
2765
 
2766
- #: includes/common/template-tags.php:1415
2767
  msgid "No topics available"
2768
  msgstr ""
2769
 
2770
- #: includes/common/template-tags.php:1420
2771
  msgid "No forums available"
2772
  msgstr ""
2773
 
2774
- #: includes/common/template-tags.php:1425
2775
  msgid "None available"
2776
  msgstr ""
2777
 
2778
- #: includes/common/template-tags.php:1553 includes/replies/functions.php:1145
2779
- #: includes/topics/functions.php:1247 includes/topics/functions.php:1602
2780
  #: templates/default/bbpress/form-reply.php:29
2781
  msgid "Reply To: %s"
2782
  msgstr ""
2783
 
2784
- #: includes/common/template-tags.php:2072
2785
  msgid "Home"
2786
  msgstr ""
2787
 
2788
- #: includes/common/template-tags.php:2142
2789
  msgid "(Edit)"
2790
  msgstr ""
2791
 
2792
- #: includes/common/template-tags.php:2146
2793
- #: includes/common/template-tags.php:2260
2794
- #: includes/common/template-tags.php:2501 includes/core/theme-compat.php:631
2795
  #: templates/default/extras/taxonomy-topic-tag-edit.php:17
2796
  #: templates/default/extras/taxonomy-topic-tag.php:17
2797
  msgid "Topic Tag: %s"
2798
  msgstr ""
2799
 
2800
- #: includes/common/template-tags.php:2167
2801
  msgid "&lsaquo;"
2802
  msgstr ""
2803
 
2804
- #: includes/common/template-tags.php:2167
2805
  msgid "&rsaquo;"
2806
  msgstr ""
2807
 
2808
- #: includes/common/template-tags.php:2264
2809
- #: includes/search/template-tags.php:213
2810
- #: templates/default/bbpress/form-search.php:16
2811
- msgid "Search"
2812
  msgstr ""
2813
 
2814
- #: includes/common/template-tags.php:2435
2815
- msgid "Log Out"
 
 
 
 
 
 
 
 
 
 
 
 
2816
  msgstr ""
2817
 
2818
- #: includes/common/template-tags.php:2488
2819
  msgid "Forum: %s"
2820
  msgstr ""
2821
 
2822
- #: includes/common/template-tags.php:2492
2823
  msgid "Topic: %s"
2824
  msgstr ""
2825
 
2826
- #: includes/common/template-tags.php:2510
2827
  msgid "Your Profile"
2828
  msgstr ""
2829
 
2830
- #: includes/common/template-tags.php:2515
2831
  #: templates/default/bbpress/user-details.php:29
2832
  msgid "%s's Profile"
2833
  msgstr ""
2834
 
2835
- #: includes/common/template-tags.php:2523
2836
  msgid "Edit Your Profile"
2837
  msgstr ""
2838
 
2839
- #: includes/common/template-tags.php:2528
 
2840
  msgid "Edit %s's Profile"
2841
  msgstr ""
2842
 
2843
- #: includes/common/template-tags.php:2535
2844
  msgid "View: %s"
2845
  msgstr ""
2846
 
@@ -2886,9 +2863,9 @@ msgid "Lost Password"
2886
  msgstr ""
2887
 
2888
  #: includes/common/widgets.php:185 includes/common/widgets.php:337
2889
- #: includes/common/widgets.php:461 includes/common/widgets.php:628
2890
- #: includes/common/widgets.php:868 includes/common/widgets.php:1022
2891
- #: includes/common/widgets.php:1225
2892
  msgid "Title:"
2893
  msgstr ""
2894
 
@@ -2916,145 +2893,145 @@ msgstr ""
2916
  msgid "(bbPress) Forum Search Form"
2917
  msgstr ""
2918
 
2919
- #: includes/common/widgets.php:508
2920
  msgid "A list of forums with an option to set the parent."
2921
  msgstr ""
2922
 
2923
- #: includes/common/widgets.php:511
2924
  msgid "(bbPress) Forums List"
2925
  msgstr ""
2926
 
2927
- #: includes/common/widgets.php:634 includes/common/widgets.php:872
2928
  msgid "Parent Forum ID:"
2929
  msgstr ""
2930
 
2931
- #: includes/common/widgets.php:640 includes/common/widgets.php:878
2932
  msgid "\"0\" to show only root - \"any\" to show all"
2933
  msgstr ""
2934
 
2935
- #: includes/common/widgets.php:686
2936
  msgid "A list of recent topics, sorted by popularity or freshness."
2937
  msgstr ""
2938
 
2939
- #: includes/common/widgets.php:689
2940
  msgid "(bbPress) Recent Topics"
2941
  msgstr ""
2942
 
2943
- #: includes/common/widgets.php:806
2944
  msgctxt "widgets"
2945
  msgid "by %1$s"
2946
  msgstr ""
2947
 
2948
- #: includes/common/widgets.php:869
2949
  msgid "Maximum topics to show:"
2950
  msgstr ""
2951
 
2952
- #: includes/common/widgets.php:881 includes/common/widgets.php:1227
2953
  msgid "Show post date:"
2954
  msgstr ""
2955
 
2956
- #: includes/common/widgets.php:882
2957
  msgid "Show topic author:"
2958
  msgstr ""
2959
 
2960
- #: includes/common/widgets.php:885
2961
  msgid "Order By:"
2962
  msgstr ""
2963
 
2964
- #: includes/common/widgets.php:887
2965
  msgid "Newest Topics"
2966
  msgstr ""
2967
 
2968
- #: includes/common/widgets.php:888
2969
  #: templates/default/extras/page-forum-statistics.php:34
2970
  msgid "Popular Topics"
2971
  msgstr ""
2972
 
2973
- #: includes/common/widgets.php:889
2974
  msgid "Topics With Recent Replies"
2975
  msgstr ""
2976
 
2977
- #: includes/common/widgets.php:906
2978
  msgid "Recent Topics"
2979
  msgstr ""
2980
 
2981
- #: includes/common/widgets.php:940
2982
  msgid "Some statistics from your forum."
2983
  msgstr ""
2984
 
2985
- #: includes/common/widgets.php:943
2986
  msgid "(bbPress) Statistics"
2987
  msgstr ""
2988
 
2989
- #: includes/common/widgets.php:1040
2990
  msgid "Forum Statistics"
2991
  msgstr ""
2992
 
2993
- #: includes/common/widgets.php:1070
2994
  msgid "A list of the most recent replies."
2995
  msgstr ""
2996
 
2997
- #: includes/common/widgets.php:1073
2998
  msgid "(bbPress) Recent Replies"
2999
  msgstr ""
3000
 
3001
  #. translators: 1: reply author, 2: reply link, 3: reply timestamp
3002
- #: includes/common/widgets.php:1157
3003
  msgctxt "widgets"
3004
  msgid "%1$s on %2$s %3$s"
3005
  msgstr ""
3006
 
3007
  #. translators: 1: reply link, 2: reply timestamp
3008
- #: includes/common/widgets.php:1163
3009
  msgctxt "widgets"
3010
  msgid "%1$s %2$s"
3011
  msgstr ""
3012
 
3013
  #. translators: 1: reply author, 2: reply link
3014
- #: includes/common/widgets.php:1169
3015
  msgctxt "widgets"
3016
  msgid "%1$s on %2$s"
3017
  msgstr ""
3018
 
3019
  #. translators: 1: reply link
3020
- #: includes/common/widgets.php:1175
3021
  msgctxt "widgets"
3022
  msgid "%1$s"
3023
  msgstr ""
3024
 
3025
- #: includes/common/widgets.php:1226
3026
  msgid "Maximum replies to show:"
3027
  msgstr ""
3028
 
3029
- #: includes/common/widgets.php:1228
3030
  msgid "Show reply author:"
3031
  msgstr ""
3032
 
3033
- #: includes/common/widgets.php:1243
3034
  msgid "Recent Replies"
3035
  msgstr ""
3036
 
3037
- #: includes/core/capabilities.php:412
3038
  msgid "Keymaster"
3039
  msgstr ""
3040
 
3041
- #: includes/core/capabilities.php:418
3042
  msgid "Moderator"
3043
  msgstr ""
3044
 
3045
- #: includes/core/capabilities.php:424
3046
  msgid "Participant"
3047
  msgstr ""
3048
 
3049
- #: includes/core/capabilities.php:430
3050
  msgid "Spectator"
3051
  msgstr ""
3052
 
3053
- #: includes/core/capabilities.php:436
3054
  msgid "Blocked"
3055
  msgstr ""
3056
 
3057
- #: includes/core/capabilities.php:555 includes/core/capabilities.php:565
3058
  msgid "Editable forum roles no longer exist."
3059
  msgstr ""
3060
 
@@ -3062,157 +3039,149 @@ msgstr ""
3062
  msgid "The current user is being initialized without using $wp->init()."
3063
  msgstr ""
3064
 
3065
- #: includes/core/update.php:172
3066
  msgid "General"
3067
  msgstr ""
3068
 
3069
- #: includes/core/update.php:173
3070
  msgid "General chit-chat"
3071
  msgstr ""
3072
 
3073
- #: includes/core/update.php:174
3074
  msgid "Hello World!"
3075
  msgstr ""
3076
 
3077
- #: includes/core/update.php:175
3078
  msgid "I am the first topic in your new forums."
3079
  msgstr ""
3080
 
3081
- #: includes/core/update.php:176
3082
  msgid "Re: Hello World!"
3083
  msgstr ""
3084
 
3085
- #: includes/core/update.php:177
3086
  msgid "Oh, and this is what a reply looks like."
3087
  msgstr ""
3088
 
3089
- #: includes/extend/akismet.php:304
3090
  msgid "%1$s reported this %2$s as spam"
3091
  msgstr ""
3092
 
3093
- #: includes/extend/akismet.php:311
3094
  msgid "%1$s reported this %2$s as not spam"
3095
  msgstr ""
3096
 
3097
- #: includes/extend/akismet.php:400
3098
  msgid "No response"
3099
  msgstr ""
3100
 
3101
- #: includes/extend/akismet.php:458
3102
  msgid "Akismet caught this post as spam"
3103
  msgstr ""
3104
 
3105
- #: includes/extend/akismet.php:462 includes/extend/akismet.php:477
3106
  msgid "Post status was changed to %s"
3107
  msgstr ""
3108
 
3109
- #: includes/extend/akismet.php:470
3110
- msgid "Akismet cleared this post"
3111
  msgstr ""
3112
 
3113
- #: includes/extend/akismet.php:484
3114
  msgid ""
3115
  "Akismet was unable to check this post (response: %s), will automatically "
3116
  "retry again later."
3117
  msgstr ""
3118
 
3119
- #: includes/extend/buddypress/activity.php:197
 
 
 
 
 
 
 
 
3120
  msgid "New forum topic"
3121
  msgstr ""
3122
 
3123
- #: includes/extend/buddypress/activity.php:198
3124
  msgid "New forum reply"
3125
  msgstr ""
3126
 
3127
- #: includes/extend/buddypress/activity.php:423
3128
  msgid "%1$s started the topic %2$s in the forum %3$s"
3129
  msgstr ""
3130
 
3131
- #: includes/extend/buddypress/activity.php:573
3132
  msgid "%1$s replied to the topic %2$s in the forum %3$s"
3133
  msgstr ""
3134
 
3135
- #: includes/extend/buddypress/group.php:268
3136
- #: includes/extend/buddypress/group.php:271
3137
  msgid "Group Forum Settings"
3138
  msgstr ""
3139
 
3140
- #: includes/extend/buddypress/group.php:272
3141
- #: includes/extend/buddypress/group.php:468
3142
  msgid ""
3143
  "Create a discussion forum to allow members of this group to communicate in a "
3144
  "structured, bulletin-board style fashion."
3145
  msgstr ""
3146
 
3147
- #: includes/extend/buddypress/group.php:276
3148
- #: includes/extend/buddypress/group.php:471
3149
  msgid "Yes. I want this group to have a forum."
3150
  msgstr ""
3151
 
3152
- #: includes/extend/buddypress/group.php:279
3153
  msgid "Saying no will not delete existing forum content."
3154
  msgstr ""
3155
 
3156
- #: includes/extend/buddypress/group.php:284
3157
  msgid "Group Forum:"
3158
  msgstr ""
3159
 
3160
- #: includes/extend/buddypress/group.php:292
3161
  msgid ""
3162
  "Network administrators can reconfigure which forum belongs to this group."
3163
  msgstr ""
3164
 
3165
- #: includes/extend/buddypress/group.php:297
3166
  msgid "Save Settings"
3167
  msgstr ""
3168
 
3169
- #: includes/extend/buddypress/group.php:332
3170
- #: includes/extend/buddypress/group.php:489 includes/forums/functions.php:118
3171
- #: includes/forums/functions.php:394 includes/replies/functions.php:114
3172
- #: includes/replies/functions.php:419 includes/replies/functions.php:1092
3173
- #: includes/topics/functions.php:120 includes/topics/functions.php:482
3174
- #: includes/topics/functions.php:1106 includes/topics/functions.php:1405
3175
- #: includes/topics/functions.php:1752 includes/topics/functions.php:1791
3176
- #: includes/topics/functions.php:1848 includes/users/functions.php:463
3177
- #: includes/users/functions.php:781 includes/users/functions.php:906
3178
- #: includes/users/functions.php:912
3179
  msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
3180
  msgstr ""
3181
 
3182
- #: includes/extend/buddypress/group.php:430
3183
  msgctxt "group admin edit screen"
3184
  msgid "Discussion Forum"
3185
  msgstr ""
3186
 
3187
- #: includes/extend/buddypress/group.php:466
3188
  msgid "Group Forum"
3189
  msgstr ""
3190
 
3191
- #: includes/extend/buddypress/group.php:757
3192
  msgid "This group does not currently have a forum."
3193
  msgstr ""
3194
 
3195
- #: includes/extend/buddypress/loader.php:99
3196
  msgid "Search Forums..."
3197
  msgstr ""
3198
 
3199
- #: includes/extend/buddypress/loader.php:191
3200
- #: includes/extend/buddypress/loader.php:267
3201
- #: templates/default/bbpress/user-details.php:35
3202
- msgid "Topics Started"
3203
- msgstr ""
3204
-
3205
- #: includes/extend/buddypress/loader.php:202
3206
- #: includes/extend/buddypress/loader.php:275
3207
- #: templates/default/bbpress/user-details.php:41
3208
- msgid "Replies Created"
3209
- msgstr ""
3210
-
3211
- #: includes/extend/buddypress/loader.php:283
3212
- msgid "Favorite Topics"
3213
- msgstr ""
3214
-
3215
- #: includes/extend/buddypress/loader.php:291
3216
  msgid "Subscribed Topics"
3217
  msgstr ""
3218
 
@@ -3221,50 +3190,50 @@ msgid ""
3221
  "<strong>ERROR</strong>: You do not have permission to create new forums."
3222
  msgstr ""
3223
 
3224
- #: includes/forums/functions.php:154 includes/forums/functions.php:453
3225
  msgid "<strong>ERROR</strong>: Your forum needs a title."
3226
  msgstr ""
3227
 
3228
- #: includes/forums/functions.php:166 includes/forums/functions.php:465
3229
  msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
3230
  msgstr ""
3231
 
3232
- #: includes/forums/functions.php:179
3233
  msgid "<strong>ERROR</strong>: Your forum must have a parent."
3234
  msgstr ""
3235
 
3236
- #: includes/forums/functions.php:186
3237
  msgid ""
3238
  "<strong>ERROR</strong>: This forum is a category. No forums can be created "
3239
  "in this forum."
3240
  msgstr ""
3241
 
3242
- #: includes/forums/functions.php:191 includes/forums/functions.php:429
3243
  msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
3244
  msgstr ""
3245
 
3246
- #: includes/forums/functions.php:196 includes/forums/functions.php:434
3247
  msgid ""
3248
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3249
  "capability to read or create new forums in it."
3250
  msgstr ""
3251
 
3252
- #: includes/forums/functions.php:201 includes/forums/functions.php:439
3253
  msgid ""
3254
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3255
  "capability to read or create new forums in it."
3256
  msgstr ""
3257
 
3258
- #: includes/forums/functions.php:208 includes/replies/functions.php:203
3259
- #: includes/topics/functions.php:230
3260
  msgid "<strong>ERROR</strong>: Slow down; you move too fast."
3261
  msgstr ""
3262
 
3263
- #: includes/forums/functions.php:213
3264
  msgid "<strong>ERROR</strong>: This forum already exists."
3265
  msgstr ""
3266
 
3267
- #: includes/forums/functions.php:218
3268
  msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
3269
  msgstr ""
3270
 
@@ -3280,725 +3249,790 @@ msgstr ""
3280
  msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
3281
  msgstr ""
3282
 
3283
- #: includes/forums/functions.php:470
3284
  msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
3285
  msgstr ""
3286
 
3287
- #: includes/forums/template-tags.php:1120
3288
- #: includes/forums/template-tags.php:1858
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3289
  msgid "%s topic"
3290
  msgid_plural "%s topics"
3291
  msgstr[0] ""
3292
  msgstr[1] ""
3293
 
3294
- #: includes/forums/template-tags.php:1136
3295
- #: includes/topics/template-tags.php:1952
3296
  msgid " (+ %d hidden)"
3297
  msgstr ""
3298
 
3299
- #: includes/forums/template-tags.php:1847
3300
- #: includes/topics/template-tags.php:1936
3301
  msgid "%s reply"
3302
  msgid_plural "%s replies"
3303
  msgstr[0] ""
3304
  msgstr[1] ""
3305
 
3306
- #: includes/forums/template-tags.php:1867
3307
  msgid ""
3308
  "This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
3309
  msgstr ""
3310
 
3311
- #: includes/forums/template-tags.php:1869
3312
  msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
3313
  msgstr ""
3314
 
3315
- #: includes/forums/template-tags.php:1875
3316
  msgid "This category contains %1$s, and was last updated by %2$s %3$s."
3317
  msgstr ""
3318
 
3319
- #: includes/forums/template-tags.php:1877
3320
  msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
3321
  msgstr ""
3322
 
3323
- #: includes/forums/template-tags.php:1887
3324
  msgid "This category contains %1$s and %2$s."
3325
  msgstr ""
3326
 
3327
- #: includes/forums/template-tags.php:1889
3328
  msgid "This forum contains %1$s and %2$s."
3329
  msgstr ""
3330
 
3331
- #: includes/forums/template-tags.php:1897
3332
  msgid "This category contains %1$s."
3333
  msgstr ""
3334
 
3335
- #: includes/forums/template-tags.php:1899
3336
  msgid "This forum contains %1$s."
3337
  msgstr ""
3338
 
3339
- #: includes/forums/template-tags.php:1903
3340
  msgid "This forum is empty."
3341
  msgstr ""
3342
 
3343
- #: includes/forums/template-tags.php:2139
3344
- msgid "Category"
3345
  msgstr ""
3346
 
3347
- #: includes/forums/template-tags.php:2176
3348
- msgctxt "Forum Status"
3349
- msgid "Open"
3350
  msgstr ""
3351
 
3352
- #: includes/forums/template-tags.php:2177
3353
- msgctxt "Forum Status"
3354
- msgid "Closed"
3355
  msgstr ""
3356
 
3357
- #: includes/forums/template-tags.php:2214
3358
- msgid "Public"
3359
  msgstr ""
3360
 
3361
- #: includes/forums/template-tags.php:2215
3362
- #: templates/default/bbpress/feedback-no-access.php:13
3363
- msgid "Private"
3364
  msgstr ""
3365
 
3366
- #: includes/forums/template-tags.php:2216
3367
- msgid "Hidden"
 
 
3368
  msgstr ""
3369
 
3370
- #: includes/replies/functions.php:140
3371
- msgid "<strong>ERROR</strong>: You do not have permission to reply."
3372
  msgstr ""
3373
 
3374
- #: includes/replies/functions.php:154
3375
- msgid "<strong>ERROR</strong>: Topic ID is missing."
3376
  msgstr ""
3377
 
3378
- #: includes/replies/functions.php:165 includes/topics/functions.php:190
3379
- #: includes/topics/functions.php:496
3380
- msgid "<strong>ERROR</strong>: Forum ID is missing."
3381
  msgstr ""
3382
 
3383
- #: includes/replies/functions.php:186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3384
  msgid "<strong>ERROR</strong>: Your reply needs a title."
3385
  msgstr ""
3386
 
3387
- #: includes/replies/functions.php:198 includes/replies/functions.php:503
3388
  msgid "<strong>ERROR</strong>: Your reply cannot be empty."
3389
  msgstr ""
3390
 
3391
- #: includes/replies/functions.php:208
3392
  msgid ""
3393
  "<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
3394
  "you&#8217;ve already said that!"
3395
  msgstr ""
3396
 
3397
- #: includes/replies/functions.php:213
3398
  msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
3399
  msgstr ""
3400
 
3401
- #: includes/replies/functions.php:282 includes/replies/functions.php:587
 
 
 
 
3402
  msgid ""
3403
  "<strong>ERROR</strong>: There was a problem adding the tags to the topic."
3404
  msgstr ""
3405
 
3406
- #: includes/replies/functions.php:408
3407
  msgid "<strong>ERROR</strong>: Reply ID not found."
3408
  msgstr ""
3409
 
3410
- #: includes/replies/functions.php:425
3411
  msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
3412
  msgstr ""
3413
 
3414
- #: includes/replies/functions.php:436
3415
  msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
3416
  msgstr ""
3417
 
3418
- #: includes/replies/functions.php:470
3419
- msgid ""
3420
- "<strong>ERROR</strong>: This forum is a category. No topics or replies can "
3421
- "be created in it."
3422
- msgstr ""
3423
-
3424
- #: includes/replies/functions.php:474
3425
- msgid ""
3426
- "<strong>ERROR</strong>: This forum has been closed to new topics and replies."
3427
- msgstr ""
3428
-
3429
- #: includes/replies/functions.php:478
3430
- msgid ""
3431
- "<strong>ERROR</strong>: This forum is private and you do not have the "
3432
- "capability to read or create new replies in it."
3433
- msgstr ""
3434
-
3435
- #: includes/replies/functions.php:482
3436
- msgid ""
3437
- "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3438
- "capability to read or create new replies in it."
3439
- msgstr ""
3440
-
3441
- #: includes/replies/functions.php:508
3442
  msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
3443
  msgstr ""
3444
 
3445
- #: includes/replies/functions.php:1069
3446
  msgid "<strong>ERROR</strong>: Reply ID to move not found!"
3447
  msgstr ""
3448
 
3449
- #: includes/replies/functions.php:1078
3450
  msgid "<strong>ERROR</strong>: The reply you want to move was not found."
3451
  msgstr ""
3452
 
3453
- #: includes/replies/functions.php:1087
3454
  msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
3455
  msgstr ""
3456
 
3457
- #: includes/replies/functions.php:1098 includes/topics/functions.php:1117
3458
- #: includes/topics/functions.php:1411
3459
  msgid ""
3460
  "<strong>ERROR</strong>: You do not have the permissions to edit the source "
3461
  "topic."
3462
  msgstr ""
3463
 
3464
- #: includes/replies/functions.php:1108
3465
  msgid "<strong>ERROR</strong>: You need to choose a valid move option."
3466
  msgstr ""
3467
 
3468
- #: includes/replies/functions.php:1121 includes/topics/functions.php:1432
3469
  msgid "<strong>ERROR</strong>: Destination topic ID not found!"
3470
  msgstr ""
3471
 
3472
- #: includes/replies/functions.php:1131
3473
  msgid "<strong>ERROR</strong>: The topic you want to move to was not found!"
3474
  msgstr ""
3475
 
3476
- #: includes/replies/functions.php:1136 includes/topics/functions.php:1445
3477
  msgid ""
3478
  "<strong>ERROR</strong>: You do not have the permissions to edit the "
3479
  "destination topic!"
3480
  msgstr ""
3481
 
3482
- #: includes/replies/functions.php:1196 includes/topics/functions.php:1484
3483
  msgid ""
3484
  "<strong>ERROR</strong>: There was a problem converting the reply into the "
3485
  "topic. Please try again."
3486
  msgstr ""
3487
 
3488
- #: includes/replies/functions.php:1201 includes/topics/functions.php:1489
3489
  msgid ""
3490
  "<strong>ERROR</strong>: You do not have the permissions to create new "
3491
  "topics. The reply could not be converted into a topic."
3492
  msgstr ""
3493
 
3494
- #: includes/replies/functions.php:1370
3495
  msgid "<strong>ERROR:</strong> You do not have the permission to do that!"
3496
  msgstr ""
3497
 
3498
- #: includes/replies/functions.php:1383
3499
  msgid ""
3500
  "<strong>ERROR</strong>: There was a problem unmarking the reply as spam!"
3501
  msgstr ""
3502
 
3503
- #: includes/replies/functions.php:1383
3504
  msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam!"
3505
  msgstr ""
3506
 
3507
- #: includes/replies/functions.php:1402
3508
  msgid "<strong>ERROR</strong>: There was a problem trashing the reply!"
3509
  msgstr ""
3510
 
3511
- #: includes/replies/functions.php:1410
3512
  msgid "<strong>ERROR</strong>: There was a problem untrashing the reply!"
3513
  msgstr ""
3514
 
3515
- #: includes/replies/functions.php:1418
3516
  msgid "<strong>ERROR</strong>: There was a problem deleting the reply!"
3517
  msgstr ""
3518
 
3519
- #: includes/replies/functions.php:1832
3520
  msgid "All Posts"
3521
  msgstr ""
3522
 
3523
- #: includes/replies/functions.php:1874 includes/topics/functions.php:3356
3524
  msgid "Replies: %s"
3525
  msgstr ""
3526
 
3527
- #: includes/replies/template-tags.php:578
3528
- #: includes/topics/template-tags.php:743
3529
  msgctxt "date at time"
3530
  msgid "%1$s at %2$s"
3531
  msgstr ""
3532
 
3533
- #: includes/replies/template-tags.php:676
3534
  msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
3535
  msgstr ""
3536
 
3537
- #: includes/replies/template-tags.php:678
3538
  msgid "This reply was modified %1$s by %2$s."
3539
  msgstr ""
3540
 
3541
- #: includes/replies/template-tags.php:964
3542
- #: includes/topics/template-tags.php:1291 includes/users/template-tags.php:165
3543
  msgid "Anonymous"
3544
  msgstr ""
3545
 
3546
- #: includes/replies/template-tags.php:1077
3547
- #: includes/topics/template-tags.php:1404
3548
- #: includes/users/template-tags.php:1419
3549
  msgid "View %s's profile"
3550
  msgstr ""
3551
 
3552
- #: includes/replies/template-tags.php:1077
3553
- #: includes/topics/template-tags.php:1404
3554
- #: includes/users/template-tags.php:1419
3555
  msgid "Visit %s's website"
3556
  msgstr ""
3557
 
3558
- #: includes/replies/template-tags.php:1710
3559
- #: includes/topics/template-tags.php:2458
 
 
 
3560
  #: templates/default/bbpress/form-topic-tag.php:88
3561
  #: templates/default/bbpress/form-topic-tag.php:101
3562
  msgid "Delete"
3563
  msgstr ""
3564
 
3565
- #: includes/replies/template-tags.php:1727
3566
- #: includes/topics/template-tags.php:2475
3567
  msgid "Are you sure you want to delete that permanently?"
3568
  msgstr ""
3569
 
3570
- #: includes/replies/template-tags.php:1780
3571
- #: includes/topics/template-tags.php:2714
3572
  msgid "Unspam"
3573
  msgstr ""
3574
 
3575
- #: includes/replies/template-tags.php:1843
3576
  msgid "Move"
3577
  msgstr ""
3578
 
3579
- #: includes/replies/template-tags.php:1844
3580
  msgid "Move this reply"
3581
  msgstr ""
3582
 
3583
- #: includes/replies/template-tags.php:1910
3584
  msgid "Split"
3585
  msgstr ""
3586
 
3587
- #: includes/replies/template-tags.php:1911
3588
  msgid "Split the topic from this reply"
3589
  msgstr ""
3590
 
3591
- #: includes/replies/template-tags.php:2018
 
 
 
 
 
 
3592
  msgid "Viewing %1$s reply"
3593
  msgid_plural "Viewing %1$s replies"
3594
  msgstr[0] ""
3595
  msgstr[1] ""
3596
 
3597
- #: includes/replies/template-tags.php:2022
3598
  msgid "Viewing %2$s replies (of %4$s total)"
3599
  msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
3600
  msgstr[0] ""
3601
  msgstr[1] ""
3602
 
3603
- #: includes/replies/template-tags.php:2030
3604
  msgid "Viewing %1$s post"
3605
  msgid_plural "Viewing %1$s posts"
3606
  msgstr[0] ""
3607
  msgstr[1] ""
3608
 
3609
- #: includes/replies/template-tags.php:2034
3610
  msgid "Viewing %2$s post (of %4$s total)"
3611
  msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
3612
  msgstr[0] ""
3613
  msgstr[1] ""
3614
 
3615
- #: includes/search/template-tags.php:217
3616
  msgid "Search Results for '%s'"
3617
  msgstr ""
3618
 
3619
- #: includes/search/template-tags.php:332
3620
  msgid "Viewing %1$s result"
3621
  msgid_plural "Viewing %1$s results"
3622
  msgstr[0] ""
3623
  msgstr[1] ""
3624
 
3625
- #: includes/search/template-tags.php:336
3626
  msgid "Viewing %2$s results (of %4$s total)"
3627
  msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
3628
  msgstr[0] ""
3629
  msgstr[1] ""
3630
 
3631
- #: includes/topics/functions.php:148
3632
  msgid ""
3633
  "<strong>ERROR</strong>: You do not have permission to create new topics."
3634
  msgstr ""
3635
 
3636
- #: includes/topics/functions.php:172 includes/topics/functions.php:546
3637
  msgid "<strong>ERROR</strong>: Your topic needs a title."
3638
  msgstr ""
3639
 
3640
- #: includes/topics/functions.php:184 includes/topics/functions.php:558
3641
  msgid "<strong>ERROR</strong>: Your topic cannot be empty."
3642
  msgstr ""
3643
 
3644
- #: includes/topics/functions.php:202
3645
  msgid ""
3646
  "<strong>ERROR</strong>: This forum is a category. No topics can be created "
3647
  "in this forum."
3648
  msgstr ""
3649
 
3650
- #: includes/topics/functions.php:209 includes/topics/functions.php:518
3651
  msgid "<strong>ERROR</strong>: This forum has been closed to new topics."
3652
  msgstr ""
3653
 
3654
- #: includes/topics/functions.php:215 includes/topics/functions.php:524
3655
  msgid ""
3656
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3657
  "capability to read or create new topics in it."
3658
  msgstr ""
3659
 
3660
- #: includes/topics/functions.php:221 includes/topics/functions.php:530
3661
  msgid ""
3662
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3663
  "capability to read or create new topics in it."
3664
  msgstr ""
3665
 
3666
- #: includes/topics/functions.php:235
3667
  msgid ""
3668
  "<strong>ERROR</strong>: Duplicate topic detected; it looks as though "
3669
  "you&#8217;ve already said that!"
3670
  msgstr ""
3671
 
3672
- #: includes/topics/functions.php:240
3673
  msgid "<strong>ERROR</strong>: Your topic cannot be created at this time."
3674
  msgstr ""
3675
 
3676
- #: includes/topics/functions.php:444 includes/topics/functions.php:1099
3677
  msgid "<strong>ERROR</strong>: Topic ID not found."
3678
  msgstr ""
3679
 
3680
- #: includes/topics/functions.php:455
3681
  msgid "<strong>ERROR</strong>: The topic you want to edit was not found."
3682
  msgstr ""
3683
 
3684
- #: includes/topics/functions.php:466
3685
  msgid "<strong>ERROR</strong>: You do not have permission to edit that topic."
3686
  msgstr ""
3687
 
3688
- #: includes/topics/functions.php:511
3689
  msgid ""
3690
  "<strong>ERROR</strong>: This forum is a category. No topics can be created "
3691
  "in it."
3692
  msgstr ""
3693
 
3694
- #: includes/topics/functions.php:563
3695
  msgid "<strong>ERROR</strong>: Your topic cannot be edited at this time."
3696
  msgstr ""
3697
 
3698
- #: includes/topics/functions.php:1111
3699
  msgid "<strong>ERROR</strong>: The topic you want to merge was not found."
3700
  msgstr ""
3701
 
3702
- #: includes/topics/functions.php:1125
3703
  msgid "<strong>ERROR</strong>: Destination topic ID not found."
3704
  msgstr ""
3705
 
3706
- #: includes/topics/functions.php:1131
3707
  msgid "<strong>ERROR</strong>: The topic you want to merge to was not found."
3708
  msgstr ""
3709
 
3710
- #: includes/topics/functions.php:1135
3711
  msgid ""
3712
  "<strong>ERROR</strong>: You do not have the permissions to edit the "
3713
  "destination topic."
3714
  msgstr ""
3715
 
3716
- #: includes/topics/functions.php:1384
3717
  msgid "<strong>ERROR</strong>: Reply ID to split the topic from not found!"
3718
  msgstr ""
3719
 
3720
- #: includes/topics/functions.php:1392
3721
  msgid "<strong>ERROR</strong>: The reply you want to split from was not found."
3722
  msgstr ""
3723
 
3724
- #: includes/topics/functions.php:1401
3725
  msgid "<strong>ERROR</strong>: The topic you want to split was not found."
3726
  msgstr ""
3727
 
3728
- #: includes/topics/functions.php:1419
3729
  msgid "<strong>ERROR</strong>: You need to choose a valid split option."
3730
  msgstr ""
3731
 
3732
- #: includes/topics/functions.php:1441
3733
  msgid "<strong>ERROR</strong>: The topic you want to split to was not found!"
3734
  msgstr ""
3735
 
3736
- #: includes/topics/functions.php:1740
3737
  msgid ""
3738
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3739
  "getting the tag: %s"
3740
  msgstr ""
3741
 
3742
- #: includes/topics/functions.php:1758 includes/topics/functions.php:1797
3743
  msgid ""
3744
  "<strong>ERROR</strong>: You do not have the permissions to edit the topic "
3745
  "tags."
3746
  msgstr ""
3747
 
3748
- #: includes/topics/functions.php:1764 includes/topics/functions.php:1803
3749
  msgid "<strong>ERROR</strong>: You need to enter a tag name."
3750
  msgstr ""
3751
 
3752
- #: includes/topics/functions.php:1774
3753
  msgid ""
3754
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3755
  "updating the tag: %s"
3756
  msgstr ""
3757
 
3758
- #: includes/topics/functions.php:1813 includes/topics/functions.php:1831
3759
  msgid ""
3760
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3761
  "merging the tags: %s"
3762
  msgstr ""
3763
 
3764
- #: includes/topics/functions.php:1822
3765
  msgid ""
3766
  "<strong>ERROR</strong>: The tags which are being merged can not be the same."
3767
  msgstr ""
3768
 
3769
- #: includes/topics/functions.php:1854
3770
  msgid ""
3771
  "<strong>ERROR</strong>: You do not have the permissions to delete the topic "
3772
  "tags."
3773
  msgstr ""
3774
 
3775
- #: includes/topics/functions.php:1863
3776
  msgid ""
3777
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3778
  "deleting the tag: %s"
3779
  msgstr ""
3780
 
3781
- #: includes/topics/functions.php:1988
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3782
  msgid "<strong>ERROR:</strong> You do not have the permission to do that."
3783
  msgstr ""
3784
 
3785
- #: includes/topics/functions.php:2001
3786
  msgid "<strong>ERROR</strong>: There was a problem closing the topic."
3787
  msgstr ""
3788
 
3789
- #: includes/topics/functions.php:2001
3790
  msgid "<strong>ERROR</strong>: There was a problem opening the topic."
3791
  msgstr ""
3792
 
3793
- #: includes/topics/functions.php:2012
3794
  msgid "<strong>ERROR</strong>: There was a problem unsticking the topic."
3795
  msgstr ""
3796
 
3797
- #: includes/topics/functions.php:2012
3798
  msgid "<strong>ERROR</strong>: There was a problem sticking the topic."
3799
  msgstr ""
3800
 
3801
- #: includes/topics/functions.php:2022
3802
  msgid ""
3803
  "<strong>ERROR</strong>: There was a problem unmarking the topic as spam."
3804
  msgstr ""
3805
 
3806
- #: includes/topics/functions.php:2022
3807
  msgid "<strong>ERROR</strong>: There was a problem marking the topic as spam."
3808
  msgstr ""
3809
 
3810
- #: includes/topics/functions.php:2041
3811
  msgid "<strong>ERROR</strong>: There was a problem trashing the topic."
3812
  msgstr ""
3813
 
3814
- #: includes/topics/functions.php:2049
3815
  msgid "<strong>ERROR</strong>: There was a problem untrashing the topic."
3816
  msgstr ""
3817
 
3818
- #: includes/topics/functions.php:2057
3819
  msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
3820
  msgstr ""
3821
 
3822
- #: includes/topics/template-tags.php:920
3823
  msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
3824
  msgstr ""
3825
 
3826
- #: includes/topics/template-tags.php:922
3827
  msgid "This topic was modified %1$s by %2$s."
3828
  msgstr ""
3829
 
3830
- #: includes/topics/template-tags.php:2129
3831
  msgid "Tagged:"
3832
  msgstr ""
3833
 
3834
- #: includes/topics/template-tags.php:2526
3835
  msgctxt "Topic Status"
3836
  msgid "Close"
3837
  msgstr ""
3838
 
3839
- #: includes/topics/template-tags.php:2527
3840
  msgctxt "Topic Status"
3841
  msgid "Open"
3842
  msgstr ""
3843
 
3844
- #: includes/topics/template-tags.php:2657
3845
  #: templates/default/bbpress/form-topic-tag.php:59
3846
  #: templates/default/bbpress/form-topic-tag.php:73
3847
  msgid "Merge"
3848
  msgstr ""
3849
 
3850
- #: includes/topics/template-tags.php:2767
3851
  msgid "Viewing %1$s topic"
3852
  msgid_plural "Viewing %1$s topics"
3853
  msgstr[0] ""
3854
  msgstr[1] ""
3855
 
3856
- #: includes/topics/template-tags.php:2771
3857
  msgid "Viewing topic %2$s (of %4$s total)"
3858
  msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
3859
  msgstr[0] ""
3860
  msgstr[1] ""
3861
 
3862
- #: includes/topics/template-tags.php:2831
3863
  msgid "This topic is marked as spam."
3864
  msgstr ""
3865
 
3866
- #: includes/topics/template-tags.php:2836
3867
  msgid "This topic is in the trash."
3868
  msgstr ""
3869
 
3870
- #: includes/topics/template-tags.php:2875
3871
- msgid "Normal"
3872
- msgstr ""
3873
-
3874
- #: includes/topics/template-tags.php:2876
3875
- msgid "Sticky"
3876
- msgstr ""
3877
-
3878
- #: includes/topics/template-tags.php:2877
3879
- msgid "Super Sticky"
3880
- msgstr ""
3881
-
3882
- #: includes/topics/template-tags.php:2995
3883
  msgid "%s voice"
3884
  msgid_plural "%s voices"
3885
  msgstr[0] ""
3886
  msgstr[1] ""
3887
 
3888
- #: includes/topics/template-tags.php:3001
3889
  msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
3890
  msgstr ""
3891
 
3892
- #: includes/topics/template-tags.php:3005
3893
  msgid "This topic contains %1$s and has %2$s."
3894
  msgstr ""
3895
 
3896
- #: includes/topics/template-tags.php:3009
3897
  msgid "This topic has no replies."
3898
  msgstr ""
3899
 
3900
- #: includes/users/functions.php:459
3901
  msgid ""
3902
  "<strong>ERROR</strong>: No topic was found! Which topic are you marking/"
3903
  "unmarking as favorite?"
3904
  msgstr ""
3905
 
3906
- #: includes/users/functions.php:467 includes/users/functions.php:785
3907
  msgid ""
3908
  "<strong>ERROR</strong>: You don't have the permission to edit favorites of "
3909
  "that user!"
3910
  msgstr ""
3911
 
3912
- #: includes/users/functions.php:510
3913
  msgid ""
3914
  "<strong>ERROR</strong>: There was a problem removing that topic from "
3915
  "favorites!"
3916
  msgstr ""
3917
 
3918
- #: includes/users/functions.php:512
3919
  msgid "<strong>ERROR</strong>: There was a problem favoriting that topic!"
3920
  msgstr ""
3921
 
3922
- #: includes/users/functions.php:777
3923
  msgid ""
3924
  "<strong>ERROR</strong>: No topic was found! Which topic are you subscribing/"
3925
  "unsubscribing to?"
3926
  msgstr ""
3927
 
3928
- #: includes/users/functions.php:828
3929
  msgid ""
3930
  "<strong>ERROR</strong>: There was a problem unsubscribing from that topic!"
3931
  msgstr ""
3932
 
3933
- #: includes/users/functions.php:830
3934
  msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic!"
3935
  msgstr ""
3936
 
3937
- #: includes/users/template-tags.php:487
3938
  msgid "Guest"
3939
  msgstr ""
3940
 
3941
- #: includes/users/template-tags.php:491
3942
  msgid "Inactive"
3943
  msgstr ""
3944
 
3945
- #: includes/users/template-tags.php:501
3946
  msgid "Member"
3947
  msgstr ""
3948
 
3949
- #: includes/users/template-tags.php:541
3950
  msgid "Admin"
3951
  msgstr ""
3952
 
3953
- #: includes/users/template-tags.php:707
3954
  msgid "Favorite"
3955
  msgstr ""
3956
 
3957
- #: includes/users/template-tags.php:708
3958
  msgid "Favorited"
3959
  msgstr ""
3960
 
3961
- #: includes/users/template-tags.php:865
3962
  msgid "Subscribe"
3963
  msgstr ""
3964
 
3965
- #: includes/users/template-tags.php:866
3966
  msgid "Unsubscribe"
3967
  msgstr ""
3968
 
3969
- #: includes/users/template-tags.php:933
3970
  msgid "User updated."
3971
  msgstr ""
3972
 
3973
- #: includes/users/template-tags.php:958
3974
  msgid "You have super admin privileges."
3975
  msgstr ""
3976
 
3977
- #: includes/users/template-tags.php:958
3978
  msgid "This user has super admin privileges."
3979
  msgstr ""
3980
 
3981
- #: includes/users/template-tags.php:1023
3982
  msgid "&mdash; No role for this site &mdash;"
3983
  msgstr ""
3984
 
3985
- #: includes/users/template-tags.php:1221
3986
  msgid "You are now logged out."
3987
  msgstr ""
3988
 
3989
- #: includes/users/template-tags.php:1225
3990
  msgid "New user registration is currently not allowed."
3991
  msgstr ""
3992
 
3993
- #: includes/users/template-tags.php:1234
3994
  msgid "Check your e-mail for the confirmation link."
3995
  msgstr ""
3996
 
3997
- #: includes/users/template-tags.php:1239
3998
  msgid "Check your e-mail for your new password."
3999
  msgstr ""
4000
 
4001
- #: includes/users/template-tags.php:1244
4002
  msgid "Registration complete. Please check your e-mail."
4003
  msgstr ""
4004
 
@@ -4022,6 +4056,10 @@ msgstr ""
4022
  msgid "You are already logged in."
4023
  msgstr ""
4024
 
 
 
 
 
4025
  #: templates/default/bbpress/feedback-no-access.php:16
4026
  msgid "You do not have permission to view this forum."
4027
  msgstr ""
@@ -4079,44 +4117,40 @@ msgstr ""
4079
  msgid "Forum Name (Maximum Length: %d):"
4080
  msgstr ""
4081
 
4082
- #: templates/default/bbpress/form-forum.php:78
4083
- msgid "Forum Description:"
4084
- msgstr ""
4085
-
4086
- #: templates/default/bbpress/form-forum.php:93
4087
- #: templates/default/bbpress/form-reply.php:75
4088
- #: templates/default/bbpress/form-topic.php:101
4089
  msgid ""
4090
  "You may use these <abbr title=\"HyperText Markup Language\">HTML</abbr> tags "
4091
  "and attributes:"
4092
  msgstr ""
4093
 
4094
- #: templates/default/bbpress/form-forum.php:102
4095
  msgid "Forum Type:"
4096
  msgstr ""
4097
 
4098
- #: templates/default/bbpress/form-forum.php:134
4099
  msgid "(No Parent)"
4100
  msgstr ""
4101
 
4102
- #: templates/default/bbpress/form-forum.php:149
4103
  #: templates/default/bbpress/form-reply-move.php:73
4104
- #: templates/default/bbpress/form-reply.php:145
4105
  #: templates/default/bbpress/form-topic-merge.php:94
4106
  #: templates/default/bbpress/form-topic-split.php:98
4107
- #: templates/default/bbpress/form-topic.php:198
4108
  msgid "Submit"
4109
  msgstr ""
4110
 
4111
- #: templates/default/bbpress/form-forum.php:172
4112
  msgid "The forum &#8216;%s&#8217; is closed to new content."
4113
  msgstr ""
4114
 
4115
- #: templates/default/bbpress/form-forum.php:180
4116
  msgid "You cannot create new forums."
4117
  msgstr ""
4118
 
4119
- #: templates/default/bbpress/form-forum.php:180
4120
  msgid "You must be logged in to create new forums."
4121
  msgstr ""
4122
 
@@ -4183,53 +4217,44 @@ msgid ""
4183
  "capabilities still allow you to do so."
4184
  msgstr ""
4185
 
4186
- #: templates/default/bbpress/form-reply.php:60
4187
- msgid "Reply:"
4188
- msgstr ""
4189
-
4190
- #: templates/default/bbpress/form-reply.php:86
4191
  msgid "Tags:"
4192
  msgstr ""
4193
 
4194
- #: templates/default/bbpress/form-reply.php:104
4195
- #: templates/default/bbpress/form-topic.php:158
4196
  msgid "Notify the author of follow-up replies via email"
4197
  msgstr ""
4198
 
4199
- #: templates/default/bbpress/form-reply.php:108
4200
- #: templates/default/bbpress/form-topic.php:162
4201
  msgid "Notify me of follow-up replies via email"
4202
  msgstr ""
4203
 
4204
- #: templates/default/bbpress/form-reply.php:123
4205
- #: templates/default/bbpress/form-topic.php:176
4206
- msgid "Revision"
4207
- msgstr ""
4208
-
4209
- #: templates/default/bbpress/form-reply.php:126
4210
- #: templates/default/bbpress/form-topic.php:179
4211
  msgid "Keep a log of this edit:"
4212
  msgstr ""
4213
 
4214
- #: templates/default/bbpress/form-reply.php:130
4215
- #: templates/default/bbpress/form-topic.php:183
4216
  msgid "Optional reason for editing:"
4217
  msgstr ""
4218
 
4219
- #: templates/default/bbpress/form-reply.php:168
4220
  msgid "The topic &#8216;%s&#8217; is closed to new replies."
4221
  msgstr ""
4222
 
4223
- #: templates/default/bbpress/form-reply.php:176
4224
- #: templates/default/bbpress/form-topic.php:221
4225
  msgid "The forum &#8216;%s&#8217; is closed to new topics and replies."
4226
  msgstr ""
4227
 
4228
- #: templates/default/bbpress/form-reply.php:184
4229
  msgid "You cannot reply to this topic."
4230
  msgstr ""
4231
 
4232
- #: templates/default/bbpress/form-reply.php:184
4233
  msgid "You must be logged in to reply to this topic."
4234
  msgstr ""
4235
 
@@ -4413,19 +4438,23 @@ msgstr ""
4413
  msgid "Topic Title (Maximum Length: %d):"
4414
  msgstr ""
4415
 
4416
- #: templates/default/bbpress/form-topic.php:112
4417
  msgid "Topic Tags:"
4418
  msgstr ""
4419
 
4420
- #: templates/default/bbpress/form-topic.php:139
4421
  msgid "Topic Type:"
4422
  msgstr ""
4423
 
4424
- #: templates/default/bbpress/form-topic.php:229
 
 
 
 
4425
  msgid "You cannot create new topics."
4426
  msgstr ""
4427
 
4428
- #: templates/default/bbpress/form-topic.php:229
4429
  msgid "You must be logged in to create new topics."
4430
  msgstr ""
4431
 
@@ -4554,19 +4583,19 @@ msgstr ""
4554
  msgid "Forum: "
4555
  msgstr ""
4556
 
4557
- #: templates/default/bbpress/loop-search-reply.php:30
4558
  msgid "In reply to: "
4559
  msgstr ""
4560
 
4561
- #: templates/default/bbpress/loop-search-topic.php:32
4562
  msgid "Topic: "
4563
  msgstr ""
4564
 
4565
- #: templates/default/bbpress/loop-search-topic.php:39
4566
  msgid "in group forum "
4567
  msgstr ""
4568
 
4569
- #: templates/default/bbpress/loop-search-topic.php:43
4570
  msgid "in forum "
4571
  msgstr ""
4572
 
@@ -4608,10 +4637,6 @@ msgstr ""
4608
  msgid "%s's Subscriptions"
4609
  msgstr ""
4610
 
4611
- #: templates/default/bbpress/user-details.php:65
4612
- msgid "Edit Profile of User %s"
4613
- msgstr ""
4614
-
4615
  #: templates/default/bbpress/user-favorites.php:15
4616
  msgid "Favorite Forum Topics"
4617
  msgstr ""
@@ -4672,43 +4697,43 @@ msgstr ""
4672
  msgid "This user has not created any topics."
4673
  msgstr ""
4674
 
4675
- #: templates/default/bbpress-functions.php:294
4676
  msgid "Something went wrong. Refresh your browser and try again."
4677
  msgstr ""
4678
 
4679
- #: templates/default/bbpress-functions.php:319
4680
  msgid "Favorites are no longer active."
4681
  msgstr ""
4682
 
4683
- #: templates/default/bbpress-functions.php:324
4684
  msgid "Please login to make this topic a favorite."
4685
  msgstr ""
4686
 
4687
- #: templates/default/bbpress-functions.php:333
4688
- #: templates/default/bbpress-functions.php:400
4689
  msgid "You do not have permission to do this."
4690
  msgstr ""
4691
 
4692
- #: templates/default/bbpress-functions.php:341
4693
- #: templates/default/bbpress-functions.php:408
4694
  msgid "The topic could not be found."
4695
  msgstr ""
4696
 
4697
- #: templates/default/bbpress-functions.php:346
4698
- #: templates/default/bbpress-functions.php:413
4699
  msgid "Are you sure you meant to do that?"
4700
  msgstr ""
4701
 
4702
- #: templates/default/bbpress-functions.php:354
4703
- #: templates/default/bbpress-functions.php:421
4704
  msgid "The request was unsuccessful. Please try again."
4705
  msgstr ""
4706
 
4707
- #: templates/default/bbpress-functions.php:386
4708
  msgid "Subscriptions are no longer active."
4709
  msgstr ""
4710
 
4711
- #: templates/default/bbpress-functions.php:391
4712
  msgid "Please login to subscribe to this topic."
4713
  msgstr ""
4714
 
@@ -4725,9 +4750,9 @@ msgstr ""
4725
  msgid "bbPress"
4726
  msgstr ""
4727
 
4728
- #. #-#-#-#-# plugin.pot (bbPress 2.3-rc1) #-#-#-#-#
4729
  #. Plugin URI of the plugin/theme
4730
- #. #-#-#-#-# plugin.pot (bbPress 2.3-rc1) #-#-#-#-#
4731
  #. Author URI of the plugin/theme
4732
  msgid "http://bbpress.org"
4733
  msgstr ""
2
  # This file is distributed under the same license as the bbPress package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: bbPress 2.4\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/bbpress\n"
7
+ "POT-Creation-Date: 2013-09-02 17:40:01+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: JOHN JAMES JACOBY <jjj@bbpress.org>\n"
13
  "Language-Team: ENGLISH <jjj@bbpress.org>\n"
14
 
15
+ #: bbpress.php:133 bbpress.php:140
16
  msgid "Cheatin&#8217; huh?"
17
  msgstr ""
18
 
19
+ #: bbpress.php:403 templates/default/bbpress-functions.php:68
20
  msgid "bbPress Default"
21
  msgstr ""
22
 
23
+ #: bbpress.php:478 bbpress.php:479 includes/admin/admin.php:221
24
+ #: includes/admin/admin.php:222 includes/admin/admin.php:232
25
+ #: includes/admin/admin.php:233 includes/admin/users.php:82
26
+ #: includes/common/widgets.php:662 includes/extend/buddypress/loader.php:42
27
  #: includes/extend/buddypress/loader.php:170
28
+ #: includes/extend/buddypress/loader.php:256
29
+ #: includes/extend/buddypress/loader.php:307
30
  #: templates/default/bbpress/content-statistics.php:22
31
  msgid "Forums"
32
  msgstr ""
33
 
34
+ #: bbpress.php:480 includes/admin/forums.php:409
35
+ #: includes/admin/metaboxes.php:50 includes/admin/metaboxes.php:379
36
+ #: includes/admin/metaboxes.php:432 includes/admin/replies.php:570
37
+ #: includes/admin/settings.php:293 includes/admin/topics.php:633
38
+ #: includes/extend/buddypress/groups.php:52
39
+ #: includes/extend/buddypress/groups.php:53
40
  #: templates/default/bbpress/loop-forums.php:19
41
  msgid "Forum"
42
  msgstr ""
43
 
44
+ #: bbpress.php:481 includes/admin/tools.php:1079
45
  msgid "All Forums"
46
  msgstr ""
47
 
48
+ #: bbpress.php:482 bbpress.php:486
49
  msgid "New Forum"
50
  msgstr ""
51
 
52
+ #: bbpress.php:483 templates/default/bbpress/form-forum.php:37
53
  msgid "Create New Forum"
54
  msgstr ""
55
 
56
+ #: bbpress.php:484 bbpress.php:541 bbpress.php:598
57
+ #: includes/common/template.php:2183 includes/replies/template.php:1819
58
+ #: includes/topics/template.php:2340
 
59
  #: templates/default/bbpress/user-details.php:65
60
  msgid "Edit"
61
  msgstr ""
62
 
63
+ #: bbpress.php:485
64
  msgid "Edit Forum"
65
  msgstr ""
66
 
67
+ #: bbpress.php:487 bbpress.php:488
68
  msgid "View Forum"
69
  msgstr ""
70
 
71
+ #: bbpress.php:489 includes/common/widgets.php:483
72
  msgid "Search Forums"
73
  msgstr ""
74
 
75
+ #: bbpress.php:490
76
  msgid "No forums found"
77
  msgstr ""
78
 
79
+ #: bbpress.php:491
80
  msgid "No forums found in Trash"
81
  msgstr ""
82
 
83
+ #: bbpress.php:492 templates/default/bbpress/form-forum.php:118
84
  msgid "Parent Forum:"
85
  msgstr ""
86
 
87
+ #: bbpress.php:515
88
  msgid "bbPress Forums"
89
  msgstr ""
90
 
91
+ #: bbpress.php:535 bbpress.php:536 includes/admin/forums.php:410
92
+ #: includes/admin/settings.php:222 includes/admin/settings.php:243
93
+ #: includes/admin/topics.php:632 includes/extend/buddypress/activity.php:354
94
+ #: includes/forums/template.php:2424
95
  #: templates/default/bbpress/content-statistics.php:27
96
  #: templates/default/bbpress/loop-forums.php:20
97
  msgid "Topics"
98
  msgstr ""
99
 
100
+ #: bbpress.php:537 includes/admin/metaboxes.php:67
101
+ #: includes/admin/metaboxes.php:457 includes/admin/replies.php:571
102
+ #: includes/admin/settings.php:301
103
  #: templates/default/bbpress/content-single-topic-lead.php:22
104
  #: templates/default/bbpress/content-single-topic-lead.php:94
105
  #: templates/default/bbpress/loop-topics.php:19
106
  msgid "Topic"
107
  msgstr ""
108
 
109
+ #: bbpress.php:538 includes/admin/tools.php:1080
110
+ #: includes/topics/functions.php:3438
111
  msgid "All Topics"
112
  msgstr ""
113
 
114
+ #: bbpress.php:539 bbpress.php:543
115
  msgid "New Topic"
116
  msgstr ""
117
 
118
+ #: bbpress.php:540 templates/default/bbpress/form-topic.php:43
119
  msgid "Create New Topic"
120
  msgstr ""
121
 
122
+ #: bbpress.php:542
123
  msgid "Edit Topic"
124
  msgstr ""
125
 
126
+ #: bbpress.php:544 bbpress.php:545
127
  msgid "View Topic"
128
  msgstr ""
129
 
130
+ #: bbpress.php:546
131
  msgid "Search Topics"
132
  msgstr ""
133
 
134
+ #: bbpress.php:547
135
  msgid "No topics found"
136
  msgstr ""
137
 
138
+ #: bbpress.php:548
139
  msgid "No topics found in Trash"
140
  msgstr ""
141
 
142
+ #: bbpress.php:549 includes/admin/metaboxes.php:378
143
+ #: includes/admin/metaboxes.php:431 includes/extend/buddypress/groups.php:1038
144
+ #: templates/default/bbpress/form-topic.php:114
145
  msgid "Forum:"
146
  msgstr ""
147
 
148
+ #: bbpress.php:572
149
  msgid "bbPress Topics"
150
  msgstr ""
151
 
152
+ #: bbpress.php:592 bbpress.php:593 includes/admin/forums.php:411
153
+ #: includes/admin/settings.php:230 includes/admin/settings.php:251
154
+ #: includes/admin/topics.php:634 includes/core/theme-compat.php:636
155
+ #: includes/extend/buddypress/activity.php:355
156
+ #: includes/forums/template.php:2488
157
  #: templates/default/bbpress/content-statistics.php:32
158
  #: templates/default/bbpress/loop-forums.php:21
159
  #: templates/default/bbpress/loop-replies.php:32
160
+ #: templates/default/bbpress/loop-replies.php:70
161
  #: templates/default/bbpress/loop-topics.php:21
162
  msgid "Replies"
163
  msgstr ""
164
 
165
+ #: bbpress.php:594 includes/admin/metaboxes.php:84
166
+ #: includes/admin/settings.php:325 includes/replies/template.php:1530
167
+ #: includes/topics/template.php:2770
168
  msgid "Reply"
169
  msgstr ""
170
 
171
+ #: bbpress.php:595 includes/admin/tools.php:1081
172
+ #: includes/replies/functions.php:1998
173
  msgid "All Replies"
174
  msgstr ""
175
 
176
+ #: bbpress.php:596 bbpress.php:600
177
  msgid "New Reply"
178
  msgstr ""
179
 
180
+ #: bbpress.php:597
181
  msgid "Create New Reply"
182
  msgstr ""
183
 
184
+ #: bbpress.php:599
185
  msgid "Edit Reply"
186
  msgstr ""
187
 
188
+ #: bbpress.php:601 bbpress.php:602
189
  msgid "View Reply"
190
  msgstr ""
191
 
192
+ #: bbpress.php:603
193
  msgid "Search Replies"
194
  msgstr ""
195
 
196
+ #: bbpress.php:604
197
  msgid "No replies found"
198
  msgstr ""
199
 
200
+ #: bbpress.php:605
201
  msgid "No replies found in Trash"
202
  msgstr ""
203
 
204
+ #: bbpress.php:606 includes/admin/metaboxes.php:456
 
205
  msgid "Topic:"
206
  msgstr ""
207
 
208
+ #: bbpress.php:629
209
  msgid "bbPress Replies"
210
  msgstr ""
211
 
212
+ #: bbpress.php:664
213
  msgctxt "post"
214
  msgid "Closed"
215
  msgstr ""
216
 
217
+ #: bbpress.php:665
218
  msgctxt "post"
219
  msgid "Closed <span class=\"count\">(%s)</span>"
220
  msgid_plural "Closed <span class=\"count\">(%s)</span>"
221
  msgstr[0] ""
222
  msgstr[1] ""
223
 
224
+ #: bbpress.php:675
225
  msgctxt "post"
226
  msgid "Spam"
227
  msgstr ""
228
 
229
+ #: bbpress.php:676
230
  msgctxt "post"
231
  msgid "Spam <span class=\"count\">(%s)</span>"
232
  msgid_plural "Spam <span class=\"count\">(%s)</span>"
233
  msgstr[0] ""
234
  msgstr[1] ""
235
 
236
+ #: bbpress.php:688
237
  msgctxt "post"
238
  msgid "Orphan"
239
  msgstr ""
240
 
241
+ #: bbpress.php:689
242
  msgctxt "post"
243
  msgid "Orphan <span class=\"count\">(%s)</span>"
244
  msgid_plural "Orphans <span class=\"count\">(%s)</span>"
245
  msgstr[0] ""
246
  msgstr[1] ""
247
 
248
+ #: bbpress.php:701
249
  msgctxt "post"
250
  msgid "Hidden"
251
  msgstr ""
252
 
253
+ #: bbpress.php:702
254
  msgctxt "post"
255
  msgid "Hidden <span class=\"count\">(%s)</span>"
256
  msgid_plural "Hidden <span class=\"count\">(%s)</span>"
257
  msgstr[0] ""
258
  msgstr[1] ""
259
 
260
+ #: bbpress.php:747 templates/default/bbpress/content-statistics.php:37
261
  msgid "Topic Tags"
262
  msgstr ""
263
 
264
+ #: bbpress.php:748 includes/admin/metaboxes.php:103
265
+ #: includes/admin/settings.php:309
266
  msgid "Topic Tag"
267
  msgstr ""
268
 
269
+ #: bbpress.php:749
270
  msgid "Search Tags"
271
  msgstr ""
272
 
273
+ #: bbpress.php:750
274
  msgid "Popular Tags"
275
  msgstr ""
276
 
277
+ #: bbpress.php:751
278
  msgid "All Tags"
279
  msgstr ""
280
 
281
+ #: bbpress.php:752
282
  msgid "Edit Tag"
283
  msgstr ""
284
 
285
+ #: bbpress.php:753
286
  msgid "Update Tag"
287
  msgstr ""
288
 
289
+ #: bbpress.php:754
290
  msgid "Add New Tag"
291
  msgstr ""
292
 
293
+ #: bbpress.php:755
294
  msgid "New Tag Name"
295
  msgstr ""
296
 
297
+ #: bbpress.php:756
298
  msgid "View Topic Tag"
299
  msgstr ""
300
 
301
+ #: bbpress.php:795
302
  msgid "Most popular topics"
303
  msgstr ""
304
 
305
+ #: bbpress.php:807
306
  msgid "Topics with no replies"
307
  msgstr ""
308
 
309
+ #: includes/admin/admin.php:186 includes/admin/functions.php:236
310
  #: includes/admin/tools.php:34
311
  msgid "Repair Forums"
312
  msgstr ""
313
 
314
+ #: includes/admin/admin.php:187
315
  msgid "Forum Repair"
316
  msgstr ""
317
 
318
+ #: includes/admin/admin.php:196 includes/admin/functions.php:240
319
+ #: includes/admin/settings.php:1507
320
  msgid "Import Forums"
321
  msgstr ""
322
 
323
+ #: includes/admin/admin.php:197
324
  msgid "Forum Import"
325
  msgstr ""
326
 
327
+ #: includes/admin/admin.php:206 includes/admin/functions.php:244
328
+ #: includes/admin/tools.php:1070
329
  msgid "Reset Forums"
330
  msgstr ""
331
 
332
+ #: includes/admin/admin.php:207
333
  msgid "Forum Reset"
334
  msgstr ""
335
 
336
+ #: includes/admin/admin.php:245 includes/admin/admin.php:246
337
+ #: includes/admin/admin.php:254 includes/admin/admin.php:255
338
  msgid "Welcome to bbPress"
339
  msgstr ""
340
 
341
+ #: includes/admin/admin.php:268 includes/admin/admin.php:269
342
+ #: includes/admin/admin.php:290 includes/admin/admin.php:291
343
+ #: includes/admin/admin.php:1629 includes/admin/admin.php:1718
344
  msgid "Update Forums"
345
  msgstr ""
346
 
347
+ #: includes/admin/admin.php:495 includes/admin/admin.php:1439
348
  msgid "Settings"
349
  msgstr ""
350
 
351
+ #: includes/admin/admin.php:496
352
  msgid "About"
353
  msgstr ""
354
 
355
+ #: includes/admin/admin.php:508
356
  msgid "Right Now in Forums"
357
  msgstr ""
358
 
359
+ #: includes/admin/admin.php:1288
360
  msgctxt "admin color scheme"
361
  msgid "Green"
362
  msgstr ""
363
 
364
+ #: includes/admin/admin.php:1342 includes/admin/admin.php:1366
365
  msgid "%s - %s"
366
  msgstr ""
367
 
368
+ #: includes/admin/admin.php:1384 includes/admin/admin.php:1472
369
  msgid "Welcome to bbPress %s"
370
  msgstr ""
371
 
372
+ #: includes/admin/admin.php:1385 includes/admin/admin.php:1473
373
  msgid ""
374
+ "Thank you for updating! bbPress %s is waxed, polished, and ready for you to "
375
+ "take it for a lap or two around the block!"
376
  msgstr ""
377
 
378
+ #: includes/admin/admin.php:1386 includes/admin/admin.php:1474
379
  msgid "Version %s"
380
  msgstr ""
381
 
382
+ #: includes/admin/admin.php:1390 includes/admin/admin.php:1478
383
  msgid "What&#8217;s New"
384
  msgstr ""
385
 
386
+ #: includes/admin/admin.php:1392 includes/admin/admin.php:1480
387
  msgid "Credits"
388
  msgstr ""
389
 
390
+ #: includes/admin/admin.php:1397
391
+ msgid "Hierarchical Replies"
392
  msgstr ""
393
 
394
+ #: includes/admin/admin.php:1401
395
+ msgid "Reply to replies"
396
  msgstr ""
397
 
398
+ #: includes/admin/admin.php:1402
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  msgid ""
400
+ "Now your users can reply to specific replies, providing context to each "
401
+ "inidividual post."
 
 
 
 
 
 
 
 
 
 
 
 
402
  msgstr ""
403
 
404
+ #: includes/admin/admin.php:1406
405
+ msgid "Choose your own discussion style"
406
  msgstr ""
407
 
408
+ #: includes/admin/admin.php:1407
409
+ msgid "Stay flat or go threaded, and seamlessly switch between the two."
 
 
410
  msgstr ""
411
 
412
+ #: includes/admin/admin.php:1413
413
  msgid "Under the Hood"
414
  msgstr ""
415
 
416
+ #: includes/admin/admin.php:1417
417
+ msgid "Preformatted text"
418
  msgstr ""
419
 
420
+ #: includes/admin/admin.php:1418
421
+ msgid "Forum users can post code snippets with confidence."
 
422
  msgstr ""
423
 
424
+ #: includes/admin/admin.php:1422
425
+ msgid "Polyglot support"
426
  msgstr ""
427
 
428
+ #: includes/admin/admin.php:1423
429
+ msgid "bbPress is ready for future translation API improvements."
430
  msgstr ""
431
 
432
+ #: includes/admin/admin.php:1427
433
+ msgid "User capabilities"
434
  msgstr ""
435
 
436
+ #: includes/admin/admin.php:1428
437
  msgid ""
438
+ "Roles and capabilities have been swept through, cleaned up, and simplified."
 
 
 
 
 
439
  msgstr ""
440
 
441
+ #: includes/admin/admin.php:1434 includes/admin/settings.php:166
442
+ #: includes/admin/settings.php:333 includes/common/template.php:2297
443
+ #: includes/search/template.php:231
444
+ #: templates/default/bbpress/form-search.php:17
445
+ msgid "Search"
446
  msgstr ""
447
 
448
+ #: includes/admin/admin.php:1435
449
+ msgid "Search results use pretty permalinks, and have a dedicated output page."
450
  msgstr ""
451
 
452
+ #: includes/admin/admin.php:1440
453
+ msgid "Fields and sections have been reordered and reorganized."
 
454
  msgstr ""
455
 
456
+ #: includes/admin/admin.php:1444
457
+ msgid "BuddyPress"
458
  msgstr ""
459
 
460
+ #: includes/admin/admin.php:1445
461
+ msgid "Forums are now fully and seamlessly integrated into BuddyPress Groups."
 
 
462
  msgstr ""
463
 
464
+ #: includes/admin/admin.php:1451 includes/admin/admin.php:1555
465
  msgid "Go to Forum Settings"
466
  msgstr ""
467
 
468
+ #: includes/admin/admin.php:1484
469
  msgid "bbPress is created by a worldwide swarm of busy, busy bees."
470
  msgstr ""
471
 
472
+ #: includes/admin/admin.php:1486
473
  msgid "Project Leaders"
474
  msgstr ""
475
 
476
+ #: includes/admin/admin.php:1491
477
  msgid "Founding Developer"
478
  msgstr ""
479
 
480
+ #: includes/admin/admin.php:1496
481
  msgid "Lead Developer"
482
  msgstr ""
483
 
484
+ #: includes/admin/admin.php:1501 includes/admin/admin.php:1520
485
+ msgid "Feature Developer"
486
+ msgstr ""
487
+
488
+ #: includes/admin/admin.php:1505
489
  msgid "Contributing Developers"
490
  msgstr ""
491
 
492
+ #: includes/admin/admin.php:1510
493
+ msgid "Converter Specialist"
494
  msgstr ""
495
 
496
+ #: includes/admin/admin.php:1515
497
+ msgid "Bug Testing"
498
+ msgstr ""
499
+
500
+ #: includes/admin/admin.php:1524
501
+ msgid "Core Contributors to bbPress 2.4"
502
  msgstr ""
503
 
504
+ #: includes/admin/admin.php:1581 includes/admin/admin.php:1603
505
  msgid "Update Forum"
506
  msgstr ""
507
 
508
+ #: includes/admin/admin.php:1592 includes/admin/admin.php:1646
509
  msgid "All done!"
510
  msgstr ""
511
 
512
+ #: includes/admin/admin.php:1593 includes/admin/admin.php:1647
513
  msgid "Go Back"
514
  msgstr ""
515
 
516
+ #: includes/admin/admin.php:1602
517
  msgid ""
518
  "You can update your forum through this page. Hit the link below to update."
519
  msgstr ""
520
 
521
+ #: includes/admin/admin.php:1674
522
  msgid ""
523
  "Warning! Problem updating %1$s. Your server may not be able to connect to "
524
  "sites running on it. Error message: <em>%2$s</em>"
525
  msgstr ""
526
 
527
+ #: includes/admin/admin.php:1698
528
  msgid ""
529
  "If your browser doesn&#8217;t start loading the next page automatically, "
530
  "click this link:"
531
  msgstr ""
532
 
533
+ #: includes/admin/admin.php:1699
534
  msgid "Next Forums"
535
  msgstr ""
536
 
537
+ #: includes/admin/admin.php:1717
538
  msgid ""
539
  "You can update all the forums on your network through this page. It works by "
540
  "calling the update script of each site automatically. Hit the link below to "
601
  msgid "Starting Conversion"
602
  msgstr ""
603
 
604
+ #: includes/admin/converter.php:248 includes/admin/converter.php:490
605
  msgid "Conversion Complete"
606
  msgstr ""
607
 
669
  msgid "Converting replies (%1$s - %2$s)"
670
  msgstr ""
671
 
672
+ #: includes/admin/converter.php:476
673
+ msgid "No reply_to parents to convert"
674
+ msgstr ""
675
+
676
+ #: includes/admin/converter.php:480
677
+ msgid "Calculating reply_to parents (%1$s - %2$s)"
678
+ msgstr ""
679
+
680
  #: includes/admin/converters/Invision.php:502
681
  #: includes/admin/converters/SimplePress5.php:495
682
  #: includes/admin/converters/Vanilla.php:514
685
  msgid "Re: "
686
  msgstr ""
687
 
688
+ #: includes/admin/forums.php:121 includes/admin/replies.php:132
689
+ #: includes/admin/settings.php:1547 includes/admin/topics.php:132
690
  msgid "Overview"
691
  msgstr ""
692
 
693
+ #: includes/admin/forums.php:123
694
  msgid ""
695
  "This screen displays the individual forums on your site. You can customize "
696
  "the display of this screen to suit your workflow."
697
  msgstr ""
698
 
699
+ #: includes/admin/forums.php:129 includes/admin/replies.php:140
700
+ #: includes/admin/topics.php:140
701
  msgid "Screen Content"
702
  msgstr ""
703
 
704
+ #: includes/admin/forums.php:131 includes/admin/replies.php:142
705
+ #: includes/admin/topics.php:142
706
  msgid ""
707
  "You can customize the display of this screen&#8217;s contents in a number of "
708
  "ways:"
709
  msgstr ""
710
 
711
+ #: includes/admin/forums.php:133
712
  msgid ""
713
  "You can hide/display columns based on your needs and decide how many forums "
714
  "to list per screen using the Screen Options tab."
715
  msgstr ""
716
 
717
+ #: includes/admin/forums.php:134
718
  msgid ""
719
  "You can filter the list of forums by forum status using the text links in "
720
  "the upper left to show All, Published, or Trashed forums. The default view "
721
  "is to show all forums."
722
  msgstr ""
723
 
724
+ #: includes/admin/forums.php:135
725
  msgid ""
726
  "You can refine the list to show only forums from a specific month by using "
727
  "the dropdown menus above the forums list. Click the Filter button after "
729
  "creator in the forums list."
730
  msgstr ""
731
 
732
+ #: includes/admin/forums.php:142 includes/admin/replies.php:154
733
+ #: includes/admin/topics.php:153
734
  msgid "Available Actions"
735
  msgstr ""
736
 
737
+ #: includes/admin/forums.php:144
738
  msgid ""
739
  "Hovering over a row in the forums list will display action links that allow "
740
  "you to manage your forum. You can perform the following actions:"
741
  msgstr ""
742
 
743
+ #: includes/admin/forums.php:146
744
  msgid ""
745
  "<strong>Edit</strong> takes you to the editing screen for that forum. You "
746
  "can also reach that screen by clicking on the forum title."
747
  msgstr ""
748
 
749
+ #: includes/admin/forums.php:147
750
  msgid ""
751
  "<strong>Trash</strong> removes your forum from this list and places it in "
752
  "the trash, from which you can permanently delete it."
753
  msgstr ""
754
 
755
+ #: includes/admin/forums.php:148
756
  msgid ""
757
  "<strong>View</strong> will show you what your draft forum will look like if "
758
  "you publish it. View will take you to your live site to view the forum. "
759
  "Which link is available depends on your forum&#8217;s status."
760
  msgstr ""
761
 
762
+ #: includes/admin/forums.php:155 includes/admin/replies.php:169
763
+ #: includes/admin/topics.php:170
764
  msgid "Bulk Actions"
765
  msgstr ""
766
 
767
+ #: includes/admin/forums.php:157
768
  msgid ""
769
  "You can also edit or move multiple forums to the trash at once. Select the "
770
  "forums you want to act on using the checkboxes, then select the action you "
771
  "want to take from the Bulk Actions menu and click Apply."
772
  msgstr ""
773
 
774
+ #: includes/admin/forums.php:158
775
  msgid ""
776
  "When using Bulk Edit, you can change the metadata (categories, author, etc.) "
777
  "for all selected forums at once. To remove a forum from the grouping, just "
778
  "click the x next to its name in the Bulk Edit area that appears."
779
  msgstr ""
780
 
781
+ #: includes/admin/forums.php:163 includes/admin/forums.php:222
782
+ #: includes/admin/replies.php:177 includes/admin/replies.php:234
783
+ #: includes/admin/settings.php:1593 includes/admin/topics.php:178
784
+ #: includes/admin/topics.php:234
785
  msgid "For more information:"
786
  msgstr ""
787
 
788
+ #: includes/admin/forums.php:164 includes/admin/forums.php:223
789
+ #: includes/admin/replies.php:178 includes/admin/replies.php:235
790
+ #: includes/admin/settings.php:1594 includes/admin/topics.php:179
791
+ #: includes/admin/topics.php:235
792
  msgid ""
793
  "<a href=\"http://codex.bbpress.org\" target=\"_blank\">bbPress "
794
  "Documentation</a>"
795
  msgstr ""
796
 
797
+ #: includes/admin/forums.php:165 includes/admin/forums.php:224
798
+ #: includes/admin/replies.php:179 includes/admin/replies.php:236
799
+ #: includes/admin/settings.php:1595 includes/admin/topics.php:180
800
+ #: includes/admin/topics.php:236
801
  msgid ""
802
  "<a href=\"http://bbpress.org/forums/\" target=\"_blank\">bbPress Support "
803
  "Forums</a>"
804
  msgstr ""
805
 
806
+ #: includes/admin/forums.php:179
807
  msgid ""
808
  "The title field and the big forum editing Area are fixed in place, but you "
809
  "can reposition all the other boxes using drag and drop, and can minimize or "
813
  "screen."
814
  msgstr ""
815
 
816
+ #: includes/admin/forums.php:183 includes/admin/replies.php:197
817
+ #: includes/admin/topics.php:198
818
  msgid "Customizing This Display"
819
  msgstr ""
820
 
821
+ #: includes/admin/forums.php:189
822
  msgid "Title and Forum Editor"
823
  msgstr ""
824
 
825
+ #: includes/admin/forums.php:191
826
  msgid ""
827
  "<strong>Title</strong> - Enter a title for your forum. After you enter a "
828
  "title, you&#8217;ll see the permalink below, which you can edit."
829
  msgstr ""
830
 
831
+ #: includes/admin/forums.php:192
832
  msgid ""
833
  "<strong>Forum Editor</strong> - Enter the text for your forum. There are two "
834
  "modes of editing: Visual and HTML. Choose the mode by clicking on the "
842
  "over the top area. Exit Fullscreen back to the regular forum editor."
843
  msgstr ""
844
 
845
+ #: includes/admin/forums.php:195
846
  msgid ""
847
  "<strong>Publish</strong> - You can set the terms of publishing your forum in "
848
  "the Publish box. For Status, Visibility, and Publish (immediately), click on "
853
  "future or backdate a forum."
854
  msgstr ""
855
 
856
+ #: includes/admin/forums.php:198
 
 
 
 
 
 
 
 
 
 
 
857
  msgid ""
858
  "<strong>Featured Image</strong> - This allows you to associate an image with "
859
  "your forum without inserting it. This is usually useful only if your theme "
861
  "custom header, etc."
862
  msgstr ""
863
 
864
+ #: includes/admin/forums.php:203 includes/admin/forums.php:243
865
  msgid "Forum Attributes"
866
  msgstr ""
867
 
868
+ #: includes/admin/forums.php:205
869
  msgid "Select the attributes that your forum should have:"
870
  msgstr ""
871
 
872
+ #: includes/admin/forums.php:207
873
  msgid ""
874
  "<strong>Type</strong> indicates if the forum is a category or forum. "
875
  "Categories generally contain other forums."
876
  msgstr ""
877
 
878
+ #: includes/admin/forums.php:208
879
  msgid ""
880
  "<strong>Status</strong> allows you to close a forum to new topics and forums."
881
  msgstr ""
882
 
883
+ #: includes/admin/forums.php:209
884
  msgid ""
885
  "<strong>Visibility</strong> lets you pick the scope of each forum and what "
886
  "users are allowed to access it."
887
  msgstr ""
888
 
889
+ #: includes/admin/forums.php:210
890
  msgid ""
891
  "<strong>Parent</strong> dropdown determines the parent forum. Select the "
892
  "forum or category from the dropdown, or leave the default (No Parent) to "
893
  "create the forum at the root of your forums."
894
  msgstr ""
895
 
896
+ #: includes/admin/forums.php:211
897
  msgid "<strong>Order</strong> allows you to order your forums numerically."
898
  msgstr ""
899
 
900
+ #: includes/admin/forums.php:217 includes/admin/replies.php:229
901
+ #: includes/admin/topics.php:229
902
  msgid "Publish Box"
903
  msgstr ""
904
 
905
+ #: includes/admin/forums.php:412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
906
  #: templates/default/bbpress/content-single-topic-lead.php:18
907
  #: templates/default/bbpress/content-single-topic-lead.php:90
908
  msgid "Creator"
909
  msgstr ""
910
 
911
+ #: includes/admin/forums.php:413 includes/admin/replies.php:573
912
+ #: includes/admin/topics.php:637
913
  msgid "Created"
914
  msgstr ""
915
 
916
+ #: includes/admin/forums.php:414 includes/admin/topics.php:638
917
  #: templates/default/bbpress/loop-forums.php:22
918
  #: templates/default/bbpress/loop-topics.php:22
919
  msgid "Freshness"
920
  msgstr ""
921
 
922
+ #: includes/admin/forums.php:463 includes/forums/template.php:531
 
 
 
 
 
923
  msgid "No Topics"
924
  msgstr ""
925
 
926
+ #: includes/admin/forums.php:529
927
  msgid "Forum updated. <a href=\"%s\">View forum</a>"
928
  msgstr ""
929
 
930
+ #: includes/admin/forums.php:532 includes/admin/replies.php:853
931
+ #: includes/admin/topics.php:923
932
  msgid "Custom field updated."
933
  msgstr ""
934
 
935
+ #: includes/admin/forums.php:535 includes/admin/replies.php:856
936
+ #: includes/admin/topics.php:926
937
  msgid "Custom field deleted."
938
  msgstr ""
939
 
940
+ #: includes/admin/forums.php:538
941
  msgid "Forum updated."
942
  msgstr ""
943
 
944
  #. translators: %s: date and time of the revision
945
+ #: includes/admin/forums.php:543
946
  msgid "Forum restored to revision from %s"
947
  msgstr ""
948
 
949
+ #: includes/admin/forums.php:547
950
  msgid "Forum created. <a href=\"%s\">View forum</a>"
951
  msgstr ""
952
 
953
+ #: includes/admin/forums.php:550
954
  msgid "Forum saved."
955
  msgstr ""
956
 
957
+ #: includes/admin/forums.php:553
958
  msgid "Forum submitted. <a target=\"_blank\" href=\"%s\">Preview forum</a>"
959
  msgstr ""
960
 
961
+ #: includes/admin/forums.php:556
962
  msgid ""
963
  "Forum scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
964
  "\">Preview forum</a>"
965
  msgstr ""
966
 
967
  #. translators: Publish box date format, see http:php.net/date
968
+ #: includes/admin/forums.php:558 includes/admin/replies.php:879
969
+ #: includes/admin/topics.php:949
970
  msgid "M j, Y @ G:i"
971
  msgstr ""
972
 
973
+ #: includes/admin/forums.php:563
974
  msgid "Forum draft updated. <a target=\"_blank\" href=\"%s\">Preview forum</a>"
975
  msgstr ""
976
 
1011
  msgstr ""
1012
 
1013
  #: includes/admin/metaboxes.php:261 includes/admin/metaboxes.php:262
1014
+ #: includes/admin/metaboxes.php:354
1015
  msgid "Type:"
1016
  msgstr ""
1017
 
1018
  #: includes/admin/metaboxes.php:273 includes/admin/metaboxes.php:274
1019
+ #: includes/admin/metaboxes.php:366
1020
+ #: templates/default/bbpress/form-forum.php:100
1021
  msgid "Status:"
1022
  msgstr ""
1023
 
1024
  #: includes/admin/metaboxes.php:285 includes/admin/metaboxes.php:286
1025
+ #: templates/default/bbpress/form-forum.php:109
1026
  msgid "Visibility:"
1027
  msgstr ""
1028
 
1034
  msgid "Forum Parent"
1035
  msgstr ""
1036
 
1037
+ #: includes/admin/metaboxes.php:314 includes/admin/metaboxes.php:393
1038
+ #: includes/admin/metaboxes.php:446
1039
  msgid "&mdash; No parent &mdash;"
1040
  msgstr ""
1041
 
1047
  msgid "Forum Order"
1048
  msgstr ""
1049
 
1050
+ #: includes/admin/metaboxes.php:355
1051
  msgid "Topic Type"
1052
  msgstr ""
1053
 
1054
+ #: includes/admin/metaboxes.php:367
1055
+ msgid "Select whether to open or close the topic."
1056
+ msgstr ""
1057
+
1058
+ #: includes/admin/metaboxes.php:462
1059
+ msgid "Reply To:"
1060
+ msgstr ""
1061
+
1062
+ #: includes/admin/metaboxes.php:463
1063
+ msgid "Reply To"
1064
+ msgstr ""
1065
+
1066
+ #: includes/admin/metaboxes.php:493
1067
  #: templates/default/bbpress/form-topic-tag.php:35
1068
  msgid "Name:"
1069
  msgstr ""
1070
 
1071
+ #: includes/admin/metaboxes.php:494
1072
  #: templates/default/bbpress/form-user-edit.php:14
1073
  #: templates/default/bbpress/form-user-edit.php:19
1074
  msgid "Name"
1075
  msgstr ""
1076
 
1077
+ #: includes/admin/metaboxes.php:499
1078
  msgid "Email:"
1079
  msgstr ""
1080
 
1081
+ #: includes/admin/metaboxes.php:500
1082
  #: templates/default/bbpress/form-user-edit.php:103
1083
  #: templates/default/bbpress/form-user-register.php:28
1084
  msgid "Email"
1085
  msgstr ""
1086
 
1087
+ #: includes/admin/metaboxes.php:505
1088
  #: templates/default/bbpress/form-anonymous.php:32
1089
  msgid "Website:"
1090
  msgstr ""
1091
 
1092
+ #: includes/admin/metaboxes.php:506
1093
  #: templates/default/bbpress/form-user-edit.php:57
1094
  msgid "Website"
1095
  msgstr ""
1096
 
1097
+ #: includes/admin/metaboxes.php:513
1098
+ msgid "ID:"
1099
+ msgstr ""
1100
+
1101
+ #: includes/admin/metaboxes.php:514
1102
+ msgid "ID"
1103
+ msgstr ""
1104
+
1105
+ #: includes/admin/metaboxes.php:521
1106
  msgid "IP:"
1107
  msgstr ""
1108
 
1109
+ #: includes/admin/metaboxes.php:522
1110
  msgid "IP Address"
1111
  msgstr ""
1112
 
1113
+ #: includes/admin/replies.php:134
1114
  msgid ""
1115
  "This screen provides access to all of your replies. You can customize the "
1116
  "display of this screen to suit your workflow."
1117
  msgstr ""
1118
 
1119
+ #: includes/admin/replies.php:144
1120
  msgid ""
1121
  "You can hide/display columns based on your needs and decide how many replies "
1122
  "to list per screen using the Screen Options tab."
1123
  msgstr ""
1124
 
1125
+ #: includes/admin/replies.php:145
1126
  msgid ""
1127
  "You can filter the list of replies by reply status using the text links in "
1128
  "the upper left to show All, Published, Draft, or Trashed replies. The "
1129
  "default view is to show all replies."
1130
  msgstr ""
1131
 
1132
+ #: includes/admin/replies.php:146
1133
  msgid ""
1134
  "You can view replies in a simple title list or with an excerpt. Choose the "
1135
  "view you prefer by clicking on the icons at the top of the list on the right."
1136
  msgstr ""
1137
 
1138
+ #: includes/admin/replies.php:147
1139
  msgid ""
1140
  "You can refine the list to show only replies in a specific category or from "
1141
  "a specific month by using the dropdown menus above the replies list. Click "
1143
  "by clicking on the reply author, category or tag in the replies list."
1144
  msgstr ""
1145
 
1146
+ #: includes/admin/replies.php:156
1147
  msgid ""
1148
  "Hovering over a row in the replies list will display action links that allow "
1149
  "you to manage your reply. You can perform the following actions:"
1150
  msgstr ""
1151
 
1152
+ #: includes/admin/replies.php:158
1153
  msgid ""
1154
  "<strong>Edit</strong> takes you to the editing screen for that reply. You "
1155
  "can also reach that screen by clicking on the reply title."
1156
  msgstr ""
1157
 
1158
+ #: includes/admin/replies.php:160
1159
  msgid ""
1160
  "<strong>Trash</strong> removes your reply from this list and places it in "
1161
  "the trash, from which you can permanently delete it."
1162
  msgstr ""
1163
 
1164
+ #: includes/admin/replies.php:161
1165
  msgid ""
1166
  "<strong>Spam</strong> removes your reply from this list and places it in the "
1167
  "spam queue, from which you can permanently delete it."
1168
  msgstr ""
1169
 
1170
+ #: includes/admin/replies.php:162
1171
  msgid ""
1172
  "<strong>Preview</strong> will show you what your draft reply will look like "
1173
  "if you publish it. View will take you to your live site to view the reply. "
1174
  "Which link is available depends on your reply&#8217;s status."
1175
  msgstr ""
1176
 
1177
+ #: includes/admin/replies.php:171
1178
  msgid ""
1179
  "You can also edit or move multiple replies to the trash at once. Select the "
1180
  "replies you want to act on using the checkboxes, then select the action you "
1181
  "want to take from the Bulk Actions menu and click Apply."
1182
  msgstr ""
1183
 
1184
+ #: includes/admin/replies.php:172
1185
  msgid ""
1186
  "When using Bulk Edit, you can change the metadata (categories, author, etc.) "
1187
  "for all selected replies at once. To remove a reply from the grouping, just "
1188
  "click the x next to its name in the Bulk Edit area that appears."
1189
  msgstr ""
1190
 
1191
+ #: includes/admin/replies.php:193
1192
  msgid ""
1193
  "The title field and the big reply editing Area are fixed in place, but you "
1194
  "can reposition all the other boxes using drag and drop, and can minimize or "
1198
  "screen."
1199
  msgstr ""
1200
 
1201
+ #: includes/admin/replies.php:203
1202
  msgid "Title and Reply Editor"
1203
  msgstr ""
1204
 
1205
+ #: includes/admin/replies.php:205
1206
  msgid ""
1207
  "<strong>Title</strong> - Enter a title for your reply. After you enter a "
1208
  "title, you&#8217;ll see the permalink below, which you can edit."
1209
  msgstr ""
1210
 
1211
+ #: includes/admin/replies.php:206
1212
  msgid ""
1213
  "<strong>Reply Editor</strong> - Enter the text for your reply. There are two "
1214
  "modes of editing: Visual and HTML. Choose the mode by clicking on the "
1222
  "over the top area. Exit Fullscreen back to the regular reply editor."
1223
  msgstr ""
1224
 
1225
+ #: includes/admin/replies.php:209
1226
  msgid ""
1227
  "<strong>Publish</strong> - You can set the terms of publishing your reply in "
1228
  "the Publish box. For Status, Visibility, and Publish (immediately), click on "
1233
  "future or backdate a reply."
1234
  msgstr ""
1235
 
1236
+ #: includes/admin/replies.php:212
 
 
 
 
 
 
 
 
 
 
 
1237
  msgid ""
1238
  "<strong>Featured Image</strong> - This allows you to associate an image with "
1239
  "your reply without inserting it. This is usually useful only if your theme "
1241
  "custom header, etc."
1242
  msgstr ""
1243
 
1244
+ #: includes/admin/replies.php:217 includes/admin/replies.php:255
1245
  msgid "Reply Attributes"
1246
  msgstr ""
1247
 
1248
+ #: includes/admin/replies.php:219
1249
  msgid "Select the attributes that your reply should have:"
1250
  msgstr ""
1251
 
1252
+ #: includes/admin/replies.php:221
1253
  msgid ""
1254
  "<strong>Forum</strong> dropdown determines the parent forum that the reply "
1255
  "belongs to. Select the forum, or leave the default (Use Forum of Topic) to "
1256
  "post the reply in forum of the topic."
1257
  msgstr ""
1258
 
1259
+ #: includes/admin/replies.php:222
1260
  msgid ""
1261
  "<strong>Topic</strong> determines the parent topic that the reply belongs to."
1262
  msgstr ""
1263
 
1264
+ #: includes/admin/replies.php:223
1265
+ msgid "<strong>Reply To</strong> determines the threading of the reply."
 
 
1266
  msgstr ""
1267
 
1268
+ #: includes/admin/replies.php:347 includes/admin/topics.php:363
1269
  #: templates/default/bbpress/form-anonymous.php:17
1270
  msgid "Author Information"
1271
  msgstr ""
1272
 
1273
+ #: includes/admin/replies.php:461
1274
  msgid "The reply was not found!"
1275
  msgstr ""
1276
 
1277
+ #: includes/admin/replies.php:464 includes/admin/topics.php:488
1278
  msgid "You do not have the permission to do that!"
1279
  msgstr ""
1280
 
1281
+ #: includes/admin/replies.php:532
1282
  msgid "There was a problem marking the reply \"%1$s\" as spam."
1283
  msgstr ""
1284
 
1285
+ #: includes/admin/replies.php:532
1286
  msgid "Reply \"%1$s\" successfully marked as spam."
1287
  msgstr ""
1288
 
1289
+ #: includes/admin/replies.php:536
1290
  msgid "There was a problem unmarking the reply \"%1$s\" as spam."
1291
  msgstr ""
1292
 
1293
+ #: includes/admin/replies.php:536
1294
  msgid "Reply \"%1$s\" successfully unmarked as spam."
1295
  msgstr ""
1296
 
1297
+ #: includes/admin/replies.php:569
1298
  msgid "Title"
1299
  msgstr ""
1300
 
1301
+ #: includes/admin/replies.php:572 includes/admin/topics.php:636
1302
  #: templates/default/bbpress/loop-replies.php:18
1303
+ #: templates/default/bbpress/loop-replies.php:60
1304
  #: templates/default/bbpress/loop-search.php:18
1305
  #: templates/default/bbpress/loop-search.php:40
1306
  msgid "Author"
1307
  msgstr ""
1308
 
1309
+ #: includes/admin/replies.php:626 includes/admin/replies.php:634
1310
  msgid "No Topic"
1311
  msgstr ""
1312
 
1313
+ #: includes/admin/replies.php:652 includes/admin/replies.php:667
1314
+ #: includes/admin/topics.php:688
1315
  msgid "No Forum"
1316
  msgstr ""
1317
 
1318
+ #: includes/admin/replies.php:658
1319
  msgid "(Mismatch)"
1320
  msgstr ""
1321
 
1322
+ #: includes/admin/replies.php:726 includes/admin/topics.php:777
1323
  msgid "View &#8220;%s&#8221;"
1324
  msgstr ""
1325
 
1326
+ #: includes/admin/replies.php:726 includes/admin/topics.php:777
1327
  msgid "View"
1328
  msgstr ""
1329
 
1330
+ #: includes/admin/replies.php:737
1331
  msgid "Mark the reply as not spam"
1332
  msgstr ""
1333
 
1334
+ #: includes/admin/replies.php:737 includes/admin/topics.php:808
1335
  msgid "Not spam"
1336
  msgstr ""
1337
 
1338
+ #: includes/admin/replies.php:739
1339
  msgid "Mark this reply as spam"
1340
  msgstr ""
1341
 
1342
+ #: includes/admin/replies.php:739 includes/admin/topics.php:810
1343
+ #: includes/replies/template.php:2014 includes/topics/template.php:2721
 
1344
  msgid "Spam"
1345
  msgstr ""
1346
 
1347
+ #: includes/admin/replies.php:748 includes/admin/topics.php:818
1348
+ #: includes/replies/template.php:1956 includes/topics/template.php:2477
 
1349
  msgid "Restore this item from the Trash"
1350
  msgstr ""
1351
 
1352
+ #: includes/admin/replies.php:748 includes/admin/topics.php:818
1353
+ #: includes/replies/template.php:1944 includes/topics/template.php:2465
 
1354
  msgid "Restore"
1355
  msgstr ""
1356
 
1357
+ #: includes/admin/replies.php:750 includes/admin/topics.php:820
1358
+ #: includes/replies/template.php:1958 includes/topics/template.php:2479
 
1359
  msgid "Move this item to the Trash"
1360
  msgstr ""
1361
 
1362
+ #: includes/admin/replies.php:750 includes/admin/topics.php:820
1363
+ #: includes/replies/template.php:1943 includes/topics/template.php:2464
 
1364
  msgid "Trash"
1365
  msgstr ""
1366
 
1367
+ #: includes/admin/replies.php:754 includes/admin/topics.php:824
1368
+ #: includes/replies/template.php:1962 includes/topics/template.php:2483
 
1369
  msgid "Delete this item permanently"
1370
  msgstr ""
1371
 
1372
+ #: includes/admin/replies.php:754 includes/admin/topics.php:824
1373
  msgid "Delete Permanently"
1374
  msgstr ""
1375
 
1376
+ #: includes/admin/replies.php:780 includes/admin/topics.php:850
1377
  msgid "Empty Spam"
1378
  msgstr ""
1379
 
1380
+ #: includes/admin/replies.php:790 includes/admin/topics.php:860
1381
  msgid "In all forums"
1382
  msgstr ""
1383
 
1384
+ #: includes/admin/replies.php:850
1385
  msgid "Reply updated. <a href=\"%s\">View topic</a>"
1386
  msgstr ""
1387
 
1388
+ #: includes/admin/replies.php:859
1389
  msgid "Reply updated."
1390
  msgstr ""
1391
 
1392
  #. translators: %s: date and time of the revision
1393
+ #: includes/admin/replies.php:864
1394
  msgid "Reply restored to revision from %s"
1395
  msgstr ""
1396
 
1397
+ #: includes/admin/replies.php:868
1398
  msgid "Reply created. <a href=\"%s\">View topic</a>"
1399
  msgstr ""
1400
 
1401
+ #: includes/admin/replies.php:871
1402
  msgid "Reply saved."
1403
  msgstr ""
1404
 
1405
+ #: includes/admin/replies.php:874
1406
  msgid "Reply submitted. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
1407
  msgstr ""
1408
 
1409
+ #: includes/admin/replies.php:877
1410
  msgid ""
1411
  "Reply scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
1412
  "\">Preview topic</a>"
1413
  msgstr ""
1414
 
1415
+ #: includes/admin/replies.php:884
1416
  msgid "Reply draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
1417
  msgstr ""
1418
 
1419
+ #: includes/admin/settings.php:24
1420
+ msgid "Forum User Settings"
1421
  msgstr ""
1422
 
1423
  #: includes/admin/settings.php:29
1424
+ msgid "Forum Features"
1425
  msgstr ""
1426
 
1427
+ #: includes/admin/settings.php:34
1428
+ msgid "Forum Theme Packages"
1429
  msgstr ""
1430
 
1431
  #: includes/admin/settings.php:39
1432
+ msgid "Topics and Replies Per Page"
1433
  msgstr ""
1434
 
1435
  #: includes/admin/settings.php:44
1436
+ msgid "Topics and Replies Per RSS Page"
1437
  msgstr ""
1438
 
1439
  #: includes/admin/settings.php:49
1440
+ msgid "Forum Root Slug"
1441
  msgstr ""
1442
 
1443
  #: includes/admin/settings.php:54
1444
+ msgid "Single Forum Slugs"
1445
  msgstr ""
1446
 
1447
  #: includes/admin/settings.php:59
1448
+ msgid "Forum User Slugs"
1449
+ msgstr ""
1450
+
1451
+ #: includes/admin/settings.php:64
1452
+ msgid "BuddyPress Integration"
1453
  msgstr ""
1454
 
1455
+ #: includes/admin/settings.php:69
1456
+ msgid "Akismet Integration"
1457
+ msgstr ""
1458
+
1459
+ #: includes/admin/settings.php:91
1460
  msgid "Disallow editing after"
1461
  msgstr ""
1462
 
1463
+ #: includes/admin/settings.php:99
1464
  msgid "Throttle posting every"
1465
  msgstr ""
1466
 
1467
+ #: includes/admin/settings.php:107
1468
+ msgid "Anonymous posting"
1469
+ msgstr ""
1470
+
1471
+ #: includes/admin/settings.php:115
1472
+ msgid "Auto role"
1473
+ msgstr ""
1474
+
1475
+ #: includes/admin/settings.php:134 includes/admin/settings.php:1688
1476
  msgid "Revisions"
1477
  msgstr ""
1478
 
1479
+ #: includes/admin/settings.php:142 includes/extend/buddypress/loader.php:213
1480
  #: templates/default/bbpress/user-details.php:48
1481
  msgid "Favorites"
1482
  msgstr ""
1483
 
1484
+ #: includes/admin/settings.php:150 includes/extend/buddypress/loader.php:225
1485
  #: templates/default/bbpress/user-details.php:58
1486
  msgid "Subscriptions"
1487
  msgstr ""
1488
 
1489
+ #: includes/admin/settings.php:158
1490
  msgid "Topic tags"
1491
  msgstr ""
1492
 
1493
+ #: includes/admin/settings.php:174
1494
+ msgid "Post Formatting"
 
 
 
 
 
 
 
 
 
 
 
 
1495
  msgstr ""
1496
 
1497
+ #: includes/admin/settings.php:182
1498
  msgid "Auto-embed links"
1499
  msgstr ""
1500
 
1501
+ #: includes/admin/settings.php:190
1502
+ msgid "Reply Threading"
1503
  msgstr ""
1504
 
1505
+ #: includes/admin/settings.php:209
1506
+ msgid "Current Package"
1507
  msgstr ""
1508
 
1509
+ #: includes/admin/settings.php:264
1510
+ msgid "Forum Root"
1511
  msgstr ""
1512
 
1513
+ #: includes/admin/settings.php:272
1514
  msgid "Forum Prefix"
1515
  msgstr ""
1516
 
1517
+ #: includes/admin/settings.php:280
1518
+ msgid "Forum root should show"
1519
  msgstr ""
1520
 
1521
+ #: includes/admin/settings.php:317
1522
+ msgid "Topic View"
1523
  msgstr ""
1524
 
1525
+ #: includes/admin/settings.php:346
1526
+ msgid "User Base"
1527
  msgstr ""
1528
 
1529
+ #: includes/admin/settings.php:354 includes/extend/buddypress/loader.php:191
1530
+ #: includes/extend/buddypress/loader.php:264
1531
+ #: templates/default/bbpress/user-details.php:35
1532
+ msgid "Topics Started"
1533
  msgstr ""
1534
 
1535
+ #: includes/admin/settings.php:362 includes/extend/buddypress/loader.php:202
1536
+ #: includes/extend/buddypress/loader.php:272
1537
+ #: templates/default/bbpress/user-details.php:41
1538
+ msgid "Replies Created"
1539
  msgstr ""
1540
 
1541
+ #: includes/admin/settings.php:370 includes/extend/buddypress/loader.php:280
1542
+ msgid "Favorite Topics"
1543
  msgstr ""
1544
 
1545
+ #: includes/admin/settings.php:378
1546
+ msgid "Topic Subscriptions"
1547
  msgstr ""
1548
 
1549
+ #: includes/admin/settings.php:391
1550
  msgid "Enable Group Forums"
1551
  msgstr ""
1552
 
1553
+ #: includes/admin/settings.php:399
1554
  msgid "Group Forums Parent"
1555
  msgstr ""
1556
 
1557
+ #: includes/admin/settings.php:412
1558
  msgid "Use Akismet"
1559
  msgstr ""
1560
 
1561
+ #: includes/admin/settings.php:450
1562
+ msgid "Setting time limits and other user posting capabilities"
1563
  msgstr ""
1564
 
1565
+ #: includes/admin/settings.php:467 includes/common/functions.php:123
1566
  msgid "minutes"
1567
  msgstr ""
1568
 
1569
+ #: includes/admin/settings.php:483 includes/common/functions.php:124
1570
  msgid "seconds"
1571
  msgstr ""
1572
 
1573
+ #: includes/admin/settings.php:499
1574
+ msgid "Allow guest users without accounts to create topics and replies"
1575
+ msgstr ""
1576
+
1577
+ #: includes/admin/settings.php:533
1578
+ msgid "Automatically give registered visitors the %s forum role"
1579
+ msgstr ""
1580
+
1581
+ #: includes/admin/settings.php:549
1582
+ msgid "Forum features that can be toggled on and off"
1583
+ msgstr ""
1584
+
1585
+ #: includes/admin/settings.php:565
1586
  msgid "Allow users to mark topics as favorites"
1587
  msgstr ""
1588
 
1589
+ #: includes/admin/settings.php:581
1590
  msgid "Allow users to subscribe to topics"
1591
  msgstr ""
1592
 
1593
+ #: includes/admin/settings.php:597
1594
  msgid "Allow topics to have tags"
1595
  msgstr ""
1596
 
1597
+ #: includes/admin/settings.php:613
1598
+ msgid "Allow forum wide search"
1599
  msgstr ""
1600
 
1601
+ #: includes/admin/settings.php:650
1602
+ msgid "Enable threaded (nested) replies %s levels deep"
1603
  msgstr ""
1604
 
1605
+ #: includes/admin/settings.php:667
1606
+ msgid "Allow topic and reply revision logging"
 
 
1607
  msgstr ""
1608
 
1609
+ #: includes/admin/settings.php:683
1610
+ msgid "Add toolbar & buttons to textareas to help with HTML formatting"
1611
  msgstr ""
1612
 
1613
+ #: includes/admin/settings.php:696
1614
  msgid "How your forum content is displayed within your existing theme."
1615
  msgstr ""
1616
 
1617
+ #: includes/admin/settings.php:720
1618
  msgid "%1$s - %2$s"
1619
  msgstr ""
1620
 
1621
+ #: includes/admin/settings.php:726
1622
  msgid "will serve all bbPress templates"
1623
  msgstr ""
1624
 
1625
+ #: includes/admin/settings.php:730
1626
  msgid "No template packages available."
1627
  msgstr ""
1628
 
1629
+ #: includes/admin/settings.php:746
1630
  msgid ""
1631
  "Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and "
1632
  "replies"
1633
  msgstr ""
1634
 
1635
+ #: includes/admin/settings.php:761
1636
  msgid "How many topics and replies to show per page"
1637
  msgstr ""
1638
 
1639
+ #: includes/admin/settings.php:777 includes/admin/settings.php:793
1640
+ #: includes/admin/settings.php:824 includes/admin/settings.php:840
1641
  msgid "per page"
1642
  msgstr ""
1643
 
1644
+ #: includes/admin/settings.php:808
1645
  msgid "How many topics and replies to show per RSS page"
1646
  msgstr ""
1647
 
1648
+ #: includes/admin/settings.php:858
1649
  msgid ""
1650
+ "Customize your Forums root. Partner with a WordPress Page and use Shortcodes "
1651
+ "for more flexibility."
1652
  msgstr ""
1653
 
1654
+ #: includes/admin/settings.php:891
1655
+ msgid "Prefix all forum content with the Forum Root slug (Recommended)"
1656
+ msgstr ""
1657
+
1658
+ #: includes/admin/settings.php:911
1659
+ msgid "Forum Index"
1660
+ msgstr ""
1661
+
1662
+ #: includes/admin/settings.php:914
1663
+ msgid "Topics by Freshness"
1664
  msgstr ""
1665
 
1666
+ #: includes/admin/settings.php:941
1667
+ msgid "Customize your user profile slugs."
1668
  msgstr ""
1669
 
1670
+ #: includes/admin/settings.php:1041
1671
+ msgid ""
1672
+ "Custom slugs for single forums, topics, replies, tags, views, and search."
1673
+ msgstr ""
1674
+
1675
+ #: includes/admin/settings.php:1159
1676
  msgid "Forum settings for BuddyPress"
1677
  msgstr ""
1678
 
1679
+ #: includes/admin/settings.php:1175
1680
  msgid "Allow BuddyPress Groups to have their own forums"
1681
  msgstr ""
1682
 
1683
+ #: includes/admin/settings.php:1192
1684
  msgid "&mdash; Forum root &mdash;"
1685
  msgstr ""
1686
 
1687
+ #: includes/admin/settings.php:1200
1688
  msgid "is the parent for all group forums"
1689
  msgstr ""
1690
 
1691
+ #: includes/admin/settings.php:1201
1692
  msgid ""
1693
  "Using the Forum Root is not recommended. Changing this does not move "
1694
  "existing forums."
1695
  msgstr ""
1696
 
1697
+ #: includes/admin/settings.php:1216
1698
  msgid "Forum settings for Akismet"
1699
  msgstr ""
1700
 
1701
+ #: includes/admin/settings.php:1233
1702
  msgid "Allow Akismet to actively prevent forum spam."
1703
  msgstr ""
1704
 
1705
+ #: includes/admin/settings.php:1256
1706
  msgid "Forums Settings"
1707
  msgstr ""
1708
 
1709
+ #: includes/admin/settings.php:1265
1710
  #: templates/default/bbpress/form-user-edit.php:173
1711
  msgid "Save Changes"
1712
  msgstr ""
1713
 
1714
+ #: includes/admin/settings.php:1284
1715
  msgid ""
1716
  "Information about your previous forums database so that they can be "
1717
  "converted. <strong>Backup your database before proceeding.</strong>"
1718
  msgstr ""
1719
 
1720
+ #: includes/admin/settings.php:1314
1721
  msgid "is the previous forum software"
1722
  msgstr ""
1723
 
1724
+ #: includes/admin/settings.php:1328
1725
  msgid "IP or hostname"
1726
  msgstr ""
1727
 
1728
+ #: includes/admin/settings.php:1342
1729
  msgid "Use default 3306 if unsure"
1730
  msgstr ""
1731
 
1732
+ #: includes/admin/settings.php:1356
1733
  msgid "User for your database connection"
1734
  msgstr ""
1735
 
1736
+ #: includes/admin/settings.php:1370
1737
  msgid "Password to access the database"
1738
  msgstr ""
1739
 
1740
+ #: includes/admin/settings.php:1384
1741
  msgid "Name of the database with your old forum data"
1742
  msgstr ""
1743
 
1744
+ #: includes/admin/settings.php:1397
1745
  msgid "Some optional parameters to help tune the conversion process."
1746
  msgstr ""
1747
 
1748
+ #: includes/admin/settings.php:1411
1749
  msgid ""
1750
  "(If converting from BuddyPress Forums, use \"wp_bb_\" or your custom prefix)"
1751
  msgstr ""
1752
 
1753
+ #: includes/admin/settings.php:1425
1754
  msgid "rows to process at a time"
1755
  msgstr ""
1756
 
1757
+ #: includes/admin/settings.php:1426
1758
  msgid "Keep this low if you experience out-of-memory issues."
1759
  msgstr ""
1760
 
1761
+ #: includes/admin/settings.php:1440
1762
  msgid "second(s) delay between each group of rows"
1763
  msgstr ""
1764
 
1765
+ #: includes/admin/settings.php:1441
1766
  msgid "Keep this high to prevent too-many-connection issues."
1767
  msgstr ""
1768
 
1769
+ #: includes/admin/settings.php:1455
1770
  msgid "Start a fresh conversion from the beginning"
1771
  msgstr ""
1772
 
1773
+ #: includes/admin/settings.php:1456
1774
  msgid "You should clean old conversion information before starting over."
1775
  msgstr ""
1776
 
1777
+ #: includes/admin/settings.php:1470
1778
  msgid "Purge all information from a previously attempted import"
1779
  msgstr ""
1780
 
1781
+ #: includes/admin/settings.php:1471
1782
  msgid ""
1783
  "Use this if an import failed and you want to remove that incomplete data."
1784
  msgstr ""
1785
 
1786
+ #: includes/admin/settings.php:1485
1787
  msgid "Attempt to import user accounts from previous forums"
1788
  msgstr ""
1789
 
1790
+ #: includes/admin/settings.php:1486
1791
  msgid ""
1792
  "Non-bbPress passwords cannot be automatically converted. They will be "
1793
  "converted as each user logs in."
1794
  msgstr ""
1795
 
1796
+ #: includes/admin/settings.php:1516
1797
  msgid "Start"
1798
  msgstr ""
1799
 
1800
+ #: includes/admin/settings.php:1517
1801
  msgid "Stop"
1802
  msgstr ""
1803
 
1804
+ #: includes/admin/settings.php:1548
1805
  msgid "This screen provides access to all of the Forums settings."
1806
  msgstr ""
1807
 
1808
+ #: includes/admin/settings.php:1549
1809
  msgid ""
1810
  "Please see the additional help tabs for more information on each indiviual "
1811
  "section."
1812
  msgstr ""
1813
 
1814
+ #: includes/admin/settings.php:1555
1815
+ msgid "Main Settings"
1816
+ msgstr ""
1817
+
1818
+ #: includes/admin/settings.php:1556
1819
  msgid "In the Main Settings you have a number of options:"
1820
  msgstr ""
1821
 
1822
+ #: includes/admin/settings.php:1559
1823
  msgid ""
1824
  "You can choose to lock a post after a certain number of minutes. \"Locking "
1825
  "post editing\" will prevent the author from editing some amount of time "
1826
  "after saving a post."
1827
  msgstr ""
1828
 
1829
+ #: includes/admin/settings.php:1560
1830
  msgid ""
1831
  "\"Throttle time\" is the amount of time required between posts from a single "
1832
  "author. The higher the throttle time, the longer a user will need to wait "
1833
  "between posting to the forum."
1834
  msgstr ""
1835
 
1836
+ #: includes/admin/settings.php:1561
1837
  msgid ""
1838
  "Favorites are a way for users to save and later return to topics they favor. "
1839
  "This is enabled by default."
1840
  msgstr ""
1841
 
1842
+ #: includes/admin/settings.php:1562
1843
  msgid ""
1844
  "Subscriptions allow users to subscribe for notifications to topics that "
1845
  "interest them. This is enabled by default."
1846
  msgstr ""
1847
 
1848
+ #: includes/admin/settings.php:1563
1849
  msgid ""
1850
  "Topic-Tags allow users to filter topics between forums. This is enabled by "
1851
  "default."
1852
  msgstr ""
1853
 
1854
+ #: includes/admin/settings.php:1564
1855
  msgid ""
1856
  "\"Anonymous Posting\" allows guest users who do not have accounts on your "
1857
  "site to both create topics as well as replies."
1858
  msgstr ""
1859
 
1860
+ #: includes/admin/settings.php:1565
1861
  msgid ""
1862
  "The Fancy Editor brings the luxury of the Visual editor and HTML editor from "
1863
  "the traditional WordPress dashboard into your theme."
1864
  msgstr ""
1865
 
1866
+ #: includes/admin/settings.php:1566
1867
  msgid ""
1868
  "Auto-embed will embed the media content from a URL directly into the "
1869
  "replies. For example: links to Flickr and YouTube."
1870
  msgstr ""
1871
 
1872
+ #: includes/admin/settings.php:1569
1873
  msgid ""
1874
  "You must click the Save Changes button at the bottom of the screen for new "
1875
  "settings to take effect."
1876
  msgstr ""
1877
 
1878
+ #: includes/admin/settings.php:1575
1879
+ msgid "Per Page"
1880
+ msgstr ""
1881
+
1882
+ #: includes/admin/settings.php:1576
1883
  msgid ""
1884
  "Per Page settings allow you to control the number of topics and replies "
1885
  "appear on each page."
1886
  msgstr ""
1887
 
1888
+ #: includes/admin/settings.php:1577
1889
  msgid ""
1890
  "This is comparable to the WordPress \"Reading Settings\" page, where you can "
1891
  "set the number of posts that should show on blog pages and in feeds."
1892
  msgstr ""
1893
 
1894
+ #: includes/admin/settings.php:1578
1895
  msgid ""
1896
  "These are broken up into two separate groups: one for what appears in your "
1897
  "theme, another for RSS feeds."
1898
  msgstr ""
1899
 
1900
+ #: includes/admin/settings.php:1584
1901
  msgid "Slugs"
1902
  msgstr ""
1903
 
1904
+ #: includes/admin/settings.php:1585
1905
  msgid ""
1906
  "The Slugs section allows you to control the permalink structure for your "
1907
  "forums."
1908
  msgstr ""
1909
 
1910
+ #: includes/admin/settings.php:1586
1911
  msgid ""
1912
  "\"Archive Slugs\" are used as the \"root\" for your forums and topics. If "
1913
  "you combine these values with existing page slugs, bbPress will attempt to "
1914
  "output the most correct title and content."
1915
  msgstr ""
1916
 
1917
+ #: includes/admin/settings.php:1587
1918
  msgid ""
1919
  "\"Single Slugs\" are used as a prefix when viewing an individual forum, "
1920
  "topic, reply, user, or view."
1921
  msgstr ""
1922
 
1923
+ #: includes/admin/settings.php:1588
1924
  msgid ""
1925
  "In the event of a slug collision with WordPress or BuddyPress, a warning "
1926
  "will appear next to the problem slug(s)."
1927
  msgstr ""
1928
 
1929
+ #: includes/admin/settings.php:1686
1930
  #: templates/default/bbpress/loop-forums.php:21
1931
  #: templates/default/bbpress/loop-replies.php:24
1932
+ #: templates/default/bbpress/loop-replies.php:66
1933
  #: templates/default/bbpress/loop-topics.php:21
1934
  msgid "Posts"
1935
  msgstr ""
1936
 
1937
+ #: includes/admin/settings.php:1687
1938
  msgid "Pages"
1939
  msgstr ""
1940
 
1941
+ #: includes/admin/settings.php:1689
1942
  msgid "Attachments"
1943
  msgstr ""
1944
 
1945
+ #: includes/admin/settings.php:1690
1946
  msgid "Menus"
1947
  msgstr ""
1948
 
1949
+ #: includes/admin/settings.php:1693
1950
  msgid "Tag base"
1951
  msgstr ""
1952
 
1953
+ #: includes/admin/settings.php:1696
1954
  msgid "Category base"
1955
  msgstr ""
1956
 
1957
+ #: includes/admin/settings.php:1701
1958
+ msgid "Forums base"
1959
+ msgstr ""
1960
+
1961
+ #: includes/admin/settings.php:1704
1962
+ msgid "Topics base"
1963
+ msgstr ""
1964
+
1965
+ #: includes/admin/settings.php:1707
1966
+ msgid "Forum slug"
1967
+ msgstr ""
1968
+
1969
+ #: includes/admin/settings.php:1710
1970
+ msgid "Topic slug"
1971
+ msgstr ""
1972
+
1973
+ #: includes/admin/settings.php:1713
1974
+ msgid "Reply slug"
1975
+ msgstr ""
1976
+
1977
+ #: includes/admin/settings.php:1716
1978
  msgid "User base"
1979
  msgstr ""
1980
 
1981
+ #: includes/admin/settings.php:1719
1982
  msgid "View base"
1983
  msgstr ""
1984
 
1985
+ #: includes/admin/settings.php:1722
1986
+ msgid "Topic tag slug"
1987
+ msgstr ""
1988
+
1989
+ #: includes/admin/settings.php:1734
1990
  msgid "%s page"
1991
  msgstr ""
1992
 
1993
+ #: includes/admin/settings.php:1753
1994
+ msgid "Possible %1$s conflict: %2$s"
1995
  msgstr ""
1996
 
1997
  #: includes/admin/tools.php:36
2094
  #: includes/admin/tools.php:510 includes/admin/tools.php:555
2095
  #: includes/admin/tools.php:600 includes/admin/tools.php:662
2096
  #: includes/admin/tools.php:730 includes/admin/tools.php:778
2097
+ #: includes/admin/tools.php:884 includes/admin/tools.php:944
2098
+ #: includes/admin/tools.php:965 includes/admin/tools.php:1019
2099
  msgid "Failed!"
2100
  msgstr ""
2101
 
2104
  #: includes/admin/tools.php:493 includes/admin/tools.php:538
2105
  #: includes/admin/tools.php:583 includes/admin/tools.php:645
2106
  #: includes/admin/tools.php:706 includes/admin/tools.php:868
2107
+ #: includes/admin/tools.php:925 includes/admin/tools.php:948
2108
+ #: includes/admin/tools.php:1003 includes/admin/tools.php:1048
2109
  msgid "Complete!"
2110
  msgstr ""
2111
 
2179
  msgid "Repairing the sticky topic to the parent forum relationships&hellip; %s"
2180
  msgstr ""
2181
 
2182
+ #: includes/admin/tools.php:940
2183
  msgid "Recalculating forum visibility &hellip; %s"
2184
  msgstr ""
2185
 
2186
+ #: includes/admin/tools.php:964
2187
  msgid "Recalculating the forum for each post &hellip; %s"
2188
  msgstr ""
2189
 
2190
+ #: includes/admin/tools.php:1018
2191
  msgid "Recalculating the topic for each post &hellip; %s"
2192
  msgstr ""
2193
 
2194
+ #: includes/admin/tools.php:1071
2195
  msgid ""
2196
  "This will revert your forums back to a brand new installation. This process "
2197
  "cannot be undone. <strong>Backup your database before proceeding</strong>."
2198
  msgstr ""
2199
 
2200
+ #: includes/admin/tools.php:1077
2201
  msgid "The following data will be removed:"
2202
  msgstr ""
2203
 
2204
+ #: includes/admin/tools.php:1082
2205
  msgid "All Topic Tags"
2206
  msgstr ""
2207
 
2208
+ #: includes/admin/tools.php:1083
2209
  msgid "Related Meta Data"
2210
  msgstr ""
2211
 
2212
+ #: includes/admin/tools.php:1084
2213
  msgid "Forum Settings"
2214
  msgstr ""
2215
 
2216
+ #: includes/admin/tools.php:1085
2217
  msgid "Forum Activity"
2218
  msgstr ""
2219
 
2220
+ #: includes/admin/tools.php:1086
2221
  msgid "Forum User Roles"
2222
  msgstr ""
2223
 
2224
+ #: includes/admin/tools.php:1087
2225
  msgid "Importer Helper Data"
2226
  msgstr ""
2227
 
2228
+ #: includes/admin/tools.php:1091
2229
  msgid "Are you sure you want to do this?"
2230
  msgstr ""
2231
 
2232
+ #: includes/admin/tools.php:1094
2233
  msgid "Say it ain't so!"
2234
  msgstr ""
2235
 
2236
+ #: includes/admin/tools.php:1095
2237
  msgid "This process cannot be undone."
2238
  msgstr ""
2239
 
2240
+ #: includes/admin/tools.php:1103
2241
  msgid "Reset bbPress"
2242
  msgstr ""
2243
 
2244
+ #: includes/admin/tools.php:1136
2245
  msgid "Failed"
2246
  msgstr ""
2247
 
2248
+ #: includes/admin/tools.php:1137
2249
  msgid "Success!"
2250
  msgstr ""
2251
 
2252
+ #: includes/admin/tools.php:1144
2253
  msgid "Deleting Posts&hellip; %s"
2254
  msgstr ""
2255
 
2256
+ #: includes/admin/tools.php:1157
2257
  msgid "Deleting Post Meta&hellip; %s"
2258
  msgstr ""
2259
 
2260
+ #: includes/admin/tools.php:1166
2261
  msgid "Deleting Topic Tags&hellip; %s"
2262
  msgstr ""
2263
 
2264
+ #: includes/admin/tools.php:1173
2265
  msgid "Deleting User Meta&hellip; %s"
2266
  msgstr ""
2267
 
2268
+ #: includes/admin/tools.php:1180
2269
  msgid "Deleting Conversion Table&hellip; %s"
2270
  msgstr ""
2271
 
2272
+ #: includes/admin/tools.php:1192
2273
  msgid "Deleting Settings&hellip; %s"
2274
  msgstr ""
2275
 
2276
+ #: includes/admin/tools.php:1198
2277
  msgid "Deleting Roles and Capabilities&hellip; %s"
2278
  msgstr ""
2279
 
2280
+ #: includes/admin/topics.php:134
2281
  msgid ""
2282
  "This screen displays the individual topics on your site. You can customize "
2283
  "the display of this screen to suit your workflow."
2284
  msgstr ""
2285
 
2286
+ #: includes/admin/topics.php:144
2287
  msgid ""
2288
  "You can hide/display columns based on your needs and decide how many topics "
2289
  "to list per screen using the Screen Options tab."
2290
  msgstr ""
2291
 
2292
+ #: includes/admin/topics.php:145
2293
  msgid ""
2294
  "You can filter the list of topics by topic status using the text links in "
2295
  "the upper left to show All, Published, or Trashed topics. The default view "
2296
  "is to show all topics."
2297
  msgstr ""
2298
 
2299
+ #: includes/admin/topics.php:146
2300
  msgid ""
2301
  "You can refine the list to show only topics from a specific month by using "
2302
  "the dropdown menus above the topics list. Click the Filter button after "
2304
  "creator in the topics list."
2305
  msgstr ""
2306
 
2307
+ #: includes/admin/topics.php:155
2308
  msgid ""
2309
  "Hovering over a row in the topics list will display action links that allow "
2310
  "you to manage your topic. You can perform the following actions:"
2311
  msgstr ""
2312
 
2313
+ #: includes/admin/topics.php:157
2314
  msgid ""
2315
  "<strong>Edit</strong> takes you to the editing screen for that topic. You "
2316
  "can also reach that screen by clicking on the topic title."
2317
  msgstr ""
2318
 
2319
+ #: includes/admin/topics.php:158
2320
  msgid ""
2321
  "<strong>Trash</strong> removes your topic from this list and places it in "
2322
  "the trash, from which you can permanently delete it."
2323
  msgstr ""
2324
 
2325
+ #: includes/admin/topics.php:159
2326
  msgid ""
2327
  "<strong>Spam</strong> removes your topic from this list and places it in the "
2328
  "spam queue, from which you can permanently delete it."
2329
  msgstr ""
2330
 
2331
+ #: includes/admin/topics.php:160
2332
  msgid ""
2333
  "<strong>Preview</strong> will show you what your draft topic will look like "
2334
  "if you publish it. View will take you to your live site to view the topic. "
2335
  "Which link is available depends on your topic&#8217;s status."
2336
  msgstr ""
2337
 
2338
+ #: includes/admin/topics.php:161
2339
  msgid ""
2340
  "<strong>Close</strong> will mark the selected topic as &#8217;closed&#8217; "
2341
  "and disable the option to post new replies to the topic."
2342
  msgstr ""
2343
 
2344
+ #: includes/admin/topics.php:162
2345
  msgid ""
2346
  "<strong>Stick</strong> will keep the selected topic &#8217;pinned&#8217; to "
2347
  "the top the parent forum topic list."
2348
  msgstr ""
2349
 
2350
+ #: includes/admin/topics.php:163
2351
  msgid ""
2352
  "<strong>Stick <em>(to front)</em></strong> will keep the selected topic "
2353
  "&#8217;pinned&#8217; to the top of ALL forums and be visable in any forums "
2354
  "topics list."
2355
  msgstr ""
2356
 
2357
+ #: includes/admin/topics.php:172
2358
  msgid ""
2359
  "You can also edit or move multiple topics to the trash at once. Select the "
2360
  "topics you want to act on using the checkboxes, then select the action you "
2361
  "want to take from the Bulk Actions menu and click Apply."
2362
  msgstr ""
2363
 
2364
+ #: includes/admin/topics.php:173
2365
  msgid ""
2366
  "When using Bulk Edit, you can change the metadata (categories, author, etc.) "
2367
  "for all selected topics at once. To remove a topic from the grouping, just "
2368
  "click the x next to its name in the Bulk Edit area that appears."
2369
  msgstr ""
2370
 
2371
+ #: includes/admin/topics.php:194
2372
  msgid ""
2373
  "The title field and the big topic editing Area are fixed in place, but you "
2374
  "can reposition all the other boxes using drag and drop, and can minimize or "
2378
  "screen."
2379
  msgstr ""
2380
 
2381
+ #: includes/admin/topics.php:204
2382
  msgid "Title and Topic Editor"
2383
  msgstr ""
2384
 
2385
+ #: includes/admin/topics.php:206
2386
  msgid ""
2387
  "<strong>Title</strong> - Enter a title for your topic. After you enter a "
2388
  "title, you&#8217;ll see the permalink below, which you can edit."
2389
  msgstr ""
2390
 
2391
+ #: includes/admin/topics.php:207
2392
  msgid ""
2393
  "<strong>Topic Editor</strong> - Enter the text for your topic. There are two "
2394
  "modes of editing: Visual and HTML. Choose the mode by clicking on the "
2402
  "over the top area. Exit Fullscreen back to the regular topic editor."
2403
  msgstr ""
2404
 
2405
+ #: includes/admin/topics.php:210
2406
  msgid ""
2407
  "<strong>Publish</strong> - You can set the terms of publishing your topic in "
2408
  "the Publish box. For Status, Visibility, and Publish (immediately), click on "
2413
  "future or backdate a topic."
2414
  msgstr ""
2415
 
2416
+ #: includes/admin/topics.php:213
 
 
 
 
 
 
 
 
 
 
 
2417
  msgid ""
2418
  "<strong>Featured Image</strong> - This allows you to associate an image with "
2419
  "your topic without inserting it. This is usually useful only if your theme "
2421
  "custom header, etc."
2422
  msgstr ""
2423
 
2424
+ #: includes/admin/topics.php:218 includes/admin/topics.php:255
2425
  msgid "Topic Attributes"
2426
  msgstr ""
2427
 
2428
+ #: includes/admin/topics.php:220
2429
  msgid "Select the attributes that your topic should have:"
2430
  msgstr ""
2431
 
2432
+ #: includes/admin/topics.php:222
2433
  msgid ""
2434
  "<strong>Forum</strong> dropdown determines the parent forum that the topic "
2435
  "belongs to. Select the forum or category from the dropdown, or leave the "
2436
  "default (No Forum) to post the topic without an assigned forum."
2437
  msgstr ""
2438
 
2439
+ #: includes/admin/topics.php:223
2440
  msgid ""
2441
  "<strong>Topic Type</strong> dropdown indicates the sticky status of the "
2442
  "topic. Selecting the super sticky option would stick the topic to the front "
2444
  "its respective forum. Selecting normal would not stick the topic anywhere."
2445
  msgstr ""
2446
 
2447
+ #: includes/admin/topics.php:485
 
 
 
 
 
 
2448
  msgid "The topic was not found!"
2449
  msgstr ""
2450
 
2451
+ #: includes/admin/topics.php:575
2452
  msgid "There was a problem opening the topic \"%1$s\"."
2453
  msgstr ""
2454
 
2455
+ #: includes/admin/topics.php:575
2456
  msgid "Topic \"%1$s\" successfully opened."
2457
  msgstr ""
2458
 
2459
+ #: includes/admin/topics.php:579
2460
  msgid "There was a problem closing the topic \"%1$s\"."
2461
  msgstr ""
2462
 
2463
+ #: includes/admin/topics.php:579
2464
  msgid "Topic \"%1$s\" successfully closed."
2465
  msgstr ""
2466
 
2467
+ #: includes/admin/topics.php:583
2468
  msgid "There was a problem sticking the topic \"%1$s\" to front."
2469
  msgstr ""
2470
 
2471
+ #: includes/admin/topics.php:583
2472
  msgid "Topic \"%1$s\" successfully sticked to front."
2473
  msgstr ""
2474
 
2475
+ #: includes/admin/topics.php:587
2476
  msgid "There was a problem sticking the topic \"%1$s\"."
2477
  msgstr ""
2478
 
2479
+ #: includes/admin/topics.php:587
2480
  msgid "Topic \"%1$s\" successfully sticked."
2481
  msgstr ""
2482
 
2483
+ #: includes/admin/topics.php:591
2484
  msgid "There was a problem unsticking the topic \"%1$s\"."
2485
  msgstr ""
2486
 
2487
+ #: includes/admin/topics.php:591
2488
  msgid "Topic \"%1$s\" successfully unsticked."
2489
  msgstr ""
2490
 
2491
+ #: includes/admin/topics.php:595
2492
  msgid "There was a problem marking the topic \"%1$s\" as spam."
2493
  msgstr ""
2494
 
2495
+ #: includes/admin/topics.php:595
2496
  msgid "Topic \"%1$s\" successfully marked as spam."
2497
  msgstr ""
2498
 
2499
+ #: includes/admin/topics.php:599
2500
  msgid "There was a problem unmarking the topic \"%1$s\" as spam."
2501
  msgstr ""
2502
 
2503
+ #: includes/admin/topics.php:599
2504
  msgid "Topic \"%1$s\" successfully unmarked as spam."
2505
  msgstr ""
2506
 
2507
+ #: includes/admin/topics.php:635 templates/default/bbpress/loop-topics.php:20
2508
  msgid "Voices"
2509
  msgstr ""
2510
 
2511
+ #: includes/admin/topics.php:695 includes/extend/buddypress/groups.php:291
2512
+ #: templates/default/bbpress/form-topic.php:117
2513
  msgid "(No Forum)"
2514
  msgstr ""
2515
 
2516
+ #: includes/admin/topics.php:730 includes/topics/template.php:1911
2517
  msgid "No Replies"
2518
  msgstr ""
2519
 
2520
+ #: includes/admin/topics.php:787
2521
  msgid "Close this topic"
2522
  msgstr ""
2523
 
2524
+ #: includes/admin/topics.php:787
2525
  msgctxt "Close a Topic"
2526
  msgid "Close"
2527
  msgstr ""
2528
 
2529
+ #: includes/admin/topics.php:789
2530
  msgid "Open this topic"
2531
  msgstr ""
2532
 
2533
+ #: includes/admin/topics.php:789
2534
  msgctxt "Open a Topic"
2535
  msgid "Open"
2536
  msgstr ""
2537
 
2538
+ #: includes/admin/topics.php:798
2539
  msgid "Unstick this topic"
2540
  msgstr ""
2541
 
2542
+ #: includes/admin/topics.php:798 includes/topics/template.php:2595
2543
  msgid "Unstick"
2544
  msgstr ""
2545
 
2546
+ #: includes/admin/topics.php:801
2547
  msgid "Stick this topic to its forum"
2548
  msgstr ""
2549
 
2550
+ #: includes/admin/topics.php:801 includes/topics/template.php:2594
2551
  msgid "Stick"
2552
  msgstr ""
2553
 
2554
+ #: includes/admin/topics.php:801
2555
  msgid "Stick this topic to front"
2556
  msgstr ""
2557
 
2558
+ #: includes/admin/topics.php:801 includes/topics/template.php:2596
2559
+ msgid "(to front)"
2560
  msgstr ""
2561
 
2562
+ #: includes/admin/topics.php:808
2563
  msgid "Mark the topic as not spam"
2564
  msgstr ""
2565
 
2566
+ #: includes/admin/topics.php:810
2567
  msgid "Mark this topic as spam"
2568
  msgstr ""
2569
 
2570
+ #: includes/admin/topics.php:920
2571
  msgid "Topic updated. <a href=\"%s\">View topic</a>"
2572
  msgstr ""
2573
 
2574
+ #: includes/admin/topics.php:929
2575
  msgid "Topic updated."
2576
  msgstr ""
2577
 
2578
  #. translators: %s: date and time of the revision
2579
+ #: includes/admin/topics.php:934
2580
  msgid "Topic restored to revision from %s"
2581
  msgstr ""
2582
 
2583
+ #: includes/admin/topics.php:938
2584
  msgid "Topic created. <a href=\"%s\">View topic</a>"
2585
  msgstr ""
2586
 
2587
+ #: includes/admin/topics.php:941
2588
  msgid "Topic saved."
2589
  msgstr ""
2590
 
2591
+ #: includes/admin/topics.php:944
2592
  msgid "Topic submitted. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
2593
  msgstr ""
2594
 
2595
+ #: includes/admin/topics.php:947
2596
  msgid ""
2597
  "Topic scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
2598
  "\">Preview topic</a>"
2599
  msgstr ""
2600
 
2601
+ #: includes/admin/topics.php:954
2602
  msgid "Topic draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
2603
  msgstr ""
2604
 
2608
  msgstr ""
2609
 
2610
  #: includes/admin/users.php:96 includes/admin/users.php:100
2611
+ #: includes/users/template.php:1076
2612
  msgid "&mdash; No role for these forums &mdash;"
2613
  msgstr ""
2614
 
2624
  msgid "Site Role"
2625
  msgstr ""
2626
 
2627
+ #: includes/common/functions.php:112
2628
  msgid "sometime"
2629
  msgstr ""
2630
 
2631
+ #: includes/common/functions.php:113
2632
  msgid "right now"
2633
  msgstr ""
2634
 
2635
+ #: includes/common/functions.php:114
2636
  msgid "%s ago"
2637
  msgstr ""
2638
 
2639
+ #: includes/common/functions.php:118
2640
  msgid "year"
2641
  msgstr ""
2642
 
2643
+ #: includes/common/functions.php:118
2644
  msgid "years"
2645
  msgstr ""
2646
 
2647
+ #: includes/common/functions.php:119
2648
  msgid "month"
2649
  msgstr ""
2650
 
2651
+ #: includes/common/functions.php:119
2652
  msgid "months"
2653
  msgstr ""
2654
 
2655
+ #: includes/common/functions.php:120
2656
  msgid "week"
2657
  msgstr ""
2658
 
2659
+ #: includes/common/functions.php:120
2660
  msgid "weeks"
2661
  msgstr ""
2662
 
2663
+ #: includes/common/functions.php:121
2664
  msgid "day"
2665
  msgstr ""
2666
 
2667
+ #: includes/common/functions.php:121
2668
  msgid "days"
2669
  msgstr ""
2670
 
2671
+ #: includes/common/functions.php:122
2672
  msgid "hour"
2673
  msgstr ""
2674
 
2675
+ #: includes/common/functions.php:122
2676
  msgid "hours"
2677
  msgstr ""
2678
 
2679
+ #: includes/common/functions.php:123
2680
  msgid "minute"
2681
  msgstr ""
2682
 
2683
+ #: includes/common/functions.php:124
2684
  msgid "second"
2685
  msgstr ""
2686
 
2687
+ #: includes/common/functions.php:179
2688
  msgctxt "Separator in time since"
2689
  msgid ","
2690
  msgstr ""
2691
 
2692
+ #: includes/common/functions.php:512 includes/common/functions.php:544
2693
  msgid "Private: %s"
2694
  msgstr ""
2695
 
2696
+ #: includes/common/functions.php:513 includes/common/functions.php:545
2697
  msgid "Spammed: %s"
2698
  msgstr ""
2699
 
2700
+ #: includes/common/functions.php:514 includes/common/functions.php:546
2701
  msgid "Trashed: %s"
2702
  msgstr ""
2703
 
2704
+ #: includes/common/functions.php:624
2705
  msgid "<strong>ERROR</strong>: Invalid author name submitted!"
2706
  msgstr ""
2707
 
2708
+ #: includes/common/functions.php:628
2709
  msgid "<strong>ERROR</strong>: Invalid email address submitted!"
2710
  msgstr ""
2711
 
2712
+ #: includes/common/functions.php:1070
2713
  msgid ""
2714
  "%1$s wrote:\n"
2715
  "\n"
2724
  "Login and visit the topic to unsubscribe from these emails."
2725
  msgstr ""
2726
 
2727
+ #: includes/common/functions.php:1758
2728
  msgid ""
2729
  "Conditional query tags do not work before the query is run. Before then, "
2730
  "they always return false."
2731
  msgstr ""
2732
 
2733
+ #: includes/common/template.php:1443
2734
  msgid "No topics available"
2735
  msgstr ""
2736
 
2737
+ #: includes/common/template.php:1448
2738
  msgid "No forums available"
2739
  msgstr ""
2740
 
2741
+ #: includes/common/template.php:1453
2742
  msgid "None available"
2743
  msgstr ""
2744
 
2745
+ #: includes/common/template.php:1582 includes/replies/functions.php:1302
2746
+ #: includes/topics/functions.php:1294 includes/topics/functions.php:1652
2747
  #: templates/default/bbpress/form-reply.php:29
2748
  msgid "Reply To: %s"
2749
  msgstr ""
2750
 
2751
+ #: includes/common/template.php:2105
2752
  msgid "Home"
2753
  msgstr ""
2754
 
2755
+ #: includes/common/template.php:2175
2756
  msgid "(Edit)"
2757
  msgstr ""
2758
 
2759
+ #: includes/common/template.php:2179 includes/common/template.php:2293
2760
+ #: includes/common/template.php:2561 includes/core/theme-compat.php:729
 
2761
  #: templates/default/extras/taxonomy-topic-tag-edit.php:17
2762
  #: templates/default/extras/taxonomy-topic-tag.php:17
2763
  msgid "Topic Tag: %s"
2764
  msgstr ""
2765
 
2766
+ #: includes/common/template.php:2200
2767
  msgid "&lsaquo;"
2768
  msgstr ""
2769
 
2770
+ #: includes/common/template.php:2200
2771
  msgid "&rsaquo;"
2772
  msgstr ""
2773
 
2774
+ #: includes/common/template.php:2468
2775
+ msgid "Log Out"
 
 
2776
  msgstr ""
2777
 
2778
+ #: includes/common/template.php:2525
2779
+ msgid "Forum Edit: %s"
2780
+ msgstr ""
2781
+
2782
+ #: includes/common/template.php:2530
2783
+ msgid "Topic Edit: %s"
2784
+ msgstr ""
2785
+
2786
+ #: includes/common/template.php:2535
2787
+ msgid "Reply Edit: %s"
2788
+ msgstr ""
2789
+
2790
+ #: includes/common/template.php:2540
2791
+ msgid "Topic Tag Edit: %s"
2792
  msgstr ""
2793
 
2794
+ #: includes/common/template.php:2547
2795
  msgid "Forum: %s"
2796
  msgstr ""
2797
 
2798
+ #: includes/common/template.php:2552
2799
  msgid "Topic: %s"
2800
  msgstr ""
2801
 
2802
+ #: includes/common/template.php:2570
2803
  msgid "Your Profile"
2804
  msgstr ""
2805
 
2806
+ #: includes/common/template.php:2575
2807
  #: templates/default/bbpress/user-details.php:29
2808
  msgid "%s's Profile"
2809
  msgstr ""
2810
 
2811
+ #: includes/common/template.php:2583
2812
  msgid "Edit Your Profile"
2813
  msgstr ""
2814
 
2815
+ #: includes/common/template.php:2588
2816
+ #: templates/default/bbpress/user-details.php:65
2817
  msgid "Edit %s's Profile"
2818
  msgstr ""
2819
 
2820
+ #: includes/common/template.php:2596
2821
  msgid "View: %s"
2822
  msgstr ""
2823
 
2863
  msgstr ""
2864
 
2865
  #: includes/common/widgets.php:185 includes/common/widgets.php:337
2866
+ #: includes/common/widgets.php:465 includes/common/widgets.php:634
2867
+ #: includes/common/widgets.php:876 includes/common/widgets.php:1030
2868
+ #: includes/common/widgets.php:1235
2869
  msgid "Title:"
2870
  msgstr ""
2871
 
2893
  msgid "(bbPress) Forum Search Form"
2894
  msgstr ""
2895
 
2896
+ #: includes/common/widgets.php:512
2897
  msgid "A list of forums with an option to set the parent."
2898
  msgstr ""
2899
 
2900
+ #: includes/common/widgets.php:515
2901
  msgid "(bbPress) Forums List"
2902
  msgstr ""
2903
 
2904
+ #: includes/common/widgets.php:640 includes/common/widgets.php:880
2905
  msgid "Parent Forum ID:"
2906
  msgstr ""
2907
 
2908
+ #: includes/common/widgets.php:646 includes/common/widgets.php:886
2909
  msgid "\"0\" to show only root - \"any\" to show all"
2910
  msgstr ""
2911
 
2912
+ #: includes/common/widgets.php:692
2913
  msgid "A list of recent topics, sorted by popularity or freshness."
2914
  msgstr ""
2915
 
2916
+ #: includes/common/widgets.php:695
2917
  msgid "(bbPress) Recent Topics"
2918
  msgstr ""
2919
 
2920
+ #: includes/common/widgets.php:815
2921
  msgctxt "widgets"
2922
  msgid "by %1$s"
2923
  msgstr ""
2924
 
2925
+ #: includes/common/widgets.php:877
2926
  msgid "Maximum topics to show:"
2927
  msgstr ""
2928
 
2929
+ #: includes/common/widgets.php:889 includes/common/widgets.php:1237
2930
  msgid "Show post date:"
2931
  msgstr ""
2932
 
2933
+ #: includes/common/widgets.php:890
2934
  msgid "Show topic author:"
2935
  msgstr ""
2936
 
2937
+ #: includes/common/widgets.php:893
2938
  msgid "Order By:"
2939
  msgstr ""
2940
 
2941
+ #: includes/common/widgets.php:895
2942
  msgid "Newest Topics"
2943
  msgstr ""
2944
 
2945
+ #: includes/common/widgets.php:896
2946
  #: templates/default/extras/page-forum-statistics.php:34
2947
  msgid "Popular Topics"
2948
  msgstr ""
2949
 
2950
+ #: includes/common/widgets.php:897
2951
  msgid "Topics With Recent Replies"
2952
  msgstr ""
2953
 
2954
+ #: includes/common/widgets.php:914
2955
  msgid "Recent Topics"
2956
  msgstr ""
2957
 
2958
+ #: includes/common/widgets.php:948
2959
  msgid "Some statistics from your forum."
2960
  msgstr ""
2961
 
2962
+ #: includes/common/widgets.php:951
2963
  msgid "(bbPress) Statistics"
2964
  msgstr ""
2965
 
2966
+ #: includes/common/widgets.php:1048
2967
  msgid "Forum Statistics"
2968
  msgstr ""
2969
 
2970
+ #: includes/common/widgets.php:1078
2971
  msgid "A list of the most recent replies."
2972
  msgstr ""
2973
 
2974
+ #: includes/common/widgets.php:1081
2975
  msgid "(bbPress) Recent Replies"
2976
  msgstr ""
2977
 
2978
  #. translators: 1: reply author, 2: reply link, 3: reply timestamp
2979
+ #: includes/common/widgets.php:1167
2980
  msgctxt "widgets"
2981
  msgid "%1$s on %2$s %3$s"
2982
  msgstr ""
2983
 
2984
  #. translators: 1: reply link, 2: reply timestamp
2985
+ #: includes/common/widgets.php:1173
2986
  msgctxt "widgets"
2987
  msgid "%1$s %2$s"
2988
  msgstr ""
2989
 
2990
  #. translators: 1: reply author, 2: reply link
2991
+ #: includes/common/widgets.php:1179
2992
  msgctxt "widgets"
2993
  msgid "%1$s on %2$s"
2994
  msgstr ""
2995
 
2996
  #. translators: 1: reply link
2997
+ #: includes/common/widgets.php:1185
2998
  msgctxt "widgets"
2999
  msgid "%1$s"
3000
  msgstr ""
3001
 
3002
+ #: includes/common/widgets.php:1236
3003
  msgid "Maximum replies to show:"
3004
  msgstr ""
3005
 
3006
+ #: includes/common/widgets.php:1238
3007
  msgid "Show reply author:"
3008
  msgstr ""
3009
 
3010
+ #: includes/common/widgets.php:1253
3011
  msgid "Recent Replies"
3012
  msgstr ""
3013
 
3014
+ #: includes/core/capabilities.php:380
3015
  msgid "Keymaster"
3016
  msgstr ""
3017
 
3018
+ #: includes/core/capabilities.php:386
3019
  msgid "Moderator"
3020
  msgstr ""
3021
 
3022
+ #: includes/core/capabilities.php:392
3023
  msgid "Participant"
3024
  msgstr ""
3025
 
3026
+ #: includes/core/capabilities.php:398
3027
  msgid "Spectator"
3028
  msgstr ""
3029
 
3030
+ #: includes/core/capabilities.php:404
3031
  msgid "Blocked"
3032
  msgstr ""
3033
 
3034
+ #: includes/core/capabilities.php:523
3035
  msgid "Editable forum roles no longer exist."
3036
  msgstr ""
3037
 
3039
  msgid "The current user is being initialized without using $wp->init()."
3040
  msgstr ""
3041
 
3042
+ #: includes/core/update.php:186
3043
  msgid "General"
3044
  msgstr ""
3045
 
3046
+ #: includes/core/update.php:187
3047
  msgid "General chit-chat"
3048
  msgstr ""
3049
 
3050
+ #: includes/core/update.php:188
3051
  msgid "Hello World!"
3052
  msgstr ""
3053
 
3054
+ #: includes/core/update.php:189
3055
  msgid "I am the first topic in your new forums."
3056
  msgstr ""
3057
 
3058
+ #: includes/core/update.php:190
3059
  msgid "Re: Hello World!"
3060
  msgstr ""
3061
 
3062
+ #: includes/core/update.php:191
3063
  msgid "Oh, and this is what a reply looks like."
3064
  msgstr ""
3065
 
3066
+ #: includes/extend/akismet.php:309
3067
  msgid "%1$s reported this %2$s as spam"
3068
  msgstr ""
3069
 
3070
+ #: includes/extend/akismet.php:316
3071
  msgid "%1$s reported this %2$s as not spam"
3072
  msgstr ""
3073
 
3074
+ #: includes/extend/akismet.php:405
3075
  msgid "No response"
3076
  msgstr ""
3077
 
3078
+ #: includes/extend/akismet.php:463
3079
  msgid "Akismet caught this post as spam"
3080
  msgstr ""
3081
 
3082
+ #: includes/extend/akismet.php:467 includes/extend/akismet.php:482
3083
  msgid "Post status was changed to %s"
3084
  msgstr ""
3085
 
3086
+ #: includes/extend/akismet.php:475
3087
+ msgid "Akismet cleared this post as not spam"
3088
  msgstr ""
3089
 
3090
+ #: includes/extend/akismet.php:489
3091
  msgid ""
3092
  "Akismet was unable to check this post (response: %s), will automatically "
3093
  "retry again later."
3094
  msgstr ""
3095
 
3096
+ #: includes/extend/akismet.php:735 includes/extend/akismet.php:745
3097
+ msgid "Akismet History"
3098
+ msgstr ""
3099
+
3100
+ #: includes/extend/akismet.php:793
3101
+ msgid "No recorded history. Akismet has not checked this post."
3102
+ msgstr ""
3103
+
3104
+ #: includes/extend/buddypress/activity.php:195
3105
  msgid "New forum topic"
3106
  msgstr ""
3107
 
3108
+ #: includes/extend/buddypress/activity.php:196
3109
  msgid "New forum reply"
3110
  msgstr ""
3111
 
3112
+ #: includes/extend/buddypress/activity.php:420
3113
  msgid "%1$s started the topic %2$s in the forum %3$s"
3114
  msgstr ""
3115
 
3116
+ #: includes/extend/buddypress/activity.php:565
3117
  msgid "%1$s replied to the topic %2$s in the forum %3$s"
3118
  msgstr ""
3119
 
3120
+ #: includes/extend/buddypress/groups.php:271
3121
+ #: includes/extend/buddypress/groups.php:274
3122
  msgid "Group Forum Settings"
3123
  msgstr ""
3124
 
3125
+ #: includes/extend/buddypress/groups.php:275
3126
+ #: includes/extend/buddypress/groups.php:476
3127
  msgid ""
3128
  "Create a discussion forum to allow members of this group to communicate in a "
3129
  "structured, bulletin-board style fashion."
3130
  msgstr ""
3131
 
3132
+ #: includes/extend/buddypress/groups.php:279
3133
+ #: includes/extend/buddypress/groups.php:479
3134
  msgid "Yes. I want this group to have a forum."
3135
  msgstr ""
3136
 
3137
+ #: includes/extend/buddypress/groups.php:282
3138
  msgid "Saying no will not delete existing forum content."
3139
  msgstr ""
3140
 
3141
+ #: includes/extend/buddypress/groups.php:287
3142
  msgid "Group Forum:"
3143
  msgstr ""
3144
 
3145
+ #: includes/extend/buddypress/groups.php:295
3146
  msgid ""
3147
  "Network administrators can reconfigure which forum belongs to this group."
3148
  msgstr ""
3149
 
3150
+ #: includes/extend/buddypress/groups.php:300
3151
  msgid "Save Settings"
3152
  msgstr ""
3153
 
3154
+ #: includes/extend/buddypress/groups.php:335
3155
+ #: includes/extend/buddypress/groups.php:494 includes/forums/functions.php:118
3156
+ #: includes/forums/functions.php:394 includes/replies/functions.php:116
3157
+ #: includes/replies/functions.php:522 includes/replies/functions.php:1249
3158
+ #: includes/topics/functions.php:122 includes/topics/functions.php:520
3159
+ #: includes/topics/functions.php:1153 includes/topics/functions.php:1456
3160
+ #: includes/topics/functions.php:1820 includes/topics/functions.php:1859
3161
+ #: includes/topics/functions.php:1916 includes/users/functions.php:459
3162
+ #: includes/users/functions.php:772 includes/users/functions.php:897
3163
+ #: includes/users/functions.php:903
3164
  msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
3165
  msgstr ""
3166
 
3167
+ #: includes/extend/buddypress/groups.php:433
3168
  msgctxt "group admin edit screen"
3169
  msgid "Discussion Forum"
3170
  msgstr ""
3171
 
3172
+ #: includes/extend/buddypress/groups.php:474
3173
  msgid "Group Forum"
3174
  msgstr ""
3175
 
3176
+ #: includes/extend/buddypress/groups.php:771
3177
  msgid "This group does not currently have a forum."
3178
  msgstr ""
3179
 
3180
+ #: includes/extend/buddypress/loader.php:100
3181
  msgid "Search Forums..."
3182
  msgstr ""
3183
 
3184
+ #: includes/extend/buddypress/loader.php:288
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3185
  msgid "Subscribed Topics"
3186
  msgstr ""
3187
 
3190
  "<strong>ERROR</strong>: You do not have permission to create new forums."
3191
  msgstr ""
3192
 
3193
+ #: includes/forums/functions.php:155 includes/forums/functions.php:454
3194
  msgid "<strong>ERROR</strong>: Your forum needs a title."
3195
  msgstr ""
3196
 
3197
+ #: includes/forums/functions.php:167 includes/forums/functions.php:466
3198
  msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
3199
  msgstr ""
3200
 
3201
+ #: includes/forums/functions.php:180
3202
  msgid "<strong>ERROR</strong>: Your forum must have a parent."
3203
  msgstr ""
3204
 
3205
+ #: includes/forums/functions.php:187
3206
  msgid ""
3207
  "<strong>ERROR</strong>: This forum is a category. No forums can be created "
3208
  "in this forum."
3209
  msgstr ""
3210
 
3211
+ #: includes/forums/functions.php:192 includes/forums/functions.php:430
3212
  msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
3213
  msgstr ""
3214
 
3215
+ #: includes/forums/functions.php:197 includes/forums/functions.php:435
3216
  msgid ""
3217
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3218
  "capability to read or create new forums in it."
3219
  msgstr ""
3220
 
3221
+ #: includes/forums/functions.php:202 includes/forums/functions.php:440
3222
  msgid ""
3223
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3224
  "capability to read or create new forums in it."
3225
  msgstr ""
3226
 
3227
+ #: includes/forums/functions.php:209 includes/replies/functions.php:297
3228
+ #: includes/topics/functions.php:260
3229
  msgid "<strong>ERROR</strong>: Slow down; you move too fast."
3230
  msgstr ""
3231
 
3232
+ #: includes/forums/functions.php:214
3233
  msgid "<strong>ERROR</strong>: This forum already exists."
3234
  msgstr ""
3235
 
3236
+ #: includes/forums/functions.php:219
3237
  msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
3238
  msgstr ""
3239
 
3249
  msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
3250
  msgstr ""
3251
 
3252
+ #: includes/forums/functions.php:471
3253
  msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
3254
  msgstr ""
3255
 
3256
+ #: includes/forums/functions.php:1559
3257
+ msgctxt "Open the forum"
3258
+ msgid "Open"
3259
+ msgstr ""
3260
+
3261
+ #: includes/forums/functions.php:1560
3262
+ msgctxt "Close the forum"
3263
+ msgid "Closed"
3264
+ msgstr ""
3265
+
3266
+ #: includes/forums/functions.php:1573
3267
+ msgctxt "Forum accepts new topics"
3268
+ msgid "Forum"
3269
+ msgstr ""
3270
+
3271
+ #: includes/forums/functions.php:1574
3272
+ msgctxt "Forum is a category"
3273
+ msgid "Category"
3274
+ msgstr ""
3275
+
3276
+ #: includes/forums/functions.php:1587
3277
+ msgctxt "Make forum public"
3278
+ msgid "Public"
3279
+ msgstr ""
3280
+
3281
+ #: includes/forums/functions.php:1588
3282
+ msgctxt "Make forum private"
3283
+ msgid "Private"
3284
+ msgstr ""
3285
+
3286
+ #: includes/forums/functions.php:1589
3287
+ msgctxt "Make forum hidden"
3288
+ msgid "Hidden"
3289
+ msgstr ""
3290
+
3291
+ #: includes/forums/template.php:1121 includes/forums/template.php:1859
3292
  msgid "%s topic"
3293
  msgid_plural "%s topics"
3294
  msgstr[0] ""
3295
  msgstr[1] ""
3296
 
3297
+ #: includes/forums/template.php:1137 includes/topics/template.php:1967
 
3298
  msgid " (+ %d hidden)"
3299
  msgstr ""
3300
 
3301
+ #: includes/forums/template.php:1848 includes/topics/template.php:1951
 
3302
  msgid "%s reply"
3303
  msgid_plural "%s replies"
3304
  msgstr[0] ""
3305
  msgstr[1] ""
3306
 
3307
+ #: includes/forums/template.php:1868
3308
  msgid ""
3309
  "This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
3310
  msgstr ""
3311
 
3312
+ #: includes/forums/template.php:1870
3313
  msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
3314
  msgstr ""
3315
 
3316
+ #: includes/forums/template.php:1876
3317
  msgid "This category contains %1$s, and was last updated by %2$s %3$s."
3318
  msgstr ""
3319
 
3320
+ #: includes/forums/template.php:1878
3321
  msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
3322
  msgstr ""
3323
 
3324
+ #: includes/forums/template.php:1888
3325
  msgid "This category contains %1$s and %2$s."
3326
  msgstr ""
3327
 
3328
+ #: includes/forums/template.php:1890
3329
  msgid "This forum contains %1$s and %2$s."
3330
  msgstr ""
3331
 
3332
+ #: includes/forums/template.php:1898
3333
  msgid "This category contains %1$s."
3334
  msgstr ""
3335
 
3336
+ #: includes/forums/template.php:1900
3337
  msgid "This forum contains %1$s."
3338
  msgstr ""
3339
 
3340
+ #: includes/forums/template.php:1904
3341
  msgid "This forum is empty."
3342
  msgstr ""
3343
 
3344
+ #: includes/replies/functions.php:142
3345
+ msgid "<strong>ERROR</strong>: You do not have permission to reply."
3346
  msgstr ""
3347
 
3348
+ #: includes/replies/functions.php:154
3349
+ msgid "<strong>ERROR</strong>: Topic ID is missing."
 
3350
  msgstr ""
3351
 
3352
+ #: includes/replies/functions.php:158
3353
+ msgid "<strong>ERROR</strong>: Topic ID must be a number."
 
3354
  msgstr ""
3355
 
3356
+ #: includes/replies/functions.php:168
3357
+ msgid "<strong>ERROR</strong>: Topic ID cannot be a negative number."
3358
  msgstr ""
3359
 
3360
+ #: includes/replies/functions.php:172
3361
+ msgid "<strong>ERROR</strong>: Topic does not exist."
 
3362
  msgstr ""
3363
 
3364
+ #: includes/replies/functions.php:191 includes/replies/functions.php:205
3365
+ #: includes/topics/functions.php:196 includes/topics/functions.php:210
3366
+ #: includes/topics/functions.php:535
3367
+ msgid "<strong>ERROR</strong>: Forum ID is missing."
3368
  msgstr ""
3369
 
3370
+ #: includes/replies/functions.php:195 includes/topics/functions.php:200
3371
+ msgid "<strong>ERROR</strong>: Forum ID must be a number."
3372
  msgstr ""
3373
 
3374
+ #: includes/replies/functions.php:209 includes/topics/functions.php:214
3375
+ msgid "<strong>ERROR</strong>: Forum ID cannot be a negative number."
3376
  msgstr ""
3377
 
3378
+ #: includes/replies/functions.php:213 includes/topics/functions.php:218
3379
+ msgid "<strong>ERROR</strong>: Forum does not exist."
 
3380
  msgstr ""
3381
 
3382
+ #: includes/replies/functions.php:227 includes/replies/functions.php:578
3383
+ msgid ""
3384
+ "<strong>ERROR</strong>: This forum is a category. No replies can be created "
3385
+ "in this forum."
3386
+ msgstr ""
3387
+
3388
+ #: includes/replies/functions.php:234 includes/replies/functions.php:585
3389
+ msgid "<strong>ERROR</strong>: This forum has been closed to new replies."
3390
+ msgstr ""
3391
+
3392
+ #: includes/replies/functions.php:240 includes/replies/functions.php:591
3393
+ msgid ""
3394
+ "<strong>ERROR</strong>: This forum is private and you do not have the "
3395
+ "capability to read or create new replies in it."
3396
+ msgstr ""
3397
+
3398
+ #: includes/replies/functions.php:246 includes/replies/functions.php:597
3399
+ msgid ""
3400
+ "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3401
+ "capability to read or create new replies in it."
3402
+ msgstr ""
3403
+
3404
+ #: includes/replies/functions.php:280
3405
  msgid "<strong>ERROR</strong>: Your reply needs a title."
3406
  msgstr ""
3407
 
3408
+ #: includes/replies/functions.php:292 includes/replies/functions.php:621
3409
  msgid "<strong>ERROR</strong>: Your reply cannot be empty."
3410
  msgstr ""
3411
 
3412
+ #: includes/replies/functions.php:302
3413
  msgid ""
3414
  "<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
3415
  "you&#8217;ve already said that!"
3416
  msgstr ""
3417
 
3418
+ #: includes/replies/functions.php:307
3419
  msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
3420
  msgstr ""
3421
 
3422
+ #: includes/replies/functions.php:324
3423
+ msgid "<strong>ERROR</strong>: Topic is closed."
3424
+ msgstr ""
3425
+
3426
+ #: includes/replies/functions.php:383 includes/replies/functions.php:705
3427
  msgid ""
3428
  "<strong>ERROR</strong>: There was a problem adding the tags to the topic."
3429
  msgstr ""
3430
 
3431
+ #: includes/replies/functions.php:511
3432
  msgid "<strong>ERROR</strong>: Reply ID not found."
3433
  msgstr ""
3434
 
3435
+ #: includes/replies/functions.php:528
3436
  msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
3437
  msgstr ""
3438
 
3439
+ #: includes/replies/functions.php:539
3440
  msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
3441
  msgstr ""
3442
 
3443
+ #: includes/replies/functions.php:626
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3444
  msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
3445
  msgstr ""
3446
 
3447
+ #: includes/replies/functions.php:1226
3448
  msgid "<strong>ERROR</strong>: Reply ID to move not found!"
3449
  msgstr ""
3450
 
3451
+ #: includes/replies/functions.php:1235
3452
  msgid "<strong>ERROR</strong>: The reply you want to move was not found."
3453
  msgstr ""
3454
 
3455
+ #: includes/replies/functions.php:1244
3456
  msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
3457
  msgstr ""
3458
 
3459
+ #: includes/replies/functions.php:1255 includes/topics/functions.php:1164
3460
+ #: includes/topics/functions.php:1462
3461
  msgid ""
3462
  "<strong>ERROR</strong>: You do not have the permissions to edit the source "
3463
  "topic."
3464
  msgstr ""
3465
 
3466
+ #: includes/replies/functions.php:1265
3467
  msgid "<strong>ERROR</strong>: You need to choose a valid move option."
3468
  msgstr ""
3469
 
3470
+ #: includes/replies/functions.php:1278 includes/topics/functions.php:1483
3471
  msgid "<strong>ERROR</strong>: Destination topic ID not found!"
3472
  msgstr ""
3473
 
3474
+ #: includes/replies/functions.php:1288
3475
  msgid "<strong>ERROR</strong>: The topic you want to move to was not found!"
3476
  msgstr ""
3477
 
3478
+ #: includes/replies/functions.php:1293 includes/topics/functions.php:1496
3479
  msgid ""
3480
  "<strong>ERROR</strong>: You do not have the permissions to edit the "
3481
  "destination topic!"
3482
  msgstr ""
3483
 
3484
+ #: includes/replies/functions.php:1347 includes/topics/functions.php:1533
3485
  msgid ""
3486
  "<strong>ERROR</strong>: There was a problem converting the reply into the "
3487
  "topic. Please try again."
3488
  msgstr ""
3489
 
3490
+ #: includes/replies/functions.php:1352 includes/topics/functions.php:1538
3491
  msgid ""
3492
  "<strong>ERROR</strong>: You do not have the permissions to create new "
3493
  "topics. The reply could not be converted into a topic."
3494
  msgstr ""
3495
 
3496
+ #: includes/replies/functions.php:1534
3497
  msgid "<strong>ERROR:</strong> You do not have the permission to do that!"
3498
  msgstr ""
3499
 
3500
+ #: includes/replies/functions.php:1547
3501
  msgid ""
3502
  "<strong>ERROR</strong>: There was a problem unmarking the reply as spam!"
3503
  msgstr ""
3504
 
3505
+ #: includes/replies/functions.php:1547
3506
  msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam!"
3507
  msgstr ""
3508
 
3509
+ #: includes/replies/functions.php:1566
3510
  msgid "<strong>ERROR</strong>: There was a problem trashing the reply!"
3511
  msgstr ""
3512
 
3513
+ #: includes/replies/functions.php:1574
3514
  msgid "<strong>ERROR</strong>: There was a problem untrashing the reply!"
3515
  msgstr ""
3516
 
3517
+ #: includes/replies/functions.php:1582
3518
  msgid "<strong>ERROR</strong>: There was a problem deleting the reply!"
3519
  msgstr ""
3520
 
3521
+ #: includes/replies/functions.php:1996
3522
  msgid "All Posts"
3523
  msgstr ""
3524
 
3525
+ #: includes/replies/functions.php:2038 includes/topics/functions.php:3463
3526
  msgid "Replies: %s"
3527
  msgstr ""
3528
 
3529
+ #: includes/replies/template.php:623 includes/topics/template.php:753
 
3530
  msgctxt "date at time"
3531
  msgid "%1$s at %2$s"
3532
  msgstr ""
3533
 
3534
+ #: includes/replies/template.php:721
3535
  msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
3536
  msgstr ""
3537
 
3538
+ #: includes/replies/template.php:723
3539
  msgid "This reply was modified %1$s by %2$s."
3540
  msgstr ""
3541
 
3542
+ #: includes/replies/template.php:1009 includes/topics/template.php:1306
3543
+ #: includes/users/template.php:184
3544
  msgid "Anonymous"
3545
  msgstr ""
3546
 
3547
+ #: includes/replies/template.php:1122 includes/topics/template.php:1419
3548
+ #: includes/users/template.php:1437
 
3549
  msgid "View %s's profile"
3550
  msgstr ""
3551
 
3552
+ #: includes/replies/template.php:1122 includes/topics/template.php:1419
3553
+ #: includes/users/template.php:1437
 
3554
  msgid "Visit %s's website"
3555
  msgstr ""
3556
 
3557
+ #: includes/replies/template.php:1604
3558
+ msgid "Cancel"
3559
+ msgstr ""
3560
+
3561
+ #: includes/replies/template.php:1945 includes/topics/template.php:2466
3562
  #: templates/default/bbpress/form-topic-tag.php:88
3563
  #: templates/default/bbpress/form-topic-tag.php:101
3564
  msgid "Delete"
3565
  msgstr ""
3566
 
3567
+ #: includes/replies/template.php:1962 includes/topics/template.php:2483
 
3568
  msgid "Are you sure you want to delete that permanently?"
3569
  msgstr ""
3570
 
3571
+ #: includes/replies/template.php:2015 includes/topics/template.php:2722
 
3572
  msgid "Unspam"
3573
  msgstr ""
3574
 
3575
+ #: includes/replies/template.php:2078
3576
  msgid "Move"
3577
  msgstr ""
3578
 
3579
+ #: includes/replies/template.php:2079
3580
  msgid "Move this reply"
3581
  msgstr ""
3582
 
3583
+ #: includes/replies/template.php:2145
3584
  msgid "Split"
3585
  msgstr ""
3586
 
3587
+ #: includes/replies/template.php:2146
3588
  msgid "Split the topic from this reply"
3589
  msgstr ""
3590
 
3591
+ #: includes/replies/template.php:2252
3592
+ msgid "Viewing %1$s reply thread"
3593
+ msgid_plural "Viewing %1$s reply threads"
3594
+ msgstr[0] ""
3595
+ msgstr[1] ""
3596
+
3597
+ #: includes/replies/template.php:2259
3598
  msgid "Viewing %1$s reply"
3599
  msgid_plural "Viewing %1$s replies"
3600
  msgstr[0] ""
3601
  msgstr[1] ""
3602
 
3603
+ #: includes/replies/template.php:2263
3604
  msgid "Viewing %2$s replies (of %4$s total)"
3605
  msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
3606
  msgstr[0] ""
3607
  msgstr[1] ""
3608
 
3609
+ #: includes/replies/template.php:2271
3610
  msgid "Viewing %1$s post"
3611
  msgid_plural "Viewing %1$s posts"
3612
  msgstr[0] ""
3613
  msgstr[1] ""
3614
 
3615
+ #: includes/replies/template.php:2275
3616
  msgid "Viewing %2$s post (of %4$s total)"
3617
  msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
3618
  msgstr[0] ""
3619
  msgstr[1] ""
3620
 
3621
+ #: includes/search/template.php:235
3622
  msgid "Search Results for '%s'"
3623
  msgstr ""
3624
 
3625
+ #: includes/search/template.php:407
3626
  msgid "Viewing %1$s result"
3627
  msgid_plural "Viewing %1$s results"
3628
  msgstr[0] ""
3629
  msgstr[1] ""
3630
 
3631
+ #: includes/search/template.php:411
3632
  msgid "Viewing %2$s results (of %4$s total)"
3633
  msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
3634
  msgstr[0] ""
3635
  msgstr[1] ""
3636
 
3637
+ #: includes/topics/functions.php:150
3638
  msgid ""
3639
  "<strong>ERROR</strong>: You do not have permission to create new topics."
3640
  msgstr ""
3641
 
3642
+ #: includes/topics/functions.php:175 includes/topics/functions.php:585
3643
  msgid "<strong>ERROR</strong>: Your topic needs a title."
3644
  msgstr ""
3645
 
3646
+ #: includes/topics/functions.php:187 includes/topics/functions.php:597
3647
  msgid "<strong>ERROR</strong>: Your topic cannot be empty."
3648
  msgstr ""
3649
 
3650
+ #: includes/topics/functions.php:232
3651
  msgid ""
3652
  "<strong>ERROR</strong>: This forum is a category. No topics can be created "
3653
  "in this forum."
3654
  msgstr ""
3655
 
3656
+ #: includes/topics/functions.php:239 includes/topics/functions.php:557
3657
  msgid "<strong>ERROR</strong>: This forum has been closed to new topics."
3658
  msgstr ""
3659
 
3660
+ #: includes/topics/functions.php:245 includes/topics/functions.php:563
3661
  msgid ""
3662
  "<strong>ERROR</strong>: This forum is private and you do not have the "
3663
  "capability to read or create new topics in it."
3664
  msgstr ""
3665
 
3666
+ #: includes/topics/functions.php:251 includes/topics/functions.php:569
3667
  msgid ""
3668
  "<strong>ERROR</strong>: This forum is hidden and you do not have the "
3669
  "capability to read or create new topics in it."
3670
  msgstr ""
3671
 
3672
+ #: includes/topics/functions.php:265
3673
  msgid ""
3674
  "<strong>ERROR</strong>: Duplicate topic detected; it looks as though "
3675
  "you&#8217;ve already said that!"
3676
  msgstr ""
3677
 
3678
+ #: includes/topics/functions.php:270
3679
  msgid "<strong>ERROR</strong>: Your topic cannot be created at this time."
3680
  msgstr ""
3681
 
3682
+ #: includes/topics/functions.php:482 includes/topics/functions.php:1146
3683
  msgid "<strong>ERROR</strong>: Topic ID not found."
3684
  msgstr ""
3685
 
3686
+ #: includes/topics/functions.php:493
3687
  msgid "<strong>ERROR</strong>: The topic you want to edit was not found."
3688
  msgstr ""
3689
 
3690
+ #: includes/topics/functions.php:504
3691
  msgid "<strong>ERROR</strong>: You do not have permission to edit that topic."
3692
  msgstr ""
3693
 
3694
+ #: includes/topics/functions.php:550
3695
  msgid ""
3696
  "<strong>ERROR</strong>: This forum is a category. No topics can be created "
3697
  "in it."
3698
  msgstr ""
3699
 
3700
+ #: includes/topics/functions.php:602
3701
  msgid "<strong>ERROR</strong>: Your topic cannot be edited at this time."
3702
  msgstr ""
3703
 
3704
+ #: includes/topics/functions.php:1158
3705
  msgid "<strong>ERROR</strong>: The topic you want to merge was not found."
3706
  msgstr ""
3707
 
3708
+ #: includes/topics/functions.php:1172
3709
  msgid "<strong>ERROR</strong>: Destination topic ID not found."
3710
  msgstr ""
3711
 
3712
+ #: includes/topics/functions.php:1178
3713
  msgid "<strong>ERROR</strong>: The topic you want to merge to was not found."
3714
  msgstr ""
3715
 
3716
+ #: includes/topics/functions.php:1182
3717
  msgid ""
3718
  "<strong>ERROR</strong>: You do not have the permissions to edit the "
3719
  "destination topic."
3720
  msgstr ""
3721
 
3722
+ #: includes/topics/functions.php:1435
3723
  msgid "<strong>ERROR</strong>: Reply ID to split the topic from not found!"
3724
  msgstr ""
3725
 
3726
+ #: includes/topics/functions.php:1443
3727
  msgid "<strong>ERROR</strong>: The reply you want to split from was not found."
3728
  msgstr ""
3729
 
3730
+ #: includes/topics/functions.php:1452
3731
  msgid "<strong>ERROR</strong>: The topic you want to split was not found."
3732
  msgstr ""
3733
 
3734
+ #: includes/topics/functions.php:1470
3735
  msgid "<strong>ERROR</strong>: You need to choose a valid split option."
3736
  msgstr ""
3737
 
3738
+ #: includes/topics/functions.php:1492
3739
  msgid "<strong>ERROR</strong>: The topic you want to split to was not found!"
3740
  msgstr ""
3741
 
3742
+ #: includes/topics/functions.php:1808
3743
  msgid ""
3744
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3745
  "getting the tag: %s"
3746
  msgstr ""
3747
 
3748
+ #: includes/topics/functions.php:1826 includes/topics/functions.php:1865
3749
  msgid ""
3750
  "<strong>ERROR</strong>: You do not have the permissions to edit the topic "
3751
  "tags."
3752
  msgstr ""
3753
 
3754
+ #: includes/topics/functions.php:1832 includes/topics/functions.php:1871
3755
  msgid "<strong>ERROR</strong>: You need to enter a tag name."
3756
  msgstr ""
3757
 
3758
+ #: includes/topics/functions.php:1842
3759
  msgid ""
3760
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3761
  "updating the tag: %s"
3762
  msgstr ""
3763
 
3764
+ #: includes/topics/functions.php:1881 includes/topics/functions.php:1899
3765
  msgid ""
3766
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3767
  "merging the tags: %s"
3768
  msgstr ""
3769
 
3770
+ #: includes/topics/functions.php:1890
3771
  msgid ""
3772
  "<strong>ERROR</strong>: The tags which are being merged can not be the same."
3773
  msgstr ""
3774
 
3775
+ #: includes/topics/functions.php:1922
3776
  msgid ""
3777
  "<strong>ERROR</strong>: You do not have the permissions to delete the topic "
3778
  "tags."
3779
  msgstr ""
3780
 
3781
+ #: includes/topics/functions.php:1931
3782
  msgid ""
3783
  "<strong>ERROR</strong>: The following problem(s) have been found while "
3784
  "deleting the tag: %s"
3785
  msgstr ""
3786
 
3787
+ #: includes/topics/functions.php:1965
3788
+ msgctxt "Open the topic"
3789
+ msgid "Open"
3790
+ msgstr ""
3791
+
3792
+ #: includes/topics/functions.php:1966
3793
+ msgctxt "Close the topic"
3794
+ msgid "Closed"
3795
+ msgstr ""
3796
+
3797
+ #: includes/topics/functions.php:1967
3798
+ msgctxt "Spam the topic"
3799
+ msgid "Spam"
3800
+ msgstr ""
3801
+
3802
+ #: includes/topics/functions.php:1968
3803
+ msgctxt "Trash the topic"
3804
+ msgid "Trash"
3805
+ msgstr ""
3806
+
3807
+ #: includes/topics/functions.php:1969
3808
+ msgctxt "Mark topic as pending"
3809
+ msgid "Pending"
3810
+ msgstr ""
3811
+
3812
+ #: includes/topics/functions.php:1982
3813
+ msgctxt "Unstick a topic"
3814
+ msgid "Normal"
3815
+ msgstr ""
3816
+
3817
+ #: includes/topics/functions.php:1983
3818
+ msgctxt "Make topic sticky"
3819
+ msgid "Sticky"
3820
+ msgstr ""
3821
+
3822
+ #: includes/topics/functions.php:1984
3823
+ msgctxt "Make topic super sticky"
3824
+ msgid "Super Sticky"
3825
+ msgstr ""
3826
+
3827
+ #: includes/topics/functions.php:2090
3828
  msgid "<strong>ERROR:</strong> You do not have the permission to do that."
3829
  msgstr ""
3830
 
3831
+ #: includes/topics/functions.php:2103
3832
  msgid "<strong>ERROR</strong>: There was a problem closing the topic."
3833
  msgstr ""
3834
 
3835
+ #: includes/topics/functions.php:2103
3836
  msgid "<strong>ERROR</strong>: There was a problem opening the topic."
3837
  msgstr ""
3838
 
3839
+ #: includes/topics/functions.php:2114
3840
  msgid "<strong>ERROR</strong>: There was a problem unsticking the topic."
3841
  msgstr ""
3842
 
3843
+ #: includes/topics/functions.php:2114
3844
  msgid "<strong>ERROR</strong>: There was a problem sticking the topic."
3845
  msgstr ""
3846
 
3847
+ #: includes/topics/functions.php:2124
3848
  msgid ""
3849
  "<strong>ERROR</strong>: There was a problem unmarking the topic as spam."
3850
  msgstr ""
3851
 
3852
+ #: includes/topics/functions.php:2124
3853
  msgid "<strong>ERROR</strong>: There was a problem marking the topic as spam."
3854
  msgstr ""
3855
 
3856
+ #: includes/topics/functions.php:2143
3857
  msgid "<strong>ERROR</strong>: There was a problem trashing the topic."
3858
  msgstr ""
3859
 
3860
+ #: includes/topics/functions.php:2151
3861
  msgid "<strong>ERROR</strong>: There was a problem untrashing the topic."
3862
  msgstr ""
3863
 
3864
+ #: includes/topics/functions.php:2159
3865
  msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
3866
  msgstr ""
3867
 
3868
+ #: includes/topics/template.php:935
3869
  msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
3870
  msgstr ""
3871
 
3872
+ #: includes/topics/template.php:937
3873
  msgid "This topic was modified %1$s by %2$s."
3874
  msgstr ""
3875
 
3876
+ #: includes/topics/template.php:2144
3877
  msgid "Tagged:"
3878
  msgstr ""
3879
 
3880
+ #: includes/topics/template.php:2534
3881
  msgctxt "Topic Status"
3882
  msgid "Close"
3883
  msgstr ""
3884
 
3885
+ #: includes/topics/template.php:2535
3886
  msgctxt "Topic Status"
3887
  msgid "Open"
3888
  msgstr ""
3889
 
3890
+ #: includes/topics/template.php:2665
3891
  #: templates/default/bbpress/form-topic-tag.php:59
3892
  #: templates/default/bbpress/form-topic-tag.php:73
3893
  msgid "Merge"
3894
  msgstr ""
3895
 
3896
+ #: includes/topics/template.php:2826
3897
  msgid "Viewing %1$s topic"
3898
  msgid_plural "Viewing %1$s topics"
3899
  msgstr[0] ""
3900
  msgstr[1] ""
3901
 
3902
+ #: includes/topics/template.php:2830
3903
  msgid "Viewing topic %2$s (of %4$s total)"
3904
  msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
3905
  msgstr[0] ""
3906
  msgstr[1] ""
3907
 
3908
+ #: includes/topics/template.php:2890
3909
  msgid "This topic is marked as spam."
3910
  msgstr ""
3911
 
3912
+ #: includes/topics/template.php:2895
3913
  msgid "This topic is in the trash."
3914
  msgstr ""
3915
 
3916
+ #: includes/topics/template.php:3155
 
 
 
 
 
 
 
 
 
 
 
 
3917
  msgid "%s voice"
3918
  msgid_plural "%s voices"
3919
  msgstr[0] ""
3920
  msgstr[1] ""
3921
 
3922
+ #: includes/topics/template.php:3161
3923
  msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
3924
  msgstr ""
3925
 
3926
+ #: includes/topics/template.php:3165
3927
  msgid "This topic contains %1$s and has %2$s."
3928
  msgstr ""
3929
 
3930
+ #: includes/topics/template.php:3169
3931
  msgid "This topic has no replies."
3932
  msgstr ""
3933
 
3934
+ #: includes/users/functions.php:455
3935
  msgid ""
3936
  "<strong>ERROR</strong>: No topic was found! Which topic are you marking/"
3937
  "unmarking as favorite?"
3938
  msgstr ""
3939
 
3940
+ #: includes/users/functions.php:463 includes/users/functions.php:776
3941
  msgid ""
3942
  "<strong>ERROR</strong>: You don't have the permission to edit favorites of "
3943
  "that user!"
3944
  msgstr ""
3945
 
3946
+ #: includes/users/functions.php:506
3947
  msgid ""
3948
  "<strong>ERROR</strong>: There was a problem removing that topic from "
3949
  "favorites!"
3950
  msgstr ""
3951
 
3952
+ #: includes/users/functions.php:508
3953
  msgid "<strong>ERROR</strong>: There was a problem favoriting that topic!"
3954
  msgstr ""
3955
 
3956
+ #: includes/users/functions.php:768
3957
  msgid ""
3958
  "<strong>ERROR</strong>: No topic was found! Which topic are you subscribing/"
3959
  "unsubscribing to?"
3960
  msgstr ""
3961
 
3962
+ #: includes/users/functions.php:819
3963
  msgid ""
3964
  "<strong>ERROR</strong>: There was a problem unsubscribing from that topic!"
3965
  msgstr ""
3966
 
3967
+ #: includes/users/functions.php:821
3968
  msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic!"
3969
  msgstr ""
3970
 
3971
+ #: includes/users/template.php:503
3972
  msgid "Guest"
3973
  msgstr ""
3974
 
3975
+ #: includes/users/template.php:507
3976
  msgid "Inactive"
3977
  msgstr ""
3978
 
3979
+ #: includes/users/template.php:517
3980
  msgid "Member"
3981
  msgstr ""
3982
 
3983
+ #: includes/users/template.php:557
3984
  msgid "Admin"
3985
  msgstr ""
3986
 
3987
+ #: includes/users/template.php:723
3988
  msgid "Favorite"
3989
  msgstr ""
3990
 
3991
+ #: includes/users/template.php:724
3992
  msgid "Favorited"
3993
  msgstr ""
3994
 
3995
+ #: includes/users/template.php:881
3996
  msgid "Subscribe"
3997
  msgstr ""
3998
 
3999
+ #: includes/users/template.php:882
4000
  msgid "Unsubscribe"
4001
  msgstr ""
4002
 
4003
+ #: includes/users/template.php:949
4004
  msgid "User updated."
4005
  msgstr ""
4006
 
4007
+ #: includes/users/template.php:974
4008
  msgid "You have super admin privileges."
4009
  msgstr ""
4010
 
4011
+ #: includes/users/template.php:974
4012
  msgid "This user has super admin privileges."
4013
  msgstr ""
4014
 
4015
+ #: includes/users/template.php:1041
4016
  msgid "&mdash; No role for this site &mdash;"
4017
  msgstr ""
4018
 
4019
+ #: includes/users/template.php:1239
4020
  msgid "You are now logged out."
4021
  msgstr ""
4022
 
4023
+ #: includes/users/template.php:1243
4024
  msgid "New user registration is currently not allowed."
4025
  msgstr ""
4026
 
4027
+ #: includes/users/template.php:1252
4028
  msgid "Check your e-mail for the confirmation link."
4029
  msgstr ""
4030
 
4031
+ #: includes/users/template.php:1257
4032
  msgid "Check your e-mail for your new password."
4033
  msgstr ""
4034
 
4035
+ #: includes/users/template.php:1262
4036
  msgid "Registration complete. Please check your e-mail."
4037
  msgstr ""
4038
 
4056
  msgid "You are already logged in."
4057
  msgstr ""
4058
 
4059
+ #: templates/default/bbpress/feedback-no-access.php:13
4060
+ msgid "Private"
4061
+ msgstr ""
4062
+
4063
  #: templates/default/bbpress/feedback-no-access.php:16
4064
  msgid "You do not have permission to view this forum."
4065
  msgstr ""
4117
  msgid "Forum Name (Maximum Length: %d):"
4118
  msgstr ""
4119
 
4120
+ #: templates/default/bbpress/form-forum.php:82
4121
+ #: templates/default/bbpress/form-reply.php:64
4122
+ #: templates/default/bbpress/form-topic.php:90
 
 
 
 
4123
  msgid ""
4124
  "You may use these <abbr title=\"HyperText Markup Language\">HTML</abbr> tags "
4125
  "and attributes:"
4126
  msgstr ""
4127
 
4128
+ #: templates/default/bbpress/form-forum.php:91
4129
  msgid "Forum Type:"
4130
  msgstr ""
4131
 
4132
+ #: templates/default/bbpress/form-forum.php:123
4133
  msgid "(No Parent)"
4134
  msgstr ""
4135
 
4136
+ #: templates/default/bbpress/form-forum.php:138
4137
  #: templates/default/bbpress/form-reply-move.php:73
4138
+ #: templates/default/bbpress/form-reply.php:135
4139
  #: templates/default/bbpress/form-topic-merge.php:94
4140
  #: templates/default/bbpress/form-topic-split.php:98
4141
+ #: templates/default/bbpress/form-topic.php:203
4142
  msgid "Submit"
4143
  msgstr ""
4144
 
4145
+ #: templates/default/bbpress/form-forum.php:161
4146
  msgid "The forum &#8216;%s&#8217; is closed to new content."
4147
  msgstr ""
4148
 
4149
+ #: templates/default/bbpress/form-forum.php:169
4150
  msgid "You cannot create new forums."
4151
  msgstr ""
4152
 
4153
+ #: templates/default/bbpress/form-forum.php:169
4154
  msgid "You must be logged in to create new forums."
4155
  msgstr ""
4156
 
4217
  "capabilities still allow you to do so."
4218
  msgstr ""
4219
 
4220
+ #: templates/default/bbpress/form-reply.php:75
 
 
 
 
4221
  msgid "Tags:"
4222
  msgstr ""
4223
 
4224
+ #: templates/default/bbpress/form-reply.php:93
4225
+ #: templates/default/bbpress/form-topic.php:164
4226
  msgid "Notify the author of follow-up replies via email"
4227
  msgstr ""
4228
 
4229
+ #: templates/default/bbpress/form-reply.php:97
4230
+ #: templates/default/bbpress/form-topic.php:168
4231
  msgid "Notify me of follow-up replies via email"
4232
  msgstr ""
4233
 
4234
+ #: templates/default/bbpress/form-reply.php:114
4235
+ #: templates/default/bbpress/form-topic.php:184
 
 
 
 
 
4236
  msgid "Keep a log of this edit:"
4237
  msgstr ""
4238
 
4239
+ #: templates/default/bbpress/form-reply.php:118
4240
+ #: templates/default/bbpress/form-topic.php:188
4241
  msgid "Optional reason for editing:"
4242
  msgstr ""
4243
 
4244
+ #: templates/default/bbpress/form-reply.php:158
4245
  msgid "The topic &#8216;%s&#8217; is closed to new replies."
4246
  msgstr ""
4247
 
4248
+ #: templates/default/bbpress/form-reply.php:166
4249
+ #: templates/default/bbpress/form-topic.php:226
4250
  msgid "The forum &#8216;%s&#8217; is closed to new topics and replies."
4251
  msgstr ""
4252
 
4253
+ #: templates/default/bbpress/form-reply.php:174
4254
  msgid "You cannot reply to this topic."
4255
  msgstr ""
4256
 
4257
+ #: templates/default/bbpress/form-reply.php:174
4258
  msgid "You must be logged in to reply to this topic."
4259
  msgstr ""
4260
 
4438
  msgid "Topic Title (Maximum Length: %d):"
4439
  msgstr ""
4440
 
4441
+ #: templates/default/bbpress/form-topic.php:101
4442
  msgid "Topic Tags:"
4443
  msgstr ""
4444
 
4445
+ #: templates/default/bbpress/form-topic.php:133
4446
  msgid "Topic Type:"
4447
  msgstr ""
4448
 
4449
+ #: templates/default/bbpress/form-topic.php:145
4450
+ msgid "Topic Status:"
4451
+ msgstr ""
4452
+
4453
+ #: templates/default/bbpress/form-topic.php:234
4454
  msgid "You cannot create new topics."
4455
  msgstr ""
4456
 
4457
+ #: templates/default/bbpress/form-topic.php:234
4458
  msgid "You must be logged in to create new topics."
4459
  msgstr ""
4460
 
4583
  msgid "Forum: "
4584
  msgstr ""
4585
 
4586
+ #: templates/default/bbpress/loop-search-reply.php:24
4587
  msgid "In reply to: "
4588
  msgstr ""
4589
 
4590
+ #: templates/default/bbpress/loop-search-topic.php:26
4591
  msgid "Topic: "
4592
  msgstr ""
4593
 
4594
+ #: templates/default/bbpress/loop-search-topic.php:33
4595
  msgid "in group forum "
4596
  msgstr ""
4597
 
4598
+ #: templates/default/bbpress/loop-search-topic.php:37
4599
  msgid "in forum "
4600
  msgstr ""
4601
 
4637
  msgid "%s's Subscriptions"
4638
  msgstr ""
4639
 
 
 
 
 
4640
  #: templates/default/bbpress/user-favorites.php:15
4641
  msgid "Favorite Forum Topics"
4642
  msgstr ""
4697
  msgid "This user has not created any topics."
4698
  msgstr ""
4699
 
4700
+ #: templates/default/bbpress-functions.php:307
4701
  msgid "Something went wrong. Refresh your browser and try again."
4702
  msgstr ""
4703
 
4704
+ #: templates/default/bbpress-functions.php:332
4705
  msgid "Favorites are no longer active."
4706
  msgstr ""
4707
 
4708
+ #: templates/default/bbpress-functions.php:337
4709
  msgid "Please login to make this topic a favorite."
4710
  msgstr ""
4711
 
4712
+ #: templates/default/bbpress-functions.php:346
4713
+ #: templates/default/bbpress-functions.php:413
4714
  msgid "You do not have permission to do this."
4715
  msgstr ""
4716
 
4717
+ #: templates/default/bbpress-functions.php:354
4718
+ #: templates/default/bbpress-functions.php:421
4719
  msgid "The topic could not be found."
4720
  msgstr ""
4721
 
4722
+ #: templates/default/bbpress-functions.php:359
4723
+ #: templates/default/bbpress-functions.php:426
4724
  msgid "Are you sure you meant to do that?"
4725
  msgstr ""
4726
 
4727
+ #: templates/default/bbpress-functions.php:367
4728
+ #: templates/default/bbpress-functions.php:434
4729
  msgid "The request was unsuccessful. Please try again."
4730
  msgstr ""
4731
 
4732
+ #: templates/default/bbpress-functions.php:399
4733
  msgid "Subscriptions are no longer active."
4734
  msgstr ""
4735
 
4736
+ #: templates/default/bbpress-functions.php:404
4737
  msgid "Please login to subscribe to this topic."
4738
  msgstr ""
4739
 
4750
  msgid "bbPress"
4751
  msgstr ""
4752
 
4753
+ #. #-#-#-#-# plugin.pot (bbPress 2.4-rc1) #-#-#-#-#
4754
  #. Plugin URI of the plugin/theme
4755
+ #. #-#-#-#-# plugin.pot (bbPress 2.4-rc1) #-#-#-#-#
4756
  #. Author URI of the plugin/theme
4757
  msgid "http://bbpress.org"
4758
  msgstr ""
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === bbPress ===
2
  Contributors: matt, johnjamesjacoby, jmdodd
3
  Tags: forums, discussion, support, theme, akismet, multisite
4
- Requires at least: 3.5
5
  Tested up to: 3.6
6
- Stable tag: 2.3.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -17,15 +17,46 @@ We're keeping things as small and light as possible while still allowing for gre
17
 
18
  == Installation ==
19
 
20
- 1. Place the 'bbpress' folder in your '/wp-content/plugins/' directory.
21
- 2. Activate bbPress.
22
- 3. Visit 'Settings > Forums' and adjust your configuration.
23
- 4. Create some forums.
24
- 5. View your site.
25
- 6. Adjust the CSS of your theme as needed, to make everything pretty.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  == Changelog ==
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  = 2.3.2 =
30
  * Improved posting of preformatted code
31
  * Improved theme compatibility CSS
1
  === bbPress ===
2
  Contributors: matt, johnjamesjacoby, jmdodd
3
  Tags: forums, discussion, support, theme, akismet, multisite
4
+ Requires at least: 3.6
5
  Tested up to: 3.6
6
+ Stable tag: 2.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
17
 
18
  == Installation ==
19
 
20
+ = From your WordPress dashboard =
21
+
22
+ 1. Visit 'Plugins > Add New'
23
+ 2. Search for 'bbPress'
24
+ 3. Activate bbPress from your Plugins page. (You'll be greeted with a Welcome page.)
25
+ 4. Visit 'Forums > Add New' and create some forums. (You can always delete these later.)
26
+ 5a. If you have pretty permalinks enabled, visit yourdomain.com/forums.
27
+ 5b. If you do not have pretty permalinks enabled, visit yourdomain.com?post_type=forum
28
+
29
+ = From WordPress.org =
30
+
31
+ 1. Download bbPress.
32
+ 2. Upload the 'bbpress' directory to your '/wp-content/plugins/' directory, using your favorite method (ftp, sftp, scp, etc...)
33
+ 3. Activate bbPress from your Plugins page. (You'll be greeted with a Welcome page.)
34
+ 4. Visit 'Forums > Add New' and create some forums. (You can always delete these later.)
35
+ 5a. If you have pretty permalinks enabled, visit yourdomain.com/forums.
36
+ 5b. If you do not have pretty permalinks enabled, visit yourdomain.com?post_type=forum
37
+
38
+ = Extra =
39
+
40
+ 1. Visit 'Settings > Forums' and adjust your configuration.
41
+ 2. Adjust the CSS of your theme as needed, to make everything pretty.
42
 
43
  == Changelog ==
44
 
45
+ = 2.4 =
46
+ * Added hierarchical reply support
47
+ * Added ability to disable forum search
48
+ * Reorganized settings page
49
+ * Improved rewrite rules
50
+ * Improved responsive CSS
51
+ * Improved code posting
52
+ * Improved user capability integration
53
+ * Improved cache getting and setting
54
+ * Audit strict type comparisons
55
+ * Audit GlotPress string escaping
56
+ * Audit title attribute usage
57
+ * Audit WordPress core function usage
58
+ * General code clean-up
59
+
60
  = 2.3.2 =
61
  * Improved posting of preformatted code
62
  * Improved theme compatibility CSS
templates/default/bbpress-functions.php CHANGED
@@ -179,9 +179,16 @@ class BBP_Default extends BBP_Theme_Compat {
179
  wp_enqueue_script( 'jquery' );
180
  }
181
 
182
- // Topic favorite/subscribe
183
  if ( bbp_is_single_topic() ) {
 
 
184
  wp_enqueue_script( 'bbpress-topic', $this->url . 'js/topic.js', array( 'jquery' ), $this->version );
 
 
 
 
 
185
  }
186
 
187
  // User Profile edit
179
  wp_enqueue_script( 'jquery' );
180
  }
181
 
182
+ // Topic-specific scripts
183
  if ( bbp_is_single_topic() ) {
184
+
185
+ // Topic favorite/unsubscribe
186
  wp_enqueue_script( 'bbpress-topic', $this->url . 'js/topic.js', array( 'jquery' ), $this->version );
187
+
188
+ // Hierarchical replies
189
+ if ( bbp_thread_replies() ) {
190
+ wp_enqueue_script( 'bbpress-reply', $this->url . 'js/reply.js', array(), $this->version );
191
+ }
192
  }
193
 
194
  // User Profile edit
templates/default/bbpress/content-archive-forum.php CHANGED
@@ -11,11 +11,15 @@
11
 
12
  <div id="bbpress-forums">
13
 
14
- <div class="bbp-search-form">
15
 
16
- <?php bbp_get_template_part( 'form', 'search' ); ?>
17
 
18
- </div>
 
 
 
 
19
 
20
  <?php bbp_breadcrumb(); ?>
21
 
11
 
12
  <div id="bbpress-forums">
13
 
14
+ <?php if ( bbp_allow_search() ) : ?>
15
 
16
+ <div class="bbp-search-form">
17
 
18
+ <?php bbp_get_template_part( 'form', 'search' ); ?>
19
+
20
+ </div>
21
+
22
+ <?php endif; ?>
23
 
24
  <?php bbp_breadcrumb(); ?>
25
 
templates/default/bbpress/content-archive-topic.php CHANGED
@@ -11,6 +11,16 @@
11
 
12
  <div id="bbpress-forums">
13
 
 
 
 
 
 
 
 
 
 
 
14
  <?php bbp_breadcrumb(); ?>
15
 
16
  <?php if ( bbp_is_topic_tag() ) bbp_topic_tag_description(); ?>
11
 
12
  <div id="bbpress-forums">
13
 
14
+ <?php if ( bbp_allow_search() ) : ?>
15
+
16
+ <div class="bbp-search-form">
17
+
18
+ <?php bbp_get_template_part( 'form', 'search' ); ?>
19
+
20
+ </div>
21
+
22
+ <?php endif; ?>
23
+
24
  <?php bbp_breadcrumb(); ?>
25
 
26
  <?php if ( bbp_is_topic_tag() ) bbp_topic_tag_description(); ?>
templates/default/bbpress/content-single-topic-lead.php CHANGED
@@ -37,7 +37,7 @@
37
 
38
  <span class="bbp-topic-post-date"><?php bbp_topic_post_date(); ?></span>
39
 
40
- <a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>" class="bbp-topic-permalink">#<?php bbp_topic_id(); ?></a>
41
 
42
  <?php do_action( 'bbp_theme_before_topic_admin_links' ); ?>
43
 
37
 
38
  <span class="bbp-topic-post-date"><?php bbp_topic_post_date(); ?></span>
39
 
40
+ <a href="<?php bbp_topic_permalink(); ?>" class="bbp-topic-permalink">#<?php bbp_topic_id(); ?></a>
41
 
42
  <?php do_action( 'bbp_theme_before_topic_admin_links' ); ?>
43
 
templates/default/bbpress/form-forum.php CHANGED
@@ -72,22 +72,11 @@
72
 
73
  <?php do_action( 'bbp_theme_before_forum_form_content' ); ?>
74
 
75
- <?php if ( !function_exists( 'wp_editor' ) ) : ?>
76
-
77
- <p>
78
- <label for="bbp_forum_content"><?php _e( 'Forum Description:', 'bbpress' ); ?></label><br />
79
- <textarea id="bbp_forum_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_forum_content" cols="60" rows="10"><?php bbp_form_forum_content(); ?></textarea>
80
- </p>
81
-
82
- <?php else : ?>
83
-
84
- <?php bbp_the_content( array( 'context' => 'forum' ) ); ?>
85
-
86
- <?php endif; ?>
87
 
88
  <?php do_action( 'bbp_theme_after_forum_form_content' ); ?>
89
 
90
- <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
91
 
92
  <p class="form-allowed-tags">
93
  <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
72
 
73
  <?php do_action( 'bbp_theme_before_forum_form_content' ); ?>
74
 
75
+ <?php bbp_the_content( array( 'context' => 'forum' ) ); ?>
 
 
 
 
 
 
 
 
 
 
 
76
 
77
  <?php do_action( 'bbp_theme_after_forum_form_content' ); ?>
78
 
79
+ <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
80
 
81
  <p class="form-allowed-tags">
82
  <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
templates/default/bbpress/form-reply.php CHANGED
@@ -54,22 +54,11 @@
54
 
55
  <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
56
 
57
- <?php if ( !function_exists( 'wp_editor' ) ) : ?>
58
-
59
- <p>
60
- <label for="bbp_reply_content"><?php _e( 'Reply:', 'bbpress' ); ?></label><br />
61
- <textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" rows="6"><?php bbp_form_reply_content(); ?></textarea>
62
- </p>
63
-
64
- <?php else : ?>
65
-
66
- <?php bbp_the_content( array( 'context' => 'reply' ) ); ?>
67
-
68
- <?php endif; ?>
69
 
70
  <?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
71
 
72
- <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
73
 
74
  <p class="form-allowed-tags">
75
  <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
@@ -99,7 +88,7 @@
99
 
100
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
101
 
102
- <?php if ( bbp_is_reply_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?>
103
 
104
  <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
105
 
@@ -120,11 +109,10 @@
120
  <?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?>
121
 
122
  <fieldset class="bbp-form">
123
- <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
124
- <div>
125
  <input name="bbp_log_reply_edit" id="bbp_log_reply_edit" type="checkbox" value="1" <?php bbp_form_reply_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />
126
  <label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
127
- </div>
128
 
129
  <div>
130
  <label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
@@ -142,6 +130,8 @@
142
 
143
  <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?>
144
 
 
 
145
  <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
146
 
147
  <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?>
54
 
55
  <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
56
 
57
+ <?php bbp_the_content( array( 'context' => 'reply' ) ); ?>
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  <?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
60
 
61
+ <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
62
 
63
  <p class="form-allowed-tags">
64
  <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
88
 
89
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
90
 
91
+ <?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?>
92
 
93
  <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
94
 
109
  <?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?>
110
 
111
  <fieldset class="bbp-form">
112
+ <legend>
 
113
  <input name="bbp_log_reply_edit" id="bbp_log_reply_edit" type="checkbox" value="1" <?php bbp_form_reply_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />
114
  <label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
115
+ </legend>
116
 
117
  <div>
118
  <label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
130
 
131
  <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?>
132
 
133
+ <?php bbp_cancel_reply_to_link(); ?>
134
+
135
  <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
136
 
137
  <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?>
templates/default/bbpress/form-search.php CHANGED
@@ -12,6 +12,7 @@
12
  <form role="search" method="get" id="bbp-search-form" action="<?php bbp_search_url(); ?>">
13
  <div>
14
  <label class="screen-reader-text hidden" for="bbp_search"><?php _e( 'Search for:', 'bbpress' ); ?></label>
 
15
  <input tabindex="<?php bbp_tab_index(); ?>" type="text" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" id="bbp_search" />
16
  <input tabindex="<?php bbp_tab_index(); ?>" class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
17
  </div>
12
  <form role="search" method="get" id="bbp-search-form" action="<?php bbp_search_url(); ?>">
13
  <div>
14
  <label class="screen-reader-text hidden" for="bbp_search"><?php _e( 'Search for:', 'bbpress' ); ?></label>
15
+ <input type="hidden" name="action" value="bbp-search-request" />
16
  <input tabindex="<?php bbp_tab_index(); ?>" type="text" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" id="bbp_search" />
17
  <input tabindex="<?php bbp_tab_index(); ?>" class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
18
  </div>
templates/default/bbpress/form-topic.php CHANGED
@@ -80,22 +80,11 @@
80
 
81
  <?php do_action( 'bbp_theme_before_topic_form_content' ); ?>
82
 
83
- <?php if ( !function_exists( 'wp_editor' ) ) : ?>
84
-
85
- <p>
86
- <label for="bbp_topic_content"><?php _e( 'Topic:', 'bbpress' ); ?></label><br />
87
- <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="60" rows="6"><?php bbp_form_topic_content(); ?></textarea>
88
- </p>
89
-
90
- <?php else : ?>
91
-
92
- <?php bbp_the_content( array( 'context' => 'topic' ) ); ?>
93
-
94
- <?php endif; ?>
95
 
96
  <?php do_action( 'bbp_theme_after_topic_form_content' ); ?>
97
 
98
- <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
99
 
100
  <p class="form-allowed-tags">
101
  <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
@@ -123,7 +112,12 @@
123
 
124
  <p>
125
  <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
126
- <?php bbp_dropdown( array( 'selected' => bbp_get_form_topic_forum() ) ); ?>
 
 
 
 
 
127
  </p>
128
 
129
  <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
@@ -138,12 +132,24 @@
138
 
139
  <label for="bbp_stick_topic"><?php _e( 'Topic Type:', 'bbpress' ); ?></label><br />
140
 
141
- <?php bbp_topic_type_select(); ?>
142
 
143
  </p>
144
 
145
  <?php do_action( 'bbp_theme_after_topic_form_type' ); ?>
146
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  <?php endif; ?>
148
 
149
  <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_topic_edit() || ( bbp_is_topic_edit() && !bbp_is_topic_anonymous() ) ) ) : ?>
@@ -153,7 +159,7 @@
153
  <p>
154
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
155
 
156
- <?php if ( bbp_is_topic_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?>
157
 
158
  <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
159
 
@@ -173,11 +179,10 @@
173
  <?php do_action( 'bbp_theme_before_topic_form_revisions' ); ?>
174
 
175
  <fieldset class="bbp-form">
176
- <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
177
- <div>
178
  <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />
179
  <label for="bbp_log_topic_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
180
- </div>
181
 
182
  <div>
183
  <label for="bbp_topic_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
80
 
81
  <?php do_action( 'bbp_theme_before_topic_form_content' ); ?>
82
 
83
+ <?php bbp_the_content( array( 'context' => 'topic' ) ); ?>
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  <?php do_action( 'bbp_theme_after_topic_form_content' ); ?>
86
 
87
+ <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
88
 
89
  <p class="form-allowed-tags">
90
  <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
112
 
113
  <p>
114
  <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
115
+ <?php
116
+ bbp_dropdown( array(
117
+ 'show_none' => __( '(No Forum)', 'bbpress' ),
118
+ 'selected' => bbp_get_form_topic_forum()
119
+ ) );
120
+ ?>
121
  </p>
122
 
123
  <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
132
 
133
  <label for="bbp_stick_topic"><?php _e( 'Topic Type:', 'bbpress' ); ?></label><br />
134
 
135
+ <?php bbp_form_topic_type_dropdown(); ?>
136
 
137
  </p>
138
 
139
  <?php do_action( 'bbp_theme_after_topic_form_type' ); ?>
140
 
141
+ <?php do_action( 'bbp_theme_before_topic_form_status' ); ?>
142
+
143
+ <p>
144
+
145
+ <label for="bbp_topic_status"><?php _e( 'Topic Status:', 'bbpress' ); ?></label><br />
146
+
147
+ <?php bbp_form_topic_status_dropdown(); ?>
148
+
149
+ </p>
150
+
151
+ <?php do_action( 'bbp_theme_after_topic_form_status' ); ?>
152
+
153
  <?php endif; ?>
154
 
155
  <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_topic_edit() || ( bbp_is_topic_edit() && !bbp_is_topic_anonymous() ) ) ) : ?>
159
  <p>
160
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
161
 
162
+ <?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
163
 
164
  <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
165
 
179
  <?php do_action( 'bbp_theme_before_topic_form_revisions' ); ?>
180
 
181
  <fieldset class="bbp-form">
182
+ <legend>
 
183
  <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />
184
  <label for="bbp_log_topic_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
185
+ </legend>
186
 
187
  <div>
188
  <label for="bbp_topic_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
templates/default/bbpress/form-user-edit.php CHANGED
@@ -22,17 +22,17 @@
22
 
23
  <div>
24
  <label for="first_name"><?php _e( 'First Name', 'bbpress' ) ?></label>
25
- <input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'first_name' ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
26
  </div>
27
 
28
  <div>
29
  <label for="last_name"><?php _e( 'Last Name', 'bbpress' ) ?></label>
30
- <input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'last_name' ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
31
  </div>
32
 
33
  <div>
34
  <label for="nickname"><?php _e( 'Nickname', 'bbpress' ); ?></label>
35
- <input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'nickname' ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
36
  </div>
37
 
38
  <div>
@@ -55,14 +55,14 @@
55
 
56
  <div>
57
  <label for="url"><?php _e( 'Website', 'bbpress' ) ?></label>
58
- <input type="text" name="url" id="url" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'user_url' ) ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
59
  </div>
60
 
61
  <?php foreach ( bbp_edit_user_contact_methods() as $name => $desc ) : ?>
62
 
63
  <div>
64
- <label for="<?php echo $name; ?>"><?php echo apply_filters( 'user_'.$name.'_label', $desc ); ?></label>
65
- <input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( bbp_get_displayed_user_field( $name ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
66
  </div>
67
 
68
  <?php endforeach; ?>
@@ -80,7 +80,7 @@
80
 
81
  <div>
82
  <label for="description"><?php _e( 'Biographical Info', 'bbpress' ); ?></label>
83
- <textarea name="description" id="description" rows="5" cols="30" tabindex="<?php bbp_tab_index(); ?>"><?php echo esc_attr( bbp_get_displayed_user_field( 'description' ) ); ?></textarea>
84
  </div>
85
 
86
  <?php do_action( 'bbp_user_edit_after_about' ); ?>
@@ -96,19 +96,19 @@
96
 
97
  <div>
98
  <label for="user_login"><?php _e( 'Username', 'bbpress' ); ?></label>
99
- <input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'user_login' ) ); ?>" disabled="disabled" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
100
  </div>
101
 
102
  <div>
103
  <label for="email"><?php _e( 'Email', 'bbpress' ); ?></label>
104
 
105
- <input type="text" name="email" id="email" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'user_email' ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
106
 
107
  <?php
108
 
109
  // Handle address change requests
110
  $new_email = get_option( bbp_get_displayed_user_id() . '_new_email' );
111
- if ( $new_email && $new_email != bbp_get_displayed_user_field( 'user_email' ) ) : ?>
112
 
113
  <span class="updated inline">
114
 
22
 
23
  <div>
24
  <label for="first_name"><?php _e( 'First Name', 'bbpress' ) ?></label>
25
+ <input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
26
  </div>
27
 
28
  <div>
29
  <label for="last_name"><?php _e( 'Last Name', 'bbpress' ) ?></label>
30
+ <input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
31
  </div>
32
 
33
  <div>
34
  <label for="nickname"><?php _e( 'Nickname', 'bbpress' ); ?></label>
35
+ <input type="text" name="nickname" id="nickname" value="<?php bbp_displayed_user_field( 'nickname', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
36
  </div>
37
 
38
  <div>
55
 
56
  <div>
57
  <label for="url"><?php _e( 'Website', 'bbpress' ) ?></label>
58
+ <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
59
  </div>
60
 
61
  <?php foreach ( bbp_edit_user_contact_methods() as $name => $desc ) : ?>
62
 
63
  <div>
64
+ <label for="<?php echo esc_attr( $name ); ?>"><?php echo apply_filters( 'user_' . $name . '_label', $desc ); ?></label>
65
+ <input type="text" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>" value="<?php bbp_displayed_user_field( $name, 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
66
  </div>
67
 
68
  <?php endforeach; ?>
80
 
81
  <div>
82
  <label for="description"><?php _e( 'Biographical Info', 'bbpress' ); ?></label>
83
+ <textarea name="description" id="description" rows="5" cols="30" tabindex="<?php bbp_tab_index(); ?>"><?php bbp_displayed_user_field( 'description', 'edit' ); ?></textarea>
84
  </div>
85
 
86
  <?php do_action( 'bbp_user_edit_after_about' ); ?>
96
 
97
  <div>
98
  <label for="user_login"><?php _e( 'Username', 'bbpress' ); ?></label>
99
+ <input type="text" name="user_login" id="user_login" value="<?php bbp_displayed_user_field( 'user_login', 'edit' ); ?>" disabled="disabled" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
100
  </div>
101
 
102
  <div>
103
  <label for="email"><?php _e( 'Email', 'bbpress' ); ?></label>
104
 
105
+ <input type="text" name="email" id="email" value="<?php bbp_displayed_user_field( 'user_email', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
106
 
107
  <?php
108
 
109
  // Handle address change requests
110
  $new_email = get_option( bbp_get_displayed_user_id() . '_new_email' );
111
+ if ( !empty( $new_email ) && $new_email !== bbp_get_displayed_user_field( 'user_email', 'edit' ) ) : ?>
112
 
113
  <span class="updated inline">
114
 
templates/default/bbpress/loop-replies.php CHANGED
@@ -39,11 +39,19 @@
39
 
40
  <li class="bbp-body">
41
 
42
- <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
43
 
44
- <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
45
 
46
- <?php endwhile; ?>
 
 
 
 
 
 
 
 
47
 
48
  </li><!-- .bbp-body -->
49
 
39
 
40
  <li class="bbp-body">
41
 
42
+ <?php if ( bbp_thread_replies() ) : ?>
43
 
44
+ <?php bbp_list_replies(); ?>
45
 
46
+ <?php else : ?>
47
+
48
+ <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
49
+
50
+ <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
51
+
52
+ <?php endwhile; ?>
53
+
54
+ <?php endif; ?>
55
 
56
  </li><!-- .bbp-body -->
57
 
templates/default/bbpress/loop-search-forum.php CHANGED
@@ -15,7 +15,7 @@
15
 
16
  <span class="bbp-forum-post-date"><?php printf( __( 'Last updated %s', 'bbpress' ), bbp_get_forum_last_active_time() ); ?></span>
17
 
18
- <a href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>" class="bbp-forum-permalink">#<?php bbp_forum_id(); ?></a>
19
 
20
  </div><!-- .bbp-meta -->
21
 
@@ -23,7 +23,7 @@
23
 
24
  <?php do_action( 'bbp_theme_before_forum_title' ); ?>
25
 
26
- <h3><?php _e( 'Forum: ', 'bbpress' ); ?><a href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a></h3>
27
 
28
  <?php do_action( 'bbp_theme_after_forum_title' ); ?>
29
 
@@ -37,7 +37,7 @@
37
 
38
  <?php do_action( 'bbp_theme_before_forum_content' ); ?>
39
 
40
- <?php the_excerpt(); ?>
41
 
42
  <?php do_action( 'bbp_theme_after_forum_content' ); ?>
43
 
15
 
16
  <span class="bbp-forum-post-date"><?php printf( __( 'Last updated %s', 'bbpress' ), bbp_get_forum_last_active_time() ); ?></span>
17
 
18
+ <a href="<?php bbp_forum_permalink(); ?>" class="bbp-forum-permalink">#<?php bbp_forum_id(); ?></a>
19
 
20
  </div><!-- .bbp-meta -->
21
 
23
 
24
  <?php do_action( 'bbp_theme_before_forum_title' ); ?>
25
 
26
+ <h3><?php _e( 'Forum: ', 'bbpress' ); ?><a href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a></h3>
27
 
28
  <?php do_action( 'bbp_theme_after_forum_title' ); ?>
29
 
37
 
38
  <?php do_action( 'bbp_theme_before_forum_content' ); ?>
39
 
40
+ <?php bbp_forum_content(); ?>
41
 
42
  <?php do_action( 'bbp_theme_after_forum_content' ); ?>
43
 
templates/default/bbpress/loop-search-reply.php CHANGED
@@ -15,20 +15,14 @@
15
 
16
  <span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
17
 
18
- <a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
19
-
20
- <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
21
-
22
- <?php bbp_reply_admin_links(); ?>
23
-
24
- <?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
25
 
26
  </div><!-- .bbp-meta -->
27
 
28
  <div class="bbp-reply-title">
29
 
30
  <h3><?php _e( 'In reply to: ', 'bbpress' ); ?>
31
- <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>" title="<?php bbp_topic_title( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a></h3>
32
 
33
  </div><!-- .bbp-reply-title -->
34
 
15
 
16
  <span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
17
 
18
+ <a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
 
 
 
 
 
 
19
 
20
  </div><!-- .bbp-meta -->
21
 
22
  <div class="bbp-reply-title">
23
 
24
  <h3><?php _e( 'In reply to: ', 'bbpress' ); ?>
25
+ <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a></h3>
26
 
27
  </div><!-- .bbp-reply-title -->
28
 
templates/default/bbpress/loop-search-topic.php CHANGED
@@ -15,13 +15,7 @@
15
 
16
  <span class="bbp-topic-post-date"><?php bbp_topic_post_date( bbp_get_topic_id() ); ?></span>
17
 
18
- <a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>" class="bbp-topic-permalink">#<?php bbp_topic_id(); ?></a>
19
-
20
- <?php do_action( 'bbp_theme_before_topic_admin_links' ); ?>
21
-
22
- <?php bbp_topic_admin_links( bbp_get_topic_id() ); ?>
23
-
24
- <?php do_action( 'bbp_theme_after_topic_admin_links' ); ?>
25
 
26
  </div><!-- .bbp-meta -->
27
 
@@ -30,7 +24,7 @@
30
  <?php do_action( 'bbp_theme_before_topic_title' ); ?>
31
 
32
  <h3><?php _e( 'Topic: ', 'bbpress' ); ?>
33
- <a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a></h3>
34
 
35
  <div class="bbp-topic-title-meta">
36
 
@@ -44,7 +38,7 @@
44
 
45
  <?php endif; ?>
46
 
47
- <a href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>" title="<?php bbp_forum_title( bbp_get_topic_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a>
48
 
49
  </div><!-- .bbp-topic-title-meta -->
50
 
15
 
16
  <span class="bbp-topic-post-date"><?php bbp_topic_post_date( bbp_get_topic_id() ); ?></span>
17
 
18
+ <a href="<?php bbp_topic_permalink(); ?>" class="bbp-topic-permalink">#<?php bbp_topic_id(); ?></a>
 
 
 
 
 
 
19
 
20
  </div><!-- .bbp-meta -->
21
 
24
  <?php do_action( 'bbp_theme_before_topic_title' ); ?>
25
 
26
  <h3><?php _e( 'Topic: ', 'bbpress' ); ?>
27
+ <a href="<?php bbp_topic_permalink(); ?>"><?php bbp_topic_title(); ?></a></h3>
28
 
29
  <div class="bbp-topic-title-meta">
30
 
38
 
39
  <?php endif; ?>
40
 
41
+ <a href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a>
42
 
43
  </div><!-- .bbp-topic-title-meta -->
44
 
templates/default/bbpress/loop-single-forum.php CHANGED
@@ -15,13 +15,13 @@
15
 
16
  <?php do_action( 'bbp_theme_before_forum_title' ); ?>
17
 
18
- <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>
19
 
20
  <?php do_action( 'bbp_theme_after_forum_title' ); ?>
21
 
22
  <?php do_action( 'bbp_theme_before_forum_description' ); ?>
23
 
24
- <div class="bbp-forum-content"><?php the_content(); ?></div>
25
 
26
  <?php do_action( 'bbp_theme_after_forum_description' ); ?>
27
 
15
 
16
  <?php do_action( 'bbp_theme_before_forum_title' ); ?>
17
 
18
+ <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>
19
 
20
  <?php do_action( 'bbp_theme_after_forum_title' ); ?>
21
 
22
  <?php do_action( 'bbp_theme_before_forum_description' ); ?>
23
 
24
+ <div class="bbp-forum-content"><?php bbp_forum_content(); ?></div>
25
 
26
  <?php do_action( 'bbp_theme_after_forum_description' ); ?>
27
 
templates/default/bbpress/loop-single-reply.php CHANGED
@@ -19,12 +19,12 @@
19
 
20
  <span class="bbp-header">
21
  <?php _e( 'in reply to: ', 'bbpress' ); ?>
22
- <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>" title="<?php bbp_topic_title( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
23
  </span>
24
 
25
  <?php endif; ?>
26
 
27
- <a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
28
 
29
  <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
30
 
19
 
20
  <span class="bbp-header">
21
  <?php _e( 'in reply to: ', 'bbpress' ); ?>
22
+ <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
23
  </span>
24
 
25
  <?php endif; ?>
26
 
27
+ <a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
28
 
29
  <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
30
 
templates/default/bbpress/loop-single-topic.php CHANGED
@@ -45,7 +45,7 @@
45
 
46
  <?php do_action( 'bbp_theme_before_topic_title' ); ?>
47
 
48
- <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a>
49
 
50
  <?php do_action( 'bbp_theme_after_topic_title' ); ?>
51
 
@@ -61,7 +61,7 @@
61
 
62
  <?php do_action( 'bbp_theme_after_topic_started_by' ); ?>
63
 
64
- <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() != bbp_get_forum_id() ) ) : ?>
65
 
66
  <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
67
 
45
 
46
  <?php do_action( 'bbp_theme_before_topic_title' ); ?>
47
 
48
+ <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink(); ?>"><?php bbp_topic_title(); ?></a>
49
 
50
  <?php do_action( 'bbp_theme_after_topic_title' ); ?>
51
 
61
 
62
  <?php do_action( 'bbp_theme_after_topic_started_by' ); ?>
63
 
64
+ <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() !== bbp_get_forum_id() ) ) : ?>
65
 
66
  <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
67
 
templates/default/bbpress/user-details.php CHANGED
@@ -16,7 +16,7 @@
16
 
17
  <span class='vcard'>
18
  <a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php bbp_displayed_user_field( 'display_name' ); ?>" rel="me">
19
- <?php echo get_avatar( bbp_get_displayed_user_field( 'user_email' ), apply_filters( 'bbp_single_user_details_avatar_size', 150 ) ); ?>
20
  </a>
21
  </span>
22
 
@@ -26,26 +26,26 @@
26
  <ul>
27
  <li class="<?php if ( bbp_is_single_user_profile() ) :?>current<?php endif; ?>">
28
  <span class="vcard bbp-user-profile-link">
29
- <a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php printf( __( "%s's Profile", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>" rel="me"><?php _e( 'Profile', 'bbpress' ); ?></a>
30
  </span>
31
  </li>
32
 
33
  <li class="<?php if ( bbp_is_single_user_topics() ) :?>current<?php endif; ?>">
34
  <span class='bbp-user-topics-created-link'>
35
- <a href="<?php bbp_user_topics_created_url(); ?>" title="<?php printf( __( "%s's Topics Started", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>"><?php _e( 'Topics Started', 'bbpress' ); ?></a>
36
  </span>
37
  </li>
38
 
39
  <li class="<?php if ( bbp_is_single_user_replies() ) :?>current<?php endif; ?>">
40
  <span class='bbp-user-replies-created-link'>
41
- <a href="<?php bbp_user_replies_created_url(); ?>" title="<?php printf( __( "%s's Replies Created", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>"><?php _e( 'Replies Created', 'bbpress' ); ?></a>
42
  </span>
43
  </li>
44
 
45
  <?php if ( bbp_is_favorites_active() ) : ?>
46
  <li class="<?php if ( bbp_is_favorites() ) :?>current<?php endif; ?>">
47
  <span class="bbp-user-favorites-link">
48
- <a href="<?php bbp_favorites_permalink(); ?>" title="<?php printf( __( "%s's Favorites", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>"><?php _e( 'Favorites', 'bbpress' ); ?></a>
49
  </span>
50
  </li>
51
  <?php endif; ?>
@@ -55,14 +55,14 @@
55
  <?php if ( bbp_is_subscriptions_active() ) : ?>
56
  <li class="<?php if ( bbp_is_subscriptions() ) :?>current<?php endif; ?>">
57
  <span class="bbp-user-subscriptions-link">
58
- <a href="<?php bbp_subscriptions_permalink(); ?>" title="<?php printf( __( "%s's Subscriptions", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>"><?php _e( 'Subscriptions', 'bbpress' ); ?></a>
59
  </span>
60
  </li>
61
  <?php endif; ?>
62
 
63
  <li class="<?php if ( bbp_is_single_user_edit() ) :?>current<?php endif; ?>">
64
  <span class="bbp-user-edit-link">
65
- <a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( __( 'Edit Profile of User %s', 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>"><?php _e( 'Edit', 'bbpress' ); ?></a>
66
  </span>
67
  </li>
68
 
16
 
17
  <span class='vcard'>
18
  <a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php bbp_displayed_user_field( 'display_name' ); ?>" rel="me">
19
+ <?php echo get_avatar( bbp_get_displayed_user_field( 'user_email', 'raw' ), apply_filters( 'bbp_single_user_details_avatar_size', 150 ) ); ?>
20
  </a>
21
  </span>
22
 
26
  <ul>
27
  <li class="<?php if ( bbp_is_single_user_profile() ) :?>current<?php endif; ?>">
28
  <span class="vcard bbp-user-profile-link">
29
+ <a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php printf( esc_attr__( "%s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>" rel="me"><?php _e( 'Profile', 'bbpress' ); ?></a>
30
  </span>
31
  </li>
32
 
33
  <li class="<?php if ( bbp_is_single_user_topics() ) :?>current<?php endif; ?>">
34
  <span class='bbp-user-topics-created-link'>
35
+ <a href="<?php bbp_user_topics_created_url(); ?>" title="<?php printf( esc_attr__( "%s's Topics Started", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Topics Started', 'bbpress' ); ?></a>
36
  </span>
37
  </li>
38
 
39
  <li class="<?php if ( bbp_is_single_user_replies() ) :?>current<?php endif; ?>">
40
  <span class='bbp-user-replies-created-link'>
41
+ <a href="<?php bbp_user_replies_created_url(); ?>" title="<?php printf( esc_attr__( "%s's Replies Created", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Replies Created', 'bbpress' ); ?></a>
42
  </span>
43
  </li>
44
 
45
  <?php if ( bbp_is_favorites_active() ) : ?>
46
  <li class="<?php if ( bbp_is_favorites() ) :?>current<?php endif; ?>">
47
  <span class="bbp-user-favorites-link">
48
+ <a href="<?php bbp_favorites_permalink(); ?>" title="<?php printf( esc_attr__( "%s's Favorites", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Favorites', 'bbpress' ); ?></a>
49
  </span>
50
  </li>
51
  <?php endif; ?>
55
  <?php if ( bbp_is_subscriptions_active() ) : ?>
56
  <li class="<?php if ( bbp_is_subscriptions() ) :?>current<?php endif; ?>">
57
  <span class="bbp-user-subscriptions-link">
58
+ <a href="<?php bbp_subscriptions_permalink(); ?>" title="<?php printf( esc_attr__( "%s's Subscriptions", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Subscriptions', 'bbpress' ); ?></a>
59
  </span>
60
  </li>
61
  <?php endif; ?>
62
 
63
  <li class="<?php if ( bbp_is_single_user_edit() ) :?>current<?php endif; ?>">
64
  <span class="bbp-user-edit-link">
65
+ <a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( esc_attr__( "Edit %s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Edit', 'bbpress' ); ?></a>
66
  </span>
67
  </li>
68
 
templates/default/css/bbpress-rtl.css CHANGED
@@ -60,12 +60,18 @@ body.reply-edit .reply {
60
  }
61
 
62
  #bbpress-forums ul {
 
63
  list-style: none;
64
  margin: 0;
65
  padding: 0;
66
  }
67
 
 
 
 
 
68
  #bbpress-forums li {
 
69
  margin: 0;
70
  list-style: none;
71
  }
@@ -160,8 +166,13 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
160
  #bbpress-forums div.bbp-forum-title h3,
161
  #bbpress-forums div.bbp-topic-title h3,
162
  #bbpress-forums div.bbp-reply-title h3 {
163
- line-height: 1em;
164
- margin: 8px 0;
 
 
 
 
 
165
  }
166
 
167
  #bbpress-forums div.bbp-forum-author,
@@ -190,6 +201,12 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
190
  display: inline-block;
191
  }
192
 
 
 
 
 
 
 
193
  #bbpress-forums div.bbp-forum-author .bbp-author-role,
194
  #bbpress-forums div.bbp-topic-author .bbp-author-role,
195
  #bbpress-forums div.bbp-reply-author .bbp-author-role {
@@ -258,6 +275,19 @@ span.bbp-author-ip {
258
  text-align: right;
259
  }
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  #bbpress-forums div.bbp-topic-content a,
262
  #bbpress-forums div.bbp-reply-content a {
263
  background: none;
@@ -324,10 +354,13 @@ span.bbp-author-ip {
324
  #bbpress-forums div.bbp-topic-content pre,
325
  #bbpress-forums div.bbp-reply-content pre {
326
  font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
327
- display: inline;
328
  background-color: #f9f9f9;
329
  border: 1px solid #ddd;
330
- padding: 2px;
 
 
 
331
  }
332
 
333
  #bbpress-forums div.bbp-topic-content pre,
@@ -348,6 +381,21 @@ span.bbp-author-ip {
348
  margin: 0;
349
  background-color: transparent;
350
  overflow-wrap: normal;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  }
352
 
353
  /* =Breadcrumb and Tags
@@ -382,6 +430,20 @@ div.bbp-topic-tags {
382
  clear: right;
383
  }
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  #bbpress-forums div.bbp-search-form {
386
  float: left;
387
  }
@@ -474,9 +536,10 @@ td.bbp-topic-counts {
474
 
475
  #bbpress-forums .bbp-forum-info .bbp-forum-content,
476
  #bbpress-forums p.bbp-topic-meta {
 
477
  margin: 5px 0 5px;
478
  padding: 0;
479
- font-size: 11px;
480
  }
481
 
482
  #bbpress-forums p.bbp-topic-meta span {
@@ -643,7 +706,7 @@ div.bbp-submit-wrapper {
643
  }
644
 
645
  p.form-allowed-tags {
646
- width: 462px;
647
  }
648
 
649
  /* =TinyMCE in themes
@@ -924,8 +987,7 @@ div.bbp-template-notice a {
924
  #bbpress-forums ul.bbp-topic-revision-log img.avatar,
925
  #bbpress-forums div.bbp-template-notice img.avatar,
926
  #bbpress-forums .widget_display_topics img.avatar,
927
- #bbpress-forums .widget_display_replies img.avatar,
928
- #bbpress-forums p.bbp-topic-meta img.avatar {
929
  float: none;
930
  margin-bottom: -7px;
931
  border: 3px double #ddd;
@@ -1065,3 +1127,216 @@ body.my-account #bbpress-forums {
1065
  #bbpress-forums li:hover > div.row-actions {
1066
  visibility: visible;
1067
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
 
62
  #bbpress-forums ul {
63
+ background: none;
64
  list-style: none;
65
  margin: 0;
66
  padding: 0;
67
  }
68
 
69
+ #bbpress-forums ul.bbp-threaded-replies {
70
+ margin-right: 50px;
71
+ }
72
+
73
  #bbpress-forums li {
74
+ background: none;
75
  margin: 0;
76
  list-style: none;
77
  }
166
  #bbpress-forums div.bbp-forum-title h3,
167
  #bbpress-forums div.bbp-topic-title h3,
168
  #bbpress-forums div.bbp-reply-title h3 {
169
+ background: none;
170
+ border: none;
171
+ font-size: 16px;
172
+ line-height: 1em;
173
+ margin: 8px 0;
174
+ padding: 0;
175
+ text-transform: none;
176
  }
177
 
178
  #bbpress-forums div.bbp-forum-author,
201
  display: inline-block;
202
  }
203
 
204
+ #bbpress-forums div.bbp-topic-author a.bbp-author-name,
205
+ #bbpress-forums div.bbp-reply-author a.bbp-author-name {
206
+ clear: right;
207
+ display: block;
208
+ }
209
+
210
  #bbpress-forums div.bbp-forum-author .bbp-author-role,
211
  #bbpress-forums div.bbp-topic-author .bbp-author-role,
212
  #bbpress-forums div.bbp-reply-author .bbp-author-role {
275
  text-align: right;
276
  }
277
 
278
+ /* Clearing hack */
279
+ #bbpress-forums div.bbp-forum-content:after,
280
+ #bbpress-forums div.bbp-topic-content:after,
281
+ #bbpress-forums div.bbp-reply-content:after {
282
+ clear: both;
283
+ content: ".";
284
+ display: block;
285
+ float: none;
286
+ height: 0;
287
+ font-size: 0;
288
+ visibility: hidden;
289
+ }
290
+
291
  #bbpress-forums div.bbp-topic-content a,
292
  #bbpress-forums div.bbp-reply-content a {
293
  background: none;
354
  #bbpress-forums div.bbp-topic-content pre,
355
  #bbpress-forums div.bbp-reply-content pre {
356
  font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
357
+ display: inline-block;
358
  background-color: #f9f9f9;
359
  border: 1px solid #ddd;
360
+ padding: 0 5px;
361
+ max-width: 95%;
362
+ vertical-align: middle;
363
+ margin-top: -3px;
364
  }
365
 
366
  #bbpress-forums div.bbp-topic-content pre,
381
  margin: 0;
382
  background-color: transparent;
383
  overflow-wrap: normal;
384
+ overflow: scroll;
385
+ max-width: 100%;
386
+ }
387
+
388
+ /* =Reply to
389
+ -------------------------------------------------------------- */
390
+
391
+ #bbpress-forums div.bbp-reply-to {
392
+ margin-right: 130px;
393
+ padding: 12px 0px 12px 12px;
394
+ text-align: left;
395
+ }
396
+
397
+ #bbpress-forums div#bbp-cancel-reply-to {
398
+ text-align: left;
399
  }
400
 
401
  /* =Breadcrumb and Tags
430
  clear: right;
431
  }
432
 
433
+ #bbpress-forums #bbp-search-form .hidden {
434
+ height: 0;
435
+ width: 0;
436
+ overflow: hidden;
437
+ position: absolute;
438
+ background: none;
439
+ left: -999em;
440
+ }
441
+
442
+ #bbpress-forums #bbp-search-form #bbp_search {
443
+ display: inline-block;
444
+ width: auto;
445
+ }
446
+
447
  #bbpress-forums div.bbp-search-form {
448
  float: left;
449
  }
536
 
537
  #bbpress-forums .bbp-forum-info .bbp-forum-content,
538
  #bbpress-forums p.bbp-topic-meta {
539
+ font-size: 11px;
540
  margin: 5px 0 5px;
541
  padding: 0;
542
+ word-wrap: break-word;
543
  }
544
 
545
  #bbpress-forums p.bbp-topic-meta span {
706
  }
707
 
708
  p.form-allowed-tags {
709
+ max-width: 100%;
710
  }
711
 
712
  /* =TinyMCE in themes
987
  #bbpress-forums ul.bbp-topic-revision-log img.avatar,
988
  #bbpress-forums div.bbp-template-notice img.avatar,
989
  #bbpress-forums .widget_display_topics img.avatar,
990
+ #bbpress-forums .widget_display_replies img.avatar {
 
991
  float: none;
992
  margin-bottom: -7px;
993
  border: 3px double #ddd;
1127
  #bbpress-forums li:hover > div.row-actions {
1128
  visibility: visible;
1129
  }
1130
+
1131
+ /*--------------------------------------------------------------
1132
+ Media Queries
1133
+ --------------------------------------------------------------*/
1134
+
1135
+ /* =Standard Mobile Landscape
1136
+ -------------------------------------------------------------- */
1137
+ @media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
1138
+ -webkit-text-size-adjust: none;
1139
+ }
1140
+ @media only screen and (max-width: 480px) {
1141
+ #bbpress-forums div.bbp-topic-tags {
1142
+ clear: right;
1143
+ float: right;
1144
+ }
1145
+ div.bbp-search-form input,
1146
+ div.bbp-search-form button {
1147
+ font-size: 11px;
1148
+ padding: 2px;
1149
+ }
1150
+ li.bbp-forum-info,
1151
+ li.bbp-topic-title {
1152
+ width: 45%;
1153
+ }
1154
+ li.bbp-forum-topic-count,
1155
+ li.bbp-forum-reply-count,
1156
+ li.bbp-topic-voice-count,
1157
+ li.bbp-topic-reply-count {
1158
+ width: 15%;
1159
+ }
1160
+ span.bbp-reply-post-date {
1161
+ float: right;
1162
+ }
1163
+ span.bbp-admin-links {
1164
+ clear: right;
1165
+ float: right;
1166
+ }
1167
+ #bbpress-forums .bbp-forums-list li {
1168
+ display: block;
1169
+ font-size: 11px;
1170
+ }
1171
+ #bbpress-forums div.bbp-reply-author {
1172
+ margin: -15px 10px 10px;
1173
+ min-height: 100px;
1174
+ padding-right: 80px;
1175
+ position: relative;
1176
+ text-align: right;
1177
+ width: 100%;
1178
+ }
1179
+ #bbpress-forums div.bbp-reply-author a.bbp-author-name {
1180
+ clear: none;
1181
+ display: inline-block;
1182
+ margin-right: 0;
1183
+ word-wrap: break-word;
1184
+ }
1185
+ #bbpress-forums div.bbp-reply-author img.avatar {
1186
+ position: absolute;
1187
+ top: 15px;
1188
+ right: 0;
1189
+ width: 60px;
1190
+ height: auto;
1191
+ }
1192
+ #bbpress-forums div.bbp-reply-author .bbp-author-role {
1193
+ font-size: 12px;
1194
+ font-style: normal;
1195
+ }
1196
+ #bbpress-forums .bbp-body div.bbp-reply-content {
1197
+ clear: both;
1198
+ margin: 10px;
1199
+ padding: 0;
1200
+ }
1201
+ #bbpress-forums div.bbp-reply-content p {
1202
+ margin-bottom: 1em;
1203
+ }
1204
+ div.bbp-submit-wrapper {
1205
+ float: right;
1206
+ }
1207
+ #bbpress-forums fieldset.bbp-form {
1208
+ padding: 0 10px 10px;
1209
+ }
1210
+ #bbpress-forums #bbp-user-body {
1211
+ clear: both;
1212
+ margin-right: 0;
1213
+ word-wrap: break-word;
1214
+ }
1215
+ }
1216
+
1217
+ /* =Standard Mobile Portrait
1218
+ -------------------------------------------------------------- */
1219
+ @media only screen and (max-width: 320px) {
1220
+ #bbpress-forums div.bbp-search-form {
1221
+ margin-bottom: 10px;
1222
+ }
1223
+ #bbpress-forums li.bbp-header li.bbp-forum-info,
1224
+ #bbpress-forums li.bbp-body li.bbp-forum-info,
1225
+ #bbpress-forums li.bbp-header li.bbp-topic-title,
1226
+ #bbpress-forums li.bbp-body li.bbp-topic-title {
1227
+ width: 100%;
1228
+ }
1229
+ #bbpress-forums li.bbp-header li.bbp-forum-info,
1230
+ #bbpress-forums li.bbp-header li.bbp-topic-title {
1231
+ text-align: center;
1232
+ text-transform: uppercase;
1233
+ }
1234
+ #bbpress-forums li.bbp-header li.bbp-forum-topic-count,
1235
+ #bbpress-forums li.bbp-header li.bbp-forum-reply-count,
1236
+ #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1237
+ #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1238
+ #bbpress-forums li.bbp-header li.bbp-topic-voice-count,
1239
+ #bbpress-forums li.bbp-header li.bbp-topic-reply-count,
1240
+ #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1241
+ #bbpress-forums li.bbp-body li.bbp-topic-reply-count {
1242
+ width: 20%;
1243
+ }
1244
+ #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1245
+ #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1246
+ #bbpress-forums li.bbp-header li.bbp-topic-freshness,
1247
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness {
1248
+ width: 58%;
1249
+ }
1250
+ #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1251
+ #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1252
+ #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1253
+ #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1254
+ #bbpress-forums li.bbp-body li.bbp-topic-reply-count,
1255
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness {
1256
+ margin-top: 7px;
1257
+ }
1258
+ #bbpress-forums li.bbp-header,
1259
+ #bbpress-forums li.bbp-footer {
1260
+ font-size: 10px;
1261
+ }
1262
+ #bbpress-forums li.bbp-header div.bbp-reply-author {
1263
+ text-align: right;
1264
+ width: 25%;
1265
+ }
1266
+ #bbpress-forums li.bbp-header div.bbp-reply-content{
1267
+ margin-right: 25%;
1268
+ }
1269
+ #bbpress-forums div.bbp-template-notice img.avatar,
1270
+ #bbpress-forums p.bbp-topic-meta img.avatar {
1271
+ width: 14px;
1272
+ height: auto;
1273
+ }
1274
+ #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar {
1275
+ padding: 1px;
1276
+ }
1277
+ #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar td {
1278
+ width: 20px;
1279
+ height: 20px;
1280
+ }
1281
+ #bbpress-forums div.wp-editor-container {
1282
+ width: 100%;
1283
+ overflow: auto;
1284
+ }
1285
+ #bbpress-forums input#bbp_topic_title,
1286
+ #bbpress-forums input#bbp_topic_tags {
1287
+ width: 95%;
1288
+ }
1289
+ }
1290
+
1291
+ /* =Extra Small Mobile
1292
+ -------------------------------------------------------------- */
1293
+ @media only screen and (max-width: 240px) {
1294
+ #bbpress-forums li.bbp-header li.bbp-forum-topic-count,
1295
+ #bbpress-forums li.bbp-header li.bbp-forum-reply-count,
1296
+ #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1297
+ #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1298
+ #bbpress-forums li.bbp-header li.bbp-topic-voice-count,
1299
+ #bbpress-forums li.bbp-header li.bbp-topic-reply-count,
1300
+ #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1301
+ #bbpress-forums li.bbp-body li.bbp-topic-reply-count,
1302
+ #bbpress-forums li.bbp-footer div.bbp-reply-author,
1303
+ #bbpress-forums li.bbp-footer div.bbp-reply-content {
1304
+ width: 45%;
1305
+ }
1306
+ #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1307
+ #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1308
+ #bbpress-forums li.bbp-header li.bbp-topic-freshness,
1309
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness,
1310
+ #bbpress-forums li.bbp-header div.bbp-reply-author,
1311
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
1312
+ clear: both;
1313
+ width: 100%;
1314
+ }
1315
+ #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1316
+ #bbpress-forums li.bbp-header li.bbp-topic-freshness {
1317
+ text-align: center;
1318
+ }
1319
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness,
1320
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
1321
+ margin-right: 0;
1322
+ text-align: right;
1323
+ }
1324
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness p.bbp-topic-meta {
1325
+ display: inline-block;
1326
+ }
1327
+ #bbpress-forums li.bbp-header {
1328
+ overflow: hidden;
1329
+ }
1330
+ #bbpress-forums li.bbp-footer div.bbp-reply-content {
1331
+ display: inline-block;
1332
+ margin-right: 0;
1333
+ }
1334
+ #bbpress-forums li.bbp-body div.bbp-reply-author {
1335
+ min-height: 60px;
1336
+ padding-right: 60px;
1337
+ }
1338
+ #bbpress-forums div.bbp-reply-author img.avatar {
1339
+ width: 40px;
1340
+ height: auto;
1341
+ }
1342
+ }
templates/default/css/bbpress-rtl.min.css CHANGED
@@ -1 +1 @@
1
- #bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}body.reply-edit .reply{float:none}#bbpress-forums .type-reply{height:auto;width:100%}#bbpress-forums div.bbp-forum-header,#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{list-style:none;margin:0;padding:0}#bbpress-forums li{margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies,#bbpress-forums ul.bbp-search-results{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 5px 0 0;padding-right:15px;border-right:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}li.bbp-forum-info,li.bbp-topic-title{float:right;text-align:right;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:right;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:right;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:left}#bbpress-forums div.bbp-forum-title h3,#bbpress-forums div.bbp-topic-title h3,#bbpress-forums div.bbp-reply-title h3{line-height:1em;margin:8px 0}#bbpress-forums div.bbp-forum-author,#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:right;text-align:center;width:115px}#bbpress-forums div.bbp-forum-author img.avatar,#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-forum-author a.bbp-author-name,#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word;display:inline-block}#bbpress-forums div.bbp-forum-author .bbp-author-role,#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums li.bbp-header .bbp-search-author,#bbpress-forums li.bbp-footer .bbp-search-author,#bbpress-forums li.bbp-header .bbp-forum-author,#bbpress-forums li.bbp-footer .bbp-forum-author,#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:right;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-search-content,#bbpress-forums li.bbp-footer .bbp-search-content,#bbpress-forums li.bbp-header .bbp-forum-content,#bbpress-forums li.bbp-footer .bbp-forum-content,#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-right:140px;padding:0;text-align:right}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}#bbpress-forums div.bbp-forum-content,#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-right:130px;padding:12px 0 12px 12px;text-align:right}#bbpress-forums div.bbp-topic-content a,#bbpress-forums div.bbp-reply-content a{background:0;border:0;display:inline;font-weight:normal;margin:0;padding:0}#bbpress-forums div.bbp-topic-content h1,#bbpress-forums div.bbp-reply-content h1,#bbpress-forums div.bbp-topic-content h2,#bbpress-forums div.bbp-reply-content h2,#bbpress-forums div.bbp-topic-content h3,#bbpress-forums div.bbp-reply-content h3,#bbpress-forums div.bbp-topic-content h4,#bbpress-forums div.bbp-reply-content h4,#bbpress-forums div.bbp-topic-content h5,#bbpress-forums div.bbp-reply-content h5,#bbpress-forums div.bbp-topic-content h6,#bbpress-forums div.bbp-reply-content h6{clear:none;line-height:1em;margin:24px 0;padding:0}#bbpress-forums div.bbp-topic-content img,#bbpress-forums div.bbp-reply-content img{max-width:100%}#bbpress-forums div.bbp-topic-content ul,#bbpress-forums div.bbp-reply-content ul,#bbpress-forums div.bbp-topic-content ol,#bbpress-forums div.bbp-reply-content ol{margin:0 15px 15px;padding:0}#bbpress-forums div.bbp-topic-content ul li,#bbpress-forums div.bbp-reply-content ul li{list-style-type:disc}#bbpress-forums div.bbp-topic-content ol li,#bbpress-forums div.bbp-reply-content ol li{list-style-type:decimal}#bbpress-forums div.bbp-topic-content ol li li,#bbpress-forums div.bbp-reply-content ol li li{list-style-type:lower-alpha}#bbpress-forums div.bbp-topic-content ol li li li,#bbpress-forums div.bbp-reply-content ol li li li{list-style-type:upper-roman}#bbpress-forums div.bbp-topic-content code,#bbpress-forums div.bbp-reply-content code,#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{font-family:Inconsolata,Consolas,Monaco,Lucida Console,monospace;display:inline;background-color:#f9f9f9;border:1px solid #ddd;padding:2px}#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{display:block;line-height:18px;margin:0 0 24px;padding:5px 10px;white-space:pre;overflow:auto}#bbpress-forums div.bbp-topic-content pre code,#bbpress-forums div.bbp-reply-content pre code{display:block;border:0;padding:0;margin:0;background-color:transparent;overflow-wrap:normal}div.bbp-breadcrumb{float:right}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}#bbpress-forums div.bbp-topic-tags{float:left}#bbp-topic-hot-tags{clear:both}#bbpress-forums #bbp-search-form{clear:right}#bbpress-forums div.bbp-search-form{float:left}span.bbp-admin-links{float:left;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:right}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-forum-header a.bbp-forum-permalink,.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:left;margin-right:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums .bbp-forum-info .bbp-forum-content,#bbpress-forums p.bbp-topic-meta{margin:5px 0 5px;padding:0;font-size:11px}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:right;border:1px solid transparent}.bbp-pagination-links{float:left;list-style:none;display:inline}.bbp-pagination-links a,.bbp-pagination-links span.current{display:block;float:right;padding:0 5px;margin-right:5px;border:1px solid #efefef;text-decoration:none}.bbp-pagination-links a:hover,.bbp-pagination-links span.current{background:#eee;opacity:.8;border:1px solid #ddd}.bbp-pagination-links span.dots{display:block;float:right;padding:1px 4px;margin-right:5px}.bbp-pagination{float:right;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-right:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:right}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:left;clear:none;margin-right:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:right}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-left:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:left;clear:both}p.form-allowed-tags{width:462px}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:0 0 0 2px;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:right;width:100%;clear:right}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:60%;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:5px 8px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:right;width:20%;padding:5px 5px 5px 20px;text-align:left;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:right;width:60%}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 20%;font-size:12px;font-style:italic;float:right;clear:right;width:60%;padding:5px 8px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:60%;display:inline}#bbpress-forums #bbp-your-profile fieldset fieldset.password input,#bbpress-forums #bbp-your-profile fieldset fieldset.password span{width:100%}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-right:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:left}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0!important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0!important;font-size:1.1em}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log{border-top:1px dotted #ddd;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li{list-style-type:none}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:left}.bbp-login-form .bbp-login-links a{float:right;clear:right}.bbp-logged-in img.avatar{float:right;margin:0 0 0 15px}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:left}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-right:2px solid #eaeaea;margin-right:5px;padding-right:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums #bbp-user-wrapper{float:right;width:100%}#bbpress-forums .bbp-user-section{overflow:auto}#bbpress-forums #bbp-user-wrapper h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0;clear:none}#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,#bbpress-forums #bbp-user-wrapper ul.bbp-topics,#bbpress-forums #bbp-user-wrapper ul.bbp-forums,#bbpress-forums #bbp-user-wrapper ul.bbp-replies,#bbpress-forums #bbp-user-wrapper fieldset.bbp-form{clear:none}#bbpress-forums #bbp-single-user-details{margin:0;width:150px;float:right;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-right:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{margin-right:180px}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}
1
+ #bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}body.reply-edit .reply{float:none}#bbpress-forums .type-reply{height:auto;width:100%}#bbpress-forums div.bbp-forum-header,#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{background:0;list-style:none;margin:0;padding:0}#bbpress-forums ul.bbp-threaded-replies{margin-right:50px}#bbpress-forums li{background:0;margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies,#bbpress-forums ul.bbp-search-results{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 5px 0 0;padding-right:15px;border-right:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}li.bbp-forum-info,li.bbp-topic-title{float:right;text-align:right;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:right;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:right;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:left}#bbpress-forums div.bbp-forum-title h3,#bbpress-forums div.bbp-topic-title h3,#bbpress-forums div.bbp-reply-title h3{background:0;border:0;font-size:16px;line-height:1em;margin:8px 0;padding:0;text-transform:none}#bbpress-forums div.bbp-forum-author,#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:right;text-align:center;width:115px}#bbpress-forums div.bbp-forum-author img.avatar,#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-forum-author a.bbp-author-name,#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word;display:inline-block}#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{clear:right;display:block}#bbpress-forums div.bbp-forum-author .bbp-author-role,#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums li.bbp-header .bbp-search-author,#bbpress-forums li.bbp-footer .bbp-search-author,#bbpress-forums li.bbp-header .bbp-forum-author,#bbpress-forums li.bbp-footer .bbp-forum-author,#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:right;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-search-content,#bbpress-forums li.bbp-footer .bbp-search-content,#bbpress-forums li.bbp-header .bbp-forum-content,#bbpress-forums li.bbp-footer .bbp-forum-content,#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-right:140px;padding:0;text-align:right}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}#bbpress-forums div.bbp-forum-content,#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-right:130px;padding:12px 0 12px 12px;text-align:right}#bbpress-forums div.bbp-forum-content:after,#bbpress-forums div.bbp-topic-content:after,#bbpress-forums div.bbp-reply-content:after{clear:both;content:".";display:block;float:none;height:0;font-size:0;visibility:hidden}#bbpress-forums div.bbp-topic-content a,#bbpress-forums div.bbp-reply-content a{background:0;border:0;display:inline;font-weight:normal;margin:0;padding:0}#bbpress-forums div.bbp-topic-content h1,#bbpress-forums div.bbp-reply-content h1,#bbpress-forums div.bbp-topic-content h2,#bbpress-forums div.bbp-reply-content h2,#bbpress-forums div.bbp-topic-content h3,#bbpress-forums div.bbp-reply-content h3,#bbpress-forums div.bbp-topic-content h4,#bbpress-forums div.bbp-reply-content h4,#bbpress-forums div.bbp-topic-content h5,#bbpress-forums div.bbp-reply-content h5,#bbpress-forums div.bbp-topic-content h6,#bbpress-forums div.bbp-reply-content h6{clear:none;line-height:1em;margin:24px 0;padding:0}#bbpress-forums div.bbp-topic-content img,#bbpress-forums div.bbp-reply-content img{max-width:100%}#bbpress-forums div.bbp-topic-content ul,#bbpress-forums div.bbp-reply-content ul,#bbpress-forums div.bbp-topic-content ol,#bbpress-forums div.bbp-reply-content ol{margin:0 15px 15px;padding:0}#bbpress-forums div.bbp-topic-content ul li,#bbpress-forums div.bbp-reply-content ul li{list-style-type:disc}#bbpress-forums div.bbp-topic-content ol li,#bbpress-forums div.bbp-reply-content ol li{list-style-type:decimal}#bbpress-forums div.bbp-topic-content ol li li,#bbpress-forums div.bbp-reply-content ol li li{list-style-type:lower-alpha}#bbpress-forums div.bbp-topic-content ol li li li,#bbpress-forums div.bbp-reply-content ol li li li{list-style-type:upper-roman}#bbpress-forums div.bbp-topic-content code,#bbpress-forums div.bbp-reply-content code,#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{font-family:Inconsolata,Consolas,Monaco,Lucida Console,monospace;display:inline-block;background-color:#f9f9f9;border:1px solid #ddd;padding:0 5px;max-width:95%;vertical-align:middle;margin-top:-3px}#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{display:block;line-height:18px;margin:0 0 24px;padding:5px 10px;white-space:pre;overflow:auto}#bbpress-forums div.bbp-topic-content pre code,#bbpress-forums div.bbp-reply-content pre code{display:block;border:0;padding:0;margin:0;background-color:transparent;overflow-wrap:normal;overflow:scroll;max-width:100%}#bbpress-forums div.bbp-reply-to{margin-right:130px;padding:12px 0 12px 12px;text-align:left}#bbpress-forums div#bbp-cancel-reply-to{text-align:left}div.bbp-breadcrumb{float:right}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}#bbpress-forums div.bbp-topic-tags{float:left}#bbp-topic-hot-tags{clear:both}#bbpress-forums #bbp-search-form{clear:right}#bbpress-forums #bbp-search-form .hidden{height:0;width:0;overflow:hidden;position:absolute;background:0;left:-999em}#bbpress-forums #bbp-search-form #bbp_search{display:inline-block;width:auto}#bbpress-forums div.bbp-search-form{float:left}span.bbp-admin-links{float:left;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:right}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-forum-header a.bbp-forum-permalink,.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:left;margin-right:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums .bbp-forum-info .bbp-forum-content,#bbpress-forums p.bbp-topic-meta{font-size:11px;margin:5px 0 5px;padding:0;word-wrap:break-word}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:right;border:1px solid transparent}.bbp-pagination-links{float:left;list-style:none;display:inline}.bbp-pagination-links a,.bbp-pagination-links span.current{display:block;float:right;padding:0 5px;margin-right:5px;border:1px solid #efefef;text-decoration:none}.bbp-pagination-links a:hover,.bbp-pagination-links span.current{background:#eee;opacity:.8;border:1px solid #ddd}.bbp-pagination-links span.dots{display:block;float:right;padding:1px 4px;margin-right:5px}.bbp-pagination{float:right;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-right:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:right}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:left;clear:none;margin-right:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:right}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-left:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:left;clear:both}p.form-allowed-tags{max-width:100%}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:0 0 0 2px;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:right;width:100%;clear:right}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:60%;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:5px 8px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:right;width:20%;padding:5px 5px 5px 20px;text-align:left;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:right;width:60%}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 20%;font-size:12px;font-style:italic;float:right;clear:right;width:60%;padding:5px 8px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:60%;display:inline}#bbpress-forums #bbp-your-profile fieldset fieldset.password input,#bbpress-forums #bbp-your-profile fieldset fieldset.password span{width:100%}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-right:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:left}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0 !important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0 !important;font-size:1.1em}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log{border-top:1px dotted #ddd;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li{list-style-type:none}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:left}.bbp-login-form .bbp-login-links a{float:right;clear:right}.bbp-logged-in img.avatar{float:right;margin:0 0 0 15px}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:left}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-right:2px solid #eaeaea;margin-right:5px;padding-right:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums #bbp-user-wrapper{float:right;width:100%}#bbpress-forums .bbp-user-section{overflow:auto}#bbpress-forums #bbp-user-wrapper h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0;clear:none}#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,#bbpress-forums #bbp-user-wrapper ul.bbp-topics,#bbpress-forums #bbp-user-wrapper ul.bbp-forums,#bbpress-forums #bbp-user-wrapper ul.bbp-replies,#bbpress-forums #bbp-user-wrapper fieldset.bbp-form{clear:none}#bbpress-forums #bbp-single-user-details{margin:0;width:150px;float:right;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-right:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{margin-right:180px}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}@media screen and (max-device-width:480px),screen and (-webkit-min-device-pixel-ratio:2){-webkit-text-size-adjust:none}@media only screen and (max-width:480px){#bbpress-forums div.bbp-topic-tags{clear:right;float:right}div.bbp-search-form input,div.bbp-search-form button{font-size:11px;padding:2px}li.bbp-forum-info,li.bbp-topic-title{width:45%}li.bbp-forum-topic-count,li.bbp-forum-reply-count,li.bbp-topic-voice-count,li.bbp-topic-reply-count{width:15%}span.bbp-reply-post-date{float:right}span.bbp-admin-links{clear:right;float:right}#bbpress-forums .bbp-forums-list li{display:block;font-size:11px}#bbpress-forums div.bbp-reply-author{margin:-15px 10px 10px;min-height:100px;padding-right:80px;position:relative;text-align:right;width:100%}#bbpress-forums div.bbp-reply-author a.bbp-author-name{clear:none;display:inline-block;margin-right:0;word-wrap:break-word}#bbpress-forums div.bbp-reply-author img.avatar{position:absolute;top:15px;right:0;width:60px;height:auto}#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:12px;font-style:normal}#bbpress-forums .bbp-body div.bbp-reply-content{clear:both;margin:10px;padding:0}#bbpress-forums div.bbp-reply-content p{margin-bottom:1em}div.bbp-submit-wrapper{float:right}#bbpress-forums fieldset.bbp-form{padding:0 10px 10px}#bbpress-forums #bbp-user-body{clear:both;margin-right:0;word-wrap:break-word}}@media only screen and (max-width:320px){#bbpress-forums div.bbp-search-form{margin-bottom:10px}#bbpress-forums li.bbp-header li.bbp-forum-info,#bbpress-forums li.bbp-body li.bbp-forum-info,#bbpress-forums li.bbp-header li.bbp-topic-title,#bbpress-forums li.bbp-body li.bbp-topic-title{width:100%}#bbpress-forums li.bbp-header li.bbp-forum-info,#bbpress-forums li.bbp-header li.bbp-topic-title{text-align:center;text-transform:uppercase}#bbpress-forums li.bbp-header li.bbp-forum-topic-count,#bbpress-forums li.bbp-header li.bbp-forum-reply-count,#bbpress-forums li.bbp-body li.bbp-forum-topic-count,#bbpress-forums li.bbp-body li.bbp-forum-reply-count,#bbpress-forums li.bbp-header li.bbp-topic-voice-count,#bbpress-forums li.bbp-header li.bbp-topic-reply-count,#bbpress-forums li.bbp-body li.bbp-topic-voice-count,#bbpress-forums li.bbp-body li.bbp-topic-reply-count{width:20%}#bbpress-forums li.bbp-header li.bbp-forum-freshness,#bbpress-forums li.bbp-body li.bbp-forum-freshness,#bbpress-forums li.bbp-header li.bbp-topic-freshness,#bbpress-forums li.bbp-body li.bbp-topic-freshness{width:58%}#bbpress-forums li.bbp-body li.bbp-forum-topic-count,#bbpress-forums li.bbp-body li.bbp-forum-reply-count,#bbpress-forums li.bbp-body li.bbp-forum-freshness,#bbpress-forums li.bbp-body li.bbp-topic-voice-count,#bbpress-forums li.bbp-body li.bbp-topic-reply-count,#bbpress-forums li.bbp-body li.bbp-topic-freshness{margin-top:7px}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{font-size:10px}#bbpress-forums li.bbp-header div.bbp-reply-author{text-align:right;width:25%}#bbpress-forums li.bbp-header div.bbp-reply-content{margin-right:25%}#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{width:14px;height:auto}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:1px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar td{width:20px;height:20px}#bbpress-forums div.wp-editor-container{width:100%;overflow:auto}#bbpress-forums input#bbp_topic_title,#bbpress-forums input#bbp_topic_tags{width:95%}}@media only screen and (max-width:240px){#bbpress-forums li.bbp-header li.bbp-forum-topic-count,#bbpress-forums li.bbp-header li.bbp-forum-reply-count,#bbpress-forums li.bbp-body li.bbp-forum-topic-count,#bbpress-forums li.bbp-body li.bbp-forum-reply-count,#bbpress-forums li.bbp-header li.bbp-topic-voice-count,#bbpress-forums li.bbp-header li.bbp-topic-reply-count,#bbpress-forums li.bbp-body li.bbp-topic-voice-count,#bbpress-forums li.bbp-body li.bbp-topic-reply-count,#bbpress-forums li.bbp-footer div.bbp-reply-author,#bbpress-forums li.bbp-footer div.bbp-reply-content{width:45%}#bbpress-forums li.bbp-header li.bbp-forum-freshness,#bbpress-forums li.bbp-body li.bbp-forum-freshness,#bbpress-forums li.bbp-header li.bbp-topic-freshness,#bbpress-forums li.bbp-body li.bbp-topic-freshness,#bbpress-forums li.bbp-header div.bbp-reply-author,#bbpress-forums li.bbp-header div.bbp-reply-content{clear:both;width:100%}#bbpress-forums li.bbp-header li.bbp-forum-freshness,#bbpress-forums li.bbp-header li.bbp-topic-freshness{text-align:center}#bbpress-forums li.bbp-body li.bbp-topic-freshness,#bbpress-forums li.bbp-header div.bbp-reply-content{margin-right:0;text-align:right}#bbpress-forums li.bbp-body li.bbp-topic-freshness p.bbp-topic-meta{display:inline-block}#bbpress-forums li.bbp-header{overflow:hidden}#bbpress-forums li.bbp-footer div.bbp-reply-content{display:inline-block;margin-right:0}#bbpress-forums li.bbp-body div.bbp-reply-author{min-height:60px;padding-right:60px}#bbpress-forums div.bbp-reply-author img.avatar{width:40px;height:auto}}
templates/default/css/bbpress.css CHANGED
@@ -60,12 +60,18 @@ body.reply-edit .reply {
60
  }
61
 
62
  #bbpress-forums ul {
 
63
  list-style: none;
64
  margin: 0;
65
  padding: 0;
66
  }
67
 
 
 
 
 
68
  #bbpress-forums li {
 
69
  margin: 0;
70
  list-style: none;
71
  }
@@ -160,8 +166,13 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
160
  #bbpress-forums div.bbp-forum-title h3,
161
  #bbpress-forums div.bbp-topic-title h3,
162
  #bbpress-forums div.bbp-reply-title h3 {
163
- line-height: 1em;
164
- margin: 8px 0;
 
 
 
 
 
165
  }
166
 
167
  #bbpress-forums div.bbp-forum-author,
@@ -190,6 +201,12 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
190
  display: inline-block;
191
  }
192
 
 
 
 
 
 
 
193
  #bbpress-forums div.bbp-forum-author .bbp-author-role,
194
  #bbpress-forums div.bbp-topic-author .bbp-author-role,
195
  #bbpress-forums div.bbp-reply-author .bbp-author-role {
@@ -258,6 +275,19 @@ span.bbp-author-ip {
258
  text-align: left;
259
  }
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  #bbpress-forums div.bbp-topic-content a,
262
  #bbpress-forums div.bbp-reply-content a {
263
  background: none;
@@ -324,10 +354,13 @@ span.bbp-author-ip {
324
  #bbpress-forums div.bbp-topic-content pre,
325
  #bbpress-forums div.bbp-reply-content pre {
326
  font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
327
- display: inline;
328
  background-color: #f9f9f9;
329
  border: 1px solid #ddd;
330
- padding: 2px;
 
 
 
331
  }
332
 
333
  #bbpress-forums div.bbp-topic-content pre,
@@ -348,6 +381,21 @@ span.bbp-author-ip {
348
  margin: 0;
349
  background-color: transparent;
350
  overflow-wrap: normal;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  }
352
 
353
  /* =Breadcrumb and Tags
@@ -382,11 +430,24 @@ div.bbp-topic-tags {
382
  clear: left;
383
  }
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  #bbpress-forums div.bbp-search-form {
386
  float: right;
387
  }
388
 
389
-
390
  /* =Admin Links
391
  -------------------------------------------------------------- */
392
 
@@ -475,9 +536,10 @@ td.bbp-topic-counts {
475
 
476
  #bbpress-forums .bbp-forum-info .bbp-forum-content,
477
  #bbpress-forums p.bbp-topic-meta {
 
478
  margin: 5px 0 5px;
479
  padding: 0;
480
- font-size: 11px;
481
  }
482
 
483
  #bbpress-forums p.bbp-topic-meta span {
@@ -644,7 +706,7 @@ div.bbp-submit-wrapper {
644
  }
645
 
646
  p.form-allowed-tags {
647
- width: 462px;
648
  }
649
 
650
  /* =TinyMCE in themes
@@ -925,8 +987,7 @@ div.bbp-template-notice a {
925
  #bbpress-forums ul.bbp-topic-revision-log img.avatar,
926
  #bbpress-forums div.bbp-template-notice img.avatar,
927
  #bbpress-forums .widget_display_topics img.avatar,
928
- #bbpress-forums .widget_display_replies img.avatar,
929
- #bbpress-forums p.bbp-topic-meta img.avatar {
930
  float: none;
931
  margin-bottom: -7px;
932
  border: 3px double #ddd;
@@ -1066,3 +1127,216 @@ body.my-account #bbpress-forums {
1066
  #bbpress-forums li:hover > div.row-actions {
1067
  visibility: visible;
1068
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
 
62
  #bbpress-forums ul {
63
+ background: none;
64
  list-style: none;
65
  margin: 0;
66
  padding: 0;
67
  }
68
 
69
+ #bbpress-forums ul.bbp-threaded-replies {
70
+ margin-left: 50px;
71
+ }
72
+
73
  #bbpress-forums li {
74
+ background: none;
75
  margin: 0;
76
  list-style: none;
77
  }
166
  #bbpress-forums div.bbp-forum-title h3,
167
  #bbpress-forums div.bbp-topic-title h3,
168
  #bbpress-forums div.bbp-reply-title h3 {
169
+ background: none;
170
+ border: none;
171
+ font-size: 16px;
172
+ line-height: 1em;
173
+ margin: 8px 0;
174
+ padding: 0;
175
+ text-transform: none;
176
  }
177
 
178
  #bbpress-forums div.bbp-forum-author,
201
  display: inline-block;
202
  }
203
 
204
+ #bbpress-forums div.bbp-topic-author a.bbp-author-name,
205
+ #bbpress-forums div.bbp-reply-author a.bbp-author-name {
206
+ clear: left;
207
+ display: block;
208
+ }
209
+
210
  #bbpress-forums div.bbp-forum-author .bbp-author-role,
211
  #bbpress-forums div.bbp-topic-author .bbp-author-role,
212
  #bbpress-forums div.bbp-reply-author .bbp-author-role {
275
  text-align: left;
276
  }
277
 
278
+ /* Clearing hack */
279
+ #bbpress-forums div.bbp-forum-content:after,
280
+ #bbpress-forums div.bbp-topic-content:after,
281
+ #bbpress-forums div.bbp-reply-content:after {
282
+ clear: both;
283
+ content: ".";
284
+ display: block;
285
+ float: none;
286
+ height: 0;
287
+ font-size: 0;
288
+ visibility: hidden;
289
+ }
290
+
291
  #bbpress-forums div.bbp-topic-content a,
292
  #bbpress-forums div.bbp-reply-content a {
293
  background: none;
354
  #bbpress-forums div.bbp-topic-content pre,
355
  #bbpress-forums div.bbp-reply-content pre {
356
  font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
357
+ display: inline-block;
358
  background-color: #f9f9f9;
359
  border: 1px solid #ddd;
360
+ padding: 0 5px;
361
+ max-width: 95%;
362
+ vertical-align: middle;
363
+ margin-top: -3px;
364
  }
365
 
366
  #bbpress-forums div.bbp-topic-content pre,
381
  margin: 0;
382
  background-color: transparent;
383
  overflow-wrap: normal;
384
+ overflow: auto;
385
+ max-width: 100%;
386
+ }
387
+
388
+ /* =Reply to
389
+ -------------------------------------------------------------- */
390
+
391
+ #bbpress-forums div.bbp-reply-to {
392
+ margin-left: 130px;
393
+ padding: 12px 12px 12px 0;
394
+ text-align: right;
395
+ }
396
+
397
+ #bbpress-forums div#bbp-cancel-reply-to {
398
+ text-align: right;
399
  }
400
 
401
  /* =Breadcrumb and Tags
430
  clear: left;
431
  }
432
 
433
+ #bbpress-forums #bbp-search-form .hidden {
434
+ height: 0;
435
+ width: 0;
436
+ overflow: hidden;
437
+ position: absolute;
438
+ background: none;
439
+ left: -999em;
440
+ }
441
+
442
+ #bbpress-forums #bbp-search-form #bbp_search {
443
+ display: inline-block;
444
+ width: auto;
445
+ }
446
+
447
  #bbpress-forums div.bbp-search-form {
448
  float: right;
449
  }
450
 
 
451
  /* =Admin Links
452
  -------------------------------------------------------------- */
453
 
536
 
537
  #bbpress-forums .bbp-forum-info .bbp-forum-content,
538
  #bbpress-forums p.bbp-topic-meta {
539
+ font-size: 11px;
540
  margin: 5px 0 5px;
541
  padding: 0;
542
+ word-wrap: break-word;
543
  }
544
 
545
  #bbpress-forums p.bbp-topic-meta span {
706
  }
707
 
708
  p.form-allowed-tags {
709
+ max-width: 100%;
710
  }
711
 
712
  /* =TinyMCE in themes
987
  #bbpress-forums ul.bbp-topic-revision-log img.avatar,
988
  #bbpress-forums div.bbp-template-notice img.avatar,
989
  #bbpress-forums .widget_display_topics img.avatar,
990
+ #bbpress-forums .widget_display_replies img.avatar {
 
991
  float: none;
992
  margin-bottom: -7px;
993
  border: 3px double #ddd;
1127
  #bbpress-forums li:hover > div.row-actions {
1128
  visibility: visible;
1129
  }
1130
+
1131
+ /*--------------------------------------------------------------
1132
+ Media Queries
1133
+ --------------------------------------------------------------*/
1134
+
1135
+ /* =Standard Mobile Landscape
1136
+ -------------------------------------------------------------- */
1137
+ @media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
1138
+ -webkit-text-size-adjust: none;
1139
+ }
1140
+ @media only screen and (max-width: 480px) {
1141
+ #bbpress-forums div.bbp-topic-tags {
1142
+ clear: left;
1143
+ float: left;
1144
+ }
1145
+ div.bbp-search-form input,
1146
+ div.bbp-search-form button {
1147
+ font-size: 11px;
1148
+ padding: 2px;
1149
+ }
1150
+ li.bbp-forum-info,
1151
+ li.bbp-topic-title {
1152
+ width: 45%;
1153
+ }
1154
+ li.bbp-forum-topic-count,
1155
+ li.bbp-forum-reply-count,
1156
+ li.bbp-topic-voice-count,
1157
+ li.bbp-topic-reply-count {
1158
+ width: 15%;
1159
+ }
1160
+ span.bbp-reply-post-date {
1161
+ float: left;
1162
+ }
1163
+ span.bbp-admin-links {
1164
+ clear: left;
1165
+ float: left;
1166
+ }
1167
+ #bbpress-forums .bbp-forums-list li {
1168
+ display: block;
1169
+ font-size: 11px;
1170
+ }
1171
+ #bbpress-forums .bbp-body div.bbp-reply-author {
1172
+ margin: -15px 10px 10px;
1173
+ min-height: 100px;
1174
+ padding-left: 80px;
1175
+ position: relative;
1176
+ text-align: left;
1177
+ width: 100%;
1178
+ }
1179
+ #bbpress-forums div.bbp-reply-author a.bbp-author-name {
1180
+ clear: none;
1181
+ display: inline-block;
1182
+ margin-left: 0;
1183
+ word-wrap: break-word;
1184
+ }
1185
+ #bbpress-forums div.bbp-reply-author img.avatar {
1186
+ position: absolute;
1187
+ top: 15px;
1188
+ left: 0;
1189
+ width: 60px;
1190
+ height: auto;
1191
+ }
1192
+ #bbpress-forums div.bbp-reply-author .bbp-author-role {
1193
+ font-size: 12px;
1194
+ font-style: normal;
1195
+ }
1196
+ #bbpress-forums .bbp-body div.bbp-reply-content {
1197
+ clear: both;
1198
+ margin: 10px;
1199
+ padding: 0;
1200
+ }
1201
+ #bbpress-forums div.bbp-reply-content p {
1202
+ margin-bottom: 1em;
1203
+ }
1204
+ div.bbp-submit-wrapper {
1205
+ float: left;
1206
+ }
1207
+ #bbpress-forums fieldset.bbp-form {
1208
+ padding: 0 10px 10px;
1209
+ }
1210
+ #bbpress-forums #bbp-user-body {
1211
+ clear: both;
1212
+ margin-left: 0;
1213
+ word-wrap: break-word;
1214
+ }
1215
+ }
1216
+
1217
+ /* =Standard Mobile Portrait
1218
+ -------------------------------------------------------------- */
1219
+ @media only screen and (max-width: 320px) {
1220
+ #bbpress-forums div.bbp-search-form {
1221
+ margin-bottom: 10px;
1222
+ }
1223
+ #bbpress-forums li.bbp-header li.bbp-forum-info,
1224
+ #bbpress-forums li.bbp-body li.bbp-forum-info,
1225
+ #bbpress-forums li.bbp-header li.bbp-topic-title,
1226
+ #bbpress-forums li.bbp-body li.bbp-topic-title {
1227
+ width: 100%;
1228
+ }
1229
+ #bbpress-forums li.bbp-header li.bbp-forum-info,
1230
+ #bbpress-forums li.bbp-header li.bbp-topic-title {
1231
+ text-align: center;
1232
+ text-transform: uppercase;
1233
+ }
1234
+ #bbpress-forums li.bbp-header li.bbp-forum-topic-count,
1235
+ #bbpress-forums li.bbp-header li.bbp-forum-reply-count,
1236
+ #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1237
+ #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1238
+ #bbpress-forums li.bbp-header li.bbp-topic-voice-count,
1239
+ #bbpress-forums li.bbp-header li.bbp-topic-reply-count,
1240
+ #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1241
+ #bbpress-forums li.bbp-body li.bbp-topic-reply-count {
1242
+ width: 20%;
1243
+ }
1244
+ #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1245
+ #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1246
+ #bbpress-forums li.bbp-header li.bbp-topic-freshness,
1247
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness {
1248
+ width: 58%;
1249
+ }
1250
+ #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1251
+ #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1252
+ #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1253
+ #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1254
+ #bbpress-forums li.bbp-body li.bbp-topic-reply-count,
1255
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness {
1256
+ margin-top: 7px;
1257
+ }
1258
+ #bbpress-forums li.bbp-header,
1259
+ #bbpress-forums li.bbp-footer {
1260
+ font-size: 10px;
1261
+ }
1262
+ #bbpress-forums li.bbp-header div.bbp-reply-author {
1263
+ text-align: left;
1264
+ width: 25%;
1265
+ }
1266
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
1267
+ margin-left: 25%;
1268
+ }
1269
+ #bbpress-forums div.bbp-template-notice img.avatar,
1270
+ #bbpress-forums p.bbp-topic-meta img.avatar {
1271
+ width: 14px;
1272
+ height: auto;
1273
+ }
1274
+ #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar {
1275
+ padding: 1px;
1276
+ }
1277
+ #bbpress-forums div.bbp-the-content-wrapper td.mceToolbar td {
1278
+ width: 20px;
1279
+ height: 20px;
1280
+ }
1281
+ #bbpress-forums div.wp-editor-container {
1282
+ width: 100%;
1283
+ overflow: auto;
1284
+ }
1285
+ #bbpress-forums input#bbp_topic_title,
1286
+ #bbpress-forums input#bbp_topic_tags {
1287
+ width: 95%;
1288
+ }
1289
+ }
1290
+
1291
+ /* =Extra Small Mobile
1292
+ -------------------------------------------------------------- */
1293
+ @media only screen and (max-width: 240px) {
1294
+ #bbpress-forums li.bbp-header li.bbp-forum-topic-count,
1295
+ #bbpress-forums li.bbp-header li.bbp-forum-reply-count,
1296
+ #bbpress-forums li.bbp-body li.bbp-forum-topic-count,
1297
+ #bbpress-forums li.bbp-body li.bbp-forum-reply-count,
1298
+ #bbpress-forums li.bbp-header li.bbp-topic-voice-count,
1299
+ #bbpress-forums li.bbp-header li.bbp-topic-reply-count,
1300
+ #bbpress-forums li.bbp-body li.bbp-topic-voice-count,
1301
+ #bbpress-forums li.bbp-body li.bbp-topic-reply-count,
1302
+ #bbpress-forums li.bbp-footer div.bbp-reply-author,
1303
+ #bbpress-forums li.bbp-footer div.bbp-reply-content {
1304
+ width: 45%;
1305
+ }
1306
+ #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1307
+ #bbpress-forums li.bbp-body li.bbp-forum-freshness,
1308
+ #bbpress-forums li.bbp-header li.bbp-topic-freshness,
1309
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness,
1310
+ #bbpress-forums li.bbp-header div.bbp-reply-author,
1311
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
1312
+ clear: both;
1313
+ width: 100%;
1314
+ }
1315
+ #bbpress-forums li.bbp-header li.bbp-forum-freshness,
1316
+ #bbpress-forums li.bbp-header li.bbp-topic-freshness {
1317
+ text-align: center;
1318
+ }
1319
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness,
1320
+ #bbpress-forums li.bbp-header div.bbp-reply-content {
1321
+ margin-left: 0;
1322
+ text-align: left;
1323
+ }
1324
+ #bbpress-forums li.bbp-body li.bbp-topic-freshness p.bbp-topic-meta {
1325
+ display: inline-block;
1326
+ }
1327
+ #bbpress-forums li.bbp-header {
1328
+ overflow: hidden;
1329
+ }
1330
+ #bbpress-forums li.bbp-footer div.bbp-reply-content {
1331
+ display: inline-block;
1332
+ margin-left: 0;
1333
+ }
1334
+ #bbpress-forums li.bbp-body div.bbp-reply-author {
1335
+ min-height: 60px;
1336
+ padding-left: 60px;
1337
+ }
1338
+ #bbpress-forums div.bbp-reply-author img.avatar {
1339
+ width: 40px;
1340
+ height: auto;
1341
+ }
1342
+ }
templates/default/css/bbpress.min.css CHANGED
@@ -1 +1 @@
1
- #bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}body.reply-edit .reply{float:none}#bbpress-forums div.reply{height:auto;width:100%}#bbpress-forums div.bbp-forum-header,#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{list-style:none;margin:0;padding:0}#bbpress-forums li{margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies,#bbpress-forums ul.bbp-search-results{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 0 0 5px;padding-left:15px;border-left:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}li.bbp-forum-info,li.bbp-topic-title{float:left;text-align:left;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:left;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:left;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:right}#bbpress-forums div.bbp-forum-title h3,#bbpress-forums div.bbp-topic-title h3,#bbpress-forums div.bbp-reply-title h3{line-height:1em;margin:8px 0}#bbpress-forums div.bbp-forum-author,#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:left;text-align:center;width:115px}#bbpress-forums div.bbp-forum-author img.avatar,#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-forum-author a.bbp-author-name,#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word;display:inline-block}#bbpress-forums div.bbp-forum-author .bbp-author-role,#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums li.bbp-header .bbp-search-author,#bbpress-forums li.bbp-footer .bbp-search-author,#bbpress-forums li.bbp-header .bbp-forum-author,#bbpress-forums li.bbp-footer .bbp-forum-author,#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:left;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-search-content,#bbpress-forums li.bbp-footer .bbp-search-content,#bbpress-forums li.bbp-header .bbp-forum-content,#bbpress-forums li.bbp-footer .bbp-forum-content,#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-left:140px;padding:0;text-align:left}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}#bbpress-forums div.bbp-forum-content,#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-left:130px;padding:12px 12px 12px 0;text-align:left}#bbpress-forums div.bbp-topic-content a,#bbpress-forums div.bbp-reply-content a{background:0;border:0;display:inline;font-weight:normal;margin:0;padding:0}#bbpress-forums div.bbp-topic-content h1,#bbpress-forums div.bbp-reply-content h1,#bbpress-forums div.bbp-topic-content h2,#bbpress-forums div.bbp-reply-content h2,#bbpress-forums div.bbp-topic-content h3,#bbpress-forums div.bbp-reply-content h3,#bbpress-forums div.bbp-topic-content h4,#bbpress-forums div.bbp-reply-content h4,#bbpress-forums div.bbp-topic-content h5,#bbpress-forums div.bbp-reply-content h5,#bbpress-forums div.bbp-topic-content h6,#bbpress-forums div.bbp-reply-content h6{clear:none;line-height:1em;margin:24px 0;padding:0}#bbpress-forums div.bbp-topic-content img,#bbpress-forums div.bbp-reply-content img{max-width:100%}#bbpress-forums div.bbp-topic-content ul,#bbpress-forums div.bbp-reply-content ul,#bbpress-forums div.bbp-topic-content ol,#bbpress-forums div.bbp-reply-content ol{margin:0 15px 15px;padding:0}#bbpress-forums div.bbp-topic-content ul li,#bbpress-forums div.bbp-reply-content ul li{list-style-type:disc}#bbpress-forums div.bbp-topic-content ol li,#bbpress-forums div.bbp-reply-content ol li{list-style-type:decimal}#bbpress-forums div.bbp-topic-content ol li li,#bbpress-forums div.bbp-reply-content ol li li{list-style-type:lower-alpha}#bbpress-forums div.bbp-topic-content ol li li li,#bbpress-forums div.bbp-reply-content ol li li li{list-style-type:upper-roman}#bbpress-forums div.bbp-topic-content code,#bbpress-forums div.bbp-reply-content code,#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{font-family:Inconsolata,Consolas,Monaco,Lucida Console,monospace;display:inline;background-color:#f9f9f9;border:1px solid #ddd;padding:2px}#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{display:block;line-height:18px;margin:0 0 24px;padding:5px 10px;white-space:pre;overflow:auto}#bbpress-forums div.bbp-topic-content pre code,#bbpress-forums div.bbp-reply-content pre code{display:block;border:0;padding:0;margin:0;background-color:transparent;overflow-wrap:normal}div.bbp-breadcrumb{float:left}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}#bbpress-forums div.bbp-topic-tags{float:right}#bbp-topic-hot-tags{clear:both}#bbpress-forums #bbp-search-form{clear:left}#bbpress-forums div.bbp-search-form{float:right}span.bbp-admin-links{float:right;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:left}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-forum-header a.bbp-forum-permalink,.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:right;margin-left:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums .bbp-forum-info .bbp-forum-content,#bbpress-forums p.bbp-topic-meta{margin:5px 0 5px;padding:0;font-size:11px}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:left;border:1px solid transparent}.bbp-pagination-links{float:right;list-style:none;display:inline}.bbp-pagination-links a,.bbp-pagination-links span.current{display:block;float:left;padding:0 5px;margin-left:5px;border:1px solid #efefef;text-decoration:none}.bbp-pagination-links a:hover,.bbp-pagination-links span.current{background:#eee;opacity:.8;border:1px solid #ddd}.bbp-pagination-links span.dots{display:block;float:left;padding:1px 4px;margin-left:5px}.bbp-pagination{float:left;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-left:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:left}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:right;clear:none;margin-left:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:left}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-right:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:right;clear:both}p.form-allowed-tags{width:462px}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:0 2px 0 0;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:left;width:100%;clear:left}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:60%;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:5px 8px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:left;width:20%;padding:5px 20px 5px 0;text-align:right;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:left;width:60%}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 20%;font-size:12px;font-style:italic;float:left;clear:left;width:60%;padding:5px 8px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:60%;display:inline}#bbpress-forums #bbp-your-profile fieldset fieldset.password input,#bbpress-forums #bbp-your-profile fieldset fieldset.password span{width:100%}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-left:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:right}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0!important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0!important;font-size:1.1em}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log{border-top:1px dotted #ddd;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li{list-style-type:none}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:right}.bbp-login-form .bbp-login-links a{float:left;clear:left}.bbp-logged-in img.avatar{float:left;margin:0 15px 0 0}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:right}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-left:2px solid #eaeaea;margin-left:5px;padding-left:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums #bbp-user-wrapper{float:left;width:100%}#bbpress-forums .bbp-user-section{overflow:auto}#bbpress-forums #bbp-user-wrapper h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0;clear:none}#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,#bbpress-forums #bbp-user-wrapper ul.bbp-topics,#bbpress-forums #bbp-user-wrapper ul.bbp-forums,#bbpress-forums #bbp-user-wrapper ul.bbp-replies,#bbpress-forums #bbp-user-wrapper fieldset.bbp-form{clear:none}#bbpress-forums #bbp-single-user-details{margin:0;width:150px;float:left;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-left:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{margin-left:180px}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}
1
+ #bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}body.reply-edit .reply{float:none}#bbpress-forums div.reply{height:auto;width:100%}#bbpress-forums div.bbp-forum-header,#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{background:0;list-style:none;margin:0;padding:0}#bbpress-forums ul.bbp-threaded-replies{margin-left:50px}#bbpress-forums li{background:0;margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies,#bbpress-forums ul.bbp-search-results{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 0 0 5px;padding-left:15px;border-left:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}li.bbp-forum-info,li.bbp-topic-title{float:left;text-align:left;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:left;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:left;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:right}#bbpress-forums div.bbp-forum-title h3,#bbpress-forums div.bbp-topic-title h3,#bbpress-forums div.bbp-reply-title h3{background:0;border:0;font-size:16px;line-height:1em;margin:8px 0;padding:0;text-transform:none}#bbpress-forums div.bbp-forum-author,#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:left;text-align:center;width:115px}#bbpress-forums div.bbp-forum-author img.avatar,#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-forum-author a.bbp-author-name,#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word;display:inline-block}#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{clear:left;display:block}#bbpress-forums div.bbp-forum-author .bbp-author-role,#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums li.bbp-header .bbp-search-author,#bbpress-forums li.bbp-footer .bbp-search-author,#bbpress-forums li.bbp-header .bbp-forum-author,#bbpress-forums li.bbp-footer .bbp-forum-author,#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:left;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-search-content,#bbpress-forums li.bbp-footer .bbp-search-content,#bbpress-forums li.bbp-header .bbp-forum-content,#bbpress-forums li.bbp-footer .bbp-forum-content,#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-left:140px;padding:0;text-align:left}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}#bbpress-forums div.bbp-forum-content,#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-left:130px;padding:12px 12px 12px 0;text-align:left}#bbpress-forums div.bbp-forum-content:after,#bbpress-forums div.bbp-topic-content:after,#bbpress-forums div.bbp-reply-content:after{clear:both;content:".";display:block;float:none;height:0;font-size:0;visibility:hidden}#bbpress-forums div.bbp-topic-content a,#bbpress-forums div.bbp-reply-content a{background:0;border:0;display:inline;font-weight:normal;margin:0;padding:0}#bbpress-forums div.bbp-topic-content h1,#bbpress-forums div.bbp-reply-content h1,#bbpress-forums div.bbp-topic-content h2,#bbpress-forums div.bbp-reply-content h2,#bbpress-forums div.bbp-topic-content h3,#bbpress-forums div.bbp-reply-content h3,#bbpress-forums div.bbp-topic-content h4,#bbpress-forums div.bbp-reply-content h4,#bbpress-forums div.bbp-topic-content h5,#bbpress-forums div.bbp-reply-content h5,#bbpress-forums div.bbp-topic-content h6,#bbpress-forums div.bbp-reply-content h6{clear:none;line-height:1em;margin:24px 0;padding:0}#bbpress-forums div.bbp-topic-content img,#bbpress-forums div.bbp-reply-content img{max-width:100%}#bbpress-forums div.bbp-topic-content ul,#bbpress-forums div.bbp-reply-content ul,#bbpress-forums div.bbp-topic-content ol,#bbpress-forums div.bbp-reply-content ol{margin:0 15px 15px;padding:0}#bbpress-forums div.bbp-topic-content ul li,#bbpress-forums div.bbp-reply-content ul li{list-style-type:disc}#bbpress-forums div.bbp-topic-content ol li,#bbpress-forums div.bbp-reply-content ol li{list-style-type:decimal}#bbpress-forums div.bbp-topic-content ol li li,#bbpress-forums div.bbp-reply-content ol li li{list-style-type:lower-alpha}#bbpress-forums div.bbp-topic-content ol li li li,#bbpress-forums div.bbp-reply-content ol li li li{list-style-type:upper-roman}#bbpress-forums div.bbp-topic-content code,#bbpress-forums div.bbp-reply-content code,#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{font-family:Inconsolata,Consolas,Monaco,Lucida Console,monospace;display:inline-block;background-color:#f9f9f9;border:1px solid #ddd;padding:0 5px;max-width:95%;vertical-align:middle;margin-top:-3px}#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{display:block;line-height:18px;margin:0 0 24px;padding:5px 10px;white-space:pre;overflow:auto}#bbpress-forums div.bbp-topic-content pre code,#bbpress-forums div.bbp-reply-content pre code{display:block;border:0;padding:0;margin:0;background-color:transparent;overflow-wrap:normal;overflow:auto;max-width:100%}#bbpress-forums div.bbp-reply-to{margin-left:130px;padding:12px 12px 12px 0;text-align:right}#bbpress-forums div#bbp-cancel-reply-to{text-align:right}div.bbp-breadcrumb{float:left}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}#bbpress-forums div.bbp-topic-tags{float:right}#bbp-topic-hot-tags{clear:both}#bbpress-forums #bbp-search-form{clear:left}#bbpress-forums #bbp-search-form .hidden{height:0;width:0;overflow:hidden;position:absolute;background:0;left:-999em}#bbpress-forums #bbp-search-form #bbp_search{display:inline-block;width:auto}#bbpress-forums div.bbp-search-form{float:right}span.bbp-admin-links{float:right;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:left}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-forum-header a.bbp-forum-permalink,.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:right;margin-left:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums .bbp-forum-info .bbp-forum-content,#bbpress-forums p.bbp-topic-meta{font-size:11px;margin:5px 0 5px;padding:0;word-wrap:break-word}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:left;border:1px solid transparent}.bbp-pagination-links{float:right;list-style:none;display:inline}.bbp-pagination-links a,.bbp-pagination-links span.current{display:block;float:left;padding:0 5px;margin-left:5px;border:1px solid #efefef;text-decoration:none}.bbp-pagination-links a:hover,.bbp-pagination-links span.current{background:#eee;opacity:.8;border:1px solid #ddd}.bbp-pagination-links span.dots{display:block;float:left;padding:1px 4px;margin-left:5px}.bbp-pagination{float:left;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-left:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:left}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:right;clear:none;margin-left:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:left}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-right:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:right;clear:both}p.form-allowed-tags{max-width:100%}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:0 2px 0 0;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:left;width:100%;clear:left}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:60%;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:5px 8px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:left;width:20%;padding:5px 20px 5px 0;text-align:right;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:left;width:60%}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 20%;font-size:12px;font-style:italic;float:left;clear:left;width:60%;padding:5px 8px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:60%;display:inline}#bbpress-forums #bbp-your-profile fieldset fieldset.password input,#bbpress-forums #bbp-your-profile fieldset fieldset.password span{width:100%}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-left:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:right}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0 !important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0 !important;font-size:1.1em}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log{border-top:1px dotted #ddd;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li{list-style-type:none}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:right}.bbp-login-form .bbp-login-links a{float:left;clear:left}.bbp-logged-in img.avatar{float:left;margin:0 15px 0 0}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:right}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-left:2px solid #eaeaea;margin-left:5px;padding-left:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums #bbp-user-wrapper{float:left;width:100%}#bbpress-forums .bbp-user-section{overflow:auto}#bbpress-forums #bbp-user-wrapper h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0;clear:none}#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,#bbpress-forums #bbp-user-wrapper ul.bbp-topics,#bbpress-forums #bbp-user-wrapper ul.bbp-forums,#bbpress-forums #bbp-user-wrapper ul.bbp-replies,#bbpress-forums #bbp-user-wrapper fieldset.bbp-form{clear:none}#bbpress-forums #bbp-single-user-details{margin:0;width:150px;float:left;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-left:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{margin-left:180px}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}@media screen and (max-device-width:480px),screen and (-webkit-min-device-pixel-ratio:2){-webkit-text-size-adjust:none}@media only screen and (max-width:480px){#bbpress-forums div.bbp-topic-tags{clear:left;float:left}div.bbp-search-form input,div.bbp-search-form button{font-size:11px;padding:2px}li.bbp-forum-info,li.bbp-topic-title{width:45%}li.bbp-forum-topic-count,li.bbp-forum-reply-count,li.bbp-topic-voice-count,li.bbp-topic-reply-count{width:15%}span.bbp-reply-post-date{float:left}span.bbp-admin-links{clear:left;float:left}#bbpress-forums .bbp-forums-list li{display:block;font-size:11px}#bbpress-forums .bbp-body div.bbp-reply-author{margin:-15px 10px 10px;min-height:100px;padding-left:80px;position:relative;text-align:left;width:100%}#bbpress-forums div.bbp-reply-author a.bbp-author-name{clear:none;display:inline-block;margin-left:0;word-wrap:break-word}#bbpress-forums div.bbp-reply-author img.avatar{position:absolute;top:15px;left:0;width:60px;height:auto}#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:12px;font-style:normal}#bbpress-forums .bbp-body div.bbp-reply-content{clear:both;margin:10px;padding:0}#bbpress-forums div.bbp-reply-content p{margin-bottom:1em}div.bbp-submit-wrapper{float:left}#bbpress-forums fieldset.bbp-form{padding:0 10px 10px}#bbpress-forums #bbp-user-body{clear:both;margin-left:0;word-wrap:break-word}}@media only screen and (max-width:320px){#bbpress-forums div.bbp-search-form{margin-bottom:10px}#bbpress-forums li.bbp-header li.bbp-forum-info,#bbpress-forums li.bbp-body li.bbp-forum-info,#bbpress-forums li.bbp-header li.bbp-topic-title,#bbpress-forums li.bbp-body li.bbp-topic-title{width:100%}#bbpress-forums li.bbp-header li.bbp-forum-info,#bbpress-forums li.bbp-header li.bbp-topic-title{text-align:center;text-transform:uppercase}#bbpress-forums li.bbp-header li.bbp-forum-topic-count,#bbpress-forums li.bbp-header li.bbp-forum-reply-count,#bbpress-forums li.bbp-body li.bbp-forum-topic-count,#bbpress-forums li.bbp-body li.bbp-forum-reply-count,#bbpress-forums li.bbp-header li.bbp-topic-voice-count,#bbpress-forums li.bbp-header li.bbp-topic-reply-count,#bbpress-forums li.bbp-body li.bbp-topic-voice-count,#bbpress-forums li.bbp-body li.bbp-topic-reply-count{width:20%}#bbpress-forums li.bbp-header li.bbp-forum-freshness,#bbpress-forums li.bbp-body li.bbp-forum-freshness,#bbpress-forums li.bbp-header li.bbp-topic-freshness,#bbpress-forums li.bbp-body li.bbp-topic-freshness{width:58%}#bbpress-forums li.bbp-body li.bbp-forum-topic-count,#bbpress-forums li.bbp-body li.bbp-forum-reply-count,#bbpress-forums li.bbp-body li.bbp-forum-freshness,#bbpress-forums li.bbp-body li.bbp-topic-voice-count,#bbpress-forums li.bbp-body li.bbp-topic-reply-count,#bbpress-forums li.bbp-body li.bbp-topic-freshness{margin-top:7px}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{font-size:10px}#bbpress-forums li.bbp-header div.bbp-reply-author{text-align:left;width:25%}#bbpress-forums li.bbp-header div.bbp-reply-content{margin-left:25%}#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{width:14px;height:auto}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:1px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar td{width:20px;height:20px}#bbpress-forums div.wp-editor-container{width:100%;overflow:auto}#bbpress-forums input#bbp_topic_title,#bbpress-forums input#bbp_topic_tags{width:95%}}@media only screen and (max-width:240px){#bbpress-forums li.bbp-header li.bbp-forum-topic-count,#bbpress-forums li.bbp-header li.bbp-forum-reply-count,#bbpress-forums li.bbp-body li.bbp-forum-topic-count,#bbpress-forums li.bbp-body li.bbp-forum-reply-count,#bbpress-forums li.bbp-header li.bbp-topic-voice-count,#bbpress-forums li.bbp-header li.bbp-topic-reply-count,#bbpress-forums li.bbp-body li.bbp-topic-voice-count,#bbpress-forums li.bbp-body li.bbp-topic-reply-count,#bbpress-forums li.bbp-footer div.bbp-reply-author,#bbpress-forums li.bbp-footer div.bbp-reply-content{width:45%}#bbpress-forums li.bbp-header li.bbp-forum-freshness,#bbpress-forums li.bbp-body li.bbp-forum-freshness,#bbpress-forums li.bbp-header li.bbp-topic-freshness,#bbpress-forums li.bbp-body li.bbp-topic-freshness,#bbpress-forums li.bbp-header div.bbp-reply-author,#bbpress-forums li.bbp-header div.bbp-reply-content{clear:both;width:100%}#bbpress-forums li.bbp-header li.bbp-forum-freshness,#bbpress-forums li.bbp-header li.bbp-topic-freshness{text-align:center}#bbpress-forums li.bbp-body li.bbp-topic-freshness,#bbpress-forums li.bbp-header div.bbp-reply-content{margin-left:0;text-align:left}#bbpress-forums li.bbp-body li.bbp-topic-freshness p.bbp-topic-meta{display:inline-block}#bbpress-forums li.bbp-header{overflow:hidden}#bbpress-forums li.bbp-footer div.bbp-reply-content{display:inline-block;margin-left:0}#bbpress-forums li.bbp-body div.bbp-reply-author{min-height:60px;padding-left:60px}#bbpress-forums div.bbp-reply-author img.avatar{width:40px;height:auto}}
templates/default/js/reply.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ addReply = {
2
+ moveForm : function(replyId, parentId, respondId, postId) {
3
+ var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id');
4
+
5
+ if ( ! reply || ! respond || ! cancel || ! parent )
6
+ return;
7
+
8
+ t.respondId = respondId;
9
+ postId = postId || false;
10
+
11
+ if ( ! t.I('bbp-temp-form-div') ) {
12
+ div = document.createElement('div');
13
+ div.id = 'bbp-temp-form-div';
14
+ div.style.display = 'none';
15
+ respond.parentNode.insertBefore(div, respond);
16
+ }
17
+
18
+ reply.parentNode.insertBefore(respond);
19
+ if ( post && postId )
20
+ post.value = postId;
21
+ parent.value = parentId;
22
+ cancel.style.display = '';
23
+
24
+ cancel.onclick = function() {
25
+ var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId);
26
+
27
+ if ( ! temp || ! respond )
28
+ return;
29
+
30
+ t.I('bbp_reply_to').value = '0';
31
+ temp.parentNode.insertBefore(respond, temp);
32
+ temp.parentNode.removeChild(temp);
33
+ this.style.display = 'none';
34
+ this.onclick = null;
35
+ return false;
36
+ }
37
+
38
+ try { t.I('bbp_reply_content').focus(); }
39
+ catch(e) {}
40
+
41
+ return false;
42
+ },
43
+
44
+ I : function(e) {
45
+ return document.getElementById(e);
46
+ }
47
+ }