bbPress - Version 2.0-rc-3

Version Description

  • Fixed activation/deactivation
  • Added Forum Participant role for multisite use
Download this release

Release Info

Developer johnjamesjacoby
Plugin Icon 128x128 bbPress
Version 2.0-rc-3
Comparing to
See all releases

Code changes from version 2.0-rc-2 to 2.0-rc-3

bbp-admin/bbp-admin.php CHANGED
@@ -186,6 +186,10 @@ class BBP_Admin {
186
  add_settings_field( '_bbp_throttle_time', __( 'Throttle time', 'bbpress' ), 'bbp_admin_setting_callback_throttle', 'bbpress', 'bbp_main' );
187
  register_setting ( 'bbpress', '_bbp_throttle_time', 'intval' );
188
 
 
 
 
 
189
  // Allow favorites setting
190
  add_settings_field( '_bbp_enable_favorites', __( 'Allow Favorites', 'bbpress' ), 'bbp_admin_setting_callback_favorites', 'bbpress', 'bbp_main' );
191
  register_setting ( 'bbpress', '_bbp_enable_favorites', 'intval' );
186
  add_settings_field( '_bbp_throttle_time', __( 'Throttle time', 'bbpress' ), 'bbp_admin_setting_callback_throttle', 'bbpress', 'bbp_main' );
187
  register_setting ( 'bbpress', '_bbp_throttle_time', 'intval' );
188
 
189
+ // Allow topic and reply revisions
190
+ add_settings_field( '_bbp_allow_revisions', __( 'Allow Revisions', 'bbpress' ), 'bbp_admin_setting_callback_revisions', 'bbpress', 'bbp_main' );
191
+ register_setting ( 'bbpress', '_bbp_allow_revisions', 'intval' );
192
+
193
  // Allow favorites setting
194
  add_settings_field( '_bbp_enable_favorites', __( 'Allow Favorites', 'bbpress' ), 'bbp_admin_setting_callback_favorites', 'bbpress', 'bbp_main' );
195
  register_setting ( 'bbpress', '_bbp_enable_favorites', 'intval' );
bbp-admin/bbp-functions.php CHANGED
@@ -20,9 +20,14 @@ if ( !defined( 'ABSPATH' ) ) exit;
20
  function bbp_admin_separator () {
21
  global $menu;
22
 
 
23
  if ( !current_user_can( 'edit_replies' ) )
24
  return;
25
 
 
 
 
 
26
  $menu[] = array( '', 'read', 'separator-bbpress', '', 'wp-menu-separator bbpress' );
27
  }
28
 
20
  function bbp_admin_separator () {
21
  global $menu;
22
 
23
+ // Prevent duplicate separators when no new menu items exist
24
  if ( !current_user_can( 'edit_replies' ) )
25
  return;
26
 
27
+ // Prevent duplicate separators when no core menu items exist
28
+ if ( !current_user_can( 'edit_posts' ) )
29
+ return;
30
+
31
  $menu[] = array( '', 'read', 'separator-bbpress', '', 'wp-menu-separator bbpress' );
32
  }
33
 
bbp-admin/bbp-settings.php CHANGED
@@ -89,6 +89,22 @@ function bbp_admin_setting_callback_subscriptions() {
89
  <?php
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  /**
93
  * Allow anonymous posting setting field
94
  *
@@ -275,10 +291,7 @@ function bbp_admin_setting_callback_topic_archive_slug() {
275
  * @since bbPress (r2786)
276
  */
277
  function bbp_admin_setting_callback_single_slug_section() {
278
-
279
- // Flush rewrite rules when this section is saved
280
- if ( isset( $_GET['settings-updated'] ) && isset( $_GET['page'] ) )
281
- flush_rewrite_rules(); ?>
282
 
283
  <p><?php printf( __( 'You can enter custom slugs for your single forums, topics, replies, and tags URLs here. If you change these, existing permalinks will also change.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
284
 
89
  <?php
90
  }
91
 
92
+ /**
93
+ * Allow topic and reply revisions
94
+ *
95
+ * @since bbPress (r3412)
96
+ *
97
+ * @uses checked() To display the checked attribute
98
+ */
99
+ function bbp_admin_setting_callback_revisions() {
100
+ ?>
101
+
102
+ <input id="_bbp_allow_revisions" name="_bbp_allow_revisions" type="checkbox" id="_bbp_allow_revisions" value="1" <?php checked( bbp_allow_revisions( true ) ); ?> />
103
+ <label for="_bbp_allow_revisions"><?php _e( 'Allow topic and reply revision logging', 'bbpress' ); ?></label>
104
+
105
+ <?php
106
+ }
107
+
108
  /**
109
  * Allow anonymous posting setting field
110
  *
291
  * @since bbPress (r2786)
292
  */
293
  function bbp_admin_setting_callback_single_slug_section() {
294
+ ?>
 
 
 
295
 
296
  <p><?php printf( __( 'You can enter custom slugs for your single forums, topics, replies, and tags URLs here. If you change these, existing permalinks will also change.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
297
 
bbp-includes/bbp-common-template.php CHANGED
@@ -41,18 +41,17 @@ function bbp_footer() {
41
  *
42
  * @since bbPress (r3398)
43
  *
44
- * @global WPDB $wpdb
45
  * @param int $site_id
 
 
 
46
  * @return bool True if site is public, false if private
47
  */
48
  function bbp_is_site_public( $site_id = 0 ) {
49
 
50
  // Get the current site ID
51
- if ( empty( $site_id ) ) {
52
- global $wpdb;
53
-
54
- $site_id = (int) $wpdb->blogid;
55
- }
56
 
57
  // Get the site visibility setting
58
  $public = get_blog_option( $site_id, 'blog_public', 1 );
@@ -440,7 +439,7 @@ function bbp_is_user_home() {
440
  if ( empty( $bbp->displayed_user ) )
441
  return false;
442
 
443
- return (bool) ( (int) $bbp->current_user->ID == (int) $bbp->displayed_user->ID );
444
  }
445
 
446
  /**
@@ -1664,7 +1663,7 @@ function bbp_template_notices() {
1664
  global $bbp;
1665
 
1666
  // Bail if no notices or errors
1667
- if ( !isset( $bbp->errors ) || !bbp_has_errors() )
1668
  return;
1669
 
1670
  // Define local variable(s)
41
  *
42
  * @since bbPress (r3398)
43
  *
 
44
  * @param int $site_id
45
+ * @uses get_current_blog_id()
46
+ * @uses get_blog_option()
47
+ * @uses apply_filters()
48
  * @return bool True if site is public, false if private
49
  */
50
  function bbp_is_site_public( $site_id = 0 ) {
51
 
52
  // Get the current site ID
53
+ if ( empty( $site_id ) )
54
+ $site_id = get_current_blog_id();
 
 
 
55
 
56
  // Get the site visibility setting
57
  $public = get_blog_option( $site_id, 'blog_public', 1 );
439
  if ( empty( $bbp->displayed_user ) )
440
  return false;
441
 
442
+ return (bool) ( bbp_get_current_user_id() == bbp_get_current_user_id() );
443
  }
444
 
445
  /**
1663
  global $bbp;
1664
 
1665
  // Bail if no notices or errors
1666
+ if ( !bbp_has_errors() )
1667
  return;
1668
 
1669
  // Define local variable(s)
bbp-includes/bbp-core-caps.php CHANGED
@@ -24,11 +24,23 @@ if ( !defined( 'ABSPATH' ) ) exit;
24
  */
25
  function bbp_add_roles() {
26
 
27
- // Add the Moderator role and add the default role caps. Mod caps are added by the bbp_add_caps () function
 
 
 
 
 
28
  $default = get_role( get_option( 'default_role' ) );
29
 
 
 
 
 
30
  // Moderators are default role + forum moderating caps in bbp_add_caps()
31
- add_role( 'bbp_moderator', __( 'Forum Moderator', 'bbpress' ), $default->capabilities );
 
 
 
32
 
33
  do_action( 'bbp_add_roles' );
34
  }
@@ -103,8 +115,15 @@ function bbp_remove_caps() {
103
  */
104
  function bbp_remove_roles() {
105
 
 
 
 
 
106
  // Remove the Moderator role
107
- remove_role( 'bbp_moderator' );
 
 
 
108
 
109
  do_action( 'bbp_remove_roles' );
110
  }
@@ -320,6 +339,10 @@ function bbp_get_topic_tag_caps () {
320
  */
321
  function bbp_get_caps_for_role( $role = '' ) {
322
 
 
 
 
 
323
  // Which role are we looking for?
324
  switch ( $role ) {
325
 
@@ -368,7 +391,7 @@ function bbp_get_caps_for_role( $role = '' ) {
368
  break;
369
 
370
  // Moderator
371
- case 'bbp_moderator' :
372
 
373
  $caps = array(
374
 
@@ -406,12 +429,15 @@ function bbp_get_caps_for_role( $role = '' ) {
406
 
407
  break;
408
 
409
- // Other specific roles
410
- case 'editor' :
411
- case 'author' :
412
- case 'contributor' :
413
- case 'subscriber' :
414
- default :
 
 
 
415
 
416
  $caps = array(
417
 
@@ -434,6 +460,89 @@ function bbp_get_caps_for_role( $role = '' ) {
434
  return apply_filters( 'bbp_get_caps_for_role', $caps, $role );
435
  }
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  /**
438
  * Add the default role and mapped bbPress caps to the current user if needed
439
  *
@@ -465,11 +574,10 @@ function bbp_global_access_role_mask() {
465
  return;
466
 
467
  // Normal user is logged in but has no caps
468
- if ( is_user_logged_in() && current_user_can( 'exist' ) && !current_user_can( 'read' ) ) {
469
- global $bbp;
470
 
471
- // Get default role for this site
472
- $default_role = get_option( 'default_role' );
473
 
474
  // Get bbPress caps for the default role
475
  $caps_for_role = bbp_get_caps_for_role( $default_role );
@@ -480,12 +588,14 @@ function bbp_global_access_role_mask() {
480
  }
481
 
482
  // Add 'read' cap just in case
483
- $mapped_meta_caps['read'] = true;
 
484
 
485
  // Allow global access caps to be manipulated
486
  $mapped_meta_caps = apply_filters( 'bbp_global_access_mapped_meta_caps', $mapped_meta_caps );
487
 
488
  // Assign the role and mapped caps to the current user
 
489
  $bbp->current_user->roles[0] = $default_role;
490
  $bbp->current_user->caps = $mapped_meta_caps;
491
  $bbp->current_user->allcaps = $mapped_meta_caps;
24
  */
25
  function bbp_add_roles() {
26
 
27
+ // Get new role names
28
+ $moderator_role = bbp_get_moderator_role();
29
+ $participant_role = bbp_get_participant_role();
30
+
31
+ // Add the Moderator role and add the default role caps.
32
+ // Mod caps are added by the bbp_add_caps() function
33
  $default = get_role( get_option( 'default_role' ) );
34
 
35
+ // If role does not exist, default to read cap
36
+ if ( empty( $default->capabilities ) )
37
+ $default->capabilities = array( 'read' );
38
+
39
  // Moderators are default role + forum moderating caps in bbp_add_caps()
40
+ add_role( $moderator_role, 'Forum Moderator', $default->capabilities );
41
+
42
+ // Forum Subscribers are auto added to sites with global forums
43
+ add_role( $participant_role, 'Forum Participant', $default->capabilities );
44
 
45
  do_action( 'bbp_add_roles' );
46
  }
115
  */
116
  function bbp_remove_roles() {
117
 
118
+ // Get new role names
119
+ $moderator_role = bbp_get_moderator_role();
120
+ $participant_role = bbp_get_participant_role();
121
+
122
  // Remove the Moderator role
123
+ remove_role( $moderator_role );
124
+
125
+ // Remove the Moderator role
126
+ remove_role( $participant_role );
127
 
128
  do_action( 'bbp_remove_roles' );
129
  }
339
  */
340
  function bbp_get_caps_for_role( $role = '' ) {
341
 
342
+ // Get new role names
343
+ $moderator_role = bbp_get_moderator_role();
344
+ $participant_role = bbp_get_participant_role();
345
+
346
  // Which role are we looking for?
347
  switch ( $role ) {
348
 
391
  break;
392
 
393
  // Moderator
394
+ case $moderator_role :
395
 
396
  $caps = array(
397
 
429
 
430
  break;
431
 
432
+ // WordPress Core Roles
433
+ case 'editor' :
434
+ case 'author' :
435
+ case 'contributor' :
436
+ case 'subscriber' :
437
+
438
+ // bbPress Participant Role
439
+ case $participant_role :
440
+ default :
441
 
442
  $caps = array(
443
 
460
  return apply_filters( 'bbp_get_caps_for_role', $caps, $role );
461
  }
462
 
463
+ /**
464
+ * Give a user the default 'Forum Participant' role when creating a topic/reply
465
+ * on a site they do not have a role or capability on.
466
+ *
467
+ * @since bbPress (r3410)
468
+ *
469
+ * @global bbPress $bbp
470
+ *
471
+ * @uses is_multisite()
472
+ * @uses bbp_allow_global_access()
473
+ * @uses bbp_is_user_deleted()
474
+ * @uses bbp_is_user_spammer()
475
+ * @uses is_user_logged_in()
476
+ * @uses current_user_can()
477
+ * @uses WP_User::set_role()
478
+ *
479
+ * @return If user is not spam/deleted or is already capable
480
+ */
481
+ function bbp_global_access_auto_role() {
482
+
483
+ // Bail if not multisite or forum is not global
484
+ if ( !is_multisite() || !bbp_allow_global_access() )
485
+ return;
486
+
487
+ // Bail if user is marked as spam or is deleted
488
+ if ( bbp_is_user_deleted() || bbp_is_user_spammer() )
489
+ return;
490
+
491
+ // Bail if user is not logged in
492
+ if ( !is_user_logged_in() )
493
+ return;
494
+
495
+ // Give the user the 'Forum Participant' role
496
+ if ( current_user_can( 'bbp_masked' ) ) {
497
+ global $bbp;
498
+
499
+ // Get the default role
500
+ $default_role = bbp_get_participant_role();
501
+
502
+ // Set the current users default role
503
+ $bbp->current_user->set_role( $default_role );
504
+ }
505
+ }
506
+
507
+ /**
508
+ * The participant role for registered users without roles
509
+ *
510
+ * This is primarily for multisite compatibility when users without roles on
511
+ * sites that have global forums enabled want to create topics and replies
512
+ *
513
+ * @since bbPress (r3410)
514
+ *
515
+ * @param string $role
516
+ * @uses apply_filters()
517
+ * @return string
518
+ */
519
+ function bbp_get_participant_role() {
520
+
521
+ // Hardcoded participant role
522
+ $role = 'bbp_participant';
523
+
524
+ // Allow override
525
+ return apply_filters( 'bbp_get_participant_role', $role );
526
+ }
527
+
528
+ /**
529
+ * The moderator role for bbPress users
530
+ *
531
+ * @since bbPress (r3410)
532
+ *
533
+ * @param string $role
534
+ * @uses apply_filters()
535
+ * @return string
536
+ */
537
+ function bbp_get_moderator_role() {
538
+
539
+ // Hardcoded moderated user role
540
+ $role = 'bbp_moderator';
541
+
542
+ // Allow override
543
+ return apply_filters( 'bbp_get_moderator_role', $role );
544
+ }
545
+
546
  /**
547
  * Add the default role and mapped bbPress caps to the current user if needed
548
  *
574
  return;
575
 
576
  // Normal user is logged in but has no caps
577
+ if ( is_user_logged_in() && !current_user_can( 'read' ) ) {
 
578
 
579
+ // Assign user the minimal participant role to map caps to
580
+ $default_role = bbp_get_participant_role();
581
 
582
  // Get bbPress caps for the default role
583
  $caps_for_role = bbp_get_caps_for_role( $default_role );
588
  }
589
 
590
  // Add 'read' cap just in case
591
+ $mapped_meta_caps['read'] = true;
592
+ $mapped_meta_caps['bbp_masked'] = true;
593
 
594
  // Allow global access caps to be manipulated
595
  $mapped_meta_caps = apply_filters( 'bbp_global_access_mapped_meta_caps', $mapped_meta_caps );
596
 
597
  // Assign the role and mapped caps to the current user
598
+ global $bbp;
599
  $bbp->current_user->roles[0] = $default_role;
600
  $bbp->current_user->caps = $mapped_meta_caps;
601
  $bbp->current_user->allcaps = $mapped_meta_caps;
bbp-includes/bbp-core-compatibility.php CHANGED
@@ -53,27 +53,28 @@ function bbp_setup_theme_compat( $theme = array() ) {
53
  *
54
  * @since bbPress (r3029)
55
  *
56
- * @global bbPress $bbp
57
  * @uses bbp_set_compat_theme_dir() Set the compatable theme to bbp-twentyten
58
  * @uses current_theme_supports() Check bbPress theme support
59
  * @uses wp_enqueue_style() Enqueue the bbp-twentyten default CSS
60
  * @uses wp_enqueue_script() Enqueue the bbp-twentyten default topic JS
61
  */
62
  function bbp_theme_compat_enqueue_css() {
63
- global $bbp;
64
 
65
  // Check if current theme supports bbPress
66
  if ( !current_theme_supports( 'bbpress' ) ) {
67
 
68
  /** Default CSS ***************************************************/
69
 
 
 
 
70
  // Right to left
71
  if ( is_rtl() ) {
72
- wp_enqueue_style( 'bbpress-style', bbp_get_theme_compat_url() . '/css/bbpress-rtl.css' );
73
 
74
  // Left to right
75
  } else {
76
- wp_enqueue_style( 'bbpress-style', bbp_get_theme_compat_url() . '/css/bbpress.css' );
77
  }
78
  }
79
  }
53
  *
54
  * @since bbPress (r3029)
55
  *
 
56
  * @uses bbp_set_compat_theme_dir() Set the compatable theme to bbp-twentyten
57
  * @uses current_theme_supports() Check bbPress theme support
58
  * @uses wp_enqueue_style() Enqueue the bbp-twentyten default CSS
59
  * @uses wp_enqueue_script() Enqueue the bbp-twentyten default topic JS
60
  */
61
  function bbp_theme_compat_enqueue_css() {
 
62
 
63
  // Check if current theme supports bbPress
64
  if ( !current_theme_supports( 'bbpress' ) ) {
65
 
66
  /** Default CSS ***************************************************/
67
 
68
+ // Version of CSS
69
+ $version = '20110808b';
70
+
71
  // Right to left
72
  if ( is_rtl() ) {
73
+ wp_enqueue_style( 'bbpress-style', bbp_get_theme_compat_url() . '/css/bbpress-rtl.css', '', $version, 'screen' );
74
 
75
  // Left to right
76
  } else {
77
+ wp_enqueue_style( 'bbpress-style', bbp_get_theme_compat_url() . '/css/bbpress.css', '', $version, 'screen' );
78
  }
79
  }
80
  }
bbp-includes/bbp-core-hooks.php CHANGED
@@ -60,15 +60,16 @@ add_action( 'bbp_loaded', 'bbp_register_theme_directory', 10 );
60
  */
61
  add_action( 'bbp_init', 'bbp_load_textdomain', 2 );
62
  add_action( 'bbp_init', 'bbp_setup_current_user', 4 );
63
- add_action( 'bbp_init', 'bbp_setup_theme_compat', 6 );
64
- add_action( 'bbp_init', 'bbp_setup_akismet', 8 );
65
- add_action( 'bbp_init', 'bbp_setup_buddypress', 10 );
66
- add_action( 'bbp_init', 'bbp_register_post_types', 12 );
67
- add_action( 'bbp_init', 'bbp_register_post_statuses', 14 );
68
- add_action( 'bbp_init', 'bbp_register_taxonomies', 16 );
69
- add_action( 'bbp_init', 'bbp_register_views', 18 );
70
- add_action( 'bbp_init', 'bbp_register_shortcodes', 20 );
71
- add_action( 'bbp_init', 'bbp_add_rewrite_tags', 22 );
 
72
  add_action( 'bbp_init', 'bbp_ready', 999 );
73
 
74
  // Multisite Global Forum Access
@@ -203,6 +204,18 @@ add_action( 'bbp_deleted_reply', 'bbp_update_reply_walker' );
203
  add_action( 'bbp_spammed_reply', 'bbp_update_reply_walker' );
204
  add_action( 'bbp_unspammed_reply', 'bbp_update_reply_walker' );
205
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  /**
207
  * When a new site is created in a multisite installation, run the activation
208
  * routine on that site
@@ -403,6 +416,57 @@ if ( is_admin() ) {
403
  add_filter( 'bbp_get_topic_content', 'wp_kses_data' );
404
  }
405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  /** Main Actions **************************************************************/
407
 
408
  /**
60
  */
61
  add_action( 'bbp_init', 'bbp_load_textdomain', 2 );
62
  add_action( 'bbp_init', 'bbp_setup_current_user', 4 );
63
+ add_action( 'bbp_init', 'bbp_setup_updater', 6 );
64
+ add_action( 'bbp_init', 'bbp_setup_theme_compat', 8 );
65
+ add_action( 'bbp_init', 'bbp_setup_akismet', 10 );
66
+ add_action( 'bbp_init', 'bbp_setup_buddypress', 12 );
67
+ add_action( 'bbp_init', 'bbp_register_post_types', 14 );
68
+ add_action( 'bbp_init', 'bbp_register_post_statuses', 16 );
69
+ add_action( 'bbp_init', 'bbp_register_taxonomies', 18 );
70
+ add_action( 'bbp_init', 'bbp_register_views', 20 );
71
+ add_action( 'bbp_init', 'bbp_register_shortcodes', 22 );
72
+ add_action( 'bbp_init', 'bbp_add_rewrite_tags', 24 );
73
  add_action( 'bbp_init', 'bbp_ready', 999 );
74
 
75
  // Multisite Global Forum Access
204
  add_action( 'bbp_spammed_reply', 'bbp_update_reply_walker' );
205
  add_action( 'bbp_unspammed_reply', 'bbp_update_reply_walker' );
206
 
207
+ // User status
208
+ add_action( 'make_ham_user', 'bbp_make_ham_user' );
209
+ add_action( 'make_spam_user', 'bbp_make_spam_user' );
210
+
211
+ // User role
212
+ add_action( 'bbp_new_topic', 'bbp_global_access_auto_role' );
213
+ add_action( 'bbp_new_reply', 'bbp_global_access_auto_role' );
214
+
215
+ // Flush rewrite rules
216
+ add_action( 'bbp_activation', 'flush_rewrite_rules' );
217
+ add_action( 'bbp_deactivation', 'flush_rewrite_rules' );
218
+
219
  /**
220
  * When a new site is created in a multisite installation, run the activation
221
  * routine on that site
416
  add_filter( 'bbp_get_topic_content', 'wp_kses_data' );
417
  }
418
 
419
+ /**
420
+ * Plugin Dependency
421
+ *
422
+ * The purpose of the following actions is to mimic the behavior of something
423
+ * called 'plugin dependency' which enables a plugin to have plugins of their
424
+ * own in a safe and reliable way.
425
+ *
426
+ * We do this in bbPress by mirroring existing WordPress actions in many places
427
+ * allowing dependant plugins to hook into the bbPress specific ones, thus
428
+ * guaranteeing proper code execution only when bbPress is active.
429
+ *
430
+ * The following functions are wrappers for their actions, allowing them to be
431
+ * manually called and/or piggy-backed on top of other actions if needed.
432
+ */
433
+
434
+ /** Activation Actions ********************************************************/
435
+
436
+ /**
437
+ * Runs on bbPress activation
438
+ *
439
+ * @since bbPress (r2509)
440
+ *
441
+ * @uses register_uninstall_hook() To register our own uninstall hook
442
+ * @uses do_action() Calls 'bbp_activation' hook
443
+ */
444
+ function bbp_activation() {
445
+ do_action( 'bbp_activation' );
446
+ }
447
+
448
+ /**
449
+ * Runs on bbPress deactivation
450
+ *
451
+ * @since bbPress (r2509)
452
+ *
453
+ * @uses do_action() Calls 'bbp_deactivation' hook
454
+ */
455
+ function bbp_deactivation() {
456
+ do_action( 'bbp_deactivation' );
457
+ }
458
+
459
+ /**
460
+ * Runs when uninstalling bbPress
461
+ *
462
+ * @since bbPress (r2509)
463
+ *
464
+ * @uses do_action() Calls 'bbp_uninstall' hook
465
+ */
466
+ function bbp_uninstall() {
467
+ do_action( 'bbp_uninstall' );
468
+ }
469
+
470
  /** Main Actions **************************************************************/
471
 
472
  /**
bbp-includes/bbp-core-options.php CHANGED
@@ -11,23 +11,20 @@
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
14
- * Add default options
15
  *
16
- * Hooked to bbp_activate, it is only called once when bbPress is activated.
17
- * This is non-destructive, so existing settings will not be overridden.
18
  *
19
- * @uses add_option() Adds default options
20
- * @uses do_action() Calls 'bbp_add_options'
21
  */
22
- function bbp_add_options() {
23
 
24
  // Default options
25
  $options = array (
26
 
27
- /** Database **********************************************************/
28
-
29
- // DB version
30
- '_bbp_db_version' => '110',
31
 
32
  /** Settings **********************************************************/
33
 
@@ -132,6 +129,23 @@ function bbp_add_options() {
132
  // Hidden forums
133
  '_bbp_hidden_forums' => '',
134
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
  // Add default options
137
  foreach ( $options as $key => $value )
@@ -141,6 +155,28 @@ function bbp_add_options() {
141
  // This is an extremely rare use-case.
142
  do_action( 'bbp_add_options' );
143
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
  /** Active? *******************************************************************/
146
 
@@ -172,6 +208,20 @@ function bbp_is_subscriptions_active( $default = true ) {
172
  return apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions', $default ) );
173
  }
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  /**
176
  * Is the anonymous posting allowed?
177
  *
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
14
+ * Get the default site options and their values
15
  *
16
+ * @since bbPress (r3421)
 
17
  *
18
+ * @return array Filtered option names and values
 
19
  */
20
+ function bbp_get_default_options() {
21
 
22
  // Default options
23
  $options = array (
24
 
25
+ /** DB Version ********************************************************/
26
+
27
+ '_bbp_db_version' => '155',
 
28
 
29
  /** Settings **********************************************************/
30
 
129
  // Hidden forums
130
  '_bbp_hidden_forums' => '',
131
  );
132
+
133
+ return apply_filters( 'bbp_get_default_options', $options );
134
+ }
135
+
136
+ /**
137
+ * Add default options
138
+ *
139
+ * Hooked to bbp_activate, it is only called once when bbPress is activated.
140
+ * This is non-destructive, so existing settings will not be overridden.
141
+ *
142
+ * @uses add_option() Adds default options
143
+ * @uses do_action() Calls 'bbp_add_options'
144
+ */
145
+ function bbp_add_options() {
146
+
147
+ // Get the default options and values
148
+ $options = bbp_get_default_options();
149
 
150
  // Add default options
151
  foreach ( $options as $key => $value )
155
  // This is an extremely rare use-case.
156
  do_action( 'bbp_add_options' );
157
  }
158
+ /**
159
+ * Delete default options
160
+ *
161
+ * Hooked to bbp_uninstall, it is only called once when bbPress is uninstalled.
162
+ * This is destructive, so existing settings will be destroyed.
163
+ *
164
+ * @uses delete_option() Removes default options
165
+ * @uses do_action() Calls 'bbp_delete_options'
166
+ */
167
+ function bbp_delete_options() {
168
+
169
+ // Get the default options and values
170
+ $options = bbp_get_default_options();
171
+
172
+ // Add default options
173
+ foreach ( $options as $key => $value )
174
+ delete_option( $key );
175
+
176
+ // Allow previously activated plugins to append their own options.
177
+ // This is an extremely rare use-case.
178
+ do_action( 'bbp_delete_options' );
179
+ }
180
 
181
  /** Active? *******************************************************************/
182
 
208
  return apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions', $default ) );
209
  }
210
 
211
+ /**
212
+ * Are topic and reply revisions allowed
213
+ *
214
+ * @since bbPress (r3412)
215
+ *
216
+ * @param $default bool Optional. Default value
217
+ *
218
+ * @uses get_option() To get the allow revisions
219
+ * @return bool Are revisions allowed?
220
+ */
221
+ function bbp_allow_revisions( $default = true ) {
222
+ return apply_filters( 'bbp_allow_revisions', (bool) get_option( '_bbp_allow_revisions', $default ) );
223
+ }
224
+
225
  /**
226
  * Is the anonymous posting allowed?
227
  *
bbp-includes/bbp-core-update.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * bbPress Updater
5
+ *
6
+ * @package bbPress
7
+ * @subpackage Updater
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ /**
14
+ * Compare the bbPress version to the DB version to determine if updating
15
+ *
16
+ * @since bbPress (r3421)
17
+ * @global bbPress $bbp
18
+ * @uses get_option()
19
+ * @return bool True if update, False if not
20
+ */
21
+ function bbp_is_update() {
22
+ global $bbp;
23
+
24
+ // Current DB version of this site (per site in a multisite network)
25
+ $current_db = get_option( '_bbp_db_version' );
26
+
27
+ // Compare versions (cast as int and bool to be safe)
28
+ $is_update = (bool) ( (int) $current_db < (int) $bbp->db_version );
29
+
30
+ // Return the product of version comparison
31
+ return $is_update;
32
+ }
33
+
34
+ /**
35
+ * Determine if bbPress is being activated
36
+ *
37
+ * @since bbPress (r3421)
38
+ * @global bbPress $bbp
39
+ * @return bool True if activating bbPress, false if not
40
+ */
41
+ function bbp_is_activation( $basename = '' ) {
42
+ global $bbp;
43
+
44
+ // Baif if action or plugin are empty
45
+ if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) )
46
+ return false;
47
+
48
+ // Bail if not activating
49
+ if ( 'activate' !== $_GET['action'] )
50
+ return false;
51
+
52
+ // The plugin being activated
53
+ $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : '';
54
+
55
+ // Set basename if empty
56
+ if ( empty( $basename ) && !empty( $bbp->basename ) )
57
+ $basename = $bbp->basename;
58
+
59
+ // Bail if no basename
60
+ if ( empty( $basename ) )
61
+ return false;
62
+
63
+ // Bail if plugin is not bbPress
64
+ if ( $basename !== $_GET['plugin'] )
65
+ return false;
66
+
67
+ return true;
68
+ }
69
+
70
+ /**
71
+ * Determine if bbPress is being deactivated
72
+ *
73
+ * @since bbPress (r3421)
74
+ * @global bbPress $bbp
75
+ * @return bool True if deactivating bbPress, false if not
76
+ */
77
+ function bbp_is_deactivation( $basename = '' ) {
78
+ global $bbp;
79
+
80
+ // Baif if action or plugin are empty
81
+ if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) )
82
+ return false;
83
+
84
+ // Bail if not deactivating
85
+ if ( 'deactivate' !== $_GET['action'] )
86
+ return false;
87
+
88
+ // The plugin being deactivated
89
+ $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : '';
90
+
91
+ // Set basename if empty
92
+ if ( empty( $basename ) && !empty( $bbp->basename ) )
93
+ $basename = $bbp->basename;
94
+
95
+ // Bail if no basename
96
+ if ( empty( $basename ) )
97
+ return false;
98
+
99
+ // Bail if plugin is not bbPress
100
+ if ( $basename !== $plugin )
101
+ return false;
102
+
103
+ return true;
104
+ }
105
+
106
+ /**
107
+ * Update the DB to the latest version
108
+ *
109
+ * @since bbPress (r3421)
110
+ * @uses update_option()
111
+ */
112
+ function bbp_version_bump() {
113
+ global $bbp;
114
+
115
+ update_option( '_bbp_db_version', $bbp->db_version );
116
+ }
117
+
118
+ /**
119
+ * Setup the bbPress updater
120
+ *
121
+ * @since bbPress (r3419)
122
+ *
123
+ * @global bbPress $bbp
124
+ * @uses BBP_Updater
125
+ */
126
+ function bbp_setup_updater() {
127
+
128
+ // Are we running an outdated version of bbPress?
129
+ if ( bbp_is_update() ) {
130
+
131
+ // Bump the version
132
+ bbp_version_bump();
133
+
134
+ // Run the deactivation function to wipe roles, caps, and rewrite rules
135
+ bbp_deactivation();
136
+
137
+ // Run the activation function to reset roles, caps, and rewrite rules
138
+ bbp_activation();
139
+ }
140
+ }
141
+
142
+ ?>
bbp-includes/bbp-extend-buddypress.php CHANGED
@@ -423,7 +423,12 @@ class BBP_BuddyPress {
423
  );
424
 
425
  // Record the activity
426
- $this->record_activity( $activity );
 
 
 
 
 
427
  }
428
 
429
  /** Replies ***************************************************************/
@@ -507,7 +512,12 @@ class BBP_BuddyPress {
507
  );
508
 
509
  // Record the activity
510
- $this->record_activity( $activity );
 
 
 
 
 
511
  }
512
  }
513
  endif;
423
  );
424
 
425
  // Record the activity
426
+ $activity_id = $this->record_activity( $activity );
427
+
428
+ // Add the activity entry ID as a meta value to the topic
429
+ if ( !empty( $activity_id ) ) {
430
+ update_post_meta( $topic_id, '_bbp_activity_id', $activity_id );
431
+ }
432
  }
433
 
434
  /** Replies ***************************************************************/
512
  );
513
 
514
  // Record the activity
515
+ $activity_id = $this->record_activity( $activity );
516
+
517
+ // Add the activity entry ID as a meta value to the reply
518
+ if ( !empty( $activity_id ) ) {
519
+ update_post_meta( $reply_id, '_bbp_activity_id', $activity_id );
520
+ }
521
  }
522
  }
523
  endif;
bbp-includes/bbp-reply-functions.php CHANGED
@@ -80,7 +80,7 @@ function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
80
  *
81
  * @since bbPress (r2574)
82
  *
83
- * @uses bbPress:errors::add() To log various error messages
84
  * @uses check_admin_referer() To verify the nonce and check the referer
85
  * @uses bbp_is_anonymous() To check if an anonymous post is being made
86
  * @uses current_user_can() To check if the current user can publish replies
@@ -97,7 +97,6 @@ function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
97
  * @uses apply_filters() Calls 'bbp_new_reply_pre_content' with the content
98
  * @uses bbp_get_reply_post_type() To get the reply post type
99
  * @uses wp_set_post_terms() To set the topic tags
100
- * @uses bbPress::errors::get_error_codes() To get the {@link WP_Error} errors
101
  * @uses wp_insert_post() To insert the reply
102
  * @uses do_action() Calls 'bbp_new_reply' with the reply id, topic id, forum
103
  * id, anonymous data and reply author
@@ -315,7 +314,7 @@ function bbp_new_reply_handler() {
315
  /**
316
  * Handles the front end edit reply submission
317
  *
318
- * @uses bbPress:errors::add() To log various error messages
319
  * @uses bbp_get_reply() To get the reply
320
  * @uses check_admin_referer() To verify the nonce and check the referer
321
  * @uses bbp_is_reply_anonymous() To check if the reply was by an anonymous user
@@ -329,7 +328,7 @@ function bbp_new_reply_handler() {
329
  * @uses apply_filters() Calls 'bbp_edit_reply_pre_content' with the content
330
  * reply id
331
  * @uses wp_set_post_terms() To set the topic tags
332
- * @uses bbPress::errors::get_error_codes() To get the {@link WP_Error} errors
333
  * @uses wp_save_post_revision() To save a reply revision
334
  * @uses bbp_update_topic_revision_log() To update the reply revision log
335
  * @uses wp_update_post() To update the reply
@@ -1017,14 +1016,20 @@ function bbp_toggle_reply_handler() {
1017
  // No errors
1018
  if ( ( false != $success ) && !is_wp_error( $success ) ) {
1019
 
1020
- // Redirect back to the reply
1021
- $redirect = bbp_get_reply_url( $reply_id );
 
 
 
 
 
1022
 
1023
  // Add view all if needed
1024
  if ( !empty( $view_all ) )
1025
- $redirect = bbp_add_view_all( $redirect, true );
1026
 
1027
- wp_redirect( $redirect );
 
1028
 
1029
  // For good measure
1030
  exit();
80
  *
81
  * @since bbPress (r2574)
82
  *
83
+ * @uses bbp_add_error() To add an error message
84
  * @uses check_admin_referer() To verify the nonce and check the referer
85
  * @uses bbp_is_anonymous() To check if an anonymous post is being made
86
  * @uses current_user_can() To check if the current user can publish replies
97
  * @uses apply_filters() Calls 'bbp_new_reply_pre_content' with the content
98
  * @uses bbp_get_reply_post_type() To get the reply post type
99
  * @uses wp_set_post_terms() To set the topic tags
 
100
  * @uses wp_insert_post() To insert the reply
101
  * @uses do_action() Calls 'bbp_new_reply' with the reply id, topic id, forum
102
  * id, anonymous data and reply author
314
  /**
315
  * Handles the front end edit reply submission
316
  *
317
+ * @uses bbp_add_error() To add an error message
318
  * @uses bbp_get_reply() To get the reply
319
  * @uses check_admin_referer() To verify the nonce and check the referer
320
  * @uses bbp_is_reply_anonymous() To check if the reply was by an anonymous user
328
  * @uses apply_filters() Calls 'bbp_edit_reply_pre_content' with the content
329
  * reply id
330
  * @uses wp_set_post_terms() To set the topic tags
331
+ * @uses bbp_has_errors() To get the {@link WP_Error} errors
332
  * @uses wp_save_post_revision() To save a reply revision
333
  * @uses bbp_update_topic_revision_log() To update the reply revision log
334
  * @uses wp_update_post() To update the reply
1016
  // No errors
1017
  if ( ( false != $success ) && !is_wp_error( $success ) ) {
1018
 
1019
+ /** Redirect **************************************************/
1020
+
1021
+ // Redirect to
1022
+ $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
1023
+
1024
+ // Get the reply URL
1025
+ $reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
1026
 
1027
  // Add view all if needed
1028
  if ( !empty( $view_all ) )
1029
+ $reply_url = bbp_add_view_all( $reply_url, true );
1030
 
1031
+ // Redirect back to reply
1032
+ wp_redirect( $reply_url );
1033
 
1034
  // For good measure
1035
  exit();
bbp-includes/bbp-reply-template.php CHANGED
@@ -380,7 +380,7 @@ function bbp_reply_url( $reply_id = 0 ) {
380
  $reply_page = ceil( $reply_position / get_option( '_bbp_replies_per_page', 15 ) );
381
 
382
  // Hash to add to end of URL
383
- $reply_hash = !empty( $bbp->errors ) ? "#post-{$reply_id}" : '';
384
 
385
  // Remove the topic view query arg if its set
386
  $topic_url = remove_query_arg( 'view', $topic_url );
380
  $reply_page = ceil( $reply_position / get_option( '_bbp_replies_per_page', 15 ) );
381
 
382
  // Hash to add to end of URL
383
+ $reply_hash = '#post-' . $reply_id;
384
 
385
  // Remove the topic view query arg if its set
386
  $topic_url = remove_query_arg( 'view', $topic_url );
bbp-includes/bbp-user-functions.php CHANGED
@@ -764,77 +764,92 @@ function bbp_edit_user_handler() {
764
  if ( empty( $_POST['action'] ) || ( 'bbp-update-user' !== $_POST['action'] ) )
765
  return;
766
 
767
- global $bbp, $wpdb;
 
 
 
768
 
769
  // Execute confirmed email change. See send_confirmation_on_profile_email().
770
- if ( is_multisite() && bbp_is_user_home() && isset( $_GET['newuseremail'] ) && $bbp->displayed_user->ID ) {
771
 
772
- $new_email = get_option( $bbp->displayed_user->ID . '_new_email' );
773
 
774
  if ( $new_email['hash'] == $_GET['newuseremail'] ) {
775
- $user->ID = $bbp->displayed_user->ID;
776
  $user->user_email = esc_html( trim( $new_email['newemail'] ) );
777
 
778
- if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $bbp->displayed_user->user_login ) ) )
779
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $bbp->displayed_user->user_login ) );
780
 
781
  wp_update_user( get_object_vars( $user ) );
782
- delete_option( $bbp->displayed_user->ID . '_new_email' );
783
 
784
- wp_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $bbp->displayed_user->ID ) ) );
785
  exit;
786
  }
787
 
788
- } elseif ( is_multisite() && bbp_is_user_home() && !empty( $_GET['dismiss'] ) && $bbp->displayed_user->ID . '_new_email' == $_GET['dismiss'] ) {
789
 
790
- delete_option( $bbp->displayed_user->ID . '_new_email' );
791
- wp_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $bbp->displayed_user->ID ) ) );
792
  exit;
793
 
794
  }
795
 
796
- check_admin_referer( 'update-user_' . $bbp->displayed_user->ID );
797
 
798
- if ( !current_user_can( 'edit_user', $bbp->displayed_user->ID ) )
799
  wp_die( __( 'What are you doing here? You do not have the permission to edit this user.', 'bbpress' ) );
800
 
801
- if ( bbp_is_user_home() )
802
- do_action( 'personal_options_update', $bbp->displayed_user->ID );
803
- else
804
- do_action( 'edit_user_profile_update', $bbp->displayed_user->ID );
805
 
 
806
  if ( !is_multisite() ) {
807
- $bbp->errors = edit_user( $bbp->displayed_user->ID ); // Handles the trouble for us ;)
 
 
808
  } else {
809
- $user = get_userdata( $bbp->displayed_user->ID );
810
 
811
  // Update the email address in signups, if present.
812
- if ( $user->user_login && isset( $_POST['email'] ) && is_email( $_POST['email'] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login ) ) )
813
  $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST['email'], $user_login ) );
 
814
 
815
  // WPMU must delete the user from the current blog if WP added him after editing.
816
  $delete_role = false;
817
  $blog_prefix = $wpdb->get_blog_prefix();
818
 
819
- if ( $bbp->displayed_user->ID != $bbp->displayed_user->ID ) {
820
- $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$bbp->displayed_user->ID}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" );
821
  if ( !is_network_admin() && null == $cap && $_POST['role'] == '' ) {
822
  $_POST['role'] = 'contributor';
823
- $delete_role = true;
824
  }
825
  }
