BuddyPress - Version 2.1-RC1

Version Description

= 2.1 = See: http://codex.buddypress.org/releases/version-2-1/

= 2.0.2 = See: http://codex.buddypress.org/releases/version-2-0-2/

= 2.0.1 = See: http://codex.buddypress.org/releases/version-2-0-1/

= 2.0 = See: http://codex.buddypress.org/releases/version-2-0/

= 1.9.2 = See: http://codex.buddypress.org/releases/version-1-9-2/

= 1.9.1 = See: http://codex.buddypress.org/releases/version-1-9-1/

= 1.9 = See: http://codex.buddypress.org/releases/version-1-9/

= 1.8.1 = See: http://codex.buddypress.org/releases/version-1-8-1/

= 1.8 = See: http://codex.buddypress.org/releases/version-1-8/

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

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

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

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

= 1.6.5 = See: http://codex.buddypress.org/releases/version-1-6-5/

= 1.6.4 = See: http://codex.buddypress.org/releases/version-1-6-4/

= 1.6.3 = See: http://codex.buddypress.org/releases/version-1-6-3/

= 1.6.2 = Compatibility with WordPress 3.5

= 1.6.1 = Fixes 4 bugs

= 1.6 = See: http://codex.buddypress.org/releases/version-1-6/

= 1.5 = See: http://codex.buddypress.org/releases/version-1-5/

= 1.2.9 = Compatibility with WordPress 3.2

= 1.2.8 = Compatibility with WordPress 3.1

= 1.2.7 = Fixes over 10 bugs.

Download this release

Release Info

Developer boonebgorges
Plugin Icon 128x128 BuddyPress
Version 2.1-RC1
Comparing to
See all releases

Code changes from version 2.0.3 to 2.1-RC1

Files changed (149) hide show
  1. bp-activity/admin/css/admin-rtl.css +80 -0
  2. bp-activity/admin/css/admin-rtl.min.css +2 -0
  3. bp-activity/admin/css/admin.css +1 -1
  4. bp-activity/admin/css/admin.min.css +2 -1
  5. bp-activity/admin/js/admin.js +9 -8
  6. bp-activity/admin/js/admin.min.js +2 -1
  7. bp-activity/bp-activity-actions.php +27 -2
  8. bp-activity/bp-activity-admin.php +45 -19
  9. bp-activity/bp-activity-classes.php +99 -20
  10. bp-activity/bp-activity-cssjs.php +48 -0
  11. bp-activity/bp-activity-filters.php +9 -2
  12. bp-activity/bp-activity-functions.php +382 -279
  13. bp-activity/bp-activity-loader.php +16 -15
  14. bp-activity/bp-activity-screens.php +2 -2
  15. bp-activity/bp-activity-template.php +504 -147
  16. bp-activity/css/mentions-rtl.css +80 -0
  17. bp-activity/css/mentions-rtl.min.css +2 -0
  18. bp-activity/css/mentions.css +80 -0
  19. bp-activity/css/mentions.min.css +2 -0
  20. bp-activity/js/mentions.js +204 -0
  21. bp-activity/js/mentions.min.js +2 -0
  22. bp-blogs/bp-blogs-activity.php +114 -40
  23. bp-blogs/bp-blogs-buddybar.php +0 -78
  24. bp-blogs/bp-blogs-classes.php +13 -9
  25. bp-blogs/bp-blogs-filters.php +16 -0
  26. bp-blogs/bp-blogs-functions.php +231 -54
  27. bp-blogs/bp-blogs-loader.php +18 -13
  28. bp-blogs/bp-blogs-screens.php +2 -2
  29. bp-blogs/bp-blogs-template.php +151 -117
  30. bp-core/admin/bp-core-functions.php +42 -26
  31. bp-core/admin/bp-core-schema.php +211 -122
  32. bp-core/admin/bp-core-settings.php +0 -29
  33. bp-core/admin/bp-core-tools.php +42 -1
  34. bp-core/admin/css/common-rtl.css +432 -0
  35. bp-core/admin/css/common-rtl.min.css +2 -0
  36. bp-core/admin/css/common.css +33 -34
  37. bp-core/admin/css/common.min.css +2 -1
  38. bp-core/admin/images/icons32.png +0 -0
  39. bp-core/admin/images/icons64.png +0 -0
  40. bp-core/admin/images/mentions.gif +0 -0
  41. bp-core/admin/images/menu-2x.png +0 -0
  42. bp-core/admin/images/menu-wp.png +0 -0
  43. bp-core/admin/images/menu.png +0 -0
  44. bp-core/bp-core-actions.php +1 -0
  45. bp-core/bp-core-admin.php +221 -147
  46. bp-core/bp-core-adminbar.php +32 -13
  47. bp-core/bp-core-avatars.php +16 -3
  48. bp-core/bp-core-buddybar.php +88 -221
  49. bp-core/bp-core-caps.php +27 -0
  50. bp-core/bp-core-catchuri.php +38 -19
  51. bp-core/bp-core-classes.php +335 -49
  52. bp-core/bp-core-component.php +38 -27
  53. bp-core/bp-core-cssjs.php +126 -17
  54. bp-core/bp-core-dependency.php +7 -0
  55. bp-core/bp-core-filters.php +58 -7
  56. bp-core/bp-core-functions.php +213 -65
  57. bp-core/bp-core-loader.php +3 -3
  58. bp-core/bp-core-options.php +23 -14
  59. bp-core/bp-core-template-loader.php +8 -8
  60. bp-core/bp-core-template.php +522 -478
  61. bp-core/bp-core-theme-compatibility.php +3 -0
  62. bp-core/bp-core-update.php +5 -9
  63. bp-core/bp-core-widgets.php +4 -5
  64. bp-core/css/admin-bar-rtl.css +49 -18
  65. bp-core/css/admin-bar-rtl.min.css +2 -1
  66. bp-core/css/admin-bar.css +1 -1
  67. bp-core/css/admin-bar.min.css +2 -1
  68. bp-core/css/buddybar-rtl.css +141 -15
  69. bp-core/css/buddybar-rtl.min.css +2 -1
  70. bp-core/css/buddybar.css +4 -4
  71. bp-core/css/buddybar.min.css +2 -1
  72. bp-members/bp-members-notifications.php → bp-core/deprecated/1.9.php +40 -43
  73. bp-core/deprecated/2.1.php +636 -0
  74. bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.css +80 -0
  75. bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.min.css +2 -0
  76. {bp-messages → bp-core/deprecated}/css/autocomplete/jquery.autocompletefb.css +0 -5
  77. bp-core/deprecated/css/autocomplete/jquery.autocompletefb.min.css +2 -0
  78. {bp-messages → bp-core/deprecated}/js/autocomplete/jquery.autocomplete.js +0 -0
  79. bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js +2 -0
  80. {bp-messages → bp-core/deprecated}/js/autocomplete/jquery.autocompletefb.js +0 -0
  81. bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js +2 -0
  82. {bp-messages → bp-core/deprecated}/js/autocomplete/jquery.bgiframe.js +0 -0
  83. bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js +2 -0
  84. {bp-messages → bp-core/deprecated}/js/autocomplete/jquery.dimensions.js +0 -0
  85. bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js +2 -0
  86. {bp-messages → bp-core/deprecated}/js/autocomplete/license.bgiframe.txt +0 -0
  87. bp-core/deprecated/js/jquery-scroll-to.js +208 -0
  88. bp-core/deprecated/js/jquery-scroll-to.min.js +2 -0
  89. bp-core/images/60pc_black.png +0 -0
  90. bp-core/images/Jcrop.gif +0 -0
  91. bp-core/images/admin-menu-arrow.gif +0 -0
  92. bp-core/images/bp20/admin-xprofile.jpg +0 -0
  93. bp-core/images/bp20/load-newest.jpg +0 -0
  94. bp-core/images/bp20/performance.png +0 -0
  95. bp-core/images/bp20/tools-buddypress.jpg +0 -0
  96. bp-core/images/bp20/user-mark-spam.jpg +0 -0
  97. bp-core/images/bp20/users-pending.jpg +0 -0
  98. bp-core/images/mystery-man-50.jpg +0 -0
  99. bp-core/images/mystery-man.jpg +0 -0
  100. bp-core/js/confirm.js +8 -3
  101. bp-core/js/confirm.min.js +2 -1
  102. bp-core/js/jquery-cookie.js +120 -0
  103. bp-core/js/jquery-cookie.min.js +2 -0
  104. bp-core/js/jquery-query.js +6 -0
  105. bp-core/js/jquery-query.min.js +2 -0
  106. bp-core/js/jquery.atwho.js +824 -0
  107. bp-core/js/jquery.atwho.min.js +2 -0
  108. bp-core/js/jquery.atwho.txt +22 -0
  109. bp-core/js/jquery.caret.js +366 -0
  110. bp-core/js/jquery.caret.min.js +2 -0
  111. bp-core/js/jquery.caret.txt +22 -0
  112. bp-core/js/widget-members.js +11 -11
  113. bp-core/js/widget-members.min.js +2 -1
  114. bp-forums/bp-forums-screens.php +1 -1
  115. bp-forums/bp-forums-template.php +2 -2
  116. bp-friends/bp-friends-activity.php +6 -2
  117. bp-friends/bp-friends-classes.php +17 -11
  118. bp-friends/bp-friends-filters.php +8 -1
  119. bp-friends/bp-friends-functions.php +54 -1
  120. bp-friends/bp-friends-loader.php +9 -9
  121. bp-friends/bp-friends-screens.php +3 -3
  122. bp-friends/bp-friends-template.php +4 -9
  123. bp-friends/bp-friends-widgets.php +7 -0
  124. bp-friends/js/widget-friends.js +12 -12
  125. bp-friends/js/widget-friends.min.js +2 -1
  126. bp-groups/admin/css/admin-rtl.css +86 -0
  127. bp-groups/admin/css/admin-rtl.min.css +2 -0
  128. bp-groups/admin/css/admin.css +33 -3
  129. bp-groups/admin/css/admin.min.css +2 -1
  130. bp-groups/admin/js/admin.js +24 -12
  131. bp-groups/admin/js/admin.min.js +2 -1
  132. bp-groups/bp-groups-actions.php +79 -2
  133. bp-groups/bp-groups-activity.php +26 -6
  134. bp-groups/bp-groups-admin.php +115 -104
  135. bp-groups/bp-groups-adminbar.php +2 -2
  136. bp-groups/bp-groups-buddybar.php +0 -67
  137. bp-groups/bp-groups-cache.php +29 -0
  138. bp-groups/bp-groups-classes.php +530 -57
  139. bp-groups/bp-groups-filters.php +48 -22
  140. bp-groups/bp-groups-forums.php +174 -147
  141. bp-groups/bp-groups-functions.php +1 -1
  142. bp-groups/bp-groups-loader.php +72 -99
  143. bp-groups/bp-groups-notifications.php +129 -68
  144. bp-groups/bp-groups-screens.php +24 -24
  145. bp-groups/bp-groups-template.php +415 -138
  146. bp-groups/bp-groups-widgets.php +11 -2
  147. bp-groups/js/widget-groups.js +11 -11
  148. bp-groups/js/widget-groups.min.js +2 -1
  149. bp-languages/buddypress.pot +0 -5819
bp-activity/admin/css/admin-rtl.css ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .akismet-status {
2
+ float: left;
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: left;
42
+ padding: 4px 10px 0;
43
+ vertical-align: top;
44
+ }
45
+ #bp-activities-form .column-response img {
46
+ float: right;
47
+ margin-left: 10px;
48
+ margin-top: 1px;
49
+ }
50
+ .activity-errors {
51
+ list-style-type: disc;
52
+ margin-right: 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
+ }
78
+ .column-action {
79
+ width: 12%;
80
+ }
bp-activity/admin/css/admin-rtl.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ .akismet-status{float:left}.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:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right: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:#fff}#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}.column-action{width:12%}
bp-activity/admin/css/admin.css CHANGED
@@ -77,4 +77,4 @@
77
  }
78
  .column-action {
79
  width: 12%;
80
- }
77
  }
78
  .column-action {
79
  width: 12%;
80
+ }
bp-activity/admin/css/admin.min.css CHANGED
@@ -1 +1,2 @@
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}.column-action{width:12%}
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ .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:#fff}#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}.column-action{width:12%}
bp-activity/admin/js/admin.js CHANGED
@@ -1,3 +1,4 @@
 
1
  (function( $ ) {
2
 
3
  /**
@@ -19,7 +20,7 @@ var activityReply = {
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
  });
@@ -30,7 +31,7 @@ var activityReply = {
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 );
@@ -47,9 +48,9 @@ var activityReply = {
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();
@@ -67,7 +68,7 @@ var activityReply = {
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();
@@ -123,7 +124,7 @@ var activityReply = {
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
  }
@@ -136,7 +137,7 @@ var activityReply = {
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();
@@ -169,4 +170,4 @@ $(document).ready( function () {
169
  postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
170
  });
171
 
172
- })(jQuery);
1
+ /* global bp_activity_admin_vars, postboxes, wpAjax */
2
  (function( $ ) {
3
 
4
  /**
20
 
21
  // Close textarea on escape
22
  $(document).on( 'keyup', '#bp-activities:visible', function( e ) {
23
+ if ( 27 === e.which ) {
24
  activityReply.close();
25
  }
26
  });
31
  *
32
  * @since BuddyPress (1.6)
33
  */
34
+ open : function() {
35
  // Hide the container row, and move it to the new location
36
  var box = $( '#bp-activities-container' ).hide();
37
  $( this ).parents( 'tr' ).after( box );
48
  *
49
  * @since BuddyPress (1.6)
50
  */
51
+ close : function() {
52
  // Hide the container row
53
+ $('#bp-activities-container').fadeOut( '200', function () {
54
 
55
  // Empty and unfocus the text area
56
  $( '#bp-activities' ).val( '' ).blur();
68
  *
69
  * @since BuddyPress (1.6)
70
  */
71
+ send : function() {
72
  // Hide any existing error message, and show the loading spinner
73
  $( '#bp-replysubmit .error' ).hide();
74
  $( '#bp-replysubmit .waiting' ).show();
124
  var bg, id, response;
125
 
126
  // Handle any errors in the response
127
+ if ( typeof( xml ) === 'string' ) {
128
  activityReply.error( { 'responseText': xml } );
129
  return false;
130
  }
137
  response = response.responses[0];
138
 
139
  // Close and reset the reply row, and add the new Activity item into the list.
140
+ $('#bp-activities-container').fadeOut( '200', function () {
141
 
142
  // Empty and unfocus the text area
143
  $( '#bp-activities' ).val( '' ).blur();
170
  postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
171
  });
172
 
173
+ })(jQuery);
bp-activity/admin/js/admin.min.js CHANGED
@@ -1 +1,2 @@
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");postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})})(jQuery);
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
bp-activity/bp-activity-actions.php CHANGED
@@ -437,7 +437,7 @@ function bp_activity_action_sitewide_feed() {
437
  'id' => 'sitewide',
438
 
439
  /* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */
440
- 'title' => sprintf( __( '%s | Site Wide Activity', 'buddypress' ), bp_get_site_name() ),
441
 
442
  'link' => bp_get_activity_directory_permalink(),
443
  'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
@@ -540,7 +540,7 @@ function bp_activity_action_my_groups_feed() {
540
  'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
541
 
542
  'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),
543
- 'description' => sprintf( __( "Public group activity feed of which %s is a member of.", 'buddypress' ), bp_get_displayed_user_fullname() ),
544
  'activity_args' => array(
545
  'object' => buddypress()->groups->id,
546
  'primary_id' => $group_ids,
@@ -647,3 +647,28 @@ function bp_activity_setup_akismet() {
647
  // Instantiate Akismet for BuddyPress
648
  $bp->activity->akismet = new BP_Akismet();
649
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  'id' => 'sitewide',
438
 
439
  /* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */
440
+ 'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
441
 
442
  'link' => bp_get_activity_directory_permalink(),
443
  'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
540
  'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
541
 
542
  'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),
543
+ 'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
544
  'activity_args' => array(
545
  'object' => buddypress()->groups->id,
546
  'primary_id' => $group_ids,
647
  // Instantiate Akismet for BuddyPress
648
  $bp->activity->akismet = new BP_Akismet();
649
  }
650
+
651
+ /**
652
+ * AJAX endpoint for Suggestions API lookups.
653
+ *
654
+ * @since BuddyPress (2.1.0)
655
+ */
656
+ function bp_ajax_get_suggestions() {
657
+ if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) {
658
+ wp_send_json_error( 'missing_parameter' );
659
+ exit;
660
+ }
661
+
662
+ $results = bp_core_get_suggestions( array(
663
+ 'term' => sanitize_text_field( $_GET['term'] ),
664
+ 'type' => sanitize_text_field( $_GET['type'] ),
665
+ ) );
666
+
667
+ if ( is_wp_error( $results ) ) {
668
+ wp_send_json_error( $results->get_error_message() );
669
+ exit;
670
+ }
671
+
672
+ wp_send_json_success( $results );
673
+ }
674
+ add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
bp-activity/bp-activity-admin.php CHANGED
@@ -29,8 +29,8 @@ function bp_activity_add_admin_menu() {
29
 
30
  // Add our screen
31
  $hook = add_menu_page(
32
- __( 'Activity', 'buddypress' ),
33
- __( 'Activity', 'buddypress' ),
34
  'bp_moderate',
35
  'bp-activity',
36
  'bp_activity_admin',
@@ -220,7 +220,7 @@ function bp_activity_admin_load() {
220
  'title' => __( 'Item, Link, Type', 'buddypress' ),
221
  'content' =>
222
  '<p>' . __( '<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.', 'buddypress' ) . '</p>' .
223
- '<p>' . __( '<strong>Link</strong> - Activity generated by 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.', 'buddypress' ) . '</p>' .
224
  '<p>' . __( '<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.', 'buddypress' ) . '</p>' .
225
  '<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>'
226
  ) );
@@ -284,6 +284,12 @@ function bp_activity_admin_load() {
284
  ) );
285
  wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() );
286
 
 
 
 
 
 
 
287
  // Handle spam/un-spam/delete of activities
288
  if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
289
 
@@ -903,7 +909,7 @@ function bp_activity_admin_index() {
903
  <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
904
  <?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
905
  <?php else : ?>
906
- <?php _e( 'Activity', 'buddypress' ); ?>
907
  <?php endif; ?>
908
 
909
  <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
@@ -1057,6 +1063,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1057
  'display_comments' => 'stream',
1058
  'show_hidden' => true,
1059
  'spam' => 'spam_only',
 
1060
  ) );
1061
  $this->spam_count = $spams['total'];
1062
  unset( $spams );
@@ -1072,6 +1079,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1072
  'show_hidden' => true,
1073
  //'sort' => $sort,
1074
  'spam' => $spam,
 
1075
  ) );
1076
 
1077
  // If we're viewing a specific activity, flatten all activites into a single array.
@@ -1138,8 +1146,6 @@ class BP_Activity_List_Table extends WP_List_Table {
1138
  * @since BuddyPress (1.6.0)
1139
  */
1140
  function display() {
1141
- extract( $this->_args );
1142
-
1143
  $this->display_tablenav( 'top' ); ?>
1144
 
1145
  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
@@ -1238,10 +1244,10 @@ class BP_Activity_List_Table extends WP_List_Table {
1238
  function get_columns() {
1239
  return array(
1240
  'cb' => '<input name type="checkbox" />',
1241
- 'author' => __( 'Author', 'buddypress' ),
1242
- 'comment' => __( 'Activity', 'buddypress' ),
1243
- 'action' => __( 'Action', 'buddypress' ),
1244
- 'response' => __( 'In Response To', 'buddypress' ),
1245
  );
1246
  }
1247
 
@@ -1272,23 +1278,43 @@ class BP_Activity_List_Table extends WP_List_Table {
1272
  * @param string $which 'top' or 'bottom'.
1273
  */
1274
  function extra_tablenav( $which ) {
1275
- if ( 'bottom' == $which )
 
 
1276
  return;
 
1277
 
1278
- $selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : '';
 
1279
 
1280
- // Get all types of activities, and sort alphabetically.
1281
- $actions = bp_activity_get_types();
1282
- natsort( $actions );
1283
- ?>
1284
 
1285
  <div class="alignleft actions">
1286
  <select name="activity_type">
1287
- <option value="" <?php selected( !$selected ); ?>><?php _e( 'Show all activity types', 'buddypress' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1288
 
1289
- <?php foreach ( $actions as $k => $v ) : ?>
1290
- <option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option>
1291
  <?php endforeach; ?>
 
1292
  </select>
1293
 
1294
  <?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?>
29
 
30
  // Add our screen
31
  $hook = add_menu_page(
32
+ _x( 'Activity', 'Admin Dashbord SWA page title', 'buddypress' ),
33
+ _x( 'Activity', 'Admin Dashbord SWA menu', 'buddypress' ),
34
  'bp_moderate',
35
  'bp-activity',
36
  'bp_activity_admin',
220
  'title' => __( 'Item, Link, Type', 'buddypress' ),
221
  'content' =>
222
  '<p>' . __( '<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.', 'buddypress' ) . '</p>' .
223
+ '<p>' . __( '<strong>Link</strong> - Used by some types of activity (e.g blog posts and comments, and forum topics and replies) to store a link back to the original content.', 'buddypress' ) . '</p>' .
224
  '<p>' . __( '<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.', 'buddypress' ) . '</p>' .
225
  '<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>'
226
  ) );
284
  ) );
285
  wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() );
286
 
287
+ wp_style_add_data( 'bp_activity_admin_css', 'rtl', true );
288
+ if ( $min ) {
289
+ wp_style_add_data( 'bp_activity_admin_css', 'suffix', $min );
290
+ }
291
+
292
+
293
  // Handle spam/un-spam/delete of activities
294
  if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
295
 
909
  <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
910
  <?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
911
  <?php else : ?>
912
+ <?php _ex( 'Activity', 'Admin SWA page', 'buddypress' ); ?>
913
  <?php endif; ?>
914
 
915
  <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
1063
  'display_comments' => 'stream',
1064
  'show_hidden' => true,
1065
  'spam' => 'spam_only',
1066
+ 'count_total' => 'count_query',
1067
  ) );
1068
  $this->spam_count = $spams['total'];
1069
  unset( $spams );
1079
  'show_hidden' => true,
1080
  //'sort' => $sort,
1081
  'spam' => $spam,
1082
+ 'count_total' => 'count_query',
1083
  ) );
1084
 
1085
  // If we're viewing a specific activity, flatten all activites into a single array.
1146
  * @since BuddyPress (1.6.0)
1147
  */
1148
  function display() {
 
 
1149
  $this->display_tablenav( 'top' ); ?>
1150
 
1151
  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
1244
  function get_columns() {
1245
  return array(
1246
  'cb' => '<input name type="checkbox" />',
1247
+ 'author' => _x('Author', 'Admin SWA column header', 'buddypress' ),
1248
+ 'comment' => _x( 'Activity', 'Admin SWA column header', 'buddypress' ),
1249
+ 'action' => _x( 'Action', 'Admin SWA column header', 'buddypress' ),
1250
+ 'response' => _x( 'In Response To', 'Admin SWA column header', 'buddypress' ),
1251
  );
1252
  }
1253
 
1278
  * @param string $which 'top' or 'bottom'.
1279
  */
1280
  function extra_tablenav( $which ) {
1281
+
1282
+ // Bail on bottom table nav
1283
+ if ( 'bottom' === $which ) {
1284
  return;
1285
+ }
1286
 
1287
+ // Is any filter currently selected?
1288
+ $selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : '';
1289
 
1290
+ // Get the actions
1291
+ $activity_actions = buddypress()->activity->actions; ?>
 
 
1292
 
1293
  <div class="alignleft actions">
1294
  <select name="activity_type">
1295
+ <option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option>
1296
+
1297
+ <?php foreach ( $activity_actions as $component => $actions ) : ?>
1298
+
1299
+ <optgroup label="<?php echo ucfirst( $component ); ?>">
1300
+
1301
+ <?php foreach ( $actions as $action_key => $action_values ) : ?>
1302
+
1303
+ <?php
1304
+
1305
+ // Skip the incorrectly named pre-1.6 action
1306
+ if ( 'friends_register_activity_action' !== $action_key ) : ?>
1307
+
1308
+ <option value="<?php echo esc_attr( $action_key ); ?>" <?php selected( $action_key, $selected ); ?>><?php echo esc_html( $action_values[ 'value' ] ); ?></option>
1309
+
1310
+ <?php endif; ?>
1311
+
1312
+ <?php endforeach; ?>
1313
+
1314
+ </optgroup>
1315
 
 
 
1316
  <?php endforeach; ?>
1317
+
1318
  </select>
1319
 
1320
  <?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?>
bp-activity/bp-activity-classes.php CHANGED
@@ -146,10 +146,10 @@ class BP_Activity_Activity {
146
  }
147
 
148
  if ( ! empty( $row ) ) {
149
- $this->id = $row->id;
150
- $this->item_id = $row->item_id;
151
- $this->secondary_item_id = $row->secondary_item_id;
152
- $this->user_id = $row->user_id;
153
  $this->primary_link = $row->primary_link;
154
  $this->component = $row->component;
155
  $this->type = $row->type;
@@ -157,8 +157,8 @@ class BP_Activity_Activity {
157
  $this->content = $row->content;
158
  $this->date_recorded = $row->date_recorded;
159
  $this->hide_sitewide = $row->hide_sitewide;
160
- $this->mptt_left = $row->mptt_left;
161
- $this->mptt_right = $row->mptt_right;
162
  $this->is_spam = $row->is_spam;
163
  }
164
 
@@ -257,6 +257,9 @@ class BP_Activity_Activity {
257
  * Default: false.
258
  * @type array $meta_query An array of meta_query conditions.
259
  * See WP_Meta_Query::queries for description.
 
 
 
260
  * @type array $filter See BP_Activity_Activity::get_filter_sql().
261
  * @type string $search_terms Limit results by a search term.
262
  * Default: false.
@@ -267,6 +270,9 @@ class BP_Activity_Activity {
267
  * @type string $spam Spam status. Default: 'ham_only'.
268
  * @type bool $update_meta_cache Whether to pre-fetch metadata for
269
  * queried activity items. Default: true.
 
 
 
270
  * }
271
  * @return array The array returned has two keys:
272
  * - 'total' is the count of located activities
@@ -305,12 +311,14 @@ class BP_Activity_Activity {
305
  'exclude' => false, // Array of ids to exclude
306
  'in' => false, // Array of ids to limit query by (IN)
307
  'meta_query' => false, // Filter by activitymeta
 
308
  'filter' => false, // See self::get_filter_sql()
309
  'search_terms' => false, // Terms to search by
310
  'display_comments' => false, // Whether to include activity comments
311
  'show_hidden' => false, // Show items marked hide_sitewide
312
  'spam' => 'ham_only', // Spam status
313
  'update_meta_cache' => true,
 
314
  );
315
  $r = wp_parse_args( $args, $defaults );
316
  extract( $r );
@@ -325,6 +333,9 @@ class BP_Activity_Activity {
325
  // Where conditions
326
  $where_conditions = array();
327
 
 
 
 
328
  // Spam
329
  if ( 'ham_only' == $spam )
330
  $where_conditions['spam_sql'] = 'a.is_spam = 0';
@@ -333,8 +344,8 @@ class BP_Activity_Activity {
333
 
334
  // Searching
335
  if ( $search_terms ) {
336
- $search_terms = esc_sql( $search_terms );
337
- $where_conditions['search_sql'] = "a.content LIKE '%%" . esc_sql( like_escape( $search_terms ) ) . "%%'";
338
  }
339
 
340
  // Filtering
@@ -372,17 +383,35 @@ class BP_Activity_Activity {
372
  $where_conditions[] = $meta_query_sql['where'];
373
  }
374
 
 
 
 
 
 
 
 
375
  // Alter the query based on whether we want to show activity item
376
  // comments in the stream like normal comments or threaded below
377
  // the activity.
378
  if ( false === $display_comments || 'threaded' === $display_comments ) {
379
- $where_conditions[] = "a.type != 'activity_comment'";
380
  }
381
 
382
  // Exclude 'last_activity' items unless the 'action' filter has
383
  // been explicitly set
384
  if ( empty( $filter['object'] ) ) {
385
- $where_conditions[] = "a.type != 'last_activity'";
 
 
 
 
 
 
 
 
 
 
 
386
  }
387
 
388
  // Filter the where conditions
@@ -411,6 +440,12 @@ class BP_Activity_Activity {
411
  $page = absint( $page );
412
  $per_page = absint( $per_page );
413
 
 
 
 
 
 
 
414
  // Filter and return true to use the legacy query structure (not recommended)
415
  if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $r ) ) {
416
 
@@ -431,17 +466,25 @@ class BP_Activity_Activity {
431
  $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}";
432
 
433
  if ( ! empty( $per_page ) && ! empty( $page ) ) {
434
- $activity_ids_sql .= $wpdb->prepare( " LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
 
 
435
  }
436
 
437
  $activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r );
438
 
439
  $activity_ids = $wpdb->get_col( $activity_ids_sql );
440
- $activities = self::get_activity_data( $activity_ids );
441
- }
442
 
443
- $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort );
444
- $total_activities = $wpdb->get_var( $total_activities_sql );
 
 
 
 
 
 
 
 
445
 
446
  // Get the fullnames of users so we don't have to query in the loop
447
  $activities = self::append_user_fullnames( $activities );
@@ -465,13 +508,23 @@ class BP_Activity_Activity {
465
  // Generate action strings
466
  $activities = BP_Activity_Activity::generate_action_strings( $activities );
467
 
 
 
468
  // If $max is set, only return up to the max results
469
- if ( !empty( $max ) ) {
470
- if ( (int) $total_activities > (int) $max )
471
- $total_activities = $max;
 
 
 
 
 
 
 
 
472
  }
473
 
474
- return array( 'activities' => $activities, 'total' => (int) $total_activities );
475
  }
476
 
477
  /**
@@ -547,7 +600,6 @@ class BP_Activity_Activity {
547
  * @return array
548
  */
549
  protected static function append_user_fullnames( $activities ) {
550
- global $wpdb;
551
 
552
  if ( bp_is_active( 'xprofile' ) && ! empty( $activities ) ) {
553
  $activity_user_ids = wp_list_pluck( $activities, 'user_id' );
@@ -656,6 +708,33 @@ class BP_Activity_Activity {
656
  return $sql_array;
657
  }
658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  /**
660
  * In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
661
  *
146
  }
147
 
148
  if ( ! empty( $row ) ) {
149
+ $this->id = (int) $row->id;
150
+ $this->item_id = (int) $row->item_id;
151
+ $this->secondary_item_id = (int) $row->secondary_item_id;
152
+ $this->user_id = (int) $row->user_id;
153
  $this->primary_link = $row->primary_link;
154
  $this->component = $row->component;
155
  $this->type = $row->type;
157
  $this->content = $row->content;
158
  $this->date_recorded = $row->date_recorded;
159
  $this->hide_sitewide = $row->hide_sitewide;
160
+ $this->mptt_left = (int) $row->mptt_left;
161
+ $this->mptt_right = (int) $row->mptt_right;
162
  $this->is_spam = $row->is_spam;
163
  }
164
 
257
  * Default: false.
258
  * @type array $meta_query An array of meta_query conditions.
259
  * See WP_Meta_Query::queries for description.
260
+ * @type array $date_query An array of date_query conditions.
261
+ * See first parameter of WP_Date_Query::__construct()
262
+ * for description.
263
  * @type array $filter See BP_Activity_Activity::get_filter_sql().
264
  * @type string $search_terms Limit results by a search term.
265
  * Default: false.
270
  * @type string $spam Spam status. Default: 'ham_only'.
271
  * @type bool $update_meta_cache Whether to pre-fetch metadata for
272
  * queried activity items. Default: true.
273
+ * @type string|bool $count_total If true, an additional DB query
274
+ * is run to count the total activity items for the query.
275
+ * Default: false.
276
  * }
277
  * @return array The array returned has two keys:
278
  * - 'total' is the count of located activities
311
  'exclude' => false, // Array of ids to exclude
312
  'in' => false, // Array of ids to limit query by (IN)
313
  'meta_query' => false, // Filter by activitymeta
314
+ 'date_query' => false, // Filter by date
315
  'filter' => false, // See self::get_filter_sql()
316
  'search_terms' => false, // Terms to search by
317
  'display_comments' => false, // Whether to include activity comments
318
  'show_hidden' => false, // Show items marked hide_sitewide
319
  'spam' => 'ham_only', // Spam status
320
  'update_meta_cache' => true,
321
+ 'count_total' => false,
322
  );
323
  $r = wp_parse_args( $args, $defaults );
324
  extract( $r );
333
  // Where conditions
334
  $where_conditions = array();
335
 
336
+ // Excluded types
337
+ $excluded_types = array();
338
+
339
  // Spam
340
  if ( 'ham_only' == $spam )
341
  $where_conditions['spam_sql'] = 'a.is_spam = 0';
344
 
345
  // Searching
346
  if ( $search_terms ) {
347
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
348
+ $where_conditions['search_sql'] = $wpdb->prepare( 'a.content LIKE %s', $search_terms_like );
349
  }
350
 
351
  // Filtering
383
  $where_conditions[] = $meta_query_sql['where'];
384
  }
385
 
386
+ // Process date_query into SQL
387
+ $date_query_sql = self::get_date_query_sql( $date_query );
388
+
389
+ if ( ! empty( $date_query_sql ) ) {
390
+ $where_conditions['date'] = $date_query_sql;
391
+ }
392
+
393
  // Alter the query based on whether we want to show activity item
394
  // comments in the stream like normal comments or threaded below
395
  // the activity.
396
  if ( false === $display_comments || 'threaded' === $display_comments ) {
397
+ $excluded_types[] = 'activity_comment';
398
  }
399
 
400
  // Exclude 'last_activity' items unless the 'action' filter has
401
  // been explicitly set
402
  if ( empty( $filter['object'] ) ) {
403
+ $excluded_types[] = 'last_activity';
404
+ }
405
+
406
+ // Exclude 'new_member' items if xprofile component is not active
407
+ if ( ! bp_is_active( 'xprofile' ) ) {
408
+ $excluded_types[] = 'new_member';
409
+ }
410
+
411
+ // Build the excluded type sql part
412
+ if ( ! empty( $excluded_types ) ) {
413
+ $not_in = "'" . implode( "', '", esc_sql( $excluded_types ) ) . "'";
414
+ $where_conditions['excluded_types'] = "a.type NOT IN ({$not_in})";
415
  }
416
 
417
  // Filter the where conditions
440
  $page = absint( $page );
441
  $per_page = absint( $per_page );
442
 
443
+ $retval = array(
444
+ 'activities' => null,
445
+ 'total' => null,
446
+ 'has_more_items' => null,
447
+ );
448
+
449
  // Filter and return true to use the legacy query structure (not recommended)
450
  if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $r ) ) {
451
 
466
  $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}";
467
 
468
  if ( ! empty( $per_page ) && ! empty( $page ) ) {
469
+ // We query for $per_page + 1 items in order to
470
+ // populate the has_more_items flag
471
+ $activity_ids_sql .= $wpdb->prepare( " LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page + 1 );
472
  }
473
 
474
  $activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r );
475
 
476
  $activity_ids = $wpdb->get_col( $activity_ids_sql );
 
 
477
 
478
+ $retval['has_more_items'] = ! empty( $per_page ) && count( $activity_ids ) > $per_page;
479
+
480
+ // If we've fetched more than the $per_page value, we
481
+ // can discard the extra now
482
+ if ( ! empty( $per_page ) && count( $activity_ids ) === $per_page + 1 ) {
483
+ array_pop( $activity_ids );
484
+ }
485
+
486
+ $activities = self::get_activity_data( $activity_ids );
487
+ }
488
 
489
  // Get the fullnames of users so we don't have to query in the loop
490
  $activities = self::append_user_fullnames( $activities );
508
  // Generate action strings
509
  $activities = BP_Activity_Activity::generate_action_strings( $activities );
510
 
511
+ $retval['activities'] = $activities;
512
+
513
  // If $max is set, only return up to the max results
514
+ if ( ! empty( $r['count_total'] ) ) {
515
+
516
+ $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort );
517
+ $total_activities = $wpdb->get_var( $total_activities_sql );
518
+
519
+ if ( !empty( $max ) ) {
520
+ if ( (int) $total_activities > (int) $max )
521
+ $total_activities = $max;
522
+ }
523
+
524
+ $retval['total'] = $total_activities;
525
  }
526
 
527
+ return $retval;
528
  }
529
 
530
  /**
600
  * @return array
601
  */
602
  protected static function append_user_fullnames( $activities ) {
 
603
 
604
  if ( bp_is_active( 'xprofile' ) && ! empty( $activities ) ) {
605
  $activity_user_ids = wp_list_pluck( $activities, 'user_id' );
708
  return $sql_array;
709
  }
710
 
711
+ /**
712
+ * Get the SQL for the 'date_query' param in BP_Activity_Activity::get().
713
+ *
714
+ * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting
715
+ * of parsing the date_query array and creating the necessary SQL clauses.
716
+ * However, since BP_Activity_Activity::get() builds its SQL differently than
717
+ * WP_Query, we have to alter the return value (stripping the leading AND
718
+ * keyword from the query).
719
+ *
720
+ * @since BuddyPress (2.1.0)
721
+ *
722
+ * @param array $date_query An array of date_query parameters. See the
723
+ * documentation for the first parameter of WP_Date_Query.
724
+ * @return string
725
+ */
726
+ public static function get_date_query_sql( $date_query = array() ) {
727
+ $sql = '';
728
+
729
+ // Date query
730
+ if ( ! empty( $date_query ) && is_array( $date_query ) && class_exists( 'BP_Date_Query' ) ) {
731
+ $date_query = new BP_Date_Query( $date_query, 'date_recorded' );
732
+ $sql = preg_replace( '/^\sAND/', '', $date_query->get_sql() );
733
+ }
734
+
735
+ return $sql;
736
+ }
737
+
738
  /**
739
  * In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
740
  *
bp-activity/bp-activity-cssjs.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Activity component CSS/JS
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityScripts
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) exit;
12
+
13
+ /**
14
+ * Enqueue @mentions JS.
15
+ *
16
+ * @since BuddyPress (2.1)
17
+ */
18
+ function bp_activity_mentions_script() {
19
+ if ( ! bp_activity_maybe_load_mentions_scripts() ) {
20
+ return;
21
+ }
22
+
23
+ // Special handling for New/Edit screens in wp-admin
24
+ if ( is_admin() ) {
25
+ if (
26
+ ! get_current_screen() ||
27
+ ! in_array( get_current_screen()->base, array( 'page', 'post' ) ) ||
28
+ ! post_type_supports( get_current_screen()->post_type, 'editor' ) ) {
29
+ return;
30
+ }
31
+ }
32
+
33
+
34
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
35
+
36
+ wp_enqueue_script( 'bp-mentions', buddypress()->plugin_url . "bp-activity/js/mentions{$min}.js", array( 'jquery', 'jquery-atwho' ), bp_get_version(), true );
37
+ wp_enqueue_style( 'bp-mentions-css', buddypress()->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version() );
38
+
39
+ wp_style_add_data( 'bp-mentions-css', 'rtl', true );
40
+ if ( $min ) {
41
+ wp_style_add_data( 'bp-mentions-css', 'suffix', $min );
42
+ }
43
+
44
+ // Print a list of the current user's friends to the page for quicker @mentions lookups.
45
+ do_action( 'bp_activity_mentions_prime_results' );
46
+ }
47
+ add_action( 'bp_enqueue_scripts', 'bp_activity_mentions_script' );
48
+ add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
bp-activity/bp-activity-filters.php CHANGED
@@ -22,7 +22,7 @@ add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_filter_kses',
22
  add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_filter_kses', 1 );
23
  add_filter( 'bp_activity_content_before_save', 'bp_activity_filter_kses', 1 );
24
  add_filter( 'bp_activity_action_before_save', 'bp_activity_filter_kses', 1 );
25
- add_filter( 'bp_activity_latest_update_content', 'wp_filter_kses', 1 );
26
 
27
  add_filter( 'bp_get_activity_action', 'force_balance_tags' );
28
  add_filter( 'bp_get_activity_content_body', 'force_balance_tags' );
@@ -96,6 +96,9 @@ add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
96
  add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
97
  add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
98
 
 
 
 
99
  /** Actions *******************************************************************/
100
 
101
  // At-name filter
@@ -456,7 +459,7 @@ function bp_activity_timestamp_class( $classes = '' ) {
456
  if ( empty( $activity_date ) ) {
457
  return $classes;
458
  }
459
-
460
  $classes .= ' date-recorded-' . strtotime( $activity_date );
461
 
462
  return $classes;
@@ -489,6 +492,10 @@ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array
489
  'activity_latest_args'
490
  );
491
 
 
 
 
 
492
  $newest_activities = array();
493
  $last_activity_recorded = 0;
494
 
22
  add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_filter_kses', 1 );
23
  add_filter( 'bp_activity_content_before_save', 'bp_activity_filter_kses', 1 );
24
  add_filter( 'bp_activity_action_before_save', 'bp_activity_filter_kses', 1 );
25
+ add_filter( 'bp_activity_latest_update_content', 'bp_activity_filter_kses', 1 );
26
 
27
  add_filter( 'bp_get_activity_action', 'force_balance_tags' );
28
  add_filter( 'bp_get_activity_content_body', 'force_balance_tags' );
96
  add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
97
  add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
98
 
99
+ add_filter( 'bp_get_total_favorite_count_for_user', 'bp_core_number_format' );
100
+ add_filter( 'bp_get_total_mention_count_for_user', 'bp_core_number_format' );
101
+
102
  /** Actions *******************************************************************/
103
 
104
  // At-name filter
459
  if ( empty( $activity_date ) ) {
460
  return $classes;
461
  }
462
+
463
  $classes .= ' date-recorded-' . strtotime( $activity_date );
464
 
465
  return $classes;
492
  'activity_latest_args'
493
  );
494
 
495
+ if ( ! empty( $data['bp_activity_last_recorded_search_terms'] ) && empty( $activity_latest_args['search_terms'] ) ) {
496
+ $activity_latest_args['search_terms'] = addslashes( $data['bp_activity_last_recorded_search_terms'] );
497
+ }
498
+
499
  $newest_activities = array();
500
  $last_activity_recorded = 0;
501
 
bp-activity/bp-activity-functions.php CHANGED
@@ -15,16 +15,12 @@ if ( !defined( 'ABSPATH' ) ) exit;
15
  /**
16
  * Check whether the $bp global lists an activity directory page.
17
  *
18
- * @since BuddyPress (1.5)
19
- *
20
- * @global object $bp BuddyPress global settings
21
  *
22
  * @return bool True if activity directory page is found, otherwise false.
23
  */
24
  function bp_activity_has_directory() {
25
- global $bp;
26
-
27
- return (bool) !empty( $bp->pages->activity->id );
28
  }
29
 
30
  /**
@@ -42,7 +38,7 @@ function bp_activity_has_directory() {
42
  *
43
  * add_filter( 'bp_activity_do_mentions', '__return_false' );
44
  *
45
- * @since BuddyPress (1.8)
46
  *
47
  * @uses apply_filters() To call 'bp_activity_do_mentions' hook.
48
  *
@@ -52,36 +48,60 @@ function bp_activity_do_mentions() {
52
  return (bool) apply_filters( 'bp_activity_do_mentions', true );
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  /**
56
  * Locate usernames in an activity content string, as designated by an @ sign.
57
  *
58
- * @since BuddyPress (1.5)
59
  *
60
- * @param string $content The content of the activity, usually found in $activity->content.
61
- * @return array|bool Associative array with user ID as key and username as value. Boolean false if no mentions found.
 
 
62
  */
63
  function bp_activity_find_mentions( $content ) {
 
64
  $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/';
65
  preg_match_all( $pattern, $content, $usernames );
66
 
67
  // Make sure there's only one instance of each username
68
- if ( !$usernames = array_unique( $usernames[1] ) )
 
 
 
69
  return false;
 
70
 
71
  $mentioned_users = array();
72
 
73
  // We've found some mentions! Check to see if users exist
74
- foreach( (array) $usernames as $key => $username ) {
75
  $user_id = bp_activity_get_userid_from_mentionname( $username );
76
 
77
  // user ID exists, so let's add it to our array
78
  if ( ! empty( $user_id ) ) {
79
- $mentioned_users[$user_id] = $username;
80
  }
81
  }
82
 
83
- if ( empty( $mentioned_users ) )
84
  return false;
 
85
 
86
  return $mentioned_users;
87
  }
@@ -89,7 +109,7 @@ function bp_activity_find_mentions( $content ) {
89
  /**
90
  * Reset a user's unread mentions list and count.
91
  *
92
- * @since BuddyPress (1.5)
93
  *
94
  * @uses bp_delete_user_meta()
95
  *
@@ -97,7 +117,7 @@ function bp_activity_find_mentions( $content ) {
97
  */
98
  function bp_activity_clear_new_mentions( $user_id ) {
99
  bp_delete_user_meta( $user_id, 'bp_new_mention_count' );
100
- bp_delete_user_meta( $user_id, 'bp_new_mentions' );
101
  }
102
 
103
  /**
@@ -108,7 +128,7 @@ function bp_activity_clear_new_mentions( $user_id ) {
108
  *
109
  * Currently, only used in {@link bp_activity_delete()}.
110
  *
111
- * @since BuddyPress (1.5)
112
  *
113
  * @uses bp_activity_find_mentions()
114
  * @uses bp_activity_update_mention_count_for_user()
@@ -117,21 +137,25 @@ function bp_activity_clear_new_mentions( $user_id ) {
117
  * @param string $action Can be 'delete' or 'add'. Defaults to 'add'.
118
  */
119
  function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
120
- if ( empty( $activity_id ) )
 
 
121
  return false;
 
122
 
123
  // Get activity object
124
- $activity = new BP_Activity_Activity( (int) $activity_id );
125
 
126
  // Try to find mentions
127
  $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) );
128
 
129
  // Still empty? Stop now
130
- if ( empty( $usernames ) )
131
  return false;
 
132
 
133
  // Increment mention count foreach mentioned user
134
- foreach( (array) $usernames as $user_id => $username ) {
135
  bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action );
136
  }
137
  }
@@ -142,7 +166,7 @@ function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
142
  * This function should be used when you've already parsed your activity item
143
  * for @mentions.
144
  *
145
- * @since BuddyPress (1.7)
146
  *
147
  * @uses bp_get_user_meta()
148
  * @uses bp_update_user_meta()
@@ -153,13 +177,19 @@ function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
153
  * @return bool
154
  */
155
  function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action = 'add' ) {
156
- if ( empty( $user_id ) || empty( $activity_id ) )
 
157
  return false;
 
158
 
159
  // Adjust the mention list and count for the member
160
  $new_mention_count = (int) bp_get_user_meta( $user_id, 'bp_new_mention_count', true );
161
- if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) )
 
 
 
162
  $new_mentions = array();
 
163
 
164
  switch ( $action ) {
165
  case 'delete' :
@@ -275,9 +305,13 @@ function bp_activity_get_userid_from_mentionname( $mentionname ) {
275
  * @param string $type The action type.
276
  * @param string $description The action description.
277
  * @param callable $format_callback Callback for formatting the action string.
 
 
 
 
278
  * @return bool False if any param is empty, otherwise true.
279
  */
280
- function bp_activity_set_action( $component_id, $type, $description, $format_callback = false ) {
281
  $bp = buddypress();
282
 
283
  // Return false if any of the above values are not set
@@ -303,7 +337,9 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal
303
  'key' => $type,
304
  'value' => $description,
305
  'format_callback' => $format_callback,
306
- ), $component_id, $type, $description, $format_callback );
 
 
307
 
308
  return true;
309
  }
@@ -311,9 +347,8 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal
311
  /**
312
  * Retreive the current action from a component and key.
313
  *
314
- * @since BuddyPress (1.1)
315
  *
316
- * @global object $bp BuddyPress global settings.
317
  * @uses apply_filters() To call the 'bp_activity_get_action' hook.
318
  *
319
  * @param string $component_id The unique string ID of the component.
@@ -321,19 +356,24 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal
321
  * @return string|bool Action value if found, otherwise false.
322
  */
323
  function bp_activity_get_action( $component_id, $key ) {
324
- global $bp;
325
 
326
  // Return false if any of the above values are not set
327
- if ( empty( $component_id ) || empty( $key ) )
328
  return false;
 
 
 
 
 
 
329
 
330
- return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key );
331
  }
332
 
333
  /**
334
  * Fetch details of all registered activity types.
335
  *
336
- * @since BuddyPress (1.7)
337
  *
338
  * @return array array( type => description ), ...
339
  */
@@ -344,8 +384,9 @@ function bp_activity_get_types() {
344
  foreach ( buddypress()->activity->actions as $action ) {
345
  $action = array_values( (array) $action );
346
 
347
- for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
348
  $actions[ $action[$i]['key'] ] = $action[$i]['value'];
 
349
  }
350
 
351
  // This was a mis-named activity type from before BP 1.6
@@ -359,7 +400,7 @@ function bp_activity_get_types() {
359
  /**
360
  * Get a users favorite activity stream items.
361
  *
362
- * @since BuddyPress (1.2)
363
  *
364
  * @uses bp_get_user_meta()
365
  * @uses apply_filters() To call the 'bp_activity_get_user_favorites' hook.
@@ -370,8 +411,9 @@ function bp_activity_get_types() {
370
  function bp_activity_get_user_favorites( $user_id = 0 ) {
371
 
372
  // Fallback to logged in user if no user_id is passed
373
- if ( empty( $user_id ) )
374
  $user_id = bp_displayed_user_id();
 
375
 
376
  // Get favorites for user
377
  $favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
@@ -382,7 +424,7 @@ function bp_activity_get_user_favorites( $user_id = 0 ) {
382
  /**
383
  * Add an activity stream item as a favorite for a user.
384
  *
385
- * @since BuddyPress (1.2)
386
  *
387
  * @uses is_user_logged_in()
388
  * @uses bp_get_user_meta()
@@ -399,12 +441,14 @@ function bp_activity_get_user_favorites( $user_id = 0 ) {
399
  function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
400
 
401
  // Favorite activity stream items are for logged in users only
402
- if ( !is_user_logged_in() )
403
  return false;
 
404
 
405
  // Fallback to logged in user if no user_id is passed
406
- if ( empty( $user_id ) )
407
  $user_id = bp_loggedin_user_id();
 
408
 
409
  $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
410
  if ( empty( $my_favs ) || ! is_array( $my_favs ) ) {
@@ -447,7 +491,7 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
447
  /**
448
  * Remove an activity stream item as a favorite for a user.
449
  *
450
- * @since BuddyPress (1.2)
451
  *
452
  * @uses is_user_logged_in()
453
  * @uses bp_get_user_meta()
@@ -463,12 +507,14 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
463
  function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
464
 
465
  // Favorite activity stream items are for logged in users only
466
- if ( !is_user_logged_in() )
467
  return false;
 
468
 
469
  // Fallback to logged in user if no user_id is passed
470
- if ( empty( $user_id ) )
471
  $user_id = bp_loggedin_user_id();
 
472
 
473
  $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
474
  $my_favs = array_flip( (array) $my_favs );
@@ -483,7 +529,8 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
483
  $my_favs = array_unique( array_flip( $my_favs ) );
484
 
485
  // Update the total number of users who have favorited this activity
486
- if ( $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' ) ) {
 
487
 
488
  // Deduct from total favorites
489
  if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int) $fav_count - 1 ) ) {
@@ -516,7 +563,7 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
516
  /**
517
  * Check whether an activity item exists with a given content string.
518
  *
519
- * @since BuddyPress (1.1)
520
  *
521
  * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity}
522
  * @uses apply_filters() To call the 'bp_activity_check_exists_by_content' hook.
@@ -531,7 +578,7 @@ function bp_activity_check_exists_by_content( $content ) {
531
  /**
532
  * Retrieve the last time activity was updated.
533
  *
534
- * @since BuddyPress (1.0)
535
  *
536
  * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity}
537
  * @uses apply_filters() To call the 'bp_activity_get_last_updated' hook.
@@ -545,7 +592,7 @@ function bp_activity_get_last_updated() {
545
  /**
546
  * Retrieve the number of favorite activity stream items a user has.
547
  *
548
- * @since BuddyPress (1.2)
549
  *
550
  * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
551
  *
@@ -555,8 +602,9 @@ function bp_activity_get_last_updated() {
555
  function bp_activity_total_favorites_for_user( $user_id = 0 ) {
556
 
557
  // Fallback on displayed user, and then logged in user
558
- if ( empty( $user_id ) )
559
  $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
560
 
561
  return BP_Activity_Activity::total_favorite_count( $user_id );
562
  }
@@ -584,7 +632,6 @@ function bp_activity_total_favorites_for_user( $user_id = 0 ) {
584
  * @return bool True on success, false on failure.
585
  */
586
  function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '', $delete_all = false ) {
587
- global $wpdb, $bp;
588
 
589
  // Legacy - if no meta_key is passed, delete all for the item
590
  if ( empty( $meta_key ) ) {
@@ -611,7 +658,7 @@ function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = ''
611
  /**
612
  * Get metadata for a given activity item.
613
  *
614
- * @since BuddyPress (1.2)
615
  *
616
  * @uses apply_filters() To call the 'bp_activity_get_meta' hook.
617
  *
@@ -636,7 +683,7 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true
636
  /**
637
  * Update a piece of activity meta.
638
  *
639
- * @since BuddyPress (1.2)
640
  *
641
  * @param int $activity_id ID of the activity item whose metadata is being
642
  * updated.
@@ -665,7 +712,7 @@ function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_va
665
  * @param int $activity_id ID of the activity item.
666
  * @param string $meta_key Metadata key.
667
  * @param mixed $meta_value Metadata value.
668
- * @param bool $unique. Optional. Whether to enforce a single metadata value
669
  * for the given key. If true, and the object already has a value for
670
  * the key, no change will be made. Default: false.
671
  * @return int|bool The meta ID on successful update, false on failure.
@@ -683,7 +730,7 @@ function bp_activity_add_meta( $activity_id, $meta_key, $meta_value, $unique = f
683
  /**
684
  * Completely remove a user's activity data.
685
  *
686
- * @since BuddyPress (1.5)
687
  *
688
  * @uses is_user_logged_in()
689
  * @uses bp_activity_delete()
@@ -696,14 +743,15 @@ function bp_activity_add_meta( $activity_id, $meta_key, $meta_value, $unique = f
696
  function bp_activity_remove_all_user_data( $user_id = 0 ) {
697
 
698
  // Do not delete user data unless a logged in user says so
699
- if ( empty( $user_id ) || !is_user_logged_in() )
700
  return false;
 
701
 
702
  // Clear the user's activity from the sitewide stream and clear their activity tables
703
  bp_activity_delete( array( 'user_id' => $user_id ) );
704
 
705
  // Remove any usermeta
706
- bp_delete_user_meta( $user_id, 'bp_latest_update' );
707
  bp_delete_user_meta( $user_id, 'bp_favorite_activities' );
708
 
709
  // Execute additional code
@@ -718,7 +766,7 @@ add_action( 'delete_user', 'bp_activity_remove_all_user_data' );
718
  /**
719
  * Mark all of the user's activity as spam.
720
  *
721
- * @since BuddyPress (1.6)
722
  *
723
  * @global object $wpdb WordPress database access object.
724
  * @global object $bp BuddyPress global settings.
@@ -726,22 +774,30 @@ add_action( 'delete_user', 'bp_activity_remove_all_user_data' );
726
  * @param int $user_id ID of the user whose activity is being spammed.
727
  */
728
  function bp_activity_spam_all_user_data( $user_id = 0 ) {
729
- global $bp, $wpdb;
730
 
731
  // Do not delete user data unless a logged in user says so
732
- if ( empty( $user_id ) || ! is_user_logged_in() )
733
  return false;
 
734
 
735
  // Get all the user's activities.
736
- $activities = bp_activity_get( array( 'display_comments' => 'stream', 'filter' => array( 'user_id' => $user_id ), 'show_hidden' => true, ) );
 
 
 
 
 
 
737
 
738
  // Mark each as spam
739
  foreach ( (array) $activities['activities'] as $activity ) {
740
 
741
  // Create an activity object
742
  $activity_obj = new BP_Activity_Activity;
743
- foreach ( $activity as $k => $v )
744
  $activity_obj->$k = $v;
 
745
 
746
  // Mark as spam
747
  bp_activity_mark_as_spam( $activity_obj );
@@ -753,8 +809,9 @@ function bp_activity_spam_all_user_data( $user_id = 0 ) {
753
  * as we're going to be updating all the activity statuses directly, for efficency,
754
  * we need to update manually.
755
  */
756
- if ( ! empty( $bp->activity->akismet ) )
757
  $bp->activity->akismet->update_activity_spam_meta( $activity_obj );
 
758
 
759
  // Tidy up
760
  unset( $activity_obj );
@@ -771,7 +828,7 @@ add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' );
771
  /**
772
  * Mark all of the user's activity as ham (not spam).
773
  *
774
- * @since BuddyPress (1.6)
775
  *
776
  * @global object $wpdb WordPress database access object.
777
  * @global object $bp BuddyPress global settings.
@@ -779,22 +836,31 @@ add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' );
779
  * @param int $user_id ID of the user whose activity is being hammed.
780
  */
781
  function bp_activity_ham_all_user_data( $user_id = 0 ) {
782
- global $bp, $wpdb;
783
 
784
  // Do not delete user data unless a logged in user says so
785
- if ( empty( $user_id ) || ! is_user_logged_in() )
786
  return false;
 
787
 
788
  // Get all the user's activities.
789
- $activities = bp_activity_get( array( 'display_comments' => 'stream', 'filter' => array( 'user_id' => $user_id ), 'show_hidden' => true, 'spam' => 'all', ) );
 
 
 
 
 
 
 
790
 
791
  // Mark each as not spam
792
  foreach ( (array) $activities['activities'] as $activity ) {
793
 
794
  // Create an activity object
795
  $activity_obj = new BP_Activity_Activity;
796
- foreach ( $activity as $k => $v )
797
  $activity_obj->$k = $v;
 
798
 
799
  // Mark as not spam
800
  bp_activity_mark_as_ham( $activity_obj );
@@ -806,8 +872,9 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) {
806
  * as we're going to be updating all the activity statuses directly, for efficency,
807
  * we need to update manually.
808
  */
809
- if ( ! empty( $bp->activity->akismet ) )
810
  $bp->activity->akismet->update_activity_ham_meta( $activity_obj );
 
811
 
812
  // Tidy up
813
  unset( $activity_obj );
@@ -824,25 +891,26 @@ add_action( 'bp_make_ham_user', 'bp_activity_ham_all_user_data' );
824
  /**
825
  * Register the activity stream actions for updates
826
  *
827
- * @since BuddyPress (1.6)
828
- *
829
- * @global object $bp BuddyPress global settings.
830
  */
831
  function bp_activity_register_activity_actions() {
832
- global $bp;
833
 
834
  bp_activity_set_action(
835
  $bp->activity->id,
836
  'activity_update',
837
  __( 'Posted a status update', 'buddypress' ),
838
- 'bp_activity_format_activity_action_activity_update'
 
 
839
  );
840
 
841
  bp_activity_set_action(
842
  $bp->activity->id,
843
  'activity_comment',
844
  __( 'Replied to a status update', 'buddypress' ),
845
- 'bp_activity_format_activity_action_activity_comment'
 
846
  );
847
 
848
  do_action( 'bp_activity_register_activity_actions' );
@@ -860,6 +928,7 @@ add_action( 'bp_register_activity_actions', 'bp_activity_register_activity_actio
860
  * the formatted action string.
861
  */
862
  function bp_activity_generate_action_string( $activity ) {
 
863
  // Check for valid input
864
  if ( empty( $activity->component ) || empty( $activity->type ) ) {
865
  return false;
@@ -926,7 +995,7 @@ function bp_activity_format_activity_action_activity_comment( $action, $activity
926
  * the default for the bp_activity_get()).
927
  * - 'per_page' (false)
928
  *
929
- * @since BuddyPress (1.2)
930
  *
931
  * @see BP_Activity_Activity::get() For more information on accepted arguments
932
  * and the format of the returned value.
@@ -940,7 +1009,8 @@ function bp_activity_format_activity_action_activity_comment( $action, $activity
940
  * @return array $activity See BP_Activity_Activity::get() for description.
941
  */
942
  function bp_activity_get( $args = '' ) {
943
- $defaults = array(
 
944
  'max' => false, // Maximum number of results to return
945
  'page' => 1, // page 1 without a per_page will result in no pagination.
946
  'per_page' => false, // results per page
@@ -949,11 +1019,13 @@ function bp_activity_get( $args = '' ) {
949
 
950
  'search_terms' => false, // Pass search terms as a string
951
  'meta_query' => false, // Filter by activity meta. See WP_Meta_Query for format
 
952
  'show_hidden' => false, // Show activity items that are hidden site-wide?
953
  'exclude' => false, // Comma-separated list of activity IDs to exclude
954
  'in' => false, // Comma-separated list or array of activity IDs to which you want to limit the query
955
  'spam' => 'ham_only', // 'ham_only' (default), 'spam_only' or 'all'.
956
  'update_meta_cache' => true,
 
957
 
958
  /**
959
  * Pass filters as an array -- all filter items can be multiple values comma separated:
@@ -966,46 +1038,50 @@ function bp_activity_get( $args = '' ) {
966
  * );
967
  */
968
  'filter' => array()
969
- );
970
- $r = wp_parse_args( $args, $defaults );
971
- extract( $r, EXTR_SKIP );
972
 
973
  // Attempt to return a cached copy of the first page of sitewide activity.
974
- if ( 1 == (int) $page && empty( $max ) && empty( $search_terms ) && empty( $meta_query ) && empty( $filter ) && empty( $exclude ) && empty( $in ) && 'DESC' == $sort && empty( $exclude ) && 'ham_only' == $spam ) {
975
- if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
976
- $args = array(
977
- 'page' => $page,
978
- 'per_page' => $per_page,
979
- 'max' => $max,
980
- 'sort' => $sort,
981
- 'search_terms' => $search_terms,
982
- 'meta_query' => $meta_query,
983
- 'filter' => $filter,
984
- 'display_comments' => $display_comments,
985
- 'show_hidden' => $show_hidden,
986
- 'spam' => $spam,
987
- 'update_meta_cache' => $update_meta_cache,
988
- );
989
- $activity = BP_Activity_Activity::get( $args );
 
 
 
 
 
990
  wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
991
  }
992
 
993
  } else {
994
- $args = array(
995
- 'page' => $page,
996
- 'per_page' => $per_page,
997
- 'max' => $max,
998
- 'sort' => $sort,
999
- 'search_terms' => $search_terms,
1000
- 'meta_query' => $meta_query,
1001
- 'filter' => $filter,
1002
- 'display_comments' => $display_comments,
1003
- 'show_hidden' => $show_hidden,
1004
- 'exclude' => $exclude,
1005
- 'in' => $in,
1006
- 'spam' => $spam
1007
- );
1008
- $activity = BP_Activity_Activity::get( $args );
 
1009
  }
1010
 
1011
  return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
@@ -1014,7 +1090,7 @@ function bp_activity_get( $args = '' ) {
1014
  /**
1015
  * Fetch specific activity items.
1016
  *
1017
- * @since BuddyPress (1.2)
1018
  *
1019
  * @see BP_Activity_Activity::get() For more information on accepted arguments
1020
  * @uses wp_parse_args()
@@ -1030,38 +1106,38 @@ function bp_activity_get( $args = '' ) {
1030
  * @return array $activity See BP_Activity_Activity::get() for description.
1031
  */
1032
  function bp_activity_get_specific( $args = '' ) {
1033
- $defaults = array(
1034
- 'activity_ids' => false, // A single activity_id or array of IDs.
1035
- 'display_comments' => false, // true or false to display threaded comments for these specific activity items
1036
- 'max' => false, // Maximum number of results to return
1037
- 'page' => 1, // page 1 without a per_page will result in no pagination.
1038
- 'per_page' => false, // results per page
1039
- 'show_hidden' => true, // When fetching specific items, show all
1040
- 'sort' => 'DESC', // sort ASC or DESC
1041
- 'spam' => 'ham_only', // Retrieve items marked as spam
 
1042
  'update_meta_cache' => true,
1043
- );
1044
- $r = wp_parse_args( $args, $defaults );
1045
- extract( $r, EXTR_SKIP );
1046
 
1047
  $get_args = array(
1048
- 'page' => $page,
1049
- 'per_page' => $per_page,
1050
- 'max' => $max,
1051
- 'sort' => $sort,
1052
- 'display_comments' => $display_comments,
1053
- 'show_hidden' => $show_hidden,
1054
- 'in' => $activity_ids,
1055
- 'spam' => $spam,
1056
- 'update_meta_cache' => $update_meta_cache,
1057
  );
 
1058
  return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $get_args ), $args, $get_args );
1059
  }
1060
 
1061
  /**
1062
  * Add an activity item.
1063
  *
1064
- * @since BuddyPress (1.1)
1065
  *
1066
  * @uses wp_parse_args()
1067
  * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
@@ -1104,56 +1180,60 @@ function bp_activity_get_specific( $args = '' ) {
1104
  */
1105
  function bp_activity_add( $args = '' ) {
1106
 
1107
- $defaults = array(
1108
- 'id' => false, // Pass an existing activity ID to update an existing entry.
1109
-
1110
- 'action' => '', // The activity action - e.g. "Jon Doe posted an update"
1111
- 'content' => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!"
1112
-
1113
- 'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent
1114
- 'type' => false, // The activity type e.g. activity_update, profile_updated
1115
- 'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink)
1116
-
1117
- 'user_id' => bp_loggedin_user_id(), // Optional: The user to record the activity for, can be false if this activity is not for a user.
1118
- 'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id
1119
- 'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
1120
  'recorded_time' => bp_core_current_time(), // The GMT time that this activity was recorded
1121
- 'hide_sitewide' => false, // Should this be hidden on the sitewide activity stream?
1122
- 'is_spam' => false, // Is this activity item to be marked as spam?
1123
- );
1124
- $params = wp_parse_args( $args, $defaults );
1125
- extract( $params, EXTR_SKIP );
1126
 
1127
  // Make sure we are backwards compatible
1128
- if ( empty( $component ) && !empty( $component_name ) )
1129
- $component = $component_name;
 
1130
 
1131
- if ( empty( $type ) && !empty( $component_action ) )
1132
- $type = $component_action;
 
1133
 
1134
  // Setup activity to be added
1135
- $activity = new BP_Activity_Activity( $id );
1136
- $activity->user_id = $user_id;
1137
- $activity->component = $component;
1138
- $activity->type = $type;
1139
- $activity->content = $content;
1140
- $activity->primary_link = $primary_link;
1141
- $activity->item_id = $item_id;
1142
- $activity->secondary_item_id = $secondary_item_id;
1143
- $activity->date_recorded = $recorded_time;
1144
- $activity->hide_sitewide = $hide_sitewide;
1145
- $activity->is_spam = $is_spam;
1146
- $activity->action = ! empty( $action ) ? $action : bp_activity_generate_action_string( $activity );
1147
-
1148
- if ( !$activity->save() )
 
 
1149
  return false;
 
1150
 
1151
  // If this is an activity comment, rebuild the tree
1152
- if ( 'activity_comment' == $activity->type )
 
 
 
1153
  BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id );
 
1154
 
1155
  wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
1156
- do_action( 'bp_activity_add', $params );
1157
 
1158
  return $activity->id;
1159
  }
@@ -1161,9 +1241,8 @@ function bp_activity_add( $args = '' ) {
1161
  /**
1162
  * Post an activity update.
1163
  *
1164
- * @since BuddyPress (1.2)
1165
  *
1166
- * @global object $bp BuddyPress global settings.
1167
  * @uses wp_parse_args()
1168
  * @uses bp_is_user_inactive()
1169
  * @uses bp_core_get_userlink()
@@ -1182,41 +1261,42 @@ function bp_activity_add( $args = '' ) {
1182
  * @return int $activity_id The activity id
1183
  */
1184
  function bp_activity_post_update( $args = '' ) {
1185
- global $bp;
1186
 
1187
- $defaults = array(
1188
  'content' => false,
1189
  'user_id' => bp_loggedin_user_id()
1190
- );
1191
- $r = wp_parse_args( $args, $defaults );
1192
- extract( $r, EXTR_SKIP );
1193
 
1194
- if ( empty( $content ) || !strlen( trim( $content ) ) )
1195
  return false;
 
1196
 
1197
- if ( bp_is_user_inactive( $user_id ) )
1198
  return false;
 
1199
 
1200
  // Record this on the user's profile
1201
- $from_user_link = bp_core_get_userlink( $user_id );
1202
- $activity_content = $content;
1203
- $primary_link = bp_core_get_userlink( $user_id, false, true );
1204
 
1205
  // Now write the values
1206
  $activity_id = bp_activity_add( array(
1207
- 'user_id' => $user_id,
1208
  'content' => apply_filters( 'bp_activity_new_update_content', $activity_content ),
1209
  'primary_link' => apply_filters( 'bp_activity_new_update_primary_link', $primary_link ),
1210
- 'component' => $bp->activity->id,
1211
  'type' => 'activity_update',
1212
  ) );
1213
 
1214
- $activity_content = apply_filters( 'bp_activity_latest_update_content', $content, $activity_content );
1215
 
1216
  // Add this update to the "latest update" usermeta so it can be fetched anywhere.
1217
- bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $activity_content ) );
 
 
 
1218
 
1219
- do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
1220
 
1221
  return $activity_id;
1222
  }
@@ -1224,7 +1304,7 @@ function bp_activity_post_update( $args = '' ) {
1224
  /**
1225
  * Add an activity comment.
1226
  *
1227
- * @since BuddyPress (1.2)
1228
  *
1229
  * @global object $bp BuddyPress global settings.
1230
  * @uses wp_parse_args()
@@ -1239,18 +1319,18 @@ function bp_activity_post_update( $args = '' ) {
1239
  * @type int $id Optional. Pass an ID to update an existing comment.
1240
  * @type string $content The content of the comment.
1241
  * @type int $user_id Optional. The ID of the user making the comment.
1242
- * Defaults to the ID of the logged-in user.
1243
  * @type int $activity_id The ID of the "root" activity item, ie the oldest
1244
- * ancestor of the comment.
1245
  * @type int $parent_id Optional. The ID of the parent activity item, ie the
1246
- * item to which the comment is an immediate reply. If
1247
- * not provided, this value defaults to the $activity_id.
1248
  * }
1249
  * @return int|bool The ID of the comment on success, otherwise false.
1250
  */
1251
  function bp_activity_new_comment( $args = '' ) {
1252
 
1253
- $params = wp_parse_args( $args, array(
1254
  'id' => false,
1255
  'content' => false,
1256
  'user_id' => bp_loggedin_user_id(),
@@ -1258,31 +1338,31 @@ function bp_activity_new_comment( $args = '' ) {
1258
  'parent_id' => false // ID of a parent comment (optional)
1259
  ) );
1260
 
1261
- extract( $params, EXTR_SKIP );
1262
-
1263
  // Bail if missing necessary data
1264
- if ( empty( $content ) || empty( $user_id ) || empty( $activity_id ) ) {
1265
  return false;
1266
  }
1267
 
1268
  // Maybe set current activity ID as the parent
1269
- if ( empty( $parent_id ) ) {
1270
- $parent_id = $activity_id;
1271
  }
1272
 
 
 
1273
  // Check to see if the parent activity is hidden, and if so, hide this comment publically.
1274
  $activity = new BP_Activity_Activity( $activity_id );
1275
  $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
1276
 
1277
  // Insert the activity comment
1278
  $comment_id = bp_activity_add( array(
1279
- 'id' => $id,
1280
- 'content' => apply_filters( 'bp_activity_comment_content', $content ),
1281
  'component' => buddypress()->activity->id,
1282
  'type' => 'activity_comment',
1283
- 'user_id' => $user_id,
1284
  'item_id' => $activity_id,
1285
- 'secondary_item_id' => $parent_id,
1286
  'hide_sitewide' => $is_hidden
1287
  ) );
1288
 
@@ -1290,7 +1370,7 @@ function bp_activity_new_comment( $args = '' ) {
1290
  wp_cache_delete( $activity_id, 'bp_activity_comments' );
1291
 
1292
  // Walk the tree to clear caches for all parent items
1293
- $clear_id = $parent_id;
1294
  while ( $clear_id != $activity_id ) {
1295
  $clear_object = new BP_Activity_Activity( $clear_id );
1296
  wp_cache_delete( $clear_id, 'bp_activity' );
@@ -1298,7 +1378,7 @@ function bp_activity_new_comment( $args = '' ) {
1298
  }
1299
  wp_cache_delete( $activity_id, 'bp_activity' );
1300
 
1301
- do_action( 'bp_activity_comment_posted', $comment_id, $params, $activity );
1302
 
1303
  return $comment_id;
1304
  }
@@ -1306,7 +1386,7 @@ function bp_activity_new_comment( $args = '' ) {
1306
  /**
1307
  * Fetch the activity_id for an existing activity entry in the DB.
1308
  *
1309
- * @since BuddyPress (1.2)
1310
  *
1311
  * @see BP_Activity_Activity::get() For more information on accepted arguments.
1312
  * @uses wp_parse_args()
@@ -1317,7 +1397,8 @@ function bp_activity_new_comment( $args = '' ) {
1317
  * @return int $activity_id The ID of the activity item found.
1318
  */
1319
  function bp_activity_get_activity_id( $args = '' ) {
1320
- $defaults = array(
 
1321
  'user_id' => false,
1322
  'component' => false,
1323
  'type' => false,
@@ -1326,12 +1407,18 @@ function bp_activity_get_activity_id( $args = '' ) {
1326
  'action' => false,
1327
  'content' => false,
1328
  'date_recorded' => false,
1329
- );
1330
-
1331
- $r = wp_parse_args( $args, $defaults );
1332
- extract( $r, EXTR_SKIP );
1333
 
1334
- return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) );
 
 
 
 
 
 
 
 
 
1335
  }
1336
 
1337
  /**
@@ -1347,7 +1434,7 @@ function bp_activity_get_activity_id( $args = '' ) {
1347
  *
1348
  * If you are deleting an activity comment please use bp_activity_delete_comment();
1349
  *
1350
- * @since BuddyPress (1.0)
1351
  *
1352
  * @see BP_Activity_Activity::get() For more information on accepted arguments.
1353
  * @uses wp_parse_args()
@@ -1369,7 +1456,7 @@ function bp_activity_get_activity_id( $args = '' ) {
1369
  function bp_activity_delete( $args = '' ) {
1370
 
1371
  // Pass one or more the of following variables to delete by those variables
1372
- $defaults = array(
1373
  'id' => false,
1374
  'action' => false,
1375
  'content' => false,
@@ -1381,23 +1468,22 @@ function bp_activity_delete( $args = '' ) {
1381
  'secondary_item_id' => false,
1382
  'date_recorded' => false,
1383
  'hide_sitewide' => false
1384
- );
1385
-
1386
- $args = wp_parse_args( $args, $defaults );
1387
 
1388
  do_action( 'bp_before_activity_delete', $args );
1389
 
1390
  // Adjust the new mention count of any mentioned member
1391
  bp_activity_adjust_mention_count( $args['id'], 'delete' );
1392
 
1393
- if ( !$activity_ids_deleted = BP_Activity_Activity::delete( $args ) )
 
1394
  return false;
 
1395
 
1396
  // Check if the user's latest update has been deleted
1397
- if ( empty( $args['user_id'] ) )
1398
- $user_id = bp_loggedin_user_id();
1399
- else
1400
- $user_id = $args['user_id'];
1401
 
1402
  $latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true );
1403
  if ( !empty( $latest_update ) ) {
@@ -1419,7 +1505,7 @@ function bp_activity_delete( $args = '' ) {
1419
  *
1420
  * You should use bp_activity_delete() instead.
1421
  *
1422
- * @since BuddyPress (1.1)
1423
  * @deprecated BuddyPress (1.2)
1424
  *
1425
  * @uses wp_parse_args()
@@ -1432,23 +1518,21 @@ function bp_activity_delete( $args = '' ) {
1432
  */
1433
  function bp_activity_delete_by_item_id( $args = '' ) {
1434
 
1435
- $defaults = array(
1436
  'item_id' => false,
1437
  'component' => false,
1438
  'type' => false,
1439
  'user_id' => false,
1440
  'secondary_item_id' => false
1441
- );
1442
- $r = wp_parse_args( $args, $defaults );
1443
- extract( $r, EXTR_SKIP );
1444
 
1445
- return bp_activity_delete( array( 'item_id' => $item_id, 'component' => $component, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) );
1446
  }
1447
 
1448
  /**
1449
  * Delete an activity item by activity id.
1450
  *
1451
- * @since BuddyPress (1.1)
1452
  *
1453
  * @uses bp_activity_delete()
1454
  *
@@ -1464,7 +1548,7 @@ function bp_activity_delete( $args = '' ) {
1464
  *
1465
  * You should use bp_activity_delete() instead.
1466
  *
1467
- * @since BuddyPress (1.1)
1468
  * @deprecated BuddyPress (1.2)
1469
  *
1470
  * @uses bp_activity_delete()
@@ -1476,7 +1560,12 @@ function bp_activity_delete( $args = '' ) {
1476
  * @return bool True on success, false on failure.
1477
  */
1478
  function bp_activity_delete_by_content( $user_id, $content, $component, $type ) {
1479
- return bp_activity_delete( array( 'user_id' => $user_id, 'content' => $content, 'component' => $component, 'type' => $type ) );
 
 
 
 
 
1480
  }
1481
 
1482
  /**
@@ -1484,7 +1573,7 @@ function bp_activity_delete( $args = '' ) {
1484
  *
1485
  * You should use bp_activity_delete() instead.
1486
  *
1487
- * @since BuddyPress (1.1)
1488
  * @deprecated BuddyPress (1.2)
1489
  *
1490
  * @uses bp_activity_delete()
@@ -1494,13 +1583,16 @@ function bp_activity_delete( $args = '' ) {
1494
  * @return bool True on success, false on failure.
1495
  */
1496
  function bp_activity_delete_for_user_by_component( $user_id, $component ) {
1497
- return bp_activity_delete( array( 'user_id' => $user_id, 'component' => $component ) );
 
 
 
1498
  }
1499
 
1500
  /**
1501
  * Delete an activity comment.
1502
  *
1503
- * @since BuddyPress (1.2)
1504
  *
1505
  * @uses apply_filters() To call the 'bp_activity_delete_comment_pre' hook.
1506
  * @uses bp_activity_delete_children()
@@ -1522,15 +1614,20 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
1522
  * You may want to hook into this filter if you want to override this function and
1523
  * handle the deletion of child comments differently. Make sure you return false.
1524
  */
1525
- if ( !apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) )
1526
  return false;
 
1527
 
1528
  // Delete any children of this comment.
1529
  bp_activity_delete_children( $activity_id, $comment_id );
1530
 
1531
  // Delete the actual comment
1532
- if ( !bp_activity_delete( array( 'id' => $comment_id, 'type' => 'activity_comment' ) ) )
1533
  return false;
 
 
 
 
1534
 
1535
  // Recalculate the comment tree
1536
  BP_Activity_Activity::rebuild_activity_comment_tree( $activity_id );
@@ -1543,24 +1640,34 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
1543
  /**
1544
  * Delete an activity comment's children.
1545
  *
1546
- * @since BuddyPress (1.2)
1547
  *
1548
  * @uses BP_Activity_Activity::get_child_comments() {@link BP_Activity_Activity}
1549
  * @uses bp_activity_delete_children()
1550
  * @uses bp_activity_delete()
1551
  *
1552
  * @param int $activity_id The ID of the "root" activity, ie the
1553
- * comment's oldest ancestor.
1554
  * @param int $comment_id The ID of the comment to be deleted.
1555
  */
1556
- function bp_activity_delete_children( $activity_id, $comment_id) {
 
 
 
 
1557
  // Recursively delete all children of this comment.
1558
- if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) {
1559
  foreach( (array) $children as $child ) {
1560
  bp_activity_delete_children( $activity_id, $child->id );
1561
  }
1562
  }
1563
- bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', 'item_id' => $activity_id ) );
 
 
 
 
 
 
1564
  }
1565
 
1566
  /**
@@ -1571,7 +1678,7 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
1571
  * be sure to pass the full $activity_obj parameter as well, if you already
1572
  * have it available.
1573
  *
1574
- * @since BuddyPress (1.2)
1575
  *
1576
  * @uses bp_get_root_domain()
1577
  * @uses bp_get_activity_root_slug()
@@ -1583,8 +1690,9 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
1583
  */
1584
  function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
1585
 
1586
- if ( empty( $activity_obj ) )
1587
  $activity_obj = new BP_Activity_Activity( $activity_id );
 
1588
 
1589
  if ( isset( $activity_obj->current_comment ) ) {
1590
  $activity_obj = $activity_obj->current_comment;
@@ -1606,7 +1714,7 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
1606
  /**
1607
  * Hide a user's activity.
1608
  *
1609
- * @since BuddyPress (1.2)
1610
  *
1611
  * @uses BP_Activity_Activity::hide_all_for_user() {@link BP_Activity_Activity}
1612
  *
@@ -1627,18 +1735,18 @@ function bp_activity_hide_user_activity( $user_id ) {
1627
  * through the content, grabs the first image and converts it to a thumbnail,
1628
  * and removes the rest of the images from the string.
1629
  *
1630
- * @since BuddyPress (1.2)
1631
  *
1632
  * @uses esc_attr()
1633
  * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
1634
  *
1635
  * @param string $content The content of the activity item.
1636
  * @param string $link Optional. The unescaped URL that the image should link
1637
- * to. If absent, the image will not be a link.
1638
- * @param array $activity_args Optional. The args passed to the activity
1639
- * creation function (eg bp_blogs_record_activity()).
1640
  * @return string $content The content with images stripped and replaced with a
1641
- * single thumb.
1642
  */
1643
  function bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) {
1644
 
@@ -1648,17 +1756,18 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
1648
  $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>([^\[\[]*\[\/caption\])?|', '', $content );
1649
 
1650
  if ( !empty( $matches ) && !empty( $matches[0] ) ) {
 
1651
  // Get the SRC value
1652
- preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src );
1653
 
1654
  // Get the width and height
1655
  preg_match( '/<img.*?(height\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $height );
1656
  preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $width );
1657
 
1658
  if ( !empty( $src ) ) {
1659
- $src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 );
1660
  $height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
1661
- $width = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 );
1662
 
1663
  if ( empty( $width ) || empty( $height ) ) {
1664
  $width = 100;
@@ -1684,7 +1793,7 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
1684
  /**
1685
  * Fetch whether the current user is allowed to mark items as spam.
1686
  *
1687
- * @since BuddyPress (1.6)
1688
  *
1689
  * @return bool True if user is allowed to mark activity items as spam.
1690
  */
@@ -1695,17 +1804,15 @@ function bp_activity_user_can_mark_spam() {
1695
  /**
1696
  * Mark an activity item as spam.
1697
  *
1698
- * @since BuddyPress (1.6)
1699
- *
1700
- * @global object $bp BuddyPress global settings.
1701
  *
1702
  * @param BP_Activity_Activity $activity The activity item to be spammed.
1703
  * @param string $source Optional. Default is "by_a_person" (ie, a person has
1704
- * manually marked the activity as spam). BP core also
1705
- * accepts 'by_akismet'.
1706
  */
1707
  function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
1708
- global $bp;
1709
 
1710
  $activity->is_spam = 1;
1711
 
@@ -1735,17 +1842,15 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
1735
  /**
1736
  * Mark an activity item as ham.
1737
  *
1738
- * @since BuddyPress (1.6)
1739
- *
1740
- * @global object $bp BuddyPress global settings.
1741
  *
1742
  * @param BP_Activity_Activity $activity The activity item to be hammed.
1743
  * @param string $source Optional. Default is "by_a_person" (ie, a person has
1744
- * manually marked the activity as spam). BP core also
1745
- * accepts 'by_akismet'.
1746
  */
1747
  function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
1748
- global $bp;
1749
 
1750
  $activity->is_spam = 0;
1751
 
@@ -1785,7 +1890,7 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
1785
  * This does not cover recursive activity comments, as they do not use a real loop.
1786
  * For that, see {@link bp_activity_comment_embed()}.
1787
  *
1788
- * @since BuddyPress (1.5)
1789
  *
1790
  * @see BP_Embed
1791
  * @see bp_embed_activity_cache()
@@ -1809,7 +1914,7 @@ add_action( 'activity_loop_start', 'bp_activity_embed' );
1809
  * necessary to grab each comment's embeds from the cache, or put them in
1810
  * the cache if they are not there yet.
1811
  *
1812
- * @since BuddyPress (1.5)
1813
  *
1814
  * @see BP_Embed
1815
  * @see bp_embed_activity_cache()
@@ -1828,10 +1933,9 @@ add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' );
1828
  /**
1829
  * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content.
1830
  *
1831
- * @since BuddyPress (1.5)
1832
  *
1833
  * @see BP_Embed
1834
- * @global object $bp BuddyPress global settings
1835
  * @uses add_filter() To attach create_function() to 'embed_post_id'.
1836
  * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'.
1837
  * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'.
@@ -1839,15 +1943,14 @@ add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' );
1839
  * @param object $activity The activity that is being expanded.
1840
  */
1841
  function bp_dtheme_embed_read_more( $activity ) {
1842
- global $bp;
1843
 
1844
- $bp->activity->read_more_id = $activity->id;
1845
-
1846
- add_filter( 'embed_post_id', create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) );
1847
- add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 );
1848
- add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
1849
  }
1850
- add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
 
1851
 
1852
  /**
1853
  * Clean up 'embed_post_id' filter after comment recursion.
@@ -1855,7 +1958,7 @@ add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more'
1855
  * This filter must be removed so that the non-comment filters take over again
1856
  * once the comments are done being processed.
1857
  *
1858
- * @since BuddyPress (1.5)
1859
  *
1860
  * @see bp_activity_comment_embed()
1861
  * @uses remove_filter() To remove 'bp_get_activity_comment_id' from 'embed_post_id'.
@@ -1870,13 +1973,13 @@ add_action( 'bp_after_activity_comment', 'bp_activity_comment_embed_after_recurs
1870
  *
1871
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
1872
  *
1873
- * @since BuddyPress (1.5)
1874
  *
1875
  * @see BP_Embed::parse_oembed()
1876
  * @uses bp_activity_get_meta()
1877
  *
1878
  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
1879
- * functions like this one to filter.
1880
  * @param int $id The ID of the activity item.
1881
  * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
1882
  * @return mixed The cached embeds for this activity item.
@@ -1890,15 +1993,15 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) {
1890
  *
1891
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
1892
  *
1893
- * @since BuddyPress (1.5)
1894
  *
1895
  * @see BP_Embed::parse_oembed()
1896
  * @uses bp_activity_update_meta()
1897
  *
1898
  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
1899
- * functions like this one to filter.
1900
- * @param int $id The ID of the activity item.
1901
  * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
 
1902
  * @return bool True on success, false on failure.
1903
  */
1904
  function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
15
  /**
16
  * Check whether the $bp global lists an activity directory page.
17
  *
18
+ * @since BuddyPress (1.5.0)
 
 
19
  *
20
  * @return bool True if activity directory page is found, otherwise false.
21
  */
22
  function bp_activity_has_directory() {
23
+ return (bool) !empty( buddypress()->pages->activity->id );
 
 
24
  }
25
 
26
  /**
38
  *
39
  * add_filter( 'bp_activity_do_mentions', '__return_false' );
40
  *
41
+ * @since BuddyPress (1.8.0)
42
  *
43
  * @uses apply_filters() To call 'bp_activity_do_mentions' hook.
44
  *
48
  return (bool) apply_filters( 'bp_activity_do_mentions', true );
49
  }
50
 
51
+ /**
52
+ * Should BuddyPress load the mentions scripts and related assets, including results to prime the
53
+ * mentions suggestions?
54
+ *
55
+ * @return bool True if mentions scripts should be loaded.
56
+ * @since BuddyPress (2.1.0)
57
+ */
58
+ function bp_activity_maybe_load_mentions_scripts() {
59
+ $retval =
60
+ bp_activity_do_mentions() &&
61
+ bp_is_user_active() &&
62
+ ( bp_is_activity_component() || bp_is_blog_page() && is_singular() && comments_open() || is_admin() );
63
+
64
+ return (bool) apply_filters( 'bp_activity_maybe_load_mentions_scripts', $retval );
65
+ }
66
+
67
  /**
68
  * Locate usernames in an activity content string, as designated by an @ sign.
69
  *
70
+ * @since BuddyPress (1.5.0)
71
  *
72
+ * @param string $content The content of the activity, usually found in
73
+ * $activity->content.
74
+ * @return array|bool Associative array with user ID as key and username as
75
+ * value. Boolean false if no mentions found.
76
  */
77
  function bp_activity_find_mentions( $content ) {
78
+
79
  $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/';
80
  preg_match_all( $pattern, $content, $usernames );
81
 
82
  // Make sure there's only one instance of each username
83
+ $usernames = array_unique( $usernames[1] );
84
+
85
+ // Bail if no usernames
86
+ if ( empty( $usernames ) ) {
87
  return false;
88
+ }
89
 
90
  $mentioned_users = array();
91
 
92
  // We've found some mentions! Check to see if users exist
93
+ foreach( (array) array_values( $usernames ) as $username ) {
94
  $user_id = bp_activity_get_userid_from_mentionname( $username );
95
 
96
  // user ID exists, so let's add it to our array
97
  if ( ! empty( $user_id ) ) {
98
+ $mentioned_users[ $user_id ] = $username;
99
  }
100
  }
101
 
102
+ if ( empty( $mentioned_users ) ) {
103
  return false;
104
+ }
105
 
106
  return $mentioned_users;
107
  }
109
  /**
110
  * Reset a user's unread mentions list and count.
111
  *
112
+ * @since BuddyPress (1.5.0)
113
  *
114
  * @uses bp_delete_user_meta()
115
  *
117
  */
118
  function bp_activity_clear_new_mentions( $user_id ) {
119
  bp_delete_user_meta( $user_id, 'bp_new_mention_count' );
120
+ bp_delete_user_meta( $user_id, 'bp_new_mentions' );
121
  }
122
 
123
  /**
128
  *
129
  * Currently, only used in {@link bp_activity_delete()}.
130
  *
131
+ * @since BuddyPress (1.5.0)
132
  *
133
  * @uses bp_activity_find_mentions()
134
  * @uses bp_activity_update_mention_count_for_user()
137
  * @param string $action Can be 'delete' or 'add'. Defaults to 'add'.
138
  */
139
  function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
140
+
141
+ // Bail if no activity ID passed
142
+ if ( empty( $activity_id ) ) {
143
  return false;
144
+ }
145
 
146
  // Get activity object
147
+ $activity = new BP_Activity_Activity( (int) $activity_id );
148
 
149
  // Try to find mentions
150
  $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) );
151
 
152
  // Still empty? Stop now
153
+ if ( empty( $usernames ) ) {
154
  return false;
155
+ }
156
 
157
  // Increment mention count foreach mentioned user
158
+ foreach( (array) array_keys( $usernames ) as $user_id ) {
159
  bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action );
160
  }
161
  }
166
  * This function should be used when you've already parsed your activity item
167
  * for @mentions.
168
  *
169
+ * @since BuddyPress (1.7.0)
170
  *
171
  * @uses bp_get_user_meta()
172
  * @uses bp_update_user_meta()
177
  * @return bool
178
  */
179
  function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action = 'add' ) {
180
+
181
+ if ( empty( $user_id ) || empty( $activity_id ) ) {
182
  return false;
183
+ }
184
 
185
  // Adjust the mention list and count for the member
186
  $new_mention_count = (int) bp_get_user_meta( $user_id, 'bp_new_mention_count', true );
187
+ $new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true );
188
+
189
+ // Make sure new mentions is an array
190
+ if ( empty( $new_mentions ) ) {
191
  $new_mentions = array();
192
+ }
193
 
194
  switch ( $action ) {
195
  case 'delete' :
305
  * @param string $type The action type.
306
  * @param string $description The action description.
307
  * @param callable $format_callback Callback for formatting the action string.
308
+ * @param string $label String to describe this action in the activity stream
309
+ * filter dropdown.
310
+ * @param array $context Activity stream contexts where the filter should appear.
311
+ * 'activity', 'member', 'member_groups', 'group'
312
  * @return bool False if any param is empty, otherwise true.
313
  */
314
+ function bp_activity_set_action( $component_id, $type, $description, $format_callback = false, $label = false, $context = array() ) {
315
  $bp = buddypress();
316
 
317
  // Return false if any of the above values are not set
337
  'key' => $type,
338
  'value' => $description,
339
  'format_callback' => $format_callback,
340
+ 'label' => $label,
341
+ 'context' => $context,
342
+ ), $component_id, $type, $description, $format_callback, $label, $context );
343
 
344
  return true;
345
  }
347
  /**
348
  * Retreive the current action from a component and key.
349
  *
350
+ * @since BuddyPress (1.1.0)
351
  *
 
352
  * @uses apply_filters() To call the 'bp_activity_get_action' hook.
353
  *
354
  * @param string $component_id The unique string ID of the component.
356
  * @return string|bool Action value if found, otherwise false.
357
  */
358
  function bp_activity_get_action( $component_id, $key ) {
 
359
 
360
  // Return false if any of the above values are not set
361
+ if ( empty( $component_id ) || empty( $key ) ) {
362
  return false;
363
+ }
364
+
365
+ $bp = buddypress();
366
+ $retval = isset( $bp->activity->actions->{$component_id}->{$key} )
367
+ ? $bp->activity->actions->{$component_id}->{$key}
368
+ : false;
369
 
370
+ return apply_filters( 'bp_activity_get_action', $retval, $component_id, $key );
371
  }
372
 
373
  /**
374
  * Fetch details of all registered activity types.
375
  *
376
+ * @since BuddyPress (1.7.0)
377
  *
378
  * @return array array( type => description ), ...
379
  */
384
  foreach ( buddypress()->activity->actions as $action ) {
385
  $action = array_values( (array) $action );
386
 
387
+ for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
388
  $actions[ $action[$i]['key'] ] = $action[$i]['value'];
389
+ }
390
  }
391
 
392
  // This was a mis-named activity type from before BP 1.6
400
  /**
401
  * Get a users favorite activity stream items.
402
  *
403
+ * @since BuddyPress (1.2.0)
404
  *
405
  * @uses bp_get_user_meta()
406
  * @uses apply_filters() To call the 'bp_activity_get_user_favorites' hook.
411
  function bp_activity_get_user_favorites( $user_id = 0 ) {
412
 
413
  // Fallback to logged in user if no user_id is passed
414
+ if ( empty( $user_id ) ) {
415
  $user_id = bp_displayed_user_id();
416
+ }
417
 
418
  // Get favorites for user
419
  $favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
424
  /**
425
  * Add an activity stream item as a favorite for a user.
426
  *
427
+ * @since BuddyPress (1.2.0)
428
  *
429
  * @uses is_user_logged_in()
430
  * @uses bp_get_user_meta()
441
  function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
442
 
443
  // Favorite activity stream items are for logged in users only
444
+ if ( ! is_user_logged_in() ) {
445
  return false;
446
+ }
447
 
448
  // Fallback to logged in user if no user_id is passed
449
+ if ( empty( $user_id ) ) {
450
  $user_id = bp_loggedin_user_id();
451
+ }
452
 
453
  $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
454
  if ( empty( $my_favs ) || ! is_array( $my_favs ) ) {
491
  /**
492
  * Remove an activity stream item as a favorite for a user.
493
  *
494
+ * @since BuddyPress (1.2.0)
495
  *
496
  * @uses is_user_logged_in()
497
  * @uses bp_get_user_meta()
507
  function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
508
 
509
  // Favorite activity stream items are for logged in users only
510
+ if ( ! is_user_logged_in() ) {
511
  return false;
512
+ }
513
 
514
  // Fallback to logged in user if no user_id is passed
515
+ if ( empty( $user_id ) ) {
516
  $user_id = bp_loggedin_user_id();
517
+ }
518
 
519
  $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
520
  $my_favs = array_flip( (array) $my_favs );
529
  $my_favs = array_unique( array_flip( $my_favs ) );
530
 
531
  // Update the total number of users who have favorited this activity
532
+ $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' );
533
+ if ( ! empty( $fav_count ) ) {
534
 
535
  // Deduct from total favorites
536
  if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int) $fav_count - 1 ) ) {
563
  /**
564
  * Check whether an activity item exists with a given content string.
565
  *
566
+ * @since BuddyPress (1.1.0)
567
  *
568
  * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity}
569
  * @uses apply_filters() To call the 'bp_activity_check_exists_by_content' hook.
578
  /**
579
  * Retrieve the last time activity was updated.
580
  *
581
+ * @since BuddyPress (1.0.0)
582
  *
583
  * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity}
584
  * @uses apply_filters() To call the 'bp_activity_get_last_updated' hook.
592
  /**
593
  * Retrieve the number of favorite activity stream items a user has.
594
  *
595
+ * @since BuddyPress (1.2.0)
596
  *
597
  * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
598
  *
602
  function bp_activity_total_favorites_for_user( $user_id = 0 ) {
603
 
604
  // Fallback on displayed user, and then logged in user
605
+ if ( empty( $user_id ) ) {
606
  $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
607
+ }
608
 
609
  return BP_Activity_Activity::total_favorite_count( $user_id );
610
  }
632
  * @return bool True on success, false on failure.
633
  */
634
  function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '', $delete_all = false ) {
 
635
 
636
  // Legacy - if no meta_key is passed, delete all for the item
637
  if ( empty( $meta_key ) ) {
658
  /**
659
  * Get metadata for a given activity item.
660
  *
661
+ * @since BuddyPress (1.2.0)
662
  *
663
  * @uses apply_filters() To call the 'bp_activity_get_meta' hook.
664
  *
683
  /**
684
  * Update a piece of activity meta.
685
  *
686
+ * @since BuddyPress (1.2.0)
687
  *
688
  * @param int $activity_id ID of the activity item whose metadata is being
689
  * updated.
712
  * @param int $activity_id ID of the activity item.
713
  * @param string $meta_key Metadata key.
714
  * @param mixed $meta_value Metadata value.
715
+ * @param bool $unique Optional. Whether to enforce a single metadata value
716
  * for the given key. If true, and the object already has a value for
717
  * the key, no change will be made. Default: false.
718
  * @return int|bool The meta ID on successful update, false on failure.
730
  /**
731
  * Completely remove a user's activity data.
732
  *
733
+ * @since BuddyPress (1.5.0)
734
  *
735
  * @uses is_user_logged_in()
736
  * @uses bp_activity_delete()
743
  function bp_activity_remove_all_user_data( $user_id = 0 ) {
744
 
745
  // Do not delete user data unless a logged in user says so
746
+ if ( empty( $user_id ) || ! is_user_logged_in() ) {
747
  return false;
748
+ }
749
 
750
  // Clear the user's activity from the sitewide stream and clear their activity tables
751
  bp_activity_delete( array( 'user_id' => $user_id ) );
752
 
753
  // Remove any usermeta
754
+ bp_delete_user_meta( $user_id, 'bp_latest_update' );
755
  bp_delete_user_meta( $user_id, 'bp_favorite_activities' );
756
 
757
  // Execute additional code
766
  /**
767
  * Mark all of the user's activity as spam.
768
  *
769
+ * @since BuddyPress (1.6.0)
770
  *
771
  * @global object $wpdb WordPress database access object.
772
  * @global object $bp BuddyPress global settings.
774
  * @param int $user_id ID of the user whose activity is being spammed.
775
  */
776
  function bp_activity_spam_all_user_data( $user_id = 0 ) {
777
+ global $wpdb;
778
 
779
  // Do not delete user data unless a logged in user says so
780
+ if ( empty( $user_id ) || ! is_user_logged_in() ) {
781
  return false;
782
+ }
783
 
784
  // Get all the user's activities.
785
+ $activities = bp_activity_get( array(
786
+ 'display_comments' => 'stream',
787
+ 'filter' => array( 'user_id' => $user_id ),
788
+ 'show_hidden' => true
789
+ ) );
790
+
791
+ $bp = buddypress();
792
 
793
  // Mark each as spam
794
  foreach ( (array) $activities['activities'] as $activity ) {
795
 
796
  // Create an activity object
797
  $activity_obj = new BP_Activity_Activity;
798
+ foreach ( $activity as $k => $v ) {
799
  $activity_obj->$k = $v;
800
+ }
801
 
802
  // Mark as spam
803
  bp_activity_mark_as_spam( $activity_obj );
809
  * as we're going to be updating all the activity statuses directly, for efficency,
810
  * we need to update manually.
811
  */
812
+ if ( ! empty( $bp->activity->akismet ) ) {
813
  $bp->activity->akismet->update_activity_spam_meta( $activity_obj );
814
+ }
815
 
816
  // Tidy up
817
  unset( $activity_obj );
828
  /**
829
  * Mark all of the user's activity as ham (not spam).
830
  *
831
+ * @since BuddyPress (1.6.0)
832
  *
833
  * @global object $wpdb WordPress database access object.
834
  * @global object $bp BuddyPress global settings.
836
  * @param int $user_id ID of the user whose activity is being hammed.
837
  */
838
  function bp_activity_ham_all_user_data( $user_id = 0 ) {
839
+ global $wpdb;
840
 
841
  // Do not delete user data unless a logged in user says so
842
+ if ( empty( $user_id ) || ! is_user_logged_in() ) {
843
  return false;
844
+ }
845
 
846
  // Get all the user's activities.
847
+ $activities = bp_activity_get( array(
848
+ 'display_comments' => 'stream',
849
+ 'filter' => array( 'user_id' => $user_id ),
850
+ 'show_hidden' => true,
851
+ 'spam' => 'all'
852
+ ) );
853
+
854
+ $bp = buddypress();
855
 
856
  // Mark each as not spam
857
  foreach ( (array) $activities['activities'] as $activity ) {
858
 
859
  // Create an activity object
860
  $activity_obj = new BP_Activity_Activity;
861
+ foreach ( $activity as $k => $v ) {
862
  $activity_obj->$k = $v;
863
+ }
864
 
865
  // Mark as not spam
866
  bp_activity_mark_as_ham( $activity_obj );
872
  * as we're going to be updating all the activity statuses directly, for efficency,
873
  * we need to update manually.
874
  */
875
+ if ( ! empty( $bp->activity->akismet ) ) {
876
  $bp->activity->akismet->update_activity_ham_meta( $activity_obj );
877
+ }
878
 
879
  // Tidy up
880
  unset( $activity_obj );
891
  /**
892
  * Register the activity stream actions for updates
893
  *
894
+ * @since BuddyPress (1.6.0)
 
 
895
  */
896
  function bp_activity_register_activity_actions() {
897
+ $bp = buddypress();
898
 
899
  bp_activity_set_action(
900
  $bp->activity->id,
901
  'activity_update',
902
  __( 'Posted a status update', 'buddypress' ),
903
+ 'bp_activity_format_activity_action_activity_update',
904
+ __( 'Updates', 'buddypress' ),
905
+ array( 'activity', 'group', 'member', 'member_groups' )
906
  );
907
 
908
  bp_activity_set_action(
909
  $bp->activity->id,
910
  'activity_comment',
911
  __( 'Replied to a status update', 'buddypress' ),
912
+ 'bp_activity_format_activity_action_activity_comment',
913
+ __( 'Activity Comments', 'buddypress' )
914
  );
915
 
916
  do_action( 'bp_activity_register_activity_actions' );
928
  * the formatted action string.
929
  */
930
  function bp_activity_generate_action_string( $activity ) {
931
+
932
  // Check for valid input
933
  if ( empty( $activity->component ) || empty( $activity->type ) ) {
934
  return false;
995
  * the default for the bp_activity_get()).
996
  * - 'per_page' (false)
997
  *
998
+ * @since BuddyPress (1.2.0)
999
  *
1000
  * @see BP_Activity_Activity::get() For more information on accepted arguments
1001
  * and the format of the returned value.
1009
  * @return array $activity See BP_Activity_Activity::get() for description.
1010
  */
1011
  function bp_activity_get( $args = '' ) {
1012
+
1013
+ $r = bp_parse_args( $args, array(
1014
  'max' => false, // Maximum number of results to return
1015
  'page' => 1, // page 1 without a per_page will result in no pagination.
1016
  'per_page' => false, // results per page
1019
 
1020
  'search_terms' => false, // Pass search terms as a string
1021
  'meta_query' => false, // Filter by activity meta. See WP_Meta_Query for format
1022
+ 'date_query' => false, // Filter by date. See first parameter of WP_Date_Query for format
1023
  'show_hidden' => false, // Show activity items that are hidden site-wide?
1024
  'exclude' => false, // Comma-separated list of activity IDs to exclude
1025
  'in' => false, // Comma-separated list or array of activity IDs to which you want to limit the query
1026
  'spam' => 'ham_only', // 'ham_only' (default), 'spam_only' or 'all'.
1027
  'update_meta_cache' => true,
1028
+ 'count_total' => false,
1029
 
1030
  /**
1031
  * Pass filters as an array -- all filter items can be multiple values comma separated:
1038
  * );
1039
  */
1040
  'filter' => array()
1041
+ ) );
 
 
1042
 
1043
  // Attempt to return a cached copy of the first page of sitewide activity.
1044
+ if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter'] ) && empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
1045
+
1046
+ $activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' );
1047
+ if ( false === $activity ) {
1048
+
1049
+ $activity = BP_Activity_Activity::get( array(
1050
+ 'page' => $r['page'],
1051
+ 'per_page' => $r['per_page'],
1052
+ 'max' => $r['max'],
1053
+ 'sort' => $r['sort'],
1054
+ 'search_terms' => $r['search_terms'],
1055
+ 'meta_query' => $r['meta_query'],
1056
+ 'date_query' => $r['date_query'],
1057
+ 'filter' => $r['filter'],
1058
+ 'display_comments' => $r['display_comments'],
1059
+ 'show_hidden' => $r['show_hidden'],
1060
+ 'spam' => $r['spam'],
1061
+ 'update_meta_cache' => $r['update_meta_cache'],
1062
+ 'count_total' => $r['count_total'],
1063
+ ) );
1064
+
1065
  wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
1066
  }
1067
 
1068
  } else {
1069
+ $activity = BP_Activity_Activity::get( array(
1070
+ 'page' => $r['page'],
1071
+ 'per_page' => $r['per_page'],
1072
+ 'max' => $r['max'],
1073
+ 'sort' => $r['sort'],
1074
+ 'search_terms' => $r['search_terms'],
1075
+ 'meta_query' => $r['meta_query'],
1076
+ 'date_query' => $r['date_query'],
1077
+ 'filter' => $r['filter'],
1078
+ 'display_comments' => $r['display_comments'],
1079
+ 'show_hidden' => $r['show_hidden'],
1080
+ 'exclude' => $r['exclude'],
1081
+ 'in' => $r['in'],
1082
+ 'spam' => $r['spam'],
1083
+ 'count_total' => $r['count_total'],
1084
+ ) );
1085
  }
1086
 
1087
  return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
1090
  /**
1091
  * Fetch specific activity items.
1092
  *
1093
+ * @since BuddyPress (1.2.0)
1094
  *
1095
  * @see BP_Activity_Activity::get() For more information on accepted arguments
1096
  * @uses wp_parse_args()
1106
  * @return array $activity See BP_Activity_Activity::get() for description.
1107
  */
1108
  function bp_activity_get_specific( $args = '' ) {
1109
+
1110
+ $r = bp_parse_args( $args, array(
1111
+ 'activity_ids' => false, // A single activity_id or array of IDs.
1112
+ 'display_comments' => false, // true or false to display threaded comments for these specific activity items
1113
+ 'max' => false, // Maximum number of results to return
1114
+ 'page' => 1, // page 1 without a per_page will result in no pagination.
1115
+ 'per_page' => false, // results per page
1116
+ 'show_hidden' => true, // When fetching specific items, show all
1117
+ 'sort' => 'DESC', // sort ASC or DESC
1118
+ 'spam' => 'ham_only', // Retrieve items marked as spam
1119
  'update_meta_cache' => true,
1120
+ ) );
 
 
1121
 
1122
  $get_args = array(
1123
+ 'display_comments' => $r['display_comments'],
1124
+ 'in' => $r['activity_ids'],
1125
+ 'max' => $r['max'],
1126
+ 'page' => $r['page'],
1127
+ 'per_page' => $r['per_page'],
1128
+ 'show_hidden' => $r['show_hidden'],
1129
+ 'sort' => $r['sort'],
1130
+ 'spam' => $r['spam'],
1131
+ 'update_meta_cache' => $r['update_meta_cache'],
1132
  );
1133
+
1134
  return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $get_args ), $args, $get_args );
1135
  }
1136
 
1137
  /**
1138
  * Add an activity item.
1139
  *
1140
+ * @since BuddyPress (1.1.0)
1141
  *
1142
  * @uses wp_parse_args()
1143
  * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
1180
  */
1181
  function bp_activity_add( $args = '' ) {
1182
 
1183
+ $r = bp_parse_args( $args, array(
1184
+ 'id' => false, // Pass an existing activity ID to update an existing entry.
1185
+ 'action' => '', // The activity action - e.g. "Jon Doe posted an update"
1186
+ 'content' => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!"
1187
+ 'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent
1188
+ 'type' => false, // The activity type e.g. activity_update, profile_updated
1189
+ 'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink)
1190
+ 'user_id' => bp_loggedin_user_id(), // Optional: The user to record the activity for, can be false if this activity is not for a user.
1191
+ 'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id
1192
+ 'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
 
 
 
1193
  'recorded_time' => bp_core_current_time(), // The GMT time that this activity was recorded
1194
+ 'hide_sitewide' => false, // Should this be hidden on the sitewide activity stream?
1195
+ 'is_spam' => false, // Is this activity item to be marked as spam?
1196
+ ) );
 
 
1197
 
1198
  // Make sure we are backwards compatible
1199
+ if ( empty( $r['component'] ) && !empty( $r['component_name'] ) ) {
1200
+ $r['component'] = $r['component_name'];
1201
+ }
1202
 
1203
+ if ( empty( $r['type'] ) && !empty( $r['component_action'] ) ) {
1204
+ $r['type'] = $r['component_action'];
1205
+ }
1206
 
1207
  // Setup activity to be added
1208
+ $activity = new BP_Activity_Activity( $r['id'] );
1209
+ $activity->user_id = $r['user_id'];
1210
+ $activity->component = $r['component'];
1211
+ $activity->type = $r['type'];
1212
+ $activity->content = $r['content'];
1213
+ $activity->primary_link = $r['primary_link'];
1214
+ $activity->item_id = $r['item_id'];
1215
+ $activity->secondary_item_id = $r['secondary_item_id'];
1216
+ $activity->date_recorded = $r['recorded_time'];
1217
+ $activity->hide_sitewide = $r['hide_sitewide'];
1218
+ $activity->is_spam = $r['is_spam'];
1219
+ $activity->action = ! empty( $r['action'] )
1220
+ ? $r['action']
1221
+ : bp_activity_generate_action_string( $activity );
1222
+
1223
+ if ( ! $activity->save() ) {
1224
  return false;
1225
+ }
1226
 
1227
  // If this is an activity comment, rebuild the tree
1228
+ if ( 'activity_comment' === $activity->type ) {
1229
+ // Also clear the comment cache for the parent activity ID
1230
+ wp_cache_delete( $activity->item_id, 'bp_activity_comments' );
1231
+
1232
  BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id );
1233
+ }
1234
 
1235
  wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
1236
+ do_action( 'bp_activity_add', $r );
1237
 
1238
  return $activity->id;
1239
  }
1241
  /**
1242
  * Post an activity update.
1243
  *
1244
+ * @since BuddyPress (1.2.0)
1245
  *
 
1246
  * @uses wp_parse_args()
1247
  * @uses bp_is_user_inactive()
1248
  * @uses bp_core_get_userlink()
1261
  * @return int $activity_id The activity id
1262
  */
1263
  function bp_activity_post_update( $args = '' ) {
 
1264
 
1265
+ $r = wp_parse_args( $args, array(
1266
  'content' => false,
1267
  'user_id' => bp_loggedin_user_id()
1268
+ ) );
 
 
1269
 
1270
+ if ( empty( $r['content'] ) || !strlen( trim( $r['content'] ) ) ) {
1271
  return false;
1272
+ }
1273
 
1274
+ if ( bp_is_user_inactive( $r['user_id'] ) ) {
1275
  return false;
1276
+ }
1277
 
1278
  // Record this on the user's profile
1279
+ $activity_content = $r['content'];
1280
+ $primary_link = bp_core_get_userlink( $r['user_id'], false, true );
 
1281
 
1282
  // Now write the values
1283
  $activity_id = bp_activity_add( array(
1284
+ 'user_id' => $r['user_id'],
1285
  'content' => apply_filters( 'bp_activity_new_update_content', $activity_content ),
1286
  'primary_link' => apply_filters( 'bp_activity_new_update_primary_link', $primary_link ),
1287
+ 'component' => buddypress()->activity->id,
1288
  'type' => 'activity_update',
1289
  ) );
1290
 
1291
+ $activity_content = apply_filters( 'bp_activity_latest_update_content', $r['content'], $activity_content );
1292
 
1293
  // Add this update to the "latest update" usermeta so it can be fetched anywhere.
1294
+ bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array(
1295
+ 'id' => $activity_id,
1296
+ 'content' => $activity_content
1297
+ ) );
1298
 
1299
+ do_action( 'bp_activity_posted_update', $r['content'], $r['user_id'], $activity_id );
1300
 
1301
  return $activity_id;
1302
  }
1304
  /**
1305
  * Add an activity comment.
1306
  *
1307
+ * @since BuddyPress (1.2.0)
1308
  *
1309
  * @global object $bp BuddyPress global settings.
1310
  * @uses wp_parse_args()
1319
  * @type int $id Optional. Pass an ID to update an existing comment.
1320
  * @type string $content The content of the comment.
1321
  * @type int $user_id Optional. The ID of the user making the comment.
1322
+ * Defaults to the ID of the logged-in user.
1323
  * @type int $activity_id The ID of the "root" activity item, ie the oldest
1324
+ * ancestor of the comment.
1325
  * @type int $parent_id Optional. The ID of the parent activity item, ie the
1326
+ * item to which the comment is an immediate reply. If not provided,
1327
+ * this value defaults to the $activity_id.
1328
  * }
1329
  * @return int|bool The ID of the comment on success, otherwise false.
1330
  */
1331
  function bp_activity_new_comment( $args = '' ) {
1332
 
1333
+ $r = wp_parse_args( $args, array(
1334
  'id' => false,
1335
  'content' => false,
1336
  'user_id' => bp_loggedin_user_id(),
1338
  'parent_id' => false // ID of a parent comment (optional)
1339
  ) );
1340
 
 
 
1341
  // Bail if missing necessary data
1342
+ if ( empty( $r['content'] ) || empty( $r['user_id'] ) || empty( $r['activity_id'] ) ) {
1343
  return false;
1344
  }
1345
 
1346
  // Maybe set current activity ID as the parent
1347
+ if ( empty( $r['parent_id'] ) ) {
1348
+ $r['parent_id'] = $r['activity_id'];
1349
  }
1350
 
1351
+ $activity_id = $r['activity_id'];
1352
+
1353
  // Check to see if the parent activity is hidden, and if so, hide this comment publically.
1354
  $activity = new BP_Activity_Activity( $activity_id );
1355
  $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
1356
 
1357
  // Insert the activity comment
1358
  $comment_id = bp_activity_add( array(
1359
+ 'id' => $r['id'],
1360
+ 'content' => apply_filters( 'bp_activity_comment_content', $r['content'] ),
1361
  'component' => buddypress()->activity->id,
1362
  'type' => 'activity_comment',
1363
+ 'user_id' => $r['user_id'],
1364
  'item_id' => $activity_id,
1365
+ 'secondary_item_id' => $r['parent_id'],
1366
  'hide_sitewide' => $is_hidden
1367
  ) );
1368
 
1370
  wp_cache_delete( $activity_id, 'bp_activity_comments' );
1371
 
1372
  // Walk the tree to clear caches for all parent items
1373
+ $clear_id = $r['parent_id'];
1374
  while ( $clear_id != $activity_id ) {
1375
  $clear_object = new BP_Activity_Activity( $clear_id );
1376
  wp_cache_delete( $clear_id, 'bp_activity' );
1378
  }
1379
  wp_cache_delete( $activity_id, 'bp_activity' );
1380
 
1381
+ do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
1382
 
1383
  return $comment_id;
1384
  }
1386
  /**
1387
  * Fetch the activity_id for an existing activity entry in the DB.
1388
  *
1389
+ * @since BuddyPress (1.2.0)
1390
  *
1391
  * @see BP_Activity_Activity::get() For more information on accepted arguments.
1392
  * @uses wp_parse_args()
1397
  * @return int $activity_id The ID of the activity item found.
1398
  */
1399
  function bp_activity_get_activity_id( $args = '' ) {
1400
+
1401
+ $r = bp_parse_args( $args, array(
1402
  'user_id' => false,
1403
  'component' => false,
1404
  'type' => false,
1407
  'action' => false,
1408
  'content' => false,
1409
  'date_recorded' => false,
1410
+ ) );
 
 
 
1411
 
1412
+ return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id(
1413
+ $r['user_id'],
1414
+ $r['component'],
1415
+ $r['type'],
1416
+ $r['item_id'],
1417
+ $r['secondary_item_id'],
1418
+ $r['action'],
1419
+ $r['content'],
1420
+ $r['date_recorded']
1421
+ ) );
1422
  }
1423
 
1424
  /**
1434
  *
1435
  * If you are deleting an activity comment please use bp_activity_delete_comment();
1436
  *
1437
+ * @since BuddyPress (1.0.0)
1438
  *
1439
  * @see BP_Activity_Activity::get() For more information on accepted arguments.
1440
  * @uses wp_parse_args()
1456
  function bp_activity_delete( $args = '' ) {
1457
 
1458
  // Pass one or more the of following variables to delete by those variables
1459
+ $args = bp_parse_args( $args, array(
1460
  'id' => false,
1461
  'action' => false,
1462
  'content' => false,
1468
  'secondary_item_id' => false,
1469
  'date_recorded' => false,
1470
  'hide_sitewide' => false
1471
+ ) );
 
 
1472
 
1473
  do_action( 'bp_before_activity_delete', $args );
1474
 
1475
  // Adjust the new mention count of any mentioned member
1476
  bp_activity_adjust_mention_count( $args['id'], 'delete' );
1477
 
1478
+ $activity_ids_deleted = BP_Activity_Activity::delete( $args );
1479
+ if ( empty( $activity_ids_deleted ) ) {
1480
  return false;
1481
+ }
1482
 
1483
  // Check if the user's latest update has been deleted
1484
+ $user_id = empty( $args['user_id'] )
1485
+ ? bp_loggedin_user_id()
1486
+ : $args['user_id'];
 
1487
 
1488
  $latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true );
1489
  if ( !empty( $latest_update ) ) {
1505
  *
1506
  * You should use bp_activity_delete() instead.
1507
  *
1508
+ * @since BuddyPress (1.1.0)
1509
  * @deprecated BuddyPress (1.2)
1510
  *
1511
  * @uses wp_parse_args()
1518
  */
1519
  function bp_activity_delete_by_item_id( $args = '' ) {
1520
 
1521
+ $r = bp_parse_args( $args, array(
1522
  'item_id' => false,
1523
  'component' => false,
1524
  'type' => false,
1525
  'user_id' => false,
1526
  'secondary_item_id' => false
1527
+ ) );
 
 
1528
 
1529
+ return bp_activity_delete( $r );
1530
  }
1531
 
1532
  /**
1533
  * Delete an activity item by activity id.
1534
  *
1535
+ * @since BuddyPress (1.1.0)
1536
  *
1537
  * @uses bp_activity_delete()
1538
  *
1548
  *
1549
  * You should use bp_activity_delete() instead.
1550
  *
1551
+ * @since BuddyPress (1.1.0)
1552
  * @deprecated BuddyPress (1.2)
1553
  *
1554
  * @uses bp_activity_delete()
1560
  * @return bool True on success, false on failure.
1561
  */
1562
  function bp_activity_delete_by_content( $user_id, $content, $component, $type ) {
1563
+ return bp_activity_delete( array(
1564
+ 'user_id' => $user_id,
1565
+ 'content' => $content,
1566
+ 'component' => $component,
1567
+ 'type' => $type
1568
+ ) );
1569
  }
1570
 
1571
  /**
1573
  *
1574
  * You should use bp_activity_delete() instead.
1575
  *
1576
+ * @since BuddyPress (1.1.0)
1577
  * @deprecated BuddyPress (1.2)
1578
  *
1579
  * @uses bp_activity_delete()
1583
  * @return bool True on success, false on failure.
1584
  */
1585
  function bp_activity_delete_for_user_by_component( $user_id, $component ) {
1586
+ return bp_activity_delete( array(
1587
+ 'user_id' => $user_id,
1588
+ 'component' => $component
1589
+ ) );
1590
  }
1591
 
1592
  /**
1593
  * Delete an activity comment.
1594
  *
1595
+ * @since BuddyPress (1.2.0)
1596
  *
1597
  * @uses apply_filters() To call the 'bp_activity_delete_comment_pre' hook.
1598
  * @uses bp_activity_delete_children()
1614
  * You may want to hook into this filter if you want to override this function and
1615
  * handle the deletion of child comments differently. Make sure you return false.
1616
  */
1617
+ if ( ! apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) ) {
1618
  return false;
1619
+ }
1620
 
1621
  // Delete any children of this comment.
1622
  bp_activity_delete_children( $activity_id, $comment_id );
1623
 
1624
  // Delete the actual comment
1625
+ if ( ! bp_activity_delete( array( 'id' => $comment_id, 'type' => 'activity_comment' ) ) ) {
1626
  return false;
1627
+ }
1628
+
1629
+ // Purge comment cache for the root activity update
1630
+ wp_cache_delete( $activity_id, 'bp_activity_comments' );
1631
 
1632
  // Recalculate the comment tree
1633
  BP_Activity_Activity::rebuild_activity_comment_tree( $activity_id );
1640
  /**
1641
  * Delete an activity comment's children.
1642
  *
1643
+ * @since BuddyPress (1.2.0)
1644
  *
1645
  * @uses BP_Activity_Activity::get_child_comments() {@link BP_Activity_Activity}
1646
  * @uses bp_activity_delete_children()
1647
  * @uses bp_activity_delete()
1648
  *
1649
  * @param int $activity_id The ID of the "root" activity, ie the
1650
+ * comment's oldest ancestor.
1651
  * @param int $comment_id The ID of the comment to be deleted.
1652
  */
1653
+ function bp_activity_delete_children( $activity_id, $comment_id ) {
1654
+
1655
+ // Get activity children to delete
1656
+ $children = BP_Activity_Activity::get_child_comments( $comment_id );
1657
+
1658
  // Recursively delete all children of this comment.
1659
+ if ( ! empty( $children ) ) {
1660
  foreach( (array) $children as $child ) {
1661
  bp_activity_delete_children( $activity_id, $child->id );
1662
  }
1663
  }
1664
+
1665
+ // Delete the comment itself
1666
+ bp_activity_delete( array(
1667
+ 'secondary_item_id' => $comment_id,
1668
+ 'type' => 'activity_comment',
1669
+ 'item_id' => $activity_id
1670
+ ) );
1671
  }
1672
 
1673
  /**
1678
  * be sure to pass the full $activity_obj parameter as well, if you already
1679
  * have it available.
1680
  *
1681
+ * @since BuddyPress (1.2.0)
1682
  *
1683
  * @uses bp_get_root_domain()
1684
  * @uses bp_get_activity_root_slug()
1690
  */
1691
  function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
1692
 
1693
+ if ( empty( $activity_obj ) ) {
1694
  $activity_obj = new BP_Activity_Activity( $activity_id );
1695
+ }
1696
 
1697
  if ( isset( $activity_obj->current_comment ) ) {
1698
  $activity_obj = $activity_obj->current_comment;
1714
  /**
1715
  * Hide a user's activity.
1716
  *
1717
+ * @since BuddyPress (1.2.0)
1718
  *
1719
  * @uses BP_Activity_Activity::hide_all_for_user() {@link BP_Activity_Activity}
1720
  *
1735
  * through the content, grabs the first image and converts it to a thumbnail,
1736
  * and removes the rest of the images from the string.
1737
  *
1738
+ * @since BuddyPress (1.2.0)
1739
  *
1740
  * @uses esc_attr()
1741
  * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
1742
  *
1743
  * @param string $content The content of the activity item.
1744
  * @param string $link Optional. The unescaped URL that the image should link
1745
+ * to. If absent, the image will not be a link.
1746
+ * @param array $args Optional. The args passed to the activity
1747
+ * creation function (eg bp_blogs_record_activity()).
1748
  * @return string $content The content with images stripped and replaced with a
1749
+ * single thumb.
1750
  */
1751
  function bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) {
1752
 
1756
  $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>([^\[\[]*\[\/caption\])?|', '', $content );
1757
 
1758
  if ( !empty( $matches ) && !empty( $matches[0] ) ) {
1759
+
1760
  // Get the SRC value
1761
+ preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src );
1762
 
1763
  // Get the width and height
1764
  preg_match( '/<img.*?(height\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $height );
1765
  preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $width );
1766
 
1767
  if ( !empty( $src ) ) {
1768
+ $src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 );
1769
  $height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
1770
+ $width = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 );
1771
 
1772
  if ( empty( $width ) || empty( $height ) ) {
1773
  $width = 100;
1793
  /**
1794
  * Fetch whether the current user is allowed to mark items as spam.
1795
  *
1796
+ * @since BuddyPress (1.6.0)
1797
  *
1798
  * @return bool True if user is allowed to mark activity items as spam.
1799
  */
1804
  /**
1805
  * Mark an activity item as spam.
1806
  *
1807
+ * @since BuddyPress (1.6.0)
 
 
1808
  *
1809
  * @param BP_Activity_Activity $activity The activity item to be spammed.
1810
  * @param string $source Optional. Default is "by_a_person" (ie, a person has
1811
+ * manually marked the activity as spam). BP core also accepts
1812
+ * 'by_akismet'.
1813
  */
1814
  function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
1815
+ $bp = buddypress();
1816
 
1817
  $activity->is_spam = 1;
1818
 
1842
  /**
1843
  * Mark an activity item as ham.
1844
  *
1845
+ * @since BuddyPress (1.6.0)
 
 
1846
  *
1847
  * @param BP_Activity_Activity $activity The activity item to be hammed.
1848
  * @param string $source Optional. Default is "by_a_person" (ie, a person has
1849
+ * manually marked the activity as spam). BP core also accepts
1850
+ * 'by_akismet'.
1851
  */
1852
  function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
1853
+ $bp = buddypress();
1854
 
1855
  $activity->is_spam = 0;
1856
 
1890
  * This does not cover recursive activity comments, as they do not use a real loop.
1891
  * For that, see {@link bp_activity_comment_embed()}.
1892
  *
1893
+ * @since BuddyPress (1.5.0)
1894
  *
1895
  * @see BP_Embed
1896
  * @see bp_embed_activity_cache()
1914
  * necessary to grab each comment's embeds from the cache, or put them in
1915
  * the cache if they are not there yet.
1916
  *
1917
+ * @since BuddyPress (1.5.0)
1918
  *
1919
  * @see BP_Embed
1920
  * @see bp_embed_activity_cache()
1933
  /**
1934
  * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content.
1935
  *
1936
+ * @since BuddyPress (1.5.0)
1937
  *
1938
  * @see BP_Embed
 
1939
  * @uses add_filter() To attach create_function() to 'embed_post_id'.
1940
  * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'.
1941
  * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'.
1943
  * @param object $activity The activity that is being expanded.
1944
  */
1945
  function bp_dtheme_embed_read_more( $activity ) {
1946
+ buddypress()->activity->read_more_id = $activity->id;
1947
 
1948
+ add_filter( 'embed_post_id', create_function( '', 'return buddypress()->activity->read_more_id;' ) );
1949
+ add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 );
1950
+ add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
 
 
1951
  }
1952
+ add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
1953
+ add_action( 'bp_legacy_theme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
1954
 
1955
  /**
1956
  * Clean up 'embed_post_id' filter after comment recursion.
1958
  * This filter must be removed so that the non-comment filters take over again
1959
  * once the comments are done being processed.
1960
  *
1961
+ * @since BuddyPress (1.5.0)
1962
  *
1963
  * @see bp_activity_comment_embed()
1964
  * @uses remove_filter() To remove 'bp_get_activity_comment_id' from 'embed_post_id'.
1973
  *
1974
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
1975
  *
1976
+ * @since BuddyPress (1.5.0)
1977
  *
1978
  * @see BP_Embed::parse_oembed()
1979
  * @uses bp_activity_get_meta()
1980
  *
1981
  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
1982
+ * functions like this one to filter.
1983
  * @param int $id The ID of the activity item.
1984
  * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
1985
  * @return mixed The cached embeds for this activity item.
1993
  *
1994
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
1995
  *
1996
+ * @since BuddyPress (1.5.0)
1997
  *
1998
  * @see BP_Embed::parse_oembed()
1999
  * @uses bp_activity_update_meta()
2000
  *
2001
  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
2002
+ * functions like this one to filter.
 
2003
  * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
2004
+ * @param int $id The ID of the activity item.
2005
  * @return bool True on success, false on failure.
2006
  */
2007
  function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
bp-activity/bp-activity-loader.php CHANGED
@@ -47,6 +47,7 @@ class BP_Activity_Component extends BP_Component {
47
  public function includes( $includes = array() ) {
48
  // Files to include
49
  $includes = array(
 
50
  'actions',
51
  'screens',
52
  'filters',
@@ -106,7 +107,7 @@ class BP_Activity_Component extends BP_Component {
106
  'slug' => BP_ACTIVITY_SLUG,
107
  'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
108
  'has_directory' => true,
109
- 'directory_title' => _x( 'Sitewide Activity', 'component directory title', 'buddypress' ),
110
  'notification_callback' => 'bp_activity_format_notifications',
111
  'search_string' => __( 'Search Activity...', 'buddypress' ),
112
  'global_tables' => $global_tables,
@@ -136,7 +137,7 @@ class BP_Activity_Component extends BP_Component {
136
 
137
  // Add 'Activity' to the main navigation
138
  $main_nav = array(
139
- 'name' => __( 'Activity', 'buddypress' ),
140
  'slug' => $this->slug,
141
  'position' => 10,
142
  'screen_function' => 'bp_activity_screen_my_activity',
@@ -162,7 +163,7 @@ class BP_Activity_Component extends BP_Component {
162
 
163
  // Add the subnav items to the activity nav item if we are using a theme that supports this
164
  $sub_nav[] = array(
165
- 'name' => __( 'Personal', 'buddypress' ),
166
  'slug' => 'just-me',
167
  'parent_url' => $activity_link,
168
  'parent_slug' => $this->slug,
@@ -173,7 +174,7 @@ class BP_Activity_Component extends BP_Component {
173
  // @ mentions
174
  if ( bp_activity_do_mentions() ) {
175
  $sub_nav[] = array(
176
- 'name' => __( 'Mentions', 'buddypress' ),
177
  'slug' => 'mentions',
178
  'parent_url' => $activity_link,
179
  'parent_slug' => $this->slug,
@@ -185,7 +186,7 @@ class BP_Activity_Component extends BP_Component {
185
 
186
  // Favorite activity items
187
  $sub_nav[] = array(
188
- 'name' => __( 'Favorites', 'buddypress' ),
189
  'slug' => 'favorites',
190
  'parent_url' => $activity_link,
191
  'parent_slug' => $this->slug,
@@ -197,7 +198,7 @@ class BP_Activity_Component extends BP_Component {
197
  // Additional menu if friends is active
198
  if ( bp_is_active( 'friends' ) ) {
199
  $sub_nav[] = array(
200
- 'name' => __( 'Friends', 'buddypress' ),
201
  'slug' => bp_get_friends_slug(),
202
  'parent_url' => $activity_link,
203
  'parent_slug' => $this->slug,
@@ -210,7 +211,7 @@ class BP_Activity_Component extends BP_Component {
210
  // Additional menu if groups is active
211
  if ( bp_is_active( 'groups' ) ) {
212
  $sub_nav[] = array(
213
- 'name' => __( 'Groups', 'buddypress' ),
214
  'slug' => bp_get_groups_slug(),
215
  'parent_url' => $activity_link,
216
  'parent_slug' => $this->slug,
@@ -255,9 +256,9 @@ class BP_Activity_Component extends BP_Component {
255
  if ( bp_activity_do_mentions() ) {
256
  $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
257
  if ( !empty( $count ) ) {
258
- $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
259
  } else {
260
- $title = __( 'Mentions', 'buddypress' );
261
  }
262
  }
263
 
@@ -265,7 +266,7 @@ class BP_Activity_Component extends BP_Component {
265
  $wp_admin_nav[] = array(
266
  'parent' => $bp->my_account_menu_id,
267
  'id' => 'my-account-' . $this->id,
268
- 'title' => __( 'Activity', 'buddypress' ),
269
  'href' => trailingslashit( $activity_link )
270
  );
271
 
@@ -273,7 +274,7 @@ class BP_Activity_Component extends BP_Component {
273
  $wp_admin_nav[] = array(
274
  'parent' => 'my-account-' . $this->id,
275
  'id' => 'my-account-' . $this->id . '-personal',
276
- 'title' => __( 'Personal', 'buddypress' ),
277
  'href' => trailingslashit( $activity_link )
278
  );
279
 
@@ -291,7 +292,7 @@ class BP_Activity_Component extends BP_Component {
291
  $wp_admin_nav[] = array(
292
  'parent' => 'my-account-' . $this->id,
293
  'id' => 'my-account-' . $this->id . '-favorites',
294
- 'title' => __( 'Favorites', 'buddypress' ),
295
  'href' => trailingslashit( $activity_link . 'favorites' )
296
  );
297
 
@@ -300,7 +301,7 @@ class BP_Activity_Component extends BP_Component {
300
  $wp_admin_nav[] = array(
301
  'parent' => 'my-account-' . $this->id,
302
  'id' => 'my-account-' . $this->id . '-friends',
303
- 'title' => __( 'Friends', 'buddypress' ),
304
  'href' => trailingslashit( $activity_link . bp_get_friends_slug() )
305
  );
306
  }
@@ -310,7 +311,7 @@ class BP_Activity_Component extends BP_Component {
310
  $wp_admin_nav[] = array(
311
  'parent' => 'my-account-' . $this->id,
312
  'id' => 'my-account-' . $this->id . '-groups',
313
- 'title' => __( 'Groups', 'buddypress' ),
314
  'href' => trailingslashit( $activity_link . bp_get_groups_slug() )
315
  );
316
  }
@@ -334,7 +335,7 @@ class BP_Activity_Component extends BP_Component {
334
  // Adjust title based on view
335
  if ( bp_is_activity_component() ) {
336
  if ( bp_is_my_profile() ) {
337
- $bp->bp_options_title = __( 'My Activity', 'buddypress' );
338
  } else {
339
  $bp->bp_options_avatar = bp_core_fetch_avatar( array(
340
  'item_id' => bp_displayed_user_id(),
47
  public function includes( $includes = array() ) {
48
  // Files to include
49
  $includes = array(
50
+ 'cssjs',
51
  'actions',
52
  'screens',
53
  'filters',
107
  'slug' => BP_ACTIVITY_SLUG,
108
  'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
109
  'has_directory' => true,
110
+ 'directory_title' => _x( 'Site-Wide Activity', 'component directory title', 'buddypress' ),
111
  'notification_callback' => 'bp_activity_format_notifications',
112
  'search_string' => __( 'Search Activity...', 'buddypress' ),
113
  'global_tables' => $global_tables,
137
 
138
  // Add 'Activity' to the main navigation
139
  $main_nav = array(
140
+ 'name' => _x( 'Activity', 'Profile activity screen nav', 'buddypress' ),
141
  'slug' => $this->slug,
142
  'position' => 10,
143
  'screen_function' => 'bp_activity_screen_my_activity',
163
 
164
  // Add the subnav items to the activity nav item if we are using a theme that supports this
165
  $sub_nav[] = array(
166
+ 'name' => _x( 'Personal', 'Profile activity screen sub nav', 'buddypress' ),
167
  'slug' => 'just-me',
168
  'parent_url' => $activity_link,
169
  'parent_slug' => $this->slug,
174
  // @ mentions
175
  if ( bp_activity_do_mentions() ) {
176
  $sub_nav[] = array(
177
+ 'name' => _x( 'Mentions', 'Profile activity screen sub nav', 'buddypress' ),
178
  'slug' => 'mentions',
179
  'parent_url' => $activity_link,
180
  'parent_slug' => $this->slug,
186
 
187
  // Favorite activity items
188
  $sub_nav[] = array(
189
+ 'name' => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ),
190
  'slug' => 'favorites',
191
  'parent_url' => $activity_link,
192
  'parent_slug' => $this->slug,
198
  // Additional menu if friends is active
199
  if ( bp_is_active( 'friends' ) ) {
200
  $sub_nav[] = array(
201
+ 'name' => _x( 'Friends', 'Profile activity screen sub nav', 'buddypress' ),
202
  'slug' => bp_get_friends_slug(),
203
  'parent_url' => $activity_link,
204
  'parent_slug' => $this->slug,
211
  // Additional menu if groups is active
212
  if ( bp_is_active( 'groups' ) ) {
213
  $sub_nav[] = array(
214
+ 'name' => _x( 'Groups', 'Profile activity screen sub nav', 'buddypress' ),
215
  'slug' => bp_get_groups_slug(),
216
  'parent_url' => $activity_link,
217
  'parent_slug' => $this->slug,
256
  if ( bp_activity_do_mentions() ) {
257
  $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
258
  if ( !empty( $count ) ) {
259
+ $title = sprintf( _x( 'Mentions <span class="count">%s</span>', 'Toolbar Mention logged in user', 'buddypress' ), number_format_i18n( $count ) );
260
  } else {
261
+ $title = _x( 'Mentions', 'Toolbar Mention logged in user', 'buddypress' );
262
  }
263
  }
264
 
266
  $wp_admin_nav[] = array(
267
  'parent' => $bp->my_account_menu_id,
268
  'id' => 'my-account-' . $this->id,
269
+ 'title' => _x( 'Activity', 'My Account Activity sub nav', 'buddypress' ),
270
  'href' => trailingslashit( $activity_link )
271
  );
272
 
274
  $wp_admin_nav[] = array(
275
  'parent' => 'my-account-' . $this->id,
276
  'id' => 'my-account-' . $this->id . '-personal',
277
+ 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ),
278
  'href' => trailingslashit( $activity_link )
279
  );
280
 
292
  $wp_admin_nav[] = array(
293
  'parent' => 'my-account-' . $this->id,
294
  'id' => 'my-account-' . $this->id . '-favorites',
295
+ 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ),
296
  'href' => trailingslashit( $activity_link . 'favorites' )
297
  );
298
 
301
  $wp_admin_nav[] = array(
302
  'parent' => 'my-account-' . $this->id,
303
  'id' => 'my-account-' . $this->id . '-friends',
304
+ 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ),
305
  'href' => trailingslashit( $activity_link . bp_get_friends_slug() )
306
  );
307
  }
311
  $wp_admin_nav[] = array(
312
  'parent' => 'my-account-' . $this->id,
313
  'id' => 'my-account-' . $this->id . '-groups',
314
+ 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ),
315
  'href' => trailingslashit( $activity_link . bp_get_groups_slug() )
316
  );
317
  }
335
  // Adjust title based on view
336
  if ( bp_is_activity_component() ) {
337
  if ( bp_is_my_profile() ) {
338
+ $bp->bp_options_title = _x( 'My Activity', 'Page and <title>', 'buddypress' );
339
  } else {
340
  $bp->bp_options_avatar = bp_core_fetch_avatar( array(
341
  'item_id' => bp_displayed_user_id(),
bp-activity/bp-activity-screens.php CHANGED
@@ -385,7 +385,7 @@ class BP_Activity_Theme_Compat {
385
  'post_author' => 0,
386
  'post_date' => 0,
387
  'post_content' => '',
388
- 'post_type' => 'bp_activity',
389
  'post_status' => 'publish',
390
  'is_page' => true,
391
  'comment_status' => 'closed'
@@ -438,7 +438,7 @@ class BP_Activity_Theme_Compat {
438
  'post_author' => 0,
439
  'post_date' => 0,
440
  'post_content' => '',
441
- 'post_type' => 'bp_activity',
442
  'post_status' => 'publish',
443
  'is_page' => true,
444
  'comment_status' => 'closed'
385
  'post_author' => 0,
386
  'post_date' => 0,
387
  'post_content' => '',
388
+ 'post_type' => 'page',
389
  'post_status' => 'publish',
390
  'is_page' => true,
391
  'comment_status' => 'closed'
438
  'post_author' => 0,
439
  'post_date' => 0,
440
  'post_content' => '',
441
+ 'post_type' => 'page',
442
  'post_status' => 'publish',
443
  'is_page' => true,
444
  'comment_status' => 'closed'
bp-activity/bp-activity-template.php CHANGED
@@ -98,6 +98,14 @@ class BP_Activity_Template {
98
 
99
  var $in_the_loop;
100
 
 
 
 
 
 
 
 
 
101
  var $pag_page;
102
  var $pag_num;
103
  var $pag_links;
@@ -170,6 +178,7 @@ class BP_Activity_Template {
170
  'filter' => false,
171
  'search_terms' => false,
172
  'meta_query' => false,
 
173
  'display_comments' => 'threaded',
174
  'show_hidden' => false,
175
  'spam' => 'ham_only',
@@ -178,7 +187,8 @@ class BP_Activity_Template {
178
  $r = wp_parse_args( $args, $defaults );
179
  extract( $r );
180
 
181
- $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
 
182
  $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
183
 
184
  // Check if blog/forum replies are disabled
@@ -211,6 +221,7 @@ class BP_Activity_Template {
211
  'sort' => $sort,
212
  'search_terms' => $search_terms,
213
  'meta_query' => $meta_query,
 
214
  'filter' => $filter,
215
  'show_hidden' => $show_hidden,
216
  'exclude' => $exclude,
@@ -220,10 +231,17 @@ class BP_Activity_Template {
220
  ) );
221
  }
222
 
223
- if ( !$max || $max >= (int) $this->activities['total'] )
224
- $this->total_activity_count = (int) $this->activities['total'];
225
- else
226
- $this->total_activity_count = (int) $max;
 
 
 
 
 
 
 
227
 
228
  $this->activities = $this->activities['activities'];
229
 
@@ -507,8 +525,9 @@ function bp_has_activities( $args = '' ) {
507
  $object = $bp->groups->id;
508
  $primary_id = $bp->groups->current_group->id;
509
 
510
- if ( ( 'public' != $bp->groups->current_group->status ) && ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) || bp_current_user_can( 'bp_moderate' ) ) )
511
  $show_hidden = true;
 
512
  }
513
 
514
  // The default scope should recognize custom slugs
@@ -550,6 +569,7 @@ function bp_has_activities( $args = '' ) {
550
  'since' => false, // return only items recorded since this Y-m-d H:i:s date
551
 
552
  'meta_query' => false, // filter on activity meta. See WP_Meta_Query for format
 
553
 
554
  // Searching
555
  'search_terms' => false, // specify terms to search on
@@ -663,6 +683,7 @@ function bp_has_activities( $args = '' ) {
663
  'filter' => $filter,
664
  'search_terms' => $search_terms,
665
  'meta_query' => $meta_query,
 
666
  'display_comments' => $display_comments,
667
  'show_hidden' => $show_hidden,
668
  'spam' => $spam,
@@ -704,6 +725,23 @@ function bp_the_activity() {
704
  return $activities_template->the_activity();
705
  }
706
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  /**
708
  * Output the activity pagination count.
709
  *
@@ -734,7 +772,7 @@ function bp_activity_pagination_count() {
734
  $to_num = bp_core_number_format( ( $start_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $start_num + ( $activities_template->pag_num - 1 ) );
735
  $total = bp_core_number_format( $activities_template->total_activity_count );
736
 
737
- return sprintf( _n( 'Viewing item %1$s to %2$s (of %3$s item)', 'Viewing item %1$s to %2$s (of %3$s items)', $total, 'buddypress' ), $from_num, $to_num, $total );
738
  }
739
 
740
  /**
@@ -777,13 +815,17 @@ function bp_activity_pagination_links() {
777
  function bp_activity_has_more_items() {
778
  global $activities_template;
779
 
780
- $remaining_pages = 0;
 
 
 
781
 
782
- if ( ! empty( $activities_template->pag_page ) ) {
783
- $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
784
- }
785
 
786
- $has_more_items = (int) $remaining_pages ? true : false;
 
787
 
788
  return apply_filters( 'bp_activity_has_more_items', $has_more_items );
789
  }
@@ -1004,6 +1046,37 @@ function bp_activity_date_recorded() {
1004
  return apply_filters( 'bp_get_activity_date_recorded', $activities_template->activity->date_recorded );
1005
  }
1006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1007
  /**
1008
  * Output the activity object name.
1009
  *
@@ -1138,10 +1211,11 @@ function bp_activity_user_link() {
1138
  function bp_get_activity_user_link() {
1139
  global $activities_template;
1140
 
1141
- if ( empty( $activities_template->activity->user_id ) )
1142
  $link = $activities_template->activity->primary_link;
1143
- else
1144
  $link = bp_core_get_user_domain( $activities_template->activity->user_id, $activities_template->activity->user_nicename, $activities_template->activity->user_login );
 
1145
 
1146
  return apply_filters( 'bp_get_activity_user_link', $link );
1147
  }
@@ -1596,24 +1670,41 @@ function bp_insert_activity_meta( $content ) {
1596
  function bp_activity_user_can_delete( $activity = false ) {
1597
  global $activities_template;
1598
 
1599
- if ( !$activity )
 
1600
  $activity = $activities_template->activity;
 
1601
 
1602
- if ( isset( $activity->current_comment ) )
 
1603
  $activity = $activity->current_comment;
 
1604
 
 
1605
  $can_delete = false;
1606
 
1607
- if ( bp_current_user_can( 'bp_moderate' ) )
1608
- $can_delete = true;
1609
 
1610
- if ( is_user_logged_in() && $activity->user_id == bp_loggedin_user_id() )
1611
- $can_delete = true;
 
 
1612
 
1613
- if ( bp_is_item_admin() && bp_is_single_item() )
1614
- $can_delete = true;
 
 
 
 
1615
 
1616
- return apply_filters( 'bp_activity_user_can_delete', $can_delete, $activity );
 
 
 
 
 
 
1617
  }
1618
 
1619
  /**
@@ -1750,7 +1841,7 @@ function bp_activity_is_favorite() {
1750
  function bp_get_activity_is_favorite() {
1751
  global $activities_template;
1752
 
1753
- return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) );
1754
  }
1755
 
1756
  /**
@@ -2090,63 +2181,65 @@ function bp_activity_comment_count() {
2090
  }
2091
 
2092
  /**
2093
- * Return the content of the activity comment currently being displayed.
2094
- *
2095
- * The content is run through two filters. 'bp_get_activity_content'
2096
- * will apply all filters applied to activity items in general. Use
2097
- * 'bp_activity_comment_content' to modify the content of activity
2098
- * comments only.
2099
  *
2100
  * @since BuddyPress (1.2)
2101
  *
2102
  * @global object $activities_template {@link BP_Activity_Template}
2103
  * @uses bp_activity_recurse_comment_count()
2104
  * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook.
2105
- * @todo deprecate $args
2106
  *
2107
- * @param array $args Deprecated.
 
2108
  * @return int $count The activity comment count.
2109
  */
2110
- function bp_activity_get_comment_count( $args = '' ) {
2111
  global $activities_template;
2112
 
2113
- if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
2114
- return 0;
 
 
2115
 
2116
- $count = bp_activity_recurse_comment_count( $activities_template->activity );
 
 
 
2117
 
2118
  return apply_filters( 'bp_activity_get_comment_count', (int) $count );
2119
  }
2120
 
2121
  /**
2122
- * Return the content of the activity comment currently being displayed.
2123
  *
2124
- * The content is run through two filters. 'bp_get_activity_content'
2125
- * will apply all filters applied to activity items in general.
2126
- * Use bp_activity_comment_content to modify the content of
2127
- * activity comments only.
2128
  *
2129
  * @since BuddyPress (1.2)
2130
  *
2131
  * @uses bp_activity_recurse_comment_count()
2132
- * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook
2133
- * @todo investigate why bp_activity_recurse_comment_count() is used while being declared
2134
  *
2135
  * @param object $comment Activity comment object.
2136
  * @param int $count The current iteration count.
 
2137
  * @return int $count The activity comment count.
2138
  */
2139
  function bp_activity_recurse_comment_count( $comment, $count = 0 ) {
2140
 
2141
- if ( empty( $comment->children ) )
2142
- return $count;
2143
 
2144
- foreach ( (array) $comment->children as $comment ) {
2145
- $count++;
2146
- $count = bp_activity_recurse_comment_count( $comment, $count );
 
 
 
2147
  }
2148
 
2149
- return $count;
 
2150
  }
2151
 
2152
  /**
@@ -2326,9 +2419,20 @@ function bp_activity_comment_permalink() {
2326
  function bp_get_activity_comment_permalink() {
2327
  global $activities_template;
2328
 
2329
- $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '#acomment-' . $activities_template->activity->current_comment->id;
 
 
 
2330
 
2331
- return apply_filters( 'bp_get_activity_comment_permalink', $link );
 
 
 
 
 
 
 
 
2332
  }
2333
 
2334
  /**
@@ -2466,21 +2570,63 @@ function bp_activity_delete_link() {
2466
  * if on single activity page.
2467
  */
2468
  function bp_get_activity_delete_link() {
2469
- global $activities_template;
2470
 
2471
- $url = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activities_template->activity->id;
2472
  $class = 'delete-activity';
2473
 
2474
  // Determine if we're on a single activity page, and customize accordingly
2475
  if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) {
2476
- $url = add_query_arg( array( 'redirect_to' => wp_get_referer() ), $url );
2477
  $class = 'delete-activity-single';
2478
  }
2479
 
2480
- $link = '<a href="' . wp_nonce_url( $url, 'bp_activity_delete_link' ) . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>';
 
2481
  return apply_filters( 'bp_get_activity_delete_link', $link );
2482
  }
2483
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2484
  /**
2485
  * Output the activity latest update link.
2486
  *
@@ -2642,39 +2788,69 @@ function bp_activity_filter_links( $args = false ) {
2642
  function bp_activity_can_comment() {
2643
  global $activities_template;
2644
 
 
2645
  $can_comment = true;
2646
 
2647
- if ( false === $activities_template->disable_blogforum_replies || (int) $activities_template->disable_blogforum_replies ) {
2648
- if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2649
  $can_comment = false;
 
2650
  }
2651
 
2652
- if ( 'activity_comment' == bp_get_activity_action_name() )
2653
- $can_comment = false;
2654
-
2655
- return apply_filters( 'bp_activity_can_comment', $can_comment );
2656
  }
2657
 
2658
  /**
2659
- * Determine if a comment can be made on an activity reply item.
2660
  *
2661
- * Defaults to true, but can be modified by plugins.
2662
- *
2663
- * @since BuddyPress (1.5)
2664
- *
2665
- * @uses apply_filters() To call the 'bp_activity_can_comment_reply' hook
2666
  *
2667
  * @param object $comment Activity comment.
2668
- * @return bool $can_comment True if comment can receive comments.
 
2669
  */
2670
- function bp_activity_can_comment_reply( $comment ) {
 
 
2671
  $can_comment = true;
2672
 
2673
- if ( get_option( 'thread_comments' ) && bp_activity_get_comment_depth() >= get_option( 'thread_comments_depth' ) ) {
2674
- $can_comment = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2675
  }
2676
 
2677
- return apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment );
2678
  }
2679
 
2680
  /**
@@ -2686,12 +2862,10 @@ function bp_activity_can_comment_reply( $comment ) {
2686
  *
2687
  * @uses apply_filters() To call the 'bp_activity_can_favorite' hook.
2688
  *
2689
- * @return bool $can_favorite True if comment can receive comments.
2690
  */
2691
  function bp_activity_can_favorite() {
2692
- $can_favorite = true;
2693
-
2694
- return apply_filters( 'bp_activity_can_favorite', $can_favorite );
2695
  }
2696
 
2697
  /**
@@ -2720,13 +2894,20 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
2720
  * @return int The total favorite count for the specified user.
2721
  */
2722
  function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
2723
- if ( ! $user_id ) {
2724
- $user_id = bp_displayed_user_id();
2725
- }
2726
 
2727
- return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
 
 
 
 
 
 
 
 
 
 
2728
  }
2729
- add_filter( 'bp_get_total_favorite_count_for_user', 'bp_core_number_format' );
2730
 
2731
  /**
2732
  * Output the total mention count for a specified user.
@@ -2754,13 +2935,19 @@ function bp_total_mention_count_for_user( $user_id = 0 ) {
2754
  * @return int The total mention count for the specified user.
2755
  */
2756
  function bp_get_total_mention_count_for_user( $user_id = 0 ) {
2757
- if ( ! $user_id ) {
2758
- $user_id = bp_displayed_user_id();
2759
- }
2760
 
2761
- return apply_filters( 'bp_get_total_mention_count_for_user', bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) );
 
 
 
 
 
 
 
 
 
 
2762
  }
2763
- add_filter( 'bp_get_total_mention_count_for_user', 'bp_core_number_format' );
2764
 
2765
  /**
2766
  * Output the public message link for displayed user.
@@ -2789,10 +2976,16 @@ function bp_send_public_message_link() {
2789
  */
2790
  function bp_get_send_public_message_link() {
2791
 
2792
- if ( ! is_user_logged_in() || ! bp_is_user() || bp_is_my_profile() )
2793
- return false;
 
 
 
 
 
 
2794
 
2795
- return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_get_activity_directory_permalink() . '?r=' . bp_get_displayed_user_mentionname() ) );
2796
  }
2797
 
2798
  /**
@@ -2832,7 +3025,7 @@ function bp_activity_recurse_comments_activity_ids( $activity = array(), $activi
2832
  *
2833
  * @param int|string $user_id_or_username See {@link bp_get_mentioned_user_display_name()}.
2834
  */
2835
- function bp_mentioned_user_display_name( $user_id_or_username ) {
2836
  echo bp_get_mentioned_user_display_name( $user_id_or_username );
2837
  }
2838
 
@@ -2847,9 +3040,15 @@ function bp_mentioned_user_display_name( $user_id_or_username ) {
2847
  * @param int|string User ID or username.
2848
  * @return string The mentioned user's display name.
2849
  */
2850
- function bp_get_mentioned_user_display_name( $user_id_or_username ) {
2851
- if ( !$name = bp_core_get_user_displayname( $user_id_or_username ) )
 
 
 
 
 
2852
  $name = __( 'a user', 'buddypress' );
 
2853
 
2854
  return apply_filters( 'bp_get_mentioned_user_display_name', $name, $user_id_or_username );
2855
  }
@@ -2896,7 +3095,8 @@ function bp_send_public_message_button( $args = '' ) {
2896
  * @return string The button for sending a public message.
2897
  */
2898
  function bp_get_send_public_message_button( $args = '' ) {
2899
- $defaults = array(
 
2900
  'id' => 'public_message',
2901
  'component' => 'activity',
2902
  'must_be_logged_in' => true,
@@ -2906,12 +3106,10 @@ function bp_send_public_message_button( $args = '' ) {
2906
  'link_title' => __( 'Send a public message on your activity stream.', 'buddypress' ),
2907
  'link_text' => __( 'Public Message', 'buddypress' ),
2908
  'link_class' => 'activity-button mention'
2909
- );
2910
-
2911
- $button = wp_parse_args( $args, $defaults );
2912
 
2913
  // Filter and return the HTML button
2914
- return bp_get_button( apply_filters( 'bp_get_send_public_message_button', $button ) );
2915
  }
2916
 
2917
  /**
@@ -2955,28 +3153,52 @@ function bp_activity_post_form_action() {
2955
  * @param array $args See {@link bp_core_fetch_avatar()}.
2956
  */
2957
  function bp_activity_comments_user_avatars( $args = array() ) {
2958
- $defaults = array(
 
2959
  'height' => false,
2960
  'html' => true,
2961
  'type' => 'thumb',
2962
  'width' => false,
2963
- );
2964
-
2965
- $args = wp_parse_args( $args, $defaults );
2966
- extract( $args, EXTR_SKIP );
2967
 
2968
  // Get the user IDs of everyone who has left a comment to the current activity item
2969
  $user_ids = bp_activity_get_comments_user_ids();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2970
 
2971
- $output = array();
2972
- foreach ( (array) $user_ids as $user_id ) {
2973
- $profile_link = bp_core_get_user_domain( $user_id );
2974
- $image_html = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'height' => $height, 'html' => $html, 'type' => $type, 'width' => $width, ) );
 
2975
 
2976
- $output[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $profile_link ), $image_html );
 
 
 
2977
  }
2978
 
2979
- echo apply_filters( 'bp_activity_comments_user_avatars', '<li>' . implode( '</li><li>', $output ) . '</li>', $args, $output );
2980
  }
2981
 
2982
  /**
@@ -2987,10 +3209,12 @@ function bp_activity_comments_user_avatars( $args = array() ) {
2987
  * @return bool|array An array of IDs, or false if none are found.
2988
  */
2989
  function bp_activity_get_comments_user_ids() {
2990
- if ( empty( $GLOBALS['activities_template']->activity ) || empty( $GLOBALS['activities_template']->activity->children ) )
2991
- return false;
 
 
 
2992
 
2993
- $user_ids = (array) bp_activity_recurse_comments_user_ids( $GLOBALS['activities_template']->activity->children );
2994
  return apply_filters( 'bp_activity_get_comments_user_ids', array_unique( $user_ids ) );
2995
  }
2996
 
@@ -3002,22 +3226,33 @@ function bp_activity_get_comments_user_ids() {
3002
  * @param array $comments Array of {@link BP_Activity_Activity} items.
3003
  * @return array Array of user IDs.
3004
  */
3005
- function bp_activity_recurse_comments_user_ids( array $comments ) {
 
 
3006
  $user_ids = array();
3007
 
3008
- foreach ( $comments as $comment ) {
3009
- // If a user is a spammer, their activity items will have been automatically marked as spam. Skip these.
3010
- if ( $comment->is_spam )
3011
- continue;
 
 
 
 
 
3012
 
3013
- $user_ids[] = $comment->user_id;
 
3014
 
3015
- // Check for commentception
3016
- if ( ! empty( $comment->children ) )
3017
- $user_ids = array_merge( $user_ids, bp_activity_recurse_comments_user_ids( $comment->children ) );
 
 
3018
  }
3019
 
3020
- return $user_ids;
 
3021
  }
3022
 
3023
  /**
@@ -3054,11 +3289,11 @@ function bp_displayed_user_mentionname() {
3054
  * }
3055
  */
3056
  function bp_activity_types_list( $output = 'select', $args = '' ) {
3057
- $defaults = array(
 
3058
  'checkbox_name' => 'bp_activity_types',
3059
  'selected' => array(),
3060
- );
3061
- $args = wp_parse_args( $args, $defaults );
3062
 
3063
  $activities = bp_activity_get_types();
3064
  natsort( $activities );
@@ -3070,19 +3305,24 @@ function bp_activity_types_list( $output = 'select', $args = '' ) {
3070
  $checked = checked( true, in_array( $type, (array) $args['selected'] ), false );
3071
  $selected = selected( true, in_array( $type, (array) $args['selected'] ), false );
3072
 
3073
- if ( 'select' == $output )
3074
- printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $type ), $selected, esc_html( $description ) );
3075
-
3076
- elseif ( 'checkbox' == $output )
3077
- 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 );
 
 
 
 
3078
 
3079
  // Allow custom markup
3080
  do_action( 'bp_activity_types_list_' . $output, $args, $type, $description );
3081
  }
3082
 
3083
  // Backpat with BP-Default for dropdown boxes only
3084
- if ( 'select' == $output )
3085
  do_action( 'bp_activity_filter_options' );
 
3086
  }
3087
 
3088
 
@@ -3155,18 +3395,30 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
3155
  */
3156
  function bp_get_member_activity_feed_link() {
3157
 
3158
- if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) )
 
3159
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/feed/';
3160
- elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) )
 
 
3161
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed/';
3162
- elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) )
 
 
3163
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/';
3164
- elseif ( 'favorites' == bp_current_action() )
 
 
3165
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
3166
- elseif ( 'mentions' == bp_current_action() && bp_activity_do_mentions() )
 
 
3167
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
3168
- else
 
 
3169
  $link = '';
 
3170
 
3171
  return apply_filters( 'bp_get_activities_member_rss_link', $link );
3172
  }
@@ -3242,19 +3494,22 @@ function bp_activity_feed_item_title() {
3242
  function bp_get_activity_feed_item_title() {
3243
  global $activities_template;
3244
 
3245
- if ( !empty( $activities_template->activity->action ) )
3246
  $content = $activities_template->activity->action;
3247
- else
3248
  $content = $activities_template->activity->content;
 
3249
 
3250
  $content = explode( '<span', $content );
3251
- $title = strip_tags( ent2ncr( trim( convert_chars( $content[0] ) ) ) );
3252
 
3253
- if ( ':' == substr( $title, -1 ) )
3254
  $title = substr( $title, 0, -1 );
 
3255
 
3256
- if ( 'activity_update' == $activities_template->activity->type )
3257
  $title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " [&#133;]" ) ) ) ) ) );
 
3258
 
3259
  return apply_filters( 'bp_get_activity_feed_item_title', $title );
3260
  }
@@ -3283,7 +3538,11 @@ function bp_activity_feed_item_link() {
3283
  function bp_get_activity_feed_item_link() {
3284
  global $activities_template;
3285
 
3286
- return apply_filters( 'bp_get_activity_feed_item_link', $activities_template->activity->primary_link );
 
 
 
 
3287
  }
3288
 
3289
  /**
@@ -3310,7 +3569,11 @@ function bp_activity_feed_item_date() {
3310
  function bp_get_activity_feed_item_date() {
3311
  global $activities_template;
3312
 
3313
- return apply_filters( 'bp_get_activity_feed_item_date', $activities_template->activity->date_recorded );
 
 
 
 
3314
  }
3315
 
3316
  /**
@@ -3339,11 +3602,17 @@ function bp_activity_feed_item_description() {
3339
  function bp_get_activity_feed_item_description() {
3340
  global $activities_template;
3341
 
3342
- $content = '';
3343
- if ( ! empty( $activities_template->activity->content ) )
3344
- $content = $activities_template->activity->content;
 
3345
 
3346
- return apply_filters( 'bp_get_activity_feed_item_description', ent2ncr( convert_chars( str_replace( '%s', '', $content ) ) ) );
 
 
 
 
 
3347
  }
3348
 
3349
  /**
@@ -3362,3 +3631,91 @@ function bp_activity_sitewide_feed() {
3362
  <?php
3363
  }
3364
  add_action( 'bp_head', 'bp_activity_sitewide_feed' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
  var $in_the_loop;
100
 
101
+ /**
102
+ * URL parameter key for activity pagination. Default: 'acpage'.
103
+ *
104
+ * @since BuddyPress (2.1.0)
105
+ * @var string
106
+ */
107
+ var $pag_arg;
108
+
109
  var $pag_page;
110
  var $pag_num;
111
  var $pag_links;
178
  'filter' => false,
179
  'search_terms' => false,
180
  'meta_query' => false,
181
+ 'date_query' => false,
182
  'display_comments' => 'threaded',
183
  'show_hidden' => false,
184
  'spam' => 'ham_only',
187
  $r = wp_parse_args( $args, $defaults );
188
  extract( $r );
189
 
190
+ $this->pag_arg = $r['page_arg'];
191
+ $this->pag_page = isset( $_REQUEST[ $this->pag_arg ] ) ? intval( $_REQUEST[ $this->pag_arg ] ) : $page;
192
  $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
193
 
194
  // Check if blog/forum replies are disabled
221
  'sort' => $sort,
222
  'search_terms' => $search_terms,
223
  'meta_query' => $meta_query,
224
+ 'date_query' => $date_query,
225
  'filter' => $filter,
226
  'show_hidden' => $show_hidden,
227
  'exclude' => $exclude,
231
  ) );
232
  }
233
 
234
+ // The total_activity_count property will be set only if a
235
+ // 'count_total' query has taken place
236
+ if ( ! is_null( $this->activities['total'] ) ) {
237
+ if ( ! $max || $max >= (int) $this->activities['total'] ) {
238
+ $this->total_activity_count = (int) $this->activities['total'];
239
+ } else {
240
+ $this->total_activity_count = (int) $max;
241
+ }
242
+ }
243
+
244
+ $this->has_more_items = $this->activities['has_more_items'];
245
 
246
  $this->activities = $this->activities['activities'];
247
 
525
  $object = $bp->groups->id;
526
  $primary_id = $bp->groups->current_group->id;
527
 
528
+ if ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) || bp_current_user_can( 'bp_moderate' ) ) {
529
  $show_hidden = true;
530
+ }
531
  }
532
 
533
  // The default scope should recognize custom slugs
569
  'since' => false, // return only items recorded since this Y-m-d H:i:s date
570
 
571
  'meta_query' => false, // filter on activity meta. See WP_Meta_Query for format
572
+ 'date_query' => false, // filter by date. See first parameter of WP_Date_Query for format
573
 
574
  // Searching
575
  'search_terms' => false, // specify terms to search on
683
  'filter' => $filter,
684
  'search_terms' => $search_terms,
685
  'meta_query' => $meta_query,
686
+ 'date_query' => $date_query,
687
  'display_comments' => $display_comments,
688
  'show_hidden' => $show_hidden,
689
  'spam' => $spam,
725
  return $activities_template->the_activity();
726
  }
727
 
728
+ /**
729
+ * Output the URL for the Load More link.
730
+ *
731
+ * @since BuddyPress (2.1.0)
732
+ */
733
+ function bp_activity_load_more_link() {
734
+ echo bp_get_activity_load_more_link();
735
+ }
736
+ function bp_get_activity_load_more_link() {
737
+ global $activities_template;
738
+
739
+ $link = bp_get_requested_url();
740
+ $link = add_query_arg( $activities_template->pag_arg, $activities_template->pag_page + 1, $link );
741
+
742
+ return apply_filters( 'bp_get_activity_load_more_link', $link );
743
+ }
744
+
745
  /**
746
  * Output the activity pagination count.
747
  *
772
  $to_num = bp_core_number_format( ( $start_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $start_num + ( $activities_template->pag_num - 1 ) );
773
  $total = bp_core_number_format( $activities_template->total_activity_count );
774
 
775
+ return sprintf( _n( 'Viewing 1 item', 'Viewing %1$s - %2$s of %3$s items', $total, 'buddypress' ), $from_num, $to_num, $total );
776
  }
777
 
778
  /**
815
  function bp_activity_has_more_items() {
816
  global $activities_template;
817
 
818
+ if ( ! empty( $activities_template->has_more_items ) ) {
819
+ $has_more_items = true;
820
+ } else {
821
+ $remaining_pages = 0;
822
 
823
+ if ( ! empty( $activities_template->pag_page ) ) {
824
+ $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
825
+ }
826
 
827
+ $has_more_items = (int) $remaining_pages > 0;
828
+ }
829
 
830
  return apply_filters( 'bp_activity_has_more_items', $has_more_items );
831
  }
1046
  return apply_filters( 'bp_get_activity_date_recorded', $activities_template->activity->date_recorded );
1047
  }
1048
 
1049
+ /**
1050
+ * Output the display name of the member who posted the activity
1051
+ *
1052
+ * @since BuddyPress (2.1.0)
1053
+ *
1054
+ * @uses bp_get_activity_member_display_name()
1055
+ */
1056
+ function bp_activity_member_display_name() {
1057
+ echo bp_get_activity_member_display_name();
1058
+ }
1059
+
1060
+ /**
1061
+ * Return the display name of the member who posted the activity
1062
+ *
1063
+ * @since BuddyPress (2.1.0)
1064
+ *
1065
+ * @global object $activities_template {@link BP_Activity_Template}
1066
+ * @uses apply_filters() To call the 'bp_get_activity_member_display_name' hook.
1067
+ *
1068
+ * @return string The date the activity was recorded.
1069
+ */
1070
+ function bp_get_activity_member_display_name() {
1071
+ global $activities_template;
1072
+
1073
+ $retval = isset( $activities_template->activity->display_name )
1074
+ ? $activities_template->activity->display_name
1075
+ : '';
1076
+
1077
+ return apply_filters( 'bp_get_activity_member_display_name', $retval );
1078
+ }
1079
+
1080
  /**
1081
  * Output the activity object name.
1082
  *
1211
  function bp_get_activity_user_link() {
1212
  global $activities_template;
1213
 
1214
+ if ( empty( $activities_template->activity->user_id ) || empty( $activities_template->activity->user_nicename ) || empty( $activities_template->activity->user_login ) ) {
1215
  $link = $activities_template->activity->primary_link;
1216
+ } else {
1217
  $link = bp_core_get_user_domain( $activities_template->activity->user_id, $activities_template->activity->user_nicename, $activities_template->activity->user_login );
1218
+ }
1219
 
1220
  return apply_filters( 'bp_get_activity_user_link', $link );
1221
  }
1670
  function bp_activity_user_can_delete( $activity = false ) {
1671
  global $activities_template;
1672
 
1673
+ // Try to use current activity if none was passed
1674
+ if ( empty( $activity ) && ! empty( $activities_template->activity ) ) {
1675
  $activity = $activities_template->activity;
1676
+ }
1677
 
1678
+ // If current_comment is set, we'll use that in place of the main activity
1679
+ if ( isset( $activity->current_comment ) ) {
1680
  $activity = $activity->current_comment;
1681
+ }
1682
 
1683
+ // Assume the user cannot delete the activity item
1684
  $can_delete = false;
1685
 
1686
+ // Only logged in users can delete activity
1687
+ if ( is_user_logged_in() ) {
1688
 
1689
+ // Community moderators can always delete activity (at least for now)
1690
+ if ( bp_current_user_can( 'bp_moderate' ) ) {
1691
+ $can_delete = true;
1692
+ }
1693
 
1694
+ // Users are allowed to delete their own activity. This is actually
1695
+ // quite powerful, because doing so also deletes all comments to that
1696
+ // activity item. We should revisit this eventually.
1697
+ if ( isset( $activity->user_id ) && ( $activity->user_id === bp_loggedin_user_id() ) ) {
1698
+ $can_delete = true;
1699
+ }
1700
 
1701
+ // Viewing a single item, and this user is an admin of that item
1702
+ if ( bp_is_single_item() && bp_is_item_admin() ) {
1703
+ $can_delete = true;
1704
+ }
1705
+ }
1706
+
1707
+ return (bool) apply_filters( 'bp_activity_user_can_delete', $can_delete, $activity );
1708
  }
1709
 
1710
  /**
1841
  function bp_get_activity_is_favorite() {
1842
  global $activities_template;
1843
 
1844
+ return (bool) apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) );
1845
  }
1846
 
1847
  /**
2181
  }
2182
 
2183
  /**
2184
+ * Return the comment count of an activity item.
 
 
 
 
 
2185
  *
2186
  * @since BuddyPress (1.2)
2187
  *
2188
  * @global object $activities_template {@link BP_Activity_Template}
2189
  * @uses bp_activity_recurse_comment_count()
2190
  * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook.
 
2191
  *
2192
+ * @param array $deprecated Deprecated.
2193
+ *
2194
  * @return int $count The activity comment count.
2195
  */
2196
+ function bp_activity_get_comment_count( $deprecated = null ) {
2197
  global $activities_template;
2198
 
2199
+ // Deprecated notice about $args
2200
+ if ( ! empty( $deprecated ) ) {
2201
+ _deprecated_argument( __FUNCTION__, '1.2', sprintf( __( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', 'buddypress' ), __FUNCTION__, __FILE__ ) );
2202
+ }
2203
 
2204
+ // Get the count using the purpose-built recursive function
2205
+ $count = ! empty( $activities_template->activity->children )
2206
+ ? bp_activity_recurse_comment_count( $activities_template->activity )
2207
+ : 0;
2208
 
2209
  return apply_filters( 'bp_activity_get_comment_count', (int) $count );
2210
  }
2211
 
2212
  /**
2213
+ * Return the total number of comments to the current comment.
2214
  *
2215
+ * This function recursively adds the total number of comments each
2216
+ * activity child has, and returns them.
 
 
2217
  *
2218
  * @since BuddyPress (1.2)
2219
  *
2220
  * @uses bp_activity_recurse_comment_count()
2221
+ * @uses apply_filters() To call the 'bp_activity_recurse_comment_count' hook
 
2222
  *
2223
  * @param object $comment Activity comment object.
2224
  * @param int $count The current iteration count.
2225
+ *
2226
  * @return int $count The activity comment count.
2227
  */
2228
  function bp_activity_recurse_comment_count( $comment, $count = 0 ) {
2229
 
2230
+ // Copy the count
2231
+ $new_count = $count;
2232
 
2233
+ // Loop through children and recursively count comments
2234
+ if ( ! empty( $comment->children ) ) {
2235
+ foreach ( (array) $comment->children as $comment ) {
2236
+ $new_count++;
2237
+ $new_count = bp_activity_recurse_comment_count( $comment, $new_count );
2238
+ }
2239
  }
2240
 
2241
+ // Filter and return
2242
+ return apply_filters( 'bp_activity_recurse_comment_count', $new_count, $comment, $count );
2243
  }
2244
 
2245
  /**
2419
  function bp_get_activity_comment_permalink() {
2420
  global $activities_template;
2421
 
2422
+ // Check that comment exists
2423
+ $comment_id = isset( $activities_template->activity->current_comment->id )
2424
+ ? $activities_template->activity->current_comment->id
2425
+ : 0;
2426
 
2427
+ // Setup the comment link
2428
+ $comment_link = ! empty( $comment_id )
2429
+ ? '#acomment-' .$comment_id
2430
+ : false;
2431
+
2432
+ // Append comment ID to end of activity permalink
2433
+ $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . $comment_link;
2434
+
2435
+ return apply_filters( 'bp_get_activity_comment_permalink', $link, $comment_id );
2436
  }
2437
 
2438
  /**
2570
  * if on single activity page.
2571
  */
2572
  function bp_get_activity_delete_link() {
 
2573
 
2574
+ $url = bp_get_activity_delete_url();
2575
  $class = 'delete-activity';
2576
 
2577
  // Determine if we're on a single activity page, and customize accordingly
2578
  if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) {
 
2579
  $class = 'delete-activity-single';
2580
  }
2581
 
2582
+ $link = '<a href="' . esc_url( $url ) . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>';
2583
+
2584
  return apply_filters( 'bp_get_activity_delete_link', $link );
2585
  }
2586
 
2587
+ /**
2588
+ * Output the URL to delete a single activity stream item
2589
+ *
2590
+ * @since BuddyPress (2.1.0)
2591
+ *
2592
+ * @uses bp_get_activity_delete_link()
2593
+ */
2594
+ function bp_activity_delete_url() {
2595
+ echo esc_url( bp_get_activity_delete_url() );
2596
+ }
2597
+ /**
2598
+ * Return the URL to delete a single activity item
2599
+ *
2600
+ * @since BuddyPress (2.1.0)
2601
+ *
2602
+ * @global object $activities_template {@link BP_Activity_Template}
2603
+ * @uses bp_get_root_domain()
2604
+ * @uses bp_get_activity_root_slug()
2605
+ * @uses bp_is_activity_component()
2606
+ * @uses bp_current_action()
2607
+ * @uses add_query_arg()
2608
+ * @uses wp_get_referer()
2609
+ * @uses wp_nonce_url()
2610
+ * @uses apply_filters() To call the 'bp_get_activity_delete_link' hook.
2611
+ *
2612
+ * @return string $link Activity delete link. Contains $redirect_to arg
2613
+ * if on single activity page.
2614
+ */
2615
+ function bp_get_activity_delete_url() {
2616
+ global $activities_template;
2617
+
2618
+ $url = trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activities_template->activity->id );
2619
+
2620
+ // Determine if we're on a single activity page, and customize accordingly
2621
+ if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) {
2622
+ $url = add_query_arg( array( 'redirect_to' => wp_get_referer() ), $url );
2623
+ }
2624
+
2625
+ $url = wp_nonce_url( $url, 'bp_activity_delete_link' );
2626
+
2627
+ return apply_filters( 'bp_get_activity_delete_url', $url );
2628
+ }
2629
+
2630
  /**
2631
  * Output the activity latest update link.
2632
  *
2788
  function bp_activity_can_comment() {
2789
  global $activities_template;
2790
 
2791
+ // Assume activity can be commented on
2792
  $can_comment = true;
2793
 
2794
+ // Determine ability to comment based on activity action name
2795
+ $activity_action = bp_get_activity_action_name();
2796
+ switch ( $activity_action ) {
2797
+
2798
+ // Maybe turn off for blog and forum updates
2799
+ case 'new_blog_post' :
2800
+ case 'new_blog_comment' :
2801
+ case 'new_forum_topic' :
2802
+ case 'new_forum_post' :
2803
+ if ( ! empty( $activities_template->disable_blogforum_replies ) ) {
2804
+ $can_comment = false;
2805
+ }
2806
+ break;
2807
+
2808
+ // Turn off for activity comments
2809
+ case 'activity_comment' :
2810
  $can_comment = false;
2811
+ break;
2812
  }
2813
 
2814
+ return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_action );
 
 
 
2815
  }
2816
 
2817
  /**
2818
+ * Determine whether a comment can be made on an activity reply item.
2819
  *
2820
+ * @since BuddyPress (1.5.0)
 
 
 
 
2821
  *
2822
  * @param object $comment Activity comment.
2823
+ * @return bool $can_comment True if comment can receive comments, otherwise
2824
+ * false.
2825
  */
2826
+ function bp_activity_can_comment_reply( $comment = '' ) {
2827
+
2828
+ // Assume activity can be commented on
2829
  $can_comment = true;
2830
 
2831
+ // Check that comment exists
2832
+ if ( empty( $comment ) ) {
2833
+ $comment = bp_activity_current_comment();
2834
+ }
2835
+
2836
+ if ( ! empty( $comment ) ) {
2837
+
2838
+ // Fall back on current comment in activity loop
2839
+ $comment_depth = isset( $comment->depth )
2840
+ ? intval( $comment->depth )
2841
+ : bp_activity_get_comment_depth();
2842
+
2843
+ // Threading is turned on, so check the depth
2844
+ if ( get_option( 'thread_comments' ) ) {
2845
+ $can_comment = (bool) ( $comment_depth < get_option( 'thread_comments_depth' ) );
2846
+
2847
+ // No threading for comment replies if no threading for comments
2848
+ } else {
2849
+ $can_comment = false;
2850
+ }
2851
  }
2852
 
2853
+ return (bool) apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment );
2854
  }
2855
 
2856
  /**
2862
  *
2863
  * @uses apply_filters() To call the 'bp_activity_can_favorite' hook.
2864
  *
2865
+ * @return bool True if comment can receive comments.
2866
  */
2867
  function bp_activity_can_favorite() {
2868
+ return apply_filters( 'bp_activity_can_favorite', true );
 
 
2869
  }
2870
 
2871
  /**
2894
  * @return int The total favorite count for the specified user.
2895
  */
2896
  function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
 
 
 
2897
 
2898
+ // Default to displayed user if none is passed
2899
+ $user_id = empty( $user_id )
2900
+ ? bp_displayed_user_id()
2901
+ : $user_id;
2902
+
2903
+ // Get user meta if user ID exists
2904
+ $retval = ! empty( $user_id )
2905
+ ? bp_activity_total_favorites_for_user( $user_id )
2906
+ : false;
2907
+
2908
+ return apply_filters( 'bp_get_total_favorite_count_for_user', $retval );
2909
  }
2910
+
2911
 
2912
  /**
2913
  * Output the total mention count for a specified user.
2935
  * @return int The total mention count for the specified user.
2936
  */
2937
  function bp_get_total_mention_count_for_user( $user_id = 0 ) {
 
 
 
2938
 
2939
+ // Default to displayed user if none is passed
2940
+ $user_id = empty( $user_id )
2941
+ ? bp_displayed_user_id()
2942
+ : $user_id;
2943
+
2944
+ // Get user meta if user ID exists
2945
+ $retval = ! empty( $user_id )
2946
+ ? bp_get_user_meta( $user_id, 'bp_new_mention_count', true )
2947
+ : false;
2948
+
2949
+ return apply_filters( 'bp_get_total_mention_count_for_user', $retval );
2950
  }
 
2951
 
2952
  /**
2953
  * Output the public message link for displayed user.
2976
  */
2977
  function bp_get_send_public_message_link() {
2978
 
2979
+ // No link if not logged in, not looking at someone else's profile
2980
+ if ( ! is_user_logged_in() || ! bp_is_user() || bp_is_my_profile() ) {
2981
+ $retval = '';
2982
+ } else {
2983
+ $args = array( 'r' => bp_get_displayed_user_mentionname() );
2984
+ $url = add_query_arg( $args, bp_get_activity_directory_permalink() );
2985
+ $retval = wp_nonce_url( $url );
2986
+ }
2987
 
2988
+ return apply_filters( 'bp_get_send_public_message_link', $retval );
2989
  }
2990
 
2991
  /**
3025
  *
3026
  * @param int|string $user_id_or_username See {@link bp_get_mentioned_user_display_name()}.
3027
  */
3028
+ function bp_mentioned_user_display_name( $user_id_or_username = false ) {
3029
  echo bp_get_mentioned_user_display_name( $user_id_or_username );
3030
  }
3031
 
3040
  * @param int|string User ID or username.
3041
  * @return string The mentioned user's display name.
3042
  */
3043
+ function bp_get_mentioned_user_display_name( $user_id_or_username = false ) {
3044
+
3045
+ // Get user display name
3046
+ $name = bp_core_get_user_displayname( $user_id_or_username );
3047
+
3048
+ // If user somehow has no name, return this really lame string
3049
+ if ( empty( $name ) ) {
3050
  $name = __( 'a user', 'buddypress' );
3051
+ }
3052
 
3053
  return apply_filters( 'bp_get_mentioned_user_display_name', $name, $user_id_or_username );
3054
  }
3095
  * @return string The button for sending a public message.
3096
  */
3097
  function bp_get_send_public_message_button( $args = '' ) {
3098
+
3099
+ $r = bp_parse_args( $args, array(
3100
  'id' => 'public_message',
3101
  'component' => 'activity',
3102
  'must_be_logged_in' => true,
3106
  'link_title' => __( 'Send a public message on your activity stream.', 'buddypress' ),
3107
  'link_text' => __( 'Public Message', 'buddypress' ),
3108
  'link_class' => 'activity-button mention'
3109
+ ) );
 
 
3110
 
3111
  // Filter and return the HTML button
3112
+ return bp_get_button( apply_filters( 'bp_get_send_public_message_button', $r ) );
3113
  }
3114
 
3115
  /**
3153
  * @param array $args See {@link bp_core_fetch_avatar()}.
3154
  */
3155
  function bp_activity_comments_user_avatars( $args = array() ) {
3156
+
3157
+ $r = bp_parse_args( $args, array(
3158
  'height' => false,
3159
  'html' => true,
3160
  'type' => 'thumb',
3161
  'width' => false,
3162
+ ) );
 
 
 
3163
 
3164
  // Get the user IDs of everyone who has left a comment to the current activity item
3165
  $user_ids = bp_activity_get_comments_user_ids();
3166
+ $output = array();
3167
+ $retval = '';
3168
+
3169
+ if ( ! empty( $user_ids ) ) {
3170
+ foreach ( (array) $user_ids as $user_id ) {
3171
+
3172
+ // Skip an empty user ID
3173
+ if ( empty( $user_id ) ) {
3174
+ continue;
3175
+ }
3176
+
3177
+ // Get profile link for this user
3178
+ $profile_link = bp_core_get_user_domain( $user_id );
3179
+
3180
+ // Get avatar for this user
3181
+ $image_html = bp_core_fetch_avatar( array(
3182
+ 'item_id' => $user_id,
3183
+ 'height' => $r['height'],
3184
+ 'html' => $r['html'],
3185
+ 'type' => $r['type'],
3186
+ 'width' => $r['width']
3187
+ ) );
3188
 
3189
+ // If user has link & avatar, add them to the output array
3190
+ if ( ! empty( $profile_link ) && ! empty( $image_html ) ) {
3191
+ $output[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $profile_link ), $image_html );
3192
+ }
3193
+ }
3194
 
3195
+ // If output array is not empty, wrap everything in some list items
3196
+ if ( ! empty( $output ) ) {
3197
+ $retval = '<li>' . implode( '</li><li>', $output ) . '</li>';
3198
+ }
3199
  }
3200
 
3201
+ echo apply_filters( 'bp_activity_comments_user_avatars', $retval, $r, $output );
3202
  }
3203
 
3204
  /**
3209
  * @return bool|array An array of IDs, or false if none are found.
3210
  */
3211
  function bp_activity_get_comments_user_ids() {
3212
+ global $activities_template;
3213
+
3214
+ $user_ids = ! empty( $activities_template->activity->children )
3215
+ ? (array) bp_activity_recurse_comments_user_ids( $activities_template->activity->children )
3216
+ : array();
3217
 
 
3218
  return apply_filters( 'bp_activity_get_comments_user_ids', array_unique( $user_ids ) );
3219
  }
3220
 
3226
  * @param array $comments Array of {@link BP_Activity_Activity} items.
3227
  * @return array Array of user IDs.
3228
  */
3229
+ function bp_activity_recurse_comments_user_ids( array $comments = array() ) {
3230
+
3231
+ // Default user ID's array
3232
  $user_ids = array();
3233
 
3234
+ // Loop through comments and try to get user ID's
3235
+ if ( ! empty( $comments ) ) {
3236
+ foreach ( $comments as $comment ) {
3237
+
3238
+ // If a user is a spammer, their activity items will have been
3239
+ // automatically marked as spam. Skip these.
3240
+ if ( ! empty( $comment->is_spam ) ) {
3241
+ continue;
3242
+ }
3243
 
3244
+ // Add user ID to array
3245
+ $user_ids[] = $comment->user_id;
3246
 
3247
+ // Check for commentception
3248
+ if ( ! empty( $comment->children ) ) {
3249
+ $user_ids = array_merge( $user_ids, bp_activity_recurse_comments_user_ids( $comment->children ) );
3250
+ }
3251
+ }
3252
  }
3253
 
3254
+ // Filter and return
3255
+ return apply_filters( 'bp_activity_recurse_comments_user_ids', $user_ids, $comments );
3256
  }
3257
 
3258
  /**
3289
  * }
3290
  */
3291
  function bp_activity_types_list( $output = 'select', $args = '' ) {
3292
+
3293
+ $args = bp_parse_args( $args, array(
3294
  'checkbox_name' => 'bp_activity_types',
3295
  'selected' => array(),
3296
+ ) );
 
3297
 
3298
  $activities = bp_activity_get_types();
3299
  natsort( $activities );
3305
  $checked = checked( true, in_array( $type, (array) $args['selected'] ), false );
3306
  $selected = selected( true, in_array( $type, (array) $args['selected'] ), false );
3307
 
3308
+ // Switch output based on the element
3309
+ switch ( $output ) {
3310
+ case 'select' :
3311
+ printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $type ), $selected, esc_html( $description ) );
3312
+ break;
3313
+ case 'checkbox' :
3314
+ 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 );
3315
+ break;
3316
+ }
3317
 
3318
  // Allow custom markup
3319
  do_action( 'bp_activity_types_list_' . $output, $args, $type, $description );
3320
  }
3321
 
3322
  // Backpat with BP-Default for dropdown boxes only
3323
+ if ( 'select' === $output ) {
3324
  do_action( 'bp_activity_filter_options' );
3325
+ }
3326
  }
3327
 
3328
 
3395
  */
3396
  function bp_get_member_activity_feed_link() {
3397
 
3398
+ // Single member activity feed link
3399
+ if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) {
3400
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/feed/';
3401
+
3402
+ // Friend feed link
3403
+ } elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) ) {
3404
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed/';
3405
+
3406
+ // Group feed link
3407
+ } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) {
3408
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/';
3409
+
3410
+ // Favorites activity feed link
3411
+ } elseif ( 'favorites' === bp_current_action() ) {
3412
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
3413
+
3414
+ // Mentions activity feed link
3415
+ } elseif ( ( 'mentions' === bp_current_action() ) && bp_activity_do_mentions() ) {
3416
  $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
3417
+
3418
+ // No feed link
3419
+ } else {
3420
  $link = '';
3421
+ }
3422
 
3423
  return apply_filters( 'bp_get_activities_member_rss_link', $link );
3424
  }
3494
  function bp_get_activity_feed_item_title() {
3495
  global $activities_template;
3496
 
3497
+ if ( !empty( $activities_template->activity->action ) ) {
3498
  $content = $activities_template->activity->action;
3499
+ } else {
3500
  $content = $activities_template->activity->content;
3501
+ }
3502
 
3503
  $content = explode( '<span', $content );
3504
+ $title = strip_tags( ent2ncr( trim( convert_chars( $content[0] ) ) ) );
3505
 
3506
+ if ( ':' === substr( $title, -1 ) ) {
3507
  $title = substr( $title, 0, -1 );
3508
+ }
3509
 
3510
+ if ( 'activity_update' === $activities_template->activity->type ) {
3511
  $title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " [&#133;]" ) ) ) ) ) );
3512
+ }
3513
 
3514
  return apply_filters( 'bp_get_activity_feed_item_title', $title );
3515
  }
3538
  function bp_get_activity_feed_item_link() {
3539
  global $activities_template;
3540
 
3541
+ $retval = ! empty( $activities_template->activity->primary_link )
3542
+ ? $activities_template->activity->primary_link
3543
+ : '';
3544
+
3545
+ return apply_filters( 'bp_get_activity_feed_item_link', $retval );
3546
  }
3547
 
3548
  /**
3569
  function bp_get_activity_feed_item_date() {
3570
  global $activities_template;
3571
 
3572
+ $retval = ! empty( $activities_template->activity->date_recorded )
3573
+ ? $activities_template->activity->date_recorded
3574
+ : '';
3575
+
3576
+ return apply_filters( 'bp_get_activity_feed_item_date', $retval );
3577
  }
3578
 
3579
  /**
3602
  function bp_get_activity_feed_item_description() {
3603
  global $activities_template;
3604
 
3605
+ // Get the content, if exists
3606
+ $content = ! empty( $activities_template->activity->content )
3607
+ ? $activities_template->activity->content
3608
+ : '';
3609
 
3610
+ // Perform a few string conversions on the content, if it's not empty
3611
+ if ( ! empty( $content ) ) {
3612
+ $content = ent2ncr( convert_chars( str_replace( '%s', '', $content ) ) );
3613
+ }
3614
+
3615
+ return apply_filters( 'bp_get_activity_feed_item_description', $content );
3616
  }
3617
 
3618
  /**
3631
  <?php
3632
  }
3633
  add_action( 'bp_head', 'bp_activity_sitewide_feed' );
3634
+
3635
+ /**
3636
+ * Display available filters depending on the scope.
3637
+ *
3638
+ * @since BuddyPress (2.1.0)
3639
+ *
3640
+ * @param string $context The current context. 'activity', 'member',
3641
+ * 'member_groups', 'group'.
3642
+ * @uses bp_get_activity_show_filters()
3643
+ */
3644
+ function bp_activity_show_filters( $context = '' ) {
3645
+ echo bp_get_activity_show_filters( $context );
3646
+ }
3647
+ /**
3648
+ * Get available filters depending on the scope.
3649
+ *
3650
+ * @since BuddyPress (2.1.0)
3651
+ *
3652
+ * @param string $context The current context. 'activity', 'member',
3653
+ * 'member_groups', 'group'
3654
+ * @return string HTML for <option> values.
3655
+ */
3656
+ function bp_get_activity_show_filters( $context = '' ) {
3657
+ // Set default context based on current page
3658
+ if ( empty( $context ) ) {
3659
+
3660
+ // On member pages, default to 'member', unless this
3661
+ // is a user's Groups activity
3662
+ if ( bp_is_user() ) {
3663
+ if ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) {
3664
+ $context = 'member_groups';
3665
+ } else {
3666
+ $context = 'member';
3667
+ }
3668
+
3669
+ // On individual group pages, default to 'group'
3670
+ } else if ( bp_is_active( 'groups' ) && bp_is_group() ) {
3671
+ $context = 'group';
3672
+
3673
+ // 'activity' everywhere else
3674
+ } else {
3675
+ $context = 'activity';
3676
+ }
3677
+ }
3678
+
3679
+ $filters = array();
3680
+
3681
+ // Walk through the registered actions, and prepare an the
3682
+ // select box options.
3683
+ foreach ( buddypress()->activity->actions as $actions ) {
3684
+ foreach ( $actions as $action ) {
3685
+ if ( ! in_array( $context, (array) $action['context'] ) ) {
3686
+ continue;
3687
+ }
3688
+
3689
+ // Friends activity collapses two filters into one
3690
+ if ( in_array( $action['key'], array( 'friendship_accepted', 'friendship_created' ) ) ) {
3691
+ $action['key'] = 'friendship_accepted,friendship_created';
3692
+ }
3693
+
3694
+ $filters[ $action['key'] ] = $action['label'];
3695
+ }
3696
+ }
3697
+
3698
+ /**
3699
+ * Modify the filter options available in the activity filter dropdown.
3700
+ *
3701
+ * @since BuddyPress (2.1.0)
3702
+ *
3703
+ * @param array $filters Array of filter options for the given
3704
+ * context, in the following format:
3705
+ * $option_value => $option_name
3706
+ * @param string $context Context for the filter. 'activity'
3707
+ * 'member', 'member_groups', 'group'.
3708
+ */
3709
+ $filters = apply_filters( 'bp_get_activity_show_filters', $filters, $context );
3710
+
3711
+ // Build the options output
3712
+ $output = '';
3713
+
3714
+ if ( ! empty( $filters ) ) {
3715
+ foreach ( $filters as $value => $filter ) {
3716
+ $output .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $filter ) . '</option>' . "\n";
3717
+ }
3718
+ }
3719
+
3720
+ return apply_filters( 'bp_get_activity_show_filters', $output, $filters, $context );
3721
+ }
bp-activity/css/mentions-rtl.css ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .atwho-view {
2
+ background: #FFF;
3
+ border-radius: 2px;
4
+ border: 1px solid rgb(204, 204, 204);
5
+ box-shadow: 0 0 5px rgba(204, 204, 204, 0.25), 0 0 1px #FFF;
6
+ color: #D84800;
7
+ display: none;
8
+ font-family: sans-serif;
9
+ margin-top: 18px;
10
+ position: absolute;
11
+ top: 0;
12
+ z-index: 1000; /* >999 for wp-admin */
13
+ }
14
+ /* @noflip */
15
+ .atwho-view {
16
+ left: 0;
17
+ }
18
+ .atwho-view ul {
19
+ list-style: none;
20
+ margin: auto;
21
+ padding: 0;
22
+ }
23
+ .atwho-view ul li {
24
+ border-bottom: 1px solid #EFEFEF;
25
+ box-sizing: content-box;
26
+ cursor: pointer;
27
+ display: block;
28
+ font-size: 14px;
29
+ height: 20px;
30
+ line-height: 20px;
31
+ margin: 0;
32
+ overflow: hidden;
33
+ padding: 5px 10px;
34
+ }
35
+ .atwho-view img {
36
+ border-radius: 2px;
37
+ float: left;
38
+ height: 20px;
39
+ margin-top:0;
40
+ width: 20px;
41
+ }
42
+ .atwho-view strong {
43
+ background: #EFEFEF;
44
+ font: bold;
45
+ }
46
+ .atwho-view .username strong {
47
+ color: #D54E21;
48
+ }
49
+ .atwho-view small {
50
+ color: #AAA;
51
+ float: left;
52
+ font-size: smaller;
53
+ font-weight: normal;
54
+ margin: 0 40px 0 10px;
55
+ }
56
+ .atwho-view .cur {
57
+ background: rgba(239, 239, 239, 0.5);
58
+ }
59
+
60
+ @media (max-width: 900px) {
61
+ .atwho-view img {
62
+ float: right;
63
+ margin: 0 0 0 10px;
64
+ }
65
+ .atwho-view small {
66
+ display: none;
67
+ }
68
+ }
69
+ @media (max-width: 400px) {
70
+ .atwho-view ul li {
71
+ font-size: 16px;
72
+ line-height: 23px;
73
+ padding: 13px;
74
+ }
75
+ .atwho-view ul li img {
76
+ height: 30px;
77
+ margin-top: -5px;
78
+ width: 30px;
79
+ }
80
+ }
bp-activity/css/mentions-rtl.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ .atwho-view{background:#FFF;border-radius:2px;border:1px solid #ccc;box-shadow:0 0 5px rgba(204,204,204,.25),0 0 1px #FFF;color:#D84800;display:none;font-family:sans-serif;margin-top:18px;position:absolute;top:0;z-index:1000;left:0}.atwho-view ul{list-style:none;margin:auto;padding:0}.atwho-view ul li{border-bottom:1px solid #EFEFEF;box-sizing:content-box;cursor:pointer;display:block;font-size:14px;height:20px;line-height:20px;margin:0;overflow:hidden;padding:5px 10px}.atwho-view img{border-radius:2px;float:left;height:20px;margin-top:0;width:20px}.atwho-view strong{background:#EFEFEF;font:700}.atwho-view .username strong{color:#D54E21}.atwho-view small{color:#AAA;float:left;font-size:smaller;font-weight:400;margin:0 40px 0 10px}.atwho-view .cur{background:rgba(239,239,239,.5)}@media (max-width:900px){.atwho-view img{float:right;margin:0 0 0 10px}.atwho-view small{display:none}}@media (max-width:400px){.atwho-view ul li{font-size:16px;line-height:23px;padding:13px}.atwho-view ul li img{height:30px;margin-top:-5px;width:30px}}
bp-activity/css/mentions.css ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .atwho-view {
2
+ background: #FFF;
3
+ border-radius: 2px;
4
+ border: 1px solid rgb(204, 204, 204);
5
+ box-shadow: 0 0 5px rgba(204, 204, 204, 0.25), 0 0 1px #FFF;
6
+ color: #D84800;
7
+ display: none;
8
+ font-family: sans-serif;
9
+ margin-top: 18px;
10
+ position: absolute;
11
+ top: 0;
12
+ z-index: 1000; /* >999 for wp-admin */
13
+ }
14
+ /* @noflip */
15
+ .atwho-view {
16
+ left: 0;
17
+ }
18
+ .atwho-view ul {
19
+ list-style: none;
20
+ margin: auto;
21
+ padding: 0;
22
+ }
23
+ .atwho-view ul li {
24
+ border-bottom: 1px solid #EFEFEF;
25
+ box-sizing: content-box;
26
+ cursor: pointer;
27
+ display: block;
28
+ font-size: 14px;
29
+ height: 20px;
30
+ line-height: 20px;
31
+ margin: 0;
32
+ overflow: hidden;
33
+ padding: 5px 10px;
34
+ }
35
+ .atwho-view img {
36
+ border-radius: 2px;
37
+ float: right;
38
+ height: 20px;
39
+ margin-top:0;
40
+ width: 20px;
41
+ }
42
+ .atwho-view strong {
43
+ background: #EFEFEF;
44
+ font: bold;
45
+ }
46
+ .atwho-view .username strong {
47
+ color: #D54E21;
48
+ }
49
+ .atwho-view small {
50
+ color: #AAA;
51
+ float: right;
52
+ font-size: smaller;
53
+ font-weight: normal;
54
+ margin: 0 10px 0 40px;
55
+ }
56
+ .atwho-view .cur {
57
+ background: rgba(239, 239, 239, 0.5);
58
+ }
59
+
60
+ @media (max-width: 900px) {
61
+ .atwho-view img {
62
+ float: left;
63
+ margin: 0 10px 0 0;
64
+ }
65
+ .atwho-view small {
66
+ display: none;
67
+ }
68
+ }
69
+ @media (max-width: 400px) {
70
+ .atwho-view ul li {
71
+ font-size: 16px;
72
+ line-height: 23px;
73
+ padding: 13px;
74
+ }
75
+ .atwho-view ul li img {
76
+ height: 30px;
77
+ margin-top: -5px;
78
+ width: 30px;
79
+ }
80
+ }
bp-activity/css/mentions.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ .atwho-view{background:#FFF;border-radius:2px;border:1px solid #ccc;box-shadow:0 0 5px rgba(204,204,204,.25),0 0 1px #FFF;color:#D84800;display:none;font-family:sans-serif;margin-top:18px;position:absolute;top:0;z-index:1000;left:0}.atwho-view ul{list-style:none;margin:auto;padding:0}.atwho-view ul li{border-bottom:1px solid #EFEFEF;box-sizing:content-box;cursor:pointer;display:block;font-size:14px;height:20px;line-height:20px;margin:0;overflow:hidden;padding:5px 10px}.atwho-view img{border-radius:2px;float:right;height:20px;margin-top:0;width:20px}.atwho-view strong{background:#EFEFEF;font:700}.atwho-view .username strong{color:#D54E21}.atwho-view small{color:#AAA;float:right;font-size:smaller;font-weight:400;margin:0 10px 0 40px}.atwho-view .cur{background:rgba(239,239,239,.5)}@media (max-width:900px){.atwho-view img{float:left;margin:0 10px 0 0}.atwho-view small{display:none}}@media (max-width:400px){.atwho-view ul li{font-size:16px;line-height:23px;padding:13px}.atwho-view ul li img{height:30px;margin-top:-5px;width:30px}}
bp-activity/js/mentions.js ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $, undefined ) {
2
+ var mentionsQueryCache = [],
3
+ mentionsItem;
4
+
5
+ /**
6
+ * Adds BuddyPress @mentions to form inputs.
7
+ *
8
+ * @param {array|object} options If array, becomes the suggestions' data source. If object, passed as config to $.atwho().
9
+ * @since BuddyPress (2.1.0)
10
+ */
11
+ $.fn.bp_mentions = function( options ) {
12
+ if ( $.isArray( options ) ) {
13
+ options = { data: options };
14
+ }
15
+
16
+ /**
17
+ * Default options for at.js; see https://github.com/ichord/At.js/.
18
+ */
19
+ var suggestionsDefaults = {
20
+ delay: 200,
21
+ hide_without_suffix: true,
22
+ insert_tpl: '</>${atwho-data-value}</>', // For contentEditable, the fake tags make jQuery insert a textNode.
23
+ limit: 10,
24
+ start_with_space: false,
25
+ suffix: '',
26
+
27
+ callbacks: {
28
+ /**
29
+ * Custom filter to only match the start of spaced words.
30
+ * Based on the core/default one.
31
+ *
32
+ * @param {string} query
33
+ * @param {array} data
34
+ * @param {string} search_key
35
+ * @return {array}
36
+ * @since BuddyPress (2.1.0)
37
+ */
38
+ filter: function( query, data, search_key ) {
39
+ var item, _i, _len, _results = [],
40
+ regxp = new RegExp( '^' + query + '| ' + query, 'ig' ); // start of string, or preceded by a space.
41
+
42
+ for ( _i = 0, _len = data.length; _i < _len; _i++ ) {
43
+ item = data[ _i ];
44
+ if ( item[ search_key ].toLowerCase().match( regxp ) ) {
45
+ _results.push( item );
46
+ }
47
+ }
48
+
49
+ return _results;
50
+ },
51
+
52
+ /**
53
+ * Removes some spaces around highlighted string and tweaks regex to allow spaces
54
+ * (to match display_name). Based on the core default.
55
+ *
56
+ * @param {unknown} li
57
+ * @param {string} query
58
+ * @return {string}
59
+ * @since BuddyPress (2.1.0)
60
+ */
61
+ highlighter: function( li, query ) {
62
+ if ( ! query ) {
63
+ return li;
64
+ }
65
+
66
+ var regexp = new RegExp( '>(\\s*|[\\w\\s]*)(' + this.at.replace( '+', '\\+') + '?' + query.replace( '+', '\\+' ) + ')([\\w ]*)\\s*<', 'ig' );
67
+ return li.replace( regexp, function( str, $1, $2, $3 ) {
68
+ return '>' + $1 + '<strong>' + $2 + '</strong>' + $3 + '<';
69
+ });
70
+ },
71
+
72
+ /**
73
+ * Reposition the suggestion list dynamically.
74
+ *
75
+ * @param {unknown} offset
76
+ * @since BuddyPress (2.1.0)
77
+ */
78
+ before_reposition: function( offset ) {
79
+ var $view = $( '#atwho-ground-' + this.id + ' .atwho-view' ),
80
+ caret = this.$inputor.caret( 'offset', { iframe: $( '#content_ifr' )[0] } ).left,
81
+ move;
82
+
83
+ // If the caret is past horizontal half, then flip it, yo.
84
+ if ( caret > ( $( 'body' ).width() / 2 ) ) {
85
+ $view.addClass( 'right' );
86
+ move = caret - offset.left - this.view.$el.width();
87
+ } else {
88
+ $view.removeClass( 'right' );
89
+ move = caret - offset.left + 1;
90
+ }
91
+
92
+ offset.top += 1;
93
+ offset.left += move;
94
+ },
95
+
96
+ /**
97
+ * Override default behaviour which inserts junk tags in the WordPress Visual editor.
98
+ *
99
+ * @param {unknown} $inputor Element which we're inserting content into.
100
+ * @param {string) content The content that will be inserted.
101
+ * @param {string) suffix Applied to the end of the content string.
102
+ * @return {string}
103
+ * @since BuddyPress (2.1.0)
104
+ */
105
+ inserting_wrapper: function( $inputor, content, suffix ) {
106
+ var new_suffix = ( suffix === '' ) ? suffix : suffix || ' ';
107
+ return '' + content + new_suffix;
108
+ }
109
+ }
110
+ },
111
+
112
+ /**
113
+ * Default options for our @mentions; see https://github.com/ichord/At.js/.
114
+ */
115
+ mentionsDefaults = {
116
+ callbacks: {
117
+ /**
118
+ * If there are no matches for the query in this.data, then query BuddyPress.
119
+ *
120
+ * @param {string} query Partial @mention to search for.
121
+ * @param {function} render_view Render page callback function.
122
+ * @since BuddyPress (2.1.0)
123
+ */
124
+ remote_filter: function( query, render_view ) {
125
+ var self = $( this );
126
+
127
+ mentionsItem = mentionsQueryCache[ query ];
128
+ if ( typeof mentionsItem === 'object' ) {
129
+ render_view( mentionsItem );
130
+ return;
131
+ }
132
+
133
+ if ( self.xhr ) {
134
+ self.xhr.abort();
135
+ }
136
+
137
+ self.xhr = $.getJSON( ajaxurl, { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' } )
138
+ /**
139
+ * Success callback for the @suggestions lookup.
140
+ *
141
+ * @param {object} response Details of users matching the query.
142
+ * @since BuddyPress (2.1.0)
143
+ */
144
+ .done(function( response ) {
145
+ if ( ! response.success ) {
146
+ return;
147
+ }
148
+
149
+ var data = $.map( response.data,
150
+ /**
151
+ * Create a composite index to determine ordering of results;
152
+ * nicename matches will appear on top.
153
+ *
154
+ * @param {array} suggestion A suggestion's original data.
155
+ * @return {array} A suggestion's new data.
156
+ * @since BuddyPress (2.1.0)
157
+ */
158
+ function( suggestion ) {
159
+ suggestion.search = suggestion.search || suggestion.ID + ' ' + suggestion.name;
160
+ return suggestion;
161
+ }
162
+ );
163
+
164
+ mentionsQueryCache[ query ] = data;
165
+ render_view( data );
166
+ });
167
+ }
168
+ },
169
+
170
+ data: $.map( options.data,
171
+ /**
172
+ * Create a composite index to search against of nicename + display name.
173
+ * This will also determine ordering of results, so nicename matches will appear on top.
174
+ *
175
+ * @param {array} suggestion A suggestion's original data.
176
+ * @return {array} A suggestion's new data.
177
+ * @since BuddyPress (2.1.0)
178
+ */
179
+ function( suggestion ) {
180
+ suggestion.search = suggestion.search || suggestion.ID + ' ' + suggestion.name;
181
+ return suggestion;
182
+ }
183
+ ),
184
+
185
+ at: '@',
186
+ search_key: 'search',
187
+ tpl: '<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'
188
+ },
189
+
190
+ opts = $.extend( true, {}, suggestionsDefaults, mentionsDefaults, options );
191
+ return $.fn.atwho.call( this, opts );
192
+ };
193
+
194
+ $( document ).ready(function() {
195
+ var users = [];
196
+
197
+ if ( typeof window.BP_Suggestions === 'object' ) {
198
+ users = window.BP_Suggestions.friends || users;
199
+ }
200
+
201
+ // Activity/reply, post comments, dashboard post 'text' editor.
202
+ $( '.bp-suggestions, #comments form textarea, .wp-editor-area' ).bp_mentions( users );
203
+ });
204
+ })( jQuery );
bp-activity/js/mentions.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){var b,c=[];a.fn.bp_mentions=function(d){a.isArray(d)&&(d={data:d});var e={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(b){var c,d=a("#atwho-ground-"+this.id+" .atwho-view"),e=this.$inputor.caret("offset",{iframe:a("#content_ifr")[0]}).left;e>a("body").width()/2?(d.addClass("right"),c=e-b.left-this.view.$el.width()):(d.removeClass("right"),c=e-b.left+1),b.top+=1,b.left+=c},inserting_wrapper:function(a,b,c){var d=""===c?c:c||" ";return""+b+d}}},f={callbacks:{remote_filter:function(d,e){var f=a(this);return b=c[d],"object"==typeof b?void e(b):(f.xhr&&f.xhr.abort(),void(f.xhr=a.getJSON(ajaxurl,{action:"bp_get_suggestions",term:d,type:"members"}).done(function(b){if(b.success){var f=a.map(b.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});c[d]=f,e(f)}})))}},data:a.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=a.extend(!0,{},e,f,d);return a.fn.atwho.call(this,g)},a(document).ready(function(){var b=[];"object"==typeof window.BP_Suggestions&&(b=window.BP_Suggestions.friends||b),a(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(b)})}(jQuery);
bp-blogs/bp-blogs-activity.php CHANGED
@@ -32,7 +32,8 @@ function bp_blogs_register_activity_actions() {
32
  $bp->blogs->id,
33
  'new_blog',
34
  __( 'New site created', 'buddypress' ),
35
- 'bp_blogs_format_activity_action_new_blog'
 
36
  );
37
  }
38
 
@@ -40,14 +41,18 @@ function bp_blogs_register_activity_actions() {
40
  $bp->blogs->id,
41
  'new_blog_post',
42
  __( 'New post published', 'buddypress' ),
43
- 'bp_blogs_format_activity_action_new_blog_post'
 
 
44
  );
45
 
46
  bp_activity_set_action(
47
  $bp->blogs->id,
48
  'new_blog_comment',
49
  __( 'New post comment posted', 'buddypress' ),
50
- 'bp_blogs_format_activity_action_new_blog_comment'
 
 
51
  );
52
 
53
  do_action( 'bp_blogs_register_activity_actions' );
@@ -264,8 +269,9 @@ function bp_blogs_record_activity( $args = '' ) {
264
  global $bp;
265
 
266
  // Bail if activity is not active
267
- if ( ! bp_is_active( 'activity' ) )
268
  return false;
 
269
 
270
  $defaults = array(
271
  'user_id' => bp_loggedin_user_id(),
@@ -281,28 +287,30 @@ function bp_blogs_record_activity( $args = '' ) {
281
  );
282
 
283
  $r = wp_parse_args( $args, $defaults );
284
- extract( $r, EXTR_SKIP );
285
 
286
  // Remove large images and replace them with just one image thumbnail
287
- if ( !empty( $content ) )
288
- $content = bp_activity_thumbnail_content_images( $content, $primary_link, $r );
 
289
 
290
- if ( !empty( $action ) )
291
- $action = apply_filters( 'bp_blogs_record_activity_action', $action );
 
292
 
293
- if ( !empty( $content ) )
294
- $content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $content ), $content );
 
295
 
296
  // Check for an existing entry and update if one exists.
297
  $id = bp_activity_get_activity_id( array(
298
- 'user_id' => $user_id,
299
- 'component' => $component,
300
- 'type' => $type,
301
- 'item_id' => $item_id,
302
- 'secondary_item_id' => $secondary_item_id
303
  ) );
304
 
305
- return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
306
  }
307
 
308
  /**
@@ -311,7 +319,6 @@ function bp_blogs_record_activity( $args = '' ) {
311
  * @since BuddyPress (1.0.0)
312
  *
313
  * @see bp_activity_delete() for description of parameters.
314
- * @global object $bp The BuddyPress global settings object.
315
  *
316
  * @param array $args {
317
  * See {@link bp_activity_delete()} for complete description of arguments.
@@ -321,31 +328,22 @@ function bp_blogs_record_activity( $args = '' ) {
321
  * }
322
  * @return bool True on success, false on failure.
323
  */
324
- function bp_blogs_delete_activity( $args = true ) {
325
- global $bp;
326
 
327
  // Bail if activity is not active
328
- if ( ! bp_is_active( 'activity' ) )
329
  return false;
 
330
 
331
- $defaults = array(
332
  'item_id' => false,
333
- 'component' => $bp->blogs->id,
334
  'type' => false,
335
  'user_id' => false,
336
  'secondary_item_id' => false
337
- );
338
-
339
- $params = wp_parse_args( $args, $defaults );
340
- extract( $params, EXTR_SKIP );
341
-
342
- bp_activity_delete_by_item_id( array(
343
- 'item_id' => $item_id,
344
- 'component' => $component,
345
- 'type' => $type,
346
- 'user_id' => $user_id,
347
- 'secondary_item_id' => $secondary_item_id
348
  ) );
 
 
349
  }
350
 
351
  /**
@@ -646,16 +644,86 @@ add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comm
646
  * @since BuddyPress (2.0.0)
647
  *
648
  * @param int $post_id The post ID
649
- * @param array $statuses Array of comment statuses. The key is comment ID, the
650
  * value is the $comment->comment_approved value.
651
  */
652
- function bp_blogs_remove_activity_meta_for_trashed_comments( $post_id, $statuses ) {
653
- foreach ( $statuses as $comment_id => $comment_approved ) {
654
- delete_comment_meta( $comment_id, 'bp_activity_comment_id' );
 
 
655
  }
656
  }
657
  add_action( 'trashed_post_comments', 'bp_blogs_remove_activity_meta_for_trashed_comments', 10, 2 );
658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  /**
660
  * Utility function to set up some variables for use in the activity loop.
661
  *
@@ -842,10 +910,16 @@ add_filter( 'bp_activity_can_comment_reply', 'bp_blogs_can_comment_reply', 10, 2
842
  * @param string $retval The activity comment permalink
843
  * @return string
844
  */
845
- function bp_blogs_activity_comment_permalink( $retval ) {
846
  global $activities_template;
847
 
848
- if ( isset( buddypress()->blogs->allow_comments[$activities_template->activity->current_comment->item_id] ) ){
 
 
 
 
 
 
849
  $retval = $activities_template->activity->current_comment->primary_link;
850
  }
851
 
32
  $bp->blogs->id,
33
  'new_blog',
34
  __( 'New site created', 'buddypress' ),
35
+ 'bp_blogs_format_activity_action_new_blog',
36
+ __( 'New Sites', 'buddypress' )
37
  );
38
  }
39
 
41
  $bp->blogs->id,
42
  'new_blog_post',
43
  __( 'New post published', 'buddypress' ),
44
+ 'bp_blogs_format_activity_action_new_blog_post',
45
+ __( 'Posts', 'buddypress' ),
46
+ array( 'activity', 'member' )
47
  );
48
 
49
  bp_activity_set_action(
50
  $bp->blogs->id,
51
  'new_blog_comment',
52
  __( 'New post comment posted', 'buddypress' ),
53
+ 'bp_blogs_format_activity_action_new_blog_comment',
54
+ __( 'Comments', 'buddypress' ),
55
+ array( 'activity', 'member' )
56
  );
57
 
58
  do_action( 'bp_blogs_register_activity_actions' );
269
  global $bp;
270
 
271
  // Bail if activity is not active
272
+ if ( ! bp_is_active( 'activity' ) ) {
273
  return false;
274
+ }
275
 
276
  $defaults = array(
277
  'user_id' => bp_loggedin_user_id(),
287
  );
288
 
289
  $r = wp_parse_args( $args, $defaults );
 
290
 
291
  // Remove large images and replace them with just one image thumbnail
292
+ if ( ! empty( $r['content'] ) ) {
293
+ $r['content'] = bp_activity_thumbnail_content_images( $r['content'], $r['primary_link'], $r );
294
+ }
295
 
296
+ if ( ! empty( $r['action'] ) ) {
297
+ $r['action'] = apply_filters( 'bp_blogs_record_activity_action', $r['action'] );
298
+ }
299
 
300
+ if ( ! empty( $r['content'] ) ) {
301
+ $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $r['content'] ), $r['content'], $r );
302
+ }
303
 
304
  // Check for an existing entry and update if one exists.
305
  $id = bp_activity_get_activity_id( array(
306
+ 'user_id' => $r['user_id'],
307
+ 'component' => $r['component'],
308
+ 'type' => $r['type'],
309
+ 'item_id' => $r['item_id'],
310
+ 'secondary_item_id' => $r['secondary_item_id'],
311
  ) );
312
 
313
+ return bp_activity_add( array( 'id' => $id, 'user_id' => $r['user_id'], 'action' => $r['action'], 'content' => $r['content'], 'primary_link' => $r['primary_link'], 'component' => $r['component'], 'type' => $r['type'], 'item_id' => $r['item_id'], 'secondary_item_id' => $r['secondary_item_id'], 'recorded_time' => $r['recorded_time'], 'hide_sitewide' => $r['hide_sitewide'] ) );
314
  }
315
 
316
  /**
319
  * @since BuddyPress (1.0.0)
320
  *
321
  * @see bp_activity_delete() for description of parameters.
 
322
  *
323
  * @param array $args {
324
  * See {@link bp_activity_delete()} for complete description of arguments.
328
  * }
329
  * @return bool True on success, false on failure.
330
  */
331
+ function bp_blogs_delete_activity( $args = '' ) {
 
332
 
333
  // Bail if activity is not active
334
+ if ( ! bp_is_active( 'activity' ) ) {
335
  return false;
336
+ }
337
 
338
+ $r = bp_parse_args( $args, array(
339
  'item_id' => false,
340
+ 'component' => buddypress()->blogs->id,
341
  'type' => false,
342
  'user_id' => false,
343
  'secondary_item_id' => false
 
 
 
 
 
 
 
 
 
 
 
344
  ) );
345
+
346
+ bp_activity_delete_by_item_id( $r );
347
  }
348
 
349
  /**
644
  * @since BuddyPress (2.0.0)
645
  *
646
  * @param int $post_id The post ID
647
+ * @param array $comments Array of comment statuses. The key is comment ID, the
648
  * value is the $comment->comment_approved value.
649
  */
650
+ function bp_blogs_remove_activity_meta_for_trashed_comments( $post_id = 0, $comments = array() ) {
651
+ if ( ! empty( $comments ) ) {
652
+ foreach ( array_keys( $comments ) as $comment_id ) {
653
+ delete_comment_meta( $comment_id, 'bp_activity_comment_id' );
654
+ }
655
  }
656
  }
657
  add_action( 'trashed_post_comments', 'bp_blogs_remove_activity_meta_for_trashed_comments', 10, 2 );
658
 
659
+ /**
660
+ * Filter 'new_blog_comment' bp_has_activities() loop to include new- and old-style blog activity comment items.
661
+ *
662
+ * In BuddyPress 2.0, the schema for storing activity items related to blog
663
+ * posts changed. Instead creating new top-level 'new_blog_comment' activity
664
+ * items, blog comments are recorded in the activity stream as comments on the
665
+ * 'new_blog_post' activity items corresponding to the parent post. This filter
666
+ * ensures that the 'new_blog_comment' filter in bp_has_activities() (which
667
+ * powers the 'Comments' filter in the activity directory dropdown) includes
668
+ * both old-style and new-style activity comments.
669
+ *
670
+ * This implementation involves filtering the activity queries directly, and
671
+ * should be considered a stopgap. The proper solution would involve enabling
672
+ * multiple query condition clauses, connected by an OR, in the bp_has_activities()
673
+ * API.
674
+ *
675
+ * @since BuddyPress (2.1.0)
676
+ *
677
+ * @param array $args Arguments passed from bp_parse_args() in bp_has_activities().
678
+ * @return array $args
679
+ */
680
+ function bp_blogs_new_blog_comment_query_backpat( $args ) {
681
+ // Bail if this is not a 'new_blog_comment' query
682
+ if ( 'new_blog_comment' !== $args['action'] ) {
683
+ return $args;
684
+ }
685
+
686
+ // display_comments=stream is required to show new-style
687
+ // 'activity_comment' items inline
688
+ $args['display_comments'] = 'stream';
689
+
690
+ // For the remaining clauses, we filter the SQL query directly
691
+ add_filter( 'bp_activity_paged_activities_sql', '_bp_blogs_new_blog_comment_query_backpat_filter' );
692
+ add_filter( 'bp_activity_total_activities_sql', '_bp_blogs_new_blog_comment_query_backpat_filter' );
693
+
694
+ // Return the original arguments
695
+ return $args;
696
+ }
697
+ add_filter( 'bp_after_has_activities_parse_args', 'bp_blogs_new_blog_comment_query_backpat' );
698
+
699
+ /**
700
+ * Filter activity SQL to include new- and old-style 'new_blog_comment' activity items.
701
+ *
702
+ * @since BuddyPress (2.1.0)
703
+ *
704
+ * @access private
705
+ * @see bp_blogs_new_blog_comment_query_backpat()
706
+ *
707
+ * @param string $query SQL query as assembled in BP_Activity_Activity::get().
708
+ * @return string $query Modified SQL query.
709
+ */
710
+ function _bp_blogs_new_blog_comment_query_backpat_filter( $query ) {
711
+ $bp = buddypress();
712
+
713
+ // The query passed to the filter is for old-style 'new_blog_comment'
714
+ // items. We include new-style 'activity_comment' items by running a
715
+ // subquery inside of a large OR clause.
716
+ $activity_comment_subquery = "SELECT a.id FROM {$bp->activity->table_name} a INNER JOIN {$bp->activity->table_name_meta} am ON (a.id = am.activity_id) WHERE am.meta_key = 'bp_blogs_post_comment_id' AND a.type = 'activity_comment'";
717
+
718
+ // WHERE ( [original WHERE clauses] OR a.id IN (activity_comment subquery) )
719
+ $query = preg_replace( '|WHERE (.*?) ORDER|', 'WHERE ( ( $1 ) OR ( a.id IN ( ' . $activity_comment_subquery . ' ) ) ) ORDER', $query );
720
+
721
+ // Don't run this on future queries
722
+ remove_filter( current_filter(), '_bp_blogs_new_blog_comment_query_backpat_filter' );
723
+
724
+ return $query;
725
+ }
726
+
727
  /**
728
  * Utility function to set up some variables for use in the activity loop.
729
  *
910
  * @param string $retval The activity comment permalink
911
  * @return string
912
  */
913
+ function bp_blogs_activity_comment_permalink( $retval = '' ) {
914
  global $activities_template;
915
 
916
+ // Get the current comment ID
917
+ $item_id = isset( $activities_template->activity->current_comment->item_id )
918
+ ? $activities_template->activity->current_comment->item_id
919
+ : false;
920
+
921
+ // Maybe adjust the link if item ID exists
922
+ if ( ( false !== $item_id ) && isset( buddypress()->blogs->allow_comments[ $item_id ] ) ) {
923
  $retval = $activities_template->activity->current_comment->primary_link;
924
  }
925
 
bp-blogs/bp-blogs-buddybar.php DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * BuddyPress Blogs BuddyBar functions.
5
- *
6
- * @package BuddyPress
7
- * @subpackage BlogsBuddyBar
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
-
13
- /**
14
- * Add a Sites menu to the BuddyBar.
15
- *
16
- * @since BuddyPress (1.0.0)
17
- *
18
- * @global object $bp The BuddyPress global settings object.
19
- *
20
- * @return bool|null Returns false on failure. Otherwise echoes the menu item.
21
- */
22
- function bp_adminbar_blogs_menu() {
23
- global $bp;
24
-
25
- if ( !is_user_logged_in() || !bp_is_active( 'blogs' ) )
26
- return false;
27
-
28
- if ( !is_multisite() )
29
- return false;
30
-
31
- $blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );
32
- if ( empty( $blogs ) ) {
33
- $blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true );
34
- wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' );
35
- }
36
-
37
- $counter = 0;
38
- if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) {
39
-
40
- echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ) . '">';
41
-
42
- _e( 'My Sites', 'buddypress' );
43
-
44
- echo '</a>';
45
- echo '<ul>';
46
-
47
- foreach ( (array) $blogs['blogs'] as $blog ) {
48
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
49
- $site_url = esc_attr( $blog->siteurl );
50
-
51
- echo '<li' . $alt . '>';
52
- echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
53
- echo '<ul>';
54
- echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
55
- echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
56
- echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
57
- echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
58
- echo '</ul>';
59
-
60
- do_action( 'bp_adminbar_blog_items', $blog );
61
-
62
- echo '</li>';
63
- $counter++;
64
- }
65
-
66
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
67
-
68
- if ( bp_blog_signup_enabled() ) {
69
- echo '<li' . $alt . '>';
70
- echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
71
- echo '</li>';
72
- }
73
-
74
- echo '</ul>';
75
- echo '</li>';
76
- }
77
- }
78
- add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-blogs/bp-blogs-classes.php CHANGED
@@ -156,9 +156,10 @@ class BP_Blogs_Blog {
156
  }
157
 
158
  if ( !empty( $search_terms ) ) {
159
- $filter = esc_sql( like_escape( $search_terms ) );
160
- $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm2.meta_value LIKE '%%$filter%%' {$user_sql} {$include_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
161
- $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql} {$include_sql}" );
 
162
  } else {
163
  $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' {$include_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
164
  $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$include_sql} {$hidden_sql}" );
@@ -342,7 +343,8 @@ class BP_Blogs_Blog {
342
  public static function search_blogs( $filter, $limit = null, $page = null ) {
343
  global $wpdb, $bp;
344
 
345
- $filter = esc_sql( like_escape( $filter ) );
 
346
 
347
  $hidden_sql = '';
348
  if ( !bp_current_user_can( 'bp_moderate' ) )
@@ -353,8 +355,8 @@ class BP_Blogs_Blog {
353
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
354
  }
355
 
356
- $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}" );
357
- $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" );
358
 
359
  return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
360
  }
@@ -403,17 +405,19 @@ class BP_Blogs_Blog {
403
  public static function get_by_letter( $letter, $limit = null, $page = null ) {
404
  global $bp, $wpdb;
405
 
406
- $letter = esc_sql( like_escape( $letter ) );
 
407
 
408
  $hidden_sql = '';
409
  if ( !bp_current_user_can( 'bp_moderate' ) )
410
  $hidden_sql = "AND wb.public = 1";
411
 
 
412
  if ( $limit && $page )
413
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
414
 
415
- $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' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" );
416
- $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' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" );
417
 
418
  return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
419
  }
156
  }
157
 
158
  if ( !empty( $search_terms ) ) {
159
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
160
+ $search_terms_sql = $wpdb->prepare( 'bm2.meta_value LIKE %s', $search_terms_like );
161
+ $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND {$search_terms_sql} {$user_sql} {$include_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
162
+ $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND {$search_terms_sql} {$user_sql} {$include_sql}" );
163
  } else {
164
  $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' {$include_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
165
  $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$include_sql} {$hidden_sql}" );
343
  public static function search_blogs( $filter, $limit = null, $page = null ) {
344
  global $wpdb, $bp;
345
 
346
+ $search_terms_like = '%' . bp_esc_like( $filter ) . '%';
347
+ $search_terms_sql = $wpdb->prepare( 'bm.meta_value LIKE %s', $search_terms_like );
348
 
349
  $hidden_sql = '';
350
  if ( !bp_current_user_can( 'bp_moderate' ) )
355
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
356
  }
357
 
358
+ $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 {$search_terms_sql} ) {$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}" );
359
+ $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 {$search_terms_sql} ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" );
360
 
361
  return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
362
  }
405
  public static function get_by_letter( $letter, $limit = null, $page = null ) {
406
  global $bp, $wpdb;
407
 
408
+ $letter_like = '%' . bp_esc_like( $letter ) . '%';
409
+ $letter_sql = $wpdb->prepare( 'bm.meta_value LIKE %s', $letter_like );
410
 
411
  $hidden_sql = '';
412
  if ( !bp_current_user_can( 'bp_moderate' ) )
413
  $hidden_sql = "AND wb.public = 1";
414
 
415
+ $pag_sql = '';
416
  if ( $limit && $page )
417
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
418
 
419
+ $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' AND {$letter_sql} {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" );
420
+ $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' AND {$letter_sql} {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" );
421
 
422
  return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
423
  }
bp-blogs/bp-blogs-filters.php CHANGED
@@ -36,3 +36,19 @@ function bp_blogs_creation_location( $url ) {
36
  return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) );
37
  }
38
  add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) );
37
  }
38
  add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
39
+
40
+ /**
41
+ * Only select comments by ID instead of all fields when using get_comments().
42
+ *
43
+ * @since BuddyPress (2.1.0)
44
+ *
45
+ * @see bp_blogs_update_post()
46
+ *
47
+ * @param array Current SQL clauses in array format
48
+ * @return array
49
+ */
50
+ function bp_blogs_comments_clauses_select_by_id( $retval ) {
51
+ $retval['fields'] = 'comment_ID';
52
+
53
+ return $retval;
54
+ }
bp-blogs/bp-blogs-functions.php CHANGED
@@ -44,57 +44,110 @@ function bp_blogs_has_directory() {
44
  */
45
  function bp_blogs_get_blogs( $args = '' ) {
46
 
47
- $defaults = array(
48
- 'type' => 'active', // active, alphabetical, newest, or random
49
- 'user_id' => false, // Pass a user_id to limit to only blogs that this user has privilages higher than subscriber on
50
- 'include_blog_ids' => false,
51
- 'search_terms' => false, // Limit to blogs that match these search terms
 
52
  'per_page' => 20, // The number of results to return per page
53
  'page' => 1, // The page to return if limiting per page
54
- 'update_meta_cache' => true,
 
 
 
 
 
 
 
 
 
 
 
55
  );
56
 
57
- $params = wp_parse_args( $args, $defaults );
58
- extract( $params, EXTR_SKIP );
59
-
60
- return apply_filters( 'bp_blogs_get_blogs', BP_Blogs_Blog::get( $type, $per_page, $page, $user_id, $search_terms, $update_meta_cache, $include_blog_ids ), $params );
61
  }
62
 
63
  /**
64
  * Populate the BP blogs table with existing blogs.
65
  *
66
- * @global object $bp BuddyPress global settings
 
67
  * @global object $wpdb WordPress database object
68
  * @uses get_users()
69
  * @uses bp_blogs_record_blog()
70
  */
71
  function bp_blogs_record_existing_blogs() {
72
- global $bp, $wpdb;
73
-
74
- // Truncate user blogs table and re-record.
75
- $wpdb->query( "DELETE FROM {$bp->blogs->table_name} WHERE 1=1" );
76
 
 
77
  if ( is_multisite() ) {
78
- $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 ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  } else {
80
- $blog_ids = 1;
81
  }
82
 
83
- if ( !empty( $blog_ids ) ) {
84
- foreach( (array) $blog_ids as $blog_id ) {
85
- $users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ID' ) );
86
- $subscribers = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ID', 'role' => 'subscriber' ) );
87
-
88
- if ( !empty( $users ) ) {
89
- foreach ( (array) $users as $user ) {
90
- // Don't record blogs for subscribers
91
- if ( !in_array( $user, $subscribers ) ) {
92
- bp_blogs_record_blog( $blog_id, $user, true );
93
- }
94
- }
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
  }
 
 
 
98
  }
99
 
100
  /**
@@ -295,7 +348,7 @@ add_action( 'update_option_close_comments_for_old_posts', 'bp_blogs_update_optio
295
  * unused here.
296
  * @param string $newvalue Value to change meta to.
297
  */
298
- function bp_blogs_update_option_close_close_comments_days_old( $oldvalue, $newvalue ) {
299
  global $wpdb;
300
 
301
  bp_blogs_update_blogmeta( $wpdb->blogid, 'close_comments_days_old', $newvalue );
@@ -470,7 +523,7 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
470
 
471
  $activity_content = $post->post_content;
472
 
473
- bp_blogs_record_activity( array(
474
  'user_id' => (int) $post->post_author,
475
  'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, $post, $post_permalink ),
476
  'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ),
@@ -478,7 +531,11 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
478
  'item_id' => $blog_id,
479
  'secondary_item_id' => $post_id,
480
  'recorded_time' => $post->post_date_gmt,
481
- ));
 
 
 
 
482
  }
483
 
484
  // Update the blogs last activity
@@ -518,9 +575,77 @@ function bp_blogs_update_post( $post ) {
518
 
519
  // update the activity entry
520
  $activity = new BP_Activity_Activity( $activity_id );
521
- $activity->content = $post->post_content;
 
 
 
 
 
 
 
 
 
522
  $activity->save();
523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  // add post comment status to activity meta if closed
525
  if( 'closed' == $post->comment_status ) {
526
  bp_activity_update_meta( $activity_id, 'post_comment_status', $post->comment_status );
@@ -618,7 +743,11 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
618
  $args['secondary_item_id'] = $comment_id;
619
 
620
  // record the activity entry
621
- bp_blogs_record_activity( $args );
 
 
 
 
622
 
623
  // record comment as BP activity comment under the parent 'new_blog_post'
624
  // activity item
@@ -682,6 +811,8 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
682
  if ( empty( $args['id'] ) ) {
683
  // add meta to activity comment
684
  bp_activity_update_meta( $comment_activity_id, 'bp_blogs_post_comment_id', $comment_id );
 
 
685
 
686
  // add meta to comment
687
  add_comment_meta( $comment_id, 'bp_activity_comment_id', $comment_activity_id );
@@ -705,40 +836,77 @@ add_action( 'edit_comment', 'bp_blogs_record_comment', 10 );
705
  * set/changed ('add_user_to_blog', 'profile_update', 'user_register'). It
706
  * parses the changes, and records them as necessary in the BP blog tracker.
707
  *
708
- * BuddyPress does not track blogs for Subscribers.
 
 
 
 
 
 
709
  *
710
- * @param int $user_id The ID of the user.
711
- * @param string|bool $role The WP role being assigned to the user
712
- * ('subscriber', 'contributor', 'author', 'editor', 'administrator', or
713
- * a custom role). Defaults to false.
714
- * @param int $blog_id Default: the current blog ID.
715
  * @return bool|null False on failure.
716
  */
717
  function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
718
  global $wpdb;
719
 
 
720
  if ( empty( $blog_id ) ) {
721
  $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
722
  }
723
 
 
724
  if ( empty( $role ) ) {
725
- $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities';
726
 
727
- $roles = bp_get_user_meta( $user_id, $key, true );
 
 
 
 
 
 
 
 
728
 
729
- if ( is_array( $roles ) )
730
- $role = array_search( 1, $roles );
731
- else
732
- return false;
 
 
 
 
 
 
 
733
  }
734
 
735
- if ( $role != 'subscriber' )
736
- bp_blogs_record_blog( $blog_id, $user_id, true );
 
 
 
 
 
737
  }
738
  add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
739
  add_action( 'profile_update', 'bp_blogs_add_user_to_blog' );
740
  add_action( 'user_register', 'bp_blogs_add_user_to_blog' );
741
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
742
  /**
743
  * Remove a blog-user pair from BP's blog tracker.
744
  *
@@ -748,8 +916,9 @@ add_action( 'user_register', 'bp_blogs_add_user_to_blog' );
748
  function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) {
749
  global $wpdb;
750
 
751
- if ( empty( $blog_id ) )
752
  $blog_id = $wpdb->blogid;
 
753
 
754
  bp_blogs_remove_blog_for_user( $user_id, $blog_id );
755
  }
@@ -1050,16 +1219,24 @@ function bp_blogs_total_blogs() {
1050
  /**
1051
  * Get the total number of blogs being tracked by BP for a specific user.
1052
  *
 
 
1053
  * @param int $user_id ID of the user being queried. Default: on a user page,
1054
  * the displayed user. Otherwise, the logged-in user.
1055
  * @return int $count Total blog count for the user.
1056
  */
1057
  function bp_blogs_total_blogs_for_user( $user_id = 0 ) {
1058
-
1059
- if ( empty( $user_id ) )
1060
  $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 
 
 
 
 
1061
 
1062
- if ( !$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ) ) {
 
1063
  $count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
1064
  wp_cache_set( 'bp_total_blogs_for_user_' . $user_id, $count, 'bp' );
1065
  }
@@ -1245,7 +1422,7 @@ function bp_blogs_update_blogmeta( $blog_id, $meta_key, $meta_value, $prev_value
1245
  * @param int $blog_id ID of the blog.
1246
  * @param string $meta_key Metadata key.
1247
  * @param mixed $meta_value Metadata value.
1248
- * @param bool $unique. Optional. Whether to enforce a single metadata value
1249
  * for the given key. If true, and the object already has a value for
1250
  * the key, no change will be made. Default: false.
1251
  * @return int|bool The meta ID on successful update, false on failure.
44
  */
45
  function bp_blogs_get_blogs( $args = '' ) {
46
 
47
+ // Parse query arguments
48
+ $r = bp_parse_args( $args, array(
49
+ 'type' => 'active', // 'active', 'alphabetical', 'newest', or 'random'
50
+ 'include_blog_ids' => false, // Array of blog IDs to include
51
+ 'user_id' => false, // Limit to blogs this user can post to
52
+ 'search_terms' => false, // Limit to blogs matching these search terms
53
  'per_page' => 20, // The number of results to return per page
54
  'page' => 1, // The page to return if limiting per page
55
+ 'update_meta_cache' => true // Whether to pre-fetch blogmeta
56
+ ), 'blogs_get_blogs' );
57
+
58
+ // Get the blogs
59
+ $blogs = BP_Blogs_Blog::get(
60
+ $r['type'],
61
+ $r['per_page'],
62
+ $r['page'],
63
+ $r['user_id'],
64
+ $r['search_terms'],
65
+ $r['update_meta_cache'],
66
+ $r['include_blog_ids']
67
  );
68
 
69
+ // Filter and return
70
+ return apply_filters( 'bp_blogs_get_blogs', $blogs, $r );
 
 
71
  }
72
 
73
  /**
74
  * Populate the BP blogs table with existing blogs.
75
  *
76
+ * @since BuddyPress (1.0.0)
77
+ *
78
  * @global object $wpdb WordPress database object
79
  * @uses get_users()
80
  * @uses bp_blogs_record_blog()
81
  */
82
  function bp_blogs_record_existing_blogs() {
83
+ global $wpdb;
 
 
 
84
 
85
+ // Query for all sites in network
86
  if ( is_multisite() ) {
87
+
88
+ // Get blog ID's if not a large network
89
+ if ( ! wp_is_large_network() ) {
90
+ $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 ) );
91
+
92
+ // If error running this query, set blog ID's to false
93
+ if ( is_wp_error( $blog_ids ) ) {
94
+ $blog_ids = false;
95
+ }
96
+
97
+ // Large networks are not currently supported
98
+ } else {
99
+ $blog_ids = false;
100
+ }
101
+
102
+ // Record a single site
103
  } else {
104
+ $blog_ids = $wpdb->blogid;
105
  }
106
 
107
+ // Bail if there are no blogs in the network
108
+ if ( empty( $blog_ids ) ) {
109
+ return false;
110
+ }
111
+
112
+ // Get BuddyPress
113
+ $bp = buddypress();
114
+
115
+ // Truncate user blogs table
116
+ $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name}" );
117
+ if ( is_wp_error( $truncate ) ) {
118
+ return false;
119
+ }
120
+
121
+ // Truncate user blogsmeta table
122
+ $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name_blogmeta}" );
123
+ if ( is_wp_error( $truncate ) ) {
124
+ return false;
125
+ }
126
+
127
+ // Loop through users of blogs and record the relationship
128
+ foreach ( (array) $blog_ids as $blog_id ) {
129
+
130
+ // Ensure that the cache is clear after the table TRUNCATE above
131
+ wp_cache_delete( $blog_id, 'blog_meta' );
132
+
133
+ // Get all users
134
+ $users = get_users( array(
135
+ 'blog_id' => $blog_id
136
+ ) );
137
+
138
+ // Continue on if no users exist for this site (how did this happen?)
139
+ if ( empty( $users ) ) {
140
+ continue;
141
+ }
142
+
143
+ // Loop through users and record their relationship to this blog
144
+ foreach ( (array) $users as $user ) {
145
+ bp_blogs_add_user_to_blog( $user->ID, false, $blog_id );
146
  }
147
  }
148
+
149
+ // No errors
150
+ return true;
151
  }
152
 
153
  /**
348
  * unused here.
349
  * @param string $newvalue Value to change meta to.
350
  */
351
+ function bp_blogs_update_option_close_comments_days_old( $oldvalue, $newvalue ) {
352
  global $wpdb;
353
 
354
  bp_blogs_update_blogmeta( $wpdb->blogid, 'close_comments_days_old', $newvalue );
523
 
524
  $activity_content = $post->post_content;
525
 
526
+ $activity_id = bp_blogs_record_activity( array(
527
  'user_id' => (int) $post->post_author,
528
  'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, $post, $post_permalink ),
529
  'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ),
531
  'item_id' => $blog_id,
532
  'secondary_item_id' => $post_id,
533
  'recorded_time' => $post->post_date_gmt,
534
+ ) );
535
+
536
+ // save post title in activity meta
537
+ bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
538
+ bp_activity_update_meta( $activity_id, 'post_url', $post_permalink );
539
  }
540
 
541
  // Update the blogs last activity
575
 
576
  // update the activity entry
577
  $activity = new BP_Activity_Activity( $activity_id );
578
+
579
+ if ( ! empty( $post->post_content ) ) {
580
+ // Make sure to update the thumbnail image
581
+ $post_content = bp_activity_thumbnail_content_images( $post->post_content, $activity->primary_link, (array) $activity );
582
+
583
+ // Make sure to apply the blop post excerpt
584
+ $activity->content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $post_content ), $post_content, (array) $activity );
585
+ }
586
+
587
+ // Save the updated activity
588
  $activity->save();
589
 
590
+ // update post title in activity meta
591
+ $existing_title = bp_activity_get_meta( $activity_id, 'post_title' );
592
+ if ( $post->post_title !== $existing_title ) {
593
+ bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
594
+
595
+ // now update activity meta for post comments... sigh
596
+ add_filter( 'comments_clauses', 'bp_blogs_comments_clauses_select_by_id' );
597
+ $comments = get_comments( array( 'post_id' => $post->ID ) );
598
+ remove_filter( 'comments_clauses', 'bp_blogs_comments_clauses_select_by_id' );
599
+
600
+ if ( ! empty( $comments ) ) {
601
+ $activity_ids = array();
602
+ $comment_ids = wp_list_pluck( $comments, 'comment_ID' );
603
+
604
+ // setup activity args
605
+ $args = array(
606
+ 'update_meta_cache' => false,
607
+ 'show_hidden' => true,
608
+ 'per_page' => 99999,
609
+ );
610
+
611
+ // query for old-style "new_blog_comment" activity items
612
+ $args['filter'] = array(
613
+ 'object' => buddypress()->blogs->id,
614
+ 'action' => 'new_blog_comment',
615
+ 'secondary_id' => implode( ',', $comment_ids ),
616
+ );
617
+
618
+ $activities = bp_activity_get( $args );
619
+ if ( ! empty( $activities['activities'] ) ) {
620
+ $activity_ids = (array) wp_list_pluck( $activities['activities'], 'id' );
621
+ }
622
+
623
+ // query for activity comments connected to a blog post
624
+ unset( $args['filter'] );
625
+ $args['meta_query'] = array( array(
626
+ 'key' => 'bp_blogs_post_comment_id',
627
+ 'value' => $comment_ids,
628
+ 'compare' => 'IN',
629
+ ) );
630
+ $args['type'] = 'activity_comment';
631
+ $args['display_comments'] = 'stream';
632
+
633
+ $activities = bp_activity_get( $args );
634
+ if ( ! empty( $activities['activities'] ) ) {
635
+ $activity_ids = array_merge( $activity_ids, (array) wp_list_pluck( $activities['activities'], 'id' ) );
636
+ }
637
+
638
+ // update activity meta for all found activity items
639
+ if ( ! empty( $activity_ids ) ) {
640
+ foreach ( $activity_ids as $aid ) {
641
+ bp_activity_update_meta( $aid, 'post_title', $post->post_title );
642
+ }
643
+ }
644
+
645
+ unset( $activities, $activity_ids, $comment_ids, $comments );
646
+ }
647
+ }
648
+
649
  // add post comment status to activity meta if closed
650
  if( 'closed' == $post->comment_status ) {
651
  bp_activity_update_meta( $activity_id, 'post_comment_status', $post->comment_status );
743
  $args['secondary_item_id'] = $comment_id;
744
 
745
  // record the activity entry
746
+ $activity_id = bp_blogs_record_activity( $args );
747
+
748
+ // add some post info in activity meta
749
+ bp_activity_update_meta( $activity_id, 'post_title', $recorded_comment->post->post_title );
750
+ bp_activity_update_meta( $activity_id, 'post_url', add_query_arg( 'p', $recorded_comment->post->ID, home_url( '/' ) ) );
751
 
752
  // record comment as BP activity comment under the parent 'new_blog_post'
753
  // activity item
811
  if ( empty( $args['id'] ) ) {
812
  // add meta to activity comment
813
  bp_activity_update_meta( $comment_activity_id, 'bp_blogs_post_comment_id', $comment_id );
814
+ bp_activity_update_meta( $comment_activity_id, 'post_title', $recorded_comment->post->post_title );
815
+ bp_activity_update_meta( $comment_activity_id, 'post_url', add_query_arg( 'p', $recorded_comment->post->ID, home_url( '/' ) ) );
816
 
817
  // add meta to comment
818
  add_comment_meta( $comment_id, 'bp_activity_comment_id', $comment_activity_id );
836
  * set/changed ('add_user_to_blog', 'profile_update', 'user_register'). It
837
  * parses the changes, and records them as necessary in the BP blog tracker.
838
  *
839
+ * BuddyPress does not track blogs for users with the 'subscriber' role by
840
+ * default, though as of 2.1.0 you can filter 'bp_blogs_get_allowed_roles' to
841
+ * modify this behavior.
842
+ *
843
+ * @param int $user_id The ID of the user
844
+ * @param string|bool $role User's WordPress role for this blog ID
845
+ * @param int $blog_id Blog ID user is being added to
846
  *
 
 
 
 
 
847
  * @return bool|null False on failure.
848
  */
849
  function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
850
  global $wpdb;
851
 
852
+ // If no blog ID was passed, use the root blog ID
853
  if ( empty( $blog_id ) ) {
854
  $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
855
  }
856
 
857
+ // If no role was passed, try to find the blog role
858
  if ( empty( $role ) ) {
 
859
 
860
+ // Get user capabilities
861
+ $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities';
862
+ $user_roles = array_keys( (array) bp_get_user_meta( $user_id, $key, true ) );
863
+
864
+ // User has roles so lets
865
+ if ( ! empty( $user_roles ) ) {
866
+
867
+ // Get blog roles
868
+ $blog_roles = array_keys( bp_get_current_blog_roles() );
869
 
870
+ // Look for blog only roles of the user
871
+ $intersect_roles = array_intersect( $user_roles, $blog_roles );
872
+
873
+ // If there's a role in the array, use the first one. This isn't
874
+ // very smart, but since roles aren't exactly hierarchical, and
875
+ // WordPress does not yet have a UI for multiple user roles, it's
876
+ // fine for now.
877
+ if ( ! empty( $intersect_roles ) ) {
878
+ $role = array_shift( $intersect_roles );
879
+ }
880
+ }
881
  }
882
 
883
+ // Bail if no role was found or role is not in the allowed roles array
884
+ if ( empty( $role ) || ! in_array( $role, bp_blogs_get_allowed_roles() ) ) {
885
+ return false;
886
+ }
887
+
888
+ // Record the blog activity for this user being added to this blog
889
+ bp_blogs_record_blog( $blog_id, $user_id, true );
890
  }
891
  add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
892
  add_action( 'profile_update', 'bp_blogs_add_user_to_blog' );
893
  add_action( 'user_register', 'bp_blogs_add_user_to_blog' );
894
 
895
+ /**
896
+ * The allowed blog roles a member must have to be recorded into the
897
+ * `bp_user_blogs` pointer table.
898
+ *
899
+ * This added and was made filterable in BuddyPress 2.1.0 to make it easier
900
+ * to extend the functionality of the Blogs component.
901
+ *
902
+ * @since BuddyPress (2.1.0)
903
+ *
904
+ * @return string
905
+ */
906
+ function bp_blogs_get_allowed_roles() {
907
+ return apply_filters( 'bp_blogs_get_allowed_roles', array( 'contributor', 'author', 'editor', 'administrator' ) );
908
+ }
909
+
910
  /**
911
  * Remove a blog-user pair from BP's blog tracker.
912
  *
916
  function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) {
917
  global $wpdb;
918
 
919
+ if ( empty( $blog_id ) ) {
920
  $blog_id = $wpdb->blogid;
921
+ }
922
 
923
  bp_blogs_remove_blog_for_user( $user_id, $blog_id );
924
  }
1219
  /**
1220
  * Get the total number of blogs being tracked by BP for a specific user.
1221
  *
1222
+ * @since BuddyPress (1.2.0)
1223
+ *
1224
  * @param int $user_id ID of the user being queried. Default: on a user page,
1225
  * the displayed user. Otherwise, the logged-in user.
1226
  * @return int $count Total blog count for the user.
1227
  */
1228
  function bp_blogs_total_blogs_for_user( $user_id = 0 ) {
1229
+ if ( empty( $user_id ) ) {
 
1230
  $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
1231
+ }
1232
+
1233
+ // no user ID? do not attempt to look at cache
1234
+ if ( empty( $user_id ) ) {
1235
+ return 0;
1236
+ }
1237
 
1238
+ $count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
1239
+ if ( false === $count ) {
1240
  $count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
1241
  wp_cache_set( 'bp_total_blogs_for_user_' . $user_id, $count, 'bp' );
1242
  }
1422
  * @param int $blog_id ID of the blog.
1423
  * @param string $meta_key Metadata key.
1424
  * @param mixed $meta_value Metadata value.
1425
+ * @param bool $unique Optional. Whether to enforce a single metadata value
1426
  * for the given key. If true, and the object already has a value for
1427
  * the key, no change will be made. Default: false.
1428
  * @return int|bool The meta ID on successful update, false on failure.
bp-blogs/bp-blogs-loader.php CHANGED
@@ -1,9 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * BuddyPress Blogs Streams Loader
5
  *
6
- * An blogs stream component, for users, groups, and blog tracking.
 
 
7
  *
8
  * @package BuddyPress
9
  * @subpackage Blogs Core
@@ -22,7 +24,7 @@ class BP_Blogs_Component extends BP_Component {
22
  public function __construct() {
23
  parent::start(
24
  'blogs',
25
- __( 'Site Tracking', 'buddypress' ),
26
  buddypress()->plugin_dir,
27
  array(
28
  'adminbar_myaccount_order' => 30
@@ -45,8 +47,9 @@ class BP_Blogs_Component extends BP_Component {
45
  public function setup_globals( $args = array() ) {
46
  $bp = buddypress();
47
 
48
- if ( !defined( 'BP_BLOGS_SLUG' ) )
49
  define ( 'BP_BLOGS_SLUG', $this->id );
 
50
 
51
  // Global tables for messaging component
52
  $global_tables = array(
@@ -58,8 +61,7 @@ class BP_Blogs_Component extends BP_Component {
58
  'blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta',
59
  );
60
 
61
- // All globals for messaging component.
62
- // Note that global_tables is included in this array.
63
  $args = array(
64
  'slug' => BP_BLOGS_SLUG,
65
  'root_slug' => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
@@ -83,6 +85,7 @@ class BP_Blogs_Component extends BP_Component {
83
  * @param array $includes See {@link BP_Component::includes()}.
84
  */
85
  public function includes( $includes = array() ) {
 
86
  // Files to include
87
  $includes = array(
88
  'cache',
@@ -93,11 +96,11 @@ class BP_Blogs_Component extends BP_Component {
93
  'filters',
94
  'activity',
95
  'functions',
96
- 'buddybar'
97
  );
98
 
99
- if ( is_multisite() )
100
  $includes[] = 'widgets';
 
101
 
102
  // Include the files
103
  parent::includes( $includes );
@@ -121,12 +124,13 @@ class BP_Blogs_Component extends BP_Component {
121
  * Although comments and posts made by users will still show on their
122
  * activity stream.
123
  */
124
- if ( !is_multisite() )
125
  return false;
 
126
 
127
  // Add 'Sites' to the main navigation
128
  $main_nav = array(
129
- 'name' => sprintf( __( 'Sites <span>%d</span>', 'buddypress' ), bp_blogs_total_blogs_for_user() ),
130
  'slug' => $this->slug,
131
  'position' => 30,
132
  'screen_function' => 'bp_blogs_screen_my_blogs',
@@ -173,11 +177,12 @@ class BP_Blogs_Component extends BP_Component {
173
 
174
  /**
175
  * Site/post/comment menus should not appear on single WordPress setups.
176
- * Although comments and posts made by users will still show on their
177
- * activity stream.
178
  */
179
- if ( !is_multisite() )
180
  return false;
 
181
 
182
  // Menus for logged in user
183
  if ( is_user_logged_in() ) {
1
  <?php
2
 
3
  /**
4
+ * BuddyPress Blogs Loader
5
  *
6
+ * The blogs component tracks posts and comments to member activity streams,
7
+ * shows blogs the member can post to in their profiles, and caches useful
8
+ * information from those blogs to make quering blogs in bulk more performant.
9
  *
10
  * @package BuddyPress
11
  * @subpackage Blogs Core
24
  public function __construct() {
25
  parent::start(
26
  'blogs',
27
+ __( 'Site Directory', 'buddypress' ),
28
  buddypress()->plugin_dir,
29
  array(
30
  'adminbar_myaccount_order' => 30
47
  public function setup_globals( $args = array() ) {
48
  $bp = buddypress();
49
 
50
+ if ( ! defined( 'BP_BLOGS_SLUG' ) ) {
51
  define ( 'BP_BLOGS_SLUG', $this->id );
52
+ }
53
 
54
  // Global tables for messaging component
55
  $global_tables = array(
61
  'blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta',
62
  );
63
 
64
+ // All globals for blogs component.
 
65
  $args = array(
66
  'slug' => BP_BLOGS_SLUG,
67
  'root_slug' => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
85
  * @param array $includes See {@link BP_Component::includes()}.
86
  */
87
  public function includes( $includes = array() ) {
88
+
89
  // Files to include
90
  $includes = array(
91
  'cache',
96
  'filters',
97
  'activity',
98
  'functions',
 
99
  );
100
 
101
+ if ( is_multisite() ) {
102
  $includes[] = 'widgets';
103
+ }
104
 
105
  // Include the files
106
  parent::includes( $includes );
124
  * Although comments and posts made by users will still show on their
125
  * activity stream.
126
  */
127
+ if ( ! is_multisite() ) {
128
  return false;
129
+ }
130
 
131
  // Add 'Sites' to the main navigation
132
  $main_nav = array(
133
+ 'name' => sprintf( __( 'Sites <span>%d</span>', 'buddypress' ), bp_get_total_blog_count_for_user() ),
134
  'slug' => $this->slug,
135
  'position' => 30,
136
  'screen_function' => 'bp_blogs_screen_my_blogs',
177
 
178
  /**
179
  * Site/post/comment menus should not appear on single WordPress setups.
180
+ *
181
+ * Comments and posts made by users will still show in their activity.
182
  */
183
+ if ( ! is_multisite() ) {
184
  return false;
185
+ }
186
 
187
  // Menus for logged in user
188
  if ( is_user_logged_in() ) {
bp-blogs/bp-blogs-screens.php CHANGED
@@ -149,7 +149,7 @@ class BP_Blogs_Theme_Compat {
149
  'post_author' => 0,
150
  'post_date' => 0,
151
  'post_content' => '',
152
- 'post_type' => 'bp_blogs',
153
  'post_status' => 'publish',
154
  'is_page' => true,
155
  'comment_status' => 'closed'
@@ -212,7 +212,7 @@ class BP_Blogs_Theme_Compat {
212
  'post_author' => 0,
213
  'post_date' => 0,
214
  'post_content' => '',
215
- 'post_type' => 'bp_group',
216
  'post_status' => 'publish',
217
  'is_page' => true,
218
  'comment_status' => 'closed'
149
  'post_author' => 0,
150
  'post_date' => 0,
151
  'post_content' => '',
152
+ 'post_type' => 'page',
153
  'post_status' => 'publish',
154
  'is_page' => true,
155
  'comment_status' => 'closed'
212
  'post_author' => 0,
213
  'post_date' => 0,
214
  'post_content' => '',
215
+ 'post_type' => 'page',
216
  'post_status' => 'publish',
217
  'is_page' => true,
218
  'comment_status' => 'closed'
bp-blogs/bp-blogs-template.php CHANGED
@@ -90,7 +90,7 @@ class BP_Blogs_Template {
90
  * @access public
91
  * @var int
92
  */
93
- var $current_blog = -1;
94
 
95
  /**
96
  * The number of blogs returned by the paged query.
@@ -98,7 +98,7 @@ class BP_Blogs_Template {
98
  * @access public
99
  * @var int
100
  */
101
- var $blog_count;
102
 
103
  /**
104
  * Array of blogs located by the query..
@@ -106,7 +106,7 @@ class BP_Blogs_Template {
106
  * @access public
107
  * @var array
108
  */
109
- var $blogs;
110
 
111
  /**
112
  * The blog object currently being iterated on.
@@ -114,7 +114,7 @@ class BP_Blogs_Template {
114
  * @access public
115
  * @var object
116
  */
117
- var $blog;
118
 
119
  /**
120
  * A flag for whether the loop is currently being iterated.
@@ -122,7 +122,7 @@ class BP_Blogs_Template {
122
  * @access public
123
  * @var bool
124
  */
125
- var $in_the_loop;
126
 
127
  /**
128
  * The page number being requested.
@@ -130,7 +130,7 @@ class BP_Blogs_Template {
130
  * @access public
131
  * @var public
132
  */
133
- var $pag_page;
134
 
135
  /**
136
  * The number of items being requested per page.
@@ -138,7 +138,7 @@ class BP_Blogs_Template {
138
  * @access public
139
  * @var public
140
  */
141
- var $pag_num;
142
 
143
  /**
144
  * An HTML string containing pagination links.
@@ -146,7 +146,7 @@ class BP_Blogs_Template {
146
  * @access public
147
  * @var string
148
  */
149
- var $pag_links;
150
 
151
  /**
152
  * The total number of blogs matching the query parameters.
@@ -154,7 +154,7 @@ class BP_Blogs_Template {
154
  * @access public
155
  * @var int
156
  */
157
- var $total_blog_count;
158
 
159
  /**
160
  * Constructor method.
@@ -173,13 +173,16 @@ class BP_Blogs_Template {
173
  * queried blogs.
174
  * @param array $include_blog_ids Array of blog IDs to include.
175
  */
176
- function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage', $update_meta_cache = true, $include_blog_ids = false ) {
177
 
178
- $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
179
- $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
180
 
181
- if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] ) {
 
182
  $this->blogs = BP_Blogs_Blog::get_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page );
 
 
183
  } else {
184
  $this->blogs = bp_blogs_get_blogs( array(
185
  'type' => $type,
@@ -192,31 +195,35 @@ class BP_Blogs_Template {
192
  ) );
193
  }
194
 
195
- if ( !$max || $max >= (int) $this->blogs['total'] )
 
196
  $this->total_blog_count = (int) $this->blogs['total'];
197
- else
198
  $this->total_blog_count = (int) $max;
 
199
 
 
200
  $this->blogs = $this->blogs['blogs'];
201
 
202
- if ( $max ) {
203
- if ( $max >= count($this->blogs) ) {
204
- $this->blog_count = count( $this->blogs );
205
- } else {
206
- $this->blog_count = (int) $max;
207
- }
208
  } else {
209
- $this->blog_count = count( $this->blogs );
210
  }
211
 
212
- if ( (int) $this->total_blog_count && (int) $this->pag_num ) {
 
213
  $this->pag_links = paginate_links( array(
214
  'base' => add_query_arg( $page_arg, '%#%' ),
215
  'format' => '',
216
  'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ),
217
  'current' => (int) $this->pag_page,
218
  'prev_text' => _x( '&larr;', 'Blog pagination previous text', 'buddypress' ),
219
- 'next_text' => _x( '&rarr;', 'Blog pagination next text', 'buddypress' ),
220
  'mid_size' => 1
221
  ) );
222
  }
@@ -229,11 +236,8 @@ class BP_Blogs_Template {
229
  *
230
  * @return bool True if there are items in the loop, otherwise false.
231
  */
232
- function has_blogs() {
233
- if ( $this->blog_count )
234
- return true;
235
-
236
- return false;
237
  }
238
 
239
  /**
@@ -241,9 +245,9 @@ class BP_Blogs_Template {
241
  *
242
  * @return object The next blog to iterate over.
243
  */
244
- function next_blog() {
245
  $this->current_blog++;
246
- $this->blog = $this->blogs[$this->current_blog];
247
 
248
  return $this->blog;
249
  }
@@ -251,7 +255,7 @@ class BP_Blogs_Template {
251
  /**
252
  * Rewind the blogs and reset blog index.
253
  */
254
- function rewind_blogs() {
255
  $this->current_blog = -1;
256
  if ( $this->blog_count > 0 ) {
257
  $this->blog = $this->blogs[0];
@@ -269,11 +273,11 @@ class BP_Blogs_Template {
269
  *
270
  * @return bool True if there are more blogs to show, otherwise false.
271
  */
272
- function blogs() {
273
- if ( $this->current_blog + 1 < $this->blog_count ) {
274
  return true;
275
- } elseif ( $this->current_blog + 1 == $this->blog_count ) {
276
- do_action('blog_loop_end');
277
  // Do some cleaning up after the loop
278
  $this->rewind_blogs();
279
  }
@@ -291,13 +295,15 @@ class BP_Blogs_Template {
291
  *
292
  * @see bp_the_blog()
293
  */
294
- function the_blog() {
295
 
296
  $this->in_the_loop = true;
297
  $this->blog = $this->next_blog();
298
 
299
- if ( 0 == $this->current_blog ) // loop has just started
300
- do_action('blog_loop_start');
 
 
301
  }
302
  }
303
 
@@ -340,7 +346,8 @@ function bp_rewind_blogs() {
340
  * 'active', 'alphabetical', 'newest', or 'random'.
341
  * @type array $include_blog_ids Array of blog IDs to limit results to.
342
  * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'.
343
- * @type string $search_terms Limit results by a search term. Default: null.
 
344
  * @type int $user_id The ID of the user whose blogs should be retrieved.
345
  * When viewing a user profile page, 'user_id' defaults to the ID of
346
  * the displayed user. Otherwise the default is false.
@@ -350,51 +357,34 @@ function bp_rewind_blogs() {
350
  function bp_has_blogs( $args = '' ) {
351
  global $blogs_template;
352
 
353
- /***
354
- * Set the defaults based on the current page. Any of these will be overridden
355
- * if arguments are directly passed into the loop. Custom plugins should always
356
- * pass their parameters directly to the loop.
357
- */
358
- $type = 'active';
359
- $user_id = 0;
360
- $search_terms = null;
361
-
362
- // User filtering
363
- if ( bp_displayed_user_id() )
364
- $user_id = bp_displayed_user_id();
365
 
366
- $defaults = array(
367
- 'type' => $type,
 
 
368
  'page' => 1,
369
  'per_page' => 20,
370
  'max' => false,
371
-
372
- 'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679
373
-
374
- 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
375
  'include_blog_ids' => false,
376
- 'search_terms' => $search_terms, // Pass search terms to filter on the blog title or description.
377
- 'update_meta_cache' => true,
378
- );
379
 
380
- $r = bp_parse_args( $args, $defaults, 'has_blogs' );
381
- extract( $r );
382
-
383
- if ( is_null( $search_terms ) ) {
384
- if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
385
- $search_terms = $_REQUEST['s'];
386
- else
387
- $search_terms = false;
388
  }
389
 
390
- if ( $max ) {
391
- if ( $per_page > $max ) {
392
- $per_page = $max;
393
- }
394
- }
395
 
396
- $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg, $update_meta_cache, $include_blog_ids );
397
- return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template );
398
  }
399
 
400
  /**
@@ -436,7 +426,7 @@ function bp_blogs_pagination_count() {
436
  $to_num = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) );
437
  $total = bp_core_number_format( $blogs_template->total_blog_count );
438
 
439
- echo sprintf( _n( 'Viewing site %1$s to %2$s (of %3$s site)', 'Viewing site %1$s to %2$s (of %3$s sites)', $total, 'buddypress' ), $from_num, $to_num, $total );
440
  }
441
 
442
  /**
@@ -488,25 +478,43 @@ function bp_blog_avatar( $args = '' ) {
488
  * @type int|bool $width Default: false.
489
  * @type int|bool $height Default: false.
490
  * @type bool $id Currently unused.
491
- * @type bool $no_grav Default: false.
492
  * }
493
  * @return string User avatar string.
494
  */
495
  function bp_get_blog_avatar( $args = '' ) {
496
  global $blogs_template;
497
 
498
- $defaults = array(
 
 
 
 
 
 
 
499
  'type' => 'full',
500
  'width' => false,
501
  'height' => false,
502
  'class' => 'avatar',
503
  'id' => false,
504
  'alt' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ) ),
505
- 'no_grav' => true
506
- );
507
-
508
- $r = wp_parse_args( $args, $defaults );
509
- extract( $r, EXTR_SKIP );
 
 
 
 
 
 
 
 
 
 
 
510
 
511
  /***
512
  * In future BuddyPress versions you will be able to set the avatar for a blog.
@@ -516,9 +524,9 @@ function bp_blog_avatar( $args = '' ) {
516
  * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version.
517
  * Use the 'bp_get_blog_avatar' filter instead.
518
  */
519
- $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, bp_core_fetch_avatar( array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email ) ) );
520
 
521
- return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email ) );
522
  }
523
 
524
  function bp_blog_permalink() {
@@ -633,39 +641,86 @@ function bp_blog_class() {
633
 
634
  /**
635
  * Output the last active date of the current blog in the loop.
 
 
636
  */
637
- function bp_blog_last_active() {
638
- echo bp_get_blog_last_active();
639
  }
640
  /**
641
  * Return the last active date of the current blog in the loop.
642
  *
 
 
 
 
 
643
  * @return string Last active date.
644
  */
645
- function bp_get_blog_last_active() {
646
  global $blogs_template;
647
 
648
- return apply_filters( 'bp_blog_last_active', bp_core_get_last_activity( $blogs_template->blog->last_activity, __( 'active %s', 'buddypress' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  }
650
 
651
  /**
652
  * Output the latest post from the current blog in the loop.
 
 
653
  */
654
- function bp_blog_latest_post() {
655
- echo bp_get_blog_latest_post();
656
  }
657
  /**
658
  * Return the latest post from the current blog in the loop.
659
  *
 
 
 
 
 
 
660
  * @return string $retval String of the form 'Latest Post: [link to post]'.
661
  */
662
- function bp_get_blog_latest_post() {
663
  global $blogs_template;
664
 
 
 
 
 
665
  $retval = bp_get_blog_latest_post_title();
666
 
667
- if ( ! empty( $retval ) )
668
- $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' );
 
 
 
 
 
669
 
670
  return apply_filters( 'bp_get_blog_latest_post', $retval );
671
  }
@@ -912,7 +967,7 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = ''
912
  $errors = $filtered_results['errors'];
913
 
914
  if ( $errors->get_error_code() ) {
915
- echo "<p>" . __('There was a problem, please correct the form below and try again.', 'buddypress') . "</p>";
916
  }
917
  ?>
918
  <p><?php printf(__("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!", 'buddypress'), $current_user->display_name) ?></p>
@@ -1006,27 +1061,6 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
1006
  do_action('signup_blogform', $errors);
1007
  }
1008
 
1009
- /**
1010
- * Output the base URL for subdomain installations of WordPress Multisite.
1011
- *
1012
- * @since BuddyPress (1.6.0)
1013
- */
1014
- function bp_blogs_subdomain_base() {
1015
- echo bp_blogs_get_subdomain_base();
1016
- }
1017
- /**
1018
- * Return the base URL for subdomain installations of WordPress Multisite.
1019
- *
1020
- * @since BuddyPress (1.6.0)
1021
- *
1022
- * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com.
1023
- */
1024
- function bp_blogs_get_subdomain_base() {
1025
- global $current_site;
1026
-
1027
- return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
1028
- }
1029
-
1030
  /**
1031
  * Process a blog registration submission.
1032
  *
90
  * @access public
91
  * @var int
92
  */
93
+ public $current_blog = -1;
94
 
95
  /**
96
  * The number of blogs returned by the paged query.
98
  * @access public
99
  * @var int
100
  */
101
+ public $blog_count = 0;
102
 
103
  /**
104
  * Array of blogs located by the query..
106
  * @access public
107
  * @var array
108
  */
109
+ public $blogs = array();
110
 
111
  /**
112
  * The blog object currently being iterated on.
114
  * @access public
115
  * @var object
116
  */
117
+ public $blog;
118
 
119
  /**
120
  * A flag for whether the loop is currently being iterated.
122
  * @access public
123
  * @var bool
124
  */
125
+ public $in_the_loop = false;
126
 
127
  /**
128
  * The page number being requested.
130
  * @access public
131
  * @var public
132
  */
133
+ public $pag_page = 1;
134
 
135
  /**
136
  * The number of items being requested per page.
138
  * @access public
139
  * @var public
140
  */
141
+ public $pag_num = 20;
142
 
143
  /**
144
  * An HTML string containing pagination links.
146
  * @access public
147
  * @var string
148
  */
149
+ public $pag_links = '';
150
 
151
  /**
152
  * The total number of blogs matching the query parameters.
154
  * @access public
155
  * @var int
156
  */
157
+ public $total_blog_count = 0;
158
 
159
  /**
160
  * Constructor method.
173
  * queried blogs.
174
  * @param array $include_blog_ids Array of blog IDs to include.
175
  */
176
+ public function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage', $update_meta_cache = true, $include_blog_ids = false ) {
177
 
178
+ $this->pag_page = isset( $_REQUEST[ $page_arg ] ) ? intval( $_REQUEST[ $page_arg ] ) : $page;
179
+ $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
180
 
181
+ // Backwards compatibility support for blogs by first letter
182
+ if ( ! empty( $_REQUEST['letter'] ) ) {
183
  $this->blogs = BP_Blogs_Blog::get_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page );
184
+
185
+ // Typical blogs query
186
  } else {
187
  $this->blogs = bp_blogs_get_blogs( array(
188
  'type' => $type,
195
  ) );
196
  }
197
 
198
+ // Set the total blog count
199
+ if ( empty( $max ) || ( $max >= (int) $this->blogs['total'] ) ) {
200
  $this->total_blog_count = (int) $this->blogs['total'];
201
+ } else {
202
  $this->total_blog_count = (int) $max;
203
+ }
204
 
205
+ // Set the blogs array (to loop through later
206
  $this->blogs = $this->blogs['blogs'];
207
 
208
+ // Get the current blog count to compare maximum against
209
+ $blog_count = count( $this->blogs );
210
+
211
+ // Set the current blog count
212
+ if ( empty( $max ) || ( $max >= (int) $blog_count ) ) {
213
+ $this->blog_count = (int) $blog_count;
214
  } else {
215
+ $this->blog_count = (int) $max;
216
  }
217
 
218
+ // Build pagination links based on total blogs and current page number
219
+ if ( ! empty( $this->total_blog_count ) && ! empty( $this->pag_num ) ) {
220
  $this->pag_links = paginate_links( array(
221
  'base' => add_query_arg( $page_arg, '%#%' ),
222
  'format' => '',
223
  'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ),
224
  'current' => (int) $this->pag_page,
225
  'prev_text' => _x( '&larr;', 'Blog pagination previous text', 'buddypress' ),
226
+ 'next_text' => _x( '&rarr;', 'Blog pagination next text', 'buddypress' ),
227
  'mid_size' => 1
228
  ) );
229
  }
236
  *
237
  * @return bool True if there are items in the loop, otherwise false.
238
  */
239
+ public function has_blogs() {
240
+ return (bool) ! empty( $this->blog_count );
 
 
 
241
  }
242
 
243
  /**
245
  *
246
  * @return object The next blog to iterate over.
247
  */
248
+ public function next_blog() {
249
  $this->current_blog++;
250
+ $this->blog = $this->blogs[ $this->current_blog ];
251
 
252
  return $this->blog;
253
  }
255
  /**
256
  * Rewind the blogs and reset blog index.
257
  */
258
+ public function rewind_blogs() {
259
  $this->current_blog = -1;
260
  if ( $this->blog_count > 0 ) {
261
  $this->blog = $this->blogs[0];
273
  *
274
  * @return bool True if there are more blogs to show, otherwise false.
275
  */
276
+ public function blogs() {
277
+ if ( ( $this->current_blog + 1 ) < $this->blog_count ) {
278
  return true;
279
+ } elseif ( ( $this->current_blog + 1 ) === $this->blog_count ) {
280
+ do_action( 'blog_loop_end' );
281
  // Do some cleaning up after the loop
282
  $this->rewind_blogs();
283
  }
295
  *
296
  * @see bp_the_blog()
297
  */
298
+ public function the_blog() {
299
 
300
  $this->in_the_loop = true;
301
  $this->blog = $this->next_blog();
302
 
303
+ // loop has just started
304
+ if ( 0 === $this->current_blog ) {
305
+ do_action( 'blog_loop_start' );
306
+ }
307
  }
308
  }
309
 
346
  * 'active', 'alphabetical', 'newest', or 'random'.
347
  * @type array $include_blog_ids Array of blog IDs to limit results to.
348
  * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'.
349
+ * @type string $search_terms Limit results by a search term. Default: the
350
+ * value of $_REQUEST['s'], if present.
351
  * @type int $user_id The ID of the user whose blogs should be retrieved.
352
  * When viewing a user profile page, 'user_id' defaults to the ID of
353
  * the displayed user. Otherwise the default is false.
357
  function bp_has_blogs( $args = '' ) {
358
  global $blogs_template;
359
 
360
+ // Checkfor and use search terms
361
+ $search_terms = ! empty( $_REQUEST['s'] )
362
+ ? $_REQUEST['s']
363
+ : false;
 
 
 
 
 
 
 
 
364
 
365
+ // Parse arguments
366
+ $r = bp_parse_args( $args, array(
367
+ 'type' => 'active',
368
+ 'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679
369
  'page' => 1,
370
  'per_page' => 20,
371
  'max' => false,
372
+ 'user_id' => bp_displayed_user_id(), // Pass a user_id to limit to only blogs this user is a member of
 
 
 
373
  'include_blog_ids' => false,
374
+ 'search_terms' => $search_terms, // Pass search terms to filter on the blog title or description.
375
+ 'update_meta_cache' => true
376
+ ), 'has_blogs' );
377
 
378
+ // Set per_page to maximum if max is enforced
379
+ if ( ! empty( $r['max'] ) && ( (int) $r['per_page'] > (int) $r['max'] ) ) {
380
+ $r['per_page'] = (int) $r['max'];
 
 
 
 
 
381
  }
382
 
383
+ // Get the blogs
384
+ $blogs_template = new BP_Blogs_Template( $r['type'], $r['page'], $r['per_page'], $r['max'], $r['user_id'], $r['search_terms'], $r['page_arg'], $r['update_meta_cache'], $r['include_blog_ids'] );
 
 
 
385
 
386
+ // Filter and return
387
+ return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template, $r );
388
  }
389
 
390
  /**
426
  $to_num = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) );
427
  $total = bp_core_number_format( $blogs_template->total_blog_count );
428
 
429
+ echo sprintf( _n( 'Viewing 1 site', 'Viewing %1$s - %2$s of %3$s sites', $total, 'buddypress' ), $from_num, $to_num, $total );
430
  }
431
 
432
  /**
478
  * @type int|bool $width Default: false.
479
  * @type int|bool $height Default: false.
480
  * @type bool $id Currently unused.
481
+ * @type bool $no_grav Default: true.
482
  * }
483
  * @return string User avatar string.
484
  */
485
  function bp_get_blog_avatar( $args = '' ) {
486
  global $blogs_template;
487
 
488
+ // Bail if avatars are turned off
489
+ // @todo Should we maybe still filter this?
490
+ if ( ! buddypress()->avatar->show_avatars ) {
491
+ return false;
492
+ }
493
+
494
+ // Parse the arguments
495
+ $r = bp_parse_args( $args, array(
496
  'type' => 'full',
497
  'width' => false,
498
  'height' => false,
499
  'class' => 'avatar',
500
  'id' => false,
501
  'alt' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ) ),
502
+ 'no_grav' => true,
503
+ ) );
504
+
505
+ // Fetch the avatar
506
+ $avatar = bp_core_fetch_avatar( array(
507
+ 'item_id' => $blogs_template->blog->admin_user_id,
508
+ 'title' => $blogs_template->blog->admin_user_email,
509
+ //'avatar_dir' => 'blog-avatars',
510
+ //'object' => 'blog',
511
+ 'type' => $r['type'],
512
+ 'alt' => $r['alt'],
513
+ 'css_id' => $r['id'],
514
+ 'class' => $r['class'],
515
+ 'width' => $r['width'],
516
+ 'height' => $r['height']
517
+ ) );
518
 
519
  /***
520
  * In future BuddyPress versions you will be able to set the avatar for a blog.
524
  * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version.
525
  * Use the 'bp_get_blog_avatar' filter instead.
526
  */
527
+ $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, $avatar );
528
 
529
+ return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, $r );
530
  }
531
 
532
  function bp_blog_permalink() {
641
 
642
  /**
643
  * Output the last active date of the current blog in the loop.
644
+ *
645
+ * @param array $args See {@link bp_get_blog_last_active()}.
646
  */
647
+ function bp_blog_last_active( $args = array() ) {
648
+ echo bp_get_blog_last_active( $args );
649
  }
650
  /**
651
  * Return the last active date of the current blog in the loop.
652
  *
653
+ * @param array $args {
654
+ * Array of optional arguments.
655
+ * @type bool $active_format If true, formatted "Active 5 minutes
656
+ * ago". If false, formatted "5 minutes ago". Default: true.
657
+ * }
658
  * @return string Last active date.
659
  */
660
+ function bp_get_blog_last_active( $args = array() ) {
661
  global $blogs_template;
662
 
663
+ // Parse the activity format
664
+ $r = bp_parse_args( $args, array(
665
+ 'active_format' => true
666
+ ) );
667
+
668
+ // Backwards compatibilty for anyone forcing a 'true' active_format
669
+ if ( true === $r['active_format'] ) {
670
+ $r['active_format'] = __( 'active %s', 'buddypress' );
671
+ }
672
+
673
+ // Blog has been posted to at least once
674
+ if ( isset( $blogs_template->blog->last_activity ) ) {
675
+
676
+ // Backwards compatibility for pre 1.5 'ago' strings
677
+ $last_activity = ! empty( $r['active_format'] )
678
+ ? bp_core_get_last_activity( $blogs_template->blog->last_activity, $r['active_format'] )
679
+ : bp_core_time_since( $blogs_template->blog->last_activity );
680
+
681
+ // Blog has never been posted to
682
+ } else {
683
+ $last_activity = __( 'Never active', 'buddypress' );
684
+ }
685
+
686
+ return apply_filters( 'bp_blog_last_active', $last_activity, $r );
687
  }
688
 
689
  /**
690
  * Output the latest post from the current blog in the loop.
691
+ *
692
+ * @param array $args See {@link bp_get_blog_latest_post()}.
693
  */
694
+ function bp_blog_latest_post( $args = array() ) {
695
+ echo bp_get_blog_latest_post( $args );
696
  }
697
  /**
698
  * Return the latest post from the current blog in the loop.
699
  *
700
+ * @param array $args {
701
+ * Array of optional arguments.
702
+ * @type bool $latest_format If true, formatted "Latest post:
703
+ * [link to post]". If false, formatted "[link to post]".
704
+ * Default: true.
705
+ * }
706
  * @return string $retval String of the form 'Latest Post: [link to post]'.
707
  */
708
+ function bp_get_blog_latest_post( $args = array() ) {
709
  global $blogs_template;
710
 
711
+ $r = wp_parse_args( $args, array(
712
+ 'latest_format' => true,
713
+ ) );
714
+
715
  $retval = bp_get_blog_latest_post_title();
716
 
717
+ if ( ! empty( $retval ) ) {
718
+ if ( ! empty( $r['latest_format'] ) ) {
719
+ $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' );
720
+ } else {
721
+ $retval = '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>';
722
+ }
723
+ }
724
 
725
  return apply_filters( 'bp_get_blog_latest_post', $retval );
726
  }
967
  $errors = $filtered_results['errors'];
968
 
969
  if ( $errors->get_error_code() ) {
970
+ echo "<p>" . __('There was a problem; please correct the form below and try again.', 'buddypress') . "</p>";
971
  }
972
  ?>
973
  <p><?php printf(__("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!", 'buddypress'), $current_user->display_name) ?></p>
1061
  do_action('signup_blogform', $errors);
1062
  }
1063
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1064
  /**
1065
  * Process a blog registration submission.
1066
  *
bp-core/admin/bp-core-functions.php CHANGED
@@ -200,36 +200,35 @@ function bp_core_add_admin_notice( $notice = '' ) {
200
  * @since BuddyPress (1.2)
201
  */
202
  function bp_core_activation_notice() {
203
- global $wpdb, $wp_rewrite;
204
-
205
- $bp = buddypress();
206
 
207
  // Only the super admin gets warnings
208
  if ( ! bp_current_user_can( 'bp_moderate' ) ) {
209
  return;
210
  }
211
 
212
- // On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden
213
- if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) {
214
  return;
215
  }
216
 
217
- // Bail if in network admin, and BuddyPress is not network activated
218
- if ( is_network_admin() && ! bp_is_network_activated() ) {
219
  return;
220
  }
221
 
222
- // Bail in network admin
223
- if ( is_user_admin() ) {
224
  return;
225
  }
226
 
227
  /**
228
- * Check to make sure that the blog setup routine has run. This can't happen during the
229
- * wizard because of the order which the components are loaded. We check for multisite here
230
- * on the off chance that someone has activated the blogs component and then disabled MS
231
  */
232
  if ( bp_is_active( 'blogs' ) ) {
 
233
  $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" );
234
 
235
  if ( empty( $count ) ) {
@@ -237,17 +236,14 @@ function bp_core_activation_notice() {
237
  }
238
  }
239
 
240
- /**
241
- * Are pretty permalinks enabled?
242
- */
243
- if ( isset( $_POST['permalink_structure'] ) ) {
244
- return;
245
- }
246
-
247
  if ( empty( $wp_rewrite->permalink_structure ) ) {
248
  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' ) ) );
249
  }
250
 
 
 
 
251
  /**
252
  * Check for orphaned BP components (BP component is enabled, no WP page exists)
253
  */
@@ -527,15 +523,15 @@ function bp_core_add_contextual_help_content( $tab = '' ) {
527
 
528
  switch ( $tab ) {
529
  case 'bp-comp-overview' :
530
- $retval = __( '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' );
531
  break;
532
 
533
  case 'bp-page-overview' :
534
- $retval = __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component.', 'buddypress' );
535
  break;
536
 
537
  case 'bp-settings-overview' :
538
- $retval = __( 'Extra configuration settings.', 'buddypress' );
539
  break;
540
 
541
  case 'bp-profile-overview' :
@@ -802,17 +798,37 @@ function bp_admin_wp_nav_menu_restrict_items() {
802
  */
803
  function bp_core_admin_user_row_actions( $actions, $user_object ) {
804
 
805
- if ( current_user_can( 'edit_user', $user_object->ID ) && bp_loggedin_user_id() != $user_object->ID ) {
 
 
 
 
 
 
 
806
 
 
807
  $url = bp_get_admin_url( 'users.php' );
808
 
809
- if ( bp_is_user_spammer( $user_object->ID ) ) {
810
- $actions['ham'] = "<a href='" . wp_nonce_url( $url . "?action=ham&amp;user=$user_object->ID", 'bp-spam-user' ) . "'>" . __( 'Not Spam', 'buddypress' ) . "</a>";
 
 
 
 
 
811
  } else {
812
- $actions['spam'] = "<a class='submitdelete' href='" . wp_nonce_url( $url . "?action=spam&amp;user=$user_object->ID", 'bp-spam-user' ) . "'>" . __( 'Mark as Spam', 'buddypress' ) . "</a>";
 
 
813
  }
814
  }
815
 
 
 
 
 
 
816
  return $actions;
817
  }
818
 
200
  * @since BuddyPress (1.2)
201
  */
202
  function bp_core_activation_notice() {
203
+ global $wp_rewrite, $wpdb;
 
 
204
 
205
  // Only the super admin gets warnings
206
  if ( ! bp_current_user_can( 'bp_moderate' ) ) {
207
  return;
208
  }
209
 
210
+ // Bail in user admin
211
+ if ( is_user_admin() ) {
212
  return;
213
  }
214
 
215
+ // On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden
216
+ if ( is_multisite() && bp_core_do_network_admin() && ! bp_is_root_blog() ) {
217
  return;
218
  }
219
 
220
+ // Bail if in network admin, and BuddyPress is not network activated
221
+ if ( is_network_admin() && ! bp_is_network_activated() ) {
222
  return;
223
  }
224
 
225
  /**
226
+ * Check to make sure that the blog setup routine has run. This can't
227
+ * happen during the wizard because of the order which the components
228
+ * are loaded.
229
  */
230
  if ( bp_is_active( 'blogs' ) ) {
231
+ $bp = buddypress();
232
  $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" );
233
 
234
  if ( empty( $count ) ) {
236
  }
237
  }
238
 
239
+ // Add notice if no rewrite rules are enabled
 
 
 
 
 
 
240
  if ( empty( $wp_rewrite->permalink_structure ) ) {
241
  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' ) ) );
242
  }
243
 
244
+ // Get BuddyPress instance
245
+ $bp = buddypress();
246
+
247
  /**
248
  * Check for orphaned BP components (BP component is enabled, no WP page exists)
249
  */
523
 
524
  switch ( $tab ) {
525
  case 'bp-comp-overview' :
526
+ $retval = __( 'By default, all but four of the BuddyPress components are enabled. You can selectively enable or disable any of the components by using the form below. 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' );
527
  break;
528
 
529
  case 'bp-page-overview' :
530
+ $retval = __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. You can change the page associations for each active component by using the form below.', 'buddypress' );
531
  break;
532
 
533
  case 'bp-settings-overview' :
534
+ $retval = __( 'Extra configuration settings are provided and activated. You can selectively enable or disable any setting by using the form on this screen.', 'buddypress' );
535
  break;
536
 
537
  case 'bp-profile-overview' :
798
  */
799
  function bp_core_admin_user_row_actions( $actions, $user_object ) {
800
 
801
+ // Setup the $user_id variable from the current user object
802
+ $user_id = 0;
803
+ if ( !empty( $user_object->ID ) ) {
804
+ $user_id = absint( $user_object->ID );
805
+ }
806
+
807
+ // Bail early if user cannot perform this action, or is looking at themselves
808
+ if ( current_user_can( 'edit_user', $user_id ) && ( bp_loggedin_user_id() !== $user_id ) ) {
809
 
810
+ // Admin URL could be single site or network
811
  $url = bp_get_admin_url( 'users.php' );
812
 
813
+ // If spammed, create unspam link
814
+ if ( bp_is_user_spammer( $user_id ) ) {
815
+ $url = add_query_arg( array( 'action' => 'ham', 'user' => $user_id ), $url );
816
+ $unspam_link = wp_nonce_url( $url, 'bp-spam-user' );
817
+ $actions['ham'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $unspam_link ), esc_html__( 'Not Spam', 'buddypress' ) );
818
+
819
+ // If not already spammed, create spam link
820
  } else {
821
+ $url = add_query_arg( array( 'action' => 'spam', 'user' => $user_id ), $url );
822
+ $spam_link = wp_nonce_url( $url, 'bp-spam-user' );
823
+ $actions['spam'] = sprintf( '<a class="submitdelete" href="%1$s">%2$s</a>', esc_url( $spam_link ), esc_html__( 'Spam', 'buddypress' ) );
824
  }
825
  }
826
 
827
+ // Create a "View" link
828
+ $url = bp_core_get_user_domain( $user_id );
829
+ $actions['view'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $url ), esc_html__( 'View', 'buddypress' ) );
830
+
831
+ // Return new actions
832
  return $actions;
833
  }
834
 
bp-core/admin/bp-core-schema.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * BuddyPress DB schema
4
  *
@@ -9,81 +10,121 @@
9
  // Exit if accessed directly
10
  if ( !defined( 'ABSPATH' ) ) exit;
11
 
 
 
 
 
 
 
 
 
12
  function bp_core_set_charset() {
13
  global $wpdb;
14
 
15
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
16
 
17
- // BuddyPress component DB schema
18
  return !empty( $wpdb->charset ) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : '';
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
21
  function bp_core_install( $active_components = false ) {
22
 
23
- if ( empty( $active_components ) )
 
24
  $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
 
25
 
26
- // Activity Streams
27
- // Install tables even when inactive, to store last_activity data
28
  bp_core_install_activity_streams();
29
 
 
 
 
30
  // Notifications
31
- if ( !empty( $active_components['notifications'] ) )
32
  bp_core_install_notifications();
 
33
 
34
  // Friend Connections
35
- if ( !empty( $active_components['friends'] ) )
36
  bp_core_install_friends();
 
37
 
38
  // Extensible Groups
39
- if ( !empty( $active_components['groups'] ) )
40
  bp_core_install_groups();
 
41
 
42
  // Private Messaging
43
- if ( !empty( $active_components['messages'] ) )
44
  bp_core_install_private_messaging();
 
45
 
46
  // Extended Profiles
47
- if ( !empty( $active_components['xprofile'] ) )
48
  bp_core_install_extended_profiles();
 
49
 
50
  // Blog tracking
51
- if ( !empty( $active_components['blogs'] ) )
52
  bp_core_install_blog_tracking();
53
-
54
- // Maybe install (or upgrade) the signups table
55
- bp_core_maybe_install_signups();
56
  }
57
 
 
 
 
 
 
 
 
 
 
58
  function bp_core_install_notifications() {
59
-
60
  $sql = array();
61
  $charset_collate = bp_core_set_charset();
62
  $bp_prefix = bp_core_get_table_prefix();
63
 
64
  $sql[] = "CREATE TABLE {$bp_prefix}bp_notifications (
65
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
66
- user_id bigint(20) NOT NULL,
67
- item_id bigint(20) NOT NULL,
68
- secondary_item_id bigint(20),
69
- component_name varchar(75) NOT NULL,
70
- component_action varchar(75) NOT NULL,
71
- date_notified datetime NOT NULL,
72
- is_new bool NOT NULL DEFAULT 0,
73
- KEY item_id (item_id),
74
- KEY secondary_item_id (secondary_item_id),
75
- KEY user_id (user_id),
76
- KEY is_new (is_new),
77
- KEY component_name (component_name),
78
- KEY component_action (component_action),
79
- KEY useritem (user_id,is_new)
80
- ) {$charset_collate};";
81
 
82
  dbDelta( $sql );
83
  }
84
 
 
 
 
 
 
 
 
 
 
85
  function bp_core_install_activity_streams() {
86
-
87
  $sql = array();
88
  $charset_collate = bp_core_set_charset();
89
  $bp_prefix = bp_core_get_table_prefix();
@@ -122,52 +163,68 @@ function bp_core_install_activity_streams() {
122
  meta_value longtext DEFAULT NULL,
123
  KEY activity_id (activity_id),
124
  KEY meta_key (meta_key)
125
- ) {$charset_collate};";
126
 
127
  dbDelta( $sql );
128
  }
129
 
 
 
 
 
 
 
 
 
 
130
  function bp_core_install_friends() {
131
-
132
  $sql = array();
133
  $charset_collate = bp_core_set_charset();
134
  $bp_prefix = bp_core_get_table_prefix();
135
 
136
  $sql[] = "CREATE TABLE {$bp_prefix}bp_friends (
137
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
138
- initiator_user_id bigint(20) NOT NULL,
139
- friend_user_id bigint(20) NOT NULL,
140
- is_confirmed bool DEFAULT 0,
141
- is_limited bool DEFAULT 0,
142
- date_created datetime NOT NULL,
143
- KEY initiator_user_id (initiator_user_id),
144
- KEY friend_user_id (friend_user_id)
145
- ) {$charset_collate};";
146
 
147
  dbDelta( $sql );
148
  }
149
 
 
 
 
 
 
 
 
 
 
150
  function bp_core_install_groups() {
151
-
152
  $sql = array();
153
  $charset_collate = bp_core_set_charset();
154
  $bp_prefix = bp_core_get_table_prefix();
155
 
156
  $sql[] = "CREATE TABLE {$bp_prefix}bp_groups (
157
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
158
  creator_id bigint(20) NOT NULL,
159
- name varchar(100) NOT NULL,
160
- slug varchar(200) NOT NULL,
161
- description longtext NOT NULL,
162
  status varchar(10) NOT NULL DEFAULT 'public',
163
  enable_forum tinyint(1) NOT NULL DEFAULT '1',
164
  date_created datetime NOT NULL,
165
- KEY creator_id (creator_id),
166
- KEY status (status)
167
- ) {$charset_collate};";
168
 
169
  $sql[] = "CREATE TABLE {$bp_prefix}bp_groups_members (
170
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
171
  group_id bigint(20) NOT NULL,
172
  user_id bigint(20) NOT NULL,
173
  inviter_id bigint(20) NOT NULL,
@@ -182,10 +239,10 @@ function bp_core_install_groups() {
182
  KEY group_id (group_id),
183
  KEY is_admin (is_admin),
184
  KEY is_mod (is_mod),
185
- KEY user_id (user_id),
186
  KEY inviter_id (inviter_id),
187
  KEY is_confirmed (is_confirmed)
188
- ) {$charset_collate};";
189
 
190
  $sql[] = "CREATE TABLE {$bp_prefix}bp_groups_groupmeta (
191
  id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -194,54 +251,71 @@ function bp_core_install_groups() {
194
  meta_value longtext DEFAULT NULL,
195
  KEY group_id (group_id),
196
  KEY meta_key (meta_key)
197
- ) {$charset_collate};";
198
 
199
  dbDelta( $sql );
200
  }
201
 
 
 
 
 
 
 
 
 
 
202
  function bp_core_install_private_messaging() {
203
-
204
  $sql = array();
205
  $charset_collate = bp_core_set_charset();
206
  $bp_prefix = bp_core_get_table_prefix();
207
 
208
  $sql[] = "CREATE TABLE {$bp_prefix}bp_messages_messages (
209
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
210
- thread_id bigint(20) NOT NULL,
211
- sender_id bigint(20) NOT NULL,
212
- subject varchar(200) NOT NULL,
213
- message longtext NOT NULL,
214
- date_sent datetime NOT NULL,
215
- KEY sender_id (sender_id),
216
- KEY thread_id (thread_id)
217
- ) {$charset_collate};";
218
 
219
  $sql[] = "CREATE TABLE {$bp_prefix}bp_messages_recipients (
220
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
221
- user_id bigint(20) NOT NULL,
222
- thread_id bigint(20) NOT NULL,
223
- unread_count int(10) NOT NULL DEFAULT '0',
224
  sender_only tinyint(1) NOT NULL DEFAULT '0',
225
  is_deleted tinyint(1) NOT NULL DEFAULT '0',
226
- KEY user_id (user_id),
227
- KEY thread_id (thread_id),
228
  KEY is_deleted (is_deleted),
229
  KEY sender_only (sender_only),
230
- KEY unread_count (unread_count)
231
- ) {$charset_collate};";
232
 
233
  $sql[] = "CREATE TABLE {$bp_prefix}bp_messages_notices (
234
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
235
- subject varchar(200) NOT NULL,
236
- message longtext NOT NULL,
237
- date_sent datetime NOT NULL,
238
  is_active tinyint(1) NOT NULL DEFAULT '0',
239
- KEY is_active (is_active)
240
- ) {$charset_collate};";
241
 
242
  dbDelta( $sql );
243
  }
244
 
 
 
 
 
 
 
 
 
 
245
  function bp_core_install_extended_profiles() {
246
  global $wpdb;
247
 
@@ -259,43 +333,43 @@ function bp_core_install_extended_profiles() {
259
  }
260
 
261
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
262
- id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
263
- name varchar(150) NOT NULL,
264
- description mediumtext NOT NULL,
265
- group_order bigint(20) NOT NULL DEFAULT '0',
266
- can_delete tinyint(1) NOT NULL,
267
- KEY can_delete (can_delete)
268
- ) {$charset_collate};";
269
 
270
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_fields (
271
- id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
272
- group_id bigint(20) unsigned NOT NULL,
273
- parent_id bigint(20) unsigned NOT NULL,
274
- type varchar(150) NOT NULL,
275
- name varchar(150) NOT NULL,
276
- description longtext NOT NULL,
277
- is_required tinyint(1) NOT NULL DEFAULT '0',
278
- is_default_option tinyint(1) NOT NULL DEFAULT '0',
279
- field_order bigint(20) NOT NULL DEFAULT '0',
280
- option_order bigint(20) NOT NULL DEFAULT '0',
281
- order_by varchar(15) NOT NULL DEFAULT '',
282
- can_delete tinyint(1) NOT NULL DEFAULT '1',
283
- KEY group_id (group_id),
284
- KEY parent_id (parent_id),
285
- KEY field_order (field_order),
286
- KEY can_delete (can_delete),
287
- KEY is_required (is_required)
288
- ) {$charset_collate};";
289
 
290
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_data (
291
- id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
292
- field_id bigint(20) unsigned NOT NULL,
293
- user_id bigint(20) unsigned NOT NULL,
294
- value longtext NOT NULL,
295
- last_updated datetime NOT NULL,
296
- KEY field_id (field_id),
297
- KEY user_id (user_id)
298
- ) {$charset_collate};";
299
 
300
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_meta (
301
  id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -305,35 +379,45 @@ function bp_core_install_extended_profiles() {
305
  meta_value longtext DEFAULT NULL,
306
  KEY object_id (object_id),
307
  KEY meta_key (meta_key)
308
- ) {$charset_collate};";
309
 
310
  dbDelta( $sql );
311
 
312
  // Insert the default group and fields
313
  $insert_sql = array();
314
 
315
- if ( !$wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_groups WHERE id = 1" ) )
316
  $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) . ", '', 0 );";
 
317
 
318
- if ( !$wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE id = 1" ) )
319
  $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );";
 
320
 
321
  dbDelta( $insert_sql );
322
  }
323
 
 
 
 
 
 
 
 
 
 
324
  function bp_core_install_blog_tracking() {
325
-
326
  $sql = array();
327
  $charset_collate = bp_core_set_charset();
328
  $bp_prefix = bp_core_get_table_prefix();
329
 
330
  $sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs (
331
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
332
- user_id bigint(20) NOT NULL,
333
- blog_id bigint(20) NOT NULL,
334
- KEY user_id (user_id),
335
- KEY blog_id (blog_id)
336
- ) {$charset_collate};";
337
 
338
  $sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs_blogmeta (
339
  id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -342,7 +426,7 @@ function bp_core_install_blog_tracking() {
342
  meta_value longtext DEFAULT NULL,
343
  KEY blog_id (blog_id),
344
  KEY meta_key (meta_key)
345
- ) {$charset_collate};";
346
 
347
  dbDelta( $sql );
348
  }
@@ -407,6 +491,11 @@ function bp_core_install_signups() {
407
  function bp_core_upgrade_signups() {
408
  global $wpdb;
409
 
 
 
 
 
 
410
  // Never use bp_core_get_table_prefix() for any global users tables
411
  $wpdb->signups = $wpdb->base_prefix . 'signups';
412
 
1
  <?php
2
+
3
  /**
4
  * BuddyPress DB schema
5
  *
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
+ /**
14
+ * Get the DB schema to use for BuddyPress components
15
+ *
16
+ * @since BuddyPress (1.1.0)
17
+ *
18
+ * @global $wpdb $wpdb
19
+ * @return string The default database character-set, if set
20
+ */
21
  function bp_core_set_charset() {
22
  global $wpdb;
23
 
24
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
25
 
 
26
  return !empty( $wpdb->charset ) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : '';
27
  }
28
 
29
+ /**
30
+ * Main installer
31
+ *
32
+ * Can be passed an optional array of components to explicitly run installation
33
+ * routines on, typically the first time a component is activated in Settings.
34
+ *
35
+ * @since BuddyPress (1.0.0)
36
+ *
37
+ * @param array $active_components Components to install
38
+ */
39
  function bp_core_install( $active_components = false ) {
40
 
41
+ // If no components passed, get all the active components from the main site
42
+ if ( empty( $active_components ) ) {
43
  $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
44
+ }
45
 
46
+ // Install Activity Streams even when inactive (to store last_activity data)
 
47
  bp_core_install_activity_streams();
48
 
49
+ // Install the signups table
50
+ bp_core_maybe_install_signups();
51
+
52
  // Notifications
53
+ if ( !empty( $active_components['notifications'] ) ) {
54
  bp_core_install_notifications();
55
+ }
56
 
57
  // Friend Connections
58
+ if ( !empty( $active_components['friends'] ) ) {
59
  bp_core_install_friends();
60
+ }
61
 
62
  // Extensible Groups
63
+ if ( !empty( $active_components['groups'] ) ) {
64
  bp_core_install_groups();
65
+ }
66
 
67
  // Private Messaging
68
+ if ( !empty( $active_components['messages'] ) ) {
69
  bp_core_install_private_messaging();
70
+ }
71
 
72
  // Extended Profiles
73
+ if ( !empty( $active_components['xprofile'] ) ) {
74
  bp_core_install_extended_profiles();
75
+ }
76
 
77
  // Blog tracking
78
+ if ( !empty( $active_components['blogs'] ) ) {
79
  bp_core_install_blog_tracking();
80
+ }
 
 
81
  }
82
 
83
+ /**
84
+ * Install database tables for the Notifications component
85
+ *
86
+ * @since BuddyPress (1.0.0)
87
+ *
88
+ * @uses bp_core_set_charset()
89
+ * @uses bp_core_get_table_prefix()
90
+ * @uses dbDelta()
91
+ */
92
  function bp_core_install_notifications() {
 
93
  $sql = array();
94
  $charset_collate = bp_core_set_charset();
95
  $bp_prefix = bp_core_get_table_prefix();
96
 
97
  $sql[] = "CREATE TABLE {$bp_prefix}bp_notifications (
98
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
99
+ user_id bigint(20) NOT NULL,
100
+ item_id bigint(20) NOT NULL,
101
+ secondary_item_id bigint(20),
102
+ component_name varchar(75) NOT NULL,
103
+ component_action varchar(75) NOT NULL,
104
+ date_notified datetime NOT NULL,
105
+ is_new bool NOT NULL DEFAULT 0,
106
+ KEY item_id (item_id),
107
+ KEY secondary_item_id (secondary_item_id),
108
+ KEY user_id (user_id),
109
+ KEY is_new (is_new),
110
+ KEY component_name (component_name),
111
+ KEY component_action (component_action),
112
+ KEY useritem (user_id,is_new)
113
+ ) {$charset_collate};";
114
 
115
  dbDelta( $sql );
116
  }
117
 
118
+ /**
119
+ * Install database tables for the Activity component
120
+ *
121
+ * @since BuddyPress (1.0.0)
122
+ *
123
+ * @uses bp_core_set_charset()
124
+ * @uses bp_core_get_table_prefix()
125
+ * @uses dbDelta()
126
+ */
127
  function bp_core_install_activity_streams() {
 
128
  $sql = array();
129
  $charset_collate = bp_core_set_charset();
130
  $bp_prefix = bp_core_get_table_prefix();
163
  meta_value longtext DEFAULT NULL,
164
  KEY activity_id (activity_id),
165
  KEY meta_key (meta_key)
166
+ ) {$charset_collate};";
167
 
168
  dbDelta( $sql );
169
  }
170
 
171
+ /**
172
+ * Install database tables for the Notifications component
173
+ *
174
+ * @since BuddyPress (1.0.0)
175
+ *
176
+ * @uses bp_core_set_charset()
177
+ * @uses bp_core_get_table_prefix()
178
+ * @uses dbDelta()
179
+ */
180
  function bp_core_install_friends() {
 
181
  $sql = array();
182
  $charset_collate = bp_core_set_charset();
183
  $bp_prefix = bp_core_get_table_prefix();
184
 
185
  $sql[] = "CREATE TABLE {$bp_prefix}bp_friends (
186
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
187
+ initiator_user_id bigint(20) NOT NULL,
188
+ friend_user_id bigint(20) NOT NULL,
189
+ is_confirmed bool DEFAULT 0,
190
+ is_limited bool DEFAULT 0,
191
+ date_created datetime NOT NULL,
192
+ KEY initiator_user_id (initiator_user_id),
193
+ KEY friend_user_id (friend_user_id)
194
+ ) {$charset_collate};";
195
 
196
  dbDelta( $sql );
197
  }
198
 
199
+ /**
200
+ * Install database tables for the Groups component
201
+ *
202
+ * @since BuddyPress (1.0.0)
203
+ *
204
+ * @uses bp_core_set_charset()
205
+ * @uses bp_core_get_table_prefix()
206
+ * @uses dbDelta()
207
+ */
208
  function bp_core_install_groups() {
 
209
  $sql = array();
210
  $charset_collate = bp_core_set_charset();
211
  $bp_prefix = bp_core_get_table_prefix();
212
 
213
  $sql[] = "CREATE TABLE {$bp_prefix}bp_groups (
214
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
215
  creator_id bigint(20) NOT NULL,
216
+ name varchar(100) NOT NULL,
217
+ slug varchar(200) NOT NULL,
218
+ description longtext NOT NULL,
219
  status varchar(10) NOT NULL DEFAULT 'public',
220
  enable_forum tinyint(1) NOT NULL DEFAULT '1',
221
  date_created datetime NOT NULL,
222
+ KEY creator_id (creator_id),
223
+ KEY status (status)
224
+ ) {$charset_collate};";
225
 
226
  $sql[] = "CREATE TABLE {$bp_prefix}bp_groups_members (
227
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
228
  group_id bigint(20) NOT NULL,
229
  user_id bigint(20) NOT NULL,
230
  inviter_id bigint(20) NOT NULL,
239
  KEY group_id (group_id),
240
  KEY is_admin (is_admin),
241
  KEY is_mod (is_mod),
242
+ KEY user_id (user_id),
243
  KEY inviter_id (inviter_id),
244
  KEY is_confirmed (is_confirmed)
245
+ ) {$charset_collate};";
246
 
247
  $sql[] = "CREATE TABLE {$bp_prefix}bp_groups_groupmeta (
248
  id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
251
  meta_value longtext DEFAULT NULL,
252
  KEY group_id (group_id),
253
  KEY meta_key (meta_key)
254
+ ) {$charset_collate};";
255
 
256
  dbDelta( $sql );
257
  }
258
 
259
+ /**
260
+ * Install database tables for the Messsages component
261
+ *
262
+ * @since BuddyPress (1.0.0)
263
+ *
264
+ * @uses bp_core_set_charset()
265
+ * @uses bp_core_get_table_prefix()
266
+ * @uses dbDelta()
267
+ */
268
  function bp_core_install_private_messaging() {
 
269
  $sql = array();
270
  $charset_collate = bp_core_set_charset();
271
  $bp_prefix = bp_core_get_table_prefix();
272
 
273
  $sql[] = "CREATE TABLE {$bp_prefix}bp_messages_messages (
274
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
275
+ thread_id bigint(20) NOT NULL,
276
+ sender_id bigint(20) NOT NULL,
277
+ subject varchar(200) NOT NULL,
278
+ message longtext NOT NULL,
279
+ date_sent datetime NOT NULL,
280
+ KEY sender_id (sender_id),
281
+ KEY thread_id (thread_id)
282
+ ) {$charset_collate};";
283
 
284
  $sql[] = "CREATE TABLE {$bp_prefix}bp_messages_recipients (
285
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
286
+ user_id bigint(20) NOT NULL,
287
+ thread_id bigint(20) NOT NULL,
288
+ unread_count int(10) NOT NULL DEFAULT '0',
289
  sender_only tinyint(1) NOT NULL DEFAULT '0',
290
  is_deleted tinyint(1) NOT NULL DEFAULT '0',
291
+ KEY user_id (user_id),
292
+ KEY thread_id (thread_id),
293
  KEY is_deleted (is_deleted),
294
  KEY sender_only (sender_only),
295
+ KEY unread_count (unread_count)
296
+ ) {$charset_collate};";
297
 
298
  $sql[] = "CREATE TABLE {$bp_prefix}bp_messages_notices (
299
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
300
+ subject varchar(200) NOT NULL,
301
+ message longtext NOT NULL,
302
+ date_sent datetime NOT NULL,
303
  is_active tinyint(1) NOT NULL DEFAULT '0',
304
+ KEY is_active (is_active)
305
+ ) {$charset_collate};";
306
 
307
  dbDelta( $sql );
308
  }
309
 
310
+ /**
311
+ * Install database tables for the Profiles component
312
+ *
313
+ * @since BuddyPress (1.0.0)
314
+ *
315
+ * @uses bp_core_set_charset()
316
+ * @uses bp_core_get_table_prefix()
317
+ * @uses dbDelta()
318
+ */
319
  function bp_core_install_extended_profiles() {
320
  global $wpdb;
321
 
333
  }
334
 
335
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
336
+ id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
337
+ name varchar(150) NOT NULL,
338
+ description mediumtext NOT NULL,
339
+ group_order bigint(20) NOT NULL DEFAULT '0',
340
+ can_delete tinyint(1) NOT NULL,
341
+ KEY can_delete (can_delete)
342
+ ) {$charset_collate};";
343
 
344
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_fields (
345
+ id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
346
+ group_id bigint(20) unsigned NOT NULL,
347
+ parent_id bigint(20) unsigned NOT NULL,
348
+ type varchar(150) NOT NULL,
349
+ name varchar(150) NOT NULL,
350
+ description longtext NOT NULL,
351
+ is_required tinyint(1) NOT NULL DEFAULT '0',
352
+ is_default_option tinyint(1) NOT NULL DEFAULT '0',
353
+ field_order bigint(20) NOT NULL DEFAULT '0',
354
+ option_order bigint(20) NOT NULL DEFAULT '0',
355
+ order_by varchar(15) NOT NULL DEFAULT '',
356
+ can_delete tinyint(1) NOT NULL DEFAULT '1',
357
+ KEY group_id (group_id),
358
+ KEY parent_id (parent_id),
359
+ KEY field_order (field_order),
360
+ KEY can_delete (can_delete),
361
+ KEY is_required (is_required)
362
+ ) {$charset_collate};";
363
 
364
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_data (
365
+ id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
366
+ field_id bigint(20) unsigned NOT NULL,
367
+ user_id bigint(20) unsigned NOT NULL,
368
+ value longtext NOT NULL,
369
+ last_updated datetime NOT NULL,
370
+ KEY field_id (field_id),
371
+ KEY user_id (user_id)
372
+ ) {$charset_collate};";
373
 
374
  $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_meta (
375
  id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
379
  meta_value longtext DEFAULT NULL,
380
  KEY object_id (object_id),
381
  KEY meta_key (meta_key)
382
+ ) {$charset_collate};";
383
 
384
  dbDelta( $sql );
385
 
386
  // Insert the default group and fields
387
  $insert_sql = array();
388
 
389
+ if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_groups WHERE id = 1" ) ) {
390
  $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) . ", '', 0 );";
391
+ }
392
 
393
+ if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE id = 1" ) ) {
394
  $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );";
395
+ }
396
 
397
  dbDelta( $insert_sql );
398
  }
399
 
400
+ /**
401
+ * Install database tables for the Sites component
402
+ *
403
+ * @since BuddyPress (1.0.0)
404
+ *
405
+ * @uses bp_core_set_charset()
406
+ * @uses bp_core_get_table_prefix()
407
+ * @uses dbDelta()
408
+ */
409
  function bp_core_install_blog_tracking() {
 
410
  $sql = array();
411
  $charset_collate = bp_core_set_charset();
412
  $bp_prefix = bp_core_get_table_prefix();
413
 
414
  $sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs (
415
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
416
+ user_id bigint(20) NOT NULL,
417
+ blog_id bigint(20) NOT NULL,
418
+ KEY user_id (user_id),
419
+ KEY blog_id (blog_id)
420
+ ) {$charset_collate};";
421
 
422
  $sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs_blogmeta (
423
  id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
426
  meta_value longtext DEFAULT NULL,
427
  KEY blog_id (blog_id),
428
  KEY meta_key (meta_key)
429
+ ) {$charset_collate};";
430
 
431
  dbDelta( $sql );
432
  }
491
  function bp_core_upgrade_signups() {
492
  global $wpdb;
493
 
494
+ // Bail if global tables should not be upgraded
495
+ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
496
+ return;
497
+ }
498
+
499
  // Never use bp_core_get_table_prefix() for any global users tables
500
  $wpdb->signups = $wpdb->base_prefix . 'signups';
501
 
bp-core/admin/bp-core-settings.php CHANGED
@@ -49,21 +49,6 @@ function bp_admin_setting_callback_account_deletion() {
49
  <?php
50
  }
51
 
52
- /**
53
- * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over
54
- * to the WP Toolbar.
55
- *
56
- * @since BuddyPress (1.6)
57
- */
58
- function bp_admin_setting_callback_force_buddybar() {
59
- ?>
60
-
61
- <input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( true ) ); ?> />
62
- <label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
63
-
64
- <?php
65
- }
66
-
67
  /** Activity *******************************************************************/
68
 
69
  /**
@@ -117,20 +102,6 @@ function bp_admin_setting_callback_heartbeat() {
117
  <?php
118
  }
119
 
120
- /**
121
- * Sanitization for _bp_force_buddyvar
122
- *
123
- * If upgraded to 1.6 and you chose to keep the BuddyBar, a checkbox asks if you want to switch to
124
- * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function
125
- * to flip the boolean before saving the intval.
126
- *
127
- * @since BuddyPress (1.6)
128
- * @access Private
129
- */
130
- function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
131
- return $value ? 0 : 1;
132
- }
133
-
134
  /**
135
  * Sanitization for bp-disable-blogforum-comments setting
136
  *
49
  <?php
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /** Activity *******************************************************************/
53
 
54
  /**
102
  <?php
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * Sanitization for bp-disable-blogforum-comments setting
107
  *
bp-core/admin/bp-core-tools.php CHANGED
@@ -132,6 +132,16 @@ function bp_admin_repair_list() {
132
  );
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
135
  ksort( $repair_list );
136
 
137
  return (array) apply_filters( 'bp_repair_list', $repair_list );
@@ -238,6 +248,38 @@ function bp_admin_repair_group_count() {
238
  return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
239
  }
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  /**
242
  * Recalculate the total number of active site members.
243
  *
@@ -281,7 +323,6 @@ function bp_admin_tools_feedback( $message, $class = false ) {
281
  switch ( count( $errors ) ) {
282
  case 0:
283
  return false;
284
- break;
285
 
286
  case 1:
287
  $message = '<p>' . $errors[0] . '</p>';
132
  );
133
  }
134
 
135
+ // Blogs:
136
+ // - user blog count
137
+ if ( bp_is_active( 'blogs' ) ) {
138
+ $repair_list[90] = array(
139
+ 'bp-blog-records',
140
+ __( 'Repopulate blogs records', 'buddypress' ),
141
+ 'bp_admin_repair_blog_records',
142
+ );
143
+ }
144
+
145
  ksort( $repair_list );
146
 
147
  return (array) apply_filters( 'bp_repair_list', $repair_list );
248
  return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
249
  }
250
 
251
+ /**
252
+ * Recalculate user-to-blog relationships and useful blog meta data
253
+ *
254
+ * @since BuddyPress (2.1.0)
255
+ *
256
+ * @return array
257
+ */
258
+ function bp_admin_repair_blog_records() {
259
+
260
+ // Description of this tool, dispalyed to the user
261
+ $statement = __( 'Repopulating Blogs records&hellip; %s', 'buddypress' );
262
+
263
+ // Default to failure text
264
+ $result = __( 'Failed!', 'buddypress' );
265
+
266
+ // Default to unrepaired
267
+ $repair = false;
268
+
269
+ // Run function if blogs component is active
270
+ if ( bp_is_active( 'blogs' ) ) {
271
+ $repair = bp_blogs_record_existing_blogs();
272
+ }
273
+
274
+ // Setup success/fail messaging
275
+ if ( true === $repair ) {
276
+ $result = __( 'Complete!', 'buddypress' );
277
+ }
278
+
279
+ // All done!
280
+ return array( 0, sprintf( $statement, $result ) );
281
+ }
282
+
283
  /**
284
  * Recalculate the total number of active site members.
285
  *
323
  switch ( count( $errors ) ) {
324
  case 0:
325
  return false;
 
326
 
327
  case 1:
328
  $message = '<p>' . $errors[0] . '</p>';
bp-core/admin/css/common-rtl.css ADDED
@@ -0,0 +1,432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * CSS that is always loaded when in wp-admin
3
+ *
4
+ * @since BuddyPress (1.6)
5
+ */
6
+
7
+ /* User's Lists
8
+ ------------------------------------------------------------------------------*/
9
+
10
+ body.site-users-php th#role,
11
+ body.users-php th#role,
12
+ body.users_page_bp-signups th#count_sent {
13
+ width: 10%;
14
+ }
15
+
16
+ body.site-users-php th#name,
17
+ body.site-users-php th#email,
18
+ body.users-php th#name,
19
+ body.users-php th#registered,
20
+ body.users-php th#email,
21
+ body.users_page_bp-signups th#name,
22
+ body.users_page_bp-signups th#registered,
23
+ body.users_page_bp-signups th#email,
24
+ body.users_page_bp-signups th#date_sent {
25
+ width: 15%;
26
+ }
27
+
28
+ body.users-php th#blogs,
29
+ body.users_page_bp-signups th#blogs {
30
+ width: 20%;
31
+ }
32
+
33
+ body.users_page_bp-signups th.column-count_sent,
34
+ body.users_page_bp-signups td.count_sent {
35
+ text-align: center;
36
+ }
37
+
38
+ /* Icon 32's
39
+ ------------------------------------------------------------------------------*/
40
+
41
+ body.branch-3-6 div#icon-buddypress,
42
+ body.branch-3-7 div#icon-buddypress {
43
+ background: url('../images/icons32.png') no-repeat -370px -6px;
44
+ }
45
+
46
+ body.branch-3-6 div#icon-buddypress-activity,
47
+ body.branch-3-7 div#icon-buddypress-activity {
48
+ background: url('../images/icons32.png') no-repeat -10px -6px;
49
+ }
50
+
51
+ body.branch-3-6 div#icon-buddypress-groups,
52
+ body.branch-3-7 div#icon-buddypress-groups {
53
+ background: url('../images/icons32.png') no-repeat -250px -6px;
54
+ }
55
+
56
+ /* Menu Icons
57
+ ------------------------------------------------------------------------------*/
58
+
59
+ /* Backpat */
60
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,
61
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,
62
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,
63
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image {
64
+ background-image: url('../images/menu.png') !important;
65
+ background-position: -178px -34px;
66
+ }
67
+
68
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,
69
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,
70
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,
71
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,
72
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,
73
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,
74
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,
75
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image {
76
+ background-position: -178px -2px;
77
+ }
78
+
79
+ /* Activity */
80
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,
81
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,
82
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,
83
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image {
84
+ background-image: url('../images/menu.png');
85
+ background-position: 0 -34px;
86
+ }
87
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,
88
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,
89
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,
90
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,
91
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,
92
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,
93
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,
94
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,
95
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,
96
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,
97
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,
98
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image {
99
+ background-position: 0 -2px;
100
+ }
101
+
102
+ /* Groups */
103
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,
104
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,
105
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,
106
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image {
107
+ background-image: url('../images/menu.png');
108
+ background-position: -61px -34px;
109
+ }
110
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,
111
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,
112
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,
113
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,
114
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,
115
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,
116
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,
117
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,
118
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,
119
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,
120
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,
121
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image {
122
+ background-position: -61px -2px;
123
+ }
124
+
125
+ /* Tools */
126
+ #adminmenu .toplevel_page_network-tools div.wp-menu-image:before {
127
+ content: "";
128
+ }
129
+
130
+ /* Components
131
+ ------------------------------------------------------------------------------*/
132
+
133
+ /* Dashicons */
134
+ #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,
135
+ #adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before,
136
+ #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before {
137
+ content: "\f452";
138
+ }
139
+
140
+ #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,
141
+ #adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before,
142
+ #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before {
143
+ content: "\f456";
144
+ }
145
+
146
+ #adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,
147
+ #adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before,
148
+ #adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before {
149
+ content: "\f439";
150
+ }
151
+
152
+ #adminmenu #toplevel_page_bp-messages .wp-menu-image:before,
153
+ #adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before,
154
+ #adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before {
155
+ content: "\f457";
156
+ }
157
+
158
+ #adminmenu #toplevel_page_bp-friends .wp-menu-image:before,
159
+ #adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before,
160
+ #adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before{
161
+ content: "\f454";
162
+ }
163
+
164
+ #adminmenu #toplevel_page_bp-settings .wp-menu-image:before,
165
+ #adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before,
166
+ #adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before {
167
+ content: "\f108";
168
+ }
169
+
170
+ #adminmenu li.toplevel_page_bp-components .wp-menu-image,
171
+ #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image {
172
+ content: "\f448";
173
+ }
174
+
175
+ /* Dashicons overrides for backward compatibility */
176
+ body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,
177
+ body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,
178
+ body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,
179
+ body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,
180
+ body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,
181
+ body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,
182
+ body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,
183
+ body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,
184
+ body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,
185
+ body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,
186
+ body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,
187
+ body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image {
188
+ content: "";
189
+ }
190
+
191
+ /* Settings - Dashicons (WP 3.8+) */
192
+ .settings_page_bp-components td.plugin-title span {
193
+ float: right;
194
+ width: 18px;
195
+ height: 18px;
196
+ margin-left: 5px;
197
+ }
198
+
199
+ .settings_page_bp-components td.plugin-title span:before {
200
+ font-family: 'dashicons';
201
+ font-size: 18px;
202
+ }
203
+
204
+ .settings_page_bp-components tr.activity td.plugin-title span:before {
205
+ content: "\f452";
206
+ }
207
+
208
+ .settings_page_bp-components tr.notifications td.plugin-title span:before {
209
+ content: "\f339";
210
+ }
211
+
212
+ .settings_page_bp-components tr.xprofile td.plugin-title span:before {
213
+ content: "\f336";
214
+ }
215
+
216
+ .settings_page_bp-components tr.settings td.plugin-title span:before {
217
+ content: "\f108";
218
+ }
219
+
220
+ .settings_page_bp-components tr.groups td.plugin-title span:before {
221
+ content: "\f456";
222
+ }
223
+
224
+ .settings_page_bp-components tr.messages td.plugin-title span:before {
225
+ content: "\f457";
226
+ }
227
+
228
+ .settings_page_bp-components tr.forums td.plugin-title span:before {
229
+ content: "\f452";
230
+ }
231
+
232
+ .settings_page_bp-components tr.blogs td.plugin-title span:before {
233
+ content: "\f120";
234
+ }
235
+
236
+ .settings_page_bp-components tr.friends td.plugin-title span:before {
237
+ content: "\f454";
238
+ }
239
+
240
+ /* Settings - Legacy (< WP 3.8) */
241
+ body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,
242
+ body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,
243
+ body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,
244
+ body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,
245
+ body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,
246
+ body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,
247
+ body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,
248
+ body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,
249
+ body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,
250
+ body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,
251
+ body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,
252
+ body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before,
253
+ body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,
254
+ body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,
255
+ body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,
256
+ body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,
257
+ body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,
258
+ body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before {
259
+ content: "";
260
+ }
261
+
262
+ body.branch-3-6.settings_page_bp-components td.plugin-title span,
263
+ body.branch-3-7.settings_page_bp-components td.plugin-title span {
264
+ background-image: url('../images/menu.png');
265
+ background-position: -4px -40px;
266
+ background-repeat: no-repeat;
267
+ }
268
+
269
+ body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,
270
+ body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span {
271
+ background-position-y: -7px;
272
+ }
273
+
274
+ body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,
275
+ body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span {
276
+ background-position: -4px -40px;
277
+ }
278
+
279
+ body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,
280
+ body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span {
281
+ background-position: -4px -7px;
282
+ }
283
+
284
+ body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,
285
+ body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span {
286
+ background-image: url('../images/menu-wp.png');
287
+ background-position: -305px -40px;
288
+ }
289
+
290
+ body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,
291
+ body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span {
292
+ background-position: -305px -7px;
293
+ }
294
+
295
+ body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,
296
+ body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span {
297
+ background-image: url('../images/menu-wp.png');
298
+ background-position: -334px -40px;
299
+ }
300
+
301
+ body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,
302
+ body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span {
303
+ background-position: -334px -7px;
304
+ }
305
+
306
+ body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,
307
+ body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span {
308
+ background-position: -66px -40px;
309
+ }
310
+
311
+ body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,
312
+ body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span {
313
+ background-position: -66px -7px;
314
+ }
315
+
316
+ body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,
317
+ body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span {
318
+ background-position: -154px -40px;
319
+ }
320
+
321
+ body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,
322
+ body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span {
323
+ background-position: -154px -7px;
324
+ }
325
+
326
+ body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,
327
+ body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span {
328
+ background-image: url('../images/menu-wp.png');
329
+ background-position: -36px -40px;
330
+ }
331
+
332
+ body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,
333
+ body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span {
334
+ background-position: -36px -7px;
335
+ }
336
+
337
+ body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,
338
+ body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span {
339
+ background-position: -125px -40px;
340
+ }
341
+
342
+ body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,
343
+ body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span {
344
+ background-position: -125px -7px;
345
+ }
346
+
347
+ body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,
348
+ body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span {
349
+ background-position: -95px -40px;
350
+ }
351
+
352
+ body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,
353
+ body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span {
354
+ background-position: -95px -7px;
355
+ }
356
+
357
+ body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,
358
+ body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span {
359
+ background-position: -184px -40px;
360
+ }
361
+
362
+ body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,
363
+ body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span {
364
+ background-position: -184px -7px;
365
+ }
366
+
367
+ body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,
368
+ body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span {
369
+ background-position: -36px -40px;
370
+ }
371
+
372
+ body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,
373
+ body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span {
374
+ background-position: -36px -7px;
375
+ }
376
+
377
+ #bp-admin-component-form .widefat th {
378
+ display: table-cell;
379
+ vertical-align: top;
380
+ }
381
+
382
+ /* Version Badge */
383
+
384
+ .bp-badge {
385
+ font: normal 150px/1 'dashicons' !important;
386
+ color: #D84800;
387
+ display: inline-block;
388
+ }
389
+
390
+ .bp-badge:before {
391
+ content: "\f448";
392
+ }
393
+
394
+ .about-wrap .bp-badge {
395
+ position: absolute;
396
+ top: 0;
397
+ left: 0;
398
+ }
399
+
400
+ /* HiDPI
401
+ ------------------------------------------------------------------------------*/
402
+
403
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
404
+
405
+ /* Icon 32 */
406
+ body.branch-3-6 div#icon-buddypress,
407
+ body.branch-3-6 div#icon-buddypress-activity,
408
+ body.branch-3-6 div#icon-buddypress-groups,
409
+ body.branch-3-7 div#icon-buddypress,
410
+ body.branch-3-7 div#icon-buddypress-activity,
411
+ body.branch-3-7 div#icon-buddypress-groups {
412
+ background-image: url('../images/icons64.png');
413
+ background-size: 419px 45px;
414
+ }
415
+
416
+ /* Backpat */
417
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,
418
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,
419
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,
420
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,
421
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,
422
+ body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,
423
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,
424
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,
425
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,
426
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,
427
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,
428
+ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image {
429
+ background-image: url('../images/menu-2x.png') !important;
430
+ background-size: 209px 64px;
431
+ }
432
+ }
bp-core/admin/css/common-rtl.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url(../images/icons32.png) no-repeat -370px -6px}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url(../images/icons32.png) no-repeat -10px -6px}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url(../images/icons32.png) no-repeat -250px -6px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url(../images/menu.png)!important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url(../images/menu.png);background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu.png);background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:400 150px/1 dashicons!important;color:#D84800;display:inline-block}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;left:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url(../images/icons64.png);background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu-2x.png)!important;background-size:209px 64px}}
bp-core/admin/css/common.css CHANGED
@@ -4,6 +4,37 @@
4
  * @since BuddyPress (1.6)
5
  */
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  /* Icon 32's
8
  ------------------------------------------------------------------------------*/
9
 
@@ -96,28 +127,6 @@ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-s
96
  content: "";
97
  }
98
 
99
- th.column-gid {
100
- width: 60px;
101
- }
102
- td.column-gid {
103
- vertical-align: middle;
104
- }
105
- table.bp-group-members th,
106
- table.bp-group-members td {
107
- padding: 5px 0;
108
- }
109
- table.bp-group-members .uid-column {
110
- padding-left: 20px;
111
- padding-right: 20px;
112
- }
113
- table.bp-group-members .uname-column {
114
- width: 70%;
115
- }
116
- table.bp-group-members .urole-column {
117
- padding-left: 20px;
118
- padding-right: 20px;
119
- }
120
-
121
  /* Components
122
  ------------------------------------------------------------------------------*/
123
 
@@ -374,7 +383,7 @@ body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title sp
374
 
375
  .bp-badge {
376
  font: normal 150px/1 'dashicons' !important;
377
- color: #000;
378
  display: inline-block;
379
  }
380
 
@@ -387,10 +396,6 @@ body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title sp
387
  top: 0;
388
  right: 0;
389
  }
390
- body.rtl .about-wrap .bp-badge {
391
- right: auto;
392
- left: 0;
393
- }
394
 
395
  /* HiDPI
396
  ------------------------------------------------------------------------------*/
@@ -424,10 +429,4 @@ body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title sp
424
  background-image: url('../images/menu-2x.png') !important;
425
  background-size: 209px 64px;
426
  }
427
-
428
- /* Badge */
429
- .bp-badge {
430
- background-image: url('../images/badge-2x.png');
431
- background-size: 173px 194px;
432
- }
433
- }
4
  * @since BuddyPress (1.6)
5
  */
6
 
7
+ /* User's Lists
8
+ ------------------------------------------------------------------------------*/
9
+
10
+ body.site-users-php th#role,
11
+ body.users-php th#role,
12
+ body.users_page_bp-signups th#count_sent {
13
+ width: 10%;
14
+ }
15
+
16
+ body.site-users-php th#name,
17
+ body.site-users-php th#email,
18
+ body.users-php th#name,
19
+ body.users-php th#registered,
20
+ body.users-php th#email,
21
+ body.users_page_bp-signups th#name,
22
+ body.users_page_bp-signups th#registered,
23
+ body.users_page_bp-signups th#email,
24
+ body.users_page_bp-signups th#date_sent {
25
+ width: 15%;
26
+ }
27
+
28
+ body.users-php th#blogs,
29
+ body.users_page_bp-signups th#blogs {
30
+ width: 20%;
31
+ }
32
+
33
+ body.users_page_bp-signups th.column-count_sent,
34
+ body.users_page_bp-signups td.count_sent {
35
+ text-align: center;
36
+ }
37
+
38
  /* Icon 32's
39
  ------------------------------------------------------------------------------*/
40
 
127
  content: "";
128
  }
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  /* Components
131
  ------------------------------------------------------------------------------*/
132
 
383
 
384
  .bp-badge {
385
  font: normal 150px/1 'dashicons' !important;
386
+ color: #D84800;
387
  display: inline-block;
388
  }
389
 
396
  top: 0;
397
  right: 0;
398
  }
 
 
 
 
399
 
400
  /* HiDPI
401
  ------------------------------------------------------------------------------*/
429
  background-image: url('../images/menu-2x.png') !important;
430
  background-size: 209px 64px;
431
  }
432
+ }
 
 
 
 
 
 
bp-core/admin/css/common.min.css CHANGED
@@ -1 +1,2 @@
1
- body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url('../images/icons32.png') no-repeat -370px -6px}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url('../images/icons32.png') no-repeat -10px -6px}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url('../images/icons32.png') no-repeat -250px -6px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url('../images/menu.png') !important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url('../images/menu.png');background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url('../images/menu.png');background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}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}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:'dashicons';font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url('../images/menu.png');background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url('../images/menu-wp.png');background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url('../images/menu-wp.png');background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url('../images/menu-wp.png');background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:normal 150px/1 'dashicons' !important;color:#000;display:inline-block}.bp-badge:before{content:"\f448"}.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){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url('../images/icons64.png');background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 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}}
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url(../images/icons32.png) no-repeat -370px -6px}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url(../images/icons32.png) no-repeat -10px -6px}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url(../images/icons32.png) no-repeat -250px -6px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url(../images/menu.png)!important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url(../images/menu.png);background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu.png);background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:400 150px/1 dashicons!important;color:#D84800;display:inline-block}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;right:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url(../images/icons64.png);background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu-2x.png)!important;background-size:209px 64px}}
bp-core/admin/images/icons32.png CHANGED
Binary file
bp-core/admin/images/icons64.png CHANGED
Binary file
bp-core/admin/images/mentions.gif ADDED
Binary file
bp-core/admin/images/menu-2x.png CHANGED
Binary file
bp-core/admin/images/menu-wp.png CHANGED
Binary file
bp-core/admin/images/menu.png CHANGED
Binary file
bp-core/bp-core-actions.php CHANGED
@@ -66,6 +66,7 @@ add_action( 'bp_loaded', 'bp_register_theme_directory', 14 );
66
  */
67
  add_action( 'bp_init', 'bp_core_set_uri_globals', 2 );
68
  add_action( 'bp_init', 'bp_setup_globals', 4 );
 
69
  add_action( 'bp_init', 'bp_setup_nav', 6 );
70
  add_action( 'bp_init', 'bp_setup_title', 8 );
71
  add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 );
66
  */
67
  add_action( 'bp_init', 'bp_core_set_uri_globals', 2 );
68
  add_action( 'bp_init', 'bp_setup_globals', 4 );
69
+ add_action( 'bp_init', 'bp_setup_canonical_stack', 5 );
70
  add_action( 'bp_init', 'bp_setup_nav', 6 );
71
  add_action( 'bp_init', 'bp_setup_title', 8 );
72
  add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 );
bp-core/bp-core-admin.php CHANGED
@@ -334,7 +334,7 @@ class BP_Admin {
334
  if ( bp_is_active( 'xprofile' ) ) {
335
 
336
  // Add the main section
337
- add_settings_section( 'bp_xprofile', __( 'Profile Settings', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
338
 
339
  $avatar_setting = 'bp_xprofile';
340
 
@@ -396,7 +396,7 @@ class BP_Admin {
396
 
397
  if ( ! empty( $avatar_setting ) ) {
398
  // Allow avatar uploads
399
- add_settings_field( 'bp-disable-avatar-uploads', __( 'Avatar Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', $avatar_setting );
400
  register_setting ( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
401
  }
402
  }
@@ -431,7 +431,7 @@ class BP_Admin {
431
  public function modify_plugin_action_links( $links, $file ) {
432
 
433
  // Return normal links if not BuddyPress
434
- if ( plugin_basename( buddypress()->file ) != $file )
435
  return $links;
436
 
437
  // Add a few links to the existing links array
@@ -466,12 +466,16 @@ class BP_Admin {
466
  * @since BuddyPress (1.6.0)
467
  */
468
  public function enqueue_scripts() {
469
-
470
  $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
471
 
472
  $file = $this->css_url . "common{$min}.css";
473
  $file = apply_filters( 'bp_core_admin_common_css', $file );
474
  wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
 
 
 
 
 
475
  }
476
 
477
  /** About *****************************************************************/
@@ -484,21 +488,17 @@ class BP_Admin {
484
  public function about_screen() {
485
  global $wp_rewrite;
486
 
487
- $is_new_install = ! empty( $_GET['is_new_install'] );
488
-
489
  $pretty_permalinks_enabled = ! empty( $wp_rewrite->permalink_structure );
490
-
491
- $image_base = buddypress()->plugin_url . 'bp-core/images/bp20/';
492
-
493
- list( $display_version ) = explode( '-', bp_get_version() ); ?>
494
 
495
  <div class="wrap about-wrap">
496
  <h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1>
497
  <div class="about-text">
498
  <?php if ( $is_new_install ) : ?>
499
- <?php printf( __( 'It&#8217;s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet.', 'buddypress' ), $display_version ); ?>
500
  <?php else : ?>
501
- <?php printf( __( 'Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet.', 'buddypress' ), $display_version ); ?>
502
  <?php endif; ?>
503
  </div>
504
 
@@ -512,120 +512,150 @@ class BP_Admin {
512
  </a>
513
  </h2>
514
 
515
- <?php if ( $is_new_install ) : ?>
516
- <h3><?php _e( 'Getting Started', 'buddypress' ); ?></h3>
517
-
518
- <div class="feature-section">
519
- <h4><?php _e( 'Your Default Setup', 'buddypress' ); ?></h4>
520
-
521
- <?php if ( bp_is_active( 'members' ) && bp_is_active( 'activity' ) && current_user_can( $this->capability ) ) : ?>
522
- <p><?php printf(
523
- __( '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' ),
524
- $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . __( 'Members', 'buddypress' ) . '</a>' : __( 'Members', 'buddypress' ),
525
- $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ) . '">' . __( 'Activity', 'buddypress' ) . '</a>' : __( 'Activity', 'buddypress' ),
526
- bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ),
527
- bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
528
- ); ?></p>
529
-
530
- <?php else : ?>
531
- <p><?php printf(
532
- __( 'BuddyPress&#8217;s powerful features help your users connect and collaborate. Want to explore BP&#8217;s features? Visit the <a href="%s">Components panel</a>.', 'buddypress' ),
533
- bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
534
- ); ?></p>
535
-
536
- <?php endif; ?>
537
-
538
- <h4><?php _e( 'Community and Support', 'buddypress' ); ?></h4>
539
- <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>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
540
  </div>
541
- <hr />
542
 
543
  <?php endif; ?>
544
 
 
 
545
  <div class="changelog">
546
- <h2 class="about-headline-callout"><?php _e( 'Performance Improvements', 'buddypress' ); ?></h2>
547
- <img class="about-overview-img" src="<?php echo $image_base ?>performance.png" alt="Performance improvements in BP 2.0" />
548
- <p><?php esc_html_e( 'Whether your community has tens of members or tens of thousands, we think the performance improvements in BuddyPress 2.0 will knock your socks off. We&#8217;ve slashed our memory footprint and query overhead across the board, with a special focus on the Activity and Members components.', 'buddypress' ) ?></p>
549
- </div>
550
 
551
  <hr />
552
 
553
  <div class="changelog">
554
- <h2 class="about-headline-callout"><?php _e( 'New Administrative Tools', 'buddypress' ); ?></h2>
555
-
556
- <div class="feature-section col two-col">
557
- <div>
558
- <h4><?php esc_html_e( 'Extended Profiles in Admin', 'buddypress' ); ?></h4>
559
- <p><?php esc_html_e( 'Site administrators can edit members&#8217; xProfile data at Dashboard > Users > Extended Profiles.', 'buddypress' ); ?></p>
560
- <img src="<?php echo $image_base ?>admin-xprofile.jpg" style="width:90%" />
561
- </div>
562
 
563
- <div class="last-feature">
564
- <h4><?php esc_html_e( 'Registration Management', 'buddypress' ); ?></h4>
565
- <p><?php esc_html_e( 'Perform common tasks with pending signups - including resending activation emails and manually activating accounts - on the new Pending tab of Dashboard > Users.', 'buddypress' ); ?></p>
566
- <img src="<?php echo $image_base ?>users-pending.jpg" style="width:90%" />
567
  </div>
568
- </div>
569
 
570
- <div class="feature-section col two-col">
571
- <div>
572
- <h4><?php esc_html_e( 'BuddyPress Repair Tools', 'buddypress' ); ?></h4>
573
- <p><?php esc_html_e( 'Dashboard > Tools > BuddyPress contains a number of tools for correcting data that occasionally gets out of sync on BP installs.', 'buddypress' ); ?></p>
574
- <img src="<?php echo $image_base ?>tools-buddypress.jpg" style="width:90%" />
575
  </div>
576
 
577
- <div class="feature-section col two-col">
578
- <h4><?php esc_html_e( 'Mark Spammers in Admin', 'buddypress' ); ?></h4>
579
- <p><?php esc_html_e( 'Admins on non-Multisite installations can now perform spam actions from Dashboard > Users > All Users.', 'buddypress' ); ?></p>
580
- <img src="<?php echo $image_base ?>user-mark-spam.jpg" style="width:90%" />
581
  </div>
582
  </div>
583
-
584
  </div>
585
 
586
  <hr />
587
 
588
  <div class="changelog">
589
- <h2 class="about-headline-callout"><?php esc_html_e( 'A More Dynamic Activity Stream', 'buddypress' ); ?></h2>
590
  <div class="feature-section col two-col">
591
- <div>
592
- <p><?php esc_html_e( 'Spend a lot of time viewing the activity stream? BuddyPress 2.0 automatically lets you know when new items are waiting to be loaded.', 'buddypress' ); ?></p>
593
-
594
- <p><?php esc_html_e( 'The activity stream is better integrated with blog posts, too. Comment on a blog post, and an activity item is posted. Comment on a blog-related activity item, and a blog comment is posted. No more worrying about fractured conversations.', 'buddypress' ) ?></p>
595
-
596
- <p><?php esc_html_e( 'We&#8217;ve also reworked the way that phrases like "Boone posted an update" are handled, so that they&#8217;re always up-to-date and always translatable.', 'buddypress' ) ?></p>
 
 
 
 
 
 
 
 
 
 
597
  </div>
598
 
599
- <div class="feature-section col two-col">
600
- <img src="<?php echo $image_base ?>load-newest.jpg" style="width:90%" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
601
  </div>
602
  </div>
603
  </div>
604
-
605
- <hr />
606
-
607
- <div class="changelog">
608
- <h2 class="about-headline-callout"><?php esc_html_e( 'Developer Tools', 'buddypress' ); ?></h2>
609
-
610
- <p><?php esc_html_e( 'BuddyPress 2.0 is full of new and improved tools for the theme and plugin developer. A few highlights:', 'buddypress' ) ?></p>
611
- <ul>
612
- <li><?php _e( 'The <code>BP_XProfile_Field_Type</code> class makes it a breeze to create new xProfile field types with custom display callbacks, validation, and more.', 'buddypress' ); ?></li>
613
- <li><?php _e( 'Major improvements have taken place with respect to object caching throughout BuddyPress. If you use Memcached, APC, or some other persistent object caching backend on your BuddyPress site, you should notice huge performance boosts.', 'buddypress' ); ?></li>
614
- <li><?php _e( 'Our internal metadata libraries have been rewritten to use WP&#8217;s <code>add_metadata()</code>, <code>update_metadata()</code>, and so on. This means greater consistency and parity between the components when storing and retrieving BuddyPress metadata.', 'buddypress' ); ?></li>
615
- <li><?php printf( __( '<a href="%s">&hellip;and lots more!</a>', 'buddypress' ), 'http://codex.buddypress.org/releases/version-2-0' ); ?></li>
616
- </ul>
617
- </div>
618
-
619
- <hr />
620
-
621
- <?php if ( current_user_can( $this->capability ) ) :?>
622
- <div class="return-to-dashboard">
623
- <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>
624
- </div>
625
- <?php endif ;?>
626
-
627
- </div>
628
-
629
  <?php
630
  }
631
 
@@ -647,18 +677,18 @@ class BP_Admin {
647
  <h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1>
648
  <div class="about-text">
649
  <?php if ( $is_new_install ) : ?>
650
- <?php printf( __( 'It&#8217;s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet.', 'buddypress' ), $display_version ); ?>
651
  <?php else : ?>
652
- <?php printf( __( 'Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet.', 'buddypress' ), $display_version ); ?>
653
  <?php endif; ?>
654
  </div>
655
 
656
  <div class="bp-badge"></div>
657
 
658
  <h2 class="nav-tab-wrapper">
659
- <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
660
  <?php _e( 'What&#8217;s New', 'buddypress' ); ?>
661
- </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">
662
  <?php _e( 'Credits', 'buddypress' ); ?>
663
  </a>
664
  </h2>
@@ -713,59 +743,73 @@ class BP_Admin {
713
  <a href="http://profiles.wordpress.org/henry.wright"><img src="http://0.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60" class="gravatar" alt="Henry Wright" /></a>
714
  <a class="web" href="http://profiles.wordpress.org/henry.wright">Henry Wright</a>
715
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
716
  </ul>
717
 
718
- <h4 class="wp-people-group"><?php _e( 'Contributors to BuddyPress 2.0', 'buddypress' ); ?></h4>
719
  <p class="wp-credits-list">
720
- <a href="https://profiles.wordpress.org/boonebgorges/">boonebgorges</a>,
721
- <a href="https://profiles.wordpress.org/Bowromir/">Bowromir</a>,
722
- <a href="https://profiles.wordpress.org/burakali/">burakali</a>,
723
- <a href="https://profiles.wordpress.org/chouf1/">chouf1</a>,
724
- <a href="https://profiles.wordpress.org/cmmarslender/">cmmarslender</a>,
 
 
 
 
725
  <a href="https://profiles.wordpress.org/danbp/">danbp</a>,
726
- <a href="https://profiles.wordpress.org/dcavins/">dcavins</a>,
727
- <a href="https://profiles.wordpress.org/Denis-de-Bernardy/">Denis-de-Bernardy</a>,
728
- <a href="https://profiles.wordpress.org/DJPaul/">DJPaul</a>,
729
- <a href="https://profiles.wordpress.org/ericlewis/">ericlewis</a>,
730
- <a href="https://profiles.wordpress.org/glyndavidson/">glyndavidson</a>,
731
- <a href="https://profiles.wordpress.org/graham-washbrook/">graham-washbrook</a>,
732
- <a href="https://profiles.wordpress.org/henrywright/">henrywright</a>,
733
- <a href="https://profiles.wordpress.org/henry.wright/">henry.wright</a>,
734
- <a href="https://profiles.wordpress.org/hnla/">hnla</a>,
735
- <a href="https://profiles.wordpress.org/imath/">imath</a>,
736
- <a href="https://profiles.wordpress.org/johnjamesjacoby/">johnjamesjacoby</a>,
737
- <a href="https://profiles.wordpress.org/karmatosed/">karmatosed</a>,
738
  <a href="https://profiles.wordpress.org/lenasterg/">lenasterg</a>,
739
- <a href="https://profiles.wordpress.org/MacPresss/">MacPresss</a>,
740
- <a href="https://profiles.wordpress.org/markoheijnen/">markoheijnen</a>,
741
- <a href="https://profiles.wordpress.org/megainfo/">megainfo</a>,
742
- <a href="https://profiles.wordpress.org/modemlooper/">modemlooper</a>,
743
- <a href="https://profiles.wordpress.org/mpa4hu/">mpa4hu</a>,
744
  <a href="https://profiles.wordpress.org/needle/">needle</a>,
745
- <a href="https://profiles.wordpress.org/netweb/">netweb</a>,
746
- <a href="https://profiles.wordpress.org/ninnypants/">ninnypants</a>,
747
- Pietro Oliva,
748
- <a href="https://profiles.wordpress.org/pross/">pross</a>,
749
  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
750
- <a href="https://profiles.wordpress.org/reactuate/">reactuate</a>,
751
- <a href="https://profiles.wordpress.org/rodrigorznd/">rodrigorznd</a>,
752
- <a href="https://profiles.wordpress.org/rogercoathup/">rogercoathup</a>,
753
- <a href="https://profiles.wordpress.org/rzen/">rzen</a>,
754
- <a href="https://profiles.wordpress.org/SergeyBiryukov/">SergeyBiryukov</a>,
755
  <a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
756
- <a href="https://profiles.wordpress.org/SlothLoveChunk/">SlothLoveChunk</a>,
757
- <a href="https://profiles.wordpress.org/StijnDeWitt/">StijnDeWitt</a>,
758
- <a href="https://profiles.wordpress.org/terraling/">terraling</a>,
759
- <a href="https://profiles.wordpress.org/trishasalas/">trishasalas</a>,
760
- <a href="https://profiles.wordpress.org/tw2113/">tw2113</a>,
761
- <a href="https://profiles.wordpress.org/vanillalounge/">vanillalounge</a>.
 
 
 
 
762
  </p>
763
 
764
- <?php if ( current_user_can( $this->capability ) ) :?>
765
- <div class="return-to-dashboard">
766
- <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>
767
- </div>
768
- <?php endif;?>
 
769
 
770
  </div>
771
 
@@ -782,5 +826,35 @@ endif; // class_exists check
782
  * @uses BP_Admin
783
  */
784
  function bp_admin() {
785
- buddypress()->admin = new BP_Admin();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
786
  }
334
  if ( bp_is_active( 'xprofile' ) ) {
335
 
336
  // Add the main section
337
+ add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
338
 
339
  $avatar_setting = 'bp_xprofile';
340
 
396
 
397
  if ( ! empty( $avatar_setting ) ) {
398
  // Allow avatar uploads
399
+ add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', $avatar_setting );
400
  register_setting ( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
401
  }
402
  }
431
  public function modify_plugin_action_links( $links, $file ) {
432
 
433
  // Return normal links if not BuddyPress
434
+ if ( plugin_basename( buddypress()->basename ) != $file )
435
  return $links;
436
 
437
  // Add a few links to the existing links array
466
  * @since BuddyPress (1.6.0)
467
  */
468
  public function enqueue_scripts() {
 
469
  $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
470
 
471
  $file = $this->css_url . "common{$min}.css";
472
  $file = apply_filters( 'bp_core_admin_common_css', $file );
473
  wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
474
+
475
+ wp_style_add_data( 'bp-admin-common-css', 'rtl', true );
476
+ if ( $min ) {
477
+ wp_style_add_data( 'bp-admin-common-css', 'suffix', $min );
478
+ }
479
  }
480
 
481
  /** About *****************************************************************/
488
  public function about_screen() {
489
  global $wp_rewrite;
490
 
491
+ $is_new_install = ! empty( $_GET['is_new_install'] );
 
492
  $pretty_permalinks_enabled = ! empty( $wp_rewrite->permalink_structure );
493
+ list( $display_version ) = explode( '-', bp_get_version() ); ?>
 
 
 
494
 
495
  <div class="wrap about-wrap">
496
  <h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1>
497
  <div class="about-text">
498
  <?php if ( $is_new_install ) : ?>
499
+ <?php printf( __( 'Thank you for installing BuddyPress! BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
500
  <?php else : ?>
501
+ <?php printf( __( 'Howdy. BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
502
  <?php endif; ?>
503
  </div>
504
 
512
  </a>
513
  </h2>
514
 
515
+ <?php if ( $is_new_install ) : ?>
516
+
517
+ <div id="welcome-panel" class="welcome-panel">
518
+ <div class="welcome-panel-content">
519
+ <h3 style="margin:0"><?php _e( 'Getting Started with BuddyPress', 'buddypress' ); ?></h3>
520
+ <div class="welcome-panel-column-container">
521
+ <div class="welcome-panel-column">
522
+ <h4><?php _e( 'Configure Buddypress', 'buddypress' ); ?></h4>
523
+ <ul>
524
+ <li><?php printf(
525
+ '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Set Up Components', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
526
+ ); ?></li>
527
+ <li><?php printf(
528
+ '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Assign Components to Pages', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), $this->settings_page ) )
529
+ ); ?></li>
530
+ <li><?php printf(
531
+ '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Customize Settings', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), $this->settings_page ) )
532
+ ); ?></li>
533
+ </ul>
534
+ <a class="button button-primary button-hero" style="margin-bottom:20px;margin-top:0;" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Get Started', 'buddypress' ); ?></a>
535
+ </div>
536
+ <div class="welcome-panel-column">
537
+ <h4><?php _e( 'Administration Tools', 'buddypress' ); ?></h4>
538
+ <ul>
539
+ <?php if ( bp_is_active( 'members' ) ) : ?>
540
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ) ); ?></li>
541
+ <?php endif; ?>
542
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ), 'users.php' ) ) ); ?></li>
543
+ <?php if ( bp_is_active( 'activity' ) ) : ?>
544
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ), 'admin.php' ) ) ); ?></li>
545
+ <?php endif; ?>
546
+ <?php if ( bp_is_active( 'groups' ) ) : ?>
547
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) ); ?></li>
548
+ <?php endif; ?>
549
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'tools.php' ) ) ); ?>
550
+ </li>
551
+ </ul>
552
+ </div>
553
+ <div class="welcome-panel-column welcome-panel-last">
554
+ <h4><?php _e( 'Community and Support', 'buddypress' ); ?></h4>
555
+ <p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Looking for help? The <a href="http://codex.buddypress.org/">BuddyPress Codex</a> has you covered.', 'buddypress' ) ?></p>
556
+ <p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Can&#8217;t find what you need? Stop by <a href="http://buddypress.org/support/">our support forums</a>, where active BuddyPress users and developers are waiting to share tips and more.', 'buddypress' ) ?></p>
557
+ </div>
558
+ </div>
559
+ </div>
560
  </div>
 
561
 
562
  <?php endif; ?>
563
 
564
+ <hr />
565
+
566
  <div class="changelog">
567
+ <h2 class="about-headline-callout"><?php _e( 'Revamped @mentions Interface', 'buddypress' ); ?></h2>
568
+ <p><?php _e( 'Forget the old days of trying to remember someone&#8217;s username when you want to @mention them in a conversation! With BuddyPress 2.1, type a <code>@</code> when leaving a status update or commenting on an activity item or blog post, and the new suggestions panel will open.', 'buddypress' ) ?></p>
569
+ <p style="text-align: center"><img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/mentions.gif' ); ?>" alt="<?php esc_attr_e( 'Demo of at-mentions feature', 'buddypress' ); ?>" style="margin-bottom: 20px"></p>
570
+ </div>
571
 
572
  <hr />
573
 
574
  <div class="changelog">
575
+ <h2 class="about-headline-callout"><?php _e( 'Continuous Improvement', 'buddypress' ); ?></h2>
 
 
 
 
 
 
 
576
 
577
+ <div class="feature-section col three-col">
578
+ <div class="col-1">
579
+ <h4><?php esc_html_e( 'New Profile Field Type: URL', 'buddypress' ); ?></h4>
580
+ <p><?php esc_html_e( 'Built to hold the address of another website, this new field type automatically creates a link to that site.', 'buddypress' ); ?></p>
581
  </div>
 
582
 
583
+ <div class="col-2">
584
+ <h4><?php esc_html_e( 'Awesome Translations', 'buddypress' ); ?></h4>
585
+ <p><?php esc_html_e( 'BuddyPress supports high-quality translations that are automatically fetched by WordPress. Many thanks to our translation volunteers for making this possible.', 'buddypress' ); ?></p>
 
 
586
  </div>
587
 
588
+ <div class="col-3 last-feature">
589
+ <h4><?php esc_html_e( 'Performance Improvements', 'buddypress' ); ?></h4>
590
+ <p><?php _e( 'Like we do with every release, we&#8217ve made further optimizations to increase BuddyPress&#8217 performance and reduce its query overhead.', 'buddypress' ); ?></p>
 
591
  </div>
592
  </div>
 
593
  </div>
594
 
595
  <hr />
596
 
597
  <div class="changelog">
598
+ <h2 class="about-headline-callout"><?php esc_html_e( 'Enhancements for Plugin &amp; Theme Developers', 'buddypress' ); ?></h2>
599
  <div class="feature-section col two-col">
600
+ <div class="col-1">
601
+ <p><?php _e( 'If you&#8217re a plugin developer, or make custom themes, or want to contribute back to the BuddyPress project, here&#8217s what you should know about this release:', 'buddypress' ); ?></p>
602
+ <p><?php _e( 'If you&#8217ve used BuddyPress for a very long time, you might remember the <em>BuddyBar</em>; it was our toolbar before WordPress had its own toolbar. We started to deprecate it in BuddyPress 1.6. It is now formally deprecated, which means you should not use it for new sites.', 'buddypress' ); ?></p>
603
+ <p>
604
+ <?php printf(
605
+ __( 'The classic <a href="%s">BP Default theme has moved to Github</a>. We moved it because BuddyPress development is now focused on our <a href="%s">theme compatibility</a> templates, which were introduced in BuddyPress 1.7. Don&#8217t worry, BP-Default is still bundled with BuddyPress releases.', 'buddypress' ),
606
+ esc_url( 'https://github.com/buddypress/BP-Default' ),
607
+ esc_url( 'http://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/' )
608
+ ); ?>
609
+ </p>
610
+ <p>
611
+ <?php
612
+ /* translators: don't translate the insides of the <code> block */
613
+ _e( 'In BuddyPress 2.0, we added a new <code>BP_XProfile_Field_Type</code> API for managing profile field types. In this release, we&#8217ve added a new <code>bp_core_get_suggestions</code> API which powers our new @mentions interface. Both are cool, and are worth checking out.', 'buddypress' );
614
+ ?>
615
+ </p>
616
  </div>
617
 
618
+ <div class="col-2 last-feature">
619
+ <p><?php esc_html_e( 'Other interesting changes:', 'buddypress' ); ?>
620
+
621
+ <ul>
622
+ <li>
623
+ <?php
624
+ /* translators: don't translate the insides of the <code> block */
625
+ _e( 'In <code>BP_Group_Extension</code>, the <code>visibility</code> and <code>enable_nav_item</code> properties have been phased out in favor of new <code>access</code> and <code>show_tab</code> parameters.', 'buddypress' );
626
+ ?>
627
+ </li>
628
+ <li>
629
+ <?php
630
+ /* translators: don't translate the insides of the <code> block */
631
+ _e( 'A new <code>group_activity</code> sort order has been added for Groups queries, to let you query for recently active members.', 'buddypress' );
632
+ ?>
633
+ </li>
634
+ <li>
635
+ <?php
636
+ /* translators: don't translate the insides of the <code> block */
637
+ _e( 'Extra CSS classes have been added to Profile Field visibility field elements, allowing greater CSS customization.', 'buddypress' );
638
+ ?>
639
+ </li>
640
+ <li>
641
+ <?php
642
+ /* translators: don't translate the insides of the <code> block */
643
+ _e( 'A <code>no_access_url</code> parameter has been added to <code>bp_core_new_subnav_item()</code>. This allows you to set the URL that users are redirected to when they do not have permission to access a sub-navigation item.', 'buddypress' );
644
+ ?>
645
+ </li>
646
+ <li>
647
+ <?php
648
+ /* translators: don't translate the insides of the <code> block */
649
+ _e( 'When making searches with <code>BP_User_Query</code>, a new <code>search_wildcard</code> parameter gives you finer control over how the search SQL is constructed.', 'buddypress' );
650
+ ?>
651
+ </li>
652
+
653
+
654
+ <li><?php printf( __( '<a href="%s">&hellip;and lots more!</a>', 'buddypress' ), 'https://codex.buddypress.org/releases/version-2-1' ); ?></li>
655
+ </ul>
656
  </div>
657
  </div>
658
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  <?php
660
  }
661
 
677
  <h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1>
678
  <div class="about-text">
679
  <?php if ( $is_new_install ) : ?>
680
+ <?php printf( __( 'Thank you for installing BuddyPress! BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
681
  <?php else : ?>
682
+ <?php printf( __( 'Howdy. BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
683
  <?php endif; ?>
684
  </div>
685
 
686
  <div class="bp-badge"></div>
687
 
688
  <h2 class="nav-tab-wrapper">
689
+ <a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>">
690
  <?php _e( 'What&#8217;s New', 'buddypress' ); ?>
691
+ </a><a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>">
692
  <?php _e( 'Credits', 'buddypress' ); ?>
693
  </a>
694
  </h2>
743
  <a href="http://profiles.wordpress.org/henry.wright"><img src="http://0.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60" class="gravatar" alt="Henry Wright" /></a>
744
  <a class="web" href="http://profiles.wordpress.org/henry.wright">Henry Wright</a>
745
  </li>
746
+ <li class="wp-person" id="wp-person-danbp">
747
+ <a href="http://profiles.wordpress.org/danbp"><img src="http://0.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=60" class="gravatar" alt="danbp" /></a>
748
+ <a class="web" href="http://profiles.wordpress.org/danbp">danbp</a>
749
+ </li>
750
+ <li class="wp-person" id="wp-person-shanebp">
751
+ <a href="http://profiles.wordpress.org/shanebp"><img src="http://0.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=60" class="gravatar" alt="shanebp" /></a>
752
+ <a class="web" href="http://profiles.wordpress.org/shanebp">shanebp</a>
753
+ </li>
754
+ <li class="wp-person" id="wp-person-netweb">
755
+ <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
756
+ <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
757
+ </li>
758
  </ul>
759
 
760
+ <h4 class="wp-people-group"><?php printf( __( 'Contributors to BuddyPress %s', 'buddypress' ), $display_version ); ?></h4>
761
  <p class="wp-credits-list">
762
+ <a href="https://profiles.wordpress.org/adamt19/">adamt19</a>,
763
+ <a href="https://profiles.wordpress.org/Viper007Bond/">Alex Mills (Viper007Bond)</a>,
764
+ <a href="https://profiles.wordpress.org/allendav/">allendav</a>,
765
+ <a href="https://profiles.wordpress.org/alternatekev/">alternatekev</a>,
766
+ <a href="https://profiles.wordpress.org/automattic/">Automattic</a>,
767
+ <a href="https://profiles.wordpress.org/beaulebens/">Beau Lebens (beaulebens)</a>,
768
+ <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
769
+ <a href="https://profiles.wordpress.org/williamsba1/">Brad Williams (williamsba1)</a>,
770
+ <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
771
  <a href="https://profiles.wordpress.org/danbp/">danbp</a>,
772
+ <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
773
+ <a href="https://profiles.wordpress.org/ebellempire/">Erin B. (ebellempire)</a>,
774
+ <a href="https://profiles.wordpress.org/esroyo/">esroyo</a>,
775
+ <a href="https://profiles.wordpress.org/godavid33">godavid33</a>,
776
+ <a href="http://profiles.wordpress.org/henry.wright">Henry Wright (henry.wright)</a>,
777
+ <a href="https://profiles.wordpress.org/hnla/">Hugo (hnla)</a>,
778
+ <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
779
+ <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
780
+ <a href="https://profiles.wordpress.org/jconti/">Jose Conti (jconti)</a>,
781
+ <a href="https://profiles.wordpress.org/jreeve/">jreeve</a>,
782
+ <a href="https://profiles.wordpress.org/Offereins">Laurens Offereins (Offereins)</a>
 
783
  <a href="https://profiles.wordpress.org/lenasterg/">lenasterg</a>,
784
+ <a href="https://profiles.wordpress.org/mercime/">mercime</a>,
785
+ <a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith (tw2113)</a>,
786
+ <a href="https://profiles.wordpress.org/milesstewart88/">Miles Stewart (milesstewart88)</a>,
 
 
787
  <a href="https://profiles.wordpress.org/needle/">needle</a>,
788
+ <a href="https://profiles.wordpress.org/sooskriszta/">OC2PS (sooskriszta)</a>,
789
+ <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
 
 
790
  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
791
+ <a href="https://profiles.wordpress.org/rogercoathup/">Roger Coathup (rogercoathup)</a>,
792
+ <a href="https://profiles.wordpress.org/pollyplummer/">Sarah Gooding (pollyplummer)</a>,
793
+ <a href="https://profiles.wordpress.org/SGr33n/">Sergio De Falco (SGr33n)</a>,
 
 
794
  <a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
795
+ <a href="https://profiles.wordpress.org/slaFFik/">Slava UA (slaFFik)</a>,
796
+ <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
797
+ <a href="https://profiles.wordpress.org/karmatosed/">Tammie (karmatosed)</a>,
798
+ <a href="https://profiles.wordpress.org/tomdxw/">tomdxw</a>,
799
+ <a href="https://profiles.wordpress.org/treyhunner/">treyhunner</a>,
800
+ <a href="https://profiles.wordpress.org/ubernaut/">ubernaut</a>,
801
+ <a href="https://profiles.wordpress.org/wbajzek/">wbajzek</a>,
802
+ <a href="https://profiles.wordpress.org/WCUADD/">WCUADD</a>,
803
+ <a href="https://profiles.wordpress.org/wpdennis/">wpdennis</a>,
804
+ <a href="https://profiles.wordpress.org/wolfhoundjesse/">wolfhoundjesse</a>.
805
  </p>
806
 
807
+ <h4 class="wp-people-group"><?php _e( 'External Libraries', 'buddypress' ); ?></h4>
808
+ <p class="wp-credits-list">
809
+ <a href="https://github.com/ichord/At.js">At.js</a>,
810
+ <a href="https://github.com/ichord/Caret.js">Caret.js</a>,
811
+ <a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a>.
812
+ </p>
813
 
814
  </div>
815
 
826
  * @uses BP_Admin
827
  */
828
  function bp_admin() {
829
+ buddypress()->admin = new BP_Admin();
830
+ return;
831
+
832
+
833
+ // These are strings we may use to describe maintenance/security releases, where we aim for no new strings.
834
+
835
+ _n_noop( 'Maintenance Release', 'Maintenance Releases', 'buddypress' );
836
+ _n_noop( 'Security Release', 'Security Releases', 'buddypress' );
837
+ _n_noop( 'Maintenance and Security Release', 'Maintenance and Security Releases', 'buddypress' );
838
+
839
+ /* translators: 1: WordPress version number. */
840
+ _n_noop( '<strong>Version %1$s</strong> addressed a security issue.',
841
+ '<strong>Version %1$s</strong> addressed some security issues.',
842
+ 'buddypress' );
843
+
844
+ /* translators: 1: WordPress version number, 2: plural number of bugs. */
845
+ _n_noop( '<strong>Version %1$s</strong> addressed %2$s bug.',
846
+ '<strong>Version %1$s</strong> addressed %2$s bugs.',
847
+ 'buddypress' );
848
+
849
+ /* translators: 1: WordPress version number, 2: plural number of bugs. Singular security issue. */
850
+ _n_noop( '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
851
+ '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.',
852
+ 'buddypress' );
853
+
854
+ /* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
855
+ _n_noop( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
856
+ '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',
857
+ 'buddypress' );
858
+
859
+ __( 'For more information, see <a href="%s">the release notes</a>.', 'buddypress' );
860
  }
bp-core/bp-core-adminbar.php CHANGED
@@ -39,6 +39,12 @@ function bp_admin_bar_my_account_root() {
39
  'class' => 'ab-sub-secondary'
40
  )
41
  ) );
 
 
 
 
 
 
42
  }
43
  }
44
  add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
@@ -70,6 +76,7 @@ function bp_core_load_admin_bar() {
70
 
71
  // Hide the WordPress Toolbar and show the BuddyBar
72
  if ( ! bp_use_wp_admin_bar() ) {
 
73
 
74
  // Keep the WP Toolbar from loading
75
  show_admin_bar( false );
@@ -89,23 +96,35 @@ function bp_core_load_admin_bar() {
89
  add_action( 'init', 'bp_core_load_admin_bar', 9 );
90
 
91
  /**
92
- * Handle the Toolbar CSS.
 
 
 
 
93
  *
94
  * @since BuddyPress (1.5.0)
95
  */
96
  function bp_core_load_admin_bar_css() {
97
- global $wp_styles;
98
-
99
- if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() )
100
- return;
101
 
102
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 
 
 
 
 
 
 
 
103
 
104
- // Toolbar styles
105
- $stylesheet = buddypress()->plugin_url . "bp-core/css/admin-bar{$min}.css";
 
 
 
106
 
107
- wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() );
108
- $wp_styles->add_data( 'bp-admin-bar', 'rtl', true );
109
- if ( $min )
110
- $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min );
111
- }
39
  'class' => 'ab-sub-secondary'
40
  )
41
  ) );
42
+
43
+ // Remove 'Edit' post link as it's not applicable to BP
44
+ // Remove when https://core.trac.wordpress.org/ticket/29538 is addressed
45
+ if ( is_buddypress() ) {
46
+ $wp_admin_bar->remove_node( 'edit' );
47
+ }
48
  }
49
  }
50
  add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
76
 
77
  // Hide the WordPress Toolbar and show the BuddyBar
78
  if ( ! bp_use_wp_admin_bar() ) {
79
+ _doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' );
80
 
81
  // Keep the WP Toolbar from loading
82
  show_admin_bar( false );
96
  add_action( 'init', 'bp_core_load_admin_bar', 9 );
97
 
98
  /**
99
+ * Handle the enqueuing of toolbar CSS.
100
+ *
101
+ * This function exists mostly for backwards compatibility reasons, so anyone
102
+ * previously unhooking this function can continue to do so. It's hooked to
103
+ * the `bp_init` action in `bp-core-actions.php`.
104
  *
105
  * @since BuddyPress (1.5.0)
106
  */
107
  function bp_core_load_admin_bar_css() {
108
+ add_action( 'bp_enqueue_scripts', 'bp_core_enqueue_admin_bar_css', 1 );
109
+ add_action( 'bp_admin_enqueue_scripts', 'bp_core_enqueue_admin_bar_css', 1 );
110
+ }
 
111
 
112
+ /**
113
+ * Enqueue supplemental WordPress Toolbar styling
114
+ *
115
+ * @since BuddyPress (2.1.0)
116
+ *
117
+ * @see bp_core_register_common_styles()
118
+ * @see bp_core_load_admin_bar_css()
119
+ */
120
+ function bp_core_enqueue_admin_bar_css() {
121
 
122
+ // Bail if not using WordPress's admin bar or it's not showing on this
123
+ // page request.
124
+ if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) {
125
+ return;
126
+ }
127
 
128
+ // Enqueue the additional adminbar css
129
+ wp_enqueue_style( 'bp-admin-bar' );
130
+ }
 
 
bp-core/bp-core-avatars.php CHANGED
@@ -300,7 +300,7 @@ function bp_core_fetch_avatar( $args = '' ) {
300
 
301
  // Get a fallback for the 'alt' parameter
302
  if ( empty( $alt ) )
303
- $alt = __( 'Avatar Image', 'buddypress' );
304
 
305
  $html_alt = ' alt="' . esc_attr( $alt ) . '"';
306
 
@@ -670,6 +670,15 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
670
  return false;
671
  }
672
 
 
 
 
 
 
 
 
 
 
673
  // Set the url value for the image
674
  $bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir;
675
 
@@ -822,7 +831,11 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = ''
822
 
823
  // If passed an object, assume $user->user_id
824
  if ( is_object( $user ) ) {
825
- $id = $user->user_id;
 
 
 
 
826
 
827
  // If passed a number, assume it was a $user_id
828
  } else if ( is_numeric( $user ) ) {
@@ -840,7 +853,7 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = ''
840
 
841
  // Image alt tag
842
  if ( empty( $alt ) ) {
843
- $alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) );
844
  }
845
 
846
  // Use the 'thumb' type, unless the requested width is bigger than
300
 
301
  // Get a fallback for the 'alt' parameter
302
  if ( empty( $alt ) )
303
+ $alt = __( 'Profile Photo', 'buddypress' );
304
 
305
  $html_alt = ' alt="' . esc_attr( $alt ) . '"';
306
 
670
  return false;
671
  }
672
 
673
+ // If the uploaded image is smaller than the "full" dimensions, throw
674
+ // a warning
675
+ $uploaded_image = @getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir );
676
+ $full_width = bp_core_avatar_full_width();
677
+ $full_height = bp_core_avatar_full_height();
678
+ if ( isset( $uploaded_image[0] ) && $uploaded_image[0] < $full_width || $uploaded_image[1] < $full_height ) {
679
+ bp_core_add_message( sprintf( __( 'You have selected an image that is smaller than recommended. For best results, upload a picture larger than %d x %d pixels.', 'buddypress' ), $full_width, $full_height ), 'error' );
680
+ }
681
+
682
  // Set the url value for the image
683
  $bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir;
684
 
831
 
832
  // If passed an object, assume $user->user_id
833
  if ( is_object( $user ) ) {
834
+ if ( isset( $user->user_id ) ) {
835
+ $id = $user->user_id;
836
+ } else {
837
+ $id = $user->ID;
838
+ }
839
 
840
  // If passed a number, assume it was a $user_id
841
  } else if ( is_numeric( $user ) ) {
853
 
854
  // Image alt tag
855
  if ( empty( $alt ) ) {
856
+ $alt = sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) );
857
  }
858
 
859
  // Use the 'thumb' type, unless the requested width is bigger than
bp-core/bp-core-buddybar.php CHANGED
@@ -259,20 +259,20 @@ add_action( 'admin_head', 'bp_core_sort_nav_items' );
259
  function bp_core_new_subnav_item( $args = '' ) {
260
  global $bp;
261
 
262
- $defaults = array(
263
  'name' => false, // Display name for the nav item
264
  'slug' => false, // URL slug for the nav item
265
  'parent_slug' => false, // URL slug of the parent nav item
266
  'parent_url' => false, // URL of the parent item
267
  'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item
268
  'user_has_access' => true, // Can the logged in user see this nav item?
 
269
  'site_admin_only' => false, // Can only site admins see this nav item?
270
  'position' => 90, // Index of where this nav item should be positioned
271
  'screen_function' => false, // The name of the function to run when clicked
272
  'link' => '' // The link for the subnav item; optional, not usually required.
273
- );
274
 
275
- $r = wp_parse_args( $args, $defaults );
276
  extract( $r, EXTR_SKIP );
277
 
278
  // If we don't have the required info we need, don't create this subnav item
@@ -296,15 +296,17 @@ function bp_core_new_subnav_item( $args = '' ) {
296
  if ( empty( $item_css_id ) )
297
  $item_css_id = $slug;
298
 
299
- $bp->bp_options_nav[$parent_slug][$slug] = array(
300
  'name' => $name,
301
  'link' => trailingslashit( $link ),
302
  'slug' => $slug,
303
  'css_id' => $item_css_id,
304
  'position' => $position,
305
  'user_has_access' => $user_has_access,
 
306
  'screen_function' => &$screen_function
307
  );
 
308
 
309
  /**
310
  * The last step is to hook the screen function for the added subnav item. But this only
@@ -330,46 +332,104 @@ function bp_core_new_subnav_item( $args = '' ) {
330
  // If we *do* meet condition (2), then the added subnav item is currently being requested
331
  if ( ( bp_current_action() && bp_is_current_action( $slug ) ) || ( bp_is_user() && ! bp_current_action() && ( $screen_function == $bp->bp_nav[$parent_slug]['screen_function'] ) ) ) {
332
 
333
- // Before hooking the screen function, check user access
334
- if ( !empty( $user_has_access ) ) {
335
- // Add our screen hook if screen function is callable
336
- if ( is_callable( $screen_function ) ) {
337
- add_action( 'bp_screens', $screen_function, 3 );
338
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  } else {
 
 
 
 
 
 
 
 
 
 
340
 
341
- // When the content is off-limits, we handle the situation
342
- // differently depending on whether the current user is logged in
343
- if ( is_user_logged_in() ) {
344
- if ( !bp_is_my_profile() && empty( $bp->bp_nav[$bp->default_component]['show_for_displayed_user'] ) ) {
345
 
346
- // This covers the edge case where the default component is
347
- // a non-public tab, like 'messages'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) {
349
  $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() );
 
350
  } else {
351
  $redirect_to = trailingslashit( bp_displayed_user_domain() . ( 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id ) );
352
  }
353
 
354
  $message = '';
355
- } else {
356
- $message = __( 'You do not have access to this page.', 'buddypress' );
357
- $redirect_to = bp_displayed_user_domain();
358
  }
359
 
360
- // Off-limits to this user. Throw an error and redirect to the displayed user's domain
361
- bp_core_no_access( array(
362
- 'message' => $message,
363
- 'root' => $redirect_to,
364
- 'redirect' => false
365
- ) );
366
-
367
- // Not logged in. Allow the user to log in, and attempt to redirect
368
  } else {
369
- bp_core_no_access();
 
370
  }
 
 
 
 
 
 
 
 
 
 
 
 
371
  }
372
  }
 
 
373
  }
374
 
375
  /**
@@ -496,175 +556,6 @@ function bp_core_reset_subnav_items( $parent_slug ) {
496
  unset( $bp->bp_options_nav[$parent_slug] );
497
  }
498
 
499
- /** BuddyBar Template functions ***********************************************/
500
-
501
- /**
502
- * Wrapper function for rendering the BuddyBar.
503
- *
504
- * @return bool|null Returns false if the BuddyBar is disabled.
505
- */
506
- function bp_core_admin_bar() {
507
- global $bp;
508
-
509
- if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
510
- return false;
511
-
512
- if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
513
- return false;
514
-
515
- $bp->doing_admin_bar = true;
516
-
517
- echo '<div id="wp-admin-bar"><div class="padder">';
518
-
519
- // **** Do bp-adminbar-logo Actions ********
520
- do_action( 'bp_adminbar_logo' );
521
-
522
- echo '<ul class="main-nav">';
523
-
524
- // **** Do bp-adminbar-menus Actions ********
525
- do_action( 'bp_adminbar_menus' );
526
-
527
- echo '</ul>';
528
- echo "</div></div><!-- #wp-admin-bar -->\n\n";
529
-
530
- $bp->doing_admin_bar = false;
531
- }
532
-
533
- /**
534
- * Output the BuddyBar logo.
535
- */
536
- function bp_adminbar_logo() {
537
- echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';
538
- }
539
-
540
- /**
541
- * Output the "Log In" and "Sign Up" names to the BuddyBar.
542
- *
543
- * Visible only to visitors who are not logged in.
544
- *
545
- * @return bool|null Returns false if the current user is logged in.
546
- */
547
- function bp_adminbar_login_menu() {
548
-
549
- if ( is_user_logged_in() )
550
- return false;
551
-
552
- echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
553
-
554
- // Show "Sign Up" link if user registrations are allowed
555
- if ( bp_get_signup_allowed() )
556
- echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
557
- }
558
-
559
- /**
560
- * Output the My Account BuddyBar menu.
561
- *
562
- * @return bool|null Returns false on failure.
563
- */
564
- function bp_adminbar_account_menu() {
565
- global $bp;
566
-
567
- if ( !$bp->bp_nav || !is_user_logged_in() )
568
- return false;
569
-
570
- echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
571
- echo __( 'My Account', 'buddypress' ) . '</a>';
572
- echo '<ul>';
573
-
574
- // Loop through each navigation item
575
- $counter = 0;
576
- foreach( (array) $bp->bp_nav as $nav_item ) {
577
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
578
-
579
- if ( -1 == $nav_item['position'] )
580
- continue;
581
-
582
- echo '<li' . $alt . '>';
583
- echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
584
-
585
- if ( isset( $bp->bp_options_nav[$nav_item['slug']] ) && is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {
586
- echo '<ul>';
587
- $sub_counter = 0;
588
-
589
- foreach( (array) $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
590
- $link = $subnav_item['link'];
591
- $name = $subnav_item['name'];
592
-
593
- if ( bp_displayed_user_domain() )
594
- $link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );
595
-
596
- if ( isset( $bp->displayed_user->userdata->user_login ) )
597
- $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
598
-
599
- $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
600
- echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
601
- $sub_counter++;
602
- }
603
- echo '</ul>';
604
- }
605
-
606
- echo '</li>';
607
-
608
- $counter++;
609
- }
610
-
611
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
612
-
613
- echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( home_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
614
- echo '</ul>';
615
- echo '</li>';
616
- }
617
-
618
- function bp_adminbar_thisblog_menu() {
619
- if ( current_user_can( 'edit_posts' ) ) {
620
- echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
621
- _e( 'Dashboard', 'buddypress' );
622
- echo '</a>';
623
- echo '<ul>';
624
-
625
- echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
626
- echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
627
- echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
628
-
629
- do_action( 'bp_adminbar_thisblog_items' );
630
-
631
- echo '</ul>';
632
- echo '</li>';
633
- }
634
- }
635
-
636
- /**
637
- * Output the Random BuddyBar menu.
638
- *
639
- * Not visible for logged-in users.
640
- */
641
- function bp_adminbar_random_menu() {
642
- ?>
643
-
644
- <li class="align-right" id="bp-adminbar-visitrandom-menu">
645
- <a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
646
- <ul class="random-list">
647
- <li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '?random-member' ?>" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
648
-
649
- <?php if ( bp_is_active( 'groups' ) ) : ?>
650
-
651
- <li class="alt"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '?random-group' ?>" rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
652
-
653
- <?php endif; ?>
654
-
655
- <?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
656
-
657
- <li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '?random-blog' ?>" rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
658
-
659
- <?php endif; ?>
660
-
661
- <?php do_action( 'bp_adminbar_random_menu' ) ?>
662
-
663
- </ul>
664
- </li>
665
-
666
- <?php
667
- }
668
 
669
  /**
670
  * Retrieve the Toolbar display preference of a user based on context.
@@ -687,27 +578,3 @@ function bp_get_admin_bar_pref( $context, $user = 0 ) {
687
 
688
  return 'true' === $pref;
689
  }
690
-
691
- /**
692
- * Enqueue the BuddyBar CSS.
693
- */
694
- function bp_core_load_buddybar_css() {
695
- global $wp_styles;
696
-
697
- 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 ) )
698
- return;
699
-
700
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
701
-
702
- if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility
703
- $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
704
- } else {
705
- $stylesheet = buddypress()->plugin_url . "bp-core/css/buddybar{$min}.css";
706
- }
707
-
708
- wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );
709
- $wp_styles->add_data( 'bp-admin-bar', 'rtl', true );
710
- if ( $min )
711
- $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min );
712
- }
713
- add_action( 'bp_init', 'bp_core_load_buddybar_css' );
259
  function bp_core_new_subnav_item( $args = '' ) {
260
  global $bp;
261
 
262
+ $r = wp_parse_args( $args, array(
263
  'name' => false, // Display name for the nav item
264
  'slug' => false, // URL slug for the nav item
265
  'parent_slug' => false, // URL slug of the parent nav item
266
  'parent_url' => false, // URL of the parent item
267
  'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item
268
  'user_has_access' => true, // Can the logged in user see this nav item?
269
+ 'no_access_url' => '',
270
  'site_admin_only' => false, // Can only site admins see this nav item?
271
  'position' => 90, // Index of where this nav item should be positioned
272
  'screen_function' => false, // The name of the function to run when clicked
273
  'link' => '' // The link for the subnav item; optional, not usually required.
274
+ ) );
275
 
 
276
  extract( $r, EXTR_SKIP );
277
 
278
  // If we don't have the required info we need, don't create this subnav item
296
  if ( empty( $item_css_id ) )
297
  $item_css_id = $slug;
298
 
299
+ $subnav_item = array(
300
  'name' => $name,
301
  'link' => trailingslashit( $link ),
302
  'slug' => $slug,
303
  'css_id' => $item_css_id,
304
  'position' => $position,
305
  'user_has_access' => $user_has_access,
306
+ 'no_access_url' => $no_access_url,
307
  'screen_function' => &$screen_function
308
  );
309
+ $bp->bp_options_nav[$parent_slug][$slug] = $subnav_item;
310
 
311
  /**
312
  * The last step is to hook the screen function for the added subnav item. But this only
332
  // If we *do* meet condition (2), then the added subnav item is currently being requested
333
  if ( ( bp_current_action() && bp_is_current_action( $slug ) ) || ( bp_is_user() && ! bp_current_action() && ( $screen_function == $bp->bp_nav[$parent_slug]['screen_function'] ) ) ) {
334
 
335
+ $hooked = bp_core_maybe_hook_new_subnav_screen_function( $subnav_item );
336
+
337
+ // If redirect args have been returned, perform the redirect now
338
+ if ( ! empty( $hooked['status'] ) && 'failure' === $hooked['status'] && isset( $hooked['redirect_args'] ) ) {
339
+ bp_core_no_access( $hooked['redirect_args'] );
340
+ }
341
+ }
342
+ }
343
+
344
+ /**
345
+ * For a given subnav item, either hook the screen function or generate redirect arguments, as necessary.
346
+ *
347
+ * @since BuddyPress (2.1.0)
348
+ *
349
+ * @param array $subnav_item The subnav array added to bp_options_nav in
350
+ * bp_core_new_subnav_item().
351
+ * @return array
352
+ */
353
+ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) {
354
+ $retval = array(
355
+ 'status' => '',
356
+ );
357
+
358
+ // User has access, so let's try to hook the display callback
359
+ if ( ! empty( $subnav_item['user_has_access'] ) ) {
360
+
361
+ // Screen function is invalid
362
+ if ( ! is_callable( $subnav_item['screen_function'] ) ) {
363
+ $retval['status'] = 'failure';
364
+
365
+ // Success - hook to bp_screens
366
  } else {
367
+ add_action( 'bp_screens', $subnav_item['screen_function'], 3 );
368
+ $retval['status'] = 'success';
369
+ }
370
+
371
+ // User doesn't have access. Determine redirect arguments based on
372
+ // user status
373
+ } else {
374
+ $retval['status'] = 'failure';
375
+
376
+ if ( is_user_logged_in() ) {
377
 
378
+ $bp = buddypress();
 
 
 
379
 
380
+ // If a redirect URL has been passed to the subnav
381
+ // item, respect it
382
+ if ( ! empty( $subnav_item['no_access_url'] ) ) {
383
+ $message = __( 'You do not have access to this page.', 'buddypress' );
384
+ $redirect_to = trailingslashit( $subnav_item['no_access_url'] );
385
+
386
+ // In the case of a user page, we try to assume a
387
+ // redirect URL
388
+ } else if ( bp_is_user() ) {
389
+
390
+ // Redirect to the displayed user's default
391
+ // component, as long as that component is
392
+ // publicly accessible.
393
+ if ( bp_is_my_profile() || ! empty( $bp->bp_nav[ $bp->default_component ]['show_for_displayed_user'] ) ) {
394
+ $message = __( 'You do not have access to this page.', 'buddypress' );
395
+ $redirect_to = bp_displayed_user_domain();
396
+
397
+ // In some cases, the default tab is not accessible to
398
+ // the logged-in user. So we fall back on a tab that we
399
+ // know will be accessible.
400
+ } else {
401
+ // Try 'activity' first
402
  if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) {
403
  $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() );
404
+ // Then try 'profile'
405
  } else {
406
  $redirect_to = trailingslashit( bp_displayed_user_domain() . ( 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id ) );
407
  }
408
 
409
  $message = '';
 
 
 
410
  }
411
 
412
+ // Fall back to the home page
 
 
 
 
 
 
 
413
  } else {
414
+ $message = __( 'You do not have access to this page.', 'buddypress' );
415
+ $redirect_to = bp_get_root_domain();
416
  }
417
+
418
+ $retval['redirect_args'] = array(
419
+ 'message' => $message,
420
+ 'root' => $redirect_to,
421
+ 'redirect' => false,
422
+ );
423
+
424
+ } else {
425
+ // When the user is logged out, pass an empty array
426
+ // This indicates that the default arguments should be
427
+ // used in bp_core_no_access()
428
+ $retval['redirect_args'] = array();
429
  }
430
  }
431
+
432
+ return $retval;
433
  }
434
 
435
  /**
556
  unset( $bp->bp_options_nav[$parent_slug] );
557
  }
558
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
 
560
  /**
561
  * Retrieve the Toolbar display preference of a user based on context.
578
 
579
  return 'true' === $pref;
580
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/bp-core-caps.php CHANGED
@@ -10,6 +10,33 @@
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Add capabilities to WordPress user roles.
15
  *
10
  // Exit if accessed directly
11
  if ( !defined( 'ABSPATH' ) ) exit;
12
 
13
+ /**
14
+ * Return an array of roles from the currently loaded blog
15
+ *
16
+ * WordPress roles are dynamically flipped when calls to switch_to_blog() and
17
+ * restore_current_blog() are made, so we use and trust WordPress core to have
18
+ * loaded the correct results for us here. As enhancements are made to
19
+ * WordPresss's RBAC, so should our capability functions here.
20
+ *
21
+ * @since BuddyPress (2.1.0)
22
+ *
23
+ * @return array
24
+ */
25
+ function bp_get_current_blog_roles() {
26
+ global $wp_roles;
27
+
28
+ // Sanity check on roles global variable
29
+ $roles = isset( $wp_roles->roles )
30
+ ? $wp_roles->roles
31
+ : array();
32
+
33
+ // Apply WordPress core filter to editable roles
34
+ $roles = apply_filters( 'editable_roles', $roles );
35
+
36
+ // Return the editable roles
37
+ return apply_filters( 'bp_get_current_blog_roles', $roles, $wp_roles );
38
+ }
39
+
40
  /**
41
  * Add capabilities to WordPress user roles.
42
  *
bp-core/bp-core-catchuri.php CHANGED
@@ -340,39 +340,58 @@ function bp_core_enable_root_profiles() {
340
  * @return bool|null Returns false on failure.
341
  */
342
  function bp_core_load_template( $templates ) {
343
- global $post, $bp, $wp_query, $wpdb;
344
 
345
- // Determine if the root object WP page exists for this request
346
- // note: get_page_by_path() breaks non-root pages
347
- if ( !empty( $bp->unfiltered_uri_offset ) ) {
348
- if ( !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) ) ) {
349
- return false;
 
350
  }
351
  }
352
 
353
- // Set the root object as the current wp_query-ied item
354
- $object_id = 0;
355
- foreach ( (array) $bp->pages as $page ) {
356
- if ( $page->name == $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) {
357
- $object_id = $page->id;
358
- }
359
- }
360
 
361
- // Make the queried/post object an actual valid page
362
- if ( !empty( $object_id ) ) {
363
- $wp_query->queried_object = get_post( $object_id );
364
- $wp_query->queried_object_id = $object_id;
365
- $post = $wp_query->queried_object;
 
 
 
 
366
  }
367
 
 
 
 
 
 
 
 
368
  // Fetch each template and add the php suffix
369
  $filtered_templates = array();
370
  foreach ( (array) $templates as $template ) {
371
  $filtered_templates[] = $template . '.php';
372
  }
373
 
 
 
 
 
 
 
 
 
 
374
  // Filter the template locations so that plugins can alter where they are located
375
- $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates );
376
  if ( !empty( $located_template ) ) {
377
 
378
  // Template was located, lets set this as a valid page and not a 404.
340
  * @return bool|null Returns false on failure.
341
  */
342
  function bp_core_load_template( $templates ) {
343
+ global $wp_query;
344
 
345
+ // check if BP page belongs to, or is a child of, a BP directory page
346
+ $page_id = false;
347
+ foreach ( (array) buddypress()->pages as $page ) {
348
+ if ( $page->name == buddypress()->unfiltered_uri[buddypress()->unfiltered_uri_offset] ) {
349
+ $page_id = $page->id;
350
+ break;
351
  }
352
  }
353
 
354
+ // Set up reset post args
355
+ $reset_post_args = array(
356
+ 'is_404' => true,
357
+ 'post_status' => 'publish',
358
+ );
 
 
359
 
360
+ // BP page exists - fill in the $wp_query->post object
361
+ //
362
+ // bp_theme_compat_reset_post() looks at the $wp_query->post object to fill in
363
+ // the post globals
364
+ if ( ! empty( $page_id ) ) {
365
+ $wp_query->post = get_post( $page_id );
366
+ $reset_post_args['ID'] = $page_id;
367
+ } else {
368
+ $reset_post_args['ID'] = 0;
369
  }
370
 
371
+ // Reset the post
372
+ bp_theme_compat_reset_post( $reset_post_args );
373
+
374
+ // Set theme compat to false since the reset post function automatically sets
375
+ // theme compat to true
376
+ bp_set_theme_compat_active( false );
377
+
378
  // Fetch each template and add the php suffix
379
  $filtered_templates = array();
380
  foreach ( (array) $templates as $template ) {
381
  $filtered_templates[] = $template . '.php';
382
  }
383
 
384
+ // Only perform template lookup for bp-default themes
385
+ if ( ! bp_use_theme_compat_with_current_theme() ) {
386
+ $template = locate_template( (array) $filtered_templates, false );
387
+
388
+ // Theme compat doesn't require a template lookup
389
+ } else {
390
+ $template = '';
391
+ }
392
+
393
  // Filter the template locations so that plugins can alter where they are located
394
+ $located_template = apply_filters( 'bp_located_template', $template, $filtered_templates );
395
  if ( !empty( $located_template ) ) {
396
 
397
  // Template was located, lets set this as a valid page and not a 404.
bp-core/bp-core-classes.php CHANGED
@@ -30,6 +30,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
30
  * @type string|bool $search_terms Terms to search by. Search happens
31
  * across xprofile fields. Requires XProfile component.
32
  * Default: false.
 
 
 
33
  * @type array|string|bool $include An array or comma-separated list of
34
  * user IDs to which query should be limited.
35
  * Default: false.
@@ -153,6 +156,7 @@ class BP_User_Query {
153
  'page' => 1,
154
  'user_id' => 0,
155
  'search_terms' => false,
 
156
  'include' => false,
157
  'exclude' => false,
158
  'user_ids' => false,
@@ -364,8 +368,26 @@ class BP_User_Query {
364
  // 'search_terms' searches user_login and user_nicename
365
  // xprofile field matches happen in bp_xprofile_bp_user_query_search()
366
  if ( false !== $search_terms ) {
367
- $search_terms_clean = esc_sql( esc_sql( $search_terms ) );
368
- $sql['where']['search'] = "u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE ( user_login LIKE '%{$search_terms_clean}%' OR user_nicename LIKE '%{$search_terms_clean}%' ) )";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  }
370
 
371
  // 'meta_key', 'meta_value' allow usermeta search
@@ -810,9 +832,9 @@ class BP_Core_User {
810
  wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
811
  wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
812
 
813
- $this->avatar = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) );
814
- $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) );
815
- $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) );
816
  $this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), __( 'active %s', 'buddypress' ) );
817
  }
818
 
@@ -967,8 +989,8 @@ class BP_Core_User {
967
  }
968
 
969
  if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) {
970
- $search_terms = esc_sql( like_escape( $search_terms ) );
971
- $sql['where_searchterms'] = "AND spd.value LIKE '%%$search_terms%%'";
972
  }
973
 
974
  if ( !empty( $meta_key ) ) {
@@ -1085,18 +1107,18 @@ class BP_Core_User {
1085
  }
1086
  }
1087
 
1088
- $letter = esc_sql( like_escape( $letter ) );
1089
- $status_sql = bp_core_get_status_sql( 'u.' );
1090
 
1091
  if ( !empty( $exclude ) ) {
1092
- $exclude = implode( ',', wp_parse_id_list( $r['exclude'] ) );
1093
  $exclude_sql = " AND u.id NOT IN ({$exclude})";
1094
  } else {
1095
  $exclude_sql = '';
1096
  }
1097
 
1098
- $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() ) );
1099
- $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() ) );
1100
 
1101
  $total_users = $wpdb->get_var( $total_users_sql );
1102
  $paged_users = $wpdb->get_results( $paged_users_sql );
@@ -1184,11 +1206,11 @@ class BP_Core_User {
1184
  $user_ids = array();
1185
  $pag_sql = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
1186
 
1187
- $search_terms = esc_sql( like_escape( $search_terms ) );
1188
- $status_sql = bp_core_get_status_sql( 'u.' );
1189
 
1190
- $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%{$search_terms}%%' ORDER BY pd.value ASC", $search_terms );
1191
- $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "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 WHERE {$status_sql} AND pd.value LIKE '%%{$search_terms}%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
1192
 
1193
  $total_users = $wpdb->get_var( $total_users_sql );
1194
  $paged_users = $wpdb->get_results( $paged_users_sql );
@@ -1321,40 +1343,35 @@ class BP_Core_User {
1321
  public static function get_last_activity( $user_id ) {
1322
  global $wpdb;
1323
 
1324
- if ( is_array( $user_id ) ) {
1325
- $user_ids = wp_parse_id_list( $user_id );
1326
- } else {
1327
- $user_ids = array( absint( $user_id ) );
1328
- }
1329
 
1330
  if ( empty( $user_ids ) ) {
1331
  return false;
1332
  }
1333
 
1334
- // get cache for single user only
1335
- if ( ! is_array( $user_id ) ) {
1336
- $cache = wp_cache_get( $user_id, 'bp_last_activity' );
1337
-
1338
- if ( false !== $cache ) {
1339
- return $cache;
1340
- }
1341
- }
1342
 
1343
- $bp = buddypress();
 
1344
 
1345
- $user_ids_sql = implode( ',', $user_ids );
1346
- $user_count = count( $user_ids );
1347
 
1348
- $last_activities = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_recorded FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity' AND user_id IN ({$user_ids_sql}) LIMIT {$user_count}", $bp->members->id ) );
 
 
 
 
 
 
 
1349
 
1350
- // Re-key
1351
  $retval = array();
1352
- foreach ( $last_activities as $last_activity ) {
1353
- $retval[ $last_activity->user_id ] = array(
1354
- 'user_id' => $last_activity->user_id,
1355
- 'date_recorded' => $last_activity->date_recorded,
1356
- 'activity_id' => $last_activity->id,
1357
- );
1358
  }
1359
 
1360
  return $retval;
@@ -1379,7 +1396,7 @@ class BP_Core_User {
1379
 
1380
  $activity = self::get_last_activity( $user_id );
1381
 
1382
- if ( ! empty( $activity ) ) {
1383
  $updated = $wpdb->update(
1384
  $table_name,
1385
 
@@ -1436,7 +1453,7 @@ class BP_Core_User {
1436
  )
1437
  );
1438
 
1439
- // setup activity array for caching
1440
  // view the foreach loop in the get_last_activity() method for format
1441
  $activity = array();
1442
  $activity[ $user_id ] = array(
@@ -1447,7 +1464,7 @@ class BP_Core_User {
1447
  }
1448
 
1449
  // set cache
1450
- wp_cache_set( $user_id, $activity, 'bp_last_activity' );
1451
 
1452
  return $updated;
1453
  }
@@ -1490,6 +1507,60 @@ class BP_Core_User {
1490
  }
1491
  }
1492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1493
 
1494
  /**
1495
  * BP_Core_Notification is deprecated.
@@ -1896,13 +1967,22 @@ class BP_Button {
1896
  if ( true == $this->must_be_logged_in && ! is_user_logged_in() )
1897
  return false;
1898
 
1899
- // No button if viewing your own profile
1900
- if ( true == $this->block_self && bp_is_my_profile() )
1901
- return false;
 
 
 
 
 
 
1902
 
1903
- // No button if you are the current user in a loop
1904
- if ( true === $this->block_self && is_user_logged_in() && bp_loggedin_user_id() === bp_get_member_user_id() )
1905
- return false;
 
 
 
1906
 
1907
  // Wrapper properties
1908
  if ( false !== $this->wrapper ) {
@@ -2412,3 +2492,209 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
2412
  $output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="'. esc_attr( $item->xfn ) .'" />';
2413
  }
2414
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  * @type string|bool $search_terms Terms to search by. Search happens
31
  * across xprofile fields. Requires XProfile component.
32
  * Default: false.
33
+ * @type string $search_wildcard When searching with $search_terms,
34
+ * set where wildcards around the term should be positioned.
35
+ * Default: 'both'. Other values: 'left', 'right'.
36
  * @type array|string|bool $include An array or comma-separated list of
37
  * user IDs to which query should be limited.
38
  * Default: false.
156
  'page' => 1,
157
  'user_id' => 0,
158
  'search_terms' => false,
159
+ 'search_wildcard' => 'both',
160
  'include' => false,
161
  'exclude' => false,
162
  'user_ids' => false,
368
  // 'search_terms' searches user_login and user_nicename
369
  // xprofile field matches happen in bp_xprofile_bp_user_query_search()
370
  if ( false !== $search_terms ) {
371
+ $search_terms = bp_esc_like( wp_kses_normalize_entities( $search_terms ) );
372
+
373
+ if ( $search_wildcard === 'left' ) {
374
+ $search_terms_nospace = '%' . $search_terms;
375
+ $search_terms_space = '%' . $search_terms . ' %';
376
+ } elseif ( $search_wildcard === 'right' ) {
377
+ $search_terms_nospace = $search_terms . '%';
378
+ $search_terms_space = '% ' . $search_terms . '%';
379
+ } else {
380
+ $search_terms_nospace = '%' . $search_terms . '%';
381
+ $search_terms_space = '%' . $search_terms . '%';
382
+ }
383
+
384
+ $sql['where']['search'] = $wpdb->prepare(
385
+ "u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE ( user_login LIKE %s OR user_login LIKE %s OR user_nicename LIKE %s OR user_nicename LIKE %s ) )",
386
+ $search_terms_nospace,
387
+ $search_terms_space,
388
+ $search_terms_nospace,
389
+ $search_terms_space
390
+ );
391
  }
392
 
393
  // 'meta_key', 'meta_value' allow usermeta search
832
  wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
833
  wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
834
 
835
+ $this->avatar = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
836
+ $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
837
+ $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) );
838
  $this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), __( 'active %s', 'buddypress' ) );
839
  }
840
 
989
  }
990
 
991
  if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) {
992
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
993
+ $sql['where_searchterms'] = $wpdb->prepare( "AND spd.value LIKE %s", $search_terms_like );
994
  }
995
 
996
  if ( !empty( $meta_key ) ) {
1107
  }
1108
  }
1109
 
1110
+ $letter_like = bp_esc_like( $letter ) . '%';
1111
+ $status_sql = bp_core_get_status_sql( 'u.' );
1112
 
1113
  if ( !empty( $exclude ) ) {
1114
+ $exclude = implode( ',', wp_parse_id_list( $exclude ) );
1115
  $exclude_sql = " AND u.id NOT IN ({$exclude})";
1116
  } else {
1117
  $exclude_sql = '';
1118
  }
1119
 
1120
+ $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 %s ORDER BY pd.value ASC", bp_xprofile_fullname_field_name(), $letter_like ) );
1121
+ $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 %s ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name(), $letter_like ) );
1122
 
1123
  $total_users = $wpdb->get_var( $total_users_sql );
1124
  $paged_users = $wpdb->get_results( $paged_users_sql );
1206
  $user_ids = array();
1207
  $pag_sql = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
1208
 
1209
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
1210
+ $status_sql = bp_core_get_status_sql( 'u.' );
1211
 
1212
+ $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", $search_terms_like ), $search_terms );
1213
+ $paged_users_sql = apply_filters( 'bp_core_search_users_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 WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", $search_terms_like ), $search_terms, $pag_sql );
1214
 
1215
  $total_users = $wpdb->get_var( $total_users_sql );
1216
  $paged_users = $wpdb->get_results( $paged_users_sql );
1343
  public static function get_last_activity( $user_id ) {
1344
  global $wpdb;
1345
 
1346
+ // Sanitize and remove empty values
1347
+ $user_ids = array_filter( wp_parse_id_list( $user_id ) );
 
 
 
1348
 
1349
  if ( empty( $user_ids ) ) {
1350
  return false;
1351
  }
1352
 
1353
+ $uncached_user_ids = bp_get_non_cached_ids( $user_ids, 'bp_last_activity' );
1354
+ if ( ! empty( $uncached_user_ids ) ) {
1355
+ $bp = buddypress();
 
 
 
 
 
1356
 
1357
+ $user_ids_sql = implode( ',', $uncached_user_ids );
1358
+ $user_count = count( $uncached_user_ids );
1359
 
1360
+ $last_activities = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_recorded FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity' AND user_id IN ({$user_ids_sql}) LIMIT {$user_count}", $bp->members->id ) );
 
1361
 
1362
+ foreach ( $last_activities as $last_activity ) {
1363
+ wp_cache_set( $last_activity->user_id, array(
1364
+ 'user_id' => $last_activity->user_id,
1365
+ 'date_recorded' => $last_activity->date_recorded,
1366
+ 'activity_id' => $last_activity->id,
1367
+ ), 'bp_last_activity' );
1368
+ }
1369
+ }
1370
 
1371
+ // Fetch all user data from the cache
1372
  $retval = array();
1373
+ foreach ( $user_ids as $user_id ) {
1374
+ $retval[ $user_id ] = wp_cache_get( $user_id, 'bp_last_activity' );
 
 
 
 
1375
  }
1376
 
1377
  return $retval;
1396
 
1397
  $activity = self::get_last_activity( $user_id );
1398
 
1399
+ if ( ! empty( $activity[ $user_id ] ) ) {
1400
  $updated = $wpdb->update(
1401
  $table_name,
1402
 
1453
  )
1454
  );
1455
 
1456
+ // set up activity array for caching
1457
  // view the foreach loop in the get_last_activity() method for format
1458
  $activity = array();
1459
  $activity[ $user_id ] = array(
1464
  }
1465
 
1466
  // set cache
1467
+ wp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' );
1468
 
1469
  return $updated;
1470
  }
1507
  }
1508
  }
1509
 
1510
+ if ( class_exists( 'WP_Date_Query' ) ) :
1511
+ /**
1512
+ * BuddyPress date query class.
1513
+ *
1514
+ * Extends the {@link WP_Date_Query} class for use with BuddyPress.
1515
+ *
1516
+ * @since BuddyPress (2.1.0)
1517
+ *
1518
+ * @param array $date_query {
1519
+ * Date query arguments. See first parameter of {@link WP_Date_Query::__construct()}.
1520
+ * }
1521
+ * @param string $column The DB column to query against.
1522
+ */
1523
+ class BP_Date_Query extends WP_Date_Query {
1524
+ /**
1525
+ * The column to query against. Can be changed via the query arguments.
1526
+ *
1527
+ * @var string
1528
+ */
1529
+ public $column;
1530
+
1531
+ /**
1532
+ * Constructor.
1533
+ *
1534
+ * @see WP_Date_Query::__construct()
1535
+ */
1536
+ public function __construct( $date_query, $column = '' ) {
1537
+ if ( ! empty( $column ) ) {
1538
+ $this->column = $column;
1539
+ add_filter( 'date_query_valid_columns', array( $this, 'register_date_column' ) );
1540
+ }
1541
+
1542
+ parent::__construct( $date_query, $column );
1543
+ }
1544
+
1545
+ /**
1546
+ * Destructor.
1547
+ */
1548
+ public function __destruct() {
1549
+ remove_filter( 'date_query_valid_columns', array( $this, 'register_date_column' ) );
1550
+ }
1551
+
1552
+ /**
1553
+ * Registers our date column with WP Date Query to pass validation.
1554
+ *
1555
+ * @param array $retval Current DB columns
1556
+ * @return array
1557
+ */
1558
+ public function register_date_column( $retval = array() ) {
1559
+ $retval[] = $this->column;
1560
+ return $retval;
1561
+ }
1562
+ }
1563
+ endif;
1564
 
1565
  /**
1566
  * BP_Core_Notification is deprecated.
1967
  if ( true == $this->must_be_logged_in && ! is_user_logged_in() )
1968
  return false;
1969
 
1970
+ // block_self
1971
+ if ( true == $this->block_self ) {
1972
+ // No button if you are the current user in a members loop
1973
+ // This condition takes precedence, because members loops
1974
+ // can be found on user profiles
1975
+ if ( bp_get_member_user_id() ) {
1976
+ if ( is_user_logged_in() && bp_loggedin_user_id() == bp_get_member_user_id() ) {
1977
+ return false;
1978
+ }
1979
 
1980
+ // No button if viewing your own profile (and not in
1981
+ // a members loop)
1982
+ } else if ( bp_is_my_profile() ) {
1983
+ return false;
1984
+ }
1985
+ }
1986
 
1987
  // Wrapper properties
1988
  if ( false !== $this->wrapper ) {
2492
  $output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="'. esc_attr( $item->xfn ) .'" />';
2493
  }
2494
  }
2495
+
2496
+ /**
2497
+ * Base class for the BuddyPress Suggestions API.
2498
+ *
2499
+ * Originally built to power BuddyPress' at-mentions suggestions, it's flexible enough to be used
2500
+ * for similar kinds of future core requirements, or those desired by third-party developers.
2501
+ *
2502
+ * To implement a new suggestions service, create a new class that extends this one, and update
2503
+ * the list of default services in {@link bp_core_get_suggestions()}. If you're building a plugin,
2504
+ * it's recommend that you use the `bp_suggestions_services` filter to do this. :)
2505
+ *
2506
+ * While the implementation of the query logic is left to you, it should be as quick and efficient
2507
+ * as possible. When implementing the abstract methods in this class, pay close attention to the
2508
+ * recommendations provided in the phpDoc blocks, particularly the expected return types.
2509
+ *
2510
+ * @since BuddyPress (2.1.0)
2511
+ */
2512
+ abstract class BP_Suggestions {
2513
+
2514
+ /**
2515
+ * Default arguments common to all suggestions services.
2516
+ *
2517
+ * If your custom service requires further defaults, add them here.
2518
+ *
2519
+ * @since BuddyPress (2.1.0)
2520
+ * @var array
2521
+ */
2522
+ protected $default_args = array(
2523
+ 'limit' => 16,
2524
+ 'term' => '',
2525
+ 'type' => '',
2526
+ );
2527
+
2528
+ /**
2529
+ * Holds the arguments for the query (about to made to the suggestions service).
2530
+ *
2531
+ * This includes `$default_args`, as well as the user-supplied values.
2532
+ *
2533
+ * @since BuddyPress (2.1.0)
2534
+ * @var array
2535
+ */
2536
+ protected $args = array(
2537
+ );
2538
+
2539
+
2540
+ /**
2541
+ * Constructor.
2542
+ *
2543
+ * @param array $args Optional. If set, used as the parameters for the suggestions service query.
2544
+ * @since BuddyPress (2.1.0)
2545
+ */
2546
+ public function __construct( array $args = array() ) {
2547
+ if ( ! empty( $args ) ) {
2548
+ $this->set_query( $args );
2549
+ }
2550
+ }
2551
+
2552
+ /**
2553
+ * Set the parameters for the suggestions service query.
2554
+ *
2555
+ * @param array $args {
2556
+ * @type int $limit Maximum number of results to display. Optional, default: 16.
2557
+ * @type string $type The name of the suggestion service to use for the request. Mandatory.
2558
+ * @type string $term The suggestion service will try to find results that contain this string.
2559
+ * Mandatory.
2560
+ * }
2561
+ * @since BuddyPress (2.1.0)
2562
+ */
2563
+ public function set_query( array $args = array() ) {
2564
+ $this->args = wp_parse_args( $args, $this->default_args );
2565
+ }
2566
+
2567
+ /**
2568
+ * Validate and sanitise the parameters for the suggestion service query.
2569
+ *
2570
+ * Be sure to call this class' version of this method when implementing it in your own service.
2571
+ * If validation fails, you must return a WP_Error object.
2572
+ *
2573
+ * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
2574
+ * @since BuddyPress (2.1.0)
2575
+ */
2576
+ public function validate() {
2577
+ $this->args['limit'] = absint( $this->args['limit'] );
2578
+ $this->args['term'] = trim( sanitize_text_field( $this->args['term'] ) );
2579
+ $this->args = apply_filters( 'bp_suggestions_args', $this->args, $this );
2580
+
2581
+
2582
+ // Check for invalid or missing mandatory parameters.
2583
+ if ( ! $this->args['limit'] || ! $this->args['term'] ) {
2584
+ return new WP_Error( 'missing_parameter' );
2585
+ }
2586
+
2587
+ // Check for blocked users (e.g. deleted accounts, or spammers).
2588
+ if ( is_user_logged_in() && ! bp_is_user_active( get_current_user_id() ) ) {
2589
+ return new WP_Error( 'invalid_user' );
2590
+ }
2591
+
2592
+ return apply_filters( 'bp_suggestions_validate_args', true, $this );
2593
+ }
2594
+
2595
+ /**
2596
+ * Find and return a list of suggestions that match the query.
2597
+ *
2598
+ * The return type is important. If no matches are found, an empty array must be returned.
2599
+ * Matches must be returned as objects in an array.
2600
+ *
2601
+ * The object format for each match must be: { 'ID': string, 'image': string, 'name': string }
2602
+ * For example: { 'ID': 'admin', 'image': 'http://example.com/logo.png', 'name': 'Name Surname' }
2603
+ *
2604
+ * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
2605
+ * @since BuddyPress (2.1.0)
2606
+ */
2607
+ abstract public function get_suggestions();
2608
+ }
2609
+
2610
+ /**
2611
+ * Adds support for user at-mentions to the Suggestions API.
2612
+ *
2613
+ * This class is in the Core component because it's required by a class in the Groups component,
2614
+ * and Groups is loaded before Members (alphabetical order).
2615
+ *
2616
+ * @since BuddyPress (2.1.0)
2617
+ */
2618
+ class BP_Members_Suggestions extends BP_Suggestions {
2619
+
2620
+ /**
2621
+ * Default arguments for this suggestions service.
2622
+ *
2623
+ * @since BuddyPress (2.1.0)
2624
+ * @var array $args {
2625
+ * @type int $limit Maximum number of results to display. Default: 16.
2626
+ * @type bool $only_friends If true, only match the current user's friends. Default: false.
2627
+ * @type string $term The suggestion service will try to find results that contain this string.
2628
+ * Mandatory.
2629
+ * }
2630
+ */
2631
+ protected $default_args = array(
2632
+ 'limit' => 10,
2633
+ 'only_friends' => false,
2634
+ 'term' => '',
2635
+ 'type' => '',
2636
+ );
2637
+
2638
+
2639
+ /**
2640
+ * Validate and sanitise the parameters for the suggestion service query.
2641
+ *
2642
+ * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
2643
+ * @since BuddyPress (2.1.0)
2644
+ */
2645
+ public function validate() {
2646
+ $this->args['only_friends'] = (bool) $this->args['only_friends'];
2647
+ $this->args = apply_filters( 'bp_members_suggestions_args', $this->args, $this );
2648
+
2649
+ // Check for invalid or missing mandatory parameters.
2650
+ if ( $this->args['only_friends'] && ( ! bp_is_active( 'friends' ) || ! is_user_logged_in() ) ) {
2651
+ return new WP_Error( 'missing_requirement' );
2652
+ }
2653
+
2654
+ return apply_filters( 'bp_members_suggestions_validate_args', parent::validate(), $this );
2655
+ }
2656
+
2657
+ /**
2658
+ * Find and return a list of username suggestions that match the query.
2659
+ *
2660
+ * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
2661
+ * @since BuddyPress (2.1.0)
2662
+ */
2663
+ public function get_suggestions() {
2664
+ $user_query = array(
2665
+ 'count_total' => '', // Prevents total count
2666
+ 'populate_extras' => false,
2667
+ 'type' => 'alphabetical',
2668
+
2669
+ 'page' => 1,
2670
+ 'per_page' => $this->args['limit'],
2671
+ 'search_terms' => $this->args['term'],
2672
+ 'search_wildcard' => 'right',
2673
+ );
2674
+
2675
+ // Only return matches of friends of this user.
2676
+ if ( $this->args['only_friends'] && is_user_logged_in() ) {
2677
+ $user_query['user_id'] = get_current_user_id();
2678
+ }
2679
+
2680
+ $user_query = apply_filters( 'bp_members_suggestions_query_args', $user_query, $this );
2681
+ if ( is_wp_error( $user_query ) ) {
2682
+ return $user_query;
2683
+ }
2684
+
2685
+
2686
+ $user_query = new BP_User_Query( $user_query );
2687
+ $results = array();
2688
+
2689
+ foreach ( $user_query->results as $user ) {
2690
+ $result = new stdClass();
2691
+ $result->ID = $user->user_nicename;
2692
+ $result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
2693
+ $result->name = bp_core_get_user_displayname( $user->ID );
2694
+
2695
+ $results[] = $result;
2696
+ }
2697
+
2698
+ return apply_filters( 'bp_members_suggestions_get_suggestions', $results, $this );
2699
+ }
2700
+ }
bp-core/bp-core-component.php CHANGED
@@ -292,31 +292,30 @@ class BP_Component {
292
  public function includes( $includes = array() ) {
293
 
294
  // Bail if no files to include
295
- if ( empty( $includes ) )
296
- return;
297
-
298
- $slashed_path = trailingslashit( $this->path );
299
-
300
- // Loop through files to be included
301
- foreach ( (array) $includes as $file ) {
302
-
303
- $paths = array(
304
-
305
- // Passed with no extension
306
- 'bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php',
307
- 'bp-' . $this->id . '-' . $file . '.php',
308
- 'bp-' . $this->id . '/' . $file . '.php',
309
-
310
- // Passed with extension
311
- $file,
312
- 'bp-' . $this->id . '-' . $file,
313
- 'bp-' . $this->id . '/' . $file,
314
- );
315
-
316
- foreach ( $paths as $path ) {
317
- if ( @is_file( $slashed_path . $path ) ) {
318
- require( $slashed_path . $path );
319
- break;
320
  }
321
  }
322
  }
@@ -338,6 +337,9 @@ class BP_Component {
338
  // Setup globals
339
  add_action( 'bp_setup_globals', array( $this, 'setup_globals' ), 10 );
340
 
 
 
 
341
  // Include required files. Called early to ensure that BP core
342
  // components are loaded before plugins that hook their loader functions
343
  // to bp_include with the default priority of 10. This is for backwards
@@ -379,6 +381,13 @@ class BP_Component {
379
  do_action( 'bp_' . $this->id . '_setup_actions' );
380
  }
381
 
 
 
 
 
 
 
 
382
  /**
383
  * Set up component navigation.
384
  *
@@ -426,12 +435,14 @@ class BP_Component {
426
  public function setup_admin_bar( $wp_admin_nav = array() ) {
427
 
428
  // Bail if this is an ajax request
429
- if ( defined( 'DOING_AJAX' ) )
430
  return;
 
431
 
432
  // Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false
433
- if ( !bp_use_wp_admin_bar() )
434
  return;
 
435
 
436
  // Filter the passed admin nav
437
  $wp_admin_nav = apply_filters( 'bp_' . $this->id . '_admin_nav', $wp_admin_nav );
292
  public function includes( $includes = array() ) {
293
 
294
  // Bail if no files to include
295
+ if ( ! empty( $includes ) ) {
296
+ $slashed_path = trailingslashit( $this->path );
297
+
298
+ // Loop through files to be included
299
+ foreach ( (array) $includes as $file ) {
300
+
301
+ $paths = array(
302
+
303
+ // Passed with no extension
304
+ 'bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php',
305
+ 'bp-' . $this->id . '-' . $file . '.php',
306
+ 'bp-' . $this->id . '/' . $file . '.php',
307
+
308
+ // Passed with extension
309
+ $file,
310
+ 'bp-' . $this->id . '-' . $file,
311
+ 'bp-' . $this->id . '/' . $file,
312
+ );
313
+
314
+ foreach ( $paths as $path ) {
315
+ if ( @is_file( $slashed_path . $path ) ) {
316
+ require( $slashed_path . $path );
317
+ break;
318
+ }
 
319
  }
320
  }
321
  }
337
  // Setup globals
338
  add_action( 'bp_setup_globals', array( $this, 'setup_globals' ), 10 );
339
 
340
+ // Set up canonical stack
341
+ add_action( 'bp_setup_canonical_stack', array( $this, 'setup_canonical_stack' ), 10 );
342
+
343
  // Include required files. Called early to ensure that BP core
344
  // components are loaded before plugins that hook their loader functions
345
  // to bp_include with the default priority of 10. This is for backwards
381
  do_action( 'bp_' . $this->id . '_setup_actions' );
382
  }
383
 
384
+ /**
385
+ * Set up the canonical URL stack for this component.
386
+ *
387
+ * @since BuddyPress (2.1.0)
388
+ */
389
+ public function setup_canonical_stack() {}
390
+
391
  /**
392
  * Set up component navigation.
393
  *
435
  public function setup_admin_bar( $wp_admin_nav = array() ) {
436
 
437
  // Bail if this is an ajax request
438
+ if ( defined( 'DOING_AJAX' ) ) {
439
  return;
440
+ }
441
 
442
  // Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false
443
+ if ( ! bp_use_wp_admin_bar() ) {
444
  return;
445
+ }
446
 
447
  // Filter the passed admin nav
448
  $wp_admin_nav = apply_filters( 'bp_' . $this->id . '_admin_nav', $wp_admin_nav );
bp-core/bp-core-cssjs.php CHANGED
@@ -9,6 +9,64 @@
9
  // Exit if accessed directly
10
  if ( !defined( 'ABSPATH' ) ) exit;
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Load the JS for "Are you sure?" .confirm links.
14
  */
@@ -17,15 +75,14 @@ function bp_core_confirmation_js() {
17
  return false;
18
  }
19
 
20
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
21
- wp_enqueue_script( 'bp-confirm', buddypress()->plugin_url . "bp-core/js/confirm{$min}.js", array( 'jquery' ), bp_get_version() );
22
 
23
  wp_localize_script( 'bp-confirm', 'BP_Confirm', array(
24
  'are_you_sure' => __( 'Are you sure?', 'buddypress' ),
25
  ) );
26
 
27
  }
28
- add_action( 'wp_enqueue_scripts', 'bp_core_confirmation_js' );
29
  add_action( 'admin_enqueue_scripts', 'bp_core_confirmation_js' );
30
 
31
  /**
@@ -45,10 +102,11 @@ function bp_core_add_cropper_inline_js() {
45
 
46
  // Bail if no image was uploaded
47
  $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir ) );
48
- if ( empty( $image ) )
49
  return;
 
50
 
51
- //
52
  $full_height = bp_core_avatar_full_height();
53
  $full_width = bp_core_avatar_full_width();
54
 
@@ -60,21 +118,52 @@ function bp_core_add_cropper_inline_js() {
60
  }
61
 
62
  // Default cropper coordinates
63
- $crop_left = round( $image[0] / 4 );
64
- $crop_top = round( $image[1] / 4 );
65
- $crop_right = $image[0] - $crop_left;
66
- $crop_bottom = $image[1] - $crop_top; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  <script type="text/javascript">
69
  jQuery(window).load( function(){
70
  jQuery('#avatar-to-crop').Jcrop({
71
  onChange: showPreview,
72
- onSelect: showPreview,
73
  onSelect: updateCoords,
74
- aspectRatio: <?php echo $aspect_ratio; ?>,
75
- setSelect: [ <?php echo $crop_left; ?>, <?php echo $crop_top; ?>, <?php echo $crop_right; ?>, <?php echo $crop_bottom; ?> ]
76
  });
77
- updateCoords({x: <?php echo $crop_left; ?>, y: <?php echo $crop_top; ?>, w: <?php echo $crop_right; ?>, h: <?php echo $crop_bottom; ?>});
78
  });
79
 
80
  function updateCoords(c) {
@@ -86,14 +175,14 @@ function bp_core_add_cropper_inline_js() {
86
 
87
  function showPreview(coords) {
88
  if ( parseInt(coords.w) > 0 ) {
89
- var fw = <?php echo $full_width; ?>;
90
- var fh = <?php echo $full_height; ?>;
91
  var rx = fw / coords.w;
92
  var ry = fh / coords.h;
93
 
94
  jQuery( '#avatar-crop-preview' ).css({
95
- width: Math.round(rx * <?php echo $image[0]; ?>) + 'px',
96
- height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',
97
  marginLeft: '-' + Math.round(rx * coords.x) + 'px',
98
  marginTop: '-' + Math.round(ry * coords.y) + 'px'
99
  });
@@ -153,3 +242,23 @@ add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
153
  function bp_core_ajax_url() {
154
  return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );
155
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  // Exit if accessed directly
10
  if ( !defined( 'ABSPATH' ) ) exit;
11
 
12
+ /**
13
+ * Register scripts commonly used by BuddyPress.
14
+ *
15
+ * @since BuddyPress (2.1.0)
16
+ */
17
+ function bp_core_register_common_scripts() {
18
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
19
+ $url = buddypress()->plugin_url . 'bp-core/js/';
20
+
21
+ $scripts = apply_filters( 'bp_core_register_common_scripts', array(
22
+
23
+ // Legacy
24
+ 'bp-confirm' => array( 'file' => "{$url}confirm{$min}.js", 'dependencies' => array( 'jquery' ) ),
25
+ 'bp-widget-members' => array( 'file' => "{$url}widget-members{$min}.js", 'dependencies' => array( 'jquery' ) ),
26
+ 'bp-jquery-query' => array( 'file' => "{$url}jquery-query{$min}.js", 'dependencies' => array( 'jquery' ) ),
27
+ 'bp-jquery-cookie' => array( 'file' => "{$url}jquery-cookie{$min}.js", 'dependencies' => array( 'jquery' ) ),
28
+
29
+ // 2.1
30
+ 'jquery-caret' => array( 'file' => "{$url}jquery.caret{$min}.js", 'dependencies' => array( 'jquery' ) ),
31
+ 'jquery-atwho' => array( 'file' => "{$url}jquery.atwho{$min}.js", 'dependencies' => array( 'jquery', 'jquery-caret' ) ),
32
+ ) );
33
+
34
+ $version = bp_get_version();
35
+ foreach ( $scripts as $id => $script ) {
36
+ wp_register_script( $id, $script['file'], $script['dependencies'], $version );
37
+ }
38
+ }
39
+ add_action( 'bp_enqueue_scripts', 'bp_core_register_common_scripts', 1 );
40
+ add_action( 'bp_admin_enqueue_scripts', 'bp_core_register_common_scripts', 1 );
41
+
42
+ /**
43
+ * Register styles commonly used by BuddyPress.
44
+ *
45
+ * @since BuddyPress (2.1.0)
46
+ */
47
+ function bp_core_register_common_styles() {
48
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
49
+ $url = buddypress()->plugin_url . 'bp-core/css/';
50
+
51
+ $styles = apply_filters( 'bp_core_register_common_styles', array(
52
+ 'bp-admin-bar' => array(
53
+ 'file' => apply_filters( 'bp_core_admin_bar_css', "{$url}admin-bar{$min}.css" ),
54
+ 'dependencies' => array( 'admin-bar' )
55
+ )
56
+ ) );
57
+
58
+ foreach ( $styles as $id => $style ) {
59
+ wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() );
60
+
61
+ wp_style_add_data( $id, 'rtl', true );
62
+ if ( $min ) {
63
+ wp_style_add_data( $id, 'suffix', $min );
64
+ }
65
+ }
66
+ }
67
+ add_action( 'bp_enqueue_scripts', 'bp_core_register_common_styles', 1 );
68
+ add_action( 'bp_admin_enqueue_scripts', 'bp_core_register_common_styles', 1 );
69
+
70
  /**
71
  * Load the JS for "Are you sure?" .confirm links.
72
  */
75
  return false;
76
  }
77
 
78
+ wp_enqueue_script( 'bp-confirm' );
 
79
 
80
  wp_localize_script( 'bp-confirm', 'BP_Confirm', array(
81
  'are_you_sure' => __( 'Are you sure?', 'buddypress' ),
82
  ) );
83
 
84
  }
85
+ add_action( 'bp_enqueue_scripts', 'bp_core_confirmation_js' );
86
  add_action( 'admin_enqueue_scripts', 'bp_core_confirmation_js' );
87
 
88
  /**
102
 
103
  // Bail if no image was uploaded
104
  $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir ) );
105
+ if ( empty( $image ) ) {
106
  return;
107
+ }
108
 
109
+ // Get avatar full width and height
110
  $full_height = bp_core_avatar_full_height();
111
  $full_width = bp_core_avatar_full_width();
112
 
118
  }
119
 
120
  // Default cropper coordinates
121
+
122
+ // Smaller than full-width: cropper defaults to entire image
123
+ if ( $image[0] < $full_width ) {
124
+ $crop_left = 0;
125
+ $crop_right = $image[0];
126
+
127
+ // Less than 2x full-width: cropper defaults to full-width
128
+ } else if ( $image[0] < ( $full_width * 2 ) ) {
129
+ $padding_w = round( ( $image[0] - $full_width ) / 2 );
130
+ $crop_left = $padding_w;
131
+ $crop_right = $image[0] - $padding_w;
132
+
133
+ // Larger than 2x full-width: cropper defaults to 1/2 image width
134
+ } else {
135
+ $crop_left = round( $image[0] / 4 );
136
+ $crop_right = $image[0] - $crop_left;
137
+ }
138
+
139
+ // Smaller than full-height: cropper defaults to entire image
140
+ if ( $image[1] < $full_height ) {
141
+ $crop_top = 0;
142
+ $crop_bottom = $image[1];
143
+
144
+ // Less than double full-height: cropper defaults to full-height
145
+ } else if ( $image[1] < ( $full_height * 2 ) ) {
146
+ $padding_h = round( ( $image[1] - $full_height ) / 2 );
147
+ $crop_top = $padding_h;
148
+ $crop_bottom = $image[1] - $padding_h;
149
+
150
+ // Larger than 2x full-height: cropper defaults to 1/2 image height
151
+ } else {
152
+ $crop_top = round( $image[1] / 4 );
153
+ $crop_bottom = $image[1] - $crop_top;
154
+ }
155
+
156
+ ?>
157
 
158
  <script type="text/javascript">
159
  jQuery(window).load( function(){
160
  jQuery('#avatar-to-crop').Jcrop({
161
  onChange: showPreview,
 
162
  onSelect: updateCoords,
163
+ aspectRatio: <?php echo (int) $aspect_ratio; ?>,
164
+ setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ]
165
  });
166
+ updateCoords({x: <?php echo (int) $crop_left; ?>, y: <?php echo (int) $crop_top; ?>, w: <?php echo (int) $crop_right; ?>, h: <?php echo (int) $crop_bottom; ?>});
167
  });
168
 
169
  function updateCoords(c) {
175
 
176
  function showPreview(coords) {
177
  if ( parseInt(coords.w) > 0 ) {
178
+ var fw = <?php echo (int) $full_width; ?>;
179
+ var fh = <?php echo (int) $full_height; ?>;
180
  var rx = fw / coords.w;
181
  var ry = fh / coords.h;
182
 
183
  jQuery( '#avatar-crop-preview' ).css({
184
+ width: Math.round(rx * <?php echo (int) $image[0]; ?>) + 'px',
185
+ height: Math.round(ry * <?php echo (int) $image[1]; ?>) + 'px',
186
  marginLeft: '-' + Math.round(rx * coords.x) + 'px',
187
  marginTop: '-' + Math.round(ry * coords.y) + 'px'
188
  });
242
  function bp_core_ajax_url() {
243
  return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );
244
  }
245
+
246
+ /**
247
+ * Get the javascript dependencies for buddypress.js.
248
+ *
249
+ * @since BuddyPress (2.0.0)
250
+ *
251
+ * @uses apply_filters() to allow other component to load extra dependencies
252
+ *
253
+ * @return array The javascript dependencies.
254
+ */
255
+ function bp_core_get_js_dependencies() {
256
+ return apply_filters( 'bp_core_get_js_dependencies', array(
257
+ 'jquery',
258
+ 'bp-confirm',
259
+ 'bp-widget-members',
260
+ 'bp-jquery-query',
261
+ 'bp-jquery-cookie',
262
+ 'bp-jquery-scroll-to'
263
+ ) );
264
+ }
bp-core/bp-core-dependency.php CHANGED
@@ -31,6 +31,13 @@ function bp_setup_components() {
31
  do_action( 'bp_setup_components' );
32
  }
33
 
 
 
 
 
 
 
 
34
  /**
35
  * Fire the 'bp_setup_globals' action, where plugins should initialize global settings.
36
  */
31
  do_action( 'bp_setup_components' );
32
  }
33
 
34
+ /**
35
+ * Fire the 'bp_setup_canonical_stack' action, where plugins should set up their canonical URL.
36
+ */
37
+ function bp_setup_canonical_stack() {
38
+ do_action( 'bp_setup_canonical_stack' );
39
+ }
40
+
41
  /**
42
  * Fire the 'bp_setup_globals' action, where plugins should initialize global settings.
43
  */
bp-core/bp-core-filters.php CHANGED
@@ -250,12 +250,18 @@ add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
250
  function bp_core_filter_user_welcome_email( $welcome_email ) {
251
 
252
  // Don't touch the email when a user is registered by the site admin
253
- if ( is_admin() )
254
  return $welcome_email;
 
 
 
 
 
255
 
256
  // Don't touch the email if we don't have a custom registration template
257
- if ( ! bp_has_custom_signup_page() )
258
  return $welcome_email;
 
259
 
260
  // [User Set] Replaces 'PASSWORD' in welcome email; Represents value set by user
261
  return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email );
@@ -279,9 +285,10 @@ add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' );
279
  */
280
  function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
281
 
282
- // Don't touch the email when a user is registered by the site admin.
283
- if ( is_admin() )
284
  return $welcome_email;
 
285
 
286
  // Don't touch the email if we don't have a custom registration template
287
  if ( ! bp_has_custom_signup_page() )
@@ -317,7 +324,7 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u
317
  $activate_url = esc_url( $activate_url );
318
 
319
  // Email contents
320
- $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}" ) );
321
  $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Activate %s', 'buddypress' ), 'http://' . $domain . $path ) ) );
322
 
323
  // Email filters
@@ -351,6 +358,32 @@ add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_not
351
  */
352
  function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  // Set up activation link
355
  $activate_url = bp_get_activation_page() . "?key=$key";
356
  $activate_url = esc_url( $activate_url );
@@ -503,7 +536,7 @@ function bp_setup_nav_menu_item( $menu_item ) {
503
  if ( is_user_logged_in() ) {
504
  $menu_item->_invalid = true;
505
  } else {
506
- $menu_item->url = wp_login_url( wp_guess_url() );
507
  }
508
 
509
  break;
@@ -512,7 +545,7 @@ function bp_setup_nav_menu_item( $menu_item ) {
512
  if ( ! is_user_logged_in() ) {
513
  $menu_item->_invalid = true;
514
  } else {
515
- $menu_item->url = wp_logout_url( wp_guess_url() );
516
  }
517
 
518
  break;
@@ -572,3 +605,21 @@ add_filter( 'wp_setup_nav_menu_item', 'bp_setup_nav_menu_item', 10, 1 );
572
  function bp_filter_metaid_column_name( $q ) {
573
  return str_replace( 'meta_id', 'id', $q );
574
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  function bp_core_filter_user_welcome_email( $welcome_email ) {
251
 
252
  // Don't touch the email when a user is registered by the site admin
253
+ if ( ( is_admin() || is_network_admin() ) && buddypress()->members->admin->signups_page != get_current_screen()->id ) {
254
  return $welcome_email;
255
+ }
256
+
257
+ if ( strpos( bp_get_requested_url(), 'wp-activate.php' ) !== false ) {
258
+ return $welcome_email;
259
+ }
260
 
261
  // Don't touch the email if we don't have a custom registration template
262
+ if ( ! bp_has_custom_signup_page() ) {
263
  return $welcome_email;
264
+ }
265
 
266
  // [User Set] Replaces 'PASSWORD' in welcome email; Represents value set by user
267
  return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email );
285
  */
286
  function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
287
 
288
+ // Don't touch the email when a user is registered by the site admin
289
+ if ( ( is_admin() || is_network_admin() ) && buddypress()->members->admin->signups_page != get_current_screen()->id ) {
290
  return $welcome_email;
291
+ }
292
 
293
  // Don't touch the email if we don't have a custom registration template
294
  if ( ! bp_has_custom_signup_page() )
324
  $activate_url = esc_url( $activate_url );
325
 
326
  // Email contents
327
+ $message = sprintf( __( "%1\$s,\n\n\n\nThanks for registering! To complete the activation of your account and blog, please click the following link:\n\n%2\$s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%3\$s", 'buddypress' ), $user, $activate_url, esc_url( "http://{$domain}{$path}" ) );
328
  $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Activate %s', 'buddypress' ), 'http://' . $domain . $path ) ) );
329
 
330
  // Email filters
358
  */
359
  function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
360
 
361
+ if ( is_admin() ) {
362
+ // If the user is created from the WordPress Add User screen, don't send BuddyPress signup notifications
363
+ if( in_array( get_current_screen()->id, array( 'user', 'user-network' ) ) ) {
364
+ // If the Super Admin want to skip confirmation email
365
+ if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {
366
+ return false;
367
+
368
+ // WordPress will manage the signup process
369
+ } else {
370
+ return $user;
371
+ }
372
+
373
+ /**
374
+ * There can be a case where the user was created without the skip confirmation
375
+ * And the super admin goes in pending accounts to resend it. In this case, as the
376
+ * meta['password'] is not set, the activation url must be WordPress one
377
+ */
378
+ } else if ( buddypress()->members->admin->signups_page == get_current_screen()->id ) {
379
+ $is_hashpass_in_meta = maybe_unserialize( $meta );
380
+
381
+ if ( empty( $is_hashpass_in_meta['password'] ) ) {
382
+ return $user;
383
+ }
384
+ }
385
+ }
386
+
387
  // Set up activation link
388
  $activate_url = bp_get_activation_page() . "?key=$key";
389
  $activate_url = esc_url( $activate_url );
536
  if ( is_user_logged_in() ) {
537
  $menu_item->_invalid = true;
538
  } else {
539
+ $menu_item->url = wp_login_url( bp_get_requested_url() );
540
  }
541
 
542
  break;
545
  if ( ! is_user_logged_in() ) {
546
  $menu_item->_invalid = true;
547
  } else {
548
+ $menu_item->url = wp_logout_url( bp_get_requested_url() );
549
  }
550
 
551
  break;
605
  function bp_filter_metaid_column_name( $q ) {
606
  return str_replace( 'meta_id', 'id', $q );
607
  }
608
+
609
+ /**
610
+ * Filter the edit post link to avoid its display in BuddyPress pages
611
+ *
612
+ * @since BuddyPress (2.1.0)
613
+ *
614
+ * @param string $link The edit link.
615
+ * @param int $post_id Post ID.
616
+ * @return mixed Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link)
617
+ * otherwise
618
+ */
619
+ function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) {
620
+ if ( 0 === $post_id ) {
621
+ $edit_link = false;
622
+ }
623
+
624
+ return $edit_link;
625
+ }
bp-core/bp-core-functions.php CHANGED
@@ -146,11 +146,12 @@ function bp_alpha_sort_by_key( $items, $key ) {
146
  * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}.
147
  * @return string The formatted number.
148
  */
149
- function bp_core_number_format( $number, $decimals = false ) {
150
 
151
  // Force number to 0 if needed
152
- if ( empty( $number ) )
153
  $number = 0;
 
154
 
155
  return apply_filters( 'bp_core_number_format', number_format_i18n( $number, $decimals ), $number, $decimals );
156
  }
@@ -264,6 +265,32 @@ function bp_esc_sql_order( $order = '' ) {
264
  return 'DESC' === $order ? 'DESC' : 'ASC';
265
  }
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  /**
268
  * Are we running username compatibility mode?
269
  *
@@ -289,25 +316,56 @@ function bp_is_username_compatibility_mode() {
289
  *
290
  * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter.
291
  *
292
- * @return bool False when WP Toolbar support is disabled, true when enabled.
293
- * Default: true.
294
  */
295
  function bp_use_wp_admin_bar() {
 
 
296
  $use_admin_bar = true;
297
 
298
- // Has the WP Toolbar constant been explicity set?
299
- if ( defined( 'BP_USE_WP_ADMIN_BAR' ) && ! BP_USE_WP_ADMIN_BAR )
300
- $use_admin_bar = false;
301
 
302
- // Has the admin chosen to use the BuddyBar during an upgrade?
303
- elseif ( (bool) bp_get_option( '_bp_force_buddybar', false ) )
304
  $use_admin_bar = false;
 
305
 
306
- return apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );
307
  }
308
 
309
  /** Directory *****************************************************************/
310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  /**
312
  * Fetch a list of BP directory pages from the appropriate meta table.
313
  *
@@ -428,14 +486,16 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
428
  return;
429
  }
430
 
431
- // Make sure that the pages are created on the root blog no matter which Dashboard the setup is being run on
432
- if ( ! bp_is_root_blog() )
 
433
  switch_to_blog( bp_get_root_blog_id() );
 
434
 
435
  $pages = bp_core_get_directory_page_ids();
436
 
437
  // Delete any existing pages
438
- if ( 'delete' == $existing ) {
439
  foreach ( (array) $pages as $page_id ) {
440
  wp_delete_post( $page_id, true );
441
  }
@@ -444,11 +504,11 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
444
  }
445
 
446
  $page_titles = array(
447
- 'activity' => _x( 'Activity', 'Page title for the Activity directory.', 'buddypress' ),
448
- 'groups' => _x( 'Groups', 'Page title for the Groups directory.', 'buddypress' ),
449
- 'sites' => _x( 'Sites', 'Page title for the Sites directory.', 'buddypress' ),
450
- 'activate' => _x( 'Activate', 'Page title for the user account activation screen.', 'buddypress' ),
451
- 'members' => _x( 'Members', 'Page title for the Members directory.', 'buddypress' ),
452
  'register' => _x( 'Register', 'Page title for the user registration screen.', 'buddypress' ),
453
  );
454
 
@@ -481,21 +541,29 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
481
 
482
  // Create the pages
483
  foreach ( $pages_to_create as $component_name => $page_name ) {
484
- $pages[ $component_name ] = wp_insert_post( array(
485
- 'comment_status' => 'closed',
486
- 'ping_status' => 'closed',
487
- 'post_status' => 'publish',
488
- 'post_title' => $page_name,
489
- 'post_type' => 'page',
490
- ) );
 
 
 
 
 
 
 
491
  }
492
 
493
  // Save the page mapping
494
  bp_update_option( 'bp-pages', $pages );
495
 
496
  // If we had to switch_to_blog, go back to the original site.
497
- if ( ! bp_is_root_blog() )
498
  restore_current_blog();
 
499
  }
500
 
501
  /**
@@ -561,7 +629,9 @@ function bp_core_add_root_component( $slug ) {
561
 
562
  // If there was no match, add a page for this root component
563
  if ( empty( $match ) ) {
564
- $bp->add_root[] = $slug;
 
 
565
  }
566
 
567
  // Make sure that this component is registered as requiring a top-level directory
@@ -663,13 +733,14 @@ function bp_core_get_root_domain() {
663
  * @param int $status Optional. The numeric code to give in the redirect
664
  * headers. Default: 302.
665
  */
666
- function bp_core_redirect( $location, $status = 302 ) {
667
 
668
  // On some setups, passing the value of wp_get_referer() may result in an
669
  // empty value for $location, which results in an error. Ensure that we
670
  // have a valid URL.
671
- if ( empty( $location ) )
672
  $location = bp_get_root_domain();
 
673
 
674
  // Make sure we don't call status_header() in bp_core_do_catch_uri() as this
675
  // conflicts with wp_redirect() and wp_safe_redirect().
@@ -700,23 +771,24 @@ function bp_core_referrer() {
700
  function bp_core_get_site_path() {
701
  global $current_site;
702
 
703
- if ( is_multisite() )
704
  $site_path = $current_site->path;
705
- else {
706
  $site_path = (array) explode( '/', home_url() );
707
 
708
- if ( count( $site_path ) < 2 )
709
  $site_path = '/';
710
- else {
711
  // Unset the first three segments (http(s)://domain.com part)
712
  unset( $site_path[0] );
713
  unset( $site_path[1] );
714
  unset( $site_path[2] );
715
 
716
- if ( !count( $site_path ) )
717
  $site_path = '/';
718
- else
719
  $site_path = '/' . implode( '/', $site_path ) . '/';
 
720
  }
721
  }
722
 
@@ -731,13 +803,12 @@ function bp_core_get_site_path() {
731
  * @since BuddyPress (1.2.6)
732
  *
733
  * @param bool $gmt True to use GMT (rather than local) time. Default: true.
 
 
734
  * @return string Current time in 'Y-m-d h:i:s' format.
735
  */
736
- function bp_core_current_time( $gmt = true ) {
737
- // Get current time in MYSQL format
738
- $current_time = current_time( 'mysql', $gmt );
739
-
740
- return apply_filters( 'bp_core_current_time', $current_time );
741
  }
742
 
743
  /**
@@ -769,7 +840,8 @@ function bp_core_current_time( $gmt = true ) {
769
  function bp_core_time_since( $older_date, $newer_date = false ) {
770
 
771
  // Use this filter to bypass BuddyPress's time_since calculations
772
- if ( $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date ) ) {
 
773
  return $pre_value;
774
  }
775
 
@@ -800,7 +872,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
800
  * a date and the current time. $newer_date will have a value if we want to
801
  * work out time elapsed between two known dates.
802
  */
803
- $newer_date = ( !$newer_date ) ? strtotime( bp_core_current_time() ) : $newer_date;
804
 
805
  // Difference in seconds
806
  $since = $newer_date - $older_date;
@@ -1022,18 +1094,26 @@ function bp_core_render_message() {
1022
  */
1023
  function bp_core_record_activity() {
1024
 
1025
- if ( !is_user_logged_in() )
 
1026
  return false;
 
1027
 
 
1028
  $user_id = bp_loggedin_user_id();
1029
 
1030
- if ( bp_is_user_inactive( $user_id ) )
 
1031
  return false;
 
1032
 
 
1033
  $activity = bp_get_user_last_activity( $user_id );
1034
 
1035
- if ( !is_numeric( $activity ) )
 
1036
  $activity = strtotime( $activity );
 
1037
 
1038
  // Get current time
1039
  $current_time = bp_core_current_time();
@@ -1043,7 +1123,8 @@ function bp_core_record_activity() {
1043
  do_action( 'bp_first_activity_for_member', $user_id );
1044
  }
1045
 
1046
- if ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) {
 
1047
  bp_update_user_last_activity( $user_id, $current_time );
1048
  }
1049
  }
@@ -1056,16 +1137,22 @@ add_action( 'wp_head', 'bp_core_record_activity' );
1056
  * representation of the time elapsed.
1057
  *
1058
  * @param int|string $last_activity_date The date of last activity.
1059
- * @param string $string A sprintf()-able statement of the form '% ago'.
1060
  * @return string $last_active A string of the form '3 years ago'.
1061
  */
1062
- function bp_core_get_last_activity( $last_activity_date, $string ) {
1063
 
1064
- if ( empty( $last_activity_date ) )
1065
- $last_active = __( 'Not recently active', 'buddypress' );
1066
- else
1067
- $last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) );
1068
 
 
 
 
 
 
 
1069
  return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
1070
  }
1071
 
@@ -1294,8 +1381,9 @@ function bp_core_do_network_admin() {
1294
  // Default
1295
  $retval = bp_is_network_activated();
1296
 
1297
- if ( bp_is_multiblog_mode() )
1298
  $retval = false;
 
1299
 
1300
  return (bool) apply_filters( 'bp_core_do_network_admin', $retval );
1301
  }
@@ -1334,12 +1422,14 @@ function bp_is_root_blog( $blog_id = 0 ) {
1334
  $is_root_blog = false;
1335
 
1336
  // Use current blog if no ID is passed
1337
- if ( empty( $blog_id ) )
1338
  $blog_id = get_current_blog_id();
 
1339
 
1340
  // Compare to root blog ID
1341
- if ( $blog_id == bp_get_root_blog_id() )
1342
  $is_root_blog = true;
 
1343
 
1344
  return (bool) apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );
1345
  }
@@ -1431,8 +1521,9 @@ function bp_is_network_activated() {
1431
  $plugins = get_site_option( 'active_sitewide_plugins' );
1432
 
1433
  // Override is_multisite() if not network activated
1434
- if ( ! is_array( $plugins ) || ! isset( $plugins[$base] ) )
1435
  $retval = false;
 
1436
 
1437
  return (bool) apply_filters( 'bp_is_network_activated', $retval );
1438
  }
@@ -1630,8 +1721,9 @@ add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
1630
  */
1631
  function bp_core_action_search_site( $slug = '' ) {
1632
 
1633
- if ( !bp_is_current_component( bp_get_search_slug() ) )
1634
  return;
 
1635
 
1636
  if ( empty( $_POST['search-terms'] ) ) {
1637
  bp_core_redirect( bp_get_root_domain() );
@@ -1700,6 +1792,25 @@ function bp_core_print_generation_time() {
1700
  }
1701
  add_action( 'wp_footer', 'bp_core_print_generation_time' );
1702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1703
  /** Nav Menu ******************************************************************/
1704
 
1705
  /**
@@ -1875,15 +1986,52 @@ function bp_nav_menu_get_item_url( $slug ) {
1875
  return $nav_item_url;
1876
  }
1877
 
 
 
1878
  /**
1879
- * Get the javascript dependencies for buddypress.js.
1880
- *
1881
- * @since BuddyPress (2.0.0)
1882
  *
1883
- * @uses apply_filters() to allow other component to load extra dependencies
 
1884
  *
1885
- * @return array The javascript dependencies.
 
 
1886
  */
1887
- function bp_core_get_js_dependencies() {
1888
- return apply_filters( 'bp_core_get_js_dependencies', array( 'jquery' ) );
1889
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}.
147
  * @return string The formatted number.
148
  */
149
+ function bp_core_number_format( $number = 0, $decimals = false ) {
150
 
151
  // Force number to 0 if needed
152
+ if ( ! is_numeric( $number ) ) {
153
  $number = 0;
154
+ }
155
 
156
  return apply_filters( 'bp_core_number_format', number_format_i18n( $number, $decimals ), $number, $decimals );
157
  }
265
  return 'DESC' === $order ? 'DESC' : 'ASC';
266
  }
267
 
268
+ /**
269
+ * Escape special characters in a SQL LIKE clause.
270
+ *
271
+ * In WordPress 4.0, like_escape() was deprecated, due to incorrect
272
+ * documentation and improper sanitization leading to a history of misuse. To
273
+ * maintain compatibility with versions of WP before 4.0, we duplicate the
274
+ * logic of the replacement, wpdb::esc_like().
275
+ *
276
+ * @since BuddyPress (2.1.0)
277
+ *
278
+ * @see wpdb::esc_like() for more details on proper use.
279
+ *
280
+ * @param string $text The raw text to be escaped.
281
+ * @return string Text in the form of a LIKE phrase. Not SQL safe. Run through
282
+ * wpdb::prepare() before use.
283
+ */
284
+ function bp_esc_like( $text ) {
285
+ global $wpdb;
286
+
287
+ if ( method_exists( $wpdb, 'esc_like' ) ) {
288
+ return $wpdb->esc_like( $text );
289
+ } else {
290
+ return addcslashes( $text, '_%\\' );
291
+ }
292
+ }
293
+
294
  /**
295
  * Are we running username compatibility mode?
296
  *
316
  *
317
  * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter.
318
  *
319
+ * @return bool Default: true. False when WP Toolbar support is disabled.
 
320
  */
321
  function bp_use_wp_admin_bar() {
322
+
323
+ // Default to true (to avoid loading deprecated BuddyBar code)
324
  $use_admin_bar = true;
325
 
326
+ // Has the WP Toolbar constant been explicity opted into?
327
+ if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
328
+ $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
329
 
330
+ // ...or is the old BuddyBar being forced back into use?
331
+ } elseif ( bp_force_buddybar( false ) ) {
332
  $use_admin_bar = false;
333
+ }
334
 
335
+ return (bool) apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );
336
  }
337
 
338
  /** Directory *****************************************************************/
339
 
340
+ /**
341
+ * Returns an array of core component IDs.
342
+ *
343
+ * @since BuddyPress (2.1.0)
344
+ *
345
+ * @return array
346
+ */
347
+ function bp_core_get_packaged_component_ids() {
348
+ $components = array(
349
+ 'activity',
350
+ 'members',
351
+ 'groups',
352
+ 'blogs',
353
+ 'xprofile',
354
+ 'friends',
355
+ 'messages',
356
+ 'settings',
357
+ 'notifications',
358
+ );
359
+
360
+ // only add legacy forums if it is enabled
361
+ // prevents conflicts with bbPress, which also uses the same 'forums' id
362
+ if ( class_exists( 'BP_Forums_Component' ) ) {
363
+ $components[] = 'forums';
364
+ }
365
+
366
+ return $components;
367
+ }
368
+
369
  /**
370
  * Fetch a list of BP directory pages from the appropriate meta table.
371
  *
486
  return;
487
  }
488
 
489
+ // Make sure that the pages are created on the root blog no matter which
490
+ // dashboard the setup is being run on.
491
+ if ( ! bp_is_root_blog() ) {
492
  switch_to_blog( bp_get_root_blog_id() );
493
+ }
494
 
495
  $pages = bp_core_get_directory_page_ids();
496
 
497
  // Delete any existing pages
498
+ if ( 'delete' === $existing ) {
499
  foreach ( (array) $pages as $page_id ) {
500
  wp_delete_post( $page_id, true );
501
  }
504
  }
505
 
506
  $page_titles = array(
507
+ 'activity' => _x( 'Activity', 'Page title for the Activity directory.', 'buddypress' ),
508
+ 'groups' => _x( 'Groups', 'Page title for the Groups directory.', 'buddypress' ),
509
+ 'sites' => _x( 'Sites', 'Page title for the Sites directory.', 'buddypress' ),
510
+ 'members' => _x( 'Members', 'Page title for the Members directory.', 'buddypress' ),
511
+ 'activate' => _x( 'Activate', 'Page title for the user activation screen.', 'buddypress' ),
512
  'register' => _x( 'Register', 'Page title for the user registration screen.', 'buddypress' ),
513
  );
514
 
541
 
542
  // Create the pages
543
  foreach ( $pages_to_create as $component_name => $page_name ) {
544
+ $exists = get_page_by_path( $component_name );
545
+
546
+ // If page already exists, use it
547
+ if ( ! empty( $exists ) ) {
548
+ $pages[ $component_name ] = $exists->ID;
549
+ } else {
550
+ $pages[ $component_name ] = wp_insert_post( array(
551
+ 'comment_status' => 'closed',
552
+ 'ping_status' => 'closed',
553
+ 'post_status' => 'publish',
554
+ 'post_title' => $page_name,
555
+ 'post_type' => 'page',
556
+ ) );
557
+ }
558
  }
559
 
560
  // Save the page mapping
561
  bp_update_option( 'bp-pages', $pages );
562
 
563
  // If we had to switch_to_blog, go back to the original site.
564
+ if ( ! bp_is_root_blog() ) {
565
  restore_current_blog();
566
+ }
567
  }
568
 
569
  /**
629
 
630
  // If there was no match, add a page for this root component
631
  if ( empty( $match ) ) {
632
+ $add_root_items = $bp->add_root();
633
+ $add_root_items[] = $slug;
634
+ $bp->add_root = $add_root_items;
635
  }
636
 
637
  // Make sure that this component is registered as requiring a top-level directory
733
  * @param int $status Optional. The numeric code to give in the redirect
734
  * headers. Default: 302.
735
  */
736
+ function bp_core_redirect( $location = '', $status = 302 ) {
737
 
738
  // On some setups, passing the value of wp_get_referer() may result in an
739
  // empty value for $location, which results in an error. Ensure that we
740
  // have a valid URL.
741
+ if ( empty( $location ) ) {
742
  $location = bp_get_root_domain();
743
+ }
744
 
745
  // Make sure we don't call status_header() in bp_core_do_catch_uri() as this
746
  // conflicts with wp_redirect() and wp_safe_redirect().
771
  function bp_core_get_site_path() {
772
  global $current_site;
773
 
774
+ if ( is_multisite() ) {
775
  $site_path = $current_site->path;
776
+ } else {
777
  $site_path = (array) explode( '/', home_url() );
778
 
779
+ if ( count( $site_path ) < 2 ) {
780
  $site_path = '/';
781
+ } else {
782
  // Unset the first three segments (http(s)://domain.com part)
783
  unset( $site_path[0] );
784
  unset( $site_path[1] );
785
  unset( $site_path[2] );
786
 
787
+ if ( !count( $site_path ) ) {
788
  $site_path = '/';
789
+ } else {
790
  $site_path = '/' . implode( '/', $site_path ) . '/';
791
+ }
792
  }
793
  }
794
 
803
  * @since BuddyPress (1.2.6)
804
  *
805
  * @param bool $gmt True to use GMT (rather than local) time. Default: true.
806
+ * @param string $type See the 'type' parameter in {@link current_time()}.
807
+ Default: 'mysql'.
808
  * @return string Current time in 'Y-m-d h:i:s' format.
809
  */
810
+ function bp_core_current_time( $gmt = true, $type = 'mysql' ) {
811
+ return apply_filters( 'bp_core_current_time', current_time( $type, $gmt ) );
 
 
 
812
  }
813
 
814
  /**
840
  function bp_core_time_since( $older_date, $newer_date = false ) {
841
 
842
  // Use this filter to bypass BuddyPress's time_since calculations
843
+ $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
844
+ if ( false !== $pre_value ) {
845
  return $pre_value;
846
  }
847
 
872
  * a date and the current time. $newer_date will have a value if we want to
873
  * work out time elapsed between two known dates.
874
  */
875
+ $newer_date = ( !$newer_date ) ? bp_core_current_time( true, 'timestamp' ) : $newer_date;
876
 
877
  // Difference in seconds
878
  $since = $newer_date - $older_date;
1094
  */
1095
  function bp_core_record_activity() {
1096
 
1097
+ // Bail if user is not logged in
1098
+ if ( ! is_user_logged_in() ) {
1099
  return false;
1100
+ }
1101
 
1102
+ // Get the user ID
1103
  $user_id = bp_loggedin_user_id();
1104
 
1105
+ // Bail if user is not active
1106
+ if ( bp_is_user_inactive( $user_id ) ) {
1107
  return false;
1108
+ }
1109
 
1110
+ // Get the user's last activity
1111
  $activity = bp_get_user_last_activity( $user_id );
1112
 
1113
+ // Make sure it's numeric
1114
+ if ( ! is_numeric( $activity ) ) {
1115
  $activity = strtotime( $activity );
1116
+ }
1117
 
1118
  // Get current time
1119
  $current_time = bp_core_current_time();
1123
  do_action( 'bp_first_activity_for_member', $user_id );
1124
  }
1125
 
1126
+ // If it's been more than 5 minutes, record a newer last-activity time
1127
+ if ( empty( $activity ) || ( strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) ) {
1128
  bp_update_user_last_activity( $user_id, $current_time );
1129
  }
1130
  }
1137
  * representation of the time elapsed.
1138
  *
1139
  * @param int|string $last_activity_date The date of last activity.
1140
+ * @param string $string A sprintf()-able statement of the form 'active %s'
1141
  * @return string $last_active A string of the form '3 years ago'.
1142
  */
1143
+ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) {
1144
 
1145
+ // Setup a default string if none was passed
1146
+ $string = empty( $string )
1147
+ ? '%s' // Gettext placeholder
1148
+ : $string;
1149
 
1150
+ // Use the string if a last activity date was passed
1151
+ $last_active = empty( $last_activity_date )
1152
+ ? __( 'Not recently active', 'buddypress' )
1153
+ : sprintf( $string, bp_core_time_since( $last_activity_date ) );
1154
+
1155
+ // Filter and return
1156
  return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
1157
  }
1158
 
1381
  // Default
1382
  $retval = bp_is_network_activated();
1383
 
1384
+ if ( bp_is_multiblog_mode() ) {
1385
  $retval = false;
1386
+ }
1387
 
1388
  return (bool) apply_filters( 'bp_core_do_network_admin', $retval );
1389
  }
1422
  $is_root_blog = false;
1423
 
1424
  // Use current blog if no ID is passed
1425
+ if ( empty( $blog_id ) ) {
1426
  $blog_id = get_current_blog_id();
1427
+ }
1428
 
1429
  // Compare to root blog ID
1430
+ if ( $blog_id == bp_get_root_blog_id() ) {
1431
  $is_root_blog = true;
1432
+ }
1433
 
1434
  return (bool) apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );
1435
  }
1521
  $plugins = get_site_option( 'active_sitewide_plugins' );
1522
 
1523
  // Override is_multisite() if not network activated
1524
+ if ( ! is_array( $plugins ) || ! isset( $plugins[ $base ] ) ) {
1525
  $retval = false;
1526
+ }
1527
 
1528
  return (bool) apply_filters( 'bp_is_network_activated', $retval );
1529
  }
1721
  */
1722
  function bp_core_action_search_site( $slug = '' ) {
1723
 
1724
+ if ( ! bp_is_current_component( bp_get_search_slug() ) ) {
1725
  return;
1726
+ }
1727
 
1728
  if ( empty( $_POST['search-terms'] ) ) {
1729
  bp_core_redirect( bp_get_root_domain() );
1792
  }
1793
  add_action( 'wp_footer', 'bp_core_print_generation_time' );
1794
 
1795
+ /**
1796
+ * Remove "prev" and "next" relational links from <head> on BuddyPress pages.
1797
+ *
1798
+ * WordPress automatically generates these relational links to the current
1799
+ * page. However, BuddyPress doesn't adhere to these links. In this
1800
+ * function, we remove these links when on a BuddyPress page. This also
1801
+ * prevents additional, unnecessary queries from running.
1802
+ *
1803
+ * @since BuddyPress (2.1.0)
1804
+ */
1805
+ function bp_remove_adjacent_posts_rel_link() {
1806
+ if ( ! is_buddypress() ) {
1807
+ return;
1808
+ }
1809
+
1810
+ remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
1811
+ }
1812
+ add_action( 'bp_init', 'bp_remove_adjacent_posts_rel_link' );
1813
+
1814
  /** Nav Menu ******************************************************************/
1815
 
1816
  /**
1986
  return $nav_item_url;
1987
  }
1988
 
1989
+ /** Suggestions***************************************************************/
1990
+
1991
  /**
1992
+ * BuddyPress Suggestions API for types of at-mentions.
 
 
1993
  *
1994
+ * This is used to power BuddyPress' at-mentions suggestions, but it is flexible enough to be used
1995
+ * for similar kinds of future requirements, or those implemented by third-party developers.
1996
  *
1997
+ * @param array $args
1998
+ * @return array|WP_Error Array of results. If there were any problems, returns a WP_Error object.
1999
+ * @since BuddyPress (2.1.0)
2000
  */
2001
+ function bp_core_get_suggestions( $args ) {
2002
+ $args = wp_parse_args( $args );
2003
+
2004
+ if ( ! $args['type'] ) {
2005
+ return new WP_Error( 'missing_parameter' );
2006
+ }
2007
+
2008
+ // Members @name suggestions.
2009
+ if ( $args['type'] === 'members' ) {
2010
+ $class = 'BP_Members_Suggestions';
2011
+
2012
+ // Members @name suggestions for users in a specific Group.
2013
+ if ( isset( $args['group_id'] ) ) {
2014
+ $class = 'BP_Groups_Member_Suggestions';
2015
+ }
2016
+
2017
+ } else {
2018
+ // If you've built a custom suggestions service, use this to tell BP the name of your class.
2019
+ $class = apply_filters( 'bp_suggestions_services', '', $args );
2020
+ }
2021
+
2022
+ if ( ! $class || ! class_exists( $class ) ) {
2023
+ return new WP_Error( 'missing_parameter' );
2024
+ }
2025
+
2026
+
2027
+ $suggestions = new $class( $args );
2028
+ $validation = $suggestions->validate();
2029
+
2030
+ if ( is_wp_error( $validation ) ) {
2031
+ $retval = $validation;
2032
+ } else {
2033
+ $retval = $suggestions->get_suggestions();
2034
+ }
2035
+
2036
+ return apply_filters( 'bp_core_get_suggestions', $retval, $args );
2037
+ }
bp-core/bp-core-loader.php CHANGED
@@ -230,7 +230,7 @@ class BP_Core extends BP_Component {
230
 
231
  // Add 'Profile' to the main navigation
232
  $main_nav = array(
233
- 'name' => __( 'Profile', 'buddypress' ),
234
  'slug' => $bp->core->profile->slug,
235
  'position' => 20,
236
  'screen_function' => 'bp_core_catch_profile_uri',
@@ -241,7 +241,7 @@ class BP_Core extends BP_Component {
241
 
242
  // Add the subnav items to the profile
243
  $sub_nav[] = array(
244
- 'name' => __( 'View', 'buddypress' ),
245
  'slug' => 'public',
246
  'parent_url' => $profile_link,
247
  'parent_slug' => $bp->core->profile->slug,
@@ -263,4 +263,4 @@ class BP_Core extends BP_Component {
263
  function bp_setup_core() {
264
  buddypress()->core = new BP_Core();
265
  }
266
- add_action( 'bp_setup_components', 'bp_setup_core', 2 );
230
 
231
  // Add 'Profile' to the main navigation
232
  $main_nav = array(
233
+ 'name' => _x( 'Profile', 'Main navigation', 'buddypress' ),
234
  'slug' => $bp->core->profile->slug,
235
  'position' => 20,
236
  'screen_function' => 'bp_core_catch_profile_uri',
241
 
242
  // Add the subnav items to the profile
243
  $sub_nav[] = array(
244
+ 'name' => _x( 'View', 'Profile sub nav', 'buddypress' ),
245
  'slug' => 'public',
246
  'parent_url' => $profile_link,
247
  'parent_slug' => $bp->core->profile->slug,
263
  function bp_setup_core() {
264
  buddypress()->core = new BP_Core();
265
  }
266
+ add_action( 'bp_loaded', 'bp_setup_core', 0 );
bp-core/bp-core-options.php CHANGED
@@ -149,8 +149,9 @@ function bp_delete_options() {
149
  $options = bp_get_default_options();
150
 
151
  // Add default options
152
- foreach ( $options as $key => $value )
153
  delete_option( $key );
 
154
 
155
  // Allow previously activated plugins to append their own options.
156
  do_action( 'bp_delete_options' );
@@ -173,8 +174,9 @@ function bp_setup_option_filters() {
173
  $options = bp_get_default_options();
174
 
175
  // Add filters to each BuddyPress option
176
- foreach ( $options as $key => $value )
177
  add_filter( 'pre_option_' . $key, 'bp_pre_get_option' );
 
178
 
179
  // Allow previously activated plugins to append their own options.
180
  do_action( 'bp_setup_option_filters' );
@@ -187,12 +189,11 @@ function bp_setup_option_filters() {
187
  *
188
  * @since BuddyPress (1.6)
189
  *
190
- * @global BuddyPress $bp
191
  * @param bool $value Optional. Default value false
192
  * @return mixed false if not overloaded, mixed if set
193
  */
194
  function bp_pre_get_option( $value = false ) {
195
- global $bp;
196
 
197
  // Get the name of the current filter so we can manipulate it
198
  $filter = current_filter();
@@ -201,8 +202,9 @@ function bp_pre_get_option( $value = false ) {
201
  $option = str_replace( 'pre_option_', '', $filter );
202
 
203
  // Check the options global for preset value
204
- if ( !empty( $bp->options[$option] ) )
205
- $value = $bp->options[$option];
 
206
 
207
  // Always return a value, even if false
208
  return $value;
@@ -240,6 +242,7 @@ function bp_get_option( $option_name, $default = '' ) {
240
  *
241
  * @param string $option_name The option key to be set.
242
  * @param mixed $value The value to be set.
 
243
  */
244
  function bp_add_option( $option_name, $value ) {
245
  return add_blog_option( bp_get_root_blog_id(), $option_name, $value );
@@ -258,9 +261,10 @@ function bp_add_option( $option_name, $value ) {
258
  *
259
  * @param string $option_name The option key to be set.
260
  * @param string $value The value to be set.
 
261
  */
262
  function bp_update_option( $option_name, $value ) {
263
- update_blog_option( bp_get_root_blog_id(), $option_name, $value );
264
  }
265
 
266
  /**
@@ -275,9 +279,10 @@ function bp_update_option( $option_name, $value ) {
275
  * @uses bp_get_root_blog_id()
276
  *
277
  * @param string $option_name The option key to be deleted.
 
278
  */
279
  function bp_delete_option( $option_name ) {
280
- delete_blog_option( bp_get_root_blog_id(), $option_name );
281
  }
282
 
283
  /**
@@ -379,26 +384,29 @@ function bp_core_get_root_options() {
379
 
380
  // Loop through options
381
  foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) {
382
- // Clear out the value from the last time around
383
- unset( $old_meta_value );
384
 
385
  if ( isset( $existing_options[$old_meta_key] ) ) {
386
  continue;
387
  }
388
 
389
  // Get old site option
390
- if ( is_multisite() )
391
  $old_meta_value = get_site_option( $old_meta_key );
 
392
 
393
  // No site option so look in root blog
394
- if ( empty( $old_meta_value ) )
395
  $old_meta_value = bp_get_option( $old_meta_key, $old_meta_default );
 
396
 
397
  // Update the root blog option
398
  bp_update_option( $old_meta_key, $old_meta_value );
399
 
400
  // Update the global array
401
  $root_blog_options_meta[$old_meta_key] = $old_meta_value;
 
 
 
402
  }
403
 
404
  $root_blog_options_meta = array_merge( $root_blog_options_meta, $existing_options );
@@ -407,8 +415,9 @@ function bp_core_get_root_options() {
407
  // We're all matched up
408
  } else {
409
  // Loop through our results and make them usable
410
- foreach ( $root_blog_options_meta as $root_blog_option )
411
  $root_blog_options[$root_blog_option->name] = $root_blog_option->value;
 
412
 
413
  // Copy the options no the return val
414
  $root_blog_options_meta = $root_blog_options;
@@ -436,7 +445,7 @@ function bp_core_get_root_options() {
436
  * Default: true.
437
  * @return bool True if profile sync is enabled, otherwise false.
438
  */
439
- function bp_disable_profile_sync( $default = true ) {
440
  return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
441
  }
442
 
149
  $options = bp_get_default_options();
150
 
151
  // Add default options
152
+ foreach ( array_keys( $options ) as $key ) {
153
  delete_option( $key );
154
+ }
155
 
156
  // Allow previously activated plugins to append their own options.
157
  do_action( 'bp_delete_options' );
174
  $options = bp_get_default_options();
175
 
176
  // Add filters to each BuddyPress option
177
+ foreach ( array_keys( $options ) as $key ) {
178
  add_filter( 'pre_option_' . $key, 'bp_pre_get_option' );
179
+ }
180
 
181
  // Allow previously activated plugins to append their own options.
182
  do_action( 'bp_setup_option_filters' );
189
  *
190
  * @since BuddyPress (1.6)
191
  *
 
192
  * @param bool $value Optional. Default value false
193
  * @return mixed false if not overloaded, mixed if set
194
  */
195
  function bp_pre_get_option( $value = false ) {
196
+ $bp = buddypress();
197
 
198
  // Get the name of the current filter so we can manipulate it
199
  $filter = current_filter();
202
  $option = str_replace( 'pre_option_', '', $filter );
203
 
204
  // Check the options global for preset value
205
+ if ( ! empty( $bp->options[ $option ] ) ) {
206
+ $value = $bp->options[ $option ];
207
+ }
208
 
209
  // Always return a value, even if false
210
  return $value;
242
  *
243
  * @param string $option_name The option key to be set.
244
  * @param mixed $value The value to be set.
245
+ * @return bool True on success, false on failure.
246
  */
247
  function bp_add_option( $option_name, $value ) {
248
  return add_blog_option( bp_get_root_blog_id(), $option_name, $value );
261
  *
262
  * @param string $option_name The option key to be set.
263
  * @param string $value The value to be set.
264
+ * @return bool True on success, false on failure.
265
  */
266
  function bp_update_option( $option_name, $value ) {
267
+ return update_blog_option( bp_get_root_blog_id(), $option_name, $value );
268
  }
269
 
270
  /**
279
  * @uses bp_get_root_blog_id()
280
  *
281
  * @param string $option_name The option key to be deleted.
282
+ * @return bool True on success, false on failure.
283
  */
284
  function bp_delete_option( $option_name ) {
285
+ return delete_blog_option( bp_get_root_blog_id(), $option_name );
286
  }
287
 
288
  /**
384
 
385
  // Loop through options
386
  foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) {
 
 
387
 
388
  if ( isset( $existing_options[$old_meta_key] ) ) {
389
  continue;
390
  }
391
 
392
  // Get old site option
393
+ if ( is_multisite() ) {
394
  $old_meta_value = get_site_option( $old_meta_key );
395
+ }
396
 
397
  // No site option so look in root blog
398
+ if ( empty( $old_meta_value ) ) {
399
  $old_meta_value = bp_get_option( $old_meta_key, $old_meta_default );
400
+ }
401
 
402
  // Update the root blog option
403
  bp_update_option( $old_meta_key, $old_meta_value );
404
 
405
  // Update the global array
406
  $root_blog_options_meta[$old_meta_key] = $old_meta_value;
407
+
408
+ // Clear out the value for the next time around
409
+ unset( $old_meta_value );
410
  }
411
 
412
  $root_blog_options_meta = array_merge( $root_blog_options_meta, $existing_options );
415
  // We're all matched up
416
  } else {
417
  // Loop through our results and make them usable
418
+ foreach ( $root_blog_options_meta as $root_blog_option ) {
419
  $root_blog_options[$root_blog_option->name] = $root_blog_option->value;
420
+ }
421
 
422
  // Copy the options no the return val
423
  $root_blog_options_meta = $root_blog_options;
445
  * Default: true.
446
  * @return bool True if profile sync is enabled, otherwise false.
447
  */
448
+ function bp_disable_profile_sync( $default = false ) {
449
  return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
450
  }
451
 
bp-core/bp-core-template-loader.php CHANGED
@@ -122,18 +122,17 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru
122
  *
123
  * @since BuddyPress (1.7.0)
124
  *
125
- * @todo Make 'callable' instead of 'function'.
126
- *
127
- * @param string $location Callback function that returns the stack location.
128
  * @param int $priority Optional. The priority parameter as passed to
129
  * add_filter(). Default: 10.
130
  * @return bool See {@link add_filter()}.
131
  */
132
  function bp_register_template_stack( $location_callback = '', $priority = 10 ) {
133
 
134
- // Bail if no location, or function does not exist
135
- if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
136
  return false;
 
137
 
138
  // Add location callback to template stack
139
  return add_filter( 'bp_template_stack', $location_callback, (int) $priority );
@@ -146,16 +145,17 @@ function bp_register_template_stack( $location_callback = '', $priority = 10 ) {
146
  *
147
  * @see bp_register_template_stack()
148
  *
149
- * @param string $location Callback function that returns the stack location.
150
  * @param int $priority Optional. The priority parameter passed to
151
  * {@link bp_register_template_stack()}. Default: 10.
152
  * @return bool See {@link remove_filter()}.
153
  */
154
  function bp_deregister_template_stack( $location_callback = '', $priority = 10 ) {
155
 
156
- // Bail if no location, or function does not exist
157
- if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
158
  return false;
 
159
 
160
  // Add location callback to template stack
161
  return remove_filter( 'bp_template_stack', $location_callback, (int) $priority );
122
  *
123
  * @since BuddyPress (1.7.0)
124
  *
125
+ * @param string $location_callback Callback function that returns the stack location.
 
 
126
  * @param int $priority Optional. The priority parameter as passed to
127
  * add_filter(). Default: 10.
128
  * @return bool See {@link add_filter()}.
129
  */
130
  function bp_register_template_stack( $location_callback = '', $priority = 10 ) {
131
 
132
+ // Bail if no location, or function/method is not callable
133
+ if ( empty( $location_callback ) || ! is_callable( $location_callback ) ) {
134
  return false;
135
+ }
136
 
137
  // Add location callback to template stack
138
  return add_filter( 'bp_template_stack', $location_callback, (int) $priority );
145
  *
146
  * @see bp_register_template_stack()
147
  *
148
+ * @param string $location_callback Callback function that returns the stack location.
149
  * @param int $priority Optional. The priority parameter passed to
150
  * {@link bp_register_template_stack()}. Default: 10.
151
  * @return bool See {@link remove_filter()}.
152
  */
153
  function bp_deregister_template_stack( $location_callback = '', $priority = 10 ) {
154
 
155
+ // Bail if no location, or function/method is not callable
156
+ if ( empty( $location_callback ) || ! is_callable( $location_callback ) ) {
157
  return false;
158
+ }
159
 
160
  // Add location callback to template stack
161
  return remove_filter( 'bp_template_stack', $location_callback, (int) $priority );
bp-core/bp-core-template.php CHANGED
@@ -23,18 +23,17 @@ if ( !defined( 'ABSPATH' ) ) exit;
23
  * The function will also analyze the current action for the current component
24
  * to determine whether or not to highlight a particular sub nav item.
25
  *
26
- * @global BuddyPress $bp The one true BuddyPress instance.
27
  * @uses bp_get_user_nav() Renders the navigation for a profile of a currently
28
  * viewed user.
29
  */
30
  function bp_get_options_nav() {
31
- global $bp;
32
 
33
- // If we are looking at a member profile, then the we can use the current component as an
34
- // index. Otherwise we need to use the component's root_slug
35
  $component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() );
36
 
37
- if ( !bp_is_single_item() ) {
38
  if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) {
39
  return false;
40
  } else {
@@ -50,8 +49,9 @@ function bp_get_options_nav() {
50
 
51
  // Loop through each navigation item
52
  foreach ( (array) $bp->bp_options_nav[$the_index] as $subnav_item ) {
53
- if ( !$subnav_item['user_has_access'] )
54
  continue;
 
55
 
56
  // If the current action or an action variable matches the nav item id, then add a highlight CSS class.
57
  if ( $subnav_item['slug'] == bp_current_action() ) {
@@ -75,10 +75,11 @@ function bp_get_options_nav() {
75
  * @todo Deprecate.
76
  */
77
  function bp_get_options_title() {
78
- global $bp;
79
 
80
- if ( empty( $bp->bp_options_title ) )
81
  $bp->bp_options_title = __( 'Options', 'buddypress' );
 
82
 
83
  echo apply_filters( 'bp_get_options_title', esc_attr( $bp->bp_options_title ) );
84
  }
@@ -101,7 +102,7 @@ function bp_get_directory_title( $component = '' ) {
101
  $title = buddypress()->{$component}->directory_title;
102
 
103
  // If none is found, concatenate
104
- } else if ( isset( buddypress()->{$component}->name ) ) {
105
  $title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name );
106
  }
107
 
@@ -118,19 +119,10 @@ function bp_get_directory_title( $component = '' ) {
118
  *
119
  * Not currently used in BuddyPress.
120
  *
121
- * @global BuddyPress $bp The one true BuddyPress instance.
122
- * @todo Deprecate.
123
- *
124
- * @return bool Returns true if an options avatar has been set, otherwise
125
- * false.
126
  */
127
  function bp_has_options_avatar() {
128
- global $bp;
129
-
130
- if ( empty( $bp->bp_options_avatar ) )
131
- return false;
132
-
133
- return true;
134
  }
135
 
136
  /**
@@ -141,41 +133,45 @@ function bp_has_options_avatar() {
141
  * @todo Deprecate.
142
  */
143
  function bp_get_options_avatar() {
144
- global $bp;
145
-
146
- echo apply_filters( 'bp_get_options_avatar', $bp->bp_options_avatar );
147
  }
148
 
149
  /**
150
  * Output a comment author's avatar.
151
  *
152
  * Not currently used in BuddyPress.
153
- *
154
- * @todo Deprecate.
155
  */
156
  function bp_comment_author_avatar() {
157
  global $comment;
158
 
159
- if ( function_exists( 'bp_core_fetch_avatar' ) )
160
- echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) ) ) ) );
161
- else if ( function_exists('get_avatar') )
 
 
 
 
162
  get_avatar();
 
163
  }
164
 
165
  /**
166
  * Output a post author's avatar.
167
  *
168
  * Not currently used in BuddyPress.
169
- *
170
- * @todo Deprecate.
171
  */
172
  function bp_post_author_avatar() {
173
  global $post;
174
 
175
- if ( function_exists( 'bp_core_fetch_avatar' ) )
176
- echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) ) ) ) );
177
- else if ( function_exists('get_avatar') )
 
 
 
 
178
  get_avatar();
 
179
  }
180
 
181
  /**
@@ -191,12 +187,10 @@ function bp_avatar_admin_step() {
191
  * if none is found.
192
  */
193
  function bp_get_avatar_admin_step() {
194
- global $bp;
195
-
196
- if ( isset( $bp->avatar_admin->step ) )
197
- $step = $bp->avatar_admin->step;
198
- else
199
- $step = 'upload-image';
200
 
201
  return apply_filters( 'bp_get_avatar_admin_step', $step );
202
  }
@@ -213,12 +207,10 @@ function bp_avatar_to_crop() {
213
  * @return string URL of the avatar awaiting cropping.
214
  */
215
  function bp_get_avatar_to_crop() {
216
- global $bp;
217
-
218
- if ( isset( $bp->avatar_admin->image->url ) )
219
- $url = $bp->avatar_admin->image->url;
220
- else
221
- $url = '';
222
 
223
  return apply_filters( 'bp_get_avatar_to_crop', $url );
224
  }
@@ -235,9 +227,12 @@ function bp_avatar_to_crop_src() {
235
  * @return string Relative file path to the avatar.
236
  */
237
  function bp_get_avatar_to_crop_src() {
238
- global $bp;
 
 
 
239
 
240
- return apply_filters( 'bp_get_avatar_to_crop_src', str_replace( WP_CONTENT_DIR, '', $bp->avatar_admin->image->dir ) );
241
  }
242
 
243
  /**
@@ -248,9 +243,9 @@ function bp_avatar_to_crop_src() {
248
  * @todo Deprecate.
249
  */
250
  function bp_avatar_cropper() {
251
- global $bp;
252
-
253
- echo '<img id="avatar-to-crop" class="avatar" src="' . $bp->avatar_admin->image . '" />';
254
  }
255
 
256
  /**
@@ -281,13 +276,16 @@ function bp_site_name() {
281
  * 'date_format' and 'time_format' settings are). False on failure.
282
  */
283
  function bp_format_time( $time, $just_date = false, $localize_time = true ) {
284
- if ( !isset( $time ) || !is_numeric( $time ) )
 
285
  return false;
 
286
 
287
  // Get GMT offset from root blog
288
  $root_blog_offset = false;
289
- if ( $localize_time )
290
  $root_blog_offset = get_blog_option( bp_get_root_blog_id(), 'gmt_offset' );
 
291
 
292
  // Calculate offset time
293
  $time_offset = $time + ( $root_blog_offset * 3600 );
@@ -296,7 +294,7 @@ function bp_format_time( $time, $just_date = false, $localize_time = true ) {
296
  $date = date_i18n( get_option( 'date_format' ), $time_offset );
297
 
298
  // Should we show the time also?
299
- if ( !$just_date ) {
300
  // Current time (9:50pm)
301
  $time = date_i18n( get_option( 'time_format' ), $time_offset );
302
 
@@ -327,8 +325,9 @@ function bp_format_time( $time, $just_date = false, $localize_time = true ) {
327
  */
328
  function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) {
329
 
330
- if ( !empty( $capitalize ) )
331
  $youtext = bp_core_ucfirst( $youtext );
 
332
 
333
  if ( bp_displayed_user_id() == bp_loggedin_user_id() ) {
334
  if ( true == $echo ) {
@@ -382,27 +381,32 @@ function bp_search_form_type_select() {
382
 
383
  $options = array();
384
 
385
- if ( bp_is_active( 'xprofile' ) )
386
- $options['members'] = __( 'Members', 'buddypress' );
 
387
 
388
- if ( bp_is_active( 'groups' ) )
389
- $options['groups'] = __( 'Groups', 'buddypress' );
 
390
 
391
- if ( bp_is_active( 'blogs' ) && is_multisite() )
392
- $options['blogs'] = __( 'Blogs', 'buddypress' );
 
393
 
394
- if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && bp_forums_has_directory() )
395
- $options['forums'] = __( 'Forums', 'buddypress' );
 
396
 
397
- $options['posts'] = __( 'Posts', 'buddypress' );
398
 
399
  // Eventually this won't be needed and a page will be built to integrate all search results.
400
- $selection_box = '<label for="search-which" class="accessibly-hidden">' . __( 'Search these:', 'buddypress' ) . '</label>';
401
  $selection_box .= '<select name="search-which" id="search-which" style="width: auto">';
402
 
403
  $options = apply_filters( 'bp_search_form_type_select_options', $options );
404
- foreach( (array) $options as $option_value => $option_title )
405
  $selection_box .= sprintf( '<option value="%s">%s</option>', $option_value, $option_title );
 
406
 
407
  $selection_box .= '</select>';
408
 
@@ -432,8 +436,9 @@ function bp_search_default_text( $component = '' ) {
432
  function bp_get_search_default_text( $component = '' ) {
433
  global $bp;
434
 
435
- if ( empty( $component ) )
436
  $component = bp_current_component();
 
437
 
438
  $default_text = __( 'Search anything...', 'buddypress' );
439
 
@@ -446,8 +451,9 @@ function bp_search_default_text( $component = '' ) {
446
  // name out of $bp->pages
447
  if ( !empty( $bp->pages->{$component}->slug ) ) {
448
  $key = $bp->pages->{$component}->slug;
449
- if ( !empty( $bp->{$key}->search_string ) )
450
  $default_text = $bp->{$key}->search_string;
 
451
  }
452
  }
453
  }
@@ -533,32 +539,33 @@ function bp_button( $args = '' ) {
533
  * @return string Trimmed string.
534
  */
535
  function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 
536
  // Backward compatibility. The third argument used to be a boolean $filter_shortcodes
537
  $filter_shortcodes_default = is_bool( $options ) ? $options : true;
538
 
539
- $defaults = array(
540
  'ending' => __( ' [&hellip;]', 'buddypress' ),
541
  'exact' => false,
542
  'html' => true,
543
  'filter_shortcodes' => $filter_shortcodes_default
544
- );
545
- $r = wp_parse_args( $options, $defaults );
546
- extract( $r );
547
 
548
  // Save the original text, to be passed along to the filter
549
  $original_text = $text;
550
 
551
  // Allow plugins to modify these values globally
552
- $length = apply_filters( 'bp_excerpt_length', $length );
553
- $ending = apply_filters( 'bp_excerpt_append_text', $ending );
554
 
555
  // Remove shortcodes if necessary
556
- if ( !empty( $filter_shortcodes ) )
557
  $text = strip_shortcodes( $text );
 
558
 
559
  // When $html is true, the excerpt should be created without including HTML tags in the
560
  // excerpt length
561
- if ( !empty( $html ) ) {
 
562
  // The text is short enough. No need to truncate
563
  if ( mb_strlen( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) {
564
  return $text;
@@ -571,20 +578,22 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
571
  // Find all the tags and put them in a stack for later use
572
  preg_match_all( '/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
573
  foreach ( $tags as $tag ) {
 
574
  // Process tags that need to be closed
575
  if ( !preg_match( '/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2] ) ) {
576
  if ( preg_match( '/<[\w]+[^>]*>/s', $tag[0] ) ) {
577
  array_unshift( $openTags, $tag[2] );
578
- } else if ( preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag ) ) {
579
  $pos = array_search( $closeTag[1], $openTags );
580
  if ( $pos !== false ) {
581
  array_splice( $openTags, $pos, 1 );
582
  }
583
  }
584
  }
585
- $truncate .= $tag[1];
586
 
 
587
  $contentLength = mb_strlen( preg_replace( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3] ) );
 
588
  if ( $contentLength + $totalLength > $length ) {
589
  $left = $length - $totalLength;
590
  $entitiesLength = 0;
@@ -618,10 +627,10 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
618
  }
619
 
620
  // If $exact is false, we can't break on words
621
- if ( empty( $exact ) ) {
622
  $spacepos = mb_strrpos( $truncate, ' ' );
623
  if ( isset( $spacepos ) ) {
624
- if ( $html ) {
625
  $bits = mb_substr( $truncate, $spacepos );
626
  preg_match_all( '/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER );
627
  if ( !empty( $droppedTags ) ) {
@@ -637,16 +646,15 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
637
  }
638
  $truncate .= $ending;
639
 
640
- if ( $html ) {
641
  foreach ( $openTags as $tag ) {
642
  $truncate .= '</' . $tag . '>';
643
  }
644
  }
645
 
646
  return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options );
647
-
648
  }
649
- add_filter( 'bp_create_excerpt', 'stripslashes_deep' );
650
  add_filter( 'bp_create_excerpt', 'force_balance_tags' );
651
 
652
  /**
@@ -691,14 +699,15 @@ function bp_blog_signup_allowed() {
691
  * @return bool True if blog signup is allowed, otherwise false.
692
  */
693
  function bp_get_blog_signup_allowed() {
694
- global $bp;
695
 
696
- if ( !is_multisite() )
697
  return false;
 
698
 
699
- $status = $bp->site_options['registration'];
700
- if ( 'none' != $status && 'user' != $status )
701
  return true;
 
702
 
703
  return false;
704
  }
@@ -710,9 +719,10 @@ function bp_blog_signup_allowed() {
710
  * otherwise false.
711
  */
712
  function bp_account_was_activated() {
713
- global $bp;
714
-
715
- $activation_complete = !empty( $bp->activation_complete ) ? $bp->activation_complete : false;
 
716
 
717
  return $activation_complete;
718
  }
@@ -755,12 +765,12 @@ function bp_registration_needs_activation() {
755
  */
756
  function bp_get_email_subject( $args = array() ) {
757
 
758
- $r = wp_parse_args( $args, array(
759
  'before' => '[',
760
  'after' => ']',
761
  'default' => __( 'Community', 'buddypress' ),
762
  'text' => ''
763
- ) );
764
 
765
  $subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text'];
766
 
@@ -781,10 +791,11 @@ function bp_get_email_subject( $args = array() ) {
781
  * @return string The AJAX querystring.
782
  */
783
  function bp_ajax_querystring( $object = false ) {
784
- global $bp;
785
 
786
- if ( !isset( $bp->ajax_querystring ) )
787
  $bp->ajax_querystring = '';
 
788
 
789
  return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring, $object );
790
  }
@@ -797,8 +808,11 @@ function bp_ajax_querystring( $object = false ) {
797
  * @return string Component name.
798
  */
799
  function bp_current_component() {
800
- global $bp;
801
- $current_component = !empty( $bp->current_component ) ? $bp->current_component : false;
 
 
 
802
  return apply_filters( 'bp_current_component', $current_component );
803
  }
804
 
@@ -808,8 +822,11 @@ function bp_current_component() {
808
  * @return string Action name.
809
  */
810
  function bp_current_action() {
811
- global $bp;
812
- $current_action = !empty( $bp->current_action ) ? $bp->current_action : '';
 
 
 
813
  return apply_filters( 'bp_current_action', $current_action );
814
  }
815
 
@@ -819,8 +836,11 @@ function bp_current_action() {
819
  * @return unknown
820
  */
821
  function bp_current_item() {
822
- global $bp;
823
- $current_item = !empty( $bp->current_item ) ? $bp->current_item : false;
 
 
 
824
  return apply_filters( 'bp_current_item', $current_item );
825
  }
826
 
@@ -831,8 +851,11 @@ function bp_current_item() {
831
  * if the array is empty.
832
  */
833
  function bp_action_variables() {
834
- global $bp;
835
- $action_variables = !empty( $bp->action_variables ) ? $bp->action_variables : false;
 
 
 
836
  return apply_filters( 'bp_action_variables', $action_variables );
837
  }
838
 
@@ -847,7 +870,9 @@ function bp_action_variables() {
847
  */
848
  function bp_action_variable( $position = 0 ) {
849
  $action_variables = bp_action_variables();
850
- $action_variable = isset( $action_variables[$position] ) ? $action_variables[$position] : false;
 
 
851
 
852
  return apply_filters( 'bp_action_variable', $action_variable, $position );
853
  }
@@ -864,9 +889,9 @@ function bp_root_domain() {
864
  * @return string URL of the BP root blog.
865
  */
866
  function bp_get_root_domain() {
867
- global $bp;
868
 
869
- if ( isset( $bp->root_domain ) && !empty( $bp->root_domain ) ) {
870
  $domain = $bp->root_domain;
871
  } else {
872
  $domain = bp_core_get_root_domain();
@@ -913,35 +938,37 @@ function bp_root_slug( $component = '' ) {
913
  *
914
  * @since BuddyPress (1.5.0)
915
  *
916
- * @global BuddyPress $bp The one true BuddyPress instance.
917
- *
918
  * @param string $component Optional. Defaults to the current component.
919
  * @return string $root_slug The root slug.
920
  */
921
  function bp_get_root_slug( $component = '' ) {
922
- global $bp;
923
-
924
  $root_slug = '';
925
 
926
  // Use current global component if none passed
927
- if ( empty( $component ) )
928
  $component = bp_current_component();
 
929
 
930
  // Component is active
931
- if ( !empty( $bp->active_components[$component] ) ) {
 
932
  // Backward compatibility: in legacy plugins, the canonical component id
933
  // was stored as an array value in $bp->active_components
934
- $component_name = '1' == $bp->active_components[$component] ? $component : $bp->active_components[$component];
 
 
935
 
936
  // Component has specific root slug
937
- if ( !empty( $bp->{$component_name}->root_slug ) ) {
938
  $root_slug = $bp->{$component_name}->root_slug;
939
  }
940
  }
941
 
942
  // No specific root slug, so fall back to component slug
943
- if ( empty( $root_slug ) )
944
  $root_slug = $component;
 
945
 
946
  return apply_filters( 'bp_get_root_slug', $root_slug, $component );
947
  }
@@ -951,25 +978,25 @@ function bp_root_slug( $component = '' ) {
951
  *
952
  * @since BuddyPress (1.5.0)
953
  *
954
- * @global BuddyPress $bp The one true BuddyPress instance.
955
- *
956
  * @param string $root_slug Needle to our active component haystack.
957
  * @return mixed False if none found, component name if found.
958
  */
959
  function bp_get_name_from_root_slug( $root_slug = '' ) {
960
- global $bp;
961
 
962
  // If no slug is passed, look at current_component
963
- if ( empty( $root_slug ) )
964
  $root_slug = bp_current_component();
 
965
 
966
  // No current component or root slug, so flee
967
- if ( empty( $root_slug ) )
968
  return false;
 
969
 
970
  // Loop through active components and look for a match
971
  foreach ( array_keys( $bp->active_components ) as $component ) {
972
- if ( ( !empty( $bp->{$component}->slug ) && ( $bp->{$component}->slug == $root_slug ) ) || ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) ) {
973
  return $bp->{$component}->name;
974
  }
975
  }
@@ -978,9 +1005,11 @@ function bp_get_name_from_root_slug( $root_slug = '' ) {
978
  }
979
 
980
  function bp_user_has_access() {
981
- $has_access = ( bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() ) ? true : false;
 
 
982
 
983
- return apply_filters( 'bp_user_has_access', $has_access );
984
  }
985
 
986
  /**
@@ -1013,7 +1042,9 @@ function bp_search_slug() {
1013
  */
1014
  function bp_displayed_user_id() {
1015
  $bp = buddypress();
1016
- $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0;
 
 
1017
 
1018
  return (int) apply_filters( 'bp_displayed_user_id', $id );
1019
  }
@@ -1027,7 +1058,9 @@ function bp_displayed_user_id() {
1027
  */
1028
  function bp_loggedin_user_id() {
1029
  $bp = buddypress();
1030
- $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;
 
 
1031
 
1032
  return (int) apply_filters( 'bp_loggedin_user_id', $id );
1033
  }
@@ -1049,7 +1082,7 @@ function bp_loggedin_user_id() {
1049
  * @return bool Returns true if the component matches, or else false.
1050
  */
1051
  function bp_is_current_component( $component ) {
1052
- global $bp, $wp_query;
1053
 
1054
  $is_current_component = false;
1055
 
@@ -1059,8 +1092,11 @@ function bp_is_current_component( $component ) {
1059
  }
1060
 
1061
  // Backward compatibility: 'xprofile' should be read as 'profile'
1062
- if ( 'xprofile' == $component )
1063
  $component = 'profile';
 
 
 
1064
 
1065
  if ( ! empty( $bp->current_component ) ) {
1066
 
@@ -1081,7 +1117,7 @@ function bp_is_current_component( $component ) {
1081
  // Next, check to see whether $component is a canonical,
1082
  // non-translatable component name. If so, we can return its
1083
  // corresponding slug from $bp->active_components.
1084
- } else if ( $key = array_search( $component, $bp->active_components ) ) {
1085
  if ( strstr( $bp->current_component, $key ) ) {
1086
  $is_current_component = true;
1087
  }
@@ -1106,13 +1142,16 @@ function bp_is_current_component( $component ) {
1106
  // Page template fallback check if $bp->current_component is empty
1107
  } elseif ( !is_admin() && is_a( $wp_query, 'WP_Query' ) && is_page() ) {
1108
  global $wp_query;
1109
- $page = $wp_query->get_queried_object();
1110
- $custom_fields = get_post_custom_values( '_wp_page_template', $page->ID );
1111
- $page_template = $custom_fields[0];
1112
 
1113
- // Component name is in the page template name
1114
- if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
1115
- $is_current_component = true;
 
 
 
 
 
 
1116
  }
1117
  }
1118
 
@@ -1137,10 +1176,7 @@ function bp_is_current_component( $component ) {
1137
  * @return bool True if the current action matches $action.
1138
  */
1139
  function bp_is_current_action( $action = '' ) {
1140
- if ( $action == bp_current_action() )
1141
- return true;
1142
-
1143
- return false;
1144
  }
1145
 
1146
  /**
@@ -1190,10 +1226,9 @@ function bp_is_action_variable( $action_variable = '', $position = false ) {
1190
  * @return bool True if $item is the current item.
1191
  */
1192
  function bp_is_current_item( $item = '' ) {
1193
- if ( !empty( $item ) && $item == bp_current_item() )
1194
- return true;
1195
 
1196
- return false;
1197
  }
1198
 
1199
  /**
@@ -1202,12 +1237,14 @@ function bp_is_current_item( $item = '' ) {
1202
  * @return bool True if looking at a single item, otherwise false.
1203
  */
1204
  function bp_is_single_item() {
1205
- global $bp;
 
1206
 
1207
- if ( !empty( $bp->is_single_item ) )
1208
- return true;
 
1209
 
1210
- return false;
1211
  }
1212
 
1213
  /**
@@ -1217,12 +1254,14 @@ function bp_is_single_item() {
1217
  * otherwise false.
1218
  */
1219
  function bp_is_item_admin() {
1220
- global $bp;
 
1221
 
1222
- if ( !empty( $bp->is_item_admin ) )
1223
- return true;
 
1224
 
1225
- return false;
1226
  }
1227
 
1228
  /**
@@ -1232,12 +1271,14 @@ function bp_is_item_admin() {
1232
  * otherwise false.
1233
  */
1234
  function bp_is_item_mod() {
1235
- global $bp;
 
1236
 
1237
- if ( !empty( $bp->is_item_mod ) )
1238
- return true;
 
1239
 
1240
- return false;
1241
  }
1242
 
1243
  /**
@@ -1247,34 +1288,47 @@ function bp_is_item_mod() {
1247
  * false.
1248
  */
1249
  function bp_is_directory() {
1250
- global $bp;
 
1251
 
1252
- if ( !empty( $bp->is_directory ) )
1253
- return true;
 
1254
 
1255
- return false;
1256
  }
1257
 
1258
  /**
1259
  * Check to see if a component's URL should be in the root, not under a member page.
1260
  *
1261
- * Yes ('groups' is root): http://domain.com/groups/the-group
1262
- * No ('groups' is not-root): http://domain.com/members/andy/groups/the-group
 
 
 
1263
  *
1264
  * @return bool True if root component, else false.
1265
  */
1266
- function bp_is_root_component( $component_name ) {
1267
- global $bp;
 
1268
 
1269
- if ( !isset( $bp->active_components ) )
1270
- return false;
 
 
1271
 
1272
- foreach ( (array) $bp->active_components as $key => $slug ) {
1273
- if ( $key == $component_name || $slug == $component_name )
1274
- return true;
 
 
 
 
 
1275
  }
1276
 
1277
- return false;
1278
  }
1279
 
1280
  /**
@@ -1284,26 +1338,37 @@ function bp_is_root_component( $component_name ) {
1284
  *
1285
  * @since BuddyPress (1.5.0)
1286
  *
1287
- * @global BuddyPress $bp The one true BuddyPress instance.
1288
  * @global $current_blog WordPress global for the current blog.
1289
  *
1290
  * @param string $component Optional. Name of the component to check for.
1291
- * Default: current component.
1292
  * @return bool True if the specified component is set to be the site's front
1293
- * page, otherwise false.
1294
  */
1295
  function bp_is_component_front_page( $component = '' ) {
1296
- global $bp, $current_blog;
 
 
 
 
 
 
 
1297
 
1298
- if ( !$component && !empty( $bp->current_component ) )
1299
- $component = $bp->current_component;
 
 
1300
 
1301
- $path = is_main_site() ? bp_core_get_site_path() : $current_blog->path;
 
 
1302
 
1303
- if ( 'page' != get_option( 'show_on_front' ) || !$component || empty( $bp->pages->{$component} ) || $_SERVER['REQUEST_URI'] != $path )
1304
  return false;
 
1305
 
1306
- return apply_filters( 'bp_is_component_front_page', ( $bp->pages->{$component}->id == get_option( 'page_on_front' ) ), $component );
1307
  }
1308
 
1309
  /**
@@ -1318,13 +1383,14 @@ function bp_is_blog_page() {
1318
 
1319
  $is_blog_page = false;
1320
 
1321
- // Generally, we can just check to see that there's no current component. The one exception
1322
- // is single user home tabs, where $bp->current_component is unset. Thus the addition
1323
- // of the bp_is_user() check.
1324
- if ( !bp_current_component() && !bp_is_user() )
1325
  $is_blog_page = true;
 
1326
 
1327
- return apply_filters( 'bp_is_blog_page', $is_blog_page );
1328
  }
1329
 
1330
  /**
@@ -1355,13 +1421,20 @@ function is_buddypress() {
1355
  * @param string $component The component name.
1356
  * @return bool True if the component is active, otherwise false.
1357
  */
1358
- function bp_is_active( $component ) {
1359
- global $bp;
1360
 
1361
- if ( isset( $bp->active_components[$component] ) || 'core' == $component )
1362
- return true;
 
 
1363
 
1364
- return false;
 
 
 
 
 
1365
  }
1366
 
1367
  /**
@@ -1370,10 +1443,7 @@ function bp_is_active( $component ) {
1370
  * @return bool True if the current page is part of the Members component.
1371
  */
1372
  function bp_is_members_component() {
1373
- if ( bp_is_current_component( 'members' ) )
1374
- return true;
1375
-
1376
- return false;
1377
  }
1378
 
1379
  /**
@@ -1382,10 +1452,7 @@ function bp_is_members_component() {
1382
  * @return bool True if the current page is part of the Profile component.
1383
  */
1384
  function bp_is_profile_component() {
1385
- if ( bp_is_current_component( 'xprofile' ) )
1386
- return true;
1387
-
1388
- return false;
1389
  }
1390
 
1391
  /**
@@ -1394,10 +1461,7 @@ function bp_is_profile_component() {
1394
  * @return bool True if the current page is part of the Activity component.
1395
  */
1396
  function bp_is_activity_component() {
1397
- if ( bp_is_current_component( 'activity' ) )
1398
- return true;
1399
-
1400
- return false;
1401
  }
1402
 
1403
  /**
@@ -1406,10 +1470,7 @@ function bp_is_activity_component() {
1406
  * @return bool True if the current page is part of the Blogs component.
1407
  */
1408
  function bp_is_blogs_component() {
1409
- if ( is_multisite() && bp_is_current_component( 'blogs' ) )
1410
- return true;
1411
-
1412
- return false;
1413
  }
1414
 
1415
  /**
@@ -1418,10 +1479,7 @@ function bp_is_blogs_component() {
1418
  * @return bool True if the current page is part of the Messages component.
1419
  */
1420
  function bp_is_messages_component() {
1421
- if ( bp_is_current_component( 'messages' ) )
1422
- return true;
1423
-
1424
- return false;
1425
  }
1426
 
1427
  /**
@@ -1430,10 +1488,7 @@ function bp_is_messages_component() {
1430
  * @return bool True if the current page is part of the Friends component.
1431
  */
1432
  function bp_is_friends_component() {
1433
- if ( bp_is_current_component( 'friends' ) )
1434
- return true;
1435
-
1436
- return false;
1437
  }
1438
 
1439
  /**
@@ -1442,10 +1497,7 @@ function bp_is_friends_component() {
1442
  * @return bool True if the current page is part of the Groups component.
1443
  */
1444
  function bp_is_groups_component() {
1445
- if ( bp_is_current_component( 'groups' ) )
1446
- return true;
1447
-
1448
- return false;
1449
  }
1450
 
1451
  /**
@@ -1454,10 +1506,7 @@ function bp_is_groups_component() {
1454
  * @return bool True if the current page is part of the Forums component.
1455
  */
1456
  function bp_is_forums_component() {
1457
- if ( bp_is_current_component( 'forums' ) )
1458
- return true;
1459
-
1460
- return false;
1461
  }
1462
 
1463
  /**
@@ -1468,11 +1517,7 @@ function bp_is_forums_component() {
1468
  * @return bool True if the current page is part of the Notifications component.
1469
  */
1470
  function bp_is_notifications_component() {
1471
- if ( bp_is_current_component( 'notifications' ) ) {
1472
- return true;
1473
- }
1474
-
1475
- return false;
1476
  }
1477
 
1478
  /**
@@ -1481,10 +1526,7 @@ function bp_is_notifications_component() {
1481
  * @return bool True if the current page is part of the Settings component.
1482
  */
1483
  function bp_is_settings_component() {
1484
- if ( bp_is_current_component( 'settings' ) )
1485
- return true;
1486
-
1487
- return false;
1488
  }
1489
 
1490
  /**
@@ -1500,10 +1542,9 @@ function bp_is_settings_component() {
1500
  * packaged components.
1501
  */
1502
  function bp_is_current_component_core() {
1503
- $retval = false;
1504
- $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
1505
 
1506
- foreach ( array_keys( $active_components ) as $active_component ) {
1507
  if ( bp_is_current_component( $active_component ) ) {
1508
  $retval = true;
1509
  break;
@@ -1519,12 +1560,13 @@ function bp_is_current_component_core() {
1519
  * Is the current page the activity directory ?
1520
  *
1521
  * @since BuddyPress (2.0.0)
1522
- *
1523
  * @return True if the current page is the activity directory.
1524
  */
1525
  function bp_is_activity_directory() {
1526
- if ( ! bp_displayed_user_id() && bp_is_activity_component() && ! bp_current_action() )
1527
  return true;
 
1528
 
1529
  return false;
1530
  }
@@ -1535,10 +1577,7 @@ function bp_is_activity_directory() {
1535
  * @return True if the current page is a single activity item permalink.
1536
  */
1537
  function bp_is_single_activity() {
1538
- if ( bp_is_activity_component() && is_numeric( bp_current_action() ) )
1539
- return true;
1540
-
1541
- return false;
1542
  }
1543
 
1544
  /** User **********************************************************************/
@@ -1547,12 +1586,13 @@ function bp_is_single_activity() {
1547
  * Is the current page the members directory ?
1548
  *
1549
  * @since BuddyPress (2.0.0)
1550
- *
1551
  * @return True if the current page is the members directory.
1552
  */
1553
  function bp_is_members_directory() {
1554
- if ( ! bp_is_user() && bp_is_members_component() )
1555
  return true;
 
1556
 
1557
  return false;
1558
  }
@@ -1566,10 +1606,11 @@ function bp_is_members_directory() {
1566
  * @return True if the current page is part of the profile of the logged-in user.
1567
  */
1568
  function bp_is_my_profile() {
1569
- if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() )
1570
  $my_profile = true;
1571
- else
1572
  $my_profile = false;
 
1573
 
1574
  return apply_filters( 'bp_is_my_profile', $my_profile );
1575
  }
@@ -1582,10 +1623,7 @@ function bp_is_my_profile() {
1582
  * @return True if the current page is a user page.
1583
  */
1584
  function bp_is_user() {
1585
- if ( bp_displayed_user_id() )
1586
- return true;
1587
-
1588
- return false;
1589
  }
1590
 
1591
  /**
@@ -1596,10 +1634,7 @@ function bp_is_user() {
1596
  * @return True if the current page is a user's activity stream page.
1597
  */
1598
  function bp_is_user_activity() {
1599
- if ( bp_is_user() && bp_is_activity_component() )
1600
- return true;
1601
-
1602
- return false;
1603
  }
1604
 
1605
  /**
@@ -1611,16 +1646,19 @@ function bp_is_user_activity() {
1611
  */
1612
  function bp_is_user_friends_activity() {
1613
 
1614
- if ( !bp_is_active( 'friends' ) )
1615
  return false;
 
1616
 
1617
  $slug = bp_get_friends_slug();
1618
 
1619
- if ( empty( $slug ) )
1620
  $slug = 'friends';
 
1621
 
1622
- if ( bp_is_user_activity() && bp_is_current_action( $slug ) )
1623
  return true;
 
1624
 
1625
  return false;
1626
  }
@@ -1634,16 +1672,17 @@ function bp_is_user_friends_activity() {
1634
  */
1635
  function bp_is_user_groups_activity() {
1636
 
1637
- if ( !bp_is_active( 'groups' ) )
1638
  return false;
 
1639
 
1640
- $slug = bp_get_groups_slug();
1641
-
1642
- if ( empty( $slug ) )
1643
- $slug = 'groups';
1644
 
1645
- if ( bp_is_user_activity() && bp_is_current_action( $slug ) )
1646
  return true;
 
1647
 
1648
  return false;
1649
  }
@@ -1656,10 +1695,7 @@ function bp_is_user_groups_activity() {
1656
  * @return True if the current page is part of a user's extended profile.
1657
  */
1658
  function bp_is_user_profile() {
1659
- if ( bp_is_profile_component() || bp_is_current_component( 'profile' ) )
1660
- return true;
1661
-
1662
- return false;
1663
  }
1664
 
1665
  /**
@@ -1670,17 +1706,11 @@ function bp_is_user_profile() {
1670
  * @return True if the current page is a user's profile edit page.
1671
  */
1672
  function bp_is_user_profile_edit() {
1673
- if ( bp_is_profile_component() && bp_is_current_action( 'edit' ) )
1674
- return true;
1675
-
1676
- return false;
1677
  }
1678
 
1679
  function bp_is_user_change_avatar() {
1680
- if ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) )
1681
- return true;
1682
-
1683
- return false;
1684
  }
1685
 
1686
  /**
@@ -1692,11 +1722,13 @@ function bp_is_user_change_avatar() {
1692
  */
1693
  function bp_is_user_forums() {
1694
 
1695
- if ( ! bp_is_active( 'forums' ) )
1696
  return false;
 
1697
 
1698
- if ( bp_is_user() && bp_is_forums_component() )
1699
  return true;
 
1700
 
1701
  return false;
1702
  }
@@ -1711,10 +1743,7 @@ function bp_is_user_forums() {
1711
  * @return bool True if the current page is a user's Topics Started page.
1712
  */
1713
  function bp_is_user_forums_started() {
1714
- if ( bp_is_user_forums() && bp_is_current_action( 'topics' ) )
1715
- return true;
1716
-
1717
- return false;
1718
  }
1719
 
1720
  /**
@@ -1727,10 +1756,7 @@ function bp_is_user_forums_started() {
1727
  * @return bool True if the current page is a user's Replied To forums page.
1728
  */
1729
  function bp_is_user_forums_replied_to() {
1730
- if ( bp_is_user_forums() && bp_is_current_action( 'replies' ) )
1731
- return true;
1732
-
1733
- return false;
1734
  }
1735
 
1736
  /**
@@ -1741,10 +1767,7 @@ function bp_is_user_forums_replied_to() {
1741
  * @return bool True if the current page is a user's Groups page.
1742
  */
1743
  function bp_is_user_groups() {
1744
- if ( bp_is_user() && bp_is_groups_component() )
1745
- return true;
1746
-
1747
- return false;
1748
  }
1749
 
1750
  /**
@@ -1755,10 +1778,7 @@ function bp_is_user_groups() {
1755
  * @return bool True if the current page is a user's Blogs page.
1756
  */
1757
  function bp_is_user_blogs() {
1758
- if ( bp_is_user() && bp_is_blogs_component() )
1759
- return true;
1760
-
1761
- return false;
1762
  }
1763
 
1764
  /**
@@ -1769,10 +1789,7 @@ function bp_is_user_blogs() {
1769
  * @return bool True if the current page is a user's Recent Blog Posts page.
1770
  */
1771
  function bp_is_user_recent_posts() {
1772
- if ( bp_is_user_blogs() && bp_is_current_action( 'recent-posts' ) )
1773
- return true;
1774
-
1775
- return false;
1776
  }
1777
 
1778
  /**
@@ -1783,10 +1800,7 @@ function bp_is_user_recent_posts() {
1783
  * @return bool True if the current page is a user's Recent Blog Comments page.
1784
  */
1785
  function bp_is_user_recent_commments() {
1786
- if ( bp_is_user_blogs() && bp_is_current_action( 'recent-comments' ) )
1787
- return true;
1788
-
1789
- return false;
1790
  }
1791
 
1792
  /**
@@ -1797,10 +1811,7 @@ function bp_is_user_recent_commments() {
1797
  * @return bool True if the current page is a user's Friends page.
1798
  */
1799
  function bp_is_user_friends() {
1800
- if ( bp_is_user() && bp_is_friends_component() )
1801
- return true;
1802
-
1803
- return false;
1804
  }
1805
 
1806
  /**
@@ -1811,10 +1822,7 @@ function bp_is_user_friends() {
1811
  * @return bool True if the current page is a user's Friends Requests page.
1812
  */
1813
  function bp_is_user_friend_requests() {
1814
- if ( bp_is_user_friends() && bp_is_current_action( 'requests' ) )
1815
- return true;
1816
-
1817
- return false;
1818
  }
1819
 
1820
  /**
@@ -1827,11 +1835,7 @@ function bp_is_user_friend_requests() {
1827
  * @return bool True if the current page is a user's Notifications page.
1828
  */
1829
  function bp_is_user_notifications() {
1830
- if ( bp_is_user() && bp_is_notifications_component() ) {
1831
- return true;
1832
- }
1833
-
1834
- return false;
1835
  }
1836
 
1837
  /**
@@ -1842,10 +1846,7 @@ function bp_is_user_notifications() {
1842
  * @return bool True if the current page is a user's Settings page.
1843
  */
1844
  function bp_is_user_settings() {
1845
- if ( bp_is_user() && bp_is_settings_component() )
1846
- return true;
1847
-
1848
- return false;
1849
  }
1850
 
1851
  /**
@@ -1858,10 +1859,7 @@ function bp_is_user_settings() {
1858
  * @return bool True if the current page is a user's General Settings page.
1859
  */
1860
  function bp_is_user_settings_general() {
1861
- if ( bp_is_user_settings() && bp_is_current_action( 'general' ) )
1862
- return true;
1863
-
1864
- return false;
1865
  }
1866
 
1867
  /**
@@ -1874,10 +1872,7 @@ function bp_is_user_settings_general() {
1874
  * @return bool True if the current page is a user's Notification Settings page.
1875
  */
1876
  function bp_is_user_settings_notifications() {
1877
- if ( bp_is_user_settings() && bp_is_current_action( 'notifications' ) )
1878
- return true;
1879
-
1880
- return false;
1881
  }
1882
 
1883
  /**
@@ -1890,10 +1885,7 @@ function bp_is_user_settings_notifications() {
1890
  * @return bool True if the current page is a user's Delete Account page.
1891
  */
1892
  function bp_is_user_settings_account_delete() {
1893
- if ( bp_is_user_settings() && bp_is_current_action( 'delete-account' ) )
1894
- return true;
1895
-
1896
- return false;
1897
  }
1898
 
1899
  /**
@@ -1906,10 +1898,7 @@ function bp_is_user_settings_account_delete() {
1906
  * @return bool True if the current page is a user's Profile Settings page.
1907
  */
1908
  function bp_is_user_settings_profile() {
1909
- if ( bp_is_user_settings() && bp_is_current_action( 'profile' ) )
1910
- return true;
1911
-
1912
- return false;
1913
  }
1914
 
1915
  /** Groups ********************************************************************/
@@ -1918,12 +1907,13 @@ function bp_is_user_settings_profile() {
1918
  * Is the current page the groups directory ?
1919
  *
1920
  * @since BuddyPress (2.0.0)
1921
- *
1922
  * @return True if the current page is the groups directory.
1923
  */
1924
  function bp_is_groups_directory() {
1925
- if ( bp_is_groups_component() && ! bp_current_action() && ! bp_current_item() )
1926
  return true;
 
1927
 
1928
  return false;
1929
  }
@@ -1936,12 +1926,13 @@ function bp_is_groups_directory() {
1936
  * @return bool True if the current page is part of a single group.
1937
  */
1938
  function bp_is_group() {
1939
- global $bp;
1940
 
1941
- if ( bp_is_groups_component() && isset( $bp->groups->current_group ) && $bp->groups->current_group )
1942
- return true;
1943
-
1944
- return false;
 
1945
  }
1946
 
1947
  /**
@@ -1953,8 +1944,9 @@ function bp_is_group() {
1953
  * @return bool True if the current page is a single group's home page.
1954
  */
1955
  function bp_is_group_home() {
1956
- if ( bp_is_single_item() && bp_is_groups_component() && ( !bp_current_action() || bp_is_current_action( 'home' ) ) )
1957
  return true;
 
1958
 
1959
  return false;
1960
  }
@@ -1965,10 +1957,7 @@ function bp_is_group_home() {
1965
  * @return bool True if the current page is part of the group creation process.
1966
  */
1967
  function bp_is_group_create() {
1968
- if ( bp_is_groups_component() && bp_is_current_action( 'create' ) )
1969
- return true;
1970
-
1971
- return false;
1972
  }
1973
 
1974
  /**
@@ -1979,10 +1968,7 @@ function bp_is_group_create() {
1979
  * @return bool True if the current page is part of a single group's admin.
1980
  */
1981
  function bp_is_group_admin_page() {
1982
- if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'admin' ) )
1983
- return true;
1984
-
1985
- return false;
1986
  }
1987
 
1988
  /**
@@ -2015,10 +2001,7 @@ function bp_is_group_forum() {
2015
  * @return True if the current page is a group's activity page.
2016
  */
2017
  function bp_is_group_activity() {
2018
- if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'activity' ) )
2019
- return true;
2020
-
2021
- return false;
2022
  }
2023
 
2024
  /**
@@ -2029,10 +2012,7 @@ function bp_is_group_activity() {
2029
  * @return bool True if the current page is part of a group forum topic.
2030
  */
2031
  function bp_is_group_forum_topic() {
2032
- if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) )
2033
- return true;
2034
-
2035
- return false;
2036
  }
2037
 
2038
  /**
@@ -2043,10 +2023,7 @@ function bp_is_group_forum_topic() {
2043
  * @return bool True if the current page is part of a group forum topic edit page.
2044
  */
2045
  function bp_is_group_forum_topic_edit() {
2046
- if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_is_action_variable( 'edit', 2 ) )
2047
- return true;
2048
-
2049
- return false;
2050
  }
2051
 
2052
  /**
@@ -2057,10 +2034,7 @@ function bp_is_group_forum_topic_edit() {
2057
  * @return bool True if the current page is part of a group's Members page.
2058
  */
2059
  function bp_is_group_members() {
2060
- if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'members' ) )
2061
- return true;
2062
-
2063
- return false;
2064
  }
2065
 
2066
  /**
@@ -2071,10 +2045,7 @@ function bp_is_group_members() {
2071
  * @return bool True if the current page is a group's Send Invites page.
2072
  */
2073
  function bp_is_group_invites() {
2074
- if ( bp_is_groups_component() && bp_is_current_action( 'send-invites' ) )
2075
- return true;
2076
-
2077
- return false;
2078
  }
2079
 
2080
  /**
@@ -2085,10 +2056,7 @@ function bp_is_group_invites() {
2085
  * @return bool True if the current page is a group's Request Membership page.
2086
  */
2087
  function bp_is_group_membership_request() {
2088
- if ( bp_is_groups_component() && bp_is_current_action( 'request-membership' ) )
2089
- return true;
2090
-
2091
- return false;
2092
  }
2093
 
2094
  /**
@@ -2097,11 +2065,7 @@ function bp_is_group_membership_request() {
2097
  * @return bool True if the current page is a Leave Group attempt.
2098
  */
2099
  function bp_is_group_leave() {
2100
-
2101
- if ( bp_is_groups_component() && bp_is_single_item() && bp_is_current_action( 'leave-group' ) )
2102
- return true;
2103
-
2104
- return false;
2105
  }
2106
 
2107
  /**
@@ -2114,10 +2078,7 @@ function bp_is_group_leave() {
2114
  * @return bool True if the current page is part of a single group.
2115
  */
2116
  function bp_is_group_single() {
2117
- if ( bp_is_groups_component() && bp_is_single_item() )
2118
- return true;
2119
-
2120
- return false;
2121
  }
2122
 
2123
  /**
@@ -2128,22 +2089,20 @@ function bp_is_group_single() {
2128
  * @return bool True if the current page is the Create a Blog page.
2129
  */
2130
  function bp_is_create_blog() {
2131
- if ( bp_is_blogs_component() && bp_is_current_action( 'create' ) )
2132
- return true;
2133
-
2134
- return false;
2135
  }
2136
 
2137
  /**
2138
  * Is the current page the blogs directory ?
2139
  *
2140
  * @since BuddyPress (2.0.0)
2141
- *
2142
  * @return True if the current page is the blogs directory.
2143
  */
2144
  function bp_is_blogs_directory() {
2145
- if ( is_multisite() && bp_is_blogs_component() && ! bp_current_action() )
2146
  return true;
 
2147
 
2148
  return false;
2149
  }
@@ -2158,10 +2117,7 @@ function bp_is_blogs_directory() {
2158
  * @return bool True if the current page is part of a user's Messages pages.
2159
  */
2160
  function bp_is_user_messages() {
2161
- if ( bp_is_user() && bp_is_messages_component() )
2162
- return true;
2163
-
2164
- return false;
2165
  }
2166
 
2167
  /**
@@ -2172,8 +2128,9 @@ function bp_is_user_messages() {
2172
  * @return bool True if the current page is a user's Messages Inbox.
2173
  */
2174
  function bp_is_messages_inbox() {
2175
- if ( bp_is_user_messages() && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) )
2176
  return true;
 
2177
 
2178
  return false;
2179
  }
@@ -2186,10 +2143,7 @@ function bp_is_messages_inbox() {
2186
  * @return bool True if the current page is a user's Messages Sentbox.
2187
  */
2188
  function bp_is_messages_sentbox() {
2189
- if ( bp_is_user_messages() && bp_is_current_action( 'sentbox' ) )
2190
- return true;
2191
-
2192
- return false;
2193
  }
2194
 
2195
  /**
@@ -2200,10 +2154,7 @@ function bp_is_messages_sentbox() {
2200
  * @return bool True if the current page is a user's Messages Compose screen.
2201
  */
2202
  function bp_is_messages_compose_screen() {
2203
- if ( bp_is_user_messages() && bp_is_current_action( 'compose' ) )
2204
- return true;
2205
-
2206
- return false;
2207
  }
2208
 
2209
  /**
@@ -2214,10 +2165,7 @@ function bp_is_messages_compose_screen() {
2214
  * @return bool True if the current page is the Notices screen.
2215
  */
2216
  function bp_is_notices() {
2217
- if ( bp_is_user_messages() && bp_is_current_action( 'notices' ) )
2218
- return true;
2219
-
2220
- return false;
2221
  }
2222
 
2223
  /**
@@ -2226,10 +2174,7 @@ function bp_is_notices() {
2226
  * @return bool True if the current page a single Messages conversation thread?
2227
  */
2228
  function bp_is_messages_conversation() {
2229
- if ( bp_is_user_messages() && ( bp_is_current_action( 'view' ) ) )
2230
- return true;
2231
-
2232
- return false;
2233
  }
2234
 
2235
  /**
@@ -2238,10 +2183,7 @@ function bp_is_messages_conversation() {
2238
  * @return bool
2239
  */
2240
  function bp_is_single( $component, $callback ) {
2241
- if ( bp_is_current_component( $component ) && ( true === call_user_func( $callback ) ) )
2242
- return true;
2243
-
2244
- return false;
2245
  }
2246
 
2247
  /** Registration **************************************************************/
@@ -2254,10 +2196,7 @@ function bp_is_single( $component, $callback ) {
2254
  * @return bool True if the current page is the Activate page.
2255
  */
2256
  function bp_is_activation_page() {
2257
- if ( bp_is_current_component( 'activate' ) )
2258
- return true;
2259
-
2260
- return false;
2261
  }
2262
 
2263
  /**
@@ -2268,10 +2207,7 @@ function bp_is_activation_page() {
2268
  * @return bool True if the current page is the Register page.
2269
  */
2270
  function bp_is_register_page() {
2271
- if ( bp_is_current_component( 'register' ) )
2272
- return true;
2273
-
2274
- return false;
2275
  }
2276
 
2277
  /**
@@ -2292,125 +2228,161 @@ function bp_the_body_class() {
2292
 
2293
  /** Pages *************************************************************/
2294
 
2295
- if ( is_front_page() )
2296
  $bp_classes[] = 'home-page';
 
2297
 
2298
- if ( bp_is_directory() )
2299
  $bp_classes[] = 'directory';
 
2300
 
2301
- if ( bp_is_single_item() )
2302
  $bp_classes[] = 'single-item';
 
2303
 
2304
  /** Components ********************************************************/
2305
 
2306
- if ( !bp_is_blog_page() ) :
2307
- if ( bp_is_user_profile() )
2308
  $bp_classes[] = 'xprofile';
 
2309
 
2310
- if ( bp_is_activity_component() )
2311
  $bp_classes[] = 'activity';
 
2312
 
2313
- if ( bp_is_blogs_component() )
2314
  $bp_classes[] = 'blogs';
 
2315
 
2316
- if ( bp_is_messages_component() )
2317
  $bp_classes[] = 'messages';
 
2318
 
2319
- if ( bp_is_friends_component() )
2320
  $bp_classes[] = 'friends';
 
2321
 
2322
- if ( bp_is_groups_component() )
2323
  $bp_classes[] = 'groups';
 
2324
 
2325
- if ( bp_is_settings_component() )
2326
  $bp_classes[] = 'settings';
2327
- endif;
 
2328
 
2329
  /** User **************************************************************/
2330
 
2331
- if ( bp_is_user() )
2332
  $bp_classes[] = 'bp-user';
 
2333
 
2334
- if ( !bp_is_directory() ) :
2335
- if ( bp_is_user_blogs() )
2336
  $bp_classes[] = 'my-blogs';
 
2337
 
2338
- if ( bp_is_user_groups() )
2339
  $bp_classes[] = 'my-groups';
 
2340
 
2341
- if ( bp_is_user_activity() )
2342
  $bp_classes[] = 'my-activity';
2343
- endif;
 
2344
 
2345
- if ( bp_is_my_profile() )
2346
  $bp_classes[] = 'my-account';
 
2347
 
2348
- if ( bp_is_user_profile() )
2349
  $bp_classes[] = 'my-profile';
 
2350
 
2351
- if ( bp_is_user_friends() )
2352
  $bp_classes[] = 'my-friends';
 
2353
 
2354
- if ( bp_is_user_messages() )
2355
  $bp_classes[] = 'my-messages';
 
2356
 
2357
- if ( bp_is_user_recent_commments() )
2358
  $bp_classes[] = 'recent-comments';
 
2359
 
2360
- if ( bp_is_user_recent_posts() )
2361
  $bp_classes[] = 'recent-posts';
 
2362
 
2363
- if ( bp_is_user_change_avatar() )
2364
  $bp_classes[] = 'change-avatar';
 
2365
 
2366
- if ( bp_is_user_profile_edit() )
2367
  $bp_classes[] = 'profile-edit';
 
2368
 
2369
- if ( bp_is_user_friends_activity() )
2370
  $bp_classes[] = 'friends-activity';
 
2371
 
2372
- if ( bp_is_user_groups_activity() )
2373
  $bp_classes[] = 'groups-activity';
 
2374
 
2375
  /** Messages **********************************************************/
2376
 
2377
- if ( bp_is_messages_inbox() )
2378
  $bp_classes[] = 'inbox';
 
2379
 
2380
- if ( bp_is_messages_sentbox() )
2381
  $bp_classes[] = 'sentbox';
 
2382
 
2383
- if ( bp_is_messages_compose_screen() )
2384
  $bp_classes[] = 'compose';
 
2385
 
2386
- if ( bp_is_notices() )
2387
  $bp_classes[] = 'notices';
 
2388
 
2389
- if ( bp_is_user_friend_requests() )
2390
  $bp_classes[] = 'friend-requests';
 
2391
 
2392
- if ( bp_is_create_blog() )
2393
  $bp_classes[] = 'create-blog';
 
2394
 
2395
  /** Groups ************************************************************/
2396
 
2397
- if ( bp_is_group_leave() )
2398
  $bp_classes[] = 'leave-group';
 
2399
 
2400
- if ( bp_is_group_invites() )
2401
  $bp_classes[] = 'group-invites';
 
2402
 
2403
- if ( bp_is_group_members() )
2404
  $bp_classes[] = 'group-members';
 
2405
 
2406
- if ( bp_is_group_forum_topic() )
2407
  $bp_classes[] = 'group-forum-topic';
 
2408
 
2409
- if ( bp_is_group_forum_topic_edit() )
2410
  $bp_classes[] = 'group-forum-topic-edit';
 
2411
 
2412
- if ( bp_is_group_forum() )
2413
  $bp_classes[] = 'group-forum';
 
2414
 
2415
  if ( bp_is_group_admin_page() ) {
2416
  $bp_classes[] = 'group-admin';
@@ -2422,23 +2394,27 @@ function bp_the_body_class() {
2422
  $bp_classes[] = bp_get_groups_current_create_step();
2423
  }
2424
 
2425
- if ( bp_is_group_home() )
2426
  $bp_classes[] = 'group-home';
 
2427
 
2428
- if ( bp_is_single_activity() )
2429
  $bp_classes[] = 'activity-permalink';
 
2430
 
2431
  /** Registration ******************************************************/
2432
 
2433
- if ( bp_is_register_page() )
2434
  $bp_classes[] = 'registration';
 
2435
 
2436
- if ( bp_is_activation_page() )
2437
  $bp_classes[] = 'activation';
 
2438
 
2439
  /** Current Component & Action ****************************************/
2440
 
2441
- if ( !bp_is_blog_page() ) {
2442
  $bp_classes[] = bp_current_component();
2443
  $bp_classes[] = bp_current_action();
2444
  }
@@ -2457,6 +2433,67 @@ function bp_the_body_class() {
2457
  }
2458
  add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 );
2459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2460
  /**
2461
  * Sort BuddyPress nav menu items by their position property.
2462
  *
@@ -2472,14 +2509,13 @@ function bp_the_body_class() {
2472
  * the first argument is considered to be respectively less than, equal to, or greater than the second.
2473
  */
2474
  function _bp_nav_menu_sort( $a, $b ) {
2475
- if ( $a["position"] == $b["position"] )
2476
  return 0;
2477
-
2478
- else if ( $a["position"] < $b["position"] )
2479
  return -1;
2480
-
2481
- else
2482
  return 1;
 
2483
  }
2484
 
2485
  /**
@@ -2496,8 +2532,9 @@ function bp_get_nav_menu_items() {
2496
  foreach ( (array) buddypress()->bp_options_nav as $parent_menu => $sub_menus ) {
2497
 
2498
  // The root menu's ID is "xprofile", but the Profile submenus are using "profile". See BP_Core::setup_nav().
2499
- if ( 'profile' == $parent_menu )
2500
  $parent_menu = 'xprofile';
 
2501
 
2502
  // Sort the items in this menu's navigation by their position property
2503
  $second_level_menus = (array) $sub_menus;
@@ -2507,12 +2544,13 @@ function bp_get_nav_menu_items() {
2507
  foreach( $second_level_menus as $sub_nav ) {
2508
 
2509
  // Skip items we don't have access to
2510
- if ( ! $sub_nav['user_has_access'] )
2511
  continue;
 
2512
 
2513
  // Add this menu
2514
  $menu = new stdClass;
2515
- $menu->class = array();
2516
  $menu->css_id = $sub_nav['css_id'];
2517
  $menu->link = $sub_nav['link'];
2518
  $menu->name = $sub_nav['name'];
@@ -2520,7 +2558,7 @@ function bp_get_nav_menu_items() {
2520
 
2521
  // If we're viewing this item's screen, record that we need to mark its parent menu to be selected
2522
  if ( $sub_nav['slug'] == bp_current_action() ) {
2523
- $menu->class = array( 'current-menu-item' );
2524
  $selected_menus[] = $parent_menu;
2525
  }
2526
 
@@ -2536,23 +2574,25 @@ function bp_get_nav_menu_items() {
2536
  foreach ( $top_level_menus as $nav ) {
2537
 
2538
  // Skip items marked as user-specific if you're not on your own profile
2539
- if ( ! $nav['show_for_displayed_user'] && ! bp_core_can_edit_settings() )
2540
  continue;
 
2541
 
2542
  // Get the correct menu link. See http://buddypress.trac.wordpress.org/ticket/4624
2543
  $link = bp_loggedin_user_domain() ? str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $nav['link'] ) : trailingslashit( bp_displayed_user_domain() . $nav['link'] );
2544
 
2545
  // Add this menu
2546
  $menu = new stdClass;
2547
- $menu->class = array();
2548
  $menu->css_id = $nav['css_id'];
2549
  $menu->link = $link;
2550
  $menu->name = $nav['name'];
2551
  $menu->parent = 0;
2552
 
2553
  // Check if we need to mark this menu as selected
2554
- if ( in_array( $nav['css_id'], $selected_menus ) )
2555
- $menu->class = array( 'current-menu-parent' );
 
2556
 
2557
  $menus[] = $menu;
2558
  }
@@ -2623,8 +2663,9 @@ function bp_nav_menu( $args = array() ) {
2623
  $show_container = false;
2624
 
2625
  // Create custom walker if one wasn't set
2626
- if ( empty( $args->walker ) )
2627
  $args->walker = new BP_Walker_Nav_Menu;
 
2628
 
2629
  // Sanitise values for class and ID
2630
  $args->container_class = sanitize_html_class( $args->container_class );
@@ -2657,10 +2698,11 @@ function bp_nav_menu( $args = array() ) {
2657
 
2658
  // If a specific ID wasn't requested, and there are multiple menus on the same screen, make sure the autogenerated ID is unique
2659
  while ( in_array( $wrap_id, $menu_id_slugs ) ) {
2660
- if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) )
2661
  $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
2662
- else
2663
  $wrap_id = $wrap_id . '-1';
 
2664
  }
2665
  }
2666
  $menu_id_slugs[] = $wrap_id;
@@ -2674,14 +2716,16 @@ function bp_nav_menu( $args = array() ) {
2674
  unset( $items );
2675
 
2676
  // If we've wrapped the ul, close it
2677
- if ( $show_container )
2678
  $nav_menu .= '</' . $args->container . '>';
 
2679
 
2680
  // Final chance to modify output
2681
  $nav_menu = apply_filters( 'bp_nav_menu', $nav_menu, $args );
2682
 
2683
- if ( $args->echo )
2684
  echo $nav_menu;
2685
- else
2686
  return $nav_menu;
 
2687
  }
23
  * The function will also analyze the current action for the current component
24
  * to determine whether or not to highlight a particular sub nav item.
25
  *
 
26
  * @uses bp_get_user_nav() Renders the navigation for a profile of a currently
27
  * viewed user.
28
  */
29
  function bp_get_options_nav() {
30
+ $bp = buddypress();
31
 
32
+ // If we are looking at a member profile, then the we can use the current
33
+ // component as an index. Otherwise we need to use the component's root_slug
34
  $component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() );
35
 
36
+ if ( ! bp_is_single_item() ) {
37
  if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) {
38
  return false;
39
  } else {
49
 
50
  // Loop through each navigation item
51
  foreach ( (array) $bp->bp_options_nav[$the_index] as $subnav_item ) {
52
+ if ( empty( $subnav_item['user_has_access'] ) ) {
53
  continue;
54
+ }
55
 
56
  // If the current action or an action variable matches the nav item id, then add a highlight CSS class.
57
  if ( $subnav_item['slug'] == bp_current_action() ) {
75
  * @todo Deprecate.
76
  */
77
  function bp_get_options_title() {
78
+ $bp = buddypress();
79
 
80
+ if ( empty( $bp->bp_options_title ) ) {
81
  $bp->bp_options_title = __( 'Options', 'buddypress' );
82
+ }
83
 
84
  echo apply_filters( 'bp_get_options_title', esc_attr( $bp->bp_options_title ) );
85
  }
102
  $title = buddypress()->{$component}->directory_title;
103
 
104
  // If none is found, concatenate
105
+ } elseif ( isset( buddypress()->{$component}->name ) ) {
106
  $title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name );
107
  }
108
 
119
  *
120
  * Not currently used in BuddyPress.
121
  *
122
+ * @return bool Returns true if an options avatar has been set, otherwise false.
 
 
 
 
123
  */
124
  function bp_has_options_avatar() {
125
+ return (bool) buddypress()->bp_options_avatar;
 
 
 
 
 
126
  }
127
 
128
  /**
133
  * @todo Deprecate.
134
  */
135
  function bp_get_options_avatar() {
136
+ echo apply_filters( 'bp_get_options_avatar', buddypress()->bp_options_avatar );
 
 
137
  }
138
 
139
  /**
140
  * Output a comment author's avatar.
141
  *
142
  * Not currently used in BuddyPress.
 
 
143
  */
144
  function bp_comment_author_avatar() {
145
  global $comment;
146
 
147
+ if ( function_exists( 'bp_core_fetch_avatar' ) ) {
148
+ echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array(
149
+ 'item_id' => $comment->user_id,
150
+ 'type' => 'thumb',
151
+ 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) )
152
+ ) ) );
153
+ } elseif ( function_exists( 'get_avatar' ) ) {
154
  get_avatar();
155
+ }
156
  }
157
 
158
  /**
159
  * Output a post author's avatar.
160
  *
161
  * Not currently used in BuddyPress.
 
 
162
  */
163
  function bp_post_author_avatar() {
164
  global $post;
165
 
166
+ if ( function_exists( 'bp_core_fetch_avatar' ) ) {
167
+ echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array(
168
+ 'item_id' => $post->post_author,
169
+ 'type' => 'thumb',
170
+ 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) )
171
+ ) ) );
172
+ } elseif ( function_exists( 'get_avatar' ) ) {
173
  get_avatar();
174
+ }
175
  }
176
 
177
  /**
187
  * if none is found.
188
  */
189
  function bp_get_avatar_admin_step() {
190
+ $bp = buddypress();
191
+ $step = isset( $bp->avatar_admin->step )
192
+ ? $step = $bp->avatar_admin->step
193
+ : 'upload-image';
 
 
194
 
195
  return apply_filters( 'bp_get_avatar_admin_step', $step );
196
  }
207
  * @return string URL of the avatar awaiting cropping.
208
  */
209
  function bp_get_avatar_to_crop() {
210
+ $bp = buddypress();
211
+ $url = isset( $bp->avatar_admin->image->url )
212
+ ? $bp->avatar_admin->image->url
213
+ : '';
 
 
214
 
215
  return apply_filters( 'bp_get_avatar_to_crop', $url );
216
  }
227
  * @return string Relative file path to the avatar.
228
  */
229
  function bp_get_avatar_to_crop_src() {
230
+ $bp = buddypress();
231
+ $src = isset( $bp->avatar_admin->image->dir )
232
+ ? str_replace( WP_CONTENT_DIR, '', $bp->avatar_admin->image->dir )
233
+ : '';
234
 
235
+ return apply_filters( 'bp_get_avatar_to_crop_src', $src );
236
  }
237
 
238
  /**
243
  * @todo Deprecate.
244
  */
245
  function bp_avatar_cropper() {
246
+ ?>
247
+ <img id="avatar-to-crop" class="avatar" src="<?php echo esc_url( buddypress()->avatar_admin->image ); ?>" />
248
+ <?php
249
  }
250
 
251
  /**
276
  * 'date_format' and 'time_format' settings are). False on failure.
277
  */
278
  function bp_format_time( $time, $just_date = false, $localize_time = true ) {
279
+
280
+ if ( ! isset( $time ) || ! is_numeric( $time ) ) {
281
  return false;
282
+ }
283
 
284
  // Get GMT offset from root blog
285
  $root_blog_offset = false;
286
+ if ( ! empty( $localize_time ) ) {
287
  $root_blog_offset = get_blog_option( bp_get_root_blog_id(), 'gmt_offset' );
288
+ }
289
 
290
  // Calculate offset time
291
  $time_offset = $time + ( $root_blog_offset * 3600 );
294
  $date = date_i18n( get_option( 'date_format' ), $time_offset );
295
 
296
  // Should we show the time also?
297
+ if ( empty( $just_date ) ) {
298
  // Current time (9:50pm)
299
  $time = date_i18n( get_option( 'time_format' ), $time_offset );
300
 
325
  */
326
  function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) {
327
 
328
+ if ( ! empty( $capitalize ) ) {
329
  $youtext = bp_core_ucfirst( $youtext );
330
+ }
331
 
332
  if ( bp_displayed_user_id() == bp_loggedin_user_id() ) {
333
  if ( true == $echo ) {
381
 
382
  $options = array();
383
 
384
+ if ( bp_is_active( 'xprofile' ) ) {
385
+ $options['members'] = _x( 'Members', 'search form', 'buddypress' );
386
+ }
387
 
388
+ if ( bp_is_active( 'groups' ) ) {
389
+ $options['groups'] = _x( 'Groups', 'search form', 'buddypress' );
390
+ }
391
 
392
+ if ( bp_is_active( 'blogs' ) && is_multisite() ) {
393
+ $options['blogs'] = _x( 'Blogs', 'search form', 'buddypress' );
394
+ }
395
 
396
+ if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && bp_forums_has_directory() ) {
397
+ $options['forums'] = _x( 'Forums', 'search form', 'buddypress' );
398
+ }
399
 
400
+ $options['posts'] = _x( 'Posts', 'search form', 'buddypress' );
401
 
402
  // Eventually this won't be needed and a page will be built to integrate all search results.
403
+ $selection_box = '<label for="search-which" class="accessibly-hidden">' . _x( 'Search these:', 'search form', 'buddypress' ) . '</label>';
404
  $selection_box .= '<select name="search-which" id="search-which" style="width: auto">';
405
 
406
  $options = apply_filters( 'bp_search_form_type_select_options', $options );
407
+ foreach( (array) $options as $option_value => $option_title ) {
408
  $selection_box .= sprintf( '<option value="%s">%s</option>', $option_value, $option_title );
409
+ }
410
 
411
  $selection_box .= '</select>';
412
 
436
  function bp_get_search_default_text( $component = '' ) {
437
  global $bp;
438
 
439
+ if ( empty( $component ) ) {
440
  $component = bp_current_component();
441
+ }
442
 
443
  $default_text = __( 'Search anything...', 'buddypress' );
444
 
451
  // name out of $bp->pages
452
  if ( !empty( $bp->pages->{$component}->slug ) ) {
453
  $key = $bp->pages->{$component}->slug;
454
+ if ( !empty( $bp->{$key}->search_string ) ) {
455
  $default_text = $bp->{$key}->search_string;
456
+ }
457
  }
458
  }
459
  }
539
  * @return string Trimmed string.
540
  */
541
  function bp_create_excerpt( $text, $length = 225, $options = array() ) {
542
+
543
  // Backward compatibility. The third argument used to be a boolean $filter_shortcodes
544
  $filter_shortcodes_default = is_bool( $options ) ? $options : true;
545
 
546
+ $r = bp_parse_args( $options, array(
547
  'ending' => __( ' [&hellip;]', 'buddypress' ),
548
  'exact' => false,
549
  'html' => true,
550
  'filter_shortcodes' => $filter_shortcodes_default
551
+ ), 'create_excerpt' );
 
 
552
 
553
  // Save the original text, to be passed along to the filter
554
  $original_text = $text;
555
 
556
  // Allow plugins to modify these values globally
557
+ $length = apply_filters( 'bp_excerpt_length', $length );
558
+ $ending = apply_filters( 'bp_excerpt_append_text', $r['ending'] );
559
 
560
  // Remove shortcodes if necessary
561
+ if ( ! empty( $r['filter_shortcodes'] ) ) {
562
  $text = strip_shortcodes( $text );
563
+ }
564
 
565
  // When $html is true, the excerpt should be created without including HTML tags in the
566
  // excerpt length
567
+ if ( ! empty( $r['html'] ) ) {
568
+
569
  // The text is short enough. No need to truncate
570
  if ( mb_strlen( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) {
571
  return $text;
578
  // Find all the tags and put them in a stack for later use
579
  preg_match_all( '/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
580
  foreach ( $tags as $tag ) {
581
+
582
  // Process tags that need to be closed
583
  if ( !preg_match( '/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2] ) ) {
584
  if ( preg_match( '/<[\w]+[^>]*>/s', $tag[0] ) ) {
585
  array_unshift( $openTags, $tag[2] );
586
+ } elseif ( preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag ) ) {
587
  $pos = array_search( $closeTag[1], $openTags );
588
  if ( $pos !== false ) {
589
  array_splice( $openTags, $pos, 1 );
590
  }
591
  }
592
  }
 
593
 
594
+ $truncate .= $tag[1];
595
  $contentLength = mb_strlen( preg_replace( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3] ) );
596
+
597
  if ( $contentLength + $totalLength > $length ) {
598
  $left = $length - $totalLength;
599
  $entitiesLength = 0;
627
  }
628
 
629
  // If $exact is false, we can't break on words
630
+ if ( empty( $r['exact'] ) ) {
631
  $spacepos = mb_strrpos( $truncate, ' ' );
632
  if ( isset( $spacepos ) ) {
633
+ if ( $r['html'] ) {
634
  $bits = mb_substr( $truncate, $spacepos );
635
  preg_match_all( '/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER );
636
  if ( !empty( $droppedTags ) ) {
646
  }
647
  $truncate .= $ending;
648
 
649
+ if ( !empty( $r['html'] ) ) {
650
  foreach ( $openTags as $tag ) {
651
  $truncate .= '</' . $tag . '>';
652
  }
653
  }
654
 
655
  return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options );
 
656
  }
657
+ add_filter( 'bp_create_excerpt', 'stripslashes_deep' );
658
  add_filter( 'bp_create_excerpt', 'force_balance_tags' );
659
 
660
  /**
699
  * @return bool True if blog signup is allowed, otherwise false.
700
  */
701
  function bp_get_blog_signup_allowed() {
 
702
 
703
+ if ( ! is_multisite() ) {
704
  return false;
705
+ }
706
 
707
+ $status = buddypress()->site_options['registration'];
708
+ if ( ( 'none' !== $status ) && ( 'user' !== $status ) ) {
709
  return true;
710
+ }
711
 
712
  return false;
713
  }
719
  * otherwise false.
720
  */
721
  function bp_account_was_activated() {
722
+ $bp = buddypress();
723
+ $activation_complete = !empty( $bp->activation_complete )
724
+ ? $bp->activation_complete
725
+ : false;
726
 
727
  return $activation_complete;
728
  }
765
  */
766
  function bp_get_email_subject( $args = array() ) {
767
 
768
+ $r = bp_parse_args( $args, array(
769
  'before' => '[',
770
  'after' => ']',
771
  'default' => __( 'Community', 'buddypress' ),
772
  'text' => ''
773
+ ), 'get_email_subject' );
774
 
775
  $subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text'];
776
 
791
  * @return string The AJAX querystring.
792
  */
793
  function bp_ajax_querystring( $object = false ) {
794
+ $bp = buddypress();
795
 
796
+ if ( ! isset( $bp->ajax_querystring ) ) {
797
  $bp->ajax_querystring = '';
798
+ }
799
 
800
  return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring, $object );
801
  }
808
  * @return string Component name.
809
  */
810
  function bp_current_component() {
811
+ $bp = buddypress();
812
+ $current_component = !empty( $bp->current_component )
813
+ ? $bp->current_component
814
+ : false;
815
+
816
  return apply_filters( 'bp_current_component', $current_component );
817
  }
818
 
822
  * @return string Action name.
823
  */
824
  function bp_current_action() {
825
+ $bp = buddypress();
826
+ $current_action = !empty( $bp->current_action )
827
+ ? $bp->current_action
828
+ : '';
829
+
830
  return apply_filters( 'bp_current_action', $current_action );
831
  }
832
 
836
  * @return unknown
837
  */
838
  function bp_current_item() {
839
+ $bp = buddypress();
840
+ $current_item = !empty( $bp->current_item )
841
+ ? $bp->current_item
842
+ : false;
843
+
844
  return apply_filters( 'bp_current_item', $current_item );
845
  }
846
 
851
  * if the array is empty.
852
  */
853
  function bp_action_variables() {
854
+ $bp = buddypress();
855
+ $action_variables = !empty( $bp->action_variables )
856
+ ? $bp->action_variables
857
+ : false;
858
+
859
  return apply_filters( 'bp_action_variables', $action_variables );
860
  }
861
 
870
  */
871
  function bp_action_variable( $position = 0 ) {
872
  $action_variables = bp_action_variables();
873
+ $action_variable = isset( $action_variables[ $position ] )
874
+ ? $action_variables[ $position ]
875
+ : false;
876
 
877
  return apply_filters( 'bp_action_variable', $action_variable, $position );
878
  }
889
  * @return string URL of the BP root blog.
890
  */
891
  function bp_get_root_domain() {
892
+ $bp = buddypress();
893
 
894
+ if ( ! empty( $bp->root_domain ) ) {
895
  $domain = $bp->root_domain;
896
  } else {
897
  $domain = bp_core_get_root_domain();
938
  *
939
  * @since BuddyPress (1.5.0)
940
  *
 
 
941
  * @param string $component Optional. Defaults to the current component.
942
  * @return string $root_slug The root slug.
943
  */
944
  function bp_get_root_slug( $component = '' ) {
945
+ $bp = buddypress();
 
946
  $root_slug = '';
947
 
948
  // Use current global component if none passed
949
+ if ( empty( $component ) ) {
950
  $component = bp_current_component();
951
+ }
952
 
953
  // Component is active
954
+ if ( ! empty( $bp->active_components[ $component ] ) ) {
955
+
956
  // Backward compatibility: in legacy plugins, the canonical component id
957
  // was stored as an array value in $bp->active_components
958
+ $component_name = ( '1' == $bp->active_components[ $component ] )
959
+ ? $component
960
+ : $bp->active_components[$component];
961
 
962
  // Component has specific root slug
963
+ if ( ! empty( $bp->{$component_name}->root_slug ) ) {
964
  $root_slug = $bp->{$component_name}->root_slug;
965
  }
966
  }
967
 
968
  // No specific root slug, so fall back to component slug
969
+ if ( empty( $root_slug ) ) {
970
  $root_slug = $component;
971
+ }
972
 
973
  return apply_filters( 'bp_get_root_slug', $root_slug, $component );
974
  }
978
  *
979
  * @since BuddyPress (1.5.0)
980
  *
 
 
981
  * @param string $root_slug Needle to our active component haystack.
982
  * @return mixed False if none found, component name if found.
983
  */
984
  function bp_get_name_from_root_slug( $root_slug = '' ) {
985
+ $bp = buddypress();
986
 
987
  // If no slug is passed, look at current_component
988
+ if ( empty( $root_slug ) ) {
989
  $root_slug = bp_current_component();
990
+ }
991
 
992
  // No current component or root slug, so flee
993
+ if ( empty( $root_slug ) ) {
994
  return false;
995
+ }
996
 
997
  // Loop through active components and look for a match
998
  foreach ( array_keys( $bp->active_components ) as $component ) {
999
+ if ( ( ! empty( $bp->{$component}->slug ) && ( $bp->{$component}->slug == $root_slug ) ) || ( ! empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug === $root_slug ) ) ) {
1000
  return $bp->{$component}->name;
1001
  }
1002
  }
1005
  }
1006
 
1007
  function bp_user_has_access() {
1008
+ $has_access = ( bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() )
1009
+ ? true
1010
+ : false;
1011
 
1012
+ return (bool) apply_filters( 'bp_user_has_access', $has_access );
1013
  }
1014
 
1015
  /**
1042
  */
1043
  function bp_displayed_user_id() {
1044
  $bp = buddypress();
1045
+ $id = !empty( $bp->displayed_user->id )
1046
+ ? $bp->displayed_user->id
1047
+ : 0;
1048
 
1049
  return (int) apply_filters( 'bp_displayed_user_id', $id );
1050
  }
1058
  */
1059
  function bp_loggedin_user_id() {
1060
  $bp = buddypress();
1061
+ $id = !empty( $bp->loggedin_user->id )
1062
+ ? $bp->loggedin_user->id
1063
+ : 0;
1064
 
1065
  return (int) apply_filters( 'bp_loggedin_user_id', $id );
1066
  }
1082
  * @return bool Returns true if the component matches, or else false.
1083
  */
1084
  function bp_is_current_component( $component ) {
1085
+ global $wp_query;
1086
 
1087
  $is_current_component = false;
1088
 
1092
  }
1093
 
1094
  // Backward compatibility: 'xprofile' should be read as 'profile'
1095
+ if ( 'xprofile' === $component ) {
1096
  $component = 'profile';
1097
+ }
1098
+
1099
+ $bp = buddypress();
1100
 
1101
  if ( ! empty( $bp->current_component ) ) {
1102
 
1117
  // Next, check to see whether $component is a canonical,
1118
  // non-translatable component name. If so, we can return its
1119
  // corresponding slug from $bp->active_components.
1120
+ } elseif ( $key = array_search( $component, $bp->active_components ) ) {
1121
  if ( strstr( $bp->current_component, $key ) ) {
1122
  $is_current_component = true;
1123
  }
1142
  // Page template fallback check if $bp->current_component is empty
1143
  } elseif ( !is_admin() && is_a( $wp_query, 'WP_Query' ) && is_page() ) {
1144
  global $wp_query;
 
 
 
1145
 
1146
+ $page = $wp_query->get_queried_object();
1147
+ if ( isset( $page->ID ) ) {
1148
+ $custom_fields = get_post_custom_values( '_wp_page_template', $page->ID );
1149
+ $page_template = $custom_fields[0];
1150
+
1151
+ // Component name is in the page template name
1152
+ if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
1153
+ $is_current_component = true;
1154
+ }
1155
  }
1156
  }
1157
 
1176
  * @return bool True if the current action matches $action.
1177
  */
1178
  function bp_is_current_action( $action = '' ) {
1179
+ return (bool) ( $action === bp_current_action() );
 
 
 
1180
  }
1181
 
1182
  /**
1226
  * @return bool True if $item is the current item.
1227
  */
1228
  function bp_is_current_item( $item = '' ) {
1229
+ $retval = ( $item === bp_current_item() );
 
1230
 
1231
+ return (bool) apply_filters( 'bp_is_current_item', $retval, $item );
1232
  }
1233
 
1234
  /**
1237
  * @return bool True if looking at a single item, otherwise false.
1238
  */
1239
  function bp_is_single_item() {
1240
+ $bp = buddypress();
1241
+ $retval = false;
1242
 
1243
+ if ( isset( $bp->is_single_item ) ) {
1244
+ $retval = $bp->is_single_item;
1245
+ }
1246
 
1247
+ return (bool) apply_filters( 'bp_is_single_item', $retval );
1248
  }
1249
 
1250
  /**
1254
  * otherwise false.
1255
  */
1256
  function bp_is_item_admin() {
1257
+ $bp = buddypress();
1258
+ $retval = false;
1259
 
1260
+ if ( isset( $bp->is_item_admin ) ) {
1261
+ $retval = $bp->is_item_admin;
1262
+ }
1263
 
1264
+ return (bool) apply_filters( 'bp_is_item_admin', $retval );
1265
  }
1266
 
1267
  /**
1271
  * otherwise false.
1272
  */
1273
  function bp_is_item_mod() {
1274
+ $bp = buddypress();
1275
+ $retval = false;
1276
 
1277
+ if ( isset( $bp->is_item_mod ) ) {
1278
+ $retval = $bp->is_item_mod;
1279
+ }
1280
 
1281
+ return (bool) apply_filters( 'bp_is_item_mod', $retval );
1282
  }
1283
 
1284
  /**
1288
  * false.
1289
  */
1290
  function bp_is_directory() {
1291
+ $bp = buddypress();
1292
+ $retval = false;
1293
 
1294
+ if ( isset( $bp->is_directory ) ) {
1295
+ $retval = $bp->is_directory;
1296
+ }
1297
 
1298
+ return (bool) apply_filters( 'bp_is_directory', $retval );
1299
  }
1300
 
1301
  /**
1302
  * Check to see if a component's URL should be in the root, not under a member page.
1303
  *
1304
+ * - Yes ('groups' is root) : http://domain.com/groups/the-group
1305
+ * - No ('groups' is not-root): http://domain.com/members/andy/groups/the-group
1306
+ *
1307
+ * This function is on the chopping block. It's currently only used by a few
1308
+ * already deprecated functions.
1309
  *
1310
  * @return bool True if root component, else false.
1311
  */
1312
+ function bp_is_root_component( $component_name = '' ) {
1313
+ $bp = buddypress();
1314
+ $retval = false;
1315
 
1316
+ // Default to the current component if none is passed
1317
+ if ( empty( $component_name ) ) {
1318
+ $component_name = bp_current_component();
1319
+ }
1320
 
1321
+ // Loop through active components and check for key/slug matches
1322
+ if ( ! empty( $bp->active_components ) ) {
1323
+ foreach ( (array) $bp->active_components as $key => $slug ) {
1324
+ if ( ( $key === $component_name ) || ( $slug === $component_name ) ) {
1325
+ $retval = true;
1326
+ break;
1327
+ }
1328
+ }
1329
  }
1330
 
1331
+ return (bool) apply_filters( 'bp_is_root_component', $retval );
1332
  }
1333
 
1334
  /**
1338
  *
1339
  * @since BuddyPress (1.5.0)
1340
  *
 
1341
  * @global $current_blog WordPress global for the current blog.
1342
  *
1343
  * @param string $component Optional. Name of the component to check for.
1344
+ * Default: current component.
1345
  * @return bool True if the specified component is set to be the site's front
1346
+ * page, otherwise false.
1347
  */
1348
  function bp_is_component_front_page( $component = '' ) {
1349
+ global $current_blog;
1350
+
1351
+ $bp = buddypress();
1352
+
1353
+ // Default to the current component if none is passed
1354
+ if ( empty( $component ) ) {
1355
+ $component = bp_current_component();
1356
+ }
1357
 
1358
+ // Get the path for the current blog/site
1359
+ $path = is_main_site()
1360
+ ? bp_core_get_site_path()
1361
+ : $current_blog->path;
1362
 
1363
+ // Get the front page variables
1364
+ $show_on_front = get_option( 'show_on_front' );
1365
+ $page_on_front = get_option( 'page_on_front' );
1366
 
1367
+ if ( ( 'page' !== $show_on_front ) || empty( $component ) || empty( $bp->pages->{$component} ) || ( $_SERVER['REQUEST_URI'] !== $path ) ) {
1368
  return false;
1369
+ }
1370
 
1371
+ return (bool) apply_filters( 'bp_is_component_front_page', ( $bp->pages->{$component}->id == $page_on_front ), $component );
1372
  }
1373
 
1374
  /**
1383
 
1384
  $is_blog_page = false;
1385
 
1386
+ // Generally, we can just check to see that there's no current component.
1387
+ // The one exception is single user home tabs, where $bp->current_component
1388
+ // is unset. Thus the addition of the bp_is_user() check.
1389
+ if ( ! bp_current_component() && ! bp_is_user() ) {
1390
  $is_blog_page = true;
1391
+ }
1392
 
1393
+ return (bool) apply_filters( 'bp_is_blog_page', $is_blog_page );
1394
  }
1395
 
1396
  /**
1421
  * @param string $component The component name.
1422
  * @return bool True if the component is active, otherwise false.
1423
  */
1424
+ function bp_is_active( $component = '' ) {
1425
+ $retval = false;
1426
 
1427
+ // Default to the current component if none is passed
1428
+ if ( empty( $component ) ) {
1429
+ $component = bp_current_component();
1430
+ }
1431
 
1432
+ // Is component in either the active or required components arrays
1433
+ if ( isset( buddypress()->active_components[ $component ] ) || isset( buddypress()->required_components[ $component ] ) ) {
1434
+ $retval = true;
1435
+ }
1436
+
1437
+ return apply_filters( 'bp_is_active', $retval, $component );
1438
  }
1439
 
1440
  /**
1443
  * @return bool True if the current page is part of the Members component.
1444
  */
1445
  function bp_is_members_component() {
1446
+ return (bool) bp_is_current_component( 'members' );
 
 
 
1447
  }
1448
 
1449
  /**
1452
  * @return bool True if the current page is part of the Profile component.
1453
  */
1454
  function bp_is_profile_component() {
1455
+ return (bool) bp_is_current_component( 'xprofile' );
 
 
 
1456
  }
1457
 
1458
  /**
1461
  * @return bool True if the current page is part of the Activity component.
1462
  */
1463
  function bp_is_activity_component() {
1464
+ return (bool) bp_is_current_component( 'activity' );
 
 
 
1465
  }
1466
 
1467
  /**
1470
  * @return bool True if the current page is part of the Blogs component.
1471
  */
1472
  function bp_is_blogs_component() {
1473
+ return (bool) ( is_multisite() && bp_is_current_component( 'blogs' ) );
 
 
 
1474
  }
1475
 
1476
  /**
1479
  * @return bool True if the current page is part of the Messages component.
1480
  */
1481
  function bp_is_messages_component() {
1482
+ return (bool) bp_is_current_component( 'messages' );
 
 
 
1483
  }
1484
 
1485
  /**
1488
  * @return bool True if the current page is part of the Friends component.
1489
  */
1490
  function bp_is_friends_component() {
1491
+ return (bool) bp_is_current_component( 'friends' );
 
 
 
1492
  }
1493
 
1494
  /**
1497
  * @return bool True if the current page is part of the Groups component.
1498
  */
1499
  function bp_is_groups_component() {
1500
+ return (bool) bp_is_current_component( 'groups' );
 
 
 
1501
  }
1502
 
1503
  /**
1506
  * @return bool True if the current page is part of the Forums component.
1507
  */
1508
  function bp_is_forums_component() {
1509
+ return (bool) bp_is_current_component( 'forums' );
 
 
 
1510
  }
1511
 
1512
  /**
1517
  * @return bool True if the current page is part of the Notifications component.
1518
  */
1519
  function bp_is_notifications_component() {
1520
+ return (bool) bp_is_current_component( 'notifications' );
 
 
 
 
1521
  }
1522
 
1523
  /**
1526
  * @return bool True if the current page is part of the Settings component.
1527
  */
1528
  function bp_is_settings_component() {
1529
+ return (bool) bp_is_current_component( 'settings' );
 
 
 
1530
  }
1531
 
1532
  /**
1542
  * packaged components.
1543
  */
1544
  function bp_is_current_component_core() {
1545
+ $retval = false;
 
1546
 
1547
+ foreach ( bp_core_get_packaged_component_ids() as $active_component ) {
1548
  if ( bp_is_current_component( $active_component ) ) {
1549
  $retval = true;
1550
  break;
1560
  * Is the current page the activity directory ?
1561
  *
1562
  * @since BuddyPress (2.0.0)
1563
+ *
1564
  * @return True if the current page is the activity directory.
1565
  */
1566
  function bp_is_activity_directory() {
1567
+ if ( ! bp_displayed_user_id() && bp_is_activity_component() && ! bp_current_action() ) {
1568
  return true;
1569
+ }
1570
 
1571
  return false;
1572
  }
1577
  * @return True if the current page is a single activity item permalink.
1578
  */
1579
  function bp_is_single_activity() {
1580
+ return (bool) ( bp_is_activity_component() && is_numeric( bp_current_action() ) );
 
 
 
1581
  }
1582
 
1583
  /** User **********************************************************************/
1586
  * Is the current page the members directory ?
1587
  *
1588
  * @since BuddyPress (2.0.0)
1589
+ *
1590
  * @return True if the current page is the members directory.
1591
  */
1592
  function bp_is_members_directory() {
1593
+ if ( ! bp_is_user() && bp_is_members_component() ) {
1594
  return true;
1595
+ }
1596
 
1597
  return false;
1598
  }
1606
  * @return True if the current page is part of the profile of the logged-in user.
1607
  */
1608
  function bp_is_my_profile() {
1609
+ if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() ) {
1610
  $my_profile = true;
1611
+ } else {
1612
  $my_profile = false;
1613
+ }
1614
 
1615
  return apply_filters( 'bp_is_my_profile', $my_profile );
1616
  }
1623
  * @return True if the current page is a user page.
1624
  */
1625
  function bp_is_user() {
1626
+ return (bool) bp_displayed_user_id();
 
 
 
1627
  }
1628
 
1629
  /**
1634
  * @return True if the current page is a user's activity stream page.
1635
  */
1636
  function bp_is_user_activity() {
1637
+ return (bool) ( bp_is_user() && bp_is_activity_component() );
 
 
 
1638
  }
1639
 
1640
  /**
1646
  */
1647
  function bp_is_user_friends_activity() {
1648
 
1649
+ if ( ! bp_is_active( 'friends' ) ) {
1650
  return false;
1651
+ }
1652
 
1653
  $slug = bp_get_friends_slug();
1654
 
1655
+ if ( empty( $slug ) ) {
1656
  $slug = 'friends';
1657
+ }
1658
 
1659
+ if ( bp_is_user_activity() && bp_is_current_action( $slug ) ) {
1660
  return true;
1661
+ }
1662
 
1663
  return false;
1664
  }
1672
  */
1673
  function bp_is_user_groups_activity() {
1674
 
1675
+ if ( ! bp_is_active( 'groups' ) ) {
1676
  return false;
1677
+ }
1678
 
1679
+ $slug = ( bp_get_groups_slug() )
1680
+ ? bp_get_groups_slug()
1681
+ : 'groups';
 
1682
 
1683
+ if ( bp_is_user_activity() && bp_is_current_action( $slug ) ) {
1684
  return true;
1685
+ }
1686
 
1687
  return false;
1688
  }
1695
  * @return True if the current page is part of a user's extended profile.
1696
  */
1697
  function bp_is_user_profile() {
1698
+ return (bool) ( bp_is_profile_component() || bp_is_current_component( 'profile' ) );
 
 
 
1699
  }
1700
 
1701
  /**
1706
  * @return True if the current page is a user's profile edit page.
1707
  */
1708
  function bp_is_user_profile_edit() {
1709
+ return (bool) ( bp_is_profile_component() && bp_is_current_action( 'edit' ) );
 
 
 
1710
  }
1711
 
1712
  function bp_is_user_change_avatar() {
1713
+ return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) );
 
 
 
1714
  }
1715
 
1716
  /**
1722
  */
1723
  function bp_is_user_forums() {
1724
 
1725
+ if ( ! bp_is_active( 'forums' ) ) {
1726
  return false;
1727
+ }
1728
 
1729
+ if ( bp_is_user() && bp_is_forums_component() ) {
1730
  return true;
1731
+ }
1732
 
1733
  return false;
1734
  }
1743
  * @return bool True if the current page is a user's Topics Started page.
1744
  */
1745
  function bp_is_user_forums_started() {
1746
+ return (bool) ( bp_is_user_forums() && bp_is_current_action( 'topics' ) );
 
 
 
1747
  }
1748
 
1749
  /**
1756
  * @return bool True if the current page is a user's Replied To forums page.
1757
  */
1758
  function bp_is_user_forums_replied_to() {
1759
+ return (bool) ( bp_is_user_forums() && bp_is_current_action( 'replies' ) );
 
 
 
1760
  }
1761
 
1762
  /**
1767
  * @return bool True if the current page is a user's Groups page.
1768
  */
1769
  function bp_is_user_groups() {
1770
+ return (bool) ( bp_is_user() && bp_is_groups_component() );
 
 
 
1771
  }
1772
 
1773
  /**
1778
  * @return bool True if the current page is a user's Blogs page.
1779
  */
1780
  function bp_is_user_blogs() {
1781
+ return (bool) ( bp_is_user() && bp_is_blogs_component() );
 
 
 
1782
  }
1783
 
1784
  /**
1789
  * @return bool True if the current page is a user's Recent Blog Posts page.
1790
  */
1791
  function bp_is_user_recent_posts() {
1792
+ return (bool) ( bp_is_user_blogs() && bp_is_current_action( 'recent-posts' ) );
 
 
 
1793
  }
1794
 
1795
  /**
1800
  * @return bool True if the current page is a user's Recent Blog Comments page.
1801
  */
1802
  function bp_is_user_recent_commments() {
1803
+ return (bool) ( bp_is_user_blogs() && bp_is_current_action( 'recent-comments' ) );
 
 
 
1804
  }
1805
 
1806
  /**
1811
  * @return bool True if the current page is a user's Friends page.
1812
  */
1813
  function bp_is_user_friends() {
1814
+ return (bool) ( bp_is_user() && bp_is_friends_component() );
 
 
 
1815
  }
1816
 
1817
  /**
1822
  * @return bool True if the current page is a user's Friends Requests page.
1823
  */
1824
  function bp_is_user_friend_requests() {
1825
+ return (bool) ( bp_is_user_friends() && bp_is_current_action( 'requests' ) );
 
 
 
1826
  }
1827
 
1828
  /**
1835
  * @return bool True if the current page is a user's Notifications page.
1836
  */
1837
  function bp_is_user_notifications() {
1838
+ return (bool) ( bp_is_user() && bp_is_notifications_component() );
 
 
 
 
1839
  }
1840
 
1841
  /**
1846
  * @return bool True if the current page is a user's Settings page.
1847
  */
1848
  function bp_is_user_settings() {
1849
+ return (bool) ( bp_is_user() && bp_is_settings_component() );
 
 
 
1850
  }
1851
 
1852
  /**
1859
  * @return bool True if the current page is a user's General Settings page.
1860
  */
1861
  function bp_is_user_settings_general() {
1862
+ return (bool) ( bp_is_user_settings() && bp_is_current_action( 'general' ) );
 
 
 
1863
  }
1864
 
1865
  /**
1872
  * @return bool True if the current page is a user's Notification Settings page.
1873
  */
1874
  function bp_is_user_settings_notifications() {
1875
+ return (bool) ( bp_is_user_settings() && bp_is_current_action( 'notifications' ) );
 
 
 
1876
  }
1877
 
1878
  /**
1885
  * @return bool True if the current page is a user's Delete Account page.
1886
  */
1887
  function bp_is_user_settings_account_delete() {
1888
+ return (bool) ( bp_is_user_settings() && bp_is_current_action( 'delete-account' ) );
 
 
 
1889
  }
1890
 
1891
  /**
1898
  * @return bool True if the current page is a user's Profile Settings page.
1899
  */
1900
  function bp_is_user_settings_profile() {
1901
+ return (bool) ( bp_is_user_settings() && bp_is_current_action( 'profile' ) );
 
 
 
1902
  }
1903
 
1904
  /** Groups ********************************************************************/
1907
  * Is the current page the groups directory ?
1908
  *
1909
  * @since BuddyPress (2.0.0)
1910
+ *
1911
  * @return True if the current page is the groups directory.
1912
  */
1913
  function bp_is_groups_directory() {
1914
+ if ( bp_is_groups_component() && ! bp_current_action() && ! bp_current_item() ) {
1915
  return true;
1916
+ }
1917
 
1918
  return false;
1919
  }
1926
  * @return bool True if the current page is part of a single group.
1927
  */
1928
  function bp_is_group() {
1929
+ $retval = bp_is_active( 'groups' );
1930
 
1931
+ if ( ! empty( $retval ) ) {
1932
+ $retval = bp_is_groups_component() && groups_get_current_group();
1933
+ }
1934
+
1935
+ return (bool) $retval;
1936
  }
1937
 
1938
  /**
1944
  * @return bool True if the current page is a single group's home page.
1945
  */
1946
  function bp_is_group_home() {
1947
+ if ( bp_is_single_item() && bp_is_groups_component() && ( ! bp_current_action() || bp_is_current_action( 'home' ) ) ) {
1948
  return true;
1949
+ }
1950
 
1951
  return false;
1952
  }
1957
  * @return bool True if the current page is part of the group creation process.
1958
  */
1959
  function bp_is_group_create() {
1960
+ return (bool) ( bp_is_groups_component() && bp_is_current_action( 'create' ) );
 
 
 
1961
  }
1962
 
1963
  /**
1968
  * @return bool True if the current page is part of a single group's admin.
1969
  */
1970
  function bp_is_group_admin_page() {
1971
+ return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'admin' ) );
 
 
 
1972
  }
1973
 
1974
  /**
2001
  * @return True if the current page is a group's activity page.
2002
  */
2003
  function bp_is_group_activity() {
2004
+ return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'activity' ) );
 
 
 
2005
  }
2006
 
2007
  /**
2012
  * @return bool True if the current page is part of a group forum topic.
2013
  */
2014
  function bp_is_group_forum_topic() {
2015
+ return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) );
 
 
 
2016
  }
2017
 
2018
  /**
2023
  * @return bool True if the current page is part of a group forum topic edit page.
2024
  */
2025
  function bp_is_group_forum_topic_edit() {
2026
+ return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_is_action_variable( 'edit', 2 ) );
 
 
 
2027
  }
2028
 
2029
  /**
2034
  * @return bool True if the current page is part of a group's Members page.
2035
  */
2036
  function bp_is_group_members() {
2037
+ return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'members' ) );
 
 
 
2038
  }
2039
 
2040
  /**
2045
  * @return bool True if the current page is a group's Send Invites page.
2046
  */
2047
  function bp_is_group_invites() {
2048
+ return (bool) ( bp_is_groups_component() && bp_is_current_action( 'send-invites' ) );
 
 
 
2049
  }
2050
 
2051
  /**
2056
  * @return bool True if the current page is a group's Request Membership page.
2057
  */
2058
  function bp_is_group_membership_request() {
2059
+ return (bool) ( bp_is_groups_component() && bp_is_current_action( 'request-membership' ) );
 
 
 
2060
  }
2061
 
2062
  /**
2065
  * @return bool True if the current page is a Leave Group attempt.
2066
  */
2067
  function bp_is_group_leave() {
2068
+ return (bool) ( bp_is_groups_component() && bp_is_single_item() && bp_is_current_action( 'leave-group' ) );
 
 
 
 
2069
  }
2070
 
2071
  /**
2078
  * @return bool True if the current page is part of a single group.
2079
  */
2080
  function bp_is_group_single() {
2081
+ return (bool) ( bp_is_groups_component() && bp_is_single_item() );
 
 
 
2082
  }
2083
 
2084
  /**
2089
  * @return bool True if the current page is the Create a Blog page.
2090
  */
2091
  function bp_is_create_blog() {
2092
+ return (bool) ( bp_is_blogs_component() && bp_is_current_action( 'create' ) );
 
 
 
2093
  }
2094
 
2095
  /**
2096
  * Is the current page the blogs directory ?
2097
  *
2098
  * @since BuddyPress (2.0.0)
2099
+ *
2100
  * @return True if the current page is the blogs directory.
2101
  */
2102
  function bp_is_blogs_directory() {
2103
+ if ( is_multisite() && bp_is_blogs_component() && ! bp_current_action() ) {
2104
  return true;
2105
+ }
2106
 
2107
  return false;
2108
  }
2117
  * @return bool True if the current page is part of a user's Messages pages.
2118
  */
2119
  function bp_is_user_messages() {
2120
+ return (bool) ( bp_is_user() && bp_is_messages_component() );
 
 
 
2121
  }
2122
 
2123
  /**
2128
  * @return bool True if the current page is a user's Messages Inbox.
2129
  */
2130
  function bp_is_messages_inbox() {
2131
+ if ( bp_is_user_messages() && ( ! bp_current_action() || bp_is_current_action( 'inbox' ) ) ) {
2132
  return true;
2133
+ }
2134
 
2135
  return false;
2136
  }
2143
  * @return bool True if the current page is a user's Messages Sentbox.
2144
  */
2145
  function bp_is_messages_sentbox() {
2146
+ return (bool) ( bp_is_user_messages() && bp_is_current_action( 'sentbox' ) );
 
 
 
2147
  }
2148
 
2149
  /**
2154
  * @return bool True if the current page is a user's Messages Compose screen.
2155
  */
2156
  function bp_is_messages_compose_screen() {
2157
+ return (bool) ( bp_is_user_messages() && bp_is_current_action( 'compose' ) );
 
 
 
2158
  }
2159
 
2160
  /**
2165
  * @return bool True if the current page is the Notices screen.
2166
  */
2167
  function bp_is_notices() {
2168
+ return (bool) ( bp_is_user_messages() && bp_is_current_action( 'notices' ) );
 
 
 
2169
  }
2170
 
2171
  /**
2174
  * @return bool True if the current page a single Messages conversation thread?
2175
  */
2176
  function bp_is_messages_conversation() {
2177
+ return (bool) ( bp_is_user_messages() && ( bp_is_current_action( 'view' ) ) );
 
 
 
2178
  }
2179
 
2180
  /**
2183
  * @return bool
2184
  */
2185
  function bp_is_single( $component, $callback ) {
2186
+ return (bool) ( bp_is_current_component( $component ) && ( true === call_user_func( $callback ) ) );
 
 
 
2187
  }
2188
 
2189
  /** Registration **************************************************************/
2196
  * @return bool True if the current page is the Activate page.
2197
  */
2198
  function bp_is_activation_page() {
2199
+ return (bool) bp_is_current_component( 'activate' );
 
 
 
2200
  }
2201
 
2202
  /**
2207
  * @return bool True if the current page is the Register page.
2208
  */
2209
  function bp_is_register_page() {
2210
+ return (bool) bp_is_current_component( 'register' );
 
 
 
2211
  }
2212
 
2213
  /**
2228
 
2229
  /** Pages *************************************************************/
2230
 
2231
+ if ( is_front_page() ) {
2232
  $bp_classes[] = 'home-page';
2233
+ }
2234
 
2235
+ if ( bp_is_directory() ) {
2236
  $bp_classes[] = 'directory';
2237
+ }
2238
 
2239
+ if ( bp_is_single_item() ) {
2240
  $bp_classes[] = 'single-item';
2241
+ }
2242
 
2243
  /** Components ********************************************************/
2244
 
2245
+ if ( ! bp_is_blog_page() ) {
2246
+ if ( bp_is_user_profile() ) {
2247
  $bp_classes[] = 'xprofile';
2248
+ }
2249
 
2250
+ if ( bp_is_activity_component() ) {
2251
  $bp_classes[] = 'activity';
2252
+ }
2253
 
2254
+ if ( bp_is_blogs_component() ) {
2255
  $bp_classes[] = 'blogs';
2256
+ }
2257
 
2258
+ if ( bp_is_messages_component() ) {
2259
  $bp_classes[] = 'messages';
2260
+ }
2261
 
2262
+ if ( bp_is_friends_component() ) {
2263
  $bp_classes[] = 'friends';
2264
+ }
2265
 
2266
+ if ( bp_is_groups_component() ) {
2267
  $bp_classes[] = 'groups';
2268
+ }
2269
 
2270
+ if ( bp_is_settings_component() ) {
2271
  $bp_classes[] = 'settings';
2272
+ }
2273
+ }
2274
 
2275
  /** User **************************************************************/
2276
 
2277
+ if ( bp_is_user() ) {
2278
  $bp_classes[] = 'bp-user';
2279
+ }
2280
 
2281
+ if ( ! bp_is_directory() ) {
2282
+ if ( bp_is_user_blogs() ) {
2283
  $bp_classes[] = 'my-blogs';
2284
+ }
2285
 
2286
+ if ( bp_is_user_groups() ) {
2287
  $bp_classes[] = 'my-groups';
2288
+ }
2289
 
2290
+ if ( bp_is_user_activity() ) {
2291
  $bp_classes[] = 'my-activity';
2292
+ }
2293
+ }
2294
 
2295
+ if ( bp_is_my_profile() ) {
2296
  $bp_classes[] = 'my-account';
2297
+ }
2298
 
2299
+ if ( bp_is_user_profile() ) {
2300
  $bp_classes[] = 'my-profile';
2301
+ }
2302
 
2303
+ if ( bp_is_user_friends() ) {
2304
  $bp_classes[] = 'my-friends';
2305
+ }
2306
 
2307
+ if ( bp_is_user_messages() ) {
2308
  $bp_classes[] = 'my-messages';
2309
+ }
2310
 
2311
+ if ( bp_is_user_recent_commments() ) {
2312
  $bp_classes[] = 'recent-comments';
2313
+ }
2314
 
2315
+ if ( bp_is_user_recent_posts() ) {
2316
  $bp_classes[] = 'recent-posts';
2317
+ }
2318
 
2319
+ if ( bp_is_user_change_avatar() ) {
2320
  $bp_classes[] = 'change-avatar';
2321
+ }
2322
 
2323
+ if ( bp_is_user_profile_edit() ) {
2324
  $bp_classes[] = 'profile-edit';
2325
+ }
2326
 
2327
+ if ( bp_is_user_friends_activity() ) {
2328
  $bp_classes[] = 'friends-activity';
2329
+ }
2330
 
2331
+ if ( bp_is_user_groups_activity() ) {
2332
  $bp_classes[] = 'groups-activity';
2333
+ }
2334
 
2335
  /** Messages **********************************************************/
2336
 
2337
+ if ( bp_is_messages_inbox() ) {
2338
  $bp_classes[] = 'inbox';
2339
+ }
2340
 
2341
+ if ( bp_is_messages_sentbox() ) {
2342
  $bp_classes[] = 'sentbox';
2343
+ }
2344
 
2345
+ if ( bp_is_messages_compose_screen() ) {
2346
  $bp_classes[] = 'compose';
2347
+ }
2348
 
2349
+ if ( bp_is_notices() ) {
2350
  $bp_classes[] = 'notices';
2351
+ }
2352
 
2353
+ if ( bp_is_user_friend_requests() ) {
2354
  $bp_classes[] = 'friend-requests';
2355
+ }
2356
 
2357
+ if ( bp_is_create_blog() ) {
2358
  $bp_classes[] = 'create-blog';
2359
+ }
2360
 
2361
  /** Groups ************************************************************/
2362
 
2363
+ if ( bp_is_group_leave() ) {
2364
  $bp_classes[] = 'leave-group';
2365
+ }
2366
 
2367
+ if ( bp_is_group_invites() ) {
2368
  $bp_classes[] = 'group-invites';
2369
+ }
2370
 
2371
+ if ( bp_is_group_members() ) {
2372
  $bp_classes[] = 'group-members';
2373
+ }
2374
 
2375
+ if ( bp_is_group_forum_topic() ) {
2376
  $bp_classes[] = 'group-forum-topic';
2377
+ }
2378
 
2379
+ if ( bp_is_group_forum_topic_edit() ) {
2380
  $bp_classes[] = 'group-forum-topic-edit';
2381
+ }
2382
 
2383
+ if ( bp_is_group_forum() ) {
2384
  $bp_classes[] = 'group-forum';
2385
+ }
2386
 
2387
  if ( bp_is_group_admin_page() ) {
2388
  $bp_classes[] = 'group-admin';
2394
  $bp_classes[] = bp_get_groups_current_create_step();
2395
  }
2396
 
2397
+ if ( bp_is_group_home() ) {
2398
  $bp_classes[] = 'group-home';
2399
+ }
2400
 
2401
+ if ( bp_is_single_activity() ) {
2402
  $bp_classes[] = 'activity-permalink';
2403
+ }
2404
 
2405
  /** Registration ******************************************************/
2406
 
2407
+ if ( bp_is_register_page() ) {
2408
  $bp_classes[] = 'registration';
2409
+ }
2410
 
2411
+ if ( bp_is_activation_page() ) {
2412
  $bp_classes[] = 'activation';
2413
+ }
2414
 
2415
  /** Current Component & Action ****************************************/
2416
 
2417
+ if ( ! bp_is_blog_page() ) {
2418
  $bp_classes[] = bp_current_component();
2419
  $bp_classes[] = bp_current_action();
2420
  }
2433
  }
2434
  add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 );
2435
 
2436
+ /**
2437
+ * Customizes the post CSS class according to BuddyPress content.
2438
+ *
2439
+ * Hooked to the 'post_class' filter.
2440
+ *
2441
+ * @since BuddyPress (2.1.0)
2442
+ *
2443
+ * @param array $wp_classes The post classes coming from WordPress.
2444
+ * @return array
2445
+ */
2446
+ function bp_get_the_post_class( $wp_classes = array() ) {
2447
+ // don't do anything if we're not on a BP page
2448
+ if ( ! is_buddypress() ) {
2449
+ return $wp_classes;
2450
+ }
2451
+
2452
+ $bp_classes = array();
2453
+
2454
+ if ( bp_is_user() || bp_is_single_activity() ) {
2455
+ $bp_classes[] = 'bp_members';
2456
+
2457
+ } elseif ( bp_is_group() ) {
2458
+ $bp_classes[] = 'bp_group';
2459
+
2460
+ } elseif ( bp_is_activity_component() ) {
2461
+ $bp_classes[] = 'bp_activity';
2462
+
2463
+ } elseif ( bp_is_blogs_component() ) {
2464
+ $bp_classes[] = 'bp_blogs';
2465
+
2466
+ } elseif ( bp_is_register_page() ) {
2467
+ $bp_classes[] = 'bp_register';
2468
+
2469
+ } elseif ( bp_is_activation_page() ) {
2470
+ $bp_classes[] = 'bp_activate';
2471
+
2472
+ } elseif ( bp_is_forums_component() && bp_is_directory() ) {
2473
+ $bp_classes[] = 'bp_forum';
2474
+ }
2475
+
2476
+ if ( empty( $bp_classes ) ) {
2477
+ return $wp_classes;
2478
+ }
2479
+
2480
+ // emulate post type css class
2481
+ foreach ( $bp_classes as $bp_class ) {
2482
+ $bp_classes[] = "type-{$bp_class}";
2483
+ }
2484
+
2485
+ // removes the 'page' and 'type-page' post classes
2486
+ // we need to remove these classes since they did not exist before we switched
2487
+ // theme compat to use the 'page' post type
2488
+ $page_key = array_search( 'page', $wp_classes );
2489
+ $page_type_key = array_search( 'type-page', $wp_classes );
2490
+ unset( $wp_classes[$page_key], $wp_classes[$page_type_key] );
2491
+
2492
+ // okay let's merge!
2493
+ return array_unique( array_merge( $bp_classes, $wp_classes ) );
2494
+ }
2495
+ add_filter( 'post_class', 'bp_get_the_post_class' );
2496
+
2497
  /**
2498
  * Sort BuddyPress nav menu items by their position property.
2499
  *
2509
  * the first argument is considered to be respectively less than, equal to, or greater than the second.
2510
  */
2511
  function _bp_nav_menu_sort( $a, $b ) {
2512
+ if ( $a['position'] == $b['position'] ) {
2513
  return 0;
2514
+ } elseif ( $a['position'] < $b['position'] ) {
 
2515
  return -1;
2516
+ } else {
 
2517
  return 1;
2518
+ }
2519
  }
2520
 
2521
  /**
2532
  foreach ( (array) buddypress()->bp_options_nav as $parent_menu => $sub_menus ) {
2533
 
2534
  // The root menu's ID is "xprofile", but the Profile submenus are using "profile". See BP_Core::setup_nav().
2535
+ if ( 'profile' === $parent_menu ) {
2536
  $parent_menu = 'xprofile';
2537
+ }
2538
 
2539
  // Sort the items in this menu's navigation by their position property
2540
  $second_level_menus = (array) $sub_menus;
2544
  foreach( $second_level_menus as $sub_nav ) {
2545
 
2546
  // Skip items we don't have access to
2547
+ if ( empty( $sub_nav['user_has_access'] ) ) {
2548
  continue;
2549
+ }
2550
 
2551
  // Add this menu
2552
  $menu = new stdClass;
2553
+ $menu->class = array( 'menu-child' );
2554
  $menu->css_id = $sub_nav['css_id'];
2555
  $menu->link = $sub_nav['link'];
2556
  $menu->name = $sub_nav['name'];
2558
 
2559
  // If we're viewing this item's screen, record that we need to mark its parent menu to be selected
2560
  if ( $sub_nav['slug'] == bp_current_action() ) {
2561
+ $menu->class[] = 'current-menu-item';
2562
  $selected_menus[] = $parent_menu;
2563
  }
2564
 
2574
  foreach ( $top_level_menus as $nav ) {
2575
 
2576
  // Skip items marked as user-specific if you're not on your own profile
2577
+ if ( empty( $nav['show_for_displayed_user'] ) && ! bp_core_can_edit_settings() ) {
2578
  continue;
2579
+ }
2580
 
2581
  // Get the correct menu link. See http://buddypress.trac.wordpress.org/ticket/4624
2582
  $link = bp_loggedin_user_domain() ? str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $nav['link'] ) : trailingslashit( bp_displayed_user_domain() . $nav['link'] );
2583
 
2584
  // Add this menu
2585
  $menu = new stdClass;
2586
+ $menu->class = array( 'menu-parent' );
2587
  $menu->css_id = $nav['css_id'];
2588
  $menu->link = $link;
2589
  $menu->name = $nav['name'];
2590
  $menu->parent = 0;
2591
 
2592
  // Check if we need to mark this menu as selected
2593
+ if ( in_array( $nav['css_id'], $selected_menus ) ) {
2594
+ $menu->class[] = 'current-menu-parent';
2595
+ }
2596
 
2597
  $menus[] = $menu;
2598
  }
2663
  $show_container = false;
2664
 
2665
  // Create custom walker if one wasn't set
2666
+ if ( empty( $args->walker ) ) {
2667
  $args->walker = new BP_Walker_Nav_Menu;
2668
+ }
2669
 
2670
  // Sanitise values for class and ID
2671
  $args->container_class = sanitize_html_class( $args->container_class );
2698
 
2699
  // If a specific ID wasn't requested, and there are multiple menus on the same screen, make sure the autogenerated ID is unique
2700
  while ( in_array( $wrap_id, $menu_id_slugs ) ) {
2701
+ if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) {
2702
  $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
2703
+ } else {
2704
  $wrap_id = $wrap_id . '-1';
2705
+ }
2706
  }
2707
  }
2708
  $menu_id_slugs[] = $wrap_id;
2716
  unset( $items );
2717
 
2718
  // If we've wrapped the ul, close it
2719
+ if ( ! empty( $show_container ) ) {
2720
  $nav_menu .= '</' . $args->container . '>';
2721
+ }
2722
 
2723
  // Final chance to modify output
2724
  $nav_menu = apply_filters( 'bp_nav_menu', $nav_menu, $args );
2725
 
2726
+ if ( ! empty( $args->echo ) ) {
2727
  echo $nav_menu;
2728
+ } else {
2729
  return $nav_menu;
2730
+ }
2731
  }
bp-core/bp-core-theme-compatibility.php CHANGED
@@ -556,6 +556,9 @@ function bp_theme_compat_reset_post( $args = array() ) {
556
 
557
  // If we are resetting a post, we are in theme compat
558
  bp_set_theme_compat_active( true );
 
 
 
559
  }
560
 
561
  /**
556
 
557
  // If we are resetting a post, we are in theme compat
558
  bp_set_theme_compat_active( true );
559
+
560
+ // If we are in theme compat, we don't need the 'Edit' post link
561
+ add_filter( 'get_edit_post_link', 'bp_core_filter_edit_post_link', 10, 2 );
562
  }
563
 
564
  /**
bp-core/bp-core-update.php CHANGED
@@ -163,8 +163,9 @@ function bp_version_bump() {
163
  function bp_setup_updater() {
164
 
165
  // Are we running an outdated version of BuddyPress?
166
- if ( ! bp_is_update() )
167
  return;
 
168
 
169
  bp_version_updater();
170
  }
@@ -400,8 +401,9 @@ function bp_update_to_2_0_1() {
400
  function bp_add_activation_redirect() {
401
 
402
  // Bail if activating from network, or bulk
403
- if ( isset( $_GET['activate-multi'] ) )
404
  return;
 
405
 
406
  // Record that this is a new installation, so we show the right
407
  // welcome message
@@ -416,7 +418,7 @@ function bp_add_activation_redirect() {
416
  /** Signups *******************************************************************/
417
 
418
  /**
419
- * Check if the signups table needs to be created.
420
  *
421
  * @since BuddyPress (2.0.0)
422
  *
@@ -425,12 +427,6 @@ function bp_add_activation_redirect() {
425
  * @return bool If signups table exists
426
  */
427
  function bp_core_maybe_install_signups() {
428
-
429
- // Bail if we are explicitly not upgrading global tables
430
- if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
431
- return false;
432
- }
433
-
434
  global $wpdb;
435
 
436
  // The table to run queries against
163
  function bp_setup_updater() {
164
 
165
  // Are we running an outdated version of BuddyPress?
166
+ if ( ! bp_is_update() ) {
167
  return;
168
+ }
169
 
170
  bp_version_updater();
171
  }
401
  function bp_add_activation_redirect() {
402
 
403
  // Bail if activating from network, or bulk
404
+ if ( isset( $_GET['activate-multi'] ) ) {
405
  return;
406
+ }
407
 
408
  // Record that this is a new installation, so we show the right
409
  // welcome message
418
  /** Signups *******************************************************************/
419
 
420
  /**
421
+ * Check if the signups table needs to be created or upgraded.
422
  *
423
  * @since BuddyPress (2.0.0)
424
  *
427
  * @return bool If signups table exists
428
  */
429
  function bp_core_maybe_install_signups() {
 
 
 
 
 
 
430
  global $wpdb;
431
 
432
  // The table to run queries against
bp-core/bp-core-widgets.php CHANGED
@@ -69,7 +69,7 @@ class BP_Core_Login_Widget extends WP_Widget {
69
 
70
  <div class="bp-login-widget-user-links">
71
  <div class="bp-login-widget-user-link"><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></div>
72
- <div class="bp-login-widget-user-logout"><a class="logout" href="<?php echo wp_logout_url( wp_guess_url() ); ?>"><?php _e( 'Log Out', 'buddypress' ); ?></a></div>
73
  </div>
74
 
75
  <?php do_action( 'bp_after_login_widget_loggedin' ); ?>
@@ -154,8 +154,7 @@ class BP_Core_Members_Widget extends WP_Widget {
154
  parent::__construct( false, $name = _x( '(BuddyPress) Members', 'widget name', 'buddypress' ), $widget_ops );
155
 
156
  if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
157
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
158
- wp_enqueue_script( 'bp_core_widget_members-js', buddypress()->plugin_url . "bp-core/js/widget-members{$min}.js", array( 'jquery' ), bp_get_version() );
159
  }
160
  }
161
 
@@ -315,7 +314,7 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
315
  */
316
  function __construct() {
317
  $widget_ops = array(
318
- 'description' => __( 'Avatars of users who are currently online', 'buddypress' ),
319
  'classname' => 'widget_bp_core_whos_online_widget buddypress widget',
320
  );
321
  parent::__construct( false, $name = _x( "(BuddyPress) Who's Online", 'widget name', 'buddypress' ), $widget_ops );
@@ -418,7 +417,7 @@ class BP_Core_Recently_Active_Widget extends WP_Widget {
418
  */
419
  function __construct() {
420
  $widget_ops = array(
421
- 'description' => __( 'Avatars of recently active members', 'buddypress' ),
422
  'classname' => 'widget_bp_core_recently_active_widget buddypress widget',
423
  );
424
  parent::__construct( false, $name = _x( '(BuddyPress) Recently Active Members', 'widget name', 'buddypress' ), $widget_ops );
69
 
70
  <div class="bp-login-widget-user-links">
71
  <div class="bp-login-widget-user-link"><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></div>
72
+ <div class="bp-login-widget-user-logout"><a class="logout" href="<?php echo wp_logout_url( bp_get_requested_url() ); ?>"><?php _e( 'Log Out', 'buddypress' ); ?></a></div>
73
  </div>
74
 
75
  <?php do_action( 'bp_after_login_widget_loggedin' ); ?>
154
  parent::__construct( false, $name = _x( '(BuddyPress) Members', 'widget name', 'buddypress' ), $widget_ops );
155
 
156
  if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
157
+ wp_enqueue_script( 'bp-widget-members' );
 
158
  }
159
  }
160
 
314
  */
315
  function __construct() {
316
  $widget_ops = array(
317
+ 'description' => __( 'Profile photos of online users', 'buddypress' ),
318
  'classname' => 'widget_bp_core_whos_online_widget buddypress widget',
319
  );
320
  parent::__construct( false, $name = _x( "(BuddyPress) Who's Online", 'widget name', 'buddypress' ), $widget_ops );
417
  */
418
  function __construct() {
419
  $widget_ops = array(
420
+ 'description' => __( 'Profile photos of recently active members', 'buddypress' ),
421
  'classname' => 'widget_bp_core_recently_active_widget buddypress widget',
422
  );
423
  parent::__construct( false, $name = _x( '(BuddyPress) Recently Active Members', 'widget name', 'buddypress' ), $widget_ops );
bp-core/css/admin-bar-rtl.css CHANGED
@@ -1,27 +1,58 @@
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
- }
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 -5px 0 10px;
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
+ right: 0;
 
18
  }
 
19
  #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
 
20
  right: 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-rtl.min.css CHANGED
@@ -1 +1,2 @@
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
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px -5px 0 10px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759B;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;-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/admin-bar.css CHANGED
@@ -55,4 +55,4 @@
55
  #wp-admin-bar-user-info img.avatar {
56
  height: 64px;
57
  width: 64px;
58
- }
55
  #wp-admin-bar-user-info img.avatar {
56
  height: 64px;
57
  width: 64px;
58
+ }
bp-core/css/admin-bar.min.css CHANGED
@@ -1 +1,2 @@
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
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-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,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759B;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;-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,77 +1,203 @@
 
 
 
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
- }
 
 
 
 
 
 
 
 
1
+ body:not(.wp-admin) {
2
+ padding-top: 25px !important;
3
+ }
4
  #wp-admin-bar {
5
+ position: fixed;
6
+ top: 0;
7
  right: 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
  right: 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: right;
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-left: 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: right;
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: right;
88
+ position: relative;
89
  background: url('../images/admin-menu-arrow.gif') 12% 53% no-repeat;
90
  padding-left: 11px;
 
91
  }
92
  #wp-admin-bar ul li.no-arrow {
93
+ background: none;
94
  padding-left: 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
  left: 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
  right: -999em;
 
117
  margin-right: 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-right-radius: 0;
126
+ -moz-border-radius-topright: 0;
127
+ -webkit-border-top-left-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: right;
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 184px 0 0;
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
  right: auto;
169
  }
170
  #wp-admin-bar ul li.align-right:hover ul {
171
  left: 0;
 
172
  }
173
  #wp-admin-bar ul li:hover ul ul,
174
  #wp-admin-bar li.sfhover ul li ul {
175
  right: -999em;
 
176
  }
177
 
178
  /* Menu item css */
179
  #wp-admin-bar img.avatar {
180
  float: right;
181
  margin-left: 8px;
 
182
  }
183
  #wp-admin-bar span.activity {
184
+ display: block;
185
  margin-right: 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-right: 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-rtl.min.css CHANGED
@@ -1 +1,2 @@
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}
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;right: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;right:10px}#wp-admin-bar a img{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#wp-admin-bar li.no-arrow a{padding-left: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:right;font-weight:700;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 0 0 11px;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-left:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;left:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;right:-999em;margin-right:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:right;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.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;-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 ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{right:-999em}#wp-admin-bar img.avatar{float:right;margin-left:8px}#wp-admin-bar span.activity{display:block;margin-right: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-right: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/css/buddybar.css CHANGED
@@ -197,7 +197,7 @@ body#bp-default #admin-bar-logo {
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
- }
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 CHANGED
@@ -1 +1,2 @@
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
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ 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:none}#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;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#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:700;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 11px 0 0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 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 ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{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,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#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.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{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 ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul 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-members/bp-members-notifications.php → bp-core/deprecated/1.9.php RENAMED
@@ -14,12 +14,12 @@
14
  if ( !defined( 'ABSPATH' ) ) exit;
15
 
16
  /**
17
- * Add a notification for a specific user, from a specific component
18
  *
19
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
20
- * bp_notifications_add_notification() instead.
21
  *
22
- * @since BuddyPress (1.0)
23
  * @param string $item_id
24
  * @param int $user_id
25
  * @param string $component_name
@@ -27,7 +27,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
27
  * @param string $secondary_item_id
28
  * @param string $date_notified
29
  * @param int $is_new
30
- * @return boolean True on success, false on fail
31
  */
32
  function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false, $is_new = 1 ) {
33
 
@@ -57,14 +57,14 @@ function bp_core_add_notification( $item_id, $user_id, $component_name, $compone
57
  }
58
 
59
  /**
60
- * Delete a specific notification by its ID
61
  *
62
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
63
- * bp_notifications_delete_notification() instead.
64
  *
65
- * @since BuddyPress (1.0)
66
- * @param int $id
67
- * @return boolean True on success, false on fail
68
  */
69
  function bp_core_delete_notification( $id ) {
70
 
@@ -80,13 +80,13 @@ function bp_core_delete_notification( $id ) {
80
  }
81
 
82
  /**
83
- * Get a specific notification by its ID
84
  *
85
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
86
- * bp_notifications_get_notification() instead.
87
  *
88
- * @since BuddyPress (1.0)
89
- * @param int $id
90
  * @return BP_Core_Notification
91
  */
92
  function bp_core_get_notification( $id ) {
@@ -103,16 +103,15 @@ function bp_core_get_notification( $id ) {
103
  }
104
 
105
  /**
106
- * Get notifications for a specific user
107
  *
108
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
109
- * bp_notifications_get_notifications_for_user() instead.
110
  *
111
- * @since BuddyPress (1.0)
112
- * @global BuddyPress $bp
113
- * @param int $user_id
114
  * @param string $format
115
- * @return boolean Object or array on success, false on fail
116
  */
117
  function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) {
118
 
@@ -124,27 +123,25 @@ function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) {
124
  // Trigger the deprecated function notice
125
  _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notifications_for_user()' );
126
 
127
- $renderable = bp_notifications_get_notifications_for_user( $user_id, $format );
128
-
129
- return apply_filters( 'bp_core_get_notifications_for_user', $renderable, $user_id, $format );
130
  }
131
 
132
  /** Delete ********************************************************************/
133
 
134
  /**
135
- * Delete notifications for a user by type
136
  *
137
  * Used when clearing out notifications for a specific component when the user
138
  * has visited that component.
139
  *
140
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
141
- * bp_notifications_delete_notifications_by_type() instead.
142
  *
143
- * @since BuddyPress (1.0)
144
  * @param int $user_id
145
  * @param string $component_name
146
  * @param string $component_action
147
- * @return boolean True on success, false on fail
148
  */
149
  function bp_core_delete_notifications_by_type( $user_id, $component_name, $component_action ) {
150
 
@@ -160,19 +157,19 @@ function bp_core_delete_notifications_by_type( $user_id, $component_name, $compo
160
  }
161
 
162
  /**
163
- * Delete notifications for an item ID
164
  *
165
  * Used when clearing out notifications for a specific component when the user
166
  * has visited that component.
167
  *
168
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
169
- * bp_notifications_delete_notifications_by_item_id() instead.
170
  *
171
- * @since BuddyPress (1.0)
172
  * @param int $user_id
173
  * @param string $component_name
174
  * @param string $component_action
175
- * @return boolean True on success, false on fail
176
  */
177
  function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
178
 
@@ -188,16 +185,16 @@ function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component
188
  }
189
 
190
  /**
191
- * Delete all notifications for by type
192
  *
193
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
194
- * bp_notifications_delete_all_notifications_by_type() instead.
195
  *
196
- * @since BuddyPress (1.0)
197
  * @param int $user_id
198
  * @param string $component_name
199
  * @param string $component_action
200
- * @return boolean True on success, false on fail
201
  */
202
  function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
203
 
@@ -213,18 +210,18 @@ function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $c
213
  }
214
 
215
  /**
216
- * Delete all notifications for a user
217
  *
218
  * Used when clearing out all notifications for a user, whene deleted or spammed
219
  *
220
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
221
- * bp_notifications_delete_notifications_from_user() instead.
222
  *
223
- * @since BuddyPress (1.0)
224
  * @param int $user_id
225
  * @param string $component_name
226
  * @param string $component_action
227
- * @return boolean True on success, false on fail
228
  */
229
  function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
230
 
@@ -242,17 +239,17 @@ function bp_core_delete_notifications_from_user( $user_id, $component_name, $com
242
  /** Helpers *******************************************************************/
243
 
244
  /**
245
- * Check if a user has access to a specific notification
246
  *
247
- * Used before deleting a notification for a user
248
  *
249
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
250
- * bp_notifications_check_notification_access() instead.
251
  *
252
- * @since BuddyPress (1.0)
253
  * @param int $user_id
254
  * @param int $notification_id
255
- * @return boolean True on success, false on fail
256
  */
257
  function bp_core_check_notification_access( $user_id, $notification_id ) {
258
 
14
  if ( !defined( 'ABSPATH' ) ) exit;
15
 
16
  /**
17
+ * Add a notification for a specific user, from a specific component.
18
  *
19
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
20
+ * bp_notifications_add_notification() instead.
21
  *
22
+ * @since BuddyPress (1.0.0)
23
  * @param string $item_id
24
  * @param int $user_id
25
  * @param string $component_name
27
  * @param string $secondary_item_id
28
  * @param string $date_notified
29
  * @param int $is_new
30
+ * @return boolean True on success, false on failure.
31
  */
32
  function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false, $is_new = 1 ) {
33
 
57
  }
58
 
59
  /**
60
+ * Delete a specific notification by its ID.
61
  *
62
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
63
+ * bp_notifications_delete_notification() instead.
64
  *
65
+ * @since BuddyPress (1.0.0)
66
+ * @param int $id ID of notification.
67
+ * @return boolean True on success, false on failure.
68
  */
69
  function bp_core_delete_notification( $id ) {
70
 
80
  }
81
 
82
  /**
83
+ * Get a specific notification by its ID.
84
  *
85
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
86
+ * bp_notifications_get_notification() instead.
87
  *
88
+ * @since BuddyPress (1.0.0)
89
+ * @param int $id ID of notification.
90
  * @return BP_Core_Notification
91
  */
92
  function bp_core_get_notification( $id ) {
103
  }
104
 
105
  /**
106
+ * Get notifications for a specific user.
107
  *
108
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
109
+ * bp_notifications_get_notifications_for_user() instead.
110
  *
111
+ * @since BuddyPress (1.0.0)
112
+ * @param int $user_id ID of user.
 
113
  * @param string $format
114
+ * @return boolean Object or array on success, false on failure.
115
  */
116
  function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) {
117
 
123
  // Trigger the deprecated function notice
124
  _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notifications_for_user()' );
125
 
126
+ return bp_notifications_get_notifications_for_user( $user_id, $format );
 
 
127
  }
128
 
129
  /** Delete ********************************************************************/
130
 
131
  /**
132
+ * Delete notifications for a user by type.
133
  *
134
  * Used when clearing out notifications for a specific component when the user
135
  * has visited that component.
136
  *
137
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
138
+ * bp_notifications_delete_notifications_by_type() instead.
139
  *
140
+ * @since BuddyPress (1.0.0)
141
  * @param int $user_id
142
  * @param string $component_name
143
  * @param string $component_action
144
+ * @return boolean True on success, false on failure.
145
  */
146
  function bp_core_delete_notifications_by_type( $user_id, $component_name, $component_action ) {
147
 
157
  }
158
 
159
  /**
160
+ * Delete notifications for an item ID.
161
  *
162
  * Used when clearing out notifications for a specific component when the user
163
  * has visited that component.
164
  *
165
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
166
+ * bp_notifications_delete_notifications_by_item_id() instead.
167
  *
168
+ * @since BuddyPress (1.0.0)
169
  * @param int $user_id
170
  * @param string $component_name
171
  * @param string $component_action
172
+ * @return boolean True on success, false on failure.
173
  */
174
  function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
175
 
185
  }
186
 
187
  /**
188
+ * Delete all notifications for by type.
189
  *
190
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
191
+ * bp_notifications_delete_all_notifications_by_type() instead.
192
  *
193
+ * @since BuddyPress (1.0.0)
194
  * @param int $user_id
195
  * @param string $component_name
196
  * @param string $component_action
197
+ * @return boolean True on success, false on failure.
198
  */
199
  function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
200
 
210
  }
211
 
212
  /**
213
+ * Delete all notifications for a user.
214
  *
215
  * Used when clearing out all notifications for a user, whene deleted or spammed
216
  *
217
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
218
+ * bp_notifications_delete_notifications_from_user() instead.
219
  *
220
+ * @since BuddyPress (1.0.0)
221
  * @param int $user_id
222
  * @param string $component_name
223
  * @param string $component_action
224
+ * @return boolean True on success, false on failure.
225
  */
226
  function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
227
 
239
  /** Helpers *******************************************************************/
240
 
241
  /**
242
+ * Check if a user has access to a specific notification.
243
  *
244
+ * Used before deleting a notification for a user.
245
  *
246
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
247
+ * bp_notifications_check_notification_access() instead.
248
  *
249
+ * @since BuddyPress (1.0.0)
250
  * @param int $user_id
251
  * @param int $notification_id
252
+ * @return boolean True on success, false on failure.
253
  */
254
  function bp_core_check_notification_access( $user_id, $notification_id ) {
255
 
bp-core/deprecated/2.1.php ADDED
@@ -0,0 +1,636 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Deprecated functions
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage Core
7
+ * @deprecated 2.1.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) exit;
12
+
13
+ /**
14
+ * Register (not enqueue) scripts that used to be used by BuddyPress.
15
+ *
16
+ * @since BuddyPress (2.1.0)
17
+ */
18
+ function bp_core_register_deprecated_scripts() {
19
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
20
+ $url = buddypress()->plugin_url . 'bp-core/deprecated/js/';
21
+
22
+ $scripts = apply_filters( 'bp_core_register_deprecated_scripts', array(
23
+
24
+ // Core
25
+ 'bp-jquery-scroll-to' => array(
26
+ 'file' => "{$url}jquery-scroll-to{$min}.js",
27
+ 'dependencies' => array( 'jquery' ),
28
+ ),
29
+
30
+ // Messages
31
+ 'bp-jquery-autocomplete' => array(
32
+ 'file' => "{$url}autocomplete/jquery.autocomplete{$min}.js",
33
+ 'dependencies' => array( 'jquery' ),
34
+ ),
35
+
36
+ 'bp-jquery-autocomplete-fb' => array(
37
+ 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.js",
38
+ 'dependencies' => array( 'jquery' ),
39
+ ),
40
+
41
+ 'bp-jquery-bgiframe' => array(
42
+ 'file' => "{$url}autocomplete/jquery.bgiframe{$min}.js",
43
+ 'dependencies' => array( 'jquery' ),
44
+ ),
45
+
46
+ 'bp-jquery-dimensions' => array(
47
+ 'file' => "{$url}autocomplete/jquery.dimensions{$min}.js",
48
+ 'dependencies' => array( 'jquery' ),
49
+ ),
50
+ ) );
51
+
52
+ foreach ( $scripts as $id => $script ) {
53
+ wp_register_script( $id, $script['file'], $script['dependencies'], bp_get_version(), true );
54
+ }
55
+ }
56
+ add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_scripts', 1 );
57
+
58
+ /**
59
+ * Register (not enqueue) styles that used to be used by BuddyPress.
60
+ *
61
+ * @since BuddyPress (2.1.0)
62
+ */
63
+ function bp_core_register_deprecated_styles() {
64
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
65
+ $url = buddypress()->plugin_url . 'bp-core/deprecated/css/';
66
+
67
+ $styles = apply_filters( 'bp_core_register_deprecated_styles', array(
68
+ // Messages
69
+ 'bp-messages-autocomplete' => array(
70
+ 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.css",
71
+ 'dependencies' => array(),
72
+ )
73
+ ) );
74
+
75
+ foreach ( $styles as $id => $style ) {
76
+ wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() );
77
+
78
+ wp_style_add_data( $id, 'rtl', true );
79
+ if ( $min ) {
80
+ wp_style_add_data( $id, 'suffix', $min );
81
+ }
82
+ }
83
+ }
84
+ add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_styles', 1 );
85
+
86
+ /** BuddyBar *****************************************************************/
87
+
88
+ /**
89
+ * Add a Sites menu to the BuddyBar.
90
+ *
91
+ * @since BuddyPress (1.0.0)
92
+ * @deprecated BuddyPress (2.1.0)
93
+ *
94
+ * @global object $bp The BuddyPress global settings object.
95
+ *
96
+ * @return bool|null Returns false on failure. Otherwise echoes the menu item.
97
+ */
98
+ function bp_adminbar_blogs_menu() {
99
+ global $bp;
100
+
101
+ if ( !is_user_logged_in() || !bp_is_active( 'blogs' ) )
102
+ return false;
103
+
104
+ if ( !is_multisite() )
105
+ return false;
106
+
107
+ $blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );
108
+ if ( empty( $blogs ) ) {
109
+ $blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true );
110
+ wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' );
111
+ }
112
+
113
+ $counter = 0;
114
+ if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) {
115
+
116
+ echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ) . '">';
117
+
118
+ _e( 'My Sites', 'buddypress' );
119
+
120
+ echo '</a>';
121
+ echo '<ul>';
122
+
123
+ foreach ( (array) $blogs['blogs'] as $blog ) {
124
+ $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
125
+ $site_url = esc_attr( $blog->siteurl );
126
+
127
+ echo '<li' . $alt . '>';
128
+ echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
129
+ echo '<ul>';
130
+ echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
131
+ echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
132
+ echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
133
+ echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
134
+ echo '</ul>';
135
+
136
+ do_action( 'bp_adminbar_blog_items', $blog );
137
+
138
+ echo '</li>';
139
+ $counter++;
140
+ }
141
+
142
+ $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
143
+
144
+ if ( bp_blog_signup_enabled() ) {
145
+ echo '<li' . $alt . '>';
146
+ echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
147
+ echo '</li>';
148
+ }
149
+
150
+ echo '</ul>';
151
+ echo '</li>';
152
+ }
153
+ }
154
+
155
+ /**
156
+ * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over
157
+ * to the WP Toolbar.
158
+ *
159
+ * @since BuddyPress (1.6)
160
+ * @deprecated BuddyPress (2.1.0)
161
+ */
162
+ function bp_admin_setting_callback_force_buddybar() {
163
+ ?>
164
+
165
+ <input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( true ) ); ?> />
166
+ <label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
167
+
168
+ <?php
169
+ }
170
+
171
+
172
+ /**
173
+ * Sanitization for _bp_force_buddyvar
174
+ *
175
+ * If upgraded to 1.6 and you chose to keep the BuddyBar, a checkbox asks if you want to switch to
176
+ * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function
177
+ * to flip the boolean before saving the intval.
178
+ *
179
+ * @since BuddyPress (1.6)
180
+ * @deprecated BuddyPress (2.1.0)
181
+ * @access Private
182
+ */
183
+ function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
184
+ return $value ? 0 : 1;
185
+ }
186
+
187
+ /**
188
+ * Wrapper function for rendering the BuddyBar.
189
+ *
190
+ * @return bool|null Returns false if the BuddyBar is disabled.
191
+ * @deprecated BuddyPress (2.1.0)
192
+ */
193
+ function bp_core_admin_bar() {
194
+ global $bp;
195
+
196
+ if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
197
+ return false;
198
+
199
+ if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
200
+ return false;
201
+
202
+ $bp->doing_admin_bar = true;
203
+
204
+ echo '<div id="wp-admin-bar"><div class="padder">';
205
+
206
+ // **** Do bp-adminbar-logo Actions ********
207
+ do_action( 'bp_adminbar_logo' );
208
+
209
+ echo '<ul class="main-nav">';
210
+
211
+ // **** Do bp-adminbar-menus Actions ********
212
+ do_action( 'bp_adminbar_menus' );
213
+
214
+ echo '</ul>';
215
+ echo "</div></div><!-- #wp-admin-bar -->\n\n";
216
+
217
+ $bp->doing_admin_bar = false;
218
+ }
219
+
220
+ /**
221
+ * Output the BuddyBar logo.
222
+ *
223
+ * @deprecated BuddyPress (2.1.0)
224
+ */
225
+ function bp_adminbar_logo() {
226
+ echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';
227
+ }
228
+
229
+ /**
230
+ * Output the "Log In" and "Sign Up" names to the BuddyBar.
231
+ *
232
+ * Visible only to visitors who are not logged in.
233
+ *
234
+ * @deprecated BuddyPress (2.1.0)
235
+ *
236
+ * @return bool|null Returns false if the current user is logged in.
237
+ */
238
+ function bp_adminbar_login_menu() {
239
+
240
+ if ( is_user_logged_in() )
241
+ return false;
242
+
243
+ echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
244
+
245
+ // Show "Sign Up" link if user registrations are allowed
246
+ if ( bp_get_signup_allowed() )
247
+ echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
248
+ }
249
+
250
+ /**
251
+ * Output the My Account BuddyBar menu.
252
+ *
253
+ * @deprecated BuddyPress (2.1.0)
254
+ *
255
+ * @return bool|null Returns false on failure.
256
+ */
257
+ function bp_adminbar_account_menu() {
258
+ global $bp;
259
+
260
+ if ( !$bp->bp_nav || !is_user_logged_in() )
261
+ return false;
262
+
263
+ echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
264
+ echo __( 'My Account', 'buddypress' ) . '</a>';
265
+ echo '<ul>';
266
+
267
+ // Loop through each navigation item
268
+ $counter = 0;
269
+ foreach( (array) $bp->bp_nav as $nav_item ) {
270
+ $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
271
+
272
+ if ( -1 == $nav_item['position'] )
273
+ continue;
274
+
275
+ echo '<li' . $alt . '>';
276
+ echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
277
+
278
+ if ( isset( $bp->bp_options_nav[$nav_item['slug']] ) && is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {
279
+ echo '<ul>';
280
+ $sub_counter = 0;
281
+
282
+ foreach( (array) $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
283
+ $link = $subnav_item['link'];
284
+ $name = $subnav_item['name'];
285
+
286
+ if ( bp_displayed_user_domain() )
287
+ $link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );
288
+
289
+ if ( isset( $bp->displayed_user->userdata->user_login ) )
290
+ $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
291
+
292
+ $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
293
+ echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
294
+ $sub_counter++;
295
+ }
296
+ echo '</ul>';
297
+ }
298
+
299
+ echo '</li>';
300
+
301
+ $counter++;
302
+ }
303
+
304
+ $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
305
+
306
+ echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( home_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
307
+ echo '</ul>';
308
+ echo '</li>';
309
+ }
310
+
311
+ function bp_adminbar_thisblog_menu() {
312
+ if ( current_user_can( 'edit_posts' ) ) {
313
+ echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
314
+ _e( 'Dashboard', 'buddypress' );
315
+ echo '</a>';
316
+ echo '<ul>';
317
+
318
+ echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
319
+ echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
320
+ echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
321
+
322
+ do_action( 'bp_adminbar_thisblog_items' );
323
+
324
+ echo '</ul>';
325
+ echo '</li>';
326
+ }
327
+ }
328
+
329
+ /**
330
+ * Output the Random BuddyBar menu.
331
+ *
332
+ * Not visible for logged-in users.
333
+ *
334
+ * @deprecated BuddyPress (2.1.0)
335
+ */
336
+ function bp_adminbar_random_menu() {
337
+ ?>
338
+
339
+ <li class="align-right" id="bp-adminbar-visitrandom-menu">
340
+ <a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
341
+ <ul class="random-list">
342
+ <li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '?random-member' ?>" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
343
+
344
+ <?php if ( bp_is_active( 'groups' ) ) : ?>
345
+
346
+ <li class="alt"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '?random-group' ?>" rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
347
+
348
+ <?php endif; ?>
349
+
350
+ <?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
351
+
352
+ <li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '?random-blog' ?>" rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
353
+
354
+ <?php endif; ?>
355
+
356
+ <?php do_action( 'bp_adminbar_random_menu' ) ?>
357
+
358
+ </ul>
359
+ </li>
360
+
361
+ <?php
362
+ }
363
+
364
+ /**
365
+ * Enqueue the BuddyBar CSS.
366
+ *
367
+ * @deprecated BuddyPress (2.1.0)
368
+ */
369
+ function bp_core_load_buddybar_css() {
370
+ 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 ) )
371
+ return;
372
+
373
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
374
+
375
+ if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility
376
+ $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
377
+ } else {
378
+ $stylesheet = buddypress()->plugin_url . "bp-core/css/buddybar{$min}.css";
379
+ }
380
+
381
+ wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );
382
+
383
+ wp_style_add_data( 'bp-admin-bar', 'rtl', true );
384
+ if ( $min ) {
385
+ wp_style_add_data( 'bp-admin-bar', 'suffix', $min );
386
+ }
387
+ }
388
+ add_action( 'bp_init', 'bp_core_load_buddybar_css' );
389
+
390
+ /**
391
+ * Add menu items to the BuddyBar.
392
+ *
393
+ * @since BuddyPress (1.0.0)
394
+ *
395
+ * @deprecated BuddyPress (2.1.0)
396
+ *
397
+ * @global BuddyPress $bp
398
+ */
399
+ function bp_groups_adminbar_admin_menu() {
400
+ global $bp;
401
+
402
+ if ( empty( $bp->groups->current_group ) )
403
+ return false;
404
+
405
+ // Only group admins and site admins can see this menu
406
+ if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() )
407
+ return false; ?>
408
+
409
+ <li id="bp-adminbar-adminoptions-menu">
410
+ <a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a>
411
+
412
+ <ul>
413
+ <li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li>
414
+
415
+ <li><a href="<?php bp_groups_action_link( 'admin/group-settings' ); ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
416
+
417
+ <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?>
418
+
419
+ <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Profile Photo', 'buddypress' ); ?></a></li>
420
+
421
+ <?php endif; ?>
422
+
423
+ <?php if ( bp_is_active( 'friends' ) ) : ?>
424
+
425
+ <li><a href="<?php bp_groups_action_link( 'send-invites' ); ?>"><?php _e( 'Manage Invitations', 'buddypress' ); ?></a></li>
426
+
427
+ <?php endif; ?>
428
+
429
+ <li><a href="<?php bp_groups_action_link( 'admin/manage-members' ); ?>"><?php _e( 'Manage Members', 'buddypress' ); ?></a></li>
430
+
431
+ <?php if ( $bp->groups->current_group->status == 'private' ) : ?>
432
+
433
+ <li><a href="<?php bp_groups_action_link( 'admin/membership-requests' ); ?>"><?php _e( 'Membership Requests', 'buddypress' ); ?></a></li>
434
+
435
+ <?php endif; ?>
436
+
437
+ <li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ); ?>&amp;delete-group-button=1&amp;delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
438
+
439
+ <?php do_action( 'bp_groups_adminbar_admin_menu' ) ?>
440
+
441
+ </ul>
442
+ </li>
443
+
444
+ <?php
445
+ }
446
+ add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
447
+
448
+ /**
449
+ * Add the Notifications menu to the BuddyBar.
450
+ *
451
+ * @deprecated BuddyPress (2.1.0)
452
+ */
453
+ function bp_adminbar_notifications_menu() {
454
+
455
+ // Bail if notifications is not active
456
+ if ( ! bp_is_active( 'notifications' ) ) {
457
+ return false;
458
+ }
459
+
460
+ bp_notifications_buddybar_menu();
461
+ }
462
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
463
+
464
+ /**
465
+ * Add the Blog Authors menu to the BuddyBar (visible when not logged in).
466
+ *
467
+ * @deprecated BuddyPress (2.1.0)
468
+ */
469
+ function bp_adminbar_authors_menu() {
470
+ global $wpdb;
471
+
472
+ // Only for multisite
473
+ if ( !is_multisite() )
474
+ return false;
475
+
476
+ // Hide on root blog
477
+ if ( $wpdb->blogid == bp_get_root_blog_id() || !bp_is_active( 'blogs' ) )
478
+ return false;
479
+
480
+ $blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid );
481
+ $authors = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
482
+
483
+ if ( !empty( $authors ) ) {
484
+ // This is a blog, render a menu with links to all authors
485
+ echo '<li id="bp-adminbar-authors-menu"><a href="/">';
486
+ _e('Blog Authors', 'buddypress');
487
+ echo '</a>';
488
+
489
+ echo '<ul class="author-list">';
490
+ foreach( (array) $authors as $author ) {
491
+ $caps = maybe_unserialize( $author->caps );
492
+ if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) continue;
493
+
494
+ echo '<li>';
495
+ echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">';
496
+ echo bp_core_fetch_avatar( array(
497
+ 'item_id' => $author->user_id,
498
+ 'email' => $author->user_email,
499
+ 'width' => 15,
500
+ 'height' => 15,
501
+ 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $author->display_name )
502
+ ) );
503
+ echo ' ' . $author->display_name . '</a>';
504
+ echo '<div class="admin-bar-clear"></div>';
505
+ echo '</li>';
506
+ }
507
+ echo '</ul>';
508
+ echo '</li>';
509
+ }
510
+ }
511
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
512
+
513
+ /**
514
+ * Add a member admin menu to the BuddyBar.
515
+ *
516
+ * Adds an Toolbar menu to any profile page providing site moderator actions
517
+ * that allow capable users to clean up a users account.
518
+ *
519
+ * @deprecated BuddyPress (2.1.0)
520
+ */
521
+ function bp_members_adminbar_admin_menu() {
522
+
523
+ // Only show if viewing a user
524
+ if ( !bp_displayed_user_id() )
525
+ return false;
526
+
527
+ // Don't show this menu to non site admins or if you're viewing your own profile
528
+ if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() )
529
+ return false; ?>
530
+
531
+ <li id="bp-adminbar-adminoptions-menu">
532
+
533
+ <a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a>
534
+
535
+ <ul>
536
+ <?php if ( bp_is_active( 'xprofile' ) ) : ?>
537
+
538
+ <li><a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"><?php printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li>
539
+
540
+ <?php endif ?>
541
+
542
+ <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Profile Photo", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li>
543
+
544
+ <li><a href="<?php bp_members_component_link( 'settings', 'capabilities' ); ?>"><?php _e( 'User Capabilities', 'buddypress' ); ?></a></li>
545
+
546
+ <li><a href="<?php bp_members_component_link( 'settings', 'delete-account' ); ?>"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li>
547
+
548
+ <?php do_action( 'bp_members_adminbar_admin_menu' ) ?>
549
+
550
+ </ul>
551
+ </li>
552
+
553
+ <?php
554
+ }
555
+ add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 );
556
+
557
+ /**
558
+ * Create the Notifications menu for the BuddyBar.
559
+ *
560
+ * @since BuddyPress (1.9.0)
561
+ * @deprecated BuddyPress (2.1.0)
562
+ */
563
+ function bp_notifications_buddybar_menu() {
564
+
565
+ if ( ! is_user_logged_in() ) {
566
+ return false;
567
+ }
568
+
569
+ echo '<li id="bp-adminbar-notifications-menu"><a href="' . esc_url( bp_loggedin_user_domain() ) . '">';
570
+ _e( 'Notifications', 'buddypress' );
571
+
572
+ if ( $notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) ) : ?>
573
+ <span><?php echo bp_core_number_format( $notification_count ); ?></span>
574
+ <?php
575
+ endif;
576
+
577
+ echo '</a>';
578
+ echo '<ul>';
579
+
580
+ if ( $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ) ) {
581
+ $counter = 0;
582
+ for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
583
+ $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
584
+
585
+ <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
586
+
587
+ <?php $counter++;
588
+ }
589
+ } else { ?>
590
+
591
+ <li><a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
592
+
593
+ <?php
594
+ }
595
+
596
+ echo '</ul>';
597
+ echo '</li>';
598
+ }
599
+ add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
600
+
601
+ /**
602
+ * Output the base URL for subdomain installations of WordPress Multisite.
603
+ *
604
+ * @since BuddyPress (1.6.0)
605
+ *
606
+ * @deprecated BuddyPress (2.1.0)
607
+ */
608
+ function bp_blogs_subdomain_base() {
609
+ _deprecated_function( __FUNCTION__, '2.1', 'bp_signup_subdomain_base()' );
610
+ echo bp_signup_get_subdomain_base();
611
+ }
612
+
613
+ /**
614
+ * Return the base URL for subdomain installations of WordPress Multisite.
615
+ *
616
+ * @since BuddyPress (1.6.0)
617
+ *
618
+ * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com.
619
+ *
620
+ * @deprecated BuddyPress (2.1.0)
621
+ */
622
+ function bp_blogs_get_subdomain_base() {
623
+ _deprecated_function( __FUNCTION__, '2.1', 'bp_signup_get_subdomain_base()' );
624
+ return bp_signup_get_subdomain_base();
625
+ }
626
+
627
+ /**
628
+ * Alledgedly output an avatar upload form, but it hasn't done that since 2009.
629
+ *
630
+ * @since BuddyPress (1.0.0)
631
+ * @deprecated BuddyPress (2.1.0)
632
+ */
633
+ function bp_avatar_upload_form() {
634
+ _deprecated_function(__FUNCTION__, '2.1', 'No longer used' );
635
+ }
636
+
bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.css ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ac_results {
2
+ padding: 0px;
3
+ overflow: hidden;
4
+ z-index: 99999;
5
+ background: #fff;
6
+ border: 1px solid #ccc;
7
+ -moz-border-radius-bottomleft: 3px;
8
+ -khtml-border-bottom-right-radius: 3px;
9
+ -webkit-border-bottom-right-radius: 3px;
10
+ border-bottom-right-radius: 3px;
11
+ -moz-border-radius-bottomright: 3px;
12
+ -khtml-border-bottom-left-radius: 3px;
13
+ -webkit-border-bottom-left-radius: 3px;
14
+ border-bottom-left-radius: 3px;
15
+ }
16
+ .ac_results ul {
17
+ width: 100%;
18
+ list-style-position: outside;
19
+ list-style: none;
20
+ padding: 0;
21
+ margin: 0;
22
+ }
23
+
24
+ .ac_results li {
25
+ margin: 0px;
26
+ padding: 5px 10px;
27
+ cursor: pointer;
28
+ display: block;
29
+ font-size: 1em;
30
+ line-height: 16px;
31
+ overflow: hidden;
32
+ }
33
+ .ac_results li img {
34
+ margin-left: 5px;
35
+ }
36
+
37
+ .ac_odd {
38
+ background-color: #f0f0f0;
39
+ }
40
+
41
+ .ac_over {
42
+ background-color: #888;
43
+ color: #fff;
44
+ }
45
+
46
+ ul.acfb-holder {
47
+ margin : 0;
48
+ height : auto !important;
49
+ height : 1%;
50
+ overflow: hidden;
51
+ padding: 0;
52
+ list-style: none;
53
+ }
54
+ ul.acfb-holder li {
55
+ float : right;
56
+ margin : 0 0 4px 5px;
57
+ list-style-type: none;
58
+ }
59
+
60
+ ul.acfb-holder li.friend-tab {
61
+ border-radius : 3px;
62
+ -moz-border-radius : 3px;
63
+ -webkit-border-radius : 3px;
64
+ border : 1px solid #ffe7c7;
65
+ padding : 2px 7px 2px;
66
+ background : #FFF9DF;
67
+ font-size: 1em;
68
+ }
69
+ li.friend-tab img.avatar {
70
+ border-width: 2px !important;
71
+ vertical-align: middle;
72
+ }
73
+
74
+ li.friend-tab span.p {
75
+ padding-right: 5px;
76
+ font-size: 0.8em;
77
+ cursor: pointer;
78
+ }
79
+
80
+ input#send-to-input { width: 275px; }
bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ .ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.ac_results ul{width:100%;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-left:5px}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:right;margin:0 0 4px 5px;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px;background:#FFF9DF;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-right:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px}
{bp-messages → bp-core/deprecated}/css/autocomplete/jquery.autocompletefb.css RENAMED
@@ -34,10 +34,6 @@
34
  margin-right: 5px;
35
  }
36
 
37
- .ac_loading {
38
- background : url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat;
39
- }
40
-
41
  .ac_odd {
42
  background-color: #f0f0f0;
43
  }
@@ -82,4 +78,3 @@ ul.acfb-holder {
82
  }
83
 
84
  input#send-to-input { width: 275px; }
85
-
34
  margin-right: 5px;
35
  }
36
 
 
 
 
 
37
  .ac_odd {
38
  background-color: #f0f0f0;
39
  }
78
  }
79
 
80
  input#send-to-input { width: 275px; }
 
bp-core/deprecated/css/autocomplete/jquery.autocompletefb.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ .ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ac_results ul{width:100%;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-right:5px}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px;background:#FFF9DF;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px}
{bp-messages → bp-core/deprecated}/js/autocomplete/jquery.autocomplete.js RENAMED
File without changes
bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){a.fn.extend({autocomplete:function(b,c){var d="string"==typeof b;return c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c),c.highlight=c.highlight||function(a){return a},this.each(function(){new a.Autocompleter(this,c)})},result:function(a){return this.bind("result",a)},search:function(a){return this.trigger("search",[a])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(a){return this.trigger("setOptions",[a])},unautocomplete:function(){return this.trigger("unautocomplete")}}),a.Autocompleter=function(b,c){function d(){var a=w.selected();if(!a)return!1;var b=a.result;if(s=b,c.multiple){var d=f(r.val());d.length>1&&(b=d.slice(0,d.length-1).join(c.multipleSeparator)+c.multipleSeparator+b),b+=c.multipleSeparator}return r.val(b),j(),r.trigger("result",[a.data,a.value]),!0}function e(a,b){if(p==q.DEL)return void w.hide();var d=r.val();(b||d!=s)&&(s=d,d=g(d),d.length>=c.minChars?(r.addClass(c.loadingClass),jQuery("#send-to-input").addClass("loading"),c.matchCase||(d=d.toLowerCase()),l(d,k,j)):(n(),w.hide()))}function f(b){if(!b)return[""];var d=b.split(a.trim(c.multipleSeparator)),e=[];return a.each(d,function(b,c){a.trim(c)&&(e[b]=a.trim(c))}),e}function g(a){if(!c.multiple)return a;var b=f(a);return b[b.length-1]}function h(d,e){c.autoFill&&g(r.val()).toLowerCase()==d.toLowerCase()&&8!=p&&(r.val(r.val()+e.substring(g(s).length)),a.Autocompleter.Selection(b,s.length,s.length+e.length))}function i(){clearTimeout(o),o=setTimeout(j,200)}function j(){w.hide(),clearTimeout(o),n(),c.mustMatch&&r.search(function(a){a||r.val("")})}function k(a,b){if(b&&b.length&&u){n(),w.display(b,a);var c=b[0].value.split(";");b.value=c[0],h(a,b.value),w.show()}else j()}function l(d,e,f){c.matchCase||(d=d.toLowerCase());var h=t.load(d);if(h&&h.length)e(d,h);else if("string"==typeof c.url&&c.url.length>0){var i={};a.each(c.extraParams,function(a,b){i[a]="function"==typeof b?b():b}),a.ajax({mode:"abort",port:"autocomplete"+b.name,dataType:c.dataType,url:c.url,data:a.extend({q:g(d),limit:c.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},i),success:function(a){var b=c.parse&&c.parse(a)||m(a);t.add(d,b),e(d,b)}})}else f(d)}function m(b){for(var d=[],e=b.split("\n"),f=0;f<e.length;f++){var g=a.trim(e[f]);g&&(g=g.split("|"),d[d.length]={data:g,value:g[0],result:c.formatResult&&c.formatResult(g,g[0])||g[0]})}return d}function n(){r.removeClass(c.loadingClass),jQuery("#send-to-input").removeClass("loading")}var o,p,q={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},r=a(b).attr("autocomplete","off").addClass(c.inputClass),s="",t=a.Autocompleter.Cache(c),u=0,v={mouseDownOnSelect:!1},w=a.Autocompleter.Select(c,b,d,v);r.keydown(function(b){switch(p=b.keyCode,b.keyCode){case q.UP:b.preventDefault(),w.visible()?w.prev():e(0,!0);break;case q.DOWN:b.preventDefault(),w.visible()?w.next():e(0,!0);break;case q.PAGEUP:b.preventDefault(),w.visible()?w.pageUp():e(0,!0);break;case q.PAGEDOWN:b.preventDefault(),w.visible()?w.pageDown():e(0,!0);break;case c.multiple&&","==a.trim(c.multipleSeparator)&&q.COMMA:case q.TAB:case q.RETURN:d()&&(c.multiple||r.blur(),b.preventDefault(),r.focus());break;case q.ESC:w.hide();break;default:clearTimeout(o),o=setTimeout(e,c.delay)}}).keypress(function(){}).focus(function(){u++}).blur(function(){u=0,v.mouseDownOnSelect||i()}).click(function(){u++>1&&!w.visible()&&e(0,!0)}).bind("search",function(){function b(a,b){var d;if(b&&b.length)for(var e=0;e<b.length;e++)if(b[e].result.toLowerCase()==a.toLowerCase()){d=b[e];break}"function"==typeof c?c(d):r.trigger("result",d&&[d.data,d.value])}var c=arguments.length>1?arguments[1]:null;a.each(f(r.val()),function(a,c){l(c,b,b)})}).bind("flushCache",function(){t.flush()}).bind("setOptions",function(){a.extend(c,arguments[1]),"data"in arguments[1]&&t.populate()}).bind("unautocomplete",function(){w.unbind(),r.unbind()})},a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(a){return a[0]},autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(a,b){return a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:250,attachTo:"body"},a.Autocompleter.Cache=function(b){function c(a,c){b.matchCase||(a=a.toLowerCase());var d=a.indexOf(c);return-1==d?!1:0==d||b.matchContains}function d(a,c){h>b.cacheLength&&f(),g[a]||h++,g[a]=c}function e(){if(!b.data)return!1;var c={},e=0;b.url||(b.cacheLength=1),c[""]=[];for(var f=0,g=b.data.length;g>f;f++){var h=b.data[f];h="string"==typeof h?[h]:h;var i=b.formatItem(h,f+1,b.data.length);if(i!==!1){var j=i.charAt(0).toLowerCase();c[j]||(c[j]=[]);var k={value:i,data:h,result:b.formatResult&&b.formatResult(h)||i};c[j].push(k),e++<b.max&&c[""].push(k)}}a.each(c,function(a,c){b.cacheLength++,d(a,c)})}function f(){g={},h=0}var g={},h=0;return setTimeout(e,25),{flush:f,add:d,populate:e,load:function(d){if(!b.cacheLength||!h)return null;if(!b.url&&b.matchContains){var e=[];for(var f in g)if(f.length>0){var i=g[f];a.each(i,function(a,b){c(b.value,d)&&e.push(b)})}return e}if(g[d])return g[d];if(b.matchSubset)for(var j=d.length-1;j>=b.minChars;j--){var i=g[d.substr(0,j)];if(i){var e=[];return a.each(i,function(a,b){c(b.value,d)&&(e[e.length]=b)}),e}}return null}}},a.Autocompleter.Select=function(b,c,d,e){function f(){s&&(n=a("<div/>").hide().addClass(b.resultsClass).css("position","absolute").appendTo(b.attachTo),o=a("<ul>").appendTo(n).mouseover(function(b){g(b).nodeName&&"LI"==g(b).nodeName.toUpperCase()&&(q=a("li",o).removeClass(p.ACTIVE).index(g(b)),a(g(b)).addClass(p.ACTIVE))}).click(function(b){return a(g(b)).addClass(p.ACTIVE),d(),c.focus(),!1}).mousedown(function(){e.mouseDownOnSelect=!0}).mouseup(function(){e.mouseDownOnSelect=!1}),b.width>0&&n.css("width",b.width),s=!1)}function g(a){for(var b=a.target;b&&"LI"!=b.tagName;)b=b.parentNode;return b?b:[]}function h(a){l.slice(q,q+1).removeClass(),i(a);var c=l.slice(q,q+1).addClass(p.ACTIVE);if(b.scroll){var d=0;l.slice(0,q).each(function(){d+=this.offsetHeight}),d+c[0].offsetHeight-o.scrollTop()>o[0].clientHeight?o.scrollTop(d+c[0].offsetHeight-o.innerHeight()):d<o.scrollTop()&&o.scrollTop(d)}}function i(a){q+=a,0>q?q=l.size()-1:q>=l.size()&&(q=0)}function j(a){return b.max&&b.max<a?b.max:a}function k(){o.empty();for(var c=j(m.length),d=0;c>d;d++)if(m[d]){var e=b.formatItem(m[d].data,d+1,c,m[d].value,r);if(e!==!1){var f=a("<li>").html(b.highlight(e,r)).addClass(d%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(f,"ac_data",m[d])}}l=o.find("li"),b.selectFirst&&(l.slice(0,1).addClass(p.ACTIVE),q=0),o.bgiframe()}var l,m,n,o,p={ACTIVE:"ac_over"},q=-1,r="",s=!0;return{display:function(a,b){f(),m=a,r=b,k()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){h(0!=q&&0>q-8?-q:-8)},pageDown:function(){h(q!=l.size()-1&&q+8>l.size()?l.size()-1-q:8)},hide:function(){n&&n.hide(),q=-1},visible:function(){return n&&n.is(":visible")},current:function(){return this.visible()&&(l.filter("."+p.ACTIVE)[0]||b.selectFirst&&l[0])},show:function(){var d=a(c).offset();if(n.css({width:"string"==typeof b.width||b.width>0?b.width:a(c).width(),top:d.top+c.offsetHeight,left:d.left}).show(),b.scroll&&(o.scrollTop(0),o.css({maxHeight:b.scrollHeight,overflow:"auto"}),a.browser.msie&&"undefined"==typeof document.body.style.maxHeight)){var e=0;l.each(function(){e+=this.offsetHeight});var f=e>b.scrollHeight;o.css("height",f?b.scrollHeight:e),f||l.width(o.width()-parseInt(l.css("padding-left"))-parseInt(l.css("padding-right")))}},selected:function(){var b=l&&l.filter("."+p.ACTIVE).removeClass(p.ACTIVE);return b&&b.length&&a.data(b[0],"ac_data")},unbind:function(){n&&n.remove()}}},a.Autocompleter.Selection=function(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.collapse(!0),d.moveStart("character",b),d.moveEnd("character",c),d.select()}else a.setSelectionRange?a.setSelectionRange(b,c):a.selectionStart&&(a.selectionStart=b,a.selectionEnd=c);a.focus()}}(jQuery);
{bp-messages → bp-core/deprecated}/js/autocomplete/jquery.autocompletefb.js RENAMED
File without changes
bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ jQuery.fn.autoCompletefb=function(a){var b=this,c={ul:b,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};a&&jQuery.extend(c,a);var d={params:c,removeFind:function(a){return d.removeUsername(a),jQuery(a).unbind("click").parent().remove(),jQuery(c.inputClass,b).focus(),b.acfb},removeUsername:function(a){var b=a.parentNode.id.substr(a.parentNode.id.indexOf("-")+1);jQuery("#send-to-usernames").removeClass(b)}};return jQuery(c.foundClass+" img.p").click(function(){d.removeFind(this)}),jQuery(c.inputClass,b).autocomplete(c.urlLookup,c.acOptions),jQuery(c.inputClass,b).result(function(a,e,f){var f=c.foundClass.replace(/\./,""),e=String(e).split(" ("),g=e[1].substr(0,e[1].length-1);if(0===jQuery(c.inputClass).siblings("#un-"+g).length){var h="#link-"+g,i=jQuery(h).attr("href"),j='<li class="'+f+'" id="un-'+g+'"><span><a href="'+i+'">'+e[0]+'</a></span> <span class="p">X</span></li>',k=jQuery(c.inputClass,b).before(j);jQuery("#send-to-usernames").addClass(g),jQuery(".p",k[0].previousSibling).click(function(){d.removeFind(this)})}jQuery(c.inputClass,b).val("")}),jQuery(c.inputClass,b).focus(),d};
{bp-messages → bp-core/deprecated}/js/autocomplete/jquery.bgiframe.js RENAMED
File without changes
bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){function b(a){return a&&a.constructor===Number?a+"px":a}a.fn.bgiframe=a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(c){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:!0,src:"javascript:false;"},c);var d='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==!1?"filter:Alpha(Opacity='0');":"")+"top:"+("auto"==c.top?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(c.top))+";left:"+("auto"==c.left?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(c.left))+";width:"+("auto"==c.width?"expression(this.parentNode.offsetWidth+'px')":b(c.width))+";height:"+("auto"==c.height?"expression(this.parentNode.offsetHeight+'px')":b(c.height))+';"/>';return this.each(function(){0===a(this).children("iframe.bgiframe").length&&this.insertBefore(document.createElement(d),this.firstChild)})}:function(){return this},a.fn.bgIframe=a.fn.bgiframe}(jQuery);
{bp-messages → bp-core/deprecated}/js/autocomplete/jquery.dimensions.js RENAMED
File without changes
bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){a.dimensions={version:"@VERSION"},a.each(["Height","Width"],function(c,d){a.fn["inner"+d]=function(){if(this[0]){var a="Height"==d?"Top":"Left",c="Height"==d?"Bottom":"Right";return this[d.toLowerCase()]()+b(this,"padding"+a)+b(this,"padding"+c)}},a.fn["outer"+d]=function(c){if(this[0]){var e="Height"==d?"Top":"Left",f="Height"==d?"Bottom":"Right";return c=a.extend({margin:!1},c||{}),this[d.toLowerCase()]()+b(this,"border"+e+"Width")+b(this,"border"+f+"Width")+b(this,"padding"+e)+b(this,"padding"+f)+(c.margin?b(this,"margin"+e)+b(this,"margin"+f):0)}}}),a.each(["Left","Top"],function(b,c){a.fn["scroll"+c]=function(b){return this[0]?void 0!=b?this.each(function(){this==window||this==document?window.scrollTo("Left"==c?b:a(window).scrollLeft(),"Top"==c?b:a(window).scrollTop()):this["scroll"+c]=b}):this[0]==window||this[0]==document?self["Left"==c?"pageXOffset":"pageYOffset"]||a.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]:void 0}}),a.fn.extend({position:function(){var a,c,d,e,f=this[0];return f&&(d=this.offsetParent(),a=this.offset(),c=d.offset(),a.top-=b(f,"marginTop"),a.left-=b(f,"marginLeft"),c.top+=b(d,"borderTopWidth"),c.left+=b(d,"borderLeftWidth"),e={top:a.top-c.top,left:a.left-c.left}),e},offsetParent:function(){for(var b=this[0].offsetParent;b&&!/^body|html$/i.test(b.tagName)&&"static"==a.css(b,"position");)b=b.offsetParent;return a(b)}});var b=function(b,c){return parseInt(a.css(b.jquery?b[0]:b,c))||0}}(jQuery);
{bp-messages → bp-core/deprecated}/js/autocomplete/license.bgiframe.txt RENAMED
File without changes
bp-core/deprecated/js/jquery-scroll-to.js ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint undef: false */
2
+ /* jshint -W065 */
3
+
4
+ /*!
5
+ * jQuery.ScrollTo
6
+ * Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
7
+ * Licensed under MIT
8
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
9
+ * @projectDescription Easy element scrolling using jQuery.
10
+ * @author Ariel Flesler
11
+ * @version 1.4.12
12
+ */
13
+
14
+ (function(factory) {
15
+ // AMD
16
+ if (typeof define === 'function' && define.amd) {
17
+ define(['jquery'], factory);
18
+ // CommonJS
19
+ } else if (typeof exports === 'object') {
20
+ factory(require('jquery'));
21
+ // Browser globals
22
+ } else {
23
+ factory(jQuery);
24
+ }
25
+ }(function($) {
26
+
27
+ var $scrollTo = $.scrollTo = function(target, duration, settings) {
28
+ return $(window).scrollTo(target, duration, settings);
29
+ };
30
+
31
+ $scrollTo.defaults = {
32
+ axis: 'xy',
33
+ duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1,
34
+ limit: true
35
+ };
36
+
37
+ // Returns the element that needs to be animated to scroll the window.
38
+ // Kept for backwards compatibility (specially for localScroll & serialScroll)
39
+ $scrollTo.window = function() {
40
+ return $(window)._scrollable();
41
+ };
42
+
43
+ // Hack, hack, hack :)
44
+ // Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
45
+ $.fn._scrollable = function() {
46
+ return this.map(function() {
47
+ var elem = this,
48
+ isWin = !elem.nodeName || $.inArray(elem.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) !== -1;
49
+
50
+ if (!isWin) {
51
+ return elem;
52
+ }
53
+
54
+ var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
55
+
56
+ return /webkit/i.test(navigator.userAgent) || doc.compatMode === 'BackCompat' ?
57
+ doc.body :
58
+ doc.documentElement;
59
+ });
60
+ };
61
+
62
+ $.fn.scrollTo = function(target, duration, settings) {
63
+ if (typeof duration === 'object') {
64
+ settings = duration;
65
+ duration = 0;
66
+ }
67
+ if (typeof settings === 'function') {
68
+ settings = {onAfter: settings};
69
+ }
70
+
71
+ if (target === 'max') {
72
+ target = 9e9;
73
+ }
74
+
75
+ settings = $.extend({}, $scrollTo.defaults, settings);
76
+ // Speed is still recognized for backwards compatibility
77
+ duration = duration || settings.duration;
78
+ // Make sure the settings are given right
79
+ settings.queue = settings.queue && settings.axis.length > 1;
80
+
81
+ // Let's keep the overall duration
82
+ if (settings.queue) {
83
+ duration /= 2;
84
+ }
85
+
86
+ settings.offset = both(settings.offset);
87
+ settings.over = both(settings.over);
88
+
89
+ return this._scrollable().each(function() {
90
+
91
+ // Null target yields nothing, just like jQuery does
92
+ if (target === null) {
93
+ return;
94
+ }
95
+
96
+ var elem = this,
97
+ $elem = $(elem),
98
+ targ = target, toff, attr = {},
99
+ win = $elem.is('html,body');
100
+
101
+ switch (typeof targ) {
102
+ // A number will pass the regex
103
+ case 'number':
104
+ case 'string':
105
+ if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
106
+ targ = both(targ);
107
+ // We are done
108
+ break;
109
+ }
110
+ // Relative/Absolute selector, no break!
111
+ targ = win ? $(targ) : $(targ, this);
112
+ if (!targ.length) {
113
+ return;
114
+ }
115
+ /* falls through */
116
+ case 'object':
117
+ // DOMElement / jQuery
118
+ if (targ.is || targ.style) {
119
+ // Get the real position of the target
120
+ toff = (targ = $(targ)).offset();
121
+ }
122
+ }
123
+
124
+ var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
125
+
126
+ $.each(settings.axis.split(''), function(i, axis) {
127
+ var Pos = axis === 'x' ? 'Left' : 'Top',
128
+ pos = Pos.toLowerCase(),
129
+ key = 'scroll' + Pos,
130
+ old = elem[key],
131
+ max = $scrollTo.max(elem, axis);
132
+
133
+ if (toff) {// jQuery / DOMElement
134
+ attr[key] = toff[pos] + (win ? 0 : old - $elem.offset()[pos]);
135
+
136
+ // If it's a dom element, reduce the margin
137
+ if (settings.margin) {
138
+ attr[key] -= parseInt(targ.css('margin' + Pos)) || 0;
139
+ attr[key] -= parseInt(targ.css('border' + Pos + 'Width')) || 0;
140
+ }
141
+
142
+ attr[key] += offset[pos] || 0;
143
+
144
+ // Scroll to a fraction of its width/height
145
+ if (settings.over[pos]) {
146
+ attr[key] += targ[axis === 'x' ? 'width' : 'height']() * settings.over[pos];
147
+ }
148
+ } else {
149
+ var val = targ[pos];
150
+ // Handle percentage values
151
+ attr[key] = val.slice && val.slice(-1) === '%' ?
152
+ parseFloat(val) / 100 * max
153
+ : val;
154
+ }
155
+
156
+ // Number or 'number'
157
+ if (settings.limit && /^\d+$/.test(attr[key])) {
158
+ // Check the limits
159
+ attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
160
+ }
161
+
162
+ // Queueing axes
163
+ if (!i && settings.queue) {
164
+ // Don't waste time animating, if there's no need.
165
+ if (old !== attr[key]) {
166
+ // Intermediate animation
167
+ animate(settings.onAfterFirst);
168
+ }
169
+ // Don't animate this axis again in the next iteration.
170
+ delete attr[key];
171
+ }
172
+ });
173
+
174
+ animate(settings.onAfter);
175
+
176
+ function animate(callback) {
177
+ $elem.animate(attr, duration, settings.easing, callback && function() {
178
+ callback.call(this, targ, settings);
179
+ });
180
+ }
181
+
182
+ }).end();
183
+ };
184
+
185
+ // Max scrolling position, works on quirks mode
186
+ // It only fails (not too badly) on IE, quirks mode.
187
+ $scrollTo.max = function(elem, axis) {
188
+ var Dim = axis === 'x' ? 'Width' : 'Height',
189
+ scroll = 'scroll' + Dim;
190
+
191
+ if (!$(elem).is('html,body')) {
192
+ return elem[scroll] - $(elem)[Dim.toLowerCase()]();
193
+ }
194
+
195
+ var size = 'client' + Dim,
196
+ html = elem.ownerDocument.documentElement,
197
+ body = elem.ownerDocument.body;
198
+
199
+ return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
200
+ };
201
+
202
+ function both(val) {
203
+ return $.isFunction(val) || typeof val === 'object' ? val : {top: val, left: val};
204
+ }
205
+
206
+ // AMD requirement
207
+ return $scrollTo;
208
+ }));
bp-core/deprecated/js/jquery-scroll-to.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(b){return a.isFunction(b)||"object"==typeof b?b:{top:b,left:b}}var c=a.scrollTo=function(b,c,d){return a(window).scrollTo(b,c,d)};return c.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1,limit:!0},c.window=function(){return a(window)._scrollable()},a.fn._scrollable=function(){return this.map(function(){var b=this,c=!b.nodeName||-1!==a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"]);if(!c)return b;var d=(b.contentWindow||b).document||b.ownerDocument||b;return/webkit/i.test(navigator.userAgent)||"BackCompat"===d.compatMode?d.body:d.documentElement})},a.fn.scrollTo=function(d,e,f){return"object"==typeof e&&(f=e,e=0),"function"==typeof f&&(f={onAfter:f}),"max"===d&&(d=9e9),f=a.extend({},c.defaults,f),e=e||f.duration,f.queue=f.queue&&f.axis.length>1,f.queue&&(e/=2),f.offset=b(f.offset),f.over=b(f.over),this._scrollable().each(function(){function g(a){j.animate(l,e,f.easing,a&&function(){a.call(this,k,f)})}if(null!==d){var h,i=this,j=a(i),k=d,l={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}if(k=m?a(k):a(k,this),!k.length)return;case"object":(k.is||k.style)&&(h=(k=a(k)).offset())}var n=a.isFunction(f.offset)&&f.offset(i,k)||f.offset;a.each(f.axis.split(""),function(a,b){var d="x"===b?"Left":"Top",e=d.toLowerCase(),o="scroll"+d,p=i[o],q=c.max(i,b);if(h)l[o]=h[e]+(m?0:p-j.offset()[e]),f.margin&&(l[o]-=parseInt(k.css("margin"+d))||0,l[o]-=parseInt(k.css("border"+d+"Width"))||0),l[o]+=n[e]||0,f.over[e]&&(l[o]+=k["x"===b?"width":"height"]()*f.over[e]);else{var r=k[e];l[o]=r.slice&&"%"===r.slice(-1)?parseFloat(r)/100*q:r}f.limit&&/^\d+$/.test(l[o])&&(l[o]=l[o]<=0?0:Math.min(l[o],q)),!a&&f.queue&&(p!==l[o]&&g(f.onAfterFirst),delete l[o])}),g(f.onAfter)}}).end()},c.max=function(b,c){var d="x"===c?"Width":"Height",e="scroll"+d;if(!a(b).is("html,body"))return b[e]-a(b)[d.toLowerCase()]();var f="client"+d,g=b.ownerDocument.documentElement,h=b.ownerDocument.body;return Math.max(g[e],h[e])-Math.min(g[f],h[f])},c});
bp-core/images/60pc_black.png CHANGED
Binary file
bp-core/images/Jcrop.gif CHANGED
Binary file
bp-core/images/admin-menu-arrow.gif CHANGED
Binary file
bp-core/images/bp20/admin-xprofile.jpg DELETED
Binary file
bp-core/images/bp20/load-newest.jpg DELETED
Binary file
bp-core/images/bp20/performance.png DELETED
Binary file
bp-core/images/bp20/tools-buddypress.jpg DELETED
Binary file
bp-core/images/bp20/user-mark-spam.jpg DELETED
Binary file
bp-core/images/bp20/users-pending.jpg DELETED
Binary file
bp-core/images/mystery-man-50.jpg CHANGED
Binary file
bp-core/images/mystery-man.jpg CHANGED
Binary file
bp-core/js/confirm.js CHANGED
@@ -1,7 +1,12 @@
 
 
 
1
  jQuery( document ).ready( function() {
2
  jQuery( 'a.confirm').click( function() {
3
- if ( confirm( BP_Confirm.are_you_sure ) )
4
- return true; else return false;
 
 
 
5
  });
6
  });
7
-
1
+ /* jshint devel: true */
2
+ /* global BP_Confirm */
3
+
4
  jQuery( document ).ready( function() {
5
  jQuery( 'a.confirm').click( function() {
6
+ if ( confirm( BP_Confirm.are_you_sure ) ) {
7
+ return true;
8
+ } else {
9
+ return false;
10
+ }
11
  });
12
  });
 
bp-core/js/confirm.min.js CHANGED
@@ -1 +1,2 @@
1
- jQuery(document).ready(function(){jQuery("a.confirm").click(function(){if(confirm(BP_Confirm.are_you_sure)){return true}else{return false}})});
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ jQuery(document).ready(function(){jQuery("a.confirm").click(function(){return confirm(BP_Confirm.are_you_sure)?!0:!1})});
bp-core/js/jquery-cookie.js ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint undef: false */
2
+
3
+ /*!
4
+ * jQuery Cookie Plugin v1.4.1
5
+ * https://github.com/carhartl/jquery-cookie
6
+ *
7
+ * Copyright 2013 Klaus Hartl
8
+ * Released under the MIT license
9
+ */
10
+ (function(factory) {
11
+ // AMD
12
+ if (typeof define === 'function' && define.amd) {
13
+ define(['jquery'], factory);
14
+ // CommonJS
15
+ } else if (typeof exports === 'object') {
16
+ factory(require('jquery'));
17
+ // Browser globals
18
+ } else {
19
+ factory(jQuery);
20
+ }
21
+ }(function($) {
22
+
23
+ var pluses = /\+/g;
24
+
25
+ function encode(s) {
26
+ return config.raw ? s : encodeURIComponent(s);
27
+ }
28
+
29
+ function decode(s) {
30
+ return config.raw ? s : decodeURIComponent(s);
31
+ }
32
+
33
+ function stringifyCookieValue(value) {
34
+ return encode(config.json ? JSON.stringify(value) : String(value));
35
+ }
36
+
37
+ function parseCookieValue(s) {
38
+ if (s.indexOf('"') === 0) {
39
+ // This is a quoted cookie as according to RFC2068, unescape...
40
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
41
+ }
42
+
43
+ try {
44
+ // Replace server-side written pluses with spaces.
45
+ // If we can't decode the cookie, ignore it, it's unusable.
46
+ // If we can't parse the cookie, ignore it, it's unusable.
47
+ s = decodeURIComponent(s.replace(pluses, ' '));
48
+ return config.json ? JSON.parse(s) : s;
49
+ } catch (e) {
50
+ }
51
+ }
52
+
53
+ function read(s, converter) {
54
+ var value = config.raw ? s : parseCookieValue(s);
55
+ return $.isFunction(converter) ? converter(value) : value;
56
+ }
57
+
58
+ var config = $.cookie = function(key, value, options) {
59
+
60
+ // Write
61
+
62
+ if (value !== undefined && !$.isFunction(value)) {
63
+ options = $.extend({}, config.defaults, options);
64
+
65
+ if (typeof options.expires === 'number') {
66
+ var days = options.expires, t = options.expires = new Date();
67
+ t.setTime(+t + days * 864e+5);
68
+ }
69
+
70
+ return (document.cookie = [
71
+ encode(key), '=', stringifyCookieValue(value),
72
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
73
+ options.path ? '; path=' + options.path : '',
74
+ options.domain ? '; domain=' + options.domain : '',
75
+ options.secure ? '; secure' : ''
76
+ ].join(''));
77
+ }
78
+
79
+ // Read
80
+
81
+ var result = key ? undefined : {};
82
+
83
+ // To prevent the for loop in the first place assign an empty array
84
+ // in case there are no cookies at all. Also prevents odd result when
85
+ // calling $.cookie().
86
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
87
+
88
+ for (var i = 0, l = cookies.length; i < l; i++) {
89
+ var parts = cookies[i].split('=');
90
+ var name = decode(parts.shift());
91
+ var cookie = parts.join('=');
92
+
93
+ if (key && key === name) {
94
+ // If second argument (value) is a function it's a converter...
95
+ result = read(cookie, value);
96
+ break;
97
+ }
98
+
99
+ // Prevent storing a cookie that we couldn't decode.
100
+ if (!key && (cookie = read(cookie)) !== undefined) {
101
+ result[name] = cookie;
102
+ }
103
+ }
104
+
105
+ return result;
106
+ };
107
+
108
+ config.defaults = {};
109
+
110
+ $.removeCookie = function(key, options) {
111
+ if ($.cookie(key) === undefined) {
112
+ return false;
113
+ }
114
+
115
+ // Must not alter options, thus extending a fresh object...
116
+ $.cookie(key, '', $.extend({}, options, {expires: -1}));
117
+ return !$.cookie(key);
118
+ };
119
+
120
+ }));
bp-core/js/jquery-cookie.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
bp-core/js/jquery-query.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /* jshint unused: false */
2
+
3
+ function bp_get_querystring( n ) {
4
+ var half = location.search.split( n + '=' )[1];
5
+ return half ? decodeURIComponent( half.split('&')[0] ) : null;
6
+ }
bp-core/js/jquery-query.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ function bp_get_querystring(a){var b=location.search.split(a+"=")[1];return b?decodeURIComponent(b.split("&")[0]):null}
bp-core/js/jquery.atwho.js ADDED
@@ -0,0 +1,824 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jquery.atwho - v0.5.0 - 2014-07-14
2
+ * Copyright (c) 2014 chord.luo <chord.luo@gmail.com>;
3
+ * homepage: http://ichord.github.com/At.js
4
+ * Licensed MIT
5
+ */
6
+
7
+ (function() {
8
+ (function(factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ return define(['jquery'], factory);
11
+ } else {
12
+ return factory(window.jQuery);
13
+ }
14
+ })(function($) {
15
+
16
+ var $CONTAINER, Api, App, Controller, DEFAULT_CALLBACKS, KEY_CODE, Model, View,
17
+ __slice = [].slice;
18
+
19
+ App = (function() {
20
+ function App(inputor) {
21
+ this.current_flag = null;
22
+ this.controllers = {};
23
+ this.alias_maps = {};
24
+ this.$inputor = $(inputor);
25
+ this.iframe = null;
26
+ this.setIframe();
27
+ this.listen();
28
+ }
29
+
30
+ App.prototype.setIframe = function(iframe) {
31
+ if (iframe) {
32
+ this.window = iframe.contentWindow;
33
+ this.document = iframe.contentDocument || this.window.document;
34
+ return this.iframe = iframe;
35
+ } else {
36
+ this.document = document;
37
+ this.window = window;
38
+ return this.iframe = null;
39
+ }
40
+ };
41
+
42
+ App.prototype.controller = function(at) {
43
+ var c, current, current_flag, _ref;
44
+ if (this.alias_maps[at]) {
45
+ current = this.controllers[this.alias_maps[at]];
46
+ } else {
47
+ _ref = this.controllers;
48
+ for (current_flag in _ref) {
49
+ c = _ref[current_flag];
50
+ if (current_flag === at) {
51
+ current = c;
52
+ break;
53
+ }
54
+ }
55
+ }
56
+ if (current) {
57
+ return current;
58
+ } else {
59
+ return this.controllers[this.current_flag];
60
+ }
61
+ };
62
+
63
+ App.prototype.set_context_for = function(at) {
64
+ this.current_flag = at;
65
+ return this;
66
+ };
67
+
68
+ App.prototype.reg = function(flag, setting) {
69
+ var controller, _base;
70
+ controller = (_base = this.controllers)[flag] || (_base[flag] = new Controller(this, flag));
71
+ if (setting.alias) {
72
+ this.alias_maps[setting.alias] = flag;
73
+ }
74
+ controller.init(setting);
75
+ return this;
76
+ };
77
+
78
+ App.prototype.listen = function() {
79
+ return this.$inputor.on('keyup.atwhoInner', (function(_this) {
80
+ return function(e) {
81
+ return _this.on_keyup(e);
82
+ };
83
+ })(this)).on('keydown.atwhoInner', (function(_this) {
84
+ return function(e) {
85
+ return _this.on_keydown(e);
86
+ };
87
+ })(this)).on('scroll.atwhoInner', (function(_this) {
88
+ return function(e) {
89
+ var _ref;
90
+ return (_ref = _this.controller()) != null ? _ref.view.hide(e) : void 0;
91
+ };
92
+ })(this)).on('blur.atwhoInner', (function(_this) {
93
+ return function(e) {
94
+ var c;
95
+ if (c = _this.controller()) {
96
+ return c.view.hide(e, c.get_opt("display_timeout"));
97
+ }
98
+ };
99
+ })(this)).on('click.atwhoInner', (function(_this) {
100
+ return function(e) {
101
+ var _ref;
102
+ return (_ref = _this.controller()) != null ? _ref.view.hide(e) : void 0;
103
+ };
104
+ })(this));
105
+ };
106
+
107
+ App.prototype.shutdown = function() {
108
+ var c, _, _ref;
109
+ _ref = this.controllers;
110
+ for (_ in _ref) {
111
+ c = _ref[_];
112
+ c.destroy();
113
+ delete this.controllers[_];
114
+ }
115
+ return this.$inputor.off('.atwhoInner');
116
+ };
117
+
118
+ App.prototype.dispatch = function() {
119
+ return $.map(this.controllers, (function(_this) {
120
+ return function(c) {
121
+ var delay;
122
+ if (delay = c.get_opt('delay')) {
123
+ clearTimeout(_this.delayedCallback);
124
+ return _this.delayedCallback = setTimeout(function() {
125
+ if (c.look_up()) {
126
+ return _this.set_context_for(c.at);
127
+ }
128
+ }, delay);
129
+ } else {
130
+ if (c.look_up()) {
131
+ return _this.set_context_for(c.at);
132
+ }
133
+ }
134
+ };
135
+ })(this));
136
+ };
137
+
138
+ App.prototype.on_keyup = function(e) {
139
+ var _ref;
140
+ switch (e.keyCode) {
141
+ case KEY_CODE.ESC:
142
+ e.preventDefault();
143
+ if ((_ref = this.controller()) != null) {
144
+ _ref.view.hide();
145
+ }
146
+ break;
147
+ case KEY_CODE.DOWN:
148
+ case KEY_CODE.UP:
149
+ case KEY_CODE.CTRL:
150
+ $.noop();
151
+ break;
152
+ case KEY_CODE.P:
153
+ case KEY_CODE.N:
154
+ if (!e.ctrlKey) {
155
+ this.dispatch();
156
+ }
157
+ break;
158
+ default:
159
+ this.dispatch();
160
+ }
161
+ };
162
+
163
+ App.prototype.on_keydown = function(e) {
164
+ var view, _ref;
165
+ view = (_ref = this.controller()) != null ? _ref.view : void 0;
166
+ if (!(view && view.visible())) {
167
+ return;
168
+ }
169
+ switch (e.keyCode) {
170
+ case KEY_CODE.ESC:
171
+ e.preventDefault();
172
+ view.hide(e);
173
+ break;
174
+ case KEY_CODE.UP:
175
+ e.preventDefault();
176
+ view.prev();
177
+ break;
178
+ case KEY_CODE.DOWN:
179
+ e.preventDefault();
180
+ view.next();
181
+ break;
182
+ case KEY_CODE.P:
183
+ if (!e.ctrlKey) {
184
+ return;
185
+ }
186
+ e.preventDefault();
187
+ view.prev();
188
+ break;
189
+ case KEY_CODE.N:
190
+ if (!e.ctrlKey) {
191
+ return;
192
+ }
193
+ e.preventDefault();
194
+ view.next();
195
+ break;
196
+ case KEY_CODE.TAB:
197
+ case KEY_CODE.ENTER:
198
+ if (!view.visible()) {
199
+ return;
200
+ }
201
+ e.preventDefault();
202
+ view.choose(e);
203
+ break;
204
+ default:
205
+ $.noop();
206
+ }
207
+ };
208
+
209
+ return App;
210
+
211
+ })();
212
+
213
+ Controller = (function() {
214
+ Controller.prototype.uid = function() {
215
+ return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime());
216
+ };
217
+
218
+ function Controller(app, at) {
219
+ this.app = app;
220
+ this.at = at;
221
+ this.$inputor = this.app.$inputor;
222
+ this.id = this.$inputor[0].id || this.uid();
223
+ this.setting = null;
224
+ this.query = null;
225
+ this.pos = 0;
226
+ this.cur_rect = null;
227
+ this.range = null;
228
+ $CONTAINER.append(this.$el = $("<div id='atwho-ground-" + this.id + "'></div>"));
229
+ this.model = new Model(this);
230
+ this.view = new View(this);
231
+ }
232
+
233
+ Controller.prototype.init = function(setting) {
234
+ this.setting = $.extend({}, this.setting || $.fn.atwho["default"], setting);
235
+ this.view.init();
236
+ return this.model.reload(this.setting.data);
237
+ };
238
+
239
+ Controller.prototype.destroy = function() {
240
+ this.trigger('beforeDestroy');
241
+ this.model.destroy();
242
+ this.view.destroy();
243
+ return this.$el.remove();
244
+ };
245
+
246
+ Controller.prototype.call_default = function() {
247
+ var args, error, func_name;
248
+ func_name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
249
+ try {
250
+ return DEFAULT_CALLBACKS[func_name].apply(this, args);
251
+ } catch (_error) {
252
+ error = _error;
253
+ return $.error("" + error + " Or maybe At.js doesn't have function " + func_name);
254
+ }
255
+ };
256
+
257
+ Controller.prototype.trigger = function(name, data) {
258
+ var alias, event_name;
259
+ if (data == null) {
260
+ data = [];
261
+ }
262
+ data.push(this);
263
+ alias = this.get_opt('alias');
264
+ event_name = alias ? "" + name + "-" + alias + ".atwho" : "" + name + ".atwho";
265
+ return this.$inputor.trigger(event_name, data);
266
+ };
267
+
268
+ Controller.prototype.callbacks = function(func_name) {
269
+ return this.get_opt("callbacks")[func_name] || DEFAULT_CALLBACKS[func_name];
270
+ };
271
+
272
+ Controller.prototype.get_opt = function(at, default_value) {
273
+ var e;
274
+ try {
275
+ return this.setting[at];
276
+ } catch (_error) {
277
+ e = _error;
278
+ return null;
279
+ }
280
+ };
281
+
282
+ Controller.prototype.content = function() {
283
+ if (this.$inputor.is('textarea, input')) {
284
+ return this.$inputor.val();
285
+ } else {
286
+ return this.$inputor.text();
287
+ }
288
+ };
289
+
290
+ Controller.prototype.catch_query = function() {
291
+ var caret_pos, content, end, query, start, subtext;
292
+ content = this.content();
293
+ caret_pos = this.$inputor.caret('pos', {
294
+ iframe: this.app.iframe
295
+ });
296
+ subtext = content.slice(0, caret_pos);
297
+ query = this.callbacks("matcher").call(this, this.at, subtext, this.get_opt('start_with_space'));
298
+ if (typeof query === "string" && query.length <= this.get_opt('max_len', 20)) {
299
+ start = caret_pos - query.length;
300
+ end = start + query.length;
301
+ this.pos = start;
302
+ query = {
303
+ 'text': query,
304
+ 'head_pos': start,
305
+ 'end_pos': end
306
+ };
307
+ this.trigger("matched", [this.at, query.text]);
308
+ } else {
309
+ query = null;
310
+ this.view.hide();
311
+ }
312
+ return this.query = query;
313
+ };
314
+
315
+ Controller.prototype.rect = function() {
316
+ var c, scale_bottom;
317
+ if (!(c = this.$inputor.caret('offset', this.pos - 1, {
318
+ iframe: this.app.iframe
319
+ }))) {
320
+ return;
321
+ }
322
+ if (this.$inputor.attr('contentEditable') === 'true') {
323
+ c = (this.cur_rect || (this.cur_rect = c)) || c;
324
+ }
325
+ scale_bottom = this.app.document.selection ? 0 : 2;
326
+ return {
327
+ left: c.left,
328
+ top: c.top,
329
+ bottom: c.top + c.height + scale_bottom
330
+ };
331
+ };
332
+
333
+ Controller.prototype.reset_rect = function() {
334
+ if (this.$inputor.attr('contentEditable') === 'true') {
335
+ return this.cur_rect = null;
336
+ }
337
+ };
338
+
339
+ Controller.prototype.mark_range = function() {
340
+ if (this.$inputor.attr('contentEditable') === 'true') {
341
+ if (this.app.window.getSelection) {
342
+ this.range = this.app.window.getSelection().getRangeAt(0);
343
+ }
344
+ if (this.app.document.selection) {
345
+ return this.ie8_range = this.app.document.selection.createRange();
346
+ }
347
+ }
348
+ };
349
+
350
+ Controller.prototype.insert_content_for = function($li) {
351
+ var data, data_value, tpl;
352
+ data_value = $li.data('value');
353
+ tpl = this.get_opt('insert_tpl');
354
+ if (this.$inputor.is('textarea, input') || !tpl) {
355
+ return data_value;
356
+ }
357
+ data = $.extend({}, $li.data('item-data'), {
358
+ 'atwho-data-value': data_value,
359
+ 'atwho-at': this.at
360
+ });
361
+ return this.callbacks("tpl_eval").call(this, tpl, data);
362
+ };
363
+
364
+ Controller.prototype.insert = function(content, $li) {
365
+ var $inputor, content_node, pos, range, sel, source, start_str, text, wrapped_content;
366
+ $inputor = this.$inputor;
367
+ wrapped_content = this.callbacks('inserting_wrapper').call(this, $inputor, content, this.get_opt("suffix"));
368
+ if ($inputor.is('textarea, input')) {
369
+ source = $inputor.val();
370
+ start_str = source.slice(0, Math.max(this.query.head_pos - this.at.length, 0));
371
+ text = "" + start_str + wrapped_content + (source.slice(this.query['end_pos'] || 0));
372
+ $inputor.val(text);
373
+ $inputor.caret('pos', start_str.length + wrapped_content.length, {
374
+ iframe: this.app.iframe
375
+ });
376
+ } else if (range = this.range) {
377
+ pos = range.startOffset - (this.query.end_pos - this.query.head_pos) - this.at.length;
378
+ range.setStart(range.endContainer, Math.max(pos, 0));
379
+ range.setEnd(range.endContainer, range.endOffset);
380
+ range.deleteContents();
381
+ content_node = $(wrapped_content, this.app.document)[0];
382
+ range.insertNode(content_node);
383
+ range.setEndAfter(content_node);
384
+ range.collapse(false);
385
+ sel = this.app.window.getSelection();
386
+ sel.removeAllRanges();
387
+ sel.addRange(range);
388
+ } else if (range = this.ie8_range) {
389
+ range.moveStart('character', this.query.end_pos - this.query.head_pos - this.at.length);
390
+ range.pasteHTML(wrapped_content);
391
+ range.collapse(false);
392
+ range.select();
393
+ }
394
+ if (!$inputor.is(':focus')) {
395
+ $inputor.focus();
396
+ }
397
+ return $inputor.change();
398
+ };
399
+
400
+ Controller.prototype.render_view = function(data) {
401
+ var search_key;
402
+ search_key = this.get_opt("search_key");
403
+ data = this.callbacks("sorter").call(this, this.query.text, data.slice(0, 1001), search_key);
404
+ return this.view.render(data.slice(0, this.get_opt('limit')));
405
+ };
406
+
407
+ Controller.prototype.look_up = function() {
408
+ var query, _callback;
409
+ if (!(query = this.catch_query())) {
410
+ return;
411
+ }
412
+ _callback = function(data) {
413
+ if (data && data.length > 0) {
414
+ return this.render_view(data);
415
+ } else {
416
+ return this.view.hide();
417
+ }
418
+ };
419
+ this.model.query(query.text, $.proxy(_callback, this));
420
+ return query;
421
+ };
422
+
423
+ return Controller;
424
+
425
+ })();
426
+
427
+ Model = (function() {
428
+ function Model(context) {
429
+ this.context = context;
430
+ this.at = this.context.at;
431
+ this.storage = this.context.$inputor;
432
+ }
433
+
434
+ Model.prototype.destroy = function() {
435
+ return this.storage.data(this.at, null);
436
+ };
437
+
438
+ Model.prototype.saved = function() {
439
+ return this.fetch() > 0;
440
+ };
441
+
442
+ Model.prototype.query = function(query, callback) {
443
+ var data, search_key, _remote_filter;
444
+ data = this.fetch();
445
+ search_key = this.context.get_opt("search_key");
446
+ data = this.context.callbacks('filter').call(this.context, query, data, search_key) || [];
447
+ _remote_filter = this.context.callbacks('remote_filter');
448
+ if (data.length > 0 || (!_remote_filter && data.length === 0)) {
449
+ return callback(data);
450
+ } else {
451
+ return _remote_filter.call(this.context, query, callback);
452
+ }
453
+ };
454
+
455
+ Model.prototype.fetch = function() {
456
+ return this.storage.data(this.at) || [];
457
+ };
458
+
459
+ Model.prototype.save = function(data) {
460
+ return this.storage.data(this.at, this.context.callbacks("before_save").call(this.context, data || []));
461
+ };
462
+
463
+ Model.prototype.load = function(data) {
464
+ if (!(this.saved() || !data)) {
465
+ return this._load(data);
466
+ }
467
+ };
468
+
469
+ Model.prototype.reload = function(data) {
470
+ return this._load(data);
471
+ };
472
+
473
+ Model.prototype._load = function(data) {
474
+ if (typeof data === "string") {
475
+ return $.ajax(data, {
476
+ dataType: "json"
477
+ }).done((function(_this) {
478
+ return function(data) {
479
+ return _this.save(data);
480
+ };
481
+ })(this));
482
+ } else {
483
+ return this.save(data);
484
+ }
485
+ };
486
+
487
+ return Model;
488
+
489
+ })();
490
+
491
+ View = (function() {
492
+ function View(context) {
493
+ this.context = context;
494
+ this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
495
+ this.timeout_id = null;
496
+ this.context.$el.append(this.$el);
497
+ this.bind_event();
498
+ }
499
+
500
+ View.prototype.init = function() {
501
+ var id;
502
+ id = this.context.get_opt("alias") || this.context.at.charCodeAt(0);
503
+ return this.$el.attr({
504
+ 'id': "at-view-" + id
505
+ });
506
+ };
507
+
508
+ View.prototype.destroy = function() {
509
+ return this.$el.remove();
510
+ };
511
+
512
+ View.prototype.bind_event = function() {
513
+ var $menu;
514
+ $menu = this.$el.find('ul');
515
+ return $menu.on('mouseenter.atwho-view', 'li', function(e) {
516
+ $menu.find('.cur').removeClass('cur');
517
+ return $(e.currentTarget).addClass('cur');
518
+ }).on('click', (function(_this) {
519
+ return function(e) {
520
+ _this.choose(e);
521
+ return e.preventDefault();
522
+ };
523
+ })(this));
524
+ };
525
+
526
+ View.prototype.visible = function() {
527
+ return this.$el.is(":visible");
528
+ };
529
+
530
+ View.prototype.choose = function(e) {
531
+ var $li, content;
532
+ if (($li = this.$el.find(".cur")).length) {
533
+ content = this.context.insert_content_for($li);
534
+ this.context.insert(this.context.callbacks("before_insert").call(this.context, content, $li), $li);
535
+ this.context.trigger("inserted", [$li, e]);
536
+ this.hide(e);
537
+ }
538
+ if (this.context.get_opt("hide_without_suffix")) {
539
+ return this.stop_showing = true;
540
+ }
541
+ };
542
+
543
+ View.prototype.reposition = function(rect) {
544
+ var offset, _ref;
545
+ if (rect.bottom + this.$el.height() - $(window).scrollTop() > $(window).height()) {
546
+ rect.bottom = rect.top - this.$el.height();
547
+ }
548
+ offset = {
549
+ left: rect.left,
550
+ top: rect.bottom
551
+ };
552
+ if ((_ref = this.context.callbacks("before_reposition")) != null) {
553
+ _ref.call(this.context, offset);
554
+ }
555
+ this.$el.offset(offset);
556
+ return this.context.trigger("reposition", [offset]);
557
+ };
558
+
559
+ View.prototype.next = function() {
560
+ var cur, next;
561
+ cur = this.$el.find('.cur').removeClass('cur');
562
+ next = cur.next();
563
+ if (!next.length) {
564
+ next = this.$el.find('li:first');
565
+ }
566
+ return next.addClass('cur');
567
+ };
568
+
569
+ View.prototype.prev = function() {
570
+ var cur, prev;
571
+ cur = this.$el.find('.cur').removeClass('cur');
572
+ prev = cur.prev();
573
+ if (!prev.length) {
574
+ prev = this.$el.find('li:last');
575
+ }
576
+ return prev.addClass('cur');
577
+ };
578
+
579
+ View.prototype.show = function() {
580
+ var rect;
581
+ if (this.stop_showing) {
582
+ this.stop_showing = false;
583
+ return;
584
+ }
585
+ this.context.mark_range();
586
+ if (!this.visible()) {
587
+ this.$el.show();
588
+ this.context.trigger('shown');
589
+ }
590
+ if (rect = this.context.rect()) {
591
+ return this.reposition(rect);
592
+ }
593
+ };
594
+
595
+ View.prototype.hide = function(e, time) {
596
+ var callback;
597
+ if (!this.visible()) {
598
+ return;
599
+ }
600
+ if (isNaN(time)) {
601
+ this.context.reset_rect();
602
+ this.$el.hide();
603
+ return this.context.trigger('hidden', [e]);
604
+ } else {
605
+ callback = (function(_this) {
606
+ return function() {
607
+ return _this.hide();
608
+ };
609
+ })(this);
610
+ clearTimeout(this.timeout_id);
611
+ return this.timeout_id = setTimeout(callback, time);
612
+ }
613
+ };
614
+
615
+ View.prototype.render = function(list) {
616
+ var $li, $ul, item, li, tpl, _i, _len;
617
+ if (!($.isArray(list) && list.length > 0)) {
618
+ this.hide();
619
+ return;
620
+ }
621
+ this.$el.find('ul').empty();
622
+ $ul = this.$el.find('ul');
623
+ tpl = this.context.get_opt('tpl');
624
+ for (_i = 0, _len = list.length; _i < _len; _i++) {
625
+ item = list[_i];
626
+ item = $.extend({}, item, {
627
+ 'atwho-at': this.context.at
628
+ });
629
+ li = this.context.callbacks("tpl_eval").call(this.context, tpl, item);
630
+ $li = $(this.context.callbacks("highlighter").call(this.context, li, this.context.query.text));
631
+ $li.data("item-data", item);
632
+ $ul.append($li);
633
+ }
634
+ this.show();
635
+ if (this.context.get_opt('highlight_first')) {
636
+ return $ul.find("li:first").addClass("cur");
637
+ }
638
+ };
639
+
640
+ return View;
641
+
642
+ })();
643
+
644
+ KEY_CODE = {
645
+ DOWN: 40,
646
+ UP: 38,
647
+ ESC: 27,
648
+ TAB: 9,
649
+ ENTER: 13,
650
+ CTRL: 17,
651
+ P: 80,
652
+ N: 78
653
+ };
654
+
655
+ DEFAULT_CALLBACKS = {
656
+ before_save: function(data) {
657
+ var item, _i, _len, _results;
658
+ if (!$.isArray(data)) {
659
+ return data;
660
+ }
661
+ _results = [];
662
+ for (_i = 0, _len = data.length; _i < _len; _i++) {
663
+ item = data[_i];
664
+ if ($.isPlainObject(item)) {
665
+ _results.push(item);
666
+ } else {
667
+ _results.push({
668
+ name: item
669
+ });
670
+ }
671
+ }
672
+ return _results;
673
+ },
674
+ matcher: function(flag, subtext, should_start_with_space) {
675
+ var match, regexp;
676
+ flag = flag.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
677
+ if (should_start_with_space) {
678
+ flag = '(?:^|\\s)' + flag;
679
+ }
680
+ regexp = new RegExp(flag + '([A-Za-z0-9_\+\-]*)$|' + flag + '([^\\x00-\\xff]*)$', 'gi');
681
+ match = regexp.exec(subtext);
682
+ if (match) {
683
+ return match[2] || match[1];
684
+ } else {
685
+ return null;
686
+ }
687
+ },
688
+ filter: function(query, data, search_key) {
689
+ var item, _i, _len, _results;
690
+ _results = [];
691
+ for (_i = 0, _len = data.length; _i < _len; _i++) {
692
+ item = data[_i];
693
+ if (~item[search_key].toLowerCase().indexOf(query.toLowerCase())) {
694
+ _results.push(item);
695
+ }
696
+ }
697
+ return _results;
698
+ },
699
+ remote_filter: null,
700
+ sorter: function(query, items, search_key) {
701
+ var item, _i, _len, _results;
702
+ if (!query) {
703
+ return items;
704
+ }
705
+ _results = [];
706
+ for (_i = 0, _len = items.length; _i < _len; _i++) {
707
+ item = items[_i];
708
+ item.atwho_order = item[search_key].toLowerCase().indexOf(query.toLowerCase());
709
+ if (item.atwho_order > -1) {
710
+ _results.push(item);
711
+ }
712
+ }
713
+ return _results.sort(function(a, b) {
714
+ return a.atwho_order - b.atwho_order;
715
+ });
716
+ },
717
+ tpl_eval: function(tpl, map) {
718
+ var error;
719
+ try {
720
+ return tpl.replace(/\$\{([^\}]*)\}/g, function(tag, key, pos) {
721
+ return map[key];
722
+ });
723
+ } catch (_error) {
724
+ error = _error;
725
+ return "";
726
+ }
727
+ },
728
+ highlighter: function(li, query) {
729
+ var regexp;
730
+ if (!query) {
731
+ return li;
732
+ }
733
+ regexp = new RegExp(">\\s*(\\w*?)(" + query.replace("+", "\\+") + ")(\\w*)\\s*<", 'ig');
734
+ return li.replace(regexp, function(str, $1, $2, $3) {
735
+ return '> ' + $1 + '<strong>' + $2 + '</strong>' + $3 + ' <';
736
+ });
737
+ },
738
+ before_insert: function(value, $li) {
739
+ return value;
740
+ },
741
+ inserting_wrapper: function($inputor, content, suffix) {
742
+ var new_suffix, wrapped_content;
743
+ new_suffix = suffix === "" ? suffix : suffix || " ";
744
+ if ($inputor.is('textarea, input')) {
745
+ return '' + content + new_suffix;
746
+ } else if ($inputor.attr('contentEditable') === 'true') {
747
+ new_suffix = suffix === "" ? suffix : suffix || "&nbsp;";
748
+ if (/firefox/i.test(navigator.userAgent)) {
749
+ wrapped_content = "<span>" + content + new_suffix + "</span>";
750
+ } else {
751
+ suffix = "<span contenteditable='false'>" + new_suffix + "<span>";
752
+ wrapped_content = "<span contenteditable='false'>" + content + suffix + "</span>";
753
+ }
754
+ if (this.app.document.selection) {
755
+ wrapped_content = "<span contenteditable='true'>" + content + "</span>";
756
+ }
757
+ return wrapped_content;
758
+ }
759
+ }
760
+ };
761
+
762
+ Api = {
763
+ load: function(at, data) {
764
+ var c;
765
+ if (c = this.controller(at)) {
766
+ return c.model.load(data);
767
+ }
768
+ },
769
+ setIframe: function(iframe) {
770
+ this.setIframe(iframe);
771
+ return null;
772
+ },
773
+ run: function() {
774
+ return this.dispatch();
775
+ },
776
+ destroy: function() {
777
+ this.shutdown();
778
+ return this.$inputor.data('atwho', null);
779
+ }
780
+ };
781
+
782
+ $CONTAINER = $("<div id='atwho-container'></div>");
783
+
784
+ $.fn.atwho = function(method) {
785
+ var result, _args;
786
+ _args = arguments;
787
+ $('body').append($CONTAINER);
788
+ result = null;
789
+ this.filter('textarea, input, [contenteditable=true]').each(function() {
790
+ var $this, app;
791
+ if (!(app = ($this = $(this)).data("atwho"))) {
792
+ $this.data('atwho', (app = new App(this)));
793
+ }
794
+ if (typeof method === 'object' || !method) {
795
+ return app.reg(method.at, method);
796
+ } else if (Api[method] && app) {
797
+ return result = Api[method].apply(app, Array.prototype.slice.call(_args, 1));
798
+ } else {
799
+ return $.error("Method " + method + " does not exist on jQuery.caret");
800
+ }
801
+ });
802
+ return result || this;
803
+ };
804
+
805
+ $.fn.atwho["default"] = {
806
+ at: void 0,
807
+ alias: void 0,
808
+ data: null,
809
+ tpl: "<li data-value='${atwho-at}${name}'>${name}</li>",
810
+ insert_tpl: "<span id='${id}'>${atwho-data-value}</span>",
811
+ callbacks: DEFAULT_CALLBACKS,
812
+ search_key: "name",
813
+ suffix: void 0,
814
+ hide_without_suffix: false,
815
+ start_with_space: true,
816
+ highlight_first: true,
817
+ limit: 5,
818
+ max_len: 20,
819
+ display_timeout: 300,
820
+ delay: null
821
+ };
822
+
823
+ });
824
+ }).call(this);
bp-core/js/jquery.atwho.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ (function(){!function(a){return"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){var b,c,d,e,f,g,h,i,j=[].slice;d=function(){function b(b){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=a(b),this.iframe=null,this.setIframe(),this.listen()}return b.prototype.setIframe=function(a){return a?(this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a):(this.document=document,this.window=window,this.iframe=null)},b.prototype.controller=function(a){var b,c,d,e;if(this.alias_maps[a])c=this.controllers[this.alias_maps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.current_flag]},b.prototype.set_context_for=function(a){return this.current_flag=a,this},b.prototype.reg=function(a,b){var c,d;return c=(d=this.controllers)[a]||(d[a]=new e(this,a)),b.alias&&(this.alias_maps[b.alias]=a),c.init(b),this},b.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",function(a){return function(b){return a.on_keyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.on_keydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.get_opt("display_timeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this))},b.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner")},b.prototype.dispatch=function(){return a.map(this.controllers,function(a){return function(b){var c;return(c=b.get_opt("delay"))?(clearTimeout(a.delayedCallback),a.delayedCallback=setTimeout(function(){return b.look_up()?a.set_context_for(b.at):void 0},c)):b.look_up()?a.set_context_for(b.at):void 0}}(this))},b.prototype.on_keyup=function(b){var c;switch(b.keyCode){case g.ESC:b.preventDefault(),null!=(c=this.controller())&&c.view.hide();break;case g.DOWN:case g.UP:case g.CTRL:a.noop();break;case g.P:case g.N:b.ctrlKey||this.dispatch();break;default:this.dispatch()}},b.prototype.on_keydown=function(b){var c,d;if(c=null!=(d=this.controller())?d.view:void 0,c&&c.visible())switch(b.keyCode){case g.ESC:b.preventDefault(),c.hide(b);break;case g.UP:b.preventDefault(),c.prev();break;case g.DOWN:b.preventDefault(),c.next();break;case g.P:if(!b.ctrlKey)return;b.preventDefault(),c.prev();break;case g.N:if(!b.ctrlKey)return;b.preventDefault(),c.next();break;case g.TAB:case g.ENTER:if(!c.visible())return;b.preventDefault(),c.choose(b);break;default:a.noop()}},b}(),e=function(){function c(c,d){this.app=c,this.at=d,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,b.append(this.$el=a("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new h(this),this.view=new i(this)}return c.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},c.prototype.init=function(b){return this.setting=a.extend({},this.setting||a.fn.atwho["default"],b),this.view.init(),this.model.reload(this.setting.data)},c.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},c.prototype.call_default=function(){var b,c,d;d=arguments[0],b=2<=arguments.length?j.call(arguments,1):[];try{return f[d].apply(this,b)}catch(e){return c=e,a.error(""+c+" Or maybe At.js doesn't have function "+d)}},c.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.get_opt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},c.prototype.callbacks=function(a){return this.get_opt("callbacks")[a]||f[a]},c.prototype.get_opt=function(a){var b;try{return this.setting[a]}catch(c){return b=c,null}},c.prototype.content=function(){return this.$inputor.is("textarea, input")?this.$inputor.val():this.$inputor.text()},c.prototype.catch_query=function(){var a,b,c,d,e,f;return b=this.content(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.get_opt("start_with_space")),"string"==typeof d&&d.length<=this.get_opt("max_len",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,head_pos:e,end_pos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},c.prototype.rect=function(){var a,b;if(a=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return"true"===this.$inputor.attr("contentEditable")&&(a=this.cur_rect||(this.cur_rect=a)||a),b=this.app.document.selection?0:2,{left:a.left,top:a.top,bottom:a.top+a.height+b}},c.prototype.reset_rect=function(){return"true"===this.$inputor.attr("contentEditable")?this.cur_rect=null:void 0},c.prototype.mark_range=function(){return"true"===this.$inputor.attr("contentEditable")&&(this.app.window.getSelection&&(this.range=this.app.window.getSelection().getRangeAt(0)),this.app.document.selection)?this.ie8_range=this.app.document.selection.createRange():void 0},c.prototype.insert_content_for=function(b){var c,d,e;return d=b.data("value"),e=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!e?d:(c=a.extend({},b.data("item-data"),{"atwho-data-value":d,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,e,c))},c.prototype.insert=function(b){var c,d,e,f,g,h,i,j,k;return c=this.$inputor,k=this.callbacks("inserting_wrapper").call(this,c,b,this.get_opt("suffix")),c.is("textarea, input")?(h=c.val(),i=h.slice(0,Math.max(this.query.head_pos-this.at.length,0)),j=""+i+k+h.slice(this.query.end_pos||0),c.val(j),c.caret("pos",i.length+k.length,{iframe:this.app.iframe})):(f=this.range)?(e=f.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,f.setStart(f.endContainer,Math.max(e,0)),f.setEnd(f.endContainer,f.endOffset),f.deleteContents(),d=a(k,this.app.document)[0],f.insertNode(d),f.setEndAfter(d),f.collapse(!1),g=this.app.window.getSelection(),g.removeAllRanges(),g.addRange(f)):(f=this.ie8_range)&&(f.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),f.pasteHTML(k),f.collapse(!1),f.select()),c.is(":focus")||c.focus(),c.change()},c.prototype.render_view=function(a){var b;return b=this.get_opt("search_key"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.get_opt("limit")))},c.prototype.look_up=function(){var b,c;if(b=this.catch_query())return c=function(a){return a&&a.length>0?this.render_view(a):this.view.hide()},this.model.query(b.text,a.proxy(c,this)),b},c}(),h=function(){function b(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return b.prototype.destroy=function(){return this.storage.data(this.at,null)},b.prototype.saved=function(){return this.fetch()>0},b.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.get_opt("search_key"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remote_filter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},b.prototype.fetch=function(){return this.storage.data(this.at)||[]},b.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,a||[]))},b.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},b.prototype.reload=function(a){return this._load(a)},b.prototype._load=function(b){return"string"==typeof b?a.ajax(b,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(b)},b}(),i=function(){function b(b){this.context=b,this.$el=a("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return b.prototype.init=function(){var a;return a=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},b.prototype.destroy=function(){return this.$el.remove()},b.prototype.bind_event=function(){var b;return b=this.$el.find("ul"),b.on("mouseenter.atwho-view","li",function(c){return b.find(".cur").removeClass("cur"),a(c.currentTarget).addClass("cur")}).on("click",function(a){return function(b){return a.choose(b),b.preventDefault()}}(this))},b.prototype.visible=function(){return this.$el.is(":visible")},b.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insert_content_for(b),this.context.insert(this.context.callbacks("before_insert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.get_opt("hide_without_suffix")?this.stop_showing=!0:void 0},b.prototype.reposition=function(b){var c,d;return b.bottom+this.$el.height()-a(window).scrollTop()>a(window).height()&&(b.bottom=b.top-this.$el.height()),c={left:b.left,top:b.bottom},null!=(d=this.context.callbacks("before_reposition"))&&d.call(this.context,c),this.$el.offset(c),this.context.trigger("reposition",[c])},b.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur")},b.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur")},b.prototype.show=function(){var a;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},b.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(c,b))},b.prototype.render=function(b){var c,d,e,f,g,h,i;if(!(a.isArray(b)&&b.length>0))return void this.hide();for(this.$el.find("ul").empty(),d=this.$el.find("ul"),g=this.context.get_opt("tpl"),h=0,i=b.length;i>h;h++)e=b[h],e=a.extend({},e,{"atwho-at":this.context.at}),f=this.context.callbacks("tpl_eval").call(this.context,g,e),c=a(this.context.callbacks("highlighter").call(this.context,f,this.context.query.text)),c.data("item-data",e),d.append(c);return this.show(),this.context.get_opt("highlight_first")?d.find("li:first").addClass("cur"):void 0},b}(),g={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78},f={before_save:function(b){var c,d,e,f;if(!a.isArray(b))return b;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(a.isPlainObject(c)?c:{name:c});return f},matcher:function(a,b,c){var d,e;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c&&(a="(?:^|\\s)"+a),e=new RegExp(a+"([A-Za-z0-9_+-]*)$|"+a+"([^\\x00-\\xff]*)$","gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~d[c].toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remote_filter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=d[c].toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tpl_eval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+"<strong>"+c+"</strong>"+d+" <"})):a},before_insert:function(a){return a},inserting_wrapper:function(a,b,c){var d,e;return d=""===c?c:c||" ",a.is("textarea, input")?""+b+d:"true"===a.attr("contentEditable")?(d=""===c?c:c||"&nbsp;",/firefox/i.test(navigator.userAgent)?e="<span>"+b+d+"</span>":(c="<span contenteditable='false'>"+d+"<span>",e="<span contenteditable='false'>"+b+c+"</span>"),this.app.document.selection&&(e="<span contenteditable='true'>"+b+"</span>"),e):void 0}},c={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},setIframe:function(a){return this.setIframe(a),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},b=a("<div id='atwho-container'></div>"),a.fn.atwho=function(e){var f,g;return g=arguments,a("body").append(b),f=null,this.filter("textarea, input, [contenteditable=true]").each(function(){var b,h;return(h=(b=a(this)).data("atwho"))||b.data("atwho",h=new d(this)),"object"!=typeof e&&e?c[e]&&h?f=c[e].apply(h,Array.prototype.slice.call(g,1)):a.error("Method "+e+" does not exist on jQuery.caret"):h.reg(e.at,e)}),f||this},a.fn.atwho["default"]={at:void 0,alias:void 0,data:null,tpl:"<li data-value='${atwho-at}${name}'>${name}</li>",insert_tpl:"<span id='${id}'>${atwho-data-value}</span>",callbacks:f,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}})}).call(this);
bp-core/js/jquery.atwho.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2013 chord.luo@gmail.com
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
bp-core/js/jquery.caret.js ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Implement Github like autocomplete mentions
3
+ http://ichord.github.com/At.js
4
+
5
+ Copyright (c) 2013 chord.luo@gmail.com
6
+ Licensed under the MIT license.
7
+ */
8
+
9
+
10
+ /*
11
+ 本插件操作 textarea 或者 input 内的插入符
12
+ 只实现了获得插入符在文本框中的位置,我设置
13
+ 插入符的位置.
14
+ */
15
+
16
+
17
+ (function() {
18
+ (function(factory) {
19
+ if (typeof define === 'function' && define.amd) {
20
+ return define(['jquery'], factory);
21
+ } else {
22
+ return factory(window.jQuery);
23
+ }
24
+ })(function($) {
25
+ "use strict";
26
+ var EditableCaret, InputCaret, Mirror, Utils, discoveryIframeOf, methods, oDocument, oFrame, oWindow, pluginName, setContextBy;
27
+ pluginName = 'caret';
28
+ EditableCaret = (function() {
29
+ function EditableCaret($inputor) {
30
+ this.$inputor = $inputor;
31
+ this.domInputor = this.$inputor[0];
32
+ }
33
+
34
+ EditableCaret.prototype.setPos = function(pos) {
35
+ return this.domInputor;
36
+ };
37
+
38
+ EditableCaret.prototype.getIEPosition = function() {
39
+ return $.noop();
40
+ };
41
+
42
+ EditableCaret.prototype.getPosition = function() {
43
+ return $.noop();
44
+ };
45
+
46
+ EditableCaret.prototype.getOldIEPos = function() {
47
+ var preCaretTextRange, textRange;
48
+ textRange = oDocument.selection.createRange();
49
+ preCaretTextRange = oDocument.body.createTextRange();
50
+ preCaretTextRange.moveToElementText(this.domInputor);
51
+ preCaretTextRange.setEndPoint("EndToEnd", textRange);
52
+ return preCaretTextRange.text.length;
53
+ };
54
+
55
+ EditableCaret.prototype.getPos = function() {
56
+ var clonedRange, pos, range;
57
+ if (range = this.range()) {
58
+ clonedRange = range.cloneRange();
59
+ clonedRange.selectNodeContents(this.domInputor);
60
+ clonedRange.setEnd(range.endContainer, range.endOffset);
61
+ pos = clonedRange.toString().length;
62
+ clonedRange.detach();
63
+ return pos;
64
+ } else if (oDocument.selection) {
65
+ return this.getOldIEPos();
66
+ }
67
+ };
68
+
69
+ EditableCaret.prototype.getOldIEOffset = function() {
70
+ var range, rect;
71
+ range = oDocument.selection.createRange().duplicate();
72
+ range.moveStart("character", -1);
73
+ rect = range.getBoundingClientRect();
74
+ return {
75
+ height: rect.bottom - rect.top,
76
+ left: rect.left,
77
+ top: rect.top
78
+ };
79
+ };
80
+
81
+ EditableCaret.prototype.getOffset = function(pos) {
82
+ var clonedRange, offset, range, rect;
83
+ if (oWindow.getSelection && (range = this.range())) {
84
+ if (range.endOffset - 1 < 0) {
85
+ return null;
86
+ }
87
+ clonedRange = range.cloneRange();
88
+ clonedRange.setStart(range.endContainer, range.endOffset - 1);
89
+ clonedRange.setEnd(range.endContainer, range.endOffset);
90
+ rect = clonedRange.getBoundingClientRect();
91
+ offset = {
92
+ height: rect.height,
93
+ left: rect.left + rect.width,
94
+ top: rect.top
95
+ };
96
+ clonedRange.detach();
97
+ } else if (oDocument.selection) {
98
+ offset = this.getOldIEOffset();
99
+ }
100
+ if (offset && !oFrame) {
101
+ offset.top += $(oWindow).scrollTop();
102
+ offset.left += $(oWindow).scrollLeft();
103
+ }
104
+ return offset;
105
+ };
106
+
107
+ EditableCaret.prototype.range = function() {
108
+ var sel;
109
+ if (!oWindow.getSelection) {
110
+ return;
111
+ }
112
+ sel = oWindow.getSelection();
113
+ if (sel.rangeCount > 0) {
114
+ return sel.getRangeAt(0);
115
+ } else {
116
+ return null;
117
+ }
118
+ };
119
+
120
+ return EditableCaret;
121
+
122
+ })();
123
+ InputCaret = (function() {
124
+ function InputCaret($inputor) {
125
+ this.$inputor = $inputor;
126
+ this.domInputor = this.$inputor[0];
127
+ }
128
+
129
+ InputCaret.prototype.getIEPos = function() {
130
+ var endRange, inputor, len, normalizedValue, pos, range, textInputRange;
131
+ inputor = this.domInputor;
132
+ range = oDocument.selection.createRange();
133
+ pos = 0;
134
+ if (range && range.parentElement() === inputor) {
135
+ normalizedValue = inputor.value.replace(/\r\n/g, "\n");
136
+ len = normalizedValue.length;
137
+ textInputRange = inputor.createTextRange();
138
+ textInputRange.moveToBookmark(range.getBookmark());
139
+ endRange = inputor.createTextRange();
140
+ endRange.collapse(false);
141
+ if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
142
+ pos = len;
143
+ } else {
144
+ pos = -textInputRange.moveStart("character", -len);
145
+ }
146
+ }
147
+ return pos;
148
+ };
149
+
150
+ InputCaret.prototype.getPos = function() {
151
+ if (oDocument.selection) {
152
+ return this.getIEPos();
153
+ } else {
154
+ return this.domInputor.selectionStart;
155
+ }
156
+ };
157
+
158
+ InputCaret.prototype.setPos = function(pos) {
159
+ var inputor, range;
160
+ inputor = this.domInputor;
161
+ if (oDocument.selection) {
162
+ range = inputor.createTextRange();
163
+ range.move("character", pos);
164
+ range.select();
165
+ } else if (inputor.setSelectionRange) {
166
+ inputor.setSelectionRange(pos, pos);
167
+ }
168
+ return inputor;
169
+ };
170
+
171
+ InputCaret.prototype.getIEOffset = function(pos) {
172
+ var h, textRange, x, y;
173
+ textRange = this.domInputor.createTextRange();
174
+ pos || (pos = this.getPos());
175
+ textRange.move('character', pos);
176
+ x = textRange.boundingLeft;
177
+ y = textRange.boundingTop;
178
+ h = textRange.boundingHeight;
179
+ return {
180
+ left: x,
181
+ top: y,
182
+ height: h
183
+ };
184
+ };
185
+
186
+ InputCaret.prototype.getOffset = function(pos) {
187
+ var $inputor, offset, position;
188
+ $inputor = this.$inputor;
189
+ if (oDocument.selection) {
190
+ offset = this.getIEOffset(pos);
191
+ offset.top += $(oWindow).scrollTop() + $inputor.scrollTop();
192
+ offset.left += $(oWindow).scrollLeft() + $inputor.scrollLeft();
193
+ return offset;
194
+ } else {
195
+ offset = $inputor.offset();
196
+ position = this.getPosition(pos);
197
+ return offset = {
198
+ left: offset.left + position.left - $inputor.scrollLeft(),
199
+ top: offset.top + position.top - $inputor.scrollTop(),
200
+ height: position.height
201
+ };
202
+ }
203
+ };
204
+
205
+ InputCaret.prototype.getPosition = function(pos) {
206
+ var $inputor, at_rect, end_range, format, html, mirror, start_range;
207
+ $inputor = this.$inputor;
208
+ format = function(value) {
209
+ return value.replace(/</g, '&lt').replace(/>/g, '&gt').replace(/`/g, '&#96').replace(/"/g, '&quot').replace(/\r\n|\r|\n/g, "<br />");
210
+ };
211
+ if (pos === void 0) {
212
+ pos = this.getPos();
213
+ }
214
+ start_range = $inputor.val().slice(0, pos);
215
+ end_range = $inputor.val().slice(pos);
216
+ html = "<span style='position: relative; display: inline;'>" + format(start_range) + "</span>";
217
+ html += "<span id='caret' style='position: relative; display: inline;'>|</span>";
218
+ html += "<span style='position: relative; display: inline;'>" + format(end_range) + "</span>";
219
+ mirror = new Mirror($inputor);
220
+ return at_rect = mirror.create(html).rect();
221
+ };
222
+
223
+ InputCaret.prototype.getIEPosition = function(pos) {
224
+ var h, inputorOffset, offset, x, y;
225
+ offset = this.getIEOffset(pos);
226
+ inputorOffset = this.$inputor.offset();
227
+ x = offset.left - inputorOffset.left;
228
+ y = offset.top - inputorOffset.top;
229
+ h = offset.height;
230
+ return {
231
+ left: x,
232
+ top: y,
233
+ height: h
234
+ };
235
+ };
236
+
237
+ return InputCaret;
238
+
239
+ })();
240
+ Mirror = (function() {
241
+ Mirror.prototype.css_attr = ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle", "borderTopWidth", "boxSizing", "fontFamily", "fontSize", "fontWeight", "height", "letterSpacing", "lineHeight", "marginBottom", "marginLeft", "marginRight", "marginTop", "outlineWidth", "overflow", "overflowX", "overflowY", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop", "textAlign", "textOverflow", "textTransform", "whiteSpace", "wordBreak", "wordWrap"];
242
+
243
+ function Mirror($inputor) {
244
+ this.$inputor = $inputor;
245
+ }
246
+
247
+ Mirror.prototype.mirrorCss = function() {
248
+ var css,
249
+ _this = this;
250
+ css = {
251
+ position: 'absolute',
252
+ left: -9999,
253
+ top: 0,
254
+ zIndex: -20000
255
+ };
256
+ if (this.$inputor.prop('tagName') === 'TEXTAREA') {
257
+ this.css_attr.push('width');
258
+ }
259
+ $.each(this.css_attr, function(i, p) {
260
+ return css[p] = _this.$inputor.css(p);
261
+ });
262
+ return css;
263
+ };
264
+
265
+ Mirror.prototype.create = function(html) {
266
+ this.$mirror = $('<div></div>');
267
+ this.$mirror.css(this.mirrorCss());
268
+ this.$mirror.html(html);
269
+ this.$inputor.after(this.$mirror);
270
+ return this;
271
+ };
272
+
273
+ Mirror.prototype.rect = function() {
274
+ var $flag, pos, rect;
275
+ $flag = this.$mirror.find("#caret");
276
+ pos = $flag.position();
277
+ rect = {
278
+ left: pos.left,
279
+ top: pos.top,
280
+ height: $flag.height()
281
+ };
282
+ this.$mirror.remove();
283
+ return rect;
284
+ };
285
+
286
+ return Mirror;
287
+
288
+ })();
289
+ Utils = {
290
+ contentEditable: function($inputor) {
291
+ return !!($inputor[0].contentEditable && $inputor[0].contentEditable === 'true');
292
+ }
293
+ };
294
+ methods = {
295
+ pos: function(pos) {
296
+ if (pos || pos === 0) {
297
+ return this.setPos(pos);
298
+ } else {
299
+ return this.getPos();
300
+ }
301
+ },
302
+ position: function(pos) {
303
+ if (oDocument.selection) {
304
+ return this.getIEPosition(pos);
305
+ } else {
306
+ return this.getPosition(pos);
307
+ }
308
+ },
309
+ offset: function(pos) {
310
+ var iOffset, offset;
311
+ offset = this.getOffset(pos);
312
+ if (oFrame) {
313
+ iOffset = $(oFrame).offset();
314
+ offset.top += iOffset.top;
315
+ offset.left += iOffset.left;
316
+ }
317
+ return offset;
318
+ }
319
+ };
320
+ oDocument = null;
321
+ oWindow = null;
322
+ oFrame = null;
323
+ setContextBy = function(settings) {
324
+ var iframe;
325
+ if (iframe = settings != null ? settings.iframe : void 0) {
326
+ oFrame = iframe;
327
+ oWindow = iframe.contentWindow;
328
+ return oDocument = iframe.contentDocument || oWindow.document;
329
+ } else {
330
+ oFrame = void 0;
331
+ oWindow = window;
332
+ return oDocument = document;
333
+ }
334
+ };
335
+ discoveryIframeOf = function($dom) {
336
+ var error;
337
+ oDocument = $dom[0].ownerDocument;
338
+ oWindow = oDocument.defaultView || oDocument.parentWindow;
339
+ try {
340
+ return oFrame = oWindow.frameElement;
341
+ } catch (_error) {
342
+ error = _error;
343
+ }
344
+ };
345
+ $.fn.caret = function(method, value, settings) {
346
+ var caret;
347
+ if (methods[method]) {
348
+ if ($.isPlainObject(value)) {
349
+ setContextBy(value);
350
+ value = void 0;
351
+ } else {
352
+ setContextBy(settings);
353
+ }
354
+ caret = Utils.contentEditable(this) ? new EditableCaret(this) : new InputCaret(this);
355
+ return methods[method].apply(caret, [value]);
356
+ } else {
357
+ return $.error("Method " + method + " does not exist on jQuery.caret");
358
+ }
359
+ };
360
+ $.fn.caret.EditableCaret = EditableCaret;
361
+ $.fn.caret.InputCaret = InputCaret;
362
+ $.fn.caret.Utils = Utils;
363
+ return $.fn.caret.apis = methods;
364
+ });
365
+
366
+ }).call(this);
bp-core/js/jquery.caret.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ (function(){!function(a){return"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;return k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(){return this.domInputor},b.prototype.getIEPosition=function(){return a.noop()},b.prototype.getPosition=function(){return a.noop()},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(){var b,c,d,e;if(j.getSelection&&(d=this.range())){if(d.endOffset-1<0)return null;b=d.cloneRange(),b.setStart(d.endContainer,d.endOffset-1),b.setEnd(d.endContainer,d.endOffset),e=b.getBoundingClientRect(),c={height:e.height,left:e.left+e.width,top:e.top},b.detach()}else h.selection&&(c=this.getOldIEOffset());return c&&!i&&(c.top+=a(j).scrollTop(),c.left+=a(j).scrollLeft()),c},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h,i;return b=this.$inputor,f=function(a){return a.replace(/</g,"&lt").replace(/>/g,"&gt").replace(/`/g,"&#96").replace(/"/g,"&quot").replace(/\r\n|\r|\n/g,"<br />")},void 0===a&&(a=this.getPos()),i=b.val().slice(0,a),e=b.val().slice(a),g="<span style='position: relative; display: inline;'>"+f(i)+"</span>",g+="<span id='caret' style='position: relative; display: inline;'>|</span>",g+="<span style='position: relative; display: inline;'>"+f(e)+"</span>",h=new d(b),c=h.create(g).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(b){var c,d;return d=this.getOffset(b),i&&(c=a(i).offset(),d.top+=c.top,d.left+=c.left),d}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g})}).call(this);
bp-core/js/jquery.caret.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2013 chord.luo@gmail.com
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
bp-core/js/widget-members.js CHANGED
@@ -1,17 +1,17 @@
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)
@@ -29,20 +29,20 @@ 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
  }
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)
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
  }
bp-core/js/widget-members.min.js CHANGED
@@ -1 +1,2 @@
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)})}};
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ function member_wiget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]),jQuery(".widget ul#members-list").fadeIn(200)}):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)})}jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;return 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)}),!1})});
bp-forums/bp-forums-screens.php CHANGED
@@ -216,7 +216,7 @@ class BP_Forum_Legacy_Theme_Compat {
216
  'post_author' => 0,
217
  'post_date' => 0,
218
  'post_content' => '',
219
- 'post_type' => 'bp_forum',
220
  'post_status' => 'publish',
221
  'is_page' => true,
222
  'comment_status' => 'closed'
216
  'post_author' => 0,
217
  'post_date' => 0,
218
  'post_content' => '',
219
+ 'post_type' => 'page',
220
  'post_status' => 'publish',
221
  'is_page' => true,
222
  'comment_status' => 'closed'
bp-forums/bp-forums-template.php CHANGED
@@ -1524,7 +1524,7 @@ function bp_forum_pagination_count() {
1524
  if ( 'tags' == $forum_template->type && !empty( $forum_template->search_terms ) )
1525
  $pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
1526
 
1527
- return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing topic %s to %s (of %d topic%s)', 'Viewing topic %s to %s (of %d total topics%s)', $total, 'buddypress' ), $from_num, $to_num, $total, $pag_filter ), $from_num, $to_num, $total );
1528
  }
1529
 
1530
  /**
@@ -2163,7 +2163,7 @@ function bp_the_topic_pagination_count() {
2163
  $to_num = bp_core_number_format( ( $start_num + ( $topic_template->pag_num - 1 ) > $topic_template->total_post_count ) ? $topic_template->total_post_count : $start_num + ( $topic_template->pag_num - 1 ) );
2164
  $total = bp_core_number_format( $topic_template->total_post_count );
2165
 
2166
- echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing post %1$s to %2$s (%3$s post)', 'Viewing post %1$s to %2$s (%3$s total posts)', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
2167
  }
2168
 
2169
  /**
1524
  if ( 'tags' == $forum_template->type && !empty( $forum_template->search_terms ) )
1525
  $pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
1526
 
1527
+ return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing 1 topic', 'Viewing %1$s - %2$s of %3$s topics', (int) $forum_template->total_topic_count, 'buddypress' ), $from_num, $to_num, $total, $pag_filter ), $from_num, $to_num, $total );
1528
  }
1529
 
1530
  /**
2163
  $to_num = bp_core_number_format( ( $start_num + ( $topic_template->pag_num - 1 ) > $topic_template->total_post_count ) ? $topic_template->total_post_count : $start_num + ( $topic_template->pag_num - 1 ) );
2164
  $total = bp_core_number_format( $topic_template->total_post_count );
2165
 
2166
+ echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing 1 post', 'Viewing %1$s - %2$s of %3$s posts', (int) $topic_template->total_post_count, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
2167
  }
2168
 
2169
  /**
bp-friends/bp-friends-activity.php CHANGED
@@ -96,14 +96,18 @@ function friends_register_activity_actions() {
96
  $bp->friends->id,
97
  'friendship_accepted',
98
  __( 'Friendships accepted', 'buddypress' ),
99
- 'bp_friends_format_activity_action_friendship_accepted'
 
 
100
  );
101
 
102
  bp_activity_set_action(
103
  $bp->friends->id,
104
  'friendship_created',
105
  __( 'New friendships', 'buddypress' ),
106
- 'bp_friends_format_activity_action_friendship_created'
 
 
107
  );
108
 
109
  // < BP 1.6 backpat
96
  $bp->friends->id,
97
  'friendship_accepted',
98
  __( 'Friendships accepted', 'buddypress' ),
99
+ 'bp_friends_format_activity_action_friendship_accepted',
100
+ __( 'Friendships', 'buddypress' ),
101
+ array( 'activity', 'member' )
102
  );
103
 
104
  bp_activity_set_action(
105
  $bp->friends->id,
106
  'friendship_created',
107
  __( 'New friendships', 'buddypress' ),
108
+ 'bp_friends_format_activity_action_friendship_created',
109
+ __( 'Friendships', 'buddypress' ),
110
+ array( 'activity', 'member' )
111
  );
112
 
113
  // < BP 1.6 backpat
bp-friends/bp-friends-classes.php CHANGED
@@ -290,7 +290,9 @@ class BP_Friends_Friendship {
290
  if ( empty( $user_id ) )
291
  $user_id = bp_loggedin_user_id();
292
 
293
- $filter = esc_sql( like_escape( $filter ) );
 
 
294
 
295
  $pag_sql = '';
296
  if ( !empty( $limit ) && !empty( $page ) )
@@ -307,11 +309,11 @@ class BP_Friends_Friendship {
307
 
308
  // filter the user_ids based on the search criteria.
309
  if ( bp_is_active( 'xprofile' ) ) {
310
- $sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}";
311
- $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%'";
312
  } else {
313
- $sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}";
314
- $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%'";
315
  }
316
 
317
  $filtered_friend_ids = $wpdb->get_col( $sql );
@@ -443,7 +445,9 @@ class BP_Friends_Friendship {
443
  public static function search_users( $filter, $user_id, $limit = null, $page = null ) {
444
  global $wpdb, $bp;
445
 
446
- $filter = esc_sql( like_escape( $filter ) );
 
 
447
 
448
  $usermeta_table = $wpdb->base_prefix . 'usermeta';
449
  $users_table = $wpdb->base_prefix . 'users';
@@ -454,9 +458,9 @@ class BP_Friends_Friendship {
454
 
455
  // filter the user_ids based on the search criteria.
456
  if ( bp_is_active( 'xprofile' ) ) {
457
- $sql = "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE '{$filter}%%' ORDER BY d.value DESC {$pag_sql}";
458
  } else {
459
- $sql = "SELECT DISTINCT user_id as id FROM {$usermeta_table} WHERE meta_value LIKE '{$filter}%%' ORDER BY d.value DESC {$pag_sql}";
460
  }
461
 
462
  $filtered_fids = $wpdb->get_col($sql);
@@ -478,16 +482,18 @@ class BP_Friends_Friendship {
478
  public static function search_users_count( $filter ) {
479
  global $wpdb, $bp;
480
 
481
- $filter = esc_sql( like_escape( $filter ) );
 
 
482
 
483
  $usermeta_table = $wpdb->prefix . 'usermeta';
484
  $users_table = $wpdb->base_prefix . 'users';
485
 
486
  // filter the user_ids based on the search criteria.
487
  if ( bp_is_active( 'xprofile' ) ) {
488
- $sql = "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE '{$filter}%%'";
489
  } else {
490
- $sql = "SELECT COUNT(DISTINCT user_id) FROM {$usermeta_table} WHERE meta_value LIKE '{$filter}%%'";
491
  }
492
 
493
  $user_count = $wpdb->get_col($sql);
290
  if ( empty( $user_id ) )
291
  $user_id = bp_loggedin_user_id();
292
 
293
+ // Only search for matching strings at the beginning of the
294
+ // name (@todo - figure out why this restriction)
295
+ $search_terms_like = bp_esc_like( $filter ) . '%';
296
 
297
  $pag_sql = '';
298
  if ( !empty( $limit ) && !empty( $page ) )
309
 
310
  // filter the user_ids based on the search criteria.
311
  if ( bp_is_active( 'xprofile' ) ) {
312
+ $sql = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s {$pag_sql}", $search_terms_like );
313
+ $total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s", $search_terms_like );
314
  } else {
315
+ $sql = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s' {$pag_sql}", $search_terms_like );
316
+ $total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s", $search_terms_like );
317
  }
318
 
319
  $filtered_friend_ids = $wpdb->get_col( $sql );
445
  public static function search_users( $filter, $user_id, $limit = null, $page = null ) {
446
  global $wpdb, $bp;
447
 
448
+ // Only search for matching strings at the beginning of the
449
+ // name (@todo - figure out why this restriction)
450
+ $search_terms_like = bp_esc_like( $filter ) . '%';
451
 
452
  $usermeta_table = $wpdb->base_prefix . 'usermeta';
453
  $users_table = $wpdb->base_prefix . 'users';
458
 
459
  // filter the user_ids based on the search criteria.
460
  if ( bp_is_active( 'xprofile' ) ) {
461
+ $sql = $wpdb->prepare( "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE %s ORDER BY d.value DESC {$pag_sql}", $search_terms_like );
462
  } else {
463
+ $sql = $wpdb->prepare( "SELECT DISTINCT user_id as id FROM {$usermeta_table} WHERE meta_value LIKE %s ORDER BY d.value DESC {$pag_sql}", $search_terms_like );
464
  }
465
 
466
  $filtered_fids = $wpdb->get_col($sql);
482
  public static function search_users_count( $filter ) {
483
  global $wpdb, $bp;
484
 
485
+ // Only search for matching strings at the beginning of the
486
+ // name (@todo - figure out why this restriction)
487
+ $search_terms_like = bp_esc_like( $filter ) . '%';
488
 
489
  $usermeta_table = $wpdb->prefix . 'usermeta';
490
  $users_table = $wpdb->base_prefix . 'users';
491
 
492
  // filter the user_ids based on the search criteria.
493
  if ( bp_is_active( 'xprofile' ) ) {
494
+ $sql = $wpdb->prepare( "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE %s", $search_terms_like );
495
  } else {
496
+ $sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$usermeta_table} WHERE meta_value LIKE %s", $search_terms_like );
497
  }
498
 
499
  $user_count = $wpdb->get_col($sql);
bp-friends/bp-friends-filters.php CHANGED
@@ -38,7 +38,14 @@ function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query
38
  $friend_id = bp_loggedin_user_id() == $fs->initiator_user_id ? $fs->friend_user_id : $fs->initiator_user_id;
39
 
40
  if ( isset( $user_query->results[ $friend_id ] ) ) {
41
- $user_query->results[ $friend_id ]->is_friend = $fs->is_confirmed;
 
 
 
 
 
 
 
42
  }
43
  }
44
  }
38
  $friend_id = bp_loggedin_user_id() == $fs->initiator_user_id ? $fs->friend_user_id : $fs->initiator_user_id;
39
 
40
  if ( isset( $user_query->results[ $friend_id ] ) ) {
41
+ if ( 0 == $fs->is_confirmed ) {
42
+ $status = $fs->initiator_user_id == bp_loggedin_user_id() ? 'pending' : 'awaiting_response';
43
+ } else {
44
+ $status = 'is_friend';
45
+ }
46
+
47
+ $user_query->results[ $friend_id ]->is_friend = $fs->is_confirmed;
48
+ $user_query->results[ $friend_id ]->friendship_status = $status;
49
  }
50
  }
51
  }
bp-friends/bp-friends-functions.php CHANGED
@@ -195,13 +195,28 @@ function friends_check_friendship( $user_id, $possible_friend_id ) {
195
  /**
196
  * Get the friendship status of two friends.
197
  *
198
- * Will return 'is_friends', 'not_friends', or 'pending'.
199
  *
200
  * @param int $user_id ID of the first user.
201
  * @param int $possible_friend_id ID of the other user.
202
  * @return string Friend status of the two users.
203
  */
204
  function friends_check_friendship_status( $user_id, $possible_friend_id ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  return BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id );
206
  }
207
 
@@ -551,3 +566,41 @@ function friends_remove_data( $user_id ) {
551
  add_action( 'wpmu_delete_user', 'friends_remove_data' );
552
  add_action( 'delete_user', 'friends_remove_data' );
553
  add_action( 'bp_make_spam_user', 'friends_remove_data' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  /**
196
  * Get the friendship status of two friends.
197
  *
198
+ * Will return 'is_friends', 'not_friends', 'pending' or 'awaiting_response'.
199
  *
200
  * @param int $user_id ID of the first user.
201
  * @param int $possible_friend_id ID of the other user.
202
  * @return string Friend status of the two users.
203
  */
204
  function friends_check_friendship_status( $user_id, $possible_friend_id ) {
205
+ global $members_template;
206
+
207
+ // check the BP_User_Query first
208
+ // @see bp_friends_filter_user_query_populate_extras()
209
+ if ( ! empty( $members_template->in_the_loop ) ) {
210
+ if ( isset( $members_template->member->friendship_status ) ) {
211
+ return $members_template->member->friendship_status;
212
+
213
+ // make sure that the friends BP_User_Query was registered before assuming
214
+ // status as 'not_friends'
215
+ } elseif ( has_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras' ) ) {
216
+ return 'not_friends';
217
+ }
218
+ }
219
+
220
  return BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id );
221
  }
222
 
566
  add_action( 'wpmu_delete_user', 'friends_remove_data' );
567
  add_action( 'delete_user', 'friends_remove_data' );
568
  add_action( 'bp_make_spam_user', 'friends_remove_data' );
569
+
570
+ /**
571
+ * Used by the Activity component's @mentions to print a JSON list of the current user's friends.
572
+ *
573
+ * This is intended to speed up @mentions lookups for a majority of use cases.
574
+ *
575
+ * @see bp_activity_mentions_script()
576
+ */
577
+ function bp_friends_prime_mentions_results() {
578
+ if ( ! bp_activity_maybe_load_mentions_scripts() ) {
579
+ return;
580
+ }
581
+
582
+ $friends_query = array(
583
+ 'count_total' => '', // Prevents total count
584
+ 'populate_extras' => false,
585
+
586
+ 'type' => 'alphabetical',
587
+ 'user_id' => get_current_user_id(),
588
+ );
589
+
590
+ $friends_query = new BP_User_Query( $friends_query );
591
+ $results = array();
592
+
593
+ foreach ( $friends_query->results as $user ) {
594
+ $result = new stdClass();
595
+ $result->ID = $user->user_nicename;
596
+ $result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
597
+ $result->name = bp_core_get_user_displayname( $user->ID );
598
+
599
+ $results[] = $result;
600
+ }
601
+
602
+ wp_localize_script( 'bp-mentions', 'BP_Suggestions', array(
603
+ 'friends' => $results,
604
+ ) );
605
+ }
606
+ add_action( 'bp_activity_mentions_prime_results', 'bp_friends_prime_mentions_results' );
bp-friends/bp-friends-loader.php CHANGED
@@ -21,7 +21,7 @@ class BP_Friends_Component extends BP_Component {
21
  public function __construct() {
22
  parent::start(
23
  'friends',
24
- __( 'Friend Connections', 'buddypress' ),
25
  buddypress()->plugin_dir,
26
  array(
27
  'adminbar_myaccount_order' => 60
@@ -137,7 +137,7 @@ class BP_Friends_Component extends BP_Component {
137
 
138
  // Add the subnav items to the friends nav item
139
  $sub_nav[] = array(
140
- 'name' => __( 'Friendships', 'buddypress' ),
141
  'slug' => 'my-friends',
142
  'parent_url' => $friends_link,
143
  'parent_slug' => bp_get_friends_slug(),
@@ -147,7 +147,7 @@ class BP_Friends_Component extends BP_Component {
147
  );
148
 
149
  $sub_nav[] = array(
150
- 'name' => __( 'Requests', 'buddypress' ),
151
  'slug' => 'requests',
152
  'parent_url' => $friends_link,
153
  'parent_slug' => bp_get_friends_slug(),
@@ -182,11 +182,11 @@ class BP_Friends_Component extends BP_Component {
182
  // Pending friend requests
183
  $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) );
184
  if ( !empty( $count ) ) {
185
- $title = sprintf( __( 'Friends <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
186
- $pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
187
  } else {
188
- $title = __( 'Friends', 'buddypress' );
189
- $pending = __( 'No Pending Requests', 'buddypress' );
190
  }
191
 
192
  // Add the "My Account" sub menus
@@ -197,11 +197,11 @@ class BP_Friends_Component extends BP_Component {
197
  'href' => trailingslashit( $friends_link )
198
  );
199
 
200
- // My Groups
201
  $wp_admin_nav[] = array(
202
  'parent' => 'my-account-' . $this->id,
203
  'id' => 'my-account-' . $this->id . '-friendships',
204
- 'title' => __( 'Friendships', 'buddypress' ),
205
  'href' => trailingslashit( $friends_link )
206
  );
207
 
21
  public function __construct() {
22
  parent::start(
23
  'friends',
24
+ _x( 'Friend Connections', 'Friends screen page <title>', 'buddypress' ),
25
  buddypress()->plugin_dir,
26
  array(
27
  'adminbar_myaccount_order' => 60
137
 
138
  // Add the subnav items to the friends nav item
139
  $sub_nav[] = array(
140
+ 'name' => _x( 'Friendships', 'Friends screen sub nav', 'buddypress' ),
141
  'slug' => 'my-friends',
142
  'parent_url' => $friends_link,
143
  'parent_slug' => bp_get_friends_slug(),
147
  );
148
 
149
  $sub_nav[] = array(
150
+ 'name' => _x( 'Requests', 'Friends screen sub nav', 'buddypress' ),
151
  'slug' => 'requests',
152
  'parent_url' => $friends_link,
153
  'parent_slug' => bp_get_friends_slug(),
182
  // Pending friend requests
183
  $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) );
184
  if ( !empty( $count ) ) {
185
+ $title = sprintf( _x( 'Friends <span class="count">%s</span>', 'My Account Friends menu', 'buddypress' ), number_format_i18n( $count ) );
186
+ $pending = sprintf( _x( 'Pending Requests <span class="count">%s</span>', 'My Account Friends menu sub nav', 'buddypress' ), number_format_i18n( $count ) );
187
  } else {
188
+ $title = _x( 'Friends', 'My Account Friends menu', 'buddypress' );
189
+ $pending = _x( 'No Pending Requests','My Account Friends menu sub nav', 'buddypress' );
190
  }
191
 
192
  // Add the "My Account" sub menus
197
  'href' => trailingslashit( $friends_link )
198
  );
199
 
200
+ // My Friends
201
  $wp_admin_nav[] = array(
202
  'parent' => 'my-account-' . $this->id,
203
  'id' => 'my-account-' . $this->id . '-friendships',
204
+ 'title' => _x( 'Friendships', 'My Account Friends menu sub nav', 'buddypress' ),
205
  'href' => trailingslashit( $friends_link )
206
  );
207
 
bp-friends/bp-friends-screens.php CHANGED
@@ -82,7 +82,7 @@ function friends_screen_notification_settings() {
82
  <thead>
83
  <tr>
84
  <th class="icon"></th>
85
- <th class="title"><?php _e( 'Friends', 'buddypress' ) ?></th>
86
  <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
87
  <th class="no"><?php _e( 'No', 'buddypress' )?></th>
88
  </tr>
@@ -91,13 +91,13 @@ function friends_screen_notification_settings() {
91
  <tbody>
92
  <tr id="friends-notification-settings-request">
93
  <td></td>
94
- <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
95
  <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/></td>
96
  <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php checked( $send_requests, 'no', true ) ?>/></td>
97
  </tr>
98
  <tr id="friends-notification-settings-accepted">
99
  <td></td>
100
- <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
101
  <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/></td>
102
  <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php checked( $accept_requests, 'no', true ) ?>/></td>
103
  </tr>
82
  <thead>
83
  <tr>
84
  <th class="icon"></th>
85
+ <th class="title"><?php _ex( 'Friends', 'Friend settings on notification settings page', 'buddypress' ) ?></th>
86
  <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
87
  <th class="no"><?php _e( 'No', 'buddypress' )?></th>
88
  </tr>
91
  <tbody>
92
  <tr id="friends-notification-settings-request">
93
  <td></td>
94
+ <td><?php _ex( 'A member sends you a friendship request', 'Friend settings on notification settings page', 'buddypress' ) ?></td>
95
  <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/></td>
96
  <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php checked( $send_requests, 'no', true ) ?>/></td>
97
  </tr>
98
  <tr id="friends-notification-settings-accepted">
99
  <td></td>
100
+ <td><?php _ex( 'A member accepts your friendship request', 'Friend settings on notification settings page', 'buddypress' ) ?></td>
101
  <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/></td>
102
  <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php checked( $accept_requests, 'no', true ) ?>/></td>
103
  </tr>
bp-friends/bp-friends-template.php CHANGED
@@ -187,17 +187,12 @@ function bp_friend_search_form() {
187
  }
188
 
189
  /**
190
- * Output the Add Friend button in member directories.
 
 
191
  */
192
  function bp_member_add_friend_button() {
193
- global $members_template;
194
-
195
- if ( !isset( $members_template->member->is_friend ) || null === $members_template->member->is_friend )
196
- $friend_status = 'not_friends';
197
- else
198
- $friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
199
-
200
- echo bp_get_add_friend_button( $members_template->member->id, $friend_status );
201
  }
202
  add_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' );
203
 
187
  }
188
 
189
  /**
190
+ * Output the "Add Friend" button in the member loop.
191
+ *
192
+ * @since BuddyPress (1.2.6)
193
  */
194
  function bp_member_add_friend_button() {
195
+ bp_add_friend_button( bp_get_member_user_id() );
 
 
 
 
 
 
 
196
  }
197
  add_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' );
198
 
bp-friends/bp-friends-widgets.php CHANGED
@@ -20,6 +20,13 @@ function bp_friends_register_widgets() {
20
  return;
21
  }
22
 
 
 
 
 
 
 
 
23
  add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Friends_Widget");' ) );
24
  }
25
  add_action( 'bp_register_widgets', 'bp_friends_register_widgets' );
20
  return;
21
  }
22
 
23
+ // The Friends widget works only when looking an a displayed user,
24
+ // and the concept of "displayed user" doesn't exist on non-root blogs,
25
+ // so we don't register the widget there.
26
+ if ( ! bp_is_root_blog() ) {
27
+ return;
28
+ }
29
+
30
  add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Friends_Widget");' ) );
31
  }
32
  add_action( 'bp_register_widgets', 'bp_friends_register_widgets' );
bp-friends/js/widget-friends.js CHANGED
@@ -1,17 +1,17 @@
1
  jQuery(document).ready( function() {
2
- jQuery(".widget div#friends-list-options a").on('click',
3
  function() {
4
  var link = this;
5
  jQuery(link).addClass('loading');
6
 
7
- jQuery(".widget div#friends-list-options a").removeClass("selected");
8
  jQuery(this).addClass('selected');
9
 
10
  jQuery.post( ajaxurl, {
11
  action: 'widget_friends',
12
  'cookie': encodeURIComponent(document.cookie),
13
- '_wpnonce': jQuery("input#_wpnonce-friends").val(),
14
- 'max-friends': jQuery("input#friends_widget_max").val(),
15
  'filter': jQuery(this).attr('id')
16
  },
17
  function(response)
@@ -29,21 +29,21 @@ function friend_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#friends-list").fadeOut(200,
34
  function() {
35
- jQuery(".widget ul#friends-list").html(response[1]);
36
- jQuery(".widget ul#friends-list").fadeIn(200);
37
  }
38
  );
39
 
40
  } else {
41
- jQuery(".widget ul#friends-list").fadeOut(200,
42
  function() {
43
  var message = '<p>' + response[1] + '</p>';
44
- jQuery(".widget ul#friends-list").html(message);
45
- jQuery(".widget ul#friends-list").fadeIn(200);
46
  }
47
  );
48
  }
49
- }
1
  jQuery(document).ready( function() {
2
+ jQuery('.widget div#friends-list-options a').on('click',
3
  function() {
4
  var link = this;
5
  jQuery(link).addClass('loading');
6
 
7
+ jQuery('.widget div#friends-list-options a').removeClass('selected');
8
  jQuery(this).addClass('selected');
9
 
10
  jQuery.post( ajaxurl, {
11
  action: 'widget_friends',
12
  'cookie': encodeURIComponent(document.cookie),
13
+ '_wpnonce': jQuery('input#_wpnonce-friends').val(),
14
+ 'max-friends': jQuery('input#friends_widget_max').val(),
15
  'filter': jQuery(this).attr('id')
16
  },
17
  function(response)
29
  response = response.substr(0, response.length-1);
30
  response = response.split('[[SPLIT]]');
31
 
32
+ if ( response[0] !== '-1' ) {
33
+ jQuery('.widget ul#friends-list').fadeOut(200,
34
  function() {
35
+ jQuery('.widget ul#friends-list').html(response[1]);
36
+ jQuery('.widget ul#friends-list').fadeIn(200);
37
  }
38
  );
39
 
40
  } else {
41
+ jQuery('.widget ul#friends-list').fadeOut(200,
42
  function() {
43
  var message = '<p>' + response[1] + '</p>';
44
+ jQuery('.widget ul#friends-list').html(message);
45
+ jQuery('.widget ul#friends-list').fadeIn(200);
46
  }
47
  );
48
  }
49
+ }
bp-friends/js/widget-friends.min.js CHANGED
@@ -1 +1,2 @@
1
- jQuery(document).ready(function(){jQuery(".widget div#friends-list-options a").on("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#friends-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");friend_wiget_response(b)});return false})});function friend_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(a[1]);jQuery(".widget ul#friends-list").fadeIn(200)})}else{jQuery(".widget ul#friends-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#friends-list").html(b);jQuery(".widget ul#friends-list").fadeIn(200)})}};
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ function friend_wiget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(a[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#friends-list").html(b),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#friends-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#friends-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),friend_wiget_response(b)}),!1})});
bp-groups/admin/css/admin-rtl.css ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.toplevel_page_bp-groups table.groups th#status,
2
+ body.toplevel_page_bp-groups table.groups th#members {
3
+ width: 10%;
4
+ }
5
+
6
+ body.toplevel_page_bp-groups table.groups th#last_active {
7
+ width: 15%;
8
+ }
9
+
10
+ #bp-groups-form .avatar {
11
+ float: right;
12
+ margin-left: 10px;
13
+ margin-top: 1px;
14
+ }
15
+ #bp-groups-edit-form input {
16
+ outline: medium none;
17
+ }
18
+ #bp-groups-edit-form input#bp-groups-name {
19
+ font-size: 1.7em;
20
+ width: 100%;
21
+ margin-bottom: 6px;
22
+ }
23
+ #bp-groups-edit-form input#bp-groups-new-members {
24
+ width: 100%;
25
+ max-width: 90%;
26
+ border: 0;
27
+ }
28
+ #bp-groups-new-members-list {
29
+ margin: 0;
30
+ }
31
+ #bp_group_settings legend {
32
+ margin: 10px 0;
33
+ font-weight: bold;
34
+ }
35
+ #bp_group_settings ul {
36
+ margin: 0;
37
+ }
38
+ .bp-groups-settings-section {
39
+ margin-top: 10px;
40
+ }
41
+ #bp-groups-permalink-box {
42
+ line-height: 24px;
43
+ color: #666;
44
+ }
45
+ .bp-groups-member-type {
46
+ position: relative;
47
+ }
48
+ .bp-groups-member-type > h4 {
49
+ margin-bottom: .5em;
50
+ }
51
+ ul.bp-group-delete-list {
52
+ list-style-type: disc;
53
+ margin: 4px 26px;
54
+ }
55
+ .bp-group-admin-pagination {
56
+ position: absolute;
57
+ text-align: left;
58
+ width: 100%;
59
+ }
60
+ .bp-group-admin-pagination.table-top {
61
+ top: 0;
62
+ }
63
+ .bp-group-admin-pagination.table-bottom {
64
+ bottom: 0;
65
+ }
66
+ .bp-group-admin-pagination-viewing {
67
+ color: #777;
68
+ font-size: 12px;
69
+ font-style: italic;
70
+ }
71
+ .bp-group-admin-pagination-links {
72
+ white-space: nowrap;
73
+ padding-right: 15px;
74
+ }
75
+
76
+ table.bp-group-members .uid-column {
77
+ padding-right: 20px;
78
+ padding-left: 20px;
79
+ }
80
+ table.bp-group-members .uname-column {
81
+ width: 70%;
82
+ }
83
+ table.bp-group-members .urole-column {
84
+ padding-right: 20px;
85
+ padding-left: 20px;
86
+ }
bp-groups/admin/css/admin-rtl.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ body.toplevel_page_bp-groups table.groups th#members,body.toplevel_page_bp-groups table.groups th#status{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#bp-groups-form .avatar{float:right;margin-left:10px;margin-top:1px}#bp-groups-edit-form input{outline:0}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%;margin-bottom:6px}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}#bp-groups-new-members-list{margin:0}#bp_group_settings legend{margin:10px 0;font-weight:700}#bp_group_settings ul{margin:0}.bp-groups-settings-section{margin-top:10px}#bp-groups-permalink-box{line-height:24px;color:#666}.bp-groups-member-type{position:relative}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:left;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-right:15px}table.bp-group-members .uid-column{padding-right:20px;padding-left:20px}table.bp-group-members .uname-column{width:70%}table.bp-group-members .urole-column{padding-right:20px;padding-left:20px}
bp-groups/admin/css/admin.css CHANGED
@@ -7,25 +7,43 @@ body.toplevel_page_bp-groups table.groups th#last_active {
7
  width: 15%;
8
  }
9
 
 
 
 
 
 
10
  #bp-groups-edit-form input {
11
  outline: medium none;
12
- padding: 3px 8px;
13
  }
14
  #bp-groups-edit-form input#bp-groups-name {
15
  font-size: 1.7em;
16
  width: 100%;
 
17
  }
18
  #bp-groups-edit-form input#bp-groups-new-members {
19
  width: 100%;
20
  max-width: 90%;
21
  border: 0;
22
  }
 
 
 
 
 
 
 
 
 
 
23
  .bp-groups-settings-section {
24
- margin-bottom: 15px;
 
 
 
 
25
  }
26
  .bp-groups-member-type {
27
  position: relative;
28
- padding-bottom: 1.7em;
29
  }
30
  .bp-groups-member-type > h4 {
31
  margin-bottom: .5em;
@@ -54,3 +72,15 @@ ul.bp-group-delete-list {
54
  white-space: nowrap;
55
  padding-left: 15px;
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
7
  width: 15%;
8
  }
9
 
10
+ #bp-groups-form .avatar {
11
+ float: left;
12
+ margin-right: 10px;
13
+ margin-top: 1px;
14
+ }
15
  #bp-groups-edit-form input {
16
  outline: medium none;
 
17
  }
18
  #bp-groups-edit-form input#bp-groups-name {
19
  font-size: 1.7em;
20
  width: 100%;
21
+ margin-bottom: 6px;
22
  }
23
  #bp-groups-edit-form input#bp-groups-new-members {
24
  width: 100%;
25
  max-width: 90%;
26
  border: 0;
27
  }
28
+ #bp-groups-new-members-list {
29
+ margin: 0;
30
+ }
31
+ #bp_group_settings legend {
32
+ margin: 10px 0;
33
+ font-weight: bold;
34
+ }
35
+ #bp_group_settings ul {
36
+ margin: 0;
37
+ }
38
  .bp-groups-settings-section {
39
+ margin-top: 10px;
40
+ }
41
+ #bp-groups-permalink-box {
42
+ line-height: 24px;
43
+ color: #666;
44
  }
45
  .bp-groups-member-type {
46
  position: relative;
 
47
  }
48
  .bp-groups-member-type > h4 {
49
  margin-bottom: .5em;
72
  white-space: nowrap;
73
  padding-left: 15px;
74
  }
75
+
76
+ table.bp-group-members .uid-column {
77
+ padding-left: 20px;
78
+ padding-right: 20px;
79
+ }
80
+ table.bp-group-members .uname-column {
81
+ width: 70%;
82
+ }
83
+ table.bp-group-members .urole-column {
84
+ padding-left: 20px;
85
+ padding-right: 20px;
86
+ }
bp-groups/admin/css/admin.min.css CHANGED
@@ -1 +1,2 @@
1
- body.toplevel_page_bp-groups table.groups th#status,body.toplevel_page_bp-groups table.groups th#members{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#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}.bp-groups-member-type{position:relative;padding-bottom:1.7em}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:right;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-left:15px}
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:10 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ body.toplevel_page_bp-groups table.groups th#members,body.toplevel_page_bp-groups table.groups th#status{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#bp-groups-form .avatar{float:left;margin-right:10px;margin-top:1px}#bp-groups-edit-form input{outline:0}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%;margin-bottom:6px}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}#bp-groups-new-members-list{margin:0}#bp_group_settings legend{margin:10px 0;font-weight:700}#bp_group_settings ul{margin:0}.bp-groups-settings-section{margin-top:10px}#bp-groups-permalink-box{line-height:24px;color:#666}.bp-groups-member-type{position:relative}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:right;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-left:15px}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}
bp-groups/admin/js/admin.js CHANGED
@@ -1,14 +1,8 @@
 
 
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_id ? '&group_id=' + group_id : '';
@@ -25,9 +19,15 @@
25
  close: function() { $(this).removeClass('open'); $(this).val(''); },
26
  select: function( event, ui ) { add_member_to_list( event, ui ); }
27
  });
28
-
29
  /* Replace noscript placeholder */
30
- $( '#bp-groups-new-members' ).attr( 'placeholder', BP_Group_Admin.add_member_placeholder );
 
 
 
 
 
 
31
 
32
  /* Warn before leaving unsaved changes */
33
  $(document).on( 'change', 'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]', function() {
@@ -35,10 +35,22 @@
35
  });
36
 
37
  $( 'input#save' ).on( 'click', function() {
 
 
 
 
 
 
 
 
 
 
 
 
38
  window.warn_on_leave = false;
39
  });
40
 
41
- window.onbeforeunload = function(e) {
42
  if ( window.warn_on_leave ) {
43
  return BP_Group_Admin.warn_on_leave;
44
  }
1
+ /* global BP_Group_Admin, group_id, isRtl */
2
+
3
  (function($) {
4
  function add_member_to_list( e, ui ) {
5
+ $('#bp-groups-new-members-list').append('<li data-login="' + ui.item.value + '"><a href="#" class="bp-groups-remove-new-member">x</a> ' + ui.item.label + '</li>');
 
 
 
 
 
 
 
 
6
  }
7
 
8
  var id = 'undefined' !== typeof group_id ? '&group_id=' + group_id : '';
19
  close: function() { $(this).removeClass('open'); $(this).val(''); },
20
  select: function( event, ui ) { add_member_to_list( event, ui ); }
21
  });
22
+
23
  /* Replace noscript placeholder */
24
+ $( '#bp-groups-new-members' ).prop( 'placeholder', BP_Group_Admin.add_member_placeholder );
25
+
26
+ /* Remove a member on 'x' click */
27
+ $( '#bp_group_add_members' ).on( 'click', '.bp-groups-remove-new-member', function( e ) {
28
+ e.preventDefault();
29
+ $( e.target.parentNode ).remove();
30
+ } );
31
 
32
  /* Warn before leaving unsaved changes */
33
  $(document).on( 'change', 'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]', function() {
35
  });
36
 
37
  $( 'input#save' ).on( 'click', function() {
38
+ /* Check for users to add */
39
+ var users_to_add = [];
40
+
41
+ $( '#bp-groups-new-members-list li' ).each( function() {
42
+ users_to_add.push( $(this).data('login' ) );
43
+ } );
44
+
45
+ /* There are users to add, include a comma separated list of users login in the main field */
46
+ if ( users_to_add.length ) {
47
+ $( '#bp-groups-new-members' ).val( '' ).val( users_to_add.join( ', ' ) );
48
+ }
49
+
50
  window.warn_on_leave = false;
51
  });
52
 
53
+ window.onbeforeunload = function() {
54
  if ( window.warn_on_leave ) {
55
  return BP_Group_Admin.warn_on_leave;
56
  }
bp-groups/admin/js/admin.min.js CHANGED
@@ -1 +1,2 @@
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_id?"&group_id="+group_id:"";c(document).ready(function(){window.warn_on_leave=false;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);c(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=true});c("input#save").on("click",function(){window.warn_on_leave=false});window.onbeforeunload=function(f){if(window.warn_on_leave){return BP_Group_Admin.warn_on_leave}}})})(jQuery);
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ !function(a){function b(b,c){a("#bp-groups-new-members-list").append('<li data-login="'+c.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+c.item.label+"</li>")}var c="undefined"!=typeof group_id?"&group_id="+group_id:"";a(document).ready(function(){window.warn_on_leave=!1,a(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+c,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){a(this).addClass("open")},close:function(){a(this).removeClass("open"),a(this).val("")},select:function(a,c){b(a,c)}}),a("#bp-groups-new-members").prop("placeholder",BP_Group_Admin.add_member_placeholder),a("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(b){b.preventDefault(),a(b.target.parentNode).remove()}),a(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=!0}),a("input#save").on("click",function(){var b=[];a("#bp-groups-new-members-list li").each(function(){b.push(a(this).data("login"))}),b.length&&a("#bp-groups-new-members").val("").val(b.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){return window.warn_on_leave?BP_Group_Admin.warn_on_leave:void 0}})}(jQuery);
bp-groups/bp-groups-actions.php CHANGED
@@ -14,6 +14,83 @@
14
  // Exit if accessed directly
15
  if ( !defined( 'ABSPATH' ) ) exit;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Catch and process group creation form submissions.
19
  */
@@ -229,9 +306,9 @@ function groups_action_create_group() {
229
  // Normally we would check a nonce here, but the group save nonce is used instead
230
 
231
  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'] ) ) )
232
- bp_core_add_message( __( 'There was an error saving the group avatar, please try uploading again.', 'buddypress' ), 'error' );
233
  else
234
- bp_core_add_message( __( 'The group avatar was uploaded successfully!', 'buddypress' ) );
235
  }
236
  }
237
 
14
  // Exit if accessed directly
15
  if ( !defined( 'ABSPATH' ) ) exit;
16
 
17
+ /**
18
+ * Protect access to single groups.
19
+ *
20
+ * @since BuddyPress (2.1.0)
21
+ */
22
+ function bp_groups_group_access_protection() {
23
+ if ( ! bp_is_group() ) {
24
+ return;
25
+ }
26
+
27
+ $current_group = groups_get_current_group();
28
+ $user_has_access = $current_group->user_has_access;
29
+ $no_access_args = array();
30
+
31
+ if ( ! $user_has_access && 'hidden' !== $current_group->status ) {
32
+ // Always allow access to home and request-membership
33
+ if ( bp_is_current_action( 'home' ) || bp_is_current_action( 'request-membership' ) ) {
34
+ $user_has_access = true;
35
+
36
+ // User doesn't have access, so set up redirect args
37
+ } else if ( is_user_logged_in() ) {
38
+ $no_access_args = array(
39
+ 'message' => __( 'You do not have access to this group.', 'buddypress' ),
40
+ 'root' => bp_get_group_permalink( $current_group ) . 'home/',
41
+ 'redirect' => false
42
+ );
43
+ }
44
+ }
45
+
46
+ // Protect the admin tab from non-admins
47
+ if ( bp_is_current_action( 'admin' ) && ! bp_is_item_admin() ) {
48
+ $user_has_access = false;
49
+ $no_access_args = array(
50
+ 'message' => __( 'You are not an admin of this group.', 'buddypress' ),
51
+ 'root' => bp_get_group_permalink( $current_group ),
52
+ 'redirect' => false
53
+ );
54
+ }
55
+
56
+ /**
57
+ * Allow plugins to filter whether the current user has access to this group content.
58
+ *
59
+ * Note that if a plugin sets $user_has_access to false, it may also
60
+ * want to change the $no_access_args, to avoid problems such as
61
+ * logged-in users being redirected to wp-login.php.
62
+ *
63
+ * @since BuddyPress (2.1.0)
64
+ *
65
+ * @param bool $user_has_access True if the user has access to the
66
+ * content, otherwise false.
67
+ * @param array $no_access_args Arguments to be passed to
68
+ * bp_core_no_access() in case of no access. Note that this
69
+ * value is passed by reference, so it can be modified by the
70
+ * filter callback.
71
+ */
72
+ $user_has_access = apply_filters_ref_array( 'bp_group_user_has_access', array( $user_has_access, &$no_access_args ) );
73
+
74
+ // If user has access, we return rather than redirect
75
+ if ( $user_has_access ) {
76
+ return;
77
+ }
78
+
79
+ // Hidden groups should return a 404 for non-members.
80
+ // Unset the current group so that you're not redirected
81
+ // to the default group tab
82
+ if ( 'hidden' == $current_group->status ) {
83
+ buddypress()->groups->current_group = 0;
84
+ buddypress()->is_single_item = false;
85
+ bp_do_404();
86
+ return;
87
+ } else {
88
+ bp_core_no_access( $no_access_args );
89
+ }
90
+
91
+ }
92
+ add_action( 'bp_actions', 'bp_groups_group_access_protection' );
93
+
94
  /**
95
  * Catch and process group creation form submissions.
96
  */
306
  // Normally we would check a nonce here, but the group save nonce is used instead
307
 
308
  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'] ) ) )
309
+ bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' );
310
  else
311
+ bp_core_add_message( __( 'The group profile photo was uploaded successfully!', 'buddypress' ) );
312
  }
313
  }
314
 
bp-groups/bp-groups-activity.php CHANGED
@@ -17,7 +17,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
17
  * Register activity actions for the Groups component.
18
  */
19
  function groups_register_activity_actions() {
20
- global $bp;
21
 
22
  if ( ! bp_is_active( 'activity' ) ) {
23
  return false;
@@ -27,22 +27,41 @@ function groups_register_activity_actions() {
27
  $bp->groups->id,
28
  'created_group',
29
  __( 'Created a group', 'buddypress' ),
30
- 'bp_groups_format_activity_action_created_group'
 
 
31
  );
32
 
33
  bp_activity_set_action(
34
  $bp->groups->id,
35
  'joined_group',
36
  __( 'Joined a group', 'buddypress' ),
37
- 'bp_groups_format_activity_action_joined_group'
 
 
38
  );
39
 
40
  // These actions are for the legacy forums
41
  // Since the bbPress plugin also shares the same 'forums' identifier, we also
42
  // check for the legacy forums loader class to be extra cautious
43
  if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
44
- bp_activity_set_action( $bp->groups->id, 'new_forum_topic', __( 'New group forum topic', 'buddypress' ) );
45
- bp_activity_set_action( $bp->groups->id, 'new_forum_post', __( 'New group forum post', 'buddypress' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
  do_action( 'groups_register_activity_actions' );
@@ -144,7 +163,8 @@ function bp_groups_prefetch_activity_object_data( $activities ) {
144
  }
145
 
146
  if ( ! empty( $uncached_ids ) ) {
147
- global $wpdb, $bp;
 
148
  $uncached_ids_sql = implode( ',', wp_parse_id_list( $uncached_ids ) );
149
  $groups = $wpdb->get_results( "SELECT * FROM {$bp->groups->table_name} WHERE id IN ({$uncached_ids_sql})" );
150
  foreach ( $groups as $group ) {
17
  * Register activity actions for the Groups component.
18
  */
19
  function groups_register_activity_actions() {
20
+ $bp = buddypress();
21
 
22
  if ( ! bp_is_active( 'activity' ) ) {
23
  return false;
27
  $bp->groups->id,
28
  'created_group',
29
  __( 'Created a group', 'buddypress' ),
30
+ 'bp_groups_format_activity_action_created_group',
31
+ __( 'New Groups', 'buddypress' ),
32
+ array( 'activity', 'member', 'member_groups' )
33
  );
34
 
35
  bp_activity_set_action(
36
  $bp->groups->id,
37
  'joined_group',
38
  __( 'Joined a group', 'buddypress' ),
39
+ 'bp_groups_format_activity_action_joined_group',
40
+ __( 'Group Memberships', 'buddypress' ),
41
+ array( 'activity', 'group', 'member', 'member_groups' )
42
  );
43
 
44
  // These actions are for the legacy forums
45
  // Since the bbPress plugin also shares the same 'forums' identifier, we also
46
  // check for the legacy forums loader class to be extra cautious
47
  if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
48
+ bp_activity_set_action(
49
+ $bp->groups->id,
50
+ 'new_forum_topic',
51
+ __( 'New group forum topic', 'buddypress' ),
52
+ false,
53
+ __( 'Forum Topics', 'buddypress' ),
54
+ array( 'activity', 'group', 'member', 'member_groups' )
55
+ );
56
+
57
+ bp_activity_set_action(
58
+ $bp->groups->id,
59
+ 'new_forum_post',
60
+ __( 'New group forum post', 'buddypress' ),
61
+ false,
62
+ __( 'Forum Replies', 'buddypress' ),
63
+ array( 'activity', 'group', 'member', 'member_groups' )
64
+ );
65
  }
66
 
67
  do_action( 'groups_register_activity_actions' );
163
  }
164
 
165
  if ( ! empty( $uncached_ids ) ) {
166
+ global $wpdb;
167
+ $bp = buddypress();
168
  $uncached_ids_sql = implode( ',', wp_parse_id_list( $uncached_ids ) );
169
  $groups = $wpdb->get_results( "SELECT * FROM {$bp->groups->table_name} WHERE id IN ({$uncached_ids_sql})" );
170
  foreach ( $groups as $group ) {
bp-groups/bp-groups-admin.php CHANGED
@@ -29,8 +29,8 @@ function bp_groups_add_admin_menu() {
29
 
30
  // Add our screen
31
  $hook = add_menu_page(
32
- __( 'Groups', 'buddypress' ),
33
- __( 'Groups', 'buddypress' ),
34
  'bp_moderate',
35
  'bp-groups',
36
  'bp_groups_admin',
@@ -168,12 +168,17 @@ function bp_groups_admin_load() {
168
 
169
  // Enqueue CSS and JavaScript
170
  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 );
171
- wp_enqueue_style( 'bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version() );
172
-
173
  wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array(
174
  'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' ),
175
  'warn_on_leave' => __( 'If you leave this page, you will lose any unsaved changes you have made to the group.', 'buddypress' ),
176
  ) );
 
 
 
 
 
 
 
177
 
178
  if ( $doaction && 'save' == $doaction ) {
179
  // Get group ID
@@ -230,10 +235,6 @@ function bp_groups_admin_load() {
230
  $user_names = array_merge( $user_names, explode( ',', $_POST['bp-groups-new-members'] ) );
231
  }
232
 
233
- if ( ! empty( $_POST['new_members'] ) ) {
234
- $user_names = array_merge( $user_names, $_POST['new_members'] );
235
- }
236
-
237
  if ( ! empty( $user_names ) ) {
238
 
239
  foreach( array_values( $user_names ) as $user_name ) {
@@ -503,7 +504,7 @@ function bp_groups_admin_edit() {
503
 
504
  <?php // If the user has just made a change to an group, display the status messages ?>
505
  <?php if ( !empty( $messages ) ) : ?>
506
- <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
507
  <?php endif; ?>
508
 
509
  <?php if ( ! empty( $group ) ) : ?>
@@ -518,6 +519,10 @@ function bp_groups_admin_edit() {
518
  <h3><?php _e( 'Name and Description', 'buddypress' ); ?></h3>
519
  <div class="inside">
520
  <input type="text" name="bp-groups-name" id="bp-groups-name" value="<?php echo esc_attr( stripslashes( $group_name ) ) ?>" />
 
 
 
 
521
 
522
  <?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' ) ) ); ?>
523
  </div>
@@ -560,8 +565,9 @@ function bp_groups_admin_edit() {
560
  */
561
  function bp_groups_admin_delete() {
562
 
563
- if ( ! is_super_admin() )
564
  die( '-1' );
 
565
 
566
  $group_ids = isset( $_REQUEST['gid'] ) ? $_REQUEST['gid'] : 0;
567
  if ( ! is_array( $group_ids ) ) {
@@ -731,7 +737,6 @@ function bp_groups_admin_edit_metabox_add_new_members( $item ) {
731
  * group.
732
  */
733
  function bp_groups_admin_edit_metabox_members( $item ) {
734
- global $members_template;
735
 
736
  // Pull up a list of group members, so we can separate out the types
737
  // We'll also keep track of group members here to place them into a
@@ -751,7 +756,7 @@ function bp_groups_admin_edit_metabox_members( $item ) {
751
  );
752
 
753
  foreach ( $members as $type => &$member_type_users ) {
754
- $page_qs_key = $type . '_page';
755
  $current_type_page = isset( $_GET[ $page_qs_key ] ) ? absint( $_GET[ $page_qs_key ] ) : 1;
756
  $member_type_query = new BP_Group_Member_Query( array(
757
  'group_id' => $item->id,
@@ -761,27 +766,24 @@ function bp_groups_admin_edit_metabox_members( $item ) {
761
  'page' => $current_type_page,
762
  ) );
763
 
764
- $member_type_users = $member_type_query->results;
765
-
766
  $pagination[ $type ] = bp_groups_admin_create_pagination_links( $member_type_query, $type );
767
  }
768
 
769
  // Echo out the javascript variable
770
- echo '<script type="text/javascript">var group_id = "' . $item->id . '";</script>';
771
 
772
  // Loop through each member type
773
  foreach ( $members as $member_type => $type_users ) : ?>
774
 
775
  <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr( $member_type ) ?>">
776
 
777
- <h4>
778
- <?php switch ( $member_type ) :
779
- case 'admin' : _e( 'Administrators', 'buddypress' ); break;
780
- case 'mod' : _e( 'Moderators', 'buddypress' ); break;
781
- case 'member' : _e( 'Members', 'buddypress' ); break;
782
- case 'banned' : _e( 'Banned Users', 'buddypress' ); break;
783
- endswitch; ?>
784
- </h4>
785
 
786
  <div class="bp-group-admin-pagination table-top">
787
  <?php echo $pagination[ $member_type ] ?>
@@ -791,11 +793,11 @@ function bp_groups_admin_edit_metabox_members( $item ) {
791
 
792
  <table class="widefat bp-group-members">
793
  <thead>
794
- <tr>
795
- <th scope="col" class="uid-column"><?php _ex( 'ID', 'Group member user_id in group admin', 'buddypress' ) ?></th>
796
- <th scope="col" class="uname-column"><?php _ex( 'Name', 'Group member name in group admin', 'buddypress' ) ?></th>
797
- <th scope="col" class="urole-column"><?php _ex( 'Group Role', 'Group member role in group admin', 'buddypress' ) ?></th>
798
- </tr>
799
  </thead>
800
 
801
  <tbody>
@@ -811,16 +813,25 @@ function bp_groups_admin_edit_metabox_members( $item ) {
811
  'height' => '32'
812
  ) ); ?></a>
813
 
814
- <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user->ID ) ?></span>
815
  </td>
816
 
817
  <td class="urole-column">
818
  <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->ID ); ?>]">
819
- <option value="admin" <?php selected( 'admin', $member_type ) ?>><?php _e( 'Administrator', 'buddypress' ) ?></option>
820
- <option value="mod" <?php selected( 'mod', $member_type ) ?>><?php _e( 'Moderator', 'buddypress' ) ?></option>
821
- <option value="member" <?php selected( 'member', $member_type ) ?>><?php _e( 'Member', 'buddypress' ) ?></option>
822
- <option class="banned" value="banned" <?php selected( 'banned', $member_type ) ?>><?php _e( 'Banned', 'buddypress' ) ?></option>
823
- <option class="remove" value="remove"><?php _e( 'Remove From Group', 'buddypress' ) ?></option>
 
 
 
 
 
 
 
 
 
824
  </select>
825
 
826
  <?php
@@ -829,7 +840,8 @@ function bp_groups_admin_edit_metabox_members( $item ) {
829
  * so we can easily detect changes.
830
  *
831
  * @todo remove this, and do database detection on save
832
- */ ?>
 
833
  <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr( $type_user->ID ); ?>]" value="<?php echo esc_attr( $member_type ); ?>" />
834
  </td>
835
  </tr>
@@ -848,19 +860,18 @@ function bp_groups_admin_edit_metabox_members( $item ) {
848
  </table>
849
 
850
  <div class="bp-group-admin-pagination table-bottom">
851
- <?php echo $pagination[ $member_type ] ?>
852
  </div>
853
 
854
  <?php else : ?>
855
 
856
- <p class="bp-groups-no-members description"><?php _e( 'No members of this type', 'buddypress' ) ?></p>
857
 
858
  <?php endif; ?>
859
 
860
  </div><!-- .bp-groups-member-type -->
861
 
862
  <?php endforeach;
863
-
864
  }
865
 
866
  /**
@@ -939,10 +950,10 @@ function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query,
939
  ) );
940
 
941
  $viewing_text = sprintf(
942
- __( 'Viewing %1$s - %2$s of %3$s', 'buddypress' ),
943
  number_format_i18n( $current_page_start ),
944
  number_format_i18n( $current_page_end ),
945
- sprintf( _n( '%s member', '%s members', $query->total_users, 'buddypress' ), $query->total_users )
946
  );
947
 
948
  $pagination .= '<span class="bp-group-admin-pagination-viewing">' . $viewing_text . '</span>';
@@ -979,41 +990,38 @@ function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) {
979
  function bp_groups_admin_autocomplete_handler() {
980
 
981
  // Bail if user user shouldn't be here, or is a large network
982
- if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) )
983
  wp_die( -1 );
 
984
 
985
- $return = array();
 
 
 
 
 
986
 
987
- // Exclude current group members
988
- $group_id = isset( $_GET['group_id'] ) ? wp_parse_id_list( $_GET['group_id'] ) : array();
989
- $group_member_query = new BP_Group_Member_Query( array(
990
- 'group_id' => $group_id,
991
- 'per_page' => 0, // show all
992
- 'group_role' => array( 'member', 'mod', 'admin', ),
993
- 'populate_extras' => false,
994
- 'count_total' => false,
995
  ) );
996
 
997
- $group_members = ! empty( $group_member_query->results ) ? wp_list_pluck( $group_member_query->results, 'ID' ) : array();
998
 
999
- $terms = isset( $_GET['term'] ) ? $_GET['term'] : '';
1000
- $users = bp_core_get_users( array(
1001
- 'type' => 'alphabetical',
1002
- 'search_terms' => $terms,
1003
- 'exclude' => $group_members,
1004
- 'per_page' => 10,
1005
- 'populate_extras' => false
1006
- ) );
1007
 
1008
- foreach ( (array) $users['users'] as $user ) {
1009
- $return[] = array(
1010
- /* translators: 1: user_login, 2: user_email */
1011
- 'label' => sprintf( __( '%1$s (%2$s)', 'buddypress' ), bp_is_username_compatibility_mode() ? $user->user_login : $user->user_nicename, $user->user_email ),
1012
- 'value' => $user->user_nicename,
1013
- );
1014
  }
1015
 
1016
- wp_die( json_encode( $return ) );
1017
  }
1018
  add_action( 'wp_ajax_bp_group_admin_member_autocomplete', 'bp_groups_admin_autocomplete_handler' );
1019
 
@@ -1069,7 +1077,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1069
  *
1070
  * @since BuddyPress (1.7.0)
1071
  */
1072
- function prepare_items() {
1073
  global $groups_template;
1074
 
1075
  $screen = get_current_screen();
@@ -1176,7 +1184,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1176
  *
1177
  * @return array Array of column headers.
1178
  */
1179
- function get_column_info() {
1180
  $this->_column_headers = array(
1181
  $this->get_columns(),
1182
  array(),
@@ -1191,7 +1199,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1191
  *
1192
  * @since BuddyPress (1.7.0)
1193
  */
1194
- function no_items() {
1195
  _e( 'No groups found.', 'buddypress' );
1196
  }
1197
 
@@ -1200,9 +1208,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1200
  *
1201
  * @since BuddyPress (1.7.0)
1202
  */
1203
- function display() {
1204
- extract( $this->_args );
1205
-
1206
  $this->display_tablenav( 'top' ); ?>
1207
 
1208
  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
@@ -1234,7 +1240,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1234
  *
1235
  * @param object $item The current group item in the loop.
1236
  */
1237
- function single_row( $item = array() ) {
1238
  static $even = false;
1239
 
1240
  $row_classes = array();
@@ -1260,7 +1266,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1260
  *
1261
  * @since BuddyPress (1.7.0)
1262
  */
1263
- function get_views() {
1264
  $url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?>
1265
 
1266
  <ul class="subsubsub">
@@ -1281,7 +1287,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1281
  *
1282
  * @return array Key/value pairs for the bulk actions dropdown.
1283
  */
1284
- function get_bulk_actions() {
1285
  return apply_filters( 'bp_groups_list_table_get_bulk_actions', array(
1286
  'delete' => __( 'Delete', 'buddypress' )
1287
  ) );
@@ -1296,7 +1302,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1296
  *
1297
  * @return array Array of column titles.
1298
  */
1299
- function get_columns() {
1300
  return apply_filters( 'bp_groups_list_table_get_columns', array(
1301
  'cb' => '<input name type="checkbox" />',
1302
  'comment' => _x( 'Name', 'Groups admin Group Name column header', 'buddypress' ),
@@ -1323,7 +1329,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1323
  *
1324
  * @return array Array of sortable column names.
1325
  */
1326
- function get_sortable_columns() {
1327
  return array(
1328
  'gid' => array( 'gid', false ),
1329
  'comment' => array( 'name', false ),
@@ -1341,7 +1347,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1341
  *
1342
  * @param array $item A singular item (one full row).
1343
  */
1344
- function column_cb( $item = array() ) {
1345
  printf( '<label class="screen-reader-text" for="gid-%1$d">' . __( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', $item['id'] );
1346
  }
1347
 
@@ -1354,8 +1360,8 @@ class BP_Groups_List_Table extends WP_List_Table {
1354
  *
1355
  * @param array $item A singular item (one full row).
1356
  */
1357
- function column_gid( $item = array() ) {
1358
- echo '<strong>' . $item['id'] . '</strong>';
1359
  }
1360
 
1361
  /**
@@ -1369,13 +1375,13 @@ class BP_Groups_List_Table extends WP_List_Table {
1369
  *
1370
  * @param array $item A singular item (one full row).
1371
  */
1372
- function column_comment( $item = array() ) {
1373
 
1374
- // Preorder items: Visit | Edit | Delete
1375
  $actions = array(
1376
- 'visit' => '',
1377
  'edit' => '',
1378
  'delete' => '',
 
1379
  );
1380
 
1381
  // We need the group object for some BP functions
@@ -1385,35 +1391,40 @@ class BP_Groups_List_Table extends WP_List_Table {
1385
  $base_url = bp_get_admin_url( 'admin.php?page=bp-groups&amp;gid=' . $item['id'] );
1386
  $delete_url = wp_nonce_url( $base_url . "&amp;action=delete", 'bp-groups-delete' );
1387
  $edit_url = $base_url . '&amp;action=edit';
1388
- $visit_url = bp_get_group_permalink( $item_obj );
 
1389
 
1390
  // Rollover actions
1391
 
1392
- // Visit
1393
- $actions['visit'] = sprintf( '<a href="%s">%s</a>', esc_url( $visit_url ), __( 'Visit', 'buddypress' ) );
1394
-
1395
  // Edit
1396
- $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), __( 'Edit', 'buddypress' ) );
1397
 
1398
  // Delete
1399
  $actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) );
1400
 
 
 
 
1401
  // Other plugins can filter which actions are shown
1402
  $actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item );
1403
 
1404
  // Get group name and avatar
1405
- $avatar = bp_core_fetch_avatar( array(
1406
- 'item_id' => $item['id'],
1407
- 'object' => 'group',
1408
- 'type' => 'thumb',
1409
- 'avatar_dir' => 'group-avatars',
1410
- 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $item['name'] ),
1411
- 'width' => '32',
1412
- 'height' => '32',
1413
- 'title' => $item['name']
1414
- ) );
 
 
 
 
1415
 
1416
- $content = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'], $item ) );
1417
 
1418
  echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions );
1419
  }
@@ -1425,7 +1436,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1425
  *
1426
  * @param array Information about the current row.
1427
  */
1428
- function column_description( $item = array() ) {
1429
  echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) );
1430
  }
1431
 
@@ -1436,7 +1447,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1436
  *
1437
  * @param array Information about the current row.
1438
  */
1439
- function column_status( $item = array() ) {
1440
  $status = $item['status'];
1441
  $status_desc = '';
1442
 
@@ -1464,7 +1475,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1464
  *
1465
  * @param array Information about the current row.
1466
  */
1467
- function column_members( $item = array() ) {
1468
  $count = groups_get_groupmeta( $item['id'], 'total_member_count' );
1469
  echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) );
1470
  }
@@ -1476,7 +1487,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1476
  *
1477
  * @param array Information about the current row.
1478
  */
1479
- function column_last_active( $item = array() ) {
1480
  $last_active = groups_get_groupmeta( $item['id'], 'last_activity' );
1481
  echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
1482
  }
@@ -1489,7 +1500,7 @@ class BP_Groups_List_Table extends WP_List_Table {
1489
  * @param array Information about the current row.
1490
  * @param string the column name.
1491
  */
1492
- function column_default( $item = array(), $column_name = '' ) {
1493
  return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item );
1494
  }
1495
  }
29
 
30
  // Add our screen
31
  $hook = add_menu_page(
32
+ _x( 'Groups', 'Admin Groups page title', 'buddypress' ),
33
+ _x( 'Groups', 'Admin Groups menu', 'buddypress' ),
34
  'bp_moderate',
35
  'bp-groups',
36
  'bp_groups_admin',
168
 
169
  // Enqueue CSS and JavaScript
170
  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 );
 
 
171
  wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array(
172
  'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' ),
173
  'warn_on_leave' => __( 'If you leave this page, you will lose any unsaved changes you have made to the group.', 'buddypress' ),
174
  ) );
175
+ wp_enqueue_style( 'bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version() );
176
+
177
+ wp_style_add_data( 'bp_groups_admin_css', 'rtl', true );
178
+ if ( $min ) {
179
+ wp_style_add_data( 'bp_groups_admin_css', 'suffix', $min );
180
+ }
181
+
182
 
183
  if ( $doaction && 'save' == $doaction ) {
184
  // Get group ID
235
  $user_names = array_merge( $user_names, explode( ',', $_POST['bp-groups-new-members'] ) );
236
  }
237
 
 
 
 
 
238
  if ( ! empty( $user_names ) ) {
239
 
240
  foreach( array_values( $user_names ) as $user_name ) {
504
 
505
  <?php // If the user has just made a change to an group, display the status messages ?>
506
  <?php if ( !empty( $messages ) ) : ?>
507
+ <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "</p><p>", $messages ); ?></p></div>
508
  <?php endif; ?>
509
 
510
  <?php if ( ! empty( $group ) ) : ?>
519
  <h3><?php _e( 'Name and Description', 'buddypress' ); ?></h3>
520
  <div class="inside">
521
  <input type="text" name="bp-groups-name" id="bp-groups-name" value="<?php echo esc_attr( stripslashes( $group_name ) ) ?>" />
522
+ <div id="bp-groups-permalink-box">
523
+ <strong><?php esc_html_e( 'Permalink:', 'buddypress' ) ?></strong> <span id="sample-permalink"><?php bp_group_permalink( $group ) ?></span> <a href="<?php echo bp_group_permalink( $group ) ?>" class="button button-small" id="bp-groups-visit-group"><?php esc_html_e( 'Visit Group', 'buddypress' ) ?></a>
524
+ </div>
525
+
526
 
527
  <?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' ) ) ); ?>
528
  </div>
565
  */
566
  function bp_groups_admin_delete() {
567
 
568
+ if ( ! bp_current_user_can( 'bp_moderate' ) ) {
569
  die( '-1' );
570
+ }
571
 
572
  $group_ids = isset( $_REQUEST['gid'] ) ? $_REQUEST['gid'] : 0;
573
  if ( ! is_array( $group_ids ) ) {
737
  * group.
738
  */
739
  function bp_groups_admin_edit_metabox_members( $item ) {
 
740
 
741
  // Pull up a list of group members, so we can separate out the types
742
  // We'll also keep track of group members here to place them into a
756
  );
757
 
758
  foreach ( $members as $type => &$member_type_users ) {
759
+ $page_qs_key = $type . '_page';
760
  $current_type_page = isset( $_GET[ $page_qs_key ] ) ? absint( $_GET[ $page_qs_key ] ) : 1;
761
  $member_type_query = new BP_Group_Member_Query( array(
762
  'group_id' => $item->id,
766
  'page' => $current_type_page,
767
  ) );
768
 
769
+ $member_type_users = $member_type_query->results;
 
770
  $pagination[ $type ] = bp_groups_admin_create_pagination_links( $member_type_query, $type );
771
  }
772
 
773
  // Echo out the javascript variable
774
+ echo '<script type="text/javascript">var group_id = "' . esc_js( $item->id ) . '";</script>';
775
 
776
  // Loop through each member type
777
  foreach ( $members as $member_type => $type_users ) : ?>
778
 
779
  <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr( $member_type ) ?>">
780
 
781
+ <h4><?php switch ( $member_type ) :
782
+ case 'admin' : esc_html_e( 'Administrators', 'buddypress' ); break;
783
+ case 'mod' : esc_html_e( 'Moderators', 'buddypress' ); break;
784
+ case 'member' : esc_html_e( 'Members', 'buddypress' ); break;
785
+ case 'banned' : esc_html_e( 'Banned Members', 'buddypress' ); break;
786
+ endswitch; ?></h4>
 
 
787
 
788
  <div class="bp-group-admin-pagination table-top">
789
  <?php echo $pagination[ $member_type ] ?>
793
 
794
  <table class="widefat bp-group-members">
795
  <thead>
796
+ <tr>
797
+ <th scope="col" class="uid-column"><?php _ex( 'ID', 'Group member user_id in group admin', 'buddypress' ); ?></th>
798
+ <th scope="col" class="uname-column"><?php _ex( 'Name', 'Group member name in group admin', 'buddypress' ); ?></th>
799
+ <th scope="col" class="urole-column"><?php _ex( 'Group Role', 'Group member role in group admin', 'buddypress' ); ?></th>
800
+ </tr>
801
  </thead>
802
 
803
  <tbody>
813
  'height' => '32'
814
  ) ); ?></a>
815
 
816
+ <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user->ID ); ?></span>
817
  </td>
818
 
819
  <td class="urole-column">
820
  <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->ID ); ?>]">
821
+ <optgroup label="<?php esc_attr_e( 'Roles', 'buddypress' ); ?>">
822
+ <option class="admin" value="admin" <?php selected( 'admin', $member_type ); ?>><?php esc_html_e( 'Administrator', 'buddypress' ); ?></option>
823
+ <option class="mod" value="mod" <?php selected( 'mod', $member_type ); ?>><?php esc_html_e( 'Moderator', 'buddypress' ); ?></option>
824
+ <option class="member" value="member" <?php selected( 'member', $member_type ); ?>><?php esc_html_e( 'Member', 'buddypress' ); ?></option>
825
+ <?php if ( 'banned' === $member_type ) : ?>
826
+ <option class="banned" value="banned" <?php selected( 'banned', $member_type ); ?>><?php esc_html_e( 'Banned', 'buddypress' ); ?></option>
827
+ <?php endif; ?>
828
+ </optgroup>
829
+ <optgroup label="<?php esc_attr_e( 'Actions', 'buddypress' ); ?>">
830
+ <option class="remove" value="remove"><?php esc_html_e( 'Remove', 'buddypress' ); ?></option>
831
+ <?php if ( 'banned' !== $member_type ) : ?>
832
+ <option class="banned" value="banned"><?php esc_html_e( 'Ban', 'buddypress' ); ?></option>
833
+ <?php endif; ?>
834
+ </optgroup>
835
  </select>
836
 
837
  <?php
840
  * so we can easily detect changes.
841
  *
842
  * @todo remove this, and do database detection on save
843
+ */
844
+ ?>
845
  <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr( $type_user->ID ); ?>]" value="<?php echo esc_attr( $member_type ); ?>" />
846
  </td>
847
  </tr>
860
  </table>
861
 
862
  <div class="bp-group-admin-pagination table-bottom">
863
+ <?php echo $pagination[ $member_type ]; ?>
864
  </div>
865
 
866
  <?php else : ?>
867
 
868
+ <p class="bp-groups-no-members description"><?php esc_html_e( 'No members of this type', 'buddypress' ); ?></p>
869
 
870
  <?php endif; ?>
871
 
872
  </div><!-- .bp-groups-member-type -->
873
 
874
  <?php endforeach;
 
875
  }
876
 
877
  /**
950
  ) );
951
 
952
  $viewing_text = sprintf(
953
+ _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $query->total_users, 'buddypress' ),
954
  number_format_i18n( $current_page_start ),
955
  number_format_i18n( $current_page_end ),
956
+ (int) $query->total_users
957
  );
958
 
959
  $pagination .= '<span class="bp-group-admin-pagination-viewing">' . $viewing_text . '</span>';
990
  function bp_groups_admin_autocomplete_handler() {
991
 
992
  // Bail if user user shouldn't be here, or is a large network
993
+ if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) ) {
994
  wp_die( -1 );
995
+ }
996
 
997
+ $term = isset( $_GET['term'] ) ? sanitize_text_field( $_GET['term'] ) : '';
998
+ $group_id = isset( $_GET['group_id'] ) ? absint( $_GET['group_id'] ) : 0;
999
+
1000
+ if ( ! $term || ! $group_id ) {
1001
+ wp_die( -1 );
1002
+ }
1003
 
1004
+ $suggestions = bp_core_get_suggestions( array(
1005
+ 'group_id' => -$group_id, // A negative value will exclude this group's members from the suggestions.
1006
+ 'limit' => 10,
1007
+ 'term' => $term,
1008
+ 'type' => 'members',
 
 
 
1009
  ) );
1010
 
1011
+ $matches = array();
1012
 
1013
+ if ( $suggestions && ! is_wp_error( $suggestions ) ) {
1014
+ foreach ( $suggestions as $user ) {
 
 
 
 
 
 
1015
 
1016
+ $matches[] = array(
1017
+ // translators: 1: user_login, 2: user_email
1018
+ 'label' => sprintf( __( '%1$s (%2$s)', 'buddypress' ), $user->name, $user->ID ),
1019
+ 'value' => $user->ID,
1020
+ );
1021
+ }
1022
  }
1023
 
1024
+ wp_die( json_encode( $matches ) );
1025
  }
1026
  add_action( 'wp_ajax_bp_group_admin_member_autocomplete', 'bp_groups_admin_autocomplete_handler' );
1027
 
1077
  *
1078
  * @since BuddyPress (1.7.0)
1079
  */
1080
+ public function prepare_items() {
1081
  global $groups_template;
1082
 
1083
  $screen = get_current_screen();
1184
  *
1185
  * @return array Array of column headers.
1186
  */
1187
+ public function get_column_info() {
1188
  $this->_column_headers = array(
1189
  $this->get_columns(),
1190
  array(),
1199
  *
1200
  * @since BuddyPress (1.7.0)
1201
  */
1202
+ public function no_items() {
1203
  _e( 'No groups found.', 'buddypress' );
1204
  }
1205
 
1208
  *
1209
  * @since BuddyPress (1.7.0)
1210
  */
1211
+ public function display() {
 
 
1212
  $this->display_tablenav( 'top' ); ?>
1213
 
1214
  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
1240
  *
1241
  * @param object $item The current group item in the loop.
1242
  */
1243
+ public function single_row( $item = array() ) {
1244
  static $even = false;
1245
 
1246
  $row_classes = array();
1266
  *
1267
  * @since BuddyPress (1.7.0)
1268
  */
1269
+ public function get_views() {
1270
  $url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?>
1271
 
1272
  <ul class="subsubsub">
1287
  *
1288
  * @return array Key/value pairs for the bulk actions dropdown.
1289
  */
1290
+ public function get_bulk_actions() {
1291
  return apply_filters( 'bp_groups_list_table_get_bulk_actions', array(
1292
  'delete' => __( 'Delete', 'buddypress' )
1293
  ) );
1302
  *
1303
  * @return array Array of column titles.
1304
  */
1305
+ public function get_columns() {
1306
  return apply_filters( 'bp_groups_list_table_get_columns', array(
1307
  'cb' => '<input name type="checkbox" />',
1308
  'comment' => _x( 'Name', 'Groups admin Group Name column header', 'buddypress' ),
1329
  *
1330
  * @return array Array of sortable column names.
1331
  */
1332
+ public function get_sortable_columns() {
1333
  return array(
1334
  'gid' => array( 'gid', false ),
1335
  'comment' => array( 'name', false ),
1347
  *
1348
  * @param array $item A singular item (one full row).
1349
  */
1350
+ public function column_cb( $item = array() ) {
1351
  printf( '<label class="screen-reader-text" for="gid-%1$d">' . __( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', $item['id'] );
1352
  }
1353
 
1360
  *
1361
  * @param array $item A singular item (one full row).
1362
  */
1363
+ public function column_gid( $item = array() ) {
1364
+ echo '<strong>' . absint( $item['id'] ) . '</strong>';
1365
  }
1366
 
1367
  /**
1375
  *
1376
  * @param array $item A singular item (one full row).
1377
  */
1378
+ public function column_comment( $item = array() ) {
1379
 
1380
+ // Preorder items: Edit | Delete | View
1381
  $actions = array(
 
1382
  'edit' => '',
1383
  'delete' => '',
1384
+ 'view' => '',
1385
  );
1386
 
1387
  // We need the group object for some BP functions
1391
  $base_url = bp_get_admin_url( 'admin.php?page=bp-groups&amp;gid=' . $item['id'] );
1392
  $delete_url = wp_nonce_url( $base_url . "&amp;action=delete", 'bp-groups-delete' );
1393
  $edit_url = $base_url . '&amp;action=edit';
1394
+ $view_url = bp_get_group_permalink( $item_obj );
1395
+ $group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'] ), $item );
1396
 
1397
  // Rollover actions
1398
 
 
 
 
1399
  // Edit
1400
+ $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), __( 'Edit', 'buddypress' ) );
1401
 
1402
  // Delete
1403
  $actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) );
1404
 
1405
+ // Visit
1406
+ $actions['view'] = sprintf( '<a href="%s">%s</a>', esc_url( $view_url ), __( 'View', 'buddypress' ) );
1407
+
1408
  // Other plugins can filter which actions are shown
1409
  $actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item );
1410
 
1411
  // Get group name and avatar
1412
+ $avatar = '';
1413
+
1414
+ if ( buddypress()->avatar->show_avatars ) {
1415
+ $avatar = bp_core_fetch_avatar( array(
1416
+ 'item_id' => $item['id'],
1417
+ 'object' => 'group',
1418
+ 'type' => 'thumb',
1419
+ 'avatar_dir' => 'group-avatars',
1420
+ 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $group_name ),
1421
+ 'width' => '32',
1422
+ 'height' => '32',
1423
+ 'title' => $group_name
1424
+ ) );
1425
+ }
1426
 
1427
+ $content = sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $group_name );
1428
 
1429
  echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions );
1430
  }
1436
  *
1437
  * @param array Information about the current row.
1438
  */
1439
+ public function column_description( $item = array() ) {
1440
  echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) );
1441
  }
1442
 
1447
  *
1448
  * @param array Information about the current row.
1449
  */
1450
+ public function column_status( $item = array() ) {
1451
  $status = $item['status'];
1452
  $status_desc = '';
1453
 
1475
  *
1476
  * @param array Information about the current row.
1477
  */
1478
+ public function column_members( $item = array() ) {
1479
  $count = groups_get_groupmeta( $item['id'], 'total_member_count' );
1480
  echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) );
1481
  }
1487
  *
1488
  * @param array Information about the current row.
1489
  */
1490
+ public function column_last_active( $item = array() ) {
1491
  $last_active = groups_get_groupmeta( $item['id'], 'last_activity' );
1492
  echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
1493
  }
1500
  * @param array Information about the current row.
1501
  * @param string the column name.
1502
  */
1503
+ public function column_default( $item = array(), $column_name = '' ) {
1504
  return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item );
1505
  }
1506
  }
bp-groups/bp-groups-adminbar.php CHANGED
@@ -57,11 +57,11 @@ function bp_groups_group_admin_menu() {
57
  ) );
58
 
59
  // Group Admin > Group avatar
60
- if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) {
61
  $wp_admin_bar->add_menu( array(
62
  'parent' => $bp->group_admin_menu_id,
63
  'id' => 'group-avatar',
64
- 'title' => __( 'Edit Avatar', 'buddypress' ),
65
  'href' => bp_get_groups_action_link( 'admin/group-avatar' )
66
  ) );
67
  }
57
  ) );
58
 
59
  // Group Admin > Group avatar
60
+ if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) {
61
  $wp_admin_bar->add_menu( array(
62
  'parent' => $bp->group_admin_menu_id,
63
  'id' => 'group-avatar',
64
+ 'title' => __( 'Edit Profile Photo', 'buddypress' ),
65
  'href' => bp_get_groups_action_link( 'admin/group-avatar' )
66
  ) );
67
  }
bp-groups/bp-groups-buddybar.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * BuddyPress Groups BuddyBar
5
- *
6
- * @package BuddyPress
7
- * @subpackage GroupsBuddyBar
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( !defined( 'ABSPATH' ) ) exit;
12
-
13
- /**
14
- * Add menu items to the BuddyBar.
15
- *
16
- * @since BuddyPress (1.0.0)
17
- *
18
- * @global BuddyPress $bp
19
- */
20
- function bp_groups_adminbar_admin_menu() {
21
- global $bp;
22
-
23
- if ( empty( $bp->groups->current_group ) )
24
- return false;
25
-
26
- // Only group admins and site admins can see this menu
27
- if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() )
28
- return false; ?>
29
-
30
- <li id="bp-adminbar-adminoptions-menu">
31
- <a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a>
32
-
33
- <ul>
34
- <li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li>
35
-
36
- <li><a href="<?php bp_groups_action_link( 'admin/group-settings' ); ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
37
-
38
- <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
39
-
40
- <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li>
41
-
42
- <?php endif; ?>
43
-
44
- <?php if ( bp_is_active( 'friends' ) ) : ?>
45
-
46
- <li><a href="<?php bp_groups_action_link( 'send-invites' ); ?>"><?php _e( 'Manage Invitations', 'buddypress' ); ?></a></li>
47
-
48
- <?php endif; ?>
49
-
50
- <li><a href="<?php bp_groups_action_link( 'admin/manage-members' ); ?>"><?php _e( 'Manage Members', 'buddypress' ); ?></a></li>
51
-
52
- <?php if ( $bp->groups->current_group->status == 'private' ) : ?>
53
-
54
- <li><a href="<?php bp_groups_action_link( 'admin/membership-requests' ); ?>"><?php _e( 'Membership Requests', 'buddypress' ); ?></a></li>
55
-
56
- <?php endif; ?>
57
-
58
- <li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ); ?>&amp;delete-group-button=1&amp;delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
59
-
60
- <?php do_action( 'bp_groups_adminbar_admin_menu' ) ?>
61
-
62
- </ul>
63
- </li>
64
-
65
- <?php
66
- }
67
- add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-groups/bp-groups-cache.php CHANGED
@@ -173,6 +173,35 @@ add_action( 'groups_unban_member', 'groups_clear_group_user_object_cache', 10,
173
  add_action( 'groups_uninvite_user', 'groups_clear_group_user_object_cache', 10, 2 );
174
  add_action( 'groups_remove_member', 'groups_clear_group_user_object_cache', 10, 2 );
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  /* List actions to clear super cached pages on, if super cache is installed */
177
  add_action( 'groups_join_group', 'bp_core_clear_cache' );
178
  add_action( 'groups_leave_group', 'bp_core_clear_cache' );
173
  add_action( 'groups_uninvite_user', 'groups_clear_group_user_object_cache', 10, 2 );
174
  add_action( 'groups_remove_member', 'groups_clear_group_user_object_cache', 10, 2 );
175
 
176
+ /**
177
+ * Clear group administrator cache.
178
+ *
179
+ * @since BuddyPress (2.1.0)
180
+ *
181
+ * @param int $group_id The group ID.
182
+ */
183
+ function groups_clear_group_administrator_cache( $group_id ) {
184
+ wp_cache_delete( $group_id, 'bp_group_admins' );
185
+ }
186
+ add_action( 'groups_promote_member', 'groups_clear_group_administrator_cache' );
187
+ add_action( 'groups_demote_member', 'groups_clear_group_administrator_cache' );
188
+ add_action( 'groups_delete_group', 'groups_clear_group_administrator_cache' );
189
+
190
+ /**
191
+ * Clear group administrator cache when a group member is saved.
192
+ *
193
+ * This accounts for situations where group administrators are added manually
194
+ * using {@link BP_Groups_Member::save()}. Usually via a plugin.
195
+ *
196
+ * @since BuddyPress (2.1.0)
197
+ *
198
+ * @param BP_Groups_Member $member
199
+ */
200
+ function groups_clear_group_administrator_cache_on_member_save( BP_Groups_Member $member ) {
201
+ groups_clear_group_administrator_cache( $member->group_id );
202
+ }
203
+ add_action( 'groups_member_after_save', 'groups_clear_group_administrator_cache_on_member_save' );
204
+
205
  /* List actions to clear super cached pages on, if super cache is installed */
206
  add_action( 'groups_join_group', 'bp_core_clear_cache' );
207
  add_action( 'groups_leave_group', 'bp_core_clear_cache' );
bp-groups/bp-groups-classes.php CHANGED
@@ -445,7 +445,7 @@ class BP_Groups_Group {
445
  if ( empty( $user_id ) )
446
  $user_id = bp_displayed_user_id();
447
 
448
- $filter = esc_sql( like_escape( $filter ) );
449
 
450
  $pag_sql = $order_sql = $hidden_sql = '';
451
 
@@ -460,8 +460,8 @@ class BP_Groups_Group {
460
 
461
  $gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
462
 
463
- $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" );
464
- $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids})" );
465
 
466
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
467
  }
@@ -486,7 +486,7 @@ class BP_Groups_Group {
486
  public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
487
  global $wpdb, $bp;
488
 
489
- $filter = esc_sql( like_escape( $filter ) );
490
 
491
  $pag_sql = $order_sql = $hidden_sql = '';
492
 
@@ -502,8 +502,8 @@ class BP_Groups_Group {
502
  if ( !bp_current_user_can( 'bp_moderate' ) )
503
  $hidden_sql = "AND status != 'hidden'";
504
 
505
- $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}" );
506
- $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%{$filter}%%' OR description LIKE '%%{$filter}%%' ) {$hidden_sql}" );
507
 
508
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
509
  }
@@ -702,8 +702,8 @@ class BP_Groups_Group {
702
  }
703
 
704
  if ( ! empty( $r['search_terms'] ) ) {
705
- $search_terms = esc_sql( like_escape( $r['search_terms'] ) );
706
- $sql['search'] = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
707
  }
708
 
709
  $meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
@@ -738,7 +738,7 @@ class BP_Groups_Group {
738
  // If a 'type' parameter was passed, parse it and overwrite
739
  // 'order' and 'orderby' params passed to the function
740
  if ( ! empty( $r['type'] ) ) {
741
- $order_orderby = self::convert_type_to_order_orderby( $r['type'] );
742
 
743
  // If an invalid type is passed, $order_orderby will be
744
  // an array with empty values. In this case, we stick
@@ -756,7 +756,7 @@ class BP_Groups_Group {
756
  $order = bp_esc_sql_order( $order );
757
 
758
  // Convert 'orderby' into the proper ORDER BY term
759
- $orderby = self::convert_orderby_to_order_by_term( $orderby );
760
 
761
  // Random order is a special case
762
  if ( 'rand()' === $orderby ) {
@@ -765,7 +765,7 @@ class BP_Groups_Group {
765
  $sql[] = "ORDER BY {$orderby} {$order}";
766
  }
767
 
768
- if ( ! empty( $r['per_page'] ) && ! empty( $r['page'] ) ) {
769
  $sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['per_page']), intval( $r['per_page'] ) );
770
  }
771
 
@@ -784,7 +784,7 @@ class BP_Groups_Group {
784
  }
785
 
786
  if ( ! empty( $sql['search'] ) ) {
787
- $total_sql['where'][] = "( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
788
  }
789
 
790
  if ( ! empty( $r['user_id'] ) ) {
@@ -891,15 +891,8 @@ class BP_Groups_Group {
891
  preg_match_all( '/ON \((.*)\)/', $meta_sql['join'], $matches_b );
892
 
893
  if ( ! empty( $matches_a[1] ) && ! empty( $matches_b[1] ) ) {
894
- $sql_array['join'] = implode( ',', $matches_a[1] ). ', ';
895
-
896
- $sql_array['where'] = '';
897
-
898
- $meta_query_where_clauses = explode( "\n", $meta_sql['where'] );
899
- foreach( $matches_b[1] as $key => $group_id_clause ) {
900
- $sql_array['where'] .= ' ' . preg_replace( '/^(AND\s+[\(\s]+)/', '$1' . $group_id_clause . ' AND ', ltrim( $meta_query_where_clauses[ $key ] ) );
901
- }
902
-
903
  }
904
  }
905
 
@@ -1025,8 +1018,8 @@ class BP_Groups_Group {
1025
  $hidden_sql = " AND g.status != 'hidden'";
1026
 
1027
  if ( !empty( $search_terms ) ) {
1028
- $search_terms = esc_sql( like_escape( $search_terms ) );
1029
- $search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
1030
  }
1031
 
1032
  if ( !empty( $exclude ) ) {
@@ -1089,8 +1082,8 @@ class BP_Groups_Group {
1089
  $hidden_sql = " AND g.status != 'hidden'";
1090
 
1091
  if ( !empty( $search_terms ) ) {
1092
- $search_terms = esc_sql( like_escape( $search_terms ) );
1093
- $search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
1094
  }
1095
 
1096
  if ( !empty( $exclude ) ) {
@@ -1160,15 +1153,15 @@ class BP_Groups_Group {
1160
  if ( !bp_current_user_can( 'bp_moderate' ) )
1161
  $hidden_sql = " AND status != 'hidden'";
1162
 
1163
- $letter = esc_sql( like_escape( $letter ) );
1164
 
1165
  if ( !empty( $limit ) && !empty( $page ) ) {
1166
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
1167
  }
1168
 
1169
- $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}" );
1170
 
1171
- $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}" );
1172
 
1173
  if ( !empty( $populate_extras ) ) {
1174
  foreach ( (array) $paged_groups as $group ) {
@@ -1216,8 +1209,8 @@ class BP_Groups_Group {
1216
  $hidden_sql = "AND g.status != 'hidden'";
1217
 
1218
  if ( !empty( $search_terms ) ) {
1219
- $search_terms = esc_sql( like_escape( $search_terms ) );
1220
- $search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
1221
  }
1222
 
1223
  if ( !empty( $exclude ) ) {
@@ -1433,8 +1426,8 @@ class BP_Groups_Group {
1433
  $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
1434
 
1435
  if ( !empty( $search_terms ) ) {
1436
- $st = esc_sql( like_escape( $search_terms ) );
1437
- $sql['where'] .= " AND ( t.topic_title LIKE '%{$st}%' )";
1438
  }
1439
 
1440
  return $wpdb->get_var( implode( ' ', $sql ) );
@@ -1707,11 +1700,20 @@ class BP_Group_Member_Query extends BP_User_Query {
1707
  $gm_ids = array( 0 );
1708
  }
1709
 
1710
- // For 'last_joined' and 'first_joined' types, we force
1711
- // the order according to the query performed in
1712
- // BP_Group_Member_Query::get_group_members(). Otherwise, fall
1713
- // through and let BP_User_Query do its own ordering.
1714
- if ( in_array( $query->query_vars['type'], array( 'last_joined', 'first_joined' ) ) ) {
 
 
 
 
 
 
 
 
 
1715
 
1716
  // The first param in the FIELD() clause is the sort column id
1717
  $gm_ids = array_merge( array( 'u.id' ), wp_parse_id_list( $gm_ids ) );
@@ -1766,6 +1768,49 @@ class BP_Group_Member_Query extends BP_User_Query {
1766
  // Don't filter other BP_User_Query objects on the same page
1767
  remove_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
1768
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1769
  }
1770
 
1771
  /**
@@ -2205,21 +2250,23 @@ class BP_Groups_Member {
2205
  public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
2206
  global $wpdb, $bp;
2207
 
2208
- $pag_sql = $hidden_sql = $filter_sql = '';
 
 
2209
 
2210
  if ( !empty( $limit ) && !empty( $page ) )
2211
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
2212
 
2213
  if ( !empty( $filter ) ) {
2214
- $filter = esc_sql( like_escape( $filter ) );
2215
- $filter_sql = " AND ( g.name LIKE '%%{$filter}%%' OR g.description LIKE '%%{$filter}%%' )";
2216
  }
2217
 
2218
  if ( $user_id != bp_loggedin_user_id() )
2219
  $hidden_sql = " AND g.status != 'hidden'";
2220
 
2221
- $paged_groups = $wpdb->get_results( $wpdb->prepare( "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_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY m.date_modified DESC {$pag_sql}", $user_id ) );
2222
- $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY m.date_modified DESC", $user_id ) );
2223
 
2224
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
2225
  }
@@ -2242,21 +2289,23 @@ class BP_Groups_Member {
2242
  public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
2243
  global $wpdb, $bp;
2244
 
2245
- $pag_sql = $hidden_sql = $filter_sql = '';
 
 
2246
 
2247
  if ( !empty( $limit ) && !empty( $page ) )
2248
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
2249
 
2250
  if ( !empty( $filter ) ) {
2251
- $filter = esc_sql( like_escape( $filter ) );
2252
- $filter_sql = " AND ( g.name LIKE '%%{$filter}%%' OR g.description LIKE '%%{$filter}%%' )";
2253
  }
2254
 
2255
  if ( $user_id != bp_loggedin_user_id() )
2256
  $hidden_sql = " AND g.status != 'hidden'";
2257
 
2258
- $paged_groups = $wpdb->get_results( $wpdb->prepare( "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_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
2259
- $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY date_modified ASC", $user_id ) );
2260
 
2261
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
2262
  }
@@ -2279,21 +2328,23 @@ class BP_Groups_Member {
2279
  public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
2280
  global $wpdb, $bp;
2281
 
2282
- $pag_sql = $hidden_sql = $filter_sql = '';
 
 
2283
 
2284
  if ( !empty( $limit ) && !empty( $page ) )
2285
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
2286
 
2287
  if ( !empty( $filter ) ) {
2288
- $filter = esc_sql( like_escape( $filter ) );
2289
- $filter_sql = " AND ( g.name LIKE '%%{$filter}%%' OR g.description LIKE '%%{$filter}%%' )";
2290
  }
2291
 
2292
  if ( $user_id != bp_loggedin_user_id() )
2293
  $hidden_sql = " AND g.status != 'hidden'";
2294
 
2295
- $paged_groups = $wpdb->get_results( $wpdb->prepare( "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_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
2296
- $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY date_modified ASC", $user_id ) );
2297
 
2298
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
2299
  }
@@ -2570,7 +2621,15 @@ class BP_Groups_Member {
2570
  public static function get_group_administrator_ids( $group_id ) {
2571
  global $bp, $wpdb;
2572
 
2573
- return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) );
 
 
 
 
 
 
 
 
2574
  }
2575
 
2576
  /**
@@ -2809,6 +2868,14 @@ class BP_Group_Extension {
2809
  */
2810
  public $params = array();
2811
 
 
 
 
 
 
 
 
 
2812
  /**
2813
  * The ID of the current group.
2814
  *
@@ -2852,6 +2919,22 @@ class BP_Group_Extension {
2852
  */
2853
  public $enable_nav_item = true;
2854
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2855
  /**
2856
  * The text of the nav item. Defaults to self::name.
2857
  *
@@ -2906,6 +2989,14 @@ class BP_Group_Extension {
2906
  */
2907
  protected $legacy_properties_converted = array();
2908
 
 
 
 
 
 
 
 
 
2909
  /**
2910
  * Miscellaneous data as set by the __set() magic method.
2911
  *
@@ -2990,6 +3081,8 @@ class BP_Group_Extension {
2990
  * }
2991
  */
2992
  public function init( $args = array() ) {
 
 
2993
 
2994
  // Before this init() method was introduced, plugins were
2995
  // encouraged to set their config directly. For backward
@@ -3010,6 +3103,8 @@ class BP_Group_Extension {
3010
  'display_hook' => $this->display_hook,
3011
  'template_file' => $this->template_file,
3012
  'screens' => $this->get_default_screens(),
 
 
3013
  ) );
3014
 
3015
  $this->initialized = true;
@@ -3053,6 +3148,9 @@ class BP_Group_Extension {
3053
  // Configure 'screens': create, admin, and edit contexts
3054
  $this->setup_screens();
3055
 
 
 
 
3056
  // Mirror configuration data so it's accessible to plugins
3057
  // that look for it in its old locations
3058
  $this->setup_legacy_properties();
@@ -3171,6 +3269,148 @@ class BP_Group_Extension {
3171
  }
3172
  }
3173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3174
  /** Display ***********************************************************/
3175
 
3176
  /**
@@ -3185,25 +3425,31 @@ class BP_Group_Extension {
3185
  return;
3186
  }
3187
 
3188
- // Bail if the current user doesn't have access
3189
  if ( ( 'public' !== $this->visibility ) && ! buddypress()->groups->current_group->user_has_access ) {
3190
  return;
3191
  }
3192
 
3193
- if ( true === $this->enable_nav_item ) {
 
 
 
 
3194
  bp_core_new_subnav_item( array(
3195
  'name' => ! $this->nav_item_name ? $this->name : $this->nav_item_name,
3196
  'slug' => $this->slug,
3197
  'parent_slug' => bp_get_current_group_slug(),
3198
- 'parent_url' => bp_get_group_permalink( groups_get_current_group() ),
3199
  'position' => $this->nav_item_position,
3200
  'item_css_id' => 'nav-' . $this->slug,
3201
  'screen_function' => array( &$this, '_display_hook' ),
3202
- 'user_has_access' => $this->enable_nav_item
 
3203
  ) );
3204
 
3205
  // When we are viewing the extension display page, set the title and options title
3206
  if ( bp_is_current_action( $this->slug ) ) {
 
3207
  add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
3208
  add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
3209
  }
@@ -3223,6 +3469,69 @@ class BP_Group_Extension {
3223
  bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) );
3224
  }
3225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3226
  /** Create ************************************************************/
3227
 
3228
  /**
@@ -3377,7 +3686,24 @@ class BP_Group_Extension {
3377
  }
3378
 
3379
  $this->check_nonce( 'edit' );
 
 
 
 
 
 
3380
  call_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id );
 
 
 
 
 
 
 
 
 
 
 
3381
  }
3382
 
3383
  /**
@@ -3441,6 +3767,22 @@ class BP_Group_Extension {
3441
  return ! empty( $matches[0] );
3442
  }
3443
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3444
  /** Admin *************************************************************/
3445
 
3446
  /**
@@ -4006,3 +4348,134 @@ function bp_register_group_extension( $group_extension_class = '' ) {
4006
  add_action( "admin_init", array( &$extension, "_register" ) );
4007
  ' ), 11 );
4008
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  if ( empty( $user_id ) )
446
  $user_id = bp_displayed_user_id();
447
 
448
+ $search_terms_like = bp_esc_like( $filter ) . '%';
449
 
450
  $pag_sql = $order_sql = $hidden_sql = '';
451
 
460
 
461
  $gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
462
 
463
+ $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids}) {$pag_sql}", $search_terms_like, $search_terms_like ) );
464
+ $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids})", $search_terms_like, $search_terms_like ) );
465
 
466
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
467
  }
486
  public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
487
  global $wpdb, $bp;
488
 
489
+ $search_terms_like = '%' . bp_esc_like( $filter ) . '%';
490
 
491
  $pag_sql = $order_sql = $hidden_sql = '';
492
 
502
  if ( !bp_current_user_can( 'bp_moderate' ) )
503
  $hidden_sql = "AND status != 'hidden'";
504
 
505
+ $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) {$hidden_sql} {$order_sql} {$pag_sql}", $search_terms_like, $search_terms_like ) );
506
+ $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) {$hidden_sql}", $search_terms_like, $search_terms_like ) );
507
 
508
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
509
  }
702
  }
703
 
704
  if ( ! empty( $r['search_terms'] ) ) {
705
+ $search_terms_like = '%' . bp_esc_like( $r['search_terms'] ) . '%';
706
+ $sql['search'] = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
707
  }
708
 
709
  $meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
738
  // If a 'type' parameter was passed, parse it and overwrite
739
  // 'order' and 'orderby' params passed to the function
740
  if ( ! empty( $r['type'] ) ) {
741
+ $order_orderby = apply_filters( 'bp_groups_get_orderby', self::convert_type_to_order_orderby( $r['type'] ), $r['type'] );
742
 
743
  // If an invalid type is passed, $order_orderby will be
744
  // an array with empty values. In this case, we stick
756
  $order = bp_esc_sql_order( $order );
757
 
758
  // Convert 'orderby' into the proper ORDER BY term
759
+ $orderby = apply_filters( 'bp_groups_get_orderby_converted_by_term', self::convert_orderby_to_order_by_term( $orderby ), $orderby, $r['type'] );
760
 
761
  // Random order is a special case
762
  if ( 'rand()' === $orderby ) {
765
  $sql[] = "ORDER BY {$orderby} {$order}";
766
  }
767
 
768
+ if ( ! empty( $r['per_page'] ) && ! empty( $r['page'] ) && $r['per_page'] != -1 ) {
769
  $sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['per_page']), intval( $r['per_page'] ) );
770
  }
771
 
784
  }
785
 
786
  if ( ! empty( $sql['search'] ) ) {
787
+ $total_sql['where'][] = $wpdb->prepare( "( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
788
  }
789
 
790
  if ( ! empty( $r['user_id'] ) ) {
891
  preg_match_all( '/ON \((.*)\)/', $meta_sql['join'], $matches_b );
892
 
893
  if ( ! empty( $matches_a[1] ) && ! empty( $matches_b[1] ) ) {
894
+ $sql_array['join'] = implode( ',', $matches_a[1] ) . ', ';
895
+ $sql_array['where'] = $meta_sql['where'] . ' AND ' . implode ( ' AND ', $matches_b[1] );
 
 
 
 
 
 
 
896
  }
897
  }
898
 
1018
  $hidden_sql = " AND g.status != 'hidden'";
1019
 
1020
  if ( !empty( $search_terms ) ) {
1021
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
1022
+ $search_sql = $wpdb->prepare( ' AND ( g.name LIKE %s OR g.description LIKE %s ) ', $search_terms_like, $search_terms_like );
1023
  }
1024
 
1025
  if ( !empty( $exclude ) ) {
1082
  $hidden_sql = " AND g.status != 'hidden'";
1083
 
1084
  if ( !empty( $search_terms ) ) {
1085
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
1086
+ $search_sql = $wpdb->prepare( ' AND ( g.name LIKE %s OR g.description LIKE %s ) ', $search_terms_like, $search_terms_like );
1087
  }
1088
 
1089
  if ( !empty( $exclude ) ) {
1153
  if ( !bp_current_user_can( 'bp_moderate' ) )
1154
  $hidden_sql = " AND status != 'hidden'";
1155
 
1156
+ $letter_like = bp_esc_like( $letter ) . '%';
1157
 
1158
  if ( !empty( $limit ) && !empty( $page ) ) {
1159
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
1160
  }
1161
 
1162
+ $total_groups = $wpdb->get_var( $wpdb->prepare( "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 %s {$hidden_sql} {$exclude_sql}", $letter_like ) );
1163
 
1164
+ $paged_groups = $wpdb->get_results( $wpdb->prepare( "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 %s {$hidden_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}", $letter_like ) );
1165
 
1166
  if ( !empty( $populate_extras ) ) {
1167
  foreach ( (array) $paged_groups as $group ) {
1209
  $hidden_sql = "AND g.status != 'hidden'";
1210
 
1211
  if ( !empty( $search_terms ) ) {
1212
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
1213
+ $search_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
1214
  }
1215
 
1216
  if ( !empty( $exclude ) ) {
1426
  $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
1427
 
1428
  if ( !empty( $search_terms ) ) {
1429
+ $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
1430
+ $sql['where'] .= $wpdb->prepare( " AND ( t.topic_title LIKE %s )", $search_terms_like );
1431
  }
1432
 
1433
  return $wpdb->get_var( implode( ' ', $sql ) );
1700
  $gm_ids = array( 0 );
1701
  }
1702
 
1703
+ // For 'last_joined', 'first_joined', and 'group_activity'
1704
+ // types, we override the default orderby clause of
1705
+ // BP_User_Query. In the case of 'group_activity', we perform
1706
+ // a separate query to get the necessary order. In the case of
1707
+ // 'last_joined' and 'first_joined', we can trust the order of
1708
+ // results from BP_Group_Member_Query::get_group_members().
1709
+ // In all other cases, we fall through and let BP_User_Query
1710
+ // do its own (non-group-specific) ordering.
1711
+ if ( in_array( $query->query_vars['type'], array( 'last_joined', 'first_joined', 'group_activity' ) ) ) {
1712
+
1713
+ // Group Activity DESC
1714
+ if ( 'group_activity' == $query->query_vars['type'] ) {
1715
+ $gm_ids = $this->get_gm_ids_ordered_by_activity( $query, $gm_ids );
1716
+ }
1717
 
1718
  // The first param in the FIELD() clause is the sort column id
1719
  $gm_ids = array_merge( array( 'u.id' ), wp_parse_id_list( $gm_ids ) );
1768
  // Don't filter other BP_User_Query objects on the same page
1769
  remove_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
1770
  }
1771
+
1772
+ /**
1773
+ * Sort user IDs by how recently they have generated activity within a given group.
1774
+ *
1775
+ * @since BuddyPress (2.1.0)
1776
+ *
1777
+ * @param BP_User_Query $query BP_User_Query object.
1778
+ * @param array $gm_ids array of group member ids.
1779
+ * @return array
1780
+ */
1781
+ public function get_gm_ids_ordered_by_activity( $query, $gm_ids = array() ) {
1782
+ global $wpdb;
1783
+
1784
+ if ( empty( $gm_ids ) ) {
1785
+ return $gm_ids;
1786
+ }
1787
+
1788
+ if ( ! bp_is_active( 'activity' ) ) {
1789
+ return $gm_ids;
1790
+ }
1791
+
1792
+ $activity_table = buddypress()->activity->table_name;
1793
+
1794
+ $sql = array(
1795
+ 'select' => "SELECT user_id, max( date_recorded ) as date_recorded FROM {$activity_table}",
1796
+ 'where' => array(),
1797
+ 'groupby' => 'GROUP BY user_id',
1798
+ 'orderby' => 'ORDER BY date_recorded',
1799
+ 'order' => 'DESC',
1800
+ );
1801
+
1802
+ $sql['where'] = array(
1803
+ 'user_id IN (' . implode( ',', wp_parse_id_list( $gm_ids ) ) . ')',
1804
+ 'item_id = ' . absint( $query->query_vars['group_id'] ),
1805
+ $wpdb->prepare( "component = %s", buddypress()->groups->id ),
1806
+ );
1807
+
1808
+ $sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] );
1809
+
1810
+ $group_user_ids = $wpdb->get_results( "{$sql['select']} {$sql['where']} {$sql['groupby']} {$sql['orderby']} {$sql['order']}" );
1811
+
1812
+ return wp_list_pluck( $group_user_ids, 'user_id' );
1813
+ }
1814
  }
1815
 
1816
  /**
2250
  public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
2251
  global $wpdb, $bp;
2252
 
2253
+ $user_id_sql = $pag_sql = $hidden_sql = $filter_sql = '';
2254
+
2255
+ $user_id_sql = $wpdb->prepare( 'm.user_id = %d', $user_id );
2256
 
2257
  if ( !empty( $limit ) && !empty( $page ) )
2258
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
2259
 
2260
  if ( !empty( $filter ) ) {
2261
+ $search_terms_like = '%' . bp_esc_like( $filter ) . '%';
2262
+ $filter_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
2263
  }
2264
 
2265
  if ( $user_id != bp_loggedin_user_id() )
2266
  $hidden_sql = " AND g.status != 'hidden'";
2267
 
2268
+ $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_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY m.date_modified DESC {$pag_sql}" );
2269
+ $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY m.date_modified DESC" );
2270
 
2271
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
2272
  }
2289
  public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
2290
  global $wpdb, $bp;
2291
 
2292
+ $user_id_sql = $pag_sql = $hidden_sql = $filter_sql = '';
2293
+
2294
+ $user_id_sql = $wpdb->prepare( 'm.user_id = %d', $user_id );
2295
 
2296
  if ( !empty( $limit ) && !empty( $page ) )
2297
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
2298
 
2299
  if ( !empty( $filter ) ) {
2300
+ $search_terms_like = '%' . bp_esc_like( $filter ) . '%';
2301
+ $filter_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
2302
  }
2303
 
2304
  if ( $user_id != bp_loggedin_user_id() )
2305
  $hidden_sql = " AND g.status != 'hidden'";
2306
 
2307
+ $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_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY m.date_modified ASC {$pag_sql}" );
2308
+ $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY date_modified ASC" );
2309
 
2310
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
2311
  }
2328
  public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
2329
  global $wpdb, $bp;
2330
 
2331
+ $user_id_sql = $pag_sql = $hidden_sql = $filter_sql = '';
2332
+
2333
+ $user_id_sql = $wpdb->prepare( 'm.user_id = %d', $user_id );
2334
 
2335
  if ( !empty( $limit ) && !empty( $page ) )
2336
  $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
2337
 
2338
  if ( !empty( $filter ) ) {
2339
+ $search_terms_like = '%' . bp_esc_like( $filter ) . '%';
2340
+ $filter_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
2341
  }
2342
 
2343
  if ( $user_id != bp_loggedin_user_id() )
2344
  $hidden_sql = " AND g.status != 'hidden'";
2345
 
2346
+ $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_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY m.date_modified ASC {$pag_sql}" );
2347
+ $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY date_modified ASC" );
2348
 
2349
  return array( 'groups' => $paged_groups, 'total' => $total_groups );
2350
  }
2621
  public static function get_group_administrator_ids( $group_id ) {
2622
  global $bp, $wpdb;
2623
 
2624
+ $group_admins = wp_cache_get( $group_id, 'bp_group_admins' );
2625
+
2626
+ if ( false === $group_admins ) {
2627
+ $group_admins = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) );
2628
+
2629
+ wp_cache_set( $group_id, $group_admins, 'bp_group_admins' );
2630
+ }
2631
+
2632
+ return $group_admins;
2633
  }
2634
 
2635
  /**
2868
  */
2869
  public $params = array();
2870
 
2871
+ /**
2872
+ * Raw config params, as passed by the extending class.
2873
+ *
2874
+ * @since BuddyPress (2.1.0)
2875
+ * @var array
2876
+ */
2877
+ public $params_raw = array();
2878
+
2879
  /**
2880
  * The ID of the current group.
2881
  *
2919
  */
2920
  public $enable_nav_item = true;
2921
 
2922
+ /**
2923
+ * Whether the current user should see the navigation item.
2924
+ *
2925
+ * @since BuddyPress (2.1.0)
2926
+ * @var bool
2927
+ */
2928
+ public $user_can_see_nav_item;
2929
+
2930
+ /**
2931
+ * Whether the current user can visit the tab.
2932
+ *
2933
+ * @since BuddyPress (2.1.0)
2934
+ * @var bool
2935
+ */
2936
+ public $user_can_visit;
2937
+
2938
  /**
2939
  * The text of the nav item. Defaults to self::name.
2940
  *
2989
  */
2990
  protected $legacy_properties_converted = array();
2991
 
2992
+ /**
2993
+ * Redirect location as defined by post-edit save callback.
2994
+ *
2995
+ * @since BuddyPress (2.1.0)
2996
+ * @var string
2997
+ */
2998
+ protected $post_save_redirect;
2999
+
3000
  /**
3001
  * Miscellaneous data as set by the __set() magic method.
3002
  *
3081
  * }
3082
  */
3083
  public function init( $args = array() ) {
3084
+ // Store the raw arguments
3085
+ $this->params_raw = $args;
3086
 
3087
  // Before this init() method was introduced, plugins were
3088
  // encouraged to set their config directly. For backward
3103
  'display_hook' => $this->display_hook,
3104
  'template_file' => $this->template_file,
3105
  'screens' => $this->get_default_screens(),
3106
+ 'access' => null,
3107
+ 'show_tab' => null,
3108
  ) );
3109
 
3110
  $this->initialized = true;
3148
  // Configure 'screens': create, admin, and edit contexts
3149
  $this->setup_screens();
3150
 
3151
+ // Configure access-related settings
3152
+ $this->setup_access_settings();
3153
+
3154
  // Mirror configuration data so it's accessible to plugins
3155
  // that look for it in its old locations
3156
  $this->setup_legacy_properties();
3269
  }
3270
  }
3271
 
3272
+ /**
3273
+ * Set up access-related settings for this extension.
3274
+ *
3275
+ * @since BuddyPress (2.1.0)
3276
+ */
3277
+ protected function setup_access_settings() {
3278
+ // Bail if no gruop ID is available
3279
+ if ( empty( $this->group_id ) ) {
3280
+ return;
3281
+ }
3282
+
3283
+ // Backward compatibility
3284
+ if ( isset( $this->params['enable_nav_item'] ) ) {
3285
+ $this->enable_nav_item = (bool) $this->params['enable_nav_item'];
3286
+ }
3287
+
3288
+ // Tab Access
3289
+ $this->user_can_visit = false;
3290
+
3291
+ // Backward compatibility for components that do not provide
3292
+ // explicit 'access' parameter
3293
+ if ( empty( $this->params['access'] ) ) {
3294
+ if ( false === $this->enable_nav_item ) {
3295
+ $this->params['access'] = 'noone';
3296
+ } else {
3297
+ $group = groups_get_group( array(
3298
+ 'group_id' => $this->group_id,
3299
+ ) );
3300
+
3301
+ if ( ! empty( $group->status ) && 'public' === $group->status ) {
3302
+ // Tabs in public groups are accessible to anyone by default
3303
+ $this->params['access'] = 'anyone';
3304
+ } else {
3305
+ // All other groups have members-only as the default
3306
+ $this->params['access'] = 'member';
3307
+ }
3308
+ }
3309
+ }
3310
+
3311
+ // Parse multiple access conditions into an array
3312
+ $access_conditions = $this->params['access'];
3313
+ if ( ! is_array( $access_conditions ) ) {
3314
+ $access_conditions = explode( ',', $access_conditions );
3315
+ }
3316
+
3317
+ // If the current user meets at least one condition, the
3318
+ // get access
3319
+ foreach ( $access_conditions as $access_condition ) {
3320
+ if ( $this->user_meets_access_condition( $access_condition ) ) {
3321
+ $this->user_can_visit = true;
3322
+ break;
3323
+ }
3324
+ }
3325
+
3326
+ // Tab Visibility
3327
+ $this->user_can_see_nav_item = false;
3328
+
3329
+ // Backward compatibility for components that do not provide
3330
+ // explicit 'show_tab' parameter
3331
+ if ( empty( $this->params['show_tab'] ) ) {
3332
+ if ( false === $this->params['enable_nav_item'] ) {
3333
+ // enable_nav_item is only false if it's been
3334
+ // defined explicitly as such in the
3335
+ // constructor. So we always trust this value
3336
+ $this->params['show_tab'] = 'noone';
3337
+
3338
+ } else if ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) {
3339
+ // If enable_nav_item or visibility is passed,
3340
+ // we assume this is a legacy extension.
3341
+ // Legacy behavior is that enable_nav_item=true +
3342
+ // visibility=private implies members-only
3343
+ if ( 'public' !== $this->visibility ) {
3344
+ $this->params['show_tab'] = 'member';
3345
+ } else {
3346
+ $this->params['show_tab'] = 'anyone';
3347
+ }
3348
+
3349
+ } else {
3350
+ // No show_tab or enable_nav_item value is
3351
+ // available, so match the value of 'access'
3352
+ $this->params['show_tab'] = $this->params['access'];
3353
+ }
3354
+ }
3355
+
3356
+ // Parse multiple access conditions into an array
3357
+ $access_conditions = $this->params['show_tab'];
3358
+ if ( ! is_array( $access_conditions ) ) {
3359
+ $access_conditions = explode( ',', $access_conditions );
3360
+ }
3361
+
3362
+ // If the current user meets at least one condition, the
3363
+ // get access
3364
+ foreach ( $access_conditions as $access_condition ) {
3365
+ if ( $this->user_meets_access_condition( $access_condition ) ) {
3366
+ $this->user_can_see_nav_item = true;
3367
+ break;
3368
+ }
3369
+ }
3370
+ }
3371
+
3372
+ /**
3373
+ * Check whether the current user meets an access condition.
3374
+ *
3375
+ * @param string $access_condition 'anyone', 'loggedin', 'member',
3376
+ * 'mod', 'admin' or 'noone'.
3377
+ * @return bool
3378
+ */
3379
+ protected function user_meets_access_condition( $access_condition ) {
3380
+ $group = groups_get_group( array(
3381
+ 'group_id' => $this->group_id,
3382
+ ) );
3383
+
3384
+ switch ( $access_condition ) {
3385
+ case 'admin' :
3386
+ $meets_condition = groups_is_user_admin( bp_loggedin_user_id(), $this->group_id );
3387
+ break;
3388
+
3389
+ case 'mod' :
3390
+ $meets_condition = groups_is_user_mod( bp_loggedin_user_id(), $this->group_id );
3391
+ break;
3392
+
3393
+ case 'member' :
3394
+ $meets_condition = groups_is_user_member( bp_loggedin_user_id(), $this->group_id );
3395
+ break;
3396
+
3397
+ case 'loggedin' :
3398
+ $meets_condition = is_user_logged_in();
3399
+ break;
3400
+
3401
+ case 'noone' :
3402
+ $meets_condition = false;
3403
+ break;
3404
+
3405
+ case 'anyone' :
3406
+ default :
3407
+ $meets_condition = true;
3408
+ break;
3409
+ }
3410
+
3411
+ return $meets_condition;
3412
+ }
3413
+
3414
  /** Display ***********************************************************/
3415
 
3416
  /**
3425
  return;
3426
  }
3427
 
3428
+ // Backward compatibility only
3429
  if ( ( 'public' !== $this->visibility ) && ! buddypress()->groups->current_group->user_has_access ) {
3430
  return;
3431
  }
3432
 
3433
+ $user_can_see_nav_item = $this->user_can_see_nav_item();
3434
+
3435
+ if ( $user_can_see_nav_item ) {
3436
+ $group_permalink = bp_get_group_permalink( groups_get_current_group() );
3437
+
3438
  bp_core_new_subnav_item( array(
3439
  'name' => ! $this->nav_item_name ? $this->name : $this->nav_item_name,
3440
  'slug' => $this->slug,
3441
  'parent_slug' => bp_get_current_group_slug(),
3442
+ 'parent_url' => $group_permalink,
3443
  'position' => $this->nav_item_position,
3444
  'item_css_id' => 'nav-' . $this->slug,
3445
  'screen_function' => array( &$this, '_display_hook' ),
3446
+ 'user_has_access' => $user_can_see_nav_item,
3447
+ 'no_access_url' => $group_permalink,
3448
  ) );
3449
 
3450
  // When we are viewing the extension display page, set the title and options title
3451
  if ( bp_is_current_action( $this->slug ) ) {
3452
+ add_filter( 'bp_group_user_has_access', array( $this, 'group_access_protection' ), 10, 2 );
3453
  add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
3454
  add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
3455
  }
3469
  bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) );
3470
  }
3471
 
3472
+ /**
3473
+ * Determine whether the current user should see this nav tab.
3474
+ *
3475
+ * Note that this controls only the display of the navigation item.
3476
+ * Access to the tab is controlled by the user_can_visit() check.
3477
+ *
3478
+ * @since BuddyPress (2.1.0)
3479
+ *
3480
+ * @return bool
3481
+ */
3482
+ public function user_can_see_nav_item( $user_can_see_nav_item = false ) {
3483
+ if ( 'noone' !== $this->params['show_tab'] && current_user_can( 'bp_moderate' ) ) {
3484
+ return true;
3485
+ }
3486
+
3487
+ return $this->user_can_see_nav_item;
3488
+ }
3489
+
3490
+ /**
3491
+ * Determine whether the current user has access to visit this tab.
3492
+ *
3493
+ * @since BuddyPress (2.1.0)
3494
+ *
3495
+ * @return bool
3496
+ */
3497
+ public function user_can_visit( $user_can_visit = false ) {
3498
+ if ( 'noone' !== $this->params['access'] && current_user_can( 'bp_moderate' ) ) {
3499
+ return true;
3500
+ }
3501
+
3502
+ return $this->user_can_visit;
3503
+ }
3504
+
3505
+ /**
3506
+ * Filter the access check in bp_groups_group_access_protection() for this extension.
3507
+ *
3508
+ * Note that $no_access_args is passed by reference, as there are some
3509
+ * circumstances where the bp_core_no_access() arguments need to be
3510
+ * modified before the redirect takes place.
3511
+ *
3512
+ * @since BuddyPress (2.1.0)
3513
+ *
3514
+ * @param bool $user_can_visit
3515
+ * @param array $no_access_args
3516
+ * @return bool
3517
+ */
3518
+ public function group_access_protection( $user_can_visit, &$no_access_args ) {
3519
+ $user_can_visit = $this->user_can_visit();
3520
+
3521
+ if ( ! $user_can_visit && is_user_logged_in() ) {
3522
+ $current_group = groups_get_group( array(
3523
+ 'group_id' => $this->group_id,
3524
+ ) );
3525
+
3526
+ $no_access_args['message'] = __( 'You do not have access to this content.', 'buddypress' );
3527
+ $no_access_args['root'] = bp_get_group_permalink( $current_group ) . 'home/';
3528
+ $no_access_args['redirect'] = false;
3529
+ }
3530
+
3531
+ return $user_can_visit;
3532
+ }
3533
+
3534
+
3535
  /** Create ************************************************************/
3536
 
3537
  /**
3686
  }
3687
 
3688
  $this->check_nonce( 'edit' );
3689
+
3690
+ // Detect whether the screen_save_callback is performing a
3691
+ // redirect, so that we don't do one of our own
3692
+ add_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) );
3693
+
3694
+ // Call the extension's save routine
3695
  call_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id );
3696
+
3697
+ // Clean up detection filters
3698
+ remove_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) );
3699
+
3700
+ // Perform a redirect only if one has not already taken place
3701
+ if ( empty( $this->post_save_redirect ) ) {
3702
+ $redirect_to = apply_filters( 'bp_group_extension_edit_screen_save_redirect', bp_get_requested_url( ) );
3703
+
3704
+ bp_core_redirect( $redirect_to );
3705
+ die();
3706
+ }
3707
  }
3708
 
3709
  /**
3767
  return ! empty( $matches[0] );
3768
  }
3769
 
3770
+ /**
3771
+ * Detect redirects hardcoded into edit_screen_save() callbacks.
3772
+ *
3773
+ * @since BuddyPress (2.1.0)
3774
+ *
3775
+ * @param string $location
3776
+ * @return string
3777
+ */
3778
+ public function detect_post_save_redirect( $redirect = '' ) {
3779
+ if ( ! empty( $redirect ) ) {
3780
+ $this->post_save_redirect = $redirect;
3781
+ }
3782
+
3783
+ return $redirect;
3784
+ }
3785
+
3786
  /** Admin *************************************************************/
3787
 
3788
  /**
4348
  add_action( "admin_init", array( &$extension, "_register" ) );
4349
  ' ), 11 );
4350
  }
4351
+
4352
+ /**
4353
+ * Adds support for user at-mentions (for users in a specific Group) to the Suggestions API.
4354
+ *
4355
+ * @since BuddyPress (2.1.0)
4356
+ */
4357
+ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions {
4358
+
4359
+ /**
4360
+ * Default arguments for this suggestions service.
4361
+ *
4362
+ * @since BuddyPress (2.1.0)
4363
+ * @var array $args {
4364
+ * @type int $group_id Positive integers will restrict the search to members in that group.
4365
+ * Negative integers will restrict the search to members in every other group.
4366
+ * @type int $limit Maximum number of results to display. Default: 16.
4367
+ * @type bool $only_friends If true, only match the current user's friends. Default: false.
4368
+ * @type string $term The suggestion service will try to find results that contain this string.
4369
+ * Mandatory.
4370
+ * }
4371
+ */
4372
+ protected $default_args = array(
4373
+ 'group_id' => 0,
4374
+ 'limit' => 16,
4375
+ 'only_friends' => false,
4376
+ 'term' => '',
4377
+ 'type' => '',
4378
+ );
4379
+
4380
+
4381
+ /**
4382
+ * Validate and sanitise the parameters for the suggestion service query.
4383
+ *
4384
+ * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
4385
+ * @since BuddyPress (2.1.0)
4386
+ */
4387
+ public function validate() {
4388
+ $this->args['group_id'] = (int) $this->args['group_id'];
4389
+ $this->args = apply_filters( 'bp_groups_member_suggestions_args', $this->args, $this );
4390
+
4391
+ // Check for invalid or missing mandatory parameters.
4392
+ if ( ! $this->args['group_id'] || ! bp_is_active( 'groups' ) ) {
4393
+ return new WP_Error( 'missing_requirement' );
4394
+ }
4395
+
4396
+ // Check that the specified group_id exists, and that the current user can access it.
4397
+ $the_group = groups_get_group( array(
4398
+ 'group_id' => absint( $this->args['group_id'] ),
4399
+ 'populate_extras' => true,
4400
+ ) );
4401
+
4402
+ if ( $the_group->id === 0 || ! $the_group->user_has_access ) {
4403
+ return new WP_Error( 'access_denied' );
4404
+ }
4405
+
4406
+ return apply_filters( 'bp_groups_member_suggestions_validate_args', parent::validate(), $this );
4407
+ }
4408
+
4409
+ /**
4410
+ * Find and return a list of username suggestions that match the query.
4411
+ *
4412
+ * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
4413
+ * @since BuddyPress (2.1.0)
4414
+ */
4415
+ public function get_suggestions() {
4416
+ $user_query = array(
4417
+ 'count_total' => '', // Prevents total count
4418
+ 'populate_extras' => false,
4419
+ 'type' => 'alphabetical',
4420
+
4421
+ 'group_role' => array( 'admin', 'member', 'mod' ),
4422
+ 'page' => 1,
4423
+ 'per_page' => $this->args['limit'],
4424
+ 'search_terms' => $this->args['term'],
4425
+ 'search_wildcard' => 'right',
4426
+ );
4427
+
4428
+ // Only return matches of friends of this user.
4429
+ if ( $this->args['only_friends'] && is_user_logged_in() ) {
4430
+ $user_query['user_id'] = get_current_user_id();
4431
+ }
4432
+
4433
+ // Positive Group IDs will restrict the search to members in that group.
4434
+ if ( $this->args['group_id'] > 0 ) {
4435
+ $user_query['group_id'] = $this->args['group_id'];
4436
+
4437
+ // Negative Group IDs will restrict the search to members in every other group.
4438
+ } else {
4439
+ $group_query = array(
4440
+ 'count_total' => '', // Prevents total count
4441
+ 'populate_extras' => false,
4442
+ 'type' => 'alphabetical',
4443
+
4444
+ 'group_id' => absint( $this->args['group_id'] ),
4445
+ 'group_role' => array( 'admin', 'member', 'mod' ),
4446
+ 'page' => 1,
4447
+ );
4448
+ $group_users = new BP_Group_Member_Query( $group_query );
4449
+
4450
+ if ( $group_users->results ) {
4451
+ $user_query['exclude'] = wp_list_pluck( $group_users->results, 'ID' );
4452
+ } else {
4453
+ $user_query['include'] = array( 0 );
4454
+ }
4455
+ }
4456
+
4457
+ $user_query = apply_filters( 'bp_groups_member_suggestions_query_args', $user_query, $this );
4458
+ if ( is_wp_error( $user_query ) ) {
4459
+ return $user_query;
4460
+ }
4461
+
4462
+
4463
+ if ( isset( $user_query['group_id'] ) ) {
4464
+ $user_query = new BP_Group_Member_Query( $user_query );
4465
+ } else {
4466
+ $user_query = new BP_User_Query( $user_query );
4467
+ }
4468
+
4469
+ $results = array();
4470
+ foreach ( $user_query->results as $user ) {
4471
+ $result = new stdClass();
4472
+ $result->ID = $user->user_nicename;
4473
+ $result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
4474
+ $result->name = bp_core_get_user_displayname( $user->ID );
4475
+
4476
+ $results[] = $result;
4477
+ }
4478
+
4479
+ return apply_filters( 'bp_groups_member_suggestions_get_suggestions', $results, $this );
4480
+ }
4481
+ }
bp-groups/bp-groups-filters.php CHANGED
@@ -33,12 +33,12 @@ add_filter( 'bp_get_group_description_excerpt', 'wpautop' );
33
  add_filter( 'bp_get_group_description', 'make_clickable', 9 );
34
  add_filter( 'bp_get_group_description_excerpt', 'make_clickable', 9 );
35
 
36
- add_filter( 'bp_get_group_name', 'wp_filter_kses', 1 );
37
- add_filter( 'bp_get_group_permalink', 'wp_filter_kses', 1 );
38
  add_filter( 'bp_get_group_description', 'bp_groups_filter_kses', 1 );
39
- add_filter( 'bp_get_group_description_excerpt', 'wp_filter_kses', 1 );
40
- add_filter( 'groups_group_name_before_save', 'wp_filter_kses', 1 );
41
- add_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
42
 
43
  add_filter( 'bp_get_group_description', 'stripslashes' );
44
  add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
@@ -65,23 +65,49 @@ add_filter( 'bp_get_total_group_count', 'bp_core_number_format' );
65
  add_filter( 'bp_get_group_total_for_member', 'bp_core_number_format' );
66
  add_filter( 'bp_get_group_total_members', 'bp_core_number_format' );
67
 
68
- function bp_groups_filter_kses( $content ) {
69
- global $allowedtags;
70
-
71
- $groups_allowedtags = $allowedtags;
72
- $groups_allowedtags['a']['class'] = array();
73
- $groups_allowedtags['img'] = array();
74
- $groups_allowedtags['img']['src'] = array();
75
- $groups_allowedtags['img']['alt'] = array();
76
- $groups_allowedtags['img']['class'] = array();
77
- $groups_allowedtags['img']['width'] = array();
78
- $groups_allowedtags['img']['height'] = array();
79
- $groups_allowedtags['img']['class'] = array();
80
- $groups_allowedtags['img']['id'] = array();
81
- $groups_allowedtags['code'] = array();
82
- $groups_allowedtags = apply_filters( 'bp_groups_filter_kses', $groups_allowedtags );
83
-
84
- return wp_kses( $content, $groups_allowedtags );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  /** Group forums **************************************************************/
33
  add_filter( 'bp_get_group_description', 'make_clickable', 9 );
34
  add_filter( 'bp_get_group_description_excerpt', 'make_clickable', 9 );
35
 
36
+ add_filter( 'bp_get_group_name', 'wp_filter_kses', 1 );
37
+ add_filter( 'bp_get_group_permalink', 'wp_filter_kses', 1 );
38
  add_filter( 'bp_get_group_description', 'bp_groups_filter_kses', 1 );
39
+ add_filter( 'bp_get_group_description_excerpt', 'wp_filter_kses', 1 );
40
+ add_filter( 'groups_group_name_before_save', 'wp_filter_kses', 1 );
41
+ add_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
42
 
43
  add_filter( 'bp_get_group_description', 'stripslashes' );
44
  add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
65
  add_filter( 'bp_get_group_total_for_member', 'bp_core_number_format' );
66
  add_filter( 'bp_get_group_total_members', 'bp_core_number_format' );
67
 
68
+ /**
69
+ * Filter output of Group Description through WordPress's KSES API.
70
+ *
71
+ * @since BuddyPress (1.1.0)
72
+ *
73
+ * @param string $content
74
+ * @return string
75
+ */
76
+ function bp_groups_filter_kses( $content = '' ) {
77
+
78
+ /**
79
+ * Note that we don't immediately bail if $content is empty. This is because
80
+ * WordPress's KSES API calls several other filters that might be relevant
81
+ * to someone's workflow (like `pre_kses`)
82
+ */
83
+
84
+ // Get allowed tags using core WordPress API allowing third party plugins
85
+ // to target the specific `buddypress-groups` context.
86
+ $allowed_tags = wp_kses_allowed_html( 'buddypress-groups' );
87
+
88
+ // Add our own tags allowed in group descriptions
89
+ $allowed_tags['a']['class'] = array();
90
+ $allowed_tags['img'] = array();
91
+ $allowed_tags['img']['src'] = array();
92
+ $allowed_tags['img']['alt'] = array();
93
+ $allowed_tags['img']['class'] = array();
94
+ $allowed_tags['img']['width'] = array();
95
+ $allowed_tags['img']['height'] = array();
96
+ $allowed_tags['img']['class'] = array();
97
+ $allowed_tags['img']['id'] = array();
98
+ $allowed_tags['code'] = array();
99
+
100
+ /**
101
+ * Filter HTML elements allowed for a given context.
102
+ *
103
+ * @since BuddyPress (1.1.0)
104
+ *
105
+ * @param string $allowed_tags Allowed tags, attributes, and/or entities.
106
+ */
107
+ $tags = apply_filters( 'bp_groups_filter_kses', $allowed_tags );
108
+
109
+ // Return KSES'ed content, allowing the above tags
110
+ return wp_kses( $content, $tags );
111
  }
112
 
113
  /** Group forums **************************************************************/
bp-groups/bp-groups-forums.php CHANGED
@@ -24,23 +24,28 @@ if ( !defined( 'ABSPATH' ) ) exit;
24
  *
25
  * @param int $group_id The group ID that the new forum should be attached to
26
  * @param string $group_name The group name
27
- * @param string $group_description The group description
28
  *
29
  * @since BuddyPress (1.0)
30
  */
31
  function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) {
32
- global $bp;
33
 
34
- if ( empty( $group_id ) )
35
  $group_id = bp_get_current_group_id();
 
36
 
37
- if ( empty( $group_name ) )
38
  $group_name = bp_get_current_group_name();
 
39
 
40
- if ( empty( $group_desc ) )
41
- $group_desc = $bp->groups->current_group->description;
 
42
 
43
- $forum_id = bp_forums_new_forum( array( 'forum_name' => $group_name, 'forum_desc' => $group_desc ) );
 
 
 
44
 
45
  groups_update_groupmeta( $group_id, 'forum_id', $forum_id );
46
 
@@ -68,17 +73,16 @@ function groups_update_group_forum( $group_id ) {
68
  * 3. The built-in bbPress forums are not correctly installed (usually means they've been
69
  * uninstalled)
70
  */
71
- if ( empty( $group->enable_forum ) || !bp_is_active( 'forums' ) || ( function_exists( 'bp_forums_is_installed_correctly' ) && !bp_forums_is_installed_correctly() ) )
72
  return false;
 
73
 
74
- $args = array(
75
- 'forum_id' => groups_get_groupmeta( $group_id, 'forum_id' ),
76
- 'forum_name' => $group->name,
77
- 'forum_desc' => $group->description,
78
- 'forum_slug' => $group->slug
79
- );
80
-
81
- bp_forums_update_forum( apply_filters( 'groups_update_group_forum', $args ) );
82
  }
83
  add_action( 'groups_details_updated', 'groups_update_group_forum' );
84
 
@@ -95,38 +99,43 @@ add_action( 'groups_details_updated', 'groups_update_group_forum' );
95
  * @since BuddyPress (1.0)
96
  */
97
  function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
98
- if ( empty( $post_text ) )
99
  return false;
 
100
 
101
- $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
102
- $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
103
-
104
- if ( $post_id = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {
105
- $topic = bp_forums_get_topic_details( $topic_id );
 
106
 
107
- $activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<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>' );
108
- $activity_content = bp_create_excerpt( $post_text );
109
- $primary_link = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/';
110
 
111
- if ( $page )
112
- $primary_link .= "?topic_page=" . $page;
 
 
113
 
114
- // Record this in activity streams
115
- groups_record_activity( array(
116
- 'action' => apply_filters_ref_array( 'groups_activity_new_forum_post_action', array( $activity_action, $post_id, $post_text, &$topic ) ),
117
- 'content' => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_id, $post_text, &$topic ) ),
118
- 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" ),
119
- 'type' => 'new_forum_post',
120
- 'item_id' => bp_get_current_group_id(),
121
- 'secondary_item_id' => $post_id
122
- ) );
123
 
124
- do_action( 'groups_new_forum_topic_post', bp_get_current_group_id(), $post_id );
 
 
 
 
 
 
 
 
125
 
126
- return $post_id;
127
- }
128
 
129
- return false;
130
  }
131
 
132
  /**
@@ -146,33 +155,38 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
146
  if ( empty( $topic_title ) || empty( $topic_text ) )
147
  return false;
148
 
149
- $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
150
- $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
151
- $topic_tags = apply_filters( 'group_forum_topic_tags_before_save', $topic_tags );
152
- $forum_id = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id );
153
-
154
- if ( $topic_id = bp_forums_new_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_tags' => $topic_tags, 'forum_id' => $forum_id ) ) ) {
155
- $topic = bp_forums_get_topic_details( $topic_id );
156
-
157
- $activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<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>' );
158
- $activity_content = bp_create_excerpt( $topic_text );
159
-
160
- // Record this in activity streams
161
- groups_record_activity( array(
162
- 'action' => apply_filters_ref_array( 'groups_activity_new_forum_topic_action', array( $activity_action, $topic_text, &$topic ) ),
163
- 'content' => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
164
- 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
165
- 'type' => 'new_forum_topic',
166
- 'item_id' => bp_get_current_group_id(),
167
- 'secondary_item_id' => $topic->topic_id
168
- ) );
169
 
170
- do_action_ref_array( 'groups_new_forum_topic', array( bp_get_current_group_id(), &$topic ) );
 
 
171
 
172
- return $topic;
173
- }
 
 
 
 
 
 
 
 
 
174
 
175
- return false;
176
  }
177
 
178
  /**
@@ -189,45 +203,50 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
189
  * @since BuddyPress (1.1)
190
  */
191
  function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
192
- global $bp;
193
 
194
  $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
195
  $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
 
 
 
 
 
 
 
 
 
 
196
 
197
- if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id, 'topic_tags' => $topic_tags ) ) ) {
198
-
199
- // Get the corresponding activity item
200
- if ( bp_is_active( 'activity' ) ) {
201
- $id = bp_activity_get_activity_id( array(
202
- 'item_id' => bp_get_current_group_id(),
203
- 'secondary_item_id' => $topic_id,
204
- 'component' => $bp->groups->id,
205
- 'type' => 'new_forum_topic'
206
- ) );
207
- }
208
-
209
- $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>' );
210
- $activity_content = bp_create_excerpt( $topic_text );
211
-
212
- // Record this in activity streams
213
- groups_record_activity( array(
214
- 'id' => $id,
215
- 'action' => apply_filters_ref_array( 'groups_activity_new_forum_topic_action', array( $activity_action, $topic_text, &$topic ) ),
216
- 'content' => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
217
- 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
218
- 'type' => 'new_forum_topic',
219
- 'item_id' => (int) bp_get_current_group_id(),
220
- 'user_id' => (int) $topic->topic_poster,
221
- 'secondary_item_id' => $topic->topic_id,
222
- 'recorded_time ' => $topic->topic_time
223
  ) );
224
-
225
- do_action_ref_array( 'groups_update_group_forum_topic', array( &$topic ) );
226
-
227
- return $topic;
228
  }
229
 
230
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  }
232
 
233
  /**
@@ -244,52 +263,59 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
244
  * @since BuddyPress (1.1)
245
  */
246
  function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
247
- global $bp;
248
 
249
  $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
250
  $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
251
  $post = bp_forums_get_post( $post_id );
 
 
 
 
 
 
 
 
 
 
 
252
 
253
- if ( $post_id = bp_forums_insert_post( array( 'post_id' => $post_id, 'post_text' => $post_text, 'post_time' => $post->post_time, 'topic_id' => $topic_id, 'poster_id' => $post->poster_id ) ) ) {
254
- $topic = bp_forums_get_topic_details( $topic_id );
255
-
256
- $activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<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>' );
257
- $activity_content = bp_create_excerpt( $post_text );
258
- $primary_link = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/';
259
-
260
- if ( $page )
261
- $primary_link .= "?topic_page=" . $page;
262
 
263
- // Get the corresponding activity item
264
- if ( bp_is_active( 'activity' ) ) {
265
- $id = bp_activity_get_activity_id( array(
266
- 'user_id' => $post->poster_id,
267
- 'component' => $bp->groups->id,
268
- 'type' => 'new_forum_post',
269
- 'item_id' => bp_get_current_group_id(),
270
- 'secondary_item_id' => $post_id
271
- ) );
272
- }
273
 
274
- // Update the entry in activity streams
275
- groups_record_activity( array(
276
- 'id' => $id,
277
- 'action' => apply_filters_ref_array( 'groups_activity_new_forum_post_action', array( $activity_action, $post_text, &$topic, &$topic ) ),
278
- 'content' => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_text, &$topic, &$topic ) ),
279
- 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id ),
280
  'type' => 'new_forum_post',
281
- 'item_id' => (int) bp_get_current_group_id(),
282
- 'user_id' => (int) $post->poster_id,
283
- 'secondary_item_id' => $post_id,
284
- 'recorded_time' => $post->post_time
285
- ) );
286
-
287
- do_action_ref_array( 'groups_update_group_forum_post', array( $post, &$topic ) );
288
-
289
- return $post_id;
290
  }
291
 
292
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  }
294
 
295
  /**
@@ -308,16 +334,18 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
308
  * @since BuddyPress (1.1)
309
  */
310
  function groups_delete_group_forum_topic( $topic_id ) {
311
- global $bp;
312
 
313
  // Before deleting the thread, get the post ids so that their activity items can be deleted
314
- $posts = bp_forums_get_topic_posts( array( 'topic_id' => $topic_id, 'per_page' => -1 ) );
 
315
 
316
- if ( bp_forums_delete_topic( array( 'topic_id' => $topic_id ) ) ) {
317
  do_action( 'groups_before_delete_group_forum_topic', $topic_id );
318
 
319
  // Delete the corresponding activity stream items
320
  if ( bp_is_active( 'activity' ) ) {
 
321
  // The activity item for the initial topic
322
  bp_activity_delete( array(
323
  'item_id' => bp_get_current_group_id(),
@@ -338,11 +366,9 @@ function groups_delete_group_forum_topic( $topic_id ) {
338
  }
339
 
340
  do_action( 'groups_delete_group_forum_topic', $topic_id );
341
-
342
- return true;
343
  }
344
 
345
- return false;
346
  }
347
 
348
  /**
@@ -353,33 +379,34 @@ function groups_delete_group_forum_topic( $topic_id ) {
353
  * @package BuddyPress
354
  *
355
  * @param int $post_id The id of the post you want to delete
356
- * @param int $topic_id Optional. The topic to which the post belongs. This value isn't used in the
357
- * function but is passed along to do_action() hooks.
 
358
  * @return bool True on success.
359
  *
360
  * @since BuddyPress (1.1)
361
  */
362
  function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
363
- global $bp;
364
 
365
- if ( bp_forums_delete_post( array( 'post_id' => $post_id ) ) ) {
 
 
366
  do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
367
 
368
  // Delete the corresponding activity stream item
369
- if ( bp_is_active( 'activity' ) )
370
  bp_activity_delete( array(
371
  'item_id' => bp_get_current_group_id(),
372
  'secondary_item_id' => $post_id,
373
- 'component' => $bp->groups->id,
374
  'type' => 'new_forum_post'
375
  ) );
 
376
 
377
  do_action( 'groups_delete_group_forum_post', $post_id, $topic_id );
378
-
379
- return true;
380
  }
381
 
382
- return false;
383
  }
384
 
385
  /**
24
  *
25
  * @param int $group_id The group ID that the new forum should be attached to
26
  * @param string $group_name The group name
27
+ * @param string $group_desc The group description
28
  *
29
  * @since BuddyPress (1.0)
30
  */
31
  function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) {
 
32
 
33
+ if ( empty( $group_id ) ) {
34
  $group_id = bp_get_current_group_id();
35
+ }
36
 
37
+ if ( empty( $group_name ) ) {
38
  $group_name = bp_get_current_group_name();
39
+ }
40
 
41
+ if ( empty( $group_desc ) ) {
42
+ $group_desc = bp_get_current_group_description();
43
+ }
44
 
45
+ $forum_id = bp_forums_new_forum( array(
46
+ 'forum_name' => $group_name,
47
+ 'forum_desc' => $group_desc
48
+ ) );
49
 
50
  groups_update_groupmeta( $group_id, 'forum_id', $forum_id );
51
 
73
  * 3. The built-in bbPress forums are not correctly installed (usually means they've been
74
  * uninstalled)
75
  */
76
+ if ( empty( $group->enable_forum ) || !bp_is_active( 'forums' ) || ( function_exists( 'bp_forums_is_installed_correctly' ) && !bp_forums_is_installed_correctly() ) ) {
77
  return false;
78
+ }
79
 
80
+ bp_forums_update_forum( apply_filters( 'groups_update_group_forum', array(
81
+ 'forum_id' => groups_get_groupmeta( $group_id, 'forum_id' ),
82
+ 'forum_name' => $group->name,
83
+ 'forum_desc' => $group->description,
84
+ 'forum_slug' => $group->slug
85
+ ) ) );
 
 
86
  }
87
  add_action( 'groups_details_updated', 'groups_update_group_forum' );
88
 
99
  * @since BuddyPress (1.0)
100
  */
101
  function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
102
+ if ( empty( $post_text ) ) {
103
  return false;
104
+ }
105
 
106
+ $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
107
+ $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
108
+ $post_id = bp_forums_insert_post( array(
109
+ 'post_text' => $post_text,
110
+ 'topic_id' => $topic_id
111
+ ) );
112
 
113
+ if ( empty( $post_id ) ) {
114
+ return false;
115
+ }
116
 
117
+ $topic = bp_forums_get_topic_details( $topic_id );
118
+ $activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<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>' );
119
+ $activity_content = bp_create_excerpt( $post_text );
120
+ $primary_link = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/';
121
 
122
+ if ( !empty( $page ) ) {
123
+ $primary_link .= "?topic_page=" . $page;
124
+ }
 
 
 
 
 
 
125
 
126
+ // Record this in activity streams
127
+ groups_record_activity( array(
128
+ 'action' => apply_filters_ref_array( 'groups_activity_new_forum_post_action', array( $activity_action, $post_id, $post_text, &$topic ) ),
129
+ 'content' => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_id, $post_text, &$topic ) ),
130
+ 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" ),
131
+ 'type' => 'new_forum_post',
132
+ 'item_id' => bp_get_current_group_id(),
133
+ 'secondary_item_id' => $post_id
134
+ ) );
135
 
136
+ do_action( 'groups_new_forum_topic_post', bp_get_current_group_id(), $post_id );
 
137
 
138
+ return $post_id;
139
  }
140
 
141
  /**
155
  if ( empty( $topic_title ) || empty( $topic_text ) )
156
  return false;
157
 
158
+ $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
159
+ $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
160
+ $topic_tags = apply_filters( 'group_forum_topic_tags_before_save', $topic_tags );
161
+ $forum_id = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id );
162
+ $topic_id = bp_forums_new_topic( array(
163
+ 'topic_title' => $topic_title,
164
+ 'topic_text' => $topic_text,
165
+ 'topic_tags' => $topic_tags,
166
+ 'forum_id' => $forum_id
167
+ ) );
168
+
169
+ if ( empty( $topic_id ) ) {
170
+ return false;
171
+ }
 
 
 
 
 
 
172
 
173
+ $topic = bp_forums_get_topic_details( $topic_id );
174
+ $activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<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>' );
175
+ $activity_content = bp_create_excerpt( $topic_text );
176
 
177
+ // Record this in activity streams
178
+ groups_record_activity( array(
179
+ 'action' => apply_filters_ref_array( 'groups_activity_new_forum_topic_action', array( $activity_action, $topic_text, &$topic ) ),
180
+ 'content' => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
181
+ 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
182
+ 'type' => 'new_forum_topic',
183
+ 'item_id' => bp_get_current_group_id(),
184
+ 'secondary_item_id' => $topic->topic_id
185
+ ) );
186
+
187
+ do_action_ref_array( 'groups_new_forum_topic', array( bp_get_current_group_id(), &$topic ) );
188
 
189
+ return $topic;
190
  }
191
 
192
  /**
203
  * @since BuddyPress (1.1)
204
  */
205
  function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
206
+ $bp = buddypress();
207
 
208
  $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
209
  $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
210
+ $topic = bp_forums_update_topic( array(
211
+ 'topic_title' => $topic_title,
212
+ 'topic_text' => $topic_text,
213
+ 'topic_id' => $topic_id,
214
+ 'topic_tags' => $topic_tags
215
+ ) );
216
+
217
+ if ( empty( $topic ) ) {
218
+ return false;
219
+ }
220
 
221
+ // Get the corresponding activity item
222
+ if ( bp_is_active( 'activity' ) ) {
223
+ $id = bp_activity_get_activity_id( array(
224
+ 'item_id' => bp_get_current_group_id(),
225
+ 'secondary_item_id' => $topic_id,
226
+ 'component' => $bp->groups->id,
227
+ 'type' => 'new_forum_topic'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  ) );
 
 
 
 
229
  }
230
 
231
+ $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>' );
232
+ $activity_content = bp_create_excerpt( $topic_text );
233
+
234
+ // Record this in activity streams
235
+ groups_record_activity( array(
236
+ 'id' => $id,
237
+ 'action' => apply_filters_ref_array( 'groups_activity_new_forum_topic_action', array( $activity_action, $topic_text, &$topic ) ),
238
+ 'content' => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
239
+ 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
240
+ 'type' => 'new_forum_topic',
241
+ 'item_id' => (int) bp_get_current_group_id(),
242
+ 'user_id' => (int) $topic->topic_poster,
243
+ 'secondary_item_id' => $topic->topic_id,
244
+ 'recorded_time ' => $topic->topic_time
245
+ ) );
246
+
247
+ do_action_ref_array( 'groups_update_group_forum_topic', array( &$topic ) );
248
+
249
+ return $topic;
250
  }
251
 
252
  /**
263
  * @since BuddyPress (1.1)
264
  */
265
  function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
266
+ $bp = buddypress();
267
 
268
  $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
269
  $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
270
  $post = bp_forums_get_post( $post_id );
271
+ $post_id = bp_forums_insert_post( array(
272
+ 'post_id' => $post_id,
273
+ 'post_text' => $post_text,
274
+ 'post_time' => $post->post_time,
275
+ 'topic_id' => $topic_id,
276
+ 'poster_id' => $post->poster_id
277
+ ) );
278
+
279
+ if ( empty( $post_id ) ) {
280
+ return false;
281
+ }
282
 
283
+ $topic = bp_forums_get_topic_details( $topic_id );
284
+ $activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<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>' );
285
+ $activity_content = bp_create_excerpt( $post_text );
286
+ $primary_link = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/';
 
 
 
 
 
287
 
288
+ if ( !empty( $page ) ) {
289
+ $primary_link .= "?topic_page=" . $page;
290
+ }
 
 
 
 
 
 
 
291
 
292
+ // Get the corresponding activity item
293
+ if ( bp_is_active( 'activity' ) ) {
294
+ $id = bp_activity_get_activity_id( array(
295
+ 'user_id' => $post->poster_id,
296
+ 'component' => $bp->groups->id,
 
297
  'type' => 'new_forum_post',
298
+ 'item_id' => bp_get_current_group_id(),
299
+ 'secondary_item_id' => $post_id
300
+ ) );
 
 
 
 
 
 
301
  }
302
 
303
+ // Update the entry in activity streams
304
+ groups_record_activity( array(
305
+ 'id' => $id,
306
+ 'action' => apply_filters_ref_array( 'groups_activity_new_forum_post_action', array( $activity_action, $post_text, &$topic, &$topic ) ),
307
+ 'content' => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_text, &$topic, &$topic ) ),
308
+ 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id ),
309
+ 'type' => 'new_forum_post',
310
+ 'item_id' => (int) bp_get_current_group_id(),
311
+ 'user_id' => (int) $post->poster_id,
312
+ 'secondary_item_id' => $post_id,
313
+ 'recorded_time' => $post->post_time
314
+ ) );
315
+
316
+ do_action_ref_array( 'groups_update_group_forum_post', array( $post, &$topic ) );
317
+
318
+ return $post_id;
319
  }
320
 
321
  /**
334
  * @since BuddyPress (1.1)
335
  */
336
  function groups_delete_group_forum_topic( $topic_id ) {
337
+ $bp = buddypress();
338
 
339
  // Before deleting the thread, get the post ids so that their activity items can be deleted
340
+ $posts = bp_forums_get_topic_posts( array( 'topic_id' => $topic_id, 'per_page' => -1 ) );
341
+ $action = bp_forums_delete_topic( array( 'topic_id' => $topic_id ) );
342
 
343
+ if ( !empty( $action ) ) {
344
  do_action( 'groups_before_delete_group_forum_topic', $topic_id );
345
 
346
  // Delete the corresponding activity stream items
347
  if ( bp_is_active( 'activity' ) ) {
348
+
349
  // The activity item for the initial topic
350
  bp_activity_delete( array(
351
  'item_id' => bp_get_current_group_id(),
366
  }
367
 
368
  do_action( 'groups_delete_group_forum_topic', $topic_id );
 
 
369
  }
370
 
371
+ return (bool) $action;
372
  }
373
 
374
  /**
379
  * @package BuddyPress
380
  *
381
  * @param int $post_id The id of the post you want to delete
382
+ * @param int $topic_id Optional. The topic to which the post belongs. This
383
+ * value isn't used in the function but is passed along to
384
+ * do_action() hooks.
385
  * @return bool True on success.
386
  *
387
  * @since BuddyPress (1.1)
388
  */
389
  function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
 
390
 
391
+ $action = bp_forums_delete_post( array( 'post_id' => $post_id ) );
392
+
393
+ if ( !empty( $action ) ) {
394
  do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
395
 
396
  // Delete the corresponding activity stream item
397
+ if ( bp_is_active( 'activity' ) ) {
398
  bp_activity_delete( array(
399
  'item_id' => bp_get_current_group_id(),
400
  'secondary_item_id' => $post_id,
401
+ 'component' => buddypress()->groups->id,
402
  'type' => 'new_forum_post'
403
  ) );
404
+ }
405
 
406
  do_action( 'groups_delete_group_forum_post', $post_id, $topic_id );
 
 
407
  }
408
 
409
+ return (bool) $action;
410
  }
411
 
412
  /**
bp-groups/bp-groups-functions.php CHANGED
@@ -305,7 +305,7 @@ function groups_leave_group( $group_id, $user_id = 0 ) {
305
  // Don't let single admins leave the group.
306
  if ( count( groups_get_group_admins( $group_id ) ) < 2 ) {
307
  if ( groups_is_user_admin( $user_id, $group_id ) ) {
308
- bp_core_add_message( __( 'As the only Admin, you cannot leave the group.', 'buddypress' ), 'error' );
309
  return false;
310
  }
311
  }
305
  // Don't let single admins leave the group.
306
  if ( count( groups_get_group_admins( $group_id ) ) < 2 ) {
307
  if ( groups_is_user_admin( $user_id, $group_id ) ) {
308
+ bp_core_add_message( __( 'As the only admin, you cannot leave the group.', 'buddypress' ), 'error' );
309
  return false;
310
  }
311
  }
bp-groups/bp-groups-loader.php CHANGED
@@ -80,7 +80,7 @@ class BP_Groups_Component extends BP_Component {
80
  public function __construct() {
81
  parent::start(
82
  'groups',
83
- __( 'User Groups', 'buddypress' ),
84
  buddypress()->plugin_dir,
85
  array(
86
  'adminbar_myaccount_order' => 70
@@ -102,7 +102,6 @@ class BP_Groups_Component extends BP_Component {
102
  'widgets',
103
  'activity',
104
  'template',
105
- 'buddybar',
106
  'adminbar',
107
  'functions',
108
  'notifications'
@@ -129,7 +128,7 @@ class BP_Groups_Component extends BP_Component {
129
  if ( !defined( 'BP_GROUPS_SLUG' ) )
130
  define( 'BP_GROUPS_SLUG', $this->id );
131
 
132
- // Global tables for messaging component
133
  $global_tables = array(
134
  'table_name' => $bp->table_prefix . 'bp_groups',
135
  'table_name_members' => $bp->table_prefix . 'bp_groups_members',
@@ -149,7 +148,7 @@ class BP_Groups_Component extends BP_Component {
149
  'has_directory' => true,
150
  'directory_title' => _x( 'Groups', 'component directory title', 'buddypress' ),
151
  'notification_callback' => 'groups_format_notifications',
152
- 'search_string' => __( 'Search Groups...', 'buddypress' ),
153
  'global_tables' => $global_tables,
154
  'meta_tables' => $meta_tables,
155
  );
@@ -241,91 +240,22 @@ class BP_Groups_Component extends BP_Component {
241
  return;
242
  }
243
 
244
- if ( bp_is_groups_component() && !empty( $this->current_group ) ) {
245
-
246
- $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
247
-
248
- if ( !bp_current_action() ) {
249
- $bp->current_action = $this->default_extension;
250
- }
251
-
252
- // Prepare for a redirect to the canonical URL
253
- $bp->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group );
254
-
255
- if ( bp_current_action() ) {
256
- $bp->canonical_stack['action'] = bp_current_action();
257
- }
258
-
259
- if ( !empty( $bp->action_variables ) ) {
260
- $bp->canonical_stack['action_variables'] = bp_action_variables();
261
- }
262
-
263
- // When viewing the default extension, the canonical URL should not have
264
- // that extension's slug, unless more has been tacked onto the URL via
265
- // action variables
266
- if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) {
267
- unset( $bp->canonical_stack['action'] );
268
- }
269
-
270
- }
271
-
272
- // Group access control
273
- if ( bp_is_groups_component() && !empty( $this->current_group ) ) {
274
- if ( !$this->current_group->user_has_access ) {
275
-
276
- // Hidden groups should return a 404 for non-members.
277
- // Unset the current group so that you're not redirected
278
- // to the default group tab
279
- if ( 'hidden' == $this->current_group->status ) {
280
- $this->current_group = 0;
281
- $bp->is_single_item = false;
282
- bp_do_404();
283
- return;
284
-
285
- // Skip the no_access check on home and membership request pages
286
- } elseif ( !bp_is_current_action( 'home' ) && !bp_is_current_action( 'request-membership' ) ) {
287
-
288
- // Off-limits to this user. Throw an error and redirect to the group's home page
289
- if ( is_user_logged_in() ) {
290
- bp_core_no_access( array(
291
- 'message' => __( 'You do not have access to this group.', 'buddypress' ),
292
- 'root' => bp_get_group_permalink( $bp->groups->current_group ) . 'home/',
293
- 'redirect' => false
294
- ) );
295
-
296
- // User does not have access, and does not get a message
297
- } else {
298
- bp_core_no_access();
299
- }
300
- }
301
- }
302
-
303
- // Protect the admin tab from non-admins
304
- if ( bp_is_current_action( 'admin' ) && !bp_is_item_admin() ) {
305
- bp_core_no_access( array(
306
- 'message' => __( 'You are not an admin of this group.', 'buddypress' ),
307
- 'root' => bp_get_group_permalink( $bp->groups->current_group ),
308
- 'redirect' => false
309
- ) );
310
- }
311
- }
312
-
313
  // Preconfigured group creation steps
314
  $this->group_creation_steps = apply_filters( 'groups_create_group_steps', array(
315
  'group-details' => array(
316
- 'name' => __( 'Details', 'buddypress' ),
317
  'position' => 0
318
  ),
319
  'group-settings' => array(
320
- 'name' => __( 'Settings', 'buddypress' ),
321
  'position' => 10
322
  )
323
  ) );
324
 
325
  // If avatar uploads are not disabled, add avatar option
326
- if ( ! (int) buddypress()->site_options['bp-disable-avatar-uploads'] ) {
327
  $this->group_creation_steps['group-avatar'] = array(
328
- 'name' => __( 'Avatar', 'buddypress' ),
329
  'position' => 20
330
  );
331
  }
@@ -333,7 +263,7 @@ class BP_Groups_Component extends BP_Component {
333
  // If friends component is active, add invitations
334
  if ( bp_is_active( 'friends' ) ) {
335
  $this->group_creation_steps['group-invites'] = array(
336
- 'name' => __( 'Invites', 'buddypress' ),
337
  'position' => 30
338
  );
339
  }
@@ -350,7 +280,47 @@ class BP_Groups_Component extends BP_Component {
350
  }
351
 
352
  /**
353
- * Setup BuddyBar navigation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  *
355
  * @global BuddyPress $bp The one true BuddyPress instance
356
  */
@@ -360,9 +330,9 @@ class BP_Groups_Component extends BP_Component {
360
  if ( bp_is_user() ) {
361
  $count = bp_get_total_group_count_for_user();
362
  $class = ( 0 === $count ) ? 'no-count' : 'count';
363
- $nav_name = sprintf( __( 'Groups <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) );
364
  } else {
365
- $nav_name = __( 'Groups', 'buddypress' );
366
  }
367
 
368
  // Add 'Groups' to the main navigation
@@ -431,7 +401,7 @@ class BP_Groups_Component extends BP_Component {
431
 
432
  // Add the "Home" subnav item, as this will always be present
433
  $sub_nav[] = array(
434
- 'name' => _x( 'Home', 'Group home navigation title', 'buddypress' ),
435
  'slug' => 'home',
436
  'parent_url' => $group_link,
437
  'parent_slug' => $this->current_group->slug,
@@ -451,7 +421,7 @@ class BP_Groups_Component extends BP_Component {
451
  ) {
452
 
453
  $sub_nav[] = array(
454
- 'name' => __( 'Request Membership', 'buddypress' ),
455
  'slug' => 'request-membership',
456
  'parent_url' => $group_link,
457
  'parent_slug' => $this->current_group->slug,
@@ -463,7 +433,7 @@ class BP_Groups_Component extends BP_Component {
463
  // Forums are enabled and turned on
464
  if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) {
465
  $sub_nav[] = array(
466
- 'name' => __( 'Forum', 'buddypress' ),
467
  'slug' => 'forum',
468
  'parent_url' => $group_link,
469
  'parent_slug' => $this->current_group->slug,
@@ -475,40 +445,43 @@ class BP_Groups_Component extends BP_Component {
475
  }
476
 
477
  $sub_nav[] = array(
478
- 'name' => sprintf( __( 'Members <span>%s</span>', 'buddypress' ), number_format( $this->current_group->total_member_count ) ),
479
  'slug' => 'members',
480
  'parent_url' => $group_link,
481
  'parent_slug' => $this->current_group->slug,
482
  'screen_function' => 'groups_screen_group_members',
483
  'position' => 60,
484
  'user_has_access' => $this->current_group->user_has_access,
485
- 'item_css_id' => 'members'
 
486
  );
487
 
488
  if ( bp_is_active( 'friends' ) && bp_groups_user_can_send_invites() ) {
489
  $sub_nav[] = array(
490
- 'name' => __( 'Send Invites', 'buddypress' ),
491
  'slug' => 'send-invites',
492
  'parent_url' => $group_link,
493
  'parent_slug' => $this->current_group->slug,
494
  'screen_function' => 'groups_screen_group_invite',
495
  'item_css_id' => 'invite',
496
  'position' => 70,
497
- 'user_has_access' => $this->current_group->user_has_access
 
498
  );
499
  }
500
 
501
  // If the user is a group admin, then show the group admin nav item
502
  if ( bp_is_item_admin() ) {
503
  $sub_nav[] = array(
504
- 'name' => __( 'Admin', 'buddypress' ),
505
  'slug' => 'admin',
506
  'parent_url' => $group_link,
507
  'parent_slug' => $this->current_group->slug,
508
  'screen_function' => 'groups_screen_group_admin',
509
  'position' => 1000,
510
  'user_has_access' => true,
511
- 'item_css_id' => 'admin'
 
512
  );
513
  }
514
 
@@ -537,12 +510,12 @@ class BP_Groups_Component extends BP_Component {
537
 
538
  // Pending group invites
539
  $count = groups_get_invite_count_for_user();
540
- $title = __( 'Groups', 'buddypress' );
541
- $pending = __( 'No Pending Invites', 'buddypress' );
542
 
543
  if ( !empty( $count['total'] ) ) {
544
- $title = sprintf( __( 'Groups <span class="count">%s</span>', 'buddypress' ), $count );
545
- $pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count );
546
  }
547
 
548
  // Add the "My Account" sub menus
@@ -557,7 +530,7 @@ class BP_Groups_Component extends BP_Component {
557
  $wp_admin_nav[] = array(
558
  'parent' => 'my-account-' . $this->id,
559
  'id' => 'my-account-' . $this->id . '-memberships',
560
- 'title' => __( 'Memberships', 'buddypress' ),
561
  'href' => trailingslashit( $groups_link )
562
  );
563
 
@@ -574,7 +547,7 @@ class BP_Groups_Component extends BP_Component {
574
  $wp_admin_nav[] = array(
575
  'parent' => 'my-account-' . $this->id,
576
  'id' => 'my-account-' . $this->id . '-create',
577
- 'title' => __( 'Create a Group', 'buddypress' ),
578
  'href' => trailingslashit( bp_get_groups_directory_permalink() . 'create' )
579
  );
580
  }
@@ -592,7 +565,7 @@ class BP_Groups_Component extends BP_Component {
592
  if ( bp_is_groups_component() ) {
593
 
594
  if ( bp_is_my_profile() && !bp_is_single_item() ) {
595
- $bp->bp_options_title = __( 'Memberships', 'buddypress' );
596
 
597
  } else if ( !bp_is_my_profile() && !bp_is_single_item() ) {
598
  $bp->bp_options_avatar = bp_core_fetch_avatar( array(
@@ -611,11 +584,11 @@ class BP_Groups_Component extends BP_Component {
611
  'object' => 'group',
612
  'type' => 'thumb',
613
  'avatar_dir' => 'group-avatars',
614
- 'alt' => __( 'Group Avatar', 'buddypress' )
615
  ) );
616
 
617
  if ( empty( $bp->bp_options_avatar ) ) {
618
- $bp->bp_options_avatar = '<img src="' . esc_url( bp_core_avatar_default_thumb() ) . '" alt="' . esc_attr__( 'No Group Avatar', 'buddypress' ) . '" class="avatar" />';
619
  }
620
  }
621
  }
80
  public function __construct() {
81
  parent::start(
82
  'groups',
83
+ _x( 'User Groups', 'Group screen page <title>', 'buddypress' ),
84
  buddypress()->plugin_dir,
85
  array(
86
  'adminbar_myaccount_order' => 70
102
  'widgets',
103
  'activity',
104
  'template',
 
105
  'adminbar',
106
  'functions',
107
  'notifications'
128
  if ( !defined( 'BP_GROUPS_SLUG' ) )
129
  define( 'BP_GROUPS_SLUG', $this->id );
130
 
131
+ // Global tables for groups component
132
  $global_tables = array(
133
  'table_name' => $bp->table_prefix . 'bp_groups',
134
  'table_name_members' => $bp->table_prefix . 'bp_groups_members',
148
  'has_directory' => true,
149
  'directory_title' => _x( 'Groups', 'component directory title', 'buddypress' ),
150
  'notification_callback' => 'groups_format_notifications',
151
+ 'search_string' => _x( 'Search Groups...', 'Component directory search', 'buddypress' ),
152
  'global_tables' => $global_tables,
153
  'meta_tables' => $meta_tables,
154
  );
240
  return;
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  // Preconfigured group creation steps
244
  $this->group_creation_steps = apply_filters( 'groups_create_group_steps', array(
245
  'group-details' => array(
246
+ 'name' => _x( 'Details', 'Group screen nav', 'buddypress' ),
247
  'position' => 0
248
  ),
249
  'group-settings' => array(
250
+ 'name' => _x( 'Settings', 'Group screen nav', 'buddypress' ),
251
  'position' => 10
252
  )
253
  ) );
254
 
255
  // If avatar uploads are not disabled, add avatar option
256
+ if ( ! (int) $bp->site_options['bp-disable-avatar-uploads'] && $bp->avatar->show_avatars ) {
257
  $this->group_creation_steps['group-avatar'] = array(
258
+ 'name' => _x( 'Photo', 'Group screen nav', 'buddypress' ),
259
  'position' => 20
260
  );
261
  }
263
  // If friends component is active, add invitations
264
  if ( bp_is_active( 'friends' ) ) {
265
  $this->group_creation_steps['group-invites'] = array(
266
+ 'name' => _x( 'Invites', 'Group screen nav', 'buddypress' ),
267
  'position' => 30
268
  );
269
  }
280
  }
281
 
282
  /**
283
+ * Set up canonical stack for this component.
284
+ *
285
+ * @since BuddyPress (2.1.0)
286
+ */
287
+ public function setup_canonical_stack() {
288
+ if ( ! bp_is_groups_component() ) {
289
+ return;
290
+ }
291
+
292
+ if ( empty( $this->current_group ) ) {
293
+ return;
294
+ }
295
+
296
+
297
+ $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
298
+
299
+ if ( !bp_current_action() ) {
300
+ buddypress()->current_action = $this->default_extension;
301
+ }
302
+
303
+ // Prepare for a redirect to the canonical URL
304
+ buddypress()->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group );
305
+
306
+ if ( bp_current_action() ) {
307
+ buddypress()->canonical_stack['action'] = bp_current_action();
308
+ }
309
+
310
+ if ( !empty( buddypress()->action_variables ) ) {
311
+ buddypress()->canonical_stack['action_variables'] = bp_action_variables();
312
+ }
313
+
314
+ // When viewing the default extension, the canonical URL should not have
315
+ // that extension's slug, unless more has been tacked onto the URL via
316
+ // action variables
317
+ if ( bp_is_current_action( $this->default_extension ) && empty( buddypress()->action_variables ) ) {
318
+ unset( buddypress()->canonical_stack['action'] );
319
+ }
320
+ }
321
+
322
+ /**
323
+ * Set up navigation.
324
  *
325
  * @global BuddyPress $bp The one true BuddyPress instance
326
  */
330
  if ( bp_is_user() ) {
331
  $count = bp_get_total_group_count_for_user();
332
  $class = ( 0 === $count ) ? 'no-count' : 'count';
333
+ $nav_name = sprintf( _x( 'Groups <span class="%s">%s</span>', 'Group screen nav with counter', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) );
334
  } else {
335
+ $nav_name = _x( 'Groups', 'Group screen nav without counter', 'buddypress' );
336
  }
337
 
338
  // Add 'Groups' to the main navigation
401
 
402
  // Add the "Home" subnav item, as this will always be present
403
  $sub_nav[] = array(
404
+ 'name' => _x( 'Home', 'Group screen navigation title', 'buddypress' ),
405
  'slug' => 'home',
406
  'parent_url' => $group_link,
407
  'parent_slug' => $this->current_group->slug,
421
  ) {
422
 
423
  $sub_nav[] = array(
424
+ 'name' => _x( 'Request Membership','Group screen nav', 'buddypress' ),
425
  'slug' => 'request-membership',
426
  'parent_url' => $group_link,
427
  'parent_slug' => $this->current_group->slug,
433
  // Forums are enabled and turned on
434
  if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) {
435
  $sub_nav[] = array(
436
+ 'name' => _x( 'Forum', 'My Group screen nav', 'buddypress' ),
437
  'slug' => 'forum',
438
  'parent_url' => $group_link,
439
  'parent_slug' => $this->current_group->slug,
445
  }
446
 
447
  $sub_nav[] = array(
448
+ 'name' => sprintf( _x( 'Members <span>%s</span>', 'My Group screen nav', 'buddypress' ), number_format( $this->current_group->total_member_count ) ),
449
  'slug' => 'members',
450
  'parent_url' => $group_link,
451
  'parent_slug' => $this->current_group->slug,
452
  'screen_function' => 'groups_screen_group_members',
453
  'position' => 60,
454
  'user_has_access' => $this->current_group->user_has_access,
455
+ 'item_css_id' => 'members',
456
+ 'no_access_url' => $group_link,
457
  );
458
 
459
  if ( bp_is_active( 'friends' ) && bp_groups_user_can_send_invites() ) {
460
  $sub_nav[] = array(
461
+ 'name' => _x( 'Send Invites', 'My Group screen nav', 'buddypress' ),
462
  'slug' => 'send-invites',
463
  'parent_url' => $group_link,
464
  'parent_slug' => $this->current_group->slug,
465
  'screen_function' => 'groups_screen_group_invite',
466
  'item_css_id' => 'invite',
467
  'position' => 70,
468
+ 'user_has_access' => $this->current_group->user_has_access,
469
+ 'no_access_url' => $group_link,
470
  );
471
  }
472
 
473
  // If the user is a group admin, then show the group admin nav item
474
  if ( bp_is_item_admin() ) {
475
  $sub_nav[] = array(
476
+ 'name' => _x( 'Manage', 'My Group screen nav', 'buddypress' ),
477
  'slug' => 'admin',
478
  'parent_url' => $group_link,
479
  'parent_slug' => $this->current_group->slug,
480
  'screen_function' => 'groups_screen_group_admin',
481
  'position' => 1000,
482
  'user_has_access' => true,
483
+ 'item_css_id' => 'admin',
484
+ 'no_access_url' => $group_link,
485
  );
486
  }
487
 
510
 
511
  // Pending group invites
512
  $count = groups_get_invite_count_for_user();
513
+ $title = _x( 'Groups', 'My Account Groups', 'buddypress' );
514
+ $pending = _x( 'No Pending Invites', 'My Account Groups sub nav', 'buddypress' );
515
 
516
  if ( !empty( $count['total'] ) ) {
517
+ $title = sprintf( _x( 'Groups <span class="count">%s</span>', 'My Account Groups nav', 'buddypress' ), $count );
518
+ $pending = sprintf( _x( 'Pending Invites <span class="count">%s</span>', 'My Account Groups sub nav', 'buddypress' ), $count );
519
  }
520
 
521
  // Add the "My Account" sub menus
530
  $wp_admin_nav[] = array(
531
  'parent' => 'my-account-' . $this->id,
532
  'id' => 'my-account-' . $this->id . '-memberships',
533
+ 'title' => _x( 'Memberships', 'My Account Groups sub nav', 'buddypress' ),
534
  'href' => trailingslashit( $groups_link )
535
  );
536
 
547
  $wp_admin_nav[] = array(
548
  'parent' => 'my-account-' . $this->id,
549
  'id' => 'my-account-' . $this->id . '-create',
550
+ 'title' => _x( 'Create a Group', 'My Account Groups sub nav', 'buddypress' ),
551
  'href' => trailingslashit( bp_get_groups_directory_permalink() . 'create' )
552
  );
553
  }
565
  if ( bp_is_groups_component() ) {
566
 
567
  if ( bp_is_my_profile() && !bp_is_single_item() ) {
568
+ $bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' );
569
 
570
  } else if ( !bp_is_my_profile() && !bp_is_single_item() ) {
571
  $bp->bp_options_avatar = bp_core_fetch_avatar( array(
584
  'object' => 'group',
585
  'type' => 'thumb',
586
  'avatar_dir' => 'group-avatars',
587
+ 'alt' => __( 'Group Profile Photo', 'buddypress' )
588
  ) );
589
 
590
  if ( empty( $bp->bp_options_avatar ) ) {
591
+ $bp->bp_options_avatar = '<img src="' . esc_url( bp_core_avatar_default_thumb() ) . '" alt="' . esc_attr__( 'No Group Profile Photo', 'buddypress' ) . '" class="avatar" />';
592
  }
593
  }
594
  }
bp-groups/bp-groups-notifications.php CHANGED
@@ -15,14 +15,25 @@ if ( !defined( 'ABSPATH' ) ) exit;
15
 
16
  /** Emails ********************************************************************/
17
 
18
- function groups_notification_group_updated( $group_id ) {
 
 
 
 
 
 
 
19
 
20
  $group = groups_get_group( array( 'group_id' => $group_id ) );
21
  $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) );
22
  $user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
23
 
24
  foreach ( (array) $user_ids as $user_id ) {
25
- if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
 
 
 
 
26
 
27
  $ud = bp_core_get_core_userdata( $user_id );
28
 
@@ -56,8 +67,20 @@ To view the group: %2$s
56
  do_action( 'bp_groups_sent_updated_email', $user_ids, $subject, '', $group_id );
57
  }
58
 
59
- function groups_notification_new_membership_request( $requesting_user_id, $admin_id, $group_id, $membership_id ) {
 
 
 
 
 
 
 
 
 
 
 
60
 
 
61
  if ( bp_is_active( 'notifications' ) ) {
62
  bp_notifications_add_notification( array(
63
  'user_id' => $admin_id,
@@ -68,8 +91,10 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin
68
  ) );
69
  }
70
 
71
- if ( 'no' == bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) )
 
72
  return false;
 
73
 
74
  // Username of the user requesting a membership: %1$s in mail
75
  $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
@@ -108,7 +133,7 @@ To view %4$s\'s profile: %5$s
108
  $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
109
  }
110
 
111
- /* Send the message */
112
  $to = apply_filters( 'groups_notification_new_membership_request_to', $to );
113
  $subject = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $subject, &$group ) );
114
  $message = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $message, &$group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) );
@@ -118,12 +143,25 @@ To view %4$s\'s profile: %5$s
118
  do_action( 'bp_groups_sent_membership_request_email', $admin_id, $subject, $message, $requesting_user_id, $group_id, $membership_id );
119
  }
120
 
121
- function groups_notification_membership_request_completed( $requesting_user_id, $group_id, $accepted = true ) {
 
 
 
 
 
 
 
 
 
 
122
 
123
- // Post a screen notification first.
124
  if ( bp_is_active( 'notifications' ) ) {
125
 
126
- $type = ! empty( $accepted ) ? 'membership_request_accepted' : 'membership_request_rejected' ;
 
 
 
127
 
128
  bp_notifications_add_notification( array(
129
  'user_id' => $requesting_user_id,
@@ -133,21 +171,20 @@ function groups_notification_membership_request_completed( $requesting_user_id,
133
  ) );
134
  }
135
 
136
- if ( 'no' == bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
 
137
  return false;
 
138
 
139
- $group = groups_get_group( array( 'group_id' => $group_id ) );
140
-
141
- $ud = bp_core_get_core_userdata($requesting_user_id);
142
-
143
- $group_link = bp_get_group_permalink( $group );
144
  $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
145
  $settings_link = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/';
 
146
 
147
  // Set up and send the message
148
- $to = $ud->user_email;
149
-
150
- if ( $accepted ) {
151
  $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ) ) );
152
  $message = sprintf( __(
153
  'Your membership request for the group "%1$s" has been accepted.
@@ -173,7 +210,7 @@ To submit another request please log in and visit: %2$s
173
  $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
174
  }
175
 
176
- /* Send the message */
177
  $to = apply_filters( 'groups_notification_membership_request_completed_to', $to );
178
  $subject = apply_filters_ref_array( 'groups_notification_membership_request_completed_subject', array( $subject, &$group ) );
179
  $message = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $message, &$group, $group_link, $settings_link ) );
@@ -185,30 +222,40 @@ To submit another request please log in and visit: %2$s
185
  add_action( 'groups_membership_accepted', 'groups_notification_membership_request_completed', 10, 3 );
186
  add_action( 'groups_membership_rejected', 'groups_notification_membership_request_completed', 10, 3 );
187
 
188
- function groups_notification_promoted_member( $user_id, $group_id ) {
 
 
 
 
 
 
 
 
 
189
 
 
190
  if ( groups_is_user_admin( $user_id, $group_id ) ) {
191
  $promoted_to = __( 'an administrator', 'buddypress' );
192
- $type = 'member_promoted_to_admin';
193
  } else {
194
  $promoted_to = __( 'a moderator', 'buddypress' );
195
- $type = 'member_promoted_to_mod';
196
  }
197
 
198
- // Post a screen notification first.
199
  if ( bp_is_active( 'notifications' ) ) {
200
  bp_notifications_add_notification( array(
201
  'user_id' => $user_id,
202
  'item_id' => $group_id,
203
  'component_name' => buddypress()->groups->id,
204
- 'component_action' => $type,
205
- 'date_notified' => bp_core_current_time(),
206
- 'is_new' => 1,
207
  ) );
208
  }
209
 
210
- if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) )
 
211
  return false;
 
212
 
213
  $group = groups_get_group( array( 'group_id' => $group_id ) );
214
  $ud = bp_core_get_core_userdata($user_id);
@@ -232,7 +279,7 @@ To view the group please visit: %3$s
232
  $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
233
  }
234
 
235
- /* Send the message */
236
  $to = apply_filters( 'groups_notification_promoted_member_to', $to );
237
  $subject = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $subject, &$group ) );
238
  $message = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $message, &$group, $promoted_to, $group_link, $settings_link ) );
@@ -243,42 +290,57 @@ To view the group please visit: %3$s
243
  }
244
  add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10, 2 );
245
 
 
 
 
 
 
 
 
 
 
 
246
  function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
247
 
248
- // @todo $inviter_up may be used for caching, test without it
 
 
 
 
 
249
  $inviter_ud = bp_core_get_core_userdata( $inviter_user_id );
250
  $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true );
251
  $inviter_link = bp_core_get_user_domain( $inviter_user_id );
 
252
 
253
- $group_link = bp_get_group_permalink( $group );
254
-
255
- if ( !$member->invite_sent ) {
256
- $invited_user_id = $member->user_id;
257
 
258
- // Post a screen notification first.
259
- if ( bp_is_active( 'notifications' ) ) {
260
- bp_notifications_add_notification( array(
261
- 'user_id' => $invited_user_id,
262
- 'item_id' => $group->id,
263
- 'component_name' => buddypress()->groups->id,
264
- 'component_action' => 'group_invite'
265
- ) );
266
- }
267
-
268
- if ( 'no' == bp_get_user_meta( $invited_user_id, 'notification_groups_invite', true ) )
269
- return false;
270
 
271
- $invited_ud = bp_core_get_core_userdata($invited_user_id);
272
- $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
273
- $settings_link = bp_core_get_user_domain( $invited_user_id ) . $settings_slug . '/notifications/';
274
- $invited_link = bp_core_get_user_domain( $invited_user_id );
275
- $invites_link = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
276
 
277
- // Set up and send the message
278
- $to = $invited_ud->user_email;
279
- $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ) ) );
 
 
280
 
281
- $message = sprintf( __(
 
 
 
282
  'One of your friends %1$s has invited you to the group: "%2$s".
283
 
284
  To view your group invites visit: %3$s
@@ -290,28 +352,28 @@ To view %5$s\'s profile visit: %6$s
290
  ---------------------
291
  ', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link );
292
 
293
- // Only show the disable notifications line if the settings component is enabled
294
- if ( bp_is_active( 'settings' ) ) {
295
- $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
296
- }
297
 
298
- /* Send the message */
299
- $to = apply_filters( 'groups_notification_group_invites_to', $to );
300
- $subject = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $subject, &$group ) );
301
- $message = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link ) );
302
 
303
- wp_mail( $to, $subject, $message );
304
 
305
- do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
306
- }
307
  }
308
 
309
  /** Notifications *************************************************************/
310
 
311
  /**
312
- * Format the BuddyBar/Toolbar notifications for the Groups component
 
 
313
  *
314
- * @since BuddyPress (1.0)
315
  * @param string $action The kind of notification being rendered
316
  * @param int $item_id The primary item id
317
  * @param int $secondary_item_id The secondary item id
@@ -629,9 +691,8 @@ add_action( 'groups_screen_group_invites', 'bp_groups_screen_invites_mark_notifi
629
  * administration area.
630
  *
631
  * @since BuddyPress (1.9.0)
632
- * @param int $group_id
633
  */
634
- function bp_groups_screen_group_admin_requests_mark_notifications( $group_id ) {
635
  if ( bp_is_active( 'notifications' ) ) {
636
  bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'new_membership_request' );
637
  }
15
 
16
  /** Emails ********************************************************************/
17
 
18
+ /**
19
+ * Notify all group members when a group is updated
20
+ *
21
+ * @since BuddyPress (1.0.0)
22
+ *
23
+ * @param int $group_id
24
+ */
25
+ function groups_notification_group_updated( $group_id = 0 ) {
26
 
27
  $group = groups_get_group( array( 'group_id' => $group_id ) );
28
  $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) );
29
  $user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
30
 
31
  foreach ( (array) $user_ids as $user_id ) {
32
+
33
+ // Continue if member opted out of receiving this email
34
+ if ( 'no' === bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) {
35
+ continue;
36
+ }
37
 
38
  $ud = bp_core_get_core_userdata( $user_id );
39
 
67
  do_action( 'bp_groups_sent_updated_email', $user_ids, $subject, '', $group_id );
68
  }
69
 
70
+ /**
71
+ * Notify group admin about new membership request
72
+ *
73
+ * @since BuddyPress (1.0.0)
74
+ *
75
+ * @param int $requesting_user_id
76
+ * @param int $admin_id
77
+ * @param int $group_id
78
+ * @param int $membership_id
79
+ * @return boolean
80
+ */
81
+ function groups_notification_new_membership_request( $requesting_user_id = 0, $admin_id = 0, $group_id = 0, $membership_id = 0 ) {
82
 
83
+ // Trigger a BuddyPress Notification
84
  if ( bp_is_active( 'notifications' ) ) {
85
  bp_notifications_add_notification( array(
86
  'user_id' => $admin_id,
91
  ) );
92
  }
93
 
94
+ // Bail if member opted out of receiving this email
95
+ if ( 'no' === bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) ) {
96
  return false;
97
+ }
98
 
99
  // Username of the user requesting a membership: %1$s in mail
100
  $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
133
  $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
134
  }
135
 
136
+ // Send the message
137
  $to = apply_filters( 'groups_notification_new_membership_request_to', $to );
138
  $subject = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $subject, &$group ) );
139
  $message = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $message, &$group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) );
143
  do_action( 'bp_groups_sent_membership_request_email', $admin_id, $subject, $message, $requesting_user_id, $group_id, $membership_id );
144
  }
145
 
146
+ /**
147
+ * Notify member about their group membership request
148
+ *
149
+ * @since BuddyPress (1.0.0)
150
+ *
151
+ * @param type $requesting_user_id
152
+ * @param type $group_id
153
+ * @param type $accepted
154
+ * @return boolean
155
+ */
156
+ function groups_notification_membership_request_completed( $requesting_user_id = 0, $group_id = 0, $accepted = true ) {
157
 
158
+ // Trigger a BuddyPress Notification
159
  if ( bp_is_active( 'notifications' ) ) {
160
 
161
+ // What type of acknowledgement
162
+ $type = ! empty( $accepted )
163
+ ? 'membership_request_accepted'
164
+ : 'membership_request_rejected';
165
 
166
  bp_notifications_add_notification( array(
167
  'user_id' => $requesting_user_id,
171
  ) );
172
  }
173
 
174
+ // Bail if member opted out of receiving this email
175
+ if ( 'no' === bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) ) {
176
  return false;
177
+ }
178
 
179
+ $group = groups_get_group( array( 'group_id' => $group_id ) );
180
+ $ud = bp_core_get_core_userdata( $requesting_user_id );
181
+ $group_link = bp_get_group_permalink( $group );
 
 
182
  $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
183
  $settings_link = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/';
184
+ $to = $ud->user_email;
185
 
186
  // Set up and send the message
187
+ if ( ! empty( $accepted ) ) {
 
 
188
  $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ) ) );
189
  $message = sprintf( __(
190
  'Your membership request for the group "%1$s" has been accepted.
210
  $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
211
  }
212
 
213
+ // Send the message
214
  $to = apply_filters( 'groups_notification_membership_request_completed_to', $to );
215
  $subject = apply_filters_ref_array( 'groups_notification_membership_request_completed_subject', array( $subject, &$group ) );
216
  $message = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $message, &$group, $group_link, $settings_link ) );
222
  add_action( 'groups_membership_accepted', 'groups_notification_membership_request_completed', 10, 3 );
223
  add_action( 'groups_membership_rejected', 'groups_notification_membership_request_completed', 10, 3 );
224
 
225
+ /**
226
+ * Notify group member they have been promoted
227
+ *
228
+ * @since BuddyPress (1.0.0)
229
+ *
230
+ * @param int $user_id
231
+ * @param int $group_id
232
+ * @return boolean
233
+ */
234
+ function groups_notification_promoted_member( $user_id = 0, $group_id = 0 ) {
235
 
236
+ // What type of promotion is this?
237
  if ( groups_is_user_admin( $user_id, $group_id ) ) {
238
  $promoted_to = __( 'an administrator', 'buddypress' );
239
+ $type = 'member_promoted_to_admin';
240
  } else {
241
  $promoted_to = __( 'a moderator', 'buddypress' );
242
+ $type = 'member_promoted_to_mod';
243
  }
244
 
245
+ // Trigger a BuddyPress Notification
246
  if ( bp_is_active( 'notifications' ) ) {
247
  bp_notifications_add_notification( array(
248
  'user_id' => $user_id,
249
  'item_id' => $group_id,
250
  'component_name' => buddypress()->groups->id,
251
+ 'component_action' => $type
 
 
252
  ) );
253
  }
254
 
255
+ // Bail if admin opted out of receiving this email
256
+ if ( 'no' === bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) ) {
257
  return false;
258
+ }
259
 
260
  $group = groups_get_group( array( 'group_id' => $group_id ) );
261
  $ud = bp_core_get_core_userdata($user_id);
279
  $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
280
  }
281
 
282
+ // Send the message
283
  $to = apply_filters( 'groups_notification_promoted_member_to', $to );
284
  $subject = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $subject, &$group ) );
285
  $message = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $message, &$group, $promoted_to, $group_link, $settings_link ) );
290
  }
291
  add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10, 2 );
292
 
293
+ /**
294
+ * Notify a member they have been invitated to a group
295
+ *
296
+ * @since BuddyPress (1.0.0)
297
+ *
298
+ * @param object $group
299
+ * @param object $member
300
+ * @param int $inviter_user_id
301
+ * @return boolean
302
+ */
303
  function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
304
 
305
+ // Bail if member has already been invited
306
+ if ( ! empty( $member->invite_sent ) ) {
307
+ return;
308
+ }
309
+
310
+ // @todo $inviter_ud may be used for caching, test without it
311
  $inviter_ud = bp_core_get_core_userdata( $inviter_user_id );
312
  $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true );
313
  $inviter_link = bp_core_get_user_domain( $inviter_user_id );
314
+ $group_link = bp_get_group_permalink( $group );
315
 
316
+ // Setup the ID for the invited user
317
+ $invited_user_id = $member->user_id;
 
 
318
 
319
+ // Trigger a BuddyPress Notification
320
+ if ( bp_is_active( 'notifications' ) ) {
321
+ bp_notifications_add_notification( array(
322
+ 'user_id' => $invited_user_id,
323
+ 'item_id' => $group->id,
324
+ 'component_name' => buddypress()->groups->id,
325
+ 'component_action' => 'group_invite'
326
+ ) );
327
+ }
 
 
 
328
 
329
+ // Bail if member opted out of receiving this email
330
+ if ( 'no' === bp_get_user_meta( $invited_user_id, 'notification_groups_invite', true ) ) {
331
+ return false;
332
+ }
 
333
 
334
+ $invited_ud = bp_core_get_core_userdata( $invited_user_id );
335
+ $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
336
+ $settings_link = bp_core_get_user_domain( $invited_user_id ) . $settings_slug . '/notifications/';
337
+ $invited_link = bp_core_get_user_domain( $invited_user_id );
338
+ $invites_link = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
339
 
340
+ // Set up and send the message
341
+ $to = $invited_ud->user_email;
342
+ $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ) ) );
343
+ $message = sprintf( __(
344
  'One of your friends %1$s has invited you to the group: "%2$s".
345
 
346
  To view your group invites visit: %3$s
352
  ---------------------
353
  ', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link );
354
 
355
+ // Only show the disable notifications line if the settings component is enabled
356
+ if ( bp_is_active( 'settings' ) ) {
357
+ $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
358
+ }
359
 
360
+ // Send the message
361
+ $to = apply_filters( 'groups_notification_group_invites_to', $to );
362
+ $subject = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $subject, &$group ) );
363
+ $message = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link ) );
364
 
365
+ wp_mail( $to, $subject, $message );
366
 
367
+ do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
 
368
  }
369
 
370
  /** Notifications *************************************************************/
371
 
372
  /**
373
+ * Format notifications for the Groups component.
374
+ *
375
+ * @since BuddyPress (1.0.0)
376
  *
 
377
  * @param string $action The kind of notification being rendered
378
  * @param int $item_id The primary item id
379
  * @param int $secondary_item_id The secondary item id
691
  * administration area.
692
  *
693
  * @since BuddyPress (1.9.0)
 
694
  */
695
+ function bp_groups_screen_group_admin_requests_mark_notifications() {
696
  if ( bp_is_active( 'notifications' ) ) {
697
  bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'new_membership_request' );
698
  }
bp-groups/bp-groups-screens.php CHANGED
@@ -505,7 +505,7 @@ function groups_screen_group_request_membership() {
505
  if ( groups_accept_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
506
  bp_core_add_message( __( 'Group invite accepted', 'buddypress' ) );
507
  else
508
- bp_core_add_message( __( 'There was an error accepting the group invitation, please try again.', 'buddypress' ), 'error' );
509
  bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
510
  }
511
 
@@ -517,7 +517,7 @@ function groups_screen_group_request_membership() {
517
  return false;
518
 
519
  if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
520
- bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' );
521
  } else {
522
  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' ) );
523
  }
@@ -568,7 +568,7 @@ function groups_screen_group_admin_edit_details() {
568
  $group_notify_members = isset( $_POST['group-notify-members'] ) ? (int) $_POST['group-notify-members'] : 0;
569
 
570
  if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $group_notify_members ) ) {
571
- bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
572
  } else {
573
  bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
574
  }
@@ -612,7 +612,7 @@ function groups_screen_group_admin_settings() {
612
  return false;
613
 
614
  if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
615
- bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' );
616
  } else {
617
  bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
618
  }
@@ -634,7 +634,7 @@ function groups_screen_group_admin_avatar() {
634
  return false;
635
 
636
  // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
637
- if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
638
  return false;
639
 
640
  $bp = buddypress();
@@ -646,9 +646,9 @@ function groups_screen_group_admin_avatar() {
646
  check_admin_referer( 'bp_group_avatar_delete' );
647
 
648
  if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) {
649
- bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) );
650
  } else {
651
- bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' );
652
  }
653
  }
654
 
@@ -691,9 +691,9 @@ function groups_screen_group_admin_avatar() {
691
  );
692
 
693
  if ( !bp_core_avatar_handle_crop( $args ) ) {
694
- bp_core_add_message( __( 'There was a problem cropping the avatar.', 'buddypress' ), 'error' );
695
  } else {
696
- bp_core_add_message( __( 'The new group avatar was uploaded successfully.', 'buddypress' ) );
697
  }
698
  }
699
 
@@ -754,7 +754,7 @@ function groups_screen_group_admin_manage_members() {
754
 
755
  // Demote a user.
756
  elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) )
757
- bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' );
758
  else
759
  bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) );
760
 
@@ -772,7 +772,7 @@ function groups_screen_group_admin_manage_members() {
772
 
773
  // Ban a user.
774
  if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) )
775
- bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' );
776
  else
777
  bp_core_add_message( __( 'User banned successfully', 'buddypress' ) );
778
 
@@ -808,7 +808,7 @@ function groups_screen_group_admin_manage_members() {
808
 
809
  // Remove a user.
810
  if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
811
- bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' );
812
  else
813
  bp_core_add_message( __( 'User removed successfully', 'buddypress' ) );
814
 
@@ -847,7 +847,7 @@ function groups_screen_group_admin_requests() {
847
 
848
  // Accept the membership request
849
  if ( !groups_accept_membership_request( $membership_id ) )
850
- bp_core_add_message( __( 'There was an error accepting the membership request, please try again.', 'buddypress' ), 'error' );
851
  else
852
  bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) );
853
 
@@ -858,7 +858,7 @@ function groups_screen_group_admin_requests() {
858
 
859
  // Reject the membership request
860
  if ( !groups_reject_membership_request( $membership_id ) )
861
- bp_core_add_message( __( 'There was an error rejecting the membership request, please try again.', 'buddypress' ), 'error' );
862
  else
863
  bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) );
864
  }
@@ -892,7 +892,7 @@ function groups_screen_group_admin_delete_group() {
892
 
893
  // Group admin has deleted the group, now do it.
894
  if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
895
- bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' );
896
  } else {
897
  bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
898
 
@@ -933,7 +933,7 @@ function groups_screen_notification_settings() {
933
  <thead>
934
  <tr>
935
  <th class="icon"></th>
936
- <th class="title"><?php _e( 'Groups', 'buddypress' ) ?></th>
937
  <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
938
  <th class="no"><?php _e( 'No', 'buddypress' )?></th>
939
  </tr>
@@ -942,25 +942,25 @@ function groups_screen_notification_settings() {
942
  <tbody>
943
  <tr id="groups-notification-settings-invitation">
944
  <td></td>
945
- <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
946
  <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/></td>
947
  <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php checked( $group_invite, 'no', true ) ?>/></td>
948
  </tr>
949
  <tr id="groups-notification-settings-info-updated">
950
  <td></td>
951
- <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
952
  <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php checked( $group_update, 'yes', true ) ?>/></td>
953
  <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php checked( $group_update, 'no', true ) ?>/></td>
954
  </tr>
955
  <tr id="groups-notification-settings-promoted">
956
  <td></td>
957
- <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
958
  <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/></td>
959
  <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php checked( $group_promo, 'no', true ) ?>/></td>
960
  </tr>
961
  <tr id="groups-notification-settings-request">
962
  <td></td>
963
- <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
964
  <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php checked( $group_request, 'yes', true ) ?>/></td>
965
  <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php checked( $group_request, 'no', true ) ?>/></td>
966
  </tr>
@@ -1071,7 +1071,7 @@ class BP_Groups_Theme_Compat {
1071
  'post_author' => 0,
1072
  'post_date' => 0,
1073
  'post_content' => '',
1074
- 'post_type' => 'bp_group',
1075
  'post_status' => 'publish',
1076
  'is_page' => true,
1077
  'comment_status' => 'closed'
@@ -1119,7 +1119,7 @@ class BP_Groups_Theme_Compat {
1119
  */
1120
  public function create_dummy_post() {
1121
 
1122
- $title = __( 'Groups', 'buddypress' );
1123
 
1124
  bp_theme_compat_reset_post( array(
1125
  'ID' => 0,
@@ -1127,7 +1127,7 @@ class BP_Groups_Theme_Compat {
1127
  'post_author' => 0,
1128
  'post_date' => 0,
1129
  'post_content' => '',
1130
- 'post_type' => 'bp_group',
1131
  'post_status' => 'publish',
1132
  'is_page' => true,
1133
  'comment_status' => 'closed'
@@ -1187,7 +1187,7 @@ class BP_Groups_Theme_Compat {
1187
  'post_author' => 0,
1188
  'post_date' => 0,
1189
  'post_content' => '',
1190
- 'post_type' => 'bp_group',
1191
  'post_status' => 'publish',
1192
  'is_page' => true,
1193
  'comment_status' => 'closed'
505
  if ( groups_accept_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
506
  bp_core_add_message( __( 'Group invite accepted', 'buddypress' ) );
507
  else
508
+ bp_core_add_message( __( 'There was an error accepting the group invitation; please try again.', 'buddypress' ), 'error' );
509
  bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
510
  }
511
 
517
  return false;
518
 
519
  if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
520
+ bp_core_add_message( __( 'There was an error sending your group membership request; please try again.', 'buddypress' ), 'error' );
521
  } else {
522
  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' ) );
523
  }
568
  $group_notify_members = isset( $_POST['group-notify-members'] ) ? (int) $_POST['group-notify-members'] : 0;
569
 
570
  if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $group_notify_members ) ) {
571
+ bp_core_add_message( __( 'There was an error updating group details; please try again.', 'buddypress' ), 'error' );
572
  } else {
573
  bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
574
  }
612
  return false;
613
 
614
  if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
615
+ bp_core_add_message( __( 'There was an error updating group settings; please try again.', 'buddypress' ), 'error' );
616
  } else {
617
  bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
618
  }
634
  return false;
635
 
636
  // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
637
+ if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars )
638
  return false;
639
 
640
  $bp = buddypress();
646
  check_admin_referer( 'bp_group_avatar_delete' );
647
 
648
  if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) {
649
+ bp_core_add_message( __( 'The group profile photo was deleted successfully!', 'buddypress' ) );
650
  } else {
651
+ bp_core_add_message( __( 'There was a problem deleting the group profile photo; please try again.', 'buddypress' ), 'error' );
652
  }
653
  }
654
 
691
  );
692
 
693
  if ( !bp_core_avatar_handle_crop( $args ) ) {
694
+ bp_core_add_message( __( 'There was a problem cropping the group profile photo.', 'buddypress' ), 'error' );
695
  } else {
696
+ bp_core_add_message( __( 'The new group profile photo was uploaded successfully.', 'buddypress' ) );
697
  }
698
  }
699
 
754
 
755
  // Demote a user.
756
  elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) )
757
+ bp_core_add_message( __( 'There was an error when demoting that user; please try again', 'buddypress' ), 'error' );
758
  else
759
  bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) );
760
 
772
 
773
  // Ban a user.
774
  if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) )
775
+ bp_core_add_message( __( 'There was an error when banning that user; please try again', 'buddypress' ), 'error' );
776
  else
777
  bp_core_add_message( __( 'User banned successfully', 'buddypress' ) );
778
 
808
 
809
  // Remove a user.
810
  if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
811
+ bp_core_add_message( __( 'There was an error removing that user from the group; please try again', 'buddypress' ), 'error' );
812
  else
813
  bp_core_add_message( __( 'User removed successfully', 'buddypress' ) );
814
 
847
 
848
  // Accept the membership request
849
  if ( !groups_accept_membership_request( $membership_id ) )
850
+ bp_core_add_message( __( 'There was an error accepting the membership request; please try again.', 'buddypress' ), 'error' );
851
  else
852
  bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) );
853
 
858
 
859
  // Reject the membership request
860
  if ( !groups_reject_membership_request( $membership_id ) )
861
+ bp_core_add_message( __( 'There was an error rejecting the membership request; please try again.', 'buddypress' ), 'error' );
862
  else
863
  bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) );
864
  }
892
 
893
  // Group admin has deleted the group, now do it.
894
  if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
895
+ bp_core_add_message( __( 'There was an error deleting the group; please try again.', 'buddypress' ), 'error' );
896
  } else {
897
  bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
898
 
933
  <thead>
934
  <tr>
935
  <th class="icon"></th>
936
+ <th class="title"><?php _ex( 'Groups', 'Group settings on notification settings page', 'buddypress' ) ?></th>
937
  <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
938
  <th class="no"><?php _e( 'No', 'buddypress' )?></th>
939
  </tr>
942
  <tbody>
943
  <tr id="groups-notification-settings-invitation">
944
  <td></td>
945
+ <td><?php _ex( 'A member invites you to join a group', 'group settings on notification settings page','buddypress' ) ?></td>
946
  <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/></td>
947
  <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php checked( $group_invite, 'no', true ) ?>/></td>
948
  </tr>
949
  <tr id="groups-notification-settings-info-updated">
950
  <td></td>
951
+ <td><?php _ex( 'Group information is updated', 'group settings on notification settings page', 'buddypress' ) ?></td>
952
  <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php checked( $group_update, 'yes', true ) ?>/></td>
953
  <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php checked( $group_update, 'no', true ) ?>/></td>
954
  </tr>
955
  <tr id="groups-notification-settings-promoted">
956
  <td></td>
957
+ <td><?php _ex( 'You are promoted to a group administrator or moderator', 'group settings on notification settings page', 'buddypress' ) ?></td>
958
  <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/></td>
959
  <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php checked( $group_promo, 'no', true ) ?>/></td>
960
  </tr>
961
  <tr id="groups-notification-settings-request">
962
  <td></td>
963
+ <td><?php _ex( 'A member requests to join a private group for which you are an admin', 'group settings on notification settings page', 'buddypress' ) ?></td>
964
  <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php checked( $group_request, 'yes', true ) ?>/></td>
965
  <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php checked( $group_request, 'no', true ) ?>/></td>
966
  </tr>
1071
  'post_author' => 0,
1072
  'post_date' => 0,
1073
  'post_content' => '',
1074
+ 'post_type' => 'page',
1075
  'post_status' => 'publish',
1076
  'is_page' => true,
1077
  'comment_status' => 'closed'
1119
  */
1120
  public function create_dummy_post() {
1121
 
1122
+ $title = _x( 'Groups', 'Group creation page', 'buddypress' );
1123
 
1124
  bp_theme_compat_reset_post( array(
1125
  'ID' => 0,
1127
  'post_author' => 0,
1128
  'post_date' => 0,
1129
  'post_content' => '',
1130
+ 'post_type' => 'page',
1131
  'post_status' => 'publish',
1132
  'is_page' => true,
1133
  'comment_status' => 'closed'
1187
  'post_author' => 0,
1188
  'post_date' => 0,
1189
  'post_content' => '',
1190
+ 'post_type' => 'page',
1191
  'post_status' => 'publish',
1192
  'is_page' => true,
1193
  'comment_status' => 'closed'
bp-groups/bp-groups-template.php CHANGED
@@ -234,8 +234,25 @@ class BP_Groups_Template {
234
 
235
  // Build pagination links
236
  if ( (int) $this->total_group_count && (int) $this->pag_num ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  $this->pag_links = paginate_links( array(
238
- 'base' => add_query_arg( array( $page_arg => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
239
  'format' => '',
240
  'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ),
241
  'current' => $this->pag_page,
@@ -292,79 +309,103 @@ class BP_Groups_Template {
292
  /**
293
  * Start the Groups Template Loop
294
  *
295
- * See the $defaults definition below for a description of parameters.
296
  *
297
- * Note that the 'type' parameter overrides 'order' and 'orderby'. See
298
- * BP_Groups_Group::get() for more details.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  *
300
- * @param array $args
301
  * @return bool True if there are groups to display that match the params
302
  */
303
  function bp_has_groups( $args = '' ) {
304
- global $groups_template, $bp;
305
 
306
  /***
307
- * Set the defaults based on the current page. Any of these will be overridden
308
- * if arguments are directly passed into the loop. Custom plugins should always
309
- * pass their parameters directly to the loop.
310
  */
311
- $slug = false;
312
- $type = '';
313
- $user_id = 0;
314
- $order = '';
315
-
316
- // User filtering
317
- if ( bp_displayed_user_id() )
318
- $user_id = bp_displayed_user_id();
319
 
320
- // Type
321
- // @todo What is $order? At some point it was removed incompletely?
322
  if ( bp_is_current_action( 'my-groups' ) ) {
323
- if ( 'most-popular' == $order ) {
324
  $type = 'popular';
325
- } elseif ( 'alphabetically' == $order ) {
326
  $type = 'alphabetical';
327
  }
 
 
328
  } elseif ( bp_is_current_action( 'invites' ) ) {
329
  $type = 'invites';
330
- } elseif ( isset( $bp->groups->current_group->slug ) && $bp->groups->current_group->slug ) {
 
 
331
  $type = 'single-group';
332
- $slug = $bp->groups->current_group->slug;
333
  }
334
 
335
- // Default search string
336
  if ( ! empty( $_REQUEST['group-filter-box'] ) ) {
337
  $search_terms = $_REQUEST['group-filter-box'];
338
- } elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) ) {
339
  $search_terms = $_REQUEST['s'];
340
- } else {
341
- $search_terms = false;
342
  }
343
 
344
- $defaults = array(
345
- 'type' => $type, // 'type' is an override for 'order' and 'orderby'. See docblock.
 
346
  'order' => 'DESC',
347
  'orderby' => 'last_activity',
348
  'page' => 1,
349
  'per_page' => 20,
350
  'max' => false,
351
  'show_hidden' => false,
352
-
353
- 'page_arg' => 'grpage', // See https://buddypress.trac.wordpress.org/ticket/3679
354
-
355
- 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined
356
- 'slug' => $slug, // Pass a group slug to only return that group
357
- 'search_terms' => $search_terms, // Pass search terms to return only matching groups
358
- 'meta_query' => false, // Filter by groupmeta. See WP_Meta_Query for format
359
- 'include' => false, // Pass comma separated list or array of group ID's to return only these groups
360
- 'exclude' => false, // Pass comma separated list or array of group ID's to exclude these groups
361
-
362
- 'populate_extras' => true, // Get extra meta - is_member, is_banned
363
  'update_meta_cache' => true,
364
- );
365
-
366
- $r = bp_parse_args( $args, $defaults, 'has_groups' );
367
 
 
368
  $groups_template = new BP_Groups_Template( array(
369
  'type' => $r['type'],
370
  'order' => $r['order'],
@@ -384,6 +425,7 @@ function bp_has_groups( $args = '' ) {
384
  'update_meta_cache' => (bool) $r['update_meta_cache'],
385
  ) );
386
 
 
387
  return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template, $r );
388
  }
389
 
@@ -524,43 +566,112 @@ function bp_group_status( $group = false ) {
524
  return apply_filters( 'bp_get_group_status', $group->status );
525
  }
526
 
 
 
 
 
 
 
 
527
  function bp_group_avatar( $args = '' ) {
528
  echo bp_get_group_avatar( $args );
529
  }
 
 
 
 
 
 
 
530
  function bp_get_group_avatar( $args = '' ) {
531
- global $bp, $groups_template;
532
 
533
- $defaults = array(
 
 
 
 
 
 
 
534
  'type' => 'full',
535
  'width' => false,
536
  'height' => false,
537
  'class' => 'avatar',
538
  'id' => false,
539
  'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name )
540
- );
541
 
542
- $r = wp_parse_args( $args, $defaults );
543
- extract( $r, EXTR_SKIP );
 
 
 
 
 
 
 
 
 
 
 
544
 
545
- /* Fetch the avatar from the folder, if not provide backwards compat. */
546
- if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'title' => $groups_template->group->name, 'alt' => $alt ) ) )
547
  $avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
 
548
 
549
- return apply_filters( 'bp_get_group_avatar', $avatar );
550
  }
551
 
 
 
 
 
 
 
 
552
  function bp_group_avatar_thumb( $group = false ) {
553
  echo bp_get_group_avatar_thumb( $group );
554
  }
 
 
 
 
 
 
 
555
  function bp_get_group_avatar_thumb( $group = false ) {
556
- return bp_get_group_avatar( 'type=thumb' );
 
 
 
557
  }
558
 
 
 
 
 
 
 
 
559
  function bp_group_avatar_mini( $group = false ) {
560
  echo bp_get_group_avatar_mini( $group );
561
  }
 
 
 
 
 
 
 
562
  function bp_get_group_avatar_mini( $group = false ) {
563
- return bp_get_group_avatar( 'type=thumb&width=30&height=30' );
 
 
 
 
 
564
  }
565
 
566
  function bp_group_last_active( $group = false ) {
@@ -774,7 +885,7 @@ function bp_group_creator_avatar( $group = false, $args = array() ) {
774
  'height' => false,
775
  'class' => 'avatar',
776
  'id' => false,
777
- 'alt' => sprintf( __( 'Group creator avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) )
778
  );
779
 
780
  $r = wp_parse_args( $args, $defaults );
@@ -994,7 +1105,7 @@ function bp_groups_pagination_count() {
994
  $to_num = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
995
  $total = bp_core_number_format( $groups_template->total_group_count );
996
 
997
- return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing group %1$s to %2$s (of %3$s group)', 'Viewing group %1$s to %2$s (of %3$s groups)', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
998
  }
999
 
1000
  function bp_groups_auto_join() {
@@ -1514,10 +1625,11 @@ function bp_group_member_remove_link( $user_id = 0 ) {
1514
  }
1515
 
1516
  function bp_group_admin_tabs( $group = false ) {
1517
- global $bp, $groups_template;
1518
 
1519
- if ( empty( $group ) )
1520
- $group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group;
 
1521
 
1522
  $current_tab = bp_get_group_current_admin_tab();
1523
 
@@ -1532,9 +1644,9 @@ function bp_group_admin_tabs( $group = false ) {
1532
 
1533
  <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
1534
 
1535
- <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
1536
 
1537
- <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
1538
 
1539
  <?php endif; ?>
1540
 
@@ -1625,36 +1737,74 @@ function bp_group_is_member( $group = false ) {
1625
  }
1626
 
1627
  /**
1628
- * Checks if a user is banned from a group.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1629
  *
1630
- * If this function is invoked inside the groups template loop (e.g. the group directory), then
1631
- * check $groups_template->group->is_banned instead of making another SQL query.
1632
- * However, if used in a single group's pages, we must use groups_is_user_banned().
1633
  *
1634
  * @global BP_Groups_Template $groups_template Group template loop object
1635
- * @param object $group Group to check if user is banned from the group
1636
- * @param int $user_id
1637
- * @return bool If user is banned from the group or not
1638
- * @since BuddyPress (1.5)
1639
  */
1640
  function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
1641
  global $groups_template;
1642
 
1643
  // Site admins always have access
1644
- if ( bp_current_user_can( 'bp_moderate' ) )
1645
  return false;
 
1646
 
1647
- if ( empty( $group ) ) {
1648
- $group =& $groups_template->group;
 
 
1649
 
1650
- if ( !$user_id && isset( $group->is_banned ) )
1651
- return apply_filters( 'bp_group_is_user_banned', $group->is_banned );
1652
- }
 
1653
 
1654
- if ( !$user_id )
1655
- $user_id = bp_loggedin_user_id();
 
1656
 
1657
- return apply_filters( 'bp_group_is_user_banned', groups_is_user_banned( $user_id, $group->id ) );
 
 
 
 
 
 
 
 
 
1658
  }
1659
 
1660
  function bp_group_accept_invite_link() {
@@ -1955,10 +2105,13 @@ function bp_group_status_message( $group = null ) {
1955
 
1956
  if ( 'private' == $group->status ) {
1957
  if ( ! bp_group_has_requested_membership() ) {
1958
- if ( is_user_logged_in() )
 
 
1959
  $message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
1960
- else
1961
  $message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
 
1962
 
1963
  } else {
1964
  $message = __( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
@@ -2190,7 +2343,9 @@ class BP_Groups_Group_Members_Template {
2190
  * @type string $type Optional. Sort order of results. 'last_joined',
2191
  * 'first_joined', or any of the $type params available in
2192
  * {@link BP_User_Query}. Default: 'last_joined'.
2193
- * @type string $search_terms Optional. Search terms to match.
 
 
2194
  * }
2195
  */
2196
  function bp_group_has_members( $args = '' ) {
@@ -2211,12 +2366,13 @@ function bp_group_has_members( $args = '' ) {
2211
  'exclude_admins_mods' => $exclude_admins_mods,
2212
  'exclude_banned' => 1,
2213
  'group_role' => false,
2214
- 'search_terms' => false,
2215
  'type' => 'last_joined',
2216
  ) );
2217
 
2218
- if ( empty( $r['search_terms'] ) && ! empty( $_REQUEST['s'] ) )
2219
  $r['search_terms'] = $_REQUEST['s'];
 
2220
 
2221
  $members_template = new BP_Groups_Group_Members_Template( $r );
2222
  return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template );
@@ -2234,31 +2390,97 @@ function bp_group_the_member() {
2234
  return $members_template->the_member();
2235
  }
2236
 
2237
- function bp_group_member_avatar() {
2238
- echo bp_get_group_member_avatar();
 
 
 
 
 
 
 
2239
  }
2240
- function bp_get_group_member_avatar() {
 
 
 
 
 
 
 
2241
  global $members_template;
2242
 
2243
- return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'full', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
 
 
 
 
 
 
 
2244
  }
2245
 
2246
- function bp_group_member_avatar_thumb() {
2247
- echo bp_get_group_member_avatar_thumb();
 
 
 
 
 
 
 
 
2248
  }
2249
- function bp_get_group_member_avatar_thumb() {
 
 
 
 
 
 
 
2250
  global $members_template;
2251
 
2252
- return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
 
 
 
 
 
 
 
2253
  }
2254
 
 
 
 
 
 
 
 
2255
  function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
2256
  echo bp_get_group_member_avatar_mini( $width, $height );
2257
  }
 
 
 
 
 
 
 
2258
  function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) {
2259
  global $members_template;
2260
 
2261
- return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
 
 
 
 
 
 
 
 
 
2262
  }
2263
 
2264
  function bp_group_member_name() {
@@ -2381,7 +2603,7 @@ function bp_group_member_pagination_count() {
2381
  $to_num = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
2382
  $total = bp_core_number_format( $members_template->total_member_count );
2383
 
2384
- return apply_filters( 'bp_get_group_member_pagination_count', sprintf( _n( 'Viewing member %1$s to %2$s (of %3$s member)', 'Viewing members %1$s to %2$s (of %3$s members)', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
2385
  }
2386
 
2387
  function bp_group_member_admin_pagination() {
@@ -2437,6 +2659,11 @@ function bp_groups_members_filter() {
2437
  <select id="group_members-order-by">
2438
  <option value="last_joined"><?php _e( 'Newest', 'buddypress' ); ?></option>
2439
  <option value="first_joined"><?php _e( 'Oldest', 'buddypress' ); ?></option>
 
 
 
 
 
2440
  <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
2441
 
2442
  <?php do_action( 'bp_groups_members_order_options' ); ?>
@@ -2849,14 +3076,16 @@ function bp_groups_filter_title() {
2849
  do_action( 'bp_groups_filter_title' );
2850
  }
2851
 
2852
- function bp_is_group_admin_screen( $slug ) {
2853
- if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) )
2854
- return false;
2855
-
2856
- if ( bp_is_action_variable( $slug ) )
2857
- return true;
2858
-
2859
- return false;
 
 
2860
  }
2861
 
2862
  /**
@@ -3254,7 +3483,7 @@ function bp_group_requests_pagination_count() {
3254
  $to_num = bp_core_number_format( ( $start_num + ( $requests_template->pag_num - 1 ) > $requests_template->total_request_count ) ? $requests_template->total_request_count : $start_num + ( $requests_template->pag_num - 1 ) );
3255
  $total = bp_core_number_format( $requests_template->total_request_count );
3256
 
3257
- return apply_filters( 'bp_get_group_requests_pagination_count', sprintf( _n( 'Viewing requests %1$s to %2$s (of %3$s request)', 'Viewing request %1$s to %2$s (of %3$s requests)', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
3258
  }
3259
 
3260
  /************************************************************************************
@@ -3380,9 +3609,9 @@ class BP_Groups_Invite_Template {
3380
  $this->invite->user->profile_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
3381
  }
3382
 
3383
- $this->invite->user->avatar = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
3384
- $this->invite->user->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
3385
- $this->invite->user->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->invite->user->fullname ), 'width' => 30, 'height' => 30 ) );
3386
  $this->invite->user->email = $this->invite->user->user_email;
3387
  $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login );
3388
  $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}' title='{$this->invite->user->fullname}'>{$this->invite->user->fullname}</a>";
@@ -3421,9 +3650,9 @@ function bp_group_has_invites( $args = '' ) {
3421
  ) );
3422
 
3423
  if ( empty( $r['group_id'] ) ) {
3424
- if ( ! empty( buddypress()->groups->current_group ) ) {
3425
  $r['group_id'] = bp_get_current_group_id();
3426
- } else if ( ! empty( buddypress()->groups->new_group_id ) ) {
3427
  $r['group_id'] = buddypress()->groups->new_group_id;
3428
  }
3429
  }
@@ -3549,7 +3778,7 @@ function bp_group_invite_pagination_count() {
3549
  $to_num = bp_core_number_format( ( $start_num + ( $invites_template->pag_num - 1 ) > $invites_template->total_invite_count ) ? $invites_template->total_invite_count : $start_num + ( $invites_template->pag_num - 1 ) );
3550
  $total = bp_core_number_format( $invites_template->total_invite_count );
3551
 
3552
- return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing invitation %1$s to %2$s (of %3$s invitation)', 'Viewing invitation %1$s to %2$s (of %3$s invitations)', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
3553
  }
3554
 
3555
  /***
@@ -3575,9 +3804,7 @@ function bp_group_activity_feed_link() {
3575
  echo bp_get_group_activity_feed_link();
3576
  }
3577
  function bp_get_group_activity_feed_link() {
3578
- global $bp;
3579
-
3580
- return apply_filters( 'bp_get_group_activity_feed_link', bp_get_group_permalink( $bp->groups->current_group ) . 'feed/' );
3581
  }
3582
 
3583
  /**
@@ -3599,8 +3826,7 @@ function bp_current_group_id() {
3599
  * @return int $current_group_id The id of the current group, if there is one
3600
  */
3601
  function bp_get_current_group_id() {
3602
- $current_group = groups_get_current_group();
3603
-
3604
  $current_group_id = isset( $current_group->id ) ? (int) $current_group->id : 0;
3605
 
3606
  return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
@@ -3625,8 +3851,7 @@ function bp_current_group_slug() {
3625
  * @return string $current_group_slug The slug of the current group, if there is one
3626
  */
3627
  function bp_get_current_group_slug() {
3628
- $current_group = groups_get_current_group();
3629
-
3630
  $current_group_slug = isset( $current_group->slug ) ? $current_group->slug : '';
3631
 
3632
  return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );
@@ -3650,44 +3875,96 @@ function bp_current_group_name() {
3650
  * @return string The name of the current group, if there is one
3651
  */
3652
  function bp_get_current_group_name() {
3653
- global $bp;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3654
 
3655
- $name = apply_filters( 'bp_get_group_name', $bp->groups->current_group->name );
3656
- return apply_filters( 'bp_get_current_group_name', $name );
3657
  }
3658
 
 
 
 
 
 
 
 
 
 
 
3659
  function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
3660
  echo bp_get_groups_action_link( $action, $query_args, $nonce );
3661
  }
 
 
 
 
 
 
 
 
 
 
3662
  function bp_get_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
3663
- global $bp;
 
 
3664
 
3665
  // Must be a group
3666
- if ( empty( $bp->groups->current_group->id ) )
3667
- return;
3668
 
3669
- // Append $action to $url if provided
3670
- if ( !empty( $action ) )
3671
- $url = bp_get_group_permalink( groups_get_current_group() ) . $action;
3672
- else
3673
- $url = bp_get_group_permalink( groups_get_current_group() );
 
3674
 
3675
- // Add a slash at the end of our user url
3676
- $url = trailingslashit( $url );
3677
 
3678
- // Add possible query arg
3679
- if ( !empty( $query_args ) && is_array( $query_args ) )
3680
- $url = add_query_arg( $query_args, $url );
 
3681
 
3682
- // To nonce, or not to nonce...
3683
- if ( true === $nonce )
3684
- $url = wp_nonce_url( $url );
3685
- elseif ( is_string( $nonce ) )
3686
- $url = wp_nonce_url( $url, $nonce );
 
 
3687
 
3688
- // Return the url, if there is one
3689
- if ( !empty( $url ) )
3690
- return $url;
3691
  }
3692
 
3693
  /** Stats **********************************************************************/
234
 
235
  // Build pagination links
236
  if ( (int) $this->total_group_count && (int) $this->pag_num ) {
237
+ $pag_args = array(
238
+ $page_arg => '%#%',
239
+ 'num' => $this->pag_num,
240
+ 'sortby' => $this->sort_by,
241
+ 'order' => $this->order,
242
+ );
243
+
244
+ if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) {
245
+ $base = remove_query_arg( 's', wp_get_referer() );
246
+ } else {
247
+ $base = '';
248
+ }
249
+
250
+ if ( ! empty( $search_terms ) ) {
251
+ $pag_args['s'] = $search_terms;
252
+ }
253
+
254
  $this->pag_links = paginate_links( array(
255
+ 'base' => add_query_arg( $pag_args, $base ),
256
  'format' => '',
257
  'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ),
258
  'current' => $this->pag_page,
309
  /**
310
  * Start the Groups Template Loop
311
  *
312
+ * @since BuddyPress (1.0.0)
313
  *
314
+ * @param array $args {
315
+ * Array of parameters. All items are optional.
316
+ * @type string $type Optional. Shorthand for certain orderby/
317
+ * order combinations. 'newest', 'active', 'popular',
318
+ * 'alphabetical', 'random'. When present, will override
319
+ * orderby and order params. Default: null.
320
+ * @type string $orderby Optional. Property to sort by.
321
+ * 'date_created', 'last_activity', 'total_member_count',
322
+ * 'name', 'random'. Default: 'date_created'.
323
+ * @type string $order Optional. Sort order. 'ASC' or 'DESC'.
324
+ * Default: 'DESC'.
325
+ * @type int $per_page Optional. Number of items to return per page
326
+ * of results. Default: null (no limit).
327
+ * @type int $page Optional. Page offset of results to return.
328
+ * Default: null (no limit).
329
+ * @type int $user_id Optional. If provided, results will be limited
330
+ * to groups of which the specified user is a member. Default:
331
+ * null.
332
+ * @type string $search_terms Optional. If provided, only groups
333
+ * whose names or descriptions match the search terms will be
334
+ * returned. Default: false.
335
+ * @type array $meta_query Optional. An array of meta_query
336
+ * conditions. See {@link WP_Meta_Query::queries} for
337
+ * description.
338
+ * @type array|string Optional. Array or comma-separated list of
339
+ * group IDs. Results will be limited to groups within the
340
+ * list. Default: false.
341
+ * @type bool $populate_extras Whether to fetch additional
342
+ * information (such as member count) about groups. Default:
343
+ * true.
344
+ * @type array|string Optional. Array or comma-separated list of
345
+ * group IDs. Results will exclude the listed groups.
346
+ * Default: false.
347
+ * @type bool $show_hidden Whether to include hidden groups in
348
+ * results. Default: false.
349
+ * }
350
  *
 
351
  * @return bool True if there are groups to display that match the params
352
  */
353
  function bp_has_groups( $args = '' ) {
354
+ global $groups_template;
355
 
356
  /***
357
+ * Defaults based on the current page & overridden by parsed $args
 
 
358
  */
359
+ $slug = false;
360
+ $type = '';
361
+ $search_terms = false;
 
 
 
 
 
362
 
363
+ // When looking your own groups, check for two action variables
 
364
  if ( bp_is_current_action( 'my-groups' ) ) {
365
+ if ( bp_is_action_variable( 'most-popular', 0 ) ) {
366
  $type = 'popular';
367
+ } elseif ( bp_is_action_variable( 'alphabetically', 0 ) ) {
368
  $type = 'alphabetical';
369
  }
370
+
371
+ // When looking at invites, set type to invites
372
  } elseif ( bp_is_current_action( 'invites' ) ) {
373
  $type = 'invites';
374
+
375
+ // When looking at a single group, set the type and slug
376
+ } elseif ( bp_get_current_group_slug() ) {
377
  $type = 'single-group';
378
+ $slug = bp_get_current_group_slug();
379
  }
380
 
381
+ // Default search string (too soon to escape here)
382
  if ( ! empty( $_REQUEST['group-filter-box'] ) ) {
383
  $search_terms = $_REQUEST['group-filter-box'];
384
+ } elseif ( !empty( $_REQUEST['s'] ) ) {
385
  $search_terms = $_REQUEST['s'];
 
 
386
  }
387
 
388
+ // Parse defaults and requested arguments
389
+ $r = bp_parse_args( $args, array(
390
+ 'type' => $type,
391
  'order' => 'DESC',
392
  'orderby' => 'last_activity',
393
  'page' => 1,
394
  'per_page' => 20,
395
  'max' => false,
396
  'show_hidden' => false,
397
+ 'page_arg' => 'grpage',
398
+ 'user_id' => bp_displayed_user_id(),
399
+ 'slug' => $slug,
400
+ 'search_terms' => $search_terms,
401
+ 'meta_query' => false,
402
+ 'include' => false,
403
+ 'exclude' => false,
404
+ 'populate_extras' => true,
 
 
 
405
  'update_meta_cache' => true,
406
+ ), 'has_groups' );
 
 
407
 
408
+ // Setup the Groups template global
409
  $groups_template = new BP_Groups_Template( array(
410
  'type' => $r['type'],
411
  'order' => $r['order'],
425
  'update_meta_cache' => (bool) $r['update_meta_cache'],
426
  ) );
427
 
428
+ // Filter and return whether or not the groups loop has groups in it
429
  return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template, $r );
430
  }
431
 
566
  return apply_filters( 'bp_get_group_status', $group->status );
567
  }
568
 
569
+ /**
570
+ * Output the group avatar while in the groups loop.
571
+ *
572
+ * @since BuddyPress (1.0.0)
573
+ *
574
+ * @param array $args {@see bp_core_fetch_avatar()}
575
+ */
576
  function bp_group_avatar( $args = '' ) {
577
  echo bp_get_group_avatar( $args );
578
  }
579
+ /**
580
+ * Return the group avatar while in the groups loop.
581
+ *
582
+ * @since BuddyPress (1.0.0)
583
+ *
584
+ * @param array $args {@see bp_core_fetch_avatar()}
585
+ */
586
  function bp_get_group_avatar( $args = '' ) {
587
+ global $groups_template;
588
 
589
+ // Bail if avatars are turned off
590
+ // @todo Should we maybe still filter this?
591
+ if ( ! buddypress()->avatar->show_avatars ) {
592
+ return false;
593
+ }
594
+
595
+ // Parse the arguments
596
+ $r = bp_parse_args( $args, array(
597
  'type' => 'full',
598
  'width' => false,
599
  'height' => false,
600
  'class' => 'avatar',
601
  'id' => false,
602
  'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name )
603
+ ) );
604
 
605
+ // Fetch the avatar from the folder
606
+ $avatar = bp_core_fetch_avatar( array(
607
+ 'item_id' => $groups_template->group->id,
608
+ 'title' => $groups_template->group->name,
609
+ 'avatar_dir' => 'group-avatars',
610
+ 'object' => 'group',
611
+ 'type' => $r['type'],
612
+ 'alt' => $r['alt'],
613
+ 'css_id' => $r['id'],
614
+ 'class' => $r['class'],
615
+ 'width' => $r['width'],
616
+ 'height' => $r['height']
617
+ ) );
618
 
619
+ // If No avatar found, provide some backwards compatibility
620
+ if ( empty( $avatar ) ) {
621
  $avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
622
+ }
623
 
624
+ return apply_filters( 'bp_get_group_avatar', $avatar, $r );
625
  }
626
 
627
+ /**
628
+ * Output the group avatar thumbnail while in the groups loop.
629
+ *
630
+ * @since BuddyPress (1.0.0)
631
+ *
632
+ * @param object $group Single group object
633
+ */
634
  function bp_group_avatar_thumb( $group = false ) {
635
  echo bp_get_group_avatar_thumb( $group );
636
  }
637
+ /**
638
+ * Return the group avatar thumbnail while in the groups loop.
639
+ *
640
+ * @since BuddyPress (1.0.0)
641
+ *
642
+ * @param object $group Single group object
643
+ */
644
  function bp_get_group_avatar_thumb( $group = false ) {
645
+ return bp_get_group_avatar( array(
646
+ 'type' => 'thumb',
647
+ 'id' => ! empty( $group->id ) ? $group->id : false
648
+ ) );
649
  }
650
 
651
+ /**
652
+ * Output the miniature group avatar thumbnail while in the groups loop.
653
+ *
654
+ * @since BuddyPress (1.0.0)
655
+ *
656
+ * @param object $group Single group object
657
+ */
658
  function bp_group_avatar_mini( $group = false ) {
659
  echo bp_get_group_avatar_mini( $group );
660
  }
661
+ /**
662
+ * Return the miniature group avatar thumbnail while in the groups loop.
663
+ *
664
+ * @since BuddyPress (1.0.0)
665
+ *
666
+ * @param object $group Single group object
667
+ */
668
  function bp_get_group_avatar_mini( $group = false ) {
669
+ return bp_get_group_avatar( array(
670
+ 'type' => 'thumb',
671
+ 'width' => 30,
672
+ 'height' => 30,
673
+ 'id' => ! empty( $group->id ) ? $group->id : false
674
+ ) );
675
  }
676
 
677
  function bp_group_last_active( $group = false ) {
885
  'height' => false,
886
  'class' => 'avatar',
887
  'id' => false,
888
+ 'alt' => sprintf( __( 'Group creator profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) )
889
  );
890
 
891
  $r = wp_parse_args( $args, $defaults );
1105
  $to_num = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
1106
  $total = bp_core_number_format( $groups_template->total_group_count );
1107
 
1108
+ return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing 1', 'Viewing %1$s - %2$s of %3$s groups', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
1109
  }
1110
 
1111
  function bp_groups_auto_join() {
1625
  }
1626
 
1627
  function bp_group_admin_tabs( $group = false ) {
1628
+ global $groups_template;
1629
 
1630
+ if ( empty( $group ) ) {
1631
+ $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group();
1632
+ }
1633
 
1634
  $current_tab = bp_get_group_current_admin_tab();
1635
 
1644
 
1645
  <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
1646
 
1647
+ <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && buddypress()->avatar->show_avatars ) : ?>
1648
 
1649
+ <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Photo', 'buddypress' ); ?></a></li>
1650
 
1651
  <?php endif; ?>
1652
 
1737
  }
1738
 
1739
  /**
1740
+ * Check whether the current user has an outstanding invite to the current group in the loop.
1741
+ *
1742
+ * @param object $group Optional. Group data object. Defaults to the current
1743
+ * group in the groups loop.
1744
+ * @return bool True if the user has an outstanding invite, otherwise false.
1745
+ */
1746
+ function bp_group_is_invited( $group = false ) {
1747
+ global $groups_template;
1748
+
1749
+ if ( empty( $group ) ) {
1750
+ $group =& $groups_template->group;
1751
+ }
1752
+
1753
+ return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ) );
1754
+ }
1755
+
1756
+ /**
1757
+ * Check if a user is banned from a group.
1758
+ *
1759
+ * If this function is invoked inside the groups template loop, then we check
1760
+ * $groups_template->group->is_banned instead of using {@link groups_is_user_banned()}
1761
+ * and making another SQL query.
1762
+ *
1763
+ * In BuddyPress 2.1, to standardize this function, we are defaulting the
1764
+ * return value to a boolean. In previous versions, using this function would
1765
+ * return either a string of the integer (0 or 1) or null if a result couldn't
1766
+ * be found from the database. If the logged-in user had the 'bp_moderate'
1767
+ * capability, the return value would be boolean false.
1768
  *
1769
+ * @since BuddyPress (1.5.0)
 
 
1770
  *
1771
  * @global BP_Groups_Template $groups_template Group template loop object
1772
+ * @param BP_Groups_Group $group Group to check if user is banned
1773
+ * @param int $user_id The user ID to check
1774
+ * @return bool True if user is banned. False if user isn't banned.
 
1775
  */
1776
  function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
1777
  global $groups_template;
1778
 
1779
  // Site admins always have access
1780
+ if ( bp_current_user_can( 'bp_moderate' ) ) {
1781
  return false;
1782
+ }
1783
 
1784
+ // check groups loop first
1785
+ // @see BP_Groups_Group::get_group_extras()
1786
+ if ( ! empty( $groups_template->in_the_loop ) && isset( $groups_template->group->is_banned ) ) {
1787
+ $retval = $groups_template->group->is_banned;
1788
 
1789
+ // not in loop
1790
+ } else {
1791
+ // Default to not banned
1792
+ $retval = false;
1793
 
1794
+ if ( empty( $group ) ) {
1795
+ $group = $groups_template->group;
1796
+ }
1797
 
1798
+ if ( empty( $user_id ) ) {
1799
+ $user_id = bp_loggedin_user_id();
1800
+ }
1801
+
1802
+ if ( ! empty( $user_id ) && ! empty( $group->id ) ) {
1803
+ $retval = groups_is_user_banned( $user_id, $group->id );
1804
+ }
1805
+ }
1806
+
1807
+ return (bool) apply_filters( 'bp_group_is_user_banned', $retval );
1808
  }
1809
 
1810
  function bp_group_accept_invite_link() {
2105
 
2106
  if ( 'private' == $group->status ) {
2107
  if ( ! bp_group_has_requested_membership() ) {
2108
+ if ( is_user_logged_in() && bp_group_is_invited() ) {
2109
+ $message = __( 'You must accept your pending invitation before you can access this private group.', 'buddypress' );
2110
+ } else if ( is_user_logged_in() ) {
2111
  $message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
2112
+ } else {
2113
  $message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
2114
+ }
2115
 
2116
  } else {
2117
  $message = __( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
2343
  * @type string $type Optional. Sort order of results. 'last_joined',
2344
  * 'first_joined', or any of the $type params available in
2345
  * {@link BP_User_Query}. Default: 'last_joined'.
2346
+ * @type string $search_terms Optional. Search terms to match. Pass an
2347
+ * empty string to force-disable search, even in the presence of
2348
+ * $_REQUEST['s']. Default: null.
2349
  * }
2350
  */
2351
  function bp_group_has_members( $args = '' ) {
2366
  'exclude_admins_mods' => $exclude_admins_mods,
2367
  'exclude_banned' => 1,
2368
  'group_role' => false,
2369
+ 'search_terms' => null,
2370
  'type' => 'last_joined',
2371
  ) );
2372
 
2373
+ if ( is_null( $r['search_terms'] ) && ! empty( $_REQUEST['s'] ) ) {
2374
  $r['search_terms'] = $_REQUEST['s'];
2375
+ }
2376
 
2377
  $members_template = new BP_Groups_Group_Members_Template( $r );
2378
  return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template );
2390
  return $members_template->the_member();
2391
  }
2392
 
2393
+ /**
2394
+ * Output the group member avatar while in the groups members loop.
2395
+ *
2396
+ * @since BuddyPress (1.0.0)
2397
+ *
2398
+ * @param array $args {@see bp_core_fetch_avatar()}
2399
+ */
2400
+ function bp_group_member_avatar( $args = '' ) {
2401
+ echo bp_get_group_member_avatar( $args );
2402
  }
2403
+ /**
2404
+ * Return the group member avatar while in the groups members loop.
2405
+ *
2406
+ * @since BuddyPress (1.0.0)
2407
+ *
2408
+ * @param array $args {@see bp_core_fetch_avatar()}
2409
+ */
2410
+ function bp_get_group_member_avatar( $args = '' ) {
2411
  global $members_template;
2412
 
2413
+ $r = bp_parse_args( $args, array(
2414
+ 'item_id' => $members_template->member->user_id,
2415
+ 'type' => 'full',
2416
+ 'email' => $members_template->member->user_email,
2417
+ 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
2418
+ ) );
2419
+
2420
+ return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( $r ), $r );
2421
  }
2422
 
2423
+ /**
2424
+ * Output the group member avatar while in the groups members loop.
2425
+ *
2426
+ * @since BuddyPress (1.0.0)
2427
+ *
2428
+ * @param array $args {@see bp_core_fetch_avatar()}
2429
+ */
2430
+
2431
+ function bp_group_member_avatar_thumb( $args = '' ) {
2432
+ echo bp_get_group_member_avatar_thumb( $args );
2433
  }
2434
+ /**
2435
+ * Return the group member avatar while in the groups members loop.
2436
+ *
2437
+ * @since BuddyPress (1.0.0)
2438
+ *
2439
+ * @param array $args {@see bp_core_fetch_avatar()}
2440
+ */
2441
+ function bp_get_group_member_avatar_thumb( $args = '' ) {
2442
  global $members_template;
2443
 
2444
+ $r = bp_parse_args( $args, array(
2445
+ 'item_id' => $members_template->member->user_id,
2446
+ 'type' => 'thumb',
2447
+ 'email' => $members_template->member->user_email,
2448
+ 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
2449
+ ) );
2450
+
2451
+ return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( $r ), $r );
2452
  }
2453
 
2454
+ /**
2455
+ * Output the group member avatar while in the groups members loop.
2456
+ *
2457
+ * @since BuddyPress (1.0.0)
2458
+ *
2459
+ * @param array $args {@see bp_core_fetch_avatar()}
2460
+ */
2461
  function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
2462
  echo bp_get_group_member_avatar_mini( $width, $height );
2463
  }
2464
+ /**
2465
+ * Output the group member avatar while in the groups members loop.
2466
+ *
2467
+ * @since BuddyPress (1.0.0)
2468
+ *
2469
+ * @param array $args {@see bp_core_fetch_avatar()}
2470
+ */
2471
  function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) {
2472
  global $members_template;
2473
 
2474
+ $r = bp_parse_args( array(), array(
2475
+ 'item_id' => $members_template->member->user_id,
2476
+ 'type' => 'thumb',
2477
+ 'email' => $members_template->member->user_email,
2478
+ 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ),
2479
+ 'width' => absint( $width ),
2480
+ 'height' => absint( $height )
2481
+ ) );
2482
+
2483
+ return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( $r ), $r );
2484
  }
2485
 
2486
  function bp_group_member_name() {
2603
  $to_num = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
2604
  $total = bp_core_number_format( $members_template->total_member_count );
2605
 
2606
+ return apply_filters( 'bp_get_group_member_pagination_count', sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
2607
  }
2608
 
2609
  function bp_group_member_admin_pagination() {
2659
  <select id="group_members-order-by">
2660
  <option value="last_joined"><?php _e( 'Newest', 'buddypress' ); ?></option>
2661
  <option value="first_joined"><?php _e( 'Oldest', 'buddypress' ); ?></option>
2662
+
2663
+ <?php if ( bp_is_active( 'activity' ) ) : ?>
2664
+ <option value="group_activity"><?php _e( 'Group Activity', 'buddypress' ); ?></option>
2665
+ <?php endif; ?>
2666
+
2667
  <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
2668
 
2669
  <?php do_action( 'bp_groups_members_order_options' ); ?>
3076
  do_action( 'bp_groups_filter_title' );
3077
  }
3078
 
3079
+ /**
3080
+ * Is the current page a specific group admin screen?
3081
+ *
3082
+ * @since BuddyPress (1.1)
3083
+ *
3084
+ * @param string $slug
3085
+ * @return bool
3086
+ */
3087
+ function bp_is_group_admin_screen( $slug = '' ) {
3088
+ return (bool) ( bp_is_group_admin_page() && bp_is_action_variable( $slug ) );
3089
  }
3090
 
3091
  /**
3483
  $to_num = bp_core_number_format( ( $start_num + ( $requests_template->pag_num - 1 ) > $requests_template->total_request_count ) ? $requests_template->total_request_count : $start_num + ( $requests_template->pag_num - 1 ) );
3484
  $total = bp_core_number_format( $requests_template->total_request_count );
3485
 
3486
+ return apply_filters( 'bp_get_group_requests_pagination_count', sprintf( _n( 'Viewing 1 request', 'Viewing %1$s - %2$s of %3$s requests', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
3487
  }
3488
 
3489
  /************************************************************************************
3609
  $this->invite->user->profile_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
3610
  }
3611
 
3612
+ $this->invite->user->avatar = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
3613
+ $this->invite->user->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
3614
+ $this->invite->user->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ), 'width' => 30, 'height' => 30 ) );
3615
  $this->invite->user->email = $this->invite->user->user_email;
3616
  $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login );
3617
  $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}' title='{$this->invite->user->fullname}'>{$this->invite->user->fullname}</a>";
3650
  ) );
3651
 
3652
  if ( empty( $r['group_id'] ) ) {
3653
+ if ( groups_get_current_group() ) {
3654
  $r['group_id'] = bp_get_current_group_id();
3655
+ } elseif ( ! empty( buddypress()->groups->new_group_id ) ) {
3656
  $r['group_id'] = buddypress()->groups->new_group_id;
3657
  }
3658
  }
3778
  $to_num = bp_core_number_format( ( $start_num + ( $invites_template->pag_num - 1 ) > $invites_template->total_invite_count ) ? $invites_template->total_invite_count : $start_num + ( $invites_template->pag_num - 1 ) );
3779
  $total = bp_core_number_format( $invites_template->total_invite_count );
3780
 
3781
+ return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing 1 invitation', 'Viewing %1$s - %2$s of %3$s invitations', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
3782
  }
3783
 
3784
  /***
3804
  echo bp_get_group_activity_feed_link();
3805
  }
3806
  function bp_get_group_activity_feed_link() {
3807
+ return apply_filters( 'bp_get_group_activity_feed_link', bp_get_group_permalink( groups_get_current_group() ) . 'feed/' );
 
 
3808
  }
3809
 
3810
  /**
3826
  * @return int $current_group_id The id of the current group, if there is one
3827
  */
3828
  function bp_get_current_group_id() {
3829
+ $current_group = groups_get_current_group();
 
3830
  $current_group_id = isset( $current_group->id ) ? (int) $current_group->id : 0;
3831
 
3832
  return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
3851
  * @return string $current_group_slug The slug of the current group, if there is one
3852
  */
3853
  function bp_get_current_group_slug() {
3854
+ $current_group = groups_get_current_group();
 
3855
  $current_group_slug = isset( $current_group->slug ) ? $current_group->slug : '';
3856
 
3857
  return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );
3875
  * @return string The name of the current group, if there is one
3876
  */
3877
  function bp_get_current_group_name() {
3878
+ $current_group = groups_get_current_group();
3879
+ $current_group_name = isset( $current_group->name ) ? $current_group->name : '';
3880
+ $name = apply_filters( 'bp_get_group_name', $current_group_name );
3881
+
3882
+ return apply_filters( 'bp_get_current_group_name', $name, $current_group );
3883
+ }
3884
+
3885
+ /**
3886
+ * Echoes the output of bp_get_current_group_description()
3887
+ *
3888
+ * @package BuddyPress
3889
+ * @since BuddyPress (2.1.0)
3890
+ */
3891
+ function bp_current_group_description() {
3892
+ echo bp_get_current_group_description();
3893
+ }
3894
+ /**
3895
+ * Returns the description of the current group
3896
+ *
3897
+ * @package BuddyPress
3898
+ * @since BuddyPress (2.1.0)
3899
+ * @uses apply_filters() Filter bp_get_current_group_description to modify
3900
+ * this output
3901
+ *
3902
+ * @return string The description of the current group, if there is one
3903
+ */
3904
+ function bp_get_current_group_description() {
3905
+ $current_group = groups_get_current_group();
3906
+ $current_group_desc = isset( $current_group->description ) ? $current_group->description : '';
3907
+ $desc = apply_filters( 'bp_get_group_description', $current_group_desc );
3908
 
3909
+ return apply_filters( 'bp_get_current_group_description', $desc );
 
3910
  }
3911
 
3912
+ /**
3913
+ * Output a URL for a group component action
3914
+ *
3915
+ * @since BuddyPress (1.2)
3916
+ *
3917
+ * @param string $action
3918
+ * @param string $query_args
3919
+ * @param bool $nonce
3920
+ * @return string
3921
+ */
3922
  function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
3923
  echo bp_get_groups_action_link( $action, $query_args, $nonce );
3924
  }
3925
+ /**
3926
+ * Get a URL for a group component action
3927
+ *
3928
+ * @since BuddyPress (1.2)
3929
+ *
3930
+ * @param string $action
3931
+ * @param string $query_args
3932
+ * @param bool $nonce
3933
+ * @return string
3934
+ */
3935
  function bp_get_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
3936
+
3937
+ $current_group = groups_get_current_group();
3938
+ $url = '';
3939
 
3940
  // Must be a group
3941
+ if ( ! empty( $current_group->id ) ) {
 
3942
 
3943
+ // Append $action to $url if provided
3944
+ if ( !empty( $action ) ) {
3945
+ $url = bp_get_group_permalink( $current_group ) . $action;
3946
+ } else {
3947
+ $url = bp_get_group_permalink( $current_group );
3948
+ }
3949
 
3950
+ // Add a slash at the end of our user url
3951
+ $url = trailingslashit( $url );
3952
 
3953
+ // Add possible query args
3954
+ if ( !empty( $query_args ) && is_array( $query_args ) ) {
3955
+ $url = add_query_arg( $query_args, $url );
3956
+ }
3957
 
3958
+ // To nonce, or not to nonce...
3959
+ if ( true === $nonce ) {
3960
+ $url = wp_nonce_url( $url );
3961
+ } elseif ( is_string( $nonce ) ) {
3962
+ $url = wp_nonce_url( $url, $nonce );
3963
+ }
3964
+ }
3965
 
3966
+ // Return the url
3967
+ return apply_filters( 'bp_get_groups_action_link', $url, $action, $query_args, $nonce );
 
3968
  }
3969
 
3970
  /** Stats **********************************************************************/
bp-groups/bp-groups-widgets.php CHANGED
@@ -58,9 +58,18 @@ class BP_Groups_Widget extends WP_Widget {
58
 
59
  $title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $title . '</a>' : $title;
60
 
61
- echo $before_title . $title . $after_title; ?>
62
 
63
- <?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
 
 
 
 
 
 
 
 
 
64
  <div class="item-options" id="groups-list-options">
65
  <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> |
66
  <a href="<?php bp_groups_directory_permalink(); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a> |
58
 
59
  $title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $title . '</a>' : $title;
60
 
61
+ echo $before_title . $title . $after_title;
62
 
63
+ $group_args = array(
64
+ 'user_id' => $user_id,
65
+ 'type' => $instance['group_default'],
66
+ 'per_page' => $instance['max_groups'],
67
+ 'max' => $instance['max_groups'],
68
+ );
69
+
70
+ ?>
71
+
72
+ <?php if ( bp_has_groups( $group_args ) ) : ?>
73
  <div class="item-options" id="groups-list-options">
74
  <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> |
75
  <a href="<?php bp_groups_directory_permalink(); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a> |
bp-groups/js/widget-groups.js CHANGED
@@ -1,17 +1,17 @@
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)
@@ -29,20 +29,20 @@ 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
  }
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)
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
  }
bp-groups/js/widget-groups.min.js CHANGED
@@ -1 +1,2 @@
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)})}};
 
1
+ /*! buddypress - v2.1.0 - 2014-09-16 3:09:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
+ function groups_wiget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):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)})}jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;return 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)}),!1})});
bp-languages/buddypress.pot DELETED
@@ -1,7212 +0,0 @@
1
- # Copyright (C) 2014 BuddyPress
2
- # This file is distributed under the same license as the BuddyPress package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: BuddyPress \n"
6
- "Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
7
- "POT-Creation-Date: 2014-04-18 17:30:35+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
-
15
- #: bp-activity/bp-activity-actions.php:157
16
- msgid "Activity deleted successfully"
17
- msgstr ""
18
-
19
- #: bp-activity/bp-activity-actions.php:159
20
- msgid "There was an error when deleting that activity"
21
- msgstr ""
22
-
23
- #: bp-activity/bp-activity-actions.php:214
24
- msgid "The activity item has been marked as spam and is no longer visible."
25
- msgstr ""
26
-
27
- #: bp-activity/bp-activity-actions.php:269
28
- #: bp-templates/bp-legacy/buddypress-functions.php:692
29
- #: bp-themes/bp-default/_inc/ajax.php:276
30
- msgid "Please enter some content to post."
31
- msgstr ""
32
-
33
- #: bp-activity/bp-activity-actions.php:290
34
- msgid "Update Posted!"
35
- msgstr ""
36
-
37
- #: bp-activity/bp-activity-actions.php:292
38
- msgid "There was an error when posting your update, please try again."
39
- msgstr ""
40
-
41
- #: bp-activity/bp-activity-actions.php:329
42
- #: bp-templates/bp-legacy/buddypress-functions.php:753
43
- #: bp-themes/bp-default/_inc/ajax.php:324
44
- msgid "Please do not leave the comment area blank."
45
- msgstr ""
46
-
47
- #: bp-activity/bp-activity-actions.php:340
48
- msgid "Reply Posted!"
49
- msgstr ""
50
-
51
- #: bp-activity/bp-activity-actions.php:342
52
- #: bp-templates/bp-legacy/buddypress-functions.php:756
53
- #: bp-templates/bp-legacy/buddypress-functions.php:765
54
- #: bp-themes/bp-default/_inc/ajax.php:327
55
- #: bp-themes/bp-default/_inc/ajax.php:336
56
- msgid "There was an error posting that reply, please try again."
57
- msgstr ""
58
-
59
- #: bp-activity/bp-activity-actions.php:374
60
- msgid "Activity marked as favorite."
61
- msgstr ""
62
-
63
- #: bp-activity/bp-activity-actions.php:376
64
- msgid "There was an error marking that activity as a favorite, please try again."
65
- msgstr ""
66
-
67
- #: bp-activity/bp-activity-actions.php:408
68
- msgid "Activity removed as favorite."
69
- msgstr ""
70
-
71
- #: bp-activity/bp-activity-actions.php:410
72
- msgid "There was an error removing that activity as a favorite, please try again."
73
- msgstr ""
74
-
75
- #. translators: Sitewide activity RSS title - "[Site Name] | Site Wide
76
- #. Activity"
77
-
78
- #: bp-activity/bp-activity-actions.php:440
79
- msgid "%s | Site Wide Activity"
80
- msgstr ""
81
-
82
- #: bp-activity/bp-activity-actions.php:443
83
- msgid "Activity feed for the entire site."
84
- msgstr ""
85
-
86
- #. translators: Personal activity RSS title - "[Site Name] | [User Display
87
- #. Name] | Activity"
88
- #. translators: Group activity RSS title - "[Site Name] | [Group Name] |
89
- #. Activity"
90
-
91
- #: bp-activity/bp-activity-actions.php:470 bp-groups/bp-groups-actions.php:389
92
- msgid "%1$s | %2$s | Activity"
93
- msgstr ""
94
-
95
- #: bp-activity/bp-activity-actions.php:473
96
- msgid "Activity feed for %s."
97
- msgstr ""
98
-
99
- #. translators: Friends activity RSS title - "[Site Name] | [User Display Name]
100
- #. | Friends Activity"
101
-
102
- #: bp-activity/bp-activity-actions.php:503
103
- msgid "%1$s | %2$s | Friends Activity"
104
- msgstr ""
105
-
106
- #: bp-activity/bp-activity-actions.php:506
107
- msgid "Activity feed for %s's friends."
108
- msgstr ""
109
-
110
- #. translators: Member groups activity RSS title - "[Site Name] | [User Display
111
- #. Name] | Groups Activity"
112
-
113
- #: bp-activity/bp-activity-actions.php:540
114
- msgid "%1$s | %2$s | Group Activity"
115
- msgstr ""
116
-
117
- #: bp-activity/bp-activity-actions.php:543
118
- msgid "Public group activity feed of which %s is a member of."
119
- msgstr ""
120
-
121
- #. translators: User mentions activity RSS title - "[Site Name] | [User Display
122
- #. Name] | Mentions"
123
-
124
- #: bp-activity/bp-activity-actions.php:579
125
- msgid "%1$s | %2$s | Mentions"
126
- msgstr ""
127
-
128
- #: bp-activity/bp-activity-actions.php:582
129
- msgid "Activity feed mentioning %s."
130
- msgstr ""
131
-
132
- #. translators: User activity favorites RSS title - "[Site Name] | [User
133
- #. Display Name] | Favorites"
134
-
135
- #: bp-activity/bp-activity-actions.php:616
136
- msgid "%1$s | %2$s | Favorites"
137
- msgstr ""
138
-
139
- #: bp-activity/bp-activity-actions.php:619
140
- msgid "Activity feed of %s's favorites."
141
- msgstr ""
142
-
143
- #: bp-activity/bp-activity-admin.php:32 bp-activity/bp-activity-admin.php:33
144
- #: bp-activity/bp-activity-admin.php:906 bp-activity/bp-activity-admin.php:1242
145
- #: bp-activity/bp-activity-loader.php:139
146
- #: bp-activity/bp-activity-loader.php:268
147
- #: bp-activity/bp-activity-screens.php:270
148
- #: bp-activity/bp-activity-screens.php:437 bp-core/bp-core-admin.php:525
149
- msgid "Activity"
150
- msgstr ""
151
-
152
- #: bp-activity/bp-activity-admin.php:88
153
- msgid "ERROR: Please type a reply."
154
- msgstr ""
155
-
156
- #: bp-activity/bp-activity-admin.php:93
157
- msgid "ERROR: The item you are trying to reply to cannot be found, or it has been deleted."
158
- msgstr ""
159
-
160
- #: bp-activity/bp-activity-admin.php:211 bp-activity/bp-activity-admin.php:258
161
- #: bp-core/admin/bp-core-functions.php:451
162
- #: bp-core/admin/bp-core-functions.php:469
163
- #: bp-core/admin/bp-core-functions.php:488
164
- #: bp-core/admin/bp-core-functions.php:507 bp-groups/bp-groups-admin.php:111
165
- #: bp-groups/bp-groups-admin.php:146 bp-members/bp-members-admin.php:384
166
- #: bp-members/bp-members-admin.php:921
167
- msgid "Overview"
168
- msgstr ""
169
-
170
- #: bp-activity/bp-activity-admin.php:213
171
- 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."
172
- msgstr ""
173
-
174
- #: bp-activity/bp-activity-admin.php:214
175
- 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."
176
- msgstr ""
177
-
178
- #: bp-activity/bp-activity-admin.php:215
179
- msgid "You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity."
180
- msgstr ""
181
-
182
- #: bp-activity/bp-activity-admin.php:220
183
- msgid "Item, Link, Type"
184
- msgstr ""
185
-
186
- #: bp-activity/bp-activity-admin.php:222
187
- 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."
188
- msgstr ""
189
-
190
- #: bp-activity/bp-activity-admin.php:223
191
- msgid "<strong>Link</strong> - Activity generated by 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."
192
- msgstr ""
193
-
194
- #: bp-activity/bp-activity-admin.php:224
195
- 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."
196
- msgstr ""
197
-
198
- #: bp-activity/bp-activity-admin.php:225
199
- msgid "For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side."
200
- msgstr ""
201
-
202
- #: bp-activity/bp-activity-admin.php:230 bp-activity/bp-activity-admin.php:275
203
- #: bp-core/admin/bp-core-functions.php:457
204
- #: bp-core/admin/bp-core-functions.php:475
205
- #: bp-core/admin/bp-core-functions.php:494
206
- #: bp-core/admin/bp-core-functions.php:513 bp-groups/bp-groups-admin.php:119
207
- #: bp-groups/bp-groups-admin.php:162 bp-members/bp-members-admin.php:393
208
- #: bp-members/bp-members-admin.php:942
209
- msgid "For more information:"
210
- msgstr ""
211
-
212
- #: bp-activity/bp-activity-admin.php:231
213
- msgid "<a href=\"http://codex.buddypress.org/buddypress-site-administration/managing-activity/\">Managing Activity</a>"
214
- msgstr ""
215
-
216
- #: bp-activity/bp-activity-admin.php:232 bp-activity/bp-activity-admin.php:276
217
- #: bp-core/admin/bp-core-functions.php:459
218
- #: bp-core/admin/bp-core-functions.php:477
219
- #: bp-core/admin/bp-core-functions.php:496
220
- #: bp-core/admin/bp-core-functions.php:515 bp-groups/bp-groups-admin.php:163
221
- #: bp-members/bp-members-admin.php:395 bp-members/bp-members-admin.php:943
222
- msgid "<a href=\"http://buddypress.org/support/\">Support Forums</a>"
223
- msgstr ""
224
-
225
- #: bp-activity/bp-activity-admin.php:236
226
- msgctxt "activity admin edit screen"
227
- msgid "Status"
228
- msgstr ""
229
-
230
- #: bp-activity/bp-activity-admin.php:237
231
- msgctxt "activity admin edit screen"
232
- msgid "Primary Item/Secondary Item"
233
- msgstr ""
234
-
235
- #: bp-activity/bp-activity-admin.php:238
236
- msgctxt "activity admin edit screen"
237
- msgid "Link"
238
- msgstr ""
239
-
240
- #: bp-activity/bp-activity-admin.php:239
241
- msgctxt "activity admin edit screen"
242
- msgid "Type"
243
- msgstr ""
244
-
245
- #: bp-activity/bp-activity-admin.php:240
246
- msgctxt "activity admin edit screen"
247
- msgid "Author ID"
248
- msgstr ""
249
-
250
- #: bp-activity/bp-activity-admin.php:253
251
- msgctxt "Activity items per page (screen options)"
252
- msgid "Activity"
253
- msgstr ""
254
-
255
- #: bp-activity/bp-activity-admin.php:260
256
- 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."
257
- msgstr ""
258
-
259
- #: bp-activity/bp-activity-admin.php:261
260
- 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."
261
- msgstr ""
262
-
263
- #: bp-activity/bp-activity-admin.php:267
264
- msgid "Moderating Activity"
265
- msgstr ""
266
-
267
- #: bp-activity/bp-activity-admin.php:269
268
- 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."
269
- msgstr ""
270
-
271
- #: bp-activity/bp-activity-admin.php:270
272
- 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."
273
- msgstr ""
274
-
275
- #: bp-activity/bp-activity-admin.php:588
276
- msgid "Editing Activity (ID #%s)"
277
- msgstr ""
278
-
279
- #: bp-activity/bp-activity-admin.php:599 bp-activity/bp-activity-admin.php:1243
280
- msgid "Action"
281
- msgstr ""
282
-
283
- #: bp-activity/bp-activity-admin.php:606
284
- msgid "Content"
285
- msgstr ""
286
-
287
- #: bp-activity/bp-activity-admin.php:631
288
- msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>."
289
- msgstr ""
290
-
291
- #: bp-activity/bp-activity-admin.php:654
292
- msgid "View Activity"
293
- msgstr ""
294
-
295
- #: bp-activity/bp-activity-admin.php:662
296
- msgid "Approved"
297
- msgstr ""
298
-
299
- #: bp-activity/bp-activity-admin.php:663 bp-activity/bp-activity-admin.php:1398
300
- #: bp-activity/bp-activity-akismet.php:197
301
- #: bp-activity/bp-activity-akismet.php:226
302
- msgid "Spam"
303
- msgstr ""
304
-
305
- #. translators: Publish box date format, see http:php.net/date
306
-
307
- #: bp-activity/bp-activity-admin.php:669 bp-members/bp-members-admin.php:650
308
- #: bp-members/bp-members-admin.php:711
309
- msgid "M j, Y @ G:i"
310
- msgstr ""
311
-
312
- #: bp-activity/bp-activity-admin.php:672
313
- msgid "Submitted on: <strong>%1$s</strong>"
314
- msgstr ""
315
-
316
- #: bp-activity/bp-activity-admin.php:672 bp-activity/bp-activity-admin.php:1391
317
- #: bp-forums/bp-forums-template.php:2112 bp-groups/bp-groups-admin.php:1396
318
- #: bp-themes/bp-default/functions.php:509 bp-xprofile/bp-xprofile-admin.php:402
319
- #: bp-xprofile/bp-xprofile-loader.php:195
320
- #: bp-xprofile/bp-xprofile-loader.php:273
321
- msgid "Edit"
322
- msgstr ""
323
-
324
- #: bp-activity/bp-activity-admin.php:685
325
- msgid "Update"
326
- msgstr ""
327
-
328
- #: bp-activity/bp-activity-admin.php:705
329
- msgid "Link"
330
- msgstr ""
331
-
332
- #: bp-activity/bp-activity-admin.php:707
333
- msgid "Activity generated by posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item."
334
- msgstr ""
335
-
336
- #: bp-activity/bp-activity-admin.php:722
337
- msgid "Author ID"
338
- msgstr ""
339
-
340
- #: bp-activity/bp-activity-admin.php:791
341
- msgid "This activity item has a type (%s) that is not registered using bp_activity_set_action(), so no label is available."
342
- msgstr ""
343
-
344
- #: bp-activity/bp-activity-admin.php:816
345
- msgid "Primary Item ID"
346
- msgstr ""
347
-
348
- #: bp-activity/bp-activity-admin.php:820
349
- msgid "Secondary Item ID"
350
- msgstr ""
351
-
352
- #: bp-activity/bp-activity-admin.php:823
353
- msgid "These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs."
354
- msgstr ""
355
-
356
- #: bp-activity/bp-activity-admin.php:863
357
- msgid "%s activity item has been permanently deleted."
358
- msgid_plural "%s activity items have been permanently deleted."
359
- msgstr[0] ""
360
- msgstr[1] ""
361
-
362
- #: bp-activity/bp-activity-admin.php:867
363
- msgid "An error occurred when trying to update activity ID #%s."
364
- msgstr ""
365
-
366
- #: bp-activity/bp-activity-admin.php:870
367
- msgid "Errors occurred when trying to update these activity items:"
368
- msgstr ""
369
-
370
- #. Translators: This is a bulleted list of item IDs
371
-
372
- #: bp-activity/bp-activity-admin.php:876
373
- msgid "#%s"
374
- msgstr ""
375
-
376
- #: bp-activity/bp-activity-admin.php:885
377
- msgid "%s activity item has been successfully spammed."
378
- msgid_plural "%s activity items have been successfully spammed."
379
- msgstr[0] ""
380
- msgstr[1] ""
381
-
382
- #: bp-activity/bp-activity-admin.php:888
383
- msgid "%s activity item has been successfully unspammed."
384
- msgid_plural "%s activity items have been successfully unspammed."
385
- msgstr[0] ""
386
- msgstr[1] ""
387
-
388
- #: bp-activity/bp-activity-admin.php:891
389
- msgid "The activity item has been updated succesfully."
390
- msgstr ""
391
-
392
- #: bp-activity/bp-activity-admin.php:904
393
- msgid "Activity related to ID #%s"
394
- msgstr ""
395
-
396
- #: bp-activity/bp-activity-admin.php:910 bp-groups/bp-groups-admin.php:645
397
- #: bp-members/bp-members-admin.php:1300
398
- msgid "Search results for &#8220;%s&#8221;"
399
- msgstr ""
400
-
401
- #: bp-activity/bp-activity-admin.php:923
402
- msgid "Search all Activity"
403
- msgstr ""
404
-
405
- #: bp-activity/bp-activity-admin.php:934
406
- msgid "Reply to Activity"
407
- msgstr ""
408
-
409
- #: bp-activity/bp-activity-admin.php:938 bp-groups/bp-groups-admin.php:599
410
- #: bp-members/bp-members-admin.php:1425
411
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:102
412
- #: bp-templates/bp-legacy/buddypress/forums/index.php:116
413
- #: bp-themes/bp-default/forums/index.php:134
414
- #: bp-xprofile/bp-xprofile-classes.php:506
415
- #: bp-xprofile/bp-xprofile-classes.php:891
416
- msgid "Cancel"
417
- msgstr ""
418
-
419
- #: bp-activity/bp-activity-admin.php:939 bp-activity/bp-activity-admin.php:1385
420
- #: bp-templates/bp-legacy/buddypress/activity/comment.php:37
421
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:10
422
- #: bp-themes/bp-default/activity/comment.php:40
423
- #: bp-themes/bp-default/groups/single/forum/edit.php:10
424
- msgid "Reply"
425
- msgstr ""
426
-
427
- #: bp-activity/bp-activity-admin.php:1132
428
- msgid "No activities found."
429
- msgstr ""
430
-
431
- #: bp-activity/bp-activity-admin.php:1205 bp-groups/bp-groups-admin.php:1267
432
- #: bp-messages/bp-messages-template.php:538
433
- msgid "All"
434
- msgstr ""
435
-
436
- #: bp-activity/bp-activity-admin.php:1206
437
- msgid "Spam <span class=\"count\">(%s)</span>"
438
- msgstr ""
439
-
440
- #: bp-activity/bp-activity-admin.php:1222
441
- #: bp-core/admin/bp-core-functions.php:847
442
- msgid "Mark as Spam"
443
- msgstr ""
444
-
445
- #: bp-activity/bp-activity-admin.php:1223
446
- #: bp-activity/bp-activity-admin.php:1396
447
- #: bp-core/admin/bp-core-functions.php:845
448
- msgid "Not Spam"
449
- msgstr ""
450
-
451
- #: bp-activity/bp-activity-admin.php:1224
452
- #: bp-activity/bp-activity-admin.php:1401 bp-groups/bp-groups-admin.php:598
453
- msgid "Delete Permanently"
454
- msgstr ""
455
-
456
- #: bp-activity/bp-activity-admin.php:1241
457
- msgid "Author"
458
- msgstr ""
459
-
460
- #: bp-activity/bp-activity-admin.php:1244
461
- msgid "In Response To"
462
- msgstr ""
463
-
464
- #: bp-activity/bp-activity-admin.php:1287
465
- msgid "Show all activity types"
466
- msgstr ""
467
-
468
- #: bp-activity/bp-activity-admin.php:1294
469
- msgid "Filter"
470
- msgstr ""
471
-
472
- #: bp-activity/bp-activity-admin.php:1310
473
- msgid "Select activity item %1$d"
474
- msgstr ""
475
-
476
- #: bp-activity/bp-activity-admin.php:1341
477
- msgid "Unregistered action - %s"
478
- msgstr ""
479
-
480
- #: bp-activity/bp-activity-admin.php:1387
481
- msgid "Replies are disabled for this activity item"
482
- msgstr ""
483
-
484
- #: bp-activity/bp-activity-admin.php:1387
485
- msgid "Replies disabled"
486
- msgstr ""
487
-
488
- #: bp-activity/bp-activity-admin.php:1401 bp-core/bp-core-cssjs.php:24
489
- msgid "Are you sure?"
490
- msgstr ""
491
-
492
- #. translators: 2: activity admin ui date/time
493
-
494
- #: bp-activity/bp-activity-admin.php:1410
495
- msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
496
- msgstr ""
497
-
498
- #: bp-activity/bp-activity-admin.php:1442
499
- msgid "%s related activity"
500
- msgid_plural "%s related activities"
501
- msgstr[0] ""
502
- msgstr[1] ""
503
-
504
- #: bp-activity/bp-activity-admin.php:1453
505
- msgid "<a href=\"%1$s\">View Activity</a>"
506
- msgstr ""
507
-
508
- #: bp-activity/bp-activity-akismet.php:86
509
- msgid "Flagged as spam by Akismet"
510
- msgstr ""
511
-
512
- #: bp-activity/bp-activity-akismet.php:89
513
- msgid "Cleared by Akismet"
514
- msgstr ""
515
-
516
- #: bp-activity/bp-activity-akismet.php:95
517
- msgid "Flagged as spam by %s"
518
- msgstr ""
519
-
520
- #: bp-activity/bp-activity-akismet.php:97
521
- msgid "Un-spammed by %s"
522
- msgstr ""
523
-
524
- #: bp-activity/bp-activity-akismet.php:106
525
- msgid "History"
526
- msgstr ""
527
-
528
- #: bp-activity/bp-activity-akismet.php:373
529
- msgid "%s reported this activity as spam"
530
- msgstr ""
531
-
532
- #: bp-activity/bp-activity-akismet.php:390
533
- msgid "%s reported this activity as not spam"
534
- msgstr ""
535
-
536
- #: bp-activity/bp-activity-akismet.php:414
537
- msgid "Akismet caught this item as spam"
538
- msgstr ""
539
-
540
- #: bp-activity/bp-activity-akismet.php:419
541
- msgid "Akismet cleared this item"
542
- msgstr ""
543
-
544
- #: bp-activity/bp-activity-akismet.php:424
545
- msgid "Akismet was unable to check this item (response: %s), will automatically retry again later."
546
- msgstr ""
547
-
548
- #: bp-activity/bp-activity-akismet.php:538
549
- msgid "Activity History"
550
- msgstr ""
551
-
552
- #: bp-activity/bp-activity-akismet.php:558
553
- msgctxt "x hours ago - akismet cleared this item"
554
- msgid "<span>%1$s</span> &mdash; %2$s"
555
- msgstr ""
556
-
557
- #: bp-activity/bp-activity-classes.php:280
558
- #: bp-activity/bp-activity-template.php:139 bp-groups/bp-groups-classes.php:646
559
- #: bp-groups/bp-groups-functions.php:418 bp-groups/bp-groups-template.php:112
560
- #: bp-groups/bp-groups-template.php:2024 bp-groups/bp-groups-template.php:2992
561
- #: bp-groups/bp-groups-template.php:3260
562
- msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details."
563
- msgstr ""
564
-
565
- #: bp-activity/bp-activity-classes.php:1427
566
- msgid "RSS feed 'id' must be defined"
567
- msgstr ""
568
-
569
- #: bp-activity/bp-activity-classes.php:1540
570
- msgid "In reply to"
571
- msgstr ""
572
-
573
- #: bp-activity/bp-activity-filters.php:380
574
- msgid "[Read more]"
575
- msgstr ""
576
-
577
- #: bp-activity/bp-activity-filters.php:385
578
- msgid "&hellip;"
579
- msgstr ""
580
-
581
- #: bp-activity/bp-activity-filters.php:567
582
- msgid "Load Newest"
583
- msgstr ""
584
-
585
- #: bp-activity/bp-activity-functions.php:837
586
- msgid "Posted a status update"
587
- msgstr ""
588
-
589
- #: bp-activity/bp-activity-functions.php:844
590
- msgid "Replied to a status update"
591
- msgstr ""
592
-
593
- #: bp-activity/bp-activity-functions.php:895
594
- msgid "%s posted an update"
595
- msgstr ""
596
-
597
- #: bp-activity/bp-activity-functions.php:909
598
- #: tests/testcases/activity/class.BP_Activity_Activity.php:216
599
- msgid "%s posted a new activity comment"
600
- msgstr ""
601
-
602
- #: bp-activity/bp-activity-functions.php:1671
603
- msgid "Thumbnail"
604
- msgstr ""
605
-
606
- #: bp-activity/bp-activity-loader.php:30
607
- #: bp-core/admin/bp-core-components.php:380
608
- msgid "Activity Streams"
609
- msgstr ""
610
-
611
- #: bp-activity/bp-activity-loader.php:109
612
- msgctxt "component directory title"
613
- msgid "Sitewide Activity"
614
- msgstr ""
615
-
616
- #: bp-activity/bp-activity-loader.php:111
617
- msgid "Search Activity..."
618
- msgstr ""
619
-
620
- #: bp-activity/bp-activity-loader.php:165
621
- #: bp-activity/bp-activity-loader.php:276
622
- msgid "Personal"
623
- msgstr ""
624
-
625
- #: bp-activity/bp-activity-loader.php:176
626
- #: bp-activity/bp-activity-loader.php:260
627
- #: bp-templates/bp-legacy/buddypress/activity/index.php:59
628
- #: bp-themes/bp-default/activity/index.php:79
629
- msgid "Mentions"
630
- msgstr ""
631
-
632
- #: bp-activity/bp-activity-loader.php:188
633
- #: bp-activity/bp-activity-loader.php:294
634
- msgid "Favorites"
635
- msgstr ""
636
-
637
- #: bp-activity/bp-activity-loader.php:200
638
- #: bp-activity/bp-activity-loader.php:303 bp-friends/bp-friends-loader.php:188
639
- #: bp-friends/bp-friends-screens.php:85
640
- msgid "Friends"
641
- msgstr ""
642
-
643
- #: bp-activity/bp-activity-loader.php:213
644
- #: bp-activity/bp-activity-loader.php:313 bp-core/bp-core-template.php:389
645
- #: bp-groups/bp-groups-admin.php:32 bp-groups/bp-groups-admin.php:33
646
- #: bp-groups/bp-groups-admin.php:638 bp-groups/bp-groups-loader.php:365
647
- #: bp-groups/bp-groups-loader.php:540 bp-groups/bp-groups-notifications.php:377
648
- #: bp-groups/bp-groups-notifications.php:413
649
- #: bp-groups/bp-groups-notifications.php:449
650
- #: bp-groups/bp-groups-notifications.php:485
651
- #: bp-groups/bp-groups-screens.php:936 bp-groups/bp-groups-screens.php:1122
652
- #: bp-groups/bp-groups-widgets.php:53 bp-groups/bp-groups-widgets.php:124
653
- msgid "Groups"
654
- msgstr ""
655
-
656
- #: bp-activity/bp-activity-loader.php:258
657
- msgid "Mentions <span class=\"count\">%s</span>"
658
- msgstr ""
659
-
660
- #: bp-activity/bp-activity-loader.php:337
661
- msgid "My Activity"
662
- msgstr ""
663
-
664
- #: bp-activity/bp-activity-loader.php:342
665
- #: bp-activity/bp-activity-template.php:1208
666
- #: bp-activity/bp-activity-template.php:1358
667
- #: bp-activity/bp-activity-template.php:1369 bp-blogs/bp-blogs-loader.php:236
668
- #: bp-forums/bp-forums-loader.php:245 bp-forums/bp-forums-template.php:730
669
- #: bp-forums/bp-forums-template.php:960 bp-forums/bp-forums-template.php:1990
670
- #: bp-friends/bp-friends-loader.php:234 bp-groups/bp-groups-loader.php:601
671
- #: bp-groups/bp-groups-template.php:800 bp-groups/bp-groups-template.php:837
672
- #: bp-groups/bp-groups-template.php:1266 bp-groups/bp-groups-template.php:1282
673
- #: bp-groups/bp-groups-template.php:1331 bp-groups/bp-groups-template.php:1347
674
- #: bp-groups/bp-groups-template.php:2222 bp-groups/bp-groups-template.php:2231
675
- #: bp-groups/bp-groups-template.php:2240 bp-groups/bp-groups-template.php:3151
676
- #: bp-members/bp-members-buddybar.php:64 bp-members/bp-members-loader.php:224
677
- #: bp-members/bp-members-template.php:520
678
- #: bp-members/bp-members-template.php:881
679
- #: bp-members/bp-members-template.php:900
680
- #: bp-messages/bp-messages-loader.php:265
681
- #: bp-messages/bp-messages-template.php:417
682
- #: bp-notifications/bp-notifications-loader.php:236
683
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:185
684
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:212
685
- #: bp-themes/bp-default/groups/single/admin.php:185
686
- #: bp-themes/bp-default/groups/single/admin.php:212
687
- #: bp-xprofile/bp-xprofile-loader.php:314
688
- msgid "Profile picture of %s"
689
- msgstr ""
690
-
691
- #: bp-activity/bp-activity-notifications.php:73
692
- msgid "%s mentioned you in an update"
693
- msgstr ""
694
-
695
- #: bp-activity/bp-activity-notifications.php:76 bp-core/deprecated/1.5.php:354
696
- msgid ""
697
- "%1$s mentioned you in the group \"%2$s\":\n"
698
- "\n"
699
- "\"%3$s\"\n"
700
- "\n"
701
- "To view and respond to the message, log in and visit: %4$s\n"
702
- "\n"
703
- "---------------------\n"
704
- msgstr ""
705
-
706
- #: bp-activity/bp-activity-notifications.php:86
707
- msgid ""
708
- "%1$s mentioned you in an update:\n"
709
- "\n"
710
- "\"%2$s\"\n"
711
- "\n"
712
- "To view and respond to the message, log in and visit: %3$s\n"
713
- "\n"
714
- "---------------------\n"
715
- msgstr ""
716
-
717
- #: bp-activity/bp-activity-notifications.php:99
718
- #: bp-activity/bp-activity-notifications.php:177
719
- #: bp-activity/bp-activity-notifications.php:226 bp-core/deprecated/1.5.php:364
720
- #: bp-friends/bp-friends-notifications.php:56
721
- #: bp-friends/bp-friends-notifications.php:105
722
- #: bp-groups/bp-groups-notifications.php:44
723
- #: bp-groups/bp-groups-notifications.php:108
724
- #: bp-groups/bp-groups-notifications.php:173
725
- #: bp-groups/bp-groups-notifications.php:232
726
- #: bp-groups/bp-groups-notifications.php:295
727
- #: bp-messages/bp-messages-notifications.php:85
728
- msgid "To disable these notifications please log in and go to: %s"
729
- msgstr ""
730
-
731
- #: bp-activity/bp-activity-notifications.php:164
732
- msgid "%s replied to one of your updates"
733
- msgstr ""
734
-
735
- #: bp-activity/bp-activity-notifications.php:165
736
- msgid ""
737
- "%1$s replied to one of your updates:\n"
738
- "\n"
739
- "\"%2$s\"\n"
740
- "\n"
741
- "To view your original update and all comments, log in and visit: %3$s\n"
742
- "\n"
743
- "---------------------\n"
744
- msgstr ""
745
-
746
- #: bp-activity/bp-activity-notifications.php:209
747
- msgid "%s replied to one of your comments"
748
- msgstr ""
749
-
750
- #: bp-activity/bp-activity-notifications.php:214
751
- msgid ""
752
- "%1$s replied to one of your comments:\n"
753
- "\n"
754
- "\"%2$s\"\n"
755
- "\n"
756
- "To view the original activity, your comment and all replies, log in and visit: %3$s\n"
757
- "\n"
758
- "---------------------\n"
759
- msgstr ""
760
-
761
- #: bp-activity/bp-activity-notifications.php:280
762
- msgid "@%s Mentions"
763
- msgstr ""
764
-
765
- #: bp-activity/bp-activity-notifications.php:283
766
- msgid "You have %1$d new mentions"
767
- msgstr ""
768
-
769
- #: bp-activity/bp-activity-notifications.php:287
770
- msgid "%1$s mentioned you"
771
- msgstr ""
772
-
773
- #: bp-activity/bp-activity-screens.php:231
774
- msgid "You do not have access to this activity."
775
- msgstr ""
776
-
777
- #: bp-activity/bp-activity-screens.php:271 bp-blogs/bp-blogs-template.php:997
778
- #: bp-friends/bp-friends-screens.php:86 bp-groups/bp-groups-screens.php:937
779
- #: bp-messages/bp-messages-screens.php:169
780
- #: bp-templates/bp-legacy/buddypress/members/register.php:148
781
- #: bp-themes/bp-default/registration/register.php:232
782
- msgid "Yes"
783
- msgstr ""
784
-
785
- #: bp-activity/bp-activity-screens.php:272 bp-blogs/bp-blogs-template.php:1001
786
- #: bp-friends/bp-friends-screens.php:87 bp-groups/bp-groups-screens.php:938
787
- #: bp-messages/bp-messages-screens.php:170
788
- #: bp-templates/bp-legacy/buddypress/members/register.php:149
789
- #: bp-themes/bp-default/registration/register.php:233
790
- msgid "No"
791
- msgstr ""
792
-
793
- #: bp-activity/bp-activity-screens.php:280
794
- msgid "A member mentions you in an update using \"@%s\""
795
- msgstr ""
796
-
797
- #: bp-activity/bp-activity-screens.php:288
798
- msgid "A member replies to an update or comment you've posted"
799
- msgstr ""
800
-
801
- #: bp-activity/bp-activity-template.php:266
802
- msgctxt "Activity pagination previous text"
803
- msgid "&larr;"
804
- msgstr ""
805
-
806
- #: bp-activity/bp-activity-template.php:267
807
- msgctxt "Activity pagination next text"
808
- msgid "&rarr;"
809
- msgstr ""
810
-
811
- #: bp-activity/bp-activity-template.php:737
812
- msgid "Viewing item %1$s to %2$s (of %3$s item)"
813
- msgid_plural "Viewing item %1$s to %2$s (of %3$s items)"
814
- msgstr[0] ""
815
- msgstr[1] ""
816
-
817
- #: bp-activity/bp-activity-template.php:1208
818
- msgid "Profile picture"
819
- msgstr ""
820
-
821
- #: bp-activity/bp-activity-template.php:1334
822
- msgid "Group logo"
823
- msgstr ""
824
-
825
- #: bp-activity/bp-activity-template.php:1337 bp-groups/bp-groups-admin.php:1410
826
- #: bp-groups/bp-groups-template.php:518
827
- msgid "Group logo of %s"
828
- msgstr ""
829
-
830
- #: bp-activity/bp-activity-template.php:1348
831
- msgid "Profile picture of the author of the site %s"
832
- msgstr ""
833
-
834
- #: bp-activity/bp-activity-template.php:1578
835
- msgid "View Discussion"
836
- msgstr ""
837
-
838
- #: bp-activity/bp-activity-template.php:2480
839
- #: bp-forums/bp-forums-template.php:2113 bp-groups/bp-groups-admin.php:1286
840
- #: bp-groups/bp-groups-admin.php:1399 bp-groups/bp-groups-template.php:1530
841
- #: bp-members/admin/bp-members-classes.php:148
842
- #: bp-members/admin/bp-members-classes.php:280
843
- #: bp-members/admin/bp-members-classes.php:466
844
- #: bp-members/admin/bp-members-classes.php:591
845
- #: bp-notifications/bp-notifications-template.php:826
846
- #: bp-templates/bp-legacy/buddypress/activity/comment.php:43
847
- #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51
848
- #: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24
849
- #: bp-themes/bp-default/activity/comment.php:46
850
- #: bp-themes/bp-default/members/single/messages/messages-loop.php:51
851
- #: bp-themes/bp-default/members/single/messages/single.php:24
852
- #: bp-xprofile/bp-xprofile-admin.php:406
853
- msgid "Delete"
854
- msgstr ""
855
-
856
- #: bp-activity/bp-activity-template.php:2528
857
- #: bp-core/admin/bp-core-slugs.php:109 bp-core/admin/bp-core-slugs.php:172
858
- #: bp-core/bp-core-loader.php:244 bp-members/bp-members-loader.php:198
859
- #: bp-members/bp-members-template.php:649
860
- #: bp-templates/bp-legacy/buddypress-functions.php:248
861
- #: bp-themes/bp-default/activity/entry.php:37
862
- #: bp-themes/bp-default/functions.php:166
863
- #: bp-xprofile/bp-xprofile-loader.php:185
864
- #: bp-xprofile/bp-xprofile-loader.php:265
865
- msgid "View"
866
- msgstr ""
867
-
868
- #: bp-activity/bp-activity-template.php:2626
869
- msgid "Clear Filter"
870
- msgstr ""
871
-
872
- #: bp-activity/bp-activity-template.php:2852
873
- msgid "a user"
874
- msgstr ""
875
-
876
- #: bp-activity/bp-activity-template.php:2906
877
- msgid "Send a public message on your activity stream."
878
- msgstr ""
879
-
880
- #: bp-activity/bp-activity-template.php:2907
881
- msgid "Public Message"
882
- msgstr ""
883
-
884
- #: bp-activity/bp-activity-template.php:3360
885
- msgid "Site Wide Activity RSS Feed"
886
- msgstr ""
887
-
888
- #: bp-blogs/bp-blogs-activity.php:34
889
- msgid "New site created"
890
- msgstr ""
891
-
892
- #: bp-blogs/bp-blogs-activity.php:42
893
- msgid "New post published"
894
- msgstr ""
895
-
896
- #: bp-blogs/bp-blogs-activity.php:49
897
- msgid "New post comment posted"
898
- msgstr ""
899
-
900
- #: bp-blogs/bp-blogs-activity.php:69
901
- msgid "%s created the site %s"
902
- msgstr ""
903
-
904
- #: bp-blogs/bp-blogs-activity.php:128 bp-blogs/bp-blogs-functions.php:452
905
- msgid "%1$s wrote a new post, %2$s, on the site %3$s"
906
- msgstr ""
907
-
908
- #: bp-blogs/bp-blogs-activity.php:130 bp-blogs/bp-blogs-functions.php:454
909
- msgid "%1$s wrote a new post, %2$s"
910
- msgstr ""
911
-
912
- #: bp-blogs/bp-blogs-activity.php:195
913
- msgid "%1$s commented on the post, %2$s, on the site %3$s"
914
- msgstr ""
915
-
916
- #: bp-blogs/bp-blogs-activity.php:197
917
- msgid "%1$s commented on the post, %2$s"
918
- msgstr ""
919
-
920
- #: bp-blogs/bp-blogs-buddybar.php:42 bp-blogs/bp-blogs-loader.php:149
921
- #: bp-blogs/bp-blogs-loader.php:199 bp-blogs/bp-blogs-loader.php:227
922
- msgid "My Sites"
923
- msgstr ""
924
-
925
- #: bp-blogs/bp-blogs-buddybar.php:54 bp-core/bp-core-buddybar.php:621
926
- msgid "Dashboard"
927
- msgstr ""
928
-
929
- #: bp-blogs/bp-blogs-buddybar.php:55 bp-core/bp-core-buddybar.php:625
930
- msgid "New Post"
931
- msgstr ""
932
-
933
- #: bp-blogs/bp-blogs-buddybar.php:56 bp-core/bp-core-buddybar.php:626
934
- msgid "Manage Posts"
935
- msgstr ""
936
-
937
- #: bp-blogs/bp-blogs-buddybar.php:57 bp-core/bp-core-buddybar.php:627
938
- msgid "Manage Comments"
939
- msgstr ""
940
-
941
- #: bp-blogs/bp-blogs-buddybar.php:70
942
- msgid "Create a Site!"
943
- msgstr ""
944
-
945
- #: bp-blogs/bp-blogs-loader.php:25 bp-core/admin/bp-core-components.php:396
946
- msgid "Site Tracking"
947
- msgstr ""
948
-
949
- #: bp-blogs/bp-blogs-loader.php:68
950
- msgid "Search sites..."
951
- msgstr ""
952
-
953
- #: bp-blogs/bp-blogs-loader.php:129
954
- msgid "Sites <span>%d</span>"
955
- msgstr ""
956
-
957
- #: bp-blogs/bp-blogs-loader.php:191 bp-blogs/bp-blogs-screens.php:144
958
- #: bp-blogs/bp-blogs-screens.php:204 bp-blogs/bp-blogs-screens.php:206
959
- msgid "Sites"
960
- msgstr ""
961
-
962
- #: bp-blogs/bp-blogs-loader.php:208 bp-blogs/bp-blogs-screens.php:204
963
- #: bp-blogs/bp-blogs-template.php:1114 bp-blogs/bp-blogs-template.php:1182
964
- #: bp-blogs/bp-blogs-template.php:1183 bp-core/bp-core-filters.php:466
965
- #: bp-themes/bp-default/blogs/create.php:21
966
- #: bp-themes/bp-default/blogs/index.php:21
967
- msgid "Create a Site"
968
- msgstr ""
969
-
970
- #: bp-blogs/bp-blogs-template.php:218
971
- msgctxt "Blog pagination previous text"
972
- msgid "&larr;"
973
- msgstr ""
974
-
975
- #: bp-blogs/bp-blogs-template.php:219
976
- msgctxt "Blog pagination next text"
977
- msgid "&rarr;"
978
- msgstr ""
979
-
980
- #: bp-blogs/bp-blogs-template.php:439
981
- msgid "Viewing site %1$s to %2$s (of %3$s site)"
982
- msgid_plural "Viewing site %1$s to %2$s (of %3$s sites)"
983
- msgstr[0] ""
984
- msgstr[1] ""
985
-
986
- #: bp-blogs/bp-blogs-template.php:504
987
- msgid "Profile picture of site author %s"
988
- msgstr ""
989
-
990
- #: bp-blogs/bp-blogs-template.php:648 bp-core/bp-core-classes.php:816
991
- #: bp-groups/bp-groups-template.php:3368 bp-groups/bp-groups-widgets.php:85
992
- #: bp-groups/bp-groups-widgets.php:197 bp-members/bp-members-template.php:616
993
- #: bp-members/bp-members-template.php:932
994
- #: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:47
995
- #: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:42
996
- #: bp-themes/bp-default/groups/groups-loop.php:47
997
- #: bp-themes/bp-default/groups/single/group-header.php:42
998
- #: tests/testcases/members/template.php:112
999
- #: tests/testcases/members/template.php:127
1000
- msgid "active %s"
1001
- msgstr ""
1002
-
1003
- #: bp-blogs/bp-blogs-template.php:668
1004
- msgid "Latest Post: %s"
1005
- msgstr ""
1006
-
1007
- #: bp-blogs/bp-blogs-template.php:915
1008
- msgid "There was a problem, please correct the form below and try again."
1009
- msgstr ""
1010
-
1011
- #: bp-blogs/bp-blogs-template.php:918
1012
- 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!"
1013
- msgstr ""
1014
-
1015
- #: bp-blogs/bp-blogs-template.php:920
1016
- msgid "If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!"
1017
- msgstr ""
1018
-
1019
- #: bp-blogs/bp-blogs-template.php:929
1020
- msgid "Create Site"
1021
- msgstr ""
1022
-
1023
- #: bp-blogs/bp-blogs-template.php:951
1024
- msgid "Site Name:"
1025
- msgstr ""
1026
-
1027
- #: bp-blogs/bp-blogs-template.php:953
1028
- msgid "Site Domain:"
1029
- msgstr ""
1030
-
1031
- #: bp-blogs/bp-blogs-template.php:967
1032
- msgid "Your address will be "
1033
- msgstr ""
1034
-
1035
- #: bp-blogs/bp-blogs-template.php:970
1036
- msgid "blogname"
1037
- msgstr ""
1038
-
1039
- #: bp-blogs/bp-blogs-template.php:972
1040
- msgid "domain."
1041
- msgstr ""
1042
-
1043
- #: bp-blogs/bp-blogs-template.php:975
1044
- msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)"
1045
- msgstr ""
1046
-
1047
- #: bp-blogs/bp-blogs-template.php:981
1048
- msgid "Site Title:"
1049
- msgstr ""
1050
-
1051
- #: bp-blogs/bp-blogs-template.php:992
1052
- msgid "Privacy:"
1053
- msgstr ""
1054
-
1055
- #: bp-blogs/bp-blogs-template.php:993
1056
- #: bp-templates/bp-legacy/buddypress/members/register.php:145
1057
- #: bp-themes/bp-default/registration/register.php:229
1058
- msgid "I would like my site to appear in search engines, and in public listings around this network."
1059
- msgstr ""
1060
-
1061
- #: bp-blogs/bp-blogs-template.php:1100
1062
- msgid "Congratulations! You have successfully registered a new site."
1063
- msgstr ""
1064
-
1065
- #: bp-blogs/bp-blogs-template.php:1102
1066
- 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."
1067
- msgstr ""
1068
-
1069
- #: bp-blogs/bp-blogs-template.php:1131
1070
- msgid "%s's Sites"
1071
- msgstr ""
1072
-
1073
- #: bp-blogs/bp-blogs-template.php:1132
1074
- msgid "%s's Recent Posts"
1075
- msgstr ""
1076
-
1077
- #: bp-blogs/bp-blogs-template.php:1133
1078
- msgid "%s's Recent Comments"
1079
- msgstr ""
1080
-
1081
- #: bp-blogs/bp-blogs-template.php:1149 bp-core/deprecated/1.5.php:417
1082
- #: bp-forums/bp-forums-template.php:2196 bp-groups/bp-groups-template.php:2772
1083
- #: bp-members/bp-members-template.php:771
1084
- #: bp-messages/bp-messages-template.php:471 bp-themes/bp-default/header.php:30
1085
- #: bp-themes/bp-default/searchform.php:5
1086
- msgid "Search"
1087
- msgstr ""
1088
-
1089
- #: bp-blogs/bp-blogs-template.php:1232 bp-blogs/bp-blogs-template.php:1233
1090
- msgid "Visit Site"
1091
- msgstr ""
1092
-
1093
- #: bp-blogs/bp-blogs-template.php:1288
1094
- msgid "%s site"
1095
- msgid_plural "%s sites"
1096
- msgstr[0] ""
1097
- msgstr[1] ""
1098
-
1099
- #: bp-blogs/bp-blogs-widgets.php:34
1100
- msgid "A list of recently published posts from across your network."
1101
- msgstr ""
1102
-
1103
- #: bp-blogs/bp-blogs-widgets.php:37
1104
- msgctxt "widget name"
1105
- msgid "(BuddyPress) Recent Networkwide Posts"
1106
- msgstr ""
1107
-
1108
- #: bp-blogs/bp-blogs-widgets.php:50 bp-blogs/bp-blogs-widgets.php:122
1109
- msgid "Recent Networkwide Posts"
1110
- msgstr ""
1111
-
1112
- #: bp-blogs/bp-blogs-widgets.php:91
1113
- msgid "Sorry, there were no posts found. Why not write one?"
1114
- msgstr ""
1115
-
1116
- #: bp-blogs/bp-blogs-widgets.php:133
1117
- msgctxt "Label for the Title field of the Recent Networkwide Posts widget"
1118
- msgid "Title:"
1119
- msgstr ""
1120
-
1121
- #: bp-blogs/bp-blogs-widgets.php:134
1122
- msgid "Link widget title to Blogs directory"
1123
- msgstr ""
1124
-
1125
- #: bp-blogs/bp-blogs-widgets.php:135
1126
- msgid "Max posts to show:"
1127
- msgstr ""
1128
-
1129
- #: bp-core/admin/bp-core-components.php:26
1130
- #: bp-core/admin/bp-core-functions.php:389
1131
- msgid "Components"
1132
- msgstr ""
1133
-
1134
- #: bp-core/admin/bp-core-components.php:32
1135
- #: bp-core/admin/bp-core-settings.php:281 bp-core/admin/bp-core-slugs.php:32
1136
- #: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:42
1137
- #: bp-themes/bp-default/members/single/settings/profile.php:92
1138
- msgid "Save Settings"
1139
- msgstr ""
1140
-
1141
- #: bp-core/admin/bp-core-components.php:59
1142
- #: bp-core/admin/bp-core-components.php:364
1143
- #: bp-xprofile/bp-xprofile-loader.php:41
1144
- msgid "Extended Profiles"
1145
- msgstr ""
1146
-
1147
- #: bp-core/admin/bp-core-components.php:60
1148
- #: bp-core/admin/bp-core-components.php:365
1149
- msgid "Customize your community with fully editable profile fields that allow your users to describe themselves."
1150
- msgstr ""
1151
-
1152
- #: bp-core/admin/bp-core-components.php:63
1153
- #: bp-core/admin/bp-core-components.php:368
1154
- msgid "Account Settings"
1155
- msgstr ""
1156
-
1157
- #: bp-core/admin/bp-core-components.php:64
1158
- #: bp-core/admin/bp-core-components.php:369
1159
- msgid "Allow your users to modify their account and notification settings directly from within their profiles."
1160
- msgstr ""
1161
-
1162
- #: bp-core/admin/bp-core-components.php:67
1163
- #: bp-core/admin/bp-core-components.php:384
1164
- #: bp-notifications/bp-notifications-buddybar.php:28
1165
- #: bp-notifications/bp-notifications-loader.php:26
1166
- #: bp-notifications/bp-notifications-loader.php:113
1167
- #: bp-notifications/bp-notifications-loader.php:188
1168
- #: bp-notifications/bp-notifications-loader.php:231
1169
- msgid "Notifications"
1170
- msgstr ""
1171
-
1172
- #: bp-core/admin/bp-core-components.php:68
1173
- #: bp-core/admin/bp-core-components.php:385
1174
- msgid "Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings."
1175
- msgstr ""
1176
-
1177
- #: bp-core/admin/bp-core-components.php:144
1178
- msgctxt "plugins"
1179
- msgid "All <span class=\"count\">(%s)</span>"
1180
- msgid_plural "All <span class=\"count\">(%s)</span>"
1181
- msgstr[0] ""
1182
- msgstr[1] ""
1183
-
1184
- #: bp-core/admin/bp-core-components.php:145
1185
- msgid "Active <span class=\"count\">(%s)</span>"
1186
- msgid_plural "Active <span class=\"count\">(%s)</span>"
1187
- msgstr[0] ""
1188
- msgstr[1] ""
1189
-
1190
- #: bp-core/admin/bp-core-components.php:146
1191
- msgid "Inactive <span class=\"count\">(%s)</span>"
1192
- msgid_plural "Inactive <span class=\"count\">(%s)</span>"
1193
- msgstr[0] ""
1194
- msgstr[1] ""
1195
-
1196
- #: bp-core/admin/bp-core-components.php:147
1197
- msgid "Must-Use <span class=\"count\">(%s)</span>"
1198
- msgid_plural "Must-Use <span class=\"count\">(%s)</span>"
1199
- msgstr[0] ""
1200
- msgstr[1] ""
1201
-
1202
- #: bp-core/admin/bp-core-components.php:148
1203
- msgid "Retired <span class=\"count\">(%s)</span>"
1204
- msgid_plural "Retired <span class=\"count\">(%s)</span>"
1205
- msgstr[0] ""
1206
- msgstr[1] ""
1207
-
1208
- #: bp-core/admin/bp-core-components.php:155
1209
- #: bp-core/admin/bp-core-components.php:163
1210
- msgid "Component"
1211
- msgstr ""
1212
-
1213
- #: bp-core/admin/bp-core-components.php:156
1214
- #: bp-core/admin/bp-core-components.php:164
1215
- msgid "Description"
1216
- msgstr ""
1217
-
1218
- #: bp-core/admin/bp-core-components.php:189
1219
- #: bp-members/admin/bp-members-classes.php:226
1220
- #: bp-members/admin/bp-members-classes.php:539
1221
- msgid "Select %s"
1222
- msgstr ""
1223
-
1224
- #: bp-core/admin/bp-core-components.php:214
1225
- msgid "No components found."
1226
- msgstr ""
1227
-
1228
- #: bp-core/admin/bp-core-components.php:344 bp-core/bp-core-loader.php:27
1229
- msgid "BuddyPress Core"
1230
- msgstr ""
1231
-
1232
- #: bp-core/admin/bp-core-components.php:345
1233
- msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
1234
- msgstr ""
1235
-
1236
- #: bp-core/admin/bp-core-components.php:348
1237
- msgid "Community Members"
1238
- msgstr ""
1239
-
1240
- #: bp-core/admin/bp-core-components.php:349
1241
- msgid "Everything in a BuddyPress community revolves around its members."
1242
- msgstr ""
1243
-
1244
- #: bp-core/admin/bp-core-components.php:356
1245
- #: bp-templates/bp-legacy/buddypress/groups/create.php:105
1246
- #: bp-themes/bp-default/groups/create.php:112
1247
- msgid "Group Forums"
1248
- msgstr ""
1249
-
1250
- #: bp-core/admin/bp-core-components.php:357
1251
- msgid "BuddyPress Forums are retired. Use %s."
1252
- msgstr ""
1253
-
1254
- #: bp-core/admin/bp-core-components.php:372 bp-friends/bp-friends-loader.php:24
1255
- msgid "Friend Connections"
1256
- msgstr ""
1257
-
1258
- #: bp-core/admin/bp-core-components.php:373
1259
- msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most."
1260
- msgstr ""
1261
-
1262
- #: bp-core/admin/bp-core-components.php:376
1263
- msgid "Private Messaging"
1264
- msgstr ""
1265
-
1266
- #: bp-core/admin/bp-core-components.php:377
1267
- 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."
1268
- msgstr ""
1269
-
1270
- #: bp-core/admin/bp-core-components.php:381
1271
- msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting, and @mentions, all with full RSS feed and email notification support."
1272
- msgstr ""
1273
-
1274
- #: bp-core/admin/bp-core-components.php:388 bp-groups/bp-groups-loader.php:83
1275
- msgid "User Groups"
1276
- msgstr ""
1277
-
1278
- #: bp-core/admin/bp-core-components.php:389
1279
- msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings."
1280
- msgstr ""
1281
-
1282
- #: bp-core/admin/bp-core-components.php:392
1283
- msgid "Group Forums (Legacy)"
1284
- msgstr ""
1285
-
1286
- #: bp-core/admin/bp-core-components.php:393
1287
- msgid "Group forums allow for focused, bulletin-board style conversations."
1288
- msgstr ""
1289
-
1290
- #: bp-core/admin/bp-core-components.php:397
1291
- msgid "Record activity for new posts and comments from your site."
1292
- msgstr ""
1293
-
1294
- #: bp-core/admin/bp-core-components.php:404
1295
- msgid "Record activity for new sites, posts, and comments across your network."
1296
- msgstr ""
1297
-
1298
- #: bp-core/admin/bp-core-functions.php:104
1299
- msgid "Why have all my BuddyPress menus disappeared?"
1300
- msgstr ""
1301
-
1302
- #: bp-core/admin/bp-core-functions.php:106
1303
- 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."
1304
- msgstr ""
1305
-
1306
- #: bp-core/admin/bp-core-functions.php:107
1307
- 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."
1308
- msgstr ""
1309
-
1310
- #: bp-core/admin/bp-core-functions.php:248
1311
- 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."
1312
- msgstr ""
1313
-
1314
- #: bp-core/admin/bp-core-functions.php:272 bp-core/admin/bp-core-slugs.php:135
1315
- #: bp-members/admin/bp-members-classes.php:271
1316
- #: bp-members/admin/bp-members-classes.php:275
1317
- #: bp-members/admin/bp-members-classes.php:584
1318
- #: bp-members/admin/bp-members-classes.php:586
1319
- #: bp-messages/bp-messages-template.php:662
1320
- #: bp-templates/bp-legacy/buddypress/members/activate.php:29
1321
- #: bp-themes/bp-default/registration/activate.php:38
1322
- msgid "Activate"
1323
- msgstr ""
1324
-
1325
- #: bp-core/admin/bp-core-functions.php:277 bp-core/admin/bp-core-slugs.php:134
1326
- #: bp-members/bp-members-adminbar.php:60
1327
- msgid "Register"
1328
- msgstr ""
1329
-
1330
- #: bp-core/admin/bp-core-functions.php:305
1331
- msgid "The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href=\"%1$s\">Repair</a>"
1332
- msgstr ""
1333
-
1334
- #: bp-core/admin/bp-core-functions.php:327
1335
- 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\">Repair</a>"
1336
- msgstr ""
1337
-
1338
- #: bp-core/admin/bp-core-functions.php:393 bp-core/admin/bp-core-slugs.php:26
1339
- msgid "Pages"
1340
- msgstr ""
1341
-
1342
- #: bp-core/admin/bp-core-functions.php:397
1343
- #: bp-core/admin/bp-core-settings.php:272 bp-core/bp-core-admin.php:439
1344
- #: bp-groups/bp-groups-loader.php:320 bp-groups/bp-groups-template.php:1512
1345
- #: bp-settings/bp-settings-loader.php:23 bp-settings/bp-settings-loader.php:73
1346
- #: bp-settings/bp-settings-loader.php:163
1347
- msgid "Settings"
1348
- msgstr ""
1349
-
1350
- #: bp-core/admin/bp-core-functions.php:410 bp-core/bp-core-template.php:395
1351
- #: bp-forums/bp-forums-loader.php:132 bp-forums/bp-forums-loader.php:199
1352
- #: bp-forums/bp-forums-loader.php:240 bp-forums/bp-forums-screens.php:208
1353
- #: bp-forums/bp-forums-screens.php:210 bp-forums/deprecated/1.6.php:42
1354
- #: bp-forums/deprecated/1.7.php:25 bp-forums/deprecated/1.7.php:102
1355
- msgid "Forums"
1356
- msgstr ""
1357
-
1358
- #: bp-core/admin/bp-core-functions.php:458
1359
- msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-components\">Managing Components</a>"
1360
- msgstr ""
1361
-
1362
- #: bp-core/admin/bp-core-functions.php:476
1363
- msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-pages\">Managing Pages</a>"
1364
- msgstr ""
1365
-
1366
- #: bp-core/admin/bp-core-functions.php:495
1367
- msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-settings\">Managing Settings</a>"
1368
- msgstr ""
1369
-
1370
- #: bp-core/admin/bp-core-functions.php:514
1371
- msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#users-profile-fields\">Managing Profile Fields</a>"
1372
- msgstr ""
1373
-
1374
- #: bp-core/admin/bp-core-functions.php:532
1375
- 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."
1376
- msgstr ""
1377
-
1378
- #: bp-core/admin/bp-core-functions.php:536
1379
- msgid "BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component."
1380
- msgstr ""
1381
-
1382
- #: bp-core/admin/bp-core-functions.php:540
1383
- msgid "Extra configuration settings."
1384
- msgstr ""
1385
-
1386
- #: bp-core/admin/bp-core-functions.php:544
1387
- 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."
1388
- msgstr ""
1389
-
1390
- #: bp-core/admin/bp-core-functions.php:704 bp-core/bp-core-admin.php:215
1391
- #: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:236
1392
- #: bp-core/bp-core-admin.php:290
1393
- msgid "BuddyPress"
1394
- msgstr ""
1395
-
1396
- #: bp-core/admin/bp-core-functions.php:726
1397
- #: bp-core/admin/bp-core-functions.php:735
1398
- msgid "Logged-In"
1399
- msgstr ""
1400
-
1401
- #: bp-core/admin/bp-core-functions.php:729
1402
- #: bp-core/admin/bp-core-functions.php:744
1403
- msgid "Logged-Out"
1404
- msgstr ""
1405
-
1406
- #: bp-core/admin/bp-core-functions.php:736
1407
- msgid "<em>Logged-In</em> links are relative to the current user, and are not visible to visitors who are not logged in."
1408
- msgstr ""
1409
-
1410
- #: bp-core/admin/bp-core-functions.php:745
1411
- msgid "<em>Logged-Out</em> links are not visible to users who are logged in."
1412
- msgstr ""
1413
-
1414
- #: bp-core/admin/bp-core-functions.php:755
1415
- msgid "Add to Menu"
1416
- msgstr ""
1417
-
1418
- #: bp-core/admin/bp-core-functions.php:900 bp-members/bp-members-actions.php:51
1419
- #: bp-members/bp-members-admin.php:489
1420
- msgid "User marked as spammer. Spam users are visible only to site admins."
1421
- msgstr ""
1422
-
1423
- #: bp-core/admin/bp-core-functions.php:902
1424
- msgid "User removed from spam."
1425
- msgstr ""
1426
-
1427
- #: bp-core/admin/bp-core-schema.php:255
1428
- msgctxt "First field-group name"
1429
- msgid "General"
1430
- msgstr ""
1431
-
1432
- #: bp-core/admin/bp-core-schema.php:259
1433
- msgctxt "Display name field"
1434
- msgid "Display Name"
1435
- msgstr ""
1436
-
1437
- #: bp-core/admin/bp-core-settings.php:31
1438
- msgid "Show the Toolbar for logged out users"
1439
- msgstr ""
1440
-
1441
- #: bp-core/admin/bp-core-settings.php:47
1442
- msgid "Allow registered members to delete their own accounts"
1443
- msgstr ""
1444
-
1445
- #: bp-core/admin/bp-core-settings.php:62
1446
- msgid "Switch to WordPress Toolbar"
1447
- msgstr ""
1448
-
1449
- #: bp-core/admin/bp-core-settings.php:87
1450
- msgid "Allow Akismet to scan for activity stream spam"
1451
- msgstr ""
1452
-
1453
- #: bp-core/admin/bp-core-settings.php:101
1454
- msgid "Allow activity stream commenting on blog and forum posts"
1455
- msgstr ""
1456
-
1457
- #: bp-core/admin/bp-core-settings.php:115
1458
- msgid "Automatically check for new items while viewing the activity stream"
1459
- msgstr ""
1460
-
1461
- #: bp-core/admin/bp-core-settings.php:167
1462
- msgid "Enable BuddyPress to WordPress profile syncing"
1463
- msgstr ""
1464
-
1465
- #: bp-core/admin/bp-core-settings.php:183
1466
- msgid "Allow registered members to upload avatars"
1467
- msgstr ""
1468
-
1469
- #: bp-core/admin/bp-core-settings.php:208
1470
- msgid "Enable group creation for all users"
1471
- msgstr ""
1472
-
1473
- #: bp-core/admin/bp-core-settings.php:209
1474
- msgid "Administrators can always create groups, regardless of this setting."
1475
- msgstr ""
1476
-
1477
- #: bp-core/admin/bp-core-settings.php:240
1478
- msgid "Attempt to save a new config file."
1479
- msgstr ""
1480
-
1481
- #: bp-core/admin/bp-core-settings.php:240 bp-core/admin/bp-core-tools.php:34
1482
- msgid "Repair"
1483
- msgstr ""
1484
-
1485
- #: bp-core/admin/bp-core-settings.php:241
1486
- msgid "File does not exist"
1487
- msgstr ""
1488
-
1489
- #: bp-core/admin/bp-core-settings.php:245
1490
- msgid "Absolute path to your bbPress configuration file."
1491
- msgstr ""
1492
-
1493
- #: bp-core/admin/bp-core-slugs.php:79
1494
- msgid "Directories"
1495
- msgstr ""
1496
-
1497
- #: bp-core/admin/bp-core-slugs.php:81
1498
- msgid "Associate a WordPress Page with each BuddyPress component directory."
1499
- msgstr ""
1500
-
1501
- #: bp-core/admin/bp-core-slugs.php:100 bp-core/admin/bp-core-slugs.php:163
1502
- msgid "- None -"
1503
- msgstr ""
1504
-
1505
- #: bp-core/admin/bp-core-slugs.php:104 bp-core/admin/bp-core-slugs.php:167
1506
- msgid "New Page"
1507
- msgstr ""
1508
-
1509
- #: bp-core/admin/bp-core-slugs.php:105 bp-core/admin/bp-core-slugs.php:168
1510
- #: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:13
1511
- #: bp-themes/bp-default/members/single/settings/capabilities.php:61
1512
- #: bp-xprofile/bp-xprofile-classes.php:501
1513
- #: bp-xprofile/bp-xprofile-classes.php:888
1514
- msgid "Save"
1515
- msgstr ""
1516
-
1517
- #: bp-core/admin/bp-core-slugs.php:142
1518
- msgid "Registration"
1519
- msgstr ""
1520
-
1521
- #: bp-core/admin/bp-core-slugs.php:144
1522
- msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
1523
- msgstr ""
1524
-
1525
- #: bp-core/admin/bp-core-tools.php:19 bp-core/admin/bp-core-tools.php:342
1526
- #: bp-core/admin/bp-core-tools.php:345 bp-core/bp-core-admin.php:289
1527
- msgid "BuddyPress Tools"
1528
- msgstr ""
1529
-
1530
- #: bp-core/admin/bp-core-tools.php:22 bp-core/admin/bp-core-tools.php:344
1531
- msgid "BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration."
1532
- msgstr ""
1533
-
1534
- #: bp-core/admin/bp-core-tools.php:23
1535
- msgid "Use the tools below to manually recalculate these relationships."
1536
- msgstr ""
1537
-
1538
- #: bp-core/admin/bp-core-tools.php:25
1539
- msgid "Some of these tools create substantial database overhead. Avoid running more than one repair job at a time."
1540
- msgstr ""
1541
-
1542
- #: bp-core/admin/bp-core-tools.php:31
1543
- msgid "Data to Repair:"
1544
- msgstr ""
1545
-
1546
- #: bp-core/admin/bp-core-tools.php:49
1547
- msgid "Repair Items"
1548
- msgstr ""
1549
-
1550
- #: bp-core/admin/bp-core-tools.php:105
1551
- msgid "Count total members"
1552
- msgstr ""
1553
-
1554
- #: bp-core/admin/bp-core-tools.php:111
1555
- msgid "Repair user \"last activity\" data"
1556
- msgstr ""
1557
-
1558
- #: bp-core/admin/bp-core-tools.php:120
1559
- msgid "Count friends for each user"
1560
- msgstr ""
1561
-
1562
- #: bp-core/admin/bp-core-tools.php:130
1563
- msgid "Count groups for each user"
1564
- msgstr ""
1565
-
1566
- #: bp-core/admin/bp-core-tools.php:154
1567
- msgid "Counting the number of friends for each user&hellip; %s"
1568
- msgstr ""
1569
-
1570
- #: bp-core/admin/bp-core-tools.php:155 bp-core/admin/bp-core-tools.php:211
1571
- msgid "Failed!"
1572
- msgstr ""
1573
-
1574
- #: bp-core/admin/bp-core-tools.php:193 bp-core/admin/bp-core-tools.php:238
1575
- #: bp-core/admin/bp-core-tools.php:250 bp-core/admin/bp-core-tools.php:263
1576
- msgid "Complete!"
1577
- msgstr ""
1578
-
1579
- #: bp-core/admin/bp-core-tools.php:210
1580
- msgid "Counting the number of groups for each user&hellip; %s"
1581
- msgstr ""
1582
-
1583
- #: bp-core/admin/bp-core-tools.php:247
1584
- msgid "Counting the number of active members on the site&hellip; %s"
1585
- msgstr ""
1586
-
1587
- #: bp-core/admin/bp-core-tools.php:261
1588
- msgid "Determining last activity dates for each user&hellip; %s"
1589
- msgstr ""
1590
-
1591
- #: bp-core/admin/bp-core-tools.php:320 bp-core/bp-core-admin.php:266
1592
- #: bp-core/bp-core-admin.php:267
1593
- msgid "Tools"
1594
- msgstr ""
1595
-
1596
- #: bp-core/admin/bp-core-tools.php:345
1597
- msgctxt "buddypress tools intro"
1598
- msgid "Use the %s to repair these relationships."
1599
- msgstr ""
1600
-
1601
- #: bp-core/bp-core-admin.php:195 bp-core/bp-core-admin.php:196
1602
- #: bp-core/bp-core-admin.php:204 bp-core/bp-core-admin.php:205
1603
- msgid "Welcome to BuddyPress"
1604
- msgstr ""
1605
-
1606
- #: bp-core/bp-core-admin.php:225
1607
- msgid "BuddyPress Help"
1608
- msgstr ""
1609
-
1610
- #: bp-core/bp-core-admin.php:226
1611
- msgid "Help"
1612
- msgstr ""
1613
-
1614
- #: bp-core/bp-core-admin.php:235
1615
- msgid "BuddyPress Components"
1616
- msgstr ""
1617
-
1618
- #: bp-core/bp-core-admin.php:244 bp-core/bp-core-admin.php:245
1619
- msgid "BuddyPress Pages"
1620
- msgstr ""
1621
-
1622
- #: bp-core/bp-core-admin.php:253 bp-core/bp-core-admin.php:254
1623
- msgid "BuddyPress Settings"
1624
- msgstr ""
1625
-
1626
- #: bp-core/bp-core-admin.php:277 bp-core/bp-core-admin.php:278
1627
- msgid "Available Tools"
1628
- msgstr ""
1629
-
1630
- #: bp-core/bp-core-admin.php:316
1631
- msgid "Main Settings"
1632
- msgstr ""
1633
-
1634
- #: bp-core/bp-core-admin.php:319 bp-core/bp-core-admin.php:324
1635
- msgid "Toolbar"
1636
- msgstr ""
1637
-
1638
- #: bp-core/bp-core-admin.php:329
1639
- msgid "Account Deletion"
1640
- msgstr ""
1641
-
1642
- #: bp-core/bp-core-admin.php:337
1643
- #: bp-themes/bp-default/members/single/settings/profile.php:49
1644
- msgid "Profile Settings"
1645
- msgstr ""
1646
-
1647
- #: bp-core/bp-core-admin.php:342
1648
- msgid "Profile Syncing"
1649
- msgstr ""
1650
-
1651
- #: bp-core/bp-core-admin.php:351
1652
- msgid "Groups Settings"
1653
- msgstr ""
1654
-
1655
- #: bp-core/bp-core-admin.php:357
1656
- msgid "Group Creation"
1657
- msgstr ""
1658
-
1659
- #: bp-core/bp-core-admin.php:366
1660
- msgid "Legacy Group Forums"
1661
- msgstr ""
1662
-
1663
- #: bp-core/bp-core-admin.php:369
1664
- msgid "bbPress Configuration"
1665
- msgstr ""
1666
-
1667
- #: bp-core/bp-core-admin.php:378
1668
- msgid "Activity Settings"
1669
- msgstr ""
1670
-
1671
- #: bp-core/bp-core-admin.php:381
1672
- msgid "Blog &amp; Forum Comments"
1673
- msgstr ""
1674
-
1675
- #: bp-core/bp-core-admin.php:385
1676
- msgid "Activity auto-refresh"
1677
- msgstr ""
1678
-
1679
- #: bp-core/bp-core-admin.php:390
1680
- msgid "Akismet"
1681
- msgstr ""
1682
-
1683
- #: bp-core/bp-core-admin.php:399
1684
- msgid "Avatar Uploads"
1685
- msgstr ""
1686
-
1687
- #: bp-core/bp-core-admin.php:416
1688
- msgid "About BuddyPress"
1689
- msgstr ""
1690
-
1691
- #: bp-core/bp-core-admin.php:440
1692
- msgid "About"
1693
- msgstr ""
1694
-
1695
- #: bp-core/bp-core-admin.php:496 bp-core/bp-core-admin.php:647
1696
- msgid "Welcome to BuddyPress %s"
1697
- msgstr ""
1698
-
1699
- #: bp-core/bp-core-admin.php:499 bp-core/bp-core-admin.php:650
1700
- msgid "It&#8217;s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet."
1701
- msgstr ""
1702
-
1703
- #: bp-core/bp-core-admin.php:501 bp-core/bp-core-admin.php:652
1704
- msgid "Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet."
1705
- msgstr ""
1706
-
1707
- #: bp-core/bp-core-admin.php:509 bp-core/bp-core-admin.php:660
1708
- msgid "What&#8217;s New"
1709
- msgstr ""
1710
-
1711
- #: bp-core/bp-core-admin.php:511 bp-core/bp-core-admin.php:662
1712
- msgid "Credits"
1713
- msgstr ""
1714
-
1715
- #: bp-core/bp-core-admin.php:516
1716
- msgid "Getting Started"
1717
- msgstr ""
1718
-
1719
- #: bp-core/bp-core-admin.php:519
1720
- msgid "Your Default Setup"
1721
- msgstr ""
1722
-
1723
- #: bp-core/bp-core-admin.php:523
1724
- 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>."
1725
- msgstr ""
1726
-
1727
- #: bp-core/bp-core-admin.php:524 bp-core/bp-core-template.php:386
1728
- #: bp-core/bp-core-widgets.php:276 bp-groups/bp-groups-admin.php:781
1729
- #: bp-groups/bp-groups-template.php:1520 bp-members/bp-members-loader.php:24
1730
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:231
1731
- #: bp-themes/bp-default/groups/single/admin.php:231
1732
- msgid "Members"
1733
- msgstr ""
1734
-
1735
- #: bp-core/bp-core-admin.php:532
1736
- msgid "BuddyPress&#8217;s powerful features help your users connect and collaborate. Want to explore BP&#8217;s features? Visit the <a href=\"%s\">Components panel</a>."
1737
- msgstr ""
1738
-
1739
- #: bp-core/bp-core-admin.php:538
1740
- msgid "Community and Support"
1741
- msgstr ""
1742
-
1743
- #: bp-core/bp-core-admin.php:539
1744
- 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."
1745
- msgstr ""
1746
-
1747
- #: bp-core/bp-core-admin.php:546
1748
- msgid "Performance Improvements"
1749
- msgstr ""
1750
-
1751
- #: bp-core/bp-core-admin.php:548
1752
- msgid "Whether your community has tens of members or tens of thousands, we think the performance improvements in BuddyPress 2.0 will knock your socks off. We&#8217;ve slashed our memory footprint and query overhead across the board, with a special focus on the Activity and Members components."
1753
- msgstr ""
1754
-
1755
- #: bp-core/bp-core-admin.php:554
1756
- msgid "New Administrative Tools"
1757
- msgstr ""
1758
-
1759
- #: bp-core/bp-core-admin.php:558
1760
- msgid "Extended Profiles in Admin"
1761
- msgstr ""
1762
-
1763
- #: bp-core/bp-core-admin.php:559
1764
- msgid "Site administrators can edit members&#8217; xProfile data at Dashboard > Users > Extended Profiles."
1765
- msgstr ""
1766
-
1767
- #: bp-core/bp-core-admin.php:564
1768
- msgid "Registration Management"
1769
- msgstr ""
1770
-
1771
- #: bp-core/bp-core-admin.php:565
1772
- msgid "Perform common tasks with pending signups - including resending activation emails and manually activating accounts - on the new Pending tab of Dashboard > Users."
1773
- msgstr ""
1774
-
1775
- #: bp-core/bp-core-admin.php:572
1776
- msgid "BuddyPress Repair Tools"
1777
- msgstr ""
1778
-
1779
- #: bp-core/bp-core-admin.php:573
1780
- msgid "Dashboard > Tools > BuddyPress contains a number of tools for correcting data that occasionally gets out of sync on BP installs."
1781
- msgstr ""
1782
-
1783
- #: bp-core/bp-core-admin.php:578
1784
- msgid "Mark Spammers in Admin"
1785
- msgstr ""
1786
-
1787
- #: bp-core/bp-core-admin.php:579
1788
- msgid "Admins on non-Multisite installations can now perform spam actions from Dashboard > Users > All Users."
1789
- msgstr ""
1790
-
1791
- #: bp-core/bp-core-admin.php:589
1792
- msgid "A More Dynamic Activity Stream"
1793
- msgstr ""
1794
-
1795
- #: bp-core/bp-core-admin.php:592
1796
- msgid "Spend a lot of time viewing the activity stream? BuddyPress 2.0 automatically lets you know when new items are waiting to be loaded."
1797
- msgstr ""
1798
-
1799
- #: bp-core/bp-core-admin.php:594
1800
- msgid "The activity stream is better integrated with blog posts, too. Comment on a blog post, and an activity item is posted. Comment on a blog-related activity item, and a blog comment is posted. No more worrying about fractured conversations."
1801
- msgstr ""
1802
-
1803
- #: bp-core/bp-core-admin.php:596
1804
- msgid "We&#8217;ve also reworked the way that phrases like \"Boone posted an update\" are handled, so that they&#8217;re always up-to-date and always translatable."
1805
- msgstr ""
1806
-
1807
- #: bp-core/bp-core-admin.php:608
1808
- msgid "Developer Tools"
1809
- msgstr ""
1810
-
1811
- #: bp-core/bp-core-admin.php:610
1812
- msgid "BuddyPress 2.0 is full of new and improved tools for the theme and plugin developer. A few highlights:"
1813
- msgstr ""
1814
-
1815
- #: bp-core/bp-core-admin.php:612
1816
- msgid "The <code>BP_XProfile_Field_Type</code> class makes it a breeze to create new xProfile field types with custom display callbacks, validation, and more."
1817
- msgstr ""
1818
-
1819
- #: bp-core/bp-core-admin.php:613
1820
- msgid "Major improvements have taken place with respect to object caching throughout BuddyPress. If you use Memcached, APC, or some other persistent object caching backend on your BuddyPress site, you should notice huge performance boosts."
1821
- msgstr ""
1822
-
1823
- #: bp-core/bp-core-admin.php:614
1824
- msgid "Our internal metadata libraries have been rewritten to use WP&#8217;s <code>add_metadata()</code>, <code>update_metadata()</code>, and so on. This means greater consistency and parity between the components when storing and retrieving BuddyPress metadata."
1825
- msgstr ""
1826
-
1827
- #: bp-core/bp-core-admin.php:615
1828
- msgid "<a href=\"%s\">&hellip;and lots more!</a>"
1829
- msgstr ""
1830
-
1831
- #: bp-core/bp-core-admin.php:623 bp-core/bp-core-admin.php:766
1832
- msgid "Go to the BuddyPress Settings page"
1833
- msgstr ""
1834
-
1835
- #: bp-core/bp-core-admin.php:666
1836
- msgid "BuddyPress is created by a worldwide network of friendly folks."
1837
- msgstr ""
1838
-
1839
- #: bp-core/bp-core-admin.php:668
1840
- msgid "Project Leaders"
1841
- msgstr ""
1842
-
1843
- #: bp-core/bp-core-admin.php:673
1844
- msgid "Project Lead"
1845
- msgstr ""
1846
-
1847
- #: bp-core/bp-core-admin.php:678 bp-core/bp-core-admin.php:683
1848
- msgid "Lead Developer"
1849
- msgstr ""
1850
-
1851
- #: bp-core/bp-core-admin.php:687
1852
- msgid "Core Team"
1853
- msgstr ""
1854
-
1855
- #: bp-core/bp-core-admin.php:692 bp-core/bp-core-admin.php:697
1856
- msgid "Core Developer"
1857
- msgstr ""
1858
-
1859
- #: bp-core/bp-core-admin.php:702
1860
- msgid "Navigator"
1861
- msgstr ""
1862
-
1863
- #: bp-core/bp-core-admin.php:706
1864
- msgid "Recent Rockstars"
1865
- msgstr ""
1866
-
1867
- #: bp-core/bp-core-admin.php:718
1868
- msgid "Contributors to BuddyPress 2.0"
1869
- msgstr ""
1870
-
1871
- #: bp-core/bp-core-adminbar.php:36 bp-core/bp-core-buddybar.php:571
1872
- msgid "My Account"
1873
- msgstr ""
1874
-
1875
- #: bp-core/bp-core-avatars.php:303
1876
- msgid "Avatar Image"
1877
- msgstr ""
1878
-
1879
- #: bp-core/bp-core-avatars.php:578
1880
- msgid "The image was uploaded successfully"
1881
- msgstr ""
1882
-
1883
- #: bp-core/bp-core-avatars.php:579 bp-core/bp-core-avatars.php:580
1884
- msgid "The image exceeds the maximum allowed file size of: "
1885
- msgstr ""
1886
-
1887
- #: bp-core/bp-core-avatars.php:581
1888
- msgid "The uploaded file was only partially uploaded."
1889
- msgstr ""
1890
-
1891
- #: bp-core/bp-core-avatars.php:582
1892
- msgid "The image was not uploaded."
1893
- msgstr ""
1894
-
1895
- #: bp-core/bp-core-avatars.php:583
1896
- msgid "Missing a temporary folder."
1897
- msgstr ""
1898
-
1899
- #: bp-core/bp-core-avatars.php:587
1900
- msgid "Your upload failed, please try again. Error was: %s"
1901
- msgstr ""
1902
-
1903
- #: bp-core/bp-core-avatars.php:592
1904
- msgid "The file you uploaded is too big. Please upload a file under %s"
1905
- msgstr ""
1906
-
1907
- #: bp-core/bp-core-avatars.php:597
1908
- msgid "Please upload only JPG, GIF or PNG photos."
1909
- msgstr ""
1910
-
1911
- #: bp-core/bp-core-avatars.php:614 bp-core/bp-core-avatars.php:651
1912
- msgid "Upload Failed! Error was: %s"
1913
- msgstr ""
1914
-
1915
- #: bp-core/bp-core-avatars.php:669
1916
- msgid "Upload failed! Error was: %s"
1917
- msgstr ""
1918
-
1919
- #: bp-core/bp-core-avatars.php:843 bp-core/bp-core-classes.php:813
1920
- #: bp-core/bp-core-classes.php:814 bp-core/bp-core-classes.php:815
1921
- #: bp-core/bp-core-template.php:160 bp-core/bp-core-template.php:176
1922
- #: bp-groups/bp-groups-template.php:3362 bp-groups/bp-groups-template.php:3363
1923
- #: bp-groups/bp-groups-template.php:3364
1924
- msgid "Avatar of %s"
1925
- msgstr ""
1926
-
1927
- #: bp-core/bp-core-buddybar.php:356
1928
- msgid "You do not have access to this page."
1929
- msgstr ""
1930
-
1931
- #: bp-core/bp-core-buddybar.php:552 bp-core/bp-core-functions.php:1806
1932
- #: bp-core/bp-core-widgets.php:90 bp-themes/bp-default/sidebar.php:52
1933
- msgid "Log In"
1934
- msgstr ""
1935
-
1936
- #: bp-core/bp-core-buddybar.php:556
1937
- msgid "Sign Up"
1938
- msgstr ""
1939
-
1940
- #: bp-core/bp-core-buddybar.php:613 bp-core/bp-core-functions.php:1739
1941
- #: bp-core/bp-core-widgets.php:72 bp-core/deprecated/1.5.php:307
1942
- #: bp-members/bp-members-template.php:835 bp-themes/bp-default/sidebar.php:18
1943
- msgid "Log Out"
1944
- msgstr ""
1945
-
1946
- #: bp-core/bp-core-buddybar.php:645 bp-groups/bp-groups-admin.php:1393
1947
- msgid "Visit"
1948
- msgstr ""
1949
-
1950
- #: bp-core/bp-core-buddybar.php:647
1951
- msgid "Random Member"
1952
- msgstr ""
1953
-
1954
- #: bp-core/bp-core-buddybar.php:651
1955
- msgid "Random Group"
1956
- msgstr ""
1957
-
1958
- #: bp-core/bp-core-buddybar.php:657
1959
- msgid "Random Site"
1960
- msgstr ""
1961
-
1962
- #: bp-core/bp-core-caps.php:256 bp-core/bp-core-caps.php:268
1963
- #: bp-core/bp-core-caps.php:282 bp-core/bp-core-caps.php:292
1964
- msgid "Special community roles no longer exist. Use mapped capabilities instead"
1965
- msgstr ""
1966
-
1967
- #: bp-core/bp-core-catchuri.php:276
1968
- msgid "This user has been marked as a spammer. Only site admins can view this profile."
1969
- msgstr ""
1970
-
1971
- #: bp-core/bp-core-catchuri.php:471 bp-core/bp-core-catchuri.php:531
1972
- msgid "You must log in to access the page you requested."
1973
- msgstr ""
1974
-
1975
- #: bp-core/bp-core-classes.php:830 bp-groups/bp-groups-template.php:3372
1976
- msgid "%d group"
1977
- msgid_plural "%d groups"
1978
- msgstr[0] ""
1979
- msgstr[1] ""
1980
-
1981
- #: bp-core/bp-core-dependency.php:81
1982
- msgid "The current user is being initialized without using $wp->init()."
1983
- msgstr ""
1984
-
1985
- #: bp-core/bp-core-filters.php:261 bp-core/bp-core-filters.php:291
1986
- msgid "[User Set]"
1987
- msgstr ""
1988
-
1989
- #: bp-core/bp-core-filters.php:320
1990
- msgid ""
1991
- "Thanks for registering! To complete the activation of your account and blog, please click the following link:\n"
1992
- "\n"
1993
- "%1$s\n"
1994
- "\n"
1995
- "\n"
1996
- "\n"
1997
- "After you activate, you can visit your blog here:\n"
1998
- "\n"
1999
- "%2$s"
2000
- msgstr ""
2001
-
2002
- #: bp-core/bp-core-filters.php:321
2003
- msgid "Activate %s"
2004
- msgstr ""
2005
-
2006
- #: bp-core/bp-core-filters.php:359 bp-members/bp-members-functions.php:1705
2007
- msgid ""
2008
- "Thanks for registering! To complete the activation of your account please click the following link:\n"
2009
- "\n"
2010
- "%1$s\n"
2011
- "\n"
2012
- msgstr ""
2013
-
2014
- #: bp-core/bp-core-filters.php:360 bp-members/bp-members-functions.php:1706
2015
- msgid "Activate Your Account"
2016
- msgstr ""
2017
-
2018
- #: bp-core/bp-core-filters.php:427
2019
- msgctxt "Construct the page title. 1 = user name, 2 = component name, 3 = seperator"
2020
- msgid "%1$s %3$s %2$s"
2021
- msgstr ""
2022
-
2023
- #. translators: "group name | group nav section name"
2024
-
2025
- #: bp-core/bp-core-filters.php:433
2026
- msgid "%1$s | %2$s"
2027
- msgstr ""
2028
-
2029
- #. translators: "component item name | component nav section name | root
2030
- #. component name"
2031
-
2032
- #: bp-core/bp-core-filters.php:438
2033
- msgid "%1$s | %2$s | %3$s"
2034
- msgstr ""
2035
-
2036
- #: bp-core/bp-core-filters.php:447
2037
- msgctxt "component directory title"
2038
- msgid "Directory"
2039
- msgstr ""
2040
-
2041
- #: bp-core/bp-core-filters.php:454 bp-members/bp-members-screens.php:519
2042
- #: bp-themes/bp-default/registration/register.php:23
2043
- msgid "Create an Account"
2044
- msgstr ""
2045
-
2046
- #: bp-core/bp-core-filters.php:458 bp-members/bp-members-screens.php:527
2047
- #: bp-themes/bp-default/registration/activate.php:13
2048
- msgid "Activate your Account"
2049
- msgstr ""
2050
-
2051
- #: bp-core/bp-core-filters.php:462 bp-groups/bp-groups-loader.php:577
2052
- #: bp-groups/bp-groups-template.php:1911 bp-groups/bp-groups-template.php:1912
2053
- #: bp-themes/bp-default/groups/create.php:18
2054
- #: bp-themes/bp-default/groups/index.php:21
2055
- msgid "Create a Group"
2056
- msgstr ""
2057
-
2058
- #: bp-core/bp-core-functions.php:447
2059
- msgctxt "Page title for the Activity directory."
2060
- msgid "Activity"
2061
- msgstr ""
2062
-
2063
- #: bp-core/bp-core-functions.php:448
2064
- msgctxt "Page title for the Groups directory."
2065
- msgid "Groups"
2066
- msgstr ""
2067
-
2068
- #: bp-core/bp-core-functions.php:449
2069
- msgctxt "Page title for the Sites directory."
2070
- msgid "Sites"
2071
- msgstr ""
2072
-
2073
- #: bp-core/bp-core-functions.php:450
2074
- msgctxt "Page title for the user account activation screen."
2075
- msgid "Activate"
2076
- msgstr ""
2077
-
2078
- #: bp-core/bp-core-functions.php:451
2079
- msgctxt "Page title for the Members directory."
2080
- msgid "Members"
2081
- msgstr ""
2082
-
2083
- #: bp-core/bp-core-functions.php:452
2084
- msgctxt "Page title for the user registration screen."
2085
- msgid "Register"
2086
- msgstr ""
2087
-
2088
- #: bp-core/bp-core-functions.php:777
2089
- msgid "sometime"
2090
- msgstr ""
2091
-
2092
- #: bp-core/bp-core-functions.php:778
2093
- msgid "right now"
2094
- msgstr ""
2095
-
2096
- #: bp-core/bp-core-functions.php:779
2097
- msgid "%s ago"
2098
- msgstr ""
2099
-
2100
- #: bp-core/bp-core-functions.php:840
2101
- msgid "%s year"
2102
- msgid_plural "%s years"
2103
- msgstr[0] ""
2104
- msgstr[1] ""
2105
-
2106
- #: bp-core/bp-core-functions.php:843 bp-core/bp-core-functions.php:877
2107
- msgid "%s month"
2108
- msgid_plural "%s months"
2109
- msgstr[0] ""
2110
- msgstr[1] ""
2111
-
2112
- #: bp-core/bp-core-functions.php:846 bp-core/bp-core-functions.php:880
2113
- msgid "%s week"
2114
- msgid_plural "%s weeks"
2115
- msgstr[0] ""
2116
- msgstr[1] ""
2117
-
2118
- #: bp-core/bp-core-functions.php:849 bp-core/bp-core-functions.php:883
2119
- msgid "%s day"
2120
- msgid_plural "%s days"
2121
- msgstr[0] ""
2122
- msgstr[1] ""
2123
-
2124
- #: bp-core/bp-core-functions.php:852 bp-core/bp-core-functions.php:886
2125
- msgid "%s hour"
2126
- msgid_plural "%s hours"
2127
- msgstr[0] ""
2128
- msgstr[1] ""
2129
-
2130
- #: bp-core/bp-core-functions.php:855 bp-core/bp-core-functions.php:889
2131
- msgid "%s minute"
2132
- msgid_plural "%s minutes"
2133
- msgstr[0] ""
2134
- msgstr[1] ""
2135
-
2136
- #: bp-core/bp-core-functions.php:858 bp-core/bp-core-functions.php:892
2137
- msgid "%s second"
2138
- msgid_plural "%s seconds"
2139
- msgstr[0] ""
2140
- msgstr[1] ""
2141
-
2142
- #: bp-core/bp-core-functions.php:873
2143
- msgctxt "Separator in time since"
2144
- msgid ","
2145
- msgstr ""
2146
-
2147
- #: bp-core/bp-core-functions.php:1065
2148
- msgid "Not recently active"
2149
- msgstr ""
2150
-
2151
- #: bp-core/bp-core-loader.php:233 bp-members/bp-members-admin.php:329
2152
- #: bp-members/bp-members-loader.php:184 bp-xprofile/bp-xprofile-loader.php:164
2153
- #: bp-xprofile/bp-xprofile-loader.php:225
2154
- #: bp-xprofile/bp-xprofile-loader.php:257
2155
- #: bp-xprofile/bp-xprofile-loader.php:339
2156
- msgid "Profile"
2157
- msgstr ""
2158
-
2159
- #: bp-core/bp-core-template.php:81
2160
- msgid "Options"
2161
- msgstr ""
2162
-
2163
- #: bp-core/bp-core-template.php:105
2164
- msgid "%s Directory"
2165
- msgstr ""
2166
-
2167
- #: bp-core/bp-core-template.php:304
2168
- msgid "%1$s at %2$s"
2169
- msgstr ""
2170
-
2171
- #: bp-core/bp-core-template.php:392
2172
- msgid "Blogs"
2173
- msgstr ""
2174
-
2175
- #: bp-core/bp-core-template.php:397
2176
- #: bp-templates/bp-legacy/buddypress/activity/index.php:83
2177
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:40
2178
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:27
2179
- #: bp-themes/bp-default/activity/index.php:103
2180
- #: bp-themes/bp-default/forums/forums-loop.php:40
2181
- #: bp-themes/bp-default/members/single/activity.php:27
2182
- msgid "Posts"
2183
- msgstr ""
2184
-
2185
- #: bp-core/bp-core-template.php:400
2186
- msgid "Search these:"
2187
- msgstr ""
2188
-
2189
- #: bp-core/bp-core-template.php:438
2190
- msgid "Search anything..."
2191
- msgstr ""
2192
-
2193
- #: bp-core/bp-core-template.php:540
2194
- msgid " [&hellip;]"
2195
- msgstr ""
2196
-
2197
- #: bp-core/bp-core-template.php:761
2198
- msgid "Community"
2199
- msgstr ""
2200
-
2201
- #: bp-core/bp-core-widgets.php:36
2202
- msgctxt "Title of the login widget"
2203
- msgid "(BuddyPress) Log In"
2204
- msgstr ""
2205
-
2206
- #: bp-core/bp-core-widgets.php:38
2207
- msgid "Show a Log In form to logged-out visitors, and a Log Out link to those who are logged in."
2208
- msgstr ""
2209
-
2210
- #: bp-core/bp-core-widgets.php:82 bp-members/admin/bp-members-classes.php:127
2211
- #: bp-members/admin/bp-members-classes.php:445
2212
- #: bp-templates/bp-legacy/buddypress/members/register.php:32
2213
- #: bp-themes/bp-default/registration/register.php:37
2214
- #: bp-themes/bp-default/sidebar.php:44
2215
- msgid "Username"
2216
- msgstr ""
2217
-
2218
- #: bp-core/bp-core-widgets.php:85 bp-themes/bp-default/sidebar.php:47
2219
- msgid "Password"
2220
- msgstr ""
2221
-
2222
- #: bp-core/bp-core-widgets.php:88 bp-themes/bp-default/sidebar.php:50
2223
- msgid "Remember Me"
2224
- msgstr ""
2225
-
2226
- #: bp-core/bp-core-widgets.php:94
2227
- msgid "<a href=\"%s\" title=\"Register for a new account\">Register</a>"
2228
- msgstr ""
2229
-
2230
- #: bp-core/bp-core-widgets.php:133 bp-core/bp-core-widgets.php:289
2231
- #: bp-core/bp-core-widgets.php:405 bp-core/bp-core-widgets.php:508
2232
- #: bp-groups/bp-groups-widgets.php:137 bp-messages/bp-messages-widgets.php:110
2233
- #: bp-templates/bp-legacy/buddypress/forums/index.php:86
2234
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:47
2235
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:75
2236
- #: bp-themes/bp-default/forums/index.php:104
2237
- #: bp-themes/bp-default/groups/single/forum/edit.php:47
2238
- #: bp-themes/bp-default/groups/single/forum.php:75
2239
- msgid "Title:"
2240
- msgstr ""
2241
-
2242
- #: bp-core/bp-core-widgets.php:151
2243
- msgid "A dynamic list of recently active, popular, and newest members"
2244
- msgstr ""
2245
-
2246
- #: bp-core/bp-core-widgets.php:154
2247
- msgctxt "widget name"
2248
- msgid "(BuddyPress) Members"
2249
- msgstr ""
2250
-
2251
- #: bp-core/bp-core-widgets.php:200 bp-core/bp-core-widgets.php:298
2252
- #: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:152
2253
- #: bp-friends/bp-friends-widgets.php:91 bp-friends/bp-friends-widgets.php:179
2254
- #: bp-groups/bp-groups-template.php:2417 bp-groups/bp-groups-widgets.php:65
2255
- #: bp-groups/bp-groups-widgets.php:146
2256
- #: bp-templates/bp-legacy/buddypress/blogs/index.php:39
2257
- #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:22
2258
- #: bp-themes/bp-default/blogs/index.php:56
2259
- #: bp-themes/bp-default/members/single/blogs.php:22
2260
- msgid "Newest"
2261
- msgstr ""
2262
-
2263
- #: bp-core/bp-core-widgets.php:201 bp-core/bp-core-widgets.php:299
2264
- #: bp-friends/bp-friends-widgets.php:92 bp-friends/bp-friends-widgets.php:180
2265
- #: bp-groups/bp-groups-widgets.php:66 bp-groups/bp-groups-widgets.php:147
2266
- #: bp-members/bp-members-admin.php:642
2267
- msgid "Active"
2268
- msgstr ""
2269
-
2270
- #: bp-core/bp-core-widgets.php:205 bp-core/bp-core-widgets.php:300
2271
- #: bp-friends/bp-friends-widgets.php:93 bp-friends/bp-friends-widgets.php:181
2272
- #: bp-groups/bp-groups-widgets.php:67 bp-groups/bp-groups-widgets.php:148
2273
- msgid "Popular"
2274
- msgstr ""
2275
-
2276
- #: bp-core/bp-core-widgets.php:242
2277
- msgid "No one has signed up yet!"
2278
- msgstr ""
2279
-
2280
- #: bp-core/bp-core-widgets.php:291 bp-friends/bp-friends-widgets.php:172
2281
- msgid "Link widget title to Members directory"
2282
- msgstr ""
2283
-
2284
- #: bp-core/bp-core-widgets.php:293
2285
- msgid "Max members to show:"
2286
- msgstr ""
2287
-
2288
- #: bp-core/bp-core-widgets.php:296
2289
- msgid "Default members to show:"
2290
- msgstr ""
2291
-
2292
- #: bp-core/bp-core-widgets.php:318
2293
- msgid "Avatars of users who are currently online"
2294
- msgstr ""
2295
-
2296
- #: bp-core/bp-core-widgets.php:321
2297
- msgctxt "widget name"
2298
- msgid "(BuddyPress) Who's Online"
2299
- msgstr ""
2300
-
2301
- #: bp-core/bp-core-widgets.php:365
2302
- msgid "There are no users currently online"
2303
- msgstr ""
2304
-
2305
- #: bp-core/bp-core-widgets.php:396
2306
- msgid "Who's Online"
2307
- msgstr ""
2308
-
2309
- #: bp-core/bp-core-widgets.php:407 bp-core/bp-core-widgets.php:510
2310
- msgid "Max Members to show:"
2311
- msgstr ""
2312
-
2313
- #: bp-core/bp-core-widgets.php:421
2314
- msgid "Avatars of recently active members"
2315
- msgstr ""
2316
-
2317
- #: bp-core/bp-core-widgets.php:424
2318
- msgctxt "widget name"
2319
- msgid "(BuddyPress) Recently Active Members"
2320
- msgstr ""
2321
-
2322
- #: bp-core/bp-core-widgets.php:468
2323
- msgid "There are no recently active members"
2324
- msgstr ""
2325
-
2326
- #: bp-core/bp-core-widgets.php:499
2327
- msgid "Recently Active Members"
2328
- msgstr ""
2329
-
2330
- #: bp-core/bp-core-widgets.php:572 bp-friends/bp-friends-widgets.php:245
2331
- msgid "There were no members found, please try another filter."
2332
- msgstr ""
2333
-
2334
- #: bp-core/deprecated/1.5.php:142
2335
- #: bp-templates/bp-legacy/buddypress/activity/post-form.php:45
2336
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
2337
- #: bp-themes/bp-default/activity/post-form.php:45
2338
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:8
2339
- #: bp-xprofile/bp-xprofile-loader.php:309
2340
- msgid "My Profile"
2341
- msgstr ""
2342
-
2343
- #: bp-core/deprecated/1.5.php:149 bp-members/admin/bp-members-classes.php:128
2344
- #: bp-members/admin/bp-members-classes.php:446
2345
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:15
2346
- #: bp-themes/bp-default/functions.php:643
2347
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:15
2348
- msgid "Name"
2349
- msgstr ""
2350
-
2351
- #: bp-core/deprecated/1.5.php:158
2352
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:24
2353
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:24
2354
- msgid "About Me"
2355
- msgstr ""
2356
-
2357
- #: bp-core/deprecated/1.5.php:167
2358
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:33
2359
- #: bp-themes/bp-default/functions.php:647
2360
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:33
2361
- msgid "Website"
2362
- msgstr ""
2363
-
2364
- #: bp-core/deprecated/1.5.php:176
2365
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:42
2366
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:42
2367
- msgid "Jabber"
2368
- msgstr ""
2369
-
2370
- #: bp-core/deprecated/1.5.php:185
2371
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:51
2372
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:51
2373
- msgid "AOL Messenger"
2374
- msgstr ""
2375
-
2376
- #: bp-core/deprecated/1.5.php:194
2377
- #: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:60
2378
- #: bp-themes/bp-default/members/single/profile/profile-wp.php:60
2379
- msgid "Yahoo Messenger"
2380
- msgstr ""
2381
-
2382
- #: bp-core/deprecated/1.5.php:352
2383
- msgid "%1$s mentioned you in the group \"%2$s\""
2384
- msgstr ""
2385
-
2386
- #: bp-core/deprecated/1.6.php:128 bp-core/deprecated/1.6.php:149
2387
- #: bp-groups/bp-groups-template.php:2788 bp-groups/bp-groups-template.php:2810
2388
- msgid "Recently Active"
2389
- msgstr ""
2390
-
2391
- #: bp-core/deprecated/1.6.php:130 bp-core/deprecated/1.6.php:155
2392
- #: bp-groups/bp-groups-template.php:2793 bp-groups/bp-groups-template.php:2825
2393
- msgid "Alphabetically"
2394
- msgstr ""
2395
-
2396
- #: bp-forums/bp-forums-loader.php:28
2397
- msgid "Discussion Forums"
2398
- msgstr ""
2399
-
2400
- #: bp-forums/bp-forums-loader.php:70
2401
- msgid "Search Forums..."
2402
- msgstr ""
2403
-
2404
- #: bp-forums/bp-forums-loader.php:154 bp-forums/bp-forums-loader.php:207
2405
- msgid "Topics Started"
2406
- msgstr ""
2407
-
2408
- #: bp-forums/bp-forums-loader.php:165
2409
- msgid "Replied To"
2410
- msgstr ""
2411
-
2412
- #: bp-forums/bp-forums-loader.php:215
2413
- msgid "Replies"
2414
- msgstr ""
2415
-
2416
- #: bp-forums/bp-forums-loader.php:223
2417
- msgid "Favorite Topics"
2418
- msgstr ""
2419
-
2420
- #: bp-forums/bp-forums-screens.php:25 bp-forums/bp-forums-screens.php:182
2421
- msgid "The forums component has not been set up yet."
2422
- msgstr ""
2423
-
2424
- #: bp-forums/bp-forums-screens.php:48 bp-groups/bp-groups-screens.php:371
2425
- msgid "Please provide a title for your forum topic."
2426
- msgstr ""
2427
-
2428
- #: bp-forums/bp-forums-screens.php:50 bp-groups/bp-groups-screens.php:373
2429
- msgid "Forum posts cannot be empty. Please enter some text."
2430
- msgstr ""
2431
-
2432
- #: bp-forums/bp-forums-screens.php:57 bp-groups/bp-groups-screens.php:385
2433
- msgid "There was an error when creating the topic"
2434
- msgstr ""
2435
-
2436
- #: bp-forums/bp-forums-screens.php:60 bp-groups/bp-groups-screens.php:388
2437
- msgid "The topic was created successfully"
2438
- msgstr ""
2439
-
2440
- #: bp-forums/bp-forums-screens.php:68 bp-forums/bp-forums-screens.php:73
2441
- msgid "Please pick the group forum where you would like to post this topic."
2442
- msgstr ""
2443
-
2444
- #: bp-forums/bp-forums-screens.php:208 bp-groups/bp-groups-template.php:1756
2445
- #: bp-groups/bp-groups-template.php:1757
2446
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:19
2447
- #: bp-themes/bp-default/forums/index.php:23
2448
- #: bp-themes/bp-default/groups/single/forum.php:19
2449
- msgid "New Topic"
2450
- msgstr ""
2451
-
2452
- #: bp-forums/bp-forums-template.php:296 bp-forums/bp-forums-template.php:568
2453
- msgctxt "Forum topic pagination previous text"
2454
- msgid "&larr;"
2455
- msgstr ""
2456
-
2457
- #: bp-forums/bp-forums-template.php:297 bp-forums/bp-forums-template.php:569
2458
- msgctxt "Forum topic pagination next text"
2459
- msgid "&rarr;"
2460
- msgstr ""
2461
-
2462
- #: bp-forums/bp-forums-template.php:756 bp-forums/bp-forums-template.php:870
2463
- #: bp-forums/bp-forums-template.php:2014
2464
- #: bp-messages/bp-messages-classes.php:474
2465
- #: bp-messages/bp-messages-template.php:945
2466
- #: bp-messages/bp-messages-template.php:1027
2467
- msgid "Deleted User"
2468
- msgstr ""
2469
-
2470
- #: bp-forums/bp-forums-template.php:916
2471
- msgid "Group logo for %s"
2472
- msgstr ""
2473
-
2474
- #: bp-forums/bp-forums-template.php:1103 bp-groups/bp-groups-template.php:1079
2475
- msgid "%d post"
2476
- msgstr ""
2477
-
2478
- #: bp-forums/bp-forums-template.php:1105 bp-groups/bp-groups-template.php:1081
2479
- msgid "%d posts"
2480
- msgstr ""
2481
-
2482
- #: bp-forums/bp-forums-template.php:1291
2483
- msgid "Edit Topic"
2484
- msgstr ""
2485
-
2486
- #: bp-forums/bp-forums-template.php:1295
2487
- msgid "Sticky Topic"
2488
- msgstr ""
2489
-
2490
- #: bp-forums/bp-forums-template.php:1297
2491
- msgid "Un-stick Topic"
2492
- msgstr ""
2493
-
2494
- #: bp-forums/bp-forums-template.php:1300
2495
- msgid "Open Topic"
2496
- msgstr ""
2497
-
2498
- #: bp-forums/bp-forums-template.php:1302
2499
- msgid "Close Topic"
2500
- msgstr ""
2501
-
2502
- #: bp-forums/bp-forums-template.php:1304
2503
- msgid "Delete Topic"
2504
- msgstr ""
2505
-
2506
- #: bp-forums/bp-forums-template.php:1525
2507
- msgid " matching tag \"%s\""
2508
- msgstr ""
2509
-
2510
- #: bp-forums/bp-forums-template.php:1527
2511
- msgid "Viewing topic %s to %s (of %d topic%s)"
2512
- msgid_plural "Viewing topic %s to %s (of %d total topics%s)"
2513
- msgstr[0] ""
2514
- msgstr[1] ""
2515
-
2516
- #: bp-forums/bp-forums-template.php:1736
2517
- msgctxt "Forum thread pagination previous text"
2518
- msgid "&larr;"
2519
- msgstr ""
2520
-
2521
- #: bp-forums/bp-forums-template.php:1737
2522
- msgctxt "Forum thread pagination next text"
2523
- msgid "&rarr;"
2524
- msgstr ""
2525
-
2526
- #: bp-forums/bp-forums-template.php:2166
2527
- msgid "Viewing post %1$s to %2$s (%3$s post)"
2528
- msgid_plural "Viewing post %1$s to %2$s (%3$s total posts)"
2529
- msgstr[0] ""
2530
- msgstr[1] ""
2531
-
2532
- #: bp-forums/deprecated/1.6.php:31 bp-forums/deprecated/1.6.php:133
2533
- msgid "Configure bbPress"
2534
- msgstr ""
2535
-
2536
- #: bp-forums/deprecated/1.6.php:34 bp-forums/deprecated/1.6.php:136
2537
- msgid "Install bbPress"
2538
- msgstr ""
2539
-
2540
- #: bp-forums/deprecated/1.6.php:47
2541
- msgid "Settings Saved."
2542
- msgstr ""
2543
-
2544
- #: bp-forums/deprecated/1.6.php:68
2545
- msgid "(Installed)"
2546
- msgstr ""
2547
-
2548
- #: bp-forums/deprecated/1.6.php:68 bp-forums/deprecated/1.6.php:210
2549
- msgid "Forums for Groups"
2550
- msgstr ""
2551
-
2552
- #: bp-forums/deprecated/1.6.php:70 bp-forums/deprecated/1.6.php:212
2553
- msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas."
2554
- msgstr ""
2555
-
2556
- #: bp-forums/deprecated/1.6.php:72 bp-forums/deprecated/1.6.php:214
2557
- msgid "Note: This component is retired and will not be receiving any updates in the future. Only use this component if your current site relies on it."
2558
- msgstr ""
2559
-
2560
- #: bp-forums/deprecated/1.6.php:74 bp-forums/deprecated/1.6.php:216
2561
- msgid "Features"
2562
- msgstr ""
2563
-
2564
- #: bp-forums/deprecated/1.6.php:76 bp-forums/deprecated/1.6.php:218
2565
- msgid "Group Integration"
2566
- msgstr ""
2567
-
2568
- #: bp-forums/deprecated/1.6.php:77 bp-forums/deprecated/1.6.php:219
2569
- msgid "Member Profile Integration"
2570
- msgstr ""
2571
-
2572
- #: bp-forums/deprecated/1.6.php:78 bp-forums/deprecated/1.6.php:220
2573
- msgid "Activity Stream Integration"
2574
- msgstr ""
2575
-
2576
- #: bp-forums/deprecated/1.6.php:79 bp-forums/deprecated/1.6.php:221
2577
- msgid "@ Mention Integration"
2578
- msgstr ""
2579
-
2580
- #: bp-forums/deprecated/1.6.php:83
2581
- msgid "Uninstall Group Forums"
2582
- msgstr ""
2583
-
2584
- #: bp-forums/deprecated/1.6.php:88 bp-forums/deprecated/1.6.php:231
2585
- msgid "New! bbPress"
2586
- msgstr ""
2587
-
2588
- #: bp-forums/deprecated/1.6.php:89 bp-forums/deprecated/1.6.php:232
2589
- msgid "bbPress is a brand-new forum plugin from one of the lead developers of BuddyPress."
2590
- msgstr ""
2591
-
2592
- #: bp-forums/deprecated/1.6.php:91 bp-forums/deprecated/1.6.php:234
2593
- msgid "It boasts a bunch of cool features that the BP Legacy Discussion Forums does not have including:"
2594
- msgstr ""
2595
-
2596
- #: bp-forums/deprecated/1.6.php:94 bp-forums/deprecated/1.6.php:237
2597
- msgid "Non-group specific forum creation"
2598
- msgstr ""
2599
-
2600
- #: bp-forums/deprecated/1.6.php:95 bp-forums/deprecated/1.6.php:238
2601
- msgid "Moderation via the WP admin dashboard"
2602
- msgstr ""
2603
-
2604
- #: bp-forums/deprecated/1.6.php:96 bp-forums/deprecated/1.6.php:239
2605
- msgid "Topic splitting"
2606
- msgstr ""
2607
-
2608
- #: bp-forums/deprecated/1.6.php:97 bp-forums/deprecated/1.6.php:240
2609
- msgid "Revisions"
2610
- msgstr ""
2611
-
2612
- #: bp-forums/deprecated/1.6.php:98 bp-forums/deprecated/1.6.php:241
2613
- msgid "Spam management"
2614
- msgstr ""
2615
-
2616
- #: bp-forums/deprecated/1.6.php:99 bp-forums/deprecated/1.6.php:242
2617
- msgid "Subscriptions"
2618
- msgstr ""
2619
-
2620
- #: bp-forums/deprecated/1.6.php:100 bp-forums/deprecated/1.6.php:243
2621
- msgid "And more!"
2622
- msgstr ""
2623
-
2624
- #: bp-forums/deprecated/1.6.php:103 bp-forums/deprecated/1.6.php:246
2625
- msgid "If you decide to use bbPress, you will need to deactivate the legacy group forum component. For more info, <a href=\"%s\">read this codex article</a>."
2626
- msgstr ""
2627
-
2628
- #: bp-forums/deprecated/1.6.php:143
2629
- msgid "The bb-config.php file was not found at that location, please try again."
2630
- msgstr ""
2631
-
2632
- #: bp-forums/deprecated/1.6.php:146
2633
- msgid "Forums were set up correctly using your existing bbPress install!"
2634
- msgstr ""
2635
-
2636
- #: bp-forums/deprecated/1.6.php:147
2637
- 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."
2638
- msgstr ""
2639
-
2640
- #: bp-forums/deprecated/1.6.php:152
2641
- msgid "Existing bbPress Installation"
2642
- msgstr ""
2643
-
2644
- #: bp-forums/deprecated/1.6.php:153
2645
- 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."
2646
- msgstr ""
2647
-
2648
- #: bp-forums/deprecated/1.6.php:155 bp-forums/deprecated/1.6.php:187
2649
- msgid "Complete Installation"
2650
- msgstr ""
2651
-
2652
- #: bp-forums/deprecated/1.6.php:171
2653
- 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>"
2654
- msgstr ""
2655
-
2656
- #: bp-forums/deprecated/1.6.php:175
2657
- 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>"
2658
- msgstr ""
2659
-
2660
- #: bp-forums/deprecated/1.6.php:184
2661
- msgid "New bbPress Installation"
2662
- msgstr ""
2663
-
2664
- #: bp-forums/deprecated/1.6.php:185
2665
- msgid ""
2666
- "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"
2667
- "\t\t\t\tprocess. When you're ready, hit the link below."
2668
- msgstr ""
2669
-
2670
- #: bp-forums/deprecated/1.6.php:197
2671
- 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\""
2672
- msgstr ""
2673
-
2674
- #: bp-forums/deprecated/1.6.php:225
2675
- msgid "Install Group Forums"
2676
- msgstr ""
2677
-
2678
- #: bp-forums/deprecated/1.6.php:226
2679
- msgid "Use Existing Installation"
2680
- msgstr ""
2681
-
2682
- #: bp-friends/bp-friends-actions.php:38
2683
- msgid "Friendship could not be requested."
2684
- msgstr ""
2685
-
2686
- #: bp-friends/bp-friends-actions.php:40
2687
- msgid "Friendship requested"
2688
- msgstr ""
2689
-
2690
- #: bp-friends/bp-friends-actions.php:44
2691
- msgid "You are already friends with this user"
2692
- msgstr ""
2693
-
2694
- #: bp-friends/bp-friends-actions.php:46
2695
- msgid "You already have a pending friendship request with this user"
2696
- msgstr ""
2697
-
2698
- #: bp-friends/bp-friends-actions.php:76
2699
- #: bp-templates/bp-legacy/buddypress-functions.php:1080
2700
- #: bp-themes/bp-default/_inc/ajax.php:646
2701
- msgid "Friendship could not be canceled."
2702
- msgstr ""
2703
-
2704
- #: bp-friends/bp-friends-actions.php:78
2705
- msgid "Friendship canceled"
2706
- msgstr ""
2707
-
2708
- #: bp-friends/bp-friends-actions.php:82
2709
- msgid "You are not yet friends with this user"
2710
- msgstr ""
2711
-
2712
- #: bp-friends/bp-friends-actions.php:84
2713
- msgid "You have a pending friendship request with this user"
2714
- msgstr ""
2715
-
2716
- #: bp-friends/bp-friends-activity.php:98
2717
- msgid "Friendships accepted"
2718
- msgstr ""
2719
-
2720
- #: bp-friends/bp-friends-activity.php:105
2721
- msgid "New friendships"
2722
- msgstr ""
2723
-
2724
- #: bp-friends/bp-friends-activity.php:110
2725
- msgid "New friendship created"
2726
- msgstr ""
2727
-
2728
- #: bp-friends/bp-friends-activity.php:128
2729
- #: bp-friends/bp-friends-activity.php:154
2730
- #: tests/testcases/friends/activity.php:23
2731
- #: tests/testcases/friends/activity.php:45
2732
- msgid "%1$s and %2$s are now friends"
2733
- msgstr ""
2734
-
2735
- #: bp-friends/bp-friends-loader.php:92
2736
- msgid "Search Friends..."
2737
- msgstr ""
2738
-
2739
- #: bp-friends/bp-friends-loader.php:119
2740
- msgid "Friends <span class=\"%s\">%s</span>"
2741
- msgstr ""
2742
-
2743
- #: bp-friends/bp-friends-loader.php:140 bp-friends/bp-friends-loader.php:204
2744
- #: bp-friends/bp-friends-loader.php:229
2745
- #: bp-templates/bp-legacy/buddypress/activity/index.php:104
2746
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:35
2747
- #: bp-themes/bp-default/activity/index.php:124
2748
- #: bp-themes/bp-default/members/single/activity.php:35
2749
- msgid "Friendships"
2750
- msgstr ""
2751
-
2752
- #: bp-friends/bp-friends-loader.php:150 bp-groups/bp-groups-template.php:1524
2753
- msgid "Requests"
2754
- msgstr ""
2755
-
2756
- #: bp-friends/bp-friends-loader.php:185
2757
- msgid "Friends <span class=\"count\">%s</span>"
2758
- msgstr ""
2759
-
2760
- #: bp-friends/bp-friends-loader.php:186
2761
- msgid "Pending Requests <span class=\"count\">%s</span>"
2762
- msgstr ""
2763
-
2764
- #: bp-friends/bp-friends-loader.php:189
2765
- msgid "No Pending Requests"
2766
- msgstr ""
2767
-
2768
- #: bp-friends/bp-friends-notifications.php:43
2769
- msgid "New friendship request from %s"
2770
- msgstr ""
2771
-
2772
- #: bp-friends/bp-friends-notifications.php:44
2773
- msgid ""
2774
- "%1$s wants to add you as a friend.\n"
2775
- "\n"
2776
- "To view all of your pending friendship requests: %2$s\n"
2777
- "\n"
2778
- "To view %3$s's profile: %4$s\n"
2779
- "\n"
2780
- "---------------------\n"
2781
- msgstr ""
2782
-
2783
- #: bp-friends/bp-friends-notifications.php:94
2784
- #: bp-friends/bp-friends-notifications.php:144
2785
- msgid "%s accepted your friendship request"
2786
- msgstr ""
2787
-
2788
- #: bp-friends/bp-friends-notifications.php:95
2789
- msgid ""
2790
- "%1$s accepted your friend request.\n"
2791
- "\n"
2792
- "To view %2$s's profile: %3$s\n"
2793
- "\n"
2794
- "---------------------\n"
2795
- msgstr ""
2796
-
2797
- #: bp-friends/bp-friends-notifications.php:141
2798
- msgid "%d friends accepted your friendship requests"
2799
- msgstr ""
2800
-
2801
- #: bp-friends/bp-friends-notifications.php:155
2802
- msgid "You have %d pending friendship requests"
2803
- msgstr ""
2804
-
2805
- #: bp-friends/bp-friends-notifications.php:158
2806
- msgid "You have a friendship request from %s"
2807
- msgstr ""
2808
-
2809
- #: bp-friends/bp-friends-screens.php:36
2810
- msgid "Friendship accepted"
2811
- msgstr ""
2812
-
2813
- #: bp-friends/bp-friends-screens.php:38
2814
- msgid "Friendship could not be accepted"
2815
- msgstr ""
2816
-
2817
- #: bp-friends/bp-friends-screens.php:47
2818
- msgid "Friendship rejected"
2819
- msgstr ""
2820
-
2821
- #: bp-friends/bp-friends-screens.php:49
2822
- msgid "Friendship could not be rejected"
2823
- msgstr ""
2824
-
2825
- #: bp-friends/bp-friends-screens.php:58
2826
- msgid "Friendship request withdrawn"
2827
- msgstr ""
2828
-
2829
- #: bp-friends/bp-friends-screens.php:60
2830
- msgid "Friendship request could not be withdrawn"
2831
- msgstr ""
2832
-
2833
- #: bp-friends/bp-friends-screens.php:94
2834
- msgid "A member sends you a friendship request"
2835
- msgstr ""
2836
-
2837
- #: bp-friends/bp-friends-screens.php:100
2838
- msgid "A member accepts your friendship request"
2839
- msgstr ""
2840
-
2841
- #: bp-friends/bp-friends-template.php:66 bp-xprofile/bp-xprofile-loader.php:124
2842
- msgid "My Friends"
2843
- msgstr ""
2844
-
2845
- #: bp-friends/bp-friends-template.php:66
2846
- msgid "%s's Friends"
2847
- msgstr ""
2848
-
2849
- #: bp-friends/bp-friends-template.php:66
2850
- msgid "See All"
2851
- msgstr ""
2852
-
2853
- #: bp-friends/bp-friends-template.php:86
2854
- msgid "You haven't added any friend connections yet."
2855
- msgstr ""
2856
-
2857
- #: bp-friends/bp-friends-template.php:86
2858
- msgid "%s hasn't created any friend connections yet."
2859
- msgstr ""
2860
-
2861
- #: bp-friends/bp-friends-template.php:156
2862
- msgid "There aren't enough site members to show a random sample just yet."
2863
- msgstr ""
2864
-
2865
- #: bp-friends/bp-friends-template.php:173
2866
- msgid "Filter Friends"
2867
- msgstr ""
2868
-
2869
- #: bp-friends/bp-friends-template.php:221
2870
- msgid "%d friend"
2871
- msgstr ""
2872
-
2873
- #: bp-friends/bp-friends-template.php:223
2874
- msgid "%d friends"
2875
- msgstr ""
2876
-
2877
- #: bp-friends/bp-friends-template.php:318
2878
- #: bp-templates/bp-legacy/buddypress-functions.php:1092
2879
- #: bp-themes/bp-default/_inc/ajax.php:658
2880
- msgid "Cancel Friendship Request"
2881
- msgstr ""
2882
-
2883
- #: bp-friends/bp-friends-template.php:319
2884
- msgid "Cancel Friendship Requested"
2885
- msgstr ""
2886
-
2887
- #: bp-friends/bp-friends-template.php:335
2888
- #: bp-friends/bp-friends-template.php:336
2889
- msgid "Friendship Requested"
2890
- msgstr ""
2891
-
2892
- #: bp-friends/bp-friends-template.php:352
2893
- #: bp-friends/bp-friends-template.php:353
2894
- msgid "Cancel Friendship"
2895
- msgstr ""
2896
-
2897
- #: bp-friends/bp-friends-template.php:369
2898
- #: bp-friends/bp-friends-template.php:370
2899
- #: bp-templates/bp-legacy/buddypress-functions.php:1082
2900
- #: bp-templates/bp-legacy/buddypress-functions.php:1100
2901
- #: bp-themes/bp-default/_inc/ajax.php:648
2902
- #: bp-themes/bp-default/_inc/ajax.php:666
2903
- msgid "Add Friend"
2904
- msgstr ""
2905
-
2906
- #: bp-friends/bp-friends-template.php:588
2907
- msgid "%s friend"
2908
- msgid_plural "%s friends"
2909
- msgstr[0] ""
2910
- msgstr[1] ""
2911
-
2912
- #: bp-friends/bp-friends-widgets.php:41
2913
- msgid "A dynamic list of recently active, popular, and newest Friends of the displayed member. Widget is only shown when viewing a member profile."
2914
- msgstr ""
2915
-
2916
- #: bp-friends/bp-friends-widgets.php:44
2917
- msgctxt "widget name"
2918
- msgid "(BuddyPress) Friends"
2919
- msgstr ""
2920
-
2921
- #: bp-friends/bp-friends-widgets.php:66
2922
- msgid "%s&#8217;s Friends"
2923
- msgstr ""
2924
-
2925
- #: bp-friends/bp-friends-widgets.php:128
2926
- #: bp-templates/bp-legacy/buddypress/members/members-loop.php:108
2927
- #: bp-themes/bp-default/members/members-loop.php:108
2928
- msgid "Sorry, no members were found."
2929
- msgstr ""
2930
-
2931
- #: bp-friends/bp-friends-widgets.php:174
2932
- msgid "Max friends to show:"
2933
- msgstr ""
2934
-
2935
- #: bp-friends/bp-friends-widgets.php:177
2936
- msgid "Default friends to show:"
2937
- msgstr ""
2938
-
2939
- #: bp-groups/bp-groups-actions.php:31
2940
- msgid "Sorry, you are not allowed to create groups."
2941
- msgstr ""
2942
-
2943
- #: bp-groups/bp-groups-actions.php:54
2944
- msgid "There was an error saving group details. Please try again."
2945
- msgstr ""
2946
-
2947
- #: bp-groups/bp-groups-actions.php:69
2948
- msgid "Only the group creator may continue editing this group."
2949
- msgstr ""
2950
-
2951
- #: bp-groups/bp-groups-actions.php:82
2952
- msgid "Please fill in all of the required fields"
2953
- msgstr ""
2954
-
2955
- #: bp-groups/bp-groups-actions.php:89 bp-groups/bp-groups-actions.php:113
2956
- msgid "There was an error saving group details, please try again."
2957
- msgstr ""
2958
-
2959
- #: bp-groups/bp-groups-actions.php:197 bp-groups/bp-groups-screens.php:472
2960
- msgid "Invite successfully removed"
2961
- msgstr ""
2962
-
2963
- #: bp-groups/bp-groups-actions.php:201 bp-groups/bp-groups-screens.php:483
2964
- msgid "There was an error removing the invite"
2965
- msgstr ""
2966
-
2967
- #: bp-groups/bp-groups-actions.php:232
2968
- msgid "There was an error saving the group avatar, please try uploading again."
2969
- msgstr ""
2970
-
2971
- #: bp-groups/bp-groups-actions.php:234
2972
- msgid "The group avatar was uploaded successfully!"
2973
- msgstr ""
2974
-
2975
- #: bp-groups/bp-groups-actions.php:258 bp-groups/bp-groups-actions.php:265
2976
- msgid "There was an error joining the group."
2977
- msgstr ""
2978
-
2979
- #: bp-groups/bp-groups-actions.php:267
2980
- msgid "You joined the group!"
2981
- msgstr ""
2982
-
2983
- #: bp-groups/bp-groups-actions.php:305 bp-groups/bp-groups-screens.php:753
2984
- msgid "This group must have at least one admin"
2985
- msgstr ""
2986
-
2987
- #: bp-groups/bp-groups-actions.php:307
2988
- msgid "There was an error leaving the group."
2989
- msgstr ""
2990
-
2991
- #: bp-groups/bp-groups-actions.php:309 bp-groups/bp-groups-functions.php:317
2992
- msgid "You successfully left the group."
2993
- msgstr ""
2994
-
2995
- #: bp-groups/bp-groups-actions.php:392
2996
- msgid "Activity feed for the group, %s."
2997
- msgstr ""
2998
-
2999
- #: bp-groups/bp-groups-activity.php:29
3000
- msgid "Created a group"
3001
- msgstr ""
3002
-
3003
- #: bp-groups/bp-groups-activity.php:36
3004
- msgid "Joined a group"
3005
- msgstr ""
3006
-
3007
- #: bp-groups/bp-groups-activity.php:44
3008
- msgid "New group forum topic"
3009
- msgstr ""
3010
-
3011
- #: bp-groups/bp-groups-activity.php:45
3012
- msgid "New group forum post"
3013
- msgstr ""
3014
-
3015
- #: bp-groups/bp-groups-activity.php:70
3016
- msgid "%1$s created the group %2$s"
3017
- msgstr ""
3018
-
3019
- #: bp-groups/bp-groups-activity.php:93 bp-groups/bp-groups-activity.php:259
3020
- msgid "%1$s joined the group %2$s"
3021
- msgstr ""
3022
-
3023
- #: bp-groups/bp-groups-admin.php:113
3024
- msgid "This page is a convenient way to edit the details associated with one of your groups."
3025
- msgstr ""
3026
-
3027
- #: bp-groups/bp-groups-admin.php:114
3028
- 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."
3029
- msgstr ""
3030
-
3031
- #: bp-groups/bp-groups-admin.php:120
3032
- msgid "Support Forums"
3033
- msgstr ""
3034
-
3035
- #: bp-groups/bp-groups-admin.php:124
3036
- msgctxt "group admin edit screen"
3037
- msgid "Save"
3038
- msgstr ""
3039
-
3040
- #: bp-groups/bp-groups-admin.php:125
3041
- msgctxt "group admin edit screen"
3042
- msgid "Settings"
3043
- msgstr ""
3044
-
3045
- #: bp-groups/bp-groups-admin.php:126
3046
- msgctxt "group admin edit screen"
3047
- msgid "Add New Members"
3048
- msgstr ""
3049
-
3050
- #: bp-groups/bp-groups-admin.php:127
3051
- msgctxt "group admin edit screen"
3052
- msgid "Manage Members"
3053
- msgstr ""
3054
-
3055
- #: bp-groups/bp-groups-admin.php:141
3056
- msgctxt "Groups per page (screen options)"
3057
- msgid "Groups"
3058
- msgstr ""
3059
-
3060
- #: bp-groups/bp-groups-admin.php:148
3061
- 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."
3062
- msgstr ""
3063
-
3064
- #: bp-groups/bp-groups-admin.php:153
3065
- msgid "Group Actions"
3066
- msgstr ""
3067
-
3068
- #: bp-groups/bp-groups-admin.php:155
3069
- 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."
3070
- msgstr ""
3071
-
3072
- #: bp-groups/bp-groups-admin.php:156
3073
- 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."
3074
- msgstr ""
3075
-
3076
- #: bp-groups/bp-groups-admin.php:157
3077
- 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)."
3078
- msgstr ""
3079
-
3080
- #: bp-groups/bp-groups-admin.php:174
3081
- msgid "Start typing a username to add a new member."
3082
- msgstr ""
3083
-
3084
- #: bp-groups/bp-groups-admin.php:175
3085
- msgid "If you leave this page, you will lose any unsaved changes you have made to the group."
3086
- msgstr ""
3087
-
3088
- #: bp-groups/bp-groups-admin.php:453
3089
- msgid "You cannot remove all administrators from a group."
3090
- msgstr ""
3091
-
3092
- #: bp-groups/bp-groups-admin.php:457
3093
- msgid "An error occurred when trying to update your group details."
3094
- msgstr ""
3095
-
3096
- #: bp-groups/bp-groups-admin.php:459
3097
- msgid "The group has been updated successfully."
3098
- msgstr ""
3099
-
3100
- #: bp-groups/bp-groups-admin.php:463
3101
- msgid "The following users could not be added to the group: <em>%s</em>"
3102
- msgstr ""
3103
-
3104
- #: bp-groups/bp-groups-admin.php:467
3105
- msgid "The following users were successfully added to the group: <em>%s</em>"
3106
- msgstr ""
3107
-
3108
- #: bp-groups/bp-groups-admin.php:472
3109
- msgid "An error occurred when trying to modify the following members: <em>%s</em>"
3110
- msgstr ""
3111
-
3112
- #: bp-groups/bp-groups-admin.php:477
3113
- msgid "The following members were successfully modified: <em>%s</em>"
3114
- msgstr ""
3115
-
3116
- #: bp-groups/bp-groups-admin.php:496 bp-groups/bp-groups-adminbar.php:39
3117
- #: bp-xprofile/bp-xprofile-admin.php:114
3118
- msgid "Edit Group"
3119
- msgstr ""
3120
-
3121
- #: bp-groups/bp-groups-admin.php:499 bp-groups/bp-groups-admin.php:641
3122
- msgid "Add New"
3123
- msgstr ""
3124
-
3125
- #: bp-groups/bp-groups-admin.php:518
3126
- msgid "Name and Description"
3127
- msgstr ""
3128
-
3129
- #: bp-groups/bp-groups-admin.php:545
3130
- msgid "No group found with this ID. <a href=\"%s\">Go back and try again</a>."
3131
- msgstr ""
3132
-
3133
- #: bp-groups/bp-groups-admin.php:587
3134
- msgid "Delete Groups"
3135
- msgstr ""
3136
-
3137
- #: bp-groups/bp-groups-admin.php:588
3138
- msgid "You are about to delete the following groups:"
3139
- msgstr ""
3140
-
3141
- #: bp-groups/bp-groups-admin.php:596 bp-members/bp-members-admin.php:1421
3142
- msgid "This action cannot be undone."
3143
- msgstr ""
3144
-
3145
- #: bp-groups/bp-groups-admin.php:625
3146
- msgid "%s group has been permanently deleted."
3147
- msgid_plural "%s groups have been permanently deleted."
3148
- msgstr[0] ""
3149
- msgstr[1] ""
3150
-
3151
- #: bp-groups/bp-groups-admin.php:658
3152
- msgid "Search all Groups"
3153
- msgstr ""
3154
-
3155
- #: bp-groups/bp-groups-admin.php:681
3156
- #: bp-templates/bp-legacy/buddypress/groups/create.php:112
3157
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:47
3158
- #: bp-themes/bp-default/groups/create.php:119
3159
- #: bp-themes/bp-default/groups/single/admin.php:47
3160
- msgid "Enable discussion forum"
3161
- msgstr ""
3162
-
3163
- #: bp-groups/bp-groups-admin.php:687
3164
- msgid "Privacy"
3165
- msgstr ""
3166
-
3167
- #: bp-groups/bp-groups-admin.php:690 bp-groups/bp-groups-admin.php:1447
3168
- #: bp-groups/bp-groups-template.php:663
3169
- msgid "Public"
3170
- msgstr ""
3171
-
3172
- #: bp-groups/bp-groups-admin.php:691 bp-groups/bp-groups-admin.php:1450
3173
- #: bp-groups/bp-groups-template.php:665
3174
- msgid "Private"
3175
- msgstr ""
3176
-
3177
- #: bp-groups/bp-groups-admin.php:692 bp-groups/bp-groups-admin.php:1453
3178
- msgid "Hidden"
3179
- msgstr ""
3180
-
3181
- #: bp-groups/bp-groups-admin.php:699
3182
- msgid "Who can invite others to this group?"
3183
- msgstr ""
3184
-
3185
- #: bp-groups/bp-groups-admin.php:702
3186
- #: bp-templates/bp-legacy/buddypress/groups/create.php:89
3187
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:99
3188
- #: bp-themes/bp-default/groups/create.php:96
3189
- #: bp-themes/bp-default/groups/single/admin.php:99
3190
- msgid "All group members"
3191
- msgstr ""
3192
-
3193
- #: bp-groups/bp-groups-admin.php:703
3194
- #: bp-templates/bp-legacy/buddypress/groups/create.php:94
3195
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:104
3196
- #: bp-themes/bp-default/groups/create.php:101
3197
- #: bp-themes/bp-default/groups/single/admin.php:104
3198
- msgid "Group admins and mods only"
3199
- msgstr ""
3200
-
3201
- #: bp-groups/bp-groups-admin.php:704
3202
- #: bp-templates/bp-legacy/buddypress/groups/create.php:99
3203
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:109
3204
- #: bp-themes/bp-default/groups/create.php:106
3205
- #: bp-themes/bp-default/groups/single/admin.php:109
3206
- msgid "Group admins only"
3207
- msgstr ""
3208
-
3209
- #: bp-groups/bp-groups-admin.php:720
3210
- msgid "Enter a comma-separated list of user logins."
3211
- msgstr ""
3212
-
3213
- #: bp-groups/bp-groups-admin.php:779
3214
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:177
3215
- #: bp-themes/bp-default/groups/single/admin.php:177
3216
- msgid "Administrators"
3217
- msgstr ""
3218
-
3219
- #: bp-groups/bp-groups-admin.php:780
3220
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:205
3221
- #: bp-themes/bp-default/groups/single/admin.php:205
3222
- msgid "Moderators"
3223
- msgstr ""
3224
-
3225
- #: bp-groups/bp-groups-admin.php:782
3226
- msgid "Banned Users"
3227
- msgstr ""
3228
-
3229
- #: bp-groups/bp-groups-admin.php:795
3230
- msgctxt "Group member user_id in group admin"
3231
- msgid "ID"
3232
- msgstr ""
3233
-
3234
- #: bp-groups/bp-groups-admin.php:796
3235
- msgctxt "Group member name in group admin"
3236
- msgid "Name"
3237
- msgstr ""
3238
-
3239
- #: bp-groups/bp-groups-admin.php:797
3240
- msgctxt "Group member role in group admin"
3241
- msgid "Group Role"
3242
- msgstr ""
3243
-
3244
- #: bp-groups/bp-groups-admin.php:819
3245
- msgid "Administrator"
3246
- msgstr ""
3247
-
3248
- #: bp-groups/bp-groups-admin.php:820
3249
- msgid "Moderator"
3250
- msgstr ""
3251
-
3252
- #: bp-groups/bp-groups-admin.php:821
3253
- msgid "Member"
3254
- msgstr ""
3255
-
3256
- #: bp-groups/bp-groups-admin.php:822
3257
- msgid "Banned"
3258
- msgstr ""
3259
-
3260
- #: bp-groups/bp-groups-admin.php:823
3261
- msgid "Remove From Group"
3262
- msgstr ""
3263
-
3264
- #: bp-groups/bp-groups-admin.php:856
3265
- msgid "No members of this type"
3266
- msgstr ""
3267
-
3268
- #: bp-groups/bp-groups-admin.php:882 bp-groups/bp-groups-adminbar.php:101
3269
- #: bp-groups/bp-groups-buddybar.php:58
3270
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:332
3271
- #: bp-themes/bp-default/groups/single/admin.php:360
3272
- #: bp-xprofile/bp-xprofile-admin.php:118
3273
- msgid "Delete Group"
3274
- msgstr ""
3275
-
3276
- #: bp-groups/bp-groups-admin.php:886 bp-groups/bp-groups-classes.php:3135
3277
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:32
3278
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:117
3279
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:58
3280
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:74
3281
- #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:61
3282
- #: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:22
3283
- #: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:11
3284
- #: bp-themes/bp-default/groups/single/admin.php:32
3285
- #: bp-themes/bp-default/groups/single/admin.php:117
3286
- #: bp-themes/bp-default/groups/single/forum/edit.php:58
3287
- #: bp-themes/bp-default/groups/single/forum/edit.php:74
3288
- #: bp-themes/bp-default/members/single/profile/edit.php:148
3289
- #: bp-themes/bp-default/members/single/settings/general.php:72
3290
- #: bp-themes/bp-default/members/single/settings/notifications.php:61
3291
- #: bp-xprofile/bp-xprofile-classes.php:460
3292
- msgid "Save Changes"
3293
- msgstr ""
3294
-
3295
- #: bp-groups/bp-groups-admin.php:935
3296
- msgid "&laquo;"
3297
- msgstr ""
3298
-
3299
- #: bp-groups/bp-groups-admin.php:936
3300
- msgid "&raquo;"
3301
- msgstr ""
3302
-
3303
- #: bp-groups/bp-groups-admin.php:942
3304
- msgid "Viewing %1$s - %2$s of %3$s"
3305
- msgstr ""
3306
-
3307
- #: bp-groups/bp-groups-admin.php:945 bp-groups/bp-groups-template.php:1004
3308
- msgid "%s member"
3309
- msgid_plural "%s members"
3310
- msgstr[0] ""
3311
- msgstr[1] ""
3312
-
3313
- #. translators: 1: user_login, 2: user_email
3314
-
3315
- #: bp-groups/bp-groups-admin.php:1011
3316
- msgid "%1$s (%2$s)"
3317
- msgstr ""
3318
-
3319
- #: bp-groups/bp-groups-admin.php:1195
3320
- msgid "No groups found."
3321
- msgstr ""
3322
-
3323
- #: bp-groups/bp-groups-admin.php:1268
3324
- msgid "Public <span class=\"count\">(%s)</span>"
3325
- msgid_plural "Public <span class=\"count\">(%s)</span>"
3326
- msgstr[0] ""
3327
- msgstr[1] ""
3328
-
3329
- #: bp-groups/bp-groups-admin.php:1269
3330
- msgid "Private <span class=\"count\">(%s)</span>"
3331
- msgid_plural "Private <span class=\"count\">(%s)</span>"
3332
- msgstr[0] ""
3333
- msgstr[1] ""
3334
-
3335
- #: bp-groups/bp-groups-admin.php:1270
3336
- msgid "Hidden <span class=\"count\">(%s)</span>"
3337
- msgid_plural "Hidden <span class=\"count\">(%s)</span>"
3338
- msgstr[0] ""
3339
- msgstr[1] ""
3340
-
3341
- #: bp-groups/bp-groups-admin.php:1302
3342
- msgctxt "Groups admin Group Name column header"
3343
- msgid "Name"
3344
- msgstr ""
3345
-
3346
- #: bp-groups/bp-groups-admin.php:1303
3347
- msgctxt "Groups admin Group Description column header"
3348
- msgid "Description"
3349
- msgstr ""
3350
-
3351
- #: bp-groups/bp-groups-admin.php:1304
3352
- msgctxt "Groups admin Privacy Status column header"
3353
- msgid "Status"
3354
- msgstr ""
3355
-
3356
- #: bp-groups/bp-groups-admin.php:1305
3357
- msgctxt "Groups admin Members column header"
3358
- msgid "# Members"
3359
- msgstr ""
3360
-
3361
- #: bp-groups/bp-groups-admin.php:1306
3362
- msgctxt "Groups admin Last Active column header"
3363
- msgid "Last Active"
3364
- msgstr ""
3365
-
3366
- #: bp-groups/bp-groups-admin.php:1345
3367
- msgid "Select group %1$d"
3368
- msgstr ""
3369
-
3370
- #: bp-groups/bp-groups-adminbar.php:47 bp-groups/bp-groups-buddybar.php:34
3371
- msgid "Edit Details"
3372
- msgstr ""
3373
-
3374
- #: bp-groups/bp-groups-adminbar.php:55
3375
- msgid "Edit Settings"
3376
- msgstr ""
3377
-
3378
- #: bp-groups/bp-groups-adminbar.php:64 bp-members/bp-members-adminbar.php:109
3379
- msgid "Edit Avatar"
3380
- msgstr ""
3381
-
3382
- #: bp-groups/bp-groups-adminbar.php:74 bp-groups/bp-groups-buddybar.php:46
3383
- msgid "Manage Invitations"
3384
- msgstr ""
3385
-
3386
- #: bp-groups/bp-groups-adminbar.php:83 bp-groups/bp-groups-buddybar.php:50
3387
- msgid "Manage Members"
3388
- msgstr ""
3389
-
3390
- #: bp-groups/bp-groups-adminbar.php:92 bp-groups/bp-groups-buddybar.php:54
3391
- msgid "Membership Requests"
3392
- msgstr ""
3393
-
3394
- #: bp-groups/bp-groups-buddybar.php:31 bp-members/bp-members-buddybar.php:94
3395
- msgid "Admin Options"
3396
- msgstr ""
3397
-
3398
- #: bp-groups/bp-groups-buddybar.php:36
3399
- msgid "Group Settings"
3400
- msgstr ""
3401
-
3402
- #: bp-groups/bp-groups-buddybar.php:40 bp-groups/bp-groups-loader.php:614
3403
- msgid "Group Avatar"
3404
- msgstr ""
3405
-
3406
- #: bp-groups/bp-groups-classes.php:2016
3407
- msgid "Group Mod"
3408
- msgstr ""
3409
-
3410
- #: bp-groups/bp-groups-classes.php:2022 bp-groups/bp-groups-functions.php:147
3411
- msgid "Group Admin"
3412
- msgstr ""
3413
-
3414
- #: bp-groups/bp-groups-forums.php:107 bp-groups/bp-groups-forums.php:256
3415
- msgid "%1$s replied to the forum topic %2$s in the group %3$s"
3416
- msgstr ""
3417
-
3418
- #: bp-groups/bp-groups-forums.php:157
3419
- msgid "%1$s started the forum topic %2$s in the group %3$s"
3420
- msgstr ""
3421
-
3422
- #: bp-groups/bp-groups-forums.php:209
3423
- msgid "%1$s edited the forum topic %2$s in the group %3$s"
3424
- msgstr ""
3425
-
3426
- #: bp-groups/bp-groups-functions.php:307
3427
- msgid "As the only Admin, you cannot leave the group."
3428
- msgstr ""
3429
-
3430
- #: bp-groups/bp-groups-functions.php:667
3431
- msgid "%1$s posted an update in the group %2$s"
3432
- msgstr ""
3433
-
3434
- #: bp-groups/bp-groups-loader.php:150
3435
- msgctxt "component directory title"
3436
- msgid "Groups"
3437
- msgstr ""
3438
-
3439
- #: bp-groups/bp-groups-loader.php:152
3440
- msgid "Search Groups..."
3441
- msgstr ""
3442
-
3443
- #: bp-groups/bp-groups-loader.php:291
3444
- msgid "You do not have access to this group."
3445
- msgstr ""
3446
-
3447
- #: bp-groups/bp-groups-loader.php:306
3448
- msgid "You are not an admin of this group."
3449
- msgstr ""
3450
-
3451
- #: bp-groups/bp-groups-loader.php:316 bp-groups/bp-groups-template.php:1505
3452
- msgid "Details"
3453
- msgstr ""
3454
-
3455
- #: bp-groups/bp-groups-loader.php:328 bp-groups/bp-groups-template.php:1516
3456
- msgid "Avatar"
3457
- msgstr ""
3458
-
3459
- #: bp-groups/bp-groups-loader.php:336
3460
- msgid "Invites"
3461
- msgstr ""
3462
-
3463
- #: bp-groups/bp-groups-loader.php:363
3464
- msgid "Groups <span class=\"%s\">%s</span>"
3465
- msgstr ""
3466
-
3467
- #: bp-groups/bp-groups-loader.php:392 bp-groups/bp-groups-loader.php:422
3468
- #: bp-groups/bp-groups-loader.php:560 bp-groups/bp-groups-loader.php:595
3469
- msgid "Memberships"
3470
- msgstr ""
3471
-
3472
- #: bp-groups/bp-groups-loader.php:403
3473
- msgid "Invitations"
3474
- msgstr ""
3475
-
3476
- #: bp-groups/bp-groups-loader.php:434
3477
- msgctxt "Group home navigation title"
3478
- msgid "Home"
3479
- msgstr ""
3480
-
3481
- #: bp-groups/bp-groups-loader.php:454 bp-groups/bp-groups-template.php:1870
3482
- #: bp-groups/bp-groups-template.php:1871
3483
- #: bp-templates/bp-legacy/buddypress-functions.php:1214
3484
- #: bp-themes/bp-default/_inc/ajax.php:780
3485
- msgid "Request Membership"
3486
- msgstr ""
3487
-
3488
- #: bp-groups/bp-groups-loader.php:466
3489
- msgid "Forum"
3490
- msgstr ""
3491
-
3492
- #: bp-groups/bp-groups-loader.php:478
3493
- msgid "Members <span>%s</span>"
3494
- msgstr ""
3495
-
3496
- #: bp-groups/bp-groups-loader.php:490
3497
- #: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:90
3498
- #: bp-themes/bp-default/groups/single/send-invites.php:60
3499
- msgid "Send Invites"
3500
- msgstr ""
3501
-
3502
- #: bp-groups/bp-groups-loader.php:504
3503
- msgid "Admin"
3504
- msgstr ""
3505
-
3506
- #: bp-groups/bp-groups-loader.php:541
3507
- msgid "No Pending Invites"
3508
- msgstr ""
3509
-
3510
- #: bp-groups/bp-groups-loader.php:544
3511
- msgid "Groups <span class=\"count\">%s</span>"
3512
- msgstr ""
3513
-
3514
- #: bp-groups/bp-groups-loader.php:545
3515
- msgid "Pending Invites <span class=\"count\">%s</span>"
3516
- msgstr ""
3517
-
3518
- #: bp-groups/bp-groups-loader.php:618
3519
- msgid "No Group Avatar"
3520
- msgstr ""
3521
-
3522
- #: bp-groups/bp-groups-notifications.php:21
3523
- msgid "Group Details Updated"
3524
- msgstr ""
3525
-
3526
- #: bp-groups/bp-groups-notifications.php:36
3527
- msgid ""
3528
- "Group details for the group \"%1$s\" were updated:\n"
3529
- "\n"
3530
- "To view the group: %2$s\n"
3531
- "\n"
3532
- "---------------------\n"
3533
- msgstr ""
3534
-
3535
- #: bp-groups/bp-groups-notifications.php:91
3536
- msgid "Membership request for group: %s"
3537
- msgstr ""
3538
-
3539
- #: bp-groups/bp-groups-notifications.php:93
3540
- msgid ""
3541
- "%1$s wants to join the group \"%2$s\".\n"
3542
- "\n"
3543
- "Because you are the administrator of this group, you must either accept or reject the membership request.\n"
3544
- "\n"
3545
- "To view all pending membership requests for this group, please visit:\n"
3546
- "%3$s\n"
3547
- "\n"
3548
- "To view %4$s's profile: %5$s\n"
3549
- "\n"
3550
- "---------------------\n"
3551
- msgstr ""
3552
-
3553
- #: bp-groups/bp-groups-notifications.php:151
3554
- msgid "Membership request for group \"%s\" accepted"
3555
- msgstr ""
3556
-
3557
- #: bp-groups/bp-groups-notifications.php:152
3558
- msgid ""
3559
- "Your membership request for the group \"%1$s\" has been accepted.\n"
3560
- "\n"
3561
- "To view the group please login and visit: %2$s\n"
3562
- "\n"
3563
- "---------------------\n"
3564
- msgstr ""
3565
-
3566
- #: bp-groups/bp-groups-notifications.php:161
3567
- msgid "Membership request for group \"%s\" rejected"
3568
- msgstr ""
3569
-
3570
- #: bp-groups/bp-groups-notifications.php:162
3571
- msgid ""
3572
- "Your membership request for the group \"%1$s\" has been rejected.\n"
3573
- "\n"
3574
- "To submit another request please log in and visit: %2$s\n"
3575
- "\n"
3576
- "---------------------\n"
3577
- msgstr ""
3578
-
3579
- #: bp-groups/bp-groups-notifications.php:191
3580
- msgid "an administrator"
3581
- msgstr ""
3582
-
3583
- #: bp-groups/bp-groups-notifications.php:194
3584
- msgid "a moderator"
3585
- msgstr ""
3586
-
3587
- #: bp-groups/bp-groups-notifications.php:221
3588
- msgid "You have been promoted in the group: \"%s\""
3589
- msgstr ""
3590
-
3591
- #: bp-groups/bp-groups-notifications.php:222
3592
- msgid ""
3593
- "You have been promoted to %1$s for the group: \"%2$s\".\n"
3594
- "\n"
3595
- "To view the group please visit: %3$s\n"
3596
- "\n"
3597
- "---------------------\n"
3598
- msgstr ""
3599
-
3600
- #: bp-groups/bp-groups-notifications.php:279
3601
- msgid "You have an invitation to the group: \"%s\""
3602
- msgstr ""
3603
-
3604
- #: bp-groups/bp-groups-notifications.php:281
3605
- msgid ""
3606
- "One of your friends %1$s has invited you to the group: \"%2$s\".\n"
3607
- "\n"
3608
- "To view your group invites visit: %3$s\n"
3609
- "\n"
3610
- "To view the group visit: %4$s\n"
3611
- "\n"
3612
- "To view %5$s's profile visit: %6$s\n"
3613
- "\n"
3614
- "---------------------\n"
3615
- msgstr ""
3616
-
3617
- #: bp-groups/bp-groups-notifications.php:335
3618
- msgid "%1$d new membership requests for the group \"%2$s\""
3619
- msgstr ""
3620
-
3621
- #: bp-groups/bp-groups-notifications.php:340
3622
- msgid "Group Membership Requests"
3623
- msgstr ""
3624
-
3625
- #: bp-groups/bp-groups-notifications.php:349
3626
- #: bp-groups/bp-groups-notifications.php:354
3627
- msgid "%s requests group membership"
3628
- msgstr ""
3629
-
3630
- #: bp-groups/bp-groups-notifications.php:372
3631
- msgid "%d accepted group membership requests"
3632
- msgstr ""
3633
-
3634
- #: bp-groups/bp-groups-notifications.php:385
3635
- msgid "Membership for group \"%s\" accepted"
3636
- msgstr ""
3637
-
3638
- #: bp-groups/bp-groups-notifications.php:408
3639
- msgid "%d rejected group membership requests"
3640
- msgstr ""
3641
-
3642
- #: bp-groups/bp-groups-notifications.php:421
3643
- msgid "Membership for group \"%s\" rejected"
3644
- msgstr ""
3645
-
3646
- #: bp-groups/bp-groups-notifications.php:444
3647
- msgid "You were promoted to an admin in %d groups"
3648
- msgstr ""
3649
-
3650
- #: bp-groups/bp-groups-notifications.php:457
3651
- msgid "You were promoted to an admin in the group \"%s\""
3652
- msgstr ""
3653
-
3654
- #: bp-groups/bp-groups-notifications.php:480
3655
- msgid "You were promoted to a mod in %d groups"
3656
- msgstr ""
3657
-
3658
- #: bp-groups/bp-groups-notifications.php:493
3659
- msgid "You were promoted to a mod in the group \"%s\""
3660
- msgstr ""
3661
-
3662
- #: bp-groups/bp-groups-notifications.php:517
3663
- msgid "You have %d new group invitations"
3664
- msgstr ""
3665
-
3666
- #: bp-groups/bp-groups-notifications.php:521
3667
- msgid "Group Invites"
3668
- msgstr ""
3669
-
3670
- #: bp-groups/bp-groups-notifications.php:529
3671
- msgid "You have an invitation to the group: %s"
3672
- msgstr ""
3673
-
3674
- #: bp-groups/bp-groups-screens.php:44
3675
- msgid "Group invite could not be accepted"
3676
- msgstr ""
3677
-
3678
- #: bp-groups/bp-groups-screens.php:46 bp-groups/bp-groups-screens.php:506
3679
- msgid "Group invite accepted"
3680
- msgstr ""
3681
-
3682
- #: bp-groups/bp-groups-screens.php:71
3683
- msgid "Group invite could not be rejected"
3684
- msgstr ""
3685
-
3686
- #: bp-groups/bp-groups-screens.php:73
3687
- msgid "Group invite rejected"
3688
- msgstr ""
3689
-
3690
- #: bp-groups/bp-groups-screens.php:151
3691
- msgid "It looks like you've already said that!"
3692
- msgstr ""
3693
-
3694
- #: bp-groups/bp-groups-screens.php:154
3695
- msgid "There was an error when replying to that topic"
3696
- msgstr ""
3697
-
3698
- #: bp-groups/bp-groups-screens.php:156
3699
- msgid "Your reply was posted successfully"
3700
- msgstr ""
3701
-
3702
- #: bp-groups/bp-groups-screens.php:177
3703
- msgid "There was an error when making that topic a sticky"
3704
- msgstr ""
3705
-
3706
- #: bp-groups/bp-groups-screens.php:179
3707
- msgid "The topic was made sticky successfully"
3708
- msgstr ""
3709
-
3710
- #: bp-groups/bp-groups-screens.php:192
3711
- msgid "There was an error when unsticking that topic"
3712
- msgstr ""
3713
-
3714
- #: bp-groups/bp-groups-screens.php:194
3715
- msgid "The topic was unstuck successfully"
3716
- msgstr ""
3717
-
3718
- #: bp-groups/bp-groups-screens.php:207
3719
- msgid "There was an error when closing that topic"
3720
- msgstr ""
3721
-
3722
- #: bp-groups/bp-groups-screens.php:209
3723
- msgid "The topic was closed successfully"
3724
- msgstr ""
3725
-
3726
- #: bp-groups/bp-groups-screens.php:222
3727
- msgid "There was an error when opening that topic"
3728
- msgstr ""
3729
-
3730
- #: bp-groups/bp-groups-screens.php:224
3731
- msgid "The topic was opened successfully"
3732
- msgstr ""
3733
-
3734
- #: bp-groups/bp-groups-screens.php:247
3735
- msgid "There was an error deleting the topic"
3736
- msgstr ""
3737
-
3738
- #: bp-groups/bp-groups-screens.php:249
3739
- msgid "The topic was deleted successfully"
3740
- msgstr ""
3741
-
3742
- #: bp-groups/bp-groups-screens.php:273
3743
- msgid "There was an error when editing that topic"
3744
- msgstr ""
3745
-
3746
- #: bp-groups/bp-groups-screens.php:275
3747
- msgid "The topic was edited successfully"
3748
- msgstr ""
3749
-
3750
- #: bp-groups/bp-groups-screens.php:300
3751
- msgid "There was an error deleting that post"
3752
- msgstr ""
3753
-
3754
- #: bp-groups/bp-groups-screens.php:302
3755
- msgid "The post was deleted successfully"
3756
- msgstr ""
3757
-
3758
- #: bp-groups/bp-groups-screens.php:326
3759
- msgid "There was an error when editing that post"
3760
- msgstr ""
3761
-
3762
- #: bp-groups/bp-groups-screens.php:328
3763
- msgid "The post was edited successfully"
3764
- msgstr ""
3765
-
3766
- #: bp-groups/bp-groups-screens.php:344 bp-groups/bp-groups-screens.php:363
3767
- msgid "You have been banned from this group."
3768
- msgstr ""
3769
-
3770
- #: bp-groups/bp-groups-screens.php:377
3771
- msgid "This group does not have a forum setup yet."
3772
- msgstr ""
3773
-
3774
- #: bp-groups/bp-groups-screens.php:436
3775
- msgid "Group invites sent."
3776
- msgstr ""
3777
-
3778
- #: bp-groups/bp-groups-screens.php:477
3779
- msgid "You are not allowed to send or remove invites"
3780
- msgstr ""
3781
-
3782
- #: bp-groups/bp-groups-screens.php:480
3783
- msgid "The member requested to join the group"
3784
- msgstr ""
3785
-
3786
- #: bp-groups/bp-groups-screens.php:508
3787
- msgid "There was an error accepting the group invitation, please try again."
3788
- msgstr ""
3789
-
3790
- #: bp-groups/bp-groups-screens.php:520
3791
- msgid "There was an error sending your group membership request, please try again."
3792
- msgstr ""
3793
-
3794
- #: bp-groups/bp-groups-screens.php:522
3795
- msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request."
3796
- msgstr ""
3797
-
3798
- #: bp-groups/bp-groups-screens.php:571
3799
- msgid "There was an error updating group details, please try again."
3800
- msgstr ""
3801
-
3802
- #: bp-groups/bp-groups-screens.php:573
3803
- msgid "Group details were successfully updated."
3804
- msgstr ""
3805
-
3806
- #: bp-groups/bp-groups-screens.php:615
3807
- msgid "There was an error updating group settings, please try again."
3808
- msgstr ""
3809
-
3810
- #: bp-groups/bp-groups-screens.php:617
3811
- msgid "Group settings were successfully updated."
3812
- msgstr ""
3813
-
3814
- #: bp-groups/bp-groups-screens.php:649 bp-xprofile/bp-xprofile-actions.php:39
3815
- msgid "Your avatar was deleted successfully!"
3816
- msgstr ""
3817
-
3818
- #: bp-groups/bp-groups-screens.php:651 bp-members/bp-members-admin.php:506
3819
- #: bp-xprofile/bp-xprofile-actions.php:41
3820
- msgid "There was a problem deleting that avatar, please try again."
3821
- msgstr ""
3822
-
3823
- #: bp-groups/bp-groups-screens.php:694
3824
- msgid "There was a problem cropping the avatar."
3825
- msgstr ""
3826
-
3827
- #: bp-groups/bp-groups-screens.php:696
3828
- msgid "The new group avatar was uploaded successfully."
3829
- msgstr ""
3830
-
3831
- #: bp-groups/bp-groups-screens.php:732
3832
- msgid "There was an error when promoting that user, please try again"
3833
- msgstr ""
3834
-
3835
- #: bp-groups/bp-groups-screens.php:734
3836
- msgid "User promoted successfully"
3837
- msgstr ""
3838
-
3839
- #: bp-groups/bp-groups-screens.php:757
3840
- msgid "There was an error when demoting that user, please try again"
3841
- msgstr ""
3842
-
3843
- #: bp-groups/bp-groups-screens.php:759
3844
- msgid "User demoted successfully"
3845
- msgstr ""
3846
-
3847
- #: bp-groups/bp-groups-screens.php:775
3848
- msgid "There was an error when banning that user, please try again"
3849
- msgstr ""
3850
-
3851
- #: bp-groups/bp-groups-screens.php:777
3852
- msgid "User banned successfully"
3853
- msgstr ""
3854
-
3855
- #: bp-groups/bp-groups-screens.php:793
3856
- msgid "There was an error when unbanning that user, please try again"
3857
- msgstr ""
3858
-
3859
- #: bp-groups/bp-groups-screens.php:795
3860
- msgid "User ban removed successfully"
3861
- msgstr ""
3862
-
3863
- #: bp-groups/bp-groups-screens.php:811
3864
- msgid "There was an error removing that user from the group, please try again"
3865
- msgstr ""
3866
-
3867
- #: bp-groups/bp-groups-screens.php:813
3868
- msgid "User removed successfully"
3869
- msgstr ""
3870
-
3871
- #: bp-groups/bp-groups-screens.php:850
3872
- msgid "There was an error accepting the membership request, please try again."
3873
- msgstr ""
3874
-
3875
- #: bp-groups/bp-groups-screens.php:852
3876
- msgid "Group membership request accepted"
3877
- msgstr ""
3878
-
3879
- #: bp-groups/bp-groups-screens.php:861
3880
- msgid "There was an error rejecting the membership request, please try again."
3881
- msgstr ""
3882
-
3883
- #: bp-groups/bp-groups-screens.php:863
3884
- msgid "Group membership request rejected"
3885
- msgstr ""
3886
-
3887
- #: bp-groups/bp-groups-screens.php:895
3888
- msgid "There was an error deleting the group, please try again."
3889
- msgstr ""
3890
-
3891
- #: bp-groups/bp-groups-screens.php:897
3892
- msgid "The group was deleted successfully"
3893
- msgstr ""
3894
-
3895
- #: bp-groups/bp-groups-screens.php:945
3896
- msgid "A member invites you to join a group"
3897
- msgstr ""
3898
-
3899
- #: bp-groups/bp-groups-screens.php:951
3900
- msgid "Group information is updated"
3901
- msgstr ""
3902
-
3903
- #: bp-groups/bp-groups-screens.php:957
3904
- msgid "You are promoted to a group administrator or moderator"
3905
- msgstr ""
3906
-
3907
- #: bp-groups/bp-groups-screens.php:963
3908
- msgid "A member requests to join a private group for which you are an admin"
3909
- msgstr ""
3910
-
3911
- #: bp-groups/bp-groups-template.php:218
3912
- msgctxt "Group pagination previous text"
3913
- msgid "&larr;"
3914
- msgstr ""
3915
-
3916
- #: bp-groups/bp-groups-template.php:219
3917
- msgctxt "Group pagination next text"
3918
- msgid "&rarr;"
3919
- msgstr ""
3920
-
3921
- #: bp-groups/bp-groups-template.php:482
3922
- msgid "Public Group"
3923
- msgstr ""
3924
-
3925
- #: bp-groups/bp-groups-template.php:484
3926
- msgid "Hidden Group"
3927
- msgstr ""
3928
-
3929
- #: bp-groups/bp-groups-template.php:486
3930
- msgid "Private Group"
3931
- msgstr ""
3932
-
3933
- #: bp-groups/bp-groups-template.php:488
3934
- msgid "Group"
3935
- msgstr ""
3936
-
3937
- #: bp-groups/bp-groups-template.php:560
3938
- msgid "not yet active"
3939
- msgstr ""
3940
-
3941
- #: bp-groups/bp-groups-template.php:756
3942
- msgid "Group creator avatar of %s"
3943
- msgstr ""
3944
-
3945
- #: bp-groups/bp-groups-template.php:805
3946
- msgid "No Admins"
3947
- msgstr ""
3948
-
3949
- #: bp-groups/bp-groups-template.php:846
3950
- msgid "No Mods"
3951
- msgstr ""
3952
-
3953
- #: bp-groups/bp-groups-template.php:928
3954
- msgid "Filter Groups"
3955
- msgstr ""
3956
-
3957
- #: bp-groups/bp-groups-template.php:976
3958
- msgid "Viewing group %1$s to %2$s (of %3$s group)"
3959
- msgid_plural "Viewing group %1$s to %2$s (of %3$s groups)"
3960
- msgstr[0] ""
3961
- msgstr[1] ""
3962
-
3963
- #: bp-groups/bp-groups-template.php:1006
3964
- msgid "%s members"
3965
- msgstr ""
3966
-
3967
- #: bp-groups/bp-groups-template.php:1045
3968
- msgid "%d topic"
3969
- msgstr ""
3970
-
3971
- #: bp-groups/bp-groups-template.php:1047
3972
- msgid "%d topics"
3973
- msgstr ""
3974
-
3975
- #: bp-groups/bp-groups-template.php:1273 bp-groups/bp-groups-template.php:1338
3976
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:190
3977
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:217
3978
- #: bp-themes/bp-default/groups/single/admin.php:190
3979
- #: bp-themes/bp-default/groups/single/admin.php:217
3980
- msgid "Demote to Member"
3981
- msgstr ""
3982
-
3983
- #: bp-groups/bp-groups-template.php:1286 bp-groups/bp-groups-template.php:1351
3984
- #: bp-groups/bp-groups-template.php:2315
3985
- msgid "joined %s"
3986
- msgstr ""
3987
-
3988
- #: bp-groups/bp-groups-template.php:1309
3989
- msgid "This group has no administrators"
3990
- msgstr ""
3991
-
3992
- #: bp-groups/bp-groups-template.php:1337
3993
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:216
3994
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:272
3995
- #: bp-themes/bp-default/groups/single/admin.php:216
3996
- #: bp-themes/bp-default/groups/single/admin.php:272
3997
- msgid "Promote to Admin"
3998
- msgstr ""
3999
-
4000
- #: bp-groups/bp-groups-template.php:1371
4001
- msgid "This group has no moderators"
4002
- msgstr ""
4003
-
4004
- #: bp-groups/bp-groups-template.php:1796 bp-groups/bp-groups-template.php:1797
4005
- #: bp-templates/bp-legacy/buddypress-functions.php:1178
4006
- #: bp-templates/bp-legacy/buddypress-functions.php:1191
4007
- #: bp-themes/bp-default/_inc/ajax.php:744
4008
- #: bp-themes/bp-default/_inc/ajax.php:757
4009
- msgid "Leave Group"
4010
- msgstr ""
4011
-
4012
- #: bp-groups/bp-groups-template.php:1819 bp-groups/bp-groups-template.php:1820
4013
- #: bp-templates/bp-legacy/buddypress-functions.php:1212
4014
- #: bp-themes/bp-default/_inc/ajax.php:778
4015
- msgid "Join Group"
4016
- msgstr ""
4017
-
4018
- #: bp-groups/bp-groups-template.php:1838 bp-groups/bp-groups-template.php:1839
4019
- msgid "Accept Invitation"
4020
- msgstr ""
4021
-
4022
- #: bp-groups/bp-groups-template.php:1854 bp-groups/bp-groups-template.php:1855
4023
- msgid "Request Sent"
4024
- msgstr ""
4025
-
4026
- #: bp-groups/bp-groups-template.php:1938
4027
- msgid "This is a private group and you must request group membership in order to join."
4028
- msgstr ""
4029
-
4030
- #: bp-groups/bp-groups-template.php:1940
4031
- msgid "This is a private group. To join you must be a registered site member and request group membership."
4032
- msgstr ""
4033
-
4034
- #: bp-groups/bp-groups-template.php:1943
4035
- msgid "This is a private group. Your membership request is awaiting approval from the group administrator."
4036
- msgstr ""
4037
-
4038
- #: bp-groups/bp-groups-template.php:1947
4039
- msgid "This is a hidden group and only invited members can join."
4040
- msgstr ""
4041
-
4042
- #: bp-groups/bp-groups-template.php:2363 bp-members/bp-members-template.php:353
4043
- msgid "Viewing member %1$s to %2$s (of %3$s member)"
4044
- msgid_plural "Viewing members %1$s to %2$s (of %3$s members)"
4045
- msgstr[0] ""
4046
- msgstr[1] ""
4047
-
4048
- #: bp-groups/bp-groups-template.php:2415
4049
- #: bp-notifications/bp-notifications-template.php:940
4050
- #: bp-templates/bp-legacy/buddypress/blogs/index.php:36
4051
- #: bp-templates/bp-legacy/buddypress/forums/index.php:42
4052
- #: bp-templates/bp-legacy/buddypress/groups/index.php:36
4053
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:36
4054
- #: bp-templates/bp-legacy/buddypress/members/index.php:35
4055
- #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:19
4056
- #: bp-templates/bp-legacy/buddypress/members/single/forums.php:18
4057
- #: bp-templates/bp-legacy/buddypress/members/single/friends.php:20
4058
- #: bp-templates/bp-legacy/buddypress/members/single/groups.php:20
4059
- #: bp-themes/bp-default/blogs/index.php:53
4060
- #: bp-themes/bp-default/forums/index.php:60
4061
- #: bp-themes/bp-default/groups/index.php:55
4062
- #: bp-themes/bp-default/groups/single/forum.php:36
4063
- #: bp-themes/bp-default/members/index.php:55
4064
- #: bp-themes/bp-default/members/single/blogs.php:19
4065
- #: bp-themes/bp-default/members/single/forums.php:18
4066
- #: bp-themes/bp-default/members/single/friends.php:20
4067
- #: bp-themes/bp-default/members/single/groups.php:20
4068
- msgid "Order By:"
4069
- msgstr ""
4070
-
4071
- #: bp-groups/bp-groups-template.php:2418
4072
- msgid "Oldest"
4073
- msgstr ""
4074
-
4075
- #: bp-groups/bp-groups-template.php:2419
4076
- #: bp-templates/bp-legacy/buddypress/blogs/index.php:40
4077
- #: bp-templates/bp-legacy/buddypress/groups/index.php:42
4078
- #: bp-templates/bp-legacy/buddypress/members/index.php:41
4079
- #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:23
4080
- #: bp-templates/bp-legacy/buddypress/members/single/friends.php:24
4081
- #: bp-templates/bp-legacy/buddypress/members/single/groups.php:25
4082
- #: bp-themes/bp-default/blogs/index.php:57
4083
- #: bp-themes/bp-default/groups/index.php:60
4084
- #: bp-themes/bp-default/members/index.php:62
4085
- #: bp-themes/bp-default/members/single/blogs.php:23
4086
- #: bp-themes/bp-default/members/single/friends.php:24
4087
- #: bp-themes/bp-default/members/single/groups.php:25
4088
- msgid "Alphabetical"
4089
- msgstr ""
4090
-
4091
- #: bp-groups/bp-groups-template.php:2646 bp-groups/bp-groups-template.php:2896
4092
- msgid "Group avatar"
4093
- msgstr ""
4094
-
4095
- #: bp-groups/bp-groups-template.php:2789 bp-groups/bp-groups-template.php:2813
4096
- msgid "Recently Joined"
4097
- msgstr ""
4098
-
4099
- #: bp-groups/bp-groups-template.php:2790 bp-groups/bp-groups-template.php:2816
4100
- msgid "Most Popular"
4101
- msgstr ""
4102
-
4103
- #: bp-groups/bp-groups-template.php:2791 bp-groups/bp-groups-template.php:2819
4104
- msgid "Administrator Of"
4105
- msgstr ""
4106
-
4107
- #: bp-groups/bp-groups-template.php:2792 bp-groups/bp-groups-template.php:2822
4108
- msgid "Moderator Of"
4109
- msgstr ""
4110
-
4111
- #: bp-groups/bp-groups-template.php:3184
4112
- msgid "requested %s"
4113
- msgstr ""
4114
-
4115
- #: bp-groups/bp-groups-template.php:3236
4116
- msgid "Viewing requests %1$s to %2$s (of %3$s request)"
4117
- msgid_plural "Viewing request %1$s to %2$s (of %3$s requests)"
4118
- msgstr[0] ""
4119
- msgstr[1] ""
4120
-
4121
- #: bp-groups/bp-groups-template.php:3531
4122
- msgid "Viewing invitation %1$s to %2$s (of %3$s invitation)"
4123
- msgid_plural "Viewing invitation %1$s to %2$s (of %3$s invitations)"
4124
- msgstr[0] ""
4125
- msgstr[1] ""
4126
-
4127
- #: bp-groups/bp-groups-template.php:3547
4128
- msgid "Group Activity RSS Feed"
4129
- msgstr ""
4130
-
4131
- #: bp-groups/bp-groups-template.php:3718
4132
- msgid "%s group"
4133
- msgid_plural "%s groups"
4134
- msgstr[0] ""
4135
- msgstr[1] ""
4136
-
4137
- #: bp-groups/bp-groups-widgets.php:24
4138
- msgid "A dynamic list of recently active, popular, and newest groups"
4139
- msgstr ""
4140
-
4141
- #: bp-groups/bp-groups-widgets.php:27
4142
- msgctxt "widget name"
4143
- msgid "(BuddyPress) Groups"
4144
- msgstr ""
4145
-
4146
- #: bp-groups/bp-groups-widgets.php:83 bp-groups/bp-groups-widgets.php:195
4147
- msgid "created %s"
4148
- msgstr ""
4149
-
4150
- #: bp-groups/bp-groups-widgets.php:102
4151
- msgid "There are no groups to display."
4152
- msgstr ""
4153
-
4154
- #: bp-groups/bp-groups-widgets.php:139
4155
- msgid "Link widget title to Groups directory"
4156
- msgstr ""
4157
-
4158
- #: bp-groups/bp-groups-widgets.php:141
4159
- msgid "Max groups to show:"
4160
- msgstr ""
4161
-
4162
- #: bp-groups/bp-groups-widgets.php:144
4163
- msgid "Default groups to show:"
4164
- msgstr ""
4165
-
4166
- #: bp-groups/bp-groups-widgets.php:213
4167
- msgid "No groups matched the current filter."
4168
- msgstr ""
4169
-
4170
- #: bp-loader.php:166 bp-loader.php:173
4171
- msgid "Cheatin&#8217; huh?"
4172
- msgstr ""
4173
-
4174
- #: bp-loader.php:569
4175
- msgid "BuddyPress Default"
4176
- msgstr ""
4177
-
4178
- #: bp-members/admin/bp-members-classes.php:102
4179
- #: bp-members/admin/bp-members-classes.php:432
4180
- #: bp-members/bp-members-admin.php:856
4181
- msgctxt "signup users"
4182
- msgid "Pending <span class=\"count\">(%s)</span>"
4183
- msgstr ""
4184
-
4185
- #: bp-members/admin/bp-members-classes.php:129
4186
- #: bp-members/admin/bp-members-classes.php:277
4187
- #: bp-members/admin/bp-members-classes.php:447
4188
- #: bp-members/admin/bp-members-classes.php:588
4189
- #: bp-settings/bp-settings-loader.php:106
4190
- #: bp-settings/bp-settings-loader.php:179
4191
- #: bp-themes/bp-default/functions.php:645
4192
- msgid "Email"
4193
- msgstr ""
4194
-
4195
- #: bp-members/admin/bp-members-classes.php:130
4196
- #: bp-members/admin/bp-members-classes.php:448
4197
- msgid "Registered"
4198
- msgstr ""
4199
-
4200
- #: bp-members/admin/bp-members-classes.php:131
4201
- #: bp-members/admin/bp-members-classes.php:449
4202
- msgid "Last Sent"
4203
- msgstr ""
4204
-
4205
- #: bp-members/admin/bp-members-classes.php:132
4206
- #: bp-members/admin/bp-members-classes.php:450
4207
- msgid "# Times Emailed"
4208
- msgstr ""
4209
-
4210
- #: bp-members/admin/bp-members-classes.php:143
4211
- #: bp-members/admin/bp-members-classes.php:461
4212
- msgctxt "Pending signup action"
4213
- msgid "Activate"
4214
- msgstr ""
4215
-
4216
- #: bp-members/admin/bp-members-classes.php:144
4217
- #: bp-members/admin/bp-members-classes.php:462
4218
- msgctxt "Pending signup action"
4219
- msgid "Email"
4220
- msgstr ""
4221
-
4222
- #: bp-members/admin/bp-members-classes.php:164
4223
- #: bp-members/admin/bp-members-classes.php:481
4224
- msgid "No pending accounts found."
4225
- msgstr ""
4226
-
4227
- #: bp-members/admin/bp-members-classes.php:170
4228
- #: bp-members/admin/bp-members-classes.php:172
4229
- #: bp-members/admin/bp-members-classes.php:486
4230
- msgid "Edit settings"
4231
- msgstr ""
4232
-
4233
- #: bp-members/admin/bp-members-classes.php:175
4234
- #: bp-members/admin/bp-members-classes.php:489
4235
- msgid "Registration is disabled. %s"
4236
- msgstr ""
4237
-
4238
- #: bp-members/bp-members-actions.php:53 bp-members/bp-members-admin.php:483
4239
- msgid "User removed as spammer."
4240
- msgstr ""
4241
-
4242
- #: bp-members/bp-members-actions.php:86
4243
- msgid "%s has been deleted from the system."
4244
- msgstr ""
4245
-
4246
- #: bp-members/bp-members-actions.php:88
4247
- msgid "There was an error deleting %s from the system. Please try again."
4248
- msgstr ""
4249
-
4250
- #: bp-members/bp-members-admin.php:190 bp-members/bp-members-admin.php:191
4251
- #: bp-members/bp-members-adminbar.php:100
4252
- #: bp-xprofile/bp-xprofile-template.php:688
4253
- #: bp-xprofile/bp-xprofile-template.php:689
4254
- msgid "Edit Profile"
4255
- msgstr ""
4256
-
4257
- #: bp-members/bp-members-admin.php:199 bp-members/bp-members-admin.php:200
4258
- msgid "Manage Signups"
4259
- msgstr ""
4260
-
4261
- #: bp-members/bp-members-admin.php:331 bp-members/bp-members-admin.php:754
4262
- msgid "Extended Profile"
4263
- msgstr ""
4264
-
4265
- #: bp-members/bp-members-admin.php:352
4266
- msgid "No users were found"
4267
- msgstr ""
4268
-
4269
- #: bp-members/bp-members-admin.php:386
4270
- msgid "This is the admin view of a user&#39;s profile."
4271
- msgstr ""
4272
-
4273
- #: bp-members/bp-members-admin.php:387
4274
- msgid "In the main column, you can edit the fields of the user&#39;s extended profile."
4275
- msgstr ""
4276
-
4277
- #: bp-members/bp-members-admin.php:388
4278
- msgid "In the right-hand column, you can update the user&#39;s status, delete the user&#39;s avatar, and view recent statistics."
4279
- msgstr ""
4280
-
4281
- #: bp-members/bp-members-admin.php:394
4282
- msgid "<a href=\"http://codex.buddypress.org/buddypress-site-administration/managing-user-profiles/\">Managing Profiles</a>"
4283
- msgstr ""
4284
-
4285
- #: bp-members/bp-members-admin.php:399
4286
- msgctxt "members user-admin edit screen"
4287
- msgid "Status"
4288
- msgstr ""
4289
-
4290
- #: bp-members/bp-members-admin.php:477
4291
- msgid "Avatar was deleted successfully!"
4292
- msgstr ""
4293
-
4294
- #: bp-members/bp-members-admin.php:495
4295
- msgid "Profile updated."
4296
- msgstr ""
4297
-
4298
- #: bp-members/bp-members-admin.php:512
4299
- msgid "User could not be removed as spammer."
4300
- msgstr ""
4301
-
4302
- #: bp-members/bp-members-admin.php:518
4303
- msgid "User could not be marked as spammer."
4304
- msgstr ""
4305
-
4306
- #: bp-members/bp-members-admin.php:524
4307
- msgid "An error occured while trying to update the profile."
4308
- msgstr ""
4309
-
4310
- #: bp-members/bp-members-admin.php:530 bp-xprofile/bp-xprofile-screens.php:96
4311
- msgid "Please make sure you fill in all required fields in this profile field group before saving."
4312
- msgstr ""
4313
-
4314
- #: bp-members/bp-members-admin.php:536 bp-xprofile/bp-xprofile-screens.php:138
4315
- msgid "There was a problem updating some of your profile information, please try again."
4316
- msgstr ""
4317
-
4318
- #: bp-members/bp-members-admin.php:550
4319
- msgid "&larr; Back to Users"
4320
- msgstr ""
4321
-
4322
- #: bp-members/bp-members-admin.php:559
4323
- msgid "Edit User"
4324
- msgstr ""
4325
-
4326
- #: bp-members/bp-members-admin.php:561 bp-members/bp-members-admin.php:1294
4327
- msgctxt "user"
4328
- msgid "Add New"
4329
- msgstr ""
4330
-
4331
- #: bp-members/bp-members-admin.php:563 bp-members/bp-members-admin.php:1296
4332
- msgctxt "user"
4333
- msgid "Add Existing"
4334
- msgstr ""
4335
-
4336
- #: bp-members/bp-members-admin.php:598
4337
- msgid "No user found with this ID. <a href=\"%s\">Go back and try again</a>."
4338
- msgstr ""
4339
-
4340
- #: bp-members/bp-members-admin.php:625
4341
- msgid "User account has not yet been activated"
4342
- msgstr ""
4343
-
4344
- #: bp-members/bp-members-admin.php:643
4345
- msgid "Spammer"
4346
- msgstr ""
4347
-
4348
- #: bp-members/bp-members-admin.php:653
4349
- msgid "Registered on: <strong>%1$s</strong>"
4350
- msgstr ""
4351
-
4352
- #: bp-members/bp-members-admin.php:663
4353
- msgid "View Profile"
4354
- msgstr ""
4355
-
4356
- #: bp-members/bp-members-admin.php:664
4357
- msgid "Update Profile"
4358
- msgstr ""
4359
-
4360
- #: bp-members/bp-members-admin.php:684 bp-xprofile/bp-xprofile-admin.php:760
4361
- msgid "%s has been marked as a spammer. All BuddyPress data associated with the user has been removed"
4362
- msgstr ""
4363
-
4364
- #: bp-members/bp-members-admin.php:715
4365
- msgid "Last active: <strong>%1$s</strong>"
4366
- msgstr ""
4367
-
4368
- #: bp-members/bp-members-admin.php:917
4369
- msgctxt "Pending Accounts per page (screen options)"
4370
- msgid "Pending Accounts"
4371
- msgstr ""
4372
-
4373
- #: bp-members/bp-members-admin.php:923
4374
- msgid "This is the admininistration screen for pending accounts on your site."
4375
- msgstr ""
4376
-
4377
- #: bp-members/bp-members-admin.php:924
4378
- msgid "From the screen options, you can customize the displayed columns and the pagination of this screen."
4379
- msgstr ""
4380
-
4381
- #: bp-members/bp-members-admin.php:925
4382
- msgid "You can reorder the list of your pending accounts by clicking on the Username, Email or Registered column headers."
4383
- msgstr ""
4384
-
4385
- #: bp-members/bp-members-admin.php:926
4386
- msgid "Using the search form, you can find pending accounts more easily. The Username and Email fields will be included in the search."
4387
- msgstr ""
4388
-
4389
- #: bp-members/bp-members-admin.php:931
4390
- #: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:7
4391
- #: bp-themes/bp-default/members/single/notifications/notifications-loop.php:7
4392
- msgid "Actions"
4393
- msgstr ""
4394
-
4395
- #: bp-members/bp-members-admin.php:933
4396
- msgid "Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:"
4397
- msgstr ""
4398
-
4399
- #: bp-members/bp-members-admin.php:934
4400
- msgid "\"Email\" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day."
4401
- msgstr ""
4402
-
4403
- #: bp-members/bp-members-admin.php:935
4404
- msgid "\"Delete\" allows you to delete a pending account from your site. You will be asked to confirm this deletion."
4405
- msgstr ""
4406
-
4407
- #: bp-members/bp-members-admin.php:936
4408
- msgid "By clicking on a Username you will be able to activate a pending account from the confirmation screen."
4409
- msgstr ""
4410
-
4411
- #: bp-members/bp-members-admin.php:937
4412
- msgid "Bulk actions allow you to perform these 3 actions for the selected rows."
4413
- msgstr ""
4414
-
4415
- #: bp-members/bp-members-admin.php:1089
4416
- msgctxt "signup resent"
4417
- msgid "%s activation email successfully sent! "
4418
- msgid_plural "%s activation emails successfully sent! "
4419
- msgstr[0] ""
4420
- msgstr[1] ""
4421
-
4422
- #: bp-members/bp-members-admin.php:1100
4423
- msgctxt "signup notsent"
4424
- msgid "%s activation email was not sent."
4425
- msgid_plural "%s activation emails were not sent."
4426
- msgstr[0] ""
4427
- msgstr[1] ""
4428
-
4429
- #: bp-members/bp-members-admin.php:1123
4430
- msgctxt "signup resent"
4431
- msgid "%s account successfully activated! "
4432
- msgid_plural "%s accounts successfully activated! "
4433
- msgstr[0] ""
4434
- msgstr[1] ""
4435
-
4436
- #: bp-members/bp-members-admin.php:1134
4437
- msgctxt "signup notsent"
4438
- msgid "%s account was not activated."
4439
- msgid_plural "%s accounts were not activated."
4440
- msgstr[0] ""
4441
- msgstr[1] ""
4442
-
4443
- #: bp-members/bp-members-admin.php:1157
4444
- msgctxt "signup deleted"
4445
- msgid "%s sign-up successfully deleted!"
4446
- msgid_plural "%s sign-ups successfully deleted!"
4447
- msgstr[0] ""
4448
- msgstr[1] ""
4449
-
4450
- #: bp-members/bp-members-admin.php:1168
4451
- msgctxt "signup notdeleted"
4452
- msgid "%s sign-up was not deleted."
4453
- msgid_plural "%s sign-ups were not deleted."
4454
- msgstr[0] ""
4455
- msgstr[1] ""
4456
-
4457
- #: bp-members/bp-members-admin.php:1191
4458
- msgid "There was a problem sending the activation emails, please try again."
4459
- msgstr ""
4460
-
4461
- #: bp-members/bp-members-admin.php:1198
4462
- msgid "There was a problem activating accounts, please try again."
4463
- msgstr ""
4464
-
4465
- #: bp-members/bp-members-admin.php:1205
4466
- msgid "There was a problem deleting sign-ups, please try again."
4467
- msgstr ""
4468
-
4469
- #: bp-members/bp-members-admin.php:1292
4470
- msgid "Users"
4471
- msgstr ""
4472
-
4473
- #: bp-members/bp-members-admin.php:1311
4474
- msgid "Search Pending Accounts"
4475
- msgstr ""
4476
-
4477
- #: bp-members/bp-members-admin.php:1357
4478
- msgid "Delete Pending Accounts"
4479
- msgstr ""
4480
-
4481
- #: bp-members/bp-members-admin.php:1358
4482
- msgid "You are about to delete the following account:"
4483
- msgid_plural "You are about to delete the following accounts:"
4484
- msgstr[0] ""
4485
- msgstr[1] ""
4486
-
4487
- #: bp-members/bp-members-admin.php:1362
4488
- msgid "Activate Pending Accounts"
4489
- msgstr ""
4490
-
4491
- #: bp-members/bp-members-admin.php:1363
4492
- msgid "You are about to activate the following account:"
4493
- msgid_plural "You are about to activate the following accounts:"
4494
- msgstr[0] ""
4495
- msgstr[1] ""
4496
-
4497
- #: bp-members/bp-members-admin.php:1367
4498
- msgid "Resend Activation Emails"
4499
- msgstr ""
4500
-
4501
- #: bp-members/bp-members-admin.php:1368
4502
- msgid "You are about to resend an activation email to the following account:"
4503
- msgid_plural "You are about to resend activation emails to the following accounts:"
4504
- msgstr[0] ""
4505
- msgstr[1] ""
4506
-
4507
- #: bp-members/bp-members-admin.php:1407
4508
- msgid "Last notified: %s"
4509
- msgstr ""
4510
-
4511
- #: bp-members/bp-members-admin.php:1410
4512
- msgid "(less than 24 hours ago)"
4513
- msgstr ""
4514
-
4515
- #: bp-members/bp-members-admin.php:1424
4516
- msgid "Confirm"
4517
- msgstr ""
4518
-
4519
- #: bp-members/bp-members-adminbar.php:38
4520
- msgid "Edit My Profile"
4521
- msgstr ""
4522
-
4523
- #: bp-members/bp-members-adminbar.php:52
4524
- msgid "Log in"
4525
- msgstr ""
4526
-
4527
- #: bp-members/bp-members-adminbar.php:91
4528
- msgid "Edit Member"
4529
- msgstr ""
4530
-
4531
- #: bp-members/bp-members-adminbar.php:121
4532
- #: bp-members/bp-members-buddybar.php:105
4533
- msgid "User Capabilities"
4534
- msgstr ""
4535
-
4536
- #: bp-members/bp-members-adminbar.php:129
4537
- #: bp-settings/bp-settings-loader.php:131
4538
- #: bp-settings/bp-settings-loader.php:188
4539
- #: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:27
4540
- #: bp-themes/bp-default/members/single/settings/delete-account.php:50
4541
- #: bp-themes/bp-default/members/single/settings/delete-account.php:76
4542
- msgid "Delete Account"
4543
- msgstr ""
4544
-
4545
- #: bp-members/bp-members-buddybar.php:49
4546
- msgid "Blog Authors"
4547
- msgstr ""
4548
-
4549
- #: bp-members/bp-members-buddybar.php:99
4550
- msgid "Edit %s's Profile"
4551
- msgstr ""
4552
-
4553
- #: bp-members/bp-members-buddybar.php:103
4554
- msgid "Edit %s's Avatar"
4555
- msgstr ""
4556
-
4557
- #: bp-members/bp-members-buddybar.php:107
4558
- msgid "Delete %s's Account"
4559
- msgstr ""
4560
-
4561
- #: bp-members/bp-members-classes.php:308
4562
- msgid "<strong>ERROR</strong>: Couldn&#8217;t register you. Please contact the <a href=\"mailto:%s\">webmaster</a>."
4563
- msgstr ""
4564
-
4565
- #: bp-members/bp-members-classes.php:512 bp-members/bp-members-classes.php:577
4566
- #: bp-members/bp-members-classes.php:632
4567
- msgid "the sign-up has already been activated."
4568
- msgstr ""
4569
-
4570
- #: bp-members/bp-members-functions.php:944
4571
- msgid "User last_activity data is no longer stored in usermeta. Use bp_get_user_last_activity() instead."
4572
- msgstr ""
4573
-
4574
- #: bp-members/bp-members-functions.php:974
4575
- msgid "User last_activity data is no longer stored in usermeta. Use bp_update_user_last_activity() instead."
4576
- msgstr ""
4577
-
4578
- #: bp-members/bp-members-functions.php:1147
4579
- #: bp-members/bp-members-functions.php:1899
4580
- msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
4581
- msgstr ""
4582
-
4583
- #: bp-members/bp-members-functions.php:1332
4584
- msgid "Please check your email address."
4585
- msgstr ""
4586
-
4587
- #: bp-members/bp-members-functions.php:1335
4588
- #: bp-members/bp-members-functions.php:1338
4589
- msgid "Sorry, that email address is not allowed!"
4590
- msgstr ""
4591
-
4592
- #: bp-members/bp-members-functions.php:1341
4593
- msgid "Sorry, that email address is already used!"
4594
- msgstr ""
4595
-
4596
- #: bp-members/bp-members-functions.php:1372
4597
- msgid "Please enter a username"
4598
- msgstr ""
4599
-
4600
- #: bp-members/bp-members-functions.php:1378
4601
- msgid "That username is not allowed"
4602
- msgstr ""
4603
-
4604
- #: bp-members/bp-members-functions.php:1383
4605
- msgid "Usernames can contain only letters, numbers, ., -, and @"
4606
- msgstr ""
4607
-
4608
- #: bp-members/bp-members-functions.php:1388
4609
- msgid "Username must be at least 4 characters"
4610
- msgstr ""
4611
-
4612
- #: bp-members/bp-members-functions.php:1393
4613
- msgid "Sorry, usernames may not contain the character \"_\"!"
4614
- msgstr ""
4615
-
4616
- #: bp-members/bp-members-functions.php:1400
4617
- msgid "Sorry, usernames must have letters too!"
4618
- msgstr ""
4619
-
4620
- #: bp-members/bp-members-functions.php:1412
4621
- msgid "Sorry, that username already exists!"
4622
- msgstr ""
4623
-
4624
- #: bp-members/bp-members-functions.php:1531
4625
- msgid "Invalid activation key."
4626
- msgstr ""
4627
-
4628
- #: bp-members/bp-members-functions.php:1538
4629
- msgid "The user is already active."
4630
- msgstr ""
4631
-
4632
- #: bp-members/bp-members-functions.php:1540
4633
- msgid "The site is already active."
4634
- msgstr ""
4635
-
4636
- #: bp-members/bp-members-functions.php:1558
4637
- msgid "Invalid activation key"
4638
- msgstr ""
4639
-
4640
- #: bp-members/bp-members-functions.php:1573
4641
- msgid "Could not create user"
4642
- msgstr ""
4643
-
4644
- #: bp-members/bp-members-functions.php:1587
4645
- msgid "That username is already activated."
4646
- msgstr ""
4647
-
4648
- #: bp-members/bp-members-functions.php:1772
4649
- msgid "If you have not received an email yet, <a href=\"%s\">click here to resend it</a>."
4650
- msgstr ""
4651
-
4652
- #: bp-members/bp-members-functions.php:1774
4653
- msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
4654
- msgstr ""
4655
-
4656
- #: bp-members/bp-members-functions.php:1805
4657
- msgid "<strong>ERROR</strong>: Your account has already been activated."
4658
- msgstr ""
4659
-
4660
- #: bp-members/bp-members-functions.php:1807
4661
- msgid "Activation email resent! Please check your inbox or spam folder."
4662
- msgstr ""
4663
-
4664
- #: bp-members/bp-members-loader.php:76
4665
- msgctxt "component directory title"
4666
- msgid "Members"
4667
- msgstr ""
4668
-
4669
- #: bp-members/bp-members-loader.php:81
4670
- msgid "Search Members..."
4671
- msgstr ""
4672
-
4673
- #: bp-members/bp-members-loader.php:219
4674
- msgid "You"
4675
- msgstr ""
4676
-
4677
- #: bp-members/bp-members-screens.php:92
4678
- msgid "Please make sure you enter your password twice"
4679
- msgstr ""
4680
-
4681
- #: bp-members/bp-members-screens.php:96
4682
- msgid "The passwords you entered do not match."
4683
- msgstr ""
4684
-
4685
- #: bp-members/bp-members-screens.php:119
4686
- msgid "This is a required field"
4687
- msgstr ""
4688
-
4689
- #: bp-members/bp-members-screens.php:261
4690
- msgid "Your account is now active!"
4691
- msgstr ""
4692
-
4693
- #: bp-members/bp-members-screens.php:522
4694
- #: bp-themes/bp-default/registration/register.php:259
4695
- msgid "Check Your Email To Activate Your Account!"
4696
- msgstr ""
4697
-
4698
- #: bp-members/bp-members-screens.php:530
4699
- #: bp-themes/bp-default/registration/activate.php:11
4700
- msgid "Account Activated"
4701
- msgstr ""
4702
-
4703
- #: bp-members/bp-members-template.php:206
4704
- msgctxt "Member pagination previous text"
4705
- msgid "&larr;"
4706
- msgstr ""
4707
-
4708
- #: bp-members/bp-members-template.php:207
4709
- msgctxt "Member pagination next text"
4710
- msgid "&rarr;"
4711
- msgstr ""
4712
-
4713
- #: bp-members/bp-members-template.php:347
4714
- msgid "Viewing member %1$s to %2$s (of %3$s active member)"
4715
- msgid_plural "Viewing member %1$s to %2$s (of %3$s active members)"
4716
- msgstr[0] ""
4717
- msgstr[1] ""
4718
-
4719
- #: bp-members/bp-members-template.php:349
4720
- msgid "Viewing member %1$s to %2$s (of %3$s member with friends)"
4721
- msgid_plural "Viewing member %1$s to %2$s (of %3$s members with friends)"
4722
- msgstr[0] ""
4723
- msgstr[1] ""
4724
-
4725
- #: bp-members/bp-members-template.php:351
4726
- msgid "Viewing member %1$s to %2$s (of %3$s member online)"
4727
- msgid_plural "Viewing member %1$s to %2$s (of %3$s members online)"
4728
- msgstr[0] ""
4729
- msgstr[1] ""
4730
-
4731
- #: bp-members/bp-members-template.php:621
4732
- msgid "Never active"
4733
- msgstr ""
4734
-
4735
- #: bp-members/bp-members-template.php:644
4736
- msgctxt "member latest update in member directory"
4737
- msgid "- &quot;%s &quot;"
4738
- msgstr ""
4739
-
4740
- #: bp-members/bp-members-template.php:738
4741
- msgctxt "Records the timestamp that the user registered into the activy stream"
4742
- msgid "registered %s"
4743
- msgstr ""
4744
-
4745
- #: bp-members/bp-members-template.php:1207
4746
- msgid "Your Avatar"
4747
- msgstr ""
4748
-
4749
- #: bp-members/bp-members-template.php:1277
4750
- msgid "Activity RSS Feed"
4751
- msgstr ""
4752
-
4753
- #: bp-messages/bp-messages-actions.php:35
4754
- msgid "Your reply was sent successfully"
4755
- msgstr ""
4756
-
4757
- #: bp-messages/bp-messages-actions.php:37
4758
- msgid "There was a problem sending your reply, please try again"
4759
- msgstr ""
4760
-
4761
- #: bp-messages/bp-messages-actions.php:65
4762
- msgid "There was an error deleting that message."
4763
- msgstr ""
4764
-
4765
- #: bp-messages/bp-messages-actions.php:67
4766
- msgid "Message deleted."
4767
- msgstr ""
4768
-
4769
- #: bp-messages/bp-messages-actions.php:89
4770
- msgid "There was an error deleting messages."
4771
- msgstr ""
4772
-
4773
- #: bp-messages/bp-messages-actions.php:91
4774
- #: bp-templates/bp-legacy/buddypress-functions.php:1370
4775
- #: bp-themes/bp-default/_inc/ajax.php:927
4776
- msgid "Messages deleted."
4777
- msgstr ""
4778
-
4779
- #: bp-messages/bp-messages-classes.php:466
4780
- msgid "%s Recipients"
4781
- msgstr ""
4782
-
4783
- #: bp-messages/bp-messages-functions.php:53
4784
- msgid "Re: %s"
4785
- msgstr ""
4786
-
4787
- #: bp-messages/bp-messages-functions.php:61
4788
- msgid "No Subject"
4789
- msgstr ""
4790
-
4791
- #: bp-messages/bp-messages-loader.php:33
4792
- msgid "Private Messages"
4793
- msgstr ""
4794
-
4795
- #: bp-messages/bp-messages-loader.php:91
4796
- msgid "Search Messages..."
4797
- msgstr ""
4798
-
4799
- #: bp-messages/bp-messages-loader.php:109
4800
- msgid "Messages <span class=\"%s\">%s</span>"
4801
- msgstr ""
4802
-
4803
- #: bp-messages/bp-messages-loader.php:111
4804
- #: bp-messages/bp-messages-loader.php:202
4805
- #: bp-messages/bp-messages-screens.php:168
4806
- msgid "Messages"
4807
- msgstr ""
4808
-
4809
- #: bp-messages/bp-messages-loader.php:139
4810
- #: bp-messages/bp-messages-loader.php:203
4811
- #: bp-messages/bp-messages-notifications.php:117
4812
- msgid "Inbox"
4813
- msgstr ""
4814
-
4815
- #: bp-messages/bp-messages-loader.php:149
4816
- #: bp-messages/bp-messages-loader.php:226
4817
- msgid "Sent"
4818
- msgstr ""
4819
-
4820
- #: bp-messages/bp-messages-loader.php:159
4821
- #: bp-messages/bp-messages-loader.php:234
4822
- msgid "Compose"
4823
- msgstr ""
4824
-
4825
- #: bp-messages/bp-messages-loader.php:170
4826
- msgid "Notices"
4827
- msgstr ""
4828
-
4829
- #: bp-messages/bp-messages-loader.php:199
4830
- msgid "Messages <span class=\"count\">%s</span>"
4831
- msgstr ""
4832
-
4833
- #: bp-messages/bp-messages-loader.php:200
4834
- msgid "Inbox <span class=\"count\">%s</span>"
4835
- msgstr ""
4836
-
4837
- #: bp-messages/bp-messages-loader.php:243
4838
- msgid "All Member Notices"
4839
- msgstr ""
4840
-
4841
- #: bp-messages/bp-messages-loader.php:260
4842
- msgid "My Messages"
4843
- msgstr ""
4844
-
4845
- #: bp-messages/bp-messages-notifications.php:69
4846
- msgid "New message from %s"
4847
- msgstr ""
4848
-
4849
- #: bp-messages/bp-messages-notifications.php:71
4850
- msgid ""
4851
- "%1$s sent you a new message:\n"
4852
- "\n"
4853
- "Subject: %2$s\n"
4854
- "\n"
4855
- "\"%3$s\"\n"
4856
- "\n"
4857
- "To view and read your messages please log in and visit: %4$s\n"
4858
- "\n"
4859
- "---------------------\n"
4860
- msgstr ""
4861
-
4862
- #: bp-messages/bp-messages-notifications.php:120
4863
- msgid "You have %d new messages"
4864
- msgstr ""
4865
-
4866
- #: bp-messages/bp-messages-notifications.php:130
4867
- msgid "%s sent you a new private message"
4868
- msgstr ""
4869
-
4870
- #: bp-messages/bp-messages-notifications.php:132
4871
- msgid "You have %d new private messages"
4872
- msgstr ""
4873
-
4874
- #: bp-messages/bp-messages-screens.php:56
4875
- #: bp-messages/bp-messages-screens.php:78
4876
- msgid "There was an error sending that message, please try again"
4877
- msgstr ""
4878
-
4879
- #: bp-messages/bp-messages-screens.php:61
4880
- msgid "Notice sent successfully!"
4881
- msgstr ""
4882
-
4883
- #: bp-messages/bp-messages-screens.php:64
4884
- msgid "There was an error sending that notice, please try again"
4885
- msgstr ""
4886
-
4887
- #: bp-messages/bp-messages-screens.php:75
4888
- msgid "Message sent successfully!"
4889
- msgstr ""
4890
-
4891
- #: bp-messages/bp-messages-screens.php:104
4892
- msgid "Messages <span>%s</span>"
4893
- msgstr ""
4894
-
4895
- #: bp-messages/bp-messages-screens.php:125
4896
- msgid "There was a problem deactivating that notice."
4897
- msgstr ""
4898
-
4899
- #: bp-messages/bp-messages-screens.php:127
4900
- msgid "Notice deactivated."
4901
- msgstr ""
4902
-
4903
- #: bp-messages/bp-messages-screens.php:131
4904
- msgid "There was a problem activating that notice."
4905
- msgstr ""
4906
-
4907
- #: bp-messages/bp-messages-screens.php:133
4908
- msgid "Notice activated."
4909
- msgstr ""
4910
-
4911
- #: bp-messages/bp-messages-screens.php:137
4912
- msgid "There was a problem deleting that notice."
4913
- msgstr ""
4914
-
4915
- #: bp-messages/bp-messages-screens.php:139
4916
- msgid "Notice deleted."
4917
- msgstr ""
4918
-
4919
- #: bp-messages/bp-messages-screens.php:177
4920
- msgid "A member sends you a new message"
4921
- msgstr ""
4922
-
4923
- #: bp-messages/bp-messages-template.php:84
4924
- msgctxt "Message pagination previous text"
4925
- msgid "&larr;"
4926
- msgstr ""
4927
-
4928
- #: bp-messages/bp-messages-template.php:85
4929
- msgctxt "Message pagination next text"
4930
- msgid "&rarr;"
4931
- msgstr ""
4932
-
4933
- #: bp-messages/bp-messages-template.php:456
4934
- msgid "Viewing message %1$s to %2$s (of %3$s message)"
4935
- msgid_plural "Viewing message %1$s to %2$s (of %3$s messages)"
4936
- msgstr[0] ""
4937
- msgstr[1] ""
4938
-
4939
- #: bp-messages/bp-messages-template.php:532
4940
- msgid "Select:"
4941
- msgstr ""
4942
-
4943
- #: bp-messages/bp-messages-template.php:536
4944
- #: bp-notifications/bp-notifications-loader.php:151
4945
- #: bp-notifications/bp-notifications-loader.php:212
4946
- #: bp-notifications/bp-notifications-template.php:733
4947
- msgid "Read"
4948
- msgstr ""
4949
-
4950
- #: bp-messages/bp-messages-template.php:537
4951
- #: bp-notifications/bp-notifications-loader.php:140
4952
- #: bp-notifications/bp-notifications-loader.php:189
4953
- #: bp-notifications/bp-notifications-template.php:763
4954
- msgid "Unread"
4955
- msgstr ""
4956
-
4957
- #: bp-messages/bp-messages-template.php:543
4958
- msgid "Mark as Read"
4959
- msgstr ""
4960
-
4961
- #: bp-messages/bp-messages-template.php:544
4962
- msgid "Mark as Unread"
4963
- msgstr ""
4964
-
4965
- #: bp-messages/bp-messages-template.php:548
4966
- msgid "Delete Selected"
4967
- msgstr ""
4968
-
4969
- #: bp-messages/bp-messages-template.php:593
4970
- msgid "Currently Active"
4971
- msgstr ""
4972
-
4973
- #: bp-messages/bp-messages-template.php:660
4974
- msgid "Deactivate"
4975
- msgstr ""
4976
-
4977
- #: bp-messages/bp-messages-template.php:709
4978
- #: bp-templates/bp-legacy/buddypress/members/register.php:89
4979
- #: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:43
4980
- #: bp-templates/bp-legacy/buddypress-functions.php:237
4981
- #: bp-themes/bp-default/functions.php:165
4982
- #: bp-themes/bp-default/members/single/profile/edit.php:130
4983
- #: bp-themes/bp-default/registration/register.php:173
4984
- #: bp-xprofile/bp-xprofile-admin.php:736
4985
- msgid "Close"
4986
- msgstr ""
4987
-
4988
- #: bp-messages/bp-messages-template.php:754
4989
- msgid "Send a private message to this user."
4990
- msgstr ""
4991
-
4992
- #: bp-messages/bp-messages-template.php:755
4993
- msgid "Private Message"
4994
- msgstr ""
4995
-
4996
- #: bp-messages/bp-messages-template.php:938
4997
- msgid "%d Recipients"
4998
- msgstr ""
4999
-
5000
- #: bp-messages/bp-messages-template.php:1047
5001
- #: bp-templates/bp-legacy/buddypress-functions.php:1279
5002
- #: bp-themes/bp-default/_inc/ajax.php:833
5003
- msgid "Sent %s"
5004
- msgstr ""
5005
-
5006
- #: bp-messages/bp-messages-widgets.php:34
5007
- msgid "(BuddyPress) Sitewide Notices"
5008
- msgstr ""
5009
-
5010
- #: bp-messages/bp-messages-widgets.php:37
5011
- msgid "Display Sitewide Notices posted by the site administrator"
5012
- msgstr ""
5013
-
5014
- #: bp-notifications/bp-notifications-actions.php:43
5015
- msgid "Notification successfully marked read."
5016
- msgstr ""
5017
-
5018
- #: bp-notifications/bp-notifications-actions.php:45
5019
- #: bp-notifications/bp-notifications-actions.php:81
5020
- msgid "There was a problem marking that notification."
5021
- msgstr ""
5022
-
5023
- #: bp-notifications/bp-notifications-actions.php:79
5024
- msgid "Notification successfully marked unread."
5025
- msgstr ""
5026
-
5027
- #: bp-notifications/bp-notifications-actions.php:115
5028
- msgid "Notification successfully deleted."
5029
- msgstr ""
5030
-
5031
- #: bp-notifications/bp-notifications-actions.php:117
5032
- msgid "There was a problem deleting that notification."
5033
- msgstr ""
5034
-
5035
- #: bp-notifications/bp-notifications-adminbar.php:54
5036
- msgid "No new notifications"
5037
- msgstr ""
5038
-
5039
- #: bp-notifications/bp-notifications-buddybar.php:49
5040
- msgid "No new notifications."
5041
- msgstr ""
5042
-
5043
- #: bp-notifications/bp-notifications-loader.php:86
5044
- msgid "Search Notifications..."
5045
- msgstr ""
5046
-
5047
- #: bp-notifications/bp-notifications-loader.php:111
5048
- msgid "Notifications <span class=\"%s\">%s</span>"
5049
- msgstr ""
5050
-
5051
- #: bp-notifications/bp-notifications-loader.php:185
5052
- msgid "Notifications <span class=\"count\">%s</span>"
5053
- msgstr ""
5054
-
5055
- #: bp-notifications/bp-notifications-loader.php:186
5056
- msgid "Unread <span class=\"count\">%s</span>"
5057
- msgstr ""
5058
-
5059
- #: bp-notifications/bp-notifications-template.php:327
5060
- msgctxt "Notifications pagination previous text"
5061
- msgid "&larr;"
5062
- msgstr ""
5063
-
5064
- #: bp-notifications/bp-notifications-template.php:328
5065
- msgctxt "Notifications pagination next text"
5066
- msgid "&rarr;"
5067
- msgstr ""
5068
-
5069
- #: bp-notifications/bp-notifications-template.php:664
5070
- msgid "Date not found"
5071
- msgstr ""
5072
-
5073
- #: bp-notifications/bp-notifications-template.php:895
5074
- msgid "Viewing %1$s to %2$s (of %3$s notification)"
5075
- msgid_plural "Viewing %1$s to %2$s (of %3$s notifications)"
5076
- msgstr[0] ""
5077
- msgstr[1] ""
5078
-
5079
- #: bp-notifications/bp-notifications-template.php:943
5080
- msgid "Newest First"
5081
- msgstr ""
5082
-
5083
- #: bp-notifications/bp-notifications-template.php:944
5084
- msgid "Oldest First"
5085
- msgstr ""
5086
-
5087
- #: bp-notifications/bp-notifications-template.php:948
5088
- msgid "Go"
5089
- msgstr ""
5090
-
5091
- #: bp-settings/bp-settings-actions.php:159
5092
- msgid "That email address is invalid. Check the formatting and try again."
5093
- msgstr ""
5094
-
5095
- #: bp-settings/bp-settings-actions.php:162
5096
- msgid "That email address is currently unavailable for use."
5097
- msgstr ""
5098
-
5099
- #: bp-settings/bp-settings-actions.php:165
5100
- msgid "That email address is already taken."
5101
- msgstr ""
5102
-
5103
- #: bp-settings/bp-settings-actions.php:168
5104
- msgid "Email address cannot be empty."
5105
- msgstr ""
5106
-
5107
- #: bp-settings/bp-settings-actions.php:178
5108
- msgid "Your current password is invalid."
5109
- msgstr ""
5110
-
5111
- #: bp-settings/bp-settings-actions.php:181
5112
- msgid "The new password fields did not match."
5113
- msgstr ""
5114
-
5115
- #: bp-settings/bp-settings-actions.php:184
5116
- msgid "One of the password fields was empty."
5117
- msgstr ""
5118
-
5119
- #: bp-settings/bp-settings-actions.php:193
5120
- msgid "Your settings have been saved."
5121
- msgstr ""
5122
-
5123
- #: bp-settings/bp-settings-actions.php:199
5124
- msgid "No changes were made to your account."
5125
- msgstr ""
5126
-
5127
- #: bp-settings/bp-settings-actions.php:201
5128
- msgid "No changes were made to this account."
5129
- msgstr ""
5130
-
5131
- #: bp-settings/bp-settings-actions.php:249
5132
- msgid "Your notification settings have been saved."
5133
- msgstr ""
5134
-
5135
- #: bp-settings/bp-settings-actions.php:251
5136
- msgid "This user's notification settings have been saved."
5137
- msgstr ""
5138
-
5139
- #: bp-settings/bp-settings-actions.php:346
5140
- msgid "%s was successfully deleted."
5141
- msgstr ""
5142
-
5143
- #: bp-settings/bp-settings-loader.php:94 bp-settings/bp-settings-loader.php:171
5144
- msgid "General"
5145
- msgstr ""
5146
-
5147
- #: bp-settings/bp-settings-loader.php:118
5148
- #: bp-themes/bp-default/members/single/settings/capabilities.php:49
5149
- msgid "Capabilities"
5150
- msgstr ""
5151
-
5152
- #: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:28
5153
- #: bp-themes/bp-default/activity/activity-loop.php:41
5154
- msgid "Load More"
5155
- msgstr ""
5156
-
5157
- #: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:42
5158
- #: bp-themes/bp-default/activity/activity-loop.php:55
5159
- msgid "Sorry, there was no activity found. Please try a different filter."
5160
- msgstr ""
5161
-
5162
- #. translators: 1: user profile link, 2: user name, 3: activity permalink, 4:
5163
- #. activity timestamp
5164
-
5165
- #: bp-templates/bp-legacy/buddypress/activity/comment.php:27
5166
- #: bp-themes/bp-default/activity/comment.php:30
5167
- 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>"
5168
- msgstr ""
5169
-
5170
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:50
5171
- msgid "View Conversation"
5172
- msgstr ""
5173
-
5174
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:58
5175
- #: bp-themes/bp-default/activity/entry.php:60
5176
- msgid "Comment <span>%s</span>"
5177
- msgstr ""
5178
-
5179
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:66
5180
- #: bp-themes/bp-default/activity/entry.php:68
5181
- msgid "Mark as Favorite"
5182
- msgstr ""
5183
-
5184
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:66
5185
- #: bp-templates/bp-legacy/buddypress-functions.php:240
5186
- #: bp-templates/bp-legacy/buddypress-functions.php:925
5187
- #: bp-templates/bp-legacy/buddypress-functions.php:942
5188
- #: bp-themes/bp-default/_inc/ajax.php:494
5189
- #: bp-themes/bp-default/_inc/ajax.php:511
5190
- #: bp-themes/bp-default/activity/entry.php:68
5191
- #: bp-themes/bp-default/functions.php:167
5192
- msgid "Favorite"
5193
- msgstr ""
5194
-
5195
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:70
5196
- #: bp-templates/bp-legacy/buddypress-functions.php:243
5197
- #: bp-templates/bp-legacy/buddypress-functions.php:923
5198
- #: bp-templates/bp-legacy/buddypress-functions.php:944
5199
- #: bp-themes/bp-default/_inc/ajax.php:492
5200
- #: bp-themes/bp-default/_inc/ajax.php:513
5201
- #: bp-themes/bp-default/activity/entry.php:72
5202
- #: bp-themes/bp-default/functions.php:168
5203
- msgid "Remove Favorite"
5204
- msgstr ""
5205
-
5206
- #: bp-templates/bp-legacy/buddypress/activity/entry.php:102
5207
- #: bp-themes/bp-default/activity/entry.php:104
5208
- msgid "Post"
5209
- msgstr ""
5210
-
5211
- #: bp-templates/bp-legacy/buddypress/activity/index.php:19
5212
- #: bp-themes/bp-default/activity/index.php:39
5213
- msgid "The public activity for everyone on this site."
5214
- msgstr ""
5215
-
5216
- #: bp-templates/bp-legacy/buddypress/activity/index.php:19
5217
- #: bp-templates/bp-legacy/buddypress/members/index.php:19
5218
- #: bp-themes/bp-default/activity/index.php:39
5219
- #: bp-themes/bp-default/members/index.php:35
5220
- msgid "All Members <span>%s</span>"
5221
- msgstr ""
5222
-
5223
- #: bp-templates/bp-legacy/buddypress/activity/index.php:29
5224
- #: bp-themes/bp-default/activity/index.php:49
5225
- msgid "The activity of my friends only."
5226
- msgstr ""
5227
-
5228
- #: bp-templates/bp-legacy/buddypress/activity/index.php:29
5229
- #: bp-templates/bp-legacy/buddypress/members/index.php:22
5230
- #: bp-themes/bp-default/activity/index.php:49
5231
- #: bp-themes/bp-default/members/index.php:39
5232
- msgid "My Friends <span>%s</span>"
5233
- msgstr ""
5234
-
5235
- #: bp-templates/bp-legacy/buddypress/activity/index.php:41
5236
- #: bp-themes/bp-default/activity/index.php:61
5237
- msgid "The activity of groups I am a member of."
5238
- msgstr ""
5239
-
5240
- #: bp-templates/bp-legacy/buddypress/activity/index.php:41
5241
- #: bp-templates/bp-legacy/buddypress/groups/index.php:22
5242
- #: bp-themes/bp-default/activity/index.php:61
5243
- #: bp-themes/bp-default/groups/index.php:39
5244
- msgid "My Groups <span>%s</span>"
5245
- msgstr ""
5246
-
5247
- #: bp-templates/bp-legacy/buddypress/activity/index.php:51
5248
- #: bp-themes/bp-default/activity/index.php:71
5249
- msgid "The activity I've marked as a favorite."
5250
- msgstr ""
5251
-
5252
- #: bp-templates/bp-legacy/buddypress/activity/index.php:51
5253
- #: bp-themes/bp-default/activity/index.php:71
5254
- msgid "My Favorites <span>%s</span>"
5255
- msgstr ""
5256
-
5257
- #: bp-templates/bp-legacy/buddypress/activity/index.php:59
5258
- #: bp-themes/bp-default/activity/index.php:79
5259
- msgid "Activity that I have been mentioned in."
5260
- msgstr ""
5261
-
5262
- #: bp-templates/bp-legacy/buddypress/activity/index.php:59
5263
- #: bp-themes/bp-default/activity/index.php:79
5264
- msgctxt "Number of new activity mentions"
5265
- msgid "%s new"
5266
- msgid_plural "%s new"
5267
- msgstr[0] ""
5268
- msgstr[1] ""
5269
-
5270
- #: bp-templates/bp-legacy/buddypress/activity/index.php:71
5271
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3
5272
- #: bp-themes/bp-default/activity/index.php:91
5273
- #: bp-themes/bp-default/groups/single/activity.php:3
5274
- msgid "RSS Feed"
5275
- msgstr ""
5276
-
5277
- #: bp-templates/bp-legacy/buddypress/activity/index.php:71
5278
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3
5279
- #: bp-themes/bp-default/activity/index.php:91
5280
- #: bp-themes/bp-default/groups/single/activity.php:3
5281
- msgid "RSS"
5282
- msgstr ""
5283
-
5284
- #: bp-templates/bp-legacy/buddypress/activity/index.php:76
5285
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:8
5286
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:18
5287
- #: bp-themes/bp-default/activity/index.php:96
5288
- #: bp-themes/bp-default/groups/single/activity.php:8
5289
- #: bp-themes/bp-default/members/single/activity.php:18
5290
- msgid "Show:"
5291
- msgstr ""
5292
-
5293
- #: bp-templates/bp-legacy/buddypress/activity/index.php:78
5294
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:10
5295
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:20
5296
- #: bp-themes/bp-default/activity/index.php:98
5297
- #: bp-themes/bp-default/groups/single/activity.php:10
5298
- #: bp-themes/bp-default/members/single/activity.php:20
5299
- msgid "Everything"
5300
- msgstr ""
5301
-
5302
- #: bp-templates/bp-legacy/buddypress/activity/index.php:79
5303
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:11
5304
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:21
5305
- #: bp-themes/bp-default/activity/index.php:99
5306
- #: bp-themes/bp-default/groups/single/activity.php:11
5307
- #: bp-themes/bp-default/members/single/activity.php:21
5308
- msgid "Updates"
5309
- msgstr ""
5310
-
5311
- #: bp-templates/bp-legacy/buddypress/activity/index.php:84
5312
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:28
5313
- #: bp-themes/bp-default/activity/index.php:104
5314
- #: bp-themes/bp-default/members/single/activity.php:28
5315
- msgid "Comments"
5316
- msgstr ""
5317
-
5318
- #: bp-templates/bp-legacy/buddypress/activity/index.php:90
5319
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:14
5320
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:43
5321
- #: bp-themes/bp-default/activity/index.php:110
5322
- #: bp-themes/bp-default/groups/single/activity.php:14
5323
- #: bp-themes/bp-default/members/single/activity.php:43
5324
- msgid "Forum Topics"
5325
- msgstr ""
5326
-
5327
- #: bp-templates/bp-legacy/buddypress/activity/index.php:91
5328
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:15
5329
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:44
5330
- #: bp-themes/bp-default/activity/index.php:111
5331
- #: bp-themes/bp-default/groups/single/activity.php:15
5332
- #: bp-themes/bp-default/members/single/activity.php:44
5333
- msgid "Forum Replies"
5334
- msgstr ""
5335
-
5336
- #: bp-templates/bp-legacy/buddypress/activity/index.php:97
5337
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:50
5338
- #: bp-themes/bp-default/activity/index.php:117
5339
- #: bp-themes/bp-default/members/single/activity.php:50
5340
- msgid "New Groups"
5341
- msgstr ""
5342
-
5343
- #: bp-templates/bp-legacy/buddypress/activity/index.php:98
5344
- #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:18
5345
- #: bp-templates/bp-legacy/buddypress/members/single/activity.php:51
5346
- #: bp-themes/bp-default/activity/index.php:118
5347
- #: bp-themes/bp-default/groups/single/activity.php:18
5348
- #: bp-themes/bp-default/members/single/activity.php:51
5349
- msgid "Group Memberships"
5350
- msgstr ""
5351
-
5352
- #: bp-templates/bp-legacy/buddypress/activity/index.php:108
5353
- #: bp-themes/bp-default/activity/index.php:128
5354
- msgid "New Members"
5355
- msgstr ""
5356
-
5357
- #: bp-templates/bp-legacy/buddypress/activity/post-form.php:23
5358
- #: bp-themes/bp-default/activity/post-form.php:23
5359
- msgid "What's new in %s, %s?"
5360
- msgstr ""
5361
-
5362
- #: bp-templates/bp-legacy/buddypress/activity/post-form.php:25
5363
- #: bp-themes/bp-default/activity/post-form.php:25
5364
- msgid "What's new, %s?"
5365
- msgstr ""
5366
-
5367
- #: bp-templates/bp-legacy/buddypress/activity/post-form.php:35
5368
- #: bp-themes/bp-default/activity/post-form.php:35
5369
- msgid "Post Update"
5370
- msgstr ""
5371
-
5372
- #: bp-templates/bp-legacy/buddypress/activity/post-form.php:42
5373
- #: bp-themes/bp-default/activity/post-form.php:42
5374
- msgid "Post in"
5375
- msgstr ""
5376
-
5377
- #: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:90
5378
- #: bp-themes/bp-default/blogs/blogs-loop.php:90
5379
- msgid "Sorry, there were no sites found."
5380
- msgstr ""
5381
-
5382
- #: bp-templates/bp-legacy/buddypress/blogs/create.php:14
5383
- #: bp-themes/bp-default/blogs/create.php:32
5384
- msgid "Site registration is currently disabled"
5385
- msgstr ""
5386
-
5387
- #: bp-templates/bp-legacy/buddypress/blogs/index.php:16
5388
- #: bp-themes/bp-default/blogs/index.php:33
5389
- msgid "All Sites <span>%s</span>"
5390
- msgstr ""
5391
-
5392
- #: bp-templates/bp-legacy/buddypress/blogs/index.php:20
5393
- #: bp-themes/bp-default/blogs/index.php:37
5394
- msgid "My Sites <span>%s</span>"
5395
- msgstr ""
5396
-
5397
- #: bp-templates/bp-legacy/buddypress/blogs/index.php:38
5398
- #: bp-templates/bp-legacy/buddypress/forums/index.php:44
5399
- #: bp-templates/bp-legacy/buddypress/groups/index.php:39
5400
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:38
5401
- #: bp-templates/bp-legacy/buddypress/members/index.php:37
5402
- #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:21
5403
- #: bp-templates/bp-legacy/buddypress/members/single/forums.php:20
5404
- #: bp-templates/bp-legacy/buddypress/members/single/friends.php:22
5405
- #: bp-templates/bp-legacy/buddypress/members/single/groups.php:22
5406
- #: bp-themes/bp-default/blogs/index.php:55
5407
- #: bp-themes/bp-default/forums/index.php:62
5408
- #: bp-themes/bp-default/groups/index.php:57
5409
- #: bp-themes/bp-default/groups/single/forum.php:38
5410
- #: bp-themes/bp-default/members/index.php:57
5411
- #: bp-themes/bp-default/members/single/blogs.php:21
5412
- #: bp-themes/bp-default/members/single/forums.php:20
5413
- #: bp-themes/bp-default/members/single/friends.php:22
5414
- #: bp-themes/bp-default/members/single/groups.php:22
5415
- msgid "Last Active"
5416
- msgstr ""
5417
-
5418
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:39
5419
- #: bp-themes/bp-default/forums/forums-loop.php:39
5420
- msgid "Topic"
5421
- msgstr ""
5422
-
5423
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:41
5424
- #: bp-themes/bp-default/forums/forums-loop.php:41
5425
- msgid "Freshness"
5426
- msgstr ""
5427
-
5428
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:54
5429
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:95
5430
- #: bp-themes/bp-default/forums/forums-loop.php:54
5431
- #: bp-themes/bp-default/groups/single/forum/topic.php:95
5432
- msgid "Permanent link to this post"
5433
- msgstr ""
5434
-
5435
- #. translators: "started by [poster] in [forum]"
5436
-
5437
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:61
5438
- #: bp-themes/bp-default/forums/forums-loop.php:61
5439
- msgid "Started by %1$s"
5440
- msgstr ""
5441
-
5442
- #. translators: "started by [poster] in [forum]"
5443
-
5444
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:72
5445
- #: bp-themes/bp-default/forums/forums-loop.php:72
5446
- msgid "in %1$s"
5447
- msgstr ""
5448
-
5449
- #: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:122
5450
- #: bp-themes/bp-default/forums/forums-loop.php:122
5451
- msgid "Sorry, there were no forum topics found."
5452
- msgstr ""
5453
-
5454
- #: bp-templates/bp-legacy/buddypress/forums/index.php:22
5455
- #: bp-themes/bp-default/forums/index.php:40
5456
- msgid "All Topics <span>%s</span>"
5457
- msgstr ""
5458
-
5459
- #: bp-templates/bp-legacy/buddypress/forums/index.php:26
5460
- #: bp-themes/bp-default/forums/index.php:44
5461
- msgid "My Topics <span>%s</span>"
5462
- msgstr ""
5463
-
5464
- #: bp-templates/bp-legacy/buddypress/forums/index.php:45
5465
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:39
5466
- #: bp-templates/bp-legacy/buddypress/members/single/forums.php:21
5467
- #: bp-themes/bp-default/forums/index.php:63
5468
- #: bp-themes/bp-default/groups/single/forum.php:39
5469
- #: bp-themes/bp-default/members/single/forums.php:21
5470
- msgid "Most Posts"
5471
- msgstr ""
5472
-
5473
- #: bp-templates/bp-legacy/buddypress/forums/index.php:46
5474
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:40
5475
- #: bp-templates/bp-legacy/buddypress/members/single/forums.php:22
5476
- #: bp-themes/bp-default/forums/index.php:64
5477
- #: bp-themes/bp-default/groups/single/forum.php:40
5478
- #: bp-themes/bp-default/members/single/forums.php:22
5479
- msgid "Unreplied"
5480
- msgstr ""
5481
-
5482
- #: bp-templates/bp-legacy/buddypress/forums/index.php:82
5483
- #: bp-themes/bp-default/forums/index.php:100
5484
- msgid "Create New Topic:"
5485
- msgstr ""
5486
-
5487
- #: bp-templates/bp-legacy/buddypress/forums/index.php:89
5488
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:50
5489
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:78
5490
- #: bp-themes/bp-default/forums/index.php:107
5491
- #: bp-themes/bp-default/groups/single/forum/edit.php:50
5492
- #: bp-themes/bp-default/groups/single/forum.php:78
5493
- msgid "Content:"
5494
- msgstr ""
5495
-
5496
- #: bp-templates/bp-legacy/buddypress/forums/index.php:92
5497
- #: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:53
5498
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:81
5499
- #: bp-themes/bp-default/forums/index.php:110
5500
- #: bp-themes/bp-default/groups/single/forum/edit.php:53
5501
- #: bp-themes/bp-default/groups/single/forum.php:81
5502
- msgid "Tags (comma separated):"
5503
- msgstr ""
5504
-
5505
- #: bp-templates/bp-legacy/buddypress/forums/index.php:95
5506
- #: bp-themes/bp-default/forums/index.php:113
5507
- msgid "Post In Group Forum:"
5508
- msgstr ""
5509
-
5510
- #. translators: no option picked in select box
5511
-
5512
- #: bp-templates/bp-legacy/buddypress/forums/index.php:98
5513
- #: bp-themes/bp-default/forums/index.php:116
5514
- #: bp-xprofile/bp-xprofile-classes.php:1593
5515
- #: bp-xprofile/bp-xprofile-classes.php:1618
5516
- #: bp-xprofile/bp-xprofile-classes.php:1626
5517
- #: bp-xprofile/bp-xprofile-classes.php:2190
5518
- msgid "----"
5519
- msgstr ""
5520
-
5521
- #: bp-templates/bp-legacy/buddypress/forums/index.php:115
5522
- #: bp-templates/bp-legacy/buddypress/groups/single/forum.php:87
5523
- #: bp-themes/bp-default/forums/index.php:133
5524
- #: bp-themes/bp-default/groups/single/forum.php:87
5525
- msgid "Post Topic"
5526
- msgstr ""
5527
-
5528
- #: bp-templates/bp-legacy/buddypress/forums/index.php:127
5529
- #: bp-themes/bp-default/forums/index.php:145
5530
- 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."
5531
- msgstr ""
5532
-
5533
- #: bp-templates/bp-legacy/buddypress/groups/create.php:29
5534
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:16
5535
- #: bp-themes/bp-default/groups/create.php:39
5536
- #: bp-themes/bp-default/groups/single/admin.php:16
5537
- msgid "Group Name (required)"
5538
- msgstr ""
5539
-
5540
- #: bp-templates/bp-legacy/buddypress/groups/create.php:34
5541
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:19
5542
- #: bp-themes/bp-default/groups/create.php:42
5543
- #: bp-themes/bp-default/groups/single/admin.php:19
5544
- msgid "Group Description (required)"
5545
- msgstr ""
5546
-
5547
- #: bp-templates/bp-legacy/buddypress/groups/create.php:51
5548
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:56
5549
- #: bp-themes/bp-default/groups/create.php:58
5550
- #: bp-themes/bp-default/groups/single/admin.php:56
5551
- msgid "Privacy Options"
5552
- msgstr ""
5553
-
5554
- #: bp-templates/bp-legacy/buddypress/groups/create.php:55
5555
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:61
5556
- #: bp-themes/bp-default/groups/create.php:62
5557
- #: bp-themes/bp-default/groups/single/admin.php:61
5558
- msgid "This is a public group"
5559
- msgstr ""
5560
-
5561
- #: bp-templates/bp-legacy/buddypress/groups/create.php:57
5562
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:63
5563
- #: bp-themes/bp-default/groups/create.php:64
5564
- #: bp-themes/bp-default/groups/single/admin.php:63
5565
- msgid "Any site member can join this group."
5566
- msgstr ""
5567
-
5568
- #: bp-templates/bp-legacy/buddypress/groups/create.php:58
5569
- #: bp-templates/bp-legacy/buddypress/groups/create.php:67
5570
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:64
5571
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:74
5572
- #: bp-themes/bp-default/groups/create.php:65
5573
- #: bp-themes/bp-default/groups/create.php:74
5574
- #: bp-themes/bp-default/groups/single/admin.php:64
5575
- #: bp-themes/bp-default/groups/single/admin.php:74
5576
- msgid "This group will be listed in the groups directory and in search results."
5577
- msgstr ""
5578
-
5579
- #: bp-templates/bp-legacy/buddypress/groups/create.php:59
5580
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:65
5581
- #: bp-themes/bp-default/groups/create.php:66
5582
- #: bp-themes/bp-default/groups/single/admin.php:65
5583
- msgid "Group content and activity will be visible to any site member."
5584
- msgstr ""
5585
-
5586
- #: bp-templates/bp-legacy/buddypress/groups/create.php:64
5587
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:71
5588
- #: bp-themes/bp-default/groups/create.php:71
5589
- #: bp-themes/bp-default/groups/single/admin.php:71
5590
- msgid "This is a private group"
5591
- msgstr ""
5592
-
5593
- #: bp-templates/bp-legacy/buddypress/groups/create.php:66
5594
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:73
5595
- #: bp-themes/bp-default/groups/create.php:73
5596
- #: bp-themes/bp-default/groups/single/admin.php:73
5597
- msgid "Only users who request membership and are accepted can join the group."
5598
- msgstr ""
5599
-
5600
- #: bp-templates/bp-legacy/buddypress/groups/create.php:68
5601
- #: bp-templates/bp-legacy/buddypress/groups/create.php:77
5602
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:75
5603
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:85
5604
- #: bp-themes/bp-default/groups/create.php:75
5605
- #: bp-themes/bp-default/groups/create.php:84
5606
- #: bp-themes/bp-default/groups/single/admin.php:75
5607
- #: bp-themes/bp-default/groups/single/admin.php:85
5608
- msgid "Group content and activity will only be visible to members of the group."
5609
- msgstr ""
5610
-
5611
- #: bp-templates/bp-legacy/buddypress/groups/create.php:73
5612
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:81
5613
- #: bp-themes/bp-default/groups/create.php:80
5614
- #: bp-themes/bp-default/groups/single/admin.php:81
5615
- msgid "This is a hidden group"
5616
- msgstr ""
5617
-
5618
- #: bp-templates/bp-legacy/buddypress/groups/create.php:75
5619
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:83
5620
- #: bp-themes/bp-default/groups/create.php:82
5621
- #: bp-themes/bp-default/groups/single/admin.php:83
5622
- msgid "Only users who are invited can join the group."
5623
- msgstr ""
5624
-
5625
- #: bp-templates/bp-legacy/buddypress/groups/create.php:76
5626
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:84
5627
- #: bp-themes/bp-default/groups/create.php:83
5628
- #: bp-themes/bp-default/groups/single/admin.php:84
5629
- msgid "This group will not be listed in the groups directory or search results."
5630
- msgstr ""
5631
-
5632
- #: bp-templates/bp-legacy/buddypress/groups/create.php:82
5633
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:92
5634
- #: bp-themes/bp-default/groups/create.php:89
5635
- #: bp-themes/bp-default/groups/single/admin.php:92
5636
- msgid "Group Invitations"
5637
- msgstr ""
5638
-
5639
- #: bp-templates/bp-legacy/buddypress/groups/create.php:84
5640
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:94
5641
- #: bp-themes/bp-default/groups/create.php:91
5642
- #: bp-themes/bp-default/groups/single/admin.php:94
5643
- msgid "Which members of this group are allowed to invite others?"
5644
- msgstr ""
5645
-
5646
- #: bp-templates/bp-legacy/buddypress/groups/create.php:109
5647
- #: bp-themes/bp-default/groups/create.php:116
5648
- msgid "Should this group have a forum?"
5649
- msgstr ""
5650
-
5651
- #: bp-templates/bp-legacy/buddypress/groups/create.php:116
5652
- #: bp-themes/bp-default/groups/create.php:123
5653
- msgid "<strong>Attention Site Admin:</strong> Group forums require the <a href=\"%s\">correct setup and configuration</a> of a bbPress installation."
5654
- msgstr ""
5655
-
5656
- #: bp-templates/bp-legacy/buddypress/groups/create.php:142
5657
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:127
5658
- #: bp-themes/bp-default/groups/create.php:149
5659
- #: bp-themes/bp-default/groups/single/admin.php:127
5660
- 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."
5661
- msgstr ""
5662
-
5663
- #: bp-templates/bp-legacy/buddypress/groups/create.php:146
5664
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:131
5665
- #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:18
5666
- #: bp-themes/bp-default/groups/create.php:153
5667
- #: bp-themes/bp-default/groups/single/admin.php:131
5668
- #: bp-themes/bp-default/members/single/profile/change-avatar.php:18
5669
- msgid "Upload Image"
5670
- msgstr ""
5671
-
5672
- #: bp-templates/bp-legacy/buddypress/groups/create.php:150
5673
- #: bp-themes/bp-default/groups/create.php:157
5674
- msgid "To skip the avatar upload process, hit the \"Next Step\" button."
5675
- msgstr ""
5676
-
5677
- #: bp-templates/bp-legacy/buddypress/groups/create.php:157
5678
- #: bp-themes/bp-default/groups/create.php:164
5679
- msgid "Crop Group Avatar"
5680
- msgstr ""
5681
-
5682
- #: bp-templates/bp-legacy/buddypress/groups/create.php:159
5683
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:151
5684
- #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:33
5685
- #: bp-themes/bp-default/groups/create.php:166
5686
- #: bp-themes/bp-default/groups/single/admin.php:151
5687
- #: bp-themes/bp-default/members/single/profile/change-avatar.php:33
5688
- msgid "Avatar to crop"
5689
- msgstr ""
5690
-
5691
- #: bp-templates/bp-legacy/buddypress/groups/create.php:162
5692
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:154
5693
- #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:36
5694
- #: bp-themes/bp-default/groups/create.php:169
5695
- #: bp-themes/bp-default/groups/single/admin.php:154
5696
- #: bp-themes/bp-default/members/single/profile/change-avatar.php:36
5697
- msgid "Avatar preview"
5698
- msgstr ""
5699
-
5700
- #: bp-templates/bp-legacy/buddypress/groups/create.php:165
5701
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:157
5702
- #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:39
5703
- #: bp-themes/bp-default/groups/create.php:172
5704
- #: bp-themes/bp-default/groups/single/admin.php:157
5705
- #: bp-themes/bp-default/members/single/profile/change-avatar.php:39
5706
- msgid "Crop Image"
5707
- msgstr ""
5708
-
5709
- #: bp-templates/bp-legacy/buddypress/groups/create.php:204
5710
- #: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:79
5711
- #: bp-themes/bp-default/groups/create.php:211
5712
- #: bp-themes/bp-default/groups/single/send-invites.php:22
5713
- msgid "Select people to invite from your friends list."
5714
- msgstr ""
5715
-
5716
- #: bp-templates/bp-legacy/buddypress/groups/create.php:222
5717
- #: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:51
5718
- #: bp-templates/bp-legacy/buddypress-functions.php:1031
5719
- #: bp-themes/bp-default/_inc/ajax.php:598
5720
- #: bp-themes/bp-default/groups/create.php:229
5721
- #: bp-themes/bp-default/groups/single/send-invites.php:42
5722
- msgid "Remove Invite"
5723
- msgstr ""
5724
-
5725
- #: bp-templates/bp-legacy/buddypress/groups/create.php:239
5726
- #: bp-themes/bp-default/groups/create.php:246
5727
- #: bp-themes/bp-default/groups/single/send-invites.php:73
5728
- msgid "Once you have built up friend connections you will be able to invite others to your group."
5729
- msgstr ""
5730
-
5731
- #: bp-templates/bp-legacy/buddypress/groups/create.php:261
5732
- #: bp-themes/bp-default/groups/create.php:268
5733
- msgid "Back to Previous Step"
5734
- msgstr ""
5735
-
5736
- #: bp-templates/bp-legacy/buddypress/groups/create.php:268
5737
- #: bp-themes/bp-default/groups/create.php:275
5738
- msgid "Next Step"
5739
- msgstr ""
5740
-
5741
- #: bp-templates/bp-legacy/buddypress/groups/create.php:275
5742
- #: bp-themes/bp-default/groups/create.php:282
5743
- msgid "Create Group and Continue"
5744
- msgstr ""
5745
-
5746
- #: bp-templates/bp-legacy/buddypress/groups/create.php:282
5747
- #: bp-themes/bp-default/groups/create.php:289
5748
- msgid "Finish"
5749
- msgstr ""
5750
-
5751
- #: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:95
5752
- #: bp-themes/bp-default/groups/groups-loop.php:95
5753
- msgid "There were no groups found."
5754
- msgstr ""
5755
-
5756
- #: bp-templates/bp-legacy/buddypress/groups/index.php:19
5757
- #: bp-themes/bp-default/groups/index.php:35
5758
- msgid "All Groups <span>%s</span>"
5759
- msgstr ""
5760
-
5761
- #: bp-templates/bp-legacy/buddypress/groups/index.php:40
5762
- #: bp-templates/bp-legacy/buddypress/members/single/groups.php:23
5763
- #: bp-themes/bp-default/groups/index.php:58
5764
- #: bp-themes/bp-default/members/single/groups.php:23
5765
- msgid "Most Members"
5766
- msgstr ""
5767
-
5768
- #: bp-templates/bp-legacy/buddypress/groups/index.php:41
5769
- #: bp-templates/bp-legacy/buddypress/members/single/groups.php:24
5770
- #: bp-themes/bp-default/groups/index.php:59
5771
- #: bp-themes/bp-default/members/single/groups.php:24
5772
- msgid "Newly Created"
5773
- msgstr ""
5774
-
5775
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:26
5776
- #: bp-themes/bp-default/groups/single/admin.php:26
5777
- msgid "Notify group members of these changes via email"
5778
- msgstr ""
5779
-
5780
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:137
5781
- #: bp-themes/bp-default/groups/single/admin.php:137
5782
- msgid "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button."
5783
- msgstr ""
5784
-
5785
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:139
5786
- #: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24
5787
- #: bp-themes/bp-default/groups/single/admin.php:139
5788
- #: bp-themes/bp-default/members/single/profile/change-avatar.php:24
5789
- #: bp-xprofile/bp-xprofile-admin.php:804
5790
- msgid "Delete Avatar"
5791
- msgstr ""
5792
-
5793
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:149
5794
- #: bp-themes/bp-default/groups/single/admin.php:149
5795
- msgid "Crop Avatar"
5796
- msgstr ""
5797
-
5798
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:260
5799
- #: bp-themes/bp-default/groups/single/admin.php:260
5800
- msgid "(banned)"
5801
- msgstr ""
5802
-
5803
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266
5804
- #: bp-themes/bp-default/groups/single/admin.php:266
5805
- msgid "Unban this member"
5806
- msgstr ""
5807
-
5808
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266
5809
- #: bp-themes/bp-default/groups/single/admin.php:266
5810
- msgid "Remove Ban"
5811
- msgstr ""
5812
-
5813
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270
5814
- #: bp-themes/bp-default/groups/single/admin.php:270
5815
- msgid "Kick and ban this member"
5816
- msgstr ""
5817
-
5818
- #: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270
5819
- #: bp-themes/bp