bbPress - Version 2.0-beta-2b

Version Description

  • GlotPress integration
  • Fixes Forum archive bug
  • Fixes and improvements to importer
  • Adds home link support to breadcrumb
  • Improvements to Theme Compatibility
  • Numerous template and CSS improvements
  • RTL support
  • Improved multisite support
  • Add filters for future anti-spam support
  • Add missing breadcrumbs to various template files
  • Topic/reply trash fixes
Download this release

Release Info

Developer johnjamesjacoby
Plugin Icon 128x128 bbPress
Version 2.0-beta-2b
Comparing to
See all releases

Code changes from version 2.0-beta-1 to 2.0-beta-2b

Files changed (73) hide show
  1. bbp-admin/bbp-admin.php +74 -13
  2. bbp-admin/bbp-forums.php +1 -1
  3. bbp-admin/bbp-functions.php +6 -6
  4. bbp-admin/bbp-replies.php +1 -1
  5. bbp-admin/bbp-settings.php +76 -32
  6. bbp-admin/bbp-tools.php +1 -1
  7. bbp-admin/bbp-topics.php +1 -1
  8. bbp-admin/bbp-users.php +1 -1
  9. bbp-admin/importers/bbpress.php +150 -107
  10. bbp-includes/bbp-core-caps.php +1 -1
  11. bbp-includes/bbp-core-classes.php +1 -1
  12. bbp-includes/bbp-core-compatibility.php +22 -21
  13. bbp-includes/bbp-core-hooks.php +1 -1
  14. bbp-includes/bbp-core-loader.php +1 -1
  15. bbp-includes/bbp-core-options.php +25 -19
  16. bbp-includes/bbp-core-shortcodes.php +34 -12
  17. bbp-includes/bbp-core-widgets.php +1 -1
  18. bbp-includes/bbp-forum-functions.php +2 -2
  19. bbp-includes/bbp-forum-template.php +8 -3
  20. bbp-includes/bbp-general-functions.php +31 -23
  21. bbp-includes/bbp-general-template.php +78 -32
  22. bbp-includes/bbp-reply-functions.php +37 -2
  23. bbp-includes/bbp-reply-template.php +16 -15
  24. bbp-includes/bbp-topic-functions.php +32 -4
  25. bbp-includes/bbp-topic-template.php +5 -1
  26. bbp-includes/bbp-user-functions.php +10 -7
  27. bbp-includes/bbp-user-template.php +34 -67
  28. bbpress.pot → bbp-languages/bbpress.pot +0 -0
  29. bbp-themes/bbp-twentyten/archive-forum.php +12 -16
  30. bbp-themes/bbp-twentyten/archive-topic.php +1 -1
  31. bbp-themes/bbp-twentyten/bbpress/action-edit.php +1 -1
  32. bbp-themes/bbp-twentyten/bbpress/action-split-merge.php +1 -1
  33. bbp-themes/bbp-twentyten/bbpress/form-anonymous.php +1 -1
  34. bbp-themes/bbp-twentyten/bbpress/form-merge.php +3 -4
  35. bbp-themes/bbp-twentyten/bbpress/form-protected.php +1 -1
  36. bbp-themes/bbp-twentyten/bbpress/form-reply.php +19 -9
  37. bbp-themes/bbp-twentyten/bbpress/form-split.php +3 -5
  38. bbp-themes/bbp-twentyten/bbpress/form-topic-tag.php +10 -10
  39. bbp-themes/bbp-twentyten/bbpress/form-topic.php +26 -21
  40. bbp-themes/bbp-twentyten/bbpress/form-user-edit.php +5 -5
  41. bbp-themes/bbp-twentyten/bbpress/form-user-login.php +1 -1
  42. bbp-themes/bbp-twentyten/bbpress/form-user-lost-pass.php +1 -1
  43. bbp-themes/bbp-twentyten/bbpress/form-user-register.php +1 -1
  44. bbp-themes/bbp-twentyten/bbpress/loop-replies.php +9 -9
  45. bbp-themes/bbp-twentyten/bbpress/nav-breadcrumb.php +0 -14
  46. bbp-themes/bbp-twentyten/bbpress/single-forum.php +1 -1
  47. bbp-themes/bbp-twentyten/bbpress/single-topic.php +13 -10
  48. bbp-themes/bbp-twentyten/bbpress/user-details.php +15 -15
  49. bbp-themes/bbp-twentyten/bbpress/user-favorites.php +15 -15
  50. bbp-themes/bbp-twentyten/bbpress/user-posts.php +8 -8
  51. bbp-themes/bbp-twentyten/bbpress/user-subscriptions.php +19 -19
  52. bbp-themes/bbp-twentyten/bbpress/user-topics-created.php +15 -15
  53. bbp-themes/bbp-twentyten/bbpress/user.php +7 -1
  54. bbp-themes/bbp-twentyten/bbpress/view.php +2 -0
  55. bbp-themes/bbp-twentyten/css/bbpress-rtl.css +618 -0
  56. bbp-themes/bbp-twentyten/css/bbpress.css +53 -44
  57. bbp-themes/bbp-twentyten/functions.php +18 -4
  58. bbp-themes/bbp-twentyten/page-create-topic.php +1 -1
  59. bbp-themes/bbp-twentyten/page-front-topics.php +1 -1
  60. bbp-themes/bbp-twentyten/page-topic-tags.php +1 -1
  61. bbp-themes/bbp-twentyten/page-topics-no-replies.php +1 -1
  62. bbp-themes/bbp-twentyten/page-user-login.php +1 -1
  63. bbp-themes/bbp-twentyten/page-user-lost-pass.php +1 -1
  64. bbp-themes/bbp-twentyten/page-user-register.php +1 -1
  65. bbp-themes/bbp-twentyten/rtl.css +16 -0
  66. bbp-themes/bbp-twentyten/single-forum.php +1 -1
  67. bbp-themes/bbp-twentyten/single-reply.php +1 -1
  68. bbp-themes/bbp-twentyten/single-topic.php +4 -4
  69. bbp-themes/bbp-twentyten/style.css +3 -7
  70. bbp-themes/bbp-twentyten/taxonomy-topic-tag.php +2 -0
  71. bbpress.php +41 -12
  72. license.txt +2 -1
  73. readme.txt +41 -28
bbp-admin/bbp-admin.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Admin' ) ) :
@@ -237,15 +237,15 @@ class BBP_Admin {
237
  /** Front Slugs *******************************************************/
238
 
239
  // Add the per page section
240
- add_settings_section( 'bbp_root_slug', __( 'Archive Slugs', 'bbpress' ), 'bbp_admin_setting_callback_root_slug_section', 'bbpress' );
241
 
242
  // Root slug setting
243
- add_settings_field( '_bbp_root_slug', __( 'Forums Base', 'bbpress' ), 'bbp_admin_setting_callback_root_slug', 'bbpress', 'bbp_root_slug' );
244
- register_setting ( 'bbpress', '_bbp_root_slug', 'esc_sql' );
245
 
246
  // Topic archive setting
247
- add_settings_field( '_bbp_topic_archive_slug', __( 'Topics Base', 'bbpress' ), 'bbp_admin_setting_callback_topic_archive_slug', 'bbpress', 'bbp_root_slug' );
248
- register_setting ( 'bbpress', '_bbp_topic_archive_slug', 'esc_sql' );
249
 
250
  /** Single slugs ******************************************************/
251
 
@@ -442,11 +442,21 @@ class BBP_Admin {
442
  font-style: italic;
443
  font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
444
  padding: 5px 10px 15px;
 
 
 
 
 
 
 
 
 
 
 
445
  color: #777;
446
  font-size: 13px;
447
  position: absolute;
448
  top: -17px;
449
- left: 15px;
450
  }
451
 
452
  #bbp-dashboard-right-now .table {
@@ -456,13 +466,33 @@ class BBP_Admin {
456
  }
457
 
458
  #bbp-dashboard-right-now .table_content {
459
- float: left;
 
 
 
 
 
 
 
 
 
 
460
  border-top: #ececec 1px solid;
461
  width: 45%;
462
  }
463
 
464
  #bbp-dashboard-right-now .table_discussion {
465
- float: right;
 
 
 
 
 
 
 
 
 
 
466
  border-top: #ececec 1px solid;
467
  width: 45%;
468
  }
@@ -477,7 +507,17 @@ class BBP_Admin {
477
  }
478
 
479
  #bbp-dashboard-right-now td.b {
480
- padding-right: 6px;
 
 
 
 
 
 
 
 
 
 
481
  text-align: right;
482
  font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
483
  font-size: 14px;
@@ -494,7 +534,17 @@ class BBP_Admin {
494
 
495
  #bbp-dashboard-right-now .t {
496
  font-size: 12px;
497
- padding-right: 12px;
 
 
 
 
 
 
 
 
 
 
498
  padding-top: 6px;
499
  color: #777;
500
  }
@@ -525,8 +575,19 @@ class BBP_Admin {
525
  }
526
 
527
  #bbp-dashboard-right-now a.button {
528
- float: right;
529
- clear: right;
 
 
 
 
 
 
 
 
 
 
 
530
  position: relative;
531
  top: -5px;
532
  }
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Admin' ) ) :
237
  /** Front Slugs *******************************************************/
238
 
239
  // Add the per page section
240
+ add_settings_section( 'bbp_root_slug', __( 'Archive Slugs', 'bbpress' ), 'bbp_admin_setting_callback_root_slug_section', 'bbpress' );
241
 
242
  // Root slug setting
243
+ add_settings_field ( '_bbp_root_slug', __( 'Forums Base', 'bbpress' ), 'bbp_admin_setting_callback_root_slug', 'bbpress', 'bbp_root_slug' );
244
+ register_setting ( 'bbpress', '_bbp_root_slug', 'esc_sql' );
245
 
246
  // Topic archive setting
247
+ add_settings_field ( '_bbp_topic_archive_slug', __( 'Topics Base', 'bbpress' ), 'bbp_admin_setting_callback_topic_archive_slug', 'bbpress', 'bbp_root_slug' );
248
+ register_setting ( 'bbpress', '_bbp_topic_archive_slug', 'esc_sql' );
249
 
250
  /** Single slugs ******************************************************/
251
 
442
  font-style: italic;
443
  font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
444
  padding: 5px 10px 15px;
445
+
446
+ <?php if ( is_rtl() ) : ?>
447
+
448
+ right: 15px;
449
+
450
+ <?php else : ?>
451
+
452
+ left: 15px;
453
+
454
+ <?php endif; ?>
455
+
456
  color: #777;
457
  font-size: 13px;
458
  position: absolute;
459
  top: -17px;
 
460
  }
461
 
462
  #bbp-dashboard-right-now .table {
466
  }
467
 
468
  #bbp-dashboard-right-now .table_content {
469
+
470
+ <?php if ( is_rtl() ) : ?>
471
+
472
+ float: right;
473
+
474
+ <?php else : ?>
475
+
476
+ float: left;
477
+
478
+ <?php endif; ?>
479
+
480
  border-top: #ececec 1px solid;
481
  width: 45%;
482
  }
483
 
484
  #bbp-dashboard-right-now .table_discussion {
485
+
486
+ <?php if ( is_rtl() ) : ?>
487
+
488
+ float: left;
489
+
490
+ <?php else : ?>
491
+
492
+ float: right;
493
+
494
+ <?php endif; ?>
495
+
496
  border-top: #ececec 1px solid;
497
  width: 45%;
498
  }
507
  }
508
 
509
  #bbp-dashboard-right-now td.b {
510
+
511
+ <?php if ( is_rtl() ) : ?>
512
+
513
+ padding-left: 6px;
514
+
515
+ <?php else : ?>
516
+
517
+ padding-right: 6px;
518
+
519
+ <?php endif; ?>
520
+
521
  text-align: right;
522
  font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
523
  font-size: 14px;
534
 
535
  #bbp-dashboard-right-now .t {
536
  font-size: 12px;
537
+
538
+ <?php if ( is_rtl() ) : ?>
539
+
540
+ padding-left: 12px;
541
+
542
+ <?php else : ?>
543
+
544
+ padding-right: 12px;
545
+
546
+ <?php endif; ?>
547
+
548
  padding-top: 6px;
549
  color: #777;
550
  }
575
  }
576
 
577
  #bbp-dashboard-right-now a.button {
578
+
579
+ <?php if ( is_rtl() ) : ?>
580
+
581
+ float: left;
582
+ clear: left;
583
+
584
+ <?php else : ?>
585
+
586
+ float: right;
587
+ clear: right;
588
+
589
+ <?php endif; ?>
590
+
591
  position: relative;
592
  top: -5px;
593
  }
bbp-admin/bbp-forums.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Forums_Admin' ) ) :
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Forums_Admin' ) ) :
bbp-admin/bbp-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Admin Menus ***************************************************************/
@@ -858,15 +858,15 @@ function bbp_recount_rewalk() {
858
  return array( 9, sprintf( $statement, $result ) );
859
 
860
  // Forums need to know what their last active item is as well. Now it gets a bit more complex to do in the database.
861
- $forums = $wpdb->get_col( "SELECT `ID` FROM `$wpdb->posts` WHERE `post_type` = 'forum';" );
862
  if ( is_wp_error( $forums ) )
863
  return array( 10, sprintf( $statement, $result ) );
864
 
865
- foreach ( $forums as $forum ) {
866
- bbp_update_forum_last_active_id( $forum );
867
- bbp_update_forum_last_active_time( $forum );
868
- }
869
 
 
870
  $result = __( 'Complete!', 'bbpress' );
871
  return array( 0, sprintf( $statement, $result ) );
872
  }
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Admin Menus ***************************************************************/
858
  return array( 9, sprintf( $statement, $result ) );
859
 
860
  // Forums need to know what their last active item is as well. Now it gets a bit more complex to do in the database.
861
+ $forums = $wpdb->get_col( "SELECT `ID` FROM `$wpdb->posts` WHERE `post_type` = 'forum' and `post_status` != 'auto-draft';" );
862
  if ( is_wp_error( $forums ) )
863
  return array( 10, sprintf( $statement, $result ) );
864
 
865
+ // Loop through each forum and update them
866
+ foreach ( $forums as $forum_id )
867
+ bbp_update_forum( array( 'forum_id' => $forum_id ) );
 
868
 
869
+ // Complete results
870
  $result = __( 'Complete!', 'bbpress' );
871
  return array( 0, sprintf( $statement, $result ) );
872
  }