826
 
827
- $bbp->errors = edit_user( $bbp->displayed_user->ID );
828
 
829
- if ( $delete_role ) // stops users being added to current blog when they are edited
830
- delete_user_meta( $bbp->displayed_user->ID, $blog_prefix . 'capabilities' );
 
 
831
 
832
- if ( is_multisite() && is_network_admin() & !bbp_is_user_home() && current_user_can( 'manage_network_options' ) && !isset( $super_admins ) && empty( $_POST['super_admin'] ) == is_super_admin( $bbp->displayed_user->ID ) )
833
- empty( $_POST['super_admin'] ) ? revoke_super_admin( $bbp->displayed_user->ID ) : grant_super_admin( $bbp->displayed_user->ID );
 
834
  }
835
 
836
- if ( !bbp_has_errors() ) {
837
- $redirect = add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $bbp->displayed_user->ID ) );
 
 
 
 
 
 
838
 
839
  wp_redirect( $redirect );
840
  exit;
@@ -939,6 +954,176 @@ function bbp_is_user_spammer( $user_id = 0 ) {
939
  return apply_filters( 'bp_core_is_user_spammer', (bool) $is_spammer );
940
  }
941
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
942
  /**
943
  * Checks if the user has been marked as deleted.
944
  *
@@ -949,6 +1134,10 @@ function bbp_is_user_spammer( $user_id = 0 ) {
949
  */
