BuddyPress - Version 1.7.3

Version Description

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

Download this release

Release Info

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

Code changes from version 1.8-beta2 to 1.7.3

Files changed (133) hide show
  1. bp-activity/bp-activity-actions.php +44 -85
  2. bp-activity/bp-activity-admin.php +8 -8
  3. bp-activity/bp-activity-cache.php +1 -18
  4. bp-activity/bp-activity-classes.php +6 -350
  5. bp-activity/bp-activity-filters.php +5 -18
  6. bp-activity/bp-activity-functions.php +7 -36
  7. bp-activity/bp-activity-loader.php +20 -26
  8. bp-activity/bp-activity-screens.php +11 -68
  9. bp-activity/bp-activity-template.php +8 -54
  10. bp-activity/feeds/bp-activity-favorites-feed.php +74 -0
  11. bp-activity/feeds/bp-activity-friends-feed.php +64 -0
  12. bp-activity/feeds/bp-activity-group-feed.php +59 -0
  13. bp-activity/feeds/bp-activity-mentions-feed.php +65 -0
  14. bp-activity/feeds/bp-activity-mygroups-feed.php +65 -0
  15. bp-activity/feeds/bp-activity-personal-feed.php +64 -0
  16. bp-activity/feeds/bp-activity-sitewide-feed.php +59 -0
  17. bp-blogs/bp-blogs-actions.php +1 -1
  18. bp-blogs/bp-blogs-activity.php +2 -1
  19. bp-blogs/bp-blogs-cache.php +1 -1
  20. bp-blogs/bp-blogs-functions.php +10 -9
  21. bp-blogs/bp-blogs-loader.php +0 -9
  22. bp-blogs/bp-blogs-screens.php +0 -48
  23. bp-blogs/bp-blogs-template.php +4 -2
  24. bp-blogs/bp-blogs-widgets.php +9 -32
  25. bp-core/admin/bp-core-components.php +1 -0
  26. bp-core/admin/bp-core-functions.php +2 -12
  27. bp-core/admin/bp-core-slugs.php +1 -0
  28. bp-core/bp-core-actions.php +0 -2
  29. bp-core/bp-core-admin.php +54 -57
  30. bp-core/bp-core-adminbar.php +1 -1
  31. bp-core/bp-core-avatars.php +68 -86
  32. bp-core/bp-core-buddybar.php +22 -19
  33. bp-core/bp-core-caps.php +2 -0
  34. bp-core/bp-core-catchuri.php +2 -2
  35. bp-core/bp-core-classes.php +14 -74
  36. bp-core/bp-core-component.php +51 -59
  37. bp-core/bp-core-dependency.php +0 -10
  38. bp-core/bp-core-filters.php +3 -2
  39. bp-core/bp-core-functions.php +532 -612
  40. bp-core/bp-core-loader.php +2 -3
  41. bp-core/bp-core-options.php +20 -20
  42. bp-core/bp-core-template-loader.php +11 -27
  43. bp-core/bp-core-template.php +20 -31
  44. bp-core/bp-core-theme-compatibility.php +90 -88
  45. bp-core/bp-core-update.php +3 -1
  46. bp-core/bp-core-widgets.php +10 -16
  47. bp-core/bp-core-wpabstraction.php +8 -8
  48. bp-core/deprecated/1.2.php +0 -48
  49. bp-core/deprecated/1.5.php +4 -4
  50. bp-core/deprecated/1.6.php +1 -1
  51. bp-forums/bp-forums-bbpress-sa.php +3 -3
  52. bp-forums/bp-forums-functions.php +2 -2
  53. bp-forums/bp-forums-loader.php +0 -6
  54. bp-forums/bp-forums-template.php +2 -2
  55. bp-forums/deprecated/1.6.php +8 -96
  56. bp-forums/deprecated/1.7.php +229 -0
  57. bp-friends/bp-friends-activity.php +2 -2
  58. bp-friends/bp-friends-functions.php +0 -4
  59. bp-friends/bp-friends-template.php +1 -1
  60. bp-groups/admin/css/admin.css +0 -37
  61. bp-groups/admin/css/admin.min.css +1 -1
  62. bp-groups/admin/js/admin.js +1 -17
  63. bp-groups/admin/js/admin.min.js +1 -1
  64. bp-groups/bp-groups-actions.php +13 -28
  65. bp-groups/bp-groups-admin.php +59 -149
  66. bp-groups/bp-groups-buddybar.php +1 -0
  67. bp-groups/bp-groups-cache.php +4 -6
  68. bp-groups/bp-groups-classes.php +188 -1584
  69. bp-groups/bp-groups-forums.php +1 -1
  70. bp-groups/bp-groups-functions.php +20 -62
  71. bp-groups/bp-groups-loader.php +1 -11
  72. bp-groups/bp-groups-screens.php +3 -84
  73. bp-groups/bp-groups-template.php +36 -56
  74. bp-groups/bp-groups-widgets.php +5 -7
  75. bp-languages/buddypress.pot +914 -936
  76. bp-loader.php +26 -43
  77. bp-members/bp-members-actions.php +3 -2
  78. bp-members/bp-members-adminbar.php +14 -20
  79. bp-members/bp-members-functions.php +40 -141
  80. bp-members/bp-members-notifications.php +1 -1
  81. bp-members/bp-members-screens.php +2 -83
  82. bp-members/bp-members-template.php +4 -5
  83. bp-messages/bp-messages-functions.php +2 -2
  84. bp-messages/bp-messages-template.php +3 -5
  85. bp-messages/js/autocomplete/jquery.autocompletefb.js +2 -2
  86. bp-messages/js/autocomplete/jquery.autocompletefb.min.js +1 -1
  87. bp-messages/js/autocomplete/license.bgiframe.txt +19 -19
  88. bp-settings/bp-settings-actions.php +7 -0
  89. bp-settings/bp-settings-screens.php +8 -0
  90. bp-templates/bp-legacy/buddypress-functions.php +43 -109
  91. bp-templates/bp-legacy/buddypress/activity/comment.php +1 -1
  92. bp-templates/bp-legacy/buddypress/activity/index.php +6 -10
  93. bp-templates/bp-legacy/buddypress/groups/single/admin.php +40 -40
  94. bp-templates/bp-legacy/buddypress/members/activate.php +1 -1
  95. bp-templates/bp-legacy/buddypress/members/index.php +0 -2
  96. bp-templates/bp-legacy/buddypress/members/register.php +8 -8
  97. bp-templates/bp-legacy/buddypress/members/single/home.php +1 -1
  98. bp-templates/bp-legacy/buddypress/members/single/member-header.php +1 -4
  99. bp-templates/bp-legacy/buddypress/members/single/profile.php +11 -5
  100. bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php +26 -14
  101. bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php +33 -21
  102. bp-templates/bp-legacy/buddypress/members/single/settings/general.php +33 -19
  103. bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php +26 -12
  104. bp-templates/bp-legacy/css/buddypress-rtl.css +126 -120
  105. bp-templates/bp-legacy/css/buddypress.css +116 -110
  106. bp-templates/bp-legacy/js/buddypress.js +34 -119
  107. bp-themes/bp-default/_inc/ajax.php +5 -17
  108. bp-themes/bp-default/_inc/css/default.css +0 -14
  109. bp-themes/bp-default/_inc/global.js +26 -94
  110. bp-themes/bp-default/activity/comment.php +1 -1
  111. bp-themes/bp-default/activity/index.php +2 -6
  112. bp-themes/bp-default/comments.php +1 -1
  113. bp-themes/bp-default/functions.php +2 -3
  114. bp-themes/bp-default/groups/single/admin.php +40 -40
  115. bp-themes/bp-default/groups/single/home.php +5 -4
  116. bp-themes/bp-default/license.txt +280 -280
  117. bp-themes/bp-default/members/index.php +0 -2
  118. bp-themes/bp-default/members/single/member-header.php +1 -4
  119. bp-themes/bp-default/members/single/profile.php +11 -5
  120. bp-themes/bp-default/members/single/settings/general.php +1 -1
  121. bp-themes/bp-default/readme.txt +21 -21
  122. bp-themes/bp-default/registration/activate.php +1 -1
  123. bp-themes/bp-default/registration/register.php +9 -9
  124. bp-themes/bp-default/rtl.css +1 -1
  125. bp-themes/bp-default/style.css +1 -1
  126. bp-xprofile/admin/js/admin.js +0 -6
  127. bp-xprofile/admin/js/admin.min.js +1 -1
  128. bp-xprofile/bp-xprofile-activity.php +2 -2
  129. bp-xprofile/bp-xprofile-admin.php +2 -2
  130. bp-xprofile/bp-xprofile-classes.php +6 -5
  131. bp-xprofile/bp-xprofile-functions.php +15 -15
  132. bp-xprofile/bp-xprofile-template.php +2 -34
  133. readme.txt +4 -1
