BuddyPress - Version 1.7

Version Description

See: http://codex.buddypress.org/releases/version-1-7/

Download this release

Release Info

Developer boonebgorges
Plugin Icon 128x128 BuddyPress
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.5 to 1.7

Files changed (141) hide show
  1. bp-activity/admin/css/admin.css +77 -1
  2. bp-activity/admin/css/admin.dev.css +0 -77
  3. bp-activity/admin/css/admin.min.css +1 -0
  4. bp-activity/admin/js/admin.dev.js +0 -167
  5. bp-activity/admin/js/admin.js +167 -1
  6. bp-activity/admin/js/admin.min.js +1 -0
  7. bp-activity/bp-activity-actions.php +6 -8
  8. bp-activity/bp-activity-admin.php +89 -84
  9. bp-activity/bp-activity-akismet.php +30 -30
  10. bp-activity/bp-activity-cache.php +1 -3
  11. bp-activity/bp-activity-classes.php +31 -26
  12. bp-activity/bp-activity-filters.php +70 -45
  13. bp-activity/bp-activity-functions.php +139 -63
  14. bp-activity/bp-activity-loader.php +6 -7
  15. bp-activity/bp-activity-notifications.php +10 -15
  16. bp-activity/bp-activity-screens.php +109 -1
  17. bp-activity/bp-activity-template.php +266 -51
  18. bp-activity/feeds/bp-activity-favorites-feed.php +2 -3
  19. bp-activity/feeds/bp-activity-friends-feed.php +2 -3
  20. bp-activity/feeds/bp-activity-group-feed.php +2 -3
  21. bp-activity/feeds/bp-activity-mentions-feed.php +2 -3
  22. bp-activity/feeds/bp-activity-mygroups-feed.php +2 -3
  23. bp-activity/feeds/bp-activity-personal-feed.php +2 -3
  24. bp-activity/feeds/bp-activity-sitewide-feed.php +2 -3
  25. bp-blogs/bp-blogs-actions.php +0 -2
  26. bp-blogs/bp-blogs-activity.php +2 -4
  27. bp-blogs/bp-blogs-buddybar.php +2 -4
  28. bp-blogs/bp-blogs-cache.php +5 -7
  29. bp-blogs/bp-blogs-classes.php +36 -8
  30. bp-blogs/bp-blogs-filters.php +16 -6
  31. bp-blogs/bp-blogs-functions.php +90 -18
  32. bp-blogs/bp-blogs-loader.php +12 -5
  33. bp-blogs/bp-blogs-screens.php +130 -1
  34. bp-blogs/bp-blogs-template.php +197 -13
  35. bp-blogs/bp-blogs-widgets.php +3 -4
  36. bp-core/admin/bp-core-actions.php +171 -0
  37. bp-core/admin/bp-core-components.php +275 -162
  38. bp-core/admin/bp-core-functions.php +331 -96
  39. bp-core/admin/bp-core-schema.php +9 -61
  40. bp-core/admin/bp-core-settings.php +3 -4
  41. bp-core/admin/bp-core-slugs.php +12 -13
  42. bp-core/admin/bp-core-update.php +0 -1051
  43. bp-core/admin/css/common.css +220 -1
  44. bp-core/admin/css/common.dev.css +0 -148
  45. bp-core/admin/css/common.min.css +1 -0
  46. bp-core/admin/css/wizard.css +0 -1
  47. bp-core/admin/css/wizard.dev.css +0 -181
  48. bp-core/admin/images/badge-2x.png +0 -0
  49. bp-core/admin/images/badge.png +0 -0
  50. bp-core/admin/images/completed.gif +0 -0
  51. bp-core/admin/images/find.png +0 -0
  52. bp-core/admin/images/icons64.png +0 -0
  53. bp-core/admin/images/installed.gif +0 -0
  54. bp-core/admin/images/menu-2x.png +0 -0
  55. bp-core/admin/js/wizard.dev.js +0 -11
  56. bp-core/admin/js/wizard.js +0 -1
  57. bp-core/bp-core-actions.php +25 -195
  58. bp-core/bp-core-admin.php +349 -243
  59. bp-core/bp-core-adminbar.php +60 -17
  60. bp-core/bp-core-avatars.php +116 -93
  61. bp-core/bp-core-buddybar.php +15 -71
  62. bp-core/bp-core-cache.php +3 -5
  63. bp-core/bp-core-caps.php +87 -223
  64. bp-core/bp-core-catchuri.php +37 -27
  65. bp-core/bp-core-classes.php +767 -105
  66. bp-core/bp-core-component.php +0 -5
  67. bp-core/bp-core-cssjs.php +57 -38
  68. bp-core/bp-core-dependency.php +271 -0
  69. bp-core/bp-core-filters.php +87 -60
  70. bp-core/bp-core-functions.php +186 -68
  71. bp-core/bp-core-loader.php +4 -3
  72. bp-core/bp-core-moderation.php +6 -7
  73. bp-core/bp-core-options.php +15 -1
  74. bp-core/bp-core-template-loader.php +398 -0
  75. bp-core/bp-core-template.php +312 -50
  76. bp-core/bp-core-theme-compatibility.php +697 -0
  77. bp-core/bp-core-update.php +178 -43
  78. bp-core/bp-core-widgets.php +39 -38
  79. bp-core/bp-core-wpabstraction.php +0 -2
  80. bp-core/css/admin-bar-rtl.css +27 -1
  81. bp-core/css/admin-bar-rtl.dev.css +0 -27
  82. bp-core/css/admin-bar-rtl.min.css +1 -0
  83. bp-core/css/admin-bar.css +58 -1
  84. bp-core/css/admin-bar.dev.css +0 -58
  85. bp-core/css/admin-bar.min.css +1 -0
  86. bp-core/css/buddybar-rtl.css +77 -1
  87. bp-core/css/buddybar-rtl.dev.css +0 -77
  88. bp-core/css/buddybar-rtl.min.css +1 -0
  89. bp-core/css/buddybar.css +203 -1
  90. bp-core/css/buddybar.dev.css +0 -203
  91. bp-core/css/buddybar.min.css +1 -0
  92. bp-core/deprecated/1.5.php +62 -35
  93. bp-core/deprecated/1.6.php +45 -35
  94. bp-core/deprecated/1.7.php +163 -0
  95. bp-core/js/widget-members.dev.js +0 -49
  96. bp-core/js/widget-members.js +49 -1
  97. bp-core/js/widget-members.min.js +1 -0
  98. bp-forums/bb-config.php +0 -1
  99. bp-forums/bp-forums-actions.php +0 -2
  100. bp-forums/bp-forums-bbpress-sa.php +0 -2
  101. bp-forums/bp-forums-bbpress.php +0 -1
  102. bp-forums/bp-forums-filters.php +1 -4
  103. bp-forums/bp-forums-functions.php +55 -74
  104. bp-forums/bp-forums-loader.php +4 -34
  105. bp-forums/bp-forums-screens.php +98 -10
  106. bp-forums/bp-forums-template.php +0 -1
  107. bp-forums/deprecated/1.6.php +4 -40
  108. bp-forums/{bp-forums-admin.php → deprecated/1.7.php} +19 -6
  109. bp-friends/bp-friends-actions.php +0 -2
  110. bp-friends/bp-friends-activity.php +1 -3
  111. bp-friends/bp-friends-cache.php +0 -2
  112. bp-friends/bp-friends-classes.php +6 -8
  113. bp-friends/bp-friends-filters.php +35 -0
  114. bp-friends/bp-friends-functions.php +3 -5
  115. bp-friends/bp-friends-loader.php +11 -4
  116. bp-friends/bp-friends-notifications.php +4 -10
  117. bp-friends/bp-friends-screens.php +1 -3
  118. bp-friends/bp-friends-template.php +5 -7
  119. bp-groups/admin/css/admin.css +20 -0
  120. bp-groups/admin/css/admin.min.css +1 -0
  121. bp-groups/admin/js/admin.js +31 -0
  122. bp-groups/admin/js/admin.min.js +1 -0
  123. bp-groups/bp-groups-actions.php +5 -3
  124. bp-groups/bp-groups-activity.php +0 -2
  125. bp-groups/bp-groups-admin.php +1324 -0
  126. bp-groups/bp-groups-adminbar.php +0 -2
  127. bp-groups/bp-groups-buddybar.php +0 -2
  128. bp-groups/bp-groups-cache.php +17 -4
  129. bp-groups/bp-groups-classes.php +152 -52
  130. bp-groups/bp-groups-filters.php +7 -4
  131. bp-groups/bp-groups-forums.php +11 -13
  132. bp-groups/bp-groups-functions.php +49 -21
  133. bp-groups/bp-groups-loader.php +43 -30
  134. bp-groups/bp-groups-notifications.php +8 -16
  135. bp-groups/bp-groups-screens.php +664 -458
  136. bp-groups/bp-groups-template.php +254 -64
  137. bp-groups/bp-groups-widgets.php +37 -44
  138. bp-groups/js/widget-groups.dev.js +0 -49
  139. bp-groups/js/widget-groups.js +49 -1
  140. bp-groups/js/widget-groups.min.js +1 -0
  141. bp-languages/buddypress.pot +2447 -1774
bp-activity/admin/css/admin.css CHANGED
@@ -1 +1,77 @@
1
- .akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .akismet-status {
2
+ float: right;
3
+ }
4
+ .akismet-status a {
5
+ color: #AAA;
6
+ font-style: italic;
7
+ }
8
+ .akismet-history {
9
+ margin: 13px;
10
+ }
11
+ .akismet-history div {
12
+ margin-bottom: 13px;
13
+ }
14
+ .akismet-history span {
15
+ color: #999;
16
+ }
17
+
18
+ #wp-bp-activities-wrap {
19
+ padding: 5px 0;
20
+ }
21
+ #bp-activities {
22
+ height: 120px;
23
+ }
24
+ #bp-replyhead {
25
+ font-size: 1em;
26
+ line-height: 1.4em;
27
+ margin: 0;
28
+ }
29
+ #bp-replysubmit {
30
+ margin: 0;
31
+ padding: 0 0 3px;
32
+ text-align: center;
33
+ }
34
+ #bp-replysubmit .error {
35
+ color: red;
36
+ line-height: 21px;
37
+ text-align: center;
38
+ vertical-align: center;
39
+ }
40
+ #bp-replysubmit img.waiting {
41
+ float: right;
42
+ padding: 4px 10px 0;
43
+ vertical-align: top;
44
+ }
45
+ #bp-activities-form .column-response img {
46
+ float: left;
47
+ margin-right: 10px;
48
+ margin-top: 1px;
49
+ }
50
+ .activity-errors {
51
+ list-style-type: disc;
52
+ margin-left: 2em;
53
+ }
54
+
55
+ #bp_activity_action div.inside,
56
+ #bp_activity_content div.inside {
57
+ line-height: 0;
58
+ }
59
+ #bp_activity_action h3,
60
+ #bp_activity_content h3 {
61
+ cursor: auto;
62
+ }
63
+ #bp_activity_action td.mceIframeContainer,
64
+ #bp_activity_content td.mceIframeContainer {
65
+ background-color: white;
66
+ }
67
+ #post-body #bp-activities-action_resize,
68
+ #post-body #bp-activities-content_resize {
69
+ position: inherit;
70
+ margin-top: -2px;
71
+ }
72
+ #bp_activity_link input {
73
+ width: 99%;
74
+ }
75
+ #bp-activities-primaryid {
76
+ margin-bottom: 1em;
77
+ }
bp-activity/admin/css/admin.dev.css DELETED
@@ -1,77 +0,0 @@
1
- .akismet-status {
2
- float: right;
3
- }
4
- .akismet-status a {
5
- color: #AAA;
6
- font-style: italic;
7
- }
8
- .akismet-history {
9
- margin: 13px;
10
- }
11
- .akismet-history div {
12
- margin-bottom: 13px;
13
- }
14
- .akismet-history span {
15
- color: #999;
16
- }
17
-
18
- #wp-bp-activities-wrap {
19
- padding: 5px 0;
20
- }
21
- #bp-activities {
22
- height: 120px;
23
- }
24
- #bp-replyhead {
25
- font-size: 1em;
26
- line-height: 1.4em;
27
- margin: 0;
28
- }
29
- #bp-replysubmit {
30
- margin: 0;
31
- padding: 0 0 3px;
32
- text-align: center;
33
- }
34
- #bp-replysubmit .error {
35
- color: red;
36
- line-height: 21px;
37
- text-align: center;
38
- vertical-align: center;
39
- }
40
- #bp-replysubmit img.waiting {
41
- float: right;
42
- padding: 4px 10px 0;
43
- vertical-align: top;
44
- }
45
- #bp-activities-form .column-response img {
46
- float: left;
47
- margin-right: 10px;
48
- margin-top: 1px;
49
- }
50
- .activity-errors {
51
- list-style-type: disc;
52
- margin-left: 2em;
53
- }
54
-
55
- #bp_activity_action div.inside,
56
- #bp_activity_content div.inside {
57
- line-height: 0;
58
- }
59
- #bp_activity_action h3,
60
- #bp_activity_content h3 {
61
- cursor: auto;
62
- }
63
- #bp_activity_action td.mceIframeContainer,
64
- #bp_activity_content td.mceIframeContainer {
65
- background-color: white;
66
- }
67
- #post-body #bp-activities-action_resize,
68
- #post-body #bp-activities-content_resize {
69
- position: inherit;
70
- margin-top: -2px;
71
- }
72
- #bp_activity_link input {
73
- width: 99%;
74
- }
75
- #bp-activities-primaryid {
76
- margin-bottom: 1em;
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-activity/admin/css/admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}
bp-activity/admin/js/admin.dev.js DELETED
@@ -1,167 +0,0 @@
1
- (function( $ ) {
2
-
3
- /**
4
- * Activity reply object for the activity index screen
5
- *
6
- * @since 1.6
7
- */
8
- var activityReply = {
9
-
10
- /**
11
- * Attach event handler functions to the relevant elements.
12
- *
13
- * @since 1.6
14
- */
15
- init : function() {
16
- $(document).on( 'click', '.row-actions a.reply', activityReply.open );
17
- $(document).on( 'click', '#bp-activities-container a.cancel', activityReply.close );
18
- $(document).on( 'click', '#bp-activities-container a.save', activityReply.send );
19
-
20
- // Close textarea on escape
21
- $(document).on( 'keyup', '#bp-activities:visible', function( e ) {
22
- if ( 27 == e.which ) {
23
- activityReply.close();
24
- }
25
- });
26
- },
27
-
28
- /**
29
- * Reveals the entire row when "reply" is pressed.
30
- *
31
- * @since 1.6
32
- */
33
- open : function( e ) {
34
- // Hide the container row, and move it to the new location
35
- var box = $( '#bp-activities-container' ).hide();
36
- $( this ).parents( 'tr' ).after( box );
37
-
38
- // Fade the whole row in, and set focus on the text area.
39
- box.fadeIn( '300' );
40
- $( '#bp-activities' ).focus();
41
-
42
- return false;
43
- },
44
-
45
- /**
46
- * Hide and reset the entire row when "cancel", or escape, are pressed.
47
- *
48
- * @since 1.6
49
- */
50
- close : function( e ) {
51
- // Hide the container row
52
- $('#bp-activities-container').fadeOut( '200', function () {
53
-
54
- // Empty and unfocus the text area
55
- $( '#bp-activities' ).val( '' ).blur();
56
-
57
- // Remove any error message and disable the spinner
58
- $( '#bp-replysubmit .error' ).html( '' ).hide();
59
- $( '#bp-replysubmit .waiting' ).hide();
60
- });
61
-
62
- return false;
63
- },
64
-
65
- /**
66
- * Submits "form" via AJAX back to WordPress.
67
- *
68
- * @since 1.6
69
- */
70
- send : function( e ) {
71
- // Hide any existing error message, and show the loading spinner
72
- $( '#bp-replysubmit .error' ).hide();
73
- $( '#bp-replysubmit .waiting' ).show();
74
-
75
- // Grab the nonce
76
- var reply = {};
77
- reply['_ajax_nonce-bp-activity-admin-reply'] = $( '#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]' ).val();
78
-
79
- // Get the rest of the data
80
- reply.action = 'bp-activity-admin-reply';
81
- reply.content = $( '#bp-activities' ).val();
82
- reply.parent_id = $( '#bp-activities-container' ).prev().data( 'parent_id' );
83
- reply.root_id = $( '#bp-activities-container' ).prev().data( 'root_id' );
84
-
85
- // Make the AJAX call
86
- $.ajax({
87
- data : reply,
88
- type : 'POST',
89
- url : ajaxurl,
90
-
91
- // Callbacks
92
- error : function( r ) { activityReply.error( r ); },
93
- success : function( r ) { activityReply.show( r ); }
94
- });
95
-
96
- return false;
97
- },
98
-
99
- /**
100
- * send() error message handler
101
- *
102
- * @since 1.6
103
- */
104
- error : function( r ) {
105
- var er = r.statusText;
106
- $('#bp-replysubmit .waiting').hide();
107
-
108
- if ( r.responseText ) {
109
- er = r.responseText.replace( /<.[^<>]*?>/g, '' );
110
- }
111
-
112
- if ( er ) {
113
- $('#bp-replysubmit .error').html( er ).show();
114
- }
115
- },
116
-
117
- /**
118
- * send() success handler
119
- *
120
- * @since 1.6
121
- */
122
- show : function ( xml ) {
123
- var bg, id, response;
124
-
125
- // Handle any errors in the response
126
- if ( typeof( xml ) == 'string' ) {
127
- activityReply.error( { 'responseText': xml } );
128
- return false;
129
- }
130
-
131
- response = wpAjax.parseAjaxResponse( xml );
132
- if ( response.errors ) {
133
- activityReply.error( { 'responseText': wpAjax.broken } );
134
- return false;
135
- }
136
- response = response.responses[0];
137
-
138
- // Close and reset the reply row, and add the new Activity item into the list.
139
- $('#bp-activities-container').fadeOut( '200', function () {
140
-
141
- // Empty and unfocus the text area
142
- $( '#bp-activities' ).val( '' ).blur();
143
-
144
- // Remove any error message and disable the spinner
145
- $( '#bp-replysubmit .error' ).html( '' ).hide();
146
- $( '#bp-replysubmit .waiting' ).hide();
147
-
148
- // Insert new activity item
149
- $( '#bp-activities-container' ).before( response.data );
150
-
151
- // Get background colour and animate the flash
152
- id = $( '#activity-' + response.id );
153
- bg = id.closest( '.widefat' ).css( 'backgroundColor' );
154
- id.animate( { 'backgroundColor': '#CEB' }, 300 ).animate( { 'backgroundColor': bg }, 300 );
155
- });
156
- }
157
- };
158
-
159
- $(document).ready( function () {
160
- // Create the Activity reply object after domready event
161
- activityReply.init();
162
-
163
- // On the edit screen, unload the close/open toggle js for the action & content metaboxes
164
- $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
165
- });
166
-
167
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-activity/admin/js/admin.js CHANGED
@@ -1 +1,167 @@
1
- (function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+
3
+ /**
4
+ * Activity reply object for the activity index screen
5
+ *
6
+ * @since BuddyPress (1.6)
7
+ */
8
+ var activityReply = {
9
+
10
+ /**
11
+ * Attach event handler functions to the relevant elements.
12
+ *
13
+ * @since BuddyPress (1.6)
14
+ */
15
+ init : function() {
16
+ $(document).on( 'click', '.row-actions a.reply', activityReply.open );
17
+ $(document).on( 'click', '#bp-activities-container a.cancel', activityReply.close );
18
+ $(document).on( 'click', '#bp-activities-container a.save', activityReply.send );
19
+
20
+ // Close textarea on escape
21
+ $(document).on( 'keyup', '#bp-activities:visible', function( e ) {
22
+ if ( 27 == e.which ) {
23
+ activityReply.close();
24
+ }
25
+ });
26
+ },
27
+
28
+ /**
29
+ * Reveals the entire row when "reply" is pressed.
30
+ *
31
+ * @since BuddyPress (1.6)
32
+ */
33
+ open : function( e ) {
34
+ // Hide the container row, and move it to the new location
35
+ var box = $( '#bp-activities-container' ).hide();
36
+ $( this ).parents( 'tr' ).after( box );
37
+
38
+ // Fade the whole row in, and set focus on the text area.
39
+ box.fadeIn( '300' );
40
+ $( '#bp-activities' ).focus();
41
+
42
+ return false;
43
+ },
44
+
45
+ /**
46
+ * Hide and reset the entire row when "cancel", or escape, are pressed.
47
+ *
48
+ * @since BuddyPress (1.6)
49
+ */
50
+ close : function( e ) {
51
+ // Hide the container row
52
+ $('#bp-activities-container').fadeOut( '200', function () {
53
+
54
+ // Empty and unfocus the text area
55
+ $( '#bp-activities' ).val( '' ).blur();
56
+
57
+ // Remove any error message and disable the spinner
58
+ $( '#bp-replysubmit .error' ).html( '' ).hide();
59
+ $( '#bp-replysubmit .waiting' ).hide();
60
+ });
61
+
62
+ return false;
63
+ },
64
+
65
+ /**
66
+ * Submits "form" via AJAX back to WordPress.
67
+ *
68
+ * @since BuddyPress (1.6)
69
+ */
70
+ send : function( e ) {
71
+ // Hide any existing error message, and show the loading spinner
72
+ $( '#bp-replysubmit .error' ).hide();
73
+ $( '#bp-replysubmit .waiting' ).show();
74
+
75
+ // Grab the nonce
76
+ var reply = {};
77
+ reply['_ajax_nonce-bp-activity-admin-reply'] = $( '#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]' ).val();
78
+
79
+ // Get the rest of the data
80
+ reply.action = 'bp-activity-admin-reply';
81
+ reply.content = $( '#bp-activities' ).val();
82
+ reply.parent_id = $( '#bp-activities-container' ).prev().data( 'parent_id' );
83
+ reply.root_id = $( '#bp-activities-container' ).prev().data( 'root_id' );
84
+
85
+ // Make the AJAX call
86
+ $.ajax({
87
+ data : reply,
88
+ type : 'POST',
89
+ url : ajaxurl,
90
+
91
+ // Callbacks
92
+ error : function( r ) { activityReply.error( r ); },
93
+ success : function( r ) { activityReply.show( r ); }
94
+ });
95
+
96
+ return false;
97
+ },
98
+
99
+ /**
100
+ * send() error message handler
101
+ *
102
+ * @since BuddyPress (1.6)
103
+ */
104
+ error : function( r ) {
105
+ var er = r.statusText;
106
+ $('#bp-replysubmit .waiting').hide();
107
+
108
+ if ( r.responseText ) {
109
+ er = r.responseText.replace( /<.[^<>]*?>/g, '' );
110
+ }
111
+
112
+ if ( er ) {
113
+ $('#bp-replysubmit .error').html( er ).show();
114
+ }
115
+ },
116
+
117
+ /**
118
+ * send() success handler
119
+ *
120
+ * @since BuddyPress (1.6)
121
+ */
122
+ show : function ( xml ) {
123
+ var bg, id, response;
124
+
125
+ // Handle any errors in the response
126
+ if ( typeof( xml ) == 'string' ) {
127
+ activityReply.error( { 'responseText': xml } );
128
+ return false;
129
+ }
130
+
131
+ response = wpAjax.parseAjaxResponse( xml );
132
+ if ( response.errors ) {
133
+ activityReply.error( { 'responseText': wpAjax.broken } );
134
+ return false;
135
+ }
136
+ response = response.responses[0];
137
+
138
+ // Close and reset the reply row, and add the new Activity item into the list.
139
+ $('#bp-activities-container').fadeOut( '200', function () {
140
+
141
+ // Empty and unfocus the text area
142
+ $( '#bp-activities' ).val( '' ).blur();
143
+
144
+ // Remove any error message and disable the spinner
145
+ $( '#bp-replysubmit .error' ).html( '' ).hide();
146
+ $( '#bp-replysubmit .waiting' ).hide();
147
+
148
+ // Insert new activity item
149
+ $( '#bp-activities-container' ).before( response.data );
150
+
151
+ // Get background colour and animate the flash
152
+ id = $( '#activity-' + response.id );
153
+ bg = id.closest( '.widefat' ).css( 'backgroundColor' );
154
+ id.animate( { 'backgroundColor': '#CEB' }, 300 ).animate( { 'backgroundColor': bg }, 300 );
155
+ });
156
+ }
157
+ };
158
+
159
+ $(document).ready( function () {
160
+ // Create the Activity reply object after domready event
161
+ activityReply.init();
162
+
163
+ // On the edit screen, unload the close/open toggle js for the action & content metaboxes
164
+ $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
165
+ });
166
+
167
+ })(jQuery);
bp-activity/admin/js/admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery);
bp-activity/bp-activity-actions.php CHANGED
@@ -147,7 +147,7 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
147
  $activity = new BP_Activity_Activity( $activity_id );
148
 
149
  // Check access
150
- if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) )
151
  return false;
152
 
153
  // Call the action before the delete so plugins can still fetch information about it
@@ -175,7 +175,7 @@ add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
175
  * @global object $bp BuddyPress global settings
176
  * @param int $activity_id Activity id to be deleted. Defaults to 0.
177
  * @return bool False on failure
178
- * @since 1.6
179
  */
180
  function bp_activity_action_spam_activity( $activity_id = 0 ) {
181
  global $bp;
@@ -325,9 +325,9 @@ function bp_activity_action_post_comment() {
325
  }
326
 
327
  $comment_id = bp_activity_new_comment( array(
328
- 'content' => $content,
329
  'activity_id' => $activity_id,
330
- 'parent_id' => $parent_id
331
  ));
332
 
333
  if ( !empty( $comment_id ) )
@@ -577,7 +577,7 @@ add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
577
  * Loads Akismet
578
  *
579
  * @global object $bp BuddyPress global settings
580
- * @since 1.6
581
  */
582
  function bp_activity_setup_akismet() {
583
  global $bp;
@@ -591,11 +591,9 @@ function bp_activity_setup_akismet() {
591
  return;
592
 
593
  // Bail if BuddyPress Activity Akismet support has been disabled by another plugin
594
- if ( ! apply_filters( 'bp_activity_use_akismet', true ) )
595
  return;
596
 
597
  // Instantiate Akismet for BuddyPress
598
  $bp->activity->akismet = new BP_Akismet();
599
  }
600
-
601
- ?>
147
  $activity = new BP_Activity_Activity( $activity_id );
148
 
149
  // Check access
150
+ if ( ! bp_activity_user_can_delete( $activity ) )
151
  return false;
152
 
153
  // Call the action before the delete so plugins can still fetch information about it
175
  * @global object $bp BuddyPress global settings
176
  * @param int $activity_id Activity id to be deleted. Defaults to 0.
177
  * @return bool False on failure
178
+ * @since BuddyPress (1.6)
179
  */
180
  function bp_activity_action_spam_activity( $activity_id = 0 ) {
181
  global $bp;
325
  }
326
 
327
  $comment_id = bp_activity_new_comment( array(
328
+ 'content' => $content,
329
  'activity_id' => $activity_id,
330
+ 'parent_id' => false
331
  ));
332
 
333
  if ( !empty( $comment_id ) )
577
  * Loads Akismet
578
  *
579
  * @global object $bp BuddyPress global settings
580
+ * @since BuddyPress (1.6)
581
  */
582
  function bp_activity_setup_akismet() {
583
  global $bp;
591
  return;
592
 
593
  // Bail if BuddyPress Activity Akismet support has been disabled by another plugin
594
+ if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) )
595
  return;
596
 
597
  // Instantiate Akismet for BuddyPress
598
  $bp->activity->akismet = new BP_Akismet();
599
  }
 
 
bp-activity/bp-activity-admin.php CHANGED
@@ -6,7 +6,7 @@
6
  * on which this implementation is heavily based.
7
  *
8
  * @package BuddyPress
9
- * @since 1.6
10
  * @subpackage Activity
11
  */
12
 
@@ -23,7 +23,7 @@ if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['p
23
  /**
24
  * Registers the Activity component admin screen
25
  *
26
- * @since 1.6
27
  */
28
  function bp_activity_add_admin_menu() {
29
 
@@ -31,18 +31,39 @@ function bp_activity_add_admin_menu() {
31
  return;
32
 
33
  // Add our screen
34
- $hook = add_menu_page( __( 'Activity', 'buddypress' ), __( 'Activity', 'buddypress' ), 'manage_options', 'bp-activity', 'bp_activity_admin' );
 
 
 
 
 
 
 
35
 
36
  // Hook into early actions to load custom CSS and our init handler.
37
  add_action( "load-$hook", 'bp_activity_admin_load' );
38
  }
39
  add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' );
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  /**
42
  * AJAX receiver for Activity replies via the admin screen. Adds a new activity
43
  * comment, and returns HTML for a new table row.
44
  *
45
- * @since 1.6
46
  */
47
  function bp_activity_admin_reply() {
48
  // Check nonce
@@ -116,7 +137,7 @@ add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' );
116
  * @param string $option Screen option name
117
  * @param string $new_value Screen option form value
118
  * @return string Option value. False to abandon update.
119
- * @since 1.6
120
  */
121
  function bp_activity_admin_screen_options( $value, $option, $new_value ) {
122
  if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
@@ -135,7 +156,7 @@ function bp_activity_admin_screen_options( $value, $option, $new_value ) {
135
  *
136
  * @param WP_Screen $screen Screen identifier
137
  * @return array Hidden Meta Boxes
138
- * @since 1.0
139
  */
140
  function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
141
  if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id )
@@ -153,16 +174,15 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe
153
  *
154
  * @global object $bp BuddyPress global settings
155
  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
156
- * @since 1.6
157
  */
158
  function bp_activity_admin_load() {
159
  global $bp, $bp_activity_list_table;
160
 
161
  // Decide whether to load the dev version of the CSS and JavaScript
162
- $dev = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'dev.' : '';
163
 
164
- // Decide whether to load the index or edit screen
165
- $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
166
 
167
  // Call an action for plugins to hook in early
168
  do_action( 'bp_activity_admin_load', $doaction );
@@ -244,8 +264,8 @@ function bp_activity_admin_load() {
244
  }
245
 
246
  // Enqueue CSS and JavaScript
247
- wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$dev}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
248
- wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$dev}css", array(), bp_get_version() );
249
 
250
  // Handle spam/un-spam/delete of activities
251
  if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
@@ -503,7 +523,7 @@ function bp_activity_admin_load() {
503
  /**
504
  * Outputs the Activity component admin screens
505
  *
506
- * @since 1.6
507
  */
508
  function bp_activity_admin() {
509
  // Decide whether to load the index or edit screen
@@ -522,10 +542,9 @@ function bp_activity_admin() {
522
  * Display the single activity edit screen
523
  *
524
  * @global int $screen_layout_columns Number of columns shown on this admin page
525
- * @since 1.6
526
  */
527
  function bp_activity_admin_edit() {
528
- global $screen_layout_columns;
529
 
530
  // @todo: Check if user is allowed to edit activity items
531
  // if ( ! current_user_can( 'bp_edit_activity' ) )
@@ -556,8 +575,7 @@ function bp_activity_admin_edit() {
556
  $form_url = add_query_arg( 'action', 'save', $form_url );
557
 
558
  // Call an action for plugins to modify the activity before we display the edit form
559
- do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) );
560
- ?>
561
 
562
  <div class="wrap">
563
  <?php screen_icon( 'buddypress-activity' ); ?>
@@ -568,7 +586,7 @@ function bp_activity_admin_edit() {
568
  <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post">
569
  <div id="poststuff">
570
 
571
- <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
572
  <div id="post-body-content">
573
  <div id="postdiv" class="postarea">
574
  <div id="bp_activity_action" class="postbox">
@@ -604,7 +622,7 @@ function bp_activity_admin_edit() {
604
  </form>
605
 
606
  <?php else : ?>
607
- <p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), network_admin_url( 'admin.php?page=bp-activity' ) ); ?></p>
608
  <?php endif; ?>
609
 
610
  </div><!-- .wrap -->
@@ -616,7 +634,7 @@ function bp_activity_admin_edit() {
616
  * Status metabox for the Activity admin edit screen
617
  *
618
  * @param object $item Activity item
619
- * @since 1.6
620
  */
621
  function bp_activity_admin_edit_metabox_status( $item ) {
622
  ?>
@@ -671,7 +689,7 @@ function bp_activity_admin_edit_metabox_status( $item ) {
671
  * Primary link metabox for the Activity admin edit screen
672
  *
673
  * @param object $item Activity item
674
- * @since 1.6
675
  */
676
  function bp_activity_admin_edit_metabox_link( $item ) {
677
  ?>
@@ -687,7 +705,7 @@ function bp_activity_admin_edit_metabox_link( $item ) {
687
  * User ID metabox for the Activity admin edit screen
688
  *
689
  * @param object $item Activity item
690
- * @since 1.6
691
  */
692
  function bp_activity_admin_edit_metabox_userid( $item ) {
693
  ?>
@@ -703,7 +721,7 @@ function bp_activity_admin_edit_metabox_userid( $item ) {
703
  *
704
  * @global object $bp BuddyPress global settings
705
  * @param object $item Activity item
706
- * @since 1.6
707
  */
708
  function bp_activity_admin_edit_metabox_type( $item ) {
709
  global $bp;
@@ -723,8 +741,7 @@ function bp_activity_admin_edit_metabox_type( $item ) {
723
  unset( $actions['friends_register_activity_action'] );
724
 
725
  // Sort array by the human-readable value
726
- natsort( $actions );
727
- ?>
728
 
729
  <select name="bp-activities-type">
730
  <?php foreach ( $actions as $k => $v ) : ?>
@@ -739,7 +756,7 @@ function bp_activity_admin_edit_metabox_type( $item ) {
739
  * Primary item ID/Secondary item ID metabox for the Activity admin edit screen
740
  *
741
  * @param object $item Activity item
742
- * @since 1.6
743
  */
744
  function bp_activity_admin_edit_metabox_itemids( $item ) {
745
  ?>
@@ -761,7 +778,7 @@ function bp_activity_admin_edit_metabox_itemids( $item ) {
761
  *
762
  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
763
  * @global string $plugin_page
764
- * @since 1.6
765
  */
766
  function bp_activity_admin_index() {
767
  global $bp_activity_list_table, $plugin_page;
@@ -780,15 +797,16 @@ function bp_activity_admin_index() {
780
 
781
  // Make sure we don't get any empty values in $errors
782
  for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) {
783
- if ( 0 === $errors[$i] )
784
  unset( $errors[$i] );
 
785
  }
786
 
787
  // Reindex array
788
  $errors = array_values( $errors );
789
 
790
  if ( $deleted > 0 )
791
- $messages[] = sprintf( _n( '%s activity has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
792
 
793
  if ( ! empty( $errors ) ) {
794
  if ( 1 == count( $errors ) ) {
@@ -810,21 +828,20 @@ function bp_activity_admin_index() {
810
  }
811
 
812
  if ( $spammed > 0 )
813
- $messages[] = sprintf( _n( '%s activity has been successfully spammed.', '%s activity items have been successfully spammed.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) );
814
 
815
  if ( $unspammed > 0 )
816
- $messages[] = sprintf( _n( '%s activity has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
817
 
818
  if ( $updated > 0 )
819
- $messages[] = __( 'The activity has been updated succesfully.', 'buddypress' );
820
  }
821
 
822
  // Prepare the activity items for display
823
  $bp_activity_list_table->prepare_items();
824
 
825
  // Call an action for plugins to modify the activity before we display the edit form
826
- do_action( 'bp_activity_admin_index', $messages );
827
- ?>
828
 
829
  <div class="wrap">
830
  <?php screen_icon( 'buddypress-activity' ); ?>
@@ -867,7 +884,7 @@ function bp_activity_admin_index() {
867
  <a href="#" class="cancel button-secondary alignleft"><?php _e( 'Cancel', 'buddypress' ); ?></a>
868
  <a href="#" class="save button-primary alignright"><?php _e( 'Reply', 'buddypress' ); ?></a>
869
 
870
- <img class="waiting" style="display:none;" src="<?php echo esc_url( network_admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
871
  <span class="error" style="display:none;"></span>
872
  <br class="clear" />
873
  </p>
@@ -886,34 +903,35 @@ function bp_activity_admin_index() {
886
  /**
887
  * List table class for the Activity component admin page.
888
  *
889
- * @since 1.6
890
  */
891
  class BP_Activity_List_Table extends WP_List_Table {
 
892
  /**
893
  * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"...
894
  *
895
- * @since 1.6
896
  */
897
  public $view = 'all';
898
 
899
  /**
900
  * How many activity items have been marked as spam.
901
  *
902
- * @since 1.6
903
  */
904
  public $spam_count = 0;
905
 
906
  /**
907
  * Store activity-to-user-ID mappings for use in the In Response To column.
908
  *
909
- * @since 1.6
910
  */
911
  protected $activity_user_id = array();
912
 
913
  /**
914
  * Constructor
915
  *
916
- * @since 1.6
917
  */
918
  public function __construct() {
919
 
@@ -928,7 +946,7 @@ class BP_Activity_List_Table extends WP_List_Table {
928
  /**
929
  * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering.
930
  *
931
- * @since 1.6
932
  */
933
  function prepare_items() {
934
  $screen = get_current_screen();
@@ -1030,7 +1048,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1030
  * Get an array of all the columns on the page
1031
  *
1032
  * @return array
1033
- * @since 1.6
1034
  */
1035
  function get_column_info() {
1036
  $this->_column_headers = array(
@@ -1045,7 +1063,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1045
  /**
1046
  * Displays a message on screen when no items are found (e.g. no search matches)
1047
  *
1048
- * @since 1.6
1049
  */
1050
  function no_items() {
1051
  _e( 'No activities found.', 'buddypress' );
@@ -1054,13 +1072,12 @@ class BP_Activity_List_Table extends WP_List_Table {
1054
  /**
1055
  * Outputs the Activity data table
1056
  *
1057
- * @since 1.6
1058
  */
1059
  function display() {
1060
  extract( $this->_args );
1061
 
1062
- $this->display_tablenav( 'top' );
1063
- ?>
1064
 
1065
  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
1066
  <thead>
@@ -1088,11 +1105,16 @@ class BP_Activity_List_Table extends WP_List_Table {
1088
  * Generates content for a single row of the table
1089
  *
1090
  * @param object $item The current item
1091
- * @since 1.6
1092
  */
1093
  function single_row( $item ) {
1094
  static $row_class = '';
1095
- $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
 
 
 
 
 
1096
 
1097
  echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['item_id'] ) . '">';
1098
  echo $this->single_row_columns( $item );
@@ -1102,7 +1124,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1102
  /**
1103
  * Get the list of views available on this table (e.g. "all", "spam").
1104
  *
1105
- * @since 1.6
1106
  */
1107
  function get_views() {
1108
  $redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'error', 'spammed', 'unspammed', 'updated', ), $_SERVER['REQUEST_URI'] );
@@ -1120,7 +1142,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1120
  * Get bulk actions
1121
  *
1122
  * @return array Key/value pairs for the bulk actions dropdown
1123
- * @since 1.6
1124
  */
1125
  function get_bulk_actions() {
1126
  $actions = array();
@@ -1136,7 +1158,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1136
  *
1137
  * @see WP_List_Table::single_row_columns()
1138
  * @return array
1139
- * @since 1.6
1140
  */
1141
  function get_columns() {
1142
  return array(
@@ -1151,7 +1173,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1151
  * Get the column names for sortable columns
1152
  *
1153
  * @return array
1154
- * @since 1.6
1155
  * @todo For this to work, BP_Activity_Activity::get() needs updating to supporting ordering by specific fields
1156
  */
1157
  function get_sortable_columns() {
@@ -1165,34 +1187,17 @@ class BP_Activity_List_Table extends WP_List_Table {
1165
  /**
1166
  * Markup for the "filter" part of the form (i.e. which activity type to display)
1167
  *
1168
- * @global object $bp BuddyPress global settings
1169
  * @param string $which 'top' or 'bottom'
1170
- * @since 1.6
1171
  */
1172
  function extra_tablenav( $which ) {
1173
- global $bp;
1174
-
1175
  if ( 'bottom' == $which )
1176
  return;
1177
 
1178
- $actions = array();
1179
  $selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : '';
1180
 
1181
- // Walk through the registered actions, and build an array of actions/values.
1182
- foreach ( $bp->activity->actions as $action ) {
1183
- $action = array_values( (array) $action );
1184
-
1185
- for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
1186
- $actions[ $action[$i]['key'] ] = $action[$i]['value'];
1187
- }
1188
-
1189
- // This was a mis-named activity type from before BP 1.6
1190
- unset( $actions['friends_register_activity_action'] );
1191
-
1192
- // This type has not been used since BP 1.0.3. It will be re-instated in a future version.
1193
- unset( $actions['updated_profile'] );
1194
-
1195
- // Sort array by the human-readable value
1196
  natsort( $actions );
1197
  ?>
1198
 
@@ -1216,7 +1221,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1216
  *
1217
  * @param array $item A singular item (one full row)
1218
  * @see WP_List_Table::single_row_columns()
1219
- * @since 1.6
1220
  */
1221
  function column_cb( $item ) {
1222
  printf( '<input type="checkbox" name="aid[]" value="%d" />', (int) $item['id'] );
@@ -1227,7 +1232,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1227
  *
1228
  * @param array $item A singular item (one full row)
1229
  * @see WP_List_Table::single_row_columns()
1230
- * @since 1.6
1231
  */
1232
  function column_author( $item ) {
1233
  echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>';
@@ -1240,7 +1245,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1240
  *
1241
  * @param array $item A singular item (one full row)
1242
  * @see WP_List_Table::single_row_columns()
1243
- * @since 1.6
1244
  */
1245
  function column_comment( $item ) {
1246
  // Determine what type of item (row) we're dealing with
@@ -1258,7 +1263,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1258
  );
1259
 
1260
  // Build actions URLs
1261
- $base_url = network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
1262
  $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) );
1263
 
1264
  $delete_url = $base_url . "&amp;action=delete&amp;$spam_nonce";
@@ -1298,10 +1303,11 @@ class BP_Activity_List_Table extends WP_List_Table {
1298
  echo '</div>';
1299
 
1300
  // Get activity content - if not set, use the action
1301
- if ( ! empty( $item['content'] ) )
1302
  $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
1303
- else
1304
  $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
 
1305
 
1306
  echo $content . ' ' . $this->row_actions( $actions );
1307
  }
@@ -1311,18 +1317,18 @@ class BP_Activity_List_Table extends WP_List_Table {
1311
  *
1312
  * @param array $item A singular item (one full row)
1313
  * @see WP_List_Table::single_row_columns()
1314
- * @since 1.6
1315
  */
1316
  function column_response( $item ) {
1317
  // Is $item is a root activity?
1318
  if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) {
1319
  $comment_count = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0;
1320
- $root_activity_url = network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
1321
 
1322
  // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble
1323
  if ( $comment_count ) {
1324
  $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) );
1325
- printf( '<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', esc_attr( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
1326
  }
1327
 
1328
  // For non-root activities, display a link to the replied-to activity's author's profile
@@ -1339,7 +1345,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1339
  * A wrapper function for the BP_Activity_List_Table to get the specified activity's user ID.
1340
  *
1341
  * @param int $activity_id Activity ID to retrieve User ID for
1342
- * @since 1.6
1343
  */
1344
  protected function get_activity_user_id( $activity_id ) {
1345
  // If there is an existing activity/user ID mapping, just return the user ID.
@@ -1373,7 +1379,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1373
  *
1374
  * @param array $tree Source array
1375
  * @return array Flattened array
1376
- * @since 1.6
1377
  */
1378
  public static function flatten_activity_array( $tree ){
1379
  foreach ( (array) $tree as $node ) {
@@ -1390,4 +1396,3 @@ class BP_Activity_List_Table extends WP_List_Table {
1390
  return $tree;
1391
  }
1392
  }
1393
- ?>
6
  * on which this implementation is heavily based.
7
  *
8
  * @package BuddyPress
9
+ * @since BuddyPress (1.6)
10
  * @subpackage Activity
11
  */
12
 
23
  /**
24
  * Registers the Activity component admin screen
25
  *
26
+ * @since BuddyPress (1.6)
27
  */
28
  function bp_activity_add_admin_menu() {
29
 
31
  return;
32
 
33
  // Add our screen
34
+ $hook = add_menu_page(
35
+ __( 'Activity', 'buddypress' ),
36
+ __( 'Activity', 'buddypress' ),
37
+ 'manage_options',
38
+ 'bp-activity',
39
+ 'bp_activity_admin',
40
+ 'div'
41
+ );
42
 
43
  // Hook into early actions to load custom CSS and our init handler.
44
  add_action( "load-$hook", 'bp_activity_admin_load' );
45
  }
46
  add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' );
47
 
48
+ /**
49
+ * Add activity component to custom menus array
50
+ *
51
+ * @since BuddyPress (1.7)
52
+ *
53
+ * @param array $custom_menus
54
+ * @return array
55
+ */
56
+ function bp_activity_admin_menu_order( $custom_menus = array() ) {
57
+ array_push( $custom_menus, 'bp-activity' );
58
+ return $custom_menus;
59
+ }
60
+ add_filter( 'bp_admin_menu_order', 'bp_activity_admin_menu_order' );
61
+
62
  /**
63
  * AJAX receiver for Activity replies via the admin screen. Adds a new activity
64
  * comment, and returns HTML for a new table row.
65
  *
66
+ * @since BuddyPress (1.6)
67
  */
68
  function bp_activity_admin_reply() {
69
  // Check nonce
137
  * @param string $option Screen option name
138
  * @param string $new_value Screen option form value
139
  * @return string Option value. False to abandon update.
140
+ * @since BuddyPress (1.6)
141
  */
142
  function bp_activity_admin_screen_options( $value, $option, $new_value ) {
143
  if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
156
  *
157
  * @param WP_Screen $screen Screen identifier
158
  * @return array Hidden Meta Boxes
159
+ * @since BuddyPress (1.0)
160
  */
161
  function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
162
  if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id )
174
  *
175
  * @global object $bp BuddyPress global settings
176
  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
177
+ * @since BuddyPress (1.6)
178
  */
179
  function bp_activity_admin_load() {
180
  global $bp, $bp_activity_list_table;
181
 
182
  // Decide whether to load the dev version of the CSS and JavaScript
183
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : 'min.';
184
 
185
+ $doaction = bp_admin_list_table_current_bulk_action();
 
186
 
187
  // Call an action for plugins to hook in early
188
  do_action( 'bp_activity_admin_load', $doaction );
264
  }
265
 
266
  // Enqueue CSS and JavaScript
267
+ wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
268
+ wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() );
269
 
270
  // Handle spam/un-spam/delete of activities
271
  if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
523
  /**
524
  * Outputs the Activity component admin screens
525
  *
526
+ * @since BuddyPress (1.6)
527
  */
528
  function bp_activity_admin() {
529
  // Decide whether to load the index or edit screen
542
  * Display the single activity edit screen
543
  *
544
  * @global int $screen_layout_columns Number of columns shown on this admin page
545
+ * @since BuddyPress (1.6)
546
  */
547
  function bp_activity_admin_edit() {
 
548
 
549
  // @todo: Check if user is allowed to edit activity items
550
  // if ( ! current_user_can( 'bp_edit_activity' ) )
575
  $form_url = add_query_arg( 'action', 'save', $form_url );
576
 
577
  // Call an action for plugins to modify the activity before we display the edit form
578
+ do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
 
579
 
580
  <div class="wrap">
581
  <?php screen_icon( 'buddypress-activity' ); ?>
586
  <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post">
587
  <div id="poststuff">
588
 
589
+ <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
590
  <div id="post-body-content">
591
  <div id="postdiv" class="postarea">
592
  <div id="bp_activity_action" class="postbox">
622
  </form>
623
 
624
  <?php else : ?>
625
+ <p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ) ); ?></p>
626
  <?php endif; ?>
627
 
628
  </div><!-- .wrap -->
634
  * Status metabox for the Activity admin edit screen
635
  *
636
  * @param object $item Activity item
637
+ * @since BuddyPress (1.6)
638
  */
639
  function bp_activity_admin_edit_metabox_status( $item ) {
640
  ?>
689
  * Primary link metabox for the Activity admin edit screen
690
  *
691
  * @param object $item Activity item
692
+ * @since BuddyPress (1.6)
693
  */
694
  function bp_activity_admin_edit_metabox_link( $item ) {
695
  ?>
705
  * User ID metabox for the Activity admin edit screen
706
  *
707
  * @param object $item Activity item
708
+ * @since BuddyPress (1.6)
709
  */
710
  function bp_activity_admin_edit_metabox_userid( $item ) {
711
  ?>
721
  *
722
  * @global object $bp BuddyPress global settings
723
  * @param object $item Activity item
724
+ * @since BuddyPress (1.6)
725
  */
726
  function bp_activity_admin_edit_metabox_type( $item ) {
727
  global $bp;
741
  unset( $actions['friends_register_activity_action'] );
742
 
743
  // Sort array by the human-readable value
744
+ natsort( $actions ); ?>
 
745
 
746
  <select name="bp-activities-type">
747
  <?php foreach ( $actions as $k => $v ) : ?>
756
  * Primary item ID/Secondary item ID metabox for the Activity admin edit screen
757
  *
758
  * @param object $item Activity item
759
+ * @since BuddyPress (1.6)
760
  */
761
  function bp_activity_admin_edit_metabox_itemids( $item ) {
762
  ?>
778
  *
779
  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
780
  * @global string $plugin_page
781
+ * @since BuddyPress (1.6)
782
  */
783
  function bp_activity_admin_index() {
784
  global $bp_activity_list_table, $plugin_page;
797
 
798
  // Make sure we don't get any empty values in $errors
799
  for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) {
800
+ if ( 0 === $errors[$i] ) {
801
  unset( $errors[$i] );
802
+ }
803
  }
804
 
805
  // Reindex array
806
  $errors = array_values( $errors );
807
 
808
  if ( $deleted > 0 )
809
+ $messages[] = sprintf( _n( '%s activity item has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
810
 
811
  if ( ! empty( $errors ) ) {
812
  if ( 1 == count( $errors ) ) {
828
  }
829
 
830
  if ( $spammed > 0 )
831
+ $messages[] = sprintf( _n( '%s activity item has been successfully spammed.', '%s activity items have been successfully spammed.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) );
832
 
833
  if ( $unspammed > 0 )
834
+ $messages[] = sprintf( _n( '%s activity item has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
835
 
836
  if ( $updated > 0 )
837
+ $messages[] = __( 'The activity item has been updated succesfully.', 'buddypress' );
838
  }
839
 
840
  // Prepare the activity items for display
841
  $bp_activity_list_table->prepare_items();
842
 
843
  // Call an action for plugins to modify the activity before we display the edit form
844
+ do_action( 'bp_activity_admin_index', $messages ); ?>
 
845
 
846
  <div class="wrap">
847
  <?php screen_icon( 'buddypress-activity' ); ?>
884
  <a href="#" class="cancel button-secondary alignleft"><?php _e( 'Cancel', 'buddypress' ); ?></a>
885
  <a href="#" class="save button-primary alignright"><?php _e( 'Reply', 'buddypress' ); ?></a>
886
 
887
+ <img class="waiting" style="display:none;" src="<?php echo esc_url( bp_get_admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
888
  <span class="error" style="display:none;"></span>
889
  <br class="clear" />
890
  </p>
903
  /**
904
  * List table class for the Activity component admin page.
905
  *
906
+ * @since BuddyPress (1.6)
907
  */
908
  class BP_Activity_List_Table extends WP_List_Table {
909
+
910
  /**
911
  * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"...
912
  *
913
+ * @since BuddyPress (1.6)
914
  */
915
  public $view = 'all';
916
 
917
  /**
918
  * How many activity items have been marked as spam.
919
  *
920
+ * @since BuddyPress (1.6)
921
  */
922
  public $spam_count = 0;
923
 
924
  /**
925
  * Store activity-to-user-ID mappings for use in the In Response To column.
926
  *
927
+ * @since BuddyPress (1.6)
928
  */
929
  protected $activity_user_id = array();
930
 
931
  /**
932
  * Constructor
933
  *
934
+ * @since BuddyPress (1.6)
935
  */
936
  public function __construct() {
937
 
946
  /**
947
  * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering.
948
  *
949
+ * @since BuddyPress (1.6)
950
  */
951
  function prepare_items() {
952
  $screen = get_current_screen();
1048
  * Get an array of all the columns on the page
1049
  *
1050
  * @return array
1051
+ * @since BuddyPress (1.6)
1052
  */
1053
  function get_column_info() {
1054
  $this->_column_headers = array(
1063
  /**
1064
  * Displays a message on screen when no items are found (e.g. no search matches)
1065
  *
1066
+ * @since BuddyPress (1.6)
1067
  */
1068
  function no_items() {
1069
  _e( 'No activities found.', 'buddypress' );
1072
  /**
1073
  * Outputs the Activity data table
1074
  *
1075
+ * @since BuddyPress (1.6)
1076
  */
1077
  function display() {
1078
  extract( $this->_args );
1079
 
1080
+ $this->display_tablenav( 'top' ); ?>
 
1081
 
1082
  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
1083
  <thead>
1105
  * Generates content for a single row of the table
1106
  *
1107
  * @param object $item The current item
1108
+ * @since BuddyPress (1.6)
1109
  */
1110
  function single_row( $item ) {
1111
  static $row_class = '';
1112
+
1113
+ if ( empty( $row_class ) ) {
1114
+ $row_class = ' class="alternate"';
1115
+ } else {
1116
+ $row_class = '';
1117
+ }
1118
 
1119
  echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['item_id'] ) . '">';
1120
  echo $this->single_row_columns( $item );
1124
  /**
1125
  * Get the list of views available on this table (e.g. "all", "spam").
1126
  *
1127
+ * @since BuddyPress (1.6)
1128
  */
1129
  function get_views() {
1130
  $redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'error', 'spammed', 'unspammed', 'updated', ), $_SERVER['REQUEST_URI'] );
1142
  * Get bulk actions
1143
  *
1144
  * @return array Key/value pairs for the bulk actions dropdown
1145
+ * @since BuddyPress (1.6)
1146
  */
1147
  function get_bulk_actions() {
1148
  $actions = array();
1158
  *
1159
  * @see WP_List_Table::single_row_columns()
1160
  * @return array
1161
+ * @since BuddyPress (1.6)
1162
  */
1163
  function get_columns() {
1164
  return array(
1173
  * Get the column names for sortable columns
1174
  *
1175
  * @return array
1176
+ * @since BuddyPress (1.6)
1177
  * @todo For this to work, BP_Activity_Activity::get() needs updating to supporting ordering by specific fields
1178
  */
1179
  function get_sortable_columns() {
1187
  /**
1188
  * Markup for the "filter" part of the form (i.e. which activity type to display)
1189
  *
 
1190
  * @param string $which 'top' or 'bottom'
1191
+ * @since BuddyPress (1.6)
1192
  */
1193
  function extra_tablenav( $which ) {
 
 
1194
  if ( 'bottom' == $which )
1195
  return;
1196
 
 
1197
  $selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : '';
1198
 
1199
+ // Get all types of activities, and sort alphabetically.
1200
+ $actions = bp_activity_get_types();
 
 
 
 
 
 
 
 
 
 
 
 
 
1201
  natsort( $actions );
1202
  ?>
1203
 
1221
  *
1222
  * @param array $item A singular item (one full row)
1223
  * @see WP_List_Table::single_row_columns()
1224
+ * @since BuddyPress (1.6)
1225
  */
1226
  function column_cb( $item ) {
1227
  printf( '<input type="checkbox" name="aid[]" value="%d" />', (int) $item['id'] );
1232
  *
1233
  * @param array $item A singular item (one full row)
1234
  * @see WP_List_Table::single_row_columns()
1235
+ * @since BuddyPress (1.6)
1236
  */
1237
  function column_author( $item ) {
1238
  echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>';
1245
  *
1246
  * @param array $item A singular item (one full row)
1247
  * @see WP_List_Table::single_row_columns()
1248
+ * @since BuddyPress (1.6)
1249
  */
1250
  function column_comment( $item ) {
1251
  // Determine what type of item (row) we're dealing with
1263
  );
1264
 
1265
  // Build actions URLs
1266
+ $base_url = bp_get_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
1267
  $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) );
1268
 
1269
  $delete_url = $base_url . "&amp;action=delete&amp;$spam_nonce";
1303
  echo '</div>';
1304
 
1305
  // Get activity content - if not set, use the action
1306
+ if ( ! empty( $item['content'] ) ) {
1307
  $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
1308
+ } else {
1309
  $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
1310
+ }
1311
 
1312
  echo $content . ' ' . $this->row_actions( $actions );
1313
  }
1317
  *
1318
  * @param array $item A singular item (one full row)
1319
  * @see WP_List_Table::single_row_columns()
1320
+ * @since BuddyPress (1.6)
1321
  */
1322
  function column_response( $item ) {
1323
  // Is $item is a root activity?
1324
  if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) {
1325
  $comment_count = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0;
1326
+ $root_activity_url = bp_get_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
1327
 
1328
  // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble
1329
  if ( $comment_count ) {
1330
  $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) );
1331
+ printf( '<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', esc_url( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
1332
  }
1333
 
1334
  // For non-root activities, display a link to the replied-to activity's author's profile
1345
  * A wrapper function for the BP_Activity_List_Table to get the specified activity's user ID.
1346
  *
1347
  * @param int $activity_id Activity ID to retrieve User ID for
1348
+ * @since BuddyPress (1.6)
1349
  */
1350
  protected function get_activity_user_id( $activity_id ) {
1351
  // If there is an existing activity/user ID mapping, just return the user ID.
1379
  *
1380
  * @param array $tree Source array
1381
  * @return array Flattened array
1382
+ * @since BuddyPress (1.6)
1383
  */
1384
  public static function flatten_activity_array( $tree ){
1385
  foreach ( (array) $tree as $node ) {
1396
  return $tree;
1397
  }
1398
  }
 
bp-activity/bp-activity-akismet.php CHANGED
@@ -3,7 +3,7 @@
3
  * Akismet support for BuddyPress' Activity Stream
4
  *
5
  * @package BuddyPress
6
- * @since 1.6
7
  * @subpackage Activity
8
  */
9
 
@@ -16,14 +16,14 @@ class BP_Akismet {
16
  *
17
  * @access protected
18
  * @var BP_Activity_Activity
19
- * @since 1.6
20
  */
21
  protected $last_activity = null;
22
 
23
  /**
24
  * Constructor
25
  *
26
- * @since 1.6
27
  */
28
  public function __construct() {
29
  $this->setup_actions();
@@ -32,7 +32,7 @@ class BP_Akismet {
32
  /**
33
  * Hook Akismet into the activity stream
34
  *
35
- * @since 1.6
36
  */
37
  protected function setup_actions() {
38
  // Add nonces to activity stream lists
@@ -67,7 +67,7 @@ class BP_Akismet {
67
  * @param array $actions The hover links
68
  * @param array $activity The activity for the current row being processed
69
  * @return array The hover links
70
- * @since 1.6
71
  */
72
  function comment_row_action( $actions, $activity ) {
73
  $akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' );
@@ -97,14 +97,14 @@ class BP_Akismet {
97
  foreach ( $actions as $k => $item ) {
98
  $b[ $k ] = $item;
99
  if ( $k == 'edit' )
100
- $b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>';
101
  }
102
 
103
  $actions = $b;
104
  }
105
 
106
  if ( $desc )
107
- echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';
108
 
109
  return apply_filters( 'bp_akismet_comment_row_action', $actions );
110
  }
@@ -114,10 +114,10 @@ class BP_Akismet {
114
  * This is used by Akismet to help detect spam activity.
115
  *
116
  * @see http://plugins.trac.wordpress.org/ticket/1232
117
- * @since 1.6
118
  */
119
  public function add_activity_stream_nonce() {
120
- $form_id = '_bp_as_nonce';
121
  $value = '_bp_as_nonce_' . bp_loggedin_user_id();
122
 
123
  // If we're in the activity stream loop, we can use the current item's ID to make the nonce unique
@@ -138,7 +138,7 @@ class BP_Akismet {
138
  * @param int $user_id User ID
139
  * @param int $activity_id Activity ID
140
  * @see bp_dtheme_post_update()
141
- * @since 1.6
142
  */
143
  public function check_member_activity_update( $content, $user_id, $activity_id ) {
144
  // By default, only handle activity updates and activity comments.
@@ -158,7 +158,7 @@ class BP_Akismet {
158
  *
159
  * This function is intended to be used inside the activity stream loop.
160
  *
161
- * @since 1.6
162
  */
163
  public function add_activity_spam_button() {
164
  if ( !bp_activity_user_can_mark_spam() )
@@ -186,7 +186,7 @@ class BP_Akismet {
186
  *
187
  * This function is intended to be used inside the activity stream loop.
188
  *
189
- * @since 1.6
190
  */
191
  public function add_activity_comment_spam_button() {
192
  if ( !bp_activity_user_can_mark_spam() )
@@ -214,7 +214,7 @@ class BP_Akismet {
214
  * Get a list of filterable types of activity item that we want Akismet to automatically check for spam.
215
  *
216
  * @return array List of activity types
217
- * @since 1.6
218
  * @static
219
  */
220
  public static function get_activity_types() {
@@ -226,7 +226,7 @@ class BP_Akismet {
226
  *
227
  * @param BP_Activity_Activity $activity
228
  * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed).
229
- * @since 1.6
230
  */
231
  public function mark_as_spam( $activity, $source ) {
232
  // Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update()
@@ -240,7 +240,7 @@ class BP_Akismet {
240
  *
241
  * @param BP_Activity_Activity $activity
242
  * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).
243
- * @since 1.6
244
  */
245
  public function mark_as_ham( $activity, $source ) {
246
  // If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
@@ -248,14 +248,14 @@ class BP_Akismet {
248
  $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
249
 
250
  do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
251
- }
252
 
253
  /**
254
  * Build a data package for the Akismet service to inspect
255
  *
256
  * @param BP_Activity_Activity $activity
257
  * @see http://akismet.com/development/api/#comment-check
258
- * @since 1.6
259
  * @static
260
  */
261
  public static function build_akismet_data_package( $activity ) {
@@ -294,7 +294,7 @@ class BP_Akismet {
294
  *
295
  * @param BP_Activity_Activity $activity The activity item to check
296
  * @see http://akismet.com/development/api/
297
- * @since 1.6
298
  * @todo Spam counter?
299
  * @todo Auto-delete old spam?
300
  */
@@ -335,7 +335,7 @@ class BP_Akismet {
335
  * Update activity meta after a manual spam change (user initiated)
336
  *
337
  * @param BP_Activity_Activity $activity The activity to check
338
- * @since 1.6
339
  */
340
  public function update_activity_spam_meta( $activity ) {
341
  // By default, only handle activity updates and activity comments.
@@ -351,7 +351,7 @@ class BP_Akismet {
351
  * Update activity meta after a manual ham change (user initiated)
352
  *
353
  * @param BP_Activity_Activity $activity The activity to check
354
- * @since 1.6
355
  */
356
  public function update_activity_ham_meta( $activity ) {
357
  // By default, only handle activity updates and activity comments.
@@ -367,7 +367,7 @@ class BP_Akismet {
367
  * Update activity meta after an automatic spam check (not user initiated)
368
  *
369
  * @param BP_Activity_Activity $activity The activity to check
370
- * @since 1.6
371
  */
372
  public function update_activity_akismet_meta( $activity ) {
373
  // Check we're dealing with what was last updated by Akismet
@@ -408,7 +408,7 @@ class BP_Akismet {
408
  * @param array $activity_data Packet of information to submit to Akismet
409
  * @param string $check "check" or "submit"
410
  * @param string $spam "spam" or "ham"
411
- * @since 1.6
412
  */
413
  public function send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' ) {
414
  global $akismet_api_host, $akismet_api_port;
@@ -480,7 +480,7 @@ class BP_Akismet {
480
  * Filters user agent when sending to Akismet.
481
  *
482
  * @param string $user_agent
483
- * @since 1.6
484
  */
485
  public function buddypress_ua( $user_agent ) {
486
  $user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' );
@@ -491,7 +491,7 @@ class BP_Akismet {
491
  * Adds a "History" meta box to the activity edit screen.
492
  *
493
  * @param string $screen_action The type of screen that has been requested
494
- * @since 1.6
495
  */
496
  function add_history_metabox( $screen_action ) {
497
  // Only proceed if we're on the edit screen
@@ -506,7 +506,7 @@ class BP_Akismet {
506
  * History meta box for the Activity admin edit screen
507
  *
508
  * @param object $item Activity item
509
- * @since 1.6
510
  * @todo Update activity meta to allow >1 record with the same key (iterate through $history).
511
  * @see http://buddypress.trac.wordpress.org/ticket/3907
512
  */
@@ -527,7 +527,7 @@ class BP_Akismet {
527
  * @param int $activity_id Activity item ID
528
  * @param string $message Human-readable description of what's changed
529
  * @param string $event The type of check we were carrying out
530
- * @since 1.6
531
  */
532
  public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) {
533
  $event = array(
@@ -546,7 +546,7 @@ class BP_Akismet {
546
  *
547
  * @param int $activity_id Activity item ID
548
  * @return array The activity item's Akismet history
549
- * @since 1.6
550
  */
551
  public function get_activity_history( $activity_id = 0 ) {
552
  $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' );
@@ -565,7 +565,7 @@ class BP_Akismet {
565
  *
566
  * @global object $bp BuddyPress global settings
567
  * @global wpdb $wpdb WordPress database object
568
- * @since 1.6
569
  */
570
  function bp_activity_akismet_delete_old_metadata() {
571
  global $bp, $wpdb;
@@ -575,7 +575,7 @@ function bp_activity_akismet_delete_old_metadata() {
575
  // Enforce a minimum of 1 day
576
  $interval = max( 1, absint( $interval ) );
577
 
578
- // _bp_akismet_submission meta values are large, so expire them after $interval days regardless of the activity status
579
  $sql = $wpdb->prepare( "SELECT a.id FROM {$bp->activity->table_name} a LEFT JOIN {$bp->activity->table_name_meta} m ON a.id = m.activity_id WHERE m.meta_key = %s AND DATE_SUB(%s, INTERVAL {$interval} DAY) > a.date_recorded LIMIT 10000", '_bp_akismet_submission', current_time( 'mysql', 1 ) );
580
  $activity_ids = $wpdb->get_col( $sql );
581
 
@@ -584,4 +584,4 @@ function bp_activity_akismet_delete_old_metadata() {
584
  bp_activity_delete_meta( $activity_id, '_bp_akismet_submission' );
585
  }
586
  }
587
- ?>
3
  * Akismet support for BuddyPress' Activity Stream
4
  *
5
  * @package BuddyPress
6
+ * @since BuddyPress (1.6)
7
  * @subpackage Activity
8
  */
9
 
16
  *
17
  * @access protected
18
  * @var BP_Activity_Activity
19
+ * @since BuddyPress (1.6)
20
  */
21
  protected $last_activity = null;
22
 
23
  /**
24
  * Constructor
25
  *
26
+ * @since BuddyPress (1.6)
27
  */
28
  public function __construct() {
29
  $this->setup_actions();
32
  /**
33
  * Hook Akismet into the activity stream
34
  *
35
+ * @since BuddyPress (1.6)
36
  */
37
  protected function setup_actions() {
38
  // Add nonces to activity stream lists
67
  * @param array $actions The hover links
68
  * @param array $activity The activity for the current row being processed
69
  * @return array The hover links
70
+ * @since BuddyPress (1.6)
71
  */
72
  function comment_row_action( $actions, $activity ) {
73
  $akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' );
97
  foreach ( $actions as $k => $item ) {
98
  $b[ $k ] = $item;
99
  if ( $k == 'edit' )
100
+ $b['history'] = '<a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>';
101
  }
102
 
103
  $actions = $b;
104
  }
105
 
106
  if ( $desc )
107
+ echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';
108
 
109
  return apply_filters( 'bp_akismet_comment_row_action', $actions );
110
  }
114
  * This is used by Akismet to help detect spam activity.
115
  *
116
  * @see http://plugins.trac.wordpress.org/ticket/1232
117
+ * @since BuddyPress (1.6)
118
  */
119
  public function add_activity_stream_nonce() {
120
+ $form_id = '_bp_as_nonce';
121
  $value = '_bp_as_nonce_' . bp_loggedin_user_id();
122
 
123
  // If we're in the activity stream loop, we can use the current item's ID to make the nonce unique
138
  * @param int $user_id User ID
139
  * @param int $activity_id Activity ID
140
  * @see bp_dtheme_post_update()
141
+ * @since BuddyPress (1.6)
142
  */
143
  public function check_member_activity_update( $content, $user_id, $activity_id ) {
144
  // By default, only handle activity updates and activity comments.
158
  *
159
  * This function is intended to be used inside the activity stream loop.
160
  *
161
+ * @since BuddyPress (1.6)
162
  */
163
  public function add_activity_spam_button() {
164
  if ( !bp_activity_user_can_mark_spam() )
186
  *
187
  * This function is intended to be used inside the activity stream loop.
188
  *
189
+ * @since BuddyPress (1.6)
190
  */
191
  public function add_activity_comment_spam_button() {
192
  if ( !bp_activity_user_can_mark_spam() )
214
  * Get a list of filterable types of activity item that we want Akismet to automatically check for spam.
215
  *
216
  * @return array List of activity types
217
+ * @since BuddyPress (1.6)
218
  * @static
219
  */
220
  public static function get_activity_types() {
226
  *
227
  * @param BP_Activity_Activity $activity
228
  * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed).
229
+ * @since BuddyPress (1.6)
230
  */
231
  public function mark_as_spam( $activity, $source ) {
232
  // Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update()
240
  *
241
  * @param BP_Activity_Activity $activity
242
  * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).
243
+ * @since BuddyPress (1.6)
244
  */
245
  public function mark_as_ham( $activity, $source ) {
246
  // If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
248
  $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
249
 
250
  do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
251
+ }
252
 
253
  /**
254
  * Build a data package for the Akismet service to inspect
255
  *
256
  * @param BP_Activity_Activity $activity
257
  * @see http://akismet.com/development/api/#comment-check
258
+ * @since BuddyPress (1.6)
259
  * @static
260
  */
261
  public static function build_akismet_data_package( $activity ) {
294
  *
295
  * @param BP_Activity_Activity $activity The activity item to check
296
  * @see http://akismet.com/development/api/
297
+ * @since BuddyPress (1.6)
298
  * @todo Spam counter?
299
  * @todo Auto-delete old spam?
300
  */
335
  * Update activity meta after a manual spam change (user initiated)
336
  *
337
  * @param BP_Activity_Activity $activity The activity to check
338
+ * @since BuddyPress (1.6)
339
  */
340
  public function update_activity_spam_meta( $activity ) {
341
  // By default, only handle activity updates and activity comments.
351
  * Update activity meta after a manual ham change (user initiated)
352
  *
353
  * @param BP_Activity_Activity $activity The activity to check
354
+ * @since BuddyPress (1.6)
355
  */
356
  public function update_activity_ham_meta( $activity ) {
357
  // By default, only handle activity updates and activity comments.
367
  * Update activity meta after an automatic spam check (not user initiated)
368
  *
369
  * @param BP_Activity_Activity $activity The activity to check
370
+ * @since BuddyPress (1.6)
371
  */
372
  public function update_activity_akismet_meta( $activity ) {
373
  // Check we're dealing with what was last updated by Akismet
408
  * @param array $activity_data Packet of information to submit to Akismet
409
  * @param string $check "check" or "submit"
410
  * @param string $spam "spam" or "ham"
411
+ * @since BuddyPress (1.6)
412
  */
413
  public function send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' ) {
414
  global $akismet_api_host, $akismet_api_port;
480
  * Filters user agent when sending to Akismet.
481
  *
482
  * @param string $user_agent
483
+ * @since BuddyPress (1.6)
484
  */
485
  public function buddypress_ua( $user_agent ) {
486
  $user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' );
491
  * Adds a "History" meta box to the activity edit screen.
492
  *
493
  * @param string $screen_action The type of screen that has been requested
494
+ * @since BuddyPress (1.6)
495
  */
496
  function add_history_metabox( $screen_action ) {
497
  // Only proceed if we're on the edit screen
506
  * History meta box for the Activity admin edit screen
507
  *
508
  * @param object $item Activity item
509
+ * @since BuddyPress (1.6)
510
  * @todo Update activity meta to allow >1 record with the same key (iterate through $history).
511
  * @see http://buddypress.trac.wordpress.org/ticket/3907
512
  */
527
  * @param int $activity_id Activity item ID
528
  * @param string $message Human-readable description of what's changed
529
  * @param string $event The type of check we were carrying out
530
+ * @since BuddyPress (1.6)
531
  */
532
  public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) {
533
  $event = array(
546
  *
547
  * @param int $activity_id Activity item ID
548
  * @return array The activity item's Akismet history
549
+ * @since BuddyPress (1.6)
550
  */
551
  public function get_activity_history( $activity_id = 0 ) {
552
  $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' );
565
  *
566
  * @global object $bp BuddyPress global settings
567
  * @global wpdb $wpdb WordPress database object
568
+ * @since BuddyPress (1.6)
569
  */
570
  function bp_activity_akismet_delete_old_metadata() {
571
  global $bp, $wpdb;
575
  // Enforce a minimum of 1 day
576
  $interval = max( 1, absint( $interval ) );
577
 
578
+ // _bp_akismet_submission meta values are large, so expire them after $interval days regardless of the activity status
579
  $sql = $wpdb->prepare( "SELECT a.id FROM {$bp->activity->table_name} a LEFT JOIN {$bp->activity->table_name_meta} m ON a.id = m.activity_id WHERE m.meta_key = %s AND DATE_SUB(%s, INTERVAL {$interval} DAY) > a.date_recorded LIMIT 10000", '_bp_akismet_submission', current_time( 'mysql', 1 ) );
580
  $activity_ids = $wpdb->get_col( $sql );
581
 
584
  bp_activity_delete_meta( $activity_id, '_bp_akismet_submission' );
585
  }
586
  }
587
+ add_action( 'bp_activity_akismet_delete_old_metadata', 'bp_activity_akismet_delete_old_metadata' );
bp-activity/bp-activity-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Functions related to the BuddyPress Activity component and the WP Cache
5
  *
6
- * @since 1.6
7
  */
8
 
9
  // Exit if accessed directly
@@ -35,5 +35,3 @@ function bp_activity_update_meta_cache( $activity_ids = false ) {
35
 
36
  bp_update_meta_cache( $cache_args );
37
  }
38
-
39
- ?>
3
  /**
4
  * Functions related to the BuddyPress Activity component and the WP Cache
5
  *
6
+ * @since BuddyPress (1.6)
7
  */
8
 
9
  // Exit if accessed directly
35
 
36
  bp_update_meta_cache( $cache_args );
37
  }
 
 
bp-activity/bp-activity-classes.php CHANGED
@@ -50,13 +50,13 @@ class BP_Activity_Activity {
50
  $this->mptt_left = $row->mptt_left;
51
  $this->mptt_right = $row->mptt_right;
52
  $this->is_spam = $row->is_spam;
53
-
54
  bp_activity_update_meta_cache( $this->id );
55
  }
56
  }
57
 
58
  function save() {
59
- global $wpdb, $bp;
60
 
61
  $this->id = apply_filters_ref_array( 'bp_activity_id_before_save', array( $this->id, &$this ) );
62
  $this->item_id = apply_filters_ref_array( 'bp_activity_item_id_before_save', array( $this->item_id, &$this ) );
@@ -83,23 +83,21 @@ class BP_Activity_Activity {
83
  $this->primary_link = bp_loggedin_user_domain();
84
 
85
  // If we have an existing ID, update the activity item, otherwise insert it.
86
- if ( $this->id ) {
87
  $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id );
88
- } else {
89
  $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam );
90
- }
91
 
92
  if ( false === $wpdb->query( $q ) )
93
  return false;
94
 
95
  // If this is a new activity item, set the $id property
96
- if ( empty( $this->id ) ) {
97
  $this->id = $wpdb->insert_id;
98
 
99
  // If an existing activity item, prevent any changes to the content generating new @mention notifications.
100
- } else {
101
  add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
102
- }
103
 
104
  do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
105
 
@@ -209,7 +207,7 @@ class BP_Activity_Activity {
209
 
210
  // Define the preferred order for indexes
211
  $indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
212
-
213
  foreach( $indexes as $key => $index ) {
214
  if ( false !== strpos( $where_sql, $index ) ) {
215
  $the_index = $index;
@@ -263,13 +261,13 @@ class BP_Activity_Activity {
263
  }
264
  }
265
  }
266
-
267
  // Get activity meta
268
  $activity_ids = array();
269
  foreach ( (array) $activities as $activity ) {
270
  $activity_ids[] = $activity->id;
271
  }
272
-
273
  if ( !empty( $activity_ids ) ) {
274
  bp_activity_update_meta_cache( $activity_ids );
275
  }
@@ -299,7 +297,7 @@ class BP_Activity_Activity {
299
  * @param string MySQL column sort; ASC or DESC. (Optional; default is DESC)
300
  * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false)
301
  * @return array
302
- * @since 1.2
303
  */
304
  function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
305
  _deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' );
@@ -447,20 +445,20 @@ class BP_Activity_Activity {
447
  * @param array $activities
448
  * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'.
449
  * @return array The updated activities with nested comments
450
- * @since 1.2
451
  */
452
  function append_comments( $activities, $spam = 'ham_only' ) {
453
  global $wpdb;
454
 
455
  $activity_comments = array();
456
 
457
- /* Now fetch the activity comments and parse them into the correct position in the activities array. */
458
  foreach( (array) $activities as $activity ) {
459
- if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right )
460
- $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam );
461
  }
462
 
463
- /* Merge the comments with the activity items */
464
  foreach( (array) $activities as $key => $activity )
465
  if ( isset( $activity_comments[$activity->id] ) )
466
  $activities[$key]->children = $activity_comments[$activity->id];
@@ -477,13 +475,19 @@ class BP_Activity_Activity {
477
  * @param int $left Left-most node boundary
478
  * @param into $right Right-most node boundary
479
  * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'.
 
480
  * @return array The updated activities with nested comments
481
- * @since 1.2
482
  */
483
- function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only' ) {
484
  global $wpdb, $bp;
485
 
 
 
 
 
486
  if ( !$comments = wp_cache_get( 'bp_activity_comments_' . $activity_id ) ) {
 
487
  // Select the user's fullname with the query
488
  if ( bp_is_active( 'xprofile' ) ) {
489
  $fullname_select = ", pd.value as user_fullname";
@@ -496,17 +500,20 @@ class BP_Activity_Activity {
496
  }
497
 
498
  // Don't retrieve activity comments marked as spam
499
- if ( 'ham_only' == $spam )
500
  $spam_sql = 'AND a.is_spam = 0';
501
- elseif ( 'spam_only' == $spam )
502
  $spam_sql = 'AND a.is_spam = 1';
503
- else
504
  $spam_sql = '';
 
505
 
506
- $sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' ${spam_sql} AND a.item_id = %d AND a.mptt_left BETWEEN %d AND %d ORDER BY a.date_recorded ASC", $activity_id, $left, $right ), $activity_id, $left, $right, $spam_sql );
 
507
 
508
  // Retrieve all descendants of the $root node
509
  $descendants = $wpdb->get_results( $sql );
 
510
 
511
  // Loop descendants and build an assoc array
512
  foreach ( (array) $descendants as $d ) {
@@ -562,7 +569,7 @@ class BP_Activity_Activity {
562
  function get_recorded_components() {
563
  global $wpdb, $bp;
564
 
565
- return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
566
  }
567
 
568
  function get_sitewide_items_for_feed( $limit = 35 ) {
@@ -671,5 +678,3 @@ class BP_Activity_Activity {
671
  return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
672
  }
673
  }
674
-
675
- ?>
50
  $this->mptt_left = $row->mptt_left;
51
  $this->mptt_right = $row->mptt_right;
52
  $this->is_spam = $row->is_spam;
53
+
54
  bp_activity_update_meta_cache( $this->id );
55
  }
56
  }
57
 
58
  function save() {
59
+ global $wpdb, $bp, $current_user;
60
 
61
  $this->id = apply_filters_ref_array( 'bp_activity_id_before_save', array( $this->id, &$this ) );
62
  $this->item_id = apply_filters_ref_array( 'bp_activity_item_id_before_save', array( $this->item_id, &$this ) );
83
  $this->primary_link = bp_loggedin_user_domain();
84
 
85
  // If we have an existing ID, update the activity item, otherwise insert it.
86
+ if ( $this->id )
87
  $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id );
88
+ else
89
  $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam );
 
90
 
91
  if ( false === $wpdb->query( $q ) )
92
  return false;
93
 
94
  // If this is a new activity item, set the $id property
95
+ if ( empty( $this->id ) )
96
  $this->id = $wpdb->insert_id;
97
 
98
  // If an existing activity item, prevent any changes to the content generating new @mention notifications.
99
+ else
100
  add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
 
101
 
102
  do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
103
 
207
 
208
  // Define the preferred order for indexes
209
  $indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
210
+
211
  foreach( $indexes as $key => $index ) {
212
  if ( false !== strpos( $where_sql, $index ) ) {
213
  $the_index = $index;
261
  }
262
  }
263
  }
264
+
265
  // Get activity meta
266
  $activity_ids = array();
267
  foreach ( (array) $activities as $activity ) {
268
  $activity_ids[] = $activity->id;
269
  }
270
+
271
  if ( !empty( $activity_ids ) ) {
272
  bp_activity_update_meta_cache( $activity_ids );
273
  }
297
  * @param string MySQL column sort; ASC or DESC. (Optional; default is DESC)
298
  * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false)
299
  * @return array
300
+ * @since BuddyPress (1.2)
301
  */
302
  function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
303
  _deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' );
445
  * @param array $activities
446
  * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'.
447
  * @return array The updated activities with nested comments
448
+ * @since BuddyPress (1.2)
449
  */
450
  function append_comments( $activities, $spam = 'ham_only' ) {
451
  global $wpdb;
452
 
453
  $activity_comments = array();
454
 
455
+ // Now fetch the activity comments and parse them into the correct position in the activities array.
456
  foreach( (array) $activities as $activity ) {
457
+ $top_level_parent_id = 'activity_comment' == $activity->type ? $activity->item_id : 0;
458
+ $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam, $top_level_parent_id );
459
  }
460
 
461
+ // Merge the comments with the activity items
462
  foreach( (array) $activities as $key => $activity )
463
  if ( isset( $activity_comments[$activity->id] ) )
464
  $activities[$key]->children = $activity_comments[$activity->id];
475
  * @param int $left Left-most node boundary
476
  * @param into $right Right-most node boundary
477
  * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'.
478
+ * @param int $top_level_parent_id The id of the root-level parent activity item
479
  * @return array The updated activities with nested comments
480
+ * @since BuddyPress (1.2)
481
  */
482
+ function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0 ) {
483
  global $wpdb, $bp;
484
 
485
+ if ( empty( $top_level_parent_id ) ) {
486
+ $top_level_parent_id = $activity_id;
487
+ }
488
+
489
  if ( !$comments = wp_cache_get( 'bp_activity_comments_' . $activity_id ) ) {
490
+
491
  // Select the user's fullname with the query
492
  if ( bp_is_active( 'xprofile' ) ) {
493
  $fullname_select = ", pd.value as user_fullname";
500
  }
501
 
502
  // Don't retrieve activity comments marked as spam
503
+ if ( 'ham_only' == $spam ) {
504
  $spam_sql = 'AND a.is_spam = 0';
505
+ } elseif ( 'spam_only' == $spam ) {
506
  $spam_sql = 'AND a.is_spam = 1';
507
+ } else {
508
  $spam_sql = '';
509
+ }
510
 
511
+ // The mptt BETWEEN clause allows us to limit returned descendants to the right part of the tree
512
+ $sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d AND a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right ), $activity_id, $left, $right, $spam_sql );
513
 
514
  // Retrieve all descendants of the $root node
515
  $descendants = $wpdb->get_results( $sql );
516
+ $ref = array();
517
 
518
  // Loop descendants and build an assoc array
519
  foreach ( (array) $descendants as $d ) {
569
  function get_recorded_components() {
570
  global $wpdb, $bp;
571
 
572
+ return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ) );
573
  }
574
 
575
  function get_sitewide_items_for_feed( $limit = 35 ) {
678
  return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
679
  }
680
  }
 
 
bp-activity/bp-activity-filters.php CHANGED
@@ -89,7 +89,7 @@ add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_
89
  add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );
90
  add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' );
91
  add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' );
92
- add_filter( 'the_content', 'bp_activity_at_name_filter' );
93
 
94
  add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
95
 
@@ -99,7 +99,7 @@ add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
99
  /** Actions *******************************************************************/
100
 
101
  // At-name filter
102
- add_action( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
103
 
104
  // Activity stream moderation
105
  add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
@@ -194,76 +194,103 @@ function bp_activity_filter_kses( $content ) {
194
  }
195
 
196
  /**
197
- * Finds and links @-mentioned users in the contents of activity items
198
  *
199
  * @since BuddyPress (1.2)
200
  *
201
- * @param string $content The activity content
202
- * @param int $activity_id The activity id
203
  *
204
  * @uses bp_activity_find_mentions()
205
- * @uses bp_is_username_compatibility_mode()
206
- * @uses bp_core_get_userid_from_nicename()
207
- * @uses bp_activity_at_message_notification()
208
  * @uses bp_core_get_user_domain()
209
- * @uses bp_activity_adjust_mention_count()
210
  *
211
  * @return string $content Content filtered for mentions
212
  */
213
  function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
214
- if ( $activity_id & bp_is_active( 'activity' ) ) {
215
- $activity = new BP_Activity_Activity( $activity_id );
216
-
217
- // If this activity has been marked as spam, don't do anything. This prevents @notifications being sent.
218
- if ( !empty( $activity ) && $activity->is_spam )
219
- return $content;
220
- }
221
 
 
222
  $usernames = bp_activity_find_mentions( $content );
223
- foreach( (array) $usernames as $username ) {
224
- if ( bp_is_username_compatibility_mode() )
225
- $user_id = username_exists( $username );
226
- else
227
- $user_id = bp_core_get_userid_from_nicename( $username );
228
-
229
- if ( empty( $user_id ) )
230
- continue;
231
-
232
- // If an activity_id is provided, we can send email and BP notifications
233
- if ( $activity_id && apply_filters( 'bp_activity_at_name_do_notifications', true ) ) {
234
- bp_activity_at_message_notification( $activity_id, $user_id );
235
- }
236
 
 
 
 
 
 
 
237
  $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
238
  }
239
 
240
- // Adjust the activity count for this item
241
- if ( $activity_id )
242
- bp_activity_adjust_mention_count( $activity_id, 'add' );
243
-
244
  return $content;
245
  }
246
 
247
  /**
248
- * Catch mentions in saved activity items
 
 
 
249
  *
250
  * @since BuddyPress (1.5)
251
  *
252
  * @param obj $activity
253
  *
254
- * @uses remove_filter() To remove the 'bp_activity_at_name_filter_updates' hook.
255
- * @uses bp_activity_at_name_filter()
256
- * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
257
  */
258
  function bp_activity_at_name_filter_updates( $activity ) {
259
- // Only run this function once for a given activity item
260
- remove_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
 
 
 
 
 
 
 
 
 
 
 
261
 
262
- // Run the content through the linking filter, making sure to increment mention count
263
- $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
264
 
265
- // Resave the activity with the new content
266
- $activity->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  }
268
 
269
  /**
@@ -336,5 +363,3 @@ function bp_activity_truncate_entry( $text ) {
336
 
337
  return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
338
  }
339
-
340
- ?>
89
  add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );
90
  add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' );
91
  add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' );
92
+ add_filter( 'the_content', 'bp_activity_at_name_filter' );
93
 
94
  add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
95
 
99
  /** Actions *******************************************************************/
100
 
101
  // At-name filter
102
+ add_action( 'bp_activity_before_save', 'bp_activity_at_name_filter_updates' );
103
 
104
  // Activity stream moderation
105
  add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
194
  }
195
 
196
  /**
197
+ * Finds and links @-mentioned users in the contents of a given item.
198
  *
199
  * @since BuddyPress (1.2)
200
  *
201
+ * @param string $content The contents of a given item.
202
+ * @param int $activity_id The activity id. Deprecated.
203
  *
204
  * @uses bp_activity_find_mentions()
 
 
 
205
  * @uses bp_core_get_user_domain()
 
206
  *
207
  * @return string $content Content filtered for mentions
208
  */
209
  function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
 
 
 
 
 
 
 
210
 
211
+ // Try to find mentions
212
  $usernames = bp_activity_find_mentions( $content );
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
+ // No mentions? Stop now!
215
+ if ( empty( $usernames ) )
216
+ return $content;
217
+
218
+ // Linkify the mentions with the username
219
+ foreach( (array) $usernames as $user_id => $username ) {
220
  $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
221
  }
222
 
223
+ // Return the content
 
 
 
224
  return $content;
225
  }
226
 
227
  /**
228
+ * Catch mentions in activity items before they are saved into the database.
229
+ *
230
+ * If mentions are found, replace @mention text with user links and add our
231
+ * hook to send mentions after the activity item is saved.
232
  *
233
  * @since BuddyPress (1.5)
234
  *
235
  * @param obj $activity
236
  *
237
+ * @uses bp_activity_find_mentions()
 
 
238
  */
239
  function bp_activity_at_name_filter_updates( $activity ) {
240
+ // If activity was marked as spam, stop the rest of this function.
241
+ if ( ! empty( $activity->is_spam ) )
242
+ return;
243
+
244
+ // Try to find mentions
245
+ $usernames = bp_activity_find_mentions( $activity->content );
246
+
247
+ // We have mentions!
248
+ if ( ! empty( $usernames ) ) {
249
+ // Replace @mention text with userlinks
250
+ foreach( (array) $usernames as $user_id => $username ) {
251
+ $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content );
252
+ }
253
 
254
+ // Add our hook to send @mention emails after the activity item is saved
255
+ add_action( 'bp_activity_after_save', 'bp_activity_at_name_send_emails' );
256
 
257
+ // temporary variable to avoid having to run bp_activity_find_mentions() again
258
+ buddypress()->activity->mentioned_users = $usernames;
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Sends emails and BP notifications for @-mentioned users in the contents of
264
+ * an activity item.
265
+ *
266
+ * @since BuddyPress (1.7)
267
+ *
268
+ * @param obj $activity The BP_Activity_Activity object
269
+ *
270
+ * @uses bp_activity_at_message_notification()
271
+ * @uses bp_activity_update_mention_count_for_user()
272
+ */
273
+ function bp_activity_at_name_send_emails( $activity ) {
274
+ // If our temporary variable doesn't exist, stop now.
275
+ if ( empty( buddypress()->activity->mentioned_users ) )
276
+ return;
277
+
278
+ // Grab our temporary variable from bp_activity_at_name_filter_updates()
279
+ $usernames = buddypress()->activity->mentioned_users;
280
+
281
+ // Get rid of temporary variable
282
+ unset( buddypress()->activity->mentioned_users );
283
+
284
+ // Send @mentions and setup BP notifications
285
+ foreach( (array) $usernames as $user_id => $username ) {
286
+ // If you want to disable notifications, you can use this filter to stop email sending
287
+ if ( apply_filters( 'bp_activity_at_name_do_notifications', true, $usernames ) ) {
288
+ bp_activity_at_message_notification( $activity->id, $user_id );
289
+ }
290
+
291
+ // Updates mention count for the user
292
+ bp_activity_update_mention_count_for_user( $user_id, $activity->id );
293
+ }
294
  }
295
 
296
  /**
363
 
364
  return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
365
  }
 
 
bp-activity/bp-activity-functions.php CHANGED
@@ -28,13 +28,13 @@ function bp_activity_has_directory() {
28
  }
29
 
30
  /**
31
- * Searches through the content of an activity item to locate usernames, designated by an @ sign
 
32
  *
33
  * @since BuddyPress (1.5)
34
  *
35
- * @param string $content The content of the activity, usually found in $activity->content
36
- *
37
- * @return bool|array $usernames Array of the found usernames that match existing users. False if no matches
38
  */
39
  function bp_activity_find_mentions( $content ) {
40
  $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/';
@@ -44,7 +44,26 @@ function bp_activity_find_mentions( $content ) {
44
  if ( !$usernames = array_unique( $usernames[1] ) )
45
  return false;
46
 
47
- return $usernames;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
 
50
  /**
@@ -61,62 +80,93 @@ function bp_activity_clear_new_mentions( $user_id ) {
61
  }
62
 
63
  /**
64
- * Adjusts new mention count for mentioned users when activity items are deleted or created
 
 
 
 
 
65
  *
66
  * @since BuddyPress (1.5)
67
  *
68
  * @param int $activity_id The unique id for the activity item
69
- * @param string $action Can be 'delete' or 'add'. Defaults to 'add'
70
  *
71
- * @uses BP_Activity_Activity() {@link BP_Activity_Activity}
72
  * @uses bp_activity_find_mentions()
73
- * @uses bp_is_username_compatibility_mode()
74
- * @uses bp_core_get_userid_from_nicename()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  * @uses bp_get_user_meta()
76
  * @uses bp_update_user_meta()
 
77
  */
78
- function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) {
79
- $activity = new BP_Activity_Activity( $activity_id );
 
 
 
 
 
 
 
 
 
 
80
 
81
- if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
82
- foreach( (array) $usernames as $username ) {
83
- if ( bp_is_username_compatibility_mode() )
84
- $user_id = username_exists( $username );
85
- else
86
- $user_id = bp_core_get_userid_from_nicename( $username );
87
-
88
- if ( empty( $user_id ) )
89
- continue;
90
-
91
- // Adjust the mention list and count for the member
92
- $new_mention_count = (int)bp_get_user_meta( $user_id, 'bp_new_mention_count', true );
93
- if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) )
94
- $new_mentions = array();
95
-
96
- switch ( $action ) {
97
- case 'delete' :
98
- $key = array_search( $activity_id, $new_mentions );
99
- if ( $key !== false ) {
100
- unset( $new_mentions[$key] );
101
- }
102
- break;
103
-
104
- case 'add' :
105
- default :
106
- if ( !in_array( $activity_id, $new_mentions ) ) {
107
- $new_mentions[] = (int) $activity_id;
108
- }
109
- break;
110
  }
111
 
112
- // Get an updated mention count
113
- $new_mention_count = count( $new_mentions );
114
 
115
- // Resave the user_meta
116
- bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count );
117
- bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions );
118
- }
 
 
 
119
  }
 
 
 
 
 
 
 
 
 
120
  }
121
 
122
  /**
@@ -236,6 +286,32 @@ function bp_activity_get_action( $component_id, $key ) {
236
  return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key );
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  /** Favorites ****************************************************************/
240
 
241
  /**
@@ -532,16 +608,16 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '' ) {
532
  // No key so get all for activity_id
533
  } else {
534
  $metas = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM {$bp->activity->table_name_meta} WHERE activity_id = %d", $activity_id ) );
535
-
536
  if ( !empty( $metas ) ) {
537
  $metas = array_map( 'maybe_unserialize', (array) $metas );
538
-
539
  foreach( $metas as $mkey => $mvalue ) {
540
  wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $mkey, $mvalue, 'bp' );
541
  }
542
  }
543
  }
544
-
545
  // No result so return false
546
  if ( empty( $metas ) )
547
  return false;
@@ -659,7 +735,7 @@ add_action( 'delete_user', 'bp_activity_remove_all_user_data' );
659
  * @global object $wpdb
660
  * @global object $bp BuddyPress global settings
661
  * @param int $user_id
662
- * @since 1.6
663
  */
664
  function bp_activity_spam_all_user_data( $user_id = 0 ) {
665
  global $bp, $wpdb;
@@ -710,7 +786,7 @@ add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' );
710
  * @global object $wpdb
711
  * @global object $bp BuddyPress global settings
712
  * @param int $user_id
713
- * @since 1.6
714
  */
715
  function bp_activity_ham_all_user_data( $user_id = 0 ) {
716
  global $bp, $wpdb;
@@ -730,7 +806,7 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) {
730
  foreach ( $activity as $k => $v )
731
  $activity_obj->$k = $v;
732
 
733
- // Mark as not spam
734
  bp_activity_mark_as_ham( $activity_obj );
735
 
736
  /*
@@ -759,7 +835,7 @@ add_action( 'bp_make_ham_user', 'bp_activity_ham_all_user_data' );
759
  * Register the activity stream actions for updates
760
  *
761
  * @global object $bp BuddyPress global settings
762
- * @since 1.6
763
  */
764
  function bp_activity_register_activity_actions() {
765
  global $bp;
@@ -1027,7 +1103,7 @@ function bp_activity_post_update( $args = '' ) {
1027
  'type' => 'activity_update'
1028
  ) );
1029
 
1030
- $activity_content = apply_filters( 'bp_activity_latest_update_content', $content );
1031
 
1032
  // Add this update to the "latest update" usermeta so it can be fetched anywhere.
1033
  bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $content ) );
@@ -1431,8 +1507,10 @@ function bp_activity_hide_user_activity( $user_id ) {
1431
  function bp_activity_thumbnail_content_images( $content, $link = false ) {
1432
 
1433
  preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
1434
- $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>(\[/caption\])?|', '', $content );
1435
-
 
 
1436
  if ( !empty( $matches ) && !empty( $matches[0] ) ) {
1437
  // Get the SRC value
1438
  preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src );
@@ -1472,7 +1550,7 @@ function bp_activity_thumbnail_content_images( $content, $link = false ) {
1472
  * Convenience function to control whether the current user is allowed to mark activity items as spam
1473
  *
1474
  * @return bool True if user is allowed to mark activity items as spam
1475
- * @since 1.6
1476
  * @static
1477
  */
1478
  function bp_activity_user_can_mark_spam() {
@@ -1485,7 +1563,7 @@ function bp_activity_user_can_mark_spam() {
1485
  * @global object $bp BuddyPress global settings
1486
  * @param BP_Activity_Activity $activity
1487
  * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam).
1488
- * @since 1.6
1489
  */
1490
  function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
1491
  global $bp;
@@ -1521,7 +1599,7 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
1521
  * @global object $bp BuddyPress global settings
1522
  * @param BP_Activity_Activity $activity
1523
  * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam).
1524
- * @since 1.6
1525
  */
1526
  function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
1527
  global $bp;
@@ -1549,7 +1627,7 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
1549
  }
1550
 
1551
  do_action( 'bp_activity_mark_as_ham', $activity, $source );
1552
- }
1553
 
1554
 
1555
  /** Embeds *******************************************************************/
@@ -1666,5 +1744,3 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) {
1666
  function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
1667
  bp_activity_update_meta( $id, $cachekey, $cache );
1668
  }
1669
-
1670
- ?>
28
  }
29
 
30
  /**
31
+ * Searches through the content of an activity item to locate usernames,
32
+ * designated by an @ sign.
33
  *
34
  * @since BuddyPress (1.5)
35
  *
36
+ * @param string $content The content of the activity, usually found in $activity->content.
37
+ * @return mixed Associative array with user ID as key and username as value. Boolean false if no mentions found.
 
38
  */
39
  function bp_activity_find_mentions( $content ) {
40
  $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/';
44
  if ( !$usernames = array_unique( $usernames[1] ) )
45
  return false;
46
 
47
+ $mentioned_users = array();
48
+
49
+ // We've found some mentions! Check to see if users exist
50
+ foreach( (array) $usernames as $key => $username ) {
51
+ if ( bp_is_username_compatibility_mode() ) {
52
+ $user_id = username_exists( $username );
53
+ } else {
54
+ $user_id = bp_core_get_userid_from_nicename( $username );
55
+ }
56
+
57
+ // user ID exists, so let's add it to our array
58
+ if ( ! empty( $user_id ) ) {
59
+ $mentioned_users[$user_id] = $username;
60
+ }
61
+ }
62
+
63
+ if ( empty( $mentioned_users ) )
64
+ return false;
65
+
66
+ return $mentioned_users;
67
  }
68
 
69
  /**
80
  }
81
 
82
  /**
83
+ * Adjusts mention count for mentioned users in activity items.
84
+ *
85
+ * This function is useful if you only have the activity ID handy and you
86
+ * haven't parsed an activity item for @mentions yet.
87
+ *
88
+ * Currently, only used in {@link bp_activity_delete()}.
89
  *
90
  * @since BuddyPress (1.5)
91
  *
92
  * @param int $activity_id The unique id for the activity item
93
+ * @param string $action Can be 'delete' or 'add'. Defaults to 'add'.
94
  *
 
95
  * @uses bp_activity_find_mentions()
96
+ * @uses bp_activity_update_mention_count_for_user()
97
+ */
98
+ function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
99
+ if ( empty( $activity_id ) )
100
+ return false;
101
+
102
+ // Get activity object
103
+ $activity = new BP_Activity_Activity( (int) $activity_id );
104
+
105
+ // Try to find mentions
106
+ $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) );
107
+
108
+ // Still empty? Stop now
109
+ if ( empty( $usernames ) )
110
+ return false;
111
+
112
+ // Increment mention count foreach mentioned user
113
+ foreach( (array) $usernames as $user_id => $username ) {
114
+ bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action );
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Updates the mention count for the user in question.
120
+ *
121
+ * This function should be used when you've already parsed your activity item
122
+ * for @mentions.
123
+ *
124
+ * @since BuddyPress (1.7)
125
+ *
126
+ * @param int $user_id The user ID
127
+ * @param int $activity_id The unique id for the activity item
128
+ * @param string $action Can be 'delete' or 'add'. Defaults to 'add'
129
+ *
130
  * @uses bp_get_user_meta()
131
  * @uses bp_update_user_meta()
132
+ * @return bool
133
  */
134
+ function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action = 'add' ) {
135
+ if ( empty( $user_id ) || empty( $activity_id ) )
136
+ return false;
137
+
138
+ // Adjust the mention list and count for the member
139
+ $new_mention_count = (int) bp_get_user_meta( $user_id, 'bp_new_mention_count', true );
140
+ if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) )
141
+ $new_mentions = array();
142
+
143
+ switch ( $action ) {
144
+ case 'delete' :
145
+ $key = array_search( $activity_id, $new_mentions );
146
 
147
+ if ( $key !== false ) {
148
+ unset( $new_mentions[$key] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
150
 
151
+ break;
 
152
 
153
+ case 'add' :
154
+ default :
155
+ if ( !in_array( $activity_id, $new_mentions ) ) {
156
+ $new_mentions[] = (int) $activity_id;
157
+ }
158
+
159
+ break;
160
  }
161
+
162
+ // Get an updated mention count
163
+ $new_mention_count = count( $new_mentions );
164
+
165
+ // Resave the user_meta
166
+ bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count );
167
+ bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions );
168
+
169
+ return true;
170
  }
171
 
172
  /**
286
  return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key );
287
  }
288
 
289
+ /**
290
+ * Fetch details of all registered activity types
291
+ *
292
+ * @return array array( type => description ), ...
293
+ * @since BuddyPress (1.7)
294
+ */
295
+ function bp_activity_get_types() {
296
+ $actions = array();
297
+
298
+ // Walk through the registered actions, and build an array of actions/values.
299
+ foreach ( buddypress()->activity->actions as $action ) {
300
+ $action = array_values( (array) $action );
301
+
302
+ for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
303
+ $actions[ $action[$i]['key'] ] = $action[$i]['value'];
304
+ }
305
+
306
+ // This was a mis-named activity type from before BP 1.6
307
+ unset( $actions['friends_register_activity_action'] );
308
+
309
+ // This type has not been used since BP 1.0.3. It will be re-instated in a future version.
310
+ unset( $actions['updated_profile'] );
311
+
312
+ return apply_filters( 'bp_activity_get_types', $actions );
313
+ }
314
+
315
  /** Favorites ****************************************************************/
316
 
317
  /**
608
  // No key so get all for activity_id
609
  } else {
610
  $metas = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM {$bp->activity->table_name_meta} WHERE activity_id = %d", $activity_id ) );
611
+
612
  if ( !empty( $metas ) ) {
613
  $metas = array_map( 'maybe_unserialize', (array) $metas );
614
+
615
  foreach( $metas as $mkey => $mvalue ) {
616
  wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $mkey, $mvalue, 'bp' );
617
  }
618
  }
619
  }
620
+
621
  // No result so return false
622
  if ( empty( $metas ) )
623
  return false;
735
  * @global object $wpdb
736
  * @global object $bp BuddyPress global settings
737
  * @param int $user_id
738
+ * @since BuddyPress (1.6)
739
  */
740
  function bp_activity_spam_all_user_data( $user_id = 0 ) {
741
  global $bp, $wpdb;
786
  * @global object $wpdb
787
  * @global object $bp BuddyPress global settings
788
  * @param int $user_id
789
+ * @since BuddyPress (1.6)
790
  */
791
  function bp_activity_ham_all_user_data( $user_id = 0 ) {
792
  global $bp, $wpdb;
806
  foreach ( $activity as $k => $v )
807
  $activity_obj->$k = $v;
808
 
809
+ // Mark as not spam
810
  bp_activity_mark_as_ham( $activity_obj );
811
 
812
  /*
835
  * Register the activity stream actions for updates
836
  *
837
  * @global object $bp BuddyPress global settings
838
+ * @since BuddyPress (1.6)
839
  */
840
  function bp_activity_register_activity_actions() {
841
  global $bp;
1103
  'type' => 'activity_update'
1104
  ) );
1105
 
1106
+ $activity_content = apply_filters( 'bp_activity_latest_update_content', $content );
1107
 
1108
  // Add this update to the "latest update" usermeta so it can be fetched anywhere.
1109
  bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $content ) );
1507
  function bp_activity_thumbnail_content_images( $content, $link = false ) {
1508
 
1509
  preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
1510
+
1511
+ // Remove <img> tags. Also remove caption shortcodes and caption text if present
1512
+ $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>([^\[\[]*\[\/caption\])?|', '', $content );
1513
+
1514
  if ( !empty( $matches ) && !empty( $matches[0] ) ) {
1515
  // Get the SRC value
1516
  preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src );
1550
  * Convenience function to control whether the current user is allowed to mark activity items as spam
1551
  *
1552
  * @return bool True if user is allowed to mark activity items as spam
1553
+ * @since BuddyPress (1.6)
1554
  * @static
1555
  */
1556
  function bp_activity_user_can_mark_spam() {
1563
  * @global object $bp BuddyPress global settings
1564
  * @param BP_Activity_Activity $activity
1565
  * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam).
1566
+ * @since BuddyPress (1.6)
1567
  */
1568
  function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
1569
  global $bp;
1599
  * @global object $bp BuddyPress global settings
1600
  * @param BP_Activity_Activity $activity
1601
  * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam).
1602
+ * @since BuddyPress (1.6)
1603
  */
1604
  function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
1605
  global $bp;
1627
  }
1628
 
1629
  do_action( 'bp_activity_mark_as_ham', $activity, $source );
1630
+ }
1631
 
1632
 
1633
  /** Embeds *******************************************************************/
1744
  function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
1745
  bp_activity_update_meta( $id, $cachekey, $cache );
1746
  }
 
 
bp-activity/bp-activity-loader.php CHANGED
@@ -52,7 +52,7 @@ class BP_Activity_Component extends BP_Component {
52
 
53
  // Load Akismet support if Akismet is configured
54
  $akismet_key = bp_get_option( 'wordpress_api_key' );
55
- if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', true ) )
56
  $includes[] = 'akismet';
57
 
58
  if ( is_admin() )
@@ -128,12 +128,13 @@ class BP_Activity_Component extends BP_Component {
128
  return;
129
 
130
  // Determine user to use
131
- if ( bp_displayed_user_domain() )
132
  $user_domain = bp_displayed_user_domain();
133
- elseif ( bp_loggedin_user_domain() )
134
  $user_domain = bp_loggedin_user_domain();
135
- else
136
  return;
 
137
 
138
  // User link
139
  $activity_link = trailingslashit( $user_domain . $this->slug );
@@ -323,7 +324,7 @@ class BP_Activity_Component extends BP_Component {
323
  /**
324
  * Setup the actions
325
  *
326
- * @since 1.6
327
  */
328
  function setup_actions() {
329
  // Spam prevention
@@ -339,5 +340,3 @@ function bp_setup_activity() {
339
  $bp->activity = new BP_Activity_Component();
340
  }
341
  add_action( 'bp_setup_components', 'bp_setup_activity', 6 );
342
-
343
- ?>
52
 
53
  // Load Akismet support if Akismet is configured
54
  $akismet_key = bp_get_option( 'wordpress_api_key' );
55
+ if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) )
56
  $includes[] = 'akismet';
57
 
58
  if ( is_admin() )
128
  return;
129
 
130
  // Determine user to use
131
+ if ( bp_displayed_user_domain() ) {
132
  $user_domain = bp_displayed_user_domain();
133
+ } elseif ( bp_loggedin_user_domain() ) {
134
  $user_domain = bp_loggedin_user_domain();
135
+ } else {
136
  return;
137
+ }
138
 
139
  // User link
140
  $activity_link = trailingslashit( $user_domain . $this->slug );
324
  /**
325
  * Setup the actions
326
  *
327
+ * @since BuddyPress (1.6)
328
  */
329
  function setup_actions() {
330
  // Spam prevention
340
  $bp->activity = new BP_Activity_Component();
341
  }
342
  add_action( 'bp_setup_components', 'bp_setup_activity', 6 );
 
 
bp-activity/bp-activity-notifications.php CHANGED
@@ -38,10 +38,10 @@ if ( !defined( 'ABSPATH' ) ) exit;
38
  * @uses do_action() To call the 'bp_activity_sent_mention_email' hook
39
  */
40
  function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
41
-
42
  // Don't leave multiple notifications for the same activity item
43
  $notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' );
44
-
45
  foreach( $notifications as $notification ) {
46
  if ( $activity_id == $notification->item_id ) {
47
  return;
@@ -52,6 +52,7 @@ function bp_activity_at_message_notification( $activity_id, $receiver_user_id )
52
 
53
  $subject = '';
54
  $message = '';
 
55
 
56
  // Add the BP notification
57
  bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id );
@@ -70,8 +71,7 @@ function bp_activity_at_message_notification( $activity_id, $receiver_user_id )
70
  // Set up and send the message
71
  $ud = bp_core_get_core_userdata( $receiver_user_id );
72
  $to = $ud->user_email;
73
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
74
- $subject = '[' . $sitename . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name );
75
 
76
  if ( bp_is_active( 'groups' ) && bp_is_group() ) {
77
  $message = sprintf( __(
@@ -157,12 +157,10 @@ function bp_activity_new_comment_notification( $comment_id, $commenter_id, $para
157
  $content = bp_activity_filter_kses( stripslashes($content) );
158
 
159
  // Set up and send the message
160
- $ud = bp_core_get_core_userdata( $original_activity->user_id );
161
- $to = $ud->user_email;
162
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
163
- $subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name );
164
-
165
- $message = sprintf( __(
166
  '%1$s replied to one of your updates:
167
 
168
  "%2$s"
@@ -188,7 +186,7 @@ To view your original update and all comments, log in and visit: %3$s
188
  * If this is a reply to another comment, send an email notification to the
189
  * author of the immediate parent comment.
190
  */
191
- if ( $activity_id == $parent_id )
192
  return false;
193
 
194
  $parent_comment = new BP_Activity_Activity( $parent_id );
@@ -202,8 +200,7 @@ To view your original update and all comments, log in and visit: %3$s
202
  // Set up and send the message
203
  $ud = bp_core_get_core_userdata( $parent_comment->user_id );
204
  $to = $ud->user_email;
205
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
206
- $subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name );
207
 
208
  $poster_name = stripslashes( $poster_name );
209
  $content = bp_activity_filter_kses( stripslashes( $content ) );
@@ -230,5 +227,3 @@ To view the original activity, your comment and all replies, log in and visit: %
230
  do_action( 'bp_activity_sent_reply_to_reply_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
231
  }
232
  }
233
-
234
- ?>
38
  * @uses do_action() To call the 'bp_activity_sent_mention_email' hook
39
  */
40
  function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
41
+
42
  // Don't leave multiple notifications for the same activity item
43
  $notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' );
44
+
45
  foreach( $notifications as $notification ) {
46
  if ( $activity_id == $notification->item_id ) {
47
  return;
52
 
53
  $subject = '';
54
  $message = '';
55
+ $content = '';
56
 
57
  // Add the BP notification
58
  bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id );
71
  // Set up and send the message
72
  $ud = bp_core_get_core_userdata( $receiver_user_id );
73
  $to = $ud->user_email;
74
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ) ) );
 
75
 
76
  if ( bp_is_active( 'groups' ) && bp_is_group() ) {
77
  $message = sprintf( __(
157
  $content = bp_activity_filter_kses( stripslashes($content) );
158
 
159
  // Set up and send the message
160
+ $ud = bp_core_get_core_userdata( $original_activity->user_id );
161
+ $to = $ud->user_email;
162
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ) ) );
163
+ $message = sprintf( __(
 
 
164
  '%1$s replied to one of your updates:
165
 
166
  "%2$s"
186
  * If this is a reply to another comment, send an email notification to the
187
  * author of the immediate parent comment.
188
  */
189
+ if ( empty( $parent_id ) || ( $activity_id == $parent_id ) )
190
  return false;
191
 
192
  $parent_comment = new BP_Activity_Activity( $parent_id );
200
  // Set up and send the message
201
  $ud = bp_core_get_core_userdata( $parent_comment->user_id );
202
  $to = $ud->user_email;
203
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ) ) );
 
204
 
205
  $poster_name = stripslashes( $poster_name );
206
  $content = bp_activity_filter_kses( stripslashes( $content ) );
227
  do_action( 'bp_activity_sent_reply_to_reply_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
228
  }
229
  }
 
 
bp-activity/bp-activity-screens.php CHANGED
@@ -303,4 +303,112 @@ function bp_activity_screen_notification_settings() {
303
  }
304
  add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 );
305
 
306
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
  add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 );
305
 
306
+ /** Theme Compatability *******************************************************/
307
+
308
+ /**
309
+ * The main theme compat class for BuddyPress Activity
310
+ *
311
+ * This class sets up the necessary theme compatability actions to safely output
312
+ * group template parts to the_title and the_content areas of a theme.
313
+ *
314
+ * @since BuddyPress (1.7)
315
+ */
316
+ class BP_Activity_Theme_Compat {
317
+
318
+ /**
319
+ * Setup the activity component theme compatibility
320
+ *
321
+ * @since BuddyPress (1.7)
322
+ */
323
+ public function __construct() {
324
+ add_action( 'bp_setup_theme_compat', array( $this, 'is_activity' ) );
325
+ }
326
+
327
+ /**
328
+ * Are we looking at something that needs activity theme compatability?
329
+ *
330
+ * @since BuddyPress (1.7)
331
+ */
332
+ public function is_activity() {
333
+
334
+ // Bail if not looking at a group
335
+ if ( ! bp_is_activity_component() )
336
+ return;
337
+
338
+ // Activity Directory
339
+ if ( ! bp_displayed_user_id() && ! bp_current_action() ) {
340
+ bp_update_is_directory( true, 'activity' );
341
+
342
+ do_action( 'bp_activity_screen_index' );
343
+
344
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
345
+ add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) );
346
+
347
+ // Single activity
348
+ } elseif ( bp_is_single_activity() ) {
349
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) );
350
+ add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) );
351
+ }
352
+ }
353
+
354
+ /** Directory *************************************************************/
355
+
356
+ /**
357
+ * Update the global $post with directory data
358
+ *
359
+ * @since BuddyPress (1.7)
360
+ */
361
+ public function directory_dummy_post() {
362
+ bp_theme_compat_reset_post( array(
363
+ 'ID' => 0,
364
+ 'post_title' => __( 'Sitewide Activity', 'buddypress' ),
365
+ 'post_author' => 0,
366
+ 'post_date' => 0,
367
+ 'post_content' => '',
368
+ 'post_type' => 'bp_activity',
369
+ 'post_status' => 'publish',
370
+ 'is_archive' => true,
371
+ 'comment_status' => 'closed'
372
+ ) );
373
+ }
374
+
375
+ /**
376
+ * Filter the_content with the groups index template part
377
+ *
378
+ * @since BuddyPress (1.7)
379
+ */
380
+ public function directory_content() {
381
+ bp_buffer_template_part( 'activity/index' );
382
+ }
383
+
384
+ /** Single ****************************************************************/
385
+
386
+ /**
387
+ * Update the global $post with the displayed user's data
388
+ *
389
+ * @since BuddyPress (1.7)
390
+ */
391
+ public function single_dummy_post() {
392
+ bp_theme_compat_reset_post( array(
393
+ 'ID' => 0,
394
+ 'post_title' => __( 'Activity', 'buddypress' ),
395
+ 'post_author' => 0,
396
+ 'post_date' => 0,
397
+ 'post_content' => '',
398
+ 'post_type' => 'bp_activity',
399
+ 'post_status' => 'publish',
400
+ 'is_archive' => true,
401
+ 'comment_status' => 'closed'
402
+ ) );
403
+ }
404
+
405
+ /**
406
+ * Filter the_content with the members' activity permalink template part
407
+ *
408
+ * @since BuddyPress (1.7)
409
+ */
410
+ public function single_dummy_content() {
411
+ bp_buffer_template_part( 'activity/single/home' );
412
+ }
413
+ }
414
+ new BP_Activity_Theme_Compat();
bp-activity/bp-activity-template.php CHANGED
@@ -107,7 +107,7 @@ class BP_Activity_Template {
107
  /**
108
  * Constructor method
109
  *
110
- * See definition of $defaults below, as well as $defaults in bp_has_activities(), for
111
  * description of $args array
112
  *
113
  * @param array $args
@@ -138,7 +138,7 @@ class BP_Activity_Template {
138
  $func_args = func_get_args();
139
  $args = bp_core_parse_args_array( $old_args_keys, $func_args );
140
  }
141
-
142
  $defaults = array(
143
  'page' => 1,
144
  'per_page' => 20,
@@ -156,7 +156,7 @@ class BP_Activity_Template {
156
  );
157
  $r = wp_parse_args( $args, $defaults );
158
  extract( $r );
159
-
160
  $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
161
  $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
162
 
@@ -368,6 +368,9 @@ function bp_has_activities( $args = '' ) {
368
  $r = wp_parse_args( $args, $defaults );
369
  extract( $r );
370
 
 
 
 
371
  // If you have passed a "scope" then this will override any filters you have passed.
372
  if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) {
373
  if ( 'just-me' == $scope )
@@ -954,18 +957,22 @@ function bp_activity_avatar( $args = '' ) {
954
  * @return string User avatar
955
  */
956
  function bp_get_activity_avatar( $args = '' ) {
957
- global $activities_template, $bp;
 
 
958
 
959
  // On activity permalink pages, default to the full-size avatar
960
  $type_default = bp_is_single_activity() ? 'full' : 'thumb';
961
 
962
- if ( !empty( $activities_template->activity->display_name ) ) {
963
- $dn_default = $activities_template->activity->display_name;
964
- } else if ( !empty( $activities_template->current_comment->display_name ) ) {
965
- $dn_default = $activities_template->current_comment->display_name;
966
- }
967
 
968
- $alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' );
 
 
 
 
969
 
970
  $defaults = array(
971
  'alt' => $alt_default,
@@ -979,6 +986,7 @@ function bp_activity_avatar( $args = '' ) {
979
  extract( $r, EXTR_SKIP );
980
 
981
  if ( !isset( $height ) && !isset( $width ) ) {
 
982
  // Backpat
983
  if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) {
984
  $height = ( 'full' == $type ) ? $bp->avatar->full->height : $bp->avatar->thumb->height;
@@ -992,23 +1000,27 @@ function bp_activity_avatar( $args = '' ) {
992
  } else {
993
  $width = 20;
994
  }
995
-
996
  }
997
 
998
- // Within the loop, we the current activity should be set first to the
999
- // current_comment, if available
1000
- $current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity;
1001
-
1002
  // Primary activity avatar is always a user, but can be modified via a filter
1003
  $object = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' );
1004
- $item_id = $user_id ? $user_id : $current_activity_item->user_id;
1005
  $item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id );
1006
 
1007
  // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it.
1008
- if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $activities_template->activity->user_email ) )
1009
  $email = $current_activity_item->user_email;
1010
 
1011
- return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email ) ) );
 
 
 
 
 
 
 
 
 
1012
  }
1013
 
1014
  /**
@@ -1044,15 +1056,16 @@ function bp_activity_secondary_avatar( $args = '' ) {
1044
  function bp_get_activity_secondary_avatar( $args = '' ) {
1045
  global $activities_template;
1046
 
1047
- $defaults = array(
1048
- 'type' => 'thumb',
1049
- 'width' => 20,
1050
- 'height' => 20,
1051
- 'class' => 'avatar',
1052
- 'email' => false
1053
- );
1054
-
1055
- $r = wp_parse_args( $args, $defaults );
 
1056
  extract( $r, EXTR_SKIP );
1057
 
1058
  // Set item_id and object (default to user)
@@ -1061,13 +1074,20 @@ function bp_activity_secondary_avatar( $args = '' ) {
1061
  $object = 'group';
1062
  $item_id = $activities_template->activity->item_id;
1063
 
 
 
 
 
 
 
 
 
 
1064
  if ( empty( $alt ) ) {
1065
  $alt = __( 'Group logo', 'buddypress' );
1066
 
1067
- if ( bp_is_active( 'groups' ) ) {
1068
- $group = groups_get_group( $item_id );
1069
- if ( isset( $group->name ) )
1070
- $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $group->name );
1071
  }
1072
  }
1073
 
@@ -1075,8 +1095,9 @@ function bp_activity_secondary_avatar( $args = '' ) {
1075
  case 'blogs' :
1076
  $object = 'blog';
1077
  $item_id = $activities_template->activity->item_id;
 
1078
 
1079
- if ( !$alt ) {
1080
  $alt = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );
1081
  }
1082
 
@@ -1084,6 +1105,7 @@ function bp_activity_secondary_avatar( $args = '' ) {
1084
  case 'friends' :
1085
  $object = 'user';
1086
  $item_id = $activities_template->activity->secondary_item_id;
 
1087
 
1088
  if ( empty( $alt ) ) {
1089
  $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) );
@@ -1094,23 +1116,48 @@ function bp_activity_secondary_avatar( $args = '' ) {
1094
  $object = 'user';
1095
  $item_id = $activities_template->activity->user_id;
1096
  $email = $activities_template->activity->user_email;
 
1097
 
1098
- if ( !$alt ) {
1099
  $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name );
1100
  }
1101
 
1102
  break;
1103
  }
1104
 
1105
- // Allow object and item_id to be filtered
1106
  $object = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object );
1107
  $item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id );
1108
 
1109
  // If we have no item_id or object, there is no avatar to display
1110
- if ( empty( $item_id ) || empty( $object ) )
1111
  return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
 
1113
- return apply_filters( 'bp_get_activity_secondary_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email ) ) );
 
1114
  }
1115
 
1116
  /**
@@ -1118,10 +1165,11 @@ function bp_activity_secondary_avatar( $args = '' ) {
1118
  *
1119
  * @since BuddyPress (1.2)
1120
  *
 
1121
  * @uses bp_get_activity_action()
1122
  */
1123
- function bp_activity_action() {
1124
- echo bp_get_activity_action();
1125
  }
1126
 
1127
  /**
@@ -1130,22 +1178,30 @@ function bp_activity_action() {
1130
  * @since BuddyPress (1.2)
1131
  *
1132
  * @global object $activities_template {@link BP_Activity_Template}
 
1133
  * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook
1134
  * @uses bp_insert_activity_meta()
1135
  * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook
1136
  *
1137
  * @return string The activity action
1138
  */
1139
- function bp_get_activity_action() {
1140
  global $activities_template;
1141
 
 
 
 
 
 
 
 
1142
  $action = $activities_template->activity->action;
1143
- $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity ) );
1144
 
1145
- if ( !empty( $action ) )
1146
  $action = bp_insert_activity_meta( $action );
1147
 
1148
- return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity ) );
1149
  }
1150
 
1151
  /**
@@ -1300,7 +1356,7 @@ function bp_activity_user_can_delete( $activity = false ) {
1300
  if ( bp_current_user_can( 'bp_moderate' ) )
1301
  $can_delete = true;
1302
 
1303
- if ( $activity->user_id == bp_loggedin_user_id() )
1304
  $can_delete = true;
1305
 
1306
  if ( bp_is_item_admin() && bp_is_single_item() )
@@ -1349,14 +1405,20 @@ function bp_activity_parent_content( $args = '' ) {
1349
  if ( !$parent_id = $activities_template->activity->item_id )
1350
  return false;
1351
 
1352
- // Get the content of the parent
1353
  if ( empty( $activities_template->activity_parents[$parent_id] ) )
1354
  return false;
1355
 
1356
- if ( empty( $activities_template->activity_parents[$parent_id]->content ) )
1357
- $content = $activities_template->activity_parents[$parent_id]->action;
1358
- else
1359
- $content = $activities_template->activity_parents[$parent_id]->action . ' ' . $activities_template->activity_parents[$parent_id]->content;
 
 
 
 
 
 
1360
 
1361
  // Remove the time since content for backwards compatibility
1362
  $content = str_replace( '<span class="time-since">%s</span>', '', $content );
@@ -1367,6 +1429,46 @@ function bp_activity_parent_content( $args = '' ) {
1367
  return apply_filters( 'bp_get_activity_parent_content', $content );
1368
  }
1369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1370
  /**
1371
  * Output whether or not the current activity is in a current user's favorites
1372
  *
@@ -1460,7 +1562,7 @@ function bp_activity_comments( $args = '' ) {
1460
  // Put the comment into the global so it's available to filters
1461
  $activities_template->activity->current_comment = $comment_child;
1462
 
1463
- $template = locate_template( 'activity/comment.php', false, false );
1464
 
1465
  // Backward compatibility. In older versions of BP, the markup was
1466
  // generated in the PHP instead of a template. This ensures that
@@ -2463,6 +2565,121 @@ function bp_activity_post_form_action() {
2463
  return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) );
2464
  }
2465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2466
  /* RSS Feed Template Tags ****************************************************/
2467
 
2468
  /**
@@ -2739,5 +2956,3 @@ function bp_activity_sitewide_feed() {
2739
  <?php
2740
  }
2741
  add_action( 'bp_head', 'bp_activity_sitewide_feed' );
2742
-
2743
- ?>
107
  /**
108
  * Constructor method
109
  *
110
+ * See definition of $defaults below, as well as $defaults in bp_has_activities(), for
111
  * description of $args array
112
  *
113
  * @param array $args
138
  $func_args = func_get_args();
139
  $args = bp_core_parse_args_array( $old_args_keys, $func_args );
140
  }
141
+
142
  $defaults = array(
143
  'page' => 1,
144
  'per_page' => 20,
156
  );
157
  $r = wp_parse_args( $args, $defaults );
158
  extract( $r );
159
+
160
  $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
161
  $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
162
 
368
  $r = wp_parse_args( $args, $defaults );
369
  extract( $r );
370
 
371
+ if ( empty( $search_terms ) && ! empty( $_REQUEST['s'] ) )
372
+ $search_terms = $_REQUEST['s'];
373
+
374
  // If you have passed a "scope" then this will override any filters you have passed.
375
  if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) {
376
  if ( 'just-me' == $scope )
957
  * @return string User avatar
958
  */
959
  function bp_get_activity_avatar( $args = '' ) {
960
+ global $activities_template;
961
+
962
+ $bp = buddypress();
963
 
964
  // On activity permalink pages, default to the full-size avatar
965
  $type_default = bp_is_single_activity() ? 'full' : 'thumb';
966
 
967
+ // Within the activity comment loop, the current activity should be set
968
+ // to current_comment. Otherwise, just use activity.
969
+ $current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity;
 
 
970
 
971
+ // Activity user display name
972
+ $dn_default = isset( $current_activity_item->display_name ) ? $current_activity_item->display_name : '';
973
+
974
+ // Prepend some descriptive text to alt
975
+ $alt_default = !empty( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $dn_default ) : __( 'Profile picture', 'buddypress' );
976
 
977
  $defaults = array(
978
  'alt' => $alt_default,
986
  extract( $r, EXTR_SKIP );
987
 
988
  if ( !isset( $height ) && !isset( $width ) ) {
989
+
990
  // Backpat
991
  if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) {
992
  $height = ( 'full' == $type ) ? $bp->avatar->full->height : $bp->avatar->thumb->height;
1000
  } else {
1001
  $width = 20;
1002
  }
 
1003
  }
1004
 
 
 
 
 
1005
  // Primary activity avatar is always a user, but can be modified via a filter
1006
  $object = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' );
1007
+ $item_id = !empty( $user_id ) ? $user_id : $current_activity_item->user_id;
1008
  $item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id );
1009
 
1010
  // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it.
1011
+ if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $current_activity_item->user_email ) )
1012
  $email = $current_activity_item->user_email;
1013
 
1014
+ return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array(
1015
+ 'item_id' => $item_id,
1016
+ 'object' => $object,
1017
+ 'type' => $type,
1018
+ 'alt' => $alt,
1019
+ 'class' => $class,
1020
+ 'width' => $width,
1021
+ 'height' => $height,
1022
+ 'email' => $email
1023
+ ) ) );
1024
  }
1025
 
1026
  /**
1056
  function bp_get_activity_secondary_avatar( $args = '' ) {
1057
  global $activities_template;
1058
 
1059
+ $r = wp_parse_args( $args, array(
1060
+ 'alt' => '',
1061
+ 'type' => 'thumb',
1062
+ 'width' => 20,
1063
+ 'height' => 20,
1064
+ 'class' => 'avatar',
1065
+ 'link_class' => '',
1066
+ 'linked' => true,
1067
+ 'email' => false
1068
+ ) );
1069
  extract( $r, EXTR_SKIP );
1070
 
1071
  // Set item_id and object (default to user)
1074
  $object = 'group';
1075
  $item_id = $activities_template->activity->item_id;
1076
 
1077
+ // Only if groups is active
1078
+ if ( bp_is_active( 'groups' ) ) {
1079
+ $group = groups_get_group( array( 'group_id' => $item_id ) );
1080
+ $link = bp_get_group_permalink( $group );
1081
+ $name = $group->name;
1082
+ } else {
1083
+ $name = '';
1084
+ }
1085
+
1086
  if ( empty( $alt ) ) {
1087
  $alt = __( 'Group logo', 'buddypress' );
1088
 
1089
+ if ( ! empty( $name ) ) {
1090
+ $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $name );
 
 
1091
  }
1092
  }
1093
 
1095
  case 'blogs' :
1096
  $object = 'blog';
1097
  $item_id = $activities_template->activity->item_id;
1098
+ $link = home_url();
1099
 
1100
+ if ( empty( $alt ) ) {
1101
  $alt = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );
1102
  }
1103
 
1105
  case 'friends' :
1106
  $object = 'user';
1107
  $item_id = $activities_template->activity->secondary_item_id;
1108
+ $link = bp_core_get_userlink( $item_id, false, true );
1109
 
1110
  if ( empty( $alt ) ) {
1111
  $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) );
1116
  $object = 'user';
1117
  $item_id = $activities_template->activity->user_id;
1118
  $email = $activities_template->activity->user_email;
1119
+ $link = bp_core_get_userlink( $item_id, false, true );
1120
 
1121
+ if ( empty( $alt ) ) {
1122
  $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name );
1123
  }
1124
 
1125
  break;
1126
  }
1127
 
1128
+ // Allow object, item_id, and link to be filtered
1129
  $object = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object );
1130
  $item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id );
1131
 
1132
  // If we have no item_id or object, there is no avatar to display
1133
+ if ( empty( $item_id ) || empty( $object ) ) {
1134
  return false;
1135
+ }
1136
+
1137
+ // Get the avatar
1138
+ $avatar = bp_core_fetch_avatar( array(
1139
+ 'item_id' => $item_id,
1140
+ 'object' => $object,
1141
+ 'type' => $type,
1142
+ 'alt' => $alt,
1143
+ 'class' => $class,
1144
+ 'width' => $width,
1145
+ 'height' => $height,
1146
+ 'email' => $email
1147
+ ) );
1148
+
1149
+ if ( !empty( $linked ) ) {
1150
+ $link = apply_filters( 'bp_get_activity_secondary_avatar_link', $link, $activities_template->activity->component );
1151
+
1152
+ return sprintf( '<a href="%s" class="%s">%s</a>',
1153
+ $link,
1154
+ $link_class,
1155
+ apply_filters( 'bp_get_activity_secondary_avatar', $avatar )
1156
+ );
1157
+ }
1158
 
1159
+ // else
1160
+ return apply_filters( 'bp_get_activity_secondary_avatar', $avatar );
1161
  }
1162
 
1163
  /**
1165
  *
1166
  * @since BuddyPress (1.2)
1167
  *
1168
+ * @param array $args See bp_get_activity_action()
1169
  * @uses bp_get_activity_action()
1170
  */
1171
+ function bp_activity_action( $args = array() ) {
1172
+ echo bp_get_activity_action( $args );
1173
  }
1174
 
1175
  /**
1178
  * @since BuddyPress (1.2)
1179
  *
1180
  * @global object $activities_template {@link BP_Activity_Template}
1181
+ * @param array $args Only parameter is "no_timestamp". If true, timestamp is shown in output.
1182
  * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook
1183
  * @uses bp_insert_activity_meta()
1184
  * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook
1185
  *
1186
  * @return string The activity action
1187
  */
1188
+ function bp_get_activity_action( $args = array() ) {
1189
  global $activities_template;
1190
 
1191
+ $defaults = array(
1192
+ 'no_timestamp' => false,
1193
+ );
1194
+
1195
+ $args = wp_parse_args( $args, $defaults );
1196
+ extract( $args, EXTR_SKIP );
1197
+
1198
  $action = $activities_template->activity->action;
1199
+ $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity, $args ) );
1200
 
1201
+ if ( ! empty( $action ) && ! $no_timestamp )
1202
  $action = bp_insert_activity_meta( $action );
1203
 
1204
+ return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity, $args ) );
1205
  }
1206
 
1207
  /**
1356
  if ( bp_current_user_can( 'bp_moderate' ) )
1357
  $can_delete = true;
1358
 
1359
+ if ( is_user_logged_in() && $activity->user_id == bp_loggedin_user_id() )
1360
  $can_delete = true;
1361
 
1362
  if ( bp_is_item_admin() && bp_is_single_item() )
1405
  if ( !$parent_id = $activities_template->activity->item_id )
1406
  return false;
1407
 
1408
+ // Bail if no parent content
1409
  if ( empty( $activities_template->activity_parents[$parent_id] ) )
1410
  return false;
1411
 
1412
+ // Bail if no action
1413
+ if ( empty( $activities_template->activity_parents[$parent_id]->action ) )
1414
+ return false;
1415
+
1416
+ // Content always includes action
1417
+ $content = $activities_template->activity_parents[$parent_id]->action;
1418
+
1419
+ // Maybe append activity content, if it exists
1420
+ if ( ! empty( $activities_template->activity_parents[$parent_id]->content ) )
1421
+ $content .= ' ' . $activities_template->activity_parents[$parent_id]->content;
1422
 
1423
  // Remove the time since content for backwards compatibility
1424
  $content = str_replace( '<span class="time-since">%s</span>', '', $content );
1429
  return apply_filters( 'bp_get_activity_parent_content', $content );
1430
  }
1431
 
1432
+ /**
1433
+ * Output the parent activity's user ID
1434
+ *
1435
+ * @since BuddyPress (1.7)
1436
+ */
1437
+ function bp_activity_parent_user_id() {
1438
+ echo bp_get_activity_parent_user_id();
1439
+ }
1440
+
1441
+ /**
1442
+ * Return the parent activity's user ID
1443
+ *
1444
+ * @global BP_Activity_Template $activities_template
1445
+ * @return bool|int False if parent activity can't be found, otherwise returns the parent activity's user ID
1446
+ * @since BuddyPress (1.7)
1447
+ */
1448
+ function bp_get_activity_parent_user_id() {
1449
+ global $activities_template;
1450
+
1451
+ // Bail if no activity on no item ID
1452
+ if ( empty( $activities_template->activity ) || empty( $activities_template->activity->item_id ) )
1453
+ return false;
1454
+
1455
+ // Get the ID of the parent activity content
1456
+ if ( !$parent_id = $activities_template->activity->item_id )
1457
+ return false;
1458
+
1459
+ // Bail if no parent item
1460
+ if ( empty( $activities_template->activity_parents[$parent_id] ) )
1461
+ return false;
1462
+
1463
+ // Bail if no parent user ID
1464
+ if ( empty( $activities_template->activity_parents[$parent_id]->user_id ) )
1465
+ return false;
1466
+
1467
+ $retval = $activities_template->activity_parents[$parent_id]->user_id;
1468
+
1469
+ return (int) apply_filters( 'bp_get_activity_parent_user_id', $retval );
1470
+ }
1471
+
1472
  /**
1473
  * Output whether or not the current activity is in a current user's favorites
1474
  *
1562
  // Put the comment into the global so it's available to filters
1563
  $activities_template->activity->current_comment = $comment_child;
1564
 
1565
+ $template = bp_locate_template( 'activity/comment.php', false, false );
1566
 
1567
  // Backward compatibility. In older versions of BP, the markup was
1568
  // generated in the PHP instead of a template. This ensures that
2565
  return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) );
2566
  }
2567
 
2568
+ /**
2569
+ * Looks at all the activity comments on the current activity item, and prints the comments' authors's avatar wrapped in <LI> tags.
2570
+ *
2571
+ * Use this function to easily output activity comment authors' avatars.
2572
+ *
2573
+ * @param array $args See {@link bp_core_fetch_avatar} for accepted values
2574
+ * @since BuddyPress (1.7)
2575
+ */
2576
+ function bp_activity_comments_user_avatars( $args = array() ) {
2577
+ $defaults = array(
2578
+ 'height' => false,
2579
+ 'html' => true,
2580
+ 'type' => 'thumb',
2581
+ 'width' => false,
2582
+ );
2583
+
2584
+ $args = wp_parse_args( $args, $defaults );
2585
+ extract( $args, EXTR_SKIP );
2586
+
2587
+ // Get the user IDs of everyone who has left a comment to the current activity item
2588
+ $user_ids = bp_activity_get_comments_user_ids();
2589
+
2590
+ $output = array();
2591
+ foreach ( (array) $user_ids as $user_id ) {
2592
+ $profile_link = bp_core_get_user_domain( $user_id );
2593
+ $image_html = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'height' => $height, 'html' => $html, 'type' => $type, 'width' => $width, ) );
2594
+
2595
+ $output[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $profile_link ), $image_html );
2596
+ }
2597
+
2598
+ echo apply_filters( 'bp_activity_comments_user_avatars', '<li>' . implode( '</li><li>', $output ) . '</li>', $args, $output );
2599
+ }
2600
+
2601
+ /**
2602
+ * Returns the user IDs of everyone who's written an activity comment on the current activity item.
2603
+ *
2604
+ * @return bool|array Returns false if there is no current activity items
2605
+ * @since BuddyPress (1.7)
2606
+ */
2607
+ function bp_activity_get_comments_user_ids() {
2608
+ if ( empty( $GLOBALS['activities_template']->activity ) || empty( $GLOBALS['activities_template']->activity->children ) )
2609
+ return false;
2610
+
2611
+ $user_ids = (array) bp_activity_recurse_comments_user_ids( $GLOBALS['activities_template']->activity->children );
2612
+ return apply_filters( 'bp_activity_get_comments_user_ids', array_unique( $user_ids ) );
2613
+ }
2614
+
2615
+ /**
2616
+ * Recurse through all activity comments and collect the IDs of the users who wrote them.
2617
+ *
2618
+ * @param array $comments Array of {@link BP_Activity_Activity} items
2619
+ * @return array Array of user IDs
2620
+ * @since BuddyPress (1.7)
2621
+ */
2622
+ function bp_activity_recurse_comments_user_ids( array $comments ) {
2623
+ $user_ids = array();
2624
+
2625
+ foreach ( $comments as $comment ) {
2626
+ // If a user is a spammer, their activity items will have been automatically marked as spam. Skip these.
2627
+ if ( $comment->is_spam )
2628
+ continue;
2629
+
2630
+ $user_ids[] = $comment->user_id;
2631
+
2632
+ // Check for commentception
2633
+ if ( ! empty( $comment->children ) )
2634
+ $user_ids = array_merge( $user_ids, bp_activity_recurse_comments_user_ids( $comment->children ) );
2635
+ }
2636
+
2637
+ return $user_ids;
2638
+ }
2639
+
2640
+
2641
+ /**
2642
+ * Renders a list of all the registered activity types for use in a <select> element, or as <input type="checkbox">.
2643
+ *
2644
+ * @param string $output Optional. Either 'select' or 'checkbox'. Defaults to select.
2645
+ * @param string|array $args Optional extra arguments:
2646
+ * checkbox_name - Used when type=checkbox. Sets the item's name property.
2647
+ * selected - Array of strings of activity types to mark as selected/checked.
2648
+ * @since BuddyPress (1.7)
2649
+ */
2650
+ function bp_activity_types_list( $output = 'select', $args = '' ) {
2651
+ $defaults = array(
2652
+ 'checkbox_name' => 'bp_activity_types',
2653
+ 'selected' => array(),
2654
+ );
2655
+ $args = wp_parse_args( $args, $defaults );
2656
+
2657
+ $activities = bp_activity_get_types();
2658
+ natsort( $activities );
2659
+
2660
+ // Loop through the activity types and output markup
2661
+ foreach ( $activities as $type => $description ) {
2662
+
2663
+ // See if we need to preselect the current type
2664
+ $checked = checked( true, in_array( $type, (array) $args['selected'] ), false );
2665
+ $selected = selected( true, in_array( $type, (array) $args['selected'] ), false );
2666
+
2667
+ if ( 'select' == $output )
2668
+ printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $type ), $selected, esc_html( $description ) );
2669
+
2670
+ elseif ( 'checkbox' == $output )
2671
+ printf( '<label style="">%1$s<input type="checkbox" name="%2$s[]" value="%3$s" %4$s/></label>', esc_html( $description ), esc_attr( $args['checkbox_name'] ), esc_attr( $type ), $checked );
2672
+
2673
+ // Allow custom markup
2674
+ do_action( 'bp_activity_types_list_' . $output, $args, $type, $description );
2675
+ }
2676
+
2677
+ // Backpat with BP-Default for dropdown boxes only
2678
+ if ( 'select' == $output )
2679
+ do_action( 'bp_activity_filter_options' );
2680
+ }
2681
+
2682
+
2683
  /* RSS Feed Template Tags ****************************************************/
2684
 
2685
  /**
2956
  <?php
2957
  }
2958
  add_action( 'bp_head', 'bp_activity_sitewide_feed' );
 
 
bp-activity/feeds/bp-activity-favorites-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -31,7 +30,7 @@ header('Status: 200 OK');
31
  <description><?php printf( __( '%s - Favorite Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
- <language><?php echo get_option('rss_language'); ?></language>
35
 
36
  <?php do_action('bp_activity_favorites_feed_head'); ?>
37
 
12
 
13
  header('Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
30
  <description><?php printf( __( '%s - Favorite Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
31
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
 
35
  <?php do_action('bp_activity_favorites_feed_head'); ?>
36
 
bp-activity/feeds/bp-activity-friends-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -31,7 +30,7 @@ header('Status: 200 OK');
31
  <description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ); ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION; ?></generator>
34
- <language><?php echo get_option('rss_language'); ?></language>
35
  <?php do_action('bp_activity_friends_feed_head'); ?>
36
 
37
  <?php if ( bp_has_activities( 'scope=friends&max=50&display_comments=stream' ) ) : ?>
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
30
  <description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ); ?></description>
31
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION; ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
  <?php do_action('bp_activity_friends_feed_head'); ?>
35
 
36
  <?php if ( bp_has_activities( 'scope=friends&max=50&display_comments=stream' ) ) : ?>
bp-activity/feeds/bp-activity-group-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -31,7 +30,7 @@ header('Status: 200 OK');
31
  <description><?php printf( __( '%s - Group Activity Feed', 'buddypress' ), $bp->groups->current_group->name ) ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
- <language><?php echo get_option('rss_language'); ?></language>
35
  <?php do_action('bp_activity_group_feed_head'); ?>
36
 
37
  <?php if ( bp_has_activities( 'object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id . '&max=50&display_comments=threaded' ) ) : ?>
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
30
  <description><?php printf( __( '%s - Group Activity Feed', 'buddypress' ), $bp->groups->current_group->name ) ?></description>
31
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
  <?php do_action('bp_activity_group_feed_head'); ?>
35
 
36
  <?php if ( bp_has_activities( 'object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id . '&max=50&display_comments=threaded' ) ) : ?>
bp-activity/feeds/bp-activity-mentions-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -32,7 +31,7 @@ header('Status: 200 OK');
32
  <description><?php printf( __( '%s - Mentions', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
33
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
34
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
35
- <language><?php echo get_option('rss_language'); ?></language>
36
  <?php do_action('bp_activity_mentions_feed_head'); ?>
37
 
38
  <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id() ) ) ) : ?>
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
31
  <description><?php printf( __( '%s - Mentions', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
+ <language><?php bloginfo_rss( 'language' ); ?></language>
35
  <?php do_action('bp_activity_mentions_feed_head'); ?>
36
 
37
  <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id() ) ) ) : ?>
bp-activity/feeds/bp-activity-mygroups-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -32,7 +31,7 @@ header('Status: 200 OK');
32
  <description><?php printf( __( '%1$s - My Groups - Public Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
33
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
34
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
35
- <language><?php echo get_option('rss_language'); ?></language>
36
  <?php do_action('bp_activity_mygroups_feed_head'); ?>
37
 
38
  <?php
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
31
  <description><?php printf( __( '%1$s - My Groups - Public Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
+ <language><?php bloginfo_rss( 'language' ); ?></language>
35
  <?php do_action('bp_activity_mygroups_feed_head'); ?>
36
 
37
  <?php
bp-activity/feeds/bp-activity-personal-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -31,7 +30,7 @@ header('Status: 200 OK');
31
  <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
- <language><?php echo get_option('rss_language'); ?></language>
35
  <?php do_action('bp_activity_personal_feed_head'); ?>
36
 
37
  <?php if ( bp_has_activities( 'user_id=' . bp_displayed_user_id() . '&max=50&display_comments=stream' ) ) : ?>
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
30
  <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
31
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
  <?php do_action('bp_activity_personal_feed_head'); ?>
35
 
36
  <?php if ( bp_has_activities( 'user_id=' . bp_displayed_user_id() . '&max=50&display_comments=stream' ) ) : ?>
bp-activity/feeds/bp-activity-sitewide-feed.php CHANGED
@@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
- ?>
16
- <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
17
 
18
  <rss version="2.0"
19
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -31,7 +30,7 @@ header('Status: 200 OK');
31
  <description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description>
32
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
- <language><?php echo get_option('rss_language'); ?></language>
35
  <?php do_action('bp_activity_sitewide_feed_head'); ?>
36
 
37
  <?php if ( bp_has_activities( 'type=sitewide&max=50&display_comments=threaded' ) ) : ?>
12
 
13
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
  header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 
16
 
17
  <rss version="2.0"
18
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
30
  <description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description>
31
  <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
  <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
  <?php do_action('bp_activity_sitewide_feed_head'); ?>
35
 
36
  <?php if ( bp_has_activities( 'type=sitewide&max=50&display_comments=threaded' ) ) : ?>
bp-blogs/bp-blogs-actions.php CHANGED
@@ -34,5 +34,3 @@ function bp_blogs_redirect_to_random_blog() {
34
  }
35
  }
36
  add_action( 'bp_actions', 'bp_blogs_redirect_to_random_blog' );
37
-
38
- ?>
34
  }
35
  }
36
  add_action( 'bp_actions', 'bp_blogs_redirect_to_random_blog' );
 
 
bp-blogs/bp-blogs-activity.php CHANGED
@@ -17,7 +17,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
17
  * @package BuddyPress
18
  * @subpackage BlogsActivity
19
  * @global type $bp
20
- * @return boolean
21
  */
22
  function bp_blogs_register_activity_actions() {
23
  global $bp;
@@ -42,7 +42,7 @@ add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions'
42
  * @subpackage BlogsActivity
43
  * @global BuddyPress $bp
44
  * @param array $args
45
- * @return boolean
46
  */
47
  function bp_blogs_record_activity( $args = '' ) {
48
  global $bp;
@@ -125,5 +125,3 @@ function bp_blogs_delete_activity( $args = true ) {
125
  'secondary_item_id' => $secondary_item_id
126
  ) );
127
  }
128
-
129
- ?>
17
  * @package BuddyPress
18
  * @subpackage BlogsActivity
19
  * @global type $bp
20
+ * @return boolean
21
  */
22
  function bp_blogs_register_activity_actions() {
23
  global $bp;
42
  * @subpackage BlogsActivity
43
  * @global BuddyPress $bp
44
  * @param array $args
45
+ * @return boolean
46
  */
47
  function bp_blogs_record_activity( $args = '' ) {
48
  global $bp;
125
  'secondary_item_id' => $secondary_item_id
126
  ) );
127
  }
 
 
bp-blogs/bp-blogs-buddybar.php CHANGED
@@ -17,9 +17,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
17
  * @package BuddyPress
18
  * @subpackage BlogsBuddyBar
19
  * @global BuddyPress $bp
20
- * @return boolean
21
  */
22
-
23
  function bp_adminbar_blogs_menu() {
24
  global $bp;
25
 
@@ -77,5 +77,3 @@ function bp_adminbar_blogs_menu() {
77
  }
78
  }
79
  add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
80
-
81
- ?>
17
  * @package BuddyPress
18
  * @subpackage BlogsBuddyBar
19
  * @global BuddyPress $bp
20
+ * @return boolean
21
  */
22
+
23
  function bp_adminbar_blogs_menu() {
24
  global $bp;
25
 
77
  }
78
  }
79
  add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
 
 
bp-blogs/bp-blogs-cache.php CHANGED
@@ -7,7 +7,7 @@
7
  * actions throughout BuddyPress.
8
  *
9
  * @package BuddyPress
10
- * @subpackage BlogsBuddyBar
11
  */
12
 
13
  // Exit if accessed directly
@@ -18,9 +18,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
18
  *
19
  * @since BuddyPress (1.0)
20
  * @package BuddyPress
21
- * @subpackage BlogsBuddyBar
22
  * @param int $blog_id
23
- * @param int $user_id
24
  */
25
  function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) {
26
  wp_cache_delete( 'bp_blogs_of_user_' . $user_id, 'bp' );
@@ -32,8 +32,8 @@ function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) {
32
  *
33
  * @since BuddyPress (1.0)
34
  * @package BuddyPress
35
- * @subpackage BlogsBuddyBar
36
- * @param Blog $recorded_blog_obj
37
  */
38
  function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) {
39
  bp_blogs_clear_blog_object_cache( false, $recorded_blog_obj->user_id );
@@ -54,5 +54,3 @@ add_action( 'bp_blogs_new_blog_comment', 'bp_core_clear_cache' );
54
  add_action( 'bp_blogs_new_blog_post', 'bp_core_clear_cache' );
55
  add_action( 'bp_blogs_new_blog', 'bp_core_clear_cache' );
56
  add_action( 'bp_blogs_remove_data', 'bp_core_clear_cache' );
57
-
58
- ?>
7
  * actions throughout BuddyPress.
8
  *
9
  * @package BuddyPress
10
+ * @subpackage BlogsCache
11
  */
12
 
13
  // Exit if accessed directly
18
  *
19
  * @since BuddyPress (1.0)
20
  * @package BuddyPress
21
+ * @subpackage BlogsCache
22
  * @param int $blog_id
23
+ * @param int $user_id
24
  */
25
  function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) {
26
  wp_cache_delete( 'bp_blogs_of_user_' . $user_id, 'bp' );
32
  *
33
  * @since BuddyPress (1.0)
34
  * @package BuddyPress
35
+ * @subpackage BlogsCache
36
+ * @param Blog $recorded_blog_obj
37
  */
38
  function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) {
39
  bp_blogs_clear_blog_object_cache( false, $recorded_blog_obj->user_id );
54
  add_action( 'bp_blogs_new_blog_post', 'bp_core_clear_cache' );
55
  add_action( 'bp_blogs_new_blog', 'bp_core_clear_cache' );
56
  add_action( 'bp_blogs_remove_data', 'bp_core_clear_cache' );
 
 
bp-blogs/bp-blogs-classes.php CHANGED
@@ -201,10 +201,11 @@ class BP_Blogs_Blog {
201
  $user_id = bp_displayed_user_id();
202
 
203
  // If the user is logged in return the blog count including their hidden blogs.
204
- if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) )
205
- return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
206
- else
207
- return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
 
208
  }
209
 
210
  function search_blogs( $filter, $limit = null, $page = null ) {
@@ -215,8 +216,9 @@ class BP_Blogs_Blog {
215
  if ( !bp_current_user_can( 'bp_moderate' ) )
216
  $hidden_sql = "AND wb.public = 1";
217
 
218
- if ( $limit && $page )
219
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
220
 
221
  $paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC{$pag_sql}" );
222
  $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" );
@@ -261,7 +263,35 @@ class BP_Blogs_Blog {
261
 
262
  for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
263
  $blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id );
264
- $paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT post_title, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  }
266
 
267
  /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
@@ -286,5 +316,3 @@ class BP_Blogs_Blog {
286
  return false;
287
  }
288
  }
289
-
290
- ?>
201
  $user_id = bp_displayed_user_id();
202
 
203
  // If the user is logged in return the blog count including their hidden blogs.
204
+ if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) ) {
205
+ return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) );
206
+ } else {
207
+ return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) );
208
+ }
209
  }
210
 
211
  function search_blogs( $filter, $limit = null, $page = null ) {
216
  if ( !bp_current_user_can( 'bp_moderate' ) )
217
  $hidden_sql = "AND wb.public = 1";
218
 
219
+ if ( $limit && $page ) {
220
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
221
+ }
222
 
223
  $paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC{$pag_sql}" );
224
  $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" );
263
 
264
  for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
265
  $blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id );
266
+ $paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT ID, post_content, post_title, post_excerpt, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" );
267
+ $images = array();
268
+
269
+ // Add URLs to any Featured Image this post might have
270
+ if ( ! empty( $paged_blogs[$i]->latest_post ) && has_post_thumbnail( $paged_blogs[$i]->latest_post->ID ) ) {
271
+
272
+ // Grab 4 sizes of the image. Thumbnail.
273
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'thumbnail', false );
274
+ if ( ! empty( $image ) )
275
+ $images['thumbnail'] = $image[0];
276
+
277
+ // Medium
278
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'medium', false );
279
+ if ( ! empty( $image ) )
280
+ $images['medium'] = $image[0];
281
+
282
+ // Large
283
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'large', false );
284
+ if ( ! empty( $image ) )
285
+ $images['large'] = $image[0];
286
+
287
+ // Post thumbnail
288
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'post-thumbnail', false );
289
+ if ( ! empty( $image ) )
290
+ $images['post-thumbnail'] = $image[0];
291
+
292
+ // Add the images to the latest_post object
293
+ $paged_blogs[$i]->latest_post->images = $images;
294
+ }
295
  }
296
 
297
  /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
316
  return false;
317
  }
318
  }
 
 
bp-blogs/bp-blogs-filters.php CHANGED
@@ -5,22 +5,32 @@
5
  *
6
  * @package BuddyPress
7
  * @subpackage Blogs
8
- * @since 1.6
9
  */
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  /**
12
  * Ensures that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup
13
  *
14
- * @since 1.6
15
  * @uses apply_filters() Filter bp_blogs_creation_location to alter the returned value
16
  *
17
  * @param string $url The original URL (points to wp-signup.php by default)
18
  * @return string The new URL
19
  */
20
  function bp_blogs_creation_location( $url ) {
21
- return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_slug() . '/create', $url ) );
22
  }
23
  add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
24
-
25
-
26
- ?>
5
  *
6
  * @package BuddyPress
7
  * @subpackage Blogs
8
+ * @since BuddyPress (1.6)
9
  */
10
 
11
+ // Display filters
12
+
13
+ add_filter( 'bp_get_blog_latest_post_title', 'wptexturize' );
14
+ add_filter( 'bp_get_blog_latest_post_title', 'convert_chars' );
15
+ add_filter( 'bp_get_blog_latest_post_title', 'trim' );
16
+
17
+ add_filter( 'bp_blog_latest_post_content', 'wptexturize' );
18
+ add_filter( 'bp_blog_latest_post_content', 'convert_smilies' );
19
+ add_filter( 'bp_blog_latest_post_content', 'convert_chars' );
20
+ add_filter( 'bp_blog_latest_post_content', 'wpautop' );
21
+ add_filter( 'bp_blog_latest_post_content', 'shortcode_unautop' );
22
+ add_filter( 'bp_blog_latest_post_content', 'prepend_attachment' );
23
+
24
  /**
25
  * Ensures that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup
26
  *
27
+ * @since BuddyPress (1.6)
28
  * @uses apply_filters() Filter bp_blogs_creation_location to alter the returned value
29
  *
30
  * @param string $url The original URL (points to wp-signup.php by default)
31
  * @return string The new URL
32
  */
33
  function bp_blogs_creation_location( $url ) {
34
+ return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) );
35
  }
36
  add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
 
 
 
bp-blogs/bp-blogs-functions.php CHANGED
@@ -48,27 +48,87 @@ function bp_blogs_record_existing_blogs() {
48
  // Truncate user blogs table and re-record.
49
  $wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
50
 
51
- if ( is_multisite() )
52
- $blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" );
53
- else
54
  $blog_ids = 1;
 
55
 
56
- if ( $blog_ids ) {
57
  foreach( (array) $blog_ids as $blog_id ) {
58
- $users = get_users( array( 'blog_id' => $blog_id ) );
59
- $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) );
60
 
61
  if ( !empty( $users ) ) {
62
  foreach ( (array) $users as $user ) {
63
  // Don't record blogs for subscribers
64
- if ( !in_array( $user, $subscribers ) )
65
  bp_blogs_record_blog( $blog_id, $user->ID, true );
 
66
  }
67
  }
68
  }
69
  }
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * Makes BuddyPress aware of a new site so that it can track its activity.
74
  *
@@ -83,7 +143,11 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
83
  if ( empty( $user_id ) )
84
  $user_id = bp_loggedin_user_id();
85
 
86
- $name = get_blog_option( $blog_id, 'blogname' );
 
 
 
 
87
  $description = get_blog_option( $blog_id, 'blogdescription' );
88
 
89
  if ( empty( $name ) )
@@ -103,7 +167,8 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
103
  $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private );
104
 
105
  // Only record this activity if the blog is public
106
- if ( !$is_private && !$no_activity ) {
 
107
  // Record this in activity streams
108
  bp_blogs_record_activity( array(
109
  'user_id' => $recorded_blog->user_id,
@@ -152,6 +217,10 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
152
  $post_id = (int) $post_id;
153
  $blog_id = (int) $wpdb->blogid;
154
 
 
 
 
 
155
  if ( !$user_id )
156
  $user_id = (int) $post->post_author;
157
 
@@ -175,7 +244,7 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
175
 
176
  if ( 'publish' == $post->post_status && empty( $post->post_password ) ) {
177
  if ( $is_blog_public || !is_multisite() ) {
178
-
179
  // Record this in activity streams
180
  $post_permalink = get_permalink( $post_id );
181
 
@@ -194,7 +263,7 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
194
  'secondary_id' => $post_id,
195
  )
196
  ) );
197
-
198
  if ( !empty( $existing['activities'] ) ) {
199
  return;
200
  }
@@ -259,7 +328,12 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
259
  $user_id = (int) $user->ID;
260
 
261
  // Get blog and post data
262
- $blog_id = get_current_blog_id();
 
 
 
 
 
263
  $recorded_comment->post = get_post( $recorded_comment->comment_post_ID );
264
 
265
  if ( empty( $recorded_comment->post ) || is_wp_error( $recorded_comment->post ) )
@@ -313,7 +387,7 @@ add_action( 'edit_comment', 'bp_blogs_record_comment', 10 );
313
 
314
  function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
315
  global $wpdb;
316
-
317
  if ( empty( $blog_id ) ) {
318
  $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
319
  }
@@ -353,7 +427,7 @@ add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
353
  * Blogs component. This function bumps the priority of the core function, so that we can be sure
354
  * that the Blogs component is loaded first. See http://buddypress.trac.wordpress.org/ticket/3916
355
  *
356
- * @since 1.6
357
  */
358
  function bp_blogs_maybe_add_user_to_blog() {
359
  if ( ! is_multisite() )
@@ -440,7 +514,7 @@ add_action( 'delete_comment', 'bp_blogs_remove_comment' );
440
  * @param string $new_status New comment status.
441
  * @param string $old_status Previous comment status.
442
  * @param object $comment Comment data.
443
- * @since 1.6
444
  */
445
  function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) {
446
  global $bp;
@@ -608,7 +682,7 @@ function bp_blogs_get_blogmeta( $blog_id, $meta_key = '') {
608
  wp_cache_set( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, $metas, 'bp' );
609
  }
610
  } else {
611
- $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id) );
612
  }
613
 
614
  if ( empty($metas) ) {
@@ -670,5 +744,3 @@ function bp_blogs_remove_data( $user_id ) {
670
  add_action( 'wpmu_delete_user', 'bp_blogs_remove_data' );
671
  add_action( 'delete_user', 'bp_blogs_remove_data' );
672
  add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' );
673
-
674
- ?>
48
  // Truncate user blogs table and re-record.
49
  $wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
50
 
51
+ if ( is_multisite() ) {
52
+ $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d" ), $wpdb->siteid );
53
+ } else {
54
  $blog_ids = 1;
55
+ }
56
 
57
+ if ( !empty( $blog_ids ) ) {
58
  foreach( (array) $blog_ids as $blog_id ) {
59
+ $users = get_users( array( 'blog_id' => $blog_id ) );
60
+ $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) );
61
 
62
  if ( !empty( $users ) ) {
63
  foreach ( (array) $users as $user ) {
64
  // Don't record blogs for subscribers
65
+ if ( !in_array( $user, $subscribers ) ) {
66
  bp_blogs_record_blog( $blog_id, $user->ID, true );
67
+ }
68
  }
69
  }
70
  }
71
  }
72
  }
73
 
74
+ /**
75
+ * Makes BuddyPress aware of sites that shouldn't be recorded to activity streams.
76
+ *
77
+ * If $user_id is provided, you can restrict site from being recordable
78
+ * only to particular users.
79
+ *
80
+ * @since BuddyPress (1.7)
81
+ * @param int $blog_id
82
+ * @param int|null $user_id
83
+ * @uses apply_filters()
84
+ * @return bool True if blog is recordable, false elsewhere
85
+ */
86
+ function bp_blogs_is_blog_recordable( $blog_id, $user_id = 0 ) {
87
+
88
+ $recordable_globally = apply_filters( 'bp_blogs_is_blog_recordable', true, $blog_id );
89
+
90
+ if ( !empty( $user_id ) ) {
91
+ $recordable_for_user = apply_filters( 'bp_blogs_is_blog_recordable_for_user', $recordable_globally, $blog_id, $user_id );
92
+ } else {
93
+ $recordable_for_user = $recordable_globally;
94
+ }
95
+
96
+ if ( !empty( $recordable_for_user ) ) {
97
+ return true;
98
+ }
99
+
100
+ return $recordable_globally;
101
+ }
102
+
103
+ /**
104
+ * Makes BuddyPress aware of sites that activities shouldn't be trackable.
105
+ * If $user_id is provided, the developer can restrict site from
106
+ * being trackable only to particular users.
107
+ *
108
+ * @since BuddyPress (1.7)
109
+ * @param int $blog_id
110
+ * @param int|null $user_id
111
+ * @uses bp_blogs_is_blog_recordable
112
+ * @uses apply_filters()
113
+ * @return bool True if blog is trackable, false elsewhere
114
+ */
115
+ function bp_blogs_is_blog_trackable( $blog_id, $user_id = 0 ) {
116
+
117
+ $trackable_globally = apply_filters( 'bp_blogs_is_blog_trackable', bp_blogs_is_blog_recordable( $blog_id, $user_id ), $blog_id );
118
+
119
+ if ( !empty( $user_id ) ) {
120
+ $trackable_for_user = apply_filters( 'bp_blogs_is_blog_trackable_for_user', $trackable_globally, $blog_id, $user_id );
121
+ } else {
122
+ $trackable_for_user = $trackable_globally;
123
+ }
124
+
125
+ if ( !empty( $trackable_for_user ) ) {
126
+ return $trackable_for_user;
127
+ }
128
+
129
+ return $trackable_globally;
130
+ }
131
+
132
  /**
133
  * Makes BuddyPress aware of a new site so that it can track its activity.
134
  *
143
  if ( empty( $user_id ) )
144
  $user_id = bp_loggedin_user_id();
145
 
146
+ // If blog is not recordable, do not record the activity.
147
+ if ( !bp_blogs_is_blog_recordable( $blog_id, $user_id ) )
148
+ return false;
149
+
150
+ $name = get_blog_option( $blog_id, 'blogname' );
151
  $description = get_blog_option( $blog_id, 'blogdescription' );
152
 
153
  if ( empty( $name ) )
167
  $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private );
168
 
169
  // Only record this activity if the blog is public
170
+ if ( !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) {
171
+
172
  // Record this in activity streams
173
  bp_blogs_record_activity( array(
174
  'user_id' => $recorded_blog->user_id,
217
  $post_id = (int) $post_id;
218
  $blog_id = (int) $wpdb->blogid;
219
 
220
+ // If blog is not trackable, do not record the activity.
221
+ if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) )
222
+ return false;
223
+
224
  if ( !$user_id )
225
  $user_id = (int) $post->post_author;
226
 
244
 
245
  if ( 'publish' == $post->post_status && empty( $post->post_password ) ) {
246
  if ( $is_blog_public || !is_multisite() ) {
247
+
248
  // Record this in activity streams
249
  $post_permalink = get_permalink( $post_id );
250
 
263
  'secondary_id' => $post_id,
264
  )
265
  ) );
266
+
267
  if ( !empty( $existing['activities'] ) ) {
268
  return;
269
  }
328
  $user_id = (int) $user->ID;
329
 
330
  // Get blog and post data
331
+ $blog_id = get_current_blog_id();
332
+
333
+ // If blog is not trackable, do not record the activity.
334
+ if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) )
335
+ return false;
336
+
337
  $recorded_comment->post = get_post( $recorded_comment->comment_post_ID );
338
 
339
  if ( empty( $recorded_comment->post ) || is_wp_error( $recorded_comment->post ) )
387
 
388
  function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
389
  global $wpdb;
390
+
391
  if ( empty( $blog_id ) ) {
392
  $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
393
  }
427
  * Blogs component. This function bumps the priority of the core function, so that we can be sure
428
  * that the Blogs component is loaded first. See http://buddypress.trac.wordpress.org/ticket/3916
429
  *
430
+ * @since BuddyPress (1.6)
431
  */
432
  function bp_blogs_maybe_add_user_to_blog() {
433
  if ( ! is_multisite() )
514
  * @param string $new_status New comment status.
515
  * @param string $old_status Previous comment status.
516
  * @param object $comment Comment data.
517
+ * @since BuddyPress (1.6)
518
  */
519
  function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) {
520
  global $bp;
682
  wp_cache_set( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, $metas, 'bp' );
683
  }
684
  } else {
685
+ $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id ) );
686
  }
687
 
688
  if ( empty($metas) ) {
744
  add_action( 'wpmu_delete_user', 'bp_blogs_remove_data' );
745
  add_action( 'delete_user', 'bp_blogs_remove_data' );
746
  add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' );
 
 
bp-blogs/bp-blogs-loader.php CHANGED
@@ -115,9 +115,18 @@ class BP_Blogs_Component extends BP_Component {
115
  'default_subnav_slug' => 'my-sites',
116
  'item_css_id' => $this->id
117
  );
118
-
119
- $parent_url = trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() );
120
-
 
 
 
 
 
 
 
 
 
121
  $sub_nav[] = array(
122
  'name' => __( 'My Sites', 'buddypress' ),
123
  'slug' => 'my-sites',
@@ -212,5 +221,3 @@ function bp_setup_blogs() {
212
  $bp->blogs = new BP_Blogs_Component();
213
  }
214
  add_action( 'bp_setup_components', 'bp_setup_blogs', 6 );
215
-
216
- ?>
115
  'default_subnav_slug' => 'my-sites',
116
  'item_css_id' => $this->id
117
  );
118
+
119
+ // Determine user to use
120
+ if ( bp_displayed_user_domain() ) {
121
+ $user_domain = bp_displayed_user_domain();
122
+ } elseif ( bp_loggedin_user_domain() ) {
123
+ $user_domain = bp_loggedin_user_domain();
124
+ } else {
125
+ return;
126
+ }
127
+
128
+ $parent_url = trailingslashit( $user_domain . bp_get_blogs_slug() );
129
+
130
  $sub_nav[] = array(
131
  'name' => __( 'My Sites', 'buddypress' ),
132
  'slug' => 'my-sites',
221
  $bp->blogs = new BP_Blogs_Component();
222
  }
223
  add_action( 'bp_setup_components', 'bp_setup_blogs', 6 );
 
 
bp-blogs/bp-blogs-screens.php CHANGED
@@ -20,6 +20,7 @@ function bp_blogs_screen_my_blogs() {
20
  }
21
 
22
  function bp_blogs_screen_create_a_blog() {
 
23
  if ( !is_multisite() || !bp_is_blogs_component() || !bp_is_current_action( 'create' ) )
24
  return false;
25
 
@@ -43,4 +44,132 @@ function bp_blogs_screen_index() {
43
  }
44
  add_action( 'bp_screens', 'bp_blogs_screen_index', 2 );
45
 
46
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
 
22
  function bp_blogs_screen_create_a_blog() {
23
+
24
  if ( !is_multisite() || !bp_is_blogs_component() || !bp_is_current_action( 'create' ) )
25
  return false;
26
 
44
  }
45
  add_action( 'bp_screens', 'bp_blogs_screen_index', 2 );
46
 
47
+ /** Theme Compatability *******************************************************/
48
+
49
+ /**
50
+ * The main theme compat class for BuddyPress Activity
51
+ *
52
+ * This class sets up the necessary theme compatability actions to safely output
53
+ * group template parts to the_title and the_content areas of a theme.
54
+ *
55
+ * @since BuddyPress (1.7)
56
+ */
57
+ class BP_Blogs_Theme_Compat {
58
+
59
+ /**
60
+ * Setup the groups component theme compatibility
61
+ *
62
+ * @since BuddyPress (1.7)
63
+ */
64
+ public function __construct() {
65
+ add_action( 'bp_setup_theme_compat', array( $this, 'is_blogs' ) );
66
+ }
67
+
68
+ /**
69
+ * Are we looking at something that needs group theme compatability?
70
+ *
71
+ * @since BuddyPress (1.7)
72
+ */
73
+ public function is_blogs() {
74
+
75
+ // Bail if not looking at a group
76
+ if ( ! bp_is_blogs_component() )
77
+ return;
78
+
79
+ // Bail if looking at a users sites
80
+ if ( bp_is_user() )
81
+ return;
82
+
83
+ // Blog Directory
84
+ if ( is_multisite() && ! bp_current_action() ) {
85
+ bp_update_is_directory( true, 'blogs' );
86
+
87
+ do_action( 'bp_blogs_screen_index' );
88
+
89
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
90
+ add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) );
91
+
92
+ // Create blog
93
+ } elseif ( is_user_logged_in() && bp_blog_signup_enabled() ) {
94
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) );
95
+ add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) );
96
+ }
97
+ }
98
+
99
+ /** Directory *************************************************************/
100
+
101
+ /**
102
+ * Update the global $post with directory data
103
+ *
104
+ * @since BuddyPress (1.7)
105
+ */
106
+ public function directory_dummy_post() {
107
+
108
+ // Title based on ability to create blogs
109
+ if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
110
+ $title = __( 'Blogs', 'buddypress' ) . '&nbsp;<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create' ) . '">' . __( 'Create a Blog', 'buddypress' ) . '</a>';
111
+ } else {
112
+ $title = __( 'Blogs', 'buddypress' );
113
+ }
114
+
115
+ bp_theme_compat_reset_post( array(
116
+ 'ID' => 0,
117
+ 'post_title' => $title,
118
+ 'post_author' => 0,
119
+ 'post_date' => 0,
120
+ 'post_content' => '',
121
+ 'post_type' => 'bp_blogs',
122
+ 'post_status' => 'publish',
123
+ 'is_archive' => true,
124
+ 'comment_status' => 'closed'
125
+ ) );
126
+ }
127
+
128
+ /**
129
+ * Filter the_content with the groups index template part
130
+ *
131
+ * @since BuddyPress (1.7)
132
+ */
133
+ public function directory_content() {
134
+ bp_buffer_template_part( 'blogs/index' );
135
+ }
136
+
137
+ /** Create ****************************************************************/
138
+
139
+ /**
140
+ * Update the global $post with create screen data
141
+ *
142
+ * @since BuddyPress (1.7)
143
+ */
144
+ public function create_dummy_post() {
145
+
146
+ // Title based on ability to create blogs
147
+ if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
148
+ $title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Blogs', 'buddypress' ) . '</a>&nbsp;' . __( 'Create a Blog', 'buddypress' );
149
+ } else {
150
+ $title = __( 'Blogs', 'buddypress' );
151
+ }
152
+
153
+ bp_theme_compat_reset_post( array(
154
+ 'ID' => 0,
155
+ 'post_title' => $title,
156
+ 'post_author' => 0,
157
+ 'post_date' => 0,
158
+ 'post_content' => '',
159
+ 'post_type' => 'bp_group',
160
+ 'post_status' => 'publish',
161
+ 'is_archive' => true,
162
+ 'comment_status' => 'closed'
163
+ ) );
164
+ }
165
+
166
+ /**
167
+ * Filter the_content with the create screen template part
168
+ *
169
+ * @since BuddyPress (1.7)
170
+ */
171
+ public function create_content() {
172
+ bp_buffer_template_part( 'blogs/create' );
173
+ }
174
+ }
175
+ new BP_Blogs_Theme_Compat();
bp-blogs/bp-blogs-template.php CHANGED
@@ -30,8 +30,7 @@ function bp_blogs_slug() {
30
  * @since BuddyPress (1.5)
31
  */
32
  function bp_get_blogs_slug() {
33
- global $bp;
34
- return apply_filters( 'bp_get_blogs_slug', $bp->blogs->slug );
35
  }
36
 
37
  /**
@@ -54,8 +53,7 @@ function bp_blogs_root_slug() {
54
  * @since BuddyPress (1.5)
55
  */
56
  function bp_get_blogs_root_slug() {
57
- global $bp;
58
- return apply_filters( 'bp_get_blogs_root_slug', $bp->blogs->root_slug );
59
  }
60
 
61
  /**
@@ -332,6 +330,26 @@ function bp_blog_name() {
332
  return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name );
333
  }
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  function bp_blog_description() {
336
  echo apply_filters( 'bp_blog_description', bp_get_blog_description() );
337
  }
@@ -341,6 +359,41 @@ function bp_blog_description() {
341
  return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description );
342
  }
343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  function bp_blog_last_active() {
345
  echo bp_get_blog_last_active();
346
  }
@@ -356,12 +409,143 @@ function bp_blog_latest_post() {
356
  function bp_get_blog_latest_post() {
357
  global $blogs_template;
358
 
359
- if ( null == $blogs_template->blog->latest_post )
360
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
 
362
- return apply_filters( 'bp_get_blog_latest_post', sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $blogs_template->blog->latest_post->post_title ) . '</a>' ) );
363
  }
364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  function bp_blog_hidden_fields() {
366
  if ( isset( $_REQUEST['s'] ) )
367
  echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ). '" name="search_terms" />';
@@ -461,9 +645,9 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
461
  <?php }
462
 
463
  if ( !is_subdomain_install() )
464
- echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
465
  else
466
- echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
467
 
468
  if ( !is_user_logged_in() ) {
469
  print '(<strong>' . __( 'Your address will be ' , 'buddypress');
@@ -511,7 +695,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
511
  /**
512
  * Echo the value of bp_blogs_get_subdomain_base()
513
  *
514
- * @since 1.6
515
  */
516
  function bp_blogs_subdomain_base() {
517
  echo bp_blogs_get_subdomain_base();
@@ -520,7 +704,7 @@ function bp_blogs_subdomain_base() {
520
  * Return the base URL to be displayed when a user chooses an address for a new blog, on
521
  * a subdomain installation of WordPress MS
522
  *
523
- * @since 1.6
524
  * @return str The base URL - eg, 'example.com' for site_url() example.com or www.example.com
525
  */
526
  function bp_blogs_get_subdomain_base() {
@@ -604,6 +788,8 @@ function bp_blogs_blog_tabs() {
604
  </ul>
605
 
606
  <?php
 
 
607
  do_action( 'bp_blogs_blog_tabs', $current_tab );
608
  }
609
 
@@ -656,5 +842,3 @@ function bp_blogs_visit_blog_button( $args = '' ) {
656
  // Filter and return the HTML button
657
  return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
658
  }
659
-
660
- ?>
30
  * @since BuddyPress (1.5)
31
  */
32
  function bp_get_blogs_slug() {
33
+ return apply_filters( 'bp_get_blogs_slug', buddypress()->blogs->slug );
 
34
  }
35
 
36
  /**
53
  * @since BuddyPress (1.5)
54
  */
55
  function bp_get_blogs_root_slug() {
56
+ return apply_filters( 'bp_get_blogs_root_slug', buddypress()->blogs->root_slug );
 
57
  }
58
 
59
  /**
330
  return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name );
331
  }
332
 
333
+ /**
334
+ * Outputs the blog ID
335
+ *
336
+ * @since BuddyPress (1.7)
337
+ */
338
+ function bp_blog_id() {
339
+ echo bp_get_blog_id();
340
+ }
341
+ /**
342
+ * Returns the blog ID
343
+ *
344
+ * @return int
345
+ * @since BuddyPress (1.7)
346
+ */
347
+ function bp_get_blog_id() {
348
+ global $blogs_template;
349
+
350
+ return apply_filters( 'bp_get_blog_id', $blogs_template->blog->blog_id );
351
+ }
352
+
353
  function bp_blog_description() {
354
  echo apply_filters( 'bp_blog_description', bp_get_blog_description() );
355
  }
359
  return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description );
360
  }
361
 
362
+
363
+ /**
364
+ * Output the row class of a site
365
+ *
366
+ * @since BuddyPress (1.7)
367
+ */
368
+ function bp_blog_class() {
369
+ echo bp_get_blog_class();
370
+ }
371
+ /**
372
+ * Return the row class of a site
373
+ *
374
+ * @global BP_Blogs_Template $blogs_template
375
+ * @return string Row class of the site
376
+ * @since BuddyPress (1.7)
377
+ */
378
+ function bp_get_blog_class() {
379
+ global $blogs_template;
380
+
381
+ $classes = array();
382
+ $pos_in_loop = (int) $blogs_template->current_blog;
383
+
384
+ // If we've only one site in the loop, don't bother with odd and even.
385
+ if ( $blogs_template->blog_count > 1 )
386
+ $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
387
+ else
388
+ $classes[] = 'bp-single-blog';
389
+
390
+ $classes = apply_filters( 'bp_get_blog_class', $classes );
391
+ $classes = array_merge( $classes, array() );
392
+
393
+ $retval = 'class="' . join( ' ', $classes ) . '"';
394
+ return $retval;
395
+ }
396
+
397
  function bp_blog_last_active() {
398
  echo bp_get_blog_last_active();
399
  }
409
  function bp_get_blog_latest_post() {
410
  global $blogs_template;
411
 
412
+ $retval = bp_get_blog_latest_post_title();
413
+
414
+ if ( ! empty( $retval ) )
415
+ $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' );
416
+
417
+ return apply_filters( 'bp_get_blog_latest_post', $retval );
418
+ }
419
+
420
+ /**
421
+ * Prints this site's latest article's title
422
+ *
423
+ * @since BuddyPress (1.7)
424
+ *
425
+ * @see bp_get_blog_latest_post_title()
426
+ */
427
+ function bp_blog_latest_post_title() {
428
+ echo bp_get_blog_latest_post_title();
429
+ }
430
+ /**
431
+ * Returns this site's latest article's title
432
+ *
433
+ * @since BuddyPress (1.7)
434
+ *
435
+ * @global BP_Blogs_Template
436
+ * @return string
437
+ */
438
+ function bp_get_blog_latest_post_title() {
439
+ global $blogs_template;
440
+
441
+ $retval = '';
442
+
443
+ if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_title ) )
444
+ $retval = $blogs_template->blog->latest_post->post_title;
445
+
446
+ return apply_filters( 'bp_get_blog_latest_post_title', $retval );
447
+ }
448
+
449
+ /**
450
+ * Prints this site's latest article's permalink
451
+ *
452
+ * @see bp_get_blog_latest_post_title()
453
+ * @since BuddyPress (1.7)
454
+ */
455
+ function bp_blog_latest_post_permalink() {
456
+ echo bp_get_blog_latest_post_permalink();
457
+ }
458
+ /**
459
+ * Returns this site's latest article's permalink
460
+ *
461
+ * @global BP_Blogs_Template
462
+ * @return string
463
+ * @since BuddyPress (1.7)
464
+ */
465
+ function bp_get_blog_latest_post_permalink() {
466
+ global $blogs_template;
467
+
468
+ $retval = '';
469
+
470
+ if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->ID ) )
471
+ $retval = add_query_arg( 'p', $blogs_template->blog->latest_post->ID, bp_get_blog_permalink() );
472
+
473
+ return apply_filters( 'bp_get_blog_latest_post_permalink', $retval );
474
+ }
475
+
476
+ /**
477
+ * Prints this site's latest article's content
478
+ *
479
+ * @since BuddyPress (1.7)
480
+ *
481
+ * @uses bp_get_blog_latest_post_content()
482
+ */
483
+ function bp_blog_latest_post_content() {
484
+ echo bp_get_blog_latest_post_content();
485
+ }
486
+ /**
487
+ * Returns this site's latest article's content
488
+ *
489
+ * @since BuddyPress (1.7)
490
+ *
491
+ * @global BP_Blogs_Template
492
+ * @return string
493
+ */
494
+ function bp_get_blog_latest_post_content() {
495
+ global $blogs_template;
496
+
497
+ $retval = '';
498
+
499
+ if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_content ) )
500
+ $retval = $blogs_template->blog->latest_post->post_content;
501
 
502
+ return apply_filters( 'bp_get_blog_latest_post_content', $retval );
503
  }
504
 
505
+ /**
506
+ * Prints this site's latest article's featured image
507
+ *
508
+ * @since BuddyPress (1.7)
509
+ *
510
+ * @param string $size Image version to return. Either "thumbnail", "medium", "large", "post-thumbnail".
511
+ * @see bp_get_blog_latest_post_content()
512
+ */
513
+ function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) {
514
+ echo bp_get_blog_latest_post_featured_image( $size );
515
+ }
516
+ /**
517
+ * Returns this site's latest article's featured image
518
+ *
519
+ * @since BuddyPress (1.7)
520
+ *
521
+ * @global BP_Blogs_Template
522
+ * @param string $size Image version to return. Either "thumbnail", "medium", "large", "post-thumbnail".
523
+ * @return string
524
+ */
525
+ function bp_get_blog_latest_post_featured_image( $size = 'thumbnail' ) {
526
+ global $blogs_template;
527
+
528
+ $retval = '';
529
+
530
+ if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->images[$size] ) )
531
+ $retval = $blogs_template->blog->latest_post->images[$size];
532
+
533
+ return apply_filters( 'bp_get_blog_latest_post_featured_image', $retval );
534
+ }
535
+
536
+ /**
537
+ * Does the latest blog post have a featured image?
538
+ *
539
+ * @param string $size Image version to check for. Either "thumbnail", "medium", "large", "post-thumbnail".
540
+ * @return bool
541
+ * @since BuddyPress (1.7)
542
+ */
543
+ function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) {
544
+ $image = bp_get_blog_latest_post_featured_image( $thumbnail );
545
+
546
+ return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image );
547
+ }
548
+
549
  function bp_blog_hidden_fields() {
550
  if ( isset( $_REQUEST['s'] ) )
551
  echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ). '" name="search_terms" />';
645
  <?php }
646
 
647
  if ( !is_subdomain_install() )
648
+ echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />';
649
  else
650
+ echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
651
 
652
  if ( !is_user_logged_in() ) {
653
  print '(<strong>' . __( 'Your address will be ' , 'buddypress');
695
  /**
696
  * Echo the value of bp_blogs_get_subdomain_base()
697
  *
698
+ * @since BuddyPress (1.6)
699
  */
700
  function bp_blogs_subdomain_base() {
701
  echo bp_blogs_get_subdomain_base();
704
  * Return the base URL to be displayed when a user chooses an address for a new blog, on
705
  * a subdomain installation of WordPress MS
706
  *
707
+ * @since BuddyPress (1.6)
708
  * @return str The base URL - eg, 'example.com' for site_url() example.com or www.example.com
709
  */
710
  function bp_blogs_get_subdomain_base() {
788
  </ul>
789
 
790
  <?php
791
+
792
+ // @todo where does $current_tab come from?
793
  do_action( 'bp_blogs_blog_tabs', $current_tab );
794
  }
795
 
842
  // Filter and return the HTML button
843
  return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
844
  }
 
 
bp-blogs/bp-blogs-widgets.php CHANGED
@@ -15,14 +15,14 @@ function bp_blogs_register_widgets() {
15
  global $wpdb;
16
 
17
  if ( bp_is_active( 'activity' ) && (int) $wpdb->blogid == bp_get_root_blog_id() )
18
- add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') );
19
  }
20
  add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' );
21
 
22
  class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
23
 
24
  function __construct() {
25
- parent::__construct( false, $name = __( 'Recent Networkwide Posts', 'buddypress' ) );
26
  }
27
 
28
  function widget($args, $instance) {
@@ -35,7 +35,7 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
35
  if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] )
36
  $instance['max_posts'] = 10; ?>
37
 
38
- <?php /* Override some of the contextually set parameters for bp_has_activities() */ ?>
39
  <?php if ( bp_has_activities( array( 'action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false ) ) ) : ?>
40
 
41
  <ul id="blog-post-list" class="activity-list item-list">
@@ -88,4 +88,3 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
88
  <?php
89
  }
90
  }
91
- ?>
15
  global $wpdb;
16
 
17
  if ( bp_is_active( 'activity' ) && (int) $wpdb->blogid == bp_get_root_blog_id() )
18
+ add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Blogs_Recent_Posts_Widget");' ) );
19
  }
20
  add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' );
21
 
22
  class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
23
 
24
  function __construct() {
25
+ parent::__construct( false, $name = _x( '(BuddyPress) Recent Networkwide Posts', 'widget name', 'buddypress' ) );
26
  }
27
 
28
  function widget($args, $instance) {
35
  if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] )
36
  $instance['max_posts'] = 10; ?>
37
 
38
+ <?php // Override some of the contextually set parameters for bp_has_activities() ?>
39
  <?php if ( bp_has_activities( array( 'action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false ) ) ) : ?>
40
 
41
  <ul id="blog-post-list" class="activity-list item-list">
88
  <?php
89
  }
90
  }
 
bp-core/admin/bp-core-actions.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * BuddyPress Admin Actions
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage Admin
8
+ *
9
+ * This file contains the actions that are used through-out BuddyPress Admin. They
10
+ * are consolidated here to make searching for them easier, and to help developers
11
+ * understand at a glance the order in which things occur.
12
+ *
13
+ * There are a few common places that additional actions can currently be found
14
+ *
15
+ * - BuddyPress: In {@link BuddyPress::setup_actions()} in BuddyPress.php
16
+ * - Admin: More in {@link bp_Admin::setup_actions()} in admin.php
17
+ *
18
+ * @see bp-core-actions.php
19
+ * @see bp-core-filters.php
20
+ */
21
+
22
+ // Exit if accessed directly
23
+ if ( !defined( 'ABSPATH' ) ) exit;
24
+
25
+ /**
26
+ * Attach BuddyPress to WordPress
27
+ *
28
+ * BuddyPress uses its own internal actions to help aid in third-party plugin
29
+ * development, and to limit the amount of potential future code changes when
30
+ * updates to WordPress core occur.
31
+ *
32
+ * These actions exist to create the concept of 'plugin dependencies'. They
33
+ * provide a safe way for plugins to execute code *only* when BuddyPress is
34
+ * installed and activated, without needing to do complicated guesswork.
35
+ *
36
+ * For more information on how this works, see the 'Plugin Dependency' section
37
+ * near the bottom of this file.
38
+ *
39
+ * v--WordPress Actions v--BuddyPress Sub-actions
40
+ */
41
+ add_action( 'admin_menu', 'bp_admin_menu' );
42
+ add_action( 'admin_init', 'bp_admin_init' );
43
+ add_action( 'admin_head', 'bp_admin_head' );
44
+ add_action( 'admin_notices', 'bp_admin_notices' );
45
+ add_action( 'admin_enqueue_scripts', 'bp_admin_enqueue_scripts' );
46
+ add_action( 'network_admin_menu', 'bp_admin_menu' );
47
+ add_action( 'custom_menu_order', 'bp_admin_custom_menu_order' );
48
+ add_action( 'menu_order', 'bp_admin_menu_order' );
49
+ add_action( 'wpmu_new_blog', 'bp_new_site', 10, 6 );
50
+
51
+ // Hook on to admin_init
52
+ add_action( 'bp_admin_init', 'bp_setup_updater', 1000 );
53
+ add_action( 'bp_admin_init', 'bp_core_activation_notice', 1010 );
54
+ add_action( 'bp_admin_init', 'bp_register_importers' );
55
+ add_action( 'bp_admin_init', 'bp_register_admin_style' );
56
+ add_action( 'bp_admin_init', 'bp_register_admin_settings' );
57
+ add_action( 'bp_admin_init', 'bp_do_activation_redirect', 1 );
58
+
59
+ // Add a new separator
60
+ add_action( 'bp_admin_menu', 'bp_admin_separator' );
61
+
62
+ /**
63
+ * When a new site is created in a multisite installation, run the activation
64
+ * routine on that site
65
+ *
66
+ * @since BuddyPress (1.7)
67
+ *
68
+ * @param int $blog_id
69
+ * @param int $user_id
70
+ * @param string $domain
71
+ * @param string $path
72
+ * @param int $site_id
73
+ * @param array() $meta
74
+ */
75
+ function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
76
+
77
+ // Bail if plugin is not network activated
78
+ if ( ! is_plugin_active_for_network( buddypress()->basename ) )
79
+ return;
80
+
81
+ // Switch to the new blog
82
+ switch_to_blog( $blog_id );
83
+
84
+ // Do the BuddyPress activation routine
85
+ do_action( 'bp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta );
86
+
87
+ // restore original blog
88
+ restore_current_blog();
89
+ }
90
+
91
+ /** Sub-Actions ***************************************************************/
92
+
93
+ /**
94
+ * Piggy back admin_init action
95
+ *
96
+ * @since BuddyPress (1.7)
97
+ * @uses do_action() Calls 'bp_admin_init'
98
+ */
99
+ function bp_admin_init() {
100
+ do_action( 'bp_admin_init' );
101
+ }
102
+
103
+ /**
104
+ * Piggy back admin_menu action
105
+ *
106
+ * @since BuddyPress (1.7)
107
+ * @uses do_action() Calls 'bp_admin_menu'
108
+ */
109
+ function bp_admin_menu() {
110
+ do_action( 'bp_admin_menu' );
111
+ }
112
+
113
+ /**
114
+ * Piggy back admin_head action
115
+ *
116
+ * @since BuddyPress (1.7)
117
+ * @uses do_action() Calls 'bp_admin_head'
118
+ */
119
+ function bp_admin_head() {
120
+ do_action( 'bp_admin_head' );
121
+ }
122
+
123
+ /**
124
+ * Piggy back admin_notices action
125
+ *
126
+ * @since BuddyPress (1.7)
127
+ * @uses do_action() Calls 'bp_admin_notices'
128
+ */
129
+ function bp_admin_notices() {
130
+ do_action( 'bp_admin_notices' );
131
+ }
132
+
133
+ /**
134
+ * Piggy back admin_notices action
135
+ *
136
+ * @since BuddyPress (1.7)
137
+ * @uses do_action() Calls 'bp_admin_notices'
138
+ */
139
+ function bp_admin_enqueue_scripts() {
140
+ do_action( 'bp_admin_enqueue_scripts' );
141
+ }
142
+
143
+ /**
144
+ * Dedicated action to register BuddyPress importers
145
+ *
146
+ * @since BuddyPress (1.7)
147
+ * @uses do_action() Calls 'bp_admin_notices'
148
+ */
149
+ function bp_register_importers() {
150
+ do_action( 'bp_register_importers' );
151
+ }
152
+
153
+ /**
154
+ * Dedicated action to register admin styles
155
+ *
156
+ * @since BuddyPress (1.7)
157
+ * @uses do_action() Calls 'bp_admin_notices'
158
+ */
159
+ function bp_register_admin_style() {
160
+ do_action( 'bp_register_admin_style' );
161
+ }
162
+
163
+ /**
164
+ * Dedicated action to register admin settings
165
+ *
166
+ * @since BuddyPress (1.7)
167
+ * @uses do_action() Calls 'bp_register_admin_settings'
168
+ */
169
+ function bp_register_admin_settings() {
170
+ do_action( 'bp_register_admin_settings' );
171
+ }
bp-core/admin/bp-core-components.php CHANGED
@@ -43,76 +43,32 @@ function bp_core_admin_components_settings() {
43
  /**
44
  * Creates reusable markup for component setup on the Components and Pages dashboard panel.
45
  *
46
- * This markup has been abstracted so that it can be used both during the setup wizard as well as
47
- * when BP has been fully installed.
48
- *
49
  * @package BuddyPress
50
  * @since BuddyPress (1.6)
51
  * @todo Use settings API
52
  */
53
  function bp_core_admin_components_options() {
54
 
55
- // Load core functions, if needed
56
- if ( !function_exists( 'bp_get_option' ) )
57
- require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
58
-
59
  // Declare local variables
60
  $deactivated_components = array();
61
- $required_components = array();
62
  $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
63
 
64
- // Optional core components
65
- $optional_components = array(
66
  'xprofile' => array(
67
  'title' => __( 'Extended Profiles', 'buddypress' ),
68
  'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
69
- ),
70
- 'settings' => array(
71
- 'title' => __( 'Account Settings', 'buddypress' ),
72
- 'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
73
- ),
74
- 'friends' => array(
75
- 'title' => __( 'Friend Connections', 'buddypress' ),
76
- 'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' )
77
- ),
78
- 'messages' => array(
79
- 'title' => __( 'Private Messaging', 'buddypress' ),
80
- 'description' => __( 'Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.', 'buddypress' )
81
- ),
82
- 'activity' => array(
83
- 'title' => __( 'Activity Streams', 'buddypress' ),
84
- 'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' )
85
- ),
86
- 'groups' => array(
87
- 'title' => __( 'User Groups', 'buddypress' ),
88
- 'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' )
89
- ),
90
- 'forums' => array(
91
- 'title' => __( 'Discussion Forums', 'buddypress' ),
92
- 'description' => __( 'Site-wide and Group forums allow for focused, bulletin-board style conversations. Powered by bbPress.', 'buddypress' )
93
- ),
94
- 'blogs' => array(
95
- 'title' => __( 'Site Tracking', 'buddypress' ),
96
- 'description' => __( 'Record activity for new posts and comments from your site.', 'buddypress' )
97
  )
98
  );
99
 
100
- // Add blogs tracking if multisite
101
- if ( is_multisite() ) {
102
- $optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' );
103
- }
104
 
105
- // Required components
106
- $required_components = array(
107
- 'core' => array(
108
- 'title' => __( 'BuddyPress Core', 'buddypress' ),
109
- 'description' => __( 'It&#8216;s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' )
110
- ),
111
- 'members' => array(
112
- 'title' => __( 'Community Members', 'buddypress' ),
113
- 'description' => __( 'Everything in a BuddyPress community revolves around its members.', 'buddypress' )
114
- ),
115
- );
116
 
117
  // Merge optional and required together
118
  $all_components = $optional_components + $required_components;
@@ -125,12 +81,12 @@ function bp_core_admin_components_options() {
125
 
126
  // Trim off namespace and filename
127
  $trimmed = array();
128
- foreach ( (array) $deactivated_components as $component => $value ) {
129
  $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
130
  }
131
 
132
  // Loop through the optional components to create an active component array
133
- foreach ( (array) $optional_components as $ocomponent => $ovalue ) {
134
  if ( !in_array( $ocomponent, $trimmed ) ) {
135
  $active_components[$ocomponent] = 1;
136
  }
@@ -138,9 +94,9 @@ function bp_core_admin_components_options() {
138
  }
139
  }
140
 
141
- // On new install, set all components to be active by default
142
- if ( empty( $active_components ) && ( bp_get_maintenance_mode() == 'install' ) ) {
143
- $active_components = $optional_components;
144
  }
145
 
146
  // Core component is always active
@@ -153,7 +109,7 @@ function bp_core_admin_components_options() {
153
  $all_count = count( $all_components );
154
  $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
155
  $action = !empty( $_GET['action'] ) ? $_GET['action'] : 'all';
156
-
157
  switch( $action ) {
158
  case 'all' :
159
  $current_components = $all_components;
@@ -171,94 +127,89 @@ function bp_core_admin_components_options() {
171
  case 'mustuse' :
172
  $current_components = $required_components;
173
  break;
174
- }
175
-
176
- // The setup wizard uses different, more descriptive text
177
- if ( bp_get_maintenance_mode() ) : ?>
178
-
179
- <h3><?php _e( 'Available Components', 'buddypress' ); ?></h3>
180
-
181
- <p><?php _e( 'Each component has a unique purpose, and your community may not need each one.', 'buddypress' ); ?></p>
182
-
183
- <?php endif ?>
184
-
185
- <ul class="subsubsub">
186
- <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'all' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'all' ) : ?>class="current"<?php endif; ?>><?php printf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $all_count, 'plugins', 'buddypress' ), number_format_i18n( $all_count ) ); ?></a> | </li>
187
- <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'active' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'active' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', count( $active_components ), 'buddypress' ), number_format_i18n( count( $active_components ) ) ); ?></a> | </li>
188
- <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'inactive' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'inactive' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', count( $inactive_components ), 'buddypress' ), number_format_i18n( count( $inactive_components ) ) ); ?></a> | </li>
189
- <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'mustuse' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'mustuse' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', count( $required_components ), 'buddypress' ), number_format_i18n( count( $required_components ) ) ); ?></a></li>
190
- </ul>
191
-
192
- <table class="widefat fixed plugins" cellspacing="0">
193
- <thead>
194
- <tr>
195
- <th scope="col" id="cb" class="manage-column column-cb check-column">&nbsp;</th>
196
- <th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
197
- <th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
198
- </tr>
199
- </thead>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
- <tfoot>
202
- <tr>
203
- <th scope="col" class="manage-column column-cb check-column">&nbsp;</th>
204
- <th scope="col" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
205
- <th scope="col" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
206
  </tr>
207
- </tfoot>
208
-
209
- <tbody id="the-list">
210
-
211
- <?php if ( !empty( $current_components ) ) : ?>
212
-
213
- <?php foreach ( $current_components as $name => $labels ) : ?>
214
-
215
- <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) :
216
- $class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive';
217
- else :
218
- $class = 'active';
219
- endif; ?>
220
-
221
- <tr id="<?php echo $name; ?>" class="<?php echo $name . ' ' . $class; ?>">
222
- <th scope="row">
223
-
224
- <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?>
225
-
226
- <input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> />
227
-
228
- <?php endif; ?>
229
-
230
- <label class="screen-reader-text" for="bp_components[<?php echo esc_attr( $name ); ?>]"><?php sprintf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label>
231
- </th>
232
- <td class="plugin-title" style="width: 190px;">
233
- <span></span>
234
- <strong><?php echo esc_html( $labels['title'] ); ?></strong>
235
- <div class="row-actions-visible">
236
-
237
- </div>
238
- </td>
239
-
240
- <td class="column-description desc">
241
- <div class="plugin-description">
242
- <p><?php echo $labels['description']; ?></p>
243
- </div>
244
- <div class="active second plugin-version-author-uri">
245
-
246
- </div>
247
- </td>
248
- </tr>
249
-
250
- <?php endforeach ?>
251
-
252
- <?php else : ?>
253
-
254
- <tr class="no-items">
255
- <td class="colspanchange" colspan="3"><?php _e( 'No components found.', 'buddypress' ); ?></td>
256
- </tr>
257
 
258
- <?php endif; ?>
259
 
260
- </tbody>
261
- </table>
262
 
263
  <input type="hidden" name="bp_components[members]" value="1" />
264
 
@@ -269,32 +220,194 @@ function bp_core_admin_components_options() {
269
  * Handle saving the Component settings
270
  *
271
  * @since BuddyPress (1.6)
272
- * @todo Use settings API
273
- * @global BuddyPress $bp
274
- * @return false On failure
275
  */
276
  function bp_core_admin_components_settings_handler() {
277
- global $bp;
278
 
279
- if ( isset( $_POST['bp-admin-component-submit'] ) ) {
280
- if ( !check_admin_referer('bp-admin-component-setup') )
281
- return false;
282
 
283
- // Settings form submitted, now save the settings. First, set active components
284
- if ( isset( $_POST['bp_components'] ) ) {
285
- // Save settings and upgrade schema
286
- require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' );
287
- $bp->active_components = stripslashes_deep( $_POST['bp_components'] );
288
- bp_core_install( $bp->active_components );
289
 
290
- bp_update_option( 'bp-active-components', $bp->active_components );
291
- }
 
 
 
292
 
293
- $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) );
 
294
 
295
- wp_redirect( $base_url );
 
 
 
 
 
296
  }
 
 
 
 
 
 
297
  }
298
- add_action( 'admin_init', 'bp_core_admin_components_settings_handler' );
299
 
300
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Creates reusable markup for component setup on the Components and Pages dashboard panel.
45
  *
 
 
 
46
  * @package BuddyPress
47
  * @since BuddyPress (1.6)
48
  * @todo Use settings API
49
  */
50
  function bp_core_admin_components_options() {
51
 
 
 
 
 
52
  // Declare local variables
53
  $deactivated_components = array();
 
54
  $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
55
 
56
+ // The default components (if none are previously selected)
57
+ $default_components = array(
58
  'xprofile' => array(
59
  'title' => __( 'Extended Profiles', 'buddypress' ),
60
  'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  )
62
  );
63
 
64
+ $optional_components = bp_core_admin_get_components( 'optional' );
65
+ $required_components = bp_core_admin_get_components( 'required' );
66
+ $retired_components = bp_core_admin_get_components( 'retired' );
 
67
 
68
+ // Don't show Forums component in optional components if it's disabled
69
+ if ( ! bp_is_active( 'forums' ) ) {
70
+ unset( $optional_components['forums'] );
71
+ }
 
 
 
 
 
 
 
72
 
73
  // Merge optional and required together
74
  $all_components = $optional_components + $required_components;
81
 
82
  // Trim off namespace and filename
83
  $trimmed = array();
84
+ foreach ( array_keys( (array) $deactivated_components ) as $component ) {
85
  $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
86
  }
87
 
88
  // Loop through the optional components to create an active component array
89
+ foreach ( array_keys( (array) $optional_components ) as $ocomponent ) {
90
  if ( !in_array( $ocomponent, $trimmed ) ) {
91
  $active_components[$ocomponent] = 1;
92
  }
94
  }
95
  }
96
 
97
+ // On new install, set active components to default
98
+ if ( empty( $active_components ) ) {
99
+ $active_components = $default_components;
100
  }
101
 
102
  // Core component is always active
109
  $all_count = count( $all_components );
110
  $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
111
  $action = !empty( $_GET['action'] ) ? $_GET['action'] : 'all';
112
+
113
  switch( $action ) {
114
  case 'all' :
115
  $current_components = $all_components;
127
  case 'mustuse' :
128
  $current_components = $required_components;
129
  break;
130
+ case 'retired' :
131
+ $current_components = $retired_components;
132
+ break;
133
+ } ?>
134
+
135
+ <ul class="subsubsub">
136
+ <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'all' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'all' ) : ?>class="current"<?php endif; ?>><?php printf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $all_count, 'plugins', 'buddypress' ), number_format_i18n( $all_count ) ); ?></a> | </li>
137
+ <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'active' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'active' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', count( $active_components ), 'buddypress' ), number_format_i18n( count( $active_components ) ) ); ?></a> | </li>
138
+ <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'inactive' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'inactive' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', count( $inactive_components ), 'buddypress' ), number_format_i18n( count( $inactive_components ) ) ); ?></a> | </li>
139
+ <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'mustuse' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'mustuse' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', count( $required_components ), 'buddypress' ), number_format_i18n( count( $required_components ) ) ); ?></a> | </li>
140
+ <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'retired' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'retired' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Retired <span class="count">(%s)</span>', 'Retired <span class="count">(%s)</span>', count( $retired_components ), 'buddypress' ), number_format_i18n( count( $retired_components ) ) ); ?></a></li>
141
+ </ul>
142
+
143
+ <table class="widefat fixed plugins" cellspacing="0">
144
+ <thead>
145
+ <tr>
146
+ <th scope="col" id="cb" class="manage-column column-cb check-column">&nbsp;</th>
147
+ <th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
148
+ <th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
149
+ </tr>
150
+ </thead>
151
+
152
+ <tfoot>
153
+ <tr>
154
+ <th scope="col" class="manage-column column-cb check-column">&nbsp;</th>
155
+ <th scope="col" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
156
+ <th scope="col" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
157
+ </tr>
158
+ </tfoot>
159
+
160
+ <tbody id="the-list">
161
+
162
+ <?php if ( !empty( $current_components ) ) : ?>
163
+
164
+ <?php foreach ( $current_components as $name => $labels ) : ?>
165
+
166
+ <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) :
167
+ $class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive';
168
+ else :
169
+ $class = 'active';
170
+ endif; ?>
171
+
172
+ <tr id="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $name ) . ' ' . esc_attr( $class ); ?>">
173
+ <th scope="row">
174
+
175
+ <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?>
176
+
177
+ <input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> />
178
+
179
+ <?php endif; ?>
180
+
181
+ <label class="screen-reader-text" for="bp_components[<?php echo esc_attr( $name ); ?>]"><?php sprintf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label>
182
+ </th>
183
+ <td class="plugin-title" style="width: 190px;">
184
+ <span></span>
185
+ <strong><?php echo esc_html( $labels['title'] ); ?></strong>
186
+ <div class="row-actions-visible">
187
+
188
+ </div>
189
+ </td>
190
+
191
+ <td class="column-description desc">
192
+ <div class="plugin-description">
193
+ <p><?php echo $labels['description']; ?></p>
194
+ </div>
195
+ <div class="active second plugin-version-author-uri">
196
+
197
+ </div>
198
+ </td>
199
+ </tr>
200
+
201
+ <?php endforeach ?>
202
+
203
+ <?php else : ?>
204
 
205
+ <tr class="no-items">
206
+ <td class="colspanchange" colspan="3"><?php _e( 'No components found.', 'buddypress' ); ?></td>
 
 
 
207
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
+ <?php endif; ?>
210
 
211
+ </tbody>
212
+ </table>
213
 
214
  <input type="hidden" name="bp_components[members]" value="1" />
215
 
220
  * Handle saving the Component settings
221
  *
222
  * @since BuddyPress (1.6)
223
+ * @todo Use settings API when it supports saving network settings
224
+ * @return If not time to save settings
 
225
  */
226
  function bp_core_admin_components_settings_handler() {
 
227
 
228
+ // Bail if not saving settings
229
+ if ( ! isset( $_POST['bp-admin-component-submit'] ) )
230
+ return;
231
 
232
+ // Bail if nonce fails
233
+ if ( ! check_admin_referer( 'bp-admin-component-setup' ) )
234
+ return;
 
 
 
235
 
236
+ // Settings form submitted, now save the settings. First, set active components
237
+ if ( isset( $_POST['bp_components'] ) ) {
238
+
239
+ // Load up BuddyPress
240
+ $bp = buddypress();
241
 
242
+ // Save settings and upgrade schema
243
+ require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' );
244
 
245
+ $submitted = stripslashes_deep( $_POST['bp_components'] );
246
+ $bp->active_components = bp_core_admin_get_active_components_from_submitted_settings( $submitted );
247
+
248
+ bp_core_install( $bp->active_components );
249
+ bp_core_add_page_mappings( $bp->active_components );
250
+ bp_update_option( 'bp-active-components', $bp->active_components );
251
  }
252
+
253
+ // Where are we redirecting to?
254
+ $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) );
255
+
256
+ // Redirect
257
+ wp_redirect( $base_url );
258
  }
259
+ add_action( 'bp_admin_init', 'bp_core_admin_components_settings_handler' );
260
 
261
+ /**
262
+ * Calculates the components that should be active after save, based on submitted settings
263
+ *
264
+ * The way that active components must be set after saving your settings must
265
+ * be calculated differently depending on which of the Components subtabs you
266
+ * are coming from:
267
+ * - When coming from All or Active, the submitted checkboxes accurately
268
+ * reflect the desired active components, so we simply pass them through
269
+ * - When coming from Inactive, components can only be activated - already
270
+ * active components will not be passed in the $_POST global. Thus, we must
271
+ * parse the newly activated components with the already active components
272
+ * saved in the $bp global
273
+ * - When activating a Retired component, the situation is similar to Inactive.
274
+ * - When deactivating a Retired component, no value is passed in the $_POST
275
+ * global (because the component settings are checkboxes). So, in order to
276
+ * determine whether a retired component is being deactivated, we retrieve a
277
+ * list of retired components, and check each one to ensure that its checkbox
278
+ * is not present, before merging the submitted components with the active
279
+ * ones.
280
+ *
281
+ * @since (BuddyPress) 1.7
282
+ *
283
+ * @param array This is the array of component settings coming from the POST
284
+ * global. You should stripslashes_deep() before passing to this function
285
+ * @return array The calculated list of component settings
286
+ */
287
+ function bp_core_admin_get_active_components_from_submitted_settings( $submitted ) {
288
+ $current_action = 'all';
289
+
290
+ if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'active', 'inactive', 'retired' ) ) ) {
291
+ $current_action = $_GET['action'];
292
+ }
293
+
294
+ $current_components = buddypress()->active_components;
295
+
296
+ switch ( $current_action ) {
297
+ case 'retired' :
298
+ $retired_components = bp_core_admin_get_components( 'retired' );
299
+ foreach ( array_keys( $retired_components ) as $retired_component ) {
300
+ if ( ! isset( $submitted[ $retired_component ] ) ) {
301
+ unset( $current_components[ $retired_component ] );
302
+ }
303
+ }
304
+ // fall through
305
+
306
+ case 'inactive' :
307
+ $components = array_merge( $submitted, $current_components );
308
+ break;
309
+
310
+ case 'all' :
311
+ case 'active' :
312
+ default :
313
+ $components = $submitted;
314
+ break;
315
+ }
316
+
317
+ return $components;
318
+ }
319
+
320
+ /**
321
+ * Return a list of component information, optionally filtered by type
322
+ *
323
+ * We use this information both to build the markup for the admin screens, as
324
+ * well as to do some processing on settings data submitted from those screens.
325
+ *
326
+ * @since (BuddyPress) 1.7
327
+ *
328
+ * @param string $type 'all', 'optional', 'retired', 'required'
329
+ * @return array An array of requested component data
330
+ */
331
+ function bp_core_admin_get_components( $type = 'all' ) {
332
+
333
+ // Required components
334
+ $required_components = array(
335
+ 'core' => array(
336
+ 'title' => __( 'BuddyPress Core', 'buddypress' ),
337
+ 'description' => __( 'It&#8216;s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' )
338
+ ),
339
+ 'members' => array(
340
+ 'title' => __( 'Community Members', 'buddypress' ),
341
+ 'description' => __( 'Everything in a BuddyPress community revolves around its members.', 'buddypress' )
342
+ ),
343
+ );
344
+
345
+ // Retired components
346
+ $retired_components = array(
347
+ 'forums' => array(
348
+ 'title' => __( 'Group Forums', 'buddypress' ),
349
+ 'description' => sprintf( __( 'BuddyPress Forums are retired. Use %s.', 'buddypress' ), '<a href="http://bbpress.org">bbPress</a>' )
350
+ ),
351
+ );
352
+
353
+ // Optional core components
354
+ $optional_components = array(
355
+ 'xprofile' => array(
356
+ 'title' => __( 'Extended Profiles', 'buddypress' ),
357
+ 'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
358
+ ),
359
+ 'settings' => array(
360
+ 'title' => __( 'Account Settings', 'buddypress' ),
361
+ 'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
362
+ ),
363
+ 'friends' => array(
364
+ 'title' => __( 'Friend Connections', 'buddypress' ),
365
+ 'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' )
366
+ ),
367
+ 'messages' => array(
368
+ 'title' => __( 'Private Messaging', 'buddypress' ),
369
+ 'description' => __( 'Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.', 'buddypress' )
370
+ ),
371
+ 'activity' => array(
372
+ 'title' => __( 'Activity Streams', 'buddypress' ),
373
+ 'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' )
374
+ ),
375
+ 'groups' => array(
376
+ 'title' => __( 'User Groups', 'buddypress' ),
377
+ 'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' )
378
+ ),
379
+ 'forums' => array(
380
+ 'title' => __( 'Group Forums (Legacy)', 'buddypress' ),
381
+ 'description' => __( 'Group forums allow for focused, bulletin-board style conversations.', 'buddypress' )
382
+ ),
383
+ 'blogs' => array(
384
+ 'title' => __( 'Site Tracking', 'buddypress' ),
385
+ 'description' => __( 'Record activity for new posts and comments from your site.', 'buddypress' )
386
+ )
387
+ );
388
+
389
+
390
+ // Add blogs tracking if multisite
391
+ if ( is_multisite() ) {
392
+ $optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' );
393
+ }
394
+
395
+ switch ( $type ) {
396
+ case 'required' :
397
+ $components = $required_components;
398
+ break;
399
+ case 'optional' :
400
+ $components = $optional_components;
401
+ break;
402
+ case 'retired' :
403
+ $components = $retired_components;
404
+ break;
405
+ case 'all' :
406
+ default :
407
+ $components = array_merge( $required_components, $optional_components, $retired_components );
408
+ break;
409
+
410
+ }
411
+
412
+ return $components;
413
+ }
bp-core/admin/bp-core-functions.php CHANGED
@@ -32,49 +32,35 @@ function bp_core_admin_menu_init() {
32
  * @global array $_parent_pages
33
  * @global array $_registered_pages
34
  * @global array $submenu
35
- * @since 1.6
36
  */
37
  function bp_core_admin_backpat_menu() {
38
  global $_parent_pages, $_registered_pages, $submenu;
39
 
40
- if ( ! is_super_admin() )
41
- return;
42
-
43
- // Don't do anything if a BP upgrade is in progress, or if the bp-wizard is in progress.
44
- if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE || empty( $submenu['bp-general-settings'] ) )
45
  return;
 
46
 
47
  /**
48
  * By default, only the core "Help" submenu is added under the top-level BuddyPress menu.
49
  * This means that if no third-party plugins have registered their admin pages into the
50
  * 'bp-general-settings' menu, it will only contain one item. Kill it.
51
  */
52
- if ( 1 == count( $submenu['bp-general-settings'] ) ) {
53
-
54
- // This removes the top-level menu
55
- remove_submenu_page( 'bp-general-settings', 'bp-general-settings' );
56
- remove_menu_page( 'bp-general-settings' );
57
-
58
- // These stop people accessing the URL directly
59
- unset( $_parent_pages['bp-general-settings'] );
60
- unset( $_registered_pages['toplevel_page_bp-general-settings'] );
61
  }
62
- }
63
- add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 );
64
 
65
- /**
66
- * Tweak the Settings subnav menu to show only one BuddyPress menu item (Settings > BuddyPress).
67
- *
68
- * @since 1.6
69
- */
70
- function bp_core_modify_admin_menu() {
71
- $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
72
 
73
- remove_submenu_page( $page, 'bb-forums-setup' );
74
- remove_submenu_page( $page, 'bp-page-settings' );
75
- remove_submenu_page( $page, 'bp-settings' );
76
  }
77
- add_action( 'admin_head', 'bp_core_modify_admin_menu', 999 );
78
 
79
  /**
80
  * This tells WP to highlight the Settings > BuddyPress menu item,
@@ -85,7 +71,7 @@ add_action( 'admin_head', 'bp_core_modify_admin_menu', 999 );
85
  *
86
  * @global string $plugin_page
87
  * @global array $submenu
88
- * @since 1.6
89
  */
90
  function bp_core_modify_admin_menu_highlight() {
91
  global $plugin_page, $submenu_file;
@@ -101,7 +87,7 @@ function bp_core_modify_admin_menu_highlight() {
101
  * will never appear.
102
  *
103
  * @see bp_core_admin_backpat_menu()
104
- * @since 1.6
105
  * @todo Add convenience links into the markup once new positions are finalised.
106
  */
107
  function bp_core_admin_backpat_page() {
@@ -109,14 +95,14 @@ function bp_core_admin_backpat_page() {
109
  $settings_url = add_query_arg( 'page', 'bp-components', $url ); ?>
110
 
111
  <div class="wrap">
112
- <?php screen_icon( 'buddypress'); ?>
113
  <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2>
114
 
115
  <p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p>
116
- <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), $settings_url, network_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>
117
  </div>
118
 
119
- <?php
120
  }
121
 
122
  /** Notices *******************************************************************/
@@ -130,12 +116,11 @@ function bp_core_admin_backpat_page() {
130
  * @package BuddyPress Core
131
  * @since BuddyPress (1.5)
132
  *
133
- * @global BuddyPress $bp The one true BuddyPress instance
134
  * @uses bp_current_user_can() to check current user permissions before showing the notices
135
  * @uses bp_is_root_blog()
136
  */
137
  function bp_core_print_admin_notices() {
138
- global $bp;
139
 
140
  // Only the super admin should see messages
141
  if ( !bp_current_user_can( 'bp_moderate' ) )
@@ -148,13 +133,13 @@ function bp_core_print_admin_notices() {
148
 
149
  // Show the messages
150
  if ( !empty( $bp->admin->notices ) ) {
151
- ?>
152
  <div id="message" class="updated fade">
153
- <?php foreach( $bp->admin->notices as $notice ) : ?>
154
  <p><?php echo $notice ?></p>
155
- <?php endforeach ?>
156
  </div>
157
- <?php
158
  }
159
  }
160
  add_action( 'admin_notices', 'bp_core_print_admin_notices' );
@@ -170,11 +155,10 @@ add_action( 'network_admin_notices', 'bp_core_print_admin_notices' );
170
  * @package BuddyPress Core
171
  * @since BuddyPress (1.5)
172
  *
173
- * @global BuddyPress $bp The one true BuddyPress instance
174
  * @param string $notice The notice you are adding to the queue
175
  */
176
  function bp_core_add_admin_notice( $notice ) {
177
- global $bp;
178
 
179
  if ( empty( $bp->admin->notices ) ) {
180
  $bp->admin->notices = array();
@@ -188,29 +172,27 @@ function bp_core_add_admin_notice( $notice ) {
188
  *
189
  * On every Dashboard page, this function checks the following:
190
  * - that pretty permalinks are enabled
191
- * - that a BP-compatible theme is activated
192
  * - that every BP component that needs a WP page for a directory has one
193
  * - that no WP page has multiple BP components associated with it
194
  * The administrator will be shown a notice for each check that fails.
195
  *
196
- * @package BuddyPress Core
 
 
197
  */
198
  function bp_core_activation_notice() {
199
- global $wp_rewrite, $wpdb, $bp;
 
 
200
 
201
  // Only the super admin gets warnings
202
  if ( !bp_current_user_can( 'bp_moderate' ) )
203
  return;
204
 
205
- // On multisite installs, don't load on a non-root blog, unless do_network_admin is
206
- // overridden
207
  if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
208
  return;
209
 
210
- // Don't show these messages during setup or upgrade
211
- if ( !empty( $bp->maintenance_mode ) )
212
- return;
213
-
214
  /**
215
  * Check to make sure that the blog setup routine has run. This can't happen during the
216
  * wizard because of the order which the components are loaded. We check for multisite here
@@ -228,40 +210,20 @@ function bp_core_activation_notice() {
228
  * Are pretty permalinks enabled?
229
  */
230
  if ( isset( $_POST['permalink_structure'] ) )
231
- return false;
232
 
233
  if ( empty( $wp_rewrite->permalink_structure ) ) {
234
  bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) );
235
  }
236
 
237
- /**
238
- * Are you using a BP-compatible theme?
239
- */
240
-
241
- // Get current theme info
242
- $ct = wp_get_theme();
243
-
244
- // Make sure tags is an array to suppress notices
245
- if ( ! isset( $ct->tags ) )
246
- $ct->tags = array();
247
- else
248
- $ct->tags = (array) $ct->tags;
249
-
250
- // The best way to remove this notice is to add a "buddypress" tag to
251
- // your active theme's CSS header.
252
- if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', $ct->tags ) ) {
253
- bp_core_add_admin_notice( sprintf( __( "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), network_admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), network_admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) );
254
- }
255
-
256
  /**
257
  * Check for orphaned BP components (BP component is enabled, no WP page exists)
258
  */
259
-
260
  $orphaned_components = array();
261
  $wp_page_components = array();
262
 
263
  // Only components with 'has_directory' require a WP page to function
264
- foreach( $bp->loaded_components as $component_id => $is_active ) {
265
  if ( !empty( $bp->{$component_id}->has_directory ) ) {
266
  $wp_page_components[] = array(
267
  'id' => $component_id,
@@ -284,6 +246,10 @@ function bp_core_activation_notice() {
284
  );
285
  }
286
 
 
 
 
 
287
  foreach( $wp_page_components as $component ) {
288
  if ( !isset( $bp->pages->{$component['id']} ) ) {
289
  $orphaned_components[] = $component['name'];
@@ -306,16 +272,13 @@ function bp_core_activation_notice() {
306
  bp_core_add_admin_notice( $notice );
307
  }
308
 
309
- /**
310
- * BP components cannot share a single WP page. Check for duplicate assignments, and post
311
- * a message if found.
312
- */
313
  $dupe_names = array();
314
  $page_ids = (array)bp_core_get_directory_page_ids();
315
  $dupes = array_diff_assoc( $page_ids, array_unique( $page_ids ) );
316
 
317
  if ( !empty( $dupes ) ) {
318
- foreach( $dupes as $dupe_component => $dupe_id ) {
319
  $dupe_names[] = $bp->pages->{$dupe_component}->title;
320
  }
321
 
@@ -331,17 +294,45 @@ function bp_core_activation_notice() {
331
  bp_core_add_admin_notice( $notice );
332
  }
333
  }
334
- add_action( 'admin_init', 'bp_core_activation_notice' );
335
 
336
  /**
337
- * Add an extra update message to the update plugin notification.
338
  *
339
- * @package BuddyPress Core
 
 
 
 
 
 
 
 
 
 
 
340
  */
341
- function bp_core_update_message() {
342
- echo '<p style="color: red; margin: 3px 0 0 0; border-top: 1px solid #ddd; padding-top: 3px">' . __( 'IMPORTANT: <a href="http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/">Read this before attempting to update BuddyPress</a>', 'buddypress' ) . '</p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  }
344
- add_action( 'in_plugin_update_message-buddypress/bp-loader.php', 'bp_core_update_message' );
345
 
346
  /** UI/Styling ****************************************************************/
347
 
@@ -361,7 +352,7 @@ function bp_core_admin_tabs( $active_tab = '' ) {
361
  // Setup core admin tabs
362
  $tabs = array(
363
  '0' => array(
364
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
365
  'name' => __( 'Components', 'buddypress' )
366
  ),
367
  '1' => array(
@@ -369,21 +360,13 @@ function bp_core_admin_tabs( $active_tab = '' ) {
369
  'name' => __( 'Pages', 'buddypress' )
370
  ),
371
  '2' => array(
372
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
373
- 'name' => __( 'Settings', 'buddypress' )
374
  )
375
  );
376
 
377
- // If forums component is active, add additional tab
378
- if ( bp_is_active( 'forums' ) ) {
379
- $tabs['3'] = array(
380
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ),
381
- 'name' => __( 'Forums', 'buddypress' )
382
- );
383
- }
384
-
385
  // Loop through tabs and build navigation
386
- foreach( $tabs as $tab_id => $tab_data ) {
387
  $is_current = (bool) ( $tab_data['name'] == $active_tab );
388
  $tab_class = $is_current ? $active_class : $idle_class;
389
  $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
@@ -396,4 +379,256 @@ function bp_core_admin_tabs( $active_tab = '' ) {
396
  do_action( 'bp_admin_tabs' );
397
  }
398
 
399
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  * @global array $_parent_pages
33
  * @global array $_registered_pages
34
  * @global array $submenu
35
+ * @since BuddyPress (1.6)
36
  */
37
  function bp_core_admin_backpat_menu() {
38
  global $_parent_pages, $_registered_pages, $submenu;
39
 
40
+ // If there's no bp-general-settings menu (perhaps because the current
41
+ // user is not an Administrator), there's nothing to do here
42
+ if ( ! isset( $submenu['bp-general-settings'] ) ) {
 
 
43
  return;
44
+ }
45
 
46
  /**
47
  * By default, only the core "Help" submenu is added under the top-level BuddyPress menu.
48
  * This means that if no third-party plugins have registered their admin pages into the
49
  * 'bp-general-settings' menu, it will only contain one item. Kill it.
50
  */
51
+ if ( 1 != count( $submenu['bp-general-settings'] ) ) {
52
+ return;
 
 
 
 
 
 
 
53
  }
 
 
54
 
55
+ // This removes the top-level menu
56
+ remove_submenu_page( 'bp-general-settings', 'bp-general-settings' );
57
+ remove_menu_page( 'bp-general-settings' );
 
 
 
 
58
 
59
+ // These stop people accessing the URL directly
60
+ unset( $_parent_pages['bp-general-settings'] );
61
+ unset( $_registered_pages['toplevel_page_bp-general-settings'] );
62
  }
63
+ add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 );
64
 
65
  /**
66
  * This tells WP to highlight the Settings > BuddyPress menu item,
71
  *
72
  * @global string $plugin_page
73
  * @global array $submenu
74
+ * @since BuddyPress (1.6)
75
  */
76
  function bp_core_modify_admin_menu_highlight() {
77
  global $plugin_page, $submenu_file;
87
  * will never appear.
88
  *
89
  * @see bp_core_admin_backpat_menu()
90
+ * @since BuddyPress (1.6)
91
  * @todo Add convenience links into the markup once new positions are finalised.
92
  */
93
  function bp_core_admin_backpat_page() {
95
  $settings_url = add_query_arg( 'page', 'bp-components', $url ); ?>
96
 
97
  <div class="wrap">
98
+ <?php screen_icon( 'buddypress' ); ?>
99
  <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2>
100
 
101
  <p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p>
102
+ <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>
103
  </div>
104
 
105
+ <?php
106
  }
107
 
108
  /** Notices *******************************************************************/
116
  * @package BuddyPress Core
117
  * @since BuddyPress (1.5)
118
  *
 
119
  * @uses bp_current_user_can() to check current user permissions before showing the notices
120
  * @uses bp_is_root_blog()
121
  */
122
  function bp_core_print_admin_notices() {
123
+ $bp = buddypress();
124
 
125
  // Only the super admin should see messages
126
  if ( !bp_current_user_can( 'bp_moderate' ) )
133
 
134
  // Show the messages
135
  if ( !empty( $bp->admin->notices ) ) {
136
+ ?>
137
  <div id="message" class="updated fade">
138
+ <?php foreach ( $bp->admin->notices as $notice ) : ?>
139
  <p><?php echo $notice ?></p>
140
+ <?php endforeach ?>
141
  </div>
142
+ <?php
143
  }
144
  }
145
  add_action( 'admin_notices', 'bp_core_print_admin_notices' );
155
  * @package BuddyPress Core
156
  * @since BuddyPress (1.5)
157
  *
 
158
  * @param string $notice The notice you are adding to the queue
159
  */
160
  function bp_core_add_admin_notice( $notice ) {
161
+ $bp = buddypress();
162
 
163
  if ( empty( $bp->admin->notices ) ) {
164
  $bp->admin->notices = array();
172
  *
173
  * On every Dashboard page, this function checks the following:
174
  * - that pretty permalinks are enabled
 
175
  * - that every BP component that needs a WP page for a directory has one
176
  * - that no WP page has multiple BP components associated with it
177
  * The administrator will be shown a notice for each check that fails.
178
  *
179
+ * @global WPDB $wpdb WordPress DB object
180
+ * @global WP_Rewrite $wp_rewrite
181
+ * @since BuddyPress (1.2)
182
  */
183
  function bp_core_activation_notice() {
184
+ global $wpdb, $wp_rewrite;
185
+
186
+ $bp = buddypress();
187
 
188
  // Only the super admin gets warnings
189
  if ( !bp_current_user_can( 'bp_moderate' ) )
190
  return;
191
 
192
+ // On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden
 
193
  if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
194
  return;
195
 
 
 
 
 
196
  /**
197
  * Check to make sure that the blog setup routine has run. This can't happen during the
198
  * wizard because of the order which the components are loaded. We check for multisite here
210
  * Are pretty permalinks enabled?
211
  */
212
  if ( isset( $_POST['permalink_structure'] ) )
213
+ return;
214
 
215
  if ( empty( $wp_rewrite->permalink_structure ) ) {
216
  bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) );
217
  }
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  /**
220
  * Check for orphaned BP components (BP component is enabled, no WP page exists)
221
  */
 
222
  $orphaned_components = array();
223
  $wp_page_components = array();
224
 
225
  // Only components with 'has_directory' require a WP page to function
226
+ foreach( array_keys( $bp->loaded_components ) as $component_id ) {
227
  if ( !empty( $bp->{$component_id}->has_directory ) ) {
228
  $wp_page_components[] = array(
229
  'id' => $component_id,
246
  );
247
  }
248
 
249
+ // On the first admin screen after a new installation, this isn't set, so grab it to supress a misleading error message.
250
+ if ( empty( $bp->pages->members ) )
251
+ $bp->pages = bp_core_get_directory_pages();
252
+
253
  foreach( $wp_page_components as $component ) {
254
  if ( !isset( $bp->pages->{$component['id']} ) ) {
255
  $orphaned_components[] = $component['name'];
272
  bp_core_add_admin_notice( $notice );
273
  }
274
 
275
+ // BP components cannot share a single WP page. Check for duplicate assignments, and post a message if found.
 
 
 
276
  $dupe_names = array();
277
  $page_ids = (array)bp_core_get_directory_page_ids();
278
  $dupes = array_diff_assoc( $page_ids, array_unique( $page_ids ) );
279
 
280
  if ( !empty( $dupes ) ) {
281
+ foreach( array_keys( $dupes ) as $dupe_component ) {
282
  $dupe_names[] = $bp->pages->{$dupe_component}->title;
283
  }
284
 
294
  bp_core_add_admin_notice( $notice );
295
  }
296
  }
 
297
 
298
  /**
299
+ * Redirect user to BuddyPress's What's New page on activation
300
  *
301
+ * @since BuddyPress (1.7)
302
+ *
303
+ * @internal Used internally to redirect BuddyPress to the about page on activation
304
+ *
305
+ * @uses get_transient() To see if transient to redirect exists
306
+ * @uses delete_transient() To delete the transient if it exists
307
+ * @uses is_network_admin() To bail if being network activated
308
+ * @uses wp_safe_redirect() To redirect
309
+ * @uses add_query_arg() To help build the URL to redirect to
310
+ * @uses admin_url() To get the admin URL to index.php
311
+ *
312
+ * @return If no transient, or is bulk activation
313
  */
314
+ function bp_do_activation_redirect() {
315
+
316
+ // Bail if no activation redirect
317
+ if ( ! get_transient( '_bp_activation_redirect' ) )
318
+ return;
319
+
320
+ // Delete the redirect transient
321
+ delete_transient( '_bp_activation_redirect' );
322
+
323
+ // Bail if activating from network, or bulk
324
+ if ( isset( $_GET['activate-multi'] ) )
325
+ return;
326
+
327
+ $query_args = array( 'page' => 'bp-about' );
328
+ if ( get_transient( '_bp_is_new_install' ) ) {
329
+ $query_args['is_new_install'] = '1';
330
+ delete_transient( '_bp_is_new_install' );
331
+ }
332
+
333
+ // Redirect to BuddyPress about page
334
+ wp_safe_redirect( add_query_arg( $query_args, bp_get_admin_url( 'index.php' ) ) );
335
  }
 
336
 
337
  /** UI/Styling ****************************************************************/
338
 
352
  // Setup core admin tabs
353
  $tabs = array(
354
  '0' => array(
355
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
356
  'name' => __( 'Components', 'buddypress' )
357
  ),
358
  '1' => array(
360
  'name' => __( 'Pages', 'buddypress' )
361
  ),
362
  '2' => array(
363
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
364
+ 'name' => __( 'Settings', 'buddypress' )
365
  )
366
  );
367
 
 
 
 
 
 
 
 
 
368
  // Loop through tabs and build navigation
369
+ foreach ( array_values( $tabs ) as $tab_data ) {
370
  $is_current = (bool) ( $tab_data['name'] == $active_tab );
371
  $tab_class = $is_current ? $active_class : $idle_class;
372
  $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
379
  do_action( 'bp_admin_tabs' );
380
  }
381
 
382
+ /** Help **********************************************************************/
383
+
384
+ /**
385
+ * adds contextual help to BuddyPress admin pages
386
+ *
387
+ * @since BuddyPress (1.7)
388
+ * @todo Make this part of the BP_Component class and split into each component
389
+ */
390
+ function bp_core_add_contextual_help( $screen = '' ) {
391
+
392
+ $screen = get_current_screen();
393
+
394
+ switch ( $screen->id ) {
395
+
396
+ // Compontent page
397
+ case 'settings_page_bp-components' :
398
+
399
+ // help tabs
400
+ $screen->add_help_tab( array(
401
+ 'id' => 'bp-comp-overview',
402
+ 'title' => __( 'Overview' ),
403
+ 'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ),
404
+ ) );
405
+
406
+ // help panel - sidebar links
407
+ $screen->set_help_sidebar(
408
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
409
+ '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-components">Managing Components</a>', 'buddypress' ) . '</p>' .
410
+ '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
411
+ );
412
+ break;
413
+
414
+ // Pages page
415
+ case 'settings_page_bp-page-settings' :
416
+
417
+ // Help tabs
418
+ $screen->add_help_tab( array(
419
+ 'id' => 'bp-page-overview',
420
+ 'title' => __( 'Overview' ),
421
+ 'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ),
422
+ ) );
423
+
424
+ // Help panel - sidebar links
425
+ $screen->set_help_sidebar(
426
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
427
+ '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-pages">Managing Pages</a>', 'buddypress' ) . '</p>' .
428
+ '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
429
+ );
430
+
431
+ break;
432
+
433
+ // Settings page
434
+ case 'settings_page_bp-settings' :
435
+
436
+ // Help tabs
437
+ $screen->add_help_tab( array(
438
+ 'id' => 'bp-settings-overview',
439
+ 'title' => __( 'Overview' ),
440
+ 'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ),
441
+ ) );
442
+
443
+ // Help panel - sidebar links
444
+ $screen->set_help_sidebar(
445
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
446
+ '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-settings">Managing Settings</a>', 'buddypress' ) . '</p>' .
447
+ '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
448
+ );
449
+
450
+ break;
451
+
452
+ // Profile fields page
453
+ case 'users_page_bp-profile-overview' :
454
+
455
+ // Help tabs
456
+ $screen->add_help_tab( array(
457
+ 'id' => 'bp-profile-overview',
458
+ 'title' => __( 'Overview' ),
459
+ 'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ),
460
+ ) );
461
+
462
+ // Help panel - sidebar links
463
+ $screen->set_help_sidebar(
464
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
465
+ '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#users-profile-fields">Managing Profile Fields</a>', 'buddypress' ) . '</p>' .
466
+ '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
467
+ );
468
+
469
+ break;
470
+ }
471
+ }
472
+ add_action( 'contextual_help', 'bp_core_add_contextual_help' );
473
+
474
+ /**
475
+ * renders contextual help content to contextual help tabs
476
+ *
477
+ * @since BuddyPress (1.7)
478
+ */
479
+ function bp_core_add_contextual_help_content( $tab = '' ) {
480
+
481
+ switch ( $tab ) {
482
+ case 'bp-comp-overview' :
483
+ return '<p>' . __( 'By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' ) . '</p>';
484
+ break;
485
+
486
+ case'bp-page-overview' :
487
+ return '<p>' . __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component.', 'buddypress' ) . '</p>';
488
+ break;
489
+
490
+ case 'bp-settings-overview' :
491
+ return '<p>' . __( 'Extra configuration settings.', 'buddypress' ) . '</p>';
492
+ break;
493
+
494
+ case 'bp-profile-overview' :
495
+ return '<p>' . __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.</br></br>Note: Any fields in the first group will appear on the signup page.', 'buddypress' ) . '</p>';
496
+ break;
497
+
498
+ default:
499
+ return false;
500
+ break;
501
+ }
502
+ }
503
+
504
+ /** Separator *****************************************************************/
505
+
506
+ /**
507
+ * Add a separator to the WordPress admin menus
508
+ *
509
+ * @since BuddyPress (1.7)
510
+ *
511
+ * @uses bp_current_user_can() To check users capability on root blog
512
+ */
513
+ function bp_admin_separator() {
514
+
515
+ // Bail if BuddyPress is not network activated and viewing network admin
516
+ if ( is_network_admin() && ! bp_is_network_activated() )
517
+ return;
518
+
519
+ // Bail if BuddyPress is network activated and viewing site admin
520
+ if ( ! is_network_admin() && bp_is_network_activated() )
521
+ return;
522
+
523
+ // Prevent duplicate separators when no core menu items exist
524
+ if ( ! bp_current_user_can( 'bp_moderate' ) )
525
+ return;
526
+
527
+ // Bail if there are no components with admin UI's. Hardcoded for now, until
528
+ // there's a real API for determining this later.
529
+ if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) )
530
+ return;
531
+
532
+ global $menu;
533
+
534
+ $menu[] = array( '', 'read', 'separator-buddypress', '', 'wp-menu-separator buddypress' );
535
+ }
536
+
537
+ /**
538
+ * Tell WordPress we have a custom menu order
539
+ *
540
+ * @since BuddyPress (1.7)
541
+ *
542
+ * @param bool $menu_order Menu order
543
+ * @uses bp_current_user_can() To check users capability on root blog
544
+ * @return bool Always true
545
+ */
546
+ function bp_admin_custom_menu_order( $menu_order = false ) {
547
+
548
+ // Bail if user cannot see admin pages
549
+ if ( ! bp_current_user_can( 'bp_moderate' ) )
550
+ return $menu_order;
551
+
552
+ return true;
553
+ }
554
+
555
+ /**
556
+ * Move our custom separator above our custom post types
557
+ *
558
+ * @since BuddyPress (1.7)
559
+ *
560
+ * @param array $menu_order Menu Order
561
+ * @uses bp_current_user_can() To check users capability on root blog
562
+ * @return array Modified menu order
563
+ */
564
+ function bp_admin_menu_order( $menu_order = array() ) {
565
+
566
+ // Bail if user cannot see admin pages
567
+ if ( empty( $menu_order ) || ! bp_current_user_can( 'bp_moderate' ) )
568
+ return $menu_order;
569
+
570
+ // Initialize our custom order array
571
+ $bp_menu_order = array();
572
+
573
+ // Menu values
574
+ $last_sep = is_network_admin() ? 'separator1' : 'separator2';
575
+
576
+ // Filter the custom admin menus
577
+ $custom_menus = (array) apply_filters( 'bp_admin_menu_order', array() );
578
+
579
+ // Bail if no components have top level admin pages
580
+ if ( empty( $custom_menus ) )
581
+ return $menu_order;
582
+
583
+ // Add our separator to beginning of array
584
+ array_unshift( $custom_menus, 'separator-buddypress' );
585
+
586
+ // Loop through menu order and do some rearranging
587
+ foreach ( (array) $menu_order as $item ) {
588
+
589
+ // Position BuddyPress menus above appearance
590
+ if ( $last_sep == $item ) {
591
+
592
+ // Add our custom menus
593
+ foreach( (array) $custom_menus as $custom_menu ) {
594
+ if ( array_search( $custom_menu, $menu_order ) ) {
595
+ $bp_menu_order[] = $custom_menu;
596
+ }
597
+ }
598
+
599
+ // Add the appearance separator
600
+ $bp_menu_order[] = $last_sep;
601
+
602
+ // Skip our menu items
603
+ } elseif ( ! in_array( $item, $custom_menus ) ) {
604
+ $bp_menu_order[] = $item;
605
+ }
606
+ }
607
+
608
+ // Return our custom order
609
+ return $bp_menu_order;
610
+ }
611
+
612
+ /** Utility *****************************************************************/
613
+
614
+ /**
615
+ * When using a WP_List_Table, get the currently selected bulk action
616
+ *
617
+ * WP_List_Tables have bulk actions at the top and at the bottom of the tables,
618
+ * and the inputs have different keys in the $_REQUEST array. This function
619
+ * reconciles the two values and returns a single action being performed.
620
+ *
621
+ * @since BuddyPress (1.7)
622
+ * @return string
623
+ */
624
+ function bp_admin_list_table_current_bulk_action() {
625
+
626
+ $action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
627
+
628
+ // If the bottom is set, let it override the action
629
+ if ( ! empty( $_REQUEST['action2'] ) && $_REQUEST['action2'] != "-1" ) {
630
+ $action = $_REQUEST['action2'];
631
+ }
632
+
633
+ return $action;
634
+ }
bp-core/admin/bp-core-schema.php CHANGED
@@ -8,11 +8,8 @@ function bp_core_set_charset() {
8
 
9
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
10
 
11
- /* BuddyPress component DB schema */
12
- if ( !empty($wpdb->charset) )
13
- return "DEFAULT CHARACTER SET $wpdb->charset";
14
-
15
- return '';
16
  }
17
 
18
  function bp_core_install( $active_components = false ) {
@@ -242,14 +239,14 @@ function bp_core_install_extended_profiles() {
242
  $charset_collate = bp_core_set_charset();
243
  $bp_prefix = bp_core_get_table_prefix();
244
 
245
- // These values should only be updated if they are not already present
246
- if ( !$base_group_name = bp_get_option( 'bp-xprofile-base-group-name' ) ) {
247
- bp_update_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) );
248
- }
249
 
250
- if ( !$fullname_field_name = bp_get_option( 'bp-xprofile-fullname-field-name' ) ) {
251
- bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) );
252
- }
253
 
254
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
255
  id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -339,52 +336,3 @@ function bp_core_install_blog_tracking() {
339
 
340
  dbDelta( $sql );
341
  }
342
-
343
- /**
344
- * I don't appear to be used anymore, but I'm here anyways. I was originally
345
- * used in olden days to update pre-1.1 schemas, but that was before we had
346
- * a legitimate update process. Keep me around just incase.
347
- *
348
- * @global WPDB $wpdb
349
- * @global BuddyPress $bp
350
- */
351
- function bp_update_db_stuff() {
352
- global $wpdb, $bp;
353
-
354
- $bp_prefix = bp_core_get_table_prefix();
355
-
356
- // Rename the old user activity cached table if needed.
357
- if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) )
358
- $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
359
-
360
- // Rename fields from pre BP 1.2
361
- if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
362
- if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) {
363
- $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
364
- }
365
-
366
- if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) {
367
- $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
368
- }
369
- }
370
-
371
- // On first installation - record all existing blogs in the system.
372
- if ( !(int) $bp->site_options['bp-blogs-first-install'] ) {
373
- bp_blogs_record_existing_blogs();
374
- bp_update_option( 'bp-blogs-first-install', 1 );
375
- }
376
-
377
- if ( is_multisite() ) {
378
- bp_core_add_illegal_names();
379
- }
380
-
381
- // Update and remove the message threads table if it exists
382
- if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
383
- if ( BP_Messages_Thread::update_tables() ) {
384
- $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
385
- }
386
- }
387
-
388
- }
389
-
390
- ?>
8
 
9
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
10
 
11
+ // BuddyPress component DB schema
12
+ return !empty( $wpdb->charset ) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : '';
 
 
 
13
  }
14
 
15
  function bp_core_install( $active_components = false ) {
239
  $charset_collate = bp_core_set_charset();
240
  $bp_prefix = bp_core_get_table_prefix();
241
 
242
+ // These values should only be updated if they are not already present
243
+ if ( ! bp_get_option( 'bp-xprofile-base-group-name' ) ) {
244
+ bp_update_option( 'bp-xprofile-base-group-name', _x( 'General', 'First field-group name', 'buddypress' ) );
245
+ }
246
 
247
+ if ( ! bp_get_option( 'bp-xprofile-fullname-field-name' ) ) {
248
+ bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Display Name', 'Display name field', 'buddypress' ) );
249
+ }
250
 
251
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
252
  id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
336
 
337
  dbDelta( $sql );
338
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/admin/bp-core-settings.php CHANGED
@@ -247,7 +247,7 @@ function bp_admin_setting_callback_bbpress_configuration() {
247
  function bp_core_admin_settings() {
248
 
249
  // We're saving our own options, until the WP Settings API is updated to work with Multisite
250
- $form_action = add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) );
251
 
252
  ?>
253
 
@@ -264,7 +264,7 @@ function bp_core_admin_settings() {
264
  <?php do_settings_sections( 'buddypress' ); ?>
265
 
266
  <p class="submit">
267
- <input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" />
268
  </p>
269
  </form>
270
  </div>
@@ -313,7 +313,7 @@ function bp_core_admin_settings_save() {
313
  bp_update_option( $legacy_option, $value );
314
  }
315
 
316
- bp_core_redirect( add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) );
317
  }
318
  }
319
  add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 );
@@ -365,4 +365,3 @@ function bp_form_option( $option, $default = '' , $slug = false ) {
365
  // Allow plugins to further filter the output
366
  return apply_filters( 'bp_get_form_option', $value, $option );
367
  }
368
- ?>
247
  function bp_core_admin_settings() {
248
 
249
  // We're saving our own options, until the WP Settings API is updated to work with Multisite
250
+ $form_action = add_query_arg( 'page', 'bp-settings', bp_get_admin_url( 'admin.php' ) );
251
 
252
  ?>
253
 
264
  <?php do_settings_sections( 'buddypress' ); ?>
265
 
266
  <p class="submit">
267
+ <input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'buddypress' ); ?>" />
268
  </p>
269
  </form>
270
  </div>
313
  bp_update_option( $legacy_option, $value );
314
  }
315
 
316
+ bp_core_redirect( add_query_arg( array( 'page' => 'bp-settings', 'updated' => 'true' ), bp_get_admin_url( 'admin.php' ) ) );
317
  }
318
  }
319
  add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 );
365
  // Allow plugins to further filter the output
366
  return apply_filters( 'bp_get_form_option', $value, $option );
367
  }
 
bp-core/admin/bp-core-slugs.php CHANGED
@@ -29,7 +29,7 @@ function bp_core_admin_slugs_settings() {
29
  <?php bp_core_admin_slugs_options(); ?>
30
 
31
  <p class="submit clear">
32
- <input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php _e( 'Save All', 'buddypress' ) ?>"/>
33
  </p>
34
 
35
  <?php wp_nonce_field( 'bp-admin-pages-setup' ); ?>
@@ -43,9 +43,6 @@ function bp_core_admin_slugs_settings() {
43
  /**
44
  * Creates reusable markup for page setup on the Components and Pages dashboard panel.
45
  *
46
- * This markup has been abstracted so that it can be used both during the setup wizard as well as
47
- * when BP has been fully installed.
48
- *
49
  * @package BuddyPress
50
  * @since BuddyPress (1.6)
51
  * @todo Use settings API
@@ -94,8 +91,8 @@ function bp_core_admin_slugs_options() {
94
  </th>
95
 
96
  <td>
97
- <?php if ( !bp_is_root_blog() )
98
- switch_to_blog( bp_get_root_blog_id() ) ?>
99
 
100
  <?php echo wp_dropdown_pages( array(
101
  'name' => 'bp_pages[' . esc_attr( $name ) . ']',
@@ -113,8 +110,7 @@ function bp_core_admin_slugs_options() {
113
 
114
  <?php endif; ?>
115
 
116
- <?php if ( !bp_is_root_blog() )
117
- restore_current_blog() ?>
118
 
119
  </td>
120
  </tr>
@@ -138,9 +134,9 @@ function bp_core_admin_slugs_options() {
138
  'register' => __( 'Register', 'buddypress' ),
139
  'activate' => __( 'Activate', 'buddypress' ),
140
  );
141
-
142
  $static_pages = apply_filters( 'bp_static_pages', $static_pages );
143
-
144
  if ( !empty( $static_pages ) ) : ?>
145
 
146
  <h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
@@ -158,6 +154,9 @@ function bp_core_admin_slugs_options() {
158
  </th>
159
 
160
  <td>
 
 
 
161
  <?php echo wp_dropdown_pages( array(
162
  'name' => 'bp_pages[' . esc_attr( $name ) . ']',
163
  'echo' => false,
@@ -174,6 +173,8 @@ function bp_core_admin_slugs_options() {
174
 
175
  <?php endif; ?>
176
 
 
 
177
  </td>
178
  </tr>
179
 
@@ -219,6 +220,4 @@ function bp_core_admin_slugs_setup_handler() {
219
  wp_redirect( $base_url );
220
  }
221
  }
222
- add_action( 'admin_init', 'bp_core_admin_slugs_setup_handler' );
223
-
224
- ?>
29
  <?php bp_core_admin_slugs_options(); ?>
30
 
31
  <p class="submit clear">
32
+ <input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
33
  </p>
34
 
35
  <?php wp_nonce_field( 'bp-admin-pages-setup' ); ?>
43
  /**
44
  * Creates reusable markup for page setup on the Components and Pages dashboard panel.
45
  *
 
 
 
46
  * @package BuddyPress
47
  * @since BuddyPress (1.6)
48
  * @todo Use settings API
91
  </th>
92
 
93
  <td>
94
+
95
+ <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?>
96
 
97
  <?php echo wp_dropdown_pages( array(
98
  'name' => 'bp_pages[' . esc_attr( $name ) . ']',
110
 
111
  <?php endif; ?>
112
 
113
+ <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
 
114
 
115
  </td>
116
  </tr>
134
  'register' => __( 'Register', 'buddypress' ),
135
  'activate' => __( 'Activate', 'buddypress' ),
136
  );
137
+
138
  $static_pages = apply_filters( 'bp_static_pages', $static_pages );
139
+
140
  if ( !empty( $static_pages ) ) : ?>
141
 
142
  <h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
154
  </th>
155
 
156
  <td>
157
+
158
+ <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?>
159
+
160
  <?php echo wp_dropdown_pages( array(
161
  'name' => 'bp_pages[' . esc_attr( $name ) . ']',
162
  'echo' => false,
173
 
174
  <?php endif; ?>
175
 
176
+ <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
177
+
178
  </td>
179
  </tr>
180
 
220
  wp_redirect( $base_url );
221
  }
222
  }
223
+ add_action( 'bp_admin_init', 'bp_core_admin_slugs_setup_handler' );
 
 
bp-core/admin/bp-core-update.php DELETED
@@ -1,1051 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( !defined( 'ABSPATH' ) ) exit;
5
-
6
- class BP_Core_Setup_Wizard {
7
-
8
- /**
9
- * @var int The current step of the updater
10
- */
11
- var $current_step;
12
-
13
- /**
14
- *
15
- * @var array The total steps to be completed
16
- */
17
- var $steps;
18
-
19
- /** Methods ***************************************************************/
20
-
21
- function __construct() {
22
-
23
- // Set/reset the wizard cookie
24
- setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
25
- $_COOKIE['bp-wizard-step'] = 0;
26
-
27
- // Call the save method that will save data and modify $current_step
28
- if ( isset( $_POST['save'] ) )
29
- $this->save( $_POST['save'] );
30
-
31
- // Build the steps needed for update or new installations
32
- $this->steps = $this->add_steps();
33
- }
34
-
35
- function current_step() {
36
- if ( isset( $_POST['step'] ) ) {
37
- $current_step = (int) $_POST['step'] + 1;
38
- } else {
39
- if ( !empty( $_COOKIE['bp-wizard-step'] ) ) {
40
- $current_step = $_COOKIE['bp-wizard-step'];
41
- } else {
42
- $current_step = 0;
43
- }
44
- }
45
-
46
- return $current_step;
47
- }
48
-
49
- function add_steps() {
50
-
51
- // Setup wizard steps
52
- $steps = array();
53
-
54
- // This is a first time installation
55
- if ( bp_get_maintenance_mode() == 'install' ) {
56
- $steps = array(
57
- __( 'Components', 'buddypress' ),
58
- __( 'Pages', 'buddypress' ),
59
- __( 'Permalinks', 'buddypress' ),
60
- __( 'Theme', 'buddypress' ),
61
- __( 'Finish', 'buddypress' )
62
- );
63
-
64
- // This is an update to an existing install
65
- } else {
66
-
67
- // New for BP 1.5
68
- if ( bp_get_db_version_raw() < 1801 || !bp_core_get_directory_page_ids() ) {
69
- $steps[] = __( 'Components', 'buddypress' );
70
- $steps[] = __( 'Pages', 'buddypress' );
71
- }
72
-
73
- // New for BP 1.6
74
- if ( bp_get_db_version_raw() < 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) )
75
- $steps[] = __( 'Toolbar', 'buddypress' );
76
-
77
- if ( bp_get_db_version_raw() < (int) bp_get_db_version() )
78
- $steps[] = __( 'Database Update', 'buddypress' );
79
-
80
- $steps[] = __( 'Finish', 'buddypress' );
81
- }
82
-
83
- return $steps;
84
- }
85
-
86
- function save( $step_name ) {
87
-
88
- // Bail if user is not capable of being here
89
- if ( ! bp_current_user_can( 'activate_plugins' ) )
90
- wp_die( 'Uh... No.' );
91
-
92
- // Save any posted values
93
- switch ( $step_name ) {
94
- case 'db_update':
95
- $result = $this->step_db_update_save();
96
- break;
97
-
98
- case 'components':
99
- $result = $this->step_components_save();
100
- break;
101
-
102
- case 'pages':
103
- $result = $this->step_pages_save();
104
- break;
105
-
106
- case 'permalinks':
107
- $result = $this->step_permalinks_save();
108
- break;
109
-
110
- case 'theme':
111
- $result = $this->step_theme_save();
112
- break;
113
-
114
- case 'admin_bar':
115
- $result = $this->step_admin_bar_save();
116
- break;
117
-
118
- case 'finish':
119
- default:
120
- $result = $this->step_finish_save();
121
- break;
122
- }
123
-
124
- if ( 'finish' != $step_name )
125
- setcookie( 'bp-wizard-step', (int) $this->current_step(), time() + 60 * 60 * 24, COOKIEPATH );
126
- }
127
-
128
- function html() {
129
-
130
- // Bail if user is not capable of being here
131
- if ( ! bp_current_user_can( 'activate_plugins' ) )
132
- wp_die( 'You do not have sufficient permissions to access this page.' );
133
-
134
- // Update or Setup
135
- $type = ( 'update' == bp_get_maintenance_mode() ) ? __( 'Update', 'buddypress' ) : __( 'Setup', 'buddypress' );
136
-
137
- ?>
138
-
139
- <div class="wrap" id="bp-wizard">
140
-
141
- <?php screen_icon( 'buddypress' ); ?>
142
-
143
- <h2><?php printf( __( 'BuddyPress %s', 'buddypress' ), $type ); ?></h2>
144
-
145
- <?php
146
- do_action( 'bp_admin_notices' );
147
-
148
- $step_count = count( $this->steps ) - 1;
149
- $wiz_or_set = $this->current_step() >= $step_count ? 'bp-components' : 'bp-wizard';
150
- $form_action = bp_core_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'index.php' ) );
151
- ?>
152
-
153
- <form action="<?php echo $form_action; ?>" method="post" id="bp-wizard-form">
154
- <div id="bp-wizard-nav">
155
- <ol>
156
-
157
- <?php foreach( (array) $this->steps as $i => $name ) : ?>
158
-
159
- <li<?php if ( $this->current_step() == $i ) : ?> class="current"<?php endif; ?>>
160
- <?php if ( $this->current_step() > $i ) : ?>
161
-
162
- <span class="complete">&nbsp;</span>
163
-
164
- <?php else :
165
-
166
- echo $i + 1 . '. ';
167
-
168
- endif;
169
-
170
- echo esc_attr( $name ) ?>
171
-
172
- </li>
173
-
174
- <?php endforeach; ?>
175
-
176
- </ol>
177
-
178
- <?php if ( __( 'Finish', 'buddypress' ) == $this->steps[$this->current_step()] ) : ?>
179
-
180
- <div class="prev-next submit clear">
181
- <input type="submit" value="<?php _e( 'Finish &amp; Activate', 'buddypress' ); ?>" name="submit" />
182
- </div>
183
-
184
- <?php else : ?>
185
-
186
- <div class="prev-next submit clear">
187
- <input type="submit" value="<?php _e( 'Save &amp; Next', 'buddypress' ); ?>" name="submit" />
188
- </div>
189
-
190
- <?php endif; ?>
191
-
192
- </div>
193
-
194
- <div id="bp-wizard-content">
195
-
196
- <?php switch ( $this->steps[$this->current_step()] ) {
197
- case __( 'Database Update', 'buddypress') :
198
- $this->step_db_update();
199
- break;
200
-
201
- case __( 'Components', 'buddypress') :
202
- $this->step_components();
203
- break;
204
-
205
- case __( 'Pages', 'buddypress') :
206
- $this->step_pages();
207
- break;
208
-
209
- case __( 'Permalinks', 'buddypress') :
210
- $this->step_permalinks();
211
- break;
212
-
213
- case __( 'Theme', 'buddypress') :
214
- $this->step_theme();
215
- break;
216
-
217
- case __( 'Toolbar', 'buddypress' ) :
218
- $this->step_admin_bar();
219
- break;
220
-
221
- case __( 'Finish', 'buddypress') :
222
- $this->step_finish();
223
- break;
224
- } ?>
225
-
226
- </div>
227
- </form>
228
- </div>
229
-
230
- <?php
231
- }
232
-
233
- /** Screen methods ********************************************************/
234
-
235
- function step_db_update() {
236
- ?>
237
-
238
- <p><?php _e( 'To complete the update, a few changes need to be made to your database. These changes are not destructive and will not remove or change any existing settings.', 'buddypress' ); ?></p>
239
-
240
- <div class="submit clear">
241
- <input type="hidden" name="save" value="db_update" />
242
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
243
-
244
- <?php wp_nonce_field( 'bpwizard_db_update' ) ?>
245
-
246
- </div>
247
-
248
- <?php
249
- }
250
-
251
- function step_components() {
252
-
253
- if ( !function_exists( 'bp_core_admin_components_options' ) )
254
- require ( BP_PLUGIN_DIR . 'bp-core/admin/bp-core-components.php' ); ?>
255
-
256
- <p><?php _e( "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future.", 'buddypress' ); ?></p>
257
-
258
- <?php bp_core_admin_components_options(); ?>
259
-
260
- <div class="submit clear">
261
- <input type="hidden" name="save" value="components" />
262
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
263
-
264
- <?php wp_nonce_field( 'bpwizard_components' ); ?>
265
-
266
- </div>
267
-
268
- <?php
269
- }
270
-
271
- function step_pages() {
272
- global $bp, $wpdb;
273
-
274
- // Make sure that page info is pulled from bp_get_root_blog_id() (except when in
275
- // multisite mode)
276
- if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
277
- switch_to_blog( bp_get_root_blog_id() );
278
-
279
- $existing_pages = bp_core_get_directory_page_ids();
280
-
281
- // Provide empty indexes to avoid PHP errors with wp_dropdown_pages()
282
- $indexes = array( 'members', 'activity', 'groups', 'forums', 'blogs', 'register', 'activate' );
283
- foreach ( $indexes as $index ) {
284
- if ( !isset( $existing_pages[$index] ) ) {
285
- $existing_pages[$index] = '';
286
- }
287
- }
288
-
289
- if ( !empty( $existing_pages['blogs'] ) )
290
- $existing_blog_page = '&selected=' . $existing_pages['blogs'];
291
- else
292
- $existing_blog_page = '';
293
-
294
- // Get active components
295
- $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
296
-
297
- // Check for defined slugs
298
- $members_slug = !empty( $bp->members->slug ) ? $bp->members->slug : __( 'members', 'buddypress' );
299
-
300
- // Groups
301
- $groups_slug = !empty( $bp->groups->slug ) ? $bp->groups->slug : __( 'groups', 'buddypress' );
302
-
303
- // Activity
304
- $activity_slug = !empty( $bp->activity->slug ) ? $bp->activity->slug : __( 'activity', 'buddypress' );
305
-
306
- // Forums
307
- $forums_slug = !empty( $bp->forums->slug ) ? $bp->forums->slug : __( 'forums', 'buddypress' );
308
-
309
- // Blogs
310
- $blogs_slug = !empty( $bp->blogs->slug ) ? $bp->blogs->slug : __( 'blogs', 'buddypress' );
311
-
312
- // Register
313
- $register_slug = !empty( $bp->register->slug ) ? $bp->register->slug : __( 'register', 'buddypress' );
314
-
315
- // Activation
316
- $activation_slug = !empty( $bp->activation->slug ) ? $bp->activation->slug : __( 'activate', 'buddypress' );
317
-
318
- ?>
319
-
320
- <script type="text/javascript">
321
- jQuery( document ).ready( function() {
322
- jQuery( 'select' ).change( function() {
323
- jQuery( this ).siblings( 'input[@type=radio]' ).click();
324
- });
325
- });
326
- </script>
327
-
328
- <p><?php _e( 'BuddyPress uses WordPress pages to display directories. This allows you to easily change their titles and relocate them.', 'buddypress' ); ?></p>
329
-
330
- <p><?php _e( 'Choose an existing page, have one auto-created, or create them manually and come back here once you are finished.', 'buddypress' ); ?></p>
331
-
332
- <table class="form-table">
333
-
334
- <tr valign="top">
335
- <th scope="row">
336
- <h5><?php _e( 'Members', 'buddypress' ); ?></h5>
337
- <p><?php _e( 'Displays member profiles, and a directory of all site members.', 'buddypress' ); ?></p>
338
- </th>
339
- <td>
340
- <p><label><input type="radio" name="bp_pages[members]" <?php checked( empty( $existing_pages['members'] ) ); ?> value="<?php echo $members_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $members_slug ); ?>/</label></p>
341
-
342
- <?php if ( $members_page_dropdown = wp_dropdown_pages( "name=bp-members-page&echo=0&selected={$existing_pages['members']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
343
-
344
- <p><label><input type="radio" name="bp_pages[members]" <?php checked( !empty( $existing_pages['members'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $members_page_dropdown ?></label></p>
345
-
346
- <?php endif ?>
347
- </td>
348
- </tr>
349
-
350
- <?php if ( isset( $active_components['groups'] ) ) : ?>
351
-
352
- <tr valign="top">
353
- <th scope="row">
354
- <h5><?php _e( 'Groups', 'buddypress' ); ?></h5>
355
- <p><?php _e( 'Displays individual groups as well as a directory of groups.', 'buddypress' ); ?></p>
356
- </th>
357
- <td>
358
- <p><label><input type="radio" name="bp_pages[groups]" <?php checked( empty( $existing_pages['groups'] ) ); ?> value="<?php echo $groups_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $groups_slug ); ?>/</label></p>
359
-
360
- <?php if ( $groups_page_dropdown = wp_dropdown_pages( "name=bp-groups-page&echo=0&selected={$existing_pages['groups']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
361
- <p><label><input type="radio" name="bp_pages[groups]" <?php checked( !empty( $existing_pages['groups'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $groups_page_dropdown ?></label></p>
362
- <?php endif ?>
363
- </td>
364
- </tr>
365
-
366
- <?php endif; ?>
367
-
368
- <?php /* The Blogs component only needs a directory page when Multisite is enabled */ ?>
369
- <?php if ( is_multisite() && isset( $active_components['blogs'] ) ) : ?>
370
-
371
- <tr valign="top">
372
- <th scope="row">
373
- <h5><?php _e( 'Blogs', 'buddypress' ); ?></h5>
374
- <p><?php _e( 'Displays a directory of the blogs in your network.', 'buddypress' ); ?></p>
375
- </th>
376
- <td>
377
- <p><label><input type="radio" name="bp_pages[blogs]" <?php checked( empty( $existing_pages['blogs'] ) ); ?> value="<?php echo $blogs_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $blogs_slug ); ?>/</label></p>
378
-
379
- <?php if ( $blogs_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['blogs']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
380
- <p><label><input type="radio" name="bp_pages[blogs]" <?php checked( !empty( $existing_pages['blogs'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $blogs_page_dropdown ?></label></p>
381
- <?php endif ?>
382
- </td>
383
- </tr>
384
-
385
- <?php endif; ?>
386
-
387
- <?php if ( isset( $active_components['activity'] ) ) : ?>
388
-
389
- <tr valign="top">
390
- <th scope="row">
391
- <h5><?php _e( 'Activity', 'buddypress' ); ?></h5>
392
- <p><?php _e( "Displays the activity for the entire site, a member's friends, groups and @mentions.", 'buddypress' ); ?></p>
393
- </th>
394
- <td>
395
- <p><label><input type="radio" name="bp_pages[activity]" <?php checked( empty( $existing_pages['activity'] ) ); ?> value="<?php echo $activity_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activity_slug ); ?>/</label></p>
396
-
397
- <?php if ( $activity_page_dropdown = wp_dropdown_pages( "name=bp-activity-page&echo=0&selected={$existing_pages['activity']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
398
- <p><label><input type="radio" name="bp_pages[activity]" <?php checked( !empty( $existing_pages['activity'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activity_page_dropdown ?></label></p>
399
- <?php endif ?>
400
- </td>
401
- </tr>
402
-
403
- <?php endif; ?>
404
-
405
- <?php if ( isset( $active_components['forums'] ) ) : ?>
406
-
407
- <tr valign="top">
408
- <th scope="row">
409
- <h5><?php _e( 'Forums', 'buddypress' ); ?></h5>
410
- <p><?php _e( 'Displays a directory of public forum topics.', 'buddypress' ); ?></p>
411
- </th>
412
- <td>
413
- <p><label><input type="radio" name="bp_pages[forums]" <?php checked( empty( $existing_pages['forums'] ) ); ?> value="<?php echo $forums_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $forums_slug ); ?>/</label></p>
414
-
415
- <?php if ( $forums_page_dropdown = wp_dropdown_pages( "name=bp-forums-page&echo=0&selected={$existing_pages['forums']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
416
- <p><label><input type="radio" name="bp_pages[forums]" <?php checked( !empty( $existing_pages['forums'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $forums_page_dropdown ?></label></p>
417
- <?php endif ?>
418
- </td>
419
- </tr>
420
-
421
- <?php endif; ?>
422
-
423
- <tr valign="top">
424
- <th scope="row">
425
- <h5><?php _e( 'Register', 'buddypress' ); ?></h5>
426
- <p><?php _e( 'Displays a site registration page where users can create new accounts.', 'buddypress' ); ?></p>
427
- </th>
428
- <td>
429
- <p><label><input type="radio" name="bp_pages[register]" <?php checked( empty( $existing_pages['register'] ) ); ?> value="<?php echo $register_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $register_slug ) ?>/</label></p>
430
-
431
- <?php if ( $register_page_dropdown = wp_dropdown_pages( "name=bp-register-page&echo=0&selected={$existing_pages['register']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
432
- <p><label><input type="radio" name="bp_pages[register]" <?php checked( !empty( $existing_pages['register'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $register_page_dropdown ?></label></p>
433
- <?php endif ?>
434
- </td>
435
- </tr>
436
-
437
- <tr valign="top">
438
- <th scope="row">
439
- <h5><?php _e( 'Activate', 'buddypress' ); ?></h5>
440
- <p><?php _e( 'The page users will visit to activate their account once they have registered.', 'buddypress' ); ?></p>
441
- </th>
442
- <td>
443
- <p><label><input type="radio" name="bp_pages[activate]" <?php checked( empty( $existing_pages['activate'] ) ); ?> value="<?php echo $activation_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activation_slug ); ?>/</label></p>
444
-
445
- <?php if ( $activate_page_dropdown = wp_dropdown_pages( "name=bp-activate-page&echo=0&selected={$existing_pages['activate']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
446
- <p><label><input type="radio" name="bp_pages[activate]" <?php checked( !empty( $existing_pages['activate'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activate_page_dropdown ?></label></p>
447
- <?php endif ?>
448
- </td>
449
- </tr>
450
- </table>
451
-
452
- <div class="submit clear">
453
- <input type="hidden" name="save" value="pages" />
454
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
455
-
456
- <?php wp_nonce_field( 'bpwizard_pages' ); ?>
457
-
458
- </div>
459
-
460
- <?php
461
-
462
- restore_current_blog();
463
- }
464
-
465
- function step_permalinks() {
466
-
467
- $prefix = '';
468
- $permalink_structure = bp_get_option( 'permalink_structure' );
469
- $structures = array( '', $prefix . '/%year%/%monthnum%/%day%/%postname%/', $prefix . '/%year%/%monthnum%/%postname%/', $prefix . '/archives/%post_id%' );
470
-
471
- // If we're using permalinks already, adjust text accordingly
472
- if ( !empty( $permalink_structure ) )
473
- $permalink_setup_text = __( 'Your permalink settings are compatible with BuddyPress.', 'buddypress' );
474
- else
475
- $permalink_setup_text = __( 'Pretty permalinks must be active on your site.', 'buddypress' );
476
-
477
- if ( !got_mod_rewrite() && !iis7_supports_permalinks() )
478
- $prefix = '/index.php'; ?>
479
-
480
- <p><?php echo $permalink_setup_text; ?></p>
481
- <p><?php printf( __( 'For more advanced options please visit the <a href="%s">permalink settings page</a> now and come back here later.', 'buddypress' ), admin_url( 'options-permalink.php' ) ); ?>
482
-
483
- <table class="form-table">
484
- <tr>
485
- <th><label><input name="permalink_structure" type="radio"<?php if ( empty( $permalink_structure ) || false != strpos( $permalink_structure, $structures[1] ) ) : ?> checked="checked" <?php endif; ?>value="<?php echo esc_attr( $structures[1] ); ?>" class="tog" <?php checked( $structures[1], $permalink_structure ); ?> />&nbsp;<?php _e( 'Day and name' ); ?></label></th>
486
- <td><code><?php echo get_home_url() . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></td>
487
- </tr>
488
- <tr>
489
- <th><label><input name="permalink_structure" type="radio"<?php if ( empty( $permalink_structure ) || false != strpos( $permalink_structure, $structures[2] ) ) : ?> checked="checked" <?php endif; ?> value="<?php echo esc_attr( $structures[2] ); ?>" class="tog" <?php checked( $structures[2], $permalink_structure ); ?> />&nbsp;<?php _e( 'Month and name' ); ?></label></th>
490
- <td><code><?php echo get_home_url() . $prefix . '/' . date('Y') . '/' . date('m') . '/sample-post/'; ?></code></td>
491
- </tr>
492
- <tr>
493
- <th><label><input name="permalink_structure" type="radio"<?php if ( empty( $permalink_structure ) || false != strpos( $permalink_structure, $structures[3] ) ) : ?> checked="checked" <?php endif; ?> value="<?php echo esc_attr( $structures[3] ); ?>" class="tog" <?php checked( $structures[3], $permalink_structure ); ?> />&nbsp;<?php _e( 'Numeric' ); ?></label></th>
494
- <td><code><?php echo get_home_url() . $prefix ?>/archives/123</code></td>
495
- </tr>
496
- </table>
497
-
498
- <div class="submit clear">
499
- <input type="hidden" name="save" value="permalinks" />
500
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
501
-
502
- <?php if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && empty( $_POST['skip-htaccess'] ) ) : ?>
503
-
504
- <input type="hidden" name="skip-htaccess" value="skip-htaccess" />
505
-
506
- <?php endif; ?>
507
-
508
- <?php wp_nonce_field( 'bpwizard_permalinks' ); ?>
509
-
510
- </div>
511
-
512
- <?php
513
- }
514
-
515
- function step_theme() {
516
- global $bp;
517
-
518
- $installed_plugins = get_plugins();
519
- $installed_themes = wp_get_themes();
520
- $bp_themes = array();
521
-
522
- $template_pack_installed = false;
523
- $bp_theme_installed = false;
524
-
525
- foreach ( (array) $installed_plugins as $plugin ) {
526
- if ( 'BuddyPress Template Pack' == $plugin['Name'] ) {
527
- $template_pack_installed = true;
528
- }
529
- }
530
-
531
- foreach ( (array) $installed_themes as $theme ) {
532
- foreach ( (array) $theme['Tags'] as $tag ) {
533
- if ( ( 'BuddyPress Default' != $theme['Name'] ) && ( 'buddypress' == $tag ) ) {
534
- $bp_theme_installed = true;
535
- $bp_themes[] = $theme;
536
- }
537
- }
538
- }
539
-
540
- // Get theme screenshot
541
- $current_theme = wp_get_theme();
542
- $screenshot = '';
543
-
544
- if ( !empty( $installed_themes[$current_theme->stylesheet]['Screenshot'] ) ) {
545
- $screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $installed_themes[$current_theme->stylesheet]['Screenshot'];
546
- } ?>
547
-
548
- <script type="text/javascript">
549
- jQuery( document ).ready( function() {
550
- jQuery( 'select' ).change( function() {
551
- jQuery( this ).siblings( 'input[@type=radio]' ).click();
552
- });
553
- });
554
- </script>
555
-
556
- <table class="form-table">
557
- <tr>
558
- <th>
559
- <h5><?php _e( 'Use BuddyPress Default', 'buddypress' ); ?></h5>
560
- <img src="<?php echo plugins_url( 'bp-themes/bp-default/screenshot.png', $bp->file ); ?>" alt="<?php _e( 'BuddyPress Default', 'buddypress' ); ?>" />
561
- </th>
562
- <td>
563
- <p><?php _e( 'The default BuddyPress theme comes with the basics, to get up and running out of the box. It supports all features and is highly customizable.', 'buddypress' ); ?></p>
564
- <p><strong><?php _e( 'This is the best choice if you want to start using BuddyPress immediately.', 'buddypress' ); ?></strong></p>
565
- <p><label><input type="radio" name="theme" value="bp_default" checked="checked" /> <?php _e( 'Yes, please!', 'buddypress' ); ?></label></p>
566
- </td>
567
- </tr>
568
-
569
- <?php if ( !empty( $bp_theme_installed ) ) : ?>
570
-
571
- <tr>
572
- <th>
573
- <h5><?php _e( 'Other themes', 'buddypress' ); ?></h5>
574
- <img src="<?php echo plugins_url( 'bp-core/admin/images/find.png', $bp->file ); ?>" alt="<?php _e( 'A BuddyPress theme', 'buddypress' ); ?>" />
575
- </th>
576
- <td>
577
- <p><?php _e( "You have some other BuddyPress compatible themes available. Pick one of them from this list to use it.", 'buddypress' ); ?></p>
578
- <p>
579
- <label>
580
- <input type="radio" name="theme" value="3rd_party" /> <?php _e( 'Use this theme', 'buddypress' ); ?>
581
- </label>
582
- <select name="3rd_party_theme">
583
-
584
- <?php foreach( (array) $bp_themes as $theme ) : ?>
585
-
586
- <option value="<?php echo $theme['Template'] . ',' . $theme['Stylesheet']; ?>"><?php echo $theme['Name']; ?></option>
587
-
588
- <?php endforeach; ?>
589
-
590
- </select>
591
- </p>
592
- </td>
593
- </tr>
594
-
595
- <?php endif; ?>
596
-
597
- <?php if ( ! current_theme_supports( 'buddypress' ) ) : ?>
598
-
599
- <tr>
600
- <th>
601
- <h5><?php _e( 'Manually update current theme', 'buddypress' ); ?></h5>
602
-
603
- <?php if ( !empty( $screenshot ) ) : ?>
604
-
605
- <img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php _e( 'Your existing theme', 'buddypress' ); ?>" />
606
-
607
- <?php endif; ?>
608
-
609
- </th>
610
- <td>
611
- <p><?php _e( 'The BuddyPress Template Pack will guide you through the process of manually editing your existing theme. It comes with a step-by-step guide and involves copying the BuddyPress template files into your theme. <strong>This option requires knowledge of CSS and HTML.</strong> You will need to tweak the new templates to match your existing theme.', 'buddypress' ); ?></p>
612
-
613
- <?php if ( empty( $template_pack_installed ) ) : ?>
614
-
615
- <p><a id="bp-template-pack" class="thickbox onclick button" href="<?php echo network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=bp-template-pack&TB_iframe=true&width=640&height=500' ); ?>"><?php _e( 'Install BuddyPress Template Pack', 'buddypress' ); ?></a></p>
616
-
617
- <?php else : ?>
618
-
619
- <p><label><input type="radio" name="theme" value="manual_wp" /> <?php _e( 'Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)', 'buddypress' ); ?></label></p>
620
- <p><a id="bp-template-pack" class="button installed disabled" href="javascript:void();"><span></span><?php _e( 'Plugin Installed', 'buddypress' ); ?></a></p>
621
-
622
- <?php endif; ?>
623
-
624
- </td>
625
- </tr>
626
-
627
- <?php endif; ?>
628
-
629
- <tr>
630
- <th>
631
- <h5><?php _e( 'Do not change theme', 'buddypress' ) ?></h5>
632
- </th>
633
- <td>
634
- <p><?php _e( "You are happy with your current theme and plan on changing it later.", 'buddypress' ); ?></p>
635
- <p><strong><?php _e( 'This is the best choice if you have a custom theme already and want to manually integrate BuddyPress later.', 'buddypress' ); ?></strong></p>
636
-
637
- <p><label><input type="radio" name="theme" value="do_not_change" /> <?php _e( "Don't change my current theme", 'buddypress' ); ?></label></p>
638
-
639
- </td>
640
- </tr>
641
- </table>
642
-
643
- <div class="submit clear">
644
- <input type="hidden" name="save" value="theme" />
645
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ) ?>" />
646
-
647
- <?php wp_nonce_field( 'bpwizard_theme' ) ?>
648
-
649
- </div>
650
-
651
- <?php
652
- }
653
-
654
- /**
655
- * When upgrading to BP 1.6, prompt the admin to switch to WordPress' Toolbar.
656
- *
657
- * @since 1.6
658
- */
659
- function step_admin_bar() {
660
- ?>
661
-
662
- <p><?php _e( "BuddyPress now uses the WordPress Toolbar; we've turbo-charged it by adding social items to help your users explore your site and manage their content.", 'buddypress' ); ?></p>
663
-
664
- <p><?php _e( "We've noticed that your site uses the old bar from earlier versions of BuddyPress.", 'buddypress' ); ?></p>
665
-
666
- <p>
667
- <label>
668
- <input type="checkbox" name="keep_buddybar" value="1" />
669
- <?php _e( "If you'd prefer to not switch to the WordPress Toolbar just yet, check this box. Don't worry, you can change your mind later.", 'buddypress' ); ?>
670
- </label>
671
- </p>
672
-
673
- <div class="submit clear">
674
- <input type="hidden" name="save" value="admin_bar" />
675
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
676
-
677
- <?php wp_nonce_field( 'bpwizard_admin_bar' ) ?>
678
-
679
- </div>
680
-
681
- <?php
682
- }
683
-
684
- function step_finish() {
685
-
686
- // What type of action is happening here?
687
- $type = ( bp_get_maintenance_mode() == 'install' ) ? __( 'setup', 'buddypress' ) : __( 'update', 'buddypress' ); ?>
688
-
689
- <p><?php printf( __( "The BuddyPress %1\$s is complete, and your site is ready to go!", 'buddypress' ), $type ); ?></p>
690
-
691
- <div class="submit clear">
692
- <input type="hidden" name="save" value="finish" />
693
- <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
694
-
695
- <?php wp_nonce_field( 'bpwizard_finish' ); ?>
696
-
697
- </div>
698
-
699
- <?php
700
- }
701
-
702
- /** Save Step Methods *****************************************************/
703
-
704
- function step_db_update_save() {
705
-
706
- if ( isset( $_POST['submit'] ) ) {
707
- check_admin_referer( 'bpwizard_db_update' );
708
-
709
- // Run the schema install to update tables
710
- bp_core_install();
711
-
712
- // Update to 1.5
713
- if ( bp_get_db_version_raw() < 1801 )
714
- $this->update_1_5();
715
-
716
- // Update to 1.6
717
- if ( bp_get_db_version_raw() < bp_get_db_version() )
718
- $this->update_1_6();
719
-
720
- return true;
721
- }
722
-
723
- return false;
724
- }
725
-
726
- function step_components_save() {
727
-
728
- if ( isset( $_POST['submit'] ) && isset( $_POST['bp_components'] ) ) {
729
-
730
- check_admin_referer( 'bpwizard_components' );
731
-
732
- $active_components = array();
733
-
734
- // Settings form submitted, now save the settings.
735
- foreach ( (array) $_POST['bp_components'] as $key => $value ) {
736
- $active_components[$key] = 1;
737
- }
738
-
739
- bp_update_option( 'bp-active-components', $active_components );
740
-
741
- wp_cache_flush();
742
- bp_core_install();
743
-
744
- return true;
745
- }
746
-
747
- return false;
748
- }
749
-
750
- function step_pages_save() {
751
- global $wpdb;
752
-
753
- if ( isset( $_POST['submit'] ) && isset( $_POST['bp_pages'] ) ) {
754
- check_admin_referer( 'bpwizard_pages' );
755
-
756
- // Make sure that the pages are created on the bp_get_root_blog_id(), no matter which Dashboard the setup is being run on
757
- if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
758
- switch_to_blog( bp_get_root_blog_id() );
759
-
760
- // Delete any existing pages
761
- $existing_pages = bp_core_get_directory_page_ids();
762
-
763
- foreach ( (array) $existing_pages as $page_id ) {
764
- wp_delete_post( $page_id, true );
765
- }
766
-
767
- $blog_pages = $this->setup_pages( (array) $_POST['bp_pages'] );
768
- bp_update_option( 'bp-pages', $blog_pages );
769
-
770
- if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
771
- restore_current_blog();
772
-
773
- return true;
774
- }
775
-
776
- return false;
777
- }
778
-
779
- function step_permalinks_save() {
780
- global $wp_rewrite, $current_site, $current_blog;
781
-
782
- // Prevent debug notices
783
- $iis7_permalinks = $usingpi = $writable = false;
784
-
785
- if ( isset( $_POST['submit'] ) ) {
786
- check_admin_referer( 'bpwizard_permalinks' );
787
-
788
- $home_path = get_home_path();
789
- $iis7_permalinks = iis7_supports_permalinks();
790
-
791
- if ( isset( $_POST['permalink_structure'] ) ) {
792
- $permalink_structure = $_POST['permalink_structure'];
793
-
794
- if ( !empty( $permalink_structure ) )
795
- $permalink_structure = preg_replace( '#/+#', '/', '/' . $_POST['permalink_structure'] );
796
-
797
- if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain . $current_site->path == $current_blog->domain . $current_blog->path )
798
- $permalink_structure = '/blog' . $permalink_structure;
799
-
800
- $wp_rewrite->set_permalink_structure( $permalink_structure );
801
- }
802
-
803
- if ( !empty( $iis7_permalinks ) ) {
804
- if ( ( !file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) {
805
- $writable = true;
806
- }
807
- } else {
808
- if ( ( !file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) {
809
- $writable = true;
810
- }
811
- }
812
-
813
- if ( $wp_rewrite->using_index_permalinks() )
814
- $usingpi = true;
815
-
816
- $wp_rewrite->flush_rules();
817
-
818
- if ( !empty( $iis7_permalinks ) || ( empty( $usingpi ) && empty( $writable ) ) ) {
819
-
820
- function _bp_core_wizard_step_permalinks_message() {
821
- global $wp_rewrite; ?>
822
-
823
- <div id="message" class="updated fade"><p>
824
-
825
- <?php
826
- _e( 'Oops, there was a problem creating a configuration file. ', 'buddypress' );
827
-
828
- if ( !empty( $iis7_permalinks ) ) {
829
-
830
- if ( !empty( $permalink_structure ) && empty( $usingpi ) && empty( $writable ) ) {
831
-
832
- _e( 'If your <code>web.config</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code> element in <code>web.config</code> file.' ); ?>
833
-
834
- <br /><br />
835
-
836
- <textarea rows="9" class="large-text readonly" style="background: #fff;" name="rules" id="rules" readonly="readonly"><?php echo esc_html( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea>
837
-
838
- <?php
839
-
840
- } else if ( !empty( $permalink_structure ) && empty( $usingpi ) && !empty( $writable ) ); {
841
- _e( 'Permalink structure updated. Remove write access on web.config file now!' );
842
- }
843
-
844
- } else {
845
-
846
- _e( 'If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.' ); ?>
847
-
848
- <br /><br />
849
-
850
- <textarea rows="6" class="large-text readonly" style="background: #fff;" name="rules" id="rules" readonly="readonly"><?php echo esc_html( $wp_rewrite->mod_rewrite_rules() ); ?></textarea>
851
-
852
- <?php } ?>
853
-
854
- <br /><br />
855
-
856
- <?php
857
- if ( empty( $iis7_permalinks ) )
858
- _e( 'Paste all these rules into a new <code>.htaccess</code> file in the root of your WordPress installation and save the file. Once you\'re done, please hit the "Save and Next" button to continue.', 'buddypress' );
859
- ?>
860
-
861
- </p></div>
862
-
863
- <?php
864
- }
865
-
866
- if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && !empty( $_POST['skip-htaccess'] ) ) {
867
- return true;
868
- } else {
869
- add_action( 'bp_admin_notices', '_bp_core_wizard_step_permalinks_message' );
870
- return false;
871
- }
872
- }
873
-
874
- return true;
875
- }
876
-
877
- return false;
878
- }
879
-
880
- function step_theme_save() {
881
- global $bp;
882
-
883
- if ( isset( $_POST['submit'] ) && isset( $_POST['theme'] ) ) {
884
- check_admin_referer( 'bpwizard_theme' );
885
-
886
- if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
887
- switch_to_blog( bp_get_root_blog_id() );
888
-
889
- switch ( $_POST['theme'] ) {
890
-
891
- // Activate the bp-default theme
892
- case 'bp_default' :
893
- register_theme_directory( $bp->themes_dir );
894
- switch_theme( 'bp-default', 'bp-default' );
895
- break;
896
-
897
- // Activate Template Pack plugin
898
- case 'manual_wp' :
899
-
900
- // Include
901
- require_once( ABSPATH . WPINC . '/plugin.php' );
902
- $installed_plugins = get_plugins();
903
-
904
- foreach ( $installed_plugins as $key => $plugin ) {
905
- if ( 'BuddyPress Template Pack' == $plugin['Name'] ) {
906
- activate_plugin( $key );
907
- }
908
- }
909
- break;
910
-
911
- // Pick a theme from the repo
912
- case '3rd_party' :
913
- if ( empty( $_POST['3rd_party_theme'] ) )
914
- return false;
915
-
916
- $theme = explode( ',', $_POST['3rd_party_theme'] );
917
- switch_theme( $theme[0], $theme[1] );
918
- break;
919
-
920
- // Keep existing theme
921
- case 'do_not_change' :
922
- return true;
923
- break;
924
- }
925
-
926
- if ( is_multisite() )
927
- restore_current_blog();
928
-
929
- return true;
930
- }
931
-
932
- return false;
933
- }
934
-
935
- /**
936
- * When upgrading to BP 1.6, the admin is prompted to switch to WordPress' Toolbar.
937
- * If they choose not to, record that preference in the options table.
938
- *
939
- * @since 1.6
940
- */
941
- function step_admin_bar_save() {
942
- if ( isset( $_POST['submit'] ) ) {
943
- check_admin_referer( 'bpwizard_admin_bar' );
944
-
945
- if ( !empty( $_POST['keep_buddybar'] ) ) {
946
- bp_update_option( '_bp_force_buddybar', 1 );
947
- }
948
-
949
- return true;
950
- }
951
-
952
- return false;
953
- }
954
-
955
- function step_finish_save() {
956
-
957
- if ( isset( $_POST['submit'] ) ) {
958
-
959
- check_admin_referer( 'bpwizard_finish' );
960
-
961
- // Update the DB version in the database
962
- bp_version_bump();
963
-
964
- // Delete the setup cookie
965
- @setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
966
-
967
- // Redirect to the BuddyPress dashboard
968
- $redirect = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
969
- $redirect = add_query_arg( array( 'page' => 'bp-components' ), $redirect );
970
-
971
- wp_safe_redirect( $redirect );
972
-
973
- // That's all!
974
- exit();
975
- }
976
-
977
- return false;
978
- }
979
-
980
- function setup_pages( $pages ) {
981
-
982
- $bp_pages = array();
983
-
984
- foreach ( $pages as $key => $value ) {
985
- if ( 'page' == $value ) {
986
- // Check for the selected page
987
- if ( !empty( $_POST['bp-' . $key . '-page'] ) )
988
- $bp_pages[$key] = (int) $_POST['bp-' . $key . '-page'];
989
- else
990
- $bp_pages[$key] = wp_insert_post( array( 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_title' => ucwords( $key ), 'post_status' => 'publish', 'post_type' => 'page' ) );
991
- } else {
992
- // Create a new page
993
- $bp_pages[$key] = wp_insert_post( array( 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_title' => ucwords( $value ), 'post_status' => 'publish', 'post_type' => 'page' ) );
994
- }
995
- }
996
-
997
- return $bp_pages;
998
- }
999
-
1000
- // Database update methods based on version numbers
1001
- function update_1_5() {
1002
-
1003
- // Delete old database version options
1004
- delete_site_option( 'bp-activity-db-version' );
1005
- delete_site_option( 'bp-blogs-db-version' );
1006
- delete_site_option( 'bp-friends-db-version' );
1007
- delete_site_option( 'bp-groups-db-version' );
1008
- delete_site_option( 'bp-messages-db-version' );
1009
- delete_site_option( 'bp-xprofile-db-version' );
1010
- }
1011
-
1012
- // Database update methods based on version numbers
1013
- function update_1_6() {
1014
-
1015
- // Delete possible site options
1016
- delete_site_option( 'bp-db-version' );
1017
- delete_site_option( '_bp_db_version' );
1018
- delete_site_option( 'bp-core-db-version' );
1019
- delete_site_option( '_bp-core-db-version' );
1020
-
1021
- // Delete possible blog options
1022
- delete_blog_option( bp_get_root_blog_id(), 'bp-db-version' );
1023
- delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version' );
1024
- delete_site_option( bp_get_root_blog_id(), '_bp-core-db-version' );
1025
- delete_site_option( bp_get_root_blog_id(), '_bp_db_version' );
1026
- }
1027
-
1028
- /**
1029
- * Reset the cookie so the install script starts over
1030
- */
1031
- function reset_cookie() {
1032
- @setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
1033
- }
1034
- }
1035
-
1036
- /**
1037
- * Get the wizard
1038
- *
1039
- * @global type $bp
1040
- * @return boolean
1041
- */
1042
- function bp_get_wizard() {
1043
- global $bp;
1044
-
1045
- if ( !empty( $bp->admin->wizard ) )
1046
- return $bp->admin->wizard;
1047
-
1048
- return false;
1049
- }
1050
-
1051
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/admin/css/common.css CHANGED
@@ -1 +1,220 @@
1
- div#icon-buddypress{background:url(../images/icons32.png) no-repeat -370px -6px}div#icon-buddypress-activity{background:url(../images/icons32.png) no-repeat -10px -6px}ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:-178pxpx -34px}ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a img,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:-178px -34px}ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a img,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:0 -34px}ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image a{background-position:0 -2px}.dashboard_page_bp-wizard td.plugin-title span,.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat;margin-right:5px}.dashboard_page_bp-wizard tr.active td.plugin-title span,.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}.dashboard_page_bp-wizard tr.activity td.plugin-title span,.settings_page_bp-components tr.activity td.plugin-title span{background-position-x:-4px}.dashboard_page_bp-wizard tr.xprofile td.plugin-title span,.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-305px}.dashboard_page_bp-wizard tr.settings td.plugin-title span,.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-334px}.dashboard_page_bp-wizard tr.groups td.plugin-title span,.settings_page_bp-components tr.groups td.plugin-title span{background-position-x:-66px}.dashboard_page_bp-wizard tr.messages td.plugin-title span,.settings_page_bp-components tr.messages td.plugin-title span{background-position-x:-154px}.dashboard_page_bp-wizard tr.forums td.plugin-title span,.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-36px}.dashboard_page_bp-wizard tr.blogs td.plugin-title span,.settings_page_bp-components tr.blogs td.plugin-title span{background-position-x:-125px}.dashboard_page_bp-wizard tr.friends td.plugin-title span,.settings_page_bp-components tr.friends td.plugin-title span{background-position-x:-95px}.dashboard_page_bp-wizard tr.core td.plugin-title span,.settings_page_bp-components tr.core td.plugin-title span{background-position-x:-184px}.dashboard_page_bp-wizard tr.members td.plugin-title span,.settings_page_bp-components tr.members td.plugin-title span{background-position-x:-36px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * CSS that is always loaded when in wp-admin
3
+ *
4
+ * @since BuddyPress (1.6)
5
+ */
6
+
7
+ /* Icon 32's
8
+ ------------------------------------------------------------------------------*/
9
+
10
+ div#icon-buddypress {
11
+ background: url('../images/icons32.png') no-repeat -370px -6px;
12
+ }
13
+
14
+ div#icon-buddypress-activity {
15
+ background: url('../images/icons32.png') no-repeat -10px -6px;
16
+ }
17
+
18
+ div#icon-buddypress-groups {
19
+ background: url('../images/icons32.png') no-repeat -250px -6px;
20
+ }
21
+
22
+ /* Menu Icons
23
+ ------------------------------------------------------------------------------*/
24
+
25
+ /* Backpat */
26
+ ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,
27
+ ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image {
28
+ background-image: url('../images/menu.png') !important;
29
+ background-position: -178px -34px;
30
+ }
31
+
32
+ ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,
33
+ ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,
34
+ ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,
35
+ ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image {
36
+ background-position: -178px -2px;
37
+ }
38
+
39
+ /* Activity */
40
+ ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,
41
+ ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image {
42
+ background-image: url('../images/menu.png');
43
+ background-position: 0 -34px;
44
+ }
45
+ ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,
46
+ ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,
47
+ ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,
48
+ ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,
49
+ ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,
50
+ ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image {
51
+ background-position: 0 -2px;
52
+ }
53
+
54
+ /* Groups */
55
+ ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,
56
+ ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image {
57
+ background-image: url('../images/menu.png');
58
+ background-position: -61px -34px;
59
+ }
60
+ ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,
61
+ ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,
62
+ ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,
63
+ ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,
64
+ ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,
65
+ ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image {
66
+ background-position: -61px -2px;
67
+ }
68
+ th.column-gid {
69
+ width: 60px;
70
+ }
71
+ td.column-gid {
72
+ vertical-align: middle;
73
+ }
74
+ table.bp-group-members th,
75
+ table.bp-group-members td {
76
+ padding: 5px 0;
77
+ }
78
+ table.bp-group-members .uid-column {
79
+ padding-left: 20px;
80
+ padding-right: 20px;
81
+ }
82
+ table.bp-group-members .uname-column {
83
+ width: 70%;
84
+ }
85
+ table.bp-group-members .urole-column {
86
+ padding-left: 20px;
87
+ padding-right: 20px;
88
+ }
89
+
90
+ /* Components
91
+ ------------------------------------------------------------------------------*/
92
+
93
+ .dashboard_page_bp-wizard td.plugin-title span,
94
+ .settings_page_bp-components td.plugin-title span {
95
+ float: left;
96
+ width: 18px;
97
+ height: 18px;
98
+ background-image: url('../images/menu.png');
99
+ background-position: -4px -40px;
100
+ background-repeat: no-repeat;
101
+ margin-right: 5px;
102
+ }
103
+
104
+ .dashboard_page_bp-wizard tr.active td.plugin-title span,
105
+ .settings_page_bp-components tr.active td.plugin-title span {
106
+ background-position-y: -7px;
107
+ }
108
+
109
+ .dashboard_page_bp-wizard tr.activity td.plugin-title span,
110
+ .settings_page_bp-components tr.activity td.plugin-title span {
111
+ background-position-x: -4px;
112
+ }
113
+
114
+ .dashboard_page_bp-wizard tr.xprofile td.plugin-title span,
115
+ .settings_page_bp-components tr.xprofile td.plugin-title span {
116
+ background-image: url('../images/menu-wp.png');
117
+ background-position-x: -305px;
118
+ }
119
+
120
+ .dashboard_page_bp-wizard tr.settings td.plugin-title span,
121
+ .settings_page_bp-components tr.settings td.plugin-title span {
122
+ background-image: url('../images/menu-wp.png');
123
+ background-position-x: -334px;
124
+ }
125
+
126
+ .dashboard_page_bp-wizard tr.groups td.plugin-title span,
127
+ .settings_page_bp-components tr.groups td.plugin-title span {
128
+ background-position-x: -66px;
129
+ }
130
+
131
+ .dashboard_page_bp-wizard tr.messages td.plugin-title span,
132
+ .settings_page_bp-components tr.messages td.plugin-title span {
133
+ background-position-x: -154px;
134
+ }
135
+
136
+ .dashboard_page_bp-wizard tr.forums td.plugin-title span,
137
+ .settings_page_bp-components tr.forums td.plugin-title span {
138
+ background-image: url('../images/menu-wp.png');
139
+ background-position-x: -36px;
140
+ }
141
+
142
+ .dashboard_page_bp-wizard tr.blogs td.plugin-title span,
143
+ .settings_page_bp-components tr.blogs td.plugin-title span {
144
+ background-position-x: -125px;
145
+ }
146
+
147
+ .dashboard_page_bp-wizard tr.friends td.plugin-title span,
148
+ .settings_page_bp-components tr.friends td.plugin-title span {
149
+ background-position-x: -95px;
150
+ }
151
+
152
+ .dashboard_page_bp-wizard tr.core td.plugin-title span,
153
+ .settings_page_bp-components tr.core td.plugin-title span {
154
+ background-position-x: -184px;
155
+ }
156
+
157
+ .dashboard_page_bp-wizard tr.members td.plugin-title span,
158
+ .settings_page_bp-components tr.members td.plugin-title span {
159
+ background-position-x: -36px;
160
+ }
161
+
162
+ #bp-admin-component-form .widefat th {
163
+ display: table-cell;
164
+ vertical-align: top;
165
+ }
166
+
167
+ /* Version Badge */
168
+
169
+ .bp-badge {
170
+ padding-top: 142px;
171
+ height: 50px;
172
+ width: 173px;
173
+ color: #fafafa;
174
+ font-weight: bold;
175
+ font-size: 14px;
176
+ text-align: center;
177
+ margin: 0 -5px;
178
+ background: url('../images/badge.png') no-repeat;
179
+ }
180
+
181
+ .about-wrap .bp-badge {
182
+ position: absolute;
183
+ top: 0;
184
+ right: 0;
185
+ }
186
+ body.rtl .about-wrap .bp-badge {
187
+ right: auto;
188
+ left: 0;
189
+ }
190
+
191
+ /* HiDPI
192
+ ------------------------------------------------------------------------------*/
193
+
194
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
195
+
196
+ /* Icon 32 */
197
+ div#icon-buddypress,
198
+ div#icon-buddypress-activity,
199
+ div#icon-buddypress-groups {
200
+ background-image: url('../images/icons64.png');
201
+ background-size: 419px 45px;
202
+ }
203
+
204
+ /* Backpat */
205
+ ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,
206
+ ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,
207
+ ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,
208
+ ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,
209
+ ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,
210
+ ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image {
211
+ background-image: url('../images/menu-2x.png') !important;
212
+ background-size: 209px 64px;
213
+ }
214
+
215
+ /* Badge */
216
+ .bp-badge {
217
+ background-image: url('../images/badge-2x.png');
218
+ background-size: 173px 194px;
219
+ }
220
+ }
bp-core/admin/css/common.dev.css DELETED
@@ -1,148 +0,0 @@
1
- /**
2
- * CSS that is always loaded when in wp-admin
3
- *
4
- * @since BuddyPress (1.6)
5
- */
6
-
7
- /* Icon 32's
8
- ------------------------------------------------------------------------------*/
9
-
10
- div#icon-buddypress {
11
- background: url( ../images/icons32.png ) no-repeat -370px -6px;
12
- }
13
-
14
- div#icon-buddypress-activity {
15
- background: url( ../images/icons32.png ) no-repeat -10px -6px;
16
- }
17
-
18
- /* Menu Icons
19
- ------------------------------------------------------------------------------*/
20
-
21
- /* Wizard */
22
- ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img {
23
- display: none;
24
- }
25
- ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a {
26
- background-image: url( ../images/menu.png ) !important;
27
- background-position: -178pxpx -34px;
28
- }
29
- ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,
30
- ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a {
31
- background-position: -178px -2px;
32
- }
33
-
34
- /* Backpat */
35
- ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a img,
36
- ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img {
37
- display: none;
38
- }
39
-
40
- ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a,
41
- ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a {
42
- background-image: url( ../images/menu.png ) !important;
43
- background-position: -178px -34px;
44
- }
45
-
46
- ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image a,
47
- ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,
48
- ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image a,
49
- ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a {
50
- background-position: -178px -2px;
51
- }
52
-
53
- /* Activity */
54
- ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a img,
55
- ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a img {
56
- display: none;
57
- }
58
- ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a,
59
- ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a {
60
- background-image: url( ../images/menu.png ) !important;
61
- background-position: 0 -34px;
62
- }
63
- ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image a,
64
- ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image a,
65
- ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image a,
66
- ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image a,
67
- ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image a,
68
- ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image a {
69
- background-position: 0 -2px;
70
- }
71
-
72
-
73
- /* Components
74
- ------------------------------------------------------------------------------*/
75
-
76
- .dashboard_page_bp-wizard td.plugin-title span,
77
- .settings_page_bp-components td.plugin-title span {
78
- float: left;
79
- width: 18px;
80
- height: 18px;
81
- background-image: url( ../images/menu.png );
82
- background-position: -4px -40px;
83
- background-repeat: no-repeat;
84
- margin-right: 5px;
85
- }
86
-
87
- .dashboard_page_bp-wizard tr.active td.plugin-title span,
88
- .settings_page_bp-components tr.active td.plugin-title span {
89
- background-position-y: -7px;
90
- }
91
-
92
- .dashboard_page_bp-wizard tr.activity td.plugin-title span,
93
- .settings_page_bp-components tr.activity td.plugin-title span {
94
- background-position-x: -4px;
95
- }
96
-
97
- .dashboard_page_bp-wizard tr.xprofile td.plugin-title span,
98
- .settings_page_bp-components tr.xprofile td.plugin-title span {
99
- background-image: url( ../images/menu-wp.png );
100
- background-position-x: -305px;
101
- }
102
-
103
- .dashboard_page_bp-wizard tr.settings td.plugin-title span,
104
- .settings_page_bp-components tr.settings td.plugin-title span {
105
- background-image: url( ../images/menu-wp.png );
106
- background-position-x: -334px;
107
- }
108
-
109
- .dashboard_page_bp-wizard tr.groups td.plugin-title span,
110
- .settings_page_bp-components tr.groups td.plugin-title span {
111
- background-position-x: -66px;
112
- }
113
-
114
- .dashboard_page_bp-wizard tr.messages td.plugin-title span,
115
- .settings_page_bp-components tr.messages td.plugin-title span {
116
- background-position-x: -154px;
117
- }
118
-
119
- .dashboard_page_bp-wizard tr.forums td.plugin-title span,
120
- .settings_page_bp-components tr.forums td.plugin-title span {
121
- background-image: url( ../images/menu-wp.png );
122
- background-position-x: -36px;
123
- }
124
-
125
- .dashboard_page_bp-wizard tr.blogs td.plugin-title span,
126
- .settings_page_bp-components tr.blogs td.plugin-title span {
127
- background-position-x: -125px;
128
- }
129
-
130
- .dashboard_page_bp-wizard tr.friends td.plugin-title span,
131
- .settings_page_bp-components tr.friends td.plugin-title span {
132
- background-position-x: -95px;
133
- }
134
-
135
- .dashboard_page_bp-wizard tr.core td.plugin-title span,
136
- .settings_page_bp-components tr.core td.plugin-title span {
137
- background-position-x: -184px;
138
- }
139
-
140
- .dashboard_page_bp-wizard tr.members td.plugin-title span,
141
- .settings_page_bp-components tr.members td.plugin-title span {
142
- background-position-x: -36px;
143
- }
144
-
145
- #bp-admin-component-form .widefat th {
146
- display: table-cell;
147
- vertical-align: top;
148
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/admin/css/common.min.css ADDED
@@ -0,0 +1 @@
 
1
+ div#icon-buddypress{background:url('../images/icons32.png') no-repeat -370px -6px}div#icon-buddypress-activity{background:url('../images/icons32.png') no-repeat -10px -6px}div#icon-buddypress-groups{background:url('../images/icons32.png') no-repeat -250px -6px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url('../images/menu.png')!important;background-position:-178px -34px}ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url('../images/menu.png');background-position:0 -34px}ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image{background-position:0 -2px}ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url('../images/menu.png');background-position:-61px -34px}ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image{background-position:-61px -2px}th.column-gid{width:60px}td.column-gid{vertical-align:middle}table.bp-group-members th,table.bp-group-members td{padding:5px 0}table.bp-group-members .uid-column{padding-left:20px;padding-right:20px}table.bp-group-members .uname-column{width:70%}table.bp-group-members .urole-column{padding-left:20px;padding-right:20px}.dashboard_page_bp-wizard td.plugin-title span,.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;background-image:url('../images/menu.png');background-position:-4px -40px;background-repeat:no-repeat;margin-right:5px}.dashboard_page_bp-wizard tr.active td.plugin-title span,.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}.dashboard_page_bp-wizard tr.activity td.plugin-title span,.settings_page_bp-components tr.activity td.plugin-title span{background-position-x:-4px}.dashboard_page_bp-wizard tr.xprofile td.plugin-title span,.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url('../images/menu-wp.png');background-position-x:-305px}.dashboard_page_bp-wizard tr.settings td.plugin-title span,.settings_page_bp-components tr.settings td.plugin-title span{background-image:url('../images/menu-wp.png');background-position-x:-334px}.dashboard_page_bp-wizard tr.groups td.plugin-title span,.settings_page_bp-components tr.groups td.plugin-title span{background-position-x:-66px}.dashboard_page_bp-wizard tr.messages td.plugin-title span,.settings_page_bp-components tr.messages td.plugin-title span{background-position-x:-154px}.dashboard_page_bp-wizard tr.forums td.plugin-title span,.settings_page_bp-components tr.forums td.plugin-title span{background-image:url('../images/menu-wp.png');background-position-x:-36px}.dashboard_page_bp-wizard tr.blogs td.plugin-title span,.settings_page_bp-components tr.blogs td.plugin-title span{background-position-x:-125px}.dashboard_page_bp-wizard tr.friends td.plugin-title span,.settings_page_bp-components tr.friends td.plugin-title span{background-position-x:-95px}.dashboard_page_bp-wizard tr.core td.plugin-title span,.settings_page_bp-components tr.core td.plugin-title span{background-position-x:-184px}.dashboard_page_bp-wizard tr.members td.plugin-title span,.settings_page_bp-components tr.members td.plugin-title span{background-position-x:-36px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{padding-top:142px;height:50px;width:173px;color:#fafafa;font-weight:bold;font-size:14px;text-align:center;margin:0 -5px;background:url('../images/badge.png') no-repeat}.about-wrap .bp-badge{position:absolute;top:0;right:0}body.rtl .about-wrap .bp-badge{right:auto;left:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){div#icon-buddypress,div#icon-buddypress-activity,div#icon-buddypress-groups{background-image:url('../images/icons64.png');background-size:419px 45px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url('../images/menu-2x.png')!important;background-size:209px 64px}.bp-badge{background-image:url('../images/badge-2x.png');background-size:173px 194px}}
bp-core/admin/css/wizard.css DELETED
@@ -1 +0,0 @@
1
- div#bp-wizard{color:#555;min-width:680px}div#bp-wizard p{line-height:170%}form#bp-wizard-form{margin:0 10px}div#bp-wizard-nav{background:#e0e0e0;margin:15px -10px 10px;padding:10px 10px 0 10px;height:30px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}div#bp-wizard-nav div.submit{position:relative;float:right;margin-top:-36px!important}div#bp-wizard-nav div.submit input{padding:6px 10px}div#bp-wizard-nav ol{list-style-type:decimal;margin:0;padding:0}div#bp-wizard-nav ol li{float:left;margin:0 10px 0 0;color:#666}div#bp-wizard-nav ol li{padding:8px 12px;display:block;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;text-decoration:none}div#bp-wizard-nav ol li.current{background:#fff;color:#555}div#bp-wizard-nav ol li span.complete{background:url(../images/completed.gif) center left no-repeat;padding:6px}div.component{width:323px;float:left;margin:15px 30px 0 0}div.component div.radio{position:relative;background:#e0e0e0;padding:5px 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;top:-6px}div.component img{margin-top:10px}div.component p{margin-left:4px}div.component h5{font-size:18px;float:left;margin:0 0 0 4px;width:100px}div.component div.radio{font-size:11px;float:right;top:5px}div#bp-wizard div.prev-next,div#bp-wizard div.prev-next p,div#bp-wizard div.submit,div#bp-wizard div.submit p{margin:0;padding:0}div#bp-wizard div.submit{margin-top:30px}div#bp-wizard div.prev-next{text-align:right;margin-top:0}div#bp-wizard div.prev-next{margin:0 -20px;padding:0 20px 10px}div#bp-wizard table td{font-family:helvetica,arial,tahoma,sans-serif;vertical-align:top}div#bp-wizard table.form-table th{border-right:1px solid #eee;padding:15px 25px 15px 0;color:#555;vertical-align:top}div#bp-wizard table.form-table tr{border-bottom:1px dotted #f0f0f0}div#bp-wizard table.form-table td{padding-left:25px;font-size:12px}div#bp-wizard table.form-table th h5{font-size:14px;margin:0;line-height:150%}div#bp-wizard table.form-table th img{margin-top:5px}div#bp-wizard table.form-table th p{margin:3px 0 0 0}div#bp-wizard code,div#bp-wizard kbd{font-size:12px;background:#f0f0f0}div#bp-wizard div#message code,div#bp-wizard div#message kbd{background:#ffe293}a.button{padding-top:4px}a.installed,a.installed:hover,a.installed:active{padding-left:15px;color:#888;border-color:#ccc;cursor:default}a.installed span{background:url(../images/installed.gif) left center no-repeat;padding:6px 10px 7px 6px;margin-left:-5px}
 
bp-core/admin/css/wizard.dev.css DELETED
@@ -1,181 +0,0 @@
1
-
2
- /* General Admin Styling
3
- ------------------------------------------------------------------------------*/
4
-
5
- div#bp-wizard {
6
- color: #555;
7
- min-width: 680px;
8
- }
9
- div#bp-wizard p {
10
- line-height: 170%;
11
- }
12
-
13
- form#bp-wizard-form {
14
- margin: 0 10px;
15
- }
16
-
17
- div#bp-wizard-nav {
18
- background: #e0e0e0;
19
- margin: 15px -10px 10px;
20
- padding: 10px 10px 0 10px;
21
- height: 30px;
22
- -moz-border-radius: 2px;
23
- -webkit-border-radius: 2px;
24
- border-radius: 2px;
25
- }
26
- div#bp-wizard-nav div.submit {
27
- position: relative;
28
- float: right;
29
- margin-top: -36px !important;
30
- }
31
- div#bp-wizard-nav div.submit input {
32
- padding: 6px 10px;
33
- }
34
- div#bp-wizard-nav ol {
35
- list-style-type: decimal;
36
- margin: 0;
37
- padding: 0;
38
- }
39
- div#bp-wizard-nav ol li {
40
- float: left;
41
- margin: 0 10px 0 0;
42
- color: #666;
43
- }
44
- div#bp-wizard-nav ol li {
45
- padding: 8px 12px;
46
- display: block;
47
- -moz-border-radius: 2px;
48
- -webkit-border-radius: 2px;
49
- border-radius: 2px;
50
- text-decoration: none;
51
- }
52
- div#bp-wizard-nav ol li.current {
53
- background: #fff;
54
- color: #555;
55
- }
56
-
57
- div#bp-wizard-nav ol li span.complete {
58
- background: url( ../images/completed.gif ) center left no-repeat;
59
- padding: 6px;
60
- }
61
-
62
- div.component {
63
- width: 323px;
64
- float: left;
65
- margin: 15px 30px 0 0;
66
- }
67
- div.component div.radio {
68
- position: relative;
69
- background: #e0e0e0;
70
- padding: 5px 10px;
71
- -moz-border-radius: 2px;
72
- -webkit-border-radius: 2px;
73
- border-radius: 2px;
74
- top: -6px;
75
- }
76
-
77
- div.component img {
78
- margin-top: 10px;
79
- }
80
-
81
- div.component p {
82
- margin-left: 4px;
83
- }
84
-
85
- div.component h5 {
86
- font-size: 18px;
87
- float: left;
88
- margin: 0 0 0 4px;
89
- width: 100px;
90
- }
91
-
92
- div.component div.radio {
93
- font-size: 11px;
94
- float: right;
95
- top: 5px;
96
- }
97
-
98
- div#bp-wizard div.prev-next, div#bp-wizard div.prev-next p,
99
- div#bp-wizard div.submit, div#bp-wizard div.submit p {
100
- margin: 0;
101
- padding: 0;
102
- }
103
- div#bp-wizard div.submit {
104
- margin-top: 30px;
105
- }
106
- div#bp-wizard div.prev-next {
107
- text-align: right;
108
- margin-top: 0;
109
- }
110
-
111
- div#bp-wizard div.prev-next {
112
- margin: 0 -20px;
113
- padding: 0 20px 10px;
114
- }
115
-
116
- div#bp-wizard table td {
117
- font-family: helvetica, arial, tahoma, sans-serif;
118
- vertical-align: top;
119
- }
120
-
121
- div#bp-wizard table.form-table th {
122
- border-right: 1px solid #eee;
123
- padding: 15px 25px 15px 0;
124
- color: #555;
125
- vertical-align: top;
126
- }
127
- div#bp-wizard table.form-table tr {
128
- border-bottom: 1px dotted #f0f0f0;
129
- }
130
- div#bp-wizard table.form-table td {
131
- padding-left: 25px;
132
- font-size: 12px;
133
- }
134
-
135
- div#bp-wizard table.form-table th h5 {
136
- font-size: 14px;
137
- margin: 0;
138
- line-height: 150%;
139
- }
140
-
141
- div#bp-wizard table.form-table th img {
142
- margin-top: 5px;
143
- width: 300px;
144
- }
145
-
146
- div#bp-wizard table.form-table th p {
147
- margin: 3px 0 0 0;
148
- }
149
-
150
- #bp-wizard .widefat th {
151
- vertical-align: top;
152
- display: table-cell;
153
- }
154
-
155
- div#bp-wizard code, div#bp-wizard kbd {
156
- font-size: 12px;
157
- background: #f0f0f0;
158
- }
159
-
160
- div#bp-wizard div#message code, div#bp-wizard div#message kbd {
161
- background: #ffe293;
162
- }
163
-
164
- a.button {
165
- padding-top: 4px;
166
- }
167
-
168
- a.installed,
169
- a.installed:hover,
170
- a.installed:active {
171
- padding-left: 15px;
172
- color: #888;
173
- border-color: #ccc;
174
- cursor: default;
175
- }
176
-
177
- a.installed span {
178
- background: url( ../images/installed.gif ) left center no-repeat;
179
- padding: 6px 10px 7px 6px;
180
- margin-left: -5px;
181
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/admin/images/badge-2x.png ADDED
Binary file
bp-core/admin/images/badge.png ADDED
Binary file
bp-core/admin/images/completed.gif DELETED
Binary file
bp-core/admin/images/find.png DELETED
Binary file
bp-core/admin/images/icons64.png ADDED
Binary file
bp-core/admin/images/installed.gif DELETED
Binary file
bp-core/admin/images/menu-2x.png ADDED
Binary file
bp-core/admin/js/wizard.dev.js DELETED
@@ -1,11 +0,0 @@
1
- jQuery(document).ready( function($) {
2
- var toggle = $('#site-tracking-enabled');
3
-
4
- if ( !$(toggle).is(':checked') ) {
5
- $('#site-tracking-page-selector').hide();
6
- }
7
-
8
- $(toggle).click(function(){
9
- $('#site-tracking-page-selector').toggle('fast');
10
- });
11
- },jQuery );
 
 
 
 
 
 
 
 
 
 
 
bp-core/admin/js/wizard.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(b){var a=b("#site-tracking-enabled");if(!b(a).is(":checked")){b("#site-tracking-page-selector").hide()}b(a).click(function(){b("#site-tracking-page-selector").toggle("fast")})},jQuery);
 
bp-core/bp-core-actions.php CHANGED
@@ -34,38 +34,40 @@ if ( !defined( 'ABSPATH' ) ) exit;
34
  add_action( 'plugins_loaded', 'bp_loaded', 10 );
35
  add_action( 'init', 'bp_init', 10 );
36
  add_action( 'wp', 'bp_ready', 10 );
 
37
  add_action( 'setup_theme', 'bp_setup_theme', 10 );
38
- add_action( 'after_theme_setup', 'bp_after_theme_setup', 10 );
39
  add_action( 'wp_enqueue_scripts', 'bp_enqueue_scripts', 10 );
40
  add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 20 ); // After WP core
41
  add_action( 'template_redirect', 'bp_template_redirect', 10 );
42
  add_action( 'widgets_init', 'bp_widgets_init', 10 );
43
- add_filter( 'template_include', 'bp_template_include', 10 );
44
- add_filter( 'map_meta_cap', 'bp_map_meta_caps', 10, 4 );
45
 
46
  /**
47
  * bp_loaded - Attached to 'plugins_loaded' above
48
  *
49
  * Attach various loader actions to the bp_loaded action.
50
  * The load order helps to execute code at the correct time.
51
- * v---Load order
52
  */
53
- add_action( 'bp_loaded', 'bp_setup_components', 2 );
54
- add_action( 'bp_loaded', 'bp_include', 4 );
55
- add_action( 'bp_loaded', 'bp_setup_widgets', 6 );
56
- add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 );
 
57
 
58
  /**
59
  * bp_init - Attached to 'init' above
60
  *
61
  * Attach various initialization actions to the bp_init action.
62
  * The load order helps to execute code at the correct time.
63
- * v---Load order
64
  */
65
- add_action( 'bp_init', 'bp_core_set_uri_globals', 2 );
66
- add_action( 'bp_init', 'bp_setup_globals', 4 );
67
- add_action( 'bp_init', 'bp_setup_nav', 6 );
68
- add_action( 'bp_init', 'bp_setup_title', 8 );
 
 
69
 
70
  /**
71
  * bp_template_redirect - Attached to 'template_redirect' above
@@ -76,192 +78,20 @@ add_action( 'bp_init', 'bp_setup_title', 8 );
76
  * Note that we currently use template_redirect versus template include because
77
  * BuddyPress is a bully and overrides the existing themes output in many
78
  * places. This won't always be this way, we promise.
79
- * v---Load order
80
  */
81
- add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 );
82
- add_action( 'bp_template_redirect', 'bp_actions', 4 );
83
- add_action( 'bp_template_redirect', 'bp_screens', 6 );
84
-
85
- // Load the admin
86
- if ( is_admin() ) {
87
- add_action( 'bp_loaded', 'bp_admin' );
88
- }
89
-
90
- /**
91
- * Plugin Dependency
92
- *
93
- * The purpose of the following actions is to mimic the behavior of something
94
- * called 'plugin dependency' which enables a plugin to have plugins of their
95
- * own in a safe and reliable way.
96
- *
97
- * We do this in BuddyPress by mirroring existing WordPress actions in many places
98
- * allowing dependant plugins to hook into the BuddyPress specific ones, thus
99
- * guaranteeing proper code execution only whenBuddyPresss is active.
100
- *
101
- * The following functions are wrappers for their actions, allowing them to be
102
- * manually called and/or piggy-backed on top of other actions if needed.
103
- */
104
-
105
- /** Sub-actions ***************************************************************/
106
-
107
- /**
108
- * Include files on this action
109
- */
110
- function bp_include() {
111
- do_action( 'bp_include' );
112
- }
113
-
114
- /**
115
- * Include files on this action
116
- */
117
- function bp_setup_components() {
118
- do_action( 'bp_setup_components' );
119
- }
120
-
121
- /**
122
- * Setup global variables and objects
123
- */
124
- function bp_setup_globals() {
125
- do_action( 'bp_setup_globals' );
126
- }
127
-
128
- /**
129
- * Set navigation elements
130
- */
131
- function bp_setup_nav() {
132
- do_action( 'bp_setup_nav' );
133
- }
134
-
135
- /**
136
- * Set up BuddyPress implementation of the WP Toolbar
137
- */
138
- function bp_setup_admin_bar() {
139
- if ( bp_use_wp_admin_bar() )
140
- do_action( 'bp_setup_admin_bar' );
141
- }
142
-
143
- /**
144
- * Set the page title
145
- */
146
- function bp_setup_title() {
147
- do_action( 'bp_setup_title' );
148
- }
149
-
150
- /**
151
- * Register widgets
152
- */
153
- function bp_setup_widgets() {
154
- do_action( 'bp_register_widgets' );
155
- }
156
-
157
- /**
158
- * Initlialize code
159
- */
160
- function bp_init() {
161
- do_action( 'bp_init' );
162
- }
163
-
164
- /**
165
- * Attached to plugins_loaded
166
- */
167
- function bp_loaded() {
168
- do_action( 'bp_loaded' );
169
- }
170
 
171
  /**
172
- * Attached to wp
173
  */
174
- function bp_ready() {
175
- do_action( 'bp_ready' );
176
- }
177
-
178
- /**
179
- * Attach potential template actions
180
- */
181
- function bp_actions() {
182
- do_action( 'bp_actions' );
183
- }
184
-
185
- /**
186
- * Attach potential template screens
187
- */
188
- function bp_screens() {
189
- do_action( 'bp_screens' );
190
- }
191
-
192
- /**
193
- * Initialize widgets
194
- */
195
- function bp_widgets_init() {
196
- do_action ( 'bp_widgets_init' );
197
- }
198
-
199
- /** Theme *********************************************************************/
200
-
201
- /**
202
- * Enqueue BuddyPress specific CSS and JS
203
- *
204
- * @since BuddyPress (1.6)
205
- *
206
- * @uses do_action() Calls 'bp_enqueue_scripts'
207
- */
208
- function bp_enqueue_scripts() {
209
- do_action ( 'bp_enqueue_scripts' );
210
- }
211
-
212
- /**
213
- * Piggy back action for BuddyPress sepecific theme actions before the theme has
214
- * been setup and the theme's functions.php has loaded.
215
- *
216
- * @since BuddyPress (1.6)
217
- *
218
- * @uses do_action() Calls 'bp_setup_theme'
219
- */
220
- function bp_setup_theme() {
221
- do_action ( 'bp_setup_theme' );
222
- }
223
-
224
- /**
225
- * Piggy back action for BuddyPress sepecific theme actions once the theme has
226
- * been setup and the theme's functions.php has loaded.
227
- *
228
- * @since BuddyPress (1.6)
229
- *
230
- * @uses do_action() Calls 'bp_after_theme_setup'
231
- */
232
- function bp_after_theme_setup() {
233
- do_action ( 'bp_after_theme_setup' );
234
- }
235
-
236
- /** Theme Compatibility Filter ************************************************/
237
-
238
- /**
239
- * The main filter used for theme compatibility and displaying custom BuddyPress
240
- * theme files.
241
- *
242
- * @since BuddyPress (1.6)
243
- *
244
- * @uses apply_filters()
245
- *
246
- * @param string $template
247
- * @return string Template file to use
248
- */
249
- function bp_template_include( $template = '' ) {
250
- return apply_filters( 'bp_template_include', $template );
251
- }
252
-
253
- /** Theme Permissions *********************************************************/
254
 
255
- /**
256
- * The main action used for redirecting BuddyPress theme actions that are not
257
- * permitted by the current_user
258
- *
259
- * @since BuddyPress (1.6)
260
- *
261
- * @uses do_action()
262
- */
263
- function bp_template_redirect() {
264
- do_action( 'bp_template_redirect' );
265
  }
266
 
267
- ?>
 
34
  add_action( 'plugins_loaded', 'bp_loaded', 10 );
35
  add_action( 'init', 'bp_init', 10 );
36
  add_action( 'wp', 'bp_ready', 10 );
37
+ add_action( 'set_current_user', 'bp_setup_current_user', 10 );
38
  add_action( 'setup_theme', 'bp_setup_theme', 10 );
39
+ add_action( 'after_setup_theme', 'bp_after_setup_theme', 100 ); // After WP themes
40
  add_action( 'wp_enqueue_scripts', 'bp_enqueue_scripts', 10 );
41
  add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 20 ); // After WP core
42
  add_action( 'template_redirect', 'bp_template_redirect', 10 );
43
  add_action( 'widgets_init', 'bp_widgets_init', 10 );
 
 
44
 
45
  /**
46
  * bp_loaded - Attached to 'plugins_loaded' above
47
  *
48
  * Attach various loader actions to the bp_loaded action.
49
  * The load order helps to execute code at the correct time.
50
+ * v---Load order
51
  */
52
+ add_action( 'bp_loaded', 'bp_setup_components', 2 );
53
+ add_action( 'bp_loaded', 'bp_include', 4 );
54
+ add_action( 'bp_loaded', 'bp_setup_widgets', 6 );
55
+ add_action( 'bp_loaded', 'bp_register_theme_packages', 12 );
56
+ add_action( 'bp_loaded', 'bp_register_theme_directory', 14 );
57
 
58
  /**
59
  * bp_init - Attached to 'init' above
60
  *
61
  * Attach various initialization actions to the bp_init action.
62
  * The load order helps to execute code at the correct time.
63
+ * v---Load order
64
  */
65
+ add_action( 'bp_init', 'bp_core_set_uri_globals', 2 );
66
+ add_action( 'bp_init', 'bp_setup_globals', 4 );
67
+ add_action( 'bp_init', 'bp_setup_nav', 6 );
68
+ add_action( 'bp_init', 'bp_setup_title', 8 );
69
+ add_action( 'bp_init', 'bp_core_load_admin_bar', 10 );
70
+ add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 );
71
 
72
  /**
73
  * bp_template_redirect - Attached to 'template_redirect' above
78
  * Note that we currently use template_redirect versus template include because
79
  * BuddyPress is a bully and overrides the existing themes output in many
80
  * places. This won't always be this way, we promise.
81
+ * v---Load order
82
  */
83
+ add_action( 'bp_template_redirect', 'bp_actions', 4 );
84
+ add_action( 'bp_template_redirect', 'bp_screens', 6 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
  /**
87
+ * Add the BuddyPress functions file
88
  */
89
+ add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
+ // Load the admin
92
+ if ( is_admin() ) {
93
+ add_action( 'bp_loaded', 'bp_admin' );
 
 
 
 
 
 
 
94
  }
95
 
96
+ // Activation redirect
97
+ add_action( 'bp_activation', 'bp_add_activation_redirect' );
bp-core/bp-core-admin.php CHANGED
@@ -20,14 +20,6 @@ if ( !class_exists( 'BP_Admin' ) ) :
20
  */
21
  class BP_Admin {
22
 
23
- /**
24
- * Instance of the setup wizard
25
- *
26
- * @since BuddyPress (1.6)
27
- * @var BP_Core_Setup_Wizard
28
- */
29
- public $wizard;
30
-
31
  /** Directory *************************************************************/
32
 
33
  /**
@@ -57,7 +49,6 @@ class BP_Admin {
57
  */
58
  public $js_url = '';
59
 
60
-
61
  /** Methods ***************************************************************/
62
 
63
  /**
@@ -65,9 +56,9 @@ class BP_Admin {
65
  *
66
  * @since BuddyPress (1.6)
67
  *
68
- * @uses BBP_Admin::setup_globals() Setup the globals needed
69
- * @uses BBP_Admin::includes() Include the required files
70
- * @uses BBP_Admin::setup_actions() Setup the hooks and actions
71
  */
72
  public function __construct() {
73
  $this->setup_globals();
@@ -82,22 +73,17 @@ class BP_Admin {
82
  * @access private
83
  */
84
  private function setup_globals() {
85
- global $bp;
86
-
87
- // Admin url
88
- $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' );
89
-
90
- // Admin url
91
- $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' );
92
 
93
- // Admin images URL
94
- $this->images_url = trailingslashit( $this->admin_url . 'images' );
 
 
 
 
95
 
96
- // Admin css URL
97
- $this->css_url = trailingslashit( $this->admin_url . 'css' );
98
-
99
- // Admin css URL
100
- $this->js_url = trailingslashit( $this->admin_url . 'js' );
101
  }
102
 
103
  /**
@@ -107,19 +93,11 @@ class BP_Admin {
107
  * @access private
108
  */
109
  private function includes() {
110
-
111
- // If in maintenance mode, only include updater and schema
112
- if ( bp_get_maintenance_mode() ) {
113
- require( $this->admin_dir . 'bp-core-schema.php' );
114
- require( $this->admin_dir . 'bp-core-update.php' );
115
-
116
- // No update needed so proceed with loading everything
117
- } else {
118
- require( $this->admin_dir . 'bp-core-settings.php' );
119
- require( $this->admin_dir . 'bp-core-functions.php' );
120
- require( $this->admin_dir . 'bp-core-components.php' );
121
- require( $this->admin_dir . 'bp-core-slugs.php' );
122
- }
123
  }
124
 
125
  /**
@@ -133,42 +111,27 @@ class BP_Admin {
133
  */
134
  private function setup_actions() {
135
 
136
- // Start the wizard if in maintenance mode
137
- if ( bp_get_maintenance_mode() ) {
138
- add_action( bp_core_admin_hook(), array( $this, 'start_wizard' ), 2 );
139
- }
140
-
141
  /** General Actions ***************************************************/
142
 
143
- // Attach the BuddyPress admin_init action to the WordPress admin_init action.
144
- add_action( 'admin_init', array( $this, 'admin_init' ) );
145
-
146
  // Add some page specific output to the <head>
147
- add_action( 'admin_head', array( $this, 'admin_head' ) );
148
 
149
  // Add menu item to settings menu
150
- add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 );
151
-
152
- // Add notice if not using a BuddyPress theme
153
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
154
- add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
155
 
156
  // Enqueue all admin JS and CSS
157
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
158
 
159
  /** BuddyPress Actions ************************************************/
160
 
161
  // Add settings
162
- add_action( 'bp_admin_init', array( $this, 'register_admin_settings' ) );
163
 
164
  /** Filters ***********************************************************/
165
 
166
  // Add link to settings page
167
- add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 10, 2 );
168
- }
169
-
170
- public function start_wizard() {
171
- $this->wizard = new BP_Core_Setup_Wizard;
172
  }
173
 
174
  /**
@@ -182,86 +145,80 @@ class BP_Admin {
182
  */
183
  public function admin_menus() {
184
 
185
- // In maintenance mode
186
- if ( bp_get_maintenance_mode() ) {
187
-
188
- if ( !current_user_can( 'manage_options' ) )
189
- return;
190
-
191
- if ( bp_get_maintenance_mode() == 'install' )
192
- $status = __( 'BuddyPress Setup', 'buddypress' );
193
- else
194
- $status = __( 'Update BuddyPress', 'buddypress' );
195
-
196
- if ( bp_get_wizard() ) {
197
- if ( ! is_multisite() || bp_is_multiblog_mode() ) {
198
- $hook = add_dashboard_page( $status, $status, 'manage_options', 'bp-wizard', array( bp_get_wizard(), 'html' ) );
199
- } else {
200
- $hook = add_submenu_page( 'update-core.php', $status, $status, 'manage_options', 'bp-wizard', array( bp_get_wizard(), 'html' ) );
201
- }
202
- }
203
 
204
- // Not in maintenance mode
205
- } else {
206
-
207
- // Bail if user cannot moderate
208
- if ( ! bp_current_user_can( 'manage_options' ) )
209
- return;
210
-
211
- $hooks = array();
212
- $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
213
-
214
- // Changed in BP 1.6 . See bp_core_admin_backpat_menu()
215
- $hooks[] = add_menu_page(
216
- __( 'BuddyPress', 'buddypress' ),
217
- __( 'BuddyPress', 'buddypress' ),
218
- 'manage_options',
219
- 'bp-general-settings',
220
- 'bp_core_admin_backpat_menu',
221
- ''
222
- );
223
-
224
- $hooks[] = add_submenu_page(
225
- 'bp-general-settings',
226
- __( 'BuddyPress Help', 'buddypress' ),
227
- __( 'Help', 'buddypress' ),
228
- 'manage_options',
229
- 'bp-general-settings',
230
- 'bp_core_admin_backpat_page'
231
- );
232
-
233
- // Add the option pages
234
- $hooks[] = add_submenu_page(
235
- $page,
236
- __( 'BuddyPress Components', 'buddypress' ),
237
- __( 'BuddyPress', 'buddypress' ),
238
- 'manage_options',
239
- 'bp-components',
240
- 'bp_core_admin_components_settings'
241
- );
242
-
243
- $hooks[] = add_submenu_page(
244
- $page,
245
- __( 'BuddyPress Pages', 'buddypress' ),
246
- __( 'BuddyPress Pages', 'buddypress' ),
247
- 'manage_options',
248
- 'bp-page-settings',
249
- 'bp_core_admin_slugs_settings'
250
- );
251
-
252
- $hooks[] = add_submenu_page(
253
- $page,
254
- __( 'BuddyPress Settings', 'buddypress' ),
255
- __( 'BuddyPress Settings', 'buddypress' ),
256
- 'manage_options',
257
- 'bp-settings',
258
- 'bp_core_admin_settings'
259
- );
260
-
261
- // Fudge the highlighted subnav item when on a BuddyPress admin page
262
- foreach( $hooks as $hook ) {
263
- add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
264
- }
 
 
 
 
 
 
 
 
 
265
  }
266
  }
267
 
@@ -273,7 +230,6 @@ class BP_Admin {
273
  * @uses add_settings_section() To add our own settings section
274
  * @uses add_settings_field() To add various settings fields
275
  * @uses register_setting() To register various settings
276
- * @uses do_action() Calls 'bp_register_admin_settings'
277
  */
278
  public function register_admin_settings() {
279
 
@@ -326,10 +282,10 @@ class BP_Admin {
326
 
327
  /** Forums ************************************************************/
328
 
329
- if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) {
330
 
331
  // Add the main section
332
- add_settings_section( 'bp_forums', __( 'Forums Settings', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' );
333
 
334
  // Allow subscriptions setting
335
  add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' );
@@ -353,8 +309,6 @@ class BP_Admin {
353
  register_setting ( 'buddypress', '_bp_enable_akismet', 'intval' );
354
  }
355
  }
356
-
357
- do_action( 'bp_register_admin_settings' );
358
  }
359
 
360
  /**
@@ -366,27 +320,17 @@ class BP_Admin {
366
  * @param string $file Current plugin basename
367
  * @return array Processed links
368
  */
369
- public function add_settings_link( $links, $file ) {
370
- global $bp;
371
 
372
- if ( plugin_basename( $bp->file ) == $file ) {
373
- $url = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
374
- $settings_link = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>';
375
- array_unshift( $links, $settings_link );
376
- }
377
-
378
- return $links;
379
- }
380
 
381
- /**
382
- * BuddyPress's dedicated admin init action
383
- *
384
- * @since BuddyPress (1.6)
385
- *
386
- * @uses do_action() Calls 'bp_admin_init'
387
- */
388
- public function admin_init() {
389
- do_action( 'bp_admin_init' );
390
  }
391
 
392
  /**
@@ -394,7 +338,16 @@ class BP_Admin {
394
  *
395
  * @since BuddyPress (1.6)
396
  */
397
- public function admin_head() { }
 
 
 
 
 
 
 
 
 
398
 
399
  /**
400
  * Add some general styling to the admin area
@@ -403,92 +356,249 @@ class BP_Admin {
403
  */
404
  public function enqueue_scripts() {
405
 
406
- $maybe_dev = '';
407
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
408
- $maybe_dev = '.dev';
409
 
410
- $file = $this->css_url . "common{$maybe_dev}.css";
411
  $file = apply_filters( 'bp_core_admin_common_css', $file );
412
  wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
 
413
 
414
- // Extra bits for the installation wizard
415
- if ( bp_get_maintenance_mode() ) {
416
-
417
- // Styling
418
- $file = $this->css_url . "wizard{$maybe_dev}.css";
419
- $file = apply_filters( 'bp_core_admin_wizard_css', $file );
420
- wp_enqueue_style( 'bp-admin-wizard-css', $file, array(), bp_get_version() );
421
-
422
- // JS
423
- $file = $this->js_url . "wizard{$maybe_dev}.js";
424
- $file = apply_filters( 'bp_core_admin_wizard_js', $file );
425
- wp_enqueue_script( 'bp-admin-wizard-js', $file, array(), bp_get_version() );
426
 
427
- // We'll need the thickbox too
428
- wp_enqueue_script( 'thickbox' );
429
- wp_enqueue_style( 'thickbox' );
430
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
 
432
- do_action( 'bp_admin_head' );
433
  }
434
 
435
  /**
436
- * Add any admin notices we might need, mostly for update or new installs
437
  *
438
- * @since BuddyPress (1.6)
 
439
  *
440
- * @global string $pagenow
441
- * @return If no notice is needed
442
  */
443
- public function admin_notices() {
444
- global $pagenow;
445
-
446
- // Bail if not in maintenance mode
447
- if ( ! bp_get_maintenance_mode() )
448
- return;
449
-
450
- // Bail if user cannot manage options
451
- if ( ! current_user_can( 'manage_options' ) )
452
- return;
453
-
454
- // Are we looking at a network?
455
- if ( bp_core_do_network_admin() ) {
456
-
457
- // Bail if looking at wizard page
458
- if ( ( 'admin.php' == $pagenow ) && ( !empty( $_GET['page'] ) && ( 'bp-wizard' == $_GET['page'] ) ) ) {
459
- return;
460
- }
461
-
462
- // Set the url for the nag
463
- $url = network_admin_url( 'admin.php?page=bp-wizard' );
464
-
465
- // Single site
466
- } else {
467
-
468
- // Bail if looking at wizard page
469
- if ( ( 'index.php' == $pagenow ) && ( !empty( $_GET['page'] ) && ( 'bp-wizard' == $_GET['page'] ) ) ) {
470
- return;
471
- }
472
-
473
- // Set the url for the nag
474
- $url = admin_url( 'index.php?page=bp-wizard' );
475
- }
476
-
477
- // What does the nag say?
478
- switch ( bp_get_maintenance_mode() ) {
479
-
480
- // Update text
481
- case 'update' :
482
- $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), $url );
483
- break;
484
-
485
- // First install text
486
- case 'install' : default :
487
- $msg = sprintf( __( 'BuddyPress was successfully activated! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), $url );
488
- break;
489
- } ?>
490
-
491
- <div class="update-nag"><?php echo $msg; ?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
 
493
  <?php
494
  }
@@ -503,9 +613,5 @@ endif; // class_exists check
503
  * @uses BP_Admin
504
  */
505
  function bp_admin() {
506
- global $bp;
507
-
508
- $bp->admin = new BP_Admin();
509
  }
510
-
511
- ?>
20
  */
21
  class BP_Admin {
22
 
 
 
 
 
 
 
 
 
23
  /** Directory *************************************************************/
24
 
25
  /**
49
  */
50
  public $js_url = '';
51
 
 
52
  /** Methods ***************************************************************/
53
 
54
  /**
56
  *
57
  * @since BuddyPress (1.6)
58
  *
59
+ * @uses BP_Admin::setup_globals() Setup the globals needed
60
+ * @uses BP_Admin::includes() Include the required files
61
+ * @uses BP_Admin::setup_actions() Setup the hooks and actions
62
  */
63
  public function __construct() {
64
  $this->setup_globals();
73
  * @access private
74
  */
75
  private function setup_globals() {
76
+ $bp = buddypress();
 
 
 
 
 
 
77
 
78
+ // Paths and URLs
79
+ $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path
80
+ $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url
81
+ $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL
82
+ $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL
83
+ $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin css URL
84
 
85
+ // Main settings page
86
+ $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
 
 
 
87
  }
88
 
89
  /**
93
  * @access private
94
  */
95
  private function includes() {
96
+ require( $this->admin_dir . 'bp-core-actions.php' );
97
+ require( $this->admin_dir . 'bp-core-settings.php' );
98
+ require( $this->admin_dir . 'bp-core-functions.php' );
99
+ require( $this->admin_dir . 'bp-core-components.php' );
100
+ require( $this->admin_dir . 'bp-core-slugs.php' );
 
 
 
 
 
 
 
 
101
  }
102
 
103
  /**
111
  */
112
  private function setup_actions() {
113
 
 
 
 
 
 
114
  /** General Actions ***************************************************/
115
 
 
 
 
116
  // Add some page specific output to the <head>
117
+ add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 );
118
 
119
  // Add menu item to settings menu
120
+ add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 );
 
 
 
 
121
 
122
  // Enqueue all admin JS and CSS
123
+ add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
124
 
125
  /** BuddyPress Actions ************************************************/
126
 
127
  // Add settings
128
+ add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) );
129
 
130
  /** Filters ***********************************************************/
131
 
132
  // Add link to settings page
133
+ add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
134
+ add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
 
 
 
135
  }
136
 
137
  /**
145
  */
146
  public function admin_menus() {
147
 
148
+ // Bail if user cannot moderate
149
+ if ( ! bp_current_user_can( 'manage_options' ) )
150
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
+ // About
153
+ add_dashboard_page(
154
+ __( 'Welcome to BuddyPress', 'buddypress' ),
155
+ __( 'Welcome to BuddyPress', 'buddypress' ),
156
+ 'manage_options',
157
+ 'bp-about',
158
+ array( $this, 'about_screen' )
159
+ );
160
+
161
+ // Credits
162
+ add_dashboard_page(
163
+ __( 'Welcome to BuddyPress', 'buddypress' ),
164
+ __( 'Welcome to BuddyPress', 'buddypress' ),
165
+ 'manage_options',
166
+ 'bp-credits',
167
+ array( $this, 'credits_screen' )
168
+ );
169
+
170
+ $hooks = array();
171
+
172
+ // Changed in BP 1.6 . See bp_core_admin_backpat_menu()
173
+ $hooks[] = add_menu_page(
174
+ __( 'BuddyPress', 'buddypress' ),
175
+ __( 'BuddyPress', 'buddypress' ),
176
+ 'manage_options',
177
+ 'bp-general-settings',
178
+ 'bp_core_admin_backpat_menu',
179
+ 'div'
180
+ );
181
+
182
+ $hooks[] = add_submenu_page(
183
+ 'bp-general-settings',
184
+ __( 'BuddyPress Help', 'buddypress' ),
185
+ __( 'Help', 'buddypress' ),
186
+ 'manage_options',
187
+ 'bp-general-settings',
188
+ 'bp_core_admin_backpat_page'
189
+ );
190
+
191
+ // Add the option pages
192
+ $hooks[] = add_submenu_page(
193
+ $this->settings_page,
194
+ __( 'BuddyPress Components', 'buddypress' ),
195
+ __( 'BuddyPress', 'buddypress' ),
196
+ 'manage_options',
197
+ 'bp-components',
198
+ 'bp_core_admin_components_settings'
199
+ );
200
+
201
+ $hooks[] = add_submenu_page(
202
+ $this->settings_page,
203
+ __( 'BuddyPress Pages', 'buddypress' ),
204
+ __( 'BuddyPress Pages', 'buddypress' ),
205
+ 'manage_options',
206
+ 'bp-page-settings',
207
+ 'bp_core_admin_slugs_settings'
208
+ );
209
+
210
+ $hooks[] = add_submenu_page(
211
+ $this->settings_page,
212
+ __( 'BuddyPress Settings', 'buddypress' ),
213
+ __( 'BuddyPress Settings', 'buddypress' ),
214
+ 'manage_options',
215
+ 'bp-settings',
216
+ 'bp_core_admin_settings'
217
+ );
218
+
219
+ // Fudge the highlighted subnav item when on a BuddyPress admin page
220
+ foreach( $hooks as $hook ) {
221
+ add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
222
  }
223
  }
224
 
230
  * @uses add_settings_section() To add our own settings section
231
  * @uses add_settings_field() To add various settings fields
232
  * @uses register_setting() To register various settings
 
233
  */
234
  public function register_admin_settings() {
235
 
282
 
283
  /** Forums ************************************************************/
284
 
285
+ if ( bp_is_active( 'forums' ) ) {
286
 
287
  // Add the main section
288
+ add_settings_section( 'bp_forums', __( 'Legacy Group Forums', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' );
289
 
290
  // Allow subscriptions setting
291
  add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' );
309
  register_setting ( 'buddypress', '_bp_enable_akismet', 'intval' );
310
  }
311
  }
 
 
312
  }
313
 
314
  /**
320
  * @param string $file Current plugin basename
321
  * @return array Processed links
322
  */
323
+ public function modify_plugin_action_links( $links, $file ) {
 
324
 
325
+ // Return normal links if not BuddyPress
326
+ if ( plugin_basename( buddypress()->file ) != $file )
327
+ return $links;
 
 
 
 
 
328
 
329
+ // Add a few links to the existing links array
330
+ return array_merge( $links, array(
331
+ 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
332
+ 'about' => '<a href="' . add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'buddypress' ) . '</a>'
333
+ ) );
 
 
 
 
334
  }
335
 
336
  /**
338
  *
339
  * @since BuddyPress (1.6)
340
  */
341
+ public function admin_head() {
342
+
343
+ // Settings pages
344
+ remove_submenu_page( $this->settings_page, 'bp-page-settings' );
345
+ remove_submenu_page( $this->settings_page, 'bp-settings' );
346
+
347
+ // About and Credits pages
348
+ remove_submenu_page( 'index.php', 'bp-about' );
349
+ remove_submenu_page( 'index.php', 'bp-credits' );
350
+ }
351
 
352
  /**
353
  * Add some general styling to the admin area
356
  */
357
  public function enqueue_scripts() {
358
 
359
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 
 
360
 
361
+ $file = $this->css_url . "common{$min}.css";
362
  $file = apply_filters( 'bp_core_admin_common_css', $file );
363
  wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
364
+ }
365
 
366
+ /** About *****************************************************************/
 
 
 
 
 
 
 
 
 
 
 
367
 
368
+ /**
369
+ * Output the about screen
370
+ *
371
+ * @since BuddyPress (1.7)
372
+ */
373
+ public function about_screen() {
374
+ global $wp_rewrite;
375
+
376
+ $is_new_install = ! empty( $_GET['is_new_install'] );
377
+
378
+ $pretty_permalinks_enabled = ! empty( $wp_rewrite->permalink_structure );
379
+
380
+ list( $display_version ) = explode( '-', bp_get_version() ); ?>
381
+
382
+ <div class="wrap about-wrap">
383
+ <h1><?php printf( __( 'Welcome to BuddyPress %s' ), $display_version ); ?></h1>
384
+ <div class="about-text">
385
+ <?php if ( $is_new_install ) : ?>
386
+ <?php printf( __( 'BuddyPress %s is our safest, fastest, most flexible version ever.' ), $display_version ); ?>
387
+ <?php else : ?>
388
+ <?php printf( __( 'Thank you for updating! BuddyPress %s is our safest, fastest, most flexible version ever.' ), $display_version ); ?>
389
+ <?php endif; ?>
390
+ </div>
391
+ <div class="bp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
392
+
393
+ <h2 class="nav-tab-wrapper">
394
+ <a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>">
395
+ <?php _e( 'What&#8217;s New', 'buddypress' ); ?>
396
+ </a><a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>">
397
+ <?php _e( 'Credits', 'buddypress' ); ?>
398
+ </a>
399
+ </h2>
400
+
401
+ <?php if ( $is_new_install ) : ?>
402
+ <h3><?php _e( 'Getting Started', 'buddypress' ); ?></h3>
403
+
404
+ <div class="feature-section">
405
+ <h4><?php _e( 'Your Default Setup', 'buddypress' ); ?></h4>
406
+ <p><?php printf(
407
+ __( 'BuddyPress&#8217;s powerful features help your users connect and collaborate. To help get your community started, we&#8217;ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href="%3$s">configuring user profiles</a>. Want to explore more of BP&#8217;s features? Visit the <a href="%4$s">Components panel</a>.', 'buddypress' ),
408
+ $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . __( 'Members', 'buddypress' ) . '</a>' : __( 'Members', 'buddypress' ),
409
+ $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ) . '">' . __( 'Activity', 'buddypress' ) . '</a>' : __( 'Activity', 'buddypress' ),
410
+ bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ),
411
+ bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
412
+ ); ?></p>
413
+
414
+ <h4><?php _e( 'Community and Support', 'buddypress' ); ?></h4>
415
+ <p><?php _e( 'Looking for help? The <a href="http://codex.buddypress.org/">BuddyPress Codex</a> has you covered, with dozens of user-contributed guides on how to configure and use your BP site. Can&#8217;t find what you need? Stop by <a href="http://buddypress.org/support/">our support forums</a>, where a vibrant community of BuddyPress users and developers is waiting to share tips, show off their sites, talk about the future of BuddyPress, and much more.', 'buddypress' ) ?></p>
416
+ </div>
417
+
418
+ <?php endif; ?>
419
+
420
+ <div class="changelog">
421
+ <h3><?php _e( 'A Declaration of (Theme) Independence', 'buddypress' ); ?></h3>
422
+
423
+ <div class="feature-section">
424
+ <h4><?php _e( 'It Just Works', 'buddypress' ); ?></h4>
425
+ <p><?php _e( 'BuddyPress is now compatible with <strong>any WordPress theme</strong>. If your theme has BuddyPress-specific templates and styling, we&#8217;ll use them. If not, we provide what you need to make your BuddyPress content look great. Still want to customize? No problem - you can override our templates just like you would in a WordPress child theme. <a href="http://codex.buddypress.org/theme-compatibility/">Learn more about theme compatibility</a>.', 'buddypress' ); ?></p>
426
+ </div>
427
+ </div>
428
+
429
+ <div class="changelog">
430
+ <h3><?php _e( 'Group Management', 'buddypress' ); ?></h3>
431
+
432
+ <div class="feature-section">
433
+ <h4><?php _e( 'Get More Done Quickly', 'buddypress' ); ?></h4>
434
+
435
+ <?php
436
+ $group_admin_text = __( 'Groups administration panel', 'buddypress' );
437
+ if ( bp_is_active( 'groups' ) ) {
438
+ $group_admin_text = '<a href="' . bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) . '">' . $group_admin_text . '</a>';
439
+ }
440
+ ?>
441
+
442
+ <p><?php printf(
443
+ __( 'The new %s makes it easy to handle large numbers of groups on your BuddyPress installation. Delete groups, edit group details, modify memberships, and more, with just a few clicks.', 'buddypress' ),
444
+ $group_admin_text
445
+ ); ?></p>
446
+ </div>
447
+ </div>
448
+
449
+ <div class="changelog">
450
+ <h3><?php _e( 'Under the Hood', 'buddypress' ); ?></h3>
451
+
452
+ <div class="feature-section three-col">
453
+ <div>
454
+ <h4><?php _e( 'Faster Member Queries', 'buddypress' ); ?></h4>
455
+ <p><?php _e( 'The new <code>BP_User_Query</code> makes member queries (like in the Members directory) up to 4x faster than before.', 'buddypress' ); ?></p>
456
+
457
+ <h4><?php _e( 'Sortable Profile Options', 'buddypress' ); ?></h4>
458
+ <p><?php _e( 'Profile field types with multiple options - like radio buttons and checkboxes - now support drag-and-drop reordering.', 'buddypress' ); ?></p>
459
+ </div>
460
+
461
+ <div>
462
+ <h4><?php _e( 'New Visibility Level', 'buddypress' ); ?></h4>
463
+ <p><?php _e( 'By popular demand, the "Admins Only" visibility setting is now available for profile fields.', 'buddypress' ); ?></p>
464
+
465
+ <h4><?php _e( 'Better bbPress Integration', 'buddypress' ); ?></h4>
466
+ <p><?php _e( 'Support for group and sitewide forums, using the latest version of the bbPress plugin, is better than ever. Still using bbPress 1.x? Our new migration tools are field-tested.', 'buddypress' ); ?></p>
467
+ </div>
468
+ </div>
469
+
470
+ <div class="return-to-dashboard">
471
+ <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Go to the BuddyPress Settings page', 'buddypress' ); ?></a>
472
+ </div>
473
+
474
+ </div>
475
 
476
+ <?php
477
  }
478
 
479
  /**
480
+ * Output the credits screen
481
  *
482
+ * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll
483
+ * want to leverage api.wordpress.org eventually.
484
  *
485
+ * @since BuddyPress (1.7)
 
486
  */
487
+ public function credits_screen() {
488
+
489
+ list( $display_version ) = explode( '-', bp_get_version() ); ?>
490
+
491
+ <div class="wrap about-wrap">
492
+ <h1><?php printf( __( 'Welcome to BuddyPress %s' ), $display_version ); ?></h1>
493
+ <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! BuddyPress %s is ready to make your community a safer, faster, and better looking place to hang out!' ), $display_version ); ?></div>
494
+ <div class="bp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
495
+
496
+ <h2 class="nav-tab-wrapper">
497
+ <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
498
+ <?php _e( 'What&#8217;s New', 'buddypress' ); ?>
499
+ </a><a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
500
+ <?php _e( 'Credits', 'buddypress' ); ?>
501
+ </a>
502
+ </h2>
503
+
504
+ <p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks.', 'buddypress' ); ?></p>
505
+
506
+ <h4 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h4>
507
+ <ul class="wp-people-group " id="wp-people-group-project-leaders">
508
+ <li class="wp-person" id="wp-person-apeatling">
509
+ <a href="http://profiles.wordpress.org/apeatling"><img src="http://0.gravatar.com/avatar/bb29d699b5cba218c313b61aa82249da?s=60" class="gravatar" alt="Andy Peatling" /></a>
510
+ <a class="web" href="http://profiles.wordpress.org/apeatling">Andy Peatling</a>
511
+ <span class="title"><?php _e( 'Founding Developer', 'buddypress' ); ?></span>
512
+ </li>
513
+ <li class="wp-person" id="wp-person-johnjamesjacoby">
514
+ <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
515
+ <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
516
+ <span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span>
517
+ </li>
518
+ <li class="wp-person" id="wp-person-boonebgorges">
519
+ <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a>
520
+ <a class="web" href="http://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a>
521
+ <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
522
+ </li>
523
+ <li class="wp-person" id="wp-person-djpaul">
524
+ <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a>
525
+ <a class="web" href="http://profiles.wordpress.org/djpaul">Paul Gibbs</a>
526
+ <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
527
+ </li>
528
+ </ul>
529
+
530
+ <h4 class="wp-people-group"><?php _e( 'Core Developers', 'buddypress' ); ?></h4>
531
+ <ul class="wp-people-group " id="wp-people-group-core-developers">
532
+ <li class="wp-person" id="wp-person-r-a-y">
533
+ <a href="http://profiles.wordpress.org/r-a-y"><img src="http://0.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a>
534
+ <a class="web" href="http://profiles.wordpress.org/r-a-y">Ray</a>
535
+ </li>
536
+ </ul>
537
+
538
+ <h4 class="wp-people-group"><?php _e( 'Recent Rockstars', 'buddypress' ); ?></h4>
539
+ <ul class="wp-people-group " id="wp-people-group-rockstars">
540
+ <li class="wp-person" id="wp-person-karmatosed">
541
+ <a href="http://profiles.wordpress.org/karmatosed"><img src="http://0.gravatar.com/avatar/d36d2c1821af9249b69ff7f5ed60529b?s=60" class="gravatar" alt="Tammie Lister" /></a>
542
+ <a class="web" href="http://profiles.wordpress.org/karmatosed">Tammie Lister</a>
543
+ <span class="title"><?php _e( 'Design Officer', 'buddypress' ); ?></span>
544
+ </li>
545
+ <li class="wp-person" id="wp-person-mercime">
546
+ <a href="http://profiles.wordpress.org/mercime"><img src="http://0.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a>
547
+ <a class="web" href="http://profiles.wordpress.org/mercime">Mercime</a>
548
+ <span class="title"><?php _e( 'Support Officer', 'buddypress' ); ?></span>
549
+ </li>
550
+ </ul>
551
+
552
+ <h4 class="wp-people-group"><?php _e( 'Core Contributors to BuddyPress 1.7', 'buddypress' ); ?></h4>
553
+ <p class="wp-credits-list">
554
+ <a href="http://profiles.wordpress.org/aesqe">aesqe</a>,
555
+ <a href="http://profiles.wordpress.org/apeatling">apeatling</a>,
556
+ <a href="http://profiles.wordpress.org/borkweb">borkweb</a>,
557
+ <a href="http://profiles.wordpress.org/calin">calin</a>,
558
+ <a href="http://profiles.wordpress.org/chouf1">chouf1</a>,
559
+ <a href="http://profiles.wordpress.org/chrisclayton">chrisclayton</a>,
560
+ <a href="http://profiles.wordpress.org/cnorris23">cnorris23</a>,
561
+ <a href="http://profiles.wordpress.org/ddean">ddean</a>,
562
+ <a href="http://profiles.wordpress.org/DennisSmolek">DennisSmolek</a>,
563
+ <a href="http://profiles.wordpress.org/Dianakc">Dianakc</a>,
564
+ <a href="http://profiles.wordpress.org/dontdream">dontdream</a>,
565
+ <a href="http://profiles.wordpress.org/empireoflight">empireoflight</a>,
566
+ <a href="http://profiles.wordpress.org/enej">enej</a>,
567
+ <a href="http://profiles.wordpress.org/ethitter">ethitter</a>,
568
+ <a href="http://profiles.wordpress.org/fanquake">fanquake</a>,
569
+ <a href="http://profiles.wordpress.org/gmax21">gmax21</a>,
570
+ <a href="http://profiles.wordpress.org/hnla">hnla</a>,
571
+ <a href="http://profiles.wordpress.org/humanshell">humanshell</a>,
572
+ <a href="http://profiles.wordpress.org/imath">imath</a>,
573
+ <a href="http://profiles.wordpress.org/Jacek">Jacek</a>,
574
+ <a href="http://profiles.wordpress.org/jag1989">jag1989</a>,
575
+ <a href="http://profiles.wordpress.org/jbobich">jbobich</a>,
576
+ <a href="http://profiles.wordpress.org/jkudish">jkudish</a>,
577
+ <a href="http://profiles.wordpress.org/jpsb">jpsb</a>,
578
+ <a href="http://profiles.wordpress.org/MacPresss">MacPresss</a>,
579
+ <a href="http://profiles.wordpress.org/magnus78">magnus78</a>,
580
+ <a href="http://profiles.wordpress.org/markjaquith">markjaquith</a>,
581
+ <a href="http://profiles.wordpress.org/Maty">Maty</a>,
582
+ <a href="http://profiles.wordpress.org/michael.ecklund">michael.ecklund</a>,
583
+ <a href="http://profiles.wordpress.org/modemlooper">modemlooper</a>,
584
+ <a href="http://profiles.wordpress.org/nacin">nacin</a>,
585
+ <a href="http://profiles.wordpress.org/netweb">netweb</a>,
586
+ <a href="http://profiles.wordpress.org/rogercoathup">rogercoathup</a>,
587
+ <a href="http://profiles.wordpress.org/sboisvert">sboisvert</a>,
588
+ <a href="http://profiles.wordpress.org/sbrajesh">sbrajesh</a>,
589
+ <a href="http://profiles.wordpress.org/slaFFik">slaFFik</a>,
590
+ <a href="http://profiles.wordpress.org/steve7777">steve7777</a>,
591
+ <a href="http://profiles.wordpress.org/tiraeth">tiraeth</a>,
592
+ <a href="http://profiles.wordpress.org/will_c">will_c</a>,
593
+ <a href="http://profiles.wordpress.org/wpdennis">wpdennis</a>,
594
+ <a href="http://profiles.wordpress.org/xt4v">xt4v</a>.
595
+ </p>
596
+
597
+ <div class="return-to-dashboard">
598
+ <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Go to the BuddyPress Settings page', 'buddypress' ); ?></a>
599
+ </div>
600
+
601
+ </div>
602
 
603
  <?php
604
  }
613
  * @uses BP_Admin
614
  */
615
  function bp_admin() {
616
+ buddypress()->admin = new BP_Admin();
 
 
617
  }
 
 
bp-core/bp-core-adminbar.php CHANGED
@@ -43,34 +43,77 @@ function bp_admin_bar_my_account_root() {
43
  }
44
  add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  /**
47
  * Handle the Toolbar CSS
48
  *
49
  * @since BuddyPress 1.5
50
  */
51
  function bp_core_load_admin_bar_css() {
 
52
 
53
  if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() )
54
  return;
55
 
 
 
56
  // Toolbar styles
57
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
58
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.dev.css';
59
- else
60
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.css';
61
 
62
  wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() );
63
-
64
- if ( !is_rtl() )
65
- return;
66
-
67
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
68
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.dev.css';
69
- else
70
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.css';
71
-
72
- wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() );
73
  }
74
- add_action( 'bp_init', 'bp_core_load_admin_bar_css' );
75
-
76
- ?>
43
  }
44
  add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
45
 
46
+ /**
47
+ * Handle the Toolbar/BuddyBar business
48
+ *
49
+ * @since BuddyPress (1.2)
50
+ *
51
+ * @global string $wp_version
52
+ * @uses bp_get_option()
53
+ * @uses is_user_logged_in()
54
+ * @uses bp_use_wp_admin_bar()
55
+ * @uses show_admin_bar()
56
+ * @uses add_action() To hook 'bp_adminbar_logo' to 'bp_adminbar_logo'
57
+ * @uses add_action() To hook 'bp_adminbar_login_menu' to 'bp_adminbar_menus'
58
+ * @uses add_action() To hook 'bp_adminbar_account_menu' to 'bp_adminbar_menus'
59
+ * @uses add_action() To hook 'bp_adminbar_thisblog_menu' to 'bp_adminbar_menus'
60
+ * @uses add_action() To hook 'bp_adminbar_random_menu' to 'bp_adminbar_menus'
61
+ * @uses add_action() To hook 'bp_core_admin_bar' to 'wp_footer'
62
+ * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer'
63
+ */
64
+ function bp_core_load_admin_bar() {
65
+ global $wp_version;
66
+
67
+ // Don't show if Toolbar is disabled for non-logged in users
68
+ if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && ! is_user_logged_in() )
69
+ return;
70
+
71
+ // Show the WordPress Toolbar
72
+ if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) {
73
+
74
+ // Respect user's Toolbar display preferences
75
+ if ( is_user_logged_in() && ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) ) )
76
+ return;
77
+
78
+ show_admin_bar( true );
79
+
80
+ // Hide the WordPress Toolbar
81
+ } elseif ( !bp_use_wp_admin_bar() ) {
82
+
83
+ // Keep the WP Toolbar from loading
84
+ show_admin_bar( false );
85
+
86
+ // Actions used to build the BP Toolbar
87
+ add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );
88
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
89
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
90
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );
91
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
92
+
93
+ // Actions used to append BP Toolbar to footer
94
+ add_action( 'wp_footer', 'bp_core_admin_bar', 8 );
95
+ add_action( 'admin_footer', 'bp_core_admin_bar' );
96
+ }
97
+ }
98
+
99
  /**
100
  * Handle the Toolbar CSS
101
  *
102
  * @since BuddyPress 1.5
103
  */
104
  function bp_core_load_admin_bar_css() {
105
+ global $wp_styles;
106
 
107
  if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() )
108
  return;
109
 
110
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
111
+
112
  // Toolbar styles
113
+ $stylesheet = BP_PLUGIN_URL . "bp-core/css/admin-bar{$min}.css";
 
 
 
114
 
115
  wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() );
116
+ $wp_styles->add_data( 'bp-admin-bar', 'rtl', true );
117
+ if ( $min )
118
+ $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min );
 
 
 
 
 
 
 
119
  }
 
 
 
bp-core/bp-core-avatars.php CHANGED
@@ -11,7 +11,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
11
  * Set up the constants we need for avatar support
12
  */
13
  function bp_core_set_avatar_constants() {
14
- global $bp;
15
 
16
  if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
17
  define( 'BP_AVATAR_THUMB_WIDTH', 50 );
@@ -29,6 +28,9 @@ function bp_core_set_avatar_constants() {
29
  define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
30
 
31
  if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
 
 
 
32
  if ( !isset( $bp->site_options['fileupload_maxk'] ) ) {
33
  define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb
34
  } else {
@@ -41,21 +43,25 @@ function bp_core_set_avatar_constants() {
41
 
42
  if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
43
  define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . 'bp-core/images/mystery-man-50.jpg' );
 
 
 
 
44
  }
45
  add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
46
 
47
  function bp_core_set_avatar_globals() {
48
- global $bp;
49
 
50
  $bp->avatar = new stdClass;
51
  $bp->avatar->thumb = new stdClass;
52
  $bp->avatar->full = new stdClass;
53
 
54
  // Dimensions
55
- $bp->avatar->thumb->width = BP_AVATAR_THUMB_WIDTH;
56
- $bp->avatar->thumb->height = BP_AVATAR_THUMB_HEIGHT;
57
- $bp->avatar->full->width = BP_AVATAR_FULL_WIDTH;
58
- $bp->avatar->full->height = BP_AVATAR_FULL_HEIGHT;
59
 
60
  // Upload maximums
61
  $bp->avatar->original_max_width = BP_AVATAR_ORIGINAL_MAX_WIDTH;
@@ -63,11 +69,15 @@ function bp_core_set_avatar_globals() {
63
 
64
  // Defaults
65
  $bp->avatar->thumb->default = BP_AVATAR_DEFAULT_THUMB;
66
- $bp->avatar->full->default = BP_AVATAR_DEFAULT;
67
 
68
  // These have to be set on page load in order to avoid infinite filter loops at runtime
69
  $bp->avatar->upload_path = bp_core_avatar_upload_path();
70
- $bp->avatar->url = bp_core_avatar_url();
 
 
 
 
71
 
72
  // Backpat for pre-1.5
73
  if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) )
@@ -87,13 +97,19 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
87
  * Fetches an avatar from a BuddyPress object. Supports user/group/blog as
88
  * default, but can be extended to include your own custom components too.
89
  *
90
- * @global BuddyPress $bp The one true BuddyPress instance
91
  * @global $current_blog WordPress global containing information and settings for the current blog being viewed.
92
  * @param array $args Determine the output of this function
93
  * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg
94
  */
95
  function bp_core_fetch_avatar( $args = '' ) {
96
- global $bp, $current_blog;
 
 
 
 
 
 
 
97
 
98
  // Set a few default variables
99
  $def_object = 'user';
@@ -101,7 +117,7 @@ function bp_core_fetch_avatar( $args = '' ) {
101
  $def_class = 'avatar';
102
 
103
  // Set the default variables array
104
- $defaults = array(
105
  'item_id' => false,
106
  'object' => $def_object, // user/group/blog/custom type (if you use filters)
107
  'type' => $def_type, // thumb or full
@@ -115,10 +131,7 @@ function bp_core_fetch_avatar( $args = '' ) {
115
  'no_grav' => false, // If there is no avatar found, return false instead of a grav?
116
  'html' => true, // Wrap the return img URL in <img />
117
  'title' => '' // Custom <img> title (string)
118
- );
119
-
120
- // Compare defaults to passed and extract
121
- $params = wp_parse_args( $args, $defaults );
122
  extract( $params, EXTR_SKIP );
123
 
124
  /** Set item_id ***********************************************************/
@@ -191,9 +204,6 @@ function bp_core_fetch_avatar( $args = '' ) {
191
 
192
  if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) {
193
 
194
- // Get item name for alt/title tags
195
- $item_name = '';
196
-
197
  switch ( $object ) {
198
 
199
  case 'blog' :
@@ -220,25 +230,35 @@ function bp_core_fetch_avatar( $args = '' ) {
220
  if ( empty( $alt ) )
221
  $alt = __( 'Avatar Image', 'buddypress' );
222
 
 
 
223
  // Set title tag, if it's been provided
224
- if ( !empty( $title ) )
225
  $title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object, $params ) ) . "'";
 
226
 
227
  // Set CSS ID if passed
228
- if ( !empty( $css_id ) )
229
- $css_id = ' id="' . $css_id . '"';
 
230
 
231
  // Set image width
232
- if ( false !== $width )
233
  $html_width = ' width="' . $width . '"';
234
- else
235
- $html_width = ( 'thumb' == $type ) ? ' width="' . bp_core_avatar_thumb_width() . '"' : ' width="' . bp_core_avatar_full_width() . '"';
 
 
 
236
 
237
  // Set image height
238
- if ( false !== $height )
239
  $html_height = ' height="' . $height . '"';
240
- else
241
- $html_height = ( 'thumb' == $type ) ? ' height="' . bp_core_avatar_thumb_height() . '"' : ' height="' . bp_core_avatar_full_height() . '"';
 
 
 
242
 
243
  // Set img URL and DIR based on prepopulated constants
244
  $avatar_loc = new stdClass();
@@ -250,9 +270,9 @@ function bp_core_fetch_avatar( $args = '' ) {
250
  $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
251
 
252
  // Add an identifying class
253
- $class .= ' ' . $object . '-' . $item_id . '-avatar';
254
 
255
- /****
256
  * Look for uploaded avatar first. Use it if it exists.
257
  * Set the file names to search for, to select the full size
258
  * or thumbnail image.
@@ -314,7 +334,7 @@ function bp_core_fetch_avatar( $args = '' ) {
314
 
315
  // Return it wrapped in an <img> element
316
  if ( true === $html ) {
317
- return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
318
 
319
  // ...or only the URL
320
  } else {
@@ -356,7 +376,7 @@ function bp_core_fetch_avatar( $args = '' ) {
356
  }
357
 
358
  // Set host based on if using ssl
359
- $host = 'http://www.gravatar.com/avatar/';
360
  if ( is_ssl() ) {
361
  $host = 'https://secure.gravatar.com/avatar/';
362
  }
@@ -367,18 +387,20 @@ function bp_core_fetch_avatar( $args = '' ) {
367
 
368
  // Gravatar rating; http://bit.ly/89QxZA
369
  $rating = get_option( 'avatar_rating' );
370
- if ( ! empty( $rating ) )
371
  $gravatar .= "&amp;r={$rating}";
 
372
 
373
  // No avatar was found, and we've been told not to use a gravatar.
374
  } else {
375
  $gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg', $params );
376
  }
377
 
378
- if ( true === $html )
379
- return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
380
- else
381
  return apply_filters( 'bp_core_fetch_avatar_url', $gravatar );
 
382
  }
383
 
384
  /**
@@ -389,12 +411,10 @@ function bp_core_fetch_avatar( $args = '' ) {
389
  * object - the objetc type user, group, blog, etc.
390
  * avatar_dir - The directory where the avatars to be uploaded.
391
  *
392
- * @global object $bp BuddyPress global settings
393
  * @param mixed $args
394
  * @return bool Success/failure
395
  */
396
  function bp_core_delete_existing_avatar( $args = '' ) {
397
- global $bp;
398
 
399
  $defaults = array(
400
  'item_id' => false,
@@ -409,7 +429,7 @@ function bp_core_delete_existing_avatar( $args = '' ) {
409
  if ( 'user' == $object )
410
  $item_id = bp_displayed_user_id();
411
  else if ( 'group' == $object )
412
- $item_id = $bp->groups->current_group->id;
413
  else if ( 'blog' == $object )
414
  $item_id = $current_blog->id;
415
 
@@ -458,7 +478,6 @@ function bp_core_delete_existing_avatar( $args = '' ) {
458
  * It then checks that the file size is within limits, and that it has an accepted file extension (jpg, gif, png).
459
  * If everything checks out, crop the image and move it to its real location.
460
  *
461
- * @global object $bp BuddyPress global settings
462
  * @param array $file The appropriate entry the from $_FILES superglobal.
463
  * @param string $upload_dir_filter A filter to be applied to upload_dir
464
  * @return bool Success/failure
@@ -466,7 +485,6 @@ function bp_core_delete_existing_avatar( $args = '' ) {
466
  * @see bp_core_check_avatar_type()
467
  */
468
  function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
469
- global $bp;
470
 
471
  /***
472
  * You may want to hook into this filter if you want to override this function.
@@ -478,25 +496,25 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
478
  require_once( ABSPATH . '/wp-admin/includes/file.php' );
479
 
480
  $uploadErrors = array(
481
- 0 => __("There is no error, the file uploaded with success", 'buddypress'),
482
- 1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
483
- 2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
484
- 3 => __("The uploaded file was only partially uploaded", 'buddypress'),
485
- 4 => __("No file was uploaded", 'buddypress'),
486
- 6 => __("Missing a temporary folder", 'buddypress')
487
  );
488
 
489
- if ( !bp_core_check_avatar_upload( $file ) ) {
490
  bp_core_add_message( sprintf( __( 'Your upload failed, please try again. Error was: %s', 'buddypress' ), $uploadErrors[$file['file']['error']] ), 'error' );
491
  return false;
492
  }
493
 
494
- if ( !bp_core_check_avatar_size( $file ) ) {
495
- bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' );
496
  return false;
497
  }
498
 
499
- if ( !bp_core_check_avatar_type( $file ) ) {
500
  bp_core_add_message( __( 'Please upload only JPG, GIF or PNG photos.', 'buddypress' ), 'error' );
501
  return false;
502
  }
@@ -504,8 +522,14 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
504
  // Filter the upload location
505
  add_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
506
 
 
 
507
  $bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) );
508
 
 
 
 
 
509
  // Move the file to the correct upload location.
510
  if ( !empty( $bp->avatar_admin->original['error'] ) ) {
511
  bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' );
@@ -524,17 +548,19 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
524
  $editor->set_quality( 100 );
525
 
526
  $resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
527
- if ( ! is_wp_error( $resized ) )
528
  $thumb = $editor->save( $editor->generate_filename() );
529
- else
530
  $error = $resized;
 
531
 
532
  // Check for thumbnail creation errors
533
- if ( false === $error && is_wp_error( $thumb ) )
534
  $error = $thumb;
 
535
 
 
536
  if ( false === $error ) {
537
- // Thumbnail is good so proceed
538
  $bp->avatar_admin->resized = $thumb;
539
  }
540
 
@@ -552,9 +578,9 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
552
  $bp->avatar_admin->image = new stdClass();
553
 
554
  // We only want to handle one image after resize.
555
- if ( empty( $bp->avatar_admin->resized ) )
556
  $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
557
- else {
558
  $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] );
559
  @unlink( $bp->avatar_admin->original['file'] );
560
  }
@@ -589,7 +615,7 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
589
  */
590
  function bp_core_avatar_handle_crop( $args = '' ) {
591
 
592
- $defaults = array(
593
  'object' => 'user',
594
  'avatar_dir' => 'avatars',
595
  'item_id' => false,
@@ -598,9 +624,7 @@ function bp_core_avatar_handle_crop( $args = '' ) {
598
  'crop_h' => bp_core_avatar_full_height(),
599
  'crop_x' => 0,
600
  'crop_y' => 0
601
- );
602
-
603
- $r = wp_parse_args( $args, $defaults );
604
 
605
  /***
606
  * You may want to hook into this filter if you want to override this function.
@@ -611,7 +635,7 @@ function bp_core_avatar_handle_crop( $args = '' ) {
611
 
612
  extract( $r, EXTR_SKIP );
613
 
614
- if ( !$original_file )
615
  return false;
616
 
617
  $original_file = bp_core_avatar_upload_path() . $original_file;
@@ -619,10 +643,11 @@ function bp_core_avatar_handle_crop( $args = '' ) {
619
  if ( !file_exists( $original_file ) )
620
  return false;
621
 
622
- if ( !$item_id )
623
  $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
624
- else
625
  $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
 
626
 
627
  if ( !file_exists( $avatar_folder_dir ) )
628
  return false;
@@ -634,22 +659,28 @@ function bp_core_avatar_handle_crop( $args = '' ) {
634
  bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) );
635
 
636
  // Make sure we at least have a width and height for cropping
637
- if ( !(int) $crop_w )
638
  $crop_w = bp_core_avatar_full_width();
 
639
 
640
- if ( !(int) $crop_h )
641
  $crop_h = bp_core_avatar_full_height();
 
 
 
 
 
642
 
643
  // Set the full and thumb filenames
644
- $full_filename = wp_hash( $original_file . time() ) . '-bpfull.jpg';
645
- $thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.jpg';
646
 
647
  // Crop the image
648
- $full_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
649
  $thumb_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
650
 
651
  // Check for errors
652
- if ( ! $full_cropped || ! $thumb_cropped || is_wp_error( $full_cropped ) || is_wp_error( $thumb_cropped ) )
653
  return false;
654
 
655
  // Remove the original
@@ -680,23 +711,27 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = ''
680
  return $avatar;
681
 
682
  // If passed an object, assume $user->user_id
683
- if ( is_object( $user ) )
684
  $id = $user->user_id;
685
 
686
  // If passed a number, assume it was a $user_id
687
- else if ( is_numeric( $user ) )
688
  $id = $user;
689
 
690
  // If passed a string and that string returns a user, get the $id
691
- else if ( is_string( $user ) && ( $user_by_email = get_user_by( 'email', $user ) ) )
692
  $id = $user_by_email->ID;
 
693
 
694
  // If somehow $id hasn't been assigned, return the result of get_avatar
695
- if ( empty( $id ) )
696
  return !empty( $avatar ) ? $avatar : $default;
 
697
 
698
- if ( !$alt )
 
699
  $alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) );
 
700
 
701
  // Let BuddyPress handle the fetching of the avatar
702
  $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
@@ -756,7 +791,7 @@ function bp_core_check_avatar_type($file) {
756
  * @return string Absolute path to WP upload directory
757
  */
758
  function bp_core_avatar_upload_path() {
759
- global $bp;
760
 
761
  // See if the value has already been calculated and stashed in the $bp global
762
  if ( isset( $bp->avatar->upload_path ) ) {
@@ -802,7 +837,7 @@ function bp_core_avatar_upload_path() {
802
  * @return string Full URL to current upload location
803
  */
804
  function bp_core_avatar_url() {
805
- global $bp;
806
 
807
  // See if the value has already been calculated and stashed in the $bp global
808
  if ( isset( $bp->avatar->url ) ) {
@@ -870,8 +905,7 @@ function bp_get_user_has_avatar( $user_id = 0 ) {
870
  * @return int $dim The dimension
871
  */
872
  function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
873
- global $bp;
874
-
875
  $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;
876
 
877
  return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
@@ -934,9 +968,7 @@ function bp_core_avatar_full_height() {
934
  * @return int The width
935
  */
936
  function bp_core_avatar_original_max_width() {
937
- global $bp;
938
-
939
- return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width );
940
  }
941
 
942
  /**
@@ -948,9 +980,7 @@ function bp_core_avatar_original_max_width() {
948
  * @return int The filesize
949
  */
950
  function bp_core_avatar_original_max_filesize() {
951
- global $bp;
952
-
953
- return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize );
954
  }
955
 
956
  /**
@@ -962,9 +992,7 @@ function bp_core_avatar_original_max_filesize() {
962
  * @return int The URL of the default avatar
963
  */
964
  function bp_core_avatar_default() {
965
- global $bp;
966
-
967
- return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default );
968
  }
969
 
970
  /**
@@ -976,10 +1004,5 @@ function bp_core_avatar_default() {
976
  * @return int The URL of the default avatar thumb
977
  */
978
  function bp_core_avatar_default_thumb() {
979
- global $bp;
980
-
981
- return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default );
982
  }
983
-
984
-
985
- ?>
11
  * Set up the constants we need for avatar support
12
  */
13
  function bp_core_set_avatar_constants() {
 
14
 
15
  if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
16
  define( 'BP_AVATAR_THUMB_WIDTH', 50 );
28
  define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
29
 
30
  if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
31
+
32
+ $bp = buddypress();
33
+
34
  if ( !isset( $bp->site_options['fileupload_maxk'] ) ) {
35
  define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb
36
  } else {
43
 
44
  if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
45
  define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . 'bp-core/images/mystery-man-50.jpg' );
46
+
47
+ if ( ! defined( 'BP_SHOW_AVATARS' ) ) {
48
+ define( 'BP_SHOW_AVATARS', bp_get_option( 'show_avatars' ) );
49
+ }
50
  }
51
  add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
52
 
53
  function bp_core_set_avatar_globals() {
54
+ $bp = buddypress();
55
 
56
  $bp->avatar = new stdClass;
57
  $bp->avatar->thumb = new stdClass;
58
  $bp->avatar->full = new stdClass;
59
 
60
  // Dimensions
61
+ $bp->avatar->thumb->width = BP_AVATAR_THUMB_WIDTH;
62
+ $bp->avatar->thumb->height = BP_AVATAR_THUMB_HEIGHT;
63
+ $bp->avatar->full->width = BP_AVATAR_FULL_WIDTH;
64
+ $bp->avatar->full->height = BP_AVATAR_FULL_HEIGHT;
65
 
66
  // Upload maximums
67
  $bp->avatar->original_max_width = BP_AVATAR_ORIGINAL_MAX_WIDTH;
69
 
70
  // Defaults
71
  $bp->avatar->thumb->default = BP_AVATAR_DEFAULT_THUMB;
72
+ $bp->avatar->full->default = BP_AVATAR_DEFAULT;
73
 
74
  // These have to be set on page load in order to avoid infinite filter loops at runtime
75
  $bp->avatar->upload_path = bp_core_avatar_upload_path();
76
+ $bp->avatar->url = bp_core_avatar_url();
77
+
78
+ // Cache the root blog's show_avatars setting, to avoid unnecessary
79
+ // calls to switch_to_blog()
80
+ $bp->avatar->show_avatars = (bool) BP_SHOW_AVATARS;
81
 
82
  // Backpat for pre-1.5
83
  if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) )
97
  * Fetches an avatar from a BuddyPress object. Supports user/group/blog as
98
  * default, but can be extended to include your own custom components too.
99
  *
 
100
  * @global $current_blog WordPress global containing information and settings for the current blog being viewed.
101
  * @param array $args Determine the output of this function
102
  * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg
103
  */
104
  function bp_core_fetch_avatar( $args = '' ) {
105
+
106
+ // If avatars are disabled for the root site, obey that request and bail
107
+ if ( ! buddypress()->avatar->show_avatars )
108
+ return;
109
+
110
+ global $current_blog;
111
+
112
+ $bp = buddypress();
113
 
114
  // Set a few default variables
115
  $def_object = 'user';
117
  $def_class = 'avatar';
118
 
119
  // Set the default variables array
120
+ $params = wp_parse_args( $args, array(
121
  'item_id' => false,
122
  'object' => $def_object, // user/group/blog/custom type (if you use filters)
123
  'type' => $def_type, // thumb or full
131
  'no_grav' => false, // If there is no avatar found, return false instead of a grav?
132
  'html' => true, // Wrap the return img URL in <img />
133
  'title' => '' // Custom <img> title (string)
134
+ ) );
 
 
 
135
  extract( $params, EXTR_SKIP );
136
 
137
  /** Set item_id ***********************************************************/
204
 
205
  if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) {
206
 
 
 
 
207
  switch ( $object ) {
208
 
209
  case 'blog' :
230
  if ( empty( $alt ) )
231
  $alt = __( 'Avatar Image', 'buddypress' );
232
 
233
+ $html_alt = ' alt="' . esc_attr( $alt ) . '"';
234
+
235
  // Set title tag, if it's been provided
236
+ if ( !empty( $title ) ) {
237
  $title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object, $params ) ) . "'";
238
+ }
239
 
240
  // Set CSS ID if passed
241
+ if ( !empty( $css_id ) ) {
242
+ $css_id = ' id="' . esc_attr( $css_id ) . '"';
243
+ }
244
 
245
  // Set image width
246
+ if ( false !== $width ) {
247
  $html_width = ' width="' . $width . '"';
248
+ } elseif ( 'thumb' == $type ) {
249
+ $html_width = ' width="' . bp_core_avatar_thumb_width() . '"';
250
+ } else {
251
+ $html_width = ' width="' . bp_core_avatar_full_width() . '"';
252
+ }
253
 
254
  // Set image height
255
+ if ( false !== $height ) {
256
  $html_height = ' height="' . $height . '"';
257
+ } elseif ( 'thumb' == $type ) {
258
+ $html_height = ' height="' . bp_core_avatar_thumb_height() . '"';
259
+ } else {
260
+ $html_height = ' height="' . bp_core_avatar_full_height() . '"';
261
+ }
262
 
263
  // Set img URL and DIR based on prepopulated constants
264
  $avatar_loc = new stdClass();
270
  $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
271
 
272
  // Add an identifying class
273
+ $class .= ' ' . $object . '-' . $item_id . '-avatar ' . sanitize_html_class( "avatar-$width" ) . ' photo';
274
 
275
+ /**
276
  * Look for uploaded avatar first. Use it if it exists.
277
  * Set the file names to search for, to select the full size
278
  * or thumbnail image.
334
 
335
  // Return it wrapped in an <img> element
336
  if ( true === $html ) {
337
+ return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
338
 
339
  // ...or only the URL
340
  } else {
376
  }
377
 
378
  // Set host based on if using ssl
379
+ $host = 'http://gravatar.com/avatar/';
380
  if ( is_ssl() ) {
381
  $host = 'https://secure.gravatar.com/avatar/';
382
  }
387
 
388
  // Gravatar rating; http://bit.ly/89QxZA
389
  $rating = get_option( 'avatar_rating' );
390
+ if ( ! empty( $rating ) ) {
391
  $gravatar .= "&amp;r={$rating}";
392
+ }
393
 
394
  // No avatar was found, and we've been told not to use a gravatar.
395
  } else {
396
  $gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg', $params );
397
  }
398
 
399
+ if ( true === $html ) {
400
+ return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
401
+ } else {
402
  return apply_filters( 'bp_core_fetch_avatar_url', $gravatar );
403
+ }
404
  }
405
 
406
  /**
411
  * object - the objetc type user, group, blog, etc.
412
  * avatar_dir - The directory where the avatars to be uploaded.
413
  *
 
414
  * @param mixed $args
415
  * @return bool Success/failure
416
  */
417
  function bp_core_delete_existing_avatar( $args = '' ) {
 
418
 
419
  $defaults = array(
420
  'item_id' => false,
429
  if ( 'user' == $object )
430
  $item_id = bp_displayed_user_id();
431
  else if ( 'group' == $object )
432
+ $item_id = buddypress()->groups->current_group->id;
433
  else if ( 'blog' == $object )
434
  $item_id = $current_blog->id;
435
 
478
  * It then checks that the file size is within limits, and that it has an accepted file extension (jpg, gif, png).
479
  * If everything checks out, crop the image and move it to its real location.
480
  *
 
481
  * @param array $file The appropriate entry the from $_FILES superglobal.
482
  * @param string $upload_dir_filter A filter to be applied to upload_dir
483
  * @return bool Success/failure
485
  * @see bp_core_check_avatar_type()
486
  */
487
  function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 
488
 
489
  /***
490
  * You may want to hook into this filter if you want to override this function.
496
  require_once( ABSPATH . '/wp-admin/includes/file.php' );
497
 
498
  $uploadErrors = array(
499
+ 0 => __( 'The image was uploaded successfully', 'buddypress' ),
500
+ 1 => __( 'The image exceeds the maximum allowed file size of: ', 'buddypress' ) . size_format( bp_core_avatar_original_max_filesize() ),
501
+ 2 => __( 'The image exceeds the maximum allowed file size of: ', 'buddypress' ) . size_format( bp_core_avatar_original_max_filesize() ),
502
+ 3 => __( 'The uploaded file was only partially uploaded.', 'buddypress' ),
503
+ 4 => __( 'The image was not uploaded.', 'buddypress' ),
504
+ 6 => __( 'Missing a temporary folder.', 'buddypress' )
505
  );
506
 
507
+ if ( ! bp_core_check_avatar_upload( $file ) ) {
508
  bp_core_add_message( sprintf( __( 'Your upload failed, please try again. Error was: %s', 'buddypress' ), $uploadErrors[$file['file']['error']] ), 'error' );
509
  return false;
510
  }
511
 
512
+ if ( ! bp_core_check_avatar_size( $file ) ) {
513
+ bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress' ), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' );
514
  return false;
515
  }
516
 
517
+ if ( ! bp_core_check_avatar_type( $file ) ) {
518
  bp_core_add_message( __( 'Please upload only JPG, GIF or PNG photos.', 'buddypress' ), 'error' );
519
  return false;
520
  }
522
  // Filter the upload location
523
  add_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
524
 
525
+ $bp = buddypress();
526
+
527
  $bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) );
528
 
529
+ // Remove the upload_dir filter, so that other upload URLs on the page
530
+ // don't break
531
+ remove_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
532
+
533
  // Move the file to the correct upload location.
534
  if ( !empty( $bp->avatar_admin->original['error'] ) ) {
535
  bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' );
548
  $editor->set_quality( 100 );
549
 
550
  $resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
551
+ if ( ! is_wp_error( $resized ) ) {
552
  $thumb = $editor->save( $editor->generate_filename() );
553
+ } else {
554
  $error = $resized;
555
+ }
556
 
557
  // Check for thumbnail creation errors
558
+ if ( false === $error && is_wp_error( $thumb ) ) {
559
  $error = $thumb;
560
+ }
561
 
562
+ // Thumbnail is good so proceed
563
  if ( false === $error ) {
 
564
  $bp->avatar_admin->resized = $thumb;
565
  }
566
 
578
  $bp->avatar_admin->image = new stdClass();
579
 
580
  // We only want to handle one image after resize.
581
+ if ( empty( $bp->avatar_admin->resized ) ) {
582
  $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
583
+ } else {
584
  $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] );
585
  @unlink( $bp->avatar_admin->original['file'] );
586
  }
615
  */
616
  function bp_core_avatar_handle_crop( $args = '' ) {
617
 
618
+ $r = wp_parse_args( $args, array(
619
  'object' => 'user',
620
  'avatar_dir' => 'avatars',
621
  'item_id' => false,
624
  'crop_h' => bp_core_avatar_full_height(),
625
  'crop_x' => 0,
626
  'crop_y' => 0
627
+ ) );
 
 
628
 
629
  /***
630
  * You may want to hook into this filter if you want to override this function.
635
 
636
  extract( $r, EXTR_SKIP );
637
 
638
+ if ( empty( $original_file ) )
639
  return false;
640
 
641
  $original_file = bp_core_avatar_upload_path() . $original_file;
643
  if ( !file_exists( $original_file ) )
644
  return false;
645
 
646
+ if ( empty( $item_id ) ) {
647
  $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
648
+ } else {
649
  $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
650
+ }
651
 
652
  if ( !file_exists( $avatar_folder_dir ) )
653
  return false;
659
  bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) );
660
 
661
  // Make sure we at least have a width and height for cropping
662
+ if ( empty( $crop_w ) ) {
663
  $crop_w = bp_core_avatar_full_width();
664
+ }
665
 
666
+ if ( empty( $crop_h ) ) {
667
  $crop_h = bp_core_avatar_full_height();
668
+ }
669
+
670
+ // Get the file extension
671
+ $data = @getimagesize( $original_file );
672
+ $ext = $data['mime'] == 'image/png' ? 'png' : 'jpg';
673
 
674
  // Set the full and thumb filenames
675
+ $full_filename = wp_hash( $original_file . time() ) . '-bpfull.' . $ext;
676
+ $thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.' . $ext;
677
 
678
  // Crop the image
679
+ $full_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
680
  $thumb_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
681
 
682
  // Check for errors
683
+ if ( empty( $full_cropped ) || empty( $thumb_cropped ) || is_wp_error( $full_cropped ) || is_wp_error( $thumb_cropped ) )
684
  return false;
685
 
686
  // Remove the original
711
  return $avatar;
712
 
713
  // If passed an object, assume $user->user_id
714
+ if ( is_object( $user ) ) {
715
  $id = $user->user_id;
716
 
717
  // If passed a number, assume it was a $user_id
718
+ } else if ( is_numeric( $user ) ) {
719
  $id = $user;
720
 
721
  // If passed a string and that string returns a user, get the $id
722
+ } elseif ( is_string( $user ) && ( $user_by_email = get_user_by( 'email', $user ) ) ) {
723
  $id = $user_by_email->ID;
724
+ }
725
 
726
  // If somehow $id hasn't been assigned, return the result of get_avatar
727
+ if ( empty( $id ) ) {
728
  return !empty( $avatar ) ? $avatar : $default;
729
+ }
730
 
731
+ // Image alt tag
732
+ if ( empty( $alt ) ) {
733
  $alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) );
734
+ }
735
 
736
  // Let BuddyPress handle the fetching of the avatar
737
  $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
791
  * @return string Absolute path to WP upload directory
792
  */
793
  function bp_core_avatar_upload_path() {
794
+ $bp = buddypress();
795
 
796
  // See if the value has already been calculated and stashed in the $bp global
797
  if ( isset( $bp->avatar->upload_path ) ) {
837
  * @return string Full URL to current upload location
838
  */
839
  function bp_core_avatar_url() {
840
+ $bp = buddypress();
841
 
842
  // See if the value has already been calculated and stashed in the $bp global
843
  if ( isset( $bp->avatar->url ) ) {
905
  * @return int $dim The dimension
906
  */
907
  function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
908
+ $bp = buddypress();
 
909
  $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;
910
 
911
  return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
968
  * @return int The width
969
  */
970
  function bp_core_avatar_original_max_width() {
971
+ return apply_filters( 'bp_core_avatar_original_max_width', (int) buddypress()->avatar->original_max_width );
 
 
972
  }
973
 
974
  /**
980
  * @return int The filesize
981
  */
982
  function bp_core_avatar_original_max_filesize() {
983
+ return apply_filters( 'bp_core_avatar_original_max_filesize', (int) buddypress()->avatar->original_max_filesize );
 
 
984
  }
985
 
986
  /**
992
  * @return int The URL of the default avatar
993
  */
994
  function bp_core_avatar_default() {
995
+ return apply_filters( 'bp_core_avatar_default', buddypress()->avatar->full->default );
 
 
996
  }
997
 
998
  /**
1004
  * @return int The URL of the default avatar thumb
1005
  */
1006
  function bp_core_avatar_default_thumb() {
1007
+ return apply_filters( 'bp_core_avatar_thumb', buddypress()->avatar->thumb->default );
 
 
1008
  }
 
 
 
bp-core/bp-core-buddybar.php CHANGED
@@ -373,8 +373,8 @@ function bp_nav_item_has_subnav( $nav_item = '' ) {
373
  * Removes a navigation item from the sub navigation array used in BuddyPress themes.
374
  *
375
  * @package BuddyPress Core
376
- * @param $parent_id The id of the parent navigation item.
377
- * @param $slug The slug of the sub navigation item.
378
  */
379
  function bp_core_remove_nav_item( $parent_id ) {
380
  global $bp;
@@ -386,6 +386,9 @@ function bp_core_remove_nav_item( $parent_id ) {
386
  }
387
  }
388
 
 
 
 
389
  if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) {
390
  if ( is_object( $function[0] ) ) {
391
  remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 );
@@ -480,7 +483,7 @@ function bp_adminbar_login_menu() {
480
 
481
  // Show "Sign Up" link if user registrations are allowed
482
  if ( bp_get_signup_allowed() )
483
- echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
484
  }
485
 
486
 
@@ -609,84 +612,25 @@ function bp_get_admin_bar_pref( $context, $user = 0 ) {
609
  return 'true' === $pref;
610
  }
611
 
612
- /**
613
- * Handle the Toolbar/BuddyBar business
614
- *
615
- * @since BuddyPress (1.2)
616
- *
617
- * @global string $wp_version
618
- * @uses bp_get_option()
619
- * @uses is_user_logged_in()
620
- * @uses bp_use_wp_admin_bar()
621
- * @uses show_admin_bar()
622
- * @uses add_action() To hook 'bp_adminbar_logo' to 'bp_adminbar_logo'
623
- * @uses add_action() To hook 'bp_adminbar_login_menu' to 'bp_adminbar_menus'
624
- * @uses add_action() To hook 'bp_adminbar_account_menu' to 'bp_adminbar_menus'
625
- * @uses add_action() To hook 'bp_adminbar_thisblog_menu' to 'bp_adminbar_menus'
626
- * @uses add_action() To hook 'bp_adminbar_random_menu' to 'bp_adminbar_menus'
627
- * @uses add_action() To hook 'bp_core_admin_bar' to 'wp_footer'
628
- * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer'
629
- */
630
- function bp_core_load_admin_bar() {
631
- global $wp_version;
632
-
633
- // Don't show if Toolbar is disabled for non-logged in users
634
- if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && ! is_user_logged_in() )
635
- return;
636
-
637
- // Show the WordPress Toolbar
638
- if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) {
639
-
640
- // Respect user's Toolbar display preferences
641
- if ( is_user_logged_in() && ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) ) )
642
- return;
643
-
644
- show_admin_bar( true );
645
-
646
- // Hide the WordPress Toolbar
647
- } elseif ( !bp_use_wp_admin_bar() ) {
648
- // Keep the WP Toolbar from loading
649
- show_admin_bar( false );
650
-
651
- // Actions used to build the BP Toolbar
652
- add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );
653
- add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
654
- add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
655
- add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );
656
- add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
657
-
658
- // Actions used to append BP Toolbar to footer
659
- add_action( 'wp_footer', 'bp_core_admin_bar', 8 );
660
- add_action( 'admin_footer', 'bp_core_admin_bar' );
661
- }
662
- }
663
-
664
  /**
665
  * Handle the BuddyBar CSS
666
  */
667
  function bp_core_load_buddybar_css() {
 
 
668
  if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )
669
  return;
670
 
 
 
671
  if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
672
  $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
673
- elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
674
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.dev.css';
675
  else
676
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.css';
677
 
678
- wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), bp_get_version() );
679
-
680
- if ( !is_rtl() )
681
- return;
682
-
683
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
684
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.dev.css';
685
- else
686
- $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.css';
687
-
688
- wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() );
689
  }
690
  add_action( 'bp_init', 'bp_core_load_buddybar_css' );
691
-
692
- ?>
373
  * Removes a navigation item from the sub navigation array used in BuddyPress themes.
374
  *
375
  * @package BuddyPress Core
376
+ * @param int $parent_id The id of the parent navigation item.
377
+ * @param bool|string false if the parent item doesn't exist or $slug the slug of the sub navigation item.
378
  */
379
  function bp_core_remove_nav_item( $parent_id ) {
380
  global $bp;
386
  }
387
  }
388
 
389
+ if ( empty( $bp->bp_nav[ $parent_id ] ) )
390
+ return false;
391
+
392
  if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) {
393
  if ( is_object( $function[0] ) ) {
394
  remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 );
483
 
484
  // Show "Sign Up" link if user registrations are allowed
485
  if ( bp_get_signup_allowed() )
486
+ echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
487
  }
488
 
489
 
612
  return 'true' === $pref;
613
  }
614
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  /**
616
  * Handle the BuddyBar CSS
617
  */
618
  function bp_core_load_buddybar_css() {
619
+ global $wp_styles;
620
+
621
  if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )
622
  return;
623
 
624
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
625
+
626
  if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
627
  $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
 
 
628
  else
629
+ $stylesheet = BP_PLUGIN_URL . "bp-core/css/buddybar{$min}.css";
630
 
631
+ wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );
632
+ $wp_styles->add_data( 'bp-admin-bar', 'rtl', true );
633
+ if ( $min )
634
+ $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min );
 
 
 
 
 
 
 
635
  }
636
  add_action( 'bp_init', 'bp_core_load_buddybar_css' );
 
 
bp-core/bp-core-cache.php CHANGED
@@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
16
  * @package BuddyPress Core
17
  */
18
  function bp_core_clear_cache() {
19
- global $cache_path, $cache_filename;
20
 
21
  if ( function_exists( 'prune_super_cache' ) ) {
22
  do_action( 'bp_core_clear_cache' );
@@ -61,7 +61,7 @@ add_action( 'deleted_user', 'bp_core_clear_member_count_caches
61
  /**
62
  * Update the metadata cache for the specified objects.
63
  *
64
- * @since 1.6
65
  * @global $wpdb WordPress database object for queries.
66
  * @param array $args See $defaults definition for more details
67
  * @return mixed Metadata cache for the specified objects, or false on failure.
@@ -103,7 +103,7 @@ function bp_update_meta_cache( $args = array() ) {
103
 
104
  // Get meta info
105
  $id_list = join( ',', $object_ids );
106
- $meta_list = $wpdb->get_results( "SELECT $object_column, meta_key, meta_value FROM $meta_table WHERE $object_column IN ($id_list)", ARRAY_A );
107
 
108
  if ( !empty( $meta_list ) ) {
109
  foreach ( $meta_list as $metarow ) {
@@ -133,5 +133,3 @@ function bp_update_meta_cache( $args = array() ) {
133
 
134
  return $cache;
135
  }
136
-
137
- ?>
16
  * @package BuddyPress Core
17
  */
18
  function bp_core_clear_cache() {
19
+ global $cache_path;
20
 
21
  if ( function_exists( 'prune_super_cache' ) ) {
22
  do_action( 'bp_core_clear_cache' );
61
  /**
62
  * Update the metadata cache for the specified objects.
63
  *
64
+ * @since BuddyPress (1.6)
65
  * @global $wpdb WordPress database object for queries.
66
  * @param array $args See $defaults definition for more details
67
  * @return mixed Metadata cache for the specified objects, or false on failure.
103
 
104
  // Get meta info
105
  $id_list = join( ',', $object_ids );
106
+ $meta_list = $wpdb->get_results( $wpdb->prepare( "SELECT {$object_column}, meta_key, meta_value FROM {$meta_table} WHERE {$object_column} IN ($id_list)", $object_type ), ARRAY_A );
107
 
108
  if ( !empty( $meta_list ) ) {
109
  foreach ( $meta_list as $metarow ) {
133
 
134
  return $cache;
135
  }
 
 
bp-core/bp-core-caps.php CHANGED
@@ -10,41 +10,6 @@
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
- /**
14
- * Adds BuddyPress-specific user roles.
15
- *
16
- * This is called on plugin activation.
17
- *
18
- * @since BuddyPress (1.6)
19
- *
20
- * @uses get_option() To get the default role
21
- * @uses get_role() To get the default role object
22
- * @uses add_role() To add our own roles
23
- * @uses do_action() Calls 'bp_add_roles'
24
- */
25
- function bp_add_roles() {
26
-
27
- // Get new role names
28
- $moderator_role = bp_get_moderator_role();
29
- $participant_role = bp_get_participant_role();
30
-
31
- // Add the Moderator role and add the default role caps.
32
- // Mod caps are added by the bp_add_caps() function
33
- $default = get_role( get_option( 'default_role' ) );
34
-
35
- // If role does not exist, default to read cap
36
- if ( empty( $default->capabilities ) )
37
- $default->capabilities = array( 'read' );
38
-
39
- // Moderators are default role + community moderating caps in bp_add_caps()
40
- add_role( $moderator_role, 'Community Moderator', $default->capabilities );
41
-
42
- // Forum Subscribers are auto added to sites with global communities
43
- add_role( $participant_role, 'Community Participant', $default->capabilities );
44
-
45
- do_action( 'bp_add_roles' );
46
- }
47
-
48
  /**
49
  * Adds capabilities to WordPress user roles.
50
  *
@@ -63,15 +28,10 @@ function bp_add_caps() {
63
  if ( ! isset( $wp_roles ) )
64
  $wp_roles = new WP_Roles();
65
 
66
- // Loop through available roles
67
- foreach( $wp_roles->roles as $role => $details ) {
68
-
69
- // Load this role
70
- $this_role = get_role( $role );
71
-
72
- // Loop through caps for this role and remove them
73
- foreach ( bp_get_caps_for_role( $role ) as $cap ) {
74
- $this_role->add_cap( $cap );
75
  }
76
  }
77
 
@@ -96,46 +56,16 @@ function bp_remove_caps() {
96
  if ( ! isset( $wp_roles ) )
97
  $wp_roles = new WP_Roles();
98
 
99
- // Loop through available roles
100
- foreach( $wp_roles->roles as $role => $details ) {
101
-
102
- // Load this role
103
- $this_role = get_role( $role );
104
-
105
- // Loop through caps for this role and remove them
106
- foreach ( bp_get_caps_for_role( $role ) as $cap ) {
107
- $this_role->remove_cap( $cap );
108
  }
109
  }
110
 
111
  do_action( 'bp_remove_caps' );
112
  }
113
 
114
- /**
115
- * Removes BuddyPress-specific user roles.
116
- *
117
- * This is called on plugin deactivation.
118
- *
119
- * @since BuddyPress (1.6)
120
- *
121
- * @uses remove_role() To remove our roles
122
- * @uses do_action() Calls 'bp_remove_roles'
123
- */
124
- function bp_remove_roles() {
125
-
126
- // Get new role names
127
- $moderator_role = bp_get_moderator_role();
128
- $participant_role = bp_get_participant_role();
129
-
130
- // Remove the Moderator role
131
- remove_role( $moderator_role );
132
-
133
- // Remove the Moderator role
134
- remove_role( $participant_role );
135
-
136
- do_action( 'bp_remove_roles' );
137
- }
138
-
139
  /**
140
  * Maps community caps to built in WordPress caps
141
  *
@@ -183,10 +113,6 @@ function bp_get_community_caps() {
183
  */
184
  function bp_get_caps_for_role( $role = '' ) {
185
 
186
- // Get new role names
187
- $moderator_role = bp_get_moderator_role();
188
- $participant_role = bp_get_participant_role();
189
-
190
  // Which role are we looking for?
191
  switch ( $role ) {
192
 
@@ -199,23 +125,10 @@ function bp_get_caps_for_role( $role = '' ) {
199
 
200
  break;
201
 
202
- // Moderator
203
- case $moderator_role :
204
- $caps = array(
205
- // Misc
206
- 'bp_moderate',
207
- );
208
-
209
- break;
210
-
211
- // WordPress Core Roles
212
  case 'editor' :
213
  case 'author' :
214
  case 'contributor' :
215
  case 'subscriber' :
216
-
217
- // BuddyPress Participant Role
218
- case $participant_role :
219
  default :
220
  $caps = array();
221
  break;
@@ -230,7 +143,7 @@ function bp_get_caps_for_role( $role = '' ) {
230
  *
231
  * @since BuddyPress (1.6)
232
  *
233
- * @global BuddyPress $bbp
234
  *
235
  * @uses is_multisite()
236
  * @uses bp_allow_global_access()
@@ -241,130 +154,22 @@ function bp_get_caps_for_role( $role = '' ) {
241
  *
242
  * @return If user is not spam/deleted or is already capable
243
  */
244
- function bp_global_access_auto_role() {
245
 
246
- // Bail if not multisite or community is not global
247
- if ( !is_multisite() || !bp_allow_global_access() )
248
  return;
249
 
250
- // Bail if user is not active
251
- if ( bp_is_user_inactive() )
252
- return;
253
-
254
- // Bail if user is not logged in
255
- if ( !is_user_logged_in() )
256
- return;
257
-
258
- // Give the user the 'Forum Participant' role
259
- if ( current_user_can( 'bp_masked' ) ) {
260
- global $bbp;
261
-
262
- // Get the default role
263
- $default_role = bp_get_participant_role();
264
-
265
- // Set the current users default role
266
- $bbp->current_user->set_role( $default_role );
267
- }
268
- }
269
-
270
- /**
271
- * The participant role for registered users without roles
272
- *
273
- * This is primarily for multisite compatibility when users without roles on
274
- * sites that have global communities enabled
275
- *
276
- * @since BuddyPress (1.6)
277
- *
278
- * @param string $role
279
- * @uses apply_filters()
280
- * @return string
281
- */
282
- function bp_get_participant_role() {
283
-
284
- // Hardcoded participant role
285
- $role = 'bp_participant';
286
-
287
- // Allow override
288
- return apply_filters( 'bp_get_participant_role', $role );
289
- }
290
-
291
- /**
292
- * The moderator role for BuddyPress users
293
- *
294
- * @since BuddyPress (1.6)
295
- *
296
- * @param string $role
297
- * @uses apply_filters()
298
- * @return string
299
- */
300
- function bp_get_moderator_role() {
301
-
302
- // Hardcoded moderated user role
303
- $role = 'bp_moderator';
304
-
305
- // Allow override
306
- return apply_filters( 'bp_get_moderator_role', $role );
307
- }
308
-
309
- /**
310
- * Add the default role and mapped BuddyPress caps to the current user if needed
311
- *
312
- * This function will bail if the community is not global in a multisite
313
- * installation of WordPress, or if the user is marked as spam or deleted.
314
- *
315
- * @since BuddyPress (1.6)
316
- *
317
- * @uses is_multisite()
318
- * @uses bp_allow_global_access()
319
- * @uses bp_is_user_inactive()
320
- * @uses is_user_logged_in()
321
- * @uses current_user_can()
322
- * @uses get_option()
323
- * @uses bp_get_caps_for_role()
324
- *
325
- * @global BuddyPress $bbp
326
- * @return If not multisite, not global, or user is deleted/spammed
327
- */
328
- function bp_global_access_role_mask() {
329
-
330
- // Bail if not multisite or community is not global
331
- if ( !is_multisite() || !bp_allow_global_access() )
332
  return;
333
 
334
- // Bail if user is marked as spam or is deleted
335
  if ( bp_is_user_inactive() )
336
  return;
337
 
338
- // Normal user is logged in but has no caps
339
- if ( is_user_logged_in() && !current_user_can( 'read' ) ) {
340
-
341
- // Define local variable
342
- $mapped_meta_caps = array();
343
-
344
- // Assign user the minimal participant role to map caps to
345
- $default_role = bp_get_participant_role();
346
-
347
- // Get BuddyPress caps for the default role
348
- $caps_for_role = bp_get_caps_for_role( $default_role );
349
-
350
- // Set all caps to true
351
- foreach ( $caps_for_role as $cap ) {
352
- $mapped_meta_caps[$cap] = true;
353
- }
354
-
355
- // Add 'read' cap just in case
356
- $mapped_meta_caps['read'] = true;
357
- $mapped_meta_caps['bp_masked'] = true;
358
-
359
- // Allow global access caps to be manipulated
360
- $mapped_meta_caps = apply_filters( 'bp_global_access_mapped_meta_caps', $mapped_meta_caps );
361
-
362
- // Assign the role and mapped caps to the current user
363
- global $bp;
364
- $bp->current_user->roles[0] = $default_role;
365
- $bp->current_user->caps = $mapped_meta_caps;
366
- $bp->current_user->allcaps = $mapped_meta_caps;
367
- }
368
  }
369
 
370
  /**
@@ -404,23 +209,82 @@ function bp_current_user_can( $capability, $blog_id = 0 ) {
404
  *
405
  * @since BuddyPress (1.6)
406
  * @see WP_User::has_cap()
 
407
  *
408
  * @param array $allcaps The caps that WP associates with the given role
409
  * @param array $caps The caps being tested for in WP_User::has_cap()
410
  * @param array $args Miscellaneous arguments passed to the user_has_cap filter
411
  * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant
412
  */
413
- function _bp_enforce_bp_moderate_cap_for_admins( $allcaps, $caps, $args ) {
414
- if ( in_array( 'bp_moderate', $caps ) && // We only care if checking for bp_moderate
415
- !in_array( 'do_not_allow', $caps ) && // 'do_not_allow' overrides everything else
416
- !is_multisite() && // Check not necessary on Multisite
417
- isset( $allcaps['delete_users'] ) ) // Mimicking WP's check for Administrator status
418
- {
419
- $allcaps['bp_moderate'] = true;
420
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
 
422
- return $allcaps;
 
 
 
 
 
 
 
 
 
 
 
 
423
  }
424
- add_filter( 'user_has_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 3 );
425
 
426
- ?>
 
 
 
 
 
 
 
 
 
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Adds capabilities to WordPress user roles.
15
  *
28
  if ( ! isset( $wp_roles ) )
29
  $wp_roles = new WP_Roles();
30
 
31
+ // Loop through available roles and add them
32
+ foreach( $wp_roles->role_objects as $role ) {
33
+ foreach ( bp_get_caps_for_role( $role->name ) as $cap ) {
34
+ $role->add_cap( $cap );
 
 
 
 
 
35
  }
36
  }
37
 
56
  if ( ! isset( $wp_roles ) )
57
  $wp_roles = new WP_Roles();
58
 
59
+ // Loop through available roles and remove them
60
+ foreach( $wp_roles->role_objects as $role ) {
61
+ foreach ( bp_get_caps_for_role( $role->name ) as $cap ) {
62
+ $role->remove_cap( $cap );
 
 
 
 
 
63
  }
64
  }
65
 
66
  do_action( 'bp_remove_caps' );
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * Maps community caps to built in WordPress caps
71
  *
113
  */
114
  function bp_get_caps_for_role( $role = '' ) {
115
 
 
 
 
 
116
  // Which role are we looking for?
117
  switch ( $role ) {
118
 
125
 
126
  break;
127
 
 
 
 
 
 
 
 
 
 
 
128
  case 'editor' :
129
  case 'author' :
130
  case 'contributor' :
131
  case 'subscriber' :
 
 
 
132
  default :
133
  $caps = array();
134
  break;
143
  *
144
  * @since BuddyPress (1.6)
145
  *
146
+ * @global BuddyPress $bp
147
  *
148
  * @uses is_multisite()
149
  * @uses bp_allow_global_access()
154
  *
155
  * @return If user is not spam/deleted or is already capable
156
  */
157
+ function bp_set_current_user_default_role() {
158
 
159
+ // Bail if not multisite or not root blog
160
+ if ( ! is_multisite() || ! bp_is_root_blog() )
161
  return;
162
 
163
+ // Bail if user is not logged in or already a member
164
+ if ( ! is_user_logged_in() || is_user_member_of_blog() )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  return;
166
 
167
+ // Bail if user is not active
168
  if ( bp_is_user_inactive() )
169
  return;
170
 
171
+ // Set the current users default role
172
+ buddypress()->current_user->set_role( bp_get_option( 'default_role', 'subscriber' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  }
174
 
175
  /**
209
  *
210
  * @since BuddyPress (1.6)
211
  * @see WP_User::has_cap()
212
+ * @access private
213
  *
214
  * @param array $allcaps The caps that WP associates with the given role
215
  * @param array $caps The caps being tested for in WP_User::has_cap()
216
  * @param array $args Miscellaneous arguments passed to the user_has_cap filter
217
  * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant
218
  */
219
+ function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
220
+
221
+ // Bail if not checking the 'bp_moderate' cap
222
+ if ( 'bp_moderate' !== $cap )
223
+ return $caps;
224
+
225
+ // Bail if BuddyPress is not network activated
226
+ if ( bp_is_network_activated() )
227
+ return $caps;
228
+
229
+ // Never trust inactive users
230
+ if ( bp_is_user_inactive( $user_id ) )
231
+ return $caps;
232
+
233
+ // Only users that can 'manage_options' on this site can 'bp_moderate'
234
+ return array( 'manage_options' );
235
+ }
236
+ add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 );
237
+
238
+ /** Deprecated ****************************************************************/
239
+
240
+ /**
241
+ * Adds BuddyPress-specific user roles.
242
+ *
243
+ * This is called on plugin activation.
244
+ *
245
+ * @since BuddyPress (1.6)
246
+ *
247
+ * @deprecated since version 1.7
248
+ */
249
+ function bp_add_roles() {
250
+ _doing_it_wrong( 'bp_add_roles', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' );
251
+ }
252
+
253
+ /**
254
+ * Removes BuddyPress-specific user roles.
255
+ *
256
+ * This is called on plugin deactivation.
257
+ *
258
+ * @since BuddyPress (1.6)
259
+ *
260
+ * @deprecated since version 1.7
261
+ */
262
+ function bp_remove_roles() {
263
+ _doing_it_wrong( 'bp_remove_roles', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' );
264
+ }
265
 
266
+
267
+ /**
268
+ * The participant role for registered users without roles
269
+ *
270
+ * This is primarily for multisite compatibility when users without roles on
271
+ * sites that have global communities enabled
272
+ *
273
+ * @since BuddyPress (1.6)
274
+ *
275
+ * @deprecated since version 1.7
276
+ */
277
+ function bp_get_participant_role() {
278
+ _doing_it_wrong( 'bp_get_participant_role', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' );
279
  }
 
280
 
281
+ /**
282
+ * The moderator role for BuddyPress users
283
+ *
284
+ * @since BuddyPress (1.6)
285
+ *
286
+ * @deprecated since version 1.7
287
+ */
288
+ function bp_get_moderator_role() {
289
+ _doing_it_wrong( 'bp_get_moderator_role', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' );
290
+ }
bp-core/bp-core-catchuri.php CHANGED
@@ -19,9 +19,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
19
  * add new re-write rules. Custom components are able to use their own custom
20
  * URI structures with very little work.
21
  *
22
- * @package BuddyPress Core
23
- * @since BuddyPress (1.0)
24
- *
25
  * The URI's are broken down as follows:
26
  * - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
27
  * - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
@@ -32,6 +29,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
32
  * - $bp->current_action: string 'edit'
33
  * - $bp->action_variables: array ['group', 5]
34
  *
 
 
35
  */
36
  function bp_core_set_uri_globals() {
37
  global $bp, $current_blog, $wp_rewrite;
@@ -333,8 +332,6 @@ function bp_core_enable_root_profiles() {
333
  }
334
 
335
  /**
336
- * bp_core_load_template()
337
- *
338
  * Load a specific template file with fallback support.
339
  *
340
  * Example:
@@ -372,13 +369,11 @@ function bp_core_load_template( $templates ) {
372
  $post = $wp_query->queried_object;
373
  }
374
 
375
- // Define local variables
376
- $located_template = false;
377
- $filtered_templates = array();
378
-
379
  // Fetch each template and add the php suffix
380
- foreach ( (array) $templates as $template )
 
381
  $filtered_templates[] = $template . '.php';
 
382
 
383
  // Filter the template locations so that plugins can alter where they are located
384
  $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates );
@@ -386,18 +381,34 @@ function bp_core_load_template( $templates ) {
386
 
387
  // Template was located, lets set this as a valid page and not a 404.
388
  status_header( 200 );
389
- $wp_query->is_page = $wp_query->is_singular = true;
390
- $wp_query->is_404 = false;
 
391
 
392
  do_action( 'bp_core_pre_load_template', $located_template );
393
 
394
  load_template( apply_filters( 'bp_load_template', $located_template ) );
395
 
396
  do_action( 'bp_core_post_load_template', $located_template );
397
- }
398
 
399
- // Kill any other output after this.
400
- die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  }
402
 
403
  /**
@@ -449,7 +460,7 @@ function bp_core_no_access( $args = '' ) {
449
  $redirect_url .= $_SERVER['REQUEST_URI'];
450
 
451
  $defaults = array(
452
- 'mode' => '1', // 1 = $root, 2 = wp-login.php
453
  'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in
454
  'root' => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access
455
  'message' => __( 'You must log in to access the page you requested.', 'buddypress' )
@@ -462,11 +473,11 @@ function bp_core_no_access( $args = '' ) {
462
  /**
463
  * @ignore Ignore these filters and use 'bp_core_no_access' above
464
  */
465
- $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message );
466
- $redirect = apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode );
467
- $root = apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode );
468
- $message = apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode );
469
- $root = trailingslashit( $root );
470
 
471
  switch ( $mode ) {
472
 
@@ -526,7 +537,7 @@ add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' );
526
  * general possible versions of the URL - eg, example.com/groups/mygroup/ instead of
527
  * example.com/groups/mygroup/home/
528
  *
529
- * @since 1.6
530
  * @see BP_Members_Component::setup_globals() where $bp->canonical_stack['base_url'] and
531
  * ['component'] may be set
532
  * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set
@@ -579,7 +590,7 @@ function bp_redirect_canonical() {
579
  /**
580
  * Output rel=canonical header tag for BuddyPress content
581
  *
582
- * @since 1.6
583
  */
584
  function bp_rel_canonical() {
585
  $canonical_url = bp_get_canonical_url();
@@ -663,7 +674,7 @@ function bp_get_requested_url() {
663
  $bp->canonical_stack['requested_url'] .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
664
  }
665
 
666
- return $bp->canonical_stack['requested_url'];
667
  }
668
 
669
  /**
@@ -705,7 +716,7 @@ add_action( 'bp_init', '_bp_maybe_remove_redirect_canonical' );
705
  * This function will be removed in a later version of BuddyPress. Plugins
706
  * (and plugin authors!) should ignore it.
707
  *
708
- * @since 1.6.1
709
  *
710
  * @link http://buddypress.trac.wordpress.org/ticket/4329
711
  * @link http://buddypress.trac.wordpress.org/ticket/4415
@@ -725,7 +736,7 @@ add_action( 'template_redirect', '_bp_rehook_maybe_redirect_404', 1 );
725
  * This function should be considered temporary, and may be removed without
726
  * notice in future versions of BuddyPress.
727
  *
728
- * @since 1.6
729
  */
730
  function _bp_maybe_remove_rel_canonical() {
731
  if ( ! bp_is_blog_page() && ! is_404() ) {
@@ -734,4 +745,3 @@ function _bp_maybe_remove_rel_canonical() {
734
  }
735
  }
736
  add_action( 'wp_head', '_bp_maybe_remove_rel_canonical', 8 );
737
- ?>
19
  * add new re-write rules. Custom components are able to use their own custom
20
  * URI structures with very little work.
21
  *
 
 
 
22
  * The URI's are broken down as follows:
23
  * - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
24
  * - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
29
  * - $bp->current_action: string 'edit'
30
  * - $bp->action_variables: array ['group', 5]
31
  *
32
+ * @package BuddyPress Core
33
+ * @since BuddyPress (1.0)
34
  */
35
  function bp_core_set_uri_globals() {
36
  global $bp, $current_blog, $wp_rewrite;
332
  }
333
 
334
  /**
 
 
335
  * Load a specific template file with fallback support.
336
  *
337
  * Example:
369
  $post = $wp_query->queried_object;
370
  }
371
 
 
 
 
 
372
  // Fetch each template and add the php suffix
373
+ $filtered_templates = array();
374
+ foreach ( (array) $templates as $template ) {
375
  $filtered_templates[] = $template . '.php';
376
+ }
377
 
378
  // Filter the template locations so that plugins can alter where they are located
379
  $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates );
381
 
382
  // Template was located, lets set this as a valid page and not a 404.
383
  status_header( 200 );
384
+ $wp_query->is_page = true;
385
+ $wp_query->is_singular = true;
386
+ $wp_query->is_404 = false;
387
 
388
  do_action( 'bp_core_pre_load_template', $located_template );
389
 
390
  load_template( apply_filters( 'bp_load_template', $located_template ) );
391
 
392
  do_action( 'bp_core_post_load_template', $located_template );
 
393
 
394
+ // Kill any other output after this.
395
+ exit();
396
+
397
+ // No template found, so setup theme compatability
398
+ // @todo Some other 404 handling if theme compat doesn't kick in
399
+ } else {
400
+
401
+ // We know where we are, so reset important $wp_query bits here early.
402
+ // The rest will be done by bp_theme_compat_reset_post() later.
403
+ if ( is_buddypress() ) {
404
+ status_header( 200 );
405
+ $wp_query->is_page = true;
406
+ $wp_query->is_singular = true;
407
+ $wp_query->is_404 = false;
408
+ }
409
+
410
+ do_action( 'bp_setup_theme_compat' );
411
+ }
412
  }
413
 
414
  /**
460
  $redirect_url .= $_SERVER['REQUEST_URI'];
461
 
462
  $defaults = array(
463
+ 'mode' => 2, // 1 = $root, 2 = wp-login.php
464
  'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in
465
  'root' => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access
466
  'message' => __( 'You must log in to access the page you requested.', 'buddypress' )
473
  /**
474
  * @ignore Ignore these filters and use 'bp_core_no_access' above
475
  */
476
+ $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message );
477
+ $redirect = apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode );
478
+ $root = apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode );
479
+ $message = apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode );
480
+ $root = trailingslashit( $root );
481
 
482
  switch ( $mode ) {
483
 
537
  * general possible versions of the URL - eg, example.com/groups/mygroup/ instead of
538
  * example.com/groups/mygroup/home/
539
  *
540
+ * @since BuddyPress (1.6)
541
  * @see BP_Members_Component::setup_globals() where $bp->canonical_stack['base_url'] and
542
  * ['component'] may be set
543
  * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set
590
  /**
591
  * Output rel=canonical header tag for BuddyPress content
592
  *
593
+ * @since BuddyPress (1.6)
594
  */
595
  function bp_rel_canonical() {
596
  $canonical_url = bp_get_canonical_url();
674
  $bp->canonical_stack['requested_url'] .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
675
  }
676
 
677
+ return apply_filters( 'bp_get_requested_url', $bp->canonical_stack['requested_url'] );
678
  }
679
 
680
  /**
716
  * This function will be removed in a later version of BuddyPress. Plugins
717
  * (and plugin authors!) should ignore it.
718
  *
719
+ * @since BuddyPress (1.6.1)
720
  *
721
  * @link http://buddypress.trac.wordpress.org/ticket/4329
722
  * @link http://buddypress.trac.wordpress.org/ticket/4415
736
  * This function should be considered temporary, and may be removed without
737
  * notice in future versions of BuddyPress.
738
  *
739
+ * @since BuddyPress (1.6)
740
  */
741
  function _bp_maybe_remove_rel_canonical() {
742
  if ( ! bp_is_blog_page() && ! is_404() ) {
745
  }
746
  }
747
  add_action( 'wp_head', '_bp_maybe_remove_rel_canonical', 8 );
 
bp-core/bp-core-classes.php CHANGED
@@ -1,7 +1,548 @@
1
  <?php
 
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  /**
6
  * BP_Core_User class can be used by any component. It will fetch useful
7
  * details for any user when provided with a user_id.
@@ -201,6 +742,8 @@ class BP_Core_User {
201
  function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
202
  global $wpdb, $bp;
203
 
 
 
204
  $sql = array();
205
 
206
  $sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
@@ -415,8 +958,8 @@ class BP_Core_User {
415
 
416
  $exclude_sql = ( !empty( $exclude ) ) ? " AND u.ID NOT IN ({$exclude})" : "";
417
 
418
- $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ), $letter );
419
- $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ), $letter, $pag_sql );
420
 
421
  $total_users = $wpdb->get_var( $total_users_sql );
422
  $paged_users = $wpdb->get_results( $paged_users_sql );
@@ -460,12 +1003,10 @@ class BP_Core_User {
460
  if ( $limit && $page )
461
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
462
 
463
- // @todo remove? $user_sql is not used here
464
- $user_sql = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";
465
  $status_sql = bp_core_get_status_sql();
466
 
467
- $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) ", $wpdb->escape( $user_ids ) );
468
- $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}", $wpdb->escape( $user_ids ) );
469
 
470
  $total_users = $wpdb->get_var( $total_users_sql );
471
  $paged_users = $wpdb->get_results( $paged_users_sql );
@@ -782,7 +1323,7 @@ class BP_Core_Notification {
782
  function get_all_for_user( $user_id, $status = 'is_new' ) {
783
  global $bp, $wpdb;
784
 
785
- $is_new = 'is_new' == $status ? ' AND is_new = 1 ' : '';
786
 
787
  return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) );
788
  }
@@ -872,42 +1413,57 @@ class BP_Core_Notification {
872
  *
873
  * API to create BuddyPress buttons
874
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
875
  * @package BuddyPress Core
876
- * @since 1.2.6
877
  */
878
  class BP_Button {
879
- // Button properties
 
880
 
881
  /**
882
  * The button ID
883
  *
884
  * @var integer
885
  */
886
- var $id;
887
 
888
  /**
889
  * The component name that button belongs to.
890
  *
891
  * @var string
892
  */
893
- var $component;
894
 
895
  /**
896
  * Does the user need to be logged in to see this button?
897
  *
898
  * @var boolean
899
  */
900
- var $must_be_logged_in;
901
 
902
  /**
903
- * True or false if the button should not be displayed while viewing your own profile.
 
904
  *
905
  * @var boolean
906
  */
907
- var $block_self;
908
 
909
-
910
- // Wrapper
911
 
912
  /**
913
  * What type of DOM element to use for a wrapper.
@@ -915,134 +1471,101 @@ class BP_Button {
915
  *
916
  * @var mixed div|span|p|li, or false for no wrapper
917
  */
918
- var $wrapper;
919
 
920
  /**
921
  * The DOM class of the button wrapper
922
  *
923
  * @var string
924
  */
925
- var $wrapper_class;
926
 
927
  /**
928
  * The DOM ID of the button wrapper
929
  *
930
  * @var string
931
  */
932
- var $wrapper_id;
933
-
934
 
935
- // Button
936
 
937
  /**
938
  * The destination link of the button
939
  *
940
  * @var string
941
  */
942
- var $link_href;
943
 
944
  /**
945
  * The DOM class of the button link
946
  *
947
  * @var string
948
  */
949
- var $link_class;
950
 
951
  /**
952
  * The DOM ID of the button link
953
  *
954
  * @var string
955
  */
956
- var $link_id;
957
 
958
  /**
959
  * The DOM rel value of the button link
960
  *
961
  * @var string
962
  */
963
- var $link_rel;
964
 
965
  /**
966
  * Title of the button link
967
  *
968
  * @var string
969
  */
970
- var $link_title;
971
 
972
  /**
973
  * The contents of the button link
974
  *
975
  * @var string
976
  */
977
- var $link_text;
978
 
 
979
 
980
- // HTML result
981
 
982
- var $contents;
983
 
984
  /**
985
- * bp_button()
986
  *
987
- * Builds the button based on passed parameters:
988
- *
989
- * component: Which component this button is for
990
- * must_be_logged_in: Button only appears for logged in users
991
- * block_self: Button will not appear when viewing your own profile.
992
- * wrapper: div|span|p|li|false for no wrapper
993
- * wrapper_id: The DOM ID of the button wrapper
994
- * wrapper_class: The DOM class of the button wrapper
995
- * link_href: The destination link of the button
996
- * link_title: Title of the button
997
- * link_id: The DOM ID of the button
998
- * link_class: The DOM class of the button
999
- * link_rel: The DOM rel of the button
1000
- * link_text: The contents of the button
1001
  *
1002
  * @param array $args
1003
  * @return bool False if not allowed
1004
  */
1005
- function __construct( $args = '' ) {
1006
-
1007
- // Default arguments
1008
- $defaults = array(
1009
- 'id' => '',
1010
- 'component' => 'core',
1011
- 'must_be_logged_in' => true,
1012
- 'block_self' => true,
1013
-
1014
- 'wrapper' => 'div',
1015
- 'wrapper_id' => '',
1016
- 'wrapper_class' => '',
1017
-
1018
- 'link_href' => '',
1019
- 'link_title' => '',
1020
- 'link_id' => '',
1021
- 'link_class' => '',
1022
- 'link_rel' => '',
1023
- 'link_text' => '',
1024
- );
1025
 
1026
- $r = wp_parse_args( $args, $defaults );
1027
- extract( $r, EXTR_SKIP );
1028
 
1029
  // Required button properties
1030
- $this->id = $id;
1031
- $this->component = $component;
1032
- $this->must_be_logged_in = (bool)$must_be_logged_in;
1033
- $this->block_self = (bool)$block_self;
1034
- $this->wrapper = $wrapper;
1035
 
1036
  // $id and $component are required
1037
- if ( empty( $id ) || empty( $component ) )
1038
  return false;
1039
 
1040
  // No button if component is not active
1041
- if ( !bp_is_active( $this->component ) )
1042
  return false;
1043
 
1044
  // No button for guests if must be logged in
1045
- if ( true == $this->must_be_logged_in && !is_user_logged_in() )
1046
  return false;
1047
 
1048
  // No button if viewing your own profile
@@ -1053,20 +1576,20 @@ class BP_Button {
1053
  if ( false !== $this->wrapper ) {
1054
 
1055
  // Wrapper ID
1056
- if ( !empty( $wrapper_id ) ) {
1057
- $this->wrapper_id = ' id="' . $wrapper_id . '"';
1058
  }
1059
 
1060
  // Wrapper class
1061
- if ( !empty( $wrapper_class ) ) {
1062
- $this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"';
1063
  } else {
1064
  $this->wrapper_class = ' class="generic-button"';
1065
  }
1066
 
1067
  // Set before and after
1068
- $before = '<' . $wrapper . $this->wrapper_class . $this->wrapper_id . '>';
1069
- $after = '</' . $wrapper . '>';
1070
 
1071
  // No wrapper
1072
  } else {
@@ -1074,48 +1597,37 @@ class BP_Button {
1074
  }
1075
 
1076
  // Link properties
1077
- if ( !empty( $link_id ) )
1078
- $this->link_id = ' id="' . $link_id . '"';
1079
-
1080
- if ( !empty( $link_href ) )
1081
- $this->link_href = ' href="' . $link_href . '"';
1082
-
1083
- if ( !empty( $link_title ) )
1084
- $this->link_title = ' title="' . $link_title . '"';
1085
-
1086
- if ( !empty( $link_rel ) )
1087
- $this->link_rel = ' rel="' . $link_rel . '"';
1088
-
1089
- if ( !empty( $link_class ) )
1090
- $this->link_class = ' class="' . $link_class . '"';
1091
-
1092
- if ( !empty( $link_text ) )
1093
- $this->link_text = $link_text;
1094
 
1095
  // Build the button
1096
  $this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after;
1097
 
1098
  // Allow button to be manipulated externally
1099
- $this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this, $before, $after );
1100
  }
1101
 
1102
  /**
1103
- * contents()
1104
- *
1105
  * Return contents of button
1106
  *
 
 
1107
  * @return string
1108
  */
1109
- function contents() {
1110
  return $this->contents;
1111
  }
1112
 
1113
  /**
1114
- * display()
1115
- *
1116
  * Output contents of button
 
 
1117
  */
1118
- function display() {
1119
  if ( !empty( $this->contents ) )
1120
  echo $this->contents;
1121
  }
@@ -1285,4 +1797,154 @@ class BP_Embed extends WP_Embed {
1285
  }
1286
  }
1287
 
1288
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  // Exit if accessed directly
4
  if ( !defined( 'ABSPATH' ) ) exit;
5
 
6
+ /**
7
+ * BuddyPress User Query class
8
+ *
9
+ * Used for querying users in a BuddyPress context, in situations where
10
+ * WP_User_Query won't do the trick: Member directories, the Friends component,
11
+ * etc.
12
+ *
13
+ * Accepted parameters:
14
+ * type - Determines sort order. Select from 'newest', 'active',
15
+ * 'online', 'random', 'popular', 'alphabetical'
16
+ * per_page - Number of results to return
17
+ * page - Page offset (together with per_page)
18
+ * user_id - Pass a single numeric user id to limit results to
19
+ * friends of that user. Requires the Friends component
20
+ * search_terms - Terms to search by. Search happens across xprofile
21
+ * fields. Requires XProfile component
22
+ * include - An array or comma-separated list of user ids. Results
23
+ * will be limited to users in this list
24
+ * exclude - An array or comma-separated list of user ids. Results
25
+ * will not include any users in this list
26
+ * user_ids - An array or comma-separated list of user ids. When
27
+ * this parameter is passed, it will override all other
28
+ * parameters; BP User objects will be constructed using
29
+ * these IDs only
30
+ * meta_key - Limit results to users that have usermeta associated
31
+ * with this meta_key. Usually used with meta_value
32
+ * meta_value - When used with meta_key, limits results to users whose
33
+ * usermeta value associated with meta_key matches
34
+ * meta_value
35
+ * populate_extras - Boolean. True if you want to fetch extra metadata about
36
+ * returned users, such as total group and friend counts
37
+ * count_total - Determines how BP_User_Query will do a count of total
38
+ * users matching the other filter criteria. Default value
39
+ * is 'count_query', which does a separate SELECT COUNT
40
+ * query to determine the total. 'sql_count_found_rows'
41
+ * uses SQL_COUNT_FOUND_ROWS and SELECT FOUND_ROWS(). Pass
42
+ * an empty string to skip the total user count query.
43
+ *
44
+ * @since BuddyPress (1.7)
45
+ */
46
+ class BP_User_Query {
47
+
48
+ /** Variables *************************************************************/
49
+
50
+ /**
51
+ * Array of variables to query with
52
+ *
53
+ * @since BuddyPress (1.7)
54
+ * @var array
55
+ */
56
+ public $query_vars = array();
57
+
58
+ /**
59
+ * List of found users and their respective data
60
+ *
61
+ * @since BuddyPress (1.7)
62
+ * @access public To allow components to manipulate them
63
+ * @var array
64
+ */
65
+ public $results = array();
66
+
67
+ /**
68
+ * Total number of found users for the current query
69
+ *
70
+ * @since BuddyPress (1.7)
71
+ * @access public To allow components to manipulate it
72
+ * @var int
73
+ */
74
+ public $total_users = 0;
75
+
76
+ /**
77
+ * List of found user ID's
78
+ *
79
+ * @since BuddyPress (1.7)
80
+ * @access public To allow components to manipulate it
81
+ * @var array
82
+ */
83
+ public $user_ids = array();
84
+
85
+ /**
86
+ * SQL clauses for the user ID query
87
+ *
88
+ * @since BuddyPress (1.7)
89
+ * @access public To allow components to manipulate it
90
+ * @var array()
91
+ */
92
+ public $uid_clauses = array();
93
+
94
+ /**
95
+ * SQL database column name to order by
96
+ *
97
+ * @since BuddyPress (1.7)
98
+ * @var string
99
+ */
100
+ public $uid_name = '';
101
+
102
+ /**
103
+ * Standard response when the query should not return any rows.
104
+ *
105
+ * @since BuddyPress (1.7)
106
+ * @access protected
107
+ * @var string
108
+ */
109
+ protected $no_results = array( 'join' => '', 'where' => '0 = 1' );
110
+
111
+
112
+ /** Methods ***************************************************************/
113
+
114
+ /**
115
+ * Constructor
116
+ *
117
+ * @since BuddyPress (1.7)
118
+ *
119
+ * @param string|array $query The query variables
120
+ */
121
+ public function __construct( $query = null ) {
122
+ if ( ! empty( $query ) ) {
123
+ $this->query_vars = wp_parse_args( $query, array(
124
+ 'type' => 'newest',
125
+ 'per_page' => 0,
126
+ 'page' => 1,
127
+ 'user_id' => 0,
128
+ 'search_terms' => false,
129
+ 'include' => false,
130
+ 'exclude' => false,
131
+ 'user_ids' => false,
132
+ 'meta_key' => false,
133
+ 'meta_value' => false,
134
+ 'populate_extras' => true,
135
+ 'count_total' => 'count_query'
136
+ ) );
137
+
138
+ // Plugins can use this filter to modify query args
139
+ // before the query is constructed
140
+ do_action_ref_array( 'bp_pre_user_query_construct', array( &$this ) );
141
+
142
+ // Get user ids
143
+ // If the user_ids param is present, we skip the query
144
+ if ( false !== $this->query_vars['user_ids'] ) {
145
+ $this->user_ids = wp_parse_id_list( $this->query_vars['user_ids'] );
146
+ } else {
147
+ $this->prepare_user_ids_query();
148
+ $this->do_user_ids_query();
149
+ }
150
+ }
151
+
152
+ // Bail if no user IDs were found
153
+ if ( empty( $this->user_ids ) ) {
154
+ return;
155
+ }
156
+
157
+ // Fetch additional data. First, using WP_User_Query
158
+ $this->do_wp_user_query();
159
+
160
+ // Get BuddyPress specific user data
161
+ $this->populate_extras();
162
+ }
163
+
164
+ /**
165
+ * Prepare the query for user_ids
166
+ *
167
+ * @since BuddyPress (1.7)
168
+ */
169
+ public function prepare_user_ids_query() {
170
+ global $wpdb, $bp;
171
+
172
+ // Default query variables used here
173
+ $type = '';
174
+ $per_page = 0;
175
+ $page = 1;
176
+ $user_id = 0;
177
+ $include = false;
178
+ $search_terms = false;
179
+ $exclude = false;
180
+ $meta_key = false;
181
+ $meta_value = false;
182
+
183
+ extract( $this->query_vars );
184
+
185
+ // Setup the main SQL query container
186
+ $sql = array(
187
+ 'select' => '',
188
+ 'where' => array(),
189
+ 'orderby' => '',
190
+ 'order' => '',
191
+ 'limit' => ''
192
+ );
193
+
194
+ /** TYPE **************************************************************/
195
+
196
+ // Determines the sort order, which means it also determines where the
197
+ // user IDs are drawn from (the SELECT and WHERE statements)
198
+ switch ( $type ) {
199
+
200
+ // 'online' query happens against the last_activity usermeta key
201
+ case 'online' :
202
+ $this->uid_name = 'user_id';
203
+ $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u";
204
+ $sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) );
205
+ $sql['where'][] = 'u.meta_value >= DATE_SUB( UTC_TIMESTAMP(), INTERVAL 5 MINUTE )';
206
+ $sql['orderby'] = "ORDER BY u.meta_value";
207
+ $sql['order'] = "DESC";
208
+
209
+ break;
210
+
211
+ // 'active', 'newest', and 'random' queries
212
+ // all happen against the last_activity usermeta key
213
+ case 'active' :
214
+ case 'newest' :
215
+ case 'random' :
216
+ $this->uid_name = 'user_id';
217
+ $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u";
218
+ $sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) );
219
+
220
+ if ( 'newest' == $type ) {
221
+ $sql['orderby'] = "ORDER BY u.user_id";
222
+ $sql['order'] = "DESC";
223
+ } else if ( 'random' == $type ) {
224
+ $sql['orderby'] = "ORDER BY rand()";
225
+ } else {
226
+ $sql['orderby'] = "ORDER BY u.meta_value";
227
+ $sql['order'] = "DESC";
228
+ }
229
+
230
+ break;
231
+
232
+ // 'popular' sorts by the 'total_friend_count' usermeta
233
+ case 'popular' :
234
+ $this->uid_name = 'user_id';
235
+ $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u";
236
+ $sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
237
+ $sql['orderby'] = "ORDER BY u.meta_value";
238
+ $sql['order'] = "DESC";
239
+
240
+ break;
241
+
242
+ // 'alphabetical' sorts depend on the xprofile setup
243
+ case 'alphabetical' :
244
+
245
+ // We prefer to do alphabetical sorts against the display_name field
246
+ // of wp_users, because the table is smaller and better indexed. We
247
+ // can do so if xprofile sync is enabled, or if xprofile is inactive.
248
+ //
249
+ // @todo remove need for bp_is_active() check
250
+ if ( ! bp_disable_profile_sync() || ! bp_is_active( 'xprofile' ) ) {
251
+ $this->uid_name = 'ID';
252
+ $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->users} u";
253
+ $sql['orderby'] = "ORDER BY u.display_name";
254
+ $sql['order'] = "ASC";
255
+
256
+ // When profile sync is disabled, alphabetical sorts must happen against
257
+ // the xprofile table
258
+ } else {
259
+ $fullname_field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) );
260
+
261
+ $this->uid_name = 'user_id';
262
+ $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$bp->profile->table_name_data} u";
263
+ $sql['where'][] = "u.field_id = {$fullname_field_id}";
264
+ $sql['orderby'] = "ORDER BY u.value";
265
+ $sql['order'] = "ASC";
266
+ }
267
+
268
+ break;
269
+
270
+ // Any other 'type' falls through
271
+ default :
272
+ $this->uid_name = 'ID';
273
+ $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->users} u";
274
+
275
+ // In this case, we assume that a plugin is
276
+ // handling order, so we leave those clauses
277
+ // blank
278
+
279
+ break;
280
+ }
281
+
282
+ /** WHERE *************************************************************/
283
+
284
+ // 'include' - User ids to include in the results
285
+ if ( false !== $include ) {
286
+ $include = wp_parse_id_list( $include );
287
+ $include_ids = $wpdb->escape( implode( ',', (array) $include ) );
288
+ $sql['where'][] = "u.{$this->uid_name} IN ({$include_ids})";
289
+ }
290
+
291
+ // 'exclude' - User ids to exclude from the results
292
+ if ( false !== $exclude ) {
293
+ $exclude = wp_parse_id_list( $exclude );
294
+ $exclude_ids = $wpdb->escape( implode( ',', (array) $exclude ) );
295
+ $sql['where'][] = "u.{$this->uid_name} NOT IN ({$exclude_ids})";
296
+ }
297
+
298
+ // 'user_id' - When a user id is passed, limit to the friends of the user
299
+ // Only parse this if no 'include' param is passed, to account for
300
+ // friend request queries
301
+ // @todo remove need for bp_is_active() check
302
+ if ( empty( $include ) && ! empty( $user_id ) && bp_is_active( 'friends' ) ) {
303
+ $friend_ids = friends_get_friend_user_ids( $user_id );
304
+ $friend_ids = $wpdb->escape( implode( ',', (array) $friend_ids ) );
305
+
306
+ if ( ! empty( $friend_ids ) ) {
307
+ $sql['where'][] = "u.{$this->uid_name} IN ({$friend_ids})";
308
+
309
+ // If the user has no friends, and we're not including specific users, make sure the query returns null
310
+ } elseif ( empty( $include ) ) {
311
+ $sql['where'][] = $this->no_results['where'];
312
+ }
313
+ }
314
+
315
+ /** Search Terms ******************************************************/
316
+
317
+ // 'search_terms' searches the xprofile fields
318
+ // To avoid global joins, do a separate query
319
+ // @todo remove need for bp_is_active() check
320
+ if ( false !== $search_terms && bp_is_active( 'xprofile' ) ) {
321
+ $found_user_ids = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s", '%%' . like_escape( $search_terms ) . '%%' ) );
322
+
323
+ if ( ! empty( $found_user_ids ) ) {
324
+ $sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")";
325
+ } else {
326
+ $sql['where'][] = $this->no_results['where'];
327
+ }
328
+ }
329
+
330
+ // 'meta_key', 'meta_value' allow usermeta search
331
+ // To avoid global joins, do a separate query
332
+ if ( false !== $meta_key ) {
333
+ $meta_sql = $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = %s", $meta_key );
334
+
335
+ if ( false !== $meta_value ) {
336
+ $meta_sql .= $wpdb->prepare( " AND meta_value = %s", $meta_value );
337
+ }
338
+
339
+ $found_user_ids = $wpdb->get_col( $meta_sql );
340
+
341
+ if ( ! empty( $found_user_ids ) ) {
342
+ $sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")";
343
+ }
344
+ }
345
+
346
+ // 'per_page', 'page' - handles LIMIT
347
+ if ( !empty( $per_page ) && !empty( $page ) ) {
348
+ $sql['limit'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
349
+ } else {
350
+ $sql['limit'] = '';
351
+ }
352
+
353
+ // Assemble the query chunks
354
+ $this->uid_clauses['select'] = $sql['select'];
355
+ $this->uid_clauses['where'] = ! empty( $sql['where'] ) ? 'WHERE ' . implode( ' AND ', $sql['where'] ) : '';
356
+ $this->uid_clauses['orderby'] = $sql['orderby'];
357
+ $this->uid_clauses['order'] = $sql['order'];
358
+ $this->uid_clauses['limit'] = $sql['limit'];
359
+
360
+ do_action_ref_array( 'bp_pre_user_query', array( &$this ) );
361
+ }
362
+
363
+ /**
364
+ * Perform a database query to specifically get only user IDs, using
365
+ * existing query variables set previously in the constructor.
366
+ *
367
+ * Also used to quickly perform user total counts.
368
+ *
369
+ * @since BuddyPress (1.7)
370
+ */
371
+ public function do_user_ids_query() {
372
+ global $wpdb;
373
+
374
+ // If counting using SQL_CALC_FOUND_ROWS, set it up here
375
+ if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) {
376
+ $this->uid_clauses['select'] = str_replace( 'SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $this->uid_clauses['select'] );
377
+ }
378
+
379
+ // Get the specific user ids
380
+ $this->user_ids = $wpdb->get_col( "{$this->uid_clauses['select']} {$this->uid_clauses['where']} {$this->uid_clauses['orderby']} {$this->uid_clauses['order']} {$this->uid_clauses['limit']}" );
381
+
382
+ // Get the total user count
383
+ if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) {
384
+ $this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "SELECT FOUND_ROWS()", $this ) );
385
+ } elseif ( 'count_query' == $this->query_vars['count_total'] ) {
386
+ $count_select = preg_replace( '/^SELECT.*?FROM (\S+) u/', "SELECT COUNT(DISTINCT u.{$this->uid_name}) FROM $1 u", $this->uid_clauses['select'] );
387
+ $this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "{$count_select} {$this->uid_clauses['where']}", $this ) );
388
+ }
389
+ }
390
+
391
+ /**
392
+ * Perform a database query using the WP_User_Query() object, using existing
393
+ * fields, variables, and user ID's set previously in this class.
394
+ *
395
+ * @since BuddyPress (1.7)
396
+ */
397
+ public function do_wp_user_query() {
398
+ $wp_user_query = new WP_User_Query( apply_filters( 'bp_wp_user_query_args', array(
399
+
400
+ // Relevant
401
+ 'fields' => array( 'ID', 'user_registered', 'user_login', 'user_nicename', 'display_name', 'user_email' ),
402
+ 'include' => $this->user_ids,
403
+
404
+ // Overrides
405
+ 'blog_id' => 0, // BP does not require blog roles
406
+ 'count_total' => false // We already have a count
407
+
408
+ ), $this ) );
409
+
410
+ // Reindex for easier matching
411
+ $r = array();
412
+ foreach ( $wp_user_query->results as $u ) {
413
+ $r[ $u->ID ] = $u;
414
+ }
415
+
416
+ // Match up to the user ids from the main query
417
+ foreach ( $this->user_ids as $uid ) {
418
+ if ( isset( $r[ $uid ] ) ) {
419
+ $this->results[ $uid ] = $r[ $uid ];
420
+
421
+ // The BP template functions expect an 'id'
422
+ // (as opposed to 'ID') property
423
+ $this->results[ $uid ]->id = $uid;
424
+ }
425
+ }
426
+ }
427
+
428
+ /**
429
+ * Perform a database query to populate any extra metadata we might need.
430
+ * Different components will hook into the 'bp_user_query_populate_extras'
431
+ * action to loop in the things they want.
432
+ *
433
+ * @since BuddyPress (1.7)
434
+ *
435
+ * @global BuddyPress $bp
436
+ * @global WPDB $wpdb
437
+ * @return
438
+ */
439
+ public function populate_extras() {
440
+ global $wpdb;
441
+
442
+ // Bail if no users
443
+ if ( empty( $this->user_ids ) || empty( $this->results ) ) {
444
+ return;
445
+ }
446
+
447
+ // Bail if the populate_extras flag is set to false
448
+ // In the case of the 'popular' sort type, we force
449
+ // populate_extras to true, because we need the friend counts
450
+ if ( 'popular' == $this->query_vars['type'] ) {
451
+ $this->query_vars['populate_extras'] = 1;
452
+ }
453
+
454
+ if ( ! (bool) $this->query_vars['populate_extras'] ) {
455
+ return;
456
+ }
457
+
458
+ // Turn user ID's into a query-usable, comma separated value
459
+ $user_ids_sql = implode( ',', wp_parse_id_list( $this->user_ids ) );
460
+
461
+ /**
462
+ * Use this action to independently populate your own custom extras.
463
+ *
464
+ * Note that anything you add here should query using $user_ids_sql, to
465
+ * avoid running multiple queries per user in the loop.
466
+ *
467
+ * Two BuddyPress components currently do this:
468
+ * - XProfile: To override display names
469
+ * - Friends: To set whether or not a user is the current users friend
470
+ *
471
+ * @see bp_xprofile_filter_user_query_populate_extras()
472
+ * @see bp_friends_filter_user_query_populate_extras()
473
+ */
474
+ do_action_ref_array( 'bp_user_query_populate_extras', array( $this, $user_ids_sql ) );
475
+
476
+ // Fetch usermeta data
477
+ // We want the three following pieces of info from usermeta:
478
+ // - friend count
479
+ // - last activity
480
+ // - latest update
481
+ $total_friend_count_key = bp_get_user_meta_key( 'total_friend_count' );
482
+ $last_activity_key = bp_get_user_meta_key( 'last_activity' );
483
+ $bp_latest_update_key = bp_get_user_meta_key( 'bp_latest_update' );
484
+
485
+ // total_friend_count must be set for each user, even if its
486
+ // value is 0
487
+ foreach ( $this->results as $uindex => $user ) {
488
+ $this->results[$uindex]->total_friend_count = 0;
489
+ }
490
+
491
+ // Create, prepare, and run the seperate usermeta query
492
+ $user_metas = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, meta_key, meta_value FROM {$wpdb->usermeta} WHERE meta_key IN (%s,%s,%s) AND user_id IN ({$user_ids_sql})", $total_friend_count_key, $last_activity_key, $bp_latest_update_key ) );
493
+
494
+ // The $members_template global expects the index key to be different
495
+ // from the meta_key in some cases, so we rejig things here.
496
+ foreach ( $user_metas as $user_meta ) {
497
+ switch ( $user_meta->meta_key ) {
498
+ case $total_friend_count_key :
499
+ $key = 'total_friend_count';
500
+ break;
501
+
502
+ case $last_activity_key :
503
+ $key = 'last_activity';
504
+ break;
505
+
506
+ case $bp_latest_update_key :
507
+ $key = 'latest_update';
508
+ break;
509
+ }
510
+
511
+ if ( isset( $this->results[ $user_meta->user_id ] ) ) {
512
+ $this->results[ $user_meta->user_id ]->{$key} = $user_meta->meta_value;
513
+ }
514
+ }
515
+
516
+ // When meta_key or meta_value have been passed to the query,
517
+ // fetch the resulting values for use in the template functions
518
+ if ( ! empty( $this->query_vars['meta_key'] ) ) {
519
+ $meta_sql = array(
520
+ 'select' => "SELECT user_id, meta_key, meta_value",
521
+ 'from' => "FROM $wpdb->usermeta",
522
+ 'where' => $wpdb->prepare( "WHERE meta_key = %s", $this->query_vars['meta_key'] )
523
+ );
524
+
525
+ if ( false !== $this->query_vars['meta_value'] ) {
526
+ $meta_sql['where'] .= $wpdb->prepare( " AND meta_value = %s", $this->query_vars['meta_value'] );
527
+ }
528
+
529
+ $metas = $wpdb->get_results( "{$meta_sql['select']} {$meta_sql['from']} {$meta_sql['where']}" );
530
+
531
+ if ( ! empty( $metas ) ) {
532
+ foreach ( $metas as $meta ) {
533
+ if ( isset( $this->results[ $meta->user_id ] ) ) {
534
+ $this->results[ $meta->user_id ]->meta_key = $meta->meta_key;
535
+
536
+ if ( ! empty( $meta->meta_value ) ) {
537
+ $this->results[ $meta->user_id ]->meta_value = $meta->meta_value;
538
+ }
539
+ }
540
+ }
541
+ }
542
+ }
543
+ }
544
+ }
545
+
546
  /**
547
  * BP_Core_User class can be used by any component. It will fetch useful
548
  * details for any user when provided with a user_id.
742
  function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
743
  global $wpdb, $bp;
744
 
745
+ _deprecated_function( __METHOD__, '1.7', 'BP_User_Query' );
746
+
747
  $sql = array();
748
 
749
  $sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
958
 
959
  $exclude_sql = ( !empty( $exclude ) ) ? " AND u.ID NOT IN ({$exclude})" : "";
960
 
961
+ $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ) );
962
+ $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ) );
963
 
964
  $total_users = $wpdb->get_var( $total_users_sql );
965
  $paged_users = $wpdb->get_results( $paged_users_sql );
1003
  if ( $limit && $page )
1004
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
1005
 
 
 
1006
  $status_sql = bp_core_get_status_sql();
1007
 
1008
+ $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " );
1009
+ $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" );
1010
 
1011
  $total_users = $wpdb->get_var( $total_users_sql );
1012
  $paged_users = $wpdb->get_results( $paged_users_sql );
1323
  function get_all_for_user( $user_id, $status = 'is_new' ) {
1324
  global $bp, $wpdb;
1325
 
1326
+ $is_new = ( 'is_new' == $status ) ? ' AND is_new = 1 ' : '';
1327
 
1328
  return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) );
1329
  }
1413
  *
1414
  * API to create BuddyPress buttons
1415
  *
1416
+ * component: Which component this button is for
1417
+ * must_be_logged_in: Button only appears for logged in users
1418
+ * block_self: Button will not appear when viewing your own profile.
1419
+ * wrapper: div|span|p|li|false for no wrapper
1420
+ * wrapper_id: The DOM ID of the button wrapper
1421
+ * wrapper_class: The DOM class of the button wrapper
1422
+ * link_href: The destination link of the button
1423
+ * link_title: Title of the button
1424
+ * link_id: The DOM ID of the button
1425
+ * link_class: The DOM class of the button
1426
+ * link_rel: The DOM rel of the button
1427
+ * link_text: The text of the button
1428
+ * contents: The contents of the button
1429
+ *
1430
  * @package BuddyPress Core
1431
+ * @since BuddyPress (1.2.6)
1432
  */
1433
  class BP_Button {
1434
+
1435
+ /** Button properties *****************************************************/
1436
 
1437
  /**
1438
  * The button ID
1439
  *
1440
  * @var integer
1441
  */
1442
+ public $id = '';
1443
 
1444
  /**
1445
  * The component name that button belongs to.
1446
  *
1447
  * @var string
1448
  */
1449
+ public $component = 'core';
1450
 
1451
  /**
1452
  * Does the user need to be logged in to see this button?
1453
  *
1454
  * @var boolean
1455
  */
1456
+ public $must_be_logged_in = true;
1457
 
1458
  /**
1459
+ * True or false if the button should not be displayed while viewing your
1460
+ * own profile.
1461
  *
1462
  * @var boolean
1463
  */
1464
+ public $block_self = true;
1465
 
1466
+ /** Wrapper ***************************************************************/
 
1467
 
1468
  /**
1469
  * What type of DOM element to use for a wrapper.
1471
  *
1472
  * @var mixed div|span|p|li, or false for no wrapper
1473
  */
1474
+ public $wrapper = 'div';
1475
 
1476
  /**
1477
  * The DOM class of the button wrapper
1478
  *
1479
  * @var string
1480
  */
1481
+ public $wrapper_class = '';
1482
 
1483
  /**
1484
  * The DOM ID of the button wrapper
1485
  *
1486
  * @var string
1487
  */
1488
+ public $wrapper_id = '';
 
1489
 
1490
+ /** Button ****************************************************************/
1491
 
1492
  /**
1493
  * The destination link of the button
1494
  *
1495
  * @var string
1496
  */
1497
+ public $link_href = '';
1498
 
1499
  /**
1500
  * The DOM class of the button link
1501
  *
1502
  * @var string
1503
  */
1504
+ public $link_class = '';
1505
 
1506
  /**
1507
  * The DOM ID of the button link
1508
  *
1509
  * @var string
1510
  */
1511
+ public $link_id = '';
1512
 
1513
  /**
1514
  * The DOM rel value of the button link
1515
  *
1516
  * @var string
1517
  */
1518
+ public $link_rel = '';
1519
 
1520
  /**
1521
  * Title of the button link
1522
  *
1523
  * @var string
1524
  */
1525
+ public $link_title = '';
1526
 
1527
  /**
1528
  * The contents of the button link
1529
  *
1530
  * @var string
1531
  */
1532
+ public $link_text = '';
1533
 
1534
+ /** HTML result ***********************************************************/
1535
 
1536
+ public $contents = '';
1537
 
1538
+ /** Methods ***************************************************************/
1539
 
1540
  /**
1541
+ * Builds the button based on class parameters:
1542
  *
1543
+ * @since BuddyPress (1.2.6)
 
 
 
 
 
 
 
 
 
 
 
 
 
1544
  *
1545
  * @param array $args
1546
  * @return bool False if not allowed
1547
  */
1548
+ public function __construct( $args = '' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1549
 
1550
+ $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) );
 
1551
 
1552
  // Required button properties
1553
+ $this->id = $r['id'];
1554
+ $this->component = $r['component'];
1555
+ $this->must_be_logged_in = (bool) $r['must_be_logged_in'];
1556
+ $this->block_self = (bool) $r['block_self'];
1557
+ $this->wrapper = $r['wrapper'];
1558
 
1559
  // $id and $component are required
1560
+ if ( empty( $r['id'] ) || empty( $r['component'] ) )
1561
  return false;
1562
 
1563
  // No button if component is not active
1564
+ if ( ! bp_is_active( $this->component ) )
1565
  return false;
1566
 
1567
  // No button for guests if must be logged in
1568
+ if ( true == $this->must_be_logged_in && ! is_user_logged_in() )
1569
  return false;
1570
 
1571
  // No button if viewing your own profile
1576
  if ( false !== $this->wrapper ) {
1577
 
1578
  // Wrapper ID
1579
+ if ( !empty( $r['wrapper_id'] ) ) {
1580
+ $this->wrapper_id = ' id="' . $r['wrapper_id'] . '"';
1581
  }
1582
 
1583
  // Wrapper class
1584
+ if ( !empty( $r['wrapper_class'] ) ) {
1585
+ $this->wrapper_class = ' class="generic-button ' . $r['wrapper_class'] . '"';
1586
  } else {
1587
  $this->wrapper_class = ' class="generic-button"';
1588
  }
1589
 
1590
  // Set before and after
1591
+ $before = '<' . $r['wrapper'] . $this->wrapper_class . $this->wrapper_id . '>';
1592
+ $after = '</' . $r['wrapper'] . '>';
1593
 
1594
  // No wrapper
1595
  } else {
1597
  }
1598
 
1599
  // Link properties
1600
+ if ( !empty( $r['link_id'] ) ) $this->link_id = ' id="' . $r['link_id'] . '"';
1601
+ if ( !empty( $r['link_href'] ) ) $this->link_href = ' href="' . $r['link_href'] . '"';
1602
+ if ( !empty( $r['link_title'] ) ) $this->link_title = ' title="' . $r['link_title'] . '"';
1603
+ if ( !empty( $r['link_rel'] ) ) $this->link_rel = ' rel="' . $r['link_rel'] . '"';
1604
+ if ( !empty( $r['link_class'] ) ) $this->link_class = ' class="' . $r['link_class'] . '"';
1605
+ if ( !empty( $r['link_text'] ) ) $this->link_text = $r['link_text'];
 
 
 
 
 
 
 
 
 
 
 
1606
 
1607
  // Build the button
1608
  $this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after;
1609
 
1610
  // Allow button to be manipulated externally
1611
+ $this->contents = apply_filters( 'bp_button_' . $this->component . '_' . $this->id, $this->contents, $this, $before, $after );
1612
  }
1613
 
1614
  /**
 
 
1615
  * Return contents of button
1616
  *
1617
+ * @since BuddyPress (1.2.6)
1618
+ *
1619
  * @return string
1620
  */
1621
+ public function contents() {
1622
  return $this->contents;
1623
  }
1624
 
1625
  /**
 
 
1626
  * Output contents of button
1627
+ *
1628
+ * @since BuddyPress (1.2.6)
1629
  */
1630
+ public function display() {
1631
  if ( !empty( $this->contents ) )
1632
  echo $this->contents;
1633
  }
1797
  }
1798
  }
1799
 
1800
+ /**
1801
+ * Create HTML list of BP nav items
1802
+ *
1803
+ * @since BuddyPress (1.7)
1804
+ */
1805
+ class BP_Walker_Nav_Menu extends Walker_Nav_Menu {
1806
+ /**
1807
+ * @since BuddyPress (1.7)
1808
+ * @var array
1809
+ */
1810
+ var $db_fields = array( 'id' => 'css_id', 'parent' => 'parent' );
1811
+
1812
+ /**
1813
+ * @since BuddyPress (1.7)
1814
+ * @var string
1815
+ */
1816
+ var $tree_type = array();
1817
+
1818
+ /**
1819
+ * Display array of elements hierarchically.
1820
+ *
1821
+ * This method is almost identical to the version in {@link Walker::walk()}. The only change is on one line
1822
+ * which has been commented. An IF was comparing 0 to a non-empty string which was preventing child elements
1823
+ * being grouped under their parent menu element.
1824
+ *
1825
+ * This caused a problem for BuddyPress because our primary/secondary navigations doesn't have a unique numerical
1826
+ * ID that describes a hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and those have ID/post_parent.
1827
+ *
1828
+ * @param array $elements
1829
+ * @param int $max_depth
1830
+ * @return string
1831
+ * @see Walker::walk()
1832
+ * @since BuddyPress (1.7)
1833
+ */
1834
+ function walk( $elements, $max_depth ) {
1835
+ $args = array_slice( func_get_args(), 2 );
1836
+ $output = '';
1837
+
1838
+ if ( $max_depth < -1 ) // invalid parameter
1839
+ return $output;
1840
+
1841
+ if ( empty( $elements ) ) // nothing to walk
1842
+ return $output;
1843
+
1844
+ $id_field = $this->db_fields['id'];
1845
+ $parent_field = $this->db_fields['parent'];
1846
+
1847
+ // flat display
1848
+ if ( -1 == $max_depth ) {
1849
+
1850
+ $empty_array = array();
1851
+ foreach ( $elements as $e )
1852
+ $this->display_element( $e, $empty_array, 1, 0, $args, $output );
1853
+
1854
+ return $output;
1855
+ }
1856
+
1857
+ /*
1858
+ * need to display in hierarchical order
1859
+ * separate elements into two buckets: top level and children elements
1860
+ * children_elements is two dimensional array, eg.
1861
+ * children_elements[10][] contains all sub-elements whose parent is 10.
1862
+ */
1863
+ $top_level_elements = array();
1864
+ $children_elements = array();
1865
+
1866
+ foreach ( $elements as $e ) {
1867
+ // BuddyPress: changed '==' to '==='. This is the only change from version in Walker::walk().
1868
+ if ( 0 === $e->$parent_field )
1869
+ $top_level_elements[] = $e;
1870
+ else
1871
+ $children_elements[$e->$parent_field][] = $e;
1872
+ }
1873
+
1874
+ /*
1875
+ * when none of the elements is top level
1876
+ * assume the first one must be root of the sub elements
1877
+ */
1878
+ if ( empty( $top_level_elements ) ) {
1879
+
1880
+ $first = array_slice( $elements, 0, 1 );
1881
+ $root = $first[0];
1882
+ $top_level_elements = array();
1883
+ $children_elements = array();
1884
+
1885
+ foreach ( $elements as $e ) {
1886
+ if ( $root->$parent_field == $e->$parent_field )
1887
+ $top_level_elements[] = $e;
1888
+ else
1889
+ $children_elements[$e->$parent_field][] = $e;
1890
+ }
1891
+ }
1892
+
1893
+ foreach ( $top_level_elements as $e )
1894
+ $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
1895
+
1896
+ /*
1897
+ * if we are displaying all levels, and remaining children_elements is not empty,
1898
+ * then we got orphans, which should be displayed regardless
1899
+ */
1900
+ if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
1901
+ $empty_array = array();
1902
+
1903
+ foreach ( $children_elements as $orphans )
1904
+ foreach ( $orphans as $op )
1905
+ $this->display_element( $op, $empty_array, 1, 0, $args, $output );
1906
+ }
1907
+
1908
+ return $output;
1909
+ }
1910
+
1911
+ /**
1912
+ * Displays the current <li> that we are on.
1913
+ *
1914
+ * @param string $output Passed by reference. Used to append additional content.
1915
+ * @param object $item Menu item data object.
1916
+ * @param int $depth Depth of menu item. Used for padding. Optional, defaults to 0.
1917
+ * @param array $args Optional
1918
+ * @param int $current_page Menu item ID. Optional.
1919
+ * @since BuddyPress (1.7)
1920
+ */
1921
+ function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
1922
+ // If we're someway down the tree, indent the HTML with the appropriate number of tabs
1923
+ $indent = $depth ? str_repeat( "\t", $depth ) : '';
1924
+
1925
+ // Add HTML classes
1926
+ $class_names = join( ' ', apply_filters( 'bp_nav_menu_css_class', array_filter( $item->class ), $item, $args ) );
1927
+ $class_names = ! empty( $class_names ) ? ' class="' . esc_attr( $class_names ) . '"' : '';
1928
+
1929
+ // Add HTML ID
1930
+ $id = sanitize_html_class( $item->css_id . '-personal-li' ); // Backpat with BP pre-1.7
1931
+ $id = apply_filters( 'bp_nav_menu_item_id', $id, $item, $args );
1932
+ $id = ! empty( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
1933
+
1934
+ // Opening tag; closing tag is handled in Walker_Nav_Menu::end_el().
1935
+ $output .= $indent . '<li' . $id . $class_names . '>';
1936
+
1937
+ // Add href attribute
1938
+ $attributes = ! empty( $item->link ) ? ' href="' . esc_attr( esc_url( $item->link ) ) . '"' : '';
1939
+
1940
+ // Construct the link
1941
+ $item_output = $args->before;
1942
+ $item_output .= '<a' . $attributes . '>';
1943
+ $item_output .= $args->link_before . apply_filters( 'the_title', $item->name, 0 ) . $args->link_after;
1944
+ $item_output .= '</a>';
1945
+ $item_output .= $args->after;
1946
+
1947
+ // $output is byref
1948
+ $output .= apply_filters( 'bp_walker_nav_menu_start_el', $item_output, $item, $depth, $args );
1949
+ }
1950
+ }
bp-core/bp-core-component.php CHANGED
@@ -109,7 +109,6 @@ class BP_Component {
109
  * Component global variables
110
  *
111
  * @since BuddyPress (1.5)
112
- * @access private
113
  *
114
  * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id'
115
  * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_slug'
@@ -187,7 +186,6 @@ class BP_Component {
187
  * - ./bp-my_component/bp-my_component-actions.php
188
  *
189
  * @since BuddyPress (1.5)
190
- * @access private
191
  *
192
  * @uses do_action() Calls 'bp_{@link bp_Component::name}includes'
193
  */
@@ -229,7 +227,6 @@ class BP_Component {
229
  * Setup the actions
230
  *
231
  * @since BuddyPress (1.5)
232
- * @access private
233
  *
234
  * @uses add_action() To add various actions
235
  * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions'
@@ -385,5 +382,3 @@ class BP_Component {
385
  }
386
  }
387
  endif; // BP_Component
388
-
389
- ?>
109
  * Component global variables
110
  *
111
  * @since BuddyPress (1.5)
 
112
  *
113
  * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id'
114
  * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_slug'
186
  * - ./bp-my_component/bp-my_component-actions.php
187
  *
188
  * @since BuddyPress (1.5)
 
189
  *
190
  * @uses do_action() Calls 'bp_{@link bp_Component::name}includes'
191
  */
227
  * Setup the actions
228
  *
229
  * @since BuddyPress (1.5)
 
230
  *
231
  * @uses add_action() To add various actions
232
  * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions'
382
  }
383
  }
384
  endif; // BP_Component
 
 
bp-core/bp-core-cssjs.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
 
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  function bp_core_confirmation_js() {
6
- global $wpdb;
7
 
8
- if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() )
9
  return false;
10
 
11
  if ( !wp_script_is( 'jquery' ) )
@@ -14,11 +14,19 @@ function bp_core_confirmation_js() {
14
  if ( !wp_script_is( 'jquery', 'done' ) )
15
  wp_print_scripts( 'jquery' ); ?>
16
 
17
- <script type="text/javascript"> jQuery(document).ready( function() { jQuery("a.confirm").click( function() { if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) ) return true; else return false; }); });</script>
 
 
 
 
 
 
 
18
 
19
  <?php
20
  }
21
- add_action( 'wp_head', 'bp_core_confirmation_js', 100 );
 
22
 
23
  /**
24
  * bp_core_add_jquery_cropper()
@@ -42,20 +50,28 @@ function bp_core_add_jquery_cropper() {
42
  * @package BuddyPress Core
43
  */
44
  function bp_core_add_cropper_inline_js() {
45
- global $bp;
46
 
47
- $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . $bp->avatar_admin->image->dir ) );
48
- $aspect_ratio = 1;
 
 
49
 
 
50
  $full_height = bp_core_avatar_full_height();
51
  $full_width = bp_core_avatar_full_width();
52
 
53
  // Calculate Aspect Ratio
54
- if ( $full_height && ( $full_width != $full_height ) )
55
  $aspect_ratio = $full_width / $full_height;
 
 
 
56
 
57
- $width = $image[0] / 2;
58
- $height = $image[1] / 2; ?>
 
 
 
59
 
60
  <script type="text/javascript">
61
  jQuery(window).load( function(){
@@ -63,10 +79,10 @@ function bp_core_add_cropper_inline_js() {
63
  onChange: showPreview,
64
  onSelect: showPreview,
65
  onSelect: updateCoords,
66
- aspectRatio: <?php echo $aspect_ratio ?>,
67
- setSelect: [ 50, 50, <?php echo $width ?>, <?php echo $height ?> ]
68
  });
69
- updateCoords({x: 50, y: 50, w: <?php echo $width ?>, h: <?php echo $height ?>});
70
  });
71
 
72
  function updateCoords(c) {
@@ -78,18 +94,14 @@ function bp_core_add_cropper_inline_js() {
78
 
79
  function showPreview(coords) {
80
  if ( parseInt(coords.w) > 0 ) {
81
- var rx = <?php echo $full_width; ?> / coords.w;
82
- var ry = <?php echo $full_height; ?> / coords.h;
83
- <?php if ( $image ) : ?>
84
- var w = <?php echo $image[0]; ?>;
85
- var h = <?php echo $image[1]; ?>;
86
- <?php endif; ?>
87
-
88
- jQuery('#avatar-crop-preview').css({
89
- <?php if ( $image ) : ?>
90
- width: Math.round(rx * w) + 'px',
91
- height: Math.round(ry * h) + 'px',
92
- <?php endif; ?>
93
  marginLeft: '-' + Math.round(rx * coords.x) + 'px',
94
  marginTop: '-' + Math.round(ry * coords.y) + 'px'
95
  });
@@ -112,35 +124,42 @@ function bp_core_add_cropper_inline_css() {
112
 
113
  <style type="text/css">
114
  .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
115
- .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('<?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif'); }
116
- .jcrop-vline { height: 100%; width: 1px !important; }
117
- .jcrop-hline { width: 100%; height: 1px !important; }
118
- .jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; }
119
- .jcrop-tracker { width: 100%; height: 100%; }
120
- .custom .jcrop-vline, .custom .jcrop-hline { background: yellow; }
121
- .custom .jcrop-handle { border-color: black; background-color: #C7BB00; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
122
  #avatar-crop-pane { width: <?php echo bp_core_avatar_full_width() ?>px; height: <?php echo bp_core_avatar_full_height() ?>px; overflow: hidden; }
123
  #avatar-crop-submit { margin: 20px 0; }
124
- #avatar-upload-form img, #create-group-form img, #group-settings-form img { border: none !important; }
 
 
 
 
125
  </style>
126
 
127
  <?php
128
  }
129
 
130
  /**
131
- * bp_core_add_ajax_url_js()
132
- *
133
  * Adds AJAX target URL so themes can access the WordPress AJAX functionality.
134
  *
135
- * @since 1.1
136
  */
137
  function bp_core_add_ajax_url_js() {
138
  ?>
139
 
140
- <script type="text/javascript">var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';</script>
141
 
142
  <?php
143
  }
144
  add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
145
 
146
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  // Exit if accessed directly
4
  if ( !defined( 'ABSPATH' ) ) exit;
5
 
6
  function bp_core_confirmation_js() {
 
7
 
8
+ if ( is_multisite() && ! bp_is_root_blog() )
9
  return false;
10
 
11
  if ( !wp_script_is( 'jquery' ) )
14
  if ( !wp_script_is( 'jquery', 'done' ) )
15
  wp_print_scripts( 'jquery' ); ?>
16
 
17
+ <script type="text/javascript">
18
+ jQuery( document ).ready( function() {
19
+ jQuery( 'a.confirm').click( function() {
20
+ if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) )
21
+ return true; else return false;
22
+ });
23
+ });
24
+ </script>
25
 
26
  <?php
27
  }
28
+ add_action( 'wp_head', 'bp_core_confirmation_js', 100 );
29
+ add_action( 'admin_head', 'bp_core_confirmation_js', 100 );
30
 
31
  /**
32
  * bp_core_add_jquery_cropper()
50
  * @package BuddyPress Core
51
  */
52
  function bp_core_add_cropper_inline_js() {
 
53
 
54
+ // Bail if no image was uploaded
55
+ $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir ) );
56
+ if ( empty( $image ) )
57
+ return;
58
 
59
+ //
60
  $full_height = bp_core_avatar_full_height();
61
  $full_width = bp_core_avatar_full_width();
62
 
63
  // Calculate Aspect Ratio
64
+ if ( !empty( $full_height ) && ( $full_width != $full_height ) ) {
65
  $aspect_ratio = $full_width / $full_height;
66
+ } else {
67
+ $aspect_ratio = 1;
68
+ }
69
 
70
+ // Default cropper coordinates
71
+ $crop_left = $image[0] / 4;
72
+ $crop_top = $image[1] / 4;
73
+ $crop_right = $image[0] - $crop_left;
74
+ $crop_bottom = $image[1] - $crop_top; ?>
75
 
76
  <script type="text/javascript">
77
  jQuery(window).load( function(){
79
  onChange: showPreview,
80
  onSelect: showPreview,
81
  onSelect: updateCoords,
82
+ aspectRatio: <?php echo $aspect_ratio; ?>,
83
+ setSelect: [ <?php echo $crop_left; ?>, <?php echo $crop_top; ?>, <?php echo $crop_right; ?>, <?php echo $crop_bottom; ?> ]
84
  });
85
+ updateCoords({x: <?php echo $crop_left; ?>, y: <?php echo $crop_top; ?>, w: <?php echo $crop_right; ?>, h: <?php echo $crop_bottom; ?>});
86
  });
87
 
88
  function updateCoords(c) {
94
 
95
  function showPreview(coords) {
96
  if ( parseInt(coords.w) > 0 ) {
97
+ var fw = <?php echo $full_width; ?>;
98
+ var fh = <?php echo $full_height; ?>;
99
+ var rx = fw / coords.w;
100
+ var ry = fh / coords.h;
101
+
102
+ jQuery( '#avatar-crop-preview' ).css({
103
+ width: Math.round(rx * <?php echo $image[0]; ?>) + 'px',
104
+ height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',
 
 
 
 
105
  marginLeft: '-' + Math.round(rx * coords.x) + 'px',
106
  marginTop: '-' + Math.round(ry * coords.y) + 'px'
107
  });
124
 
125
  <style type="text/css">
126
  .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
 
 
 
 
 
 
 
127
  #avatar-crop-pane { width: <?php echo bp_core_avatar_full_width() ?>px; height: <?php echo bp_core_avatar_full_height() ?>px; overflow: hidden; }
128
  #avatar-crop-submit { margin: 20px 0; }
129
+ .jcrop-holder img,
130
+ #avatar-crop-pane img,
131
+ #avatar-upload-form img,
132
+ #create-group-form img,
133
+ #group-settings-form img { border: none !important; max-width: none !important; }
134
  </style>
135
 
136
  <?php
137
  }
138
 
139
  /**
 
 
140
  * Adds AJAX target URL so themes can access the WordPress AJAX functionality.
141
  *
142
+ * @since BuddyPress (1.1)
143
  */
144
  function bp_core_add_ajax_url_js() {
145
  ?>
146
 
147
+ <script type="text/javascript">var ajaxurl = '<?php echo bp_core_ajax_url(); ?>';</script>
148
 
149
  <?php
150
  }
151
  add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
152
 
153
+ /**
154
+ * Returns the proper value for BP's ajaxurl
155
+ *
156
+ * Designed to be sensitive to FORCE_SSL_ADMIN and non-standard multisite
157
+ * configurations.
158
+ *
159
+ * @since BuddyPress (1.7)
160
+ *
161
+ * @return string
162
+ */
163
+ function bp_core_ajax_url() {
164
+ return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );
165
+ }
bp-core/bp-core-dependency.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Plugin Dependency
5
+ *
6
+ * The purpose of the following hooks is to mimic the behavior of something
7
+ * called 'plugin dependency' which enables a plugin to have plugins of their
8
+ * own in a safe and reliable way.
9
+ *
10
+ * We do this in BuddyPress by mirroring existing WordPress hookss in many places
11
+ * allowing dependant plugins to hook into the BuddyPress specific ones, thus
12
+ * guaranteeing proper code execution only when BuddyPress is active.
13
+ *
14
+ * The following functions are wrappers for hookss, allowing them to be
15
+ * manually called and/or piggy-backed on top of other hooks if needed.
16
+ *
17
+ * @todo use anonymous functions when PHP minimun requirement allows (5.3)
18
+ */
19
+
20
+ /**
21
+ * Include files on this action
22
+ */
23
+ function bp_include() {
24
+ do_action( 'bp_include' );
25
+ }
26
+
27
+ /**
28
+ * Include files on this action
29
+ */
30
+ function bp_setup_components() {
31
+ do_action( 'bp_setup_components' );
32
+ }
33
+
34
+ /**
35
+ * Setup global variables and objects
36
+ */
37
+ function bp_setup_globals() {
38
+ do_action( 'bp_setup_globals' );
39
+ }
40
+
41
+ /**
42
+ * Set navigation elements
43
+ */
44
+ function bp_setup_nav() {
45
+ do_action( 'bp_setup_nav' );
46
+ }
47
+
48
+ /**
49
+ * Set up BuddyPress implementation of the WP Toolbar
50
+ */
51
+ function bp_setup_admin_bar() {
52
+ if ( bp_use_wp_admin_bar() )
53
+ do_action( 'bp_setup_admin_bar' );
54
+ }
55
+
56
+ /**
57
+ * Set the page title
58
+ */
59
+ function bp_setup_title() {
60
+ do_action( 'bp_setup_title' );
61
+ }
62
+
63
+ /**
64
+ * Register widgets
65
+ */
66
+ function bp_setup_widgets() {
67
+ do_action( 'bp_register_widgets' );
68
+ }
69
+
70
+ /**
71
+ * Setup the currently logged-in user
72
+ *
73
+ * @uses did_action() To make sure the user isn't loaded out of order
74
+ * @uses do_action() Calls 'bp_setup_current_user'
75
+ */
76
+ function bp_setup_current_user() {
77
+
78
+ // If the current user is being setup before the "init" action has fired,
79
+ // strange (and difficult to debug) role/capability issues will occur.
80
+ if ( ! did_action( 'after_setup_theme' ) ) {
81
+ _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'buddypress' ), '1.7' );
82
+ }
83
+
84
+ do_action( 'bp_setup_current_user' );
85
+ }
86
+
87
+ /**
88
+ * Initlialize code
89
+ */
90
+ function bp_init() {
91
+ do_action( 'bp_init' );
92
+ }
93
+
94
+ /**
95
+ * Attached to plugins_loaded
96
+ */
97
+ function bp_loaded() {
98
+ do_action( 'bp_loaded' );
99
+ }
100
+
101
+ /**
102
+ * Attached to wp
103
+ */
104
+ function bp_ready() {
105
+ do_action( 'bp_ready' );
106
+ }
107
+
108
+ /**
109
+ * Attach potential template actions
110
+ */
111
+ function bp_actions() {
112
+ do_action( 'bp_actions' );
113
+ }
114
+
115
+ /**
116
+ * Attach potential template screens
117
+ */
118
+ function bp_screens() {
119
+ do_action( 'bp_screens' );
120
+ }
121
+
122
+ /**
123
+ * Initialize widgets
124
+ */
125
+ function bp_widgets_init() {
126
+ do_action ( 'bp_widgets_init' );
127
+ }
128
+
129
+ /**
130
+ * BuddyPress head scripts
131
+ */
132
+ function bp_head() {
133
+ do_action ( 'bp_head' );
134
+ }
135
+
136
+ /** Theme Permissions *********************************************************/
137
+
138
+ /**
139
+ * The main action used for redirecting BuddyPress theme actions that are not
140
+ * permitted by the current_user
141
+ *
142
+ * @since BuddyPress (1.6)
143
+ *
144
+ * @uses do_action()
145
+ */
146
+ function bp_template_redirect() {
147
+ do_action( 'bp_template_redirect' );
148
+ }
149
+
150
+ /** Theme Helpers *************************************************************/
151
+
152
+ /**
153
+ * The main action used registering theme directory
154
+ *
155
+ * @since BuddyPress (1.5)
156
+ * @uses do_action()
157
+ */
158
+ function bp_register_theme_directory() {
159
+ do_action( 'bp_register_theme_directory' );
160
+ }
161
+
162
+ /**
163
+ * The main action used registering theme packages
164
+ *
165
+ * @since BuddyPress (1.7)
166
+ * @uses do_action()
167
+ */
168
+ function bp_register_theme_packages() {
169
+ do_action( 'bp_register_theme_packages' );
170
+ }
171
+
172
+ /**
173
+ * Enqueue BuddyPress specific CSS and JS
174
+ *
175
+ * @since BuddyPress (1.6)
176
+ *
177
+ * @uses do_action() Calls 'bp_enqueue_scripts'
178
+ */
179
+ function bp_enqueue_scripts() {
180
+ do_action ( 'bp_enqueue_scripts' );
181
+ }
182
+
183
+ /**
184
+ * Piggy back action for BuddyPress sepecific theme actions before the theme has
185
+ * been setup and the theme's functions.php has loaded.
186
+ *
187
+ * @since BuddyPress (1.6)
188
+ *
189
+ * @uses do_action() Calls 'bp_setup_theme'
190
+ */
191
+ function bp_setup_theme() {
192
+ do_action ( 'bp_setup_theme' );
193
+ }
194
+
195
+ /**
196
+ * Piggy back action for BuddyPress sepecific theme actions once the theme has
197
+ * been setup and the theme's functions.php has loaded.
198
+ *
199
+ * Hooked to 'after_setup_theme' with a priority of 100. This allows plenty of
200
+ * time for other themes to load their features, such as BuddyPress support,
201
+ * before our theme compatibility layer kicks in.
202
+ *
203
+ * @since BuddyPress (1.6)
204
+ *
205
+ * @uses do_action() Calls 'bp_after_setup_theme'
206
+ */
207
+ function bp_after_setup_theme() {
208
+ do_action ( 'bp_after_setup_theme' );
209
+ }
210
+
211
+ /** Theme Compatibility Filter ************************************************/
212
+
213
+ /**
214
+ * Piggy back filter for WordPress's 'request' filter
215
+ *
216
+ * @since BuddyPress (1.7)
217
+ * @param array $query_vars
218
+ * @return array
219
+ */
220
+ function bp_request( $query_vars = array() ) {
221
+ return apply_filters( 'bp_request', $query_vars );
222
+ }
223
+
224
+ /**
225
+ * Piggy back filter to handle login redirects.
226
+ *
227
+ * @since BuddyPress (1.7)
228
+ *
229
+ * @param string $redirect_to
230
+ * @param string $redirect_to_raw
231
+ * @param string $user
232
+ */
233
+ function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) {
234
+ return apply_filters( 'bp_login_redirect', $redirect_to, $redirect_to_raw, $user );
235
+ }
236
+
237
+ /**
238
+ * The main filter used for theme compatibility and displaying custom BuddyPress
239
+ * theme files.
240
+ *
241
+ * @since BuddyPress (1.6)
242
+ *
243
+ * @uses apply_filters()
244
+ *
245
+ * @param string $template
246
+ * @return string Template file to use
247
+ */
248
+ function bp_template_include( $template = '' ) {
249
+ return apply_filters( 'bp_template_include', $template );
250
+ }
251
+
252
+ /**
253
+ * Generate BuddyPress-specific rewrite rules
254
+ *
255
+ * @since BuddyPress (1.7)
256
+ * @param WP_Rewrite $wp_rewrite
257
+ * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}
258
+ */
259
+ function bp_generate_rewrite_rules( $wp_rewrite ) {
260
+ do_action_ref_array( 'bp_generate_rewrite_rules', array( &$wp_rewrite ) );
261
+ }
262
+
263
+ /**
264
+ * Filter the allowed themes list for BuddyPress specific themes
265
+ *
266
+ * @since BuddyPress (1.7)
267
+ * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list
268
+ */
269
+ function bp_allowed_themes( $themes ) {
270
+ return apply_filters( 'bp_allowed_themes', $themes );
271
+ }
bp-core/bp-core-filters.php CHANGED
@@ -1,8 +1,50 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  // Exit if accessed directly
4
  if ( !defined( 'ABSPATH' ) ) exit;
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  // Add some filters to feedback messages
7
  add_filter( 'bp_core_render_message_content', 'wptexturize' );
8
  add_filter( 'bp_core_render_message_content', 'convert_smilies' );
@@ -10,6 +52,22 @@ add_filter( 'bp_core_render_message_content', 'convert_chars' );
10
  add_filter( 'bp_core_render_message_content', 'wpautop' );
11
  add_filter( 'bp_core_render_message_content', 'shortcode_unautop' );
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * bp_core_exclude_pages()
15
  *
@@ -19,19 +77,22 @@ add_filter( 'bp_core_render_message_content', 'shortcode_unautop' );
19
  * @uses bp_is_active() checks if a BuddyPress component is active.
20
  * @return array The list of page ID's to exclude
21
  */
22
- function bp_core_exclude_pages( $pages ) {
23
- global $bp;
24
 
25
- if ( bp_is_root_blog() ) {
26
- if ( !empty( $bp->pages->activate ) )
27
- $pages[] = $bp->pages->activate->id;
28
 
29
- if ( !empty( $bp->pages->register ) )
30
- $pages[] = $bp->pages->register->id;
31
 
32
- if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) )
33
- $pages[] = $bp->pages->forums->id;
34
- }
 
 
 
 
 
35
 
36
  return apply_filters( 'bp_core_exclude_pages', $pages );
37
  }
@@ -43,38 +104,14 @@ add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' );
43
  * Sets the "From" name in emails sent to the name of the site and not "WordPress"
44
  *
45
  * @package BuddyPress Core
46
- * @uses get_blog_option() fetches the value for a meta_key in the wp_X_options table
47
  * @return The blog name for the root blog
48
  */
49
  function bp_core_email_from_name_filter() {
50
- return apply_filters( 'bp_core_email_from_name_filter', wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ) );
51
  }
52
  add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
53
 
54
- /**
55
- * bp_core_allow_default_theme()
56
- *
57
- * On multiblog installations you must first allow themes to be activated and show
58
- * up on the theme selection screen. This function will let the BuddyPress bundled
59
- * themes show up on the root blog selection screen and bypass this step. It also
60
- * means that the themes won't show for selection on other blogs.
61
- *
62
- * @package BuddyPress Core
63
- */
64
- function bp_core_allow_default_theme( $themes ) {
65
- global $wpdb;
66
-
67
- if ( !bp_current_user_can( 'bp_moderate' ) )
68
- return $themes;
69
-
70
- if ( $wpdb->blogid == bp_get_root_blog_id() ) {
71
- $themes['bp-default'] = 1;
72
- }
73
-
74
- return $themes;
75
- }
76
- add_filter( 'allowed_themes', 'bp_core_allow_default_theme' );
77
-
78
  /**
79
  * bp_core_filter_comments()
80
  *
@@ -156,7 +193,7 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) {
156
 
157
  return bp_get_root_domain();
158
  }
159
- add_filter( 'login_redirect', 'bp_core_login_redirect', 10, 3 );
160
 
161
  /***
162
  * bp_core_filter_user_welcome_email()
@@ -171,14 +208,13 @@ add_filter( 'login_redirect', 'bp_core_login_redirect', 10, 3 );
171
  function bp_core_filter_user_welcome_email( $welcome_email ) {
172
 
173
  // Don't touch the email if we don't have a custom registration template
174
- if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
175
  return $welcome_email;
176
 
177
  // [User Set] Replaces 'PASSWORD' in welcome email; Represents value set by user
178
  return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email );
179
  }
180
- if ( !is_admin() && empty( $_GET['e'] ) )
181
- add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' );
182
 
183
  /***
184
  * bp_core_filter_blog_welcome_email()
@@ -196,14 +232,13 @@ if ( !is_admin() && empty( $_GET['e'] ) )
196
  function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
197
 
198
  // Don't touch the email if we don't have a custom registration template
199
- if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
200
  return $welcome_email;
201
 
202
  // [User Set] Replaces $password in welcome email; Represents value set by user
203
  return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email );
204
  }
205
- if ( !is_admin() && empty( $_GET['e'] ) )
206
- add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 );
207
 
208
  // Notify user of signup success.
209
  function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) {
@@ -217,10 +252,10 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u
217
  if ( empty( $admin_email ) )
218
  $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
219
 
220
- $from_name = ( '' == get_site_option( 'site_name' ) ) ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
221
  $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
222
  $message = sprintf( __( "Thanks for registering! To complete the activation of your account and blog, please click the following link:\n\n%1\$s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%2\$s", 'buddypress' ), $activate_url, esc_url( "http://{$domain}{$path}" ) );
223
- $subject = '[' . $from_name . '] ' . sprintf(__( 'Activate %s', 'buddypress' ), esc_url( 'http://' . $domain . $path ) );
224
 
225
  // Send the message
226
  $to = apply_filters( 'bp_core_activation_signup_blog_notification_to', $user_email, $domain, $path, $title, $user, $user_email, $key, $meta );
@@ -234,8 +269,7 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u
234
  // Return false to stop the original WPMU function from continuing
235
  return false;
236
  }
237
- if ( !is_admin() )
238
- add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
239
 
240
  function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
241
 
@@ -246,14 +280,10 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key,
246
  if ( empty( $admin_email ) )
247
  $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
248
 
249
- // If this is an admin generated activation, add a param to email the
250
- // user login details
251
- $email = is_admin() ? '&e=1' : '';
252
-
253
- $from_name = ( '' == get_site_option( 'site_name' ) ) ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
254
  $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
255
- $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url . $email );
256
- $subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
257
 
258
  // Send the message
259
  $to = apply_filters( 'bp_core_activation_signup_user_notification_to', $user_email, $user, $user_email, $key, $meta );
@@ -267,8 +297,7 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key,
267
  // Return false to stop the original WPMU function from continuing
268
  return false;
269
  }
270
- if ( !is_admin() || ( is_admin() && empty( $_POST['noconfirmation'] ) ) )
271
- add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
272
 
273
  /**
274
  * Filter the page title for BuddyPress pages
@@ -309,8 +338,8 @@ function bp_modify_page_title( $title, $sep, $seplocation ) {
309
  $component_name = $bp->{$component_id}->id;
310
  }
311
 
312
- // translators: "displayed user's name | canonicalised component name"
313
- $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ) ) );
314
 
315
  // A single group
316
  } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
@@ -357,5 +386,3 @@ add_filter( 'wp_title', 'bp_modify_page_title', 10, 3 );
357
  add_filter( 'bp_modify_page_title', 'wptexturize' );
358
  add_filter( 'bp_modify_page_title', 'convert_chars' );
359
  add_filter( 'bp_modify_page_title', 'esc_html' );
360
-
361
- ?>
1
  <?php
2
 
3
+ /**
4
+ * BuddyPress Filters
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage Core
8
+ *
9
+ * This file contains the filters that are used through-out BuddyPress. They are
10
+ * consolidated here to make searching for them easier, and to help developers
11
+ * understand at a glance the order in which things occur.
12
+ *
13
+ * There are a few common places that additional filters can currently be found
14
+ *
15
+ * - BuddyPress: In {@link BuddyPress::setup_actions()} in buddypress.php
16
+ * - Component: In {@link BP_Component::setup_actions()} in
17
+ * bp-core/bp-core-component.php
18
+ * - Admin: More in {@link BP_Admin::setup_actions()} in
19
+ * bp-core/bp-core-admin.php
20
+ *
21
+ * @see bp-core-actions.php
22
+ */
23
+
24
  // Exit if accessed directly
25
  if ( !defined( 'ABSPATH' ) ) exit;
26
 
27
+ /**
28
+ * Attach BuddyPress to WordPress
29
+ *
30
+ * BuddyPress uses its own internal actions to help aid in third-party plugin
31
+ * development, and to limit the amount of potential future code changes when
32
+ * updates to WordPress core occur.
33
+ *
34
+ * These actions exist to create the concept of 'plugin dependencies'. They
35
+ * provide a safe way for plugins to execute code *only* when BuddyPress is
36
+ * installed and activated, without needing to do complicated guesswork.
37
+ *
38
+ * For more information on how this works, see the 'Plugin Dependency' section
39
+ * near the bottom of this file.
40
+ *
41
+ * v--WordPress Actions v--BuddyPress Sub-actions
42
+ */
43
+ add_filter( 'request', 'bp_request', 10 );
44
+ add_filter( 'template_include', 'bp_template_include', 10 );
45
+ add_filter( 'login_redirect', 'bp_login_redirect', 10, 3 );
46
+ add_filter( 'map_meta_cap', 'bp_map_meta_caps', 10, 4 );
47
+
48
  // Add some filters to feedback messages
49
  add_filter( 'bp_core_render_message_content', 'wptexturize' );
50
  add_filter( 'bp_core_render_message_content', 'convert_smilies' );
52
  add_filter( 'bp_core_render_message_content', 'wpautop' );
53
  add_filter( 'bp_core_render_message_content', 'shortcode_unautop' );
54
 
55
+ /**
56
+ * Template Compatibility
57
+ *
58
+ * If you want to completely bypass this and manage your own custom BuddyPress
59
+ * template hierarchy, start here by removing this filter, then look at how
60
+ * bp_template_include() works and do something similar. :)
61
+ */
62
+ add_filter( 'bp_template_include', 'bp_template_include_theme_supports', 2, 1 );
63
+ add_filter( 'bp_template_include', 'bp_template_include_theme_compat', 4, 2 );
64
+
65
+ // Filter BuddyPress template locations
66
+ add_filter( 'bp_get_template_stack', 'bp_add_template_stack_locations' );
67
+
68
+ // Turn comments off for BuddyPress pages
69
+ add_filter( 'comments_open', 'bp_comments_open', 10, 2 );
70
+
71
  /**
72
  * bp_core_exclude_pages()
73
  *
77
  * @uses bp_is_active() checks if a BuddyPress component is active.
78
  * @return array The list of page ID's to exclude
79
  */
80
+ function bp_core_exclude_pages( $pages = array() ) {
 
81
 
82
+ // Bail if not the root blog
83
+ if ( ! bp_is_root_blog() )
84
+ return $pages;
85
 
86
+ $bp = buddypress();
 
87
 
88
+ if ( !empty( $bp->pages->activate ) )
89
+ $pages[] = $bp->pages->activate->id;
90
+
91
+ if ( !empty( $bp->pages->register ) )
92
+ $pages[] = $bp->pages->register->id;
93
+
94
+ if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) )
95
+ $pages[] = $bp->pages->forums->id;
96
 
97
  return apply_filters( 'bp_core_exclude_pages', $pages );
98
  }
104
  * Sets the "From" name in emails sent to the name of the site and not "WordPress"
105
  *
106
  * @package BuddyPress Core
107
+ * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table
108
  * @return The blog name for the root blog
109
  */
110
  function bp_core_email_from_name_filter() {
111
+ return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) );
112
  }
113
  add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  /**
116
  * bp_core_filter_comments()
117
  *
193
 
194
  return bp_get_root_domain();
195
  }
196
+ add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
197
 
198
  /***
199
  * bp_core_filter_user_welcome_email()
208
  function bp_core_filter_user_welcome_email( $welcome_email ) {
209
 
210
  // Don't touch the email if we don't have a custom registration template
211
+ if ( ! bp_has_custom_signup_page() )
212
  return $welcome_email;
213
 
214
  // [User Set] Replaces 'PASSWORD' in welcome email; Represents value set by user
215
  return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email );
216
  }
217
+ add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' );
 
218
 
219
  /***
220
  * bp_core_filter_blog_welcome_email()
232
  function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
233
 
234
  // Don't touch the email if we don't have a custom registration template
235
+ if ( ! bp_has_custom_signup_page() )
236
  return $welcome_email;
237
 
238
  // [User Set] Replaces $password in welcome email; Represents value set by user
239
  return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email );
240
  }
241
+ add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 );
 
242
 
243
  // Notify user of signup success.
244
  function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) {
252
  if ( empty( $admin_email ) )
253
  $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
254
 
255
+ $from_name = bp_get_option( 'blogname', 'WordPress' );
256
  $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
257
  $message = sprintf( __( "Thanks for registering! To complete the activation of your account and blog, please click the following link:\n\n%1\$s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%2\$s", 'buddypress' ), $activate_url, esc_url( "http://{$domain}{$path}" ) );
258
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Activate %s', 'buddypress' ), 'http://' . $domain . $path ) ) );
259
 
260
  // Send the message
261
  $to = apply_filters( 'bp_core_activation_signup_blog_notification_to', $user_email, $domain, $path, $title, $user, $user_email, $key, $meta );
269
  // Return false to stop the original WPMU function from continuing
270
  return false;
271
  }
272
+ add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
 
273
 
274
  function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
275
 
280
  if ( empty( $admin_email ) )
281
  $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
282
 
283
+ $from_name = bp_get_option( 'blogname', 'WordPress' );
 
 
 
 
284
  $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
285
+ $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url );
286
+ $subject = bp_get_email_subject( array( 'text' => __( 'Activate Your Account', 'buddypress' ) ) );
287
 
288
  // Send the message
289
  $to = apply_filters( 'bp_core_activation_signup_user_notification_to', $user_email, $user, $user_email, $key, $meta );
297
  // Return false to stop the original WPMU function from continuing
298
  return false;
299
  }
300
+ add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
 
301
 
302
  /**
303
  * Filter the page title for BuddyPress pages
338
  $component_name = $bp->{$component_id}->id;
339
  }
340
 
341
+ // Construct the page title. 1 = user name, 2 = seperator, 3 = component name
342
+ $title = strip_tags( sprintf( _x( '%1$s %3$s %2$s', 'Construct the page title. 1 = user name, 2 = component name, 3 = seperator', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep ) );
343
 
344
  // A single group
345
  } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
386
  add_filter( 'bp_modify_page_title', 'wptexturize' );
387
  add_filter( 'bp_modify_page_title', 'convert_chars' );
388
  add_filter( 'bp_modify_page_title', 'esc_html' );
 
 
bp-core/bp-core-functions.php CHANGED
@@ -25,12 +25,10 @@ function bp_version() {
25
  * Return the BuddyPress version
26
  *
27
  * @since BuddyPress (1.6)
28
- * @global BuddyPress $bp
29
  * @return string The BuddyPress version
30
  */
31
  function bp_get_version() {
32
- global $bp;
33
- return $bp->version;
34
  }
35
 
36
  /**
@@ -46,12 +44,10 @@ function bp_db_version() {
46
  * Return the BuddyPress database version
47
  *
48
  * @since BuddyPress (1.6)
49
- * @global BuddyPress $bp
50
  * @return string The BuddyPress version
51
  */
52
  function bp_get_db_version() {
53
- global $bp;
54
- return $bp->db_version;
55
  }
56
 
57
  /**
@@ -67,38 +63,11 @@ function bp_db_version_raw() {
67
  * Return the BuddyPress database version
68
  *
69
  * @since BuddyPress (1.6)
70
- * @global BuddyPress $bp
71
  * @return string The BuddyPress version direct from the database
72
  */
73
  function bp_get_db_version_raw() {
74
- global $bp;
75
-
76
- $retval = 0;
77
- if ( !empty( $bp->db_version_raw ) )
78
- $retval = $bp->db_version_raw;
79
-
80
- return $retval;
81
- }
82
-
83
- /**
84
- * Output the BuddyPress maintenance mode
85
- *
86
- * @since BuddyPress (1.6)
87
- * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode
88
- */
89
- function bp_maintenance_mode() {
90
- echo bp_get_maintenance_mode();
91
- }
92
- /**
93
- * Return the BuddyPress maintenance mode
94
- *
95
- * @since BuddyPress (1.6)
96
- * @global BuddyPress $bp
97
- * @return string The BuddyPress maintenance mode
98
- */
99
- function bp_get_maintenance_mode() {
100
- global $bp;
101
- return $bp->maintenance_mode;
102
  }
103
 
104
  /** Functions *****************************************************************/
@@ -205,6 +174,87 @@ function bp_core_get_directory_pages() {
205
  return apply_filters( 'bp_core_get_directory_pages', $pages );
206
  }
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  /**
209
  * Creates a default component slug from a WP page root_slug
210
  *
@@ -254,7 +304,7 @@ function bp_core_get_root_domain() {
254
  * Get the current GMT time to save into the DB
255
  *
256
  * @package BuddyPress Core
257
- * @since 1.2.6
258
  */
259
  function bp_core_current_time( $gmt = true ) {
260
  // Get current time in MYSQL format
@@ -335,7 +385,7 @@ function bp_core_render_message() {
335
  $type = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error';
336
  $content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?>
337
 
338
- <div id="message" class="<?php echo $type; ?>">
339
 
340
  <?php echo $content; ?>
341
 
@@ -374,12 +424,19 @@ function bp_core_number_format( $number, $decimals = false ) {
374
  * eg: 4 weeks and 6 days
375
  *
376
  * @package BuddyPress Core
 
 
377
  * @param $older_date int Unix timestamp of date you want to calculate the time since for
378
  * @param $newer_date int Unix timestamp of date to compare older date to. Default false (current time).
379
  * @return str The time since.
380
  */
381
  function bp_core_time_since( $older_date, $newer_date = false ) {
382
 
 
 
 
 
 
383
  // Setup the strings
384
  $unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) );
385
  $right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
@@ -468,7 +525,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
468
  $output = sprintf( $ago_text, $output );
469
  }
470
 
471
- return $output;
472
  }
473
 
474
  /**
@@ -565,24 +622,21 @@ function bp_core_get_site_path() {
565
  * Performs a status safe wp_redirect() that is compatible with bp_catch_uri()
566
  *
567
  * @package BuddyPress Core
568
- * @global BuddyPress $bp Makes sure that there are no conflicts with
569
- * status_header() called in bp_core_do_catch_uri()
570
- * @uses wp_redirect()
571
  */
572
  function bp_core_redirect( $location, $status = 302 ) {
573
- global $bp;
574
 
575
- // On some setups, passing the value of wp_get_referer() may result in an empty value for
576
- // $location, which results in an error. Ensure that we have a valid URL.
577
- if ( empty( $location ) ) {
 
578
  $location = bp_get_root_domain();
579
- }
580
 
581
- // Make sure we don't call status_header() in bp_core_do_catch_uri()
582
- // as this conflicts with wp_redirect()
583
- $bp->no_status_set = true;
584
 
585
- wp_redirect( $location, $status );
586
  die;
587
  }
588
 
@@ -910,16 +964,25 @@ function bp_is_username_compatibility_mode() {
910
  /**
911
  * Are we running multiblog mode?
912
  *
913
- * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. "Multiblog" is
914
- * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog
915
- * on the network. Thus, instead of having all 'boonebgorges' links go to
 
 
916
  * http://example.com/members/boonebgorges
917
- * on the root blog, each blog will have its own version of the same profile content, eg
918
  * http://site2.example.com/members/boonebgorges (for subdomains)
919
  * http://example.com/site2/members/boonebgorges (for subdirectories)
920
  *
921
- * Multiblog mode is disabled by default, meaning that all BP content must be viewed on the root
922
- * blog.
 
 
 
 
 
 
 
923
  *
924
  * @package BuddyPress
925
  * @since BuddyPress (1.5)
@@ -928,7 +991,23 @@ function bp_is_username_compatibility_mode() {
928
  * @return bool False when multiblog mode is disabled (default); true when enabled
929
  */
930
  function bp_is_multiblog_mode() {
931
- return apply_filters( 'bp_is_multiblog_mode', is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
932
  }
933
 
934
  /**
@@ -1076,23 +1155,40 @@ function bp_admin_url( $path = '', $scheme = 'admin' ) {
1076
  function bp_get_admin_url( $path = '', $scheme = 'admin' ) {
1077
 
1078
  // Links belong in network admin
1079
- if ( bp_core_do_network_admin() )
1080
  $url = network_admin_url( $path, $scheme );
1081
 
1082
  // Links belong in site admin
1083
- else
1084
  $url = admin_url( $path, $scheme );
 
1085
 
1086
  return $url;
1087
  }
1088
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1089
  function bp_core_do_network_admin() {
1090
- $do_network_admin = false;
1091
 
1092
- if ( is_multisite() && !bp_is_multiblog_mode() )
1093
- $do_network_admin = true;
1094
 
1095
- return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
 
 
 
1096
  }
1097
 
1098
  function bp_core_admin_hook() {
@@ -1101,6 +1197,32 @@ function bp_core_admin_hook() {
1101
  return apply_filters( 'bp_core_admin_hook', $hook );
1102
  }
1103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1104
  /** Global Manipulators *******************************************************/
1105
 
1106
  /**
@@ -1190,9 +1312,7 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
1190
  // Get the home URL
1191
  $home_url = strtolower( home_url() );
1192
 
1193
- // Build the currently requested URL
1194
- $scheme = is_ssl() ? 'https://' : 'http://';
1195
- $requested_url = strtolower( $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
1196
 
1197
  // Check the nonce
1198
  $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false;
@@ -1206,5 +1326,3 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
1206
 
1207
  return $result;
1208
  }
1209
-
1210
- ?>
25
  * Return the BuddyPress version
26
  *
27
  * @since BuddyPress (1.6)
 
28
  * @return string The BuddyPress version
29
  */
30
  function bp_get_version() {
31
+ return buddypress()->version;
 
32
  }
33
 
34
  /**
44
  * Return the BuddyPress database version
45
  *
46
  * @since BuddyPress (1.6)
 
47
  * @return string The BuddyPress version
48
  */
49
  function bp_get_db_version() {
50
+ return buddypress()->db_version;
 
51
  }
52
 
53
  /**
63
  * Return the BuddyPress database version
64
  *
65
  * @since BuddyPress (1.6)
 
66
  * @return string The BuddyPress version direct from the database
67
  */
68
  function bp_get_db_version_raw() {
69
+ $bp = buddypress();
70
+ return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
 
73
  /** Functions *****************************************************************/
174
  return apply_filters( 'bp_core_get_directory_pages', $pages );
175
  }
176
 
177
+ /**
178
+ * Add the pages for the component mapping. These are most often used by components with directories (e.g. groups, members).
179
+ *
180
+ * @param array $default_components Optional components to create pages for
181
+ * @param string $existing 'delete' if you want to delete existing page
182
+ * mappings and replace with new ones. Otherwise existing page mappings
183
+ * are kept, and the gaps filled in with new pages
184
+ * @since BuddyPress (1.7)
185
+ */
186
+ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
187
+
188
+ // Make sure that the pages are created on the root blog no matter which Dashboard the setup is being run on
189
+ if ( ! bp_is_root_blog() )
190
+ switch_to_blog( bp_get_root_blog_id() );
191
+
192
+ $pages = bp_core_get_directory_page_ids();
193
+
194
+ // Delete any existing pages
195
+ if ( 'delete' == $existing ) {
196
+ foreach ( (array) $pages as $page_id ) {
197
+ wp_delete_post( $page_id, true );
198
+ }
199
+
200
+ $pages = array();
201
+ }
202
+
203
+ $page_titles = array(
204
+ 'activity' => _x( 'Activity', 'Page title for the Activity directory.', 'buddypress' ),
205
+ 'groups' => _x( 'Groups', 'Page title for the Groups directory.', 'buddypress' ),
206
+ 'sites' => _x( 'Sites', 'Page title for the Sites directory.', 'buddypress' ),
207
+ 'activate' => _x( 'Activate', 'Page title for the user account activation screen.', 'buddypress' ),
208
+ 'members' => _x( 'Members', 'Page title for the Members directory.', 'buddypress' ),
209
+ 'register' => _x( 'Register', 'Page title for the user registration screen.', 'buddypress' ),
210
+ );
211
+
212
+ $pages_to_create = array();
213
+ foreach ( array_keys( $components ) as $component_name ) {
214
+ if ( ! isset( $pages[ $component_name ] ) && isset( $page_titles[ $component_name ] ) ) {
215
+ $pages_to_create[ $component_name ] = $page_titles[ $component_name ];
216
+ }
217
+ }
218
+
219
+ // Register and Activate are not components, but need pages when
220
+ // registration is enabled
221
+ if ( bp_get_signup_allowed() ) {
222
+ foreach ( array( 'register', 'activate' ) as $slug ) {
223
+ if ( ! isset( $pages[ $slug ] ) ) {
224
+ $pages_to_create[ $slug ] = $page_titles[ $slug ];
225
+ }
226
+ }
227
+ }
228
+
229
+ // No need for a Sites directory unless we're on multisite
230
+ if ( ! is_multisite() && isset( $pages_to_create['sites'] ) ) {
231
+ unset( $pages_to_create['sites'] );
232
+ }
233
+
234
+ // Members must always have a page, no matter what
235
+ if ( ! isset( $pages['members'] ) && ! isset( $pages_to_create['members'] ) ) {
236
+ $pages_to_create['members'] = $page_titles['members'];
237
+ }
238
+
239
+ // Create the pages
240
+ foreach ( $pages_to_create as $component_name => $page_name ) {
241
+ $pages[ $component_name ] = wp_insert_post( array(
242
+ 'comment_status' => 'closed',
243
+ 'ping_status' => 'closed',
244
+ 'post_status' => 'publish',
245
+ 'post_title' => $page_name,
246
+ 'post_type' => 'page',
247
+ ) );
248
+ }
249
+
250
+ // Save the page mapping
251
+ bp_update_option( 'bp-pages', $pages );
252
+
253
+ // If we had to switch_to_blog, go back to the original site.
254
+ if ( ! bp_is_root_blog() )
255
+ restore_current_blog();
256
+ }
257
+
258
  /**
259
  * Creates a default component slug from a WP page root_slug
260
  *
304
  * Get the current GMT time to save into the DB
305
  *
306
  * @package BuddyPress Core
307
+ * @since BuddyPress (1.2.6)
308
  */
309
  function bp_core_current_time( $gmt = true ) {
310
  // Get current time in MYSQL format
385
  $type = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error';
386
  $content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?>
387
 
388
+ <div id="message" class="bp-template-notice <?php echo $type; ?>">
389
 
390
  <?php echo $content; ?>
391
 
424
  * eg: 4 weeks and 6 days
425
  *
426
  * @package BuddyPress Core
427
+ * @uses apply_filters() Filter 'bp_core_time_since_pre' to bypass BP's calculations
428
+ * @uses apply_filters() Filter 'bp_core_time_since' to modify BP's calculations
429
  * @param $older_date int Unix timestamp of date you want to calculate the time since for
430
  * @param $newer_date int Unix timestamp of date to compare older date to. Default false (current time).
431
  * @return str The time since.
432
  */
433
  function bp_core_time_since( $older_date, $newer_date = false ) {
434
 
435
+ // Use this filter to bypass BuddyPress's time_since calculations
436
+ if ( $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date ) ) {
437
+ return $pre_value;
438
+ }
439
+
440
  // Setup the strings
441
  $unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) );
442
  $right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
525
  $output = sprintf( $ago_text, $output );
526
  }
527
 
528
+ return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date );
529
  }
530
 
531
  /**
622
  * Performs a status safe wp_redirect() that is compatible with bp_catch_uri()
623
  *
624
  * @package BuddyPress Core
625
+ * @uses wp_safe_redirect()
 
 
626
  */
627
  function bp_core_redirect( $location, $status = 302 ) {
 
628
 
629
+ // On some setups, passing the value of wp_get_referer() may result in an
630
+ // empty value for $location, which results in an error. Ensure that we
631
+ // have a valid URL.
632
+ if ( empty( $location ) )
633
  $location = bp_get_root_domain();
 
634
 
635
+ // Make sure we don't call status_header() in bp_core_do_catch_uri() as this
636
+ // conflicts with wp_redirect() and wp_safe_redirect().
637
+ buddypress()->no_status_set = true;
638
 
639
+ wp_safe_redirect( $location, $status );
640
  die;
641
  }
642
 
964
  /**
965
  * Are we running multiblog mode?
966
  *
967
+ * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WordPress
968
+ * Multisite. "Multiblog" is BuddyPress setup that allows BuddyPress components
969
+ * to be viewed on every blog on the network, each with their own settings.
970
+ *
971
+ * Thus, instead of having all 'boonebgorges' links go to
972
  * http://example.com/members/boonebgorges
973
+ * on the root blog, each blog will have its own version of the same content, eg
974
  * http://site2.example.com/members/boonebgorges (for subdomains)
975
  * http://example.com/site2/members/boonebgorges (for subdirectories)
976
  *
977
+ * Multiblog mode is disabled by default, meaning that all BuddyPress content
978
+ * must be viewed on the root blog. It's also recommended not to use the
979
+ * BP_ENABLE_MULTIBLOG constant beyond 1.7, as BuddyPress can now be activated
980
+ * on individual sites.
981
+ *
982
+ * Why would you want to use this? Originally it was intended to allow
983
+ * BuddyPress to live in mu-plugins and be visible on mapped domains. This is
984
+ * a very small use-case with large architectural shortcomings, so do not go
985
+ * down this road unless you specifically need to.
986
  *
987
  * @package BuddyPress
988
  * @since BuddyPress (1.5)
991
  * @return bool False when multiblog mode is disabled (default); true when enabled
992
  */
993
  function bp_is_multiblog_mode() {
994
+
995
+ // Setup some default values
996
+ $retval = false;
997
+ $is_multisite = is_multisite();
998
+ $network_active = bp_is_network_activated();
999
+ $is_multiblog = defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG;
1000
+
1001
+ // Multisite, Network Activated, and Specifically Multiblog
1002
+ if ( $is_multisite && $network_active && $is_multiblog ) {
1003
+ $retval = true;
1004
+
1005
+ // Multisite, but not network activated
1006
+ } elseif ( $is_multisite && ! $network_active ) {
1007
+ $retval = true;
1008
+ }
1009
+
1010
+ return apply_filters( 'bp_is_multiblog_mode', $retval );
1011
  }
1012
 
1013
  /**
1155
  function bp_get_admin_url( $path = '', $scheme = 'admin' ) {
1156
 
1157
  // Links belong in network admin
1158
+ if ( bp_core_do_network_admin() ) {
1159
  $url = network_admin_url( $path, $scheme );
1160
 
1161
  // Links belong in site admin
1162
+ } else {
1163
  $url = admin_url( $path, $scheme );
1164
+ }
1165
 
1166
  return $url;
1167
  }
1168
 
1169
+ /**
1170
+ * Should BuddyPress appear in network admin, or site admin?
1171
+ *
1172
+ * Because BuddyPress can be installed in multiple ways and with multiple
1173
+ * configurations, we need to check a few things to be confident about where
1174
+ * to hook into certain areas of WordPress's admin.
1175
+ *
1176
+ * This function defaults to BuddyPress being network activated.
1177
+ * @since BuddyPress (1.5)
1178
+ *
1179
+ * @uses bp_is_network_activated()
1180
+ * @uses bp_is_multiblog_mode()
1181
+ * @return boolean
1182
+ */
1183
  function bp_core_do_network_admin() {
 
1184
 
1185
+ // Default
1186
+ $retval = bp_is_network_activated();
1187
 
1188
+ if ( bp_is_multiblog_mode() )
1189
+ $retval = false;
1190
+
1191
+ return (bool) apply_filters( 'bp_core_do_network_admin', $retval );
1192
  }
1193
 
1194
  function bp_core_admin_hook() {
1197
  return apply_filters( 'bp_core_admin_hook', $hook );
1198
  }
1199
 
1200
+ /**
1201
+ * Is BuddyPress active at the network level for this network?
1202
+ *
1203
+ * Used to determine admin menu placement, and where settings and options are
1204
+ * stored. If you're being *really* clever and manually pulling BuddyPress in
1205
+ * with an mu-plugin or some other method, you'll want to
1206
+ *
1207
+ * @since BuddyPress (1.7)
1208
+ * @return boolean
1209
+ */
1210
+ function bp_is_network_activated() {
1211
+
1212
+ // Default to is_multisite()
1213
+ $retval = is_multisite();
1214
+
1215
+ // Check the sitewide plugins array
1216
+ $base = buddypress()->basename;
1217
+ $plugins = get_site_option( 'active_sitewide_plugins' );
1218
+
1219
+ // Override is_multisite() if not network activated
1220
+ if ( ! is_array( $plugins ) || ! isset( $plugins[$base] ) )
1221
+ $retval = false;
1222
+
1223
+ return (bool) apply_filters( 'bp_is_network_activated', $retval );
1224
+ }
1225
+
1226
  /** Global Manipulators *******************************************************/
1227
 
1228
  /**
1312
  // Get the home URL
1313
  $home_url = strtolower( home_url() );
1314
 
1315
+ $requested_url = bp_get_requested_url();
 
 
1316
 
1317
  // Check the nonce
1318
  $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false;
1326
 
1327
  return $result;
1328
  }
 
 
bp-core/bp-core-loader.php CHANGED
@@ -203,6 +203,9 @@ class BP_Core extends BP_Component {
203
  $sub_nav = array();
204
 
205
  // Fallback values if xprofile is disabled
 
 
 
206
  $bp->core->profile->slug = 'profile';
207
  $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;
208
 
@@ -219,7 +222,7 @@ class BP_Core extends BP_Component {
219
 
220
  // Add the subnav items to the profile
221
  $sub_nav[] = array(
222
- 'name' => __( 'Public', 'buddypress' ),
223
  'slug' => 'public',
224
  'parent_url' => $profile_link,
225
  'parent_slug' => $bp->core->profile->slug,
@@ -243,5 +246,3 @@ function bp_setup_core() {
243
  $bp->core = new BP_Core();
244
  }
245
  add_action( 'bp_setup_components', 'bp_setup_core', 2 );
246
-
247
- ?>
203
  $sub_nav = array();
204
 
205
  // Fallback values if xprofile is disabled
206
+ if ( ! isset( $bp->core->profile ) ) {
207
+ $bp->core->profile = new stdClass;
208
+ }
209
  $bp->core->profile->slug = 'profile';
210
  $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;
211
 
222
 
223
  // Add the subnav items to the profile
224
  $sub_nav[] = array(
225
+ 'name' => __( 'View', 'buddypress' ),
226
  'slug' => 'public',
227
  'parent_url' => $profile_link,
228
  'parent_slug' => $bp->core->profile->slug,
246
  $bp->core = new BP_Core();
247
  }
248
  add_action( 'bp_setup_components', 'bp_setup_core', 2 );
 
 
bp-core/bp-core-moderation.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package BuddyPress
6
  * @subpackage Core
7
- * @since 1.6
8
  */
9
 
10
  // Exit if accessed directly
@@ -20,7 +20,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
20
  *
21
  * @param int $user_id User id to check for flood
22
  * @return bool True if there is no flooding, true if there is
23
- * @since 1.6
24
  * @uses current_user_can() To check if the current user can throttle
25
  * @uses bp_get_option() To get the throttle time
26
  * @uses get_transient() To get the last posted transient of the ip
@@ -50,7 +50,7 @@ function bp_core_check_for_flood( $user_id = 0 ) {
50
  * @param string $title The title of the content
51
  * @param string $content The content being posted
52
  * @return bool True if test is passed, false if fail
53
- * @since 1.6
54
  * @uses bp_current_author_ip() To get current user IP address
55
  * @uses bp_current_author_ua() To get current user agent
56
  * @uses bp_current_user_can() Allow super admins to bypass blacklist
@@ -159,7 +159,7 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = ''
159
  * @uses bp_current_author_ip() To get current user IP address
160
  * @uses bp_current_author_ua() To get current user agent
161
  * @uses bp_current_user_can() Allow super admins to bypass blacklist
162
- * @since 1.6
163
  */
164
  function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) {
165
 
@@ -241,7 +241,7 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' )
241
  * Get the current-user IP address
242
  *
243
  * @return string
244
- * @since 1.6
245
  */
246
  function bp_core_current_user_ip() {
247
  $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
@@ -253,7 +253,7 @@ function bp_core_current_user_ip() {
253
  * Get the current-user user-agent
254
  *
255
  * @return string
256
- * @since 1.6
257
  */
258
  function bp_core_current_user_ua() {
259
 
@@ -265,4 +265,3 @@ function bp_core_current_user_ua() {
265
 
266
  return apply_filters( 'bp_core_current_user_ua', $retval );
267
  }
268
- ?>
4
  *
5
  * @package BuddyPress
6
  * @subpackage Core
7
+ * @since BuddyPress (1.6)
8
  */
9
 
10
  // Exit if accessed directly
20
  *
21
  * @param int $user_id User id to check for flood
22
  * @return bool True if there is no flooding, true if there is
23
+ * @since BuddyPress (1.6)
24
  * @uses current_user_can() To check if the current user can throttle
25
  * @uses bp_get_option() To get the throttle time
26
  * @uses get_transient() To get the last posted transient of the ip
50
  * @param string $title The title of the content
51
  * @param string $content The content being posted
52
  * @return bool True if test is passed, false if fail
53
+ * @since BuddyPress (1.6)
54
  * @uses bp_current_author_ip() To get current user IP address
55
  * @uses bp_current_author_ua() To get current user agent
56
  * @uses bp_current_user_can() Allow super admins to bypass blacklist
159
  * @uses bp_current_author_ip() To get current user IP address
160
  * @uses bp_current_author_ua() To get current user agent
161
  * @uses bp_current_user_can() Allow super admins to bypass blacklist
162
+ * @since BuddyPress (1.6)
163
  */
164
  function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) {
165
 
241
  * Get the current-user IP address
242
  *
243
  * @return string
244
+ * @since BuddyPress (1.6)
245
  */
246
  function bp_core_current_user_ip() {
247
  $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
253
  * Get the current-user user-agent
254
  *
255
  * @return string
256
+ * @since BuddyPress (1.6)
257
  */
258
  function bp_core_current_user_ua() {
259
 
265
 
266
  return apply_filters( 'bp_core_current_user_ua', $retval );
267
  }
 
bp-core/bp-core-options.php CHANGED
@@ -61,6 +61,9 @@ function bp_get_default_options() {
61
  // Allow comments on blog and forum activity items
62
  'bp-disable-blogforum-comments' => true,
63
 
 
 
 
64
  /** Groups ************************************************************/
65
 
66
  // @todo Move this into the groups component
@@ -521,4 +524,15 @@ function bp_is_akismet_active( $default = true ) {
521
  return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
522
  }
523
 
524
- ?>
 
 
 
 
 
 
 
 
 
 
 
61
  // Allow comments on blog and forum activity items
62
  'bp-disable-blogforum-comments' => true,
63
 
64
+ // The ID for the current theme package.
65
+ '_bp_theme_package_id' => 'legacy',
66
+
67
  /** Groups ************************************************************/
68
 
69
  // @todo Move this into the groups component
524
  return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
525
  }
526
 
527
+ /**
528
+ * Get the current theme package ID
529
+ *
530
+ * @since BuddyPress (1.7)
531
+ *
532
+ * @param $default string Optional. Default value 'default'
533
+ * @uses get_option() To get the subtheme option
534
+ * @return string ID of the subtheme
535
+ */
536
+ function bp_get_theme_package_id( $default = 'legacy' ) {
537
+ return apply_filters( 'bp_get_theme_package_id', get_option( '_bp_theme_package_id', $default ) );
538
+ }
bp-core/bp-core-template-loader.php ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * BuddyPress Template Functions
5
+ *
6
+ * This file contains functions necessary to mirror the WordPress core template
7
+ * loading process. Many of those functions are not filterable, and even then
8
+ * would not be robust enough to predict where BuddyPress templates might exist.
9
+ *
10
+ * @package BuddyPress
11
+ * @subpackage TemplateFunctions
12
+ */
13
+
14
+ // Exit if accessed directly
15
+ if ( !defined( 'ABSPATH' ) ) exit;
16
+
17
+ /**
18
+ * Adds BuddyPress theme support to any active WordPress theme
19
+ *
20
+ * @since BuddyPress (1.7)
21
+ *
22
+ * @param string $slug
23
+ * @param string $name Optional. Default null
24
+ * @uses bp_locate_template()
25
+ * @uses load_template()
26
+ * @uses get_template_part()
27
+ */
28
+ function bp_get_template_part( $slug, $name = null ) {
29
+
30
+ // Execute code for this part
31
+ do_action( 'get_template_part_' . $slug, $slug, $name );
32
+
33
+ // Setup possible parts
34
+ $templates = array();
35
+ if ( isset( $name ) )
36
+ $templates[] = $slug . '-' . $name . '.php';
37
+ $templates[] = $slug . '.php';
38
+
39
+ // Allow template parts to be filtered
40
+ $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name );
41
+
42
+ // Return the part that is found
43
+ return bp_locate_template( $templates, true, false );
44
+ }
45
+
46
+ /**
47
+ * Retrieve the name of the highest priority template file that exists.
48
+ *
49
+ * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
50
+ * inherit from a parent theme can just overload one file. If the template is
51
+ * not found in either of those, it looks in the theme-compat folder last.
52
+ *
53
+ * @since BuddyPress (1.7)
54
+ *
55
+ * @param string|array $template_names Template file(s) to search for, in order.
56
+ * @param bool $load If true the template file will be loaded if it is found.
57
+ * @param bool $require_once Whether to require_once or require. Default true.
58
+ * Has no effect if $load is false.
59
+ * @return string The template filename if one is located.
60
+ */
61
+ function bp_locate_template( $template_names, $load = false, $require_once = true ) {
62
+
63
+ // No file found yet
64
+ $located = false;
65
+ $template_locations = bp_get_template_stack();
66
+
67
+ // Try to find a template file
68
+ foreach ( (array) $template_names as $template_name ) {
69
+
70
+ // Continue if template is empty
71
+ if ( empty( $template_name ) )
72
+ continue;
73
+
74
+ // Trim off any slashes from the template name
75
+ $template_name = ltrim( $template_name, '/' );
76
+
77
+ // Loop through template stack
78
+ foreach ( (array) $template_locations as $template_location ) {
79
+
80
+ // Continue if $template_location is empty
81
+ if ( empty( $template_location ) )
82
+ continue;
83
+
84
+ // Check child theme first
85
+ if ( file_exists( trailingslashit( $template_location ) . $template_name ) ) {
86
+ $located = trailingslashit( $template_location ) . $template_name;
87
+ break 2;
88
+ }
89
+ }
90
+ }
91
+
92
+ // Maybe load the template if one was located
93
+ if ( ( true == $load ) && !empty( $located ) )
94
+ load_template( $located, $require_once );
95
+
96
+ return $located;
97
+ }
98
+
99
+ /**
100
+ * This is really cool. This function registers a new template stack location,
101
+ * using WordPress's built in filters API.
102
+ *
103
+ * This allows for templates to live in places beyond just the parent/child
104
+ * relationship, to allow for custom template locations. Used in conjunction
105
+ * with bp_locate_template(), this allows for easy template overrides.
106
+ *
107
+ * @since BuddyPress (1.7)
108
+ *
109
+ * @param string $location Callback function that returns the stack location
110
+ * @param int $priority
111
+ */
112
+ function bp_register_template_stack( $location_callback = '', $priority = 10 ) {
113
+
114
+ // Bail if no location, or function does not exist
115
+ if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
116
+ return false;
117
+
118
+ // Add location callback to template stack
119
+ return add_filter( 'bp_template_stack', $location_callback, (int) $priority );
120
+ }
121
+
122
+ /**
123
+ * Deregisters a previously registered template stack location.
124
+ *
125
+ * @since BuddyPress (1.7)
126
+ *
127
+ * @param string $location Callback function that returns the stack location
128
+ * @param int $priority
129
+ * @see bp_register_template_stack()
130
+ */
131
+ function bp_deregister_template_stack( $location_callback = '', $priority = 10 ) {
132
+
133
+ // Bail if no location, or function does not exist
134
+ if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
135
+ return false;
136
+
137
+ // Add location callback to template stack
138
+ return remove_filter( 'bp_template_stack', $location_callback, (int) $priority );
139
+ }
140
+
141
+ /**
142
+ * Call the functions added to the 'bp_template_stack' filter hook, and return
143
+ * an array of the template locations.
144
+ *
145
+ * @see bp_register_template_stack()
146
+ *
147
+ * @since BuddyPress (1.7)
148
+ *
149
+ * @global array $wp_filter Stores all of the filters
150
+ * @global array $merged_filters Merges the filter hooks using this function.
151
+ * @global array $wp_current_filter stores the list of current filters with the current one last
152
+ *
153
+ * @return array The filtered value after all hooked functions are applied to it.
154
+ */
155
+ function bp_get_template_stack() {
156
+ global $wp_filter, $merged_filters, $wp_current_filter;
157
+
158
+ // Setup some default variables
159
+ $tag = 'bp_template_stack';
160
+ $args = $stack = array();
161
+
162
+ // Add 'bp_template_stack' to the current filter array
163
+ $wp_current_filter[] = $tag;
164
+
165
+ // Sort
166
+ if ( ! isset( $merged_filters[ $tag ] ) ) {
167
+ ksort( $wp_filter[$tag] );
168
+ $merged_filters[ $tag ] = true;
169
+ }
170
+
171
+ // Ensure we're always at the beginning of the filter array
172
+ reset( $wp_filter[ $tag ] );
173
+
174
+ // Loop through 'bp_template_stack' filters, and call callback functions
175
+ do {
176
+ foreach( (array) current( $wp_filter[$tag] ) as $the_ ) {
177
+ if ( ! is_null( $the_['function'] ) ) {
178
+ $args[1] = $stack;
179
+ $stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) );
180
+ }
181
+ }
182
+ } while ( next( $wp_filter[$tag] ) !== false );
183
+
184
+ // Remove 'bp_template_stack' from the current filter array
185
+ array_pop( $wp_current_filter );
186
+
187
+ // Remove empties and duplicates
188
+ $stack = array_unique( array_filter( $stack ) );
189
+
190
+ return (array) apply_filters( 'bp_get_template_stack', $stack ) ;
191
+ }
192
+
193
+ /**
194
+ * Get a template part in an output buffer, and return it
195
+ *
196
+ * @since BuddyPress (1.7)
197
+ *
198
+ * @param string $slug
199
+ * @param string $name
200
+ * @return string
201
+ */
202
+ function bp_buffer_template_part( $slug, $name = null, $echo = true ) {
203
+ ob_start();
204
+
205
+ // Remove 'bp_replace_the_content' filter to prevent infinite loops
206
+ remove_filter( 'the_content', 'bp_replace_the_content' );
207
+
208
+ bp_get_template_part( $slug, $name );
209
+
210
+ // Remove 'bp_replace_the_content' filter to prevent infinite loops
211
+ add_filter( 'the_content', 'bp_replace_the_content' );
212
+
213
+ // Get the output buffer contents
214
+ $output = ob_get_contents();
215
+
216
+ // Flush the output buffer
217
+ ob_end_clean();
218
+
219
+ // Echo or return the output buffer contents
220
+ if ( true === $echo ) {
221
+ echo $output;
222
+ } else {
223
+ return $output;
224
+ }
225
+ }
226
+
227
+ /**
228
+ * Retrieve path to a template
229
+ *
230
+ * Used to quickly retrieve the path of a template without including the file
231
+ * extension. It will also check the parent theme and theme-compat theme with
232
+ * the use of {@link bp_locate_template()}. Allows for more generic template
233
+ * locations without the use of the other get_*_template() functions.
234
+ *
235
+ * @since BuddyPress (1.7)
236
+ *
237
+ * @param string $type Filename without extension.
238
+ * @param array $templates An optional list of template candidates
239
+ * @uses bp_set_theme_compat_templates()
240
+ * @uses bp_locate_template()
241
+ * @uses bp_set_theme_compat_template()
242
+ * @return string Full path to file.
243
+ */
244
+ function bp_get_query_template( $type, $templates = array() ) {
245
+ $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
246
+
247
+ if ( empty( $templates ) )
248
+ $templates = array( "{$type}.php" );
249
+
250
+ // Filter possible templates, try to match one, and set any BuddyPress theme
251
+ // compat properties so they can be cross-checked later.
252
+ $templates = apply_filters( "bp_get_{$type}_template", $templates );
253
+ $templates = bp_set_theme_compat_templates( $templates );
254
+ $template = bp_locate_template( $templates );
255
+ $template = bp_set_theme_compat_template( $template );
256
+
257
+ return apply_filters( "bp_{$type}_template", $template );
258
+ }
259
+
260
+ /**
261
+ * Get the possible subdirectories to check for templates in
262
+ *
263
+ * @since BuddyPress (1.7)
264
+ * @param array $templates Templates we are looking for
265
+ * @return array Possible subfolders to look in
266
+ */
267
+ function bp_get_template_locations( $templates = array() ) {
268
+ $locations = array(
269
+ 'buddypress',
270
+ 'community',
271
+ ''
272
+ );
273
+ return apply_filters( 'bp_get_template_locations', $locations, $templates );
274
+ }
275
+
276
+ /**
277
+ * Add template locations to template files being searched for
278
+ *
279
+ * @since BuddyPress (1.7)
280
+ *
281
+ * @param array $stacks
282
+ * @return array()
283
+ */
284
+ function bp_add_template_stack_locations( $stacks = array() ) {
285
+ $retval = array();
286
+
287
+ // Get alternate locations
288
+ $locations = bp_get_template_locations();
289
+
290
+ // Loop through locations and stacks and combine
291
+ foreach ( (array) $stacks as $stack )
292
+ foreach ( (array) $locations as $custom_location )
293
+ $retval[] = untrailingslashit( trailingslashit( $stack ) . $custom_location );
294
+
295
+ return apply_filters( 'bp_add_template_stack_locations', array_unique( $retval ), $stacks );
296
+ }
297
+
298
+ /**
299
+ * Add checks for BuddyPress conditions to parse_query action
300
+ *
301
+ * @since BuddyPress (1.7)
302
+ *
303
+ * @param WP_Query $posts_query
304
+ */
305
+ function bp_parse_query( $posts_query ) {
306
+
307
+ // Bail if $posts_query is not the main loop
308
+ if ( ! $posts_query->is_main_query() )
309
+ return;
310
+
311
+ // Bail if filters are suppressed on this query
312
+ if ( true == $posts_query->get( 'suppress_filters' ) )
313
+ return;
314
+
315
+ // Bail if in admin
316
+ if ( is_admin() )
317
+ return;
318
+
319
+ // Allow BuddyPress components to parse the main query
320
+ do_action_ref_array( 'bp_parse_query', array( &$posts_query ) );
321
+ }
322
+
323
+ /**
324
+ * Possibly intercept the template being loaded
325
+ *
326
+ * Listens to the 'template_include' filter and waits for any BuddyPress specific
327
+ * template condition to be met. If one is met and the template file exists,
328
+ * it will be used; otherwise
329
+ *
330
+ * Note that the _edit() checks are ahead of their counterparts, to prevent them
331
+ * from being stomped on accident.
332
+ *
333
+ * @since BuddyPress (1.7)
334
+ *
335
+ * @param string $template
336
+ *
337
+ * @return string The path to the template file that is being used
338
+ */
339
+ function bp_template_include_theme_supports( $template = '' ) {
340
+
341
+ // Look for root BuddyPress template files in parent/child themes
342
+ $new_template = apply_filters( 'bp_get_root_template', false, $template );
343
+
344
+ // BuddyPress template file exists
345
+ if ( !empty( $new_template ) ) {
346
+
347
+ // Override the WordPress template with a BuddyPress one
348
+ $template = $new_template;
349
+
350
+ // @see: bp_template_include_theme_compat()
351
+ buddypress()->theme_compat->found_template = true;
352
+ }
353
+
354
+ return apply_filters( 'bp_template_include_theme_supports', $template );
355
+ }
356
+
357
+ /**
358
+ * Attempt to load a custom BuddyPress functions file, similar to each themes
359
+ * functions.php file.
360
+ *
361
+ * @since BuddyPress (1.7)
362
+ *
363
+ * @global string $pagenow
364
+ * @uses bp_locate_template()
365
+ */
366
+ function bp_load_theme_functions() {
367
+ global $pagenow;
368
+
369
+ // Do not include on BuddyPress deactivation
370
+ if ( bp_is_deactivation() )
371
+ return;
372
+
373
+ // Only include if not installing or if activating via wp-activate.php
374
+ if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
375
+ bp_locate_template( 'buddypress-functions.php', true );
376
+ }
377
+ }
378
+
379
+ /**
380
+ * Get the templates to use as the endpoint for BuddyPress template parts
381
+ *
382
+ * @since BuddyPress (1.7)
383
+ *
384
+ * @uses apply_filters()
385
+ * @return array Of possible root level wrapper template files
386
+ */
387
+ function bp_get_theme_compat_templates() {
388
+ $templates = array(
389
+ 'plugin-buddypress.php',
390
+ 'buddypress.php',
391
+ 'community.php',
392
+ 'generic.php',
393
+ 'page.php',
394
+ 'single.php',
395
+ 'index.php'
396
+ );
397
+ return bp_get_query_template( 'buddypress', $templates );
398
+ }
bp-core/bp-core-template.php CHANGED
@@ -161,23 +161,12 @@ function bp_site_name() {
161
  /**
162
  * Returns the name of the BP site. Used in RSS headers
163
  *
164
- * @since 1.6
165
  */
166
  function bp_get_site_name() {
167
  return apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) );
168
  }
169
 
170
- function bp_get_profile_header() {
171
- locate_template( array( '/profile/profile-header.php' ), true );
172
- }
173
-
174
- function bp_exists( $component_name ) {
175
- if ( function_exists( $component_name . '_install' ) )
176
- return true;
177
-
178
- return false;
179
- }
180
-
181
  function bp_format_time( $time, $just_date = false, $localize_time = true ) {
182
  if ( !isset( $time ) || !is_numeric( $time ) )
183
  return false;
@@ -228,9 +217,6 @@ function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true
228
  }
229
  }
230
 
231
- function bp_get_plugin_sidebar() {
232
- locate_template( array( 'plugin-sidebar.php' ), true );
233
- }
234
 
235
  function bp_styles() {
236
  do_action( 'bp_styles' );
@@ -247,7 +233,7 @@ function bp_search_form_action() {
247
  * Generates the basic search form as used in BP-Default's header.
248
  *
249
  * @return string HTML <select> element
250
- * @since 1.0
251
  */
252
  function bp_search_form_type_select() {
253
 
@@ -552,6 +538,31 @@ function bp_registration_needs_activation() {
552
  return apply_filters( 'bp_registration_needs_activation', true );
553
  }
554
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  /**
556
  * Allow templates to pass parameters directly into the template loops via AJAX
557
  *
@@ -715,8 +726,8 @@ function bp_get_name_from_root_slug( $root_slug = '' ) {
715
  return false;
716
 
717
  // Loop through active components and look for a match
718
- foreach ( $bp->active_components as $component => $id ) {
719
- if ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) {
720
  return $bp->{$component}->name;
721
  }
722
  }
@@ -758,15 +769,10 @@ function bp_search_slug() {
758
  * @return int
759
  */
760
  function bp_displayed_user_id() {
 
 
761
 
762
- static $id = 0;
763
-
764
- if ( empty( $id ) ) {
765
- global $bp;
766
- $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0;
767
- }
768
-
769
- return apply_filters( 'bp_displayed_user_id', $id );
770
  }
771
 
772
  /**
@@ -776,15 +782,10 @@ function bp_displayed_user_id() {
776
  * @return int
777
  */
778
  function bp_loggedin_user_id() {
 
 
779
 
780
- static $id = 0;
781
-
782
- if ( empty( $id ) ) {
783
- global $bp;
784
- $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;
785
- }
786
-
787
- return apply_filters( 'bp_loggedin_user_id', $id );
788
  }
789
 
790
  /** is_() functions to determine the current page *****************************/
@@ -1045,14 +1046,25 @@ function bp_is_blog_page() {
1045
  return apply_filters( 'bp_is_blog_page', $is_blog_page );
1046
  }
1047
 
1048
- function bp_is_page( $page ) {
1049
- if ( !bp_is_user() && bp_is_current_component( $page ) )
1050
- return true;
1051
-
1052
- if ( 'home' == $page )
1053
- return is_front_page();
 
 
 
 
 
 
 
 
 
 
 
1054
 
1055
- return false;
1056
  }
1057
 
1058
  /** Components ****************************************************************/
@@ -1129,6 +1141,32 @@ function bp_is_settings_component() {
1129
  return false;
1130
  }
1131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1132
  /** Activity ******************************************************************/
1133
 
1134
  function bp_is_single_activity() {
@@ -1224,6 +1262,10 @@ function bp_is_user_change_avatar() {
1224
  * @return bool
1225
  */
1226
  function bp_is_user_forums() {
 
 
 
 
1227
  if ( bp_is_user() && bp_is_forums_component() )
1228
  return true;
1229
 
@@ -1395,10 +1437,20 @@ function bp_is_group_admin_page() {
1395
  }
1396
 
1397
  function bp_is_group_forum() {
1398
- if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) )
1399
- return true;
1400
 
1401
- return false;
 
 
 
 
 
 
 
 
 
 
 
1402
  }
1403
 
1404
  function bp_is_group_activity() {
@@ -1705,6 +1757,13 @@ function bp_the_body_class() {
1705
  $bp_classes[] = bp_current_action();
1706
  }
1707
 
 
 
 
 
 
 
 
1708
  /** Clean up***********************************************************/
1709
 
1710
  // We don't want WordPress blog classes to appear on non-blog pages.
@@ -1722,14 +1781,217 @@ function bp_the_body_class() {
1722
  }
1723
  }
1724
 
1725
- // Merge WP classes with BP classes
1726
- $classes = array_merge( (array) $bp_classes, (array) $wp_classes );
1727
-
1728
- // Remove any duplicates
1729
- $classes = array_unique( $classes );
1730
 
1731
  return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes );
1732
  }
1733
  add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 );
1734
 
1735
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  /**
162
  * Returns the name of the BP site. Used in RSS headers
163
  *
164
+ * @since BuddyPress (1.6)
165
  */
166
  function bp_get_site_name() {
167
  return apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) );
168
  }
169
 
 
 
 
 
 
 
 
 
 
 
 
170
  function bp_format_time( $time, $just_date = false, $localize_time = true ) {
171
  if ( !isset( $time ) || !is_numeric( $time ) )
172
  return false;
217
  }
218
  }
219
 
 
 
 
220
 
221
  function bp_styles() {
222
  do_action( 'bp_styles' );
233
  * Generates the basic search form as used in BP-Default's header.
234
  *
235
  * @return string HTML <select> element
236
+ * @since BuddyPress (1.0)
237
  */
238
  function bp_search_form_type_select() {
239
 
538
  return apply_filters( 'bp_registration_needs_activation', true );
539
  }
540
 
541
+ /**
542
+ * Retrieve a client friendly version of the root blog name, plus take care of
543
+ * the typical formatting bits and bobs.
544
+ *
545
+ * The blogname option is escaped with esc_html on the way into the database in
546
+ * sanitize_option, we want to reverse this for the plain text arena of emails.
547
+ *
548
+ * @link http://buddypress.trac.wordpress.org/ticket/4401
549
+ * @since BuddyPress (1.7)
550
+ * @return string
551
+ */
552
+ function bp_get_email_subject( $args = array() ) {
553
+
554
+ $r = wp_parse_args( $args, array(
555
+ 'before' => '[',
556
+ 'after' => ']',
557
+ 'default' => __( 'Community', 'buddypress' ),
558
+ 'text' => ''
559
+ ) );
560
+
561
+ $subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text'];
562
+
563
+ return apply_filters( 'bp_get_email_subject', $subject, $r );
564
+ }
565
+
566
  /**
567
  * Allow templates to pass parameters directly into the template loops via AJAX
568
  *
726
  return false;
727
 
728
  // Loop through active components and look for a match
729
+ foreach ( array_keys( $bp->active_components ) as $component ) {
730
+ if ( ( !empty( $bp->{$component}->slug ) && ( $bp->{$component}->slug == $root_slug ) ) || ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) ) {
731
  return $bp->{$component}->name;
732
  }
733
  }
769
  * @return int
770
  */
771
  function bp_displayed_user_id() {
772
+ $bp = buddypress();
773
+ $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0;
774
 
775
+ return (int) apply_filters( 'bp_displayed_user_id', $id );
 
 
 
 
 
 
 
776
  }
777
 
778
  /**
782
  * @return int
783
  */
784
  function bp_loggedin_user_id() {
785
+ $bp = buddypress();
786
+ $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;
787
 
788
+ return (int) apply_filters( 'bp_loggedin_user_id', $id );
 
 
 
 
 
 
 
789
  }
790
 
791
  /** is_() functions to determine the current page *****************************/
1046
  return apply_filters( 'bp_is_blog_page', $is_blog_page );
1047
  }
1048
 
1049
+ /**
1050
+ * Is this a BuddyPress component?
1051
+ *
1052
+ * You can tell if a page is displaying BP content by whether the
1053
+ * current_component has been defined
1054
+ *
1055
+ * Generally, we can just check to see that there's no current component.
1056
+ * The one exception is single user home tabs, where $bp->current_component
1057
+ * is unset. Thus the addition of the bp_is_user() check.
1058
+ *
1059
+ * @since BuddyPress (1.7)
1060
+ *
1061
+ * @package BuddyPress
1062
+ * @return bool True if it's a BuddyPress page, false otherwise
1063
+ */
1064
+ function is_buddypress() {
1065
+ $retval = (bool) ( bp_current_component() || bp_is_user() );
1066
 
1067
+ return apply_filters( 'is_buddypress', $retval );
1068
  }
1069
 
1070
  /** Components ****************************************************************/
1141
  return false;
1142
  }
1143
 
1144
+ /**
1145
+ * Is the current component an active core component.
1146
+ *
1147
+ * Use this function when you need to check if the current component is an
1148
+ * active core component of BuddyPress. If the current component is inactive, it
1149
+ * will return false. If the current component is not part of BuddyPress core,
1150
+ * it will return false. If the current component is active, and is part of
1151
+ * BuddyPress core, it will return true.
1152
+ *
1153
+ * @since BuddyPress (1.7)
1154
+ * @return boolean
1155
+ */
1156
+ function bp_is_current_component_core() {
1157
+ $retval = false;
1158
+ $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
1159
+
1160
+ foreach ( array_keys( $active_components ) as $active_component ) {
1161
+ if ( bp_is_current_component( $active_component ) ) {
1162
+ $retval = true;
1163
+ break;
1164
+ }
1165
+ }
1166
+
1167
+ return $retval;
1168
+ }
1169
+
1170
  /** Activity ******************************************************************/
1171
 
1172
  function bp_is_single_activity() {
1262
  * @return bool
1263
  */
1264
  function bp_is_user_forums() {
1265
+
1266
+ if ( ! bp_is_active( 'forums' ) )
1267
+ return false;
1268
+
1269
  if ( bp_is_user() && bp_is_forums_component() )
1270
  return true;
1271
 
1437
  }
1438
 
1439
  function bp_is_group_forum() {
1440
+ $retval = false;
 
1441
 
1442
+ // At a forum URL
1443
+ if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) ) {
1444
+ $retval = true;
1445
+
1446
+ // If at a forum URL, set back to false if forums are inactive, or not
1447
+ // installed correctly.
1448
+ if ( ! bp_is_active( 'forums' ) || ! bp_forums_is_installed_correctly() ) {
1449
+ $retval = false;
1450
+ }
1451
+ }
1452
+
1453
+ return $retval;
1454
  }
1455
 
1456
  function bp_is_group_activity() {
1757
  $bp_classes[] = bp_current_action();
1758
  }
1759
 
1760
+ /** is_buddypress *****************************************************/
1761
+
1762
+ // Add BuddyPress class if we are within a BuddyPress page
1763
+ if ( !empty( $bp_classes ) ) {
1764
+ $bp_classes[] = 'buddypress';
1765
+ }
1766
+
1767
  /** Clean up***********************************************************/
1768
 
1769
  // We don't want WordPress blog classes to appear on non-blog pages.
1781
  }
1782
  }
1783
 
1784
+ // Merge WP classes with BP classes and remove any duplicates
1785
+ $classes = array_unique( array_merge( (array) $bp_classes, (array) $wp_classes ) );
 
 
 
1786
 
1787
  return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes );
1788
  }
1789
  add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 );
1790
 
1791
+ /**
1792
+ * Sort BuddyPress nav menu items by their position property.
1793
+ *
1794
+ * This is an internal convenience function and it will probably be removed in a later release. Do not use.
1795
+ *
1796
+ * @access private
1797
+ * @param array $a First item
1798
+ * @param array $b Second item
1799
+ * @return int Returns an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
1800
+ * @since BuddyPress (1.7)
1801
+ */
1802
+ function _bp_nav_menu_sort( $a, $b ) {
1803
+ if ( $a["position"] == $b["position"] )
1804
+ return 0;
1805
+
1806
+ else if ( $a["position"] < $b["position"] )
1807
+ return -1;
1808
+
1809
+ else
1810
+ return 1;
1811
+ }
1812
+
1813
+ /**
1814
+ * Get an array of all the items registered in the primary and secondary BuddyPress navigation menus
1815
+ *
1816
+ * @return array
1817
+ * @since BuddyPress (1.7)
1818
+ */
1819
+ function bp_get_nav_menu_items() {
1820
+ $menus = $selected_menus = array();
1821
+
1822
+ // Get the second level menus
1823
+ foreach ( (array) buddypress()->bp_options_nav as $parent_menu => $sub_menus ) {
1824
+
1825
+ // The root menu's ID is "xprofile", but the Profile submenus are using "profile". See BP_Core::setup_nav().
1826
+ if ( 'profile' == $parent_menu )
1827
+ $parent_menu = 'xprofile';
1828
+
1829
+ // Sort the items in this menu's navigation by their position property
1830
+ $second_level_menus = (array) $sub_menus;
1831
+ usort( $second_level_menus, '_bp_nav_menu_sort' );
1832
+
1833
+ // Iterate through the second level menus
1834
+ foreach( $second_level_menus as $sub_nav ) {
1835
+
1836
+ // Skip items we don't have access to
1837
+ if ( ! $sub_nav['user_has_access'] )
1838
+ continue;
1839
+
1840
+ // Add this menu
1841
+ $menu = new stdClass;
1842
+ $menu->class = array();
1843
+ $menu->css_id = $sub_nav['css_id'];
1844
+ $menu->link = $sub_nav['link'];
1845
+ $menu->name = $sub_nav['name'];
1846
+ $menu->parent = $parent_menu; // Associate this sub nav with a top-level menu
1847
+
1848
+ // If we're viewing this item's screen, record that we need to mark its parent menu to be selected
1849
+ if ( $sub_nav['slug'] == bp_current_action() ) {
1850
+ $menu->class = array( 'current-menu-item' );
1851
+ $selected_menus[] = $parent_menu;
1852
+ }
1853
+
1854
+ $menus[] = $menu;
1855
+ }
1856
+ }
1857
+
1858
+ // Get the top-level menu parts (Friends, Groups, etc) and sort by their position property
1859
+ $top_level_menus = (array) buddypress()->bp_nav;
1860
+ usort( $top_level_menus, '_bp_nav_menu_sort' );
1861
+
1862
+ // Iterate through the top-level menus
1863
+ foreach ( $top_level_menus as $nav ) {
1864
+
1865
+ // Skip items marked as user-specific if you're not on your own profile
1866
+ if ( ! $nav['show_for_displayed_user'] && ! bp_core_can_edit_settings() )
1867
+ continue;
1868
+
1869
+ // Get the correct menu link. See http://buddypress.trac.wordpress.org/ticket/4624
1870
+ $link = bp_loggedin_user_domain() ? str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $nav['link'] ) : trailingslashit( bp_displayed_user_domain() . $nav['link'] );
1871
+
1872
+ // Add this menu
1873
+ $menu = new stdClass;
1874
+ $menu->class = array();
1875
+ $menu->css_id = $nav['css_id'];
1876
+ $menu->link = $link;
1877
+ $menu->name = $nav['name'];
1878
+ $menu->parent = 0;
1879
+
1880
+ // Check if we need to mark this menu as selected
1881
+ if ( in_array( $nav['css_id'], $selected_menus ) )
1882
+ $menu->class = array( 'current-menu-parent' );
1883
+
1884
+ $menus[] = $menu;
1885
+ }
1886
+
1887
+ return apply_filters( 'bp_get_nav_menu_items', $menus );
1888
+ }
1889
+
1890
+ /**
1891
+ * Displays a navigation menu.
1892
+ *
1893
+ * @param string|array $args Optional arguments:
1894
+ * before - Text before the link text.
1895
+ * container - Whether to wrap the ul, and what to wrap it with. Defaults to div.
1896
+ * container_class - The class that is applied to the container. Defaults to 'menu-bp-container'.
1897
+ * container_id - The ID that is applied to the container. Defaults to blank.
1898
+ * depth - How many levels of the hierarchy are to be included. 0 means all. Defaults to 0.
1899
+ * echo - Whether to echo the menu or return it. Defaults to echo.
1900
+ * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to false (no fallback).
1901
+ * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders.
1902
+ * link_after - Text after the link.
1903
+ * link_before - Text before the link.
1904
+ * menu_class - CSS class to use for the ul element which forms the menu. Defaults to 'menu'.
1905
+ * menu_id - The ID that is applied to the ul element which forms the menu. Defaults to 'menu-bp', incremented.
1906
+ * walker - Allows a custom walker to be specified. Defaults to 'BP_Walker_Nav_Menu'.
1907
+ * @since BuddyPress (1.7)
1908
+ */
1909
+ function bp_nav_menu( $args = array() ) {
1910
+ static $menu_id_slugs = array();
1911
+
1912
+ $defaults = array(
1913
+ 'after' => '',
1914
+ 'before' => '',
1915
+ 'container' => 'div',
1916
+ 'container_class' => '',
1917
+ 'container_id' => '',
1918
+ 'depth' => 0,
1919
+ 'echo' => true,
1920
+ 'fallback_cb' => false,
1921
+ 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
1922
+ 'link_after' => '',
1923
+ 'link_before' => '',
1924
+ 'menu_class' => 'menu',
1925
+ 'menu_id' => '',
1926
+ 'walker' => '',
1927
+ );
1928
+ $args = wp_parse_args( $args, $defaults );
1929
+ $args = apply_filters( 'bp_nav_menu_args', $args );
1930
+ $args = (object) $args;
1931
+
1932
+ $items = $nav_menu = '';
1933
+ $show_container = false;
1934
+
1935
+ // Create custom walker if one wasn't set
1936
+ if ( empty( $args->walker ) )
1937
+ $args->walker = new BP_Walker_Nav_Menu;
1938
+
1939
+ // Sanitise values for class and ID
1940
+ $args->container_class = sanitize_html_class( $args->container_class );
1941
+ $args->container_id = sanitize_html_class( $args->container_id );
1942
+
1943
+ // Whether to wrap the ul, and what to wrap it with
1944
+ if ( $args->container ) {
1945
+ $allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav', ) );
1946
+
1947
+ if ( in_array( $args->container, $allowed_tags ) ) {
1948
+ $show_container = true;
1949
+
1950
+ $class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-bp-container"';
1951
+ $id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : '';
1952
+ $nav_menu .= '<' . $args->container . $id . $class . '>';
1953
+ }
1954
+ }
1955
+
1956
+ // Get the BuddyPress menu items
1957
+ $menu_items = apply_filters( 'bp_nav_menu_objects', bp_get_nav_menu_items(), $args );
1958
+ $items = walk_nav_menu_tree( $menu_items, $args->depth, $args );
1959
+ unset( $menu_items );
1960
+
1961
+ // Set the ID that is applied to the ul element which forms the menu.
1962
+ if ( ! empty( $args->menu_id ) ) {
1963
+ $wrap_id = $args->menu_id;
1964
+
1965
+ } else {
1966
+ $wrap_id = 'menu-bp';
1967
+
1968
+ // If a specific ID wasn't requested, and there are multiple menus on the same screen, make sure the autogenerated ID is unique
1969
+ while ( in_array( $wrap_id, $menu_id_slugs ) ) {
1970
+ if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) )
1971
+ $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
1972
+ else
1973
+ $wrap_id = $wrap_id . '-1';
1974
+ }
1975
+ }
1976
+ $menu_id_slugs[] = $wrap_id;
1977
+
1978
+ // Allow plugins to hook into the menu to add their own <li>'s
1979
+ $items = apply_filters( 'bp_nav_menu_items', $items, $args );
1980
+
1981
+ // Build the output
1982
+ $wrap_class = $args->menu_class ? $args->menu_class : '';
1983
+ $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );
1984
+ unset( $items );
1985
+
1986
+ // If we've wrapped the ul, close it
1987
+ if ( $show_container )
1988
+ $nav_menu .= '</' . $args->container . '>';
1989
+
1990
+ // Final chance to modify output
1991
+ $nav_menu = apply_filters( 'bp_nav_menu', $nav_menu, $args );
1992
+
1993
+ if ( $args->echo )
1994
+ echo $nav_menu;
1995
+ else
1996
+ return $nav_menu;
1997
+ }
bp-core/bp-core-theme-compatibility.php ADDED
@@ -0,0 +1,697 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * BuddyPress Core Theme Compatibility
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ThemeCompatibility
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ /** Theme Compat **************************************************************/
14
+
15
+ /**
16
+ * What follows is an attempt at intercepting the natural page load process
17
+ * to replace the_content() with the appropriate BuddyPress content.
18
+ *
19
+ * To do this, BuddyPress does several direct manipulations of global variables
20
+ * and forces them to do what they are not supposed to be doing.
21
+ *
22
+ * Don't try anything you're about to witness here, at home. Ever.
23
+ */
24
+
25
+ /** Base Class ****************************************************************/
26
+
27
+ /**
28
+ * Theme Compatibility base class
29
+ *
30
+ * This is only intended to be extended, and is included here as a basic guide
31
+ * for future Theme Packs to use. @link BP_Legacy is a good example of
32
+ * extending this class.
33
+ *
34
+ * @since BuddyPress (1.7)
35
+ * @todo We should probably do something similar to BP_Component::start()
36
+ */
37
+ class BP_Theme_Compat {
38
+
39
+ /**
40
+ * Should be like:
41
+ *
42
+ * array(
43
+ * 'id' => ID of the theme (should be unique)
44
+ * 'name' => Name of the theme (should match style.css)
45
+ * 'version' => Theme version for cache busting scripts and styling
46
+ * 'dir' => Path to theme
47
+ * 'url' => URL to theme
48
+ * );
49
+ * @var array
50
+ */
51
+ protected $_data = array();
52
+
53
+ /**
54
+ * Pass the $properties to the object on creation.
55
+ *
56
+ * @since BuddyPress (1.7)
57
+ * @param array $properties
58
+ */
59
+ public function __construct( Array $properties = array() ) {
60
+ $this->_data = $properties;
61
+ }
62
+
63
+
64
+ /**
65
+ * Themes shoud use this method in their constructor.
66
+ *
67
+ * In this method, we check all types of conditions where theme compatibility
68
+ * should *not* run.
69
+ *
70
+ * If we pass all conditions, then we setup some additional methods to use.
71
+ *
72
+ * @since BuddyPress (1.7)
73
+ */
74
+ protected function start() {
75
+
76
+ // If the theme supports 'buddypress', bail.
77
+ if ( current_theme_supports( 'buddypress' ) ) {
78
+ return;
79
+
80
+ // If the theme doesn't support BP, do some additional checks
81
+ } else {
82
+ // Bail if theme is a derivative of bp-default
83
+ if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) {
84
+ return;
85
+ }
86
+
87
+ // Bruteforce check for a BP template
88
+ // Examples are clones of bp-default
89
+ if ( locate_template( 'members/members-loop.php', false, false ) ) {
90
+ return;
91
+ }
92
+ }
93
+
94
+ // Setup methods
95
+ $this->setup_globals();
96
+ $this->setup_actions();
97
+ }
98
+
99
+ /**
100
+ * Meant to be extended in your class.
101
+ *
102
+ * @since BuddyPress (1.7)
103
+ */
104
+ protected function setup_globals() {}
105
+
106
+ /**
107
+ * Meant to be extended in your class.
108
+ *
109
+ * @since BuddyPress (1.7)
110
+ */
111
+ protected function setup_actions() {}
112
+
113
+ /**
114
+ * Set a theme's property.
115
+ *
116
+ * @since BuddyPress (1.7)
117
+ * @param string $property
118
+ * @param mixed $value
119
+ * @return mixed
120
+ */
121
+ public function __set( $property, $value ) {
122
+ return $this->_data[$property] = $value;
123
+ }
124
+
125
+ /**
126
+ * Get a theme's property.
127
+ *
128
+ * @since BuddyPress (1.7)
129
+ * @param string $property
130
+ * @param mixed $value
131
+ * @return mixed
132
+ */
133
+ public function __get( $property ) {
134
+ return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : '';
135
+ }
136
+ }
137
+
138
+ /** Functions *****************************************************************/
139
+
140
+ /**
141
+ * Setup the default theme compat theme
142
+ *
143
+ * @since BuddyPress (1.7)
144
+ * @param BP_Theme_Compat $theme
145
+ */
146
+ function bp_setup_theme_compat( $theme = '' ) {
147
+ $bp = buddypress();
148
+
149
+ // Make sure theme package is available, set to default if not
150
+ if ( ! isset( $bp->theme_compat->packages[$theme] ) || ! is_a( $bp->theme_compat->packages[$theme], 'BP_Theme_Compat' ) ) {
151
+ $theme = 'legacy';
152
+ }
153
+
154
+ // Set the active theme compat theme
155
+ $bp->theme_compat->theme = $bp->theme_compat->packages[$theme];
156
+ }
157
+
158
+ /**
159
+ * Gets the name of the BuddyPress compatable theme used, in the event the
160
+ * currently active WordPress theme does not explicitly support BuddyPress.
161
+ * This can be filtered or set manually. Tricky theme authors can override the
162
+ * default and include their own BuddyPress compatability layers for their themes.
163
+ *
164
+ * @since BuddyPress (1.7)
165
+ * @uses apply_filters()
166
+ * @return string
167
+ */
168
+ function bp_get_theme_compat_id() {
169
+ return apply_filters( 'bp_get_theme_compat_id', buddypress()->theme_compat->theme->id );
170
+ }
171
+
172
+ /**
173
+ * Gets the name of the BuddyPress compatable theme used, in the event the
174
+ * currently active WordPress theme does not explicitly support BuddyPress.
175
+ * This can be filtered or set manually. Tricky theme authors can override the
176
+ * default and include their own BuddyPress compatability layers for their themes.
177
+ *
178
+ * @since BuddyPress (1.7)
179
+ * @uses apply_filters()
180
+ * @return string
181
+ */
182
+ function bp_get_theme_compat_name() {
183
+ return apply_filters( 'bp_get_theme_compat_name', buddypress()->theme_compat->theme->name );
184
+ }
185
+
186
+ /**
187
+ * Gets the version of the BuddyPress compatable theme used, in the event the
188
+ * currently active WordPress theme does not explicitly support BuddyPress.
189
+ * This can be filtered or set manually. Tricky theme authors can override the
190
+ * default and include their own BuddyPress compatability layers for their themes.
191
+ *
192
+ * @since BuddyPress (1.7)
193
+ * @uses apply_filters()
194
+ * @return string
195
+ */
196
+ function bp_get_theme_compat_version() {
197
+ return apply_filters( 'bp_get_theme_compat_version', buddypress()->theme_compat->theme->version );
198
+ }
199
+
200
+ /**
201
+ * Gets the BuddyPress compatable theme used in the event the currently active
202
+ * WordPress theme does not explicitly support BuddyPress. This can be filtered,
203
+ * or set manually. Tricky theme authors can override the default and include
204
+ * their own BuddyPress compatability layers for their themes.
205
+ *
206
+ * @since BuddyPress (1.7)
207
+ * @uses apply_filters()
208
+ * @return string
209
+ */
210
+ function bp_get_theme_compat_dir() {
211
+ return apply_filters( 'bp_get_theme_compat_dir', buddypress()->theme_compat->theme->dir );
212
+ }
213
+
214
+ /**
215
+ * Gets the BuddyPress compatable theme used in the event the currently active
216
+ * WordPress theme does not explicitly support BuddyPress. This can be filtered,
217
+ * or set manually. Tricky theme authors can override the default and include
218
+ * their own BuddyPress compatability layers for their themes.
219
+ *
220
+ * @since BuddyPress (1.7)
221
+ * @uses apply_filters()
222
+ * @return string
223
+ */
224
+ function bp_get_theme_compat_url() {
225
+ return apply_filters( 'bp_get_theme_compat_url', buddypress()->theme_compat->theme->url );
226
+ }
227
+
228
+ /**
229
+ * Gets true/false if the current, loaded page uses theme compatibility
230
+ *
231
+ * @since BuddyPress (1.7)
232
+ * @return bool
233
+ */
234
+ function bp_is_theme_compat_active() {
235
+ $bp = buddypress();
236
+
237
+ if ( empty( $bp->theme_compat->active ) )
238
+ return false;
239
+
240
+ return $bp->theme_compat->active;
241
+ }
242
+
243
+ /**
244
+ * Sets true/false if page is currently inside theme compatibility
245
+ *
246
+ * @since BuddyPress (1.7)
247
+ * @param bool $set
248
+ * @return bool
249
+ */
250
+ function bp_set_theme_compat_active( $set = true ) {
251
+ buddypress()->theme_compat->active = $set;
252
+
253
+ return (bool) buddypress()->theme_compat->active;
254
+ }
255
+
256
+ /**
257
+ * Set the theme compat templates global
258
+ *
259
+ * Stash possible template files for the current query. Useful if plugins want
260
+ * to override them, or see what files are being scanned for inclusion.
261
+ *
262
+ * @since BuddyPress (1.7)
263
+ */
264
+ function bp_set_theme_compat_templates( $templates = array() ) {
265
+ buddypress()->theme_compat->templates = $templates;
266
+
267
+ return buddypress()->theme_compat->templates;
268
+ }
269
+
270
+ /**
271
+ * Set the theme compat template global
272
+ *
273
+ * Stash the template file for the current query. Useful if plugins want
274
+ * to override it, or see what file is being included.
275
+ *
276
+ * @since BuddyPress (1.7)
277
+ */
278
+ function bp_set_theme_compat_template( $template = '' ) {
279
+ buddypress()->theme_compat->template = $template;
280
+
281
+ return buddypress()->theme_compat->template;
282
+ }
283
+
284
+ /**
285
+ * Set the theme compat original_template global
286
+ *
287
+ * Stash the original template file for the current query. Useful for checking
288
+ * if BuddyPress was able to find a more appropriate template.
289
+ *
290
+ * @since BuddyPress (1.7)
291
+ */
292
+ function bp_set_theme_compat_original_template( $template = '' ) {
293
+ buddypress()->theme_compat->original_template = $template;
294
+
295
+ return buddypress()->theme_compat->original_template;
296
+ }
297
+
298
+ /**
299
+ * Set the theme compat original_template global
300
+ *
301
+ * Stash the original template file for the current query. Useful for checking
302
+ * if BuddyPress was able to find a more appropriate template.
303
+ *
304
+ * @since BuddyPress (1.7)
305
+ */
306
+ function bp_is_theme_compat_original_template( $template = '' ) {
307
+ $bp = buddypress();
308
+
309
+ if ( empty( $bp->theme_compat->original_template ) )
310
+ return false;
311
+
312
+ return (bool) ( $bp->theme_compat->original_template == $template );
313
+ }
314
+
315
+ /**
316
+ * Register a new BuddyPress theme package to the active theme packages array
317
+ *
318
+ * @since BuddyPress (1.7)
319
+ * @param array $theme
320
+ */
321
+ function bp_register_theme_package( $theme = array(), $override = true ) {
322
+
323
+ // Create new BP_Theme_Compat object from the $theme array
324
+ if ( is_array( $theme ) )
325
+ $theme = new BP_Theme_Compat( $theme );
326
+
327
+ // Bail if $theme isn't a proper object
328
+ if ( ! is_a( $theme, 'BP_Theme_Compat' ) )
329
+ return;
330
+
331
+ // Load up BuddyPress
332
+ $bp = buddypress();
333
+
334
+ // Only override if the flag is set and not previously registered
335
+ if ( empty( $bp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) {
336
+ $bp->theme_compat->packages[$theme->id] = $theme;
337
+ }
338
+ }
339
+ /**
340
+ * This fun little function fills up some WordPress globals with dummy data to
341
+ * stop your average page template from complaining about it missing.
342
+ *
343
+ * @since BuddyPress (1.7)
344
+ * @global WP_Query $wp_query
345
+ * @global object $post
346
+ * @param array $args
347
+ */
348
+ function bp_theme_compat_reset_post( $args = array() ) {
349
+ global $wp_query, $post;
350
+
351
+ // Default arguments
352
+ $defaults = array(
353
+ 'ID' => -9999,
354
+ 'post_status' => 'publish',
355
+ 'post_author' => 0,
356
+ 'post_parent' => 0,
357
+ 'post_type' => 'page',
358
+ 'post_date' => 0,
359
+ 'post_date_gmt' => 0,
360
+ 'post_modified' => 0,
361
+ 'post_modified_gmt' => 0,
362
+ 'post_content' => '',
363
+ 'post_title' => '',
364
+ 'post_category' => 0,
365
+ 'post_excerpt' => '',
366
+ 'post_content_filtered' => '',
367
+ 'post_mime_type' => '',
368
+ 'post_password' => '',
369
+ 'post_name' => '',
370
+ 'guid' => '',
371
+ 'menu_order' => 0,
372
+ 'pinged' => '',
373
+ 'to_ping' => '',
374
+ 'ping_status' => '',
375
+ 'comment_status' => 'closed',
376
+ 'comment_count' => 0,
377
+
378
+ 'is_404' => false,
379
+ 'is_page' => false,
380
+ 'is_single' => false,
381
+ 'is_archive' => false,
382
+ 'is_tax' => false,
383
+ );
384
+
385
+ // Switch defaults if post is set
386
+ if ( isset( $wp_query->post ) ) {
387
+ $defaults = array(
388
+ 'ID' => $wp_query->post->ID,
389
+ 'post_status' => $wp_query->post->post_status,
390
+ 'post_author' => $wp_query->post->post_author,
391
+ 'post_parent' => $wp_query->post->post_parent,
392
+ 'post_type' => $wp_query->post->post_type,
393
+ 'post_date' => $wp_query->post->post_date,
394
+ 'post_date_gmt' => $wp_query->post->post_date_gmt,
395
+ 'post_modified' => $wp_query->post->post_modified,
396
+ 'post_modified_gmt' => $wp_query->post->post_modified_gmt,
397
+ 'post_content' => $wp_query->post->post_content,
398
+ 'post_title' => $wp_query->post->post_title,
399
+ 'post_excerpt' => $wp_query->post->post_excerpt,
400
+ 'post_content_filtered' => $wp_query->post->post_content_filtered,
401
+ 'post_mime_type' => $wp_query->post->post_mime_type,
402
+ 'post_password' => $wp_query->post->post_password,
403
+ 'post_name' => $wp_query->post->post_name,
404
+ 'guid' => $wp_query->post->guid,
405
+ 'menu_order' => $wp_query->post->menu_order,
406
+ 'pinged' => $wp_query->post->pinged,
407
+ 'to_ping' => $wp_query->post->to_ping,
408
+ 'ping_status' => $wp_query->post->ping_status,
409
+ 'comment_status' => $wp_query->post->comment_status,
410
+ 'comment_count' => $wp_query->post->comment_count,
411
+
412
+ 'is_404' => false,
413
+ 'is_page' => false,
414
+ 'is_single' => false,
415
+ 'is_archive' => false,
416
+ 'is_tax' => false,
417
+ );
418
+ }
419
+ $dummy = wp_parse_args( $args, $defaults ); //, 'theme_compat_reset_post' );
420
+
421
+ // Clear out the post related globals
422
+ unset( $wp_query->posts );
423
+ unset( $wp_query->post );
424
+ unset( $post );
425
+
426
+ // Setup the dummy post object
427
+ $wp_query->post = new stdClass;
428
+ $wp_query->post->ID = $dummy['ID'];
429
+ $wp_query->post->post_status = $dummy['post_status'];
430
+ $wp_query->post->post_author = $dummy['post_author'];
431
+ $wp_query->post->post_parent = $dummy['post_parent'];
432
+ $wp_query->post->post_type = $dummy['post_type'];
433
+ $wp_query->post->post_date = $dummy['post_date'];
434
+ $wp_query->post->post_date_gmt = $dummy['post_date_gmt'];
435
+ $wp_query->post->post_modified = $dummy['post_modified'];
436
+ $wp_query->post->post_modified_gmt = $dummy['post_modified_gmt'];
437
+ $wp_query->post->post_content = $dummy['post_content'];
438
+ $wp_query->post->post_title = $dummy['post_title'];
439
+ $wp_query->post->post_excerpt = $dummy['post_excerpt'];
440
+ $wp_query->post->post_content_filtered = $dummy['post_content_filtered'];
441
+ $wp_query->post->post_mime_type = $dummy['post_mime_type'];
442
+ $wp_query->post->post_password = $dummy['post_password'];
443
+ $wp_query->post->post_name = $dummy['post_name'];
444
+ $wp_query->post->guid = $dummy['guid'];
445
+ $wp_query->post->menu_order = $dummy['menu_order'];
446
+ $wp_query->post->pinged = $dummy['pinged'];
447
+ $wp_query->post->to_ping = $dummy['to_ping'];
448
+ $wp_query->post->ping_status = $dummy['ping_status'];
449
+ $wp_query->post->comment_status = $dummy['comment_status'];
450
+ $wp_query->post->comment_count = $dummy['comment_count'];
451
+
452
+ // Set the $post global
453
+ $post = $wp_query->post;
454
+
455
+ // Setup the dummy post loop
456
+ $wp_query->posts[0] = $wp_query->post;
457
+
458
+ // Prevent comments form from appearing
459
+ $wp_query->post_count = 1;
460
+ $wp_query->is_404 = $dummy['is_404'];
461
+ $wp_query->is_page = $dummy['is_page'];
462
+ $wp_query->is_single = $dummy['is_single'];
463
+ $wp_query->is_archive = $dummy['is_archive'];
464
+ $wp_query->is_tax = $dummy['is_tax'];
465
+
466
+ // If we are resetting a post, we are in theme compat
467
+ bp_set_theme_compat_active();
468
+ }
469
+
470
+ /**
471
+ * Reset main query vars and filter 'the_content' to output a BuddyPress
472
+ * template part as needed.
473
+ *
474
+ * @since BuddyPress (1.7)
475
+ *
476
+ * @param string $template
477
+ * @uses bp_is_single_user() To check if page is single user
478
+ * @uses bp_get_single_user_template() To get user template
479
+ * @uses bp_is_single_user_edit() To check if page is single user edit
480
+ * @uses bp_get_single_user_edit_template() To get user edit template
481
+ * @uses bp_is_single_view() To check if page is single view
482
+ * @uses bp_get_single_view_template() To get view template
483
+ * @uses bp_is_forum_edit() To check if page is forum edit
484
+ * @uses bp_get_forum_edit_template() To get forum edit template
485
+ * @uses bp_is_topic_merge() To check if page is topic merge
486
+ * @uses bp_get_topic_merge_template() To get topic merge template
487
+ * @uses bp_is_topic_split() To check if page is topic split
488
+ * @uses bp_get_topic_split_template() To get topic split template
489
+ * @uses bp_is_topic_edit() To check if page is topic edit
490
+ * @uses bp_get_topic_edit_template() To get topic edit template
491
+ * @uses bp_is_reply_edit() To check if page is reply edit
492
+ * @uses bp_get_reply_edit_template() To get reply edit template
493
+ * @uses bp_set_theme_compat_template() To set the global theme compat template
494
+ */
495
+ function bp_template_include_theme_compat( $template = '' ) {
496
+
497
+ /**
498
+ * Use this action to execute code that will communicate to BuddyPress's
499
+ * theme compatibility layer whether or not we're replacing the_content()
500
+ * with some other template part.
501
+ */
502
+ do_action( 'bp_template_include_reset_dummy_post_data' );
503
+
504
+ // Bail if the template already matches a BuddyPress template
505
+ if ( !empty( buddypress()->theme_compat->found_template ) )
506
+ return $template;
507
+
508
+ /**
509
+ * If we are relying on BuddyPress's built in theme compatibility to load
510
+ * the proper content, we need to intercept the_content, replace the
511
+ * output, and display ours instead.
512
+ *
513
+ * To do this, we first remove all filters from 'the_content' and hook
514
+ * our own function into it, which runs a series of checks to determine
515
+ * the context, and then uses the built in shortcodes to output the
516
+ * correct results from inside an output buffer.
517
+ *
518
+ * Uses bp_get_theme_compat_templates() to provide fall-backs that
519
+ * should be coded without superfluous mark-up and logic (prev/next
520
+ * navigation, comments, date/time, etc...)
521
+ */
522
+ if ( bp_is_theme_compat_active() ) {
523
+
524
+ // Remove all filters from the_content
525
+ bp_remove_all_filters( 'the_content' );
526
+
527
+ // Add a filter on the_content late, which we will later remove
528
+ if ( ! has_filter( 'the_content', 'bp_replace_the_content' ) ) {
529
+ add_filter( 'the_content', 'bp_replace_the_content' );
530
+ }
531
+
532
+ // Add BuddyPress's head action to wp_head
533
+ if ( ! has_action( 'wp_head', 'bp_head' ) ) {
534
+ add_action( 'wp_head', 'bp_head' );
535
+ }
536
+
537
+ // Find the appropriate template file
538
+ $template = bp_get_theme_compat_templates();
539
+ }
540
+
541
+ return apply_filters( 'bp_template_include_theme_compat', $template );
542
+ }
543
+
544
+ /**
545
+ * Replaces the_content() if the post_type being displayed is one that would
546
+ * normally be handled by BuddyPress, but proper single page templates do not
547
+ * exist in the currently active theme.
548
+ *
549
+ * @since BuddyPress (1.7)
550
+ * @param string $content
551
+ * @return type
552
+ */
553
+ function bp_replace_the_content( $content = '' ) {
554
+
555
+ if ( ! in_the_loop() )
556
+ return $content;
557
+
558
+ $new_content = apply_filters( 'bp_replace_the_content', $content );
559
+
560
+ // Juggle the content around and try to prevent unsightly comments
561
+ if ( !empty( $new_content ) && ( $new_content != $content ) ) {
562
+
563
+ // Set the content to be the new content
564
+ $content = $new_content;
565
+
566
+ // Clean up after ourselves
567
+ unset( $new_content );
568
+
569
+ // Reset the $post global
570
+ wp_reset_postdata();
571
+ }
572
+
573
+ // Return possibly hi-jacked content
574
+ return $content;
575
+ }
576
+
577
+ /** Filters *******************************************************************/
578
+
579
+ /**
580
+ * Removes all filters from a WordPress filter, and stashes them in the $bp
581
+ * global in the event they need to be restored later.
582
+ *
583
+ * @since BuddyPress (1.7)
584
+ * @global WP_filter $wp_filter
585
+ * @global array $merged_filters
586
+ * @param string $tag
587
+ * @param int $priority
588
+ * @return bool
589
+ */
590
+ function bp_remove_all_filters( $tag, $priority = false ) {
591
+ global $wp_filter, $merged_filters;
592
+
593
+ $bp = buddypress();
594
+
595
+ // Filters exist
596
+ if ( isset( $wp_filter[$tag] ) ) {
597
+
598
+ // Filters exist in this priority
599
+ if ( !empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) {
600
+
601
+ // Store filters in a backup
602
+ $bp->filters->wp_filter[$tag][$priority] = $wp_filter[$tag][$priority];
603
+
604
+ // Unset the filters
605
+ unset( $wp_filter[$tag][$priority] );
606
+
607
+ // Priority is empty
608
+ } else {
609
+
610
+ // Store filters in a backup
611
+ $bp->filters->wp_filter[$tag] = $wp_filter[$tag];
612
+
613
+ // Unset the filters
614
+ unset( $wp_filter[$tag] );
615
+ }
616
+ }
617
+
618
+ // Check merged filters
619
+ if ( isset( $merged_filters[$tag] ) ) {
620
+
621
+ // Store filters in a backup
622
+ $bp->filters->merged_filters[$tag] = $merged_filters[$tag];
623
+
624
+ // Unset the filters
625
+ unset( $merged_filters[$tag] );
626
+ }
627
+
628
+ return true;
629
+ }
630
+
631
+ /**
632
+ * Restores filters from the $bp global that were removed using
633
+ * bp_remove_all_filters()
634
+ *
635
+ * @since BuddyPress (1.7)
636
+ * @global WP_filter $wp_filter
637
+ * @global array $merged_filters
638
+ * @param string $tag
639
+ * @param int $priority
640
+ * @return bool
641
+ */
642
+ function bp_restore_all_filters( $tag, $priority = false ) {
643
+ global $wp_filter, $merged_filters;
644
+
645
+ $bp = buddypress();
646
+
647
+ // Filters exist
648
+ if ( isset( $bp->filters->wp_filter[$tag] ) ) {
649
+
650
+ // Filters exist in this priority
651
+ if ( !empty( $priority ) && isset( $bp->filters->wp_filter[$tag][$priority] ) ) {
652
+
653
+ // Store filters in a backup
654
+ $wp_filter[$tag][$priority] = $bp->filters->wp_filter[$tag][$priority];
655
+
656
+ // Unset the filters
657
+ unset( $bp->filters->wp_filter[$tag][$priority] );
658
+
659
+ // Priority is empty
660
+ } else {
661
+
662
+ // Store filters in a backup
663
+ $wp_filter[$tag] = $bp->filters->wp_filter[$tag];
664
+
665
+ // Unset the filters
666
+ unset( $bp->filters->wp_filter[$tag] );
667
+ }
668
+ }
669
+
670
+ // Check merged filters
671
+ if ( isset( $bp->filters->merged_filters[$tag] ) ) {
672
+
673
+ // Store filters in a backup
674
+ $merged_filters[$tag] = $bp->filters->merged_filters[$tag];
675
+
676
+ // Unset the filters
677
+ unset( $bp->filters->merged_filters[$tag] );
678
+ }
679
+
680
+ return true;
681
+ }
682
+
683
+ /**
684
+ * Force comments_status to 'closed' for BuddyPress post types
685
+ *
686
+ * @since BuddyPress (1.7)
687
+ * @param bool $open True if open, false if closed
688
+ * @param int $post_id ID of the post to check
689
+ * @return bool True if open, false if closed
690
+ */
691
+ function bp_comments_open( $open, $post_id = 0 ) {
692
+
693
+ $retval = is_buddypress() ? false : $open;
694
+
695
+ // Allow override of the override
696
+ return apply_filters( 'bp_force_comment_status', $retval, $open, $post_id );
697
+ }
bp-core/bp-core-update.php CHANGED
@@ -10,6 +10,19 @@
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Compare the BuddyPress version to the DB version to determine if updating
15
  *
@@ -37,36 +50,43 @@ function bp_is_update() {
37
  *
38
  * @since BuddyPress (1.6)
39
  *
40
- * @global BuddyPress $bp
41
  * @return bool True if activating BuddyPress, false if not
42
  */
43
  function bp_is_activation( $basename = '' ) {
44
- global $bp;
 
45
 
46
- // Baif if action or plugin are empty
47
- if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) )
48
- return false;
 
 
49
 
50
  // Bail if not activating
51
- if ( 'activate' !== $_GET['action'] )
52
  return false;
 
53
 
54
- // The plugin being activated
55
- $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : '';
 
 
 
 
56
 
57
  // Set basename if empty
58
- if ( empty( $basename ) && !empty( $bp->basename ) )
59
  $basename = $bp->basename;
 
60
 
61
  // Bail if no basename
62
- if ( empty( $basename ) )
63
- return false;
64
-
65
- // Bail if plugin is not BuddyPress
66
- if ( $basename !== $plugin )
67
  return false;
 
68
 
69
- return true;
 
70
  }
71
 
72
  /**
@@ -74,36 +94,43 @@ function bp_is_activation( $basename = '' ) {
74
  *
75
  * @since BuddyPress (1.6)
76
  *
77
- * @global BuddyPress $bp
78
  * @return bool True if deactivating BuddyPress, false if not
79
  */
80
  function bp_is_deactivation( $basename = '' ) {
81
- global $bp;
 
82
 
83
- // Baif if action or plugin are empty
84
- if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) )
85
- return false;
 
 
86
 
87
  // Bail if not deactivating
88
- if ( 'deactivate' !== $_GET['action'] )
89
  return false;
 
90
 
91
- // The plugin being deactivated
92
- $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : '';
 
 
 
 
93
 
94
  // Set basename if empty
95
- if ( empty( $basename ) && !empty( $bp->basename ) )
96
  $basename = $bp->basename;
 
97
 
98
  // Bail if no basename
99
- if ( empty( $basename ) )
100
- return false;
101
-
102
- // Bail if plugin is not BuddyPress
103
- if ( $basename !== $plugin )
104
  return false;
 
105
 
106
- return true;
 
107
  }
108
 
109
  /**
@@ -116,31 +143,133 @@ function bp_is_deactivation( $basename = '' ) {
116
  * @uses bp_update_option() To update BuddyPress's database version
117
  */
118
  function bp_version_bump() {
119
- $db_version = bp_get_db_version();
120
- bp_update_option( '_bp_db_version', $db_version );
121
  }
122
 
123
  /**
124
  * Setup the BuddyPress updater
125
  *
126
  * @since BuddyPress (1.6)
127
- *
128
- * @uses BBP_Updater
129
  */
130
  function bp_setup_updater() {
131
 
132
  // Are we running an outdated version of BuddyPress?
133
- if ( bp_is_update() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
- // Bump the version
136
- bp_version_bump();
137
 
138
- // Run the deactivation function to wipe roles, caps, and rewrite rules
139
- bp_deactivation();
140
 
141
- // Run the activation function to reset roles, caps, and rewrite rules
142
- bp_activation();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
 
 
 
144
  }
145
 
146
  /** Activation Actions ********************************************************/
@@ -176,6 +305,14 @@ function bp_deactivation() {
176
  // Force refresh theme roots.
177
  delete_site_transient( 'theme_roots' );
178
 
 
 
 
 
 
 
 
 
179
  // Use as of (1.6)
180
  do_action( 'bp_deactivation' );
181
 
@@ -193,5 +330,3 @@ function bp_deactivation() {
193
  function bp_uninstall() {
194
  do_action( 'bp_uninstall' );
195
  }
196
-
197
- ?>
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
+ /**
14
+ * If there is no raw DB version, this is the first installation
15
+ *
16
+ * @since BuddyPress (1.7)
17
+ *
18
+ * @uses get_option()
19
+ * @uses bp_get_db_version() To get BuddyPress's database version
20
+ * @return bool True if update, False if not
21
+ */
22
+ function bp_is_install() {
23
+ return ! bp_get_db_version_raw();
24
+ }
25
+
26
  /**
27
  * Compare the BuddyPress version to the DB version to determine if updating
28
  *
50
  *
51
  * @since BuddyPress (1.6)
52
  *
53
+ * @uses buddypress()
54
  * @return bool True if activating BuddyPress, false if not
55
  */
56
  function bp_is_activation( $basename = '' ) {
57
+ $bp = buddypress();
58
+ $action = false;
59
 
60
+ if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
61
+ $action = $_REQUEST['action'];
62
+ } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
63
+ $action = $_REQUEST['action2'];
64
+ }
65
 
66
  // Bail if not activating
67
+ if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) {
68
  return false;
69
+ }
70
 
71
+ // The plugin(s) being activated
72
+ if ( $action == 'activate' ) {
73
+ $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
74
+ } else {
75
+ $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
76
+ }
77
 
78
  // Set basename if empty
79
+ if ( empty( $basename ) && !empty( $bp->basename ) ) {
80
  $basename = $bp->basename;
81
+ }
82
 
83
  // Bail if no basename
84
+ if ( empty( $basename ) ) {
 
 
 
 
85
  return false;
86
+ }
87
 
88
+ // Is BuddyPress being activated?
89
+ return in_array( $basename, $plugins );
90
  }
91
 
92
  /**
94
  *
95
  * @since BuddyPress (1.6)
96
  *
97
+ * @uses buddypress()
98
  * @return bool True if deactivating BuddyPress, false if not
99
  */
100
  function bp_is_deactivation( $basename = '' ) {
101
+ $bp = buddypress();
102
+ $action = false;
103
 
104
+ if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
105
+ $action = $_REQUEST['action'];
106
+ } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
107
+ $action = $_REQUEST['action2'];
108
+ }
109
 
110
  // Bail if not deactivating
111
+ if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) {
112
  return false;
113
+ }
114
 
115
+ // The plugin(s) being deactivated
116
+ if ( 'deactivate' == $action ) {
117
+ $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
118
+ } else {
119
+ $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
120
+ }
121
 
122
  // Set basename if empty
123
+ if ( empty( $basename ) && !empty( $bp->basename ) ) {
124
  $basename = $bp->basename;
125
+ }
126
 
127
  // Bail if no basename
128
+ if ( empty( $basename ) ) {
 
 
 
 
129
  return false;
130
+ }
131
 
132
+ // Is bbPress being deactivated?
133
+ return in_array( $basename, $plugins );
134
  }
135
 
136
  /**
143
  * @uses bp_update_option() To update BuddyPress's database version
144
  */
145
  function bp_version_bump() {
146
+ bp_update_option( '_bp_db_version', bp_get_db_version() );
 
147
  }
148
 
149
  /**
150
  * Setup the BuddyPress updater
151
  *
152
  * @since BuddyPress (1.6)
 
 
153
  */
154
  function bp_setup_updater() {
155
 
156
  // Are we running an outdated version of BuddyPress?
157
+ if ( ! bp_is_update() )
158
+ return;
159
+
160
+ bp_version_updater();
161
+ }
162
+
163
+ /**
164
+ * BuddyPress's version updater looks at what the current database version is,
165
+ * and runs whatever other code is needed.
166
+ *
167
+ * This is most-often used when the data schema changes, but should also be used
168
+ * to correct issues with BuddyPress metadata silently on software update.
169
+ *
170
+ * @since BuddyPress (r4104)
171
+ */
172
+ function bp_version_updater() {
173
 
174
+ // Get the raw database version
175
+ $raw_db_version = (int) bp_get_db_version_raw();
176
 
177
+ $default_components = apply_filters( 'bp_new_install_default_components', array( 'activity' => 1, 'members' => 1, 'xprofile' => 1, ) );
178
+ require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' );
179
 
180
+ // Install BP schema and activate only Activity and XProfile
181
+ if ( bp_is_install() ) {
182
+
183
+ // Apply schema and set Activity and XProfile components as active
184
+ bp_core_install( $default_components );
185
+ bp_update_option( 'bp-active-components', $default_components );
186
+ bp_core_add_page_mappings( $default_components, 'delete' );
187
+
188
+ // Upgrades
189
+ } else {
190
+
191
+ // Run the schema install to update tables
192
+ bp_core_install();
193
+
194
+ // 1.5
195
+ if ( $raw_db_version < 1801 ) {
196
+ bp_update_to_1_5();
197
+ bp_core_add_page_mappings( $default_components, 'delete' );
198
+ }
199
+
200
+ // 1.6
201
+ if ( $raw_db_version < 6067 ) {
202
+ bp_update_to_1_6();
203
+ }
204
+ }
205
+
206
+ /** All done! *************************************************************/
207
+
208
+ // Bump the version
209
+ bp_version_bump();
210
+ }
211
+
212
+ /**
213
+ * Database update methods based on version numbers
214
+ *
215
+ * @since BuddyPress (1.7)
216
+ */
217
+ function bp_update_to_1_5() {
218
+
219
+ // Delete old database version options
220
+ delete_site_option( 'bp-activity-db-version' );
221
+ delete_site_option( 'bp-blogs-db-version' );
222
+ delete_site_option( 'bp-friends-db-version' );
223
+ delete_site_option( 'bp-groups-db-version' );
224
+ delete_site_option( 'bp-messages-db-version' );
225
+ delete_site_option( 'bp-xprofile-db-version' );
226
+ }
227
+
228
+ /**
229
+ * Database update methods based on version numbers
230
+ *
231
+ * @since BuddyPress (1.7)
232
+ */
233
+ function bp_update_to_1_6() {
234
+
235
+ // Delete possible site options
236
+ delete_site_option( 'bp-db-version' );
237
+ delete_site_option( '_bp_db_version' );
238
+ delete_site_option( 'bp-core-db-version' );
239
+ delete_site_option( '_bp-core-db-version' );
240
+
241
+ // Delete possible blog options
242
+ delete_blog_option( bp_get_root_blog_id(), 'bp-db-version' );
243
+ delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version' );
244
+ delete_site_option( bp_get_root_blog_id(), '_bp-core-db-version' );
245
+ delete_site_option( bp_get_root_blog_id(), '_bp_db_version' );
246
+ }
247
+
248
+ /**
249
+ * Redirect user to BuddyPress's What's New page on activation
250
+ *
251
+ * @since BuddyPress (1.7)
252
+ *
253
+ * @internal Used internally to redirect BuddyPress to the about page on activation
254
+ *
255
+ * @uses set_transient() To drop the activation transient for 30 seconds
256
+ *
257
+ * @return If bulk activation
258
+ */
259
+ function bp_add_activation_redirect() {
260
+
261
+ // Bail if activating from network, or bulk
262
+ if ( isset( $_GET['activate-multi'] ) )
263
+ return;
264
+
265
+ // Record that this is a new installation, so we show the right
266
+ // welcome message
267
+ if ( bp_is_install() ) {
268
+ set_transient( '_bp_is_new_install', true, 30 );
269
  }
270
+
271
+ // Add the transient to redirect
272
+ set_transient( '_bp_activation_redirect', true, 30 );
273
  }
274
 
275
  /** Activation Actions ********************************************************/
305
  // Force refresh theme roots.
306
  delete_site_transient( 'theme_roots' );
307
 
308
+ // Switch to WordPress's default theme if current parent or child theme
309
+ // depend on bp-default. This is to prevent white screens of doom.
310
+ if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) {
311
+ switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
312
+ update_option( 'template_root', get_raw_theme_root( WP_DEFAULT_THEME, true ) );
313
+ update_option( 'stylesheet_root', get_raw_theme_root( WP_DEFAULT_THEME, true ) );
314
+ }
315
+
316
  // Use as of (1.6)
317
  do_action( 'bp_deactivation' );
318
 
330
  function bp_uninstall() {
331
  do_action( 'bp_uninstall' );
332
  }
 
 
bp-core/bp-core-widgets.php CHANGED
@@ -15,15 +15,15 @@ add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
15
  class BP_Core_Members_Widget extends WP_Widget {
16
 
17
  function __construct() {
18
- $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ) );
19
- parent::__construct( false, $name = __( 'Members', 'buddypress' ), $widget_ops );
 
 
 
20
 
21
  if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
22
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
23
- wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.dev.js', array( 'jquery' ), bp_get_version() );
24
- } else {
25
- wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.js', array( 'jquery' ), bp_get_version() );
26
- }
27
  }
28
  }
29
 
@@ -42,7 +42,7 @@ class BP_Core_Members_Widget extends WP_Widget {
42
  . $title
43
  . $after_title; ?>
44
 
45
- <?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
46
  <div class="item-options" id="members-list-options">
47
  <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a>
48
  | <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a>
@@ -146,8 +146,11 @@ class BP_Core_Members_Widget extends WP_Widget {
146
  class BP_Core_Whos_Online_Widget extends WP_Widget {
147
 
148
  function __construct() {
149
- $widget_ops = array( 'description' => __( 'Avatars of users who are currently online', 'buddypress' ) );
150
- parent::__construct( false, $name = __( "Who's Online Avatars", 'buddypress' ), $widget_ops );
 
 
 
151
  }
152
 
153
  function widget($args, $instance) {
@@ -159,7 +162,7 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
159
  . $instance['title']
160
  . $after_title; ?>
161
 
162
- <?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
163
  <div class="avatar-block">
164
  <?php while ( bp_members() ) : bp_the_member(); ?>
165
  <div class="item-avatar">
@@ -210,8 +213,11 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
210
  class BP_Core_Recently_Active_Widget extends WP_Widget {
211
 
212
  function __construct() {
213
- $widget_ops = array( 'description' => __( 'Avatars of recently active members', 'buddypress' ) );
214
- parent::__construct( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ), $widget_ops );
 
 
 
215
  }
216
 
217
  function widget( $args, $instance ) {
@@ -223,7 +229,7 @@ class BP_Core_Recently_Active_Widget extends WP_Widget {
223
  . $instance['title']
224
  . $after_title; ?>
225
 
226
- <?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
227
  <div class="avatar-block">
228
  <?php while ( bp_members() ) : bp_the_member(); ?>
229
  <div class="item-avatar">
@@ -293,29 +299,26 @@ function bp_core_ajax_widget_members() {
293
  break;
294
  }
295
 
296
- if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=0' ) ) : ?>
297
  <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?>
298
- <div class="avatar-block">
299
- <?php while ( bp_members() ) : bp_the_member(); ?>
300
- <li class="vcard">
301
- <div class="item-avatar">
302
- <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
303
- </div>
304
-
305
- <div class="item">
306
- <div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
307
- <?php if ( 'active' == $type ) : ?>
308
- <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
309
- <?php elseif ( 'newest' == $type ) : ?>
310
- <div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div>
311
- <?php elseif ( bp_is_active( 'friends' ) ) : ?>
312
- <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
313
- <?php endif; ?>
314
- </div>
315
- </li>
316
-
317
- <?php endwhile; ?>
318
- </div>
319
 
320
  <?php else: ?>
321
  <?php echo "-1[[SPLIT]]<li>"; ?>
@@ -325,5 +328,3 @@ function bp_core_ajax_widget_members() {
325
  }
326
  add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
327
  add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' );
328
-
329
- ?>
15
  class BP_Core_Members_Widget extends WP_Widget {
16
 
17
  function __construct() {
18
+ $widget_ops = array(
19
+ 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ),
20
+ 'classname' => 'buddypress',
21
+ );
22
+ parent::__construct( false, $name = _x( '(BuddyPress) Members', 'widget name', 'buddypress' ), $widget_ops );
23
 
24
  if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
25
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
26
+ wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . "bp-core/js/widget-members{$min}.js", array( 'jquery' ), bp_get_version() );
 
 
 
27
  }
28
  }
29
 
42
  . $title
43
  . $after_title; ?>
44
 
45
+ <?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?>
46
  <div class="item-options" id="members-list-options">
47
  <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a>
48
  | <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a>
146
  class BP_Core_Whos_Online_Widget extends WP_Widget {
147
 
148
  function __construct() {
149
+ $widget_ops = array(
150
+ 'description' => __( 'Avatars of users who are currently online', 'buddypress' ),
151
+ 'classname' => 'buddypress',
152
+ );
153
+ parent::__construct( false, $name = _x( "(BuddyPress) Who's Online", 'widget name', 'buddypress' ), $widget_ops );
154
  }
155
 
156
  function widget($args, $instance) {
162
  . $instance['title']
163
  . $after_title; ?>
164
 
165
+ <?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?>
166
  <div class="avatar-block">
167
  <?php while ( bp_members() ) : bp_the_member(); ?>
168
  <div class="item-avatar">
213
  class BP_Core_Recently_Active_Widget extends WP_Widget {
214
 
215
  function __construct() {
216
+ $widget_ops = array(
217
+ 'description' => __( 'Avatars of recently active members', 'buddypress' ),
218
+ 'classname' => 'buddypress',
219
+ );
220
+ parent::__construct( false, $name = _x( '(BuddyPress) Recently Active Members', 'widget name', 'buddypress' ), $widget_ops );
221
  }
222
 
223
  function widget( $args, $instance ) {
229
  . $instance['title']
230
  . $after_title; ?>
231
 
232
+ <?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?>
233
  <div class="avatar-block">
234
  <?php while ( bp_members() ) : bp_the_member(); ?>
235
  <div class="item-avatar">
299
  break;
300
  }
301
 
302
+ if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=1' ) ) : ?>
303
  <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?>
304
+ <?php while ( bp_members() ) : bp_the_member(); ?>
305
+ <li class="vcard">
306
+ <div class="item-avatar">
307
+ <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
308
+ </div>
309
+
310
+ <div class="item">
311
+ <div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
312
+ <?php if ( 'active' == $type ) : ?>
313
+ <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
314
+ <?php elseif ( 'newest' == $type ) : ?>
315
+ <div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div>
316
+ <?php elseif ( bp_is_active( 'friends' ) ) : ?>
317
+ <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
318
+ <?php endif; ?>
319
+ </div>
320
+ </li>
321
+ <?php endwhile; ?>
 
 
 
322
 
323
  <?php else: ?>
324
  <?php echo "-1[[SPLIT]]<li>"; ?>
328
  }
329
  add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
330
  add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' );
 
 
bp-core/bp-core-wpabstraction.php CHANGED
@@ -170,5 +170,3 @@ if ( !function_exists( 'mb_strrpos' ) ) {
170
  }
171
  }
172
  }
173
-
174
- ?>
170
  }
171
  }
172
  }
 
 
bp-core/css/admin-bar-rtl.css CHANGED
@@ -1 +1,27 @@
1
- #wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{margin:-2px -5px 0 23px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:30px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account ul,
2
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
3
+ left: auto;
4
+ right: 0;
5
+ }
6
+ #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img,
7
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
8
+ margin: -2px -5px 0 23px;
9
+ }
10
+ #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,
11
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
12
+ left: auto;
13
+ right: 30px;
14
+ }
15
+ #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,
16
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
17
+ left: auto;
18
+ right: 0;
19
+ }
20
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
21
+ left: auto;
22
+ right: 0;
23
+ }
24
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
25
+ left: auto;
26
+ right: 0;
27
+ }
bp-core/css/admin-bar-rtl.dev.css DELETED
@@ -1,27 +0,0 @@
1
- #wpadminbar .quicklinks li#wp-admin-bar-my-account ul,
2
- #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
3
- left: auto;
4
- right: 0;
5
- }
6
- #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img,
7
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
8
- margin: -2px -5px 0 23px;
9
- }
10
- #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,
11
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
12
- left: auto;
13
- right: 30px;
14
- }
15
- #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,
16
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
17
- left: auto;
18
- right: 0;
19
- }
20
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
21
- left: auto;
22
- right: 0;
23
- }
24
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
25
- left: auto;
26
- right: 0;
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/css/admin-bar-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{margin:-2px -5px 0 23px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:30px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}
bp-core/css/admin-bar.css CHANGED
@@ -1 +1,58 @@
1
- #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Displayed User */
2
+ #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img,
3
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
4
+ width: 16px;
5
+ height: 16px;
6
+ display: inline;
7
+ border: 1px solid #999;
8
+ vertical-align: middle;
9
+ margin: -2px 10px 0 -5px;
10
+ padding: 0;
11
+ background: #eee;
12
+ float: none;
13
+ }
14
+
15
+ /* Displayed Group */
16
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
17
+ left: 0;
18
+ }
19
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
20
+ left: 0;
21
+ }
22
+
23
+ /* Notifications */
24
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,
25
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,
26
+ #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications {
27
+ background: #21759B;
28
+ color: #fff;
29
+ text-shadow: none;
30
+ display: inline;
31
+ padding: 2px 5px;
32
+ font-size: 10px;
33
+ font-weight: bold;
34
+ -moz-border-radius: 10px;
35
+ -khtml-border-radius: 10px;
36
+ -webkit-border-radius: 10px;
37
+ border-radius: 10px;
38
+ }
39
+
40
+ #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications {
41
+ background: #ddd;
42
+ color: #333;
43
+ margin: 0
44
+ }
45
+
46
+ #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert {
47
+ background-color: #1fb3dd;
48
+ color: #fff;
49
+ }
50
+
51
+ #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications > a {
52
+ padding: 0 .5em;
53
+ }
54
+
55
+ #wp-admin-bar-user-info img.avatar {
56
+ height: 64px;
57
+ width: 64px;
58
+ }
bp-core/css/admin-bar.dev.css DELETED
@@ -1,58 +0,0 @@
1
- /* Displayed User */
2
- #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img,
3
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
4
- width: 16px;
5
- height: 16px;
6
- display: inline;
7
- border: 1px solid #999;
8
- vertical-align: middle;
9
- margin: -2px 10px 0 -5px;
10
- padding: 0;
11
- background: #eee;
12
- float: none;
13
- }
14
-
15
- /* Displayed Group */
16
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
17
- left: 0;
18
- }
19
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
20
- left: 0;
21
- }
22
-
23
- /* Notifications */
24
- #wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,
25
- #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,
26
- #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications {
27
- background: #21759B;
28
- color: #fff;
29
- text-shadow: none;
30
- display: inline;
31
- padding: 2px 5px;
32
- font-size: 10px;
33
- font-weight: bold;
34
- -moz-border-radius: 10px;
35
- -khtml-border-radius: 10px;
36
- -webkit-border-radius: 10px;
37
- border-radius: 10px;
38
- }
39
-
40
- #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications {
41
- background: #ddd;
42
- color: #333;
43
- margin: 0
44
- }
45
-
46
- #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert {
47
- background-color: #1fb3dd;
48
- color: #fff;
49
- }
50
-
51
- #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications > a {
52
- padding: 0 .5em;
53
- }
54
-
55
- #wp-admin-bar-user-info img.avatar {
56
- height: 64px;
57
- width: 64px;
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/css/admin-bar.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
bp-core/css/buddybar-rtl.css CHANGED
@@ -1 +1,77 @@
1
- #wp-admin-bar{right:0;left:auto}#wp-admin-bar div#admin-bar-logo{right:10px;left:auto}#wp-admin-bar li{text-align:right}#wp-admin-bar li.no-arrow a{padding-left:15px;padding-right:0}#admin-bar-logo{float:right}#wp-admin-bar ul li{float:right;background:url(_inc/images/admin-menu-arrow.gif) 12% 53% no-repeat;padding-left:11px;padding-right:0}#wp-admin-bar ul li.no-arrow{padding-left:0}#wp-admin-bar ul li.align-right{left:0;right:auto}#wp-admin-bar ul li ul{right:-999em;left:auto;margin-right:0}#wp-admin-bar ul li ul li{float:right}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0;right:auto}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{right:-999em;left:auto}#wp-admin-bar img.avatar{float:right;margin-left:8px;margin-right:0}#wp-admin-bar span.activity{margin-right:34px;margin-left:0}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{margin-right:2px;margin-left:0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp-admin-bar {
2
+ right: 0;
3
+ left: auto;
4
+ }
5
+ #wp-admin-bar div#admin-bar-logo {
6
+ right: 10px;
7
+ left: auto;
8
+ }
9
+ #wp-admin-bar li {
10
+ text-align: right;
11
+ }
12
+ #wp-admin-bar li.no-arrow a {
13
+ padding-left: 15px;
14
+ padding-right: 0;
15
+ }
16
+ #admin-bar-logo {
17
+ float: right;
18
+ }
19
+
20
+ #wp-admin-bar ul li {/* all list items */
21
+ float: right;
22
+ background: url('../images/admin-menu-arrow.gif') 12% 53% no-repeat;
23
+ padding-left: 11px;
24
+ padding-right: 0;
25
+ }
26
+ #wp-admin-bar ul li.no-arrow {
27
+ padding-left: 0;
28
+ }
29
+ #wp-admin-bar ul li.align-right {
30
+ left: 0;
31
+ right: auto;
32
+ }
33
+
34
+ /* second-level lists */
35
+ #wp-admin-bar ul li ul {
36
+ right: -999em;
37
+ left: auto;
38
+ margin-right: 0;
39
+ }
40
+ #wp-admin-bar ul li ul li {
41
+ float: right;
42
+ }
43
+
44
+ /* third-and-above-level lists */
45
+ #wp-admin-bar ul li ul ul {
46
+ margin: -25px 184px 0 0;
47
+ }
48
+ #wp-admin-bar ul li:hover ul,
49
+ #wp-admin-bar ul li li:hover ul,
50
+ #wp-admin-bar ul li.sfhover ul,
51
+ #wp-admin-bar ul li ul li.sfhover ul {/* lists nested under hovered list items */
52
+ right: auto;
53
+ }
54
+ #wp-admin-bar ul li.align-right:hover ul {
55
+ left: 0;
56
+ right: auto;
57
+ }
58
+ #wp-admin-bar ul li:hover ul ul,
59
+ #wp-admin-bar li.sfhover ul li ul {
60
+ right: -999em;
61
+ left: auto;
62
+ }
63
+
64
+ /* Menu item css */
65
+ #wp-admin-bar img.avatar {
66
+ float: right;
67
+ margin-left: 8px;
68
+ margin-right: 0;
69
+ }
70
+ #wp-admin-bar span.activity {
71
+ margin-right: 34px;
72
+ margin-left: 0;
73
+ }
74
+ #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
75
+ margin-right: 2px;
76
+ margin-left: 0;
77
+ }
bp-core/css/buddybar-rtl.dev.css DELETED
@@ -1,77 +0,0 @@
1
- #wp-admin-bar {
2
- right: 0;
3
- left: auto;
4
- }
5
- #wp-admin-bar div#admin-bar-logo {
6
- right: 10px;
7
- left: auto;
8
- }
9
- #wp-admin-bar li {
10
- text-align: right;
11
- }
12
- #wp-admin-bar li.no-arrow a {
13
- padding-left: 15px;
14
- padding-right: 0;
15
- }
16
- #admin-bar-logo {
17
- float: right;
18
- }
19
-
20
- #wp-admin-bar ul li {/* all list items */
21
- float: right;
22
- background: url( _inc/images/admin-menu-arrow.gif ) 12% 53% no-repeat;
23
- padding-left: 11px;
24
- padding-right: 0;
25
- }
26
- #wp-admin-bar ul li.no-arrow {
27
- padding-left: 0;
28
- }
29
- #wp-admin-bar ul li.align-right {
30
- left: 0;
31
- right: auto;
32
- }
33
-
34
- /* second-level lists */
35
- #wp-admin-bar ul li ul {
36
- right: -999em;
37
- left: auto;
38
- margin-right: 0;
39
- }
40
- #wp-admin-bar ul li ul li {
41
- float: right;
42
- }
43
-
44
- /* third-and-above-level lists */
45
- #wp-admin-bar ul li ul ul {
46
- margin: -25px 184px 0 0;
47
- }
48
- #wp-admin-bar ul li:hover ul,
49
- #wp-admin-bar ul li li:hover ul,
50
- #wp-admin-bar ul li.sfhover ul,
51
- #wp-admin-bar ul li ul li.sfhover ul {/* lists nested under hovered list items */
52
- right: auto;
53
- }
54
- #wp-admin-bar ul li.align-right:hover ul {
55
- left: 0;
56
- right: auto;
57
- }
58
- #wp-admin-bar ul li:hover ul ul,
59
- #wp-admin-bar li.sfhover ul li ul {
60
- right: -999em;
61
- left: auto;
62
- }
63
-
64
- /* Menu item css */
65
- #wp-admin-bar img.avatar {
66
- float: right;
67
- margin-left: 8px;
68
- margin-right: 0;
69
- }
70
- #wp-admin-bar span.activity {
71
- margin-right: 34px;
72
- margin-left: 0;
73
- }
74
- #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
75
- margin-right: 2px;
76
- margin-left: 0;
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/css/buddybar-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wp-admin-bar{right:0;left:auto}#wp-admin-bar div#admin-bar-logo{right:10px;left:auto}#wp-admin-bar li{text-align:right}#wp-admin-bar li.no-arrow a{padding-left:15px;padding-right:0}#admin-bar-logo{float:right}#wp-admin-bar ul li{float:right;background:url('../images/admin-menu-arrow.gif') 12% 53% no-repeat;padding-left:11px;padding-right:0}#wp-admin-bar ul li.no-arrow{padding-left:0}#wp-admin-bar ul li.align-right{left:0;right:auto}#wp-admin-bar ul li ul{right:-999em;left:auto;margin-right:0}#wp-admin-bar ul li ul li{float:right}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0;right:auto}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{right:-999em;left:auto}#wp-admin-bar img.avatar{float:right;margin-left:8px;margin-right:0}#wp-admin-bar span.activity{margin-right:34px;margin-left:0}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{margin-right:2px;margin-left:0}
bp-core/css/buddybar.css CHANGED
@@ -1 +1,203 @@
1
- body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:0}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px 7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:0}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li:hover,#wp-admin-bar li.hover{position:static}#admin-bar-logo{float:left;font-weight:bold;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;padding-right:11px}#wp-admin-bar ul li.no-arrow{background:0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li:hover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0}#wp-admin-bar ul li>ul{border-top:0}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li:hover,#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body:not(.wp-admin) {
2
+ padding-top: 25px !important;
3
+ }
4
+ #wp-admin-bar {
5
+ position: fixed;
6
+ top: 0;
7
+ left: 0;
8
+ height: 25px;
9
+ font-size: 11px;
10
+ width: 100%;
11
+ z-index: 9999;
12
+ }
13
+ #wp-admin-bar .padder {
14
+ position: relative;
15
+ padding: 0;
16
+ width: 100%;
17
+ margin: 0 auto;
18
+ background: url('../images/60pc_black.png');
19
+ height: 25px;
20
+ }
21
+ body#bp-default #wp-admin-bar .padder {
22
+ max-width: 1250px;
23
+ }
24
+ #wp-admin-bar * {
25
+ z-index: 999;
26
+ }
27
+ #wp-admin-bar div#admin-bar-logo {
28
+ position: absolute;
29
+ top: 5px;
30
+ left: 10px;
31
+ }
32
+ #wp-admin-bar a img {
33
+ border: none;
34
+ }
35
+ #wp-admin-bar li {
36
+ list-style: none;
37
+ margin: 0;
38
+ padding: 0;
39
+ line-height: 100%;
40
+ text-align: left;
41
+ }
42
+ #wp-admin-bar li a {
43
+ padding: 7px 15px 7px 15px;
44
+ color: #eee;
45
+ text-decoration: none;
46
+ font-size: 11px;
47
+ }
48
+ #wp-admin-bar li.alt {
49
+ border: none;
50
+ }
51
+ #wp-admin-bar li.no-arrow a {
52
+ padding-right: 15px;
53
+ }
54
+ #wp-admin-bar ul li ul li a span {
55
+ display: none;
56
+ }
57
+ #wp-admin-bar li:hover,
58
+ #wp-admin-bar li.hover {
59
+ position: static;
60
+ }
61
+ #admin-bar-logo {
62
+ float: left;
63
+ font-weight: bold;
64
+ font-size: 11px;
65
+ padding: 5px 8px;
66
+ margin: 0;
67
+ text-decoration: none;
68
+ color: #fff;
69
+ }
70
+ body#bp-default #admin-bar-logo {
71
+ padding: 2px 8px;
72
+ }
73
+
74
+ /* all lists */
75
+ #wp-admin-bar ul {
76
+ margin: 0;
77
+ list-style: none;
78
+ line-height: 1;
79
+ cursor: pointer;
80
+ height: auto;
81
+ padding: 0;
82
+ }
83
+
84
+ /* all list items */
85
+ #wp-admin-bar ul li {
86
+ padding: 0;
87
+ float: left;
88
+ position: relative;
89
+ background: url('../images/admin-menu-arrow.gif') 88% 53% no-repeat;
90
+ padding-right: 11px;
91
+ }
92
+ #wp-admin-bar ul li.no-arrow {
93
+ background: none;
94
+ padding-right: 0;
95
+ }
96
+ #wp-admin-bar ul li ul li {
97
+ background-image: none;
98
+ }
99
+ #wp-admin-bar ul li.align-right {
100
+ position: absolute;
101
+ right: 0;
102
+ }
103
+ #wp-admin-bar ul li a {
104
+ display: block;
105
+ }
106
+ #wp-admin-bar ul.main-nav li:hover,
107
+ #wp-admin-bar ul.main-nav li.sfhover,
108
+ #wp-admin-bar ul.main-nav li ul li.sfhover {
109
+ background-color: #333;
110
+ }
111
+
112
+ /* second-level lists */
113
+ #wp-admin-bar ul li ul {
114
+ position: absolute;
115
+ width: 185px;
116
+ left: -999em;
117
+ margin-left: 0;
118
+ background: #333;
119
+ border: 1px solid #222;
120
+ -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
121
+ -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
122
+ -moz-border-radius: 3px;
123
+ -webkit-border-radius: 3px;
124
+ -moz-border-radius-topleft: 0;
125
+ -webkit-border-top-left-radius: 0;
126
+ -moz-border-radius-topright: 0;
127
+ -webkit-border-top-right-radius: 0;
128
+ }
129
+ #wp-admin-bar ul li > ul {
130
+ border-top: none;
131
+ }
132
+ #wp-admin-bar ul li ul a {
133
+ color: #eee;
134
+ }
135
+ #wp-admin-bar ul li ul li {
136
+ float: left;
137
+ width: 174px;
138
+ margin: 0;
139
+ }
140
+ #wp-admin-bar ul li ul li:hover a {
141
+ color: #fff;
142
+ }
143
+ #wp-admin-bar ul li div.admin-bar-clear {
144
+ clear: both;
145
+ }
146
+ #wp-admin-bar ul.main-nav li ul li:hover,
147
+ #wp-admin-bar ul.main-nav li ul li.sfhover,
148
+ #wp-admin-bar ul.main-nav li ul li.sfhover {
149
+ background-color: #222;
150
+ }
151
+
152
+ /* third-and-above-level lists */
153
+ #wp-admin-bar ul li ul ul {
154
+ margin: -25px 0 0 184px;
155
+ -moz-border-radius: 3px;
156
+ -webkit-border-radius: 3px;
157
+ }
158
+ #wp-admin-bar ul li ul li:hover ul li a {
159
+ color: #eee;
160
+ }
161
+ #wp-admin-bar ul li ul li ul li:hover a {
162
+ color: #fff;
163
+ }
164
+ #wp-admin-bar ul li:hover ul,
165
+ #wp-admin-bar ul li ul li:hover ul,
166
+ #wp-admin-bar ul li.sfhover ul,
167
+ #wp-admin-bar ul li ul li.sfhover ul {
168
+ left: auto;
169
+ }
170
+ #wp-admin-bar ul li.align-right:hover ul {
171
+ right: 0;
172
+ }
173
+ #wp-admin-bar ul li:hover ul ul,
174
+ #wp-admin-bar li.sfhover ul li ul {
175
+ left: -999em;
176
+ }
177
+
178
+ /* Menu item css */
179
+ #wp-admin-bar img.avatar {
180
+ float: left;
181
+ margin-right: 8px;
182
+ }
183
+ #wp-admin-bar span.activity {
184
+ display: block;
185
+ margin-left: 34px;
186
+ padding: 0;
187
+ }
188
+ #wp-admin-bar ul.author-list li a {
189
+ height: 17px;
190
+ }
191
+ #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
192
+ padding: 0 6px;
193
+ margin-left: 2px;
194
+ background: #fff;
195
+ color: #000;
196
+ -moz-border-radius: 3px;
197
+ -webkit-border-radius: 3px;
198
+ border-radius: 3px;
199
+ }
200
+ #wp-admin-bar-user-info img.avatar {
201
+ height: 64px;
202
+ width: 64px;
203
+ }
bp-core/css/buddybar.dev.css DELETED
@@ -1,203 +0,0 @@
1
- body:not(.wp-admin) {
2
- padding-top: 25px !important;
3
- }
4
- #wp-admin-bar {
5
- position: fixed;
6
- top: 0;
7
- left: 0;
8
- height: 25px;
9
- font-size: 11px;
10
- width: 100%;
11
- z-index: 9999;
12
- }
13
- #wp-admin-bar .padder {
14
- position: relative;
15
- padding: 0;
16
- width: 100%;
17
- margin: 0 auto;
18
- background: url( ../images/60pc_black.png );
19
- height: 25px;
20
- }
21
- body#bp-default #wp-admin-bar .padder {
22
- max-width: 1250px;
23
- }
24
- #wp-admin-bar * {
25
- z-index: 999;
26
- }
27
- #wp-admin-bar div#admin-bar-logo {
28
- position: absolute;
29
- top: 5px;
30
- left: 10px;
31
- }
32
- #wp-admin-bar a img {
33
- border: none;
34
- }
35
- #wp-admin-bar li {
36
- list-style: none;
37
- margin: 0;
38
- padding: 0;
39
- line-height: 100%;
40
- text-align: left;
41
- }
42
- #wp-admin-bar li a {
43
- padding: 7px 15px 7px 15px;
44
- color: #eee;
45
- text-decoration: none;
46
- font-size: 11px;
47
- }
48
- #wp-admin-bar li.alt {
49
- border: none;
50
- }
51
- #wp-admin-bar li.no-arrow a {
52
- padding-right: 15px;
53
- }
54
- #wp-admin-bar ul li ul li a span {
55
- display: none;
56
- }
57
- #wp-admin-bar li:hover,
58
- #wp-admin-bar li.hover {
59
- position: static;
60
- }
61
- #admin-bar-logo {
62
- float: left;
63
- font-weight: bold;
64
- font-size: 11px;
65
- padding: 5px 8px;
66
- margin: 0;
67
- text-decoration: none;
68
- color: #fff;
69
- }
70
- body#bp-default #admin-bar-logo {
71
- padding: 2px 8px;
72
- }
73
-
74
- /* all lists */
75
- #wp-admin-bar ul {
76
- margin: 0;
77
- list-style: none;
78
- line-height: 1;
79
- cursor: pointer;
80
- height: auto;
81
- padding: 0;
82
- }
83
-
84
- /* all list items */
85
- #wp-admin-bar ul li {
86
- padding: 0;
87
- float: left;
88
- position: relative;
89
- background: url( ../images/admin-menu-arrow.gif ) 88% 53% no-repeat;
90
- padding-right: 11px;
91
- }
92
- #wp-admin-bar ul li.no-arrow {
93
- background: none;
94
- padding-right: 0;
95
- }
96
- #wp-admin-bar ul li ul li {
97
- background-image: none;
98
- }
99
- #wp-admin-bar ul li.align-right {
100
- position: absolute;
101
- right: 0;
102
- }
103
- #wp-admin-bar ul li a {
104
- display: block;
105
- }
106
- #wp-admin-bar ul.main-nav li:hover,
107
- #wp-admin-bar ul.main-nav li.sfhover,
108
- #wp-admin-bar ul.main-nav li ul li.sfhover {
109
- background-color: #333;
110
- }
111
-
112
- /* second-level lists */
113
- #wp-admin-bar ul li ul {
114
- position: absolute;
115
- width: 185px;
116
- left: -999em;
117
- margin-left: 0;
118
- background: #333;
119
- border: 1px solid #222;
120
- -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
121
- -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
122
- -moz-border-radius: 3px;
123
- -webkit-border-radius: 3px;
124
- -moz-border-radius-topleft: 0;
125
- -webkit-border-top-left-radius: 0;
126
- -moz-border-radius-topright: 0;
127
- -webkit-border-top-right-radius: 0;
128
- }
129
- #wp-admin-bar ul li > ul {
130
- border-top: none;
131
- }
132
- #wp-admin-bar ul li ul a {
133
- color: #eee;
134
- }
135
- #wp-admin-bar ul li ul li {
136
- float: left;
137
- width: 174px;
138
- margin: 0;
139
- }
140
- #wp-admin-bar ul li ul li:hover a {
141
- color: #fff;
142
- }
143
- #wp-admin-bar ul li div.admin-bar-clear {
144
- clear: both;
145
- }
146
- #wp-admin-bar ul.main-nav li ul li:hover,
147
- #wp-admin-bar ul.main-nav li ul li.sfhover,
148
- #wp-admin-bar ul.main-nav li ul li.sfhover {
149
- background-color: #222;
150
- }
151
-
152
- /* third-and-above-level lists */
153
- #wp-admin-bar ul li ul ul {
154
- margin: -25px 0 0 184px;
155
- -moz-border-radius: 3px;
156
- -webkit-border-radius: 3px;
157
- }
158
- #wp-admin-bar ul li ul li:hover ul li a {
159
- color: #eee;
160
- }
161
- #wp-admin-bar ul li ul li ul li:hover a {
162
- color: #fff;
163
- }
164
- #wp-admin-bar ul li:hover ul,
165
- #wp-admin-bar ul li ul li:hover ul,
166
- #wp-admin-bar ul li.sfhover ul,
167
- #wp-admin-bar ul li ul li.sfhover ul {
168
- left: auto;
169
- }
170
- #wp-admin-bar ul li.align-right:hover ul {
171
- right: 0;
172
- }
173
- #wp-admin-bar ul li:hover ul ul,
174
- #wp-admin-bar li.sfhover ul li ul {
175
- left: -999em;
176
- }
177
-
178
- /* Menu item css */
179
- #wp-admin-bar img.avatar {
180
- float: left;
181
- margin-right: 8px;
182
- }
183
- #wp-admin-bar span.activity {
184
- display: block;
185
- margin-left: 34px;
186
- padding: 0;
187
- }
188
- #wp-admin-bar ul.author-list li a {
189
- height: 17px;
190
- }
191
- #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
192
- padding: 0 6px;
193
- margin-left: 2px;
194
- background: #fff;
195
- color: #000;
196
- -moz-border-radius: 3px;
197
- -webkit-border-radius: 3px;
198
- border-radius: 3px;
199
- }
200
- #wp-admin-bar-user-info img.avatar {
201
- height: 64px;
202
- width: 64px;
203
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/css/buddybar.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url('../images/60pc_black.png');height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:0}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px 7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:0}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li:hover,#wp-admin-bar li.hover{position:static}#admin-bar-logo{float:left;font-weight:bold;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url('../images/admin-menu-arrow.gif') 88% 53% no-repeat;padding-right:11px}#wp-admin-bar ul li.no-arrow{background:0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li:hover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0}#wp-admin-bar ul li>ul{border-top:0}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li:hover,#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
bp-core/deprecated/1.5.php CHANGED
@@ -12,6 +12,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
  /** Loader ********************************************************************/
14
 
 
 
 
15
  function bp_setup_root_components() {
16
  do_action( 'bp_setup_root_components' );
17
  }
@@ -25,7 +28,7 @@ add_action( 'bp_init', 'bp_setup_root_components', 6 );
25
  * This function originally served as a wrapper when WordPress and WordPress MU were separate entities.
26
  * Use is_multisite() instead.
27
  *
28
- * @deprecated 1.5
29
  * @deprecated Use is_multisite()
30
  */
31
  function bp_core_is_multisite() {
@@ -38,12 +41,12 @@ function bp_core_is_multisite() {
38
  *
39
  * Checks if current blog is root blog of site. Deprecated in 1.5.
40
  *
41
- * @deprecated 1.5
42
  * @deprecated Use is_main_site()
43
  * @package BuddyPress
44
  * @param int $blog_id optional blog id to test (default current blog)
45
  * @return bool True if not multisite or $blog_id is main site
46
- * @since 1.2.6
47
  */
48
  function bp_core_is_main_site( $blog_id = '' ) {
49
  _deprecated_function( __FUNCTION__, '1.5', 'is_main_site()' );
@@ -53,7 +56,7 @@ function bp_core_is_main_site( $blog_id = '' ) {
53
  /**
54
  * WPMU version of is_super_admin()
55
  *
56
- * @deprecated 1.5
57
  * @deprecated Use is_super_admin()
58
  * @param int $user_id Optional. Defaults to logged-in user
59
  * @return bool True if is super admin
@@ -71,9 +74,9 @@ if ( !function_exists( 'is_site_admin' ) ) {
71
  * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page()
72
  * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function.
73
  *
74
- * @deprecated 1.5
75
  * @deprecated Use add_menu_page().
76
- * @since 1.1
77
  */
78
  function bp_core_add_admin_menu_page( $args = '' ) {
79
  global $_registered_pages, $admin_page_hooks, $menu;
@@ -117,6 +120,9 @@ function bp_core_add_admin_menu_page( $args = '' ) {
117
  }
118
  /** Activity ******************************************************************/
119
 
 
 
 
120
  function bp_is_activity_permalink() {
121
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_single_activity' );
122
  bp_is_single_activity();
@@ -124,11 +130,12 @@ function bp_is_activity_permalink() {
124
 
125
  /** Core **********************************************************************/
126
 
 
 
 
127
  function bp_core_get_wp_profile() {
128
  _deprecated_function( __FUNCTION__, '1.5' );
129
 
130
- global $bp;
131
-
132
  $ud = get_userdata( bp_displayed_user_id() ); ?>
133
 
134
  <div class="bp-widget wp-profile">
@@ -196,6 +203,10 @@ function bp_core_get_wp_profile() {
196
  <?php
197
  }
198
 
 
 
 
 
199
  function bp_is_home() {
200
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_my_profile' );
201
  return bp_is_my_profile();
@@ -204,7 +215,7 @@ function bp_is_home() {
204
  /**
205
  * Is the user on the front page of the site?
206
  *
207
- * @deprecated 1.5
208
  * @deprecated Use is_front_page()
209
  * @return bool
210
  */
@@ -216,7 +227,7 @@ function bp_is_front_page() {
216
  /**
217
  * Is the front page of the site set to the Activity component?
218
  *
219
- * @deprecated 1.5
220
  * @deprecated Use bp_is_component_front_page( 'activity' )
221
  * @return bool
222
  */
@@ -225,11 +236,19 @@ function bp_is_activity_front_page() {
225
  return bp_is_component_front_page( 'activity' );
226
  }
227
 
 
 
 
 
228
  function bp_is_member() {
229
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user' );
230
  return bp_is_user();
231
  }
232
 
 
 
 
 
233
  function bp_loggedinuser_link() {
234
  _deprecated_function( __FUNCTION__, '1.5', 'bp_logged_in_user_link' );
235
  bp_loggedin_user_link();
@@ -239,6 +258,7 @@ function bp_loggedinuser_link() {
239
  * Only show the search form if there are available objects to search for.
240
  * Deprecated in 1.5; not used anymore.
241
  *
 
242
  * @return bool
243
  */
244
  function bp_search_form_enabled() {
@@ -249,9 +269,9 @@ function bp_search_form_enabled() {
249
  /**
250
  * Template tag version of bp_get_page_title()
251
  *
252
- * @deprecated 1.5
253
  * @deprecated Use wp_title()
254
- * @since 1.0
255
  */
256
  function bp_page_title() {
257
  echo bp_get_page_title();
@@ -260,9 +280,9 @@ function bp_page_title() {
260
  * Prior to BuddyPress 1.5, this was used to generate the page's <title> text.
261
  * Now, just simply use wp_title().
262
  *
263
- * @deprecated 1.5
264
  * @deprecated Use wp_title()
265
- * @since 1.0
266
  */
267
  function bp_get_page_title() {
268
  _deprecated_function( __FUNCTION__, '1.5', 'wp_title()' );
@@ -277,9 +297,9 @@ function bp_page_title() {
277
  /**
278
  * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url().
279
  *
280
- * @deprecated 1.5
281
  * @deprecated Use wp_logout_url()
282
- * @since 1.0
283
  */
284
  function bp_log_out_link() {
285
  _deprecated_function( __FUNCTION__, '1.5', 'wp_logout_url()' );
@@ -291,12 +311,10 @@ function bp_log_out_link() {
291
  /**
292
  * Send an email and a BP notification on receipt of an @-mention in a group
293
  *
294
- * @deprecated 1.5
295
  * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification()
296
  */
297
  function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) {
298
- global $bp;
299
-
300
  _deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' );
301
 
302
  /* Scan for @username strings in an activity update. Notify each user. */
@@ -331,8 +349,7 @@ function groups_at_message_notification( $content, $poster_user_id, $group_id, $
331
  // Set up and send the message
332
  $ud = bp_core_get_core_userdata( $receiver_user_id );
333
  $to = $ud->user_email;
334
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
335
- $subject = '[' . $sitename . '] ' . sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name );
336
 
337
  $message = sprintf( __(
338
  '%1$s mentioned you in the group "%2$s":
@@ -360,6 +377,7 @@ To view and respond to the message, log in and visit: %4$s
360
 
361
  /**
362
  * BP 1.5 simplified notification functions a bit
 
363
  */
364
  function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) {
365
  _deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_type()' );
@@ -373,6 +391,7 @@ function bp_core_delete_notifications_for_user_by_item_id( $user_id, $item_id, $
373
 
374
  /**
375
  * In BP 1.5, these functions were renamed for greater consistency
 
376
  */
377
  function bp_forum_directory_permalink() {
378
  _deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' );
@@ -385,6 +404,7 @@ function bp_forum_directory_permalink() {
385
 
386
  /**
387
  * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template.
 
388
  */
389
  function bp_search_form() {
390
  _deprecated_function( __FUNCTION__, '1.1', 'No longer required.' );
@@ -404,17 +424,24 @@ function bp_search_form() {
404
 
405
  /**
406
  * Some _is_ function had their names normalized
 
407
  */
408
  function bp_is_profile_edit() {
409
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_profile_edit()' );
410
  return bp_is_user_profile_edit();
411
  }
412
 
 
 
 
413
  function bp_is_change_avatar() {
414
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_change_avatar()' );
415
  return bp_is_user_change_avatar();
416
  }
417
 
 
 
 
418
  function bp_is_friend_requests() {
419
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' );
420
  return bp_is_user_friend_requests();
@@ -425,7 +452,7 @@ function bp_is_friend_requests() {
425
  * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group
426
  * You should be using bp_is_root_component().
427
  *
428
- * @deprecated 1.5
429
  * @deprecated bp_is_root_component()
430
  * @return true if root component, else false.
431
  */
@@ -440,6 +467,7 @@ function bp_core_is_root_component( $component_name ) {
440
  * Contains functions which were moved out of BP-Default's functions.php
441
  * in BuddyPress 1.5.
442
  *
 
443
  * @since BuddyPress (1.5)
444
  */
445
  function bp_dtheme_deprecated() {
@@ -449,12 +477,12 @@ function bp_dtheme_deprecated() {
449
  * Settings > Reading screen for selecting the page to show on front to
450
  * include "Activity Stream." As of 1.5.x, it is no longer required.
451
  *
452
- * @deprecated 1.5
453
  * @deprecated No longer required.
454
  * @param string $page_html A list of pages as a dropdown (select list)
455
  * @return string
456
  * @see wp_dropdown_pages()
457
- * @since 1.2
458
  */
459
  function bp_dtheme_wp_pages_filter( $page_html ) {
460
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
@@ -467,12 +495,12 @@ function bp_dtheme_deprecated() {
467
  * In BuddyPress 1.2.x, this function hijacked the saving of page on front setting to save the activity stream setting.
468
  * As of 1.5.x, it is no longer required.
469
  *
470
- * @deprecated 1.5
471
  * @deprecated No longer required.
472
  * @param $string $oldvalue Previous value of get_option( 'page_on_front' )
473
  * @param $string $oldvalue New value of get_option( 'page_on_front' )
474
  * @return string
475
- * @since 1.2
476
  */
477
  function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) {
478
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
@@ -488,11 +516,11 @@ function bp_dtheme_deprecated() {
488
  * In BuddyPress 1.2.x, this function loaded the activity stream template if the front page display settings allow.
489
  * As of 1.5.x, it is no longer required.
490
  *
491
- * @deprecated 1.5
492
  * @deprecated No longer required.
493
  * @param string $template Absolute path to the page template
494
  * @return string
495
- * @since 1.2
496
  */
497
  function bp_dtheme_page_on_front_template( $template ) {
498
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
@@ -505,9 +533,9 @@ function bp_dtheme_deprecated() {
505
  * In BuddyPress 1.2.x, this forced the page ID as a string to stop the get_posts query from kicking up a fuss.
506
  * As of 1.5.x, it is no longer required.
507
  *
508
- * @deprecated 1.5
509
  * @deprecated No longer required.
510
- * @since 1.2
511
  */
512
  function bp_dtheme_fix_get_posts_on_activity_front() {
513
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
@@ -519,11 +547,11 @@ function bp_dtheme_deprecated() {
519
  * In BuddyPress 1.2.x, this was used as part of the code that set the activity stream to be on the front page.
520
  * As of 1.5.x, it is no longer required.
521
  *
522
- * @deprecated 1.5
523
  * @deprecated No longer required.
524
  * @param array $posts Posts as retrieved by WP_Query
525
  * @return array
526
- * @since 1.2.5
527
  */
528
  function bp_dtheme_fix_the_posts_on_activity_front( $posts ) {
529
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
@@ -536,9 +564,9 @@ function bp_dtheme_deprecated() {
536
  * In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
537
  * As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
538
  *
539
- * @deprecated 1.5
540
  * @deprecated Enqueue the comment-reply script in your theme's header.php.
541
- * @since 1.2
542
  */
543
  function bp_dtheme_add_blog_comments_js() {
544
  _deprecated_function( __FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php." );
@@ -677,4 +705,3 @@ function bp_core_screen_delete_account_title() {
677
  function bp_core_screen_delete_account_content() {
678
  _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
679
  }
680
- ?>
12
 
13
  /** Loader ********************************************************************/
14
 
15
+ /**
16
+ * @deprecated BuddyPress (1.5)
17
+ */
18
  function bp_setup_root_components() {
19
  do_action( 'bp_setup_root_components' );
20
  }
28
  * This function originally served as a wrapper when WordPress and WordPress MU were separate entities.
29
  * Use is_multisite() instead.
30
  *
31
+ * @deprecated BuddyPress (1.5)
32
  * @deprecated Use is_multisite()
33
  */
34
  function bp_core_is_multisite() {
41
  *
42
  * Checks if current blog is root blog of site. Deprecated in 1.5.
43
  *
44
+ * @deprecated BuddyPress (1.5)
45
  * @deprecated Use is_main_site()
46
  * @package BuddyPress
47
  * @param int $blog_id optional blog id to test (default current blog)
48
  * @return bool True if not multisite or $blog_id is main site
49
+ * @since BuddyPress (1.2.6)
50
  */
51
  function bp_core_is_main_site( $blog_id = '' ) {
52
  _deprecated_function( __FUNCTION__, '1.5', 'is_main_site()' );
56
  /**
57
  * WPMU version of is_super_admin()
58
  *
59
+ * @deprecated BuddyPress (1.5)
60
  * @deprecated Use is_super_admin()
61
  * @param int $user_id Optional. Defaults to logged-in user
62
  * @return bool True if is super admin
74
  * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page()
75
  * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function.
76
  *
77
+ * @deprecated BuddyPress (1.5)
78
  * @deprecated Use add_menu_page().
79
+ * @since BuddyPress (1.1)
80
  */
81
  function bp_core_add_admin_menu_page( $args = '' ) {
82
  global $_registered_pages, $admin_page_hooks, $menu;
120
  }
121
  /** Activity ******************************************************************/
122
 
123
+ /**
124
+ * @deprecated BuddyPress (1.5)
125
+ */
126
  function bp_is_activity_permalink() {
127
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_single_activity' );
128
  bp_is_single_activity();
130
 
131
  /** Core **********************************************************************/
132
 
133
+ /**
134
+ * @deprecated BuddyPress (1.5)
135
+ */
136
  function bp_core_get_wp_profile() {
137
  _deprecated_function( __FUNCTION__, '1.5' );
138
 
 
 
139
  $ud = get_userdata( bp_displayed_user_id() ); ?>
140
 
141
  <div class="bp-widget wp-profile">
203
  <?php
204
  }
205
 
206
+ /**
207
+ * @deprecated BuddyPress (1.5)
208
+ * @deprecated Use bp_is_my_profile()
209
+ */
210
  function bp_is_home() {
211
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_my_profile' );
212
  return bp_is_my_profile();
215
  /**
216
  * Is the user on the front page of the site?
217
  *
218
+ * @deprecated BuddyPress (1.5)
219
  * @deprecated Use is_front_page()
220
  * @return bool
221
  */
227
  /**
228
  * Is the front page of the site set to the Activity component?
229
  *
230
+ * @deprecated BuddyPress (1.5)
231
  * @deprecated Use bp_is_component_front_page( 'activity' )
232
  * @return bool
233
  */
236
  return bp_is_component_front_page( 'activity' );
237
  }
238
 
239
+ /**
240
+ * @deprecated BuddyPress (1.5)
241
+ * @deprecated use bp_is_user()
242
+ */
243
  function bp_is_member() {
244
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user' );
245
  return bp_is_user();
246
  }
247
 
248
+ /**
249
+ * @deprecated BuddyPress (1.5)
250
+ * @deprecated use bp_loggedin_user_link()
251
+ */
252
  function bp_loggedinuser_link() {
253
  _deprecated_function( __FUNCTION__, '1.5', 'bp_logged_in_user_link' );
254
  bp_loggedin_user_link();
258
  * Only show the search form if there are available objects to search for.
259
  * Deprecated in 1.5; not used anymore.
260
  *
261
+ * @deprecated BuddyPress (1.5)
262
  * @return bool
263
  */
264
  function bp_search_form_enabled() {
269
  /**
270
  * Template tag version of bp_get_page_title()
271
  *
272
+ * @deprecated BuddyPress (1.5)
273
  * @deprecated Use wp_title()
274
+ * @since BuddyPress (1.0)
275
  */
276
  function bp_page_title() {
277
  echo bp_get_page_title();
280
  * Prior to BuddyPress 1.5, this was used to generate the page's <title> text.
281
  * Now, just simply use wp_title().
282
  *
283
+ * @deprecated BuddyPress (1.5)
284
  * @deprecated Use wp_title()
285
+ * @since BuddyPress (1.0)
286
  */
287
  function bp_get_page_title() {
288
  _deprecated_function( __FUNCTION__, '1.5', 'wp_title()' );
297
  /**
298
  * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url().
299
  *
300
+ * @deprecated BuddyPress (1.5)
301
  * @deprecated Use wp_logout_url()
302
+ * @since BuddyPress (1.0)
303
  */
304
  function bp_log_out_link() {
305
  _deprecated_function( __FUNCTION__, '1.5', 'wp_logout_url()' );
311
  /**
312
  * Send an email and a BP notification on receipt of an @-mention in a group
313
  *
314
+ * @deprecated BuddyPress (1.5)
315
  * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification()
316
  */
317
  function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) {
 
 
318
  _deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' );
319
 
320
  /* Scan for @username strings in an activity update. Notify each user. */
349
  // Set up and send the message
350
  $ud = bp_core_get_core_userdata( $receiver_user_id );
351
  $to = $ud->user_email;
352
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name ) ) );
 
353
 
354
  $message = sprintf( __(
355
  '%1$s mentioned you in the group "%2$s":
377
 
378
  /**
379
  * BP 1.5 simplified notification functions a bit
380
+ * @deprecated BuddyPress (1.5)
381
  */
382
  function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) {
383
  _deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_type()' );
391
 
392
  /**
393
  * In BP 1.5, these functions were renamed for greater consistency
394
+ * @deprecated BuddyPress (1.5)
395
  */
396
  function bp_forum_directory_permalink() {
397
  _deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' );
404
 
405
  /**
406
  * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template.
407
+ * @deprecated BuddyPress (1.5)
408
  */
409
  function bp_search_form() {
410
  _deprecated_function( __FUNCTION__, '1.1', 'No longer required.' );
424
 
425
  /**
426
  * Some _is_ function had their names normalized
427
+ * @deprecated BuddyPress (1.5)
428
  */
429
  function bp_is_profile_edit() {
430
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_profile_edit()' );
431
  return bp_is_user_profile_edit();
432
  }
433
 
434
+ /**
435
+ * @deprecated BuddyPress (1.5)
436
+ */
437
  function bp_is_change_avatar() {
438
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_change_avatar()' );
439
  return bp_is_user_change_avatar();
440
  }
441
 
442
+ /**
443
+ * @deprecated BuddyPress (1.5)
444
+ */
445
  function bp_is_friend_requests() {
446
  _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' );
447
  return bp_is_user_friend_requests();
452
  * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group
453
  * You should be using bp_is_root_component().
454
  *
455
+ * @deprecated BuddyPress (1.5)
456
  * @deprecated bp_is_root_component()
457
  * @return true if root component, else false.
458
  */
467
  * Contains functions which were moved out of BP-Default's functions.php
468
  * in BuddyPress 1.5.
469
  *
470
+ * @deprecated BuddyPress (1.5)
471
  * @since BuddyPress (1.5)
472
  */
473
  function bp_dtheme_deprecated() {
477
  * Settings > Reading screen for selecting the page to show on front to
478
  * include "Activity Stream." As of 1.5.x, it is no longer required.
479
  *
480
+ * @deprecated BuddyPress (1.5)
481
  * @deprecated No longer required.
482
  * @param string $page_html A list of pages as a dropdown (select list)
483
  * @return string
484
  * @see wp_dropdown_pages()
485
+ * @since BuddyPress (1.2)
486
  */
487
  function bp_dtheme_wp_pages_filter( $page_html ) {
488
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
495
  * In BuddyPress 1.2.x, this function hijacked the saving of page on front setting to save the activity stream setting.
496
  * As of 1.5.x, it is no longer required.
497
  *
498
+ * @deprecated BuddyPress (1.5)
499
  * @deprecated No longer required.
500
  * @param $string $oldvalue Previous value of get_option( 'page_on_front' )
501
  * @param $string $oldvalue New value of get_option( 'page_on_front' )
502
  * @return string
503
+ * @since BuddyPress (1.2)
504
  */
505
  function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) {
506
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
516
  * In BuddyPress 1.2.x, this function loaded the activity stream template if the front page display settings allow.
517
  * As of 1.5.x, it is no longer required.
518
  *
519
+ * @deprecated BuddyPress (1.5)
520
  * @deprecated No longer required.
521
  * @param string $template Absolute path to the page template
522
  * @return string
523
+ * @since BuddyPress (1.2)
524
  */
525
  function bp_dtheme_page_on_front_template( $template ) {
526
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
533
  * In BuddyPress 1.2.x, this forced the page ID as a string to stop the get_posts query from kicking up a fuss.
534
  * As of 1.5.x, it is no longer required.
535
  *
536
+ * @deprecated BuddyPress (1.5)
537
  * @deprecated No longer required.
538
+ * @since BuddyPress (1.2)
539
  */
540
  function bp_dtheme_fix_get_posts_on_activity_front() {
541
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
547
  * In BuddyPress 1.2.x, this was used as part of the code that set the activity stream to be on the front page.
548
  * As of 1.5.x, it is no longer required.
549
  *
550
+ * @deprecated BuddyPress (1.5)
551
  * @deprecated No longer required.
552
  * @param array $posts Posts as retrieved by WP_Query
553
  * @return array
554
+ * @since BuddyPress (1.2.5)
555
  */
556
  function bp_dtheme_fix_the_posts_on_activity_front( $posts ) {
557
  _deprecated_function( __FUNCTION__, '1.5', "No longer required." );
564
  * In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
565
  * As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
566
  *
567
+ * @deprecated BuddyPress (1.5)
568
  * @deprecated Enqueue the comment-reply script in your theme's header.php.
569
+ * @since BuddyPress (1.2)
570
  */
571
  function bp_dtheme_add_blog_comments_js() {
572
  _deprecated_function( __FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php." );
705
  function bp_core_screen_delete_account_content() {
706
  _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
707
  }
 
bp-core/deprecated/1.6.php CHANGED
@@ -8,41 +8,71 @@
8
  * @deprecated Since 1.6
9
  */
10
 
 
 
 
11
  /** Toolbar functions *********************************************************/
12
 
 
 
 
13
  function bp_admin_bar_remove_wp_menus() {
14
  _deprecated_function( __FUNCTION__, '1.6' );
15
  }
16
 
 
 
 
17
  function bp_admin_bar_root_site() {
18
  _deprecated_function( __FUNCTION__, '1.6' );
19
  }
20
 
 
 
 
21
  function bp_admin_bar_my_sites_menu() {
22
  _deprecated_function( __FUNCTION__, '1.6' );
23
  }
24
 
25
- function bp_admin_bar_comments_menu( $wp_admin_bar ) {
 
 
 
26
  _deprecated_function( __FUNCTION__, '1.6' );
27
  }
28
 
 
 
 
29
  function bp_admin_bar_appearance_menu() {
30
  _deprecated_function( __FUNCTION__, '1.6' );
31
  }
32
 
 
 
 
33
  function bp_admin_bar_updates_menu() {
34
  _deprecated_function( __FUNCTION__, '1.6' );
35
  }
36
 
 
 
 
37
  function bp_members_admin_bar_my_account_logout() {
38
  _deprecated_function( __FUNCTION__, '1.6' );
39
  }
40
 
 
 
 
41
  function bp_core_is_user_deleted( $user_id = 0 ) {
42
  _deprecated_function( __FUNCTION__, '1.6' );
43
  bp_is_user_deleted( $user_id );
44
  }
45
 
 
 
 
46
  function bp_core_is_user_spammer( $user_id = 0 ) {
47
  _deprecated_function( __FUNCTION__, '1.6' );
48
  bp_is_user_spammer( $user_id );
@@ -54,7 +84,7 @@ function bp_core_is_user_spammer( $user_id = 0 ) {
54
  */
55
 
56
  /**
57
- * @deprecated 1.6
58
  * @deprecated No longer used; see bp_blogs_transition_activity_status()
59
  */
60
  function bp_blogs_manage_comment( $comment_id, $comment_status ) {
@@ -66,7 +96,7 @@ function bp_blogs_manage_comment( $comment_id, $comment_status ) {
66
  */
67
 
68
  /**
69
- * @deprecated 1.6
70
  * @deprecated No longer used; see BP_Admin::admin_menus()
71
  */
72
  function bp_core_add_admin_menu() {
@@ -74,25 +104,13 @@ function bp_core_add_admin_menu() {
74
  }
75
 
76
  /**
77
- * @deprecated 1.6
78
  * @deprecated No longer used. We do ajax properly now.
79
  */
80
  function bp_core_add_ajax_hook() {
81
  _deprecated_function( __FUNCTION__, '1.6', 'No longer used' );
82
  }
83
 
84
- /**
85
- * Members functions
86
- */
87
-
88
- /**
89
- * @deprecated 1.6
90
- * @deprecated No longer used. Check for $bp->pages->activate->slug instead.
91
- */
92
- function bp_has_custom_activation_page() {
93
- _deprecated_function( __FUNCTION__, '1.6' );
94
- }
95
-
96
  /**
97
  * Friends functions
98
  */
@@ -100,7 +118,7 @@ function bp_has_custom_activation_page() {
100
  /**
101
  * Displays Friends header tabs
102
  *
103
- * @deprecated 1.6
104
  * @deprecated No longer used
105
  */
106
  function bp_friends_header_tabs() {
@@ -118,7 +136,7 @@ function bp_friends_header_tabs() {
118
  /**
119
  * Filters the title for the Friends component
120
  *
121
- * @deprecated 1.6
122
  * @deprecated No longer used
123
  */
124
  function bp_friends_filter_title() {
@@ -140,12 +158,10 @@ function bp_friends_filter_title() {
140
  }
141
 
142
 
143
- /**
144
- * Groups functions
145
- */
146
 
147
  /**
148
- * @deprecated 1.6
149
  * @deprecated Renamed to groups_get_id() for greater consistency
150
  */
151
  function groups_check_group_exists( $group_slug ) {
@@ -153,27 +169,21 @@ function groups_check_group_exists( $group_slug ) {
153
  return groups_get_id( $group_slug );
154
  }
155
 
156
- /**
157
- * Admin functions
158
- */
159
 
160
  /**
161
  * Loads admin panel styles and scripts.
162
  *
163
- * @deprecated 1.6
164
- * @deprecated No longer used.
165
  */
166
  function bp_core_add_admin_menu_styles() {
167
  _deprecated_function( __FUNCTION__, '1.6' );
168
  }
169
 
170
- /**
171
- * Activity functions
172
- */
173
 
174
  /**
175
- * @deprecated 1.6
176
- * @deprecated No longer used. Renamed to bp_activity_register_activity_actions().
177
  */
178
  function updates_register_activity_actions() {
179
  _deprecated_function( __FUNCTION__, '1.6' );
@@ -182,8 +192,7 @@ function updates_register_activity_actions() {
182
  /**
183
  * Sets the "From" address in emails sent
184
  *
185
- * @deprecated 1.6
186
- * @deprecated No longer used.
187
  * @return noreply@sitedomain email address
188
  */
189
  function bp_core_email_from_address_filter() {
@@ -209,6 +218,8 @@ function bp_core_email_from_address_filter() {
209
  *
210
  * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this
211
  * function was introduced in BP 1.6 for related backward compatibility reasons).
 
 
212
  */
213
  if ( !function_exists( 'bp_dtheme_register_actions' ) ) :
214
  function bp_die_legacy_ajax_callbacks() {
@@ -261,4 +272,3 @@ if ( !function_exists( 'bp_dtheme_register_actions' ) ) :
261
  }
262
  add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 );
263
  endif;
264
- ?>
8
  * @deprecated Since 1.6
9
  */
10
 
11
+ // Exit if accessed directly
12
+ if ( !defined( 'ABSPATH' ) ) exit;
13
+
14
  /** Toolbar functions *********************************************************/
15
 
16
+ /**
17
+ * @deprecated BuddyPress (1.6)
18
+ */
19
  function bp_admin_bar_remove_wp_menus() {
20
  _deprecated_function( __FUNCTION__, '1.6' );
21
  }
22
 
23
+ /**
24
+ * @deprecated BuddyPress (1.6)
25
+ */
26
  function bp_admin_bar_root_site() {
27
  _deprecated_function( __FUNCTION__, '1.6' );
28
  }
29
 
30
+ /**
31
+ * @deprecated BuddyPress (1.6)
32
+ */
33
  function bp_admin_bar_my_sites_menu() {
34
  _deprecated_function( __FUNCTION__, '1.6' );
35
  }
36
 
37
+ /**
38
+ * @deprecated BuddyPress (1.6)
39
+ */
40
+ function bp_admin_bar_comments_menu( $wp_admin_bar = '' ) {
41
  _deprecated_function( __FUNCTION__, '1.6' );
42
  }
43
 
44
+ /**
45
+ * @deprecated BuddyPress (1.6)
46
+ */
47
  function bp_admin_bar_appearance_menu() {
48
  _deprecated_function( __FUNCTION__, '1.6' );
49
  }
50
 
51
+ /**
52
+ * @deprecated BuddyPress (1.6)
53
+ */
54
  function bp_admin_bar_updates_menu() {
55
  _deprecated_function( __FUNCTION__, '1.6' );
56
  }
57
 
58
+ /**
59
+ * @deprecated BuddyPress (1.6)
60
+ */
61
  function bp_members_admin_bar_my_account_logout() {
62
  _deprecated_function( __FUNCTION__, '1.6' );
63
  }
64
 
65
+ /**
66
+ * @deprecated BuddyPress (1.6)
67
+ */
68
  function bp_core_is_user_deleted( $user_id = 0 ) {
69
  _deprecated_function( __FUNCTION__, '1.6' );
70
  bp_is_user_deleted( $user_id );
71
  }
72
 
73
+ /**
74
+ * @deprecated BuddyPress (1.6)
75
+ */
76
  function bp_core_is_user_spammer( $user_id = 0 ) {
77
  _deprecated_function( __FUNCTION__, '1.6' );
78
  bp_is_user_spammer( $user_id );
84
  */
85
 
86
  /**
87
+ * @deprecated BuddyPress (1.6)
88
  * @deprecated No longer used; see bp_blogs_transition_activity_status()
89
  */
90
  function bp_blogs_manage_comment( $comment_id, $comment_status ) {
96
  */
97
 
98
  /**
99
+ * @deprecated BuddyPress (1.6)
100
  * @deprecated No longer used; see BP_Admin::admin_menus()
101
  */
102
  function bp_core_add_admin_menu() {
104
  }
105
 
106
  /**
107
+ * @deprecated BuddyPress (1.6)
108
  * @deprecated No longer used. We do ajax properly now.
109
  */
110
  function bp_core_add_ajax_hook() {
111
  _deprecated_function( __FUNCTION__, '1.6', 'No longer used' );
112
  }
113
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  /**
115
  * Friends functions
116
  */
118
  /**
119
  * Displays Friends header tabs
120
  *
121
+ * @deprecated BuddyPress (1.6)
122
  * @deprecated No longer used
123
  */
124
  function bp_friends_header_tabs() {
136
  /**
137
  * Filters the title for the Friends component
138
  *
139
+ * @deprecated BuddyPress (1.6)
140
  * @deprecated No longer used
141
  */
142
  function bp_friends_filter_title() {
158
  }
159
 
160
 
161
+ /** Groups functions **********************************************************/
 
 
162
 
163
  /**
164
+ * @deprecated BuddyPress (1.6)
165
  * @deprecated Renamed to groups_get_id() for greater consistency
166
  */
167
  function groups_check_group_exists( $group_slug ) {
169
  return groups_get_id( $group_slug );
170
  }
171
 
172
+ /** Admin functions ***********************************************************/
 
 
173
 
174
  /**
175
  * Loads admin panel styles and scripts.
176
  *
177
+ * @deprecated BuddyPress (1.6)
 
178
  */
179
  function bp_core_add_admin_menu_styles() {
180
  _deprecated_function( __FUNCTION__, '1.6' );
181
  }
182
 
183
+ /** Activity functions ********************************************************/
 
 
184
 
185
  /**
186
+ * @deprecated BuddyPress (1.6)
 
187
  */
188
  function updates_register_activity_actions() {
189
  _deprecated_function( __FUNCTION__, '1.6' );
192
  /**
193
  * Sets the "From" address in emails sent
194
  *
195
+ * @deprecated BuddyPress (1.6)
 
196
  * @return noreply@sitedomain email address
197
  */
198
  function bp_core_email_from_address_filter() {
218
  *
219
  * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this
220
  * function was introduced in BP 1.6 for related backward compatibility reasons).
221
+ *
222
+ * @deprecated BuddyPress (1.6)
223
  */
224
  if ( !function_exists( 'bp_dtheme_register_actions' ) ) :
225
  function bp_die_legacy_ajax_callbacks() {
272
  }
273
  add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 );
274
  endif;
 
bp-core/deprecated/1.7.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Deprecated Functions
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage Core
7
+ * @deprecated Since 1.7
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ /**
14
+ * Output the BuddyPress maintenance mode
15
+ *
16
+ * @since BuddyPress (1.6)
17
+ * @deprecated BuddyPress (1.7)
18
+ * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode
19
+ */
20
+ function bp_maintenance_mode() {
21
+ echo bp_get_maintenance_mode();
22
+ }
23
+ /**
24
+ * Return the BuddyPress maintenance mode
25
+ *
26
+ * @since BuddyPress (1.6)
27
+ * @deprecated BuddyPress (1.7)
28
+ * @return string The BuddyPress maintenance mode
29
+ */
30
+ function bp_get_maintenance_mode() {
31
+ return buddypress()->maintenance_mode;
32
+ }
33
+
34
+ /**
35
+ * @deprecated BuddyPress (1.7)
36
+ */
37
+ function xprofile_get_profile() {
38
+ _deprecated_function( __FUNCTION__, '1.7' );
39
+ bp_locate_template( array( 'profile/profile-loop.php' ), true );
40
+ }
41
+
42
+ /**
43
+ * @deprecated BuddyPress (1.7)
44
+ */
45
+ function bp_get_profile_header() {
46
+ _deprecated_function( __FUNCTION__, '1.7' );
47
+ bp_locate_template( array( 'profile/profile-header.php' ), true );
48
+ }
49
+
50
+ /**
51
+ * @deprecated BuddyPress (1.7)
52
+ * @param string $component_name
53
+ * @return boolean
54
+ */
55
+ function bp_exists( $component_name ) {
56
+ _deprecated_function( __FUNCTION__, '1.7' );
57
+ if ( function_exists( $component_name . '_install' ) )
58
+ return true;
59
+
60
+ return false;
61
+ }
62
+
63
+ /**
64
+ * @deprecated BuddyPress (1.7)
65
+ */
66
+ function bp_get_plugin_sidebar() {
67
+ _deprecated_function( __FUNCTION__, '1.7' );
68
+ bp_locate_template( array( 'plugin-sidebar.php' ), true );
69
+ }
70
+
71
+ /**
72
+ * On multiblog installations you must first allow themes to be activated and
73
+ * show up on the theme selection screen. This function will let the BuddyPress
74
+ * bundled themes show up on the root blog selection screen and bypass this
75
+ * step. It also means that the themes won't show for selection on other blogs.
76
+ *
77
+ * @deprecated BuddyPress (1.7)
78
+ * @package BuddyPress Core
79
+ */
80
+ function bp_core_allow_default_theme( $themes ) {
81
+ _deprecated_function( __FUNCTION__, '1.7' );
82
+
83
+ if ( !bp_current_user_can( 'bp_moderate' ) )
84
+ return $themes;
85
+
86
+ if ( bp_get_root_blog_id() != get_current_blog_id() )
87
+ return $themes;
88
+
89
+ if ( isset( $themes['bp-default'] ) )
90
+ return $themes;
91
+
92
+ $themes['bp-default'] = true;
93
+
94
+ return $themes;
95
+ }
96
+
97
+ /**
98
+ * No longer used by BuddyPress core
99
+ *
100
+ * @deprecated BuddyPress (1.7)
101
+ * @param string $page
102
+ * @return boolean True if is BuddyPress page
103
+ */
104
+ function bp_is_page( $page = '' ) {
105
+ _deprecated_function( __FUNCTION__, '1.7' );
106
+
107
+ if ( !bp_is_user() && bp_is_current_component( $page ) )
108
+ return true;
109
+
110
+ if ( 'home' == $page )
111
+ return is_front_page();
112
+
113
+ return false;
114
+ }
115
+
116
+ /** Admin *********************************************************************/
117
+
118
+ /**
119
+ * This function was originally used to update pre-1.1 schemas, but that was
120
+ * before we had a legitimate update process.
121
+ *
122
+ * @deprecated BuddyPress (1.7)
123
+ * @global WPDB $wpdb
124
+ */
125
+ function bp_update_db_stuff() {
126
+ global $wpdb;
127
+
128
+ $bp = buddypress();
129
+ $bp_prefix = bp_core_get_table_prefix();
130
+
131
+ // Rename the old user activity cached table if needed.
132
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) {
133
+ $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
134
+ }
135
+
136
+ // Rename fields from pre BP 1.2
137
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
138
+ if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) {
139
+ $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
140
+ }
141
+
142
+ if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) {
143
+ $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
144
+ }
145
+ }
146
+
147
+ // On first installation - record all existing blogs in the system.
148
+ if ( !(int) $bp->site_options['bp-blogs-first-install'] ) {
149
+ bp_blogs_record_existing_blogs();
150
+ bp_update_option( 'bp-blogs-first-install', 1 );
151
+ }
152
+
153
+ if ( is_multisite() ) {
154
+ bp_core_add_illegal_names();
155
+ }
156
+
157
+ // Update and remove the message threads table if it exists
158
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
159
+ if ( BP_Messages_Thread::update_tables() ) {
160
+ $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
161
+ }
162
+ }
163
+ }
bp-core/js/widget-members.dev.js DELETED
@@ -1,49 +0,0 @@
1
- jQuery(document).ready( function() {
2
- jQuery(".widget div#members-list-options a").live('click',
3
- function() {
4
- var link = this;
5
- jQuery(link).addClass('loading');
6
-
7
- jQuery(".widget div#members-list-options a").removeClass("selected");
8
- jQuery(this).addClass('selected');
9
-
10
- jQuery.post( ajaxurl, {
11
- action: 'widget_members',
12
- 'cookie': encodeURIComponent(document.cookie),
13
- '_wpnonce': jQuery("input#_wpnonce-members").val(),
14
- 'max-members': jQuery("input#members_widget_max").val(),
15
- 'filter': jQuery(this).attr('id')
16
- },
17
- function(response)
18
- {
19
- jQuery(link).removeClass('loading');
20
- member_wiget_response(response);
21
- });
22
-
23
- return false;
24
- }
25
- );
26
- });
27
-
28
- function member_wiget_response(response) {
29
- response = response.substr(0, response.length-1);
30
- response = response.split('[[SPLIT]]');
31
-
32
- if ( response[0] != "-1" ) {
33
- jQuery(".widget ul#members-list").fadeOut(200,
34
- function() {
35
- jQuery(".widget ul#members-list").html(response[1]);
36
- jQuery(".widget ul#members-list").fadeIn(200);
37
- }
38
- );
39
-
40
- } else {
41
- jQuery(".widget ul#members-list").fadeOut(200,
42
- function() {
43
- var message = '<p>' + response[1] + '</p>';
44
- jQuery(".widget ul#members-list").html(message);
45
- jQuery(".widget ul#members-list").fadeIn(200);
46
- }
47
- );
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/js/widget-members.js CHANGED
@@ -1 +1,49 @@
1
- jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").live("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#members-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");member_wiget_response(b)});return false})});function member_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]);jQuery(".widget ul#members-list").fadeIn(200)})}else{jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b);jQuery(".widget ul#members-list").fadeIn(200)})}};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready( function() {
2
+ jQuery(".widget div#members-list-options a").on('click',
3
+ function() {
4
+ var link = this;
5
+ jQuery(link).addClass('loading');
6
+
7
+ jQuery(".widget div#members-list-options a").removeClass("selected");
8
+ jQuery(this).addClass('selected');
9
+
10
+ jQuery.post( ajaxurl, {
11
+ action: 'widget_members',
12
+ 'cookie': encodeURIComponent(document.cookie),
13
+ '_wpnonce': jQuery("input#_wpnonce-members").val(),
14
+ 'max-members': jQuery("input#members_widget_max").val(),
15
+ 'filter': jQuery(this).attr('id')
16
+ },
17
+ function(response)
18
+ {
19
+ jQuery(link).removeClass('loading');
20
+ member_wiget_response(response);
21
+ });
22
+
23
+ return false;
24
+ }
25
+ );
26
+ });
27
+
28
+ function member_wiget_response(response) {
29
+ response = response.substr(0, response.length-1);
30
+ response = response.split('[[SPLIT]]');
31
+
32
+ if ( response[0] != "-1" ) {
33
+ jQuery(".widget ul#members-list").fadeOut(200,
34
+ function() {
35
+ jQuery(".widget ul#members-list").html(response[1]);
36
+ jQuery(".widget ul#members-list").fadeIn(200);
37
+ }
38
+ );
39
+
40
+ } else {
41
+ jQuery(".widget ul#members-list").fadeOut(200,
42
+ function() {
43
+ var message = '<p>' + response[1] + '</p>';
44
+ jQuery(".widget ul#members-list").html(message);
45
+ jQuery(".widget ul#members-list").fadeIn(200);
46
+ }
47
+ );
48
+ }
49
+ }
bp-core/js/widget-members.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#members-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");member_wiget_response(b)});return false})});function member_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]);jQuery(".widget ul#members-list").fadeIn(200)})}else{jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b);jQuery(".widget ul#members-list").fadeIn(200)})}};
bp-forums/bb-config.php CHANGED
@@ -8,4 +8,3 @@
8
  */
9
 
10
  header("HTTP/1.0 403 Forbidden"); die;
11
- ?>
8
  */
9
 
10
  header("HTTP/1.0 403 Forbidden"); die;
 
bp-forums/bp-forums-actions.php CHANGED
@@ -1,5 +1,3 @@
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
-
5
- ?>
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
 
 
bp-forums/bp-forums-bbpress-sa.php CHANGED
@@ -420,5 +420,3 @@ function bp_bb_dbDelta($queries, $execute = true) {
420
 
421
  return $for_update;
422
  }
423
-
424
- ?>
420
 
421
  return $for_update;
422
  }
 
 
bp-forums/bp-forums-bbpress.php CHANGED
@@ -5,4 +5,3 @@
5
 
6
  // Exit if accessed directly
7
  if ( !defined( 'ABSPATH' ) ) exit;
8
- ?>
5
 
6
  // Exit if accessed directly
7
  if ( !defined( 'ABSPATH' ) ) exit;
 
bp-forums/bp-forums-filters.php CHANGED
@@ -150,7 +150,6 @@ add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
150
  * @package BuddyPress
151
  * @since BuddyPress (1.5)
152
  *
153
- * @global object $wpdb The WordPress database global
154
  * @param string $sql
155
  * @return string $sql
156
  */
@@ -176,7 +175,7 @@ function bp_forums_add_replied_distinct_sql( $sql ) {
176
  function bp_forums_add_replied_join_sql( $sql ) {
177
  global $bbdb;
178
 
179
- $sql .= " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id ";
180
 
181
  return $sql;
182
  }
@@ -203,5 +202,3 @@ function bp_forums_add_replied_where_sql( $sql ) {
203
 
204
  return $sql;
205
  }
206
-
207
- ?>
150
  * @package BuddyPress
151
  * @since BuddyPress (1.5)
152
  *
 
153
  * @param string $sql
154
  * @return string $sql
155
  */
175
  function bp_forums_add_replied_join_sql( $sql ) {
176
  global $bbdb;
177
 
178
+ $sql .= " LEFT JOIN {$bbdb->posts} p ON p.topic_id = t.topic_id ";
179
 
180
  return $sql;
181
  }
202
 
203
  return $sql;
204
  }
 
 
bp-forums/bp-forums-functions.php CHANGED
@@ -34,7 +34,7 @@ function bp_forums_is_bbpress_active() {
34
  * @return boolean True if option exists, false if not
35
  */
36
  function bp_forums_is_installed_correctly() {
37
- global $bp;
38
 
39
  if ( isset( $bp->forums->bbconfig ) && is_file( $bp->forums->bbconfig ) )
40
  return true;
@@ -51,9 +51,7 @@ function bp_forums_is_installed_correctly() {
51
  * @return bool True if set, False if empty
52
  */
53
  function bp_forums_has_directory() {
54
- global $bp;
55
-
56
- return (bool) !empty( $bp->pages->forums->id );
57
  }
58
 
59
  /** Forum Functions ***********************************************************/
@@ -66,15 +64,13 @@ function bp_forums_get_forum( $forum_id ) {
66
  function bp_forums_new_forum( $args = '' ) {
67
  do_action( 'bbpress_init' );
68
 
69
- $defaults = array(
70
  'forum_name' => '',
71
  'forum_desc' => '',
72
  'forum_parent_id' => bp_forums_parent_forum_id(),
73
  'forum_order' => false,
74
  'forum_is_category' => 0
75
- );
76
-
77
- $r = wp_parse_args( $args, $defaults );
78
  extract( $r, EXTR_SKIP );
79
 
80
  return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
@@ -83,7 +79,7 @@ function bp_forums_new_forum( $args = '' ) {
83
  function bp_forums_update_forum( $args = '' ) {
84
  do_action( 'bbpress_init' );
85
 
86
- $defaults = array(
87
  'forum_id' => '',
88
  'forum_name' => '',
89
  'forum_desc' => '',
@@ -91,9 +87,7 @@ function bp_forums_update_forum( $args = '' ) {
91
  'forum_parent_id' => bp_forums_parent_forum_id(),
92
  'forum_order' => false,
93
  'forum_is_category' => 0
94
- );
95
-
96
- $r = wp_parse_args( $args, $defaults );
97
  extract( $r, EXTR_SKIP );
98
 
99
  return bb_update_forum( array( 'forum_id' => (int) $forum_id, 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_slug' => stripslashes( $forum_slug ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
@@ -112,11 +106,9 @@ add_action( 'groups_delete_group', 'bp_forums_delete_group_forum' );
112
  /** Topic Functions ***********************************************************/
113
 
114
  function bp_forums_get_forum_topics( $args = '' ) {
115
- global $bp;
116
-
117
  do_action( 'bbpress_init' );
118
 
119
- $defaults = array(
120
  'type' => 'newest',
121
  'forum_id' => false,
122
  'user_id' => false,
@@ -127,9 +119,7 @@ function bp_forums_get_forum_topics( $args = '' ) {
127
  'exclude' => false,
128
  'show_stickies' => 'all',
129
  'filter' => false // if $type = tag then filter is the tag name, otherwise it's terms to search on.
130
- );
131
-
132
- $r = wp_parse_args( $args, $defaults );
133
  extract( $r, EXTR_SKIP );
134
 
135
  if ( class_exists( 'BB_Query' ) ) {
@@ -183,7 +173,7 @@ function bp_forums_new_topic( $args = '' ) {
183
 
184
  do_action( 'bbpress_init' );
185
 
186
- $defaults = array(
187
  'topic_title' => '',
188
  'topic_slug' => '',
189
  'topic_text' => '',
@@ -196,9 +186,7 @@ function bp_forums_new_topic( $args = '' ) {
196
  'topic_open' => 1,
197
  'topic_tags' => false, // accepts array or comma delim
198
  'forum_id' => 0 // accepts ids or slugs
199
- );
200
-
201
- $r = wp_parse_args( $args, $defaults );
202
  extract( $r, EXTR_SKIP );
203
 
204
  $topic_title = strip_tags( $topic_title );
@@ -228,22 +216,18 @@ function bp_forums_new_topic( $args = '' ) {
228
  }
229
 
230
  function bp_forums_update_topic( $args = '' ) {
231
- global $bp;
232
-
233
  do_action( 'bbpress_init' );
234
 
235
- $defaults = array(
236
  'topic_id' => false,
237
  'topic_title' => '',
238
  'topic_text' => '',
239
  'topic_tags' => false
240
- );
241
-
242
- $r = wp_parse_args( $args, $defaults );
243
  extract( $r, EXTR_SKIP );
244
 
245
- // Check if the user is a spammer
246
- if ( bp_is_user_inactive( bp_loggedin_user_id() ) )
247
  return false;
248
 
249
  // bb_insert_topic() will append tags, but not remove them. So we remove all existing tags.
@@ -263,16 +247,12 @@ function bp_forums_update_topic( $args = '' ) {
263
  }
264
 
265
  function bp_forums_sticky_topic( $args = '' ) {
266
- global $bp;
267
-
268
  do_action( 'bbpress_init' );
269
 
270
- $defaults = array(
271
  'topic_id' => false,
272
  'mode' => 'stick' // stick/unstick
273
- );
274
-
275
- $r = wp_parse_args( $args, $defaults );
276
  extract( $r, EXTR_SKIP );
277
 
278
  if ( 'stick' == $mode )
@@ -284,16 +264,12 @@ function bp_forums_sticky_topic( $args = '' ) {
284
  }
285
 
286
  function bp_forums_openclose_topic( $args = '' ) {
287
- global $bp;
288
-
289
  do_action( 'bbpress_init' );
290
 
291
- $defaults = array(
292
  'topic_id' => false,
293
  'mode' => 'close' // stick/unstick
294
- );
295
-
296
- $r = wp_parse_args( $args, $defaults );
297
  extract( $r, EXTR_SKIP );
298
 
299
  if ( 'close' == $mode )
@@ -305,15 +281,11 @@ function bp_forums_openclose_topic( $args = '' ) {
305
  }
306
 
307
  function bp_forums_delete_topic( $args = '' ) {
308
- global $bp;
309
-
310
  do_action( 'bbpress_init' );
311
 
312
- $defaults = array(
313
  'topic_id' => false
314
- );
315
-
316
- $r = wp_parse_args( $args, $defaults );
317
  extract( $r, EXTR_SKIP );
318
 
319
  return bb_delete_topic( $topic_id, 1 );
@@ -345,35 +317,52 @@ function bp_forums_total_topic_count() {
345
  * Check to see whether a user has already left this particular reply on a given post.
346
  * Prevents dupes.
347
  *
348
- * @since 1.6
349
  *
350
  * @param str $text The text of the comment
351
  * @param int $topic_id The topic id
352
  * @param int $user_id The user id
353
  */
354
  function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
355
- global $wpdb;
356
 
357
  $reply_exists = false;
358
-
359
  if ( $text && $topic_id && $user_id ) {
360
  do_action( 'bbpress_init' );
361
-
362
  $args = array(
363
  'post_author_id' => $user_id,
364
  'topic_id' => $topic_id
365
  );
366
-
367
- // BB_Query's post_text parameter does a MATCH, while we need exact matches
368
- add_filter( 'get_posts_where', create_function( '$q', 'return $q . " AND p.post_text = \'' . $wpdb->escape( $text ) . '\'";' ) );
369
 
 
 
 
 
 
370
  $query = new BB_Query( 'post', $args );
371
-
372
- $reply_exists = !empty( $query->results );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
374
-
375
- return apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );
376
- }
377
 
378
  /**
379
  * Get a total "Topics Started" count for a given user
@@ -385,8 +374,6 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
385
  * @return int $count The topic count
386
  */
387
  function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) {
388
- global $bp;
389
-
390
  do_action( 'bbpress_init' );
391
 
392
  if ( !$user_id )
@@ -425,8 +412,6 @@ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' )
425
  * @return int $count
426
  */
427
  function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) {
428
- global $bp;
429
-
430
  do_action( 'bbpress_init' );
431
 
432
  if ( !$user_id )
@@ -462,11 +447,13 @@ function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active'
462
  }
463
 
464
  function bp_forums_get_topic_extras( $topics ) {
465
- global $bp, $wpdb, $bbdb;
466
 
467
  if ( empty( $topics ) )
468
  return $topics;
469
 
 
 
470
  // Get the topic ids
471
  foreach ( (array) $topics as $topic ) $topic_ids[] = $topic->topic_id;
472
  $topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) );
@@ -538,23 +525,18 @@ function bp_forums_get_post( $post_id ) {
538
  }
539
 
540
  function bp_forums_delete_post( $args = '' ) {
541
- global $bp;
542
-
543
  do_action( 'bbpress_init' );
544
 
545
- $defaults = array(
546
  'post_id' => false
547
- );
548
 
549
- $r = wp_parse_args( $args, $defaults );
550
  extract( $r, EXTR_SKIP );
551
 
552
  return bb_delete_post( $post_id, 1 );
553
  }
554
 
555
  function bp_forums_insert_post( $args = '' ) {
556
- global $bp;
557
-
558
  do_action( 'bbpress_init' );
559
 
560
  $defaults = array(
@@ -648,7 +630,7 @@ function bp_forums_get_forum_topicpost_count( $forum_id ) {
648
  }
649
 
650
  function bp_forums_filter_caps( $allcaps ) {
651
- global $bp, $wp_roles, $bb_table_prefix;
652
 
653
  if ( !bp_loggedin_user_id() )
654
  return $allcaps;
@@ -748,4 +730,3 @@ function bp_embed_forum_cache( $cache, $id, $cachekey ) {
748
  function bp_embed_forum_save_cache( $cache, $cachekey, $id ) {
749
  bb_update_postmeta( $id, $cachekey, $cache );
750
  }
751
- ?>
34
  * @return boolean True if option exists, false if not
35
  */
36
  function bp_forums_is_installed_correctly() {
37
+ $bp = buddypress();
38
 
39
  if ( isset( $bp->forums->bbconfig ) && is_file( $bp->forums->bbconfig ) )
40
  return true;
51
  * @return bool True if set, False if empty
52
  */
53
  function bp_forums_has_directory() {
54
+ return (bool) !empty( buddypress()->pages->forums->id );
 
 
55
  }
56
 
57
  /** Forum Functions ***********************************************************/
64
  function bp_forums_new_forum( $args = '' ) {
65
  do_action( 'bbpress_init' );
66
 
67
+ $r = wp_parse_args( $args, array(
68
  'forum_name' => '',
69
  'forum_desc' => '',
70
  'forum_parent_id' => bp_forums_parent_forum_id(),
71
  'forum_order' => false,
72
  'forum_is_category' => 0
73
+ ) );
 
 
74
  extract( $r, EXTR_SKIP );
75
 
76
  return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
79
  function bp_forums_update_forum( $args = '' ) {
80
  do_action( 'bbpress_init' );
81
 
82
+ $r = wp_parse_args( $args, array(
83
  'forum_id' => '',
84
  'forum_name' => '',
85
  'forum_desc' => '',
87
  'forum_parent_id' => bp_forums_parent_forum_id(),
88
  'forum_order' => false,
89
  'forum_is_category' => 0
90
+ ) );
 
 
91
  extract( $r, EXTR_SKIP );
92
 
93
  return bb_update_forum( array( 'forum_id' => (int) $forum_id, 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_slug' => stripslashes( $forum_slug ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
106
  /** Topic Functions ***********************************************************/
107
 
108
  function bp_forums_get_forum_topics( $args = '' ) {
 
 
109
  do_action( 'bbpress_init' );
110
 
111
+ $r = wp_parse_args( $args, array(
112
  'type' => 'newest',
113
  'forum_id' => false,
114
  'user_id' => false,
119
  'exclude' => false,
120
  'show_stickies' => 'all',
121
  'filter' => false // if $type = tag then filter is the tag name, otherwise it's terms to search on.
122
+ ) );
 
 
123
  extract( $r, EXTR_SKIP );
124
 
125
  if ( class_exists( 'BB_Query' ) ) {
173
 
174
  do_action( 'bbpress_init' );
175
 
176
+ $r = wp_parse_args( $args, array(
177
  'topic_title' => '',
178
  'topic_slug' => '',
179
  'topic_text' => '',
186
  'topic_open' => 1,
187
  'topic_tags' => false, // accepts array or comma delim
188
  'forum_id' => 0 // accepts ids or slugs
189
+ ) );
 
 
190
  extract( $r, EXTR_SKIP );
191
 
192
  $topic_title = strip_tags( $topic_title );
216
  }
217
 
218
  function bp_forums_update_topic( $args = '' ) {
 
 
219
  do_action( 'bbpress_init' );
220
 
221
+ $r = wp_parse_args( $args, array(
222
  'topic_id' => false,
223
  'topic_title' => '',
224
  'topic_text' => '',
225
  'topic_tags' => false
226
+ ) );
 
 
227
  extract( $r, EXTR_SKIP );
228
 
229
+ // Check if the user is a spammer
230
+ if ( bp_is_user_inactive( bp_loggedin_user_id() ) )
231
  return false;
232
 
233
  // bb_insert_topic() will append tags, but not remove them. So we remove all existing tags.
247
  }
248
 
249
  function bp_forums_sticky_topic( $args = '' ) {
 
 
250
  do_action( 'bbpress_init' );
251
 
252
+ $r = wp_parse_args( $args, array(
253
  'topic_id' => false,
254
  'mode' => 'stick' // stick/unstick
255
+ ) );
 
 
256
  extract( $r, EXTR_SKIP );
257
 
258
  if ( 'stick' == $mode )
264
  }
265
 
266
  function bp_forums_openclose_topic( $args = '' ) {
 
 
267
  do_action( 'bbpress_init' );
268
 
269
+ $r = wp_parse_args( $args, array(
270
  'topic_id' => false,
271
  'mode' => 'close' // stick/unstick
272
+ ) );
 
 
273
  extract( $r, EXTR_SKIP );
274
 
275
  if ( 'close' == $mode )
281
  }
282
 
283
  function bp_forums_delete_topic( $args = '' ) {
 
 
284
  do_action( 'bbpress_init' );
285
 
286
+ $r = wp_parse_args( $args, array(
287
  'topic_id' => false
288
+ ) );
 
 
289
  extract( $r, EXTR_SKIP );
290
 
291
  return bb_delete_topic( $topic_id, 1 );
317
  * Check to see whether a user has already left this particular reply on a given post.
318
  * Prevents dupes.
319
  *
320
+ * @since BuddyPress (1.6)
321
  *
322
  * @param str $text The text of the comment
323
  * @param int $topic_id The topic id
324
  * @param int $user_id The user id
325
  */
326
  function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
 
327
 
328
  $reply_exists = false;
329
+
330
  if ( $text && $topic_id && $user_id ) {
331
  do_action( 'bbpress_init' );
332
+
333
  $args = array(
334
  'post_author_id' => $user_id,
335
  'topic_id' => $topic_id
336
  );
 
 
 
337
 
338
+ // Set the reply_exists_text so we can check it in the filter below
339
+ buddypress()->forums->reply_exists_text = $text;
340
+
341
+ // BB_Query's post_text parameter does a MATCH, while we need exact matches
342
+ add_filter( 'get_posts_where', '_bp_forums_reply_exists_posts_where' );
343
  $query = new BB_Query( 'post', $args );
344
+ remove_filter( 'get_posts_where', '_bp_forums_reply_exists_posts_where' );
345
+
346
+ // Cleanup
347
+ unset( buddypress()->forums->reply_exists_text );
348
+
349
+ $reply_exists = (bool) !empty( $query->results );
350
+ }
351
+
352
+ return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );
353
+ }
354
+ /**
355
+ * Private one-time-use function used in conjunction with bp_forums_reply_exists()
356
+ *
357
+ * @since BuddyPress (1.7)
358
+ * @access private
359
+ * @global WPDB $wpdb
360
+ * @param string $where
361
+ * @return string
362
+ */
363
+ function _bp_forums_reply_exists_posts_where( $where = '' ) {
364
+ return $where . " AND p.post_text = '" . buddypress()->forums->reply_exists_text . "'";
365
  }
 
 
 
366
 
367
  /**
368
  * Get a total "Topics Started" count for a given user
374
  * @return int $count The topic count
375
  */
376
  function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) {
 
 
377
  do_action( 'bbpress_init' );
378
 
379
  if ( !$user_id )
412
  * @return int $count
413
  */
414
  function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) {
 
 
415
  do_action( 'bbpress_init' );
416
 
417
  if ( !$user_id )
447
  }
448
 
449
  function bp_forums_get_topic_extras( $topics ) {
450
+ global $wpdb, $bbdb;
451
 
452
  if ( empty( $topics ) )
453
  return $topics;
454
 
455
+ $bp = buddypress();
456
+
457
  // Get the topic ids
458
  foreach ( (array) $topics as $topic ) $topic_ids[] = $topic->topic_id;
459
  $topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) );
525
  }
526
 
527
  function bp_forums_delete_post( $args = '' ) {
 
 
528
  do_action( 'bbpress_init' );
529
 
530
+ $r = wp_parse_args( $args, array(
531
  'post_id' => false
532
+ ) );
533
 
 
534
  extract( $r, EXTR_SKIP );
535
 
536
  return bb_delete_post( $post_id, 1 );
537
  }
538
 
539
  function bp_forums_insert_post( $args = '' ) {
 
 
540
  do_action( 'bbpress_init' );
541
 
542
  $defaults = array(
630
  }
631
 
632
  function bp_forums_filter_caps( $allcaps ) {
633
+ global $wp_roles, $bb_table_prefix;
634
 
635
  if ( !bp_loggedin_user_id() )
636
  return $allcaps;
730
  function bp_embed_forum_save_cache( $cache, $cachekey, $id ) {
731
  bb_update_postmeta( $id, $cachekey, $cache );
732
  }
 
bp-forums/bp-forums-loader.php CHANGED
@@ -34,10 +34,9 @@ class BP_Forums_Component extends BP_Component {
34
  * backwards compatibility.
35
  *
36
  * @since BuddyPress (1.5)
37
- * @global BuddyPress $bp The one true BuddyPress instance
38
  */
39
  function setup_globals() {
40
- global $bp;
41
 
42
  // Define the parent forum ID
43
  if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) )
@@ -79,10 +78,6 @@ class BP_Forums_Component extends BP_Component {
79
  'functions',
80
  );
81
 
82
- // Admin area
83
- if ( is_admin() )
84
- $includes[] = 'admin';
85
-
86
  // bbPress stand-alone
87
  if ( !defined( 'BB_PATH' ) )
88
  $includes[] = 'bbpress-sa';
@@ -92,11 +87,8 @@ class BP_Forums_Component extends BP_Component {
92
 
93
  /**
94
  * Setup BuddyBar navigation
95
- *
96
- * @global BuddyPress $bp The one true BuddyPress instance
97
  */
98
  function setup_nav() {
99
- global $bp;
100
 
101
  // Stop if forums haven't been set up yet
102
  if ( !bp_forums_is_installed_correctly() )
@@ -150,29 +142,13 @@ class BP_Forums_Component extends BP_Component {
150
  'item_css_id' => 'replies'
151
  );
152
 
153
- // Favorite forums items. Disabled until future release.
154
- /*
155
- $sub_nav[] = array(
156
- 'name' => __( 'Favorites', 'buddypress' ),
157
- 'slug' => 'favorites',
158
- 'parent_url' => $forums_link,
159
- 'parent_slug' => $this->slug,
160
- 'screen_function' => 'bp_member_forums_screen_favorites',
161
- 'position' => 60,
162
- 'item_css_id' => 'favorites'
163
- );
164
- */
165
-
166
  parent::setup_nav( $main_nav, $sub_nav );
167
  }
168
 
169
  /**
170
  * Set up the Toolbar
171
- *
172
- * @global BuddyPress $bp The one true BuddyPress instance
173
  */
174
  function setup_admin_bar() {
175
- global $bp;
176
 
177
  // Prevent debug notices
178
  $wp_admin_nav = array();
@@ -185,7 +161,7 @@ class BP_Forums_Component extends BP_Component {
185
 
186
  // Add the "My Account" sub menus
187
  $wp_admin_nav[] = array(
188
- 'parent' => $bp->my_account_menu_id,
189
  'id' => 'my-account-' . $this->id,
190
  'title' => __( 'Forums', 'buddypress' ),
191
  'href' => trailingslashit( $forums_link )
@@ -221,11 +197,9 @@ class BP_Forums_Component extends BP_Component {
221
 
222
  /**
223
  * Sets up the title for pages and <title>
224
- *
225
- * @global BuddyPress $bp The one true BuddyPress instance
226
  */
227
  function setup_title() {
228
- global $bp;
229
 
230
  // Adjust title based on view
231
  if ( bp_is_forums_component() ) {
@@ -246,10 +220,6 @@ class BP_Forums_Component extends BP_Component {
246
  }
247
 
248
  function bp_setup_forums() {
249
- global $bp;
250
-
251
- $bp->forums = new BP_Forums_Component();
252
  }
253
  add_action( 'bp_setup_components', 'bp_setup_forums', 6 );
254
-
255
- ?>
34
  * backwards compatibility.
35
  *
36
  * @since BuddyPress (1.5)
 
37
  */
38
  function setup_globals() {
39
+ $bp = buddypress();
40
 
41
  // Define the parent forum ID
42
  if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) )
78
  'functions',
79
  );
80
 
 
 
 
 
81
  // bbPress stand-alone
82
  if ( !defined( 'BB_PATH' ) )
83
  $includes[] = 'bbpress-sa';
87
 
88
  /**
89
  * Setup BuddyBar navigation
 
 
90
  */
91
  function setup_nav() {
 
92
 
93
  // Stop if forums haven't been set up yet
94
  if ( !bp_forums_is_installed_correctly() )
142
  'item_css_id' => 'replies'
143
  );
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  parent::setup_nav( $main_nav, $sub_nav );
146
  }
147
 
148
  /**
149
  * Set up the Toolbar
 
 
150
  */
151
  function setup_admin_bar() {
 
152
 
153
  // Prevent debug notices
154
  $wp_admin_nav = array();
161
 
162
  // Add the "My Account" sub menus
163
  $wp_admin_nav[] = array(
164
+ 'parent' => buddypress()->my_account_menu_id,
165
  'id' => 'my-account-' . $this->id,
166
  'title' => __( 'Forums', 'buddypress' ),
167
  'href' => trailingslashit( $forums_link )
197
 
198
  /**
199
  * Sets up the title for pages and <title>
 
 
200
  */
201
  function setup_title() {
202
+ $bp = buddypress();
203
 
204
  // Adjust title based on view
205
  if ( bp_is_forums_component() ) {
220
  }
221
 
222
  function bp_setup_forums() {
223
+ buddypress()->forums = new BP_Forums_Component();
 
 
224
  }
225
  add_action( 'bp_setup_components', 'bp_setup_forums', 6 );
 
 
bp-forums/bp-forums-screens.php CHANGED
@@ -3,7 +3,9 @@
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  function bp_forums_directory_forums_setup() {
6
- global $bp;
 
 
7
 
8
  if ( bp_is_forums_component() && ( !bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && !bp_current_item() ) {
9
  if ( !bp_forums_has_directory() )
@@ -71,16 +73,12 @@ function bp_forums_directory_forums_setup() {
71
  add_action( 'bp_screens', 'bp_forums_directory_forums_setup', 2 );
72
 
73
  function bp_member_forums_screen_topics() {
74
- global $bp;
75
-
76
  do_action( 'bp_member_forums_screen_topics' );
77
 
78
  bp_core_load_template( apply_filters( 'bp_member_forums_screen_topics', 'members/single/home' ) );
79
  }
80
 
81
  function bp_member_forums_screen_replies() {
82
- global $bp;
83
-
84
  do_action( 'bp_member_forums_screen_replies' );
85
 
86
  bp_core_load_template( apply_filters( 'bp_member_forums_screen_replies', 'members/single/home' ) );
@@ -94,15 +92,12 @@ function bp_member_forums_screen_replies() {
94
  * @package BuddyPress Forums
95
  */
96
  function bp_member_forums_screen_favorites() {
97
- global $bp;
98
-
99
  do_action( 'bp_member_forums_screen_favorites' );
100
 
101
  bp_core_load_template( apply_filters( 'bp_member_forums_screen_favorites', 'members/single/home' ) );
102
  }
103
 
104
  function bp_forums_screen_single_forum() {
105
- global $bp;
106
 
107
  if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || !bp_action_variable( 0 ) )
108
  return false;
@@ -114,7 +109,6 @@ function bp_forums_screen_single_forum() {
114
  add_action( 'bp_screens', 'bp_forums_screen_single_forum' );
115
 
116
  function bp_forums_screen_single_topic() {
117
- global $bp;
118
 
119
  if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || !bp_action_variable( 0 ) )
120
  return false;
@@ -124,4 +118,98 @@ function bp_forums_screen_single_topic() {
124
  bp_core_load_template( apply_filters( 'bp_forums_screen_single_topic', 'forums/single/topic' ) );
125
  }
126
  add_action( 'bp_screens', 'bp_forums_screen_single_topic' );
127
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  function bp_forums_directory_forums_setup() {
6
+
7
+ // Get BuddyPress once
8
+ $bp = buddypress();
9
 
10
  if ( bp_is_forums_component() && ( !bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && !bp_current_item() ) {
11
  if ( !bp_forums_has_directory() )
73
  add_action( 'bp_screens', 'bp_forums_directory_forums_setup', 2 );
74
 
75
  function bp_member_forums_screen_topics() {
 
 
76
  do_action( 'bp_member_forums_screen_topics' );
77
 
78
  bp_core_load_template( apply_filters( 'bp_member_forums_screen_topics', 'members/single/home' ) );
79
  }
80
 
81
  function bp_member_forums_screen_replies() {
 
 
82
  do_action( 'bp_member_forums_screen_replies' );
83
 
84
  bp_core_load_template( apply_filters( 'bp_member_forums_screen_replies', 'members/single/home' ) );
92
  * @package BuddyPress Forums
93
  */
94
  function bp_member_forums_screen_favorites() {
 
 
95
  do_action( 'bp_member_forums_screen_favorites' );
96
 
97
  bp_core_load_template( apply_filters( 'bp_member_forums_screen_favorites', 'members/single/home' ) );
98
  }
99
 
100
  function bp_forums_screen_single_forum() {
 
101
 
102
  if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || !bp_action_variable( 0 ) )
103
  return false;
109
  add_action( 'bp_screens', 'bp_forums_screen_single_forum' );
110
 
111
  function bp_forums_screen_single_topic() {
 
112
 
113
  if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || !bp_action_variable( 0 ) )
114
  return false;
118
  bp_core_load_template( apply_filters( 'bp_forums_screen_single_topic', 'forums/single/topic' ) );
119
  }
120
  add_action( 'bp_screens', 'bp_forums_screen_single_topic' );
121
+
122
+
123
+ /** Theme Compatability *******************************************************/
124
+
125
+ /**
126
+ * The main theme compat class for legacy BuddyPress forums, as powered by bbPress 1.x
127
+ *
128
+ * This class sets up the necessary theme compatability actions to safely output
129
+ * old forum template parts to the_title and the_content areas of a theme.
130
+ *
131
+ * @since BuddyPress (1.7)
132
+ */
133
+ class BP_Forum_Legacy_Theme_Compat {
134
+
135
+ /**
136
+ * Setup the old forums component theme compatibility
137
+ *
138
+ * @since BuddyPress (1.7)
139
+ */
140
+ public function __construct() {
141
+ add_action( 'bp_setup_theme_compat', array( $this, 'is_legacy_forum' ) );
142
+ }
143
+
144
+ /**
145
+ * Are we looking at something that needs old forum theme compatability?
146
+ *
147
+ * @since BuddyPress (1.7)
148
+ */
149
+ public function is_legacy_forum() {
150
+
151
+ // Bail if not looking at a group
152
+ if ( ! bp_is_forums_component() )
153
+ return;
154
+
155
+ // forum Directory
156
+ if ( ( ! bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && ! bp_current_item() ) {
157
+
158
+ if ( ! bp_forums_has_directory() )
159
+ return false;
160
+
161
+ if ( ! bp_forums_is_installed_correctly() ) {
162
+ bp_core_add_message( __( 'The forums component has not been set up yet.', 'buddypress' ), 'error' );
163
+ bp_core_redirect( bp_get_root_domain() );
164
+ }
165
+
166
+ bp_update_is_directory( true, 'forums' );
167
+
168
+ do_action( 'bp_forums_directory_forums_setup' );
169
+
170
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
171
+ add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) );
172
+
173
+ }
174
+
175
+ }
176
+
177
+ /** Directory *************************************************************/
178
+
179
+ /**
180
+ * Update the global $post with directory data
181
+ *
182
+ * @since BuddyPress (1.7)
183
+ */
184
+ public function directory_dummy_post() {
185
+
186
+ // Title based on ability to create groups
187
+ if ( is_user_logged_in() ) {
188
+ $title = __( 'Forums', 'buddypress' ) . '&nbsp;<a class="button show-hide-new bp-title-button" href="#new-topic" id="new-topic-button">' . __( 'New Topic', 'buddypress' ) . '</a>';
189
+ } else {
190
+ $title = __( 'Forums', 'buddypress' );
191
+ }
192
+
193
+ bp_theme_compat_reset_post( array(
194
+ 'ID' => 0,
195
+ 'post_title' => $title,
196
+ 'post_author' => 0,
197
+ 'post_date' => 0,
198
+ 'post_content' => '',
199
+ 'post_type' => 'bp_forum',
200
+ 'post_status' => 'publish',
201
+ 'is_archive' => true,
202
+ 'comment_status' => 'closed'
203
+ ) );
204
+ }
205
+
206
+ /**
207
+ * Filter the_content with the old forum index template part
208
+ *
209
+ * @since BuddyPress (1.7)
210
+ */
211
+ public function directory_content() {
212
+ bp_buffer_template_part( 'forums/index' );
213
+ }
214
+ }
215
+ new BP_Forum_Legacy_Theme_Compat();
bp-forums/bp-forums-template.php CHANGED
@@ -1465,4 +1465,3 @@ function bp_forum_topic_count( $user_id = 0 ) {
1465
  function bp_get_forum_topic_count( $user_id = 0 ) {
1466
  return apply_filters( 'bp_get_forum_topic_count', bp_forums_total_topic_count( $user_id ) );
1467
  }
1468
- ?>
1465
  function bp_get_forum_topic_count( $user_id = 0 ) {
1466
  return apply_filters( 'bp_get_forum_topic_count', bp_forums_total_topic_count( $user_id ) );
1467
  }
 
bp-forums/deprecated/1.6.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * This file contains all the deprecated functions for BuddyPress forums since
7
  * version 1.6. This was a major update for the forums component, moving from
8
- * bbPress 1.1 to bbPress 2.1.
9
  *
10
  * @package BuddyPress
11
  * @subpackage Forums
@@ -41,7 +41,7 @@ function bp_forums_bbpress_admin() {
41
 
42
  else : ?>
43
 
44
- <div style="width: 45%; float: left; margin-top: 20px;">
45
  <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
46
 
47
  <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
@@ -60,23 +60,6 @@ function bp_forums_bbpress_admin() {
60
  </div>
61
  </div>
62
 
63
- <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">
64
- <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3>
65
- <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p>
66
- <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p>
67
-
68
- <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
69
- <ul class="description" style="list-style: square; margin-left: 30px;">
70
- <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li>
71
- <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li>
72
- <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
73
- <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li>
74
- </ul>
75
- <div>
76
- <a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
77
- </div>
78
- </div>
79
-
80
  <?php endif; ?>
81
 
82
  </div>
@@ -84,7 +67,7 @@ function bp_forums_bbpress_admin() {
84
  }
85
 
86
  function bp_forums_bbpress_install_wizard() {
87
- $post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );
88
 
89
  $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
90
 
@@ -158,7 +141,7 @@ function bp_forums_bbpress_install_wizard() {
158
  wp_admin_css( 'plugin-install' );
159
  ?>
160
 
161
- <div style="width: 45%; float: left; margin-top: 20px;">
162
  <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
163
 
164
  <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
@@ -178,26 +161,7 @@ function bp_forums_bbpress_install_wizard() {
178
  </div>
179
  </div>
180
 
181
- <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">
182
- <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3>
183
- <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p>
184
- <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p>
185
-
186
- <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
187
- <ul class="description" style="list-style: square; margin-left: 30px;">
188
- <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li>
189
- <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li>
190
- <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
191
- <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li>
192
- </ul>
193
- <div>
194
- <a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
195
- </div>
196
- </div>
197
-
198
  <?php }
199
  break;
200
  }
201
  }
202
-
203
- ?>
5
  *
6
  * This file contains all the deprecated functions for BuddyPress forums since
7
  * version 1.6. This was a major update for the forums component, moving from
8
+ * bbPress 1.x to bbPress 2.x.
9
  *
10
  * @package BuddyPress
11
  * @subpackage Forums
41
 
42
  else : ?>
43
 
44
+ <div>
45
  <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
46
 
47
  <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
60
  </div>
61
  </div>
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  <?php endif; ?>
64
 
65
  </div>
67
  }
68
 
69
  function bp_forums_bbpress_install_wizard() {
70
+ $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );
71
 
72
  $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
73
 
141
  wp_admin_css( 'plugin-install' );
142
  ?>
143
 
144
+ <div>
145
  <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
146
 
147
  <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
161
  </div>
162
  </div>
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  <?php }
165
  break;
166
  }
167
  }
 
 
bp-forums/{bp-forums-admin.php → deprecated/1.7.php} RENAMED
@@ -1,9 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  function bp_forums_add_admin_menu() {
6
- global $bp;
7
 
8
  if ( !is_super_admin() )
9
  return false;
@@ -22,7 +33,6 @@ add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' );
22
  * Outputs the markup for the bb-forums-admin panel
23
  */
24
  function bp_forums_bbpress_admin() {
25
- global $bp;
26
 
27
  // The text and URL of the Site Wide Forums button differs depending on whether bbPress
28
  // is running
@@ -60,6 +70,11 @@ function bp_forums_bbpress_admin() {
60
 
61
  // Delete the bb-config.php location option
62
  bp_delete_option( 'bb-config-location' );
 
 
 
 
 
63
  bp_forums_bbpress_install_wizard();
64
 
65
  else : ?>
@@ -79,7 +94,7 @@ function bp_forums_bbpress_admin() {
79
  </ul>
80
 
81
  <div>
82
- <a class="button button-primary" href="<?php echo $action ?>"><?php _e( 'Uninstall Group Forums', 'buddypress' ) ?></a> &nbsp;
83
  </div>
84
  </div>
85
 
@@ -109,7 +124,7 @@ function bp_forums_bbpress_admin() {
109
  }
110
 
111
  function bp_forums_bbpress_install_wizard() {
112
- $post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );
113
  $bbpress_plugin_is_active = false;
114
 
115
  $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
@@ -417,5 +432,3 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) {
417
 
418
  return 1;
419
  }
420
-
421
- ?>
1
  <?php
2
+
3
+ /**
4
+ * BuddyPress Forums Deprecated Functions
5
+ *
6
+ * This file contains all the deprecated functions for BuddyPress forums since
7
+ * version 1.7. This was a major update for the forums component, moving from
8
+ * bbPress 1.x to bbPress 2.x.
9
+ *
10
+ * @package BuddyPress
11
+ * @subpackage Forums
12
+ */
13
+
14
  // Exit if accessed directly
15
  if ( !defined( 'ABSPATH' ) ) exit;
16
 
17
  function bp_forums_add_admin_menu() {
 
18
 
19
  if ( !is_super_admin() )
20
  return false;
33
  * Outputs the markup for the bb-forums-admin panel
34
  */
35
  function bp_forums_bbpress_admin() {
 
36
 
37
  // The text and URL of the Site Wide Forums button differs depending on whether bbPress
38
  // is running
70
 
71
  // Delete the bb-config.php location option
72
  bp_delete_option( 'bb-config-location' );
73
+
74
+ // Now delete the bb-config.php file
75
+ @unlink( ABSPATH . 'bb-config.php' );
76
+
77
+ // show the updated wizard
78
  bp_forums_bbpress_install_wizard();
79
 
80
  else : ?>
94
  </ul>
95
 
96
  <div>
97
+ <a class="button button-primary confirm" href="<?php echo $action ?>"><?php _e( 'Uninstall Group Forums', 'buddypress' ) ?></a> &nbsp;
98
  </div>
99
  </div>
100
 
124
  }
125
 
126
  function bp_forums_bbpress_install_wizard() {
127
+ $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );
128
  $bbpress_plugin_is_active = false;
129
 
130
  $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
432
 
433
  return 1;
434
  }
 
 
bp-friends/bp-friends-actions.php CHANGED
@@ -83,5 +83,3 @@ function friends_action_remove_friend() {
83
  return false;
84
  }
85
  add_action( 'bp_init', 'friends_action_remove_friend' );
86
-
87
- ?>
83
  return false;
84
  }
85
  add_action( 'bp_init', 'friends_action_remove_friend' );
 
 
bp-friends/bp-friends-activity.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * BuddyPress Friends Activity Functions
5
  *
6
- * These functions handle the recording, deleting and formatting of activity
7
  * for the user and for this specific component.
8
  *
9
  * @package BuddyPress
@@ -121,5 +121,3 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
121
 
122
  return $return;
123
  }
124
-
125
- ?>
3
  /**
4
  * BuddyPress Friends Activity Functions
5
  *
6
+ * These functions handle the recording, deleting and formatting of activity
7
  * for the user and for this specific component.
8
  *
9
  * @package BuddyPress
121
 
122
  return $return;
123
  }
 
 
bp-friends/bp-friends-cache.php CHANGED
@@ -39,5 +39,3 @@ add_action( 'friends_friendship_rejected', 'bp_core_clear_cache' );
39
  add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' );
40
  add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' );
41
  add_action( 'friends_friendship_requested', 'bp_core_clear_cache' );
42
-
43
- ?>
39
  add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' );
40
  add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' );
41
  add_action( 'friends_friendship_requested', 'bp_core_clear_cache' );
 
 
bp-friends/bp-friends-classes.php CHANGED
@@ -84,11 +84,11 @@ class BP_Friends_Friendship {
84
  global $wpdb, $bp;
85
 
86
  if ( !empty( $friend_requests_only ) ) {
87
- $oc_sql = "AND is_confirmed = 0";
88
- $friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id );
89
  } else {
90
- $oc_sql = "AND is_confirmed = 1";
91
- $friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
92
  }
93
 
94
  $friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" );
@@ -160,10 +160,10 @@ class BP_Friends_Friendship {
160
 
161
  // filter the user_ids based on the search criteria.
162
  if ( bp_is_active( 'xprofile' ) ) {
163
- $sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}";
164
  $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%'";
165
  } else {
166
- $sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}";
167
  $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%'";
168
  }
169
 
@@ -346,5 +346,3 @@ class BP_Friends_Friendship {
346
  }
347
  }
348
  }
349
-
350
- ?>
84
  global $wpdb, $bp;
85
 
86
  if ( !empty( $friend_requests_only ) ) {
87
+ $oc_sql = 'AND is_confirmed = 0';
88
+ $friend_sql = $wpdb->prepare( " WHERE friend_user_id = %d", $user_id );
89
  } else {
90
+ $oc_sql = 'AND is_confirmed = 1';
91
+ $friend_sql = $wpdb->prepare( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
92
  }
93
 
94
  $friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" );
160
 
161
  // filter the user_ids based on the search criteria.
162
  if ( bp_is_active( 'xprofile' ) ) {
163
+ $sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}";
164
  $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%'";
165
  } else {
166
+ $sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}";
167
  $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%'";
168
  }
169
 
346
  }
347
  }
348
  }
 
 
bp-friends/bp-friends-filters.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * BuddyPress Friend Filters
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage FriendsFilters
8
+ */
9
+
10
+ /**
11
+ * Filter BP_User_Query::populate_extras to override each queried users fullname
12
+ *
13
+ * @since BuddyPress (1.7)
14
+ *
15
+ * @global BuddyPress $bp
16
+ * @global WPDB $wpdb
17
+ * @param BP_User_Query $user_query
18
+ * @param string $user_ids_sql
19
+ */
20
+ function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) {
21
+ global $bp, $wpdb;
22
+
23
+ // Fetch whether or not the user is a friend of the current user
24
+ $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids_sql} ) ) OR (initiator_user_id IN ( {$user_ids_sql} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
25
+
26
+ // The "friend" is the user ID in the pair who is *not* the logged in user
27
+ foreach ( (array) $friend_status as $fs ) {
28
+ $friend_id = bp_loggedin_user_id() == $fs->initiator_user_id ? $fs->friend_user_id : $fs->initiator_user_id;
29
+
30
+ if ( isset( $user_query->results[ $friend_id ] ) ) {
31
+ $user_query->results[ $friend_id ]->is_friend = $fs->is_confirmed;
32
+ }
33
+ }
34
+ }
35
+ add_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras', 4, 2 );
bp-friends/bp-friends-functions.php CHANGED
@@ -144,7 +144,7 @@ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) {
144
 
145
  $friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid );
146
  $friendship = new BP_Friends_Friendship( $friendship_id, true, false );
147
-
148
  if ( !$friendship->is_confirmed && BP_Friends_Friendship::withdraw( $friendship_id ) ) {
149
  // Remove the friend request notice
150
  bp_core_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
@@ -226,11 +226,11 @@ function friends_get_bulk_last_active( $friend_ids ) {
226
 
227
  /**
228
  * Get a list of friends that a user can invite into this group.
229
- *
230
  * Excludes friends that are already in the group, and banned friends if the
231
  * user is not a group admin.
232
  *
233
- * @since 1.0
234
  * @param int $user_id User ID whose friends to see can be invited
235
  * @param int $group_id Group to check possible invitations against
236
  * @return mixed False if no friends, array of users if friends
@@ -354,5 +354,3 @@ function friends_remove_data( $user_id ) {
354
  add_action( 'wpmu_delete_user', 'friends_remove_data' );
355
  add_action( 'delete_user', 'friends_remove_data' );
356
  add_action( 'bp_make_spam_user', 'friends_remove_data' );
357
-
358
- ?>
144
 
145
  $friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid );
146
  $friendship = new BP_Friends_Friendship( $friendship_id, true, false );
147
+
148
  if ( !$friendship->is_confirmed && BP_Friends_Friendship::withdraw( $friendship_id ) ) {
149
  // Remove the friend request notice
150
  bp_core_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
226
 
227
  /**
228
  * Get a list of friends that a user can invite into this group.
229
+ *
230
  * Excludes friends that are already in the group, and banned friends if the
231
  * user is not a group admin.
232
  *
233
+ * @since BuddyPress (1.0)
234
  * @param int $user_id User ID whose friends to see can be invited
235
  * @param int $group_id Group to check possible invitations against
236
  * @return mixed False if no friends, array of users if friends
354
  add_action( 'wpmu_delete_user', 'friends_remove_data' );
355
  add_action( 'delete_user', 'friends_remove_data' );
356
  add_action( 'bp_make_spam_user', 'friends_remove_data' );
 
 
bp-friends/bp-friends-loader.php CHANGED
@@ -102,7 +102,16 @@ class BP_Friends_Component extends BP_Component {
102
  'item_css_id' => $bp->friends->id
103
  );
104
 
105
- $friends_link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() );
 
 
 
 
 
 
 
 
 
106
 
107
  // Add the subnav items to the friends nav item
108
  $sub_nav[] = array(
@@ -122,7 +131,7 @@ class BP_Friends_Component extends BP_Component {
122
  'parent_slug' => bp_get_friends_slug(),
123
  'screen_function' => 'friends_screen_requests',
124
  'position' => 20,
125
- 'user_has_access' => bp_is_my_profile()
126
  );
127
 
128
  parent::setup_nav( $main_nav, $sub_nav );
@@ -215,5 +224,3 @@ function bp_setup_friends() {
215
  $bp->friends = new BP_Friends_Component();
216
  }
217
  add_action( 'bp_setup_components', 'bp_setup_friends', 6 );
218
-
219
- ?>
102
  'item_css_id' => $bp->friends->id
103
  );
104
 
105
+ // Determine user to use
106
+ if ( bp_displayed_user_domain() ) {
107
+ $user_domain = bp_displayed_user_domain();
108
+ } elseif ( bp_loggedin_user_domain() ) {
109
+ $user_domain = bp_loggedin_user_domain();
110
+ } else {
111
+ return;
112
+ }
113
+
114
+ $friends_link = trailingslashit( $user_domain . bp_get_friends_slug() );
115
 
116
  // Add the subnav items to the friends nav item
117
  $sub_nav[] = array(
131
  'parent_slug' => bp_get_friends_slug(),
132
  'screen_function' => 'friends_screen_requests',
133
  'position' => 20,
134
+ 'user_has_access' => bp_core_can_edit_settings()
135
  );
136
 
137
  parent::setup_nav( $main_nav, $sub_nav );
224
  $bp->friends = new BP_Friends_Component();
225
  }
226
  add_action( 'bp_setup_components', 'bp_setup_friends', 6 );
 
 
bp-friends/bp-friends-notifications.php CHANGED
@@ -28,10 +28,8 @@ function friends_notification_new_request( $friendship_id, $initiator_id, $frien
28
 
29
  // Set up and send the message
30
  $to = $ud->user_email;
31
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
32
- $subject = '[' . $sitename . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
33
-
34
- $message = sprintf( __(
35
  '%1$s wants to add you as a friend.
36
 
37
  To view all of your pending friendship requests: %2$s
@@ -67,10 +65,8 @@ function friends_notification_accepted_request( $friendship_id, $initiator_id, $
67
 
68
  // Set up and send the message
69
  $to = $ud->user_email;
70
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
71
- $subject = '[' . $sitename . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
72
-
73
- $message = sprintf( __(
74
  '%1$s accepted your friend request.
75
 
76
  To view %2$s\'s profile: %3$s
@@ -89,5 +85,3 @@ To view %2$s\'s profile: %3$s
89
 
90
  do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id );
91
  }
92
-
93
- ?>
28
 
29
  // Set up and send the message
30
  $to = $ud->user_email;
31
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ) ) );
32
+ $message = sprintf( __(
 
 
33
  '%1$s wants to add you as a friend.
34
 
35
  To view all of your pending friendship requests: %2$s
65
 
66
  // Set up and send the message
67
  $to = $ud->user_email;
68
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ) ) );
69
+ $message = sprintf( __(
 
 
70
  '%1$s accepted your friend request.
71
 
72
  To view %2$s\'s profile: %3$s
85
 
86
  do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id );
87
  }
 
 
bp-friends/bp-friends-screens.php CHANGED
@@ -47,7 +47,7 @@ function friends_screen_requests() {
47
  bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' );
48
 
49
  bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
50
-
51
  } elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
52
  // Check the nonce
53
  check_admin_referer( 'friends_withdraw_friendship' );
@@ -108,5 +108,3 @@ function friends_screen_notification_settings() {
108
  <?php
109
  }
110
  add_action( 'bp_notification_settings', 'friends_screen_notification_settings' );
111
-
112
- ?>
47
  bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' );
48
 
49
  bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
50
+
51
  } elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
52
  // Check the nonce
53
  check_admin_referer( 'friends_withdraw_friendship' );
108
  <?php
109
  }
110
  add_action( 'bp_notification_settings', 'friends_screen_notification_settings' );
 
 
bp-friends/bp-friends-template.php CHANGED
@@ -355,19 +355,19 @@ function bp_get_friendship_requests( $user_id = 0 ) {
355
  if ( !$user_id ) {
356
  $user_id = bp_displayed_user_id();
357
  }
358
-
359
  if ( !$user_id ) {
360
- return 0;
361
  }
362
-
363
  $requests = friends_get_friendship_request_user_ids( $user_id );
364
-
365
  if ( !empty( $requests ) ) {
366
  $requests = implode( ',', (array) $requests );
367
  } else {
368
  $requests = 0;
369
  }
370
-
371
  return apply_filters( 'bp_get_friendship_requests', $requests );
372
  }
373
 
@@ -430,5 +430,3 @@ function bp_friend_total_requests_count( $user_id = 0 ) {
430
 
431
  return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) );
432
  }
433
-
434
- ?>
355
  if ( !$user_id ) {
356
  $user_id = bp_displayed_user_id();
357
  }
358
+
359
  if ( !$user_id ) {
360
+ return 0;
361
  }
362
+
363
  $requests = friends_get_friendship_request_user_ids( $user_id );
364
+
365
  if ( !empty( $requests ) ) {
366
  $requests = implode( ',', (array) $requests );
367
  } else {
368
  $requests = 0;
369
  }
370
+
371
  return apply_filters( 'bp_get_friendship_requests', $requests );
372
  }
373
 
430
 
431
  return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) );
432
  }
 
 
bp-groups/admin/css/admin.css ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #bp-groups-edit-form input {
2
+ outline: medium none;
3
+ padding: 3px 8px;
4
+ }
5
+ #bp-groups-edit-form input#bp-groups-name {
6
+ font-size: 1.7em;
7
+ width: 100%;
8
+ }
9
+ #bp-groups-edit-form input#bp-groups-new-members {
10
+ width: 100%;
11
+ max-width: 90%;
12
+ border: 0;
13
+ }
14
+ .bp-groups-settings-section {
15
+ margin-bottom: 15px;
16
+ }
17
+ ul.bp-group-delete-list {
18
+ list-style-type: disc;
19
+ margin: 4px 26px;
20
+ }
bp-groups/admin/css/admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #bp-groups-edit-form input{outline:medium none;padding:3px 8px}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}.bp-groups-settings-section{margin-bottom:15px}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}
bp-groups/admin/js/admin.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ function add_member_to_list( e, ui ) {
3
+ var remove_id = 'bp-groups-remove-new-member-' + ui.item.value;
4
+ $('#bp-groups-new-members-list').append('<li><a href="#" class="bp-groups-remove-new-member" id="' + remove_id + '">x</a> ' + ui.item.label + '</li>');
5
+ $('#' + remove_id).bind('click', function(e) { remove_member_from_list(e); return false; });
6
+
7
+ $('#bp-groups-new-members-list').after('<input name="new_members[]" type="hidden" value="' + ui.item.value + '" />');
8
+ }
9
+
10
+ function remove_member_from_list( e ) {
11
+ $(e.target).closest('li').remove();
12
+ }
13
+
14
+ var id = 'undefined' !== typeof group_members ? '&group_members=' + group_members : '';
15
+ $(document).ready( function() {
16
+ /* Initialize autocomplete */
17
+ $( '.bp-suggest-user' ).autocomplete({
18
+ source: ajaxurl + '?action=bp_group_admin_member_autocomplete' + id,
19
+ delay: 500,
20
+ minLength: 2,
21
+ position: ( 'undefined' !== typeof isRtl && isRtl ) ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' },
22
+ open: function() { $(this).addClass('open'); },
23
+ close: function() { $(this).removeClass('open'); $(this).val(''); },
24
+ select: function( event, ui ) { add_member_to_list( event, ui ); }
25
+ });
26
+
27
+ /* Replace noscript placeholder */
28
+ $( '#bp-groups-new-members' ).attr( 'placeholder', BP_Group_Admin.add_member_placeholder );
29
+
30
+ });
31
+ })(jQuery);
bp-groups/admin/js/admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(c){function b(h,f){var g="bp-groups-remove-new-member-"+f.item.value;c("#bp-groups-new-members-list").append('<li><a href="#" class="bp-groups-remove-new-member" id="'+g+'">x</a> '+f.item.label+"</li>");c("#"+g).bind("click",function(i){a(i);return false});c("#bp-groups-new-members-list").after('<input name="new_members[]" type="hidden" value="'+f.item.value+'" />')}function a(f){c(f.target).closest("li").remove()}var d="undefined"!==typeof group_members?"&group_members="+group_members:"";c(document).ready(function(){c(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+d,delay:500,minLength:2,position:("undefined"!==typeof isRtl&&isRtl)?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){c(this).addClass("open")},close:function(){c(this).removeClass("open");c(this).val("")},select:function(e,f){b(e,f)}});c("#bp-groups-new-members").attr("placeholder",BP_Group_Admin.add_member_placeholder)})})(jQuery);
bp-groups/bp-groups-actions.php CHANGED
@@ -173,6 +173,10 @@ function groups_action_create_group() {
173
 
174
  // Group avatar is handled separately
175
  if ( 'group-avatar' == bp_get_groups_current_create_step() && isset( $_POST['upload'] ) ) {
 
 
 
 
176
  if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) {
177
  // Normally we would check a nonce here, but the group save nonce is used instead
178
 
@@ -196,7 +200,7 @@ function groups_action_create_group() {
196
  }
197
  }
198
 
199
- bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) );
200
  }
201
  add_action( 'bp_actions', 'groups_action_create_group' );
202
 
@@ -321,5 +325,3 @@ function groups_action_group_feed() {
321
  die;
322
  }
323
  add_action( 'bp_actions', 'groups_action_group_feed' );
324
-
325
- ?>
173
 
174
  // Group avatar is handled separately
175
  if ( 'group-avatar' == bp_get_groups_current_create_step() && isset( $_POST['upload'] ) ) {
176
+ if ( ! isset( $bp->avatar_admin ) ) {
177
+ $bp->avatar_admin = new stdClass();
178
+ }
179
+
180
  if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) {
181
  // Normally we would check a nonce here, but the group save nonce is used instead
182
 
200
  }
201
  }
202
 
203
+ bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) );
204
  }
205
  add_action( 'bp_actions', 'groups_action_create_group' );
206
 
325
  die;
326
  }
327
  add_action( 'bp_actions', 'groups_action_group_feed' );
 
 
bp-groups/bp-groups-activity.php CHANGED
@@ -312,5 +312,3 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
312
 
313
  return false;
314
  }
315
-
316
- ?>
312
 
313
  return false;
314
  }
 
 
bp-groups/bp-groups-admin.php ADDED
@@ -0,0 +1,1324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Groups component admin screen
4
+ *
5
+ * Props to WordPress core for the Comments admin screen, and its contextual help text,
6
+ * on which this implementation is heavily based.
7
+ *
8
+ * @package BuddyPress
9
+ * @since BuddyPress (1.7)
10
+ * @subpackage Groups
11
+ */
12
+
13
+ // Exit if accessed directly
14
+ if ( !defined( 'ABSPATH' ) ) exit;
15
+
16
+ // Include WP's list table class
17
+ if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
18
+
19
+ // per_page screen option. Has to be hooked in extremely early.
20
+ if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-groups' == $_REQUEST['page'] )
21
+ add_filter( 'set-screen-option', 'bp_groups_admin_screen_options', 10, 3 );
22
+
23
+ /**
24
+ * Registers the Groups component admin screen
25
+ *
26
+ * @since BuddyPress (1.7)
27
+ */
28
+ function bp_groups_add_admin_menu() {
29
+
30
+ if ( ! bp_current_user_can( 'bp_moderate' ) )
31
+ return;
32
+
33
+ // Add our screen
34
+ $hook = add_menu_page(
35
+ __( 'Groups', 'buddypress' ),
36
+ __( 'Groups', 'buddypress' ),
37
+ 'manage_options',
38
+ 'bp-groups',
39
+ 'bp_groups_admin',
40
+ 'div'
41
+ );
42
+
43
+ // Hook into early actions to load custom CSS and our init handler.
44
+ add_action( "load-$hook", 'bp_groups_admin_load' );
45
+ }
46
+ add_action( bp_core_admin_hook(), 'bp_groups_add_admin_menu' );
47
+
48
+ /**
49
+ * Add groups component to custom menus array
50
+ *
51
+ * @since BuddyPress (1.7)
52
+ *
53
+ * @param array $custom_menus
54
+ * @return array
55
+ */
56
+ function bp_groups_admin_menu_order( $custom_menus = array() ) {
57
+ array_push( $custom_menus, 'bp-groups' );
58
+ return $custom_menus;
59
+ }
60
+ add_filter( 'bp_admin_menu_order', 'bp_groups_admin_menu_order' );
61
+
62
+ /**
63
+ * Set up the admin page before any output is sent. Register contextual help and screen options for this admin page.
64
+ *
65
+ * @global object $bp BuddyPress global settings
66
+ * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table
67
+ * @since BuddyPress (1.7)
68
+ */
69
+ function bp_groups_admin_load() {
70
+ global $bp_groups_list_table;
71
+
72
+ // Build redirection URL
73
+ $redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] );
74
+
75
+ // Decide whether to load the dev version of the CSS and JavaScript
76
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : 'min.';
77
+
78
+ $doaction = bp_admin_list_table_current_bulk_action();
79
+
80
+ // Call an action for plugins to hook in early
81
+ do_action( 'bp_groups_admin_load', $doaction );
82
+
83
+ // Edit screen
84
+ if ( 'do_delete' == $doaction && ! empty( $_GET['gid'] ) ) {
85
+
86
+ check_admin_referer( 'bp-groups-delete' );
87
+
88
+ $group_ids = wp_parse_id_list( $_GET['gid'] );
89
+
90
+ $count = 0;
91
+ foreach ( $group_ids as $group_id ) {
92
+ if ( groups_delete_group( $group_id ) ) {
93
+ $count++;
94
+ }
95
+ }
96
+
97
+ $redirect_to = add_query_arg( 'deleted', $count, $redirect_to );
98
+
99
+ bp_core_redirect( $redirect_to );
100
+
101
+ } else if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
102
+ // columns screen option
103
+ add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
104
+
105
+ get_current_screen()->add_help_tab( array(
106
+ 'id' => 'bp-group-edit-overview',
107
+ 'title' => __( 'Overview', 'buddypress' ),
108
+ 'content' =>
109
+ '<p>' . __( 'This page is a convenient way to edit the details associated with one of your groups.', 'buddypress' ) . '</p>' .
110
+ '<p>' . __( 'The Name and Description box is fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to hide or unhide, or to choose a 1- or 2-column layout for this screen.', 'buddypress' ) . '</p>'
111
+ ) );
112
+
113
+ // Help panel - sidebar links
114
+ get_current_screen()->set_help_sidebar(
115
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
116
+ '<p><a href="http://buddypress.org/support">' . __( 'Support Forums', 'buddypress' ) . '</a></p>'
117
+ );
118
+
119
+ // Register metaboxes for the edit screen.
120
+ add_meta_box( 'submitdiv', _x( 'Save', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_status', get_current_screen()->id, 'side', 'high' );
121
+ add_meta_box( 'bp_group_settings', _x( 'Settings', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_settings', get_current_screen()->id, 'side', 'core' );
122
+ add_meta_box( 'bp_group_add_members', _x( 'Add New Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_add_new_members', get_current_screen()->id, 'normal', 'core' );
123
+ add_meta_box( 'bp_group_members', _x( 'Manage Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_members', get_current_screen()->id, 'normal', 'core' );
124
+
125
+ do_action( 'bp_groups_admin_meta_boxes' );
126
+
127
+ // Enqueue javascripts
128
+ wp_enqueue_script( 'postbox' );
129
+ wp_enqueue_script( 'dashboard' );
130
+ wp_enqueue_script( 'comment' );
131
+
132
+ // Index screen
133
+ } else {
134
+ // Create the Groups screen list table
135
+ $bp_groups_list_table = new BP_Groups_List_Table();
136
+
137
+ // per_page screen option
138
+ add_screen_option( 'per_page', array( 'label' => _x( 'Groups', 'Groups per page (screen options)', 'buddypress' )) );
139
+
140
+ // Help panel - overview text
141
+ get_current_screen()->add_help_tab( array(
142
+ 'id' => 'bp-groups-overview',
143
+ 'title' => __( 'Overview', 'buddypress' ),
144
+ 'content' =>
145
+ '<p>' . __( 'You can manage groups much like you can manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on groups by using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>',
146
+ ) );
147
+
148
+ get_current_screen()->add_help_tab( array(
149
+ 'id' => 'bp-groups-overview-actions',
150
+ 'title' => __( 'Group Actions', 'buddypress' ),
151
+ 'content' =>
152
+ '<p>' . __( 'Clicking "Visit" will take you to the group&#8217;s public page. Use this link to see what the group looks like on the front end of your site.', 'buddypress' ) . '</p>' .
153
+ '<p>' . __( 'Clicking "Edit" will take you to a Dashboard panel where you can manage various details about the group, such as its name and description, its members, and other settings.', 'buddypress' ) . '</p>' .
154
+ '<p>' . __( 'If you click "Delete" under a specific group, or select a number of groups and then choose Delete from the Bulk Actions menu, you will be led to a page where you&#8217;ll be asked to confirm the permanent deletion of the group(s).', 'buddypress' ) . '</p>',
155
+ ) );
156
+
157
+ // Help panel - sidebar links
158
+ get_current_screen()->set_help_sidebar(
159
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
160
+ '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
161
+ );
162
+ }
163
+
164
+ // Enqueue CSS and JavaScript
165
+ wp_enqueue_script( 'bp_groups_admin_js', BP_PLUGIN_URL . "bp-groups/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true );
166
+ wp_enqueue_style( 'bp_groups_admin_css', BP_PLUGIN_URL . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version() );
167
+
168
+ wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array(
169
+ 'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' )
170
+ ) );
171
+
172
+ if ( $doaction && 'save' == $doaction ) {
173
+ // Get group ID
174
+ $group_id = isset( $_REQUEST['gid'] ) ? (int) $_REQUEST['gid'] : '';
175
+
176
+ $redirect_to = add_query_arg( array(
177
+ 'gid' => (int) $group_id,
178
+ 'action' => 'edit'
179
+ ), $redirect_to );
180
+
181
+ // Check this is a valid form submission
182
+ check_admin_referer( 'edit-group_' . $group_id );
183
+
184
+ // Get the group from the database
185
+ $group = groups_get_group( 'group_id=' . $group_id );
186
+
187
+ // If the group doesn't exist, just redirect back to the index
188
+ if ( empty( $group->slug ) ) {
189
+ wp_redirect( $redirect_to );
190
+ exit;
191
+ }
192
+
193
+ // Check the form for the updated properties
194
+
195
+ // Store errors
196
+ $error = 0;
197
+ $success_new = $error_new = $success_modified = $error_modified = array();
198
+
199
+ // Group name and description are handled with
200
+ // groups_edit_base_group_details()
201
+ if ( !groups_edit_base_group_details( $group_id, $_POST['bp-groups-name'], $_POST['bp-groups-description'], 0 ) ) {
202
+ $error = $group_id;
203
+ }
204
+
205
+ // Enable discussion forum
206
+ $enable_forum = ( isset( $_POST['group-show-forum'] ) ) ? 1 : 0;
207
+
208
+ // Privacy setting
209
+ $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
210
+ $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
211
+
212
+ // Invite status
213
+ $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
214
+ $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
215
+
216
+ if ( !groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status ) ) {
217
+ $error = $group_id;
218
+ }
219
+
220
+ // Process new members
221
+ $user_names = array();
222
+
223
+ if ( ! empty( $_POST['bp-groups-new-members'] ) ) {
224
+ $user_names = array_merge( $user_names, explode( ',', $_POST['bp-groups-new-members'] ) );
225
+ }
226
+
227
+ if ( ! empty( $_POST['new_members'] ) ) {
228
+ $user_names = array_merge( $user_names, $_POST['new_members'] );
229
+ }
230
+
231
+ if ( ! empty( $user_names ) ) {
232
+
233
+ foreach( array_values( $user_names ) as $user_name ) {
234
+ $un = trim( $user_name );
235
+
236
+ // Make sure the user exists before attempting
237
+ // to add to the group
238
+ if ( ! $user_id = username_exists( $un ) ) {
239
+ $error_new[] = $un;
240
+ } else if ( ! groups_join_group( $group_id, $user_id ) ) {
241
+ $error_new[] = $un;
242
+ } else {
243
+ $success_new[] = $un;
244
+ }
245
+ }
246
+ }
247
+
248
+ // Process member role changes
249
+ if ( ! empty( $_POST['bp-groups-role'] ) && ! empty( $_POST['bp-groups-existing-role'] ) ) {
250
+
251
+ // Before processing anything, make sure you're not
252
+ // attempting to remove the all user admins
253
+ $admin_count = 0;
254
+ foreach ( (array) $_POST['bp-groups-role'] as $new_role ) {
255
+ if ( 'admin' == $new_role ) {
256
+ $admin_count++;
257
+ break;
258
+ }
259
+ }
260
+
261
+ if ( ! $admin_count ) {
262
+ $redirect_to = add_query_arg( 'no_admins', 1, $redirect_to );
263
+ bp_core_redirect( $redirect_to );
264
+ }
265
+
266
+ // Process only those users who have had their roles changed
267
+ foreach ( (array) $_POST['bp-groups-role'] as $user_id => $new_role ) {
268
+
269
+ $existing_role = isset( $_POST['bp-groups-existing-role'][$user_id] ) ? $_POST['bp-groups-existing-role'][$user_id] : '';
270
+
271
+ if ( $existing_role != $new_role ) {
272
+
273
+ switch ( $new_role ) {
274
+ case 'mod' :
275
+ // Admin to mod is a demotion. Demote to
276
+ // member, then fall through
277
+ if ( 'admin' == $existing_role ) {
278
+ groups_demote_member( $user_id, $group_id );
279
+ }
280
+
281
+ case 'admin' :
282
+ // If the user was banned, we must
283
+ // unban first
284
+ if ( 'banned' == $existing_role ) {
285
+ groups_unban_member( $user_id, $group_id );
286
+ }
287
+
288
+ // At this point, each existing_role
289
+ // is a member, so promote
290
+ $result = groups_promote_member( $user_id, $group_id, $new_role );
291
+
292
+ break;
293
+
294
+ case 'member' :
295
+
296
+ if ( 'admin' == $existing_role || 'mod' == $existing_role ) {
297
+ $result = groups_demote_member( $user_id, $group_id );
298
+ } else if ( 'banned' == $existing_role ) {
299
+ $result = groups_unban_member( $user_id, $group_id );
300
+ }
301
+
302
+ break;
303
+
304
+ case 'banned' :
305
+
306
+ $result = groups_ban_member( $user_id, $group_id );
307
+
308
+ break;
309
+
310
+ case 'remove' :
311
+
312
+ $result = groups_remove_member( $user_id, $group_id );
313
+
314
+ break;
315
+ }
316
+
317
+ // Store the success or failure
318
+ if ( $result ) {
319
+ $success_modified[] = $user_id;
320
+ } else {
321
+ $error_modified[] = $user_id;
322
+ }
323
+ }
324
+ }
325
+ }
326
+
327
+ // Call actions for plugins to do something before we redirect
328
+ do_action( 'bp_group_admin_edit_after', $group_id );
329
+
330
+ // Create the redirect URL
331
+
332
+ if ( $error ) {
333
+ // This means there was an error updating group details
334
+ $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to );
335
+ } else {
336
+ // Group details were update successfully
337
+ $redirect_to = add_query_arg( 'updated', 1, $redirect_to );
338
+ }
339
+
340
+ if ( !empty( $success_new ) ) {
341
+ $success_new = implode( ',', array_filter( $success_new, 'urlencode' ) );
342
+ $redirect_to = add_query_arg( 'success_new', $success_new, $redirect_to );
343
+ }
344
+
345
+ if ( !empty( $error_new ) ) {
346
+ $error_new = implode( ',', array_filter( $error_new, 'urlencode' ) );
347
+ $redirect_to = add_query_arg( 'error_new', $error_new, $redirect_to );
348
+ }
349
+
350
+ if ( !empty( $success_modified ) ) {
351
+ $success_modified = implode( ',', array_filter( $success_modified, 'urlencode' ) );
352
+ $redirect_to = add_query_arg( 'success_modified', $success_modified, $redirect_to );
353
+ }
354
+
355
+ if ( !empty( $error_modified ) ) {
356
+ $error_modified = implode( ',', array_filter( $error_modified, 'urlencode' ) );
357
+ $redirect_to = add_query_arg( 'error_modified', $error_modified, $redirect_to );
358
+ }
359
+
360
+ // Redirect
361
+ wp_redirect( apply_filters( 'bp_group_admin_edit_redirect', $redirect_to ) );
362
+ exit;
363
+
364
+
365
+ // If a referrer and a nonce is supplied, but no action, redirect back.
366
+ } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
367
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
368
+ exit;
369
+ }
370
+ }
371
+
372
+ /**
373
+ * Handle save/update of screen options for the Groups component admin screen
374
+ *
375
+ * @since BuddyPress (1.7)
376
+ *
377
+ * @param string $value Will always be false unless another plugin filters it first.
378
+ * @param string $option Screen option name
379
+ * @param string $new_value Screen option form value
380
+ * @return string Option value. False to abandon update.
381
+ */
382
+ function bp_groups_admin_screen_options( $value, $option, $new_value ) {
383
+ if ( 'toplevel_page_bp_groups_per_page' != $option && 'toplevel_page_bp_groups_network_per_page' != $option )
384
+ return $value;
385
+
386
+ // Per page
387
+ $new_value = (int) $new_value;
388
+ if ( $new_value < 1 || $new_value > 999 )
389
+ return $value;
390
+
391
+ return $new_value;
392
+ }
393
+
394
+ /**
395
+ * Outputs the Groups component admin screens
396
+ *
397
+ * @since BuddyPress (1.7)
398
+ */
399
+ function bp_groups_admin() {
400
+ // Decide whether to load the index or edit screen
401
+ $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
402
+
403
+ // Display the single group edit screen
404
+ if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
405
+ bp_groups_admin_edit();
406
+
407
+ // Display the group deletion confirmation screen
408
+ } else if ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {
409
+ bp_groups_admin_delete();
410
+
411
+ // Otherwise, display the groups index screen
412
+ } else {
413
+ bp_groups_admin_index();
414
+ }
415
+ }
416
+
417
+ /**
418
+ * Display the single groups edit screen
419
+ *
420
+ * @since BuddyPress (1.7)
421
+ */
422
+ function bp_groups_admin_edit() {
423
+
424
+ if ( ! is_super_admin() )
425
+ die( '-1' );
426
+
427
+ $messages = array();
428
+
429
+ // If the user has just made a change to a group, build status messages
430
+ if ( !empty( $_REQUEST['no_admins'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) || ! empty( $_REQUEST['error_new'] ) || ! empty( $_REQUEST['success_new'] ) || ! empty( $_REQUEST['error_modified'] ) || ! empty( $_REQUEST['success_modified'] ) ) {
431
+ $no_admins = ! empty( $_REQUEST['no_admins'] ) ? 1 : 0;
432
+ $errors = ! empty( $_REQUEST['error'] ) ? $_REQUEST['error'] : '';
433
+ $updated = ! empty( $_REQUEST['updated'] ) ? $_REQUEST['updated'] : '';
434
+ $error_new = ! empty( $_REQUEST['error_new'] ) ? explode( ',', $_REQUEST['error_new'] ) : array();
435
+ $success_new = ! empty( $_REQUEST['success_new'] ) ? explode( ',', $_REQUEST['success_new'] ) : array();
436
+ $error_modified = ! empty( $_REQUEST['error_modified'] ) ? explode( ',', $_REQUEST['error_modified'] ) : array();
437
+ $success_modified = ! empty( $_REQUEST['success_modified'] ) ? explode( ',', $_REQUEST['success_modified'] ) : array();
438
+
439
+ if ( ! empty( $no_admins ) ) {
440
+ $messages[] = __( 'You cannot remove all administrators from a group.', 'buddypress' );
441
+ }
442
+
443
+ if ( ! empty( $errors ) ) {
444
+ $messages[] = __( 'An error occurred when trying to update your group details.', 'buddypress' );
445
+ } else if ( ! empty( $updated ) ) {
446
+ $messages[] = __( 'The group has been updated successfully.', 'buddypress' );
447
+ }
448
+
449
+ if ( ! empty( $error_new ) ) {
450
+ $messages[] = sprintf( __( 'The following users could not be added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $error_new ) );
451
+ }
452
+
453
+ if ( ! empty( $success_new ) ) {
454
+ $messages[] = sprintf( __( 'The following users were successfully added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $success_new ) );
455
+ }
456
+
457
+ if ( ! empty( $error_modified ) ) {
458
+ $error_modified = bp_groups_admin_get_usernames_from_ids( $error_modified );
459
+ $messages[] = sprintf( __( 'An error occurred when trying to modify the following members: <em>%s</em>', 'buddypress' ), implode( ', ', $error_modified ) );
460
+ }
461
+
462
+ if ( ! empty( $success_modified ) ) {
463
+ $success_modified = bp_groups_admin_get_usernames_from_ids( $success_modified );
464
+ $messages[] = sprintf( __( 'The following members were successfully modified: <em>%s</em>', 'buddypress' ), implode( ', ', $success_modified ) );
465
+ }
466
+ }
467
+
468
+ $is_error = ! empty( $no_admins ) || ! empty( $errors ) || ! empty( $error_new ) || ! empty( $error_modified );
469
+
470
+ // Get the group from the database
471
+ $group = groups_get_group( 'group_id=' . $_GET['gid'] );
472
+ $group_name = isset( $group->name ) ? apply_filters( 'bp_get_group_name', $group->name ) : '';
473
+
474
+ // Construct URL for form
475
+ $form_url = remove_query_arg( array( 'action', 'deleted', 'no_admins', 'error', 'error_new', 'success_new', 'error_modified', 'success_modified' ), $_SERVER['REQUEST_URI'] );
476
+ $form_url = add_query_arg( 'action', 'save', $form_url );
477
+
478
+ // Call an action for plugins to modify the group before we display the edit form
479
+ do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?>
480
+
481
+ <div class="wrap">
482
+ <?php screen_icon( 'buddypress-groups' ); ?>
483
+ <h2><?php _e( 'Edit Group', 'buddypress' ); ?>
484
+
485
+ <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
486
+ <a class="add-new-h2" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
487
+ <?php endif; ?>
488
+
489
+ </h2>
490
+
491
+ <?php // If the user has just made a change to an group, display the status messages ?>
492
+ <?php if ( !empty( $messages ) ) : ?>
493
+ <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
494
+ <?php endif; ?>
495
+
496
+ <?php if ( ! empty( $group ) ) : ?>
497
+
498
+ <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-groups-edit-form" method="post">
499
+ <div id="poststuff">
500
+
501
+ <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
502
+ <div id="post-body-content">
503
+ <div id="postdiv" class="postarea">
504
+ <div id="bp_groups_name" class="postbox">
505
+ <h3><?php _e( 'Name and Description', 'buddypress' ); ?></h3>
506
+ <div class="inside">
507
+ <input type="text" name="bp-groups-name" id="bp-groups-name" value="<?php echo esc_attr( stripslashes( $group_name ) ) ?>" />
508
+
509
+ <?php wp_editor( stripslashes( $group->description ), 'bp-groups-description', array( 'media_buttons' => false, 'teeny' => true, 'textarea_rows' => 5, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
510
+ </div>
511
+ </div>
512
+ </div>
513
+ </div><!-- #post-body-content -->
514
+
515
+ <div id="postbox-container-1" class="postbox-container">
516
+ <?php do_meta_boxes( get_current_screen()->id, 'side', $group ); ?>
517
+ </div>
518
+
519
+ <div id="postbox-container-2" class="postbox-container">
520
+ <?php do_meta_boxes( get_current_screen()->id, 'normal', $group ); ?>
521
+ <?php do_meta_boxes( get_current_screen()->id, 'advanced', $group ); ?>
522
+ </div>
523
+ </div><!-- #post-body -->
524
+
525
+ </div><!-- #poststuff -->
526
+ <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
527
+ <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
528
+ <?php wp_nonce_field( 'edit-group_' . $group->id ); ?>
529
+ </form>
530
+
531
+ <?php else : ?>
532
+ <p><?php printf( __( 'No group found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'admin.php?page=bp-groups' ) ) ); ?></p>
533
+ <?php endif; ?>
534
+
535
+ </div><!-- .wrap -->
536
+
537
+ <?php
538
+ }
539
+
540
+ /**
541
+ * Display the Group delete confirmation screen
542
+ *
543
+ * We include a separate confirmation because group deletion is truly
544
+ * irreversible.
545
+ *
546
+ * @since (BuddyPress) 1.7
547
+ */
548
+ function bp_groups_admin_delete() {
549
+
550
+ if ( ! is_super_admin() )
551
+ die( '-1' );
552
+
553
+ $group_ids = isset( $_REQUEST['gid'] ) ? $_REQUEST['gid'] : 0;
554
+ if ( ! is_array( $group_ids ) ) {
555
+ $group_ids = explode( ',', $group_ids );
556
+ }
557
+ $group_ids = wp_parse_id_list( $group_ids );
558
+ $groups = groups_get_groups( array( 'include' => $group_ids, 'show_hidden' => true, ) );
559
+
560
+ // Create a new list of group ids, based on those that actually exist
561
+ $gids = array();
562
+ foreach ( $groups['groups'] as $group ) {
563
+ $gids[] = $group->id;
564
+ }
565
+
566
+ $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?>
567
+
568
+ <div class="wrap">
569
+ <?php screen_icon( 'buddypress-groups' ); ?>
570
+ <h2><?php _e( 'Delete Groups', 'buddypress' ) ?></h2>
571
+ <p><?php _e( 'You are about to delete the following groups:', 'buddypress' ) ?></p>
572
+
573
+ <ul class="bp-group-delete-list">
574
+ <?php foreach ( $groups['groups'] as $group ) : ?>
575
+ <li><?php echo esc_html( $group->name ) ?></li>
576
+ <?php endforeach; ?>
577
+ </ul>
578
+
579
+ <p><strong><?php _e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
580
+
581
+ <a class="button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'gid' => implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ?>"><?php _e( 'Delete Permanently', 'buddypress' ) ?></a>
582
+ <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php _e( 'Cancel', 'buddypress' ) ?></a>
583
+ </div>
584
+
585
+ <?php
586
+ }
587
+
588
+ /**
589
+ * Display the Groups admin index screen, which contains a list of all your
590
+ * BuddyPress groups.
591
+ *
592
+ * @global BP_Group_List_Table $bp_groups_list_table Group screen list table
593
+ * @global string $plugin_page
594
+ * @since BuddyPress (1.7)
595
+ */
596
+ function bp_groups_admin_index() {
597
+ global $bp_groups_list_table, $plugin_page;
598
+
599
+ $messages = array();
600
+
601
+ // If the user has just made a change to a group, build status messages
602
+ if ( ! empty( $_REQUEST['deleted'] ) ) {
603
+ $deleted = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
604
+
605
+ if ( $deleted > 0 ) {
606
+ $messages[] = sprintf( _n( '%s group has been permanently deleted.', '%s groups have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
607
+ }
608
+ }
609
+
610
+ // Prepare the group items for display
611
+ $bp_groups_list_table->prepare_items();
612
+
613
+ // Call an action for plugins to modify the messages before we display the edit form
614
+ do_action( 'bp_groups_admin_index', $messages ); ?>
615
+
616
+ <div class="wrap">
617
+ <?php screen_icon( 'buddypress-groups' ); ?>
618
+ <h2>
619
+ <?php _e( 'Groups', 'buddypress' ); ?>
620
+
621
+ <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
622
+ <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
623
+ <?php endif; ?>
624
+ </h2>
625
+
626
+ <?php // If the user has just made a change to an group, display the status messages ?>
627
+ <?php if ( !empty( $messages ) ) : ?>
628
+ <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
629
+ <?php endif; ?>
630
+
631
+ <?php // Display each group on its own row ?>
632
+ <?php $bp_groups_list_table->views(); ?>
633
+
634
+ <form id="bp-groups-form" action="" method="get">
635
+ <?php $bp_groups_list_table->search_box( __( 'Search all Groups', 'buddypress' ), 'bp-groups' ); ?>
636
+ <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
637
+ <?php $bp_groups_list_table->display(); ?>
638
+ </form>
639
+
640
+ </div>
641
+
642
+ <?php
643
+ }
644
+
645
+ /**
646
+ * Settings metabox
647
+ *
648
+ * @param object $item Group item
649
+ * @since BuddyPress (1.7)
650
+ */
651
+ function bp_groups_admin_edit_metabox_settings( $item ) {
652
+
653
+ $invite_status = groups_get_groupmeta( $item->id, 'invite_status' ); ?>
654
+
655
+ <?php if ( bp_is_active( 'forums' ) ) : ?>
656
+ <div class="bp-groups-settings-section" id="bp-groups-settings-section-forum">
657
+ <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" <?php checked( $item->enable_forum ) ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ) ?><br />
658
+ </div>
659
+ <?php endif; ?>
660
+
661
+ <div class="bp-groups-settings-section" id="bp-groups-settings-section-status">
662
+ <label for="group-status"><?php _e( 'Privacy', 'buddypress' ); ?></label>
663
+
664
+ <ul>
665
+ <li><input type="radio" name="group-status" id="bp-group-status-public" value="public" <?php checked( $item->status, 'public' ) ?> /> <?php _e( 'Public', 'buddypress' ) ?></li>
666
+ <li><input type="radio" name="group-status" id="bp-group-status-private" value="private" <?php checked( $item->status, 'private' ) ?> /> <?php _e( 'Private', 'buddypress' ) ?></li>
667
+ <li><input type="radio" name="group-status" id="bp-group-status-hidden" value="hidden" <?php checked( $item->status, 'hidden' ) ?> /> <?php _e( 'Hidden', 'buddypress' ) ?></li>
668
+ </div>
669
+
670
+ <div class="bp-groups-settings-section" id="bp-groups-settings-section-invite-status">
671
+ <label for="group-invite-status"><?php _e( 'Who can invite others to this group?', 'buddypress' ); ?></label>
672
+
673
+ <ul>
674
+ <li><input type="radio" name="group-invite-status" id="bp-group-invite-status-members" value="members" <?php checked( $invite_status, 'members' ) ?> /> <?php _e( 'All group members', 'buddypress' ) ?></li>
675
+ <li><input type="radio" name="group-invite-status" id="bp-group-invite-status-mods" value="mods" <?php checked( $invite_status, 'mods' ) ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ) ?></li>
676
+ <li><input type="radio" name="group-invite-status" id="bp-group-invite-status-admins" value="admins" <?php checked( $invite_status, 'admins' ) ?> /> <?php _e( 'Group admins only', 'buddypress' ) ?></li>
677
+ </ul>
678
+ </div>
679
+
680
+ <?php
681
+ }
682
+
683
+ /**
684
+ * Add New Members metabox
685
+ *
686
+ * @since BuddyPress (1.7)
687
+ */
688
+ function bp_groups_admin_edit_metabox_add_new_members( $item ) {
689
+ ?>
690
+
691
+ <input name="bp-groups-new-members" id="bp-groups-new-members" class="bp-suggest-user" placeholder="<?php _e( 'Enter a comma-separated list of user logins.', 'buddypress' ) ?>" />
692
+ <ul id="bp-groups-new-members-list"></ul>
693
+ <?php
694
+ }
695
+
696
+ /**
697
+ * Members metabox
698
+ *
699
+ * @since BuddyPress (1.7)
700
+ */
701
+ function bp_groups_admin_edit_metabox_members( $item ) {
702
+ global $members_template;
703
+
704
+ // Pull up a list of group members, so we can separate out the types
705
+ // We'll also keep track of group members here to place them into a
706
+ // javascript variable, which will help with group member autocomplete
707
+ $member_ids = array();
708
+ $members = array(
709
+ 'admin' => array(),
710
+ 'mod' => array(),
711
+ 'member' => array(),
712
+ 'banned' => array()
713
+ );
714
+
715
+ if ( bp_group_has_members( array(
716
+ 'group_id' => $item->id,
717
+ 'exclude_admins_mods' => false,
718
+ 'exclude_banned' => false
719
+ ) ) ) {
720
+ // Get a list of admins and mods, to reduce lookups
721
+ // We'll rekey them by user_id for convenience
722
+ $admins = $mods = array();
723
+
724
+ foreach ( (array) groups_get_group_admins( $item->id ) as $admin_obj ) {
725
+ $admins[ $admin_obj->user_id ] = $admin_obj;
726
+ }
727
+
728
+ foreach ( (array) groups_get_group_mods( $item->id ) as $admin_obj ) {
729
+ $mods[ $admin_obj->user_id ] = $admin_obj;
730
+ }
731
+
732
+ while ( bp_group_members() ) {
733
+ bp_group_the_member();
734
+ if ( bp_get_group_member_is_banned() ) {
735
+ $members['banned'][] = $members_template->member;
736
+ } else if ( isset( $admins[ bp_get_group_member_id() ] ) ) {
737
+ $members['admin'][] = $members_template->member;
738
+ } else if ( isset( $mods[ bp_get_group_member_id() ] ) ) {
739
+ $members['mod'][] = $members_template->member;
740
+ } else {
741
+ $members['member'][] = $members_template->member;
742
+ }
743
+
744
+ $member_ids[] = bp_get_group_member_id();
745
+ }
746
+ }
747
+
748
+ // Echo out the javascript variable
749
+ $member_ids = ! empty( $member_ids ) ? implode( ',', $member_ids ) : '';
750
+ echo '<script type="text/javascript">var group_members = "' . $member_ids . '";</script>';
751
+
752
+ // Loop through each member type
753
+ foreach ( $members as $member_type => $type_users ) : ?>
754
+
755
+ <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr( $member_type ) ?>">
756
+
757
+ <h4>
758
+ <?php switch ( $member_type ) :
759
+ case 'admin' : _e( 'Administrators', 'buddypress' ); break;
760
+ case 'mod' : _e( 'Moderators', 'buddypress' ); break;
761
+ case 'member' : _e( 'Members', 'buddypress' ); break;
762
+ case 'banned' : _e( 'Banned Users', 'buddypress' ); break;
763
+ endswitch; ?>
764
+ </h4>
765
+
766
+ <?php if ( !empty( $type_users ) ) : ?>
767
+
768
+ <table class="widefat bp-group-members">
769
+ <thead>
770
+ <tr>
771
+ <th scope="col" class="uid-column"><?php _ex( 'ID', 'Group member user_id in group admin', 'buddypress' ) ?></th>
772
+ <th scope="col" class="uname-column"><?php _ex( 'Name', 'Group member name in group admin', 'buddypress' ) ?></th>
773
+ <th scope="col" class="urole-column"><?php _ex( 'Group Role', 'Group member role in group admin', 'buddypress' ) ?></th>
774
+ </tr>
775
+ </thead>
776
+
777
+ <tbody>
778
+
779
+ <?php foreach ( $type_users as $type_user ) : ?>
780
+
781
+ <tr>
782
+ <th scope="row" class="uid-column"><?php echo esc_html( $type_user->user_id ); ?></th>
783
+
784
+ <td class="uname-column">
785
+ <a style="float: left;" href="<?php echo bp_core_get_user_domain( $type_user->user_id ); ?>"><?php echo bp_core_fetch_avatar( array(
786
+ 'item_id' => $type_user->user_id,
787
+ 'width' => '32',
788
+ 'height' => '32'
789
+ ) ); ?></a>
790
+
791
+ <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user->user_id ) ?></span>
792
+ </td>
793
+
794
+ <td class="urole-column">
795
+ <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->user_id ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->user_id ); ?>]">
796
+ <option value="admin" <?php selected( 'admin', $member_type ) ?>><?php _e( 'Administrator', 'buddypress' ) ?></option>
797
+ <option value="mod" <?php selected( 'mod', $member_type ) ?>><?php _e( 'Moderator', 'buddypress' ) ?></option>
798
+ <option value="member" <?php selected( 'member', $member_type ) ?>><?php _e( 'Member', 'buddypress' ) ?></option>
799
+ <option class="banned" value="banned" <?php selected( 'banned', $member_type ) ?>><?php _e( 'Banned', 'buddypress' ) ?></option>
800
+ <option class="remove" value="remove"><?php _e( 'Remove From Group', 'buddypress' ) ?></option>
801
+ </select>
802
+
803
+ <?php
804
+ /**
805
+ * Store the current role for this user,
806
+ * so we can easily detect changes.
807
+ *
808
+ * @todo remove this, and do database detection on save
809
+ */ ?>
810
+ <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr( $type_user->user_id ); ?>]" value="<?php echo esc_attr( $member_type ); ?>" />
811
+ </td>
812
+ </tr>
813
+
814
+ <?php endforeach; ?>
815
+
816
+ </tbody>
817
+ </table>
818
+
819
+ <?php else : ?>
820
+
821
+ <p class="bp-groups-no-members description"><?php _e( 'No members of this type', 'buddypress' ) ?></p>
822
+
823
+ <?php endif; ?>
824
+
825
+ </div><!-- .bp-groups-member-type -->
826
+
827
+ <?php endforeach;
828
+
829
+ }
830
+
831
+ /**
832
+ * Status metabox for the Groups admin edit screen
833
+ *
834
+ * @param object $item Group item
835
+ * @since BuddyPress (1.7)
836
+ */
837
+ function bp_groups_admin_edit_metabox_status( $item ) {
838
+ $base_url = add_query_arg( array(
839
+ 'page' => 'bp-groups',
840
+ 'gid' => $item->id
841
+ ), bp_get_admin_url( 'admin.php' ) ); ?>
842
+
843
+ <div id="submitcomment" class="submitbox">
844
+ <div id="major-publishing-actions">
845
+ <div id="delete-action">
846
+ <a class="submitdelete deletion" href="<?php echo wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-groups-delete' ) ?>"><?php _e( 'Delete Group', 'buddypress' ) ?></a>
847
+ </div>
848
+
849
+ <div id="publishing-action">
850
+ <?php submit_button( __( 'Save Changes', 'buddypress' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?>
851
+ </div>
852
+ <div class="clear"></div>
853
+ </div><!-- #major-publishing-actions -->
854
+ </div><!-- #submitcomment -->
855
+
856
+ <?php
857
+ }
858
+
859
+ /**
860
+ * Match a set of user ids up to a set of usernames
861
+ *
862
+ * @since BuddyPress (1.7)
863
+ */
864
+ function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) {
865
+
866
+ $usernames = array();
867
+ $users = new WP_User_Query( array( 'blog_id' => 0, 'include' => $user_ids ) );
868
+
869
+ foreach ( (array) $users->results as $user ) {
870
+ $usernames[] = $user->user_login;
871
+ }
872
+
873
+ return $usernames;
874
+ }
875
+
876
+ /**
877
+ * AJAX handler for group member autocomplete requests
878
+ *
879
+ * @since BuddyPress (1.7)
880
+ */
881
+ function bp_groups_admin_autocomplete_handler() {
882
+
883
+ // Bail if user user shouldn't be here, or is a large network
884
+ if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) )
885
+ wp_die( -1 );
886
+
887
+ $return = array();
888
+
889
+ // Exclude current group members
890
+ $group_members = isset( $_REQUEST['group_members'] ) ? wp_parse_id_list( $_REQUEST['group_members'] ) : array();
891
+ $terms = isset( $_REQUEST['term'] ) ? $_REQUEST['term'] : '';
892
+ $users = get_users( array(
893
+ 'blog_id' => false,
894
+ 'search' => '*' . $terms . '*',
895
+ 'exclude' => $group_members,
896
+ 'search_columns' => array( 'user_login', 'user_nicename', 'user_email', 'display_name' ),
897
+ 'number' => 10
898
+ ) );
899
+
900
+ foreach ( (array) $users as $user ) {
901
+ $return[] = array(
902
+ /* translators: 1: user_login, 2: user_email */
903
+ 'label' => sprintf( __( '%1$s (%2$s)' ), $user->user_login, $user->user_email ),
904
+ 'value' => $user->user_login,
905
+ );
906
+ }
907
+
908
+ wp_die( json_encode( $return ) );
909
+ }
910
+ add_action( 'wp_ajax_bp_group_admin_member_autocomplete', 'bp_groups_admin_autocomplete_handler' );
911
+
912
+ /**
913
+ * List table class for the Groups component admin page.
914
+ *
915
+ * @since BuddyPress (1.7)
916
+ */
917
+ class BP_Groups_List_Table extends WP_List_Table {
918
+
919
+ /**
920
+ * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"...
921
+ *
922
+ * @since BuddyPress (1.7)
923
+ */
924
+ public $view = 'all';
925
+
926
+ /**
927
+ * Group counts for each group type
928
+ *
929
+ * @since BuddyPress (1.7)
930
+ */
931
+ public $group_counts = 0;
932
+
933
+ /**
934
+ * Constructor
935
+ *
936
+ * @since BuddyPress (1.7)
937
+ */
938
+ public function __construct() {
939
+
940
+ // Define singular and plural labels, as well as whether we support AJAX.
941
+ parent::__construct( array(
942
+ 'ajax' => false,
943
+ 'plural' => 'groups',
944
+ 'singular' => 'group',
945
+ ) );
946
+ }
947
+
948
+ /**
949
+ * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering.
950
+ *
951
+ * @since BuddyPress (1.7)
952
+ */
953
+ function prepare_items() {
954
+ global $groups_template;
955
+
956
+ $screen = get_current_screen();
957
+
958
+ // Option defaults
959
+ $include_id = false;
960
+ $search_terms = false;
961
+
962
+ // Set current page
963
+ $page = $this->get_pagenum();
964
+
965
+ // Set per page from the screen options
966
+ $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) );
967
+
968
+ // Sort order. Note: not supported in bp_has_groups()
969
+ $order = 'ASC';
970
+ if ( !empty( $_REQUEST['order'] ) ) {
971
+ $order = ( 'desc' == strtolower( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC';
972
+ }
973
+
974
+ // Order by - default to newest
975
+ $type = 'newest';
976
+ if ( !empty( $_REQUEST['orderby'] ) ) {
977
+ switch ( $_REQUEST['orderby'] ) {
978
+ case 'name' :
979
+ $type = 'alphabetical';
980
+ break;
981
+ case 'id' :
982
+ $type = 'newest';
983
+ break;
984
+ case 'members' :
985
+ $type = 'popular';
986
+ break;
987
+ }
988
+ }
989
+
990
+ // Are we doing a search?
991
+ if ( !empty( $_REQUEST['s'] ) )
992
+ $search_terms = $_REQUEST['s'];
993
+
994
+ // Check if user has clicked on a specific group (if so, fetch only that group).
995
+ if ( !empty( $_REQUEST['gid'] ) )
996
+ $include_id = (int) $_REQUEST['gid'];
997
+
998
+ // Set the current view
999
+ if ( isset( $_GET['group_status'] ) && in_array( $_GET['group_status'], array( 'public', 'private', 'hidden' ) ) ) {
1000
+ $this->view = $_GET['group_status'];
1001
+ }
1002
+
1003
+ // We'll use the ids of group types for the 'include' param
1004
+ $this->group_type_ids = BP_Groups_Group::get_group_type_ids();
1005
+
1006
+ // Pass a dummy array if there are no groups of this type
1007
+ $include = false;
1008
+ if ( 'all' != $this->view && isset( $this->group_type_ids[ $this->view ] ) ) {
1009
+ $include = ! empty( $this->group_type_ids[ $this->view ] ) ? $this->group_type_ids[ $this->view ] : array( 0 );
1010
+ }
1011
+
1012
+ // Get group type counts for display in the filter tabs
1013
+ $this->group_counts = array();
1014
+ foreach ( $this->group_type_ids as $group_type => $group_ids ) {
1015
+ $this->group_counts[ $group_type ] = count( $group_ids );
1016
+ }
1017
+
1018
+ // If we're viewing a specific group, flatten all activites into a single array.
1019
+ if ( $include_id ) {
1020
+ $groups = array( (array) groups_get_group( 'group_id=' . $include_id ) );
1021
+ } else {
1022
+ $groups_args = array(
1023
+ 'include' => $include,
1024
+ 'per_page' => $per_page,
1025
+ 'page' => $page,
1026
+ 'type' => $type,
1027
+ 'order' => $order
1028
+ );
1029
+
1030
+ $groups = array();
1031
+ if ( bp_has_groups( $groups_args ) ) {
1032
+ while ( bp_groups() ) {
1033
+ bp_the_group();
1034
+ $groups[] = (array) $groups_template->group;
1035
+ }
1036
+ }
1037
+ }
1038
+
1039
+ // Set raw data to display
1040
+ $this->items = $groups;
1041
+
1042
+ // Store information needed for handling table pagination
1043
+ $this->set_pagination_args( array(
1044
+ 'per_page' => $per_page,
1045
+ 'total_items' => $groups_template->total_group_count,
1046
+ 'total_pages' => ceil( $groups_template->total_group_count / $per_page )
1047
+ ) );
1048
+ }
1049
+
1050
+ /**
1051
+ * Get an array of all the columns on the page
1052
+ *
1053
+ * @return array
1054
+ * @since BuddyPress (1.7)
1055
+ */
1056
+ function get_column_info() {
1057
+ $this->_column_headers = array(
1058
+ $this->get_columns(),
1059
+ array(),
1060
+ $this->get_sortable_columns(),
1061
+ );
1062
+
1063
+ return $this->_column_headers;
1064
+ }
1065
+
1066
+ /**
1067
+ * Displays a message on screen when no items are found (e.g. no search matches)
1068
+ *
1069
+ * @since BuddyPress (1.7)
1070
+ */
1071
+ function no_items() {
1072
+ _e( 'No groups found.', 'buddypress' );
1073
+ }
1074
+
1075
+ /**
1076
+ * Outputs the Groups data table
1077
+ *
1078
+ * @since BuddyPress (1.7)
1079
+ */
1080
+ function display() {
1081
+ extract( $this->_args );
1082
+
1083
+ $this->display_tablenav( 'top' ); ?>
1084
+
1085
+ <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
1086
+ <thead>
1087
+ <tr>
1088
+ <?php $this->print_column_headers(); ?>
1089
+ </tr>
1090
+ </thead>
1091
+
1092
+ <tfoot>
1093
+ <tr>
1094
+ <?php $this->print_column_headers( false ); ?>
1095
+ </tr>
1096
+ </tfoot>
1097
+
1098
+ <tbody id="the-comment-list">
1099
+ <?php $this->display_rows_or_placeholder(); ?>
1100
+ </tbody>
1101
+ </table>
1102
+ <?php
1103
+
1104
+ $this->display_tablenav( 'bottom' );
1105
+ }
1106
+
1107
+ /**
1108
+ * Generates content for a single row of the table
1109
+ *
1110
+ * @param object $item The current item
1111
+ * @since BuddyPress (1.7)
1112
+ */
1113
+ function single_row( $item = array() ) {
1114
+ static $row_class = '';
1115
+
1116
+ if ( empty( $row_class ) ) {
1117
+ $row_class = ' class="alternate odd"';
1118
+ } else {
1119
+ $row_class = ' class="even"';
1120
+ }
1121
+
1122
+ echo '<tr' . $row_class . ' id="group-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['id'] ) . '">';
1123
+ echo $this->single_row_columns( $item );
1124
+ echo '</tr>';
1125
+ }
1126
+
1127
+ /**
1128
+ * Get the list of views available on this table (e.g. "all", "public").
1129
+ *
1130
+ * @since BuddyPress (1.7)
1131
+ */
1132
+ function get_views() {
1133
+ $url_base = remove_query_arg( array( 'orderby', 'order', 'group_status' ), $_SERVER['REQUEST_URI'] ); ?>
1134
+ <ul class="subsubsub">
1135
+ <li class="all"><a href="<?php echo esc_attr( esc_url( $url_base ) ); ?>" class="<?php if ( 'all' == $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
1136
+ <li class="public"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'public', $url_base ) ) ); ?>" class="<?php if ( 'public' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Public <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->group_counts['public'] ) ); ?></a> |</li>
1137
+ <li class="private"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'private', $url_base ) ) ); ?>" class="<?php if ( 'private' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Private <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->group_counts['private'] ) ); ?></a> |</li>
1138
+ <li class="hidden"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'hidden', $url_base ) ) ); ?>" class="<?php if ( 'hidden' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Hidden <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->group_counts['hidden'] ) ); ?></a></li>
1139
+
1140
+ <?php do_action( 'bp_groups_list_table_get_views', $url_base, $this->view ); ?>
1141
+ </ul>
1142
+ <?php
1143
+ }
1144
+
1145
+ /**
1146
+ * Get bulk actions
1147
+ *
1148
+ * @return array Key/value pairs for the bulk actions dropdown
1149
+ * @since BuddyPress (1.7)
1150
+ */
1151
+ function get_bulk_actions() {
1152
+ return apply_filters( 'bp_groups_list_table_get_bulk_actions', array(
1153
+ 'delete' => __( 'Delete', 'buddypress' )
1154
+ ) );
1155
+ }
1156
+
1157
+ /**
1158
+ * Get the table column titles.
1159
+ *
1160
+ * @see WP_List_Table::single_row_columns()
1161
+ * @return array
1162
+ * @since BuddyPress (1.7)
1163
+ */
1164
+ function get_columns() {
1165
+ return array(
1166
+ 'cb' => '<input name type="checkbox" />',
1167
+ 'comment' => _x( 'Name', 'Groups admin Group Name column header', 'buddypress' ),
1168
+ 'description' => _x( 'Description', 'Groups admin Group Description column header', 'buddypress' ),
1169
+ 'status' => _x( 'Status', 'Groups admin Privacy Status column header', 'buddypress' ),
1170
+ 'members' => _x( '# Members', 'Groups admin Members column header', 'buddypress' ),
1171
+ 'last_active' => _x( 'Last Active', 'Groups admin Last Active column header', 'buddypress' )
1172
+ );
1173
+ }
1174
+
1175
+ /**
1176
+ * Get the column names for sortable columns
1177
+ *
1178
+ * @return array
1179
+ * @since BuddyPress (1.7)
1180
+ */
1181
+ function get_sortable_columns() {
1182
+ return array(
1183
+ 'gid' => array( 'gid', false ),
1184
+ 'comment' => array( 'name', false ),
1185
+ 'members' => array( 'members', false ),
1186
+ 'last_active' => array( 'last_active', false )
1187
+ );
1188
+ }
1189
+
1190
+ /**
1191
+ * Checkbox column
1192
+ *
1193
+ * @param array $item A singular item (one full row)
1194
+ * @see WP_List_Table::single_row_columns()
1195
+ * @since BuddyPress (1.7)
1196
+ */
1197
+ function column_cb( $item = array() ) {
1198
+ printf( '<input type="checkbox" name="gid[]" value="%d" />', (int) $item['id'] );
1199
+ }
1200
+
1201
+ /**
1202
+ * Group id column
1203
+ *
1204
+ * @param array $item A singular item (one full row)
1205
+ * @see WP_List_Table::single_row_columns()
1206
+ * @since BuddyPress (1.7)
1207
+ */
1208
+ function column_gid( $item = array() ) {
1209
+ echo '<strong>' . $item['id'] . '</strong>';
1210
+ }
1211
+
1212
+ /**
1213
+ * Name column, and "quick admin" rollover actions.
1214
+ *
1215
+ * Called "comment" in the CSS so we can re-use some WP core CSS.
1216
+ *
1217
+ * @param array $item A singular item (one full row)
1218
+ * @see WP_List_Table::single_row_columns()
1219
+ * @since BuddyPress (1.7)
1220
+ */
1221
+ function column_comment( $item = array() ) {
1222
+
1223
+ // Preorder items: Visit | Edit | Delete
1224
+ $actions = array(
1225
+ 'visit' => '',
1226
+ 'edit' => '',
1227
+ 'delete' => '',
1228
+ );
1229
+
1230
+ // We need the group object for some BP functions
1231
+ $item_obj = (object) $item;
1232
+
1233
+ // Build actions URLs
1234
+ $base_url = bp_get_admin_url( 'admin.php?page=bp-groups&amp;gid=' . $item['id'] );
1235
+ $delete_url = wp_nonce_url( $base_url . "&amp;action=delete", 'bp-groups-delete' );
1236
+ $edit_url = $base_url . '&amp;action=edit';
1237
+ $visit_url = bp_get_group_permalink( $item_obj );
1238
+
1239
+ // Rollover actions
1240
+
1241
+ // Visit
1242
+ $actions['visit'] = sprintf( '<a href="%s">%s</a>', esc_url( $visit_url ), __( 'Visit', 'buddypress' ) );
1243
+
1244
+ // Edit
1245
+ $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), __( 'Edit', 'buddypress' ) );
1246
+
1247
+ // Delete
1248
+ $actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) );
1249
+
1250
+ // Other plugins can filter which actions are shown
1251
+ $actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item );
1252
+
1253
+ // Get group name and avatar
1254
+ $avatar = bp_core_fetch_avatar( array(
1255
+ 'item_id' => $item['id'],
1256
+ 'object' => 'group',
1257
+ 'type' => 'thumb',
1258
+ 'avatar_dir' => 'group-avatars',
1259
+ 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $item['name'] ),
1260
+ 'width' => '32',
1261
+ 'height' => '32',
1262
+ 'title' => $item['name']
1263
+ ) );
1264
+
1265
+ $content = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'], $item ) );
1266
+
1267
+ echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions );
1268
+ }
1269
+
1270
+ /**
1271
+ * Description column
1272
+ *
1273
+ * @since BuddyPress (1.7)
1274
+ */
1275
+ function column_description( $item = array() ) {
1276
+ echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) );
1277
+ }
1278
+
1279
+ /**
1280
+ * Status column
1281
+ *
1282
+ * @since BuddyPress (1.7)
1283
+ */
1284
+ function column_status( $item = array() ) {
1285
+ $status = $item['status'];
1286
+ $status_desc = '';
1287
+
1288
+ // @todo This should be abstracted out somewhere for the whole
1289
+ // Groups component
1290
+ switch ( $status ) {
1291
+ case 'public' :
1292
+ $status_desc = __( 'Public', 'buddypress' );
1293
+ break;
1294
+ case 'private' :
1295
+ $status_desc = __( 'Private', 'buddypress' );
1296
+ break;
1297
+ case 'hidden' :
1298
+ $status_desc = __( 'Hidden', 'buddypress' );
1299
+ break;
1300
+ }
1301
+
1302
+ echo apply_filters_ref_array( 'bp_groups_admin_get_group_status', array( $status_desc, $item ) );
1303
+ }
1304
+
1305
+ /**
1306
+ * Number of Members column
1307
+ *
1308
+ * @since BuddyPress (1.7)
1309
+ */
1310
+ function column_members( $item = array() ) {
1311
+ $count = groups_get_groupmeta( $item['id'], 'total_member_count' );
1312
+ echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) );
1313
+ }
1314
+
1315
+ /**
1316
+ * Last Active column
1317
+ *
1318
+ * @since BuddyPress (1.7)
1319
+ */
1320
+ function column_last_active( $item = array() ) {
1321
+ $last_active = groups_get_groupmeta( $item['id'], 'last_activity' );
1322
+ echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
1323
+ }
1324
+ }
bp-groups/bp-groups-adminbar.php CHANGED
@@ -116,5 +116,3 @@ function bp_groups_remove_edit_page_menu() {
116
  }
117
  }
118
  add_action( 'bp_init', 'bp_groups_remove_edit_page_menu', 99 );
119
-
120
- ?>
116
  }
117
  }
118
  add_action( 'bp_init', 'bp_groups_remove_edit_page_menu', 99 );
 
 
bp-groups/bp-groups-buddybar.php CHANGED
@@ -65,5 +65,3 @@ function bp_groups_adminbar_admin_menu() {
65
  <?php
66
  }
67
  add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
68
-
69
- ?>
65
  <?php
66
  }
67
  add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
 
 
bp-groups/bp-groups-cache.php CHANGED
@@ -28,7 +28,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
28
  */
29
  function bp_groups_update_meta_cache( $group_ids = false ) {
30
  global $bp;
31
-
32
  $cache_args = array(
33
  'object_ids' => $group_ids,
34
  'object_type' => $bp->groups->id,
@@ -36,7 +36,7 @@ function bp_groups_update_meta_cache( $group_ids = false ) {
36
  'meta_table' => $bp->groups->table_name_groupmeta,
37
  'cache_key_prefix' => 'bp_groups_groupmeta'
38
  );
39
-
40
  bp_update_meta_cache( $cache_args );
41
  }
42
 
@@ -49,6 +49,21 @@ add_action( 'groups_details_updated', 'groups_clear_group_object_cach
49
  add_action( 'groups_group_avatar_updated', 'groups_clear_group_object_cache' );
50
  add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cache' );
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * Clears caches for the group creator when a group is created
54
  *
@@ -103,5 +118,3 @@ add_action( 'groups_membership_requested', 'bp_core_clear_cache' );
103
  add_action( 'groups_create_group_step_complete', 'bp_core_clear_cache' );
104
  add_action( 'groups_created_group', 'bp_core_clear_cache' );
105
  add_action( 'groups_group_avatar_updated', 'bp_core_clear_cache' );
106
-
107
- ?>
28
  */
29
  function bp_groups_update_meta_cache( $group_ids = false ) {
30
  global $bp;
31
+
32
  $cache_args = array(
33
  'object_ids' => $group_ids,
34
  'object_type' => $bp->groups->id,
36
  'meta_table' => $bp->groups->table_name_groupmeta,
37
  'cache_key_prefix' => 'bp_groups_groupmeta'
38
  );
39
+
40
  bp_update_meta_cache( $cache_args );
41
  }
42
 
49
  add_action( 'groups_group_avatar_updated', 'groups_clear_group_object_cache' );
50
  add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cache' );
51
 
52
+ /**
53
+ * Bust group caches when editing or deleting
54
+ *
55
+ * @since BuddyPress (1.7)
56
+ * @param int $group_id The group being edited
57
+ */
58
+ function bp_groups_delete_group_cache( $group_id = 0 ) {
59
+ wp_cache_delete( 'bp_groups_group_' . $group_id . '_load_users', 'bp' );
60
+ wp_cache_delete( 'bp_groups_group_' . $group_id . '_noload_users', 'bp' );
61
+ }
62
+ add_action( 'groups_delete_group', 'bp_groups_delete_group_cache' );
63
+ add_action( 'groups_update_group', 'bp_groups_delete_group_cache' );
64
+ add_action( 'groups_details_updated', 'bp_groups_delete_group_cache' );
65
+ add_action( 'groups_settings_updated', 'bp_groups_delete_group_cache' );
66
+
67
  /**
68
  * Clears caches for the group creator when a group is created
69
  *
118
  add_action( 'groups_create_group_step_complete', 'bp_core_clear_cache' );
119
  add_action( 'groups_created_group', 'bp_core_clear_cache' );
120
  add_action( 'groups_group_avatar_updated', 'bp_core_clear_cache' );
 
 
bp-groups/bp-groups-classes.php CHANGED
@@ -58,9 +58,9 @@ class BP_Groups_Group {
58
  function populate() {
59
  global $wpdb, $bp;
60
 
61
- if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) {
62
  bp_groups_update_meta_cache( $this->id );
63
-
64
  $this->id = $group->id;
65
  $this->creator_id = $group->creator_id;
66
  $this->name = stripslashes($group->name);
@@ -72,7 +72,7 @@ class BP_Groups_Group {
72
  $this->last_activity = groups_get_groupmeta( $this->id, 'last_activity' );
73
  $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
74
  $this->is_member = BP_Groups_Member::check_is_member( bp_loggedin_user_id(), $this->id );
75
-
76
  // If this is a private or hidden group, does the current user have access?
77
  if ( 'private' == $this->status || 'hidden' == $this->status ) {
78
  if ( $this->is_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) )
@@ -159,7 +159,7 @@ class BP_Groups_Group {
159
  $this->id = $wpdb->insert_id;
160
 
161
  do_action_ref_array( 'groups_group_after_save', array( &$this ) );
162
-
163
  wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' );
164
 
165
  return true;
@@ -257,8 +257,8 @@ class BP_Groups_Group {
257
  if ( !bp_current_user_can( 'bp_moderate' ) )
258
  $hidden_sql = "AND status != 'hidden'";
259
 
260
- $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sql} {$order_sql} {$pag_sql}" );
261
- $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sq}" );
262
 
263
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
264
  }
@@ -305,9 +305,44 @@ class BP_Groups_Group {
305
  return array( 'requests' => $paged_requests, 'total' => $total_requests );
306
  }
307
 
308
- function get( $type = 'newest', $per_page = null, $page = null, $user_id = 0, $search_terms = false, $include = false, $populate_extras = true, $exclude = false, $show_hidden = false ) {
309
  global $wpdb, $bp;
310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  $sql = array();
312
  $total_sql = array();
313
 
@@ -415,13 +450,13 @@ class BP_Groups_Group {
415
  foreach ( (array) $paged_groups as $group ) {
416
  $group_ids[] = $group->id;
417
  }
418
-
419
  // Populate some extra information instead of querying each time in the loop
420
  if ( !empty( $populate_extras ) ) {
421
  $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
422
  $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $type );
423
  }
424
-
425
  // Grab all groupmeta
426
  bp_groups_update_meta_cache( $group_ids );
427
 
@@ -537,15 +572,17 @@ class BP_Groups_Group {
537
  $letter = like_escape( $wpdb->escape( $letter ) );
538
 
539
  if ( !empty( $limit ) && !empty( $page ) ) {
540
- $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
541
- $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" );
542
  }
543
 
544
- $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" );
545
 
546
  if ( !empty( $populate_extras ) ) {
547
- foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
548
- $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
 
 
549
  $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
550
  }
551
 
@@ -645,19 +682,7 @@ class BP_Groups_Group {
645
  if ( 'unreplied' == $type )
646
  $bp->groups->filter_sql = ' AND t.topic_posts = 1';
647
 
648
- /**
649
- * Provide backward-compatibility for the groups_total_public_forum_topic_count SQL filter.
650
- * Developers: DO NOT use this filter. It will be removed in BP 1.7. Instead, use
651
- * get_global_forum_topic_count_extra_sql. See https://buddypress.trac.wordpress.org/ticket/4306
652
- */
653
- $maybe_extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type );
654
-
655
- if ( is_int( $maybe_extra_sql ) )
656
- $extra_sql = $bp->groups->filter_sql;
657
- else
658
- $extra_sql = $maybe_extra_sql;
659
-
660
- // Developers: use this filter instead
661
  $extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type );
662
 
663
  // Make sure the $extra_sql begins with an AND
@@ -707,10 +732,8 @@ class BP_Groups_Group {
707
  $sql = array();
708
 
709
  $sql['select'] = "SELECT COUNT(t.topic_id)";
710
-
711
- $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
712
-
713
- $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
714
 
715
  if ( $search_terms ) {
716
  $st = like_escape( $search_terms );
@@ -719,6 +742,29 @@ class BP_Groups_Group {
719
 
720
  return $wpdb->get_var( implode( ' ', $sql ) );
721
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
722
  }
723
 
724
  class BP_Groups_Member {
@@ -811,7 +857,7 @@ class BP_Groups_Member {
811
  if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) {
812
  return false;
813
  }
814
-
815
  $sql = $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_members} ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d )", $this->user_id, $this->group_id, $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent );
816
  }
817
 
@@ -1109,7 +1155,7 @@ class BP_Groups_Member {
1109
  * @global wpdb $wpdb WordPress database object
1110
  * @param int $user_id
1111
  * @param int $group_id
1112
- * @since 1.2.6
1113
  */
1114
  function check_is_creator( $user_id, $group_id ) {
1115
  global $bp, $wpdb;
@@ -1134,9 +1180,9 @@ class BP_Groups_Member {
1134
 
1135
  // If the user is logged in and viewing their random groups, we can show hidden and private groups
1136
  if ( bp_is_my_profile() ) {
1137
- return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) );
1138
  } else {
1139
- return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) );
1140
  }
1141
  }
1142
 
@@ -1185,18 +1231,21 @@ class BP_Groups_Member {
1185
  $exclude_sql = " AND m.user_id NOT IN ({$exclude})";
1186
  }
1187
 
1188
- if ( bp_is_active( 'xprofile' ) )
1189
  $members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
1190
- else
1191
  $members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u WHERE u.ID = m.user_id AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
 
1192
 
1193
- if ( empty( $members ) )
1194
  return false;
 
1195
 
1196
- if ( empty( $pag_sql ) )
1197
  $total_member_count = count( $members );
1198
- else
1199
- $total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) );
 
1200
 
1201
  // Fetch whether or not the user is a friend
1202
  foreach ( (array) $members as $user )
@@ -1230,7 +1279,7 @@ class BP_Groups_Member {
1230
  * @global object $bp BuddyPress global settings
1231
  * @global wpdb $wpdb WordPress database object
1232
  * @param int $user_id
1233
- * @since 1.0
1234
  * @uses BP_Groups_Member
1235
  */
1236
  function delete_all_for_user( $user_id ) {
@@ -1262,12 +1311,12 @@ class BP_Groups_Member {
1262
  *
1263
  * @package BuddyPress
1264
  * @subpackage Groups
1265
- * @since 1.1
1266
  */
1267
  class BP_Group_Extension {
1268
  var $name = false;
1269
  var $slug = false;
1270
-
1271
  // The name/slug of the Group Admin tab for this extension
1272
  var $admin_name = '';
1273
  var $admin_slug = '';
@@ -1282,9 +1331,26 @@ class BP_Group_Extension {
1282
  var $create_step_position = 81;
1283
  var $nav_item_position = 81;
1284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1285
  var $enable_create_step = true;
1286
  var $enable_nav_item = true;
1287
  var $enable_edit_item = true;
 
1288
 
1289
  var $nav_item_name = false;
1290
 
@@ -1309,21 +1375,21 @@ class BP_Group_Extension {
1309
 
1310
  function _register() {
1311
  global $bp;
1312
-
1313
  // If admin/create names and slugs are not provided, they fall back on the main
1314
  // name and slug for the extension
1315
  if ( !$this->admin_name ) {
1316
  $this->admin_name = $this->name;
1317
  }
1318
-
1319
  if ( !$this->admin_slug ) {
1320
  $this->admin_slug = $this->slug;
1321
  }
1322
-
1323
  if ( !$this->create_name ) {
1324
  $this->create_name = $this->name;
1325
  }
1326
-
1327
  if ( !$this->create_slug ) {
1328
  $this->create_slug = $this->slug;
1329
  }
@@ -1369,7 +1435,7 @@ class BP_Group_Extension {
1369
 
1370
  add_action( 'groups_custom_edit_steps', array( &$this, 'edit_screen' ) );
1371
 
1372
- if ( '' != locate_template( array( 'groups/single/home.php' ), false ) ) {
1373
  bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
1374
  } else {
1375
  add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
@@ -1378,12 +1444,44 @@ class BP_Group_Extension {
1378
  }
1379
  }
1380
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1381
  }
1382
 
1383
  function _display_hook() {
1384
  add_action( 'bp_template_content', array( &$this, 'display' ) );
1385
  bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) );
1386
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1387
  }
1388
 
1389
  function bp_register_group_extension( $group_extension_class ) {
@@ -1393,7 +1491,9 @@ function bp_register_group_extension( $group_extension_class ) {
1393
 
1394
  // Register the group extension on the bp_init action so we have access
1395
  // to all plugins.
1396
- add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_actions", array( &$extension, "_register" ), 8 );' ), 11 );
 
 
 
 
1397
  }
1398
-
1399
- ?>
58
  function populate() {
59
  global $wpdb, $bp;
60
 
61
+ if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) {
62
  bp_groups_update_meta_cache( $this->id );
63
+
64
  $this->id = $group->id;
65
  $this->creator_id = $group->creator_id;
66
  $this->name = stripslashes($group->name);
72
  $this->last_activity = groups_get_groupmeta( $this->id, 'last_activity' );
73
  $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
74
  $this->is_member = BP_Groups_Member::check_is_member( bp_loggedin_user_id(), $this->id );
75
+
76
  // If this is a private or hidden group, does the current user have access?
77
  if ( 'private' == $this->status || 'hidden' == $this->status ) {
78
  if ( $this->is_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) )
159
  $this->id = $wpdb->insert_id;
160
 
161
  do_action_ref_array( 'groups_group_after_save', array( &$this ) );
162
+
163
  wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' );
164
 
165
  return true;
257
  if ( !bp_current_user_can( 'bp_moderate' ) )
258
  $hidden_sql = "AND status != 'hidden'";
259
 
260
+ $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '%%{$filter}%%' OR description LIKE '%%{$filter}%%' ) {$hidden_sql} {$order_sql} {$pag_sql}" );
261
+ $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%{$filter}%%' OR description LIKE '%%{$filter}%%' ) {$hidden_sql}" );
262
 
263
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
264
  }
305
  return array( 'requests' => $paged_requests, 'total' => $total_requests );
306
  }
307
 
308
+ function get( $args = array() ) {
309
  global $wpdb, $bp;
310
 
311
+ // Backward compatibility with old method of passing arguments
312
+ if ( ! is_array( $args ) || func_num_args() > 1 ) {
313
+ _deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
314
+
315
+ $old_args_keys = array(
316
+ 0 => 'type',
317
+ 1 => 'per_page',
318
+ 2 => 'page',
319
+ 3 => 'user_id',
320
+ 4 => 'search_terms',
321
+ 5 => 'include',
322
+ 6 => 'populate_extras',
323
+ 7 => 'exclude',
324
+ 8 => 'show_hidden',
325
+ );
326
+
327
+ $func_args = func_get_args();
328
+ $args = bp_core_parse_args_array( $old_args_keys, $func_args );
329
+ }
330
+
331
+ $defaults = array(
332
+ 'type' => 'newest',
333
+ 'per_page' => null,
334
+ 'page' => null,
335
+ 'user_id' => 0,
336
+ 'search_terms' => false,
337
+ 'include' => false,
338
+ 'populate_extras' => true,
339
+ 'exclude' => false,
340
+ 'show_hidden' => false
341
+ );
342
+
343
+ $r = wp_parse_args( $args, $defaults );
344
+ extract( $r );
345
+
346
  $sql = array();
347
  $total_sql = array();
348
 
450
  foreach ( (array) $paged_groups as $group ) {
451
  $group_ids[] = $group->id;
452
  }
453
+
454
  // Populate some extra information instead of querying each time in the loop
455
  if ( !empty( $populate_extras ) ) {
456
  $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
457
  $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $type );
458
  }
459
+
460
  // Grab all groupmeta
461
  bp_groups_update_meta_cache( $group_ids );
462
 
572
  $letter = like_escape( $wpdb->escape( $letter ) );
573
 
574
  if ( !empty( $limit ) && !empty( $page ) ) {
575
+ $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
576
+ $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '{$letter}%%' {$hidden_sql} {$exclude_sql}" );
577
  }
578
 
579
+ $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '{$letter}%%' {$hidden_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" );
580
 
581
  if ( !empty( $populate_extras ) ) {
582
+ foreach ( (array) $paged_groups as $group ) {
583
+ $group_ids[] = $group->id;
584
+ }
585
+ $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
586
  $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
587
  }
588
 
682
  if ( 'unreplied' == $type )
683
  $bp->groups->filter_sql = ' AND t.topic_posts = 1';
684
 
685
+ // https://buddypress.trac.wordpress.org/ticket/4306
 
 
 
 
 
 
 
 
 
 
 
 
686
  $extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type );
687
 
688
  // Make sure the $extra_sql begins with an AND
732
  $sql = array();
733
 
734
  $sql['select'] = "SELECT COUNT(t.topic_id)";
735
+ $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
736
+ $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
 
 
737
 
738
  if ( $search_terms ) {
739
  $st = like_escape( $search_terms );
742
 
743
  return $wpdb->get_var( implode( ' ', $sql ) );
744
  }
745
+
746
+ /**
747
+ * Get an array containing ids for each group type
748
+ *
749
+ * A bit of a kludge workaround for some issues
750
+ * with bp_has_groups()
751
+ *
752
+ * @since BuddyPress (1.7)
753
+ *
754
+ * @return array
755
+ */
756
+ function get_group_type_ids() {
757
+ global $wpdb, $bp;
758
+
759
+ $ids = array();
760
+
761
+ $ids['all'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name}" );
762
+ $ids['public'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'public'" );
763
+ $ids['private'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'private'" );
764
+ $ids['hidden'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'hidden'" );
765
+
766
+ return $ids;
767
+ }
768
  }
769
 
770
  class BP_Groups_Member {
857
  if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) {
858
  return false;
859
  }
860
+
861
  $sql = $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_members} ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d )", $this->user_id, $this->group_id, $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent );
862
  }
863
 
1155
  * @global wpdb $wpdb WordPress database object
1156
  * @param int $user_id
1157
  * @param int $group_id
1158
+ * @since BuddyPress (1.2.6)
1159
  */
1160
  function check_is_creator( $user_id, $group_id ) {
1161
  global $bp, $wpdb;
1180
 
1181
  // If the user is logged in and viewing their random groups, we can show hidden and private groups
1182
  if ( bp_is_my_profile() ) {
1183
+ return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) );
1184
  } else {
1185
+ return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) );
1186
  }
1187
  }
1188
 
1231
  $exclude_sql = " AND m.user_id NOT IN ({$exclude})";
1232
  }
1233
 
1234
+ if ( bp_is_active( 'xprofile' ) ) {
1235
  $members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
1236
+ } else {
1237
  $members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u WHERE u.ID = m.user_id AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
1238
+ }
1239
 
1240
+ if ( empty( $members ) ) {
1241
  return false;
1242
+ }
1243
 
1244
+ if ( empty( $pag_sql ) ) {
1245
  $total_member_count = count( $members );
1246
+ } else {
1247
+ $total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} m WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) );
1248
+ }
1249
 
1250
  // Fetch whether or not the user is a friend
1251
  foreach ( (array) $members as $user )
1279
  * @global object $bp BuddyPress global settings
1280
  * @global wpdb $wpdb WordPress database object
1281
  * @param int $user_id
1282
+ * @since BuddyPress (1.0)
1283
  * @uses BP_Groups_Member
1284
  */
1285
  function delete_all_for_user( $user_id ) {
1311
  *
1312
  * @package BuddyPress
1313
  * @subpackage Groups
1314
+ * @since BuddyPress (1.1)
1315
  */
1316
  class BP_Group_Extension {
1317
  var $name = false;
1318
  var $slug = false;
1319
+
1320
  // The name/slug of the Group Admin tab for this extension
1321
  var $admin_name = '';
1322
  var $admin_slug = '';
1331
  var $create_step_position = 81;
1332
  var $nav_item_position = 81;
1333
 
1334
+ /**
1335
+ * @var string Context for the optional admin metabox
1336
+ * @see https://codex.wordpress.org/Function_Reference/add_meta_box for
1337
+ * possible values
1338
+ * @since BuddyPress (1.7)
1339
+ */
1340
+ var $admin_metabox_context = 'normal';
1341
+
1342
+ /**
1343
+ * @var string Priority for the optional admin menabox
1344
+ * @see https://codex.wordpress.org/Function_Reference/add_meta_box for
1345
+ * possible values
1346
+ * @since BuddyPress (1.7)
1347
+ */
1348
+ var $admin_metabox_priority = 'core';
1349
+
1350
  var $enable_create_step = true;
1351
  var $enable_nav_item = true;
1352
  var $enable_edit_item = true;
1353
+ var $enable_admin_item = true;
1354
 
1355
  var $nav_item_name = false;
1356
 
1375
 
1376
  function _register() {
1377
  global $bp;
1378
+
1379
  // If admin/create names and slugs are not provided, they fall back on the main
1380
  // name and slug for the extension
1381
  if ( !$this->admin_name ) {
1382
  $this->admin_name = $this->name;
1383
  }
1384
+
1385
  if ( !$this->admin_slug ) {
1386
  $this->admin_slug = $this->slug;
1387
  }
1388
+
1389
  if ( !$this->create_name ) {
1390
  $this->create_name = $this->name;
1391
  }
1392
+
1393
  if ( !$this->create_slug ) {
1394
  $this->create_slug = $this->slug;
1395
  }
1435
 
1436
  add_action( 'groups_custom_edit_steps', array( &$this, 'edit_screen' ) );
1437
 
1438
+ if ( '' != bp_locate_template( array( 'groups/single/home.php' ), false ) ) {
1439
  bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
1440
  } else {
1441
  add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
1444
  }
1445
  }
1446
  }
1447
+
1448
+ // Construct the admin metabox
1449
+ // Plugin authors: Note that $this->enable_admin_item must be
1450
+ // set to true, and self::admin_screen() must be defined
1451
+ if ( ! empty( $this->enable_admin_item ) && is_admin() && method_exists( get_class( $this ), 'admin_screen' ) ) {
1452
+ // Hook the admin screen markup function to the content hook
1453
+ add_action( 'bp_groups_admin_meta_box_content_' . $this->slug, array( $this, 'admin_screen' ) );
1454
+
1455
+ // Initialize the metabox
1456
+ add_action( 'bp_groups_admin_meta_boxes', array( $this, '_meta_box_display_callback' ) );
1457
+
1458
+ // Catch the metabox save
1459
+ add_action( 'bp_group_admin_edit_after', array( $this, 'admin_screen_save' ), 10 );
1460
+ }
1461
  }
1462
 
1463
  function _display_hook() {
1464
  add_action( 'bp_template_content', array( &$this, 'display' ) );
1465
  bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) );
1466
  }
1467
+
1468
+ /**
1469
+ * Create the Dashboard meta box for this extension
1470
+ *
1471
+ * @since BuddyPress (1.7)
1472
+ */
1473
+ function _meta_box_display_callback() {
1474
+ $group_id = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : 0;
1475
+
1476
+ add_meta_box(
1477
+ $this->slug,
1478
+ $this->name,
1479
+ create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' . $this->slug . '", ' . $group_id . ' );' ),
1480
+ get_current_screen()->id,
1481
+ $this->admin_metabox_context,
1482
+ $this->admin_metabox_priority
1483
+ );
1484
+ }
1485
  }
1486
 
1487
  function bp_register_group_extension( $group_extension_class ) {
1491
 
1492
  // Register the group extension on the bp_init action so we have access
1493
  // to all plugins.
1494
+ add_action( 'bp_init', create_function( '', '
1495
+ $extension = new ' . $group_extension_class . ';
1496
+ add_action( "bp_actions", array( &$extension, "_register" ), 8 );
1497
+ add_action( "admin_init", array( &$extension, "_register" ) );
1498
+ ' ), 11 );
1499
  }
 
 
bp-groups/bp-groups-filters.php CHANGED
@@ -10,6 +10,11 @@
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
 
 
 
 
 
13
  /* Apply WordPress defined filters */
14
  add_filter( 'bp_get_group_description', 'wptexturize' );
15
  add_filter( 'bp_get_group_description_excerpt', 'wptexturize' );
@@ -72,7 +77,7 @@ function bp_groups_filter_kses( $content ) {
72
  /** Group forums **************************************************************/
73
 
74
  /**
75
- * Only filter the forum SQL on group pages or on the forums directory
76
  */
77
  function groups_add_forum_privacy_sql() {
78
  add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
@@ -142,7 +147,7 @@ function groups_filter_bbpress_caps( $value, $cap, $args ) {
142
 
143
  if ( bp_current_user_can( 'bp_moderate' ) )
144
  return true;
145
-
146
  if ( 'add_tag_to' == $cap )
147
  if ( $bp->groups->current_group->user_has_access ) return true;
148
 
@@ -164,5 +169,3 @@ function groups_filter_forums_root_page_sql( $sql ) {
164
  return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' );
165
  }
166
  add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
167
-
168
- ?>
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
+ // Filter bbPress template locations
14
+
15
+ add_filter( 'bp_groups_get_directory_template', 'bp_add_template_locations' );
16
+ add_filter( 'bp_get_single_group_template', 'bp_add_template_locations' );
17
+
18
  /* Apply WordPress defined filters */
19
  add_filter( 'bp_get_group_description', 'wptexturize' );
20
  add_filter( 'bp_get_group_description_excerpt', 'wptexturize' );
77
  /** Group forums **************************************************************/
78
 
79
  /**
80
+ * Only filter the forum SQL on group pages or on the forums directory
81
  */
82
  function groups_add_forum_privacy_sql() {
83
  add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
147
 
148
  if ( bp_current_user_can( 'bp_moderate' ) )
149
  return true;
150
+
151
  if ( 'add_tag_to' == $cap )
152
  if ( $bp->groups->current_group->user_has_access ) return true;
153
 
169
  return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' );
170
  }
171
  add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
 
 
bp-groups/bp-groups-forums.php CHANGED
@@ -23,7 +23,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
23
  * @param string $group_name The group name
24
  * @param string $group_description The group description
25
  *
26
- * @since 1.0
27
  */
28
  function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) {
29
  global $bp;
@@ -52,7 +52,7 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc =
52
  *
53
  * @param int $group_id Group id, passed from groups_details_updated
54
  *
55
- * @since 1.1
56
  */
57
  function groups_update_group_forum( $group_id ) {
58
 
@@ -89,7 +89,7 @@ add_action( 'groups_details_updated', 'groups_update_group_forum' );
89
  * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
90
  * @return mixed The new forum post ID on success. Boolean false on failure.
91
  *
92
- * @since 1.0
93
  */
94
  function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
95
  if ( empty( $post_text ) )
@@ -137,7 +137,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
137
  * @param int $forum_id The forum ID this forum topic resides in
138
  * @return mixed The new topic object on success. Boolean false on failure.
139
  *
140
- * @since 1.0
141
  */
142
  function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) {
143
  if ( empty( $topic_title ) || empty( $topic_text ) )
@@ -183,7 +183,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
183
  * @param mixed $topic_tags A comma-delimited string of topic tags. Defaults to boolean false.
184
  * @return mixed The topic object on success. Boolean false on failure.
185
  *
186
- * @since 1.1
187
  */
188
  function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
189
  global $bp;
@@ -203,7 +203,7 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
203
  ) );
204
  }
205
 
206
- $activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
207
  $activity_content = bp_create_excerpt( $topic_text );
208
 
209
  // Record this in activity streams
@@ -238,7 +238,7 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
238
  * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
239
  * @return mixed The forum post ID on success. Boolean false on failure.
240
  *
241
- * @since 1.1
242
  */
243
  function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
244
  global $bp;
@@ -302,7 +302,7 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
302
  * @param int $topic_id The id of the topic to be deleted
303
  * @return bool True if the delete routine went through properly
304
  *
305
- * @since 1.1
306
  */
307
  function groups_delete_group_forum_topic( $topic_id ) {
308
  global $bp;
@@ -354,7 +354,7 @@ function groups_delete_group_forum_topic( $topic_id ) {
354
  * function but is passed along to do_action() hooks.
355
  * @return bool True on success.
356
  *
357
- * @since 1.1
358
  */
359
  function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
360
  global $bp;
@@ -383,7 +383,7 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
383
  * Get a total count of all public topics of a given type, across groups/forums
384
  *
385
  * @package BuddyPress
386
- * @since 1.5
387
  *
388
  * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'. Defaults to 'newest'.
389
  * @return int The topic count
@@ -396,7 +396,7 @@ function groups_total_public_forum_topic_count( $type = 'newest' ) {
396
  * Get a total count of all topics of a given status, across groups/forums
397
  *
398
  * @package BuddyPress
399
- * @since 1.5
400
  *
401
  * @param str $status 'public', 'private', 'hidden', 'all' Which group types to count
402
  * @return int The topic count
@@ -404,5 +404,3 @@ function groups_total_public_forum_topic_count( $type = 'newest' ) {
404
  function groups_total_forum_topic_count( $status = 'public', $search_terms = false ) {
405
  return apply_filters( 'groups_total_forum_topic_count', BP_Groups_Group::get_global_topic_count( $status, $search_terms ) );
406
  }
407
-
408
- ?>
23
  * @param string $group_name The group name
24
  * @param string $group_description The group description
25
  *
26
+ * @since BuddyPress (1.0)
27
  */
28
  function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) {
29
  global $bp;
52
  *
53
  * @param int $group_id Group id, passed from groups_details_updated
54
  *
55
+ * @since BuddyPress (1.1)
56
  */
57
  function groups_update_group_forum( $group_id ) {
58
 
89
  * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
90
  * @return mixed The new forum post ID on success. Boolean false on failure.
91
  *
92
+ * @since BuddyPress (1.0)
93
  */
94
  function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
95
  if ( empty( $post_text ) )
137
  * @param int $forum_id The forum ID this forum topic resides in
138
  * @return mixed The new topic object on success. Boolean false on failure.
139
  *
140
+ * @since BuddyPress (1.0)
141
  */
142
  function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) {
143
  if ( empty( $topic_title ) || empty( $topic_text ) )
183
  * @param mixed $topic_tags A comma-delimited string of topic tags. Defaults to boolean false.
184
  * @return mixed The topic object on success. Boolean false on failure.
185
  *
186
+ * @since BuddyPress (1.1)
187
  */
188
  function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
189
  global $bp;
203
  ) );
204
  }
205
 
206
+ $activity_action = sprintf( __( '%1$s edited the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
207
  $activity_content = bp_create_excerpt( $topic_text );
208
 
209
  // Record this in activity streams
238
  * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
239
  * @return mixed The forum post ID on success. Boolean false on failure.
240
  *
241
+ * @since BuddyPress (1.1)
242
  */
243
  function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
244
  global $bp;
302
  * @param int $topic_id The id of the topic to be deleted
303
  * @return bool True if the delete routine went through properly
304
  *
305
+ * @since BuddyPress (1.1)
306
  */
307
  function groups_delete_group_forum_topic( $topic_id ) {
308
  global $bp;
354
  * function but is passed along to do_action() hooks.
355
  * @return bool True on success.
356
  *
357
+ * @since BuddyPress (1.1)
358
  */
359
  function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
360
  global $bp;
383
  * Get a total count of all public topics of a given type, across groups/forums
384
  *
385
  * @package BuddyPress
386
+ * @since BuddyPress (1.5)
387
  *
388
  * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'. Defaults to 'newest'.
389
  * @return int The topic count
396
  * Get a total count of all topics of a given status, across groups/forums
397
  *
398
  * @package BuddyPress
399
+ * @since BuddyPress (1.5)
400
  *
401
  * @param str $status 'public', 'private', 'hidden', 'all' Which group types to count
402
  * @return int The topic count
404
  function groups_total_forum_topic_count( $status = 'public', $search_terms = false ) {
405
  return apply_filters( 'groups_total_forum_topic_count', BP_Groups_Group::get_global_topic_count( $status, $search_terms ) );
406
  }
 
 
bp-groups/bp-groups-functions.php CHANGED
@@ -195,7 +195,7 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_
195
  *
196
  * @global object $bp BuddyPress global settings
197
  * @param int $group_id
198
- * @since 1.0
199
  */
200
  function groups_delete_group( $group_id ) {
201
  global $bp;
@@ -204,13 +204,13 @@ function groups_delete_group( $group_id ) {
204
  if ( ! bp_is_item_admin() )
205
  return false;
206
 
 
 
207
  // Get the group object
208
  $group = groups_get_group( array( 'group_id' => $group_id ) );
209
  if ( !$group->delete() )
210
  return false;
211
 
212
- do_action( 'groups_before_delete_group', $group_id );
213
-
214
  // Delete all group activity from activity streams
215
  if ( bp_is_active( 'activity' ) )
216
  bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) );
@@ -265,7 +265,7 @@ function groups_get_slug( $group_id ) {
265
  /**
266
  * Get a group ID by its slug
267
  *
268
- * @since 1.6
269
  *
270
  * @param string $group_slug The group's slug
271
  * @return int The ID
@@ -379,8 +379,21 @@ function groups_get_group_mods( $group_id ) {
379
  return BP_Groups_Member::get_group_moderator_ids( $group_id );
380
  }
381
 
382
- function groups_get_group_members( $group_id, $limit = false, $page = false ) {
383
- return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page );
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  }
385
 
386
  function groups_get_total_member_count( $group_id ) {
@@ -389,6 +402,14 @@ function groups_get_total_member_count( $group_id ) {
389
 
390
  /*** Group Fetching, Filtering & Searching *************************************/
391
 
 
 
 
 
 
 
 
 
392
  function groups_get_groups( $args = '' ) {
393
 
394
  $defaults = array(
@@ -403,12 +424,21 @@ function groups_get_groups( $args = '' ) {
403
  'populate_extras' => true, // Fetch meta such as is_banned and is_member
404
  );
405
 
406
- $params = wp_parse_args( $args, $defaults );
407
- extract( $params, EXTR_SKIP );
408
 
409
- $groups = BP_Groups_Group::get( $type, $per_page, $page, $user_id, $search_terms, $include, $populate_extras, $exclude, $show_hidden );
 
 
 
 
 
 
 
 
 
 
410
 
411
- return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$params ) );
412
  }
413
 
414
  function groups_get_total_group_count() {
@@ -501,7 +531,7 @@ function groups_is_user_banned( $user_id, $group_id ) {
501
  *
502
  * @param int $user_id
503
  * @param int $group_id
504
- * @since 1.2.6
505
  * @uses BP_Groups_Member
506
  */
507
  function groups_is_user_creator( $user_id, $group_id ) {
@@ -917,11 +947,11 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa
917
  $meta_value = trim( $meta_value );
918
 
919
  if ( !$meta_key )
920
- $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id ) );
921
  else if ( $meta_value )
922
- $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) );
923
  else
924
- $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
925
 
926
  // Delete the cached object
927
  wp_cache_delete( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
@@ -942,11 +972,11 @@ function groups_get_groupmeta( $group_id, $meta_key = '') {
942
 
943
  $metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
944
  if ( false === $metas ) {
945
- $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key) );
946
  wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $metas, 'bp' );
947
  }
948
  } else {
949
- $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id) );
950
  }
951
 
952
  if ( empty( $metas ) ) {
@@ -977,12 +1007,12 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) {
977
 
978
  $meta_value = maybe_serialize( $meta_value );
979
 
980
- $cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
981
 
982
  if ( !$cur )
983
- $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_groupmeta} ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) );
984
  else if ( $cur->meta_value != $meta_value )
985
- $wpdb->query( $wpdb->prepare( "UPDATE {$bp->groups->table_name_groupmeta} SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) );
986
  else
987
  return false;
988
 
@@ -1006,5 +1036,3 @@ function groups_remove_data_for_user( $user_id ) {
1006
  add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' );
1007
  add_action( 'delete_user', 'groups_remove_data_for_user' );
1008
  add_action( 'bp_make_spam_user', 'groups_remove_data_for_user' );
1009
-
1010
- ?>
195
  *
196
  * @global object $bp BuddyPress global settings
197
  * @param int $group_id
198
+ * @since BuddyPress (1.0)
199
  */
200
  function groups_delete_group( $group_id ) {
201
  global $bp;
204
  if ( ! bp_is_item_admin() )
205
  return false;
206
 
207
+ do_action( 'groups_before_delete_group', $group_id );
208
+
209
  // Get the group object
210
  $group = groups_get_group( array( 'group_id' => $group_id ) );
211
  if ( !$group->delete() )
212
  return false;
213
 
 
 
214
  // Delete all group activity from activity streams
215
  if ( bp_is_active( 'activity' ) )
216
  bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) );
265
  /**
266
  * Get a group ID by its slug
267
  *
268
+ * @since BuddyPress (1.6)
269
  *
270
  * @param string $group_slug The group's slug
271
  * @return int The ID
379
  return BP_Groups_Member::get_group_moderator_ids( $group_id );
380
  }
381
 
382
+ /**
383
+ * Fetch the members of a group
384
+ *
385
+ * Procedural wrapper for BP_Groups_Member::get_all_for_group().
386
+ *
387
+ * @param int $group_id
388
+ * @param int $limit Maximum members to return
389
+ * @param int $page The page of results to return (requires $limit)
390
+ * @param bool $exclude_admins_mods Whether to exclude admins and mods
391
+ * @param bool $exclude_banned Whether to exclude banned users
392
+ * @param array|string $exclude Array or comma-sep list of users to exclude
393
+ * @return array Multi-d array of 'members' list and 'count'
394
+ */
395
+ function groups_get_group_members( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
396
+ return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page, $exclude_admins_mods, $exclude_banned, $exclude );
397
  }
398
 
399
  function groups_get_total_member_count( $group_id ) {
402
 
403
  /*** Group Fetching, Filtering & Searching *************************************/
404
 
405
+ /**
406
+ * Get a collection of groups, based on the parameters passed
407
+ *
408
+ * @uses apply_filters_ref_array() Filter 'groups_get_groups' to modify return value
409
+ * @uses BP_Groups_Group::get()
410
+ * @param array $args See inline documentation for details
411
+ * @return array
412
+ */
413
  function groups_get_groups( $args = '' ) {
414
 
415
  $defaults = array(
424
  'populate_extras' => true, // Fetch meta such as is_banned and is_member
425
  );
426
 
427
+ $r = wp_parse_args( $args, $defaults );
 
428
 
429
+ $groups = BP_Groups_Group::get( array(
430
+ 'type' => $r['type'],
431
+ 'user_id' => $r['user_id'],
432
+ 'include' => $r['include'],
433
+ 'exclude' => $r['exclude'],
434
+ 'search_terms' => $r['search_terms'],
435
+ 'show_hidden' => $r['show_hidden'],
436
+ 'per_page' => $r['per_page'],
437
+ 'page' => $r['page'],
438
+ 'populate_extras' => $r['populate_extras']
439
+ ) );
440
 
441
+ return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$r ) );
442
  }
443
 
444
  function groups_get_total_group_count() {
531
  *
532
  * @param int $user_id
533
  * @param int $group_id
534
+ * @since BuddyPress (1.2.6)
535
  * @uses BP_Groups_Member
536
  */
537
  function groups_is_user_creator( $user_id, $group_id ) {
947
  $meta_value = trim( $meta_value );
948
 
949
  if ( !$meta_key )
950
+ $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id ) );
951
  else if ( $meta_value )
952
+ $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) );
953
  else
954
+ $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
955
 
956
  // Delete the cached object
957
  wp_cache_delete( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
972
 
973
  $metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
974
  if ( false === $metas ) {
975
+ $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
976
  wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $metas, 'bp' );
977
  }
978
  } else {
979
+ $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id ) );
980
  }
981
 
982
  if ( empty( $metas ) ) {
1007
 
1008
  $meta_value = maybe_serialize( $meta_value );
1009
 
1010
+ $cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
1011
 
1012
  if ( !$cur )
1013
+ $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp->groups->table_name_groupmeta . " ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) );
1014
  else if ( $cur->meta_value != $meta_value )
1015
+ $wpdb->query( $wpdb->prepare( "UPDATE " . $bp->groups->table_name_groupmeta . " SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) );
1016
  else
1017
  return false;
1018
 
1036
  add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' );
1037
  add_action( 'delete_user', 'groups_remove_data_for_user' );
1038
  add_action( 'bp_make_spam_user', 'groups_remove_data_for_user' );
 
 
bp-groups/bp-groups-loader.php CHANGED
@@ -104,6 +104,10 @@ class BP_Groups_Component extends BP_Component {
104
  'functions',
105
  'notifications'
106
  );
 
 
 
 
107
  parent::includes( $includes );
108
  }
109
 
@@ -130,7 +134,7 @@ class BP_Groups_Component extends BP_Component {
130
  'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta'
131
  );
132
 
133
- // All globals for messaging component.
134
  // Note that global_tables is included in this array.
135
  $globals = array(
136
  'slug' => BP_GROUPS_SLUG,
@@ -267,7 +271,7 @@ class BP_Groups_Component extends BP_Component {
267
  if ( is_user_logged_in() ) {
268
  bp_core_no_access( array(
269
  'message' => __( 'You do not have access to this group.', 'buddypress' ),
270
- 'root' => bp_get_group_permalink( $bp->groups->current_group ),
271
  'redirect' => false
272
  ) );
273
 
@@ -339,7 +343,7 @@ class BP_Groups_Component extends BP_Component {
339
 
340
  // Add 'Groups' to the main navigation
341
  $main_nav = array(
342
- 'name' => sprintf( __( 'Groups <span>%d</span>', 'buddypress' ), groups_total_groups_for_user() ),
343
  'slug' => $this->slug,
344
  'position' => 70,
345
  'screen_function' => 'groups_screen_my_groups',
@@ -347,31 +351,42 @@ class BP_Groups_Component extends BP_Component {
347
  'item_css_id' => $this->id
348
  );
349
 
350
- $groups_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
351
-
352
- // Add the My Groups nav item
353
- $sub_nav[] = array(
354
- 'name' => __( 'Memberships', 'buddypress' ),
355
- 'slug' => 'my-groups',
356
- 'parent_url' => $groups_link,
357
- 'parent_slug' => $this->slug,
358
- 'screen_function' => 'groups_screen_my_groups',
359
- 'position' => 10,
360
- 'item_css_id' => 'groups-my-groups'
361
- );
362
 
363
- // Add the Group Invites nav item
364
- $sub_nav[] = array(
365
- 'name' => __( 'Invitations', 'buddypress' ),
366
- 'slug' => 'invites',
367
- 'parent_url' => $groups_link,
368
- 'parent_slug' => $this->slug,
369
- 'screen_function' => 'groups_screen_group_invites',
370
- 'user_has_access' => bp_is_my_profile(),
371
- 'position' => 30
372
- );
 
 
 
373
 
374
- parent::setup_nav( $main_nav, $sub_nav );
 
 
 
 
 
 
 
 
 
 
 
 
375
 
376
  if ( bp_is_groups_component() && bp_is_single_item() ) {
377
 
@@ -456,8 +471,8 @@ class BP_Groups_Component extends BP_Component {
456
  );
457
  }
458
 
459
- // If the user is a group mod or more, then show the group admin nav item
460
- if ( bp_is_item_admin() || bp_is_item_mod() ) {
461
  $sub_nav[] = array(
462
  'name' => __( 'Admin', 'buddypress' ),
463
  'slug' => 'admin',
@@ -586,5 +601,3 @@ function bp_setup_groups() {
586
  $bp->groups = new BP_Groups_Component();
587
  }
588
  add_action( 'bp_setup_components', 'bp_setup_groups', 6 );
589
-
590
- ?>
104
  'functions',
105
  'notifications'
106
  );
107
+
108
+ if ( is_admin() )
109
+ $includes[] = 'admin';
110
+
111
  parent::includes( $includes );
112
  }
113
 
134
  'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta'
135
  );
136
 
137
+ // All globals for groups component.
138
  // Note that global_tables is included in this array.
139
  $globals = array(
140
  'slug' => BP_GROUPS_SLUG,
271
  if ( is_user_logged_in() ) {
272
  bp_core_no_access( array(
273
  'message' => __( 'You do not have access to this group.', 'buddypress' ),
274
+ 'root' => bp_get_group_permalink( $bp->groups->current_group ) . 'home/',
275
  'redirect' => false
276
  ) );
277
 
343
 
344
  // Add 'Groups' to the main navigation
345
  $main_nav = array(
346
+ 'name' => sprintf( __( 'Groups <span>%d</span>', 'buddypress' ), bp_get_total_group_count_for_user() ),
347
  'slug' => $this->slug,
348
  'position' => 70,
349
  'screen_function' => 'groups_screen_my_groups',
351
  'item_css_id' => $this->id
352
  );
353
 
354
+ // Determine user to use
355
+ if ( bp_displayed_user_domain() ) {
356
+ $user_domain = bp_displayed_user_domain();
357
+ } elseif ( bp_loggedin_user_domain() ) {
358
+ $user_domain = bp_loggedin_user_domain();
359
+ } else {
360
+ $user_domain = false;
361
+ }
 
 
 
 
362
 
363
+ if ( !empty( $user_domain ) ) {
364
+ $groups_link = trailingslashit( $user_domain . $this->slug );
365
+
366
+ // Add the My Groups nav item
367
+ $sub_nav[] = array(
368
+ 'name' => __( 'Memberships', 'buddypress' ),
369
+ 'slug' => 'my-groups',
370
+ 'parent_url' => $groups_link,
371
+ 'parent_slug' => $this->slug,
372
+ 'screen_function' => 'groups_screen_my_groups',
373
+ 'position' => 10,
374
+ 'item_css_id' => 'groups-my-groups'
375
+ );
376
 
377
+ // Add the Group Invites nav item
378
+ $sub_nav[] = array(
379
+ 'name' => __( 'Invitations', 'buddypress' ),
380
+ 'slug' => 'invites',
381
+ 'parent_url' => $groups_link,
382
+ 'parent_slug' => $this->slug,
383
+ 'screen_function' => 'groups_screen_group_invites',
384
+ 'user_has_access' => bp_core_can_edit_settings(),
385
+ 'position' => 30
386
+ );
387
+
388
+ parent::setup_nav( $main_nav, $sub_nav );
389
+ }
390
 
391
  if ( bp_is_groups_component() && bp_is_single_item() ) {
392
 
471
  );
472
  }
473
 
474
+ // If the user is a group admin, then show the group admin nav item
475
+ if ( bp_is_item_admin() ) {
476
  $sub_nav[] = array(
477
  'name' => __( 'Admin', 'buddypress' ),
478
  'slug' => 'admin',
601
  $bp->groups = new BP_Groups_Component();
602
  }
603
  add_action( 'bp_setup_components', 'bp_setup_groups', 6 );
 
 
bp-groups/bp-groups-notifications.php CHANGED
@@ -16,10 +16,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
16
  function groups_notification_group_updated( $group_id ) {
17
 
18
  $group = groups_get_group( array( 'group_id' => $group_id ) );
19
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
20
- $subject = '[' . $sitename . '] ' . __( 'Group Details Updated', 'buddypress' );
21
-
22
  $user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
 
23
  foreach ( (array) $user_ids as $user_id ) {
24
  if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
25
 
@@ -73,8 +72,7 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin
73
 
74
  // Set up and send the message
75
  $to = $ud->user_email;
76
- $sitename = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES );
77
- $subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name );
78
 
79
  $message = sprintf( __(
80
  '%1$s wants to join the group "%2$s".
@@ -122,10 +120,9 @@ function groups_notification_membership_request_completed( $requesting_user_id,
122
 
123
  // Set up and send the message
124
  $to = $ud->user_email;
125
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
126
 
127
  if ( $accepted ) {
128
- $subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name );
129
  $message = sprintf( __(
130
  'Your membership request for the group "%1$s" has been accepted.
131
 
@@ -135,7 +132,7 @@ To view the group please login and visit: %2$s
135
  ', 'buddypress' ), $group->name, $group_link );
136
 
137
  } else {
138
- $subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name );
139
  $message = sprintf( __(
140
  'Your membership request for the group "%1$s" has been rejected.
141
 
@@ -181,10 +178,8 @@ function groups_notification_promoted_member( $user_id, $group_id ) {
181
 
182
  // Set up and send the message
183
  $to = $ud->user_email;
184
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
185
- $subject = '[' . $sitename . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name );
186
-
187
- $message = sprintf( __(
188
  'You have been promoted to %1$s for the group: "%2$s".
189
 
190
  To view the group please visit: %3$s
@@ -231,8 +226,7 @@ function groups_notification_group_invites( &$group, &$member, $inviter_user_id
231
 
232
  // Set up and send the message
233
  $to = $invited_ud->user_email;
234
- $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
235
- $subject = '[' . $sitename . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name );
236
 
237
  $message = sprintf( __(
238
  'One of your friends %1$s has invited you to the group: "%2$s".
@@ -258,5 +252,3 @@ To view %5$s\'s profile visit: %6$s
258
  do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
259
  }
260
  }
261
-
262
- ?>
16
  function groups_notification_group_updated( $group_id ) {
17
 
18
  $group = groups_get_group( array( 'group_id' => $group_id ) );
19
+ $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) );
 
 
20
  $user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
21
+
22
  foreach ( (array) $user_ids as $user_id ) {
23
  if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
24
 
72
 
73
  // Set up and send the message
74
  $to = $ud->user_email;
75
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name ) ) );
 
76
 
77
  $message = sprintf( __(
78
  '%1$s wants to join the group "%2$s".
120
 
121
  // Set up and send the message
122
  $to = $ud->user_email;
 
123
 
124
  if ( $accepted ) {
125
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ) ) );
126
  $message = sprintf( __(
127
  'Your membership request for the group "%1$s" has been accepted.
128
 
132
  ', 'buddypress' ), $group->name, $group_link );
133
 
134
  } else {
135
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name ) ) );
136
  $message = sprintf( __(
137
  'Your membership request for the group "%1$s" has been rejected.
138
 
178
 
179
  // Set up and send the message
180
  $to = $ud->user_email;
181
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ) ) );
182
+ $message = sprintf( __(
 
 
183
  'You have been promoted to %1$s for the group: "%2$s".
184
 
185
  To view the group please visit: %3$s
226
 
227
  // Set up and send the message
228
  $to = $invited_ud->user_email;
229
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ) ) );
 
230
 
231
  $message = sprintf( __(
232
  'One of your friends %1$s has invited you to the group: "%2$s".
252
  do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
253
  }
254
  }
 
 
bp-groups/bp-groups-screens.php CHANGED
@@ -26,7 +26,8 @@ function groups_directory_groups_setup() {
26
  add_action( 'bp_screens', 'groups_directory_groups_setup', 2 );
27
 
28
  function groups_screen_my_groups() {
29
- global $bp;
 
30
 
31
  // Delete group request notifications for the user
32
  if ( isset( $_GET['n'] ) ) {
@@ -71,10 +72,11 @@ function groups_screen_group_invites() {
71
  if ( !check_admin_referer( 'groups_reject_invite' ) )
72
  return false;
73
 
74
- if ( !groups_reject_invite( bp_loggedin_user_id(), $group_id ) )
75
- bp_core_add_message( __('Group invite could not be rejected', 'buddypress'), 'error' );
76
- else
77
- bp_core_add_message( __('Group invite rejected', 'buddypress') );
 
78
 
79
  bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
80
  }
@@ -88,20 +90,22 @@ function groups_screen_group_invites() {
88
  }
89
 
90
  function groups_screen_group_home() {
91
- global $bp;
92
 
93
- if ( bp_is_single_item() ) {
94
- if ( isset( $_GET['n'] ) ) {
95
- bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
96
- bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
97
- bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' );
98
- bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' );
99
- }
100
 
101
- do_action( 'groups_screen_group_home' );
102
 
103
- bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
 
 
 
 
104
  }
 
 
 
 
105
  }
106
 
107
  /**
@@ -110,7 +114,6 @@ function groups_screen_group_home() {
110
  * @package BuddyPress
111
  */
112
  function groups_screen_group_forum() {
113
- global $bp;
114
 
115
  if ( !bp_is_active( 'forums' ) || !bp_forums_is_installed_correctly() )
116
  return false;
@@ -120,313 +123,336 @@ function groups_screen_group_forum() {
120
  return;
121
  }
122
 
 
 
123
  if ( !$bp->groups->current_group->user_has_access ) {
124
  bp_core_no_access();
125
  return;
126
  }
127
 
128
- if ( bp_is_single_item() ) {
 
129
 
130
- // Fetch the details we need
131
- $topic_slug = (string)bp_action_variable( 1 );
132
- $topic_id = bp_forums_get_topic_id_from_slug( $topic_slug );
133
- $forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
134
- $user_is_banned = false;
135
 
136
- if ( !bp_current_user_can( 'bp_moderate' ) && groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
137
- $user_is_banned = true;
138
 
139
- if ( !empty( $topic_slug ) && !empty( $topic_id ) ) {
140
 
141
- // Posting a reply
142
- if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) {
143
- // Check the nonce
144
- check_admin_referer( 'bp_forums_new_reply' );
145
 
146
- // Auto join this user if they are not yet a member of this group
147
- if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
148
- groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
 
149
 
150
- $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
151
-
152
- // Don't allow reply flooding
153
- if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) {
154
- bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' );
155
- } else {
156
- if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) )
157
- bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' );
158
- else
159
- bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') );
160
  }
 
161
 
162
- $query_vars = isset( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '';
163
-
164
- $redirect = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars;
165
 
166
- if ( !empty( $post_id ) ) {
167
- $redirect .= '#post-' . $post_id;
168
- }
169
 
170
- bp_core_redirect( $redirect );
 
171
  }
172
 
173
- // Sticky a topic
174
- else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
175
- // Check the nonce
176
- check_admin_referer( 'bp_forums_stick_topic' );
177
 
178
- if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id ) ) )
179
- bp_core_add_message( __( 'There was an error when making that topic a sticky', 'buddypress' ), 'error' );
180
- else
181
- bp_core_add_message( __( 'The topic was made sticky successfully', 'buddypress' ) );
182
 
183
- do_action( 'groups_stick_forum_topic', $topic_id );
184
- bp_core_redirect( wp_get_referer() );
 
 
185
  }
186
 
187
- // Un-Sticky a topic
188
- else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
189
- // Check the nonce
190
- check_admin_referer( 'bp_forums_unstick_topic' );
191
 
192
- if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id, 'mode' => 'unstick' ) ) )
193
- bp_core_add_message( __( 'There was an error when unsticking that topic', 'buddypress'), 'error' );
194
- else
195
- bp_core_add_message( __( 'The topic was unstuck successfully', 'buddypress') );
196
 
197
- do_action( 'groups_unstick_forum_topic', $topic_id );
198
- bp_core_redirect( wp_get_referer() );
 
 
199
  }
200
 
201
- // Close a topic
202
- else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
203
- // Check the nonce
204
- check_admin_referer( 'bp_forums_close_topic' );
205
 
206
- if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id ) ) )
207
- bp_core_add_message( __( 'There was an error when closing that topic', 'buddypress'), 'error' );
208
- else
209
- bp_core_add_message( __( 'The topic was closed successfully', 'buddypress') );
210
 
211
- do_action( 'groups_close_forum_topic', $topic_id );
212
- bp_core_redirect( wp_get_referer() );
 
 
213
  }
214
 
215
- // Open a topic
216
- else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
217
- // Check the nonce
218
- check_admin_referer( 'bp_forums_open_topic' );
219
 
220
- if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id, 'mode' => 'open' ) ) )
221
- bp_core_add_message( __( 'There was an error when opening that topic', 'buddypress'), 'error' );
222
- else
223
- bp_core_add_message( __( 'The topic was opened successfully', 'buddypress') );
224
 
225
- do_action( 'groups_open_forum_topic', $topic_id );
226
- bp_core_redirect( wp_get_referer() );
 
 
227
  }
228
 
229
- // Delete a topic
230
- else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
231
- // Fetch the topic
232
- $topic = bp_forums_get_topic_details( $topic_id );
233
 
234
- /* Check the logged in user can delete this topic */
235
- if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) )
236
- bp_core_redirect( wp_get_referer() );
 
237
 
238
- // Check the nonce
239
- check_admin_referer( 'bp_forums_delete_topic' );
 
 
240
 
241
- do_action( 'groups_before_delete_forum_topic', $topic_id );
 
242
 
243
- if ( !groups_delete_group_forum_topic( $topic_id ) )
244
- bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress' ), 'error' );
245
- else
246
- bp_core_add_message( __( 'The topic was deleted successfully', 'buddypress' ) );
247
 
248
- do_action( 'groups_delete_forum_topic', $topic_id );
249
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' );
 
 
250
  }
251
 
252
- // Editing a topic
253
- else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
254
- // Fetch the topic
255
- $topic = bp_forums_get_topic_details( $topic_id );
256
 
257
- // Check the logged in user can edit this topic
258
- if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) )
259
- bp_core_redirect( wp_get_referer() );
 
260
 
261
- if ( isset( $_POST['save_changes'] ) ) {
262
- // Check the nonce
263
- check_admin_referer( 'bp_forums_edit_topic' );
 
264
 
265
- $topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false;
 
 
266
 
267
- if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'], $topic_tags ) )
268
- bp_core_add_message( __( 'There was an error when editing that topic', 'buddypress'), 'error' );
269
- else
270
- bp_core_add_message( __( 'The topic was edited successfully', 'buddypress') );
271
 
272
- do_action( 'groups_edit_forum_topic', $topic_id );
273
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' );
 
 
274
  }
275
 
276
- bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
277
  }
278
 
279
- // Delete a post
280
- else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
281
- // Fetch the post
282
- $post = bp_forums_get_post( $post_id );
283
 
284
- // Check the logged in user can edit this topic
285
- if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) )
286
- bp_core_redirect( wp_get_referer() );
 
287
 
288
- // Check the nonce
289
- check_admin_referer( 'bp_forums_delete_post' );
 
 
290
 
291
- do_action( 'groups_before_delete_forum_post', $post_id );
 
292
 
293
- if ( !groups_delete_group_forum_post( $post_id ) )
294
- bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' );
295
- else
296
- bp_core_add_message( __( 'The post was deleted successfully', 'buddypress') );
297
 
298
- do_action( 'groups_delete_forum_post', $post_id );
299
- bp_core_redirect( wp_get_referer() );
 
 
300
  }
301
 
302
- // Editing a post
303
- else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
304
- // Fetch the post
305
- $post = bp_forums_get_post( $post_id );
306
 
307
- // Check the logged in user can edit this topic
308
- if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) )
309
- bp_core_redirect( wp_get_referer() );
310
 
311
- if ( isset( $_POST['save_changes'] ) ) {
312
- // Check the nonce
313
- check_admin_referer( 'bp_forums_edit_post' );
 
 
 
 
314
 
315
- $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
 
 
316
 
317
- if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $topic_page ) )
318
- bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' );
319
- else
320
- bp_core_add_message( __( 'The post was edited successfully', 'buddypress') );
321
 
322
- if ( $_SERVER['QUERY_STRING'] )
323
- $query_vars = '?' . $_SERVER['QUERY_STRING'];
 
 
 
324
 
325
- do_action( 'groups_edit_forum_post', $post_id );
326
- bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
327
  }
328
 
329
- bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
330
  }
331
 
332
- // Standard topic display
333
- else {
334
- if ( !empty( $user_is_banned ) )
335
- bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) );
336
 
337
- bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) );
 
 
 
338
  }
339
 
340
- // Forum topic does not exist
341
- } elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) {
342
- bp_do_404();
343
- return;
344
 
345
- } else {
346
- // Posting a topic
347
- if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) {
348
- // Check the nonce
349
- check_admin_referer( 'bp_forums_new_topic' );
350
 
351
- if ( $user_is_banned ) {
352
- $error_message = __( "You have been banned from this group.", 'buddypress' );
 
353
 
354
- } elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
355
- // Auto join this user if they are not yet a member of this group
356
- groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
357
- }
 
 
 
 
 
 
358
 
359
- if ( empty( $_POST['topic_title'] ) )
360
- $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
361
- else if ( empty( $_POST['topic_text'] ) )
362
- $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
 
363
 
364
- if ( empty( $forum_id ) )
365
- $error_message = __( 'This group does not have a forum setup yet.', 'buddypress' );
 
366
 
367
- if ( isset( $error_message ) ) {
368
- bp_core_add_message( $error_message, 'error' );
 
 
 
 
369
  $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
370
  } else {
371
- if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) {
372
- bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' );
373
- $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
374
- } else {
375
- bp_core_add_message( __( 'The topic was created successfully', 'buddypress') );
376
- $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
377
- }
378
  }
379
-
380
- bp_core_redirect( $redirect );
381
  }
382
 
383
- do_action( 'groups_screen_group_forum', $topic_id, $forum_id );
384
-
385
- bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) );
386
  }
 
 
 
 
387
  }
388
  }
389
 
390
  function groups_screen_group_members() {
391
- global $bp;
392
 
393
- if ( $bp->is_single_item ) {
394
- // Refresh the group member count meta
395
- groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) );
396
 
397
- do_action( 'groups_screen_group_members', $bp->groups->current_group->id );
398
- bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) );
399
- }
 
 
 
 
400
  }
401
 
402
  function groups_screen_group_invite() {
403
- global $bp;
404
 
405
- if ( $bp->is_single_item ) {
406
- if ( bp_is_action_variable( 'send', 0 ) ) {
407
 
408
- if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) )
409
- return false;
410
 
411
- if ( !empty( $_POST['friends'] ) ) {
412
- foreach( (array) $_POST['friends'] as $friend ) {
413
- groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) );
414
- }
 
 
 
 
415
  }
 
416
 
417
- // Send the invites.
418
- groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id );
419
- bp_core_add_message( __('Group invites sent.', 'buddypress') );
420
- do_action( 'groups_screen_group_invite', $bp->groups->current_group->id );
421
- bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
422
 
423
- } elseif ( !bp_action_variable( 0 ) ) {
424
- // Show send invite page
425
- bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) );
426
 
427
- } else {
428
- bp_do_404();
429
- }
430
  }
431
  }
432
 
@@ -436,34 +462,37 @@ function groups_screen_group_request_membership() {
436
  if ( !is_user_logged_in() )
437
  return false;
438
 
439
- if ( 'private' == $bp->groups->current_group->status ) {
440
- // If the user has submitted a request, send it.
441
- if ( isset( $_POST['group-request-send']) ) {
442
- // Check the nonce
443
- if ( !check_admin_referer( 'groups_request_membership' ) )
444
- return false;
445
 
446
- if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
447
- bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' );
448
- } else {
449
- bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
450
- }
451
- bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
452
- }
453
 
454
- do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );
 
 
455
 
456
- bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );
 
 
 
 
 
457
  }
 
 
 
 
458
  }
459
 
460
  function groups_screen_group_activity_permalink() {
461
- global $bp;
462
 
463
  if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) )
464
  return false;
465
 
466
- $bp->is_single_item = true;
467
 
468
  bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
469
  }
@@ -480,138 +509,153 @@ function groups_screen_group_admin() {
480
  }
481
 
482
  function groups_screen_group_admin_edit_details() {
483
- global $bp;
484
 
485
- if ( 'edit-details' == bp_get_group_current_admin_tab() ) {
486
-
487
- if ( bp_is_item_admin() || bp_is_item_mod() ) {
488
 
489
- // If the edit form has been submitted, save the edited details
490
- if ( isset( $_POST['save'] ) ) {
491
- // Check the nonce
492
- if ( !check_admin_referer( 'groups_edit_group_details' ) )
493
- return false;
494
 
495
- if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int) $_POST['group-notify-members'] ) ) {
496
- bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
497
- } else {
498
- bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
499
- }
500
 
501
- do_action( 'groups_group_details_edited', $bp->groups->current_group->id );
 
 
 
 
502
 
503
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' );
 
 
 
504
  }
505
 
506
- do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id );
507
 
508
- bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) );
509
  }
 
 
 
 
510
  }
511
  }
512
  add_action( 'bp_screens', 'groups_screen_group_admin_edit_details' );
513
 
514
  function groups_screen_group_admin_settings() {
515
- global $bp;
516
 
517
- if ( 'group-settings' == bp_get_group_current_admin_tab() ) {
 
518
 
519
- if ( ! bp_is_item_admin() )
520
- return false;
521
 
522
- // If the edit form has been submitted, save the edited details
523
- if ( isset( $_POST['save'] ) ) {
524
- $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
525
 
526
- // Checked against a whitelist for security
527
- $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
528
- $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
529
 
530
- // Checked against a whitelist for security
531
- $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
532
- $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
533
 
534
- // Check the nonce
535
- if ( !check_admin_referer( 'groups_edit_group_settings' ) )
536
- return false;
537
 
538
- if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
539
- bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' );
540
- } else {
541
- bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
542
- }
543
-
544
- do_action( 'groups_group_settings_edited', $bp->groups->current_group->id );
545
 
546
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' );
 
 
 
547
  }
548
 
549
- do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id );
550
 
551
- bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) );
552
  }
 
 
 
 
553
  }
554
  add_action( 'bp_screens', 'groups_screen_group_admin_settings' );
555
 
556
  function groups_screen_group_admin_avatar() {
557
- global $bp;
558
 
559
- if ( 'group-avatar' == bp_get_group_current_admin_tab() ) {
 
560
 
561
- // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
562
- if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
563
- return false;
564
 
565
- // If the group admin has deleted the admin avatar
566
- if ( bp_is_action_variable( 'delete', 1 ) ) {
567
 
568
- // Check the nonce
569
- check_admin_referer( 'bp_group_avatar_delete' );
570
 
571
- if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) )
572
- bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) );
573
- else
574
- bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' );
575
 
 
 
 
 
576
  }
 
577
 
578
- if ( ! isset( $bp->avatar_admin ) )
579
- $bp->avatar_admin = new stdClass();
580
-
581
- $bp->avatar_admin->step = 'upload-image';
582
 
583
- if ( !empty( $_FILES ) ) {
584
 
585
- // Check the nonce
586
- check_admin_referer( 'bp_avatar_upload' );
587
 
588
- // Pass the file to the avatar upload handler
589
- if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) {
590
- $bp->avatar_admin->step = 'crop-image';
591
 
592
- // Make sure we include the jQuery jCrop file for image cropping
593
- add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
594
- }
595
 
 
 
596
  }
597
 
598
- // If the image cropping is done, crop the image and save a full/thumb version
599
- if ( isset( $_POST['avatar-crop-submit'] ) ) {
600
-
601
- // Check the nonce
602
- check_admin_referer( 'bp_avatar_cropstore' );
603
 
604
- if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
605
- bp_core_add_message( __( 'There was a problem cropping the avatar, please try uploading it again', 'buddypress' ) );
606
- else
607
- bp_core_add_message( __( 'The new group avatar was uploaded successfully!', 'buddypress' ) );
608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  }
 
610
 
611
- do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id );
612
 
613
- bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) );
614
- }
615
  }
616
  add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
617
 
@@ -621,202 +665,205 @@ add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
621
  * @package BuddyPress
622
  */
623
  function groups_screen_group_admin_manage_members() {
624
- global $bp;
625
 
626
- if ( 'manage-members' == bp_get_group_current_admin_tab() ) {
 
627
 
628
- if ( ! bp_is_item_admin() )
629
- return false;
630
 
631
- if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) {
632
- if ( bp_is_action_variable( 'promote', 1 ) && ( bp_is_action_variable( 'mod', 2 ) || bp_is_action_variable( 'admin', 2 ) ) && is_numeric( bp_action_variable( 3 ) ) ) {
633
- $user_id = bp_action_variable( 3 );
634
- $status = bp_action_variable( 2 );
635
 
636
- // Check the nonce first.
637
- if ( !check_admin_referer( 'groups_promote_member' ) )
638
- return false;
 
639
 
640
- // Promote a user.
641
- if ( !groups_promote_member( $user_id, $bp->groups->current_group->id, $status ) )
642
- bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' );
643
- else
644
- bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) );
 
 
 
 
645
 
646
- do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id );
647
 
648
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
649
- }
650
  }
 
651
 
652
- if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) {
653
- if ( bp_is_action_variable( 'demote', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
654
- $user_id = bp_action_variable( 2 );
655
 
656
- // Check the nonce first.
657
- if ( !check_admin_referer( 'groups_demote_member' ) )
658
- return false;
659
 
660
- // Stop sole admins from abandoning their group
661
- $group_admins = groups_get_group_admins( $bp->groups->current_group->id );
662
- if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $user_id )
663
- bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' );
664
 
665
- // Demote a user.
666
- elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) )
667
- bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' );
668
- else
669
- bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) );
670
 
671
- do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id );
672
 
673
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
674
- }
675
 
676
- if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
677
- $user_id = bp_action_variable( 2 );
678
 
679
- // Check the nonce first.
680
- if ( !check_admin_referer( 'groups_ban_member' ) )
681
- return false;
682
 
683
- // Ban a user.
684
- if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) )
685
- bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' );
686
- else
687
- bp_core_add_message( __( 'User banned successfully', 'buddypress' ) );
688
 
689
- do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id );
690
 
691
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
692
- }
693
 
694
- if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
695
- $user_id = bp_action_variable( 2 );
696
 
697
- // Check the nonce first.
698
- if ( !check_admin_referer( 'groups_unban_member' ) )
699
- return false;
700
 
701
- // Remove a ban for user.
702
- if ( !groups_unban_member( $user_id, $bp->groups->current_group->id ) )
703
- bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' );
704
- else
705
- bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) );
706
 
707
- do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id );
708
 
709
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
710
- }
711
 
712
- if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
713
- $user_id = bp_action_variable( 2 );
714
 
715
- // Check the nonce first.
716
- if ( !check_admin_referer( 'groups_remove_member' ) )
717
- return false;
718
 
719
- // Remove a user.
720
- if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
721
- bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' );
722
- else
723
- bp_core_add_message( __( 'User removed successfully', 'buddypress' ) );
724
 
725
- do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id );
726
 
727
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
728
- }
729
  }
 
730
 
731
- do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id );
732
 
733
- bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) );
734
- }
735
  }
736
  add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' );
737
 
738
  function groups_screen_group_admin_requests() {
739
  global $bp;
740
 
741
- if ( 'membership-requests' == bp_get_group_current_admin_tab() ) {
742
-
743
- if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) )
744
- return false;
745
 
746
- // Remove any screen notifications
747
- bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' );
748
 
749
- $request_action = (string)bp_action_variable( 1 );
750
- $membership_id = (int)bp_action_variable( 2 );
751
 
752
- if ( !empty( $request_action ) && !empty( $membership_id ) ) {
753
- if ( 'accept' == $request_action && is_numeric( $membership_id ) ) {
754
 
755
- // Check the nonce first.
756
- if ( !check_admin_referer( 'groups_accept_membership_request' ) )
757
- return false;
758
 
759
- // Accept the membership request
760
- if ( !groups_accept_membership_request( $membership_id ) )
761
- bp_core_add_message( __( 'There was an error accepting the membership request, please try again.', 'buddypress' ), 'error' );
762
- else
763
- bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) );
764
 
765
- } elseif ( 'reject' == $request_action && is_numeric( $membership_id ) ) {
766
- /* Check the nonce first. */
767
- if ( !check_admin_referer( 'groups_reject_membership_request' ) )
768
- return false;
 
769
 
770
- // Reject the membership request
771
- if ( !groups_reject_membership_request( $membership_id ) )
772
- bp_core_add_message( __( 'There was an error rejecting the membership request, please try again.', 'buddypress' ), 'error' );
773
- else
774
- bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) );
775
- }
776
 
777
- do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id );
778
- bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' );
 
 
 
779
  }
780
 
781
- do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id );
782
- bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) );
783
  }
 
 
 
784
  }
785
  add_action( 'bp_screens', 'groups_screen_group_admin_requests' );
786
 
787
  function groups_screen_group_admin_delete_group() {
788
  global $bp;
789
 
790
- if ( 'delete-group' == bp_get_group_current_admin_tab() ) {
 
791
 
792
- if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) )
793
- return false;
794
 
795
- if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
796
- // Check the nonce first.
797
- if ( !check_admin_referer( 'groups_delete_group' ) )
798
- return false;
799
 
800
- do_action( 'groups_before_group_deleted', $bp->groups->current_group->id );
 
 
 
801
 
802
- // Group admin has deleted the group, now do it.
803
- if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
804
- bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' );
805
- } else {
806
- bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
807
 
808
- do_action( 'groups_group_deleted', $bp->groups->current_group->id );
 
 
 
 
809
 
810
- bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
811
- }
812
 
813
  bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
814
  }
815
 
816
- do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id );
817
-
818
- bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) );
819
  }
 
 
 
 
820
  }
821
  add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' );
822
 
@@ -837,8 +884,7 @@ function groups_screen_notification_settings() {
837
  $group_promo = 'yes';
838
 
839
  if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) )
840
- $group_request = 'yes';
841
- ?>
842
 
843
  <table class="notification-settings" id="groups-notification-settings">
844
  <thead>
@@ -885,4 +931,164 @@ function groups_screen_notification_settings() {
885
  }
886
  add_action( 'bp_notification_settings', 'groups_screen_notification_settings' );
887
 
888
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  add_action( 'bp_screens', 'groups_directory_groups_setup', 2 );
27
 
28
  function groups_screen_my_groups() {
29
+
30
+ $bp = buddypress();
31
 
32
  // Delete group request notifications for the user
33
  if ( isset( $_GET['n'] ) ) {
72
  if ( !check_admin_referer( 'groups_reject_invite' ) )
73
  return false;
74
 
75
+ if ( !groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) {
76
+ bp_core_add_message( __( 'Group invite could not be rejected', 'buddypress' ), 'error' );
77
+ } else {
78
+ bp_core_add_message( __( 'Group invite rejected', 'buddypress' ) );
79
+ }
80
 
81
  bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
82
  }
90
  }
91
 
92
  function groups_screen_group_home() {
 
93
 
94
+ if ( ! bp_is_single_item() )
95
+ return false;
 
 
 
 
 
96
 
97
+ $bp = buddypress();
98
 
99
+ if ( isset( $_GET['n'] ) ) {
100
+ bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
101
+ bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
102
+ bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' );
103
+ bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' );
104
  }
105
+
106
+ do_action( 'groups_screen_group_home' );
107
+
108
+ bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
109
  }
110
 
111
  /**
114
  * @package BuddyPress
115
  */
116
  function groups_screen_group_forum() {
 
117
 
118
  if ( !bp_is_active( 'forums' ) || !bp_forums_is_installed_correctly() )
119
  return false;
123
  return;
124
  }
125
 
126
+ $bp = buddypress();
127
+
128
  if ( !$bp->groups->current_group->user_has_access ) {
129
  bp_core_no_access();
130
  return;
131
  }
132
 
133
+ if ( ! bp_is_single_item() )
134
+ return false;
135
 
136
+ // Fetch the details we need
137
+ $topic_slug = (string)bp_action_variable( 1 );
138
+ $topic_id = bp_forums_get_topic_id_from_slug( $topic_slug );
139
+ $forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
140
+ $user_is_banned = false;
141
 
142
+ if ( !bp_current_user_can( 'bp_moderate' ) && groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
143
+ $user_is_banned = true;
144
 
145
+ if ( !empty( $topic_slug ) && !empty( $topic_id ) ) {
146
 
147
+ // Posting a reply
148
+ if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) {
149
+ // Check the nonce
150
+ check_admin_referer( 'bp_forums_new_reply' );
151
 
152
+ // Auto join this user if they are not yet a member of this group
153
+ if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
154
+ groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
155
+ }
156
 
157
+ $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
158
+
159
+ // Don't allow reply flooding
160
+ if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) {
161
+ bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' );
162
+ } else {
163
+ if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) ) {
164
+ bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' );
165
+ } else {
166
+ bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') );
167
  }
168
+ }
169
 
170
+ $query_vars = isset( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '';
 
 
171
 
172
+ $redirect = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars;
 
 
173
 
174
+ if ( !empty( $post_id ) ) {
175
+ $redirect .= '#post-' . $post_id;
176
  }
177
 
178
+ bp_core_redirect( $redirect );
179
+ }
 
 
180
 
181
+ // Sticky a topic
182
+ else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
183
+ // Check the nonce
184
+ check_admin_referer( 'bp_forums_stick_topic' );
185
 
186
+ if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id ) ) ) {
187
+ bp_core_add_message( __( 'There was an error when making that topic a sticky', 'buddypress' ), 'error' );
188
+ } else {
189
+ bp_core_add_message( __( 'The topic was made sticky successfully', 'buddypress' ) );
190
  }
191
 
192
+ do_action( 'groups_stick_forum_topic', $topic_id );
193
+ bp_core_redirect( wp_get_referer() );
194
+ }
 
195
 
196
+ // Un-Sticky a topic
197
+ else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
198
+ // Check the nonce
199
+ check_admin_referer( 'bp_forums_unstick_topic' );
200
 
201
+ if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id, 'mode' => 'unstick' ) ) ) {
202
+ bp_core_add_message( __( 'There was an error when unsticking that topic', 'buddypress'), 'error' );
203
+ } else {
204
+ bp_core_add_message( __( 'The topic was unstuck successfully', 'buddypress') );
205
  }
206
 
207
+ do_action( 'groups_unstick_forum_topic', $topic_id );
208
+ bp_core_redirect( wp_get_referer() );
209
+ }
 
210
 
211
+ // Close a topic
212
+ else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
213
+ // Check the nonce
214
+ check_admin_referer( 'bp_forums_close_topic' );
215
 
216
+ if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id ) ) ) {
217
+ bp_core_add_message( __( 'There was an error when closing that topic', 'buddypress'), 'error' );
218
+ } else {
219
+ bp_core_add_message( __( 'The topic was closed successfully', 'buddypress') );
220
  }
221
 
222
+ do_action( 'groups_close_forum_topic', $topic_id );
223
+ bp_core_redirect( wp_get_referer() );
224
+ }
 
225
 
226
+ // Open a topic
227
+ else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
228
+ // Check the nonce
229
+ check_admin_referer( 'bp_forums_open_topic' );
230
 
231
+ if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id, 'mode' => 'open' ) ) ) {
232
+ bp_core_add_message( __( 'There was an error when opening that topic', 'buddypress'), 'error' );
233
+ } else {
234
+ bp_core_add_message( __( 'The topic was opened successfully', 'buddypress') );
235
  }
236
 
237
+ do_action( 'groups_open_forum_topic', $topic_id );
238
+ bp_core_redirect( wp_get_referer() );
239
+ }
 
240
 
241
+ // Delete a topic
242
+ else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
243
+ // Fetch the topic
244
+ $topic = bp_forums_get_topic_details( $topic_id );
245
 
246
+ /* Check the logged in user can delete this topic */
247
+ if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) {
248
+ bp_core_redirect( wp_get_referer() );
249
+ }
250
 
251
+ // Check the nonce
252
+ check_admin_referer( 'bp_forums_delete_topic' );
253
 
254
+ do_action( 'groups_before_delete_forum_topic', $topic_id );
 
 
 
255
 
256
+ if ( !groups_delete_group_forum_topic( $topic_id ) ) {
257
+ bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress' ), 'error' );
258
+ } else {
259
+ bp_core_add_message( __( 'The topic was deleted successfully', 'buddypress' ) );
260
  }
261
 
262
+ do_action( 'groups_delete_forum_topic', $topic_id );
263
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' );
264
+ }
 
265
 
266
+ // Editing a topic
267
+ else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
268
+ // Fetch the topic
269
+ $topic = bp_forums_get_topic_details( $topic_id );
270
 
271
+ // Check the logged in user can edit this topic
272
+ if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) {
273
+ bp_core_redirect( wp_get_referer() );
274
+ }
275
 
276
+ if ( isset( $_POST['save_changes'] ) ) {
277
+ // Check the nonce
278
+ check_admin_referer( 'bp_forums_edit_topic' );
279
 
280
+ $topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false;
 
 
 
281
 
282
+ if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'], $topic_tags ) ) {
283
+ bp_core_add_message( __( 'There was an error when editing that topic', 'buddypress'), 'error' );
284
+ } else {
285
+ bp_core_add_message( __( 'The topic was edited successfully', 'buddypress') );
286
  }
287
 
288
+ do_action( 'groups_edit_forum_topic', $topic_id );
289
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' );
290
  }
291
 
292
+ bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
 
 
293
 
294
+ // Delete a post
295
+ } else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
296
+ // Fetch the post
297
+ $post = bp_forums_get_post( $post_id );
298
 
299
+ // Check the logged in user can edit this topic
300
+ if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) {
301
+ bp_core_redirect( wp_get_referer() );
302
+ }
303
 
304
+ // Check the nonce
305
+ check_admin_referer( 'bp_forums_delete_post' );
306
 
307
+ do_action( 'groups_before_delete_forum_post', $post_id );
 
 
 
308
 
309
+ if ( !groups_delete_group_forum_post( $post_id ) ) {
310
+ bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' );
311
+ } else {
312
+ bp_core_add_message( __( 'The post was deleted successfully', 'buddypress') );
313
  }
314
 
315
+ do_action( 'groups_delete_forum_post', $post_id );
316
+ bp_core_redirect( wp_get_referer() );
 
 
317
 
318
+ // Editing a post
319
+ } else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
 
320
 
321
+ // Fetch the post
322
+ $post = bp_forums_get_post( $post_id );
323
+
324
+ // Check the logged in user can edit this topic
325
+ if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) {
326
+ bp_core_redirect( wp_get_referer() );
327
+ }
328
 
329
+ if ( isset( $_POST['save_changes'] ) ) {
330
+ // Check the nonce
331
+ check_admin_referer( 'bp_forums_edit_post' );
332
 
333
+ $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
 
 
 
334
 
335
+ if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $topic_page ) ) {
336
+ bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' );
337
+ } else {
338
+ bp_core_add_message( __( 'The post was edited successfully', 'buddypress') );
339
+ }
340
 
341
+ if ( $_SERVER['QUERY_STRING'] ) {
342
+ $query_vars = '?' . $_SERVER['QUERY_STRING'];
343
  }
344
 
345
+ do_action( 'groups_edit_forum_post', $post_id );
346
+ bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
347
  }
348
 
349
+ bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
 
 
350
 
351
+ // Standard topic display
352
+ } else {
353
+ if ( !empty( $user_is_banned ) ) {
354
+ bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) );
355
  }
356
 
357
+ bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) );
358
+ }
 
 
359
 
360
+ // Forum topic does not exist
361
+ } elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) {
362
+ bp_do_404();
363
+ return;
 
364
 
365
+ } else {
366
+ // Posting a topic
367
+ if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) {
368
 
369
+ // Check the nonce
370
+ check_admin_referer( 'bp_forums_new_topic' );
371
+
372
+ if ( $user_is_banned ) {
373
+ $error_message = __( "You have been banned from this group.", 'buddypress' );
374
+
375
+ } elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
376
+ // Auto join this user if they are not yet a member of this group
377
+ groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
378
+ }
379
 
380
+ if ( empty( $_POST['topic_title'] ) ) {
381
+ $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
382
+ } else if ( empty( $_POST['topic_text'] ) ) {
383
+ $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
384
+ }
385
 
386
+ if ( empty( $forum_id ) ) {
387
+ $error_message = __( 'This group does not have a forum setup yet.', 'buddypress' );
388
+ }
389
 
390
+ if ( isset( $error_message ) ) {
391
+ bp_core_add_message( $error_message, 'error' );
392
+ $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
393
+ } else {
394
+ if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) {
395
+ bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' );
396
  $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
397
  } else {
398
+ bp_core_add_message( __( 'The topic was created successfully', 'buddypress') );
399
+ $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
 
 
 
 
 
400
  }
 
 
401
  }
402
 
403
+ bp_core_redirect( $redirect );
 
 
404
  }
405
+
406
+ do_action( 'groups_screen_group_forum', $topic_id, $forum_id );
407
+
408
+ bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) );
409
  }
410
  }
411
 
412
  function groups_screen_group_members() {
 
413
 
414
+ if ( !bp_is_single_item() )
415
+ return false;
 
416
 
417
+ $bp = buddypress();
418
+
419
+ // Refresh the group member count meta
420
+ groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) );
421
+
422
+ do_action( 'groups_screen_group_members', $bp->groups->current_group->id );
423
+ bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) );
424
  }
425
 
426
  function groups_screen_group_invite() {
 
427
 
428
+ if ( !bp_is_single_item() )
429
+ return false;
430
 
431
+ $bp = buddypress();
 
432
 
433
+ if ( bp_is_action_variable( 'send', 0 ) ) {
434
+
435
+ if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) )
436
+ return false;
437
+
438
+ if ( !empty( $_POST['friends'] ) ) {
439
+ foreach( (array) $_POST['friends'] as $friend ) {
440
+ groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) );
441
  }
442
+ }
443
 
444
+ // Send the invites.
445
+ groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id );
446
+ bp_core_add_message( __('Group invites sent.', 'buddypress') );
447
+ do_action( 'groups_screen_group_invite', $bp->groups->current_group->id );
448
+ bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
449
 
450
+ } elseif ( !bp_action_variable( 0 ) ) {
451
+ // Show send invite page
452
+ bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) );
453
 
454
+ } else {
455
+ bp_do_404();
 
456
  }
457
  }
458
 
462
  if ( !is_user_logged_in() )
463
  return false;
464
 
465
+ $bp = buddypress();
 
 
 
 
 
466
 
467
+ if ( 'private' != $bp->groups->current_group->status )
468
+ return false;
469
+
470
+ // If the user has submitted a request, send it.
471
+ if ( isset( $_POST['group-request-send']) ) {
 
 
472
 
473
+ // Check the nonce
474
+ if ( !check_admin_referer( 'groups_request_membership' ) )
475
+ return false;
476
 
477
+ if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
478
+ bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' );
479
+ } else {
480
+ bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
481
+ }
482
+ bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
483
  }
484
+
485
+ do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );
486
+
487
+ bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );
488
  }
489
 
490
  function groups_screen_group_activity_permalink() {
 
491
 
492
  if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) )
493
  return false;
494
 
495
+ buddypress()->is_single_item = true;
496
 
497
  bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
498
  }
509
  }
510
 
511
  function groups_screen_group_admin_edit_details() {
 
512
 
513
+ if ( 'edit-details' != bp_get_group_current_admin_tab() )
514
+ return false;
 
515
 
516
+ if ( bp_is_item_admin() ) {
 
 
 
 
517
 
518
+ $bp = buddypress();
 
 
 
 
519
 
520
+ // If the edit form has been submitted, save the edited details
521
+ if ( isset( $_POST['save'] ) ) {
522
+ // Check the nonce
523
+ if ( !check_admin_referer( 'groups_edit_group_details' ) )
524
+ return false;
525
 
526
+ if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int) $_POST['group-notify-members'] ) ) {
527
+ bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
528
+ } else {
529
+ bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
530
  }
531
 
532
+ do_action( 'groups_group_details_edited', $bp->groups->current_group->id );
533
 
534
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' );
535
  }
536
+
537
+ do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id );
538
+
539
+ bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) );
540
  }
541
  }
542
  add_action( 'bp_screens', 'groups_screen_group_admin_edit_details' );
543
 
544
  function groups_screen_group_admin_settings() {
 
545
 
546
+ if ( 'group-settings' != bp_get_group_current_admin_tab() )
547
+ return false;
548
 
549
+ if ( ! bp_is_item_admin() )
550
+ return false;
551
 
552
+ $bp = buddypress();
 
 
553
 
554
+ // If the edit form has been submitted, save the edited details
555
+ if ( isset( $_POST['save'] ) ) {
556
+ $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
557
 
558
+ // Checked against a whitelist for security
559
+ $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
560
+ $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
561
 
562
+ // Checked against a whitelist for security
563
+ $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
564
+ $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
565
 
566
+ // Check the nonce
567
+ if ( !check_admin_referer( 'groups_edit_group_settings' ) )
568
+ return false;
 
 
 
 
569
 
570
+ if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
571
+ bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' );
572
+ } else {
573
+ bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
574
  }
575
 
576
+ do_action( 'groups_group_settings_edited', $bp->groups->current_group->id );
577
 
578
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' );
579
  }
580
+
581
+ do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id );
582
+
583
+ bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) );
584
  }
585
  add_action( 'bp_screens', 'groups_screen_group_admin_settings' );
586
 
587
  function groups_screen_group_admin_avatar() {
 
588
 
589
+ if ( 'group-avatar' != bp_get_group_current_admin_tab() )
590
+ return false;
591
 
592
+ // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
593
+ if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
594
+ return false;
595
 
596
+ $bp = buddypress();
 
597
 
598
+ // If the group admin has deleted the admin avatar
599
+ if ( bp_is_action_variable( 'delete', 1 ) ) {
600
 
601
+ // Check the nonce
602
+ check_admin_referer( 'bp_group_avatar_delete' );
 
 
603
 
604
+ if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) {
605
+ bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) );
606
+ } else {
607
+ bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' );
608
  }
609
+ }
610
 
611
+ if ( ! isset( $bp->avatar_admin ) ) {
612
+ $bp->avatar_admin = new stdClass();
613
+ }
 
614
 
615
+ $bp->avatar_admin->step = 'upload-image';
616
 
617
+ if ( !empty( $_FILES ) ) {
 
618
 
619
+ // Check the nonce
620
+ check_admin_referer( 'bp_avatar_upload' );
 
621
 
622
+ // Pass the file to the avatar upload handler
623
+ if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) {
624
+ $bp->avatar_admin->step = 'crop-image';
625
 
626
+ // Make sure we include the jQuery jCrop file for image cropping
627
+ add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
628
  }
629
 
630
+ }
 
 
 
 
631
 
632
+ // If the image cropping is done, crop the image and save a full/thumb version
633
+ if ( isset( $_POST['avatar-crop-submit'] ) ) {
 
 
634
 
635
+ // Check the nonce
636
+ check_admin_referer( 'bp_avatar_cropstore' );
637
+
638
+ $args = array(
639
+ 'object' => 'group',
640
+ 'avatar_dir' => 'group-avatars',
641
+ 'item_id' => $bp->groups->current_group->id,
642
+ 'original_file' => $_POST['image_src'],
643
+ 'crop_x' => $_POST['x'],
644
+ 'crop_y' => $_POST['y'],
645
+ 'crop_w' => $_POST['w'],
646
+ 'crop_h' => $_POST['h']
647
+ );
648
+
649
+ if ( !bp_core_avatar_handle_crop( $args ) ) {
650
+ bp_core_add_message( __( 'There was a problem cropping the avatar.', ' buddypress' ), 'error' );
651
+ } else {
652
+ bp_core_add_message( __( 'The new group avatar was uploaded successfully.', 'buddypress' ) );
653
  }
654
+ }
655
 
656
+ do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id );
657
 
658
+ bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) );
 
659
  }
660
  add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
661
 
665
  * @package BuddyPress
666
  */
667
  function groups_screen_group_admin_manage_members() {
 
668
 
669
+ if ( 'manage-members' != bp_get_group_current_admin_tab() )
670
+ return false;
671
 
672
+ if ( ! bp_is_item_admin() )
673
+ return false;
674
 
675
+ $bp = buddypress();
 
 
 
676
 
677
+ if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) {
678
+ if ( bp_is_action_variable( 'promote', 1 ) && ( bp_is_action_variable( 'mod', 2 ) || bp_is_action_variable( 'admin', 2 ) ) && is_numeric( bp_action_variable( 3 ) ) ) {
679
+ $user_id = bp_action_variable( 3 );
680
+ $status = bp_action_variable( 2 );
681
 
682
+ // Check the nonce first.
683
+ if ( !check_admin_referer( 'groups_promote_member' ) )
684
+ return false;
685
+
686
+ // Promote a user.
687
+ if ( !groups_promote_member( $user_id, $bp->groups->current_group->id, $status ) )
688
+ bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' );
689
+ else
690
+ bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) );
691
 
692
+ do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id );
693
 
694
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
 
695
  }
696
+ }
697
 
698
+ if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) {
699
+ if ( bp_is_action_variable( 'demote', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
700
+ $user_id = bp_action_variable( 2 );
701
 
702
+ // Check the nonce first.
703
+ if ( !check_admin_referer( 'groups_demote_member' ) )
704
+ return false;
705
 
706
+ // Stop sole admins from abandoning their group
707
+ $group_admins = groups_get_group_admins( $bp->groups->current_group->id );
708
+ if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $user_id )
709
+ bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' );
710
 
711
+ // Demote a user.
712
+ elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) )
713
+ bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' );
714
+ else
715
+ bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) );
716
 
717
+ do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id );
718
 
719
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
720
+ }
721
 
722
+ if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
723
+ $user_id = bp_action_variable( 2 );
724
 
725
+ // Check the nonce first.
726
+ if ( !check_admin_referer( 'groups_ban_member' ) )
727
+ return false;
728
 
729
+ // Ban a user.
730
+ if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) )
731
+ bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' );
732
+ else
733
+ bp_core_add_message( __( 'User banned successfully', 'buddypress' ) );
734
 
735
+ do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id );
736
 
737
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
738
+ }
739
 
740
+ if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
741
+ $user_id = bp_action_variable( 2 );
742
 
743
+ // Check the nonce first.
744
+ if ( !check_admin_referer( 'groups_unban_member' ) )
745
+ return false;
746
 
747
+ // Remove a ban for user.
748
+ if ( !groups_unban_member( $user_id, $bp->groups->current_group->id ) )
749
+ bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' );
750
+ else
751
+ bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) );
752
 
753
+ do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id );
754
 
755
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
756
+ }
757
 
758
+ if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
759
+ $user_id = bp_action_variable( 2 );
760
 
761
+ // Check the nonce first.
762
+ if ( !check_admin_referer( 'groups_remove_member' ) )
763
+ return false;
764
 
765
+ // Remove a user.
766
+ if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
767
+ bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' );
768
+ else
769
+ bp_core_add_message( __( 'User removed successfully', 'buddypress' ) );
770
 
771
+ do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id );
772
 
773
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
 
774
  }
775
+ }
776
 
777
+ do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id );
778
 
779
+ bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) );
 
780
  }
781
  add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' );
782
 
783
  function groups_screen_group_admin_requests() {
784
  global $bp;
785
 
786
+ if ( 'membership-requests' != bp_get_group_current_admin_tab() )
787
+ return false;
 
 
788
 
789
+ if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) )
790
+ return false;
791
 
792
+ // Remove any screen notifications
793
+ bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' );
794
 
795
+ $request_action = (string)bp_action_variable( 1 );
796
+ $membership_id = (int)bp_action_variable( 2 );
797
 
798
+ if ( !empty( $request_action ) && !empty( $membership_id ) ) {
799
+ if ( 'accept' == $request_action && is_numeric( $membership_id ) ) {
 
800
 
801
+ // Check the nonce first.
802
+ if ( !check_admin_referer( 'groups_accept_membership_request' ) )
803
+ return false;
 
 
804
 
805
+ // Accept the membership request
806
+ if ( !groups_accept_membership_request( $membership_id ) )
807
+ bp_core_add_message( __( 'There was an error accepting the membership request, please try again.', 'buddypress' ), 'error' );
808
+ else
809
+ bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) );
810
 
811
+ } elseif ( 'reject' == $request_action && is_numeric( $membership_id ) ) {
812
+ /* Check the nonce first. */
813
+ if ( !check_admin_referer( 'groups_reject_membership_request' ) )
814
+ return false;
 
 
815
 
816
+ // Reject the membership request
817
+ if ( !groups_reject_membership_request( $membership_id ) )
818
+ bp_core_add_message( __( 'There was an error rejecting the membership request, please try again.', 'buddypress' ), 'error' );
819
+ else
820
+ bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) );
821
  }
822
 
823
+ do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id );
824
+ bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' );
825
  }
826
+
827
+ do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id );
828
+ bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) );
829
  }
830
  add_action( 'bp_screens', 'groups_screen_group_admin_requests' );
831
 
832
  function groups_screen_group_admin_delete_group() {
833
  global $bp;
834
 
835
+ if ( 'delete-group' != bp_get_group_current_admin_tab() )
836
+ return false;
837
 
838
+ if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) )
839
+ return false;
840
 
841
+ if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
 
 
 
842
 
843
+ // Check the nonce first.
844
+ if ( !check_admin_referer( 'groups_delete_group' ) ) {
845
+ return false;
846
+ }
847
 
848
+ do_action( 'groups_before_group_deleted', $bp->groups->current_group->id );
 
 
 
 
849
 
850
+ // Group admin has deleted the group, now do it.
851
+ if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
852
+ bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' );
853
+ } else {
854
+ bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
855
 
856
+ do_action( 'groups_group_deleted', $bp->groups->current_group->id );
 
857
 
858
  bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
859
  }
860
 
861
+ bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
 
 
862
  }
863
+
864
+ do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id );
865
+
866
+ bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) );
867
  }
868
  add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' );
869
 
884
  $group_promo = 'yes';
885
 
886
  if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) )
887
+ $group_request = 'yes'; ?>
 
888
 
889
  <table class="notification-settings" id="groups-notification-settings">
890
  <thead>
931
  }
932
  add_action( 'bp_notification_settings', 'groups_screen_notification_settings' );
933
 
934
+ /** Theme Compatability *******************************************************/
935
+
936
+ /**
937
+ * The main theme compat class for BuddyPress Groups
938
+ *
939
+ * This class sets up the necessary theme compatability actions to safely output
940
+ * group template parts to the_title and the_content areas of a theme.
941
+ *
942
+ * @since BuddyPress (1.7)
943
+ */
944
+ class BP_Groups_Theme_Compat {
945
+
946
+ /**
947
+ * Setup the groups component theme compatibility
948
+ *
949
+ * @since BuddyPress (1.7)
950
+ */
951
+ public function __construct() {
952
+ add_action( 'bp_setup_theme_compat', array( $this, 'is_group' ) );
953
+ }
954
+
955
+ /**
956
+ * Are we looking at something that needs group theme compatability?
957
+ *
958
+ * @since BuddyPress (1.7)
959
+ */
960
+ public function is_group() {
961
+
962
+ // Bail if not looking at a group
963
+ if ( ! bp_is_groups_component() )
964
+ return;
965
+
966
+ // Group Directory
967
+ if ( ! bp_current_action() && ! bp_current_item() ) {
968
+ bp_update_is_directory( true, 'groups' );
969
+
970
+ do_action( 'groups_directory_groups_setup' );
971
+
972
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
973
+ add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) );
974
+
975
+ // Creating a group
976
+ } elseif ( bp_is_groups_component() && bp_is_current_action( 'create' ) ) {
977
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) );
978
+ add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) );
979
+
980
+ // Group admin
981
+ } elseif ( bp_is_single_item() ) {
982
+ add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) );
983
+ add_filter( 'bp_replace_the_content', array( $this, 'single_content' ) );
984
+
985
+ }
986
+ }
987
+
988
+ /** Directory *************************************************************/
989
+
990
+ /**
991
+ * Update the global $post with directory data
992
+ *
993
+ * @since BuddyPress (1.7)
994
+ */
995
+ public function directory_dummy_post() {
996
+
997
+ // Title based on ability to create groups
998
+ if ( is_user_logged_in() && bp_user_can_create_groups() ) {
999
+ $title = __( 'Groups', 'buddypress' ) . '&nbsp;<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ) . '">' . __( 'Create a Group', 'buddypress' ) . '</a>';
1000
+ } else {
1001
+ $title = __( 'Groups', 'buddypress' );
1002
+ }
1003
+
1004
+ bp_theme_compat_reset_post( array(
1005
+ 'ID' => 0,
1006
+ 'post_title' => $title,
1007
+ 'post_author' => 0,
1008
+ 'post_date' => 0,
1009
+ 'post_content' => '',
1010
+ 'post_type' => 'bp_group',
1011
+ 'post_status' => 'publish',
1012
+ 'is_archive' => true,
1013
+ 'comment_status' => 'closed'
1014
+ ) );
1015
+ }
1016
+
1017
+ /**
1018
+ * Filter the_content with the groups index template part
1019
+ *
1020
+ * @since BuddyPress (1.7)
1021
+ */
1022
+ public function directory_content() {
1023
+ bp_buffer_template_part( 'groups/index' );
1024
+ }
1025
+
1026
+ /** Create ****************************************************************/
1027
+
1028
+ /**
1029
+ * Update the global $post with create screen data
1030
+ *
1031
+ * @since BuddyPress (1.7)
1032
+ */
1033
+ public function create_dummy_post() {
1034
+
1035
+ // Title based on ability to create groups
1036
+ if ( is_user_logged_in() && bp_user_can_create_groups() ) {
1037
+ $title = '<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . __( 'Groups', 'buddypress' ) . '</a>&nbsp;' . __( 'Create a Group', 'buddypress' );
1038
+ } else {
1039
+ $title = __( 'Groups', 'buddypress' );
1040
+ }
1041
+
1042
+ bp_theme_compat_reset_post( array(
1043
+ 'ID' => 0,
1044
+ 'post_title' => $title,
1045
+ 'post_author' => 0,
1046
+ 'post_date' => 0,
1047
+ 'post_content' => '',
1048
+ 'post_type' => 'bp_group',
1049
+ 'post_status' => 'publish',
1050
+ 'is_archive' => true,
1051
+ 'comment_status' => 'closed'
1052
+ ) );
1053
+ }
1054
+
1055
+ /**
1056
+ * Filter the_content with the create screen template part
1057
+ *
1058
+ * @since BuddyPress (1.7)
1059
+ */
1060
+ public function create_content() {
1061
+ bp_buffer_template_part( 'groups/create' );
1062
+ }
1063
+
1064
+ /** Single ****************************************************************/
1065
+
1066
+ /**
1067
+ * Update the global $post with single group data
1068
+ *
1069
+ * @since BuddyPress (1.7)
1070
+ */
1071
+ public function single_dummy_post() {
1072
+ bp_theme_compat_reset_post( array(
1073
+ 'ID' => 0,
1074
+ 'post_title' => '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . bp_get_current_group_name() . '</a>',
1075
+ 'post_author' => 0,
1076
+ 'post_date' => 0,
1077
+ 'post_content' => '',
1078
+ 'post_type' => 'bp_group',
1079
+ 'post_status' => 'publish',
1080
+ 'is_archive' => true,
1081
+ 'comment_status' => 'closed'
1082
+ ) );
1083
+ }
1084
+
1085
+ /**
1086
+ * Filter the_content with the single group template part
1087
+ *
1088
+ * @since BuddyPress (1.7)
1089
+ */
1090
+ public function single_content() {
1091
+ bp_buffer_template_part( 'groups/single/home' );
1092
+ }
1093
+ }
1094
+ new BP_Groups_Theme_Compat();
bp-groups/bp-groups-template.php CHANGED
@@ -107,7 +107,48 @@ class BP_Groups_Template {
107
  var $sort_by;
108
  var $order;
109
 
110
- function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false, $page_arg = 'grpage' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
113
  $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
@@ -273,19 +314,32 @@ function bp_has_groups( $args = '' ) {
273
  );
274
 
275
  $r = wp_parse_args( $args, $defaults );
276
- extract( $r );
277
 
278
- if ( empty( $search_terms ) ) {
279
  if ( isset( $_REQUEST['group-filter-box'] ) && !empty( $_REQUEST['group-filter-box'] ) )
280
- $search_terms = $_REQUEST['group-filter-box'];
281
  elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
282
- $search_terms = $_REQUEST['s'];
283
  else
284
- $search_terms = false;
285
  }
286
 
287
- $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden, $page_arg );
288
- return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  }
290
 
291
  function bp_groups() {
@@ -318,8 +372,8 @@ function bp_group_is_visible( $group = false ) {
318
  return false;
319
  }
320
 
321
- function bp_group_id() {
322
- echo bp_get_group_id();
323
  }
324
  function bp_get_group_id( $group = false ) {
325
  global $groups_template;
@@ -330,8 +384,57 @@ function bp_group_id() {
330
  return apply_filters( 'bp_get_group_id', $group->id );
331
  }
332
 
333
- function bp_group_name() {
334
- echo bp_get_group_name();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  }
336
  function bp_get_group_name( $group = false ) {
337
  global $groups_template;
@@ -342,8 +445,8 @@ function bp_group_name() {
342
  return apply_filters( 'bp_get_group_name', $group->name );
343
  }
344
 
345
- function bp_group_type() {
346
- echo bp_get_group_type();
347
  }
348
  function bp_get_group_type( $group = false ) {
349
  global $groups_template;
@@ -364,8 +467,8 @@ function bp_group_type() {
364
  return apply_filters( 'bp_get_group_type', $type );
365
  }
366
 
367
- function bp_group_status() {
368
- echo bp_get_group_status();
369
  }
370
  function bp_get_group_status( $group = false ) {
371
  global $groups_template;
@@ -401,22 +504,22 @@ function bp_group_avatar( $args = '' ) {
401
  return apply_filters( 'bp_get_group_avatar', $avatar );
402
  }
403
 
404
- function bp_group_avatar_thumb() {
405
- echo bp_get_group_avatar_thumb();
406
  }
407
  function bp_get_group_avatar_thumb( $group = false ) {
408
  return bp_get_group_avatar( 'type=thumb' );
409
  }
410
 
411
- function bp_group_avatar_mini() {
412
- echo bp_get_group_avatar_mini();
413
  }
414
  function bp_get_group_avatar_mini( $group = false ) {
415
  return bp_get_group_avatar( 'type=thumb&width=30&height=30' );
416
  }
417
 
418
- function bp_group_last_active() {
419
- echo bp_get_group_last_active();
420
  }
421
  function bp_get_group_last_active( $group = false ) {
422
  global $groups_template;
@@ -436,8 +539,8 @@ function bp_group_last_active() {
436
  }
437
  }
438
 
439
- function bp_group_permalink() {
440
- echo bp_get_group_permalink();
441
  }
442
  function bp_get_group_permalink( $group = false ) {
443
  global $groups_template;
@@ -448,8 +551,8 @@ function bp_group_permalink() {
448
  return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' ) );
449
  }
450
 
451
- function bp_group_admin_permalink() {
452
- echo bp_get_group_admin_permalink();
453
  }
454
  function bp_get_group_admin_permalink( $group = false ) {
455
  global $groups_template;
@@ -460,8 +563,8 @@ function bp_group_admin_permalink() {
460
  return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) );
461
  }
462
 
463
- function bp_group_slug() {
464
- echo bp_get_group_slug();
465
  }
466
  function bp_get_group_slug( $group = false ) {
467
  global $groups_template;
@@ -472,8 +575,8 @@ function bp_group_slug() {
472
  return apply_filters( 'bp_get_group_slug', $group->slug );
473
  }
474
 
475
- function bp_group_description() {
476
- echo bp_get_group_description();
477
  }
478
  function bp_get_group_description( $group = false ) {
479
  global $groups_template;
@@ -484,8 +587,8 @@ function bp_group_description() {
484
  return apply_filters( 'bp_get_group_description', stripslashes($group->description) );
485
  }
486
 
487
- function bp_group_description_editable() {
488
- echo bp_get_group_description_editable();
489
  }
490
  function bp_get_group_description_editable( $group = false ) {
491
  global $groups_template;
@@ -496,8 +599,8 @@ function bp_group_description_editable() {
496
  return apply_filters( 'bp_get_group_description_editable', $group->description );
497
  }
498
 
499
- function bp_group_description_excerpt() {
500
- echo bp_get_group_description_excerpt();
501
  }
502
  function bp_get_group_description_excerpt( $group = false ) {
503
  global $groups_template;
@@ -509,8 +612,8 @@ function bp_group_description_excerpt() {
509
  }
510
 
511
 
512
- function bp_group_public_status() {
513
- echo bp_get_group_public_status();
514
  }
515
  function bp_get_group_public_status( $group = false ) {
516
  global $groups_template;
@@ -525,8 +628,8 @@ function bp_group_public_status() {
525
  }
526
  }
527
 
528
- function bp_group_is_public() {
529
- echo bp_get_group_is_public();
530
  }
531
  function bp_get_group_is_public( $group = false ) {
532
  global $groups_template;
@@ -537,8 +640,8 @@ function bp_group_is_public() {
537
  return apply_filters( 'bp_get_group_is_public', $group->is_public );
538
  }
539
 
540
- function bp_group_date_created() {
541
- echo bp_get_group_date_created();
542
  }
543
  function bp_get_group_date_created( $group = false ) {
544
  global $groups_template;
@@ -548,7 +651,82 @@ function bp_group_date_created() {
548
 
549
  return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) );
550
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
 
 
552
  function bp_group_is_admin() {
553
  return bp_is_item_admin();
554
  }
@@ -848,16 +1026,8 @@ function bp_group_is_forum_enabled( $group = false ) {
848
  if ( empty( $group ) )
849
  $group =& $groups_template->group;
850
 
851
- if ( bp_is_active( 'forums' ) ) {
852
- if ( bp_forums_is_installed_correctly() ) {
853
- if ( $group->enable_forum )
854
- return true;
855
-
856
- return false;
857
- } else {
858
- return false;
859
- }
860
- }
861
 
862
  return false;
863
  }
@@ -1005,7 +1175,7 @@ function bp_groups_user_can_send_invites( $group_id = false ) {
1005
  *
1006
  * @deprecated 1.5
1007
  * @deprecated No longer used.
1008
- * @since 1.0
1009
  * @todo Remove in 1.4
1010
  */
1011
  function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
@@ -1264,7 +1434,7 @@ function bp_group_admin_tabs( $group = false ) {
1264
 
1265
  $current_tab = bp_get_group_current_admin_tab();
1266
 
1267
- if ( bp_is_item_admin() || bp_is_item_mod() ) : ?>
1268
 
1269
  <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
1270
 
@@ -1475,9 +1645,30 @@ function bp_has_friends_to_invite( $group = false ) {
1475
  return true;
1476
  }
1477
 
 
 
 
 
 
 
 
 
1478
  function bp_group_new_topic_button( $group = false ) {
1479
  echo bp_get_group_new_topic_button( $group );
1480
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1481
  function bp_get_group_new_topic_button( $group = false ) {
1482
  global $groups_template;
1483
 
@@ -1487,7 +1678,7 @@ function bp_group_new_topic_button( $group = false ) {
1487
  if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() )
1488
  return false;
1489
 
1490
- $button = bp_button( array (
1491
  'id' => 'new_topic',
1492
  'component' => 'groups',
1493
  'must_be_logged_in' => true,
@@ -1498,7 +1689,7 @@ function bp_group_new_topic_button( $group = false ) {
1498
  'link_id' => 'new-topic-button',
1499
  'link_text' => __( 'New Topic', 'buddypress' ),
1500
  'link_title' => __( 'New Topic', 'buddypress' ),
1501
- ) );
1502
 
1503
  // Filter and return the HTML button
1504
  return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) );
@@ -1521,7 +1712,7 @@ function bp_group_join_button( $group = false ) {
1521
  return false;
1522
 
1523
  // Already a member
1524
- if ( $group->is_member ) {
1525
 
1526
  // Stop sole admins from abandoning their group
1527
  $group_admins = groups_get_group_admins( $group->id );
@@ -1612,7 +1803,7 @@ function bp_group_join_button( $group = false ) {
1612
  *
1613
  * @global BP_Groups_Template $groups_template Groups template object
1614
  * @param object $group Group to get status message for. Optional; defaults to current group.
1615
- * @since 1.0
1616
  */
1617
  function bp_group_status_message( $group = null ) {
1618
  global $groups_template;
@@ -2194,7 +2385,7 @@ function bp_group_creation_previous_link() {
2194
  /**
2195
  * Echoes the current group creation step
2196
  *
2197
- * @since 1.6
2198
  */
2199
  function bp_groups_current_create_step() {
2200
  echo bp_get_groups_current_create_step();
@@ -2202,20 +2393,20 @@ function bp_groups_current_create_step() {
2202
  /**
2203
  * Returns the current group creation step. If none is found, returns an empty string
2204
  *
2205
- * @since 1.6
2206
  *
2207
  * @uses apply_filters() Filter bp_get_groups_current_create_step to modify
2208
  * @return str $current_create_step
2209
  */
2210
  function bp_get_groups_current_create_step() {
2211
  global $bp;
2212
-
2213
  if ( !empty( $bp->groups->current_create_step ) ) {
2214
  $current_create_step = $bp->groups->current_create_step;
2215
  } else {
2216
  $current_create_step = '';
2217
  }
2218
-
2219
  return apply_filters( 'bp_get_groups_current_create_step', $current_create_step );
2220
  }
2221
 
@@ -2360,7 +2551,7 @@ function bp_is_group_admin_screen( $slug ) {
2360
  /**
2361
  * Echoes the current group admin tab slug
2362
  *
2363
- * @since 1.6
2364
  */
2365
  function bp_group_current_admin_tab() {
2366
  echo bp_get_group_current_admin_tab();
@@ -2368,7 +2559,7 @@ function bp_group_current_admin_tab() {
2368
  /**
2369
  * Returns the current group admin tab slug
2370
  *
2371
- * @since 1.6
2372
  *
2373
  * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value
2374
  * @return str $tab The current tab's slug
@@ -2379,7 +2570,7 @@ function bp_group_current_admin_tab() {
2379
  } else {
2380
  $tab = '';
2381
  }
2382
-
2383
  return apply_filters( 'bp_get_current_group_admin_tab', $tab );
2384
  }
2385
 
@@ -2896,4 +3087,3 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false )
2896
  if ( !empty( $url ) )
2897
  return $url;
2898
  }
2899
- ?>
107
  var $sort_by;
108
  var $order;
109
 
110
+ function __construct( $args = array() ){
111
+
112
+ // Backward compatibility with old method of passing arguments
113
+ if ( ! is_array( $args ) || func_num_args() > 1 ) {
114
+ _deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
115
+
116
+ $old_args_keys = array(
117
+ 0 => 'user_id',
118
+ 1 => 'type',
119
+ 2 => 'page',
120
+ 3 => 'per_page',
121
+ 4 => 'max',
122
+ 5 => 'slug',
123
+ 6 => 'search_terms',
124
+ 7 => 'populate_extras',
125
+ 8 => 'include',
126
+ 9 => 'exclude',
127
+ 10 => 'show_hidden',
128
+ 11 => 'page_arg',
129
+ );
130
+
131
+ $func_args = func_get_args();
132
+ $args = bp_core_parse_args_array( $old_args_keys, $func_args );
133
+ }
134
+
135
+ $defaults = array(
136
+ 'type' => 'active',
137
+ 'page' => 1,
138
+ 'per_page' => 20,
139
+ 'max' => false,
140
+ 'show_hidden' => false,
141
+ 'page_arg' => 'grpage',
142
+ 'user_id' => 0,
143
+ 'slug' => false,
144
+ 'include' => false,
145
+ 'exclude' => false,
146
+ 'search_terms' => '',
147
+ 'populate_extras' => true
148
+ );
149
+
150
+ $r = wp_parse_args( $args, $defaults );
151
+ extract( $r );
152
 
153
  $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
154
  $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
314
  );
315
 
316
  $r = wp_parse_args( $args, $defaults );
 
317
 
318
+ if ( empty( $r['search_terms'] ) ) {
319
  if ( isset( $_REQUEST['group-filter-box'] ) && !empty( $_REQUEST['group-filter-box'] ) )
320
+ $r['search_terms'] = $_REQUEST['group-filter-box'];
321
  elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
322
+ $r['search_terms'] = $_REQUEST['s'];
323
  else
324
+ $r['search_terms'] = false;
325
  }
326
 
327
+ $groups_template = new BP_Groups_Template( array(
328
+ 'type' => $r['type'],
329
+ 'page' => (int) $r['page'],
330
+ 'per_page' => (int) $r['per_page'],
331
+ 'max' => (int) $r['max'],
332
+ 'show_hidden' => $r['show_hidden'],
333
+ 'page_arg' => $r['page_arg'],
334
+ 'user_id' => (int) $r['user_id'],
335
+ 'slug' => $r['slug'],
336
+ 'search_terms' => $r['search_terms'],
337
+ 'include' => $r['include'],
338
+ 'exclude' => $r['exclude'],
339
+ 'populate_extras' => (bool) $r['populate_extras']
340
+ ) );
341
+
342
+ return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template, $r );
343
  }
344
 
345
  function bp_groups() {
372
  return false;
373
  }
374
 
375
+ function bp_group_id( $group = false ) {
376
+ echo bp_get_group_id( $group );
377
  }
378
  function bp_get_group_id( $group = false ) {
379
  global $groups_template;
384
  return apply_filters( 'bp_get_group_id', $group->id );
385
  }
386
 
387
+ /**
388
+ * Output the row class of a group
389
+ *
390
+ * @since BuddyPress (1.7)
391
+ */
392
+ function bp_group_class() {
393
+ echo bp_get_group_class();
394
+ }
395
+ /**
396
+ * Return the row class of a group
397
+ *
398
+ * @global BP_Groups_Template $groups_template
399
+ * @return string Row class of the group
400
+ * @since BuddyPress (1.7)
401
+ */
402
+ function bp_get_group_class() {
403
+ global $groups_template;
404
+
405
+ $classes = array();
406
+ $pos_in_loop = (int) $groups_template->current_group;
407
+
408
+ // If we've only one group in the loop, don't both with odd and even.
409
+ if ( $groups_template->group_count > 1 )
410
+ $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
411
+ else
412
+ $classes[] = 'bp-single-group';
413
+
414
+ // Group type - public, private, hidden.
415
+ $classes[] = esc_attr( $groups_template->group->status );
416
+
417
+ // User's group status
418
+ if ( bp_is_user_active() ) {
419
+ if ( bp_group_is_admin() )
420
+ $classes[] = 'is-admin';
421
+
422
+ if ( bp_group_is_member() )
423
+ $classes[] = 'is-member';
424
+
425
+ if ( bp_group_is_mod() )
426
+ $classes[] = 'is-mod';
427
+ }
428
+
429
+ $classes = apply_filters( 'bp_get_group_class', $classes );
430
+ $classes = array_merge( $classes, array() );
431
+ $retval = 'class="' . join( ' ', $classes ) . '"';
432
+
433
+ return $retval;
434
+ }
435
+
436
+ function bp_group_name( $group = false ) {
437
+ echo bp_get_group_name( $group );
438
  }
439
  function bp_get_group_name( $group = false ) {
440
  global $groups_template;
445
  return apply_filters( 'bp_get_group_name', $group->name );
446
  }
447
 
448
+ function bp_group_type( $group = false ) {
449
+ echo bp_get_group_type( $group );
450
  }
451
  function bp_get_group_type( $group = false ) {
452
  global $groups_template;
467
  return apply_filters( 'bp_get_group_type', $type );
468
  }
469
 
470
+ function bp_group_status( $group = false ) {
471
+ echo bp_get_group_status( $group );
472
  }
473
  function bp_get_group_status( $group = false ) {
474
  global $groups_template;
504
  return apply_filters( 'bp_get_group_avatar', $avatar );
505
  }
506
 
507
+ function bp_group_avatar_thumb( $group = false ) {
508
+ echo bp_get_group_avatar_thumb( $group );
509
  }
510
  function bp_get_group_avatar_thumb( $group = false ) {
511
  return bp_get_group_avatar( 'type=thumb' );
512
  }
513
 
514
+ function bp_group_avatar_mini( $group = false ) {
515
+ echo bp_get_group_avatar_mini( $group );
516
  }
517
  function bp_get_group_avatar_mini( $group = false ) {
518
  return bp_get_group_avatar( 'type=thumb&width=30&height=30' );
519
  }
520
 
521
+ function bp_group_last_active( $group = false ) {
522
+ echo bp_get_group_last_active( $group );
523
  }
524
  function bp_get_group_last_active( $group = false ) {
525
  global $groups_template;
539
  }
540
  }
541
 
542
+ function bp_group_permalink( $group = false ) {
543
+ echo bp_get_group_permalink( $group );
544
  }
545
  function bp_get_group_permalink( $group = false ) {
546
  global $groups_template;
551
  return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' ) );
552
  }
553
 
554
+ function bp_group_admin_permalink( $group = false ) {
555
+ echo bp_get_group_admin_permalink( $group );
556
  }
557
  function bp_get_group_admin_permalink( $group = false ) {
558
  global $groups_template;
563
  return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) );
564
  }
565
 
566
+ function bp_group_slug( $group = false ) {
567
+ echo bp_get_group_slug( $group );
568
  }
569
  function bp_get_group_slug( $group = false ) {
570
  global $groups_template;
575
  return apply_filters( 'bp_get_group_slug', $group->slug );
576
  }
577
 
578
+ function bp_group_description( $group = false ) {
579
+ echo bp_get_group_description( $group );
580
  }
581
  function bp_get_group_description( $group = false ) {
582
  global $groups_template;
587
  return apply_filters( 'bp_get_group_description', stripslashes($group->description) );
588
  }
589
 
590
+ function bp_group_description_editable( $group = false ) {
591
+ echo bp_get_group_description_editable( $group );
592
  }
593
  function bp_get_group_description_editable( $group = false ) {
594
  global $groups_template;
599
  return apply_filters( 'bp_get_group_description_editable', $group->description );
600
  }
601
 
602
+ function bp_group_description_excerpt( $group = false ) {
603
+ echo bp_get_group_description_excerpt( $group );
604
  }
605
  function bp_get_group_description_excerpt( $group = false ) {
606
  global $groups_template;
612
  }
613
 
614
 
615
+ function bp_group_public_status( $group = false ) {
616
+ echo bp_get_group_public_status( $group );
617
  }
618
  function bp_get_group_public_status( $group = false ) {
619
  global $groups_template;
628
  }
629
  }
630
 
631
+ function bp_group_is_public( $group = false ) {
632
+ echo bp_get_group_is_public( $group );
633
  }
634
  function bp_get_group_is_public( $group = false ) {
635
  global $groups_template;
640
  return apply_filters( 'bp_get_group_is_public', $group->is_public );
641
  }
642
 
643
+ function bp_group_date_created( $group = false ) {
644
+ echo bp_get_group_date_created( $group );
645
  }
646
  function bp_get_group_date_created( $group = false ) {
647
  global $groups_template;
651
 
652
  return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) );
653
  }
654
+
655
+ function bp_group_creator_username( $group = false ) {
656
+ echo bp_get_group_creator_username( $group );
657
+ }
658
+ function bp_get_group_creator_username( $group = false ) {
659
+ global $groups_template;
660
+
661
+ if ( empty( $group ) )
662
+ $group =& $groups_template->group;
663
+
664
+ return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ) );
665
+ }
666
+
667
+ function bp_group_creator_id( $group = false ) {
668
+ echo bp_get_group_creator_id( $group );
669
+ }
670
+ function bp_get_group_creator_id( $group = false ) {
671
+ global $groups_template;
672
+
673
+ if ( empty( $group ) )
674
+ $group =& $groups_template->group;
675
+
676
+ return apply_filters( 'bp_get_group_creator_id', $group->creator_id );
677
+ }
678
+
679
+ function bp_group_creator_permalink( $group = false ) {
680
+ echo bp_get_group_creator_permalink( $group );
681
+ }
682
+ function bp_get_group_creator_permalink( $group = false ) {
683
+ global $groups_template;
684
+
685
+ if ( empty( $group ) )
686
+ $group =& $groups_template->group;
687
+
688
+ return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ) );
689
+ }
690
+
691
+ function bp_is_group_creator( $group = false, $user_id = 0 ) {
692
+ global $groups_template;
693
+
694
+ if ( empty( $group ) )
695
+ $group =& $groups_template->group;
696
+
697
+ if ( empty( $user_id ) )
698
+ $user_id = bp_loggedin_user_id();
699
+
700
+ return (bool) ( $group->creator_id == $user_id );
701
+ }
702
+
703
+ function bp_group_creator_avatar( $group = false, $args = array() ) {
704
+ echo bp_get_group_creator_avatar( $group, $args );
705
+ }
706
+ function bp_get_group_creator_avatar( $group = false, $args = array() ) {
707
+ global $groups_template;
708
+
709
+ if ( empty( $group ) )
710
+ $group =& $groups_template->group;
711
+
712
+ $defaults = array(
713
+ 'type' => 'full',
714
+ 'width' => false,
715
+ 'height' => false,
716
+ 'class' => 'avatar',
717
+ 'id' => false,
718
+ 'alt' => sprintf( __( 'Group creator avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) )
719
+ );
720
+
721
+ $r = wp_parse_args( $args, $defaults );
722
+ extract( $r, EXTR_SKIP );
723
+
724
+ $avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) );
725
+
726
+ return apply_filters( 'bp_get_group_creator_avatar', $avatar );
727
+ }
728
 
729
+
730
  function bp_group_is_admin() {
731
  return bp_is_item_admin();
732
  }
1026
  if ( empty( $group ) )
1027
  $group =& $groups_template->group;
1028
 
1029
+ if ( ! empty( $group->enable_forum ) )
1030
+ return true;
 
 
 
 
 
 
 
 
1031
 
1032
  return false;
1033
  }
1175
  *
1176
  * @deprecated 1.5
1177
  * @deprecated No longer used.
1178
+ * @since BuddyPress (1.0)
1179
  * @todo Remove in 1.4
1180
  */
1181
  function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
1434
 
1435
  $current_tab = bp_get_group_current_admin_tab();
1436
 
1437
+ if ( bp_is_item_admin() ) : ?>
1438
 
1439
  <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
1440
 
1645
  return true;
1646
  }
1647
 
1648
+ /**
1649
+ * Outputs a 'New Topic' button for a group.
1650
+ *
1651
+ * @since BuddyPress (1.2.7)
1652
+ *
1653
+ * @param obj|bool $group The BP Groups_Group object if passed, boolean false if not passed.
1654
+ * @uses bp_get_group_new_topic_button() Returns the 'New Topic' button
1655
+ */
1656
  function bp_group_new_topic_button( $group = false ) {
1657
  echo bp_get_group_new_topic_button( $group );
1658
  }
1659
+ /**
1660
+ * Returns a 'New Topic' button for a group.
1661
+ *
1662
+ * @since BuddyPress (1.2.7)
1663
+ *
1664
+ * @param obj|bool $group The BP Groups_Group object if passed, boolean false if not passed.
1665
+ * @uses is_user_logged_in() Is there a user logged in?
1666
+ * @uses bp_group_is_user_banned() Is the current user banned from the current group?
1667
+ * @uses bp_is_group_forum() Are we on a group forum page?
1668
+ * @uses bp_is_group_forum_topic() Are we on a group topic page?
1669
+ * @uses bp_get_button() Renders a button
1670
+ * @return HTML code for the button
1671
+ */
1672
  function bp_get_group_new_topic_button( $group = false ) {
1673
  global $groups_template;
1674
 
1678
  if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() )
1679
  return false;
1680
 
1681
+ $button = array(
1682
  'id' => 'new_topic',
1683
  'component' => 'groups',
1684
  'must_be_logged_in' => true,
1689
  'link_id' => 'new-topic-button',
1690
  'link_text' => __( 'New Topic', 'buddypress' ),
1691
  'link_title' => __( 'New Topic', 'buddypress' ),
1692
+ );
1693
 
1694
  // Filter and return the HTML button
1695
  return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) );
1712
  return false;
1713
 
1714
  // Already a member
1715
+ if ( isset( $group->is_member ) && $group->is_member ) {
1716
 
1717
  // Stop sole admins from abandoning their group
1718
  $group_admins = groups_get_group_admins( $group->id );
1803
  *
1804
  * @global BP_Groups_Template $groups_template Groups template object
1805
  * @param object $group Group to get status message for. Optional; defaults to current group.
1806
+ * @since BuddyPress (1.0)
1807
  */
1808
  function bp_group_status_message( $group = null ) {
1809
  global $groups_template;
2385
  /**
2386
  * Echoes the current group creation step
2387
  *
2388
+ * @since BuddyPress (1.6)
2389
  */
2390
  function bp_groups_current_create_step() {
2391
  echo bp_get_groups_current_create_step();
2393
  /**
2394
  * Returns the current group creation step. If none is found, returns an empty string
2395
  *
2396
+ * @since BuddyPress (1.6)
2397
  *
2398
  * @uses apply_filters() Filter bp_get_groups_current_create_step to modify
2399
  * @return str $current_create_step
2400
  */
2401
  function bp_get_groups_current_create_step() {
2402
  global $bp;
2403
+
2404
  if ( !empty( $bp->groups->current_create_step ) ) {
2405
  $current_create_step = $bp->groups->current_create_step;
2406
  } else {
2407
  $current_create_step = '';
2408
  }
2409
+
2410
  return apply_filters( 'bp_get_groups_current_create_step', $current_create_step );
2411
  }
2412
 
2551
  /**
2552
  * Echoes the current group admin tab slug
2553
  *
2554
+ * @since BuddyPress (1.6)
2555
  */
2556
  function bp_group_current_admin_tab() {
2557
  echo bp_get_group_current_admin_tab();
2559
  /**
2560
  * Returns the current group admin tab slug
2561
  *
2562
+ * @since BuddyPress (1.6)
2563
  *
2564
  * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value
2565
  * @return str $tab The current tab's slug
2570
  } else {
2571
  $tab = '';
2572
  }
2573
+
2574
  return apply_filters( 'bp_get_current_group_admin_tab', $tab );
2575
  }
2576
 
3087
  if ( !empty( $url ) )
3088
  return $url;
3089
  }
 
bp-groups/bp-groups-widgets.php CHANGED
@@ -24,15 +24,15 @@ class BP_Groups_Widget extends WP_Widget {
24
  }
25
 
26
  function __construct() {
27
- $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ) );
28
- parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops );
 
 
 
29
 
30
  if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
31
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
32
- wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.dev.js', array( 'jquery' ), bp_get_version() );
33
- } else {
34
- wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.js', array( 'jquery' ), bp_get_version() );
35
- }
36
  }
37
  }
38
 
@@ -48,12 +48,10 @@ class BP_Groups_Widget extends WP_Widget {
48
  $instance['title'] = __( 'Groups', 'buddypress' );
49
 
50
  echo $before_widget;
51
-
52
- $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
53
-
54
- echo $before_title
55
- . $title
56
- . $after_title; ?>
57
 
58
  <?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
59
  <div class="item-options" id="groups-list-options">
@@ -105,7 +103,7 @@ class BP_Groups_Widget extends WP_Widget {
105
 
106
  function update( $new_instance, $old_instance ) {
107
  $instance = $old_instance;
108
-
109
  $instance['title'] = strip_tags( $new_instance['title'] );
110
  $instance['max_groups'] = strip_tags( $new_instance['max_groups'] );
111
  $instance['group_default'] = strip_tags( $new_instance['group_default'] );
@@ -130,7 +128,7 @@ class BP_Groups_Widget extends WP_Widget {
130
  ?>
131
 
132
  <p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
133
-
134
  <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p>
135
 
136
  <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>
@@ -166,34 +164,31 @@ function groups_ajax_widget_groups_list() {
166
 
167
  if ( bp_has_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
168
  <?php echo "0[[SPLIT]]"; ?>
169
-
170
- <ul id="groups-list" class="item-list">
171
- <?php while ( bp_groups() ) : bp_the_group(); ?>
172
- <li>
173
- <div class="item-avatar">
174
- <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  </div>
 
 
 
176
 
177
- <div class="item">
178
- <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
179
- <div class="item-meta">
180
- <span class="activity">
181
- <?php
182
- if ( 'newest-groups' == $_POST['filter'] ) {
183
- printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
184
- } else if ( 'recently-active-groups' == $_POST['filter'] ) {
185
- printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
186
- } else if ( 'popular-groups' == $_POST['filter'] ) {
187
- bp_group_member_count();
188
- }
189
- ?>
190
- </span>
191
- </div>
192
- </div>
193
- </li>
194
-
195
- <?php endwhile; ?>
196
- </ul>
197
  <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
198
  <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $_POST['max_groups'] ); ?>" />
199
 
@@ -204,7 +199,5 @@ function groups_ajax_widget_groups_list() {
204
  <?php endif;
205
 
206
  }
207
- add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
208
  add_action( 'wp_ajax_nopriv_widget_groups_list', 'groups_ajax_widget_groups_list' );
209
-
210
- ?>
24
  }
25
 
26
  function __construct() {
27
+ $widget_ops = array(
28
+ 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ),
29
+ 'classname' => 'buddypress',
30
+ );
31
+ parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops );
32
 
33
  if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
34
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
35
+ wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() );
 
 
 
36
  }
37
  }
38
 
48
  $instance['title'] = __( 'Groups', 'buddypress' );
49
 
50
  echo $before_widget;
51
+
52
+ $title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
53
+
54
+ echo $before_title . $title . $after_title; ?>
 
 
55
 
56
  <?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
57
  <div class="item-options" id="groups-list-options">
103
 
104
  function update( $new_instance, $old_instance ) {
105
  $instance = $old_instance;
106
+
107
  $instance['title'] = strip_tags( $new_instance['title'] );
108
  $instance['max_groups'] = strip_tags( $new_instance['max_groups'] );
109
  $instance['group_default'] = strip_tags( $new_instance['group_default'] );
128
  ?>
129
 
130
  <p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
131
+
132
  <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p>
133
 
134
  <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>
164
 
165
  if ( bp_has_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
166
  <?php echo "0[[SPLIT]]"; ?>
167
+ <?php while ( bp_groups() ) : bp_the_group(); ?>
168
+ <li>
169
+ <div class="item-avatar">
170
+ <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
171
+ </div>
172
+
173
+ <div class="item">
174
+ <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
175
+ <div class="item-meta">
176
+ <span class="activity">
177
+ <?php
178
+ if ( 'newest-groups' == $_POST['filter'] ) {
179
+ printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
180
+ } else if ( 'recently-active-groups' == $_POST['filter'] ) {
181
+ printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
182
+ } else if ( 'popular-groups' == $_POST['filter'] ) {
183
+ bp_group_member_count();
184
+ }
185
+ ?>
186
+ </span>
187
  </div>
188
+ </div>
189
+ </li>
190
+ <?php endwhile; ?>
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
193
  <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $_POST['max_groups'] ); ?>" />
194
 
199
  <?php endif;
200
 
201
  }
202
+ add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
203
  add_action( 'wp_ajax_nopriv_widget_groups_list', 'groups_ajax_widget_groups_list' );
 
 
bp-groups/js/widget-groups.dev.js DELETED
@@ -1,49 +0,0 @@
1
- jQuery(document).ready( function() {
2
- jQuery(".widget div#groups-list-options a").live('click',
3
- function() {
4
- var link = this;
5
- jQuery(link).addClass('loading');
6
-
7
- jQuery(".widget div#groups-list-options a").removeClass("selected");
8
- jQuery(this).addClass('selected');
9
-
10
- jQuery.post( ajaxurl, {
11
- action: 'widget_groups_list',
12
- 'cookie': encodeURIComponent(document.cookie),
13
- '_wpnonce': jQuery("input#_wpnonce-groups").val(),
14
- 'max_groups': jQuery("input#groups_widget_max").val(),
15
- 'filter': jQuery(this).attr('id')
16
- },
17
- function(response)
18
- {
19
- jQuery(link).removeClass('loading');
20
- groups_wiget_response(response);
21
- });
22
-
23
- return false;
24
- }
25
- );
26
- });
27
-
28
- function groups_wiget_response(response) {
29
- response = response.substr(0, response.length-1);
30
- response = response.split('[[SPLIT]]');
31
-
32
- if ( response[0] != "-1" ) {
33
- jQuery(".widget ul#groups-list").fadeOut(200,
34
- function() {
35
- jQuery(".widget ul#groups-list").html(response[1]);
36
- jQuery(".widget ul#groups-list").fadeIn(200);
37
- }
38
- );
39
-
40
- } else {
41
- jQuery(".widget ul#groups-list").fadeOut(200,
42
- function() {
43
- var message = '<p>' + response[1] + '</p>';
44
- jQuery(".widget ul#groups-list").html(message);
45
- jQuery(".widget ul#groups-list").fadeIn(200);
46
- }
47
- );
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-groups/js/widget-groups.js CHANGED
@@ -1 +1,49 @@
1
- jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").live("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#groups-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");groups_wiget_response(b)});return false})});function groups_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]);jQuery(".widget ul#groups-list").fadeIn(200)})}else{jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b);jQuery(".widget ul#groups-list").fadeIn(200)})}};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready( function() {
2
+ jQuery(".widget div#groups-list-options a").on('click',
3
+ function() {
4
+ var link = this;
5
+ jQuery(link).addClass('loading');
6
+
7
+ jQuery(".widget div#groups-list-options a").removeClass("selected");
8
+ jQuery(this).addClass('selected');
9
+
10
+ jQuery.post( ajaxurl, {
11
+ action: 'widget_groups_list',
12
+ 'cookie': encodeURIComponent(document.cookie),
13
+ '_wpnonce': jQuery("input#_wpnonce-groups").val(),
14
+ 'max_groups': jQuery("input#groups_widget_max").val(),
15
+ 'filter': jQuery(this).attr('id')
16
+ },
17
+ function(response)
18
+ {
19
+ jQuery(link).removeClass('loading');
20
+ groups_wiget_response(response);
21
+ });
22
+
23
+ return false;
24
+ }
25
+ );
26
+ });
27
+
28
+ function groups_wiget_response(response) {
29
+ response = response.substr(0, response.length-1);
30
+ response = response.split('[[SPLIT]]');
31
+
32
+ if ( response[0] != "-1" ) {
33
+ jQuery(".widget ul#groups-list").fadeOut(200,
34
+ function() {
35
+ jQuery(".widget ul#groups-list").html(response[1]);
36
+ jQuery(".widget ul#groups-list").fadeIn(200);
37
+ }
38
+ );
39
+
40
+ } else {
41
+ jQuery(".widget ul#groups-list").fadeOut(200,
42
+ function() {
43
+ var message = '<p>' + response[1] + '</p>';
44
+ jQuery(".widget ul#groups-list").html(message);
45
+ jQuery(".widget ul#groups-list").fadeIn(200);
46
+ }
47
+ );
48
+ }
49
+ }
bp-groups/js/widget-groups.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#groups-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");groups_wiget_response(b)});return false})});function groups_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]);jQuery(".widget ul#groups-list").fadeIn(200)})}else{jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b);jQuery(".widget ul#groups-list").fadeIn(200)})}};
bp-languages/buddypress.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: BuddyPress \n"
6
  "Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
7
- "POT-Creation-Date: 2013-02-13 22:36:44+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -25,6 +25,7 @@ msgid "The activity item has been marked as spam and is no longer visible."
25
  msgstr ""
26
 
27
  #: bp-activity/bp-activity-actions.php:263
 
28
  #: bp-themes/bp-default/_inc/ajax.php:263
29
  msgid "Please enter some content to post."
30
  msgstr ""
@@ -38,6 +39,7 @@ msgid "There was an error when posting your update, please try again."
38
  msgstr ""
39
 
40
  #: bp-activity/bp-activity-actions.php:323
 
41
  #: bp-themes/bp-default/_inc/ajax.php:311
42
  msgid "Please do not leave the comment area blank."
43
  msgstr ""
@@ -47,6 +49,8 @@ msgid "Reply Posted!"
47
  msgstr ""
48
 
49
  #: bp-activity/bp-activity-actions.php:336
 
 
50
  #: bp-themes/bp-default/_inc/ajax.php:314
51
  #: bp-themes/bp-default/_inc/ajax.php:323
52
  msgid "There was an error posting that reply, please try again."
@@ -71,147 +75,162 @@ msgstr ""
71
  #. translators: Personal activity RSS title - "[Site Name] | [Displayed User
72
  #. Name] | Activity"
73
 
74
- #: bp-activity/bp-activity-admin.php:34 bp-activity/bp-activity-admin.php:835
75
- #: bp-activity/bp-activity-admin.php:1145
76
  #: bp-activity/bp-activity-loader.php:118
77
- #: bp-activity/bp-activity-loader.php:241
78
  #: bp-activity/bp-activity-screens.php:278
79
- #: bp-activity/feeds/bp-activity-personal-feed.php:28
80
- #: bp-core/admin/bp-core-update.php:391
 
81
  msgid "Activity"
82
  msgstr ""
83
 
84
- #: bp-activity/bp-activity-admin.php:64
85
  msgid "ERROR: Please type a reply."
86
  msgstr ""
87
 
88
- #: bp-activity/bp-activity-admin.php:69
89
  msgid "ERROR: The item you are trying to reply to cannot be found, or it has been deleted."
90
  msgstr ""
91
 
92
- #: bp-activity/bp-activity-admin.php:177 bp-activity/bp-activity-admin.php:224
 
 
 
 
 
93
  msgid "Overview"
94
  msgstr ""
95
 
96
- #: bp-activity/bp-activity-admin.php:179
97
  msgid "You edit activities made on your site similar to the way you edit a comment. This is useful if you need to change which page the activity links to, or when you notice that the author has made a typographical error."
98
  msgstr ""
99
 
100
- #: bp-activity/bp-activity-admin.php:180
101
  msgid "The two big editing areas for the activity title and content are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Primary Item/Secondary Item, Link, Type, Author ID) or to choose a 1- or 2-column layout for this screen."
102
  msgstr ""
103
 
104
- #: bp-activity/bp-activity-admin.php:181
105
  msgid "You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity."
106
  msgstr ""
107
 
108
- #: bp-activity/bp-activity-admin.php:186
109
  msgid "Item, Link, Type"
110
  msgstr ""
111
 
112
- #: bp-activity/bp-activity-admin.php:188
113
  msgid "<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields."
114
  msgstr ""
115
 
116
- #: bp-activity/bp-activity-admin.php:189
117
  msgid "<strong>Link</strong> - Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item. Some types of activity may not use this field, even if it has been set."
118
  msgstr ""
119
 
120
- #: bp-activity/bp-activity-admin.php:190
121
  msgid "<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group."
122
  msgstr ""
123
 
124
- #: bp-activity/bp-activity-admin.php:191
125
  msgid "For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side."
126
  msgstr ""
127
 
128
- #: bp-activity/bp-activity-admin.php:196 bp-activity/bp-activity-admin.php:241
 
 
 
 
 
129
  msgid "For more information:"
130
  msgstr ""
131
 
132
- #: bp-activity/bp-activity-admin.php:197
133
  msgid "<a href=\"http://codex.buddypress.org/buddypress-site-administration/managing-activity/\">Managing Activity</a>"
134
  msgstr ""
135
 
136
- #: bp-activity/bp-activity-admin.php:198 bp-activity/bp-activity-admin.php:242
 
 
 
 
137
  msgid "<a href=\"http://buddypress.org/support/\">Support Forums</a>"
138
  msgstr ""
139
 
140
- #: bp-activity/bp-activity-admin.php:202
141
  msgctxt "activity admin edit screen"
142
  msgid "Status"
143
  msgstr ""
144
 
145
- #: bp-activity/bp-activity-admin.php:203
146
  msgctxt "activity admin edit screen"
147
  msgid "Primary Item/Secondary Item"
148
  msgstr ""
149
 
150
- #: bp-activity/bp-activity-admin.php:204
151
  msgctxt "activity admin edit screen"
152
  msgid "Link"
153
  msgstr ""
154
 
155
- #: bp-activity/bp-activity-admin.php:205
156
  msgctxt "activity admin edit screen"
157
  msgid "Type"
158
  msgstr ""
159
 
160
- #: bp-activity/bp-activity-admin.php:206
161
  msgctxt "activity admin edit screen"
162
  msgid "Author ID"
163
  msgstr ""
164
 
165
- #: bp-activity/bp-activity-admin.php:219
166
  msgctxt "Activity items per page (screen options)"
167
  msgid "Activity"
168
  msgstr ""
169
 
170
- #: bp-activity/bp-activity-admin.php:226
171
  msgid "You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions."
172
  msgstr ""
173
 
174
- #: bp-activity/bp-activity-admin.php:227
175
  msgid "There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them."
176
  msgstr ""
177
 
178
- #: bp-activity/bp-activity-admin.php:233
179
  msgid "Moderating Activity"
180
  msgstr ""
181
 
182
- #: bp-activity/bp-activity-admin.php:235
183
  msgid "In the <strong>Activity</strong> column, above each activity it says &#8220;Submitted on,&#8221; followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity."
184
  msgstr ""
185
 
186
- #: bp-activity/bp-activity-admin.php:236
187
  msgid "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items."
188
  msgstr ""
189
 
190
- #: bp-activity/bp-activity-admin.php:564
191
  msgid "Editing Activity (ID #%s)"
192
  msgstr ""
193
 
194
- #: bp-activity/bp-activity-admin.php:575
195
  msgid "Action"
196
  msgstr ""
197
 
198
- #: bp-activity/bp-activity-admin.php:582
199
  msgid "Content"
200
  msgstr ""
201
 
202
- #: bp-activity/bp-activity-admin.php:607
203
  msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>."
204
  msgstr ""
205
 
206
- #: bp-activity/bp-activity-admin.php:629
207
  msgid "View Activity"
208
  msgstr ""
209
 
210
- #: bp-activity/bp-activity-admin.php:637
211
  msgid "Approved"
212
  msgstr ""
213
 
214
- #: bp-activity/bp-activity-admin.php:638 bp-activity/bp-activity-admin.php:1283
215
  #: bp-activity/bp-activity-akismet.php:178
216
  #: bp-activity/bp-activity-akismet.php:207
217
  msgid "Spam"
@@ -219,174 +238,179 @@ msgstr ""
219
 
220
  #. translators: Publish box date format, see http:php.net/date
221
 
222
- #: bp-activity/bp-activity-admin.php:644
223
  msgid "M j, Y @ G:i"
224
  msgstr ""
225
 
226
- #: bp-activity/bp-activity-admin.php:647
227
  msgid "Submitted on: <strong>%1$s</strong>"
228
  msgstr ""
229
 
230
- #: bp-activity/bp-activity-admin.php:647 bp-activity/bp-activity-admin.php:1276
231
- #: bp-forums/bp-forums-template.php:1270 bp-themes/bp-default/functions.php:507
232
- #: bp-xprofile/bp-xprofile-admin.php:456 bp-xprofile/bp-xprofile-loader.php:172
233
- #: bp-xprofile/bp-xprofile-loader.php:230
 
234
  msgid "Edit"
235
  msgstr ""
236
 
237
- #: bp-activity/bp-activity-admin.php:660 bp-core/admin/bp-core-update.php:135
238
  msgid "Update"
239
  msgstr ""
240
 
241
- #: bp-activity/bp-activity-admin.php:679
242
  msgid "Link"
243
  msgstr ""
244
 
245
- #: bp-activity/bp-activity-admin.php:681
246
  msgid "Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item."
247
  msgstr ""
248
 
249
- #: bp-activity/bp-activity-admin.php:695
250
  msgid "Author ID"
251
  msgstr ""
252
 
253
- #: bp-activity/bp-activity-admin.php:747
254
  msgid "Primary Item ID"
255
  msgstr ""
256
 
257
- #: bp-activity/bp-activity-admin.php:751
258
  msgid "Secondary Item ID"
259
  msgstr ""
260
 
261
- #: bp-activity/bp-activity-admin.php:754
262
  msgid "These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs."
263
  msgstr ""
264
 
265
- #: bp-activity/bp-activity-admin.php:791
266
- msgid "%s activity has been permanently deleted."
267
  msgid_plural "%s activity items have been permanently deleted."
268
  msgstr[0] ""
269
  msgstr[1] ""
270
 
271
- #: bp-activity/bp-activity-admin.php:795
272
  msgid "An error occurred when trying to update activity ID #%s."
273
  msgstr ""
274
 
275
- #: bp-activity/bp-activity-admin.php:798
276
  msgid "Errors occurred when trying to update these activity items:"
277
  msgstr ""
278
 
279
  #. Translators: This is a bulleted list of item IDs
280
 
281
- #: bp-activity/bp-activity-admin.php:804
282
  msgid "#%s"
283
  msgstr ""
284
 
285
- #: bp-activity/bp-activity-admin.php:813
286
- msgid "%s activity has been successfully spammed."
287
  msgid_plural "%s activity items have been successfully spammed."
288
  msgstr[0] ""
289
  msgstr[1] ""
290
 
291
- #: bp-activity/bp-activity-admin.php:816
292
- msgid "%s activity has been successfully unspammed."
293
  msgid_plural "%s activity items have been successfully unspammed."
294
  msgstr[0] ""
295
  msgstr[1] ""
296
 
297
- #: bp-activity/bp-activity-admin.php:819
298
- msgid "The activity has been updated succesfully."
299
  msgstr ""
300
 
301
- #: bp-activity/bp-activity-admin.php:833
302
  msgid "Activity related to ID #%s"
303
  msgstr ""
304
 
305
- #: bp-activity/bp-activity-admin.php:839
306
  msgid "Search results for &#8220;%s&#8221;"
307
  msgstr ""
308
 
309
- #: bp-activity/bp-activity-admin.php:852
310
  msgid "Search all Activity"
311
  msgstr ""
312
 
313
- #: bp-activity/bp-activity-admin.php:863
314
  msgid "Reply to Activity"
315
  msgstr ""
316
 
317
- #: bp-activity/bp-activity-admin.php:867
 
 
318
  #: bp-themes/bp-default/forums/index.php:134
319
- #: bp-xprofile/bp-xprofile-classes.php:405
320
- #: bp-xprofile/bp-xprofile-classes.php:913
321
  msgid "Cancel"
322
  msgstr ""
323
 
324
- #: bp-activity/bp-activity-admin.php:868 bp-activity/bp-activity-admin.php:1273
325
- #: bp-themes/bp-default/activity/comment.php:37
 
 
326
  #: bp-themes/bp-default/groups/single/forum/edit.php:10
327
  msgid "Reply"
328
  msgstr ""
329
 
330
- #: bp-activity/bp-activity-admin.php:1051
331
  msgid "No activities found."
332
  msgstr ""
333
 
334
- #: bp-activity/bp-activity-admin.php:1111
335
- #: bp-messages/bp-messages-template.php:440
336
  msgid "All"
337
  msgstr ""
338
 
339
- #: bp-activity/bp-activity-admin.php:1112
340
  msgid "Spam <span class=\"count\">(%s)</span>"
341
  msgstr ""
342
 
343
- #: bp-activity/bp-activity-admin.php:1127
344
  msgid "Mark as Spam"
345
  msgstr ""
346
 
347
- #: bp-activity/bp-activity-admin.php:1128
348
- #: bp-activity/bp-activity-admin.php:1281
349
  msgid "Not Spam"
350
  msgstr ""
351
 
352
- #: bp-activity/bp-activity-admin.php:1129
353
- #: bp-activity/bp-activity-admin.php:1286
354
  msgid "Delete Permanently"
355
  msgstr ""
356
 
357
- #: bp-activity/bp-activity-admin.php:1144
358
  msgid "Author"
359
  msgstr ""
360
 
361
- #: bp-activity/bp-activity-admin.php:1146
362
  msgid "In Response To"
363
  msgstr ""
364
 
365
- #: bp-activity/bp-activity-admin.php:1201
366
  msgid "Show all activity types"
367
  msgstr ""
368
 
369
- #: bp-activity/bp-activity-admin.php:1208
370
  msgid "Filter"
371
  msgstr ""
372
 
373
- #: bp-activity/bp-activity-admin.php:1286 bp-core/bp-core-cssjs.php:17
374
  msgid "Are you sure?"
375
  msgstr ""
376
 
377
  #. translators: 2: activity admin ui date/time
378
 
379
- #: bp-activity/bp-activity-admin.php:1295
380
  msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
381
  msgstr ""
382
 
383
- #: bp-activity/bp-activity-admin.php:1324
384
  msgid "%s related activity"
385
  msgid_plural "%s related activities"
386
  msgstr[0] ""
387
  msgstr[1] ""
388
 
389
- #: bp-activity/bp-activity-admin.php:1335
390
  msgid "<a href=\"%1$s\">View Activity</a>"
391
  msgstr ""
392
 
@@ -439,53 +463,54 @@ msgctxt "x hours ago - akismet cleared this item"
439
  msgid "<span>%1$s</span> &mdash; %2$s"
440
  msgstr ""
441
 
442
- #: bp-activity/bp-activity-classes.php:122
443
- #: bp-activity/bp-activity-template.php:120
 
444
  msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details."
445
  msgstr ""
446
 
447
- #: bp-activity/bp-activity-filters.php:321
448
  msgid "[Read more]"
449
  msgstr ""
450
 
451
- #: bp-activity/bp-activity-filters.php:326
452
  msgid "&hellip;"
453
  msgstr ""
454
 
455
- #: bp-activity/bp-activity-functions.php:149
456
  msgid "@%s Mentions"
457
  msgstr ""
458
 
459
- #: bp-activity/bp-activity-functions.php:152
460
  msgid "You have %1$d new mentions"
461
  msgstr ""
462
 
463
- #: bp-activity/bp-activity-functions.php:156
464
  msgid "%1$s mentioned you"
465
  msgstr ""
466
 
467
- #: bp-activity/bp-activity-functions.php:767
468
  msgid "Posted a status update"
469
  msgstr ""
470
 
471
- #: bp-activity/bp-activity-functions.php:768
472
  msgid "Replied to a status update"
473
  msgstr ""
474
 
475
- #: bp-activity/bp-activity-functions.php:1016
476
  msgid "%s posted an update"
477
  msgstr ""
478
 
479
- #: bp-activity/bp-activity-functions.php:1085
480
  msgid "%s posted a new activity comment"
481
  msgstr ""
482
 
483
- #: bp-activity/bp-activity-functions.php:1458
484
  msgid "Thumbnail"
485
  msgstr ""
486
 
487
  #: bp-activity/bp-activity-loader.php:30
488
- #: bp-core/admin/bp-core-components.php:83
489
  msgid "Activity Streams"
490
  msgstr ""
491
 
@@ -493,71 +518,77 @@ msgstr ""
493
  msgid "Search Activity..."
494
  msgstr ""
495
 
496
- #: bp-activity/bp-activity-loader.php:143
497
- #: bp-activity/bp-activity-loader.php:257
498
  msgid "Personal"
499
  msgstr ""
500
 
501
  #. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] |
502
  #. Mentions"
503
 
504
- #: bp-activity/bp-activity-loader.php:153
505
- #: bp-activity/bp-activity-loader.php:234
506
- #: bp-activity/feeds/bp-activity-mentions-feed.php:28
 
507
  #: bp-themes/bp-default/activity/index.php:77
508
  msgid "Mentions"
509
  msgstr ""
510
 
511
- #: bp-activity/bp-activity-loader.php:164
512
- #: bp-activity/bp-activity-loader.php:265
513
  msgid "Favorites"
514
  msgstr ""
515
 
516
- #: bp-activity/bp-activity-loader.php:176
517
- #: bp-activity/bp-activity-loader.php:274 bp-friends/bp-friends-loader.php:155
518
  #: bp-friends/bp-friends-screens.php:83
519
  msgid "Friends"
520
  msgstr ""
521
 
522
- #: bp-activity/bp-activity-loader.php:189
523
- #: bp-activity/bp-activity-loader.php:284 bp-core/admin/bp-core-update.php:354
524
- #: bp-core/bp-core-template.php:260 bp-groups/bp-groups-activity.php:143
525
- #: bp-groups/bp-groups-activity.php:179 bp-groups/bp-groups-activity.php:215
526
- #: bp-groups/bp-groups-activity.php:251 bp-groups/bp-groups-loader.php:502
527
- #: bp-groups/bp-groups-screens.php:847 bp-groups/bp-groups-widgets.php:28
528
- #: bp-groups/bp-groups-widgets.php:48 bp-groups/bp-groups-widgets.php:119
 
 
 
529
  msgid "Groups"
530
  msgstr ""
531
 
532
- #: bp-activity/bp-activity-loader.php:232
533
  msgid "Mentions <span class=\"count\">%s</span>"
534
  msgstr ""
535
 
536
- #: bp-activity/bp-activity-loader.php:309
537
  msgid "My Activity"
538
  msgstr ""
539
 
540
- #: bp-activity/bp-activity-loader.php:314
541
- #: bp-activity/bp-activity-template.php:968
542
- #: bp-activity/bp-activity-template.php:1089
543
- #: bp-activity/bp-activity-template.php:1099 bp-blogs/bp-blogs-loader.php:200
544
- #: bp-forums/bp-forums-loader.php:238 bp-forums/bp-forums-template.php:487
545
  #: bp-forums/bp-forums-template.php:604 bp-forums/bp-forums-template.php:1200
546
- #: bp-friends/bp-friends-loader.php:203 bp-groups/bp-groups-loader.php:557
547
- #: bp-groups/bp-groups-template.php:570 bp-groups/bp-groups-template.php:593
548
- #: bp-groups/bp-groups-template.php:1030 bp-groups/bp-groups-template.php:1046
549
- #: bp-groups/bp-groups-template.php:1095 bp-groups/bp-groups-template.php:1111
550
- #: bp-groups/bp-groups-template.php:1801 bp-groups/bp-groups-template.php:1810
551
- #: bp-groups/bp-groups-template.php:1819 bp-groups/bp-groups-template.php:2567
552
- #: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:197
553
- #: bp-members/bp-members-template.php:478
554
- #: bp-members/bp-members-template.php:778
555
- #: bp-members/bp-members-template.php:797
556
- #: bp-messages/bp-messages-loader.php:255
557
  #: bp-messages/bp-messages-template.php:326
 
 
558
  #: bp-themes/bp-default/groups/single/admin.php:185
559
  #: bp-themes/bp-default/groups/single/admin.php:212
560
- #: bp-xprofile/bp-xprofile-loader.php:262
561
  msgid "Profile picture of %s"
562
  msgstr ""
563
 
@@ -565,7 +596,7 @@ msgstr ""
565
  msgid "%s mentioned you in an update"
566
  msgstr ""
567
 
568
- #: bp-activity/bp-activity-notifications.php:77 bp-core/deprecated/1.5.php:337
569
  msgid ""
570
  "%1$s mentioned you in the group \"%2$s\":\n"
571
  "\n"
@@ -588,24 +619,24 @@ msgid ""
588
  msgstr ""
589
 
590
  #: bp-activity/bp-activity-notifications.php:98
591
- #: bp-activity/bp-activity-notifications.php:175
592
- #: bp-activity/bp-activity-notifications.php:221 bp-core/deprecated/1.5.php:347
593
- #: bp-friends/bp-friends-notifications.php:44
594
- #: bp-friends/bp-friends-notifications.php:81
595
- #: bp-groups/bp-groups-notifications.php:43
596
- #: bp-groups/bp-groups-notifications.php:92
597
- #: bp-groups/bp-groups-notifications.php:148
598
- #: bp-groups/bp-groups-notifications.php:195
599
- #: bp-groups/bp-groups-notifications.php:249
600
- #: bp-messages/bp-messages-notifications.php:60
601
  msgid "To disable these notifications please log in and go to: %s"
602
  msgstr ""
603
 
604
- #: bp-activity/bp-activity-notifications.php:163
605
  msgid "%s replied to one of your updates"
606
  msgstr ""
607
 
608
- #: bp-activity/bp-activity-notifications.php:165
609
  msgid ""
610
  "%1$s replied to one of your updates:\n"
611
  "\n"
@@ -616,11 +647,11 @@ msgid ""
616
  "---------------------\n"
617
  msgstr ""
618
 
619
- #: bp-activity/bp-activity-notifications.php:206
620
  msgid "%s replied to one of your comments"
621
  msgstr ""
622
 
623
- #: bp-activity/bp-activity-notifications.php:211
624
  msgid ""
625
  "%1$s replied to one of your comments:\n"
626
  "\n"
@@ -635,19 +666,23 @@ msgstr ""
635
  msgid "You do not have access to this activity."
636
  msgstr ""
637
 
638
- #: bp-activity/bp-activity-screens.php:279 bp-blogs/bp-blogs-template.php:499
639
- #: bp-friends/bp-friends-screens.php:84 bp-groups/bp-groups-screens.php:848
640
- #: bp-messages/bp-messages-screens.php:149
 
 
641
  #: bp-themes/bp-default/groups/single/admin.php:26
642
- #: bp-themes/bp-default/registration/register.php:227
643
  msgid "Yes"
644
  msgstr ""
645
 
646
- #: bp-activity/bp-activity-screens.php:280 bp-blogs/bp-blogs-template.php:503
647
- #: bp-friends/bp-friends-screens.php:85 bp-groups/bp-groups-screens.php:849
648
- #: bp-messages/bp-messages-screens.php:150
 
 
649
  #: bp-themes/bp-default/groups/single/admin.php:27
650
- #: bp-themes/bp-default/registration/register.php:228
651
  msgid "No"
652
  msgstr ""
653
 
@@ -659,6 +694,10 @@ msgstr ""
659
  msgid "A member replies to an update or comment you've posted"
660
  msgstr ""
661
 
 
 
 
 
662
  #: bp-activity/bp-activity-template.php:220
663
  msgctxt "Activity pagination previous text"
664
  msgid "&larr;"
@@ -669,152 +708,159 @@ msgctxt "Activity pagination next text"
669
  msgid "&rarr;"
670
  msgstr ""
671
 
672
- #: bp-activity/bp-activity-template.php:523
673
  msgid "Viewing item %1$s to %2$s (of %3$s items)"
674
  msgstr ""
675
 
676
- #: bp-activity/bp-activity-template.php:968
677
  msgid "Profile picture"
678
  msgstr ""
679
 
680
- #: bp-activity/bp-activity-template.php:1065
681
  msgid "Group logo"
682
  msgstr ""
683
 
684
- #: bp-activity/bp-activity-template.php:1070
685
- #: bp-groups/bp-groups-template.php:391
686
  msgid "Group logo of %s"
687
  msgstr ""
688
 
689
- #: bp-activity/bp-activity-template.php:1080
690
  msgid "Profile picture of the author of the site %s"
691
  msgstr ""
692
 
693
- #: bp-activity/bp-activity-template.php:1270
694
  msgid "View Discussion"
695
  msgstr ""
696
 
697
- #: bp-activity/bp-activity-template.php:2065
698
- #: bp-forums/bp-forums-template.php:1271 bp-groups/bp-groups-template.php:1294
699
- #: bp-themes/bp-default/activity/comment.php:43
 
 
 
 
700
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:51
701
  #: bp-themes/bp-default/members/single/messages/single.php:24
702
  #: bp-xprofile/bp-xprofile-admin.php:460
703
  msgid "Delete"
704
  msgstr ""
705
 
706
- #: bp-activity/bp-activity-template.php:2112
707
- #: bp-core/admin/bp-core-slugs.php:112 bp-core/admin/bp-core-slugs.php:173
708
- #: bp-members/bp-members-template.php:583
 
 
709
  #: bp-themes/bp-default/activity/entry.php:37
710
  #: bp-themes/bp-default/functions.php:165
711
- #: bp-xprofile/bp-xprofile-loader.php:222
 
712
  msgid "View"
713
  msgstr ""
714
 
715
- #: bp-activity/bp-activity-template.php:2206
716
  msgid "Clear Filter"
717
  msgstr ""
718
 
719
- #: bp-activity/bp-activity-template.php:2389
720
  msgid "a user"
721
  msgstr ""
722
 
723
- #: bp-activity/bp-activity-template.php:2429
724
  msgid "Send a public message on your activity stream."
725
  msgstr ""
726
 
727
- #: bp-activity/bp-activity-template.php:2430
728
  msgid "Public Message"
729
  msgstr ""
730
 
731
- #: bp-activity/bp-activity-template.php:2737
732
  msgid "Site Wide Activity RSS Feed"
733
  msgstr ""
734
 
735
  #. translators: Favorited activity RSS title - "[Site Name] | [Displayed User
736
  #. Name] | Favorite Activity"
737
 
738
- #: bp-activity/feeds/bp-activity-favorites-feed.php:28
739
  msgid "Favorite Activity"
740
  msgstr ""
741
 
742
- #: bp-activity/feeds/bp-activity-favorites-feed.php:31
743
  msgid "%s - Favorite Activity"
744
  msgstr ""
745
 
746
- #: bp-activity/feeds/bp-activity-favorites-feed.php:57
747
- #: bp-activity/feeds/bp-activity-friends-feed.php:50
748
- #: bp-activity/feeds/bp-activity-group-feed.php:50
749
- #: bp-activity/feeds/bp-activity-mentions-feed.php:51
750
- #: bp-activity/feeds/bp-activity-mygroups-feed.php:56
751
- #: bp-activity/feeds/bp-activity-personal-feed.php:50
752
- #: bp-activity/feeds/bp-activity-sitewide-feed.php:50
753
  msgid "Comments: %s"
754
  msgstr ""
755
 
756
- #: bp-activity/feeds/bp-activity-favorites-feed.php:61
757
- #: bp-activity/feeds/bp-activity-friends-feed.php:54
758
- #: bp-activity/feeds/bp-activity-mentions-feed.php:55
759
- #: bp-activity/feeds/bp-activity-personal-feed.php:54
760
  msgid "In reply to"
761
  msgstr ""
762
 
763
  #. translators: Member friends activity RSS title - "[Site Name] | Friends
764
  #. Activity"
765
 
766
- #: bp-activity/feeds/bp-activity-friends-feed.php:28
767
  msgid "Friends Activity"
768
  msgstr ""
769
 
770
- #: bp-activity/feeds/bp-activity-friends-feed.php:31
771
  msgid "%s - Friends Activity Feed"
772
  msgstr ""
773
 
774
  #. translators: Single group activity RSS title - "[Site Name] | [Group Name] |
775
  #. Group Activity"
776
 
777
- #: bp-activity/feeds/bp-activity-group-feed.php:28
778
  msgid "Group Activity"
779
  msgstr ""
780
 
781
- #: bp-activity/feeds/bp-activity-group-feed.php:31
782
  msgid "%s - Group Activity Feed"
783
  msgstr ""
784
 
785
  #. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] |
786
  #. Mentions"
787
 
788
- #: bp-activity/feeds/bp-activity-mentions-feed.php:32
789
  msgid "%s - Mentions"
790
  msgstr ""
791
 
792
  #. translators: Member groups activity RSS title - "[Site Name] | [Displayed
793
  #. User Name] | My Groups - Public Activity"
794
 
795
- #: bp-activity/feeds/bp-activity-mygroups-feed.php:28
796
  msgid "My Groups - Public Activity"
797
  msgstr ""
798
 
799
  #. translators: Member groups activity RSS description - "[Displayed user name]
800
  #. - My Groups - Public Activity"
801
 
802
- #: bp-activity/feeds/bp-activity-mygroups-feed.php:32
803
  msgid "%1$s - My Groups - Public Activity"
804
  msgstr ""
805
 
806
- #: bp-activity/feeds/bp-activity-personal-feed.php:31
807
  msgid "%s - Activity Feed"
808
  msgstr ""
809
 
810
  #. translators: Sitewide activity RSS title - "[Site Name] | Site Wide
811
  #. Activity"
812
 
813
- #: bp-activity/feeds/bp-activity-sitewide-feed.php:28
814
  msgid "Site Wide Activity"
815
  msgstr ""
816
 
817
- #: bp-activity/feeds/bp-activity-sitewide-feed.php:31
818
  msgid "Site Wide Activity Feed"
819
  msgstr ""
820
 
@@ -830,24 +876,24 @@ msgstr ""
830
  msgid "New post comment posted"
831
  msgstr ""
832
 
833
- #: bp-blogs/bp-blogs-buddybar.php:43 bp-blogs/bp-blogs-loader.php:122
834
- #: bp-blogs/bp-blogs-loader.php:170 bp-blogs/bp-blogs-loader.php:191
835
  msgid "My Sites"
836
  msgstr ""
837
 
838
- #: bp-blogs/bp-blogs-buddybar.php:55 bp-core/bp-core-buddybar.php:545
839
  msgid "Dashboard"
840
  msgstr ""
841
 
842
- #: bp-blogs/bp-blogs-buddybar.php:56 bp-core/bp-core-buddybar.php:549
843
  msgid "New Post"
844
  msgstr ""
845
 
846
- #: bp-blogs/bp-blogs-buddybar.php:57 bp-core/bp-core-buddybar.php:550
847
  msgid "Manage Posts"
848
  msgstr ""
849
 
850
- #: bp-blogs/bp-blogs-buddybar.php:58 bp-core/bp-core-buddybar.php:551
851
  msgid "Manage Comments"
852
  msgstr ""
853
 
@@ -855,27 +901,27 @@ msgstr ""
855
  msgid "Create a Site!"
856
  msgstr ""
857
 
858
- #: bp-blogs/bp-blogs-functions.php:110
859
  msgid "%s created the site %s"
860
  msgstr ""
861
 
862
- #: bp-blogs/bp-blogs-functions.php:183
863
  msgid "%1$s wrote a new post, %2$s, on the site %3$s"
864
  msgstr ""
865
 
866
- #: bp-blogs/bp-blogs-functions.php:185
867
  msgid "%1$s wrote a new post, %2$s"
868
  msgstr ""
869
 
870
- #: bp-blogs/bp-blogs-functions.php:287
871
  msgid "%1$s commented on the post, %2$s, on the site %3$s"
872
  msgstr ""
873
 
874
- #: bp-blogs/bp-blogs-functions.php:289
875
  msgid "%1$s commented on the post, %2$s"
876
  msgstr ""
877
 
878
- #: bp-blogs/bp-blogs-loader.php:25 bp-core/admin/bp-core-components.php:95
879
  msgid "Site Tracking"
880
  msgstr ""
881
 
@@ -887,134 +933,148 @@ msgstr ""
887
  msgid "Sites <span>%d</span>"
888
  msgstr ""
889
 
890
- #: bp-blogs/bp-blogs-loader.php:162
891
  msgid "Sites"
892
  msgstr ""
893
 
894
- #: bp-blogs/bp-blogs-template.php:138
 
 
 
 
 
 
 
 
 
 
895
  msgctxt "Blog pagination previous text"
896
  msgid "&larr;"
897
  msgstr ""
898
 
899
- #: bp-blogs/bp-blogs-template.php:139
900
  msgctxt "Blog pagination next text"
901
  msgid "&rarr;"
902
  msgstr ""
903
 
904
- #: bp-blogs/bp-blogs-template.php:263
905
  msgid "Viewing site %1$s to %2$s (of %3$s sites)"
906
  msgstr ""
907
 
908
- #: bp-blogs/bp-blogs-template.php:287
909
  msgid "Profile picture of site author %s"
910
  msgstr ""
911
 
912
- #: bp-blogs/bp-blogs-template.php:350 bp-core/bp-core-classes.php:177
913
- #: bp-groups/bp-groups-widgets.php:80 bp-groups/bp-groups-widgets.php:185
914
- #: bp-members/bp-members-template.php:554
915
- #: bp-members/bp-members-template.php:829
 
 
916
  #: bp-themes/bp-default/groups/groups-loop.php:47
917
  #: bp-themes/bp-default/groups/single/group-header.php:42
918
  msgid "active %s"
919
  msgstr ""
920
 
921
- #: bp-blogs/bp-blogs-template.php:362
922
  msgid "Latest Post: %s"
923
  msgstr ""
924
 
925
- #: bp-blogs/bp-blogs-template.php:425
926
  msgid "There was a problem, please correct the form below and try again."
927
  msgstr ""
928
 
929
- #: bp-blogs/bp-blogs-template.php:428
930
  msgid "By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!"
931
  msgstr ""
932
 
933
- #: bp-blogs/bp-blogs-template.php:430
934
  msgid "If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!"
935
  msgstr ""
936
 
937
- #: bp-blogs/bp-blogs-template.php:439
938
  msgid "Create Site"
939
  msgstr ""
940
 
941
- #: bp-blogs/bp-blogs-template.php:453
942
  msgid "Site Name:"
943
  msgstr ""
944
 
945
- #: bp-blogs/bp-blogs-template.php:455
946
  msgid "Site Domain:"
947
  msgstr ""
948
 
949
- #: bp-blogs/bp-blogs-template.php:469
950
  msgid "Your address will be "
951
  msgstr ""
952
 
953
- #: bp-blogs/bp-blogs-template.php:472
954
  msgid "blogname"
955
  msgstr ""
956
 
957
- #: bp-blogs/bp-blogs-template.php:474
958
  msgid "domain."
959
  msgstr ""
960
 
961
- #: bp-blogs/bp-blogs-template.php:477
962
  msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)"
963
  msgstr ""
964
 
965
- #: bp-blogs/bp-blogs-template.php:483
966
  msgid "Site Title:"
967
  msgstr ""
968
 
969
- #: bp-blogs/bp-blogs-template.php:494
970
  msgid "Privacy:"
971
  msgstr ""
972
 
973
- #: bp-blogs/bp-blogs-template.php:495
974
- #: bp-themes/bp-default/registration/register.php:224
 
975
  msgid "I would like my site to appear in search engines, and in public listings around this network."
976
  msgstr ""
977
 
978
- #: bp-blogs/bp-blogs-template.php:578
979
  msgid "Congratulations! You have successfully registered a new site."
980
  msgstr ""
981
 
982
- #: bp-blogs/bp-blogs-template.php:580
983
  msgid "<a href=\"%1$s\">%2$s</a> is your new site. <a href=\"%3$s\">Login</a> as \"%4$s\" using your existing password."
984
  msgstr ""
985
 
986
- #: bp-blogs/bp-blogs-template.php:589 bp-core/bp-core-filters.php:348
987
  #: bp-themes/bp-default/blogs/create.php:21
988
  #: bp-themes/bp-default/blogs/index.php:21
989
  msgid "Create a Site"
990
  msgstr ""
991
 
992
- #: bp-blogs/bp-blogs-template.php:601
993
  msgid "%s's Sites"
994
  msgstr ""
995
 
996
- #: bp-blogs/bp-blogs-template.php:602
997
  msgid "%s's Recent Posts"
998
  msgstr ""
999
 
1000
- #: bp-blogs/bp-blogs-template.php:603
1001
  msgid "%s's Recent Comments"
1002
  msgstr ""
1003
 
1004
- #: bp-blogs/bp-blogs-template.php:617 bp-core/deprecated/1.5.php:397
1005
- #: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2292
1006
- #: bp-members/bp-members-template.php:668
1007
- #: bp-messages/bp-messages-template.php:373 bp-themes/bp-default/header.php:30
1008
  #: bp-themes/bp-default/searchform.php:5
1009
  msgid "Search"
1010
  msgstr ""
1011
 
1012
- #: bp-blogs/bp-blogs-template.php:650 bp-blogs/bp-blogs-template.php:651
1013
  msgid "Visit Site"
1014
  msgstr ""
1015
 
1016
  #: bp-blogs/bp-blogs-widgets.php:25
1017
- msgid "Recent Networkwide Posts"
 
1018
  msgstr ""
1019
 
1020
  #: bp-blogs/bp-blogs-widgets.php:67
@@ -1026,217 +1086,241 @@ msgid "Max posts to show:"
1026
  msgstr ""
1027
 
1028
  #: bp-core/admin/bp-core-components.php:26
1029
- #: bp-core/admin/bp-core-functions.php:365 bp-core/admin/bp-core-update.php:57
1030
- #: bp-core/admin/bp-core-update.php:69 bp-core/admin/bp-core-update.php:201
1031
  msgid "Components"
1032
  msgstr ""
1033
 
1034
  #: bp-core/admin/bp-core-components.php:32
 
1035
  msgid "Save Settings"
1036
  msgstr ""
1037
 
1038
- #: bp-core/admin/bp-core-components.php:67
 
1039
  #: bp-xprofile/bp-xprofile-loader.php:41
1040
  msgid "Extended Profiles"
1041
  msgstr ""
1042
 
1043
- #: bp-core/admin/bp-core-components.php:68
 
1044
  msgid "Customize your community with fully editable profile fields that allow your users to describe themselves."
1045
  msgstr ""
1046
 
1047
- #: bp-core/admin/bp-core-components.php:71
1048
- msgid "Account Settings"
1049
- msgstr ""
 
 
 
1050
 
1051
- #: bp-core/admin/bp-core-components.php:72
1052
- msgid "Allow your users to modify their account and notification settings directly from within their profiles."
1053
- msgstr ""
 
 
1054
 
1055
- #: bp-core/admin/bp-core-components.php:75 bp-friends/bp-friends-loader.php:24
1056
- msgid "Friend Connections"
1057
- msgstr ""
 
 
1058
 
1059
- #: bp-core/admin/bp-core-components.php:76
1060
- msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most."
1061
- msgstr ""
 
 
1062
 
1063
- #: bp-core/admin/bp-core-components.php:79
1064
- msgid "Private Messaging"
 
 
 
 
 
 
 
1065
  msgstr ""
1066
 
1067
- #: bp-core/admin/bp-core-components.php:80
1068
- msgid "Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members."
 
1069
  msgstr ""
1070
 
1071
- #: bp-core/admin/bp-core-components.php:84
1072
- msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support."
1073
  msgstr ""
1074
 
1075
- #: bp-core/admin/bp-core-components.php:87 bp-groups/bp-groups-loader.php:83
1076
- msgid "User Groups"
1077
  msgstr ""
1078
 
1079
- #: bp-core/admin/bp-core-components.php:88
1080
- msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings."
1081
  msgstr ""
1082
 
1083
- #: bp-core/admin/bp-core-components.php:91 bp-forums/bp-forums-loader.php:25
1084
- msgid "Discussion Forums"
1085
  msgstr ""
1086
 
1087
- #: bp-core/admin/bp-core-components.php:92
1088
- msgid "Site-wide and Group forums allow for focused, bulletin-board style conversations. Powered by bbPress."
1089
  msgstr ""
1090
 
1091
- #: bp-core/admin/bp-core-components.php:96
1092
- msgid "Record activity for new posts and comments from your site."
1093
  msgstr ""
1094
 
1095
- #: bp-core/admin/bp-core-components.php:102
1096
- msgid "Record activity for new sites, posts, and comments across your network."
 
 
1097
  msgstr ""
1098
 
1099
- #: bp-core/admin/bp-core-components.php:108 bp-core/bp-core-loader.php:27
1100
- msgid "BuddyPress Core"
1101
  msgstr ""
1102
 
1103
- #: bp-core/admin/bp-core-components.php:109
1104
- msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
1105
  msgstr ""
1106
 
1107
- #: bp-core/admin/bp-core-components.php:112
1108
- msgid "Community Members"
1109
  msgstr ""
1110
 
1111
- #: bp-core/admin/bp-core-components.php:113
1112
- msgid "Everything in a BuddyPress community revolves around its members."
1113
  msgstr ""
1114
 
1115
- #: bp-core/admin/bp-core-components.php:179
1116
- msgid "Available Components"
1117
  msgstr ""
1118
 
1119
- #: bp-core/admin/bp-core-components.php:181
1120
- msgid "Each component has a unique purpose, and your community may not need each one."
1121
  msgstr ""
1122
 
1123
- #: bp-core/admin/bp-core-components.php:186
1124
- msgctxt "plugins"
1125
- msgid "All <span class=\"count\">(%s)</span>"
1126
- msgid_plural "All <span class=\"count\">(%s)</span>"
1127
- msgstr[0] ""
1128
- msgstr[1] ""
1129
 
1130
- #: bp-core/admin/bp-core-components.php:187
1131
- msgid "Active <span class=\"count\">(%s)</span>"
1132
- msgid_plural "Active <span class=\"count\">(%s)</span>"
1133
- msgstr[0] ""
1134
- msgstr[1] ""
1135
 
1136
- #: bp-core/admin/bp-core-components.php:188
1137
- msgid "Inactive <span class=\"count\">(%s)</span>"
1138
- msgid_plural "Inactive <span class=\"count\">(%s)</span>"
1139
- msgstr[0] ""
1140
- msgstr[1] ""
1141
 
1142
- #: bp-core/admin/bp-core-components.php:189
1143
- msgid "Must-Use <span class=\"count\">(%s)</span>"
1144
- msgid_plural "Must-Use <span class=\"count\">(%s)</span>"
1145
- msgstr[0] ""
1146
- msgstr[1] ""
1147
 
1148
- #: bp-core/admin/bp-core-components.php:196
1149
- #: bp-core/admin/bp-core-components.php:204
1150
- msgid "Component"
1151
  msgstr ""
1152
 
1153
- #: bp-core/admin/bp-core-components.php:197
1154
- #: bp-core/admin/bp-core-components.php:205
1155
- msgid "Description"
1156
  msgstr ""
1157
 
1158
- #: bp-core/admin/bp-core-components.php:230
1159
- msgid "Select %s"
1160
  msgstr ""
1161
 
1162
- #: bp-core/admin/bp-core-components.php:255
1163
- msgid "No components found."
1164
  msgstr ""
1165
 
1166
- #: bp-core/admin/bp-core-functions.php:113
1167
  msgid "Why have all my BuddyPress menus disappeared?"
1168
  msgstr ""
1169
 
1170
- #: bp-core/admin/bp-core-functions.php:115
1171
  msgid "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated."
1172
  msgstr ""
1173
 
1174
- #: bp-core/admin/bp-core-functions.php:116
1175
  msgid "Components, Pages, Settings, and Forums, have been moved to <a href=\"%s\">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href=\"%s\">Users</a> menu."
1176
  msgstr ""
1177
 
1178
- #: bp-core/admin/bp-core-functions.php:234
1179
  msgid "<strong>BuddyPress is almost ready</strong>. You must <a href=\"%s\">update your permalink structure</a> to something other than the default for it to work."
1180
  msgstr ""
1181
 
1182
- #: bp-core/admin/bp-core-functions.php:253
1183
- msgid "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>."
1184
- msgstr ""
1185
-
1186
- #: bp-core/admin/bp-core-functions.php:278 bp-core/admin/bp-core-slugs.php:139
1187
- #: bp-core/admin/bp-core-update.php:439
1188
- #: bp-messages/bp-messages-template.php:564
1189
- #: bp-themes/bp-default/registration/activate.php:36
1190
  msgid "Activate"
1191
  msgstr ""
1192
 
1193
- #: bp-core/admin/bp-core-functions.php:283 bp-core/admin/bp-core-slugs.php:138
1194
- #: bp-core/admin/bp-core-update.php:425 bp-members/bp-members-adminbar.php:60
1195
  msgid "Register"
1196
  msgstr ""
1197
 
1198
- #: bp-core/admin/bp-core-functions.php:304
1199
  msgid "The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
1200
  msgstr ""
1201
 
1202
- #: bp-core/admin/bp-core-functions.php:329
1203
  msgid "Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
1204
  msgstr ""
1205
 
1206
- #: bp-core/admin/bp-core-functions.php:342
1207
- msgid "IMPORTANT: <a href=\"http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/\">Read this before attempting to update BuddyPress</a>"
1208
- msgstr ""
1209
-
1210
- #: bp-core/admin/bp-core-functions.php:369 bp-core/admin/bp-core-slugs.php:26
1211
- #: bp-core/admin/bp-core-update.php:58 bp-core/admin/bp-core-update.php:70
1212
- #: bp-core/admin/bp-core-update.php:205
1213
  msgid "Pages"
1214
  msgstr ""
1215
 
1216
- #: bp-core/admin/bp-core-functions.php:373
1217
- #: bp-core/admin/bp-core-settings.php:258 bp-core/bp-core-admin.php:374
1218
- #: bp-groups/bp-groups-loader.php:298 bp-groups/bp-groups-template.php:1276
1219
- #: bp-settings/bp-settings-loader.php:23 bp-settings/bp-settings-loader.php:78
1220
- #: bp-settings/bp-settings-loader.php:169
1221
  msgid "Settings"
1222
  msgstr ""
1223
 
1224
- #: bp-core/admin/bp-core-functions.php:381 bp-core/admin/bp-core-update.php:409
1225
- #: bp-core/bp-core-template.php:266 bp-forums/bp-forums-admin.php:14
1226
- #: bp-forums/bp-forums-admin.php:47 bp-forums/bp-forums-admin.php:314
1227
- #: bp-forums/bp-forums-loader.php:111 bp-forums/bp-forums-loader.php:190
1228
- #: bp-forums/bp-forums-loader.php:233 bp-forums/deprecated/1.6.php:24
1229
- msgid "Forums"
1230
  msgstr ""
1231
 
1232
- #: bp-core/admin/bp-core-schema.php:247
1233
- msgctxt "First XProfile group name"
1234
- msgid "Base"
1235
  msgstr ""
1236
 
1237
- #: bp-core/admin/bp-core-schema.php:251
1238
- msgctxt "XProfile fullname field name"
1239
- msgid "Name"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1240
  msgstr ""
1241
 
1242
  #: bp-core/admin/bp-core-settings.php:31
@@ -1291,728 +1375,652 @@ msgstr ""
1291
  msgid "Absolute path to your bbPress configuration file."
1292
  msgstr ""
1293
 
1294
- #: bp-core/admin/bp-core-settings.php:267
1295
- #: bp-themes/bp-default/groups/single/admin.php:32
1296
- #: bp-themes/bp-default/groups/single/admin.php:117
1297
- #: bp-themes/bp-default/groups/single/forum/edit.php:58
1298
- #: bp-themes/bp-default/groups/single/forum/edit.php:74
1299
- #: bp-themes/bp-default/members/single/profile/edit.php:146
1300
- #: bp-themes/bp-default/members/single/settings/general.php:72
1301
- #: bp-themes/bp-default/members/single/settings/notifications.php:61
1302
- #: bp-xprofile/bp-xprofile-classes.php:363
1303
- msgid "Save Changes"
1304
- msgstr ""
1305
-
1306
- #: bp-core/admin/bp-core-slugs.php:32
1307
- msgid "Save All"
1308
- msgstr ""
1309
-
1310
- #: bp-core/admin/bp-core-slugs.php:82
1311
  msgid "Directories"
1312
  msgstr ""
1313
 
1314
- #: bp-core/admin/bp-core-slugs.php:84
1315
  msgid "Associate a WordPress Page with each BuddyPress component directory."
1316
  msgstr ""
1317
 
1318
- #: bp-core/admin/bp-core-slugs.php:103 bp-core/admin/bp-core-slugs.php:164
1319
  msgid "- None -"
1320
  msgstr ""
1321
 
1322
- #: bp-core/admin/bp-core-slugs.php:107 bp-core/admin/bp-core-slugs.php:168
1323
  msgid "New Page"
1324
  msgstr ""
1325
 
1326
- #: bp-core/admin/bp-core-slugs.php:108 bp-core/admin/bp-core-slugs.php:169
 
1327
  #: bp-themes/bp-default/members/single/settings/capabilities.php:61
1328
- #: bp-xprofile/bp-xprofile-classes.php:912
 
1329
  msgid "Save"
1330
  msgstr ""
1331
 
1332
- #: bp-core/admin/bp-core-slugs.php:146
1333
  msgid "Registration"
1334
  msgstr ""
1335
 
1336
- #: bp-core/admin/bp-core-slugs.php:148
1337
  msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
1338
  msgstr ""
1339
 
1340
- #: bp-core/admin/bp-core-update.php:59 bp-core/admin/bp-core-update.php:209
1341
- msgid "Permalinks"
 
1342
  msgstr ""
1343
 
1344
- #: bp-core/admin/bp-core-update.php:60 bp-core/admin/bp-core-update.php:213
1345
- msgid "Theme"
 
1346
  msgstr ""
1347
 
1348
- #: bp-core/admin/bp-core-update.php:61 bp-core/admin/bp-core-update.php:80
1349
- #: bp-core/admin/bp-core-update.php:178 bp-core/admin/bp-core-update.php:221
1350
- #: bp-themes/bp-default/groups/create.php:289
1351
- msgid "Finish"
1352
  msgstr ""
1353
 
1354
- #: bp-core/admin/bp-core-update.php:75 bp-core/admin/bp-core-update.php:217
1355
- #: bp-core/bp-core-admin.php:286 bp-core/bp-core-admin.php:291
1356
- msgid "Toolbar"
1357
  msgstr ""
1358
 
1359
- #: bp-core/admin/bp-core-update.php:78 bp-core/admin/bp-core-update.php:197
1360
- msgid "Database Update"
1361
  msgstr ""
1362
 
1363
- #: bp-core/admin/bp-core-update.php:135
1364
- msgid "Setup"
1365
  msgstr ""
1366
 
1367
- #: bp-core/admin/bp-core-update.php:143
1368
- msgid "BuddyPress %s"
1369
  msgstr ""
1370
 
1371
- #: bp-core/admin/bp-core-update.php:181
1372
- msgid "Finish &amp; Activate"
1373
  msgstr ""
1374
 
1375
- #: bp-core/admin/bp-core-update.php:187
1376
- msgid "Save &amp; Next"
1377
  msgstr ""
1378
 
1379
- #: bp-core/admin/bp-core-update.php:238
1380
- msgid "To complete the update, a few changes need to be made to your database. These changes are not destructive and will not remove or change any existing settings."
1381
  msgstr ""
1382
 
1383
- #: bp-core/admin/bp-core-update.php:256
1384
- msgid "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future."
1385
  msgstr ""
1386
 
1387
- #: bp-core/admin/bp-core-update.php:298
1388
- msgid "members"
1389
  msgstr ""
1390
 
1391
- #: bp-core/admin/bp-core-update.php:301
1392
- msgid "groups"
1393
  msgstr ""
1394
 
1395
- #: bp-core/admin/bp-core-update.php:304
1396
- msgid "activity"
1397
  msgstr ""
1398
 
1399
- #: bp-core/admin/bp-core-update.php:307
1400
- msgid "forums"
1401
  msgstr ""
1402
 
1403
- #: bp-core/admin/bp-core-update.php:310
1404
- msgid "blogs"
1405
  msgstr ""
1406
 
1407
- #: bp-core/admin/bp-core-update.php:313
1408
- msgid "register"
1409
  msgstr ""
1410
 
1411
- #: bp-core/admin/bp-core-update.php:316
1412
- msgid "activate"
1413
  msgstr ""
1414
 
1415
- #: bp-core/admin/bp-core-update.php:328
1416
- msgid "BuddyPress uses WordPress pages to display directories. This allows you to easily change their titles and relocate them."
1417
  msgstr ""
1418
 
1419
- #: bp-core/admin/bp-core-update.php:330
1420
- msgid "Choose an existing page, have one auto-created, or create them manually and come back here once you are finished."
1421
  msgstr ""
1422
 
1423
- #: bp-core/admin/bp-core-update.php:336 bp-core/bp-core-template.php:257
1424
- #: bp-core/bp-core-widgets.php:19 bp-core/bp-core-widgets.php:111
1425
- #: bp-groups/bp-groups-template.php:1284 bp-members/bp-members-loader.php:24
1426
- #: bp-themes/bp-default/groups/single/admin.php:231
1427
- msgid "Members"
1428
  msgstr ""
1429
 
1430
- #: bp-core/admin/bp-core-update.php:337
1431
- msgid "Displays member profiles, and a directory of all site members."
1432
  msgstr ""
1433
 
1434
- #: bp-core/admin/bp-core-update.php:340 bp-core/admin/bp-core-update.php:358
1435
- #: bp-core/admin/bp-core-update.php:377 bp-core/admin/bp-core-update.php:395
1436
- #: bp-core/admin/bp-core-update.php:413 bp-core/admin/bp-core-update.php:429
1437
- #: bp-core/admin/bp-core-update.php:443
1438
- msgid "Automatically create a page at:"
1439
  msgstr ""
1440
 
1441
- #: bp-core/admin/bp-core-update.php:342 bp-core/admin/bp-core-update.php:360
1442
- #: bp-core/admin/bp-core-update.php:379 bp-core/admin/bp-core-update.php:397
1443
- #: bp-core/admin/bp-core-update.php:415 bp-core/admin/bp-core-update.php:431
1444
- #: bp-core/admin/bp-core-update.php:445
1445
- msgid "- Select -"
1446
  msgstr ""
1447
 
1448
- #: bp-core/admin/bp-core-update.php:344 bp-core/admin/bp-core-update.php:361
1449
- #: bp-core/admin/bp-core-update.php:380 bp-core/admin/bp-core-update.php:398
1450
- #: bp-core/admin/bp-core-update.php:416 bp-core/admin/bp-core-update.php:432
1451
- #: bp-core/admin/bp-core-update.php:446
1452
- msgid "Use an existing page:"
1453
  msgstr ""
1454
 
1455
- #: bp-core/admin/bp-core-update.php:355
1456
- msgid "Displays individual groups as well as a directory of groups."
1457
  msgstr ""
1458
 
1459
- #: bp-core/admin/bp-core-update.php:373 bp-core/bp-core-template.php:263
1460
- msgid "Blogs"
1461
  msgstr ""
1462
 
1463
- #: bp-core/admin/bp-core-update.php:374
1464
- msgid "Displays a directory of the blogs in your network."
1465
  msgstr ""
1466
 
1467
- #: bp-core/admin/bp-core-update.php:392
1468
- msgid "Displays the activity for the entire site, a member's friends, groups and @mentions."
1469
  msgstr ""
1470
 
1471
- #: bp-core/admin/bp-core-update.php:410
1472
- msgid "Displays a directory of public forum topics."
1473
  msgstr ""
1474
 
1475
- #: bp-core/admin/bp-core-update.php:426
1476
- msgid "Displays a site registration page where users can create new accounts."
 
 
 
 
 
1477
  msgstr ""
1478
 
1479
- #: bp-core/admin/bp-core-update.php:440
1480
- msgid "The page users will visit to activate their account once they have registered."
1481
  msgstr ""
1482
 
1483
- #: bp-core/admin/bp-core-update.php:473
1484
- msgid "Your permalink settings are compatible with BuddyPress."
1485
  msgstr ""
1486
 
1487
- #: bp-core/admin/bp-core-update.php:475
1488
- msgid "Pretty permalinks must be active on your site."
1489
  msgstr ""
1490
 
1491
- #: bp-core/admin/bp-core-update.php:481
1492
- msgid "For more advanced options please visit the <a href=\"%s\">permalink settings page</a> now and come back here later."
1493
  msgstr ""
1494
 
1495
- #: bp-core/admin/bp-core-update.php:485
1496
- msgid "Day and name"
1497
  msgstr ""
1498
 
1499
- #: bp-core/admin/bp-core-update.php:489
1500
- msgid "Month and name"
1501
  msgstr ""
1502
 
1503
- #: bp-core/admin/bp-core-update.php:493
1504
- msgid "Numeric"
1505
  msgstr ""
1506
 
1507
- #: bp-core/admin/bp-core-update.php:559
1508
- msgid "Use BuddyPress Default"
1509
  msgstr ""
1510
 
1511
- #: bp-core/admin/bp-core-update.php:560
1512
- msgid "BuddyPress Default"
1513
  msgstr ""
1514
 
1515
- #: bp-core/admin/bp-core-update.php:563
1516
- msgid "The default BuddyPress theme comes with the basics, to get up and running out of the box. It supports all features and is highly customizable."
1517
  msgstr ""
1518
 
1519
- #: bp-core/admin/bp-core-update.php:564
1520
- msgid "This is the best choice if you want to start using BuddyPress immediately."
1521
  msgstr ""
1522
 
1523
- #: bp-core/admin/bp-core-update.php:565
1524
- msgid "Yes, please!"
1525
  msgstr ""
1526
 
1527
- #: bp-core/admin/bp-core-update.php:573
1528
- msgid "Other themes"
1529
  msgstr ""
1530
 
1531
- #: bp-core/admin/bp-core-update.php:574
1532
- msgid "A BuddyPress theme"
1533
  msgstr ""
1534
 
1535
- #: bp-core/admin/bp-core-update.php:577
1536
- msgid "You have some other BuddyPress compatible themes available. Pick one of them from this list to use it."
1537
  msgstr ""
1538
 
1539
- #: bp-core/admin/bp-core-update.php:580
1540
- msgid "Use this theme"
1541
  msgstr ""
1542
 
1543
- #: bp-core/admin/bp-core-update.php:601
1544
- msgid "Manually update current theme"
1545
  msgstr ""
1546
 
1547
- #: bp-core/admin/bp-core-update.php:605
1548
- msgid "Your existing theme"
1549
  msgstr ""
1550
 
1551
- #: bp-core/admin/bp-core-update.php:611
1552
- msgid "The BuddyPress Template Pack will guide you through the process of manually editing your existing theme. It comes with a step-by-step guide and involves copying the BuddyPress template files into your theme. <strong>This option requires knowledge of CSS and HTML.</strong> You will need to tweak the new templates to match your existing theme."
1553
  msgstr ""
1554
 
1555
- #: bp-core/admin/bp-core-update.php:615
1556
- msgid "Install BuddyPress Template Pack"
1557
  msgstr ""
1558
 
1559
- #: bp-core/admin/bp-core-update.php:619
1560
- msgid "Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)"
1561
  msgstr ""
1562
 
1563
- #: bp-core/admin/bp-core-update.php:620
1564
- msgid "Plugin Installed"
1565
  msgstr ""
1566
 
1567
- #: bp-core/admin/bp-core-update.php:631
1568
- msgid "Do not change theme"
1569
  msgstr ""
1570
 
1571
- #: bp-core/admin/bp-core-update.php:634
1572
- msgid "You are happy with your current theme and plan on changing it later."
1573
  msgstr ""
1574
 
1575
- #: bp-core/admin/bp-core-update.php:635
1576
- msgid "This is the best choice if you have a custom theme already and want to manually integrate BuddyPress later."
1577
  msgstr ""
1578
 
1579
- #: bp-core/admin/bp-core-update.php:637
1580
- msgid "Don't change my current theme"
1581
  msgstr ""
1582
 
1583
- #: bp-core/admin/bp-core-update.php:662
1584
- msgid "BuddyPress now uses the WordPress Toolbar; we've turbo-charged it by adding social items to help your users explore your site and manage their content."
1585
  msgstr ""
1586
 
1587
- #: bp-core/admin/bp-core-update.php:664
1588
- msgid "We've noticed that your site uses the old bar from earlier versions of BuddyPress."
1589
  msgstr ""
1590
 
1591
- #: bp-core/admin/bp-core-update.php:669
1592
- msgid "If you'd prefer to not switch to the WordPress Toolbar just yet, check this box. Don't worry, you can change your mind later."
1593
  msgstr ""
1594
 
1595
- #: bp-core/admin/bp-core-update.php:687
1596
- msgid "setup"
1597
  msgstr ""
1598
 
1599
- #: bp-core/admin/bp-core-update.php:687
1600
- msgid "update"
1601
  msgstr ""
1602
 
1603
- #: bp-core/admin/bp-core-update.php:689
1604
- msgid "The BuddyPress %1$s is complete, and your site is ready to go!"
1605
  msgstr ""
1606
 
1607
- #: bp-core/admin/bp-core-update.php:826
1608
- msgid "Oops, there was a problem creating a configuration file. "
1609
  msgstr ""
1610
 
1611
- #: bp-core/admin/bp-core-update.php:832
1612
- msgid "If your <code>web.config</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code> element in <code>web.config</code> file."
1613
  msgstr ""
1614
 
1615
- #: bp-core/admin/bp-core-update.php:841
1616
- msgid "Permalink structure updated. Remove write access on web.config file now!"
1617
  msgstr ""
1618
 
1619
- #: bp-core/admin/bp-core-update.php:846
1620
- msgid "If your <code>.htaccess</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all."
1621
  msgstr ""
1622
 
1623
- #: bp-core/admin/bp-core-update.php:858
1624
- msgid "Paste all these rules into a new <code>.htaccess</code> file in the root of your WordPress installation and save the file. Once you're done, please hit the \"Save and Next\" button to continue."
1625
  msgstr ""
1626
 
1627
- #: bp-core/bp-core-admin.php:192
1628
- msgid "BuddyPress Setup"
1629
  msgstr ""
1630
 
1631
- #: bp-core/bp-core-admin.php:194
1632
- msgid "Update BuddyPress"
1633
  msgstr ""
1634
 
1635
- #: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:217
1636
- #: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:1310
1637
- msgid "BuddyPress"
1638
  msgstr ""
1639
 
1640
- #: bp-core/bp-core-admin.php:226
1641
- msgid "BuddyPress Help"
1642
  msgstr ""
1643
 
1644
- #: bp-core/bp-core-admin.php:227
1645
- msgid "Help"
1646
  msgstr ""
1647
 
1648
- #: bp-core/bp-core-admin.php:236
1649
- msgid "BuddyPress Components"
 
 
1650
  msgstr ""
1651
 
1652
- #: bp-core/bp-core-admin.php:245 bp-core/bp-core-admin.php:246
1653
- msgid "BuddyPress Pages"
1654
  msgstr ""
1655
 
1656
- #: bp-core/bp-core-admin.php:254 bp-core/bp-core-admin.php:255
1657
- msgid "BuddyPress Settings"
1658
  msgstr ""
1659
 
1660
- #: bp-core/bp-core-admin.php:283
1661
- msgid "Main Settings"
1662
  msgstr ""
1663
 
1664
- #: bp-core/bp-core-admin.php:296
1665
- msgid "Account Deletion"
 
1666
  msgstr ""
1667
 
1668
- #: bp-core/bp-core-admin.php:304
1669
- msgid "Profile Settings"
1670
  msgstr ""
1671
 
1672
- #: bp-core/bp-core-admin.php:307
1673
- msgid "Avatar Uploads"
1674
  msgstr ""
1675
 
1676
- #: bp-core/bp-core-admin.php:311
1677
- msgid "Profile Syncing"
1678
  msgstr ""
1679
 
1680
- #: bp-core/bp-core-admin.php:320
1681
- msgid "Groups Settings"
1682
  msgstr ""
1683
 
1684
- #: bp-core/bp-core-admin.php:323
1685
- msgid "Group Creation"
 
1686
  msgstr ""
1687
 
1688
- #: bp-core/bp-core-admin.php:332
1689
- msgid "Forums Settings"
1690
  msgstr ""
1691
 
1692
- #: bp-core/bp-core-admin.php:335
1693
- msgid "bbPress Configuration"
1694
  msgstr ""
1695
 
1696
- #: bp-core/bp-core-admin.php:344
1697
- msgid "Activity Settings"
1698
- msgstr ""
 
 
1699
 
1700
- #: bp-core/bp-core-admin.php:347
1701
- msgid "Blog &amp; Forum Comments"
1702
  msgstr ""
1703
 
1704
- #: bp-core/bp-core-admin.php:352
1705
- msgid "Akismet"
1706
  msgstr ""
1707
 
1708
- #: bp-core/bp-core-admin.php:482
1709
- msgid "BuddyPress has been updated! Please run the <a href=\"%s\">update wizard</a>."
 
 
 
 
 
 
 
 
 
1710
  msgstr ""
1711
 
1712
- #: bp-core/bp-core-admin.php:487
1713
- msgid "BuddyPress was successfully activated! Please run the <a href=\"%s\">installation wizard</a>."
1714
  msgstr ""
1715
 
1716
- #: bp-core/bp-core-adminbar.php:36 bp-core/bp-core-buddybar.php:495
1717
- msgid "My Account"
 
 
 
 
1718
  msgstr ""
1719
 
1720
- #: bp-core/bp-core-avatars.php:221
1721
- msgid "Avatar Image"
1722
  msgstr ""
1723
 
1724
- #: bp-core/bp-core-avatars.php:481
1725
- msgid "There is no error, the file uploaded with success"
 
1726
  msgstr ""
1727
 
1728
- #: bp-core/bp-core-avatars.php:482 bp-core/bp-core-avatars.php:483
1729
- msgid "Your image was bigger than the maximum allowed file size of: "
1730
- msgstr ""
1731
 
1732
- #: bp-core/bp-core-avatars.php:484
1733
- msgid "The uploaded file was only partially uploaded"
1734
  msgstr ""
1735
 
1736
- #: bp-core/bp-core-avatars.php:485
1737
- msgid "No file was uploaded"
1738
- msgstr ""
1739
 
1740
- #: bp-core/bp-core-avatars.php:486
1741
- msgid "Missing a temporary folder"
1742
  msgstr ""
1743
 
1744
- #: bp-core/bp-core-avatars.php:490
1745
- msgid "Your upload failed, please try again. Error was: %s"
1746
  msgstr ""
1747
 
1748
- #: bp-core/bp-core-avatars.php:495
1749
- msgid "The file you uploaded is too big. Please upload a file under %s"
 
1750
  msgstr ""
1751
 
1752
- #: bp-core/bp-core-avatars.php:500
1753
- msgid "Please upload only JPG, GIF or PNG photos."
 
1754
  msgstr ""
1755
 
1756
- #: bp-core/bp-core-avatars.php:511 bp-core/bp-core-avatars.php:546
1757
- msgid "Upload Failed! Error was: %s"
1758
- msgstr ""
1759
-
1760
- #: bp-core/bp-core-avatars.php:564
1761
- msgid "Upload failed! Error was: %s"
1762
- msgstr ""
1763
-
1764
- #: bp-core/bp-core-avatars.php:699 bp-core/bp-core-classes.php:174
1765
- #: bp-core/bp-core-classes.php:175 bp-core/bp-core-classes.php:176
1766
- #: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107
1767
- msgid "Avatar of %s"
1768
- msgstr ""
1769
-
1770
- #: bp-core/bp-core-buddybar.php:303
1771
- msgid "You do not have access to this page."
1772
- msgstr ""
1773
-
1774
- #: bp-core/bp-core-buddybar.php:479 bp-themes/bp-default/sidebar.php:53
1775
- msgid "Log In"
1776
- msgstr ""
1777
-
1778
- #: bp-core/bp-core-buddybar.php:483
1779
- msgid "Sign Up"
1780
- msgstr ""
1781
-
1782
- #: bp-core/bp-core-buddybar.php:537 bp-core/deprecated/1.5.php:287
1783
- #: bp-members/bp-members-template.php:732 bp-themes/bp-default/sidebar.php:18
1784
- msgid "Log Out"
1785
- msgstr ""
1786
-
1787
- #: bp-core/bp-core-buddybar.php:566
1788
- msgid "Visit"
1789
- msgstr ""
1790
-
1791
- #: bp-core/bp-core-buddybar.php:568
1792
- msgid "Random Member"
1793
- msgstr ""
1794
-
1795
- #: bp-core/bp-core-buddybar.php:572
1796
- msgid "Random Group"
1797
- msgstr ""
1798
-
1799
- #: bp-core/bp-core-buddybar.php:578
1800
- msgid "Random Site"
1801
- msgstr ""
1802
-
1803
- #: bp-core/bp-core-catchuri.php:281
1804
- msgid "This user has been marked as a spammer. Only site admins can view this profile."
1805
- msgstr ""
1806
-
1807
- #: bp-core/bp-core-catchuri.php:455 bp-core/bp-core-catchuri.php:514
1808
- msgid "You must log in to access the page you requested."
1809
- msgstr ""
1810
-
1811
- #: bp-core/bp-core-classes.php:191
1812
- msgid "%d group"
1813
- msgid_plural "%d groups"
1814
- msgstr[0] ""
1815
- msgstr[1] ""
1816
-
1817
- #: bp-core/bp-core-filters.php:178 bp-core/bp-core-filters.php:203
1818
- msgid "[User Set]"
1819
- msgstr ""
1820
-
1821
- #: bp-core/bp-core-filters.php:222
1822
- msgid ""
1823
- "Thanks for registering! To complete the activation of your account and blog, please click the following link:\n"
1824
- "\n"
1825
- "%1$s\n"
1826
- "\n"
1827
- "\n"
1828
- "\n"
1829
- "After you activate, you can visit your blog here:\n"
1830
- "\n"
1831
- "%2$s"
1832
- msgstr ""
1833
-
1834
- #: bp-core/bp-core-filters.php:223
1835
- msgid "Activate %s"
1836
- msgstr ""
1837
-
1838
- #: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:1312
1839
- msgid ""
1840
- "Thanks for registering! To complete the activation of your account please click the following link:\n"
1841
- "\n"
1842
- "%1$s\n"
1843
- "\n"
1844
- msgstr ""
1845
-
1846
- #: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:1313
1847
- msgid "Activate Your Account"
1848
  msgstr ""
1849
 
1850
- #. translators: "displayed user's name | canonicalised component name"
1851
- #. translators: "group name | group nav section name"
1852
-
1853
- #: bp-core/bp-core-filters.php:313 bp-core/bp-core-filters.php:319
1854
- msgid "%1$s | %2$s"
1855
  msgstr ""
1856
 
1857
- #. translators: "component item name | component nav section name | root
1858
- #. component name"
1859
-
1860
- #: bp-core/bp-core-filters.php:324
1861
- msgid "%1$s | %2$s | %3$s"
1862
  msgstr ""
1863
 
1864
- #: bp-core/bp-core-filters.php:329 bp-core/bp-core-filters.php:331
1865
- msgid "%s Directory"
 
1866
  msgstr ""
1867
 
1868
- #: bp-core/bp-core-filters.php:336
1869
- #: bp-themes/bp-default/registration/register.php:23
1870
- msgid "Create an Account"
1871
  msgstr ""
1872
 
1873
- #: bp-core/bp-core-filters.php:340
1874
- #: bp-themes/bp-default/registration/activate.php:24
1875
- msgid "Activate your Account"
1876
  msgstr ""
1877
 
1878
- #: bp-core/bp-core-filters.php:344 bp-themes/bp-default/groups/create.php:18
1879
- #: bp-themes/bp-default/groups/index.php:21
1880
- msgid "Create a Group"
1881
  msgstr ""
1882
 
1883
- #: bp-core/bp-core-functions.php:384
1884
  msgid "sometime"
1885
  msgstr ""
1886
 
1887
- #: bp-core/bp-core-functions.php:385
1888
  msgid "right now"
1889
  msgstr ""
1890
 
1891
- #: bp-core/bp-core-functions.php:386
1892
  msgid "%s ago"
1893
  msgstr ""
1894
 
1895
- #: bp-core/bp-core-functions.php:390
1896
  msgid "year"
1897
  msgstr ""
1898
 
1899
- #: bp-core/bp-core-functions.php:390
1900
  msgid "years"
1901
  msgstr ""
1902
 
1903
- #: bp-core/bp-core-functions.php:391
1904
  msgid "month"
1905
  msgstr ""
1906
 
1907
- #: bp-core/bp-core-functions.php:391
1908
  msgid "months"
1909
  msgstr ""
1910
 
1911
- #: bp-core/bp-core-functions.php:392
1912
  msgid "week"
1913
  msgstr ""
1914
 
1915
- #: bp-core/bp-core-functions.php:392
1916
  msgid "weeks"
1917
  msgstr ""
1918
 
1919
- #: bp-core/bp-core-functions.php:393
1920
  msgid "day"
1921
  msgstr ""
1922
 
1923
- #: bp-core/bp-core-functions.php:393
1924
  msgid "days"
1925
  msgstr ""
1926
 
1927
- #: bp-core/bp-core-functions.php:394
1928
  msgid "hour"
1929
  msgstr ""
1930
 
1931
- #: bp-core/bp-core-functions.php:394
1932
  msgid "hours"
1933
  msgstr ""
1934
 
1935
- #: bp-core/bp-core-functions.php:395
1936
  msgid "minute"
1937
  msgstr ""
1938
 
1939
- #: bp-core/bp-core-functions.php:395
1940
  msgid "minutes"
1941
  msgstr ""
1942
 
1943
- #: bp-core/bp-core-functions.php:396
1944
  msgid "second"
1945
  msgstr ""
1946
 
1947
- #: bp-core/bp-core-functions.php:396
1948
  msgid "seconds"
1949
  msgstr ""
1950
 
1951
- #: bp-core/bp-core-functions.php:455
1952
  msgctxt "Separator in time since"
1953
  msgid ","
1954
  msgstr ""
1955
 
1956
- #: bp-core/bp-core-functions.php:523
1957
  msgid "Not recently active"
1958
  msgstr ""
1959
 
1960
- #: bp-core/bp-core-loader.php:211 bp-members/bp-members-loader.php:157
1961
- #: bp-xprofile/bp-xprofile-loader.php:150
1962
- #: bp-xprofile/bp-xprofile-loader.php:214
1963
  msgid "Profile"
1964
  msgstr ""
1965
 
1966
- #: bp-core/bp-core-loader.php:222 bp-groups/bp-groups-template.php:522
1967
- #: bp-members/bp-members-loader.php:171 bp-xprofile/bp-xprofile-loader.php:162
1968
- msgid "Public"
1969
- msgstr ""
1970
-
1971
  #: bp-core/bp-core-template.php:65
1972
  msgid "Options"
1973
  msgstr ""
1974
 
1975
- #: bp-core/bp-core-template.php:202
1976
  msgid "%1$s at %2$s"
1977
  msgstr ""
1978
 
1979
- #: bp-core/bp-core-template.php:268 bp-themes/bp-default/activity/index.php:99
 
 
 
 
 
 
 
 
 
 
 
 
1980
  #: bp-themes/bp-default/forums/forums-loop.php:40
1981
  #: bp-themes/bp-default/members/single/activity.php:27
1982
  msgid "Posts"
1983
  msgstr ""
1984
 
1985
- #: bp-core/bp-core-template.php:271
1986
  msgid "Search these:"
1987
  msgstr ""
1988
 
1989
- #: bp-core/bp-core-template.php:299
1990
  msgid "Search anything..."
1991
  msgstr ""
1992
 
1993
- #: bp-core/bp-core-template.php:393
1994
  msgid " [&hellip;]"
1995
  msgstr ""
1996
 
1997
- #: bp-core/bp-core-widgets.php:18
 
 
 
 
1998
  msgid "A dynamic list of recently active, popular, and newest members"
1999
  msgstr ""
2000
 
 
 
 
 
 
2001
  #: bp-core/bp-core-widgets.php:47 bp-core/bp-core-widgets.php:133
2002
- #: bp-core/deprecated/1.6.php:111 bp-core/deprecated/1.6.php:134
2003
- #: bp-groups/bp-groups-widgets.php:60 bp-groups/bp-groups-widgets.php:141
 
 
2004
  #: bp-themes/bp-default/blogs/index.php:56
2005
  #: bp-themes/bp-default/members/single/blogs.php:22
2006
  msgid "Newest"
2007
  msgstr ""
2008
 
2009
  #: bp-core/bp-core-widgets.php:48 bp-core/bp-core-widgets.php:134
2010
- #: bp-groups/bp-groups-widgets.php:61 bp-groups/bp-groups-widgets.php:142
2011
  msgid "Active"
2012
  msgstr ""
2013
 
2014
  #: bp-core/bp-core-widgets.php:52 bp-core/bp-core-widgets.php:135
2015
- #: bp-groups/bp-groups-widgets.php:62 bp-groups/bp-groups-widgets.php:143
2016
  msgid "Popular"
2017
  msgstr ""
2018
 
@@ -2020,8 +2028,11 @@ msgstr ""
2020
  msgid "No one has signed up yet!"
2021
  msgstr ""
2022
 
2023
- #: bp-core/bp-core-widgets.php:124 bp-core/bp-core-widgets.php:201
2024
- #: bp-core/bp-core-widgets.php:265 bp-groups/bp-groups-widgets.php:132
 
 
 
2025
  #: bp-themes/bp-default/forums/index.php:104
2026
  #: bp-themes/bp-default/groups/single/forum/edit.php:47
2027
  #: bp-themes/bp-default/groups/single/forum.php:75
@@ -2040,288 +2051,161 @@ msgstr ""
2040
  msgid "Default members to show:"
2041
  msgstr ""
2042
 
2043
- #: bp-core/bp-core-widgets.php:149
2044
  msgid "Avatars of users who are currently online"
2045
  msgstr ""
2046
 
2047
- #: bp-core/bp-core-widgets.php:150
2048
- msgid "Who's Online Avatars"
 
2049
  msgstr ""
2050
 
2051
- #: bp-core/bp-core-widgets.php:173
2052
  msgid "There are no users currently online"
2053
  msgstr ""
2054
 
2055
- #: bp-core/bp-core-widgets.php:192
2056
  msgid "Who's Online"
2057
  msgstr ""
2058
 
2059
- #: bp-core/bp-core-widgets.php:203 bp-core/bp-core-widgets.php:267
2060
  msgid "Max Members to show:"
2061
  msgstr ""
2062
 
2063
- #: bp-core/bp-core-widgets.php:213
2064
  msgid "Avatars of recently active members"
2065
  msgstr ""
2066
 
2067
- #: bp-core/bp-core-widgets.php:214
2068
- msgid "Recently Active Member Avatars"
 
2069
  msgstr ""
2070
 
2071
- #: bp-core/bp-core-widgets.php:237
2072
  msgid "There are no recently active members"
2073
  msgstr ""
2074
 
2075
- #: bp-core/bp-core-widgets.php:322
2076
  msgid "There were no members found, please try another filter."
2077
  msgstr ""
2078
 
2079
- #: bp-core/deprecated/1.5.php:135
 
 
2080
  #: bp-themes/bp-default/activity/post-form.php:45
2081
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:8
2082
- #: bp-xprofile/bp-xprofile-loader.php:257
2083
  msgid "My Profile"
2084
  msgstr ""
2085
 
2086
- #: bp-core/deprecated/1.5.php:142 bp-themes/bp-default/functions.php:641
 
 
2087
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:15
2088
  msgid "Name"
2089
  msgstr ""
2090
 
2091
- #: bp-core/deprecated/1.5.php:151
 
2092
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:24
2093
  msgid "About Me"
2094
  msgstr ""
2095
 
2096
- #: bp-core/deprecated/1.5.php:160 bp-themes/bp-default/functions.php:645
 
 
2097
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:33
2098
  msgid "Website"
2099
  msgstr ""
2100
 
2101
- #: bp-core/deprecated/1.5.php:169
 
2102
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:42
2103
  msgid "Jabber"
2104
  msgstr ""
2105
 
2106
- #: bp-core/deprecated/1.5.php:178
 
2107
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:51
2108
  msgid "AOL Messenger"
2109
  msgstr ""
2110
 
2111
- #: bp-core/deprecated/1.5.php:187
 
2112
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:60
2113
  msgid "Yahoo Messenger"
2114
  msgstr ""
2115
 
2116
- #: bp-core/deprecated/1.5.php:335
2117
  msgid "%1$s mentioned you in the group \"%2$s\""
2118
  msgstr ""
2119
 
2120
- #: bp-core/deprecated/1.6.php:110 bp-core/deprecated/1.6.php:131
2121
- #: bp-groups/bp-groups-template.php:2307 bp-groups/bp-groups-template.php:2329
2122
  msgid "Recently Active"
2123
  msgstr ""
2124
 
2125
- #: bp-core/deprecated/1.6.php:112 bp-core/deprecated/1.6.php:137
2126
- #: bp-groups/bp-groups-template.php:2312 bp-groups/bp-groups-template.php:2344
2127
  msgid "Alphabetically"
2128
  msgstr ""
2129
 
2130
- #: bp-forums/bp-forums-admin.php:36 bp-forums/bp-forums-admin.php:128
2131
- msgid "Configure Site Wide Forums"
2132
- msgstr ""
2133
-
2134
- #: bp-forums/bp-forums-admin.php:39 bp-forums/bp-forums-admin.php:131
2135
- #: bp-forums/deprecated/1.6.php:76 bp-forums/deprecated/1.6.php:194
2136
- msgid "Install Site Wide Forums"
2137
- msgstr ""
2138
-
2139
- #: bp-forums/bp-forums-admin.php:52 bp-forums/deprecated/1.6.php:29
2140
- msgid "Settings Saved."
2141
- msgstr ""
2142
-
2143
- #: bp-forums/bp-forums-admin.php:68
2144
- msgid "(Installed)"
2145
- msgstr ""
2146
-
2147
- #: bp-forums/bp-forums-admin.php:68 bp-forums/bp-forums-admin.php:205
2148
- #: bp-forums/deprecated/1.6.php:45 bp-forums/deprecated/1.6.php:162
2149
- msgid "Forums for Groups"
2150
- msgstr ""
2151
-
2152
- #: bp-forums/bp-forums-admin.php:70 bp-forums/bp-forums-admin.php:207
2153
- #: bp-forums/deprecated/1.6.php:47 bp-forums/deprecated/1.6.php:164
2154
- msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas."
2155
- msgstr ""
2156
-
2157
- #: bp-forums/bp-forums-admin.php:71 bp-forums/bp-forums-admin.php:208
2158
- #: bp-forums/deprecated/1.6.php:48 bp-forums/deprecated/1.6.php:165
2159
- msgid "You may use an existing bbPress installation if you have one."
2160
- msgstr ""
2161
-
2162
- #: bp-forums/bp-forums-admin.php:73 bp-forums/bp-forums-admin.php:91
2163
- #: bp-forums/bp-forums-admin.php:210 bp-forums/bp-forums-admin.php:229
2164
- #: bp-forums/deprecated/1.6.php:50 bp-forums/deprecated/1.6.php:68
2165
- #: bp-forums/deprecated/1.6.php:167 bp-forums/deprecated/1.6.php:186
2166
- msgid "Features"
2167
- msgstr ""
2168
-
2169
- #: bp-forums/bp-forums-admin.php:75 bp-forums/bp-forums-admin.php:212
2170
- #: bp-forums/deprecated/1.6.php:52 bp-forums/deprecated/1.6.php:169
2171
- msgid "Group Integration"
2172
- msgstr ""
2173
-
2174
- #: bp-forums/bp-forums-admin.php:76 bp-forums/bp-forums-admin.php:213
2175
- #: bp-forums/deprecated/1.6.php:53 bp-forums/deprecated/1.6.php:170
2176
- msgid "Member Profile Integration"
2177
- msgstr ""
2178
-
2179
- #: bp-forums/bp-forums-admin.php:77 bp-forums/bp-forums-admin.php:95
2180
- #: bp-forums/bp-forums-admin.php:214 bp-forums/bp-forums-admin.php:233
2181
- #: bp-forums/deprecated/1.6.php:54 bp-forums/deprecated/1.6.php:72
2182
- #: bp-forums/deprecated/1.6.php:171 bp-forums/deprecated/1.6.php:190
2183
- msgid "Activity Stream Integration"
2184
- msgstr ""
2185
-
2186
- #: bp-forums/bp-forums-admin.php:78 bp-forums/bp-forums-admin.php:96
2187
- #: bp-forums/bp-forums-admin.php:215 bp-forums/bp-forums-admin.php:234
2188
- #: bp-forums/deprecated/1.6.php:55 bp-forums/deprecated/1.6.php:73
2189
- #: bp-forums/deprecated/1.6.php:172 bp-forums/deprecated/1.6.php:191
2190
- msgid "@ Mention Integration"
2191
- msgstr ""
2192
-
2193
- #: bp-forums/bp-forums-admin.php:82
2194
- msgid "Uninstall Group Forums"
2195
- msgstr ""
2196
-
2197
- #: bp-forums/bp-forums-admin.php:87 bp-forums/bp-forums-admin.php:225
2198
- #: bp-forums/deprecated/1.6.php:64 bp-forums/deprecated/1.6.php:182
2199
- msgid "New! Site Wide Forums"
2200
- msgstr ""
2201
-
2202
- #: bp-forums/bp-forums-admin.php:88 bp-forums/bp-forums-admin.php:226
2203
- #: bp-forums/deprecated/1.6.php:65 bp-forums/deprecated/1.6.php:183
2204
- msgid "Your site will have central forums that are not isolated to any specific group. Choose this if you'd like to have a central forum area for your members."
2205
- msgstr ""
2206
-
2207
- #: bp-forums/bp-forums-admin.php:89 bp-forums/bp-forums-admin.php:227
2208
- #: bp-forums/deprecated/1.6.php:66 bp-forums/deprecated/1.6.php:184
2209
- msgid "You may activate both Group and Site Wide forums, but this may create a poor experience for your members."
2210
- msgstr ""
2211
-
2212
- #: bp-forums/bp-forums-admin.php:93 bp-forums/bp-forums-admin.php:231
2213
- #: bp-forums/deprecated/1.6.php:70 bp-forums/deprecated/1.6.php:188
2214
- msgid "Central Discussion Area"
2215
- msgstr ""
2216
-
2217
- #: bp-forums/bp-forums-admin.php:94 bp-forums/bp-forums-admin.php:232
2218
- #: bp-forums/deprecated/1.6.php:71 bp-forums/deprecated/1.6.php:189
2219
- msgid "Forum Plugins Available"
2220
- msgstr ""
2221
-
2222
- #: bp-forums/bp-forums-admin.php:106
2223
- msgid "Need help deciding between Group Forums and Site Wide Forums? Visit <a href=\"%s\">the BuddyPress codex</a> for more information."
2224
- msgstr ""
2225
-
2226
- #: bp-forums/bp-forums-admin.php:138 bp-forums/deprecated/1.6.php:95
2227
- msgid "The bb-config.php file was not found at that location, please try again."
2228
- msgstr ""
2229
-
2230
- #: bp-forums/bp-forums-admin.php:141 bp-forums/deprecated/1.6.php:98
2231
- msgid "Forums were set up correctly using your existing bbPress install!"
2232
- msgstr ""
2233
-
2234
- #: bp-forums/bp-forums-admin.php:142 bp-forums/deprecated/1.6.php:99
2235
- msgid "BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location."
2236
- msgstr ""
2237
-
2238
- #: bp-forums/bp-forums-admin.php:147 bp-forums/deprecated/1.6.php:104
2239
- msgid "Existing bbPress Installation"
2240
- msgstr ""
2241
-
2242
- #: bp-forums/bp-forums-admin.php:148 bp-forums/deprecated/1.6.php:105
2243
- msgid "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest."
2244
- msgstr ""
2245
-
2246
- #: bp-forums/bp-forums-admin.php:150 bp-forums/bp-forums-admin.php:182
2247
- #: bp-forums/deprecated/1.6.php:107 bp-forums/deprecated/1.6.php:139
2248
- msgid "Complete Installation"
2249
- msgstr ""
2250
-
2251
- #: bp-forums/bp-forums-admin.php:166 bp-forums/deprecated/1.6.php:123
2252
- msgid "<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>"
2253
- msgstr ""
2254
-
2255
- #: bp-forums/bp-forums-admin.php:170 bp-forums/deprecated/1.6.php:127
2256
- msgid "<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>"
2257
- msgstr ""
2258
-
2259
- #: bp-forums/bp-forums-admin.php:179 bp-forums/deprecated/1.6.php:136
2260
- msgid "New bbPress Installation"
2261
- msgstr ""
2262
-
2263
- #: bp-forums/bp-forums-admin.php:180 bp-forums/deprecated/1.6.php:137
2264
- msgid ""
2265
- "You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n"
2266
- "\t\t\t\tprocess. When you're ready, hit the link below."
2267
- msgstr ""
2268
-
2269
- #: bp-forums/bp-forums-admin.php:192 bp-forums/deprecated/1.6.php:149
2270
- msgid "bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: \"%s\""
2271
- msgstr ""
2272
-
2273
- #: bp-forums/bp-forums-admin.php:219 bp-forums/deprecated/1.6.php:176
2274
- msgid "Install Group Forums"
2275
- msgstr ""
2276
-
2277
- #: bp-forums/bp-forums-admin.php:220 bp-forums/deprecated/1.6.php:177
2278
- msgid "Use Existing Installation"
2279
  msgstr ""
2280
 
2281
- #: bp-forums/bp-forums-loader.php:61
2282
  msgid "Search Forums..."
2283
  msgstr ""
2284
 
2285
- #: bp-forums/bp-forums-loader.php:133 bp-forums/bp-forums-loader.php:198
2286
  msgid "Topics Started"
2287
  msgstr ""
2288
 
2289
- #: bp-forums/bp-forums-loader.php:144
2290
  msgid "Replied To"
2291
  msgstr ""
2292
 
2293
- #: bp-forums/bp-forums-loader.php:206
2294
  msgid "Replies"
2295
  msgstr ""
2296
 
2297
- #: bp-forums/bp-forums-loader.php:214
2298
  msgid "Favorite Topics"
2299
  msgstr ""
2300
 
2301
- #: bp-forums/bp-forums-screens.php:13
2302
  msgid "The forums component has not been set up yet."
2303
  msgstr ""
2304
 
2305
- #: bp-forums/bp-forums-screens.php:36 bp-groups/bp-groups-screens.php:360
2306
  msgid "Please provide a title for your forum topic."
2307
  msgstr ""
2308
 
2309
- #: bp-forums/bp-forums-screens.php:38 bp-groups/bp-groups-screens.php:362
2310
  msgid "Forum posts cannot be empty. Please enter some text."
2311
  msgstr ""
2312
 
2313
- #: bp-forums/bp-forums-screens.php:45 bp-groups/bp-groups-screens.php:372
2314
  msgid "There was an error when creating the topic"
2315
  msgstr ""
2316
 
2317
- #: bp-forums/bp-forums-screens.php:48 bp-groups/bp-groups-screens.php:375
2318
  msgid "The topic was created successfully"
2319
  msgstr ""
2320
 
2321
- #: bp-forums/bp-forums-screens.php:56 bp-forums/bp-forums-screens.php:61
2322
  msgid "Please pick the group forum where you would like to post this topic."
2323
  msgstr ""
2324
 
 
 
 
 
 
 
 
 
2325
  #: bp-forums/bp-forums-template.php:188 bp-forums/bp-forums-template.php:404
2326
  msgctxt "Forum topic pagination previous text"
2327
  msgid "&larr;"
@@ -2335,7 +2219,8 @@ msgstr ""
2335
  #: bp-forums/bp-forums-template.php:505 bp-forums/bp-forums-template.php:567
2336
  #: bp-forums/bp-forums-template.php:1216
2337
  #: bp-messages/bp-messages-classes.php:269
2338
- #: bp-messages/bp-messages-template.php:847
 
2339
  msgid "Deleted User"
2340
  msgstr ""
2341
 
@@ -2343,11 +2228,11 @@ msgstr ""
2343
  msgid "Group logo for %s"
2344
  msgstr ""
2345
 
2346
- #: bp-forums/bp-forums-template.php:683 bp-groups/bp-groups-template.php:835
2347
  msgid "%d post"
2348
  msgstr ""
2349
 
2350
- #: bp-forums/bp-forums-template.php:685 bp-groups/bp-groups-template.php:837
2351
  msgid "%d posts"
2352
  msgstr ""
2353
 
@@ -2397,69 +2282,213 @@ msgstr ""
2397
  msgid "Viewing post %1$s to %2$s (%3$s total posts)"
2398
  msgstr ""
2399
 
2400
- #: bp-forums/deprecated/1.6.php:59
2401
- msgid "Reinstall Group Forums"
2402
  msgstr ""
2403
 
2404
- #: bp-friends/bp-friends-actions.php:35
2405
- msgid "Friendship could not be requested."
 
2406
  msgstr ""
2407
 
2408
- #: bp-friends/bp-friends-actions.php:37
2409
- msgid "Friendship requested"
 
2410
  msgstr ""
2411
 
2412
- #: bp-friends/bp-friends-actions.php:41
2413
- msgid "You are already friends with this user"
 
2414
  msgstr ""
2415
 
2416
- #: bp-friends/bp-friends-actions.php:43
2417
- msgid "You already have a pending friendship request with this user"
 
 
2418
  msgstr ""
2419
 
2420
- #: bp-friends/bp-friends-actions.php:70 bp-themes/bp-default/_inc/ajax.php:605
2421
- msgid "Friendship could not be canceled."
 
2422
  msgstr ""
2423
 
2424
- #: bp-friends/bp-friends-actions.php:72
2425
- msgid "Friendship canceled"
 
2426
  msgstr ""
2427
 
2428
- #: bp-friends/bp-friends-actions.php:76
2429
- msgid "You are not yet friends with this user"
 
 
2430
  msgstr ""
2431
 
2432
- #: bp-friends/bp-friends-actions.php:78
2433
- msgid "You have a pending friendship request with this user"
 
 
2434
  msgstr ""
2435
 
2436
- #: bp-friends/bp-friends-activity.php:57
2437
- msgid "Friendships accepted"
2438
  msgstr ""
2439
 
2440
- #: bp-friends/bp-friends-activity.php:58
2441
- msgid "New friendships"
2442
  msgstr ""
2443
 
2444
- #: bp-friends/bp-friends-activity.php:61
2445
- msgid "New friendship created"
2446
  msgstr ""
2447
 
2448
- #: bp-friends/bp-friends-activity.php:86
2449
- msgid "%d friends accepted your friendship requests"
2450
  msgstr ""
2451
 
2452
- #: bp-friends/bp-friends-activity.php:89
2453
- #: bp-friends/bp-friends-notifications.php:71
2454
- msgid "%s accepted your friendship request"
2455
  msgstr ""
2456
 
2457
- #: bp-friends/bp-friends-activity.php:100
2458
- msgid "You have %d pending friendship requests"
2459
  msgstr ""
2460
 
2461
- #: bp-friends/bp-friends-activity.php:103
2462
- msgid "You have a friendship request from %s"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2463
  msgstr ""
2464
 
2465
  #: bp-friends/bp-friends-functions.php:100
@@ -2475,34 +2504,36 @@ msgstr ""
2475
  msgid "Friends <span>%d</span>"
2476
  msgstr ""
2477
 
2478
- #: bp-friends/bp-friends-loader.php:109 bp-friends/bp-friends-loader.php:171
2479
- #: bp-friends/bp-friends-loader.php:198
 
 
2480
  #: bp-themes/bp-default/activity/index.php:120
2481
  #: bp-themes/bp-default/members/single/activity.php:35
2482
  msgid "Friendships"
2483
  msgstr ""
2484
 
2485
- #: bp-friends/bp-friends-loader.php:119 bp-groups/bp-groups-template.php:1288
2486
  msgid "Requests"
2487
  msgstr ""
2488
 
2489
- #: bp-friends/bp-friends-loader.php:152
2490
  msgid "Friends <span class=\"count\">%s</span>"
2491
  msgstr ""
2492
 
2493
- #: bp-friends/bp-friends-loader.php:153
2494
  msgid "Pending Requests <span class=\"count\">%s</span>"
2495
  msgstr ""
2496
 
2497
- #: bp-friends/bp-friends-loader.php:156
2498
  msgid "No Pending Requests"
2499
  msgstr ""
2500
 
2501
- #: bp-friends/bp-friends-notifications.php:32
2502
  msgid "New friendship request from %s"
2503
  msgstr ""
2504
 
2505
- #: bp-friends/bp-friends-notifications.php:34
2506
  msgid ""
2507
  "%1$s wants to add you as a friend.\n"
2508
  "\n"
@@ -2513,7 +2544,7 @@ msgid ""
2513
  "---------------------\n"
2514
  msgstr ""
2515
 
2516
- #: bp-friends/bp-friends-notifications.php:73
2517
  msgid ""
2518
  "%1$s accepted your friend request.\n"
2519
  "\n"
@@ -2554,7 +2585,7 @@ msgstr ""
2554
  msgid "A member accepts your friendship request"
2555
  msgstr ""
2556
 
2557
- #: bp-friends/bp-friends-template.php:69 bp-xprofile/bp-xprofile-loader.php:117
2558
  msgid "My Friends"
2559
  msgstr ""
2560
 
@@ -2591,6 +2622,7 @@ msgid "%d friends"
2591
  msgstr ""
2592
 
2593
  #: bp-friends/bp-friends-template.php:285
 
2594
  #: bp-themes/bp-default/_inc/ajax.php:617
2595
  msgid "Cancel Friendship Request"
2596
  msgstr ""
@@ -2606,6 +2638,8 @@ msgstr ""
2606
 
2607
  #: bp-friends/bp-friends-template.php:319
2608
  #: bp-friends/bp-friends-template.php:320
 
 
2609
  #: bp-themes/bp-default/_inc/ajax.php:607
2610
  #: bp-themes/bp-default/_inc/ajax.php:625
2611
  msgid "Add Friend"
@@ -2631,31 +2665,31 @@ msgstr ""
2631
  msgid "%1$s created the group %2$s"
2632
  msgstr ""
2633
 
2634
- #: bp-groups/bp-groups-actions.php:193
2635
  msgid "There was an error saving the group avatar, please try uploading again."
2636
  msgstr ""
2637
 
2638
- #: bp-groups/bp-groups-actions.php:195
2639
  msgid "The group avatar was uploaded successfully!"
2640
  msgstr ""
2641
 
2642
- #: bp-groups/bp-groups-actions.php:219 bp-groups/bp-groups-actions.php:226
2643
  msgid "There was an error joining the group."
2644
  msgstr ""
2645
 
2646
- #: bp-groups/bp-groups-actions.php:228
2647
  msgid "You joined the group!"
2648
  msgstr ""
2649
 
2650
- #: bp-groups/bp-groups-actions.php:254 bp-groups/bp-groups-screens.php:663
2651
  msgid "This group must have at least one admin"
2652
  msgstr ""
2653
 
2654
- #: bp-groups/bp-groups-actions.php:257
2655
  msgid "There was an error leaving the group."
2656
  msgstr ""
2657
 
2658
- #: bp-groups/bp-groups-actions.php:259 bp-groups/bp-groups-functions.php:313
2659
  msgid "You successfully left the group."
2660
  msgstr ""
2661
 
@@ -2731,669 +2765,995 @@ msgstr ""
2731
  msgid "You have an invitation to the group: %s"
2732
  msgstr ""
2733
 
2734
- #: bp-groups/bp-groups-adminbar.php:40 bp-xprofile/bp-xprofile-admin.php:114
2735
- msgid "Edit Group"
2736
- msgstr ""
2737
-
2738
- #: bp-groups/bp-groups-adminbar.php:48 bp-groups/bp-groups-buddybar.php:34
2739
- msgid "Edit Details"
2740
  msgstr ""
2741
 
2742
- #: bp-groups/bp-groups-adminbar.php:56
2743
- msgid "Edit Settings"
2744
  msgstr ""
2745
 
2746
- #: bp-groups/bp-groups-adminbar.php:65 bp-members/bp-members-adminbar.php:107
2747
- msgid "Edit Avatar"
2748
  msgstr ""
2749
 
2750
- #: bp-groups/bp-groups-adminbar.php:75 bp-groups/bp-groups-buddybar.php:46
2751
- msgid "Manage Invitations"
 
2752
  msgstr ""
2753
 
2754
- #: bp-groups/bp-groups-adminbar.php:84 bp-groups/bp-groups-buddybar.php:50
2755
- msgid "Manage Members"
 
2756
  msgstr ""
2757
 
2758
- #: bp-groups/bp-groups-adminbar.php:93 bp-groups/bp-groups-buddybar.php:54
2759
- msgid "Membership Requests"
 
2760
  msgstr ""
2761
 
2762
- #: bp-groups/bp-groups-adminbar.php:102 bp-groups/bp-groups-buddybar.php:58
2763
- #: bp-themes/bp-default/groups/single/admin.php:360
2764
- #: bp-xprofile/bp-xprofile-admin.php:118
2765
- msgid "Delete Group"
2766
  msgstr ""
2767
 
2768
- #: bp-groups/bp-groups-buddybar.php:31 bp-members/bp-members-buddybar.php:120
2769
- msgid "Admin Options"
 
2770
  msgstr ""
2771
 
2772
- #: bp-groups/bp-groups-buddybar.php:36
2773
- msgid "Group Settings"
2774
  msgstr ""
2775
 
2776
- #: bp-groups/bp-groups-buddybar.php:40 bp-groups/bp-groups-loader.php:570
2777
- #: bp-groups/bp-groups-template.php:2395
2778
- msgid "Group Avatar"
2779
  msgstr ""
2780
 
2781
- #: bp-groups/bp-groups-classes.php:832
2782
- msgid "Group Mod"
2783
  msgstr ""
2784
 
2785
- #: bp-groups/bp-groups-classes.php:838 bp-groups/bp-groups-functions.php:121
2786
- msgid "Group Admin"
2787
  msgstr ""
2788
 
2789
- #: bp-groups/bp-groups-forums.php:104 bp-groups/bp-groups-forums.php:253
2790
- msgid "%1$s replied to the forum topic %2$s in the group %3$s"
2791
  msgstr ""
2792
 
2793
- #: bp-groups/bp-groups-forums.php:154 bp-groups/bp-groups-forums.php:206
2794
- msgid "%1$s started the forum topic %2$s in the group %3$s"
2795
  msgstr ""
2796
 
2797
- #: bp-groups/bp-groups-functions.php:288
2798
- msgid "As the only Admin, you cannot leave the group."
2799
  msgstr ""
2800
 
2801
- #: bp-groups/bp-groups-functions.php:357 bp-groups/bp-groups-functions.php:848
2802
- #: bp-groups/bp-groups-screens.php:61
2803
- msgid "%1$s joined the group %2$s"
2804
  msgstr ""
2805
 
2806
- #: bp-groups/bp-groups-functions.php:538
2807
- msgid "%1$s posted an update in the group %2$s"
2808
  msgstr ""
2809
 
2810
- #: bp-groups/bp-groups-loader.php:140
2811
- msgid "Search Groups..."
2812
  msgstr ""
2813
 
2814
- #: bp-groups/bp-groups-loader.php:269
2815
- msgid "You do not have access to this group."
2816
  msgstr ""
2817
 
2818
- #: bp-groups/bp-groups-loader.php:284
2819
- msgid "You are not an admin of this group."
2820
  msgstr ""
2821
 
2822
- #: bp-groups/bp-groups-loader.php:294 bp-groups/bp-groups-template.php:1269
2823
- msgid "Details"
2824
  msgstr ""
2825
 
2826
- #: bp-groups/bp-groups-loader.php:306 bp-groups/bp-groups-template.php:1280
2827
- msgid "Avatar"
 
2828
  msgstr ""
2829
 
2830
- #: bp-groups/bp-groups-loader.php:314
2831
- msgid "Invites"
2832
  msgstr ""
2833
 
2834
- #: bp-groups/bp-groups-loader.php:342
2835
- msgid "Groups <span>%d</span>"
2836
  msgstr ""
2837
 
2838
- #: bp-groups/bp-groups-loader.php:354 bp-groups/bp-groups-loader.php:383
2839
- #: bp-groups/bp-groups-loader.php:522 bp-groups/bp-groups-loader.php:550
2840
- msgid "Memberships"
2841
  msgstr ""
2842
 
2843
- #: bp-groups/bp-groups-loader.php:365
2844
- msgid "Invitations"
2845
  msgstr ""
2846
 
2847
- #: bp-groups/bp-groups-loader.php:395
2848
- msgctxt "Group home navigation title"
2849
- msgid "Home"
2850
  msgstr ""
2851
 
2852
- #: bp-groups/bp-groups-loader.php:412 bp-groups/bp-groups-template.php:1580
2853
- #: bp-groups/bp-groups-template.php:1581 bp-themes/bp-default/_inc/ajax.php:724
2854
- msgid "Request Membership"
2855
  msgstr ""
2856
 
2857
- #: bp-groups/bp-groups-loader.php:424
2858
- msgid "Forum"
2859
- msgstr ""
 
 
2860
 
2861
- #: bp-groups/bp-groups-loader.php:436
2862
- msgid "Members <span>%s</span>"
2863
  msgstr ""
2864
 
2865
- #: bp-groups/bp-groups-loader.php:448
2866
- #: bp-themes/bp-default/groups/single/send-invites.php:60
2867
- msgid "Send Invites"
 
 
 
2868
  msgstr ""
2869
 
2870
- #: bp-groups/bp-groups-loader.php:462
2871
- msgid "Admin"
2872
  msgstr ""
2873
 
2874
- #: bp-groups/bp-groups-loader.php:503
2875
- msgid "No Pending Invites"
 
2876
  msgstr ""
2877
 
2878
- #: bp-groups/bp-groups-loader.php:506
2879
- msgid "Groups <span class=\"count\">%s</span>"
 
2880
  msgstr ""
2881
 
2882
- #: bp-groups/bp-groups-loader.php:507
2883
- msgid "Pending Invites <span class=\"count\">%s</span>"
2884
  msgstr ""
2885
 
2886
- #: bp-groups/bp-groups-notifications.php:20
2887
- msgid "Group Details Updated"
2888
  msgstr ""
2889
 
2890
- #: bp-groups/bp-groups-notifications.php:35
2891
- msgid ""
2892
- "Group details for the group \"%1$s\" were updated:\n"
2893
- "\n"
2894
- "To view the group: %2$s\n"
2895
- "\n"
2896
- "---------------------\n"
2897
  msgstr ""
2898
 
2899
- #: bp-groups/bp-groups-notifications.php:77
2900
- msgid "Membership request for group: %s"
 
 
 
 
2901
  msgstr ""
2902
 
2903
- #: bp-groups/bp-groups-notifications.php:79
2904
- msgid ""
2905
- "%1$s wants to join the group \"%2$s\".\n"
2906
- "\n"
2907
- "Because you are the administrator of this group, you must either accept or reject the membership request.\n"
2908
- "\n"
2909
- "To view all pending membership requests for this group, please visit:\n"
2910
- "%3$s\n"
2911
- "\n"
2912
- "To view %4$s's profile: %5$s\n"
2913
- "\n"
2914
- "---------------------\n"
2915
  msgstr ""
2916
 
2917
- #: bp-groups/bp-groups-notifications.php:128
2918
- msgid "Membership request for group \"%s\" accepted"
2919
  msgstr ""
2920
 
2921
- #: bp-groups/bp-groups-notifications.php:129
2922
- msgid ""
2923
- "Your membership request for the group \"%1$s\" has been accepted.\n"
2924
- "\n"
2925
- "To view the group please login and visit: %2$s\n"
2926
- "\n"
2927
- "---------------------\n"
2928
  msgstr ""
2929
 
2930
- #: bp-groups/bp-groups-notifications.php:138
2931
- msgid "Membership request for group \"%s\" rejected"
 
 
2932
  msgstr ""
2933
 
2934
- #: bp-groups/bp-groups-notifications.php:139
2935
- msgid ""
2936
- "Your membership request for the group \"%1$s\" has been rejected.\n"
2937
- "\n"
2938
- "To submit another request please log in and visit: %2$s\n"
2939
- "\n"
2940
- "---------------------\n"
2941
  msgstr ""
2942
 
2943
- #: bp-groups/bp-groups-notifications.php:163
2944
- msgid "an administrator"
 
2945
  msgstr ""
2946
 
2947
- #: bp-groups/bp-groups-notifications.php:166
2948
- msgid "a moderator"
 
2949
  msgstr ""
2950
 
2951
- #: bp-groups/bp-groups-notifications.php:185
2952
- msgid "You have been promoted in the group: \"%s\""
 
2953
  msgstr ""
2954
 
2955
- #: bp-groups/bp-groups-notifications.php:187
2956
- msgid ""
2957
- "You have been promoted to %1$s for the group: \"%2$s\".\n"
2958
- "\n"
2959
- "To view the group please visit: %3$s\n"
2960
- "\n"
2961
- "---------------------\n"
2962
  msgstr ""
2963
 
2964
- #: bp-groups/bp-groups-notifications.php:235
2965
- msgid "You have an invitation to the group: \"%s\""
2966
  msgstr ""
2967
 
2968
- #: bp-groups/bp-groups-notifications.php:237
2969
- msgid ""
2970
- "One of your friends %1$s has invited you to the group: \"%2$s\".\n"
2971
- "\n"
2972
- "To view your group invites visit: %3$s\n"
2973
- "\n"
2974
- "To view the group visit: %4$s\n"
2975
- "\n"
2976
- "To view %5$s's profile visit: %6$s\n"
2977
- "\n"
2978
- "---------------------\n"
2979
  msgstr ""
2980
 
2981
- #: bp-groups/bp-groups-screens.php:53
2982
- msgid "Group invite could not be accepted"
2983
  msgstr ""
2984
 
2985
- #: bp-groups/bp-groups-screens.php:55
2986
- msgid "Group invite accepted"
2987
  msgstr ""
2988
 
2989
- #: bp-groups/bp-groups-screens.php:75
2990
- msgid "Group invite could not be rejected"
2991
  msgstr ""
2992
 
2993
- #: bp-groups/bp-groups-screens.php:77
2994
- msgid "Group invite rejected"
 
 
 
 
2995
  msgstr ""
2996
 
2997
- #: bp-groups/bp-groups-screens.php:154
2998
- msgid "It looks like you've already said that!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2999
  msgstr ""
3000
 
3001
- #: bp-groups/bp-groups-screens.php:157
 
 
 
 
 
 
 
 
3002
  msgid "There was an error when replying to that topic"
3003
  msgstr ""
3004
 
3005
- #: bp-groups/bp-groups-screens.php:159
3006
  msgid "Your reply was posted successfully"
3007
  msgstr ""
3008
 
3009
- #: bp-groups/bp-groups-screens.php:179
3010
  msgid "There was an error when making that topic a sticky"
3011
  msgstr ""
3012
 
3013
- #: bp-groups/bp-groups-screens.php:181
3014
  msgid "The topic was made sticky successfully"
3015
  msgstr ""
3016
 
3017
- #: bp-groups/bp-groups-screens.php:193
3018
  msgid "There was an error when unsticking that topic"
3019
  msgstr ""
3020
 
3021
- #: bp-groups/bp-groups-screens.php:195
3022
  msgid "The topic was unstuck successfully"
3023
  msgstr ""
3024
 
3025
- #: bp-groups/bp-groups-screens.php:207
3026
  msgid "There was an error when closing that topic"
3027
  msgstr ""
3028
 
3029
- #: bp-groups/bp-groups-screens.php:209
3030
  msgid "The topic was closed successfully"
3031
  msgstr ""
3032
 
3033
- #: bp-groups/bp-groups-screens.php:221
3034
  msgid "There was an error when opening that topic"
3035
  msgstr ""
3036
 
3037
- #: bp-groups/bp-groups-screens.php:223
3038
  msgid "The topic was opened successfully"
3039
  msgstr ""
3040
 
3041
- #: bp-groups/bp-groups-screens.php:244
3042
  msgid "There was an error deleting the topic"
3043
  msgstr ""
3044
 
3045
- #: bp-groups/bp-groups-screens.php:246
3046
  msgid "The topic was deleted successfully"
3047
  msgstr ""
3048
 
3049
- #: bp-groups/bp-groups-screens.php:268
3050
  msgid "There was an error when editing that topic"
3051
  msgstr ""
3052
 
3053
- #: bp-groups/bp-groups-screens.php:270
3054
  msgid "The topic was edited successfully"
3055
  msgstr ""
3056
 
3057
- #: bp-groups/bp-groups-screens.php:294
3058
  msgid "There was an error deleting that post"
3059
  msgstr ""
3060
 
3061
- #: bp-groups/bp-groups-screens.php:296
3062
  msgid "The post was deleted successfully"
3063
  msgstr ""
3064
 
3065
- #: bp-groups/bp-groups-screens.php:318
3066
  msgid "There was an error when editing that post"
3067
  msgstr ""
3068
 
3069
- #: bp-groups/bp-groups-screens.php:320
3070
  msgid "The post was edited successfully"
3071
  msgstr ""
3072
 
3073
- #: bp-groups/bp-groups-screens.php:335 bp-groups/bp-groups-screens.php:352
3074
  msgid "You have been banned from this group."
3075
  msgstr ""
3076
 
3077
- #: bp-groups/bp-groups-screens.php:365
3078
  msgid "This group does not have a forum setup yet."
3079
  msgstr ""
3080
 
3081
- #: bp-groups/bp-groups-screens.php:419
3082
  msgid "Group invites sent."
3083
  msgstr ""
3084
 
3085
- #: bp-groups/bp-groups-screens.php:447
3086
  msgid "There was an error sending your group membership request, please try again."
3087
  msgstr ""
3088
 
3089
- #: bp-groups/bp-groups-screens.php:449
3090
  msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request."
3091
  msgstr ""
3092
 
3093
- #: bp-groups/bp-groups-screens.php:496
3094
  msgid "There was an error updating group details, please try again."
3095
  msgstr ""
3096
 
3097
- #: bp-groups/bp-groups-screens.php:498
3098
  msgid "Group details were successfully updated."
3099
  msgstr ""
3100
 
3101
- #: bp-groups/bp-groups-screens.php:539
3102
  msgid "There was an error updating group settings, please try again."
3103
  msgstr ""
3104
 
3105
- #: bp-groups/bp-groups-screens.php:541
3106
  msgid "Group settings were successfully updated."
3107
  msgstr ""
3108
 
3109
- #: bp-groups/bp-groups-screens.php:572 bp-xprofile/bp-xprofile-actions.php:40
3110
  msgid "Your avatar was deleted successfully!"
3111
  msgstr ""
3112
 
3113
- #: bp-groups/bp-groups-screens.php:574 bp-xprofile/bp-xprofile-actions.php:42
3114
  msgid "There was a problem deleting that avatar, please try again."
3115
  msgstr ""
3116
 
3117
- #: bp-groups/bp-groups-screens.php:605
3118
- msgid "There was a problem cropping the avatar, please try uploading it again"
3119
  msgstr ""
3120
 
3121
- #: bp-groups/bp-groups-screens.php:607
3122
- msgid "The new group avatar was uploaded successfully!"
3123
  msgstr ""
3124
 
3125
- #: bp-groups/bp-groups-screens.php:642
3126
  msgid "There was an error when promoting that user, please try again"
3127
  msgstr ""
3128
 
3129
- #: bp-groups/bp-groups-screens.php:644
3130
  msgid "User promoted successfully"
3131
  msgstr ""
3132
 
3133
- #: bp-groups/bp-groups-screens.php:667
3134
  msgid "There was an error when demoting that user, please try again"
3135
  msgstr ""
3136
 
3137
- #: bp-groups/bp-groups-screens.php:669
3138
  msgid "User demoted successfully"
3139
  msgstr ""
3140
 
3141
- #: bp-groups/bp-groups-screens.php:685
3142
  msgid "There was an error when banning that user, please try again"
3143
  msgstr ""
3144
 
3145
- #: bp-groups/bp-groups-screens.php:687
3146
  msgid "User banned successfully"
3147
  msgstr ""
3148
 
3149
- #: bp-groups/bp-groups-screens.php:703
3150
  msgid "There was an error when unbanning that user, please try again"
3151
  msgstr ""
3152
 
3153
- #: bp-groups/bp-groups-screens.php:705
3154
  msgid "User ban removed successfully"
3155
  msgstr ""
3156
 
3157
- #: bp-groups/bp-groups-screens.php:721
3158
  msgid "There was an error removing that user from the group, please try again"
3159
  msgstr ""
3160
 
3161
- #: bp-groups/bp-groups-screens.php:723
3162
  msgid "User removed successfully"
3163
  msgstr ""
3164
 
3165
- #: bp-groups/bp-groups-screens.php:761
3166
  msgid "There was an error accepting the membership request, please try again."
3167
  msgstr ""
3168
 
3169
- #: bp-groups/bp-groups-screens.php:763
3170
  msgid "Group membership request accepted"
3171
  msgstr ""
3172
 
3173
- #: bp-groups/bp-groups-screens.php:772
3174
  msgid "There was an error rejecting the membership request, please try again."
3175
  msgstr ""
3176
 
3177
- #: bp-groups/bp-groups-screens.php:774
3178
  msgid "Group membership request rejected"
3179
  msgstr ""
3180
 
3181
- #: bp-groups/bp-groups-screens.php:804
3182
  msgid "There was an error deleting the group, please try again."
3183
  msgstr ""
3184
 
3185
- #: bp-groups/bp-groups-screens.php:806
3186
  msgid "The group was deleted successfully"
3187
  msgstr ""
3188
 
3189
- #: bp-groups/bp-groups-screens.php:856
3190
  msgid "A member invites you to join a group"
3191
  msgstr ""
3192
 
3193
- #: bp-groups/bp-groups-screens.php:862
3194
  msgid "Group information is updated"
3195
  msgstr ""
3196
 
3197
- #: bp-groups/bp-groups-screens.php:868
3198
  msgid "You are promoted to a group administrator or moderator"
3199
  msgstr ""
3200
 
3201
- #: bp-groups/bp-groups-screens.php:874
3202
  msgid "A member requests to join a private group for which you are an admin"
3203
  msgstr ""
3204
 
3205
- #: bp-groups/bp-groups-template.php:173
3206
  msgctxt "Group pagination previous text"
3207
  msgid "&larr;"
3208
  msgstr ""
3209
 
3210
- #: bp-groups/bp-groups-template.php:174
3211
  msgctxt "Group pagination next text"
3212
  msgid "&rarr;"
3213
  msgstr ""
3214
 
3215
- #: bp-groups/bp-groups-template.php:355
3216
  msgid "Public Group"
3217
  msgstr ""
3218
 
3219
- #: bp-groups/bp-groups-template.php:357
3220
  msgid "Hidden Group"
3221
  msgstr ""
3222
 
3223
- #: bp-groups/bp-groups-template.php:359
3224
  msgid "Private Group"
3225
  msgstr ""
3226
 
3227
- #: bp-groups/bp-groups-template.php:361
3228
  msgid "Group"
3229
  msgstr ""
3230
 
3231
- #: bp-groups/bp-groups-template.php:433
3232
  msgid "not yet active"
3233
  msgstr ""
3234
 
3235
- #: bp-groups/bp-groups-template.php:524
3236
- msgid "Private"
3237
  msgstr ""
3238
 
3239
- #: bp-groups/bp-groups-template.php:575
3240
  msgid "No Admins"
3241
  msgstr ""
3242
 
3243
- #: bp-groups/bp-groups-template.php:602
3244
  msgid "No Mods"
3245
  msgstr ""
3246
 
3247
- #: bp-groups/bp-groups-template.php:684
3248
  msgid "Filter Groups"
3249
  msgstr ""
3250
 
3251
- #: bp-groups/bp-groups-template.php:732
3252
  msgid "Viewing group %1$s to %2$s (of %3$s groups)"
3253
  msgstr ""
3254
 
3255
- #: bp-groups/bp-groups-template.php:760
3256
  msgid "%s member"
3257
  msgstr ""
3258
 
3259
- #: bp-groups/bp-groups-template.php:762
 
3260
  #: bp-themes/bp-default/members/single/groups/invites.php:14
3261
  msgid "%s members"
3262
  msgstr ""
3263
 
3264
- #: bp-groups/bp-groups-template.php:801
3265
  msgid "%d topic"
3266
  msgstr ""
3267
 
3268
- #: bp-groups/bp-groups-template.php:803
3269
  msgid "%d topics"
3270
  msgstr ""
3271
 
3272
- #: bp-groups/bp-groups-template.php:1037 bp-groups/bp-groups-template.php:1102
 
 
3273
  #: bp-themes/bp-default/groups/single/admin.php:190
3274
  #: bp-themes/bp-default/groups/single/admin.php:217
3275
  msgid "Demote to Member"
3276
  msgstr ""
3277
 
3278
- #: bp-groups/bp-groups-template.php:1050 bp-groups/bp-groups-template.php:1115
3279
- #: bp-groups/bp-groups-template.php:1894
3280
  msgid "joined %s"
3281
  msgstr ""
3282
 
3283
- #: bp-groups/bp-groups-template.php:1073
3284
  msgid "This group has no administrators"
3285
  msgstr ""
3286
 
3287
- #: bp-groups/bp-groups-template.php:1101
 
 
3288
  #: bp-themes/bp-default/groups/single/admin.php:216
3289
  #: bp-themes/bp-default/groups/single/admin.php:272
3290
  msgid "Promote to Admin"
3291
  msgstr ""
3292
 
3293
- #: bp-groups/bp-groups-template.php:1135
3294
  msgid "This group has no moderators"
3295
  msgstr ""
3296
 
3297
- #: bp-groups/bp-groups-template.php:1499 bp-groups/bp-groups-template.php:1500
3298
- #: bp-themes/bp-default/forums/index.php:23
3299
- #: bp-themes/bp-default/groups/single/forum.php:19
3300
- msgid "New Topic"
3301
- msgstr ""
3302
-
3303
- #: bp-groups/bp-groups-template.php:1539 bp-groups/bp-groups-template.php:1540
3304
  #: bp-themes/bp-default/_inc/ajax.php:703
3305
  msgid "Leave Group"
3306
  msgstr ""
3307
 
3308
- #: bp-groups/bp-groups-template.php:1562 bp-groups/bp-groups-template.php:1563
 
3309
  #: bp-themes/bp-default/_inc/ajax.php:722
3310
  msgid "Join Group"
3311
  msgstr ""
3312
 
3313
- #: bp-groups/bp-groups-template.php:1595 bp-groups/bp-groups-template.php:1596
3314
  msgid "Request Sent"
3315
  msgstr ""
3316
 
3317
- #: bp-groups/bp-groups-template.php:1626
3318
  msgid "This is a private group and you must request group membership in order to join."
3319
  msgstr ""
3320
 
3321
- #: bp-groups/bp-groups-template.php:1628
3322
  msgid "This is a private group. To join you must be a registered site member and request group membership."
3323
  msgstr ""
3324
 
3325
- #: bp-groups/bp-groups-template.php:1631
3326
  msgid "This is a private group. Your membership request is awaiting approval from the group administrator."
3327
  msgstr ""
3328
 
3329
- #: bp-groups/bp-groups-template.php:1635
3330
  msgid "This is a hidden group and only invited members can join."
3331
  msgstr ""
3332
 
3333
- #: bp-groups/bp-groups-template.php:1942
3334
  msgid "Viewing members %1$s to %2$s (of %3$s members)"
3335
  msgstr ""
3336
 
3337
- #: bp-groups/bp-groups-template.php:2168
3338
  msgid "Group avatar"
3339
  msgstr ""
3340
 
3341
- #: bp-groups/bp-groups-template.php:2308 bp-groups/bp-groups-template.php:2332
3342
  msgid "Recently Joined"
3343
  msgstr ""
3344
 
3345
- #: bp-groups/bp-groups-template.php:2309 bp-groups/bp-groups-template.php:2335
3346
  msgid "Most Popular"
3347
  msgstr ""
3348
 
3349
- #: bp-groups/bp-groups-template.php:2310 bp-groups/bp-groups-template.php:2338
3350
  msgid "Administrator Of"
3351
  msgstr ""
3352
 
3353
- #: bp-groups/bp-groups-template.php:2311 bp-groups/bp-groups-template.php:2341
3354
  msgid "Moderator Of"
3355
  msgstr ""
3356
 
3357
- #: bp-groups/bp-groups-template.php:2399
3358
  msgid "No Group Avatar"
3359
  msgstr ""
3360
 
3361
- #: bp-groups/bp-groups-template.php:2600
3362
  msgid "requested %s"
3363
  msgstr ""
3364
 
3365
- #: bp-groups/bp-groups-template.php:2775
3366
  msgid "Group Activity RSS Feed"
3367
  msgstr ""
3368
 
3369
- #: bp-groups/bp-groups-widgets.php:27
3370
  msgid "A dynamic list of recently active, popular, and newest groups"
3371
  msgstr ""
3372
 
3373
- #: bp-groups/bp-groups-widgets.php:78 bp-groups/bp-groups-widgets.php:183
 
 
 
 
 
3374
  msgid "created %s"
3375
  msgstr ""
3376
 
3377
- #: bp-groups/bp-groups-widgets.php:97
3378
  msgid "There are no groups to display."
3379
  msgstr ""
3380
 
3381
- #: bp-groups/bp-groups-widgets.php:134
3382
  msgid "Link widget title to Groups directory"
3383
  msgstr ""
3384
 
3385
- #: bp-groups/bp-groups-widgets.php:136
3386
  msgid "Max groups to show:"
3387
  msgstr ""
3388
 
3389
- #: bp-groups/bp-groups-widgets.php:139
3390
  msgid "Default groups to show:"
3391
  msgstr ""
3392
 
3393
- #: bp-groups/bp-groups-widgets.php:202
3394
  msgid "No groups matched the current filter."
3395
  msgstr ""
3396
 
 
 
 
 
 
 
 
 
3397
  #: bp-members/bp-members-actions.php:45
3398
  msgid "User marked as spammer. Spam users are visible only to site admins."
3399
  msgstr ""
@@ -3423,18 +3783,20 @@ msgid "Edit Member"
3423
  msgstr ""
3424
 
3425
  #: bp-members/bp-members-adminbar.php:99
3426
- #: bp-xprofile/bp-xprofile-template.php:899
3427
- #: bp-xprofile/bp-xprofile-template.php:900
3428
  msgid "Edit Profile"
3429
  msgstr ""
3430
 
3431
  #: bp-members/bp-members-adminbar.php:115
 
3432
  msgid "User Capabilities"
3433
  msgstr ""
3434
 
3435
  #: bp-members/bp-members-adminbar.php:123
3436
- #: bp-settings/bp-settings-loader.php:134
3437
- #: bp-settings/bp-settings-loader.php:194
 
3438
  #: bp-themes/bp-default/members/single/settings/delete-account.php:50
3439
  #: bp-themes/bp-default/members/single/settings/delete-account.php:76
3440
  msgid "Delete Account"
@@ -3444,8 +3806,8 @@ msgstr ""
3444
  msgid "No new notifications"
3445
  msgstr ""
3446
 
3447
- #: bp-members/bp-members-buddybar.php:24 bp-settings/bp-settings-loader.php:109
3448
- #: bp-settings/bp-settings-loader.php:185
3449
  msgid "Notifications"
3450
  msgstr ""
3451
 
@@ -3466,72 +3828,64 @@ msgid "Edit %s's Avatar"
3466
  msgstr ""
3467
 
3468
  #: bp-members/bp-members-buddybar.php:133
3469
- msgid "Mark as Spammer"
3470
  msgstr ""
3471
 
3472
- #: bp-members/bp-members-buddybar.php:137
3473
- msgid "Not a Spammer"
3474
  msgstr ""
3475
 
3476
- #: bp-members/bp-members-buddybar.php:141
3477
- msgid "Delete %s's Account"
3478
  msgstr ""
3479
 
3480
- #: bp-members/bp-members-functions.php:862
3481
- msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
 
 
 
 
 
3482
  msgstr ""
3483
 
3484
- #: bp-members/bp-members-functions.php:1038
3485
  msgid "Please enter a username"
3486
  msgstr ""
3487
 
3488
- #: bp-members/bp-members-functions.php:1046
3489
  msgid "Only lowercase letters and numbers allowed"
3490
  msgstr ""
3491
 
3492
- #: bp-members/bp-members-functions.php:1049
3493
  msgid "Username must be at least 4 characters"
3494
  msgstr ""
3495
 
3496
- #: bp-members/bp-members-functions.php:1052
3497
  msgid "Sorry, usernames may not contain the character \"_\"!"
3498
  msgstr ""
3499
 
3500
- #: bp-members/bp-members-functions.php:1059
3501
  msgid "Sorry, usernames must have letters too!"
3502
  msgstr ""
3503
 
3504
- #: bp-members/bp-members-functions.php:1062
3505
- msgid "Please check your email address."
3506
- msgstr ""
3507
-
3508
- #: bp-members/bp-members-functions.php:1065
3509
- #: bp-members/bp-members-functions.php:1073
3510
- msgid "Sorry, that email address is not allowed!"
3511
- msgstr ""
3512
-
3513
- #: bp-members/bp-members-functions.php:1078
3514
  msgid "Sorry, that username already exists!"
3515
  msgstr ""
3516
 
3517
- #: bp-members/bp-members-functions.php:1082
3518
- msgid "Sorry, that email address is already used!"
3519
- msgstr ""
3520
-
3521
- #: bp-members/bp-members-functions.php:1121
3522
  msgid "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
3523
  msgstr ""
3524
 
3525
- #: bp-members/bp-members-functions.php:1219
3526
- #: bp-members/bp-members-functions.php:1223
3527
  msgid "Invalid activation key"
3528
  msgstr ""
3529
 
3530
- #: bp-members/bp-members-functions.php:1260
3531
  msgid "%s became a registered member"
3532
  msgstr ""
3533
 
3534
- #: bp-members/bp-members-functions.php:1346
3535
  msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
3536
  msgstr ""
3537
 
@@ -3539,7 +3893,7 @@ msgstr ""
3539
  msgid "Search Members..."
3540
  msgstr ""
3541
 
3542
- #: bp-members/bp-members-loader.php:192
3543
  msgid "You"
3544
  msgstr ""
3545
 
@@ -3555,10 +3909,20 @@ msgstr ""
3555
  msgid "This is a required field"
3556
  msgstr ""
3557
 
3558
- #: bp-members/bp-members-screens.php:251
3559
  msgid "Your account is now active!"
3560
  msgstr ""
3561
 
 
 
 
 
 
 
 
 
 
 
3562
  #: bp-members/bp-members-template.php:206
3563
  msgctxt "Member pagination previous text"
3564
  msgid "&larr;"
@@ -3585,57 +3949,50 @@ msgstr ""
3585
  msgid "Viewing member %1$s to %2$s (of %3$s members)"
3586
  msgstr ""
3587
 
3588
- #: bp-members/bp-members-template.php:556
3589
  msgid "Never active"
3590
  msgstr ""
3591
 
3592
- #: bp-members/bp-members-template.php:578
3593
  msgctxt "member latest update in member directory"
3594
  msgid "- &quot;%s &quot;"
3595
  msgstr ""
3596
 
3597
- #: bp-members/bp-members-template.php:635
 
3598
  msgid "registered %s"
3599
  msgstr ""
3600
 
3601
- #: bp-members/bp-members-template.php:1077
3602
  msgid "Your Avatar"
3603
  msgstr ""
3604
 
3605
- #: bp-members/bp-members-template.php:1147
3606
  msgid "Activity RSS Feed"
3607
  msgstr ""
3608
 
3609
- #: bp-messages/bp-messages-actions.php:36
3610
  msgid "Your reply was sent successfully"
3611
  msgstr ""
3612
 
3613
- #: bp-messages/bp-messages-actions.php:38
3614
  msgid "There was a problem sending your reply, please try again"
3615
  msgstr ""
3616
 
3617
- #: bp-messages/bp-messages-actions.php:47
3618
- #: bp-messages/bp-messages-loader.php:104
3619
- msgid "Messages <span>%s</span>"
3620
- msgstr ""
3621
-
3622
- #: bp-messages/bp-messages-actions.php:54
3623
- msgid "From: %s"
3624
- msgstr ""
3625
-
3626
- #: bp-messages/bp-messages-actions.php:84
3627
  msgid "There was an error deleting that message."
3628
  msgstr ""
3629
 
3630
- #: bp-messages/bp-messages-actions.php:86
3631
  msgid "Message deleted."
3632
  msgstr ""
3633
 
3634
- #: bp-messages/bp-messages-actions.php:108
3635
  msgid "There was an error deleting messages."
3636
  msgstr ""
3637
 
3638
- #: bp-messages/bp-messages-actions.php:110
 
3639
  #: bp-themes/bp-default/_inc/ajax.php:871
3640
  msgid "Messages deleted."
3641
  msgstr ""
@@ -3652,17 +4009,17 @@ msgstr ""
3652
  msgid "No Subject"
3653
  msgstr ""
3654
 
3655
- #: bp-messages/bp-messages-functions.php:233
3656
- #: bp-messages/bp-messages-loader.php:122
3657
- #: bp-messages/bp-messages-loader.php:191
3658
  msgid "Inbox"
3659
  msgstr ""
3660
 
3661
- #: bp-messages/bp-messages-functions.php:236
3662
  msgid "You have %d new messages"
3663
  msgstr ""
3664
 
3665
- #: bp-messages/bp-messages-functions.php:239
3666
  msgid "You have %d new message"
3667
  msgstr ""
3668
 
@@ -3674,46 +4031,51 @@ msgstr ""
3674
  msgid "Search Messages..."
3675
  msgstr ""
3676
 
3677
- #: bp-messages/bp-messages-loader.php:132
3678
- #: bp-messages/bp-messages-loader.php:214
 
 
 
 
 
3679
  msgid "Sent"
3680
  msgstr ""
3681
 
3682
- #: bp-messages/bp-messages-loader.php:142
3683
- #: bp-messages/bp-messages-loader.php:222
3684
  msgid "Compose"
3685
  msgstr ""
3686
 
3687
- #: bp-messages/bp-messages-loader.php:153
3688
  msgid "Notices"
3689
  msgstr ""
3690
 
3691
- #: bp-messages/bp-messages-loader.php:187
3692
  msgid "Messages <span class=\"count\">%s</span>"
3693
  msgstr ""
3694
 
3695
- #: bp-messages/bp-messages-loader.php:188
3696
  msgid "Inbox <span class=\"count\">%s</span>"
3697
  msgstr ""
3698
 
3699
- #: bp-messages/bp-messages-loader.php:190
3700
- #: bp-messages/bp-messages-screens.php:148
3701
  msgid "Messages"
3702
  msgstr ""
3703
 
3704
- #: bp-messages/bp-messages-loader.php:231
3705
  msgid "All Member Notices"
3706
  msgstr ""
3707
 
3708
- #: bp-messages/bp-messages-loader.php:250
3709
  msgid "My Messages"
3710
  msgstr ""
3711
 
3712
- #: bp-messages/bp-messages-notifications.php:46
3713
  msgid "New message from %s"
3714
  msgstr ""
3715
 
3716
- #: bp-messages/bp-messages-notifications.php:48
3717
  msgid ""
3718
  "%1$s sent you a new message:\n"
3719
  "\n"
@@ -3743,38 +4105,34 @@ msgstr ""
3743
  msgid "Message sent successfully!"
3744
  msgstr ""
3745
 
3746
- #: bp-messages/bp-messages-screens.php:102
3747
  msgid "There was a problem deactivating that notice."
3748
  msgstr ""
3749
 
3750
- #: bp-messages/bp-messages-screens.php:104
3751
  msgid "Notice deactivated."
3752
  msgstr ""
3753
 
3754
- #: bp-messages/bp-messages-screens.php:108
3755
  msgid "There was a problem activating that notice."
3756
  msgstr ""
3757
 
3758
- #: bp-messages/bp-messages-screens.php:110
3759
  msgid "Notice activated."
3760
  msgstr ""
3761
 
3762
- #: bp-messages/bp-messages-screens.php:114
3763
  msgid "There was a problem deleting that notice."
3764
  msgstr ""
3765
 
3766
- #: bp-messages/bp-messages-screens.php:116
3767
  msgid "Notice deleted."
3768
  msgstr ""
3769
 
3770
- #: bp-messages/bp-messages-screens.php:157
3771
  msgid "A member sends you a new message"
3772
  msgstr ""
3773
 
3774
- #: bp-messages/bp-messages-screens.php:163
3775
- msgid "A new site notice is posted"
3776
- msgstr ""
3777
-
3778
  #: bp-messages/bp-messages-template.php:84
3779
  msgctxt "Message pagination previous text"
3780
  msgid "&larr;"
@@ -3785,224 +4143,137 @@ msgctxt "Message pagination next text"
3785
  msgid "&rarr;"
3786
  msgstr ""
3787
 
3788
- #: bp-messages/bp-messages-template.php:358
3789
  msgid "Viewing message %1$s to %2$s (of %3$s messages)"
3790
  msgstr ""
3791
 
3792
- #: bp-messages/bp-messages-template.php:434
3793
  msgid "Select:"
3794
  msgstr ""
3795
 
3796
- #: bp-messages/bp-messages-template.php:438
3797
  msgid "Read"
3798
  msgstr ""
3799
 
3800
- #: bp-messages/bp-messages-template.php:439
3801
  msgid "Unread"
3802
  msgstr ""
3803
 
3804
- #: bp-messages/bp-messages-template.php:445
3805
  msgid "Mark as Read"
3806
  msgstr ""
3807
 
3808
- #: bp-messages/bp-messages-template.php:446
3809
  msgid "Mark as Unread"
3810
  msgstr ""
3811
 
3812
- #: bp-messages/bp-messages-template.php:450
3813
  msgid "Delete Selected"
3814
  msgstr ""
3815
 
3816
- #: bp-messages/bp-messages-template.php:495
3817
  msgid "Currently Active"
3818
  msgstr ""
3819
 
3820
- #: bp-messages/bp-messages-template.php:562
3821
  msgid "Deactivate"
3822
  msgstr ""
3823
 
3824
- #: bp-messages/bp-messages-template.php:613
 
 
 
3825
  #: bp-themes/bp-default/functions.php:164
3826
- #: bp-themes/bp-default/members/single/profile/edit.php:128
3827
- #: bp-themes/bp-default/registration/register.php:169
3828
  msgid "Close"
3829
  msgstr ""
3830
 
3831
- #: bp-messages/bp-messages-template.php:656
3832
  msgid "Send a private message to this user."
3833
  msgstr ""
3834
 
3835
- #: bp-messages/bp-messages-template.php:657
3836
  msgid "Private Message"
3837
  msgstr ""
3838
 
3839
- #: bp-messages/bp-messages-template.php:840
3840
  msgid "%d Recipients"
3841
  msgstr ""
3842
 
3843
  #: bp-messages/bp-messages-template.php:922
 
3844
  #: bp-themes/bp-default/_inc/ajax.php:777
3845
  msgid "Sent %s"
3846
  msgstr ""
3847
 
3848
- #: bp-settings/bp-settings-actions.php:157
3849
  msgid "That email address is invalid. Check the formatting and try again."
3850
  msgstr ""
3851
 
3852
- #: bp-settings/bp-settings-actions.php:160
3853
  msgid "That email address is currently unavailable for use."
3854
  msgstr ""
3855
 
3856
- #: bp-settings/bp-settings-actions.php:163
3857
  msgid "That email address is already taken."
3858
  msgstr ""
3859
 
3860
- #: bp-settings/bp-settings-actions.php:166
3861
  msgid "Email address cannot be empty."
3862
  msgstr ""
3863
 
3864
- #: bp-settings/bp-settings-actions.php:176
3865
  msgid "Your current password is invalid."
3866
  msgstr ""
3867
 
3868
- #: bp-settings/bp-settings-actions.php:179
3869
  msgid "The new password fields did not match."
3870
  msgstr ""
3871
 
3872
- #: bp-settings/bp-settings-actions.php:182
3873
  msgid "One of the password fields was empty."
3874
  msgstr ""
3875
 
3876
- #: bp-settings/bp-settings-actions.php:191
3877
  msgid "Your settings have been saved."
3878
  msgstr ""
3879
 
3880
- #: bp-settings/bp-settings-actions.php:197
3881
  msgid "No changes were made to your account."
3882
  msgstr ""
3883
 
3884
- #: bp-settings/bp-settings-actions.php:199
3885
  msgid "No changes were made to this account."
3886
  msgstr ""
3887
 
3888
- #: bp-settings/bp-settings-actions.php:247
3889
  msgid "Your notification settings have been saved."
3890
  msgstr ""
3891
 
3892
- #: bp-settings/bp-settings-actions.php:249
3893
  msgid "This user's notification settings have been saved."
3894
  msgstr ""
3895
 
3896
- #: bp-settings/bp-settings-actions.php:340
3897
  msgid "%s was successfully deleted."
3898
  msgstr ""
3899
 
3900
- #: bp-settings/bp-settings-loader.php:98 bp-settings/bp-settings-loader.php:177
3901
  msgid "General"
3902
  msgstr ""
3903
 
3904
- #: bp-settings/bp-settings-loader.php:121
3905
  #: bp-themes/bp-default/members/single/settings/capabilities.php:49
3906
  msgid "Capabilities"
3907
  msgstr ""
3908
 
3909
- #: bp-themes/bp-default/404.php:7
3910
- msgid "Page not found"
3911
- msgstr ""
3912
-
3913
- #: bp-themes/bp-default/404.php:9
3914
- msgid "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help."
3915
- msgstr ""
3916
-
3917
- #: bp-themes/bp-default/_inc/ajax.php:278
3918
- msgid "There was a problem posting your update, please try again."
3919
- msgstr ""
3920
-
3921
- #: bp-themes/bp-default/_inc/ajax.php:380
3922
- #: bp-themes/bp-default/_inc/ajax.php:416
3923
- msgid "There was a problem when deleting. Please try again."
3924
- msgstr ""
3925
-
3926
- #: bp-themes/bp-default/_inc/ajax.php:479
3927
- #: bp-themes/bp-default/_inc/ajax.php:500
3928
- #: bp-themes/bp-default/activity/entry.php:72
3929
- #: bp-themes/bp-default/functions.php:167
3930
- msgid "Remove Favorite"
3931
- msgstr ""
3932
-
3933
- #: bp-themes/bp-default/_inc/ajax.php:481
3934
- #: bp-themes/bp-default/_inc/ajax.php:498
3935
- #: bp-themes/bp-default/activity/entry.php:68
3936
- #: bp-themes/bp-default/functions.php:166
3937
- msgid "Favorite"
3938
- msgstr ""
3939
-
3940
- #: bp-themes/bp-default/_inc/ajax.php:570
3941
- #: bp-themes/bp-default/groups/create.php:229
3942
- #: bp-themes/bp-default/groups/single/send-invites.php:42
3943
- msgid "Remove Invite"
3944
- msgstr ""
3945
-
3946
- #: bp-themes/bp-default/_inc/ajax.php:615
3947
- msgid " Friendship could not be requested."
3948
- msgstr ""
3949
-
3950
- #: bp-themes/bp-default/_inc/ajax.php:627
3951
- msgid "Friendship request could not be cancelled."
3952
- msgstr ""
3953
-
3954
- #: bp-themes/bp-default/_inc/ajax.php:632
3955
- msgid "Request Pending"
3956
- msgstr ""
3957
-
3958
- #: bp-themes/bp-default/_inc/ajax.php:652
3959
- msgid "There was a problem accepting that request. Please try again."
3960
- msgstr ""
3961
-
3962
- #: bp-themes/bp-default/_inc/ajax.php:671
3963
- msgid "There was a problem rejecting that request. Please try again."
3964
- msgstr ""
3965
-
3966
- #: bp-themes/bp-default/_inc/ajax.php:701
3967
- msgid "Error joining group"
3968
- msgstr ""
3969
-
3970
- #: bp-themes/bp-default/_inc/ajax.php:710
3971
- msgid "Error requesting membership"
3972
- msgstr ""
3973
-
3974
- #: bp-themes/bp-default/_inc/ajax.php:712
3975
- msgid "Membership Requested"
3976
- msgstr ""
3977
-
3978
- #: bp-themes/bp-default/_inc/ajax.php:720
3979
- msgid "Error leaving group"
3980
- msgstr ""
3981
-
3982
- #: bp-themes/bp-default/_inc/ajax.php:743
3983
- msgid "There was a problem closing the notice."
3984
- msgstr ""
3985
-
3986
- #: bp-themes/bp-default/_inc/ajax.php:794
3987
- msgid "There was a problem sending that reply. Please try again."
3988
- msgstr ""
3989
-
3990
- #: bp-themes/bp-default/_inc/ajax.php:812
3991
- msgid "There was a problem marking messages as unread."
3992
- msgstr ""
3993
-
3994
- #: bp-themes/bp-default/_inc/ajax.php:837
3995
- msgid "There was a problem marking messages as read."
3996
- msgstr ""
3997
-
3998
- #: bp-themes/bp-default/_inc/ajax.php:862
3999
- msgid "There was a problem deleting messages."
4000
- msgstr ""
4001
-
4002
  #: bp-themes/bp-default/activity/activity-loop.php:41
4003
  msgid "Load More"
4004
  msgstr ""
4005
 
 
4006
  #: bp-themes/bp-default/activity/activity-loop.php:55
4007
  msgid "Sorry, there was no activity found. Please try a different filter."
4008
  msgstr ""
@@ -4010,250 +4281,244 @@ msgstr ""
4010
  #. translators: 1: user profile link, 2: user name, 3: activity permalink, 4:
4011
  #. activity timestamp
4012
 
4013
- #: bp-themes/bp-default/activity/comment.php:27
 
4014
  msgid "<a href=\"%1$s\">%2$s</a> replied <a href=\"%3$s\" class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>"
4015
  msgstr ""
4016
 
4017
- #: bp-themes/bp-default/activity/entry.php:37
4018
- msgid "In reply to: "
4019
- msgstr ""
4020
-
4021
- #: bp-themes/bp-default/activity/entry.php:37
4022
- msgid "View Thread / Permalink"
4023
  msgstr ""
4024
 
 
4025
  #: bp-themes/bp-default/activity/entry.php:60
4026
  msgid "Comment <span>%s</span>"
4027
  msgstr ""
4028
 
 
4029
  #: bp-themes/bp-default/activity/entry.php:68
4030
  msgid "Mark as Favorite"
4031
  msgstr ""
4032
 
4033
- #: bp-themes/bp-default/activity/entry.php:104
4034
- msgid "Post"
 
 
 
 
 
 
 
4035
  msgstr ""
4036
 
4037
- #: bp-themes/bp-default/activity/entry.php:104
4038
- msgid "or press esc to cancel."
 
 
 
 
 
 
 
4039
  msgstr ""
4040
 
4041
- #: bp-themes/bp-default/activity/index.php:21
4042
- msgid "Site Activity"
 
4043
  msgstr ""
4044
 
 
4045
  #: bp-themes/bp-default/activity/index.php:39
4046
  msgid "The public activity for everyone on this site."
4047
  msgstr ""
4048
 
 
 
4049
  #: bp-themes/bp-default/activity/index.php:39
4050
  #: bp-themes/bp-default/members/index.php:33
4051
  msgid "All Members <span>%s</span>"
4052
  msgstr ""
4053
 
 
4054
  #: bp-themes/bp-default/activity/index.php:49
4055
  msgid "The activity of my friends only."
4056
  msgstr ""
4057
 
 
 
4058
  #: bp-themes/bp-default/activity/index.php:49
4059
  #: bp-themes/bp-default/members/index.php:37
4060
  msgid "My Friends <span>%s</span>"
4061
  msgstr ""
4062
 
 
4063
  #: bp-themes/bp-default/activity/index.php:61
4064
  msgid "The activity of groups I am a member of."
4065
  msgstr ""
4066
 
 
 
4067
  #: bp-themes/bp-default/activity/index.php:61
4068
  #: bp-themes/bp-default/groups/index.php:39
4069
  msgid "My Groups <span>%s</span>"
4070
  msgstr ""
4071
 
 
4072
  #: bp-themes/bp-default/activity/index.php:71
4073
  msgid "The activity I've marked as a favorite."
4074
  msgstr ""
4075
 
 
4076
  #: bp-themes/bp-default/activity/index.php:71
4077
  msgid "My Favorites <span>%s</span>"
4078
  msgstr ""
4079
 
 
4080
  #: bp-themes/bp-default/activity/index.php:77
4081
  msgid "Activity that I have been mentioned in."
4082
  msgstr ""
4083
 
 
4084
  #: bp-themes/bp-default/activity/index.php:77
4085
  msgid "<span>%s new</span>"
4086
  msgstr ""
4087
 
 
 
4088
  #: bp-themes/bp-default/activity/index.php:87
4089
  #: bp-themes/bp-default/groups/single/activity.php:3
4090
  msgid "RSS Feed"
4091
  msgstr ""
4092
 
 
 
4093
  #: bp-themes/bp-default/activity/index.php:87
4094
  #: bp-themes/bp-default/groups/single/activity.php:3
4095
  msgid "RSS"
4096
  msgstr ""
4097
 
 
 
 
4098
  #: bp-themes/bp-default/activity/index.php:92
4099
  #: bp-themes/bp-default/groups/single/activity.php:8
4100
  #: bp-themes/bp-default/members/single/activity.php:18
4101
  msgid "Show:"
4102
  msgstr ""
4103
 
 
 
 
4104
  #: bp-themes/bp-default/activity/index.php:94
4105
  #: bp-themes/bp-default/groups/single/activity.php:10
4106
  #: bp-themes/bp-default/members/single/activity.php:20
4107
  msgid "Everything"
4108
  msgstr ""
4109
 
 
 
 
4110
  #: bp-themes/bp-default/activity/index.php:95
4111
  #: bp-themes/bp-default/groups/single/activity.php:11
4112
  #: bp-themes/bp-default/members/single/activity.php:21
4113
  msgid "Updates"
4114
  msgstr ""
4115
 
 
 
4116
  #: bp-themes/bp-default/activity/index.php:100
4117
  #: bp-themes/bp-default/members/single/activity.php:28
4118
  msgid "Comments"
4119
  msgstr ""
4120
 
 
 
 
4121
  #: bp-themes/bp-default/activity/index.php:106
4122
  #: bp-themes/bp-default/groups/single/activity.php:14
4123
  #: bp-themes/bp-default/members/single/activity.php:43
4124
  msgid "Forum Topics"
4125
  msgstr ""
4126
 
 
 
 
4127
  #: bp-themes/bp-default/activity/index.php:107
4128
  #: bp-themes/bp-default/groups/single/activity.php:15
4129
  #: bp-themes/bp-default/members/single/activity.php:44
4130
  msgid "Forum Replies"
4131
  msgstr ""
4132
 
 
 
4133
  #: bp-themes/bp-default/activity/index.php:113
4134
  #: bp-themes/bp-default/members/single/activity.php:50
4135
  msgid "New Groups"
4136
  msgstr ""
4137
 
 
 
 
4138
  #: bp-themes/bp-default/activity/index.php:114
4139
  #: bp-themes/bp-default/groups/single/activity.php:18
4140
  #: bp-themes/bp-default/members/single/activity.php:51
4141
  msgid "Group Memberships"
4142
  msgstr ""
4143
 
 
4144
  #: bp-themes/bp-default/activity/index.php:124
4145
  msgid "New Members"
4146
  msgstr ""
4147
 
 
4148
  #: bp-themes/bp-default/activity/post-form.php:23
4149
  msgid "What's new in %s, %s?"
4150
  msgstr ""
4151
 
 
4152
  #: bp-themes/bp-default/activity/post-form.php:25
4153
  msgid "What's new, %s?"
4154
  msgstr ""
4155
 
 
4156
  #: bp-themes/bp-default/activity/post-form.php:35
4157
  msgid "Post Update"
4158
  msgstr ""
4159
 
 
4160
  #: bp-themes/bp-default/activity/post-form.php:42
4161
  msgid "Post in"
4162
  msgstr ""
4163
 
4164
- #: bp-themes/bp-default/archive.php:10
4165
- msgid "You are browsing the archive for %1$s."
4166
- msgstr ""
4167
-
4168
- #: bp-themes/bp-default/archive.php:24 bp-themes/bp-default/attachment.php:18
4169
- #: bp-themes/bp-default/index.php:24 bp-themes/bp-default/search.php:26
4170
- #: bp-themes/bp-default/single.php:16
4171
- msgctxt "Post written by..."
4172
- msgid "by %s"
4173
- msgstr ""
4174
-
4175
- #: bp-themes/bp-default/archive.php:28 bp-themes/bp-default/attachment.php:22
4176
- #: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:30
4177
- msgid "Permanent Link to"
4178
- msgstr ""
4179
-
4180
- #: bp-themes/bp-default/archive.php:30 bp-themes/bp-default/index.php:34
4181
- #: bp-themes/bp-default/search.php:32 bp-themes/bp-default/single.php:23
4182
- msgid "%1$s <span>in %2$s</span>"
4183
- msgstr ""
4184
-
4185
- #: bp-themes/bp-default/archive.php:33 bp-themes/bp-default/index.php:37
4186
- #: bp-themes/bp-default/search.php:35 bp-themes/bp-default/single.php:28
4187
- msgid "Read the rest of this entry &rarr;"
4188
- msgstr ""
4189
-
4190
- #: bp-themes/bp-default/archive.php:34 bp-themes/bp-default/index.php:38
4191
- #: bp-themes/bp-default/onecolumn-page.php:31 bp-themes/bp-default/page.php:20
4192
- #: bp-themes/bp-default/single.php:30
4193
- msgid "Pages: "
4194
- msgstr ""
4195
-
4196
- #: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
4197
- #: bp-themes/bp-default/search.php:38 bp-themes/bp-default/single.php:33
4198
- msgid "Tags: "
4199
- msgstr ""
4200
-
4201
- #: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
4202
- #: bp-themes/bp-default/search.php:38
4203
- msgid "No Comments &#187;"
4204
- msgstr ""
4205
-
4206
- #: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
4207
- #: bp-themes/bp-default/search.php:38
4208
- msgid "1 Comment &#187;"
4209
- msgstr ""
4210
-
4211
- #: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
4212
- #: bp-themes/bp-default/search.php:38
4213
- msgid "% Comments &#187;"
4214
- msgstr ""
4215
-
4216
- #: bp-themes/bp-default/archive.php:50 bp-themes/bp-default/index.php:54
4217
- msgid "Not Found"
4218
- msgstr ""
4219
-
4220
- #: bp-themes/bp-default/attachment.php:26 bp-themes/bp-default/single.php:24
4221
- msgid "Edit this entry"
4222
- msgstr ""
4223
-
4224
- #: bp-themes/bp-default/attachment.php:40
4225
- msgid "Full size is %s pixels"
4226
- msgstr ""
4227
-
4228
- #: bp-themes/bp-default/attachment.php:43
4229
- msgid "Link to full size image"
4230
- msgstr ""
4231
-
4232
- #: bp-themes/bp-default/attachment.php:62
4233
- msgid "Sorry, no attachments matched your criteria."
4234
- msgstr ""
4235
-
4236
  #: bp-themes/bp-default/blogs/blogs-loop.php:90
4237
  msgid "Sorry, there were no sites found."
4238
  msgstr ""
4239
 
4240
- #: bp-themes/bp-default/blogs/create.php:21
4241
- #: bp-themes/bp-default/blogs/index.php:21
4242
- msgid "Site Directory"
4243
- msgstr ""
4244
-
4245
  #: bp-themes/bp-default/blogs/create.php:32
4246
  msgid "Site registration is currently disabled"
4247
  msgstr ""
4248
 
 
4249
  #: bp-themes/bp-default/blogs/index.php:33
4250
  msgid "All Sites <span>%s</span>"
4251
  msgstr ""
4252
 
 
4253
  #: bp-themes/bp-default/blogs/index.php:37
4254
  msgid "My Sites <span>%s</span>"
4255
  msgstr ""
4256
 
 
 
 
 
 
 
 
 
 
4257
  #: bp-themes/bp-default/blogs/index.php:53
4258
  #: bp-themes/bp-default/forums/index.php:60
4259
  #: bp-themes/bp-default/groups/index.php:55
@@ -4263,10 +4528,18 @@ msgstr ""
4263
  #: bp-themes/bp-default/members/single/forums.php:18
4264
  #: bp-themes/bp-default/members/single/friends.php:20
4265
  #: bp-themes/bp-default/members/single/groups.php:20
4266
- #: bp-xprofile/bp-xprofile-classes.php:741
4267
  msgid "Order By:"
4268
  msgstr ""
4269
 
 
 
 
 
 
 
 
 
 
4270
  #: bp-themes/bp-default/blogs/index.php:55
4271
  #: bp-themes/bp-default/forums/index.php:62
4272
  #: bp-themes/bp-default/groups/index.php:57
@@ -4279,6 +4552,12 @@ msgstr ""
4279
  msgid "Last Active"
4280
  msgstr ""
4281
 
 
 
 
 
 
 
4282
  #: bp-themes/bp-default/blogs/index.php:57
4283
  #: bp-themes/bp-default/groups/index.php:60
4284
  #: bp-themes/bp-default/members/index.php:60
@@ -4288,259 +4567,157 @@ msgstr ""
4288
  msgid "Alphabetical"
4289
  msgstr ""
4290
 
4291
- #: bp-themes/bp-default/comments.php:3
4292
- msgid "Password Protected"
 
4293
  msgstr ""
4294
 
4295
- #: bp-themes/bp-default/comments.php:4
4296
- msgid "Enter the password to view comments."
4297
- msgstr ""
4298
-
4299
- #: bp-themes/bp-default/comments.php:24
4300
- msgid "1 response to %2$s"
4301
- msgid_plural "%1$s responses to %2$s"
4302
- msgstr[0] ""
4303
- msgstr[1] ""
4304
-
4305
- #: bp-themes/bp-default/comments.php:46
4306
- msgid "Comments are closed, but <a href=\"%1$s\" title=\"Trackback URL for this post\">trackbacks</a> and pingbacks are open."
4307
- msgstr ""
4308
-
4309
- #: bp-themes/bp-default/comments.php:50
4310
- msgid "Comments are closed."
4311
- msgstr ""
4312
-
4313
- #: bp-themes/bp-default/comments.php:62
4314
- msgid "1 trackback"
4315
- msgid_plural "%d trackbacks"
4316
- msgstr[0] ""
4317
- msgstr[1] ""
4318
-
4319
- #: bp-themes/bp-default/footer.php:15
4320
- msgid "Proudly powered by <a href=\"%1$s\">WordPress</a> and <a href=\"%2$s\">BuddyPress</a>."
4321
- msgstr ""
4322
-
4323
- #: bp-themes/bp-default/forums/forums-loop.php:39
4324
- msgid "Topic"
4325
- msgstr ""
4326
-
4327
- #: bp-themes/bp-default/forums/forums-loop.php:41
4328
- msgid "Freshness"
4329
  msgstr ""
4330
 
 
 
4331
  #: bp-themes/bp-default/forums/forums-loop.php:54
4332
- msgid "Permalink"
 
4333
  msgstr ""
4334
 
4335
  #. translators: "started by [poster] in [forum]"
4336
 
 
4337
  #: bp-themes/bp-default/forums/forums-loop.php:61
4338
  msgid "Started by %1$s"
4339
  msgstr ""
4340
 
4341
  #. translators: "started by [poster] in [forum]"
4342
 
 
4343
  #: bp-themes/bp-default/forums/forums-loop.php:72
4344
  msgid "in %1$s"
4345
  msgstr ""
4346
 
 
4347
  #: bp-themes/bp-default/forums/forums-loop.php:122
4348
  msgid "Sorry, there were no forum topics found."
4349
  msgstr ""
4350
 
4351
- #: bp-themes/bp-default/forums/index.php:23
4352
- msgid "Forums Directory"
4353
- msgstr ""
4354
-
4355
  #: bp-themes/bp-default/forums/index.php:40
4356
  msgid "All Topics <span>%s</span>"
4357
  msgstr ""
4358
 
 
4359
  #: bp-themes/bp-default/forums/index.php:44
4360
  msgid "My Topics <span>%s</span>"
4361
  msgstr ""
4362
 
 
 
 
4363
  #: bp-themes/bp-default/forums/index.php:63
4364
  #: bp-themes/bp-default/groups/single/forum.php:39
4365
  #: bp-themes/bp-default/members/single/forums.php:21
4366
  msgid "Most Posts"
4367
  msgstr ""
4368
 
 
 
 
4369
  #: bp-themes/bp-default/forums/index.php:64
4370
  #: bp-themes/bp-default/groups/single/forum.php:40
4371
  #: bp-themes/bp-default/members/single/forums.php:22
4372
  msgid "Unreplied"
4373
  msgstr ""
4374
 
 
4375
  #: bp-themes/bp-default/forums/index.php:100
4376
  msgid "Create New Topic:"
4377
  msgstr ""
4378
 
 
 
 
4379
  #: bp-themes/bp-default/forums/index.php:107
4380
  #: bp-themes/bp-default/groups/single/forum/edit.php:50
4381
  #: bp-themes/bp-default/groups/single/forum.php:78
4382
  msgid "Content:"
4383
  msgstr ""
4384
 
 
 
 
4385
  #: bp-themes/bp-default/forums/index.php:110
4386
  #: bp-themes/bp-default/groups/single/forum/edit.php:53
4387
  #: bp-themes/bp-default/groups/single/forum.php:81
4388
  msgid "Tags (comma separated):"
4389
  msgstr ""
4390
 
 
4391
  #: bp-themes/bp-default/forums/index.php:113
4392
  msgid "Post In Group Forum:"
4393
  msgstr ""
4394
 
4395
  #. translators: no option picked in select box
4396
 
 
4397
  #: bp-themes/bp-default/forums/index.php:116
4398
- #: bp-xprofile/bp-xprofile-template.php:463
4399
  msgid "----"
4400
  msgstr ""
4401
 
 
 
4402
  #: bp-themes/bp-default/forums/index.php:133
4403
  #: bp-themes/bp-default/groups/single/forum.php:87
4404
  msgid "Post Topic"
4405
  msgstr ""
4406
 
 
4407
  #: bp-themes/bp-default/forums/index.php:145
4408
  msgid "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum."
4409
  msgstr ""
4410
 
4411
- #: bp-themes/bp-default/functions.php:85
4412
- msgid "Primary Navigation"
4413
- msgstr ""
4414
-
4415
- #: bp-themes/bp-default/functions.php:158
4416
- msgid "My Favorites"
4417
- msgstr ""
4418
-
4419
- #: bp-themes/bp-default/functions.php:159
4420
- msgid "Accepted"
4421
- msgstr ""
4422
-
4423
- #: bp-themes/bp-default/functions.php:160
4424
- msgid "Rejected"
4425
- msgstr ""
4426
-
4427
- #: bp-themes/bp-default/functions.php:161
4428
- msgid "Show all comments for this thread"
4429
- msgstr ""
4430
-
4431
- #: bp-themes/bp-default/functions.php:162
4432
- msgid "Show all"
4433
- msgstr ""
4434
-
4435
- #: bp-themes/bp-default/functions.php:163
4436
- msgid "comments"
4437
- msgstr ""
4438
-
4439
- #: bp-themes/bp-default/functions.php:389
4440
- msgid "The sidebar widget area"
4441
- msgstr ""
4442
-
4443
- #: bp-themes/bp-default/functions.php:398
4444
- msgid "First Footer Widget Area"
4445
- msgstr ""
4446
-
4447
- #: bp-themes/bp-default/functions.php:400
4448
- msgid "The first footer widget area"
4449
- msgstr ""
4450
-
4451
- #: bp-themes/bp-default/functions.php:409
4452
- msgid "Second Footer Widget Area"
4453
- msgstr ""
4454
-
4455
- #: bp-themes/bp-default/functions.php:411
4456
- msgid "The second footer widget area"
4457
- msgstr ""
4458
-
4459
- #: bp-themes/bp-default/functions.php:420
4460
- msgid "Third Footer Widget Area"
4461
- msgstr ""
4462
-
4463
- #: bp-themes/bp-default/functions.php:422
4464
- msgid "The third footer widget area"
4465
- msgstr ""
4466
-
4467
- #: bp-themes/bp-default/functions.php:431
4468
- msgid "Fourth Footer Widget Area"
4469
- msgstr ""
4470
-
4471
- #: bp-themes/bp-default/functions.php:433
4472
- msgid "The fourth footer widget area"
4473
- msgstr ""
4474
-
4475
- #. translators: 1: comment author url, 2: comment author name, 3: comment
4476
- #. permalink, 4: comment date/timestamp
4477
-
4478
- #: bp-themes/bp-default/functions.php:488
4479
- msgid "<a href=\"%1$s\" rel=\"nofollow\">%2$s</a> said on <a href=\"%3$s\"><span class=\"time-since\">%4$s</span></a>"
4480
- msgstr ""
4481
-
4482
- #: bp-themes/bp-default/functions.php:495
4483
- msgid "Your comment is awaiting moderation."
4484
- msgstr ""
4485
-
4486
- #: bp-themes/bp-default/functions.php:507
4487
- msgid "Edit comment"
4488
- msgstr ""
4489
-
4490
- #: bp-themes/bp-default/functions.php:577
4491
- msgid "Theme activated! This theme contains <a href=\"%s\">custom header image</a> support and <a href=\"%s\">sidebar widgets</a>."
4492
- msgstr ""
4493
-
4494
- #: bp-themes/bp-default/functions.php:643
4495
- msgid "Email"
4496
- msgstr ""
4497
-
4498
- #: bp-themes/bp-default/functions.php:653
4499
- msgid "You must be <a href=\"%1$s\">logged in</a> to post a comment."
4500
- msgstr ""
4501
-
4502
- #: bp-themes/bp-default/functions.php:654
4503
- msgid "Leave a reply"
4504
- msgstr ""
4505
-
4506
- #: bp-themes/bp-default/functions.php:741
4507
- msgid "&larr; Previous Entries"
4508
- msgstr ""
4509
-
4510
- #: bp-themes/bp-default/functions.php:742
4511
- msgid "Next Entries &rarr;"
4512
- msgstr ""
4513
-
4514
- #: bp-themes/bp-default/groups/create.php:18
4515
- #: bp-themes/bp-default/groups/index.php:21
4516
- msgid "Groups Directory"
4517
- msgstr ""
4518
-
4519
  #: bp-themes/bp-default/groups/create.php:39
4520
  #: bp-themes/bp-default/groups/single/admin.php:16
4521
  msgid "Group Name (required)"
4522
  msgstr ""
4523
 
 
 
4524
  #: bp-themes/bp-default/groups/create.php:42
4525
  #: bp-themes/bp-default/groups/single/admin.php:19
4526
  msgid "Group Description (required)"
4527
  msgstr ""
4528
 
 
 
4529
  #: bp-themes/bp-default/groups/create.php:58
4530
  #: bp-themes/bp-default/groups/single/admin.php:56
4531
  msgid "Privacy Options"
4532
  msgstr ""
4533
 
 
 
4534
  #: bp-themes/bp-default/groups/create.php:62
4535
  #: bp-themes/bp-default/groups/single/admin.php:61
4536
  msgid "This is a public group"
4537
  msgstr ""
4538
 
 
 
4539
  #: bp-themes/bp-default/groups/create.php:64
4540
  #: bp-themes/bp-default/groups/single/admin.php:63
4541
  msgid "Any site member can join this group."
4542
  msgstr ""
4543
 
 
 
 
 
4544
  #: bp-themes/bp-default/groups/create.php:65
4545
  #: bp-themes/bp-default/groups/create.php:74
4546
  #: bp-themes/bp-default/groups/single/admin.php:64
@@ -4548,21 +4725,31 @@ msgstr ""
4548
  msgid "This group will be listed in the groups directory and in search results."
4549
  msgstr ""
4550
 
 
 
4551
  #: bp-themes/bp-default/groups/create.php:66
4552
  #: bp-themes/bp-default/groups/single/admin.php:65
4553
  msgid "Group content and activity will be visible to any site member."
4554
  msgstr ""
4555
 
 
 
4556
  #: bp-themes/bp-default/groups/create.php:71
4557
  #: bp-themes/bp-default/groups/single/admin.php:71
4558
  msgid "This is a private group"
4559
  msgstr ""
4560
 
 
 
4561
  #: bp-themes/bp-default/groups/create.php:73
4562
  #: bp-themes/bp-default/groups/single/admin.php:73
4563
  msgid "Only users who request membership and are accepted can join the group."
4564
  msgstr ""
4565
 
 
 
 
 
4566
  #: bp-themes/bp-default/groups/create.php:75
4567
  #: bp-themes/bp-default/groups/create.php:84
4568
  #: bp-themes/bp-default/groups/single/admin.php:75
@@ -4570,644 +4757,1135 @@ msgstr ""
4570
  msgid "Group content and activity will only be visible to members of the group."
4571
  msgstr ""
4572
 
 
 
4573
  #: bp-themes/bp-default/groups/create.php:80
4574
  #: bp-themes/bp-default/groups/single/admin.php:81
4575
  msgid "This is a hidden group"
4576
  msgstr ""
4577
 
 
 
4578
  #: bp-themes/bp-default/groups/create.php:82
4579
  #: bp-themes/bp-default/groups/single/admin.php:83
4580
  msgid "Only users who are invited can join the group."
4581
  msgstr ""
4582
 
 
 
4583
  #: bp-themes/bp-default/groups/create.php:83
4584
  #: bp-themes/bp-default/groups/single/admin.php:84
4585
  msgid "This group will not be listed in the groups directory or search results."
4586
  msgstr ""
4587
 
 
 
4588
  #: bp-themes/bp-default/groups/create.php:89
4589
  #: bp-themes/bp-default/groups/single/admin.php:92
4590
  msgid "Group Invitations"
4591
  msgstr ""
4592
 
 
 
4593
  #: bp-themes/bp-default/groups/create.php:91
4594
  #: bp-themes/bp-default/groups/single/admin.php:94
4595
  msgid "Which members of this group are allowed to invite others?"
4596
  msgstr ""
4597
 
4598
- #: bp-themes/bp-default/groups/create.php:96
4599
- #: bp-themes/bp-default/groups/single/admin.php:99
4600
- msgid "All group members"
4601
- msgstr ""
4602
-
4603
- #: bp-themes/bp-default/groups/create.php:101
4604
- #: bp-themes/bp-default/groups/single/admin.php:104
4605
- msgid "Group admins and mods only"
4606
- msgstr ""
4607
-
4608
- #: bp-themes/bp-default/groups/create.php:106
4609
- #: bp-themes/bp-default/groups/single/admin.php:109
4610
- msgid "Group admins only"
4611
- msgstr ""
4612
-
4613
- #: bp-themes/bp-default/groups/create.php:112
4614
- msgid "Group Forums"
4615
- msgstr ""
4616
-
4617
  #: bp-themes/bp-default/groups/create.php:116
4618
  msgid "Should this group have a forum?"
4619
  msgstr ""
4620
 
4621
- #: bp-themes/bp-default/groups/create.php:119
4622
- #: bp-themes/bp-default/groups/single/admin.php:47
4623
- msgid "Enable discussion forum"
4624
- msgstr ""
4625
-
4626
  #: bp-themes/bp-default/groups/create.php:123
4627
  msgid "<strong>Attention Site Admin:</strong> Group forums require the <a href=\"%s\">correct setup and configuration</a> of a bbPress installation."
4628
  msgstr ""
4629
 
 
 
4630
  #: bp-themes/bp-default/groups/create.php:149
4631
  #: bp-themes/bp-default/groups/single/admin.php:127
4632
  msgid "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results."
4633
  msgstr ""
4634
 
 
 
 
4635
  #: bp-themes/bp-default/groups/create.php:153
4636
  #: bp-themes/bp-default/groups/single/admin.php:131
4637
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:18
4638
  msgid "Upload Image"
4639
  msgstr ""
4640
 
 
4641
  #: bp-themes/bp-default/groups/create.php:157
4642
  msgid "To skip the avatar upload process, hit the \"Next Step\" button."
4643
  msgstr ""
4644
 
 
4645
  #: bp-themes/bp-default/groups/create.php:164
4646
  msgid "Crop Group Avatar"
4647
  msgstr ""
4648
 
 
 
 
4649
  #: bp-themes/bp-default/groups/create.php:166
4650
  #: bp-themes/bp-default/groups/single/admin.php:151
4651
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:33
4652
  msgid "Avatar to crop"
4653
  msgstr ""
4654
 
 
 
 
4655
  #: bp-themes/bp-default/groups/create.php:169
4656
  #: bp-themes/bp-default/groups/single/admin.php:154
4657
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:36
4658
  msgid "Avatar preview"
4659
  msgstr ""
4660
 
 
 
 
4661
  #: bp-themes/bp-default/groups/create.php:172
4662
  #: bp-themes/bp-default/groups/single/admin.php:157
4663
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:39
4664
  msgid "Crop Image"
4665
  msgstr ""
4666
 
 
 
4667
  #: bp-themes/bp-default/groups/create.php:211
4668
  #: bp-themes/bp-default/groups/single/send-invites.php:22
4669
  msgid "Select people to invite from your friends list."
4670
  msgstr ""
4671
 
 
 
 
 
 
 
 
 
 
 
 
4672
  #: bp-themes/bp-default/groups/create.php:246
4673
  #: bp-themes/bp-default/groups/single/send-invites.php:73
4674
- msgid "Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the \"Send Invites\" option when viewing your new group."
4675
  msgstr ""
4676
 
 
4677
  #: bp-themes/bp-default/groups/create.php:268
4678
  msgid "Back to Previous Step"
4679
  msgstr ""
4680
 
 
4681
  #: bp-themes/bp-default/groups/create.php:275
4682
  msgid "Next Step"
4683
  msgstr ""
4684
 
 
4685
  #: bp-themes/bp-default/groups/create.php:282
4686
  msgid "Create Group and Continue"
4687
  msgstr ""
4688
 
 
 
 
 
 
 
4689
  #: bp-themes/bp-default/groups/groups-loop.php:95
4690
  msgid "There were no groups found."
4691
  msgstr ""
4692
 
 
4693
  #: bp-themes/bp-default/groups/index.php:35
4694
  msgid "All Groups <span>%s</span>"
4695
  msgstr ""
4696
 
 
 
4697
  #: bp-themes/bp-default/groups/index.php:58
4698
  #: bp-themes/bp-default/members/single/groups.php:23
4699
  msgid "Most Members"
4700
  msgstr ""
4701
 
 
 
4702
  #: bp-themes/bp-default/groups/index.php:59
4703
  #: bp-themes/bp-default/members/single/groups.php:24
4704
  msgid "Newly Created"
4705
  msgstr ""
4706
 
 
4707
  #: bp-themes/bp-default/groups/single/admin.php:25
4708
  msgid "Notify group members of changes via email"
4709
  msgstr ""
4710
 
 
4711
  #: bp-themes/bp-default/groups/single/admin.php:137
4712
  msgid "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button."
4713
  msgstr ""
4714
 
 
 
4715
  #: bp-themes/bp-default/groups/single/admin.php:139
4716
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:24
4717
  msgid "Delete Avatar"
4718
  msgstr ""
4719
 
 
4720
  #: bp-themes/bp-default/groups/single/admin.php:149
4721
  msgid "Crop Avatar"
4722
  msgstr ""
4723
 
4724
- #: bp-themes/bp-default/groups/single/admin.php:177
4725
- msgid "Administrators"
4726
- msgstr ""
4727
-
4728
- #: bp-themes/bp-default/groups/single/admin.php:205
4729
- msgid "Moderators"
4730
- msgstr ""
4731
-
4732
  #: bp-themes/bp-default/groups/single/admin.php:260
4733
  msgid "(banned)"
4734
  msgstr ""
4735
 
 
4736
  #: bp-themes/bp-default/groups/single/admin.php:266
4737
  msgid "Unban this member"
4738
  msgstr ""
4739
 
 
4740
  #: bp-themes/bp-default/groups/single/admin.php:266
4741
  msgid "Remove Ban"
4742
  msgstr ""
4743
 
 
4744
  #: bp-themes/bp-default/groups/single/admin.php:270
4745
  msgid "Kick and ban this member"
4746
  msgstr ""
4747
 
 
4748
  #: bp-themes/bp-default/groups/single/admin.php:270
4749
  msgid "Kick &amp; Ban"
4750
  msgstr ""
4751
 
 
4752
  #: bp-themes/bp-default/groups/single/admin.php:271
4753
  msgid "Promote to Mod"
4754
  msgstr ""
4755
 
 
4756
  #: bp-themes/bp-default/groups/single/admin.php:276
4757
  msgid "Remove this member"
4758
  msgstr ""
4759
 
 
4760
  #: bp-themes/bp-default/groups/single/admin.php:276
4761
  msgid "Remove from group"
4762
  msgstr ""
4763
 
 
 
4764
  #: bp-themes/bp-default/groups/single/admin.php:290
4765
  #: bp-themes/bp-default/groups/single/members.php:87
4766
  msgid "This group has no members."
4767
  msgstr ""
4768
 
 
 
 
4769
  #: bp-themes/bp-default/groups/single/admin.php:320
4770
  #: bp-themes/bp-default/members/single/friends/requests.php:37
4771
  #: bp-themes/bp-default/members/single/groups/invites.php:23
4772
  msgid "Accept"
4773
  msgstr ""
4774
 
 
 
 
4775
  #: bp-themes/bp-default/groups/single/admin.php:322
4776
  #: bp-themes/bp-default/members/single/friends/requests.php:38
4777
  #: bp-themes/bp-default/members/single/groups/invites.php:24
4778
  msgid "Reject"
4779
  msgstr ""
4780
 
 
4781
  #: bp-themes/bp-default/groups/single/admin.php:335
4782
  msgid "There are no pending membership requests."
4783
  msgstr ""
4784
 
 
4785
  #: bp-themes/bp-default/groups/single/admin.php:352
4786
  msgid "WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option."
4787
  msgstr ""
4788
 
 
4789
  #: bp-themes/bp-default/groups/single/admin.php:355
4790
  msgid "I understand the consequences of deleting this group."
4791
  msgstr ""
4792
 
 
 
 
4793
  #: bp-themes/bp-default/groups/single/forum/edit.php:16
4794
  #: bp-themes/bp-default/groups/single/forum/topic.php:17
4795
  #: bp-themes/bp-default/groups/single/forum.php:27
4796
  msgid "Forum Directory"
4797
  msgstr ""
4798
 
 
4799
  #: bp-themes/bp-default/groups/single/forum/edit.php:25
4800
  msgid "Edit:"
4801
  msgstr ""
4802
 
 
4803
  #: bp-themes/bp-default/groups/single/forum/edit.php:87
4804
  msgid "This topic does not exist."
4805
  msgstr ""
4806
 
 
4807
  #: bp-themes/bp-default/groups/single/forum/topic.php:9
4808
  msgid "New Reply"
4809
  msgstr ""
4810
 
 
4811
  #: bp-themes/bp-default/groups/single/forum/topic.php:32
4812
  msgid "Topic tags:"
4813
  msgstr ""
4814
 
 
4815
  #: bp-themes/bp-default/groups/single/forum/topic.php:81
4816
  msgid "%1$s said %2$s:"
4817
  msgstr ""
4818
 
4819
- #: bp-themes/bp-default/groups/single/forum/topic.php:95
4820
- msgid "Permanent link to this post"
4821
- msgstr ""
4822
-
4823
  #: bp-themes/bp-default/groups/single/forum/topic.php:119
4824
  msgid "There are no posts for this topic."
4825
  msgstr ""
4826
 
 
4827
  #: bp-themes/bp-default/groups/single/forum/topic.php:134
4828
  msgid "You will auto join this group when you reply to this topic."
4829
  msgstr ""
4830
 
 
4831
  #: bp-themes/bp-default/groups/single/forum/topic.php:139
4832
  msgid "Add a reply:"
4833
  msgstr ""
4834
 
 
4835
  #: bp-themes/bp-default/groups/single/forum/topic.php:144
4836
  msgid "Post Reply"
4837
  msgstr ""
4838
 
 
4839
  #: bp-themes/bp-default/groups/single/forum/topic.php:155
4840
  msgid "This topic is closed, replies are no longer accepted."
4841
  msgstr ""
4842
 
 
4843
  #: bp-themes/bp-default/groups/single/forum.php:69
4844
  msgid "You will auto join this group when you start a new topic."
4845
  msgstr ""
4846
 
 
4847
  #: bp-themes/bp-default/groups/single/forum.php:73
4848
  msgid "Post a New Topic:"
4849
  msgstr ""
4850
 
 
4851
  #: bp-themes/bp-default/groups/single/group-header.php:11
4852
  msgid "Group Admins"
4853
  msgstr ""
4854
 
 
4855
  #: bp-themes/bp-default/groups/single/group-header.php:20
4856
  msgid "Group Mods"
4857
  msgstr ""
4858
 
 
4859
  #: bp-themes/bp-default/groups/single/request-membership.php:4
4860
  msgid "You are requesting to become a member of the group '%s'."
4861
  msgstr ""
4862
 
 
4863
  #: bp-themes/bp-default/groups/single/request-membership.php:7
4864
  msgid "Comments (optional)"
4865
  msgstr ""
4866
 
 
4867
  #: bp-themes/bp-default/groups/single/request-membership.php:12
4868
  msgid "Send Request"
4869
  msgstr ""
4870
 
4871
- #: bp-themes/bp-default/header.php:22
4872
- msgctxt "Home page banner link title"
4873
- msgid "Home"
4874
- msgstr ""
4875
-
4876
- #: bp-themes/bp-default/header.php:25
4877
- msgid "Search for:"
4878
- msgstr ""
4879
-
4880
- #: bp-themes/bp-default/index.php:27
4881
- msgctxt "Sticky post"
4882
- msgid "Featured"
4883
  msgstr ""
4884
 
4885
- #: bp-themes/bp-default/index.php:55
4886
- msgid "Sorry, but you are looking for something that isn't here."
 
4887
  msgstr ""
4888
 
4889
- #: bp-themes/bp-default/links.php:16
4890
- msgid "Links"
 
4891
  msgstr ""
4892
 
4893
- #: bp-themes/bp-default/members/index.php:21
4894
- msgid "Members Directory"
 
4895
  msgstr ""
4896
 
 
 
4897
  #: bp-themes/bp-default/members/index.php:56
4898
  #: bp-themes/bp-default/members/single/friends.php:23
4899
  msgid "Newest Registered"
4900
  msgstr ""
4901
 
 
4902
  #: bp-themes/bp-default/members/members-loop.php:108
4903
  msgid "Sorry, no members were found."
4904
  msgstr ""
4905
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4906
  #: bp-themes/bp-default/members/single/friends/requests.php:68
4907
  msgid "You have no pending friendship requests."
4908
  msgstr ""
4909
 
 
4910
  #: bp-themes/bp-default/members/single/groups/invites.php:37
4911
  msgid "You have no outstanding group invites."
4912
  msgstr ""
4913
 
 
4914
  #: bp-themes/bp-default/members/single/messages/compose.php:5
4915
  msgid "Send To (Username or Friend's Name)"
4916
  msgstr ""
4917
 
 
4918
  #: bp-themes/bp-default/members/single/messages/compose.php:14
4919
  msgid "This is a notice to all users."
4920
  msgstr ""
4921
 
 
4922
  #: bp-themes/bp-default/members/single/messages/compose.php:17
4923
  msgid "Subject"
4924
  msgstr ""
4925
 
 
4926
  #: bp-themes/bp-default/members/single/messages/compose.php:20
4927
  msgid "Message"
4928
  msgstr ""
4929
 
 
4930
  #: bp-themes/bp-default/members/single/messages/compose.php:28
4931
  msgid "Send Message"
4932
  msgstr ""
4933
 
 
4934
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:32
4935
  msgid "From:"
4936
  msgstr ""
4937
 
 
4938
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:37
4939
  msgid "To:"
4940
  msgstr ""
4941
 
 
4942
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:43
4943
  msgid "View Message"
4944
  msgstr ""
4945
 
 
 
 
4946
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:51
4947
  #: bp-themes/bp-default/members/single/messages/notices-loop.php:43
4948
  #: bp-themes/bp-default/members/single/messages/single.php:24
4949
  msgid "Delete Message"
4950
  msgstr ""
4951
 
 
4952
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:69
4953
  msgid "Sorry, no messages were found."
4954
  msgstr ""
4955
 
 
4956
  #: bp-themes/bp-default/members/single/messages/notices-loop.php:36
4957
  msgid "Sent:"
4958
  msgstr ""
4959
 
 
4960
  #: bp-themes/bp-default/members/single/messages/notices-loop.php:54
4961
  msgid "Sorry, no notices were found."
4962
  msgstr ""
4963
 
 
4964
  #: bp-themes/bp-default/members/single/messages/single.php:14
4965
  msgid "You are alone in this conversation."
4966
  msgstr ""
4967
 
 
4968
  #: bp-themes/bp-default/members/single/messages/single.php:18
4969
  msgid "Conversation between %s and you."
4970
  msgstr ""
4971
 
 
4972
  #: bp-themes/bp-default/members/single/messages/single.php:75
4973
  msgid "Send a Reply"
4974
  msgstr ""
4975
 
 
4976
  #: bp-themes/bp-default/members/single/messages/single.php:91
4977
  msgid "Send Reply"
4978
  msgstr ""
4979
 
 
4980
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:1
4981
- #: bp-xprofile/bp-xprofile-loader.php:182
4982
- #: bp-xprofile/bp-xprofile-loader.php:238
4983
  msgid "Change Avatar"
4984
  msgstr ""
4985
 
 
4986
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:7
4987
  msgid "Your avatar will be used on your profile and throughout the site. If there is a <a href=\"http://gravatar.com\">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer."
4988
  msgstr ""
4989
 
4990
- #: bp-themes/bp-default/members/single/profile/change-avatar.php:14
4991
- msgid "Click below to select a JPG, GIF or PNG format photo from your computer and then click 'Upload Image' to proceed."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  msgstr ""
5
  "Project-Id-Version: BuddyPress \n"
6
  "Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
7
+ "POT-Creation-Date: 2013-04-08 17:36:00+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
25
  msgstr ""
26
 
27
  #: bp-activity/bp-activity-actions.php:263
28
+ #: bp-templates/bp-legacy/buddypress-functions.php:554
29
  #: bp-themes/bp-default/_inc/ajax.php:263
30
  msgid "Please enter some content to post."
31
  msgstr ""
39
  msgstr ""
40
 
41
  #: bp-activity/bp-activity-actions.php:323
42
+ #: bp-templates/bp-legacy/buddypress-functions.php:602
43
  #: bp-themes/bp-default/_inc/ajax.php:311
44
  msgid "Please do not leave the comment area blank."
45
  msgstr ""
49
  msgstr ""
50
 
51
  #: bp-activity/bp-activity-actions.php:336
52
+ #: bp-templates/bp-legacy/buddypress-functions.php:605
53
+ #: bp-templates/bp-legacy/buddypress-functions.php:614
54
  #: bp-themes/bp-default/_inc/ajax.php:314
55
  #: bp-themes/bp-default/_inc/ajax.php:323
56
  msgid "There was an error posting that reply, please try again."
75
  #. translators: Personal activity RSS title - "[Site Name] | [Displayed User
76
  #. Name] | Activity"
77
 
78
+ #: bp-activity/bp-activity-admin.php:35 bp-activity/bp-activity-admin.php:36
79
+ #: bp-activity/bp-activity-admin.php:852 bp-activity/bp-activity-admin.php:1167
80
  #: bp-activity/bp-activity-loader.php:118
81
+ #: bp-activity/bp-activity-loader.php:242
82
  #: bp-activity/bp-activity-screens.php:278
83
+ #: bp-activity/bp-activity-screens.php:394
84
+ #: bp-activity/feeds/bp-activity-personal-feed.php:27
85
+ #: bp-core/bp-core-admin.php:409
86
  msgid "Activity"
87
  msgstr ""
88
 
89
+ #: bp-activity/bp-activity-admin.php:85
90
  msgid "ERROR: Please type a reply."
91
  msgstr ""
92
 
93
+ #: bp-activity/bp-activity-admin.php:90
94
  msgid "ERROR: The item you are trying to reply to cannot be found, or it has been deleted."
95
  msgstr ""
96
 
97
+ #: bp-activity/bp-activity-admin.php:197 bp-activity/bp-activity-admin.php:244
98
+ #: bp-core/admin/bp-core-functions.php:402
99
+ #: bp-core/admin/bp-core-functions.php:420
100
+ #: bp-core/admin/bp-core-functions.php:439
101
+ #: bp-core/admin/bp-core-functions.php:458 bp-groups/bp-groups-admin.php:107
102
+ #: bp-groups/bp-groups-admin.php:143
103
  msgid "Overview"
104
  msgstr ""
105
 
106
+ #: bp-activity/bp-activity-admin.php:199
107
  msgid "You edit activities made on your site similar to the way you edit a comment. This is useful if you need to change which page the activity links to, or when you notice that the author has made a typographical error."
108
  msgstr ""
109
 
110
+ #: bp-activity/bp-activity-admin.php:200
111
  msgid "The two big editing areas for the activity title and content are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Primary Item/Secondary Item, Link, Type, Author ID) or to choose a 1- or 2-column layout for this screen."
112
  msgstr ""
113
 
114
+ #: bp-activity/bp-activity-admin.php:201
115
  msgid "You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity."
116
  msgstr ""
117
 
118
+ #: bp-activity/bp-activity-admin.php:206
119
  msgid "Item, Link, Type"
120
  msgstr ""
121
 
122
+ #: bp-activity/bp-activity-admin.php:208
123
  msgid "<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields."
124
  msgstr ""
125
 
126
+ #: bp-activity/bp-activity-admin.php:209
127
  msgid "<strong>Link</strong> - Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item. Some types of activity may not use this field, even if it has been set."
128
  msgstr ""
129
 
130
+ #: bp-activity/bp-activity-admin.php:210
131
  msgid "<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group."
132
  msgstr ""
133
 
134
+ #: bp-activity/bp-activity-admin.php:211
135
  msgid "For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side."
136
  msgstr ""
137
 
138
+ #: bp-activity/bp-activity-admin.php:216 bp-activity/bp-activity-admin.php:261
139
+ #: bp-core/admin/bp-core-functions.php:408
140
+ #: bp-core/admin/bp-core-functions.php:426
141
+ #: bp-core/admin/bp-core-functions.php:445
142
+ #: bp-core/admin/bp-core-functions.php:464 bp-groups/bp-groups-admin.php:115
143
+ #: bp-groups/bp-groups-admin.php:159
144
  msgid "For more information:"
145
  msgstr ""
146
 
147
+ #: bp-activity/bp-activity-admin.php:217
148
  msgid "<a href=\"http://codex.buddypress.org/buddypress-site-administration/managing-activity/\">Managing Activity</a>"
149
  msgstr ""
150
 
151
+ #: bp-activity/bp-activity-admin.php:218 bp-activity/bp-activity-admin.php:262
152
+ #: bp-core/admin/bp-core-functions.php:410
153
+ #: bp-core/admin/bp-core-functions.php:428
154
+ #: bp-core/admin/bp-core-functions.php:447
155
+ #: bp-core/admin/bp-core-functions.php:466 bp-groups/bp-groups-admin.php:160
156
  msgid "<a href=\"http://buddypress.org/support/\">Support Forums</a>"
157
  msgstr ""
158
 
159
+ #: bp-activity/bp-activity-admin.php:222
160
  msgctxt "activity admin edit screen"
161
  msgid "Status"
162
  msgstr ""
163
 
164
+ #: bp-activity/bp-activity-admin.php:223
165
  msgctxt "activity admin edit screen"
166
  msgid "Primary Item/Secondary Item"
167
  msgstr ""
168
 
169
+ #: bp-activity/bp-activity-admin.php:224
170
  msgctxt "activity admin edit screen"
171
  msgid "Link"
172
  msgstr ""
173
 
174
+ #: bp-activity/bp-activity-admin.php:225
175
  msgctxt "activity admin edit screen"
176
  msgid "Type"
177
  msgstr ""
178
 
179
+ #: bp-activity/bp-activity-admin.php:226
180
  msgctxt "activity admin edit screen"
181
  msgid "Author ID"
182
  msgstr ""
183
 
184
+ #: bp-activity/bp-activity-admin.php:239
185
  msgctxt "Activity items per page (screen options)"
186
  msgid "Activity"
187
  msgstr ""
188
 
189
+ #: bp-activity/bp-activity-admin.php:246
190
  msgid "You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions."
191
  msgstr ""
192
 
193
+ #: bp-activity/bp-activity-admin.php:247
194
  msgid "There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them."
195
  msgstr ""
196
 
197
+ #: bp-activity/bp-activity-admin.php:253
198
  msgid "Moderating Activity"
199
  msgstr ""
200
 
201
+ #: bp-activity/bp-activity-admin.php:255
202
  msgid "In the <strong>Activity</strong> column, above each activity it says &#8220;Submitted on,&#8221; followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity."
203
  msgstr ""
204
 
205
+ #: bp-activity/bp-activity-admin.php:256
206
  msgid "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items."
207
  msgstr ""
208
 
209
+ #: bp-activity/bp-activity-admin.php:582
210
  msgid "Editing Activity (ID #%s)"
211
  msgstr ""
212
 
213
+ #: bp-activity/bp-activity-admin.php:593
214
  msgid "Action"
215
  msgstr ""
216
 
217
+ #: bp-activity/bp-activity-admin.php:600
218
  msgid "Content"
219
  msgstr ""
220
 
221
+ #: bp-activity/bp-activity-admin.php:625
222
  msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>."
223
  msgstr ""
224
 
225
+ #: bp-activity/bp-activity-admin.php:647
226
  msgid "View Activity"
227
  msgstr ""
228
 
229
+ #: bp-activity/bp-activity-admin.php:655
230
  msgid "Approved"
231
  msgstr ""
232
 
233
+ #: bp-activity/bp-activity-admin.php:656 bp-activity/bp-activity-admin.php:1288
234
  #: bp-activity/bp-activity-akismet.php:178
235
  #: bp-activity/bp-activity-akismet.php:207
236
  msgid "Spam"
238
 
239
  #. translators: Publish box date format, see http:php.net/date
240
 
241
+ #: bp-activity/bp-activity-admin.php:662
242
  msgid "M j, Y @ G:i"
243
  msgstr ""
244
 
245
+ #: bp-activity/bp-activity-admin.php:665
246
  msgid "Submitted on: <strong>%1$s</strong>"
247
  msgstr ""
248
 
249
+ #: bp-activity/bp-activity-admin.php:665 bp-activity/bp-activity-admin.php:1281
250
+ #: bp-forums/bp-forums-template.php:1270 bp-groups/bp-groups-admin.php:1245
251
+ #: bp-themes/bp-default/functions.php:507 bp-xprofile/bp-xprofile-admin.php:456
252
+ #: bp-xprofile/bp-xprofile-loader.php:185
253
+ #: bp-xprofile/bp-xprofile-loader.php:245
254
  msgid "Edit"
255
  msgstr ""
256
 
257
+ #: bp-activity/bp-activity-admin.php:678
258
  msgid "Update"
259
  msgstr ""
260
 
261
+ #: bp-activity/bp-activity-admin.php:697
262
  msgid "Link"
263
  msgstr ""
264
 
265
+ #: bp-activity/bp-activity-admin.php:699
266
  msgid "Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item."
267
  msgstr ""
268
 
269
+ #: bp-activity/bp-activity-admin.php:713
270
  msgid "Author ID"
271
  msgstr ""
272
 
273
+ #: bp-activity/bp-activity-admin.php:764
274
  msgid "Primary Item ID"
275
  msgstr ""
276
 
277
+ #: bp-activity/bp-activity-admin.php:768
278
  msgid "Secondary Item ID"
279
  msgstr ""
280
 
281
+ #: bp-activity/bp-activity-admin.php:771
282
  msgid "These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs."
283
  msgstr ""
284
 
285
+ #: bp-activity/bp-activity-admin.php:809
286
+ msgid "%s activity item has been permanently deleted."
287
  msgid_plural "%s activity items have been permanently deleted."
288
  msgstr[0] ""
289
  msgstr[1] ""
290
 
291
+ #: bp-activity/bp-activity-admin.php:813
292
  msgid "An error occurred when trying to update activity ID #%s."
293
  msgstr ""
294
 
295
+ #: bp-activity/bp-activity-admin.php:816
296
  msgid "Errors occurred when trying to update these activity items:"
297
  msgstr ""
298
 
299
  #. Translators: This is a bulleted list of item IDs
300
 
301
+ #: bp-activity/bp-activity-admin.php:822
302
  msgid "#%s"
303
  msgstr ""
304
 
305
+ #: bp-activity/bp-activity-admin.php:831
306
+ msgid "%s activity item has been successfully spammed."
307
  msgid_plural "%s activity items have been successfully spammed."
308
  msgstr[0] ""
309
  msgstr[1] ""
310
 
311
+ #: bp-activity/bp-activity-admin.php:834
312
+ msgid "%s activity item has been successfully unspammed."
313
  msgid_plural "%s activity items have been successfully unspammed."
314
  msgstr[0] ""
315
  msgstr[1] ""
316
 
317
+ #: bp-activity/bp-activity-admin.php:837
318
+ msgid "The activity item has been updated succesfully."
319
  msgstr ""
320
 
321
+ #: bp-activity/bp-activity-admin.php:850
322
  msgid "Activity related to ID #%s"
323
  msgstr ""
324
 
325
+ #: bp-activity/bp-activity-admin.php:856 bp-groups/bp-groups-admin.php:622
326
  msgid "Search results for &#8220;%s&#8221;"
327
  msgstr ""
328
 
329
+ #: bp-activity/bp-activity-admin.php:869
330
  msgid "Search all Activity"
331
  msgstr ""
332
 
333
+ #: bp-activity/bp-activity-admin.php:880
334
  msgid "Reply to Activity"
335
  msgstr ""
336
 
337
+ #: bp-activity/bp-activity-admin.php:884 bp-groups/bp-groups-admin.php:582
338
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:102
339
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:116
340
  #: bp-themes/bp-default/forums/index.php:134
341
+ #: bp-xprofile/bp-xprofile-classes.php:406
342
+ #: bp-xprofile/bp-xprofile-classes.php:929
343
  msgid "Cancel"
344
  msgstr ""
345
 
346
+ #: bp-activity/bp-activity-admin.php:885 bp-activity/bp-activity-admin.php:1278
347
+ #: bp-templates/bp-legacy/buddypress/activity/comment.php:37
348
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:10
349
+ #: bp-themes/bp-default/activity/comment.php:40
350
  #: bp-themes/bp-default/groups/single/forum/edit.php:10
351
  msgid "Reply"
352
  msgstr ""
353
 
354
+ #: bp-activity/bp-activity-admin.php:1069
355
  msgid "No activities found."
356
  msgstr ""
357
 
358
+ #: bp-activity/bp-activity-admin.php:1133 bp-groups/bp-groups-admin.php:1135
359
+ #: bp-messages/bp-messages-template.php:434
360
  msgid "All"
361
  msgstr ""
362
 
363
+ #: bp-activity/bp-activity-admin.php:1134
364
  msgid "Spam <span class=\"count\">(%s)</span>"
365
  msgstr ""
366
 
367
+ #: bp-activity/bp-activity-admin.php:1149
368
  msgid "Mark as Spam"
369
  msgstr ""
370
 
371
+ #: bp-activity/bp-activity-admin.php:1150
372
+ #: bp-activity/bp-activity-admin.php:1286
373
  msgid "Not Spam"
374
  msgstr ""
375
 
376
+ #: bp-activity/bp-activity-admin.php:1151
377
+ #: bp-activity/bp-activity-admin.php:1291 bp-groups/bp-groups-admin.php:581
378
  msgid "Delete Permanently"
379
  msgstr ""
380
 
381
+ #: bp-activity/bp-activity-admin.php:1166
382
  msgid "Author"
383
  msgstr ""
384
 
385
+ #: bp-activity/bp-activity-admin.php:1168
386
  msgid "In Response To"
387
  msgstr ""
388
 
389
+ #: bp-activity/bp-activity-admin.php:1206
390
  msgid "Show all activity types"
391
  msgstr ""
392
 
393
+ #: bp-activity/bp-activity-admin.php:1213
394
  msgid "Filter"
395
  msgstr ""
396
 
397
+ #: bp-activity/bp-activity-admin.php:1291 bp-core/bp-core-cssjs.php:20
398
  msgid "Are you sure?"
399
  msgstr ""
400
 
401
  #. translators: 2: activity admin ui date/time
402
 
403
+ #: bp-activity/bp-activity-admin.php:1300
404
  msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
405
  msgstr ""
406
 
407
+ #: bp-activity/bp-activity-admin.php:1330
408
  msgid "%s related activity"
409
  msgid_plural "%s related activities"
410
  msgstr[0] ""
411
  msgstr[1] ""
412
 
413
+ #: bp-activity/bp-activity-admin.php:1341
414
  msgid "<a href=\"%1$s\">View Activity</a>"
415
  msgstr ""
416
 
463
  msgid "<span>%1$s</span> &mdash; %2$s"
464
  msgstr ""
465
 
466
+ #: bp-activity/bp-activity-classes.php:120
467
+ #: bp-activity/bp-activity-template.php:120 bp-groups/bp-groups-classes.php:313
468
+ #: bp-groups/bp-groups-template.php:114
469
  msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details."
470
  msgstr ""
471
 
472
+ #: bp-activity/bp-activity-filters.php:348
473
  msgid "[Read more]"
474
  msgstr ""
475
 
476
+ #: bp-activity/bp-activity-filters.php:353
477
  msgid "&hellip;"
478
  msgstr ""
479
 
480
+ #: bp-activity/bp-activity-functions.php:199
481
  msgid "@%s Mentions"
482
  msgstr ""
483
 
484
+ #: bp-activity/bp-activity-functions.php:202
485
  msgid "You have %1$d new mentions"
486
  msgstr ""
487
 
488
+ #: bp-activity/bp-activity-functions.php:206
489
  msgid "%1$s mentioned you"
490
  msgstr ""
491
 
492
+ #: bp-activity/bp-activity-functions.php:843
493
  msgid "Posted a status update"
494
  msgstr ""
495
 
496
+ #: bp-activity/bp-activity-functions.php:844
497
  msgid "Replied to a status update"
498
  msgstr ""
499
 
500
+ #: bp-activity/bp-activity-functions.php:1092
501
  msgid "%s posted an update"
502
  msgstr ""
503
 
504
+ #: bp-activity/bp-activity-functions.php:1161
505
  msgid "%s posted a new activity comment"
506
  msgstr ""
507
 
508
+ #: bp-activity/bp-activity-functions.php:1536
509
  msgid "Thumbnail"
510
  msgstr ""
511
 
512
  #: bp-activity/bp-activity-loader.php:30
513
+ #: bp-core/admin/bp-core-components.php:372
514
  msgid "Activity Streams"
515
  msgstr ""
516
 
518
  msgid "Search Activity..."
519
  msgstr ""
520
 
521
+ #: bp-activity/bp-activity-loader.php:144
522
+ #: bp-activity/bp-activity-loader.php:258
523
  msgid "Personal"
524
  msgstr ""
525
 
526
  #. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] |
527
  #. Mentions"
528
 
529
+ #: bp-activity/bp-activity-loader.php:154
530
+ #: bp-activity/bp-activity-loader.php:235
531
+ #: bp-activity/feeds/bp-activity-mentions-feed.php:27
532
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:57
533
  #: bp-themes/bp-default/activity/index.php:77
534
  msgid "Mentions"
535
  msgstr ""
536
 
537
+ #: bp-activity/bp-activity-loader.php:165
538
+ #: bp-activity/bp-activity-loader.php:266
539
  msgid "Favorites"
540
  msgstr ""
541
 
542
+ #: bp-activity/bp-activity-loader.php:177
543
+ #: bp-activity/bp-activity-loader.php:275 bp-friends/bp-friends-loader.php:164
544
  #: bp-friends/bp-friends-screens.php:83
545
  msgid "Friends"
546
  msgstr ""
547
 
548
+ #: bp-activity/bp-activity-loader.php:190
549
+ #: bp-activity/bp-activity-loader.php:285 bp-core/bp-core-template.php:246
550
+ #: bp-groups/bp-groups-activity.php:143 bp-groups/bp-groups-activity.php:179
551
+ #: bp-groups/bp-groups-activity.php:215 bp-groups/bp-groups-activity.php:251
552
+ #: bp-groups/bp-groups-admin.php:35 bp-groups/bp-groups-admin.php:36
553
+ #: bp-groups/bp-groups-admin.php:619 bp-groups/bp-groups-loader.php:517
554
+ #: bp-groups/bp-groups-screens.php:893 bp-groups/bp-groups-screens.php:999
555
+ #: bp-groups/bp-groups-screens.php:1001 bp-groups/bp-groups-screens.php:1037
556
+ #: bp-groups/bp-groups-screens.php:1039 bp-groups/bp-groups-widgets.php:48
557
+ #: bp-groups/bp-groups-widgets.php:117
558
  msgid "Groups"
559
  msgstr ""
560
 
561
+ #: bp-activity/bp-activity-loader.php:233
562
  msgid "Mentions <span class=\"count\">%s</span>"
563
  msgstr ""
564
 
565
+ #: bp-activity/bp-activity-loader.php:310
566
  msgid "My Activity"
567
  msgstr ""
568
 
569
+ #: bp-activity/bp-activity-loader.php:315
570
+ #: bp-activity/bp-activity-template.php:975
571
+ #: bp-activity/bp-activity-template.php:1111
572
+ #: bp-activity/bp-activity-template.php:1122 bp-blogs/bp-blogs-loader.php:209
573
+ #: bp-forums/bp-forums-loader.php:212 bp-forums/bp-forums-template.php:487
574
  #: bp-forums/bp-forums-template.php:604 bp-forums/bp-forums-template.php:1200
575
+ #: bp-friends/bp-friends-loader.php:212 bp-groups/bp-groups-loader.php:572
576
+ #: bp-groups/bp-groups-template.php:748 bp-groups/bp-groups-template.php:771
577
+ #: bp-groups/bp-groups-template.php:1200 bp-groups/bp-groups-template.php:1216
578
+ #: bp-groups/bp-groups-template.php:1265 bp-groups/bp-groups-template.php:1281
579
+ #: bp-groups/bp-groups-template.php:1992 bp-groups/bp-groups-template.php:2001
580
+ #: bp-groups/bp-groups-template.php:2010 bp-groups/bp-groups-template.php:2758
581
+ #: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:198
582
+ #: bp-members/bp-members-template.php:519
583
+ #: bp-members/bp-members-template.php:819
584
+ #: bp-members/bp-members-template.php:838
585
+ #: bp-messages/bp-messages-loader.php:264
586
  #: bp-messages/bp-messages-template.php:326
587
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:185
588
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:212
589
  #: bp-themes/bp-default/groups/single/admin.php:185
590
  #: bp-themes/bp-default/groups/single/admin.php:212
591
+ #: bp-xprofile/bp-xprofile-loader.php:277
592
  msgid "Profile picture of %s"
593
  msgstr ""
594
 
596
  msgid "%s mentioned you in an update"
597
  msgstr ""
598
 
599
+ #: bp-activity/bp-activity-notifications.php:77 bp-core/deprecated/1.5.php:354
600
  msgid ""
601
  "%1$s mentioned you in the group \"%2$s\":\n"
602
  "\n"
619
  msgstr ""
620
 
621
  #: bp-activity/bp-activity-notifications.php:98
622
+ #: bp-activity/bp-activity-notifications.php:173
623
+ #: bp-activity/bp-activity-notifications.php:218 bp-core/deprecated/1.5.php:364
624
+ #: bp-friends/bp-friends-notifications.php:42
625
+ #: bp-friends/bp-friends-notifications.php:77
626
+ #: bp-groups/bp-groups-notifications.php:42
627
+ #: bp-groups/bp-groups-notifications.php:90
628
+ #: bp-groups/bp-groups-notifications.php:145
629
+ #: bp-groups/bp-groups-notifications.php:190
630
+ #: bp-groups/bp-groups-notifications.php:243
631
+ #: bp-messages/bp-messages-notifications.php:64
632
  msgid "To disable these notifications please log in and go to: %s"
633
  msgstr ""
634
 
635
+ #: bp-activity/bp-activity-notifications.php:162
636
  msgid "%s replied to one of your updates"
637
  msgstr ""
638
 
639
+ #: bp-activity/bp-activity-notifications.php:163
640
  msgid ""
641
  "%1$s replied to one of your updates:\n"
642
  "\n"
647
  "---------------------\n"
648
  msgstr ""
649
 
650
+ #: bp-activity/bp-activity-notifications.php:203
651
  msgid "%s replied to one of your comments"
652
  msgstr ""
653
 
654
+ #: bp-activity/bp-activity-notifications.php:208
655
  msgid ""
656
  "%1$s replied to one of your comments:\n"
657
  "\n"
666
  msgid "You do not have access to this activity."
667
  msgstr ""
668
 
669
+ #: bp-activity/bp-activity-screens.php:279 bp-blogs/bp-blogs-template.php:683
670
+ #: bp-friends/bp-friends-screens.php:84 bp-groups/bp-groups-screens.php:894
671
+ #: bp-messages/bp-messages-screens.php:169
672
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:26
673
+ #: bp-templates/bp-legacy/buddypress/members/register.php:223
674
  #: bp-themes/bp-default/groups/single/admin.php:26
675
+ #: bp-themes/bp-default/registration/register.php:228
676
  msgid "Yes"
677
  msgstr ""
678
 
679
+ #: bp-activity/bp-activity-screens.php:280 bp-blogs/bp-blogs-template.php:687
680
+ #: bp-friends/bp-friends-screens.php:85 bp-groups/bp-groups-screens.php:895
681
+ #: bp-messages/bp-messages-screens.php:170
682
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:27
683
+ #: bp-templates/bp-legacy/buddypress/members/register.php:224
684
  #: bp-themes/bp-default/groups/single/admin.php:27
685
+ #: bp-themes/bp-default/registration/register.php:229
686
  msgid "No"
687
  msgstr ""
688
 
694
  msgid "A member replies to an update or comment you've posted"
695
  msgstr ""
696
 
697
+ #: bp-activity/bp-activity-screens.php:364
698
+ msgid "Sitewide Activity"
699
+ msgstr ""
700
+
701
  #: bp-activity/bp-activity-template.php:220
702
  msgctxt "Activity pagination previous text"
703
  msgid "&larr;"
708
  msgid "&rarr;"
709
  msgstr ""
710
 
711
+ #: bp-activity/bp-activity-template.php:526
712
  msgid "Viewing item %1$s to %2$s (of %3$s items)"
713
  msgstr ""
714
 
715
+ #: bp-activity/bp-activity-template.php:975
716
  msgid "Profile picture"
717
  msgstr ""
718
 
719
+ #: bp-activity/bp-activity-template.php:1087
720
  msgid "Group logo"
721
  msgstr ""
722
 
723
+ #: bp-activity/bp-activity-template.php:1090 bp-groups/bp-groups-admin.php:1259
724
+ #: bp-groups/bp-groups-template.php:494
725
  msgid "Group logo of %s"
726
  msgstr ""
727
 
728
+ #: bp-activity/bp-activity-template.php:1101
729
  msgid "Profile picture of the author of the site %s"
730
  msgstr ""
731
 
732
+ #: bp-activity/bp-activity-template.php:1326
733
  msgid "View Discussion"
734
  msgstr ""
735
 
736
+ #: bp-activity/bp-activity-template.php:2167
737
+ #: bp-forums/bp-forums-template.php:1271 bp-groups/bp-groups-admin.php:1153
738
+ #: bp-groups/bp-groups-admin.php:1248 bp-groups/bp-groups-template.php:1464
739
+ #: bp-templates/bp-legacy/buddypress/activity/comment.php:43
740
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51
741
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24
742
+ #: bp-themes/bp-default/activity/comment.php:46
743
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:51
744
  #: bp-themes/bp-default/members/single/messages/single.php:24
745
  #: bp-xprofile/bp-xprofile-admin.php:460
746
  msgid "Delete"
747
  msgstr ""
748
 
749
+ #: bp-activity/bp-activity-template.php:2214
750
+ #: bp-core/admin/bp-core-slugs.php:109 bp-core/admin/bp-core-slugs.php:172
751
+ #: bp-core/bp-core-loader.php:225 bp-members/bp-members-loader.php:172
752
+ #: bp-members/bp-members-template.php:624
753
+ #: bp-templates/bp-legacy/buddypress-functions.php:258
754
  #: bp-themes/bp-default/activity/entry.php:37
755
  #: bp-themes/bp-default/functions.php:165
756
+ #: bp-xprofile/bp-xprofile-loader.php:175
757
+ #: bp-xprofile/bp-xprofile-loader.php:237
758
  msgid "View"
759
  msgstr ""
760
 
761
+ #: bp-activity/bp-activity-template.php:2308
762
  msgid "Clear Filter"
763
  msgstr ""
764
 
765
+ #: bp-activity/bp-activity-template.php:2491
766
  msgid "a user"
767
  msgstr ""
768
 
769
+ #: bp-activity/bp-activity-template.php:2531
770
  msgid "Send a public message on your activity stream."
771
  msgstr ""
772
 
773
+ #: bp-activity/bp-activity-template.php:2532
774
  msgid "Public Message"
775
  msgstr ""
776
 
777
+ #: bp-activity/bp-activity-template.php:2954
778
  msgid "Site Wide Activity RSS Feed"
779
  msgstr ""
780
 
781
  #. translators: Favorited activity RSS title - "[Site Name] | [Displayed User
782
  #. Name] | Favorite Activity"
783
 
784
+ #: bp-activity/feeds/bp-activity-favorites-feed.php:27
785
  msgid "Favorite Activity"
786
  msgstr ""
787
 
788
+ #: bp-activity/feeds/bp-activity-favorites-feed.php:30
789
  msgid "%s - Favorite Activity"
790
  msgstr ""
791
 
792
+ #: bp-activity/feeds/bp-activity-favorites-feed.php:56
793
+ #: bp-activity/feeds/bp-activity-friends-feed.php:49
794
+ #: bp-activity/feeds/bp-activity-group-feed.php:49
795
+ #: bp-activity/feeds/bp-activity-mentions-feed.php:50
796
+ #: bp-activity/feeds/bp-activity-mygroups-feed.php:55
797
+ #: bp-activity/feeds/bp-activity-personal-feed.php:49
798
+ #: bp-activity/feeds/bp-activity-sitewide-feed.php:49
799
  msgid "Comments: %s"
800
  msgstr ""
801
 
802
+ #: bp-activity/feeds/bp-activity-favorites-feed.php:60
803
+ #: bp-activity/feeds/bp-activity-friends-feed.php:53
804
+ #: bp-activity/feeds/bp-activity-mentions-feed.php:54
805
+ #: bp-activity/feeds/bp-activity-personal-feed.php:53
806
  msgid "In reply to"
807
  msgstr ""
808
 
809
  #. translators: Member friends activity RSS title - "[Site Name] | Friends
810
  #. Activity"
811
 
812
+ #: bp-activity/feeds/bp-activity-friends-feed.php:27
813
  msgid "Friends Activity"
814
  msgstr ""
815
 
816
+ #: bp-activity/feeds/bp-activity-friends-feed.php:30
817
  msgid "%s - Friends Activity Feed"
818
  msgstr ""
819
 
820
  #. translators: Single group activity RSS title - "[Site Name] | [Group Name] |
821
  #. Group Activity"
822
 
823
+ #: bp-activity/feeds/bp-activity-group-feed.php:27
824
  msgid "Group Activity"
825
  msgstr ""
826
 
827
+ #: bp-activity/feeds/bp-activity-group-feed.php:30
828
  msgid "%s - Group Activity Feed"
829
  msgstr ""
830
 
831
  #. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] |
832
  #. Mentions"
833
 
834
+ #: bp-activity/feeds/bp-activity-mentions-feed.php:31
835
  msgid "%s - Mentions"
836
  msgstr ""
837
 
838
  #. translators: Member groups activity RSS title - "[Site Name] | [Displayed
839
  #. User Name] | My Groups - Public Activity"
840
 
841
+ #: bp-activity/feeds/bp-activity-mygroups-feed.php:27
842
  msgid "My Groups - Public Activity"
843
  msgstr ""
844
 
845
  #. translators: Member groups activity RSS description - "[Displayed user name]
846
  #. - My Groups - Public Activity"
847
 
848
+ #: bp-activity/feeds/bp-activity-mygroups-feed.php:31
849
  msgid "%1$s - My Groups - Public Activity"
850
  msgstr ""
851
 
852
+ #: bp-activity/feeds/bp-activity-personal-feed.php:30
853
  msgid "%s - Activity Feed"
854
  msgstr ""
855
 
856
  #. translators: Sitewide activity RSS title - "[Site Name] | Site Wide
857
  #. Activity"
858
 
859
+ #: bp-activity/feeds/bp-activity-sitewide-feed.php:27
860
  msgid "Site Wide Activity"
861
  msgstr ""
862
 
863
+ #: bp-activity/feeds/bp-activity-sitewide-feed.php:30
864
  msgid "Site Wide Activity Feed"
865
  msgstr ""
866
 
876
  msgid "New post comment posted"
877
  msgstr ""
878
 
879
+ #: bp-blogs/bp-blogs-buddybar.php:43 bp-blogs/bp-blogs-loader.php:131
880
+ #: bp-blogs/bp-blogs-loader.php:179 bp-blogs/bp-blogs-loader.php:200
881
  msgid "My Sites"
882
  msgstr ""
883
 
884
+ #: bp-blogs/bp-blogs-buddybar.php:55 bp-core/bp-core-buddybar.php:548
885
  msgid "Dashboard"
886
  msgstr ""
887
 
888
+ #: bp-blogs/bp-blogs-buddybar.php:56 bp-core/bp-core-buddybar.php:552
889
  msgid "New Post"
890
  msgstr ""
891
 
892
+ #: bp-blogs/bp-blogs-buddybar.php:57 bp-core/bp-core-buddybar.php:553
893
  msgid "Manage Posts"
894
  msgstr ""
895
 
896
+ #: bp-blogs/bp-blogs-buddybar.php:58 bp-core/bp-core-buddybar.php:554
897
  msgid "Manage Comments"
898
  msgstr ""
899
 
901
  msgid "Create a Site!"
902
  msgstr ""
903
 
904
+ #: bp-blogs/bp-blogs-functions.php:175
905
  msgid "%s created the site %s"
906
  msgstr ""
907
 
908
+ #: bp-blogs/bp-blogs-functions.php:252
909
  msgid "%1$s wrote a new post, %2$s, on the site %3$s"
910
  msgstr ""
911
 
912
+ #: bp-blogs/bp-blogs-functions.php:254
913
  msgid "%1$s wrote a new post, %2$s"
914
  msgstr ""
915
 
916
+ #: bp-blogs/bp-blogs-functions.php:361
917
  msgid "%1$s commented on the post, %2$s, on the site %3$s"
918
  msgstr ""
919
 
920
+ #: bp-blogs/bp-blogs-functions.php:363
921
  msgid "%1$s commented on the post, %2$s"
922
  msgstr ""
923
 
924
+ #: bp-blogs/bp-blogs-loader.php:25 bp-core/admin/bp-core-components.php:384
925
  msgid "Site Tracking"
926
  msgstr ""
927
 
933
  msgid "Sites <span>%d</span>"
934
  msgstr ""
935
 
936
+ #: bp-blogs/bp-blogs-loader.php:171
937
  msgid "Sites"
938
  msgstr ""
939
 
940
+ #: bp-blogs/bp-blogs-screens.php:110 bp-blogs/bp-blogs-screens.php:112
941
+ #: bp-blogs/bp-blogs-screens.php:148 bp-blogs/bp-blogs-screens.php:150
942
+ #: bp-core/bp-core-template.php:249
943
+ msgid "Blogs"
944
+ msgstr ""
945
+
946
+ #: bp-blogs/bp-blogs-screens.php:110 bp-blogs/bp-blogs-screens.php:148
947
+ msgid "Create a Blog"
948
+ msgstr ""
949
+
950
+ #: bp-blogs/bp-blogs-template.php:136
951
  msgctxt "Blog pagination previous text"
952
  msgid "&larr;"
953
  msgstr ""
954
 
955
+ #: bp-blogs/bp-blogs-template.php:137
956
  msgctxt "Blog pagination next text"
957
  msgid "&rarr;"
958
  msgstr ""
959
 
960
+ #: bp-blogs/bp-blogs-template.php:261
961
  msgid "Viewing site %1$s to %2$s (of %3$s sites)"
962
  msgstr ""
963
 
964
+ #: bp-blogs/bp-blogs-template.php:285
965
  msgid "Profile picture of site author %s"
966
  msgstr ""
967
 
968
+ #: bp-blogs/bp-blogs-template.php:403 bp-core/bp-core-classes.php:718
969
+ #: bp-groups/bp-groups-widgets.php:78 bp-groups/bp-groups-widgets.php:181
970
+ #: bp-members/bp-members-template.php:595
971
+ #: bp-members/bp-members-template.php:870
972
+ #: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:47
973
+ #: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:42
974
  #: bp-themes/bp-default/groups/groups-loop.php:47
975
  #: bp-themes/bp-default/groups/single/group-header.php:42
976
  msgid "active %s"
977
  msgstr ""
978
 
979
+ #: bp-blogs/bp-blogs-template.php:415
980
  msgid "Latest Post: %s"
981
  msgstr ""
982
 
983
+ #: bp-blogs/bp-blogs-template.php:609
984
  msgid "There was a problem, please correct the form below and try again."
985
  msgstr ""
986
 
987
+ #: bp-blogs/bp-blogs-template.php:612
988
  msgid "By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!"
989
  msgstr ""
990
 
991
+ #: bp-blogs/bp-blogs-template.php:614
992
  msgid "If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!"
993
  msgstr ""
994
 
995
+ #: bp-blogs/bp-blogs-template.php:623
996
  msgid "Create Site"
997
  msgstr ""
998
 
999
+ #: bp-blogs/bp-blogs-template.php:637
1000
  msgid "Site Name:"
1001
  msgstr ""
1002
 
1003
+ #: bp-blogs/bp-blogs-template.php:639
1004
  msgid "Site Domain:"
1005
  msgstr ""
1006
 
1007
+ #: bp-blogs/bp-blogs-template.php:653
1008
  msgid "Your address will be "
1009
  msgstr ""
1010
 
1011
+ #: bp-blogs/bp-blogs-template.php:656
1012
  msgid "blogname"
1013
  msgstr ""
1014
 
1015
+ #: bp-blogs/bp-blogs-template.php:658
1016
  msgid "domain."
1017
  msgstr ""
1018
 
1019
+ #: bp-blogs/bp-blogs-template.php:661
1020
  msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)"
1021
  msgstr ""
1022
 
1023
+ #: bp-blogs/bp-blogs-template.php:667
1024
  msgid "Site Title:"
1025
  msgstr ""
1026
 
1027
+ #: bp-blogs/bp-blogs-template.php:678
1028
  msgid "Privacy:"
1029
  msgstr ""
1030
 
1031
+ #: bp-blogs/bp-blogs-template.php:679
1032
+ #: bp-templates/bp-legacy/buddypress/members/register.php:220
1033
+ #: bp-themes/bp-default/registration/register.php:225
1034
  msgid "I would like my site to appear in search engines, and in public listings around this network."
1035
  msgstr ""
1036
 
1037
+ #: bp-blogs/bp-blogs-template.php:762
1038
  msgid "Congratulations! You have successfully registered a new site."
1039
  msgstr ""
1040
 
1041
+ #: bp-blogs/bp-blogs-template.php:764
1042
  msgid "<a href=\"%1$s\">%2$s</a> is your new site. <a href=\"%3$s\">Login</a> as \"%4$s\" using your existing password."
1043
  msgstr ""
1044
 
1045
+ #: bp-blogs/bp-blogs-template.php:773 bp-core/bp-core-filters.php:377
1046
  #: bp-themes/bp-default/blogs/create.php:21
1047
  #: bp-themes/bp-default/blogs/index.php:21
1048
  msgid "Create a Site"
1049
  msgstr ""
1050
 
1051
+ #: bp-blogs/bp-blogs-template.php:785
1052
  msgid "%s's Sites"
1053
  msgstr ""
1054
 
1055
+ #: bp-blogs/bp-blogs-template.php:786
1056
  msgid "%s's Recent Posts"
1057
  msgstr ""
1058
 
1059
+ #: bp-blogs/bp-blogs-template.php:787
1060
  msgid "%s's Recent Comments"
1061
  msgstr ""
1062
 
1063
+ #: bp-blogs/bp-blogs-template.php:803 bp-core/deprecated/1.5.php:417
1064
+ #: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2483
1065
+ #: bp-members/bp-members-template.php:709
1066
+ #: bp-messages/bp-messages-template.php:367 bp-themes/bp-default/header.php:30
1067
  #: bp-themes/bp-default/searchform.php:5
1068
  msgid "Search"
1069
  msgstr ""
1070
 
1071
+ #: bp-blogs/bp-blogs-template.php:836 bp-blogs/bp-blogs-template.php:837
1072
  msgid "Visit Site"
1073
  msgstr ""
1074
 
1075
  #: bp-blogs/bp-blogs-widgets.php:25
1076
+ msgctxt "widget name"
1077
+ msgid "(BuddyPress) Recent Networkwide Posts"
1078
  msgstr ""
1079
 
1080
  #: bp-blogs/bp-blogs-widgets.php:67
1086
  msgstr ""
1087
 
1088
  #: bp-core/admin/bp-core-components.php:26
1089
+ #: bp-core/admin/bp-core-functions.php:356
 
1090
  msgid "Components"
1091
  msgstr ""
1092
 
1093
  #: bp-core/admin/bp-core-components.php:32
1094
+ #: bp-core/admin/bp-core-settings.php:267 bp-core/admin/bp-core-slugs.php:32
1095
  msgid "Save Settings"
1096
  msgstr ""
1097
 
1098
+ #: bp-core/admin/bp-core-components.php:59
1099
+ #: bp-core/admin/bp-core-components.php:356
1100
  #: bp-xprofile/bp-xprofile-loader.php:41
1101
  msgid "Extended Profiles"
1102
  msgstr ""
1103
 
1104
+ #: bp-core/admin/bp-core-components.php:60
1105
+ #: bp-core/admin/bp-core-components.php:357
1106
  msgid "Customize your community with fully editable profile fields that allow your users to describe themselves."
1107
  msgstr ""
1108
 
1109
+ #: bp-core/admin/bp-core-components.php:136
1110
+ msgctxt "plugins"
1111
+ msgid "All <span class=\"count\">(%s)</span>"
1112
+ msgid_plural "All <span class=\"count\">(%s)</span>"
1113
+ msgstr[0] ""
1114
+ msgstr[1] ""
1115
 
1116
+ #: bp-core/admin/bp-core-components.php:137
1117
+ msgid "Active <span class=\"count\">(%s)</span>"
1118
+ msgid_plural "Active <span class=\"count\">(%s)</span>"
1119
+ msgstr[0] ""
1120
+ msgstr[1] ""
1121
 
1122
+ #: bp-core/admin/bp-core-components.php:138
1123
+ msgid "Inactive <span class=\"count\">(%s)</span>"
1124
+ msgid_plural "Inactive <span class=\"count\">(%s)</span>"
1125
+ msgstr[0] ""
1126
+ msgstr[1] ""
1127
 
1128
+ #: bp-core/admin/bp-core-components.php:139
1129
+ msgid "Must-Use <span class=\"count\">(%s)</span>"
1130
+ msgid_plural "Must-Use <span class=\"count\">(%s)</span>"
1131
+ msgstr[0] ""
1132
+ msgstr[1] ""
1133
 
1134
+ #: bp-core/admin/bp-core-components.php:140
1135
+ msgid "Retired <span class=\"count\">(%s)</span>"
1136
+ msgid_plural "Retired <span class=\"count\">(%s)</span>"
1137
+ msgstr[0] ""
1138
+ msgstr[1] ""
1139
+
1140
+ #: bp-core/admin/bp-core-components.php:147
1141
+ #: bp-core/admin/bp-core-components.php:155
1142
+ msgid "Component"
1143
  msgstr ""
1144
 
1145
+ #: bp-core/admin/bp-core-components.php:148
1146
+ #: bp-core/admin/bp-core-components.php:156
1147
+ msgid "Description"
1148
  msgstr ""
1149
 
1150
+ #: bp-core/admin/bp-core-components.php:181
1151
+ msgid "Select %s"
1152
  msgstr ""
1153
 
1154
+ #: bp-core/admin/bp-core-components.php:206
1155
+ msgid "No components found."
1156
  msgstr ""
1157
 
1158
+ #: bp-core/admin/bp-core-components.php:336 bp-core/bp-core-loader.php:27
1159
+ msgid "BuddyPress Core"
1160
  msgstr ""
1161
 
1162
+ #: bp-core/admin/bp-core-components.php:337
1163
+ msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
1164
  msgstr ""
1165
 
1166
+ #: bp-core/admin/bp-core-components.php:340
1167
+ msgid "Community Members"
1168
  msgstr ""
1169
 
1170
+ #: bp-core/admin/bp-core-components.php:341
1171
+ msgid "Everything in a BuddyPress community revolves around its members."
1172
  msgstr ""
1173
 
1174
+ #: bp-core/admin/bp-core-components.php:348
1175
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:105
1176
+ #: bp-themes/bp-default/groups/create.php:112
1177
+ msgid "Group Forums"
1178
  msgstr ""
1179
 
1180
+ #: bp-core/admin/bp-core-components.php:349
1181
+ msgid "BuddyPress Forums are retired. Use %s."
1182
  msgstr ""
1183
 
1184
+ #: bp-core/admin/bp-core-components.php:360
1185
+ msgid "Account Settings"
1186
  msgstr ""
1187
 
1188
+ #: bp-core/admin/bp-core-components.php:361
1189
+ msgid "Allow your users to modify their account and notification settings directly from within their profiles."
1190
  msgstr ""
1191
 
1192
+ #: bp-core/admin/bp-core-components.php:364 bp-friends/bp-friends-loader.php:24
1193
+ msgid "Friend Connections"
1194
  msgstr ""
1195
 
1196
+ #: bp-core/admin/bp-core-components.php:365
1197
+ msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most."
1198
  msgstr ""
1199
 
1200
+ #: bp-core/admin/bp-core-components.php:368
1201
+ msgid "Private Messaging"
1202
  msgstr ""
1203
 
1204
+ #: bp-core/admin/bp-core-components.php:369
1205
+ msgid "Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members."
1206
+ msgstr ""
 
 
 
1207
 
1208
+ #: bp-core/admin/bp-core-components.php:373
1209
+ msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support."
1210
+ msgstr ""
 
 
1211
 
1212
+ #: bp-core/admin/bp-core-components.php:376 bp-groups/bp-groups-loader.php:83
1213
+ msgid "User Groups"
1214
+ msgstr ""
 
 
1215
 
1216
+ #: bp-core/admin/bp-core-components.php:377
1217
+ msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings."
1218
+ msgstr ""
 
 
1219
 
1220
+ #: bp-core/admin/bp-core-components.php:380
1221
+ msgid "Group Forums (Legacy)"
 
1222
  msgstr ""
1223
 
1224
+ #: bp-core/admin/bp-core-components.php:381
1225
+ msgid "Group forums allow for focused, bulletin-board style conversations."
 
1226
  msgstr ""
1227
 
1228
+ #: bp-core/admin/bp-core-components.php:385
1229
+ msgid "Record activity for new posts and comments from your site."
1230
  msgstr ""
1231
 
1232
+ #: bp-core/admin/bp-core-components.php:392
1233
+ msgid "Record activity for new sites, posts, and comments across your network."
1234
  msgstr ""
1235
 
1236
+ #: bp-core/admin/bp-core-functions.php:99
1237
  msgid "Why have all my BuddyPress menus disappeared?"
1238
  msgstr ""
1239
 
1240
+ #: bp-core/admin/bp-core-functions.php:101
1241
  msgid "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated."
1242
  msgstr ""
1243
 
1244
+ #: bp-core/admin/bp-core-functions.php:102
1245
  msgid "Components, Pages, Settings, and Forums, have been moved to <a href=\"%s\">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href=\"%s\">Users</a> menu."
1246
  msgstr ""
1247
 
1248
+ #: bp-core/admin/bp-core-functions.php:216
1249
  msgid "<strong>BuddyPress is almost ready</strong>. You must <a href=\"%s\">update your permalink structure</a> to something other than the default for it to work."
1250
  msgstr ""
1251
 
1252
+ #: bp-core/admin/bp-core-functions.php:240 bp-core/admin/bp-core-slugs.php:135
1253
+ #: bp-messages/bp-messages-template.php:558
1254
+ #: bp-templates/bp-legacy/buddypress/members/activate.php:29
1255
+ #: bp-themes/bp-default/registration/activate.php:38
 
 
 
 
1256
  msgid "Activate"
1257
  msgstr ""
1258
 
1259
+ #: bp-core/admin/bp-core-functions.php:245 bp-core/admin/bp-core-slugs.php:134
1260
+ #: bp-members/bp-members-adminbar.php:60
1261
  msgid "Register"
1262
  msgstr ""
1263
 
1264
+ #: bp-core/admin/bp-core-functions.php:270
1265
  msgid "The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
1266
  msgstr ""
1267
 
1268
+ #: bp-core/admin/bp-core-functions.php:292
1269
  msgid "Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
1270
  msgstr ""
1271
 
1272
+ #: bp-core/admin/bp-core-functions.php:360 bp-core/admin/bp-core-slugs.php:26
 
 
 
 
 
 
1273
  msgid "Pages"
1274
  msgstr ""
1275
 
1276
+ #: bp-core/admin/bp-core-functions.php:364
1277
+ #: bp-core/admin/bp-core-settings.php:258 bp-core/bp-core-admin.php:331
1278
+ #: bp-groups/bp-groups-loader.php:302 bp-groups/bp-groups-template.php:1446
1279
+ #: bp-settings/bp-settings-loader.php:23 bp-settings/bp-settings-loader.php:73
1280
+ #: bp-settings/bp-settings-loader.php:165
1281
  msgid "Settings"
1282
  msgstr ""
1283
 
1284
+ #: bp-core/admin/bp-core-functions.php:409
1285
+ msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-components\">Managing Components</a>"
 
 
 
 
1286
  msgstr ""
1287
 
1288
+ #: bp-core/admin/bp-core-functions.php:427
1289
+ msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-pages\">Managing Pages</a>"
 
1290
  msgstr ""
1291
 
1292
+ #: bp-core/admin/bp-core-functions.php:446
1293
+ msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-settings\">Managing Settings</a>"
1294
+ msgstr ""
1295
+
1296
+ #: bp-core/admin/bp-core-functions.php:465
1297
+ msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#users-profile-fields\">Managing Profile Fields</a>"
1298
+ msgstr ""
1299
+
1300
+ #: bp-core/admin/bp-core-functions.php:483
1301
+ msgid "By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site."
1302
+ msgstr ""
1303
+
1304
+ #: bp-core/admin/bp-core-functions.php:487
1305
+ msgid "BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component."
1306
+ msgstr ""
1307
+
1308
+ #: bp-core/admin/bp-core-functions.php:491
1309
+ msgid "Extra configuration settings."
1310
+ msgstr ""
1311
+
1312
+ #: bp-core/admin/bp-core-functions.php:495
1313
+ msgid "Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.</br></br>Note: Any fields in the first group will appear on the signup page."
1314
+ msgstr ""
1315
+
1316
+ #: bp-core/admin/bp-core-schema.php:244
1317
+ msgctxt "First field-group name"
1318
+ msgid "General"
1319
+ msgstr ""
1320
+
1321
+ #: bp-core/admin/bp-core-schema.php:248
1322
+ msgctxt "Display name field"
1323
+ msgid "Display Name"
1324
  msgstr ""
1325
 
1326
  #: bp-core/admin/bp-core-settings.php:31
1375
  msgid "Absolute path to your bbPress configuration file."
1376
  msgstr ""
1377
 
1378
+ #: bp-core/admin/bp-core-slugs.php:79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1379
  msgid "Directories"
1380
  msgstr ""
1381
 
1382
+ #: bp-core/admin/bp-core-slugs.php:81
1383
  msgid "Associate a WordPress Page with each BuddyPress component directory."
1384
  msgstr ""
1385
 
1386
+ #: bp-core/admin/bp-core-slugs.php:100 bp-core/admin/bp-core-slugs.php:163
1387
  msgid "- None -"
1388
  msgstr ""
1389
 
1390
+ #: bp-core/admin/bp-core-slugs.php:104 bp-core/admin/bp-core-slugs.php:167
1391
  msgid "New Page"
1392
  msgstr ""
1393
 
1394
+ #: bp-core/admin/bp-core-slugs.php:105 bp-core/admin/bp-core-slugs.php:168
1395
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:19
1396
  #: bp-themes/bp-default/members/single/settings/capabilities.php:61
1397
+ #: bp-xprofile/bp-xprofile-classes.php:401
1398
+ #: bp-xprofile/bp-xprofile-classes.php:928
1399
  msgid "Save"
1400
  msgstr ""
1401
 
1402
+ #: bp-core/admin/bp-core-slugs.php:142
1403
  msgid "Registration"
1404
  msgstr ""
1405
 
1406
+ #: bp-core/admin/bp-core-slugs.php:144
1407
  msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
1408
  msgstr ""
1409
 
1410
+ #: bp-core/bp-core-admin.php:154 bp-core/bp-core-admin.php:155
1411
+ #: bp-core/bp-core-admin.php:163 bp-core/bp-core-admin.php:164
1412
+ msgid "Welcome to BuddyPress"
1413
  msgstr ""
1414
 
1415
+ #: bp-core/bp-core-admin.php:174 bp-core/bp-core-admin.php:175
1416
+ #: bp-core/bp-core-admin.php:195
1417
+ msgid "BuddyPress"
1418
  msgstr ""
1419
 
1420
+ #: bp-core/bp-core-admin.php:184
1421
+ msgid "BuddyPress Help"
 
 
1422
  msgstr ""
1423
 
1424
+ #: bp-core/bp-core-admin.php:185
1425
+ msgid "Help"
 
1426
  msgstr ""
1427
 
1428
+ #: bp-core/bp-core-admin.php:194
1429
+ msgid "BuddyPress Components"
1430
  msgstr ""
1431
 
1432
+ #: bp-core/bp-core-admin.php:203 bp-core/bp-core-admin.php:204
1433
+ msgid "BuddyPress Pages"
1434
  msgstr ""
1435
 
1436
+ #: bp-core/bp-core-admin.php:212 bp-core/bp-core-admin.php:213
1437
+ msgid "BuddyPress Settings"
1438
  msgstr ""
1439
 
1440
+ #: bp-core/bp-core-admin.php:239
1441
+ msgid "Main Settings"
1442
  msgstr ""
1443
 
1444
+ #: bp-core/bp-core-admin.php:242 bp-core/bp-core-admin.php:247
1445
+ msgid "Toolbar"
1446
  msgstr ""
1447
 
1448
+ #: bp-core/bp-core-admin.php:252
1449
+ msgid "Account Deletion"
1450
  msgstr ""
1451
 
1452
+ #: bp-core/bp-core-admin.php:260
1453
+ msgid "Profile Settings"
1454
  msgstr ""
1455
 
1456
+ #: bp-core/bp-core-admin.php:263
1457
+ msgid "Avatar Uploads"
1458
  msgstr ""
1459
 
1460
+ #: bp-core/bp-core-admin.php:267
1461
+ msgid "Profile Syncing"
1462
  msgstr ""
1463
 
1464
+ #: bp-core/bp-core-admin.php:276
1465
+ msgid "Groups Settings"
1466
  msgstr ""
1467
 
1468
+ #: bp-core/bp-core-admin.php:279
1469
+ msgid "Group Creation"
1470
  msgstr ""
1471
 
1472
+ #: bp-core/bp-core-admin.php:288
1473
+ msgid "Legacy Group Forums"
1474
  msgstr ""
1475
 
1476
+ #: bp-core/bp-core-admin.php:291
1477
+ msgid "bbPress Configuration"
1478
  msgstr ""
1479
 
1480
+ #: bp-core/bp-core-admin.php:300
1481
+ msgid "Activity Settings"
1482
  msgstr ""
1483
 
1484
+ #: bp-core/bp-core-admin.php:303
1485
+ msgid "Blog &amp; Forum Comments"
1486
  msgstr ""
1487
 
1488
+ #: bp-core/bp-core-admin.php:308
1489
+ msgid "Akismet"
1490
  msgstr ""
1491
 
1492
+ #: bp-core/bp-core-admin.php:332
1493
+ msgid "About"
 
 
 
1494
  msgstr ""
1495
 
1496
+ #: bp-core/bp-core-admin.php:383 bp-core/bp-core-admin.php:492
1497
+ msgid "Welcome to BuddyPress %s"
1498
  msgstr ""
1499
 
1500
+ #: bp-core/bp-core-admin.php:386
1501
+ msgid "BuddyPress %s is our safest, fastest, most flexible version ever."
 
 
 
1502
  msgstr ""
1503
 
1504
+ #: bp-core/bp-core-admin.php:388
1505
+ msgid "Thank you for updating! BuddyPress %s is our safest, fastest, most flexible version ever."
 
 
 
1506
  msgstr ""
1507
 
1508
+ #: bp-core/bp-core-admin.php:391 bp-core/bp-core-admin.php:494
1509
+ msgid "Version %s"
 
 
 
1510
  msgstr ""
1511
 
1512
+ #: bp-core/bp-core-admin.php:395 bp-core/bp-core-admin.php:498
1513
+ msgid "What&#8217;s New"
1514
  msgstr ""
1515
 
1516
+ #: bp-core/bp-core-admin.php:397 bp-core/bp-core-admin.php:500
1517
+ msgid "Credits"
1518
  msgstr ""
1519
 
1520
+ #: bp-core/bp-core-admin.php:402
1521
+ msgid "Getting Started"
1522
  msgstr ""
1523
 
1524
+ #: bp-core/bp-core-admin.php:405
1525
+ msgid "Your Default Setup"
1526
  msgstr ""
1527
 
1528
+ #: bp-core/bp-core-admin.php:407
1529
+ msgid "BuddyPress&#8217;s powerful features help your users connect and collaborate. To help get your community started, we&#8217;ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href=\"%3$s\">configuring user profiles</a>. Want to explore more of BP&#8217;s features? Visit the <a href=\"%4$s\">Components panel</a>."
1530
  msgstr ""
1531
 
1532
+ #: bp-core/bp-core-admin.php:408 bp-core/bp-core-template.php:243
1533
+ #: bp-core/bp-core-widgets.php:111 bp-groups/bp-groups-admin.php:761
1534
+ #: bp-groups/bp-groups-template.php:1454 bp-members/bp-members-loader.php:24
1535
+ #: bp-members/bp-members-screens.php:327
1536
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:231
1537
+ #: bp-themes/bp-default/groups/single/admin.php:231
1538
+ msgid "Members"
1539
  msgstr ""
1540
 
1541
+ #: bp-core/bp-core-admin.php:414
1542
+ msgid "Community and Support"
1543
  msgstr ""
1544
 
1545
+ #: bp-core/bp-core-admin.php:415
1546
+ msgid "Looking for help? The <a href=\"http://codex.buddypress.org/\">BuddyPress Codex</a> has you covered, with dozens of user-contributed guides on how to configure and use your BP site. Can&#8217;t find what you need? Stop by <a href=\"http://buddypress.org/support/\">our support forums</a>, where a vibrant community of BuddyPress users and developers is waiting to share tips, show off their sites, talk about the future of BuddyPress, and much more."
1547
  msgstr ""
1548
 
1549
+ #: bp-core/bp-core-admin.php:421
1550
+ msgid "A Declaration of (Theme) Independence"
1551
  msgstr ""
1552
 
1553
+ #: bp-core/bp-core-admin.php:424
1554
+ msgid "It Just Works"
1555
  msgstr ""
1556
 
1557
+ #: bp-core/bp-core-admin.php:425
1558
+ msgid "BuddyPress is now compatible with <strong>any WordPress theme</strong>. If your theme has BuddyPress-specific templates and styling, we&#8217;ll use them. If not, we provide what you need to make your BuddyPress content look great. Still want to customize? No problem - you can override our templates just like you would in a WordPress child theme. <a href=\"http://codex.buddypress.org/theme-compatibility/\">Learn more about theme compatibility</a>."
1559
  msgstr ""
1560
 
1561
+ #: bp-core/bp-core-admin.php:430
1562
+ msgid "Group Management"
1563
  msgstr ""
1564
 
1565
+ #: bp-core/bp-core-admin.php:433
1566
+ msgid "Get More Done Quickly"
1567
  msgstr ""
1568
 
1569
+ #: bp-core/bp-core-admin.php:436
1570
+ msgid "Groups administration panel"
1571
  msgstr ""
1572
 
1573
+ #: bp-core/bp-core-admin.php:443
1574
+ msgid "The new %s makes it easy to handle large numbers of groups on your BuddyPress installation. Delete groups, edit group details, modify memberships, and more, with just a few clicks."
1575
  msgstr ""
1576
 
1577
+ #: bp-core/bp-core-admin.php:450
1578
+ msgid "Under the Hood"
1579
  msgstr ""
1580
 
1581
+ #: bp-core/bp-core-admin.php:454
1582
+ msgid "Faster Member Queries"
1583
  msgstr ""
1584
 
1585
+ #: bp-core/bp-core-admin.php:455
1586
+ msgid "The new <code>BP_User_Query</code> makes member queries (like in the Members directory) up to 4x faster than before."
1587
  msgstr ""
1588
 
1589
+ #: bp-core/bp-core-admin.php:457
1590
+ msgid "Sortable Profile Options"
1591
  msgstr ""
1592
 
1593
+ #: bp-core/bp-core-admin.php:458
1594
+ msgid "Profile field types with multiple options - like radio buttons and checkboxes - now support drag-and-drop reordering."
1595
  msgstr ""
1596
 
1597
+ #: bp-core/bp-core-admin.php:462
1598
+ msgid "New Visibility Level"
1599
  msgstr ""
1600
 
1601
+ #: bp-core/bp-core-admin.php:463
1602
+ msgid "By popular demand, the \"Admins Only\" visibility setting is now available for profile fields."
1603
  msgstr ""
1604
 
1605
+ #: bp-core/bp-core-admin.php:465
1606
+ msgid "Better bbPress Integration"
1607
  msgstr ""
1608
 
1609
+ #: bp-core/bp-core-admin.php:466
1610
+ msgid "Support for group and sitewide forums, using the latest version of the bbPress plugin, is better than ever. Still using bbPress 1.x? Our new migration tools are field-tested."
1611
  msgstr ""
1612
 
1613
+ #: bp-core/bp-core-admin.php:471 bp-core/bp-core-admin.php:598
1614
+ msgid "Go to the BuddyPress Settings page"
1615
  msgstr ""
1616
 
1617
+ #: bp-core/bp-core-admin.php:493
1618
+ msgid "Thank you for updating to the latest version! BuddyPress %s is ready to make your community a safer, faster, and better looking place to hang out!"
1619
  msgstr ""
1620
 
1621
+ #: bp-core/bp-core-admin.php:504
1622
+ msgid "BuddyPress is created by a worldwide network of friendly folks."
1623
  msgstr ""
1624
 
1625
+ #: bp-core/bp-core-admin.php:506
1626
+ msgid "Project Leaders"
1627
  msgstr ""
1628
 
1629
+ #: bp-core/bp-core-admin.php:511
1630
+ msgid "Founding Developer"
1631
  msgstr ""
1632
 
1633
+ #: bp-core/bp-core-admin.php:516
1634
+ msgid "Project Lead"
1635
  msgstr ""
1636
 
1637
+ #: bp-core/bp-core-admin.php:521 bp-core/bp-core-admin.php:526
1638
+ msgid "Lead Developer"
1639
  msgstr ""
1640
 
1641
+ #: bp-core/bp-core-admin.php:530
1642
+ msgid "Core Developers"
1643
  msgstr ""
1644
 
1645
+ #: bp-core/bp-core-admin.php:538
1646
+ msgid "Recent Rockstars"
1647
  msgstr ""
1648
 
1649
+ #: bp-core/bp-core-admin.php:543
1650
+ msgid "Design Officer"
1651
  msgstr ""
1652
 
1653
+ #: bp-core/bp-core-admin.php:548
1654
+ msgid "Support Officer"
1655
  msgstr ""
1656
 
1657
+ #: bp-core/bp-core-admin.php:552
1658
+ msgid "Core Contributors to BuddyPress 1.7"
1659
  msgstr ""
1660
 
1661
+ #: bp-core/bp-core-adminbar.php:36 bp-core/bp-core-buddybar.php:498
1662
+ msgid "My Account"
1663
  msgstr ""
1664
 
1665
+ #: bp-core/bp-core-avatars.php:231
1666
+ msgid "Avatar Image"
1667
  msgstr ""
1668
 
1669
+ #: bp-core/bp-core-avatars.php:499
1670
+ msgid "The image was uploaded successfully"
1671
  msgstr ""
1672
 
1673
+ #: bp-core/bp-core-avatars.php:500 bp-core/bp-core-avatars.php:501
1674
+ msgid "The image exceeds the maximum allowed file size of: "
1675
  msgstr ""
1676
 
1677
+ #: bp-core/bp-core-avatars.php:502
1678
+ msgid "The uploaded file was only partially uploaded."
1679
  msgstr ""
1680
 
1681
+ #: bp-core/bp-core-avatars.php:503
1682
+ msgid "The image was not uploaded."
1683
  msgstr ""
1684
 
1685
+ #: bp-core/bp-core-avatars.php:504
1686
+ msgid "Missing a temporary folder."
1687
  msgstr ""
1688
 
1689
+ #: bp-core/bp-core-avatars.php:508
1690
+ msgid "Your upload failed, please try again. Error was: %s"
1691
  msgstr ""
1692
 
1693
+ #: bp-core/bp-core-avatars.php:513
1694
+ msgid "The file you uploaded is too big. Please upload a file under %s"
1695
  msgstr ""
1696
 
1697
+ #: bp-core/bp-core-avatars.php:518
1698
+ msgid "Please upload only JPG, GIF or PNG photos."
 
1699
  msgstr ""
1700
 
1701
+ #: bp-core/bp-core-avatars.php:535 bp-core/bp-core-avatars.php:572
1702
+ msgid "Upload Failed! Error was: %s"
1703
  msgstr ""
1704
 
1705
+ #: bp-core/bp-core-avatars.php:590
1706
+ msgid "Upload failed! Error was: %s"
1707
  msgstr ""
1708
 
1709
+ #: bp-core/bp-core-avatars.php:733 bp-core/bp-core-classes.php:715
1710
+ #: bp-core/bp-core-classes.php:716 bp-core/bp-core-classes.php:717
1711
+ #: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107
1712
+ msgid "Avatar of %s"
1713
  msgstr ""
1714
 
1715
+ #: bp-core/bp-core-buddybar.php:303
1716
+ msgid "You do not have access to this page."
1717
  msgstr ""
1718
 
1719
+ #: bp-core/bp-core-buddybar.php:482 bp-themes/bp-default/sidebar.php:53
1720
+ msgid "Log In"
1721
  msgstr ""
1722
 
1723
+ #: bp-core/bp-core-buddybar.php:486
1724
+ msgid "Sign Up"
1725
  msgstr ""
1726
 
1727
+ #: bp-core/bp-core-buddybar.php:540 bp-core/deprecated/1.5.php:307
1728
+ #: bp-members/bp-members-template.php:773 bp-themes/bp-default/sidebar.php:18
1729
+ msgid "Log Out"
1730
  msgstr ""
1731
 
1732
+ #: bp-core/bp-core-buddybar.php:569 bp-groups/bp-groups-admin.php:1242
1733
+ msgid "Visit"
1734
  msgstr ""
1735
 
1736
+ #: bp-core/bp-core-buddybar.php:571
1737
+ msgid "Random Member"
1738
  msgstr ""
1739
 
1740
+ #: bp-core/bp-core-buddybar.php:575
1741
+ msgid "Random Group"
1742
  msgstr ""
1743
 
1744
+ #: bp-core/bp-core-buddybar.php:581
1745
+ msgid "Random Site"
1746
  msgstr ""
1747
 
1748
+ #: bp-core/bp-core-caps.php:250 bp-core/bp-core-caps.php:263
1749
+ #: bp-core/bp-core-caps.php:278 bp-core/bp-core-caps.php:289
1750
+ msgid "Special community roles no longer exist. Use mapped capabilities instead"
1751
  msgstr ""
1752
 
1753
+ #: bp-core/bp-core-catchuri.php:280
1754
+ msgid "This user has been marked as a spammer. Only site admins can view this profile."
1755
  msgstr ""
1756
 
1757
+ #: bp-core/bp-core-catchuri.php:466 bp-core/bp-core-catchuri.php:525
1758
+ msgid "You must log in to access the page you requested."
1759
  msgstr ""
1760
 
1761
+ #: bp-core/bp-core-classes.php:732
1762
+ msgid "%d group"
1763
+ msgid_plural "%d groups"
1764
+ msgstr[0] ""
1765
+ msgstr[1] ""
1766
 
1767
+ #: bp-core/bp-core-dependency.php:81
1768
+ msgid "The current user is being initialized without using $wp->init()."
1769
  msgstr ""
1770
 
1771
+ #: bp-core/bp-core-filters.php:215 bp-core/bp-core-filters.php:239
1772
+ msgid "[User Set]"
1773
  msgstr ""
1774
 
1775
+ #: bp-core/bp-core-filters.php:257
1776
+ msgid ""
1777
+ "Thanks for registering! To complete the activation of your account and blog, please click the following link:\n"
1778
+ "\n"
1779
+ "%1$s\n"
1780
+ "\n"
1781
+ "\n"
1782
+ "\n"
1783
+ "After you activate, you can visit your blog here:\n"
1784
+ "\n"
1785
+ "%2$s"
1786
  msgstr ""
1787
 
1788
+ #: bp-core/bp-core-filters.php:258
1789
+ msgid "Activate %s"
1790
  msgstr ""
1791
 
1792
+ #: bp-core/bp-core-filters.php:285 bp-members/bp-members-functions.php:1357
1793
+ msgid ""
1794
+ "Thanks for registering! To complete the activation of your account please click the following link:\n"
1795
+ "\n"
1796
+ "%1$s\n"
1797
+ "\n"
1798
  msgstr ""
1799
 
1800
+ #: bp-core/bp-core-filters.php:286 bp-members/bp-members-functions.php:1358
1801
+ msgid "Activate Your Account"
1802
  msgstr ""
1803
 
1804
+ #: bp-core/bp-core-filters.php:342
1805
+ msgctxt "Construct the page title. 1 = user name, 2 = component name, 3 = seperator"
1806
+ msgid "%1$s %3$s %2$s"
1807
  msgstr ""
1808
 
1809
+ #. translators: "group name | group nav section name"
 
 
1810
 
1811
+ #: bp-core/bp-core-filters.php:348
1812
+ msgid "%1$s | %2$s"
1813
  msgstr ""
1814
 
1815
+ #. translators: "component item name | component nav section name | root
1816
+ #. component name"
 
1817
 
1818
+ #: bp-core/bp-core-filters.php:353
1819
+ msgid "%1$s | %2$s | %3$s"
1820
  msgstr ""
1821
 
1822
+ #: bp-core/bp-core-filters.php:358 bp-core/bp-core-filters.php:360
1823
+ msgid "%s Directory"
1824
  msgstr ""
1825
 
1826
+ #: bp-core/bp-core-filters.php:365 bp-members/bp-members-screens.php:428
1827
+ #: bp-themes/bp-default/registration/register.php:23
1828
+ msgid "Create an Account"
1829
  msgstr ""
1830
 
1831
+ #: bp-core/bp-core-filters.php:369 bp-members/bp-members-screens.php:436
1832
+ #: bp-themes/bp-default/registration/activate.php:13
1833
+ msgid "Activate your Account"
1834
  msgstr ""
1835
 
1836
+ #: bp-core/bp-core-filters.php:373 bp-groups/bp-groups-screens.php:999
1837
+ #: bp-groups/bp-groups-screens.php:1037
1838
+ #: bp-themes/bp-default/groups/create.php:18
1839
+ #: bp-themes/bp-default/groups/index.php:21
1840
+ msgid "Create a Group"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1841
  msgstr ""
1842
 
1843
+ #: bp-core/bp-core-functions.php:204
1844
+ msgctxt "Page title for the Activity directory."
1845
+ msgid "Activity"
 
 
1846
  msgstr ""
1847
 
1848
+ #: bp-core/bp-core-functions.php:205
1849
+ msgctxt "Page title for the Groups directory."
1850
+ msgid "Groups"
 
 
1851
  msgstr ""
1852
 
1853
+ #: bp-core/bp-core-functions.php:206
1854
+ msgctxt "Page title for the Sites directory."
1855
+ msgid "Sites"
1856
  msgstr ""
1857
 
1858
+ #: bp-core/bp-core-functions.php:207
1859
+ msgctxt "Page title for the user account activation screen."
1860
+ msgid "Activate"
1861
  msgstr ""
1862
 
1863
+ #: bp-core/bp-core-functions.php:208
1864
+ msgctxt "Page title for the Members directory."
1865
+ msgid "Members"
1866
  msgstr ""
1867
 
1868
+ #: bp-core/bp-core-functions.php:209
1869
+ msgctxt "Page title for the user registration screen."
1870
+ msgid "Register"
1871
  msgstr ""
1872
 
1873
+ #: bp-core/bp-core-functions.php:441
1874
  msgid "sometime"
1875
  msgstr ""
1876
 
1877
+ #: bp-core/bp-core-functions.php:442
1878
  msgid "right now"
1879
  msgstr ""
1880
 
1881
+ #: bp-core/bp-core-functions.php:443
1882
  msgid "%s ago"
1883
  msgstr ""
1884
 
1885
+ #: bp-core/bp-core-functions.php:447
1886
  msgid "year"
1887
  msgstr ""
1888
 
1889
+ #: bp-core/bp-core-functions.php:447
1890
  msgid "years"
1891
  msgstr ""
1892
 
1893
+ #: bp-core/bp-core-functions.php:448
1894
  msgid "month"
1895
  msgstr ""
1896
 
1897
+ #: bp-core/bp-core-functions.php:448
1898
  msgid "months"
1899
  msgstr ""
1900
 
1901
+ #: bp-core/bp-core-functions.php:449
1902
  msgid "week"
1903
  msgstr ""
1904
 
1905
+ #: bp-core/bp-core-functions.php:449
1906
  msgid "weeks"
1907
  msgstr ""
1908
 
1909
+ #: bp-core/bp-core-functions.php:450
1910
  msgid "day"
1911
  msgstr ""
1912
 
1913
+ #: bp-core/bp-core-functions.php:450
1914
  msgid "days"
1915
  msgstr ""
1916
 
1917
+ #: bp-core/bp-core-functions.php:451
1918
  msgid "hour"
1919
  msgstr ""
1920
 
1921
+ #: bp-core/bp-core-functions.php:451
1922
  msgid "hours"
1923
  msgstr ""
1924
 
1925
+ #: bp-core/bp-core-functions.php:452
1926
  msgid "minute"
1927
  msgstr ""
1928
 
1929
+ #: bp-core/bp-core-functions.php:452
1930
  msgid "minutes"
1931
  msgstr ""
1932
 
1933
+ #: bp-core/bp-core-functions.php:453
1934
  msgid "second"
1935
  msgstr ""
1936
 
1937
+ #: bp-core/bp-core-functions.php:453
1938
  msgid "seconds"
1939
  msgstr ""
1940
 
1941
+ #: bp-core/bp-core-functions.php:512
1942
  msgctxt "Separator in time since"
1943
  msgid ","
1944
  msgstr ""
1945
 
1946
+ #: bp-core/bp-core-functions.php:580
1947
  msgid "Not recently active"
1948
  msgstr ""
1949
 
1950
+ #: bp-core/bp-core-loader.php:214 bp-members/bp-members-loader.php:158
1951
+ #: bp-xprofile/bp-xprofile-loader.php:154
1952
+ #: bp-xprofile/bp-xprofile-loader.php:229
1953
  msgid "Profile"
1954
  msgstr ""
1955
 
 
 
 
 
 
1956
  #: bp-core/bp-core-template.php:65
1957
  msgid "Options"
1958
  msgstr ""
1959
 
1960
+ #: bp-core/bp-core-template.php:191
1961
  msgid "%1$s at %2$s"
1962
  msgstr ""
1963
 
1964
+ #: bp-core/bp-core-template.php:252 bp-forums/bp-forums-loader.php:103
1965
+ #: bp-forums/bp-forums-loader.php:166 bp-forums/bp-forums-loader.php:207
1966
+ #: bp-forums/bp-forums-screens.php:188 bp-forums/bp-forums-screens.php:190
1967
+ #: bp-forums/deprecated/1.6.php:24 bp-forums/deprecated/1.7.php:25
1968
+ #: bp-forums/deprecated/1.7.php:57 bp-forums/deprecated/1.7.php:329
1969
+ msgid "Forums"
1970
+ msgstr ""
1971
+
1972
+ #: bp-core/bp-core-template.php:254
1973
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:79
1974
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:40
1975
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:27
1976
+ #: bp-themes/bp-default/activity/index.php:99
1977
  #: bp-themes/bp-default/forums/forums-loop.php:40
1978
  #: bp-themes/bp-default/members/single/activity.php:27
1979
  msgid "Posts"
1980
  msgstr ""
1981
 
1982
+ #: bp-core/bp-core-template.php:257
1983
  msgid "Search these:"
1984
  msgstr ""
1985
 
1986
+ #: bp-core/bp-core-template.php:285
1987
  msgid "Search anything..."
1988
  msgstr ""
1989
 
1990
+ #: bp-core/bp-core-template.php:379
1991
  msgid " [&hellip;]"
1992
  msgstr ""
1993
 
1994
+ #: bp-core/bp-core-template.php:557
1995
+ msgid "Community"
1996
+ msgstr ""
1997
+
1998
+ #: bp-core/bp-core-widgets.php:19
1999
  msgid "A dynamic list of recently active, popular, and newest members"
2000
  msgstr ""
2001
 
2002
+ #: bp-core/bp-core-widgets.php:22
2003
+ msgctxt "widget name"
2004
+ msgid "(BuddyPress) Members"
2005
+ msgstr ""
2006
+
2007
  #: bp-core/bp-core-widgets.php:47 bp-core/bp-core-widgets.php:133
2008
+ #: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:152
2009
+ #: bp-groups/bp-groups-widgets.php:58 bp-groups/bp-groups-widgets.php:139
2010
+ #: bp-templates/bp-legacy/buddypress/blogs/index.php:39
2011
+ #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:22
2012
  #: bp-themes/bp-default/blogs/index.php:56
2013
  #: bp-themes/bp-default/members/single/blogs.php:22
2014
  msgid "Newest"
2015
  msgstr ""
2016
 
2017
  #: bp-core/bp-core-widgets.php:48 bp-core/bp-core-widgets.php:134
2018
+ #: bp-groups/bp-groups-widgets.php:59 bp-groups/bp-groups-widgets.php:140
2019
  msgid "Active"
2020
  msgstr ""
2021
 
2022
  #: bp-core/bp-core-widgets.php:52 bp-core/bp-core-widgets.php:135
2023
+ #: bp-groups/bp-groups-widgets.php:60 bp-groups/bp-groups-widgets.php:141
2024
  msgid "Popular"
2025
  msgstr ""
2026
 
2028
  msgid "No one has signed up yet!"
2029
  msgstr ""
2030
 
2031
+ #: bp-core/bp-core-widgets.php:124 bp-core/bp-core-widgets.php:204
2032
+ #: bp-core/bp-core-widgets.php:271 bp-groups/bp-groups-widgets.php:130
2033
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:86
2034
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:47
2035
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:75
2036
  #: bp-themes/bp-default/forums/index.php:104
2037
  #: bp-themes/bp-default/groups/single/forum/edit.php:47
2038
  #: bp-themes/bp-default/groups/single/forum.php:75
2051
  msgid "Default members to show:"
2052
  msgstr ""
2053
 
2054
+ #: bp-core/bp-core-widgets.php:150
2055
  msgid "Avatars of users who are currently online"
2056
  msgstr ""
2057
 
2058
+ #: bp-core/bp-core-widgets.php:153
2059
+ msgctxt "widget name"
2060
+ msgid "(BuddyPress) Who's Online"
2061
  msgstr ""
2062
 
2063
+ #: bp-core/bp-core-widgets.php:176
2064
  msgid "There are no users currently online"
2065
  msgstr ""
2066
 
2067
+ #: bp-core/bp-core-widgets.php:195
2068
  msgid "Who's Online"
2069
  msgstr ""
2070
 
2071
+ #: bp-core/bp-core-widgets.php:206 bp-core/bp-core-widgets.php:273
2072
  msgid "Max Members to show:"
2073
  msgstr ""
2074
 
2075
+ #: bp-core/bp-core-widgets.php:217
2076
  msgid "Avatars of recently active members"
2077
  msgstr ""
2078
 
2079
+ #: bp-core/bp-core-widgets.php:220
2080
+ msgctxt "widget name"
2081
+ msgid "(BuddyPress) Recently Active Members"
2082
  msgstr ""
2083
 
2084
+ #: bp-core/bp-core-widgets.php:243
2085
  msgid "There are no recently active members"
2086
  msgstr ""
2087
 
2088
+ #: bp-core/bp-core-widgets.php:325
2089
  msgid "There were no members found, please try another filter."
2090
  msgstr ""
2091
 
2092
+ #: bp-core/deprecated/1.5.php:142
2093
+ #: bp-templates/bp-legacy/buddypress/activity/post-form.php:45
2094
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
2095
  #: bp-themes/bp-default/activity/post-form.php:45
2096
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:8
2097
+ #: bp-xprofile/bp-xprofile-loader.php:272
2098
  msgid "My Profile"
2099
  msgstr ""
2100
 
2101
+ #: bp-core/deprecated/1.5.php:149
2102
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:15
2103
+ #: bp-themes/bp-default/functions.php:641
2104
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:15
2105
  msgid "Name"
2106
  msgstr ""
2107
 
2108
+ #: bp-core/deprecated/1.5.php:158
2109
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:24
2110
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:24
2111
  msgid "About Me"
2112
  msgstr ""
2113
 
2114
+ #: bp-core/deprecated/1.5.php:167
2115
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:33
2116
+ #: bp-themes/bp-default/functions.php:645
2117
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:33
2118
  msgid "Website"
2119
  msgstr ""
2120
 
2121
+ #: bp-core/deprecated/1.5.php:176
2122
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:42
2123
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:42
2124
  msgid "Jabber"
2125
  msgstr ""
2126
 
2127
+ #: bp-core/deprecated/1.5.php:185
2128
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:51
2129
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:51
2130
  msgid "AOL Messenger"
2131
  msgstr ""
2132
 
2133
+ #: bp-core/deprecated/1.5.php:194
2134
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:60
2135
  #: bp-themes/bp-default/members/single/profile/profile-wp.php:60
2136
  msgid "Yahoo Messenger"
2137
  msgstr ""
2138
 
2139
+ #: bp-core/deprecated/1.5.php:352
2140
  msgid "%1$s mentioned you in the group \"%2$s\""
2141
  msgstr ""
2142
 
2143
+ #: bp-core/deprecated/1.6.php:128 bp-core/deprecated/1.6.php:149
2144
+ #: bp-groups/bp-groups-template.php:2498 bp-groups/bp-groups-template.php:2520
2145
  msgid "Recently Active"
2146
  msgstr ""
2147
 
2148
+ #: bp-core/deprecated/1.6.php:130 bp-core/deprecated/1.6.php:155
2149
+ #: bp-groups/bp-groups-template.php:2503 bp-groups/bp-groups-template.php:2535
2150
  msgid "Alphabetically"
2151
  msgstr ""
2152
 
2153
+ #: bp-forums/bp-forums-loader.php:25
2154
+ msgid "Discussion Forums"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2155
  msgstr ""
2156
 
2157
+ #: bp-forums/bp-forums-loader.php:60
2158
  msgid "Search Forums..."
2159
  msgstr ""
2160
 
2161
+ #: bp-forums/bp-forums-loader.php:125 bp-forums/bp-forums-loader.php:174
2162
  msgid "Topics Started"
2163
  msgstr ""
2164
 
2165
+ #: bp-forums/bp-forums-loader.php:136
2166
  msgid "Replied To"
2167
  msgstr ""
2168
 
2169
+ #: bp-forums/bp-forums-loader.php:182
2170
  msgid "Replies"
2171
  msgstr ""
2172
 
2173
+ #: bp-forums/bp-forums-loader.php:190
2174
  msgid "Favorite Topics"
2175
  msgstr ""
2176
 
2177
+ #: bp-forums/bp-forums-screens.php:15 bp-forums/bp-forums-screens.php:162
2178
  msgid "The forums component has not been set up yet."
2179
  msgstr ""
2180
 
2181
+ #: bp-forums/bp-forums-screens.php:38 bp-groups/bp-groups-screens.php:381
2182
  msgid "Please provide a title for your forum topic."
2183
  msgstr ""
2184
 
2185
+ #: bp-forums/bp-forums-screens.php:40 bp-groups/bp-groups-screens.php:383
2186
  msgid "Forum posts cannot be empty. Please enter some text."
2187
  msgstr ""
2188
 
2189
+ #: bp-forums/bp-forums-screens.php:47 bp-groups/bp-groups-screens.php:395
2190
  msgid "There was an error when creating the topic"
2191
  msgstr ""
2192
 
2193
+ #: bp-forums/bp-forums-screens.php:50 bp-groups/bp-groups-screens.php:398
2194
  msgid "The topic was created successfully"
2195
  msgstr ""
2196
 
2197
+ #: bp-forums/bp-forums-screens.php:58 bp-forums/bp-forums-screens.php:63
2198
  msgid "Please pick the group forum where you would like to post this topic."
2199
  msgstr ""
2200
 
2201
+ #: bp-forums/bp-forums-screens.php:188 bp-groups/bp-groups-template.php:1690
2202
+ #: bp-groups/bp-groups-template.php:1691
2203
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:19
2204
+ #: bp-themes/bp-default/forums/index.php:23
2205
+ #: bp-themes/bp-default/groups/single/forum.php:19
2206
+ msgid "New Topic"
2207
+ msgstr ""
2208
+
2209
  #: bp-forums/bp-forums-template.php:188 bp-forums/bp-forums-template.php:404
2210
  msgctxt "Forum topic pagination previous text"
2211
  msgid "&larr;"
2219
  #: bp-forums/bp-forums-template.php:505 bp-forums/bp-forums-template.php:567
2220
  #: bp-forums/bp-forums-template.php:1216
2221
  #: bp-messages/bp-messages-classes.php:269
2222
+ #: bp-messages/bp-messages-template.php:841
2223
+ #: bp-messages/bp-messages-template.php:902
2224
  msgid "Deleted User"
2225
  msgstr ""
2226
 
2228
  msgid "Group logo for %s"
2229
  msgstr ""
2230
 
2231
+ #: bp-forums/bp-forums-template.php:683 bp-groups/bp-groups-template.php:1013
2232
  msgid "%d post"
2233
  msgstr ""
2234
 
2235
+ #: bp-forums/bp-forums-template.php:685 bp-groups/bp-groups-template.php:1015
2236
  msgid "%d posts"
2237
  msgstr ""
2238
 
2282
  msgid "Viewing post %1$s to %2$s (%3$s total posts)"
2283
  msgstr ""
2284
 
2285
+ #: bp-forums/deprecated/1.6.php:29 bp-forums/deprecated/1.7.php:62
2286
+ msgid "Settings Saved."
2287
  msgstr ""
2288
 
2289
+ #: bp-forums/deprecated/1.6.php:45 bp-forums/deprecated/1.6.php:145
2290
+ #: bp-forums/deprecated/1.7.php:83 bp-forums/deprecated/1.7.php:220
2291
+ msgid "Forums for Groups"
2292
  msgstr ""
2293
 
2294
+ #: bp-forums/deprecated/1.6.php:47 bp-forums/deprecated/1.6.php:147
2295
+ #: bp-forums/deprecated/1.7.php:85 bp-forums/deprecated/1.7.php:222
2296
+ msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas."
2297
  msgstr ""
2298
 
2299
+ #: bp-forums/deprecated/1.6.php:48 bp-forums/deprecated/1.6.php:148
2300
+ #: bp-forums/deprecated/1.7.php:86 bp-forums/deprecated/1.7.php:223
2301
+ msgid "You may use an existing bbPress installation if you have one."
2302
  msgstr ""
2303
 
2304
+ #: bp-forums/deprecated/1.6.php:50 bp-forums/deprecated/1.6.php:150
2305
+ #: bp-forums/deprecated/1.7.php:88 bp-forums/deprecated/1.7.php:106
2306
+ #: bp-forums/deprecated/1.7.php:225 bp-forums/deprecated/1.7.php:244
2307
+ msgid "Features"
2308
  msgstr ""
2309
 
2310
+ #: bp-forums/deprecated/1.6.php:52 bp-forums/deprecated/1.6.php:152
2311
+ #: bp-forums/deprecated/1.7.php:90 bp-forums/deprecated/1.7.php:227
2312
+ msgid "Group Integration"
2313
  msgstr ""
2314
 
2315
+ #: bp-forums/deprecated/1.6.php:53 bp-forums/deprecated/1.6.php:153
2316
+ #: bp-forums/deprecated/1.7.php:91 bp-forums/deprecated/1.7.php:228
2317
+ msgid "Member Profile Integration"
2318
  msgstr ""
2319
 
2320
+ #: bp-forums/deprecated/1.6.php:54 bp-forums/deprecated/1.6.php:154
2321
+ #: bp-forums/deprecated/1.7.php:92 bp-forums/deprecated/1.7.php:110
2322
+ #: bp-forums/deprecated/1.7.php:229 bp-forums/deprecated/1.7.php:248
2323
+ msgid "Activity Stream Integration"
2324
  msgstr ""
2325
 
2326
+ #: bp-forums/deprecated/1.6.php:55 bp-forums/deprecated/1.6.php:155
2327
+ #: bp-forums/deprecated/1.7.php:93 bp-forums/deprecated/1.7.php:111
2328
+ #: bp-forums/deprecated/1.7.php:230 bp-forums/deprecated/1.7.php:249
2329
+ msgid "@ Mention Integration"
2330
  msgstr ""
2331
 
2332
+ #: bp-forums/deprecated/1.6.php:59
2333
+ msgid "Reinstall Group Forums"
2334
  msgstr ""
2335
 
2336
+ #: bp-forums/deprecated/1.6.php:78 bp-forums/deprecated/1.7.php:153
2337
+ msgid "The bb-config.php file was not found at that location, please try again."
2338
  msgstr ""
2339
 
2340
+ #: bp-forums/deprecated/1.6.php:81 bp-forums/deprecated/1.7.php:156
2341
+ msgid "Forums were set up correctly using your existing bbPress install!"
2342
  msgstr ""
2343
 
2344
+ #: bp-forums/deprecated/1.6.php:82 bp-forums/deprecated/1.7.php:157
2345
+ msgid "BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location."
2346
  msgstr ""
2347
 
2348
+ #: bp-forums/deprecated/1.6.php:87 bp-forums/deprecated/1.7.php:162
2349
+ msgid "Existing bbPress Installation"
 
2350
  msgstr ""
2351
 
2352
+ #: bp-forums/deprecated/1.6.php:88 bp-forums/deprecated/1.7.php:163
2353
+ msgid "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest."
2354
  msgstr ""
2355
 
2356
+ #: bp-forums/deprecated/1.6.php:90 bp-forums/deprecated/1.6.php:122
2357
+ #: bp-forums/deprecated/1.7.php:165 bp-forums/deprecated/1.7.php:197
2358
+ msgid "Complete Installation"
2359
+ msgstr ""
2360
+
2361
+ #: bp-forums/deprecated/1.6.php:106 bp-forums/deprecated/1.7.php:181
2362
+ msgid "<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>"
2363
+ msgstr ""
2364
+
2365
+ #: bp-forums/deprecated/1.6.php:110 bp-forums/deprecated/1.7.php:185
2366
+ msgid "<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>"
2367
+ msgstr ""
2368
+
2369
+ #: bp-forums/deprecated/1.6.php:119 bp-forums/deprecated/1.7.php:194
2370
+ msgid "New bbPress Installation"
2371
+ msgstr ""
2372
+
2373
+ #: bp-forums/deprecated/1.6.php:120 bp-forums/deprecated/1.7.php:195
2374
+ msgid ""
2375
+ "You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n"
2376
+ "\t\t\t\tprocess. When you're ready, hit the link below."
2377
+ msgstr ""
2378
+
2379
+ #: bp-forums/deprecated/1.6.php:132 bp-forums/deprecated/1.7.php:207
2380
+ msgid "bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: \"%s\""
2381
+ msgstr ""
2382
+
2383
+ #: bp-forums/deprecated/1.6.php:159 bp-forums/deprecated/1.7.php:234
2384
+ msgid "Install Group Forums"
2385
+ msgstr ""
2386
+
2387
+ #: bp-forums/deprecated/1.6.php:160 bp-forums/deprecated/1.7.php:235
2388
+ msgid "Use Existing Installation"
2389
+ msgstr ""
2390
+
2391
+ #: bp-forums/deprecated/1.7.php:46 bp-forums/deprecated/1.7.php:143
2392
+ msgid "Configure Site Wide Forums"
2393
+ msgstr ""
2394
+
2395
+ #: bp-forums/deprecated/1.7.php:49 bp-forums/deprecated/1.7.php:146
2396
+ msgid "Install Site Wide Forums"
2397
+ msgstr ""
2398
+
2399
+ #: bp-forums/deprecated/1.7.php:83
2400
+ msgid "(Installed)"
2401
+ msgstr ""
2402
+
2403
+ #: bp-forums/deprecated/1.7.php:97
2404
+ msgid "Uninstall Group Forums"
2405
+ msgstr ""
2406
+
2407
+ #: bp-forums/deprecated/1.7.php:102 bp-forums/deprecated/1.7.php:240
2408
+ msgid "New! Site Wide Forums"
2409
+ msgstr ""
2410
+
2411
+ #: bp-forums/deprecated/1.7.php:103 bp-forums/deprecated/1.7.php:241
2412
+ msgid "Your site will have central forums that are not isolated to any specific group. Choose this if you'd like to have a central forum area for your members."
2413
+ msgstr ""
2414
+
2415
+ #: bp-forums/deprecated/1.7.php:104 bp-forums/deprecated/1.7.php:242
2416
+ msgid "You may activate both Group and Site Wide forums, but this may create a poor experience for your members."
2417
+ msgstr ""
2418
+
2419
+ #: bp-forums/deprecated/1.7.php:108 bp-forums/deprecated/1.7.php:246
2420
+ msgid "Central Discussion Area"
2421
+ msgstr ""
2422
+
2423
+ #: bp-forums/deprecated/1.7.php:109 bp-forums/deprecated/1.7.php:247
2424
+ msgid "Forum Plugins Available"
2425
+ msgstr ""
2426
+
2427
+ #: bp-forums/deprecated/1.7.php:121
2428
+ msgid "Need help deciding between Group Forums and Site Wide Forums? Visit <a href=\"%s\">the BuddyPress codex</a> for more information."
2429
+ msgstr ""
2430
+
2431
+ #: bp-friends/bp-friends-actions.php:35
2432
+ msgid "Friendship could not be requested."
2433
+ msgstr ""
2434
+
2435
+ #: bp-friends/bp-friends-actions.php:37
2436
+ msgid "Friendship requested"
2437
+ msgstr ""
2438
+
2439
+ #: bp-friends/bp-friends-actions.php:41
2440
+ msgid "You are already friends with this user"
2441
+ msgstr ""
2442
+
2443
+ #: bp-friends/bp-friends-actions.php:43
2444
+ msgid "You already have a pending friendship request with this user"
2445
+ msgstr ""
2446
+
2447
+ #: bp-friends/bp-friends-actions.php:70
2448
+ #: bp-templates/bp-legacy/buddypress-functions.php:889
2449
+ #: bp-themes/bp-default/_inc/ajax.php:605
2450
+ msgid "Friendship could not be canceled."
2451
+ msgstr ""
2452
+
2453
+ #: bp-friends/bp-friends-actions.php:72
2454
+ msgid "Friendship canceled"
2455
+ msgstr ""
2456
+
2457
+ #: bp-friends/bp-friends-actions.php:76
2458
+ msgid "You are not yet friends with this user"
2459
+ msgstr ""
2460
+
2461
+ #: bp-friends/bp-friends-actions.php:78
2462
+ msgid "You have a pending friendship request with this user"
2463
+ msgstr ""
2464
+
2465
+ #: bp-friends/bp-friends-activity.php:57
2466
+ msgid "Friendships accepted"
2467
+ msgstr ""
2468
+
2469
+ #: bp-friends/bp-friends-activity.php:58
2470
+ msgid "New friendships"
2471
+ msgstr ""
2472
+
2473
+ #: bp-friends/bp-friends-activity.php:61
2474
+ msgid "New friendship created"
2475
+ msgstr ""
2476
+
2477
+ #: bp-friends/bp-friends-activity.php:86
2478
+ msgid "%d friends accepted your friendship requests"
2479
+ msgstr ""
2480
+
2481
+ #: bp-friends/bp-friends-activity.php:89
2482
+ #: bp-friends/bp-friends-notifications.php:68
2483
+ msgid "%s accepted your friendship request"
2484
+ msgstr ""
2485
+
2486
+ #: bp-friends/bp-friends-activity.php:100
2487
+ msgid "You have %d pending friendship requests"
2488
+ msgstr ""
2489
+
2490
+ #: bp-friends/bp-friends-activity.php:103
2491
+ msgid "You have a friendship request from %s"
2492
  msgstr ""
2493
 
2494
  #: bp-friends/bp-friends-functions.php:100
2504
  msgid "Friends <span>%d</span>"
2505
  msgstr ""
2506
 
2507
+ #: bp-friends/bp-friends-loader.php:118 bp-friends/bp-friends-loader.php:180
2508
+ #: bp-friends/bp-friends-loader.php:207
2509
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:100
2510
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:35
2511
  #: bp-themes/bp-default/activity/index.php:120
2512
  #: bp-themes/bp-default/members/single/activity.php:35
2513
  msgid "Friendships"
2514
  msgstr ""
2515
 
2516
+ #: bp-friends/bp-friends-loader.php:128 bp-groups/bp-groups-template.php:1458
2517
  msgid "Requests"
2518
  msgstr ""
2519
 
2520
+ #: bp-friends/bp-friends-loader.php:161
2521
  msgid "Friends <span class=\"count\">%s</span>"
2522
  msgstr ""
2523
 
2524
+ #: bp-friends/bp-friends-loader.php:162
2525
  msgid "Pending Requests <span class=\"count\">%s</span>"
2526
  msgstr ""
2527
 
2528
+ #: bp-friends/bp-friends-loader.php:165
2529
  msgid "No Pending Requests"
2530
  msgstr ""
2531
 
2532
+ #: bp-friends/bp-friends-notifications.php:31
2533
  msgid "New friendship request from %s"
2534
  msgstr ""
2535
 
2536
+ #: bp-friends/bp-friends-notifications.php:32
2537
  msgid ""
2538
  "%1$s wants to add you as a friend.\n"
2539
  "\n"
2544
  "---------------------\n"
2545
  msgstr ""
2546
 
2547
+ #: bp-friends/bp-friends-notifications.php:69
2548
  msgid ""
2549
  "%1$s accepted your friend request.\n"
2550
  "\n"
2585
  msgid "A member accepts your friendship request"
2586
  msgstr ""
2587
 
2588
+ #: bp-friends/bp-friends-template.php:69 bp-xprofile/bp-xprofile-loader.php:121
2589
  msgid "My Friends"
2590
  msgstr ""
2591
 
2622
  msgstr ""
2623
 
2624
  #: bp-friends/bp-friends-template.php:285
2625
+ #: bp-templates/bp-legacy/buddypress-functions.php:901
2626
  #: bp-themes/bp-default/_inc/ajax.php:617
2627
  msgid "Cancel Friendship Request"
2628
  msgstr ""
2638
 
2639
  #: bp-friends/bp-friends-template.php:319
2640
  #: bp-friends/bp-friends-template.php:320
2641
+ #: bp-templates/bp-legacy/buddypress-functions.php:891
2642
+ #: bp-templates/bp-legacy/buddypress-functions.php:909
2643
  #: bp-themes/bp-default/_inc/ajax.php:607
2644
  #: bp-themes/bp-default/_inc/ajax.php:625
2645
  msgid "Add Friend"
2665
  msgid "%1$s created the group %2$s"
2666
  msgstr ""
2667
 
2668
+ #: bp-groups/bp-groups-actions.php:197
2669
  msgid "There was an error saving the group avatar, please try uploading again."
2670
  msgstr ""
2671
 
2672
+ #: bp-groups/bp-groups-actions.php:199
2673
  msgid "The group avatar was uploaded successfully!"
2674
  msgstr ""
2675
 
2676
+ #: bp-groups/bp-groups-actions.php:223 bp-groups/bp-groups-actions.php:230
2677
  msgid "There was an error joining the group."
2678
  msgstr ""
2679
 
2680
+ #: bp-groups/bp-groups-actions.php:232
2681
  msgid "You joined the group!"
2682
  msgstr ""
2683
 
2684
+ #: bp-groups/bp-groups-actions.php:258 bp-groups/bp-groups-screens.php:709
2685
  msgid "This group must have at least one admin"
2686
  msgstr ""
2687
 
2688
+ #: bp-groups/bp-groups-actions.php:261
2689
  msgid "There was an error leaving the group."
2690
  msgstr ""
2691
 
2692
+ #: bp-groups/bp-groups-actions.php:263 bp-groups/bp-groups-functions.php:313
2693
  msgid "You successfully left the group."
2694
  msgstr ""
2695
 
2765
  msgid "You have an invitation to the group: %s"
2766
  msgstr ""
2767
 
2768
+ #: bp-groups/bp-groups-admin.php:109
2769
+ msgid "This page is a convenient way to edit the details associated with one of your groups."
 
 
 
 
2770
  msgstr ""
2771
 
2772
+ #: bp-groups/bp-groups-admin.php:110
2773
+ msgid "The Name and Description box is fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to hide or unhide, or to choose a 1- or 2-column layout for this screen."
2774
  msgstr ""
2775
 
2776
+ #: bp-groups/bp-groups-admin.php:116
2777
+ msgid "Support Forums"
2778
  msgstr ""
2779
 
2780
+ #: bp-groups/bp-groups-admin.php:120
2781
+ msgctxt "group admin edit screen"
2782
+ msgid "Save"
2783
  msgstr ""
2784
 
2785
+ #: bp-groups/bp-groups-admin.php:121
2786
+ msgctxt "group admin edit screen"
2787
+ msgid "Settings"
2788
  msgstr ""
2789
 
2790
+ #: bp-groups/bp-groups-admin.php:122
2791
+ msgctxt "group admin edit screen"
2792
+ msgid "Add New Members"
2793
  msgstr ""
2794
 
2795
+ #: bp-groups/bp-groups-admin.php:123
2796
+ msgctxt "group admin edit screen"
2797
+ msgid "Manage Members"
 
2798
  msgstr ""
2799
 
2800
+ #: bp-groups/bp-groups-admin.php:138
2801
+ msgctxt "Groups per page (screen options)"
2802
+ msgid "Groups"
2803
  msgstr ""
2804
 
2805
+ #: bp-groups/bp-groups-admin.php:145
2806
+ msgid "You can manage groups much like you can manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on groups by using the on-hover action links or the Bulk Actions."
2807
  msgstr ""
2808
 
2809
+ #: bp-groups/bp-groups-admin.php:150
2810
+ msgid "Group Actions"
 
2811
  msgstr ""
2812
 
2813
+ #: bp-groups/bp-groups-admin.php:152
2814
+ msgid "Clicking \"Visit\" will take you to the group&#8217;s public page. Use this link to see what the group looks like on the front end of your site."
2815
  msgstr ""
2816
 
2817
+ #: bp-groups/bp-groups-admin.php:153
2818
+ msgid "Clicking \"Edit\" will take you to a Dashboard panel where you can manage various details about the group, such as its name and description, its members, and other settings."
2819
  msgstr ""
2820
 
2821
+ #: bp-groups/bp-groups-admin.php:154
2822
+ msgid "If you click \"Delete\" under a specific group, or select a number of groups and then choose Delete from the Bulk Actions menu, you will be led to a page where you&#8217;ll be asked to confirm the permanent deletion of the group(s)."
2823
  msgstr ""
2824
 
2825
+ #: bp-groups/bp-groups-admin.php:169
2826
+ msgid "Start typing a username to add a new member."
2827
  msgstr ""
2828
 
2829
+ #: bp-groups/bp-groups-admin.php:440
2830
+ msgid "You cannot remove all administrators from a group."
2831
  msgstr ""
2832
 
2833
+ #: bp-groups/bp-groups-admin.php:444
2834
+ msgid "An error occurred when trying to update your group details."
 
2835
  msgstr ""
2836
 
2837
+ #: bp-groups/bp-groups-admin.php:446
2838
+ msgid "The group has been updated successfully."
2839
  msgstr ""
2840
 
2841
+ #: bp-groups/bp-groups-admin.php:450
2842
+ msgid "The following users could not be added to the group: <em>%s</em>"
2843
  msgstr ""
2844
 
2845
+ #: bp-groups/bp-groups-admin.php:454
2846
+ msgid "The following users were successfully added to the group: <em>%s</em>"
2847
  msgstr ""
2848
 
2849
+ #: bp-groups/bp-groups-admin.php:459
2850
+ msgid "An error occurred when trying to modify the following members: <em>%s</em>"
2851
  msgstr ""
2852
 
2853
+ #: bp-groups/bp-groups-admin.php:464
2854
+ msgid "The following members were successfully modified: <em>%s</em>"
2855
  msgstr ""
2856
 
2857
+ #: bp-groups/bp-groups-admin.php:483 bp-groups/bp-groups-adminbar.php:40
2858
+ #: bp-xprofile/bp-xprofile-admin.php:114
2859
+ msgid "Edit Group"
2860
  msgstr ""
2861
 
2862
+ #: bp-groups/bp-groups-admin.php:486
2863
+ msgid "Add New"
2864
  msgstr ""
2865
 
2866
+ #: bp-groups/bp-groups-admin.php:505
2867
+ msgid "Name and Description"
2868
  msgstr ""
2869
 
2870
+ #: bp-groups/bp-groups-admin.php:532
2871
+ msgid "No group found with this ID. <a href=\"%s\">Go back and try again</a>."
 
2872
  msgstr ""
2873
 
2874
+ #: bp-groups/bp-groups-admin.php:570
2875
+ msgid "Delete Groups"
2876
  msgstr ""
2877
 
2878
+ #: bp-groups/bp-groups-admin.php:571
2879
+ msgid "You are about to delete the following groups:"
 
2880
  msgstr ""
2881
 
2882
+ #: bp-groups/bp-groups-admin.php:579
2883
+ msgid "This action cannot be undone."
 
2884
  msgstr ""
2885
 
2886
+ #: bp-groups/bp-groups-admin.php:606
2887
+ msgid "%s group has been permanently deleted."
2888
+ msgid_plural "%s groups have been permanently deleted."
2889
+ msgstr[0] ""
2890
+ msgstr[1] ""
2891
 
2892
+ #: bp-groups/bp-groups-admin.php:635
2893
+ msgid "Search all Groups"
2894
  msgstr ""
2895
 
2896
+ #: bp-groups/bp-groups-admin.php:657
2897
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:112
2898
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:47
2899
+ #: bp-themes/bp-default/groups/create.php:119
2900
+ #: bp-themes/bp-default/groups/single/admin.php:47
2901
+ msgid "Enable discussion forum"
2902
  msgstr ""
2903
 
2904
+ #: bp-groups/bp-groups-admin.php:662
2905
+ msgid "Privacy"
2906
  msgstr ""
2907
 
2908
+ #: bp-groups/bp-groups-admin.php:665 bp-groups/bp-groups-admin.php:1292
2909
+ #: bp-groups/bp-groups-template.php:625
2910
+ msgid "Public"
2911
  msgstr ""
2912
 
2913
+ #: bp-groups/bp-groups-admin.php:666 bp-groups/bp-groups-admin.php:1295
2914
+ #: bp-groups/bp-groups-template.php:627
2915
+ msgid "Private"
2916
  msgstr ""
2917
 
2918
+ #: bp-groups/bp-groups-admin.php:667 bp-groups/bp-groups-admin.php:1298
2919
+ msgid "Hidden"
2920
  msgstr ""
2921
 
2922
+ #: bp-groups/bp-groups-admin.php:671
2923
+ msgid "Who can invite others to this group?"
2924
  msgstr ""
2925
 
2926
+ #: bp-groups/bp-groups-admin.php:674
2927
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:89
2928
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:99
2929
+ #: bp-themes/bp-default/groups/create.php:96
2930
+ #: bp-themes/bp-default/groups/single/admin.php:99
2931
+ msgid "All group members"
 
2932
  msgstr ""
2933
 
2934
+ #: bp-groups/bp-groups-admin.php:675
2935
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:94
2936
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:104
2937
+ #: bp-themes/bp-default/groups/create.php:101
2938
+ #: bp-themes/bp-default/groups/single/admin.php:104
2939
+ msgid "Group admins and mods only"
2940
  msgstr ""
2941
 
2942
+ #: bp-groups/bp-groups-admin.php:676
2943
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:99
2944
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:109
2945
+ #: bp-themes/bp-default/groups/create.php:106
2946
+ #: bp-themes/bp-default/groups/single/admin.php:109
2947
+ msgid "Group admins only"
 
 
 
 
 
 
2948
  msgstr ""
2949
 
2950
+ #: bp-groups/bp-groups-admin.php:691
2951
+ msgid "Enter a comma-separated list of user logins."
2952
  msgstr ""
2953
 
2954
+ #: bp-groups/bp-groups-admin.php:759
2955
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:177
2956
+ #: bp-themes/bp-default/groups/single/admin.php:177
2957
+ msgid "Administrators"
 
 
 
2958
  msgstr ""
2959
 
2960
+ #: bp-groups/bp-groups-admin.php:760
2961
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:205
2962
+ #: bp-themes/bp-default/groups/single/admin.php:205
2963
+ msgid "Moderators"
2964
  msgstr ""
2965
 
2966
+ #: bp-groups/bp-groups-admin.php:762
2967
+ msgid "Banned Users"
 
 
 
 
 
2968
  msgstr ""
2969
 
2970
+ #: bp-groups/bp-groups-admin.php:771
2971
+ msgctxt "Group member user_id in group admin"
2972
+ msgid "ID"
2973
  msgstr ""
2974
 
2975
+ #: bp-groups/bp-groups-admin.php:772
2976
+ msgctxt "Group member name in group admin"
2977
+ msgid "Name"
2978
  msgstr ""
2979
 
2980
+ #: bp-groups/bp-groups-admin.php:773
2981
+ msgctxt "Group member role in group admin"
2982
+ msgid "Group Role"
2983
  msgstr ""
2984
 
2985
+ #: bp-groups/bp-groups-admin.php:796
2986
+ msgid "Administrator"
 
 
 
 
 
2987
  msgstr ""
2988
 
2989
+ #: bp-groups/bp-groups-admin.php:797
2990
+ msgid "Moderator"
2991
  msgstr ""
2992
 
2993
+ #: bp-groups/bp-groups-admin.php:798
2994
+ msgid "Member"
 
 
 
 
 
 
 
 
 
2995
  msgstr ""
2996
 
2997
+ #: bp-groups/bp-groups-admin.php:799
2998
+ msgid "Banned"
2999
  msgstr ""
3000
 
3001
+ #: bp-groups/bp-groups-admin.php:800
3002
+ msgid "Remove From Group"
3003
  msgstr ""
3004
 
3005
+ #: bp-groups/bp-groups-admin.php:821
3006
+ msgid "No members of this type"
3007
  msgstr ""
3008
 
3009
+ #: bp-groups/bp-groups-admin.php:846 bp-groups/bp-groups-adminbar.php:102
3010
+ #: bp-groups/bp-groups-buddybar.php:58
3011
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:360
3012
+ #: bp-themes/bp-default/groups/single/admin.php:360
3013
+ #: bp-xprofile/bp-xprofile-admin.php:118
3014
+ msgid "Delete Group"
3015
  msgstr ""
3016
 
3017
+ #: bp-groups/bp-groups-admin.php:850
3018
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:32
3019
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:117
3020
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:58
3021
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:74
3022
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:148
3023
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:30
3024
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:19
3025
+ #: bp-themes/bp-default/groups/single/admin.php:32
3026
+ #: bp-themes/bp-default/groups/single/admin.php:117
3027
+ #: bp-themes/bp-default/groups/single/forum/edit.php:58
3028
+ #: bp-themes/bp-default/groups/single/forum/edit.php:74
3029
+ #: bp-themes/bp-default/members/single/profile/edit.php:148
3030
+ #: bp-themes/bp-default/members/single/settings/general.php:72
3031
+ #: bp-themes/bp-default/members/single/settings/notifications.php:61
3032
+ #: bp-xprofile/bp-xprofile-classes.php:360
3033
+ msgid "Save Changes"
3034
+ msgstr ""
3035
+
3036
+ #. translators: 1: user_login, 2: user_email
3037
+
3038
+ #: bp-groups/bp-groups-admin.php:903
3039
+ msgid "%1$s (%2$s)"
3040
+ msgstr ""
3041
+
3042
+ #: bp-groups/bp-groups-admin.php:1072
3043
+ msgid "No groups found."
3044
+ msgstr ""
3045
+
3046
+ #: bp-groups/bp-groups-admin.php:1136
3047
+ msgid "Public <span class=\"count\">(%s)</span>"
3048
+ msgstr ""
3049
+
3050
+ #: bp-groups/bp-groups-admin.php:1137
3051
+ msgid "Private <span class=\"count\">(%s)</span>"
3052
+ msgstr ""
3053
+
3054
+ #: bp-groups/bp-groups-admin.php:1138
3055
+ msgid "Hidden <span class=\"count\">(%s)</span>"
3056
+ msgstr ""
3057
+
3058
+ #: bp-groups/bp-groups-admin.php:1167
3059
+ msgctxt "Groups admin Group Name column header"
3060
+ msgid "Name"
3061
+ msgstr ""
3062
+
3063
+ #: bp-groups/bp-groups-admin.php:1168
3064
+ msgctxt "Groups admin Group Description column header"
3065
+ msgid "Description"
3066
+ msgstr ""
3067
+
3068
+ #: bp-groups/bp-groups-admin.php:1169
3069
+ msgctxt "Groups admin Privacy Status column header"
3070
+ msgid "Status"
3071
+ msgstr ""
3072
+
3073
+ #: bp-groups/bp-groups-admin.php:1170
3074
+ msgctxt "Groups admin Members column header"
3075
+ msgid "# Members"
3076
+ msgstr ""
3077
+
3078
+ #: bp-groups/bp-groups-admin.php:1171
3079
+ msgctxt "Groups admin Last Active column header"
3080
+ msgid "Last Active"
3081
+ msgstr ""
3082
+
3083
+ #: bp-groups/bp-groups-adminbar.php:48 bp-groups/bp-groups-buddybar.php:34
3084
+ msgid "Edit Details"
3085
+ msgstr ""
3086
+
3087
+ #: bp-groups/bp-groups-adminbar.php:56
3088
+ msgid "Edit Settings"
3089
+ msgstr ""
3090
+
3091
+ #: bp-groups/bp-groups-adminbar.php:65 bp-members/bp-members-adminbar.php:107
3092
+ msgid "Edit Avatar"
3093
+ msgstr ""
3094
+
3095
+ #: bp-groups/bp-groups-adminbar.php:75 bp-groups/bp-groups-buddybar.php:46
3096
+ msgid "Manage Invitations"
3097
+ msgstr ""
3098
+
3099
+ #: bp-groups/bp-groups-adminbar.php:84 bp-groups/bp-groups-buddybar.php:50
3100
+ msgid "Manage Members"
3101
+ msgstr ""
3102
+
3103
+ #: bp-groups/bp-groups-adminbar.php:93 bp-groups/bp-groups-buddybar.php:54
3104
+ msgid "Membership Requests"
3105
+ msgstr ""
3106
+
3107
+ #: bp-groups/bp-groups-buddybar.php:31 bp-members/bp-members-buddybar.php:120
3108
+ msgid "Admin Options"
3109
+ msgstr ""
3110
+
3111
+ #: bp-groups/bp-groups-buddybar.php:36
3112
+ msgid "Group Settings"
3113
+ msgstr ""
3114
+
3115
+ #: bp-groups/bp-groups-buddybar.php:40 bp-groups/bp-groups-loader.php:585
3116
+ #: bp-groups/bp-groups-template.php:2586
3117
+ msgid "Group Avatar"
3118
+ msgstr ""
3119
+
3120
+ #: bp-groups/bp-groups-classes.php:878
3121
+ msgid "Group Mod"
3122
+ msgstr ""
3123
+
3124
+ #: bp-groups/bp-groups-classes.php:884 bp-groups/bp-groups-functions.php:121
3125
+ msgid "Group Admin"
3126
+ msgstr ""
3127
+
3128
+ #: bp-groups/bp-groups-forums.php:104 bp-groups/bp-groups-forums.php:253
3129
+ msgid "%1$s replied to the forum topic %2$s in the group %3$s"
3130
+ msgstr ""
3131
+
3132
+ #: bp-groups/bp-groups-forums.php:154
3133
+ msgid "%1$s started the forum topic %2$s in the group %3$s"
3134
+ msgstr ""
3135
+
3136
+ #: bp-groups/bp-groups-forums.php:206
3137
+ msgid "%1$s edited the forum topic %2$s in the group %3$s"
3138
+ msgstr ""
3139
+
3140
+ #: bp-groups/bp-groups-functions.php:288
3141
+ msgid "As the only Admin, you cannot leave the group."
3142
+ msgstr ""
3143
+
3144
+ #: bp-groups/bp-groups-functions.php:357 bp-groups/bp-groups-functions.php:878
3145
+ #: bp-groups/bp-groups-screens.php:62
3146
+ msgid "%1$s joined the group %2$s"
3147
+ msgstr ""
3148
+
3149
+ #: bp-groups/bp-groups-functions.php:568
3150
+ msgid "%1$s posted an update in the group %2$s"
3151
+ msgstr ""
3152
+
3153
+ #: bp-groups/bp-groups-loader.php:144
3154
+ msgid "Search Groups..."
3155
+ msgstr ""
3156
+
3157
+ #: bp-groups/bp-groups-loader.php:273
3158
+ msgid "You do not have access to this group."
3159
+ msgstr ""
3160
+
3161
+ #: bp-groups/bp-groups-loader.php:288
3162
+ msgid "You are not an admin of this group."
3163
+ msgstr ""
3164
+
3165
+ #: bp-groups/bp-groups-loader.php:298 bp-groups/bp-groups-template.php:1439
3166
+ msgid "Details"
3167
+ msgstr ""
3168
+
3169
+ #: bp-groups/bp-groups-loader.php:310 bp-groups/bp-groups-template.php:1450
3170
+ msgid "Avatar"
3171
+ msgstr ""
3172
+
3173
+ #: bp-groups/bp-groups-loader.php:318
3174
+ msgid "Invites"
3175
+ msgstr ""
3176
+
3177
+ #: bp-groups/bp-groups-loader.php:346
3178
+ msgid "Groups <span>%d</span>"
3179
+ msgstr ""
3180
+
3181
+ #: bp-groups/bp-groups-loader.php:368 bp-groups/bp-groups-loader.php:398
3182
+ #: bp-groups/bp-groups-loader.php:537 bp-groups/bp-groups-loader.php:565
3183
+ msgid "Memberships"
3184
+ msgstr ""
3185
+
3186
+ #: bp-groups/bp-groups-loader.php:379
3187
+ msgid "Invitations"
3188
+ msgstr ""
3189
+
3190
+ #: bp-groups/bp-groups-loader.php:410
3191
+ msgctxt "Group home navigation title"
3192
+ msgid "Home"
3193
+ msgstr ""
3194
+
3195
+ #: bp-groups/bp-groups-loader.php:427 bp-groups/bp-groups-template.php:1771
3196
+ #: bp-groups/bp-groups-template.php:1772
3197
+ #: bp-templates/bp-legacy/buddypress-functions.php:1008
3198
+ #: bp-themes/bp-default/_inc/ajax.php:724
3199
+ msgid "Request Membership"
3200
+ msgstr ""
3201
+
3202
+ #: bp-groups/bp-groups-loader.php:439
3203
+ msgid "Forum"
3204
+ msgstr ""
3205
+
3206
+ #: bp-groups/bp-groups-loader.php:451
3207
+ msgid "Members <span>%s</span>"
3208
+ msgstr ""
3209
+
3210
+ #: bp-groups/bp-groups-loader.php:463
3211
+ #: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:60
3212
+ #: bp-themes/bp-default/groups/single/send-invites.php:60
3213
+ msgid "Send Invites"
3214
+ msgstr ""
3215
+
3216
+ #: bp-groups/bp-groups-loader.php:477
3217
+ msgid "Admin"
3218
+ msgstr ""
3219
+
3220
+ #: bp-groups/bp-groups-loader.php:518
3221
+ msgid "No Pending Invites"
3222
+ msgstr ""
3223
+
3224
+ #: bp-groups/bp-groups-loader.php:521
3225
+ msgid "Groups <span class=\"count\">%s</span>"
3226
+ msgstr ""
3227
+
3228
+ #: bp-groups/bp-groups-loader.php:522
3229
+ msgid "Pending Invites <span class=\"count\">%s</span>"
3230
+ msgstr ""
3231
+
3232
+ #: bp-groups/bp-groups-notifications.php:19
3233
+ msgid "Group Details Updated"
3234
+ msgstr ""
3235
+
3236
+ #: bp-groups/bp-groups-notifications.php:34
3237
+ msgid ""
3238
+ "Group details for the group \"%1$s\" were updated:\n"
3239
+ "\n"
3240
+ "To view the group: %2$s\n"
3241
+ "\n"
3242
+ "---------------------\n"
3243
+ msgstr ""
3244
+
3245
+ #: bp-groups/bp-groups-notifications.php:75
3246
+ msgid "Membership request for group: %s"
3247
+ msgstr ""
3248
+
3249
+ #: bp-groups/bp-groups-notifications.php:77
3250
+ msgid ""
3251
+ "%1$s wants to join the group \"%2$s\".\n"
3252
+ "\n"
3253
+ "Because you are the administrator of this group, you must either accept or reject the membership request.\n"
3254
+ "\n"
3255
+ "To view all pending membership requests for this group, please visit:\n"
3256
+ "%3$s\n"
3257
+ "\n"
3258
+ "To view %4$s's profile: %5$s\n"
3259
+ "\n"
3260
+ "---------------------\n"
3261
+ msgstr ""
3262
+
3263
+ #: bp-groups/bp-groups-notifications.php:125
3264
+ msgid "Membership request for group \"%s\" accepted"
3265
+ msgstr ""
3266
+
3267
+ #: bp-groups/bp-groups-notifications.php:126
3268
+ msgid ""
3269
+ "Your membership request for the group \"%1$s\" has been accepted.\n"
3270
+ "\n"
3271
+ "To view the group please login and visit: %2$s\n"
3272
+ "\n"
3273
+ "---------------------\n"
3274
+ msgstr ""
3275
+
3276
+ #: bp-groups/bp-groups-notifications.php:135
3277
+ msgid "Membership request for group \"%s\" rejected"
3278
+ msgstr ""
3279
+
3280
+ #: bp-groups/bp-groups-notifications.php:136
3281
+ msgid ""
3282
+ "Your membership request for the group \"%1$s\" has been rejected.\n"
3283
+ "\n"
3284
+ "To submit another request please log in and visit: %2$s\n"
3285
+ "\n"
3286
+ "---------------------\n"
3287
+ msgstr ""
3288
+
3289
+ #: bp-groups/bp-groups-notifications.php:160
3290
+ msgid "an administrator"
3291
+ msgstr ""
3292
+
3293
+ #: bp-groups/bp-groups-notifications.php:163
3294
+ msgid "a moderator"
3295
+ msgstr ""
3296
+
3297
+ #: bp-groups/bp-groups-notifications.php:181
3298
+ msgid "You have been promoted in the group: \"%s\""
3299
+ msgstr ""
3300
+
3301
+ #: bp-groups/bp-groups-notifications.php:182
3302
+ msgid ""
3303
+ "You have been promoted to %1$s for the group: \"%2$s\".\n"
3304
+ "\n"
3305
+ "To view the group please visit: %3$s\n"
3306
+ "\n"
3307
+ "---------------------\n"
3308
+ msgstr ""
3309
+
3310
+ #: bp-groups/bp-groups-notifications.php:229
3311
+ msgid "You have an invitation to the group: \"%s\""
3312
+ msgstr ""
3313
+
3314
+ #: bp-groups/bp-groups-notifications.php:231
3315
+ msgid ""
3316
+ "One of your friends %1$s has invited you to the group: \"%2$s\".\n"
3317
+ "\n"
3318
+ "To view your group invites visit: %3$s\n"
3319
+ "\n"
3320
+ "To view the group visit: %4$s\n"
3321
+ "\n"
3322
+ "To view %5$s's profile visit: %6$s\n"
3323
+ "\n"
3324
+ "---------------------\n"
3325
+ msgstr ""
3326
+
3327
+ #: bp-groups/bp-groups-screens.php:54
3328
+ msgid "Group invite could not be accepted"
3329
+ msgstr ""
3330
+
3331
+ #: bp-groups/bp-groups-screens.php:56
3332
+ msgid "Group invite accepted"
3333
+ msgstr ""
3334
+
3335
+ #: bp-groups/bp-groups-screens.php:76
3336
+ msgid "Group invite could not be rejected"
3337
  msgstr ""
3338
 
3339
+ #: bp-groups/bp-groups-screens.php:78
3340
+ msgid "Group invite rejected"
3341
+ msgstr ""
3342
+
3343
+ #: bp-groups/bp-groups-screens.php:161
3344
+ msgid "It looks like you've already said that!"
3345
+ msgstr ""
3346
+
3347
+ #: bp-groups/bp-groups-screens.php:164
3348
  msgid "There was an error when replying to that topic"
3349
  msgstr ""
3350
 
3351
+ #: bp-groups/bp-groups-screens.php:166
3352
  msgid "Your reply was posted successfully"
3353
  msgstr ""
3354
 
3355
+ #: bp-groups/bp-groups-screens.php:187
3356
  msgid "There was an error when making that topic a sticky"
3357
  msgstr ""
3358
 
3359
+ #: bp-groups/bp-groups-screens.php:189
3360
  msgid "The topic was made sticky successfully"
3361
  msgstr ""
3362
 
3363
+ #: bp-groups/bp-groups-screens.php:202
3364
  msgid "There was an error when unsticking that topic"
3365
  msgstr ""
3366
 
3367
+ #: bp-groups/bp-groups-screens.php:204
3368
  msgid "The topic was unstuck successfully"
3369
  msgstr ""
3370
 
3371
+ #: bp-groups/bp-groups-screens.php:217
3372
  msgid "There was an error when closing that topic"
3373
  msgstr ""
3374
 
3375
+ #: bp-groups/bp-groups-screens.php:219
3376
  msgid "The topic was closed successfully"
3377
  msgstr ""
3378
 
3379
+ #: bp-groups/bp-groups-screens.php:232
3380
  msgid "There was an error when opening that topic"
3381
  msgstr ""
3382
 
3383
+ #: bp-groups/bp-groups-screens.php:234
3384
  msgid "The topic was opened successfully"
3385
  msgstr ""
3386
 
3387
+ #: bp-groups/bp-groups-screens.php:257
3388
  msgid "There was an error deleting the topic"
3389
  msgstr ""
3390
 
3391
+ #: bp-groups/bp-groups-screens.php:259
3392
  msgid "The topic was deleted successfully"
3393
  msgstr ""
3394
 
3395
+ #: bp-groups/bp-groups-screens.php:283
3396
  msgid "There was an error when editing that topic"
3397
  msgstr ""
3398
 
3399
+ #: bp-groups/bp-groups-screens.php:285
3400
  msgid "The topic was edited successfully"
3401
  msgstr ""
3402
 
3403
+ #: bp-groups/bp-groups-screens.php:310
3404
  msgid "There was an error deleting that post"
3405
  msgstr ""
3406
 
3407
+ #: bp-groups/bp-groups-screens.php:312
3408
  msgid "The post was deleted successfully"
3409
  msgstr ""
3410
 
3411
+ #: bp-groups/bp-groups-screens.php:336
3412
  msgid "There was an error when editing that post"
3413
  msgstr ""
3414
 
3415
+ #: bp-groups/bp-groups-screens.php:338
3416
  msgid "The post was edited successfully"
3417
  msgstr ""
3418
 
3419
+ #: bp-groups/bp-groups-screens.php:354 bp-groups/bp-groups-screens.php:373
3420
  msgid "You have been banned from this group."
3421
  msgstr ""
3422
 
3423
+ #: bp-groups/bp-groups-screens.php:387
3424
  msgid "This group does not have a forum setup yet."
3425
  msgstr ""
3426
 
3427
+ #: bp-groups/bp-groups-screens.php:446
3428
  msgid "Group invites sent."
3429
  msgstr ""
3430
 
3431
+ #: bp-groups/bp-groups-screens.php:478
3432
  msgid "There was an error sending your group membership request, please try again."
3433
  msgstr ""
3434
 
3435
+ #: bp-groups/bp-groups-screens.php:480
3436
  msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request."
3437
  msgstr ""
3438
 
3439
+ #: bp-groups/bp-groups-screens.php:527
3440
  msgid "There was an error updating group details, please try again."
3441
  msgstr ""
3442
 
3443
+ #: bp-groups/bp-groups-screens.php:529
3444
  msgid "Group details were successfully updated."
3445
  msgstr ""
3446
 
3447
+ #: bp-groups/bp-groups-screens.php:571
3448
  msgid "There was an error updating group settings, please try again."
3449
  msgstr ""
3450
 
3451
+ #: bp-groups/bp-groups-screens.php:573
3452
  msgid "Group settings were successfully updated."
3453
  msgstr ""
3454
 
3455
+ #: bp-groups/bp-groups-screens.php:605 bp-xprofile/bp-xprofile-actions.php:39
3456
  msgid "Your avatar was deleted successfully!"
3457
  msgstr ""
3458
 
3459
+ #: bp-groups/bp-groups-screens.php:607 bp-xprofile/bp-xprofile-actions.php:41
3460
  msgid "There was a problem deleting that avatar, please try again."
3461
  msgstr ""
3462
 
3463
+ #: bp-groups/bp-groups-screens.php:650
3464
+ msgid "There was a problem cropping the avatar."
3465
  msgstr ""
3466
 
3467
+ #: bp-groups/bp-groups-screens.php:652
3468
+ msgid "The new group avatar was uploaded successfully."
3469
  msgstr ""
3470
 
3471
+ #: bp-groups/bp-groups-screens.php:688
3472
  msgid "There was an error when promoting that user, please try again"
3473
  msgstr ""
3474
 
3475
+ #: bp-groups/bp-groups-screens.php:690
3476
  msgid "User promoted successfully"
3477
  msgstr ""
3478
 
3479
+ #: bp-groups/bp-groups-screens.php:713
3480
  msgid "There was an error when demoting that user, please try again"
3481
  msgstr ""
3482
 
3483
+ #: bp-groups/bp-groups-screens.php:715
3484
  msgid "User demoted successfully"
3485
  msgstr ""
3486
 
3487
+ #: bp-groups/bp-groups-screens.php:731
3488
  msgid "There was an error when banning that user, please try again"
3489
  msgstr ""
3490
 
3491
+ #: bp-groups/bp-groups-screens.php:733
3492
  msgid "User banned successfully"
3493
  msgstr ""
3494
 
3495
+ #: bp-groups/bp-groups-screens.php:749
3496
  msgid "There was an error when unbanning that user, please try again"
3497
  msgstr ""
3498
 
3499
+ #: bp-groups/bp-groups-screens.php:751
3500
  msgid "User ban removed successfully"
3501
  msgstr ""
3502
 
3503
+ #: bp-groups/bp-groups-screens.php:767
3504
  msgid "There was an error removing that user from the group, please try again"
3505
  msgstr ""
3506
 
3507
+ #: bp-groups/bp-groups-screens.php:769
3508
  msgid "User removed successfully"
3509
  msgstr ""
3510
 
3511
+ #: bp-groups/bp-groups-screens.php:807
3512
  msgid "There was an error accepting the membership request, please try again."
3513
  msgstr ""
3514
 
3515
+ #: bp-groups/bp-groups-screens.php:809
3516
  msgid "Group membership request accepted"
3517
  msgstr ""
3518
 
3519
+ #: bp-groups/bp-groups-screens.php:818
3520
  msgid "There was an error rejecting the membership request, please try again."
3521
  msgstr ""
3522
 
3523
+ #: bp-groups/bp-groups-screens.php:820
3524
  msgid "Group membership request rejected"
3525
  msgstr ""
3526
 
3527
+ #: bp-groups/bp-groups-screens.php:852
3528
  msgid "There was an error deleting the group, please try again."
3529
  msgstr ""
3530
 
3531
+ #: bp-groups/bp-groups-screens.php:854
3532
  msgid "The group was deleted successfully"
3533
  msgstr ""
3534
 
3535
+ #: bp-groups/bp-groups-screens.php:902
3536
  msgid "A member invites you to join a group"
3537
  msgstr ""
3538
 
3539
+ #: bp-groups/bp-groups-screens.php:908
3540
  msgid "Group information is updated"
3541
  msgstr ""
3542
 
3543
+ #: bp-groups/bp-groups-screens.php:914
3544
  msgid "You are promoted to a group administrator or moderator"
3545
  msgstr ""
3546
 
3547
+ #: bp-groups/bp-groups-screens.php:920
3548
  msgid "A member requests to join a private group for which you are an admin"
3549
  msgstr ""
3550
 
3551
+ #: bp-groups/bp-groups-template.php:214
3552
  msgctxt "Group pagination previous text"
3553
  msgid "&larr;"
3554
  msgstr ""
3555
 
3556
+ #: bp-groups/bp-groups-template.php:215
3557
  msgctxt "Group pagination next text"
3558
  msgid "&rarr;"
3559
  msgstr ""
3560
 
3561
+ #: bp-groups/bp-groups-template.php:458
3562
  msgid "Public Group"
3563
  msgstr ""
3564
 
3565
+ #: bp-groups/bp-groups-template.php:460
3566
  msgid "Hidden Group"
3567
  msgstr ""
3568
 
3569
+ #: bp-groups/bp-groups-template.php:462
3570
  msgid "Private Group"
3571
  msgstr ""
3572
 
3573
+ #: bp-groups/bp-groups-template.php:464
3574
  msgid "Group"
3575
  msgstr ""
3576
 
3577
+ #: bp-groups/bp-groups-template.php:536
3578
  msgid "not yet active"
3579
  msgstr ""
3580
 
3581
+ #: bp-groups/bp-groups-template.php:718
3582
+ msgid "Group creator avatar of %s"
3583
  msgstr ""
3584
 
3585
+ #: bp-groups/bp-groups-template.php:753
3586
  msgid "No Admins"
3587
  msgstr ""
3588
 
3589
+ #: bp-groups/bp-groups-template.php:780
3590
  msgid "No Mods"
3591
  msgstr ""
3592
 
3593
+ #: bp-groups/bp-groups-template.php:862
3594
  msgid "Filter Groups"
3595
  msgstr ""
3596
 
3597
+ #: bp-groups/bp-groups-template.php:910
3598
  msgid "Viewing group %1$s to %2$s (of %3$s groups)"
3599
  msgstr ""
3600
 
3601
+ #: bp-groups/bp-groups-template.php:938
3602
  msgid "%s member"
3603
  msgstr ""
3604
 
3605
+ #: bp-groups/bp-groups-template.php:940
3606
+ #: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:14
3607
  #: bp-themes/bp-default/members/single/groups/invites.php:14
3608
  msgid "%s members"
3609
  msgstr ""
3610
 
3611
+ #: bp-groups/bp-groups-template.php:979
3612
  msgid "%d topic"
3613
  msgstr ""
3614
 
3615
+ #: bp-groups/bp-groups-template.php:981
3616
  msgid "%d topics"
3617
  msgstr ""
3618
 
3619
+ #: bp-groups/bp-groups-template.php:1207 bp-groups/bp-groups-template.php:1272
3620
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:190
3621
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:217
3622
  #: bp-themes/bp-default/groups/single/admin.php:190
3623
  #: bp-themes/bp-default/groups/single/admin.php:217
3624
  msgid "Demote to Member"
3625
  msgstr ""
3626
 
3627
+ #: bp-groups/bp-groups-template.php:1220 bp-groups/bp-groups-template.php:1285
3628
+ #: bp-groups/bp-groups-template.php:2085
3629
  msgid "joined %s"
3630
  msgstr ""
3631
 
3632
+ #: bp-groups/bp-groups-template.php:1243
3633
  msgid "This group has no administrators"
3634
  msgstr ""
3635
 
3636
+ #: bp-groups/bp-groups-template.php:1271
3637
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:216
3638
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:272
3639
  #: bp-themes/bp-default/groups/single/admin.php:216
3640
  #: bp-themes/bp-default/groups/single/admin.php:272
3641
  msgid "Promote to Admin"
3642
  msgstr ""
3643
 
3644
+ #: bp-groups/bp-groups-template.php:1305
3645
  msgid "This group has no moderators"
3646
  msgstr ""
3647
 
3648
+ #: bp-groups/bp-groups-template.php:1730 bp-groups/bp-groups-template.php:1731
3649
+ #: bp-templates/bp-legacy/buddypress-functions.php:987
 
 
 
 
 
3650
  #: bp-themes/bp-default/_inc/ajax.php:703
3651
  msgid "Leave Group"
3652
  msgstr ""
3653
 
3654
+ #: bp-groups/bp-groups-template.php:1753 bp-groups/bp-groups-template.php:1754
3655
+ #: bp-templates/bp-legacy/buddypress-functions.php:1006
3656
  #: bp-themes/bp-default/_inc/ajax.php:722
3657
  msgid "Join Group"
3658
  msgstr ""
3659
 
3660
+ #: bp-groups/bp-groups-template.php:1786 bp-groups/bp-groups-template.php:1787
3661
  msgid "Request Sent"
3662
  msgstr ""
3663
 
3664
+ #: bp-groups/bp-groups-template.php:1817
3665
  msgid "This is a private group and you must request group membership in order to join."
3666
  msgstr ""
3667
 
3668
+ #: bp-groups/bp-groups-template.php:1819
3669
  msgid "This is a private group. To join you must be a registered site member and request group membership."
3670
  msgstr ""
3671
 
3672
+ #: bp-groups/bp-groups-template.php:1822
3673
  msgid "This is a private group. Your membership request is awaiting approval from the group administrator."
3674
  msgstr ""
3675
 
3676
+ #: bp-groups/bp-groups-template.php:1826
3677
  msgid "This is a hidden group and only invited members can join."
3678
  msgstr ""
3679
 
3680
+ #: bp-groups/bp-groups-template.php:2133
3681
  msgid "Viewing members %1$s to %2$s (of %3$s members)"
3682
  msgstr ""
3683
 
3684
+ #: bp-groups/bp-groups-template.php:2359
3685
  msgid "Group avatar"
3686
  msgstr ""
3687
 
3688
+ #: bp-groups/bp-groups-template.php:2499 bp-groups/bp-groups-template.php:2523
3689
  msgid "Recently Joined"
3690
  msgstr ""
3691
 
3692
+ #: bp-groups/bp-groups-template.php:2500 bp-groups/bp-groups-template.php:2526
3693
  msgid "Most Popular"
3694
  msgstr ""
3695
 
3696
+ #: bp-groups/bp-groups-template.php:2501 bp-groups/bp-groups-template.php:2529
3697
  msgid "Administrator Of"
3698
  msgstr ""
3699
 
3700
+ #: bp-groups/bp-groups-template.php:2502 bp-groups/bp-groups-template.php:2532
3701
  msgid "Moderator Of"
3702
  msgstr ""
3703
 
3704
+ #: bp-groups/bp-groups-template.php:2590
3705
  msgid "No Group Avatar"
3706
  msgstr ""
3707
 
3708
+ #: bp-groups/bp-groups-template.php:2791
3709
  msgid "requested %s"
3710
  msgstr ""
3711
 
3712
+ #: bp-groups/bp-groups-template.php:2966
3713
  msgid "Group Activity RSS Feed"
3714
  msgstr ""
3715
 
3716
+ #: bp-groups/bp-groups-widgets.php:28
3717
  msgid "A dynamic list of recently active, popular, and newest groups"
3718
  msgstr ""
3719
 
3720
+ #: bp-groups/bp-groups-widgets.php:31
3721
+ msgctxt "widget name"
3722
+ msgid "(BuddyPress) Groups"
3723
+ msgstr ""
3724
+
3725
+ #: bp-groups/bp-groups-widgets.php:76 bp-groups/bp-groups-widgets.php:179
3726
  msgid "created %s"
3727
  msgstr ""
3728
 
3729
+ #: bp-groups/bp-groups-widgets.php:95
3730
  msgid "There are no groups to display."
3731
  msgstr ""
3732
 
3733
+ #: bp-groups/bp-groups-widgets.php:132
3734
  msgid "Link widget title to Groups directory"
3735
  msgstr ""
3736
 
3737
+ #: bp-groups/bp-groups-widgets.php:134
3738
  msgid "Max groups to show:"
3739
  msgstr ""
3740
 
3741
+ #: bp-groups/bp-groups-widgets.php:137
3742
  msgid "Default groups to show:"
3743
  msgstr ""
3744
 
3745
+ #: bp-groups/bp-groups-widgets.php:197
3746
  msgid "No groups matched the current filter."
3747
  msgstr ""
3748
 
3749
+ #: bp-loader.php:162 bp-loader.php:169
3750
+ msgid "Cheatin&#8217; huh?"
3751
+ msgstr ""
3752
+
3753
+ #: bp-loader.php:530
3754
+ msgid "BuddyPress Default"
3755
+ msgstr ""
3756
+
3757
  #: bp-members/bp-members-actions.php:45
3758
  msgid "User marked as spammer. Spam users are visible only to site admins."
3759
  msgstr ""
3783
  msgstr ""
3784
 
3785
  #: bp-members/bp-members-adminbar.php:99
3786
+ #: bp-xprofile/bp-xprofile-template.php:895
3787
+ #: bp-xprofile/bp-xprofile-template.php:896
3788
  msgid "Edit Profile"
3789
  msgstr ""
3790
 
3791
  #: bp-members/bp-members-adminbar.php:115
3792
+ #: bp-members/bp-members-buddybar.php:131
3793
  msgid "User Capabilities"
3794
  msgstr ""
3795
 
3796
  #: bp-members/bp-members-adminbar.php:123
3797
+ #: bp-settings/bp-settings-loader.php:130
3798
+ #: bp-settings/bp-settings-loader.php:190
3799
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:33
3800
  #: bp-themes/bp-default/members/single/settings/delete-account.php:50
3801
  #: bp-themes/bp-default/members/single/settings/delete-account.php:76
3802
  msgid "Delete Account"
3806
  msgid "No new notifications"
3807
  msgstr ""
3808
 
3809
+ #: bp-members/bp-members-buddybar.php:24 bp-settings/bp-settings-loader.php:105
3810
+ #: bp-settings/bp-settings-loader.php:181
3811
  msgid "Notifications"
3812
  msgstr ""
3813
 
3828
  msgstr ""
3829
 
3830
  #: bp-members/bp-members-buddybar.php:133
3831
+ msgid "Delete %s's Account"
3832
  msgstr ""
3833
 
3834
+ #: bp-members/bp-members-functions.php:897
3835
+ msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
3836
  msgstr ""
3837
 
3838
+ #: bp-members/bp-members-functions.php:1071
3839
+ msgid "Please check your email address."
3840
  msgstr ""
3841
 
3842
+ #: bp-members/bp-members-functions.php:1074
3843
+ #: bp-members/bp-members-functions.php:1077
3844
+ msgid "Sorry, that email address is not allowed!"
3845
+ msgstr ""
3846
+
3847
+ #: bp-members/bp-members-functions.php:1080
3848
+ msgid "Sorry, that email address is already used!"
3849
  msgstr ""
3850
 
3851
+ #: bp-members/bp-members-functions.php:1098
3852
  msgid "Please enter a username"
3853
  msgstr ""
3854
 
3855
+ #: bp-members/bp-members-functions.php:1106
3856
  msgid "Only lowercase letters and numbers allowed"
3857
  msgstr ""
3858
 
3859
+ #: bp-members/bp-members-functions.php:1109
3860
  msgid "Username must be at least 4 characters"
3861
  msgstr ""
3862
 
3863
+ #: bp-members/bp-members-functions.php:1112
3864
  msgid "Sorry, usernames may not contain the character \"_\"!"
3865
  msgstr ""
3866
 
3867
+ #: bp-members/bp-members-functions.php:1119
3868
  msgid "Sorry, usernames must have letters too!"
3869
  msgstr ""
3870
 
3871
+ #: bp-members/bp-members-functions.php:1123
 
 
 
 
 
 
 
 
 
3872
  msgid "Sorry, that username already exists!"
3873
  msgstr ""
3874
 
3875
+ #: bp-members/bp-members-functions.php:1168
 
 
 
 
3876
  msgid "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
3877
  msgstr ""
3878
 
3879
+ #: bp-members/bp-members-functions.php:1266
3880
+ #: bp-members/bp-members-functions.php:1270
3881
  msgid "Invalid activation key"
3882
  msgstr ""
3883
 
3884
+ #: bp-members/bp-members-functions.php:1307
3885
  msgid "%s became a registered member"
3886
  msgstr ""
3887
 
3888
+ #: bp-members/bp-members-functions.php:1391
3889
  msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
3890
  msgstr ""
3891
 
3893
  msgid "Search Members..."
3894
  msgstr ""
3895
 
3896
+ #: bp-members/bp-members-loader.php:193
3897
  msgid "You"
3898
  msgstr ""
3899
 
3909
  msgid "This is a required field"
3910
  msgstr ""
3911
 
3912
+ #: bp-members/bp-members-screens.php:254
3913
  msgid "Your account is now active!"
3914
  msgstr ""
3915
 
3916
+ #: bp-members/bp-members-screens.php:431
3917
+ #: bp-themes/bp-default/registration/register.php:253
3918
+ msgid "Sign Up Complete!"
3919
+ msgstr ""
3920
+
3921
+ #: bp-members/bp-members-screens.php:439
3922
+ #: bp-themes/bp-default/registration/activate.php:11
3923
+ msgid "Account Activated"
3924
+ msgstr ""
3925
+
3926
  #: bp-members/bp-members-template.php:206
3927
  msgctxt "Member pagination previous text"
3928
  msgid "&larr;"
3949
  msgid "Viewing member %1$s to %2$s (of %3$s members)"
3950
  msgstr ""
3951
 
3952
+ #: bp-members/bp-members-template.php:597
3953
  msgid "Never active"
3954
  msgstr ""
3955
 
3956
+ #: bp-members/bp-members-template.php:619
3957
  msgctxt "member latest update in member directory"
3958
  msgid "- &quot;%s &quot;"
3959
  msgstr ""
3960
 
3961
+ #: bp-members/bp-members-template.php:676
3962
+ msgctxt "Records the timestamp that the user registered into the activy stream"
3963
  msgid "registered %s"
3964
  msgstr ""
3965
 
3966
+ #: bp-members/bp-members-template.php:1145
3967
  msgid "Your Avatar"
3968
  msgstr ""
3969
 
3970
+ #: bp-members/bp-members-template.php:1215
3971
  msgid "Activity RSS Feed"
3972
  msgstr ""
3973
 
3974
+ #: bp-messages/bp-messages-actions.php:35
3975
  msgid "Your reply was sent successfully"
3976
  msgstr ""
3977
 
3978
+ #: bp-messages/bp-messages-actions.php:37
3979
  msgid "There was a problem sending your reply, please try again"
3980
  msgstr ""
3981
 
3982
+ #: bp-messages/bp-messages-actions.php:65
 
 
 
 
 
 
 
 
 
3983
  msgid "There was an error deleting that message."
3984
  msgstr ""
3985
 
3986
+ #: bp-messages/bp-messages-actions.php:67
3987
  msgid "Message deleted."
3988
  msgstr ""
3989
 
3990
+ #: bp-messages/bp-messages-actions.php:89
3991
  msgid "There was an error deleting messages."
3992
  msgstr ""
3993
 
3994
+ #: bp-messages/bp-messages-actions.php:91
3995
+ #: bp-templates/bp-legacy/buddypress-functions.php:1167
3996
  #: bp-themes/bp-default/_inc/ajax.php:871
3997
  msgid "Messages deleted."
3998
  msgstr ""
4009
  msgid "No Subject"
4010
  msgstr ""
4011
 
4012
+ #: bp-messages/bp-messages-functions.php:246
4013
+ #: bp-messages/bp-messages-loader.php:131
4014
+ #: bp-messages/bp-messages-loader.php:200
4015
  msgid "Inbox"
4016
  msgstr ""
4017
 
4018
+ #: bp-messages/bp-messages-functions.php:249
4019
  msgid "You have %d new messages"
4020
  msgstr ""
4021
 
4022
+ #: bp-messages/bp-messages-functions.php:252
4023
  msgid "You have %d new message"
4024
  msgstr ""
4025
 
4031
  msgid "Search Messages..."
4032
  msgstr ""
4033
 
4034
+ #: bp-messages/bp-messages-loader.php:104
4035
+ #: bp-messages/bp-messages-screens.php:104
4036
+ msgid "Messages <span>%s</span>"
4037
+ msgstr ""
4038
+
4039
+ #: bp-messages/bp-messages-loader.php:141
4040
+ #: bp-messages/bp-messages-loader.php:223
4041
  msgid "Sent"
4042
  msgstr ""
4043
 
4044
+ #: bp-messages/bp-messages-loader.php:151
4045
+ #: bp-messages/bp-messages-loader.php:231
4046
  msgid "Compose"
4047
  msgstr ""
4048
 
4049
+ #: bp-messages/bp-messages-loader.php:162
4050
  msgid "Notices"
4051
  msgstr ""
4052
 
4053
+ #: bp-messages/bp-messages-loader.php:196
4054
  msgid "Messages <span class=\"count\">%s</span>"
4055
  msgstr ""
4056
 
4057
+ #: bp-messages/bp-messages-loader.php:197
4058
  msgid "Inbox <span class=\"count\">%s</span>"
4059
  msgstr ""
4060
 
4061
+ #: bp-messages/bp-messages-loader.php:199
4062
+ #: bp-messages/bp-messages-screens.php:168
4063
  msgid "Messages"
4064
  msgstr ""
4065
 
4066
+ #: bp-messages/bp-messages-loader.php:240
4067
  msgid "All Member Notices"
4068
  msgstr ""
4069
 
4070
+ #: bp-messages/bp-messages-loader.php:259
4071
  msgid "My Messages"
4072
  msgstr ""
4073
 
4074
+ #: bp-messages/bp-messages-notifications.php:50
4075
  msgid "New message from %s"
4076
  msgstr ""
4077
 
4078
+ #: bp-messages/bp-messages-notifications.php:52
4079
  msgid ""
4080
  "%1$s sent you a new message:\n"
4081
  "\n"
4105
  msgid "Message sent successfully!"
4106
  msgstr ""
4107
 
4108
+ #: bp-messages/bp-messages-screens.php:125
4109
  msgid "There was a problem deactivating that notice."
4110
  msgstr ""
4111
 
4112
+ #: bp-messages/bp-messages-screens.php:127
4113
  msgid "Notice deactivated."
4114
  msgstr ""
4115
 
4116
+ #: bp-messages/bp-messages-screens.php:131
4117
  msgid "There was a problem activating that notice."
4118
  msgstr ""
4119
 
4120
+ #: bp-messages/bp-messages-screens.php:133
4121
  msgid "Notice activated."
4122
  msgstr ""
4123
 
4124
+ #: bp-messages/bp-messages-screens.php:137
4125
  msgid "There was a problem deleting that notice."
4126
  msgstr ""
4127
 
4128
+ #: bp-messages/bp-messages-screens.php:139
4129
  msgid "Notice deleted."
4130
  msgstr ""
4131
 
4132
+ #: bp-messages/bp-messages-screens.php:177
4133
  msgid "A member sends you a new message"
4134
  msgstr ""
4135
 
 
 
 
 
4136
  #: bp-messages/bp-messages-template.php:84
4137
  msgctxt "Message pagination previous text"
4138
  msgid "&larr;"
4143
  msgid "&rarr;"
4144
  msgstr ""
4145
 
4146
+ #: bp-messages/bp-messages-template.php:352
4147
  msgid "Viewing message %1$s to %2$s (of %3$s messages)"
4148
  msgstr ""
4149
 
4150
+ #: bp-messages/bp-messages-template.php:428
4151
  msgid "Select:"
4152
  msgstr ""
4153
 
4154
+ #: bp-messages/bp-messages-template.php:432
4155
  msgid "Read"
4156
  msgstr ""
4157
 
4158
+ #: bp-messages/bp-messages-template.php:433
4159
  msgid "Unread"
4160
  msgstr ""
4161
 
4162
+ #: bp-messages/bp-messages-template.php:439
4163
  msgid "Mark as Read"
4164
  msgstr ""
4165
 
4166
+ #: bp-messages/bp-messages-template.php:440
4167
  msgid "Mark as Unread"
4168
  msgstr ""
4169
 
4170
+ #: bp-messages/bp-messages-template.php:444
4171
  msgid "Delete Selected"
4172
  msgstr ""
4173
 
4174
+ #: bp-messages/bp-messages-template.php:489
4175
  msgid "Currently Active"
4176
  msgstr ""
4177
 
4178
+ #: bp-messages/bp-messages-template.php:556
4179
  msgid "Deactivate"
4180
  msgstr ""
4181
 
4182
+ #: bp-messages/bp-messages-template.php:607
4183
+ #: bp-templates/bp-legacy/buddypress/members/register.php:166
4184
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:130
4185
+ #: bp-templates/bp-legacy/buddypress-functions.php:257
4186
  #: bp-themes/bp-default/functions.php:164
4187
+ #: bp-themes/bp-default/members/single/profile/edit.php:130
4188
+ #: bp-themes/bp-default/registration/register.php:171
4189
  msgid "Close"
4190
  msgstr ""
4191
 
4192
+ #: bp-messages/bp-messages-template.php:650
4193
  msgid "Send a private message to this user."
4194
  msgstr ""
4195
 
4196
+ #: bp-messages/bp-messages-template.php:651
4197
  msgid "Private Message"
4198
  msgstr ""
4199
 
4200
+ #: bp-messages/bp-messages-template.php:834
4201
  msgid "%d Recipients"
4202
  msgstr ""
4203
 
4204
  #: bp-messages/bp-messages-template.php:922
4205
+ #: bp-templates/bp-legacy/buddypress-functions.php:1073
4206
  #: bp-themes/bp-default/_inc/ajax.php:777
4207
  msgid "Sent %s"
4208
  msgstr ""
4209
 
4210
+ #: bp-settings/bp-settings-actions.php:158
4211
  msgid "That email address is invalid. Check the formatting and try again."
4212
  msgstr ""
4213
 
4214
+ #: bp-settings/bp-settings-actions.php:161
4215
  msgid "That email address is currently unavailable for use."
4216
  msgstr ""
4217
 
4218
+ #: bp-settings/bp-settings-actions.php:164
4219
  msgid "That email address is already taken."
4220
  msgstr ""
4221
 
4222
+ #: bp-settings/bp-settings-actions.php:167
4223
  msgid "Email address cannot be empty."
4224
  msgstr ""
4225
 
4226
+ #: bp-settings/bp-settings-actions.php:177
4227
  msgid "Your current password is invalid."
4228
  msgstr ""
4229
 
4230
+ #: bp-settings/bp-settings-actions.php:180
4231
  msgid "The new password fields did not match."
4232
  msgstr ""
4233
 
4234
+ #: bp-settings/bp-settings-actions.php:183
4235
  msgid "One of the password fields was empty."
4236
  msgstr ""
4237
 
4238
+ #: bp-settings/bp-settings-actions.php:192
4239
  msgid "Your settings have been saved."
4240
  msgstr ""
4241
 
4242
+ #: bp-settings/bp-settings-actions.php:198
4243
  msgid "No changes were made to your account."
4244
  msgstr ""
4245
 
4246
+ #: bp-settings/bp-settings-actions.php:200
4247
  msgid "No changes were made to this account."
4248
  msgstr ""
4249
 
4250
+ #: bp-settings/bp-settings-actions.php:250
4251
  msgid "Your notification settings have been saved."
4252
  msgstr ""
4253
 
4254
+ #: bp-settings/bp-settings-actions.php:252
4255
  msgid "This user's notification settings have been saved."
4256
  msgstr ""
4257
 
4258
+ #: bp-settings/bp-settings-actions.php:345
4259
  msgid "%s was successfully deleted."
4260
  msgstr ""
4261
 
4262
+ #: bp-settings/bp-settings-loader.php:94 bp-settings/bp-settings-loader.php:173
4263
  msgid "General"
4264
  msgstr ""
4265
 
4266
+ #: bp-settings/bp-settings-loader.php:117
4267
  #: bp-themes/bp-default/members/single/settings/capabilities.php:49
4268
  msgid "Capabilities"
4269
  msgstr ""
4270
 
4271
+ #: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4272
  #: bp-themes/bp-default/activity/activity-loop.php:41
4273
  msgid "Load More"
4274
  msgstr ""
4275
 
4276
+ #: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:42
4277
  #: bp-themes/bp-default/activity/activity-loop.php:55
4278
  msgid "Sorry, there was no activity found. Please try a different filter."
4279
  msgstr ""
4281
  #. translators: 1: user profile link, 2: user name, 3: activity permalink, 4:
4282
  #. activity timestamp
4283
 
4284
+ #: bp-templates/bp-legacy/buddypress/activity/comment.php:27
4285
+ #: bp-themes/bp-default/activity/comment.php:30
4286
  msgid "<a href=\"%1$s\">%2$s</a> replied <a href=\"%3$s\" class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>"
4287
  msgstr ""
4288
 
4289
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:50
4290
+ msgid "View Conversation"
 
 
 
 
4291
  msgstr ""
4292
 
4293
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:58
4294
  #: bp-themes/bp-default/activity/entry.php:60
4295
  msgid "Comment <span>%s</span>"
4296
  msgstr ""
4297
 
4298
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:66
4299
  #: bp-themes/bp-default/activity/entry.php:68
4300
  msgid "Mark as Favorite"
4301
  msgstr ""
4302
 
4303
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:66
4304
+ #: bp-templates/bp-legacy/buddypress-functions.php:259
4305
+ #: bp-templates/bp-legacy/buddypress-functions.php:764
4306
+ #: bp-templates/bp-legacy/buddypress-functions.php:781
4307
+ #: bp-themes/bp-default/_inc/ajax.php:481
4308
+ #: bp-themes/bp-default/_inc/ajax.php:498
4309
+ #: bp-themes/bp-default/activity/entry.php:68
4310
+ #: bp-themes/bp-default/functions.php:166
4311
+ msgid "Favorite"
4312
  msgstr ""
4313
 
4314
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:70
4315
+ #: bp-templates/bp-legacy/buddypress-functions.php:260
4316
+ #: bp-templates/bp-legacy/buddypress-functions.php:762
4317
+ #: bp-templates/bp-legacy/buddypress-functions.php:783
4318
+ #: bp-themes/bp-default/_inc/ajax.php:479
4319
+ #: bp-themes/bp-default/_inc/ajax.php:500
4320
+ #: bp-themes/bp-default/activity/entry.php:72
4321
+ #: bp-themes/bp-default/functions.php:167
4322
+ msgid "Remove Favorite"
4323
  msgstr ""
4324
 
4325
+ #: bp-templates/bp-legacy/buddypress/activity/entry.php:102
4326
+ #: bp-themes/bp-default/activity/entry.php:104
4327
+ msgid "Post"
4328
  msgstr ""
4329
 
4330
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:19
4331
  #: bp-themes/bp-default/activity/index.php:39
4332
  msgid "The public activity for everyone on this site."
4333
  msgstr ""
4334
 
4335
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:19
4336
+ #: bp-templates/bp-legacy/buddypress/members/index.php:17
4337
  #: bp-themes/bp-default/activity/index.php:39
4338
  #: bp-themes/bp-default/members/index.php:33
4339
  msgid "All Members <span>%s</span>"
4340
  msgstr ""
4341
 
4342
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:29
4343
  #: bp-themes/bp-default/activity/index.php:49
4344
  msgid "The activity of my friends only."
4345
  msgstr ""
4346
 
4347
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:29
4348
+ #: bp-templates/bp-legacy/buddypress/members/index.php:20
4349
  #: bp-themes/bp-default/activity/index.php:49
4350
  #: bp-themes/bp-default/members/index.php:37
4351
  msgid "My Friends <span>%s</span>"
4352
  msgstr ""
4353
 
4354
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:41
4355
  #: bp-themes/bp-default/activity/index.php:61
4356
  msgid "The activity of groups I am a member of."
4357
  msgstr ""
4358
 
4359
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:41
4360
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:22
4361
  #: bp-themes/bp-default/activity/index.php:61
4362
  #: bp-themes/bp-default/groups/index.php:39
4363
  msgid "My Groups <span>%s</span>"
4364
  msgstr ""
4365
 
4366
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:51
4367
  #: bp-themes/bp-default/activity/index.php:71
4368
  msgid "The activity I've marked as a favorite."
4369
  msgstr ""
4370
 
4371
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:51
4372
  #: bp-themes/bp-default/activity/index.php:71
4373
  msgid "My Favorites <span>%s</span>"
4374
  msgstr ""
4375
 
4376
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:57
4377
  #: bp-themes/bp-default/activity/index.php:77
4378
  msgid "Activity that I have been mentioned in."
4379
  msgstr ""
4380
 
4381
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:57
4382
  #: bp-themes/bp-default/activity/index.php:77
4383
  msgid "<span>%s new</span>"
4384
  msgstr ""
4385
 
4386
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:67
4387
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3
4388
  #: bp-themes/bp-default/activity/index.php:87
4389
  #: bp-themes/bp-default/groups/single/activity.php:3
4390
  msgid "RSS Feed"
4391
  msgstr ""
4392
 
4393
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:67
4394
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3
4395
  #: bp-themes/bp-default/activity/index.php:87
4396
  #: bp-themes/bp-default/groups/single/activity.php:3
4397
  msgid "RSS"
4398
  msgstr ""
4399
 
4400
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:72
4401
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:8
4402
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:18
4403
  #: bp-themes/bp-default/activity/index.php:92
4404
  #: bp-themes/bp-default/groups/single/activity.php:8
4405
  #: bp-themes/bp-default/members/single/activity.php:18
4406
  msgid "Show:"
4407
  msgstr ""
4408
 
4409
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:74
4410
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:10
4411
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:20
4412
  #: bp-themes/bp-default/activity/index.php:94
4413
  #: bp-themes/bp-default/groups/single/activity.php:10
4414
  #: bp-themes/bp-default/members/single/activity.php:20
4415
  msgid "Everything"
4416
  msgstr ""
4417
 
4418
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:75
4419
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:11
4420
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:21
4421
  #: bp-themes/bp-default/activity/index.php:95
4422
  #: bp-themes/bp-default/groups/single/activity.php:11
4423
  #: bp-themes/bp-default/members/single/activity.php:21
4424
  msgid "Updates"
4425
  msgstr ""
4426
 
4427
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:80
4428
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:28
4429
  #: bp-themes/bp-default/activity/index.php:100
4430
  #: bp-themes/bp-default/members/single/activity.php:28
4431
  msgid "Comments"
4432
  msgstr ""
4433
 
4434
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:86
4435
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:14
4436
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:43
4437
  #: bp-themes/bp-default/activity/index.php:106
4438
  #: bp-themes/bp-default/groups/single/activity.php:14
4439
  #: bp-themes/bp-default/members/single/activity.php:43
4440
  msgid "Forum Topics"
4441
  msgstr ""
4442
 
4443
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:87
4444
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:15
4445
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:44
4446
  #: bp-themes/bp-default/activity/index.php:107
4447
  #: bp-themes/bp-default/groups/single/activity.php:15
4448
  #: bp-themes/bp-default/members/single/activity.php:44
4449
  msgid "Forum Replies"
4450
  msgstr ""
4451
 
4452
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:93
4453
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:50
4454
  #: bp-themes/bp-default/activity/index.php:113
4455
  #: bp-themes/bp-default/members/single/activity.php:50
4456
  msgid "New Groups"
4457
  msgstr ""
4458
 
4459
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:94
4460
+ #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:18
4461
+ #: bp-templates/bp-legacy/buddypress/members/single/activity.php:51
4462
  #: bp-themes/bp-default/activity/index.php:114
4463
  #: bp-themes/bp-default/groups/single/activity.php:18
4464
  #: bp-themes/bp-default/members/single/activity.php:51
4465
  msgid "Group Memberships"
4466
  msgstr ""
4467
 
4468
+ #: bp-templates/bp-legacy/buddypress/activity/index.php:104
4469
  #: bp-themes/bp-default/activity/index.php:124
4470
  msgid "New Members"
4471
  msgstr ""
4472
 
4473
+ #: bp-templates/bp-legacy/buddypress/activity/post-form.php:23
4474
  #: bp-themes/bp-default/activity/post-form.php:23
4475
  msgid "What's new in %s, %s?"
4476
  msgstr ""
4477
 
4478
+ #: bp-templates/bp-legacy/buddypress/activity/post-form.php:25
4479
  #: bp-themes/bp-default/activity/post-form.php:25
4480
  msgid "What's new, %s?"
4481
  msgstr ""
4482
 
4483
+ #: bp-templates/bp-legacy/buddypress/activity/post-form.php:35
4484
  #: bp-themes/bp-default/activity/post-form.php:35
4485
  msgid "Post Update"
4486
  msgstr ""
4487
 
4488
+ #: bp-templates/bp-legacy/buddypress/activity/post-form.php:42
4489
  #: bp-themes/bp-default/activity/post-form.php:42
4490
  msgid "Post in"
4491
  msgstr ""
4492
 
4493
+ #: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4494
  #: bp-themes/bp-default/blogs/blogs-loop.php:90
4495
  msgid "Sorry, there were no sites found."
4496
  msgstr ""
4497
 
4498
+ #: bp-templates/bp-legacy/buddypress/blogs/create.php:14
 
 
 
 
4499
  #: bp-themes/bp-default/blogs/create.php:32
4500
  msgid "Site registration is currently disabled"
4501
  msgstr ""
4502
 
4503
+ #: bp-templates/bp-legacy/buddypress/blogs/index.php:16
4504
  #: bp-themes/bp-default/blogs/index.php:33
4505
  msgid "All Sites <span>%s</span>"
4506
  msgstr ""
4507
 
4508
+ #: bp-templates/bp-legacy/buddypress/blogs/index.php:20
4509
  #: bp-themes/bp-default/blogs/index.php:37
4510
  msgid "My Sites <span>%s</span>"
4511
  msgstr ""
4512
 
4513
+ #: bp-templates/bp-legacy/buddypress/blogs/index.php:36
4514
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:42
4515
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:36
4516
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:36
4517
+ #: bp-templates/bp-legacy/buddypress/members/index.php:33
4518
+ #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:19
4519
+ #: bp-templates/bp-legacy/buddypress/members/single/forums.php:18
4520
+ #: bp-templates/bp-legacy/buddypress/members/single/friends.php:20
4521
+ #: bp-templates/bp-legacy/buddypress/members/single/groups.php:20
4522
  #: bp-themes/bp-default/blogs/index.php:53
4523
  #: bp-themes/bp-default/forums/index.php:60
4524
  #: bp-themes/bp-default/groups/index.php:55
4528
  #: bp-themes/bp-default/members/single/forums.php:18
4529
  #: bp-themes/bp-default/members/single/friends.php:20
4530
  #: bp-themes/bp-default/members/single/groups.php:20
 
4531
  msgid "Order By:"
4532
  msgstr ""
4533
 
4534
+ #: bp-templates/bp-legacy/buddypress/blogs/index.php:38
4535
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:44
4536
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:39
4537
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:38
4538
+ #: bp-templates/bp-legacy/buddypress/members/index.php:35
4539
+ #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:21
4540
+ #: bp-templates/bp-legacy/buddypress/members/single/forums.php:20
4541
+ #: bp-templates/bp-legacy/buddypress/members/single/friends.php:22
4542
+ #: bp-templates/bp-legacy/buddypress/members/single/groups.php:22
4543
  #: bp-themes/bp-default/blogs/index.php:55
4544
  #: bp-themes/bp-default/forums/index.php:62
4545
  #: bp-themes/bp-default/groups/index.php:57
4552
  msgid "Last Active"
4553
  msgstr ""
4554
 
4555
+ #: bp-templates/bp-legacy/buddypress/blogs/index.php:40
4556
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:42
4557
+ #: bp-templates/bp-legacy/buddypress/members/index.php:39
4558
+ #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:23
4559
+ #: bp-templates/bp-legacy/buddypress/members/single/friends.php:24
4560
+ #: bp-templates/bp-legacy/buddypress/members/single/groups.php:25
4561
  #: bp-themes/bp-default/blogs/index.php:57
4562
  #: bp-themes/bp-default/groups/index.php:60
4563
  #: bp-themes/bp-default/members/index.php:60
4567
  msgid "Alphabetical"
4568
  msgstr ""
4569
 
4570
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:39
4571
+ #: bp-themes/bp-default/forums/forums-loop.php:39
4572
+ msgid "Topic"
4573
  msgstr ""
4574
 
4575
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:41
4576
+ #: bp-themes/bp-default/forums/forums-loop.php:41
4577
+ msgid "Freshness"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4578
  msgstr ""
4579
 
4580
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:54
4581
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:95
4582
  #: bp-themes/bp-default/forums/forums-loop.php:54
4583
+ #: bp-themes/bp-default/groups/single/forum/topic.php:95
4584
+ msgid "Permanent link to this post"
4585
  msgstr ""
4586
 
4587
  #. translators: "started by [poster] in [forum]"
4588
 
4589
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:61
4590
  #: bp-themes/bp-default/forums/forums-loop.php:61
4591
  msgid "Started by %1$s"
4592
  msgstr ""
4593
 
4594
  #. translators: "started by [poster] in [forum]"
4595
 
4596
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:72
4597
  #: bp-themes/bp-default/forums/forums-loop.php:72
4598
  msgid "in %1$s"
4599
  msgstr ""
4600
 
4601
+ #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:122
4602
  #: bp-themes/bp-default/forums/forums-loop.php:122
4603
  msgid "Sorry, there were no forum topics found."
4604
  msgstr ""
4605
 
4606
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:22
 
 
 
4607
  #: bp-themes/bp-default/forums/index.php:40
4608
  msgid "All Topics <span>%s</span>"
4609
  msgstr ""
4610
 
4611
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:26
4612
  #: bp-themes/bp-default/forums/index.php:44
4613
  msgid "My Topics <span>%s</span>"
4614
  msgstr ""
4615
 
4616
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:45
4617
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:39
4618
+ #: bp-templates/bp-legacy/buddypress/members/single/forums.php:21
4619
  #: bp-themes/bp-default/forums/index.php:63
4620
  #: bp-themes/bp-default/groups/single/forum.php:39
4621
  #: bp-themes/bp-default/members/single/forums.php:21
4622
  msgid "Most Posts"
4623
  msgstr ""
4624
 
4625
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:46
4626
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:40
4627
+ #: bp-templates/bp-legacy/buddypress/members/single/forums.php:22
4628
  #: bp-themes/bp-default/forums/index.php:64
4629
  #: bp-themes/bp-default/groups/single/forum.php:40
4630
  #: bp-themes/bp-default/members/single/forums.php:22
4631
  msgid "Unreplied"
4632
  msgstr ""
4633
 
4634
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:82
4635
  #: bp-themes/bp-default/forums/index.php:100
4636
  msgid "Create New Topic:"
4637
  msgstr ""
4638
 
4639
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:89
4640
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:50
4641
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:78
4642
  #: bp-themes/bp-default/forums/index.php:107
4643
  #: bp-themes/bp-default/groups/single/forum/edit.php:50
4644
  #: bp-themes/bp-default/groups/single/forum.php:78
4645
  msgid "Content:"
4646
  msgstr ""
4647
 
4648
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:92
4649
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:53
4650
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:81
4651
  #: bp-themes/bp-default/forums/index.php:110
4652
  #: bp-themes/bp-default/groups/single/forum/edit.php:53
4653
  #: bp-themes/bp-default/groups/single/forum.php:81
4654
  msgid "Tags (comma separated):"
4655
  msgstr ""
4656
 
4657
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:95
4658
  #: bp-themes/bp-default/forums/index.php:113
4659
  msgid "Post In Group Forum:"
4660
  msgstr ""
4661
 
4662
  #. translators: no option picked in select box
4663
 
4664
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:98
4665
  #: bp-themes/bp-default/forums/index.php:116
4666
+ #: bp-xprofile/bp-xprofile-template.php:459
4667
  msgid "----"
4668
  msgstr ""
4669
 
4670
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:115
4671
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:87
4672
  #: bp-themes/bp-default/forums/index.php:133
4673
  #: bp-themes/bp-default/groups/single/forum.php:87
4674
  msgid "Post Topic"
4675
  msgstr ""
4676
 
4677
+ #: bp-templates/bp-legacy/buddypress/forums/index.php:127
4678
  #: bp-themes/bp-default/forums/index.php:145
4679
  msgid "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum."
4680
  msgstr ""
4681
 
4682
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:29
4683
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4684
  #: bp-themes/bp-default/groups/create.php:39
4685
  #: bp-themes/bp-default/groups/single/admin.php:16
4686
  msgid "Group Name (required)"
4687
  msgstr ""
4688
 
4689
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:34
4690
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:19
4691
  #: bp-themes/bp-default/groups/create.php:42
4692
  #: bp-themes/bp-default/groups/single/admin.php:19
4693
  msgid "Group Description (required)"
4694
  msgstr ""
4695
 
4696
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:51
4697
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:56
4698
  #: bp-themes/bp-default/groups/create.php:58
4699
  #: bp-themes/bp-default/groups/single/admin.php:56
4700
  msgid "Privacy Options"
4701
  msgstr ""
4702
 
4703
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:55
4704
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:61
4705
  #: bp-themes/bp-default/groups/create.php:62
4706
  #: bp-themes/bp-default/groups/single/admin.php:61
4707
  msgid "This is a public group"
4708
  msgstr ""
4709
 
4710
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:57
4711
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:63
4712
  #: bp-themes/bp-default/groups/create.php:64
4713
  #: bp-themes/bp-default/groups/single/admin.php:63
4714
  msgid "Any site member can join this group."
4715
  msgstr ""
4716
 
4717
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:58
4718
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:67
4719
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:64
4720
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:74
4721
  #: bp-themes/bp-default/groups/create.php:65
4722
  #: bp-themes/bp-default/groups/create.php:74
4723
  #: bp-themes/bp-default/groups/single/admin.php:64
4725
  msgid "This group will be listed in the groups directory and in search results."
4726
  msgstr ""
4727
 
4728
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:59
4729
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:65
4730
  #: bp-themes/bp-default/groups/create.php:66
4731
  #: bp-themes/bp-default/groups/single/admin.php:65
4732
  msgid "Group content and activity will be visible to any site member."
4733
  msgstr ""
4734
 
4735
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:64
4736
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:71
4737
  #: bp-themes/bp-default/groups/create.php:71
4738
  #: bp-themes/bp-default/groups/single/admin.php:71
4739
  msgid "This is a private group"
4740
  msgstr ""
4741
 
4742
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:66
4743
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:73
4744
  #: bp-themes/bp-default/groups/create.php:73
4745
  #: bp-themes/bp-default/groups/single/admin.php:73
4746
  msgid "Only users who request membership and are accepted can join the group."
4747
  msgstr ""
4748
 
4749
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:68
4750
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:77
4751
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:75
4752
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:85
4753
  #: bp-themes/bp-default/groups/create.php:75
4754
  #: bp-themes/bp-default/groups/create.php:84
4755
  #: bp-themes/bp-default/groups/single/admin.php:75
4757
  msgid "Group content and activity will only be visible to members of the group."
4758
  msgstr ""
4759
 
4760
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:73
4761
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:81
4762
  #: bp-themes/bp-default/groups/create.php:80
4763
  #: bp-themes/bp-default/groups/single/admin.php:81
4764
  msgid "This is a hidden group"
4765
  msgstr ""
4766
 
4767
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:75
4768
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:83
4769
  #: bp-themes/bp-default/groups/create.php:82
4770
  #: bp-themes/bp-default/groups/single/admin.php:83
4771
  msgid "Only users who are invited can join the group."
4772
  msgstr ""
4773
 
4774
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:76
4775
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:84
4776
  #: bp-themes/bp-default/groups/create.php:83
4777
  #: bp-themes/bp-default/groups/single/admin.php:84
4778
  msgid "This group will not be listed in the groups directory or search results."
4779
  msgstr ""
4780
 
4781
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:82
4782
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:92
4783
  #: bp-themes/bp-default/groups/create.php:89
4784
  #: bp-themes/bp-default/groups/single/admin.php:92
4785
  msgid "Group Invitations"
4786
  msgstr ""
4787
 
4788
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:84
4789
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:94
4790
  #: bp-themes/bp-default/groups/create.php:91
4791
  #: bp-themes/bp-default/groups/single/admin.php:94
4792
  msgid "Which members of this group are allowed to invite others?"
4793
  msgstr ""
4794
 
4795
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4796
  #: bp-themes/bp-default/groups/create.php:116
4797
  msgid "Should this group have a forum?"
4798
  msgstr ""
4799
 
4800
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:116
 
 
 
 
4801
  #: bp-themes/bp-default/groups/create.php:123
4802
  msgid "<strong>Attention Site Admin:</strong> Group forums require the <a href=\"%s\">correct setup and configuration</a> of a bbPress installation."
4803
  msgstr ""
4804
 
4805
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:142
4806
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:127
4807
  #: bp-themes/bp-default/groups/create.php:149
4808
  #: bp-themes/bp-default/groups/single/admin.php:127
4809
  msgid "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results."
4810
  msgstr ""
4811
 
4812
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:146
4813
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:131
4814
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:18
4815
  #: bp-themes/bp-default/groups/create.php:153
4816
  #: bp-themes/bp-default/groups/single/admin.php:131
4817
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:18
4818
  msgid "Upload Image"
4819
  msgstr ""
4820
 
4821
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:150
4822
  #: bp-themes/bp-default/groups/create.php:157
4823
  msgid "To skip the avatar upload process, hit the \"Next Step\" button."
4824
  msgstr ""
4825
 
4826
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:157
4827
  #: bp-themes/bp-default/groups/create.php:164
4828
  msgid "Crop Group Avatar"
4829
  msgstr ""
4830
 
4831
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:159
4832
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:151
4833
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:33
4834
  #: bp-themes/bp-default/groups/create.php:166
4835
  #: bp-themes/bp-default/groups/single/admin.php:151
4836
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:33
4837
  msgid "Avatar to crop"
4838
  msgstr ""
4839
 
4840
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:162
4841
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:154
4842
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:36
4843
  #: bp-themes/bp-default/groups/create.php:169
4844
  #: bp-themes/bp-default/groups/single/admin.php:154
4845
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:36
4846
  msgid "Avatar preview"
4847
  msgstr ""
4848
 
4849
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:165
4850
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:157
4851
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:39
4852
  #: bp-themes/bp-default/groups/create.php:172
4853
  #: bp-themes/bp-default/groups/single/admin.php:157
4854
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:39
4855
  msgid "Crop Image"
4856
  msgstr ""
4857
 
4858
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:204
4859
+ #: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:22
4860
  #: bp-themes/bp-default/groups/create.php:211
4861
  #: bp-themes/bp-default/groups/single/send-invites.php:22
4862
  msgid "Select people to invite from your friends list."
4863
  msgstr ""
4864
 
4865
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:222
4866
+ #: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:42
4867
+ #: bp-templates/bp-legacy/buddypress-functions.php:853
4868
+ #: bp-themes/bp-default/_inc/ajax.php:570
4869
+ #: bp-themes/bp-default/groups/create.php:229
4870
+ #: bp-themes/bp-default/groups/single/send-invites.php:42
4871
+ msgid "Remove Invite"
4872
+ msgstr ""
4873
+
4874
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:239
4875
+ #: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:73
4876
  #: bp-themes/bp-default/groups/create.php:246
4877
  #: bp-themes/bp-default/groups/single/send-invites.php:73
4878
+ msgid "Once you have built up friend connections you will be able to invite others to your group."
4879
  msgstr ""
4880
 
4881
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:261
4882
  #: bp-themes/bp-default/groups/create.php:268
4883
  msgid "Back to Previous Step"
4884
  msgstr ""
4885
 
4886
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:268
4887
  #: bp-themes/bp-default/groups/create.php:275
4888
  msgid "Next Step"
4889
  msgstr ""
4890
 
4891
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:275
4892
  #: bp-themes/bp-default/groups/create.php:282
4893
  msgid "Create Group and Continue"
4894
  msgstr ""
4895
 
4896
+ #: bp-templates/bp-legacy/buddypress/groups/create.php:282
4897
+ #: bp-themes/bp-default/groups/create.php:289
4898
+ msgid "Finish"
4899
+ msgstr ""
4900
+
4901
+ #: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:95
4902
  #: bp-themes/bp-default/groups/groups-loop.php:95
4903
  msgid "There were no groups found."
4904
  msgstr ""
4905
 
4906
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:19
4907
  #: bp-themes/bp-default/groups/index.php:35
4908
  msgid "All Groups <span>%s</span>"
4909
  msgstr ""
4910
 
4911
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:40
4912
+ #: bp-templates/bp-legacy/buddypress/members/single/groups.php:23
4913
  #: bp-themes/bp-default/groups/index.php:58
4914
  #: bp-themes/bp-default/members/single/groups.php:23
4915
  msgid "Most Members"
4916
  msgstr ""
4917
 
4918
+ #: bp-templates/bp-legacy/buddypress/groups/index.php:41
4919
+ #: bp-templates/bp-legacy/buddypress/members/single/groups.php:24
4920
  #: bp-themes/bp-default/groups/index.php:59
4921
  #: bp-themes/bp-default/members/single/groups.php:24
4922
  msgid "Newly Created"
4923
  msgstr ""
4924
 
4925
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:25
4926
  #: bp-themes/bp-default/groups/single/admin.php:25
4927
  msgid "Notify group members of changes via email"
4928
  msgstr ""
4929
 
4930
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:137
4931
  #: bp-themes/bp-default/groups/single/admin.php:137
4932
  msgid "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button."
4933
  msgstr ""
4934
 
4935
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:139
4936
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24
4937
  #: bp-themes/bp-default/groups/single/admin.php:139
4938
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:24
4939
  msgid "Delete Avatar"
4940
  msgstr ""
4941
 
4942
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:149
4943
  #: bp-themes/bp-default/groups/single/admin.php:149
4944
  msgid "Crop Avatar"
4945
  msgstr ""
4946
 
4947
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:260
 
 
 
 
 
 
 
4948
  #: bp-themes/bp-default/groups/single/admin.php:260
4949
  msgid "(banned)"
4950
  msgstr ""
4951
 
4952
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266
4953
  #: bp-themes/bp-default/groups/single/admin.php:266
4954
  msgid "Unban this member"
4955
  msgstr ""
4956
 
4957
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266
4958
  #: bp-themes/bp-default/groups/single/admin.php:266
4959
  msgid "Remove Ban"
4960
  msgstr ""
4961
 
4962
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270
4963
  #: bp-themes/bp-default/groups/single/admin.php:270
4964
  msgid "Kick and ban this member"
4965
  msgstr ""
4966
 
4967
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270
4968
  #: bp-themes/bp-default/groups/single/admin.php:270
4969
  msgid "Kick &amp; Ban"
4970
  msgstr ""
4971
 
4972
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:271
4973
  #: bp-themes/bp-default/groups/single/admin.php:271
4974
  msgid "Promote to Mod"
4975
  msgstr ""
4976
 
4977
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:276
4978
  #: bp-themes/bp-default/groups/single/admin.php:276
4979
  msgid "Remove this member"
4980
  msgstr ""
4981
 
4982
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:276
4983
  #: bp-themes/bp-default/groups/single/admin.php:276
4984
  msgid "Remove from group"
4985
  msgstr ""
4986
 
4987
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:290
4988
+ #: bp-templates/bp-legacy/buddypress/groups/single/members.php:87
4989
  #: bp-themes/bp-default/groups/single/admin.php:290
4990
  #: bp-themes/bp-default/groups/single/members.php:87
4991
  msgid "This group has no members."
4992
  msgstr ""
4993
 
4994
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:320
4995
+ #: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:37
4996
+ #: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:23
4997
  #: bp-themes/bp-default/groups/single/admin.php:320
4998
  #: bp-themes/bp-default/members/single/friends/requests.php:37
4999
  #: bp-themes/bp-default/members/single/groups/invites.php:23
5000
  msgid "Accept"
5001
  msgstr ""
5002
 
5003
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:322
5004
+ #: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:38
5005
+ #: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:24
5006
  #: bp-themes/bp-default/groups/single/admin.php:322
5007
  #: bp-themes/bp-default/members/single/friends/requests.php:38
5008
  #: bp-themes/bp-default/members/single/groups/invites.php:24
5009
  msgid "Reject"
5010
  msgstr ""
5011
 
5012
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:335
5013
  #: bp-themes/bp-default/groups/single/admin.php:335
5014
  msgid "There are no pending membership requests."
5015
  msgstr ""
5016
 
5017
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:352
5018
  #: bp-themes/bp-default/groups/single/admin.php:352
5019
  msgid "WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option."
5020
  msgstr ""
5021
 
5022
+ #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:355
5023
  #: bp-themes/bp-default/groups/single/admin.php:355
5024
  msgid "I understand the consequences of deleting this group."
5025
  msgstr ""
5026
 
5027
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:16
5028
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:17
5029
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:27
5030
  #: bp-themes/bp-default/groups/single/forum/edit.php:16
5031
  #: bp-themes/bp-default/groups/single/forum/topic.php:17
5032
  #: bp-themes/bp-default/groups/single/forum.php:27
5033
  msgid "Forum Directory"
5034
  msgstr ""
5035
 
5036
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:25
5037
  #: bp-themes/bp-default/groups/single/forum/edit.php:25
5038
  msgid "Edit:"
5039
  msgstr ""
5040
 
5041
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:87
5042
  #: bp-themes/bp-default/groups/single/forum/edit.php:87
5043
  msgid "This topic does not exist."
5044
  msgstr ""
5045
 
5046
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:9
5047
  #: bp-themes/bp-default/groups/single/forum/topic.php:9
5048
  msgid "New Reply"
5049
  msgstr ""
5050
 
5051
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:32
5052
  #: bp-themes/bp-default/groups/single/forum/topic.php:32
5053
  msgid "Topic tags:"
5054
  msgstr ""
5055
 
5056
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:81
5057
  #: bp-themes/bp-default/groups/single/forum/topic.php:81
5058
  msgid "%1$s said %2$s:"
5059
  msgstr ""
5060
 
5061
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:119
 
 
 
5062
  #: bp-themes/bp-default/groups/single/forum/topic.php:119
5063
  msgid "There are no posts for this topic."
5064
  msgstr ""
5065
 
5066
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:134
5067
  #: bp-themes/bp-default/groups/single/forum/topic.php:134
5068
  msgid "You will auto join this group when you reply to this topic."
5069
  msgstr ""
5070
 
5071
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:139
5072
  #: bp-themes/bp-default/groups/single/forum/topic.php:139
5073
  msgid "Add a reply:"
5074
  msgstr ""
5075
 
5076
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:144
5077
  #: bp-themes/bp-default/groups/single/forum/topic.php:144
5078
  msgid "Post Reply"
5079
  msgstr ""
5080
 
5081
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:155
5082
  #: bp-themes/bp-default/groups/single/forum/topic.php:155
5083
  msgid "This topic is closed, replies are no longer accepted."
5084
  msgstr ""
5085
 
5086
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:69
5087
  #: bp-themes/bp-default/groups/single/forum.php:69
5088
  msgid "You will auto join this group when you start a new topic."
5089
  msgstr ""
5090
 
5091
+ #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:73
5092
  #: bp-themes/bp-default/groups/single/forum.php:73
5093
  msgid "Post a New Topic:"
5094
  msgstr ""
5095
 
5096
+ #: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:11
5097
  #: bp-themes/bp-default/groups/single/group-header.php:11
5098
  msgid "Group Admins"
5099
  msgstr ""
5100
 
5101
+ #: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:20
5102
  #: bp-themes/bp-default/groups/single/group-header.php:20
5103
  msgid "Group Mods"
5104
  msgstr ""
5105
 
5106
+ #: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:4
5107
  #: bp-themes/bp-default/groups/single/request-membership.php:4
5108
  msgid "You are requesting to become a member of the group '%s'."
5109
  msgstr ""
5110
 
5111
+ #: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:7
5112
  #: bp-themes/bp-default/groups/single/request-membership.php:7
5113
  msgid "Comments (optional)"
5114
  msgstr ""
5115
 
5116
+ #: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:12
5117
  #: bp-themes/bp-default/groups/single/request-membership.php:12
5118
  msgid "Send Request"
5119
  msgstr ""
5120
 
5121
+ #: bp-templates/bp-legacy/buddypress/members/activate.php:14
5122
+ #: bp-themes/bp-default/registration/activate.php:23
5123
+ msgid "Your account was activated successfully! Your account details have been sent to you in a separate email."
 
 
 
 
 
 
 
 
 
5124
  msgstr ""
5125
 
5126
+ #: bp-templates/bp-legacy/buddypress/members/activate.php:16
5127
+ #: bp-themes/bp-default/registration/activate.php:25
5128
+ msgid "Your account was activated successfully! You can now log in with the username and password you provided when you signed up."
5129
  msgstr ""
5130
 
5131
+ #: bp-templates/bp-legacy/buddypress/members/activate.php:21
5132
+ #: bp-themes/bp-default/registration/activate.php:30
5133
+ msgid "Please provide a valid activation key."
5134
  msgstr ""
5135
 
5136
+ #: bp-templates/bp-legacy/buddypress/members/activate.php:25
5137
+ #: bp-themes/bp-default/registration/activate.php:34
5138
+ msgid "Activation Key:"
5139
  msgstr ""
5140
 
5141
+ #: bp-templates/bp-legacy/buddypress/members/index.php:36
5142
+ #: bp-templates/bp-legacy/buddypress/members/single/friends.php:23
5143
  #: bp-themes/bp-default/members/index.php:56
5144
  #: bp-themes/bp-default/members/single/friends.php:23
5145
  msgid "Newest Registered"
5146
  msgstr ""
5147
 
5148
+ #: bp-templates/bp-legacy/buddypress/members/members-loop.php:108
5149
  #: bp-themes/bp-default/members/members-loop.php:108
5150
  msgid "Sorry, no members were found."
5151
  msgstr ""
5152
 
5153
+ #: bp-templates/bp-legacy/buddypress/members/register.php:13
5154
+ #: bp-themes/bp-default/registration/register.php:16
5155
+ msgid "User registration is currently not allowed."
5156
+ msgstr ""
5157
+
5158
+ #: bp-templates/bp-legacy/buddypress/members/register.php:22
5159
+ #: bp-themes/bp-default/registration/register.php:27
5160
+ msgid "Registering for this site is easy, just fill in the fields below and we'll get a new account set up for you in no time."
5161
+ msgstr ""
5162
+
5163
+ #: bp-templates/bp-legacy/buddypress/members/register.php:30
5164
+ #: bp-themes/bp-default/registration/register.php:35
5165
+ msgid "Account Details"
5166
+ msgstr ""
5167
+
5168
+ #: bp-templates/bp-legacy/buddypress/members/register.php:32
5169
+ #: bp-themes/bp-default/registration/register.php:37
5170
+ #: bp-themes/bp-default/sidebar.php:44
5171
+ msgid "Username"
5172
+ msgstr ""
5173
+
5174
+ #: bp-templates/bp-legacy/buddypress/members/register.php:32
5175
+ #: bp-templates/bp-legacy/buddypress/members/register.php:36
5176
+ #: bp-templates/bp-legacy/buddypress/members/register.php:40
5177
+ #: bp-templates/bp-legacy/buddypress/members/register.php:44
5178
+ #: bp-templates/bp-legacy/buddypress/members/register.php:71
5179
+ #: bp-templates/bp-legacy/buddypress/members/register.php:79
5180
+ #: bp-templates/bp-legacy/buddypress/members/register.php:87
5181
+ #: bp-templates/bp-legacy/buddypress/members/register.php:97
5182
+ #: bp-templates/bp-legacy/buddypress/members/register.php:108
5183
+ #: bp-templates/bp-legacy/buddypress/members/register.php:123
5184
+ #: bp-templates/bp-legacy/buddypress/members/register.php:134
5185
+ #: bp-templates/bp-legacy/buddypress/members/register.php:207
5186
+ #: bp-templates/bp-legacy/buddypress/members/register.php:216
5187
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:26
5188
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:33
5189
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:40
5190
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:49
5191
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:67
5192
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:83
5193
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:93
5194
+ #: bp-themes/bp-default/members/single/profile/edit.php:26
5195
+ #: bp-themes/bp-default/members/single/profile/edit.php:33
5196
+ #: bp-themes/bp-default/members/single/profile/edit.php:40
5197
+ #: bp-themes/bp-default/members/single/profile/edit.php:49
5198
+ #: bp-themes/bp-default/members/single/profile/edit.php:67
5199
+ #: bp-themes/bp-default/members/single/profile/edit.php:83
5200
+ #: bp-themes/bp-default/members/single/profile/edit.php:93
5201
+ #: bp-themes/bp-default/registration/register.php:37
5202
+ #: bp-themes/bp-default/registration/register.php:41
5203
+ #: bp-themes/bp-default/registration/register.php:45
5204
+ #: bp-themes/bp-default/registration/register.php:49
5205
+ #: bp-themes/bp-default/registration/register.php:76
5206
+ #: bp-themes/bp-default/registration/register.php:84
5207
+ #: bp-themes/bp-default/registration/register.php:92
5208
+ #: bp-themes/bp-default/registration/register.php:102
5209
+ #: bp-themes/bp-default/registration/register.php:113
5210
+ #: bp-themes/bp-default/registration/register.php:128
5211
+ #: bp-themes/bp-default/registration/register.php:139
5212
+ #: bp-themes/bp-default/registration/register.php:212
5213
+ #: bp-themes/bp-default/registration/register.php:221
5214
+ msgid "(required)"
5215
+ msgstr ""
5216
+
5217
+ #: bp-templates/bp-legacy/buddypress/members/register.php:36
5218
+ #: bp-themes/bp-default/registration/register.php:41
5219
+ msgid "Email Address"
5220
+ msgstr ""
5221
+
5222
+ #: bp-templates/bp-legacy/buddypress/members/register.php:40
5223
+ #: bp-themes/bp-default/registration/register.php:45
5224
+ msgid "Choose a Password"
5225
+ msgstr ""
5226
+
5227
+ #: bp-templates/bp-legacy/buddypress/members/register.php:44
5228
+ #: bp-themes/bp-default/registration/register.php:49
5229
+ msgid "Confirm Password"
5230
+ msgstr ""
5231
+
5232
+ #: bp-templates/bp-legacy/buddypress/members/register.php:60
5233
+ #: bp-themes/bp-default/registration/register.php:65
5234
+ msgid "Profile Details"
5235
+ msgstr ""
5236
+
5237
+ #: bp-templates/bp-legacy/buddypress/members/register.php:114
5238
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:58
5239
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:73
5240
+ #: bp-themes/bp-default/members/single/profile/edit.php:58
5241
+ #: bp-themes/bp-default/members/single/profile/edit.php:73
5242
+ #: bp-themes/bp-default/registration/register.php:119
5243
+ #: bp-xprofile/bp-xprofile-admin.php:415
5244
+ msgid "Clear"
5245
+ msgstr ""
5246
+
5247
+ #: bp-templates/bp-legacy/buddypress/members/register.php:156
5248
+ #: bp-templates/bp-legacy/buddypress/members/register.php:171
5249
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:120
5250
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:134
5251
+ #: bp-themes/bp-default/members/single/profile/edit.php:120
5252
+ #: bp-themes/bp-default/members/single/profile/edit.php:134
5253
+ #: bp-themes/bp-default/registration/register.php:161
5254
+ #: bp-themes/bp-default/registration/register.php:176
5255
+ msgid "This field can be seen by: <span class=\"current-visibility-level\">%s</span>"
5256
+ msgstr ""
5257
+
5258
+ #: bp-templates/bp-legacy/buddypress/members/register.php:156
5259
+ #: bp-themes/bp-default/registration/register.php:161
5260
+ msgctxt "Change profile field visibility level"
5261
+ msgid "Change"
5262
+ msgstr ""
5263
+
5264
+ #: bp-templates/bp-legacy/buddypress/members/register.php:161
5265
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:125
5266
+ #: bp-themes/bp-default/members/single/profile/edit.php:125
5267
+ #: bp-themes/bp-default/registration/register.php:166
5268
+ msgid "Who can see this field?"
5269
+ msgstr ""
5270
+
5271
+ #: bp-templates/bp-legacy/buddypress/members/register.php:201
5272
+ #: bp-themes/bp-default/registration/register.php:206
5273
+ msgid "Blog Details"
5274
+ msgstr ""
5275
+
5276
+ #: bp-templates/bp-legacy/buddypress/members/register.php:203
5277
+ #: bp-themes/bp-default/registration/register.php:208
5278
+ msgid "Yes, I'd like to create a new site"
5279
+ msgstr ""
5280
+
5281
+ #: bp-templates/bp-legacy/buddypress/members/register.php:207
5282
+ #: bp-themes/bp-default/registration/register.php:212
5283
+ msgid "Blog URL"
5284
+ msgstr ""
5285
+
5286
+ #: bp-templates/bp-legacy/buddypress/members/register.php:216
5287
+ #: bp-themes/bp-default/registration/register.php:221
5288
+ msgid "Site Title"
5289
+ msgstr ""
5290
+
5291
+ #: bp-templates/bp-legacy/buddypress/members/register.php:237
5292
+ #: bp-themes/bp-default/registration/register.php:242
5293
+ msgid "Complete Sign Up"
5294
+ msgstr ""
5295
+
5296
+ #: bp-templates/bp-legacy/buddypress/members/register.php:252
5297
+ #: bp-themes/bp-default/registration/register.php:259
5298
+ msgid "You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address."
5299
+ msgstr ""
5300
+
5301
+ #: bp-templates/bp-legacy/buddypress/members/register.php:254
5302
+ #: bp-themes/bp-default/registration/register.php:261
5303
+ msgid "You have successfully created your account! Please log in using the username and password you have just created."
5304
+ msgstr ""
5305
+
5306
+ #: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:68
5307
  #: bp-themes/bp-default/members/single/friends/requests.php:68
5308
  msgid "You have no pending friendship requests."
5309
  msgstr ""
5310
 
5311
+ #: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:37
5312
  #: bp-themes/bp-default/members/single/groups/invites.php:37
5313
  msgid "You have no outstanding group invites."
5314
  msgstr ""
5315
 
5316
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:5
5317
  #: bp-themes/bp-default/members/single/messages/compose.php:5
5318
  msgid "Send To (Username or Friend's Name)"
5319
  msgstr ""
5320
 
5321
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:14
5322
  #: bp-themes/bp-default/members/single/messages/compose.php:14
5323
  msgid "This is a notice to all users."
5324
  msgstr ""
5325
 
5326
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:17
5327
  #: bp-themes/bp-default/members/single/messages/compose.php:17
5328
  msgid "Subject"
5329
  msgstr ""
5330
 
5331
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:20
5332
  #: bp-themes/bp-default/members/single/messages/compose.php:20
5333
  msgid "Message"
5334
  msgstr ""
5335
 
5336
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:28
5337
  #: bp-themes/bp-default/members/single/messages/compose.php:28
5338
  msgid "Send Message"
5339
  msgstr ""
5340
 
5341
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:32
5342
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:32
5343
  msgid "From:"
5344
  msgstr ""
5345
 
5346
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:37
5347
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:37
5348
  msgid "To:"
5349
  msgstr ""
5350
 
5351
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:43
5352
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:43
5353
  msgid "View Message"
5354
  msgstr ""
5355
 
5356
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51
5357
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:43
5358
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24
5359
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:51
5360
  #: bp-themes/bp-default/members/single/messages/notices-loop.php:43
5361
  #: bp-themes/bp-default/members/single/messages/single.php:24
5362
  msgid "Delete Message"
5363
  msgstr ""
5364
 
5365
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:69
5366
  #: bp-themes/bp-default/members/single/messages/messages-loop.php:69
5367
  msgid "Sorry, no messages were found."
5368
  msgstr ""
5369
 
5370
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:36
5371
  #: bp-themes/bp-default/members/single/messages/notices-loop.php:36
5372
  msgid "Sent:"
5373
  msgstr ""
5374
 
5375
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:54
5376
  #: bp-themes/bp-default/members/single/messages/notices-loop.php:54
5377
  msgid "Sorry, no notices were found."
5378
  msgstr ""
5379
 
5380
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:14
5381
  #: bp-themes/bp-default/members/single/messages/single.php:14
5382
  msgid "You are alone in this conversation."
5383
  msgstr ""
5384
 
5385
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:18
5386
  #: bp-themes/bp-default/members/single/messages/single.php:18
5387
  msgid "Conversation between %s and you."
5388
  msgstr ""
5389
 
5390
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:86
5391
  #: bp-themes/bp-default/members/single/messages/single.php:75
5392
  msgid "Send a Reply"
5393
  msgstr ""
5394
 
5395
+ #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:102
5396
  #: bp-themes/bp-default/members/single/messages/single.php:91
5397
  msgid "Send Reply"
5398
  msgstr ""
5399
 
5400
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:1
5401
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:1
5402
+ #: bp-xprofile/bp-xprofile-loader.php:196
5403
+ #: bp-xprofile/bp-xprofile-loader.php:253
5404
  msgid "Change Avatar"
5405
  msgstr ""
5406
 
5407
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:7
5408
  #: bp-themes/bp-default/members/single/profile/change-avatar.php:7
5409
  msgid "Your avatar will be used on your profile and throughout the site. If there is a <a href=\"http://gravatar.com\">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer."
5410
  msgstr ""
5411
 
5412
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:14
5413
+ #: bp-themes/bp-default/members/single/profile/change-avatar.php:14
5414
+ msgid "Click below to select a JPG, GIF or PNG format photo from your computer and then click 'Upload Image' to proceed."
5415
+ msgstr ""
5416
+
5417
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:23
5418
+ #: bp-themes/bp-default/members/single/profile/change-avatar.php:23
5419
+ msgid "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button."
5420
+ msgstr ""
5421
+
5422
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24
5423
+ #: bp-themes/bp-default/members/single/profile/change-avatar.php:24
5424
+ msgid "Delete My Avatar"
5425
+ msgstr ""
5426
+
5427
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:31
5428
+ #: bp-themes/bp-default/members/single/profile/change-avatar.php:31
5429
+ msgid "Crop Your New Avatar"
5430
+ msgstr ""
5431
+
5432
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:55
5433
+ #: bp-themes/bp-default/members/single/profile/change-avatar.php:55
5434
+ msgid "Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href=\"http://gravatar.com\">Gravatar</a> using the same email address as you used to register with this site."
5435
+ msgstr ""
5436
+
5437
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:10
5438
+ #: bp-themes/bp-default/members/single/profile/edit.php:10
5439
+ msgid "Editing '%s' Profile Group"
5440
+ msgstr ""
5441
+
5442
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:120
5443
+ #: bp-themes/bp-default/members/single/profile/edit.php:120
5444
+ msgid "Change"
5445
+ msgstr ""
5446
+
5447
+ #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
5448
+ #: bp-themes/bp-default/members/single/profile/profile-wp.php:8
5449
+ msgid "%s's Profile"
5450
+ msgstr ""
5451
+
5452
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:15
5453
+ #: bp-themes/bp-default/members/single/settings/capabilities.php:57
5454
+ msgid "This user is a spammer."
5455
+ msgstr ""
5456
+
5457
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:13
5458
+ #: bp-themes/bp-default/members/single/settings/delete-account.php:56
5459
+ msgid "Deleting your account will delete all of the content you have created. It will be completely irrecoverable."
5460
+ msgstr ""
5461
+
5462
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:17
5463
+ #: bp-themes/bp-default/members/single/settings/delete-account.php:60
5464
+ msgid "Deleting this account will delete all of the content it has created. It will be completely irrecoverable."
5465
+ msgstr ""
5466
+
5467
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:29
5468
+ #: bp-themes/bp-default/members/single/settings/delete-account.php:72
5469
+ msgid "I understand the consequences."
5470
+ msgstr ""
5471
+
5472
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:15
5473
+ #: bp-themes/bp-default/members/single/settings/general.php:57
5474
+ msgid "Current Password <span>(required to update email or change current password)</span>"
5475
+ msgstr ""
5476
+
5477
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:16
5478
+ #: bp-themes/bp-default/members/single/settings/general.php:58
5479
+ msgid "Password Lost and Found"
5480
+ msgstr ""
5481
+
5482
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:16
5483
+ #: bp-themes/bp-default/members/single/settings/general.php:58
5484
+ msgid "Lost your password?"
5485
+ msgstr ""
5486
+
5487
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:20
5488
+ #: bp-themes/bp-default/members/single/settings/general.php:62
5489
+ msgid "Account Email"
5490
+ msgstr ""
5491
+
5492
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:23
5493
+ #: bp-themes/bp-default/members/single/settings/general.php:65
5494
+ msgid "Change Password <span>(leave blank for no change)</span>"
5495
+ msgstr ""
5496
+
5497
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:24
5498
+ #: bp-themes/bp-default/members/single/settings/general.php:66
5499
+ msgid "New Password"
5500
+ msgstr ""
5501
+
5502
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:25
5503
+ #: bp-themes/bp-default/members/single/settings/general.php:67
5504
+ msgid "Repeat New Password"
5505
+ msgstr ""
5506
+
5507
+ #: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:12
5508
+ #: bp-themes/bp-default/members/single/settings/notifications.php:54
5509
+ msgid "Send a notification by email when:"
5510
+ msgstr ""
5511
+
5512
+ #: bp-templates/bp-legacy/buddypress-functions.php:63
5513
+ msgid "BuddyPress Legacy"
5514
+ msgstr ""
5515
+
5516
+ #: bp-templates/bp-legacy/buddypress-functions.php:251
5517
+ #: bp-themes/bp-default/functions.php:158
5518
+ msgid "My Favorites"
5519
+ msgstr ""
5520
+
5521
+ #: bp-templates/bp-legacy/buddypress-functions.php:252
5522
+ #: bp-themes/bp-default/functions.php:159
5523
+ msgid "Accepted"
5524
+ msgstr ""
5525
+
5526
+ #: bp-templates/bp-legacy/buddypress-functions.php:253
5527
+ #: bp-themes/bp-default/functions.php:160
5528
+ msgid "Rejected"
5529
+ msgstr ""
5530
+
5531
+ #: bp-templates/bp-legacy/buddypress-functions.php:254
5532
+ #: bp-themes/bp-default/functions.php:161
5533
+ msgid "Show all comments for this thread"
5534
+ msgstr ""
5535
+
5536
+ #: bp-templates/bp-legacy/buddypress-functions.php:255
5537
+ #: bp-themes/bp-default/functions.php:162
5538
+ msgid "Show all"
5539
+ msgstr ""
5540
+
5541
+ #: bp-templates/bp-legacy/buddypress-functions.php:256
5542
+ #: bp-themes/bp-default/functions.php:163
5543
+ msgid "comments"
5544
+ msgstr ""
5545
+
5546
+ #: bp-templates/bp-legacy/buddypress-functions.php:569
5547
+ #: bp-themes/bp-default/_inc/ajax.php:278
5548
+ msgid "There was a problem posting your update, please try again."
5549
+ msgstr ""
5550
+
5551
+ #: bp-templates/bp-legacy/buddypress-functions.php:663
5552
+ #: bp-templates/bp-legacy/buddypress-functions.php:699
5553
+ #: bp-themes/bp-default/_inc/ajax.php:380
5554
+ #: bp-themes/bp-default/_inc/ajax.php:416
5555
+ msgid "There was a problem when deleting. Please try again."
5556
+ msgstr ""
5557
+
5558
+ #: bp-templates/bp-legacy/buddypress-functions.php:899
5559
+ #: bp-themes/bp-default/_inc/ajax.php:615
5560
+ msgid " Friendship could not be requested."
5561
+ msgstr ""
5562
+
5563
+ #: bp-templates/bp-legacy/buddypress-functions.php:911
5564
+ #: bp-themes/bp-default/_inc/ajax.php:627
5565
+ msgid "Friendship request could not be cancelled."
5566
+ msgstr ""
5567
+
5568
+ #: bp-templates/bp-legacy/buddypress-functions.php:916
5569
+ #: bp-themes/bp-default/_inc/ajax.php:632
5570
+ msgid "Request Pending"
5571
+ msgstr ""
5572
+
5573
+ #: bp-templates/bp-legacy/buddypress-functions.php:936
5574
+ #: bp-themes/bp-default/_inc/ajax.php:652
5575
+ msgid "There was a problem accepting that request. Please try again."
5576
+ msgstr ""
5577
+
5578
+ #: bp-templates/bp-legacy/buddypress-functions.php:955
5579
+ #: bp-themes/bp-default/_inc/ajax.php:671
5580
+ msgid "There was a problem rejecting that request. Please try again."
5581
+ msgstr ""
5582
+
5583
+ #: bp-templates/bp-legacy/buddypress-functions.php:985
5584
+ #: bp-themes/bp-default/_inc/ajax.php:701
5585
+ msgid "Error joining group"
5586
+ msgstr ""
5587
+
5588
+ #: bp-templates/bp-legacy/buddypress-functions.php:994
5589
+ #: bp-themes/bp-default/_inc/ajax.php:710
5590
+ msgid "Error requesting membership"
5591
+ msgstr ""
5592
+
5593
+ #: bp-templates/bp-legacy/buddypress-functions.php:996
5594
+ #: bp-themes/bp-default/_inc/ajax.php:712
5595
+ msgid "Membership Requested"
5596
+ msgstr ""
5597
+
5598
+ #: bp-templates/bp-legacy/buddypress-functions.php:1004
5599
+ #: bp-themes/bp-default/_inc/ajax.php:720
5600
+ msgid "Error leaving group"
5601
+ msgstr ""
5602
+
5603
+ #: bp-templates/bp-legacy/buddypress-functions.php:1027
5604
+ #: bp-themes/bp-default/_inc/ajax.php:743
5605
+ msgid "There was a problem closing the notice."
5606
+ msgstr ""
5607
+
5608
+ #: bp-templates/bp-legacy/buddypress-functions.php:1090
5609
+ #: bp-themes/bp-default/_inc/ajax.php:794
5610
+ msgid "There was a problem sending that reply. Please try again."
5611
+ msgstr ""
5612
+
5613
+ #: bp-templates/bp-legacy/buddypress-functions.php:1108
5614
+ #: bp-themes/bp-default/_inc/ajax.php:812
5615
+ msgid "There was a problem marking messages as unread."
5616
+ msgstr ""
5617
+
5618
+ #: bp-templates/bp-legacy/buddypress-functions.php:1133
5619
+ #: bp-themes/bp-default/_inc/ajax.php:837
5620
+ msgid "There was a problem marking messages as read."
5621
+ msgstr ""
5622
+
5623
+ #: bp-templates/bp-legacy/buddypress-functions.php:1158
5624
+ #: bp-themes/bp-default/_inc/ajax.php:862
5625
+ msgid "There was a problem deleting messages."
5626
+ msgstr ""
5627
+
5628
+ #: bp-themes/bp-default/404.php:7
5629
+ msgid "Page not found"
5630
+ msgstr ""
5631
+
5632
+ #: bp-themes/bp-default/404.php:9
5633
+ msgid "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help."
5634
+ msgstr ""
5635
+
5636
+ #: bp-themes/bp-default/activity/entry.php:37
5637
+ msgid "In reply to: "
5638
+ msgstr ""
5639
+
5640
+ #: bp-themes/bp-default/activity/entry.php:37
5641
+ msgid "View Thread / Permalink"
5642
+ msgstr ""
5643
+
5644
+ #: bp-themes/bp-default/activity/entry.php:104
5645
+ msgid "or press esc to cancel."
5646
+ msgstr ""
5647
+
5648
+ #: bp-themes/bp-default/activity/index.php:21
5649
+ msgid "Site Activity"
5650
+ msgstr ""
5651
+
5652
+ #: bp-themes/bp-default/archive.php:10
5653
+ msgid "You are browsing the archive for %1$s."
5654
+ msgstr ""
5655
+
5656
+ #: bp-themes/bp-default/archive.php:24 bp-themes/bp-default/attachment.php:18
5657
+ #: bp-themes/bp-default/index.php:24 bp-themes/bp-default/search.php:26
5658
+ #: bp-themes/bp-default/single.php:16
5659
+ msgctxt "Post written by..."
5660
+ msgid "by %s"
5661
+ msgstr ""
5662
+
5663
+ #: bp-themes/bp-default/archive.php:28 bp-themes/bp-default/attachment.php:22
5664
+ #: bp-themes/bp-default/index.php:32 bp-themes/bp-default/s