950
  function bbp_is_user_deleted( $user_id = 0 ) {
951
 
 
 
 
 
952
  // No user to check
953
  if ( empty( $user_id ) )
954
  return false;
764
  if ( empty( $_POST['action'] ) || ( 'bbp-update-user' !== $_POST['action'] ) )
765
  return;
766
 
767
+ // Get the displayed user ID
768
+ $user_id = bbp_get_displayed_user_id();
769
+
770
+ global $wpdb;
771
 
772
  // Execute confirmed email change. See send_confirmation_on_profile_email().
773
+ if ( is_multisite() && bbp_is_user_home() && isset( $_GET['newuseremail'] ) ) {
774
 
775
+ $new_email = get_option( $user_id . '_new_email' );
776
 
777
  if ( $new_email['hash'] == $_GET['newuseremail'] ) {
778
+ $user->ID = $user_id;
779
  $user->user_email = esc_html( trim( $new_email['newemail'] ) );
780
 
781
+ if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", bbp_get_displayed_user_field( 'user_login' ) ) ) )
782
+ $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' ) ) );
783
 
784
  wp_update_user( get_object_vars( $user ) );
785
+ delete_option( $user_id . '_new_email' );
786
 
787
+ wp_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
788
  exit;
789
  }
790
 
791
+ } elseif ( is_multisite() && bbp_is_user_home() && !empty( $_GET['dismiss'] ) && ( $user_id . '_new_email' == $_GET['dismiss'] ) ) {
792
 
793
+ delete_option( $user_id . '_new_email' );
794
+ wp_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
795
  exit;
796
 
797
  }
798
 
799
+ check_admin_referer( 'update-user_' . $user_id );
800
 
801
+ if ( !current_user_can( 'edit_user', $user_id ) )
802
  wp_die( __( 'What are you doing here? You do not have the permission to edit this user.', 'bbpress' ) );
803
 
804
+ // Do action based on who's profile you're editing
805
+ $edit_action = bbp_is_user_home() ? 'personal_options_update' : 'edit_user_profile_update';
806
+ do_action( $edit_action, $user_id );
 
807
 
808
+ // Multisite handles the trouble for us ;)
809
  if ( !is_multisite() ) {
810
+ $edit_user = edit_user( $user_id );
811
+
812
+ // Single site means we need to do some manual labor
813
  } else {
814
+ $user = get_userdata( $user_id );
815
 
816
  // Update the email address in signups, if present.
817
+ if ( $user->user_login && isset( $_POST['email'] ) && is_email( $_POST['email'] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login ) ) ) {
818
  $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST['email'], $user_login ) );