bbp-admin/bbp-replies.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Replies_Admin' ) ) :
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Replies_Admin' ) ) :
bbp-admin/bbp-settings.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Start Main Section ********************************************************/
@@ -30,12 +30,12 @@ function bbp_admin_setting_callback_main_section() {
30
  *
31
  * @since bbPress (r2737)
32
  *
33
- * @uses form_option() To output the option value
34
  */
35
  function bbp_admin_setting_callback_editlock() {
36
  ?>
37
 
38
- <input name="_bbp_edit_lock" type="text" id="_bbp_edit_lock" value="<?php form_option( '_bbp_edit_lock' ); ?>" class="small-text" />
39
  <label for="_bbp_edit_lock"><?php _e( 'minutes', 'bbpress' ); ?></label>
40
 
41
  <?php
@@ -46,12 +46,12 @@ function bbp_admin_setting_callback_editlock() {
46
  *
47
  * @since bbPress (r2737)
48
  *
49
- * @uses form_option() To output the option value
50
  */
51
  function bbp_admin_setting_callback_throttle() {
52
  ?>
53
 
54
- <input name="_bbp_throttle_time" type="text" id="_bbp_throttle_time" value="<?php form_option( '_bbp_throttle_time' ); ?>" class="small-text" />
55
  <label for="_bbp_throttle_time"><?php _e( 'seconds', 'bbpress' ); ?></label>
56
 
57
  <?php
@@ -67,7 +67,7 @@ function bbp_admin_setting_callback_throttle() {
67
  function bbp_admin_setting_callback_favorites() {
68
  ?>
69
 
70
- <input id="_bbp_enable_favorites" name="_bbp_enable_favorites" type="checkbox" id="_bbp_enable_favorites" value="1" <?php checked( true, bbp_is_favorites_active() ); ?> />
71
  <label for="_bbp_enable_favorites"><?php _e( 'Allow users to mark topics as favorites?', 'bbpress' ); ?></label>
72
 
73
  <?php
@@ -83,7 +83,7 @@ function bbp_admin_setting_callback_favorites() {
83
  function bbp_admin_setting_callback_subscriptions() {
84
  ?>
85
 
86
- <input id="_bbp_enable_subscriptions" name="_bbp_enable_subscriptions" type="checkbox" id="_bbp_enable_subscriptions" value="1" <?php checked( true, bbp_is_subscriptions_active() ); ?> />
87
  <label for="_bbp_enable_subscriptions"><?php _e( 'Allow users to subscribe to topics', 'bbpress' ); ?></label>
88
 
89
  <?php
@@ -99,7 +99,7 @@ function bbp_admin_setting_callback_subscriptions() {
99
  function bbp_admin_setting_callback_anonymous() {
100
  ?>
101
 
102
- <input id="_bbp_allow_anonymous" name="_bbp_allow_anonymous" type="checkbox" id="_bbp_allow_anonymous" value="1" <?php checked( true, bbp_allow_anonymous() ); ?> />
103
  <label for="_bbp_allow_anonymous"><?php _e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
104
 
105
  <?php
@@ -125,12 +125,12 @@ function bbp_admin_setting_callback_per_page_section() {
125
  *
126
  * @since bbPress (r2786)
127
  *
128
- * @uses form_option() To output the option value
129
  */
130
  function bbp_admin_setting_callback_topics_per_page() {
131
  ?>
132
 
133
- <input name="_bbp_topics_per_page" type="text" id="_bbp_topics_per_page" value="<?php form_option( '_bbp_topics_per_page' ); ?>" class="small-text" />
134
  <label for="_bbp_topics_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
135
 
136
  <?php
@@ -141,12 +141,12 @@ function bbp_admin_setting_callback_topics_per_page() {
141
  *
142
  * @since bbPress (r2786)
143
  *
144
- * @uses form_option() To output the option value
145
  */
146
  function bbp_admin_setting_callback_replies_per_page() {
147
  ?>
148
 
149
- <input name="_bbp_replies_per_page" type="text" id="_bbp_replies_per_page" value="<?php form_option( '_bbp_replies_per_page' ); ?>" class="small-text" />
150
  <label for="_bbp_replies_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
151
 
152
  <?php
@@ -172,12 +172,12 @@ function bbp_admin_setting_callback_per_rss_page_section() {
172
  *
173
  * @since bbPress (r2786)
174
  *
175
- * @uses form_option() To output the option value
176
  */
177
  function bbp_admin_setting_callback_topics_per_rss_page() {
178
  ?>
179
 
180
- <input name="_bbp_topics_per_rss_page" type="text" id="_bbp_topics_per_rss_page" value="<?php form_option( '_bbp_topics_per_rss_page' ); ?>" class="small-text" />
181
  <label for="_bbp_topics_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
182
 
183
  <?php
@@ -188,12 +188,12 @@ function bbp_admin_setting_callback_topics_per_rss_page() {
188
  *
189
  * @since bbPress (r2786)
190
  *
191
- * @uses form_option() To output the option value
192
  */
193
  function bbp_admin_setting_callback_replies_per_rss_page() {
194
  ?>
195
 
196
- <input name="_bbp_replies_per_rss_page" type="text" id="_bbp_replies_per_rss_page" value="<?php form_option( '_bbp_replies_per_rss_page' ); ?>" class="small-text" />
197
  <label for="_bbp_replies_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
198
 
199
  <?php
@@ -222,12 +222,12 @@ function bbp_admin_setting_callback_root_slug_section() {
222
  *
223
  * @since bbPress (r2786)
224
  *
225
- * @uses form_option() To output the option value
226
  */
227
  function bbp_admin_setting_callback_root_slug() {
228
  ?>
229
 
230
- <input name="_bbp_root_slug" type="text" id="_bbp_root_slug" class="regular-text code" value="<?php form_option( '_bbp_root_slug' ); ?>" />
231
 
232
  <?php
233
  }
@@ -237,12 +237,12 @@ function bbp_admin_setting_callback_root_slug() {
237
  *
238
  * @since bbPress (r2786)
239
  *
240
- * @uses form_option() To output the option value
241
  */
242
  function bbp_admin_setting_callback_topic_archive_slug() {
243
  ?>
244
 
245
- <input name="_bbp_topic_archive_slug" type="text" id="_bbp_topic_archive_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_archive_slug' ); ?>" />
246
 
247
  <?php
248
  }
@@ -286,12 +286,12 @@ function bbp_admin_setting_callback_include_root() {
286
  *
287
  * @since bbPress (r2786)
288
  *
289
- * @uses form_option() To output the option value
290
  */
291
  function bbp_admin_setting_callback_forum_slug() {
292
  ?>
293
 
294
- <input name="_bbp_forum_slug" type="text" id="_bbp_forum_slug" class="regular-text code" value="<?php form_option( '_bbp_forum_slug' ); ?>" />
295
 
296
  <?php
297
  }
@@ -301,12 +301,12 @@ function bbp_admin_setting_callback_forum_slug() {
301
  *
302
  * @since bbPress (r2786)
303
  *
304
- * @uses form_option() To output the option value
305
  */
306
  function bbp_admin_setting_callback_topic_slug() {
307
  ?>
308
 
309
- <input name="_bbp_topic_slug" type="text" id="_bbp_topic_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_slug' ); ?>" />
310
 
311
  <?php
312
  }
@@ -316,12 +316,12 @@ function bbp_admin_setting_callback_topic_slug() {
316
  *
317
  * @since bbPress (r2786)
318
  *
319
- * @uses form_option() To output the option value
320
  */
321
  function bbp_admin_setting_callback_reply_slug() {
322
  ?>
323
 
324
- <input name="_bbp_reply_slug" type="text" id="_bbp_reply_slug" class="regular-text code" value="<?php form_option( '_bbp_reply_slug' ); ?>" />
325
 
326
  <?php
327
  }
@@ -331,12 +331,12 @@ function bbp_admin_setting_callback_reply_slug() {
331
  *
332
  * @since bbPress (r2786)
333
  *
334
- * @uses form_option() To output the option value
335
  */
336
  function bbp_admin_setting_callback_topic_tag_slug() {
337
  ?>
338
 
339
- <input name="_bbp_topic_tag_slug" type="text" id="_bbp_topic_tag_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_tag_slug' ); ?>" />
340
 
341
  <?php
342
  }
@@ -348,12 +348,12 @@ function bbp_admin_setting_callback_topic_tag_slug() {
348
  *
349
  * @since bbPress (r2786)
350
  *
351
- * @uses form_option() To output the option value
352
  */
353
  function bbp_admin_setting_callback_user_slug() {
354
  ?>
355
 
356
- <input name="_bbp_user_slug" type="text" id="_bbp_user_slug" class="regular-text code" value="<?php form_option( '_bbp_user_slug' ); ?>" />
357
 
358
  <?php
359
  }
@@ -363,12 +363,12 @@ function bbp_admin_setting_callback_user_slug() {
363
  *
364
  * @since bbPress (r2789)
365
  *
366
- * @uses form_option() To output the option value
367
  */
368
  function bbp_admin_setting_callback_view_slug() {
369
  ?>
370
 
371
- <input name="_bbp_view_slug" type="text" id="_bbp_view_slug" class="regular-text code" value="<?php form_option( '_bbp_view_slug' ); ?>" />
372
 
373
  <?php
374
  }
@@ -447,4 +447,48 @@ function bbp_admin_settings_help() {
447
  add_contextual_help( 'settings_page_bbpress', $contextual_help );
448
  }
449
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  ?>
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Start Main Section ********************************************************/
30
  *
31
  * @since bbPress (r2737)
32
  *
33
+ * @uses bbp_form_option() To output the option value
34
  */
35
  function bbp_admin_setting_callback_editlock() {
36
  ?>
37
 
38
+ <input name="_bbp_edit_lock" type="text" id="_bbp_edit_lock" value="<?php bbp_form_option( '_bbp_edit_lock', '5' ); ?>" class="small-text" />
39
  <label for="_bbp_edit_lock"><?php _e( 'minutes', 'bbpress' ); ?></label>
40
 
41
  <?php
46
  *
47
  * @since bbPress (r2737)
48
  *
49
+ * @uses bbp_form_option() To output the option value
50
  */
51
  function bbp_admin_setting_callback_throttle() {
52
  ?>
53
 
54
+ <input name="_bbp_throttle_time" type="text" id="_bbp_throttle_time" value="<?php bbp_form_option( '_bbp_throttle_time', '10' ); ?>" class="small-text" />
55
  <label for="_bbp_throttle_time"><?php _e( 'seconds', 'bbpress' ); ?></label>
56
 
57
  <?php
67
  function bbp_admin_setting_callback_favorites() {
68
  ?>
69
 
70
+ <input id="_bbp_enable_favorites" name="_bbp_enable_favorites" type="checkbox" id="_bbp_enable_favorites" value="1" <?php checked( true, bbp_is_favorites_active( true ) ); ?> />
71
  <label for="_bbp_enable_favorites"><?php _e( 'Allow users to mark topics as favorites?', 'bbpress' ); ?></label>
72
 
73
  <?php
83
  function bbp_admin_setting_callback_subscriptions() {
84
  ?>
85
 
86
+ <input id="_bbp_enable_subscriptions" name="_bbp_enable_subscriptions" type="checkbox" id="_bbp_enable_subscriptions" value="1" <?php checked( true, bbp_is_subscriptions_active( true ) ); ?> />
87
  <label for="_bbp_enable_subscriptions"><?php _e( 'Allow users to subscribe to topics', 'bbpress' ); ?></label>
88
 
89
  <?php
99
  function bbp_admin_setting_callback_anonymous() {
100
  ?>
101
 
102
+ <input id="_bbp_allow_anonymous" name="_bbp_allow_anonymous" type="checkbox" id="_bbp_allow_anonymous" value="1" <?php checked( true, bbp_allow_anonymous( false ) ); ?> />
103
  <label for="_bbp_allow_anonymous"><?php _e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
104
 
105
  <?php
125
  *
126
  * @since bbPress (r2786)
127
  *
128
+ * @uses bbp_form_option() To output the option value
129
  */
130
  function bbp_admin_setting_callback_topics_per_page() {
131
  ?>
132
 
133
+ <input name="_bbp_topics_per_page" type="text" id="_bbp_topics_per_page" value="<?php bbp_form_option( '_bbp_topics_per_page', '15' ); ?>" class="small-text" />
134
  <label for="_bbp_topics_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
135
 
136
  <?php
141
  *
142
  * @since bbPress (r2786)
143
  *
144
+ * @uses bbp_form_option() To output the option value
145
  */
146
  function bbp_admin_setting_callback_replies_per_page() {
147
  ?>
148
 
149
+ <input name="_bbp_replies_per_page" type="text" id="_bbp_replies_per_page" value="<?php bbp_form_option( '_bbp_replies_per_page', '15' ); ?>" class="small-text" />
150
  <label for="_bbp_replies_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
151
 
152
  <?php
172
  *
173
  * @since bbPress (r2786)
174
  *
175
+ * @uses bbp_form_option() To output the option value
176
  */
177
  function bbp_admin_setting_callback_topics_per_rss_page() {
178
  ?>
179
 
180
+ <input name="_bbp_topics_per_rss_page" type="text" id="_bbp_topics_per_rss_page" value="<?php bbp_form_option( '_bbp_topics_per_rss_page', '25' ); ?>" class="small-text" />
181
  <label for="_bbp_topics_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
182
 
183
  <?php
188
  *
189
  * @since bbPress (r2786)
190
  *
191
+ * @uses bbp_form_option() To output the option value
192
  */
193
  function bbp_admin_setting_callback_replies_per_rss_page() {
194
  ?>
195
 
196
+ <input name="_bbp_replies_per_rss_page" type="text" id="_bbp_replies_per_rss_page" value="<?php bbp_form_option( '_bbp_replies_per_rss_page', '25' ); ?>" class="small-text" />
197
  <label for="_bbp_replies_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
198
 
199
  <?php
222
  *
223
  * @since bbPress (r2786)
224
  *
225
+ * @uses bbp_form_option() To output the option value
226
  */
227
  function bbp_admin_setting_callback_root_slug() {
228
  ?>
229
 
230
+ <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 ); ?>" />
231
 
232
  <?php
233
  }
237
  *
238
  * @since bbPress (r2786)
239
  *
240
+ * @uses bbp_form_option() To output the option value
241
  */
242
  function bbp_admin_setting_callback_topic_archive_slug() {
243
  ?>
244
 
245
+ <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 ); ?>" />
246
 
247
  <?php
248
  }
286
  *
287
  * @since bbPress (r2786)
288
  *
289
+ * @uses bbp_form_option() To output the option value
290
  */
291
  function bbp_admin_setting_callback_forum_slug() {
292
  ?>
293
 
294
+ <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 ); ?>" />
295
 
296
  <?php
297
  }
301
  *
302
  * @since bbPress (r2786)
303
  *
304
+ * @uses bbp_form_option() To output the option value
305
  */
306
  function bbp_admin_setting_callback_topic_slug() {
307
  ?>
308
 
309
+ <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 ); ?>" />
310
 
311
  <?php
312
  }
316
  *
317
  * @since bbPress (r2786)
318
  *
319
+ * @uses bbp_form_option() To output the option value
320
  */
321
  function bbp_admin_setting_callback_reply_slug() {
322
  ?>
323
 
324
+ <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 ); ?>" />
325
 
326
  <?php
327
  }
331
  *
332
  * @since bbPress (r2786)
333
  *
334
+ * @uses bbp_form_option() To output the option value
335
  */
336
  function bbp_admin_setting_callback_topic_tag_slug() {
337
  ?>
338
 
339
+ <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', 'tag', true ); ?>" />
340
 
341
  <?php
342
  }
348
  *
349
  * @since bbPress (r2786)
350
  *
351
+ * @uses bbp_form_option() To output the option value
352
  */
353
  function bbp_admin_setting_callback_user_slug() {
354
  ?>
355
 
356
+ <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 ); ?>" />
357
 
358
  <?php
359
  }
363
  *
364
  * @since bbPress (r2789)
365
  *
366
+ * @uses bbp_form_option() To output the option value
367
  */
368
  function bbp_admin_setting_callback_view_slug() {
369
  ?>
370
 
371
+ <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 ); ?>" />
372
 
373
  <?php
374
  }
447
  add_contextual_help( 'settings_page_bbpress', $contextual_help );
448
  }
449
 
450
+ /**
451
+ * Output settings API option
452
+ *
453
+ * @since bbPress (r3203)
454
+ *
455
+ * @uses bbp_get_bbp_form_option()
456
+ *
457
+ * @param string $option
458
+ * @param string $default
459
+ * @param bool $slug
460
+ */
461
+ function bbp_form_option( $option, $default = '' , $slug = false ) {
462
+ echo bbp_get_form_option( $option, $default, $slug );
463
+ }
464
+ /**
465
+ * Return settings API option
466
+ *
467
+ * @since bbPress (r3203)
468
+ *
469
+ * @uses get_option()
470
+ * @uses esc_attr()
471
+ * @uses apply_filters()
472
+ *
473
+ * @param string $option
474
+ * @param string $default
475
+ * @param bool $slug
476
+ */
477
+ function bbp_get_form_option( $option, $default = '', $slug = false ) {
478
+
479
+ // Get the option and sanitize it
480
+ $value = get_option( $option, $default );
481
+
482
+ // Slug?
483
+ if ( true === $slug )
484
+ $value = esc_attr( apply_filters( 'editable_slug', $value ) );
485
+
486
+ // Not a slug
487
+ else
488
+ $value = esc_attr( $value );
489
+
490
+ // Allow plugins to further filter the output
491
+ return apply_filters( 'bbp_get_form_option', $value, $option );
492
+ }
493
+
494
  ?>
bbp-admin/bbp-tools.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
bbp-admin/bbp-topics.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Topics_Admin' ) ) :
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Topics_Admin' ) ) :
bbp-admin/bbp-users.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Administration
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Users_Admin' ) ) :
7
  * @subpackage Administration
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Users_Admin' ) ) :
bbp-admin/importers/bbpress.php CHANGED
@@ -100,7 +100,7 @@ class BPDB extends WPDB {
100
  endif; // class_exists
101
 
102
  if ( !function_exists( 'bb_cache_users' ) ) :
103
- function bb_cache_users( $users ) {}
104
  endif;
105
 
106
  /**
@@ -116,43 +116,40 @@ endif;
116
  * @todo Role Mapping Options
117
  */
118
  class bbPress_Importer {
119
- /**
120
- * @var string Path to bbPress standalone
121
- */
122
- var $bb_path = '';
123
 
124
  /**
125
- * @var bool Are we debugging?
126
  */
127
- var $debug = false;
128
 
129
  /**
130
  * Load the bbPress environment
131
  */
132
  function load_bbpress() {
 
 
 
 
 
 
 
 
 
133
  global $wpdb, $wp_roles, $current_user, $wp_users_object, $wp_taxonomy_object;
134
  global $bb, $bbdb, $bb_table_prefix, $bb_current_user, $bb_roles, $bb_queries;
135
 
136
- /* Return if we've already run this function. */
137
  if ( is_object( $bbdb ) )
138
  return;
139
 
140
- if ( !file_exists( $this->bb_path ) )
 
141
  return false;
142
 
143
- // BuddyPress install
144
- if ( defined( 'BP_VERSION' ) ) {
145
- define( 'BB_PATH', BP_PLUGIN_DIR . '/bp-forums/bbpress/' );
146
- define( 'BACKPRESS_PATH', BP_PLUGIN_DIR . '/bp-forums/bbpress/bb-includes/backpress/' );
147
- define( 'BB_URL', BP_PLUGIN_URL . '/bp-forums/bbpress/' );
148
- define( 'BB_INC', 'bb-includes/' );
149
-
150
- // Normal existing install
151
- } else {
152
- define( 'BB_PATH', trailingslashit( dirname( $this->bb_path ) ) );
153
- define( 'BACKPRESS_PATH', BB_PATH . 'bb-includes/backpress/' );
154
- define( 'BB_INC', 'bb-includes/' );
155
- }
156
 
157
  require_once( BB_PATH . BB_INC . 'class.bb-query.php' );
158
  require_once( BB_PATH . BB_INC . 'class.bb-walker.php' );
@@ -171,12 +168,12 @@ class bbPress_Importer {
171
  require_once( BB_PATH . BB_INC . 'class.bb-taxonomy.php' );
172
 
173
  $bb = new stdClass();
174
- require_once( $this->bb_path );
175
 
176
  // Setup the global database connection
177
  $bbdb = new BPDB( BBDB_USER, BBDB_PASSWORD, BBDB_NAME, BBDB_HOST );
178
 
179
- /* Set the table names */
180
  $bbdb->forums = $bb_table_prefix . 'forums';
181
  $bbdb->meta = $bb_table_prefix . 'meta';
182
  $bbdb->posts = $bb_table_prefix . 'posts';
@@ -185,32 +182,40 @@ class bbPress_Importer {
185
  $bbdb->term_taxonomy = $bb_table_prefix . 'term_taxonomy';
186
  $bbdb->topics = $bb_table_prefix . 'topics';
187
 
 
188
  if ( isset( $bb->custom_user_table ) )
189
  $bbdb->users = $bb->custom_user_table;
190
  else
191
  $bbdb->users = $bb_table_prefix . 'users';
192
 
 
193
  if ( isset( $bb->custom_user_meta_table ) )
194
  $bbdb->usermeta = $bb->custom_user_meta_table;
195
  else
196
  $bbdb->usermeta = $bb_table_prefix . 'usermeta';
197
 
198
- $bbdb->prefix = $bb_table_prefix;
 
199
 
 
200
  define( 'BB_INSTALLING', false );
201
 
 
202
  if ( is_object( $wp_roles ) ) {
203
  $bb_roles = $wp_roles;
204
  bb_init_roles( $bb_roles );
205
  }
206
 
 
207
  do_action( 'bb_got_roles' );
208
  do_action( 'bb_init' );
209
  do_action( 'init_roles' );
210
 
 
211
  $bb_current_user = $current_user;
212
  $wp_users_object = new bbPress_Importer_BB_Auth;
213
 
 
214
  if ( !isset( $wp_taxonomy_object ) )
215
  $wp_taxonomy_object = new BB_Taxonomy( $bbdb );
216
 
@@ -243,27 +248,39 @@ class bbPress_Importer {
243
  *
244
  * @return string Path, if found
245
  */
246
- function autolocate_bb_path() {
 
 
 
 
247
 
248
- $path = '';
249
- $dirs = array( '', 'forum', 'forums', 'board', 'discussion', 'bb', 'bbpress' );
 
 
 
 
250
  $base = trailingslashit( ABSPATH );
251
  $base_dirs = array( $base, dirname( $base ) );
252
 
 
253
  foreach ( $dirs as $dir ) {
254
 
 
255
  foreach ( $base_dirs as $base_dir ) {
 
 
256
  $test_path = $base_dir . $dir . '/bb-config.php';
257
 
 
258
  if ( file_exists( $test_path ) ) {
259
- $path = $test_path;
260
- break;
261
  }
262
  }
263
-
264
  }
265
 
266
- return $path;
 
267
  }
268
 
269
  /**
@@ -414,9 +431,8 @@ class bbPress_Importer {
414
  function greet() {
415
  global $wpdb, $bbdb;
416
 
417
- $autolocate = $this->autolocate_bb_path();
418
-
419
- ?>
420
 
421
  <div class="narrow">
422
 
@@ -466,10 +482,10 @@ class bbPress_Importer {
466
  <li><?php _e( 'Notes on compatibility:', 'bbpress' ); ?>
467
  <ol>
468
  <li>
469
- <?php printf( __( 'If you have the <a href="%s">Subscribe to Topic</a> plugin active, please deactivate it. This script will migrate user subscriptions from that plugin.', 'bbpress' ), 'http://bbpress.org/plugins/topic/subscribe-to-topic/' ); ?>
470
  </li>
471
  <li>
472
- <?php _e( 'If you are using the alpha version of bbPress 1.1 subscriptions will be ported automatically.', 'bbpress' ); ?>
473
  </li>
474
  <li>
475
  <?php printf( __( 'If you are importing an existing BuddyPress Forums installation, we should have found your previous configuration file.', 'bbpress' ), 'http://bbpress.org/plugins/topic/subscribe-to-topic/' ); ?>
@@ -480,15 +496,13 @@ class bbPress_Importer {
480
  </ol>
481
 
482
  <h3><?php _e( 'Configuration', 'bbpress' ); ?></h3>
483
- <p><?php _e( 'Enter the path to your bbPress standalone install, where you\'d find your <code>bb-config.php</code>:', 'bbpress' ); ?></p>
484
 
485
  <table class="form-table">
486
-
487
  <tr>
488
  <th scope="row"><label for="bbp_bbpress_path"><?php _e( 'bbPress Standalone Path:', 'bbpress' ); ?></label></th>
489
- <td><input type="text" name="bbp_bbpress_path" id="bbp_bbpress_path" class="regular-text" value="<?php echo $autolocate; ?>" /></td>
490
  </tr>
491
-
492
  </table>
493
 
494
  <p class="submit">
@@ -521,17 +535,23 @@ class bbPress_Importer {
521
  * @return type
522
  */
523
  function setup() {
524
- // Get details from form or from DB
 
525
  if ( !empty( $_POST['bbp_bbpress_path'] ) ) {
 
526
  // Store details for later
527
- $this->bb_path = $_POST['bbp_bbpress_path'];
 
 
 
528
 
529
- update_option( 'bbp_bbpress_path', $this->bb_path );
530
  } else {
531
- $this->bb_path = get_option( 'bbp_bbpress_path' );
532
  }
533
 
534
- if ( empty( $this->bb_path ) ) { ?>
 
535
 
536
  <p><?php _e( 'Please enter the path to your bbPress configuration file - <code>bb-config.php</code>.', 'bbpress' ); ?></p>
537
  <p><a href="<?php echo esc_url( add_query_arg( array( 'import' => 'bbpress', 'step' => '-1', '_wpnonce' => wp_create_nonce( 'bbp-bbpress-import' ), '_wp_http_referer' => esc_attr( remove_query_arg( 'step', $_SERVER['REQUEST_URI'] ) ) ) ) ); ?>" class="button"><?php _e( 'Go Back', 'bbpress' ); ?></a></p>
@@ -542,19 +562,21 @@ class bbPress_Importer {
542
  }
543
 
544
  // Check if the user submitted a directory as the path by mistake
545
- if ( is_dir( $this->bb_path ) && file_exists( trailingslashit( $this->bb_path ) . 'bb-config.php' ) ) {
546
- $this->bb_path = trailingslashit( $this->bb_path ) . 'bb-config.php';
547
  }
548
 
549
  // Check if the file exists
550
- if ( !file_exists( $this->bb_path ) || is_dir( $this->bb_path ) ) {
551
 
552
  delete_option( 'bbp_bbpress_path' ); ?>
553
 
554
- <p><?php _e( 'bbPress configuration file <code>bb-config.php</code> doesn\'t exist in the path specified! Please check the path and try again.', 'bbpress' ); ?></p>
555
- <p><a href="<?php echo esc_url( add_query_arg( array( 'import' => 'bbpress', 'step' => '-1', '_wpnonce' => wp_create_nonce( 'bbp-bbpress-import' ), '_wp_http_referer' => esc_attr( remove_query_arg( 'step', $_SERVER['REQUEST_URI'] ) ) ) ) ); ?>" class="button"><?php _e( 'Go Back', 'bbpress' ); ?></a></p>
556
- <?php
557
- return false;
 
 
558
  }
559
 
560
  $this->load_bbpress();
@@ -598,8 +620,8 @@ class bbPress_Importer {
598
  <li>
599
  <?php _e( 'Your WordPress blog is <strong>new</strong> and you don\'t have the fear of losing WordPress users:', 'bbpress' ); ?>
600
  <label for="step_user"><?php _e( 'Go to migrating users section.', 'bbpress' ); ?></label>
601
- <?php printf( __( '<strong>Note</strong>: The WordPress %1$s and %2$s tables would be renamed, but not deleted so that you could restore them if something goes wrong.', 'bbpress' ), $wpdb->users, $wpdb->usermeta ); ?>
602
- <?php printf( __( 'Please ensure there are no tables with names %1$s and %2$s so that there is no problem in renaming.', 'bbpress' ), $bbdb->prefix . $wpdb->users . '_tmp', $bbdb->prefix . $wpdb->usermeta . '_tmp' ); ?>
603
  <?php _e( 'Also, your WordPress and bbPress installs must be in the same database.', 'bbpress' ); ?>
604
  </li>
605
 
@@ -611,14 +633,14 @@ class bbPress_Importer {
611
  <li>
612
  <?php _e( 'You have a well <strong>established</strong> WordPress user base, the user tables are not integrated and you can\'t lose your users:', 'bbpress' ); ?>
613
  <?php _e( 'This is currently not yet supported, and will likely not be in the future also as it is highly complex to merge two user sets (which might even conflict).', 'bbpress' ); ?>
614
- <?php printf( __( 'But, patches are always <a href="%s" title="The last revision containing the custom user migration code">welcome</a>. :)', 'bbpress' ), 'http://code.google.com/p/bbpress-standalone-to-plugin/source/browse/trunk/bbs2p.php?spec=svn13&r=13' ); ?>
615
  </li>
616
 
617
  </ol>
618
 
619
  <?php endif; ?>
620
 
621
- <input type="radio" name="step" <?php if ( $this->is_integrated() ) : ?>disabled="disabled"<?php endif;?> value="2"<?php checked( $radio, 'user' ); ?> id="step_user" />
622
  <label for="step_user"><?php _e( 'Migrate Users', 'bbpress' ); ?></label>
623
 
624
  <input type="radio" name="step" value="3"<?php checked( $radio, 'board' ); ?> id="step_board" />
@@ -667,41 +689,58 @@ class bbPress_Importer {
667
 
668
  <ol>
669
 
670
- <?php
671
 
672
- // Drop the old temp tables while debugging
673
- if ( $this->debug == true )
674
- $wpdb->query( "DROP TABLE IF EXISTS {$bbdb->prefix}{$wpdb->users}_tmp, {$bbdb->prefix}{$wpdb->usermeta}_tmp" );
675
 
676
- // Rename the WordPress users and usermeta table
 
 
 
677
 
678
- ?>
679
 
680
- <li>
681
  <?php
682
- if ( $wpdb->query( "RENAME TABLE $wpdb->users TO {$bbdb->prefix}{$wpdb->users}_tmp, $wpdb->usermeta TO {$bbdb->prefix}{$wpdb->usermeta}_tmp" ) !== false ) : ?>
683
- <?php printf( __( 'Renamed the <code>%1$s</code> and <code>%2$s</code> tables to <code>%3$s</code> and <code>%4$s</code> respectively.', 'bbpress' ), $wpdb->users, $wpdb->usermeta, $bbdb->prefix . $wpdb->users . '_tmp', $bbdb->prefix . $wpdb->usermeta . '_tmp' ); ?>
684
- <?php else : ?>
685
- <?php printf( __( 'There was a problem dropping the <code>%1$s</code> and <code>%2$s</code> tables. Please check and re-run the script or rename or drop the tables yourself.', 'bbpress' ), $wpdb->users, $wpdb->usermeta ); ?></li></ol>
686
- <?php break; endif; ?>
687
  </li>
688
 
689
  <?php /* Duplicate the WordPress users and usermeta table */ ?>
690
 
691
  <li>
692
- <?php if ( $wpdb->query( "CREATE TABLE $wpdb->users ( `ID` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `user_activation_key` VARCHAR( 60 ) NOT NULL DEFAULT '', KEY ( `user_login` ), KEY( `user_nicename` ) ) SELECT * FROM $bbdb->users ORDER BY `ID`" ) !== false ) : ?>
693
- <?php printf( __( 'Created the <code>%s</code> table and copied the users from bbPress.', 'bbpress' ), $wpdb->users ); ?>
694
- <?php else : ?>
695
- <?php printf( __( 'There was a problem duplicating the table <code>%1$s</code> to <code>%2$s</code>. Please check and re-run the script or duplicate the table yourself.', 'bbpress' ), $bbdb->users, $wpdb->users ); ?></li></ol>
696
- <?php break; endif; ?>
 
 
 
 
 
 
 
 
 
697
  </li>
698
 
699
  <li>
700
- <?php if ( $wpdb->query( "CREATE TABLE $wpdb->usermeta ( `umeta_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, KEY ( `user_id` ), KEY( `meta_key` ) ) SELECT * FROM $bbdb->usermeta ORDER BY `umeta_id`" ) !== false ) : ?>
701
- <?php printf( __( 'Created the <code>%s</code> table and copied the user information from bbPress.', 'bbpress' ), $wpdb->usermeta ); ?>
702
- <?php else : ?>
703
- <?php printf( __( 'There was a problem duplicating the table <code>%1$s</code> to <code>%2$s</code>. Please check and re-run the script or duplicate the table yourself.', 'bbpress' ), $bbdb->usermeta, $wpdb->usermeta ); ?></li></ol>
704
- <?php break; endif; ?>
 
 
 
 
 
 
 
 
 
705
  </li>
706
 
707
  <?php
@@ -733,24 +772,26 @@ class bbPress_Importer {
733
  foreach ( $users as $user ) {
734
 
735
  // Get the bbPress roles
736
- $bb_roles =& $user->{ $bbdb->prefix . 'capabilities' };
737
  $converted_roles = $converted_level = array();
738
 
739
  // Loop through each role the user has
740
- foreach ( $bb_roles as $bb_role => $bb_role_value ) {
 
741
 
742
- // If we have one of those in our roles map, add the WP counterpart in the new roles array
743
- if ( $roles_map[strtolower( $bb_role )] && !empty( $bb_role_value ) ) {
744
- $converted_roles[$roles_map[strtolower( $bb_role )]] = true;
745
 
746
- // Have support for deprecated levels too
747
- $converted_level[] = $wp_user_level_map[$roles_map[strtolower( $bb_role )]];
748
 
749
- // We need an admin for future use
750
- if ( empty( $admin_user ) && 'administrator' == $roles_map[strtolower( $bb_role )] )
751
- $admin_user = $user;
752
- }
753
 
 
754
  }
755
 
756
  // If we have new roles, then update the user meta
@@ -771,7 +812,7 @@ class bbPress_Importer {
771
 
772
  <?php
773
 
774
- break;
775
 
776
  endif;
777
 
@@ -795,7 +836,7 @@ class bbPress_Importer {
795
  <p><?php _e( 'Your users have all been imported, but wait &#8211; there&#8217;s more! Now we need to import your forums, topics and posts!', 'bbpress' ); ?></p>
796
  <?php
797
 
798
- echo $this->next_step( 3, __( 'Import by forums, topics and posts &raquo;', 'bbpress' ) ); ?>
799
 
800
  </div>
801
 
@@ -832,11 +873,10 @@ class bbPress_Importer {
832
 
833
  if ( !$forums = bb_get_forums() ) {
834
  echo "<li><strong>" . __( 'No forums were found!', 'bbpress' ) . "</strong></li></ol>\n";
835
- break;
836
  }
837
 
838
- if ( $this->debug == true )
839
- echo "<li>" . sprintf( __( 'Total number of forums: %s', 'bbpress' ), count( $forums ) ) . "</li>\n";
840
 
841
  $forum_map = array();
842
  $post_statuses = array( 'publish', $bbp->trash_status_id, $bbp->spam_status_id );
@@ -871,7 +911,9 @@ class bbPress_Importer {
871
  $topics_query = new BB_Query( 'topic', array(
872
  'forum_id' => $forum->forum_id,
873
  'per_page' => -1,
874
- 'topic_status' => 'all'
 
 
875
  ) );
876
 
877
  $topics = $topics_query->results;
@@ -895,8 +937,7 @@ class bbPress_Importer {
895
 
896
  bb_cache_first_posts( $topics );
897
 
898
- if ( $this->debug == true )
899
- echo "<li>" . sprintf( __( 'Total number of topics in the forum: %s', 'bbpress' ), count( $topics ) ) . "</li>\n";
900
 
901
  foreach ( (array) $topics as $topic ) {
902
  $first_post = bb_get_first_post( $topic->topic_id );
@@ -989,10 +1030,10 @@ class bbPress_Importer {
989
  bbp_update_reply_walker( $last_reply );
990
  }
991
 
992
- $replies++;
993
-
994
  if ( $post->post_status != 0 )
995
  $hidden_replies++;
 
 
996
  }
997
 
998
  // Only add favorites and subscriptions if the topic is public
@@ -1021,15 +1062,17 @@ class bbPress_Importer {
1021
  break;
1022
  }
1023
 
1024
- // Last active time
1025
- $last_active = $post ? $post->post_time : $first_post->post_time;
 
1026
 
1027
  // Reply topic meta
1028
- update_post_meta( $inserted_topic, '_bbp_last_reply_id', $last_reply );
1029
- update_post_meta( $inserted_topic, '_bbp_last_active_id', $last_reply ? $last_reply : $inserted_topic );
1030
- update_post_meta( $inserted_topic, '_bbp_last_active_time', $topic->topic_time );
1031
- update_post_meta( $inserted_topic, '_bbp_reply_count', $replies - $hidden_replies );
1032
- update_post_meta( $inserted_topic, '_bbp_hidden_reply_count', $hidden_replies );
 
1033
  // Voices will be done by recount
1034
 
1035
  bbp_update_topic_walker( $inserted_topic );
100
  endif; // class_exists
101
 
102
  if ( !function_exists( 'bb_cache_users' ) ) :
103
+ function bb_cache_users( $users ) { }
104
  endif;
105
 
106
  /**
116
  * @todo Role Mapping Options
117
  */
118
  class bbPress_Importer {
 
 
 
 
119
 
120
  /**
121
+ * @var string Path to bbPress standalone configuration file (bb-config.php)
122
  */
123
+ var $bbconfig = '';
124
 
125
  /**
126
  * Load the bbPress environment
127
  */
128
  function load_bbpress() {
129
+
130
+ // BuddyPress Install
131
+ if ( defined( 'BP_VERSION' ) && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) {
132
+ global $bp;
133
+
134
+ if ( !empty( $bp->forums->bbconfig ) && ( $bp->forums->bbconfig == $this->bbconfig ) )
135
+ bp_forums_load_bbpress();
136
+ }
137
+
138
  global $wpdb, $wp_roles, $current_user, $wp_users_object, $wp_taxonomy_object;
139
  global $bb, $bbdb, $bb_table_prefix, $bb_current_user, $bb_roles, $bb_queries;
140
 
141
+ // Return if we've already run this function or it is BuddyPress
142
  if ( is_object( $bbdb ) )
143
  return;
144
 
145
+ // Config file does not exist
146
+ if ( !file_exists( $this->bbconfig ) )
147
  return false;
148
 
149
+ // Set the path constants
150
+ define( 'BB_PATH', trailingslashit( dirname( $this->bbconfig ) ) );
151
+ define( 'BACKPRESS_PATH', BB_PATH . 'bb-includes/backpress/' );
152
+ define( 'BB_INC', 'bb-includes/' );
 
 
 
 
 
 
 
 
 
153
 
154
  require_once( BB_PATH . BB_INC . 'class.bb-query.php' );
155
  require_once( BB_PATH . BB_INC . 'class.bb-walker.php' );
168
  require_once( BB_PATH . BB_INC . 'class.bb-taxonomy.php' );
169
 
170
  $bb = new stdClass();
171
+ require_once( $this->bbconfig );
172
 
173
  // Setup the global database connection
174
  $bbdb = new BPDB( BBDB_USER, BBDB_PASSWORD, BBDB_NAME, BBDB_HOST );
175
 
176
+ // Set the table names
177
  $bbdb->forums = $bb_table_prefix . 'forums';
178
  $bbdb->meta = $bb_table_prefix . 'meta';
179
  $bbdb->posts = $bb_table_prefix . 'posts';
182
  $bbdb->term_taxonomy = $bb_table_prefix . 'term_taxonomy';
183
  $bbdb->topics = $bb_table_prefix . 'topics';
184
 
185
+ // Users table
186
  if ( isset( $bb->custom_user_table ) )
187
  $bbdb->users = $bb->custom_user_table;
188
  else
189
  $bbdb->users = $bb_table_prefix . 'users';
190
 
191
+ // Users meta table
192
  if ( isset( $bb->custom_user_meta_table ) )
193
  $bbdb->usermeta = $bb->custom_user_meta_table;
194
  else
195
  $bbdb->usermeta = $bb_table_prefix . 'usermeta';
196
 
197
+ // Table prefix
198
+ $bbdb->prefix = $bb_table_prefix;
199
 
200
+ // Not installing
201
  define( 'BB_INSTALLING', false );
202
 
203
+ // Ghetto role map
204
  if ( is_object( $wp_roles ) ) {
205
  $bb_roles = $wp_roles;
206
  bb_init_roles( $bb_roles );
207
  }
208
 
209
+ // Call the standard bbPress actions
210
  do_action( 'bb_got_roles' );
211
  do_action( 'bb_init' );
212
  do_action( 'init_roles' );
213
 
214
+ // Setup required objects
215
  $bb_current_user = $current_user;
216
  $wp_users_object = new bbPress_Importer_BB_Auth;
217
 
218
+ // Taxonomy object
219
  if ( !isset( $wp_taxonomy_object ) )
220
  $wp_taxonomy_object = new BB_Taxonomy( $bbdb );
221
 
248
  *
249
  * @return string Path, if found
250
  */
251
+ function autolocate_bbconfig() {
252
+
253
+ // BuddyPress Install
254
+ if ( defined( 'BP_VERSION' ) && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) {
255
+ global $bp;
256
 
257
+ if ( !empty( $bp->forums->bbconfig ) )
258
+ return $bp->forums->bbconfig;
259
+ }
260
+
261
+ // Normal install
262
+ $dirs = array( 'forum', 'forums', 'board', 'discussion', 'bbpress', 'bb', '' );
263
  $base = trailingslashit( ABSPATH );
264
  $base_dirs = array( $base, dirname( $base ) );
265
 
266
+ // Loop through possible directories
267
  foreach ( $dirs as $dir ) {
268
 
269
+ // Loop through base dir
270
  foreach ( $base_dirs as $base_dir ) {
271
+
272
+ // Path to try
273
  $test_path = $base_dir . $dir . '/bb-config.php';
274
 
275
+ // File exists
276
  if ( file_exists( $test_path ) ) {
277
+ return realpath( $test_path );
 
278
  }
279
  }
 
280
  }
281
 
282
+ // Nothing found
283
+ return '';
284
  }
285
 
286
  /**
431
  function greet() {
432
  global $wpdb, $bbdb;
433
 
434
+ // Attempt to autolocate config file
435
+ $autolocate = $this->autolocate_bbconfig(); ?>
 
436
 
437
  <div class="narrow">
438
 
482
  <li><?php _e( 'Notes on compatibility:', 'bbpress' ); ?>
483
  <ol>
484
  <li>
485
+ <?php _e( 'If you are using the alpha version of bbPress 1.1, subscriptions will be ported automatically.', 'bbpress' ); ?>
486
  </li>
487
  <li>
488
+ <?php printf( __( 'If you have the <a href="%s">Subscribe to Topic</a> plugin active, then this script will migrate user subscriptions from that plugin.', 'bbpress' ), 'http://bbpress.org/plugins/topic/subscribe-to-topic/' ); ?>
489
  </li>
490
  <li>
491
  <?php printf( __( 'If you are importing an existing BuddyPress Forums installation, we should have found your previous configuration file.', 'bbpress' ), 'http://bbpress.org/plugins/topic/subscribe-to-topic/' ); ?>
496
  </ol>
497
 
498
  <h3><?php _e( 'Configuration', 'bbpress' ); ?></h3>
499
+ <p><?php _e( 'Enter the full path to your bbPress configuration file i.e. <code>bb-config.php</code>:', 'bbpress' ); ?></p>
500
 
501
  <table class="form-table">
 
502
  <tr>
503
  <th scope="row"><label for="bbp_bbpress_path"><?php _e( 'bbPress Standalone Path:', 'bbpress' ); ?></label></th>
504
+ <td><input type="text" name="bbp_bbpress_path" id="bbp_bbpress_path" class="regular-text" value="<?php echo !empty( $autolocate ) ? $autolocate : trailingslashit( ABSPATH ) . 'bb-config.php'; ?>" /></td>
505
  </tr>
 
506
  </table>
507
 
508
  <p class="submit">
535
  * @return type
536
  */
537
  function setup() {
538
+
539
+ // Get details from _POST
540
  if ( !empty( $_POST['bbp_bbpress_path'] ) ) {
541
+
542
  // Store details for later
543
+ $this->bbconfig = realpath( $_POST['bbp_bbpress_path'] );
544
+
545
+ // Update path
546
+ update_option( 'bbp_bbpress_path', $this->bbconfig );
547
 
548
+ // Get details from DB
549
  } else {
550
+ $this->bbconfig = get_option( 'bbp_bbpress_path' );
551
  }
552
 
553
+ // No config file found
554
+ if ( empty( $this->bbconfig ) ) { ?>
555
 
556
  <p><?php _e( 'Please enter the path to your bbPress configuration file - <code>bb-config.php</code>.', 'bbpress' ); ?></p>
557
  <p><a href="<?php echo esc_url( add_query_arg( array( 'import' => 'bbpress', 'step' => '-1', '_wpnonce' => wp_create_nonce( 'bbp-bbpress-import' ), '_wp_http_referer' => esc_attr( remove_query_arg( 'step', $_SERVER['REQUEST_URI'] ) ) ) ) ); ?>" class="button"><?php _e( 'Go Back', 'bbpress' ); ?></a></p>
562
  }
563
 
564
  // Check if the user submitted a directory as the path by mistake
565
+ if ( is_dir( $this->bbconfig ) && file_exists( trailingslashit( $this->bbconfig ) . 'bb-config.php' ) ) {
566
+ $this->bbconfig = trailingslashit( $this->bbconfig ) . 'bb-config.php';
567
  }
568
 
569
  // Check if the file exists
570
+ if ( !file_exists( $this->bbconfig ) || is_dir( $this->bbconfig ) ) {
571
 
572
  delete_option( 'bbp_bbpress_path' ); ?>
573
 
574
+ <p><?php _e( 'bbPress configuration file <code>bb-config.php</code> doesn\'t exist in the path specified! Please check the path and try again.', 'bbpress' ); ?></p>
575
+ <p><a href="<?php echo esc_url( add_query_arg( array( 'import' => 'bbpress', 'step' => '-1', '_wpnonce' => wp_create_nonce( 'bbp-bbpress-import' ), '_wp_http_referer' => esc_attr( remove_query_arg( 'step', $_SERVER['REQUEST_URI'] ) ) ) ) ); ?>" class="button"><?php _e( 'Go Back', 'bbpress' ); ?></a></p>
576
+
577
+ <?php
578
+
579
+ return false;
580
  }
581
 
582
  $this->load_bbpress();
620
  <li>
621
  <?php _e( 'Your WordPress blog is <strong>new</strong> and you don\'t have the fear of losing WordPress users:', 'bbpress' ); ?>
622
  <label for="step_user"><?php _e( 'Go to migrating users section.', 'bbpress' ); ?></label>
623
+ <?php printf( __( '<strong>Note</strong>: The WordPress %1$s and %2$s tables will be renamed (not deleted) so that you can restore them if something goes wrong.', 'bbpress' ), '<code>' . $wpdb->users . '</code>', '<code>' . $wpdb->usermeta . '</code>' ); ?>
624
+ <?php printf( __( 'Please ensure there are no tables named %1$s and %2$s to avoid renaming conflicts.', 'bbpress' ), '<code>' . $bbdb->prefix . $wpdb->users . '_tmp' . '</code>', '<code>' . $bbdb->prefix . $wpdb->usermeta . '_tmp' . '</code>' ); ?>
625
  <?php _e( 'Also, your WordPress and bbPress installs must be in the same database.', 'bbpress' ); ?>
626
  </li>
627
 
633
  <li>
634
  <?php _e( 'You have a well <strong>established</strong> WordPress user base, the user tables are not integrated and you can\'t lose your users:', 'bbpress' ); ?>
635
  <?php _e( 'This is currently not yet supported, and will likely not be in the future also as it is highly complex to merge two user sets (which might even conflict).', 'bbpress' ); ?>
636
+ <?php printf( __( 'Patches are always <a href="%s" title="The last revision containing the custom user migration code">welcome</a>. :)', 'bbpress' ), 'http://bbpress.trac.wordpress.org/ticket/1523' ); ?>
637
  </li>
638
 
639
  </ol>
640
 
641
  <?php endif; ?>
642
 
643
+ <input type="radio" name="step"<?php disabled( $this->is_integrated() ); ?> value="2"<?php checked( $radio, 'user' ); ?> id="step_user" />
644
  <label for="step_user"><?php _e( 'Migrate Users', 'bbpress' ); ?></label>
645
 
646
  <input type="radio" name="step" value="3"<?php checked( $radio, 'board' ); ?> id="step_board" />
689
 
690
  <ol>
691
 
692
+ <?php /* Rename the WordPress users and usermeta table */ ?>
693
 
694
+ <li>
695
+ <?php
 
696
 
697
+ if ( $wpdb->query( "RENAME TABLE $wpdb->users TO {$bbdb->prefix}{$wpdb->users}_tmp, $wpdb->usermeta TO {$bbdb->prefix}{$wpdb->usermeta}_tmp" ) !== false ) :
698
+ printf( __( 'Renamed the <code>%1$s</code> and <code>%2$s</code> tables to <code>%3$s</code> and <code>%4$s</code> respectively.', 'bbpress' ), $wpdb->users, $wpdb->usermeta, $bbdb->prefix . $wpdb->users . '_tmp', $bbdb->prefix . $wpdb->usermeta . '_tmp' );
699
+ else :
700
+ printf( __( 'There was a problem dropping the <code>%1$s</code> and <code>%2$s</code> tables. Please check and re-run the script or rename or drop the tables yourself.', 'bbpress' ), $wpdb->users, $wpdb->usermeta ); ?>
701
 
702
+ </li></ol>
703
 
 
704
  <?php
705
+ return;
706
+ endif; ?>
707
+
 
 
708
  </li>
709
 
710
  <?php /* Duplicate the WordPress users and usermeta table */ ?>
711
 
712
  <li>
713
+ <?php
714
+
715
+ if ( $wpdb->query( "CREATE TABLE $wpdb->users ( `ID` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `user_activation_key` VARCHAR( 60 ) NOT NULL DEFAULT '', KEY ( `user_login` ), KEY( `user_nicename` ) ) SELECT * FROM $bbdb->users ORDER BY `ID`" ) !== false ) :
716
+ printf( __( 'Created the <code>%s</code> table and copied the users from bbPress.', 'bbpress' ), $wpdb->users );
717
+ else :
718
+ printf( __( 'There was a problem duplicating the table <code>%1$s</code> to <code>%2$s</code>. Please check and re-run the script or duplicate the table yourself.', 'bbpress' ), $bbdb->users, $wpdb->users ); ?>
719
+
720
+ </li></ol>
721
+
722
+ <?php
723
+
724
+ return;
725
+ endif; ?>
726
+
727
  </li>
728
 
729
  <li>
730
+ <?php
731
+
732
+ if ( $wpdb->query( "CREATE TABLE $wpdb->usermeta ( `umeta_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, KEY ( `user_id` ), KEY( `meta_key` ) ) SELECT * FROM $bbdb->usermeta ORDER BY `umeta_id`" ) !== false ) :
733
+ printf( __( 'Created the <code>%s</code> table and copied the user information from bbPress.', 'bbpress' ), $wpdb->usermeta );
734
+ else :
735
+ printf( __( 'There was a problem duplicating the table <code>%1$s</code> to <code>%2$s</code>. Please check and re-run the script or duplicate the table yourself.', 'bbpress' ), $bbdb->usermeta, $wpdb->usermeta ); ?>
736
+
737
+ </li></ol>
738
+
739
+ <?php
740
+
741
+ return;
742
+ endif; ?>
743
+
744
  </li>
745
 
746
  <?php
772
  foreach ( $users as $user ) {
773
 
774
  // Get the bbPress roles
775
+ $bb_roles =& $user->{ $bbdb->prefix . 'capabilities' };
776
  $converted_roles = $converted_level = array();
777
 
778
  // Loop through each role the user has
779
+ if ( !empty( $bb_roles ) ) {
780
+ foreach ( $bb_roles as $bb_role => $bb_role_value ) {
781
 
782
+ // If we have one of those in our roles map, add the WP counterpart in the new roles array
783
+ if ( $roles_map[strtolower( $bb_role )] && !empty( $bb_role_value ) ) {
784
+ $converted_roles[$roles_map[strtolower( $bb_role )]] = true;
785
 
786
+ // Have support for deprecated levels too
787
+ $converted_level[] = $wp_user_level_map[$roles_map[strtolower( $bb_role )]];
788
 
789
+ // We need an admin for future use
790
+ if ( empty( $admin_user ) && 'administrator' == $roles_map[strtolower( $bb_role )] )
791
+ $admin_user = $user;
792
+ }
793
 
794
+ }
795
  }
796
 
797
  // If we have new roles, then update the user meta
812
 
813
  <?php
814
 
815
+ return;
816
 
817
  endif;
818
 
836
  <p><?php _e( 'Your users have all been imported, but wait &#8211; there&#8217;s more! Now we need to import your forums, topics and posts!', 'bbpress' ); ?></p>
837
  <?php
838
 
839
+ echo $this->next_step( 3, __( 'Import forums, topics and posts &raquo;', 'bbpress' ) ); ?>
840
 
841
  </div>
842
 
873
 
874
  if ( !$forums = bb_get_forums() ) {
875
  echo "<li><strong>" . __( 'No forums were found!', 'bbpress' ) . "</strong></li></ol>\n";
876
+ return;
877
  }
878
 
879
+ echo "<li>" . sprintf( __( 'Total number of forums: %s', 'bbpress' ), count( $forums ) ) . "</li>\n";
 
880
 
881
  $forum_map = array();
882
  $post_statuses = array( 'publish', $bbp->trash_status_id, $bbp->spam_status_id );
911
  $topics_query = new BB_Query( 'topic', array(
912
  'forum_id' => $forum->forum_id,
913
  'per_page' => -1,
914
+ 'topic_status' => 'all',
915
+ 'order_by' => 'topic_start_time',
916
+ 'order' => 'ASC'
917
  ) );
918
 
919
  $topics = $topics_query->results;
937
 
938
  bb_cache_first_posts( $topics );
939
 
940
+ echo "<li>" . sprintf( __( 'Total number of topics in the forum: %s', 'bbpress' ), count( $topics ) ) . "</li>\n";
 
941
 
942
  foreach ( (array) $topics as $topic ) {
943
  $first_post = bb_get_first_post( $topic->topic_id );
1030
  bbp_update_reply_walker( $last_reply );
1031
  }
1032
 
 
 
1033
  if ( $post->post_status != 0 )
1034
  $hidden_replies++;
1035
+ else
1036
+ $replies++;
1037
  }
1038
 
1039
  // Only add favorites and subscriptions if the topic is public
1062
  break;
1063
  }
1064
 
1065
+ // Last active
1066
+ $last_active_id = !empty( $last_reply ) ? $last_reply : $inserted_topic;
1067
+ $last_active_time = !empty( $post ) ? $post->post_time : $first_post->post_time;
1068
 
1069
  // Reply topic meta
1070
+ update_post_meta( $inserted_topic, '_bbp_last_reply_id', $last_reply );
1071
+ update_post_meta( $inserted_topic, '_bbp_last_active_id', $last_active_id );
1072
+ update_post_meta( $inserted_topic, '_bbp_last_active_time', $last_active_time );
1073
+ update_post_meta( $inserted_topic, '_bbp_reply_count', $replies );
1074
+ update_post_meta( $inserted_topic, '_bbp_hidden_reply_count', $hidden_replies );
1075
+
1076
  // Voices will be done by recount
1077
 
1078
  bbp_update_topic_walker( $inserted_topic );
bbp-includes/bbp-core-caps.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Capabilities
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
7
  * @subpackage Capabilities
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
bbp-includes/bbp-core-classes.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Classes
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Component' ) ) :
7
  * @subpackage Classes
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Component' ) ) :
bbp-includes/bbp-core-compatibility.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage ThemeCompatibility
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Theme Compat **************************************************************/
@@ -428,7 +428,7 @@ function bbp_template_include( $template = false ) {
428
  if ( !current_theme_supports( 'bbpress' ) || ( !empty( $templates ) && empty( $new_template ) ) ) {
429
 
430
  // Assume we are not in theme compat
431
- $in_theme_compat = false;
432
 
433
  /** Users *************************************************************/
434
 
@@ -553,27 +553,20 @@ function bbp_template_include( $template = false ) {
553
 
554
  // Single Forum
555
  case bbp_get_forum_post_type() :
556
- $forum_id = bbp_get_forum_id( get_the_ID() );
 
 
557
 
558
  // Single Topic
559
  case bbp_get_topic_post_type() :
560
- $forum_id = bbp_get_topic_forum_id( get_the_ID() );
 
 
561
 
562
  // Single Reply
563
  case bbp_get_reply_post_type() :
564
- $forum_id = bbp_get_reply_forum_id( get_the_ID() );
565
-
566
- // Display template
567
- if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) || bbp_is_forum_private( $forum_id ) ) {
568
-
569
- // In Theme Compat
570
- $in_theme_compat = true;
571
-
572
- // Display 404 page
573
- } elseif ( bbp_is_forum_hidden( $forum_id ) ) {
574
- bbp_set_404();
575
- }
576
-
577
  break;
578
  }
579
  }
@@ -601,9 +594,17 @@ function bbp_template_include( $template = false ) {
601
  // Add a filter on the_content late, which we will later remove
602
  add_filter( 'the_content', 'bbp_replace_the_content' );
603
 
604
- // Default to the page template
605
- $template = apply_filters( 'bbp_template_include', 'page.php' );
606
- $template = locate_template( $template, false, false );
 
 
 
 
 
 
 
 
607
  }
608
  }
609
 
@@ -699,7 +700,7 @@ function bbp_replace_the_content( $content = '' ) {
699
 
700
  bbp_get_template_part( 'bbpress/form', 'merge' );
701
 
702
- $content = ob_get_contents();
703
 
704
  ob_end_clean();
705
 
7
  * @subpackage ThemeCompatibility
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Theme Compat **************************************************************/
428
  if ( !current_theme_supports( 'bbpress' ) || ( !empty( $templates ) && empty( $new_template ) ) ) {
429
 
430
  // Assume we are not in theme compat
431
+ $in_theme_compat = false; $forum_id = 0;
432
 
433
  /** Users *************************************************************/
434
 
553
 
554
  // Single Forum
555
  case bbp_get_forum_post_type() :
556
+ $forum_id = bbp_get_forum_id( get_the_ID() );
557
+ $in_theme_compat = true;
558
+ break;
559
 
560
  // Single Topic
561
  case bbp_get_topic_post_type() :
562
+ $forum_id = bbp_get_topic_forum_id( get_the_ID() );
563
+ $in_theme_compat = true;
564
+ break;
565
 
566
  // Single Reply
567
  case bbp_get_reply_post_type() :
568
+ $forum_id = bbp_get_reply_forum_id( get_the_ID() );
569
+ $in_theme_compat = true;
 
 
 
 
 
 
 
 
 
 
 
570
  break;
571
  }
572
  }
594
  // Add a filter on the_content late, which we will later remove
595
  add_filter( 'the_content', 'bbp_replace_the_content' );
596
 
597
+ // Allow just-in-time filtering of theme compat template
598
+ $templates = apply_filters( 'bbp_template_include', array(
599
+ 'bbpress.php',
600
+ 'forum.php',
601
+ 'page.php',
602
+ 'single.php',
603
+ 'index.php'
604
+ ) );
605
+
606
+ // Find the appropriate template file
607
+ $template = locate_template( $templates, false, false );
608
  }
609
  }
610
 
700
 
701
  bbp_get_template_part( 'bbpress/form', 'merge' );
702
 
703
+ $new_content = ob_get_contents();
704
 
705
  ob_end_clean();
706
 
bbp-includes/bbp-core-hooks.php CHANGED
@@ -19,7 +19,7 @@
19
  * bbp-admin/bbp-admin.php
20
  */
21
 
22
- // Redirect if accessed directly
23
  if ( !defined( 'ABSPATH' ) ) exit;
24
 
25
  /** ACTIONS *******************************************************************/
19
  * bbp-admin/bbp-admin.php
20
  */
21
 
22
+ // Exit if accessed directly
23
  if ( !defined( 'ABSPATH' ) ) exit;
24
 
25
  /** ACTIONS *******************************************************************/
bbp-includes/bbp-core-loader.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Loader
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Main Actions **************************************************************/
7
  * @subpackage Loader
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Main Actions **************************************************************/
bbp-includes/bbp-core-options.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Options
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
@@ -46,6 +46,8 @@ function bbp_add_options() {
46
  // Allow anonymous posting
47
  '_bbp_allow_anonymous' => false,
48
 
 
 
49
  // Topics per page
50
  '_bbp_topics_per_page' => '15',
51
 
@@ -61,35 +63,33 @@ function bbp_add_options() {
61
  // Replies per RSS page
62
  '_bbp_replies_per_rss_page' => '25',
63
 
64
- /** Slugs *************************************************************/
65
 
66
- // Root slug
67
  '_bbp_root_slug' => 'forums',
68
 
69
- // Use root before slugs
 
 
 
 
 
70
  '_bbp_include_root' => true,
71
 
72
  // Forum slug
73
  '_bbp_forum_slug' => 'forum',
74
 
75
- // Forum archive slug
76
- '_bbp_forum_archive_slug' => 'forums',
77
-
78
  // Topic slug
79
  '_bbp_topic_slug' => 'topic',
80
 
81
- // Topic archive slug
82
- '_bbp_topic_archive_slug' => 'topics',
83
-
84
  // Reply slug
85
  '_bbp_reply_slug' => 'reply',
86
 
87
- // Reply archive slug
88
- '_bbp_reply_archive_slug' => 'replies',
89
-
90
  // Topic tag slug
91
  '_bbp_topic_tag_slug' => 'tag',
92
 
 
 
93
  // User profile slug
94
  '_bbp_user_slug' => 'users',
95
 
@@ -126,11 +126,13 @@ function bbp_add_options() {
126
  *
127
  * @since bbPress (r2658)
128
  *
 
 
129
  * @uses get_option() To get the favorites option
130
  * @return bool Is favorites enabled or not
131
  */
132
- function bbp_is_favorites_active() {
133
- return apply_filters( 'bbp_is_favorites_active', (bool) get_option( '_bbp_enable_favorites', true ) );
134
  }
135
 
136
  /**
@@ -138,11 +140,13 @@ function bbp_is_favorites_active() {
138
  *
139
  * @since bbPress (r2658)
140
  *
 
 
141
  * @uses get_option() To get the subscriptions option
142
  * @return bool Is subscription enabled or not
143
  */
144
- function bbp_is_subscriptions_active() {
145
- return apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions' ) );
146
  }
147
 
148
  /**
@@ -150,11 +154,13 @@ function bbp_is_subscriptions_active() {
150
  *
151
  * @since bbPress (r2659)
152
  *
 
 
153
  * @uses get_option() To get the allow anonymous option
154
  * @return bool Is anonymous posting allowed?
155
  */
156
- function bbp_allow_anonymous() {
157
- return apply_filters( 'bbp_allow_anonymous', get_option( '_bbp_allow_anonymous', false ) );
158
  }
159
 
160
  ?>
7
  * @subpackage Options
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
46
  // Allow anonymous posting
47
  '_bbp_allow_anonymous' => false,
48
 
49
+ /** Per Page **********************************************************/
50
+
51
  // Topics per page
52
  '_bbp_topics_per_page' => '15',
53
 
63
  // Replies per RSS page
64
  '_bbp_replies_per_rss_page' => '25',
65
 
66
+ /** Archive Slugs *****************************************************/
67
 
68
+ // Forum archive slug
69
  '_bbp_root_slug' => 'forums',
70
 
71
+ // Topic archive slug
72
+ '_bbp_topic_archive_slug' => 'topics',
73
+
74
+ /** Single Slugs ******************************************************/
75
+
76
+ // Include Forum archive before single slugs
77
  '_bbp_include_root' => true,
78
 
79
  // Forum slug
80
  '_bbp_forum_slug' => 'forum',
81
 
 
 
 
82
  // Topic slug
83
  '_bbp_topic_slug' => 'topic',
84
 
 
 
 
85
  // Reply slug
86
  '_bbp_reply_slug' => 'reply',
87
 
 
 
 
88
  // Topic tag slug
89
  '_bbp_topic_tag_slug' => 'tag',
90
 
91
+ /** Other Slugs *******************************************************/
92
+
93
  // User profile slug
94
  '_bbp_user_slug' => 'users',
95
 
126
  *
127
  * @since bbPress (r2658)
128
  *
129
+ * @param $default bool Optional.Default value
130
+ *
131
  * @uses get_option() To get the favorites option
132
  * @return bool Is favorites enabled or not
133
  */
134
+ function bbp_is_favorites_active( $default = true ) {
135
+ return apply_filters( 'bbp_is_favorites_active', (bool) get_option( '_bbp_enable_favorites', $default ) );
136
  }
137
 
138
  /**
140
  *
141
  * @since bbPress (r2658)
142
  *
143
+ * @param $default bool Optional.Default value
144
+ *
145
  * @uses get_option() To get the subscriptions option
146
  * @return bool Is subscription enabled or not
147
  */
148
+ function bbp_is_subscriptions_active( $default = true ) {
149
+ return apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions', $default ) );
150
  }
151
 
152
  /**
154
  *
155
  * @since bbPress (r2659)
156
  *
157
+ * @param $default bool Optional. Default value
158
+ *
159
  * @uses get_option() To get the allow anonymous option
160
  * @return bool Is anonymous posting allowed?
161
  */
162
+ function bbp_allow_anonymous( $default = false ) {
163
+ return apply_filters( 'bbp_allow_anonymous', get_option( '_bbp_allow_anonymous', $default ) );
164
  }
165
 
166
  ?>
bbp-includes/bbp-core-shortcodes.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Shortcodes
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Shortcodes' ) ) :
@@ -248,8 +248,8 @@ class BBP_Shortcodes {
248
  // Start output buffer
249
  $this->_ob_start();
250
 
251
- // Display breadcrumb if a subforum
252
- bbp_get_template_part( 'bbpress/nav', 'breadcrumb' );
253
 
254
  // Password protected
255
  if ( post_password_required() ) {
@@ -425,7 +425,7 @@ class BBP_Shortcodes {
425
  $this->_ob_start();
426
 
427
  // Breadcrumb
428
- bbp_get_template_part( 'bbpress/nav', 'breadcrumb' );
429
 
430
  // Password protected
431
  if ( post_password_required() ) {
@@ -439,14 +439,14 @@ class BBP_Shortcodes {
439
  // Check forum caps
440
  if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
441
 
442
- // Load the topic
443
- if ( bbp_has_replies( $replies_query ) ) {
444
 
445
- // Tags
446
- bbp_topic_tag_list( $topic_id );
447
 
448
- // Topic description
449
- bbp_single_topic_description( array( 'topic_id' => $topic_id ) );
450
 
451
  // Template files
452
  bbp_get_template_part( 'bbpress/single', 'topic' );
@@ -485,6 +485,21 @@ class BBP_Shortcodes {
485
  // Start output buffer
486
  $this->_ob_start();
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  // Output templates
489
  bbp_get_template_part( 'bbpress/form', 'topic' );
490
 
@@ -508,6 +523,10 @@ class BBP_Shortcodes {
508
  // Start output buffer
509
  $this->_ob_start();
510
 
 
 
 
 
511
  // Output templates
512
  bbp_get_template_part( 'bbpress/form', 'reply' );
513
 
@@ -585,6 +604,9 @@ class BBP_Shortcodes {
585
  // Start output buffer
586
  $this->_ob_start();
587
 
 
 
 
588
  // Tag description
589
  bbp_topic_tag_description();
590
 
@@ -635,8 +657,8 @@ class BBP_Shortcodes {
635
  // Start output buffer
636
  $this->_ob_start();
637
 
638
- // Display breadcrumb if a subforum
639
- bbp_get_template_part( 'bbpress/nav', 'breadcrumb' );
640
 
641
  // Password protected
642
  if ( post_password_required() ) {
7
  * @subpackage Shortcodes
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  if ( !class_exists( 'BBP_Shortcodes' ) ) :
248
  // Start output buffer
249
  $this->_ob_start();
250
 
251
+ // Breadcrumb
252
+ bbp_breadcrumb();
253
 
254
  // Password protected
255
  if ( post_password_required() ) {
425
  $this->_ob_start();
426
 
427
  // Breadcrumb
428
+ bbp_breadcrumb();
429
 
430
  // Password protected
431
  if ( post_password_required() ) {
439
  // Check forum caps
440
  if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
441
 
442
+ // Tags
443
+ bbp_topic_tag_list( $topic_id );
444
 
445
+ // Topic description
446
+ bbp_single_topic_description( array( 'topic_id' => $topic_id ) );
447
 
448
+ // Load the topic
449
+ if ( bbp_has_replies( $replies_query ) ) {
450
 
451
  // Template files
452
  bbp_get_template_part( 'bbpress/single', 'topic' );
485
  // Start output buffer
486
  $this->_ob_start();
487
 
488
+ // Breadcrumb
489
+ if ( bbp_is_forum() || bbp_is_topic_edit() )
490
+ bbp_breadcrumb();
491
+
492
+ // Editing a topic
493
+ if ( bbp_is_topic_edit() ) {
494
+
495
+ // Tags
496
+ bbp_topic_tag_list( get_the_ID() );
497
+
498
+ // Topic description
499
+ bbp_single_topic_description( array( 'topic_id' => get_the_ID() ) );
500
+
501
+ }
502
+
503
  // Output templates
504
  bbp_get_template_part( 'bbpress/form', 'topic' );
505
 
523
  // Start output buffer
524
  $this->_ob_start();
525
 
526
+ // Breadcrumb
527
+ if ( bbp_is_reply_edit() )
528
+ bbp_breadcrumb();
529
+
530
  // Output templates
531
  bbp_get_template_part( 'bbpress/form', 'reply' );
532
 
604
  // Start output buffer
605
  $this->_ob_start();
606
 
607
+ // Breadcrumb
608
+ bbp_breadcrumb();
609
+
610
  // Tag description
611
  bbp_topic_tag_description();
612
 
657
  // Start output buffer
658
  $this->_ob_start();
659
 
660
+ // Breadcrumb
661
+ bbp_breadcrumb();
662
 
663
  // Password protected
664
  if ( post_password_required() ) {
bbp-includes/bbp-core-widgets.php CHANGED
@@ -9,7 +9,7 @@
9
  * @subpackage Widgets
10
  */
11
 
12
- // Redirect if accessed directly
13
  if ( !defined( 'ABSPATH' ) ) exit;
14
 
15
  /**
9
  * @subpackage Widgets
10
  */
11
 
12
+ // Exit if accessed directly
13
  if ( !defined( 'ABSPATH' ) ) exit;
14
 
15
  /**
bbp-includes/bbp-forum-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Functions
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Walk **********************************************************************/
@@ -785,7 +785,7 @@ function bbp_exclude_forum_ids( $query = array() ) {
785
  return $query;
786
 
787
  // Setup arrays
788
- $private = $hidden = array();
789
 
790
  // Private forums
791
  if ( !current_user_can( 'read_private_forums' ) )
7
  * @subpackage Functions
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Walk **********************************************************************/
785
  return $query;
786
 
787
  // Setup arrays
788
+ $private = $hidden = $meta_query = array();
789
 
790
  // Private forums
791
  if ( !current_user_can( 'read_private_forums' ) )
bbp-includes/bbp-forum-template.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage TemplateTags
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Type *****************************************************************/
@@ -85,7 +85,7 @@ function bbp_has_forums( $args = '' ) {
85
  // The default forum query for most circumstances
86
  $default = array (
87
  'post_type' => bbp_get_forum_post_type(),
88
- 'post_parent' => bbp_get_forum_id(),
89
  'post_status' => implode( ',', $post_stati ),
90
  'posts_per_page' => get_option( '_bbp_forums_per_page', 15 ),
91
  'orderby' => 'menu_order',
@@ -550,7 +550,8 @@ function bbp_forum_get_subforums( $args = '' ) {
550
  'post_type' => bbp_get_forum_post_type(),
551
  'post_status' => implode( ',', $post_stati ),
552
  'posts_per_page' => get_option( '_bbp_forums_per_page', 15 ),
553
- 'sort_column' => 'menu_order, post_title'
 
554
  );
555
 
556
  $r = wp_parse_args( $args, $default );
@@ -606,6 +607,10 @@ function bbp_list_forums( $args = '' ) {
606
  $r = wp_parse_args( $args, $defaults );
607
  extract( $r, EXTR_SKIP );
608
 
 
 
 
 
609
  // Loop through forums and create a list
610
  if ( $sub_forums = bbp_forum_get_subforums( $forum_id ) ) {
611
 
7
  * @subpackage TemplateTags
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Type *****************************************************************/
85
  // The default forum query for most circumstances
86
  $default = array (
87
  'post_type' => bbp_get_forum_post_type(),
88
+ 'post_parent' => is_post_type_archive( bbp_get_forum_post_type() ) ? 0 : bbp_get_forum_id() ,
89
  'post_status' => implode( ',', $post_stati ),
90
  'posts_per_page' => get_option( '_bbp_forums_per_page', 15 ),
91
  'orderby' => 'menu_order',
550
  'post_type' => bbp_get_forum_post_type(),
551
  'post_status' => implode( ',', $post_stati ),
552
  'posts_per_page' => get_option( '_bbp_forums_per_page', 15 ),
553
+ 'sort_column' => 'menu_order, post_title',
554
+ 'order' => 'ASC'
555
  );
556
 
557
  $r = wp_parse_args( $args, $default );
607
  $r = wp_parse_args( $args, $defaults );
608
  extract( $r, EXTR_SKIP );
609
 
610
+ // Bail if there are no subforums
611
+ if ( !bbp_get_forum_subforum_count( $forum_id ) )
612
+ return;
613
+
614
  // Loop through forums and create a list
615
  if ( $sub_forums = bbp_forum_get_subforums( $forum_id ) ) {
616
 
bbp-includes/bbp-general-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Functions
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Meta *****************************************************************/
@@ -379,73 +379,81 @@ function bbp_get_statistics( $args = '' ) {
379
  // Topics
380
  if ( !empty( $count_topics ) ) {
381
 
382
- $all_topics = wp_count_posts( bbp_get_topic_post_type() );
383
 
384
  // Published (publish + closed)
385
- $topic_count = $all_topics->publish + $all_topics->{$bbp->closed_status_id};
386
 
387
  if ( current_user_can( 'read_private_topics' ) || current_user_can( 'edit_others_topics' ) || current_user_can( 'view_trash' ) ) {
388
 
389
  // Private
390
- $private_topics = ( !empty( $count_private_topics ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->private : 0;
391
 
392
  // Spam
393
- $spammed_topics = ( !empty( $count_spammed_topics ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$bbp->spam_status_id} : 0;
394
 
395
  // Trash
396
- $trashed_topics = ( !empty( $count_trashed_topics ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$bbp->trash_status_id} : 0;
397
 
398
  // Total hidden (private + spam + trash)
399
- $hidden_topic_count = $private_topics + $spammed_topics + $trashed_topics;
400
 
401
  // Generate the hidden topic count's title attribute
402
- $hidden_topic_title = !empty( $private_topics ) ? sprintf( __( 'Private: %s | ', 'bbpress' ), number_format_i18n( $private_topics ) ) : '';
403
- $hidden_topic_title .= !empty( $spammed_topics ) ? sprintf( __( 'Spammed: %s | ', 'bbpress' ), number_format_i18n( $spammed_topics ) ) : '';
404
- $hidden_topic_title .= !empty( $trashed_topics ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $trashed_topics ) ) : '';
405
 
 
 
406
  }
407
-
408
  }
409
 
410
  // Replies
411
  if ( !empty( $count_replies ) ) {
412
 
413
- $all_replies = wp_count_posts( bbp_get_reply_post_type() );
414
 
415
  // Published
416
- $reply_count = $all_replies->publish;
417
 
418
  if ( current_user_can( 'read_private_replies' ) || current_user_can( 'edit_others_replies' ) || current_user_can( 'view_trash' ) ) {
419
 
420
  // Private
421
- $private_replies = ( !empty( $count_private_replies ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->private : 0;
422
 
423
  // Spam
424
- $spammed_replies = ( !empty( $count_spammed_replies ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$bbp->spam_status_id} : 0;
425
 
426
  // Trash
427
- $trashed_replies = ( !empty( $count_trashed_replies ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$bbp->trash_status_id} : 0;
428
 
429
  // Total hidden (private + spam + trash)
430
- $hidden_reply_count = $private_replies + $spammed_replies + $trashed_replies;
431
 
432
- // Generate the hidden reply count's title attribute
433
- $hidden_reply_title = !empty( $private_replies ) ? sprintf( __( 'Private: %s | ', 'bbpress' ), number_format_i18n( $private_replies ) ) : '';
434
- $hidden_reply_title .= !empty( $spammed_replies ) ? sprintf( __( 'Spammed: %s | ', 'bbpress' ), number_format_i18n( $spammed_replies ) ) : '';
435
- $hidden_reply_title .= !empty( $trashed_replies ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $trashed_replies ) ) : '';
436
 
437
- }
 
438
 
 
439
  }
440
 
441
  // Topic Tags
442
  if ( !empty( $count_tags ) ) {
 
 
443
  $topic_tag_count = wp_count_terms( $bbp->topic_tag_id, array( 'hide_empty' => true ) );
444
 
445
- if ( !empty( $count_empty_tags ) && current_user_can( 'edit_topic_tags' ) )
 
446
  $empty_topic_tag_count = wp_count_terms( $bbp->topic_tag_id ) - $topic_tag_count;
 
447
  }
448
 
 
449
  $statistics = compact( 'user_count', 'forum_count', 'topic_count', 'hidden_topic_count', 'reply_count', 'hidden_reply_count', 'topic_tag_count', 'empty_topic_tag_count' );
450
  $statistics = array_map( 'absint', $statistics );
451
  $statistics = array_map( 'number_format_i18n', $statistics );
7
  * @subpackage Functions
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Meta *****************************************************************/
379
  // Topics
380
  if ( !empty( $count_topics ) ) {
381
 
382
+ $all_topics = wp_count_posts( bbp_get_topic_post_type() );
383
 
384
  // Published (publish + closed)
385
+ $topic_count = $all_topics->publish + $all_topics->{$bbp->closed_status_id};
386
 
387
  if ( current_user_can( 'read_private_topics' ) || current_user_can( 'edit_others_topics' ) || current_user_can( 'view_trash' ) ) {
388
 
389
  // Private
390
+ $topics['private'] = ( !empty( $count_private_topics ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->private : 0;
391
 
392
  // Spam
393
+ $topics['spammed'] = ( !empty( $count_spammed_topics ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$bbp->spam_status_id} : 0;
394
 
395
  // Trash
396
+ $topics['trashed'] = ( !empty( $count_trashed_topics ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$bbp->trash_status_id} : 0;
397
 
398
  // Total hidden (private + spam + trash)
399
+ $hidden_topic_count = $topics['private'] + $topics['spammed'] + $topics['trashed'];
400
 
401
  // Generate the hidden topic count's title attribute
402
+ $topic_titles[] = !empty( $topics['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $topics['private'] ) ) : '';
403
+ $topic_titles[] = !empty( $topics['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $topics['spammed'] ) ) : '';
404
+ $topic_titles[] = !empty( $topics['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $topics['trashed'] ) ) : '';
405
 
406
+ // Compile the hidden topic title
407
+ $hidden_topic_title = implode( ' | ', array_filter( $topic_titles ) );
408
  }
 
409
  }
410
 
411
  // Replies
412
  if ( !empty( $count_replies ) ) {
413
 
414
+ $all_replies = wp_count_posts( bbp_get_reply_post_type() );
415
 
416
  // Published
417
+ $reply_count = $all_replies->publish;
418
 
419
  if ( current_user_can( 'read_private_replies' ) || current_user_can( 'edit_others_replies' ) || current_user_can( 'view_trash' ) ) {
420
 
421
  // Private
422
+ $replies['private'] = ( !empty( $count_private_replies ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->private : 0;
423
 
424
  // Spam
425
+ $replies['spammed'] = ( !empty( $count_spammed_replies ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$bbp->spam_status_id} : 0;
426
 
427
  // Trash
428
+ $replies['trashed'] = ( !empty( $count_trashed_replies ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$bbp->trash_status_id} : 0;
429
 
430
  // Total hidden (private + spam + trash)
431
+ $hidden_reply_count = $replies['private'] + $replies['spammed'] + $replies['trashed'];
432
 
433
+ // Generate the hidden topic count's title attribute
434
+ $reply_titles[] = !empty( $replies['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $replies['private'] ) ) : '';
435
+ $reply_titles[] = !empty( $replies['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $replies['spammed'] ) ) : '';
436
+ $reply_titles[] = !empty( $replies['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $replies['trashed'] ) ) : '';
437
 
438
+ // Compile the hidden replies title
439
+ $hidden_reply_title = implode( ' | ', array_filter( $reply_titles ) );
440
 
441
+ }
442
  }
443
 
444
  // Topic Tags
445
  if ( !empty( $count_tags ) ) {
446
+
447
+ // Get the count
448
  $topic_tag_count = wp_count_terms( $bbp->topic_tag_id, array( 'hide_empty' => true ) );
449
 
450
+ // Empty tags
451
+ if ( !empty( $count_empty_tags ) && current_user_can( 'edit_topic_tags' ) ) {
452
  $empty_topic_tag_count = wp_count_terms( $bbp->topic_tag_id ) - $topic_tag_count;
453
+ }
454
  }
455
 
456
+ // Tally the tallies
457
  $statistics = compact( 'user_count', 'forum_count', 'topic_count', 'hidden_topic_count', 'reply_count', 'hidden_reply_count', 'topic_tag_count', 'empty_topic_tag_count' );
458
  $statistics = array_map( 'absint', $statistics );
459
  $statistics = array_map( 'number_format_i18n', $statistics );
bbp-includes/bbp-general-template.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage TemplateTags
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Add-on Actions ************************************************************/
@@ -669,14 +669,16 @@ function bbp_dropdown( $args = '' ) {
669
  function bbp_get_dropdown( $args = '' ) {
670
  global $bbp;
671
 
 
 
672
  $defaults = array (
673
  'post_type' => bbp_get_forum_post_type(),
674
  'selected' => 0,
675
  'sort_column' => 'menu_order',
676
  'child_of' => '0',
677
- 'post_status' => 'publish',
678
  'numberposts' => -1,
679
  'orderby' => 'menu_order',
 
680
  'walker' => '',
681
 
682
  // Output-related
@@ -699,22 +701,47 @@ function bbp_dropdown( $args = '' ) {
699
  if ( is_numeric( $r['selected'] ) && $r['selected'] < 0 )
700
  $r['selected'] = 0;
701
 
702
- $r = bbp_exclude_forum_ids( $r );
703
-
704
  extract( $r );
705
 
706
  // Unset the args not needed for WP_Query to avoid any possible conflicts.
707
  // Note: walker and disable_categories are not unset
708
  unset( $r['select_id'], $r['tab'], $r['options_only'], $r['show_none'], $r['none_found'] );
709
 
710
- // Setup variables
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
711
  $name = esc_attr( $select_id );
712
  $select_id = $name;
713
  $tab = (int) $tab;
714
  $retval = '';
715
  $posts = get_posts( $r );
716
 
717
- // Make a drop down if we found posts
 
 
718
  if ( !empty( $posts ) ) {
719
  if ( empty( $options_only ) ) {
720
  $tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : '';
@@ -727,7 +754,7 @@ function bbp_dropdown( $args = '' ) {
727
  if ( empty( $options_only ) )
728
  $retval .= '</select>';
729
 
730
- // Display feedback if no custom message was passed
731
  } elseif ( empty( $none_found ) ) {
732
 
733
  // Switch the response based on post type
@@ -1090,8 +1117,8 @@ function bbp_reset_query_name() {
1090
  * @param bool $root Include the root page if one exists
1091
  * @uses bbp_get_breadcrumb() To get the breadcrumb
1092
  */
1093
- function bbp_title_breadcrumb( $sep = ' &rsaquo; ' ) {
1094
- echo bbp_get_breadcrumb( $sep );
1095
  }
1096
 
1097
  /**
@@ -1104,8 +1131,8 @@ function bbp_title_breadcrumb( $sep = ' &rsaquo; ' ) {
1104
  * @param bool $root Include the root page if one exists
1105
  * @uses bbp_get_breadcrumb() To get the breadcrumb
1106
  */
1107
- function bbp_breadcrumb( $sep = ' &rsaquo; ', $current_page = true, $root = true ) {
1108
- echo bbp_get_breadcrumb( $sep, $current_page, $root );
1109
  }
1110
  /**
1111
  * Return a breadcrumb ( forum -> topic -> reply )
@@ -1131,30 +1158,45 @@ function bbp_breadcrumb( $sep = ' &rsaquo; ', $current_page = true, $root = true
1131
  * @uses apply_filters() Calls 'bbp_get_breadcrumb' with the crumbs
1132
  * @return string Breadcrumbs
1133
  */
1134
- function bbp_get_breadcrumb( $sep = ' &rsaquo; ', $current_page = true, $root = true ) {
1135
- global $post, $bbp;
1136
 
1137
- // No post, no breadcrumb
1138
- if ( empty( $post ) )
1139
  return;
1140
 
1141
- // Get post ancestors
1142
- $ancestors = array_reverse( get_post_ancestors( $post->ID ) );
1143
 
1144
- // Do we want to include the forum root?
1145
- if ( !empty( $root ) && ( get_option( '_bbp_include_root' ) ) && ( $root_slug = get_option( '_bbp_root_slug' ) ) ) {
 
 
1146
 
1147
- // Page exists at the root slug location, so add it to the breadcrumb
1148
- if ( $page = get_page_by_path( $root_slug ) )
1149
- $title = get_the_title( $page->ID );
1150
 
1151
- // Use generic root title
1152
- else
1153
- $title = __( 'Forums', 'bbpress' );
1154
 
1155
- // Add root slug
1156
- $breadcrumbs[] = '<a href="' . trailingslashit( home_url( $root_slug ) ) . '">' . $title . '</a>';
1157
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
1158
 
1159
  // Loop through parents
1160
  foreach( $ancestors as $parent_id ) {
@@ -1187,14 +1229,18 @@ function bbp_breadcrumb( $sep = ' &rsaquo; ', $current_page = true, $root = true
1187
  }
1188
 
1189
  // Add current page to breadcrumb
1190
- if ( true == $current_page )
1191
- $breadcrumbs[] = get_the_title();
1192
 
1193
  // Allow the separator of the breadcrumb to be easily changed
1194
- $sep = apply_filters( 'bbp_breadcrumb_separator', $sep );
 
 
 
 
1195
 
1196
  // Build the trail
1197
- $trail = !empty( $breadcrumbs ) ? implode( $sep, $breadcrumbs ) : '';
1198
 
1199
  return apply_filters( 'bbp_get_breadcrumb', $trail );
1200
  }
7
  * @subpackage TemplateTags
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Add-on Actions ************************************************************/
669
  function bbp_get_dropdown( $args = '' ) {
670
  global $bbp;
671
 
672
+ /** Arguments *********************************************************/
673
+
674
  $defaults = array (
675
  'post_type' => bbp_get_forum_post_type(),
676
  'selected' => 0,
677
  'sort_column' => 'menu_order',
678
  'child_of' => '0',
 
679
  'numberposts' => -1,
680
  'orderby' => 'menu_order',
681
+ 'order' => 'ASC',
682
  'walker' => '',
683
 
684
  // Output-related
701
  if ( is_numeric( $r['selected'] ) && $r['selected'] < 0 )
702
  $r['selected'] = 0;
703
 
 
 
704
  extract( $r );
705
 
706
  // Unset the args not needed for WP_Query to avoid any possible conflicts.
707
  // Note: walker and disable_categories are not unset
708
  unset( $r['select_id'], $r['tab'], $r['options_only'], $r['show_none'], $r['none_found'] );
709
 
710
+ /** Post Status *******************************************************/
711
+
712
+ // Public
713
+ $post_stati[] = 'publish';
714
+
715
+ // Forums
716
+ if ( bbp_get_forum_post_type() == $post_type ) {
717
+
718
+ // Private forums
719
+ if ( current_user_can( 'read_private_forums' ) )
720
+ $post_stati[] = 'private';
721
+
722
+ // Hidden forums
723
+ if ( current_user_can( 'read_hidden_forums' ) )
724
+ $post_stati[] = $bbp->hidden_status_id;
725
+
726
+ // Topics
727
+ } else {
728
+ $r = bbp_exclude_forum_ids( $r );
729
+ }
730
+
731
+ // Setup the post statuses
732
+ $r['post_status'] = implode( ',', $post_stati );
733
+
734
+ /** Setup variables ***************************************************/
735
+
736
  $name = esc_attr( $select_id );
737
  $select_id = $name;
738
  $tab = (int) $tab;
739
  $retval = '';
740
  $posts = get_posts( $r );
741
 
742
+ /** Drop Down *********************************************************/
743
+
744
+ // Items found
745
  if ( !empty( $posts ) ) {
746
  if ( empty( $options_only ) ) {
747
  $tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : '';
754
  if ( empty( $options_only ) )
755
  $retval .= '</select>';
756
 
757
+ // No items found - Display feedback if no custom message was passed
758
  } elseif ( empty( $none_found ) ) {
759
 
760
  // Switch the response based on post type
1117
  * @param bool $root Include the root page if one exists
1118
  * @uses bbp_get_breadcrumb() To get the breadcrumb
1119
  */
1120
+ function bbp_title_breadcrumb( $args = array() ) {
1121
+ echo bbp_get_breadcrumb( $args );
1122
  }
1123
 
1124
  /**
1131
  * @param bool $root Include the root page if one exists
1132
  * @uses bbp_get_breadcrumb() To get the breadcrumb
1133
  */
1134
+ function bbp_breadcrumb( $args = array() ) {
1135
+ echo bbp_get_breadcrumb( $args );
1136
  }
1137
  /**
1138
  * Return a breadcrumb ( forum -> topic -> reply )
1158
  * @uses apply_filters() Calls 'bbp_get_breadcrumb' with the crumbs
1159
  * @return string Breadcrumbs
1160
  */
1161
+ function bbp_get_breadcrumb( $args = array() ) {
1162
+ global $bbp;
1163
 
1164
+ // Turn off breadcrumbs
1165
+ if ( apply_filters( 'bbp_no_breadcrumb', false ) )
1166
  return;
1167
 
1168
+ // Parse args
1169
+ $defaults = array(
1170
 
1171
+ // HTML
1172
+ 'before' => '<div class="bbp-breadcrumb"><p>',
1173
+ 'after' => '</p></div>',
1174
+ 'sep' => is_rtl() ? ' &lsaquo; ' : ' &rsaquo; ',
1175
 
1176
+ // Home
1177
+ 'include_home' => true,
1178
+ 'home_text' => ( $front = get_option( 'page_on_front' ) ) ? get_the_title( $front ) : __( 'Home' ),
1179
 
1180
+ // Forum root
1181
+ 'include_root' => get_option( '_bbp_include_root' ),
1182
+ 'root_text' => ( $page = get_page_by_path( $bbp->root_slug ) ) ? get_the_title( $page->ID ) : __( 'Forums', 'bbpress' ),
1183
 
1184
+ // Current
1185
+ 'include_current' => true,
1186
+ );
1187
+ $r = wp_parse_args( $args, $defaults );
1188
+ extract( $r );
1189
+
1190
+ // Get post ancestors
1191
+ $ancestors = array_reverse( get_post_ancestors( get_the_ID() ) );
1192
+
1193
+ // Do we want to include a link to home?
1194
+ if ( !empty( $include_home ) )
1195
+ $breadcrumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $home_text . '</a>';
1196
+
1197
+ // Do we want to include a link to the forum root?
1198
+ if ( !empty( $include_root ) && ( !empty( $page ) && ( $front != $page->ID ) ) )
1199
+ $breadcrumbs[] = '<a href="' . trailingslashit( home_url( $bbp->root_slug ) ) . '" class="bbp-breadcrumb-root">' . $root_text . '</a>';
1200
 
1201
  // Loop through parents
1202
  foreach( $ancestors as $parent_id ) {
1229
  }
1230
 
1231
  // Add current page to breadcrumb
1232
+ if ( true == $include_current )
1233
+ $breadcrumbs[] = '<span class="bbp-breadcrumb-current">' . get_the_title() . '</span>';
1234
 
1235
  // Allow the separator of the breadcrumb to be easily changed
1236
+ $sep = apply_filters( 'bbp_breadcrumb_separator', $sep );
1237
+
1238
+ // Right to left support
1239
+ if ( is_rtl() )
1240
+ $breadcrumbs = apply_filters( 'bbp_breadcrumbs', array_reverse( $breadcrumbs ) );
1241
 
1242
  // Build the trail
1243
+ $trail = !empty( $breadcrumbs ) ? $before . implode( $sep, $breadcrumbs ) . $after: '';
1244
 
1245
  return apply_filters( 'bbp_get_breadcrumb', $trail );
1246
  }
bbp-includes/bbp-reply-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Functions
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
@@ -256,6 +256,9 @@ function bbp_new_reply_handler() {
256
  'post_type' => bbp_get_reply_post_type()
257
  );
258
 
 
 
 
259
  // Insert reply
260
  $reply_id = wp_insert_post( $reply_data );
261
 
@@ -273,13 +276,41 @@ function bbp_new_reply_handler() {
273
  if ( is_wp_error( $terms ) )
274
  $bbp->errors->add( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was some problem adding the tags to the topic.', 'bbpress' ) );
275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  // Update counts, etc...
277
  do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author );
278
 
 
 
 
 
 
 
 
 
 
279
  /** Successful Save *******************************************/
280
 
281
  // Redirect back to new reply
282
- wp_redirect( bbp_get_reply_url( $reply_id ) );
283
 
284
  // For good measure
285
  exit();
@@ -445,6 +476,9 @@ function bbp_edit_reply_handler() {
445
  'post_content' => $reply_content
446
  );
447
 
 
 
 
448
  // Insert reply
449
  $reply_id = wp_update_post( $reply_data );
450
 
@@ -669,6 +703,7 @@ function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymo
669
  * @uses bbp_update_forum_reply_count() To update the forum reply count
670
  */
671
  function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id = 0, $topic_id = 0, $refresh = true ) {
 
672
 
673
  // Verify the reply ID
674
  if ( $reply_id = bbp_get_reply_id( $reply_id ) ) {
7
  * @subpackage Functions
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
256
  'post_type' => bbp_get_reply_post_type()
257
  );
258
 
259
+ // Just in time manipulation of reply data before being created
260
+ $reply_data = apply_filters( 'bbp_new_reply_pre_insert', $reply_data );
261
+
262
  // Insert reply
263
  $reply_id = wp_insert_post( $reply_data );
264
 
276
  if ( is_wp_error( $terms ) )
277
  $bbp->errors->add( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was some problem adding the tags to the topic.', 'bbpress' ) );
278
 
279
+ /** Trash Check ***********************************************/
280
+
281
+ // If this reply starts as trash, add it to pre_trashed_replies
282
+ // for the topic, so it is properly restored.
283
+ if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] == $bbp->trash_status_id ) ) {
284
+
285
+ // Trash the reply
286
+ wp_trash_post( $reply_id );
287
+
288
+ // Get pre_trashed_replies for topic
289
+ $pre_trashed_replies = get_post_meta( $topic_id, '_bbp_pre_trashed_replies', true );
290
+
291
+ // Add this reply to the end of the existing replies
292
+ $pre_trashed_replies[] = $reply_id;
293
+
294
+ // Update the pre_trashed_reply post meta
295
+ update_post_meta( $topic_id, '_bbp_pre_trashed_replies', $pre_trashed_replies );
296
+ }
297
+
298
  // Update counts, etc...
299
  do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author );
300
 
301
+ /** Redirect **************************************************/
302
+
303
+ $reply_url = bbp_get_reply_url( $reply_id );
304
+
305
+ if ( ( !empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) ) || ( $reply_data['post_status'] == $bbp->trash_status_id ) )
306
+ $reply_url = add_query_arg( array( 'view' => 'all' ), $reply_url );
307
+
308
+ $reply_url = apply_filters( 'bbp_new_reply_redirect_to', $reply_url );
309
+
310
  /** Successful Save *******************************************/
311
 
312
  // Redirect back to new reply
313
+ wp_redirect( $reply_url );
314
 
315
  // For good measure
316
  exit();
476
  'post_content' => $reply_content
477
  );
478
 
479
+ // Just in time manipulation of reply data before being edited
480
+ $reply_data = apply_filters( 'bbp_edit_reply_pre_insert', $reply_data );
481
+
482
  // Insert reply
483
  $reply_id = wp_update_post( $reply_data );
484
 
703
  * @uses bbp_update_forum_reply_count() To update the forum reply count
704
  */
705
  function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id = 0, $topic_id = 0, $refresh = true ) {
706
+ global $bbp;
707
 
708
  // Verify the reply ID
709
  if ( $reply_id = bbp_get_reply_id( $reply_id ) ) {
bbp-includes/bbp-reply-template.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage TemplateTags
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Type *****************************************************************/
@@ -1144,13 +1144,13 @@ function bbp_reply_position( $reply_id = 0 ) {
1144
  * @param int $reply_id
1145
  * @uses bbp_get_reply_id() To get the reply id
1146
  * @uses bbp_get_reply_topic_id() Get the topic id of the reply id
1147
- * @uses bbp_get_topic_reply_count() To get the topic reply count
1148
- * @uses bbp_get_reply_post_type() To get the reply post type
1149
  * @uses bbp_get_public_child_ids() To get the reply ids of the topic id
1150
  * @uses bbp_show_lead_topic() Bump the count if lead topic is included
1151
  * @uses apply_filters() Calls 'bbp_get_reply_position' with the reply
1152
- * position, reply id and topic id
1153
- * @return int Reply position
1154
  */
1155
  function bbp_get_reply_position( $reply_id = 0 ) {
1156
 
@@ -1163,20 +1163,21 @@ function bbp_reply_position( $reply_id = 0 ) {
1163
  if ( $reply_count = bbp_get_topic_reply_count( $topic_id ) ) {
1164
 
1165
  // Get reply id's
1166
- $topic_replies = bbp_get_public_child_ids( $topic_id, bbp_get_reply_post_type() );
1167
 
1168
- // Reverse replies array and search for current reply position
1169
- $topic_replies = array_reverse( $topic_replies );
1170
 
1171
- // Position found
1172
- if ( $reply_position = array_search( (string) $reply_id, $topic_replies ) ) {
1173
 
1174
- // Bump if topic is in replies loop
1175
- if ( !bbp_show_lead_topic() )
1176
- $reply_position++;
1177
 
1178
- // Bump now so we don't need to do math later
1179
- $reply_position++;
 
1180
  }
1181
  }
1182
 
7
  * @subpackage TemplateTags
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Type *****************************************************************/
1144
  * @param int $reply_id
1145
  * @uses bbp_get_reply_id() To get the reply id
1146
  * @uses bbp_get_reply_topic_id() Get the topic id of the reply id
1147
+ * @uses bbp_get_topic_reply_count() To get the topic reply count
1148
+ * @uses bbp_get_reply_post_type() To get the reply post type
1149
  * @uses bbp_get_public_child_ids() To get the reply ids of the topic id
1150
  * @uses bbp_show_lead_topic() Bump the count if lead topic is included
1151
  * @uses apply_filters() Calls 'bbp_get_reply_position' with the reply
1152
+ * position, reply id and topic id
1153
+ * @return int Reply position
1154
  */
1155
  function bbp_get_reply_position( $reply_id = 0 ) {
1156
 
1163
  if ( $reply_count = bbp_get_topic_reply_count( $topic_id ) ) {
1164
 
1165
  // Get reply id's
1166
+ if ( $topic_replies = bbp_get_public_child_ids( $topic_id, bbp_get_reply_post_type() ) ) {
1167
 
1168
+ // Reverse replies array and search for current reply position
1169
+ $topic_replies = array_reverse( $topic_replies );
1170
 
1171
+ // Position found
1172
+ if ( $reply_position = array_search( (string) $reply_id, $topic_replies ) ) {
1173
 
1174
+ // Bump if topic is in replies loop
1175
+ if ( !bbp_show_lead_topic() )
1176
+ $reply_position++;
1177
 
1178
+ // Bump now so we don't need to do math later
1179
+ $reply_position++;
1180
+ }
1181
  }
1182
  }
1183
 
bbp-includes/bbp-topic-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Functions
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Form Handlers ********************************************************/
@@ -190,6 +190,9 @@ function bbp_new_topic_handler() {
190
  'post_type' => bbp_get_topic_post_type()
191
  );
192
 
 
 
 
193
  // Insert topic
194
  $topic_id = wp_insert_post( $topic_data );
195
 
@@ -219,16 +222,34 @@ function bbp_new_topic_handler() {
219
  default :
220
  break;
221
  }
 
 
 
 
 
 
 
222
 
 
 
223
  }
224
 
225
  // Update counts, etc...
226
  do_action( 'bbp_new_topic', $topic_id, $forum_id, $anonymous_data, $topic_author );
227
 
 
 
 
 
 
 
 
 
 
228
  /** Successful Save *******************************************/
229
 
230
- // Redirect back to new reply
231
- wp_redirect( bbp_get_topic_permalink( $topic_id ) . '#post-' . $topic_id );
232
 
233
  // For good measure
234
  exit();
@@ -443,6 +464,9 @@ function bbp_edit_topic_handler() {
443
  'tax_input' => $terms,
444
  );
445
 
 
 
 
446
  // Insert topic
447
  $topic_id = wp_update_post( $topic_data );
448
 
@@ -2401,10 +2425,14 @@ function bbp_trash_topic( $topic_id = 0 ) {
2401
 
2402
  do_action( 'bbp_trash_topic', $topic_id );
2403
 
2404
- // Topic is being permanently deleted, so its replies gotta go too
2405
  if ( bbp_has_replies( array( 'post_parent' => $topic_id, 'post_status' => 'publish', 'posts_per_page' => -1 ) ) ) {
2406
  global $bbp;
2407
 
 
 
 
 
2408
  while ( bbp_replies() ) {
2409
  bbp_the_reply();
2410
  wp_trash_post( $bbp->reply_query->post->ID );
7
  * @subpackage Functions
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Form Handlers ********************************************************/
190
  'post_type' => bbp_get_topic_post_type()
191
  );
192
 
193
+ // Just in time manipulation of topic data before being created
194
+ $topic_data = apply_filters( 'bbp_new_topic_pre_insert', $topic_data );
195
+
196
  // Insert topic
197
  $topic_id = wp_insert_post( $topic_data );
198
 
222
  default :
223
  break;
224
  }
225
+ }
226
+
227
+ /** Trash Check ***********************************************/
228
+
229
+ // If the forum is trash, or the topic_status is switched to
230
+ // trash, trash it properly
231
+ if ( ( get_post_field( 'post_status', $forum_id ) == $bbp->trash_status_id ) || ( $topic_data['post_status'] == $bbp->trash_status_id ) ) {
232
 
233
+ // Trash the reply
234
+ wp_trash_post( $topic_id );
235
  }
236
 
237
  // Update counts, etc...
238
  do_action( 'bbp_new_topic', $topic_id, $forum_id, $anonymous_data, $topic_author );
239
 
240
+ /** Redirect **************************************************/
241
+
242
+ $topic_url = bbp_get_topic_permalink( $topic_id );
243
+
244
+ if ( $bbp->trash_status_id == $topic_data['post_status'] )
245
+ $topic_url = add_query_arg( array( 'view' => 'all' ), $topic_url );
246
+
247
+ $topic_url = apply_filters( 'bbp_new_topic_redirect_to', $topic_url );
248
+
249
  /** Successful Save *******************************************/
250
 
251
+ // Redirect back to new topic
252
+ wp_redirect( $topic_url );
253
 
254
  // For good measure
255
  exit();
464
  'tax_input' => $terms,
465
  );
466
 
467
+ // Just in time manipulation of topic data before being edited
468
+ $topic_data = apply_filters( 'bbp_edit_topic_pre_insert', $topic_data );
469
+
470
  // Insert topic
471
  $topic_id = wp_update_post( $topic_data );
472
 
2425
 
2426
  do_action( 'bbp_trash_topic', $topic_id );
2427
 
2428
+ // Topic is being trashed, so its replies are trashed too
2429
  if ( bbp_has_replies( array( 'post_parent' => $topic_id, 'post_status' => 'publish', 'posts_per_page' => -1 ) ) ) {
2430
  global $bbp;
2431
 
2432
+ // Prevent debug notices
2433
+ $pre_trashed_replies = array();
2434
+
2435
+ // Loop through replies, trash them, and add them to array
2436
  while ( bbp_replies() ) {
2437
  bbp_the_reply();
2438
  wp_trash_post( $bbp->reply_query->post->ID );
bbp-includes/bbp-topic-template.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage TemplateTags
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Type *****************************************************************/
@@ -244,6 +244,10 @@ function bbp_has_topics( $args = '' ) {
244
  elseif ( is_post_type_archive( bbp_get_topic_post_type() ) )
245
  $base = user_trailingslashit( trailingslashit( home_url( $bbp->topic_archive_slug ) ) . 'page/%#%/' );
246
 
 
 
 
 
247
  // Default
248
  else
249
  $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' );
7
  * @subpackage TemplateTags
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Post Type *****************************************************************/
244
  elseif ( is_post_type_archive( bbp_get_topic_post_type() ) )
245
  $base = user_trailingslashit( trailingslashit( home_url( $bbp->topic_archive_slug ) ) . 'page/%#%/' );
246
 
247
+ // Page or single post
248
+ elseif ( is_page() || is_single() )
249
+ $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/' );
250
+
251
  // Default
252
  else
253
  $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' );
bbp-includes/bbp-user-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage Functions
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
@@ -25,17 +25,20 @@ if ( !defined( 'ABSPATH' ) ) exit;
25
  * @uses wp_safe_redirect() To redirect
26
  */
27
  function bbp_redirect_login( $url = '', $raw_url = '', $user = '' ) {
28
- if ( is_wp_error( $user ) )
29
- return $url;
30
 
31
- if ( empty( $url ) && !empty( $raw_url ) )
 
32
  $url = $raw_url;
33
 
34
- if ( empty( $url ) || $url == admin_url() )
 
35
  $url = home_url();
36
 
37
- wp_safe_redirect( esc_url( $url ) );
38
- exit;
 
 
 
39
  }
40
 
41
  /**
7
  * @subpackage Functions
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /**
25
  * @uses wp_safe_redirect() To redirect
26
  */
27
  function bbp_redirect_login( $url = '', $raw_url = '', $user = '' ) {
 
 
28
 
29
+ // Raw redirect_to was passed, so use it
30
+ if ( !empty( $raw_url ) )
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
38
+ elseif ( empty( $url ) )
39
+ $url = home_url();
40
+
41
+ return apply_filters( 'bbp_redirect_login', $url, $raw_url, $user );
42
  }
43
 
44
  /**
bbp-includes/bbp-user-template.php CHANGED
@@ -7,7 +7,7 @@
7
  * @subpackage TemplateTags
8
  */
9
 
10
- // Redirect if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Users *********************************************************************/
@@ -1072,7 +1072,7 @@ function bbp_user_can_view_forum( $args = '' ) {
1072
  $retval = true;
1073
 
1074
  // Forum is public, and user can read forums or is not logged in
1075
- elseif ( bbp_is_forum_public( $forum_id, $check_ancestors ) && ( !is_user_logged_in() || current_user_can( 'read_forum' ) ) )
1076
  $retval = true;
1077
 
1078
  // Forum is private, and user can see it
@@ -1162,35 +1162,39 @@ function bbp_current_user_can_access_create_topic_form() {
1162
  // Looking at a single forum
1163
  if ( bbp_is_forum() ) {
1164
 
1165
- // What is the visibility of this forum
1166
- switch ( bbp_get_forum_visibility() ) {
1167
 
1168
- // Public
1169
- case 'publish' :
1170
 
1171
- // User cannot publish topics
1172
- if ( current_user_can( 'publish_topics' ) )
1173
- $retval = true;
1174
 
1175
- // Anonymous posting is allowed
1176
- if ( bbp_allow_anonymous() && !is_user_logged_in() )
1177
- $retval = true;
1178
 
1179
- break;
 
 
1180
 
1181
- // Private forums
1182
- case 'private' :
1183
- if ( current_user_can( 'read_private_forums' ) )
1184
- $retval = true;
1185
 
1186
- break;
 
 
 
1187
 
1188
- // Hidden forums
1189
- case 'hidden' :
1190
- if ( current_user_can( 'read_hidden_forums' ) )
1191
- $retval = true;
1192
 
1193
- break;
 
 
 
 
 
 
1194
  }
1195
 
1196
  // Editing a single topic
@@ -1199,56 +1203,19 @@ function bbp_current_user_can_access_create_topic_form() {
1199
  // User can edit edit this topic
1200
  if ( current_user_can( 'edit_topic', bbp_get_topic_id() ) )
1201
  $retval = true;
1202
- }
1203
-
1204
- // Allow access to be filtered
1205
- return apply_filters( 'bbp_current_user_can_access_create_topic_form', $retval );
1206
- }
1207
-
1208
- /**
1209
- * Performs a series of checks to ensure the current user can create topics in
1210
- * this specific forum or scope.
1211
- *
1212
- * @since bbPress (r3127)
1213
- *
1214
- * @uses bbp_is_forum_category()
1215
- * @uses bbp_is_forum_closed()
1216
- * @uses current_user_can()
1217
- * @uses bbp_get_topic_forum_id()
1218
- * @uses bbp_is_topic_edit()
1219
- *
1220
- * @return bool
1221
- */
1222
- function bbp_current_user_can_create_topic_in_forum() {
1223
-
1224
- // Always allow super admins
1225
- if ( is_super_admin() )
1226
- return true;
1227
 
1228
- // Users need to earn access
1229
- $retval = false;
1230
-
1231
- // Looking at a single forum
1232
- if ( bbp_is_forum() ) {
1233
 
1234
- // Forum is not a category
1235
- if ( !bbp_is_forum_category() ) {
1236
-
1237
- // Forum is open
1238
- $retval = (bool) bbp_is_forum_open();
1239
- }
1240
-
1241
- // Editing a single topic
1242
- } elseif ( bbp_is_topic_edit() ) {
1243
-
1244
- // If you can edit this forum, you can edit topics in this forum
1245
- if ( current_user_can( 'edit_forum', bbp_get_topic_forum_id() ) )
1246
  $retval = true;
 
1247
  }
1248
 
1249
  // Allow access to be filtered
1250
- return apply_filters( 'bbp_current_user_can_create_topic_in_forum', $retval );
1251
  }
1252
 
1253
-
1254
  ?>
7
  * @subpackage TemplateTags
8
  */
9
 
10
+ // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Users *********************************************************************/
1072
  $retval = true;
1073
 
1074
  // Forum is public, and user can read forums or is not logged in
1075
+ elseif ( bbp_is_forum_public ( $forum_id, $check_ancestors ) )
1076
  $retval = true;
1077
 
1078
  // Forum is private, and user can see it
1162
  // Looking at a single forum
1163
  if ( bbp_is_forum() ) {
1164
 
1165
+ // Forum is open
1166
+ if ( bbp_is_forum_open() ) {
1167
 
1168
+ // What is the visibility of this forum
1169
+ switch ( bbp_get_forum_visibility() ) {
1170
 
1171
+ // Public
1172
+ case 'publish' :
 
1173
 
1174
+ // User cannot publish topics
1175
+ if ( current_user_can( 'publish_topics' ) )
1176
+ $retval = true;
1177
 
1178
+ // Anonymous posting is allowed
1179
+ if ( bbp_allow_anonymous() && !is_user_logged_in() )
1180
+ $retval = true;
1181
 
1182
+ break;
 
 
 
1183
 
1184
+ // Private forums
1185
+ case 'private' :
1186
+ if ( current_user_can( 'read_private_forums' ) )
1187
+ $retval = true;
1188
 
1189
+ break;
 
 
 
1190
 
1191
+ // Hidden forums
1192
+ case 'hidden' :
1193
+ if ( current_user_can( 'read_hidden_forums' ) )
1194
+ $retval = true;
1195
+
1196
+ break;
1197
+ }
1198
  }
1199
 
1200
  // Editing a single topic
1203
  // User can edit edit this topic
1204
  if ( current_user_can( 'edit_topic', bbp_get_topic_id() ) )
1205
  $retval = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1206
 
1207
+ // Fallback for shortcodes
1208
+ } elseif ( is_page() || is_single() ) {
 
 
 
1209
 
1210
+ // Page or single post, and user can publish topics or anonymous
1211
+ // posting is allowed.
1212
+ if ( current_user_can( 'publish_topics' ) || ( !is_user_logged_in() && bbp_allow_anonymous() ) )
 
 
 
 
 
 
 
 
 
1213
  $retval = true;
1214
+
1215
  }
1216
 
1217
  // Allow access to be filtered
1218
+ return apply_filters( 'bbp_current_user_can_access_create_topic_form', $retval );
1219
  }
1220
 
 
1221
  ?>
bbpress.pot → bbp-languages/bbpress.pot RENAMED
File without changes
bbp-themes/bbp-twentyten/archive-forum.php CHANGED
@@ -16,30 +16,26 @@
16
 
17
  <?php do_action( 'bbp_template_notices' ); ?>
18
 
19
- <?php while ( have_posts() ) : the_post(); ?>
 
 
20
 
21
- <div id="forum-front" class="bbp-forum-front">
22
- <h1 class="entry-title"><?php the_title(); ?></h1>
23
- <div class="entry-content">
24
 
25
- <?php do_action( 'bbp_template_before_forums_index' ); ?>
26
 
27
- <?php if ( bbp_has_forums() ) : ?>
28
 
29
- <?php bbp_get_template_part( 'bbpress/loop', 'forums' ); ?>
30
 
31
- <?php else : ?>
32
 
33
- <?php bbp_get_template_part( 'bbpress/no', 'forums' ); ?>
34
 
35
- <?php endif; ?>
36
 
37
- <?php do_action( 'bbp_template_after_forums_index' ); ?>
38
-
39
- </div>
40
- </div><!-- #forum-front -->
41
-
42
- <?php endwhile; ?>
43
 
44
  </div><!-- #content -->
45
  </div><!-- #container -->
16
 
17
  <?php do_action( 'bbp_template_notices' ); ?>
18
 
19
+ <div id="forum-front" class="bbp-forum-front">
20
+ <h1 class="entry-title"><?php _e( 'Forums', 'bbpress' ); ?></h1>
21
+ <div class="entry-content">
22
 
23
+ <?php do_action( 'bbp_template_before_forums_index' ); ?>
 
 
24
 
25
+ <?php if ( bbp_has_forums() ) : ?>
26
 
27
+ <?php bbp_get_template_part( 'bbpress/loop', 'forums' ); ?>
28
 
29
+ <?php else : ?>
30
 
31
+ <?php bbp_get_template_part( 'bbpress/no', 'forums' ); ?>
32
 
33
+ <?php endif; ?>
34
 
35
+ <?php do_action( 'bbp_template_after_forums_index' ); ?>
36
 
37
+ </div>
38
+ </div><!-- #forum-front -->
 
 
 
 
39
 
40
  </div><!-- #content -->
41
  </div><!-- #container -->
bbp-themes/bbp-twentyten/archive-topic.php CHANGED
@@ -22,7 +22,7 @@
22
  <h1 class="entry-title"><?php the_title(); ?></h1>
23
  <div class="entry-content">
24
 
25
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
26
 
27
  <?php do_action( 'bbp_template_before_topics_index' ); ?>
28
 
22
  <h1 class="entry-title"><?php the_title(); ?></h1>
23
  <div class="entry-content">
24
 
25
+ <?php bbp_breadcrumb(); ?>
26
 
27
  <?php do_action( 'bbp_template_before_topics_index' ); ?>
28
 
bbp-themes/bbp-twentyten/bbpress/action-edit.php CHANGED
@@ -20,7 +20,7 @@
20
  <h1 class="entry-title"><?php the_title(); ?></h1>
21
  <div class="entry-content">
22
 
23
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
24
 
25
  <?php if ( bbp_is_reply_edit() ) : ?>
26
 
20
  <h1 class="entry-title"><?php the_title(); ?></h1>
21
  <div class="entry-content">
22
 
23
+ <?php bbp_breadcrumb(); ?>
24
 
25
  <?php if ( bbp_is_reply_edit() ) : ?>
26
 
bbp-themes/bbp-twentyten/bbpress/action-split-merge.php CHANGED
@@ -22,7 +22,7 @@
22
  <h1 class="entry-title"><?php the_title(); ?></h1>
23
  <div class="entry-content">
24
 
25
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
26
 
27
  <?php if ( bbp_is_topic_merge() ) : ?>
28
 
22
  <h1 class="entry-title"><?php the_title(); ?></h1>
23
  <div class="entry-content">
24
 
25
+ <?php bbp_breadcrumb(); ?>
26
 
27
  <?php if ( bbp_is_topic_merge() ) : ?>
28
 
bbp-themes/bbp-twentyten/bbpress/form-anonymous.php CHANGED
@@ -11,7 +11,7 @@
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>
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 />
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 />
bbp-themes/bbp-twentyten/bbpress/form-merge.php CHANGED
@@ -15,7 +15,7 @@
15
 
16
  <form id="merge_topic" name="merge_topic" method="post" action="">
17
 
18
- <fieldset>
19
 
20
  <legend><?php printf( __( 'Merge topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
21
 
@@ -30,7 +30,7 @@
30
  <p><?php _e( 'All replies within both topics will be merged chronologically. The order of the merged replies is based on the time and date they were posted. If the destination topic was created after this one, it\'s post date will be updated to second earlier than this one.', 'bbpress' ); ?></p>
31
  </div>
32
 
33
- <fieldset>
34
  <legend><?php _e( 'Destination', 'bbpress' ); ?></legend>
35
  <div>
36
  <?php if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ), 'post__not_in' => array( bbp_get_topic_id() ) ) ) ) : ?>
@@ -57,7 +57,7 @@
57
  </div>
58
  </fieldset>
59
 
60
- <fieldset>
61
  <legend><?php _e( 'Topic Extras', 'bbpress' ); ?></legend>
62
 
63
  <div>
@@ -96,7 +96,6 @@
96
  <?php else : ?>
97
 
98
  <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
99
- <h2 class="entry-title"><?php _e( 'Sorry!', 'bbpress' ); ?></h2>
100
  <div class="entry-content"><?php is_user_logged_in() ? _e( 'You do not have the permissions to edit this topic!', 'bbpress' ) : _e( 'You cannot edit this topic.', 'bbpress' ); ?></div>
101
  </div>
102
 
15
 
16
  <form id="merge_topic" name="merge_topic" method="post" action="">
17
 
18
+ <fieldset class="bbp-form">
19
 
20
  <legend><?php printf( __( 'Merge topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
21
 
30
  <p><?php _e( 'All replies within both topics will be merged chronologically. The order of the merged replies is based on the time and date they were posted. If the destination topic was created after this one, it\'s post date will be updated to second earlier than this one.', 'bbpress' ); ?></p>
31
  </div>
32
 
33
+ <fieldset class="bbp-form">
34
  <legend><?php _e( 'Destination', 'bbpress' ); ?></legend>
35
  <div>
36
  <?php if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ), 'post__not_in' => array( bbp_get_topic_id() ) ) ) ) : ?>
57
  </div>
58
  </fieldset>
59
 
60
+ <fieldset class="bbp-form">
61
  <legend><?php _e( 'Topic Extras', 'bbpress' ); ?></legend>
62
 
63
  <div>
96
  <?php else : ?>
97
 
98
  <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
 
99
  <div class="entry-content"><?php is_user_logged_in() ? _e( 'You do not have the permissions to edit this topic!', 'bbpress' ) : _e( 'You cannot edit this topic.', 'bbpress' ); ?></div>
100
  </div>
101
 
bbp-themes/bbp-twentyten/bbpress/form-protected.php CHANGED
@@ -12,7 +12,7 @@ wp_reset_postdata();
12
 
13
  ?>
14
 
15
- <fieldset id="bbp-protected">
16
  <Legend><?php _e( 'Protected', 'bbpress' ); ?></legend>
17
 
18
  <?php echo get_the_password_form(); ?>
12
 
13
  ?>
14
 
15
+ <fieldset class="bbp-form" id="bbp-protected">
16
  <Legend><?php _e( 'Protected', 'bbpress' ); ?></legend>
17
 
18
  <?php echo get_the_password_form(); ?>
bbp-themes/bbp-twentyten/bbpress/form-reply.php CHANGED
@@ -19,7 +19,7 @@ wp_reset_postdata();
19
  <div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form">
20
 
21
  <form id="new-post" name="new-post" method="post" action="">
22
- <fieldset>
23
  <legend><?php printf( __( 'Reply to: &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
24
 
25
  <?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>
@@ -30,11 +30,19 @@ wp_reset_postdata();
30
 
31
  <?php endif; ?>
32
 
 
 
 
 
 
 
 
 
33
  <?php do_action( 'bbp_template_notices' ); ?>
34
 
35
  <div>
36
 
37
- <div class="alignright avatar">
38
 
39
  <?php bbp_is_reply_edit() ? bbp_reply_author_avatar( bbp_get_reply_id(), 120 ) : bbp_current_user_avatar( 120 ); ?>
40
 
@@ -47,10 +55,14 @@ wp_reset_postdata();
47
  <textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" cols="51" rows="6"><?php bbp_form_reply_content(); ?></textarea>
48
  </p>
49
 
50
- <p class="form-allowed-tags">
51
- <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
52
- <code><?php bbp_allowed_tags(); ?></code>
53
- </p>
 
 
 
 
54
 
55
  <p>
56
  <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
@@ -79,7 +91,7 @@ wp_reset_postdata();
79
 
80
  <?php if ( bbp_is_reply_edit() ) : ?>
81
 
82
- <fieldset>
83
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
84
  <div>
85
  <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(); ?>" />
@@ -112,7 +124,6 @@ wp_reset_postdata();
112
  <?php else : ?>
113
 
114
  <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
115
- <h2 class="entry-title"><?php _e( 'Sorry!', 'bbpress' ); ?></h2>
116
  <div class="bbp-template-notice">
117
  <p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>
118
  </div>
@@ -123,7 +134,6 @@ wp_reset_postdata();
123
  <?php else : ?>
124
 
125
  <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
126
- <h2 class="entry-title"><?php _e( 'Topic Closed', 'bbpress' ); ?></h2>
127
  <div class="bbp-template-notice">
128
  <p><?php _e( 'This topic has been closed to new replies.', 'bbpress' ); ?></p>
129
  </div>
19
  <div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form">
20
 
21
  <form id="new-post" name="new-post" method="post" action="">
22
+ <fieldset class="bbp-form">
23
  <legend><?php printf( __( 'Reply to: &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
24
 
25
  <?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>
30
 
31
  <?php endif; ?>
32
 
33
+ <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
34
+
35
+ <div class="bbp-template-notice">
36
+ <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
37
+ </div>
38
+
39
+ <?php endif; ?>
40
+
41
  <?php do_action( 'bbp_template_notices' ); ?>
42
 
43
  <div>
44
 
45
+ <div class="avatar">
46
 
47
  <?php bbp_is_reply_edit() ? bbp_reply_author_avatar( bbp_get_reply_id(), 120 ) : bbp_current_user_avatar( 120 ); ?>
48
 
55
  <textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" cols="51" rows="6"><?php bbp_form_reply_content(); ?></textarea>
56
  </p>
57
 
58
+ <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
59
+
60
+ <p class="form-allowed-tags">
61
+ <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
62
+ <code><?php bbp_allowed_tags(); ?></code>
63
+ </p>
64
+
65
+ <?php endif; ?>
66
 
67
  <p>
68
  <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
91
 
92
  <?php if ( bbp_is_reply_edit() ) : ?>
93
 
94
+ <fieldset class="bbp-form">
95
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
96
  <div>
97
  <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(); ?>" />
124
  <?php else : ?>
125
 
126
  <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
 
127
  <div class="bbp-template-notice">
128
  <p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>
129
  </div>
134
  <?php else : ?>
135
 
136
  <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
 
137
  <div class="bbp-template-notice">
138
  <p><?php _e( 'This topic has been closed to new replies.', 'bbpress' ); ?></p>
139
  </div>
bbp-themes/bbp-twentyten/bbpress/form-split.php CHANGED
@@ -15,7 +15,7 @@
15
 
16
  <form id="split_topic" name="split_topic" method="post" action="">
17
 
18
- <fieldset>
19
 
20
  <legend><?php printf( __( 'Split topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
21
 
@@ -29,7 +29,7 @@
29
  <p><?php _e( 'If you use the existing topic option, replies within both topics will be merged chronologically. The order of the merged replies is based on the time and date they were posted.', 'bbpress' ); ?></p>
30
  </div>
31
 
32
- <fieldset>
33
  <legend><?php _e( 'Split Method', 'bbpress' ); ?></legend>
34
 
35
  <div>
@@ -61,7 +61,7 @@
61
 
62
  </fieldset>
63
 
64
- <fieldset>
65
  <legend><?php _e( 'Topic Extras', 'bbpress' ); ?></legend>
66
 
67
  <div>
@@ -100,9 +100,7 @@
100
  <?php else : ?>
101
 
102
  <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
103
- <h2 class="entry-title"><?php _e( 'Sorry!', 'bbpress' ); ?></h2>
104
  <div class="entry-content"><?php is_user_logged_in() ? _e( 'You do not have the permissions to edit this topic!', 'bbpress' ) : _e( 'You cannot edit this topic.', 'bbpress' ); ?></div>
105
  </div>
106
 
107
-
108
  <?php endif; ?>
15
 
16
  <form id="split_topic" name="split_topic" method="post" action="">
17
 
18
+ <fieldset class="bbp-form">
19
 
20
  <legend><?php printf( __( 'Split topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
21
 
29
  <p><?php _e( 'If you use the existing topic option, replies within both topics will be merged chronologically. The order of the merged replies is based on the time and date they were posted.', 'bbpress' ); ?></p>
30
  </div>
31
 
32
+ <fieldset class="bbp-form">
33
  <legend><?php _e( 'Split Method', 'bbpress' ); ?></legend>
34
 
35
  <div>
61
 
62
  </fieldset>
63
 
64
+ <fieldset class="bbp-form">
65
  <legend><?php _e( 'Topic Extras', 'bbpress' ); ?></legend>
66
 
67
  <div>
100
  <?php else : ?>
101
 
102
  <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
 
103
  <div class="entry-content"><?php is_user_logged_in() ? _e( 'You do not have the permissions to edit this topic!', 'bbpress' ) : _e( 'You cannot edit this topic.', 'bbpress' ); ?></div>
104
  </div>
105
 
 
106
  <?php endif; ?>
bbp-themes/bbp-twentyten/bbpress/form-topic-tag.php CHANGED
@@ -13,11 +13,11 @@
13
 
14
  <div id="edit-topic-tag-<?php bbp_topic_tag_id(); ?>" class="bbp-topic-tag-form">
15
 
16
- <fieldset>
17
 
18
  <legend><?php printf( __( 'Manage Tag: "%s"', 'bbpress' ), bbp_get_topic_tag_name() ); ?></legend>
19
 
20
- <fieldset id="tag-rename">
21
 
22
  <legend><?php _e( 'Rename', 'bbpress' ); ?></legend>
23
 
@@ -31,17 +31,17 @@
31
 
32
  <form id="rename_tag" name="rename_tag" method="post" action="">
33
 
34
- <div class="alignleft">
35
  <label for="tag-name"><?php _e( 'Name:', 'bbpress' ); ?></label>
36
  <input type="text" name="tag-name" size="20" maxlength="40" tabindex="<?php bbp_tab_index(); ?>" value="<?php echo esc_attr( bbp_get_topic_tag_slug() ); ?>" />
37
  </div>
38
 
39
- <div class="alignleft">
40
  <label for="tag-name"><?php _e( 'Slug:', 'bbpress' ); ?></label>
41
  <input type="text" name="tag-slug" size="20" maxlength="40" tabindex="<?php bbp_tab_index(); ?>" value="<?php echo esc_attr( apply_filters( 'editable_slug', bbp_get_topic_tag_slug() ) ); ?>" />
42
  </div>
43
 
44
- <div class="alignright">
45
  <input type="submit" name="submit" tabindex="<?php bbp_tab_index(); ?>" value="<?php esc_attr_e( 'Update', 'bbpress' ); ?>" /><br />
46
 
47
  <input type="hidden" name="tag-id" value="<?php bbp_get_topic_tag_id(); ?>" />
@@ -54,7 +54,7 @@
54
 
55
  </fieldset>
56
 
57
- <fieldset id="tag-merge">
58
 
59
  <legend><?php _e( 'Merge', 'bbpress' ); ?></legend>
60
 
@@ -64,12 +64,12 @@
64
 
65
  <form id="merge_tag" name="merge_tag" method="post" action="">
66
 
67
- <div class="alignleft">
68
  <label for="tag-name"><?php _e( 'Existing tag:', 'bbpress' ); ?></label>
69
  <input type="text" name="tag-name" size="22" tabindex="<?php bbp_tab_index(); ?>" maxlength="40" />
70
  </div>
71
 
72
- <div class="alignright">
73
  <input type="submit" name="submit" tabindex="<?php bbp_tab_index(); ?>" value="<?php esc_attr_e( 'Merge', 'bbpress' ); ?>"
74
  onclick="return confirm('<?php echo esc_js( sprintf( __( 'Are you sure you want to merge the "%s" tag into the tag you specified?', 'bbpress' ), bbp_get_topic_tag_name() ) ); ?>');" />
75
 
@@ -84,7 +84,7 @@
84
 
85
  <?php if ( current_user_can( 'delete_topic_tags' ) ) : ?>
86
 
87
- <fieldset id="delete-tag">
88
 
89
  <legend><?php _e( 'Delete', 'bbpress' ); ?></legend>
90
 
@@ -98,7 +98,7 @@
98
 
99
  <form id="delete_tag" name="delete_tag" method="post" action="">
100
 
101
- <div class="alignright">
102
  <input type="submit" name="submit" tabindex="<?php bbp_tab_index(); ?>" value="<?php _e( 'Delete', 'bbpress' ); ?>"
103
  onclick="return confirm('<?php echo esc_js( sprintf( __( 'Are you sure you want to delete the "%s" tag? This is permanent and cannot be undone.', 'bbpress' ), bbp_get_topic_tag_name() ) ); ?>');" />
104
 
13
 
14
  <div id="edit-topic-tag-<?php bbp_topic_tag_id(); ?>" class="bbp-topic-tag-form">
15
 
16
+ <fieldset class="bbp-form" id="bbp-edit-topic-tag">
17
 
18
  <legend><?php printf( __( 'Manage Tag: "%s"', 'bbpress' ), bbp_get_topic_tag_name() ); ?></legend>
19
 
20
+ <fieldset class="bbp-form" id="tag-rename">
21
 
22
  <legend><?php _e( 'Rename', 'bbpress' ); ?></legend>
23
 
31
 
32
  <form id="rename_tag" name="rename_tag" method="post" action="">
33
 
34
+ <div>
35
  <label for="tag-name"><?php _e( 'Name:', 'bbpress' ); ?></label>
36
  <input type="text" name="tag-name" size="20" maxlength="40" tabindex="<?php bbp_tab_index(); ?>" value="<?php echo esc_attr( bbp_get_topic_tag_slug() ); ?>" />
37
  </div>
38
 
39
+ <div>
40
  <label for="tag-name"><?php _e( 'Slug:', 'bbpress' ); ?></label>
41
  <input type="text" name="tag-slug" size="20" maxlength="40" tabindex="<?php bbp_tab_index(); ?>" value="<?php echo esc_attr( apply_filters( 'editable_slug', bbp_get_topic_tag_slug() ) ); ?>" />
42
  </div>
43
 
44
+ <div class="bbp-submit-wrapper">
45
  <input type="submit" name="submit" tabindex="<?php bbp_tab_index(); ?>" value="<?php esc_attr_e( 'Update', 'bbpress' ); ?>" /><br />
46
 
47
  <input type="hidden" name="tag-id" value="<?php bbp_get_topic_tag_id(); ?>" />
54
 
55
  </fieldset>
56
 
57
+ <fieldset class="bbp-form" id="tag-merge">
58
 
59
  <legend><?php _e( 'Merge', 'bbpress' ); ?></legend>
60
 
64
 
65
  <form id="merge_tag" name="merge_tag" method="post" action="">
66
 
67
+ <div>
68
  <label for="tag-name"><?php _e( 'Existing tag:', 'bbpress' ); ?></label>
69
  <input type="text" name="tag-name" size="22" tabindex="<?php bbp_tab_index(); ?>" maxlength="40" />
70
  </div>
71
 
72
+ <div class="bbp-submit-wrapper">
73
  <input type="submit" name="submit" tabindex="<?php bbp_tab_index(); ?>" value="<?php esc_attr_e( 'Merge', 'bbpress' ); ?>"
74
  onclick="return confirm('<?php echo esc_js( sprintf( __( 'Are you sure you want to merge the "%s" tag into the tag you specified?', 'bbpress' ), bbp_get_topic_tag_name() ) ); ?>');" />
75
 
84
 
85
  <?php if ( current_user_can( 'delete_topic_tags' ) ) : ?>
86
 
87
+ <fieldset class="bbp-form" id="delete-tag">
88
 
89
  <legend><?php _e( 'Delete', 'bbpress' ); ?></legend>
90
 
98
 
99
  <form id="delete_tag" name="delete_tag" method="post" action="">
100
 
101
+ <div class="bbp-submit-wrapper">
102
  <input type="submit" name="submit" tabindex="<?php bbp_tab_index(); ?>" value="<?php _e( 'Delete', 'bbpress' ); ?>"
103
  onclick="return confirm('<?php echo esc_js( sprintf( __( 'Are you sure you want to delete the "%s" tag? This is permanent and cannot be undone.', 'bbpress' ), bbp_get_topic_tag_name() ) ); ?>');" />
104
 
bbp-themes/bbp-twentyten/bbpress/form-topic.php CHANGED
@@ -12,14 +12,12 @@ wp_reset_postdata();
12
 
13
  ?>
14
 
15
- <?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
16
-
17
- <?php if ( bbp_current_user_can_create_topic_in_forum() ) : ?>
18
 
19
  <div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form">
20
 
21
  <form id="new-post" name="new-post" method="post" action="">
22
- <fieldset>
23
  <legend>
24
 
25
  <?php
@@ -39,10 +37,18 @@ wp_reset_postdata();
39
 
40
  <?php endif; ?>
41
 
 
 
 
 
 
 
 
 
42
  <?php do_action( 'bbp_template_notices' ); ?>
43
 
44
  <div>
45
- <div class="alignright avatar">
46
 
47
  <?php bbp_is_topic_edit() ? bbp_topic_author_avatar( bbp_get_topic_id(), 120 ) : bbp_current_user_avatar( 120 ); ?>
48
 
@@ -60,10 +66,14 @@ wp_reset_postdata();
60
  <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="51" rows="6"><?php bbp_form_topic_content(); ?></textarea>
61
  </p>
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 />
65
- <code><?php bbp_allowed_tags(); ?></code>
66
- </p>
 
 
 
 
67
 
68
  <p>
69
  <label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
@@ -111,7 +121,7 @@ wp_reset_postdata();
111
 
112
  <?php if ( bbp_is_topic_edit() ) : ?>
113
 
114
- <fieldset>
115
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
116
  <div>
117
  <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(); ?>" />
@@ -140,22 +150,17 @@ wp_reset_postdata();
140
  <?php elseif ( bbp_is_forum_closed() ) : ?>
141
 
142
  <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
143
- <h2 class="entry-title"><?php _e( 'Sorry!', 'bbpress' ); ?></h2>
144
  <div class="bbp-template-notice">
145
  <p><?php _e( 'This forum is closed to new topics.', 'bbpress' ); ?></p>
146
  </div>
147
  </div>
148
 
149
- <?php endif; ?>
150
 
151
- <?php else : ?>
152
-
153
- <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
154
- <h2 class="entry-title"><?php _e( 'Sorry!', 'bbpress' ); ?></h2>
155
- <div class="bbp-template-notice">
156
- <p><?php is_user_logged_in() ? _e( 'You cannot create new topics at this time.', 'bbpress' ) : _e( 'You must be logged in to create new topics.', 'bbpress' ); ?></p>
157
  </div>
158
- </div>
159
 
160
-
161
- <?php endif; ?>
12
 
13
  ?>
14
 
15
+ <?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
 
 
16
 
17
  <div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form">
18
 
19
  <form id="new-post" name="new-post" method="post" action="">
20
+ <fieldset class="bbp-form">
21
  <legend>
22
 
23
  <?php
37
 
38
  <?php endif; ?>
39
 
40
+ <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
41
+
42
+ <div class="bbp-template-notice">
43
+ <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
44
+ </div>
45
+
46
+ <?php endif; ?>
47
+
48
  <?php do_action( 'bbp_template_notices' ); ?>
49
 
50
  <div>
51
+ <div class="avatar">
52
 
53
  <?php bbp_is_topic_edit() ? bbp_topic_author_avatar( bbp_get_topic_id(), 120 ) : bbp_current_user_avatar( 120 ); ?>
54
 
66
  <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="51" rows="6"><?php bbp_form_topic_content(); ?></textarea>
67
  </p>
68
 
69
+ <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
70
+
71
+ <p class="form-allowed-tags">
72
+ <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
73
+ <code><?php bbp_allowed_tags(); ?></code>
74
+ </p>
75
+
76
+ <?php endif; ?>
77
 
78
  <p>
79
  <label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
121
 
122
  <?php if ( bbp_is_topic_edit() ) : ?>
123
 
124
+ <fieldset class="bbp-form">
125
  <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
126
  <div>
127
  <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(); ?>" />
150
  <?php elseif ( bbp_is_forum_closed() ) : ?>
151
 
152
  <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
 
153
  <div class="bbp-template-notice">
154
  <p><?php _e( 'This forum is closed to new topics.', 'bbpress' ); ?></p>
155
  </div>
156
  </div>
157
 
158
+ <?php else : ?>
159
 
160
+ <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
161
+ <div class="bbp-template-notice">
162
+ <p><?php is_user_logged_in() ? _e( 'You cannot create new topics at this time.', 'bbpress' ) : _e( 'You must be logged in to create new topics.', 'bbpress' ); ?></p>
163
+ </div>
 
 
164
  </div>
 
165
 
166
+ <?php endif; ?>
 
bbp-themes/bbp-twentyten/bbpress/form-user-edit.php CHANGED
@@ -15,7 +15,7 @@
15
 
16
  <?php do_action( 'bbp_user_edit_before' ); ?>
17
 
18
- <fieldset>
19
  <legend><?php _e( 'Name', 'bbpress' ) ?></legend>
20
 
21
  <?php do_action( 'bbp_user_edit_before_name' ); ?>
@@ -48,7 +48,7 @@
48
 
49
  <h2 class="entry-title"><?php _e( 'Contact Info', 'bbpress' ) ?></h2>
50
 
51
- <fieldset>
52
  <legend><?php _e( 'Contact Info', 'bbpress' ) ?></legend>
53
 
54
  <?php do_action( 'bbp_user_edit_before_contact' ); ?>
@@ -73,7 +73,7 @@
73
 
74
  <h2 class="entry-title"><?php bbp_is_user_home() ? _e( 'About Yourself', 'bbpress' ) : _e( 'About the user', 'bbpress' ); ?></h2>
75
 
76
- <fieldset>
77
  <legend><?php bbp_is_user_home() ? _e( 'About Yourself', 'bbpress' ) : _e( 'About the user', 'bbpress' ); ?></legend>
78
 
79
  <?php do_action( 'bbp_user_edit_before_about' ); ?>
@@ -90,7 +90,7 @@
90
 
91
  <h2 class="entry-title"><?php _e( 'Account' ) ?></h2>
92
 
93
- <fieldset>
94
  <legend><?php _e( 'Account' ) ?></legend>
95
 
96
  <?php do_action( 'bbp_user_edit_before_account' ); ?>
@@ -124,7 +124,7 @@
124
 
125
  <div id="password">
126
  <label for="pass1"><?php _e( 'New Password', 'bbpress' ); ?></label>
127
- <fieldset>
128
  <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" />
129
  <span class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'bbpress' ); ?></span>
130
 
15
 
16
  <?php do_action( 'bbp_user_edit_before' ); ?>
17
 
18
+ <fieldset class="bbp-form">
19
  <legend><?php _e( 'Name', 'bbpress' ) ?></legend>
20
 
21
  <?php do_action( 'bbp_user_edit_before_name' ); ?>
48
 
49
  <h2 class="entry-title"><?php _e( 'Contact Info', 'bbpress' ) ?></h2>
50
 
51
+ <fieldset class="bbp-form">
52
  <legend><?php _e( 'Contact Info', 'bbpress' ) ?></legend>
53
 
54
  <?php do_action( 'bbp_user_edit_before_contact' ); ?>
73
 
74
  <h2 class="entry-title"><?php bbp_is_user_home() ? _e( 'About Yourself', 'bbpress' ) : _e( 'About the user', 'bbpress' ); ?></h2>
75
 
76
+ <fieldset class="bbp-form">
77
  <legend><?php bbp_is_user_home() ? _e( 'About Yourself', 'bbpress' ) : _e( 'About the user', 'bbpress' ); ?></legend>
78
 
79
  <?php do_action( 'bbp_user_edit_before_about' ); ?>
90
 
91
  <h2 class="entry-title"><?php _e( 'Account' ) ?></h2>
92
 
93
+ <fieldset class="bbp-form">
94
  <legend><?php _e( 'Account' ) ?></legend>
95
 
96
  <?php do_action( 'bbp_user_edit_before_account' ); ?>
124
 
125
  <div id="password">
126
  <label for="pass1"><?php _e( 'New Password', 'bbpress' ); ?></label>
127
+ <fieldset class="bbp-form">
128
  <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" />
129
  <span class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'bbpress' ); ?></span>
130
 
bbp-themes/bbp-twentyten/bbpress/form-user-login.php CHANGED
@@ -10,7 +10,7 @@
10
  ?>
11
 
12
  <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form">
13
- <fieldset>
14
  <legend><?php _e( 'Login', 'bbpress' ); ?></legend>
15
 
16
  <div class="bbp-username">
10
  ?>
11
 
12
  <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form">
13
+ <fieldset class="bbp-form">
14
  <legend><?php _e( 'Login', 'bbpress' ); ?></legend>
15
 
16
  <div class="bbp-username">
bbp-themes/bbp-twentyten/bbpress/form-user-lost-pass.php CHANGED
@@ -10,7 +10,7 @@
10
  ?>
11
 
12
  <form method="post" action="<?php bbp_wp_login_action( array( 'action' => 'lostpassword', 'context' => 'login_post' ) ); ?>" class="bbp-user-register">
13
- <fieldset>
14
  <legend><?php _e( 'Lost Password', 'bbpress' ); ?></legend>
15
 
16
  <div class="bbp-username">
10
  ?>
11
 
12
  <form method="post" action="<?php bbp_wp_login_action( array( 'action' => 'lostpassword', 'context' => 'login_post' ) ); ?>" class="bbp-user-register">
13
+ <fieldset class="bbp-form">
14
  <legend><?php _e( 'Lost Password', 'bbpress' ); ?></legend>
15
 
16
  <div class="bbp-username">
bbp-themes/bbp-twentyten/bbpress/form-user-register.php CHANGED
@@ -10,7 +10,7 @@
10
  ?>
11
 
12
  <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form">
13
- <fieldset>
14
  <legend><?php _e( 'Create an Account', 'bbpress' ); ?></legend>
15
 
16
  <div class="bbp-template-notice">
10
  ?>
11
 
12
  <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form">
13
+ <fieldset class="bbp-form">
14
  <legend><?php _e( 'Create an Account', 'bbpress' ); ?></legend>
15
 
16
  <div class="bbp-template-notice">
bbp-themes/bbp-twentyten/bbpress/loop-replies.php CHANGED
@@ -57,16 +57,12 @@
57
  <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
58
 
59
  <tr class="bbp-reply-header">
60
- <td class="bbp-reply-author">
61
-
62
- <?php bbp_reply_author_display_name(); ?>
63
-
64
- </td>
65
- <td class="bbp-reply-content">
66
- <a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>">#</a>
67
 
68
  <?php printf( __( '%1$s at %2$s', 'bbpress' ), get_the_date(), esc_attr( get_the_time() ) ); ?>
69
 
 
 
70
  <?php bbp_reply_admin_links(); ?>
71
 
72
  </td>
@@ -76,9 +72,13 @@
76
 
77
  <td class="bbp-reply-author">
78
 
79
- <?php bbp_reply_author_link( array( 'type' => 'avatar' ) ); ?>
 
 
 
 
80
 
81
- <?php if ( is_super_admin() ) bbp_author_ip( bbp_get_reply_id() ); ?>
82
 
83
  </td>
84
 
57
  <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
58
 
59
  <tr class="bbp-reply-header">
60
+ <td colspan="2">
 
 
 
 
 
 
61
 
62
  <?php printf( __( '%1$s at %2$s', 'bbpress' ), get_the_date(), esc_attr( get_the_time() ) ); ?>
63
 
64
+ <a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
65
+
66
  <?php bbp_reply_admin_links(); ?>
67
 
68
  </td>
72
 
73
  <td class="bbp-reply-author">
74
 
75
+ <?php bbp_reply_author_link(); ?>
76
+
77
+ <?php if ( is_super_admin() ) : ?>
78
+
79
+ <div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
80
 
81
+ <?php endif; ?>
82
 
83
  </td>
84
 
bbp-themes/bbp-twentyten/bbpress/nav-breadcrumb.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Breadcrumb
5
- *
6
- * @package bbPress
7
- * @subpackage Theme
8
- */
9
-
10
- ?>
11
-
12
- <div class="bbp-breadcrumb">
13
- <p><?php bbp_breadcrumb(); ?></p>
14
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bbp-themes/bbp-twentyten/bbpress/single-forum.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  <?php if ( bbp_user_can_view_forum( array( 'forum_id' => bbp_get_topic_forum_id() ) ) ) : ?>
13
 
14
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
15
 
16
  <?php bbp_single_forum_description(); ?>
17
 
11
 
12
  <?php if ( bbp_user_can_view_forum( array( 'forum_id' => bbp_get_topic_forum_id() ) ) ) : ?>
13
 
14
+ <?php bbp_breadcrumb(); ?>
15
 
16
  <?php bbp_single_forum_description(); ?>
17
 
bbp-themes/bbp-twentyten/bbpress/single-topic.php CHANGED
@@ -40,25 +40,28 @@
40
  <tbody>
41
 
42
  <tr class="bbp-topic-header">
43
- <td class="bbp-topic-author">
44
 
45
- <?php bbp_topic_author_link( array( 'type' => 'name' ) ); ?>
46
 
47
- <?php if ( is_super_admin() ) bbp_author_ip( bbp_get_reply_id() ); ?>
48
 
49
  </td>
 
50
 
51
- <td class="bbp-topic-content">
52
- <a href="#bbp-topic-<?php bbp_topic_id(); ?>" title="<?php bbp_topic_title(); ?>">#</a>
 
53
 
54
- <?php printf( __( 'Posted on %1$s at %2$s', 'bbpress' ), get_the_date(), esc_attr( get_the_time() ) ); ?>
55
 
56
- </td>
57
- </tr>
58
 
59
- <tr id="post-<?php bbp_topic_id(); ?>" <?php post_class( 'bbp-forum-topic' ); ?>>
 
 
60
 
61
- <td class="bbp-topic-author"><?php bbp_topic_author_link( array( 'type' => 'avatar' ) ); ?></td>
62
 
63
  <td class="bbp-topic-content">
64
 
40
  <tbody>
41
 
42
  <tr class="bbp-topic-header">
43
+ <td colspan="2">
44
 
45
+ <?php printf( __( '%1$s at %2$s', 'bbpress' ), get_the_date(), esc_attr( get_the_time() ) ); ?>
46
 
47
+ <a href="#bbp-topic-<?php bbp_topic_id(); ?>" title="<?php bbp_topic_title(); ?>" class="bbp-topic-permalink">#<?php bbp_topic_id(); ?></a>
48
 
49
  </td>
50
+ </tr>
51
 
52
+ <tr id="post-<?php bbp_topic_id(); ?>" <?php post_class( 'bbp-forum-topic' ); ?>>
53
+
54
+ <td class="bbp-topic-author">
55
 
56
+ <?php bbp_topic_author_link(); ?>
57
 
58
+ <?php if ( is_super_admin() ) : ?>
 
59
 
60
+ <div class="bbp-topic-ip"><?php bbp_author_ip( bbp_get_topic_id() ); ?></div>
61
+
62
+ <?php endif; ?>
63
 
64
+ </td>
65
 
66
  <td class="bbp-topic-content">
67
 
bbp-themes/bbp-twentyten/bbpress/user-details.php CHANGED
@@ -9,28 +9,28 @@
9
 
10
  ?>
11
 
12
- <span class="page-title author">
13
 
14
- <?php printf( __( 'Profile: %s', 'bbpress' ), "<span class='vcard'><a class='url fn n' href='" . bbp_get_user_profile_url() . "' title='" . esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) . "' rel='me'>" . bbp_get_displayed_user_field( 'display_name' ) . "</a></span>" ); ?>
15
 
16
- <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
17
 
18
- <span class="edit_user_link"><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></span>
19
 
20
- <?php endif; ?>
21
 
22
- </span>
23
 
24
- <div id="entry-author-info">
25
- <div id="author-avatar">
26
 
27
- <?php echo get_avatar( bbp_get_displayed_user_field( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
28
 
29
- </div><!-- #author-avatar -->
30
- <div id="author-description">
31
- <h1><?php printf( __( 'About %s', 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?></h1>
32
 
33
- <?php echo bbp_get_displayed_user_field( 'description' ); ?>
34
 
35
- </div><!-- #author-description -->
36
- </div><!-- #entry-author-info -->
9
 
10
  ?>
11
 
12
+ <span class="page-title author">
13
 
14
+ <?php printf( __( 'Profile: %s', 'bbpress' ), "<span class='vcard'><a class='url fn n' href='" . bbp_get_user_profile_url() . "' title='" . esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) . "' rel='me'>" . bbp_get_displayed_user_field( 'display_name' ) . "</a></span>" ); ?>
15
 
16
+ <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
17
 
18
+ <span class="edit_user_link"><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></span>
19
 
20
+ <?php endif; ?>
21
 
22
+ </span>
23
 
24
+ <div id="entry-author-info">
25
+ <div id="author-avatar">
26
 
27
+ <?php echo get_avatar( bbp_get_displayed_user_field( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
28
 
29
+ </div><!-- #author-avatar -->
30
+ <div id="author-description">
31
+ <h1><?php printf( __( 'About %s', 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?></h1>
32
 
33
+ <?php echo bbp_get_displayed_user_field( 'description' ); ?>
34
 
35
+ </div><!-- #author-description -->
36
+ </div><!-- #entry-author-info -->
bbp-themes/bbp-twentyten/bbpress/user-favorites.php CHANGED
@@ -9,26 +9,26 @@
9
 
10
  ?>
11
 
12
- <?php bbp_set_query_name( 'bbp_user_profile_favorites' ); ?>
13
 
14
- <div id="bbp-author-favorites" class="bbp-author-favorites">
15
- <hr />
16
- <h2 class="entry-title"><?php _e( 'Favorite Forum Topics', 'bbpress' ); ?></h2>
17
- <div class="entry-content">
18
 
19
- <?php if ( bbp_get_user_favorites() ) :
20
 
21
- bbp_get_template_part( 'bbpress/pagination', 'topics' );
22
- bbp_get_template_part( 'bbpress/loop', 'topics' );
23
- bbp_get_template_part( 'bbpress/pagination', 'topics' );
24
 
25
- else : ?>
26
 
27
- <p><?php bbp_is_user_home() ? _e( 'You currently have no favorite topics.', 'bbpress' ) : _e( 'This user has no favorite topics.', 'bbpress' ); ?></p>
28
 
29
- <?php endif; ?>
30
 
31
- </div>
32
- </div><!-- #bbp-author-favorites -->
33
 
34
- <?php bbp_reset_query_name(); ?>
9
 
10
  ?>
11
 
12
+ <?php bbp_set_query_name( 'bbp_user_profile_favorites' ); ?>
13
 
14
+ <div id="bbp-author-favorites" class="bbp-author-favorites">
15
+ <hr />
16
+ <h2 class="entry-title"><?php _e( 'Favorite Forum Topics', 'bbpress' ); ?></h2>
17
+ <div class="entry-content">
18
 
19
+ <?php if ( bbp_get_user_favorites() ) :
20
 
21
+ bbp_get_template_part( 'bbpress/pagination', 'topics' );
22
+ bbp_get_template_part( 'bbpress/loop', 'topics' );
23
+ bbp_get_template_part( 'bbpress/pagination', 'topics' );
24
 
25
+ else : ?>
26
 
27
+ <p><?php bbp_is_user_home() ? _e( 'You currently have no favorite topics.', 'bbpress' ) : _e( 'This user has no favorite topics.', 'bbpress' ); ?></p>
28
 
29
+ <?php endif; ?>
30
 
31
+ </div>
32
+ </div><!-- #bbp-author-favorites -->
33
 
34
+ <?php bbp_reset_query_name(); ?>
bbp-themes/bbp-twentyten/bbpress/user-posts.php CHANGED
@@ -9,15 +9,15 @@
9
 
10
  ?>
11
 
12
- <div id="bbp-author-blog-posts" class="bbp-author-blog-posts">
13
- <hr />
14
- <h2 class="entry-title"><?php _e( 'Blog Posts', 'bbpress' ); ?></h2>
15
 
16
- <div class="entry-content">
17
 
18
- <?php rewind_posts(); ?>
19
 
20
- <?php bbp_get_template_part( 'bbpress/loop', 'author' ); ?>
21
 
22
- </div>
23
- </div><!-- #bbp-author-blog-posts -->
9
 
10
  ?>
11
 
12
+ <div id="bbp-author-blog-posts" class="bbp-author-blog-posts">
13
+ <hr />
14
+ <h2 class="entry-title"><?php _e( 'Blog Posts', 'bbpress' ); ?></h2>
15
 
16
+ <div class="entry-content">
17
 
18
+ <?php rewind_posts(); ?>
19
 
20
+ <?php bbp_get_template_part( 'bbpress/loop', 'author' ); ?>
21
 
22
+ </div>
23
+ </div><!-- #bbp-author-blog-posts -->
bbp-themes/bbp-twentyten/bbpress/user-subscriptions.php CHANGED
@@ -9,34 +9,34 @@
9
 
10
  ?>
11
 
12
- <?php if ( bbp_is_subscriptions_active() ) : ?>
13
 
14
- <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
15
 
16
- <?php bbp_set_query_name( 'bbp_user_profile_subscriptions' ); ?>
17
 
18
- <div id="bbp-author-subscriptions" class="bbp-author-subscriptions">
19
- <hr />
20
- <h2 class="entry-title"><?php _e( 'Subscribed Forum Topics', 'bbpress' ); ?></h2>
21
- <div class="entry-content">
22
 
23
- <?php if ( bbp_get_user_subscriptions() ) :
24
 
25
- bbp_get_template_part( 'bbpress/pagination', 'topics' );
26
- bbp_get_template_part( 'bbpress/loop', 'topics' );
27
- bbp_get_template_part( 'bbpress/pagination', 'topics' );
28
 
29
- else : ?>
30
 
31
- <p><?php bbp_is_user_home() ? _e( 'You are not currently subscribed to any topics.', 'bbpress' ) : _e( 'This user is not currently subscribed to any topics.', 'bbpress' ); ?></p>
32
 
33
- <?php endif; ?>
34
 
35
- </div>
36
- </div><!-- #bbp-author-subscriptions -->
37
 
38
- <?php bbp_reset_query_name(); ?>
39
 
40
- <?php endif; ?>
41
 
42
- <?php endif; ?>
9
 
10
  ?>
11
 
12
+ <?php if ( bbp_is_subscriptions_active() ) : ?>
13
 
14
+ <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
15
 
16
+ <?php bbp_set_query_name( 'bbp_user_profile_subscriptions' ); ?>
17
 
18
+ <div id="bbp-author-subscriptions" class="bbp-author-subscriptions">
19
+ <hr />
20
+ <h2 class="entry-title"><?php _e( 'Subscribed Forum Topics', 'bbpress' ); ?></h2>
21
+ <div class="entry-content">
22
 
23
+ <?php if ( bbp_get_user_subscriptions() ) :
24
 
25
+ bbp_get_template_part( 'bbpress/pagination', 'topics' );
26
+ bbp_get_template_part( 'bbpress/loop', 'topics' );
27
+ bbp_get_template_part( 'bbpress/pagination', 'topics' );
28
 
29
+ else : ?>
30
 
31
+ <p><?php bbp_is_user_home() ? _e( 'You are not currently subscribed to any topics.', 'bbpress' ) : _e( 'This user is not currently subscribed to any topics.', 'bbpress' ); ?></p>
32
 
33
+ <?php endif; ?>
34
 
35
+ </div>
36
+ </div><!-- #bbp-author-subscriptions -->
37
 
38
+ <?php bbp_reset_query_name(); ?>
39
 
40
+ <?php endif; ?>
41
 
42
+ <?php endif; ?>
bbp-themes/bbp-twentyten/bbpress/user-topics-created.php CHANGED
@@ -9,26 +9,26 @@
9
 
10
  ?>
11
 
12
- <?php bbp_set_query_name( 'bbp_user_profile_topics_created' ); ?>
13
 
14
- <div id="bbp-author-topics-started" class="bbp-author-topics-started">
15
- <hr />
16
- <h2 class="entry-title"><?php _e( 'Forum Topics Created', 'bbpress' ); ?></h2>
17
- <div class="entry-content">
18
 
19
- <?php if ( bbp_get_user_topics_started() ) :
20
 
21
- bbp_get_template_part( 'bbpress/pagination', 'topics' );
22
- bbp_get_template_part( 'bbpress/loop', 'topics' );
23
- bbp_get_template_part( 'bbpress/pagination', 'topics' );
24
 
25
- else : ?>
26
 
27
- <p><?php bbp_is_user_home() ? _e( 'You have not created any topics.', 'bbpress' ) : _e( 'This user has not created any topics.', 'bbpress' ); ?></p>
28
 
29
- <?php endif; ?>
30
 
31
- </div>
32
- </div><!-- #bbp-author-topics-started -->
33
 
34
- <?php bbp_reset_query_name(); ?>
9
 
10
  ?>
11
 
12
+ <?php bbp_set_query_name( 'bbp_user_profile_topics_created' ); ?>
13
 
14
+ <div id="bbp-author-topics-started" class="bbp-author-topics-started">
15
+ <hr />
16
+ <h2 class="entry-title"><?php _e( 'Forum Topics Created', 'bbpress' ); ?></h2>
17
+ <div class="entry-content">
18
 
19
+ <?php if ( bbp_get_user_topics_started() ) :
20
 
21
+ bbp_get_template_part( 'bbpress/pagination', 'topics' );
22
+ bbp_get_template_part( 'bbpress/loop', 'topics' );
23
+ bbp_get_template_part( 'bbpress/pagination', 'topics' );
24
 
25
+ else : ?>
26
 
27
+ <p><?php bbp_is_user_home() ? _e( 'You have not created any topics.', 'bbpress' ) : _e( 'This user has not created any topics.', 'bbpress' ); ?></p>
28
 
29
+ <?php endif; ?>
30
 
31
+ </div>
32
+ </div><!-- #bbp-author-topics-started -->
33
 
34
+ <?php bbp_reset_query_name(); ?>
bbp-themes/bbp-twentyten/bbpress/user.php CHANGED
@@ -14,7 +14,13 @@
14
  <div id="container">
15
  <div id="content" role="main">
16
 
17
- <?php bbp_get_template_part( 'bbpress/single', 'user' ); ?>
 
 
 
 
 
 
18
 
19
  </div><!-- #content -->
20
  </div><!-- #container -->
14
  <div id="container">
15
  <div id="content" role="main">
16
 
17
+ <div id="bbp-user-<?php bbp_current_user_id(); ?>" class="bbp-single-user">
18
+ <div class="entry-content">
19
+
20
+ <?php bbp_get_template_part( 'bbpress/single', 'user' ); ?>
21
+
22
+ </div><!-- .entry-content -->
23
+ </div><!-- #bbp-user-<?php bbp_current_user_id(); ?> -->
24
 
25
  </div><!-- #content -->
26
  </div><!-- #container -->
bbp-themes/bbp-twentyten/bbpress/view.php CHANGED
@@ -20,6 +20,8 @@
20
  <h1 class="entry-title"><?php bbp_view_title(); ?></h1>
21
  <div class="entry-content">
22
 
 
 
23
  <?php bbp_set_query_name( 'bbp_view' ); ?>
24
 
25
  <?php if ( bbp_view_query() ) : ?>
20
  <h1 class="entry-title"><?php bbp_view_title(); ?></h1>
21
  <div class="entry-content">
22
 
23
+ <?php bbp_breadcrumb(); ?>
24
+
25
  <?php bbp_set_query_name( 'bbp_view' ); ?>
26
 
27
  <?php if ( bbp_view_query() ) : ?>
bbp-themes/bbp-twentyten/css/bbpress-rtl.css ADDED
@@ -0,0 +1,618 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * bbPress specific CSS
3
+ *
4
+ * @package bbPress
5
+ * @subpackage Theme
6
+ */
7
+
8
+ /* =bbPress Style
9
+ -------------------------------------------------------------- */
10
+
11
+ #content hr,
12
+ #container hr {
13
+ margin: 0 0 24px 0;
14
+ }
15
+ #entry-author-info {
16
+ margin: 10px 0 0 0;
17
+ border-bottom: 1px solid #fff;
18
+ }
19
+
20
+ #content table.bbp-topics,
21
+ #content table.bbp-forums,
22
+ #content table.bbp-replies,
23
+
24
+ #container table.bbp-topics,
25
+ #container table.bbp-forums,
26
+ #container table.bbp-replies,
27
+
28
+ #main table.bbp-topics,
29
+ #main table.bbp-forums,
30
+ #main table.bbp-replies {
31
+ clear: right;
32
+ }
33
+
34
+ /* =Breadcrumb and Tags
35
+ -------------------------------------------------------------- */
36
+
37
+ div.bbp-breadcrumb {
38
+ float: right;
39
+ }
40
+
41
+ div.bbp-breadcrumb,
42
+ div.bbp-topic-tags {
43
+ font-size: 12px;
44
+ }
45
+
46
+ #content div.bbp-breadcrumb p,
47
+ #content div.bbp-topic-tags p {
48
+ margin-bottom: 10px
49
+ }
50
+
51
+ div.bbp-topic-tags {
52
+ float: left;
53
+ }
54
+
55
+ /* =Tables
56
+ -------------------------------------------------------------- */
57
+
58
+ #content table tbody tr.even td {
59
+ background-color: #fff;
60
+ }
61
+ #content table tbody tr.odd td {
62
+ background-color: #fbfbfb;
63
+ }
64
+
65
+ #content table tbody tr.status-trash.even td,
66
+ #content table tbody tr.status-spam.even td {
67
+ background-color: #fee;
68
+ }
69
+ #content table tbody tr.status-trash.odd td,
70
+ #content table tbody tr.status-spam.odd td {
71
+ background-color: #fdd;
72
+ }
73
+
74
+ #content table.bbp-topics tbody tr.status-closed td,
75
+ #content table.bbp-topics tbody tr.status-closed td a {
76
+ color: #ccc;
77
+ }
78
+
79
+ table.bbp-topic tbody tr td,
80
+ table.bbp-replies tbody tr td {
81
+ background-color: #fff;
82
+ }
83
+
84
+ table.bbp-forums th, table.bbp-topics th,
85
+ table.bbp-topic th, table.bbp-replies th {
86
+ background-color: #f3f3f3;
87
+ }
88
+ table.bbp-forums th span, table.bbp-topics th span,
89
+ table.bbp-topic th span, table.bbp-replies th span {
90
+ float: left;
91
+ }
92
+ #content th.bbp-topic-author,
93
+ #content th.bbp-reply-author {
94
+ text-align: center;
95
+ }
96
+ #content th.bbp-topic-content,
97
+ #content th.bbp-reply-content {
98
+ text-align: left;
99
+ padding: 9px 15px 9px 10px;
100
+ }
101
+ #content table.bbp-forums tfoot td, #content table.bbp-topics tfoot td,
102
+ #content table.bbp-topic tfoot td, #content table.bbp-replies tfoot td,
103
+ #content table.bbp-replies tr.bbp-reply-header td,
104
+ #content table.bbp-topic tr.bbp-topic-header td {
105
+ background-color: #fafafa;
106
+ color: #888;
107
+ font-size: 12px;
108
+ font-weight: bold;
109
+ font-family: 'Helvetica Neue', Arial, Helvetica, 'Nimbus Sans L', sans-serif;
110
+ padding: 4px 10px;
111
+ }
112
+
113
+ span.bbp-author-ip {
114
+ font-family: 'Helvetica Neue', Arial, Helvetica, 'Nimbus Sans L', sans-serif;
115
+ font-size: 11px;
116
+ font-weight: bold;
117
+ color: #aaa;
118
+ }
119
+
120
+ #content .bbp-forum-topic-count,
121
+ #content .bbp-forum-reply-count,
122
+ #content .bbp-topic-reply-count,
123
+ #content .bbp-topic-voice-count,
124
+ #content .bbp-topic-action {
125
+ width: 10%;
126
+ text-align: center;
127
+ padding: 6px 0px;
128
+ }
129
+ #content .bbp-topic-author,
130
+ #content .bbp-reply-author {
131
+ padding: 20px 0 20px 20px
132
+ width: 90px;
133
+ text-align: center;
134
+ vertical-align: top;
135
+ }
136
+ .bbp-topic-freshness,
137
+ .bbp-forum-freshness {
138
+ text-align: center;
139
+ width: 20%;
140
+ }
141
+
142
+ #content tbody .bbp-topic-content,
143
+ #content tbody .bbp-reply-content {
144
+ vertical-align: top;
145
+ padding: 15px 15px 10px 10px;
146
+ }
147
+
148
+ #content .bbp-topic-content img,
149
+ #content .bbp-reply-content img {
150
+ max-width: 100%;
151
+ }
152
+
153
+ /* =Admin Links
154
+ -------------------------------------------------------------- */
155
+
156
+ span.bbp-admin-links {
157
+ float: left;
158
+ color: #ddd;
159
+ }
160
+ span.bbp-admin-links a {
161
+ color: #bbb;
162
+ font-weight: normal;
163
+ font-size: 10px;
164
+ text-transform: uppercase;
165
+ text-decoration: none;
166
+ }
167
+ fieldset span.bbp-admin-links {
168
+ float: right;
169
+ }
170
+ tr td span.bbp-admin-links a:hover {
171
+ color: #ff4b33;
172
+ }
173
+ td.bbp-topic-admin-links,
174
+ td.bbp-topic-counts {
175
+ width: 50%;
176
+ }
177
+
178
+ a.bbp-reply-permalink {
179
+ float: left;
180
+ margin-right: 10px;
181
+ color: #ccc;
182
+ }
183
+
184
+ /* =Toggles
185
+ -------------------------------------------------------------- */
186
+
187
+ .bbp-topic-action #favorite-toggle a {
188
+ text-decoration: none;
189
+ padding: 0px 3px 1px;
190
+ color: #7c7;
191
+ border: 1px solid #aca;
192
+ background-color: #dfd;
193
+ font-weight: bold;
194
+ font-size: 13px;
195
+ -moz-border-radius: 8px;
196
+ -webkit-border-radius: 8px;
197
+ }
198
+ .bbp-topic-action #favorite-toggle a:hover {
199
+ color: #5a5;
200
+ border-color: #7c7;
201
+ background-color: #beb;
202
+ }
203
+ .bbp-topic-action #favorite-toggle span.is-favorite a {
204
+ color: #faa;
205
+ border: 1px solid #faa;
206
+ background-color: #fee;
207
+ -moz-border-radius: 5px;
208
+ -webkit-border-radius: 5px;
209
+ }
210
+ .bbp-topic-action #favorite-toggle span.is-favorite a:hover {
211
+ color: #c88;
212
+ border-color: #c88;
213
+ background-color: #fdd;
214
+ }
215
+
216
+ .bbp-topic-action #subscription-toggle a {
217
+ text-decoration: none;
218
+ padding: 0px 3px 1px;
219
+ color: #7c7;
220
+ border: 1px solid #aca;
221
+ background-color: #dfd;
222
+ font-weight: bold;
223
+ font-size: 13px;
224
+ -moz-border-radius: 8px;
225
+ -webkit-border-radius: 8px;
226
+ }
227
+ .bbp-topic-action #subscription-toggle a:hover {
228
+ color: #5a5;
229
+ border-color: #7c7;
230
+ background-color: #beb;
231
+ }
232
+ .bbp-topic-action #subscription-toggle span.is-subscribed a {
233
+ color: #faa;
234
+ border: 1px solid #faa;
235
+ background-color: #fee;
236
+ -moz-border-radius: 5px;
237
+ -webkit-border-radius: 5px;
238
+ }
239
+ .bbp-topic-action #subscription-toggle span.is-subscribed a:hover {
240
+ color: #c88;
241
+ border-color: #c88;
242
+ background-color: #fdd;
243
+ }
244
+
245
+ #content p.bbp-topic-meta {
246
+ margin-bottom: 0;
247
+ font-size: 11px;
248
+ }
249
+
250
+ #content p.bbp-topic-meta span {
251
+ white-space: nowrap;
252
+ }
253
+
254
+ /* =Forums
255
+ -------------------------------------------------------------- */
256
+
257
+ #content table tbody tr .bbp-forum-description p {
258
+ margin-bottom: 0;
259
+ font-size: 13px;
260
+ font-style: italic;
261
+ }
262
+ #content table tbody tr ul.bbp-forums {
263
+ list-style: none;
264
+ font-size: 12px;
265
+ margin: 0 0 0 10px;
266
+ padding: 0 0 0 10px;
267
+ border-right: 1px solid #aaa;
268
+ }
269
+ #content table tbody tr ul.bbp-forums li {
270
+ display: inline;
271
+ }
272
+
273
+ /* =Pagination
274
+ -------------------------------------------------------------- */
275
+
276
+ .bbp-pagination-count {
277
+ float: right;
278
+ }
279
+ .bbp-pagination-links {
280
+ float: left;
281
+ }
282
+ .bbp-pagination {
283
+ float: right;
284
+ width: 100%;
285
+ margin-bottom: 20px;
286
+ }
287
+
288
+ .bbp-topic-pagination {
289
+ display: inline-block;
290
+ margin-right: 5px;
291
+ margin-bottom: 2px;
292
+ }
293
+ .bbp-topic-pagination a {
294
+ font-size: 10px;
295
+ line-height: 10px;
296
+ padding: 1px 3px;
297
+ border: 1px solid #ddd;
298
+ text-decoration: none;
299
+ }
300
+
301
+ /* =Forms
302
+ -------------------------------------------------------------- */
303
+ #content fieldset.bbp-form,
304
+ #container fieldset.bbp-form,
305
+ #wrapper fieldset.bbp-form {
306
+ clear: right;
307
+ }
308
+
309
+ #content fieldset.bbp-form,
310
+ #container fieldset.bbp-form,
311
+ #wrapper fieldset.bbp-form {
312
+ border: 1px solid #eee;
313
+ padding: 10px 20px;
314
+ }
315
+
316
+ #content fieldset.bbp-form legend,
317
+ #container fieldset.bbp-form legend,
318
+ #wrapper fieldset.bbp-form legend {
319
+ padding: 5px;
320
+ }
321
+
322
+ #content fieldset.bbp-form label,
323
+ #container fieldset.bbp-form label,
324
+ #wrapper fieldset.bbp-form label {
325
+ width: 250px;
326
+ display: inline-block;
327
+ }
328
+
329
+ #bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,
330
+ #bbp-login fieldset label,
331
+ #bbp-register fieldset label,
332
+ #bbp-lost-pass fieldset label {
333
+ width: 100px;
334
+ }
335
+
336
+ #content fieldset.bbp-form p,
337
+ #container fieldset.bbp-form p,
338
+ #wrapper fieldset.bbp-form p,
339
+ #content fieldset.bbp-form textarea,
340
+ #container fieldset.bbp-form textarea,
341
+ #wrapper fieldset.bbp-form textarea,
342
+ #content fieldset.bbp-form select,
343
+ #container fieldset.bbp-form select,
344
+ #wrapper fieldset.bbp-form select,
345
+ #content fieldset.bbp-form input,
346
+ #container fieldset.bbp-form input,
347
+ #wrapper fieldset.bbp-form input {
348
+ margin: 0px 0px 10px;
349
+ }
350
+
351
+ .bbp-topic-form,
352
+ .bbp-reply-form,
353
+ .bbp-topic-tag-form {
354
+ clear: right;
355
+ }
356
+ body.topic-edit .bbp-topic-form div.avatar img,
357
+ body.reply-edit .bbp-reply-form div.avatar img,
358
+ body.single-forum .bbp-topic-form div.avatar img,
359
+ body.single-reply .bbp-reply-form div.avatar img {
360
+ margin-left: 0;
361
+ padding: 10px;
362
+ border: 1px solid #ddd;
363
+ line-height: 0;
364
+ background-color: #efefef;
365
+ }
366
+
367
+ body.page .bbp-reply-form code,
368
+ body.page .bbp-topic-form code,
369
+ body.single-topic .bbp-reply-form code,
370
+ body.single-forum .bbp-topic-form code,
371
+ body.topic-edit .bbp-topic-form code,
372
+ body.reply-edit .bbp-reply-form code {
373
+ font-size: 10px;
374
+ background-color: #f0fff8;
375
+ border: 1px solid #CEEFE1;
376
+ display: block;
377
+ padding: 8px;
378
+ margin-top: 5px;
379
+ width: 369px;
380
+ }
381
+
382
+ #merge_tag,
383
+ #delete_tag {
384
+ display: inline;
385
+ }
386
+
387
+ div.bbp-submit-wrapper {
388
+ float: left;
389
+ }
390
+
391
+ p.form-allowed-tags {
392
+ width: 462px;
393
+ }
394
+
395
+ input[type="password"] {
396
+ background: #f9f9f9;
397
+ border: 1px solid #ccc;
398
+ box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
399
+ -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
400
+ -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
401
+ padding: 2px;
402
+ }
403
+
404
+ /* =Edit User
405
+ -------------------------------------------------------------- */
406
+
407
+ #bbp-your-profile fieldset {
408
+ margin-top: 20px;
409
+ padding: 20px 20px 0 20px;
410
+ }
411
+ #bbp-your-profile fieldset div {
412
+ margin-bottom: 20px;
413
+ float: right;
414
+ width: 100%;
415
+ clear: right;
416
+ }
417
+ #bbp-your-profile fieldset select {
418
+ margin-bottom: 0;
419
+ }
420
+ #bbp-your-profile fieldset input,
421
+ #bbp-your-profile fieldset textarea {
422
+ margin-bottom: 0;
423
+ width: 400px;
424
+ background: #f9f9f9;
425
+ border: 1px solid #ccc;
426
+ box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
427
+ -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
428
+ -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
429
+ padding: 2px;
430
+ }
431
+ #bbp-your-profile fieldset legend {
432
+ display: none;
433
+ }
434
+ #bbp-your-profile fieldset label {
435
+ float: right;
436
+ width: 150px;
437
+ padding-left: 20px;
438
+ text-align: left;
439
+ }
440
+ #bbp-your-profile fieldset span.description {
441
+ margin: 5px 0 0 170px;
442
+ font-size: 12px;
443
+ font-style: italic;
444
+ float: right;
445
+ clear: right;
446
+ width: 383px;
447
+ padding: 5px 10px;
448
+ border: #cee1ef 1px solid;
449
+ background-color: #f0f8ff;
450
+ }
451
+
452
+ #bbp-your-profile fieldset fieldset {
453
+ margin: 0;
454
+ width: 260px;
455
+ border: none;
456
+ padding: 0;
457
+ }
458
+ #bbp-your-profile fieldset fieldset span.description {
459
+ margin-right: 0;
460
+ margin-bottom: 20px;
461
+ }
462
+
463
+ #bbp-your-profile fieldset.submit button {
464
+ float: left;
465
+ }
466
+
467
+ /* =Notices
468
+ -------------------------------------------------------------- */
469
+
470
+ div.bbp-template-notice {
471
+ border-width: 1px;
472
+ border-style: solid;
473
+ padding: 0 0.6em;
474
+ margin: 5px 0 15px;
475
+ -moz-border-radius: 3px;
476
+ -khtml-border-radius: 3px;
477
+ -webkit-border-radius: 3px;
478
+ border-radius: 3px;
479
+ background-color: #ffffe0;
480
+ border-color: #e6db55;
481
+ color: #000;
482
+ clear: both;
483
+ }
484
+ div.bbp-template-notice a {
485
+ color: #555;
486
+ text-decoration: none;
487
+ }
488
+ div.bbp-template-notice a:hover {
489
+ color: #000;
490
+ }
491
+ div.bbp-template-notice.info {
492
+ border: #cee1ef 1px solid;
493
+ background-color: #f0f8ff;
494
+ }
495
+ div.bbp-template-notice.important {
496
+ border: #e6db55 1px solid;
497
+ background-color: #fffbcc;
498
+ }
499
+ div.bbp-template-notice.error,
500
+ div.bbp-template-notice.warning {
501
+ background-color: #ffebe8;
502
+ border-color: #c00;
503
+ }
504
+ div.bbp-template-notice.error a,
505
+ div.bbp-template-notice.warning a {
506
+ color: #c00;
507
+ }
508
+ div.bbp-template-notice p {
509
+ margin: 0.5em 0 6px 0 !important;
510
+ padding: 2px;
511
+ font-size: 12px;
512
+ line-height: 140%;
513
+ }
514
+
515
+ /* =Stickies
516
+ -------------------------------------------------------------- */
517
+
518
+ .bbp-topics-front tr.super-sticky td,
519
+ .bbp-topics tr.super-sticky td,
520
+ .bbp-topics tr.sticky td,
521
+ .bbp-forum-info tr.sticky td {
522
+ background-color: #ffffe0 !important;
523
+ font-size: 1.1em;
524
+ }
525
+
526
+ /* =Revisions
527
+ -------------------------------------------------------------- */
528
+ #content .bbp-topic-revision-log,
529
+ #content .bbp-reply-revision-log,
530
+
531
+ #main .bbp-topic-revision-log,
532
+ #main .bbp-reply-revision-log,
533
+
534
+ #container .bbp-topic-revision-log,
535
+ #container .bbp-reply-revision-log {
536
+ border-top: 1px dotted #ddd;
537
+ list-style: none;
538
+ width: 100%;
539
+ margin: 0;
540
+ padding: 8px 0 0 0;
541
+ font-size: 11px;
542
+ color: #aaa;
543
+ }
544
+
545
+ /* =Widgets
546
+ -------------------------------------------------------------- */
547
+
548
+ .widget-area .bbp-login-form fieldset legend {
549
+ display: none;
550
+ }
551
+
552
+ .widget-area .bbp-login-form .bbp-username label,
553
+ .widget-area .bbp-login-form .bbp-password label {
554
+ width: 70px;
555
+ display: inline-block;
556
+ }
557
+ .widget-area .bbp-login-form .bbp-username,
558
+ .widget-area .bbp-login-form .bbp-password,
559
+ .widget-area .bbp-login-form .bbp-remember-me,
560
+ .widget-area .bbp-login-form .bbp-submit-wrapper {
561
+ margin-top: 10px;
562
+ }
563
+
564
+ .widget-area .bbp-login-form .bbp-remember-me {
565
+ float: right;
566
+ }
567
+
568
+ .widget-area .bbp-login-form .bbp-submit-wrapper {
569
+ float: left;
570
+ }
571
+
572
+ .widget-area .bbp-logged-in img.avatar {
573
+ float: right;
574
+ margin-left: 15px;
575
+ }
576
+
577
+ .widget-area .bbp-logged-in h4 {
578
+ font-weight: bold;
579
+ font-size: 1.3em;
580
+ display: inline;
581
+ clear: none;
582
+ }
583
+
584
+ .widget-area .bbp-logged-in a.logout-link {
585
+ display: block;
586
+ }
587
+
588
+ /* =Avatars
589
+ -------------------------------------------------------------- */
590
+
591
+ #content p.bbp-topic-meta img.avatar,
592
+ #content ul.bbp-reply-revision-log img.avatar,
593
+ #content ul.bbp-topic-revision-log img.avatar,
594
+ #content div.bbp-template-notice img.avatar,
595
+ #content .widget_display_topics img.avatar,
596
+ #content .widget_display_replies img.avatar,
597
+ #content p.bbp-topic-meta img.avatar,
598
+
599
+ #main ul.bbp-reply-revision-log img.avatar,
600
+ #main ul.bbp-topic-revision-log img.avatar,
601
+ #main div.bbp-template-notice img.avatar,
602
+ #main .widget_display_topics img.avatar,
603
+ #main .widget_display_replies img.avatar,
604
+ #main p.bbp-topic-meta img.avatar,
605
+
606
+ #container ul.bbp-reply-revision-log img.avatar,
607
+ #container ul.bbp-topic-revision-log img.avatar,
608
+ #container div.bbp-template-notice img.avatar,
609
+ #container .widget_display_topics img.avatar,
610
+ #container .widget_display_replies img.avatar {
611
+ float: none;
612
+ margin-bottom: -7px;
613
+ border: 3px double #ddd;
614
+ }
615
+
616
+ fieldset div.avatar {
617
+ float: left;
618
+ }
bbp-themes/bbp-twentyten/css/bbpress.css CHANGED
@@ -81,11 +81,6 @@ table.bbp-replies tbody tr td {
81
  background-color: #fff;
82
  }
83
 
84
- table tbody tr.bbp-reply-header:hover td,
85
- table tbody tr.bbp-reply-header td {
86
- background-color: #f8f8f8;
87
- }
88
-
89
  table.bbp-forums th, table.bbp-topics th,
90
  table.bbp-topic th, table.bbp-replies th {
91
  background-color: #f3f3f3;
@@ -94,6 +89,15 @@ table.bbp-forums th span, table.bbp-topics th span,
94
  table.bbp-topic th span, table.bbp-replies th span {
95
  float: right;
96
  }
 
 
 
 
 
 
 
 
 
97
  #content table.bbp-forums tfoot td, #content table.bbp-topics tfoot td,
98
  #content table.bbp-topic tfoot td, #content table.bbp-replies tfoot td,
99
  #content table.bbp-replies tr.bbp-reply-header td,
@@ -122,9 +126,10 @@ span.bbp-author-ip {
122
  text-align: center;
123
  padding: 6px 0px;
124
  }
125
- #content .bbp-topic-author,
126
- #content .bbp-reply-author {
127
- width: 80px;
 
128
  text-align: center;
129
  vertical-align: top;
130
  }
@@ -137,7 +142,7 @@ span.bbp-author-ip {
137
  #content tbody .bbp-topic-content,
138
  #content tbody .bbp-reply-content {
139
  vertical-align: top;
140
- padding: 15px 20px 10px 10px;
141
  }
142
 
143
  #content .bbp-topic-content img,
@@ -170,6 +175,13 @@ td.bbp-topic-counts {
170
  width: 50%;
171
  }
172
 
 
 
 
 
 
 
 
173
  /* =Toggles
174
  -------------------------------------------------------------- */
175
 
@@ -289,57 +301,51 @@ td.bbp-topic-counts {
289
 
290
  /* =Forms
291
  -------------------------------------------------------------- */
292
- body.single fieldset,
293
- body.page fieldset {
 
294
  clear: left;
295
  }
296
 
297
- #bbp-login fieldset,
298
- #bbp-register fieldset,
299
- #bbp-lost-pass fieldset,
300
- body.single-forum fieldset,
301
- body.single-topic fieldset,
302
- div.bbp-topic-tag-form fieldset,
303
- body.topic-edit fieldset,
304
- body.reply-edit fieldset {
305
  border: 1px solid #eee;
306
  padding: 10px 20px;
307
  }
308
 
309
- #bbp-login fieldset legend,
310
- #bbp-register fieldset legend,
311
- #bbp-lost-pass fieldset legend,
312
- body.single-forum fieldset legend,
313
- body.single-topic fieldset legend,
314
- div.bbp-topic-tag-form fieldset legend,
315
- body.topic-edit fieldset legend,
316
- body.reply-edit fieldste legend {
317
  padding: 5px;
318
  }
319
 
320
- div.bbp-topic-tag-form fieldset label,
 
 
 
 
 
 
 
321
  #bbp-login fieldset label,
322
  #bbp-register fieldset label,
323
  #bbp-lost-pass fieldset label {
324
  width: 100px;
325
- display: inline-block;
326
- }
327
- body.single-forum fieldset label,
328
- body.single-topic fieldset label,
329
- body.topic-edit fieldset label,
330
- body.reply-edit fieldset label {
331
- width: 250px;
332
- display: inline-block;
333
  }
334
 
335
- #bbp-login fieldset p,
336
- #bbp-register fieldset p,
337
- #bbp-lost-pass fieldset p,
338
- body.single-forum fieldset p,
339
- body.single-topic fieldset input,
340
- div.bbp-topic-tag-form fieldset p,
341
- body.topic-edit fieldset p,
342
- body.reply-edit fieldset input {
 
 
 
 
343
  margin: 0px 0px 10px;
344
  }
345
 
@@ -608,3 +614,6 @@ div.bbp-template-notice a {
608
  border: 3px double #ddd;
609
  }
610
 
 
 
 
81
  background-color: #fff;
82
  }
83
 
 
 
 
 
 
84
  table.bbp-forums th, table.bbp-topics th,
85
  table.bbp-topic th, table.bbp-replies th {
86
  background-color: #f3f3f3;
89
  table.bbp-topic th span, table.bbp-replies th span {
90
  float: right;
91
  }
92
+ #content th.bbp-topic-author,
93
+ #content th.bbp-reply-author {
94
+ text-align: center;
95
+ }
96
+ #content th.bbp-topic-content,
97
+ #content th.bbp-reply-content {
98
+ text-align: left;
99
+ padding: 9px 10px 9px 15px;
100
+ }
101
  #content table.bbp-forums tfoot td, #content table.bbp-topics tfoot td,
102
  #content table.bbp-topic tfoot td, #content table.bbp-replies tfoot td,
103
  #content table.bbp-replies tr.bbp-reply-header td,
126
  text-align: center;
127
  padding: 6px 0px;
128
  }
129
+ #content td.bbp-topic-author,
130
+ #content td.bbp-reply-author {
131
+ padding: 20px 0 20px 20px;
132
+ width: 90px;
133
  text-align: center;
134
  vertical-align: top;
135
  }
142
  #content tbody .bbp-topic-content,
143
  #content tbody .bbp-reply-content {
144
  vertical-align: top;
145
+ padding: 15px 10px 10px 15px;
146
  }
147
 
148
  #content .bbp-topic-content img,
175
  width: 50%;
176
  }
177
 
178
+ a.bbp-topic-permalink,
179
+ a.bbp-reply-permalink {
180
+ float: right;
181
+ margin-left: 10px;
182
+ color: #ccc;
183
+ }
184
+
185
  /* =Toggles
186
  -------------------------------------------------------------- */
187
 
301
 
302
  /* =Forms
303
  -------------------------------------------------------------- */
304
+ #content fieldset.bbp-form,
305
+ #container fieldset.bbp-form,
306
+ #wrapper fieldset.bbp-form {
307
  clear: left;
308
  }
309
 
310
+ #content fieldset.bbp-form,
311
+ #container fieldset.bbp-form,
312
+ #wrapper fieldset.bbp-form {
 
 
 
 
 
313
  border: 1px solid #eee;
314
  padding: 10px 20px;
315
  }
316
 
317
+ #content fieldset.bbp-form legend,
318
+ #container fieldset.bbp-form legend,
319
+ #wrapper fieldset.bbp-form legend {
 
 
 
 
 
320
  padding: 5px;
321
  }
322
 
323
+ #content fieldset.bbp-form label,
324
+ #container fieldset.bbp-form label,
325
+ #wrapper fieldset.bbp-form label {
326
+ width: 250px;
327
+ display: inline-block;
328
+ }
329
+
330
+ #bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,
331
  #bbp-login fieldset label,
332
  #bbp-register fieldset label,
333
  #bbp-lost-pass fieldset label {
334
  width: 100px;
 
 
 
 
 
 
 
 
335
  }
336
 
337
+ #content fieldset.bbp-form p,
338
+ #container fieldset.bbp-form p,
339
+ #wrapper fieldset.bbp-form p,
340
+ #content fieldset.bbp-form textarea,
341
+ #container fieldset.bbp-form textarea,
342
+ #wrapper fieldset.bbp-form textarea,
343
+ #content fieldset.bbp-form select,
344
+ #container fieldset.bbp-form select,
345
+ #wrapper fieldset.bbp-form select,
346
+ #content fieldset.bbp-form input,
347
+ #container fieldset.bbp-form input,
348
+ #wrapper fieldset.bbp-form input {
349
  margin: 0px 0px 10px;
350
  }
351
 
614
  border: 3px double #ddd;
615
  }
616
 
617
+ fieldset div.avatar {
618
+ float: right;
619
+ }
bbp-themes/bbp-twentyten/functions.php CHANGED
@@ -37,11 +37,25 @@ function bbp_twentyten_enqueue_styles () {
37
  if ( is_admin() )
38
  return false;
39
 
40
- // TwentyTen
41
- wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', 'bbp-twentyten-default', 20100503, 'screen' );
42
 
43
- // bbPress specific
44
- wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress.css', 'twentyten', 20100503, 'screen' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
  add_action( 'init', 'bbp_twentyten_enqueue_styles' );
47
  endif;
37
  if ( is_admin() )
38
  return false;
39
 
40
+ // Right to left
41
+ if ( is_rtl() ) {
42
 
43
+ // TwentyTen
44
+ wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', '', 20100503, 'screen' );
45
+ wp_enqueue_style( 'twentyten-rtl', get_template_directory_uri() . '/rtl.css', 'twentyten', 20100503, 'screen' );
46
+
47
+ // bbPress specific
48
+ wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress-rtl.css', 'twentyten-rtl', 20100503, 'screen' );
49
+
50
+ // Left to right
51
+ } else {
52
+
53
+ // TwentyTen
54
+ wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', '', 20100503, 'screen' );
55
+
56
+ // bbPress specific
57
+ wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress.css', 'twentyten', 20100503, 'screen' );
58
+ }
59
  }
60
  add_action( 'init', 'bbp_twentyten_enqueue_styles' );
61
  endif;
bbp-themes/bbp-twentyten/page-create-topic.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  <?php the_content(); ?>
26
 
27
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
28
 
29
  <?php bbp_get_template_part( 'bbpress/form', 'topic' ); ?>
30
 
24
 
25
  <?php the_content(); ?>
26
 
27
+ <?php bbp_breadcrumb(); ?>
28
 
29
  <?php bbp_get_template_part( 'bbpress/form', 'topic' ); ?>
30
 
bbp-themes/bbp-twentyten/page-front-topics.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  <?php the_content(); ?>
26
 
27
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
28
 
29
  <?php do_action( 'bbp_template_before_topics_index' ); ?>
30
 
24
 
25
  <?php the_content(); ?>
26
 
27
+ <?php bbp_breadcrumb(); ?>
28
 
29
  <?php do_action( 'bbp_template_before_topics_index' ); ?>
30
 
bbp-themes/bbp-twentyten/page-topic-tags.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  <?php get_the_content() ? the_content() : _e( '<p>This is a collection of tags that are currently popular on our forums.</p>', 'bbpress' ); ?>
26
 
27
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
28
 
29
  <div id="bbp-topic-hot-tags">
30
 
24
 
25
  <?php get_the_content() ? the_content() : _e( '<p>This is a collection of tags that are currently popular on our forums.</p>', 'bbpress' ); ?>
26
 
27
+ <?php bbp_breadcrumb(); ?>
28
 
29
  <div id="bbp-topic-hot-tags">
30
 
bbp-themes/bbp-twentyten/page-topics-no-replies.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  <?php the_content(); ?>
26
 
27
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
28
 
29
  <?php bbp_set_query_name( 'bbp_no_replies' ); ?>
30
 
24
 
25
  <?php the_content(); ?>
26
 
27
+ <?php bbp_breadcrumb(); ?>
28
 
29
  <?php bbp_set_query_name( 'bbp_no_replies' ); ?>
30
 
bbp-themes/bbp-twentyten/page-user-login.php CHANGED
@@ -26,7 +26,7 @@ get_header(); ?>
26
 
27
  <?php the_content(); ?>
28
 
29
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
30
 
31
  <?php bbp_get_template_part( 'bbpress/form', 'user-login' ); ?>
32
 
26
 
27
  <?php the_content(); ?>
28
 
29
+ <?php bbp_breadcrumb(); ?>
30
 
31
  <?php bbp_get_template_part( 'bbpress/form', 'user-login' ); ?>
32
 
bbp-themes/bbp-twentyten/page-user-lost-pass.php CHANGED
@@ -26,7 +26,7 @@ get_header(); ?>
26
 
27
  <?php the_content(); ?>
28
 
29
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
30
 
31
  <?php bbp_get_template_part( 'bbpress/form', 'user-lost-pass' ); ?>
32
 
26
 
27
  <?php the_content(); ?>
28
 
29
+ <?php bbp_breadcrumb(); ?>
30
 
31
  <?php bbp_get_template_part( 'bbpress/form', 'user-lost-pass' ); ?>
32
 
bbp-themes/bbp-twentyten/page-user-register.php CHANGED
@@ -26,7 +26,7 @@ get_header(); ?>
26
 
27
  <?php the_content(); ?>
28
 
29
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
30
 
31
  <?php bbp_get_template_part( 'bbpress/form', 'user-register' ); ?>
32
 
26
 
27
  <?php the_content(); ?>
28
 
29
+ <?php bbp_breadcrumb(); ?>
30
 
31
  <?php bbp_get_template_part( 'bbpress/form', 'user-register' ); ?>
32
 
bbp-themes/bbp-twentyten/rtl.css ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Theme Name: bbPress (Twenty Ten)
3
+ * Theme URI: http://bbpress.org
4
+ * Description: Adds bbPress forums to the Twenty Ten theme
5
+ * Author: WordPress and bbPress teams
6
+ * Version: 1.1
7
+ * Tags: bbpress, black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style
8
+ * Template: twentyten
9
+ *
10
+ **
11
+ *
12
+ * This file intentionally left blank. Styles are enqueued in functions.php
13
+ *
14
+ * 1 - ./css/bbpress-rtl.css
15
+ *
16
+ **/
bbp-themes/bbp-twentyten/single-forum.php CHANGED
@@ -24,7 +24,7 @@
24
  <h1 class="entry-title"><?php bbp_forum_title(); ?></h1>
25
  <div class="entry-content">
26
 
27
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
28
 
29
  <?php if ( post_password_required() ) : ?>
30
 
24
  <h1 class="entry-title"><?php bbp_forum_title(); ?></h1>
25
  <div class="entry-content">
26
 
27
+ <?php bbp_breadcrumb(); ?>
28
 
29
  <?php if ( post_password_required() ) : ?>
30
 
bbp-themes/bbp-twentyten/single-reply.php CHANGED
@@ -21,7 +21,7 @@
21
  <div id="bbp-reply-wrapper-<?php bbp_reply_id(); ?>" class="bbp-reply-wrapper">
22
  <h1 class="entry-title"><?php bbp_reply_title(); ?></h1>
23
 
24
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
25
 
26
  <div class="entry-content">
27
 
21
  <div id="bbp-reply-wrapper-<?php bbp_reply_id(); ?>" class="bbp-reply-wrapper">
22
  <h1 class="entry-title"><?php bbp_reply_title(); ?></h1>
23
 
24
+ <?php bbp_breadcrumb(); ?>
25
 
26
  <div class="entry-content">
27
 
bbp-themes/bbp-twentyten/single-topic.php CHANGED
@@ -24,7 +24,7 @@
24
  <h1 class="entry-title"><?php bbp_topic_title(); ?></h1>
25
  <div class="entry-content">
26
 
27
- <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
28
 
29
  <?php if ( post_password_required() ) : ?>
30
 
@@ -38,7 +38,7 @@
38
 
39
  <div id="ajax-response"></div>
40
 
41
- <?php bbp_get_template_part( 'bbpress/single', 'topic' ); ?>
42
 
43
  <?php if ( bbp_get_query_name() || bbp_has_replies() ) : ?>
44
 
@@ -48,10 +48,10 @@
48
 
49
  <?php bbp_get_template_part( 'bbpress/pagination', 'replies' ); ?>
50
 
51
- <?php bbp_get_template_part( 'bbpress/form', 'reply' ); ?>
52
-
53
  <?php endif; ?>
54
 
 
 
55
  <?php endif; ?>
56
 
57
  </div>
24
  <h1 class="entry-title"><?php bbp_topic_title(); ?></h1>
25
  <div class="entry-content">
26
 
27
+ <?php bbp_breadcrumb(); ?>
28
 
29
  <?php if ( post_password_required() ) : ?>
30
 
38
 
39
  <div id="ajax-response"></div>
40
 
41
+ <?php bbp_get_template_part( 'bbpress/single', 'topic' ); ?>
42
 
43
  <?php if ( bbp_get_query_name() || bbp_has_replies() ) : ?>
44
 
48
 
49
  <?php bbp_get_template_part( 'bbpress/pagination', 'replies' ); ?>
50
 
 
 
51
  <?php endif; ?>
52
 
53
+ <?php bbp_get_template_part( 'bbpress/form', 'reply' ); ?>
54
+
55
  <?php endif; ?>
56
 
57
  </div>
bbp-themes/bbp-twentyten/style.css CHANGED
@@ -9,12 +9,8 @@
9
  *
10
  **
11
  *
12
- * This file intentionally left blank. Styles are enqueued in functions.php in
13
- * the order you see listed below:
14
  *
 
15
  *
16
- * 1 - ./css/twentyten.css
17
- *
18
- * 2 - ./css/bbpress.css
19
- *
20
- **/
9
  *
10
  **
11
  *
12
+ * This file intentionally left blank. Styles are enqueued in functions.php
 
13
  *
14
+ * 1 - ./css/bbpress.css
15
  *
16
+ **/
 
 
 
 
bbp-themes/bbp-twentyten/taxonomy-topic-tag.php CHANGED
@@ -21,6 +21,8 @@
21
 
22
  <div class="entry-content">
23
 
 
 
24
  <?php bbp_topic_tag_description(); ?>
25
 
26
  <?php do_action( 'bbp_template_before_topic_tag' ); ?>
21
 
22
  <div class="entry-content">
23
 
24
+ <?php bbp_breadcrumb(); ?>
25
+
26
  <?php bbp_topic_tag_description(); ?>
27
 
28
  <?php do_action( 'bbp_template_before_topic_tag' ); ?>
bbpress.php CHANGED
@@ -15,10 +15,10 @@
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-beta-1
19
  */
20
 
21
- // Redirect if accessed directly
22
  if ( !defined( 'ABSPATH' ) ) exit;
23
 
24
  /**
@@ -30,7 +30,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
30
  * Note: Checking for defined( 'BBP_VERSION' ) in your code does NOT
31
  * guarantee bbPress is initialized and listening.
32
  */
33
- define( 'BBP_VERSION', '2.0-beta-1' );
34
 
35
  if ( !class_exists( 'bbPress' ) ) :
36
  /**
@@ -148,6 +148,11 @@ class bbPress {
148
  */
149
  var $themes_dir;
150
 
 
 
 
 
 
151
  /** URLs ******************************************************************/
152
 
153
  /**
@@ -285,6 +290,9 @@ class bbPress {
285
  $this->themes_dir = WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) . '/bbp-themes';
286
  $this->themes_url = $this->plugin_url . 'bbp-themes';
287
 
 
 
 
288
  /** Identifiers *******************************************************/
289
 
290
  // Post type identifiers
@@ -424,9 +432,13 @@ class bbPress {
424
  /**
425
  * Register Textdomain
426
  *
427
- * Load the translation file for current language. Checks only the default
428
- * WordPress languages folder to avoid language files being wiped out
429
- * with plugin updates.
 
 
 
 
430
  *
431
  * @since bbPress (r2596)
432
  *
@@ -443,11 +455,16 @@ class bbPress {
443
  // Get mo file name
444
  $mofile = sprintf( 'bbpress-%s.mo', $locale );
445
 
446
- // Setup path to current locale file
 
447
  $mofile_global = WP_LANG_DIR . '/bbpress/' . $mofile;
448
 
 
 
 
 
449
  // Look in global /wp-content/languages/ folder
450
- if ( file_exists( $mofile_global ) )
451
  return load_textdomain( 'bbpress', $mofile_global );
452
 
453
  // Nothing found
@@ -520,7 +537,7 @@ class bbPress {
520
  'capabilities' => bbp_get_forum_caps(),
521
  'capability_type' => 'forum',
522
  'menu_position' => 56,
523
- 'has_archive' => get_page_by_path( $this->root_slug ) ? false : $this->root_slug,
524
  'show_in_nav_menus' => true,
525
  'public' => true,
526
  'show_ui' => true,
@@ -693,7 +710,7 @@ class bbPress {
693
  'protected' => true,
694
  'exclude_from_search' => true,
695
  'show_in_admin_status_list' => true,
696
- 'show_in_admin_all_list' => false
697
  ) );
698
  register_post_status( $this->hidden_status_id, $status );
699
 
@@ -883,8 +900,20 @@ class bbPress {
883
  // Set the compat_theme global for help with loading template parts
884
  bbp_set_theme_compat( $bbp->themes_dir . '/bbp-twentyten' );
885
 
886
- // Load up the default bbPress CSS from bbp-twentyten
887
- wp_enqueue_style ( 'bbpress-style', $bbp->themes_url . '/bbp-twentyten/css/bbpress.css' );
 
 
 
 
 
 
 
 
 
 
 
 
888
  }
889
  }
890
  }
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-beta-2b
19
  */
20
 
21
+ // Exit if accessed directly
22
  if ( !defined( 'ABSPATH' ) ) exit;
23
 
24
  /**
30
  * Note: Checking for defined( 'BBP_VERSION' ) in your code does NOT
31
  * guarantee bbPress is initialized and listening.
32
  */
33
+ define( 'BBP_VERSION', '2.0-beta-2b' );
34
 
35
  if ( !class_exists( 'bbPress' ) ) :
36
  /**
148
  */
149
  var $themes_dir;
150
 
151
+ /**
152
+ * @var string Absolute path to the bbPress language directory
153
+ */
154
+ var $lang_dir;
155
+
156
  /** URLs ******************************************************************/
157
 
158
  /**
290
  $this->themes_dir = WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) . '/bbp-themes';
291
  $this->themes_url = $this->plugin_url . 'bbp-themes';
292
 
293
+ // Languages
294
+ $this->lang_dir = $this->plugin_dir . 'bbp-languages';
295
+
296
  /** Identifiers *******************************************************/
297
 
298
  // Post type identifiers
432
  /**
433
  * Register Textdomain
434
  *
435
+ * Load the translation file for current language. Checks the languages
436
+ * folder inside the bbPress plugin first, and then the default WordPress
437
+ * languages folder.
438
+ *
439
+ * Note that custom translation files inside the bbPress plugin folder
440
+ * will be removed on bbPress updates. If you're creating custom
441
+ * translation files, please use the global language folder.
442
  *
443
  * @since bbPress (r2596)
444
  *
455
  // Get mo file name
456
  $mofile = sprintf( 'bbpress-%s.mo', $locale );
457
 
458
+ // Setup paths to current locale file
459
+ $mofile_local = $this->lang_dir . '/' . $mofile;
460
  $mofile_global = WP_LANG_DIR . '/bbpress/' . $mofile;
461
 
462
+ // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
463
+ if ( file_exists( $mofile_local ) )
464
+ return load_textdomain( 'bbpress', $mofile_local );
465
+
466
  // Look in global /wp-content/languages/ folder
467
+ elseif ( file_exists( $mofile_global ) )
468
  return load_textdomain( 'bbpress', $mofile_global );
469
 
470
  // Nothing found
537
  'capabilities' => bbp_get_forum_caps(),
538
  'capability_type' => 'forum',
539
  'menu_position' => 56,
540
+ 'has_archive' => !empty( $this->root_slug ) ? $this->root_slug : false,
541
  'show_in_nav_menus' => true,
542
  'public' => true,
543
  'show_ui' => true,
710
  'protected' => true,
711
  'exclude_from_search' => true,
712
  'show_in_admin_status_list' => true,
713
+ 'show_in_admin_all_list' => true
714
  ) );
715
  register_post_status( $this->hidden_status_id, $status );
716
 
900
  // Set the compat_theme global for help with loading template parts
901
  bbp_set_theme_compat( $bbp->themes_dir . '/bbp-twentyten' );
902
 
903
+ /** Default CSS ***************************************************/
904
+
905
+ // Do not enqueue CSS in admin
906
+ if ( !is_admin() ) {
907
+
908
+ // Right to left
909
+ if ( is_rtl() ) {
910
+ wp_enqueue_style( 'bbpress-style', $bbp->themes_url . '/bbp-twentyten/css/bbpress-rtl.css' );
911
+
912
+ // Left to right
913
+ } else {
914
+ wp_enqueue_style( 'bbpress-style', $bbp->themes_url . '/bbp-twentyten/css/bbpress.css' );
915
+ }
916
+ }
917
  }
918
  }
919
  }
license.txt CHANGED
@@ -2,7 +2,7 @@
2
  Version 2, June 1991
3
 
4
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
6
 
7
  Everyone is permitted to copy and distribute verbatim copies
8
  of this license document, but changing it is not allowed.
@@ -278,3 +278,4 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
  POSSIBILITY OF SUCH DAMAGES.
279
 
280
  END OF TERMS AND CONDITIONS
 
2
  Version 2, June 1991
3
 
4
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
 
7
  Everyone is permitted to copy and distribute verbatim copies
8
  of this license document, but changing it is not allowed.
278
  POSSIBILITY OF SUCH DAMAGES.
279
 
280
  END OF TERMS AND CONDITIONS
281
+
readme.txt CHANGED
@@ -1,28 +1,41 @@
1
- === bbPress ===
2
- Contributors: matt, johnjamesjacoby, mdawaffe
3
- Tags: bbpress, forums, discussion, post type, theme
4
- Requires at least: 3.1
5
- Tested up to: 3.2
6
- Stable tag: 2.0-beta-1
7
-
8
- bbPress is forum software with a twist from the creators of WordPress
9
-
10
- == Description ==
11
-
12
- Have you ever been frustrated with forum or bulletin board software that was slow, bloated and always got your server hacked? bbPress is focused on web standards, ease of use, ease of integration, and speed.
13
-
14
- We're keeping things as small and light as possible while still allowing for great add-on features through WordPress's extensive plugin system. What does all that mean? bbPress is lean, mean, and ready to take on any job you throw at it.
15
-
16
- == Installation ==
17
-
18
- 1. Place the 'bbpress' folder in your '/wp-content/plugins/' directory.
19
- 2. Activate bbPress.
20
- 3. Visit 'Settings > Forums' and adjust your configuration.
21
- 4. Create some forums.
22
- 5. View your site.
23
- 6. Adjust the CSS of your theme as needed, to make everything pretty.
24
-
25
- == Changelog ==
26
-
27
- = 2.0-beta-1 =
28
- * In development
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === bbPress ===
2
+ Contributors: matt, johnjamesjacoby, mdawaffe
3
+ Tags: bbpress, forums, discussion, post type, theme
4
+ Requires at least: 3.1
5
+ Tested up to: 3.2
6
+ Stable tag: 2.0-beta-2b
7
+
8
+ bbPress is forum software with a twist from the creators of WordPress
9
+
10
+ == Description ==
11
+
12
+ Have you ever been frustrated with forum or bulletin board software that was slow, bloated and always got your server hacked? bbPress is focused on web standards, ease of use, ease of integration, and speed.
13
+
14
+ We're keeping things as small and light as possible while still allowing for great add-on features through WordPress's extensive plugin system. What does all that mean? bbPress is lean, mean, and ready to take on any job you throw at it.
15
+
16
+ == Installation ==
17
+
18
+ 1. Place the 'bbpress' folder in your '/wp-content/plugins/' directory.
19
+ 2. Activate bbPress.
20
+ 3. Visit 'Settings > Forums' and adjust your configuration.
21
+ 4. Create some forums.
22
+ 5. View your site.
23
+ 6. Adjust the CSS of your theme as needed, to make everything pretty.
24
+
25
+ == Changelog ==
26
+
27
+ = 2.0-beta-2b =
28
+ * GlotPress integration
29
+ * Fixes Forum archive bug
30
+ * Fixes and improvements to importer
31
+ * Adds home link support to breadcrumb
32
+ * Improvements to Theme Compatibility
33
+ * Numerous template and CSS improvements
34
+ * RTL support
35
+ * Improved multisite support
36
+ * Add filters for future anti-spam support
37
+ * Add missing breadcrumbs to various template files
38
+ * Topic/reply trash fixes
39
+
40
+ = 2.0-beta-1 =
41
+ * In development