bp-activity/bp-activity-actions.php CHANGED
@@ -45,13 +45,14 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
45
* @return bool False on failure
46
*/
47
function bp_activity_action_permalink_router() {
48
49
// Not viewing activity
50
- if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) )
51
return false;
52
53
// No activity to display
54
- if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) )
55
return false;
56
57
// Get the activity details
@@ -61,6 +62,7 @@ function bp_activity_action_permalink_router() {
61
if ( empty( $activity['activities'][0] ) ) {
62
bp_do_404();
63
return;
64
} else {
65
$activity = $activity['activities'][0];
66
}
@@ -69,10 +71,10 @@ function bp_activity_action_permalink_router() {
69
$redirect = false;
70
71
// Redirect based on the type of activity
72
- if ( bp_is_active( 'groups' ) && $activity->component == buddypress()->groups->id ) {
73
74
// Activity is a user update
75
- if ( ! empty( $activity->user_id ) ) {
76
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
77
78
// Activity is something else
@@ -85,21 +87,20 @@ function bp_activity_action_permalink_router() {
85
}
86
87
// Set redirect to users' activity stream
88
- } else if ( ! empty( $activity->user_id ) ) {
89
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
90
}
91
92
// If set, add the original query string back onto the redirect URL
93
- if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
94
$query_frags = array();
95
wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags );
96
$redirect = add_query_arg( urlencode_deep( $query_frags ), $redirect );
97
}
98
99
// Allow redirect to be filtered
100
- if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) {
101
bp_core_redirect( bp_get_root_domain() );
102
- }
103
104
// Redirect to the actual activity permalink page
105
bp_core_redirect( $redirect );
@@ -421,22 +422,16 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
421
* @return bool False on failure
422
*/
423
function bp_activity_action_sitewide_feed() {
424
- global $bp;
425
426
- if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
427
return false;
428
429
- // setup the feed
430
- buddypress()->activity->feed = new BP_Activity_Feed( array(
431
- 'id' => 'sitewide',
432
-
433
- /* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */
434
- 'title' => sprintf( __( '%s | Site Wide Activity', 'buddypress' ), bp_get_site_name() ),
435
436
- 'link' => bp_get_activity_directory_permalink(),
437
- 'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
438
- 'activity_args' => 'display_comments=threaded'
439
- ) );
440
}
441
add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
442
@@ -453,21 +448,16 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
453
* @return bool False on failure
454
*/
455
function bp_activity_action_personal_feed() {
456
- if ( ! bp_is_user_activity() || ! bp_is_current_action( 'feed' ) ) {
457
- return false;
458
- }
459
460
- // setup the feed
461
- buddypress()->activity->feed = new BP_Activity_Feed( array(
462
- 'id' => 'personal',
463
464
- /* translators: Personal activity RSS title - "[Site Name] | [User Display Name] | Activity" */
465
- 'title' => sprintf( __( '%1$s | %2$s | Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
466
467
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ),
468
- 'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ),
469
- 'activity_args' => 'user_id=' . bp_displayed_user_id()
470
- ) );
471
}
472
add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
473
@@ -487,21 +477,16 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
487
* @return bool False on failure
488
*/
489
function bp_activity_action_friends_feed() {
490
- if ( ! bp_is_active( 'friends' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_friends_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {
491
- return false;
492
- }
493
494
- // setup the feed
495
- buddypress()->activity->feed = new BP_Activity_Feed( array(
496
- 'id' => 'friends',
497
498
- /* translators: Friends activity RSS title - "[Site Name] | [User Display Name] | Friends Activity" */
499
- 'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
500
501
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ),
502
- 'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ),
503
- 'activity_args' => 'scope=friends'
504
- ) );
505
}
506
add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
507
@@ -521,29 +506,16 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
521
* @return bool False on failure
522
*/
523
function bp_activity_action_my_groups_feed() {
524
- if ( ! bp_is_active( 'groups' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_groups_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {
525
return false;
526
- }
527
528
- // get displayed user's group IDs
529
- $groups = groups_get_user_groups();
530
- $group_ids = implode( ',', $groups['groups'] );
531
-
532
- // setup the feed
533
- buddypress()->activity->feed = new BP_Activity_Feed( array(
534
- 'id' => 'mygroups',
535
-
536
- /* translators: Member groups activity RSS title - "[Site Name] | [User Display Name] | Groups Activity" */
537
- 'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
538
-
539
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),
540
- 'description' => sprintf( __( "Public group activity feed of which %s is a member of.", 'buddypress' ), bp_get_displayed_user_fullname() ),
541
- 'activity_args' => array(
542
- 'object' => buddypress()->groups->id,
543
- 'primary_id' => $group_ids,
544
- 'display_comments' => 'threaded'
545
- )
546
- ) );
547
}
548
add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
549
@@ -563,10 +535,6 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
563
function bp_activity_action_mentions_feed() {
564
global $wp_query;
565
566
- if ( ! bp_activity_do_mentions() ) {
567
- return false;
568
- }
569
-
570
if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
571
return false;
572
@@ -592,25 +560,16 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
592
* @return bool False on failure
593
*/
594
function bp_activity_action_favorites_feed() {
595
- if ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
596
- return false;
597
- }
598
-
599
- // get displayed user's favorite activity IDs
600
- $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
601
- $fav_ids = implode( ',', (array) $favs );
602
603
- // setup the feed
604
- buddypress()->activity->feed = new BP_Activity_Feed( array(
605
- 'id' => 'favorites',
606
607
- /* translators: User activity favorites RSS title - "[Site Name] | [User Display Name] | Favorites" */
608
- 'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
609
610
- 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',
611
- 'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ),
612
- 'activity_args' => 'include=' . $fav_ids
613
- ) );
614
}
615
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
616
45
* @return bool False on failure
46
*/
47
function bp_activity_action_permalink_router() {
48
+ global $bp;
49
50
// Not viewing activity
51
+ if ( !bp_is_activity_component() || !bp_is_current_action( 'p' ) )
52
return false;
53
54
// No activity to display
55
+ if ( !bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) )
56
return false;
57
58
// Get the activity details
62
if ( empty( $activity['activities'][0] ) ) {
63
bp_do_404();
64
return;
65
+
66
} else {
67
$activity = $activity['activities'][0];
68
}
71
$redirect = false;
72
73
// Redirect based on the type of activity
74
+ if ( bp_is_active( 'groups' ) && $activity->component == $bp->groups->id ) {
75
76
// Activity is a user update
77
+ if ( !empty( $activity->user_id ) ) {
78
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
79
80
// Activity is something else
87
}
88
89
// Set redirect to users' activity stream
90
+ } else {
91
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
92
}
93
94
// If set, add the original query string back onto the redirect URL
95
+ if ( !empty( $_SERVER['QUERY_STRING'] ) ) {
96
$query_frags = array();
97
wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags );
98
$redirect = add_query_arg( urlencode_deep( $query_frags ), $redirect );
99
}
100
101
// Allow redirect to be filtered
102
+ if ( !$redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) )
103
bp_core_redirect( bp_get_root_domain() );
104
105
// Redirect to the actual activity permalink page
106
bp_core_redirect( $redirect );
422
* @return bool False on failure
423
*/
424
function bp_activity_action_sitewide_feed() {
425
+ global $bp, $wp_query;
426
427
+ if ( !bp_is_activity_component() || !bp_is_current_action( 'feed' ) || bp_is_user() || !empty( $bp->groups->current_group ) )
428
return false;
429
430
+ $wp_query->is_404 = false;
431
+ status_header( 200 );
432
433
+ include_once( 'feeds/bp-activity-sitewide-feed.php' );
434
+ die;
435
}
436
add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
437
448
* @return bool False on failure
449
*/
450
function bp_activity_action_personal_feed() {
451
+ global $wp_query;
452
453
+ if ( !bp_is_user_activity() || !bp_is_current_action( 'feed' ) )
454
+ return false;
455
456
+ $wp_query->is_404 = false;
457
+ status_header( 200 );
458
459
+ include_once( 'feeds/bp-activity-personal-feed.php' );
460
+ die;
461
}
462
add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
463
477
* @return bool False on failure
478
*/
479
function bp_activity_action_friends_feed() {
480
+ global $wp_query;
481
482
+ if ( !bp_is_active( 'friends' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
483
+ return false;
484
485
+ $wp_query->is_404 = false;
486
+ status_header( 200 );
487
488
+ include_once( 'feeds/bp-activity-friends-feed.php' );
489
+ die;
490
}
491
add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
492
506
* @return bool False on failure
507
*/
508
function bp_activity_action_my_groups_feed() {
509
+ global $wp_query;
510
+
511
+ if ( !bp_is_active( 'groups' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
512
return false;
513
514
+ $wp_query->is_404 = false;
515
+ status_header( 200 );
516
+
517
+ include_once( 'feeds/bp-activity-mygroups-feed.php' );
518
+ die;
519
}
520
add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
521
535
function bp_activity_action_mentions_feed() {
536
global $wp_query;
537
538
if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
539
return false;
540
560
* @return bool False on failure
561
*/
562
function bp_activity_action_favorites_feed() {
563
+ global $wp_query;
564
565
+ if ( !bp_is_user_activity() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
566
+ return false;
567
568
+ $wp_query->is_404 = false;
569
+ status_header( 200 );
570
571
+ include_once( 'feeds/bp-activity-favorites-feed.php' );
572
+ die;
573
}
574
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
575
bp-activity/bp-activity-admin.php CHANGED
@@ -588,7 +588,7 @@ function bp_activity_admin_edit() {
588
589
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
590
<div id="post-body-content">
591
- <div id="postdiv">
592
<div id="bp_activity_action" class="postbox">
593
<h3><?php _e( 'Action', 'buddypress' ); ?></h3>
594
<div class="inside">
@@ -1127,13 +1127,13 @@ class BP_Activity_List_Table extends WP_List_Table {
1127
* @since BuddyPress (1.6)
1128
*/
1129
function get_views() {
1130
- $url_base = bp_get_admin_url( 'admin.php?page=bp-activity' ); ?>
1131
-
1132
<ul class="subsubsub">
1133
- <li class="all"><a href="<?php echo esc_attr( esc_url( $url_base ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
1134
- <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $url_base ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
1135
1136
- <?php do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?>
1137
</ul>
1138
<?php
1139
}
@@ -1224,7 +1224,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1224
* @since BuddyPress (1.6)
1225
*/
1226
function column_cb( $item ) {
1227
- printf( '<label class="screen-reader-text" for="aid-%1$d">' . __( 'Select activity item %1$d', 'buddypress' ) . '</label><input type="checkbox" name="aid[]" value="%1$d" id="aid-%1$d" />', $item['id'] );
1228
}
1229
1230
/**
@@ -1297,7 +1297,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1297
$actions = apply_filters( 'bp_activity_admin_comment_row_actions', array_filter( $actions ), $item );
1298
1299
/* translators: 2: activity admin ui date/time */
1300
- printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>', 'buddypress' ), bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $item['id'] . '/', get_date_from_gmt( $item['date_recorded'], get_option( 'date_format' ) ), get_date_from_gmt( $item['date_recorded'], get_option( 'time_format' ) ) );
1301
1302
// End timestamp
1303
echo '</div>';
588
589
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
590
<div id="post-body-content">
591
+ <div id="postdiv" class="postarea">
592
<div id="bp_activity_action" class="postbox">
593
<h3><?php _e( 'Action', 'buddypress' ); ?></h3>
594
<div class="inside">
1127
* @since BuddyPress (1.6)
1128
*/
1129
function get_views() {
1130
+ $redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'error', 'spammed', 'unspammed', 'updated', ), $_SERVER['REQUEST_URI'] );
1131
+ ?>
1132
<ul class="subsubsub">
1133
+ <li class="all"><a href="<?php echo esc_attr( esc_url( $redirect_to ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
1134
+ <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
1135
1136
+ <?php do_action( 'bp_activity_list_table_get_views', $redirect_to, $this->view ); ?>
1137
</ul>
1138
<?php
1139
}
1224
* @since BuddyPress (1.6)
1225
*/
1226
function column_cb( $item ) {
1227
+ printf( '<input type="checkbox" name="aid[]" value="%d" />', (int) $item['id'] );
1228
}
1229
1230
/**
1297
$actions = apply_filters( 'bp_activity_admin_comment_row_actions', array_filter( $actions ), $item );
1298
1299
/* translators: 2: activity admin ui date/time */
1300
+ printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>', 'buddypress' ), bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $item['id'] . '/', date_i18n( get_option( 'date_format' ), strtotime( $item['date_recorded'] ) ), date_i18n( get_option( 'time_format' ), strtotime( $item['date_recorded'] ) ) );
1301
1302
// End timestamp
1303
echo '</div>';
bp-activity/bp-activity-cache.php CHANGED
@@ -32,23 +32,6 @@ function bp_activity_update_meta_cache( $activity_ids = false ) {
32
'meta_table' => $bp->activity->table_name_meta,
33
'cache_key_prefix' => 'bp_activity_meta'
34
);
35
-
36
bp_update_meta_cache( $cache_args );
37
}
38
-
39
- /**
40
- * Clear the cache for all metadata of a given activity
41
- *
42
- * @param int $activity_id
43
- */
44
- function bp_activity_clear_meta_cache_for_activity( $activity_id ) {
45
- global $wp_object_cache;
46
-
47
- if ( is_object( $wp_object_cache ) && ! empty( $wp_object_cache->cache['bp'] ) ) {
48
- foreach ( $wp_object_cache->cache['bp'] as $ckey => $cvalue ) {
49
- if ( 0 === strpos( $ckey, 'bp_activity_meta_' . $activity_id ) ) {
50
- wp_cache_delete( $ckey, 'bp' );
51
- }
52
- }
53
- }
54
- }
32
'meta_table' => $bp->activity->table_name_meta,
33
'cache_key_prefix' => 'bp_activity_meta'
34
);
35
+
36
bp_update_meta_cache( $cache_args );
37
}
bp-activity/bp-activity-classes.php CHANGED
@@ -144,7 +144,6 @@ class BP_Activity_Activity {
144
'sort' => 'DESC', // ASC or DESC
145
'exclude' => false, // Array of ids to exclude
146
'in' => false, // Array of ids to limit query by (IN)
147
- 'meta_query' => false, // Filter by activitymeta
148
'filter' => false, // See self::get_filter_sql()
149
'search_terms' => false, // Terms to search by
150
'display_comments' => false, // Whether to include activity comments
@@ -159,8 +158,6 @@ class BP_Activity_Activity {
159
160
$from_sql = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
161
162
- $join_sql = '';
163
-
164
// Where conditions
165
$where_conditions = array();
166
@@ -200,17 +197,6 @@ class BP_Activity_Activity {
200
$where_conditions['in'] = "a.id IN ({$in})";
201
}
202
203
- // Process meta_query into SQL
204
- $meta_query_sql = self::get_meta_query_sql( $meta_query );
205
-
206
- if ( ! empty( $meta_query_sql['join'] ) ) {
207
- $join_sql .= $meta_query_sql['join'];
208
- }
209
-
210
- if ( ! empty( $meta_query_sql['where'] ) ) {
211
- $where_conditions[] = $meta_query_sql['where'];
212
- }
213
-
214
// Alter the query based on whether we want to show activity item
215
// comments in the stream like normal comments or threaded below
216
// the activity.
@@ -242,12 +228,12 @@ class BP_Activity_Activity {
242
$per_page = absint( $per_page );
243
244
$pag_sql = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
245
- $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
246
} else {
247
- $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort ) );
248
}
249
250
- $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(a.id) FROM {$bp->activity->table_name} a {$index_hint_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $where_sql, $sort );
251
252
$total_activities = $wpdb->get_var( $total_activities_sql );
253
@@ -256,7 +242,7 @@ class BP_Activity_Activity {
256
$activity_user_ids = wp_list_pluck( $activities, 'user_id' );
257
$activity_user_ids = implode( ',', wp_parse_id_list( $activity_user_ids ) );
258
259
- if ( !empty( $activity_user_ids ) ) {
260
if ( $names = $wpdb->get_results( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) {
261
foreach ( (array) $names as $name )
262
$tmp_names[$name->user_id] = $name->user_fullname;
@@ -294,46 +280,6 @@ class BP_Activity_Activity {
294
return array( 'activities' => $activities, 'total' => (int) $total_activities );
295
}
296
297
- /**
298
- * Get the SQL for the 'meta_query' param in BP_Activity_Activity::get()
299
- *
300
- * We use WP_Meta_Query to do the heavy lifting of parsing the
301
- * meta_query array and creating the necessary SQL clauses. However,
302
- * since BP_Activity_Activity::get() builds its SQL differently than
303
- * WP_Query, we have to alter the return value (stripping the leading
304
- * AND keyword from the 'where' clause).
305
- *
306
- * @since BuddyPress (1.8)
307
- *
308
- * @param array $meta_query An array of meta_query filters. See the
309
- * documentation for WP_Meta_Query for details.
310
- * @return array $sql_array 'join' and 'where' clauses
311
- */
312
- public static function get_meta_query_sql( $meta_query = array() ) {
313
- global $wpdb;
314
-
315
- $sql_array = array(
316
- 'join' => '',
317
- 'where' => '',
318
- );
319
-
320
- if ( ! empty( $meta_query ) ) {
321
- $activity_meta_query = new WP_Meta_Query( $meta_query );
322
-
323
- // WP_Meta_Query expects the table name at
324
- // $wpdb->activitymeta
325
- $wpdb->activitymeta = buddypress()->activity->table_name_meta;
326
-
327
- $meta_sql = $activity_meta_query->get_sql( 'activity', 'a', 'id' );
328
-
329
- // Strip the leading AND - BP handles it in get()
330
- $sql_array['where'] = preg_replace( '/^\sAND/', '', $meta_sql['where'] );
331
- $sql_array['join'] = $meta_sql['join'];
332
- }
333
-
334
- return $sql_array;
335
- }
336
-
337
/**
338
* In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
339
* As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead.
@@ -479,10 +425,6 @@ class BP_Activity_Activity {
479
480
$activity_ids = implode( ',', wp_parse_id_list( $activity_ids ) );
481
482
- foreach ( (array) $activity_ids as $activity_id ) {
483
- bp_activity_clear_meta_cache_for_activity( $activity_id );
484
- }
485
-
486
return $wpdb->query( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" );
487
}
488
@@ -614,14 +556,10 @@ class BP_Activity_Activity {
614
return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
615
}
616
617
- /**
618
- * Fetch a list of all components that have activity items recorded
619
- *
620
- * @return array
621
- */
622
function get_recorded_components() {
623
global $wpdb, $bp;
624
- return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
625
}
626
627
function get_sitewide_items_for_feed( $limit = 35 ) {
@@ -730,285 +668,3 @@ class BP_Activity_Activity {
730
return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
731
}
732
}
733
-
734
- /**
735
- * Create a RSS feed using the activity component.
736
- *
737
- * You should only construct a new feed when you've validated that you're on
738
- * the appropriate screen.
739
- *
740
- * See {@link bp_activity_action_sitewide_feed()} as an example.
741
- *
742
- * Accepted parameters:
743
- * id - internal id for the feed; should be alphanumeric only
744
- * (required)
745
- * title - RSS feed title
746
- * link - Relevant link for the RSS feed
747
- * description - RSS feed description
748
- * ttl - Time-to-live (see inline doc in constructor)
749
- * update_period - Part of the syndication module (see inline doc in
750
- * constructor for more info)
751
- * update_frequency - Part of the syndication module (see inline doc in
752
- * constructor for more info)
753
- * max - Number of feed items to display
754
- * activity_args - Arguments passed to {@link bp_has_activities()}
755
- *
756
- * @since BuddyPress (1.8)
757
- */
758
- class BP_Activity_Feed {
759
- /**
760
- * Holds our custom class properties.
761
- *
762
- * These variables are stored in a protected array that is magically
763
- * updated using PHP 5.2+ methods.
764
- *
765
- * @see BP_Feed::__construct() This is where $data is added
766
- * @var array
767
- */
768
- protected $data;
769
-
770
- /**
771
- * Magic method for checking the existence of a certain data variable.
772
- *
773
- * @param string $key
774
- */
775
- public function __isset( $key ) { return isset( $this->data[$key] ); }
776
-
777
- /**
778
- * Magic method for getting a certain data variable.
779
- *
780
- * @param string $key
781
- */
782
- public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
783
-
784
- /**
785
- * Constructor.
786
- *
787
- * @param array $args Optional
788
- */
789
- public function __construct( $args = array() ) {
790
- // If feeds are disabled, stop now!
791
- if ( false === (bool) apply_filters( 'bp_activity_enable_feeds', true ) ) {
792
- global $wp_query;
793
-
794
- // set feed flag to false
795
- $wp_query->is_feed = false;
796
-
797
- return false;
798
- }
799
-
800
- // Setup data
801
- $this->data = wp_parse_args( $args, array(
802
- // Internal identifier for the RSS feed - should be alphanumeric only
803
- 'id' => '',
804
-
805
- // RSS title - should be plain-text
806
- 'title' => '',
807
-
808
- // relevant link for the RSS feed
809
- 'link' => '',
810
-
811
- // RSS description - should be plain-text
812
- 'description' => '',
813
-
814
- // Time-to-live - number of minutes to cache the data before an aggregator
815
- // requests it again. This is only acknowledged if the RSS client supports it
816
- //
817
- // See: http://www.rssboard.org/rss-profile#element-channel-ttl
818
- // http://www.kbcafe.com/rss/rssfeedstate.html#ttl
819
- 'ttl' => '30',
820
-
821
- // Syndication module - similar to ttl, but not really supported by RSS
822
- // clients
823
- //
824
- // See: http://web.resource.org/rss/1.0/modules/syndication/#description
825
- // http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule
826
- 'update_period' => 'hourly',
827
- 'update_frequency' => 2,
828
-
829
- // Number of items to display
830
- 'max' => 50,
831
-
832
- // Activity arguments passed to bp_has_activities()
833
- 'activity_args' => array()
834
- ) );
835
-
836
- // Plugins can use this filter to modify the feed before it is setup
837
- do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
838
-
839
- // Setup class properties
840
- $this->setup_properties();
841
-
842
- // Check if id is valid
843
- if ( empty( $this->id ) ) {
844
- _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
845
- return false;
846
- }
847
-
848
- // Plugins can use this filter to modify the feed after it's setup
849
- do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
850
-
851
- // Setup feed hooks
852
- $this->setup_hooks();
853
-
854
- // Output the feed
855
- $this->output();
856
-
857
- // Kill the rest of the output
858
- die();
859
- }
860
-
861
- /** SETUP ****************************************************************/
862
-
863
- /**
864
- * Setup and validate the class properties.
865
- */
866
- protected function setup_properties() {
867
- $this->id = sanitize_title( $this->id );
868
- $this->title = strip_tags( $this->title );
869
- $this->link = esc_url_raw( $this->link );
870
- $this->description = strip_tags( $this->description );
871
- $this->ttl = (int) $this->ttl;
872
- $this->update_period = strip_tags( $this->update_period );
873
- $this->update_frequency = (int) $this->update_frequency;
874
-
875
- $this->activity_args = wp_parse_args( $this->activity_args, array(
876
- 'max' => $this->max,
877
- 'display_comments' => 'stream'
878
- ) );
879
-
880
- }
881
-
882
- /**
883
- * Setup some hooks that are used in the feed.
884
- *
885
- * Currently, these hooks are used to maintain backwards compatibility with
886
- * the RSS feeds previous to BP 1.8.
887
- */
888
- protected function setup_hooks() {
889
- add_action( 'bp_activity_feed_rss_attributes', array( $this, 'backpat_rss_attributes' ) );
890
- add_action( 'bp_activity_feed_channel_elements', array( $this, 'backpat_channel_elements' ) );
891
- add_action( 'bp_activity_feed_item_elements', array( $this, 'backpat_item_elements' ) );
892
- }
893
-
894
- /** BACKPAT HOOKS ********************************************************/
895
-
896
- public function backpat_rss_attributes() {
897
- do_action( 'bp_activity_' . $this->id . '_feed' );
898
- }
899
-
900
- public function backpat_channel_elements() {
901
- do_action( 'bp_activity_' . $this->id . '_feed_head' );
902
- }
903
-
904
- public function backpat_item_elements() {
905
- switch ( $this->id ) {
906
-
907
- // sitewide and friends feeds use the 'personal' hook
908
- case 'sitewide' :
909
- case 'friends' :
910
- $id = 'personal';
911
-
912
- break;
913
-
914
- default :
915
- $id = $this->id;
916
-
917
- break;
918
- }
919
-
920
- do_action( 'bp_activity_' . $id . '_feed_item' );
921
- }
922
-
923
- /** HELPERS **************************************************************/
924
-
925
- /**
926
- * Output the feed's item content.
927
- */
928
- protected function feed_content() {
929
- bp_activity_content_body();
930
-
931
- switch ( $this->id ) {
932
-
933
- // also output parent activity item if we're on a specific feed
934
- case 'favorites' :
935
- case 'friends' :
936
- case 'mentions' :
937
- case 'personal' :
938
-
939
- if ( 'activity_comment' == bp_get_activity_action_name() ) :
940
- ?>
941
- <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
942
- <?php bp_activity_parent_content() ?>
943
- <?php
944
- endif;
945
-
946
- break;
947
- }
948
- }
949
-
950
- /** OUTPUT ***************************************************************/
951
-
952
- /**
953
- * Output the RSS feed.
954
- */
955
- protected function output() {
956
- // set up some additional headers if not on a directory page
957
- // this is done b/c BP uses pseudo-pages
958
- if ( ! bp_is_directory() ) {
959
- global $wp_query;
960
-
961
- $wp_query->is_404 = false;
962
- status_header( 200 );
963
- }
964
-
965
- header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
966
- echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>';
967
- ?>
968
-
969
- <rss version="2.0"
970
- xmlns:content="http://purl.org/rss/1.0/modules/content/"
971
- xmlns:atom="http://www.w3.org/2005/Atom"
972
- xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
973
- xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
974
- <?php do_action( 'bp_activity_feed_rss_attributes' ); ?>
975
- >
976
-
977
- <channel>
978
- <title><?php echo $this->title; ?></title>
979
- <link><?php echo $this->link; ?></link>
980
- <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
981
- <description><?php echo $this->description ?></description>
982
- <lastBuildDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ); ?></lastBuildDate>
983
- <generator>http://buddypress.org/?v=<?php bp_version(); ?></generator>
984
- <language><?php bloginfo_rss( 'language' ); ?></language>
985
- <ttl><?php echo $this->ttl; ?></ttl>
986
- <sy:updatePeriod><?php echo $this->update_period; ?></sy:updatePeriod>
987
- <sy:updateFrequency><?php echo $this->update_frequency; ?></sy:updateFrequency>
988
- <?php do_action( 'bp_activity_feed_channel_elements' ); ?>
989
-
990
- <?php if ( bp_has_activities( $this->activity_args ) ) : ?>
991
- <?php while ( bp_activities() ) : bp_the_activity(); ?>
992
- <item>
993
- <guid isPermaLink="false"><?php bp_activity_feed_item_guid(); ?></guid>
994
- <title><?php echo stripslashes( bp_get_activity_feed_item_title() ); ?></title>
995
- <link><?php bp_activity_thread_permalink() ?></link>
996
- <pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ); ?></pubDate>
997
-
998
- <?php if ( bp_get_activity_feed_item_description() ) : ?>
999
- <content:encoded><![CDATA[<?php $this->feed_content(); ?>]]></content:encoded>
1000
- <?php endif; ?>
1001
-
1002
- <?php if ( bp_activity_can_comment() ) : ?>
1003
- <slash:comments><?php bp_activity_comment_count(); ?></slash:comments>
1004
- <?php endif; ?>
1005
-
1006
- <?php do_action( 'bp_activity_feed_item_elements' ); ?>
1007
- </item>
1008
- <?php endwhile; ?>
1009
-
1010
- <?php endif; ?>
1011
- </channel>
1012
- </rss><?php
1013
- }
1014
- }
144
'sort' => 'DESC', // ASC or DESC
145
'exclude' => false, // Array of ids to exclude
146
'in' => false, // Array of ids to limit query by (IN)
147
'filter' => false, // See self::get_filter_sql()
148
'search_terms' => false, // Terms to search by
149
'display_comments' => false, // Whether to include activity comments
158
159
$from_sql = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
160
161
// Where conditions
162
$where_conditions = array();
163
197
$where_conditions['in'] = "a.id IN ({$in})";
198
}
199
200
// Alter the query based on whether we want to show activity item
201
// comments in the stream like normal comments or threaded below
202
// the activity.
228
$per_page = absint( $per_page );
229
230
$pag_sql = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
231
+ $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
232
} else {
233
+ $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort ) );
234
}
235
236
+ $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(a.id) FROM {$bp->activity->table_name} a {$index_hint_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $where_sql, $sort );
237
238
$total_activities = $wpdb->get_var( $total_activities_sql );
239
242
$activity_user_ids = wp_list_pluck( $activities, 'user_id' );
243
$activity_user_ids = implode( ',', wp_parse_id_list( $activity_user_ids ) );
244
245
+ if ( !empty( $activity_user_ids ) ) {
246
if ( $names = $wpdb->get_results( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) {
247
foreach ( (array) $names as $name )
248
$tmp_names[$name->user_id] = $name->user_fullname;
280
return array( 'activities' => $activities, 'total' => (int) $total_activities );
281
}
282
283
/**
284
* In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
285
* As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead.
425
426
$activity_ids = implode( ',', wp_parse_id_list( $activity_ids ) );
427
428
return $wpdb->query( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" );
429
}
430
556
return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
557
}
558
559
function get_recorded_components() {
560
global $wpdb, $bp;
561
+
562
+ return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ) );
563
}
564
565
function get_sitewide_items_for_feed( $limit = 35 ) {
668
return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
669
}
670
}
bp-activity/bp-activity-filters.php CHANGED
@@ -125,6 +125,7 @@ function bp_activity_get_moderated_activity_types() {
125
*
126
* @since BuddyPress (1.6)
127
* @param BP_Activity_Activity $activity
128
*/
129
function bp_activity_check_moderation_keys( $activity ) {
130
@@ -143,6 +144,7 @@ function bp_activity_check_moderation_keys( $activity ) {
143
*
144
* @since BuddyPress (1.6)
145
* @param BP_Activity_Activity $activity
146
*/
147
function bp_activity_check_blacklist_keys( $activity ) {
148
@@ -206,11 +208,6 @@ function bp_activity_filter_kses( $content ) {
206
*/
207
function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
208
209
- // Are mentions disabled?
210
- if ( ! bp_activity_do_mentions() ) {
211
- return $content;
212
- }
213
-
214
// Try to find mentions
215
$usernames = bp_activity_find_mentions( $content );
216
@@ -235,16 +232,11 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
235
*
236
* @since BuddyPress (1.5)
237
*
238
- * @param BP_Activity_Activity $activity
239
*
240
* @uses bp_activity_find_mentions()
241
*/
242
function bp_activity_at_name_filter_updates( $activity ) {
243
- // Are mentions disabled?
244
- if ( ! bp_activity_do_mentions() ) {
245
- return;
246
- }
247
-
248
// If activity was marked as spam, stop the rest of this function.
249
if ( ! empty( $activity->is_spam ) )
250
return;
@@ -273,17 +265,12 @@ function bp_activity_at_name_filter_updates( $activity ) {
273
*
274
* @since BuddyPress (1.7)
275
*
276
- * @param BP_Activity_Activity $activity The BP_Activity_Activity object
277
*
278
* @uses bp_activity_at_message_notification()
279
* @uses bp_activity_update_mention_count_for_user()
280
*/
281
function bp_activity_at_name_send_emails( $activity ) {
282
- // Are mentions disabled?
283
- if ( ! bp_activity_do_mentions() ) {
284
- return;
285
- }
286
-
287
// If our temporary variable doesn't exist, stop now.
288
if ( empty( buddypress()->activity->mentioned_users ) )
289
return;
@@ -339,7 +326,7 @@ function bp_activity_make_nofollow_filter( $text ) {
339
*
340
* @since BuddyPress (1.5)
341
*
342
- * @param string $text The original activity entry text
343
*
344
* @uses bp_is_single_activity()
345
* @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook
125
*
126
* @since BuddyPress (1.6)
127
* @param BP_Activity_Activity $activity
128
+ * @return If activity type is not an update or comment
129
*/
130
function bp_activity_check_moderation_keys( $activity ) {
131
144
*
145
* @since BuddyPress (1.6)
146
* @param BP_Activity_Activity $activity
147
+ * @return If activity type is not an update or comment
148
*/
149
function bp_activity_check_blacklist_keys( $activity ) {
150
208
*/
209
function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
210
211
// Try to find mentions
212
$usernames = bp_activity_find_mentions( $content );
213
232
*
233
* @since BuddyPress (1.5)
234
*
235
+ * @param obj $activity
236
*
237
* @uses bp_activity_find_mentions()
238
*/
239
function bp_activity_at_name_filter_updates( $activity ) {
240
// If activity was marked as spam, stop the rest of this function.
241
if ( ! empty( $activity->is_spam ) )
242
return;
265
*
266
* @since BuddyPress (1.7)
267
*
268
+ * @param obj $activity The BP_Activity_Activity object
269
*
270
* @uses bp_activity_at_message_notification()
271
* @uses bp_activity_update_mention_count_for_user()
272
*/
273
function bp_activity_at_name_send_emails( $activity ) {
274
// If our temporary variable doesn't exist, stop now.
275
if ( empty( buddypress()->activity->mentioned_users ) )
276
return;
326
*
327
* @since BuddyPress (1.5)
328
*
329
+ * @param $text The original activity entry text
330
*
331
* @uses bp_is_single_activity()
332
* @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook
bp-activity/bp-activity-functions.php CHANGED
@@ -27,30 +27,6 @@ function bp_activity_has_directory() {
27
return (bool) !empty( $bp->pages->activity->id );
28
}
29
30
- /**
31
- * Are mentions enabled or disabled?
32
- *
33
- * The Mentions feature does a number of things, all of which will be turned
34
- * off if you disable mentions:
35
- * - Detecting and auto-linking @username in all BP/WP content
36
- * - Sending BP notifications and emails to users when they are mentioned
37
- * using the @username syntax
38
- * - The Public Message button on user profiles
39
- *
40
- * Mentions are enabled by default. To disable, put the following line in
41
- * bp-custom.php or your theme's functions.php file:
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
- * @return bool $retval True to enable mentions, false to disable.
49
- */
50
- function bp_activity_do_mentions() {
51
- return (bool) apply_filters( 'bp_activity_do_mentions', true );
52
- }
53
-
54
/**
55
* Searches through the content of an activity item to locate usernames,
56
* designated by an @ sign.
@@ -391,7 +367,7 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
391
$user_id = bp_loggedin_user_id();
392
393
// Update the user's personal favorites
394
- $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
395
$my_favs[] = $activity_id;
396
397
// Update the total number of users who have favorited this activity
@@ -399,7 +375,7 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
399
$fav_count = !empty( $fav_count ) ? (int) $fav_count + 1 : 1;
400
401
// Update user meta
402
- bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs );
403
404
// Update activity meta counts
405
if ( true === bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count ) ) {
@@ -905,7 +881,6 @@ function bp_activity_get( $args = '' ) {
905
'display_comments' => false, // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
906
907
'search_terms' => false, // Pass search terms as a string
908
- 'meta_query' => false, // Filter by activity meta. See WP_Meta_Query for format
909
'show_hidden' => false, // Show activity items that are hidden site-wide?
910
'exclude' => false, // Comma-separated list of activity IDs to exclude
911
'in' => false, // Comma-separated list or array of activity IDs to which you want to limit the query
@@ -927,7 +902,7 @@ function bp_activity_get( $args = '' ) {
927
extract( $r, EXTR_SKIP );
928
929
// Attempt to return a cached copy of the first page of sitewide activity.
930
- 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 ) {
931
if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
932
$args = array(
933
'page' => $page,
@@ -935,7 +910,6 @@ function bp_activity_get( $args = '' ) {
935
'max' => $max,
936
'sort' => $sort,
937
'search_terms' => $search_terms,
938
- 'meta_query' => $meta_query,
939
'filter' => $filter,
940
'display_comments' => $display_comments,
941
'show_hidden' => $show_hidden,
@@ -952,7 +926,6 @@ function bp_activity_get( $args = '' ) {
952
'max' => $max,
953
'sort' => $sort,
954
'search_terms' => $search_terms,
955
- 'meta_query' => $meta_query,
956
'filter' => $filter,
957
'display_comments' => $display_comments,
958
'show_hidden' => $show_hidden,
@@ -1130,10 +1103,10 @@ function bp_activity_post_update( $args = '' ) {
1130
'type' => 'activity_update'
1131
) );
1132
1133
- $activity_content = apply_filters( 'bp_activity_latest_update_content', $content, $activity_content );
1134
1135
// Add this update to the "latest update" usermeta so it can be fetched anywhere.
1136
- bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $activity_content ) );
1137
1138
do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
1139
@@ -1525,15 +1498,13 @@ function bp_activity_hide_user_activity( $user_id ) {
1525
*
1526
* @param string $content The content to work with
1527
* @param string $link Optional. The URL that the image should link to
1528
- * @param array $activity_args Optional. The args passed to the activity
1529
- * creation function (eg bp_blogs_record_activity())
1530
*
1531
* @uses esc_attr()
1532
* @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
1533
*
1534
* @return string $content The content with images stripped and replaced with a single thumb.
1535
*/
1536
- function bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) {
1537
1538
preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
1539
@@ -1572,7 +1543,7 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
1572
}
1573
}
1574
1575
- return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
1576
}
1577
1578
/**
27
return (bool) !empty( $bp->pages->activity->id );
28
}
29
30
/**
31
* Searches through the content of an activity item to locate usernames,
32
* designated by an @ sign.
367
$user_id = bp_loggedin_user_id();
368
369
// Update the user's personal favorites
370
+ $my_favs = bp_get_user_meta( bp_loggedin_user_id(), 'bp_favorite_activities', true );
371
$my_favs[] = $activity_id;
372
373
// Update the total number of users who have favorited this activity
375
$fav_count = !empty( $fav_count ) ? (int) $fav_count + 1 : 1;
376
377
// Update user meta
378
+ bp_update_user_meta( bp_loggedin_user_id(), 'bp_favorite_activities', $my_favs );
379
380
// Update activity meta counts
381
if ( true === bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count ) ) {
881
'display_comments' => false, // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
882
883
'search_terms' => false, // Pass search terms as a string
884
'show_hidden' => false, // Show activity items that are hidden site-wide?
885
'exclude' => false, // Comma-separated list of activity IDs to exclude
886
'in' => false, // Comma-separated list or array of activity IDs to which you want to limit the query
902
extract( $r, EXTR_SKIP );
903
904
// Attempt to return a cached copy of the first page of sitewide activity.
905
+ if ( 1 == (int) $page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && empty( $exclude ) && empty( $in ) && 'DESC' == $sort && empty( $exclude ) && 'ham_only' == $spam ) {
906
if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
907
$args = array(
908
'page' => $page,
910
'max' => $max,
911
'sort' => $sort,
912
'search_terms' => $search_terms,
913
'filter' => $filter,
914
'display_comments' => $display_comments,
915
'show_hidden' => $show_hidden,
926
'max' => $max,
927
'sort' => $sort,
928
'search_terms' => $search_terms,
929
'filter' => $filter,
930
'display_comments' => $display_comments,
931
'show_hidden' => $show_hidden,
1103
'type' => 'activity_update'
1104
) );
1105
1106
+ $activity_content = apply_filters( 'bp_activity_latest_update_content', $content );
1107
1108
// Add this update to the "latest update" usermeta so it can be fetched anywhere.
1109
+ bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $content ) );
1110
1111
do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
1112
1498
*
1499
* @param string $content The content to work with
1500
* @param string $link Optional. The URL that the image should link to
1501
*
1502
* @uses esc_attr()
1503
* @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
1504
*
1505
* @return string $content The content with images stripped and replaced with a single thumb.
1506
*/
1507
+ function bp_activity_thumbnail_content_images( $content, $link = false ) {
1508
1509
preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
1510
1543
}
1544
}
1545
1546
+ return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches );
1547
}
1548
1549
/**
bp-activity/bp-activity-loader.php CHANGED
@@ -150,17 +150,15 @@ class BP_Activity_Component extends BP_Component {
150
);
151
152
// @ mentions
153
- if ( bp_activity_do_mentions() ) {
154
- $sub_nav[] = array(
155
- 'name' => __( 'Mentions', 'buddypress' ),
156
- 'slug' => 'mentions',
157
- 'parent_url' => $activity_link,
158
- 'parent_slug' => $this->slug,
159
- 'screen_function' => 'bp_activity_screen_mentions',
160
- 'position' => 20,
161
- 'item_css_id' => 'activity-mentions'
162
- );
163
- }
164
165
// Favorite activity items
166
$sub_nav[] = array(
@@ -230,13 +228,11 @@ class BP_Activity_Component extends BP_Component {
230
$activity_link = trailingslashit( $user_domain . $this->slug );
231
232
// Unread message count
233
- if ( bp_activity_do_mentions() ) {
234
- $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
235
- if ( !empty( $count ) ) {
236
- $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
237
- } else {
238
- $title = __( 'Mentions', 'buddypress' );
239
- }
240
}
241
242
// Add the "Activity" sub menu
@@ -248,14 +244,12 @@ class BP_Activity_Component extends BP_Component {
248
);
249
250
// Mentions
251
- if ( bp_activity_do_mentions() ) {
252
- $wp_admin_nav[] = array(
253
- 'parent' => 'my-account-' . $this->id,
254
- 'id' => 'my-account-' . $this->id . '-mentions',
255
- 'title' => $title,
256
- 'href' => trailingslashit( $activity_link . 'mentions' )
257
- );
258
- }
259
260
// Personal
261
$wp_admin_nav[] = array(
150
);
151
152
// @ mentions
153
+ $sub_nav[] = array(
154
+ 'name' => __( 'Mentions', 'buddypress' ),
155
+ 'slug' => 'mentions',
156
+ 'parent_url' => $activity_link,
157
+ 'parent_slug' => $this->slug,
158
+ 'screen_function' => 'bp_activity_screen_mentions',
159
+ 'position' => 20,
160
+ 'item_css_id' => 'activity-mentions'
161
+ );
162
163
// Favorite activity items
164
$sub_nav[] = array(
228
$activity_link = trailingslashit( $user_domain . $this->slug );
229
230
// Unread message count
231
+ $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
232
+ if ( !empty( $count ) ) {
233
+ $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
234
+ } else {
235
+ $title = __( 'Mentions', 'buddypress' );
236
}
237
238
// Add the "Activity" sub menu
244
);
245
246
// Mentions
247
+ $wp_admin_nav[] = array(
248
+ 'parent' => 'my-account-' . $this->id,
249
+ 'id' => 'my-account-' . $this->id . '-mentions',
250
+ 'title' => $title,
251
+ 'href' => trailingslashit( $activity_link . 'mentions' )
252
+ );
253
254
// Personal
255
$wp_admin_nav[] = array(
bp-activity/bp-activity-screens.php CHANGED
@@ -265,17 +265,11 @@ add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' );
265
*/
266
function bp_activity_screen_notification_settings() {
267
268
- if ( bp_activity_do_mentions() ) {
269
- if ( ! $mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) ) {
270
- $mention = 'yes';
271
- }
272
- }
273
-
274
- if ( ! $reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) ) {
275
- $reply = 'yes';
276
- }
277
278
- ?>
279
280
<table class="notification-settings" id="activity-notification-settings">
281
<thead>
@@ -288,15 +282,12 @@ function bp_activity_screen_notification_settings() {
288
</thead>
289
290
<tbody>
291
- <?php if ( bp_activity_do_mentions() ) : ?>
292
- <tr id="activity-notification-settings-mentions">
293
- <td>&nbsp;</td>
294
- <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td>
295
- <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td>
296
- <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td>
297
- </tr>
298
- <?php endif; ?>
299
-
300
<tr id="activity-notification-settings-replies">
301
<td>&nbsp;</td>
302
<td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
@@ -318,7 +309,7 @@ add_action( 'bp_notification_settings', 'bp_activity_screen_notification_setting
318
* The main theme compat class for BuddyPress Activity
319
*
320
* This class sets up the necessary theme compatability actions to safely output
321
- * activity template parts to the_title and the_content areas of a theme.
322
*
323
* @since BuddyPress (1.7)
324
*/
@@ -350,13 +341,11 @@ class BP_Activity_Theme_Compat {
350
351
do_action( 'bp_activity_screen_index' );
352
353
- add_filter( 'bp_get_buddypress_template', array( $this, 'directory_template_hierarchy' ) );
354
add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
355
add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) );
356
357
// Single activity
358
} elseif ( bp_is_single_activity() ) {
359
- add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) );
360
add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) );
361
add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) );
362
}
@@ -364,29 +353,6 @@ class BP_Activity_Theme_Compat {
364
365
/** Directory *************************************************************/
366
367
- /**
368
- * Add template hierarchy to theme compat for the activity directory page.
369
- *
370
- * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
371
- *
372
- * @since BuddyPress (1.8)
373
- *
374
- * @param string $templates The templates from bp_get_theme_compat_templates()
375
- * @return array $templates Array of custom templates to look for.
376
- */
377
- public function directory_template_hierarchy( $templates ) {
378
- // Setup our templates based on priority
379
- $new_templates = apply_filters( 'bp_template_hierarchy_activity_directory', array(
380
- 'activity/index-directory.php'
381
- ) );
382
-
383
- // Merge new templates with existing stack
384
- // @see bp_get_theme_compat_templates()
385
- $templates = array_merge( (array) $new_templates, $templates );
386
-
387
- return $templates;
388
- }
389
-
390
/**
391
* Update the global $post with directory data
392
*
@@ -417,29 +383,6 @@ class BP_Activity_Theme_Compat {
417
418
/** Single ****************************************************************/
419
420
- /**
421
- * Add custom template hierarchy to theme compat for activity permalink pages.
422
- *
423
- * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
424
- *
425
- * @since BuddyPress (1.8)
426
- *
427
- * @param string $templates The templates from bp_get_theme_compat_templates()
428
- * @return array $templates Array of custom templates to look for.
429
- */
430
- public function single_template_hierarchy( $templates ) {
431
- // Setup our templates based on priority
432
- $new_templates = apply_filters( 'bp_template_hierarchy_activity_single_item', array(
433
- 'activity/single/index.php'
434
- ) );
435
-
436
- // Merge new templates with existing stack
437
- // @see bp_get_theme_compat_templates()
438
- $templates = array_merge( (array) $new_templates, $templates );
439
-
440
- return $templates;
441
- }
442
-
443
/**
444
* Update the global $post with the displayed user's data
445
*
265
*/
266
function bp_activity_screen_notification_settings() {
267
268
+ if ( !$mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) )
269
+ $mention = 'yes';
270
271
+ if ( !$reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) )
272
+ $reply = 'yes'; ?>
273
274
<table class="notification-settings" id="activity-notification-settings">
275
<thead>
282
</thead>
283
284
<tbody>
285
+ <tr id="activity-notification-settings-mentions">
286
+ <td>&nbsp;</td>
287
+ <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td>
288
+ <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td>
289
+ <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td>
290
+ </tr>
291
<tr id="activity-notification-settings-replies">
292
<td>&nbsp;</td>
293
<td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
309
* The main theme compat class for BuddyPress Activity
310
*
311
* This class sets up the necessary theme compatability actions to safely output
312
+ * group template parts to the_title and the_content areas of a theme.
313
*
314
* @since BuddyPress (1.7)
315
*/
341
342
do_action( 'bp_activity_screen_index' );
343
344
add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
345
add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) );
346
347
// Single activity
348
} elseif ( bp_is_single_activity() ) {
349
add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) );
350
add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) );
351
}
353
354
/** Directory *************************************************************/
355
356
/**
357
* Update the global $post with directory data
358
*
383
384
/** Single ****************************************************************/
385
386
/**
387
* Update the global $post with the displayed user's data
388
*
bp-activity/bp-activity-template.php CHANGED
@@ -150,7 +150,6 @@ class BP_Activity_Template {
150
'in' => false,
151
'filter' => false,
152
'search_terms' => false,
153
- 'meta_query' => false,
154
'display_comments' => 'threaded',
155
'show_hidden' => false,
156
'spam' => 'ham_only',
@@ -173,7 +172,7 @@ class BP_Activity_Template {
173
174
// Fetch all activity items
175
else
176
- $this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'meta_query' => $meta_query, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam ) );
177
178
if ( !$max || $max >= (int) $this->activities['total'] )
179
$this->total_activity_count = (int) $this->activities['total'];
@@ -362,8 +361,6 @@ function bp_has_activities( $args = '' ) {
362
'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
363
'secondary_id' => false, // secondary object ID to filter on e.g. a post_id
364
365
- 'meta_query' => false, // filter on activity meta. See WP_Meta_Query for format
366
-
367
// Searching
368
'search_terms' => false // specify terms to search on
369
);
@@ -413,17 +410,11 @@ function bp_has_activities( $args = '' ) {
413
if ( empty( $favs ) )
414
return false;
415
416
- $in = implode( ',', (array) $favs );
417
$display_comments = true;
418
- $user_id = 0;
419
break;
420
case 'mentions':
421
422
- // Are mentions disabled?
423
- if ( ! bp_activity_do_mentions() ) {
424
- return false;
425
- }
426
-
427
// Start search at @ symbol and stop search at closing tag delimiter.
428
$search_terms = '@' . bp_core_get_username( $user_id ) . '<';
429
$display_comments = 'stream';
@@ -462,7 +453,6 @@ function bp_has_activities( $args = '' ) {
462
'in' => $in,
463
'filter' => $filter,
464
'search_terms' => $search_terms,
465
- 'meta_query' => $meta_query,
466
'display_comments' => $display_comments,
467
'show_hidden' => $show_hidden,
468
'spam' => $spam
@@ -682,7 +672,7 @@ function bp_activities_no_activity() {
682
* @global string $bp_activity_no_activity
683
* @uses apply_filters() To call the 'bp_get_activities_no_activity' hook
684
*
685
- * @return string
686
*/
687
function bp_get_activities_no_activity() {
688
global $bp_activity_no_activity;
@@ -1083,14 +1073,14 @@ function bp_activity_secondary_avatar( $args = '' ) {
1083
case 'groups' :
1084
$object = 'group';
1085
$item_id = $activities_template->activity->item_id;
1086
- $link = '';
1087
- $name = '';
1088
1089
// Only if groups is active
1090
if ( bp_is_active( 'groups' ) ) {
1091
$group = groups_get_group( array( 'group_id' => $item_id ) );
1092
$link = bp_get_group_permalink( $group );
1093
$name = $group->name;
1094
}
1095
1096
if ( empty( $alt ) ) {
@@ -2029,34 +2019,6 @@ function bp_activity_thread_permalink() {
2029
return apply_filters( 'bp_get_activity_thread_permalink', $link );
2030
}
2031
2032
- /**
2033
- * Echoes the activity comment permalink
2034
- *
2035
- * @since BuddyPress (1.8)
2036
- *
2037
- * @uses bp_get_activity_permalink_id()
2038
- */
2039
- function bp_activity_comment_permalink() {
2040
- echo bp_get_activity_comment_permalink();
2041
- }
2042
- /**
2043
- * Gets the activity comment permalink
2044
- *
2045
- * @since BuddyPress (1.8)
2046
- *
2047
- * @uses bp_activity_get_permalink()
2048
- * @uses apply_filters() To call the 'bp_get_activity_comment_permalink' hook
2049
- *
2050
- * @return string $link The activity comment permalink
2051
- */
2052
- function bp_get_activity_comment_permalink() {
2053
- global $activities_template;
2054
-
2055
- $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '#acomment-' . $activities_template->activity->current_comment->id;
2056
-
2057
- return apply_filters( 'bp_get_activity_comment_permalink', $link );
2058
- }
2059
-
2060
/**
2061
* Echoes the activity favorite link
2062
*
@@ -2433,10 +2395,6 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
2433
* @return int The total favorite count for a specified user
2434
*/
2435
function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
2436
- if ( ! $user_id ) {
2437
- $user_id = bp_displayed_user_id();
2438
- }
2439
-
2440
return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
2441
}
2442
@@ -2450,7 +2408,7 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
2450
* @uses bp_get_total_favorite_count_for_user()
2451
*/
2452
function bp_total_mention_count_for_user( $user_id = 0 ) {
2453
- echo bp_get_total_mention_count_for_user( $user_id );
2454
}
2455
2456
/**
@@ -2464,10 +2422,6 @@ function bp_total_mention_count_for_user( $user_id = 0 ) {
2464
* @return int The total mention count for a specified user
2465
*/
2466
function bp_get_total_mention_count_for_user( $user_id = 0 ) {
2467
- if ( ! $user_id ) {
2468
- $user_id = bp_displayed_user_id();
2469
- }
2470
-
2471
return apply_filters( 'bp_get_total_mention_count_for_user', bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) );
2472
}
2473
@@ -2504,7 +2458,7 @@ function bp_send_public_message_link() {
2504
if ( bp_is_my_profile() || !is_user_logged_in() )
2505
return false;
2506
2507
- return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_get_activity_directory_permalink() . '?r=' . bp_core_get_username( bp_displayed_user_id(), bp_get_displayed_user_username(), $bp->displayed_user->userdata->user_login ) ) );
2508
}
2509
2510
/**
@@ -2803,7 +2757,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
2803
$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/';
2804
elseif ( 'favorites' == bp_current_action() )
2805
$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
2806
- elseif ( 'mentions' == bp_current_action() && bp_activity_do_mentions() )
2807
$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
2808
else
2809
$link = '';
150
'in' => false,
151
'filter' => false,
152
'search_terms' => false,
153
'display_comments' => 'threaded',
154
'show_hidden' => false,
155
'spam' => 'ham_only',
172
173
// Fetch all activity items
174
else
175
+ $this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam ) );
176
177
if ( !$max || $max >= (int) $this->activities['total'] )
178
$this->total_activity_count = (int) $this->activities['total'];
361
'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
362
'secondary_id' => false, // secondary object ID to filter on e.g. a post_id
363
364
// Searching
365
'search_terms' => false // specify terms to search on
366
);
410
if ( empty( $favs ) )
411
return false;
412
413
+ $include = implode( ',', (array) $favs );
414
$display_comments = true;
415
break;
416
case 'mentions':
417
418
// Start search at @ symbol and stop search at closing tag delimiter.
419
$search_terms = '@' . bp_core_get_username( $user_id ) . '<';
420
$display_comments = 'stream';
453
'in' => $in,
454
'filter' => $filter,
455
'search_terms' => $search_terms,
456
'display_comments' => $display_comments,
457
'show_hidden' => $show_hidden,
458
'spam' => $spam
672
* @global string $bp_activity_no_activity
673
* @uses apply_filters() To call the 'bp_get_activities_no_activity' hook
674
*
675
+ * @return unknown_type
676
*/
677
function bp_get_activities_no_activity() {
678
global $bp_activity_no_activity;
1073
case 'groups' :
1074
$object = 'group';
1075
$item_id = $activities_template->activity->item_id;
1076
1077
// Only if groups is active
1078
if ( bp_is_active( 'groups' ) ) {
1079
$group = groups_get_group( array( 'group_id' => $item_id ) );
1080
$link = bp_get_group_permalink( $group );
1081
$name = $group->name;
1082
+ } else {
1083
+ $name = '';
1084
}
1085
1086
if ( empty( $alt ) ) {
2019
return apply_filters( 'bp_get_activity_thread_permalink', $link );
2020
}
2021
2022
/**
2023
* Echoes the activity favorite link
2024
*
2395
* @return int The total favorite count for a specified user
2396
*/
2397
function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
2398
return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
2399
}
2400
2408
* @uses bp_get_total_favorite_count_for_user()
2409
*/
2410
function bp_total_mention_count_for_user( $user_id = 0 ) {
2411
+ echo bp_get_total_favorite_count_for_user( $user_id );
2412
}
2413
2414
/**
2422
* @return int The total mention count for a specified user
2423
*/
2424
function bp_get_total_mention_count_for_user( $user_id = 0 ) {
2425
return apply_filters( 'bp_get_total_mention_count_for_user', bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) );
2426
}
2427
2458
if ( bp_is_my_profile() || !is_user_logged_in() )
2459
return false;
2460
2461
+ return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( bp_displayed_user_id(), bp_get_displayed_user_username(), $bp->displayed_user->userdata->user_login ) ) );
2462
}
2463
2464
/**
2757
$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/';
2758
elseif ( 'favorites' == bp_current_action() )
2759
$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
2760
+ elseif ( 'mentions' == bp_current_action() )
2761
$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
2762
else
2763
$link = '';
bp-activity/feeds/bp-activity-favorites-feed.php ADDED
@@ -0,0 +1,74 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying a member's favorite activity
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_favorites_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Favorited activity RSS title - "[Site Name] | [Displayed User Name] | Favorite Activity" */ ?>
27
+ <title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'Favorite Activity', 'buddypress' ) ) ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo home_url( bp_get_activity_root_slug() . '/#my-favorites/' ) ?></link>
30
+ <description><?php printf( __( '%s - Favorite Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
31
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
+
35
+ <?php do_action('bp_activity_favorites_feed_head'); ?>
36
+
37
+ <?php
38
+ $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
39
+ $fav_ids = implode( ',', (array) $favs );
40
+ ?>
41
+
42
+ <?php if ( bp_has_activities( 'include=' . $fav_ids . '&max=50&display_comments=stream' ) ) : ?>
43
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
44
+
45
+ <item>
46
+ <guid><?php bp_activity_thread_permalink() ?></guid>
47
+ <title><?php bp_activity_feed_item_title() ?></title>
48
+ <link><?php echo bp_activity_thread_permalink() ?></link>
49
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
50
+
51
+ <description>
52
+ <![CDATA[
53
+ <?php bp_activity_feed_item_description() ?>
54
+
55
+ <?php if ( bp_activity_can_comment() ) : ?>
56
+ <p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
57
+ <?php endif; ?>
58
+
59
+ <?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
60
+ <br /><strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
61
+ <?php bp_activity_parent_content() ?>
62
+ <?php endif; ?>
63
+ ]]>
64
+ </description>
65
+
66
+ <?php do_action('bp_activity_favorites_feed_item'); ?>
67
+
68
+ </item>
69
+
70
+ <?php endwhile; ?>
71
+ <?php endif; ?>
72
+
73
+ </channel>
74
+ </rss>
bp-activity/feeds/bp-activity-friends-feed.php ADDED
@@ -0,0 +1,64 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying a member's friends activity stream.
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_friends_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Member friends activity RSS title - "[Site Name] | Friends Activity" */ ?>
27
+ <title><?php bp_site_name() ?> | <?php bp_displayed_user_fullname(); ?> | <?php _e( 'Friends Activity', 'buddypress' ); ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed'; ?></link>
30
+ <description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ); ?></description>
31
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION; ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
+ <?php do_action('bp_activity_friends_feed_head'); ?>
35
+
36
+ <?php if ( bp_has_activities( 'scope=friends&max=50&display_comments=stream' ) ) : ?>
37
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
38
+ <item>
39
+ <guid><?php bp_activity_thread_permalink(); ?></guid>
40
+ <title><?php bp_activity_feed_item_title(); ?></title>
41
+ <link><?php echo bp_activity_thread_permalink(); ?></link>
42
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
43
+
44
+ <description>
45
+ <![CDATA[
46
+ <?php bp_activity_feed_item_description(); ?>
47
+
48
+ <?php if ( bp_activity_can_comment() ) : ?>
49
+ <p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
50
+ <?php endif; ?>
51
+
52
+ <?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
53
+ <br /><strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> -
54
+ <?php bp_activity_parent_content(); ?>
55
+ <?php endif; ?>
56
+ ]]>
57
+ </description>
58
+ <?php do_action('bp_activity_personal_feed_item'); ?>
59
+ </item>
60
+ <?php endwhile; ?>
61
+
62
+ <?php endif; ?>
63
+ </channel>
64
+ </rss>
bp-activity/feeds/bp-activity-group-feed.php ADDED
@@ -0,0 +1,59 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying a group activity stream
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_group_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Single group activity RSS title - "[Site Name] | [Group Name] | Group Activity" */ ?>
27
+ <title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_current_group_name(), __( 'Group Activity', 'buddypress' ) ) ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo bp_get_group_permalink( $bp->groups->current_group ) . bp_get_activity_slug() . '/feed' ?></link>
30
+ <description><?php printf( __( '%s - Group Activity Feed', 'buddypress' ), $bp->groups->current_group->name ) ?></description>
31
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
+ <?php do_action('bp_activity_group_feed_head'); ?>
35
+
36
+ <?php if ( bp_has_activities( 'object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id . '&max=50&display_comments=threaded' ) ) : ?>
37
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
38
+ <item>
39
+ <guid><?php bp_activity_thread_permalink() ?></guid>
40
+ <title><?php bp_activity_feed_item_title() ?></title>
41
+ <link><?php echo bp_activity_thread_permalink() ?></link>
42
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
43
+
44
+ <description>
45
+ <![CDATA[
46
+ <?php bp_activity_feed_item_description() ?>
47
+
48
+ <?php if ( bp_activity_can_comment() ) : ?>
49
+ <p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
50
+ <?php endif; ?>
51
+ ]]>
52
+ </description>
53
+ <?php do_action('bp_activity_group_feed_item'); ?>
54
+ </item>
55
+ <?php endwhile; ?>
56
+
57
+ <?php endif; ?>
58
+ </channel>
59
+ </rss>
bp-activity/feeds/bp-activity-mentions-feed.php ADDED
@@ -0,0 +1,65 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying a member's activity mentions
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_mentions_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | Mentions" */ ?>
27
+ <title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'Mentions', 'buddypress' ) ) ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo home_url( bp_get_activity_root_slug() . '/#mentions/' ) ?></link>
30
+ <?php /* translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | Mentions" */ ?>
31
+ <description><?php printf( __( '%s - Mentions', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
32
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
+ <language><?php bloginfo_rss( 'language' ); ?></language>
35
+ <?php do_action('bp_activity_mentions_feed_head'); ?>
36
+
37
+ <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id() ) ) ) : ?>
38
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
39
+ <item>
40
+ <guid><?php bp_activity_thread_permalink() ?></guid>
41
+ <title><?php bp_activity_feed_item_title() ?></title>
42
+ <link><?php echo bp_activity_thread_permalink() ?></link>
43
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
44
+
45
+ <description>
46
+ <![CDATA[
47
+ <?php bp_activity_feed_item_description() ?>
48
+
49
+ <?php if ( bp_activity_can_comment() ) : ?>
50
+ <p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
51
+ <?php endif; ?>
52
+
53
+ <?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
54
+ <br /><strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
55
+ <?php bp_activity_parent_content() ?>
56
+ <?php endif; ?>
57
+ ]]>
58
+ </description>
59
+ <?php do_action('bp_activity_mentions_feed_item'); ?>
60
+ </item>
61
+ <?php endwhile; ?>
62
+
63
+ <?php endif; ?>
64
+ </channel>
65
+ </rss>
bp-activity/feeds/bp-activity-mygroups-feed.php ADDED
@@ -0,0 +1,65 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying a member's group's activity
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_mygroups_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Member groups activity RSS title - "[Site Name] | [Displayed User Name] | My Groups - Public Activity" */ ?>
27
+ <title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'My Groups - Public Activity', 'buddypress' ) ) ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo home_url( bp_get_activity_root_slug() . '/#my-groups/' ) ?></link>
30
+ <?php /* translators: Member groups activity RSS description - "[Displayed user name] - My Groups - Public Activity" */ ?>
31
+ <description><?php printf( __( '%1$s - My Groups - Public Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
32
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
33
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
34
+ <language><?php bloginfo_rss( 'language' ); ?></language>
35
+ <?php do_action('bp_activity_mygroups_feed_head'); ?>
36
+
37
+ <?php
38
+ $groups = groups_get_user_groups( bp_loggedin_user_id() );
39
+ $group_ids = implode( ',', $groups['groups'] );
40
+ ?>
41
+
42
+ <?php if ( bp_has_activities( 'object=' . $bp->groups->id . '&primary_id=' . $group_ids . '&max=50&display_comments=threaded' ) ) : ?>
43
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
44
+ <item>
45
+ <guid><?php bp_activity_thread_permalink() ?></guid>
46
+ <title><?php bp_activity_feed_item_title() ?></title>
47
+ <link><?php echo bp_activity_thread_permalink() ?></link>
48
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
49
+
50
+ <description>
51
+ <![CDATA[
52
+ <?php bp_activity_feed_item_description() ?>
53
+
54
+ <?php if ( bp_activity_can_comment() ) : ?>
55
+ <p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
56
+ <?php endif; ?>
57
+ ]]>
58
+ </description>
59
+ <?php do_action('bp_activity_mygroups_feed_item'); ?>
60
+ </item>
61
+ <?php endwhile; ?>
62
+
63
+ <?php endif; ?>
64
+ </channel>
65
+ </rss>
bp-activity/feeds/bp-activity-personal-feed.php ADDED
@@ -0,0 +1,64 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying a member's activity stream.
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_personal_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Personal activity RSS title - "[Site Name] | [Displayed User Name] | Activity" */ ?>
27
+ <title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'Activity', 'buddypress' ) ) ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo bp_displayed_user_domain() . bp_get_activity_slug() . '/feed' ?></link>
30
+ <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
31
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34
+ <?php do_action('bp_activity_personal_feed_head'); ?>
35
+
36
+ <?php if ( bp_has_activities( 'user_id=' . bp_displayed_user_id() . '&max=50&display_comments=stream' ) ) : ?>
37
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
38
+ <item>
39
+ <guid><?php bp_activity_thread_permalink() ?></guid>
40
+ <title><?php bp_activity_feed_item_title() ?></title>
41
+ <link><?php echo bp_activity_thread_permalink() ?></link>
42
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
43
+
44
+ <description>
45
+ <![CDATA[
46
+ <?php bp_activity_feed_item_description() ?>
47
+
48
+ <?php if ( bp_activity_can_comment() ) : ?>
49
+ <p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
50
+ <?php endif; ?>
51
+
52
+ <?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
53
+ <br /><strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
54
+ <?php bp_activity_parent_content() ?>
55
+ <?php endif; ?>
56
+ ]]>
57
+ </description>
58
+ <?php do_action('bp_activity_personal_feed_item'); ?>
59
+ </item>
60
+ <?php endwhile; ?>
61
+
62
+ <?php endif; ?>
63
+ </channel>
64
+ </rss>
bp-activity/feeds/bp-activity-sitewide-feed.php ADDED
@@ -0,0 +1,59 @@
1
+ <?php
2
+
3
+ /**
4
+ * RSS2 Feed Template for displaying the site wide activity stream.
5
+ *
6
+ * @package BuddyPress
7
+ * @subpackage ActivityFeeds
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( !defined( 'ABSPATH' ) ) exit;
12
+
13
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
14
+ header('Status: 200 OK');
15
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
16
+
17
+ <rss version="2.0"
18
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
19
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21
+ xmlns:atom="http://www.w3.org/2005/Atom"
22
+ <?php do_action('bp_activity_sitewide_feed'); ?>
23
+ >
24
+
25
+ <channel>
26
+ <?php /* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */ ?>
27
+ <title><?php printf( '%1$s | %2$s', bp_get_site_name(), __( 'Site Wide Activity', 'buddypress' ) ) ?></title>
28
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
29
+ <link><?php echo bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed' ?></link>
30
+ <description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description>
31
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
32
+ <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
33
+ <language><?php bloginfo_rss( 'language' ); ?></language>
34