819
+ }
820
 
821
  // WPMU must delete the user from the current blog if WP added him after editing.
822
  $delete_role = false;
823
  $blog_prefix = $wpdb->get_blog_prefix();
824
 
825
+ if ( $user_id != $user_id ) {
826
+ $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" );
827
  if ( !is_network_admin() && null == $cap && $_POST['role'] == '' ) {
828
  $_POST['role'] = 'contributor';
829
+ $delete_role = true;
830
  }
831
  }
832
 
833
+ $edit_user = edit_user( $user_id );
834
 
835
+ // stops users being added to current blog when they are edited
836
+ if ( $delete_role ) {
837
+ delete_user_meta( $user_id, $blog_prefix . 'capabilities' );
838
+ }
839
 
840
+ if ( is_multisite() && is_network_admin() & !bbp_is_user_home() && current_user_can( 'manage_network_options' ) && !isset( $super_admins ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) {
841
+ empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
842
+ }
843
  }
844
 
845
+ // Error(s) editng the user, so copy them into the global
846
+ if ( is_wp_error( $edit_user ) ) {
847
+ global $bbp;
848
+ $bbp->errors = $edit_user;
849
+
850
+ // Successful edit to redirect
851
+ } elseif ( is_integer( $edit_user ) ) {
852
+ $redirect = add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $edit_user ) );
853
 
854
  wp_redirect( $redirect );
855
  exit;
954
  return apply_filters( 'bp_core_is_user_spammer', (bool) $is_spammer );
955
  }
956
 
957
+ /**
958
+ * Mark a users topics and replies as spam when the user is marked as spam
959
+ *
960
+ * @since bbPress (r3405)
961
+ *
962
+ * @global WPDB $wpdb
963
+ * @param int $user_id Optional. User ID to spam. Defaults to displayed user.
964
+
965
+ * @uses bbp_is_single_user()
966
+ * @uses bbp_is_user_home()
967
+ * @uses bbp_get_displayed_user_field()
968
+ * @uses is_super_admin()
969
+ * @uses get_blogs_of_user()
970
+ * @uses get_current_blog_id()
971
+ * @uses bbp_get_topic_post_type()
972
+ * @uses bbp_get_reply_post_type()
973
+ * @uses switch_to_blog()
974
+ * @uses get_post_type()
975
+ * @uses bbp_spam_topic()
976
+ * @uses bbp_spam_reply()
977
+ * @uses restore_current_blog()
978
+ *
979
+ * @return If no user ID passed
980
+ */
981
+ function bbp_make_spam_user( $user_id = 0 ) {
982
+
983
+ // Use displayed user if it's not yourself
984
+ if ( empty( $user_id ) && bbp_is_single_user() && !bbp_is_user_home() )
985
+ $user_id = bbp_get_displayed_user_id();
986
+
987
+ // Bail if no user ID
988
+ if ( empty( $user_id ) )
989
+ return;
990
+
991
+ // Bail if user ID is super admin
992
+ if ( is_super_admin( $user_id ) )
993
+ return;
994
+
995
+ // Arm the torpedos
996
+ global $wpdb;
997
+
998
+ // Get the blog IDs of the user to mark as spam
999
+ $blogs = get_blogs_of_user( $user_id, true );
1000
+ $blog_id = get_current_blog_id();
1001
+
1002
+ // If user has no blogs, they are a guest on this site
1003
+ if ( empty( $blogs ) )
1004
+ $blogs[$blog_id] = array();
1005
+
1006
+ // Make array of post types to mark as spam
1007
+ $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
1008
+ $post_types = "'" . implode( "', '", $post_types ) . "'";
1009
+
1010
+ // Loop through blogs and remove their posts
1011
+ foreach ( (array) $blogs as $blog_id => $details ) {
1012
+
1013
+ // Switch to the blog ID
1014
+ switch_to_blog( $blog_id );
1015
+
1016
+ // Get topics and replies
1017
+ $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = 'publish' AND post_type IN ({$post_types})" );
1018
+
1019
+ // Loop through posts and spam them
1020
+ if ( !empty( $posts ) ) {
1021
+ foreach ( $posts as $post_id ) {
1022
+
1023
+ // The routines for topics ang replies are different, so use the
1024
+ // correct one based on the post type
1025
+ switch ( get_post_type( $post_id ) ) {
1026
+
1027
+ case bbp_get_topic_post_type() :
1028
+ bbp_spam_topic( $post_id );
1029
+ break;
1030
+
1031
+ case bbp_get_reply_post_type() :
1032
+ bbp_spam_reply( $post_id );
1033
+ break;
1034
+ }
1035
+ }
1036
+ }
1037
+
1038
+ // Switch back to current blog
1039
+ restore_current_blog();
1040
+ }
1041
+ }
1042
+
1043
+ /**
1044
+ * Mark a users topics and replies as spam when the user is marked as spam
1045
+ *
1046
+ * @since bbPress (r3405)
1047
+ *
1048
+ * @global WPDB $wpdb
1049
+ * @param int $user_id Optional. User ID to unspam. Defaults to displayed user.
1050
+ *
1051
+ * @uses bbp_is_single_user()
1052
+ * @uses bbp_is_user_home()
1053
+ * @uses bbp_get_displayed_user_field()
1054
+ * @uses is_super_admin()
1055
+ * @uses get_blogs_of_user()
1056
+ * @uses bbp_get_topic_post_type()
1057
+ * @uses bbp_get_reply_post_type()
1058
+ * @uses switch_to_blog()
1059
+ * @uses get_post_type()
1060
+ * @uses bbp_unspam_topic()
1061
+ * @uses bbp_unspam_reply()
1062
+ * @uses restore_current_blog()
1063
+ *
1064
+ * @return If no user ID passed
1065
+ */
1066
+ function bbp_make_ham_user( $user_id = 0 ) {
1067
+
1068
+ // Use displayed user if it's not yourself
1069
+ if ( empty( $user_id ) && bbp_is_single_user() && !bbp_is_user_home() )
1070
+ $user_id = bbp_get_displayed_user_field();
1071
+
1072
+ // Bail if no user ID
1073
+ if ( empty( $user_id ) )
1074
+ return;
1075
+
1076
+ // Bail if user ID is super admin
1077
+ if ( is_super_admin( $user_id ) )
1078
+ return;
1079
+
1080
+ // Arm the torpedos
1081
+ global $wpdb, $bbp;
1082
+
1083
+ // Get the blog IDs of the user to mark as spam
1084
+ $blogs = get_blogs_of_user( $user_id, true );
1085
+
1086
+ // If user has no blogs, they are a guest on this site
1087
+ if ( empty( $blogs ) )
1088
+ $blogs[$wpdb->blogid] = array();
1089
+
1090
+ // Make array of post types to mark as spam
1091
+ $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
1092
+ $post_types = "'" . implode( "', '", $post_types ) . "'";
1093
+
1094
+ // Loop through blogs and remove their posts
1095
+ foreach ( (array) $blogs as $blog_id => $details ) {
1096
+
1097
+ // Switch to the blog ID
1098
+ switch_to_blog( $blog_id );
1099
+
1100
+ // Get topics and replies
1101
+ $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = '{$bbp->spam_status_id}' AND post_type IN ({$post_types})" );
1102
+
1103
+ // Loop through posts and spam them
1104
+ if ( !empty( $posts ) ) {
1105
+ foreach ( $posts as $post_id ) {
1106
+
1107
+ // The routines for topics ang replies are different, so use the
1108
+ // correct one based on the post type
1109
+ switch ( get_post_type( $post_id ) ) {
1110
+
1111
+ case bbp_get_topic_post_type() :
1112
+ bbp_unspam_topic( $post_id );
1113
+ break;
1114
+
1115
+ case bbp_get_reply_post_type() :
1116
+ bbp_unspam_reply( $post_id );
1117
+ break;
1118
+ }
1119
+ }
1120
+ }
1121
+
1122
+ // Switch back to current blog
1123
+ restore_current_blog();
1124
+ }
1125
+ }
1126
+
1127
  /**
1128
  * Checks if the user has been marked as deleted.
1129
  *
1134
  */
1135
  function bbp_is_user_deleted( $user_id = 0 ) {
1136
 
1137
+ // Default to current user
1138
+ if ( empty( $user_id ) && is_user_logged_in() )
1139
+ $user_id = bbp_get_current_user_id();
1140
+
1141
  // No user to check
1142
  if ( empty( $user_id ) )
1143
  return false;
bbp-themes/bbp-twentyten/bbpress/form-anonymous.php CHANGED
@@ -11,8 +11,13 @@
11
 
12
  <?php if ( bbp_is_anonymous() || ( bbp_is_topic_edit() && bbp_is_topic_anonymous() ) || ( bbp_is_reply_edit() && bbp_is_reply_anonymous() ) ) : ?>
13
 
 
 
14
  <fieldset class="bbp-form">
15
  <legend><?php ( bbp_is_topic_edit() || bbp_is_reply_edit() ) ? _e( 'Author Information', 'bbpress' ) : _e( 'Your information:', 'bbpress' ); ?></legend>
 
 
 
16
  <p>
17
  <label for="bbp_anonymous_author"><?php _e( 'Name (required):', 'bbpress' ); ?></label><br />
18
  <input type="text" id="bbp_anonymous_author" value="<?php bbp_is_topic_edit() ? bbp_topic_author() : bbp_is_reply_edit() ? bbp_reply_author() : bbp_current_anonymous_user_data( 'name' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_name" />
@@ -27,6 +32,11 @@
27
  <label for="bbp_anonymous_website"><?php _e( 'Website:', 'bbpress' ); ?></label><br />
28
  <input type="text" id="bbp_anonymous_website" value="<?php bbp_is_topic_edit() ? bbp_topic_author_url() : bbp_is_reply_edit() ? bbp_reply_author_url() : bbp_current_anonymous_user_data( 'website' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_website" />
29
  </p>
 
 
 
30
  </fieldset>
31
 
 
 
32
  <?php endif; ?>
11
 
12
  <?php if ( bbp_is_anonymous() || ( bbp_is_topic_edit() && bbp_is_topic_anonymous() ) || ( bbp_is_reply_edit() && bbp_is_reply_anonymous() ) ) : ?>
13
 
14
+ <?php do_action( 'bbp_theme_before_anonymous_form' ); ?>
15
+
16
  <fieldset class="bbp-form">
17
  <legend><?php ( bbp_is_topic_edit() || bbp_is_reply_edit() ) ? _e( 'Author Information', 'bbpress' ) : _e( 'Your information:', 'bbpress' ); ?></legend>
18
+
19
+ <?php do_action( 'bbp_theme_anonymous_form_extras_top' ); ?>
20
+
21
  <p>
22
  <label for="bbp_anonymous_author"><?php _e( 'Name (required):', 'bbpress' ); ?></label><br />
23
  <input type="text" id="bbp_anonymous_author" value="<?php bbp_is_topic_edit() ? bbp_topic_author() : bbp_is_reply_edit() ? bbp_reply_author() : bbp_current_anonymous_user_data( 'name' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_name" />
32
  <label for="bbp_anonymous_website"><?php _e( 'Website:', 'bbpress' ); ?></label><br />
33
  <input type="text" id="bbp_anonymous_website" value="<?php bbp_is_topic_edit() ? bbp_topic_author_url() : bbp_is_reply_edit() ? bbp_reply_author_url() : bbp_current_anonymous_user_data( 'website' ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_website" />
34
  </p>
35
+
36
+ <?php do_action( 'bbp_theme_anonymous_form_extras_bottom' ); ?>
37
+
38
  </fieldset>
39
 
40
+ <?php do_action( 'bbp_theme_after_anonymous_form' ); ?>
41
+
42
  <?php endif; ?>
bbp-themes/bbp-twentyten/bbpress/form-reply.php CHANGED
@@ -20,9 +20,14 @@
20
  <div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form">
21
 
22
  <form id="new-post" name="new-post" method="post" action="">
 
 
 
23
  <fieldset class="bbp-form">
24
  <legend><?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
25
 
 
 
26
  <?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>
27
 
28
  <div class="bbp-template-notice">
@@ -51,11 +56,15 @@
51
 
52
  <?php bbp_get_template_part( 'bbpress/form', 'anonymous' ); ?>
53
 
 
 
54
  <p>
55
  <label for="bbp_reply_content"><?php _e( 'Reply:', 'bbpress' ); ?></label><br />
56
  <textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" cols="51" rows="6"><?php bbp_form_reply_content(); ?></textarea>
57
  </p>
58
 
 
 
59
  <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
60
 
61
  <p class="form-allowed-tags">
@@ -65,13 +74,19 @@
65
 
66
  <?php endif; ?>
67
 
 
 
68
  <p>
69
  <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
70
  <input id="bbp_topic_tags" type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" />
71
  </p>
72
 
 
 
73
  <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?>
74
 
 
 
75
  <p>
76
 
77
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
@@ -88,9 +103,13 @@
88
 
89
  </p>
90
 
 
 
91
  <?php endif; ?>
92
 
93
- <?php if ( bbp_is_reply_edit() ) : ?>
 
 
94
 
95
  <fieldset class="bbp-form">
96
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
@@ -105,20 +124,36 @@
105
  </div>
106
  </fieldset>
107
 
 
 
108
  <?php else : ?>
109
 
110
  <?php bbp_topic_admin_links(); ?>
111
 
112
  <?php endif; ?>
113
 
 
 
114
  <div class="bbp-submit-wrapper">
 
 
 
115
  <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
 
 
 
116
  </div>
 
 
 
117
  </div>
118
 
119
  <?php bbp_reply_form_fields(); ?>
120
 
121
  </fieldset>
 
 
 
122
  </form>
123
  </div>
124
 
20
  <div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form">
21
 
22
  <form id="new-post" name="new-post" method="post" action="">
23
+
24
+ <?php do_action( 'bbp_theme_before_reply_form' ); ?>
25
+
26
  <fieldset class="bbp-form">
27
  <legend><?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
28
 
29
+ <?php do_action( 'bbp_theme_before_reply_form_notices' ); ?>
30
+
31
  <?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>
32
 
33
  <div class="bbp-template-notice">
56
 
57
  <?php bbp_get_template_part( 'bbpress/form', 'anonymous' ); ?>
58
 
59
+ <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
60
+
61
  <p>
62
  <label for="bbp_reply_content"><?php _e( 'Reply:', 'bbpress' ); ?></label><br />
63
  <textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" cols="51" rows="6"><?php bbp_form_reply_content(); ?></textarea>
64
  </p>
65
 
66
+ <?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
67
+
68
  <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
69
 
70
  <p class="form-allowed-tags">
74
 
75
  <?php endif; ?>
76
 
77
+ <?php do_action( 'bbp_theme_before_reply_form_tags' ); ?>
78
+
79
  <p>
80
  <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
81
  <input id="bbp_topic_tags" type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" />
82
  </p>
83
 
84
+ <?php do_action( 'bbp_theme_after_reply_form_tags' ); ?>
85
+
86
  <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?>
87
 
88
+ <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?>
89
+
90
  <p>
91
 
92
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
103
 
104
  </p>
105
 
106
+ <?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?>
107
+
108
  <?php endif; ?>
109
 
110
+ <?php if ( bbp_allow_revisions() && bbp_is_reply_edit() ) : ?>
111
+
112
+ <?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?>
113
 
114
  <fieldset class="bbp-form">
115
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
124
  </div>
125
  </fieldset>
126
 
127
+ <?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?>
128
+
129
  <?php else : ?>
130
 
131
  <?php bbp_topic_admin_links(); ?>
132
 
133
  <?php endif; ?>
134
 
135
+ <?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?>
136
+
137
  <div class="bbp-submit-wrapper">
138
+
139
+ <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?>
140
+
141
  <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
142
+
143
+ <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?>
144
+
145
  </div>
146
+
147
+ <?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?>
148
+
149
  </div>
150
 
151
  <?php bbp_reply_form_fields(); ?>
152
 
153
  </fieldset>
154
+
155
+ <?php do_action( 'bbp_theme_after_reply_form' ); ?>
156
+
157
  </form>
158
  </div>
159
 
bbp-themes/bbp-twentyten/bbpress/form-topic.php CHANGED
@@ -28,6 +28,9 @@
28
  <div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form">
29
 
30
  <form id="new-post" name="new-post" method="post" action="">
 
 
 
31
  <fieldset class="bbp-form">
32
  <legend>
33
 
@@ -40,6 +43,8 @@
40
 
41
  </legend>
42
 
 
 
43
  <?php if ( !bbp_is_topic_edit() && bbp_is_forum_closed() ) : ?>
44
 
45
  <div class="bbp-template-notice">
@@ -67,16 +72,24 @@
67
 
68
  <?php bbp_get_template_part( 'bbpress/form', 'anonymous' ); ?>
69
 
 
 
70
  <p>
71
  <label for="bbp_topic_title"><?php printf( __( 'Topic Title (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
72
  <input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_title" maxlength="<?php bbp_title_max_length(); ?>" />
73
  </p>
74
 
 
 
 
 
75
  <p>
76
  <label for="bbp_topic_content"><?php _e( 'Topic Description:', 'bbpress' ); ?></label><br />
77
  <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="51" rows="6"><?php bbp_form_topic_content(); ?></textarea>
78
  </p>
79
 
 
 
80
  <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
81
 
82
  <p class="form-allowed-tags">
@@ -86,22 +99,32 @@
86
 
87
  <?php endif; ?>
88
 
 
 
89
  <p>
90
  <label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
91
  <input type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" />
92
  </p>
93
 
 
 
94
  <?php if ( !bbp_is_single_forum() ) : ?>
95
 
 
 
96
  <p>
97
  <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
98
  <?php bbp_dropdown( array( 'selected' => bbp_get_form_topic_forum() ) ); ?>
99
  </p>
100
 
 
 
101
  <?php endif; ?>
102
 
103
  <?php if ( current_user_can( 'moderate' ) ) : ?>
104
 
 
 
105
  <p>
106
 
107
  <label for="bbp_stick_topic"><?php _e( 'Topic Type:', 'bbpress' ); ?></label><br />
@@ -110,10 +133,14 @@
110
 
111
  </p>
112
 
 
 
113
  <?php endif; ?>
114
 
115
  <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_topic_edit() || ( bbp_is_topic_edit() && !bbp_is_topic_anonymous() ) ) ) : ?>
116
 
 
 
117
  <p>
118
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
119
 
@@ -128,9 +155,13 @@
128
  <?php endif; ?>
129
  </p>
130
 
 
 
131
  <?php endif; ?>
132
 
133
- <?php if ( bbp_is_topic_edit() ) : ?>
 
 
134
 
135
  <fieldset class="bbp-form">
136
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
@@ -145,16 +176,32 @@
145
  </div>
146
  </fieldset>
147
 
 
 
148
  <?php endif; ?>
149
 
 
 
150
  <div class="bbp-submit-wrapper">
 
 
 
151
  <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_topic_submit" name="bbp_topic_submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
 
 
 
152
  </div>
 
 
 
153
  </div>
154
 
155
  <?php bbp_topic_form_fields(); ?>
156
 
157
  </fieldset>
 
 
 
158
  </form>
159
  </div>
160
 
28
  <div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form">
29
 
30
  <form id="new-post" name="new-post" method="post" action="">
31
+
32
+ <?php do_action( 'bbp_theme_before_topic_form' ); ?>
33
+
34
  <fieldset class="bbp-form">
35
  <legend>
36
 
43
 
44
  </legend>
45
 
46
+ <?php do_action( 'bbp_theme_before_topic_form_notices' ); ?>
47
+
48
  <?php if ( !bbp_is_topic_edit() && bbp_is_forum_closed() ) : ?>
49
 
50
  <div class="bbp-template-notice">
72
 
73
  <?php bbp_get_template_part( 'bbpress/form', 'anonymous' ); ?>
74
 
75
+ <?php do_action( 'bbp_theme_before_topic_form_title' ); ?>
76
+
77
  <p>
78
  <label for="bbp_topic_title"><?php printf( __( 'Topic Title (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
79
  <input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_title" maxlength="<?php bbp_title_max_length(); ?>" />
80
  </p>
81
 
82
+ <?php do_action( 'bbp_theme_after_topic_form_title' ); ?>
83
+
84
+ <?php do_action( 'bbp_theme_before_topic_form_content' ); ?>
85
+
86
  <p>
87
  <label for="bbp_topic_content"><?php _e( 'Topic Description:', 'bbpress' ); ?></label><br />
88
  <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="51" rows="6"><?php bbp_form_topic_content(); ?></textarea>
89
  </p>
90
 
91
+ <?php do_action( 'bbp_theme_after_topic_form_content' ); ?>
92
+
93
  <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
94
 
95
  <p class="form-allowed-tags">
99
 
100
  <?php endif; ?>
101
 
102
+ <?php do_action( 'bbp_theme_before_topic_form_tags' ); ?>
103
+
104
  <p>
105
  <label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
106
  <input type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" />
107
  </p>
108
 
109
+ <?php do_action( 'bbp_theme_after_topic_form_tags' ); ?>
110
+
111
  <?php if ( !bbp_is_single_forum() ) : ?>
112
 
113
+ <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
114
+
115
  <p>
116
  <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
117
  <?php bbp_dropdown( array( 'selected' => bbp_get_form_topic_forum() ) ); ?>
118
  </p>
119
 
120
+ <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
121
+
122
  <?php endif; ?>
123
 
124
  <?php if ( current_user_can( 'moderate' ) ) : ?>
125
 
126
+ <?php do_action( 'bbp_theme_before_topic_form_type' ); ?>
127
+
128
  <p>
129
 
130
  <label for="bbp_stick_topic"><?php _e( 'Topic Type:', 'bbpress' ); ?></label><br />
133
 
134
  </p>
135
 
136
+ <?php do_action( 'bbp_theme_after_topic_form_type' ); ?>
137
+
138
  <?php endif; ?>
139
 
140
  <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_topic_edit() || ( bbp_is_topic_edit() && !bbp_is_topic_anonymous() ) ) ) : ?>
141
 
142
+ <?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?>
143
+
144
  <p>
145
  <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
146
 
155
  <?php endif; ?>
156
  </p>
157
 
158
+ <?php do_action( 'bbp_theme_after_topic_form_subscriptions' ); ?>
159
+
160
  <?php endif; ?>
161
 
162
+ <?php if ( bbp_allow_revisions() && bbp_is_topic_edit() ) : ?>
163
+
164
+ <?php do_action( 'bbp_theme_before_topic_form_revisions' ); ?>
165
 
166
  <fieldset class="bbp-form">
167
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
176
  </div>
177
  </fieldset>
178
 
179
+ <?php do_action( 'bbp_theme_after_topic_form_revisions' ); ?>
180
+
181
  <?php endif; ?>
182
 
183
+ <?php do_action( 'bbp_theme_before_topic_form_submit_wrapper' ); ?>
184
+
185
  <div class="bbp-submit-wrapper">
186
+
187
+ <?php do_action( 'bbp_theme_before_topic_form_submit_button' ); ?>
188
+
189
  <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_topic_submit" name="bbp_topic_submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
190
+
191
+ <?php do_action( 'bbp_theme_after_topic_form_submit_button' ); ?>
192
+
193
  </div>
194
+
195
+ <?php do_action( 'bbp_theme_before_topic_form_submit_wrapper' ); ?>
196
+
197
  </div>
198
 
199
  <?php bbp_topic_form_fields(); ?>
200
 
201
  </fieldset>
202
+
203
+ <?php do_action( 'bbp_theme_after_topic_form' ); ?>
204
+
205
  </form>
206
  </div>
207
 
bbp-themes/bbp-twentyten/bbpress/loop-forums.php CHANGED
@@ -33,11 +33,25 @@
33
  <tr id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
34
 
35
  <td class="bbp-forum-info">
 
 
 
36
  <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>
37
 
 
 
 
 
38
  <?php bbp_list_forums(); ?>
39
 
 
 
 
 
40
  <div class="bbp-forum-description"><?php the_content(); ?></div>
 
 
 
41
  </td>
42
 
43
  <td class="bbp-forum-topic-count"><?php bbp_forum_topic_count(); ?></td>
@@ -46,12 +60,20 @@
46
 
47
  <td class="bbp-forum-freshness">
48
 
 
 
49
  <?php bbp_forum_freshness_link(); ?>
50
 
 
 
51
  <p class="bbp-topic-meta">
52
 
 
 
53
  <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
54
 
 
 
55
  </p>
56
  </td>
57
 
33
  <tr id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
34
 
35
  <td class="bbp-forum-info">
36
+
37
+ <?php do_action( 'bbp_theme_before_forum_title' ); ?>
38
+
39
  <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>
40
 
41
+ <?php do_action( 'bbp_theme_after_forum_title' ); ?>
42
+
43
+ <?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
44
+
45
  <?php bbp_list_forums(); ?>
46
 
47
+ <?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
48
+
49
+ <?php do_action( 'bbp_theme_before_forum_description' ); ?>
50
+
51
  <div class="bbp-forum-description"><?php the_content(); ?></div>
52
+
53
+ <?php do_action( 'bbp_theme_after_forum_description' ); ?>
54
+
55
  </td>
56
 
57
  <td class="bbp-forum-topic-count"><?php bbp_forum_topic_count(); ?></td>
60
 
61
  <td class="bbp-forum-freshness">
62
 
63
+ <?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
64
+
65
  <?php bbp_forum_freshness_link(); ?>
66
 
67
+ <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
68
+
69
  <p class="bbp-topic-meta">
70
 
71
+ <?php do_action( 'bbp_theme_before_topic_author' ); ?>
72
+
73
  <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
74
 
75
+ <?php do_action( 'bbp_theme_after_topic_author' ); ?>
76
+
77
  </p>
78
  </td>
79
 
bbp-themes/bbp-twentyten/bbpress/loop-replies.php CHANGED
@@ -65,8 +65,12 @@
65
 
66
  <a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
67
 
 
 
68
  <?php bbp_reply_admin_links(); ?>
69
 
 
 
70
  </td>
71
  </tr>
72
 
@@ -74,20 +78,32 @@
74
 
75
  <td class="bbp-reply-author">
76
 
 
 
77
  <?php bbp_reply_author_link(); ?>
78
 
79
  <?php if ( is_super_admin() ) : ?>
80
-
 
 
81
  <div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
82
 
 
 
83
  <?php endif; ?>
84
 
 
 
85
  </td>
86
 
87
  <td class="bbp-reply-content">
88
 
 
 
89
  <?php bbp_reply_content(); ?>
90
 
 
 
91
  </td>
92
 
93
  </tr><!-- #post-<?php bbp_topic_id(); ?> -->
65
 
66
  <a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
67
 
68
+ <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
69
+
70
  <?php bbp_reply_admin_links(); ?>
71
 
72
+ <?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
73
+
74
  </td>
75
  </tr>
76
 
78
 
79
  <td class="bbp-reply-author">
80
 
81
+ <?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
82
+
83
  <?php bbp_reply_author_link(); ?>
84
 
85
  <?php if ( is_super_admin() ) : ?>
86
+
87
+ <?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
88
+
89
  <div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
90
 
91
+ <?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
92
+
93
  <?php endif; ?>
94
 
95
+ <?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
96
+
97
  </td>
98
 
99
  <td class="bbp-reply-content">
100
 
101
+ <?php do_action( 'bbp_theme_after_reply_content' ); ?>
102
+
103
  <?php bbp_reply_content(); ?>
104
 
105
+ <?php do_action( 'bbp_theme_before_reply_content' ); ?>
106
+
107
  </td>
108
 
109
  </tr><!-- #post-<?php bbp_topic_id(); ?> -->
bbp-themes/bbp-twentyten/bbpress/loop-topics.php CHANGED
@@ -33,21 +33,39 @@
33
  <tr id="topic-<?php bbp_topic_id(); ?>" <?php bbp_topic_class(); ?>>
34
 
35
  <td class="bbp-topic-title">
 
 
 
36
  <a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a>
37
 
 
 
38
  <?php bbp_topic_pagination(); ?>
39
 
 
 
40
  <p class="bbp-topic-meta">
41
 
 
 
42
  <span class="bbp-topic-started-by"><?php printf( __( 'Started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) ) ); ?></span>
43
 
 
 
44
  <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() != bbp_get_forum_id() ) ) : ?>
45
 
 
 
46
  <span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
47
 
 
 
48
  <?php endif; ?>
49
 
50
  </p>
 
 
 
51
  </td>
52
 
53
  <td class="bbp-topic-voice-count"><?php bbp_topic_voice_count(); ?></td>
@@ -56,12 +74,20 @@
56
 
57
  <td class="bbp-topic-freshness">
58
 
 
 
59
  <?php bbp_topic_freshness_link(); ?>
60
 
 
 
61
  <p class="bbp-topic-meta">
62
 
 
 
63
  <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_topic_last_active_id(), 'size' => 14 ) ); ?></span>
64
 
 
 
65
  </p>
66
  </td>
67
 
@@ -71,16 +97,24 @@
71
 
72
  <td class="bbp-topic-action">
73
 
 
 
74
  <?php bbp_user_favorites_link( array( 'mid' => '+', 'post' => '' ), array( 'pre' => '', 'mid' => '&times;', 'post' => '' ) ); ?>
75
 
 
 
76
  </td>
77
 
78
  <?php elseif ( bbp_is_subscriptions() ) : ?>
79
 
80
  <td class="bbp-topic-action">
81
 
 
 
82
  <?php bbp_user_subscribe_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '&times;' ) ); ?>
83
 
 
 
84
  </td>
85
 
86
  <?php endif; ?>
33
  <tr id="topic-<?php bbp_topic_id(); ?>" <?php bbp_topic_class(); ?>>
34
 
35
  <td class="bbp-topic-title">
36
+
37
+ <?php do_action( 'bbp_theme_before_topic_title' ); ?>
38
+
39
  <a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a>
40
 
41
+ <?php do_action( 'bbp_theme_after_topic_title' ); ?>
42
+
43
  <?php bbp_topic_pagination(); ?>
44
 
45
+ <?php do_action( 'bbp_theme_before_topic_meta' ); ?>
46
+
47
  <p class="bbp-topic-meta">
48
 
49
+ <?php do_action( 'bbp_theme_before_topic_started_by' ); ?>
50
+
51
  <span class="bbp-topic-started-by"><?php printf( __( 'Started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) ) ); ?></span>
52
 
53
+ <?php do_action( 'bbp_theme_after_topic_started_by' ); ?>
54
+
55
  <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() != bbp_get_forum_id() ) ) : ?>
56
 
57
+ <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
58
+
59
  <span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
60
 
61
+ <?php do_action( 'bbp_theme_after_topic_started_in' ); ?>
62
+
63
  <?php endif; ?>
64
 
65
  </p>
66
+
67
+ <?php do_action( 'bbp_theme_after_topic_meta' ); ?>
68
+
69
  </td>
70
 
71
  <td class="bbp-topic-voice-count"><?php bbp_topic_voice_count(); ?></td>
74
 
75
  <td class="bbp-topic-freshness">
76
 
77
+ <?php do_action( 'bbp_theme_before_topic_freshness_link' ); ?>
78
+
79
  <?php bbp_topic_freshness_link(); ?>
80
 
81
+ <?php do_action( 'bbp_theme_after_topic_freshness_link' ); ?>
82
+
83
  <p class="bbp-topic-meta">
84
 
85
+ <?php do_action( 'bbp_theme_before_topic_freshness_author' ); ?>
86
+
87
  <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_topic_last_active_id(), 'size' => 14 ) ); ?></span>
88
 
89
+ <?php do_action( 'bbp_theme_after_topic_freshness_author' ); ?>
90
+
91
  </p>
92
  </td>
93
 
97
 
98
  <td class="bbp-topic-action">
99
 
100
+ <?php do_action( 'bbp_theme_before_topic_favorites_action' ); ?>
101
+
102
  <?php bbp_user_favorites_link( array( 'mid' => '+', 'post' => '' ), array( 'pre' => '', 'mid' => '&times;', 'post' => '' ) ); ?>
103
 
104
+ <?php do_action( 'bbp_theme_after_topic_favorites_action' ); ?>
105
+
106
  </td>
107
 
108
  <?php elseif ( bbp_is_subscriptions() ) : ?>
109
 
110
  <td class="bbp-topic-action">
111
 
112
+ <?php do_action( 'bbp_theme_before_topic_subscription_action' ); ?>
113
+
114
  <?php bbp_user_subscribe_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '&times;' ) ); ?>
115
 
116
+ <?php do_action( 'bbp_theme_after_topic_subscription_action' ); ?>
117
+
118
  </td>
119
 
120
  <?php endif; ?>
bbp-themes/bbp-twentyten/css/bbpress-rtl.css CHANGED
@@ -143,6 +143,7 @@ span.bbp-author-ip {
143
  #content tbody .bbp-reply-content {
144
  vertical-align: top;
145
  padding: 15px 15px 10px 10px;
 
146
  }
147
 
148
  #content .bbp-topic-content img,
143
  #content tbody .bbp-reply-content {
144
  vertical-align: top;
145
  padding: 15px 15px 10px 10px;
146
+ overflow: auto;
147
  }
148
 
149
  #content .bbp-topic-content img,
bbp-themes/bbp-twentyten/css/bbpress.css CHANGED
@@ -152,6 +152,7 @@ span.bbp-author-ip {
152
  #content tbody .bbp-reply-content {
153
  vertical-align: top;
154
  padding: 15px 10px 10px 15px;
 
155
  }
156
 
157
  #content .bbp-topic-content img,
152
  #content tbody .bbp-reply-content {
153
  vertical-align: top;
154
  padding: 15px 10px 10px 15px;
155
+ overflow: auto;
156
  }
157
 
158
  #content .bbp-topic-content img,
bbp-themes/bbp-twentyten/functions.php CHANGED
@@ -34,7 +34,7 @@ if ( !function_exists( 'bbp_twentyten_enqueue_styles' ) ) :
34
  */
35
  function bbp_twentyten_enqueue_styles () {
36
 
37
- $version = '20110807b';
38
 
39
  // Right to left
40
  if ( is_rtl() ) {
@@ -72,7 +72,7 @@ if ( !function_exists( 'bbp_twentyten_enqueue_scripts' ) ) :
72
  */
73
  function bbp_twentyten_enqueue_scripts () {
74
 
75
- $version = '20110807b';
76
 
77
  if ( bbp_is_single_topic() )
78
  wp_enqueue_script( 'bbp_topic', get_stylesheet_directory_uri() . '/js/topic.js', array( 'wp-lists' ), $version );
34
  */
35
  function bbp_twentyten_enqueue_styles () {
36
 
37
+ $version = '20110808b';
38
 
39
  // Right to left
40
  if ( is_rtl() ) {
72
  */
73
  function bbp_twentyten_enqueue_scripts () {
74
 
75
+ $version = '20110808b';
76
 
77
  if ( bbp_is_single_topic() )
78
  wp_enqueue_script( 'bbp_topic', get_stylesheet_directory_uri() . '/js/topic.js', array( 'wp-lists' ), $version );
bbpress.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: bbPress is forum software with a twist from the creators of WordPress.
16
  * Author: The bbPress Community
17
  * Author URI: http://bbpress.org
18
- * Version: 2.0-rc-2
19
  */
20
 
21
  // Exit if accessed directly
@@ -36,7 +36,12 @@ class bbPress {
36
  /**
37
  * @public string bbPress version
38
  */
39
- public $version = '2.0-rc-2';
 
 
 
 
 
40
 
41
  /** Post types ************************************************************/
42
 
@@ -409,6 +414,7 @@ class bbPress {
409
  require( $this->plugin_dir . 'bbp-includes/bbp-core-widgets.php' ); // Sidebar widgets
410
  require( $this->plugin_dir . 'bbp-includes/bbp-core-shortcodes.php' ); // Shortcodes for use with pages and posts
411
  require( $this->plugin_dir . 'bbp-includes/bbp-core-compatibility.php' ); // Theme compatibility for existing themes
 
412
 
413
  /** Extensions ********************************************************/
414
 
@@ -451,9 +457,13 @@ class bbPress {
451
  */
452
  private function setup_actions() {
453
 
454
- // Register bbPress activation/deactivation sequences
455
- register_activation_hook ( $this->file, 'bbp_activation' );
456
- register_deactivation_hook( $this->file, 'bbp_deactivation' );
 
 
 
 
457
 
458
  // Array of bbPress core actions
459
  $actions = array(
@@ -942,40 +952,4 @@ $GLOBALS['bbp'] = new bbPress();
942
 
943
  endif; // class_exists check
944
 
945
- /**
946
- * Runs on bbPress activation
947
- *
948
- * @since bbPress (r2509)
949
- *
950
- * @uses register_uninstall_hook() To register our own uninstall hook
951
- * @uses do_action() Calls 'bbp_activation' hook
952
- */
953
- function bbp_activation() {
954
- register_uninstall_hook( __FILE__, 'bbp_uninstall' );
955
-
956
- do_action( 'bbp_activation' );
957
- }
958
-
959
- /**
960
- * Runs on bbPress deactivation
961
- *
962
- * @since bbPress (r2509)
963
- *
964
- * @uses do_action() Calls 'bbp_deactivation' hook
965
- */
966
- function bbp_deactivation() {
967
- do_action( 'bbp_deactivation' );
968
- }
969
-
970
- /**
971
- * Runs when uninstalling bbPress
972
- *
973
- * @since bbPress (r2509)
974
- *
975
- * @uses do_action() Calls 'bbp_uninstall' hook
976
- */
977
- function bbp_uninstall() {
978
- do_action( 'bbp_uninstall' );
979
- }
980
-
981
  ?>
15
  * Description: bbPress is forum software with a twist from the creators of WordPress.
16
  * Author: The bbPress Community
17
  * Author URI: http://bbpress.org
18
+ * Version: 2.0-rc-3
19
  */
20
 
21
  // Exit if accessed directly
36
  /**
37
  * @public string bbPress version
38
  */
39
+ public $version = '2.0-rc-3';
40
+
41
+ /**
42
+ * @public string bbPress DB version
43
+ */
44
+ public $db_version = '155';
45
 
46
  /** Post types ************************************************************/
47
 
414
  require( $this->plugin_dir . 'bbp-includes/bbp-core-widgets.php' ); // Sidebar widgets
415
  require( $this->plugin_dir . 'bbp-includes/bbp-core-shortcodes.php' ); // Shortcodes for use with pages and posts
416
  require( $this->plugin_dir . 'bbp-includes/bbp-core-compatibility.php' ); // Theme compatibility for existing themes
417
+ require( $this->plugin_dir . 'bbp-includes/bbp-core-update.php' ); // Database updater
418
 
419
  /** Extensions ********************************************************/
420
 
457
  */
458
  private function setup_actions() {
459
 
460
+ // Add actions to plugin activation and deactivation hooks
461
+ add_action( 'activate_' . $this->basename, 'bbp_activation' );
462
+ add_action( 'deactivate_' . $this->basename, 'bbp_deactivation' );
463
+
464
+ // If bbPress is being deactivated, do not add any actions
465
+ if ( bbp_is_deactivation( $this->basename ) )
466
+ return;
467
 
468
  // Array of bbPress core actions
469
  $actions = array(
952
 
953
  endif; // class_exists check
954
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
  ?>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: matt, johnjamesjacoby
3
  Tags: bbpress, forums, discussion, post type, theme
4
  Requires at least: 3.2
5
  Tested up to: 3.2
6
- Stable tag: 2.0-rc-2
7
 
8
  bbPress is forum software with a twist from the creators of WordPress
9
 
@@ -24,6 +24,10 @@ We're keeping things as small and light as possible while still allowing for gre
24
 
25
  == Changelog ==
26
 
 
 
 
 
27
  = 2.0-rc-2 =
28
  * BuddyPress integration
29
  * Multisite integration
3
  Tags: bbpress, forums, discussion, post type, theme
4
  Requires at least: 3.2
5
  Tested up to: 3.2
6
+ Stable tag: 2.0-rc-3
7
 
8
  bbPress is forum software with a twist from the creators of WordPress
9
 
24
 
25
  == Changelog ==
26
 
27
+ = 2.0-rc-3 =
28
+ * Fixed activation/deactivation
29
+ * Added Forum Participant role for multisite use
30
+
31
  = 2.0-rc-2 =
32
  * BuddyPress integration
33
  * Multisite integration